From ec54613ecac5c15b6055cc98c370f24a958ba3d2 Mon Sep 17 00:00:00 2001 From: georapbox Date: Sun, 14 Jan 2024 16:32:07 +0200 Subject: [PATCH] Create build --- docs/{index.6d051d2c.js => index.0ec871bb.js} | 8 +++----- docs/index.0ec871bb.js.map | 1 + docs/index.2a3e2367.js.map | 1 - docs/index.6d051d2c.js.map | 1 - docs/{index.2a3e2367.js => index.bc158aed.js} | 8 +++----- docs/index.bc158aed.js.map | 1 + docs/index.html | 2 +- docs/service-worker.js | 2 +- docs/service-worker.js.map | 2 +- 9 files changed, 11 insertions(+), 15 deletions(-) rename docs/{index.6d051d2c.js => index.0ec871bb.js} (99%) create mode 100644 docs/index.0ec871bb.js.map delete mode 100644 docs/index.2a3e2367.js.map delete mode 100644 docs/index.6d051d2c.js.map rename docs/{index.2a3e2367.js => index.bc158aed.js} (99%) create mode 100644 docs/index.bc158aed.js.map diff --git a/docs/index.6d051d2c.js b/docs/index.0ec871bb.js similarity index 99% rename from docs/index.6d051d2c.js rename to docs/index.0ec871bb.js index 92c9ef0..af8cd6b 100644 --- a/docs/index.6d051d2c.js +++ b/docs/index.0ec871bb.js @@ -1,4 +1,4 @@ -function t(t){return t&&t.__esModule?t.default:t}var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},o={},i={},a=e.parcelRequire5078;function n(t){return null!==t&&"object"==typeof t?"share"in navigator&&"canShare"in navigator&&navigator.canShare(t):"share"in navigator}null==a&&((a=function(t){if(t in o)return o[t].exports;if(t in i){var e=i[t];delete i[t];var a={id:t,exports:{}};return o[t]=a,e.call(a.exports,a,a.exports),a.exports}var n=Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(t,e){i[t]=e},e.parcelRequire5078=a),(0,a.register)("kyEFX",function(t,e){Object.defineProperty(t.exports,"register",{get:function(){return o},set:function(t){return o=t},enumerable:!0,configurable:!0});var o,i=new Map;o=function(t,e){for(var o=0;o `;class R extends HTMLElement{#e=null;#t=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"}).appendChild(L.content.cloneNode(!0)),this.shadowRoot&&(this.#e=this.shadowRoot.getElementById("fileInput"),this.#t=this.shadowRoot.getElementById("dropzoneEl"))}static get observedAttributes(){return["accept","disabled","multiple","no-keyboard"]}attributeChangedCallback(t,e,o){"accept"===t&&e!==o&&this.#e&&(this.#e.accept=this.accept),"disabled"===t&&e!==o&&this.#e&&(this.#e.disabled=this.disabled,this.disabled?this.#t?.removeAttribute("tabindex"):this.#t?.setAttribute("tabindex","0")),"multiple"===t&&e!==o&&this.#e&&(this.#e.multiple=this.multiple),"no-keyboard"===t&&e!==o&&this.#t&&(this.noKeyboard?this.#t.removeAttribute("tabindex"):this.#t.setAttribute("tabindex","0"))}connectedCallback(){this.#r("accept"),this.#r("disabled"),this.#r("maxFiles"),this.#r("maxSize"),this.#r("minSize"),this.#r("multiple"),this.#r("noClick"),this.#r("noDrag"),this.#r("noKeyboard"),this.#r("autoFocus"),this.#r("noStyle"),this.#e?.addEventListener("change",this.#i),this.#t?.addEventListener("dragenter",this.#a),this.#t?.addEventListener("dragover",this.#n),this.#t?.addEventListener("dragleave",this.#s),this.#t?.addEventListener("drop",this.#o),this.#t?.addEventListener("click",this.#h),this.#t?.addEventListener("keyup",this.#l),this.autoFocus&&this.#t?.focus()}disconnectedCallback(){this.#e?.removeEventListener("change",this.#i),this.#t?.removeEventListener("dragenter",this.#a),this.#t?.removeEventListener("dragover",this.#n),this.#t?.removeEventListener("dragleave",this.#s),this.#t?.removeEventListener("drop",this.#o),this.#t?.removeEventListener("click",this.#h),this.#t?.removeEventListener("keyup",this.#l)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",null!=t?t.toString():t)}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",!!t)}get maxFiles(){let t=Number(this.getAttribute("max-files"))||0;return t<=0?1/0:Math.floor(Math.abs(t))}set maxFiles(t){this.setAttribute("max-files",null!=t?t.toString():t)}get maxSize(){let t=this.getAttribute("max-size");if(null===t)return 1/0;let e=Number(t);return Number.isNaN(e)?1/0:e}set maxSize(t){this.setAttribute("max-size",null!=t?t.toString():t)}get minSize(){let t=this.getAttribute("min-size");if(null===t)return 0;let e=Number(t);return Number.isNaN(e)?0:e}set minSize(t){this.setAttribute("min-size",null!=t?t.toString():t)}get multiple(){return this.hasAttribute("multiple")}set multiple(t){this.toggleAttribute("multiple",!!t)}get noClick(){return this.hasAttribute("no-click")}set noClick(t){this.toggleAttribute("no-click",!!t)}get noDrag(){return this.hasAttribute("no-drag")}set noDrag(t){this.toggleAttribute("no-drag",!!t)}get noKeyboard(){return this.hasAttribute("no-keyboard")}set noKeyboard(t){this.toggleAttribute("no-keyboard",!!t)}get autoFocus(){return this.hasAttribute("auto-focus")}set autoFocus(t){this.toggleAttribute("auto-focus",!!t)}get noStyle(){return this.hasAttribute("no-style")}set noStyle(t){this.toggleAttribute("no-style",!!t)}#i=async t=>{try{this.#m(await k(t))}catch(t){this.dispatchEvent(new CustomEvent(`${z}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}};#a=()=>{this.disabled||this.noDrag||this.dispatchEvent(new Event(`${z}-dragenter`,{bubbles:!0,composed:!0}))};#n=t=>{if(t.preventDefault(),this.disabled||this.noDrag){t.dataTransfer.dropEffect="none";return}t.dataTransfer.dropEffect="copy",this.#t&&(this.#t.classList.add("dropzone--dragover"),this.#t.part.add("dropzone--dragover")),this.dispatchEvent(new Event(`${z}-dragover`,{bubbles:!0,composed:!0}))};#s=()=>{this.disabled||this.noDrag||(this.#t&&(this.#t.classList.remove("dropzone--dragover"),this.#t.part.remove("dropzone--dragover")),this.dispatchEvent(new Event(`${z}-dragleave`,{bubbles:!0,composed:!0})))};#o=async t=>{if(!this.disabled&&!this.noDrag){t.preventDefault(),this.#t&&(this.#t.classList.remove("dropzone--dragover"),this.#t.part.remove("dropzone--dragover"));try{this.#m(await k(t))}catch(t){this.dispatchEvent(new CustomEvent(`${z}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}};#h=()=>{this.disabled||this.noClick||this.#e?.click()};#l=t=>{this.disabled||this.noKeyboard||" "!==t.key&&"Enter"!==t.key||this.#e?.click()};#m(t){if(!Array.isArray(t)||!t.length)return;let e=[],o=[],i=t.length;if(!this.multiple&&i>1)for(let e of t)o.push({file:e,errors:[{code:C,message:"Too many files selected. Only 1 file is allowed."}]});else if(this.multiple&&i>this.maxFiles)for(let e of t)o.push({file:e,errors:[{code:C,message:`Too many files selected. Only ${this.maxFiles} ${this.maxFiles>1?"files are":"file is"} allowed.`}]});else for(let i of t){let t=function(t,e=""){if(!e)return!0;let o=[...new Set(e.split(",").map(t=>t.trim()).filter(Boolean))],i=t.type,a=i.replace(/\/.*$/,"");for(let e of o)if("."===e.charAt(0)){if(-1!==t.name.toLowerCase().indexOf(e.toLowerCase(),t.name.length-e.length))return!0}else if(/\/\*$/.test(e)){if(a===e.replace(/\/.*$/,""))return!0}else if(i===e)return!0;return!1}(i,this.accept),a=i.size>this.maxSize,n=i.size0&&this.dispatchEvent(new CustomEvent(`${z}-drop-accepted`,{bubbles:!0,composed:!0,detail:{acceptedFiles:e}})),o.length>0&&this.dispatchEvent(new CustomEvent(`${z}-drop-rejected`,{bubbles:!0,composed:!0,detail:{rejectedFiles:o}})),this.#e&&(this.#e.value=this.#e.defaultValue)}openFileDialog(){this.disabled||this.#e?.click()}#r(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}static defineCustomElement(t=z){"undefined"==typeof window||window.customElements.get(t)||window.customElements.define(t,R)}}R.defineCustomElement();const T=(t,...e)=>{if(!Array.isArray(t))throw TypeError("Expected an array for first argument");return t.filter((t,o)=>-1===e.indexOf(o))},B=(t="",e="")=>{let o=Math.random().toString(36).substring(2,8);return`${"string"==typeof t&&""!==t?t+"-":""}${o}${"string"==typeof e&&""!==e?"-"+e:""}`},F=["image/jpg","image/jpeg","image/png","image/apng","image/gif","image/webp","image/avif"];var $={};$=new URL("Anton-Regular.e58ab3fe.ttf",import.meta.url).toString();var H={};H=new URL("Oswald-Regular.89ec7d89.ttf",import.meta.url).toString();var O={};O=new URL("Oswald-Bold.0f6a7ca6.ttf",import.meta.url).toString();var N={};N=new URL("Roboto-Regular.ca197847.ttf",import.meta.url).toString();var I={};I=new URL("Roboto-Bold.fdb9b54a.ttf",import.meta.url).toString();var M={};M=new URL("RobotoCondensed-Regular.d585f5c7.ttf",import.meta.url).toString();var q={};q=new URL("RobotoCondensed-Bold.e1f96d4b.ttf",import.meta.url).toString();var P={};P=new URL("CourierPrime-Regular.3a25a501.ttf",import.meta.url).toString();var j={};j=new URL("CourierPrime-Bold.3d6bf689.ttf",import.meta.url).toString();var U={};U=new URL("OpenSans-Regular.edf9e01b.ttf",import.meta.url).toString();var D={};D=new URL("OpenSans-Bold.8fceb72b.ttf",import.meta.url).toString();const X=[{name:"Anton",label:"Anton",path:t($),style:"normal",weight:"400"},{name:"Oswald-Regular",label:"Oswald",path:t(H),style:"normal",weight:"400"},{name:"Oswald-Bold",label:"Oswald Bold",path:t(O),style:"normal",weight:"700"},{name:"Roboto-Regular",label:"Roboto",path:t(N),style:"normal",weight:"400"},{name:"Roboto-Bold",label:"Roboto Bold",path:t(I),style:"normal",weight:"700"},{name:"RobotoCondensed-Regular",label:"Roboto Condensed",path:t(M),style:"normal",weight:"400"},{name:"RobotoCondensed-Bold",label:"Roboto Condensed Bold",path:t(q),style:"normal",weight:"700"},{name:"CourierPrime-Regular",label:"Courier Prime",path:t(P),style:"normal",weight:"400"},{name:"CourierPrime-Bold",label:"Courier Prime Bold",path:t(j),style:"normal",weight:"700"},{name:"OpenSans-Regular",label:"Open Sans",path:t(U),style:"normal",weight:"400"},{name:"OpenSans-Bold",label:"Open Sans Bold",path:t(D),style:"normal",weight:"400"}],Y=async(t,e,o={})=>{try{let i=new FontFace(t,`url(${e})`,{...o});await i.load(),document.fonts.add(i)}catch(t){console.error(t)}},V=async(t={})=>{let e=await fetch(t.url),o=await e.blob(),i=t.mimeType||o.type||"";if(!F.includes(i))throw Error(`This is not an accepted image format. Accepted MIME types are: ${F.join(", ")}`);return new File([o],t.filename||"",o)},W=document.getElementById("errorsContainer"),G=t=>{let e=t.currentTarget;e.removeEventListener("click",G),W.removeChild(e.parentNode)},K=(t="",e="info")=>{["info","warning","danger"].includes(e)||(e="info");let o=` ${t} - + `,i=document.createElement("div");i.className=`alert alert-${e} alert-dismissible text-break mb-2 fade`,i.innerHTML=o,i.querySelector("button").addEventListener("click",G),W.appendChild(i),setTimeout(()=>i.classList.add("show"),100)},Z=(t,e={})=>{let o=`
@@ -448,4 +446,4 @@ function t(t){return t&&t.__esModule?t.default:t}var e="undefined"!=typeof globa
`,i=document.createDocumentFragment(),a=document.createElement("div");return a.className="bg-light border shadow-sm mb-3 rounded",a.setAttribute("data-section","textBox"),a.setAttribute("data-index",t),a.innerHTML=o,a.querySelector('[data-input="font"]').value=e.font,a.querySelector('[data-input="textAlign"]').value=e.textAlign,a.querySelector('[data-input="allCaps"]').checked=e.allCaps,i.appendChild(a)},J=(t,e,o,i=[])=>{null!=t&&(o.clearRect(0,0,e.width,e.height),"string"==typeof t?(o.fillStyle=t,o.fillRect(0,0,e.width,e.height)):o.drawImage(t,0,0,e.width,e.height),i.forEach(function(t,i){o.font=`${t.fontWeight} ${t.fontSize}px ${t.font}`;let a=i+1,n=o.measureText("M").width+t.fontSize/2,s=e.width/2,r=t.shadowBlur,l=(!0===t.allCaps?t.text.toUpperCase():t.text).split("\n");o.fillStyle=t.fillColor,o.textAlign=t.textAlign,o.save(),0!==r&&(o.shadowOffsetX=0,o.shadowOffsetY=0,o.shadowBlur=r,o.shadowColor=t.shadowColor),t.rotate?(o.translate(s+t.offsetX,n*a+t.offsetY),o.rotate(t.rotate*Math.PI/180),l.forEach((t,e)=>o.fillText(t,0,e*n)),o.rotate(-(t.rotate*Math.PI/180)),o.translate(-(s+t.offsetX),-(n*a+t.offsetY))):l.forEach((e,i)=>{o.fillText(e,s+t.offsetX,i*n+n*a+t.offsetY)}),o.restore()}))},Q=document.getElementById("videoModal"),tt=document.getElementById("downloadModal"),te=document.getElementById("canvas"),to=document.querySelector("files-dropzone"),ti=document.getElementById("instructions"),ta=te.getContext("2d"),tn=document.getElementById("imageUploadMethodSelect"),ts=document.getElementById("fileSelectBtn"),tr=document.getElementById("imageUrlForm"),tl=document.getElementById("addTextboxBtn"),td=document.getElementById("inputsContainer"),tc=document.getElementById("generateMemeBtn"),th=document.getElementById("openVideoModalBtn"),tu=document.getElementById("downloadMemeBtn"),tp=document.getElementById("downloadMemePreview"),tm=document.querySelector("web-share"),tb=document.getElementById("gallery"),tg=document.getElementById("gallerySearch"),tf=tb.querySelector(".gallery__no-results"),tv=document.getElementById("solidColorForm"),ty=document.querySelectorAll(".upload-method");let tw=null,tE=null;const tx={_isSettingsOpen:!1,text:"",fillColor:"#ffffff",shadowColor:"#000000",font:"Anton",fontSize:40,fontWeight:"normal",textAlign:"center",shadowBlur:3,offsetY:0,offsetX:0,rotate:0,allCaps:!0};let tA=[{...tx}];const tS=async()=>{let t=te.toDataURL("image/png"),e=t.replace("image/png","image/octet-stream");if(tu.download=`${B("meme")}.png`,tu.href=e,tp.src=e,n())try{let e=await V({url:t,filename:`${B("meme")}.png`,mimeType:"image/png"}).catch(t=>K(t.message,"danger"));e&&n({files:[e]})&&(tm.shareFiles=[e],tm.hidden=!1)}catch(t){console.error(t)}tt.open=!0},tk=t=>{let e=t.target.width,o=t.target.height;e>o?e>800&&(o*=800/e,e=800):o>600&&(e*=600/o,o=600),te.width=e,te.height=o,J(tw=t.target,te,ta,tA),tc.disabled=!1,te.hidden=!1,ti.hidden=!0},tz=t=>{if(!t)return;let e=new Image,o=new FileReader;o.addEventListener("load",function(t){let o=t.target.result;e.addEventListener("load",tk),e.src=o}),o.readAsDataURL(t)},tC=(t,e,o)=>{"checkbox"===t.type?tA[e][o]=t.checked:"number"===t.type?tA[e][o]=Number(t.value):tA[e][o]=t.value,J(tw,te,ta,tA)},tL=async t=>{t.preventDefault();let e=t.target,o=e.querySelector('button[type="submit"]'),i=e.imageUrl.value;if(i.trim()){o.disabled=!0,o.querySelector(".spinner").hidden=!1,o.querySelector(".label").hidden=!0;try{let t=await V({url:i}).catch(t=>K(t.message,"danger"));t&&tz(t)}catch(t){K(`Failed to load image from "${i}".`,"danger")}finally{o.disabled=!1,o.querySelector(".spinner").hidden=!0,o.querySelector(".label").hidden=!1}}},t_=(t,e,o)=>()=>{let i=document.querySelectorAll('[data-section="textBox"]')[o],a=i.querySelector('[data-input="offsetY"]'),n=i.querySelector('[data-input="offsetX"]');"offsetY"===t&&("-"===e&&(tA[o].offsetY-=1),"+"===e&&(tA[o].offsetY+=1),a.value=tA[o].offsetY),"offsetX"===t&&("-"===e&&(tA[o].offsetX-=1),"+"===e&&(tA[o].offsetX+=1),n.value=tA[o].offsetX),J(tw,te,ta,tA),tE=requestAnimationFrame(t_(t,e,o))},tR=async t=>{let e=t.target.closest("button");if(!e)return;let o=e.querySelector("img");try{let t=await V({url:o.src}).catch(t=>K(t.message,"danger"));t&&tz(t)}catch(t){K(`Failed to load image: "${o.alt}".`,"danger")}};ts.addEventListener("click",()=>{"function"==typeof to.openFileDialog&&to.openFileDialog()}),th.addEventListener("click",()=>{Q.open=!0}),tl.addEventListener("click",()=>{let t=Z(tA.length,tx);tA.push({...tx}),td.appendChild(t),t.querySelector('[data-input="text"]').focus()}),tc.addEventListener("click",tS),tu.addEventListener("click",()=>tt.open=!1),tr.addEventListener("submit",tL),to.addEventListener("files-dropzone-drop-accepted",t=>{let[e]=t.detail.acceptedFiles;e&&tz(e)}),td.addEventListener("input",t=>{let e;let o=t.target,i=Number(o.closest('[data-section="textBox"]').getAttribute("data-index"));o.matches('[data-input="text"]')?e="text":o.matches('[data-input="fillColor"]')?e="fillColor":o.matches('[data-input="shadowColor"]')?e="shadowColor":o.matches('[data-input="font"]')?e="font":o.matches('[data-input="fontSize"]')?e="fontSize":o.matches('[data-input="fontWeight"]')?e="fontWeight":o.matches('[data-input="textAlign"]')?e="textAlign":o.matches('[data-input="shadowBlur"]')?e="shadowBlur":o.matches('[data-input="offsetY"]')?e="offsetY":o.matches('[data-input="offsetX"]')?e="offsetX":o.matches('[data-input="rotate"]')&&(e="rotate"),e&&tC(o,i,e)}),td.addEventListener("change",t=>{let e;let o=t.target,i=Number(o.closest('[data-section="textBox"]').getAttribute("data-index"));o.matches('[data-input="allCaps"]')&&(e="allCaps"),e&&tC(o,i,e)}),td.addEventListener("click",t=>{let e=t.target;if(e.matches('[data-button="settings"]')){let t=e.closest('[data-section="textBox"]').getAttribute("data-index");document.querySelectorAll('[data-section="textBox"]').forEach((e,o)=>{let i=e.querySelector('[data-section="settings"]');e.getAttribute("data-index")===t?(i.hidden=!i.hidden,tA[o]._isSettingsOpen=!tA[o]._isSettingsOpen):(i.hidden=!0,tA[o]._isSettingsOpen=!1)})}if(e.matches('[data-button="delete-text-box"]')){let t=Number(e.closest('[data-section="textBox"]').getAttribute("data-index")),o=!0;tA[t].text.trim()&&(o=window.confirm("Are you sure you want to remove this text box?")),o&&(tA=T(tA,t),td.querySelectorAll('[data-section="textBox"]').forEach(t=>t.remove()),tA.forEach((t,e)=>td.appendChild(Z(e,t))),J(tw,te,ta,tA))}}),td.addEventListener("pointerdown",t=>{let e=t.target;if(!e.closest('[data-section="textBox"]'))return;let o=Number(e.closest('[data-section="textBox"]').getAttribute("data-index")),i=e.matches('[data-move="offsetY"]'),a=e.matches('[data-move="offsetX"]');if(!i&&!a)return;let n=e.getAttribute("data-move"),s=e.getAttribute("data-sign");tE=requestAnimationFrame(t_(n,s,o))}),td.addEventListener("pointerup",t=>{let e=t.target,o=e.matches('[data-move="offsetY"]'),i=e.matches('[data-move="offsetX"]');(o||i)&&(cancelAnimationFrame(tE),tE=null)}),td.addEventListener("pointerout",t=>{let e=t.target,o=e.matches('[data-move="offsetY"]'),i=e.matches('[data-move="offsetX"]');(o||i)&&tE&&(cancelAnimationFrame(tE),tE=null)}),tn.addEventListener("change",t=>{ty.forEach(e=>e.hidden=e.id!==t.target.value)}),tb.addEventListener("click",tR),tg.addEventListener("input",t=>{let e=t.target.value.toLowerCase().trim();tb.querySelectorAll("button").forEach(t=>{let o=(t.querySelector("img").getAttribute("alt")||"").toLowerCase();t.hidden=!o.includes(e)}),tf.hidden=!!tb.querySelector("button:not([hidden])")}),tv.addEventListener("input",t=>{t.target===tv.canvasColor&&(tw=t.target.value),"string"==typeof tw&&(te.width=Number(tv.canvasWidth.value)||600,te.height=Number(tv.canvasHeight.value)||400,J(tw,te,ta,tA),tc.disabled=!1,te.hidden=!1,ti.hidden=!0)}),document.addEventListener("web-share:error",()=>{tt.open=!1,K("There was an error while trying to share your meme.","danger")}),document.addEventListener("capture-photo:error",t=>{console.error(t.detail.error),K(t.detail.error.message,"danger")}),document.addEventListener("capture-photo:success",t=>{Q.open=!1;let e=new Image;e.addEventListener("load",tk),e.src=t.detail.dataURI}),document.addEventListener("me-open",t=>{if("videoModal"===t.target.id){let t=Q.querySelector("capture-photo");t&&"function"==typeof t.startVideoStream&&t.startVideoStream()}}),document.addEventListener("me-close",t=>{if("videoModal"===t.target.id){let t=Q.querySelector("capture-photo");t&&"function"==typeof t.stopVideoStream&&t.stopVideoStream()}}),tb.querySelectorAll("button > img")?.forEach(t=>{t.setAttribute("title",t.getAttribute("alt"))}),tA.forEach((t,e)=>{td.appendChild(Z(e,t))}),to.accept=F,X.forEach(({name:t,path:e,style:o,weight:i})=>{Y(t,e,{style:o,weight:i})}); -//# sourceMappingURL=index.6d051d2c.js.map +//# sourceMappingURL=index.0ec871bb.js.map diff --git a/docs/index.0ec871bb.js.map b/docs/index.0ec871bb.js.map new file mode 100644 index 0000000..ad3e9be --- /dev/null +++ b/docs/index.0ec871bb.js.map @@ -0,0 +1 @@ +{"mappings":"A,S,E,C,E,O,G,E,U,C,E,O,C,C,C,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,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b74f958dd415d8.js","src/js/index.js","node_modules/@georapbox/web-share-element/dist/is-web-share-supported.js","node_modules/@georapbox/web-share-element/dist/","node_modules/@georapbox/web-share-element/dist/src/is-web-share-supported.js","node_modules/@georapbox/web-share-element/dist/web-share-defined.js","node_modules/@georapbox/web-share-element/dist/src/web-share-defined.js","node_modules/@georapbox/web-share-element/dist/src/web-share.js","node_modules/@georapbox/capture-photo-element/dist/capture-photo-defined.js","node_modules/@georapbox/capture-photo-element/dist/","node_modules/@georapbox/capture-photo-element/dist/src/capture-photo-defined.js","node_modules/@georapbox/capture-photo-element/dist/src/capture-photo.js","node_modules/@georapbox/capture-photo-element/dist/src/utils/clamp.js","node_modules/@georapbox/modal-element/dist/modal-element-defined.js","node_modules/@georapbox/modal-element/dist/","node_modules/@georapbox/modal-element/dist/src/modal-element-defined.js","node_modules/@georapbox/modal-element/dist/src/modal-element.js","node_modules/@georapbox/files-dropzone-element/dist/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/dist/","node_modules/@georapbox/files-dropzone-element/dist/src/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/dist/src/files-dropzone.js","node_modules/@georapbox/files-dropzone-element/dist/src/utils/is-valid-file.js","node_modules/@georapbox/files-dropzone-element/dist/src/utils/files-selector.js","src/js/utils/array-remove.js","src/js/utils/uid.js","src/js/constants.js","src/js/custom-fonts.js","node_modules/@parcel/runtime-js/lib/runtime-3165768b2af17669.js","node_modules/@parcel/runtime-js/lib/runtime-73291864e538b74b.js","node_modules/@parcel/runtime-js/lib/runtime-a2fc0bec9703ab72.js","node_modules/@parcel/runtime-js/lib/runtime-b59fd44dfd81b5fd.js","node_modules/@parcel/runtime-js/lib/runtime-bf36396318022d20.js","node_modules/@parcel/runtime-js/lib/runtime-418166379205b8eb.js","node_modules/@parcel/runtime-js/lib/runtime-105db2d9f9edf7cf.js","node_modules/@parcel/runtime-js/lib/runtime-9f8b0d4110a0174a.js","node_modules/@parcel/runtime-js/lib/runtime-94ba5916670c0a2b.js","node_modules/@parcel/runtime-js/lib/runtime-dec7b2cfeb98de11.js","node_modules/@parcel/runtime-js/lib/runtime-1800a52d85f464ab.js","src/js/file-from-url.js","src/js/toast-alert.js","src/js/create-text-box.js","src/js/draw-canvas.js"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire5078\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire5078\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"kyEFX\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $ef7689007096c8a0$export$6503ec6e8aabbaf; }, function (v) { return $ef7689007096c8a0$export$6503ec6e8aabbaf = v; });\nvar $ef7689007096c8a0$export$6503ec6e8aabbaf;\nvar $ef7689007096c8a0$export$f7ad0328861e2f03;\n\"use strict\";\nvar $ef7689007096c8a0$var$mapping = new Map();\nfunction $ef7689007096c8a0$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$ef7689007096c8a0$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $ef7689007096c8a0$var$resolve(id) {\n var resolved = $ef7689007096c8a0$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$ef7689007096c8a0$export$6503ec6e8aabbaf = $ef7689007096c8a0$var$register;\n$ef7689007096c8a0$export$f7ad0328861e2f03 = $ef7689007096c8a0$var$resolve;\n\n});\n\nvar $279d7e991aa5fda1$exports = {};\n\n(parcelRequire(\"kyEFX\")).register(new URL(\"\", import.meta.url).toString(), JSON.parse('[\"eq2Ey\",\"index.0ec871bb.js\",\"9jzSS\",\"Anton-Regular.e58ab3fe.ttf\",\"hr5Pp\",\"Oswald-Regular.89ec7d89.ttf\",\"5TebC\",\"Oswald-Bold.0f6a7ca6.ttf\",\"3ENF9\",\"Roboto-Regular.ca197847.ttf\",\"5yAXK\",\"Roboto-Bold.fdb9b54a.ttf\",\"k2KZ9\",\"RobotoCondensed-Regular.d585f5c7.ttf\",\"4h4UX\",\"RobotoCondensed-Bold.e1f96d4b.ttf\",\"8pomG\",\"CourierPrime-Regular.3a25a501.ttf\",\"l2v76\",\"CourierPrime-Bold.3d6bf689.ttf\",\"eKMWr\",\"OpenSans-Regular.edf9e01b.ttf\",\"dXO1Z\",\"OpenSans-Bold.8fceb72b.ttf\",\"9FH7D\",\"index.2d751096.css\"]'));\n\nfunction $7a2aca835bb05064$export$c37129e465f64ef0(a) {\n return null !== a && \"object\" == typeof a ? \"share\" in navigator && \"canShare\" in navigator && navigator.canShare(a) : \"share\" in navigator;\n}\n\n\nObject.defineProperty({}, \"WebShare\", {\n get: function() {\n return $cd62c5572235e737$export$30b344bef3e55b67;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $cd62c5572235e737$var$t = `\n :host {\n display: inline-block;\n }\n`, $cd62c5572235e737$var$e = document.createElement(\"template\");\n$cd62c5572235e737$var$e.innerHTML = `\n \n \n`;\nclass $cd62c5572235e737$export$30b344bef3e55b67 extends HTMLElement {\n #t;\n #e;\n #s = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($cd62c5572235e737$var$e.content.cloneNode(!0)), this.#t = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null, this.#e = this.#i();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n \"disabled\" === t && e !== s && this.#e && (this.#e.toggleAttribute(\"disabled\", this.disabled), this.#e.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#e.part && this.#e.part.contains(\"button\") && this.#e.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#r(\"shareUrl\"), this.#r(\"shareTitle\"), this.#r(\"shareText\"), this.#r(\"shareFiles\"), this.#r(\"disabled\"), this.#t?.addEventListener(\"slotchange\", this.#a), this.#e?.addEventListener(\"click\", this.#n);\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"slotchange\", this.#a), this.#e?.removeEventListener(\"click\", this.#n);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(t) {\n this.setAttribute(\"share-url\", t);\n }\n get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(t) {\n this.setAttribute(\"share-title\", t);\n }\n get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(t) {\n this.setAttribute(\"share-text\", t);\n }\n get shareFiles() {\n return this.#s;\n }\n set shareFiles(t) {\n Array.isArray(t) && t.length > 0 && (this.#s = t);\n }\n async share() {\n if (!this.disabled) try {\n let t = {};\n this.shareUrl && (t.url = this.shareUrl), this.shareTitle && (t.title = this.shareTitle), this.shareText && (t.text = this.shareText), Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n }) && (t.files = this.shareFiles), await navigator.share(t), this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: !0,\n composed: !0,\n detail: {\n shareData: t\n }\n }));\n } catch (t) {\n if (t instanceof Error && \"AbortError\" === t.name) {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #n = (t)=>{\n t.preventDefault(), this.disabled || this.share();\n };\n #a = (t)=>{\n t.target && \"button\" === t.target.name && (this.#e?.removeEventListener(\"click\", this.#n), this.#e = this.#i(), this.#e && (this.#e.addEventListener(\"click\", this.#n), \"BUTTON\" === this.#e.nodeName || this.#e.hasAttribute(\"role\") || this.#e.setAttribute(\"role\", \"button\")));\n };\n #i() {\n return this.#t && this.#t.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"button\" === t.getAttribute(\"slot\")) || null;\n }\n #r(t) {\n if (Object.prototype.hasOwnProperty.call(this, t)) {\n let e = this[t];\n delete this[t], this[t] = e;\n }\n }\n static defineCustomElement(t = \"web-share\") {\n \"undefined\" == typeof window || window.customElements.get(t) || window.customElements.define(t, $cd62c5572235e737$export$30b344bef3e55b67);\n }\n}\n$cd62c5572235e737$export$30b344bef3e55b67.defineCustomElement();\n\n\nObject.defineProperty({}, \"CapturePhoto\", {\n get: function() {\n return $dced0d224c6d876e$export$cc30a98fe3890794;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $dced0d224c6d876e$var$t = (t, e, i)=>(Number.isNaN(e) && (e = 0), Number.isNaN(i) && (i = 0), Math.min(Math.max(t, Math.min(e, i)), Math.max(e, i))), $dced0d224c6d876e$var$e = \"capture-photo\", $dced0d224c6d876e$var$i = `\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`, $dced0d224c6d876e$var$o = document.createElement(\"template\");\n$dced0d224c6d876e$var$o.innerHTML = `\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\nclass $dced0d224c6d876e$export$cc30a98fe3890794 extends HTMLElement {\n #t = {};\n #e = null;\n #i = null;\n #o = null;\n #n = null;\n #a = null;\n #s = null;\n #r = null;\n #l = null;\n constructor(){\n super(), this.#t = this.getSupportedConstraints(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($dced0d224c6d876e$var$o.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"facing-mode\",\n \"camera-resolution\",\n \"pan\",\n \"tilt\",\n \"zoom\"\n ];\n }\n attributeChangedCallback(t, e, i) {\n if (!this.isConnected) return;\n let o = this.getTrackCapabilities(), n = this.getTrackSettings();\n if (\"no-image\" === t && e !== i && this.#u(), \"facing-mode\" === t && e !== i && \"facingMode\" in this.#t) {\n let t = [\n \"user\",\n \"environment\"\n ].includes(this.facingMode || \"\");\n \"facingMode\" in n && t && (this.stopVideoStream(), this.startVideoStream());\n }\n if (\"camera-resolution\" === t && e !== i && \"string\" == typeof this.cameraResolution && this.cameraResolution.trim().length > 0) {\n let [t = 0, e = 0] = this.cameraResolution.split(\"x\").map((t)=>Number(t));\n if (t > 0 && e > 0 && \"width\" in o && \"height\" in o) {\n let i = !!(o.width?.min && o.width?.max) && t >= o?.width?.min && t <= o?.width?.max, a = !!(o.height?.min && o.height?.max) && e >= o?.height?.min && e <= o?.height?.max;\n \"width\" in n && \"height\" in n && i && a && (this.stopVideoStream(), this.startVideoStream());\n }\n }\n if (\"pan\" === t && e !== i && \"pan\" in this.#t) {\n let t = !!(\"pan\" in o && o.pan?.min && o.pan?.max) && this.pan >= o.pan.min && this.pan <= o.pan.max;\n \"pan\" in n && \"number\" == typeof this.pan && t && this.#h(\"pan\", this.pan);\n }\n if (\"tilt\" === t && e !== i && \"tilt\" in this.#t) {\n let t = !!(\"tilt\" in o && o.tilt?.min && o.tilt?.max) && this.tilt >= o.tilt.min && this.tilt <= o.tilt.max;\n \"tilt\" in n && \"number\" == typeof this.tilt && t && this.#h(\"tilt\", this.tilt);\n }\n if (\"zoom\" === t && e !== i && \"zoom\" in this.#t) {\n let t = !!(\"zoom\" in o && o.zoom?.min && o.zoom?.max) && this.zoom >= o.zoom.min && this.zoom <= o.zoom.max;\n \"zoom\" in n && \"number\" == typeof this.zoom && t && this.#h(\"zoom\", this.zoom);\n }\n }\n connectedCallback() {\n if (this.#d(\"autpoPlay\"), this.#d(\"noImage\"), this.#d(\"facingMode\"), this.#d(\"cameraResolution\"), this.#d(\"pan\"), this.#d(\"tilt\"), this.#d(\"zoom\"), this.#d(\"calculateFileSize\"), this.#i = this.shadowRoot?.querySelector(\"canvas\") || null, this.#o = this.shadowRoot?.getElementById(\"output\") || null, this.#n = this.shadowRoot?.querySelector(\"video\") || null, this.#a = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null, this.#s = this.#c(), this.#r = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null, this.#l = this.#m(), this.#n?.addEventListener(\"loadedmetadata\", this.#p), this.#a?.addEventListener(\"slotchange\", this.#g), this.#s?.addEventListener(\"click\", this.#b), this.#r?.addEventListener(\"slotchange\", this.#f), this.#l?.addEventListener(\"click\", this.#v), !$dced0d224c6d876e$export$cc30a98fe3890794.isSupported()) return this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n this.autoPlay && this.startVideoStream();\n }\n disconnectedCallback() {\n this.stopVideoStream(), this.#l?.removeEventListener(\"click\", this.#v), this.#s?.removeEventListener(\"click\", this.#b), this.#n?.removeEventListener(\"canplay\", this.#p), this.#a?.removeEventListener(\"slotchange\", this.#g), this.#r?.removeEventListener(\"slotchange\", this.#f);\n }\n get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(t) {\n this.toggleAttribute(\"auto-play\", !!t);\n }\n get noImage() {\n return this.hasAttribute(\"no-image\");\n }\n set noImage(t) {\n this.toggleAttribute(\"no-image\", !!t);\n }\n get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(t) {\n this.setAttribute(\"facing-mode\", t);\n }\n get cameraResolution() {\n return this.getAttribute(\"camera-resolution\") || \"\";\n }\n set cameraResolution(t) {\n this.setAttribute(\"camera-resolution\", t);\n }\n get pan() {\n return Number(this.getAttribute(\"pan\")) || 0;\n }\n set pan(t) {\n this.setAttribute(\"pan\", null != t ? t.toString() : t);\n }\n get tilt() {\n return Number(this.getAttribute(\"tilt\")) || 0;\n }\n set tilt(t) {\n this.setAttribute(\"tilt\", null != t ? t.toString() : t);\n }\n get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(t) {\n this.setAttribute(\"zoom\", null != t ? t.toString() : t);\n }\n get loading() {\n return this.hasAttribute(\"loading\");\n }\n get calculateFileSize() {\n return this.hasAttribute(\"calculate-file-size\");\n }\n set calculateFileSize(t) {\n this.toggleAttribute(\"calculate-file-size\", !!t);\n }\n #v = (t)=>{\n t.preventDefault(), this.loading || (this.facingMode = \"user\" !== this.facingMode && this.facingMode ? \"user\" : \"environment\");\n };\n #b = (t)=>{\n t.preventDefault(), this.capture();\n };\n #p = (t)=>{\n let i = t.target;\n i.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:video-play`, {\n bubbles: !0,\n composed: !0,\n detail: {\n video: i\n }\n }));\n }).catch((t)=>{\n this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n #u() {\n this.#o && Array.from(this.#o.childNodes).forEach((t)=>t.remove());\n }\n #h(e, i) {\n if (!this.#e || !e || !i) return;\n let [o] = this.#e.getVideoTracks(), n = this.getTrackCapabilities();\n e in this.getTrackSettings() && o.applyConstraints({\n advanced: [\n {\n [e]: $dced0d224c6d876e$var$t(Number(i), n[e]?.min || 1, n[e]?.max || 1)\n }\n ]\n });\n }\n #g = (t)=>{\n t.target?.name === \"capture-button\" && (this.#s?.removeEventListener(\"click\", this.#b), this.#s = this.#c(), this.#s && (this.#s.addEventListener(\"click\", this.#b), \"BUTTON\" === this.#s.nodeName || this.#s.hasAttribute(\"role\") || this.#s.setAttribute(\"role\", \"button\")));\n };\n #f = (t)=>{\n t.target?.name === \"facing-mode-button\" && (this.#l?.removeEventListener(\"click\", this.#v), this.#l = this.#m(), this.#l && (this.#l.addEventListener(\"click\", this.#v), \"BUTTON\" === this.#l.nodeName || this.#l.hasAttribute(\"role\") || this.#l.setAttribute(\"role\", \"button\")));\n };\n #m() {\n return this.#r && this.#r.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"facing-mode-button\" === t.getAttribute(\"slot\")) || null;\n }\n #c() {\n return this.#a && this.#a.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"capture-button\" === t.getAttribute(\"slot\")) || null;\n }\n #d(t) {\n if (Object.prototype.hasOwnProperty.call(this, t)) {\n let e = this[t];\n delete this[t], this[t] = e;\n }\n }\n async startVideoStream() {\n if (!$dced0d224c6d876e$export$cc30a98fe3890794.isSupported() || this.#e) return;\n this.setAttribute(\"loading\", \"\");\n let t = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: !0,\n tilt: !0,\n zoom: !0\n },\n audio: !1\n };\n if (\"string\" == typeof this.cameraResolution && this.cameraResolution.trim().length > 0) {\n let [e = 0, i = 0] = this.cameraResolution.split(\"x\").map((t)=>Number(t));\n e > 0 && i > 0 && (t.video.width = e, t.video.height = i);\n }\n try {\n this.#e = await navigator.mediaDevices.getUserMedia(t), this.#n && (this.#n.srcObject = this.#e), this.#h(\"pan\", this.pan), this.#h(\"tilt\", this.tilt), this.#h(\"zoom\", this.zoom);\n let e = this.getTrackSettings();\n \"facingMode\" in e && this.#r && (this.#r.hidden = !1);\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n stopVideoStream() {\n if (!this.#n || !this.#e) return;\n let [t] = this.#e.getVideoTracks();\n t?.stop(), this.#n.srcObject = null, this.#e = null;\n }\n async capture() {\n if (!this.loading && this.#i && this.#n) try {\n let t = this.#i.getContext(\"2d\"), i = this.#n.videoWidth, o = this.#n.videoHeight;\n this.#i.width = i, this.#i.height = o, t?.drawImage(this.#n, 0, 0, i, o);\n let n = this.#i.toDataURL(\"image/png\");\n if (\"string\" == typeof n && n.includes(\"data:image\")) {\n if (!this.noImage) {\n let t = new Image;\n t.src = n, t.width = i, t.height = o, t.setAttribute(\"part\", \"output-image\"), this.#u(), this.#o?.appendChild(t);\n }\n let t = {\n dataURI: n,\n width: i,\n height: o\n };\n if (this.calculateFileSize) try {\n let e = await fetch(n), i = (await e.blob()).size;\n i && (t.size = i);\n } catch (t) {}\n this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:success`, {\n bubbles: !0,\n composed: !0,\n detail: t\n }));\n }\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n getSupportedConstraints() {\n return $dced0d224c6d876e$export$cc30a98fe3890794.isSupported() && navigator.mediaDevices.getSupportedConstraints() || {};\n }\n getTrackCapabilities() {\n if (!this.#e) return {};\n let [t] = this.#e.getVideoTracks();\n return t && \"function\" == typeof t.getCapabilities && t.getCapabilities() || {};\n }\n getTrackSettings() {\n if (!this.#e) return {};\n let [t] = this.#e.getVideoTracks();\n return t && \"function\" == typeof t.getSettings && t.getSettings() || {};\n }\n static isSupported() {\n return !!navigator.mediaDevices?.getUserMedia;\n }\n static defineCustomElement(t = $dced0d224c6d876e$var$e) {\n \"undefined\" == typeof window || window.customElements.get(t) || window.customElements.define(t, $dced0d224c6d876e$export$cc30a98fe3890794);\n }\n}\n$dced0d224c6d876e$export$cc30a98fe3890794.defineCustomElement();\n\n\nObject.defineProperty({}, \"ModalElement\", {\n get: function() {\n return $d9c5053bade2d3f8$export$32589115725b904b;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $d9c5053bade2d3f8$var$e = document.createElement(\"template\");\n$d9c5053bade2d3f8$var$e.innerHTML = /* html */ `\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`; /**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */ \nclass $d9c5053bade2d3f8$export$32589115725b904b extends HTMLElement {\n #e = null;\n #t = null;\n #o = void 0;\n constructor(){\n if (super(), !this.shadowRoot) {\n let t = this.attachShadow({\n mode: \"open\"\n });\n t.appendChild($d9c5053bade2d3f8$var$e.content.cloneNode(!0));\n }\n this.shadowRoot && (this.#e = this.shadowRoot.querySelector(\"dialog\"), this.#t = this.shadowRoot.querySelector('slot[name=\"footer\"]'));\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\"\n ];\n }\n attributeChangedCallback(e, t, o) {\n if (null !== this.#e) {\n if (\"open\" === e && t !== o && (this.open ? (this.#e.showModal(), document.body && (document.body.style.overflowY = \"hidden\"), this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n }))) : this.#e.close()), \"no-header\" === e && t !== o) {\n let e = this.#e.querySelector(\".dialog__header\");\n null !== e && (e.hidden = this.noHeader);\n }\n if (\"no-animations\" === e && t !== o && this.#e.classList.toggle(\"dialog--no-animations\", this.noAnimations), \"no-close-button\" === e && t !== o) {\n let e = this.#e.querySelector(\".dialog__close\");\n null !== e && (e.hidden = this.noCloseButton);\n }\n }\n }\n connectedCallback() {\n this.#i(\"open\"), this.#i(\"staticBackdrop\"), this.#i(\"noHeader\"), this.#i(\"noAnimations\"), this.#i(\"noCloseButton\"), this.#i(\"fullscreen\"), this.#e?.addEventListener(\"click\", this.#a), this.#e?.addEventListener(\"close\", this.#l), this.#e?.addEventListener(\"cancel\", this.#s), this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#n), this.#t?.addEventListener(\"slotchange\", this.#r);\n }\n disconnectedCallback() {\n this.#o && clearTimeout(this.#o), this.#e?.addEventListener(\"click\", this.#a), this.#e?.removeEventListener(\"close\", this.#l), this.#e?.removeEventListener(\"cancel\", this.#s), this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#n), this.#t?.removeEventListener(\"slotchange\", this.#r);\n }\n get open() {\n return this.hasAttribute(\"open\");\n }\n set open(e) {\n e ? this.setAttribute(\"open\", \"\") : this.removeAttribute(\"open\");\n }\n get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(e) {\n e ? this.setAttribute(\"static-backdrop\", \"\") : this.removeAttribute(\"static-backdrop\");\n }\n get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(e) {\n e ? this.setAttribute(\"no-header\", \"\") : this.removeAttribute(\"no-header\");\n }\n get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(e) {\n e ? this.setAttribute(\"no-animations\", \"\") : this.removeAttribute(\"no-animations\");\n }\n get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(e) {\n e ? this.setAttribute(\"no-close-button\", \"\") : this.removeAttribute(\"no-close-button\");\n }\n get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(e) {\n e ? this.setAttribute(\"fullscreen\", \"\") : this.removeAttribute(\"fullscreen\");\n }\n #d() {\n this.#o || (this.#e?.classList.add(\"dialog--pulse\"), this.#o = setTimeout(()=>{\n this.#e?.classList.remove(\"dialog--pulse\"), clearTimeout(this.#o), this.#o = void 0;\n }, 300));\n }\n #l = ()=>{\n // the open property when the dialog is closed by the user.\n this.open = !1, document.body && (document.body.style.overflowY = \"\"), this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n }));\n };\n #s = (e)=>{\n let t = this.#c(\"escape-key\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), this.noAnimations || this.#d());\n };\n #n = (e)=>{\n let t = this.#c(\"close-button\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), this.noAnimations || this.#d());\n };\n #a = (e)=>{\n if (e.target !== e.currentTarget) return;\n let t = this.#c(\"backdrop-click\");\n if (this.dispatchEvent(t), t.defaultPrevented || this.staticBackdrop) {\n this.noAnimations || this.#d();\n return;\n }\n this.#e?.close();\n };\n #r = ()=>{\n if (null === this.#e) return; /** @type {Nullable} */ \n let e = this.#e.querySelector(\".dialog__footer\");\n if (null === e) return;\n let t = this.#t?.assignedNodes(), o = !!t && t.length > 0;\n e.hidden = !o;\n };\n #c(e) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: !0,\n composed: !0,\n cancelable: !0,\n detail: {\n reason: e,\n element: this\n }\n });\n }\n #i(e) {\n if (Object.prototype.hasOwnProperty.call(this, e)) {\n let t = this[e];\n delete this[e], this[e] = t;\n }\n }\n show() {\n this.open || (this.open = !0);\n }\n hide() {\n this.open && (this.open = !1);\n }\n static defineCustomElement(e = \"modal-element\") {\n \"undefined\" == typeof window || window.customElements.get(e) || window.customElements.define(e, $d9c5053bade2d3f8$export$32589115725b904b);\n }\n}\n$d9c5053bade2d3f8$export$32589115725b904b.defineCustomElement();\n //# sourceMappingURL=modal-element-defined.js.map\n\n\nObject.defineProperty({}, \"FilesDropzone\", {\n get: function() {\n return $9351176e8d763a78$export$6ccd1735166caad9;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $9351176e8d763a78$var$e = new Map([\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]), $9351176e8d763a78$var$t = [\n \".DS_Store\",\n \"Thumbs.db\"\n], $9351176e8d763a78$var$o = (t)=>{\n let { name: o } = t;\n if (o && -1 !== o.lastIndexOf(\".\") && !t.type) {\n let i = (o.split(\".\").pop() || \"\").toLowerCase(), r = $9351176e8d763a78$var$e.get(i);\n r && Object.defineProperty(t, \"type\", {\n value: r,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return t;\n}, $9351176e8d763a78$var$i = (e, t)=>{\n let i = $9351176e8d763a78$var$o(e);\n if (\"string\" != typeof i.path) {\n let { webkitRelativePath: o } = e;\n Object.defineProperty(i, \"path\", {\n value: \"string\" == typeof t ? t : o || e.name,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return i;\n}, $9351176e8d763a78$var$r = async (e)=>await new Promise((t, o)=>{\n e.readEntries(t, o);\n }), $9351176e8d763a78$var$a = async (e)=>{\n let t = [], o = await $9351176e8d763a78$var$r(e);\n for(; o.length > 0;)t.push(...o), o = await $9351176e8d763a78$var$r(e);\n return t;\n}, $9351176e8d763a78$var$n = (e)=>new Promise((t, o)=>{\n e.file((o)=>t($9351176e8d763a78$var$i(o, e.fullPath)), o);\n }), $9351176e8d763a78$var$s = async (e)=>{\n let o = [], i = [];\n for (let t of e){\n if (\"file\" !== t.kind) continue;\n let e = t.getAsEntry ? t.getAsEntry() : t.webkitGetAsEntry();\n i.push(e);\n }\n for(; i.length > 0;){\n let e = i.shift();\n if (e) {\n if (e.isFile) {\n let i = await $9351176e8d763a78$var$n(e);\n -1 === $9351176e8d763a78$var$t.indexOf(i.name) && o.push(i);\n } else e.isDirectory && i.push(...await $9351176e8d763a78$var$a(e.createReader()));\n }\n }\n return o;\n}, $9351176e8d763a78$var$d = async (e)=>{\n let o = [];\n for (let r of e)-1 === $9351176e8d763a78$var$t.indexOf(r.name) && o.push($9351176e8d763a78$var$i(r));\n return o;\n}, $9351176e8d763a78$var$l = async (e)=>e.dataTransfer ? e.dataTransfer.items ? await $9351176e8d763a78$var$s(e.dataTransfer.items) : await $9351176e8d763a78$var$d(e.dataTransfer.files) : await $9351176e8d763a78$var$d(e.target.files), $9351176e8d763a78$var$p = \"files-dropzone\", $9351176e8d763a78$var$c = \"TOO_MANY_FILES\", $9351176e8d763a78$var$h = document.createElement(\"template\"), $9351176e8d763a78$var$u = `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$9351176e8d763a78$var$h.innerHTML = `\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\nclass $9351176e8d763a78$export$6ccd1735166caad9 extends HTMLElement {\n #e = null;\n #t = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($9351176e8d763a78$var$h.content.cloneNode(!0)), this.shadowRoot && (this.#e = this.shadowRoot.getElementById(\"fileInput\"), this.#t = this.shadowRoot.getElementById(\"dropzoneEl\"));\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\",\n \"no-keyboard\"\n ];\n }\n attributeChangedCallback(e, t, o) {\n \"accept\" === e && t !== o && this.#e && (this.#e.accept = this.accept), \"disabled\" === e && t !== o && this.#e && (this.#e.disabled = this.disabled, this.disabled ? this.#t?.removeAttribute(\"tabindex\") : this.#t?.setAttribute(\"tabindex\", \"0\")), \"multiple\" === e && t !== o && this.#e && (this.#e.multiple = this.multiple), \"no-keyboard\" === e && t !== o && this.#t && (this.noKeyboard ? this.#t.removeAttribute(\"tabindex\") : this.#t.setAttribute(\"tabindex\", \"0\"));\n }\n connectedCallback() {\n this.#o(\"accept\"), this.#o(\"disabled\"), this.#o(\"maxFiles\"), this.#o(\"maxSize\"), this.#o(\"minSize\"), this.#o(\"multiple\"), this.#o(\"noClick\"), this.#o(\"noDrag\"), this.#o(\"noKeyboard\"), this.#o(\"autoFocus\"), this.#o(\"noStyle\"), this.#e?.addEventListener(\"change\", this.#i), this.#t?.addEventListener(\"dragenter\", this.#r), this.#t?.addEventListener(\"dragover\", this.#a), this.#t?.addEventListener(\"dragleave\", this.#n), this.#t?.addEventListener(\"drop\", this.#s), this.#t?.addEventListener(\"click\", this.#d), this.#t?.addEventListener(\"keyup\", this.#l), this.autoFocus && this.#t?.focus();\n }\n disconnectedCallback() {\n this.#e?.removeEventListener(\"change\", this.#i), this.#t?.removeEventListener(\"dragenter\", this.#r), this.#t?.removeEventListener(\"dragover\", this.#a), this.#t?.removeEventListener(\"dragleave\", this.#n), this.#t?.removeEventListener(\"drop\", this.#s), this.#t?.removeEventListener(\"click\", this.#d), this.#t?.removeEventListener(\"keyup\", this.#l);\n }\n get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(e) {\n this.setAttribute(\"accept\", null != e ? e.toString() : e);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n get maxFiles() {\n let e = Number(this.getAttribute(\"max-files\")) || 0;\n return e <= 0 ? 1 / 0 : Math.floor(Math.abs(e));\n }\n set maxFiles(e) {\n this.setAttribute(\"max-files\", null != e ? e.toString() : e);\n }\n get maxSize() {\n let e = this.getAttribute(\"max-size\");\n if (null === e) return 1 / 0;\n let t = Number(e);\n return Number.isNaN(t) ? 1 / 0 : t;\n }\n set maxSize(e) {\n this.setAttribute(\"max-size\", null != e ? e.toString() : e);\n }\n get minSize() {\n let e = this.getAttribute(\"min-size\");\n if (null === e) return 0;\n let t = Number(e);\n return Number.isNaN(t) ? 0 : t;\n }\n set minSize(e) {\n this.setAttribute(\"min-size\", null != e ? e.toString() : e);\n }\n get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(e) {\n this.toggleAttribute(\"multiple\", !!e);\n }\n get noClick() {\n return this.hasAttribute(\"no-click\");\n }\n set noClick(e) {\n this.toggleAttribute(\"no-click\", !!e);\n }\n get noDrag() {\n return this.hasAttribute(\"no-drag\");\n }\n set noDrag(e) {\n this.toggleAttribute(\"no-drag\", !!e);\n }\n get noKeyboard() {\n return this.hasAttribute(\"no-keyboard\");\n }\n set noKeyboard(e) {\n this.toggleAttribute(\"no-keyboard\", !!e);\n }\n get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(e) {\n this.toggleAttribute(\"auto-focus\", !!e);\n }\n get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(e) {\n this.toggleAttribute(\"no-style\", !!e);\n }\n #i = async (e)=>{\n try {\n this.#p(await $9351176e8d763a78$var$l(e));\n } catch (e) {\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$p}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: e\n }\n }));\n }\n };\n #r = ()=>{\n this.disabled || this.noDrag || this.dispatchEvent(new Event(`${$9351176e8d763a78$var$p}-dragenter`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #a = (e)=>{\n if (e.preventDefault(), this.disabled || this.noDrag) {\n e.dataTransfer.dropEffect = \"none\";\n return;\n }\n e.dataTransfer.dropEffect = \"copy\", this.#t && (this.#t.classList.add(\"dropzone--dragover\"), this.#t.part.add(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$9351176e8d763a78$var$p}-dragover`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #n = ()=>{\n this.disabled || this.noDrag || (this.#t && (this.#t.classList.remove(\"dropzone--dragover\"), this.#t.part.remove(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$9351176e8d763a78$var$p}-dragleave`, {\n bubbles: !0,\n composed: !0\n })));\n };\n #s = async (e)=>{\n if (!this.disabled && !this.noDrag) {\n e.preventDefault(), this.#t && (this.#t.classList.remove(\"dropzone--dragover\"), this.#t.part.remove(\"dropzone--dragover\"));\n try {\n this.#p(await $9351176e8d763a78$var$l(e));\n } catch (e) {\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$p}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: e\n }\n }));\n }\n }\n };\n #d = ()=>{\n this.disabled || this.noClick || this.#e?.click();\n };\n #l = (e)=>{\n this.disabled || this.noKeyboard || \" \" !== e.key && \"Enter\" !== e.key || this.#e?.click();\n };\n #p(e) {\n if (!Array.isArray(e) || !e.length) return;\n let t = [], o = [], i = e.length;\n if (!this.multiple && i > 1) for (let t of e)o.push({\n file: t,\n errors: [\n {\n code: $9351176e8d763a78$var$c,\n message: \"Too many files selected. Only 1 file is allowed.\"\n }\n ]\n });\n else if (this.multiple && i > this.maxFiles) for (let t of e)o.push({\n file: t,\n errors: [\n {\n code: $9351176e8d763a78$var$c,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else for (let i of e){\n let e = function(e, t = \"\") {\n if (!t) return !0;\n let o = [\n ...new Set(t.split(\",\").map((e)=>e.trim()).filter(Boolean))\n ], i = e.type, r = i.replace(/\\/.*$/, \"\");\n for (let t of o)if (\".\" === t.charAt(0)) {\n if (-1 !== e.name.toLowerCase().indexOf(t.toLowerCase(), e.name.length - t.length)) return !0;\n } else if (/\\/\\*$/.test(t)) {\n if (r === t.replace(/\\/.*$/, \"\")) return !0;\n } else if (i === t) return !0;\n return !1;\n }(i, this.accept), r = i.size > this.maxSize, a = i.size < this.minSize;\n if (!e || r || a) {\n let t = [];\n e || t.push({\n code: \"INVALID_MIME_TYPE\",\n message: `File type \"${i.type}\" is not accepted.`\n }), r && t.push({\n code: \"FILE_TOO_LARGE\",\n message: `File size ${i.size} exceeds the maximum size of ${this.maxSize}.`\n }), a && t.push({\n code: \"FILE_TOO_SMALL\",\n message: `File size ${i.size} is smaller than the minimum size of ${this.minSize}.`\n }), o.push({\n file: i,\n errors: t\n });\n } else t.push(i);\n }\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$p}-drop`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t,\n rejectedFiles: o\n }\n })), t.length > 0 && this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$p}-drop-accepted`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t\n }\n })), o.length > 0 && this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$p}-drop-rejected`, {\n bubbles: !0,\n composed: !0,\n detail: {\n rejectedFiles: o\n }\n })), this.#e && (this.#e.value = this.#e.defaultValue);\n }\n openFileDialog() {\n this.disabled || this.#e?.click();\n }\n #o(e) {\n if (Object.prototype.hasOwnProperty.call(this, e)) {\n let t = this[e];\n delete this[e], this[e] = t;\n }\n }\n static defineCustomElement(e = $9351176e8d763a78$var$p) {\n \"undefined\" == typeof window || window.customElements.get(e) || window.customElements.define(e, $9351176e8d763a78$export$6ccd1735166caad9);\n }\n}\n$9351176e8d763a78$export$6ccd1735166caad9.defineCustomElement();\n\n\n\n\n/**\n * Removes one or more elements from an array at the specified index(es).\n *\n * @param {Array} array The initial array to remove elements from.\n * @param {Number} ...indexes The index(es) of the elements to be removed. Non numbers are ignored.\n * @throws {TypeError} If `array` is not array.\n * @returns {Array} The result array with the elements specified removed.\n * @example\n *\n * const arr = [1, 2, 3, 4, 5];\n *\n * remove(arr, 0);\n * // => [2, 3, 4, 5]\n *\n * remove(arr, 0, 1);\n * // => [3, 4, 5]\n *\n * remove(arr, 0, 4);\n * // => [2, 3, 4]\n *\n * remove(arr);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length - 1);\n * // => [1, 2, 3, 4]\n *\n * remove(arr, NaN);\n * // => [1, 2, 3, 4, 5]\n */ const $4af3d380d1884504$export$30a014203d0d7e4f = (array, ...indexes)=>{\n if (!Array.isArray(array)) throw new TypeError(\"Expected an array for first argument\");\n return array.filter((_, i)=>indexes.indexOf(i) === -1);\n};\n\n\n/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */ const $17004b28c97c1306$export$e2a22331486dcca0 = (prefix = \"\", suffix = \"\")=>{\n const prefixString = typeof prefix === \"string\" && prefix !== \"\" ? prefix + \"-\" : \"\";\n const suffixString = typeof suffix === \"string\" && suffix !== \"\" ? \"-\" + suffix : \"\";\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n return `${prefixString}${randomString}${suffixString}`;\n};\n\n\nconst $65136e012e05e2d7$export$63e7bed68b07a85c = [\n \"image/jpg\",\n \"image/jpeg\",\n \"image/png\",\n \"image/apng\",\n \"image/gif\",\n \"image/webp\",\n \"image/avif\"\n];\n\n\nvar $068eb37972da8c20$exports = {};\n$068eb37972da8c20$exports = new URL(\"Anton-Regular.e58ab3fe.ttf\", import.meta.url).toString();\n\n\nvar $2db6b38fbc5d48da$exports = {};\n$2db6b38fbc5d48da$exports = new URL(\"Oswald-Regular.89ec7d89.ttf\", import.meta.url).toString();\n\n\nvar $a0b1873abc1b077b$exports = {};\n$a0b1873abc1b077b$exports = new URL(\"Oswald-Bold.0f6a7ca6.ttf\", import.meta.url).toString();\n\n\nvar $df7c7f72fd04e02a$exports = {};\n$df7c7f72fd04e02a$exports = new URL(\"Roboto-Regular.ca197847.ttf\", import.meta.url).toString();\n\n\nvar $e4c2039736f96f5d$exports = {};\n$e4c2039736f96f5d$exports = new URL(\"Roboto-Bold.fdb9b54a.ttf\", import.meta.url).toString();\n\n\nvar $fbff28e47a938944$exports = {};\n$fbff28e47a938944$exports = new URL(\"RobotoCondensed-Regular.d585f5c7.ttf\", import.meta.url).toString();\n\n\nvar $d8f4a375a42d32f4$exports = {};\n$d8f4a375a42d32f4$exports = new URL(\"RobotoCondensed-Bold.e1f96d4b.ttf\", import.meta.url).toString();\n\n\nvar $7cfbda315cbb4209$exports = {};\n$7cfbda315cbb4209$exports = new URL(\"CourierPrime-Regular.3a25a501.ttf\", import.meta.url).toString();\n\n\nvar $6379185b16d8409f$exports = {};\n$6379185b16d8409f$exports = new URL(\"CourierPrime-Bold.3d6bf689.ttf\", import.meta.url).toString();\n\n\nvar $454f2b111c8d0078$exports = {};\n$454f2b111c8d0078$exports = new URL(\"OpenSans-Regular.edf9e01b.ttf\", import.meta.url).toString();\n\n\nvar $c05fcaeb63dbd733$exports = {};\n$c05fcaeb63dbd733$exports = new URL(\"OpenSans-Bold.8fceb72b.ttf\", import.meta.url).toString();\n\n\nconst $56b863c8b6be7003$export$6874249d87f2602a = [\n {\n name: \"Anton\",\n label: \"Anton\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($068eb37972da8c20$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Oswald-Regular\",\n label: \"Oswald\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($2db6b38fbc5d48da$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Oswald-Bold\",\n label: \"Oswald Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($a0b1873abc1b077b$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"Roboto-Regular\",\n label: \"Roboto\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($df7c7f72fd04e02a$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Roboto-Bold\",\n label: \"Roboto Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($e4c2039736f96f5d$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"RobotoCondensed-Regular\",\n label: \"Roboto Condensed\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($fbff28e47a938944$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"RobotoCondensed-Bold\",\n label: \"Roboto Condensed Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($d8f4a375a42d32f4$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"CourierPrime-Regular\",\n label: \"Courier Prime\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($7cfbda315cbb4209$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"CourierPrime-Bold\",\n label: \"Courier Prime Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($6379185b16d8409f$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"OpenSans-Regular\",\n label: \"Open Sans\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($454f2b111c8d0078$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"OpenSans-Bold\",\n label: \"Open Sans Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($c05fcaeb63dbd733$exports))),\n style: \"normal\",\n weight: \"400\"\n }\n];\nconst $56b863c8b6be7003$export$59eceaef0c7797b2 = async (name, path, options = {})=>{\n try {\n const font = new FontFace(name, `url(${path})`, {\n ...options\n });\n await font.load();\n document.fonts.add(font);\n } catch (err) {\n console.error(err);\n }\n};\n\n\n\nconst $0374350c629f125f$export$6539e087749cf9d3 = async (options = {})=>{\n const res = await fetch(options.url);\n const blob = await res.blob();\n const mimeType = options.mimeType || blob.type || \"\";\n if (!(0, $65136e012e05e2d7$export$63e7bed68b07a85c).includes(mimeType)) throw new Error(`This is not an accepted image format. Accepted MIME types are: ${(0, $65136e012e05e2d7$export$63e7bed68b07a85c).join(\", \")}`);\n return new File([\n blob\n ], options.filename || \"\", blob);\n};\n\n\nconst $3969451ff60cb8d5$var$errorsContainer = document.getElementById(\"errorsContainer\");\nconst $3969451ff60cb8d5$var$hideError = (evt)=>{\n const target = evt.currentTarget;\n target.removeEventListener(\"click\", $3969451ff60cb8d5$var$hideError);\n $3969451ff60cb8d5$var$errorsContainer.removeChild(target.parentNode);\n};\nconst $3969451ff60cb8d5$export$af04143326425dbd = (message = \"\", type = \"info\")=>{\n const types = [\n \"info\",\n \"warning\",\n \"danger\"\n ];\n if (!types.includes(type)) type = \"info\";\n const template = /* html */ `\n ${message}\n \n `;\n const div = document.createElement(\"div\");\n div.className = `alert alert-${type} alert-dismissible text-break mb-2 fade`;\n div.innerHTML = template;\n div.querySelector(\"button\").addEventListener(\"click\", $3969451ff60cb8d5$var$hideError);\n $3969451ff60cb8d5$var$errorsContainer.appendChild(div);\n setTimeout(()=>div.classList.add(\"show\"), 100);\n};\n\n\n\nconst $224fa2388dce65c4$export$293a4b86a6fe2398 = (index, data = {})=>{\n const inputTemplate = /* html */ `\n
\n \n\n \n\n
\n \n \n \n
\n
\n\n
\n
\n
\n \n\n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n \n \n \n \n
\n
\n
\n\n
\n
\n
\n \n \n
\n
\n
\n
\n `;\n const fragment = document.createDocumentFragment();\n const div = document.createElement(\"div\");\n div.className = \"bg-light border shadow-sm mb-3 rounded\";\n div.setAttribute(\"data-section\", \"textBox\");\n div.setAttribute(\"data-index\", index);\n div.innerHTML = inputTemplate;\n div.querySelector('[data-input=\"font\"]').value = data.font;\n div.querySelector('[data-input=\"textAlign\"]').value = data.textAlign;\n div.querySelector('[data-input=\"allCaps\"]').checked = data.allCaps;\n return fragment.appendChild(div);\n};\n\n\nconst $64ef5d4149d7e6a5$export$e653a2de0f3a8b89 = (image, canvas, ctx, textOptions = [])=>{\n if (image == null) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n if (typeof image === \"string\") {\n ctx.fillStyle = image;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n } else ctx.drawImage(image, 0, 0, canvas.width, canvas.height);\n textOptions.forEach(function(item, index) {\n ctx.font = `${item.fontWeight} ${item.fontSize}px ${item.font}`;\n const multiplier = index + 1;\n const lineHeight = ctx.measureText(\"M\").width + item.fontSize / 2;\n const xPos = canvas.width / 2;\n const shadowBlur = item.shadowBlur;\n const text = item.allCaps === true ? item.text.toUpperCase() : item.text;\n const textLines = text.split(\"\\n\");\n ctx.fillStyle = item.fillColor;\n ctx.textAlign = item.textAlign;\n ctx.save();\n if (shadowBlur !== 0) {\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n ctx.shadowBlur = shadowBlur;\n ctx.shadowColor = item.shadowColor;\n }\n if (item.rotate) {\n ctx.translate(xPos + item.offsetX, lineHeight * multiplier + item.offsetY);\n ctx.rotate(item.rotate * Math.PI / 180);\n textLines.forEach((text, index)=>ctx.fillText(text, 0, index * lineHeight));\n ctx.rotate(-(item.rotate * Math.PI / 180));\n ctx.translate(-(xPos + item.offsetX), -(lineHeight * multiplier + item.offsetY));\n } else textLines.forEach((text, index)=>{\n ctx.fillText(text, xPos + item.offsetX, index * lineHeight + lineHeight * multiplier + item.offsetY);\n });\n ctx.restore();\n });\n};\n\n\nconst $85a5f86b715fe7db$var$videoModal = document.getElementById(\"videoModal\");\nconst $85a5f86b715fe7db$var$downloadModal = document.getElementById(\"downloadModal\");\nconst $85a5f86b715fe7db$var$canvas = document.getElementById(\"canvas\");\nconst $85a5f86b715fe7db$var$dropzoneEl = document.querySelector(\"files-dropzone\");\nconst $85a5f86b715fe7db$var$instructionsEl = document.getElementById(\"instructions\");\nconst $85a5f86b715fe7db$var$ctx = $85a5f86b715fe7db$var$canvas.getContext(\"2d\");\nconst $85a5f86b715fe7db$var$imageUploadMethodSelect = document.getElementById(\"imageUploadMethodSelect\");\nconst $85a5f86b715fe7db$var$fileSelectBtn = document.getElementById(\"fileSelectBtn\");\nconst $85a5f86b715fe7db$var$imageUrlForm = document.getElementById(\"imageUrlForm\");\nconst $85a5f86b715fe7db$var$addTextboxBtn = document.getElementById(\"addTextboxBtn\");\nconst $85a5f86b715fe7db$var$inputsContainer = document.getElementById(\"inputsContainer\");\nconst $85a5f86b715fe7db$var$generateMemeBtn = document.getElementById(\"generateMemeBtn\");\nconst $85a5f86b715fe7db$var$openVideoModalBtn = document.getElementById(\"openVideoModalBtn\");\nconst $85a5f86b715fe7db$var$downloadMemeBtn = document.getElementById(\"downloadMemeBtn\");\nconst $85a5f86b715fe7db$var$downloadMemePreview = document.getElementById(\"downloadMemePreview\");\nconst $85a5f86b715fe7db$var$webShareComponent = document.querySelector(\"web-share\");\nconst $85a5f86b715fe7db$var$galleryEl = document.getElementById(\"gallery\");\nconst $85a5f86b715fe7db$var$gallerySearchEl = document.getElementById(\"gallerySearch\");\nconst $85a5f86b715fe7db$var$galleryNoResultsEl = $85a5f86b715fe7db$var$galleryEl.querySelector(\".gallery__no-results\");\nconst $85a5f86b715fe7db$var$solidColorForm = document.getElementById(\"solidColorForm\");\nconst $85a5f86b715fe7db$var$uploadMethodEls = document.querySelectorAll(\".upload-method\");\nlet $85a5f86b715fe7db$var$selectedImage = null;\nlet $85a5f86b715fe7db$var$reqAnimFrame = null;\nconst $85a5f86b715fe7db$var$defaultTextOptions = {\n _isSettingsOpen: false,\n text: \"\",\n fillColor: \"#ffffff\",\n shadowColor: \"#000000\",\n font: \"Anton\",\n fontSize: 40,\n fontWeight: \"normal\",\n textAlign: \"center\",\n shadowBlur: 3,\n offsetY: 0,\n offsetX: 0,\n rotate: 0,\n allCaps: true\n};\nlet $85a5f86b715fe7db$var$textOptions = [\n {\n ...$85a5f86b715fe7db$var$defaultTextOptions\n }\n];\nconst $85a5f86b715fe7db$var$generateMeme = async ()=>{\n const dataUrl = $85a5f86b715fe7db$var$canvas.toDataURL(\"image/png\");\n // Prepare download link\n const downloadLink = dataUrl.replace(\"image/png\", \"image/octet-stream\");\n $85a5f86b715fe7db$var$downloadMemeBtn.download = `${(0, $17004b28c97c1306$export$e2a22331486dcca0)(\"meme\")}.png`;\n $85a5f86b715fe7db$var$downloadMemeBtn.href = downloadLink;\n $85a5f86b715fe7db$var$downloadMemePreview.src = downloadLink;\n // Prepare for sharing file\n if ((0, $7a2aca835bb05064$export$c37129e465f64ef0)()) try {\n const file = await (0, $0374350c629f125f$export$6539e087749cf9d3)({\n url: dataUrl,\n filename: `${(0, $17004b28c97c1306$export$e2a22331486dcca0)(\"meme\")}.png`,\n mimeType: \"image/png\"\n }).catch((err)=>(0, $3969451ff60cb8d5$export$af04143326425dbd)(err.message, \"danger\"));\n if (file && (0, $7a2aca835bb05064$export$c37129e465f64ef0)({\n files: [\n file\n ]\n })) {\n $85a5f86b715fe7db$var$webShareComponent.shareFiles = [\n file\n ];\n $85a5f86b715fe7db$var$webShareComponent.hidden = false;\n }\n } catch (error) {\n console.error(error);\n }\n $85a5f86b715fe7db$var$downloadModal.open = true;\n};\nconst $85a5f86b715fe7db$var$onImageLoaded = (evt)=>{\n const MAX_WIDTH = 800;\n const MAX_HEIGHT = 600;\n let width = evt.target.width;\n let height = evt.target.height;\n if (width > height) {\n if (width > MAX_WIDTH) {\n height *= MAX_WIDTH / width;\n width = MAX_WIDTH;\n }\n } else if (height > MAX_HEIGHT) {\n width *= MAX_HEIGHT / height;\n height = MAX_HEIGHT;\n }\n $85a5f86b715fe7db$var$canvas.width = width;\n $85a5f86b715fe7db$var$canvas.height = height;\n $85a5f86b715fe7db$var$selectedImage = evt.target;\n (0, $64ef5d4149d7e6a5$export$e653a2de0f3a8b89)($85a5f86b715fe7db$var$selectedImage, $85a5f86b715fe7db$var$canvas, $85a5f86b715fe7db$var$ctx, $85a5f86b715fe7db$var$textOptions);\n $85a5f86b715fe7db$var$generateMemeBtn.disabled = false;\n $85a5f86b715fe7db$var$canvas.hidden = false;\n $85a5f86b715fe7db$var$instructionsEl.hidden = true;\n};\nconst $85a5f86b715fe7db$var$handleSolidColorFormInput = (evt)=>{\n const DEFAULT_WIDTH = 600;\n const DEFAULT_HEIGHT = 400;\n if (evt.target === $85a5f86b715fe7db$var$solidColorForm[\"canvasColor\"]) $85a5f86b715fe7db$var$selectedImage = evt.target.value;\n if (typeof $85a5f86b715fe7db$var$selectedImage === \"string\") {\n $85a5f86b715fe7db$var$canvas.width = Number($85a5f86b715fe7db$var$solidColorForm[\"canvasWidth\"].value) || DEFAULT_WIDTH;\n $85a5f86b715fe7db$var$canvas.height = Number($85a5f86b715fe7db$var$solidColorForm[\"canvasHeight\"].value) || DEFAULT_HEIGHT;\n (0, $64ef5d4149d7e6a5$export$e653a2de0f3a8b89)($85a5f86b715fe7db$var$selectedImage, $85a5f86b715fe7db$var$canvas, $85a5f86b715fe7db$var$ctx, $85a5f86b715fe7db$var$textOptions);\n $85a5f86b715fe7db$var$generateMemeBtn.disabled = false;\n $85a5f86b715fe7db$var$canvas.hidden = false;\n $85a5f86b715fe7db$var$instructionsEl.hidden = true;\n }\n};\nconst $85a5f86b715fe7db$var$handleFileSelect = (file)=>{\n if (!file) return;\n const image = new Image();\n const reader = new FileReader();\n reader.addEventListener(\"load\", function(evt) {\n const data = evt.target.result;\n image.addEventListener(\"load\", $85a5f86b715fe7db$var$onImageLoaded);\n image.src = data;\n });\n reader.readAsDataURL(file);\n};\nconst $85a5f86b715fe7db$var$handleOpenVideoModalButtonClick = ()=>{\n $85a5f86b715fe7db$var$videoModal.open = true;\n};\nconst $85a5f86b715fe7db$var$handleTextPropChange = (element, index, prop)=>{\n if (element.type === \"checkbox\") $85a5f86b715fe7db$var$textOptions[index][prop] = element.checked;\n else if (element.type === \"number\") $85a5f86b715fe7db$var$textOptions[index][prop] = Number(element.value);\n else $85a5f86b715fe7db$var$textOptions[index][prop] = element.value;\n (0, $64ef5d4149d7e6a5$export$e653a2de0f3a8b89)($85a5f86b715fe7db$var$selectedImage, $85a5f86b715fe7db$var$canvas, $85a5f86b715fe7db$var$ctx, $85a5f86b715fe7db$var$textOptions);\n};\nconst $85a5f86b715fe7db$var$handleAddTextboxBtnClick = ()=>{\n const textOptionsLength = $85a5f86b715fe7db$var$textOptions.length;\n const newTextBox = (0, $224fa2388dce65c4$export$293a4b86a6fe2398)(textOptionsLength, $85a5f86b715fe7db$var$defaultTextOptions);\n $85a5f86b715fe7db$var$textOptions.push({\n ...$85a5f86b715fe7db$var$defaultTextOptions\n });\n $85a5f86b715fe7db$var$inputsContainer.appendChild(newTextBox);\n newTextBox.querySelector('[data-input=\"text\"]').focus();\n};\nconst $85a5f86b715fe7db$var$handleImageUploadFromURL = async (evt)=>{\n evt.preventDefault();\n const form = evt.target;\n const submitButton = form.querySelector('button[type=\"submit\"]');\n const imageUrl = form[\"imageUrl\"].value;\n if (!imageUrl.trim()) return;\n submitButton.disabled = true;\n submitButton.querySelector(\".spinner\").hidden = false;\n submitButton.querySelector(\".label\").hidden = true;\n try {\n const file = await (0, $0374350c629f125f$export$6539e087749cf9d3)({\n url: imageUrl\n }).catch((err)=>(0, $3969451ff60cb8d5$export$af04143326425dbd)(err.message, \"danger\"));\n if (file) $85a5f86b715fe7db$var$handleFileSelect(file);\n } catch (err) {\n (0, $3969451ff60cb8d5$export$af04143326425dbd)(`Failed to load image from \"${imageUrl}\".`, \"danger\");\n } finally{\n submitButton.disabled = false;\n submitButton.querySelector(\".spinner\").hidden = true;\n submitButton.querySelector(\".label\").hidden = false;\n }\n};\nconst $85a5f86b715fe7db$var$moveText = (offsetDir, sign, index)=>()=>{\n const textBoxSection = document.querySelectorAll('[data-section=\"textBox\"]')[index];\n const offsetYInput = textBoxSection.querySelector('[data-input=\"offsetY\"]');\n const offsetXInput = textBoxSection.querySelector('[data-input=\"offsetX\"]');\n if (offsetDir === \"offsetY\") {\n if (sign === \"-\") $85a5f86b715fe7db$var$textOptions[index].offsetY -= 1;\n if (sign === \"+\") $85a5f86b715fe7db$var$textOptions[index].offsetY += 1;\n offsetYInput.value = $85a5f86b715fe7db$var$textOptions[index].offsetY;\n }\n if (offsetDir === \"offsetX\") {\n if (sign === \"-\") $85a5f86b715fe7db$var$textOptions[index].offsetX -= 1;\n if (sign === \"+\") $85a5f86b715fe7db$var$textOptions[index].offsetX += 1;\n offsetXInput.value = $85a5f86b715fe7db$var$textOptions[index].offsetX;\n }\n (0, $64ef5d4149d7e6a5$export$e653a2de0f3a8b89)($85a5f86b715fe7db$var$selectedImage, $85a5f86b715fe7db$var$canvas, $85a5f86b715fe7db$var$ctx, $85a5f86b715fe7db$var$textOptions);\n $85a5f86b715fe7db$var$reqAnimFrame = requestAnimationFrame($85a5f86b715fe7db$var$moveText(offsetDir, sign, index));\n };\nconst $85a5f86b715fe7db$var$handleUploadMethodChange = (evt)=>{\n $85a5f86b715fe7db$var$uploadMethodEls.forEach((el)=>el.hidden = el.id !== evt.target.value);\n};\nconst $85a5f86b715fe7db$var$handleFileSelectClick = ()=>{\n if (typeof $85a5f86b715fe7db$var$dropzoneEl.openFileDialog === \"function\") $85a5f86b715fe7db$var$dropzoneEl.openFileDialog();\n};\nconst $85a5f86b715fe7db$var$handleDropFilesAccepted = (evt)=>{\n const [file] = evt.detail.acceptedFiles;\n if (file) $85a5f86b715fe7db$var$handleFileSelect(file);\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerInput = (evt)=>{\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let prop;\n if (element.matches('[data-input=\"text\"]')) prop = \"text\";\n else if (element.matches('[data-input=\"fillColor\"]')) prop = \"fillColor\";\n else if (element.matches('[data-input=\"shadowColor\"]')) prop = \"shadowColor\";\n else if (element.matches('[data-input=\"font\"]')) prop = \"font\";\n else if (element.matches('[data-input=\"fontSize\"]')) prop = \"fontSize\";\n else if (element.matches('[data-input=\"fontWeight\"]')) prop = \"fontWeight\";\n else if (element.matches('[data-input=\"textAlign\"]')) prop = \"textAlign\";\n else if (element.matches('[data-input=\"shadowBlur\"]')) prop = \"shadowBlur\";\n else if (element.matches('[data-input=\"offsetY\"]')) prop = \"offsetY\";\n else if (element.matches('[data-input=\"offsetX\"]')) prop = \"offsetX\";\n else if (element.matches('[data-input=\"rotate\"]')) prop = \"rotate\";\n if (prop) $85a5f86b715fe7db$var$handleTextPropChange(element, index, prop);\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerChange = (evt)=>{\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let prop;\n if (element.matches('[data-input=\"allCaps\"]')) prop = \"allCaps\";\n if (prop) $85a5f86b715fe7db$var$handleTextPropChange(element, index, prop);\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerClick = (evt)=>{\n const element = evt.target;\n if (element.matches('[data-button=\"settings\"]')) {\n const textBoxIndex = element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\");\n const textBoxEls = document.querySelectorAll('[data-section=\"textBox\"]');\n textBoxEls.forEach((el, index)=>{\n const settingsEl = el.querySelector('[data-section=\"settings\"]');\n if (el.getAttribute(\"data-index\") === textBoxIndex) {\n settingsEl.hidden = !settingsEl.hidden;\n $85a5f86b715fe7db$var$textOptions[index]._isSettingsOpen = !$85a5f86b715fe7db$var$textOptions[index]._isSettingsOpen;\n } else {\n settingsEl.hidden = true;\n $85a5f86b715fe7db$var$textOptions[index]._isSettingsOpen = false;\n }\n });\n }\n if (element.matches('[data-button=\"delete-text-box\"]')) {\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let confirm = true;\n if ($85a5f86b715fe7db$var$textOptions[index].text.trim()) confirm = window.confirm(\"Are you sure you want to remove this text box?\");\n if (confirm) {\n $85a5f86b715fe7db$var$textOptions = (0, $4af3d380d1884504$export$30a014203d0d7e4f)($85a5f86b715fe7db$var$textOptions, index);\n $85a5f86b715fe7db$var$inputsContainer.querySelectorAll('[data-section=\"textBox\"]').forEach((el)=>el.remove());\n $85a5f86b715fe7db$var$textOptions.forEach((item, index)=>$85a5f86b715fe7db$var$inputsContainer.appendChild((0, $224fa2388dce65c4$export$293a4b86a6fe2398)(index, item)));\n (0, $64ef5d4149d7e6a5$export$e653a2de0f3a8b89)($85a5f86b715fe7db$var$selectedImage, $85a5f86b715fe7db$var$canvas, $85a5f86b715fe7db$var$ctx, $85a5f86b715fe7db$var$textOptions);\n }\n }\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerPointerdown = (evt)=>{\n const element = evt.target;\n const textBoxEl = element.closest('[data-section=\"textBox\"]');\n if (!textBoxEl) return;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton) return;\n const offsetDir = element.getAttribute(\"data-move\");\n const sign = element.getAttribute(\"data-sign\");\n $85a5f86b715fe7db$var$reqAnimFrame = requestAnimationFrame($85a5f86b715fe7db$var$moveText(offsetDir, sign, index));\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerPointerup = (evt)=>{\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton) return;\n cancelAnimationFrame($85a5f86b715fe7db$var$reqAnimFrame);\n $85a5f86b715fe7db$var$reqAnimFrame = null;\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerPointerout = (evt)=>{\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton || !$85a5f86b715fe7db$var$reqAnimFrame) return;\n cancelAnimationFrame($85a5f86b715fe7db$var$reqAnimFrame);\n $85a5f86b715fe7db$var$reqAnimFrame = null;\n};\nconst $85a5f86b715fe7db$var$handleGalleryClick = async (evt)=>{\n const button = evt.target.closest(\"button\");\n if (!button) return;\n const img = button.querySelector(\"img\");\n try {\n const file = await (0, $0374350c629f125f$export$6539e087749cf9d3)({\n url: img.src\n }).catch((err)=>(0, $3969451ff60cb8d5$export$af04143326425dbd)(err.message, \"danger\"));\n if (file) $85a5f86b715fe7db$var$handleFileSelect(file);\n } catch (err) {\n (0, $3969451ff60cb8d5$export$af04143326425dbd)(`Failed to load image: \"${img.alt}\".`, \"danger\");\n }\n};\nconst $85a5f86b715fe7db$var$handleGallerySearchInput = (evt)=>{\n const query = evt.target.value.toLowerCase().trim();\n const galleryItems = $85a5f86b715fe7db$var$galleryEl.querySelectorAll(\"button\");\n galleryItems.forEach((item)=>{\n const alt = (item.querySelector(\"img\").getAttribute(\"alt\") || \"\").toLowerCase();\n item.hidden = !alt.includes(query);\n });\n $85a5f86b715fe7db$var$galleryNoResultsEl.hidden = !!$85a5f86b715fe7db$var$galleryEl.querySelector(\"button:not([hidden])\");\n};\nconst $85a5f86b715fe7db$var$handleWebShareError = ()=>{\n $85a5f86b715fe7db$var$downloadModal.open = false;\n (0, $3969451ff60cb8d5$export$af04143326425dbd)(\"There was an error while trying to share your meme.\", \"danger\");\n};\nconst $85a5f86b715fe7db$var$handleCapturePhotoError = (evt)=>{\n console.error(evt.detail.error);\n (0, $3969451ff60cb8d5$export$af04143326425dbd)(evt.detail.error.message, \"danger\");\n};\nconst $85a5f86b715fe7db$var$handleCapturePhotoSuccess = (evt)=>{\n $85a5f86b715fe7db$var$videoModal.open = false;\n const image = new Image();\n image.addEventListener(\"load\", $85a5f86b715fe7db$var$onImageLoaded);\n image.src = evt.detail.dataURI;\n};\nconst $85a5f86b715fe7db$var$handleModalOpen = (evt)=>{\n if (evt.target.id === \"videoModal\") {\n const capturePhotoComponent = $85a5f86b715fe7db$var$videoModal.querySelector(\"capture-photo\");\n if (capturePhotoComponent && typeof capturePhotoComponent.startVideoStream === \"function\") capturePhotoComponent.startVideoStream();\n }\n};\nconst $85a5f86b715fe7db$var$handleModalClose = (evt)=>{\n if (evt.target.id === \"videoModal\") {\n const capturePhotoComponent = $85a5f86b715fe7db$var$videoModal.querySelector(\"capture-photo\");\n if (capturePhotoComponent && typeof capturePhotoComponent.stopVideoStream === \"function\") capturePhotoComponent.stopVideoStream();\n }\n};\n$85a5f86b715fe7db$var$fileSelectBtn.addEventListener(\"click\", $85a5f86b715fe7db$var$handleFileSelectClick);\n$85a5f86b715fe7db$var$openVideoModalBtn.addEventListener(\"click\", $85a5f86b715fe7db$var$handleOpenVideoModalButtonClick);\n$85a5f86b715fe7db$var$addTextboxBtn.addEventListener(\"click\", $85a5f86b715fe7db$var$handleAddTextboxBtnClick);\n$85a5f86b715fe7db$var$generateMemeBtn.addEventListener(\"click\", $85a5f86b715fe7db$var$generateMeme);\n$85a5f86b715fe7db$var$downloadMemeBtn.addEventListener(\"click\", ()=>$85a5f86b715fe7db$var$downloadModal.open = false);\n$85a5f86b715fe7db$var$imageUrlForm.addEventListener(\"submit\", $85a5f86b715fe7db$var$handleImageUploadFromURL);\n$85a5f86b715fe7db$var$dropzoneEl.addEventListener(\"files-dropzone-drop-accepted\", $85a5f86b715fe7db$var$handleDropFilesAccepted);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"input\", $85a5f86b715fe7db$var$handleInputsContainerInput);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"change\", $85a5f86b715fe7db$var$handleInputsContainerChange);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"click\", $85a5f86b715fe7db$var$handleInputsContainerClick);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"pointerdown\", $85a5f86b715fe7db$var$handleInputsContainerPointerdown);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"pointerup\", $85a5f86b715fe7db$var$handleInputsContainerPointerup);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"pointerout\", $85a5f86b715fe7db$var$handleInputsContainerPointerout);\n$85a5f86b715fe7db$var$imageUploadMethodSelect.addEventListener(\"change\", $85a5f86b715fe7db$var$handleUploadMethodChange);\n$85a5f86b715fe7db$var$galleryEl.addEventListener(\"click\", $85a5f86b715fe7db$var$handleGalleryClick);\n$85a5f86b715fe7db$var$gallerySearchEl.addEventListener(\"input\", $85a5f86b715fe7db$var$handleGallerySearchInput);\n$85a5f86b715fe7db$var$solidColorForm.addEventListener(\"input\", $85a5f86b715fe7db$var$handleSolidColorFormInput);\ndocument.addEventListener(\"web-share:error\", $85a5f86b715fe7db$var$handleWebShareError);\ndocument.addEventListener(\"capture-photo:error\", $85a5f86b715fe7db$var$handleCapturePhotoError);\ndocument.addEventListener(\"capture-photo:success\", $85a5f86b715fe7db$var$handleCapturePhotoSuccess);\ndocument.addEventListener(\"me-open\", $85a5f86b715fe7db$var$handleModalOpen);\ndocument.addEventListener(\"me-close\", $85a5f86b715fe7db$var$handleModalClose);\n$85a5f86b715fe7db$var$galleryEl.querySelectorAll(\"button > img\")?.forEach((image)=>{\n image.setAttribute(\"title\", image.getAttribute(\"alt\"));\n});\n$85a5f86b715fe7db$var$textOptions.forEach((item, index)=>{\n $85a5f86b715fe7db$var$inputsContainer.appendChild((0, $224fa2388dce65c4$export$293a4b86a6fe2398)(index, item));\n});\n$85a5f86b715fe7db$var$dropzoneEl.accept = (0, $65136e012e05e2d7$export$63e7bed68b07a85c);\n(0, $56b863c8b6be7003$export$6874249d87f2602a).forEach(({ name: name, path: path, style: style, weight: weight })=>{\n (0, $56b863c8b6be7003$export$59eceaef0c7797b2)(name, path, {\n style: style,\n weight: weight\n });\n});\n\n\n//# sourceMappingURL=index.0ec871bb.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","require('./helpers/bundle-manifest').register(new __parcel__URL__(\"\").toString(),JSON.parse(\"[\\\"eq2Ey\\\",\\\"index.0ec871bb.js\\\",\\\"9jzSS\\\",\\\"Anton-Regular.e58ab3fe.ttf\\\",\\\"hr5Pp\\\",\\\"Oswald-Regular.89ec7d89.ttf\\\",\\\"5TebC\\\",\\\"Oswald-Bold.0f6a7ca6.ttf\\\",\\\"3ENF9\\\",\\\"Roboto-Regular.ca197847.ttf\\\",\\\"5yAXK\\\",\\\"Roboto-Bold.fdb9b54a.ttf\\\",\\\"k2KZ9\\\",\\\"RobotoCondensed-Regular.d585f5c7.ttf\\\",\\\"4h4UX\\\",\\\"RobotoCondensed-Bold.e1f96d4b.ttf\\\",\\\"8pomG\\\",\\\"CourierPrime-Regular.3a25a501.ttf\\\",\\\"l2v76\\\",\\\"CourierPrime-Bold.3d6bf689.ttf\\\",\\\"eKMWr\\\",\\\"OpenSans-Regular.edf9e01b.ttf\\\",\\\"dXO1Z\\\",\\\"OpenSans-Bold.8fceb72b.ttf\\\",\\\"9FH7D\\\",\\\"index.2d751096.css\\\"]\"));","import { isWebShareSupported } from '@georapbox/web-share-element/dist/is-web-share-supported.js';\nimport '@georapbox/web-share-element/dist/web-share-defined.js';\nimport '@georapbox/capture-photo-element/dist/capture-photo-defined.js';\nimport '@georapbox/modal-element/dist/modal-element-defined.js';\nimport '@georapbox/files-dropzone-element/dist/files-dropzone-defined.js';\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport '../css/main.css';\nimport { arrayRemove } from './utils/array-remove.js';\nimport { uid } from './utils/uid.js';\nimport { ACCEPTED_MIME_TYPES } from './constants.js';\nimport { customFonts, loadCustomFont } from './custom-fonts.js';\nimport { fileFromUrl } from './file-from-url.js';\nimport { toastAlert } from './toast-alert.js';\nimport { createTextBox } from './create-text-box.js';\nimport { drawCanvas } from './draw-canvas.js';\n\nconst videoModal = document.getElementById('videoModal');\nconst downloadModal = document.getElementById('downloadModal');\nconst canvas = document.getElementById('canvas');\nconst dropzoneEl = document.querySelector('files-dropzone');\nconst instructionsEl = document.getElementById('instructions');\nconst ctx = canvas.getContext('2d');\nconst imageUploadMethodSelect = document.getElementById('imageUploadMethodSelect');\nconst fileSelectBtn = document.getElementById('fileSelectBtn');\nconst imageUrlForm = document.getElementById('imageUrlForm');\nconst addTextboxBtn = document.getElementById('addTextboxBtn');\nconst inputsContainer = document.getElementById('inputsContainer');\nconst generateMemeBtn = document.getElementById('generateMemeBtn');\nconst openVideoModalBtn = document.getElementById('openVideoModalBtn');\nconst downloadMemeBtn = document.getElementById('downloadMemeBtn');\nconst downloadMemePreview = document.getElementById('downloadMemePreview');\nconst webShareComponent = document.querySelector('web-share');\nconst galleryEl = document.getElementById('gallery');\nconst gallerySearchEl = document.getElementById('gallerySearch');\nconst galleryNoResultsEl = galleryEl.querySelector('.gallery__no-results');\nconst solidColorForm = document.getElementById('solidColorForm');\nconst uploadMethodEls = document.querySelectorAll('.upload-method');\nlet selectedImage = null;\nlet reqAnimFrame = null;\n\nconst defaultTextOptions = {\n _isSettingsOpen: false,\n text: '',\n fillColor: '#ffffff',\n shadowColor: '#000000',\n font: 'Anton',\n fontSize: 40,\n fontWeight: 'normal',\n textAlign: 'center',\n shadowBlur: 3,\n offsetY: 0,\n offsetX: 0,\n rotate: 0,\n allCaps: true\n};\n\nlet textOptions = [\n { ...defaultTextOptions }\n];\n\nconst generateMeme = async () => {\n const dataUrl = canvas.toDataURL('image/png');\n\n // Prepare download link\n const downloadLink = dataUrl.replace('image/png', 'image/octet-stream');\n downloadMemeBtn.download = `${uid('meme')}.png`;\n downloadMemeBtn.href = downloadLink;\n downloadMemePreview.src = downloadLink;\n\n // Prepare for sharing file\n if (isWebShareSupported()) {\n try {\n const file = await fileFromUrl({\n url: dataUrl,\n filename: `${uid('meme')}.png`,\n mimeType: 'image/png'\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file && isWebShareSupported({ files: [file] })) {\n webShareComponent.shareFiles = [file];\n webShareComponent.hidden = false;\n }\n } catch (error) {\n console.error(error);\n }\n }\n\n downloadModal.open = true;\n};\n\nconst onImageLoaded = evt => {\n const MAX_WIDTH = 800;\n const MAX_HEIGHT = 600;\n let width = evt.target.width;\n let height = evt.target.height;\n\n if (width > height) {\n if (width > MAX_WIDTH) {\n height *= MAX_WIDTH / width;\n width = MAX_WIDTH;\n }\n } else {\n if (height > MAX_HEIGHT) {\n width *= MAX_HEIGHT / height;\n height = MAX_HEIGHT;\n }\n }\n canvas.width = width;\n canvas.height = height;\n\n selectedImage = evt.target;\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n generateMemeBtn.disabled = false;\n canvas.hidden = false;\n instructionsEl.hidden = true;\n};\n\nconst handleSolidColorFormInput = evt => {\n const DEFAULT_WIDTH = 600;\n const DEFAULT_HEIGHT = 400;\n\n if (evt.target === solidColorForm['canvasColor']) {\n selectedImage = evt.target.value;\n }\n\n if (typeof selectedImage === 'string') {\n canvas.width = Number(solidColorForm['canvasWidth'].value) || DEFAULT_WIDTH;\n canvas.height = Number(solidColorForm['canvasHeight'].value) || DEFAULT_HEIGHT;\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n generateMemeBtn.disabled = false;\n canvas.hidden = false;\n instructionsEl.hidden = true;\n }\n};\n\nconst handleFileSelect = file => {\n if (!file) {\n return;\n }\n\n const image = new Image();\n const reader = new FileReader();\n\n reader.addEventListener('load', function (evt) {\n const data = evt.target.result;\n image.addEventListener('load', onImageLoaded);\n image.src = data;\n });\n\n reader.readAsDataURL(file);\n};\n\nconst handleOpenVideoModalButtonClick = () => {\n videoModal.open = true;\n};\n\nconst handleTextPropChange = (element, index, prop) => {\n if (element.type === 'checkbox') {\n textOptions[index][prop] = element.checked;\n } else if (element.type === 'number') {\n textOptions[index][prop] = Number(element.value);\n } else {\n textOptions[index][prop] = element.value;\n }\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n};\n\nconst handleAddTextboxBtnClick = () => {\n const textOptionsLength = textOptions.length;\n const newTextBox = createTextBox(textOptionsLength, defaultTextOptions);\n\n textOptions.push({ ...defaultTextOptions });\n inputsContainer.appendChild(newTextBox);\n newTextBox.querySelector('[data-input=\"text\"]').focus();\n};\n\nconst handleImageUploadFromURL = async evt => {\n evt.preventDefault();\n\n const form = evt.target;\n const submitButton = form.querySelector('button[type=\"submit\"]');\n const imageUrl = form['imageUrl'].value;\n\n if (!imageUrl.trim()) {\n return;\n }\n\n submitButton.disabled = true;\n submitButton.querySelector('.spinner').hidden = false;\n submitButton.querySelector('.label').hidden = true;\n\n try {\n const file = await fileFromUrl({\n url: imageUrl\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file) {\n handleFileSelect(file);\n }\n } catch (err) {\n toastAlert(`Failed to load image from \"${imageUrl}\".`, 'danger');\n } finally {\n submitButton.disabled = false;\n submitButton.querySelector('.spinner').hidden = true;\n submitButton.querySelector('.label').hidden = false;\n }\n};\n\nconst moveText = (offsetDir, sign, index) => () => {\n const textBoxSection = document.querySelectorAll('[data-section=\"textBox\"]')[index];\n const offsetYInput = textBoxSection.querySelector('[data-input=\"offsetY\"]');\n const offsetXInput = textBoxSection.querySelector('[data-input=\"offsetX\"]');\n\n if (offsetDir === 'offsetY') {\n if (sign === '-') {\n textOptions[index].offsetY -= 1;\n }\n\n if (sign === '+') {\n textOptions[index].offsetY += 1;\n }\n\n offsetYInput.value = textOptions[index].offsetY;\n }\n\n if (offsetDir === 'offsetX') {\n if (sign === '-') {\n textOptions[index].offsetX -= 1;\n }\n\n if (sign === '+') {\n textOptions[index].offsetX += 1;\n }\n\n offsetXInput.value = textOptions[index].offsetX;\n }\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n reqAnimFrame = requestAnimationFrame(moveText(offsetDir, sign, index));\n};\n\nconst handleUploadMethodChange = evt => {\n uploadMethodEls.forEach(el => el.hidden = el.id !== evt.target.value);\n};\n\nconst handleFileSelectClick = () => {\n if (typeof dropzoneEl.openFileDialog === 'function') {\n dropzoneEl.openFileDialog();\n }\n};\n\nconst handleDropFilesAccepted = evt => {\n const [file] = evt.detail.acceptedFiles;\n\n if (file) {\n handleFileSelect(file);\n }\n};\n\nconst handleInputsContainerInput = evt => {\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let prop;\n\n if (element.matches('[data-input=\"text\"]')) {\n prop = 'text';\n } else if (element.matches('[data-input=\"fillColor\"]')) {\n prop = 'fillColor';\n } else if (element.matches('[data-input=\"shadowColor\"]')) {\n prop = 'shadowColor';\n } else if (element.matches('[data-input=\"font\"]')) {\n prop = 'font';\n } else if (element.matches('[data-input=\"fontSize\"]')) {\n prop = 'fontSize';\n } else if (element.matches('[data-input=\"fontWeight\"]')) {\n prop = 'fontWeight';\n } else if (element.matches('[data-input=\"textAlign\"]')) {\n prop = 'textAlign';\n } else if (element.matches('[data-input=\"shadowBlur\"]')) {\n prop = 'shadowBlur';\n } else if (element.matches('[data-input=\"offsetY\"]')) {\n prop = 'offsetY';\n } else if (element.matches('[data-input=\"offsetX\"]')) {\n prop = 'offsetX';\n } else if (element.matches('[data-input=\"rotate\"]')) {\n prop = 'rotate';\n }\n\n if (prop) {\n handleTextPropChange(element, index, prop);\n }\n};\n\nconst handleInputsContainerChange = evt => {\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let prop;\n\n if (element.matches('[data-input=\"allCaps\"]')) {\n prop = 'allCaps';\n }\n\n if (prop) {\n handleTextPropChange(element, index, prop);\n }\n};\n\nconst handleInputsContainerClick = evt => {\n const element = evt.target;\n\n if (element.matches('[data-button=\"settings\"]')) {\n const textBoxIndex = element.closest('[data-section=\"textBox\"]').getAttribute('data-index');\n const textBoxEls = document.querySelectorAll('[data-section=\"textBox\"]');\n\n textBoxEls.forEach((el, index) => {\n const settingsEl = el.querySelector('[data-section=\"settings\"]');\n\n if (el.getAttribute('data-index') === textBoxIndex) {\n settingsEl.hidden = !settingsEl.hidden;\n textOptions[index]._isSettingsOpen = !textOptions[index]._isSettingsOpen;\n } else {\n settingsEl.hidden = true;\n textOptions[index]._isSettingsOpen = false;\n }\n });\n }\n\n if (element.matches('[data-button=\"delete-text-box\"]')) {\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let confirm = true;\n\n if (textOptions[index].text.trim()) {\n confirm = window.confirm('Are you sure you want to remove this text box?');\n }\n\n if (confirm) {\n textOptions = arrayRemove(textOptions, index);\n inputsContainer.querySelectorAll('[data-section=\"textBox\"]').forEach(el => el.remove());\n textOptions.forEach((item, index) => inputsContainer.appendChild(createTextBox(index, item)));\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n }\n }\n};\n\nconst handleInputsContainerPointerdown = evt => {\n const element = evt.target;\n const textBoxEl = element.closest('[data-section=\"textBox\"]');\n\n if (!textBoxEl) {\n return;\n }\n\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton) {\n return;\n }\n\n const offsetDir = element.getAttribute('data-move');\n const sign = element.getAttribute('data-sign');\n\n reqAnimFrame = requestAnimationFrame(moveText(offsetDir, sign, index));\n};\n\nconst handleInputsContainerPointerup = evt => {\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton) {\n return;\n }\n\n cancelAnimationFrame(reqAnimFrame);\n reqAnimFrame = null;\n};\n\nconst handleInputsContainerPointerout = evt => {\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton || !reqAnimFrame) {\n return;\n }\n\n cancelAnimationFrame(reqAnimFrame);\n reqAnimFrame = null;\n};\n\nconst handleGalleryClick = async evt => {\n const button = evt.target.closest('button');\n\n if (!button) {\n return;\n }\n\n const img = button.querySelector('img');\n\n try {\n const file = await fileFromUrl({\n url: img.src\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file) {\n handleFileSelect(file);\n }\n } catch (err) {\n toastAlert(`Failed to load image: \"${img.alt}\".`, 'danger');\n }\n};\n\nconst handleGallerySearchInput = evt => {\n const query = evt.target.value.toLowerCase().trim();\n const galleryItems = galleryEl.querySelectorAll('button');\n\n galleryItems.forEach(item => {\n const alt = (item.querySelector('img').getAttribute('alt') || '').toLowerCase();\n item.hidden = !alt.includes(query);\n });\n\n galleryNoResultsEl.hidden = !!galleryEl.querySelector('button:not([hidden])');\n};\n\nconst handleWebShareError = () => {\n downloadModal.open = false;\n toastAlert('There was an error while trying to share your meme.', 'danger');\n};\n\nconst handleCapturePhotoError = evt => {\n console.error(evt.detail.error);\n toastAlert(evt.detail.error.message, 'danger');\n};\n\nconst handleCapturePhotoSuccess = evt => {\n videoModal.open = false;\n const image = new Image();\n image.addEventListener('load', onImageLoaded);\n image.src = evt.detail.dataURI;\n};\n\nconst handleModalOpen = evt => {\n if (evt.target.id === 'videoModal') {\n const capturePhotoComponent = videoModal.querySelector('capture-photo');\n\n if (capturePhotoComponent && typeof capturePhotoComponent.startVideoStream === 'function') {\n capturePhotoComponent.startVideoStream();\n }\n }\n};\n\nconst handleModalClose = evt => {\n if (evt.target.id === 'videoModal') {\n const capturePhotoComponent = videoModal.querySelector('capture-photo');\n\n if (capturePhotoComponent && typeof capturePhotoComponent.stopVideoStream === 'function') {\n capturePhotoComponent.stopVideoStream();\n }\n }\n};\n\nfileSelectBtn.addEventListener('click', handleFileSelectClick);\nopenVideoModalBtn.addEventListener('click', handleOpenVideoModalButtonClick);\naddTextboxBtn.addEventListener('click', handleAddTextboxBtnClick);\ngenerateMemeBtn.addEventListener('click', generateMeme);\ndownloadMemeBtn.addEventListener('click', () => downloadModal.open = false);\nimageUrlForm.addEventListener('submit', handleImageUploadFromURL);\ndropzoneEl.addEventListener('files-dropzone-drop-accepted', handleDropFilesAccepted);\ninputsContainer.addEventListener('input', handleInputsContainerInput);\ninputsContainer.addEventListener('change', handleInputsContainerChange);\ninputsContainer.addEventListener('click', handleInputsContainerClick);\ninputsContainer.addEventListener('pointerdown', handleInputsContainerPointerdown);\ninputsContainer.addEventListener('pointerup', handleInputsContainerPointerup);\ninputsContainer.addEventListener('pointerout', handleInputsContainerPointerout);\nimageUploadMethodSelect.addEventListener('change', handleUploadMethodChange);\ngalleryEl.addEventListener('click', handleGalleryClick);\ngallerySearchEl.addEventListener('input', handleGallerySearchInput);\nsolidColorForm.addEventListener('input', handleSolidColorFormInput);\ndocument.addEventListener('web-share:error', handleWebShareError);\ndocument.addEventListener('capture-photo:error', handleCapturePhotoError);\ndocument.addEventListener('capture-photo:success', handleCapturePhotoSuccess);\ndocument.addEventListener('me-open', handleModalOpen);\ndocument.addEventListener('me-close', handleModalClose);\n\ngalleryEl.querySelectorAll('button > img')?.forEach(image => {\n image.setAttribute('title', image.getAttribute('alt'));\n});\n\ntextOptions.forEach((item, index) => {\n inputsContainer.appendChild(createTextBox(index, item));\n});\n\ndropzoneEl.accept = ACCEPTED_MIME_TYPES;\n\ncustomFonts.forEach(({ name, path, style, weight }) => {\n loadCustomFont(name, path, { style, weight });\n});\n","function a(a){return null!==a&&\"object\"==typeof a?\"share\"in navigator&&\"canShare\"in navigator&&navigator.canShare(a):\"share\"in navigator}export{a as isWebShareSupported};\n//# sourceMappingURL=is-web-share-supported.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $e179325634270afd$exports = {};\n\n$parcel$export($e179325634270afd$exports, \"WebShare\", function () { return $e179325634270afd$export$30b344bef3e55b67; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ /**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */ const $e179325634270afd$var$styles = /* css */ `\n :host {\n display: inline-block;\n }\n`;\nconst $e179325634270afd$var$template = document.createElement(\"template\");\n$e179325634270afd$var$template.innerHTML = /* html */ `\n \n \n`;\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */ class $e179325634270afd$export$30b344bef3e55b67 extends HTMLElement {\n /** @type {Nullable} */ #buttonSlot;\n /** @type {Nullable} */ #buttonEl;\n /** @type {File[]} */ #files = [];\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\",\n delegatesFocus: true\n });\n shadowRoot.appendChild($e179325634270afd$var$template.content.cloneNode(true));\n }\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"disabled\" && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute(\"disabled\", this.disabled);\n this.#buttonEl.setAttribute(\"aria-disabled\", this.disabled.toString());\n if (this.#buttonEl.part && this.#buttonEl.part.contains(\"button\")) this.#buttonEl.part.toggle(\"button--disabled\", this.disabled);\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"shareUrl\");\n this.#upgradeProperty(\"shareTitle\");\n this.#upgradeProperty(\"shareText\");\n this.#upgradeProperty(\"shareFiles\");\n this.#upgradeProperty(\"disabled\");\n this.#buttonSlot?.addEventListener(\"slotchange\", this.#handleSlotChange);\n this.#buttonEl?.addEventListener(\"click\", this.#handleClick);\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#buttonSlot?.removeEventListener(\"slotchange\", this.#handleSlotChange);\n this.#buttonEl?.removeEventListener(\"click\", this.#handleClick);\n }\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */ get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(value) {\n this.toggleAttribute(\"disabled\", !!value);\n }\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */ get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(value) {\n this.setAttribute(\"share-url\", value);\n }\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */ get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(value) {\n this.setAttribute(\"share-title\", value);\n }\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */ get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(value) {\n this.setAttribute(\"share-text\", value);\n }\n /**\n * @type {File[]} - The files to share.\n */ get shareFiles() {\n return this.#files;\n }\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) this.#files = value;\n }\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */ async share() {\n if (this.disabled) return;\n try {\n /** @type {ShareData} */ const shareData = {};\n if (this.shareUrl) shareData.url = this.shareUrl;\n if (this.shareTitle) shareData.title = this.shareTitle;\n if (this.shareText) shareData.text = this.shareText;\n if (Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n })) shareData.files = this.shareFiles;\n await navigator.share(shareData);\n this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: true,\n composed: true,\n detail: {\n shareData: shareData\n }\n }));\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n }\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */ #handleClick = (evt)=>{\n evt.preventDefault();\n if (this.disabled) return;\n this.share();\n };\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */ #handleSlotChange = (evt)=>{\n if (evt.target && evt.target.name === \"button\") {\n this.#buttonEl?.removeEventListener(\"click\", this.#handleClick);\n this.#buttonEl = this.#getButton();\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener(\"click\", this.#handleClick);\n if (this.#buttonEl.nodeName !== \"BUTTON\" && !this.#buttonEl.hasAttribute(\"role\")) this.#buttonEl.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */ #getButton() {\n if (!this.#buttonSlot) return null;\n return this.#buttonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"button\";\n }) || null;\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"web-share\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $e179325634270afd$export$30b344bef3e55b67);\n }\n}\n\n\n(0, $e179325634270afd$export$30b344bef3e55b67).defineCustomElement();\n\n\nexport {$e179325634270afd$export$30b344bef3e55b67 as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","// @ts-check\n\n/**\n * Check if Web Share API is supported by the platform.\n *\n * @param {import('./web-share').ShareData} [options]\n * @returns {boolean} Returns `true` if Web Share API is supported; otherwise `false`.\n */\nfunction isWebShareSupported(options) {\n if (options !== null && typeof options === 'object') {\n return 'share' in navigator && 'canShare' in navigator && navigator.canShare(options);\n }\n\n return 'share' in navigator;\n}\n\nexport { isWebShareSupported };\n","Object.defineProperty({},\"WebShare\",{get:function(){return s},set:void 0,enumerable:!0,configurable:!0});let t=`\n :host {\n display: inline-block;\n }\n`,e=document.createElement(\"template\");e.innerHTML=`\n \n \n`;class s extends HTMLElement{#t;#e;#s=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(e.content.cloneNode(!0)),this.#t=this.shadowRoot?.querySelector('slot[name=\"button\"]')||null,this.#e=this.#i()}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,e,s){\"disabled\"===t&&e!==s&&this.#e&&(this.#e.toggleAttribute(\"disabled\",this.disabled),this.#e.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#e.part&&this.#e.part.contains(\"button\")&&this.#e.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#r(\"shareUrl\"),this.#r(\"shareTitle\"),this.#r(\"shareText\"),this.#r(\"shareFiles\"),this.#r(\"disabled\"),this.#t?.addEventListener(\"slotchange\",this.#a),this.#e?.addEventListener(\"click\",this.#n)}disconnectedCallback(){this.#t?.removeEventListener(\"slotchange\",this.#a),this.#e?.removeEventListener(\"click\",this.#n)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get shareUrl(){return this.getAttribute(\"share-url\")||\"\"}set shareUrl(t){this.setAttribute(\"share-url\",t)}get shareTitle(){return this.getAttribute(\"share-title\")||\"\"}set shareTitle(t){this.setAttribute(\"share-title\",t)}get shareText(){return this.getAttribute(\"share-text\")||\"\"}set shareText(t){this.setAttribute(\"share-text\",t)}get shareFiles(){return this.#s}set shareFiles(t){Array.isArray(t)&&t.length>0&&(this.#s=t)}async share(){if(!this.disabled)try{let t={};this.shareUrl&&(t.url=this.shareUrl),this.shareTitle&&(t.title=this.shareTitle),this.shareText&&(t.text=this.shareText),Array.isArray(this.shareFiles)&&this.shareFiles.length>0&&navigator.canShare&&navigator.canShare({files:this.shareFiles})&&(t.files=this.shareFiles),await navigator.share(t),this.dispatchEvent(new CustomEvent(\"web-share:success\",{bubbles:!0,composed:!0,detail:{shareData:t}}))}catch(t){if(t instanceof Error&&\"AbortError\"===t.name){this.dispatchEvent(new CustomEvent(\"web-share:abort\",{bubbles:!0,composed:!0,detail:{error:t}}));return}this.dispatchEvent(new CustomEvent(\"web-share:error\",{bubbles:!0,composed:!0,detail:{error:t}}))}}#n=t=>{t.preventDefault(),this.disabled||this.share()};#a=t=>{t.target&&\"button\"===t.target.name&&(this.#e?.removeEventListener(\"click\",this.#n),this.#e=this.#i(),this.#e&&(this.#e.addEventListener(\"click\",this.#n),\"BUTTON\"===this.#e.nodeName||this.#e.hasAttribute(\"role\")||this.#e.setAttribute(\"role\",\"button\")))};#i(){return this.#t&&this.#t.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"button\"===t.getAttribute(\"slot\"))||null}#r(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}static defineCustomElement(t=\"web-share\"){\"undefined\"==typeof window||window.customElements.get(t)||window.customElements.define(t,s)}}s.defineCustomElement();export{s as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","import { WebShare } from './web-share.js';\n\nWebShare.defineCustomElement();\n\nexport { WebShare };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */\n\nconst styles = /* css */`\n :host {\n display: inline-block;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */\nclass WebShare extends HTMLElement {\n /** @type {Nullable} */\n #buttonSlot;\n\n /** @type {Nullable} */\n #buttonEl;\n\n /** @type {File[]} */\n #files = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute('disabled', this.disabled);\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part && this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('shareUrl');\n this.#upgradeProperty('shareTitle');\n this.#upgradeProperty('shareText');\n this.#upgradeProperty('shareFiles');\n this.#upgradeProperty('disabled');\n\n this.#buttonSlot?.addEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n }\n\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */\n get shareUrl() {\n return this.getAttribute('share-url') || '';\n }\n\n set shareUrl(value) {\n this.setAttribute('share-url', value);\n }\n\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */\n get shareTitle() {\n return this.getAttribute('share-title') || '';\n }\n\n set shareTitle(value) {\n this.setAttribute('share-title', value);\n }\n\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */\n get shareText() {\n return this.getAttribute('share-text') || '';\n }\n\n set shareText(value) {\n this.setAttribute('share-text', value);\n }\n\n /**\n * @type {File[]} - The files to share.\n */\n get shareFiles() {\n return this.#files;\n }\n\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) {\n this.#files = value;\n }\n }\n\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */\n async share() {\n if (this.disabled) {\n return;\n }\n\n try {\n /** @type {ShareData} */\n const shareData = {};\n\n if (this.shareUrl) {\n shareData.url = this.shareUrl;\n }\n\n if (this.shareTitle) {\n shareData.title = this.shareTitle;\n }\n\n if (this.shareText) {\n shareData.text = this.shareText;\n }\n\n if (\n Array.isArray(this.shareFiles)\n && this.shareFiles.length > 0\n && navigator.canShare\n && navigator.canShare({ files: this.shareFiles })\n ) {\n shareData.files = this.shareFiles;\n }\n\n await navigator.share(shareData);\n\n this.dispatchEvent(new CustomEvent('web-share:success', {\n bubbles: true,\n composed: true,\n detail: { shareData }\n }));\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n this.dispatchEvent(new CustomEvent('web-share:abort', {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n\n return;\n }\n\n this.dispatchEvent(new CustomEvent('web-share:error', {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n }\n\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n this.share();\n };\n\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */\n #handleSlotChange = evt => {\n if (evt.target && evt.target.name === 'button') {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n this.#buttonEl = this.#getButton();\n\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener('click', this.#handleClick);\n\n if (this.#buttonEl.nodeName !== 'BUTTON' && !this.#buttonEl.hasAttribute('role')) {\n this.#buttonEl.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */\n #getButton() {\n if (!this.#buttonSlot) {\n return null;\n }\n\n return this.#buttonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'button';\n }) || null;\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'web-share') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, WebShare);\n }\n }\n}\n\nexport { WebShare };\n","Object.defineProperty({},\"CapturePhoto\",{get:function(){return n},set:void 0,enumerable:!0,configurable:!0});let t=(t,e,i)=>(Number.isNaN(e)&&(e=0),Number.isNaN(i)&&(i=0),Math.min(Math.max(t,Math.min(e,i)),Math.max(e,i))),e=\"capture-photo\",i=`\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`,o=document.createElement(\"template\");o.innerHTML=`\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;class n extends HTMLElement{#t={};#e=null;#i=null;#o=null;#n=null;#a=null;#s=null;#r=null;#l=null;constructor(){super(),this.#t=this.getSupportedConstraints(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(o.content.cloneNode(!0))}static get observedAttributes(){return[\"no-image\",\"facing-mode\",\"camera-resolution\",\"pan\",\"tilt\",\"zoom\"]}attributeChangedCallback(t,e,i){if(!this.isConnected)return;let o=this.getTrackCapabilities(),n=this.getTrackSettings();if(\"no-image\"===t&&e!==i&&this.#u(),\"facing-mode\"===t&&e!==i&&\"facingMode\"in this.#t){let t=[\"user\",\"environment\"].includes(this.facingMode||\"\");\"facingMode\"in n&&t&&(this.stopVideoStream(),this.startVideoStream())}if(\"camera-resolution\"===t&&e!==i&&\"string\"==typeof this.cameraResolution&&this.cameraResolution.trim().length>0){let[t=0,e=0]=this.cameraResolution.split(\"x\").map(t=>Number(t));if(t>0&&e>0&&\"width\"in o&&\"height\"in o){let i=!!(o.width?.min&&o.width?.max)&&t>=o?.width?.min&&t<=o?.width?.max,a=!!(o.height?.min&&o.height?.max)&&e>=o?.height?.min&&e<=o?.height?.max;\"width\"in n&&\"height\"in n&&i&&a&&(this.stopVideoStream(),this.startVideoStream())}}if(\"pan\"===t&&e!==i&&\"pan\"in this.#t){let t=!!(\"pan\"in o&&o.pan?.min&&o.pan?.max)&&this.pan>=o.pan.min&&this.pan<=o.pan.max;\"pan\"in n&&\"number\"==typeof this.pan&&t&&this.#h(\"pan\",this.pan)}if(\"tilt\"===t&&e!==i&&\"tilt\"in this.#t){let t=!!(\"tilt\"in o&&o.tilt?.min&&o.tilt?.max)&&this.tilt>=o.tilt.min&&this.tilt<=o.tilt.max;\"tilt\"in n&&\"number\"==typeof this.tilt&&t&&this.#h(\"tilt\",this.tilt)}if(\"zoom\"===t&&e!==i&&\"zoom\"in this.#t){let t=!!(\"zoom\"in o&&o.zoom?.min&&o.zoom?.max)&&this.zoom>=o.zoom.min&&this.zoom<=o.zoom.max;\"zoom\"in n&&\"number\"==typeof this.zoom&&t&&this.#h(\"zoom\",this.zoom)}}connectedCallback(){if(this.#d(\"autpoPlay\"),this.#d(\"noImage\"),this.#d(\"facingMode\"),this.#d(\"cameraResolution\"),this.#d(\"pan\"),this.#d(\"tilt\"),this.#d(\"zoom\"),this.#d(\"calculateFileSize\"),this.#i=this.shadowRoot?.querySelector(\"canvas\")||null,this.#o=this.shadowRoot?.getElementById(\"output\")||null,this.#n=this.shadowRoot?.querySelector(\"video\")||null,this.#a=this.shadowRoot?.querySelector('slot[name=\"capture-button\"]')||null,this.#s=this.#c(),this.#r=this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]')||null,this.#l=this.#m(),this.#n?.addEventListener(\"loadedmetadata\",this.#p),this.#a?.addEventListener(\"slotchange\",this.#g),this.#s?.addEventListener(\"click\",this.#b),this.#r?.addEventListener(\"slotchange\",this.#f),this.#l?.addEventListener(\"click\",this.#v),!n.isSupported())return this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:{name:\"NotSupportedError\",message:\"Not supported\"}}}));this.autoPlay&&this.startVideoStream()}disconnectedCallback(){this.stopVideoStream(),this.#l?.removeEventListener(\"click\",this.#v),this.#s?.removeEventListener(\"click\",this.#b),this.#n?.removeEventListener(\"canplay\",this.#p),this.#a?.removeEventListener(\"slotchange\",this.#g),this.#r?.removeEventListener(\"slotchange\",this.#f)}get autoPlay(){return this.hasAttribute(\"auto-play\")}set autoPlay(t){this.toggleAttribute(\"auto-play\",!!t)}get noImage(){return this.hasAttribute(\"no-image\")}set noImage(t){this.toggleAttribute(\"no-image\",!!t)}get facingMode(){return this.getAttribute(\"facing-mode\")||\"user\"}set facingMode(t){this.setAttribute(\"facing-mode\",t)}get cameraResolution(){return this.getAttribute(\"camera-resolution\")||\"\"}set cameraResolution(t){this.setAttribute(\"camera-resolution\",t)}get pan(){return Number(this.getAttribute(\"pan\"))||0}set pan(t){this.setAttribute(\"pan\",null!=t?t.toString():t)}get tilt(){return Number(this.getAttribute(\"tilt\"))||0}set tilt(t){this.setAttribute(\"tilt\",null!=t?t.toString():t)}get zoom(){return Number(this.getAttribute(\"zoom\"))||1}set zoom(t){this.setAttribute(\"zoom\",null!=t?t.toString():t)}get loading(){return this.hasAttribute(\"loading\")}get calculateFileSize(){return this.hasAttribute(\"calculate-file-size\")}set calculateFileSize(t){this.toggleAttribute(\"calculate-file-size\",!!t)}#v=t=>{t.preventDefault(),this.loading||(this.facingMode=\"user\"!==this.facingMode&&this.facingMode?\"user\":\"environment\")};#b=t=>{t.preventDefault(),this.capture()};#p=t=>{let i=t.target;i.play().then(()=>{this.dispatchEvent(new CustomEvent(`${e}:video-play`,{bubbles:!0,composed:!0,detail:{video:i}}))}).catch(t=>{this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}).finally(()=>{this.removeAttribute(\"loading\")})};#u(){this.#o&&Array.from(this.#o.childNodes).forEach(t=>t.remove())}#h(e,i){if(!this.#e||!e||!i)return;let[o]=this.#e.getVideoTracks(),n=this.getTrackCapabilities();e in this.getTrackSettings()&&o.applyConstraints({advanced:[{[e]:t(Number(i),n[e]?.min||1,n[e]?.max||1)}]})}#g=t=>{t.target?.name===\"capture-button\"&&(this.#s?.removeEventListener(\"click\",this.#b),this.#s=this.#c(),this.#s&&(this.#s.addEventListener(\"click\",this.#b),\"BUTTON\"===this.#s.nodeName||this.#s.hasAttribute(\"role\")||this.#s.setAttribute(\"role\",\"button\")))};#f=t=>{t.target?.name===\"facing-mode-button\"&&(this.#l?.removeEventListener(\"click\",this.#v),this.#l=this.#m(),this.#l&&(this.#l.addEventListener(\"click\",this.#v),\"BUTTON\"===this.#l.nodeName||this.#l.hasAttribute(\"role\")||this.#l.setAttribute(\"role\",\"button\")))};#m(){return this.#r&&this.#r.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"facing-mode-button\"===t.getAttribute(\"slot\"))||null}#c(){return this.#a&&this.#a.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"capture-button\"===t.getAttribute(\"slot\"))||null}#d(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}async startVideoStream(){if(!n.isSupported()||this.#e)return;this.setAttribute(\"loading\",\"\");let t={video:{facingMode:{ideal:this.facingMode||\"user\"},pan:!0,tilt:!0,zoom:!0},audio:!1};if(\"string\"==typeof this.cameraResolution&&this.cameraResolution.trim().length>0){let[e=0,i=0]=this.cameraResolution.split(\"x\").map(t=>Number(t));e>0&&i>0&&(t.video.width=e,t.video.height=i)}try{this.#e=await navigator.mediaDevices.getUserMedia(t),this.#n&&(this.#n.srcObject=this.#e),this.#h(\"pan\",this.pan),this.#h(\"tilt\",this.tilt),this.#h(\"zoom\",this.zoom);let e=this.getTrackSettings();\"facingMode\"in e&&this.#r&&(this.#r.hidden=!1)}catch(t){this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}finally{this.removeAttribute(\"loading\")}}stopVideoStream(){if(!this.#n||!this.#e)return;let[t]=this.#e.getVideoTracks();t?.stop(),this.#n.srcObject=null,this.#e=null}async capture(){if(!this.loading&&this.#i&&this.#n)try{let t=this.#i.getContext(\"2d\"),i=this.#n.videoWidth,o=this.#n.videoHeight;this.#i.width=i,this.#i.height=o,t?.drawImage(this.#n,0,0,i,o);let n=this.#i.toDataURL(\"image/png\");if(\"string\"==typeof n&&n.includes(\"data:image\")){if(!this.noImage){let t=new Image;t.src=n,t.width=i,t.height=o,t.setAttribute(\"part\",\"output-image\"),this.#u(),this.#o?.appendChild(t)}let t={dataURI:n,width:i,height:o};if(this.calculateFileSize)try{let e=await fetch(n),i=(await e.blob()).size;i&&(t.size=i)}catch(t){}this.dispatchEvent(new CustomEvent(`${e}:success`,{bubbles:!0,composed:!0,detail:t}))}}catch(t){this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}getSupportedConstraints(){return n.isSupported()&&navigator.mediaDevices.getSupportedConstraints()||{}}getTrackCapabilities(){if(!this.#e)return{};let[t]=this.#e.getVideoTracks();return t&&\"function\"==typeof t.getCapabilities&&t.getCapabilities()||{}}getTrackSettings(){if(!this.#e)return{};let[t]=this.#e.getVideoTracks();return t&&\"function\"==typeof t.getSettings&&t.getSettings()||{}}static isSupported(){return!!navigator.mediaDevices?.getUserMedia}static defineCustomElement(t=e){\"undefined\"==typeof window||window.customElements.get(t)||window.customElements.define(t,n)}}n.defineCustomElement();export{n as CapturePhoto};\n//# sourceMappingURL=capture-photo-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $c290816263f90981$exports = {};\n\n$parcel$export($c290816263f90981$exports, \"CapturePhoto\", function () { return $c290816263f90981$export$cc30a98fe3890794; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ /**\n * @typedef {Object} ExtendedMediaTrackCapabilities\n * @property {ULongRange} [width] - The width of the video track.\n * @property {ULongRange} [height] - The height of the video track.\n * @property {ULongRange} [pan] - The pan level of the camera.\n * @property {ULongRange} [tilt] - The tilt level of the camera.\n * @property {ULongRange} [zoom] - The zoom level of the camera.\n * @property {MediaTrackCapabilities} [nativeMediaTrackCapabilities] - The native track capabilities.\n */ /**\n * @typedef {Object} ExtendedMediaTrackConstraints\n * @property {MediaTrackConstraints & {pan: boolean, tilt: boolean, zoom: boolean}} video - The video constraints.\n * @property {MediaTrackConstraints | boolean} audio - The audio constraints.\n */ // @ts-check\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */ const $02ad8beec419df62$export$7d15b64cf5a3a4c4 = (value, lower, upper)=>{\n if (Number.isNaN(lower)) lower = 0;\n if (Number.isNaN(upper)) upper = 0;\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n\n\nconst $c290816263f90981$var$COMPONENT_NAME = \"capture-photo\";\nconst $c290816263f90981$var$styles = /* css */ `\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`;\nconst $c290816263f90981$var$template = document.createElement(\"template\");\n$c290816263f90981$var$template.innerHTML = /* html */ `\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\n/**\n * @summary A custom element that implements the MediaDevices.getUserMedia() method of the MediaDevices interface to capture a photo in the browser.\n * @documentation https://github.com/georapbox/capture-photo-element\n *\n * @tagname capture-photo This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @property {boolean} noImage - Whether or not to show the captured image.\n * @property {string} facingMode - The facing mode of the camera.\n * @property {string} cameraResolution - The resolution of the camera.\n * @property {number} pan - The pan value of the camera.\n * @property {number} tilt - The tilt value of the camera.\n * @property {number} zoom - The zoom value of the camera.\n * @property {boolean} loading - Whether or not the video stream is loading.\n * @property {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n *\n * @atttribute {boolean} auto-play - Reflects the autoPlay property.\n * @atttribute {boolean} no-image - Reflects the noImage property.\n * @atttribute {string} facing-mode - Reflects the facingMode property.\n * @atttribute {string} camera-resolution - Reflects the cameraResolution property.\n * @atttribute {number} pan - Reflects the pan property.\n * @atttribute {number} tilt - Reflects the tilt property.\n * @atttribute {number} zoom - Reflects the zoom property.\n * @atttribute {boolean} loading - Reflects the loading property.\n * @atttribute {boolean} calculate-file-size - Reflects the calculateFileSize property.\n *\n * @slot capture-button - The capture button.\n * @slot capture-button-content - The capture button content.\n * @slot facing-mode-button - The facing mode button.\n * @slot facing-mode-button-content - The facing mode button content.\n * @slot actions - The actions container.\n * @slot - A default un-named slot to add content inside the component.\n *\n * @csspart video - The video element.\n * @csspart actions-container - The actions container.\n * @csspart capture-button - The capture button.\n * @csspart facing-mode-button - The facing mode button.\n * @csspart output-container - The output container.\n * @csspart output-image - The output image.\n *\n * @event capture-photo:video-play - Fires when the video stream is successfully playing.\n * @event capture-photo:success - Fires when the photo is successfully captured.\n * @event capture-photo:error - Fires when an error occurs.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method isSupported - Static method. Checks if the MediaDevices.getUserMedia() method is supported.\n * @method startVideoStream - Instance method. Starts the video stream.\n * @method stopVideoStream - Instance method. Stops the video stream.\n * @method capture - Instance method. Captures a photo.\n * @method getSupportedConstraints - Instance method. Gets the supported constraints.\n * @method getTrackCapabilities - Instance method. Gets the track capabilities.\n * @method getTrackSettings - Instance method. Gets the track settings.\n */ class $c290816263f90981$export$cc30a98fe3890794 extends HTMLElement {\n /** @type {MediaTrackSupportedConstraints | {}}*/ #supportedConstraints = {};\n /** @type {Nullable} */ #stream = null;\n /** @type {Nullable} */ #canvasElement = null;\n /** @type {Nullable} */ #outputElement = null;\n /** @type {Nullable} */ #videoElement = null;\n /** @type {Nullable} */ #captureButtonSlot = null;\n /** @type {Nullable} */ #captureButton = null;\n /** @type {Nullable} */ #facingModeButtonSlot = null;\n /** @type {Nullable} */ #facingModeButton = null;\n constructor(){\n super();\n this.#supportedConstraints = this.getSupportedConstraints();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($c290816263f90981$var$template.content.cloneNode(true));\n }\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"facing-mode\",\n \"camera-resolution\",\n \"pan\",\n \"tilt\",\n \"zoom\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) return;\n /** @type {ExtendedMediaTrackCapabilities} */ const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n if (name === \"no-image\" && oldValue !== newValue) this.#emptyOutputElement();\n if (name === \"facing-mode\" && oldValue !== newValue && \"facingMode\" in this.#supportedConstraints) {\n const isValidFacingMode = [\n \"user\",\n \"environment\"\n ].includes(this.facingMode || \"\");\n if (\"facingMode\" in trackSettings && isValidFacingMode) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n if (name === \"camera-resolution\" && oldValue !== newValue) {\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0 && \"width\" in trackCapabilities && \"height\" in trackCapabilities) {\n const widthInAllowedRange = trackCapabilities.width?.min && trackCapabilities.width?.max ? width >= trackCapabilities?.width?.min && width <= trackCapabilities?.width?.max : false;\n const heightInAllowedRange = trackCapabilities.height?.min && trackCapabilities.height?.max ? height >= trackCapabilities?.height?.min && height <= trackCapabilities?.height?.max : false;\n if (\"width\" in trackSettings && \"height\" in trackSettings && widthInAllowedRange && heightInAllowedRange) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n }\n }\n if (name === \"pan\" && oldValue !== newValue && \"pan\" in this.#supportedConstraints) {\n const panInAllowedRange = \"pan\" in trackCapabilities && trackCapabilities.pan?.min && trackCapabilities.pan?.max ? this.pan >= trackCapabilities.pan.min && this.pan <= trackCapabilities.pan.max : false;\n if (\"pan\" in trackSettings && typeof this.pan === \"number\" && panInAllowedRange) this.#applyPTZ(\"pan\", this.pan);\n }\n if (name === \"tilt\" && oldValue !== newValue && \"tilt\" in this.#supportedConstraints) {\n const tiltInAllowedRange = \"tilt\" in trackCapabilities && trackCapabilities.tilt?.min && trackCapabilities.tilt?.max ? this.tilt >= trackCapabilities.tilt.min && this.tilt <= trackCapabilities.tilt.max : false;\n if (\"tilt\" in trackSettings && typeof this.tilt === \"number\" && tiltInAllowedRange) this.#applyPTZ(\"tilt\", this.tilt);\n }\n if (name === \"zoom\" && oldValue !== newValue && \"zoom\" in this.#supportedConstraints) {\n const zoomInAllowedRange = \"zoom\" in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max : false;\n if (\"zoom\" in trackSettings && typeof this.zoom === \"number\" && zoomInAllowedRange) this.#applyPTZ(\"zoom\", this.zoom);\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"autpoPlay\");\n this.#upgradeProperty(\"noImage\");\n this.#upgradeProperty(\"facingMode\");\n this.#upgradeProperty(\"cameraResolution\");\n this.#upgradeProperty(\"pan\");\n this.#upgradeProperty(\"tilt\");\n this.#upgradeProperty(\"zoom\");\n this.#upgradeProperty(\"calculateFileSize\");\n this.#canvasElement = this.shadowRoot?.querySelector(\"canvas\") || null;\n this.#outputElement = this.shadowRoot?.getElementById(\"output\") || null;\n this.#videoElement = this.shadowRoot?.querySelector(\"video\") || null;\n this.#captureButtonSlot = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null;\n this.#captureButton = this.#getCaptureButton();\n this.#facingModeButtonSlot = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null;\n this.#facingModeButton = this.#getFacingModeButton();\n this.#videoElement?.addEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.addEventListener(\"slotchange\", this.#onCaptureButtonSlotChange);\n this.#captureButton?.addEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#facingModeButtonSlot?.addEventListener(\"slotchange\", this.#onFacingModeButtonSlotChange);\n this.#facingModeButton?.addEventListener(\"click\", this.#onFacingModeButtonClick);\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported()) return this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n if (this.autoPlay) this.startVideoStream();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.stopVideoStream();\n this.#facingModeButton?.removeEventListener(\"click\", this.#onFacingModeButtonClick);\n this.#captureButton?.removeEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#videoElement?.removeEventListener(\"canplay\", this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.removeEventListener(\"slotchange\", this.#onCaptureButtonSlotChange);\n this.#facingModeButtonSlot?.removeEventListener(\"slotchange\", this.#onFacingModeButtonSlotChange);\n }\n /**\n * @type {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @attribute auto-play - Reflects the autoPlay attribute.\n */ get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(value) {\n this.toggleAttribute(\"auto-play\", !!value);\n }\n /**\n * @type {boolean} noImage - Whether or not to show the captured image.\n * @attribute no-image - Reflects the noImage attribute.\n */ get noImage() {\n return this.hasAttribute(\"no-image\");\n }\n set noImage(value) {\n this.toggleAttribute(\"no-image\", !!value);\n }\n /**\n * @type {string} facingMode - The facing mode of the camera.\n * @attribute facing-mode - Reflects the facingMode attribute.\n */ get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(value) {\n this.setAttribute(\"facing-mode\", value);\n }\n /**\n * @type {string} cameraResolution - The resolution of the camera.\n * @attribute camera-resolution - Reflects the cameraResolution attribute.\n */ get cameraResolution() {\n return this.getAttribute(\"camera-resolution\") || \"\";\n }\n set cameraResolution(value) {\n this.setAttribute(\"camera-resolution\", value);\n }\n /**\n * @type {number} pan - The pan value of the camera.\n * @attribute pan - Reflects the pan attribute.\n */ get pan() {\n return Number(this.getAttribute(\"pan\")) || 0;\n }\n set pan(value) {\n this.setAttribute(\"pan\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} tilt - The tilt value of the camera.\n * @attribute tilt - Reflects the tilt attribute.\n */ get tilt() {\n return Number(this.getAttribute(\"tilt\")) || 0;\n }\n set tilt(value) {\n this.setAttribute(\"tilt\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} zoom - The zoom value of the camera.\n * @attribute zoom - Reflects the zoom attribute.\n */ get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(value) {\n this.setAttribute(\"zoom\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} loading - Whether or not the video stream is loading.\n * @attribute loading - Reflects the loading attribute.\n */ get loading() {\n return this.hasAttribute(\"loading\");\n }\n /**\n * @type {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n * @attribute calculate-file-size - Reflects the calculateFileSize attribute.\n */ get calculateFileSize() {\n return this.hasAttribute(\"calculate-file-size\");\n }\n set calculateFileSize(value) {\n this.toggleAttribute(\"calculate-file-size\", !!value);\n }\n /**\n * Handles the click event of the facing mode button.\n *\n * @param {*} evt - The click event.\n */ #onFacingModeButtonClick = (evt)=>{\n evt.preventDefault();\n if (this.loading) return;\n this.facingMode = this.facingMode === \"user\" || !this.facingMode ? \"environment\" : \"user\";\n };\n /**\n * Handles the click event of the capture button.\n *\n * @param {*} evt - The click event.\n */ #onCapturePhotoButtonClick = (evt)=>{\n evt.preventDefault();\n this.capture();\n };\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {*} evt - The loadedmetadata event.\n */ #onVideoLoadedMetaData = (evt)=>{\n const video = evt.target;\n video.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: {\n video: video\n }\n }));\n }).catch(/** @param {Error} error */ (error)=>{\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n /**\n * Removes all child nodes from the output element.\n */ #emptyOutputElement() {\n if (!this.#outputElement) return;\n Array.from(this.#outputElement.childNodes).forEach((node)=>node.remove());\n }\n /**\n * Applies the pan, tilt or zoom constraint.\n *\n * @param {'pan' | 'tilt' | 'zoom'} constraintName - The name of the constraint.\n * @param {number} constraintValue - The value of the constraint.\n */ #applyPTZ(constraintName, constraintValue) {\n if (!this.#stream || !constraintName || !constraintValue) return;\n const [track] = this.#stream.getVideoTracks();\n /** @type {ExtendedMediaTrackCapabilities} */ const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n if (constraintName in trackSettings) track.applyConstraints({\n advanced: [\n {\n [constraintName]: (0, $02ad8beec419df62$export$7d15b64cf5a3a4c4)(Number(constraintValue), trackCapabilities[constraintName]?.min || 1, trackCapabilities[constraintName]?.max || 1)\n }\n ]\n });\n }\n /**\n * Handles the slotchange event of the capture button slot.\n *\n * @param {*} evt - The slotchange event.\n */ #onCaptureButtonSlotChange = (evt)=>{\n if (evt.target?.name === \"capture-button\") {\n this.#captureButton?.removeEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#captureButton = this.#getCaptureButton();\n if (this.#captureButton) {\n this.#captureButton.addEventListener(\"click\", this.#onCapturePhotoButtonClick);\n if (this.#captureButton.nodeName !== \"BUTTON\" && !this.#captureButton.hasAttribute(\"role\")) this.#captureButton.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Handles the slotchange event of the facing mode button slot.\n *\n * @param {*} evt - The slotchange event.\n */ #onFacingModeButtonSlotChange = (evt)=>{\n if (evt.target?.name === \"facing-mode-button\") {\n this.#facingModeButton?.removeEventListener(\"click\", this.#onFacingModeButtonClick);\n this.#facingModeButton = this.#getFacingModeButton();\n if (this.#facingModeButton) {\n this.#facingModeButton.addEventListener(\"click\", this.#onFacingModeButtonClick);\n if (this.#facingModeButton.nodeName !== \"BUTTON\" && !this.#facingModeButton.hasAttribute(\"role\")) this.#facingModeButton.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Returns the facing mode button.\n *\n * @returns {Nullable}\n */ #getFacingModeButton() {\n if (!this.#facingModeButtonSlot) return null;\n return this.#facingModeButtonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"facing-mode-button\";\n }) || null;\n }\n /**\n * Returns the capture button.\n *\n * @returns {Nullable}\n */ #getCaptureButton() {\n if (!this.#captureButtonSlot) return null;\n return this.#captureButtonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"capture-button\";\n }) || null;\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'autpoPlay' | 'noImage' | 'facingMode' | 'cameraResolution' | 'pan' | 'tilt' | 'zoom' | 'calculateFileSize'} prop\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Starts the video stream.\n *\n * @returns Promise\n */ async startVideoStream() {\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported() || this.#stream) return;\n this.setAttribute(\"loading\", \"\");\n /** @type {ExtendedMediaTrackConstraints} */ const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: true,\n tilt: true,\n zoom: true\n },\n audio: false\n };\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n if (this.#videoElement) this.#videoElement.srcObject = this.#stream;\n this.#applyPTZ(\"pan\", this.pan);\n this.#applyPTZ(\"tilt\", this.tilt);\n this.#applyPTZ(\"zoom\", this.zoom);\n const trackSettings = this.getTrackSettings();\n if (\"facingMode\" in trackSettings && this.#facingModeButtonSlot) this.#facingModeButtonSlot.hidden = false;\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n /**\n * Stops the video stream.\n */ stopVideoStream() {\n if (!this.#videoElement || !this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n /**\n * Captures a photo using the element's properties.\n *\n * @returns Promise\n */ async capture() {\n if (this.loading || !this.#canvasElement || !this.#videoElement) return;\n try {\n const ctx = this.#canvasElement.getContext(\"2d\");\n const width = this.#videoElement.videoWidth;\n const height = this.#videoElement.videoHeight;\n this.#canvasElement.width = width;\n this.#canvasElement.height = height;\n ctx?.drawImage(this.#videoElement, 0, 0, width, height);\n const dataURI = this.#canvasElement.toDataURL(\"image/png\");\n if (typeof dataURI === \"string\" && dataURI.includes(\"data:image\")) {\n if (!this.noImage) {\n const image = new Image();\n image.src = dataURI;\n image.width = width;\n image.height = height;\n image.setAttribute(\"part\", \"output-image\");\n this.#emptyOutputElement();\n this.#outputElement?.appendChild(image);\n }\n /** @type {{ dataURI: string, width: number, height: number, size?: number }} */ const eventDetail = {\n dataURI: dataURI,\n width: width,\n height: height\n };\n if (this.calculateFileSize) try {\n const file = await fetch(dataURI);\n const blob = await file.blob();\n const size = blob.size;\n if (size) eventDetail.size = size;\n } catch (err) {\n // Fail silently...\n }\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:success`, {\n bubbles: true,\n composed: true,\n detail: eventDetail\n }));\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n }\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */ getSupportedConstraints() {\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported()) return {};\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */ getTrackCapabilities() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getCapabilities === \"function\") return track.getCapabilities() || {};\n return {};\n }\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */ getTrackSettings() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getSettings === \"function\") return track.getSettings() || {};\n return {};\n }\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */ static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='capture-photo'] - The name of the custom element.\n * @example\n *\n * CapturePhoto.defineCustomElement('my-capture-photo');\n */ static defineCustomElement(elementName = $c290816263f90981$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $c290816263f90981$export$cc30a98fe3890794);\n }\n}\n\n\n(0, $c290816263f90981$export$cc30a98fe3890794).defineCustomElement();\n\n\nexport {$c290816263f90981$export$cc30a98fe3890794 as CapturePhoto};\n//# sourceMappingURL=capture-photo-defined.js.map\n","import { CapturePhoto } from './capture-photo.js';\n\nCapturePhoto.defineCustomElement();\n\nexport { CapturePhoto };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * @typedef {Object} ExtendedMediaTrackCapabilities\n * @property {ULongRange} [width] - The width of the video track.\n * @property {ULongRange} [height] - The height of the video track.\n * @property {ULongRange} [pan] - The pan level of the camera.\n * @property {ULongRange} [tilt] - The tilt level of the camera.\n * @property {ULongRange} [zoom] - The zoom level of the camera.\n * @property {MediaTrackCapabilities} [nativeMediaTrackCapabilities] - The native track capabilities.\n */\n\n/**\n * @typedef {Object} ExtendedMediaTrackConstraints\n * @property {MediaTrackConstraints & {pan: boolean, tilt: boolean, zoom: boolean}} video - The video constraints.\n * @property {MediaTrackConstraints | boolean} audio - The audio constraints.\n */\n\nimport { clamp } from './utils/clamp.js';\n\nconst COMPONENT_NAME = 'capture-photo';\n\nconst styles = /* css */`\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */`\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\n\n/**\n * @summary A custom element that implements the MediaDevices.getUserMedia() method of the MediaDevices interface to capture a photo in the browser.\n * @documentation https://github.com/georapbox/capture-photo-element\n *\n * @tagname capture-photo This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @property {boolean} noImage - Whether or not to show the captured image.\n * @property {string} facingMode - The facing mode of the camera.\n * @property {string} cameraResolution - The resolution of the camera.\n * @property {number} pan - The pan value of the camera.\n * @property {number} tilt - The tilt value of the camera.\n * @property {number} zoom - The zoom value of the camera.\n * @property {boolean} loading - Whether or not the video stream is loading.\n * @property {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n *\n * @atttribute {boolean} auto-play - Reflects the autoPlay property.\n * @atttribute {boolean} no-image - Reflects the noImage property.\n * @atttribute {string} facing-mode - Reflects the facingMode property.\n * @atttribute {string} camera-resolution - Reflects the cameraResolution property.\n * @atttribute {number} pan - Reflects the pan property.\n * @atttribute {number} tilt - Reflects the tilt property.\n * @atttribute {number} zoom - Reflects the zoom property.\n * @atttribute {boolean} loading - Reflects the loading property.\n * @atttribute {boolean} calculate-file-size - Reflects the calculateFileSize property.\n *\n * @slot capture-button - The capture button.\n * @slot capture-button-content - The capture button content.\n * @slot facing-mode-button - The facing mode button.\n * @slot facing-mode-button-content - The facing mode button content.\n * @slot actions - The actions container.\n * @slot - A default un-named slot to add content inside the component.\n *\n * @csspart video - The video element.\n * @csspart actions-container - The actions container.\n * @csspart capture-button - The capture button.\n * @csspart facing-mode-button - The facing mode button.\n * @csspart output-container - The output container.\n * @csspart output-image - The output image.\n *\n * @event capture-photo:video-play - Fires when the video stream is successfully playing.\n * @event capture-photo:success - Fires when the photo is successfully captured.\n * @event capture-photo:error - Fires when an error occurs.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method isSupported - Static method. Checks if the MediaDevices.getUserMedia() method is supported.\n * @method startVideoStream - Instance method. Starts the video stream.\n * @method stopVideoStream - Instance method. Stops the video stream.\n * @method capture - Instance method. Captures a photo.\n * @method getSupportedConstraints - Instance method. Gets the supported constraints.\n * @method getTrackCapabilities - Instance method. Gets the track capabilities.\n * @method getTrackSettings - Instance method. Gets the track settings.\n */\nclass CapturePhoto extends HTMLElement {\n /** @type {MediaTrackSupportedConstraints | {}}*/\n #supportedConstraints = {};\n\n /** @type {Nullable} */\n #stream = null;\n\n /** @type {Nullable} */\n #canvasElement = null;\n\n /** @type {Nullable} */\n #outputElement = null;\n\n /** @type {Nullable} */\n #videoElement = null;\n\n /** @type {Nullable} */\n #captureButtonSlot = null;\n\n /** @type {Nullable} */\n #captureButton = null;\n\n /** @type {Nullable} */\n #facingModeButtonSlot = null;\n\n /** @type {Nullable} */\n #facingModeButton = null;\n\n constructor() {\n super();\n\n this.#supportedConstraints = this.getSupportedConstraints();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['no-image', 'facing-mode', 'camera-resolution', 'pan', 'tilt', 'zoom'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) {\n return;\n }\n\n /** @type {ExtendedMediaTrackCapabilities} */\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n if (name === 'no-image' && oldValue !== newValue) {\n this.#emptyOutputElement();\n }\n\n if (name === 'facing-mode' && oldValue !== newValue && 'facingMode' in this.#supportedConstraints) {\n const isValidFacingMode = ['user', 'environment'].includes(this.facingMode || '');\n\n if ('facingMode' in trackSettings && isValidFacingMode) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n\n if (name === 'camera-resolution' && oldValue !== newValue) {\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0 && 'width' in trackCapabilities && 'height' in trackCapabilities) {\n const widthInAllowedRange = trackCapabilities.width?.min && trackCapabilities.width?.max\n ? width >= trackCapabilities?.width?.min && width <= trackCapabilities?.width?.max\n : false;\n\n const heightInAllowedRange = trackCapabilities.height?.min && trackCapabilities.height?.max\n ? height >= trackCapabilities?.height?.min && height <= trackCapabilities?.height?.max\n : false;\n\n if ('width' in trackSettings && 'height' in trackSettings && widthInAllowedRange && heightInAllowedRange) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n }\n }\n\n if (name === 'pan' && oldValue !== newValue && 'pan' in this.#supportedConstraints) {\n const panInAllowedRange = 'pan' in trackCapabilities && trackCapabilities.pan?.min && trackCapabilities.pan?.max\n ? this.pan >= trackCapabilities.pan.min && this.pan <= trackCapabilities.pan.max\n : false;\n\n if ('pan' in trackSettings && typeof this.pan === 'number' && panInAllowedRange) {\n this.#applyPTZ('pan', this.pan);\n }\n }\n\n if (name === 'tilt' && oldValue !== newValue && 'tilt' in this.#supportedConstraints) {\n const tiltInAllowedRange = 'tilt' in trackCapabilities && trackCapabilities.tilt?.min && trackCapabilities.tilt?.max\n ? this.tilt >= trackCapabilities.tilt.min && this.tilt <= trackCapabilities.tilt.max\n : false;\n\n if ('tilt' in trackSettings && typeof this.tilt === 'number' && tiltInAllowedRange) {\n this.#applyPTZ('tilt', this.tilt);\n }\n }\n\n if (name === 'zoom' && oldValue !== newValue && 'zoom' in this.#supportedConstraints) {\n const zoomInAllowedRange = 'zoom' in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max\n ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max\n : false;\n\n if ('zoom' in trackSettings && typeof this.zoom === 'number' && zoomInAllowedRange) {\n this.#applyPTZ('zoom', this.zoom);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('autpoPlay');\n this.#upgradeProperty('noImage');\n this.#upgradeProperty('facingMode');\n this.#upgradeProperty('cameraResolution');\n this.#upgradeProperty('pan');\n this.#upgradeProperty('tilt');\n this.#upgradeProperty('zoom');\n this.#upgradeProperty('calculateFileSize');\n\n this.#canvasElement = this.shadowRoot?.querySelector('canvas') || null;\n this.#outputElement = this.shadowRoot?.getElementById('output') || null;\n this.#videoElement = this.shadowRoot?.querySelector('video') || null;\n this.#captureButtonSlot = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null;\n this.#captureButton = this.#getCaptureButton();\n this.#facingModeButtonSlot = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null;\n this.#facingModeButton = this.#getFacingModeButton();\n\n this.#videoElement?.addEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.addEventListener('slotchange', this.#onCaptureButtonSlotChange);\n this.#captureButton?.addEventListener('click', this.#onCapturePhotoButtonClick);\n this.#facingModeButtonSlot?.addEventListener('slotchange', this.#onFacingModeButtonSlotChange);\n this.#facingModeButton?.addEventListener('click', this.#onFacingModeButtonClick);\n\n if (!CapturePhoto.isSupported()) {\n return this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: 'NotSupportedError',\n message: 'Not supported'\n }\n }\n }));\n }\n\n if (this.autoPlay) {\n this.startVideoStream();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.stopVideoStream();\n this.#facingModeButton?.removeEventListener('click', this.#onFacingModeButtonClick);\n this.#captureButton?.removeEventListener('click', this.#onCapturePhotoButtonClick);\n this.#videoElement?.removeEventListener('canplay', this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.removeEventListener('slotchange', this.#onCaptureButtonSlotChange);\n this.#facingModeButtonSlot?.removeEventListener('slotchange', this.#onFacingModeButtonSlotChange);\n }\n\n /**\n * @type {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @attribute auto-play - Reflects the autoPlay attribute.\n */\n get autoPlay() {\n return this.hasAttribute('auto-play');\n }\n\n set autoPlay(value) {\n this.toggleAttribute('auto-play', !!value);\n }\n\n /**\n * @type {boolean} noImage - Whether or not to show the captured image.\n * @attribute no-image - Reflects the noImage attribute.\n */\n get noImage() {\n return this.hasAttribute('no-image');\n }\n\n set noImage(value) {\n this.toggleAttribute('no-image', !!value);\n }\n\n /**\n * @type {string} facingMode - The facing mode of the camera.\n * @attribute facing-mode - Reflects the facingMode attribute.\n */\n get facingMode() {\n return this.getAttribute('facing-mode') || 'user';\n }\n\n set facingMode(value) {\n this.setAttribute('facing-mode', value);\n }\n\n /**\n * @type {string} cameraResolution - The resolution of the camera.\n * @attribute camera-resolution - Reflects the cameraResolution attribute.\n */\n get cameraResolution() {\n return this.getAttribute('camera-resolution') || '';\n }\n\n set cameraResolution(value) {\n this.setAttribute('camera-resolution', value);\n }\n\n /**\n * @type {number} pan - The pan value of the camera.\n * @attribute pan - Reflects the pan attribute.\n */\n get pan() {\n return Number(this.getAttribute('pan')) || 0;\n }\n\n set pan(value) {\n this.setAttribute('pan', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} tilt - The tilt value of the camera.\n * @attribute tilt - Reflects the tilt attribute.\n */\n get tilt() {\n return Number(this.getAttribute('tilt')) || 0;\n }\n\n set tilt(value) {\n this.setAttribute('tilt', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} zoom - The zoom value of the camera.\n * @attribute zoom - Reflects the zoom attribute.\n */\n get zoom() {\n return Number(this.getAttribute('zoom')) || 1;\n }\n\n set zoom(value) {\n this.setAttribute('zoom', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} loading - Whether or not the video stream is loading.\n * @attribute loading - Reflects the loading attribute.\n */\n get loading() {\n return this.hasAttribute('loading');\n }\n\n /**\n * @type {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n * @attribute calculate-file-size - Reflects the calculateFileSize attribute.\n */\n get calculateFileSize() {\n return this.hasAttribute('calculate-file-size');\n }\n\n set calculateFileSize(value) {\n this.toggleAttribute('calculate-file-size', !!value);\n }\n\n /**\n * Handles the click event of the facing mode button.\n *\n * @param {*} evt - The click event.\n */\n #onFacingModeButtonClick = evt => {\n evt.preventDefault();\n\n if (this.loading) {\n return;\n }\n\n this.facingMode = this.facingMode === 'user' || !this.facingMode ? 'environment' : 'user';\n };\n\n /**\n * Handles the click event of the capture button.\n *\n * @param {*} evt - The click event.\n */\n #onCapturePhotoButtonClick = evt => {\n evt.preventDefault();\n this.capture();\n };\n\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {*} evt - The loadedmetadata event.\n */\n #onVideoLoadedMetaData = evt => {\n const video = evt.target;\n\n video.play().then(() => {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: { video }\n }));\n }).catch(/** @param {Error} error */error => {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }).finally(() => {\n this.removeAttribute('loading');\n });\n };\n\n /**\n * Removes all child nodes from the output element.\n */\n #emptyOutputElement() {\n if (!this.#outputElement) {\n return;\n }\n\n Array.from(this.#outputElement.childNodes).forEach(node => node.remove());\n }\n\n /**\n * Applies the pan, tilt or zoom constraint.\n *\n * @param {'pan' | 'tilt' | 'zoom'} constraintName - The name of the constraint.\n * @param {number} constraintValue - The value of the constraint.\n */\n #applyPTZ(constraintName, constraintValue) {\n if (!this.#stream || !constraintName || !constraintValue) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n /** @type {ExtendedMediaTrackCapabilities} */\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n if (constraintName in trackSettings) {\n track.applyConstraints({\n advanced: [{\n [constraintName]: clamp(Number(constraintValue), trackCapabilities[constraintName]?.min || 1, trackCapabilities[constraintName]?.max || 1)\n }]\n });\n }\n }\n\n /**\n * Handles the slotchange event of the capture button slot.\n *\n * @param {*} evt - The slotchange event.\n */\n #onCaptureButtonSlotChange = evt => {\n if (evt.target?.name === 'capture-button') {\n this.#captureButton?.removeEventListener('click', this.#onCapturePhotoButtonClick);\n this.#captureButton = this.#getCaptureButton();\n\n if (this.#captureButton) {\n this.#captureButton.addEventListener('click', this.#onCapturePhotoButtonClick);\n\n if (this.#captureButton.nodeName !== 'BUTTON' && !this.#captureButton.hasAttribute('role')) {\n this.#captureButton.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Handles the slotchange event of the facing mode button slot.\n *\n * @param {*} evt - The slotchange event.\n */\n #onFacingModeButtonSlotChange = evt => {\n if (evt.target?.name === 'facing-mode-button') {\n this.#facingModeButton?.removeEventListener('click', this.#onFacingModeButtonClick);\n this.#facingModeButton = this.#getFacingModeButton();\n\n if (this.#facingModeButton) {\n this.#facingModeButton.addEventListener('click', this.#onFacingModeButtonClick);\n\n if (this.#facingModeButton.nodeName !== 'BUTTON' && !this.#facingModeButton.hasAttribute('role')) {\n this.#facingModeButton.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the facing mode button.\n *\n * @returns {Nullable}\n */\n #getFacingModeButton() {\n if (!this.#facingModeButtonSlot) {\n return null;\n }\n\n return this.#facingModeButtonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'facing-mode-button';\n }) || null;\n }\n\n /**\n * Returns the capture button.\n *\n * @returns {Nullable}\n */\n #getCaptureButton() {\n if (!this.#captureButtonSlot) {\n return null;\n }\n\n return this.#captureButtonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'capture-button';\n }) || null;\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'autpoPlay' | 'noImage' | 'facingMode' | 'cameraResolution' | 'pan' | 'tilt' | 'zoom' | 'calculateFileSize'} prop\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Starts the video stream.\n *\n * @returns Promise\n */\n async startVideoStream() {\n if (!CapturePhoto.isSupported() || this.#stream) {\n return;\n }\n\n this.setAttribute('loading', '');\n\n /** @type {ExtendedMediaTrackConstraints} */\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || 'user'\n },\n pan: true,\n tilt: true,\n zoom: true\n },\n audio: false\n };\n\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n\n if (this.#videoElement) {\n this.#videoElement.srcObject = this.#stream;\n }\n\n this.#applyPTZ('pan', this.pan);\n this.#applyPTZ('tilt', this.tilt);\n this.#applyPTZ('zoom', this.zoom);\n\n const trackSettings = this.getTrackSettings();\n\n if ('facingMode' in trackSettings && this.#facingModeButtonSlot) {\n this.#facingModeButtonSlot.hidden = false;\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n } finally {\n this.removeAttribute('loading');\n }\n }\n\n /**\n * Stops the video stream.\n */\n stopVideoStream() {\n if (!this.#videoElement || !this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n\n /**\n * Captures a photo using the element's properties.\n *\n * @returns Promise\n */\n async capture() {\n if (this.loading || !this.#canvasElement || !this.#videoElement) {\n return;\n }\n\n try {\n const ctx = this.#canvasElement.getContext('2d');\n const width = this.#videoElement.videoWidth;\n const height = this.#videoElement.videoHeight;\n this.#canvasElement.width = width;\n this.#canvasElement.height = height;\n ctx?.drawImage(this.#videoElement, 0, 0, width, height);\n const dataURI = this.#canvasElement.toDataURL('image/png');\n\n if (typeof dataURI === 'string' && dataURI.includes('data:image')) {\n if (!this.noImage) {\n const image = new Image();\n image.src = dataURI;\n image.width = width;\n image.height = height;\n image.setAttribute('part', 'output-image');\n this.#emptyOutputElement();\n this.#outputElement?.appendChild(image);\n }\n\n /** @type {{ dataURI: string, width: number, height: number, size?: number }} */\n const eventDetail = { dataURI, width, height };\n\n if (this.calculateFileSize) {\n try {\n const file = await fetch(dataURI);\n const blob = await file.blob();\n const size = blob.size;\n\n if (size) {\n eventDetail.size = size;\n }\n } catch (err) {\n // Fail silently...\n }\n }\n\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:success`, {\n bubbles: true,\n composed: true,\n detail: eventDetail\n }));\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n }\n\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */\n getSupportedConstraints() {\n if (!CapturePhoto.isSupported()) {\n return {};\n }\n\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */\n getTrackCapabilities() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getCapabilities === 'function') {\n return track.getCapabilities() || {};\n }\n\n return {};\n }\n\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */\n getTrackSettings() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getSettings === 'function') {\n return track.getSettings() || {};\n }\n\n return {};\n }\n\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */\n static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='capture-photo'] - The name of the custom element.\n * @example\n *\n * CapturePhoto.defineCustomElement('my-capture-photo');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, CapturePhoto);\n }\n }\n}\n\nexport { CapturePhoto };\n","// @ts-check\n\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */\nexport const clamp = (value, lower, upper) => {\n if (Number.isNaN(lower)) {\n lower = 0;\n }\n\n if (Number.isNaN(upper)) {\n upper = 0;\n }\n\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n","Object.defineProperty({},\"ModalElement\",{get:function(){return t},set:void 0,enumerable:!0,configurable:!0});let e=document.createElement(\"template\");e.innerHTML=/* html */`\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */class t extends HTMLElement{/** @type {Nullable} */#e=null;/** @type {Nullable} */#t=null;/** @type {ReturnType | undefined} */#o=void 0;constructor(){if(super(),!this.shadowRoot){let t=this.attachShadow({mode:\"open\"});t.appendChild(e.content.cloneNode(!0))}this.shadowRoot&&(this.#e=this.shadowRoot.querySelector(\"dialog\"),this.#t=this.shadowRoot.querySelector('slot[name=\"footer\"]'))}static get observedAttributes(){return[\"open\",\"no-header\",\"no-animations\",\"no-close-button\"]}/**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */attributeChangedCallback(e,t,o){if(null!==this.#e){if(\"open\"===e&&t!==o&&(this.open?(this.#e.showModal(),document.body&&(document.body.style.overflowY=\"hidden\"),this.dispatchEvent(new CustomEvent(\"me-open\",{bubbles:!0,composed:!0,detail:{element:this}}))):this.#e.close()),\"no-header\"===e&&t!==o){/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__header\");null!==e&&(e.hidden=this.noHeader)}if(\"no-animations\"===e&&t!==o&&this.#e.classList.toggle(\"dialog--no-animations\",this.noAnimations),\"no-close-button\"===e&&t!==o){/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__close\");null!==e&&(e.hidden=this.noCloseButton)}}}/**\n * Lifecycle method that is called when the element is added to the DOM.\n */connectedCallback(){this.#i(\"open\"),this.#i(\"staticBackdrop\"),this.#i(\"noHeader\"),this.#i(\"noAnimations\"),this.#i(\"noCloseButton\"),this.#i(\"fullscreen\"),this.#e?.addEventListener(\"click\",this.#a),this.#e?.addEventListener(\"close\",this.#l),this.#e?.addEventListener(\"cancel\",this.#s),this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\",this.#n),this.#t?.addEventListener(\"slotchange\",this.#r)}/**\n * Lifecycle method that is called when the element is removed from the DOM.\n */disconnectedCallback(){this.#o&&clearTimeout(this.#o),this.#e?.addEventListener(\"click\",this.#a),this.#e?.removeEventListener(\"close\",this.#l),this.#e?.removeEventListener(\"cancel\",this.#s),this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\",this.#n),this.#t?.removeEventListener(\"slotchange\",this.#r)}/**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */get open(){return this.hasAttribute(\"open\")}set open(e){e?this.setAttribute(\"open\",\"\"):this.removeAttribute(\"open\")}/**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */get staticBackdrop(){return this.hasAttribute(\"static-backdrop\")}set staticBackdrop(e){e?this.setAttribute(\"static-backdrop\",\"\"):this.removeAttribute(\"static-backdrop\")}/**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */get noHeader(){return this.hasAttribute(\"no-header\")}set noHeader(e){e?this.setAttribute(\"no-header\",\"\"):this.removeAttribute(\"no-header\")}/**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */get noAnimations(){return this.hasAttribute(\"no-animations\")}set noAnimations(e){e?this.setAttribute(\"no-animations\",\"\"):this.removeAttribute(\"no-animations\")}/**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */get noCloseButton(){return this.hasAttribute(\"no-close-button\")}set noCloseButton(e){e?this.setAttribute(\"no-close-button\",\"\"):this.removeAttribute(\"no-close-button\")}/**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */get fullscreen(){return this.hasAttribute(\"fullscreen\")}set fullscreen(e){e?this.setAttribute(\"fullscreen\",\"\"):this.removeAttribute(\"fullscreen\")}/**\n * Applies a pulse effect on the dialog.\n */#d(){this.#o||(this.#e?.classList.add(\"dialog--pulse\"),this.#o=setTimeout(()=>{this.#e?.classList.remove(\"dialog--pulse\"),clearTimeout(this.#o),this.#o=void 0},300))}/**\n * Handles the close event of the dialog.\n */#l=()=>{// This is needed because the dialog element does not reset\n// the open property when the dialog is closed by the user.\nthis.open=!1,document.body&&(document.body.style.overflowY=\"\"),this.dispatchEvent(new CustomEvent(\"me-close\",{bubbles:!0,composed:!0,detail:{element:this}}))};/**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */#s=e=>{let t=this.#c(\"escape-key\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),this.noAnimations||this.#d())};/**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */#n=e=>{let t=this.#c(\"close-button\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),this.noAnimations||this.#d())};/**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */#a=e=>{if(e.target!==e.currentTarget)return;let t=this.#c(\"backdrop-click\");if(this.dispatchEvent(t),t.defaultPrevented||this.staticBackdrop){this.noAnimations||this.#d();return}this.#e?.close()};/**\n * Handles the slotchange event of the footer slot.\n */#r=()=>{if(null===this.#e)return;/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__footer\");if(null===e)return;let t=this.#t?.assignedNodes(),o=!!t&&t.length>0;e.hidden=!o};/**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */#c(e){return new CustomEvent(\"me-request-close\",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e,element:this}})}/**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */#i(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}/**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */show(){this.open||(this.open=!0)}/**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */hide(){this.open&&(this.open=!1)}/**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */static defineCustomElement(e=\"modal-element\"){\"undefined\"==typeof window||window.customElements.get(e)||window.customElements.define(e,t)}}t.defineCustomElement();export{t as ModalElement};//# sourceMappingURL=modal-element-defined.js.map\n\n//# sourceMappingURL=modal-element-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $180b6dcf923bafc7$exports = {};\n\n$parcel$export($180b6dcf923bafc7$exports, \"ModalElement\", function () { return $180b6dcf923bafc7$export$32589115725b904b; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ const $180b6dcf923bafc7$var$PULSE_ANIMATION_DURATION = 300;\nconst $180b6dcf923bafc7$var$template = document.createElement(\"template\");\n$180b6dcf923bafc7$var$template.innerHTML = /* html */ `\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;\n/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */ class $180b6dcf923bafc7$export$32589115725b904b extends HTMLElement {\n /** @type {Nullable} */ #dialogEl = null;\n /** @type {Nullable} */ #footerSlotEl = null;\n /** @type {ReturnType | undefined} */ #pulseAnimationTimeout = void 0;\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($180b6dcf923bafc7$var$template.content.cloneNode(true));\n }\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector(\"dialog\");\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n }\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) return;\n if (name === \"open\" && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n if (document.body) document.body.style.overflowY = \"hidden\";\n this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: true,\n composed: true,\n detail: {\n element: this\n }\n }));\n } else this.#dialogEl.close();\n }\n if (name === \"no-header\" && oldValue !== newValue) {\n /** @type {Nullable} */ const headerEl = this.#dialogEl.querySelector(\".dialog__header\");\n if (headerEl !== null) headerEl.hidden = this.noHeader;\n }\n if (name === \"no-animations\" && oldValue !== newValue) this.#dialogEl.classList.toggle(\"dialog--no-animations\", this.noAnimations);\n if (name === \"no-close-button\" && oldValue !== newValue) {\n /** @type {Nullable} */ const closeBtnEl = this.#dialogEl.querySelector(\".dialog__close\");\n if (closeBtnEl !== null) closeBtnEl.hidden = this.noCloseButton;\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"open\");\n this.#upgradeProperty(\"staticBackdrop\");\n this.#upgradeProperty(\"noHeader\");\n this.#upgradeProperty(\"noAnimations\");\n this.#upgradeProperty(\"noCloseButton\");\n this.#upgradeProperty(\"fullscreen\");\n this.#dialogEl?.addEventListener(\"click\", this.#handleDialogClick);\n this.#dialogEl?.addEventListener(\"close\", this.#handleDialogClose);\n this.#dialogEl?.addEventListener(\"cancel\", this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener(\"slotchange\", this.#handleFooterSlotChange);\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener(\"click\", this.#handleDialogClick);\n this.#dialogEl?.removeEventListener(\"close\", this.#handleDialogClose);\n this.#dialogEl?.removeEventListener(\"cancel\", this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener(\"slotchange\", this.#handleFooterSlotChange);\n }\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */ get open() {\n return this.hasAttribute(\"open\");\n }\n set open(value) {\n if (value) this.setAttribute(\"open\", \"\");\n else this.removeAttribute(\"open\");\n }\n /**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */ get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(value) {\n if (value) this.setAttribute(\"static-backdrop\", \"\");\n else this.removeAttribute(\"static-backdrop\");\n }\n /**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */ get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(value) {\n if (value) this.setAttribute(\"no-header\", \"\");\n else this.removeAttribute(\"no-header\");\n }\n /**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */ get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(value) {\n if (value) this.setAttribute(\"no-animations\", \"\");\n else this.removeAttribute(\"no-animations\");\n }\n /**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */ get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(value) {\n if (value) this.setAttribute(\"no-close-button\", \"\");\n else this.removeAttribute(\"no-close-button\");\n }\n /**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */ get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(value) {\n if (value) this.setAttribute(\"fullscreen\", \"\");\n else this.removeAttribute(\"fullscreen\");\n }\n /**\n * Applies a pulse effect on the dialog.\n */ #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) return;\n this.#dialogEl?.classList.add(\"dialog--pulse\");\n this.#pulseAnimationTimeout = setTimeout(()=>{\n this.#dialogEl?.classList.remove(\"dialog--pulse\");\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, $180b6dcf923bafc7$var$PULSE_ANIMATION_DURATION);\n }\n /**\n * Handles the close event of the dialog.\n */ #handleDialogClose = ()=>{\n // This is needed because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n if (document.body) document.body.style.overflowY = \"\";\n this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: true,\n composed: true,\n detail: {\n element: this\n }\n }));\n };\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */ #handleDialogCancel = (evt)=>{\n const requestCloseEvent = this.#createRequestCloseEvent(\"escape-key\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */ #handleCloseButtonClick = (evt)=>{\n const requestCloseEvent = this.#createRequestCloseEvent(\"close-button\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */ #handleDialogClick = (evt)=>{\n if (evt.target !== evt.currentTarget) return;\n const requestCloseEvent = this.#createRequestCloseEvent(\"backdrop-click\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n return;\n }\n this.#dialogEl?.close();\n };\n /**\n * Handles the slotchange event of the footer slot.\n */ #handleFooterSlotChange = ()=>{\n if (this.#dialogEl === null) return;\n /** @type {Nullable} */ const footerEl = this.#dialogEl.querySelector(\".dialog__footer\");\n if (footerEl === null) return;\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n footerEl.hidden = !hasFooterSlotNodes;\n };\n /**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */ #createRequestCloseEvent(reason) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason: reason,\n element: this\n }\n });\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */ show() {\n if (this.open) return;\n this.open = true;\n }\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */ hide() {\n if (!this.open) return;\n this.open = false;\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */ static defineCustomElement(elementName = \"modal-element\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $180b6dcf923bafc7$export$32589115725b904b);\n }\n}\n\n\n(0, $180b6dcf923bafc7$export$32589115725b904b).defineCustomElement();\n\n\nexport {$180b6dcf923bafc7$export$32589115725b904b as ModalElement};\n//# sourceMappingURL=modal-element-defined.js.map\n","import { ModalElement } from './modal-element.js';\n\nModalElement.defineCustomElement();\n\nexport { ModalElement };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst PULSE_ANIMATION_DURATION = 300;\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */`\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;\n\n/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */\nclass ModalElement extends HTMLElement {\n /** @type {Nullable} */\n #dialogEl = null;\n\n /** @type {Nullable} */\n #footerSlotEl = null;\n\n /** @type {ReturnType | undefined} */\n #pulseAnimationTimeout = void 0;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector('dialog');\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n }\n }\n\n static get observedAttributes() {\n return ['open', 'no-header', 'no-animations', 'no-close-button'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) {\n return;\n }\n\n if (name === 'open' && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n\n if (document.body) {\n document.body.style.overflowY = 'hidden';\n }\n\n this.dispatchEvent(new CustomEvent('me-open', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n }));\n } else {\n this.#dialogEl.close();\n }\n }\n\n if (name === 'no-header' && oldValue !== newValue) {\n /** @type {Nullable} */\n const headerEl = this.#dialogEl.querySelector('.dialog__header');\n\n if (headerEl !== null) {\n headerEl.hidden = this.noHeader;\n }\n }\n\n if (name === 'no-animations' && oldValue !== newValue) {\n this.#dialogEl.classList.toggle('dialog--no-animations', this.noAnimations);\n }\n\n if (name === 'no-close-button' && oldValue !== newValue) {\n /** @type {Nullable} */\n const closeBtnEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeBtnEl !== null) {\n closeBtnEl.hidden = this.noCloseButton;\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('open');\n this.#upgradeProperty('staticBackdrop');\n this.#upgradeProperty('noHeader');\n this.#upgradeProperty('noAnimations');\n this.#upgradeProperty('noCloseButton');\n this.#upgradeProperty('fullscreen');\n\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.addEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.addEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener('slotchange', this.#handleFooterSlotChange);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.removeEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.removeEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener('slotchange', this.#handleFooterSlotChange);\n }\n\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */\n get open() {\n return this.hasAttribute('open');\n }\n\n set open(value) {\n if (value) {\n this.setAttribute('open', '');\n } else {\n this.removeAttribute('open');\n }\n }\n\n /**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */\n get staticBackdrop() {\n return this.hasAttribute('static-backdrop');\n }\n\n set staticBackdrop(value) {\n if (value) {\n this.setAttribute('static-backdrop', '');\n } else {\n this.removeAttribute('static-backdrop');\n }\n }\n\n /**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */\n get noHeader() {\n return this.hasAttribute('no-header');\n }\n\n set noHeader(value) {\n if (value) {\n this.setAttribute('no-header', '');\n } else {\n this.removeAttribute('no-header');\n }\n }\n\n /**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */\n get noAnimations() {\n return this.hasAttribute('no-animations');\n }\n\n set noAnimations(value) {\n if (value) {\n this.setAttribute('no-animations', '');\n } else {\n this.removeAttribute('no-animations');\n }\n }\n\n /**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */\n get noCloseButton() {\n return this.hasAttribute('no-close-button');\n }\n\n set noCloseButton(value) {\n if (value) {\n this.setAttribute('no-close-button', '');\n } else {\n this.removeAttribute('no-close-button');\n }\n }\n\n /**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */\n get fullscreen() {\n return this.hasAttribute('fullscreen');\n }\n\n set fullscreen(value) {\n if (value) {\n this.setAttribute('fullscreen', '');\n } else {\n this.removeAttribute('fullscreen');\n }\n }\n\n /**\n * Applies a pulse effect on the dialog.\n */\n #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) {\n return;\n }\n\n this.#dialogEl?.classList.add('dialog--pulse');\n\n this.#pulseAnimationTimeout = setTimeout(() => {\n this.#dialogEl?.classList.remove('dialog--pulse');\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, PULSE_ANIMATION_DURATION);\n }\n\n /**\n * Handles the close event of the dialog.\n */\n #handleDialogClose = () => {\n // This is needed because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n\n if (document.body) {\n document.body.style.overflowY = '';\n }\n\n this.dispatchEvent(new CustomEvent('me-close', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n }));\n };\n\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */\n #handleDialogCancel = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('escape-key');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('close-button');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleDialogClick = evt => {\n if (evt.target !== evt.currentTarget) {\n return;\n }\n\n const requestCloseEvent = this.#createRequestCloseEvent('backdrop-click');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n return;\n }\n\n this.#dialogEl?.close();\n };\n\n /**\n * Handles the slotchange event of the footer slot.\n */\n #handleFooterSlotChange = () => {\n if (this.#dialogEl === null) {\n return;\n }\n\n /** @type {Nullable} */\n const footerEl = this.#dialogEl.querySelector('.dialog__footer');\n\n if (footerEl === null) {\n return;\n }\n\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n\n footerEl.hidden = !hasFooterSlotNodes;\n };\n\n /**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */\n #createRequestCloseEvent(reason) {\n return new CustomEvent('me-request-close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason,\n element: this\n }\n });\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */\n show() {\n if (this.open) {\n return;\n }\n\n this.open = true;\n }\n\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */\n hide() {\n if (!this.open) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */\n static defineCustomElement(elementName = 'modal-element') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ModalElement);\n }\n }\n}\n\nexport { ModalElement };\n","Object.defineProperty({},\"FilesDropzone\",{get:function(){return m},set:void 0,enumerable:!0,configurable:!0});let e=new Map([[\"aac\",\"audio/aac\"],[\"abw\",\"application/x-abiword\"],[\"arc\",\"application/x-freearc\"],[\"avif\",\"image/avif\"],[\"avi\",\"video/x-msvideo\"],[\"azw\",\"application/vnd.amazon.ebook\"],[\"bin\",\"application/octet-stream\"],[\"bmp\",\"image/bmp\"],[\"bz\",\"application/x-bzip\"],[\"bz2\",\"application/x-bzip2\"],[\"cda\",\"application/x-cdf\"],[\"csh\",\"application/x-csh\"],[\"css\",\"text/css\"],[\"csv\",\"text/csv\"],[\"doc\",\"application/msword\"],[\"docx\",\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"],[\"eot\",\"application/vnd.ms-fontobject\"],[\"epub\",\"application/epub+zip\"],[\"gz\",\"application/gzip\"],[\"gif\",\"image/gif\"],[\"heic\",\"image/heic\"],[\"heif\",\"image/heif\"],[\"htm\",\"text/html\"],[\"html\",\"text/html\"],[\"ico\",\"image/vnd.microsoft.icon\"],[\"ics\",\"text/calendar\"],[\"jar\",\"application/java-archive\"],[\"jpeg\",\"image/jpeg\"],[\"jpg\",\"image/jpeg\"],[\"jxl\",\"image/jxl\"],[\"js\",\"text/javascript\"],[\"json\",\"application/json\"],[\"jsonld\",\"application/ld+json\"],[\"markdown\",\"text/markdown\"],[\"md\",\"text/markdown\"],[\"mid\",\"audio/midi\"],[\"midi\",\"audio/midi\"],[\"mjs\",\"text/javascript\"],[\"mp3\",\"audio/mpeg\"],[\"mp4\",\"video/mp4\"],[\"mpeg\",\"video/mpeg\"],[\"mpkg\",\"application/vnd.apple.installer+xml\"],[\"odp\",\"application/vnd.oasis.opendocument.presentation\"],[\"ods\",\"application/vnd.oasis.opendocument.spreadsheet\"],[\"odt\",\"application/vnd.oasis.opendocument.text\"],[\"oga\",\"audio/ogg\"],[\"ogv\",\"video/ogg\"],[\"ogx\",\"application/ogg\"],[\"opus\",\"audio/opus\"],[\"otf\",\"font/otf\"],[\"png\",\"image/png\"],[\"pdf\",\"application/pdf\"],[\"php\",\"application/x-httpd-php\"],[\"ppt\",\"application/vnd.ms-powerpoint\"],[\"pptx\",\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"],[\"rar\",\"application/vnd.rar\"],[\"rtf\",\"application/rtf\"],[\"sh\",\"application/x-sh\"],[\"svg\",\"image/svg+xml\"],[\"swf\",\"application/x-shockwave-flash\"],[\"tar\",\"application/x-tar\"],[\"tif\",\"image/tiff\"],[\"tiff\",\"image/tiff\"],[\"ts\",\"video/mp2t\"],[\"ttf\",\"font/ttf\"],[\"txt\",\"text/plain\"],[\"vsd\",\"application/vnd.visio\"],[\"wav\",\"audio/wav\"],[\"weba\",\"audio/webm\"],[\"webm\",\"video/webm\"],[\"webp\",\"image/webp\"],[\"woff\",\"font/woff\"],[\"woff2\",\"font/woff2\"],[\"xhtml\",\"application/xhtml+xml\"],[\"xls\",\"application/vnd.ms-excel\"],[\"xlsx\",\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"],[\"xml\",\"application/xml\"],[\"xul\",\"application/vnd.mozilla.xul+xml\"],[\"zip\",\"application/zip\"],[\"7z\",\"application/x-7z-compressed\"],[\"mkv\",\"video/x-matroska\"],[\"mov\",\"video/quicktime\"],[\"msg\",\"application/vnd.ms-outlook\"]]),t=[\".DS_Store\",\"Thumbs.db\"],o=t=>{let{name:o}=t;if(o&&-1!==o.lastIndexOf(\".\")&&!t.type){let i=(o.split(\".\").pop()||\"\").toLowerCase(),r=e.get(i);r&&Object.defineProperty(t,\"type\",{value:r,writable:!1,configurable:!1,enumerable:!0})}return t},i=(e,t)=>{let i=o(e);if(\"string\"!=typeof i.path){let{webkitRelativePath:o}=e;Object.defineProperty(i,\"path\",{value:\"string\"==typeof t?t:o||e.name,writable:!1,configurable:!1,enumerable:!0})}return i},r=async e=>await new Promise((t,o)=>{e.readEntries(t,o)}),a=async e=>{let t=[],o=await r(e);for(;o.length>0;)t.push(...o),o=await r(e);return t},n=e=>new Promise((t,o)=>{e.file(o=>t(i(o,e.fullPath)),o)}),s=async e=>{let o=[],i=[];for(let t of e){if(\"file\"!==t.kind)continue;let e=t.getAsEntry?t.getAsEntry():t.webkitGetAsEntry();i.push(e)}for(;i.length>0;){let e=i.shift();if(e){if(e.isFile){let i=await n(e);-1===t.indexOf(i.name)&&o.push(i)}else e.isDirectory&&i.push(...await a(e.createReader()))}}return o},d=async e=>{let o=[];for(let r of e)-1===t.indexOf(r.name)&&o.push(i(r));return o},l=async e=>e.dataTransfer?e.dataTransfer.items?await s(e.dataTransfer.items):await d(e.dataTransfer.files):await d(e.target.files),p=\"files-dropzone\",c=\"TOO_MANY_FILES\",h=document.createElement(\"template\"),u=`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;h.innerHTML=`\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;class m extends HTMLElement{#e=null;#t=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(h.content.cloneNode(!0)),this.shadowRoot&&(this.#e=this.shadowRoot.getElementById(\"fileInput\"),this.#t=this.shadowRoot.getElementById(\"dropzoneEl\"))}static get observedAttributes(){return[\"accept\",\"disabled\",\"multiple\",\"no-keyboard\"]}attributeChangedCallback(e,t,o){\"accept\"===e&&t!==o&&this.#e&&(this.#e.accept=this.accept),\"disabled\"===e&&t!==o&&this.#e&&(this.#e.disabled=this.disabled,this.disabled?this.#t?.removeAttribute(\"tabindex\"):this.#t?.setAttribute(\"tabindex\",\"0\")),\"multiple\"===e&&t!==o&&this.#e&&(this.#e.multiple=this.multiple),\"no-keyboard\"===e&&t!==o&&this.#t&&(this.noKeyboard?this.#t.removeAttribute(\"tabindex\"):this.#t.setAttribute(\"tabindex\",\"0\"))}connectedCallback(){this.#o(\"accept\"),this.#o(\"disabled\"),this.#o(\"maxFiles\"),this.#o(\"maxSize\"),this.#o(\"minSize\"),this.#o(\"multiple\"),this.#o(\"noClick\"),this.#o(\"noDrag\"),this.#o(\"noKeyboard\"),this.#o(\"autoFocus\"),this.#o(\"noStyle\"),this.#e?.addEventListener(\"change\",this.#i),this.#t?.addEventListener(\"dragenter\",this.#r),this.#t?.addEventListener(\"dragover\",this.#a),this.#t?.addEventListener(\"dragleave\",this.#n),this.#t?.addEventListener(\"drop\",this.#s),this.#t?.addEventListener(\"click\",this.#d),this.#t?.addEventListener(\"keyup\",this.#l),this.autoFocus&&this.#t?.focus()}disconnectedCallback(){this.#e?.removeEventListener(\"change\",this.#i),this.#t?.removeEventListener(\"dragenter\",this.#r),this.#t?.removeEventListener(\"dragover\",this.#a),this.#t?.removeEventListener(\"dragleave\",this.#n),this.#t?.removeEventListener(\"drop\",this.#s),this.#t?.removeEventListener(\"click\",this.#d),this.#t?.removeEventListener(\"keyup\",this.#l)}get accept(){return this.getAttribute(\"accept\")||\"\"}set accept(e){this.setAttribute(\"accept\",null!=e?e.toString():e)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}get maxFiles(){let e=Number(this.getAttribute(\"max-files\"))||0;return e<=0?1/0:Math.floor(Math.abs(e))}set maxFiles(e){this.setAttribute(\"max-files\",null!=e?e.toString():e)}get maxSize(){let e=this.getAttribute(\"max-size\");if(null===e)return 1/0;let t=Number(e);return Number.isNaN(t)?1/0:t}set maxSize(e){this.setAttribute(\"max-size\",null!=e?e.toString():e)}get minSize(){let e=this.getAttribute(\"min-size\");if(null===e)return 0;let t=Number(e);return Number.isNaN(t)?0:t}set minSize(e){this.setAttribute(\"min-size\",null!=e?e.toString():e)}get multiple(){return this.hasAttribute(\"multiple\")}set multiple(e){this.toggleAttribute(\"multiple\",!!e)}get noClick(){return this.hasAttribute(\"no-click\")}set noClick(e){this.toggleAttribute(\"no-click\",!!e)}get noDrag(){return this.hasAttribute(\"no-drag\")}set noDrag(e){this.toggleAttribute(\"no-drag\",!!e)}get noKeyboard(){return this.hasAttribute(\"no-keyboard\")}set noKeyboard(e){this.toggleAttribute(\"no-keyboard\",!!e)}get autoFocus(){return this.hasAttribute(\"auto-focus\")}set autoFocus(e){this.toggleAttribute(\"auto-focus\",!!e)}get noStyle(){return this.hasAttribute(\"no-style\")}set noStyle(e){this.toggleAttribute(\"no-style\",!!e)}#i=async e=>{try{this.#p(await l(e))}catch(e){this.dispatchEvent(new CustomEvent(`${p}-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}};#r=()=>{this.disabled||this.noDrag||this.dispatchEvent(new Event(`${p}-dragenter`,{bubbles:!0,composed:!0}))};#a=e=>{if(e.preventDefault(),this.disabled||this.noDrag){e.dataTransfer.dropEffect=\"none\";return}e.dataTransfer.dropEffect=\"copy\",this.#t&&(this.#t.classList.add(\"dropzone--dragover\"),this.#t.part.add(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${p}-dragover`,{bubbles:!0,composed:!0}))};#n=()=>{this.disabled||this.noDrag||(this.#t&&(this.#t.classList.remove(\"dropzone--dragover\"),this.#t.part.remove(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${p}-dragleave`,{bubbles:!0,composed:!0})))};#s=async e=>{if(!this.disabled&&!this.noDrag){e.preventDefault(),this.#t&&(this.#t.classList.remove(\"dropzone--dragover\"),this.#t.part.remove(\"dropzone--dragover\"));try{this.#p(await l(e))}catch(e){this.dispatchEvent(new CustomEvent(`${p}-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}}};#d=()=>{this.disabled||this.noClick||this.#e?.click()};#l=e=>{this.disabled||this.noKeyboard||\" \"!==e.key&&\"Enter\"!==e.key||this.#e?.click()};#p(e){if(!Array.isArray(e)||!e.length)return;let t=[],o=[],i=e.length;if(!this.multiple&&i>1)for(let t of e)o.push({file:t,errors:[{code:c,message:\"Too many files selected. Only 1 file is allowed.\"}]});else if(this.multiple&&i>this.maxFiles)for(let t of e)o.push({file:t,errors:[{code:c,message:`Too many files selected. Only ${this.maxFiles} ${this.maxFiles>1?\"files are\":\"file is\"} allowed.`}]});else for(let i of e){let e=function(e,t=\"\"){if(!t)return!0;let o=[...new Set(t.split(\",\").map(e=>e.trim()).filter(Boolean))],i=e.type,r=i.replace(/\\/.*$/,\"\");for(let t of o)if(\".\"===t.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(t.toLowerCase(),e.name.length-t.length))return!0}else if(/\\/\\*$/.test(t)){if(r===t.replace(/\\/.*$/,\"\"))return!0}else if(i===t)return!0;return!1}(i,this.accept),r=i.size>this.maxSize,a=i.size0&&this.dispatchEvent(new CustomEvent(`${p}-drop-accepted`,{bubbles:!0,composed:!0,detail:{acceptedFiles:t}})),o.length>0&&this.dispatchEvent(new CustomEvent(`${p}-drop-rejected`,{bubbles:!0,composed:!0,detail:{rejectedFiles:o}})),this.#e&&(this.#e.value=this.#e.defaultValue)}openFileDialog(){this.disabled||this.#e?.click()}#o(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}static defineCustomElement(e=p){\"undefined\"==typeof window||window.customElements.get(e)||window.customElements.define(e,m)}}m.defineCustomElement();export{m as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $862aa3736b0514bc$exports = {};\n\n$parcel$export($862aa3736b0514bc$exports, \"FilesDropzone\", function () { return $862aa3736b0514bc$export$6ccd1735166caad9; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ // @ts-check\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */ function $38f222170fd4d21a$export$7c47054fed488f80(file, acceptedTypeSpecifiers = \"\") {\n if (!acceptedTypeSpecifiers) return true;\n const acceptedMimeTypesList = [\n ...new Set(acceptedTypeSpecifiers.split(\",\").map((v)=>v.trim()).filter(Boolean))\n ];\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, \"\");\n for (const validType of acceptedMimeTypesList){\n if (validType.charAt(0) === \".\") {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) return true;\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, \"\")) return true;\n } else {\n if (fileMimeType === validType) return true;\n }\n }\n return false;\n}\n\n\n// @ts-check\n/**\n * A map of common file extensions and their associated MIME types.\n */ const $f31161edf38949e9$var$COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n // Others\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]);\nconst $f31161edf38949e9$var$FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n \".DS_Store\",\n \"Thumbs.db\" // Windows\n];\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */ const $f31161edf38949e9$var$toFileWithMimeType = (file)=>{\n const { name: name } = file;\n const hasExtension = name && name.lastIndexOf(\".\") !== -1;\n if (hasExtension && !file.type) {\n const extension = (name.split(\".\").pop() || \"\").toLowerCase();\n const type = $f31161edf38949e9$var$COMMON_MIME_TYPES.get(extension);\n if (type) Object.defineProperty(file, \"type\", {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return file;\n};\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */ const $f31161edf38949e9$var$toFileWithPath = (file, path)=>{\n const fileWithMimeType = $f31161edf38949e9$var$toFileWithMimeType(file);\n // @ts-ignore\n if (typeof fileWithMimeType.path !== \"string\") {\n const { webkitRelativePath: webkitRelativePath } = file;\n Object.defineProperty(fileWithMimeType, \"path\", {\n value: typeof path === \"string\" ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return fileWithMimeType;\n};\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */ const $f31161edf38949e9$var$readEntriesPromise = async (directoryReader)=>{\n return await new Promise((resolve, reject)=>{\n directoryReader.readEntries(resolve, reject);\n });\n};\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */ const $f31161edf38949e9$var$readAllDirectoryEntries = async (directoryReader)=>{\n const entries = [];\n let readEntries = await $f31161edf38949e9$var$readEntriesPromise(directoryReader);\n while(readEntries.length > 0){\n entries.push(...readEntries);\n readEntries = await $f31161edf38949e9$var$readEntriesPromise(directoryReader);\n }\n return entries;\n};\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */ const $f31161edf38949e9$var$getFileFromFileEntry = (fileEntry)=>{\n return new Promise((resolve, reject)=>{\n fileEntry.file((file)=>resolve($f31161edf38949e9$var$toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */ const $f31161edf38949e9$var$getFilesFromDataTransferItemList = async (dataTransferItemList)=>{\n const files = [];\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n for (const item of dataTransferItemList){\n if (item.kind !== \"file\") continue;\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n queue.push(entry);\n }\n while(queue.length > 0){\n const entry = queue.shift();\n if (!entry) continue;\n else if (entry.isFile) {\n const file = await $f31161edf38949e9$var$getFileFromFileEntry(entry);\n if ($f31161edf38949e9$var$FILES_TO_IGNORE.indexOf(file.name) === -1) files.push(file);\n } else if (entry.isDirectory) queue.push(...await $f31161edf38949e9$var$readAllDirectoryEntries(entry.createReader()));\n }\n return files;\n};\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */ const $f31161edf38949e9$var$getFilesFromFileList = async (fileList)=>{\n const files = [];\n for (const file of fileList)if ($f31161edf38949e9$var$FILES_TO_IGNORE.indexOf(file.name) === -1) files.push($f31161edf38949e9$var$toFileWithPath(file));\n return files;\n};\nconst $f31161edf38949e9$export$6d52664cd15c442 = async (evt)=>{\n if (evt.dataTransfer) return evt.dataTransfer.items ? await $f31161edf38949e9$var$getFilesFromDataTransferItemList(evt.dataTransfer.items) : await $f31161edf38949e9$var$getFilesFromFileList(evt.dataTransfer.files);\n return await $f31161edf38949e9$var$getFilesFromFileList(evt.target.files);\n};\n\n\nconst $862aa3736b0514bc$var$COMPONENT_NAME = \"files-dropzone\";\nconst $862aa3736b0514bc$var$TOO_MANY_FILES = \"TOO_MANY_FILES\";\nconst $862aa3736b0514bc$var$FILE_TOO_LARGE = \"FILE_TOO_LARGE\";\nconst $862aa3736b0514bc$var$FILE_TOO_SMALL = \"FILE_TOO_SMALL\";\nconst $862aa3736b0514bc$var$INVALID_MIME_TYPE = \"INVALID_MIME_TYPE\";\nconst $862aa3736b0514bc$var$template = document.createElement(\"template\");\nconst $862aa3736b0514bc$var$styles = /* css */ `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$862aa3736b0514bc$var$template.innerHTML = /* html */ `\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} noClick - Prevents the file dialog from opening when the dropzone is clicked.\n * @property {boolean} noDrag - Prevents the dropzone from reacting to drag events.\n * @property {boolean} noKeyboard - Prevents the dropzone from reacting to keyboard events.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} no-click - Reflects the noClick property.\n * @attribute {boolean} no-drag - Reflects the noDrag property.\n * @attribute {boolean} no-keyboard - Reflects the noKeyboard property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */ class $862aa3736b0514bc$export$6ccd1735166caad9 extends HTMLElement {\n /** @type {Nullable} */ #fileInput = null;\n /** @type {Nullable} */ #dropzoneEl = null;\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($862aa3736b0514bc$var$template.content.cloneNode(true));\n }\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */ this.shadowRoot.getElementById(\"fileInput\");\n this.#dropzoneEl = this.shadowRoot.getElementById(\"dropzoneEl\");\n }\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\",\n \"no-keyboard\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"accept\" && oldValue !== newValue && this.#fileInput) this.#fileInput.accept = this.accept;\n if (name === \"disabled\" && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n if (this.disabled) this.#dropzoneEl?.removeAttribute(\"tabindex\");\n else this.#dropzoneEl?.setAttribute(\"tabindex\", \"0\");\n }\n if (name === \"multiple\" && oldValue !== newValue && this.#fileInput) this.#fileInput.multiple = this.multiple;\n if (name === \"no-keyboard\" && oldValue !== newValue && this.#dropzoneEl) {\n if (this.noKeyboard) this.#dropzoneEl.removeAttribute(\"tabindex\");\n else this.#dropzoneEl.setAttribute(\"tabindex\", \"0\");\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"accept\");\n this.#upgradeProperty(\"disabled\");\n this.#upgradeProperty(\"maxFiles\");\n this.#upgradeProperty(\"maxSize\");\n this.#upgradeProperty(\"minSize\");\n this.#upgradeProperty(\"multiple\");\n this.#upgradeProperty(\"noClick\");\n this.#upgradeProperty(\"noDrag\");\n this.#upgradeProperty(\"noKeyboard\");\n this.#upgradeProperty(\"autoFocus\");\n this.#upgradeProperty(\"noStyle\");\n this.#fileInput?.addEventListener(\"change\", this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener(\"dragenter\", this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener(\"dragover\", this.#handleDragOver);\n this.#dropzoneEl?.addEventListener(\"dragleave\", this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener(\"drop\", this.#handleDrop);\n this.#dropzoneEl?.addEventListener(\"click\", this.#handleClick);\n this.#dropzoneEl?.addEventListener(\"keyup\", this.#handleKeyUp);\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#fileInput?.removeEventListener(\"change\", this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener(\"dragenter\", this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener(\"dragover\", this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener(\"dragleave\", this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener(\"drop\", this.#handleDrop);\n this.#dropzoneEl?.removeEventListener(\"click\", this.#handleClick);\n this.#dropzoneEl?.removeEventListener(\"keyup\", this.#handleKeyUp);\n }\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */ get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(value) {\n this.setAttribute(\"accept\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */ get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(value) {\n this.toggleAttribute(\"disabled\", !!value);\n }\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */ get maxFiles() {\n const num = Number(this.getAttribute(\"max-files\")) || 0;\n if (num <= 0) return Infinity;\n return Math.floor(Math.abs(num));\n }\n set maxFiles(value) {\n this.setAttribute(\"max-files\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */ get maxSize() {\n const value = this.getAttribute(\"max-size\");\n if (value === null) return Infinity;\n const num = Number(value);\n return Number.isNaN(num) ? Infinity : num;\n }\n set maxSize(value) {\n this.setAttribute(\"max-size\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */ get minSize() {\n const value = this.getAttribute(\"min-size\");\n if (value === null) return 0;\n const num = Number(value);\n return Number.isNaN(num) ? 0 : num;\n }\n set minSize(value) {\n this.setAttribute(\"min-size\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */ get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(value) {\n this.toggleAttribute(\"multiple\", !!value);\n }\n /**\n * @type {boolean} - Prevents the file dialog from opening when the dropzone is clicked.\n * @default false\n * @attribute no-click - Reflects the noClick property.\n */ get noClick() {\n return this.hasAttribute(\"no-click\");\n }\n set noClick(value) {\n this.toggleAttribute(\"no-click\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from reacting to drag events.\n * @default false\n * @attribute no-drag - Reflects the noDrag property.\n */ get noDrag() {\n return this.hasAttribute(\"no-drag\");\n }\n set noDrag(value) {\n this.toggleAttribute(\"no-drag\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from reacting to keyboard events.\n * @default false\n * @attribute no-keyboard - Reflects the noKeyboard property.\n */ get noKeyboard() {\n return this.hasAttribute(\"no-keyboard\");\n }\n set noKeyboard(value) {\n this.toggleAttribute(\"no-keyboard\", !!value);\n }\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */ get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(value) {\n this.toggleAttribute(\"auto-focus\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */ get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(value) {\n this.toggleAttribute(\"no-style\", !!value);\n }\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */ #handleFileInputChange = async (evt)=>{\n try {\n this.#handleFilesSelect(await (0, $f31161edf38949e9$export$6d52664cd15c442)(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n };\n /**\n * Handles the dragenter event of the dropzone.\n */ #handleDragEnter = ()=>{\n if (this.disabled || this.noDrag) return;\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleDragOver = (evt)=>{\n evt.preventDefault();\n if (this.disabled || this.noDrag) {\n evt.dataTransfer.dropEffect = \"none\";\n return;\n }\n evt.dataTransfer.dropEffect = \"copy\";\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add(\"dropzone--dragover\");\n this.#dropzoneEl.part.add(\"dropzone--dragover\");\n }\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the dragleave event of the dropzone.\n */ #handleDragLeave = ()=>{\n if (this.disabled || this.noDrag) return;\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove(\"dropzone--dragover\");\n this.#dropzoneEl.part.remove(\"dropzone--dragover\");\n }\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleDrop = async (evt)=>{\n if (this.disabled || this.noDrag) return;\n evt.preventDefault();\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove(\"dropzone--dragover\");\n this.#dropzoneEl.part.remove(\"dropzone--dragover\");\n }\n try {\n this.#handleFilesSelect(await (0, $f31161edf38949e9$export$6d52664cd15c442)(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n };\n /**\n * Handles the click event of the dropzone.\n */ #handleClick = ()=>{\n if (this.disabled || this.noClick) return;\n this.#fileInput?.click();\n };\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleKeyUp = (evt)=>{\n if (this.disabled || this.noKeyboard) return;\n if (evt.key === \" \" || evt.key === \"Enter\") this.#fileInput?.click();\n };\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */ #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) return;\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) for (const file of files)rejectedFiles.push({\n file: file,\n errors: [\n {\n code: $862aa3736b0514bc$var$TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }\n ]\n });\n else if (this.multiple && filesLength > this.maxFiles) // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files)rejectedFiles.push({\n file: file,\n errors: [\n {\n code: $862aa3736b0514bc$var$TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files){\n const fileHasValidType = (0, $38f222170fd4d21a$export$7c47054fed488f80)(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) acceptedFiles.push(file);\n else {\n const errors = [];\n if (!fileHasValidType) errors.push({\n code: $862aa3736b0514bc$var$INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n if (fileExceedsMaxSize) errors.push({\n code: $862aa3736b0514bc$var$FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n if (fileIsSmallerThanMinSize) errors.push({\n code: $862aa3736b0514bc$var$FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n rejectedFiles.push({\n file: file,\n errors: errors\n });\n }\n }\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles: acceptedFiles,\n rejectedFiles: rejectedFiles\n }\n }));\n if (acceptedFiles.length > 0) this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles: acceptedFiles\n }\n }));\n if (rejectedFiles.length > 0) this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles: rejectedFiles\n }\n }));\n if (this.#fileInput) this.#fileInput.value = this.#fileInput.defaultValue;\n }\n /**\n * Opens the file dialog programmatically.\n */ openFileDialog() {\n if (this.disabled) return;\n this.#fileInput?.click();\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'noClick' | 'noDrag' | 'noKeyboard' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */ static defineCustomElement(elementName = $862aa3736b0514bc$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $862aa3736b0514bc$export$6ccd1735166caad9);\n }\n}\n\n\n(0, $862aa3736b0514bc$export$6ccd1735166caad9).defineCustomElement();\n\n\nexport {$862aa3736b0514bc$export$6ccd1735166caad9 as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","import { FilesDropzone } from './files-dropzone.js';\n\nFilesDropzone.defineCustomElement();\n\nexport { FilesDropzone };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nimport { isValidFile } from './utils/is-valid-file.js';\nimport { getFilesFromEvent } from './utils/files-selector.js';\n\nconst COMPONENT_NAME = 'files-dropzone';\nconst TOO_MANY_FILES = 'TOO_MANY_FILES';\nconst FILE_TOO_LARGE = 'FILE_TOO_LARGE';\nconst FILE_TOO_SMALL = 'FILE_TOO_SMALL';\nconst INVALID_MIME_TYPE = 'INVALID_MIME_TYPE';\nconst template = document.createElement('template');\n\nconst styles = /* css */`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n\ntemplate.innerHTML = /* html */`\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\n\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} noClick - Prevents the file dialog from opening when the dropzone is clicked.\n * @property {boolean} noDrag - Prevents the dropzone from reacting to drag events.\n * @property {boolean} noKeyboard - Prevents the dropzone from reacting to keyboard events.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} no-click - Reflects the noClick property.\n * @attribute {boolean} no-drag - Reflects the noDrag property.\n * @attribute {boolean} no-keyboard - Reflects the noKeyboard property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */\nclass FilesDropzone extends HTMLElement {\n /** @type {Nullable} */\n #fileInput = null;\n\n /** @type {Nullable} */\n #dropzoneEl = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */(this.shadowRoot.getElementById('fileInput'));\n this.#dropzoneEl = this.shadowRoot.getElementById('dropzoneEl');\n }\n }\n\n static get observedAttributes() {\n return ['accept', 'disabled', 'multiple', 'no-keyboard'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'accept' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.accept = this.accept;\n }\n\n if (name === 'disabled' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n\n if (this.disabled) {\n this.#dropzoneEl?.removeAttribute('tabindex');\n } else {\n this.#dropzoneEl?.setAttribute('tabindex', '0');\n }\n }\n\n if (name === 'multiple' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.multiple = this.multiple;\n }\n\n if (name === 'no-keyboard' && oldValue !== newValue && this.#dropzoneEl) {\n if (this.noKeyboard) {\n this.#dropzoneEl.removeAttribute('tabindex');\n } else {\n this.#dropzoneEl.setAttribute('tabindex', '0');\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('accept');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('maxFiles');\n this.#upgradeProperty('maxSize');\n this.#upgradeProperty('minSize');\n this.#upgradeProperty('multiple');\n this.#upgradeProperty('noClick');\n this.#upgradeProperty('noDrag');\n this.#upgradeProperty('noKeyboard');\n this.#upgradeProperty('autoFocus');\n this.#upgradeProperty('noStyle');\n\n this.#fileInput?.addEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.addEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.addEventListener('click', this.#handleClick);\n this.#dropzoneEl?.addEventListener('keyup', this.#handleKeyUp);\n\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#fileInput?.removeEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.removeEventListener('click', this.#handleClick);\n this.#dropzoneEl?.removeEventListener('keyup', this.#handleKeyUp);\n }\n\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */\n get accept() {\n return this.getAttribute('accept') || '';\n }\n\n set accept(value) {\n this.setAttribute('accept', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */\n get maxFiles() {\n const num = Number(this.getAttribute('max-files')) || 0;\n\n if (num <= 0) {\n return Infinity;\n }\n\n return Math.floor(Math.abs(num));\n }\n\n set maxFiles(value) {\n this.setAttribute('max-files', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */\n get maxSize() {\n const value = this.getAttribute('max-size');\n\n if (value === null) {\n return Infinity;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? Infinity : num;\n }\n\n set maxSize(value) {\n this.setAttribute('max-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */\n get minSize() {\n const value = this.getAttribute('min-size');\n\n if (value === null) {\n return 0;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? 0 : num;\n }\n\n set minSize(value) {\n this.setAttribute('min-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */\n get multiple() {\n return this.hasAttribute('multiple');\n }\n\n set multiple(value) {\n this.toggleAttribute('multiple', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the file dialog from opening when the dropzone is clicked.\n * @default false\n * @attribute no-click - Reflects the noClick property.\n */\n get noClick() {\n return this.hasAttribute('no-click');\n }\n\n set noClick(value) {\n this.toggleAttribute('no-click', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from reacting to drag events.\n * @default false\n * @attribute no-drag - Reflects the noDrag property.\n */\n get noDrag() {\n return this.hasAttribute('no-drag');\n }\n\n set noDrag(value) {\n this.toggleAttribute('no-drag', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from reacting to keyboard events.\n * @default false\n * @attribute no-keyboard - Reflects the noKeyboard property.\n */\n get noKeyboard() {\n return this.hasAttribute('no-keyboard');\n }\n\n set noKeyboard(value) {\n this.toggleAttribute('no-keyboard', !!value);\n }\n\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */\n get autoFocus() {\n return this.hasAttribute('auto-focus');\n }\n\n set autoFocus(value) {\n this.toggleAttribute('auto-focus', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */\n get noStyle() {\n return this.hasAttribute('no-style');\n }\n\n set noStyle(value) {\n this.toggleAttribute('no-style', !!value);\n }\n\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */\n #handleFileInputChange = async evt => {\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n };\n\n /**\n * Handles the dragenter event of the dropzone.\n */\n #handleDragEnter = () => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDragOver = evt => {\n evt.preventDefault();\n\n if (this.disabled || this.noDrag) {\n evt.dataTransfer.dropEffect = 'none';\n return;\n }\n\n evt.dataTransfer.dropEffect = 'copy';\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add('dropzone--dragover');\n this.#dropzoneEl.part.add('dropzone--dragover');\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the dragleave event of the dropzone.\n */\n #handleDragLeave = () => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDrop = async evt => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n evt.preventDefault();\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n };\n\n /**\n * Handles the click event of the dropzone.\n */\n #handleClick = () => {\n if (this.disabled || this.noClick) {\n return;\n }\n\n this.#fileInput?.click();\n };\n\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleKeyUp = evt => {\n if (this.disabled || this.noKeyboard) {\n return;\n }\n\n if (evt.key === ' ' || evt.key === 'Enter') {\n this.#fileInput?.click();\n }\n };\n\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */\n #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) {\n return;\n }\n\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) {\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [{\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }]\n });\n }\n } else if (this.multiple && filesLength > this.maxFiles) {\n // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [{\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? 'files are' : 'file is'} allowed.`\n }]\n });\n }\n } else {\n // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files) {\n const fileHasValidType = isValidFile(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) {\n acceptedFiles.push(file);\n } else {\n const errors = [];\n\n if (!fileHasValidType) {\n errors.push({\n code: INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n }\n\n if (fileExceedsMaxSize) {\n errors.push({\n code: FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n }\n\n if (fileIsSmallerThanMinSize) {\n errors.push({\n code: FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n }\n\n rejectedFiles.push({ file, errors });\n }\n }\n }\n\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles,\n rejectedFiles\n }\n }));\n\n if (acceptedFiles.length > 0) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles\n }\n }));\n }\n\n if (rejectedFiles.length > 0) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles\n }\n }));\n }\n\n if (this.#fileInput) {\n this.#fileInput.value = this.#fileInput.defaultValue;\n }\n }\n\n /**\n * Opens the file dialog programmatically.\n */\n openFileDialog() {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'noClick' | 'noDrag' | 'noKeyboard' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, FilesDropzone);\n }\n }\n}\n\nexport { FilesDropzone };\n","// @ts-check\n\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */\nexport function isValidFile(file, acceptedTypeSpecifiers = '') {\n if (!acceptedTypeSpecifiers) {\n return true;\n }\n\n const acceptedMimeTypesList = [\n ...new Set(acceptedTypeSpecifiers.split(',').map(v => v.trim()).filter(Boolean))\n ];\n\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, '');\n\n for (const validType of acceptedMimeTypesList) {\n if (validType.charAt(0) === '.') {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {\n return true;\n }\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, '')) {\n return true;\n }\n } else {\n if (fileMimeType === validType) {\n return true;\n }\n }\n }\n\n return false;\n}\n","// @ts-check\n\n/**\n * A map of common file extensions and their associated MIME types.\n */\nconst COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n ['aac', 'audio/aac'],\n ['abw', 'application/x-abiword'],\n ['arc', 'application/x-freearc'],\n ['avif', 'image/avif'],\n ['avi', 'video/x-msvideo'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bin', 'application/octet-stream'],\n ['bmp', 'image/bmp'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['cda', 'application/x-cdf'],\n ['csh', 'application/x-csh'],\n ['css', 'text/css'],\n ['csv', 'text/csv'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['epub', 'application/epub+zip'],\n ['gz', 'application/gzip'],\n ['gif', 'image/gif'],\n ['heic', 'image/heic'],\n ['heif', 'image/heif'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['ico', 'image/vnd.microsoft.icon'],\n ['ics', 'text/calendar'],\n ['jar', 'application/java-archive'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['jxl', 'image/jxl'],\n ['js', 'text/javascript'],\n ['json', 'application/json'],\n ['jsonld', 'application/ld+json'],\n ['markdown', 'text/markdown'],\n ['md', 'text/markdown'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mjs', 'text/javascript'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mpeg', 'video/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['opus', 'audio/opus'],\n ['otf', 'font/otf'],\n ['png', 'image/png'],\n ['pdf', 'application/pdf'],\n ['php', 'application/x-httpd-php'],\n ['ppt', 'application/vnd.ms-powerpoint'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['rar', 'application/vnd.rar'],\n ['rtf', 'application/rtf'],\n ['sh', 'application/x-sh'],\n ['svg', 'image/svg+xml'],\n ['swf', 'application/x-shockwave-flash'],\n ['tar', 'application/x-tar'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['ts', 'video/mp2t'],\n ['ttf', 'font/ttf'],\n ['txt', 'text/plain'],\n ['vsd', 'application/vnd.visio'],\n ['wav', 'audio/wav'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['xhtml', 'application/xhtml+xml'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['zip', 'application/zip'],\n ['7z', 'application/x-7z-compressed'],\n\n // Others\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['msg', 'application/vnd.ms-outlook']\n]);\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */\nconst toFileWithMimeType = file => {\n const { name } = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const extension = (name.split('.').pop() || '').toLowerCase();\n const type = COMMON_MIME_TYPES.get(extension);\n\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n};\n\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */\nconst toFileWithPath = (file, path) => {\n const fileWithMimeType = toFileWithMimeType(file);\n\n // @ts-ignore\n if (typeof fileWithMimeType.path !== 'string') {\n const { webkitRelativePath } = file;\n\n Object.defineProperty(fileWithMimeType, 'path', {\n value: typeof path === 'string' ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n\n return fileWithMimeType;\n};\n\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readEntriesPromise = async directoryReader => {\n return await new Promise((resolve, reject) => {\n directoryReader.readEntries(resolve, reject);\n });\n};\n\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readAllDirectoryEntries = async directoryReader => {\n const entries = [];\n let readEntries = await readEntriesPromise(directoryReader);\n\n while (readEntries.length > 0) {\n entries.push(...readEntries);\n readEntries = await readEntriesPromise(directoryReader);\n }\n\n return entries;\n};\n\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */\nconst getFileFromFileEntry = fileEntry => {\n return new Promise((resolve, reject) => {\n fileEntry.file(file => resolve(toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromDataTransferItemList = async dataTransferItemList => {\n const files = [];\n\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n\n for (const item of dataTransferItemList) {\n if (item.kind !== 'file') {\n // Ignore non-file items, such as links.\n continue;\n }\n\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n\n queue.push(entry);\n }\n\n while (queue.length > 0) {\n const entry = queue.shift();\n\n if (!entry) {\n continue;\n } else if (entry.isFile) {\n const file = await getFileFromFileEntry(entry);\n\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(file);\n }\n } else if (entry.isDirectory) {\n queue.push(...await readAllDirectoryEntries(entry.createReader()));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromFileList = async fileList => {\n const files = [];\n\n for (const file of fileList) {\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(toFileWithPath(file));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from an event.\n * This function supports both `drop` and `change` events.\n *\n * @param {*} evt - The event to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nexport const getFilesFromEvent = async evt => {\n if (evt.dataTransfer) {\n return evt.dataTransfer.items\n ? await getFilesFromDataTransferItemList(evt.dataTransfer.items)\n : await getFilesFromFileList(evt.dataTransfer.files);\n }\n\n return await getFilesFromFileList(evt.target.files);\n};\n","/**\n * Removes one or more elements from an array at the specified index(es).\n *\n * @param {Array} array The initial array to remove elements from.\n * @param {Number} ...indexes The index(es) of the elements to be removed. Non numbers are ignored.\n * @throws {TypeError} If `array` is not array.\n * @returns {Array} The result array with the elements specified removed.\n * @example\n *\n * const arr = [1, 2, 3, 4, 5];\n *\n * remove(arr, 0);\n * // => [2, 3, 4, 5]\n *\n * remove(arr, 0, 1);\n * // => [3, 4, 5]\n *\n * remove(arr, 0, 4);\n * // => [2, 3, 4]\n *\n * remove(arr);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length - 1);\n * // => [1, 2, 3, 4]\n *\n * remove(arr, NaN);\n * // => [1, 2, 3, 4, 5]\n */\nexport const arrayRemove = (array, ...indexes) => {\n if (!Array.isArray(array)) {\n throw new TypeError('Expected an array for first argument');\n }\n\n return array.filter((_, i) => indexes.indexOf(i) === -1);\n};\n","/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */\nconst uid = (prefix = '', suffix = '') => {\n const prefixString = typeof prefix === 'string' && prefix !== '' ? prefix + '-' : '';\n const suffixString = typeof suffix === 'string' && suffix !== '' ? '-' + suffix : '';\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n\n return `${prefixString}${randomString}${suffixString}`;\n};\n\nexport { uid };\n","export const ACCEPTED_MIME_TYPES = ['image/jpg', 'image/jpeg', 'image/png', 'image/apng', 'image/gif', 'image/webp', 'image/avif'];\n","import AntonRegular from 'url:../assets/fonts/Anton/Anton-Regular.ttf';\nimport OswaldRegular from 'url:../assets/fonts/Oswald/Oswald-Regular.ttf';\nimport OswaldBold from 'url:../assets/fonts/Oswald/Oswald-Bold.ttf';\nimport RobotoRegular from 'url:../assets/fonts/Roboto/Roboto-Regular.ttf';\nimport RobotoBold from 'url:../assets/fonts/Roboto/Roboto-Bold.ttf';\nimport RobotoCondensedRegular from 'url:../assets/fonts/RobotoCondensed/RobotoCondensed-Regular.ttf';\nimport RobotoCondensedBold from 'url:../assets/fonts/RobotoCondensed/RobotoCondensed-Bold.ttf';\nimport CourierPrimeRegular from 'url:../assets/fonts/CourierPrime/CourierPrime-Regular.ttf';\nimport CourierPrimeBold from 'url:../assets/fonts/CourierPrime/CourierPrime-Bold.ttf';\nimport OpenSansRegular from 'url:../assets/fonts/OpenSans/OpenSans-Regular.ttf';\nimport OpenSansBold from 'url:../assets/fonts/OpenSans/OpenSans-Bold.ttf';\n\nexport const customFonts = [\n { name: 'Anton', label: 'Anton', path: AntonRegular, style: 'normal', weight: '400' },\n { name: 'Oswald-Regular', label: 'Oswald', path: OswaldRegular, style: 'normal', weight: '400' },\n { name: 'Oswald-Bold', label: 'Oswald Bold', path: OswaldBold, style: 'normal', weight: '700' },\n { name: 'Roboto-Regular', label: 'Roboto', path: RobotoRegular, style: 'normal', weight: '400' },\n { name: 'Roboto-Bold', label: 'Roboto Bold', path: RobotoBold, style: 'normal', weight: '700' },\n { name: 'RobotoCondensed-Regular', label: 'Roboto Condensed', path: RobotoCondensedRegular, style: 'normal', weight: '400' },\n { name: 'RobotoCondensed-Bold', label: 'Roboto Condensed Bold', path: RobotoCondensedBold, style: 'normal', weight: '700' },\n { name: 'CourierPrime-Regular', label: 'Courier Prime', path: CourierPrimeRegular, style: 'normal', weight: '400' },\n { name: 'CourierPrime-Bold', label: 'Courier Prime Bold', path: CourierPrimeBold, style: 'normal', weight: '700' },\n { name: 'OpenSans-Regular', label: 'Open Sans', path: OpenSansRegular, style: 'normal', weight: '400' },\n { name: 'OpenSans-Bold', label: 'Open Sans Bold', path: OpenSansBold, style: 'normal', weight: '400' }\n];\n\nexport const loadCustomFont = async (name, path, options = {}) => {\n try {\n const font = new FontFace(name, `url(${path})`, { ...options });\n await font.load();\n document.fonts.add(font);\n } catch (err) {\n console.error(err);\n }\n};\n","module.exports = new __parcel__URL__(\"Anton-Regular.e58ab3fe.ttf\").toString();","module.exports = new __parcel__URL__(\"Oswald-Regular.89ec7d89.ttf\").toString();","module.exports = new __parcel__URL__(\"Oswald-Bold.0f6a7ca6.ttf\").toString();","module.exports = new __parcel__URL__(\"Roboto-Regular.ca197847.ttf\").toString();","module.exports = new __parcel__URL__(\"Roboto-Bold.fdb9b54a.ttf\").toString();","module.exports = new __parcel__URL__(\"RobotoCondensed-Regular.d585f5c7.ttf\").toString();","module.exports = new __parcel__URL__(\"RobotoCondensed-Bold.e1f96d4b.ttf\").toString();","module.exports = new __parcel__URL__(\"CourierPrime-Regular.3a25a501.ttf\").toString();","module.exports = new __parcel__URL__(\"CourierPrime-Bold.3d6bf689.ttf\").toString();","module.exports = new __parcel__URL__(\"OpenSans-Regular.edf9e01b.ttf\").toString();","module.exports = new __parcel__URL__(\"OpenSans-Bold.8fceb72b.ttf\").toString();","import { ACCEPTED_MIME_TYPES } from './constants.js';\n\nexport const fileFromUrl = async (options = {}) => {\n const res = await fetch(options.url);\n const blob = await res.blob();\n const mimeType = options.mimeType || blob.type || '';\n\n if (!ACCEPTED_MIME_TYPES.includes(mimeType)) {\n throw new Error(`This is not an accepted image format. Accepted MIME types are: ${ACCEPTED_MIME_TYPES.join(', ')}`);\n }\n\n return new File([blob], options.filename || '', blob);\n};\n","const errorsContainer = document.getElementById('errorsContainer');\n\nconst hideError = evt => {\n const target = evt.currentTarget;\n target.removeEventListener('click', hideError);\n errorsContainer.removeChild(target.parentNode);\n};\n\nexport const toastAlert = (message = '', type = 'info') => {\n const types = ['info', 'warning', 'danger'];\n\n if (!types.includes(type)) {\n type = 'info';\n }\n\n const template = /* html */`\n ${message}\n \n `;\n\n const div = document.createElement('div');\n div.className = `alert alert-${type} alert-dismissible text-break mb-2 fade`;\n div.innerHTML = template;\n div.querySelector('button').addEventListener('click', hideError);\n errorsContainer.appendChild(div);\n setTimeout(() => div.classList.add('show'), 100);\n};\n","import { customFonts } from './custom-fonts.js';\n\nexport const createTextBox = (index, data = {}) => {\n const inputTemplate = /* html */`\n
\n \n\n \n\n
\n \n \n \n
\n
\n\n
\n
\n
\n \n\n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n \n \n \n \n
\n
\n
\n\n
\n
\n
\n \n \n
\n
\n
\n
\n `;\n\n const fragment = document.createDocumentFragment();\n const div = document.createElement('div');\n\n div.className = 'bg-light border shadow-sm mb-3 rounded';\n div.setAttribute('data-section', 'textBox');\n div.setAttribute('data-index', index);\n div.innerHTML = inputTemplate;\n div.querySelector('[data-input=\"font\"]').value = data.font;\n div.querySelector('[data-input=\"textAlign\"]').value = data.textAlign;\n div.querySelector('[data-input=\"allCaps\"]').checked = data.allCaps;\n\n return fragment.appendChild(div);\n};\n","export const drawCanvas = (image, canvas, ctx, textOptions = []) => {\n if (image == null) {\n return;\n }\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n if (typeof image === 'string') { // Assume it's a color\n ctx.fillStyle = image;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n } else {\n ctx.drawImage(image, 0, 0, canvas.width, canvas.height);\n }\n\n textOptions.forEach(function (item, index) {\n ctx.font = `${item.fontWeight} ${item.fontSize}px ${item.font}`;\n\n const multiplier = index + 1;\n const lineHeight = ctx.measureText('M').width + item.fontSize / 2;\n const xPos = canvas.width / 2;\n const shadowBlur = item.shadowBlur;\n const text = item.allCaps === true ? item.text.toUpperCase() : item.text;\n const textLines = text.split('\\n');\n\n ctx.fillStyle = item.fillColor;\n ctx.textAlign = item.textAlign;\n ctx.save();\n\n if (shadowBlur !== 0) {\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n ctx.shadowBlur = shadowBlur;\n ctx.shadowColor = item.shadowColor;\n }\n\n if (item.rotate) {\n ctx.translate(xPos + item.offsetX, lineHeight * multiplier + item.offsetY);\n ctx.rotate(item.rotate * Math.PI / 180);\n textLines.forEach((text, index) => ctx.fillText(text, 0, index * lineHeight));\n ctx.rotate(-(item.rotate * Math.PI / 180));\n ctx.translate(-(xPos + item.offsetX), -(lineHeight * multiplier + item.offsetY));\n } else {\n textLines.forEach((text, index) => {\n ctx.fillText(text, xPos + item.offsetX, index * lineHeight + lineHeight * multiplier + item.offsetY);\n });\n }\n\n ctx.restore();\n });\n};"],"names":["$parcel$interopDefault","a","__esModule","default","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","$7a2aca835bb05064$export$c37129e465f64ef0","navigator","canShare","id","exports","init","module","call","err","Error","code","register","parcelRegister","Object","defineProperty","get","$ef7689007096c8a0$export$6503ec6e8aabbaf","set","v","enumerable","configurable","$ef7689007096c8a0$var$mapping","Map","baseUrl","manifest","i","length","path","URL","url","toString","JSON","parse","$cd62c5572235e737$export$30b344bef3e55b67","$cd62c5572235e737$var$t","$cd62c5572235e737$var$e","document","createElement","innerHTML","HTMLElement","t","e","s","constructor","shadowRoot","attachShadow","mode","delegatesFocus","appendChild","content","cloneNode","querySelector","observedAttributes","attributeChangedCallback","toggleAttribute","disabled","setAttribute","part","contains","toggle","connectedCallback","r","addEventListener","n","disconnectedCallback","removeEventListener","hasAttribute","shareUrl","getAttribute","shareTitle","shareText","shareFiles","Array","isArray","share","title","text","files","dispatchEvent","CustomEvent","bubbles","composed","detail","shareData","name","error","preventDefault","target","nodeName","assignedElements","flatten","find","prototype","hasOwnProperty","defineCustomElement","customElements","define","$dced0d224c6d876e$export$cc30a98fe3890794","$dced0d224c6d876e$var$t","Number","isNaN","Math","min","max","$dced0d224c6d876e$var$e","$dced0d224c6d876e$var$i","$dced0d224c6d876e$var$o","o","l","getSupportedConstraints","isConnected","getTrackCapabilities","getTrackSettings","u","includes","facingMode","stopVideoStream","startVideoStream","cameraResolution","trim","split","map","width","height","pan","h","tilt","zoom","d","getElementById","c","m","p","g","b","f","isSupported","message","autoPlay","noImage","loading","calculateFileSize","capture","play","then","video","catch","finally","removeAttribute","from","childNodes","forEach","remove","getVideoTracks","applyConstraints","advanced","ideal","audio","mediaDevices","getUserMedia","srcObject","hidden","stop","getContext","videoWidth","videoHeight","drawImage","toDataURL","Image","src","dataURI","fetch","blob","size","getCapabilities","getSettings","$d9c5053bade2d3f8$export$32589115725b904b","$d9c5053bade2d3f8$var$e","open","showModal","body","style","overflowY","element","close","noHeader","classList","noAnimations","noCloseButton","clearTimeout","staticBackdrop","fullscreen","add","setTimeout","defaultPrevented","currentTarget","assignedNodes","cancelable","reason","show","hide","$9351176e8d763a78$export$6ccd1735166caad9","$9351176e8d763a78$var$e","$9351176e8d763a78$var$t","$9351176e8d763a78$var$o","lastIndexOf","type","pop","toLowerCase","value","writable","$9351176e8d763a78$var$i","webkitRelativePath","$9351176e8d763a78$var$r","Promise","readEntries","$9351176e8d763a78$var$a","push","$9351176e8d763a78$var$n","file","fullPath","$9351176e8d763a78$var$s","kind","getAsEntry","webkitGetAsEntry","shift","isFile","indexOf","isDirectory","createReader","$9351176e8d763a78$var$d","$9351176e8d763a78$var$l","dataTransfer","items","$9351176e8d763a78$var$p","$9351176e8d763a78$var$c","$9351176e8d763a78$var$h","$9351176e8d763a78$var$u","accept","multiple","noKeyboard","autoFocus","focus","maxFiles","floor","abs","maxSize","minSize","noClick","noDrag","noStyle","Event","dropEffect","click","key","errors","Set","filter","Boolean","replace","charAt","test","acceptedFiles","rejectedFiles","defaultValue","openFileDialog","$4af3d380d1884504$export$30a014203d0d7e4f","array","indexes","TypeError","_","$17004b28c97c1306$export$e2a22331486dcca0","prefix","suffix","randomString","random","substring","$65136e012e05e2d7$export$63e7bed68b07a85c","$068eb37972da8c20$exports","$2db6b38fbc5d48da$exports","$a0b1873abc1b077b$exports","$df7c7f72fd04e02a$exports","$e4c2039736f96f5d$exports","$fbff28e47a938944$exports","$d8f4a375a42d32f4$exports","$7cfbda315cbb4209$exports","$6379185b16d8409f$exports","$454f2b111c8d0078$exports","$c05fcaeb63dbd733$exports","$56b863c8b6be7003$export$6874249d87f2602a","label","weight","$56b863c8b6be7003$export$59eceaef0c7797b2","options","font","FontFace","load","fonts","console","$0374350c629f125f$export$6539e087749cf9d3","res","mimeType","join","File","filename","$3969451ff60cb8d5$var$errorsContainer","$3969451ff60cb8d5$var$hideError","evt","removeChild","parentNode","$3969451ff60cb8d5$export$af04143326425dbd","types","template","div","className","$224fa2388dce65c4$export$293a4b86a6fe2398","index","data","inputTemplate","fillColor","shadowColor","_isSettingsOpen","fontSize","shadowBlur","rotate","offsetY","offsetX","fragment","createDocumentFragment","textAlign","checked","allCaps","$64ef5d4149d7e6a5$export$e653a2de0f3a8b89","image","canvas","ctx","textOptions","clearRect","fillStyle","fillRect","item","fontWeight","multiplier","lineHeight","measureText","xPos","textLines","toUpperCase","save","shadowOffsetX","shadowOffsetY","translate","PI","fillText","restore","$85a5f86b715fe7db$var$videoModal","$85a5f86b715fe7db$var$downloadModal","$85a5f86b715fe7db$var$canvas","$85a5f86b715fe7db$var$dropzoneEl","$85a5f86b715fe7db$var$instructionsEl","$85a5f86b715fe7db$var$ctx","$85a5f86b715fe7db$var$imageUploadMethodSelect","$85a5f86b715fe7db$var$fileSelectBtn","$85a5f86b715fe7db$var$imageUrlForm","$85a5f86b715fe7db$var$addTextboxBtn","$85a5f86b715fe7db$var$inputsContainer","$85a5f86b715fe7db$var$generateMemeBtn","$85a5f86b715fe7db$var$openVideoModalBtn","$85a5f86b715fe7db$var$downloadMemeBtn","$85a5f86b715fe7db$var$downloadMemePreview","$85a5f86b715fe7db$var$webShareComponent","$85a5f86b715fe7db$var$galleryEl","$85a5f86b715fe7db$var$gallerySearchEl","$85a5f86b715fe7db$var$galleryNoResultsEl","$85a5f86b715fe7db$var$solidColorForm","$85a5f86b715fe7db$var$uploadMethodEls","querySelectorAll","$85a5f86b715fe7db$var$selectedImage","$85a5f86b715fe7db$var$reqAnimFrame","$85a5f86b715fe7db$var$defaultTextOptions","$85a5f86b715fe7db$var$textOptions","$85a5f86b715fe7db$var$generateMeme","dataUrl","downloadLink","download","href","$85a5f86b715fe7db$var$onImageLoaded","MAX_WIDTH","MAX_HEIGHT","$85a5f86b715fe7db$var$handleFileSelect","reader","FileReader","result","readAsDataURL","$85a5f86b715fe7db$var$handleTextPropChange","prop","$85a5f86b715fe7db$var$handleImageUploadFromURL","form","submitButton","imageUrl","$85a5f86b715fe7db$var$moveText","offsetDir","sign","textBoxSection","offsetYInput","offsetXInput","requestAnimationFrame","$85a5f86b715fe7db$var$handleGalleryClick","button","closest","img","alt","newTextBox","matches","textBoxIndex","textBoxEls","el","settingsEl","confirm","isOffsetYButton","isOffsetXButton","cancelAnimationFrame","query","galleryItems","capturePhotoComponent","$442be162a818aed4$export$c37129e465f64ef0","isWebShareSupported","$e179325634270afd$export$30b344bef3e55b67","$e179325634270afd$var$styles","$e179325634270afd$var$template","buttonSlot","buttonEl","getButton","oldValue","newValue","upgradeProperty","handleSlotChange","handleClick","instance","elementName","WebShare","$c290816263f90981$export$cc30a98fe3890794","$02ad8beec419df62$export$7d15b64cf5a3a4c4","lower","upper","$c290816263f90981$var$COMPONENT_NAME","$c290816263f90981$var$styles","$c290816263f90981$var$template","supportedConstraints","stream","canvasElement","outputElement","videoElement","captureButtonSlot","captureButton","facingModeButtonSlot","facingModeButton","trackCapabilities","trackSettings","emptyOutputElement","isValidFacingMode","x","widthInAllowedRange","heightInAllowedRange","panInAllowedRange","applyPTZ","tiltInAllowedRange","zoomInAllowedRange","getCaptureButton","getFacingModeButton","onVideoLoadedMetaData","onCaptureButtonSlotChange","onCapturePhotoButtonClick","onFacingModeButtonSlotChange","onFacingModeButtonClick","node","constraintName","constraintValue","track","constraints","eventDetail","CapturePhoto","$180b6dcf923bafc7$export$32589115725b904b","$180b6dcf923bafc7$var$template","dialogEl","footerSlotEl","pulseAnimationTimeout","headerEl","closeBtnEl","handleDialogClick","handleDialogClose","handleDialogCancel","handleCloseButtonClick","handleFooterSlotChange","applyPulseEffectOnDialog","requestCloseEvent","createRequestCloseEvent","footerEl","footerSlotNodes","hasFooterSlotNodes","ModalElement","$862aa3736b0514bc$export$6ccd1735166caad9","$f31161edf38949e9$var$COMMON_MIME_TYPES","$f31161edf38949e9$var$FILES_TO_IGNORE","$f31161edf38949e9$var$toFileWithMimeType","hasExtension","extension","$f31161edf38949e9$var$toFileWithPath","fileWithMimeType","$f31161edf38949e9$var$readEntriesPromise","directoryReader","resolve","reject","$f31161edf38949e9$var$readAllDirectoryEntries","entries","$f31161edf38949e9$var$getFileFromFileEntry","fileEntry","$f31161edf38949e9$var$getFilesFromDataTransferItemList","dataTransferItemList","queue","entry","$f31161edf38949e9$var$getFilesFromFileList","fileList","$f31161edf38949e9$export$6d52664cd15c442","$862aa3736b0514bc$var$COMPONENT_NAME","$862aa3736b0514bc$var$TOO_MANY_FILES","$862aa3736b0514bc$var$template","$862aa3736b0514bc$var$styles","fileInput","dropzoneEl","handleFileInputChange","handleDragEnter","handleDragOver","handleDragLeave","handleDrop","handleKeyUp","num","Infinity","handleFilesSelect","filesLength","fileHasValidType","acceptedTypeSpecifiers","acceptedMimeTypesList","fileMimeType","baseMimeType","validType","fileExceedsMaxSize","fileIsSmallerThanMinSize","FilesDropzone"],"version":3,"file":"index.0ec871bb.js.map"} \ No newline at end of file diff --git a/docs/index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mB,CAClC,IAAM,EAAwB,GAAW,aAAa,CAAC,iBAEnD,GAAyB,AAAiD,YAAjD,OAAO,EAAsB,eAAe,EACvE,EAAsB,eAAe,EAEzC,CACF,GAyBA,GAAU,gBAAgB,CAAC,iBAAiB,QAAQ,AAAA,IAClD,EAAM,YAAY,CAAC,QAAS,EAAM,YAAY,CAAC,OACjD,GAEA,GAAY,OAAO,CAAC,CAAC,EAAM,KACzB,GAAgB,WAAW,CAAC,AAAA,EAAc,EAAO,GACnD,GAEA,GAAW,MAAM,CAAG,EAEpB,AAAA,EAAY,OAAO,CAAC,CAAC,CAAA,KAAE,CAAI,CAAA,KAAE,CAAI,CAAA,MAAE,CAAK,CAAA,OAAE,CAAM,CAAE,IAChD,AAAA,EAAe,EAAM,EAAM,CAAE,MAAA,EAAO,OAAA,CAAO,EAC7C,E","sources":["","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/helpers/bundle-url.js","node_modules/@parcel/runtime-js/lib/runtime-0f4aac860c093f90.js","src/js/index.js","node_modules/@georapbox/web-share-element/dist/is-web-share-supported.js","node_modules/@georapbox/web-share-element/dist/","node_modules/@georapbox/web-share-element/dist/src/is-web-share-supported.js","node_modules/@georapbox/web-share-element/dist/web-share-defined.js","node_modules/@georapbox/web-share-element/dist/src/web-share-defined.js","node_modules/@georapbox/web-share-element/dist/src/web-share.js","node_modules/@georapbox/capture-photo-element/dist/capture-photo-defined.js","node_modules/@georapbox/capture-photo-element/dist/","node_modules/@georapbox/capture-photo-element/dist/src/capture-photo-defined.js","node_modules/@georapbox/capture-photo-element/dist/src/capture-photo.js","node_modules/@georapbox/capture-photo-element/dist/src/utils/clamp.js","node_modules/@georapbox/modal-element/dist/modal-element-defined.js","node_modules/@georapbox/modal-element/dist/","node_modules/@georapbox/modal-element/dist/src/modal-element-defined.js","node_modules/@georapbox/modal-element/dist/src/modal-element.js","node_modules/@georapbox/files-dropzone-element/dist/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/dist/","node_modules/@georapbox/files-dropzone-element/dist/src/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/dist/src/files-dropzone.js","node_modules/@georapbox/files-dropzone-element/dist/src/utils/is-valid-file.js","node_modules/@georapbox/files-dropzone-element/dist/src/utils/files-selector.js","src/js/utils/array-remove.js","src/js/utils/uid.js","src/js/constants.js","src/js/custom-fonts.js","node_modules/@parcel/runtime-js/lib/runtime-a1c2e9b10dbbde58.js","node_modules/@parcel/runtime-js/lib/runtime-d90b112f208fab9c.js","node_modules/@parcel/runtime-js/lib/runtime-8863d03da459b1d2.js","node_modules/@parcel/runtime-js/lib/runtime-7530982a5c34e2a8.js","node_modules/@parcel/runtime-js/lib/runtime-f6db6103a1a0ae20.js","node_modules/@parcel/runtime-js/lib/runtime-d668b18f4657778e.js","node_modules/@parcel/runtime-js/lib/runtime-9d4df09940169c58.js","node_modules/@parcel/runtime-js/lib/runtime-df220659d471ec24.js","node_modules/@parcel/runtime-js/lib/runtime-935f2ad29b2ba54a.js","node_modules/@parcel/runtime-js/lib/runtime-23720a89f55d1035.js","node_modules/@parcel/runtime-js/lib/runtime-180dcf6211e1516d.js","src/js/file-from-url.js","src/js/toast-alert.js","src/js/create-text-box.js","src/js/draw-canvas.js"],"sourcesContent":["(function () {\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire5078\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire5078\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"iE7OH\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $0380ce8f1f064ccc$export$6503ec6e8aabbaf; }, function (v) { return $0380ce8f1f064ccc$export$6503ec6e8aabbaf = v; });\nvar $0380ce8f1f064ccc$export$6503ec6e8aabbaf;\nvar $0380ce8f1f064ccc$export$f7ad0328861e2f03;\n\"use strict\";\nvar $0380ce8f1f064ccc$var$mapping = new Map();\nfunction $0380ce8f1f064ccc$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$0380ce8f1f064ccc$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $0380ce8f1f064ccc$var$resolve(id) {\n var resolved = $0380ce8f1f064ccc$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$0380ce8f1f064ccc$export$6503ec6e8aabbaf = $0380ce8f1f064ccc$var$register;\n$0380ce8f1f064ccc$export$f7ad0328861e2f03 = $0380ce8f1f064ccc$var$resolve;\n\n});\n\nparcelRegister(\"aNJCr\", function(module, exports) {\n\n$parcel$export(module.exports, \"getBundleURL\", function () { return $7dd1ddf6834435ca$export$bdfd709ae4826697; }, function (v) { return $7dd1ddf6834435ca$export$bdfd709ae4826697 = v; });\nvar $7dd1ddf6834435ca$export$bdfd709ae4826697;\nvar $7dd1ddf6834435ca$export$c9e73fbda7da57b6;\nvar $7dd1ddf6834435ca$export$5a759dc7a1cfb72a;\n\"use strict\";\nvar $7dd1ddf6834435ca$var$bundleURL = {};\nfunction $7dd1ddf6834435ca$var$getBundleURLCached(id) {\n var value = $7dd1ddf6834435ca$var$bundleURL[id];\n if (!value) {\n value = $7dd1ddf6834435ca$var$getBundleURL();\n $7dd1ddf6834435ca$var$bundleURL[id] = value;\n }\n return value;\n}\nfunction $7dd1ddf6834435ca$var$getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = (\"\" + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return $7dd1ddf6834435ca$var$getBaseURL(matches[2]);\n }\n return \"/\";\n}\nfunction $7dd1ddf6834435ca$var$getBaseURL(url) {\n return (\"\" + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, \"$1\") + \"/\";\n}\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction $7dd1ddf6834435ca$var$getOrigin(url) {\n var matches = (\"\" + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) throw new Error(\"Origin not found\");\n return matches[0];\n}\n$7dd1ddf6834435ca$export$bdfd709ae4826697 = $7dd1ddf6834435ca$var$getBundleURLCached;\n$7dd1ddf6834435ca$export$c9e73fbda7da57b6 = $7dd1ddf6834435ca$var$getBaseURL;\n$7dd1ddf6834435ca$export$5a759dc7a1cfb72a = $7dd1ddf6834435ca$var$getOrigin;\n\n});\n\nvar $137b868283288b39$exports = {};\n\n\n(parcelRequire(\"iE7OH\")).register((parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\"), JSON.parse('[\"8tAhj\",\"index.2a3e2367.js\",\"cmj6F\",\"Anton-Regular.e58ab3fe.ttf\",\"a9OJN\",\"Oswald-Regular.89ec7d89.ttf\",\"jOuj0\",\"Oswald-Bold.0f6a7ca6.ttf\",\"ePq3V\",\"Roboto-Regular.ca197847.ttf\",\"9WQUU\",\"Roboto-Bold.fdb9b54a.ttf\",\"hIywO\",\"RobotoCondensed-Regular.d585f5c7.ttf\",\"ab1rw\",\"RobotoCondensed-Bold.e1f96d4b.ttf\",\"j4ruO\",\"CourierPrime-Regular.3a25a501.ttf\",\"3nnD2\",\"CourierPrime-Bold.3d6bf689.ttf\",\"8fsWK\",\"OpenSans-Regular.edf9e01b.ttf\",\"5JXG6\",\"OpenSans-Bold.8fceb72b.ttf\",\"9FH7D\",\"index.2d751096.css\"]'));\n\nfunction $94933cc6427541bd$export$c37129e465f64ef0(a) {\n return null !== a && \"object\" == typeof a ? \"share\" in navigator && \"canShare\" in navigator && navigator.canShare(a) : \"share\" in navigator;\n}\n\n\nObject.defineProperty({}, \"WebShare\", {\n get: function() {\n return $4f74a8126e204146$export$30b344bef3e55b67;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $4f74a8126e204146$var$t = `\n :host {\n display: inline-block;\n }\n`, $4f74a8126e204146$var$e = document.createElement(\"template\");\n$4f74a8126e204146$var$e.innerHTML = `\n \n \n`;\nclass $4f74a8126e204146$export$30b344bef3e55b67 extends HTMLElement {\n #t;\n #e;\n #s = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($4f74a8126e204146$var$e.content.cloneNode(!0)), this.#t = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null, this.#e = this.#i();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n \"disabled\" === t && e !== s && this.#e && (this.#e.toggleAttribute(\"disabled\", this.disabled), this.#e.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#e.part && this.#e.part.contains(\"button\") && this.#e.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#r(\"shareUrl\"), this.#r(\"shareTitle\"), this.#r(\"shareText\"), this.#r(\"shareFiles\"), this.#r(\"disabled\"), this.#t?.addEventListener(\"slotchange\", this.#a), this.#e?.addEventListener(\"click\", this.#n);\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"slotchange\", this.#a), this.#e?.removeEventListener(\"click\", this.#n);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(t) {\n this.setAttribute(\"share-url\", t);\n }\n get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(t) {\n this.setAttribute(\"share-title\", t);\n }\n get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(t) {\n this.setAttribute(\"share-text\", t);\n }\n get shareFiles() {\n return this.#s;\n }\n set shareFiles(t) {\n Array.isArray(t) && t.length > 0 && (this.#s = t);\n }\n async share() {\n if (!this.disabled) try {\n let t = {};\n this.shareUrl && (t.url = this.shareUrl), this.shareTitle && (t.title = this.shareTitle), this.shareText && (t.text = this.shareText), Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n }) && (t.files = this.shareFiles), await navigator.share(t), this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: !0,\n composed: !0,\n detail: {\n shareData: t\n }\n }));\n } catch (t) {\n if (t instanceof Error && \"AbortError\" === t.name) {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #n = (t)=>{\n t.preventDefault(), this.disabled || this.share();\n };\n #a = (t)=>{\n t.target && \"button\" === t.target.name && (this.#e?.removeEventListener(\"click\", this.#n), this.#e = this.#i(), this.#e && (this.#e.addEventListener(\"click\", this.#n), \"BUTTON\" === this.#e.nodeName || this.#e.hasAttribute(\"role\") || this.#e.setAttribute(\"role\", \"button\")));\n };\n #i() {\n return this.#t && this.#t.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"button\" === t.getAttribute(\"slot\")) || null;\n }\n #r(t) {\n if (Object.prototype.hasOwnProperty.call(this, t)) {\n let e = this[t];\n delete this[t], this[t] = e;\n }\n }\n static defineCustomElement(t = \"web-share\") {\n \"undefined\" == typeof window || window.customElements.get(t) || window.customElements.define(t, $4f74a8126e204146$export$30b344bef3e55b67);\n }\n}\n$4f74a8126e204146$export$30b344bef3e55b67.defineCustomElement();\n\n\nObject.defineProperty({}, \"CapturePhoto\", {\n get: function() {\n return $636b0cf1ed0b9f88$export$cc30a98fe3890794;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $636b0cf1ed0b9f88$var$t = (t, e, i)=>(Number.isNaN(e) && (e = 0), Number.isNaN(i) && (i = 0), Math.min(Math.max(t, Math.min(e, i)), Math.max(e, i))), $636b0cf1ed0b9f88$var$e = \"capture-photo\", $636b0cf1ed0b9f88$var$i = `\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`, $636b0cf1ed0b9f88$var$o = document.createElement(\"template\");\n$636b0cf1ed0b9f88$var$o.innerHTML = `\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\nclass $636b0cf1ed0b9f88$export$cc30a98fe3890794 extends HTMLElement {\n #t = {};\n #e = null;\n #i = null;\n #o = null;\n #n = null;\n #a = null;\n #s = null;\n #r = null;\n #l = null;\n constructor(){\n super(), this.#t = this.getSupportedConstraints(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($636b0cf1ed0b9f88$var$o.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"facing-mode\",\n \"camera-resolution\",\n \"pan\",\n \"tilt\",\n \"zoom\"\n ];\n }\n attributeChangedCallback(t, e, i) {\n if (!this.isConnected) return;\n let o = this.getTrackCapabilities(), n = this.getTrackSettings();\n if (\"no-image\" === t && e !== i && this.#u(), \"facing-mode\" === t && e !== i && \"facingMode\" in this.#t) {\n let t = [\n \"user\",\n \"environment\"\n ].includes(this.facingMode || \"\");\n \"facingMode\" in n && t && (this.stopVideoStream(), this.startVideoStream());\n }\n if (\"camera-resolution\" === t && e !== i && \"string\" == typeof this.cameraResolution && this.cameraResolution.trim().length > 0) {\n let [t = 0, e = 0] = this.cameraResolution.split(\"x\").map((t)=>Number(t));\n if (t > 0 && e > 0 && \"width\" in o && \"height\" in o) {\n let i = !!(o.width?.min && o.width?.max) && t >= o?.width?.min && t <= o?.width?.max, a = !!(o.height?.min && o.height?.max) && e >= o?.height?.min && e <= o?.height?.max;\n \"width\" in n && \"height\" in n && i && a && (this.stopVideoStream(), this.startVideoStream());\n }\n }\n if (\"pan\" === t && e !== i && \"pan\" in this.#t) {\n let t = !!(\"pan\" in o && o.pan?.min && o.pan?.max) && this.pan >= o.pan.min && this.pan <= o.pan.max;\n \"pan\" in n && \"number\" == typeof this.pan && t && this.#h(\"pan\", this.pan);\n }\n if (\"tilt\" === t && e !== i && \"tilt\" in this.#t) {\n let t = !!(\"tilt\" in o && o.tilt?.min && o.tilt?.max) && this.tilt >= o.tilt.min && this.tilt <= o.tilt.max;\n \"tilt\" in n && \"number\" == typeof this.tilt && t && this.#h(\"tilt\", this.tilt);\n }\n if (\"zoom\" === t && e !== i && \"zoom\" in this.#t) {\n let t = !!(\"zoom\" in o && o.zoom?.min && o.zoom?.max) && this.zoom >= o.zoom.min && this.zoom <= o.zoom.max;\n \"zoom\" in n && \"number\" == typeof this.zoom && t && this.#h(\"zoom\", this.zoom);\n }\n }\n connectedCallback() {\n if (this.#d(\"autpoPlay\"), this.#d(\"noImage\"), this.#d(\"facingMode\"), this.#d(\"cameraResolution\"), this.#d(\"pan\"), this.#d(\"tilt\"), this.#d(\"zoom\"), this.#d(\"calculateFileSize\"), this.#i = this.shadowRoot?.querySelector(\"canvas\") || null, this.#o = this.shadowRoot?.getElementById(\"output\") || null, this.#n = this.shadowRoot?.querySelector(\"video\") || null, this.#a = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null, this.#s = this.#c(), this.#r = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null, this.#l = this.#m(), this.#n?.addEventListener(\"loadedmetadata\", this.#p), this.#a?.addEventListener(\"slotchange\", this.#g), this.#s?.addEventListener(\"click\", this.#b), this.#r?.addEventListener(\"slotchange\", this.#f), this.#l?.addEventListener(\"click\", this.#v), !$636b0cf1ed0b9f88$export$cc30a98fe3890794.isSupported()) return this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n this.autoPlay && this.startVideoStream();\n }\n disconnectedCallback() {\n this.stopVideoStream(), this.#l?.removeEventListener(\"click\", this.#v), this.#s?.removeEventListener(\"click\", this.#b), this.#n?.removeEventListener(\"canplay\", this.#p), this.#a?.removeEventListener(\"slotchange\", this.#g), this.#r?.removeEventListener(\"slotchange\", this.#f);\n }\n get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(t) {\n this.toggleAttribute(\"auto-play\", !!t);\n }\n get noImage() {\n return this.hasAttribute(\"no-image\");\n }\n set noImage(t) {\n this.toggleAttribute(\"no-image\", !!t);\n }\n get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(t) {\n this.setAttribute(\"facing-mode\", t);\n }\n get cameraResolution() {\n return this.getAttribute(\"camera-resolution\") || \"\";\n }\n set cameraResolution(t) {\n this.setAttribute(\"camera-resolution\", t);\n }\n get pan() {\n return Number(this.getAttribute(\"pan\")) || 0;\n }\n set pan(t) {\n this.setAttribute(\"pan\", null != t ? t.toString() : t);\n }\n get tilt() {\n return Number(this.getAttribute(\"tilt\")) || 0;\n }\n set tilt(t) {\n this.setAttribute(\"tilt\", null != t ? t.toString() : t);\n }\n get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(t) {\n this.setAttribute(\"zoom\", null != t ? t.toString() : t);\n }\n get loading() {\n return this.hasAttribute(\"loading\");\n }\n get calculateFileSize() {\n return this.hasAttribute(\"calculate-file-size\");\n }\n set calculateFileSize(t) {\n this.toggleAttribute(\"calculate-file-size\", !!t);\n }\n #v = (t)=>{\n t.preventDefault(), this.loading || (this.facingMode = \"user\" !== this.facingMode && this.facingMode ? \"user\" : \"environment\");\n };\n #b = (t)=>{\n t.preventDefault(), this.capture();\n };\n #p = (t)=>{\n let i = t.target;\n i.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:video-play`, {\n bubbles: !0,\n composed: !0,\n detail: {\n video: i\n }\n }));\n }).catch((t)=>{\n this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n #u() {\n this.#o && Array.from(this.#o.childNodes).forEach((t)=>t.remove());\n }\n #h(e, i) {\n if (!this.#e || !e || !i) return;\n let [o] = this.#e.getVideoTracks(), n = this.getTrackCapabilities();\n e in this.getTrackSettings() && o.applyConstraints({\n advanced: [\n {\n [e]: $636b0cf1ed0b9f88$var$t(Number(i), n[e]?.min || 1, n[e]?.max || 1)\n }\n ]\n });\n }\n #g = (t)=>{\n t.target?.name === \"capture-button\" && (this.#s?.removeEventListener(\"click\", this.#b), this.#s = this.#c(), this.#s && (this.#s.addEventListener(\"click\", this.#b), \"BUTTON\" === this.#s.nodeName || this.#s.hasAttribute(\"role\") || this.#s.setAttribute(\"role\", \"button\")));\n };\n #f = (t)=>{\n t.target?.name === \"facing-mode-button\" && (this.#l?.removeEventListener(\"click\", this.#v), this.#l = this.#m(), this.#l && (this.#l.addEventListener(\"click\", this.#v), \"BUTTON\" === this.#l.nodeName || this.#l.hasAttribute(\"role\") || this.#l.setAttribute(\"role\", \"button\")));\n };\n #m() {\n return this.#r && this.#r.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"facing-mode-button\" === t.getAttribute(\"slot\")) || null;\n }\n #c() {\n return this.#a && this.#a.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"capture-button\" === t.getAttribute(\"slot\")) || null;\n }\n #d(t) {\n if (Object.prototype.hasOwnProperty.call(this, t)) {\n let e = this[t];\n delete this[t], this[t] = e;\n }\n }\n async startVideoStream() {\n if (!$636b0cf1ed0b9f88$export$cc30a98fe3890794.isSupported() || this.#e) return;\n this.setAttribute(\"loading\", \"\");\n let t = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: !0,\n tilt: !0,\n zoom: !0\n },\n audio: !1\n };\n if (\"string\" == typeof this.cameraResolution && this.cameraResolution.trim().length > 0) {\n let [e = 0, i = 0] = this.cameraResolution.split(\"x\").map((t)=>Number(t));\n e > 0 && i > 0 && (t.video.width = e, t.video.height = i);\n }\n try {\n this.#e = await navigator.mediaDevices.getUserMedia(t), this.#n && (this.#n.srcObject = this.#e), this.#h(\"pan\", this.pan), this.#h(\"tilt\", this.tilt), this.#h(\"zoom\", this.zoom);\n let e = this.getTrackSettings();\n \"facingMode\" in e && this.#r && (this.#r.hidden = !1);\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n stopVideoStream() {\n if (!this.#n || !this.#e) return;\n let [t] = this.#e.getVideoTracks();\n t?.stop(), this.#n.srcObject = null, this.#e = null;\n }\n async capture() {\n if (!this.loading && this.#i && this.#n) try {\n let t = this.#i.getContext(\"2d\"), i = this.#n.videoWidth, o = this.#n.videoHeight;\n this.#i.width = i, this.#i.height = o, t?.drawImage(this.#n, 0, 0, i, o);\n let n = this.#i.toDataURL(\"image/png\");\n if (\"string\" == typeof n && n.includes(\"data:image\")) {\n if (!this.noImage) {\n let t = new Image;\n t.src = n, t.width = i, t.height = o, t.setAttribute(\"part\", \"output-image\"), this.#u(), this.#o?.appendChild(t);\n }\n let t = {\n dataURI: n,\n width: i,\n height: o\n };\n if (this.calculateFileSize) try {\n let e = await fetch(n), i = (await e.blob()).size;\n i && (t.size = i);\n } catch (t) {}\n this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:success`, {\n bubbles: !0,\n composed: !0,\n detail: t\n }));\n }\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n getSupportedConstraints() {\n return $636b0cf1ed0b9f88$export$cc30a98fe3890794.isSupported() && navigator.mediaDevices.getSupportedConstraints() || {};\n }\n getTrackCapabilities() {\n if (!this.#e) return {};\n let [t] = this.#e.getVideoTracks();\n return t && \"function\" == typeof t.getCapabilities && t.getCapabilities() || {};\n }\n getTrackSettings() {\n if (!this.#e) return {};\n let [t] = this.#e.getVideoTracks();\n return t && \"function\" == typeof t.getSettings && t.getSettings() || {};\n }\n static isSupported() {\n return !!navigator.mediaDevices?.getUserMedia;\n }\n static defineCustomElement(t = $636b0cf1ed0b9f88$var$e) {\n \"undefined\" == typeof window || window.customElements.get(t) || window.customElements.define(t, $636b0cf1ed0b9f88$export$cc30a98fe3890794);\n }\n}\n$636b0cf1ed0b9f88$export$cc30a98fe3890794.defineCustomElement();\n\n\nObject.defineProperty({}, \"ModalElement\", {\n get: function() {\n return $4da30046ce6d9325$export$32589115725b904b;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $4da30046ce6d9325$var$e = document.createElement(\"template\");\n$4da30046ce6d9325$var$e.innerHTML = /* html */ `\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`; /**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */ \nclass $4da30046ce6d9325$export$32589115725b904b extends HTMLElement {\n #e = null;\n #t = null;\n #o = void 0;\n constructor(){\n if (super(), !this.shadowRoot) {\n let t = this.attachShadow({\n mode: \"open\"\n });\n t.appendChild($4da30046ce6d9325$var$e.content.cloneNode(!0));\n }\n this.shadowRoot && (this.#e = this.shadowRoot.querySelector(\"dialog\"), this.#t = this.shadowRoot.querySelector('slot[name=\"footer\"]'));\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\"\n ];\n }\n attributeChangedCallback(e, t, o) {\n if (null !== this.#e) {\n if (\"open\" === e && t !== o && (this.open ? (this.#e.showModal(), document.body && (document.body.style.overflowY = \"hidden\"), this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n }))) : this.#e.close()), \"no-header\" === e && t !== o) {\n let e = this.#e.querySelector(\".dialog__header\");\n null !== e && (e.hidden = this.noHeader);\n }\n if (\"no-animations\" === e && t !== o && this.#e.classList.toggle(\"dialog--no-animations\", this.noAnimations), \"no-close-button\" === e && t !== o) {\n let e = this.#e.querySelector(\".dialog__close\");\n null !== e && (e.hidden = this.noCloseButton);\n }\n }\n }\n connectedCallback() {\n this.#i(\"open\"), this.#i(\"staticBackdrop\"), this.#i(\"noHeader\"), this.#i(\"noAnimations\"), this.#i(\"noCloseButton\"), this.#i(\"fullscreen\"), this.#e?.addEventListener(\"click\", this.#a), this.#e?.addEventListener(\"close\", this.#l), this.#e?.addEventListener(\"cancel\", this.#s), this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#n), this.#t?.addEventListener(\"slotchange\", this.#r);\n }\n disconnectedCallback() {\n this.#o && clearTimeout(this.#o), this.#e?.addEventListener(\"click\", this.#a), this.#e?.removeEventListener(\"close\", this.#l), this.#e?.removeEventListener(\"cancel\", this.#s), this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#n), this.#t?.removeEventListener(\"slotchange\", this.#r);\n }\n get open() {\n return this.hasAttribute(\"open\");\n }\n set open(e) {\n e ? this.setAttribute(\"open\", \"\") : this.removeAttribute(\"open\");\n }\n get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(e) {\n e ? this.setAttribute(\"static-backdrop\", \"\") : this.removeAttribute(\"static-backdrop\");\n }\n get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(e) {\n e ? this.setAttribute(\"no-header\", \"\") : this.removeAttribute(\"no-header\");\n }\n get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(e) {\n e ? this.setAttribute(\"no-animations\", \"\") : this.removeAttribute(\"no-animations\");\n }\n get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(e) {\n e ? this.setAttribute(\"no-close-button\", \"\") : this.removeAttribute(\"no-close-button\");\n }\n get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(e) {\n e ? this.setAttribute(\"fullscreen\", \"\") : this.removeAttribute(\"fullscreen\");\n }\n #d() {\n this.#o || (this.#e?.classList.add(\"dialog--pulse\"), this.#o = setTimeout(()=>{\n this.#e?.classList.remove(\"dialog--pulse\"), clearTimeout(this.#o), this.#o = void 0;\n }, 300));\n }\n #l = ()=>{\n // the open property when the dialog is closed by the user.\n this.open = !1, document.body && (document.body.style.overflowY = \"\"), this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n }));\n };\n #s = (e)=>{\n let t = this.#c(\"escape-key\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), this.noAnimations || this.#d());\n };\n #n = (e)=>{\n let t = this.#c(\"close-button\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), this.noAnimations || this.#d());\n };\n #a = (e)=>{\n if (e.target !== e.currentTarget) return;\n let t = this.#c(\"backdrop-click\");\n if (this.dispatchEvent(t), t.defaultPrevented || this.staticBackdrop) {\n this.noAnimations || this.#d();\n return;\n }\n this.#e?.close();\n };\n #r = ()=>{\n if (null === this.#e) return; /** @type {Nullable} */ \n let e = this.#e.querySelector(\".dialog__footer\");\n if (null === e) return;\n let t = this.#t?.assignedNodes(), o = !!t && t.length > 0;\n e.hidden = !o;\n };\n #c(e) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: !0,\n composed: !0,\n cancelable: !0,\n detail: {\n reason: e,\n element: this\n }\n });\n }\n #i(e) {\n if (Object.prototype.hasOwnProperty.call(this, e)) {\n let t = this[e];\n delete this[e], this[e] = t;\n }\n }\n show() {\n this.open || (this.open = !0);\n }\n hide() {\n this.open && (this.open = !1);\n }\n static defineCustomElement(e = \"modal-element\") {\n \"undefined\" == typeof window || window.customElements.get(e) || window.customElements.define(e, $4da30046ce6d9325$export$32589115725b904b);\n }\n}\n$4da30046ce6d9325$export$32589115725b904b.defineCustomElement();\n //# sourceMappingURL=modal-element-defined.js.map\n\n\nObject.defineProperty({}, \"FilesDropzone\", {\n get: function() {\n return $7aad62ebc3d6fae8$export$6ccd1735166caad9;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $7aad62ebc3d6fae8$var$e = new Map([\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]), $7aad62ebc3d6fae8$var$t = [\n \".DS_Store\",\n \"Thumbs.db\"\n], $7aad62ebc3d6fae8$var$o = (t)=>{\n let { name: o } = t;\n if (o && -1 !== o.lastIndexOf(\".\") && !t.type) {\n let i = (o.split(\".\").pop() || \"\").toLowerCase(), r = $7aad62ebc3d6fae8$var$e.get(i);\n r && Object.defineProperty(t, \"type\", {\n value: r,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return t;\n}, $7aad62ebc3d6fae8$var$i = (e, t)=>{\n let i = $7aad62ebc3d6fae8$var$o(e);\n if (\"string\" != typeof i.path) {\n let { webkitRelativePath: o } = e;\n Object.defineProperty(i, \"path\", {\n value: \"string\" == typeof t ? t : o || e.name,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return i;\n}, $7aad62ebc3d6fae8$var$r = async (e)=>await new Promise((t, o)=>{\n e.readEntries(t, o);\n }), $7aad62ebc3d6fae8$var$a = async (e)=>{\n let t = [], o = await $7aad62ebc3d6fae8$var$r(e);\n for(; o.length > 0;)t.push(...o), o = await $7aad62ebc3d6fae8$var$r(e);\n return t;\n}, $7aad62ebc3d6fae8$var$n = (e)=>new Promise((t, o)=>{\n e.file((o)=>t($7aad62ebc3d6fae8$var$i(o, e.fullPath)), o);\n }), $7aad62ebc3d6fae8$var$s = async (e)=>{\n let o = [], i = [];\n for (let t of e){\n if (\"file\" !== t.kind) continue;\n let e = t.getAsEntry ? t.getAsEntry() : t.webkitGetAsEntry();\n i.push(e);\n }\n for(; i.length > 0;){\n let e = i.shift();\n if (e) {\n if (e.isFile) {\n let i = await $7aad62ebc3d6fae8$var$n(e);\n -1 === $7aad62ebc3d6fae8$var$t.indexOf(i.name) && o.push(i);\n } else e.isDirectory && i.push(...await $7aad62ebc3d6fae8$var$a(e.createReader()));\n }\n }\n return o;\n}, $7aad62ebc3d6fae8$var$d = async (e)=>{\n let o = [];\n for (let r of e)-1 === $7aad62ebc3d6fae8$var$t.indexOf(r.name) && o.push($7aad62ebc3d6fae8$var$i(r));\n return o;\n}, $7aad62ebc3d6fae8$var$l = async (e)=>e.dataTransfer ? e.dataTransfer.items ? await $7aad62ebc3d6fae8$var$s(e.dataTransfer.items) : await $7aad62ebc3d6fae8$var$d(e.dataTransfer.files) : await $7aad62ebc3d6fae8$var$d(e.target.files), $7aad62ebc3d6fae8$var$p = \"files-dropzone\", $7aad62ebc3d6fae8$var$c = \"TOO_MANY_FILES\", $7aad62ebc3d6fae8$var$h = document.createElement(\"template\"), $7aad62ebc3d6fae8$var$u = `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$7aad62ebc3d6fae8$var$h.innerHTML = `\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\nclass $7aad62ebc3d6fae8$export$6ccd1735166caad9 extends HTMLElement {\n #e = null;\n #t = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($7aad62ebc3d6fae8$var$h.content.cloneNode(!0)), this.shadowRoot && (this.#e = this.shadowRoot.getElementById(\"fileInput\"), this.#t = this.shadowRoot.getElementById(\"dropzoneEl\"));\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\",\n \"no-keyboard\"\n ];\n }\n attributeChangedCallback(e, t, o) {\n \"accept\" === e && t !== o && this.#e && (this.#e.accept = this.accept), \"disabled\" === e && t !== o && this.#e && (this.#e.disabled = this.disabled, this.disabled ? this.#t?.removeAttribute(\"tabindex\") : this.#t?.setAttribute(\"tabindex\", \"0\")), \"multiple\" === e && t !== o && this.#e && (this.#e.multiple = this.multiple), \"no-keyboard\" === e && t !== o && this.#t && (this.noKeyboard ? this.#t.removeAttribute(\"tabindex\") : this.#t.setAttribute(\"tabindex\", \"0\"));\n }\n connectedCallback() {\n this.#o(\"accept\"), this.#o(\"disabled\"), this.#o(\"maxFiles\"), this.#o(\"maxSize\"), this.#o(\"minSize\"), this.#o(\"multiple\"), this.#o(\"noClick\"), this.#o(\"noDrag\"), this.#o(\"noKeyboard\"), this.#o(\"autoFocus\"), this.#o(\"noStyle\"), this.#e?.addEventListener(\"change\", this.#i), this.#t?.addEventListener(\"dragenter\", this.#r), this.#t?.addEventListener(\"dragover\", this.#a), this.#t?.addEventListener(\"dragleave\", this.#n), this.#t?.addEventListener(\"drop\", this.#s), this.#t?.addEventListener(\"click\", this.#d), this.#t?.addEventListener(\"keyup\", this.#l), this.autoFocus && this.#t?.focus();\n }\n disconnectedCallback() {\n this.#e?.removeEventListener(\"change\", this.#i), this.#t?.removeEventListener(\"dragenter\", this.#r), this.#t?.removeEventListener(\"dragover\", this.#a), this.#t?.removeEventListener(\"dragleave\", this.#n), this.#t?.removeEventListener(\"drop\", this.#s), this.#t?.removeEventListener(\"click\", this.#d), this.#t?.removeEventListener(\"keyup\", this.#l);\n }\n get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(e) {\n this.setAttribute(\"accept\", null != e ? e.toString() : e);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n get maxFiles() {\n let e = Number(this.getAttribute(\"max-files\")) || 0;\n return e <= 0 ? 1 / 0 : Math.floor(Math.abs(e));\n }\n set maxFiles(e) {\n this.setAttribute(\"max-files\", null != e ? e.toString() : e);\n }\n get maxSize() {\n let e = this.getAttribute(\"max-size\");\n if (null === e) return 1 / 0;\n let t = Number(e);\n return Number.isNaN(t) ? 1 / 0 : t;\n }\n set maxSize(e) {\n this.setAttribute(\"max-size\", null != e ? e.toString() : e);\n }\n get minSize() {\n let e = this.getAttribute(\"min-size\");\n if (null === e) return 0;\n let t = Number(e);\n return Number.isNaN(t) ? 0 : t;\n }\n set minSize(e) {\n this.setAttribute(\"min-size\", null != e ? e.toString() : e);\n }\n get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(e) {\n this.toggleAttribute(\"multiple\", !!e);\n }\n get noClick() {\n return this.hasAttribute(\"no-click\");\n }\n set noClick(e) {\n this.toggleAttribute(\"no-click\", !!e);\n }\n get noDrag() {\n return this.hasAttribute(\"no-drag\");\n }\n set noDrag(e) {\n this.toggleAttribute(\"no-drag\", !!e);\n }\n get noKeyboard() {\n return this.hasAttribute(\"no-keyboard\");\n }\n set noKeyboard(e) {\n this.toggleAttribute(\"no-keyboard\", !!e);\n }\n get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(e) {\n this.toggleAttribute(\"auto-focus\", !!e);\n }\n get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(e) {\n this.toggleAttribute(\"no-style\", !!e);\n }\n #i = async (e)=>{\n try {\n this.#p(await $7aad62ebc3d6fae8$var$l(e));\n } catch (e) {\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$p}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: e\n }\n }));\n }\n };\n #r = ()=>{\n this.disabled || this.noDrag || this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$p}-dragenter`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #a = (e)=>{\n if (e.preventDefault(), this.disabled || this.noDrag) {\n e.dataTransfer.dropEffect = \"none\";\n return;\n }\n e.dataTransfer.dropEffect = \"copy\", this.#t && (this.#t.classList.add(\"dropzone--dragover\"), this.#t.part.add(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$p}-dragover`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #n = ()=>{\n this.disabled || this.noDrag || (this.#t && (this.#t.classList.remove(\"dropzone--dragover\"), this.#t.part.remove(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$p}-dragleave`, {\n bubbles: !0,\n composed: !0\n })));\n };\n #s = async (e)=>{\n if (!this.disabled && !this.noDrag) {\n e.preventDefault(), this.#t && (this.#t.classList.remove(\"dropzone--dragover\"), this.#t.part.remove(\"dropzone--dragover\"));\n try {\n this.#p(await $7aad62ebc3d6fae8$var$l(e));\n } catch (e) {\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$p}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: e\n }\n }));\n }\n }\n };\n #d = ()=>{\n this.disabled || this.noClick || this.#e?.click();\n };\n #l = (e)=>{\n this.disabled || this.noKeyboard || \" \" !== e.key && \"Enter\" !== e.key || this.#e?.click();\n };\n #p(e) {\n if (!Array.isArray(e) || !e.length) return;\n let t = [], o = [], i = e.length;\n if (!this.multiple && i > 1) for (let t of e)o.push({\n file: t,\n errors: [\n {\n code: $7aad62ebc3d6fae8$var$c,\n message: \"Too many files selected. Only 1 file is allowed.\"\n }\n ]\n });\n else if (this.multiple && i > this.maxFiles) for (let t of e)o.push({\n file: t,\n errors: [\n {\n code: $7aad62ebc3d6fae8$var$c,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else for (let i of e){\n let e = function(e, t = \"\") {\n if (!t) return !0;\n let o = [\n ...new Set(t.split(\",\").map((e)=>e.trim()).filter(Boolean))\n ], i = e.type, r = i.replace(/\\/.*$/, \"\");\n for (let t of o)if (\".\" === t.charAt(0)) {\n if (-1 !== e.name.toLowerCase().indexOf(t.toLowerCase(), e.name.length - t.length)) return !0;\n } else if (/\\/\\*$/.test(t)) {\n if (r === t.replace(/\\/.*$/, \"\")) return !0;\n } else if (i === t) return !0;\n return !1;\n }(i, this.accept), r = i.size > this.maxSize, a = i.size < this.minSize;\n if (!e || r || a) {\n let t = [];\n e || t.push({\n code: \"INVALID_MIME_TYPE\",\n message: `File type \"${i.type}\" is not accepted.`\n }), r && t.push({\n code: \"FILE_TOO_LARGE\",\n message: `File size ${i.size} exceeds the maximum size of ${this.maxSize}.`\n }), a && t.push({\n code: \"FILE_TOO_SMALL\",\n message: `File size ${i.size} is smaller than the minimum size of ${this.minSize}.`\n }), o.push({\n file: i,\n errors: t\n });\n } else t.push(i);\n }\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$p}-drop`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t,\n rejectedFiles: o\n }\n })), t.length > 0 && this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$p}-drop-accepted`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t\n }\n })), o.length > 0 && this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$p}-drop-rejected`, {\n bubbles: !0,\n composed: !0,\n detail: {\n rejectedFiles: o\n }\n })), this.#e && (this.#e.value = this.#e.defaultValue);\n }\n openFileDialog() {\n this.disabled || this.#e?.click();\n }\n #o(e) {\n if (Object.prototype.hasOwnProperty.call(this, e)) {\n let t = this[e];\n delete this[e], this[e] = t;\n }\n }\n static defineCustomElement(e = $7aad62ebc3d6fae8$var$p) {\n \"undefined\" == typeof window || window.customElements.get(e) || window.customElements.define(e, $7aad62ebc3d6fae8$export$6ccd1735166caad9);\n }\n}\n$7aad62ebc3d6fae8$export$6ccd1735166caad9.defineCustomElement();\n\n\n\n\n/**\n * Removes one or more elements from an array at the specified index(es).\n *\n * @param {Array} array The initial array to remove elements from.\n * @param {Number} ...indexes The index(es) of the elements to be removed. Non numbers are ignored.\n * @throws {TypeError} If `array` is not array.\n * @returns {Array} The result array with the elements specified removed.\n * @example\n *\n * const arr = [1, 2, 3, 4, 5];\n *\n * remove(arr, 0);\n * // => [2, 3, 4, 5]\n *\n * remove(arr, 0, 1);\n * // => [3, 4, 5]\n *\n * remove(arr, 0, 4);\n * // => [2, 3, 4]\n *\n * remove(arr);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length - 1);\n * // => [1, 2, 3, 4]\n *\n * remove(arr, NaN);\n * // => [1, 2, 3, 4, 5]\n */ const $5742c9e143620cb1$export$30a014203d0d7e4f = (array, ...indexes)=>{\n if (!Array.isArray(array)) throw new TypeError(\"Expected an array for first argument\");\n return array.filter((_, i)=>indexes.indexOf(i) === -1);\n};\n\n\n/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */ const $21c3f3a8dccfa4fd$export$e2a22331486dcca0 = (prefix = \"\", suffix = \"\")=>{\n const prefixString = typeof prefix === \"string\" && prefix !== \"\" ? prefix + \"-\" : \"\";\n const suffixString = typeof suffix === \"string\" && suffix !== \"\" ? \"-\" + suffix : \"\";\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n return `${prefixString}${randomString}${suffixString}`;\n};\n\n\nconst $33dea9d9a6da4c9a$export$63e7bed68b07a85c = [\n \"image/jpg\",\n \"image/jpeg\",\n \"image/png\",\n \"image/apng\",\n \"image/gif\",\n \"image/webp\",\n \"image/avif\"\n];\n\n\nvar $b9a1dffffdf320f2$exports = {};\n\n$b9a1dffffdf320f2$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"Anton-Regular.e58ab3fe.ttf\";\n\n\nvar $6f8f0ad93b4f4fec$exports = {};\n\n$6f8f0ad93b4f4fec$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"Oswald-Regular.89ec7d89.ttf\";\n\n\nvar $60f12aeb358e1d01$exports = {};\n\n$60f12aeb358e1d01$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"Oswald-Bold.0f6a7ca6.ttf\";\n\n\nvar $b312cc3e2ac443c7$exports = {};\n\n$b312cc3e2ac443c7$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"Roboto-Regular.ca197847.ttf\";\n\n\nvar $481315e8ee95f8f9$exports = {};\n\n$481315e8ee95f8f9$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"Roboto-Bold.fdb9b54a.ttf\";\n\n\nvar $7cee0a691e2711a6$exports = {};\n\n$7cee0a691e2711a6$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"RobotoCondensed-Regular.d585f5c7.ttf\";\n\n\nvar $12b7043e62e67366$exports = {};\n\n$12b7043e62e67366$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"RobotoCondensed-Bold.e1f96d4b.ttf\";\n\n\nvar $f224edc54658ebde$exports = {};\n\n$f224edc54658ebde$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"CourierPrime-Regular.3a25a501.ttf\";\n\n\nvar $33ce2f42587a9c55$exports = {};\n\n$33ce2f42587a9c55$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"CourierPrime-Bold.3d6bf689.ttf\";\n\n\nvar $1375393a097acb0e$exports = {};\n\n$1375393a097acb0e$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"OpenSans-Regular.edf9e01b.ttf\";\n\n\nvar $728f6ce83c7b6e27$exports = {};\n\n$728f6ce83c7b6e27$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"OpenSans-Bold.8fceb72b.ttf\";\n\n\nconst $055531bbd0af154c$export$6874249d87f2602a = [\n {\n name: \"Anton\",\n label: \"Anton\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($b9a1dffffdf320f2$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Oswald-Regular\",\n label: \"Oswald\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($6f8f0ad93b4f4fec$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Oswald-Bold\",\n label: \"Oswald Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($60f12aeb358e1d01$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"Roboto-Regular\",\n label: \"Roboto\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($b312cc3e2ac443c7$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Roboto-Bold\",\n label: \"Roboto Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($481315e8ee95f8f9$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"RobotoCondensed-Regular\",\n label: \"Roboto Condensed\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($7cee0a691e2711a6$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"RobotoCondensed-Bold\",\n label: \"Roboto Condensed Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($12b7043e62e67366$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"CourierPrime-Regular\",\n label: \"Courier Prime\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($f224edc54658ebde$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"CourierPrime-Bold\",\n label: \"Courier Prime Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($33ce2f42587a9c55$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"OpenSans-Regular\",\n label: \"Open Sans\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($1375393a097acb0e$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"OpenSans-Bold\",\n label: \"Open Sans Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($728f6ce83c7b6e27$exports))),\n style: \"normal\",\n weight: \"400\"\n }\n];\nconst $055531bbd0af154c$export$59eceaef0c7797b2 = async (name, path, options = {})=>{\n try {\n const font = new FontFace(name, `url(${path})`, {\n ...options\n });\n await font.load();\n document.fonts.add(font);\n } catch (err) {\n console.error(err);\n }\n};\n\n\n\nconst $008970865eefc93d$export$6539e087749cf9d3 = async (options = {})=>{\n const res = await fetch(options.url);\n const blob = await res.blob();\n const mimeType = options.mimeType || blob.type || \"\";\n if (!(0, $33dea9d9a6da4c9a$export$63e7bed68b07a85c).includes(mimeType)) throw new Error(`This is not an accepted image format. Accepted MIME types are: ${(0, $33dea9d9a6da4c9a$export$63e7bed68b07a85c).join(\", \")}`);\n return new File([\n blob\n ], options.filename || \"\", blob);\n};\n\n\nconst $166cfb2484b08c80$var$errorsContainer = document.getElementById(\"errorsContainer\");\nconst $166cfb2484b08c80$var$hideError = (evt)=>{\n const target = evt.currentTarget;\n target.removeEventListener(\"click\", $166cfb2484b08c80$var$hideError);\n $166cfb2484b08c80$var$errorsContainer.removeChild(target.parentNode);\n};\nconst $166cfb2484b08c80$export$af04143326425dbd = (message = \"\", type = \"info\")=>{\n const types = [\n \"info\",\n \"warning\",\n \"danger\"\n ];\n if (!types.includes(type)) type = \"info\";\n const template = /* html */ `\n ${message}\n \n `;\n const div = document.createElement(\"div\");\n div.className = `alert alert-${type} alert-dismissible text-break mb-2 fade`;\n div.innerHTML = template;\n div.querySelector(\"button\").addEventListener(\"click\", $166cfb2484b08c80$var$hideError);\n $166cfb2484b08c80$var$errorsContainer.appendChild(div);\n setTimeout(()=>div.classList.add(\"show\"), 100);\n};\n\n\n\nconst $50a37fdc18d479c2$export$293a4b86a6fe2398 = (index, data = {})=>{\n const inputTemplate = /* html */ `\n
\n \n\n \n\n
\n \n \n \n
\n
\n\n
\n
\n
\n \n\n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n \n \n \n \n
\n
\n
\n\n
\n
\n
\n \n \n
\n
\n
\n
\n `;\n const fragment = document.createDocumentFragment();\n const div = document.createElement(\"div\");\n div.className = \"bg-light border shadow-sm mb-3 rounded\";\n div.setAttribute(\"data-section\", \"textBox\");\n div.setAttribute(\"data-index\", index);\n div.innerHTML = inputTemplate;\n div.querySelector('[data-input=\"font\"]').value = data.font;\n div.querySelector('[data-input=\"textAlign\"]').value = data.textAlign;\n div.querySelector('[data-input=\"allCaps\"]').checked = data.allCaps;\n return fragment.appendChild(div);\n};\n\n\nconst $d346fdc99aed49b3$export$e653a2de0f3a8b89 = (image, canvas, ctx, textOptions = [])=>{\n if (image == null) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n if (typeof image === \"string\") {\n ctx.fillStyle = image;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n } else ctx.drawImage(image, 0, 0, canvas.width, canvas.height);\n textOptions.forEach(function(item, index) {\n ctx.font = `${item.fontWeight} ${item.fontSize}px ${item.font}`;\n const multiplier = index + 1;\n const lineHeight = ctx.measureText(\"M\").width + item.fontSize / 2;\n const xPos = canvas.width / 2;\n const shadowBlur = item.shadowBlur;\n const text = item.allCaps === true ? item.text.toUpperCase() : item.text;\n const textLines = text.split(\"\\n\");\n ctx.fillStyle = item.fillColor;\n ctx.textAlign = item.textAlign;\n ctx.save();\n if (shadowBlur !== 0) {\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n ctx.shadowBlur = shadowBlur;\n ctx.shadowColor = item.shadowColor;\n }\n if (item.rotate) {\n ctx.translate(xPos + item.offsetX, lineHeight * multiplier + item.offsetY);\n ctx.rotate(item.rotate * Math.PI / 180);\n textLines.forEach((text, index)=>ctx.fillText(text, 0, index * lineHeight));\n ctx.rotate(-(item.rotate * Math.PI / 180));\n ctx.translate(-(xPos + item.offsetX), -(lineHeight * multiplier + item.offsetY));\n } else textLines.forEach((text, index)=>{\n ctx.fillText(text, xPos + item.offsetX, index * lineHeight + lineHeight * multiplier + item.offsetY);\n });\n ctx.restore();\n });\n};\n\n\nconst $44ae6d9db4eaca0f$var$videoModal = document.getElementById(\"videoModal\");\nconst $44ae6d9db4eaca0f$var$downloadModal = document.getElementById(\"downloadModal\");\nconst $44ae6d9db4eaca0f$var$canvas = document.getElementById(\"canvas\");\nconst $44ae6d9db4eaca0f$var$dropzoneEl = document.querySelector(\"files-dropzone\");\nconst $44ae6d9db4eaca0f$var$instructionsEl = document.getElementById(\"instructions\");\nconst $44ae6d9db4eaca0f$var$ctx = $44ae6d9db4eaca0f$var$canvas.getContext(\"2d\");\nconst $44ae6d9db4eaca0f$var$imageUploadMethodSelect = document.getElementById(\"imageUploadMethodSelect\");\nconst $44ae6d9db4eaca0f$var$fileSelectBtn = document.getElementById(\"fileSelectBtn\");\nconst $44ae6d9db4eaca0f$var$imageUrlForm = document.getElementById(\"imageUrlForm\");\nconst $44ae6d9db4eaca0f$var$addTextboxBtn = document.getElementById(\"addTextboxBtn\");\nconst $44ae6d9db4eaca0f$var$inputsContainer = document.getElementById(\"inputsContainer\");\nconst $44ae6d9db4eaca0f$var$generateMemeBtn = document.getElementById(\"generateMemeBtn\");\nconst $44ae6d9db4eaca0f$var$openVideoModalBtn = document.getElementById(\"openVideoModalBtn\");\nconst $44ae6d9db4eaca0f$var$downloadMemeBtn = document.getElementById(\"downloadMemeBtn\");\nconst $44ae6d9db4eaca0f$var$downloadMemePreview = document.getElementById(\"downloadMemePreview\");\nconst $44ae6d9db4eaca0f$var$webShareComponent = document.querySelector(\"web-share\");\nconst $44ae6d9db4eaca0f$var$galleryEl = document.getElementById(\"gallery\");\nconst $44ae6d9db4eaca0f$var$gallerySearchEl = document.getElementById(\"gallerySearch\");\nconst $44ae6d9db4eaca0f$var$galleryNoResultsEl = $44ae6d9db4eaca0f$var$galleryEl.querySelector(\".gallery__no-results\");\nconst $44ae6d9db4eaca0f$var$solidColorForm = document.getElementById(\"solidColorForm\");\nconst $44ae6d9db4eaca0f$var$uploadMethodEls = document.querySelectorAll(\".upload-method\");\nlet $44ae6d9db4eaca0f$var$selectedImage = null;\nlet $44ae6d9db4eaca0f$var$reqAnimFrame = null;\nconst $44ae6d9db4eaca0f$var$defaultTextOptions = {\n _isSettingsOpen: false,\n text: \"\",\n fillColor: \"#ffffff\",\n shadowColor: \"#000000\",\n font: \"Anton\",\n fontSize: 40,\n fontWeight: \"normal\",\n textAlign: \"center\",\n shadowBlur: 3,\n offsetY: 0,\n offsetX: 0,\n rotate: 0,\n allCaps: true\n};\nlet $44ae6d9db4eaca0f$var$textOptions = [\n {\n ...$44ae6d9db4eaca0f$var$defaultTextOptions\n }\n];\nconst $44ae6d9db4eaca0f$var$generateMeme = async ()=>{\n const dataUrl = $44ae6d9db4eaca0f$var$canvas.toDataURL(\"image/png\");\n // Prepare download link\n const downloadLink = dataUrl.replace(\"image/png\", \"image/octet-stream\");\n $44ae6d9db4eaca0f$var$downloadMemeBtn.download = `${(0, $21c3f3a8dccfa4fd$export$e2a22331486dcca0)(\"meme\")}.png`;\n $44ae6d9db4eaca0f$var$downloadMemeBtn.href = downloadLink;\n $44ae6d9db4eaca0f$var$downloadMemePreview.src = downloadLink;\n // Prepare for sharing file\n if ((0, $94933cc6427541bd$export$c37129e465f64ef0)()) try {\n const file = await (0, $008970865eefc93d$export$6539e087749cf9d3)({\n url: dataUrl,\n filename: `${(0, $21c3f3a8dccfa4fd$export$e2a22331486dcca0)(\"meme\")}.png`,\n mimeType: \"image/png\"\n }).catch((err)=>(0, $166cfb2484b08c80$export$af04143326425dbd)(err.message, \"danger\"));\n if (file && (0, $94933cc6427541bd$export$c37129e465f64ef0)({\n files: [\n file\n ]\n })) {\n $44ae6d9db4eaca0f$var$webShareComponent.shareFiles = [\n file\n ];\n $44ae6d9db4eaca0f$var$webShareComponent.hidden = false;\n }\n } catch (error) {\n console.error(error);\n }\n $44ae6d9db4eaca0f$var$downloadModal.open = true;\n};\nconst $44ae6d9db4eaca0f$var$onImageLoaded = (evt)=>{\n const MAX_WIDTH = 800;\n const MAX_HEIGHT = 600;\n let width = evt.target.width;\n let height = evt.target.height;\n if (width > height) {\n if (width > MAX_WIDTH) {\n height *= MAX_WIDTH / width;\n width = MAX_WIDTH;\n }\n } else if (height > MAX_HEIGHT) {\n width *= MAX_HEIGHT / height;\n height = MAX_HEIGHT;\n }\n $44ae6d9db4eaca0f$var$canvas.width = width;\n $44ae6d9db4eaca0f$var$canvas.height = height;\n $44ae6d9db4eaca0f$var$selectedImage = evt.target;\n (0, $d346fdc99aed49b3$export$e653a2de0f3a8b89)($44ae6d9db4eaca0f$var$selectedImage, $44ae6d9db4eaca0f$var$canvas, $44ae6d9db4eaca0f$var$ctx, $44ae6d9db4eaca0f$var$textOptions);\n $44ae6d9db4eaca0f$var$generateMemeBtn.disabled = false;\n $44ae6d9db4eaca0f$var$canvas.hidden = false;\n $44ae6d9db4eaca0f$var$instructionsEl.hidden = true;\n};\nconst $44ae6d9db4eaca0f$var$handleSolidColorFormInput = (evt)=>{\n const DEFAULT_WIDTH = 600;\n const DEFAULT_HEIGHT = 400;\n if (evt.target === $44ae6d9db4eaca0f$var$solidColorForm[\"canvasColor\"]) $44ae6d9db4eaca0f$var$selectedImage = evt.target.value;\n if (typeof $44ae6d9db4eaca0f$var$selectedImage === \"string\") {\n $44ae6d9db4eaca0f$var$canvas.width = Number($44ae6d9db4eaca0f$var$solidColorForm[\"canvasWidth\"].value) || DEFAULT_WIDTH;\n $44ae6d9db4eaca0f$var$canvas.height = Number($44ae6d9db4eaca0f$var$solidColorForm[\"canvasHeight\"].value) || DEFAULT_HEIGHT;\n (0, $d346fdc99aed49b3$export$e653a2de0f3a8b89)($44ae6d9db4eaca0f$var$selectedImage, $44ae6d9db4eaca0f$var$canvas, $44ae6d9db4eaca0f$var$ctx, $44ae6d9db4eaca0f$var$textOptions);\n $44ae6d9db4eaca0f$var$generateMemeBtn.disabled = false;\n $44ae6d9db4eaca0f$var$canvas.hidden = false;\n $44ae6d9db4eaca0f$var$instructionsEl.hidden = true;\n }\n};\nconst $44ae6d9db4eaca0f$var$handleFileSelect = (file)=>{\n if (!file) return;\n const image = new Image();\n const reader = new FileReader();\n reader.addEventListener(\"load\", function(evt) {\n const data = evt.target.result;\n image.addEventListener(\"load\", $44ae6d9db4eaca0f$var$onImageLoaded);\n image.src = data;\n });\n reader.readAsDataURL(file);\n};\nconst $44ae6d9db4eaca0f$var$handleOpenVideoModalButtonClick = ()=>{\n $44ae6d9db4eaca0f$var$videoModal.open = true;\n};\nconst $44ae6d9db4eaca0f$var$handleTextPropChange = (element, index, prop)=>{\n if (element.type === \"checkbox\") $44ae6d9db4eaca0f$var$textOptions[index][prop] = element.checked;\n else if (element.type === \"number\") $44ae6d9db4eaca0f$var$textOptions[index][prop] = Number(element.value);\n else $44ae6d9db4eaca0f$var$textOptions[index][prop] = element.value;\n (0, $d346fdc99aed49b3$export$e653a2de0f3a8b89)($44ae6d9db4eaca0f$var$selectedImage, $44ae6d9db4eaca0f$var$canvas, $44ae6d9db4eaca0f$var$ctx, $44ae6d9db4eaca0f$var$textOptions);\n};\nconst $44ae6d9db4eaca0f$var$handleAddTextboxBtnClick = ()=>{\n const textOptionsLength = $44ae6d9db4eaca0f$var$textOptions.length;\n const newTextBox = (0, $50a37fdc18d479c2$export$293a4b86a6fe2398)(textOptionsLength, $44ae6d9db4eaca0f$var$defaultTextOptions);\n $44ae6d9db4eaca0f$var$textOptions.push({\n ...$44ae6d9db4eaca0f$var$defaultTextOptions\n });\n $44ae6d9db4eaca0f$var$inputsContainer.appendChild(newTextBox);\n newTextBox.querySelector('[data-input=\"text\"]').focus();\n};\nconst $44ae6d9db4eaca0f$var$handleImageUploadFromURL = async (evt)=>{\n evt.preventDefault();\n const form = evt.target;\n const submitButton = form.querySelector('button[type=\"submit\"]');\n const imageUrl = form[\"imageUrl\"].value;\n if (!imageUrl.trim()) return;\n submitButton.disabled = true;\n submitButton.querySelector(\".spinner\").hidden = false;\n submitButton.querySelector(\".label\").hidden = true;\n try {\n const file = await (0, $008970865eefc93d$export$6539e087749cf9d3)({\n url: imageUrl\n }).catch((err)=>(0, $166cfb2484b08c80$export$af04143326425dbd)(err.message, \"danger\"));\n if (file) $44ae6d9db4eaca0f$var$handleFileSelect(file);\n } catch (err) {\n (0, $166cfb2484b08c80$export$af04143326425dbd)(`Failed to load image from \"${imageUrl}\".`, \"danger\");\n } finally{\n submitButton.disabled = false;\n submitButton.querySelector(\".spinner\").hidden = true;\n submitButton.querySelector(\".label\").hidden = false;\n }\n};\nconst $44ae6d9db4eaca0f$var$moveText = (offsetDir, sign, index)=>()=>{\n const textBoxSection = document.querySelectorAll('[data-section=\"textBox\"]')[index];\n const offsetYInput = textBoxSection.querySelector('[data-input=\"offsetY\"]');\n const offsetXInput = textBoxSection.querySelector('[data-input=\"offsetX\"]');\n if (offsetDir === \"offsetY\") {\n if (sign === \"-\") $44ae6d9db4eaca0f$var$textOptions[index].offsetY -= 1;\n if (sign === \"+\") $44ae6d9db4eaca0f$var$textOptions[index].offsetY += 1;\n offsetYInput.value = $44ae6d9db4eaca0f$var$textOptions[index].offsetY;\n }\n if (offsetDir === \"offsetX\") {\n if (sign === \"-\") $44ae6d9db4eaca0f$var$textOptions[index].offsetX -= 1;\n if (sign === \"+\") $44ae6d9db4eaca0f$var$textOptions[index].offsetX += 1;\n offsetXInput.value = $44ae6d9db4eaca0f$var$textOptions[index].offsetX;\n }\n (0, $d346fdc99aed49b3$export$e653a2de0f3a8b89)($44ae6d9db4eaca0f$var$selectedImage, $44ae6d9db4eaca0f$var$canvas, $44ae6d9db4eaca0f$var$ctx, $44ae6d9db4eaca0f$var$textOptions);\n $44ae6d9db4eaca0f$var$reqAnimFrame = requestAnimationFrame($44ae6d9db4eaca0f$var$moveText(offsetDir, sign, index));\n };\nconst $44ae6d9db4eaca0f$var$handleUploadMethodChange = (evt)=>{\n $44ae6d9db4eaca0f$var$uploadMethodEls.forEach((el)=>el.hidden = el.id !== evt.target.value);\n};\nconst $44ae6d9db4eaca0f$var$handleFileSelectClick = ()=>{\n if (typeof $44ae6d9db4eaca0f$var$dropzoneEl.openFileDialog === \"function\") $44ae6d9db4eaca0f$var$dropzoneEl.openFileDialog();\n};\nconst $44ae6d9db4eaca0f$var$handleDropFilesAccepted = (evt)=>{\n const [file] = evt.detail.acceptedFiles;\n if (file) $44ae6d9db4eaca0f$var$handleFileSelect(file);\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerInput = (evt)=>{\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let prop;\n if (element.matches('[data-input=\"text\"]')) prop = \"text\";\n else if (element.matches('[data-input=\"fillColor\"]')) prop = \"fillColor\";\n else if (element.matches('[data-input=\"shadowColor\"]')) prop = \"shadowColor\";\n else if (element.matches('[data-input=\"font\"]')) prop = \"font\";\n else if (element.matches('[data-input=\"fontSize\"]')) prop = \"fontSize\";\n else if (element.matches('[data-input=\"fontWeight\"]')) prop = \"fontWeight\";\n else if (element.matches('[data-input=\"textAlign\"]')) prop = \"textAlign\";\n else if (element.matches('[data-input=\"shadowBlur\"]')) prop = \"shadowBlur\";\n else if (element.matches('[data-input=\"offsetY\"]')) prop = \"offsetY\";\n else if (element.matches('[data-input=\"offsetX\"]')) prop = \"offsetX\";\n else if (element.matches('[data-input=\"rotate\"]')) prop = \"rotate\";\n if (prop) $44ae6d9db4eaca0f$var$handleTextPropChange(element, index, prop);\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerChange = (evt)=>{\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let prop;\n if (element.matches('[data-input=\"allCaps\"]')) prop = \"allCaps\";\n if (prop) $44ae6d9db4eaca0f$var$handleTextPropChange(element, index, prop);\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerClick = (evt)=>{\n const element = evt.target;\n if (element.matches('[data-button=\"settings\"]')) {\n const textBoxIndex = element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\");\n const textBoxEls = document.querySelectorAll('[data-section=\"textBox\"]');\n textBoxEls.forEach((el, index)=>{\n const settingsEl = el.querySelector('[data-section=\"settings\"]');\n if (el.getAttribute(\"data-index\") === textBoxIndex) {\n settingsEl.hidden = !settingsEl.hidden;\n $44ae6d9db4eaca0f$var$textOptions[index]._isSettingsOpen = !$44ae6d9db4eaca0f$var$textOptions[index]._isSettingsOpen;\n } else {\n settingsEl.hidden = true;\n $44ae6d9db4eaca0f$var$textOptions[index]._isSettingsOpen = false;\n }\n });\n }\n if (element.matches('[data-button=\"delete-text-box\"]')) {\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let confirm = true;\n if ($44ae6d9db4eaca0f$var$textOptions[index].text.trim()) confirm = window.confirm(\"Are you sure you want to remove this text box?\");\n if (confirm) {\n $44ae6d9db4eaca0f$var$textOptions = (0, $5742c9e143620cb1$export$30a014203d0d7e4f)($44ae6d9db4eaca0f$var$textOptions, index);\n $44ae6d9db4eaca0f$var$inputsContainer.querySelectorAll('[data-section=\"textBox\"]').forEach((el)=>el.remove());\n $44ae6d9db4eaca0f$var$textOptions.forEach((item, index)=>$44ae6d9db4eaca0f$var$inputsContainer.appendChild((0, $50a37fdc18d479c2$export$293a4b86a6fe2398)(index, item)));\n (0, $d346fdc99aed49b3$export$e653a2de0f3a8b89)($44ae6d9db4eaca0f$var$selectedImage, $44ae6d9db4eaca0f$var$canvas, $44ae6d9db4eaca0f$var$ctx, $44ae6d9db4eaca0f$var$textOptions);\n }\n }\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerPointerdown = (evt)=>{\n const element = evt.target;\n const textBoxEl = element.closest('[data-section=\"textBox\"]');\n if (!textBoxEl) return;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton) return;\n const offsetDir = element.getAttribute(\"data-move\");\n const sign = element.getAttribute(\"data-sign\");\n $44ae6d9db4eaca0f$var$reqAnimFrame = requestAnimationFrame($44ae6d9db4eaca0f$var$moveText(offsetDir, sign, index));\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerPointerup = (evt)=>{\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton) return;\n cancelAnimationFrame($44ae6d9db4eaca0f$var$reqAnimFrame);\n $44ae6d9db4eaca0f$var$reqAnimFrame = null;\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerPointerout = (evt)=>{\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton || !$44ae6d9db4eaca0f$var$reqAnimFrame) return;\n cancelAnimationFrame($44ae6d9db4eaca0f$var$reqAnimFrame);\n $44ae6d9db4eaca0f$var$reqAnimFrame = null;\n};\nconst $44ae6d9db4eaca0f$var$handleGalleryClick = async (evt)=>{\n const button = evt.target.closest(\"button\");\n if (!button) return;\n const img = button.querySelector(\"img\");\n try {\n const file = await (0, $008970865eefc93d$export$6539e087749cf9d3)({\n url: img.src\n }).catch((err)=>(0, $166cfb2484b08c80$export$af04143326425dbd)(err.message, \"danger\"));\n if (file) $44ae6d9db4eaca0f$var$handleFileSelect(file);\n } catch (err) {\n (0, $166cfb2484b08c80$export$af04143326425dbd)(`Failed to load image: \"${img.alt}\".`, \"danger\");\n }\n};\nconst $44ae6d9db4eaca0f$var$handleGallerySearchInput = (evt)=>{\n const query = evt.target.value.toLowerCase().trim();\n const galleryItems = $44ae6d9db4eaca0f$var$galleryEl.querySelectorAll(\"button\");\n galleryItems.forEach((item)=>{\n const alt = (item.querySelector(\"img\").getAttribute(\"alt\") || \"\").toLowerCase();\n item.hidden = !alt.includes(query);\n });\n $44ae6d9db4eaca0f$var$galleryNoResultsEl.hidden = !!$44ae6d9db4eaca0f$var$galleryEl.querySelector(\"button:not([hidden])\");\n};\nconst $44ae6d9db4eaca0f$var$handleWebShareError = ()=>{\n $44ae6d9db4eaca0f$var$downloadModal.open = false;\n (0, $166cfb2484b08c80$export$af04143326425dbd)(\"There was an error while trying to share your meme.\", \"danger\");\n};\nconst $44ae6d9db4eaca0f$var$handleCapturePhotoError = (evt)=>{\n console.error(evt.detail.error);\n (0, $166cfb2484b08c80$export$af04143326425dbd)(evt.detail.error.message, \"danger\");\n};\nconst $44ae6d9db4eaca0f$var$handleCapturePhotoSuccess = (evt)=>{\n $44ae6d9db4eaca0f$var$videoModal.open = false;\n const image = new Image();\n image.addEventListener(\"load\", $44ae6d9db4eaca0f$var$onImageLoaded);\n image.src = evt.detail.dataURI;\n};\nconst $44ae6d9db4eaca0f$var$handleModalOpen = (evt)=>{\n if (evt.target.id === \"videoModal\") {\n const capturePhotoComponent = $44ae6d9db4eaca0f$var$videoModal.querySelector(\"capture-photo\");\n if (capturePhotoComponent && typeof capturePhotoComponent.startVideoStream === \"function\") capturePhotoComponent.startVideoStream();\n }\n};\nconst $44ae6d9db4eaca0f$var$handleModalClose = (evt)=>{\n if (evt.target.id === \"videoModal\") {\n const capturePhotoComponent = $44ae6d9db4eaca0f$var$videoModal.querySelector(\"capture-photo\");\n if (capturePhotoComponent && typeof capturePhotoComponent.stopVideoStream === \"function\") capturePhotoComponent.stopVideoStream();\n }\n};\n$44ae6d9db4eaca0f$var$fileSelectBtn.addEventListener(\"click\", $44ae6d9db4eaca0f$var$handleFileSelectClick);\n$44ae6d9db4eaca0f$var$openVideoModalBtn.addEventListener(\"click\", $44ae6d9db4eaca0f$var$handleOpenVideoModalButtonClick);\n$44ae6d9db4eaca0f$var$addTextboxBtn.addEventListener(\"click\", $44ae6d9db4eaca0f$var$handleAddTextboxBtnClick);\n$44ae6d9db4eaca0f$var$generateMemeBtn.addEventListener(\"click\", $44ae6d9db4eaca0f$var$generateMeme);\n$44ae6d9db4eaca0f$var$downloadMemeBtn.addEventListener(\"click\", ()=>$44ae6d9db4eaca0f$var$downloadModal.open = false);\n$44ae6d9db4eaca0f$var$imageUrlForm.addEventListener(\"submit\", $44ae6d9db4eaca0f$var$handleImageUploadFromURL);\n$44ae6d9db4eaca0f$var$dropzoneEl.addEventListener(\"files-dropzone-drop-accepted\", $44ae6d9db4eaca0f$var$handleDropFilesAccepted);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"input\", $44ae6d9db4eaca0f$var$handleInputsContainerInput);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"change\", $44ae6d9db4eaca0f$var$handleInputsContainerChange);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"click\", $44ae6d9db4eaca0f$var$handleInputsContainerClick);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"pointerdown\", $44ae6d9db4eaca0f$var$handleInputsContainerPointerdown);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"pointerup\", $44ae6d9db4eaca0f$var$handleInputsContainerPointerup);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"pointerout\", $44ae6d9db4eaca0f$var$handleInputsContainerPointerout);\n$44ae6d9db4eaca0f$var$imageUploadMethodSelect.addEventListener(\"change\", $44ae6d9db4eaca0f$var$handleUploadMethodChange);\n$44ae6d9db4eaca0f$var$galleryEl.addEventListener(\"click\", $44ae6d9db4eaca0f$var$handleGalleryClick);\n$44ae6d9db4eaca0f$var$gallerySearchEl.addEventListener(\"input\", $44ae6d9db4eaca0f$var$handleGallerySearchInput);\n$44ae6d9db4eaca0f$var$solidColorForm.addEventListener(\"input\", $44ae6d9db4eaca0f$var$handleSolidColorFormInput);\ndocument.addEventListener(\"web-share:error\", $44ae6d9db4eaca0f$var$handleWebShareError);\ndocument.addEventListener(\"capture-photo:error\", $44ae6d9db4eaca0f$var$handleCapturePhotoError);\ndocument.addEventListener(\"capture-photo:success\", $44ae6d9db4eaca0f$var$handleCapturePhotoSuccess);\ndocument.addEventListener(\"me-open\", $44ae6d9db4eaca0f$var$handleModalOpen);\ndocument.addEventListener(\"me-close\", $44ae6d9db4eaca0f$var$handleModalClose);\n$44ae6d9db4eaca0f$var$galleryEl.querySelectorAll(\"button > img\")?.forEach((image)=>{\n image.setAttribute(\"title\", image.getAttribute(\"alt\"));\n});\n$44ae6d9db4eaca0f$var$textOptions.forEach((item, index)=>{\n $44ae6d9db4eaca0f$var$inputsContainer.appendChild((0, $50a37fdc18d479c2$export$293a4b86a6fe2398)(index, item));\n});\n$44ae6d9db4eaca0f$var$dropzoneEl.accept = (0, $33dea9d9a6da4c9a$export$63e7bed68b07a85c);\n(0, $055531bbd0af154c$export$6874249d87f2602a).forEach(({ name: name, path: path, style: style, weight: weight })=>{\n (0, $055531bbd0af154c$export$59eceaef0c7797b2)(name, path, {\n style: style,\n weight: weight\n });\n});\n\n})();\n//# sourceMappingURL=index.2a3e2367.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","\"use strict\";\n\nvar bundleURL = {};\nfunction getBundleURLCached(id) {\n var value = bundleURL[id];\n if (!value) {\n value = getBundleURL();\n bundleURL[id] = value;\n }\n return value;\n}\nfunction getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return getBaseURL(matches[2]);\n }\n }\n return '/';\n}\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction getOrigin(url) {\n var matches = ('' + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) {\n throw new Error('Origin not found');\n }\n return matches[0];\n}\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\nexports.getOrigin = getOrigin;","require('./helpers/bundle-manifest').register(require('./helpers/bundle-url').getBundleURL('8tAhj'),JSON.parse(\"[\\\"8tAhj\\\",\\\"index.2a3e2367.js\\\",\\\"cmj6F\\\",\\\"Anton-Regular.e58ab3fe.ttf\\\",\\\"a9OJN\\\",\\\"Oswald-Regular.89ec7d89.ttf\\\",\\\"jOuj0\\\",\\\"Oswald-Bold.0f6a7ca6.ttf\\\",\\\"ePq3V\\\",\\\"Roboto-Regular.ca197847.ttf\\\",\\\"9WQUU\\\",\\\"Roboto-Bold.fdb9b54a.ttf\\\",\\\"hIywO\\\",\\\"RobotoCondensed-Regular.d585f5c7.ttf\\\",\\\"ab1rw\\\",\\\"RobotoCondensed-Bold.e1f96d4b.ttf\\\",\\\"j4ruO\\\",\\\"CourierPrime-Regular.3a25a501.ttf\\\",\\\"3nnD2\\\",\\\"CourierPrime-Bold.3d6bf689.ttf\\\",\\\"8fsWK\\\",\\\"OpenSans-Regular.edf9e01b.ttf\\\",\\\"5JXG6\\\",\\\"OpenSans-Bold.8fceb72b.ttf\\\",\\\"9FH7D\\\",\\\"index.2d751096.css\\\"]\"));","import { isWebShareSupported } from '@georapbox/web-share-element/dist/is-web-share-supported.js';\nimport '@georapbox/web-share-element/dist/web-share-defined.js';\nimport '@georapbox/capture-photo-element/dist/capture-photo-defined.js';\nimport '@georapbox/modal-element/dist/modal-element-defined.js';\nimport '@georapbox/files-dropzone-element/dist/files-dropzone-defined.js';\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport '../css/main.css';\nimport { arrayRemove } from './utils/array-remove.js';\nimport { uid } from './utils/uid.js';\nimport { ACCEPTED_MIME_TYPES } from './constants.js';\nimport { customFonts, loadCustomFont } from './custom-fonts.js';\nimport { fileFromUrl } from './file-from-url.js';\nimport { toastAlert } from './toast-alert.js';\nimport { createTextBox } from './create-text-box.js';\nimport { drawCanvas } from './draw-canvas.js';\n\nconst videoModal = document.getElementById('videoModal');\nconst downloadModal = document.getElementById('downloadModal');\nconst canvas = document.getElementById('canvas');\nconst dropzoneEl = document.querySelector('files-dropzone');\nconst instructionsEl = document.getElementById('instructions');\nconst ctx = canvas.getContext('2d');\nconst imageUploadMethodSelect = document.getElementById('imageUploadMethodSelect');\nconst fileSelectBtn = document.getElementById('fileSelectBtn');\nconst imageUrlForm = document.getElementById('imageUrlForm');\nconst addTextboxBtn = document.getElementById('addTextboxBtn');\nconst inputsContainer = document.getElementById('inputsContainer');\nconst generateMemeBtn = document.getElementById('generateMemeBtn');\nconst openVideoModalBtn = document.getElementById('openVideoModalBtn');\nconst downloadMemeBtn = document.getElementById('downloadMemeBtn');\nconst downloadMemePreview = document.getElementById('downloadMemePreview');\nconst webShareComponent = document.querySelector('web-share');\nconst galleryEl = document.getElementById('gallery');\nconst gallerySearchEl = document.getElementById('gallerySearch');\nconst galleryNoResultsEl = galleryEl.querySelector('.gallery__no-results');\nconst solidColorForm = document.getElementById('solidColorForm');\nconst uploadMethodEls = document.querySelectorAll('.upload-method');\nlet selectedImage = null;\nlet reqAnimFrame = null;\n\nconst defaultTextOptions = {\n _isSettingsOpen: false,\n text: '',\n fillColor: '#ffffff',\n shadowColor: '#000000',\n font: 'Anton',\n fontSize: 40,\n fontWeight: 'normal',\n textAlign: 'center',\n shadowBlur: 3,\n offsetY: 0,\n offsetX: 0,\n rotate: 0,\n allCaps: true\n};\n\nlet textOptions = [\n { ...defaultTextOptions }\n];\n\nconst generateMeme = async () => {\n const dataUrl = canvas.toDataURL('image/png');\n\n // Prepare download link\n const downloadLink = dataUrl.replace('image/png', 'image/octet-stream');\n downloadMemeBtn.download = `${uid('meme')}.png`;\n downloadMemeBtn.href = downloadLink;\n downloadMemePreview.src = downloadLink;\n\n // Prepare for sharing file\n if (isWebShareSupported()) {\n try {\n const file = await fileFromUrl({\n url: dataUrl,\n filename: `${uid('meme')}.png`,\n mimeType: 'image/png'\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file && isWebShareSupported({ files: [file] })) {\n webShareComponent.shareFiles = [file];\n webShareComponent.hidden = false;\n }\n } catch (error) {\n console.error(error);\n }\n }\n\n downloadModal.open = true;\n};\n\nconst onImageLoaded = evt => {\n const MAX_WIDTH = 800;\n const MAX_HEIGHT = 600;\n let width = evt.target.width;\n let height = evt.target.height;\n\n if (width > height) {\n if (width > MAX_WIDTH) {\n height *= MAX_WIDTH / width;\n width = MAX_WIDTH;\n }\n } else {\n if (height > MAX_HEIGHT) {\n width *= MAX_HEIGHT / height;\n height = MAX_HEIGHT;\n }\n }\n canvas.width = width;\n canvas.height = height;\n\n selectedImage = evt.target;\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n generateMemeBtn.disabled = false;\n canvas.hidden = false;\n instructionsEl.hidden = true;\n};\n\nconst handleSolidColorFormInput = evt => {\n const DEFAULT_WIDTH = 600;\n const DEFAULT_HEIGHT = 400;\n\n if (evt.target === solidColorForm['canvasColor']) {\n selectedImage = evt.target.value;\n }\n\n if (typeof selectedImage === 'string') {\n canvas.width = Number(solidColorForm['canvasWidth'].value) || DEFAULT_WIDTH;\n canvas.height = Number(solidColorForm['canvasHeight'].value) || DEFAULT_HEIGHT;\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n generateMemeBtn.disabled = false;\n canvas.hidden = false;\n instructionsEl.hidden = true;\n }\n};\n\nconst handleFileSelect = file => {\n if (!file) {\n return;\n }\n\n const image = new Image();\n const reader = new FileReader();\n\n reader.addEventListener('load', function (evt) {\n const data = evt.target.result;\n image.addEventListener('load', onImageLoaded);\n image.src = data;\n });\n\n reader.readAsDataURL(file);\n};\n\nconst handleOpenVideoModalButtonClick = () => {\n videoModal.open = true;\n};\n\nconst handleTextPropChange = (element, index, prop) => {\n if (element.type === 'checkbox') {\n textOptions[index][prop] = element.checked;\n } else if (element.type === 'number') {\n textOptions[index][prop] = Number(element.value);\n } else {\n textOptions[index][prop] = element.value;\n }\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n};\n\nconst handleAddTextboxBtnClick = () => {\n const textOptionsLength = textOptions.length;\n const newTextBox = createTextBox(textOptionsLength, defaultTextOptions);\n\n textOptions.push({ ...defaultTextOptions });\n inputsContainer.appendChild(newTextBox);\n newTextBox.querySelector('[data-input=\"text\"]').focus();\n};\n\nconst handleImageUploadFromURL = async evt => {\n evt.preventDefault();\n\n const form = evt.target;\n const submitButton = form.querySelector('button[type=\"submit\"]');\n const imageUrl = form['imageUrl'].value;\n\n if (!imageUrl.trim()) {\n return;\n }\n\n submitButton.disabled = true;\n submitButton.querySelector('.spinner').hidden = false;\n submitButton.querySelector('.label').hidden = true;\n\n try {\n const file = await fileFromUrl({\n url: imageUrl\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file) {\n handleFileSelect(file);\n }\n } catch (err) {\n toastAlert(`Failed to load image from \"${imageUrl}\".`, 'danger');\n } finally {\n submitButton.disabled = false;\n submitButton.querySelector('.spinner').hidden = true;\n submitButton.querySelector('.label').hidden = false;\n }\n};\n\nconst moveText = (offsetDir, sign, index) => () => {\n const textBoxSection = document.querySelectorAll('[data-section=\"textBox\"]')[index];\n const offsetYInput = textBoxSection.querySelector('[data-input=\"offsetY\"]');\n const offsetXInput = textBoxSection.querySelector('[data-input=\"offsetX\"]');\n\n if (offsetDir === 'offsetY') {\n if (sign === '-') {\n textOptions[index].offsetY -= 1;\n }\n\n if (sign === '+') {\n textOptions[index].offsetY += 1;\n }\n\n offsetYInput.value = textOptions[index].offsetY;\n }\n\n if (offsetDir === 'offsetX') {\n if (sign === '-') {\n textOptions[index].offsetX -= 1;\n }\n\n if (sign === '+') {\n textOptions[index].offsetX += 1;\n }\n\n offsetXInput.value = textOptions[index].offsetX;\n }\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n reqAnimFrame = requestAnimationFrame(moveText(offsetDir, sign, index));\n};\n\nconst handleUploadMethodChange = evt => {\n uploadMethodEls.forEach(el => el.hidden = el.id !== evt.target.value);\n};\n\nconst handleFileSelectClick = () => {\n if (typeof dropzoneEl.openFileDialog === 'function') {\n dropzoneEl.openFileDialog();\n }\n};\n\nconst handleDropFilesAccepted = evt => {\n const [file] = evt.detail.acceptedFiles;\n\n if (file) {\n handleFileSelect(file);\n }\n};\n\nconst handleInputsContainerInput = evt => {\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let prop;\n\n if (element.matches('[data-input=\"text\"]')) {\n prop = 'text';\n } else if (element.matches('[data-input=\"fillColor\"]')) {\n prop = 'fillColor';\n } else if (element.matches('[data-input=\"shadowColor\"]')) {\n prop = 'shadowColor';\n } else if (element.matches('[data-input=\"font\"]')) {\n prop = 'font';\n } else if (element.matches('[data-input=\"fontSize\"]')) {\n prop = 'fontSize';\n } else if (element.matches('[data-input=\"fontWeight\"]')) {\n prop = 'fontWeight';\n } else if (element.matches('[data-input=\"textAlign\"]')) {\n prop = 'textAlign';\n } else if (element.matches('[data-input=\"shadowBlur\"]')) {\n prop = 'shadowBlur';\n } else if (element.matches('[data-input=\"offsetY\"]')) {\n prop = 'offsetY';\n } else if (element.matches('[data-input=\"offsetX\"]')) {\n prop = 'offsetX';\n } else if (element.matches('[data-input=\"rotate\"]')) {\n prop = 'rotate';\n }\n\n if (prop) {\n handleTextPropChange(element, index, prop);\n }\n};\n\nconst handleInputsContainerChange = evt => {\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let prop;\n\n if (element.matches('[data-input=\"allCaps\"]')) {\n prop = 'allCaps';\n }\n\n if (prop) {\n handleTextPropChange(element, index, prop);\n }\n};\n\nconst handleInputsContainerClick = evt => {\n const element = evt.target;\n\n if (element.matches('[data-button=\"settings\"]')) {\n const textBoxIndex = element.closest('[data-section=\"textBox\"]').getAttribute('data-index');\n const textBoxEls = document.querySelectorAll('[data-section=\"textBox\"]');\n\n textBoxEls.forEach((el, index) => {\n const settingsEl = el.querySelector('[data-section=\"settings\"]');\n\n if (el.getAttribute('data-index') === textBoxIndex) {\n settingsEl.hidden = !settingsEl.hidden;\n textOptions[index]._isSettingsOpen = !textOptions[index]._isSettingsOpen;\n } else {\n settingsEl.hidden = true;\n textOptions[index]._isSettingsOpen = false;\n }\n });\n }\n\n if (element.matches('[data-button=\"delete-text-box\"]')) {\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let confirm = true;\n\n if (textOptions[index].text.trim()) {\n confirm = window.confirm('Are you sure you want to remove this text box?');\n }\n\n if (confirm) {\n textOptions = arrayRemove(textOptions, index);\n inputsContainer.querySelectorAll('[data-section=\"textBox\"]').forEach(el => el.remove());\n textOptions.forEach((item, index) => inputsContainer.appendChild(createTextBox(index, item)));\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n }\n }\n};\n\nconst handleInputsContainerPointerdown = evt => {\n const element = evt.target;\n const textBoxEl = element.closest('[data-section=\"textBox\"]');\n\n if (!textBoxEl) {\n return;\n }\n\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton) {\n return;\n }\n\n const offsetDir = element.getAttribute('data-move');\n const sign = element.getAttribute('data-sign');\n\n reqAnimFrame = requestAnimationFrame(moveText(offsetDir, sign, index));\n};\n\nconst handleInputsContainerPointerup = evt => {\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton) {\n return;\n }\n\n cancelAnimationFrame(reqAnimFrame);\n reqAnimFrame = null;\n};\n\nconst handleInputsContainerPointerout = evt => {\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton || !reqAnimFrame) {\n return;\n }\n\n cancelAnimationFrame(reqAnimFrame);\n reqAnimFrame = null;\n};\n\nconst handleGalleryClick = async evt => {\n const button = evt.target.closest('button');\n\n if (!button) {\n return;\n }\n\n const img = button.querySelector('img');\n\n try {\n const file = await fileFromUrl({\n url: img.src\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file) {\n handleFileSelect(file);\n }\n } catch (err) {\n toastAlert(`Failed to load image: \"${img.alt}\".`, 'danger');\n }\n};\n\nconst handleGallerySearchInput = evt => {\n const query = evt.target.value.toLowerCase().trim();\n const galleryItems = galleryEl.querySelectorAll('button');\n\n galleryItems.forEach(item => {\n const alt = (item.querySelector('img').getAttribute('alt') || '').toLowerCase();\n item.hidden = !alt.includes(query);\n });\n\n galleryNoResultsEl.hidden = !!galleryEl.querySelector('button:not([hidden])');\n};\n\nconst handleWebShareError = () => {\n downloadModal.open = false;\n toastAlert('There was an error while trying to share your meme.', 'danger');\n};\n\nconst handleCapturePhotoError = evt => {\n console.error(evt.detail.error);\n toastAlert(evt.detail.error.message, 'danger');\n};\n\nconst handleCapturePhotoSuccess = evt => {\n videoModal.open = false;\n const image = new Image();\n image.addEventListener('load', onImageLoaded);\n image.src = evt.detail.dataURI;\n};\n\nconst handleModalOpen = evt => {\n if (evt.target.id === 'videoModal') {\n const capturePhotoComponent = videoModal.querySelector('capture-photo');\n\n if (capturePhotoComponent && typeof capturePhotoComponent.startVideoStream === 'function') {\n capturePhotoComponent.startVideoStream();\n }\n }\n};\n\nconst handleModalClose = evt => {\n if (evt.target.id === 'videoModal') {\n const capturePhotoComponent = videoModal.querySelector('capture-photo');\n\n if (capturePhotoComponent && typeof capturePhotoComponent.stopVideoStream === 'function') {\n capturePhotoComponent.stopVideoStream();\n }\n }\n};\n\nfileSelectBtn.addEventListener('click', handleFileSelectClick);\nopenVideoModalBtn.addEventListener('click', handleOpenVideoModalButtonClick);\naddTextboxBtn.addEventListener('click', handleAddTextboxBtnClick);\ngenerateMemeBtn.addEventListener('click', generateMeme);\ndownloadMemeBtn.addEventListener('click', () => downloadModal.open = false);\nimageUrlForm.addEventListener('submit', handleImageUploadFromURL);\ndropzoneEl.addEventListener('files-dropzone-drop-accepted', handleDropFilesAccepted);\ninputsContainer.addEventListener('input', handleInputsContainerInput);\ninputsContainer.addEventListener('change', handleInputsContainerChange);\ninputsContainer.addEventListener('click', handleInputsContainerClick);\ninputsContainer.addEventListener('pointerdown', handleInputsContainerPointerdown);\ninputsContainer.addEventListener('pointerup', handleInputsContainerPointerup);\ninputsContainer.addEventListener('pointerout', handleInputsContainerPointerout);\nimageUploadMethodSelect.addEventListener('change', handleUploadMethodChange);\ngalleryEl.addEventListener('click', handleGalleryClick);\ngallerySearchEl.addEventListener('input', handleGallerySearchInput);\nsolidColorForm.addEventListener('input', handleSolidColorFormInput);\ndocument.addEventListener('web-share:error', handleWebShareError);\ndocument.addEventListener('capture-photo:error', handleCapturePhotoError);\ndocument.addEventListener('capture-photo:success', handleCapturePhotoSuccess);\ndocument.addEventListener('me-open', handleModalOpen);\ndocument.addEventListener('me-close', handleModalClose);\n\ngalleryEl.querySelectorAll('button > img')?.forEach(image => {\n image.setAttribute('title', image.getAttribute('alt'));\n});\n\ntextOptions.forEach((item, index) => {\n inputsContainer.appendChild(createTextBox(index, item));\n});\n\ndropzoneEl.accept = ACCEPTED_MIME_TYPES;\n\ncustomFonts.forEach(({ name, path, style, weight }) => {\n loadCustomFont(name, path, { style, weight });\n});\n","function a(a){return null!==a&&\"object\"==typeof a?\"share\"in navigator&&\"canShare\"in navigator&&navigator.canShare(a):\"share\"in navigator}export{a as isWebShareSupported};\n//# sourceMappingURL=is-web-share-supported.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $e179325634270afd$exports = {};\n\n$parcel$export($e179325634270afd$exports, \"WebShare\", function () { return $e179325634270afd$export$30b344bef3e55b67; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ /**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */ const $e179325634270afd$var$styles = /* css */ `\n :host {\n display: inline-block;\n }\n`;\nconst $e179325634270afd$var$template = document.createElement(\"template\");\n$e179325634270afd$var$template.innerHTML = /* html */ `\n \n \n`;\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */ class $e179325634270afd$export$30b344bef3e55b67 extends HTMLElement {\n /** @type {Nullable} */ #buttonSlot;\n /** @type {Nullable} */ #buttonEl;\n /** @type {File[]} */ #files = [];\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\",\n delegatesFocus: true\n });\n shadowRoot.appendChild($e179325634270afd$var$template.content.cloneNode(true));\n }\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"disabled\" && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute(\"disabled\", this.disabled);\n this.#buttonEl.setAttribute(\"aria-disabled\", this.disabled.toString());\n if (this.#buttonEl.part && this.#buttonEl.part.contains(\"button\")) this.#buttonEl.part.toggle(\"button--disabled\", this.disabled);\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"shareUrl\");\n this.#upgradeProperty(\"shareTitle\");\n this.#upgradeProperty(\"shareText\");\n this.#upgradeProperty(\"shareFiles\");\n this.#upgradeProperty(\"disabled\");\n this.#buttonSlot?.addEventListener(\"slotchange\", this.#handleSlotChange);\n this.#buttonEl?.addEventListener(\"click\", this.#handleClick);\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#buttonSlot?.removeEventListener(\"slotchange\", this.#handleSlotChange);\n this.#buttonEl?.removeEventListener(\"click\", this.#handleClick);\n }\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */ get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(value) {\n this.toggleAttribute(\"disabled\", !!value);\n }\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */ get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(value) {\n this.setAttribute(\"share-url\", value);\n }\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */ get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(value) {\n this.setAttribute(\"share-title\", value);\n }\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */ get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(value) {\n this.setAttribute(\"share-text\", value);\n }\n /**\n * @type {File[]} - The files to share.\n */ get shareFiles() {\n return this.#files;\n }\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) this.#files = value;\n }\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */ async share() {\n if (this.disabled) return;\n try {\n /** @type {ShareData} */ const shareData = {};\n if (this.shareUrl) shareData.url = this.shareUrl;\n if (this.shareTitle) shareData.title = this.shareTitle;\n if (this.shareText) shareData.text = this.shareText;\n if (Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n })) shareData.files = this.shareFiles;\n await navigator.share(shareData);\n this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: true,\n composed: true,\n detail: {\n shareData: shareData\n }\n }));\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n }\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */ #handleClick = (evt)=>{\n evt.preventDefault();\n if (this.disabled) return;\n this.share();\n };\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */ #handleSlotChange = (evt)=>{\n if (evt.target && evt.target.name === \"button\") {\n this.#buttonEl?.removeEventListener(\"click\", this.#handleClick);\n this.#buttonEl = this.#getButton();\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener(\"click\", this.#handleClick);\n if (this.#buttonEl.nodeName !== \"BUTTON\" && !this.#buttonEl.hasAttribute(\"role\")) this.#buttonEl.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */ #getButton() {\n if (!this.#buttonSlot) return null;\n return this.#buttonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"button\";\n }) || null;\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"web-share\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $e179325634270afd$export$30b344bef3e55b67);\n }\n}\n\n\n(0, $e179325634270afd$export$30b344bef3e55b67).defineCustomElement();\n\n\nexport {$e179325634270afd$export$30b344bef3e55b67 as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","// @ts-check\n\n/**\n * Check if Web Share API is supported by the platform.\n *\n * @param {import('./web-share').ShareData} [options]\n * @returns {boolean} Returns `true` if Web Share API is supported; otherwise `false`.\n */\nfunction isWebShareSupported(options) {\n if (options !== null && typeof options === 'object') {\n return 'share' in navigator && 'canShare' in navigator && navigator.canShare(options);\n }\n\n return 'share' in navigator;\n}\n\nexport { isWebShareSupported };\n","Object.defineProperty({},\"WebShare\",{get:function(){return s},set:void 0,enumerable:!0,configurable:!0});let t=`\n :host {\n display: inline-block;\n }\n`,e=document.createElement(\"template\");e.innerHTML=`\n \n \n`;class s extends HTMLElement{#t;#e;#s=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(e.content.cloneNode(!0)),this.#t=this.shadowRoot?.querySelector('slot[name=\"button\"]')||null,this.#e=this.#i()}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,e,s){\"disabled\"===t&&e!==s&&this.#e&&(this.#e.toggleAttribute(\"disabled\",this.disabled),this.#e.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#e.part&&this.#e.part.contains(\"button\")&&this.#e.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#r(\"shareUrl\"),this.#r(\"shareTitle\"),this.#r(\"shareText\"),this.#r(\"shareFiles\"),this.#r(\"disabled\"),this.#t?.addEventListener(\"slotchange\",this.#a),this.#e?.addEventListener(\"click\",this.#n)}disconnectedCallback(){this.#t?.removeEventListener(\"slotchange\",this.#a),this.#e?.removeEventListener(\"click\",this.#n)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get shareUrl(){return this.getAttribute(\"share-url\")||\"\"}set shareUrl(t){this.setAttribute(\"share-url\",t)}get shareTitle(){return this.getAttribute(\"share-title\")||\"\"}set shareTitle(t){this.setAttribute(\"share-title\",t)}get shareText(){return this.getAttribute(\"share-text\")||\"\"}set shareText(t){this.setAttribute(\"share-text\",t)}get shareFiles(){return this.#s}set shareFiles(t){Array.isArray(t)&&t.length>0&&(this.#s=t)}async share(){if(!this.disabled)try{let t={};this.shareUrl&&(t.url=this.shareUrl),this.shareTitle&&(t.title=this.shareTitle),this.shareText&&(t.text=this.shareText),Array.isArray(this.shareFiles)&&this.shareFiles.length>0&&navigator.canShare&&navigator.canShare({files:this.shareFiles})&&(t.files=this.shareFiles),await navigator.share(t),this.dispatchEvent(new CustomEvent(\"web-share:success\",{bubbles:!0,composed:!0,detail:{shareData:t}}))}catch(t){if(t instanceof Error&&\"AbortError\"===t.name){this.dispatchEvent(new CustomEvent(\"web-share:abort\",{bubbles:!0,composed:!0,detail:{error:t}}));return}this.dispatchEvent(new CustomEvent(\"web-share:error\",{bubbles:!0,composed:!0,detail:{error:t}}))}}#n=t=>{t.preventDefault(),this.disabled||this.share()};#a=t=>{t.target&&\"button\"===t.target.name&&(this.#e?.removeEventListener(\"click\",this.#n),this.#e=this.#i(),this.#e&&(this.#e.addEventListener(\"click\",this.#n),\"BUTTON\"===this.#e.nodeName||this.#e.hasAttribute(\"role\")||this.#e.setAttribute(\"role\",\"button\")))};#i(){return this.#t&&this.#t.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"button\"===t.getAttribute(\"slot\"))||null}#r(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}static defineCustomElement(t=\"web-share\"){\"undefined\"==typeof window||window.customElements.get(t)||window.customElements.define(t,s)}}s.defineCustomElement();export{s as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","import { WebShare } from './web-share.js';\n\nWebShare.defineCustomElement();\n\nexport { WebShare };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */\n\nconst styles = /* css */`\n :host {\n display: inline-block;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */\nclass WebShare extends HTMLElement {\n /** @type {Nullable} */\n #buttonSlot;\n\n /** @type {Nullable} */\n #buttonEl;\n\n /** @type {File[]} */\n #files = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute('disabled', this.disabled);\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part && this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('shareUrl');\n this.#upgradeProperty('shareTitle');\n this.#upgradeProperty('shareText');\n this.#upgradeProperty('shareFiles');\n this.#upgradeProperty('disabled');\n\n this.#buttonSlot?.addEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n }\n\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */\n get shareUrl() {\n return this.getAttribute('share-url') || '';\n }\n\n set shareUrl(value) {\n this.setAttribute('share-url', value);\n }\n\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */\n get shareTitle() {\n return this.getAttribute('share-title') || '';\n }\n\n set shareTitle(value) {\n this.setAttribute('share-title', value);\n }\n\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */\n get shareText() {\n return this.getAttribute('share-text') || '';\n }\n\n set shareText(value) {\n this.setAttribute('share-text', value);\n }\n\n /**\n * @type {File[]} - The files to share.\n */\n get shareFiles() {\n return this.#files;\n }\n\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) {\n this.#files = value;\n }\n }\n\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */\n async share() {\n if (this.disabled) {\n return;\n }\n\n try {\n /** @type {ShareData} */\n const shareData = {};\n\n if (this.shareUrl) {\n shareData.url = this.shareUrl;\n }\n\n if (this.shareTitle) {\n shareData.title = this.shareTitle;\n }\n\n if (this.shareText) {\n shareData.text = this.shareText;\n }\n\n if (\n Array.isArray(this.shareFiles)\n && this.shareFiles.length > 0\n && navigator.canShare\n && navigator.canShare({ files: this.shareFiles })\n ) {\n shareData.files = this.shareFiles;\n }\n\n await navigator.share(shareData);\n\n this.dispatchEvent(new CustomEvent('web-share:success', {\n bubbles: true,\n composed: true,\n detail: { shareData }\n }));\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n this.dispatchEvent(new CustomEvent('web-share:abort', {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n\n return;\n }\n\n this.dispatchEvent(new CustomEvent('web-share:error', {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n }\n\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n this.share();\n };\n\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */\n #handleSlotChange = evt => {\n if (evt.target && evt.target.name === 'button') {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n this.#buttonEl = this.#getButton();\n\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener('click', this.#handleClick);\n\n if (this.#buttonEl.nodeName !== 'BUTTON' && !this.#buttonEl.hasAttribute('role')) {\n this.#buttonEl.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */\n #getButton() {\n if (!this.#buttonSlot) {\n return null;\n }\n\n return this.#buttonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'button';\n }) || null;\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'web-share') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, WebShare);\n }\n }\n}\n\nexport { WebShare };\n","Object.defineProperty({},\"CapturePhoto\",{get:function(){return n},set:void 0,enumerable:!0,configurable:!0});let t=(t,e,i)=>(Number.isNaN(e)&&(e=0),Number.isNaN(i)&&(i=0),Math.min(Math.max(t,Math.min(e,i)),Math.max(e,i))),e=\"capture-photo\",i=`\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`,o=document.createElement(\"template\");o.innerHTML=`\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;class n extends HTMLElement{#t={};#e=null;#i=null;#o=null;#n=null;#a=null;#s=null;#r=null;#l=null;constructor(){super(),this.#t=this.getSupportedConstraints(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(o.content.cloneNode(!0))}static get observedAttributes(){return[\"no-image\",\"facing-mode\",\"camera-resolution\",\"pan\",\"tilt\",\"zoom\"]}attributeChangedCallback(t,e,i){if(!this.isConnected)return;let o=this.getTrackCapabilities(),n=this.getTrackSettings();if(\"no-image\"===t&&e!==i&&this.#u(),\"facing-mode\"===t&&e!==i&&\"facingMode\"in this.#t){let t=[\"user\",\"environment\"].includes(this.facingMode||\"\");\"facingMode\"in n&&t&&(this.stopVideoStream(),this.startVideoStream())}if(\"camera-resolution\"===t&&e!==i&&\"string\"==typeof this.cameraResolution&&this.cameraResolution.trim().length>0){let[t=0,e=0]=this.cameraResolution.split(\"x\").map(t=>Number(t));if(t>0&&e>0&&\"width\"in o&&\"height\"in o){let i=!!(o.width?.min&&o.width?.max)&&t>=o?.width?.min&&t<=o?.width?.max,a=!!(o.height?.min&&o.height?.max)&&e>=o?.height?.min&&e<=o?.height?.max;\"width\"in n&&\"height\"in n&&i&&a&&(this.stopVideoStream(),this.startVideoStream())}}if(\"pan\"===t&&e!==i&&\"pan\"in this.#t){let t=!!(\"pan\"in o&&o.pan?.min&&o.pan?.max)&&this.pan>=o.pan.min&&this.pan<=o.pan.max;\"pan\"in n&&\"number\"==typeof this.pan&&t&&this.#h(\"pan\",this.pan)}if(\"tilt\"===t&&e!==i&&\"tilt\"in this.#t){let t=!!(\"tilt\"in o&&o.tilt?.min&&o.tilt?.max)&&this.tilt>=o.tilt.min&&this.tilt<=o.tilt.max;\"tilt\"in n&&\"number\"==typeof this.tilt&&t&&this.#h(\"tilt\",this.tilt)}if(\"zoom\"===t&&e!==i&&\"zoom\"in this.#t){let t=!!(\"zoom\"in o&&o.zoom?.min&&o.zoom?.max)&&this.zoom>=o.zoom.min&&this.zoom<=o.zoom.max;\"zoom\"in n&&\"number\"==typeof this.zoom&&t&&this.#h(\"zoom\",this.zoom)}}connectedCallback(){if(this.#d(\"autpoPlay\"),this.#d(\"noImage\"),this.#d(\"facingMode\"),this.#d(\"cameraResolution\"),this.#d(\"pan\"),this.#d(\"tilt\"),this.#d(\"zoom\"),this.#d(\"calculateFileSize\"),this.#i=this.shadowRoot?.querySelector(\"canvas\")||null,this.#o=this.shadowRoot?.getElementById(\"output\")||null,this.#n=this.shadowRoot?.querySelector(\"video\")||null,this.#a=this.shadowRoot?.querySelector('slot[name=\"capture-button\"]')||null,this.#s=this.#c(),this.#r=this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]')||null,this.#l=this.#m(),this.#n?.addEventListener(\"loadedmetadata\",this.#p),this.#a?.addEventListener(\"slotchange\",this.#g),this.#s?.addEventListener(\"click\",this.#b),this.#r?.addEventListener(\"slotchange\",this.#f),this.#l?.addEventListener(\"click\",this.#v),!n.isSupported())return this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:{name:\"NotSupportedError\",message:\"Not supported\"}}}));this.autoPlay&&this.startVideoStream()}disconnectedCallback(){this.stopVideoStream(),this.#l?.removeEventListener(\"click\",this.#v),this.#s?.removeEventListener(\"click\",this.#b),this.#n?.removeEventListener(\"canplay\",this.#p),this.#a?.removeEventListener(\"slotchange\",this.#g),this.#r?.removeEventListener(\"slotchange\",this.#f)}get autoPlay(){return this.hasAttribute(\"auto-play\")}set autoPlay(t){this.toggleAttribute(\"auto-play\",!!t)}get noImage(){return this.hasAttribute(\"no-image\")}set noImage(t){this.toggleAttribute(\"no-image\",!!t)}get facingMode(){return this.getAttribute(\"facing-mode\")||\"user\"}set facingMode(t){this.setAttribute(\"facing-mode\",t)}get cameraResolution(){return this.getAttribute(\"camera-resolution\")||\"\"}set cameraResolution(t){this.setAttribute(\"camera-resolution\",t)}get pan(){return Number(this.getAttribute(\"pan\"))||0}set pan(t){this.setAttribute(\"pan\",null!=t?t.toString():t)}get tilt(){return Number(this.getAttribute(\"tilt\"))||0}set tilt(t){this.setAttribute(\"tilt\",null!=t?t.toString():t)}get zoom(){return Number(this.getAttribute(\"zoom\"))||1}set zoom(t){this.setAttribute(\"zoom\",null!=t?t.toString():t)}get loading(){return this.hasAttribute(\"loading\")}get calculateFileSize(){return this.hasAttribute(\"calculate-file-size\")}set calculateFileSize(t){this.toggleAttribute(\"calculate-file-size\",!!t)}#v=t=>{t.preventDefault(),this.loading||(this.facingMode=\"user\"!==this.facingMode&&this.facingMode?\"user\":\"environment\")};#b=t=>{t.preventDefault(),this.capture()};#p=t=>{let i=t.target;i.play().then(()=>{this.dispatchEvent(new CustomEvent(`${e}:video-play`,{bubbles:!0,composed:!0,detail:{video:i}}))}).catch(t=>{this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}).finally(()=>{this.removeAttribute(\"loading\")})};#u(){this.#o&&Array.from(this.#o.childNodes).forEach(t=>t.remove())}#h(e,i){if(!this.#e||!e||!i)return;let[o]=this.#e.getVideoTracks(),n=this.getTrackCapabilities();e in this.getTrackSettings()&&o.applyConstraints({advanced:[{[e]:t(Number(i),n[e]?.min||1,n[e]?.max||1)}]})}#g=t=>{t.target?.name===\"capture-button\"&&(this.#s?.removeEventListener(\"click\",this.#b),this.#s=this.#c(),this.#s&&(this.#s.addEventListener(\"click\",this.#b),\"BUTTON\"===this.#s.nodeName||this.#s.hasAttribute(\"role\")||this.#s.setAttribute(\"role\",\"button\")))};#f=t=>{t.target?.name===\"facing-mode-button\"&&(this.#l?.removeEventListener(\"click\",this.#v),this.#l=this.#m(),this.#l&&(this.#l.addEventListener(\"click\",this.#v),\"BUTTON\"===this.#l.nodeName||this.#l.hasAttribute(\"role\")||this.#l.setAttribute(\"role\",\"button\")))};#m(){return this.#r&&this.#r.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"facing-mode-button\"===t.getAttribute(\"slot\"))||null}#c(){return this.#a&&this.#a.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"capture-button\"===t.getAttribute(\"slot\"))||null}#d(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}async startVideoStream(){if(!n.isSupported()||this.#e)return;this.setAttribute(\"loading\",\"\");let t={video:{facingMode:{ideal:this.facingMode||\"user\"},pan:!0,tilt:!0,zoom:!0},audio:!1};if(\"string\"==typeof this.cameraResolution&&this.cameraResolution.trim().length>0){let[e=0,i=0]=this.cameraResolution.split(\"x\").map(t=>Number(t));e>0&&i>0&&(t.video.width=e,t.video.height=i)}try{this.#e=await navigator.mediaDevices.getUserMedia(t),this.#n&&(this.#n.srcObject=this.#e),this.#h(\"pan\",this.pan),this.#h(\"tilt\",this.tilt),this.#h(\"zoom\",this.zoom);let e=this.getTrackSettings();\"facingMode\"in e&&this.#r&&(this.#r.hidden=!1)}catch(t){this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}finally{this.removeAttribute(\"loading\")}}stopVideoStream(){if(!this.#n||!this.#e)return;let[t]=this.#e.getVideoTracks();t?.stop(),this.#n.srcObject=null,this.#e=null}async capture(){if(!this.loading&&this.#i&&this.#n)try{let t=this.#i.getContext(\"2d\"),i=this.#n.videoWidth,o=this.#n.videoHeight;this.#i.width=i,this.#i.height=o,t?.drawImage(this.#n,0,0,i,o);let n=this.#i.toDataURL(\"image/png\");if(\"string\"==typeof n&&n.includes(\"data:image\")){if(!this.noImage){let t=new Image;t.src=n,t.width=i,t.height=o,t.setAttribute(\"part\",\"output-image\"),this.#u(),this.#o?.appendChild(t)}let t={dataURI:n,width:i,height:o};if(this.calculateFileSize)try{let e=await fetch(n),i=(await e.blob()).size;i&&(t.size=i)}catch(t){}this.dispatchEvent(new CustomEvent(`${e}:success`,{bubbles:!0,composed:!0,detail:t}))}}catch(t){this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}getSupportedConstraints(){return n.isSupported()&&navigator.mediaDevices.getSupportedConstraints()||{}}getTrackCapabilities(){if(!this.#e)return{};let[t]=this.#e.getVideoTracks();return t&&\"function\"==typeof t.getCapabilities&&t.getCapabilities()||{}}getTrackSettings(){if(!this.#e)return{};let[t]=this.#e.getVideoTracks();return t&&\"function\"==typeof t.getSettings&&t.getSettings()||{}}static isSupported(){return!!navigator.mediaDevices?.getUserMedia}static defineCustomElement(t=e){\"undefined\"==typeof window||window.customElements.get(t)||window.customElements.define(t,n)}}n.defineCustomElement();export{n as CapturePhoto};\n//# sourceMappingURL=capture-photo-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $c290816263f90981$exports = {};\n\n$parcel$export($c290816263f90981$exports, \"CapturePhoto\", function () { return $c290816263f90981$export$cc30a98fe3890794; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ /**\n * @typedef {Object} ExtendedMediaTrackCapabilities\n * @property {ULongRange} [width] - The width of the video track.\n * @property {ULongRange} [height] - The height of the video track.\n * @property {ULongRange} [pan] - The pan level of the camera.\n * @property {ULongRange} [tilt] - The tilt level of the camera.\n * @property {ULongRange} [zoom] - The zoom level of the camera.\n * @property {MediaTrackCapabilities} [nativeMediaTrackCapabilities] - The native track capabilities.\n */ /**\n * @typedef {Object} ExtendedMediaTrackConstraints\n * @property {MediaTrackConstraints & {pan: boolean, tilt: boolean, zoom: boolean}} video - The video constraints.\n * @property {MediaTrackConstraints | boolean} audio - The audio constraints.\n */ // @ts-check\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */ const $02ad8beec419df62$export$7d15b64cf5a3a4c4 = (value, lower, upper)=>{\n if (Number.isNaN(lower)) lower = 0;\n if (Number.isNaN(upper)) upper = 0;\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n\n\nconst $c290816263f90981$var$COMPONENT_NAME = \"capture-photo\";\nconst $c290816263f90981$var$styles = /* css */ `\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`;\nconst $c290816263f90981$var$template = document.createElement(\"template\");\n$c290816263f90981$var$template.innerHTML = /* html */ `\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\n/**\n * @summary A custom element that implements the MediaDevices.getUserMedia() method of the MediaDevices interface to capture a photo in the browser.\n * @documentation https://github.com/georapbox/capture-photo-element\n *\n * @tagname capture-photo This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @property {boolean} noImage - Whether or not to show the captured image.\n * @property {string} facingMode - The facing mode of the camera.\n * @property {string} cameraResolution - The resolution of the camera.\n * @property {number} pan - The pan value of the camera.\n * @property {number} tilt - The tilt value of the camera.\n * @property {number} zoom - The zoom value of the camera.\n * @property {boolean} loading - Whether or not the video stream is loading.\n * @property {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n *\n * @atttribute {boolean} auto-play - Reflects the autoPlay property.\n * @atttribute {boolean} no-image - Reflects the noImage property.\n * @atttribute {string} facing-mode - Reflects the facingMode property.\n * @atttribute {string} camera-resolution - Reflects the cameraResolution property.\n * @atttribute {number} pan - Reflects the pan property.\n * @atttribute {number} tilt - Reflects the tilt property.\n * @atttribute {number} zoom - Reflects the zoom property.\n * @atttribute {boolean} loading - Reflects the loading property.\n * @atttribute {boolean} calculate-file-size - Reflects the calculateFileSize property.\n *\n * @slot capture-button - The capture button.\n * @slot capture-button-content - The capture button content.\n * @slot facing-mode-button - The facing mode button.\n * @slot facing-mode-button-content - The facing mode button content.\n * @slot actions - The actions container.\n * @slot - A default un-named slot to add content inside the component.\n *\n * @csspart video - The video element.\n * @csspart actions-container - The actions container.\n * @csspart capture-button - The capture button.\n * @csspart facing-mode-button - The facing mode button.\n * @csspart output-container - The output container.\n * @csspart output-image - The output image.\n *\n * @event capture-photo:video-play - Fires when the video stream is successfully playing.\n * @event capture-photo:success - Fires when the photo is successfully captured.\n * @event capture-photo:error - Fires when an error occurs.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method isSupported - Static method. Checks if the MediaDevices.getUserMedia() method is supported.\n * @method startVideoStream - Instance method. Starts the video stream.\n * @method stopVideoStream - Instance method. Stops the video stream.\n * @method capture - Instance method. Captures a photo.\n * @method getSupportedConstraints - Instance method. Gets the supported constraints.\n * @method getTrackCapabilities - Instance method. Gets the track capabilities.\n * @method getTrackSettings - Instance method. Gets the track settings.\n */ class $c290816263f90981$export$cc30a98fe3890794 extends HTMLElement {\n /** @type {MediaTrackSupportedConstraints | {}}*/ #supportedConstraints = {};\n /** @type {Nullable} */ #stream = null;\n /** @type {Nullable} */ #canvasElement = null;\n /** @type {Nullable} */ #outputElement = null;\n /** @type {Nullable} */ #videoElement = null;\n /** @type {Nullable} */ #captureButtonSlot = null;\n /** @type {Nullable} */ #captureButton = null;\n /** @type {Nullable} */ #facingModeButtonSlot = null;\n /** @type {Nullable} */ #facingModeButton = null;\n constructor(){\n super();\n this.#supportedConstraints = this.getSupportedConstraints();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($c290816263f90981$var$template.content.cloneNode(true));\n }\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"facing-mode\",\n \"camera-resolution\",\n \"pan\",\n \"tilt\",\n \"zoom\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) return;\n /** @type {ExtendedMediaTrackCapabilities} */ const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n if (name === \"no-image\" && oldValue !== newValue) this.#emptyOutputElement();\n if (name === \"facing-mode\" && oldValue !== newValue && \"facingMode\" in this.#supportedConstraints) {\n const isValidFacingMode = [\n \"user\",\n \"environment\"\n ].includes(this.facingMode || \"\");\n if (\"facingMode\" in trackSettings && isValidFacingMode) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n if (name === \"camera-resolution\" && oldValue !== newValue) {\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0 && \"width\" in trackCapabilities && \"height\" in trackCapabilities) {\n const widthInAllowedRange = trackCapabilities.width?.min && trackCapabilities.width?.max ? width >= trackCapabilities?.width?.min && width <= trackCapabilities?.width?.max : false;\n const heightInAllowedRange = trackCapabilities.height?.min && trackCapabilities.height?.max ? height >= trackCapabilities?.height?.min && height <= trackCapabilities?.height?.max : false;\n if (\"width\" in trackSettings && \"height\" in trackSettings && widthInAllowedRange && heightInAllowedRange) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n }\n }\n if (name === \"pan\" && oldValue !== newValue && \"pan\" in this.#supportedConstraints) {\n const panInAllowedRange = \"pan\" in trackCapabilities && trackCapabilities.pan?.min && trackCapabilities.pan?.max ? this.pan >= trackCapabilities.pan.min && this.pan <= trackCapabilities.pan.max : false;\n if (\"pan\" in trackSettings && typeof this.pan === \"number\" && panInAllowedRange) this.#applyPTZ(\"pan\", this.pan);\n }\n if (name === \"tilt\" && oldValue !== newValue && \"tilt\" in this.#supportedConstraints) {\n const tiltInAllowedRange = \"tilt\" in trackCapabilities && trackCapabilities.tilt?.min && trackCapabilities.tilt?.max ? this.tilt >= trackCapabilities.tilt.min && this.tilt <= trackCapabilities.tilt.max : false;\n if (\"tilt\" in trackSettings && typeof this.tilt === \"number\" && tiltInAllowedRange) this.#applyPTZ(\"tilt\", this.tilt);\n }\n if (name === \"zoom\" && oldValue !== newValue && \"zoom\" in this.#supportedConstraints) {\n const zoomInAllowedRange = \"zoom\" in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max : false;\n if (\"zoom\" in trackSettings && typeof this.zoom === \"number\" && zoomInAllowedRange) this.#applyPTZ(\"zoom\", this.zoom);\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"autpoPlay\");\n this.#upgradeProperty(\"noImage\");\n this.#upgradeProperty(\"facingMode\");\n this.#upgradeProperty(\"cameraResolution\");\n this.#upgradeProperty(\"pan\");\n this.#upgradeProperty(\"tilt\");\n this.#upgradeProperty(\"zoom\");\n this.#upgradeProperty(\"calculateFileSize\");\n this.#canvasElement = this.shadowRoot?.querySelector(\"canvas\") || null;\n this.#outputElement = this.shadowRoot?.getElementById(\"output\") || null;\n this.#videoElement = this.shadowRoot?.querySelector(\"video\") || null;\n this.#captureButtonSlot = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null;\n this.#captureButton = this.#getCaptureButton();\n this.#facingModeButtonSlot = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null;\n this.#facingModeButton = this.#getFacingModeButton();\n this.#videoElement?.addEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.addEventListener(\"slotchange\", this.#onCaptureButtonSlotChange);\n this.#captureButton?.addEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#facingModeButtonSlot?.addEventListener(\"slotchange\", this.#onFacingModeButtonSlotChange);\n this.#facingModeButton?.addEventListener(\"click\", this.#onFacingModeButtonClick);\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported()) return this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n if (this.autoPlay) this.startVideoStream();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.stopVideoStream();\n this.#facingModeButton?.removeEventListener(\"click\", this.#onFacingModeButtonClick);\n this.#captureButton?.removeEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#videoElement?.removeEventListener(\"canplay\", this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.removeEventListener(\"slotchange\", this.#onCaptureButtonSlotChange);\n this.#facingModeButtonSlot?.removeEventListener(\"slotchange\", this.#onFacingModeButtonSlotChange);\n }\n /**\n * @type {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @attribute auto-play - Reflects the autoPlay attribute.\n */ get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(value) {\n this.toggleAttribute(\"auto-play\", !!value);\n }\n /**\n * @type {boolean} noImage - Whether or not to show the captured image.\n * @attribute no-image - Reflects the noImage attribute.\n */ get noImage() {\n return this.hasAttribute(\"no-image\");\n }\n set noImage(value) {\n this.toggleAttribute(\"no-image\", !!value);\n }\n /**\n * @type {string} facingMode - The facing mode of the camera.\n * @attribute facing-mode - Reflects the facingMode attribute.\n */ get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(value) {\n this.setAttribute(\"facing-mode\", value);\n }\n /**\n * @type {string} cameraResolution - The resolution of the camera.\n * @attribute camera-resolution - Reflects the cameraResolution attribute.\n */ get cameraResolution() {\n return this.getAttribute(\"camera-resolution\") || \"\";\n }\n set cameraResolution(value) {\n this.setAttribute(\"camera-resolution\", value);\n }\n /**\n * @type {number} pan - The pan value of the camera.\n * @attribute pan - Reflects the pan attribute.\n */ get pan() {\n return Number(this.getAttribute(\"pan\")) || 0;\n }\n set pan(value) {\n this.setAttribute(\"pan\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} tilt - The tilt value of the camera.\n * @attribute tilt - Reflects the tilt attribute.\n */ get tilt() {\n return Number(this.getAttribute(\"tilt\")) || 0;\n }\n set tilt(value) {\n this.setAttribute(\"tilt\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} zoom - The zoom value of the camera.\n * @attribute zoom - Reflects the zoom attribute.\n */ get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(value) {\n this.setAttribute(\"zoom\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} loading - Whether or not the video stream is loading.\n * @attribute loading - Reflects the loading attribute.\n */ get loading() {\n return this.hasAttribute(\"loading\");\n }\n /**\n * @type {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n * @attribute calculate-file-size - Reflects the calculateFileSize attribute.\n */ get calculateFileSize() {\n return this.hasAttribute(\"calculate-file-size\");\n }\n set calculateFileSize(value) {\n this.toggleAttribute(\"calculate-file-size\", !!value);\n }\n /**\n * Handles the click event of the facing mode button.\n *\n * @param {*} evt - The click event.\n */ #onFacingModeButtonClick = (evt)=>{\n evt.preventDefault();\n if (this.loading) return;\n this.facingMode = this.facingMode === \"user\" || !this.facingMode ? \"environment\" : \"user\";\n };\n /**\n * Handles the click event of the capture button.\n *\n * @param {*} evt - The click event.\n */ #onCapturePhotoButtonClick = (evt)=>{\n evt.preventDefault();\n this.capture();\n };\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {*} evt - The loadedmetadata event.\n */ #onVideoLoadedMetaData = (evt)=>{\n const video = evt.target;\n video.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: {\n video: video\n }\n }));\n }).catch(/** @param {Error} error */ (error)=>{\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n /**\n * Removes all child nodes from the output element.\n */ #emptyOutputElement() {\n if (!this.#outputElement) return;\n Array.from(this.#outputElement.childNodes).forEach((node)=>node.remove());\n }\n /**\n * Applies the pan, tilt or zoom constraint.\n *\n * @param {'pan' | 'tilt' | 'zoom'} constraintName - The name of the constraint.\n * @param {number} constraintValue - The value of the constraint.\n */ #applyPTZ(constraintName, constraintValue) {\n if (!this.#stream || !constraintName || !constraintValue) return;\n const [track] = this.#stream.getVideoTracks();\n /** @type {ExtendedMediaTrackCapabilities} */ const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n if (constraintName in trackSettings) track.applyConstraints({\n advanced: [\n {\n [constraintName]: (0, $02ad8beec419df62$export$7d15b64cf5a3a4c4)(Number(constraintValue), trackCapabilities[constraintName]?.min || 1, trackCapabilities[constraintName]?.max || 1)\n }\n ]\n });\n }\n /**\n * Handles the slotchange event of the capture button slot.\n *\n * @param {*} evt - The slotchange event.\n */ #onCaptureButtonSlotChange = (evt)=>{\n if (evt.target?.name === \"capture-button\") {\n this.#captureButton?.removeEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#captureButton = this.#getCaptureButton();\n if (this.#captureButton) {\n this.#captureButton.addEventListener(\"click\", this.#onCapturePhotoButtonClick);\n if (this.#captureButton.nodeName !== \"BUTTON\" && !this.#captureButton.hasAttribute(\"role\")) this.#captureButton.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Handles the slotchange event of the facing mode button slot.\n *\n * @param {*} evt - The slotchange event.\n */ #onFacingModeButtonSlotChange = (evt)=>{\n if (evt.target?.name === \"facing-mode-button\") {\n this.#facingModeButton?.removeEventListener(\"click\", this.#onFacingModeButtonClick);\n this.#facingModeButton = this.#getFacingModeButton();\n if (this.#facingModeButton) {\n this.#facingModeButton.addEventListener(\"click\", this.#onFacingModeButtonClick);\n if (this.#facingModeButton.nodeName !== \"BUTTON\" && !this.#facingModeButton.hasAttribute(\"role\")) this.#facingModeButton.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Returns the facing mode button.\n *\n * @returns {Nullable}\n */ #getFacingModeButton() {\n if (!this.#facingModeButtonSlot) return null;\n return this.#facingModeButtonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"facing-mode-button\";\n }) || null;\n }\n /**\n * Returns the capture button.\n *\n * @returns {Nullable}\n */ #getCaptureButton() {\n if (!this.#captureButtonSlot) return null;\n return this.#captureButtonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"capture-button\";\n }) || null;\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'autpoPlay' | 'noImage' | 'facingMode' | 'cameraResolution' | 'pan' | 'tilt' | 'zoom' | 'calculateFileSize'} prop\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Starts the video stream.\n *\n * @returns Promise\n */ async startVideoStream() {\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported() || this.#stream) return;\n this.setAttribute(\"loading\", \"\");\n /** @type {ExtendedMediaTrackConstraints} */ const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: true,\n tilt: true,\n zoom: true\n },\n audio: false\n };\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n if (this.#videoElement) this.#videoElement.srcObject = this.#stream;\n this.#applyPTZ(\"pan\", this.pan);\n this.#applyPTZ(\"tilt\", this.tilt);\n this.#applyPTZ(\"zoom\", this.zoom);\n const trackSettings = this.getTrackSettings();\n if (\"facingMode\" in trackSettings && this.#facingModeButtonSlot) this.#facingModeButtonSlot.hidden = false;\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n /**\n * Stops the video stream.\n */ stopVideoStream() {\n if (!this.#videoElement || !this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n /**\n * Captures a photo using the element's properties.\n *\n * @returns Promise\n */ async capture() {\n if (this.loading || !this.#canvasElement || !this.#videoElement) return;\n try {\n const ctx = this.#canvasElement.getContext(\"2d\");\n const width = this.#videoElement.videoWidth;\n const height = this.#videoElement.videoHeight;\n this.#canvasElement.width = width;\n this.#canvasElement.height = height;\n ctx?.drawImage(this.#videoElement, 0, 0, width, height);\n const dataURI = this.#canvasElement.toDataURL(\"image/png\");\n if (typeof dataURI === \"string\" && dataURI.includes(\"data:image\")) {\n if (!this.noImage) {\n const image = new Image();\n image.src = dataURI;\n image.width = width;\n image.height = height;\n image.setAttribute(\"part\", \"output-image\");\n this.#emptyOutputElement();\n this.#outputElement?.appendChild(image);\n }\n /** @type {{ dataURI: string, width: number, height: number, size?: number }} */ const eventDetail = {\n dataURI: dataURI,\n width: width,\n height: height\n };\n if (this.calculateFileSize) try {\n const file = await fetch(dataURI);\n const blob = await file.blob();\n const size = blob.size;\n if (size) eventDetail.size = size;\n } catch (err) {\n // Fail silently...\n }\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:success`, {\n bubbles: true,\n composed: true,\n detail: eventDetail\n }));\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n }\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */ getSupportedConstraints() {\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported()) return {};\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */ getTrackCapabilities() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getCapabilities === \"function\") return track.getCapabilities() || {};\n return {};\n }\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */ getTrackSettings() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getSettings === \"function\") return track.getSettings() || {};\n return {};\n }\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */ static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='capture-photo'] - The name of the custom element.\n * @example\n *\n * CapturePhoto.defineCustomElement('my-capture-photo');\n */ static defineCustomElement(elementName = $c290816263f90981$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $c290816263f90981$export$cc30a98fe3890794);\n }\n}\n\n\n(0, $c290816263f90981$export$cc30a98fe3890794).defineCustomElement();\n\n\nexport {$c290816263f90981$export$cc30a98fe3890794 as CapturePhoto};\n//# sourceMappingURL=capture-photo-defined.js.map\n","import { CapturePhoto } from './capture-photo.js';\n\nCapturePhoto.defineCustomElement();\n\nexport { CapturePhoto };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * @typedef {Object} ExtendedMediaTrackCapabilities\n * @property {ULongRange} [width] - The width of the video track.\n * @property {ULongRange} [height] - The height of the video track.\n * @property {ULongRange} [pan] - The pan level of the camera.\n * @property {ULongRange} [tilt] - The tilt level of the camera.\n * @property {ULongRange} [zoom] - The zoom level of the camera.\n * @property {MediaTrackCapabilities} [nativeMediaTrackCapabilities] - The native track capabilities.\n */\n\n/**\n * @typedef {Object} ExtendedMediaTrackConstraints\n * @property {MediaTrackConstraints & {pan: boolean, tilt: boolean, zoom: boolean}} video - The video constraints.\n * @property {MediaTrackConstraints | boolean} audio - The audio constraints.\n */\n\nimport { clamp } from './utils/clamp.js';\n\nconst COMPONENT_NAME = 'capture-photo';\n\nconst styles = /* css */`\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */`\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\n\n/**\n * @summary A custom element that implements the MediaDevices.getUserMedia() method of the MediaDevices interface to capture a photo in the browser.\n * @documentation https://github.com/georapbox/capture-photo-element\n *\n * @tagname capture-photo This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @property {boolean} noImage - Whether or not to show the captured image.\n * @property {string} facingMode - The facing mode of the camera.\n * @property {string} cameraResolution - The resolution of the camera.\n * @property {number} pan - The pan value of the camera.\n * @property {number} tilt - The tilt value of the camera.\n * @property {number} zoom - The zoom value of the camera.\n * @property {boolean} loading - Whether or not the video stream is loading.\n * @property {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n *\n * @atttribute {boolean} auto-play - Reflects the autoPlay property.\n * @atttribute {boolean} no-image - Reflects the noImage property.\n * @atttribute {string} facing-mode - Reflects the facingMode property.\n * @atttribute {string} camera-resolution - Reflects the cameraResolution property.\n * @atttribute {number} pan - Reflects the pan property.\n * @atttribute {number} tilt - Reflects the tilt property.\n * @atttribute {number} zoom - Reflects the zoom property.\n * @atttribute {boolean} loading - Reflects the loading property.\n * @atttribute {boolean} calculate-file-size - Reflects the calculateFileSize property.\n *\n * @slot capture-button - The capture button.\n * @slot capture-button-content - The capture button content.\n * @slot facing-mode-button - The facing mode button.\n * @slot facing-mode-button-content - The facing mode button content.\n * @slot actions - The actions container.\n * @slot - A default un-named slot to add content inside the component.\n *\n * @csspart video - The video element.\n * @csspart actions-container - The actions container.\n * @csspart capture-button - The capture button.\n * @csspart facing-mode-button - The facing mode button.\n * @csspart output-container - The output container.\n * @csspart output-image - The output image.\n *\n * @event capture-photo:video-play - Fires when the video stream is successfully playing.\n * @event capture-photo:success - Fires when the photo is successfully captured.\n * @event capture-photo:error - Fires when an error occurs.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method isSupported - Static method. Checks if the MediaDevices.getUserMedia() method is supported.\n * @method startVideoStream - Instance method. Starts the video stream.\n * @method stopVideoStream - Instance method. Stops the video stream.\n * @method capture - Instance method. Captures a photo.\n * @method getSupportedConstraints - Instance method. Gets the supported constraints.\n * @method getTrackCapabilities - Instance method. Gets the track capabilities.\n * @method getTrackSettings - Instance method. Gets the track settings.\n */\nclass CapturePhoto extends HTMLElement {\n /** @type {MediaTrackSupportedConstraints | {}}*/\n #supportedConstraints = {};\n\n /** @type {Nullable} */\n #stream = null;\n\n /** @type {Nullable} */\n #canvasElement = null;\n\n /** @type {Nullable} */\n #outputElement = null;\n\n /** @type {Nullable} */\n #videoElement = null;\n\n /** @type {Nullable} */\n #captureButtonSlot = null;\n\n /** @type {Nullable} */\n #captureButton = null;\n\n /** @type {Nullable} */\n #facingModeButtonSlot = null;\n\n /** @type {Nullable} */\n #facingModeButton = null;\n\n constructor() {\n super();\n\n this.#supportedConstraints = this.getSupportedConstraints();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['no-image', 'facing-mode', 'camera-resolution', 'pan', 'tilt', 'zoom'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) {\n return;\n }\n\n /** @type {ExtendedMediaTrackCapabilities} */\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n if (name === 'no-image' && oldValue !== newValue) {\n this.#emptyOutputElement();\n }\n\n if (name === 'facing-mode' && oldValue !== newValue && 'facingMode' in this.#supportedConstraints) {\n const isValidFacingMode = ['user', 'environment'].includes(this.facingMode || '');\n\n if ('facingMode' in trackSettings && isValidFacingMode) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n\n if (name === 'camera-resolution' && oldValue !== newValue) {\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0 && 'width' in trackCapabilities && 'height' in trackCapabilities) {\n const widthInAllowedRange = trackCapabilities.width?.min && trackCapabilities.width?.max\n ? width >= trackCapabilities?.width?.min && width <= trackCapabilities?.width?.max\n : false;\n\n const heightInAllowedRange = trackCapabilities.height?.min && trackCapabilities.height?.max\n ? height >= trackCapabilities?.height?.min && height <= trackCapabilities?.height?.max\n : false;\n\n if ('width' in trackSettings && 'height' in trackSettings && widthInAllowedRange && heightInAllowedRange) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n }\n }\n\n if (name === 'pan' && oldValue !== newValue && 'pan' in this.#supportedConstraints) {\n const panInAllowedRange = 'pan' in trackCapabilities && trackCapabilities.pan?.min && trackCapabilities.pan?.max\n ? this.pan >= trackCapabilities.pan.min && this.pan <= trackCapabilities.pan.max\n : false;\n\n if ('pan' in trackSettings && typeof this.pan === 'number' && panInAllowedRange) {\n this.#applyPTZ('pan', this.pan);\n }\n }\n\n if (name === 'tilt' && oldValue !== newValue && 'tilt' in this.#supportedConstraints) {\n const tiltInAllowedRange = 'tilt' in trackCapabilities && trackCapabilities.tilt?.min && trackCapabilities.tilt?.max\n ? this.tilt >= trackCapabilities.tilt.min && this.tilt <= trackCapabilities.tilt.max\n : false;\n\n if ('tilt' in trackSettings && typeof this.tilt === 'number' && tiltInAllowedRange) {\n this.#applyPTZ('tilt', this.tilt);\n }\n }\n\n if (name === 'zoom' && oldValue !== newValue && 'zoom' in this.#supportedConstraints) {\n const zoomInAllowedRange = 'zoom' in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max\n ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max\n : false;\n\n if ('zoom' in trackSettings && typeof this.zoom === 'number' && zoomInAllowedRange) {\n this.#applyPTZ('zoom', this.zoom);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('autpoPlay');\n this.#upgradeProperty('noImage');\n this.#upgradeProperty('facingMode');\n this.#upgradeProperty('cameraResolution');\n this.#upgradeProperty('pan');\n this.#upgradeProperty('tilt');\n this.#upgradeProperty('zoom');\n this.#upgradeProperty('calculateFileSize');\n\n this.#canvasElement = this.shadowRoot?.querySelector('canvas') || null;\n this.#outputElement = this.shadowRoot?.getElementById('output') || null;\n this.#videoElement = this.shadowRoot?.querySelector('video') || null;\n this.#captureButtonSlot = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null;\n this.#captureButton = this.#getCaptureButton();\n this.#facingModeButtonSlot = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null;\n this.#facingModeButton = this.#getFacingModeButton();\n\n this.#videoElement?.addEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.addEventListener('slotchange', this.#onCaptureButtonSlotChange);\n this.#captureButton?.addEventListener('click', this.#onCapturePhotoButtonClick);\n this.#facingModeButtonSlot?.addEventListener('slotchange', this.#onFacingModeButtonSlotChange);\n this.#facingModeButton?.addEventListener('click', this.#onFacingModeButtonClick);\n\n if (!CapturePhoto.isSupported()) {\n return this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: 'NotSupportedError',\n message: 'Not supported'\n }\n }\n }));\n }\n\n if (this.autoPlay) {\n this.startVideoStream();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.stopVideoStream();\n this.#facingModeButton?.removeEventListener('click', this.#onFacingModeButtonClick);\n this.#captureButton?.removeEventListener('click', this.#onCapturePhotoButtonClick);\n this.#videoElement?.removeEventListener('canplay', this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.removeEventListener('slotchange', this.#onCaptureButtonSlotChange);\n this.#facingModeButtonSlot?.removeEventListener('slotchange', this.#onFacingModeButtonSlotChange);\n }\n\n /**\n * @type {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @attribute auto-play - Reflects the autoPlay attribute.\n */\n get autoPlay() {\n return this.hasAttribute('auto-play');\n }\n\n set autoPlay(value) {\n this.toggleAttribute('auto-play', !!value);\n }\n\n /**\n * @type {boolean} noImage - Whether or not to show the captured image.\n * @attribute no-image - Reflects the noImage attribute.\n */\n get noImage() {\n return this.hasAttribute('no-image');\n }\n\n set noImage(value) {\n this.toggleAttribute('no-image', !!value);\n }\n\n /**\n * @type {string} facingMode - The facing mode of the camera.\n * @attribute facing-mode - Reflects the facingMode attribute.\n */\n get facingMode() {\n return this.getAttribute('facing-mode') || 'user';\n }\n\n set facingMode(value) {\n this.setAttribute('facing-mode', value);\n }\n\n /**\n * @type {string} cameraResolution - The resolution of the camera.\n * @attribute camera-resolution - Reflects the cameraResolution attribute.\n */\n get cameraResolution() {\n return this.getAttribute('camera-resolution') || '';\n }\n\n set cameraResolution(value) {\n this.setAttribute('camera-resolution', value);\n }\n\n /**\n * @type {number} pan - The pan value of the camera.\n * @attribute pan - Reflects the pan attribute.\n */\n get pan() {\n return Number(this.getAttribute('pan')) || 0;\n }\n\n set pan(value) {\n this.setAttribute('pan', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} tilt - The tilt value of the camera.\n * @attribute tilt - Reflects the tilt attribute.\n */\n get tilt() {\n return Number(this.getAttribute('tilt')) || 0;\n }\n\n set tilt(value) {\n this.setAttribute('tilt', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} zoom - The zoom value of the camera.\n * @attribute zoom - Reflects the zoom attribute.\n */\n get zoom() {\n return Number(this.getAttribute('zoom')) || 1;\n }\n\n set zoom(value) {\n this.setAttribute('zoom', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} loading - Whether or not the video stream is loading.\n * @attribute loading - Reflects the loading attribute.\n */\n get loading() {\n return this.hasAttribute('loading');\n }\n\n /**\n * @type {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n * @attribute calculate-file-size - Reflects the calculateFileSize attribute.\n */\n get calculateFileSize() {\n return this.hasAttribute('calculate-file-size');\n }\n\n set calculateFileSize(value) {\n this.toggleAttribute('calculate-file-size', !!value);\n }\n\n /**\n * Handles the click event of the facing mode button.\n *\n * @param {*} evt - The click event.\n */\n #onFacingModeButtonClick = evt => {\n evt.preventDefault();\n\n if (this.loading) {\n return;\n }\n\n this.facingMode = this.facingMode === 'user' || !this.facingMode ? 'environment' : 'user';\n };\n\n /**\n * Handles the click event of the capture button.\n *\n * @param {*} evt - The click event.\n */\n #onCapturePhotoButtonClick = evt => {\n evt.preventDefault();\n this.capture();\n };\n\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {*} evt - The loadedmetadata event.\n */\n #onVideoLoadedMetaData = evt => {\n const video = evt.target;\n\n video.play().then(() => {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: { video }\n }));\n }).catch(/** @param {Error} error */error => {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }).finally(() => {\n this.removeAttribute('loading');\n });\n };\n\n /**\n * Removes all child nodes from the output element.\n */\n #emptyOutputElement() {\n if (!this.#outputElement) {\n return;\n }\n\n Array.from(this.#outputElement.childNodes).forEach(node => node.remove());\n }\n\n /**\n * Applies the pan, tilt or zoom constraint.\n *\n * @param {'pan' | 'tilt' | 'zoom'} constraintName - The name of the constraint.\n * @param {number} constraintValue - The value of the constraint.\n */\n #applyPTZ(constraintName, constraintValue) {\n if (!this.#stream || !constraintName || !constraintValue) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n /** @type {ExtendedMediaTrackCapabilities} */\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n if (constraintName in trackSettings) {\n track.applyConstraints({\n advanced: [{\n [constraintName]: clamp(Number(constraintValue), trackCapabilities[constraintName]?.min || 1, trackCapabilities[constraintName]?.max || 1)\n }]\n });\n }\n }\n\n /**\n * Handles the slotchange event of the capture button slot.\n *\n * @param {*} evt - The slotchange event.\n */\n #onCaptureButtonSlotChange = evt => {\n if (evt.target?.name === 'capture-button') {\n this.#captureButton?.removeEventListener('click', this.#onCapturePhotoButtonClick);\n this.#captureButton = this.#getCaptureButton();\n\n if (this.#captureButton) {\n this.#captureButton.addEventListener('click', this.#onCapturePhotoButtonClick);\n\n if (this.#captureButton.nodeName !== 'BUTTON' && !this.#captureButton.hasAttribute('role')) {\n this.#captureButton.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Handles the slotchange event of the facing mode button slot.\n *\n * @param {*} evt - The slotchange event.\n */\n #onFacingModeButtonSlotChange = evt => {\n if (evt.target?.name === 'facing-mode-button') {\n this.#facingModeButton?.removeEventListener('click', this.#onFacingModeButtonClick);\n this.#facingModeButton = this.#getFacingModeButton();\n\n if (this.#facingModeButton) {\n this.#facingModeButton.addEventListener('click', this.#onFacingModeButtonClick);\n\n if (this.#facingModeButton.nodeName !== 'BUTTON' && !this.#facingModeButton.hasAttribute('role')) {\n this.#facingModeButton.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the facing mode button.\n *\n * @returns {Nullable}\n */\n #getFacingModeButton() {\n if (!this.#facingModeButtonSlot) {\n return null;\n }\n\n return this.#facingModeButtonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'facing-mode-button';\n }) || null;\n }\n\n /**\n * Returns the capture button.\n *\n * @returns {Nullable}\n */\n #getCaptureButton() {\n if (!this.#captureButtonSlot) {\n return null;\n }\n\n return this.#captureButtonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'capture-button';\n }) || null;\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'autpoPlay' | 'noImage' | 'facingMode' | 'cameraResolution' | 'pan' | 'tilt' | 'zoom' | 'calculateFileSize'} prop\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Starts the video stream.\n *\n * @returns Promise\n */\n async startVideoStream() {\n if (!CapturePhoto.isSupported() || this.#stream) {\n return;\n }\n\n this.setAttribute('loading', '');\n\n /** @type {ExtendedMediaTrackConstraints} */\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || 'user'\n },\n pan: true,\n tilt: true,\n zoom: true\n },\n audio: false\n };\n\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n\n if (this.#videoElement) {\n this.#videoElement.srcObject = this.#stream;\n }\n\n this.#applyPTZ('pan', this.pan);\n this.#applyPTZ('tilt', this.tilt);\n this.#applyPTZ('zoom', this.zoom);\n\n const trackSettings = this.getTrackSettings();\n\n if ('facingMode' in trackSettings && this.#facingModeButtonSlot) {\n this.#facingModeButtonSlot.hidden = false;\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n } finally {\n this.removeAttribute('loading');\n }\n }\n\n /**\n * Stops the video stream.\n */\n stopVideoStream() {\n if (!this.#videoElement || !this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n\n /**\n * Captures a photo using the element's properties.\n *\n * @returns Promise\n */\n async capture() {\n if (this.loading || !this.#canvasElement || !this.#videoElement) {\n return;\n }\n\n try {\n const ctx = this.#canvasElement.getContext('2d');\n const width = this.#videoElement.videoWidth;\n const height = this.#videoElement.videoHeight;\n this.#canvasElement.width = width;\n this.#canvasElement.height = height;\n ctx?.drawImage(this.#videoElement, 0, 0, width, height);\n const dataURI = this.#canvasElement.toDataURL('image/png');\n\n if (typeof dataURI === 'string' && dataURI.includes('data:image')) {\n if (!this.noImage) {\n const image = new Image();\n image.src = dataURI;\n image.width = width;\n image.height = height;\n image.setAttribute('part', 'output-image');\n this.#emptyOutputElement();\n this.#outputElement?.appendChild(image);\n }\n\n /** @type {{ dataURI: string, width: number, height: number, size?: number }} */\n const eventDetail = { dataURI, width, height };\n\n if (this.calculateFileSize) {\n try {\n const file = await fetch(dataURI);\n const blob = await file.blob();\n const size = blob.size;\n\n if (size) {\n eventDetail.size = size;\n }\n } catch (err) {\n // Fail silently...\n }\n }\n\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:success`, {\n bubbles: true,\n composed: true,\n detail: eventDetail\n }));\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n }\n\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */\n getSupportedConstraints() {\n if (!CapturePhoto.isSupported()) {\n return {};\n }\n\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */\n getTrackCapabilities() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getCapabilities === 'function') {\n return track.getCapabilities() || {};\n }\n\n return {};\n }\n\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */\n getTrackSettings() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getSettings === 'function') {\n return track.getSettings() || {};\n }\n\n return {};\n }\n\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */\n static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='capture-photo'] - The name of the custom element.\n * @example\n *\n * CapturePhoto.defineCustomElement('my-capture-photo');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, CapturePhoto);\n }\n }\n}\n\nexport { CapturePhoto };\n","// @ts-check\n\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */\nexport const clamp = (value, lower, upper) => {\n if (Number.isNaN(lower)) {\n lower = 0;\n }\n\n if (Number.isNaN(upper)) {\n upper = 0;\n }\n\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n","Object.defineProperty({},\"ModalElement\",{get:function(){return t},set:void 0,enumerable:!0,configurable:!0});let e=document.createElement(\"template\");e.innerHTML=/* html */`\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */class t extends HTMLElement{/** @type {Nullable} */#e=null;/** @type {Nullable} */#t=null;/** @type {ReturnType | undefined} */#o=void 0;constructor(){if(super(),!this.shadowRoot){let t=this.attachShadow({mode:\"open\"});t.appendChild(e.content.cloneNode(!0))}this.shadowRoot&&(this.#e=this.shadowRoot.querySelector(\"dialog\"),this.#t=this.shadowRoot.querySelector('slot[name=\"footer\"]'))}static get observedAttributes(){return[\"open\",\"no-header\",\"no-animations\",\"no-close-button\"]}/**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */attributeChangedCallback(e,t,o){if(null!==this.#e){if(\"open\"===e&&t!==o&&(this.open?(this.#e.showModal(),document.body&&(document.body.style.overflowY=\"hidden\"),this.dispatchEvent(new CustomEvent(\"me-open\",{bubbles:!0,composed:!0,detail:{element:this}}))):this.#e.close()),\"no-header\"===e&&t!==o){/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__header\");null!==e&&(e.hidden=this.noHeader)}if(\"no-animations\"===e&&t!==o&&this.#e.classList.toggle(\"dialog--no-animations\",this.noAnimations),\"no-close-button\"===e&&t!==o){/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__close\");null!==e&&(e.hidden=this.noCloseButton)}}}/**\n * Lifecycle method that is called when the element is added to the DOM.\n */connectedCallback(){this.#i(\"open\"),this.#i(\"staticBackdrop\"),this.#i(\"noHeader\"),this.#i(\"noAnimations\"),this.#i(\"noCloseButton\"),this.#i(\"fullscreen\"),this.#e?.addEventListener(\"click\",this.#a),this.#e?.addEventListener(\"close\",this.#l),this.#e?.addEventListener(\"cancel\",this.#s),this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\",this.#n),this.#t?.addEventListener(\"slotchange\",this.#r)}/**\n * Lifecycle method that is called when the element is removed from the DOM.\n */disconnectedCallback(){this.#o&&clearTimeout(this.#o),this.#e?.addEventListener(\"click\",this.#a),this.#e?.removeEventListener(\"close\",this.#l),this.#e?.removeEventListener(\"cancel\",this.#s),this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\",this.#n),this.#t?.removeEventListener(\"slotchange\",this.#r)}/**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */get open(){return this.hasAttribute(\"open\")}set open(e){e?this.setAttribute(\"open\",\"\"):this.removeAttribute(\"open\")}/**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */get staticBackdrop(){return this.hasAttribute(\"static-backdrop\")}set staticBackdrop(e){e?this.setAttribute(\"static-backdrop\",\"\"):this.removeAttribute(\"static-backdrop\")}/**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */get noHeader(){return this.hasAttribute(\"no-header\")}set noHeader(e){e?this.setAttribute(\"no-header\",\"\"):this.removeAttribute(\"no-header\")}/**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */get noAnimations(){return this.hasAttribute(\"no-animations\")}set noAnimations(e){e?this.setAttribute(\"no-animations\",\"\"):this.removeAttribute(\"no-animations\")}/**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */get noCloseButton(){return this.hasAttribute(\"no-close-button\")}set noCloseButton(e){e?this.setAttribute(\"no-close-button\",\"\"):this.removeAttribute(\"no-close-button\")}/**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */get fullscreen(){return this.hasAttribute(\"fullscreen\")}set fullscreen(e){e?this.setAttribute(\"fullscreen\",\"\"):this.removeAttribute(\"fullscreen\")}/**\n * Applies a pulse effect on the dialog.\n */#d(){this.#o||(this.#e?.classList.add(\"dialog--pulse\"),this.#o=setTimeout(()=>{this.#e?.classList.remove(\"dialog--pulse\"),clearTimeout(this.#o),this.#o=void 0},300))}/**\n * Handles the close event of the dialog.\n */#l=()=>{// This is needed because the dialog element does not reset\n// the open property when the dialog is closed by the user.\nthis.open=!1,document.body&&(document.body.style.overflowY=\"\"),this.dispatchEvent(new CustomEvent(\"me-close\",{bubbles:!0,composed:!0,detail:{element:this}}))};/**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */#s=e=>{let t=this.#c(\"escape-key\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),this.noAnimations||this.#d())};/**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */#n=e=>{let t=this.#c(\"close-button\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),this.noAnimations||this.#d())};/**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */#a=e=>{if(e.target!==e.currentTarget)return;let t=this.#c(\"backdrop-click\");if(this.dispatchEvent(t),t.defaultPrevented||this.staticBackdrop){this.noAnimations||this.#d();return}this.#e?.close()};/**\n * Handles the slotchange event of the footer slot.\n */#r=()=>{if(null===this.#e)return;/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__footer\");if(null===e)return;let t=this.#t?.assignedNodes(),o=!!t&&t.length>0;e.hidden=!o};/**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */#c(e){return new CustomEvent(\"me-request-close\",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e,element:this}})}/**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */#i(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}/**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */show(){this.open||(this.open=!0)}/**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */hide(){this.open&&(this.open=!1)}/**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */static defineCustomElement(e=\"modal-element\"){\"undefined\"==typeof window||window.customElements.get(e)||window.customElements.define(e,t)}}t.defineCustomElement();export{t as ModalElement};//# sourceMappingURL=modal-element-defined.js.map\n\n//# sourceMappingURL=modal-element-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $180b6dcf923bafc7$exports = {};\n\n$parcel$export($180b6dcf923bafc7$exports, \"ModalElement\", function () { return $180b6dcf923bafc7$export$32589115725b904b; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ const $180b6dcf923bafc7$var$PULSE_ANIMATION_DURATION = 300;\nconst $180b6dcf923bafc7$var$template = document.createElement(\"template\");\n$180b6dcf923bafc7$var$template.innerHTML = /* html */ `\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;\n/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */ class $180b6dcf923bafc7$export$32589115725b904b extends HTMLElement {\n /** @type {Nullable} */ #dialogEl = null;\n /** @type {Nullable} */ #footerSlotEl = null;\n /** @type {ReturnType | undefined} */ #pulseAnimationTimeout = void 0;\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($180b6dcf923bafc7$var$template.content.cloneNode(true));\n }\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector(\"dialog\");\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n }\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) return;\n if (name === \"open\" && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n if (document.body) document.body.style.overflowY = \"hidden\";\n this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: true,\n composed: true,\n detail: {\n element: this\n }\n }));\n } else this.#dialogEl.close();\n }\n if (name === \"no-header\" && oldValue !== newValue) {\n /** @type {Nullable} */ const headerEl = this.#dialogEl.querySelector(\".dialog__header\");\n if (headerEl !== null) headerEl.hidden = this.noHeader;\n }\n if (name === \"no-animations\" && oldValue !== newValue) this.#dialogEl.classList.toggle(\"dialog--no-animations\", this.noAnimations);\n if (name === \"no-close-button\" && oldValue !== newValue) {\n /** @type {Nullable} */ const closeBtnEl = this.#dialogEl.querySelector(\".dialog__close\");\n if (closeBtnEl !== null) closeBtnEl.hidden = this.noCloseButton;\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"open\");\n this.#upgradeProperty(\"staticBackdrop\");\n this.#upgradeProperty(\"noHeader\");\n this.#upgradeProperty(\"noAnimations\");\n this.#upgradeProperty(\"noCloseButton\");\n this.#upgradeProperty(\"fullscreen\");\n this.#dialogEl?.addEventListener(\"click\", this.#handleDialogClick);\n this.#dialogEl?.addEventListener(\"close\", this.#handleDialogClose);\n this.#dialogEl?.addEventListener(\"cancel\", this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener(\"slotchange\", this.#handleFooterSlotChange);\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener(\"click\", this.#handleDialogClick);\n this.#dialogEl?.removeEventListener(\"close\", this.#handleDialogClose);\n this.#dialogEl?.removeEventListener(\"cancel\", this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener(\"slotchange\", this.#handleFooterSlotChange);\n }\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */ get open() {\n return this.hasAttribute(\"open\");\n }\n set open(value) {\n if (value) this.setAttribute(\"open\", \"\");\n else this.removeAttribute(\"open\");\n }\n /**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */ get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(value) {\n if (value) this.setAttribute(\"static-backdrop\", \"\");\n else this.removeAttribute(\"static-backdrop\");\n }\n /**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */ get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(value) {\n if (value) this.setAttribute(\"no-header\", \"\");\n else this.removeAttribute(\"no-header\");\n }\n /**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */ get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(value) {\n if (value) this.setAttribute(\"no-animations\", \"\");\n else this.removeAttribute(\"no-animations\");\n }\n /**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */ get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(value) {\n if (value) this.setAttribute(\"no-close-button\", \"\");\n else this.removeAttribute(\"no-close-button\");\n }\n /**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */ get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(value) {\n if (value) this.setAttribute(\"fullscreen\", \"\");\n else this.removeAttribute(\"fullscreen\");\n }\n /**\n * Applies a pulse effect on the dialog.\n */ #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) return;\n this.#dialogEl?.classList.add(\"dialog--pulse\");\n this.#pulseAnimationTimeout = setTimeout(()=>{\n this.#dialogEl?.classList.remove(\"dialog--pulse\");\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, $180b6dcf923bafc7$var$PULSE_ANIMATION_DURATION);\n }\n /**\n * Handles the close event of the dialog.\n */ #handleDialogClose = ()=>{\n // This is needed because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n if (document.body) document.body.style.overflowY = \"\";\n this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: true,\n composed: true,\n detail: {\n element: this\n }\n }));\n };\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */ #handleDialogCancel = (evt)=>{\n const requestCloseEvent = this.#createRequestCloseEvent(\"escape-key\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */ #handleCloseButtonClick = (evt)=>{\n const requestCloseEvent = this.#createRequestCloseEvent(\"close-button\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */ #handleDialogClick = (evt)=>{\n if (evt.target !== evt.currentTarget) return;\n const requestCloseEvent = this.#createRequestCloseEvent(\"backdrop-click\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n return;\n }\n this.#dialogEl?.close();\n };\n /**\n * Handles the slotchange event of the footer slot.\n */ #handleFooterSlotChange = ()=>{\n if (this.#dialogEl === null) return;\n /** @type {Nullable} */ const footerEl = this.#dialogEl.querySelector(\".dialog__footer\");\n if (footerEl === null) return;\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n footerEl.hidden = !hasFooterSlotNodes;\n };\n /**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */ #createRequestCloseEvent(reason) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason: reason,\n element: this\n }\n });\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */ show() {\n if (this.open) return;\n this.open = true;\n }\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */ hide() {\n if (!this.open) return;\n this.open = false;\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */ static defineCustomElement(elementName = \"modal-element\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $180b6dcf923bafc7$export$32589115725b904b);\n }\n}\n\n\n(0, $180b6dcf923bafc7$export$32589115725b904b).defineCustomElement();\n\n\nexport {$180b6dcf923bafc7$export$32589115725b904b as ModalElement};\n//# sourceMappingURL=modal-element-defined.js.map\n","import { ModalElement } from './modal-element.js';\n\nModalElement.defineCustomElement();\n\nexport { ModalElement };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst PULSE_ANIMATION_DURATION = 300;\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */`\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;\n\n/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */\nclass ModalElement extends HTMLElement {\n /** @type {Nullable} */\n #dialogEl = null;\n\n /** @type {Nullable} */\n #footerSlotEl = null;\n\n /** @type {ReturnType | undefined} */\n #pulseAnimationTimeout = void 0;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector('dialog');\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n }\n }\n\n static get observedAttributes() {\n return ['open', 'no-header', 'no-animations', 'no-close-button'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) {\n return;\n }\n\n if (name === 'open' && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n\n if (document.body) {\n document.body.style.overflowY = 'hidden';\n }\n\n this.dispatchEvent(new CustomEvent('me-open', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n }));\n } else {\n this.#dialogEl.close();\n }\n }\n\n if (name === 'no-header' && oldValue !== newValue) {\n /** @type {Nullable} */\n const headerEl = this.#dialogEl.querySelector('.dialog__header');\n\n if (headerEl !== null) {\n headerEl.hidden = this.noHeader;\n }\n }\n\n if (name === 'no-animations' && oldValue !== newValue) {\n this.#dialogEl.classList.toggle('dialog--no-animations', this.noAnimations);\n }\n\n if (name === 'no-close-button' && oldValue !== newValue) {\n /** @type {Nullable} */\n const closeBtnEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeBtnEl !== null) {\n closeBtnEl.hidden = this.noCloseButton;\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('open');\n this.#upgradeProperty('staticBackdrop');\n this.#upgradeProperty('noHeader');\n this.#upgradeProperty('noAnimations');\n this.#upgradeProperty('noCloseButton');\n this.#upgradeProperty('fullscreen');\n\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.addEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.addEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener('slotchange', this.#handleFooterSlotChange);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.removeEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.removeEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener('slotchange', this.#handleFooterSlotChange);\n }\n\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */\n get open() {\n return this.hasAttribute('open');\n }\n\n set open(value) {\n if (value) {\n this.setAttribute('open', '');\n } else {\n this.removeAttribute('open');\n }\n }\n\n /**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */\n get staticBackdrop() {\n return this.hasAttribute('static-backdrop');\n }\n\n set staticBackdrop(value) {\n if (value) {\n this.setAttribute('static-backdrop', '');\n } else {\n this.removeAttribute('static-backdrop');\n }\n }\n\n /**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */\n get noHeader() {\n return this.hasAttribute('no-header');\n }\n\n set noHeader(value) {\n if (value) {\n this.setAttribute('no-header', '');\n } else {\n this.removeAttribute('no-header');\n }\n }\n\n /**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */\n get noAnimations() {\n return this.hasAttribute('no-animations');\n }\n\n set noAnimations(value) {\n if (value) {\n this.setAttribute('no-animations', '');\n } else {\n this.removeAttribute('no-animations');\n }\n }\n\n /**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */\n get noCloseButton() {\n return this.hasAttribute('no-close-button');\n }\n\n set noCloseButton(value) {\n if (value) {\n this.setAttribute('no-close-button', '');\n } else {\n this.removeAttribute('no-close-button');\n }\n }\n\n /**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */\n get fullscreen() {\n return this.hasAttribute('fullscreen');\n }\n\n set fullscreen(value) {\n if (value) {\n this.setAttribute('fullscreen', '');\n } else {\n this.removeAttribute('fullscreen');\n }\n }\n\n /**\n * Applies a pulse effect on the dialog.\n */\n #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) {\n return;\n }\n\n this.#dialogEl?.classList.add('dialog--pulse');\n\n this.#pulseAnimationTimeout = setTimeout(() => {\n this.#dialogEl?.classList.remove('dialog--pulse');\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, PULSE_ANIMATION_DURATION);\n }\n\n /**\n * Handles the close event of the dialog.\n */\n #handleDialogClose = () => {\n // This is needed because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n\n if (document.body) {\n document.body.style.overflowY = '';\n }\n\n this.dispatchEvent(new CustomEvent('me-close', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n }));\n };\n\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */\n #handleDialogCancel = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('escape-key');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('close-button');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleDialogClick = evt => {\n if (evt.target !== evt.currentTarget) {\n return;\n }\n\n const requestCloseEvent = this.#createRequestCloseEvent('backdrop-click');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n return;\n }\n\n this.#dialogEl?.close();\n };\n\n /**\n * Handles the slotchange event of the footer slot.\n */\n #handleFooterSlotChange = () => {\n if (this.#dialogEl === null) {\n return;\n }\n\n /** @type {Nullable} */\n const footerEl = this.#dialogEl.querySelector('.dialog__footer');\n\n if (footerEl === null) {\n return;\n }\n\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n\n footerEl.hidden = !hasFooterSlotNodes;\n };\n\n /**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */\n #createRequestCloseEvent(reason) {\n return new CustomEvent('me-request-close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason,\n element: this\n }\n });\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */\n show() {\n if (this.open) {\n return;\n }\n\n this.open = true;\n }\n\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */\n hide() {\n if (!this.open) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */\n static defineCustomElement(elementName = 'modal-element') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ModalElement);\n }\n }\n}\n\nexport { ModalElement };\n","Object.defineProperty({},\"FilesDropzone\",{get:function(){return m},set:void 0,enumerable:!0,configurable:!0});let e=new Map([[\"aac\",\"audio/aac\"],[\"abw\",\"application/x-abiword\"],[\"arc\",\"application/x-freearc\"],[\"avif\",\"image/avif\"],[\"avi\",\"video/x-msvideo\"],[\"azw\",\"application/vnd.amazon.ebook\"],[\"bin\",\"application/octet-stream\"],[\"bmp\",\"image/bmp\"],[\"bz\",\"application/x-bzip\"],[\"bz2\",\"application/x-bzip2\"],[\"cda\",\"application/x-cdf\"],[\"csh\",\"application/x-csh\"],[\"css\",\"text/css\"],[\"csv\",\"text/csv\"],[\"doc\",\"application/msword\"],[\"docx\",\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"],[\"eot\",\"application/vnd.ms-fontobject\"],[\"epub\",\"application/epub+zip\"],[\"gz\",\"application/gzip\"],[\"gif\",\"image/gif\"],[\"heic\",\"image/heic\"],[\"heif\",\"image/heif\"],[\"htm\",\"text/html\"],[\"html\",\"text/html\"],[\"ico\",\"image/vnd.microsoft.icon\"],[\"ics\",\"text/calendar\"],[\"jar\",\"application/java-archive\"],[\"jpeg\",\"image/jpeg\"],[\"jpg\",\"image/jpeg\"],[\"jxl\",\"image/jxl\"],[\"js\",\"text/javascript\"],[\"json\",\"application/json\"],[\"jsonld\",\"application/ld+json\"],[\"markdown\",\"text/markdown\"],[\"md\",\"text/markdown\"],[\"mid\",\"audio/midi\"],[\"midi\",\"audio/midi\"],[\"mjs\",\"text/javascript\"],[\"mp3\",\"audio/mpeg\"],[\"mp4\",\"video/mp4\"],[\"mpeg\",\"video/mpeg\"],[\"mpkg\",\"application/vnd.apple.installer+xml\"],[\"odp\",\"application/vnd.oasis.opendocument.presentation\"],[\"ods\",\"application/vnd.oasis.opendocument.spreadsheet\"],[\"odt\",\"application/vnd.oasis.opendocument.text\"],[\"oga\",\"audio/ogg\"],[\"ogv\",\"video/ogg\"],[\"ogx\",\"application/ogg\"],[\"opus\",\"audio/opus\"],[\"otf\",\"font/otf\"],[\"png\",\"image/png\"],[\"pdf\",\"application/pdf\"],[\"php\",\"application/x-httpd-php\"],[\"ppt\",\"application/vnd.ms-powerpoint\"],[\"pptx\",\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"],[\"rar\",\"application/vnd.rar\"],[\"rtf\",\"application/rtf\"],[\"sh\",\"application/x-sh\"],[\"svg\",\"image/svg+xml\"],[\"swf\",\"application/x-shockwave-flash\"],[\"tar\",\"application/x-tar\"],[\"tif\",\"image/tiff\"],[\"tiff\",\"image/tiff\"],[\"ts\",\"video/mp2t\"],[\"ttf\",\"font/ttf\"],[\"txt\",\"text/plain\"],[\"vsd\",\"application/vnd.visio\"],[\"wav\",\"audio/wav\"],[\"weba\",\"audio/webm\"],[\"webm\",\"video/webm\"],[\"webp\",\"image/webp\"],[\"woff\",\"font/woff\"],[\"woff2\",\"font/woff2\"],[\"xhtml\",\"application/xhtml+xml\"],[\"xls\",\"application/vnd.ms-excel\"],[\"xlsx\",\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"],[\"xml\",\"application/xml\"],[\"xul\",\"application/vnd.mozilla.xul+xml\"],[\"zip\",\"application/zip\"],[\"7z\",\"application/x-7z-compressed\"],[\"mkv\",\"video/x-matroska\"],[\"mov\",\"video/quicktime\"],[\"msg\",\"application/vnd.ms-outlook\"]]),t=[\".DS_Store\",\"Thumbs.db\"],o=t=>{let{name:o}=t;if(o&&-1!==o.lastIndexOf(\".\")&&!t.type){let i=(o.split(\".\").pop()||\"\").toLowerCase(),r=e.get(i);r&&Object.defineProperty(t,\"type\",{value:r,writable:!1,configurable:!1,enumerable:!0})}return t},i=(e,t)=>{let i=o(e);if(\"string\"!=typeof i.path){let{webkitRelativePath:o}=e;Object.defineProperty(i,\"path\",{value:\"string\"==typeof t?t:o||e.name,writable:!1,configurable:!1,enumerable:!0})}return i},r=async e=>await new Promise((t,o)=>{e.readEntries(t,o)}),a=async e=>{let t=[],o=await r(e);for(;o.length>0;)t.push(...o),o=await r(e);return t},n=e=>new Promise((t,o)=>{e.file(o=>t(i(o,e.fullPath)),o)}),s=async e=>{let o=[],i=[];for(let t of e){if(\"file\"!==t.kind)continue;let e=t.getAsEntry?t.getAsEntry():t.webkitGetAsEntry();i.push(e)}for(;i.length>0;){let e=i.shift();if(e){if(e.isFile){let i=await n(e);-1===t.indexOf(i.name)&&o.push(i)}else e.isDirectory&&i.push(...await a(e.createReader()))}}return o},d=async e=>{let o=[];for(let r of e)-1===t.indexOf(r.name)&&o.push(i(r));return o},l=async e=>e.dataTransfer?e.dataTransfer.items?await s(e.dataTransfer.items):await d(e.dataTransfer.files):await d(e.target.files),p=\"files-dropzone\",c=\"TOO_MANY_FILES\",h=document.createElement(\"template\"),u=`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;h.innerHTML=`\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;class m extends HTMLElement{#e=null;#t=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(h.content.cloneNode(!0)),this.shadowRoot&&(this.#e=this.shadowRoot.getElementById(\"fileInput\"),this.#t=this.shadowRoot.getElementById(\"dropzoneEl\"))}static get observedAttributes(){return[\"accept\",\"disabled\",\"multiple\",\"no-keyboard\"]}attributeChangedCallback(e,t,o){\"accept\"===e&&t!==o&&this.#e&&(this.#e.accept=this.accept),\"disabled\"===e&&t!==o&&this.#e&&(this.#e.disabled=this.disabled,this.disabled?this.#t?.removeAttribute(\"tabindex\"):this.#t?.setAttribute(\"tabindex\",\"0\")),\"multiple\"===e&&t!==o&&this.#e&&(this.#e.multiple=this.multiple),\"no-keyboard\"===e&&t!==o&&this.#t&&(this.noKeyboard?this.#t.removeAttribute(\"tabindex\"):this.#t.setAttribute(\"tabindex\",\"0\"))}connectedCallback(){this.#o(\"accept\"),this.#o(\"disabled\"),this.#o(\"maxFiles\"),this.#o(\"maxSize\"),this.#o(\"minSize\"),this.#o(\"multiple\"),this.#o(\"noClick\"),this.#o(\"noDrag\"),this.#o(\"noKeyboard\"),this.#o(\"autoFocus\"),this.#o(\"noStyle\"),this.#e?.addEventListener(\"change\",this.#i),this.#t?.addEventListener(\"dragenter\",this.#r),this.#t?.addEventListener(\"dragover\",this.#a),this.#t?.addEventListener(\"dragleave\",this.#n),this.#t?.addEventListener(\"drop\",this.#s),this.#t?.addEventListener(\"click\",this.#d),this.#t?.addEventListener(\"keyup\",this.#l),this.autoFocus&&this.#t?.focus()}disconnectedCallback(){this.#e?.removeEventListener(\"change\",this.#i),this.#t?.removeEventListener(\"dragenter\",this.#r),this.#t?.removeEventListener(\"dragover\",this.#a),this.#t?.removeEventListener(\"dragleave\",this.#n),this.#t?.removeEventListener(\"drop\",this.#s),this.#t?.removeEventListener(\"click\",this.#d),this.#t?.removeEventListener(\"keyup\",this.#l)}get accept(){return this.getAttribute(\"accept\")||\"\"}set accept(e){this.setAttribute(\"accept\",null!=e?e.toString():e)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}get maxFiles(){let e=Number(this.getAttribute(\"max-files\"))||0;return e<=0?1/0:Math.floor(Math.abs(e))}set maxFiles(e){this.setAttribute(\"max-files\",null!=e?e.toString():e)}get maxSize(){let e=this.getAttribute(\"max-size\");if(null===e)return 1/0;let t=Number(e);return Number.isNaN(t)?1/0:t}set maxSize(e){this.setAttribute(\"max-size\",null!=e?e.toString():e)}get minSize(){let e=this.getAttribute(\"min-size\");if(null===e)return 0;let t=Number(e);return Number.isNaN(t)?0:t}set minSize(e){this.setAttribute(\"min-size\",null!=e?e.toString():e)}get multiple(){return this.hasAttribute(\"multiple\")}set multiple(e){this.toggleAttribute(\"multiple\",!!e)}get noClick(){return this.hasAttribute(\"no-click\")}set noClick(e){this.toggleAttribute(\"no-click\",!!e)}get noDrag(){return this.hasAttribute(\"no-drag\")}set noDrag(e){this.toggleAttribute(\"no-drag\",!!e)}get noKeyboard(){return this.hasAttribute(\"no-keyboard\")}set noKeyboard(e){this.toggleAttribute(\"no-keyboard\",!!e)}get autoFocus(){return this.hasAttribute(\"auto-focus\")}set autoFocus(e){this.toggleAttribute(\"auto-focus\",!!e)}get noStyle(){return this.hasAttribute(\"no-style\")}set noStyle(e){this.toggleAttribute(\"no-style\",!!e)}#i=async e=>{try{this.#p(await l(e))}catch(e){this.dispatchEvent(new CustomEvent(`${p}-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}};#r=()=>{this.disabled||this.noDrag||this.dispatchEvent(new Event(`${p}-dragenter`,{bubbles:!0,composed:!0}))};#a=e=>{if(e.preventDefault(),this.disabled||this.noDrag){e.dataTransfer.dropEffect=\"none\";return}e.dataTransfer.dropEffect=\"copy\",this.#t&&(this.#t.classList.add(\"dropzone--dragover\"),this.#t.part.add(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${p}-dragover`,{bubbles:!0,composed:!0}))};#n=()=>{this.disabled||this.noDrag||(this.#t&&(this.#t.classList.remove(\"dropzone--dragover\"),this.#t.part.remove(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${p}-dragleave`,{bubbles:!0,composed:!0})))};#s=async e=>{if(!this.disabled&&!this.noDrag){e.preventDefault(),this.#t&&(this.#t.classList.remove(\"dropzone--dragover\"),this.#t.part.remove(\"dropzone--dragover\"));try{this.#p(await l(e))}catch(e){this.dispatchEvent(new CustomEvent(`${p}-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}}};#d=()=>{this.disabled||this.noClick||this.#e?.click()};#l=e=>{this.disabled||this.noKeyboard||\" \"!==e.key&&\"Enter\"!==e.key||this.#e?.click()};#p(e){if(!Array.isArray(e)||!e.length)return;let t=[],o=[],i=e.length;if(!this.multiple&&i>1)for(let t of e)o.push({file:t,errors:[{code:c,message:\"Too many files selected. Only 1 file is allowed.\"}]});else if(this.multiple&&i>this.maxFiles)for(let t of e)o.push({file:t,errors:[{code:c,message:`Too many files selected. Only ${this.maxFiles} ${this.maxFiles>1?\"files are\":\"file is\"} allowed.`}]});else for(let i of e){let e=function(e,t=\"\"){if(!t)return!0;let o=[...new Set(t.split(\",\").map(e=>e.trim()).filter(Boolean))],i=e.type,r=i.replace(/\\/.*$/,\"\");for(let t of o)if(\".\"===t.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(t.toLowerCase(),e.name.length-t.length))return!0}else if(/\\/\\*$/.test(t)){if(r===t.replace(/\\/.*$/,\"\"))return!0}else if(i===t)return!0;return!1}(i,this.accept),r=i.size>this.maxSize,a=i.size0&&this.dispatchEvent(new CustomEvent(`${p}-drop-accepted`,{bubbles:!0,composed:!0,detail:{acceptedFiles:t}})),o.length>0&&this.dispatchEvent(new CustomEvent(`${p}-drop-rejected`,{bubbles:!0,composed:!0,detail:{rejectedFiles:o}})),this.#e&&(this.#e.value=this.#e.defaultValue)}openFileDialog(){this.disabled||this.#e?.click()}#o(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}static defineCustomElement(e=p){\"undefined\"==typeof window||window.customElements.get(e)||window.customElements.define(e,m)}}m.defineCustomElement();export{m as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $862aa3736b0514bc$exports = {};\n\n$parcel$export($862aa3736b0514bc$exports, \"FilesDropzone\", function () { return $862aa3736b0514bc$export$6ccd1735166caad9; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ // @ts-check\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */ function $38f222170fd4d21a$export$7c47054fed488f80(file, acceptedTypeSpecifiers = \"\") {\n if (!acceptedTypeSpecifiers) return true;\n const acceptedMimeTypesList = [\n ...new Set(acceptedTypeSpecifiers.split(\",\").map((v)=>v.trim()).filter(Boolean))\n ];\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, \"\");\n for (const validType of acceptedMimeTypesList){\n if (validType.charAt(0) === \".\") {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) return true;\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, \"\")) return true;\n } else {\n if (fileMimeType === validType) return true;\n }\n }\n return false;\n}\n\n\n// @ts-check\n/**\n * A map of common file extensions and their associated MIME types.\n */ const $f31161edf38949e9$var$COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n // Others\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]);\nconst $f31161edf38949e9$var$FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n \".DS_Store\",\n \"Thumbs.db\" // Windows\n];\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */ const $f31161edf38949e9$var$toFileWithMimeType = (file)=>{\n const { name: name } = file;\n const hasExtension = name && name.lastIndexOf(\".\") !== -1;\n if (hasExtension && !file.type) {\n const extension = (name.split(\".\").pop() || \"\").toLowerCase();\n const type = $f31161edf38949e9$var$COMMON_MIME_TYPES.get(extension);\n if (type) Object.defineProperty(file, \"type\", {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return file;\n};\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */ const $f31161edf38949e9$var$toFileWithPath = (file, path)=>{\n const fileWithMimeType = $f31161edf38949e9$var$toFileWithMimeType(file);\n // @ts-ignore\n if (typeof fileWithMimeType.path !== \"string\") {\n const { webkitRelativePath: webkitRelativePath } = file;\n Object.defineProperty(fileWithMimeType, \"path\", {\n value: typeof path === \"string\" ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return fileWithMimeType;\n};\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */ const $f31161edf38949e9$var$readEntriesPromise = async (directoryReader)=>{\n return await new Promise((resolve, reject)=>{\n directoryReader.readEntries(resolve, reject);\n });\n};\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */ const $f31161edf38949e9$var$readAllDirectoryEntries = async (directoryReader)=>{\n const entries = [];\n let readEntries = await $f31161edf38949e9$var$readEntriesPromise(directoryReader);\n while(readEntries.length > 0){\n entries.push(...readEntries);\n readEntries = await $f31161edf38949e9$var$readEntriesPromise(directoryReader);\n }\n return entries;\n};\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */ const $f31161edf38949e9$var$getFileFromFileEntry = (fileEntry)=>{\n return new Promise((resolve, reject)=>{\n fileEntry.file((file)=>resolve($f31161edf38949e9$var$toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */ const $f31161edf38949e9$var$getFilesFromDataTransferItemList = async (dataTransferItemList)=>{\n const files = [];\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n for (const item of dataTransferItemList){\n if (item.kind !== \"file\") continue;\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n queue.push(entry);\n }\n while(queue.length > 0){\n const entry = queue.shift();\n if (!entry) continue;\n else if (entry.isFile) {\n const file = await $f31161edf38949e9$var$getFileFromFileEntry(entry);\n if ($f31161edf38949e9$var$FILES_TO_IGNORE.indexOf(file.name) === -1) files.push(file);\n } else if (entry.isDirectory) queue.push(...await $f31161edf38949e9$var$readAllDirectoryEntries(entry.createReader()));\n }\n return files;\n};\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */ const $f31161edf38949e9$var$getFilesFromFileList = async (fileList)=>{\n const files = [];\n for (const file of fileList)if ($f31161edf38949e9$var$FILES_TO_IGNORE.indexOf(file.name) === -1) files.push($f31161edf38949e9$var$toFileWithPath(file));\n return files;\n};\nconst $f31161edf38949e9$export$6d52664cd15c442 = async (evt)=>{\n if (evt.dataTransfer) return evt.dataTransfer.items ? await $f31161edf38949e9$var$getFilesFromDataTransferItemList(evt.dataTransfer.items) : await $f31161edf38949e9$var$getFilesFromFileList(evt.dataTransfer.files);\n return await $f31161edf38949e9$var$getFilesFromFileList(evt.target.files);\n};\n\n\nconst $862aa3736b0514bc$var$COMPONENT_NAME = \"files-dropzone\";\nconst $862aa3736b0514bc$var$TOO_MANY_FILES = \"TOO_MANY_FILES\";\nconst $862aa3736b0514bc$var$FILE_TOO_LARGE = \"FILE_TOO_LARGE\";\nconst $862aa3736b0514bc$var$FILE_TOO_SMALL = \"FILE_TOO_SMALL\";\nconst $862aa3736b0514bc$var$INVALID_MIME_TYPE = \"INVALID_MIME_TYPE\";\nconst $862aa3736b0514bc$var$template = document.createElement(\"template\");\nconst $862aa3736b0514bc$var$styles = /* css */ `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$862aa3736b0514bc$var$template.innerHTML = /* html */ `\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} noClick - Prevents the file dialog from opening when the dropzone is clicked.\n * @property {boolean} noDrag - Prevents the dropzone from reacting to drag events.\n * @property {boolean} noKeyboard - Prevents the dropzone from reacting to keyboard events.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} no-click - Reflects the noClick property.\n * @attribute {boolean} no-drag - Reflects the noDrag property.\n * @attribute {boolean} no-keyboard - Reflects the noKeyboard property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */ class $862aa3736b0514bc$export$6ccd1735166caad9 extends HTMLElement {\n /** @type {Nullable} */ #fileInput = null;\n /** @type {Nullable} */ #dropzoneEl = null;\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($862aa3736b0514bc$var$template.content.cloneNode(true));\n }\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */ this.shadowRoot.getElementById(\"fileInput\");\n this.#dropzoneEl = this.shadowRoot.getElementById(\"dropzoneEl\");\n }\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\",\n \"no-keyboard\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"accept\" && oldValue !== newValue && this.#fileInput) this.#fileInput.accept = this.accept;\n if (name === \"disabled\" && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n if (this.disabled) this.#dropzoneEl?.removeAttribute(\"tabindex\");\n else this.#dropzoneEl?.setAttribute(\"tabindex\", \"0\");\n }\n if (name === \"multiple\" && oldValue !== newValue && this.#fileInput) this.#fileInput.multiple = this.multiple;\n if (name === \"no-keyboard\" && oldValue !== newValue && this.#dropzoneEl) {\n if (this.noKeyboard) this.#dropzoneEl.removeAttribute(\"tabindex\");\n else this.#dropzoneEl.setAttribute(\"tabindex\", \"0\");\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"accept\");\n this.#upgradeProperty(\"disabled\");\n this.#upgradeProperty(\"maxFiles\");\n this.#upgradeProperty(\"maxSize\");\n this.#upgradeProperty(\"minSize\");\n this.#upgradeProperty(\"multiple\");\n this.#upgradeProperty(\"noClick\");\n this.#upgradeProperty(\"noDrag\");\n this.#upgradeProperty(\"noKeyboard\");\n this.#upgradeProperty(\"autoFocus\");\n this.#upgradeProperty(\"noStyle\");\n this.#fileInput?.addEventListener(\"change\", this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener(\"dragenter\", this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener(\"dragover\", this.#handleDragOver);\n this.#dropzoneEl?.addEventListener(\"dragleave\", this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener(\"drop\", this.#handleDrop);\n this.#dropzoneEl?.addEventListener(\"click\", this.#handleClick);\n this.#dropzoneEl?.addEventListener(\"keyup\", this.#handleKeyUp);\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#fileInput?.removeEventListener(\"change\", this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener(\"dragenter\", this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener(\"dragover\", this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener(\"dragleave\", this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener(\"drop\", this.#handleDrop);\n this.#dropzoneEl?.removeEventListener(\"click\", this.#handleClick);\n this.#dropzoneEl?.removeEventListener(\"keyup\", this.#handleKeyUp);\n }\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */ get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(value) {\n this.setAttribute(\"accept\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */ get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(value) {\n this.toggleAttribute(\"disabled\", !!value);\n }\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */ get maxFiles() {\n const num = Number(this.getAttribute(\"max-files\")) || 0;\n if (num <= 0) return Infinity;\n return Math.floor(Math.abs(num));\n }\n set maxFiles(value) {\n this.setAttribute(\"max-files\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */ get maxSize() {\n const value = this.getAttribute(\"max-size\");\n if (value === null) return Infinity;\n const num = Number(value);\n return Number.isNaN(num) ? Infinity : num;\n }\n set maxSize(value) {\n this.setAttribute(\"max-size\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */ get minSize() {\n const value = this.getAttribute(\"min-size\");\n if (value === null) return 0;\n const num = Number(value);\n return Number.isNaN(num) ? 0 : num;\n }\n set minSize(value) {\n this.setAttribute(\"min-size\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */ get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(value) {\n this.toggleAttribute(\"multiple\", !!value);\n }\n /**\n * @type {boolean} - Prevents the file dialog from opening when the dropzone is clicked.\n * @default false\n * @attribute no-click - Reflects the noClick property.\n */ get noClick() {\n return this.hasAttribute(\"no-click\");\n }\n set noClick(value) {\n this.toggleAttribute(\"no-click\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from reacting to drag events.\n * @default false\n * @attribute no-drag - Reflects the noDrag property.\n */ get noDrag() {\n return this.hasAttribute(\"no-drag\");\n }\n set noDrag(value) {\n this.toggleAttribute(\"no-drag\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from reacting to keyboard events.\n * @default false\n * @attribute no-keyboard - Reflects the noKeyboard property.\n */ get noKeyboard() {\n return this.hasAttribute(\"no-keyboard\");\n }\n set noKeyboard(value) {\n this.toggleAttribute(\"no-keyboard\", !!value);\n }\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */ get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(value) {\n this.toggleAttribute(\"auto-focus\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */ get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(value) {\n this.toggleAttribute(\"no-style\", !!value);\n }\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */ #handleFileInputChange = async (evt)=>{\n try {\n this.#handleFilesSelect(await (0, $f31161edf38949e9$export$6d52664cd15c442)(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n };\n /**\n * Handles the dragenter event of the dropzone.\n */ #handleDragEnter = ()=>{\n if (this.disabled || this.noDrag) return;\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleDragOver = (evt)=>{\n evt.preventDefault();\n if (this.disabled || this.noDrag) {\n evt.dataTransfer.dropEffect = \"none\";\n return;\n }\n evt.dataTransfer.dropEffect = \"copy\";\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add(\"dropzone--dragover\");\n this.#dropzoneEl.part.add(\"dropzone--dragover\");\n }\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the dragleave event of the dropzone.\n */ #handleDragLeave = ()=>{\n if (this.disabled || this.noDrag) return;\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove(\"dropzone--dragover\");\n this.#dropzoneEl.part.remove(\"dropzone--dragover\");\n }\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleDrop = async (evt)=>{\n if (this.disabled || this.noDrag) return;\n evt.preventDefault();\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove(\"dropzone--dragover\");\n this.#dropzoneEl.part.remove(\"dropzone--dragover\");\n }\n try {\n this.#handleFilesSelect(await (0, $f31161edf38949e9$export$6d52664cd15c442)(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n };\n /**\n * Handles the click event of the dropzone.\n */ #handleClick = ()=>{\n if (this.disabled || this.noClick) return;\n this.#fileInput?.click();\n };\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleKeyUp = (evt)=>{\n if (this.disabled || this.noKeyboard) return;\n if (evt.key === \" \" || evt.key === \"Enter\") this.#fileInput?.click();\n };\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */ #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) return;\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) for (const file of files)rejectedFiles.push({\n file: file,\n errors: [\n {\n code: $862aa3736b0514bc$var$TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }\n ]\n });\n else if (this.multiple && filesLength > this.maxFiles) // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files)rejectedFiles.push({\n file: file,\n errors: [\n {\n code: $862aa3736b0514bc$var$TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files){\n const fileHasValidType = (0, $38f222170fd4d21a$export$7c47054fed488f80)(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) acceptedFiles.push(file);\n else {\n const errors = [];\n if (!fileHasValidType) errors.push({\n code: $862aa3736b0514bc$var$INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n if (fileExceedsMaxSize) errors.push({\n code: $862aa3736b0514bc$var$FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n if (fileIsSmallerThanMinSize) errors.push({\n code: $862aa3736b0514bc$var$FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n rejectedFiles.push({\n file: file,\n errors: errors\n });\n }\n }\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles: acceptedFiles,\n rejectedFiles: rejectedFiles\n }\n }));\n if (acceptedFiles.length > 0) this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles: acceptedFiles\n }\n }));\n if (rejectedFiles.length > 0) this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles: rejectedFiles\n }\n }));\n if (this.#fileInput) this.#fileInput.value = this.#fileInput.defaultValue;\n }\n /**\n * Opens the file dialog programmatically.\n */ openFileDialog() {\n if (this.disabled) return;\n this.#fileInput?.click();\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'noClick' | 'noDrag' | 'noKeyboard' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */ static defineCustomElement(elementName = $862aa3736b0514bc$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $862aa3736b0514bc$export$6ccd1735166caad9);\n }\n}\n\n\n(0, $862aa3736b0514bc$export$6ccd1735166caad9).defineCustomElement();\n\n\nexport {$862aa3736b0514bc$export$6ccd1735166caad9 as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","import { FilesDropzone } from './files-dropzone.js';\n\nFilesDropzone.defineCustomElement();\n\nexport { FilesDropzone };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nimport { isValidFile } from './utils/is-valid-file.js';\nimport { getFilesFromEvent } from './utils/files-selector.js';\n\nconst COMPONENT_NAME = 'files-dropzone';\nconst TOO_MANY_FILES = 'TOO_MANY_FILES';\nconst FILE_TOO_LARGE = 'FILE_TOO_LARGE';\nconst FILE_TOO_SMALL = 'FILE_TOO_SMALL';\nconst INVALID_MIME_TYPE = 'INVALID_MIME_TYPE';\nconst template = document.createElement('template');\n\nconst styles = /* css */`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n\ntemplate.innerHTML = /* html */`\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\n\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} noClick - Prevents the file dialog from opening when the dropzone is clicked.\n * @property {boolean} noDrag - Prevents the dropzone from reacting to drag events.\n * @property {boolean} noKeyboard - Prevents the dropzone from reacting to keyboard events.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} no-click - Reflects the noClick property.\n * @attribute {boolean} no-drag - Reflects the noDrag property.\n * @attribute {boolean} no-keyboard - Reflects the noKeyboard property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */\nclass FilesDropzone extends HTMLElement {\n /** @type {Nullable} */\n #fileInput = null;\n\n /** @type {Nullable} */\n #dropzoneEl = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */(this.shadowRoot.getElementById('fileInput'));\n this.#dropzoneEl = this.shadowRoot.getElementById('dropzoneEl');\n }\n }\n\n static get observedAttributes() {\n return ['accept', 'disabled', 'multiple', 'no-keyboard'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'accept' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.accept = this.accept;\n }\n\n if (name === 'disabled' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n\n if (this.disabled) {\n this.#dropzoneEl?.removeAttribute('tabindex');\n } else {\n this.#dropzoneEl?.setAttribute('tabindex', '0');\n }\n }\n\n if (name === 'multiple' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.multiple = this.multiple;\n }\n\n if (name === 'no-keyboard' && oldValue !== newValue && this.#dropzoneEl) {\n if (this.noKeyboard) {\n this.#dropzoneEl.removeAttribute('tabindex');\n } else {\n this.#dropzoneEl.setAttribute('tabindex', '0');\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('accept');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('maxFiles');\n this.#upgradeProperty('maxSize');\n this.#upgradeProperty('minSize');\n this.#upgradeProperty('multiple');\n this.#upgradeProperty('noClick');\n this.#upgradeProperty('noDrag');\n this.#upgradeProperty('noKeyboard');\n this.#upgradeProperty('autoFocus');\n this.#upgradeProperty('noStyle');\n\n this.#fileInput?.addEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.addEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.addEventListener('click', this.#handleClick);\n this.#dropzoneEl?.addEventListener('keyup', this.#handleKeyUp);\n\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#fileInput?.removeEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.removeEventListener('click', this.#handleClick);\n this.#dropzoneEl?.removeEventListener('keyup', this.#handleKeyUp);\n }\n\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */\n get accept() {\n return this.getAttribute('accept') || '';\n }\n\n set accept(value) {\n this.setAttribute('accept', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */\n get maxFiles() {\n const num = Number(this.getAttribute('max-files')) || 0;\n\n if (num <= 0) {\n return Infinity;\n }\n\n return Math.floor(Math.abs(num));\n }\n\n set maxFiles(value) {\n this.setAttribute('max-files', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */\n get maxSize() {\n const value = this.getAttribute('max-size');\n\n if (value === null) {\n return Infinity;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? Infinity : num;\n }\n\n set maxSize(value) {\n this.setAttribute('max-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */\n get minSize() {\n const value = this.getAttribute('min-size');\n\n if (value === null) {\n return 0;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? 0 : num;\n }\n\n set minSize(value) {\n this.setAttribute('min-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */\n get multiple() {\n return this.hasAttribute('multiple');\n }\n\n set multiple(value) {\n this.toggleAttribute('multiple', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the file dialog from opening when the dropzone is clicked.\n * @default false\n * @attribute no-click - Reflects the noClick property.\n */\n get noClick() {\n return this.hasAttribute('no-click');\n }\n\n set noClick(value) {\n this.toggleAttribute('no-click', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from reacting to drag events.\n * @default false\n * @attribute no-drag - Reflects the noDrag property.\n */\n get noDrag() {\n return this.hasAttribute('no-drag');\n }\n\n set noDrag(value) {\n this.toggleAttribute('no-drag', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from reacting to keyboard events.\n * @default false\n * @attribute no-keyboard - Reflects the noKeyboard property.\n */\n get noKeyboard() {\n return this.hasAttribute('no-keyboard');\n }\n\n set noKeyboard(value) {\n this.toggleAttribute('no-keyboard', !!value);\n }\n\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */\n get autoFocus() {\n return this.hasAttribute('auto-focus');\n }\n\n set autoFocus(value) {\n this.toggleAttribute('auto-focus', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */\n get noStyle() {\n return this.hasAttribute('no-style');\n }\n\n set noStyle(value) {\n this.toggleAttribute('no-style', !!value);\n }\n\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */\n #handleFileInputChange = async evt => {\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n };\n\n /**\n * Handles the dragenter event of the dropzone.\n */\n #handleDragEnter = () => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDragOver = evt => {\n evt.preventDefault();\n\n if (this.disabled || this.noDrag) {\n evt.dataTransfer.dropEffect = 'none';\n return;\n }\n\n evt.dataTransfer.dropEffect = 'copy';\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add('dropzone--dragover');\n this.#dropzoneEl.part.add('dropzone--dragover');\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the dragleave event of the dropzone.\n */\n #handleDragLeave = () => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDrop = async evt => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n evt.preventDefault();\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n };\n\n /**\n * Handles the click event of the dropzone.\n */\n #handleClick = () => {\n if (this.disabled || this.noClick) {\n return;\n }\n\n this.#fileInput?.click();\n };\n\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleKeyUp = evt => {\n if (this.disabled || this.noKeyboard) {\n return;\n }\n\n if (evt.key === ' ' || evt.key === 'Enter') {\n this.#fileInput?.click();\n }\n };\n\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */\n #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) {\n return;\n }\n\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) {\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [{\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }]\n });\n }\n } else if (this.multiple && filesLength > this.maxFiles) {\n // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [{\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? 'files are' : 'file is'} allowed.`\n }]\n });\n }\n } else {\n // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files) {\n const fileHasValidType = isValidFile(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) {\n acceptedFiles.push(file);\n } else {\n const errors = [];\n\n if (!fileHasValidType) {\n errors.push({\n code: INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n }\n\n if (fileExceedsMaxSize) {\n errors.push({\n code: FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n }\n\n if (fileIsSmallerThanMinSize) {\n errors.push({\n code: FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n }\n\n rejectedFiles.push({ file, errors });\n }\n }\n }\n\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles,\n rejectedFiles\n }\n }));\n\n if (acceptedFiles.length > 0) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles\n }\n }));\n }\n\n if (rejectedFiles.length > 0) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles\n }\n }));\n }\n\n if (this.#fileInput) {\n this.#fileInput.value = this.#fileInput.defaultValue;\n }\n }\n\n /**\n * Opens the file dialog programmatically.\n */\n openFileDialog() {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'noClick' | 'noDrag' | 'noKeyboard' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, FilesDropzone);\n }\n }\n}\n\nexport { FilesDropzone };\n","// @ts-check\n\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */\nexport function isValidFile(file, acceptedTypeSpecifiers = '') {\n if (!acceptedTypeSpecifiers) {\n return true;\n }\n\n const acceptedMimeTypesList = [\n ...new Set(acceptedTypeSpecifiers.split(',').map(v => v.trim()).filter(Boolean))\n ];\n\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, '');\n\n for (const validType of acceptedMimeTypesList) {\n if (validType.charAt(0) === '.') {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {\n return true;\n }\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, '')) {\n return true;\n }\n } else {\n if (fileMimeType === validType) {\n return true;\n }\n }\n }\n\n return false;\n}\n","// @ts-check\n\n/**\n * A map of common file extensions and their associated MIME types.\n */\nconst COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n ['aac', 'audio/aac'],\n ['abw', 'application/x-abiword'],\n ['arc', 'application/x-freearc'],\n ['avif', 'image/avif'],\n ['avi', 'video/x-msvideo'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bin', 'application/octet-stream'],\n ['bmp', 'image/bmp'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['cda', 'application/x-cdf'],\n ['csh', 'application/x-csh'],\n ['css', 'text/css'],\n ['csv', 'text/csv'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['epub', 'application/epub+zip'],\n ['gz', 'application/gzip'],\n ['gif', 'image/gif'],\n ['heic', 'image/heic'],\n ['heif', 'image/heif'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['ico', 'image/vnd.microsoft.icon'],\n ['ics', 'text/calendar'],\n ['jar', 'application/java-archive'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['jxl', 'image/jxl'],\n ['js', 'text/javascript'],\n ['json', 'application/json'],\n ['jsonld', 'application/ld+json'],\n ['markdown', 'text/markdown'],\n ['md', 'text/markdown'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mjs', 'text/javascript'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mpeg', 'video/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['opus', 'audio/opus'],\n ['otf', 'font/otf'],\n ['png', 'image/png'],\n ['pdf', 'application/pdf'],\n ['php', 'application/x-httpd-php'],\n ['ppt', 'application/vnd.ms-powerpoint'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['rar', 'application/vnd.rar'],\n ['rtf', 'application/rtf'],\n ['sh', 'application/x-sh'],\n ['svg', 'image/svg+xml'],\n ['swf', 'application/x-shockwave-flash'],\n ['tar', 'application/x-tar'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['ts', 'video/mp2t'],\n ['ttf', 'font/ttf'],\n ['txt', 'text/plain'],\n ['vsd', 'application/vnd.visio'],\n ['wav', 'audio/wav'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['xhtml', 'application/xhtml+xml'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['zip', 'application/zip'],\n ['7z', 'application/x-7z-compressed'],\n\n // Others\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['msg', 'application/vnd.ms-outlook']\n]);\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */\nconst toFileWithMimeType = file => {\n const { name } = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const extension = (name.split('.').pop() || '').toLowerCase();\n const type = COMMON_MIME_TYPES.get(extension);\n\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n};\n\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */\nconst toFileWithPath = (file, path) => {\n const fileWithMimeType = toFileWithMimeType(file);\n\n // @ts-ignore\n if (typeof fileWithMimeType.path !== 'string') {\n const { webkitRelativePath } = file;\n\n Object.defineProperty(fileWithMimeType, 'path', {\n value: typeof path === 'string' ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n\n return fileWithMimeType;\n};\n\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readEntriesPromise = async directoryReader => {\n return await new Promise((resolve, reject) => {\n directoryReader.readEntries(resolve, reject);\n });\n};\n\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readAllDirectoryEntries = async directoryReader => {\n const entries = [];\n let readEntries = await readEntriesPromise(directoryReader);\n\n while (readEntries.length > 0) {\n entries.push(...readEntries);\n readEntries = await readEntriesPromise(directoryReader);\n }\n\n return entries;\n};\n\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */\nconst getFileFromFileEntry = fileEntry => {\n return new Promise((resolve, reject) => {\n fileEntry.file(file => resolve(toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromDataTransferItemList = async dataTransferItemList => {\n const files = [];\n\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n\n for (const item of dataTransferItemList) {\n if (item.kind !== 'file') {\n // Ignore non-file items, such as links.\n continue;\n }\n\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n\n queue.push(entry);\n }\n\n while (queue.length > 0) {\n const entry = queue.shift();\n\n if (!entry) {\n continue;\n } else if (entry.isFile) {\n const file = await getFileFromFileEntry(entry);\n\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(file);\n }\n } else if (entry.isDirectory) {\n queue.push(...await readAllDirectoryEntries(entry.createReader()));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromFileList = async fileList => {\n const files = [];\n\n for (const file of fileList) {\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(toFileWithPath(file));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from an event.\n * This function supports both `drop` and `change` events.\n *\n * @param {*} evt - The event to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nexport const getFilesFromEvent = async evt => {\n if (evt.dataTransfer) {\n return evt.dataTransfer.items\n ? await getFilesFromDataTransferItemList(evt.dataTransfer.items)\n : await getFilesFromFileList(evt.dataTransfer.files);\n }\n\n return await getFilesFromFileList(evt.target.files);\n};\n","/**\n * Removes one or more elements from an array at the specified index(es).\n *\n * @param {Array} array The initial array to remove elements from.\n * @param {Number} ...indexes The index(es) of the elements to be removed. Non numbers are ignored.\n * @throws {TypeError} If `array` is not array.\n * @returns {Array} The result array with the elements specified removed.\n * @example\n *\n * const arr = [1, 2, 3, 4, 5];\n *\n * remove(arr, 0);\n * // => [2, 3, 4, 5]\n *\n * remove(arr, 0, 1);\n * // => [3, 4, 5]\n *\n * remove(arr, 0, 4);\n * // => [2, 3, 4]\n *\n * remove(arr);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length - 1);\n * // => [1, 2, 3, 4]\n *\n * remove(arr, NaN);\n * // => [1, 2, 3, 4, 5]\n */\nexport const arrayRemove = (array, ...indexes) => {\n if (!Array.isArray(array)) {\n throw new TypeError('Expected an array for first argument');\n }\n\n return array.filter((_, i) => indexes.indexOf(i) === -1);\n};\n","/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */\nconst uid = (prefix = '', suffix = '') => {\n const prefixString = typeof prefix === 'string' && prefix !== '' ? prefix + '-' : '';\n const suffixString = typeof suffix === 'string' && suffix !== '' ? '-' + suffix : '';\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n\n return `${prefixString}${randomString}${suffixString}`;\n};\n\nexport { uid };\n","export const ACCEPTED_MIME_TYPES = ['image/jpg', 'image/jpeg', 'image/png', 'image/apng', 'image/gif', 'image/webp', 'image/avif'];\n","import AntonRegular from 'url:../assets/fonts/Anton/Anton-Regular.ttf';\nimport OswaldRegular from 'url:../assets/fonts/Oswald/Oswald-Regular.ttf';\nimport OswaldBold from 'url:../assets/fonts/Oswald/Oswald-Bold.ttf';\nimport RobotoRegular from 'url:../assets/fonts/Roboto/Roboto-Regular.ttf';\nimport RobotoBold from 'url:../assets/fonts/Roboto/Roboto-Bold.ttf';\nimport RobotoCondensedRegular from 'url:../assets/fonts/RobotoCondensed/RobotoCondensed-Regular.ttf';\nimport RobotoCondensedBold from 'url:../assets/fonts/RobotoCondensed/RobotoCondensed-Bold.ttf';\nimport CourierPrimeRegular from 'url:../assets/fonts/CourierPrime/CourierPrime-Regular.ttf';\nimport CourierPrimeBold from 'url:../assets/fonts/CourierPrime/CourierPrime-Bold.ttf';\nimport OpenSansRegular from 'url:../assets/fonts/OpenSans/OpenSans-Regular.ttf';\nimport OpenSansBold from 'url:../assets/fonts/OpenSans/OpenSans-Bold.ttf';\n\nexport const customFonts = [\n { name: 'Anton', label: 'Anton', path: AntonRegular, style: 'normal', weight: '400' },\n { name: 'Oswald-Regular', label: 'Oswald', path: OswaldRegular, style: 'normal', weight: '400' },\n { name: 'Oswald-Bold', label: 'Oswald Bold', path: OswaldBold, style: 'normal', weight: '700' },\n { name: 'Roboto-Regular', label: 'Roboto', path: RobotoRegular, style: 'normal', weight: '400' },\n { name: 'Roboto-Bold', label: 'Roboto Bold', path: RobotoBold, style: 'normal', weight: '700' },\n { name: 'RobotoCondensed-Regular', label: 'Roboto Condensed', path: RobotoCondensedRegular, style: 'normal', weight: '400' },\n { name: 'RobotoCondensed-Bold', label: 'Roboto Condensed Bold', path: RobotoCondensedBold, style: 'normal', weight: '700' },\n { name: 'CourierPrime-Regular', label: 'Courier Prime', path: CourierPrimeRegular, style: 'normal', weight: '400' },\n { name: 'CourierPrime-Bold', label: 'Courier Prime Bold', path: CourierPrimeBold, style: 'normal', weight: '700' },\n { name: 'OpenSans-Regular', label: 'Open Sans', path: OpenSansRegular, style: 'normal', weight: '400' },\n { name: 'OpenSans-Bold', label: 'Open Sans Bold', path: OpenSansBold, style: 'normal', weight: '400' }\n];\n\nexport const loadCustomFont = async (name, path, options = {}) => {\n try {\n const font = new FontFace(name, `url(${path})`, { ...options });\n await font.load();\n document.fonts.add(font);\n } catch (err) {\n console.error(err);\n }\n};\n","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"Anton-Regular.e58ab3fe.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"Oswald-Regular.89ec7d89.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"Oswald-Bold.0f6a7ca6.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"Roboto-Regular.ca197847.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"Roboto-Bold.fdb9b54a.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"RobotoCondensed-Regular.d585f5c7.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"RobotoCondensed-Bold.e1f96d4b.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"CourierPrime-Regular.3a25a501.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"CourierPrime-Bold.3d6bf689.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"OpenSans-Regular.edf9e01b.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"OpenSans-Bold.8fceb72b.ttf\";","import { ACCEPTED_MIME_TYPES } from './constants.js';\n\nexport const fileFromUrl = async (options = {}) => {\n const res = await fetch(options.url);\n const blob = await res.blob();\n const mimeType = options.mimeType || blob.type || '';\n\n if (!ACCEPTED_MIME_TYPES.includes(mimeType)) {\n throw new Error(`This is not an accepted image format. Accepted MIME types are: ${ACCEPTED_MIME_TYPES.join(', ')}`);\n }\n\n return new File([blob], options.filename || '', blob);\n};\n","const errorsContainer = document.getElementById('errorsContainer');\n\nconst hideError = evt => {\n const target = evt.currentTarget;\n target.removeEventListener('click', hideError);\n errorsContainer.removeChild(target.parentNode);\n};\n\nexport const toastAlert = (message = '', type = 'info') => {\n const types = ['info', 'warning', 'danger'];\n\n if (!types.includes(type)) {\n type = 'info';\n }\n\n const template = /* html */`\n ${message}\n \n `;\n\n const div = document.createElement('div');\n div.className = `alert alert-${type} alert-dismissible text-break mb-2 fade`;\n div.innerHTML = template;\n div.querySelector('button').addEventListener('click', hideError);\n errorsContainer.appendChild(div);\n setTimeout(() => div.classList.add('show'), 100);\n};\n","import { customFonts } from './custom-fonts.js';\n\nexport const createTextBox = (index, data = {}) => {\n const inputTemplate = /* html */`\n
\n \n\n \n\n
\n \n \n \n
\n
\n\n
\n
\n
\n \n\n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n \n \n \n \n
\n
\n
\n\n
\n
\n
\n \n \n
\n
\n
\n
\n `;\n\n const fragment = document.createDocumentFragment();\n const div = document.createElement('div');\n\n div.className = 'bg-light border shadow-sm mb-3 rounded';\n div.setAttribute('data-section', 'textBox');\n div.setAttribute('data-index', index);\n div.innerHTML = inputTemplate;\n div.querySelector('[data-input=\"font\"]').value = data.font;\n div.querySelector('[data-input=\"textAlign\"]').value = data.textAlign;\n div.querySelector('[data-input=\"allCaps\"]').checked = data.allCaps;\n\n return fragment.appendChild(div);\n};\n","export const drawCanvas = (image, canvas, ctx, textOptions = []) => {\n if (image == null) {\n return;\n }\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n if (typeof image === 'string') { // Assume it's a color\n ctx.fillStyle = image;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n } else {\n ctx.drawImage(image, 0, 0, canvas.width, canvas.height);\n }\n\n textOptions.forEach(function (item, index) {\n ctx.font = `${item.fontWeight} ${item.fontSize}px ${item.font}`;\n\n const multiplier = index + 1;\n const lineHeight = ctx.measureText('M').width + item.fontSize / 2;\n const xPos = canvas.width / 2;\n const shadowBlur = item.shadowBlur;\n const text = item.allCaps === true ? item.text.toUpperCase() : item.text;\n const textLines = text.split('\\n');\n\n ctx.fillStyle = item.fillColor;\n ctx.textAlign = item.textAlign;\n ctx.save();\n\n if (shadowBlur !== 0) {\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n ctx.shadowBlur = shadowBlur;\n ctx.shadowColor = item.shadowColor;\n }\n\n if (item.rotate) {\n ctx.translate(xPos + item.offsetX, lineHeight * multiplier + item.offsetY);\n ctx.rotate(item.rotate * Math.PI / 180);\n textLines.forEach((text, index) => ctx.fillText(text, 0, index * lineHeight));\n ctx.rotate(-(item.rotate * Math.PI / 180));\n ctx.translate(-(xPos + item.offsetX), -(lineHeight * multiplier + item.offsetY));\n } else {\n textLines.forEach((text, index) => {\n ctx.fillText(text, xPos + item.offsetX, index * lineHeight + lineHeight * multiplier + item.offsetY);\n });\n }\n\n ctx.restore();\n });\n};"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$interopDefault","a","__esModule","default","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$94933cc6427541bd$export$c37129e465f64ef0","navigator","canShare","$0380ce8f1f064ccc$export$6503ec6e8aabbaf","$0380ce8f1f064ccc$var$mapping","Map","baseUrl","manifest","i","length","path","$7dd1ddf6834435ca$export$bdfd709ae4826697","$7dd1ddf6834435ca$var$bundleURL","value","$7dd1ddf6834435ca$var$getBundleURL","matches","stack","match","replace","getBundleURL","JSON","parse","$4f74a8126e204146$export$30b344bef3e55b67","$4f74a8126e204146$var$t","$4f74a8126e204146$var$e","document","createElement","innerHTML","HTMLElement","t","constructor","shadowRoot","attachShadow","mode","delegatesFocus","appendChild","content","cloneNode","querySelector","observedAttributes","attributeChangedCallback","toggleAttribute","disabled","setAttribute","toString","part","contains","toggle","connectedCallback","r","addEventListener","disconnectedCallback","removeEventListener","hasAttribute","shareUrl","getAttribute","shareTitle","shareText","shareFiles","Array","isArray","share","url","title","text","files","dispatchEvent","CustomEvent","bubbles","composed","detail","shareData","name","error","preventDefault","target","nodeName","assignedElements","flatten","find","prototype","hasOwnProperty","defineCustomElement","customElements","define","$636b0cf1ed0b9f88$export$cc30a98fe3890794","$636b0cf1ed0b9f88$var$t","Number","isNaN","Math","min","max","$636b0cf1ed0b9f88$var$e","$636b0cf1ed0b9f88$var$i","$636b0cf1ed0b9f88$var$o","o","l","getSupportedConstraints","isConnected","getTrackCapabilities","getTrackSettings","u","includes","facingMode","stopVideoStream","startVideoStream","cameraResolution","trim","split","map","width","height","pan","h","tilt","zoom","d","getElementById","c","m","p","g","b","f","isSupported","message","autoPlay","noImage","loading","calculateFileSize","capture","play","then","video","catch","finally","removeAttribute","from","childNodes","forEach","remove","getVideoTracks","applyConstraints","advanced","ideal","audio","mediaDevices","getUserMedia","srcObject","hidden","stop","getContext","videoWidth","videoHeight","drawImage","toDataURL","Image","src","dataURI","fetch","blob","size","getCapabilities","getSettings","$4da30046ce6d9325$export$32589115725b904b","$4da30046ce6d9325$var$e","open","showModal","body","style","overflowY","element","close","noHeader","classList","noAnimations","noCloseButton","clearTimeout","staticBackdrop","fullscreen","add","setTimeout","defaultPrevented","currentTarget","assignedNodes","cancelable","reason","show","hide","$7aad62ebc3d6fae8$export$6ccd1735166caad9","$7aad62ebc3d6fae8$var$e","$7aad62ebc3d6fae8$var$t","$7aad62ebc3d6fae8$var$o","lastIndexOf","type","pop","toLowerCase","writable","$7aad62ebc3d6fae8$var$i","webkitRelativePath","$7aad62ebc3d6fae8$var$r","Promise","readEntries","$7aad62ebc3d6fae8$var$a","push","$7aad62ebc3d6fae8$var$n","file","fullPath","$7aad62ebc3d6fae8$var$s","kind","getAsEntry","webkitGetAsEntry","shift","isFile","indexOf","isDirectory","createReader","$7aad62ebc3d6fae8$var$d","$7aad62ebc3d6fae8$var$l","dataTransfer","items","$7aad62ebc3d6fae8$var$p","$7aad62ebc3d6fae8$var$c","$7aad62ebc3d6fae8$var$h","$7aad62ebc3d6fae8$var$u","accept","multiple","noKeyboard","autoFocus","focus","maxFiles","floor","abs","maxSize","minSize","noClick","noDrag","noStyle","Event","dropEffect","click","key","errors","Set","filter","Boolean","charAt","test","acceptedFiles","rejectedFiles","defaultValue","openFileDialog","$5742c9e143620cb1$export$30a014203d0d7e4f","array","indexes","TypeError","_","$21c3f3a8dccfa4fd$export$e2a22331486dcca0","prefix","suffix","randomString","random","substring","$33dea9d9a6da4c9a$export$63e7bed68b07a85c","$b9a1dffffdf320f2$exports","$6f8f0ad93b4f4fec$exports","$60f12aeb358e1d01$exports","$b312cc3e2ac443c7$exports","$481315e8ee95f8f9$exports","$7cee0a691e2711a6$exports","$12b7043e62e67366$exports","$f224edc54658ebde$exports","$33ce2f42587a9c55$exports","$1375393a097acb0e$exports","$728f6ce83c7b6e27$exports","$055531bbd0af154c$export$6874249d87f2602a","label","weight","$055531bbd0af154c$export$59eceaef0c7797b2","options","font","FontFace","load","fonts","console","$008970865eefc93d$export$6539e087749cf9d3","res","mimeType","join","File","filename","$166cfb2484b08c80$var$errorsContainer","$166cfb2484b08c80$var$hideError","evt","removeChild","parentNode","$166cfb2484b08c80$export$af04143326425dbd","types","template","div","className","$50a37fdc18d479c2$export$293a4b86a6fe2398","index","data","inputTemplate","fillColor","shadowColor","_isSettingsOpen","fontSize","shadowBlur","rotate","offsetY","offsetX","fragment","createDocumentFragment","textAlign","checked","allCaps","$d346fdc99aed49b3$export$e653a2de0f3a8b89","image","canvas","ctx","textOptions","clearRect","fillStyle","fillRect","item","fontWeight","multiplier","lineHeight","measureText","xPos","textLines","toUpperCase","save","shadowOffsetX","shadowOffsetY","translate","PI","fillText","restore","$44ae6d9db4eaca0f$var$videoModal","$44ae6d9db4eaca0f$var$downloadModal","$44ae6d9db4eaca0f$var$canvas","$44ae6d9db4eaca0f$var$dropzoneEl","$44ae6d9db4eaca0f$var$instructionsEl","$44ae6d9db4eaca0f$var$ctx","$44ae6d9db4eaca0f$var$imageUploadMethodSelect","$44ae6d9db4eaca0f$var$fileSelectBtn","$44ae6d9db4eaca0f$var$imageUrlForm","$44ae6d9db4eaca0f$var$addTextboxBtn","$44ae6d9db4eaca0f$var$inputsContainer","$44ae6d9db4eaca0f$var$generateMemeBtn","$44ae6d9db4eaca0f$var$openVideoModalBtn","$44ae6d9db4eaca0f$var$downloadMemeBtn","$44ae6d9db4eaca0f$var$downloadMemePreview","$44ae6d9db4eaca0f$var$webShareComponent","$44ae6d9db4eaca0f$var$galleryEl","$44ae6d9db4eaca0f$var$gallerySearchEl","$44ae6d9db4eaca0f$var$galleryNoResultsEl","$44ae6d9db4eaca0f$var$solidColorForm","$44ae6d9db4eaca0f$var$uploadMethodEls","querySelectorAll","$44ae6d9db4eaca0f$var$selectedImage","$44ae6d9db4eaca0f$var$reqAnimFrame","$44ae6d9db4eaca0f$var$defaultTextOptions","$44ae6d9db4eaca0f$var$textOptions","$44ae6d9db4eaca0f$var$generateMeme","dataUrl","downloadLink","download","href","$44ae6d9db4eaca0f$var$onImageLoaded","MAX_WIDTH","MAX_HEIGHT","$44ae6d9db4eaca0f$var$handleFileSelect","reader","FileReader","result","readAsDataURL","$44ae6d9db4eaca0f$var$handleTextPropChange","prop","$44ae6d9db4eaca0f$var$handleImageUploadFromURL","form","submitButton","imageUrl","$44ae6d9db4eaca0f$var$moveText","offsetDir","sign","textBoxSection","offsetYInput","offsetXInput","requestAnimationFrame","$44ae6d9db4eaca0f$var$handleGalleryClick","button","closest","img","alt","newTextBox","textBoxIndex","textBoxEls","el","settingsEl","confirm","isOffsetYButton","isOffsetXButton","cancelAnimationFrame","query","galleryItems","capturePhotoComponent","$442be162a818aed4$export$c37129e465f64ef0","isWebShareSupported","$e179325634270afd$export$30b344bef3e55b67","$e179325634270afd$var$styles","$e179325634270afd$var$template","buttonSlot","buttonEl","getButton","oldValue","newValue","upgradeProperty","handleSlotChange","handleClick","instance","elementName","WebShare","$c290816263f90981$export$cc30a98fe3890794","$02ad8beec419df62$export$7d15b64cf5a3a4c4","lower","upper","$c290816263f90981$var$COMPONENT_NAME","$c290816263f90981$var$styles","$c290816263f90981$var$template","supportedConstraints","stream","canvasElement","outputElement","videoElement","captureButtonSlot","captureButton","facingModeButtonSlot","facingModeButton","trackCapabilities","trackSettings","emptyOutputElement","isValidFacingMode","x","widthInAllowedRange","heightInAllowedRange","panInAllowedRange","applyPTZ","tiltInAllowedRange","zoomInAllowedRange","getCaptureButton","getFacingModeButton","onVideoLoadedMetaData","onCaptureButtonSlotChange","onCapturePhotoButtonClick","onFacingModeButtonSlotChange","onFacingModeButtonClick","node","constraintName","constraintValue","track","constraints","eventDetail","CapturePhoto","$180b6dcf923bafc7$export$32589115725b904b","$180b6dcf923bafc7$var$template","dialogEl","footerSlotEl","pulseAnimationTimeout","headerEl","closeBtnEl","handleDialogClick","handleDialogClose","handleDialogCancel","handleCloseButtonClick","handleFooterSlotChange","applyPulseEffectOnDialog","requestCloseEvent","createRequestCloseEvent","footerEl","footerSlotNodes","hasFooterSlotNodes","ModalElement","$862aa3736b0514bc$export$6ccd1735166caad9","$f31161edf38949e9$var$COMMON_MIME_TYPES","$f31161edf38949e9$var$FILES_TO_IGNORE","$f31161edf38949e9$var$toFileWithMimeType","hasExtension","extension","$f31161edf38949e9$var$toFileWithPath","fileWithMimeType","$f31161edf38949e9$var$readEntriesPromise","directoryReader","resolve","reject","$f31161edf38949e9$var$readAllDirectoryEntries","entries","$f31161edf38949e9$var$getFileFromFileEntry","fileEntry","$f31161edf38949e9$var$getFilesFromDataTransferItemList","dataTransferItemList","queue","entry","$f31161edf38949e9$var$getFilesFromFileList","fileList","$f31161edf38949e9$export$6d52664cd15c442","$862aa3736b0514bc$var$COMPONENT_NAME","$862aa3736b0514bc$var$TOO_MANY_FILES","$862aa3736b0514bc$var$template","$862aa3736b0514bc$var$styles","fileInput","dropzoneEl","handleFileInputChange","handleDragEnter","handleDragOver","handleDragLeave","handleDrop","handleKeyUp","num","Infinity","handleFilesSelect","filesLength","fileHasValidType","acceptedTypeSpecifiers","acceptedMimeTypesList","fileMimeType","baseMimeType","validType","fileExceedsMaxSize","fileIsSmallerThanMinSize","FilesDropzone"],"version":3,"file":"index.2a3e2367.js.map"} \ No newline at end of file diff --git a/docs/index.6d051d2c.js.map b/docs/index.6d051d2c.js.map deleted file mode 100644 index fac44f5..0000000 --- a/docs/index.6d051d2c.js.map +++ /dev/null @@ -1 +0,0 @@ -{"mappings":"A,S,E,C,E,O,G,E,U,C,E,O,C,C,C,I,E,A,a,O,W,W,A,a,O,K,K,A,a,O,O,O,A,a,O,O,O,C,E,E,C,E,E,C,E,E,E,iB,CMQA,SAAS,EAAoB,CAAO,EAAA,OAClB,OAAZ,GAAoB,UAAA,OAAO,EACtB,UAAW,WAAa,aAAc,WAAa,UAAU,QAAA,CAAS,GAGxE,UAAW,SACpB,C,M,I,A,C,E,S,C,E,G,K,E,O,C,C,E,C,O,C,G,K,E,C,I,E,C,C,E,A,Q,C,C,E,C,I,E,C,G,E,Q,C,C,E,O,C,C,E,C,E,E,I,C,E,O,C,E,E,O,E,E,O,A,C,I,E,A,M,uB,E,I,O,E,I,C,mB,C,C,E,Q,C,S,C,C,C,E,C,C,E,C,C,E,E,iB,C,G,A,C,E,E,Q,A,E,Q,S,C,C,C,E,O,c,C,E,O,C,W,C,I,W,O,C,E,I,S,C,E,O,E,C,E,W,C,E,a,C,C,GLZA,IAgBA,EAhBI,EAAU,IAAI,IAgBlB,EAfA,SAAkB,CAAO,CAAE,CAAQ,EAC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D,AAAA,IACvB,GAAI,AAAkB,eAAlB,EAAI,MAAM,CAAC,EAAE,CAAmB,CAClC,IAAM,EAAwB,EAAW,aAAa,CAAC,iBAEnD,GAAyB,AAAiD,YAAjD,OAAO,EAAsB,eAAe,EACvE,EAAsB,eAAe,EAEzC,CACF,GAyBA,GAAU,gBAAgB,CAAC,iBAAiB,QAAQ,AAAA,IAClD,EAAM,YAAY,CAAC,QAAS,EAAM,YAAY,CAAC,OACjD,GAEA,GAAY,OAAO,CAAC,CAAC,EAAM,KACzB,GAAgB,WAAW,CAAC,AAAA,EAAc,EAAO,GACnD,GAEA,GAAW,MAAM,CAAG,EAEpB,AAAA,EAAY,OAAO,CAAC,CAAC,CAAA,KAAE,CAAI,CAAA,KAAE,CAAI,CAAA,MAAE,CAAK,CAAA,OAAE,CAAM,CAAE,IAChD,AAAA,EAAe,EAAM,EAAM,CAAE,MAAA,EAAO,OAAA,CAAO,EAC7C","sources":["","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/runtime-57b74f958dd415d8.js","src/js/index.js","node_modules/@georapbox/web-share-element/dist/is-web-share-supported.js","node_modules/@georapbox/web-share-element/dist/","node_modules/@georapbox/web-share-element/dist/src/is-web-share-supported.js","node_modules/@georapbox/web-share-element/dist/web-share-defined.js","node_modules/@georapbox/web-share-element/dist/src/web-share-defined.js","node_modules/@georapbox/web-share-element/dist/src/web-share.js","node_modules/@georapbox/capture-photo-element/dist/capture-photo-defined.js","node_modules/@georapbox/capture-photo-element/dist/","node_modules/@georapbox/capture-photo-element/dist/src/capture-photo-defined.js","node_modules/@georapbox/capture-photo-element/dist/src/capture-photo.js","node_modules/@georapbox/capture-photo-element/dist/src/utils/clamp.js","node_modules/@georapbox/modal-element/dist/modal-element-defined.js","node_modules/@georapbox/modal-element/dist/","node_modules/@georapbox/modal-element/dist/src/modal-element-defined.js","node_modules/@georapbox/modal-element/dist/src/modal-element.js","node_modules/@georapbox/files-dropzone-element/dist/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/dist/","node_modules/@georapbox/files-dropzone-element/dist/src/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/dist/src/files-dropzone.js","node_modules/@georapbox/files-dropzone-element/dist/src/utils/is-valid-file.js","node_modules/@georapbox/files-dropzone-element/dist/src/utils/files-selector.js","src/js/utils/array-remove.js","src/js/utils/uid.js","src/js/constants.js","src/js/custom-fonts.js","node_modules/@parcel/runtime-js/lib/runtime-3165768b2af17669.js","node_modules/@parcel/runtime-js/lib/runtime-73291864e538b74b.js","node_modules/@parcel/runtime-js/lib/runtime-a2fc0bec9703ab72.js","node_modules/@parcel/runtime-js/lib/runtime-b59fd44dfd81b5fd.js","node_modules/@parcel/runtime-js/lib/runtime-bf36396318022d20.js","node_modules/@parcel/runtime-js/lib/runtime-418166379205b8eb.js","node_modules/@parcel/runtime-js/lib/runtime-105db2d9f9edf7cf.js","node_modules/@parcel/runtime-js/lib/runtime-9f8b0d4110a0174a.js","node_modules/@parcel/runtime-js/lib/runtime-94ba5916670c0a2b.js","node_modules/@parcel/runtime-js/lib/runtime-dec7b2cfeb98de11.js","node_modules/@parcel/runtime-js/lib/runtime-1800a52d85f464ab.js","src/js/file-from-url.js","src/js/toast-alert.js","src/js/create-text-box.js","src/js/draw-canvas.js"],"sourcesContent":["\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire5078\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire5078\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"kyEFX\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $ef7689007096c8a0$export$6503ec6e8aabbaf; }, function (v) { return $ef7689007096c8a0$export$6503ec6e8aabbaf = v; });\nvar $ef7689007096c8a0$export$6503ec6e8aabbaf;\nvar $ef7689007096c8a0$export$f7ad0328861e2f03;\n\"use strict\";\nvar $ef7689007096c8a0$var$mapping = new Map();\nfunction $ef7689007096c8a0$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$ef7689007096c8a0$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $ef7689007096c8a0$var$resolve(id) {\n var resolved = $ef7689007096c8a0$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$ef7689007096c8a0$export$6503ec6e8aabbaf = $ef7689007096c8a0$var$register;\n$ef7689007096c8a0$export$f7ad0328861e2f03 = $ef7689007096c8a0$var$resolve;\n\n});\n\nvar $279d7e991aa5fda1$exports = {};\n\n(parcelRequire(\"kyEFX\")).register(new URL(\"\", import.meta.url).toString(), JSON.parse('[\"eq2Ey\",\"index.6d051d2c.js\",\"9jzSS\",\"Anton-Regular.e58ab3fe.ttf\",\"hr5Pp\",\"Oswald-Regular.89ec7d89.ttf\",\"5TebC\",\"Oswald-Bold.0f6a7ca6.ttf\",\"3ENF9\",\"Roboto-Regular.ca197847.ttf\",\"5yAXK\",\"Roboto-Bold.fdb9b54a.ttf\",\"k2KZ9\",\"RobotoCondensed-Regular.d585f5c7.ttf\",\"4h4UX\",\"RobotoCondensed-Bold.e1f96d4b.ttf\",\"8pomG\",\"CourierPrime-Regular.3a25a501.ttf\",\"l2v76\",\"CourierPrime-Bold.3d6bf689.ttf\",\"eKMWr\",\"OpenSans-Regular.edf9e01b.ttf\",\"dXO1Z\",\"OpenSans-Bold.8fceb72b.ttf\",\"9FH7D\",\"index.2d751096.css\"]'));\n\nfunction $7a2aca835bb05064$export$c37129e465f64ef0(a) {\n return null !== a && \"object\" == typeof a ? \"share\" in navigator && \"canShare\" in navigator && navigator.canShare(a) : \"share\" in navigator;\n}\n\n\nObject.defineProperty({}, \"WebShare\", {\n get: function() {\n return $cd62c5572235e737$export$30b344bef3e55b67;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $cd62c5572235e737$var$t = `\n :host {\n display: inline-block;\n }\n`, $cd62c5572235e737$var$e = document.createElement(\"template\");\n$cd62c5572235e737$var$e.innerHTML = `\n \n \n`;\nclass $cd62c5572235e737$export$30b344bef3e55b67 extends HTMLElement {\n #t;\n #e;\n #s = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($cd62c5572235e737$var$e.content.cloneNode(!0)), this.#t = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null, this.#e = this.#i();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n \"disabled\" === t && e !== s && this.#e && (this.#e.toggleAttribute(\"disabled\", this.disabled), this.#e.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#e.part && this.#e.part.contains(\"button\") && this.#e.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#r(\"shareUrl\"), this.#r(\"shareTitle\"), this.#r(\"shareText\"), this.#r(\"shareFiles\"), this.#r(\"disabled\"), this.#t?.addEventListener(\"slotchange\", this.#a), this.#e?.addEventListener(\"click\", this.#n);\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"slotchange\", this.#a), this.#e?.removeEventListener(\"click\", this.#n);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(t) {\n this.setAttribute(\"share-url\", t);\n }\n get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(t) {\n this.setAttribute(\"share-title\", t);\n }\n get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(t) {\n this.setAttribute(\"share-text\", t);\n }\n get shareFiles() {\n return this.#s;\n }\n set shareFiles(t) {\n Array.isArray(t) && t.length > 0 && (this.#s = t);\n }\n async share() {\n if (!this.disabled) try {\n let t = {};\n this.shareUrl && (t.url = this.shareUrl), this.shareTitle && (t.title = this.shareTitle), this.shareText && (t.text = this.shareText), Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n }) && (t.files = this.shareFiles), await navigator.share(t), this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: !0,\n composed: !0,\n detail: {\n shareData: t\n }\n }));\n } catch (t) {\n if (t instanceof Error && \"AbortError\" === t.name) {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #n = (t)=>{\n t.preventDefault(), this.disabled || this.share();\n };\n #a = (t)=>{\n t.target && \"button\" === t.target.name && (this.#e?.removeEventListener(\"click\", this.#n), this.#e = this.#i(), this.#e && (this.#e.addEventListener(\"click\", this.#n), \"BUTTON\" === this.#e.nodeName || this.#e.hasAttribute(\"role\") || this.#e.setAttribute(\"role\", \"button\")));\n };\n #i() {\n return this.#t && this.#t.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"button\" === t.getAttribute(\"slot\")) || null;\n }\n #r(t) {\n if (Object.prototype.hasOwnProperty.call(this, t)) {\n let e = this[t];\n delete this[t], this[t] = e;\n }\n }\n static defineCustomElement(t = \"web-share\") {\n \"undefined\" == typeof window || window.customElements.get(t) || window.customElements.define(t, $cd62c5572235e737$export$30b344bef3e55b67);\n }\n}\n$cd62c5572235e737$export$30b344bef3e55b67.defineCustomElement();\n\n\nObject.defineProperty({}, \"CapturePhoto\", {\n get: function() {\n return $dced0d224c6d876e$export$cc30a98fe3890794;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $dced0d224c6d876e$var$t = (t, e, i)=>(Number.isNaN(e) && (e = 0), Number.isNaN(i) && (i = 0), Math.min(Math.max(t, Math.min(e, i)), Math.max(e, i))), $dced0d224c6d876e$var$e = \"capture-photo\", $dced0d224c6d876e$var$i = `\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`, $dced0d224c6d876e$var$o = document.createElement(\"template\");\n$dced0d224c6d876e$var$o.innerHTML = `\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\nclass $dced0d224c6d876e$export$cc30a98fe3890794 extends HTMLElement {\n #t = {};\n #e = null;\n #i = null;\n #o = null;\n #n = null;\n #a = null;\n #s = null;\n #r = null;\n #l = null;\n constructor(){\n super(), this.#t = this.getSupportedConstraints(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($dced0d224c6d876e$var$o.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"facing-mode\",\n \"camera-resolution\",\n \"pan\",\n \"tilt\",\n \"zoom\"\n ];\n }\n attributeChangedCallback(t, e, i) {\n if (!this.isConnected) return;\n let o = this.getTrackCapabilities(), n = this.getTrackSettings();\n if (\"no-image\" === t && e !== i && this.#u(), \"facing-mode\" === t && e !== i && \"facingMode\" in this.#t) {\n let t = [\n \"user\",\n \"environment\"\n ].includes(this.facingMode || \"\");\n \"facingMode\" in n && t && (this.stopVideoStream(), this.startVideoStream());\n }\n if (\"camera-resolution\" === t && e !== i && \"string\" == typeof this.cameraResolution && this.cameraResolution.trim().length > 0) {\n let [t = 0, e = 0] = this.cameraResolution.split(\"x\").map((t)=>Number(t));\n if (t > 0 && e > 0 && \"width\" in o && \"height\" in o) {\n let i = !!(o.width?.min && o.width?.max) && t >= o?.width?.min && t <= o?.width?.max, a = !!(o.height?.min && o.height?.max) && e >= o?.height?.min && e <= o?.height?.max;\n \"width\" in n && \"height\" in n && i && a && (this.stopVideoStream(), this.startVideoStream());\n }\n }\n if (\"pan\" === t && e !== i && \"pan\" in this.#t) {\n let t = !!(\"pan\" in o && o.pan?.min && o.pan?.max) && this.pan >= o.pan.min && this.pan <= o.pan.max;\n \"pan\" in n && \"number\" == typeof this.pan && t && this.#h(\"pan\", this.pan);\n }\n if (\"tilt\" === t && e !== i && \"tilt\" in this.#t) {\n let t = !!(\"tilt\" in o && o.tilt?.min && o.tilt?.max) && this.tilt >= o.tilt.min && this.tilt <= o.tilt.max;\n \"tilt\" in n && \"number\" == typeof this.tilt && t && this.#h(\"tilt\", this.tilt);\n }\n if (\"zoom\" === t && e !== i && \"zoom\" in this.#t) {\n let t = !!(\"zoom\" in o && o.zoom?.min && o.zoom?.max) && this.zoom >= o.zoom.min && this.zoom <= o.zoom.max;\n \"zoom\" in n && \"number\" == typeof this.zoom && t && this.#h(\"zoom\", this.zoom);\n }\n }\n connectedCallback() {\n if (this.#d(\"autpoPlay\"), this.#d(\"noImage\"), this.#d(\"facingMode\"), this.#d(\"cameraResolution\"), this.#d(\"pan\"), this.#d(\"tilt\"), this.#d(\"zoom\"), this.#d(\"calculateFileSize\"), this.#i = this.shadowRoot?.querySelector(\"canvas\") || null, this.#o = this.shadowRoot?.getElementById(\"output\") || null, this.#n = this.shadowRoot?.querySelector(\"video\") || null, this.#a = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null, this.#s = this.#c(), this.#r = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null, this.#l = this.#m(), this.#n?.addEventListener(\"loadedmetadata\", this.#p), this.#a?.addEventListener(\"slotchange\", this.#g), this.#s?.addEventListener(\"click\", this.#b), this.#r?.addEventListener(\"slotchange\", this.#f), this.#l?.addEventListener(\"click\", this.#v), !$dced0d224c6d876e$export$cc30a98fe3890794.isSupported()) return this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n this.autoPlay && this.startVideoStream();\n }\n disconnectedCallback() {\n this.stopVideoStream(), this.#l?.removeEventListener(\"click\", this.#v), this.#s?.removeEventListener(\"click\", this.#b), this.#n?.removeEventListener(\"canplay\", this.#p), this.#a?.removeEventListener(\"slotchange\", this.#g), this.#r?.removeEventListener(\"slotchange\", this.#f);\n }\n get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(t) {\n this.toggleAttribute(\"auto-play\", !!t);\n }\n get noImage() {\n return this.hasAttribute(\"no-image\");\n }\n set noImage(t) {\n this.toggleAttribute(\"no-image\", !!t);\n }\n get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(t) {\n this.setAttribute(\"facing-mode\", t);\n }\n get cameraResolution() {\n return this.getAttribute(\"camera-resolution\") || \"\";\n }\n set cameraResolution(t) {\n this.setAttribute(\"camera-resolution\", t);\n }\n get pan() {\n return Number(this.getAttribute(\"pan\")) || 0;\n }\n set pan(t) {\n this.setAttribute(\"pan\", null != t ? t.toString() : t);\n }\n get tilt() {\n return Number(this.getAttribute(\"tilt\")) || 0;\n }\n set tilt(t) {\n this.setAttribute(\"tilt\", null != t ? t.toString() : t);\n }\n get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(t) {\n this.setAttribute(\"zoom\", null != t ? t.toString() : t);\n }\n get loading() {\n return this.hasAttribute(\"loading\");\n }\n get calculateFileSize() {\n return this.hasAttribute(\"calculate-file-size\");\n }\n set calculateFileSize(t) {\n this.toggleAttribute(\"calculate-file-size\", !!t);\n }\n #v = (t)=>{\n t.preventDefault(), this.loading || (this.facingMode = \"user\" !== this.facingMode && this.facingMode ? \"user\" : \"environment\");\n };\n #b = (t)=>{\n t.preventDefault(), this.capture();\n };\n #p = (t)=>{\n let i = t.target;\n i.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:video-play`, {\n bubbles: !0,\n composed: !0,\n detail: {\n video: i\n }\n }));\n }).catch((t)=>{\n this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n #u() {\n this.#o && Array.from(this.#o.childNodes).forEach((t)=>t.remove());\n }\n #h(e, i) {\n if (!this.#e || !e || !i) return;\n let [o] = this.#e.getVideoTracks(), n = this.getTrackCapabilities();\n e in this.getTrackSettings() && o.applyConstraints({\n advanced: [\n {\n [e]: $dced0d224c6d876e$var$t(Number(i), n[e]?.min || 1, n[e]?.max || 1)\n }\n ]\n });\n }\n #g = (t)=>{\n t.target?.name === \"capture-button\" && (this.#s?.removeEventListener(\"click\", this.#b), this.#s = this.#c(), this.#s && (this.#s.addEventListener(\"click\", this.#b), \"BUTTON\" === this.#s.nodeName || this.#s.hasAttribute(\"role\") || this.#s.setAttribute(\"role\", \"button\")));\n };\n #f = (t)=>{\n t.target?.name === \"facing-mode-button\" && (this.#l?.removeEventListener(\"click\", this.#v), this.#l = this.#m(), this.#l && (this.#l.addEventListener(\"click\", this.#v), \"BUTTON\" === this.#l.nodeName || this.#l.hasAttribute(\"role\") || this.#l.setAttribute(\"role\", \"button\")));\n };\n #m() {\n return this.#r && this.#r.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"facing-mode-button\" === t.getAttribute(\"slot\")) || null;\n }\n #c() {\n return this.#a && this.#a.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"capture-button\" === t.getAttribute(\"slot\")) || null;\n }\n #d(t) {\n if (Object.prototype.hasOwnProperty.call(this, t)) {\n let e = this[t];\n delete this[t], this[t] = e;\n }\n }\n async startVideoStream() {\n if (!$dced0d224c6d876e$export$cc30a98fe3890794.isSupported() || this.#e) return;\n this.setAttribute(\"loading\", \"\");\n let t = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: !0,\n tilt: !0,\n zoom: !0\n },\n audio: !1\n };\n if (\"string\" == typeof this.cameraResolution && this.cameraResolution.trim().length > 0) {\n let [e = 0, i = 0] = this.cameraResolution.split(\"x\").map((t)=>Number(t));\n e > 0 && i > 0 && (t.video.width = e, t.video.height = i);\n }\n try {\n this.#e = await navigator.mediaDevices.getUserMedia(t), this.#n && (this.#n.srcObject = this.#e), this.#h(\"pan\", this.pan), this.#h(\"tilt\", this.tilt), this.#h(\"zoom\", this.zoom);\n let e = this.getTrackSettings();\n \"facingMode\" in e && this.#r && (this.#r.hidden = !1);\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n stopVideoStream() {\n if (!this.#n || !this.#e) return;\n let [t] = this.#e.getVideoTracks();\n t?.stop(), this.#n.srcObject = null, this.#e = null;\n }\n async capture() {\n if (!this.loading && this.#i && this.#n) try {\n let t = this.#i.getContext(\"2d\"), i = this.#n.videoWidth, o = this.#n.videoHeight;\n this.#i.width = i, this.#i.height = o, t?.drawImage(this.#n, 0, 0, i, o);\n let n = this.#i.toDataURL(\"image/png\");\n if (\"string\" == typeof n && n.includes(\"data:image\")) {\n if (!this.noImage) {\n let t = new Image;\n t.src = n, t.width = i, t.height = o, t.setAttribute(\"part\", \"output-image\"), this.#u(), this.#o?.appendChild(t);\n }\n let t = {\n dataURI: n,\n width: i,\n height: o\n };\n if (this.calculateFileSize) try {\n let e = await fetch(n), i = (await e.blob()).size;\n i && (t.size = i);\n } catch (t) {}\n this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:success`, {\n bubbles: !0,\n composed: !0,\n detail: t\n }));\n }\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$dced0d224c6d876e$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n getSupportedConstraints() {\n return $dced0d224c6d876e$export$cc30a98fe3890794.isSupported() && navigator.mediaDevices.getSupportedConstraints() || {};\n }\n getTrackCapabilities() {\n if (!this.#e) return {};\n let [t] = this.#e.getVideoTracks();\n return t && \"function\" == typeof t.getCapabilities && t.getCapabilities() || {};\n }\n getTrackSettings() {\n if (!this.#e) return {};\n let [t] = this.#e.getVideoTracks();\n return t && \"function\" == typeof t.getSettings && t.getSettings() || {};\n }\n static isSupported() {\n return !!navigator.mediaDevices?.getUserMedia;\n }\n static defineCustomElement(t = $dced0d224c6d876e$var$e) {\n \"undefined\" == typeof window || window.customElements.get(t) || window.customElements.define(t, $dced0d224c6d876e$export$cc30a98fe3890794);\n }\n}\n$dced0d224c6d876e$export$cc30a98fe3890794.defineCustomElement();\n\n\nObject.defineProperty({}, \"ModalElement\", {\n get: function() {\n return $d9c5053bade2d3f8$export$32589115725b904b;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $d9c5053bade2d3f8$var$e = document.createElement(\"template\");\n$d9c5053bade2d3f8$var$e.innerHTML = /* html */ `\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`; /**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */ \nclass $d9c5053bade2d3f8$export$32589115725b904b extends HTMLElement {\n #e = null;\n #t = null;\n #o = void 0;\n constructor(){\n if (super(), !this.shadowRoot) {\n let t = this.attachShadow({\n mode: \"open\"\n });\n t.appendChild($d9c5053bade2d3f8$var$e.content.cloneNode(!0));\n }\n this.shadowRoot && (this.#e = this.shadowRoot.querySelector(\"dialog\"), this.#t = this.shadowRoot.querySelector('slot[name=\"footer\"]'));\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\"\n ];\n }\n attributeChangedCallback(e, t, o) {\n if (null !== this.#e) {\n if (\"open\" === e && t !== o && (this.open ? (this.#e.showModal(), document.body && (document.body.style.overflowY = \"hidden\"), this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n }))) : this.#e.close()), \"no-header\" === e && t !== o) {\n let e = this.#e.querySelector(\".dialog__header\");\n null !== e && (e.hidden = this.noHeader);\n }\n if (\"no-animations\" === e && t !== o && this.#e.classList.toggle(\"dialog--no-animations\", this.noAnimations), \"no-close-button\" === e && t !== o) {\n let e = this.#e.querySelector(\".dialog__close\");\n null !== e && (e.hidden = this.noCloseButton);\n }\n }\n }\n connectedCallback() {\n this.#i(\"open\"), this.#i(\"staticBackdrop\"), this.#i(\"noHeader\"), this.#i(\"noAnimations\"), this.#i(\"noCloseButton\"), this.#i(\"fullscreen\"), this.#e?.addEventListener(\"click\", this.#a), this.#e?.addEventListener(\"close\", this.#l), this.#e?.addEventListener(\"cancel\", this.#s), this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#n), this.#t?.addEventListener(\"slotchange\", this.#r);\n }\n disconnectedCallback() {\n this.#o && clearTimeout(this.#o), this.#e?.addEventListener(\"click\", this.#a), this.#e?.removeEventListener(\"close\", this.#l), this.#e?.removeEventListener(\"cancel\", this.#s), this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#n), this.#t?.removeEventListener(\"slotchange\", this.#r);\n }\n get open() {\n return this.hasAttribute(\"open\");\n }\n set open(e) {\n e ? this.setAttribute(\"open\", \"\") : this.removeAttribute(\"open\");\n }\n get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(e) {\n e ? this.setAttribute(\"static-backdrop\", \"\") : this.removeAttribute(\"static-backdrop\");\n }\n get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(e) {\n e ? this.setAttribute(\"no-header\", \"\") : this.removeAttribute(\"no-header\");\n }\n get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(e) {\n e ? this.setAttribute(\"no-animations\", \"\") : this.removeAttribute(\"no-animations\");\n }\n get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(e) {\n e ? this.setAttribute(\"no-close-button\", \"\") : this.removeAttribute(\"no-close-button\");\n }\n get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(e) {\n e ? this.setAttribute(\"fullscreen\", \"\") : this.removeAttribute(\"fullscreen\");\n }\n #d() {\n this.#o || (this.#e?.classList.add(\"dialog--pulse\"), this.#o = setTimeout(()=>{\n this.#e?.classList.remove(\"dialog--pulse\"), clearTimeout(this.#o), this.#o = void 0;\n }, 300));\n }\n #l = ()=>{\n // the open property when the dialog is closed by the user.\n this.open = !1, document.body && (document.body.style.overflowY = \"\"), this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n }));\n };\n #s = (e)=>{\n let t = this.#c(\"escape-key\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), this.noAnimations || this.#d());\n };\n #n = (e)=>{\n let t = this.#c(\"close-button\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), this.noAnimations || this.#d());\n };\n #a = (e)=>{\n if (e.target !== e.currentTarget) return;\n let t = this.#c(\"backdrop-click\");\n if (this.dispatchEvent(t), t.defaultPrevented || this.staticBackdrop) {\n this.noAnimations || this.#d();\n return;\n }\n this.#e?.close();\n };\n #r = ()=>{\n if (null === this.#e) return; /** @type {Nullable} */ \n let e = this.#e.querySelector(\".dialog__footer\");\n if (null === e) return;\n let t = this.#t?.assignedNodes(), o = !!t && t.length > 0;\n e.hidden = !o;\n };\n #c(e) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: !0,\n composed: !0,\n cancelable: !0,\n detail: {\n reason: e,\n element: this\n }\n });\n }\n #i(e) {\n if (Object.prototype.hasOwnProperty.call(this, e)) {\n let t = this[e];\n delete this[e], this[e] = t;\n }\n }\n show() {\n this.open || (this.open = !0);\n }\n hide() {\n this.open && (this.open = !1);\n }\n static defineCustomElement(e = \"modal-element\") {\n \"undefined\" == typeof window || window.customElements.get(e) || window.customElements.define(e, $d9c5053bade2d3f8$export$32589115725b904b);\n }\n}\n$d9c5053bade2d3f8$export$32589115725b904b.defineCustomElement();\n //# sourceMappingURL=modal-element-defined.js.map\n\n\nObject.defineProperty({}, \"FilesDropzone\", {\n get: function() {\n return $9351176e8d763a78$export$6ccd1735166caad9;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $9351176e8d763a78$var$e = new Map([\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]), $9351176e8d763a78$var$t = [\n \".DS_Store\",\n \"Thumbs.db\"\n], $9351176e8d763a78$var$o = (t)=>{\n let { name: o } = t;\n if (o && -1 !== o.lastIndexOf(\".\") && !t.type) {\n let i = (o.split(\".\").pop() || \"\").toLowerCase(), r = $9351176e8d763a78$var$e.get(i);\n r && Object.defineProperty(t, \"type\", {\n value: r,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return t;\n}, $9351176e8d763a78$var$i = (e, t)=>{\n let i = $9351176e8d763a78$var$o(e);\n if (\"string\" != typeof i.path) {\n let { webkitRelativePath: o } = e;\n Object.defineProperty(i, \"path\", {\n value: \"string\" == typeof t ? t : o || e.name,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return i;\n}, $9351176e8d763a78$var$r = async (e)=>await new Promise((t, o)=>{\n e.readEntries(t, o);\n }), $9351176e8d763a78$var$a = async (e)=>{\n let t = [], o = await $9351176e8d763a78$var$r(e);\n for(; o.length > 0;)t.push(...o), o = await $9351176e8d763a78$var$r(e);\n return t;\n}, $9351176e8d763a78$var$n = (e)=>new Promise((t, o)=>{\n e.file((o)=>t($9351176e8d763a78$var$i(o, e.fullPath)), o);\n }), $9351176e8d763a78$var$s = async (e)=>{\n let o = [], i = [];\n for (let t of e){\n if (\"file\" !== t.kind) continue;\n let e = t.getAsEntry ? t.getAsEntry() : t.webkitGetAsEntry();\n i.push(e);\n }\n for(; i.length > 0;){\n let e = i.shift();\n if (e) {\n if (e.isFile) {\n let i = await $9351176e8d763a78$var$n(e);\n -1 === $9351176e8d763a78$var$t.indexOf(i.name) && o.push(i);\n } else e.isDirectory && i.push(...await $9351176e8d763a78$var$a(e.createReader()));\n }\n }\n return o;\n}, $9351176e8d763a78$var$d = async (e)=>{\n let o = [];\n for (let r of e)-1 === $9351176e8d763a78$var$t.indexOf(r.name) && o.push($9351176e8d763a78$var$i(r));\n return o;\n}, $9351176e8d763a78$var$l = async (e)=>e.dataTransfer ? e.dataTransfer.items ? await $9351176e8d763a78$var$s(e.dataTransfer.items) : await $9351176e8d763a78$var$d(e.dataTransfer.files) : await $9351176e8d763a78$var$d(e.target.files), $9351176e8d763a78$var$p = \"files-dropzone\", $9351176e8d763a78$var$c = \"TOO_MANY_FILES\", $9351176e8d763a78$var$h = document.createElement(\"template\"), $9351176e8d763a78$var$u = `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$9351176e8d763a78$var$h.innerHTML = `\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\nclass $9351176e8d763a78$export$6ccd1735166caad9 extends HTMLElement {\n #e = null;\n #t = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($9351176e8d763a78$var$h.content.cloneNode(!0)), this.shadowRoot && (this.#e = this.shadowRoot.getElementById(\"fileInput\"), this.#t = this.shadowRoot.getElementById(\"dropzoneEl\"));\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\",\n \"no-keyboard\"\n ];\n }\n attributeChangedCallback(e, t, o) {\n \"accept\" === e && t !== o && this.#e && (this.#e.accept = this.accept), \"disabled\" === e && t !== o && this.#e && (this.#e.disabled = this.disabled, this.disabled ? this.#t?.removeAttribute(\"tabindex\") : this.#t?.setAttribute(\"tabindex\", \"0\")), \"multiple\" === e && t !== o && this.#e && (this.#e.multiple = this.multiple), \"no-keyboard\" === e && t !== o && this.#t && (this.noKeyboard ? this.#t.removeAttribute(\"tabindex\") : this.#t.setAttribute(\"tabindex\", \"0\"));\n }\n connectedCallback() {\n this.#o(\"accept\"), this.#o(\"disabled\"), this.#o(\"maxFiles\"), this.#o(\"maxSize\"), this.#o(\"minSize\"), this.#o(\"multiple\"), this.#o(\"noClick\"), this.#o(\"noDrag\"), this.#o(\"noKeyboard\"), this.#o(\"autoFocus\"), this.#o(\"noStyle\"), this.#e?.addEventListener(\"change\", this.#i), this.#t?.addEventListener(\"dragenter\", this.#r), this.#t?.addEventListener(\"dragover\", this.#a), this.#t?.addEventListener(\"dragleave\", this.#n), this.#t?.addEventListener(\"drop\", this.#s), this.#t?.addEventListener(\"click\", this.#d), this.#t?.addEventListener(\"keyup\", this.#l), this.autoFocus && this.#t?.focus();\n }\n disconnectedCallback() {\n this.#e?.removeEventListener(\"change\", this.#i), this.#t?.removeEventListener(\"dragenter\", this.#r), this.#t?.removeEventListener(\"dragover\", this.#a), this.#t?.removeEventListener(\"dragleave\", this.#n), this.#t?.removeEventListener(\"drop\", this.#s), this.#t?.removeEventListener(\"click\", this.#d), this.#t?.removeEventListener(\"keyup\", this.#l);\n }\n get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(e) {\n this.setAttribute(\"accept\", null != e ? e.toString() : e);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n get maxFiles() {\n let e = Number(this.getAttribute(\"max-files\")) || 0;\n return e <= 0 ? 1 / 0 : Math.floor(Math.abs(e));\n }\n set maxFiles(e) {\n this.setAttribute(\"max-files\", null != e ? e.toString() : e);\n }\n get maxSize() {\n let e = this.getAttribute(\"max-size\");\n if (null === e) return 1 / 0;\n let t = Number(e);\n return Number.isNaN(t) ? 1 / 0 : t;\n }\n set maxSize(e) {\n this.setAttribute(\"max-size\", null != e ? e.toString() : e);\n }\n get minSize() {\n let e = this.getAttribute(\"min-size\");\n if (null === e) return 0;\n let t = Number(e);\n return Number.isNaN(t) ? 0 : t;\n }\n set minSize(e) {\n this.setAttribute(\"min-size\", null != e ? e.toString() : e);\n }\n get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(e) {\n this.toggleAttribute(\"multiple\", !!e);\n }\n get noClick() {\n return this.hasAttribute(\"no-click\");\n }\n set noClick(e) {\n this.toggleAttribute(\"no-click\", !!e);\n }\n get noDrag() {\n return this.hasAttribute(\"no-drag\");\n }\n set noDrag(e) {\n this.toggleAttribute(\"no-drag\", !!e);\n }\n get noKeyboard() {\n return this.hasAttribute(\"no-keyboard\");\n }\n set noKeyboard(e) {\n this.toggleAttribute(\"no-keyboard\", !!e);\n }\n get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(e) {\n this.toggleAttribute(\"auto-focus\", !!e);\n }\n get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(e) {\n this.toggleAttribute(\"no-style\", !!e);\n }\n #i = async (e)=>{\n try {\n this.#p(await $9351176e8d763a78$var$l(e));\n } catch (e) {\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$p}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: e\n }\n }));\n }\n };\n #r = ()=>{\n this.disabled || this.noDrag || this.dispatchEvent(new Event(`${$9351176e8d763a78$var$p}-dragenter`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #a = (e)=>{\n if (e.preventDefault(), this.disabled || this.noDrag) {\n e.dataTransfer.dropEffect = \"none\";\n return;\n }\n e.dataTransfer.dropEffect = \"copy\", this.#t && (this.#t.classList.add(\"dropzone--dragover\"), this.#t.part.add(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$9351176e8d763a78$var$p}-dragover`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #n = ()=>{\n this.disabled || this.noDrag || (this.#t && (this.#t.classList.remove(\"dropzone--dragover\"), this.#t.part.remove(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$9351176e8d763a78$var$p}-dragleave`, {\n bubbles: !0,\n composed: !0\n })));\n };\n #s = async (e)=>{\n if (!this.disabled && !this.noDrag) {\n e.preventDefault(), this.#t && (this.#t.classList.remove(\"dropzone--dragover\"), this.#t.part.remove(\"dropzone--dragover\"));\n try {\n this.#p(await $9351176e8d763a78$var$l(e));\n } catch (e) {\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$p}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: e\n }\n }));\n }\n }\n };\n #d = ()=>{\n this.disabled || this.noClick || this.#e?.click();\n };\n #l = (e)=>{\n this.disabled || this.noKeyboard || \" \" !== e.key && \"Enter\" !== e.key || this.#e?.click();\n };\n #p(e) {\n if (!Array.isArray(e) || !e.length) return;\n let t = [], o = [], i = e.length;\n if (!this.multiple && i > 1) for (let t of e)o.push({\n file: t,\n errors: [\n {\n code: $9351176e8d763a78$var$c,\n message: \"Too many files selected. Only 1 file is allowed.\"\n }\n ]\n });\n else if (this.multiple && i > this.maxFiles) for (let t of e)o.push({\n file: t,\n errors: [\n {\n code: $9351176e8d763a78$var$c,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else for (let i of e){\n let e = function(e, t = \"\") {\n if (!t) return !0;\n let o = [\n ...new Set(t.split(\",\").map((e)=>e.trim()).filter(Boolean))\n ], i = e.type, r = i.replace(/\\/.*$/, \"\");\n for (let t of o)if (\".\" === t.charAt(0)) {\n if (-1 !== e.name.toLowerCase().indexOf(t.toLowerCase(), e.name.length - t.length)) return !0;\n } else if (/\\/\\*$/.test(t)) {\n if (r === t.replace(/\\/.*$/, \"\")) return !0;\n } else if (i === t) return !0;\n return !1;\n }(i, this.accept), r = i.size > this.maxSize, a = i.size < this.minSize;\n if (!e || r || a) {\n let t = [];\n e || t.push({\n code: \"INVALID_MIME_TYPE\",\n message: `File type \"${i.type}\" is not accepted.`\n }), r && t.push({\n code: \"FILE_TOO_LARGE\",\n message: `File size ${i.size} exceeds the maximum size of ${this.maxSize}.`\n }), a && t.push({\n code: \"FILE_TOO_SMALL\",\n message: `File size ${i.size} is smaller than the minimum size of ${this.minSize}.`\n }), o.push({\n file: i,\n errors: t\n });\n } else t.push(i);\n }\n this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$p}-drop`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t,\n rejectedFiles: o\n }\n })), t.length > 0 && this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$p}-drop-accepted`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t\n }\n })), o.length > 0 && this.dispatchEvent(new CustomEvent(`${$9351176e8d763a78$var$p}-drop-rejected`, {\n bubbles: !0,\n composed: !0,\n detail: {\n rejectedFiles: o\n }\n })), this.#e && (this.#e.value = this.#e.defaultValue);\n }\n openFileDialog() {\n this.disabled || this.#e?.click();\n }\n #o(e) {\n if (Object.prototype.hasOwnProperty.call(this, e)) {\n let t = this[e];\n delete this[e], this[e] = t;\n }\n }\n static defineCustomElement(e = $9351176e8d763a78$var$p) {\n \"undefined\" == typeof window || window.customElements.get(e) || window.customElements.define(e, $9351176e8d763a78$export$6ccd1735166caad9);\n }\n}\n$9351176e8d763a78$export$6ccd1735166caad9.defineCustomElement();\n\n\n\n\n/**\n * Removes one or more elements from an array at the specified index(es).\n *\n * @param {Array} array The initial array to remove elements from.\n * @param {Number} ...indexes The index(es) of the elements to be removed. Non numbers are ignored.\n * @throws {TypeError} If `array` is not array.\n * @returns {Array} The result array with the elements specified removed.\n * @example\n *\n * const arr = [1, 2, 3, 4, 5];\n *\n * remove(arr, 0);\n * // => [2, 3, 4, 5]\n *\n * remove(arr, 0, 1);\n * // => [3, 4, 5]\n *\n * remove(arr, 0, 4);\n * // => [2, 3, 4]\n *\n * remove(arr);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length - 1);\n * // => [1, 2, 3, 4]\n *\n * remove(arr, NaN);\n * // => [1, 2, 3, 4, 5]\n */ const $4af3d380d1884504$export$30a014203d0d7e4f = (array, ...indexes)=>{\n if (!Array.isArray(array)) throw new TypeError(\"Expected an array for first argument\");\n return array.filter((_, i)=>indexes.indexOf(i) === -1);\n};\n\n\n/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */ const $17004b28c97c1306$export$e2a22331486dcca0 = (prefix = \"\", suffix = \"\")=>{\n const prefixString = typeof prefix === \"string\" && prefix !== \"\" ? prefix + \"-\" : \"\";\n const suffixString = typeof suffix === \"string\" && suffix !== \"\" ? \"-\" + suffix : \"\";\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n return `${prefixString}${randomString}${suffixString}`;\n};\n\n\nconst $65136e012e05e2d7$export$63e7bed68b07a85c = [\n \"image/jpg\",\n \"image/jpeg\",\n \"image/png\",\n \"image/apng\",\n \"image/gif\",\n \"image/webp\",\n \"image/avif\"\n];\n\n\nvar $068eb37972da8c20$exports = {};\n$068eb37972da8c20$exports = new URL(\"Anton-Regular.e58ab3fe.ttf\", import.meta.url).toString();\n\n\nvar $2db6b38fbc5d48da$exports = {};\n$2db6b38fbc5d48da$exports = new URL(\"Oswald-Regular.89ec7d89.ttf\", import.meta.url).toString();\n\n\nvar $a0b1873abc1b077b$exports = {};\n$a0b1873abc1b077b$exports = new URL(\"Oswald-Bold.0f6a7ca6.ttf\", import.meta.url).toString();\n\n\nvar $df7c7f72fd04e02a$exports = {};\n$df7c7f72fd04e02a$exports = new URL(\"Roboto-Regular.ca197847.ttf\", import.meta.url).toString();\n\n\nvar $e4c2039736f96f5d$exports = {};\n$e4c2039736f96f5d$exports = new URL(\"Roboto-Bold.fdb9b54a.ttf\", import.meta.url).toString();\n\n\nvar $fbff28e47a938944$exports = {};\n$fbff28e47a938944$exports = new URL(\"RobotoCondensed-Regular.d585f5c7.ttf\", import.meta.url).toString();\n\n\nvar $d8f4a375a42d32f4$exports = {};\n$d8f4a375a42d32f4$exports = new URL(\"RobotoCondensed-Bold.e1f96d4b.ttf\", import.meta.url).toString();\n\n\nvar $7cfbda315cbb4209$exports = {};\n$7cfbda315cbb4209$exports = new URL(\"CourierPrime-Regular.3a25a501.ttf\", import.meta.url).toString();\n\n\nvar $6379185b16d8409f$exports = {};\n$6379185b16d8409f$exports = new URL(\"CourierPrime-Bold.3d6bf689.ttf\", import.meta.url).toString();\n\n\nvar $454f2b111c8d0078$exports = {};\n$454f2b111c8d0078$exports = new URL(\"OpenSans-Regular.edf9e01b.ttf\", import.meta.url).toString();\n\n\nvar $c05fcaeb63dbd733$exports = {};\n$c05fcaeb63dbd733$exports = new URL(\"OpenSans-Bold.8fceb72b.ttf\", import.meta.url).toString();\n\n\nconst $56b863c8b6be7003$export$6874249d87f2602a = [\n {\n name: \"Anton\",\n label: \"Anton\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($068eb37972da8c20$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Oswald-Regular\",\n label: \"Oswald\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($2db6b38fbc5d48da$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Oswald-Bold\",\n label: \"Oswald Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($a0b1873abc1b077b$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"Roboto-Regular\",\n label: \"Roboto\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($df7c7f72fd04e02a$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Roboto-Bold\",\n label: \"Roboto Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($e4c2039736f96f5d$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"RobotoCondensed-Regular\",\n label: \"Roboto Condensed\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($fbff28e47a938944$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"RobotoCondensed-Bold\",\n label: \"Roboto Condensed Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($d8f4a375a42d32f4$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"CourierPrime-Regular\",\n label: \"Courier Prime\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($7cfbda315cbb4209$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"CourierPrime-Bold\",\n label: \"Courier Prime Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($6379185b16d8409f$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"OpenSans-Regular\",\n label: \"Open Sans\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($454f2b111c8d0078$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"OpenSans-Bold\",\n label: \"Open Sans Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($c05fcaeb63dbd733$exports))),\n style: \"normal\",\n weight: \"400\"\n }\n];\nconst $56b863c8b6be7003$export$59eceaef0c7797b2 = async (name, path, options = {})=>{\n try {\n const font = new FontFace(name, `url(${path})`, {\n ...options\n });\n await font.load();\n document.fonts.add(font);\n } catch (err) {\n console.error(err);\n }\n};\n\n\n\nconst $0374350c629f125f$export$6539e087749cf9d3 = async (options = {})=>{\n const res = await fetch(options.url);\n const blob = await res.blob();\n const mimeType = options.mimeType || blob.type || \"\";\n if (!(0, $65136e012e05e2d7$export$63e7bed68b07a85c).includes(mimeType)) throw new Error(`This is not an accepted image format. Accepted MIME types are: ${(0, $65136e012e05e2d7$export$63e7bed68b07a85c).join(\", \")}`);\n return new File([\n blob\n ], options.filename || \"\", blob);\n};\n\n\nconst $3969451ff60cb8d5$var$errorsContainer = document.getElementById(\"errorsContainer\");\nconst $3969451ff60cb8d5$var$hideError = (evt)=>{\n const target = evt.currentTarget;\n target.removeEventListener(\"click\", $3969451ff60cb8d5$var$hideError);\n $3969451ff60cb8d5$var$errorsContainer.removeChild(target.parentNode);\n};\nconst $3969451ff60cb8d5$export$af04143326425dbd = (message = \"\", type = \"info\")=>{\n const types = [\n \"info\",\n \"warning\",\n \"danger\"\n ];\n if (!types.includes(type)) type = \"info\";\n const template = /* html */ `\n ${message}\n \n `;\n const div = document.createElement(\"div\");\n div.className = `alert alert-${type} alert-dismissible text-break mb-2 fade`;\n div.innerHTML = template;\n div.querySelector(\"button\").addEventListener(\"click\", $3969451ff60cb8d5$var$hideError);\n $3969451ff60cb8d5$var$errorsContainer.appendChild(div);\n setTimeout(()=>div.classList.add(\"show\"), 100);\n};\n\n\n\nconst $224fa2388dce65c4$export$293a4b86a6fe2398 = (index, data = {})=>{\n const inputTemplate = /* html */ `\n
\n \n\n \n\n
\n \n \n \n
\n
\n\n
\n
\n
\n \n\n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n \n \n \n \n
\n
\n
\n\n
\n
\n
\n \n \n
\n
\n
\n
\n `;\n const fragment = document.createDocumentFragment();\n const div = document.createElement(\"div\");\n div.className = \"bg-light border shadow-sm mb-3 rounded\";\n div.setAttribute(\"data-section\", \"textBox\");\n div.setAttribute(\"data-index\", index);\n div.innerHTML = inputTemplate;\n div.querySelector('[data-input=\"font\"]').value = data.font;\n div.querySelector('[data-input=\"textAlign\"]').value = data.textAlign;\n div.querySelector('[data-input=\"allCaps\"]').checked = data.allCaps;\n return fragment.appendChild(div);\n};\n\n\nconst $64ef5d4149d7e6a5$export$e653a2de0f3a8b89 = (image, canvas, ctx, textOptions = [])=>{\n if (image == null) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n if (typeof image === \"string\") {\n ctx.fillStyle = image;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n } else ctx.drawImage(image, 0, 0, canvas.width, canvas.height);\n textOptions.forEach(function(item, index) {\n ctx.font = `${item.fontWeight} ${item.fontSize}px ${item.font}`;\n const multiplier = index + 1;\n const lineHeight = ctx.measureText(\"M\").width + item.fontSize / 2;\n const xPos = canvas.width / 2;\n const shadowBlur = item.shadowBlur;\n const text = item.allCaps === true ? item.text.toUpperCase() : item.text;\n const textLines = text.split(\"\\n\");\n ctx.fillStyle = item.fillColor;\n ctx.textAlign = item.textAlign;\n ctx.save();\n if (shadowBlur !== 0) {\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n ctx.shadowBlur = shadowBlur;\n ctx.shadowColor = item.shadowColor;\n }\n if (item.rotate) {\n ctx.translate(xPos + item.offsetX, lineHeight * multiplier + item.offsetY);\n ctx.rotate(item.rotate * Math.PI / 180);\n textLines.forEach((text, index)=>ctx.fillText(text, 0, index * lineHeight));\n ctx.rotate(-(item.rotate * Math.PI / 180));\n ctx.translate(-(xPos + item.offsetX), -(lineHeight * multiplier + item.offsetY));\n } else textLines.forEach((text, index)=>{\n ctx.fillText(text, xPos + item.offsetX, index * lineHeight + lineHeight * multiplier + item.offsetY);\n });\n ctx.restore();\n });\n};\n\n\nconst $85a5f86b715fe7db$var$videoModal = document.getElementById(\"videoModal\");\nconst $85a5f86b715fe7db$var$downloadModal = document.getElementById(\"downloadModal\");\nconst $85a5f86b715fe7db$var$canvas = document.getElementById(\"canvas\");\nconst $85a5f86b715fe7db$var$dropzoneEl = document.querySelector(\"files-dropzone\");\nconst $85a5f86b715fe7db$var$instructionsEl = document.getElementById(\"instructions\");\nconst $85a5f86b715fe7db$var$ctx = $85a5f86b715fe7db$var$canvas.getContext(\"2d\");\nconst $85a5f86b715fe7db$var$imageUploadMethodSelect = document.getElementById(\"imageUploadMethodSelect\");\nconst $85a5f86b715fe7db$var$fileSelectBtn = document.getElementById(\"fileSelectBtn\");\nconst $85a5f86b715fe7db$var$imageUrlForm = document.getElementById(\"imageUrlForm\");\nconst $85a5f86b715fe7db$var$addTextboxBtn = document.getElementById(\"addTextboxBtn\");\nconst $85a5f86b715fe7db$var$inputsContainer = document.getElementById(\"inputsContainer\");\nconst $85a5f86b715fe7db$var$generateMemeBtn = document.getElementById(\"generateMemeBtn\");\nconst $85a5f86b715fe7db$var$openVideoModalBtn = document.getElementById(\"openVideoModalBtn\");\nconst $85a5f86b715fe7db$var$downloadMemeBtn = document.getElementById(\"downloadMemeBtn\");\nconst $85a5f86b715fe7db$var$downloadMemePreview = document.getElementById(\"downloadMemePreview\");\nconst $85a5f86b715fe7db$var$webShareComponent = document.querySelector(\"web-share\");\nconst $85a5f86b715fe7db$var$galleryEl = document.getElementById(\"gallery\");\nconst $85a5f86b715fe7db$var$gallerySearchEl = document.getElementById(\"gallerySearch\");\nconst $85a5f86b715fe7db$var$galleryNoResultsEl = $85a5f86b715fe7db$var$galleryEl.querySelector(\".gallery__no-results\");\nconst $85a5f86b715fe7db$var$solidColorForm = document.getElementById(\"solidColorForm\");\nconst $85a5f86b715fe7db$var$uploadMethodEls = document.querySelectorAll(\".upload-method\");\nlet $85a5f86b715fe7db$var$selectedImage = null;\nlet $85a5f86b715fe7db$var$reqAnimFrame = null;\nconst $85a5f86b715fe7db$var$defaultTextOptions = {\n _isSettingsOpen: false,\n text: \"\",\n fillColor: \"#ffffff\",\n shadowColor: \"#000000\",\n font: \"Anton\",\n fontSize: 40,\n fontWeight: \"normal\",\n textAlign: \"center\",\n shadowBlur: 3,\n offsetY: 0,\n offsetX: 0,\n rotate: 0,\n allCaps: true\n};\nlet $85a5f86b715fe7db$var$textOptions = [\n {\n ...$85a5f86b715fe7db$var$defaultTextOptions\n }\n];\nconst $85a5f86b715fe7db$var$generateMeme = async ()=>{\n const dataUrl = $85a5f86b715fe7db$var$canvas.toDataURL(\"image/png\");\n // Prepare download link\n const downloadLink = dataUrl.replace(\"image/png\", \"image/octet-stream\");\n $85a5f86b715fe7db$var$downloadMemeBtn.download = `${(0, $17004b28c97c1306$export$e2a22331486dcca0)(\"meme\")}.png`;\n $85a5f86b715fe7db$var$downloadMemeBtn.href = downloadLink;\n $85a5f86b715fe7db$var$downloadMemePreview.src = downloadLink;\n // Prepare for sharing file\n if ((0, $7a2aca835bb05064$export$c37129e465f64ef0)()) try {\n const file = await (0, $0374350c629f125f$export$6539e087749cf9d3)({\n url: dataUrl,\n filename: `${(0, $17004b28c97c1306$export$e2a22331486dcca0)(\"meme\")}.png`,\n mimeType: \"image/png\"\n }).catch((err)=>(0, $3969451ff60cb8d5$export$af04143326425dbd)(err.message, \"danger\"));\n if (file && (0, $7a2aca835bb05064$export$c37129e465f64ef0)({\n files: [\n file\n ]\n })) {\n $85a5f86b715fe7db$var$webShareComponent.shareFiles = [\n file\n ];\n $85a5f86b715fe7db$var$webShareComponent.hidden = false;\n }\n } catch (error) {\n console.error(error);\n }\n $85a5f86b715fe7db$var$downloadModal.open = true;\n};\nconst $85a5f86b715fe7db$var$onImageLoaded = (evt)=>{\n const MAX_WIDTH = 800;\n const MAX_HEIGHT = 600;\n let width = evt.target.width;\n let height = evt.target.height;\n if (width > height) {\n if (width > MAX_WIDTH) {\n height *= MAX_WIDTH / width;\n width = MAX_WIDTH;\n }\n } else if (height > MAX_HEIGHT) {\n width *= MAX_HEIGHT / height;\n height = MAX_HEIGHT;\n }\n $85a5f86b715fe7db$var$canvas.width = width;\n $85a5f86b715fe7db$var$canvas.height = height;\n $85a5f86b715fe7db$var$selectedImage = evt.target;\n (0, $64ef5d4149d7e6a5$export$e653a2de0f3a8b89)($85a5f86b715fe7db$var$selectedImage, $85a5f86b715fe7db$var$canvas, $85a5f86b715fe7db$var$ctx, $85a5f86b715fe7db$var$textOptions);\n $85a5f86b715fe7db$var$generateMemeBtn.disabled = false;\n $85a5f86b715fe7db$var$canvas.hidden = false;\n $85a5f86b715fe7db$var$instructionsEl.hidden = true;\n};\nconst $85a5f86b715fe7db$var$handleSolidColorFormInput = (evt)=>{\n const DEFAULT_WIDTH = 600;\n const DEFAULT_HEIGHT = 400;\n if (evt.target === $85a5f86b715fe7db$var$solidColorForm[\"canvasColor\"]) $85a5f86b715fe7db$var$selectedImage = evt.target.value;\n if (typeof $85a5f86b715fe7db$var$selectedImage === \"string\") {\n $85a5f86b715fe7db$var$canvas.width = Number($85a5f86b715fe7db$var$solidColorForm[\"canvasWidth\"].value) || DEFAULT_WIDTH;\n $85a5f86b715fe7db$var$canvas.height = Number($85a5f86b715fe7db$var$solidColorForm[\"canvasHeight\"].value) || DEFAULT_HEIGHT;\n (0, $64ef5d4149d7e6a5$export$e653a2de0f3a8b89)($85a5f86b715fe7db$var$selectedImage, $85a5f86b715fe7db$var$canvas, $85a5f86b715fe7db$var$ctx, $85a5f86b715fe7db$var$textOptions);\n $85a5f86b715fe7db$var$generateMemeBtn.disabled = false;\n $85a5f86b715fe7db$var$canvas.hidden = false;\n $85a5f86b715fe7db$var$instructionsEl.hidden = true;\n }\n};\nconst $85a5f86b715fe7db$var$handleFileSelect = (file)=>{\n if (!file) return;\n const image = new Image();\n const reader = new FileReader();\n reader.addEventListener(\"load\", function(evt) {\n const data = evt.target.result;\n image.addEventListener(\"load\", $85a5f86b715fe7db$var$onImageLoaded);\n image.src = data;\n });\n reader.readAsDataURL(file);\n};\nconst $85a5f86b715fe7db$var$handleOpenVideoModalButtonClick = ()=>{\n $85a5f86b715fe7db$var$videoModal.open = true;\n};\nconst $85a5f86b715fe7db$var$handleTextPropChange = (element, index, prop)=>{\n if (element.type === \"checkbox\") $85a5f86b715fe7db$var$textOptions[index][prop] = element.checked;\n else if (element.type === \"number\") $85a5f86b715fe7db$var$textOptions[index][prop] = Number(element.value);\n else $85a5f86b715fe7db$var$textOptions[index][prop] = element.value;\n (0, $64ef5d4149d7e6a5$export$e653a2de0f3a8b89)($85a5f86b715fe7db$var$selectedImage, $85a5f86b715fe7db$var$canvas, $85a5f86b715fe7db$var$ctx, $85a5f86b715fe7db$var$textOptions);\n};\nconst $85a5f86b715fe7db$var$handleAddTextboxBtnClick = ()=>{\n const textOptionsLength = $85a5f86b715fe7db$var$textOptions.length;\n const newTextBox = (0, $224fa2388dce65c4$export$293a4b86a6fe2398)(textOptionsLength, $85a5f86b715fe7db$var$defaultTextOptions);\n $85a5f86b715fe7db$var$textOptions.push({\n ...$85a5f86b715fe7db$var$defaultTextOptions\n });\n $85a5f86b715fe7db$var$inputsContainer.appendChild(newTextBox);\n newTextBox.querySelector('[data-input=\"text\"]').focus();\n};\nconst $85a5f86b715fe7db$var$handleImageUploadFromURL = async (evt)=>{\n evt.preventDefault();\n const form = evt.target;\n const submitButton = form.querySelector('button[type=\"submit\"]');\n const imageUrl = form[\"imageUrl\"].value;\n if (!imageUrl.trim()) return;\n submitButton.disabled = true;\n submitButton.querySelector(\".spinner\").hidden = false;\n submitButton.querySelector(\".label\").hidden = true;\n try {\n const file = await (0, $0374350c629f125f$export$6539e087749cf9d3)({\n url: imageUrl\n }).catch((err)=>(0, $3969451ff60cb8d5$export$af04143326425dbd)(err.message, \"danger\"));\n if (file) $85a5f86b715fe7db$var$handleFileSelect(file);\n } catch (err) {\n (0, $3969451ff60cb8d5$export$af04143326425dbd)(`Failed to load image from \"${imageUrl}\".`, \"danger\");\n } finally{\n submitButton.disabled = false;\n submitButton.querySelector(\".spinner\").hidden = true;\n submitButton.querySelector(\".label\").hidden = false;\n }\n};\nconst $85a5f86b715fe7db$var$moveText = (offsetDir, sign, index)=>()=>{\n const textBoxSection = document.querySelectorAll('[data-section=\"textBox\"]')[index];\n const offsetYInput = textBoxSection.querySelector('[data-input=\"offsetY\"]');\n const offsetXInput = textBoxSection.querySelector('[data-input=\"offsetX\"]');\n if (offsetDir === \"offsetY\") {\n if (sign === \"-\") $85a5f86b715fe7db$var$textOptions[index].offsetY -= 1;\n if (sign === \"+\") $85a5f86b715fe7db$var$textOptions[index].offsetY += 1;\n offsetYInput.value = $85a5f86b715fe7db$var$textOptions[index].offsetY;\n }\n if (offsetDir === \"offsetX\") {\n if (sign === \"-\") $85a5f86b715fe7db$var$textOptions[index].offsetX -= 1;\n if (sign === \"+\") $85a5f86b715fe7db$var$textOptions[index].offsetX += 1;\n offsetXInput.value = $85a5f86b715fe7db$var$textOptions[index].offsetX;\n }\n (0, $64ef5d4149d7e6a5$export$e653a2de0f3a8b89)($85a5f86b715fe7db$var$selectedImage, $85a5f86b715fe7db$var$canvas, $85a5f86b715fe7db$var$ctx, $85a5f86b715fe7db$var$textOptions);\n $85a5f86b715fe7db$var$reqAnimFrame = requestAnimationFrame($85a5f86b715fe7db$var$moveText(offsetDir, sign, index));\n };\nconst $85a5f86b715fe7db$var$handleUploadMethodChange = (evt)=>{\n $85a5f86b715fe7db$var$uploadMethodEls.forEach((el)=>el.hidden = el.id !== evt.target.value);\n};\nconst $85a5f86b715fe7db$var$handleFileSelectClick = ()=>{\n if (typeof $85a5f86b715fe7db$var$dropzoneEl.openFileDialog === \"function\") $85a5f86b715fe7db$var$dropzoneEl.openFileDialog();\n};\nconst $85a5f86b715fe7db$var$handleDropFilesAccepted = (evt)=>{\n const [file] = evt.detail.acceptedFiles;\n if (file) $85a5f86b715fe7db$var$handleFileSelect(file);\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerInput = (evt)=>{\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let prop;\n if (element.matches('[data-input=\"text\"]')) prop = \"text\";\n else if (element.matches('[data-input=\"fillColor\"]')) prop = \"fillColor\";\n else if (element.matches('[data-input=\"shadowColor\"]')) prop = \"shadowColor\";\n else if (element.matches('[data-input=\"font\"]')) prop = \"font\";\n else if (element.matches('[data-input=\"fontSize\"]')) prop = \"fontSize\";\n else if (element.matches('[data-input=\"fontWeight\"]')) prop = \"fontWeight\";\n else if (element.matches('[data-input=\"textAlign\"]')) prop = \"textAlign\";\n else if (element.matches('[data-input=\"shadowBlur\"]')) prop = \"shadowBlur\";\n else if (element.matches('[data-input=\"offsetY\"]')) prop = \"offsetY\";\n else if (element.matches('[data-input=\"offsetX\"]')) prop = \"offsetX\";\n else if (element.matches('[data-input=\"rotate\"]')) prop = \"rotate\";\n if (prop) $85a5f86b715fe7db$var$handleTextPropChange(element, index, prop);\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerChange = (evt)=>{\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let prop;\n if (element.matches('[data-input=\"allCaps\"]')) prop = \"allCaps\";\n if (prop) $85a5f86b715fe7db$var$handleTextPropChange(element, index, prop);\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerClick = (evt)=>{\n const element = evt.target;\n if (element.matches('[data-button=\"settings\"]')) {\n const textBoxIndex = element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\");\n const textBoxEls = document.querySelectorAll('[data-section=\"textBox\"]');\n textBoxEls.forEach((el, index)=>{\n const settingsEl = el.querySelector('[data-section=\"settings\"]');\n if (el.getAttribute(\"data-index\") === textBoxIndex) {\n settingsEl.hidden = !settingsEl.hidden;\n $85a5f86b715fe7db$var$textOptions[index]._isSettingsOpen = !$85a5f86b715fe7db$var$textOptions[index]._isSettingsOpen;\n } else {\n settingsEl.hidden = true;\n $85a5f86b715fe7db$var$textOptions[index]._isSettingsOpen = false;\n }\n });\n }\n if (element.matches('[data-button=\"delete-text-box\"]')) {\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let confirm = true;\n if ($85a5f86b715fe7db$var$textOptions[index].text.trim()) confirm = window.confirm(\"Are you sure you want to remove this text box?\");\n if (confirm) {\n $85a5f86b715fe7db$var$textOptions = (0, $4af3d380d1884504$export$30a014203d0d7e4f)($85a5f86b715fe7db$var$textOptions, index);\n $85a5f86b715fe7db$var$inputsContainer.querySelectorAll('[data-section=\"textBox\"]').forEach((el)=>el.remove());\n $85a5f86b715fe7db$var$textOptions.forEach((item, index)=>$85a5f86b715fe7db$var$inputsContainer.appendChild((0, $224fa2388dce65c4$export$293a4b86a6fe2398)(index, item)));\n (0, $64ef5d4149d7e6a5$export$e653a2de0f3a8b89)($85a5f86b715fe7db$var$selectedImage, $85a5f86b715fe7db$var$canvas, $85a5f86b715fe7db$var$ctx, $85a5f86b715fe7db$var$textOptions);\n }\n }\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerPointerdown = (evt)=>{\n const element = evt.target;\n const textBoxEl = element.closest('[data-section=\"textBox\"]');\n if (!textBoxEl) return;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton) return;\n const offsetDir = element.getAttribute(\"data-move\");\n const sign = element.getAttribute(\"data-sign\");\n $85a5f86b715fe7db$var$reqAnimFrame = requestAnimationFrame($85a5f86b715fe7db$var$moveText(offsetDir, sign, index));\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerPointerup = (evt)=>{\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton) return;\n cancelAnimationFrame($85a5f86b715fe7db$var$reqAnimFrame);\n $85a5f86b715fe7db$var$reqAnimFrame = null;\n};\nconst $85a5f86b715fe7db$var$handleInputsContainerPointerout = (evt)=>{\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton || !$85a5f86b715fe7db$var$reqAnimFrame) return;\n cancelAnimationFrame($85a5f86b715fe7db$var$reqAnimFrame);\n $85a5f86b715fe7db$var$reqAnimFrame = null;\n};\nconst $85a5f86b715fe7db$var$handleGalleryClick = async (evt)=>{\n const button = evt.target.closest(\"button\");\n if (!button) return;\n const img = button.querySelector(\"img\");\n try {\n const file = await (0, $0374350c629f125f$export$6539e087749cf9d3)({\n url: img.src\n }).catch((err)=>(0, $3969451ff60cb8d5$export$af04143326425dbd)(err.message, \"danger\"));\n if (file) $85a5f86b715fe7db$var$handleFileSelect(file);\n } catch (err) {\n (0, $3969451ff60cb8d5$export$af04143326425dbd)(`Failed to load image: \"${img.alt}\".`, \"danger\");\n }\n};\nconst $85a5f86b715fe7db$var$handleGallerySearchInput = (evt)=>{\n const query = evt.target.value.toLowerCase().trim();\n const galleryItems = $85a5f86b715fe7db$var$galleryEl.querySelectorAll(\"button\");\n galleryItems.forEach((item)=>{\n const alt = (item.querySelector(\"img\").getAttribute(\"alt\") || \"\").toLowerCase();\n item.hidden = !alt.includes(query);\n });\n $85a5f86b715fe7db$var$galleryNoResultsEl.hidden = !!$85a5f86b715fe7db$var$galleryEl.querySelector(\"button:not([hidden])\");\n};\nconst $85a5f86b715fe7db$var$handleWebShareError = ()=>{\n $85a5f86b715fe7db$var$downloadModal.open = false;\n (0, $3969451ff60cb8d5$export$af04143326425dbd)(\"There was an error while trying to share your meme.\", \"danger\");\n};\nconst $85a5f86b715fe7db$var$handleCapturePhotoError = (evt)=>{\n console.error(evt.detail.error);\n (0, $3969451ff60cb8d5$export$af04143326425dbd)(evt.detail.error.message, \"danger\");\n};\nconst $85a5f86b715fe7db$var$handleCapturePhotoSuccess = (evt)=>{\n $85a5f86b715fe7db$var$videoModal.open = false;\n const image = new Image();\n image.addEventListener(\"load\", $85a5f86b715fe7db$var$onImageLoaded);\n image.src = evt.detail.dataURI;\n};\nconst $85a5f86b715fe7db$var$handleModalOpen = (evt)=>{\n if (evt.target.id === \"videoModal\") {\n const capturePhotoComponent = $85a5f86b715fe7db$var$videoModal.querySelector(\"capture-photo\");\n if (capturePhotoComponent && typeof capturePhotoComponent.startVideoStream === \"function\") capturePhotoComponent.startVideoStream();\n }\n};\nconst $85a5f86b715fe7db$var$handleModalClose = (evt)=>{\n if (evt.target.id === \"videoModal\") {\n const capturePhotoComponent = $85a5f86b715fe7db$var$videoModal.querySelector(\"capture-photo\");\n if (capturePhotoComponent && typeof capturePhotoComponent.stopVideoStream === \"function\") capturePhotoComponent.stopVideoStream();\n }\n};\n$85a5f86b715fe7db$var$fileSelectBtn.addEventListener(\"click\", $85a5f86b715fe7db$var$handleFileSelectClick);\n$85a5f86b715fe7db$var$openVideoModalBtn.addEventListener(\"click\", $85a5f86b715fe7db$var$handleOpenVideoModalButtonClick);\n$85a5f86b715fe7db$var$addTextboxBtn.addEventListener(\"click\", $85a5f86b715fe7db$var$handleAddTextboxBtnClick);\n$85a5f86b715fe7db$var$generateMemeBtn.addEventListener(\"click\", $85a5f86b715fe7db$var$generateMeme);\n$85a5f86b715fe7db$var$downloadMemeBtn.addEventListener(\"click\", ()=>$85a5f86b715fe7db$var$downloadModal.open = false);\n$85a5f86b715fe7db$var$imageUrlForm.addEventListener(\"submit\", $85a5f86b715fe7db$var$handleImageUploadFromURL);\n$85a5f86b715fe7db$var$dropzoneEl.addEventListener(\"files-dropzone-drop-accepted\", $85a5f86b715fe7db$var$handleDropFilesAccepted);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"input\", $85a5f86b715fe7db$var$handleInputsContainerInput);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"change\", $85a5f86b715fe7db$var$handleInputsContainerChange);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"click\", $85a5f86b715fe7db$var$handleInputsContainerClick);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"pointerdown\", $85a5f86b715fe7db$var$handleInputsContainerPointerdown);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"pointerup\", $85a5f86b715fe7db$var$handleInputsContainerPointerup);\n$85a5f86b715fe7db$var$inputsContainer.addEventListener(\"pointerout\", $85a5f86b715fe7db$var$handleInputsContainerPointerout);\n$85a5f86b715fe7db$var$imageUploadMethodSelect.addEventListener(\"change\", $85a5f86b715fe7db$var$handleUploadMethodChange);\n$85a5f86b715fe7db$var$galleryEl.addEventListener(\"click\", $85a5f86b715fe7db$var$handleGalleryClick);\n$85a5f86b715fe7db$var$gallerySearchEl.addEventListener(\"input\", $85a5f86b715fe7db$var$handleGallerySearchInput);\n$85a5f86b715fe7db$var$solidColorForm.addEventListener(\"input\", $85a5f86b715fe7db$var$handleSolidColorFormInput);\ndocument.addEventListener(\"web-share:error\", $85a5f86b715fe7db$var$handleWebShareError);\ndocument.addEventListener(\"capture-photo:error\", $85a5f86b715fe7db$var$handleCapturePhotoError);\ndocument.addEventListener(\"capture-photo:success\", $85a5f86b715fe7db$var$handleCapturePhotoSuccess);\ndocument.addEventListener(\"me-open\", $85a5f86b715fe7db$var$handleModalOpen);\ndocument.addEventListener(\"me-close\", $85a5f86b715fe7db$var$handleModalClose);\n$85a5f86b715fe7db$var$galleryEl.querySelectorAll(\"button > img\")?.forEach((image)=>{\n image.setAttribute(\"title\", image.getAttribute(\"alt\"));\n});\n$85a5f86b715fe7db$var$textOptions.forEach((item, index)=>{\n $85a5f86b715fe7db$var$inputsContainer.appendChild((0, $224fa2388dce65c4$export$293a4b86a6fe2398)(index, item));\n});\n$85a5f86b715fe7db$var$dropzoneEl.accept = (0, $65136e012e05e2d7$export$63e7bed68b07a85c);\n(0, $56b863c8b6be7003$export$6874249d87f2602a).forEach(({ name: name, path: path, style: style, weight: weight })=>{\n (0, $56b863c8b6be7003$export$59eceaef0c7797b2)(name, path, {\n style: style,\n weight: weight\n });\n});\n\n\n//# sourceMappingURL=index.6d051d2c.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","require('./helpers/bundle-manifest').register(new __parcel__URL__(\"\").toString(),JSON.parse(\"[\\\"eq2Ey\\\",\\\"index.6d051d2c.js\\\",\\\"9jzSS\\\",\\\"Anton-Regular.e58ab3fe.ttf\\\",\\\"hr5Pp\\\",\\\"Oswald-Regular.89ec7d89.ttf\\\",\\\"5TebC\\\",\\\"Oswald-Bold.0f6a7ca6.ttf\\\",\\\"3ENF9\\\",\\\"Roboto-Regular.ca197847.ttf\\\",\\\"5yAXK\\\",\\\"Roboto-Bold.fdb9b54a.ttf\\\",\\\"k2KZ9\\\",\\\"RobotoCondensed-Regular.d585f5c7.ttf\\\",\\\"4h4UX\\\",\\\"RobotoCondensed-Bold.e1f96d4b.ttf\\\",\\\"8pomG\\\",\\\"CourierPrime-Regular.3a25a501.ttf\\\",\\\"l2v76\\\",\\\"CourierPrime-Bold.3d6bf689.ttf\\\",\\\"eKMWr\\\",\\\"OpenSans-Regular.edf9e01b.ttf\\\",\\\"dXO1Z\\\",\\\"OpenSans-Bold.8fceb72b.ttf\\\",\\\"9FH7D\\\",\\\"index.2d751096.css\\\"]\"));","import { isWebShareSupported } from '@georapbox/web-share-element/dist/is-web-share-supported.js';\nimport '@georapbox/web-share-element/dist/web-share-defined.js';\nimport '@georapbox/capture-photo-element/dist/capture-photo-defined.js';\nimport '@georapbox/modal-element/dist/modal-element-defined.js';\nimport '@georapbox/files-dropzone-element/dist/files-dropzone-defined.js';\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport '../css/main.css';\nimport { arrayRemove } from './utils/array-remove.js';\nimport { uid } from './utils/uid.js';\nimport { ACCEPTED_MIME_TYPES } from './constants.js';\nimport { customFonts, loadCustomFont } from './custom-fonts.js';\nimport { fileFromUrl } from './file-from-url.js';\nimport { toastAlert } from './toast-alert.js';\nimport { createTextBox } from './create-text-box.js';\nimport { drawCanvas } from './draw-canvas.js';\n\nconst videoModal = document.getElementById('videoModal');\nconst downloadModal = document.getElementById('downloadModal');\nconst canvas = document.getElementById('canvas');\nconst dropzoneEl = document.querySelector('files-dropzone');\nconst instructionsEl = document.getElementById('instructions');\nconst ctx = canvas.getContext('2d');\nconst imageUploadMethodSelect = document.getElementById('imageUploadMethodSelect');\nconst fileSelectBtn = document.getElementById('fileSelectBtn');\nconst imageUrlForm = document.getElementById('imageUrlForm');\nconst addTextboxBtn = document.getElementById('addTextboxBtn');\nconst inputsContainer = document.getElementById('inputsContainer');\nconst generateMemeBtn = document.getElementById('generateMemeBtn');\nconst openVideoModalBtn = document.getElementById('openVideoModalBtn');\nconst downloadMemeBtn = document.getElementById('downloadMemeBtn');\nconst downloadMemePreview = document.getElementById('downloadMemePreview');\nconst webShareComponent = document.querySelector('web-share');\nconst galleryEl = document.getElementById('gallery');\nconst gallerySearchEl = document.getElementById('gallerySearch');\nconst galleryNoResultsEl = galleryEl.querySelector('.gallery__no-results');\nconst solidColorForm = document.getElementById('solidColorForm');\nconst uploadMethodEls = document.querySelectorAll('.upload-method');\nlet selectedImage = null;\nlet reqAnimFrame = null;\n\nconst defaultTextOptions = {\n _isSettingsOpen: false,\n text: '',\n fillColor: '#ffffff',\n shadowColor: '#000000',\n font: 'Anton',\n fontSize: 40,\n fontWeight: 'normal',\n textAlign: 'center',\n shadowBlur: 3,\n offsetY: 0,\n offsetX: 0,\n rotate: 0,\n allCaps: true\n};\n\nlet textOptions = [\n { ...defaultTextOptions }\n];\n\nconst generateMeme = async () => {\n const dataUrl = canvas.toDataURL('image/png');\n\n // Prepare download link\n const downloadLink = dataUrl.replace('image/png', 'image/octet-stream');\n downloadMemeBtn.download = `${uid('meme')}.png`;\n downloadMemeBtn.href = downloadLink;\n downloadMemePreview.src = downloadLink;\n\n // Prepare for sharing file\n if (isWebShareSupported()) {\n try {\n const file = await fileFromUrl({\n url: dataUrl,\n filename: `${uid('meme')}.png`,\n mimeType: 'image/png'\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file && isWebShareSupported({ files: [file] })) {\n webShareComponent.shareFiles = [file];\n webShareComponent.hidden = false;\n }\n } catch (error) {\n console.error(error);\n }\n }\n\n downloadModal.open = true;\n};\n\nconst onImageLoaded = evt => {\n const MAX_WIDTH = 800;\n const MAX_HEIGHT = 600;\n let width = evt.target.width;\n let height = evt.target.height;\n\n if (width > height) {\n if (width > MAX_WIDTH) {\n height *= MAX_WIDTH / width;\n width = MAX_WIDTH;\n }\n } else {\n if (height > MAX_HEIGHT) {\n width *= MAX_HEIGHT / height;\n height = MAX_HEIGHT;\n }\n }\n canvas.width = width;\n canvas.height = height;\n\n selectedImage = evt.target;\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n generateMemeBtn.disabled = false;\n canvas.hidden = false;\n instructionsEl.hidden = true;\n};\n\nconst handleSolidColorFormInput = evt => {\n const DEFAULT_WIDTH = 600;\n const DEFAULT_HEIGHT = 400;\n\n if (evt.target === solidColorForm['canvasColor']) {\n selectedImage = evt.target.value;\n }\n\n if (typeof selectedImage === 'string') {\n canvas.width = Number(solidColorForm['canvasWidth'].value) || DEFAULT_WIDTH;\n canvas.height = Number(solidColorForm['canvasHeight'].value) || DEFAULT_HEIGHT;\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n generateMemeBtn.disabled = false;\n canvas.hidden = false;\n instructionsEl.hidden = true;\n }\n};\n\nconst handleFileSelect = file => {\n if (!file) {\n return;\n }\n\n const image = new Image();\n const reader = new FileReader();\n\n reader.addEventListener('load', function (evt) {\n const data = evt.target.result;\n image.addEventListener('load', onImageLoaded);\n image.src = data;\n });\n\n reader.readAsDataURL(file);\n};\n\nconst handleOpenVideoModalButtonClick = () => {\n videoModal.open = true;\n};\n\nconst handleTextPropChange = (element, index, prop) => {\n if (element.type === 'checkbox') {\n textOptions[index][prop] = element.checked;\n } else if (element.type === 'number') {\n textOptions[index][prop] = Number(element.value);\n } else {\n textOptions[index][prop] = element.value;\n }\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n};\n\nconst handleAddTextboxBtnClick = () => {\n const textOptionsLength = textOptions.length;\n const newTextBox = createTextBox(textOptionsLength, defaultTextOptions);\n\n textOptions.push({ ...defaultTextOptions });\n inputsContainer.appendChild(newTextBox);\n newTextBox.querySelector('[data-input=\"text\"]').focus();\n};\n\nconst handleImageUploadFromURL = async evt => {\n evt.preventDefault();\n\n const form = evt.target;\n const submitButton = form.querySelector('button[type=\"submit\"]');\n const imageUrl = form['imageUrl'].value;\n\n if (!imageUrl.trim()) {\n return;\n }\n\n submitButton.disabled = true;\n submitButton.querySelector('.spinner').hidden = false;\n submitButton.querySelector('.label').hidden = true;\n\n try {\n const file = await fileFromUrl({\n url: imageUrl\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file) {\n handleFileSelect(file);\n }\n } catch (err) {\n toastAlert(`Failed to load image from \"${imageUrl}\".`, 'danger');\n } finally {\n submitButton.disabled = false;\n submitButton.querySelector('.spinner').hidden = true;\n submitButton.querySelector('.label').hidden = false;\n }\n};\n\nconst moveText = (offsetDir, sign, index) => () => {\n const textBoxSection = document.querySelectorAll('[data-section=\"textBox\"]')[index];\n const offsetYInput = textBoxSection.querySelector('[data-input=\"offsetY\"]');\n const offsetXInput = textBoxSection.querySelector('[data-input=\"offsetX\"]');\n\n if (offsetDir === 'offsetY') {\n if (sign === '-') {\n textOptions[index].offsetY -= 1;\n }\n\n if (sign === '+') {\n textOptions[index].offsetY += 1;\n }\n\n offsetYInput.value = textOptions[index].offsetY;\n }\n\n if (offsetDir === 'offsetX') {\n if (sign === '-') {\n textOptions[index].offsetX -= 1;\n }\n\n if (sign === '+') {\n textOptions[index].offsetX += 1;\n }\n\n offsetXInput.value = textOptions[index].offsetX;\n }\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n reqAnimFrame = requestAnimationFrame(moveText(offsetDir, sign, index));\n};\n\nconst handleUploadMethodChange = evt => {\n uploadMethodEls.forEach(el => el.hidden = el.id !== evt.target.value);\n};\n\nconst handleFileSelectClick = () => {\n if (typeof dropzoneEl.openFileDialog === 'function') {\n dropzoneEl.openFileDialog();\n }\n};\n\nconst handleDropFilesAccepted = evt => {\n const [file] = evt.detail.acceptedFiles;\n\n if (file) {\n handleFileSelect(file);\n }\n};\n\nconst handleInputsContainerInput = evt => {\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let prop;\n\n if (element.matches('[data-input=\"text\"]')) {\n prop = 'text';\n } else if (element.matches('[data-input=\"fillColor\"]')) {\n prop = 'fillColor';\n } else if (element.matches('[data-input=\"shadowColor\"]')) {\n prop = 'shadowColor';\n } else if (element.matches('[data-input=\"font\"]')) {\n prop = 'font';\n } else if (element.matches('[data-input=\"fontSize\"]')) {\n prop = 'fontSize';\n } else if (element.matches('[data-input=\"fontWeight\"]')) {\n prop = 'fontWeight';\n } else if (element.matches('[data-input=\"textAlign\"]')) {\n prop = 'textAlign';\n } else if (element.matches('[data-input=\"shadowBlur\"]')) {\n prop = 'shadowBlur';\n } else if (element.matches('[data-input=\"offsetY\"]')) {\n prop = 'offsetY';\n } else if (element.matches('[data-input=\"offsetX\"]')) {\n prop = 'offsetX';\n } else if (element.matches('[data-input=\"rotate\"]')) {\n prop = 'rotate';\n }\n\n if (prop) {\n handleTextPropChange(element, index, prop);\n }\n};\n\nconst handleInputsContainerChange = evt => {\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let prop;\n\n if (element.matches('[data-input=\"allCaps\"]')) {\n prop = 'allCaps';\n }\n\n if (prop) {\n handleTextPropChange(element, index, prop);\n }\n};\n\nconst handleInputsContainerClick = evt => {\n const element = evt.target;\n\n if (element.matches('[data-button=\"settings\"]')) {\n const textBoxIndex = element.closest('[data-section=\"textBox\"]').getAttribute('data-index');\n const textBoxEls = document.querySelectorAll('[data-section=\"textBox\"]');\n\n textBoxEls.forEach((el, index) => {\n const settingsEl = el.querySelector('[data-section=\"settings\"]');\n\n if (el.getAttribute('data-index') === textBoxIndex) {\n settingsEl.hidden = !settingsEl.hidden;\n textOptions[index]._isSettingsOpen = !textOptions[index]._isSettingsOpen;\n } else {\n settingsEl.hidden = true;\n textOptions[index]._isSettingsOpen = false;\n }\n });\n }\n\n if (element.matches('[data-button=\"delete-text-box\"]')) {\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let confirm = true;\n\n if (textOptions[index].text.trim()) {\n confirm = window.confirm('Are you sure you want to remove this text box?');\n }\n\n if (confirm) {\n textOptions = arrayRemove(textOptions, index);\n inputsContainer.querySelectorAll('[data-section=\"textBox\"]').forEach(el => el.remove());\n textOptions.forEach((item, index) => inputsContainer.appendChild(createTextBox(index, item)));\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n }\n }\n};\n\nconst handleInputsContainerPointerdown = evt => {\n const element = evt.target;\n const textBoxEl = element.closest('[data-section=\"textBox\"]');\n\n if (!textBoxEl) {\n return;\n }\n\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton) {\n return;\n }\n\n const offsetDir = element.getAttribute('data-move');\n const sign = element.getAttribute('data-sign');\n\n reqAnimFrame = requestAnimationFrame(moveText(offsetDir, sign, index));\n};\n\nconst handleInputsContainerPointerup = evt => {\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton) {\n return;\n }\n\n cancelAnimationFrame(reqAnimFrame);\n reqAnimFrame = null;\n};\n\nconst handleInputsContainerPointerout = evt => {\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton || !reqAnimFrame) {\n return;\n }\n\n cancelAnimationFrame(reqAnimFrame);\n reqAnimFrame = null;\n};\n\nconst handleGalleryClick = async evt => {\n const button = evt.target.closest('button');\n\n if (!button) {\n return;\n }\n\n const img = button.querySelector('img');\n\n try {\n const file = await fileFromUrl({\n url: img.src\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file) {\n handleFileSelect(file);\n }\n } catch (err) {\n toastAlert(`Failed to load image: \"${img.alt}\".`, 'danger');\n }\n};\n\nconst handleGallerySearchInput = evt => {\n const query = evt.target.value.toLowerCase().trim();\n const galleryItems = galleryEl.querySelectorAll('button');\n\n galleryItems.forEach(item => {\n const alt = (item.querySelector('img').getAttribute('alt') || '').toLowerCase();\n item.hidden = !alt.includes(query);\n });\n\n galleryNoResultsEl.hidden = !!galleryEl.querySelector('button:not([hidden])');\n};\n\nconst handleWebShareError = () => {\n downloadModal.open = false;\n toastAlert('There was an error while trying to share your meme.', 'danger');\n};\n\nconst handleCapturePhotoError = evt => {\n console.error(evt.detail.error);\n toastAlert(evt.detail.error.message, 'danger');\n};\n\nconst handleCapturePhotoSuccess = evt => {\n videoModal.open = false;\n const image = new Image();\n image.addEventListener('load', onImageLoaded);\n image.src = evt.detail.dataURI;\n};\n\nconst handleModalOpen = evt => {\n if (evt.target.id === 'videoModal') {\n const capturePhotoComponent = videoModal.querySelector('capture-photo');\n\n if (capturePhotoComponent && typeof capturePhotoComponent.startVideoStream === 'function') {\n capturePhotoComponent.startVideoStream();\n }\n }\n};\n\nconst handleModalClose = evt => {\n if (evt.target.id === 'videoModal') {\n const capturePhotoComponent = videoModal.querySelector('capture-photo');\n\n if (capturePhotoComponent && typeof capturePhotoComponent.stopVideoStream === 'function') {\n capturePhotoComponent.stopVideoStream();\n }\n }\n};\n\nfileSelectBtn.addEventListener('click', handleFileSelectClick);\nopenVideoModalBtn.addEventListener('click', handleOpenVideoModalButtonClick);\naddTextboxBtn.addEventListener('click', handleAddTextboxBtnClick);\ngenerateMemeBtn.addEventListener('click', generateMeme);\ndownloadMemeBtn.addEventListener('click', () => downloadModal.open = false);\nimageUrlForm.addEventListener('submit', handleImageUploadFromURL);\ndropzoneEl.addEventListener('files-dropzone-drop-accepted', handleDropFilesAccepted);\ninputsContainer.addEventListener('input', handleInputsContainerInput);\ninputsContainer.addEventListener('change', handleInputsContainerChange);\ninputsContainer.addEventListener('click', handleInputsContainerClick);\ninputsContainer.addEventListener('pointerdown', handleInputsContainerPointerdown);\ninputsContainer.addEventListener('pointerup', handleInputsContainerPointerup);\ninputsContainer.addEventListener('pointerout', handleInputsContainerPointerout);\nimageUploadMethodSelect.addEventListener('change', handleUploadMethodChange);\ngalleryEl.addEventListener('click', handleGalleryClick);\ngallerySearchEl.addEventListener('input', handleGallerySearchInput);\nsolidColorForm.addEventListener('input', handleSolidColorFormInput);\ndocument.addEventListener('web-share:error', handleWebShareError);\ndocument.addEventListener('capture-photo:error', handleCapturePhotoError);\ndocument.addEventListener('capture-photo:success', handleCapturePhotoSuccess);\ndocument.addEventListener('me-open', handleModalOpen);\ndocument.addEventListener('me-close', handleModalClose);\n\ngalleryEl.querySelectorAll('button > img')?.forEach(image => {\n image.setAttribute('title', image.getAttribute('alt'));\n});\n\ntextOptions.forEach((item, index) => {\n inputsContainer.appendChild(createTextBox(index, item));\n});\n\ndropzoneEl.accept = ACCEPTED_MIME_TYPES;\n\ncustomFonts.forEach(({ name, path, style, weight }) => {\n loadCustomFont(name, path, { style, weight });\n});\n","function a(a){return null!==a&&\"object\"==typeof a?\"share\"in navigator&&\"canShare\"in navigator&&navigator.canShare(a):\"share\"in navigator}export{a as isWebShareSupported};\n//# sourceMappingURL=is-web-share-supported.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $e179325634270afd$exports = {};\n\n$parcel$export($e179325634270afd$exports, \"WebShare\", function () { return $e179325634270afd$export$30b344bef3e55b67; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ /**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */ const $e179325634270afd$var$styles = /* css */ `\n :host {\n display: inline-block;\n }\n`;\nconst $e179325634270afd$var$template = document.createElement(\"template\");\n$e179325634270afd$var$template.innerHTML = /* html */ `\n \n \n`;\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */ class $e179325634270afd$export$30b344bef3e55b67 extends HTMLElement {\n /** @type {Nullable} */ #buttonSlot;\n /** @type {Nullable} */ #buttonEl;\n /** @type {File[]} */ #files = [];\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\",\n delegatesFocus: true\n });\n shadowRoot.appendChild($e179325634270afd$var$template.content.cloneNode(true));\n }\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"disabled\" && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute(\"disabled\", this.disabled);\n this.#buttonEl.setAttribute(\"aria-disabled\", this.disabled.toString());\n if (this.#buttonEl.part && this.#buttonEl.part.contains(\"button\")) this.#buttonEl.part.toggle(\"button--disabled\", this.disabled);\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"shareUrl\");\n this.#upgradeProperty(\"shareTitle\");\n this.#upgradeProperty(\"shareText\");\n this.#upgradeProperty(\"shareFiles\");\n this.#upgradeProperty(\"disabled\");\n this.#buttonSlot?.addEventListener(\"slotchange\", this.#handleSlotChange);\n this.#buttonEl?.addEventListener(\"click\", this.#handleClick);\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#buttonSlot?.removeEventListener(\"slotchange\", this.#handleSlotChange);\n this.#buttonEl?.removeEventListener(\"click\", this.#handleClick);\n }\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */ get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(value) {\n this.toggleAttribute(\"disabled\", !!value);\n }\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */ get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(value) {\n this.setAttribute(\"share-url\", value);\n }\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */ get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(value) {\n this.setAttribute(\"share-title\", value);\n }\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */ get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(value) {\n this.setAttribute(\"share-text\", value);\n }\n /**\n * @type {File[]} - The files to share.\n */ get shareFiles() {\n return this.#files;\n }\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) this.#files = value;\n }\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */ async share() {\n if (this.disabled) return;\n try {\n /** @type {ShareData} */ const shareData = {};\n if (this.shareUrl) shareData.url = this.shareUrl;\n if (this.shareTitle) shareData.title = this.shareTitle;\n if (this.shareText) shareData.text = this.shareText;\n if (Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n })) shareData.files = this.shareFiles;\n await navigator.share(shareData);\n this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: true,\n composed: true,\n detail: {\n shareData: shareData\n }\n }));\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n }\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */ #handleClick = (evt)=>{\n evt.preventDefault();\n if (this.disabled) return;\n this.share();\n };\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */ #handleSlotChange = (evt)=>{\n if (evt.target && evt.target.name === \"button\") {\n this.#buttonEl?.removeEventListener(\"click\", this.#handleClick);\n this.#buttonEl = this.#getButton();\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener(\"click\", this.#handleClick);\n if (this.#buttonEl.nodeName !== \"BUTTON\" && !this.#buttonEl.hasAttribute(\"role\")) this.#buttonEl.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */ #getButton() {\n if (!this.#buttonSlot) return null;\n return this.#buttonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"button\";\n }) || null;\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"web-share\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $e179325634270afd$export$30b344bef3e55b67);\n }\n}\n\n\n(0, $e179325634270afd$export$30b344bef3e55b67).defineCustomElement();\n\n\nexport {$e179325634270afd$export$30b344bef3e55b67 as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","// @ts-check\n\n/**\n * Check if Web Share API is supported by the platform.\n *\n * @param {import('./web-share').ShareData} [options]\n * @returns {boolean} Returns `true` if Web Share API is supported; otherwise `false`.\n */\nfunction isWebShareSupported(options) {\n if (options !== null && typeof options === 'object') {\n return 'share' in navigator && 'canShare' in navigator && navigator.canShare(options);\n }\n\n return 'share' in navigator;\n}\n\nexport { isWebShareSupported };\n","Object.defineProperty({},\"WebShare\",{get:function(){return s},set:void 0,enumerable:!0,configurable:!0});let t=`\n :host {\n display: inline-block;\n }\n`,e=document.createElement(\"template\");e.innerHTML=`\n \n \n`;class s extends HTMLElement{#t;#e;#s=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(e.content.cloneNode(!0)),this.#t=this.shadowRoot?.querySelector('slot[name=\"button\"]')||null,this.#e=this.#i()}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,e,s){\"disabled\"===t&&e!==s&&this.#e&&(this.#e.toggleAttribute(\"disabled\",this.disabled),this.#e.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#e.part&&this.#e.part.contains(\"button\")&&this.#e.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#r(\"shareUrl\"),this.#r(\"shareTitle\"),this.#r(\"shareText\"),this.#r(\"shareFiles\"),this.#r(\"disabled\"),this.#t?.addEventListener(\"slotchange\",this.#a),this.#e?.addEventListener(\"click\",this.#n)}disconnectedCallback(){this.#t?.removeEventListener(\"slotchange\",this.#a),this.#e?.removeEventListener(\"click\",this.#n)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get shareUrl(){return this.getAttribute(\"share-url\")||\"\"}set shareUrl(t){this.setAttribute(\"share-url\",t)}get shareTitle(){return this.getAttribute(\"share-title\")||\"\"}set shareTitle(t){this.setAttribute(\"share-title\",t)}get shareText(){return this.getAttribute(\"share-text\")||\"\"}set shareText(t){this.setAttribute(\"share-text\",t)}get shareFiles(){return this.#s}set shareFiles(t){Array.isArray(t)&&t.length>0&&(this.#s=t)}async share(){if(!this.disabled)try{let t={};this.shareUrl&&(t.url=this.shareUrl),this.shareTitle&&(t.title=this.shareTitle),this.shareText&&(t.text=this.shareText),Array.isArray(this.shareFiles)&&this.shareFiles.length>0&&navigator.canShare&&navigator.canShare({files:this.shareFiles})&&(t.files=this.shareFiles),await navigator.share(t),this.dispatchEvent(new CustomEvent(\"web-share:success\",{bubbles:!0,composed:!0,detail:{shareData:t}}))}catch(t){if(t instanceof Error&&\"AbortError\"===t.name){this.dispatchEvent(new CustomEvent(\"web-share:abort\",{bubbles:!0,composed:!0,detail:{error:t}}));return}this.dispatchEvent(new CustomEvent(\"web-share:error\",{bubbles:!0,composed:!0,detail:{error:t}}))}}#n=t=>{t.preventDefault(),this.disabled||this.share()};#a=t=>{t.target&&\"button\"===t.target.name&&(this.#e?.removeEventListener(\"click\",this.#n),this.#e=this.#i(),this.#e&&(this.#e.addEventListener(\"click\",this.#n),\"BUTTON\"===this.#e.nodeName||this.#e.hasAttribute(\"role\")||this.#e.setAttribute(\"role\",\"button\")))};#i(){return this.#t&&this.#t.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"button\"===t.getAttribute(\"slot\"))||null}#r(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}static defineCustomElement(t=\"web-share\"){\"undefined\"==typeof window||window.customElements.get(t)||window.customElements.define(t,s)}}s.defineCustomElement();export{s as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","import { WebShare } from './web-share.js';\n\nWebShare.defineCustomElement();\n\nexport { WebShare };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */\n\nconst styles = /* css */`\n :host {\n display: inline-block;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */\nclass WebShare extends HTMLElement {\n /** @type {Nullable} */\n #buttonSlot;\n\n /** @type {Nullable} */\n #buttonEl;\n\n /** @type {File[]} */\n #files = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute('disabled', this.disabled);\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part && this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('shareUrl');\n this.#upgradeProperty('shareTitle');\n this.#upgradeProperty('shareText');\n this.#upgradeProperty('shareFiles');\n this.#upgradeProperty('disabled');\n\n this.#buttonSlot?.addEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n }\n\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */\n get shareUrl() {\n return this.getAttribute('share-url') || '';\n }\n\n set shareUrl(value) {\n this.setAttribute('share-url', value);\n }\n\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */\n get shareTitle() {\n return this.getAttribute('share-title') || '';\n }\n\n set shareTitle(value) {\n this.setAttribute('share-title', value);\n }\n\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */\n get shareText() {\n return this.getAttribute('share-text') || '';\n }\n\n set shareText(value) {\n this.setAttribute('share-text', value);\n }\n\n /**\n * @type {File[]} - The files to share.\n */\n get shareFiles() {\n return this.#files;\n }\n\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) {\n this.#files = value;\n }\n }\n\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */\n async share() {\n if (this.disabled) {\n return;\n }\n\n try {\n /** @type {ShareData} */\n const shareData = {};\n\n if (this.shareUrl) {\n shareData.url = this.shareUrl;\n }\n\n if (this.shareTitle) {\n shareData.title = this.shareTitle;\n }\n\n if (this.shareText) {\n shareData.text = this.shareText;\n }\n\n if (\n Array.isArray(this.shareFiles)\n && this.shareFiles.length > 0\n && navigator.canShare\n && navigator.canShare({ files: this.shareFiles })\n ) {\n shareData.files = this.shareFiles;\n }\n\n await navigator.share(shareData);\n\n this.dispatchEvent(new CustomEvent('web-share:success', {\n bubbles: true,\n composed: true,\n detail: { shareData }\n }));\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n this.dispatchEvent(new CustomEvent('web-share:abort', {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n\n return;\n }\n\n this.dispatchEvent(new CustomEvent('web-share:error', {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n }\n\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n this.share();\n };\n\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */\n #handleSlotChange = evt => {\n if (evt.target && evt.target.name === 'button') {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n this.#buttonEl = this.#getButton();\n\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener('click', this.#handleClick);\n\n if (this.#buttonEl.nodeName !== 'BUTTON' && !this.#buttonEl.hasAttribute('role')) {\n this.#buttonEl.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */\n #getButton() {\n if (!this.#buttonSlot) {\n return null;\n }\n\n return this.#buttonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'button';\n }) || null;\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'web-share') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, WebShare);\n }\n }\n}\n\nexport { WebShare };\n","Object.defineProperty({},\"CapturePhoto\",{get:function(){return n},set:void 0,enumerable:!0,configurable:!0});let t=(t,e,i)=>(Number.isNaN(e)&&(e=0),Number.isNaN(i)&&(i=0),Math.min(Math.max(t,Math.min(e,i)),Math.max(e,i))),e=\"capture-photo\",i=`\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`,o=document.createElement(\"template\");o.innerHTML=`\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;class n extends HTMLElement{#t={};#e=null;#i=null;#o=null;#n=null;#a=null;#s=null;#r=null;#l=null;constructor(){super(),this.#t=this.getSupportedConstraints(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(o.content.cloneNode(!0))}static get observedAttributes(){return[\"no-image\",\"facing-mode\",\"camera-resolution\",\"pan\",\"tilt\",\"zoom\"]}attributeChangedCallback(t,e,i){if(!this.isConnected)return;let o=this.getTrackCapabilities(),n=this.getTrackSettings();if(\"no-image\"===t&&e!==i&&this.#u(),\"facing-mode\"===t&&e!==i&&\"facingMode\"in this.#t){let t=[\"user\",\"environment\"].includes(this.facingMode||\"\");\"facingMode\"in n&&t&&(this.stopVideoStream(),this.startVideoStream())}if(\"camera-resolution\"===t&&e!==i&&\"string\"==typeof this.cameraResolution&&this.cameraResolution.trim().length>0){let[t=0,e=0]=this.cameraResolution.split(\"x\").map(t=>Number(t));if(t>0&&e>0&&\"width\"in o&&\"height\"in o){let i=!!(o.width?.min&&o.width?.max)&&t>=o?.width?.min&&t<=o?.width?.max,a=!!(o.height?.min&&o.height?.max)&&e>=o?.height?.min&&e<=o?.height?.max;\"width\"in n&&\"height\"in n&&i&&a&&(this.stopVideoStream(),this.startVideoStream())}}if(\"pan\"===t&&e!==i&&\"pan\"in this.#t){let t=!!(\"pan\"in o&&o.pan?.min&&o.pan?.max)&&this.pan>=o.pan.min&&this.pan<=o.pan.max;\"pan\"in n&&\"number\"==typeof this.pan&&t&&this.#h(\"pan\",this.pan)}if(\"tilt\"===t&&e!==i&&\"tilt\"in this.#t){let t=!!(\"tilt\"in o&&o.tilt?.min&&o.tilt?.max)&&this.tilt>=o.tilt.min&&this.tilt<=o.tilt.max;\"tilt\"in n&&\"number\"==typeof this.tilt&&t&&this.#h(\"tilt\",this.tilt)}if(\"zoom\"===t&&e!==i&&\"zoom\"in this.#t){let t=!!(\"zoom\"in o&&o.zoom?.min&&o.zoom?.max)&&this.zoom>=o.zoom.min&&this.zoom<=o.zoom.max;\"zoom\"in n&&\"number\"==typeof this.zoom&&t&&this.#h(\"zoom\",this.zoom)}}connectedCallback(){if(this.#d(\"autpoPlay\"),this.#d(\"noImage\"),this.#d(\"facingMode\"),this.#d(\"cameraResolution\"),this.#d(\"pan\"),this.#d(\"tilt\"),this.#d(\"zoom\"),this.#d(\"calculateFileSize\"),this.#i=this.shadowRoot?.querySelector(\"canvas\")||null,this.#o=this.shadowRoot?.getElementById(\"output\")||null,this.#n=this.shadowRoot?.querySelector(\"video\")||null,this.#a=this.shadowRoot?.querySelector('slot[name=\"capture-button\"]')||null,this.#s=this.#c(),this.#r=this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]')||null,this.#l=this.#m(),this.#n?.addEventListener(\"loadedmetadata\",this.#p),this.#a?.addEventListener(\"slotchange\",this.#g),this.#s?.addEventListener(\"click\",this.#b),this.#r?.addEventListener(\"slotchange\",this.#f),this.#l?.addEventListener(\"click\",this.#v),!n.isSupported())return this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:{name:\"NotSupportedError\",message:\"Not supported\"}}}));this.autoPlay&&this.startVideoStream()}disconnectedCallback(){this.stopVideoStream(),this.#l?.removeEventListener(\"click\",this.#v),this.#s?.removeEventListener(\"click\",this.#b),this.#n?.removeEventListener(\"canplay\",this.#p),this.#a?.removeEventListener(\"slotchange\",this.#g),this.#r?.removeEventListener(\"slotchange\",this.#f)}get autoPlay(){return this.hasAttribute(\"auto-play\")}set autoPlay(t){this.toggleAttribute(\"auto-play\",!!t)}get noImage(){return this.hasAttribute(\"no-image\")}set noImage(t){this.toggleAttribute(\"no-image\",!!t)}get facingMode(){return this.getAttribute(\"facing-mode\")||\"user\"}set facingMode(t){this.setAttribute(\"facing-mode\",t)}get cameraResolution(){return this.getAttribute(\"camera-resolution\")||\"\"}set cameraResolution(t){this.setAttribute(\"camera-resolution\",t)}get pan(){return Number(this.getAttribute(\"pan\"))||0}set pan(t){this.setAttribute(\"pan\",null!=t?t.toString():t)}get tilt(){return Number(this.getAttribute(\"tilt\"))||0}set tilt(t){this.setAttribute(\"tilt\",null!=t?t.toString():t)}get zoom(){return Number(this.getAttribute(\"zoom\"))||1}set zoom(t){this.setAttribute(\"zoom\",null!=t?t.toString():t)}get loading(){return this.hasAttribute(\"loading\")}get calculateFileSize(){return this.hasAttribute(\"calculate-file-size\")}set calculateFileSize(t){this.toggleAttribute(\"calculate-file-size\",!!t)}#v=t=>{t.preventDefault(),this.loading||(this.facingMode=\"user\"!==this.facingMode&&this.facingMode?\"user\":\"environment\")};#b=t=>{t.preventDefault(),this.capture()};#p=t=>{let i=t.target;i.play().then(()=>{this.dispatchEvent(new CustomEvent(`${e}:video-play`,{bubbles:!0,composed:!0,detail:{video:i}}))}).catch(t=>{this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}).finally(()=>{this.removeAttribute(\"loading\")})};#u(){this.#o&&Array.from(this.#o.childNodes).forEach(t=>t.remove())}#h(e,i){if(!this.#e||!e||!i)return;let[o]=this.#e.getVideoTracks(),n=this.getTrackCapabilities();e in this.getTrackSettings()&&o.applyConstraints({advanced:[{[e]:t(Number(i),n[e]?.min||1,n[e]?.max||1)}]})}#g=t=>{t.target?.name===\"capture-button\"&&(this.#s?.removeEventListener(\"click\",this.#b),this.#s=this.#c(),this.#s&&(this.#s.addEventListener(\"click\",this.#b),\"BUTTON\"===this.#s.nodeName||this.#s.hasAttribute(\"role\")||this.#s.setAttribute(\"role\",\"button\")))};#f=t=>{t.target?.name===\"facing-mode-button\"&&(this.#l?.removeEventListener(\"click\",this.#v),this.#l=this.#m(),this.#l&&(this.#l.addEventListener(\"click\",this.#v),\"BUTTON\"===this.#l.nodeName||this.#l.hasAttribute(\"role\")||this.#l.setAttribute(\"role\",\"button\")))};#m(){return this.#r&&this.#r.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"facing-mode-button\"===t.getAttribute(\"slot\"))||null}#c(){return this.#a&&this.#a.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"capture-button\"===t.getAttribute(\"slot\"))||null}#d(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}async startVideoStream(){if(!n.isSupported()||this.#e)return;this.setAttribute(\"loading\",\"\");let t={video:{facingMode:{ideal:this.facingMode||\"user\"},pan:!0,tilt:!0,zoom:!0},audio:!1};if(\"string\"==typeof this.cameraResolution&&this.cameraResolution.trim().length>0){let[e=0,i=0]=this.cameraResolution.split(\"x\").map(t=>Number(t));e>0&&i>0&&(t.video.width=e,t.video.height=i)}try{this.#e=await navigator.mediaDevices.getUserMedia(t),this.#n&&(this.#n.srcObject=this.#e),this.#h(\"pan\",this.pan),this.#h(\"tilt\",this.tilt),this.#h(\"zoom\",this.zoom);let e=this.getTrackSettings();\"facingMode\"in e&&this.#r&&(this.#r.hidden=!1)}catch(t){this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}finally{this.removeAttribute(\"loading\")}}stopVideoStream(){if(!this.#n||!this.#e)return;let[t]=this.#e.getVideoTracks();t?.stop(),this.#n.srcObject=null,this.#e=null}async capture(){if(!this.loading&&this.#i&&this.#n)try{let t=this.#i.getContext(\"2d\"),i=this.#n.videoWidth,o=this.#n.videoHeight;this.#i.width=i,this.#i.height=o,t?.drawImage(this.#n,0,0,i,o);let n=this.#i.toDataURL(\"image/png\");if(\"string\"==typeof n&&n.includes(\"data:image\")){if(!this.noImage){let t=new Image;t.src=n,t.width=i,t.height=o,t.setAttribute(\"part\",\"output-image\"),this.#u(),this.#o?.appendChild(t)}let t={dataURI:n,width:i,height:o};if(this.calculateFileSize)try{let e=await fetch(n),i=(await e.blob()).size;i&&(t.size=i)}catch(t){}this.dispatchEvent(new CustomEvent(`${e}:success`,{bubbles:!0,composed:!0,detail:t}))}}catch(t){this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}getSupportedConstraints(){return n.isSupported()&&navigator.mediaDevices.getSupportedConstraints()||{}}getTrackCapabilities(){if(!this.#e)return{};let[t]=this.#e.getVideoTracks();return t&&\"function\"==typeof t.getCapabilities&&t.getCapabilities()||{}}getTrackSettings(){if(!this.#e)return{};let[t]=this.#e.getVideoTracks();return t&&\"function\"==typeof t.getSettings&&t.getSettings()||{}}static isSupported(){return!!navigator.mediaDevices?.getUserMedia}static defineCustomElement(t=e){\"undefined\"==typeof window||window.customElements.get(t)||window.customElements.define(t,n)}}n.defineCustomElement();export{n as CapturePhoto};\n//# sourceMappingURL=capture-photo-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $c290816263f90981$exports = {};\n\n$parcel$export($c290816263f90981$exports, \"CapturePhoto\", function () { return $c290816263f90981$export$cc30a98fe3890794; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ /**\n * @typedef {Object} ExtendedMediaTrackCapabilities\n * @property {ULongRange} [width] - The width of the video track.\n * @property {ULongRange} [height] - The height of the video track.\n * @property {ULongRange} [pan] - The pan level of the camera.\n * @property {ULongRange} [tilt] - The tilt level of the camera.\n * @property {ULongRange} [zoom] - The zoom level of the camera.\n * @property {MediaTrackCapabilities} [nativeMediaTrackCapabilities] - The native track capabilities.\n */ /**\n * @typedef {Object} ExtendedMediaTrackConstraints\n * @property {MediaTrackConstraints & {pan: boolean, tilt: boolean, zoom: boolean}} video - The video constraints.\n * @property {MediaTrackConstraints | boolean} audio - The audio constraints.\n */ // @ts-check\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */ const $02ad8beec419df62$export$7d15b64cf5a3a4c4 = (value, lower, upper)=>{\n if (Number.isNaN(lower)) lower = 0;\n if (Number.isNaN(upper)) upper = 0;\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n\n\nconst $c290816263f90981$var$COMPONENT_NAME = \"capture-photo\";\nconst $c290816263f90981$var$styles = /* css */ `\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`;\nconst $c290816263f90981$var$template = document.createElement(\"template\");\n$c290816263f90981$var$template.innerHTML = /* html */ `\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\n/**\n * @summary A custom element that implements the MediaDevices.getUserMedia() method of the MediaDevices interface to capture a photo in the browser.\n * @documentation https://github.com/georapbox/capture-photo-element\n *\n * @tagname capture-photo This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @property {boolean} noImage - Whether or not to show the captured image.\n * @property {string} facingMode - The facing mode of the camera.\n * @property {string} cameraResolution - The resolution of the camera.\n * @property {number} pan - The pan value of the camera.\n * @property {number} tilt - The tilt value of the camera.\n * @property {number} zoom - The zoom value of the camera.\n * @property {boolean} loading - Whether or not the video stream is loading.\n * @property {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n *\n * @atttribute {boolean} auto-play - Reflects the autoPlay property.\n * @atttribute {boolean} no-image - Reflects the noImage property.\n * @atttribute {string} facing-mode - Reflects the facingMode property.\n * @atttribute {string} camera-resolution - Reflects the cameraResolution property.\n * @atttribute {number} pan - Reflects the pan property.\n * @atttribute {number} tilt - Reflects the tilt property.\n * @atttribute {number} zoom - Reflects the zoom property.\n * @atttribute {boolean} loading - Reflects the loading property.\n * @atttribute {boolean} calculate-file-size - Reflects the calculateFileSize property.\n *\n * @slot capture-button - The capture button.\n * @slot capture-button-content - The capture button content.\n * @slot facing-mode-button - The facing mode button.\n * @slot facing-mode-button-content - The facing mode button content.\n * @slot actions - The actions container.\n * @slot - A default un-named slot to add content inside the component.\n *\n * @csspart video - The video element.\n * @csspart actions-container - The actions container.\n * @csspart capture-button - The capture button.\n * @csspart facing-mode-button - The facing mode button.\n * @csspart output-container - The output container.\n * @csspart output-image - The output image.\n *\n * @event capture-photo:video-play - Fires when the video stream is successfully playing.\n * @event capture-photo:success - Fires when the photo is successfully captured.\n * @event capture-photo:error - Fires when an error occurs.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method isSupported - Static method. Checks if the MediaDevices.getUserMedia() method is supported.\n * @method startVideoStream - Instance method. Starts the video stream.\n * @method stopVideoStream - Instance method. Stops the video stream.\n * @method capture - Instance method. Captures a photo.\n * @method getSupportedConstraints - Instance method. Gets the supported constraints.\n * @method getTrackCapabilities - Instance method. Gets the track capabilities.\n * @method getTrackSettings - Instance method. Gets the track settings.\n */ class $c290816263f90981$export$cc30a98fe3890794 extends HTMLElement {\n /** @type {MediaTrackSupportedConstraints | {}}*/ #supportedConstraints = {};\n /** @type {Nullable} */ #stream = null;\n /** @type {Nullable} */ #canvasElement = null;\n /** @type {Nullable} */ #outputElement = null;\n /** @type {Nullable} */ #videoElement = null;\n /** @type {Nullable} */ #captureButtonSlot = null;\n /** @type {Nullable} */ #captureButton = null;\n /** @type {Nullable} */ #facingModeButtonSlot = null;\n /** @type {Nullable} */ #facingModeButton = null;\n constructor(){\n super();\n this.#supportedConstraints = this.getSupportedConstraints();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($c290816263f90981$var$template.content.cloneNode(true));\n }\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"facing-mode\",\n \"camera-resolution\",\n \"pan\",\n \"tilt\",\n \"zoom\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) return;\n /** @type {ExtendedMediaTrackCapabilities} */ const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n if (name === \"no-image\" && oldValue !== newValue) this.#emptyOutputElement();\n if (name === \"facing-mode\" && oldValue !== newValue && \"facingMode\" in this.#supportedConstraints) {\n const isValidFacingMode = [\n \"user\",\n \"environment\"\n ].includes(this.facingMode || \"\");\n if (\"facingMode\" in trackSettings && isValidFacingMode) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n if (name === \"camera-resolution\" && oldValue !== newValue) {\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0 && \"width\" in trackCapabilities && \"height\" in trackCapabilities) {\n const widthInAllowedRange = trackCapabilities.width?.min && trackCapabilities.width?.max ? width >= trackCapabilities?.width?.min && width <= trackCapabilities?.width?.max : false;\n const heightInAllowedRange = trackCapabilities.height?.min && trackCapabilities.height?.max ? height >= trackCapabilities?.height?.min && height <= trackCapabilities?.height?.max : false;\n if (\"width\" in trackSettings && \"height\" in trackSettings && widthInAllowedRange && heightInAllowedRange) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n }\n }\n if (name === \"pan\" && oldValue !== newValue && \"pan\" in this.#supportedConstraints) {\n const panInAllowedRange = \"pan\" in trackCapabilities && trackCapabilities.pan?.min && trackCapabilities.pan?.max ? this.pan >= trackCapabilities.pan.min && this.pan <= trackCapabilities.pan.max : false;\n if (\"pan\" in trackSettings && typeof this.pan === \"number\" && panInAllowedRange) this.#applyPTZ(\"pan\", this.pan);\n }\n if (name === \"tilt\" && oldValue !== newValue && \"tilt\" in this.#supportedConstraints) {\n const tiltInAllowedRange = \"tilt\" in trackCapabilities && trackCapabilities.tilt?.min && trackCapabilities.tilt?.max ? this.tilt >= trackCapabilities.tilt.min && this.tilt <= trackCapabilities.tilt.max : false;\n if (\"tilt\" in trackSettings && typeof this.tilt === \"number\" && tiltInAllowedRange) this.#applyPTZ(\"tilt\", this.tilt);\n }\n if (name === \"zoom\" && oldValue !== newValue && \"zoom\" in this.#supportedConstraints) {\n const zoomInAllowedRange = \"zoom\" in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max : false;\n if (\"zoom\" in trackSettings && typeof this.zoom === \"number\" && zoomInAllowedRange) this.#applyPTZ(\"zoom\", this.zoom);\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"autpoPlay\");\n this.#upgradeProperty(\"noImage\");\n this.#upgradeProperty(\"facingMode\");\n this.#upgradeProperty(\"cameraResolution\");\n this.#upgradeProperty(\"pan\");\n this.#upgradeProperty(\"tilt\");\n this.#upgradeProperty(\"zoom\");\n this.#upgradeProperty(\"calculateFileSize\");\n this.#canvasElement = this.shadowRoot?.querySelector(\"canvas\") || null;\n this.#outputElement = this.shadowRoot?.getElementById(\"output\") || null;\n this.#videoElement = this.shadowRoot?.querySelector(\"video\") || null;\n this.#captureButtonSlot = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null;\n this.#captureButton = this.#getCaptureButton();\n this.#facingModeButtonSlot = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null;\n this.#facingModeButton = this.#getFacingModeButton();\n this.#videoElement?.addEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.addEventListener(\"slotchange\", this.#onCaptureButtonSlotChange);\n this.#captureButton?.addEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#facingModeButtonSlot?.addEventListener(\"slotchange\", this.#onFacingModeButtonSlotChange);\n this.#facingModeButton?.addEventListener(\"click\", this.#onFacingModeButtonClick);\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported()) return this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n if (this.autoPlay) this.startVideoStream();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.stopVideoStream();\n this.#facingModeButton?.removeEventListener(\"click\", this.#onFacingModeButtonClick);\n this.#captureButton?.removeEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#videoElement?.removeEventListener(\"canplay\", this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.removeEventListener(\"slotchange\", this.#onCaptureButtonSlotChange);\n this.#facingModeButtonSlot?.removeEventListener(\"slotchange\", this.#onFacingModeButtonSlotChange);\n }\n /**\n * @type {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @attribute auto-play - Reflects the autoPlay attribute.\n */ get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(value) {\n this.toggleAttribute(\"auto-play\", !!value);\n }\n /**\n * @type {boolean} noImage - Whether or not to show the captured image.\n * @attribute no-image - Reflects the noImage attribute.\n */ get noImage() {\n return this.hasAttribute(\"no-image\");\n }\n set noImage(value) {\n this.toggleAttribute(\"no-image\", !!value);\n }\n /**\n * @type {string} facingMode - The facing mode of the camera.\n * @attribute facing-mode - Reflects the facingMode attribute.\n */ get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(value) {\n this.setAttribute(\"facing-mode\", value);\n }\n /**\n * @type {string} cameraResolution - The resolution of the camera.\n * @attribute camera-resolution - Reflects the cameraResolution attribute.\n */ get cameraResolution() {\n return this.getAttribute(\"camera-resolution\") || \"\";\n }\n set cameraResolution(value) {\n this.setAttribute(\"camera-resolution\", value);\n }\n /**\n * @type {number} pan - The pan value of the camera.\n * @attribute pan - Reflects the pan attribute.\n */ get pan() {\n return Number(this.getAttribute(\"pan\")) || 0;\n }\n set pan(value) {\n this.setAttribute(\"pan\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} tilt - The tilt value of the camera.\n * @attribute tilt - Reflects the tilt attribute.\n */ get tilt() {\n return Number(this.getAttribute(\"tilt\")) || 0;\n }\n set tilt(value) {\n this.setAttribute(\"tilt\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} zoom - The zoom value of the camera.\n * @attribute zoom - Reflects the zoom attribute.\n */ get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(value) {\n this.setAttribute(\"zoom\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} loading - Whether or not the video stream is loading.\n * @attribute loading - Reflects the loading attribute.\n */ get loading() {\n return this.hasAttribute(\"loading\");\n }\n /**\n * @type {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n * @attribute calculate-file-size - Reflects the calculateFileSize attribute.\n */ get calculateFileSize() {\n return this.hasAttribute(\"calculate-file-size\");\n }\n set calculateFileSize(value) {\n this.toggleAttribute(\"calculate-file-size\", !!value);\n }\n /**\n * Handles the click event of the facing mode button.\n *\n * @param {*} evt - The click event.\n */ #onFacingModeButtonClick = (evt)=>{\n evt.preventDefault();\n if (this.loading) return;\n this.facingMode = this.facingMode === \"user\" || !this.facingMode ? \"environment\" : \"user\";\n };\n /**\n * Handles the click event of the capture button.\n *\n * @param {*} evt - The click event.\n */ #onCapturePhotoButtonClick = (evt)=>{\n evt.preventDefault();\n this.capture();\n };\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {*} evt - The loadedmetadata event.\n */ #onVideoLoadedMetaData = (evt)=>{\n const video = evt.target;\n video.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: {\n video: video\n }\n }));\n }).catch(/** @param {Error} error */ (error)=>{\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n /**\n * Removes all child nodes from the output element.\n */ #emptyOutputElement() {\n if (!this.#outputElement) return;\n Array.from(this.#outputElement.childNodes).forEach((node)=>node.remove());\n }\n /**\n * Applies the pan, tilt or zoom constraint.\n *\n * @param {'pan' | 'tilt' | 'zoom'} constraintName - The name of the constraint.\n * @param {number} constraintValue - The value of the constraint.\n */ #applyPTZ(constraintName, constraintValue) {\n if (!this.#stream || !constraintName || !constraintValue) return;\n const [track] = this.#stream.getVideoTracks();\n /** @type {ExtendedMediaTrackCapabilities} */ const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n if (constraintName in trackSettings) track.applyConstraints({\n advanced: [\n {\n [constraintName]: (0, $02ad8beec419df62$export$7d15b64cf5a3a4c4)(Number(constraintValue), trackCapabilities[constraintName]?.min || 1, trackCapabilities[constraintName]?.max || 1)\n }\n ]\n });\n }\n /**\n * Handles the slotchange event of the capture button slot.\n *\n * @param {*} evt - The slotchange event.\n */ #onCaptureButtonSlotChange = (evt)=>{\n if (evt.target?.name === \"capture-button\") {\n this.#captureButton?.removeEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#captureButton = this.#getCaptureButton();\n if (this.#captureButton) {\n this.#captureButton.addEventListener(\"click\", this.#onCapturePhotoButtonClick);\n if (this.#captureButton.nodeName !== \"BUTTON\" && !this.#captureButton.hasAttribute(\"role\")) this.#captureButton.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Handles the slotchange event of the facing mode button slot.\n *\n * @param {*} evt - The slotchange event.\n */ #onFacingModeButtonSlotChange = (evt)=>{\n if (evt.target?.name === \"facing-mode-button\") {\n this.#facingModeButton?.removeEventListener(\"click\", this.#onFacingModeButtonClick);\n this.#facingModeButton = this.#getFacingModeButton();\n if (this.#facingModeButton) {\n this.#facingModeButton.addEventListener(\"click\", this.#onFacingModeButtonClick);\n if (this.#facingModeButton.nodeName !== \"BUTTON\" && !this.#facingModeButton.hasAttribute(\"role\")) this.#facingModeButton.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Returns the facing mode button.\n *\n * @returns {Nullable}\n */ #getFacingModeButton() {\n if (!this.#facingModeButtonSlot) return null;\n return this.#facingModeButtonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"facing-mode-button\";\n }) || null;\n }\n /**\n * Returns the capture button.\n *\n * @returns {Nullable}\n */ #getCaptureButton() {\n if (!this.#captureButtonSlot) return null;\n return this.#captureButtonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"capture-button\";\n }) || null;\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'autpoPlay' | 'noImage' | 'facingMode' | 'cameraResolution' | 'pan' | 'tilt' | 'zoom' | 'calculateFileSize'} prop\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Starts the video stream.\n *\n * @returns Promise\n */ async startVideoStream() {\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported() || this.#stream) return;\n this.setAttribute(\"loading\", \"\");\n /** @type {ExtendedMediaTrackConstraints} */ const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: true,\n tilt: true,\n zoom: true\n },\n audio: false\n };\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n if (this.#videoElement) this.#videoElement.srcObject = this.#stream;\n this.#applyPTZ(\"pan\", this.pan);\n this.#applyPTZ(\"tilt\", this.tilt);\n this.#applyPTZ(\"zoom\", this.zoom);\n const trackSettings = this.getTrackSettings();\n if (\"facingMode\" in trackSettings && this.#facingModeButtonSlot) this.#facingModeButtonSlot.hidden = false;\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n /**\n * Stops the video stream.\n */ stopVideoStream() {\n if (!this.#videoElement || !this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n /**\n * Captures a photo using the element's properties.\n *\n * @returns Promise\n */ async capture() {\n if (this.loading || !this.#canvasElement || !this.#videoElement) return;\n try {\n const ctx = this.#canvasElement.getContext(\"2d\");\n const width = this.#videoElement.videoWidth;\n const height = this.#videoElement.videoHeight;\n this.#canvasElement.width = width;\n this.#canvasElement.height = height;\n ctx?.drawImage(this.#videoElement, 0, 0, width, height);\n const dataURI = this.#canvasElement.toDataURL(\"image/png\");\n if (typeof dataURI === \"string\" && dataURI.includes(\"data:image\")) {\n if (!this.noImage) {\n const image = new Image();\n image.src = dataURI;\n image.width = width;\n image.height = height;\n image.setAttribute(\"part\", \"output-image\");\n this.#emptyOutputElement();\n this.#outputElement?.appendChild(image);\n }\n /** @type {{ dataURI: string, width: number, height: number, size?: number }} */ const eventDetail = {\n dataURI: dataURI,\n width: width,\n height: height\n };\n if (this.calculateFileSize) try {\n const file = await fetch(dataURI);\n const blob = await file.blob();\n const size = blob.size;\n if (size) eventDetail.size = size;\n } catch (err) {\n // Fail silently...\n }\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:success`, {\n bubbles: true,\n composed: true,\n detail: eventDetail\n }));\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n }\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */ getSupportedConstraints() {\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported()) return {};\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */ getTrackCapabilities() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getCapabilities === \"function\") return track.getCapabilities() || {};\n return {};\n }\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */ getTrackSettings() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getSettings === \"function\") return track.getSettings() || {};\n return {};\n }\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */ static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='capture-photo'] - The name of the custom element.\n * @example\n *\n * CapturePhoto.defineCustomElement('my-capture-photo');\n */ static defineCustomElement(elementName = $c290816263f90981$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $c290816263f90981$export$cc30a98fe3890794);\n }\n}\n\n\n(0, $c290816263f90981$export$cc30a98fe3890794).defineCustomElement();\n\n\nexport {$c290816263f90981$export$cc30a98fe3890794 as CapturePhoto};\n//# sourceMappingURL=capture-photo-defined.js.map\n","import { CapturePhoto } from './capture-photo.js';\n\nCapturePhoto.defineCustomElement();\n\nexport { CapturePhoto };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * @typedef {Object} ExtendedMediaTrackCapabilities\n * @property {ULongRange} [width] - The width of the video track.\n * @property {ULongRange} [height] - The height of the video track.\n * @property {ULongRange} [pan] - The pan level of the camera.\n * @property {ULongRange} [tilt] - The tilt level of the camera.\n * @property {ULongRange} [zoom] - The zoom level of the camera.\n * @property {MediaTrackCapabilities} [nativeMediaTrackCapabilities] - The native track capabilities.\n */\n\n/**\n * @typedef {Object} ExtendedMediaTrackConstraints\n * @property {MediaTrackConstraints & {pan: boolean, tilt: boolean, zoom: boolean}} video - The video constraints.\n * @property {MediaTrackConstraints | boolean} audio - The audio constraints.\n */\n\nimport { clamp } from './utils/clamp.js';\n\nconst COMPONENT_NAME = 'capture-photo';\n\nconst styles = /* css */`\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */`\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\n\n/**\n * @summary A custom element that implements the MediaDevices.getUserMedia() method of the MediaDevices interface to capture a photo in the browser.\n * @documentation https://github.com/georapbox/capture-photo-element\n *\n * @tagname capture-photo This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @property {boolean} noImage - Whether or not to show the captured image.\n * @property {string} facingMode - The facing mode of the camera.\n * @property {string} cameraResolution - The resolution of the camera.\n * @property {number} pan - The pan value of the camera.\n * @property {number} tilt - The tilt value of the camera.\n * @property {number} zoom - The zoom value of the camera.\n * @property {boolean} loading - Whether or not the video stream is loading.\n * @property {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n *\n * @atttribute {boolean} auto-play - Reflects the autoPlay property.\n * @atttribute {boolean} no-image - Reflects the noImage property.\n * @atttribute {string} facing-mode - Reflects the facingMode property.\n * @atttribute {string} camera-resolution - Reflects the cameraResolution property.\n * @atttribute {number} pan - Reflects the pan property.\n * @atttribute {number} tilt - Reflects the tilt property.\n * @atttribute {number} zoom - Reflects the zoom property.\n * @atttribute {boolean} loading - Reflects the loading property.\n * @atttribute {boolean} calculate-file-size - Reflects the calculateFileSize property.\n *\n * @slot capture-button - The capture button.\n * @slot capture-button-content - The capture button content.\n * @slot facing-mode-button - The facing mode button.\n * @slot facing-mode-button-content - The facing mode button content.\n * @slot actions - The actions container.\n * @slot - A default un-named slot to add content inside the component.\n *\n * @csspart video - The video element.\n * @csspart actions-container - The actions container.\n * @csspart capture-button - The capture button.\n * @csspart facing-mode-button - The facing mode button.\n * @csspart output-container - The output container.\n * @csspart output-image - The output image.\n *\n * @event capture-photo:video-play - Fires when the video stream is successfully playing.\n * @event capture-photo:success - Fires when the photo is successfully captured.\n * @event capture-photo:error - Fires when an error occurs.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method isSupported - Static method. Checks if the MediaDevices.getUserMedia() method is supported.\n * @method startVideoStream - Instance method. Starts the video stream.\n * @method stopVideoStream - Instance method. Stops the video stream.\n * @method capture - Instance method. Captures a photo.\n * @method getSupportedConstraints - Instance method. Gets the supported constraints.\n * @method getTrackCapabilities - Instance method. Gets the track capabilities.\n * @method getTrackSettings - Instance method. Gets the track settings.\n */\nclass CapturePhoto extends HTMLElement {\n /** @type {MediaTrackSupportedConstraints | {}}*/\n #supportedConstraints = {};\n\n /** @type {Nullable} */\n #stream = null;\n\n /** @type {Nullable} */\n #canvasElement = null;\n\n /** @type {Nullable} */\n #outputElement = null;\n\n /** @type {Nullable} */\n #videoElement = null;\n\n /** @type {Nullable} */\n #captureButtonSlot = null;\n\n /** @type {Nullable} */\n #captureButton = null;\n\n /** @type {Nullable} */\n #facingModeButtonSlot = null;\n\n /** @type {Nullable} */\n #facingModeButton = null;\n\n constructor() {\n super();\n\n this.#supportedConstraints = this.getSupportedConstraints();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['no-image', 'facing-mode', 'camera-resolution', 'pan', 'tilt', 'zoom'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) {\n return;\n }\n\n /** @type {ExtendedMediaTrackCapabilities} */\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n if (name === 'no-image' && oldValue !== newValue) {\n this.#emptyOutputElement();\n }\n\n if (name === 'facing-mode' && oldValue !== newValue && 'facingMode' in this.#supportedConstraints) {\n const isValidFacingMode = ['user', 'environment'].includes(this.facingMode || '');\n\n if ('facingMode' in trackSettings && isValidFacingMode) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n\n if (name === 'camera-resolution' && oldValue !== newValue) {\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0 && 'width' in trackCapabilities && 'height' in trackCapabilities) {\n const widthInAllowedRange = trackCapabilities.width?.min && trackCapabilities.width?.max\n ? width >= trackCapabilities?.width?.min && width <= trackCapabilities?.width?.max\n : false;\n\n const heightInAllowedRange = trackCapabilities.height?.min && trackCapabilities.height?.max\n ? height >= trackCapabilities?.height?.min && height <= trackCapabilities?.height?.max\n : false;\n\n if ('width' in trackSettings && 'height' in trackSettings && widthInAllowedRange && heightInAllowedRange) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n }\n }\n\n if (name === 'pan' && oldValue !== newValue && 'pan' in this.#supportedConstraints) {\n const panInAllowedRange = 'pan' in trackCapabilities && trackCapabilities.pan?.min && trackCapabilities.pan?.max\n ? this.pan >= trackCapabilities.pan.min && this.pan <= trackCapabilities.pan.max\n : false;\n\n if ('pan' in trackSettings && typeof this.pan === 'number' && panInAllowedRange) {\n this.#applyPTZ('pan', this.pan);\n }\n }\n\n if (name === 'tilt' && oldValue !== newValue && 'tilt' in this.#supportedConstraints) {\n const tiltInAllowedRange = 'tilt' in trackCapabilities && trackCapabilities.tilt?.min && trackCapabilities.tilt?.max\n ? this.tilt >= trackCapabilities.tilt.min && this.tilt <= trackCapabilities.tilt.max\n : false;\n\n if ('tilt' in trackSettings && typeof this.tilt === 'number' && tiltInAllowedRange) {\n this.#applyPTZ('tilt', this.tilt);\n }\n }\n\n if (name === 'zoom' && oldValue !== newValue && 'zoom' in this.#supportedConstraints) {\n const zoomInAllowedRange = 'zoom' in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max\n ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max\n : false;\n\n if ('zoom' in trackSettings && typeof this.zoom === 'number' && zoomInAllowedRange) {\n this.#applyPTZ('zoom', this.zoom);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('autpoPlay');\n this.#upgradeProperty('noImage');\n this.#upgradeProperty('facingMode');\n this.#upgradeProperty('cameraResolution');\n this.#upgradeProperty('pan');\n this.#upgradeProperty('tilt');\n this.#upgradeProperty('zoom');\n this.#upgradeProperty('calculateFileSize');\n\n this.#canvasElement = this.shadowRoot?.querySelector('canvas') || null;\n this.#outputElement = this.shadowRoot?.getElementById('output') || null;\n this.#videoElement = this.shadowRoot?.querySelector('video') || null;\n this.#captureButtonSlot = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null;\n this.#captureButton = this.#getCaptureButton();\n this.#facingModeButtonSlot = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null;\n this.#facingModeButton = this.#getFacingModeButton();\n\n this.#videoElement?.addEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.addEventListener('slotchange', this.#onCaptureButtonSlotChange);\n this.#captureButton?.addEventListener('click', this.#onCapturePhotoButtonClick);\n this.#facingModeButtonSlot?.addEventListener('slotchange', this.#onFacingModeButtonSlotChange);\n this.#facingModeButton?.addEventListener('click', this.#onFacingModeButtonClick);\n\n if (!CapturePhoto.isSupported()) {\n return this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: 'NotSupportedError',\n message: 'Not supported'\n }\n }\n }));\n }\n\n if (this.autoPlay) {\n this.startVideoStream();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.stopVideoStream();\n this.#facingModeButton?.removeEventListener('click', this.#onFacingModeButtonClick);\n this.#captureButton?.removeEventListener('click', this.#onCapturePhotoButtonClick);\n this.#videoElement?.removeEventListener('canplay', this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.removeEventListener('slotchange', this.#onCaptureButtonSlotChange);\n this.#facingModeButtonSlot?.removeEventListener('slotchange', this.#onFacingModeButtonSlotChange);\n }\n\n /**\n * @type {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @attribute auto-play - Reflects the autoPlay attribute.\n */\n get autoPlay() {\n return this.hasAttribute('auto-play');\n }\n\n set autoPlay(value) {\n this.toggleAttribute('auto-play', !!value);\n }\n\n /**\n * @type {boolean} noImage - Whether or not to show the captured image.\n * @attribute no-image - Reflects the noImage attribute.\n */\n get noImage() {\n return this.hasAttribute('no-image');\n }\n\n set noImage(value) {\n this.toggleAttribute('no-image', !!value);\n }\n\n /**\n * @type {string} facingMode - The facing mode of the camera.\n * @attribute facing-mode - Reflects the facingMode attribute.\n */\n get facingMode() {\n return this.getAttribute('facing-mode') || 'user';\n }\n\n set facingMode(value) {\n this.setAttribute('facing-mode', value);\n }\n\n /**\n * @type {string} cameraResolution - The resolution of the camera.\n * @attribute camera-resolution - Reflects the cameraResolution attribute.\n */\n get cameraResolution() {\n return this.getAttribute('camera-resolution') || '';\n }\n\n set cameraResolution(value) {\n this.setAttribute('camera-resolution', value);\n }\n\n /**\n * @type {number} pan - The pan value of the camera.\n * @attribute pan - Reflects the pan attribute.\n */\n get pan() {\n return Number(this.getAttribute('pan')) || 0;\n }\n\n set pan(value) {\n this.setAttribute('pan', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} tilt - The tilt value of the camera.\n * @attribute tilt - Reflects the tilt attribute.\n */\n get tilt() {\n return Number(this.getAttribute('tilt')) || 0;\n }\n\n set tilt(value) {\n this.setAttribute('tilt', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} zoom - The zoom value of the camera.\n * @attribute zoom - Reflects the zoom attribute.\n */\n get zoom() {\n return Number(this.getAttribute('zoom')) || 1;\n }\n\n set zoom(value) {\n this.setAttribute('zoom', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} loading - Whether or not the video stream is loading.\n * @attribute loading - Reflects the loading attribute.\n */\n get loading() {\n return this.hasAttribute('loading');\n }\n\n /**\n * @type {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n * @attribute calculate-file-size - Reflects the calculateFileSize attribute.\n */\n get calculateFileSize() {\n return this.hasAttribute('calculate-file-size');\n }\n\n set calculateFileSize(value) {\n this.toggleAttribute('calculate-file-size', !!value);\n }\n\n /**\n * Handles the click event of the facing mode button.\n *\n * @param {*} evt - The click event.\n */\n #onFacingModeButtonClick = evt => {\n evt.preventDefault();\n\n if (this.loading) {\n return;\n }\n\n this.facingMode = this.facingMode === 'user' || !this.facingMode ? 'environment' : 'user';\n };\n\n /**\n * Handles the click event of the capture button.\n *\n * @param {*} evt - The click event.\n */\n #onCapturePhotoButtonClick = evt => {\n evt.preventDefault();\n this.capture();\n };\n\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {*} evt - The loadedmetadata event.\n */\n #onVideoLoadedMetaData = evt => {\n const video = evt.target;\n\n video.play().then(() => {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: { video }\n }));\n }).catch(/** @param {Error} error */error => {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }).finally(() => {\n this.removeAttribute('loading');\n });\n };\n\n /**\n * Removes all child nodes from the output element.\n */\n #emptyOutputElement() {\n if (!this.#outputElement) {\n return;\n }\n\n Array.from(this.#outputElement.childNodes).forEach(node => node.remove());\n }\n\n /**\n * Applies the pan, tilt or zoom constraint.\n *\n * @param {'pan' | 'tilt' | 'zoom'} constraintName - The name of the constraint.\n * @param {number} constraintValue - The value of the constraint.\n */\n #applyPTZ(constraintName, constraintValue) {\n if (!this.#stream || !constraintName || !constraintValue) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n /** @type {ExtendedMediaTrackCapabilities} */\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n if (constraintName in trackSettings) {\n track.applyConstraints({\n advanced: [{\n [constraintName]: clamp(Number(constraintValue), trackCapabilities[constraintName]?.min || 1, trackCapabilities[constraintName]?.max || 1)\n }]\n });\n }\n }\n\n /**\n * Handles the slotchange event of the capture button slot.\n *\n * @param {*} evt - The slotchange event.\n */\n #onCaptureButtonSlotChange = evt => {\n if (evt.target?.name === 'capture-button') {\n this.#captureButton?.removeEventListener('click', this.#onCapturePhotoButtonClick);\n this.#captureButton = this.#getCaptureButton();\n\n if (this.#captureButton) {\n this.#captureButton.addEventListener('click', this.#onCapturePhotoButtonClick);\n\n if (this.#captureButton.nodeName !== 'BUTTON' && !this.#captureButton.hasAttribute('role')) {\n this.#captureButton.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Handles the slotchange event of the facing mode button slot.\n *\n * @param {*} evt - The slotchange event.\n */\n #onFacingModeButtonSlotChange = evt => {\n if (evt.target?.name === 'facing-mode-button') {\n this.#facingModeButton?.removeEventListener('click', this.#onFacingModeButtonClick);\n this.#facingModeButton = this.#getFacingModeButton();\n\n if (this.#facingModeButton) {\n this.#facingModeButton.addEventListener('click', this.#onFacingModeButtonClick);\n\n if (this.#facingModeButton.nodeName !== 'BUTTON' && !this.#facingModeButton.hasAttribute('role')) {\n this.#facingModeButton.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the facing mode button.\n *\n * @returns {Nullable}\n */\n #getFacingModeButton() {\n if (!this.#facingModeButtonSlot) {\n return null;\n }\n\n return this.#facingModeButtonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'facing-mode-button';\n }) || null;\n }\n\n /**\n * Returns the capture button.\n *\n * @returns {Nullable}\n */\n #getCaptureButton() {\n if (!this.#captureButtonSlot) {\n return null;\n }\n\n return this.#captureButtonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'capture-button';\n }) || null;\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'autpoPlay' | 'noImage' | 'facingMode' | 'cameraResolution' | 'pan' | 'tilt' | 'zoom' | 'calculateFileSize'} prop\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Starts the video stream.\n *\n * @returns Promise\n */\n async startVideoStream() {\n if (!CapturePhoto.isSupported() || this.#stream) {\n return;\n }\n\n this.setAttribute('loading', '');\n\n /** @type {ExtendedMediaTrackConstraints} */\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || 'user'\n },\n pan: true,\n tilt: true,\n zoom: true\n },\n audio: false\n };\n\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n\n if (this.#videoElement) {\n this.#videoElement.srcObject = this.#stream;\n }\n\n this.#applyPTZ('pan', this.pan);\n this.#applyPTZ('tilt', this.tilt);\n this.#applyPTZ('zoom', this.zoom);\n\n const trackSettings = this.getTrackSettings();\n\n if ('facingMode' in trackSettings && this.#facingModeButtonSlot) {\n this.#facingModeButtonSlot.hidden = false;\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n } finally {\n this.removeAttribute('loading');\n }\n }\n\n /**\n * Stops the video stream.\n */\n stopVideoStream() {\n if (!this.#videoElement || !this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n\n /**\n * Captures a photo using the element's properties.\n *\n * @returns Promise\n */\n async capture() {\n if (this.loading || !this.#canvasElement || !this.#videoElement) {\n return;\n }\n\n try {\n const ctx = this.#canvasElement.getContext('2d');\n const width = this.#videoElement.videoWidth;\n const height = this.#videoElement.videoHeight;\n this.#canvasElement.width = width;\n this.#canvasElement.height = height;\n ctx?.drawImage(this.#videoElement, 0, 0, width, height);\n const dataURI = this.#canvasElement.toDataURL('image/png');\n\n if (typeof dataURI === 'string' && dataURI.includes('data:image')) {\n if (!this.noImage) {\n const image = new Image();\n image.src = dataURI;\n image.width = width;\n image.height = height;\n image.setAttribute('part', 'output-image');\n this.#emptyOutputElement();\n this.#outputElement?.appendChild(image);\n }\n\n /** @type {{ dataURI: string, width: number, height: number, size?: number }} */\n const eventDetail = { dataURI, width, height };\n\n if (this.calculateFileSize) {\n try {\n const file = await fetch(dataURI);\n const blob = await file.blob();\n const size = blob.size;\n\n if (size) {\n eventDetail.size = size;\n }\n } catch (err) {\n // Fail silently...\n }\n }\n\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:success`, {\n bubbles: true,\n composed: true,\n detail: eventDetail\n }));\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n }\n\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */\n getSupportedConstraints() {\n if (!CapturePhoto.isSupported()) {\n return {};\n }\n\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */\n getTrackCapabilities() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getCapabilities === 'function') {\n return track.getCapabilities() || {};\n }\n\n return {};\n }\n\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */\n getTrackSettings() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getSettings === 'function') {\n return track.getSettings() || {};\n }\n\n return {};\n }\n\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */\n static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='capture-photo'] - The name of the custom element.\n * @example\n *\n * CapturePhoto.defineCustomElement('my-capture-photo');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, CapturePhoto);\n }\n }\n}\n\nexport { CapturePhoto };\n","// @ts-check\n\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */\nexport const clamp = (value, lower, upper) => {\n if (Number.isNaN(lower)) {\n lower = 0;\n }\n\n if (Number.isNaN(upper)) {\n upper = 0;\n }\n\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n","Object.defineProperty({},\"ModalElement\",{get:function(){return t},set:void 0,enumerable:!0,configurable:!0});let e=document.createElement(\"template\");e.innerHTML=/* html */`\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */class t extends HTMLElement{/** @type {Nullable} */#e=null;/** @type {Nullable} */#t=null;/** @type {ReturnType | undefined} */#o=void 0;constructor(){if(super(),!this.shadowRoot){let t=this.attachShadow({mode:\"open\"});t.appendChild(e.content.cloneNode(!0))}this.shadowRoot&&(this.#e=this.shadowRoot.querySelector(\"dialog\"),this.#t=this.shadowRoot.querySelector('slot[name=\"footer\"]'))}static get observedAttributes(){return[\"open\",\"no-header\",\"no-animations\",\"no-close-button\"]}/**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */attributeChangedCallback(e,t,o){if(null!==this.#e){if(\"open\"===e&&t!==o&&(this.open?(this.#e.showModal(),document.body&&(document.body.style.overflowY=\"hidden\"),this.dispatchEvent(new CustomEvent(\"me-open\",{bubbles:!0,composed:!0,detail:{element:this}}))):this.#e.close()),\"no-header\"===e&&t!==o){/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__header\");null!==e&&(e.hidden=this.noHeader)}if(\"no-animations\"===e&&t!==o&&this.#e.classList.toggle(\"dialog--no-animations\",this.noAnimations),\"no-close-button\"===e&&t!==o){/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__close\");null!==e&&(e.hidden=this.noCloseButton)}}}/**\n * Lifecycle method that is called when the element is added to the DOM.\n */connectedCallback(){this.#i(\"open\"),this.#i(\"staticBackdrop\"),this.#i(\"noHeader\"),this.#i(\"noAnimations\"),this.#i(\"noCloseButton\"),this.#i(\"fullscreen\"),this.#e?.addEventListener(\"click\",this.#a),this.#e?.addEventListener(\"close\",this.#l),this.#e?.addEventListener(\"cancel\",this.#s),this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\",this.#n),this.#t?.addEventListener(\"slotchange\",this.#r)}/**\n * Lifecycle method that is called when the element is removed from the DOM.\n */disconnectedCallback(){this.#o&&clearTimeout(this.#o),this.#e?.addEventListener(\"click\",this.#a),this.#e?.removeEventListener(\"close\",this.#l),this.#e?.removeEventListener(\"cancel\",this.#s),this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\",this.#n),this.#t?.removeEventListener(\"slotchange\",this.#r)}/**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */get open(){return this.hasAttribute(\"open\")}set open(e){e?this.setAttribute(\"open\",\"\"):this.removeAttribute(\"open\")}/**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */get staticBackdrop(){return this.hasAttribute(\"static-backdrop\")}set staticBackdrop(e){e?this.setAttribute(\"static-backdrop\",\"\"):this.removeAttribute(\"static-backdrop\")}/**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */get noHeader(){return this.hasAttribute(\"no-header\")}set noHeader(e){e?this.setAttribute(\"no-header\",\"\"):this.removeAttribute(\"no-header\")}/**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */get noAnimations(){return this.hasAttribute(\"no-animations\")}set noAnimations(e){e?this.setAttribute(\"no-animations\",\"\"):this.removeAttribute(\"no-animations\")}/**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */get noCloseButton(){return this.hasAttribute(\"no-close-button\")}set noCloseButton(e){e?this.setAttribute(\"no-close-button\",\"\"):this.removeAttribute(\"no-close-button\")}/**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */get fullscreen(){return this.hasAttribute(\"fullscreen\")}set fullscreen(e){e?this.setAttribute(\"fullscreen\",\"\"):this.removeAttribute(\"fullscreen\")}/**\n * Applies a pulse effect on the dialog.\n */#d(){this.#o||(this.#e?.classList.add(\"dialog--pulse\"),this.#o=setTimeout(()=>{this.#e?.classList.remove(\"dialog--pulse\"),clearTimeout(this.#o),this.#o=void 0},300))}/**\n * Handles the close event of the dialog.\n */#l=()=>{// This is needed because the dialog element does not reset\n// the open property when the dialog is closed by the user.\nthis.open=!1,document.body&&(document.body.style.overflowY=\"\"),this.dispatchEvent(new CustomEvent(\"me-close\",{bubbles:!0,composed:!0,detail:{element:this}}))};/**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */#s=e=>{let t=this.#c(\"escape-key\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),this.noAnimations||this.#d())};/**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */#n=e=>{let t=this.#c(\"close-button\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),this.noAnimations||this.#d())};/**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */#a=e=>{if(e.target!==e.currentTarget)return;let t=this.#c(\"backdrop-click\");if(this.dispatchEvent(t),t.defaultPrevented||this.staticBackdrop){this.noAnimations||this.#d();return}this.#e?.close()};/**\n * Handles the slotchange event of the footer slot.\n */#r=()=>{if(null===this.#e)return;/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__footer\");if(null===e)return;let t=this.#t?.assignedNodes(),o=!!t&&t.length>0;e.hidden=!o};/**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */#c(e){return new CustomEvent(\"me-request-close\",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e,element:this}})}/**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */#i(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}/**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */show(){this.open||(this.open=!0)}/**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */hide(){this.open&&(this.open=!1)}/**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */static defineCustomElement(e=\"modal-element\"){\"undefined\"==typeof window||window.customElements.get(e)||window.customElements.define(e,t)}}t.defineCustomElement();export{t as ModalElement};//# sourceMappingURL=modal-element-defined.js.map\n\n//# sourceMappingURL=modal-element-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $180b6dcf923bafc7$exports = {};\n\n$parcel$export($180b6dcf923bafc7$exports, \"ModalElement\", function () { return $180b6dcf923bafc7$export$32589115725b904b; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ const $180b6dcf923bafc7$var$PULSE_ANIMATION_DURATION = 300;\nconst $180b6dcf923bafc7$var$template = document.createElement(\"template\");\n$180b6dcf923bafc7$var$template.innerHTML = /* html */ `\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;\n/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */ class $180b6dcf923bafc7$export$32589115725b904b extends HTMLElement {\n /** @type {Nullable} */ #dialogEl = null;\n /** @type {Nullable} */ #footerSlotEl = null;\n /** @type {ReturnType | undefined} */ #pulseAnimationTimeout = void 0;\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($180b6dcf923bafc7$var$template.content.cloneNode(true));\n }\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector(\"dialog\");\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n }\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) return;\n if (name === \"open\" && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n if (document.body) document.body.style.overflowY = \"hidden\";\n this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: true,\n composed: true,\n detail: {\n element: this\n }\n }));\n } else this.#dialogEl.close();\n }\n if (name === \"no-header\" && oldValue !== newValue) {\n /** @type {Nullable} */ const headerEl = this.#dialogEl.querySelector(\".dialog__header\");\n if (headerEl !== null) headerEl.hidden = this.noHeader;\n }\n if (name === \"no-animations\" && oldValue !== newValue) this.#dialogEl.classList.toggle(\"dialog--no-animations\", this.noAnimations);\n if (name === \"no-close-button\" && oldValue !== newValue) {\n /** @type {Nullable} */ const closeBtnEl = this.#dialogEl.querySelector(\".dialog__close\");\n if (closeBtnEl !== null) closeBtnEl.hidden = this.noCloseButton;\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"open\");\n this.#upgradeProperty(\"staticBackdrop\");\n this.#upgradeProperty(\"noHeader\");\n this.#upgradeProperty(\"noAnimations\");\n this.#upgradeProperty(\"noCloseButton\");\n this.#upgradeProperty(\"fullscreen\");\n this.#dialogEl?.addEventListener(\"click\", this.#handleDialogClick);\n this.#dialogEl?.addEventListener(\"close\", this.#handleDialogClose);\n this.#dialogEl?.addEventListener(\"cancel\", this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener(\"slotchange\", this.#handleFooterSlotChange);\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener(\"click\", this.#handleDialogClick);\n this.#dialogEl?.removeEventListener(\"close\", this.#handleDialogClose);\n this.#dialogEl?.removeEventListener(\"cancel\", this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener(\"slotchange\", this.#handleFooterSlotChange);\n }\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */ get open() {\n return this.hasAttribute(\"open\");\n }\n set open(value) {\n if (value) this.setAttribute(\"open\", \"\");\n else this.removeAttribute(\"open\");\n }\n /**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */ get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(value) {\n if (value) this.setAttribute(\"static-backdrop\", \"\");\n else this.removeAttribute(\"static-backdrop\");\n }\n /**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */ get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(value) {\n if (value) this.setAttribute(\"no-header\", \"\");\n else this.removeAttribute(\"no-header\");\n }\n /**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */ get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(value) {\n if (value) this.setAttribute(\"no-animations\", \"\");\n else this.removeAttribute(\"no-animations\");\n }\n /**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */ get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(value) {\n if (value) this.setAttribute(\"no-close-button\", \"\");\n else this.removeAttribute(\"no-close-button\");\n }\n /**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */ get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(value) {\n if (value) this.setAttribute(\"fullscreen\", \"\");\n else this.removeAttribute(\"fullscreen\");\n }\n /**\n * Applies a pulse effect on the dialog.\n */ #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) return;\n this.#dialogEl?.classList.add(\"dialog--pulse\");\n this.#pulseAnimationTimeout = setTimeout(()=>{\n this.#dialogEl?.classList.remove(\"dialog--pulse\");\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, $180b6dcf923bafc7$var$PULSE_ANIMATION_DURATION);\n }\n /**\n * Handles the close event of the dialog.\n */ #handleDialogClose = ()=>{\n // This is needed because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n if (document.body) document.body.style.overflowY = \"\";\n this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: true,\n composed: true,\n detail: {\n element: this\n }\n }));\n };\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */ #handleDialogCancel = (evt)=>{\n const requestCloseEvent = this.#createRequestCloseEvent(\"escape-key\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */ #handleCloseButtonClick = (evt)=>{\n const requestCloseEvent = this.#createRequestCloseEvent(\"close-button\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */ #handleDialogClick = (evt)=>{\n if (evt.target !== evt.currentTarget) return;\n const requestCloseEvent = this.#createRequestCloseEvent(\"backdrop-click\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n return;\n }\n this.#dialogEl?.close();\n };\n /**\n * Handles the slotchange event of the footer slot.\n */ #handleFooterSlotChange = ()=>{\n if (this.#dialogEl === null) return;\n /** @type {Nullable} */ const footerEl = this.#dialogEl.querySelector(\".dialog__footer\");\n if (footerEl === null) return;\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n footerEl.hidden = !hasFooterSlotNodes;\n };\n /**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */ #createRequestCloseEvent(reason) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason: reason,\n element: this\n }\n });\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */ show() {\n if (this.open) return;\n this.open = true;\n }\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */ hide() {\n if (!this.open) return;\n this.open = false;\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */ static defineCustomElement(elementName = \"modal-element\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $180b6dcf923bafc7$export$32589115725b904b);\n }\n}\n\n\n(0, $180b6dcf923bafc7$export$32589115725b904b).defineCustomElement();\n\n\nexport {$180b6dcf923bafc7$export$32589115725b904b as ModalElement};\n//# sourceMappingURL=modal-element-defined.js.map\n","import { ModalElement } from './modal-element.js';\n\nModalElement.defineCustomElement();\n\nexport { ModalElement };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst PULSE_ANIMATION_DURATION = 300;\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */`\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;\n\n/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */\nclass ModalElement extends HTMLElement {\n /** @type {Nullable} */\n #dialogEl = null;\n\n /** @type {Nullable} */\n #footerSlotEl = null;\n\n /** @type {ReturnType | undefined} */\n #pulseAnimationTimeout = void 0;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector('dialog');\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n }\n }\n\n static get observedAttributes() {\n return ['open', 'no-header', 'no-animations', 'no-close-button'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) {\n return;\n }\n\n if (name === 'open' && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n\n if (document.body) {\n document.body.style.overflowY = 'hidden';\n }\n\n this.dispatchEvent(new CustomEvent('me-open', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n }));\n } else {\n this.#dialogEl.close();\n }\n }\n\n if (name === 'no-header' && oldValue !== newValue) {\n /** @type {Nullable} */\n const headerEl = this.#dialogEl.querySelector('.dialog__header');\n\n if (headerEl !== null) {\n headerEl.hidden = this.noHeader;\n }\n }\n\n if (name === 'no-animations' && oldValue !== newValue) {\n this.#dialogEl.classList.toggle('dialog--no-animations', this.noAnimations);\n }\n\n if (name === 'no-close-button' && oldValue !== newValue) {\n /** @type {Nullable} */\n const closeBtnEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeBtnEl !== null) {\n closeBtnEl.hidden = this.noCloseButton;\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('open');\n this.#upgradeProperty('staticBackdrop');\n this.#upgradeProperty('noHeader');\n this.#upgradeProperty('noAnimations');\n this.#upgradeProperty('noCloseButton');\n this.#upgradeProperty('fullscreen');\n\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.addEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.addEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener('slotchange', this.#handleFooterSlotChange);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.removeEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.removeEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener('slotchange', this.#handleFooterSlotChange);\n }\n\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */\n get open() {\n return this.hasAttribute('open');\n }\n\n set open(value) {\n if (value) {\n this.setAttribute('open', '');\n } else {\n this.removeAttribute('open');\n }\n }\n\n /**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */\n get staticBackdrop() {\n return this.hasAttribute('static-backdrop');\n }\n\n set staticBackdrop(value) {\n if (value) {\n this.setAttribute('static-backdrop', '');\n } else {\n this.removeAttribute('static-backdrop');\n }\n }\n\n /**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */\n get noHeader() {\n return this.hasAttribute('no-header');\n }\n\n set noHeader(value) {\n if (value) {\n this.setAttribute('no-header', '');\n } else {\n this.removeAttribute('no-header');\n }\n }\n\n /**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */\n get noAnimations() {\n return this.hasAttribute('no-animations');\n }\n\n set noAnimations(value) {\n if (value) {\n this.setAttribute('no-animations', '');\n } else {\n this.removeAttribute('no-animations');\n }\n }\n\n /**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */\n get noCloseButton() {\n return this.hasAttribute('no-close-button');\n }\n\n set noCloseButton(value) {\n if (value) {\n this.setAttribute('no-close-button', '');\n } else {\n this.removeAttribute('no-close-button');\n }\n }\n\n /**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */\n get fullscreen() {\n return this.hasAttribute('fullscreen');\n }\n\n set fullscreen(value) {\n if (value) {\n this.setAttribute('fullscreen', '');\n } else {\n this.removeAttribute('fullscreen');\n }\n }\n\n /**\n * Applies a pulse effect on the dialog.\n */\n #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) {\n return;\n }\n\n this.#dialogEl?.classList.add('dialog--pulse');\n\n this.#pulseAnimationTimeout = setTimeout(() => {\n this.#dialogEl?.classList.remove('dialog--pulse');\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, PULSE_ANIMATION_DURATION);\n }\n\n /**\n * Handles the close event of the dialog.\n */\n #handleDialogClose = () => {\n // This is needed because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n\n if (document.body) {\n document.body.style.overflowY = '';\n }\n\n this.dispatchEvent(new CustomEvent('me-close', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n }));\n };\n\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */\n #handleDialogCancel = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('escape-key');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('close-button');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleDialogClick = evt => {\n if (evt.target !== evt.currentTarget) {\n return;\n }\n\n const requestCloseEvent = this.#createRequestCloseEvent('backdrop-click');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n return;\n }\n\n this.#dialogEl?.close();\n };\n\n /**\n * Handles the slotchange event of the footer slot.\n */\n #handleFooterSlotChange = () => {\n if (this.#dialogEl === null) {\n return;\n }\n\n /** @type {Nullable} */\n const footerEl = this.#dialogEl.querySelector('.dialog__footer');\n\n if (footerEl === null) {\n return;\n }\n\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n\n footerEl.hidden = !hasFooterSlotNodes;\n };\n\n /**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */\n #createRequestCloseEvent(reason) {\n return new CustomEvent('me-request-close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason,\n element: this\n }\n });\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */\n show() {\n if (this.open) {\n return;\n }\n\n this.open = true;\n }\n\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */\n hide() {\n if (!this.open) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */\n static defineCustomElement(elementName = 'modal-element') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ModalElement);\n }\n }\n}\n\nexport { ModalElement };\n","Object.defineProperty({},\"FilesDropzone\",{get:function(){return m},set:void 0,enumerable:!0,configurable:!0});let e=new Map([[\"aac\",\"audio/aac\"],[\"abw\",\"application/x-abiword\"],[\"arc\",\"application/x-freearc\"],[\"avif\",\"image/avif\"],[\"avi\",\"video/x-msvideo\"],[\"azw\",\"application/vnd.amazon.ebook\"],[\"bin\",\"application/octet-stream\"],[\"bmp\",\"image/bmp\"],[\"bz\",\"application/x-bzip\"],[\"bz2\",\"application/x-bzip2\"],[\"cda\",\"application/x-cdf\"],[\"csh\",\"application/x-csh\"],[\"css\",\"text/css\"],[\"csv\",\"text/csv\"],[\"doc\",\"application/msword\"],[\"docx\",\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"],[\"eot\",\"application/vnd.ms-fontobject\"],[\"epub\",\"application/epub+zip\"],[\"gz\",\"application/gzip\"],[\"gif\",\"image/gif\"],[\"heic\",\"image/heic\"],[\"heif\",\"image/heif\"],[\"htm\",\"text/html\"],[\"html\",\"text/html\"],[\"ico\",\"image/vnd.microsoft.icon\"],[\"ics\",\"text/calendar\"],[\"jar\",\"application/java-archive\"],[\"jpeg\",\"image/jpeg\"],[\"jpg\",\"image/jpeg\"],[\"jxl\",\"image/jxl\"],[\"js\",\"text/javascript\"],[\"json\",\"application/json\"],[\"jsonld\",\"application/ld+json\"],[\"markdown\",\"text/markdown\"],[\"md\",\"text/markdown\"],[\"mid\",\"audio/midi\"],[\"midi\",\"audio/midi\"],[\"mjs\",\"text/javascript\"],[\"mp3\",\"audio/mpeg\"],[\"mp4\",\"video/mp4\"],[\"mpeg\",\"video/mpeg\"],[\"mpkg\",\"application/vnd.apple.installer+xml\"],[\"odp\",\"application/vnd.oasis.opendocument.presentation\"],[\"ods\",\"application/vnd.oasis.opendocument.spreadsheet\"],[\"odt\",\"application/vnd.oasis.opendocument.text\"],[\"oga\",\"audio/ogg\"],[\"ogv\",\"video/ogg\"],[\"ogx\",\"application/ogg\"],[\"opus\",\"audio/opus\"],[\"otf\",\"font/otf\"],[\"png\",\"image/png\"],[\"pdf\",\"application/pdf\"],[\"php\",\"application/x-httpd-php\"],[\"ppt\",\"application/vnd.ms-powerpoint\"],[\"pptx\",\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"],[\"rar\",\"application/vnd.rar\"],[\"rtf\",\"application/rtf\"],[\"sh\",\"application/x-sh\"],[\"svg\",\"image/svg+xml\"],[\"swf\",\"application/x-shockwave-flash\"],[\"tar\",\"application/x-tar\"],[\"tif\",\"image/tiff\"],[\"tiff\",\"image/tiff\"],[\"ts\",\"video/mp2t\"],[\"ttf\",\"font/ttf\"],[\"txt\",\"text/plain\"],[\"vsd\",\"application/vnd.visio\"],[\"wav\",\"audio/wav\"],[\"weba\",\"audio/webm\"],[\"webm\",\"video/webm\"],[\"webp\",\"image/webp\"],[\"woff\",\"font/woff\"],[\"woff2\",\"font/woff2\"],[\"xhtml\",\"application/xhtml+xml\"],[\"xls\",\"application/vnd.ms-excel\"],[\"xlsx\",\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"],[\"xml\",\"application/xml\"],[\"xul\",\"application/vnd.mozilla.xul+xml\"],[\"zip\",\"application/zip\"],[\"7z\",\"application/x-7z-compressed\"],[\"mkv\",\"video/x-matroska\"],[\"mov\",\"video/quicktime\"],[\"msg\",\"application/vnd.ms-outlook\"]]),t=[\".DS_Store\",\"Thumbs.db\"],o=t=>{let{name:o}=t;if(o&&-1!==o.lastIndexOf(\".\")&&!t.type){let i=(o.split(\".\").pop()||\"\").toLowerCase(),r=e.get(i);r&&Object.defineProperty(t,\"type\",{value:r,writable:!1,configurable:!1,enumerable:!0})}return t},i=(e,t)=>{let i=o(e);if(\"string\"!=typeof i.path){let{webkitRelativePath:o}=e;Object.defineProperty(i,\"path\",{value:\"string\"==typeof t?t:o||e.name,writable:!1,configurable:!1,enumerable:!0})}return i},r=async e=>await new Promise((t,o)=>{e.readEntries(t,o)}),a=async e=>{let t=[],o=await r(e);for(;o.length>0;)t.push(...o),o=await r(e);return t},n=e=>new Promise((t,o)=>{e.file(o=>t(i(o,e.fullPath)),o)}),s=async e=>{let o=[],i=[];for(let t of e){if(\"file\"!==t.kind)continue;let e=t.getAsEntry?t.getAsEntry():t.webkitGetAsEntry();i.push(e)}for(;i.length>0;){let e=i.shift();if(e){if(e.isFile){let i=await n(e);-1===t.indexOf(i.name)&&o.push(i)}else e.isDirectory&&i.push(...await a(e.createReader()))}}return o},d=async e=>{let o=[];for(let r of e)-1===t.indexOf(r.name)&&o.push(i(r));return o},l=async e=>e.dataTransfer?e.dataTransfer.items?await s(e.dataTransfer.items):await d(e.dataTransfer.files):await d(e.target.files),p=\"files-dropzone\",c=\"TOO_MANY_FILES\",h=document.createElement(\"template\"),u=`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;h.innerHTML=`\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;class m extends HTMLElement{#e=null;#t=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(h.content.cloneNode(!0)),this.shadowRoot&&(this.#e=this.shadowRoot.getElementById(\"fileInput\"),this.#t=this.shadowRoot.getElementById(\"dropzoneEl\"))}static get observedAttributes(){return[\"accept\",\"disabled\",\"multiple\",\"no-keyboard\"]}attributeChangedCallback(e,t,o){\"accept\"===e&&t!==o&&this.#e&&(this.#e.accept=this.accept),\"disabled\"===e&&t!==o&&this.#e&&(this.#e.disabled=this.disabled,this.disabled?this.#t?.removeAttribute(\"tabindex\"):this.#t?.setAttribute(\"tabindex\",\"0\")),\"multiple\"===e&&t!==o&&this.#e&&(this.#e.multiple=this.multiple),\"no-keyboard\"===e&&t!==o&&this.#t&&(this.noKeyboard?this.#t.removeAttribute(\"tabindex\"):this.#t.setAttribute(\"tabindex\",\"0\"))}connectedCallback(){this.#o(\"accept\"),this.#o(\"disabled\"),this.#o(\"maxFiles\"),this.#o(\"maxSize\"),this.#o(\"minSize\"),this.#o(\"multiple\"),this.#o(\"noClick\"),this.#o(\"noDrag\"),this.#o(\"noKeyboard\"),this.#o(\"autoFocus\"),this.#o(\"noStyle\"),this.#e?.addEventListener(\"change\",this.#i),this.#t?.addEventListener(\"dragenter\",this.#r),this.#t?.addEventListener(\"dragover\",this.#a),this.#t?.addEventListener(\"dragleave\",this.#n),this.#t?.addEventListener(\"drop\",this.#s),this.#t?.addEventListener(\"click\",this.#d),this.#t?.addEventListener(\"keyup\",this.#l),this.autoFocus&&this.#t?.focus()}disconnectedCallback(){this.#e?.removeEventListener(\"change\",this.#i),this.#t?.removeEventListener(\"dragenter\",this.#r),this.#t?.removeEventListener(\"dragover\",this.#a),this.#t?.removeEventListener(\"dragleave\",this.#n),this.#t?.removeEventListener(\"drop\",this.#s),this.#t?.removeEventListener(\"click\",this.#d),this.#t?.removeEventListener(\"keyup\",this.#l)}get accept(){return this.getAttribute(\"accept\")||\"\"}set accept(e){this.setAttribute(\"accept\",null!=e?e.toString():e)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}get maxFiles(){let e=Number(this.getAttribute(\"max-files\"))||0;return e<=0?1/0:Math.floor(Math.abs(e))}set maxFiles(e){this.setAttribute(\"max-files\",null!=e?e.toString():e)}get maxSize(){let e=this.getAttribute(\"max-size\");if(null===e)return 1/0;let t=Number(e);return Number.isNaN(t)?1/0:t}set maxSize(e){this.setAttribute(\"max-size\",null!=e?e.toString():e)}get minSize(){let e=this.getAttribute(\"min-size\");if(null===e)return 0;let t=Number(e);return Number.isNaN(t)?0:t}set minSize(e){this.setAttribute(\"min-size\",null!=e?e.toString():e)}get multiple(){return this.hasAttribute(\"multiple\")}set multiple(e){this.toggleAttribute(\"multiple\",!!e)}get noClick(){return this.hasAttribute(\"no-click\")}set noClick(e){this.toggleAttribute(\"no-click\",!!e)}get noDrag(){return this.hasAttribute(\"no-drag\")}set noDrag(e){this.toggleAttribute(\"no-drag\",!!e)}get noKeyboard(){return this.hasAttribute(\"no-keyboard\")}set noKeyboard(e){this.toggleAttribute(\"no-keyboard\",!!e)}get autoFocus(){return this.hasAttribute(\"auto-focus\")}set autoFocus(e){this.toggleAttribute(\"auto-focus\",!!e)}get noStyle(){return this.hasAttribute(\"no-style\")}set noStyle(e){this.toggleAttribute(\"no-style\",!!e)}#i=async e=>{try{this.#p(await l(e))}catch(e){this.dispatchEvent(new CustomEvent(`${p}-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}};#r=()=>{this.disabled||this.noDrag||this.dispatchEvent(new Event(`${p}-dragenter`,{bubbles:!0,composed:!0}))};#a=e=>{if(e.preventDefault(),this.disabled||this.noDrag){e.dataTransfer.dropEffect=\"none\";return}e.dataTransfer.dropEffect=\"copy\",this.#t&&(this.#t.classList.add(\"dropzone--dragover\"),this.#t.part.add(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${p}-dragover`,{bubbles:!0,composed:!0}))};#n=()=>{this.disabled||this.noDrag||(this.#t&&(this.#t.classList.remove(\"dropzone--dragover\"),this.#t.part.remove(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${p}-dragleave`,{bubbles:!0,composed:!0})))};#s=async e=>{if(!this.disabled&&!this.noDrag){e.preventDefault(),this.#t&&(this.#t.classList.remove(\"dropzone--dragover\"),this.#t.part.remove(\"dropzone--dragover\"));try{this.#p(await l(e))}catch(e){this.dispatchEvent(new CustomEvent(`${p}-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}}};#d=()=>{this.disabled||this.noClick||this.#e?.click()};#l=e=>{this.disabled||this.noKeyboard||\" \"!==e.key&&\"Enter\"!==e.key||this.#e?.click()};#p(e){if(!Array.isArray(e)||!e.length)return;let t=[],o=[],i=e.length;if(!this.multiple&&i>1)for(let t of e)o.push({file:t,errors:[{code:c,message:\"Too many files selected. Only 1 file is allowed.\"}]});else if(this.multiple&&i>this.maxFiles)for(let t of e)o.push({file:t,errors:[{code:c,message:`Too many files selected. Only ${this.maxFiles} ${this.maxFiles>1?\"files are\":\"file is\"} allowed.`}]});else for(let i of e){let e=function(e,t=\"\"){if(!t)return!0;let o=[...new Set(t.split(\",\").map(e=>e.trim()).filter(Boolean))],i=e.type,r=i.replace(/\\/.*$/,\"\");for(let t of o)if(\".\"===t.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(t.toLowerCase(),e.name.length-t.length))return!0}else if(/\\/\\*$/.test(t)){if(r===t.replace(/\\/.*$/,\"\"))return!0}else if(i===t)return!0;return!1}(i,this.accept),r=i.size>this.maxSize,a=i.size0&&this.dispatchEvent(new CustomEvent(`${p}-drop-accepted`,{bubbles:!0,composed:!0,detail:{acceptedFiles:t}})),o.length>0&&this.dispatchEvent(new CustomEvent(`${p}-drop-rejected`,{bubbles:!0,composed:!0,detail:{rejectedFiles:o}})),this.#e&&(this.#e.value=this.#e.defaultValue)}openFileDialog(){this.disabled||this.#e?.click()}#o(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}static defineCustomElement(e=p){\"undefined\"==typeof window||window.customElements.get(e)||window.customElements.define(e,m)}}m.defineCustomElement();export{m as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $862aa3736b0514bc$exports = {};\n\n$parcel$export($862aa3736b0514bc$exports, \"FilesDropzone\", function () { return $862aa3736b0514bc$export$6ccd1735166caad9; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ // @ts-check\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */ function $38f222170fd4d21a$export$7c47054fed488f80(file, acceptedTypeSpecifiers = \"\") {\n if (!acceptedTypeSpecifiers) return true;\n const acceptedMimeTypesList = [\n ...new Set(acceptedTypeSpecifiers.split(\",\").map((v)=>v.trim()).filter(Boolean))\n ];\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, \"\");\n for (const validType of acceptedMimeTypesList){\n if (validType.charAt(0) === \".\") {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) return true;\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, \"\")) return true;\n } else {\n if (fileMimeType === validType) return true;\n }\n }\n return false;\n}\n\n\n// @ts-check\n/**\n * A map of common file extensions and their associated MIME types.\n */ const $f31161edf38949e9$var$COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n // Others\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]);\nconst $f31161edf38949e9$var$FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n \".DS_Store\",\n \"Thumbs.db\" // Windows\n];\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */ const $f31161edf38949e9$var$toFileWithMimeType = (file)=>{\n const { name: name } = file;\n const hasExtension = name && name.lastIndexOf(\".\") !== -1;\n if (hasExtension && !file.type) {\n const extension = (name.split(\".\").pop() || \"\").toLowerCase();\n const type = $f31161edf38949e9$var$COMMON_MIME_TYPES.get(extension);\n if (type) Object.defineProperty(file, \"type\", {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return file;\n};\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */ const $f31161edf38949e9$var$toFileWithPath = (file, path)=>{\n const fileWithMimeType = $f31161edf38949e9$var$toFileWithMimeType(file);\n // @ts-ignore\n if (typeof fileWithMimeType.path !== \"string\") {\n const { webkitRelativePath: webkitRelativePath } = file;\n Object.defineProperty(fileWithMimeType, \"path\", {\n value: typeof path === \"string\" ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return fileWithMimeType;\n};\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */ const $f31161edf38949e9$var$readEntriesPromise = async (directoryReader)=>{\n return await new Promise((resolve, reject)=>{\n directoryReader.readEntries(resolve, reject);\n });\n};\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */ const $f31161edf38949e9$var$readAllDirectoryEntries = async (directoryReader)=>{\n const entries = [];\n let readEntries = await $f31161edf38949e9$var$readEntriesPromise(directoryReader);\n while(readEntries.length > 0){\n entries.push(...readEntries);\n readEntries = await $f31161edf38949e9$var$readEntriesPromise(directoryReader);\n }\n return entries;\n};\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */ const $f31161edf38949e9$var$getFileFromFileEntry = (fileEntry)=>{\n return new Promise((resolve, reject)=>{\n fileEntry.file((file)=>resolve($f31161edf38949e9$var$toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */ const $f31161edf38949e9$var$getFilesFromDataTransferItemList = async (dataTransferItemList)=>{\n const files = [];\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n for (const item of dataTransferItemList){\n if (item.kind !== \"file\") continue;\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n queue.push(entry);\n }\n while(queue.length > 0){\n const entry = queue.shift();\n if (!entry) continue;\n else if (entry.isFile) {\n const file = await $f31161edf38949e9$var$getFileFromFileEntry(entry);\n if ($f31161edf38949e9$var$FILES_TO_IGNORE.indexOf(file.name) === -1) files.push(file);\n } else if (entry.isDirectory) queue.push(...await $f31161edf38949e9$var$readAllDirectoryEntries(entry.createReader()));\n }\n return files;\n};\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */ const $f31161edf38949e9$var$getFilesFromFileList = async (fileList)=>{\n const files = [];\n for (const file of fileList)if ($f31161edf38949e9$var$FILES_TO_IGNORE.indexOf(file.name) === -1) files.push($f31161edf38949e9$var$toFileWithPath(file));\n return files;\n};\nconst $f31161edf38949e9$export$6d52664cd15c442 = async (evt)=>{\n if (evt.dataTransfer) return evt.dataTransfer.items ? await $f31161edf38949e9$var$getFilesFromDataTransferItemList(evt.dataTransfer.items) : await $f31161edf38949e9$var$getFilesFromFileList(evt.dataTransfer.files);\n return await $f31161edf38949e9$var$getFilesFromFileList(evt.target.files);\n};\n\n\nconst $862aa3736b0514bc$var$COMPONENT_NAME = \"files-dropzone\";\nconst $862aa3736b0514bc$var$TOO_MANY_FILES = \"TOO_MANY_FILES\";\nconst $862aa3736b0514bc$var$FILE_TOO_LARGE = \"FILE_TOO_LARGE\";\nconst $862aa3736b0514bc$var$FILE_TOO_SMALL = \"FILE_TOO_SMALL\";\nconst $862aa3736b0514bc$var$INVALID_MIME_TYPE = \"INVALID_MIME_TYPE\";\nconst $862aa3736b0514bc$var$template = document.createElement(\"template\");\nconst $862aa3736b0514bc$var$styles = /* css */ `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$862aa3736b0514bc$var$template.innerHTML = /* html */ `\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} noClick - Prevents the file dialog from opening when the dropzone is clicked.\n * @property {boolean} noDrag - Prevents the dropzone from reacting to drag events.\n * @property {boolean} noKeyboard - Prevents the dropzone from reacting to keyboard events.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} no-click - Reflects the noClick property.\n * @attribute {boolean} no-drag - Reflects the noDrag property.\n * @attribute {boolean} no-keyboard - Reflects the noKeyboard property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */ class $862aa3736b0514bc$export$6ccd1735166caad9 extends HTMLElement {\n /** @type {Nullable} */ #fileInput = null;\n /** @type {Nullable} */ #dropzoneEl = null;\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($862aa3736b0514bc$var$template.content.cloneNode(true));\n }\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */ this.shadowRoot.getElementById(\"fileInput\");\n this.#dropzoneEl = this.shadowRoot.getElementById(\"dropzoneEl\");\n }\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\",\n \"no-keyboard\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"accept\" && oldValue !== newValue && this.#fileInput) this.#fileInput.accept = this.accept;\n if (name === \"disabled\" && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n if (this.disabled) this.#dropzoneEl?.removeAttribute(\"tabindex\");\n else this.#dropzoneEl?.setAttribute(\"tabindex\", \"0\");\n }\n if (name === \"multiple\" && oldValue !== newValue && this.#fileInput) this.#fileInput.multiple = this.multiple;\n if (name === \"no-keyboard\" && oldValue !== newValue && this.#dropzoneEl) {\n if (this.noKeyboard) this.#dropzoneEl.removeAttribute(\"tabindex\");\n else this.#dropzoneEl.setAttribute(\"tabindex\", \"0\");\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"accept\");\n this.#upgradeProperty(\"disabled\");\n this.#upgradeProperty(\"maxFiles\");\n this.#upgradeProperty(\"maxSize\");\n this.#upgradeProperty(\"minSize\");\n this.#upgradeProperty(\"multiple\");\n this.#upgradeProperty(\"noClick\");\n this.#upgradeProperty(\"noDrag\");\n this.#upgradeProperty(\"noKeyboard\");\n this.#upgradeProperty(\"autoFocus\");\n this.#upgradeProperty(\"noStyle\");\n this.#fileInput?.addEventListener(\"change\", this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener(\"dragenter\", this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener(\"dragover\", this.#handleDragOver);\n this.#dropzoneEl?.addEventListener(\"dragleave\", this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener(\"drop\", this.#handleDrop);\n this.#dropzoneEl?.addEventListener(\"click\", this.#handleClick);\n this.#dropzoneEl?.addEventListener(\"keyup\", this.#handleKeyUp);\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#fileInput?.removeEventListener(\"change\", this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener(\"dragenter\", this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener(\"dragover\", this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener(\"dragleave\", this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener(\"drop\", this.#handleDrop);\n this.#dropzoneEl?.removeEventListener(\"click\", this.#handleClick);\n this.#dropzoneEl?.removeEventListener(\"keyup\", this.#handleKeyUp);\n }\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */ get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(value) {\n this.setAttribute(\"accept\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */ get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(value) {\n this.toggleAttribute(\"disabled\", !!value);\n }\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */ get maxFiles() {\n const num = Number(this.getAttribute(\"max-files\")) || 0;\n if (num <= 0) return Infinity;\n return Math.floor(Math.abs(num));\n }\n set maxFiles(value) {\n this.setAttribute(\"max-files\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */ get maxSize() {\n const value = this.getAttribute(\"max-size\");\n if (value === null) return Infinity;\n const num = Number(value);\n return Number.isNaN(num) ? Infinity : num;\n }\n set maxSize(value) {\n this.setAttribute(\"max-size\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */ get minSize() {\n const value = this.getAttribute(\"min-size\");\n if (value === null) return 0;\n const num = Number(value);\n return Number.isNaN(num) ? 0 : num;\n }\n set minSize(value) {\n this.setAttribute(\"min-size\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */ get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(value) {\n this.toggleAttribute(\"multiple\", !!value);\n }\n /**\n * @type {boolean} - Prevents the file dialog from opening when the dropzone is clicked.\n * @default false\n * @attribute no-click - Reflects the noClick property.\n */ get noClick() {\n return this.hasAttribute(\"no-click\");\n }\n set noClick(value) {\n this.toggleAttribute(\"no-click\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from reacting to drag events.\n * @default false\n * @attribute no-drag - Reflects the noDrag property.\n */ get noDrag() {\n return this.hasAttribute(\"no-drag\");\n }\n set noDrag(value) {\n this.toggleAttribute(\"no-drag\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from reacting to keyboard events.\n * @default false\n * @attribute no-keyboard - Reflects the noKeyboard property.\n */ get noKeyboard() {\n return this.hasAttribute(\"no-keyboard\");\n }\n set noKeyboard(value) {\n this.toggleAttribute(\"no-keyboard\", !!value);\n }\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */ get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(value) {\n this.toggleAttribute(\"auto-focus\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */ get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(value) {\n this.toggleAttribute(\"no-style\", !!value);\n }\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */ #handleFileInputChange = async (evt)=>{\n try {\n this.#handleFilesSelect(await (0, $f31161edf38949e9$export$6d52664cd15c442)(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n };\n /**\n * Handles the dragenter event of the dropzone.\n */ #handleDragEnter = ()=>{\n if (this.disabled || this.noDrag) return;\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleDragOver = (evt)=>{\n evt.preventDefault();\n if (this.disabled || this.noDrag) {\n evt.dataTransfer.dropEffect = \"none\";\n return;\n }\n evt.dataTransfer.dropEffect = \"copy\";\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add(\"dropzone--dragover\");\n this.#dropzoneEl.part.add(\"dropzone--dragover\");\n }\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the dragleave event of the dropzone.\n */ #handleDragLeave = ()=>{\n if (this.disabled || this.noDrag) return;\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove(\"dropzone--dragover\");\n this.#dropzoneEl.part.remove(\"dropzone--dragover\");\n }\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleDrop = async (evt)=>{\n if (this.disabled || this.noDrag) return;\n evt.preventDefault();\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove(\"dropzone--dragover\");\n this.#dropzoneEl.part.remove(\"dropzone--dragover\");\n }\n try {\n this.#handleFilesSelect(await (0, $f31161edf38949e9$export$6d52664cd15c442)(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n };\n /**\n * Handles the click event of the dropzone.\n */ #handleClick = ()=>{\n if (this.disabled || this.noClick) return;\n this.#fileInput?.click();\n };\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleKeyUp = (evt)=>{\n if (this.disabled || this.noKeyboard) return;\n if (evt.key === \" \" || evt.key === \"Enter\") this.#fileInput?.click();\n };\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */ #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) return;\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) for (const file of files)rejectedFiles.push({\n file: file,\n errors: [\n {\n code: $862aa3736b0514bc$var$TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }\n ]\n });\n else if (this.multiple && filesLength > this.maxFiles) // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files)rejectedFiles.push({\n file: file,\n errors: [\n {\n code: $862aa3736b0514bc$var$TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files){\n const fileHasValidType = (0, $38f222170fd4d21a$export$7c47054fed488f80)(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) acceptedFiles.push(file);\n else {\n const errors = [];\n if (!fileHasValidType) errors.push({\n code: $862aa3736b0514bc$var$INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n if (fileExceedsMaxSize) errors.push({\n code: $862aa3736b0514bc$var$FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n if (fileIsSmallerThanMinSize) errors.push({\n code: $862aa3736b0514bc$var$FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n rejectedFiles.push({\n file: file,\n errors: errors\n });\n }\n }\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles: acceptedFiles,\n rejectedFiles: rejectedFiles\n }\n }));\n if (acceptedFiles.length > 0) this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles: acceptedFiles\n }\n }));\n if (rejectedFiles.length > 0) this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles: rejectedFiles\n }\n }));\n if (this.#fileInput) this.#fileInput.value = this.#fileInput.defaultValue;\n }\n /**\n * Opens the file dialog programmatically.\n */ openFileDialog() {\n if (this.disabled) return;\n this.#fileInput?.click();\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'noClick' | 'noDrag' | 'noKeyboard' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */ static defineCustomElement(elementName = $862aa3736b0514bc$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $862aa3736b0514bc$export$6ccd1735166caad9);\n }\n}\n\n\n(0, $862aa3736b0514bc$export$6ccd1735166caad9).defineCustomElement();\n\n\nexport {$862aa3736b0514bc$export$6ccd1735166caad9 as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","import { FilesDropzone } from './files-dropzone.js';\n\nFilesDropzone.defineCustomElement();\n\nexport { FilesDropzone };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nimport { isValidFile } from './utils/is-valid-file.js';\nimport { getFilesFromEvent } from './utils/files-selector.js';\n\nconst COMPONENT_NAME = 'files-dropzone';\nconst TOO_MANY_FILES = 'TOO_MANY_FILES';\nconst FILE_TOO_LARGE = 'FILE_TOO_LARGE';\nconst FILE_TOO_SMALL = 'FILE_TOO_SMALL';\nconst INVALID_MIME_TYPE = 'INVALID_MIME_TYPE';\nconst template = document.createElement('template');\n\nconst styles = /* css */`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n\ntemplate.innerHTML = /* html */`\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\n\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} noClick - Prevents the file dialog from opening when the dropzone is clicked.\n * @property {boolean} noDrag - Prevents the dropzone from reacting to drag events.\n * @property {boolean} noKeyboard - Prevents the dropzone from reacting to keyboard events.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} no-click - Reflects the noClick property.\n * @attribute {boolean} no-drag - Reflects the noDrag property.\n * @attribute {boolean} no-keyboard - Reflects the noKeyboard property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */\nclass FilesDropzone extends HTMLElement {\n /** @type {Nullable} */\n #fileInput = null;\n\n /** @type {Nullable} */\n #dropzoneEl = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */(this.shadowRoot.getElementById('fileInput'));\n this.#dropzoneEl = this.shadowRoot.getElementById('dropzoneEl');\n }\n }\n\n static get observedAttributes() {\n return ['accept', 'disabled', 'multiple', 'no-keyboard'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'accept' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.accept = this.accept;\n }\n\n if (name === 'disabled' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n\n if (this.disabled) {\n this.#dropzoneEl?.removeAttribute('tabindex');\n } else {\n this.#dropzoneEl?.setAttribute('tabindex', '0');\n }\n }\n\n if (name === 'multiple' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.multiple = this.multiple;\n }\n\n if (name === 'no-keyboard' && oldValue !== newValue && this.#dropzoneEl) {\n if (this.noKeyboard) {\n this.#dropzoneEl.removeAttribute('tabindex');\n } else {\n this.#dropzoneEl.setAttribute('tabindex', '0');\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('accept');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('maxFiles');\n this.#upgradeProperty('maxSize');\n this.#upgradeProperty('minSize');\n this.#upgradeProperty('multiple');\n this.#upgradeProperty('noClick');\n this.#upgradeProperty('noDrag');\n this.#upgradeProperty('noKeyboard');\n this.#upgradeProperty('autoFocus');\n this.#upgradeProperty('noStyle');\n\n this.#fileInput?.addEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.addEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.addEventListener('click', this.#handleClick);\n this.#dropzoneEl?.addEventListener('keyup', this.#handleKeyUp);\n\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#fileInput?.removeEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.removeEventListener('click', this.#handleClick);\n this.#dropzoneEl?.removeEventListener('keyup', this.#handleKeyUp);\n }\n\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */\n get accept() {\n return this.getAttribute('accept') || '';\n }\n\n set accept(value) {\n this.setAttribute('accept', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */\n get maxFiles() {\n const num = Number(this.getAttribute('max-files')) || 0;\n\n if (num <= 0) {\n return Infinity;\n }\n\n return Math.floor(Math.abs(num));\n }\n\n set maxFiles(value) {\n this.setAttribute('max-files', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */\n get maxSize() {\n const value = this.getAttribute('max-size');\n\n if (value === null) {\n return Infinity;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? Infinity : num;\n }\n\n set maxSize(value) {\n this.setAttribute('max-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */\n get minSize() {\n const value = this.getAttribute('min-size');\n\n if (value === null) {\n return 0;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? 0 : num;\n }\n\n set minSize(value) {\n this.setAttribute('min-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */\n get multiple() {\n return this.hasAttribute('multiple');\n }\n\n set multiple(value) {\n this.toggleAttribute('multiple', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the file dialog from opening when the dropzone is clicked.\n * @default false\n * @attribute no-click - Reflects the noClick property.\n */\n get noClick() {\n return this.hasAttribute('no-click');\n }\n\n set noClick(value) {\n this.toggleAttribute('no-click', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from reacting to drag events.\n * @default false\n * @attribute no-drag - Reflects the noDrag property.\n */\n get noDrag() {\n return this.hasAttribute('no-drag');\n }\n\n set noDrag(value) {\n this.toggleAttribute('no-drag', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from reacting to keyboard events.\n * @default false\n * @attribute no-keyboard - Reflects the noKeyboard property.\n */\n get noKeyboard() {\n return this.hasAttribute('no-keyboard');\n }\n\n set noKeyboard(value) {\n this.toggleAttribute('no-keyboard', !!value);\n }\n\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */\n get autoFocus() {\n return this.hasAttribute('auto-focus');\n }\n\n set autoFocus(value) {\n this.toggleAttribute('auto-focus', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */\n get noStyle() {\n return this.hasAttribute('no-style');\n }\n\n set noStyle(value) {\n this.toggleAttribute('no-style', !!value);\n }\n\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */\n #handleFileInputChange = async evt => {\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n };\n\n /**\n * Handles the dragenter event of the dropzone.\n */\n #handleDragEnter = () => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDragOver = evt => {\n evt.preventDefault();\n\n if (this.disabled || this.noDrag) {\n evt.dataTransfer.dropEffect = 'none';\n return;\n }\n\n evt.dataTransfer.dropEffect = 'copy';\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add('dropzone--dragover');\n this.#dropzoneEl.part.add('dropzone--dragover');\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the dragleave event of the dropzone.\n */\n #handleDragLeave = () => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDrop = async evt => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n evt.preventDefault();\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n };\n\n /**\n * Handles the click event of the dropzone.\n */\n #handleClick = () => {\n if (this.disabled || this.noClick) {\n return;\n }\n\n this.#fileInput?.click();\n };\n\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleKeyUp = evt => {\n if (this.disabled || this.noKeyboard) {\n return;\n }\n\n if (evt.key === ' ' || evt.key === 'Enter') {\n this.#fileInput?.click();\n }\n };\n\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */\n #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) {\n return;\n }\n\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) {\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [{\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }]\n });\n }\n } else if (this.multiple && filesLength > this.maxFiles) {\n // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [{\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? 'files are' : 'file is'} allowed.`\n }]\n });\n }\n } else {\n // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files) {\n const fileHasValidType = isValidFile(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) {\n acceptedFiles.push(file);\n } else {\n const errors = [];\n\n if (!fileHasValidType) {\n errors.push({\n code: INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n }\n\n if (fileExceedsMaxSize) {\n errors.push({\n code: FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n }\n\n if (fileIsSmallerThanMinSize) {\n errors.push({\n code: FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n }\n\n rejectedFiles.push({ file, errors });\n }\n }\n }\n\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles,\n rejectedFiles\n }\n }));\n\n if (acceptedFiles.length > 0) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles\n }\n }));\n }\n\n if (rejectedFiles.length > 0) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles\n }\n }));\n }\n\n if (this.#fileInput) {\n this.#fileInput.value = this.#fileInput.defaultValue;\n }\n }\n\n /**\n * Opens the file dialog programmatically.\n */\n openFileDialog() {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'noClick' | 'noDrag' | 'noKeyboard' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, FilesDropzone);\n }\n }\n}\n\nexport { FilesDropzone };\n","// @ts-check\n\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */\nexport function isValidFile(file, acceptedTypeSpecifiers = '') {\n if (!acceptedTypeSpecifiers) {\n return true;\n }\n\n const acceptedMimeTypesList = [\n ...new Set(acceptedTypeSpecifiers.split(',').map(v => v.trim()).filter(Boolean))\n ];\n\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, '');\n\n for (const validType of acceptedMimeTypesList) {\n if (validType.charAt(0) === '.') {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {\n return true;\n }\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, '')) {\n return true;\n }\n } else {\n if (fileMimeType === validType) {\n return true;\n }\n }\n }\n\n return false;\n}\n","// @ts-check\n\n/**\n * A map of common file extensions and their associated MIME types.\n */\nconst COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n ['aac', 'audio/aac'],\n ['abw', 'application/x-abiword'],\n ['arc', 'application/x-freearc'],\n ['avif', 'image/avif'],\n ['avi', 'video/x-msvideo'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bin', 'application/octet-stream'],\n ['bmp', 'image/bmp'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['cda', 'application/x-cdf'],\n ['csh', 'application/x-csh'],\n ['css', 'text/css'],\n ['csv', 'text/csv'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['epub', 'application/epub+zip'],\n ['gz', 'application/gzip'],\n ['gif', 'image/gif'],\n ['heic', 'image/heic'],\n ['heif', 'image/heif'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['ico', 'image/vnd.microsoft.icon'],\n ['ics', 'text/calendar'],\n ['jar', 'application/java-archive'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['jxl', 'image/jxl'],\n ['js', 'text/javascript'],\n ['json', 'application/json'],\n ['jsonld', 'application/ld+json'],\n ['markdown', 'text/markdown'],\n ['md', 'text/markdown'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mjs', 'text/javascript'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mpeg', 'video/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['opus', 'audio/opus'],\n ['otf', 'font/otf'],\n ['png', 'image/png'],\n ['pdf', 'application/pdf'],\n ['php', 'application/x-httpd-php'],\n ['ppt', 'application/vnd.ms-powerpoint'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['rar', 'application/vnd.rar'],\n ['rtf', 'application/rtf'],\n ['sh', 'application/x-sh'],\n ['svg', 'image/svg+xml'],\n ['swf', 'application/x-shockwave-flash'],\n ['tar', 'application/x-tar'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['ts', 'video/mp2t'],\n ['ttf', 'font/ttf'],\n ['txt', 'text/plain'],\n ['vsd', 'application/vnd.visio'],\n ['wav', 'audio/wav'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['xhtml', 'application/xhtml+xml'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['zip', 'application/zip'],\n ['7z', 'application/x-7z-compressed'],\n\n // Others\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['msg', 'application/vnd.ms-outlook']\n]);\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */\nconst toFileWithMimeType = file => {\n const { name } = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const extension = (name.split('.').pop() || '').toLowerCase();\n const type = COMMON_MIME_TYPES.get(extension);\n\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n};\n\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */\nconst toFileWithPath = (file, path) => {\n const fileWithMimeType = toFileWithMimeType(file);\n\n // @ts-ignore\n if (typeof fileWithMimeType.path !== 'string') {\n const { webkitRelativePath } = file;\n\n Object.defineProperty(fileWithMimeType, 'path', {\n value: typeof path === 'string' ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n\n return fileWithMimeType;\n};\n\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readEntriesPromise = async directoryReader => {\n return await new Promise((resolve, reject) => {\n directoryReader.readEntries(resolve, reject);\n });\n};\n\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readAllDirectoryEntries = async directoryReader => {\n const entries = [];\n let readEntries = await readEntriesPromise(directoryReader);\n\n while (readEntries.length > 0) {\n entries.push(...readEntries);\n readEntries = await readEntriesPromise(directoryReader);\n }\n\n return entries;\n};\n\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */\nconst getFileFromFileEntry = fileEntry => {\n return new Promise((resolve, reject) => {\n fileEntry.file(file => resolve(toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromDataTransferItemList = async dataTransferItemList => {\n const files = [];\n\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n\n for (const item of dataTransferItemList) {\n if (item.kind !== 'file') {\n // Ignore non-file items, such as links.\n continue;\n }\n\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n\n queue.push(entry);\n }\n\n while (queue.length > 0) {\n const entry = queue.shift();\n\n if (!entry) {\n continue;\n } else if (entry.isFile) {\n const file = await getFileFromFileEntry(entry);\n\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(file);\n }\n } else if (entry.isDirectory) {\n queue.push(...await readAllDirectoryEntries(entry.createReader()));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromFileList = async fileList => {\n const files = [];\n\n for (const file of fileList) {\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(toFileWithPath(file));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from an event.\n * This function supports both `drop` and `change` events.\n *\n * @param {*} evt - The event to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nexport const getFilesFromEvent = async evt => {\n if (evt.dataTransfer) {\n return evt.dataTransfer.items\n ? await getFilesFromDataTransferItemList(evt.dataTransfer.items)\n : await getFilesFromFileList(evt.dataTransfer.files);\n }\n\n return await getFilesFromFileList(evt.target.files);\n};\n","/**\n * Removes one or more elements from an array at the specified index(es).\n *\n * @param {Array} array The initial array to remove elements from.\n * @param {Number} ...indexes The index(es) of the elements to be removed. Non numbers are ignored.\n * @throws {TypeError} If `array` is not array.\n * @returns {Array} The result array with the elements specified removed.\n * @example\n *\n * const arr = [1, 2, 3, 4, 5];\n *\n * remove(arr, 0);\n * // => [2, 3, 4, 5]\n *\n * remove(arr, 0, 1);\n * // => [3, 4, 5]\n *\n * remove(arr, 0, 4);\n * // => [2, 3, 4]\n *\n * remove(arr);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length - 1);\n * // => [1, 2, 3, 4]\n *\n * remove(arr, NaN);\n * // => [1, 2, 3, 4, 5]\n */\nexport const arrayRemove = (array, ...indexes) => {\n if (!Array.isArray(array)) {\n throw new TypeError('Expected an array for first argument');\n }\n\n return array.filter((_, i) => indexes.indexOf(i) === -1);\n};\n","/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */\nconst uid = (prefix = '', suffix = '') => {\n const prefixString = typeof prefix === 'string' && prefix !== '' ? prefix + '-' : '';\n const suffixString = typeof suffix === 'string' && suffix !== '' ? '-' + suffix : '';\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n\n return `${prefixString}${randomString}${suffixString}`;\n};\n\nexport { uid };\n","export const ACCEPTED_MIME_TYPES = ['image/jpg', 'image/jpeg', 'image/png', 'image/apng', 'image/gif', 'image/webp', 'image/avif'];\n","import AntonRegular from 'url:../assets/fonts/Anton/Anton-Regular.ttf';\nimport OswaldRegular from 'url:../assets/fonts/Oswald/Oswald-Regular.ttf';\nimport OswaldBold from 'url:../assets/fonts/Oswald/Oswald-Bold.ttf';\nimport RobotoRegular from 'url:../assets/fonts/Roboto/Roboto-Regular.ttf';\nimport RobotoBold from 'url:../assets/fonts/Roboto/Roboto-Bold.ttf';\nimport RobotoCondensedRegular from 'url:../assets/fonts/RobotoCondensed/RobotoCondensed-Regular.ttf';\nimport RobotoCondensedBold from 'url:../assets/fonts/RobotoCondensed/RobotoCondensed-Bold.ttf';\nimport CourierPrimeRegular from 'url:../assets/fonts/CourierPrime/CourierPrime-Regular.ttf';\nimport CourierPrimeBold from 'url:../assets/fonts/CourierPrime/CourierPrime-Bold.ttf';\nimport OpenSansRegular from 'url:../assets/fonts/OpenSans/OpenSans-Regular.ttf';\nimport OpenSansBold from 'url:../assets/fonts/OpenSans/OpenSans-Bold.ttf';\n\nexport const customFonts = [\n { name: 'Anton', label: 'Anton', path: AntonRegular, style: 'normal', weight: '400' },\n { name: 'Oswald-Regular', label: 'Oswald', path: OswaldRegular, style: 'normal', weight: '400' },\n { name: 'Oswald-Bold', label: 'Oswald Bold', path: OswaldBold, style: 'normal', weight: '700' },\n { name: 'Roboto-Regular', label: 'Roboto', path: RobotoRegular, style: 'normal', weight: '400' },\n { name: 'Roboto-Bold', label: 'Roboto Bold', path: RobotoBold, style: 'normal', weight: '700' },\n { name: 'RobotoCondensed-Regular', label: 'Roboto Condensed', path: RobotoCondensedRegular, style: 'normal', weight: '400' },\n { name: 'RobotoCondensed-Bold', label: 'Roboto Condensed Bold', path: RobotoCondensedBold, style: 'normal', weight: '700' },\n { name: 'CourierPrime-Regular', label: 'Courier Prime', path: CourierPrimeRegular, style: 'normal', weight: '400' },\n { name: 'CourierPrime-Bold', label: 'Courier Prime Bold', path: CourierPrimeBold, style: 'normal', weight: '700' },\n { name: 'OpenSans-Regular', label: 'Open Sans', path: OpenSansRegular, style: 'normal', weight: '400' },\n { name: 'OpenSans-Bold', label: 'Open Sans Bold', path: OpenSansBold, style: 'normal', weight: '400' }\n];\n\nexport const loadCustomFont = async (name, path, options = {}) => {\n try {\n const font = new FontFace(name, `url(${path})`, { ...options });\n await font.load();\n document.fonts.add(font);\n } catch (err) {\n console.error(err);\n }\n};\n","module.exports = new __parcel__URL__(\"Anton-Regular.e58ab3fe.ttf\").toString();","module.exports = new __parcel__URL__(\"Oswald-Regular.89ec7d89.ttf\").toString();","module.exports = new __parcel__URL__(\"Oswald-Bold.0f6a7ca6.ttf\").toString();","module.exports = new __parcel__URL__(\"Roboto-Regular.ca197847.ttf\").toString();","module.exports = new __parcel__URL__(\"Roboto-Bold.fdb9b54a.ttf\").toString();","module.exports = new __parcel__URL__(\"RobotoCondensed-Regular.d585f5c7.ttf\").toString();","module.exports = new __parcel__URL__(\"RobotoCondensed-Bold.e1f96d4b.ttf\").toString();","module.exports = new __parcel__URL__(\"CourierPrime-Regular.3a25a501.ttf\").toString();","module.exports = new __parcel__URL__(\"CourierPrime-Bold.3d6bf689.ttf\").toString();","module.exports = new __parcel__URL__(\"OpenSans-Regular.edf9e01b.ttf\").toString();","module.exports = new __parcel__URL__(\"OpenSans-Bold.8fceb72b.ttf\").toString();","import { ACCEPTED_MIME_TYPES } from './constants.js';\n\nexport const fileFromUrl = async (options = {}) => {\n const res = await fetch(options.url);\n const blob = await res.blob();\n const mimeType = options.mimeType || blob.type || '';\n\n if (!ACCEPTED_MIME_TYPES.includes(mimeType)) {\n throw new Error(`This is not an accepted image format. Accepted MIME types are: ${ACCEPTED_MIME_TYPES.join(', ')}`);\n }\n\n return new File([blob], options.filename || '', blob);\n};\n","const errorsContainer = document.getElementById('errorsContainer');\n\nconst hideError = evt => {\n const target = evt.currentTarget;\n target.removeEventListener('click', hideError);\n errorsContainer.removeChild(target.parentNode);\n};\n\nexport const toastAlert = (message = '', type = 'info') => {\n const types = ['info', 'warning', 'danger'];\n\n if (!types.includes(type)) {\n type = 'info';\n }\n\n const template = /* html */`\n ${message}\n \n `;\n\n const div = document.createElement('div');\n div.className = `alert alert-${type} alert-dismissible text-break mb-2 fade`;\n div.innerHTML = template;\n div.querySelector('button').addEventListener('click', hideError);\n errorsContainer.appendChild(div);\n setTimeout(() => div.classList.add('show'), 100);\n};\n","import { customFonts } from './custom-fonts.js';\n\nexport const createTextBox = (index, data = {}) => {\n const inputTemplate = /* html */`\n
\n \n\n \n\n
\n \n \n \n
\n
\n\n
\n
\n
\n \n\n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n \n \n \n \n
\n
\n
\n\n
\n
\n
\n \n \n
\n
\n
\n
\n `;\n\n const fragment = document.createDocumentFragment();\n const div = document.createElement('div');\n\n div.className = 'bg-light border shadow-sm mb-3 rounded';\n div.setAttribute('data-section', 'textBox');\n div.setAttribute('data-index', index);\n div.innerHTML = inputTemplate;\n div.querySelector('[data-input=\"font\"]').value = data.font;\n div.querySelector('[data-input=\"textAlign\"]').value = data.textAlign;\n div.querySelector('[data-input=\"allCaps\"]').checked = data.allCaps;\n\n return fragment.appendChild(div);\n};\n","export const drawCanvas = (image, canvas, ctx, textOptions = []) => {\n if (image == null) {\n return;\n }\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n if (typeof image === 'string') { // Assume it's a color\n ctx.fillStyle = image;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n } else {\n ctx.drawImage(image, 0, 0, canvas.width, canvas.height);\n }\n\n textOptions.forEach(function (item, index) {\n ctx.font = `${item.fontWeight} ${item.fontSize}px ${item.font}`;\n\n const multiplier = index + 1;\n const lineHeight = ctx.measureText('M').width + item.fontSize / 2;\n const xPos = canvas.width / 2;\n const shadowBlur = item.shadowBlur;\n const text = item.allCaps === true ? item.text.toUpperCase() : item.text;\n const textLines = text.split('\\n');\n\n ctx.fillStyle = item.fillColor;\n ctx.textAlign = item.textAlign;\n ctx.save();\n\n if (shadowBlur !== 0) {\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n ctx.shadowBlur = shadowBlur;\n ctx.shadowColor = item.shadowColor;\n }\n\n if (item.rotate) {\n ctx.translate(xPos + item.offsetX, lineHeight * multiplier + item.offsetY);\n ctx.rotate(item.rotate * Math.PI / 180);\n textLines.forEach((text, index) => ctx.fillText(text, 0, index * lineHeight));\n ctx.rotate(-(item.rotate * Math.PI / 180));\n ctx.translate(-(xPos + item.offsetX), -(lineHeight * multiplier + item.offsetY));\n } else {\n textLines.forEach((text, index) => {\n ctx.fillText(text, xPos + item.offsetX, index * lineHeight + lineHeight * multiplier + item.offsetY);\n });\n }\n\n ctx.restore();\n });\n};"],"names":["$parcel$interopDefault","a","__esModule","default","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","$7a2aca835bb05064$export$c37129e465f64ef0","navigator","canShare","id","exports","init","module","call","err","Error","code","register","parcelRegister","Object","defineProperty","get","$ef7689007096c8a0$export$6503ec6e8aabbaf","set","v","enumerable","configurable","$ef7689007096c8a0$var$mapping","Map","baseUrl","manifest","i","length","path","URL","url","toString","JSON","parse","$cd62c5572235e737$export$30b344bef3e55b67","$cd62c5572235e737$var$t","$cd62c5572235e737$var$e","document","createElement","innerHTML","HTMLElement","t","e","s","constructor","shadowRoot","attachShadow","mode","delegatesFocus","appendChild","content","cloneNode","querySelector","observedAttributes","attributeChangedCallback","toggleAttribute","disabled","setAttribute","part","contains","toggle","connectedCallback","r","addEventListener","n","disconnectedCallback","removeEventListener","hasAttribute","shareUrl","getAttribute","shareTitle","shareText","shareFiles","Array","isArray","share","title","text","files","dispatchEvent","CustomEvent","bubbles","composed","detail","shareData","name","error","preventDefault","target","nodeName","assignedElements","flatten","find","prototype","hasOwnProperty","defineCustomElement","customElements","define","$dced0d224c6d876e$export$cc30a98fe3890794","$dced0d224c6d876e$var$t","Number","isNaN","Math","min","max","$dced0d224c6d876e$var$e","$dced0d224c6d876e$var$i","$dced0d224c6d876e$var$o","o","l","getSupportedConstraints","isConnected","getTrackCapabilities","getTrackSettings","u","includes","facingMode","stopVideoStream","startVideoStream","cameraResolution","trim","split","map","width","height","pan","h","tilt","zoom","d","getElementById","c","m","p","g","b","f","isSupported","message","autoPlay","noImage","loading","calculateFileSize","capture","play","then","video","catch","finally","removeAttribute","from","childNodes","forEach","remove","getVideoTracks","applyConstraints","advanced","ideal","audio","mediaDevices","getUserMedia","srcObject","hidden","stop","getContext","videoWidth","videoHeight","drawImage","toDataURL","Image","src","dataURI","fetch","blob","size","getCapabilities","getSettings","$d9c5053bade2d3f8$export$32589115725b904b","$d9c5053bade2d3f8$var$e","open","showModal","body","style","overflowY","element","close","noHeader","classList","noAnimations","noCloseButton","clearTimeout","staticBackdrop","fullscreen","add","setTimeout","defaultPrevented","currentTarget","assignedNodes","cancelable","reason","show","hide","$9351176e8d763a78$export$6ccd1735166caad9","$9351176e8d763a78$var$e","$9351176e8d763a78$var$t","$9351176e8d763a78$var$o","lastIndexOf","type","pop","toLowerCase","value","writable","$9351176e8d763a78$var$i","webkitRelativePath","$9351176e8d763a78$var$r","Promise","readEntries","$9351176e8d763a78$var$a","push","$9351176e8d763a78$var$n","file","fullPath","$9351176e8d763a78$var$s","kind","getAsEntry","webkitGetAsEntry","shift","isFile","indexOf","isDirectory","createReader","$9351176e8d763a78$var$d","$9351176e8d763a78$var$l","dataTransfer","items","$9351176e8d763a78$var$p","$9351176e8d763a78$var$c","$9351176e8d763a78$var$h","$9351176e8d763a78$var$u","accept","multiple","noKeyboard","autoFocus","focus","maxFiles","floor","abs","maxSize","minSize","noClick","noDrag","noStyle","Event","dropEffect","click","key","errors","Set","filter","Boolean","replace","charAt","test","acceptedFiles","rejectedFiles","defaultValue","openFileDialog","$4af3d380d1884504$export$30a014203d0d7e4f","array","indexes","TypeError","_","$17004b28c97c1306$export$e2a22331486dcca0","prefix","suffix","randomString","random","substring","$65136e012e05e2d7$export$63e7bed68b07a85c","$068eb37972da8c20$exports","$2db6b38fbc5d48da$exports","$a0b1873abc1b077b$exports","$df7c7f72fd04e02a$exports","$e4c2039736f96f5d$exports","$fbff28e47a938944$exports","$d8f4a375a42d32f4$exports","$7cfbda315cbb4209$exports","$6379185b16d8409f$exports","$454f2b111c8d0078$exports","$c05fcaeb63dbd733$exports","$56b863c8b6be7003$export$6874249d87f2602a","label","weight","$56b863c8b6be7003$export$59eceaef0c7797b2","options","font","FontFace","load","fonts","console","$0374350c629f125f$export$6539e087749cf9d3","res","mimeType","join","File","filename","$3969451ff60cb8d5$var$errorsContainer","$3969451ff60cb8d5$var$hideError","evt","removeChild","parentNode","$3969451ff60cb8d5$export$af04143326425dbd","types","template","div","className","$224fa2388dce65c4$export$293a4b86a6fe2398","index","data","inputTemplate","fillColor","shadowColor","_isSettingsOpen","fontSize","shadowBlur","rotate","offsetY","offsetX","fragment","createDocumentFragment","textAlign","checked","allCaps","$64ef5d4149d7e6a5$export$e653a2de0f3a8b89","image","canvas","ctx","textOptions","clearRect","fillStyle","fillRect","item","fontWeight","multiplier","lineHeight","measureText","xPos","textLines","toUpperCase","save","shadowOffsetX","shadowOffsetY","translate","PI","fillText","restore","$85a5f86b715fe7db$var$videoModal","$85a5f86b715fe7db$var$downloadModal","$85a5f86b715fe7db$var$canvas","$85a5f86b715fe7db$var$dropzoneEl","$85a5f86b715fe7db$var$instructionsEl","$85a5f86b715fe7db$var$ctx","$85a5f86b715fe7db$var$imageUploadMethodSelect","$85a5f86b715fe7db$var$fileSelectBtn","$85a5f86b715fe7db$var$imageUrlForm","$85a5f86b715fe7db$var$addTextboxBtn","$85a5f86b715fe7db$var$inputsContainer","$85a5f86b715fe7db$var$generateMemeBtn","$85a5f86b715fe7db$var$openVideoModalBtn","$85a5f86b715fe7db$var$downloadMemeBtn","$85a5f86b715fe7db$var$downloadMemePreview","$85a5f86b715fe7db$var$webShareComponent","$85a5f86b715fe7db$var$galleryEl","$85a5f86b715fe7db$var$gallerySearchEl","$85a5f86b715fe7db$var$galleryNoResultsEl","$85a5f86b715fe7db$var$solidColorForm","$85a5f86b715fe7db$var$uploadMethodEls","querySelectorAll","$85a5f86b715fe7db$var$selectedImage","$85a5f86b715fe7db$var$reqAnimFrame","$85a5f86b715fe7db$var$defaultTextOptions","$85a5f86b715fe7db$var$textOptions","$85a5f86b715fe7db$var$generateMeme","dataUrl","downloadLink","download","href","$85a5f86b715fe7db$var$onImageLoaded","MAX_WIDTH","MAX_HEIGHT","$85a5f86b715fe7db$var$handleFileSelect","reader","FileReader","result","readAsDataURL","$85a5f86b715fe7db$var$handleTextPropChange","prop","$85a5f86b715fe7db$var$handleImageUploadFromURL","form","submitButton","imageUrl","$85a5f86b715fe7db$var$moveText","offsetDir","sign","textBoxSection","offsetYInput","offsetXInput","requestAnimationFrame","$85a5f86b715fe7db$var$handleGalleryClick","button","closest","img","alt","newTextBox","matches","textBoxIndex","textBoxEls","el","settingsEl","confirm","isOffsetYButton","isOffsetXButton","cancelAnimationFrame","query","galleryItems","capturePhotoComponent","$442be162a818aed4$export$c37129e465f64ef0","isWebShareSupported","$e179325634270afd$export$30b344bef3e55b67","$e179325634270afd$var$styles","$e179325634270afd$var$template","buttonSlot","buttonEl","getButton","oldValue","newValue","upgradeProperty","handleSlotChange","handleClick","instance","elementName","WebShare","$c290816263f90981$export$cc30a98fe3890794","$02ad8beec419df62$export$7d15b64cf5a3a4c4","lower","upper","$c290816263f90981$var$COMPONENT_NAME","$c290816263f90981$var$styles","$c290816263f90981$var$template","supportedConstraints","stream","canvasElement","outputElement","videoElement","captureButtonSlot","captureButton","facingModeButtonSlot","facingModeButton","trackCapabilities","trackSettings","emptyOutputElement","isValidFacingMode","x","widthInAllowedRange","heightInAllowedRange","panInAllowedRange","applyPTZ","tiltInAllowedRange","zoomInAllowedRange","getCaptureButton","getFacingModeButton","onVideoLoadedMetaData","onCaptureButtonSlotChange","onCapturePhotoButtonClick","onFacingModeButtonSlotChange","onFacingModeButtonClick","node","constraintName","constraintValue","track","constraints","eventDetail","CapturePhoto","$180b6dcf923bafc7$export$32589115725b904b","$180b6dcf923bafc7$var$template","dialogEl","footerSlotEl","pulseAnimationTimeout","headerEl","closeBtnEl","handleDialogClick","handleDialogClose","handleDialogCancel","handleCloseButtonClick","handleFooterSlotChange","applyPulseEffectOnDialog","requestCloseEvent","createRequestCloseEvent","footerEl","footerSlotNodes","hasFooterSlotNodes","ModalElement","$862aa3736b0514bc$export$6ccd1735166caad9","$f31161edf38949e9$var$COMMON_MIME_TYPES","$f31161edf38949e9$var$FILES_TO_IGNORE","$f31161edf38949e9$var$toFileWithMimeType","hasExtension","extension","$f31161edf38949e9$var$toFileWithPath","fileWithMimeType","$f31161edf38949e9$var$readEntriesPromise","directoryReader","resolve","reject","$f31161edf38949e9$var$readAllDirectoryEntries","entries","$f31161edf38949e9$var$getFileFromFileEntry","fileEntry","$f31161edf38949e9$var$getFilesFromDataTransferItemList","dataTransferItemList","queue","entry","$f31161edf38949e9$var$getFilesFromFileList","fileList","$f31161edf38949e9$export$6d52664cd15c442","$862aa3736b0514bc$var$COMPONENT_NAME","$862aa3736b0514bc$var$TOO_MANY_FILES","$862aa3736b0514bc$var$template","$862aa3736b0514bc$var$styles","fileInput","dropzoneEl","handleFileInputChange","handleDragEnter","handleDragOver","handleDragLeave","handleDrop","handleKeyUp","num","Infinity","handleFilesSelect","filesLength","fileHasValidType","acceptedTypeSpecifiers","acceptedMimeTypesList","fileMimeType","baseMimeType","validType","fileExceedsMaxSize","fileIsSmallerThanMinSize","FilesDropzone"],"version":3,"file":"index.6d051d2c.js.map"} \ No newline at end of file diff --git a/docs/index.2a3e2367.js b/docs/index.bc158aed.js similarity index 99% rename from docs/index.2a3e2367.js rename to docs/index.bc158aed.js index 2f4b786..4d2ecad 100644 --- a/docs/index.2a3e2367.js +++ b/docs/index.bc158aed.js @@ -1,4 +1,4 @@ -!function(){function t(t,e,o,i){Object.defineProperty(t,e,{get:o,set:i,enumerable:!0,configurable:!0})}function e(t){return t&&t.__esModule?t.default:t}var o="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:{},i={},a={},n=o.parcelRequire5078;null==n&&((n=function(t){if(t in i)return i[t].exports;if(t in a){var e=a[t];delete a[t];var o={id:t,exports:{}};return i[t]=o,e.call(o.exports,o,o.exports),o.exports}var n=Error("Cannot find module '"+t+"'");throw n.code="MODULE_NOT_FOUND",n}).register=function(t,e){a[t]=e},o.parcelRequire5078=n);var s=n.register;function r(t){return null!==t&&"object"==typeof t?"share"in navigator&&"canShare"in navigator&&navigator.canShare(t):"share"in navigator}s("iE7OH",function(e,o){t(e.exports,"register",function(){return i},function(t){return i=t});var i,a=new Map;i=function(t,e){for(var o=0;o `;class T extends HTMLElement{#e=null;#t=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"}).appendChild(R.content.cloneNode(!0)),this.shadowRoot&&(this.#e=this.shadowRoot.getElementById("fileInput"),this.#t=this.shadowRoot.getElementById("dropzoneEl"))}static get observedAttributes(){return["accept","disabled","multiple","no-keyboard"]}attributeChangedCallback(t,e,o){"accept"===t&&e!==o&&this.#e&&(this.#e.accept=this.accept),"disabled"===t&&e!==o&&this.#e&&(this.#e.disabled=this.disabled,this.disabled?this.#t?.removeAttribute("tabindex"):this.#t?.setAttribute("tabindex","0")),"multiple"===t&&e!==o&&this.#e&&(this.#e.multiple=this.multiple),"no-keyboard"===t&&e!==o&&this.#t&&(this.noKeyboard?this.#t.removeAttribute("tabindex"):this.#t.setAttribute("tabindex","0"))}connectedCallback(){this.#r("accept"),this.#r("disabled"),this.#r("maxFiles"),this.#r("maxSize"),this.#r("minSize"),this.#r("multiple"),this.#r("noClick"),this.#r("noDrag"),this.#r("noKeyboard"),this.#r("autoFocus"),this.#r("noStyle"),this.#e?.addEventListener("change",this.#i),this.#t?.addEventListener("dragenter",this.#a),this.#t?.addEventListener("dragover",this.#n),this.#t?.addEventListener("dragleave",this.#s),this.#t?.addEventListener("drop",this.#o),this.#t?.addEventListener("click",this.#h),this.#t?.addEventListener("keyup",this.#l),this.autoFocus&&this.#t?.focus()}disconnectedCallback(){this.#e?.removeEventListener("change",this.#i),this.#t?.removeEventListener("dragenter",this.#a),this.#t?.removeEventListener("dragover",this.#n),this.#t?.removeEventListener("dragleave",this.#s),this.#t?.removeEventListener("drop",this.#o),this.#t?.removeEventListener("click",this.#h),this.#t?.removeEventListener("keyup",this.#l)}get accept(){return this.getAttribute("accept")||""}set accept(t){this.setAttribute("accept",null!=t?t.toString():t)}get disabled(){return this.hasAttribute("disabled")}set disabled(t){this.toggleAttribute("disabled",!!t)}get maxFiles(){let t=Number(this.getAttribute("max-files"))||0;return t<=0?1/0:Math.floor(Math.abs(t))}set maxFiles(t){this.setAttribute("max-files",null!=t?t.toString():t)}get maxSize(){let t=this.getAttribute("max-size");if(null===t)return 1/0;let e=Number(t);return Number.isNaN(e)?1/0:e}set maxSize(t){this.setAttribute("max-size",null!=t?t.toString():t)}get minSize(){let t=this.getAttribute("min-size");if(null===t)return 0;let e=Number(t);return Number.isNaN(e)?0:e}set minSize(t){this.setAttribute("min-size",null!=t?t.toString():t)}get multiple(){return this.hasAttribute("multiple")}set multiple(t){this.toggleAttribute("multiple",!!t)}get noClick(){return this.hasAttribute("no-click")}set noClick(t){this.toggleAttribute("no-click",!!t)}get noDrag(){return this.hasAttribute("no-drag")}set noDrag(t){this.toggleAttribute("no-drag",!!t)}get noKeyboard(){return this.hasAttribute("no-keyboard")}set noKeyboard(t){this.toggleAttribute("no-keyboard",!!t)}get autoFocus(){return this.hasAttribute("auto-focus")}set autoFocus(t){this.toggleAttribute("auto-focus",!!t)}get noStyle(){return this.hasAttribute("no-style")}set noStyle(t){this.toggleAttribute("no-style",!!t)}#i=async t=>{try{this.#m(await z(t))}catch(t){this.dispatchEvent(new CustomEvent(`${L}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}};#a=()=>{this.disabled||this.noDrag||this.dispatchEvent(new Event(`${L}-dragenter`,{bubbles:!0,composed:!0}))};#n=t=>{if(t.preventDefault(),this.disabled||this.noDrag){t.dataTransfer.dropEffect="none";return}t.dataTransfer.dropEffect="copy",this.#t&&(this.#t.classList.add("dropzone--dragover"),this.#t.part.add("dropzone--dragover")),this.dispatchEvent(new Event(`${L}-dragover`,{bubbles:!0,composed:!0}))};#s=()=>{this.disabled||this.noDrag||(this.#t&&(this.#t.classList.remove("dropzone--dragover"),this.#t.part.remove("dropzone--dragover")),this.dispatchEvent(new Event(`${L}-dragleave`,{bubbles:!0,composed:!0})))};#o=async t=>{if(!this.disabled&&!this.noDrag){t.preventDefault(),this.#t&&(this.#t.classList.remove("dropzone--dragover"),this.#t.part.remove("dropzone--dragover"));try{this.#m(await z(t))}catch(t){this.dispatchEvent(new CustomEvent(`${L}-error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}};#h=()=>{this.disabled||this.noClick||this.#e?.click()};#l=t=>{this.disabled||this.noKeyboard||" "!==t.key&&"Enter"!==t.key||this.#e?.click()};#m(t){if(!Array.isArray(t)||!t.length)return;let e=[],o=[],i=t.length;if(!this.multiple&&i>1)for(let e of t)o.push({file:e,errors:[{code:_,message:"Too many files selected. Only 1 file is allowed."}]});else if(this.multiple&&i>this.maxFiles)for(let e of t)o.push({file:e,errors:[{code:_,message:`Too many files selected. Only ${this.maxFiles} ${this.maxFiles>1?"files are":"file is"} allowed.`}]});else for(let i of t){let t=function(t,e=""){if(!e)return!0;let o=[...new Set(e.split(",").map(t=>t.trim()).filter(Boolean))],i=t.type,a=i.replace(/\/.*$/,"");for(let e of o)if("."===e.charAt(0)){if(-1!==t.name.toLowerCase().indexOf(e.toLowerCase(),t.name.length-e.length))return!0}else if(/\/\*$/.test(e)){if(a===e.replace(/\/.*$/,""))return!0}else if(i===e)return!0;return!1}(i,this.accept),a=i.size>this.maxSize,n=i.size0&&this.dispatchEvent(new CustomEvent(`${L}-drop-accepted`,{bubbles:!0,composed:!0,detail:{acceptedFiles:e}})),o.length>0&&this.dispatchEvent(new CustomEvent(`${L}-drop-rejected`,{bubbles:!0,composed:!0,detail:{rejectedFiles:o}})),this.#e&&(this.#e.value=this.#e.defaultValue)}openFileDialog(){this.disabled||this.#e?.click()}#r(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}static defineCustomElement(t=L){"undefined"==typeof window||window.customElements.get(t)||window.customElements.define(t,T)}}T.defineCustomElement();let F=(t,...e)=>{if(!Array.isArray(t))throw TypeError("Expected an array for first argument");return t.filter((t,o)=>-1===e.indexOf(o))},N=(t="",e="")=>{let o=Math.random().toString(36).substring(2,8);return`${"string"==typeof t&&""!==t?t+"-":""}${o}${"string"==typeof e&&""!==e?"-"+e:""}`},$=["image/jpg","image/jpeg","image/png","image/apng","image/gif","image/webp","image/avif"];var O={};O=n("aNJCr").getBundleURL("8tAhj")+"Anton-Regular.e58ab3fe.ttf";var H={};H=n("aNJCr").getBundleURL("8tAhj")+"Oswald-Regular.89ec7d89.ttf";var I={};I=n("aNJCr").getBundleURL("8tAhj")+"Oswald-Bold.0f6a7ca6.ttf";var M={};M=n("aNJCr").getBundleURL("8tAhj")+"Roboto-Regular.ca197847.ttf";var j={};j=n("aNJCr").getBundleURL("8tAhj")+"Roboto-Bold.fdb9b54a.ttf";var q={};q=n("aNJCr").getBundleURL("8tAhj")+"RobotoCondensed-Regular.d585f5c7.ttf";var P={};P=n("aNJCr").getBundleURL("8tAhj")+"RobotoCondensed-Bold.e1f96d4b.ttf";var U={};U=n("aNJCr").getBundleURL("8tAhj")+"CourierPrime-Regular.3a25a501.ttf";var D={};D=n("aNJCr").getBundleURL("8tAhj")+"CourierPrime-Bold.3d6bf689.ttf";var Y={};Y=n("aNJCr").getBundleURL("8tAhj")+"OpenSans-Regular.edf9e01b.ttf";var V={};V=n("aNJCr").getBundleURL("8tAhj")+"OpenSans-Bold.8fceb72b.ttf";let X=[{name:"Anton",label:"Anton",path:e(O),style:"normal",weight:"400"},{name:"Oswald-Regular",label:"Oswald",path:e(H),style:"normal",weight:"400"},{name:"Oswald-Bold",label:"Oswald Bold",path:e(I),style:"normal",weight:"700"},{name:"Roboto-Regular",label:"Roboto",path:e(M),style:"normal",weight:"400"},{name:"Roboto-Bold",label:"Roboto Bold",path:e(j),style:"normal",weight:"700"},{name:"RobotoCondensed-Regular",label:"Roboto Condensed",path:e(q),style:"normal",weight:"400"},{name:"RobotoCondensed-Bold",label:"Roboto Condensed Bold",path:e(P),style:"normal",weight:"700"},{name:"CourierPrime-Regular",label:"Courier Prime",path:e(U),style:"normal",weight:"400"},{name:"CourierPrime-Bold",label:"Courier Prime Bold",path:e(D),style:"normal",weight:"700"},{name:"OpenSans-Regular",label:"Open Sans",path:e(Y),style:"normal",weight:"400"},{name:"OpenSans-Bold",label:"Open Sans Bold",path:e(V),style:"normal",weight:"400"}],J=async(t,e,o={})=>{try{let i=new FontFace(t,`url(${e})`,{...o});await i.load(),document.fonts.add(i)}catch(t){console.error(t)}},W=async(t={})=>{let e=await fetch(t.url),o=await e.blob(),i=t.mimeType||o.type||"";if(!$.includes(i))throw Error(`This is not an accepted image format. Accepted MIME types are: ${$.join(", ")}`);return new File([o],t.filename||"",o)},G=document.getElementById("errorsContainer"),K=t=>{let e=t.currentTarget;e.removeEventListener("click",K),G.removeChild(e.parentNode)},Q=(t="",e="info")=>{["info","warning","danger"].includes(e)||(e="info");let o=` ${t} - + `,i=document.createElement("div");i.className=`alert alert-${e} alert-dismissible text-break mb-2 fade`,i.innerHTML=o,i.querySelector("button").addEventListener("click",K),G.appendChild(i),setTimeout(()=>i.classList.add("show"),100)},Z=(t,e={})=>{let o=`
@@ -448,4 +446,4 @@
`,i=document.createDocumentFragment(),a=document.createElement("div");return a.className="bg-light border shadow-sm mb-3 rounded",a.setAttribute("data-section","textBox"),a.setAttribute("data-index",t),a.innerHTML=o,a.querySelector('[data-input="font"]').value=e.font,a.querySelector('[data-input="textAlign"]').value=e.textAlign,a.querySelector('[data-input="allCaps"]').checked=e.allCaps,i.appendChild(a)},tt=(t,e,o,i=[])=>{null!=t&&(o.clearRect(0,0,e.width,e.height),"string"==typeof t?(o.fillStyle=t,o.fillRect(0,0,e.width,e.height)):o.drawImage(t,0,0,e.width,e.height),i.forEach(function(t,i){o.font=`${t.fontWeight} ${t.fontSize}px ${t.font}`;let a=i+1,n=o.measureText("M").width+t.fontSize/2,s=e.width/2,r=t.shadowBlur,l=(!0===t.allCaps?t.text.toUpperCase():t.text).split("\n");o.fillStyle=t.fillColor,o.textAlign=t.textAlign,o.save(),0!==r&&(o.shadowOffsetX=0,o.shadowOffsetY=0,o.shadowBlur=r,o.shadowColor=t.shadowColor),t.rotate?(o.translate(s+t.offsetX,n*a+t.offsetY),o.rotate(t.rotate*Math.PI/180),l.forEach((t,e)=>o.fillText(t,0,e*n)),o.rotate(-(t.rotate*Math.PI/180)),o.translate(-(s+t.offsetX),-(n*a+t.offsetY))):l.forEach((e,i)=>{o.fillText(e,s+t.offsetX,i*n+n*a+t.offsetY)}),o.restore()}))},te=document.getElementById("videoModal"),to=document.getElementById("downloadModal"),ti=document.getElementById("canvas"),ta=document.querySelector("files-dropzone"),tn=document.getElementById("instructions"),ts=ti.getContext("2d"),tr=document.getElementById("imageUploadMethodSelect"),tl=document.getElementById("fileSelectBtn"),td=document.getElementById("imageUrlForm"),tc=document.getElementById("addTextboxBtn"),th=document.getElementById("inputsContainer"),tu=document.getElementById("generateMemeBtn"),tp=document.getElementById("openVideoModalBtn"),tm=document.getElementById("downloadMemeBtn"),tb=document.getElementById("downloadMemePreview"),tg=document.querySelector("web-share"),tf=document.getElementById("gallery"),tv=document.getElementById("gallerySearch"),ty=tf.querySelector(".gallery__no-results"),tw=document.getElementById("solidColorForm"),tE=document.querySelectorAll(".upload-method"),tx=null,tA=null,tS={_isSettingsOpen:!1,text:"",fillColor:"#ffffff",shadowColor:"#000000",font:"Anton",fontSize:40,fontWeight:"normal",textAlign:"center",shadowBlur:3,offsetY:0,offsetX:0,rotate:0,allCaps:!0},tk=[{...tS}],tC=async()=>{let t=ti.toDataURL("image/png"),e=t.replace("image/png","image/octet-stream");if(tm.download=`${N("meme")}.png`,tm.href=e,tb.src=e,r())try{let e=await W({url:t,filename:`${N("meme")}.png`,mimeType:"image/png"}).catch(t=>Q(t.message,"danger"));e&&r({files:[e]})&&(tg.shareFiles=[e],tg.hidden=!1)}catch(t){console.error(t)}to.open=!0},tz=t=>{let e=t.target.width,o=t.target.height;e>o?e>800&&(o*=800/e,e=800):o>600&&(e*=600/o,o=600),ti.width=e,ti.height=o,tt(tx=t.target,ti,ts,tk),tu.disabled=!1,ti.hidden=!1,tn.hidden=!0},tL=t=>{if(!t)return;let e=new Image,o=new FileReader;o.addEventListener("load",function(t){let o=t.target.result;e.addEventListener("load",tz),e.src=o}),o.readAsDataURL(t)},t_=(t,e,o)=>{"checkbox"===t.type?tk[e][o]=t.checked:"number"===t.type?tk[e][o]=Number(t.value):tk[e][o]=t.value,tt(tx,ti,ts,tk)},tR=async t=>{t.preventDefault();let e=t.target,o=e.querySelector('button[type="submit"]'),i=e.imageUrl.value;if(i.trim()){o.disabled=!0,o.querySelector(".spinner").hidden=!1,o.querySelector(".label").hidden=!0;try{let t=await W({url:i}).catch(t=>Q(t.message,"danger"));t&&tL(t)}catch(t){Q(`Failed to load image from "${i}".`,"danger")}finally{o.disabled=!1,o.querySelector(".spinner").hidden=!0,o.querySelector(".label").hidden=!1}}},tB=(t,e,o)=>()=>{let i=document.querySelectorAll('[data-section="textBox"]')[o],a=i.querySelector('[data-input="offsetY"]'),n=i.querySelector('[data-input="offsetX"]');"offsetY"===t&&("-"===e&&(tk[o].offsetY-=1),"+"===e&&(tk[o].offsetY+=1),a.value=tk[o].offsetY),"offsetX"===t&&("-"===e&&(tk[o].offsetX-=1),"+"===e&&(tk[o].offsetX+=1),n.value=tk[o].offsetX),tt(tx,ti,ts,tk),tA=requestAnimationFrame(tB(t,e,o))},tT=async t=>{let e=t.target.closest("button");if(!e)return;let o=e.querySelector("img");try{let t=await W({url:o.src}).catch(t=>Q(t.message,"danger"));t&&tL(t)}catch(t){Q(`Failed to load image: "${o.alt}".`,"danger")}};tl.addEventListener("click",()=>{"function"==typeof ta.openFileDialog&&ta.openFileDialog()}),tp.addEventListener("click",()=>{te.open=!0}),tc.addEventListener("click",()=>{let t=Z(tk.length,tS);tk.push({...tS}),th.appendChild(t),t.querySelector('[data-input="text"]').focus()}),tu.addEventListener("click",tC),tm.addEventListener("click",()=>to.open=!1),td.addEventListener("submit",tR),ta.addEventListener("files-dropzone-drop-accepted",t=>{let[e]=t.detail.acceptedFiles;e&&tL(e)}),th.addEventListener("input",t=>{let e;let o=t.target,i=Number(o.closest('[data-section="textBox"]').getAttribute("data-index"));o.matches('[data-input="text"]')?e="text":o.matches('[data-input="fillColor"]')?e="fillColor":o.matches('[data-input="shadowColor"]')?e="shadowColor":o.matches('[data-input="font"]')?e="font":o.matches('[data-input="fontSize"]')?e="fontSize":o.matches('[data-input="fontWeight"]')?e="fontWeight":o.matches('[data-input="textAlign"]')?e="textAlign":o.matches('[data-input="shadowBlur"]')?e="shadowBlur":o.matches('[data-input="offsetY"]')?e="offsetY":o.matches('[data-input="offsetX"]')?e="offsetX":o.matches('[data-input="rotate"]')&&(e="rotate"),e&&t_(o,i,e)}),th.addEventListener("change",t=>{let e;let o=t.target,i=Number(o.closest('[data-section="textBox"]').getAttribute("data-index"));o.matches('[data-input="allCaps"]')&&(e="allCaps"),e&&t_(o,i,e)}),th.addEventListener("click",t=>{let e=t.target;if(e.matches('[data-button="settings"]')){let t=e.closest('[data-section="textBox"]').getAttribute("data-index");document.querySelectorAll('[data-section="textBox"]').forEach((e,o)=>{let i=e.querySelector('[data-section="settings"]');e.getAttribute("data-index")===t?(i.hidden=!i.hidden,tk[o]._isSettingsOpen=!tk[o]._isSettingsOpen):(i.hidden=!0,tk[o]._isSettingsOpen=!1)})}if(e.matches('[data-button="delete-text-box"]')){let t=Number(e.closest('[data-section="textBox"]').getAttribute("data-index")),o=!0;tk[t].text.trim()&&(o=window.confirm("Are you sure you want to remove this text box?")),o&&(tk=F(tk,t),th.querySelectorAll('[data-section="textBox"]').forEach(t=>t.remove()),tk.forEach((t,e)=>th.appendChild(Z(e,t))),tt(tx,ti,ts,tk))}}),th.addEventListener("pointerdown",t=>{let e=t.target;if(!e.closest('[data-section="textBox"]'))return;let o=Number(e.closest('[data-section="textBox"]').getAttribute("data-index")),i=e.matches('[data-move="offsetY"]'),a=e.matches('[data-move="offsetX"]');if(!i&&!a)return;let n=e.getAttribute("data-move"),s=e.getAttribute("data-sign");tA=requestAnimationFrame(tB(n,s,o))}),th.addEventListener("pointerup",t=>{let e=t.target,o=e.matches('[data-move="offsetY"]'),i=e.matches('[data-move="offsetX"]');(o||i)&&(cancelAnimationFrame(tA),tA=null)}),th.addEventListener("pointerout",t=>{let e=t.target,o=e.matches('[data-move="offsetY"]'),i=e.matches('[data-move="offsetX"]');(o||i)&&tA&&(cancelAnimationFrame(tA),tA=null)}),tr.addEventListener("change",t=>{tE.forEach(e=>e.hidden=e.id!==t.target.value)}),tf.addEventListener("click",tT),tv.addEventListener("input",t=>{let e=t.target.value.toLowerCase().trim();tf.querySelectorAll("button").forEach(t=>{let o=(t.querySelector("img").getAttribute("alt")||"").toLowerCase();t.hidden=!o.includes(e)}),ty.hidden=!!tf.querySelector("button:not([hidden])")}),tw.addEventListener("input",t=>{t.target===tw.canvasColor&&(tx=t.target.value),"string"==typeof tx&&(ti.width=Number(tw.canvasWidth.value)||600,ti.height=Number(tw.canvasHeight.value)||400,tt(tx,ti,ts,tk),tu.disabled=!1,ti.hidden=!1,tn.hidden=!0)}),document.addEventListener("web-share:error",()=>{to.open=!1,Q("There was an error while trying to share your meme.","danger")}),document.addEventListener("capture-photo:error",t=>{console.error(t.detail.error),Q(t.detail.error.message,"danger")}),document.addEventListener("capture-photo:success",t=>{te.open=!1;let e=new Image;e.addEventListener("load",tz),e.src=t.detail.dataURI}),document.addEventListener("me-open",t=>{if("videoModal"===t.target.id){let t=te.querySelector("capture-photo");t&&"function"==typeof t.startVideoStream&&t.startVideoStream()}}),document.addEventListener("me-close",t=>{if("videoModal"===t.target.id){let t=te.querySelector("capture-photo");t&&"function"==typeof t.stopVideoStream&&t.stopVideoStream()}}),tf.querySelectorAll("button > img")?.forEach(t=>{t.setAttribute("title",t.getAttribute("alt"))}),tk.forEach((t,e)=>{th.appendChild(Z(e,t))}),ta.accept=$,X.forEach(({name:t,path:e,style:o,weight:i})=>{J(t,e,{style:o,weight:i})})}(); -//# sourceMappingURL=index.2a3e2367.js.map +//# sourceMappingURL=index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,CAAC,EAAE,CAAmB,CAClC,IAAM,EAAwB,GAAW,aAAa,CAAC,iBAEnD,GAAyB,AAAiD,YAAjD,OAAO,EAAsB,eAAe,EACvE,EAAsB,eAAe,EAEzC,CACF,GAyBA,GAAU,gBAAgB,CAAC,iBAAiB,QAAQ,AAAA,IAClD,EAAM,YAAY,CAAC,QAAS,EAAM,YAAY,CAAC,OACjD,GAEA,GAAY,OAAO,CAAC,CAAC,EAAM,KACzB,GAAgB,WAAW,CAAC,AAAA,EAAc,EAAO,GACnD,GAEA,GAAW,MAAM,CAAG,EAEpB,AAAA,EAAY,OAAO,CAAC,CAAC,CAAA,KAAE,CAAI,CAAA,KAAE,CAAI,CAAA,MAAE,CAAK,CAAA,OAAE,CAAM,CAAE,IAChD,AAAA,EAAe,EAAM,EAAM,CAAE,MAAA,EAAO,OAAA,CAAO,EAC7C,E","sources":["","node_modules/@parcel/runtime-js/lib/helpers/bundle-manifest.js","node_modules/@parcel/runtime-js/lib/helpers/bundle-url.js","node_modules/@parcel/runtime-js/lib/runtime-0f4aac860c093f90.js","src/js/index.js","node_modules/@georapbox/web-share-element/dist/is-web-share-supported.js","node_modules/@georapbox/web-share-element/dist/","node_modules/@georapbox/web-share-element/dist/src/is-web-share-supported.js","node_modules/@georapbox/web-share-element/dist/web-share-defined.js","node_modules/@georapbox/web-share-element/dist/src/web-share-defined.js","node_modules/@georapbox/web-share-element/dist/src/web-share.js","node_modules/@georapbox/capture-photo-element/dist/capture-photo-defined.js","node_modules/@georapbox/capture-photo-element/dist/","node_modules/@georapbox/capture-photo-element/dist/src/capture-photo-defined.js","node_modules/@georapbox/capture-photo-element/dist/src/capture-photo.js","node_modules/@georapbox/capture-photo-element/dist/src/utils/clamp.js","node_modules/@georapbox/modal-element/dist/modal-element-defined.js","node_modules/@georapbox/modal-element/dist/","node_modules/@georapbox/modal-element/dist/src/modal-element-defined.js","node_modules/@georapbox/modal-element/dist/src/modal-element.js","node_modules/@georapbox/files-dropzone-element/dist/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/dist/","node_modules/@georapbox/files-dropzone-element/dist/src/files-dropzone-defined.js","node_modules/@georapbox/files-dropzone-element/dist/src/files-dropzone.js","node_modules/@georapbox/files-dropzone-element/dist/src/utils/is-valid-file.js","node_modules/@georapbox/files-dropzone-element/dist/src/utils/files-selector.js","src/js/utils/array-remove.js","src/js/utils/uid.js","src/js/constants.js","src/js/custom-fonts.js","node_modules/@parcel/runtime-js/lib/runtime-a1c2e9b10dbbde58.js","node_modules/@parcel/runtime-js/lib/runtime-d90b112f208fab9c.js","node_modules/@parcel/runtime-js/lib/runtime-8863d03da459b1d2.js","node_modules/@parcel/runtime-js/lib/runtime-7530982a5c34e2a8.js","node_modules/@parcel/runtime-js/lib/runtime-f6db6103a1a0ae20.js","node_modules/@parcel/runtime-js/lib/runtime-d668b18f4657778e.js","node_modules/@parcel/runtime-js/lib/runtime-9d4df09940169c58.js","node_modules/@parcel/runtime-js/lib/runtime-df220659d471ec24.js","node_modules/@parcel/runtime-js/lib/runtime-935f2ad29b2ba54a.js","node_modules/@parcel/runtime-js/lib/runtime-23720a89f55d1035.js","node_modules/@parcel/runtime-js/lib/runtime-180dcf6211e1516d.js","src/js/file-from-url.js","src/js/toast-alert.js","src/js/create-text-box.js","src/js/draw-canvas.js"],"sourcesContent":["(function () {\n\nfunction $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\n\nfunction $parcel$interopDefault(a) {\n return a && a.__esModule ? a.default : a;\n}\n\n var $parcel$global =\n typeof globalThis !== 'undefined'\n ? globalThis\n : typeof self !== 'undefined'\n ? self\n : typeof window !== 'undefined'\n ? window\n : typeof global !== 'undefined'\n ? global\n : {};\n \nvar $parcel$modules = {};\nvar $parcel$inits = {};\n\nvar parcelRequire = $parcel$global[\"parcelRequire5078\"];\n\nif (parcelRequire == null) {\n parcelRequire = function(id) {\n if (id in $parcel$modules) {\n return $parcel$modules[id].exports;\n }\n if (id in $parcel$inits) {\n var init = $parcel$inits[id];\n delete $parcel$inits[id];\n var module = {id: id, exports: {}};\n $parcel$modules[id] = module;\n init.call(module.exports, module, module.exports);\n return module.exports;\n }\n var err = new Error(\"Cannot find module '\" + id + \"'\");\n err.code = 'MODULE_NOT_FOUND';\n throw err;\n };\n\n parcelRequire.register = function register(id, init) {\n $parcel$inits[id] = init;\n };\n\n $parcel$global[\"parcelRequire5078\"] = parcelRequire;\n}\n\nvar parcelRegister = parcelRequire.register;\nparcelRegister(\"iE7OH\", function(module, exports) {\n\n$parcel$export(module.exports, \"register\", function () { return $0380ce8f1f064ccc$export$6503ec6e8aabbaf; }, function (v) { return $0380ce8f1f064ccc$export$6503ec6e8aabbaf = v; });\nvar $0380ce8f1f064ccc$export$6503ec6e8aabbaf;\nvar $0380ce8f1f064ccc$export$f7ad0328861e2f03;\n\"use strict\";\nvar $0380ce8f1f064ccc$var$mapping = new Map();\nfunction $0380ce8f1f064ccc$var$register(baseUrl, manifest) {\n for(var i = 0; i < manifest.length - 1; i += 2)$0380ce8f1f064ccc$var$mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n}\nfunction $0380ce8f1f064ccc$var$resolve(id) {\n var resolved = $0380ce8f1f064ccc$var$mapping.get(id);\n if (resolved == null) throw new Error(\"Could not resolve bundle with id \" + id);\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\n$0380ce8f1f064ccc$export$6503ec6e8aabbaf = $0380ce8f1f064ccc$var$register;\n$0380ce8f1f064ccc$export$f7ad0328861e2f03 = $0380ce8f1f064ccc$var$resolve;\n\n});\n\nparcelRegister(\"aNJCr\", function(module, exports) {\n\n$parcel$export(module.exports, \"getBundleURL\", function () { return $7dd1ddf6834435ca$export$bdfd709ae4826697; }, function (v) { return $7dd1ddf6834435ca$export$bdfd709ae4826697 = v; });\nvar $7dd1ddf6834435ca$export$bdfd709ae4826697;\nvar $7dd1ddf6834435ca$export$c9e73fbda7da57b6;\nvar $7dd1ddf6834435ca$export$5a759dc7a1cfb72a;\n\"use strict\";\nvar $7dd1ddf6834435ca$var$bundleURL = {};\nfunction $7dd1ddf6834435ca$var$getBundleURLCached(id) {\n var value = $7dd1ddf6834435ca$var$bundleURL[id];\n if (!value) {\n value = $7dd1ddf6834435ca$var$getBundleURL();\n $7dd1ddf6834435ca$var$bundleURL[id] = value;\n }\n return value;\n}\nfunction $7dd1ddf6834435ca$var$getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = (\"\" + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return $7dd1ddf6834435ca$var$getBaseURL(matches[2]);\n }\n return \"/\";\n}\nfunction $7dd1ddf6834435ca$var$getBaseURL(url) {\n return (\"\" + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, \"$1\") + \"/\";\n}\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction $7dd1ddf6834435ca$var$getOrigin(url) {\n var matches = (\"\" + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) throw new Error(\"Origin not found\");\n return matches[0];\n}\n$7dd1ddf6834435ca$export$bdfd709ae4826697 = $7dd1ddf6834435ca$var$getBundleURLCached;\n$7dd1ddf6834435ca$export$c9e73fbda7da57b6 = $7dd1ddf6834435ca$var$getBaseURL;\n$7dd1ddf6834435ca$export$5a759dc7a1cfb72a = $7dd1ddf6834435ca$var$getOrigin;\n\n});\n\nvar $137b868283288b39$exports = {};\n\n\n(parcelRequire(\"iE7OH\")).register((parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\"), JSON.parse('[\"8tAhj\",\"index.bc158aed.js\",\"cmj6F\",\"Anton-Regular.e58ab3fe.ttf\",\"a9OJN\",\"Oswald-Regular.89ec7d89.ttf\",\"jOuj0\",\"Oswald-Bold.0f6a7ca6.ttf\",\"ePq3V\",\"Roboto-Regular.ca197847.ttf\",\"9WQUU\",\"Roboto-Bold.fdb9b54a.ttf\",\"hIywO\",\"RobotoCondensed-Regular.d585f5c7.ttf\",\"ab1rw\",\"RobotoCondensed-Bold.e1f96d4b.ttf\",\"j4ruO\",\"CourierPrime-Regular.3a25a501.ttf\",\"3nnD2\",\"CourierPrime-Bold.3d6bf689.ttf\",\"8fsWK\",\"OpenSans-Regular.edf9e01b.ttf\",\"5JXG6\",\"OpenSans-Bold.8fceb72b.ttf\",\"9FH7D\",\"index.2d751096.css\"]'));\n\nfunction $94933cc6427541bd$export$c37129e465f64ef0(a) {\n return null !== a && \"object\" == typeof a ? \"share\" in navigator && \"canShare\" in navigator && navigator.canShare(a) : \"share\" in navigator;\n}\n\n\nObject.defineProperty({}, \"WebShare\", {\n get: function() {\n return $4f74a8126e204146$export$30b344bef3e55b67;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $4f74a8126e204146$var$t = `\n :host {\n display: inline-block;\n }\n`, $4f74a8126e204146$var$e = document.createElement(\"template\");\n$4f74a8126e204146$var$e.innerHTML = `\n \n \n`;\nclass $4f74a8126e204146$export$30b344bef3e55b67 extends HTMLElement {\n #t;\n #e;\n #s = [];\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\",\n delegatesFocus: !0\n }).appendChild($4f74a8126e204146$var$e.content.cloneNode(!0)), this.#t = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null, this.#e = this.#i();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n attributeChangedCallback(t, e, s) {\n \"disabled\" === t && e !== s && this.#e && (this.#e.toggleAttribute(\"disabled\", this.disabled), this.#e.setAttribute(\"aria-disabled\", this.disabled.toString()), this.#e.part && this.#e.part.contains(\"button\") && this.#e.part.toggle(\"button--disabled\", this.disabled));\n }\n connectedCallback() {\n this.#r(\"shareUrl\"), this.#r(\"shareTitle\"), this.#r(\"shareText\"), this.#r(\"shareFiles\"), this.#r(\"disabled\"), this.#t?.addEventListener(\"slotchange\", this.#a), this.#e?.addEventListener(\"click\", this.#n);\n }\n disconnectedCallback() {\n this.#t?.removeEventListener(\"slotchange\", this.#a), this.#e?.removeEventListener(\"click\", this.#n);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(t) {\n this.toggleAttribute(\"disabled\", !!t);\n }\n get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(t) {\n this.setAttribute(\"share-url\", t);\n }\n get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(t) {\n this.setAttribute(\"share-title\", t);\n }\n get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(t) {\n this.setAttribute(\"share-text\", t);\n }\n get shareFiles() {\n return this.#s;\n }\n set shareFiles(t) {\n Array.isArray(t) && t.length > 0 && (this.#s = t);\n }\n async share() {\n if (!this.disabled) try {\n let t = {};\n this.shareUrl && (t.url = this.shareUrl), this.shareTitle && (t.title = this.shareTitle), this.shareText && (t.text = this.shareText), Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n }) && (t.files = this.shareFiles), await navigator.share(t), this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: !0,\n composed: !0,\n detail: {\n shareData: t\n }\n }));\n } catch (t) {\n if (t instanceof Error && \"AbortError\" === t.name) {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n #n = (t)=>{\n t.preventDefault(), this.disabled || this.share();\n };\n #a = (t)=>{\n t.target && \"button\" === t.target.name && (this.#e?.removeEventListener(\"click\", this.#n), this.#e = this.#i(), this.#e && (this.#e.addEventListener(\"click\", this.#n), \"BUTTON\" === this.#e.nodeName || this.#e.hasAttribute(\"role\") || this.#e.setAttribute(\"role\", \"button\")));\n };\n #i() {\n return this.#t && this.#t.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"button\" === t.getAttribute(\"slot\")) || null;\n }\n #r(t) {\n if (Object.prototype.hasOwnProperty.call(this, t)) {\n let e = this[t];\n delete this[t], this[t] = e;\n }\n }\n static defineCustomElement(t = \"web-share\") {\n \"undefined\" == typeof window || window.customElements.get(t) || window.customElements.define(t, $4f74a8126e204146$export$30b344bef3e55b67);\n }\n}\n$4f74a8126e204146$export$30b344bef3e55b67.defineCustomElement();\n\n\nObject.defineProperty({}, \"CapturePhoto\", {\n get: function() {\n return $636b0cf1ed0b9f88$export$cc30a98fe3890794;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $636b0cf1ed0b9f88$var$t = (t, e, i)=>(Number.isNaN(e) && (e = 0), Number.isNaN(i) && (i = 0), Math.min(Math.max(t, Math.min(e, i)), Math.max(e, i))), $636b0cf1ed0b9f88$var$e = \"capture-photo\", $636b0cf1ed0b9f88$var$i = `\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`, $636b0cf1ed0b9f88$var$o = document.createElement(\"template\");\n$636b0cf1ed0b9f88$var$o.innerHTML = `\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\nclass $636b0cf1ed0b9f88$export$cc30a98fe3890794 extends HTMLElement {\n #t = {};\n #e = null;\n #i = null;\n #o = null;\n #n = null;\n #a = null;\n #s = null;\n #r = null;\n #l = null;\n constructor(){\n super(), this.#t = this.getSupportedConstraints(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($636b0cf1ed0b9f88$var$o.content.cloneNode(!0));\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"facing-mode\",\n \"camera-resolution\",\n \"pan\",\n \"tilt\",\n \"zoom\"\n ];\n }\n attributeChangedCallback(t, e, i) {\n if (!this.isConnected) return;\n let o = this.getTrackCapabilities(), n = this.getTrackSettings();\n if (\"no-image\" === t && e !== i && this.#u(), \"facing-mode\" === t && e !== i && \"facingMode\" in this.#t) {\n let t = [\n \"user\",\n \"environment\"\n ].includes(this.facingMode || \"\");\n \"facingMode\" in n && t && (this.stopVideoStream(), this.startVideoStream());\n }\n if (\"camera-resolution\" === t && e !== i && \"string\" == typeof this.cameraResolution && this.cameraResolution.trim().length > 0) {\n let [t = 0, e = 0] = this.cameraResolution.split(\"x\").map((t)=>Number(t));\n if (t > 0 && e > 0 && \"width\" in o && \"height\" in o) {\n let i = !!(o.width?.min && o.width?.max) && t >= o?.width?.min && t <= o?.width?.max, a = !!(o.height?.min && o.height?.max) && e >= o?.height?.min && e <= o?.height?.max;\n \"width\" in n && \"height\" in n && i && a && (this.stopVideoStream(), this.startVideoStream());\n }\n }\n if (\"pan\" === t && e !== i && \"pan\" in this.#t) {\n let t = !!(\"pan\" in o && o.pan?.min && o.pan?.max) && this.pan >= o.pan.min && this.pan <= o.pan.max;\n \"pan\" in n && \"number\" == typeof this.pan && t && this.#h(\"pan\", this.pan);\n }\n if (\"tilt\" === t && e !== i && \"tilt\" in this.#t) {\n let t = !!(\"tilt\" in o && o.tilt?.min && o.tilt?.max) && this.tilt >= o.tilt.min && this.tilt <= o.tilt.max;\n \"tilt\" in n && \"number\" == typeof this.tilt && t && this.#h(\"tilt\", this.tilt);\n }\n if (\"zoom\" === t && e !== i && \"zoom\" in this.#t) {\n let t = !!(\"zoom\" in o && o.zoom?.min && o.zoom?.max) && this.zoom >= o.zoom.min && this.zoom <= o.zoom.max;\n \"zoom\" in n && \"number\" == typeof this.zoom && t && this.#h(\"zoom\", this.zoom);\n }\n }\n connectedCallback() {\n if (this.#d(\"autpoPlay\"), this.#d(\"noImage\"), this.#d(\"facingMode\"), this.#d(\"cameraResolution\"), this.#d(\"pan\"), this.#d(\"tilt\"), this.#d(\"zoom\"), this.#d(\"calculateFileSize\"), this.#i = this.shadowRoot?.querySelector(\"canvas\") || null, this.#o = this.shadowRoot?.getElementById(\"output\") || null, this.#n = this.shadowRoot?.querySelector(\"video\") || null, this.#a = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null, this.#s = this.#c(), this.#r = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null, this.#l = this.#m(), this.#n?.addEventListener(\"loadedmetadata\", this.#p), this.#a?.addEventListener(\"slotchange\", this.#g), this.#s?.addEventListener(\"click\", this.#b), this.#r?.addEventListener(\"slotchange\", this.#f), this.#l?.addEventListener(\"click\", this.#v), !$636b0cf1ed0b9f88$export$cc30a98fe3890794.isSupported()) return this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n this.autoPlay && this.startVideoStream();\n }\n disconnectedCallback() {\n this.stopVideoStream(), this.#l?.removeEventListener(\"click\", this.#v), this.#s?.removeEventListener(\"click\", this.#b), this.#n?.removeEventListener(\"canplay\", this.#p), this.#a?.removeEventListener(\"slotchange\", this.#g), this.#r?.removeEventListener(\"slotchange\", this.#f);\n }\n get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(t) {\n this.toggleAttribute(\"auto-play\", !!t);\n }\n get noImage() {\n return this.hasAttribute(\"no-image\");\n }\n set noImage(t) {\n this.toggleAttribute(\"no-image\", !!t);\n }\n get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(t) {\n this.setAttribute(\"facing-mode\", t);\n }\n get cameraResolution() {\n return this.getAttribute(\"camera-resolution\") || \"\";\n }\n set cameraResolution(t) {\n this.setAttribute(\"camera-resolution\", t);\n }\n get pan() {\n return Number(this.getAttribute(\"pan\")) || 0;\n }\n set pan(t) {\n this.setAttribute(\"pan\", null != t ? t.toString() : t);\n }\n get tilt() {\n return Number(this.getAttribute(\"tilt\")) || 0;\n }\n set tilt(t) {\n this.setAttribute(\"tilt\", null != t ? t.toString() : t);\n }\n get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(t) {\n this.setAttribute(\"zoom\", null != t ? t.toString() : t);\n }\n get loading() {\n return this.hasAttribute(\"loading\");\n }\n get calculateFileSize() {\n return this.hasAttribute(\"calculate-file-size\");\n }\n set calculateFileSize(t) {\n this.toggleAttribute(\"calculate-file-size\", !!t);\n }\n #v = (t)=>{\n t.preventDefault(), this.loading || (this.facingMode = \"user\" !== this.facingMode && this.facingMode ? \"user\" : \"environment\");\n };\n #b = (t)=>{\n t.preventDefault(), this.capture();\n };\n #p = (t)=>{\n let i = t.target;\n i.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:video-play`, {\n bubbles: !0,\n composed: !0,\n detail: {\n video: i\n }\n }));\n }).catch((t)=>{\n this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n #u() {\n this.#o && Array.from(this.#o.childNodes).forEach((t)=>t.remove());\n }\n #h(e, i) {\n if (!this.#e || !e || !i) return;\n let [o] = this.#e.getVideoTracks(), n = this.getTrackCapabilities();\n e in this.getTrackSettings() && o.applyConstraints({\n advanced: [\n {\n [e]: $636b0cf1ed0b9f88$var$t(Number(i), n[e]?.min || 1, n[e]?.max || 1)\n }\n ]\n });\n }\n #g = (t)=>{\n t.target?.name === \"capture-button\" && (this.#s?.removeEventListener(\"click\", this.#b), this.#s = this.#c(), this.#s && (this.#s.addEventListener(\"click\", this.#b), \"BUTTON\" === this.#s.nodeName || this.#s.hasAttribute(\"role\") || this.#s.setAttribute(\"role\", \"button\")));\n };\n #f = (t)=>{\n t.target?.name === \"facing-mode-button\" && (this.#l?.removeEventListener(\"click\", this.#v), this.#l = this.#m(), this.#l && (this.#l.addEventListener(\"click\", this.#v), \"BUTTON\" === this.#l.nodeName || this.#l.hasAttribute(\"role\") || this.#l.setAttribute(\"role\", \"button\")));\n };\n #m() {\n return this.#r && this.#r.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"facing-mode-button\" === t.getAttribute(\"slot\")) || null;\n }\n #c() {\n return this.#a && this.#a.assignedElements({\n flatten: !0\n }).find((t)=>\"BUTTON\" === t.nodeName || \"capture-button\" === t.getAttribute(\"slot\")) || null;\n }\n #d(t) {\n if (Object.prototype.hasOwnProperty.call(this, t)) {\n let e = this[t];\n delete this[t], this[t] = e;\n }\n }\n async startVideoStream() {\n if (!$636b0cf1ed0b9f88$export$cc30a98fe3890794.isSupported() || this.#e) return;\n this.setAttribute(\"loading\", \"\");\n let t = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: !0,\n tilt: !0,\n zoom: !0\n },\n audio: !1\n };\n if (\"string\" == typeof this.cameraResolution && this.cameraResolution.trim().length > 0) {\n let [e = 0, i = 0] = this.cameraResolution.split(\"x\").map((t)=>Number(t));\n e > 0 && i > 0 && (t.video.width = e, t.video.height = i);\n }\n try {\n this.#e = await navigator.mediaDevices.getUserMedia(t), this.#n && (this.#n.srcObject = this.#e), this.#h(\"pan\", this.pan), this.#h(\"tilt\", this.tilt), this.#h(\"zoom\", this.zoom);\n let e = this.getTrackSettings();\n \"facingMode\" in e && this.#r && (this.#r.hidden = !1);\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n stopVideoStream() {\n if (!this.#n || !this.#e) return;\n let [t] = this.#e.getVideoTracks();\n t?.stop(), this.#n.srcObject = null, this.#e = null;\n }\n async capture() {\n if (!this.loading && this.#i && this.#n) try {\n let t = this.#i.getContext(\"2d\"), i = this.#n.videoWidth, o = this.#n.videoHeight;\n this.#i.width = i, this.#i.height = o, t?.drawImage(this.#n, 0, 0, i, o);\n let n = this.#i.toDataURL(\"image/png\");\n if (\"string\" == typeof n && n.includes(\"data:image\")) {\n if (!this.noImage) {\n let t = new Image;\n t.src = n, t.width = i, t.height = o, t.setAttribute(\"part\", \"output-image\"), this.#u(), this.#o?.appendChild(t);\n }\n let t = {\n dataURI: n,\n width: i,\n height: o\n };\n if (this.calculateFileSize) try {\n let e = await fetch(n), i = (await e.blob()).size;\n i && (t.size = i);\n } catch (t) {}\n this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:success`, {\n bubbles: !0,\n composed: !0,\n detail: t\n }));\n }\n } catch (t) {\n this.dispatchEvent(new CustomEvent(`${$636b0cf1ed0b9f88$var$e}:error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: t\n }\n }));\n }\n }\n getSupportedConstraints() {\n return $636b0cf1ed0b9f88$export$cc30a98fe3890794.isSupported() && navigator.mediaDevices.getSupportedConstraints() || {};\n }\n getTrackCapabilities() {\n if (!this.#e) return {};\n let [t] = this.#e.getVideoTracks();\n return t && \"function\" == typeof t.getCapabilities && t.getCapabilities() || {};\n }\n getTrackSettings() {\n if (!this.#e) return {};\n let [t] = this.#e.getVideoTracks();\n return t && \"function\" == typeof t.getSettings && t.getSettings() || {};\n }\n static isSupported() {\n return !!navigator.mediaDevices?.getUserMedia;\n }\n static defineCustomElement(t = $636b0cf1ed0b9f88$var$e) {\n \"undefined\" == typeof window || window.customElements.get(t) || window.customElements.define(t, $636b0cf1ed0b9f88$export$cc30a98fe3890794);\n }\n}\n$636b0cf1ed0b9f88$export$cc30a98fe3890794.defineCustomElement();\n\n\nObject.defineProperty({}, \"ModalElement\", {\n get: function() {\n return $4da30046ce6d9325$export$32589115725b904b;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $4da30046ce6d9325$var$e = document.createElement(\"template\");\n$4da30046ce6d9325$var$e.innerHTML = /* html */ `\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`; /**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */ \nclass $4da30046ce6d9325$export$32589115725b904b extends HTMLElement {\n #e = null;\n #t = null;\n #o = void 0;\n constructor(){\n if (super(), !this.shadowRoot) {\n let t = this.attachShadow({\n mode: \"open\"\n });\n t.appendChild($4da30046ce6d9325$var$e.content.cloneNode(!0));\n }\n this.shadowRoot && (this.#e = this.shadowRoot.querySelector(\"dialog\"), this.#t = this.shadowRoot.querySelector('slot[name=\"footer\"]'));\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\"\n ];\n }\n attributeChangedCallback(e, t, o) {\n if (null !== this.#e) {\n if (\"open\" === e && t !== o && (this.open ? (this.#e.showModal(), document.body && (document.body.style.overflowY = \"hidden\"), this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n }))) : this.#e.close()), \"no-header\" === e && t !== o) {\n let e = this.#e.querySelector(\".dialog__header\");\n null !== e && (e.hidden = this.noHeader);\n }\n if (\"no-animations\" === e && t !== o && this.#e.classList.toggle(\"dialog--no-animations\", this.noAnimations), \"no-close-button\" === e && t !== o) {\n let e = this.#e.querySelector(\".dialog__close\");\n null !== e && (e.hidden = this.noCloseButton);\n }\n }\n }\n connectedCallback() {\n this.#i(\"open\"), this.#i(\"staticBackdrop\"), this.#i(\"noHeader\"), this.#i(\"noAnimations\"), this.#i(\"noCloseButton\"), this.#i(\"fullscreen\"), this.#e?.addEventListener(\"click\", this.#a), this.#e?.addEventListener(\"close\", this.#l), this.#e?.addEventListener(\"cancel\", this.#s), this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#n), this.#t?.addEventListener(\"slotchange\", this.#r);\n }\n disconnectedCallback() {\n this.#o && clearTimeout(this.#o), this.#e?.addEventListener(\"click\", this.#a), this.#e?.removeEventListener(\"close\", this.#l), this.#e?.removeEventListener(\"cancel\", this.#s), this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#n), this.#t?.removeEventListener(\"slotchange\", this.#r);\n }\n get open() {\n return this.hasAttribute(\"open\");\n }\n set open(e) {\n e ? this.setAttribute(\"open\", \"\") : this.removeAttribute(\"open\");\n }\n get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(e) {\n e ? this.setAttribute(\"static-backdrop\", \"\") : this.removeAttribute(\"static-backdrop\");\n }\n get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(e) {\n e ? this.setAttribute(\"no-header\", \"\") : this.removeAttribute(\"no-header\");\n }\n get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(e) {\n e ? this.setAttribute(\"no-animations\", \"\") : this.removeAttribute(\"no-animations\");\n }\n get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(e) {\n e ? this.setAttribute(\"no-close-button\", \"\") : this.removeAttribute(\"no-close-button\");\n }\n get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(e) {\n e ? this.setAttribute(\"fullscreen\", \"\") : this.removeAttribute(\"fullscreen\");\n }\n #d() {\n this.#o || (this.#e?.classList.add(\"dialog--pulse\"), this.#o = setTimeout(()=>{\n this.#e?.classList.remove(\"dialog--pulse\"), clearTimeout(this.#o), this.#o = void 0;\n }, 300));\n }\n #l = ()=>{\n // the open property when the dialog is closed by the user.\n this.open = !1, document.body && (document.body.style.overflowY = \"\"), this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: !0,\n composed: !0,\n detail: {\n element: this\n }\n }));\n };\n #s = (e)=>{\n let t = this.#c(\"escape-key\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), this.noAnimations || this.#d());\n };\n #n = (e)=>{\n let t = this.#c(\"close-button\");\n this.dispatchEvent(t), t.defaultPrevented && (e.preventDefault(), this.noAnimations || this.#d());\n };\n #a = (e)=>{\n if (e.target !== e.currentTarget) return;\n let t = this.#c(\"backdrop-click\");\n if (this.dispatchEvent(t), t.defaultPrevented || this.staticBackdrop) {\n this.noAnimations || this.#d();\n return;\n }\n this.#e?.close();\n };\n #r = ()=>{\n if (null === this.#e) return; /** @type {Nullable} */ \n let e = this.#e.querySelector(\".dialog__footer\");\n if (null === e) return;\n let t = this.#t?.assignedNodes(), o = !!t && t.length > 0;\n e.hidden = !o;\n };\n #c(e) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: !0,\n composed: !0,\n cancelable: !0,\n detail: {\n reason: e,\n element: this\n }\n });\n }\n #i(e) {\n if (Object.prototype.hasOwnProperty.call(this, e)) {\n let t = this[e];\n delete this[e], this[e] = t;\n }\n }\n show() {\n this.open || (this.open = !0);\n }\n hide() {\n this.open && (this.open = !1);\n }\n static defineCustomElement(e = \"modal-element\") {\n \"undefined\" == typeof window || window.customElements.get(e) || window.customElements.define(e, $4da30046ce6d9325$export$32589115725b904b);\n }\n}\n$4da30046ce6d9325$export$32589115725b904b.defineCustomElement();\n //# sourceMappingURL=modal-element-defined.js.map\n\n\nObject.defineProperty({}, \"FilesDropzone\", {\n get: function() {\n return $7aad62ebc3d6fae8$export$6ccd1735166caad9;\n },\n set: void 0,\n enumerable: !0,\n configurable: !0\n});\nlet $7aad62ebc3d6fae8$var$e = new Map([\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]), $7aad62ebc3d6fae8$var$t = [\n \".DS_Store\",\n \"Thumbs.db\"\n], $7aad62ebc3d6fae8$var$o = (t)=>{\n let { name: o } = t;\n if (o && -1 !== o.lastIndexOf(\".\") && !t.type) {\n let i = (o.split(\".\").pop() || \"\").toLowerCase(), r = $7aad62ebc3d6fae8$var$e.get(i);\n r && Object.defineProperty(t, \"type\", {\n value: r,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return t;\n}, $7aad62ebc3d6fae8$var$i = (e, t)=>{\n let i = $7aad62ebc3d6fae8$var$o(e);\n if (\"string\" != typeof i.path) {\n let { webkitRelativePath: o } = e;\n Object.defineProperty(i, \"path\", {\n value: \"string\" == typeof t ? t : o || e.name,\n writable: !1,\n configurable: !1,\n enumerable: !0\n });\n }\n return i;\n}, $7aad62ebc3d6fae8$var$r = async (e)=>await new Promise((t, o)=>{\n e.readEntries(t, o);\n }), $7aad62ebc3d6fae8$var$a = async (e)=>{\n let t = [], o = await $7aad62ebc3d6fae8$var$r(e);\n for(; o.length > 0;)t.push(...o), o = await $7aad62ebc3d6fae8$var$r(e);\n return t;\n}, $7aad62ebc3d6fae8$var$n = (e)=>new Promise((t, o)=>{\n e.file((o)=>t($7aad62ebc3d6fae8$var$i(o, e.fullPath)), o);\n }), $7aad62ebc3d6fae8$var$s = async (e)=>{\n let o = [], i = [];\n for (let t of e){\n if (\"file\" !== t.kind) continue;\n let e = t.getAsEntry ? t.getAsEntry() : t.webkitGetAsEntry();\n i.push(e);\n }\n for(; i.length > 0;){\n let e = i.shift();\n if (e) {\n if (e.isFile) {\n let i = await $7aad62ebc3d6fae8$var$n(e);\n -1 === $7aad62ebc3d6fae8$var$t.indexOf(i.name) && o.push(i);\n } else e.isDirectory && i.push(...await $7aad62ebc3d6fae8$var$a(e.createReader()));\n }\n }\n return o;\n}, $7aad62ebc3d6fae8$var$d = async (e)=>{\n let o = [];\n for (let r of e)-1 === $7aad62ebc3d6fae8$var$t.indexOf(r.name) && o.push($7aad62ebc3d6fae8$var$i(r));\n return o;\n}, $7aad62ebc3d6fae8$var$l = async (e)=>e.dataTransfer ? e.dataTransfer.items ? await $7aad62ebc3d6fae8$var$s(e.dataTransfer.items) : await $7aad62ebc3d6fae8$var$d(e.dataTransfer.files) : await $7aad62ebc3d6fae8$var$d(e.target.files), $7aad62ebc3d6fae8$var$p = \"files-dropzone\", $7aad62ebc3d6fae8$var$c = \"TOO_MANY_FILES\", $7aad62ebc3d6fae8$var$h = document.createElement(\"template\"), $7aad62ebc3d6fae8$var$u = `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$7aad62ebc3d6fae8$var$h.innerHTML = `\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\nclass $7aad62ebc3d6fae8$export$6ccd1735166caad9 extends HTMLElement {\n #e = null;\n #t = null;\n constructor(){\n super(), this.shadowRoot || this.attachShadow({\n mode: \"open\"\n }).appendChild($7aad62ebc3d6fae8$var$h.content.cloneNode(!0)), this.shadowRoot && (this.#e = this.shadowRoot.getElementById(\"fileInput\"), this.#t = this.shadowRoot.getElementById(\"dropzoneEl\"));\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\",\n \"no-keyboard\"\n ];\n }\n attributeChangedCallback(e, t, o) {\n \"accept\" === e && t !== o && this.#e && (this.#e.accept = this.accept), \"disabled\" === e && t !== o && this.#e && (this.#e.disabled = this.disabled, this.disabled ? this.#t?.removeAttribute(\"tabindex\") : this.#t?.setAttribute(\"tabindex\", \"0\")), \"multiple\" === e && t !== o && this.#e && (this.#e.multiple = this.multiple), \"no-keyboard\" === e && t !== o && this.#t && (this.noKeyboard ? this.#t.removeAttribute(\"tabindex\") : this.#t.setAttribute(\"tabindex\", \"0\"));\n }\n connectedCallback() {\n this.#o(\"accept\"), this.#o(\"disabled\"), this.#o(\"maxFiles\"), this.#o(\"maxSize\"), this.#o(\"minSize\"), this.#o(\"multiple\"), this.#o(\"noClick\"), this.#o(\"noDrag\"), this.#o(\"noKeyboard\"), this.#o(\"autoFocus\"), this.#o(\"noStyle\"), this.#e?.addEventListener(\"change\", this.#i), this.#t?.addEventListener(\"dragenter\", this.#r), this.#t?.addEventListener(\"dragover\", this.#a), this.#t?.addEventListener(\"dragleave\", this.#n), this.#t?.addEventListener(\"drop\", this.#s), this.#t?.addEventListener(\"click\", this.#d), this.#t?.addEventListener(\"keyup\", this.#l), this.autoFocus && this.#t?.focus();\n }\n disconnectedCallback() {\n this.#e?.removeEventListener(\"change\", this.#i), this.#t?.removeEventListener(\"dragenter\", this.#r), this.#t?.removeEventListener(\"dragover\", this.#a), this.#t?.removeEventListener(\"dragleave\", this.#n), this.#t?.removeEventListener(\"drop\", this.#s), this.#t?.removeEventListener(\"click\", this.#d), this.#t?.removeEventListener(\"keyup\", this.#l);\n }\n get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(e) {\n this.setAttribute(\"accept\", null != e ? e.toString() : e);\n }\n get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(e) {\n this.toggleAttribute(\"disabled\", !!e);\n }\n get maxFiles() {\n let e = Number(this.getAttribute(\"max-files\")) || 0;\n return e <= 0 ? 1 / 0 : Math.floor(Math.abs(e));\n }\n set maxFiles(e) {\n this.setAttribute(\"max-files\", null != e ? e.toString() : e);\n }\n get maxSize() {\n let e = this.getAttribute(\"max-size\");\n if (null === e) return 1 / 0;\n let t = Number(e);\n return Number.isNaN(t) ? 1 / 0 : t;\n }\n set maxSize(e) {\n this.setAttribute(\"max-size\", null != e ? e.toString() : e);\n }\n get minSize() {\n let e = this.getAttribute(\"min-size\");\n if (null === e) return 0;\n let t = Number(e);\n return Number.isNaN(t) ? 0 : t;\n }\n set minSize(e) {\n this.setAttribute(\"min-size\", null != e ? e.toString() : e);\n }\n get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(e) {\n this.toggleAttribute(\"multiple\", !!e);\n }\n get noClick() {\n return this.hasAttribute(\"no-click\");\n }\n set noClick(e) {\n this.toggleAttribute(\"no-click\", !!e);\n }\n get noDrag() {\n return this.hasAttribute(\"no-drag\");\n }\n set noDrag(e) {\n this.toggleAttribute(\"no-drag\", !!e);\n }\n get noKeyboard() {\n return this.hasAttribute(\"no-keyboard\");\n }\n set noKeyboard(e) {\n this.toggleAttribute(\"no-keyboard\", !!e);\n }\n get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(e) {\n this.toggleAttribute(\"auto-focus\", !!e);\n }\n get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(e) {\n this.toggleAttribute(\"no-style\", !!e);\n }\n #i = async (e)=>{\n try {\n this.#p(await $7aad62ebc3d6fae8$var$l(e));\n } catch (e) {\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$p}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: e\n }\n }));\n }\n };\n #r = ()=>{\n this.disabled || this.noDrag || this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$p}-dragenter`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #a = (e)=>{\n if (e.preventDefault(), this.disabled || this.noDrag) {\n e.dataTransfer.dropEffect = \"none\";\n return;\n }\n e.dataTransfer.dropEffect = \"copy\", this.#t && (this.#t.classList.add(\"dropzone--dragover\"), this.#t.part.add(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$p}-dragover`, {\n bubbles: !0,\n composed: !0\n }));\n };\n #n = ()=>{\n this.disabled || this.noDrag || (this.#t && (this.#t.classList.remove(\"dropzone--dragover\"), this.#t.part.remove(\"dropzone--dragover\")), this.dispatchEvent(new Event(`${$7aad62ebc3d6fae8$var$p}-dragleave`, {\n bubbles: !0,\n composed: !0\n })));\n };\n #s = async (e)=>{\n if (!this.disabled && !this.noDrag) {\n e.preventDefault(), this.#t && (this.#t.classList.remove(\"dropzone--dragover\"), this.#t.part.remove(\"dropzone--dragover\"));\n try {\n this.#p(await $7aad62ebc3d6fae8$var$l(e));\n } catch (e) {\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$p}-error`, {\n bubbles: !0,\n composed: !0,\n detail: {\n error: e\n }\n }));\n }\n }\n };\n #d = ()=>{\n this.disabled || this.noClick || this.#e?.click();\n };\n #l = (e)=>{\n this.disabled || this.noKeyboard || \" \" !== e.key && \"Enter\" !== e.key || this.#e?.click();\n };\n #p(e) {\n if (!Array.isArray(e) || !e.length) return;\n let t = [], o = [], i = e.length;\n if (!this.multiple && i > 1) for (let t of e)o.push({\n file: t,\n errors: [\n {\n code: $7aad62ebc3d6fae8$var$c,\n message: \"Too many files selected. Only 1 file is allowed.\"\n }\n ]\n });\n else if (this.multiple && i > this.maxFiles) for (let t of e)o.push({\n file: t,\n errors: [\n {\n code: $7aad62ebc3d6fae8$var$c,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else for (let i of e){\n let e = function(e, t = \"\") {\n if (!t) return !0;\n let o = [\n ...new Set(t.split(\",\").map((e)=>e.trim()).filter(Boolean))\n ], i = e.type, r = i.replace(/\\/.*$/, \"\");\n for (let t of o)if (\".\" === t.charAt(0)) {\n if (-1 !== e.name.toLowerCase().indexOf(t.toLowerCase(), e.name.length - t.length)) return !0;\n } else if (/\\/\\*$/.test(t)) {\n if (r === t.replace(/\\/.*$/, \"\")) return !0;\n } else if (i === t) return !0;\n return !1;\n }(i, this.accept), r = i.size > this.maxSize, a = i.size < this.minSize;\n if (!e || r || a) {\n let t = [];\n e || t.push({\n code: \"INVALID_MIME_TYPE\",\n message: `File type \"${i.type}\" is not accepted.`\n }), r && t.push({\n code: \"FILE_TOO_LARGE\",\n message: `File size ${i.size} exceeds the maximum size of ${this.maxSize}.`\n }), a && t.push({\n code: \"FILE_TOO_SMALL\",\n message: `File size ${i.size} is smaller than the minimum size of ${this.minSize}.`\n }), o.push({\n file: i,\n errors: t\n });\n } else t.push(i);\n }\n this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$p}-drop`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t,\n rejectedFiles: o\n }\n })), t.length > 0 && this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$p}-drop-accepted`, {\n bubbles: !0,\n composed: !0,\n detail: {\n acceptedFiles: t\n }\n })), o.length > 0 && this.dispatchEvent(new CustomEvent(`${$7aad62ebc3d6fae8$var$p}-drop-rejected`, {\n bubbles: !0,\n composed: !0,\n detail: {\n rejectedFiles: o\n }\n })), this.#e && (this.#e.value = this.#e.defaultValue);\n }\n openFileDialog() {\n this.disabled || this.#e?.click();\n }\n #o(e) {\n if (Object.prototype.hasOwnProperty.call(this, e)) {\n let t = this[e];\n delete this[e], this[e] = t;\n }\n }\n static defineCustomElement(e = $7aad62ebc3d6fae8$var$p) {\n \"undefined\" == typeof window || window.customElements.get(e) || window.customElements.define(e, $7aad62ebc3d6fae8$export$6ccd1735166caad9);\n }\n}\n$7aad62ebc3d6fae8$export$6ccd1735166caad9.defineCustomElement();\n\n\n\n\n/**\n * Removes one or more elements from an array at the specified index(es).\n *\n * @param {Array} array The initial array to remove elements from.\n * @param {Number} ...indexes The index(es) of the elements to be removed. Non numbers are ignored.\n * @throws {TypeError} If `array` is not array.\n * @returns {Array} The result array with the elements specified removed.\n * @example\n *\n * const arr = [1, 2, 3, 4, 5];\n *\n * remove(arr, 0);\n * // => [2, 3, 4, 5]\n *\n * remove(arr, 0, 1);\n * // => [3, 4, 5]\n *\n * remove(arr, 0, 4);\n * // => [2, 3, 4]\n *\n * remove(arr);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length - 1);\n * // => [1, 2, 3, 4]\n *\n * remove(arr, NaN);\n * // => [1, 2, 3, 4, 5]\n */ const $5742c9e143620cb1$export$30a014203d0d7e4f = (array, ...indexes)=>{\n if (!Array.isArray(array)) throw new TypeError(\"Expected an array for first argument\");\n return array.filter((_, i)=>indexes.indexOf(i) === -1);\n};\n\n\n/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */ const $21c3f3a8dccfa4fd$export$e2a22331486dcca0 = (prefix = \"\", suffix = \"\")=>{\n const prefixString = typeof prefix === \"string\" && prefix !== \"\" ? prefix + \"-\" : \"\";\n const suffixString = typeof suffix === \"string\" && suffix !== \"\" ? \"-\" + suffix : \"\";\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n return `${prefixString}${randomString}${suffixString}`;\n};\n\n\nconst $33dea9d9a6da4c9a$export$63e7bed68b07a85c = [\n \"image/jpg\",\n \"image/jpeg\",\n \"image/png\",\n \"image/apng\",\n \"image/gif\",\n \"image/webp\",\n \"image/avif\"\n];\n\n\nvar $b9a1dffffdf320f2$exports = {};\n\n$b9a1dffffdf320f2$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"Anton-Regular.e58ab3fe.ttf\";\n\n\nvar $6f8f0ad93b4f4fec$exports = {};\n\n$6f8f0ad93b4f4fec$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"Oswald-Regular.89ec7d89.ttf\";\n\n\nvar $60f12aeb358e1d01$exports = {};\n\n$60f12aeb358e1d01$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"Oswald-Bold.0f6a7ca6.ttf\";\n\n\nvar $b312cc3e2ac443c7$exports = {};\n\n$b312cc3e2ac443c7$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"Roboto-Regular.ca197847.ttf\";\n\n\nvar $481315e8ee95f8f9$exports = {};\n\n$481315e8ee95f8f9$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"Roboto-Bold.fdb9b54a.ttf\";\n\n\nvar $7cee0a691e2711a6$exports = {};\n\n$7cee0a691e2711a6$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"RobotoCondensed-Regular.d585f5c7.ttf\";\n\n\nvar $12b7043e62e67366$exports = {};\n\n$12b7043e62e67366$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"RobotoCondensed-Bold.e1f96d4b.ttf\";\n\n\nvar $f224edc54658ebde$exports = {};\n\n$f224edc54658ebde$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"CourierPrime-Regular.3a25a501.ttf\";\n\n\nvar $33ce2f42587a9c55$exports = {};\n\n$33ce2f42587a9c55$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"CourierPrime-Bold.3d6bf689.ttf\";\n\n\nvar $1375393a097acb0e$exports = {};\n\n$1375393a097acb0e$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"OpenSans-Regular.edf9e01b.ttf\";\n\n\nvar $728f6ce83c7b6e27$exports = {};\n\n$728f6ce83c7b6e27$exports = (parcelRequire(\"aNJCr\")).getBundleURL(\"8tAhj\") + \"OpenSans-Bold.8fceb72b.ttf\";\n\n\nconst $055531bbd0af154c$export$6874249d87f2602a = [\n {\n name: \"Anton\",\n label: \"Anton\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($b9a1dffffdf320f2$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Oswald-Regular\",\n label: \"Oswald\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($6f8f0ad93b4f4fec$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Oswald-Bold\",\n label: \"Oswald Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($60f12aeb358e1d01$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"Roboto-Regular\",\n label: \"Roboto\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($b312cc3e2ac443c7$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"Roboto-Bold\",\n label: \"Roboto Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($481315e8ee95f8f9$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"RobotoCondensed-Regular\",\n label: \"Roboto Condensed\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($7cee0a691e2711a6$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"RobotoCondensed-Bold\",\n label: \"Roboto Condensed Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($12b7043e62e67366$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"CourierPrime-Regular\",\n label: \"Courier Prime\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($f224edc54658ebde$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"CourierPrime-Bold\",\n label: \"Courier Prime Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($33ce2f42587a9c55$exports))),\n style: \"normal\",\n weight: \"700\"\n },\n {\n name: \"OpenSans-Regular\",\n label: \"Open Sans\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($1375393a097acb0e$exports))),\n style: \"normal\",\n weight: \"400\"\n },\n {\n name: \"OpenSans-Bold\",\n label: \"Open Sans Bold\",\n path: (0, (/*@__PURE__*/$parcel$interopDefault($728f6ce83c7b6e27$exports))),\n style: \"normal\",\n weight: \"400\"\n }\n];\nconst $055531bbd0af154c$export$59eceaef0c7797b2 = async (name, path, options = {})=>{\n try {\n const font = new FontFace(name, `url(${path})`, {\n ...options\n });\n await font.load();\n document.fonts.add(font);\n } catch (err) {\n console.error(err);\n }\n};\n\n\n\nconst $008970865eefc93d$export$6539e087749cf9d3 = async (options = {})=>{\n const res = await fetch(options.url);\n const blob = await res.blob();\n const mimeType = options.mimeType || blob.type || \"\";\n if (!(0, $33dea9d9a6da4c9a$export$63e7bed68b07a85c).includes(mimeType)) throw new Error(`This is not an accepted image format. Accepted MIME types are: ${(0, $33dea9d9a6da4c9a$export$63e7bed68b07a85c).join(\", \")}`);\n return new File([\n blob\n ], options.filename || \"\", blob);\n};\n\n\nconst $166cfb2484b08c80$var$errorsContainer = document.getElementById(\"errorsContainer\");\nconst $166cfb2484b08c80$var$hideError = (evt)=>{\n const target = evt.currentTarget;\n target.removeEventListener(\"click\", $166cfb2484b08c80$var$hideError);\n $166cfb2484b08c80$var$errorsContainer.removeChild(target.parentNode);\n};\nconst $166cfb2484b08c80$export$af04143326425dbd = (message = \"\", type = \"info\")=>{\n const types = [\n \"info\",\n \"warning\",\n \"danger\"\n ];\n if (!types.includes(type)) type = \"info\";\n const template = /* html */ `\n ${message}\n \n `;\n const div = document.createElement(\"div\");\n div.className = `alert alert-${type} alert-dismissible text-break mb-2 fade`;\n div.innerHTML = template;\n div.querySelector(\"button\").addEventListener(\"click\", $166cfb2484b08c80$var$hideError);\n $166cfb2484b08c80$var$errorsContainer.appendChild(div);\n setTimeout(()=>div.classList.add(\"show\"), 100);\n};\n\n\n\nconst $50a37fdc18d479c2$export$293a4b86a6fe2398 = (index, data = {})=>{\n const inputTemplate = /* html */ `\n
\n \n\n \n\n
\n \n \n \n
\n
\n\n
\n
\n
\n \n\n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n \n \n \n \n
\n
\n
\n\n
\n
\n
\n \n \n
\n
\n
\n
\n `;\n const fragment = document.createDocumentFragment();\n const div = document.createElement(\"div\");\n div.className = \"bg-light border shadow-sm mb-3 rounded\";\n div.setAttribute(\"data-section\", \"textBox\");\n div.setAttribute(\"data-index\", index);\n div.innerHTML = inputTemplate;\n div.querySelector('[data-input=\"font\"]').value = data.font;\n div.querySelector('[data-input=\"textAlign\"]').value = data.textAlign;\n div.querySelector('[data-input=\"allCaps\"]').checked = data.allCaps;\n return fragment.appendChild(div);\n};\n\n\nconst $d346fdc99aed49b3$export$e653a2de0f3a8b89 = (image, canvas, ctx, textOptions = [])=>{\n if (image == null) return;\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n if (typeof image === \"string\") {\n ctx.fillStyle = image;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n } else ctx.drawImage(image, 0, 0, canvas.width, canvas.height);\n textOptions.forEach(function(item, index) {\n ctx.font = `${item.fontWeight} ${item.fontSize}px ${item.font}`;\n const multiplier = index + 1;\n const lineHeight = ctx.measureText(\"M\").width + item.fontSize / 2;\n const xPos = canvas.width / 2;\n const shadowBlur = item.shadowBlur;\n const text = item.allCaps === true ? item.text.toUpperCase() : item.text;\n const textLines = text.split(\"\\n\");\n ctx.fillStyle = item.fillColor;\n ctx.textAlign = item.textAlign;\n ctx.save();\n if (shadowBlur !== 0) {\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n ctx.shadowBlur = shadowBlur;\n ctx.shadowColor = item.shadowColor;\n }\n if (item.rotate) {\n ctx.translate(xPos + item.offsetX, lineHeight * multiplier + item.offsetY);\n ctx.rotate(item.rotate * Math.PI / 180);\n textLines.forEach((text, index)=>ctx.fillText(text, 0, index * lineHeight));\n ctx.rotate(-(item.rotate * Math.PI / 180));\n ctx.translate(-(xPos + item.offsetX), -(lineHeight * multiplier + item.offsetY));\n } else textLines.forEach((text, index)=>{\n ctx.fillText(text, xPos + item.offsetX, index * lineHeight + lineHeight * multiplier + item.offsetY);\n });\n ctx.restore();\n });\n};\n\n\nconst $44ae6d9db4eaca0f$var$videoModal = document.getElementById(\"videoModal\");\nconst $44ae6d9db4eaca0f$var$downloadModal = document.getElementById(\"downloadModal\");\nconst $44ae6d9db4eaca0f$var$canvas = document.getElementById(\"canvas\");\nconst $44ae6d9db4eaca0f$var$dropzoneEl = document.querySelector(\"files-dropzone\");\nconst $44ae6d9db4eaca0f$var$instructionsEl = document.getElementById(\"instructions\");\nconst $44ae6d9db4eaca0f$var$ctx = $44ae6d9db4eaca0f$var$canvas.getContext(\"2d\");\nconst $44ae6d9db4eaca0f$var$imageUploadMethodSelect = document.getElementById(\"imageUploadMethodSelect\");\nconst $44ae6d9db4eaca0f$var$fileSelectBtn = document.getElementById(\"fileSelectBtn\");\nconst $44ae6d9db4eaca0f$var$imageUrlForm = document.getElementById(\"imageUrlForm\");\nconst $44ae6d9db4eaca0f$var$addTextboxBtn = document.getElementById(\"addTextboxBtn\");\nconst $44ae6d9db4eaca0f$var$inputsContainer = document.getElementById(\"inputsContainer\");\nconst $44ae6d9db4eaca0f$var$generateMemeBtn = document.getElementById(\"generateMemeBtn\");\nconst $44ae6d9db4eaca0f$var$openVideoModalBtn = document.getElementById(\"openVideoModalBtn\");\nconst $44ae6d9db4eaca0f$var$downloadMemeBtn = document.getElementById(\"downloadMemeBtn\");\nconst $44ae6d9db4eaca0f$var$downloadMemePreview = document.getElementById(\"downloadMemePreview\");\nconst $44ae6d9db4eaca0f$var$webShareComponent = document.querySelector(\"web-share\");\nconst $44ae6d9db4eaca0f$var$galleryEl = document.getElementById(\"gallery\");\nconst $44ae6d9db4eaca0f$var$gallerySearchEl = document.getElementById(\"gallerySearch\");\nconst $44ae6d9db4eaca0f$var$galleryNoResultsEl = $44ae6d9db4eaca0f$var$galleryEl.querySelector(\".gallery__no-results\");\nconst $44ae6d9db4eaca0f$var$solidColorForm = document.getElementById(\"solidColorForm\");\nconst $44ae6d9db4eaca0f$var$uploadMethodEls = document.querySelectorAll(\".upload-method\");\nlet $44ae6d9db4eaca0f$var$selectedImage = null;\nlet $44ae6d9db4eaca0f$var$reqAnimFrame = null;\nconst $44ae6d9db4eaca0f$var$defaultTextOptions = {\n _isSettingsOpen: false,\n text: \"\",\n fillColor: \"#ffffff\",\n shadowColor: \"#000000\",\n font: \"Anton\",\n fontSize: 40,\n fontWeight: \"normal\",\n textAlign: \"center\",\n shadowBlur: 3,\n offsetY: 0,\n offsetX: 0,\n rotate: 0,\n allCaps: true\n};\nlet $44ae6d9db4eaca0f$var$textOptions = [\n {\n ...$44ae6d9db4eaca0f$var$defaultTextOptions\n }\n];\nconst $44ae6d9db4eaca0f$var$generateMeme = async ()=>{\n const dataUrl = $44ae6d9db4eaca0f$var$canvas.toDataURL(\"image/png\");\n // Prepare download link\n const downloadLink = dataUrl.replace(\"image/png\", \"image/octet-stream\");\n $44ae6d9db4eaca0f$var$downloadMemeBtn.download = `${(0, $21c3f3a8dccfa4fd$export$e2a22331486dcca0)(\"meme\")}.png`;\n $44ae6d9db4eaca0f$var$downloadMemeBtn.href = downloadLink;\n $44ae6d9db4eaca0f$var$downloadMemePreview.src = downloadLink;\n // Prepare for sharing file\n if ((0, $94933cc6427541bd$export$c37129e465f64ef0)()) try {\n const file = await (0, $008970865eefc93d$export$6539e087749cf9d3)({\n url: dataUrl,\n filename: `${(0, $21c3f3a8dccfa4fd$export$e2a22331486dcca0)(\"meme\")}.png`,\n mimeType: \"image/png\"\n }).catch((err)=>(0, $166cfb2484b08c80$export$af04143326425dbd)(err.message, \"danger\"));\n if (file && (0, $94933cc6427541bd$export$c37129e465f64ef0)({\n files: [\n file\n ]\n })) {\n $44ae6d9db4eaca0f$var$webShareComponent.shareFiles = [\n file\n ];\n $44ae6d9db4eaca0f$var$webShareComponent.hidden = false;\n }\n } catch (error) {\n console.error(error);\n }\n $44ae6d9db4eaca0f$var$downloadModal.open = true;\n};\nconst $44ae6d9db4eaca0f$var$onImageLoaded = (evt)=>{\n const MAX_WIDTH = 800;\n const MAX_HEIGHT = 600;\n let width = evt.target.width;\n let height = evt.target.height;\n if (width > height) {\n if (width > MAX_WIDTH) {\n height *= MAX_WIDTH / width;\n width = MAX_WIDTH;\n }\n } else if (height > MAX_HEIGHT) {\n width *= MAX_HEIGHT / height;\n height = MAX_HEIGHT;\n }\n $44ae6d9db4eaca0f$var$canvas.width = width;\n $44ae6d9db4eaca0f$var$canvas.height = height;\n $44ae6d9db4eaca0f$var$selectedImage = evt.target;\n (0, $d346fdc99aed49b3$export$e653a2de0f3a8b89)($44ae6d9db4eaca0f$var$selectedImage, $44ae6d9db4eaca0f$var$canvas, $44ae6d9db4eaca0f$var$ctx, $44ae6d9db4eaca0f$var$textOptions);\n $44ae6d9db4eaca0f$var$generateMemeBtn.disabled = false;\n $44ae6d9db4eaca0f$var$canvas.hidden = false;\n $44ae6d9db4eaca0f$var$instructionsEl.hidden = true;\n};\nconst $44ae6d9db4eaca0f$var$handleSolidColorFormInput = (evt)=>{\n const DEFAULT_WIDTH = 600;\n const DEFAULT_HEIGHT = 400;\n if (evt.target === $44ae6d9db4eaca0f$var$solidColorForm[\"canvasColor\"]) $44ae6d9db4eaca0f$var$selectedImage = evt.target.value;\n if (typeof $44ae6d9db4eaca0f$var$selectedImage === \"string\") {\n $44ae6d9db4eaca0f$var$canvas.width = Number($44ae6d9db4eaca0f$var$solidColorForm[\"canvasWidth\"].value) || DEFAULT_WIDTH;\n $44ae6d9db4eaca0f$var$canvas.height = Number($44ae6d9db4eaca0f$var$solidColorForm[\"canvasHeight\"].value) || DEFAULT_HEIGHT;\n (0, $d346fdc99aed49b3$export$e653a2de0f3a8b89)($44ae6d9db4eaca0f$var$selectedImage, $44ae6d9db4eaca0f$var$canvas, $44ae6d9db4eaca0f$var$ctx, $44ae6d9db4eaca0f$var$textOptions);\n $44ae6d9db4eaca0f$var$generateMemeBtn.disabled = false;\n $44ae6d9db4eaca0f$var$canvas.hidden = false;\n $44ae6d9db4eaca0f$var$instructionsEl.hidden = true;\n }\n};\nconst $44ae6d9db4eaca0f$var$handleFileSelect = (file)=>{\n if (!file) return;\n const image = new Image();\n const reader = new FileReader();\n reader.addEventListener(\"load\", function(evt) {\n const data = evt.target.result;\n image.addEventListener(\"load\", $44ae6d9db4eaca0f$var$onImageLoaded);\n image.src = data;\n });\n reader.readAsDataURL(file);\n};\nconst $44ae6d9db4eaca0f$var$handleOpenVideoModalButtonClick = ()=>{\n $44ae6d9db4eaca0f$var$videoModal.open = true;\n};\nconst $44ae6d9db4eaca0f$var$handleTextPropChange = (element, index, prop)=>{\n if (element.type === \"checkbox\") $44ae6d9db4eaca0f$var$textOptions[index][prop] = element.checked;\n else if (element.type === \"number\") $44ae6d9db4eaca0f$var$textOptions[index][prop] = Number(element.value);\n else $44ae6d9db4eaca0f$var$textOptions[index][prop] = element.value;\n (0, $d346fdc99aed49b3$export$e653a2de0f3a8b89)($44ae6d9db4eaca0f$var$selectedImage, $44ae6d9db4eaca0f$var$canvas, $44ae6d9db4eaca0f$var$ctx, $44ae6d9db4eaca0f$var$textOptions);\n};\nconst $44ae6d9db4eaca0f$var$handleAddTextboxBtnClick = ()=>{\n const textOptionsLength = $44ae6d9db4eaca0f$var$textOptions.length;\n const newTextBox = (0, $50a37fdc18d479c2$export$293a4b86a6fe2398)(textOptionsLength, $44ae6d9db4eaca0f$var$defaultTextOptions);\n $44ae6d9db4eaca0f$var$textOptions.push({\n ...$44ae6d9db4eaca0f$var$defaultTextOptions\n });\n $44ae6d9db4eaca0f$var$inputsContainer.appendChild(newTextBox);\n newTextBox.querySelector('[data-input=\"text\"]').focus();\n};\nconst $44ae6d9db4eaca0f$var$handleImageUploadFromURL = async (evt)=>{\n evt.preventDefault();\n const form = evt.target;\n const submitButton = form.querySelector('button[type=\"submit\"]');\n const imageUrl = form[\"imageUrl\"].value;\n if (!imageUrl.trim()) return;\n submitButton.disabled = true;\n submitButton.querySelector(\".spinner\").hidden = false;\n submitButton.querySelector(\".label\").hidden = true;\n try {\n const file = await (0, $008970865eefc93d$export$6539e087749cf9d3)({\n url: imageUrl\n }).catch((err)=>(0, $166cfb2484b08c80$export$af04143326425dbd)(err.message, \"danger\"));\n if (file) $44ae6d9db4eaca0f$var$handleFileSelect(file);\n } catch (err) {\n (0, $166cfb2484b08c80$export$af04143326425dbd)(`Failed to load image from \"${imageUrl}\".`, \"danger\");\n } finally{\n submitButton.disabled = false;\n submitButton.querySelector(\".spinner\").hidden = true;\n submitButton.querySelector(\".label\").hidden = false;\n }\n};\nconst $44ae6d9db4eaca0f$var$moveText = (offsetDir, sign, index)=>()=>{\n const textBoxSection = document.querySelectorAll('[data-section=\"textBox\"]')[index];\n const offsetYInput = textBoxSection.querySelector('[data-input=\"offsetY\"]');\n const offsetXInput = textBoxSection.querySelector('[data-input=\"offsetX\"]');\n if (offsetDir === \"offsetY\") {\n if (sign === \"-\") $44ae6d9db4eaca0f$var$textOptions[index].offsetY -= 1;\n if (sign === \"+\") $44ae6d9db4eaca0f$var$textOptions[index].offsetY += 1;\n offsetYInput.value = $44ae6d9db4eaca0f$var$textOptions[index].offsetY;\n }\n if (offsetDir === \"offsetX\") {\n if (sign === \"-\") $44ae6d9db4eaca0f$var$textOptions[index].offsetX -= 1;\n if (sign === \"+\") $44ae6d9db4eaca0f$var$textOptions[index].offsetX += 1;\n offsetXInput.value = $44ae6d9db4eaca0f$var$textOptions[index].offsetX;\n }\n (0, $d346fdc99aed49b3$export$e653a2de0f3a8b89)($44ae6d9db4eaca0f$var$selectedImage, $44ae6d9db4eaca0f$var$canvas, $44ae6d9db4eaca0f$var$ctx, $44ae6d9db4eaca0f$var$textOptions);\n $44ae6d9db4eaca0f$var$reqAnimFrame = requestAnimationFrame($44ae6d9db4eaca0f$var$moveText(offsetDir, sign, index));\n };\nconst $44ae6d9db4eaca0f$var$handleUploadMethodChange = (evt)=>{\n $44ae6d9db4eaca0f$var$uploadMethodEls.forEach((el)=>el.hidden = el.id !== evt.target.value);\n};\nconst $44ae6d9db4eaca0f$var$handleFileSelectClick = ()=>{\n if (typeof $44ae6d9db4eaca0f$var$dropzoneEl.openFileDialog === \"function\") $44ae6d9db4eaca0f$var$dropzoneEl.openFileDialog();\n};\nconst $44ae6d9db4eaca0f$var$handleDropFilesAccepted = (evt)=>{\n const [file] = evt.detail.acceptedFiles;\n if (file) $44ae6d9db4eaca0f$var$handleFileSelect(file);\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerInput = (evt)=>{\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let prop;\n if (element.matches('[data-input=\"text\"]')) prop = \"text\";\n else if (element.matches('[data-input=\"fillColor\"]')) prop = \"fillColor\";\n else if (element.matches('[data-input=\"shadowColor\"]')) prop = \"shadowColor\";\n else if (element.matches('[data-input=\"font\"]')) prop = \"font\";\n else if (element.matches('[data-input=\"fontSize\"]')) prop = \"fontSize\";\n else if (element.matches('[data-input=\"fontWeight\"]')) prop = \"fontWeight\";\n else if (element.matches('[data-input=\"textAlign\"]')) prop = \"textAlign\";\n else if (element.matches('[data-input=\"shadowBlur\"]')) prop = \"shadowBlur\";\n else if (element.matches('[data-input=\"offsetY\"]')) prop = \"offsetY\";\n else if (element.matches('[data-input=\"offsetX\"]')) prop = \"offsetX\";\n else if (element.matches('[data-input=\"rotate\"]')) prop = \"rotate\";\n if (prop) $44ae6d9db4eaca0f$var$handleTextPropChange(element, index, prop);\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerChange = (evt)=>{\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let prop;\n if (element.matches('[data-input=\"allCaps\"]')) prop = \"allCaps\";\n if (prop) $44ae6d9db4eaca0f$var$handleTextPropChange(element, index, prop);\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerClick = (evt)=>{\n const element = evt.target;\n if (element.matches('[data-button=\"settings\"]')) {\n const textBoxIndex = element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\");\n const textBoxEls = document.querySelectorAll('[data-section=\"textBox\"]');\n textBoxEls.forEach((el, index)=>{\n const settingsEl = el.querySelector('[data-section=\"settings\"]');\n if (el.getAttribute(\"data-index\") === textBoxIndex) {\n settingsEl.hidden = !settingsEl.hidden;\n $44ae6d9db4eaca0f$var$textOptions[index]._isSettingsOpen = !$44ae6d9db4eaca0f$var$textOptions[index]._isSettingsOpen;\n } else {\n settingsEl.hidden = true;\n $44ae6d9db4eaca0f$var$textOptions[index]._isSettingsOpen = false;\n }\n });\n }\n if (element.matches('[data-button=\"delete-text-box\"]')) {\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n let confirm = true;\n if ($44ae6d9db4eaca0f$var$textOptions[index].text.trim()) confirm = window.confirm(\"Are you sure you want to remove this text box?\");\n if (confirm) {\n $44ae6d9db4eaca0f$var$textOptions = (0, $5742c9e143620cb1$export$30a014203d0d7e4f)($44ae6d9db4eaca0f$var$textOptions, index);\n $44ae6d9db4eaca0f$var$inputsContainer.querySelectorAll('[data-section=\"textBox\"]').forEach((el)=>el.remove());\n $44ae6d9db4eaca0f$var$textOptions.forEach((item, index)=>$44ae6d9db4eaca0f$var$inputsContainer.appendChild((0, $50a37fdc18d479c2$export$293a4b86a6fe2398)(index, item)));\n (0, $d346fdc99aed49b3$export$e653a2de0f3a8b89)($44ae6d9db4eaca0f$var$selectedImage, $44ae6d9db4eaca0f$var$canvas, $44ae6d9db4eaca0f$var$ctx, $44ae6d9db4eaca0f$var$textOptions);\n }\n }\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerPointerdown = (evt)=>{\n const element = evt.target;\n const textBoxEl = element.closest('[data-section=\"textBox\"]');\n if (!textBoxEl) return;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute(\"data-index\"));\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton) return;\n const offsetDir = element.getAttribute(\"data-move\");\n const sign = element.getAttribute(\"data-sign\");\n $44ae6d9db4eaca0f$var$reqAnimFrame = requestAnimationFrame($44ae6d9db4eaca0f$var$moveText(offsetDir, sign, index));\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerPointerup = (evt)=>{\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton) return;\n cancelAnimationFrame($44ae6d9db4eaca0f$var$reqAnimFrame);\n $44ae6d9db4eaca0f$var$reqAnimFrame = null;\n};\nconst $44ae6d9db4eaca0f$var$handleInputsContainerPointerout = (evt)=>{\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n if (!isOffsetYButton && !isOffsetXButton || !$44ae6d9db4eaca0f$var$reqAnimFrame) return;\n cancelAnimationFrame($44ae6d9db4eaca0f$var$reqAnimFrame);\n $44ae6d9db4eaca0f$var$reqAnimFrame = null;\n};\nconst $44ae6d9db4eaca0f$var$handleGalleryClick = async (evt)=>{\n const button = evt.target.closest(\"button\");\n if (!button) return;\n const img = button.querySelector(\"img\");\n try {\n const file = await (0, $008970865eefc93d$export$6539e087749cf9d3)({\n url: img.src\n }).catch((err)=>(0, $166cfb2484b08c80$export$af04143326425dbd)(err.message, \"danger\"));\n if (file) $44ae6d9db4eaca0f$var$handleFileSelect(file);\n } catch (err) {\n (0, $166cfb2484b08c80$export$af04143326425dbd)(`Failed to load image: \"${img.alt}\".`, \"danger\");\n }\n};\nconst $44ae6d9db4eaca0f$var$handleGallerySearchInput = (evt)=>{\n const query = evt.target.value.toLowerCase().trim();\n const galleryItems = $44ae6d9db4eaca0f$var$galleryEl.querySelectorAll(\"button\");\n galleryItems.forEach((item)=>{\n const alt = (item.querySelector(\"img\").getAttribute(\"alt\") || \"\").toLowerCase();\n item.hidden = !alt.includes(query);\n });\n $44ae6d9db4eaca0f$var$galleryNoResultsEl.hidden = !!$44ae6d9db4eaca0f$var$galleryEl.querySelector(\"button:not([hidden])\");\n};\nconst $44ae6d9db4eaca0f$var$handleWebShareError = ()=>{\n $44ae6d9db4eaca0f$var$downloadModal.open = false;\n (0, $166cfb2484b08c80$export$af04143326425dbd)(\"There was an error while trying to share your meme.\", \"danger\");\n};\nconst $44ae6d9db4eaca0f$var$handleCapturePhotoError = (evt)=>{\n console.error(evt.detail.error);\n (0, $166cfb2484b08c80$export$af04143326425dbd)(evt.detail.error.message, \"danger\");\n};\nconst $44ae6d9db4eaca0f$var$handleCapturePhotoSuccess = (evt)=>{\n $44ae6d9db4eaca0f$var$videoModal.open = false;\n const image = new Image();\n image.addEventListener(\"load\", $44ae6d9db4eaca0f$var$onImageLoaded);\n image.src = evt.detail.dataURI;\n};\nconst $44ae6d9db4eaca0f$var$handleModalOpen = (evt)=>{\n if (evt.target.id === \"videoModal\") {\n const capturePhotoComponent = $44ae6d9db4eaca0f$var$videoModal.querySelector(\"capture-photo\");\n if (capturePhotoComponent && typeof capturePhotoComponent.startVideoStream === \"function\") capturePhotoComponent.startVideoStream();\n }\n};\nconst $44ae6d9db4eaca0f$var$handleModalClose = (evt)=>{\n if (evt.target.id === \"videoModal\") {\n const capturePhotoComponent = $44ae6d9db4eaca0f$var$videoModal.querySelector(\"capture-photo\");\n if (capturePhotoComponent && typeof capturePhotoComponent.stopVideoStream === \"function\") capturePhotoComponent.stopVideoStream();\n }\n};\n$44ae6d9db4eaca0f$var$fileSelectBtn.addEventListener(\"click\", $44ae6d9db4eaca0f$var$handleFileSelectClick);\n$44ae6d9db4eaca0f$var$openVideoModalBtn.addEventListener(\"click\", $44ae6d9db4eaca0f$var$handleOpenVideoModalButtonClick);\n$44ae6d9db4eaca0f$var$addTextboxBtn.addEventListener(\"click\", $44ae6d9db4eaca0f$var$handleAddTextboxBtnClick);\n$44ae6d9db4eaca0f$var$generateMemeBtn.addEventListener(\"click\", $44ae6d9db4eaca0f$var$generateMeme);\n$44ae6d9db4eaca0f$var$downloadMemeBtn.addEventListener(\"click\", ()=>$44ae6d9db4eaca0f$var$downloadModal.open = false);\n$44ae6d9db4eaca0f$var$imageUrlForm.addEventListener(\"submit\", $44ae6d9db4eaca0f$var$handleImageUploadFromURL);\n$44ae6d9db4eaca0f$var$dropzoneEl.addEventListener(\"files-dropzone-drop-accepted\", $44ae6d9db4eaca0f$var$handleDropFilesAccepted);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"input\", $44ae6d9db4eaca0f$var$handleInputsContainerInput);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"change\", $44ae6d9db4eaca0f$var$handleInputsContainerChange);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"click\", $44ae6d9db4eaca0f$var$handleInputsContainerClick);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"pointerdown\", $44ae6d9db4eaca0f$var$handleInputsContainerPointerdown);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"pointerup\", $44ae6d9db4eaca0f$var$handleInputsContainerPointerup);\n$44ae6d9db4eaca0f$var$inputsContainer.addEventListener(\"pointerout\", $44ae6d9db4eaca0f$var$handleInputsContainerPointerout);\n$44ae6d9db4eaca0f$var$imageUploadMethodSelect.addEventListener(\"change\", $44ae6d9db4eaca0f$var$handleUploadMethodChange);\n$44ae6d9db4eaca0f$var$galleryEl.addEventListener(\"click\", $44ae6d9db4eaca0f$var$handleGalleryClick);\n$44ae6d9db4eaca0f$var$gallerySearchEl.addEventListener(\"input\", $44ae6d9db4eaca0f$var$handleGallerySearchInput);\n$44ae6d9db4eaca0f$var$solidColorForm.addEventListener(\"input\", $44ae6d9db4eaca0f$var$handleSolidColorFormInput);\ndocument.addEventListener(\"web-share:error\", $44ae6d9db4eaca0f$var$handleWebShareError);\ndocument.addEventListener(\"capture-photo:error\", $44ae6d9db4eaca0f$var$handleCapturePhotoError);\ndocument.addEventListener(\"capture-photo:success\", $44ae6d9db4eaca0f$var$handleCapturePhotoSuccess);\ndocument.addEventListener(\"me-open\", $44ae6d9db4eaca0f$var$handleModalOpen);\ndocument.addEventListener(\"me-close\", $44ae6d9db4eaca0f$var$handleModalClose);\n$44ae6d9db4eaca0f$var$galleryEl.querySelectorAll(\"button > img\")?.forEach((image)=>{\n image.setAttribute(\"title\", image.getAttribute(\"alt\"));\n});\n$44ae6d9db4eaca0f$var$textOptions.forEach((item, index)=>{\n $44ae6d9db4eaca0f$var$inputsContainer.appendChild((0, $50a37fdc18d479c2$export$293a4b86a6fe2398)(index, item));\n});\n$44ae6d9db4eaca0f$var$dropzoneEl.accept = (0, $33dea9d9a6da4c9a$export$63e7bed68b07a85c);\n(0, $055531bbd0af154c$export$6874249d87f2602a).forEach(({ name: name, path: path, style: style, weight: weight })=>{\n (0, $055531bbd0af154c$export$59eceaef0c7797b2)(name, path, {\n style: style,\n weight: weight\n });\n});\n\n})();\n//# sourceMappingURL=index.bc158aed.js.map\n","\"use strict\";\n\nvar mapping = new Map();\nfunction register(baseUrl, manifest) {\n for (var i = 0; i < manifest.length - 1; i += 2) {\n mapping.set(manifest[i], {\n baseUrl: baseUrl,\n path: manifest[i + 1]\n });\n }\n}\nfunction resolve(id) {\n var resolved = mapping.get(id);\n if (resolved == null) {\n throw new Error('Could not resolve bundle with id ' + id);\n }\n return new URL(resolved.path, resolved.baseUrl).toString();\n}\nmodule.exports.register = register;\nmodule.exports.resolve = resolve;","\"use strict\";\n\nvar bundleURL = {};\nfunction getBundleURLCached(id) {\n var value = bundleURL[id];\n if (!value) {\n value = getBundleURL();\n bundleURL[id] = value;\n }\n return value;\n}\nfunction getBundleURL() {\n try {\n throw new Error();\n } catch (err) {\n var matches = ('' + err.stack).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^)\\n]+/g);\n if (matches) {\n // The first two stack frames will be this function and getBundleURLCached.\n // Use the 3rd one, which will be a runtime in the original bundle.\n return getBaseURL(matches[2]);\n }\n }\n return '/';\n}\nfunction getBaseURL(url) {\n return ('' + url).replace(/^((?:https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/.+)\\/[^/]+$/, '$1') + '/';\n}\n\n// TODO: Replace uses with `new URL(url).origin` when ie11 is no longer supported.\nfunction getOrigin(url) {\n var matches = ('' + url).match(/(https?|file|ftp|(chrome|moz|safari-web)-extension):\\/\\/[^/]+/);\n if (!matches) {\n throw new Error('Origin not found');\n }\n return matches[0];\n}\nexports.getBundleURL = getBundleURLCached;\nexports.getBaseURL = getBaseURL;\nexports.getOrigin = getOrigin;","require('./helpers/bundle-manifest').register(require('./helpers/bundle-url').getBundleURL('8tAhj'),JSON.parse(\"[\\\"8tAhj\\\",\\\"index.bc158aed.js\\\",\\\"cmj6F\\\",\\\"Anton-Regular.e58ab3fe.ttf\\\",\\\"a9OJN\\\",\\\"Oswald-Regular.89ec7d89.ttf\\\",\\\"jOuj0\\\",\\\"Oswald-Bold.0f6a7ca6.ttf\\\",\\\"ePq3V\\\",\\\"Roboto-Regular.ca197847.ttf\\\",\\\"9WQUU\\\",\\\"Roboto-Bold.fdb9b54a.ttf\\\",\\\"hIywO\\\",\\\"RobotoCondensed-Regular.d585f5c7.ttf\\\",\\\"ab1rw\\\",\\\"RobotoCondensed-Bold.e1f96d4b.ttf\\\",\\\"j4ruO\\\",\\\"CourierPrime-Regular.3a25a501.ttf\\\",\\\"3nnD2\\\",\\\"CourierPrime-Bold.3d6bf689.ttf\\\",\\\"8fsWK\\\",\\\"OpenSans-Regular.edf9e01b.ttf\\\",\\\"5JXG6\\\",\\\"OpenSans-Bold.8fceb72b.ttf\\\",\\\"9FH7D\\\",\\\"index.2d751096.css\\\"]\"));","import { isWebShareSupported } from '@georapbox/web-share-element/dist/is-web-share-supported.js';\nimport '@georapbox/web-share-element/dist/web-share-defined.js';\nimport '@georapbox/capture-photo-element/dist/capture-photo-defined.js';\nimport '@georapbox/modal-element/dist/modal-element-defined.js';\nimport '@georapbox/files-dropzone-element/dist/files-dropzone-defined.js';\nimport 'bootstrap/dist/css/bootstrap.min.css';\nimport '../css/main.css';\nimport { arrayRemove } from './utils/array-remove.js';\nimport { uid } from './utils/uid.js';\nimport { ACCEPTED_MIME_TYPES } from './constants.js';\nimport { customFonts, loadCustomFont } from './custom-fonts.js';\nimport { fileFromUrl } from './file-from-url.js';\nimport { toastAlert } from './toast-alert.js';\nimport { createTextBox } from './create-text-box.js';\nimport { drawCanvas } from './draw-canvas.js';\n\nconst videoModal = document.getElementById('videoModal');\nconst downloadModal = document.getElementById('downloadModal');\nconst canvas = document.getElementById('canvas');\nconst dropzoneEl = document.querySelector('files-dropzone');\nconst instructionsEl = document.getElementById('instructions');\nconst ctx = canvas.getContext('2d');\nconst imageUploadMethodSelect = document.getElementById('imageUploadMethodSelect');\nconst fileSelectBtn = document.getElementById('fileSelectBtn');\nconst imageUrlForm = document.getElementById('imageUrlForm');\nconst addTextboxBtn = document.getElementById('addTextboxBtn');\nconst inputsContainer = document.getElementById('inputsContainer');\nconst generateMemeBtn = document.getElementById('generateMemeBtn');\nconst openVideoModalBtn = document.getElementById('openVideoModalBtn');\nconst downloadMemeBtn = document.getElementById('downloadMemeBtn');\nconst downloadMemePreview = document.getElementById('downloadMemePreview');\nconst webShareComponent = document.querySelector('web-share');\nconst galleryEl = document.getElementById('gallery');\nconst gallerySearchEl = document.getElementById('gallerySearch');\nconst galleryNoResultsEl = galleryEl.querySelector('.gallery__no-results');\nconst solidColorForm = document.getElementById('solidColorForm');\nconst uploadMethodEls = document.querySelectorAll('.upload-method');\nlet selectedImage = null;\nlet reqAnimFrame = null;\n\nconst defaultTextOptions = {\n _isSettingsOpen: false,\n text: '',\n fillColor: '#ffffff',\n shadowColor: '#000000',\n font: 'Anton',\n fontSize: 40,\n fontWeight: 'normal',\n textAlign: 'center',\n shadowBlur: 3,\n offsetY: 0,\n offsetX: 0,\n rotate: 0,\n allCaps: true\n};\n\nlet textOptions = [\n { ...defaultTextOptions }\n];\n\nconst generateMeme = async () => {\n const dataUrl = canvas.toDataURL('image/png');\n\n // Prepare download link\n const downloadLink = dataUrl.replace('image/png', 'image/octet-stream');\n downloadMemeBtn.download = `${uid('meme')}.png`;\n downloadMemeBtn.href = downloadLink;\n downloadMemePreview.src = downloadLink;\n\n // Prepare for sharing file\n if (isWebShareSupported()) {\n try {\n const file = await fileFromUrl({\n url: dataUrl,\n filename: `${uid('meme')}.png`,\n mimeType: 'image/png'\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file && isWebShareSupported({ files: [file] })) {\n webShareComponent.shareFiles = [file];\n webShareComponent.hidden = false;\n }\n } catch (error) {\n console.error(error);\n }\n }\n\n downloadModal.open = true;\n};\n\nconst onImageLoaded = evt => {\n const MAX_WIDTH = 800;\n const MAX_HEIGHT = 600;\n let width = evt.target.width;\n let height = evt.target.height;\n\n if (width > height) {\n if (width > MAX_WIDTH) {\n height *= MAX_WIDTH / width;\n width = MAX_WIDTH;\n }\n } else {\n if (height > MAX_HEIGHT) {\n width *= MAX_HEIGHT / height;\n height = MAX_HEIGHT;\n }\n }\n canvas.width = width;\n canvas.height = height;\n\n selectedImage = evt.target;\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n generateMemeBtn.disabled = false;\n canvas.hidden = false;\n instructionsEl.hidden = true;\n};\n\nconst handleSolidColorFormInput = evt => {\n const DEFAULT_WIDTH = 600;\n const DEFAULT_HEIGHT = 400;\n\n if (evt.target === solidColorForm['canvasColor']) {\n selectedImage = evt.target.value;\n }\n\n if (typeof selectedImage === 'string') {\n canvas.width = Number(solidColorForm['canvasWidth'].value) || DEFAULT_WIDTH;\n canvas.height = Number(solidColorForm['canvasHeight'].value) || DEFAULT_HEIGHT;\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n generateMemeBtn.disabled = false;\n canvas.hidden = false;\n instructionsEl.hidden = true;\n }\n};\n\nconst handleFileSelect = file => {\n if (!file) {\n return;\n }\n\n const image = new Image();\n const reader = new FileReader();\n\n reader.addEventListener('load', function (evt) {\n const data = evt.target.result;\n image.addEventListener('load', onImageLoaded);\n image.src = data;\n });\n\n reader.readAsDataURL(file);\n};\n\nconst handleOpenVideoModalButtonClick = () => {\n videoModal.open = true;\n};\n\nconst handleTextPropChange = (element, index, prop) => {\n if (element.type === 'checkbox') {\n textOptions[index][prop] = element.checked;\n } else if (element.type === 'number') {\n textOptions[index][prop] = Number(element.value);\n } else {\n textOptions[index][prop] = element.value;\n }\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n};\n\nconst handleAddTextboxBtnClick = () => {\n const textOptionsLength = textOptions.length;\n const newTextBox = createTextBox(textOptionsLength, defaultTextOptions);\n\n textOptions.push({ ...defaultTextOptions });\n inputsContainer.appendChild(newTextBox);\n newTextBox.querySelector('[data-input=\"text\"]').focus();\n};\n\nconst handleImageUploadFromURL = async evt => {\n evt.preventDefault();\n\n const form = evt.target;\n const submitButton = form.querySelector('button[type=\"submit\"]');\n const imageUrl = form['imageUrl'].value;\n\n if (!imageUrl.trim()) {\n return;\n }\n\n submitButton.disabled = true;\n submitButton.querySelector('.spinner').hidden = false;\n submitButton.querySelector('.label').hidden = true;\n\n try {\n const file = await fileFromUrl({\n url: imageUrl\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file) {\n handleFileSelect(file);\n }\n } catch (err) {\n toastAlert(`Failed to load image from \"${imageUrl}\".`, 'danger');\n } finally {\n submitButton.disabled = false;\n submitButton.querySelector('.spinner').hidden = true;\n submitButton.querySelector('.label').hidden = false;\n }\n};\n\nconst moveText = (offsetDir, sign, index) => () => {\n const textBoxSection = document.querySelectorAll('[data-section=\"textBox\"]')[index];\n const offsetYInput = textBoxSection.querySelector('[data-input=\"offsetY\"]');\n const offsetXInput = textBoxSection.querySelector('[data-input=\"offsetX\"]');\n\n if (offsetDir === 'offsetY') {\n if (sign === '-') {\n textOptions[index].offsetY -= 1;\n }\n\n if (sign === '+') {\n textOptions[index].offsetY += 1;\n }\n\n offsetYInput.value = textOptions[index].offsetY;\n }\n\n if (offsetDir === 'offsetX') {\n if (sign === '-') {\n textOptions[index].offsetX -= 1;\n }\n\n if (sign === '+') {\n textOptions[index].offsetX += 1;\n }\n\n offsetXInput.value = textOptions[index].offsetX;\n }\n\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n\n reqAnimFrame = requestAnimationFrame(moveText(offsetDir, sign, index));\n};\n\nconst handleUploadMethodChange = evt => {\n uploadMethodEls.forEach(el => el.hidden = el.id !== evt.target.value);\n};\n\nconst handleFileSelectClick = () => {\n if (typeof dropzoneEl.openFileDialog === 'function') {\n dropzoneEl.openFileDialog();\n }\n};\n\nconst handleDropFilesAccepted = evt => {\n const [file] = evt.detail.acceptedFiles;\n\n if (file) {\n handleFileSelect(file);\n }\n};\n\nconst handleInputsContainerInput = evt => {\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let prop;\n\n if (element.matches('[data-input=\"text\"]')) {\n prop = 'text';\n } else if (element.matches('[data-input=\"fillColor\"]')) {\n prop = 'fillColor';\n } else if (element.matches('[data-input=\"shadowColor\"]')) {\n prop = 'shadowColor';\n } else if (element.matches('[data-input=\"font\"]')) {\n prop = 'font';\n } else if (element.matches('[data-input=\"fontSize\"]')) {\n prop = 'fontSize';\n } else if (element.matches('[data-input=\"fontWeight\"]')) {\n prop = 'fontWeight';\n } else if (element.matches('[data-input=\"textAlign\"]')) {\n prop = 'textAlign';\n } else if (element.matches('[data-input=\"shadowBlur\"]')) {\n prop = 'shadowBlur';\n } else if (element.matches('[data-input=\"offsetY\"]')) {\n prop = 'offsetY';\n } else if (element.matches('[data-input=\"offsetX\"]')) {\n prop = 'offsetX';\n } else if (element.matches('[data-input=\"rotate\"]')) {\n prop = 'rotate';\n }\n\n if (prop) {\n handleTextPropChange(element, index, prop);\n }\n};\n\nconst handleInputsContainerChange = evt => {\n const element = evt.target;\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let prop;\n\n if (element.matches('[data-input=\"allCaps\"]')) {\n prop = 'allCaps';\n }\n\n if (prop) {\n handleTextPropChange(element, index, prop);\n }\n};\n\nconst handleInputsContainerClick = evt => {\n const element = evt.target;\n\n if (element.matches('[data-button=\"settings\"]')) {\n const textBoxIndex = element.closest('[data-section=\"textBox\"]').getAttribute('data-index');\n const textBoxEls = document.querySelectorAll('[data-section=\"textBox\"]');\n\n textBoxEls.forEach((el, index) => {\n const settingsEl = el.querySelector('[data-section=\"settings\"]');\n\n if (el.getAttribute('data-index') === textBoxIndex) {\n settingsEl.hidden = !settingsEl.hidden;\n textOptions[index]._isSettingsOpen = !textOptions[index]._isSettingsOpen;\n } else {\n settingsEl.hidden = true;\n textOptions[index]._isSettingsOpen = false;\n }\n });\n }\n\n if (element.matches('[data-button=\"delete-text-box\"]')) {\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n let confirm = true;\n\n if (textOptions[index].text.trim()) {\n confirm = window.confirm('Are you sure you want to remove this text box?');\n }\n\n if (confirm) {\n textOptions = arrayRemove(textOptions, index);\n inputsContainer.querySelectorAll('[data-section=\"textBox\"]').forEach(el => el.remove());\n textOptions.forEach((item, index) => inputsContainer.appendChild(createTextBox(index, item)));\n drawCanvas(selectedImage, canvas, ctx, textOptions);\n }\n }\n};\n\nconst handleInputsContainerPointerdown = evt => {\n const element = evt.target;\n const textBoxEl = element.closest('[data-section=\"textBox\"]');\n\n if (!textBoxEl) {\n return;\n }\n\n const index = Number(element.closest('[data-section=\"textBox\"]').getAttribute('data-index'));\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton) {\n return;\n }\n\n const offsetDir = element.getAttribute('data-move');\n const sign = element.getAttribute('data-sign');\n\n reqAnimFrame = requestAnimationFrame(moveText(offsetDir, sign, index));\n};\n\nconst handleInputsContainerPointerup = evt => {\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton) {\n return;\n }\n\n cancelAnimationFrame(reqAnimFrame);\n reqAnimFrame = null;\n};\n\nconst handleInputsContainerPointerout = evt => {\n const element = evt.target;\n const isOffsetYButton = element.matches('[data-move=\"offsetY\"]');\n const isOffsetXButton = element.matches('[data-move=\"offsetX\"]');\n\n if (!isOffsetYButton && !isOffsetXButton || !reqAnimFrame) {\n return;\n }\n\n cancelAnimationFrame(reqAnimFrame);\n reqAnimFrame = null;\n};\n\nconst handleGalleryClick = async evt => {\n const button = evt.target.closest('button');\n\n if (!button) {\n return;\n }\n\n const img = button.querySelector('img');\n\n try {\n const file = await fileFromUrl({\n url: img.src\n }).catch(err => toastAlert(err.message, 'danger'));\n\n if (file) {\n handleFileSelect(file);\n }\n } catch (err) {\n toastAlert(`Failed to load image: \"${img.alt}\".`, 'danger');\n }\n};\n\nconst handleGallerySearchInput = evt => {\n const query = evt.target.value.toLowerCase().trim();\n const galleryItems = galleryEl.querySelectorAll('button');\n\n galleryItems.forEach(item => {\n const alt = (item.querySelector('img').getAttribute('alt') || '').toLowerCase();\n item.hidden = !alt.includes(query);\n });\n\n galleryNoResultsEl.hidden = !!galleryEl.querySelector('button:not([hidden])');\n};\n\nconst handleWebShareError = () => {\n downloadModal.open = false;\n toastAlert('There was an error while trying to share your meme.', 'danger');\n};\n\nconst handleCapturePhotoError = evt => {\n console.error(evt.detail.error);\n toastAlert(evt.detail.error.message, 'danger');\n};\n\nconst handleCapturePhotoSuccess = evt => {\n videoModal.open = false;\n const image = new Image();\n image.addEventListener('load', onImageLoaded);\n image.src = evt.detail.dataURI;\n};\n\nconst handleModalOpen = evt => {\n if (evt.target.id === 'videoModal') {\n const capturePhotoComponent = videoModal.querySelector('capture-photo');\n\n if (capturePhotoComponent && typeof capturePhotoComponent.startVideoStream === 'function') {\n capturePhotoComponent.startVideoStream();\n }\n }\n};\n\nconst handleModalClose = evt => {\n if (evt.target.id === 'videoModal') {\n const capturePhotoComponent = videoModal.querySelector('capture-photo');\n\n if (capturePhotoComponent && typeof capturePhotoComponent.stopVideoStream === 'function') {\n capturePhotoComponent.stopVideoStream();\n }\n }\n};\n\nfileSelectBtn.addEventListener('click', handleFileSelectClick);\nopenVideoModalBtn.addEventListener('click', handleOpenVideoModalButtonClick);\naddTextboxBtn.addEventListener('click', handleAddTextboxBtnClick);\ngenerateMemeBtn.addEventListener('click', generateMeme);\ndownloadMemeBtn.addEventListener('click', () => downloadModal.open = false);\nimageUrlForm.addEventListener('submit', handleImageUploadFromURL);\ndropzoneEl.addEventListener('files-dropzone-drop-accepted', handleDropFilesAccepted);\ninputsContainer.addEventListener('input', handleInputsContainerInput);\ninputsContainer.addEventListener('change', handleInputsContainerChange);\ninputsContainer.addEventListener('click', handleInputsContainerClick);\ninputsContainer.addEventListener('pointerdown', handleInputsContainerPointerdown);\ninputsContainer.addEventListener('pointerup', handleInputsContainerPointerup);\ninputsContainer.addEventListener('pointerout', handleInputsContainerPointerout);\nimageUploadMethodSelect.addEventListener('change', handleUploadMethodChange);\ngalleryEl.addEventListener('click', handleGalleryClick);\ngallerySearchEl.addEventListener('input', handleGallerySearchInput);\nsolidColorForm.addEventListener('input', handleSolidColorFormInput);\ndocument.addEventListener('web-share:error', handleWebShareError);\ndocument.addEventListener('capture-photo:error', handleCapturePhotoError);\ndocument.addEventListener('capture-photo:success', handleCapturePhotoSuccess);\ndocument.addEventListener('me-open', handleModalOpen);\ndocument.addEventListener('me-close', handleModalClose);\n\ngalleryEl.querySelectorAll('button > img')?.forEach(image => {\n image.setAttribute('title', image.getAttribute('alt'));\n});\n\ntextOptions.forEach((item, index) => {\n inputsContainer.appendChild(createTextBox(index, item));\n});\n\ndropzoneEl.accept = ACCEPTED_MIME_TYPES;\n\ncustomFonts.forEach(({ name, path, style, weight }) => {\n loadCustomFont(name, path, { style, weight });\n});\n","function a(a){return null!==a&&\"object\"==typeof a?\"share\"in navigator&&\"canShare\"in navigator&&navigator.canShare(a):\"share\"in navigator}export{a as isWebShareSupported};\n//# sourceMappingURL=is-web-share-supported.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $e179325634270afd$exports = {};\n\n$parcel$export($e179325634270afd$exports, \"WebShare\", function () { return $e179325634270afd$export$30b344bef3e55b67; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ /**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */ const $e179325634270afd$var$styles = /* css */ `\n :host {\n display: inline-block;\n }\n`;\nconst $e179325634270afd$var$template = document.createElement(\"template\");\n$e179325634270afd$var$template.innerHTML = /* html */ `\n \n \n`;\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */ class $e179325634270afd$export$30b344bef3e55b67 extends HTMLElement {\n /** @type {Nullable} */ #buttonSlot;\n /** @type {Nullable} */ #buttonEl;\n /** @type {File[]} */ #files = [];\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\",\n delegatesFocus: true\n });\n shadowRoot.appendChild($e179325634270afd$var$template.content.cloneNode(true));\n }\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n static get observedAttributes() {\n return [\n \"disabled\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"disabled\" && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute(\"disabled\", this.disabled);\n this.#buttonEl.setAttribute(\"aria-disabled\", this.disabled.toString());\n if (this.#buttonEl.part && this.#buttonEl.part.contains(\"button\")) this.#buttonEl.part.toggle(\"button--disabled\", this.disabled);\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"shareUrl\");\n this.#upgradeProperty(\"shareTitle\");\n this.#upgradeProperty(\"shareText\");\n this.#upgradeProperty(\"shareFiles\");\n this.#upgradeProperty(\"disabled\");\n this.#buttonSlot?.addEventListener(\"slotchange\", this.#handleSlotChange);\n this.#buttonEl?.addEventListener(\"click\", this.#handleClick);\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#buttonSlot?.removeEventListener(\"slotchange\", this.#handleSlotChange);\n this.#buttonEl?.removeEventListener(\"click\", this.#handleClick);\n }\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */ get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(value) {\n this.toggleAttribute(\"disabled\", !!value);\n }\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */ get shareUrl() {\n return this.getAttribute(\"share-url\") || \"\";\n }\n set shareUrl(value) {\n this.setAttribute(\"share-url\", value);\n }\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */ get shareTitle() {\n return this.getAttribute(\"share-title\") || \"\";\n }\n set shareTitle(value) {\n this.setAttribute(\"share-title\", value);\n }\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */ get shareText() {\n return this.getAttribute(\"share-text\") || \"\";\n }\n set shareText(value) {\n this.setAttribute(\"share-text\", value);\n }\n /**\n * @type {File[]} - The files to share.\n */ get shareFiles() {\n return this.#files;\n }\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) this.#files = value;\n }\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */ async share() {\n if (this.disabled) return;\n try {\n /** @type {ShareData} */ const shareData = {};\n if (this.shareUrl) shareData.url = this.shareUrl;\n if (this.shareTitle) shareData.title = this.shareTitle;\n if (this.shareText) shareData.text = this.shareText;\n if (Array.isArray(this.shareFiles) && this.shareFiles.length > 0 && navigator.canShare && navigator.canShare({\n files: this.shareFiles\n })) shareData.files = this.shareFiles;\n await navigator.share(shareData);\n this.dispatchEvent(new CustomEvent(\"web-share:success\", {\n bubbles: true,\n composed: true,\n detail: {\n shareData: shareData\n }\n }));\n } catch (error) {\n if (error instanceof Error && error.name === \"AbortError\") {\n this.dispatchEvent(new CustomEvent(\"web-share:abort\", {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n return;\n }\n this.dispatchEvent(new CustomEvent(\"web-share:error\", {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n }\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */ #handleClick = (evt)=>{\n evt.preventDefault();\n if (this.disabled) return;\n this.share();\n };\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */ #handleSlotChange = (evt)=>{\n if (evt.target && evt.target.name === \"button\") {\n this.#buttonEl?.removeEventListener(\"click\", this.#handleClick);\n this.#buttonEl = this.#getButton();\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener(\"click\", this.#handleClick);\n if (this.#buttonEl.nodeName !== \"BUTTON\" && !this.#buttonEl.hasAttribute(\"role\")) this.#buttonEl.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */ #getButton() {\n if (!this.#buttonSlot) return null;\n return this.#buttonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"button\";\n }) || null;\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n static defineCustomElement(elementName = \"web-share\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $e179325634270afd$export$30b344bef3e55b67);\n }\n}\n\n\n(0, $e179325634270afd$export$30b344bef3e55b67).defineCustomElement();\n\n\nexport {$e179325634270afd$export$30b344bef3e55b67 as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","// @ts-check\n\n/**\n * Check if Web Share API is supported by the platform.\n *\n * @param {import('./web-share').ShareData} [options]\n * @returns {boolean} Returns `true` if Web Share API is supported; otherwise `false`.\n */\nfunction isWebShareSupported(options) {\n if (options !== null && typeof options === 'object') {\n return 'share' in navigator && 'canShare' in navigator && navigator.canShare(options);\n }\n\n return 'share' in navigator;\n}\n\nexport { isWebShareSupported };\n","Object.defineProperty({},\"WebShare\",{get:function(){return s},set:void 0,enumerable:!0,configurable:!0});let t=`\n :host {\n display: inline-block;\n }\n`,e=document.createElement(\"template\");e.innerHTML=`\n \n \n`;class s extends HTMLElement{#t;#e;#s=[];constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\",delegatesFocus:!0}).appendChild(e.content.cloneNode(!0)),this.#t=this.shadowRoot?.querySelector('slot[name=\"button\"]')||null,this.#e=this.#i()}static get observedAttributes(){return[\"disabled\"]}attributeChangedCallback(t,e,s){\"disabled\"===t&&e!==s&&this.#e&&(this.#e.toggleAttribute(\"disabled\",this.disabled),this.#e.setAttribute(\"aria-disabled\",this.disabled.toString()),this.#e.part&&this.#e.part.contains(\"button\")&&this.#e.part.toggle(\"button--disabled\",this.disabled))}connectedCallback(){this.#r(\"shareUrl\"),this.#r(\"shareTitle\"),this.#r(\"shareText\"),this.#r(\"shareFiles\"),this.#r(\"disabled\"),this.#t?.addEventListener(\"slotchange\",this.#a),this.#e?.addEventListener(\"click\",this.#n)}disconnectedCallback(){this.#t?.removeEventListener(\"slotchange\",this.#a),this.#e?.removeEventListener(\"click\",this.#n)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(t){this.toggleAttribute(\"disabled\",!!t)}get shareUrl(){return this.getAttribute(\"share-url\")||\"\"}set shareUrl(t){this.setAttribute(\"share-url\",t)}get shareTitle(){return this.getAttribute(\"share-title\")||\"\"}set shareTitle(t){this.setAttribute(\"share-title\",t)}get shareText(){return this.getAttribute(\"share-text\")||\"\"}set shareText(t){this.setAttribute(\"share-text\",t)}get shareFiles(){return this.#s}set shareFiles(t){Array.isArray(t)&&t.length>0&&(this.#s=t)}async share(){if(!this.disabled)try{let t={};this.shareUrl&&(t.url=this.shareUrl),this.shareTitle&&(t.title=this.shareTitle),this.shareText&&(t.text=this.shareText),Array.isArray(this.shareFiles)&&this.shareFiles.length>0&&navigator.canShare&&navigator.canShare({files:this.shareFiles})&&(t.files=this.shareFiles),await navigator.share(t),this.dispatchEvent(new CustomEvent(\"web-share:success\",{bubbles:!0,composed:!0,detail:{shareData:t}}))}catch(t){if(t instanceof Error&&\"AbortError\"===t.name){this.dispatchEvent(new CustomEvent(\"web-share:abort\",{bubbles:!0,composed:!0,detail:{error:t}}));return}this.dispatchEvent(new CustomEvent(\"web-share:error\",{bubbles:!0,composed:!0,detail:{error:t}}))}}#n=t=>{t.preventDefault(),this.disabled||this.share()};#a=t=>{t.target&&\"button\"===t.target.name&&(this.#e?.removeEventListener(\"click\",this.#n),this.#e=this.#i(),this.#e&&(this.#e.addEventListener(\"click\",this.#n),\"BUTTON\"===this.#e.nodeName||this.#e.hasAttribute(\"role\")||this.#e.setAttribute(\"role\",\"button\")))};#i(){return this.#t&&this.#t.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"button\"===t.getAttribute(\"slot\"))||null}#r(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}static defineCustomElement(t=\"web-share\"){\"undefined\"==typeof window||window.customElements.get(t)||window.customElements.define(t,s)}}s.defineCustomElement();export{s as WebShare};\n//# sourceMappingURL=web-share-defined.js.map\n","import { WebShare } from './web-share.js';\n\nWebShare.defineCustomElement();\n\nexport { WebShare };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * Represents the data to share.\n *\n * @typedef {Object} ShareData\n * @property {string} [url] - The URL to share.\n * @property {string} [title] - The title to share.\n * @property {string} [text] - The text to share.\n * @property {File[]} [files] - The files to share.\n */\n\nconst styles = /* css */`\n :host {\n display: inline-block;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */ `\n \n \n`;\n\n/**\n * @summary A custom element that provides a button to share content.\n * @documentation https://github.com/georapbox/web-share-element\n *\n * @tagname web-share - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {boolean} disabled - Indicates whether the button is disabled.\n * @property {string} shareUrl - The URL to share.\n * @property {string} shareTitle - The title to share.\n * @property {string} shareText - The text to share.\n * @property {File[]} shareFiles - The files to share.\n *\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {string} share-url - Reflects the shareUrl property.\n * @attribute {string} share-title - Reflects the shareTitle property.\n * @attribute {string} share-text - Reflects the shareText property.\n *\n * @slot button - The button to share content.\n * @slot button-content - The content of the button to share content.\n *\n * @csspart button - The button to share content.\n * @csspart button--disabled - The button to share content when disabled.\n *\n * @event web-share:success - Fired when the share operation is successful.\n * @event web-share:abort - Fired when the share operation is aborted.\n * @event web-share:error - Fired when the share operation fails.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method share - Instance method. Shares the shareable data taken from the element's properties.\n */\nclass WebShare extends HTMLElement {\n /** @type {Nullable} */\n #buttonSlot;\n\n /** @type {Nullable} */\n #buttonEl;\n\n /** @type {File[]} */\n #files = [];\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open', delegatesFocus: true });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n this.#buttonSlot = this.shadowRoot?.querySelector('slot[name=\"button\"]') || null;\n this.#buttonEl = this.#getButton();\n }\n\n static get observedAttributes() {\n return ['disabled'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'disabled' && oldValue !== newValue && this.#buttonEl) {\n this.#buttonEl.toggleAttribute('disabled', this.disabled);\n this.#buttonEl.setAttribute('aria-disabled', this.disabled.toString());\n\n if (this.#buttonEl.part && this.#buttonEl.part.contains('button')) {\n this.#buttonEl.part.toggle('button--disabled', this.disabled);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('shareUrl');\n this.#upgradeProperty('shareTitle');\n this.#upgradeProperty('shareText');\n this.#upgradeProperty('shareFiles');\n this.#upgradeProperty('disabled');\n\n this.#buttonSlot?.addEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.addEventListener('click', this.#handleClick);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#buttonSlot?.removeEventListener('slotchange', this.#handleSlotChange);\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n }\n\n /**\n * @type {boolean} - Indicates whether the button is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {string} - The URL to share.\n * @attribute share-url - Reflects the shareUrl property.\n */\n get shareUrl() {\n return this.getAttribute('share-url') || '';\n }\n\n set shareUrl(value) {\n this.setAttribute('share-url', value);\n }\n\n /**\n * @type {string} - The title to share.\n * @attribute share-title - Reflects the shareTitle property.\n */\n get shareTitle() {\n return this.getAttribute('share-title') || '';\n }\n\n set shareTitle(value) {\n this.setAttribute('share-title', value);\n }\n\n /**\n * @type {string} - The text to share.\n * @attribute share-text - Reflects the shareText property.\n */\n get shareText() {\n return this.getAttribute('share-text') || '';\n }\n\n set shareText(value) {\n this.setAttribute('share-text', value);\n }\n\n /**\n * @type {File[]} - The files to share.\n */\n get shareFiles() {\n return this.#files;\n }\n\n set shareFiles(value) {\n if (Array.isArray(value) && value.length > 0) {\n this.#files = value;\n }\n }\n\n /**\n * Shares the shareable data taken from the element's properties.\n *\n * @returns {Promise} - A promise that resolves when the share operation is complete.\n */\n async share() {\n if (this.disabled) {\n return;\n }\n\n try {\n /** @type {ShareData} */\n const shareData = {};\n\n if (this.shareUrl) {\n shareData.url = this.shareUrl;\n }\n\n if (this.shareTitle) {\n shareData.title = this.shareTitle;\n }\n\n if (this.shareText) {\n shareData.text = this.shareText;\n }\n\n if (\n Array.isArray(this.shareFiles)\n && this.shareFiles.length > 0\n && navigator.canShare\n && navigator.canShare({ files: this.shareFiles })\n ) {\n shareData.files = this.shareFiles;\n }\n\n await navigator.share(shareData);\n\n this.dispatchEvent(new CustomEvent('web-share:success', {\n bubbles: true,\n composed: true,\n detail: { shareData }\n }));\n } catch (error) {\n if (error instanceof Error && error.name === 'AbortError') {\n this.dispatchEvent(new CustomEvent('web-share:abort', {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n\n return;\n }\n\n this.dispatchEvent(new CustomEvent('web-share:error', {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n }\n\n /**\n * Handles the click event on the button.\n *\n * @param {any} evt - The event object.\n */\n #handleClick = evt => {\n evt.preventDefault();\n\n if (this.disabled) {\n return;\n }\n\n this.share();\n };\n\n /**\n * Handles the slotchange event on the button slot.\n *\n * @param {any} evt - The event object.\n */\n #handleSlotChange = evt => {\n if (evt.target && evt.target.name === 'button') {\n this.#buttonEl?.removeEventListener('click', this.#handleClick);\n this.#buttonEl = this.#getButton();\n\n if (this.#buttonEl) {\n this.#buttonEl.addEventListener('click', this.#handleClick);\n\n if (this.#buttonEl.nodeName !== 'BUTTON' && !this.#buttonEl.hasAttribute('role')) {\n this.#buttonEl.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the button element from the button slot.\n *\n * @returns {Nullable} - The button element.\n */\n #getButton() {\n if (!this.#buttonSlot) {\n return null;\n }\n\n return this.#buttonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'button';\n }) || null;\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'shareUrl' | 'shareTitle' | 'shareText' | 'shareFiles' | 'disabled'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n static defineCustomElement(elementName = 'web-share') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, WebShare);\n }\n }\n}\n\nexport { WebShare };\n","Object.defineProperty({},\"CapturePhoto\",{get:function(){return n},set:void 0,enumerable:!0,configurable:!0});let t=(t,e,i)=>(Number.isNaN(e)&&(e=0),Number.isNaN(i)&&(i=0),Math.min(Math.max(t,Math.min(e,i)),Math.max(e,i))),e=\"capture-photo\",i=`\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`,o=document.createElement(\"template\");o.innerHTML=`\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;class n extends HTMLElement{#t={};#e=null;#i=null;#o=null;#n=null;#a=null;#s=null;#r=null;#l=null;constructor(){super(),this.#t=this.getSupportedConstraints(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(o.content.cloneNode(!0))}static get observedAttributes(){return[\"no-image\",\"facing-mode\",\"camera-resolution\",\"pan\",\"tilt\",\"zoom\"]}attributeChangedCallback(t,e,i){if(!this.isConnected)return;let o=this.getTrackCapabilities(),n=this.getTrackSettings();if(\"no-image\"===t&&e!==i&&this.#u(),\"facing-mode\"===t&&e!==i&&\"facingMode\"in this.#t){let t=[\"user\",\"environment\"].includes(this.facingMode||\"\");\"facingMode\"in n&&t&&(this.stopVideoStream(),this.startVideoStream())}if(\"camera-resolution\"===t&&e!==i&&\"string\"==typeof this.cameraResolution&&this.cameraResolution.trim().length>0){let[t=0,e=0]=this.cameraResolution.split(\"x\").map(t=>Number(t));if(t>0&&e>0&&\"width\"in o&&\"height\"in o){let i=!!(o.width?.min&&o.width?.max)&&t>=o?.width?.min&&t<=o?.width?.max,a=!!(o.height?.min&&o.height?.max)&&e>=o?.height?.min&&e<=o?.height?.max;\"width\"in n&&\"height\"in n&&i&&a&&(this.stopVideoStream(),this.startVideoStream())}}if(\"pan\"===t&&e!==i&&\"pan\"in this.#t){let t=!!(\"pan\"in o&&o.pan?.min&&o.pan?.max)&&this.pan>=o.pan.min&&this.pan<=o.pan.max;\"pan\"in n&&\"number\"==typeof this.pan&&t&&this.#h(\"pan\",this.pan)}if(\"tilt\"===t&&e!==i&&\"tilt\"in this.#t){let t=!!(\"tilt\"in o&&o.tilt?.min&&o.tilt?.max)&&this.tilt>=o.tilt.min&&this.tilt<=o.tilt.max;\"tilt\"in n&&\"number\"==typeof this.tilt&&t&&this.#h(\"tilt\",this.tilt)}if(\"zoom\"===t&&e!==i&&\"zoom\"in this.#t){let t=!!(\"zoom\"in o&&o.zoom?.min&&o.zoom?.max)&&this.zoom>=o.zoom.min&&this.zoom<=o.zoom.max;\"zoom\"in n&&\"number\"==typeof this.zoom&&t&&this.#h(\"zoom\",this.zoom)}}connectedCallback(){if(this.#d(\"autpoPlay\"),this.#d(\"noImage\"),this.#d(\"facingMode\"),this.#d(\"cameraResolution\"),this.#d(\"pan\"),this.#d(\"tilt\"),this.#d(\"zoom\"),this.#d(\"calculateFileSize\"),this.#i=this.shadowRoot?.querySelector(\"canvas\")||null,this.#o=this.shadowRoot?.getElementById(\"output\")||null,this.#n=this.shadowRoot?.querySelector(\"video\")||null,this.#a=this.shadowRoot?.querySelector('slot[name=\"capture-button\"]')||null,this.#s=this.#c(),this.#r=this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]')||null,this.#l=this.#m(),this.#n?.addEventListener(\"loadedmetadata\",this.#p),this.#a?.addEventListener(\"slotchange\",this.#g),this.#s?.addEventListener(\"click\",this.#b),this.#r?.addEventListener(\"slotchange\",this.#f),this.#l?.addEventListener(\"click\",this.#v),!n.isSupported())return this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:{name:\"NotSupportedError\",message:\"Not supported\"}}}));this.autoPlay&&this.startVideoStream()}disconnectedCallback(){this.stopVideoStream(),this.#l?.removeEventListener(\"click\",this.#v),this.#s?.removeEventListener(\"click\",this.#b),this.#n?.removeEventListener(\"canplay\",this.#p),this.#a?.removeEventListener(\"slotchange\",this.#g),this.#r?.removeEventListener(\"slotchange\",this.#f)}get autoPlay(){return this.hasAttribute(\"auto-play\")}set autoPlay(t){this.toggleAttribute(\"auto-play\",!!t)}get noImage(){return this.hasAttribute(\"no-image\")}set noImage(t){this.toggleAttribute(\"no-image\",!!t)}get facingMode(){return this.getAttribute(\"facing-mode\")||\"user\"}set facingMode(t){this.setAttribute(\"facing-mode\",t)}get cameraResolution(){return this.getAttribute(\"camera-resolution\")||\"\"}set cameraResolution(t){this.setAttribute(\"camera-resolution\",t)}get pan(){return Number(this.getAttribute(\"pan\"))||0}set pan(t){this.setAttribute(\"pan\",null!=t?t.toString():t)}get tilt(){return Number(this.getAttribute(\"tilt\"))||0}set tilt(t){this.setAttribute(\"tilt\",null!=t?t.toString():t)}get zoom(){return Number(this.getAttribute(\"zoom\"))||1}set zoom(t){this.setAttribute(\"zoom\",null!=t?t.toString():t)}get loading(){return this.hasAttribute(\"loading\")}get calculateFileSize(){return this.hasAttribute(\"calculate-file-size\")}set calculateFileSize(t){this.toggleAttribute(\"calculate-file-size\",!!t)}#v=t=>{t.preventDefault(),this.loading||(this.facingMode=\"user\"!==this.facingMode&&this.facingMode?\"user\":\"environment\")};#b=t=>{t.preventDefault(),this.capture()};#p=t=>{let i=t.target;i.play().then(()=>{this.dispatchEvent(new CustomEvent(`${e}:video-play`,{bubbles:!0,composed:!0,detail:{video:i}}))}).catch(t=>{this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}).finally(()=>{this.removeAttribute(\"loading\")})};#u(){this.#o&&Array.from(this.#o.childNodes).forEach(t=>t.remove())}#h(e,i){if(!this.#e||!e||!i)return;let[o]=this.#e.getVideoTracks(),n=this.getTrackCapabilities();e in this.getTrackSettings()&&o.applyConstraints({advanced:[{[e]:t(Number(i),n[e]?.min||1,n[e]?.max||1)}]})}#g=t=>{t.target?.name===\"capture-button\"&&(this.#s?.removeEventListener(\"click\",this.#b),this.#s=this.#c(),this.#s&&(this.#s.addEventListener(\"click\",this.#b),\"BUTTON\"===this.#s.nodeName||this.#s.hasAttribute(\"role\")||this.#s.setAttribute(\"role\",\"button\")))};#f=t=>{t.target?.name===\"facing-mode-button\"&&(this.#l?.removeEventListener(\"click\",this.#v),this.#l=this.#m(),this.#l&&(this.#l.addEventListener(\"click\",this.#v),\"BUTTON\"===this.#l.nodeName||this.#l.hasAttribute(\"role\")||this.#l.setAttribute(\"role\",\"button\")))};#m(){return this.#r&&this.#r.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"facing-mode-button\"===t.getAttribute(\"slot\"))||null}#c(){return this.#a&&this.#a.assignedElements({flatten:!0}).find(t=>\"BUTTON\"===t.nodeName||\"capture-button\"===t.getAttribute(\"slot\"))||null}#d(t){if(Object.prototype.hasOwnProperty.call(this,t)){let e=this[t];delete this[t],this[t]=e}}async startVideoStream(){if(!n.isSupported()||this.#e)return;this.setAttribute(\"loading\",\"\");let t={video:{facingMode:{ideal:this.facingMode||\"user\"},pan:!0,tilt:!0,zoom:!0},audio:!1};if(\"string\"==typeof this.cameraResolution&&this.cameraResolution.trim().length>0){let[e=0,i=0]=this.cameraResolution.split(\"x\").map(t=>Number(t));e>0&&i>0&&(t.video.width=e,t.video.height=i)}try{this.#e=await navigator.mediaDevices.getUserMedia(t),this.#n&&(this.#n.srcObject=this.#e),this.#h(\"pan\",this.pan),this.#h(\"tilt\",this.tilt),this.#h(\"zoom\",this.zoom);let e=this.getTrackSettings();\"facingMode\"in e&&this.#r&&(this.#r.hidden=!1)}catch(t){this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}finally{this.removeAttribute(\"loading\")}}stopVideoStream(){if(!this.#n||!this.#e)return;let[t]=this.#e.getVideoTracks();t?.stop(),this.#n.srcObject=null,this.#e=null}async capture(){if(!this.loading&&this.#i&&this.#n)try{let t=this.#i.getContext(\"2d\"),i=this.#n.videoWidth,o=this.#n.videoHeight;this.#i.width=i,this.#i.height=o,t?.drawImage(this.#n,0,0,i,o);let n=this.#i.toDataURL(\"image/png\");if(\"string\"==typeof n&&n.includes(\"data:image\")){if(!this.noImage){let t=new Image;t.src=n,t.width=i,t.height=o,t.setAttribute(\"part\",\"output-image\"),this.#u(),this.#o?.appendChild(t)}let t={dataURI:n,width:i,height:o};if(this.calculateFileSize)try{let e=await fetch(n),i=(await e.blob()).size;i&&(t.size=i)}catch(t){}this.dispatchEvent(new CustomEvent(`${e}:success`,{bubbles:!0,composed:!0,detail:t}))}}catch(t){this.dispatchEvent(new CustomEvent(`${e}:error`,{bubbles:!0,composed:!0,detail:{error:t}}))}}getSupportedConstraints(){return n.isSupported()&&navigator.mediaDevices.getSupportedConstraints()||{}}getTrackCapabilities(){if(!this.#e)return{};let[t]=this.#e.getVideoTracks();return t&&\"function\"==typeof t.getCapabilities&&t.getCapabilities()||{}}getTrackSettings(){if(!this.#e)return{};let[t]=this.#e.getVideoTracks();return t&&\"function\"==typeof t.getSettings&&t.getSettings()||{}}static isSupported(){return!!navigator.mediaDevices?.getUserMedia}static defineCustomElement(t=e){\"undefined\"==typeof window||window.customElements.get(t)||window.customElements.define(t,n)}}n.defineCustomElement();export{n as CapturePhoto};\n//# sourceMappingURL=capture-photo-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $c290816263f90981$exports = {};\n\n$parcel$export($c290816263f90981$exports, \"CapturePhoto\", function () { return $c290816263f90981$export$cc30a98fe3890794; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ /**\n * @typedef {Object} ExtendedMediaTrackCapabilities\n * @property {ULongRange} [width] - The width of the video track.\n * @property {ULongRange} [height] - The height of the video track.\n * @property {ULongRange} [pan] - The pan level of the camera.\n * @property {ULongRange} [tilt] - The tilt level of the camera.\n * @property {ULongRange} [zoom] - The zoom level of the camera.\n * @property {MediaTrackCapabilities} [nativeMediaTrackCapabilities] - The native track capabilities.\n */ /**\n * @typedef {Object} ExtendedMediaTrackConstraints\n * @property {MediaTrackConstraints & {pan: boolean, tilt: boolean, zoom: boolean}} video - The video constraints.\n * @property {MediaTrackConstraints | boolean} audio - The audio constraints.\n */ // @ts-check\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */ const $02ad8beec419df62$export$7d15b64cf5a3a4c4 = (value, lower, upper)=>{\n if (Number.isNaN(lower)) lower = 0;\n if (Number.isNaN(upper)) upper = 0;\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n\n\nconst $c290816263f90981$var$COMPONENT_NAME = \"capture-photo\";\nconst $c290816263f90981$var$styles = /* css */ `\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`;\nconst $c290816263f90981$var$template = document.createElement(\"template\");\n$c290816263f90981$var$template.innerHTML = /* html */ `\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\n/**\n * @summary A custom element that implements the MediaDevices.getUserMedia() method of the MediaDevices interface to capture a photo in the browser.\n * @documentation https://github.com/georapbox/capture-photo-element\n *\n * @tagname capture-photo This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @property {boolean} noImage - Whether or not to show the captured image.\n * @property {string} facingMode - The facing mode of the camera.\n * @property {string} cameraResolution - The resolution of the camera.\n * @property {number} pan - The pan value of the camera.\n * @property {number} tilt - The tilt value of the camera.\n * @property {number} zoom - The zoom value of the camera.\n * @property {boolean} loading - Whether or not the video stream is loading.\n * @property {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n *\n * @atttribute {boolean} auto-play - Reflects the autoPlay property.\n * @atttribute {boolean} no-image - Reflects the noImage property.\n * @atttribute {string} facing-mode - Reflects the facingMode property.\n * @atttribute {string} camera-resolution - Reflects the cameraResolution property.\n * @atttribute {number} pan - Reflects the pan property.\n * @atttribute {number} tilt - Reflects the tilt property.\n * @atttribute {number} zoom - Reflects the zoom property.\n * @atttribute {boolean} loading - Reflects the loading property.\n * @atttribute {boolean} calculate-file-size - Reflects the calculateFileSize property.\n *\n * @slot capture-button - The capture button.\n * @slot capture-button-content - The capture button content.\n * @slot facing-mode-button - The facing mode button.\n * @slot facing-mode-button-content - The facing mode button content.\n * @slot actions - The actions container.\n * @slot - A default un-named slot to add content inside the component.\n *\n * @csspart video - The video element.\n * @csspart actions-container - The actions container.\n * @csspart capture-button - The capture button.\n * @csspart facing-mode-button - The facing mode button.\n * @csspart output-container - The output container.\n * @csspart output-image - The output image.\n *\n * @event capture-photo:video-play - Fires when the video stream is successfully playing.\n * @event capture-photo:success - Fires when the photo is successfully captured.\n * @event capture-photo:error - Fires when an error occurs.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method isSupported - Static method. Checks if the MediaDevices.getUserMedia() method is supported.\n * @method startVideoStream - Instance method. Starts the video stream.\n * @method stopVideoStream - Instance method. Stops the video stream.\n * @method capture - Instance method. Captures a photo.\n * @method getSupportedConstraints - Instance method. Gets the supported constraints.\n * @method getTrackCapabilities - Instance method. Gets the track capabilities.\n * @method getTrackSettings - Instance method. Gets the track settings.\n */ class $c290816263f90981$export$cc30a98fe3890794 extends HTMLElement {\n /** @type {MediaTrackSupportedConstraints | {}}*/ #supportedConstraints = {};\n /** @type {Nullable} */ #stream = null;\n /** @type {Nullable} */ #canvasElement = null;\n /** @type {Nullable} */ #outputElement = null;\n /** @type {Nullable} */ #videoElement = null;\n /** @type {Nullable} */ #captureButtonSlot = null;\n /** @type {Nullable} */ #captureButton = null;\n /** @type {Nullable} */ #facingModeButtonSlot = null;\n /** @type {Nullable} */ #facingModeButton = null;\n constructor(){\n super();\n this.#supportedConstraints = this.getSupportedConstraints();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($c290816263f90981$var$template.content.cloneNode(true));\n }\n }\n static get observedAttributes() {\n return [\n \"no-image\",\n \"facing-mode\",\n \"camera-resolution\",\n \"pan\",\n \"tilt\",\n \"zoom\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) return;\n /** @type {ExtendedMediaTrackCapabilities} */ const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n if (name === \"no-image\" && oldValue !== newValue) this.#emptyOutputElement();\n if (name === \"facing-mode\" && oldValue !== newValue && \"facingMode\" in this.#supportedConstraints) {\n const isValidFacingMode = [\n \"user\",\n \"environment\"\n ].includes(this.facingMode || \"\");\n if (\"facingMode\" in trackSettings && isValidFacingMode) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n if (name === \"camera-resolution\" && oldValue !== newValue) {\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0 && \"width\" in trackCapabilities && \"height\" in trackCapabilities) {\n const widthInAllowedRange = trackCapabilities.width?.min && trackCapabilities.width?.max ? width >= trackCapabilities?.width?.min && width <= trackCapabilities?.width?.max : false;\n const heightInAllowedRange = trackCapabilities.height?.min && trackCapabilities.height?.max ? height >= trackCapabilities?.height?.min && height <= trackCapabilities?.height?.max : false;\n if (\"width\" in trackSettings && \"height\" in trackSettings && widthInAllowedRange && heightInAllowedRange) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n }\n }\n if (name === \"pan\" && oldValue !== newValue && \"pan\" in this.#supportedConstraints) {\n const panInAllowedRange = \"pan\" in trackCapabilities && trackCapabilities.pan?.min && trackCapabilities.pan?.max ? this.pan >= trackCapabilities.pan.min && this.pan <= trackCapabilities.pan.max : false;\n if (\"pan\" in trackSettings && typeof this.pan === \"number\" && panInAllowedRange) this.#applyPTZ(\"pan\", this.pan);\n }\n if (name === \"tilt\" && oldValue !== newValue && \"tilt\" in this.#supportedConstraints) {\n const tiltInAllowedRange = \"tilt\" in trackCapabilities && trackCapabilities.tilt?.min && trackCapabilities.tilt?.max ? this.tilt >= trackCapabilities.tilt.min && this.tilt <= trackCapabilities.tilt.max : false;\n if (\"tilt\" in trackSettings && typeof this.tilt === \"number\" && tiltInAllowedRange) this.#applyPTZ(\"tilt\", this.tilt);\n }\n if (name === \"zoom\" && oldValue !== newValue && \"zoom\" in this.#supportedConstraints) {\n const zoomInAllowedRange = \"zoom\" in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max : false;\n if (\"zoom\" in trackSettings && typeof this.zoom === \"number\" && zoomInAllowedRange) this.#applyPTZ(\"zoom\", this.zoom);\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"autpoPlay\");\n this.#upgradeProperty(\"noImage\");\n this.#upgradeProperty(\"facingMode\");\n this.#upgradeProperty(\"cameraResolution\");\n this.#upgradeProperty(\"pan\");\n this.#upgradeProperty(\"tilt\");\n this.#upgradeProperty(\"zoom\");\n this.#upgradeProperty(\"calculateFileSize\");\n this.#canvasElement = this.shadowRoot?.querySelector(\"canvas\") || null;\n this.#outputElement = this.shadowRoot?.getElementById(\"output\") || null;\n this.#videoElement = this.shadowRoot?.querySelector(\"video\") || null;\n this.#captureButtonSlot = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null;\n this.#captureButton = this.#getCaptureButton();\n this.#facingModeButtonSlot = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null;\n this.#facingModeButton = this.#getFacingModeButton();\n this.#videoElement?.addEventListener(\"loadedmetadata\", this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.addEventListener(\"slotchange\", this.#onCaptureButtonSlotChange);\n this.#captureButton?.addEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#facingModeButtonSlot?.addEventListener(\"slotchange\", this.#onFacingModeButtonSlotChange);\n this.#facingModeButton?.addEventListener(\"click\", this.#onFacingModeButtonClick);\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported()) return this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: \"NotSupportedError\",\n message: \"Not supported\"\n }\n }\n }));\n if (this.autoPlay) this.startVideoStream();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.stopVideoStream();\n this.#facingModeButton?.removeEventListener(\"click\", this.#onFacingModeButtonClick);\n this.#captureButton?.removeEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#videoElement?.removeEventListener(\"canplay\", this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.removeEventListener(\"slotchange\", this.#onCaptureButtonSlotChange);\n this.#facingModeButtonSlot?.removeEventListener(\"slotchange\", this.#onFacingModeButtonSlotChange);\n }\n /**\n * @type {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @attribute auto-play - Reflects the autoPlay attribute.\n */ get autoPlay() {\n return this.hasAttribute(\"auto-play\");\n }\n set autoPlay(value) {\n this.toggleAttribute(\"auto-play\", !!value);\n }\n /**\n * @type {boolean} noImage - Whether or not to show the captured image.\n * @attribute no-image - Reflects the noImage attribute.\n */ get noImage() {\n return this.hasAttribute(\"no-image\");\n }\n set noImage(value) {\n this.toggleAttribute(\"no-image\", !!value);\n }\n /**\n * @type {string} facingMode - The facing mode of the camera.\n * @attribute facing-mode - Reflects the facingMode attribute.\n */ get facingMode() {\n return this.getAttribute(\"facing-mode\") || \"user\";\n }\n set facingMode(value) {\n this.setAttribute(\"facing-mode\", value);\n }\n /**\n * @type {string} cameraResolution - The resolution of the camera.\n * @attribute camera-resolution - Reflects the cameraResolution attribute.\n */ get cameraResolution() {\n return this.getAttribute(\"camera-resolution\") || \"\";\n }\n set cameraResolution(value) {\n this.setAttribute(\"camera-resolution\", value);\n }\n /**\n * @type {number} pan - The pan value of the camera.\n * @attribute pan - Reflects the pan attribute.\n */ get pan() {\n return Number(this.getAttribute(\"pan\")) || 0;\n }\n set pan(value) {\n this.setAttribute(\"pan\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} tilt - The tilt value of the camera.\n * @attribute tilt - Reflects the tilt attribute.\n */ get tilt() {\n return Number(this.getAttribute(\"tilt\")) || 0;\n }\n set tilt(value) {\n this.setAttribute(\"tilt\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} zoom - The zoom value of the camera.\n * @attribute zoom - Reflects the zoom attribute.\n */ get zoom() {\n return Number(this.getAttribute(\"zoom\")) || 1;\n }\n set zoom(value) {\n this.setAttribute(\"zoom\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} loading - Whether or not the video stream is loading.\n * @attribute loading - Reflects the loading attribute.\n */ get loading() {\n return this.hasAttribute(\"loading\");\n }\n /**\n * @type {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n * @attribute calculate-file-size - Reflects the calculateFileSize attribute.\n */ get calculateFileSize() {\n return this.hasAttribute(\"calculate-file-size\");\n }\n set calculateFileSize(value) {\n this.toggleAttribute(\"calculate-file-size\", !!value);\n }\n /**\n * Handles the click event of the facing mode button.\n *\n * @param {*} evt - The click event.\n */ #onFacingModeButtonClick = (evt)=>{\n evt.preventDefault();\n if (this.loading) return;\n this.facingMode = this.facingMode === \"user\" || !this.facingMode ? \"environment\" : \"user\";\n };\n /**\n * Handles the click event of the capture button.\n *\n * @param {*} evt - The click event.\n */ #onCapturePhotoButtonClick = (evt)=>{\n evt.preventDefault();\n this.capture();\n };\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {*} evt - The loadedmetadata event.\n */ #onVideoLoadedMetaData = (evt)=>{\n const video = evt.target;\n video.play().then(()=>{\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: {\n video: video\n }\n }));\n }).catch(/** @param {Error} error */ (error)=>{\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }).finally(()=>{\n this.removeAttribute(\"loading\");\n });\n };\n /**\n * Removes all child nodes from the output element.\n */ #emptyOutputElement() {\n if (!this.#outputElement) return;\n Array.from(this.#outputElement.childNodes).forEach((node)=>node.remove());\n }\n /**\n * Applies the pan, tilt or zoom constraint.\n *\n * @param {'pan' | 'tilt' | 'zoom'} constraintName - The name of the constraint.\n * @param {number} constraintValue - The value of the constraint.\n */ #applyPTZ(constraintName, constraintValue) {\n if (!this.#stream || !constraintName || !constraintValue) return;\n const [track] = this.#stream.getVideoTracks();\n /** @type {ExtendedMediaTrackCapabilities} */ const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n if (constraintName in trackSettings) track.applyConstraints({\n advanced: [\n {\n [constraintName]: (0, $02ad8beec419df62$export$7d15b64cf5a3a4c4)(Number(constraintValue), trackCapabilities[constraintName]?.min || 1, trackCapabilities[constraintName]?.max || 1)\n }\n ]\n });\n }\n /**\n * Handles the slotchange event of the capture button slot.\n *\n * @param {*} evt - The slotchange event.\n */ #onCaptureButtonSlotChange = (evt)=>{\n if (evt.target?.name === \"capture-button\") {\n this.#captureButton?.removeEventListener(\"click\", this.#onCapturePhotoButtonClick);\n this.#captureButton = this.#getCaptureButton();\n if (this.#captureButton) {\n this.#captureButton.addEventListener(\"click\", this.#onCapturePhotoButtonClick);\n if (this.#captureButton.nodeName !== \"BUTTON\" && !this.#captureButton.hasAttribute(\"role\")) this.#captureButton.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Handles the slotchange event of the facing mode button slot.\n *\n * @param {*} evt - The slotchange event.\n */ #onFacingModeButtonSlotChange = (evt)=>{\n if (evt.target?.name === \"facing-mode-button\") {\n this.#facingModeButton?.removeEventListener(\"click\", this.#onFacingModeButtonClick);\n this.#facingModeButton = this.#getFacingModeButton();\n if (this.#facingModeButton) {\n this.#facingModeButton.addEventListener(\"click\", this.#onFacingModeButtonClick);\n if (this.#facingModeButton.nodeName !== \"BUTTON\" && !this.#facingModeButton.hasAttribute(\"role\")) this.#facingModeButton.setAttribute(\"role\", \"button\");\n }\n }\n };\n /**\n * Returns the facing mode button.\n *\n * @returns {Nullable}\n */ #getFacingModeButton() {\n if (!this.#facingModeButtonSlot) return null;\n return this.#facingModeButtonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"facing-mode-button\";\n }) || null;\n }\n /**\n * Returns the capture button.\n *\n * @returns {Nullable}\n */ #getCaptureButton() {\n if (!this.#captureButtonSlot) return null;\n return this.#captureButtonSlot.assignedElements({\n flatten: true\n }).find((el)=>{\n return el.nodeName === \"BUTTON\" || el.getAttribute(\"slot\") === \"capture-button\";\n }) || null;\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'autpoPlay' | 'noImage' | 'facingMode' | 'cameraResolution' | 'pan' | 'tilt' | 'zoom' | 'calculateFileSize'} prop\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Starts the video stream.\n *\n * @returns Promise\n */ async startVideoStream() {\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported() || this.#stream) return;\n this.setAttribute(\"loading\", \"\");\n /** @type {ExtendedMediaTrackConstraints} */ const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || \"user\"\n },\n pan: true,\n tilt: true,\n zoom: true\n },\n audio: false\n };\n if (typeof this.cameraResolution === \"string\" && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split(\"x\").map((x)=>Number(x));\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n if (this.#videoElement) this.#videoElement.srcObject = this.#stream;\n this.#applyPTZ(\"pan\", this.pan);\n this.#applyPTZ(\"tilt\", this.tilt);\n this.#applyPTZ(\"zoom\", this.zoom);\n const trackSettings = this.getTrackSettings();\n if (\"facingMode\" in trackSettings && this.#facingModeButtonSlot) this.#facingModeButtonSlot.hidden = false;\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n } finally{\n this.removeAttribute(\"loading\");\n }\n }\n /**\n * Stops the video stream.\n */ stopVideoStream() {\n if (!this.#videoElement || !this.#stream) return;\n const [track] = this.#stream.getVideoTracks();\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n /**\n * Captures a photo using the element's properties.\n *\n * @returns Promise\n */ async capture() {\n if (this.loading || !this.#canvasElement || !this.#videoElement) return;\n try {\n const ctx = this.#canvasElement.getContext(\"2d\");\n const width = this.#videoElement.videoWidth;\n const height = this.#videoElement.videoHeight;\n this.#canvasElement.width = width;\n this.#canvasElement.height = height;\n ctx?.drawImage(this.#videoElement, 0, 0, width, height);\n const dataURI = this.#canvasElement.toDataURL(\"image/png\");\n if (typeof dataURI === \"string\" && dataURI.includes(\"data:image\")) {\n if (!this.noImage) {\n const image = new Image();\n image.src = dataURI;\n image.width = width;\n image.height = height;\n image.setAttribute(\"part\", \"output-image\");\n this.#emptyOutputElement();\n this.#outputElement?.appendChild(image);\n }\n /** @type {{ dataURI: string, width: number, height: number, size?: number }} */ const eventDetail = {\n dataURI: dataURI,\n width: width,\n height: height\n };\n if (this.calculateFileSize) try {\n const file = await fetch(dataURI);\n const blob = await file.blob();\n const size = blob.size;\n if (size) eventDetail.size = size;\n } catch (err) {\n // Fail silently...\n }\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:success`, {\n bubbles: true,\n composed: true,\n detail: eventDetail\n }));\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$c290816263f90981$var$COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n }\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */ getSupportedConstraints() {\n if (!$c290816263f90981$export$cc30a98fe3890794.isSupported()) return {};\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */ getTrackCapabilities() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getCapabilities === \"function\") return track.getCapabilities() || {};\n return {};\n }\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */ getTrackSettings() {\n if (!this.#stream) return {};\n const [track] = this.#stream.getVideoTracks();\n if (track && typeof track.getSettings === \"function\") return track.getSettings() || {};\n return {};\n }\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */ static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='capture-photo'] - The name of the custom element.\n * @example\n *\n * CapturePhoto.defineCustomElement('my-capture-photo');\n */ static defineCustomElement(elementName = $c290816263f90981$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $c290816263f90981$export$cc30a98fe3890794);\n }\n}\n\n\n(0, $c290816263f90981$export$cc30a98fe3890794).defineCustomElement();\n\n\nexport {$c290816263f90981$export$cc30a98fe3890794 as CapturePhoto};\n//# sourceMappingURL=capture-photo-defined.js.map\n","import { CapturePhoto } from './capture-photo.js';\n\nCapturePhoto.defineCustomElement();\n\nexport { CapturePhoto };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\n/**\n * @typedef {Object} ExtendedMediaTrackCapabilities\n * @property {ULongRange} [width] - The width of the video track.\n * @property {ULongRange} [height] - The height of the video track.\n * @property {ULongRange} [pan] - The pan level of the camera.\n * @property {ULongRange} [tilt] - The tilt level of the camera.\n * @property {ULongRange} [zoom] - The zoom level of the camera.\n * @property {MediaTrackCapabilities} [nativeMediaTrackCapabilities] - The native track capabilities.\n */\n\n/**\n * @typedef {Object} ExtendedMediaTrackConstraints\n * @property {MediaTrackConstraints & {pan: boolean, tilt: boolean, zoom: boolean}} video - The video constraints.\n * @property {MediaTrackConstraints | boolean} audio - The audio constraints.\n */\n\nimport { clamp } from './utils/clamp.js';\n\nconst COMPONENT_NAME = 'capture-photo';\n\nconst styles = /* css */`\n :host {\n display: block;\n box-sizing: border-box;\n }\n\n :host *,\n :host *::before,\n :host *::after {\n box-sizing: inherit;\n }\n\n :host([hidden]),\n [hidden],\n ::slotted([hidden]) {\n display: none;\n }\n\n video {\n display: block;\n }\n\n #output:empty {\n display: none;\n }\n`;\n\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */`\n \n\n \n\n \n\n
\n \n \n \n\n \n\n \n
\n\n \n\n
\n`;\n\n/**\n * @summary A custom element that implements the MediaDevices.getUserMedia() method of the MediaDevices interface to capture a photo in the browser.\n * @documentation https://github.com/georapbox/capture-photo-element\n *\n * @tagname capture-photo This is the default tag name, unless overridden by the `defineCustomElement` method.\n * @extends HTMLElement\n *\n * @property {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @property {boolean} noImage - Whether or not to show the captured image.\n * @property {string} facingMode - The facing mode of the camera.\n * @property {string} cameraResolution - The resolution of the camera.\n * @property {number} pan - The pan value of the camera.\n * @property {number} tilt - The tilt value of the camera.\n * @property {number} zoom - The zoom value of the camera.\n * @property {boolean} loading - Whether or not the video stream is loading.\n * @property {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n *\n * @atttribute {boolean} auto-play - Reflects the autoPlay property.\n * @atttribute {boolean} no-image - Reflects the noImage property.\n * @atttribute {string} facing-mode - Reflects the facingMode property.\n * @atttribute {string} camera-resolution - Reflects the cameraResolution property.\n * @atttribute {number} pan - Reflects the pan property.\n * @atttribute {number} tilt - Reflects the tilt property.\n * @atttribute {number} zoom - Reflects the zoom property.\n * @atttribute {boolean} loading - Reflects the loading property.\n * @atttribute {boolean} calculate-file-size - Reflects the calculateFileSize property.\n *\n * @slot capture-button - The capture button.\n * @slot capture-button-content - The capture button content.\n * @slot facing-mode-button - The facing mode button.\n * @slot facing-mode-button-content - The facing mode button content.\n * @slot actions - The actions container.\n * @slot - A default un-named slot to add content inside the component.\n *\n * @csspart video - The video element.\n * @csspart actions-container - The actions container.\n * @csspart capture-button - The capture button.\n * @csspart facing-mode-button - The facing mode button.\n * @csspart output-container - The output container.\n * @csspart output-image - The output image.\n *\n * @event capture-photo:video-play - Fires when the video stream is successfully playing.\n * @event capture-photo:success - Fires when the photo is successfully captured.\n * @event capture-photo:error - Fires when an error occurs.\n *\n * @method defineCustomElement - Static method. Defines the custom element with the given name.\n * @method isSupported - Static method. Checks if the MediaDevices.getUserMedia() method is supported.\n * @method startVideoStream - Instance method. Starts the video stream.\n * @method stopVideoStream - Instance method. Stops the video stream.\n * @method capture - Instance method. Captures a photo.\n * @method getSupportedConstraints - Instance method. Gets the supported constraints.\n * @method getTrackCapabilities - Instance method. Gets the track capabilities.\n * @method getTrackSettings - Instance method. Gets the track settings.\n */\nclass CapturePhoto extends HTMLElement {\n /** @type {MediaTrackSupportedConstraints | {}}*/\n #supportedConstraints = {};\n\n /** @type {Nullable} */\n #stream = null;\n\n /** @type {Nullable} */\n #canvasElement = null;\n\n /** @type {Nullable} */\n #outputElement = null;\n\n /** @type {Nullable} */\n #videoElement = null;\n\n /** @type {Nullable} */\n #captureButtonSlot = null;\n\n /** @type {Nullable} */\n #captureButton = null;\n\n /** @type {Nullable} */\n #facingModeButtonSlot = null;\n\n /** @type {Nullable} */\n #facingModeButton = null;\n\n constructor() {\n super();\n\n this.#supportedConstraints = this.getSupportedConstraints();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n }\n\n static get observedAttributes() {\n return ['no-image', 'facing-mode', 'camera-resolution', 'pan', 'tilt', 'zoom'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (!this.isConnected) {\n return;\n }\n\n /** @type {ExtendedMediaTrackCapabilities} */\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n if (name === 'no-image' && oldValue !== newValue) {\n this.#emptyOutputElement();\n }\n\n if (name === 'facing-mode' && oldValue !== newValue && 'facingMode' in this.#supportedConstraints) {\n const isValidFacingMode = ['user', 'environment'].includes(this.facingMode || '');\n\n if ('facingMode' in trackSettings && isValidFacingMode) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n\n if (name === 'camera-resolution' && oldValue !== newValue) {\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0 && 'width' in trackCapabilities && 'height' in trackCapabilities) {\n const widthInAllowedRange = trackCapabilities.width?.min && trackCapabilities.width?.max\n ? width >= trackCapabilities?.width?.min && width <= trackCapabilities?.width?.max\n : false;\n\n const heightInAllowedRange = trackCapabilities.height?.min && trackCapabilities.height?.max\n ? height >= trackCapabilities?.height?.min && height <= trackCapabilities?.height?.max\n : false;\n\n if ('width' in trackSettings && 'height' in trackSettings && widthInAllowedRange && heightInAllowedRange) {\n this.stopVideoStream();\n this.startVideoStream();\n }\n }\n }\n }\n\n if (name === 'pan' && oldValue !== newValue && 'pan' in this.#supportedConstraints) {\n const panInAllowedRange = 'pan' in trackCapabilities && trackCapabilities.pan?.min && trackCapabilities.pan?.max\n ? this.pan >= trackCapabilities.pan.min && this.pan <= trackCapabilities.pan.max\n : false;\n\n if ('pan' in trackSettings && typeof this.pan === 'number' && panInAllowedRange) {\n this.#applyPTZ('pan', this.pan);\n }\n }\n\n if (name === 'tilt' && oldValue !== newValue && 'tilt' in this.#supportedConstraints) {\n const tiltInAllowedRange = 'tilt' in trackCapabilities && trackCapabilities.tilt?.min && trackCapabilities.tilt?.max\n ? this.tilt >= trackCapabilities.tilt.min && this.tilt <= trackCapabilities.tilt.max\n : false;\n\n if ('tilt' in trackSettings && typeof this.tilt === 'number' && tiltInAllowedRange) {\n this.#applyPTZ('tilt', this.tilt);\n }\n }\n\n if (name === 'zoom' && oldValue !== newValue && 'zoom' in this.#supportedConstraints) {\n const zoomInAllowedRange = 'zoom' in trackCapabilities && trackCapabilities.zoom?.min && trackCapabilities.zoom?.max\n ? this.zoom >= trackCapabilities.zoom.min && this.zoom <= trackCapabilities.zoom.max\n : false;\n\n if ('zoom' in trackSettings && typeof this.zoom === 'number' && zoomInAllowedRange) {\n this.#applyPTZ('zoom', this.zoom);\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('autpoPlay');\n this.#upgradeProperty('noImage');\n this.#upgradeProperty('facingMode');\n this.#upgradeProperty('cameraResolution');\n this.#upgradeProperty('pan');\n this.#upgradeProperty('tilt');\n this.#upgradeProperty('zoom');\n this.#upgradeProperty('calculateFileSize');\n\n this.#canvasElement = this.shadowRoot?.querySelector('canvas') || null;\n this.#outputElement = this.shadowRoot?.getElementById('output') || null;\n this.#videoElement = this.shadowRoot?.querySelector('video') || null;\n this.#captureButtonSlot = this.shadowRoot?.querySelector('slot[name=\"capture-button\"]') || null;\n this.#captureButton = this.#getCaptureButton();\n this.#facingModeButtonSlot = this.shadowRoot?.querySelector('slot[name=\"facing-mode-button\"]') || null;\n this.#facingModeButton = this.#getFacingModeButton();\n\n this.#videoElement?.addEventListener('loadedmetadata', this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.addEventListener('slotchange', this.#onCaptureButtonSlotChange);\n this.#captureButton?.addEventListener('click', this.#onCapturePhotoButtonClick);\n this.#facingModeButtonSlot?.addEventListener('slotchange', this.#onFacingModeButtonSlotChange);\n this.#facingModeButton?.addEventListener('click', this.#onFacingModeButtonClick);\n\n if (!CapturePhoto.isSupported()) {\n return this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: {\n name: 'NotSupportedError',\n message: 'Not supported'\n }\n }\n }));\n }\n\n if (this.autoPlay) {\n this.startVideoStream();\n }\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.stopVideoStream();\n this.#facingModeButton?.removeEventListener('click', this.#onFacingModeButtonClick);\n this.#captureButton?.removeEventListener('click', this.#onCapturePhotoButtonClick);\n this.#videoElement?.removeEventListener('canplay', this.#onVideoLoadedMetaData);\n this.#captureButtonSlot?.removeEventListener('slotchange', this.#onCaptureButtonSlotChange);\n this.#facingModeButtonSlot?.removeEventListener('slotchange', this.#onFacingModeButtonSlotChange);\n }\n\n /**\n * @type {boolean} autoPlay - Whether or not to start the video stream automatically.\n * @attribute auto-play - Reflects the autoPlay attribute.\n */\n get autoPlay() {\n return this.hasAttribute('auto-play');\n }\n\n set autoPlay(value) {\n this.toggleAttribute('auto-play', !!value);\n }\n\n /**\n * @type {boolean} noImage - Whether or not to show the captured image.\n * @attribute no-image - Reflects the noImage attribute.\n */\n get noImage() {\n return this.hasAttribute('no-image');\n }\n\n set noImage(value) {\n this.toggleAttribute('no-image', !!value);\n }\n\n /**\n * @type {string} facingMode - The facing mode of the camera.\n * @attribute facing-mode - Reflects the facingMode attribute.\n */\n get facingMode() {\n return this.getAttribute('facing-mode') || 'user';\n }\n\n set facingMode(value) {\n this.setAttribute('facing-mode', value);\n }\n\n /**\n * @type {string} cameraResolution - The resolution of the camera.\n * @attribute camera-resolution - Reflects the cameraResolution attribute.\n */\n get cameraResolution() {\n return this.getAttribute('camera-resolution') || '';\n }\n\n set cameraResolution(value) {\n this.setAttribute('camera-resolution', value);\n }\n\n /**\n * @type {number} pan - The pan value of the camera.\n * @attribute pan - Reflects the pan attribute.\n */\n get pan() {\n return Number(this.getAttribute('pan')) || 0;\n }\n\n set pan(value) {\n this.setAttribute('pan', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} tilt - The tilt value of the camera.\n * @attribute tilt - Reflects the tilt attribute.\n */\n get tilt() {\n return Number(this.getAttribute('tilt')) || 0;\n }\n\n set tilt(value) {\n this.setAttribute('tilt', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} zoom - The zoom value of the camera.\n * @attribute zoom - Reflects the zoom attribute.\n */\n get zoom() {\n return Number(this.getAttribute('zoom')) || 1;\n }\n\n set zoom(value) {\n this.setAttribute('zoom', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} loading - Whether or not the video stream is loading.\n * @attribute loading - Reflects the loading attribute.\n */\n get loading() {\n return this.hasAttribute('loading');\n }\n\n /**\n * @type {boolean} calculateFileSize - Whether or not to calculate the file size of the captured image.\n * @attribute calculate-file-size - Reflects the calculateFileSize attribute.\n */\n get calculateFileSize() {\n return this.hasAttribute('calculate-file-size');\n }\n\n set calculateFileSize(value) {\n this.toggleAttribute('calculate-file-size', !!value);\n }\n\n /**\n * Handles the click event of the facing mode button.\n *\n * @param {*} evt - The click event.\n */\n #onFacingModeButtonClick = evt => {\n evt.preventDefault();\n\n if (this.loading) {\n return;\n }\n\n this.facingMode = this.facingMode === 'user' || !this.facingMode ? 'environment' : 'user';\n };\n\n /**\n * Handles the click event of the capture button.\n *\n * @param {*} evt - The click event.\n */\n #onCapturePhotoButtonClick = evt => {\n evt.preventDefault();\n this.capture();\n };\n\n /**\n * Handles the loadedmetadata event of the video element.\n *\n * @param {*} evt - The loadedmetadata event.\n */\n #onVideoLoadedMetaData = evt => {\n const video = evt.target;\n\n video.play().then(() => {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:video-play`, {\n bubbles: true,\n composed: true,\n detail: { video }\n }));\n }).catch(/** @param {Error} error */error => {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }).finally(() => {\n this.removeAttribute('loading');\n });\n };\n\n /**\n * Removes all child nodes from the output element.\n */\n #emptyOutputElement() {\n if (!this.#outputElement) {\n return;\n }\n\n Array.from(this.#outputElement.childNodes).forEach(node => node.remove());\n }\n\n /**\n * Applies the pan, tilt or zoom constraint.\n *\n * @param {'pan' | 'tilt' | 'zoom'} constraintName - The name of the constraint.\n * @param {number} constraintValue - The value of the constraint.\n */\n #applyPTZ(constraintName, constraintValue) {\n if (!this.#stream || !constraintName || !constraintValue) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n /** @type {ExtendedMediaTrackCapabilities} */\n const trackCapabilities = this.getTrackCapabilities();\n const trackSettings = this.getTrackSettings();\n\n if (constraintName in trackSettings) {\n track.applyConstraints({\n advanced: [{\n [constraintName]: clamp(Number(constraintValue), trackCapabilities[constraintName]?.min || 1, trackCapabilities[constraintName]?.max || 1)\n }]\n });\n }\n }\n\n /**\n * Handles the slotchange event of the capture button slot.\n *\n * @param {*} evt - The slotchange event.\n */\n #onCaptureButtonSlotChange = evt => {\n if (evt.target?.name === 'capture-button') {\n this.#captureButton?.removeEventListener('click', this.#onCapturePhotoButtonClick);\n this.#captureButton = this.#getCaptureButton();\n\n if (this.#captureButton) {\n this.#captureButton.addEventListener('click', this.#onCapturePhotoButtonClick);\n\n if (this.#captureButton.nodeName !== 'BUTTON' && !this.#captureButton.hasAttribute('role')) {\n this.#captureButton.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Handles the slotchange event of the facing mode button slot.\n *\n * @param {*} evt - The slotchange event.\n */\n #onFacingModeButtonSlotChange = evt => {\n if (evt.target?.name === 'facing-mode-button') {\n this.#facingModeButton?.removeEventListener('click', this.#onFacingModeButtonClick);\n this.#facingModeButton = this.#getFacingModeButton();\n\n if (this.#facingModeButton) {\n this.#facingModeButton.addEventListener('click', this.#onFacingModeButtonClick);\n\n if (this.#facingModeButton.nodeName !== 'BUTTON' && !this.#facingModeButton.hasAttribute('role')) {\n this.#facingModeButton.setAttribute('role', 'button');\n }\n }\n }\n };\n\n /**\n * Returns the facing mode button.\n *\n * @returns {Nullable}\n */\n #getFacingModeButton() {\n if (!this.#facingModeButtonSlot) {\n return null;\n }\n\n return this.#facingModeButtonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'facing-mode-button';\n }) || null;\n }\n\n /**\n * Returns the capture button.\n *\n * @returns {Nullable}\n */\n #getCaptureButton() {\n if (!this.#captureButtonSlot) {\n return null;\n }\n\n return this.#captureButtonSlot.assignedElements({ flatten: true }).find(el => {\n return el.nodeName === 'BUTTON' || el.getAttribute('slot') === 'capture-button';\n }) || null;\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and\n * set a value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would\n * miss that property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'autpoPlay' | 'noImage' | 'facingMode' | 'cameraResolution' | 'pan' | 'tilt' | 'zoom' | 'calculateFileSize'} prop\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Starts the video stream.\n *\n * @returns Promise\n */\n async startVideoStream() {\n if (!CapturePhoto.isSupported() || this.#stream) {\n return;\n }\n\n this.setAttribute('loading', '');\n\n /** @type {ExtendedMediaTrackConstraints} */\n const constraints = {\n video: {\n facingMode: {\n ideal: this.facingMode || 'user'\n },\n pan: true,\n tilt: true,\n zoom: true\n },\n audio: false\n };\n\n if (typeof this.cameraResolution === 'string' && this.cameraResolution.trim().length > 0) {\n const [width = 0, height = 0] = this.cameraResolution.split('x').map(x => Number(x));\n\n if (width > 0 && height > 0) {\n constraints.video.width = width;\n constraints.video.height = height;\n }\n }\n\n try {\n this.#stream = await navigator.mediaDevices.getUserMedia(constraints);\n\n if (this.#videoElement) {\n this.#videoElement.srcObject = this.#stream;\n }\n\n this.#applyPTZ('pan', this.pan);\n this.#applyPTZ('tilt', this.tilt);\n this.#applyPTZ('zoom', this.zoom);\n\n const trackSettings = this.getTrackSettings();\n\n if ('facingMode' in trackSettings && this.#facingModeButtonSlot) {\n this.#facingModeButtonSlot.hidden = false;\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n } finally {\n this.removeAttribute('loading');\n }\n }\n\n /**\n * Stops the video stream.\n */\n stopVideoStream() {\n if (!this.#videoElement || !this.#stream) {\n return;\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n track?.stop();\n this.#videoElement.srcObject = null;\n this.#stream = null;\n }\n\n /**\n * Captures a photo using the element's properties.\n *\n * @returns Promise\n */\n async capture() {\n if (this.loading || !this.#canvasElement || !this.#videoElement) {\n return;\n }\n\n try {\n const ctx = this.#canvasElement.getContext('2d');\n const width = this.#videoElement.videoWidth;\n const height = this.#videoElement.videoHeight;\n this.#canvasElement.width = width;\n this.#canvasElement.height = height;\n ctx?.drawImage(this.#videoElement, 0, 0, width, height);\n const dataURI = this.#canvasElement.toDataURL('image/png');\n\n if (typeof dataURI === 'string' && dataURI.includes('data:image')) {\n if (!this.noImage) {\n const image = new Image();\n image.src = dataURI;\n image.width = width;\n image.height = height;\n image.setAttribute('part', 'output-image');\n this.#emptyOutputElement();\n this.#outputElement?.appendChild(image);\n }\n\n /** @type {{ dataURI: string, width: number, height: number, size?: number }} */\n const eventDetail = { dataURI, width, height };\n\n if (this.calculateFileSize) {\n try {\n const file = await fetch(dataURI);\n const blob = await file.blob();\n const size = blob.size;\n\n if (size) {\n eventDetail.size = size;\n }\n } catch (err) {\n // Fail silently...\n }\n }\n\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:success`, {\n bubbles: true,\n composed: true,\n detail: eventDetail\n }));\n }\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}:error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n }\n\n /**\n * Returns an object based on the `MediaTrackSupportedConstraints` dictionary,\n * whose member fields each specify one ofthe constrainable properties the user agent understands.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaDevices/getSupportedConstraints\n * @returns {MediaTrackSupportedConstraints | {}}\n */\n getSupportedConstraints() {\n if (!CapturePhoto.isSupported()) {\n return {};\n }\n\n return navigator.mediaDevices.getSupportedConstraints() || {};\n }\n\n /**\n * Returns a `MediaTrackCapabilities` object which specifies the values or range of values\n * which each constrainable property, based upon the platform and user agent.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getCapabilities\n * @returns {MediaTrackCapabilities | {}}\n */\n getTrackCapabilities() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getCapabilities === 'function') {\n return track.getCapabilities() || {};\n }\n\n return {};\n }\n\n /**\n * Returns a `MediaTrackSettings` object containing the current values of each of\n * the constrainable properties for the current MediaStreamTrack.\n *\n * @see https://developer.mozilla.org/docs/Web/API/MediaStreamTrack/getSettings\n * @returns {MediaTrackSettings | {}}\n */\n getTrackSettings() {\n if (!this.#stream) {\n return {};\n }\n\n const [track] = this.#stream.getVideoTracks();\n\n if (track && typeof track.getSettings === 'function') {\n return track.getSettings() || {};\n }\n\n return {};\n }\n\n /**\n * Checks if the `MediaDevices.getUserMedia()` method is supported.\n *\n * @returns {boolean}\n */\n static isSupported() {\n return Boolean(navigator.mediaDevices?.getUserMedia);\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='capture-photo'] - The name of the custom element.\n * @example\n *\n * CapturePhoto.defineCustomElement('my-capture-photo');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, CapturePhoto);\n }\n }\n}\n\nexport { CapturePhoto };\n","// @ts-check\n\n/**\n * Clamps number within the inclusive `min` and `max` bounds,\n * making sure it does not go beyond them on either side.\n * If `min` is greater than `max` the parameters are swapped to support inverted ranges.\n *\n * @param {number} value - The number to clamp.\n * @param {number} lower - The lower bound.\n * @param {number} upper - The upper bound.\n * @throws {TypeError} - If one or more of the arguments passed is not a number.\n * @returns {number} - The clamped number.\n * @example\n *\n * clamp(10, -5, 5);\n * // => 5\n *\n * clamp(-10, -5, 5);\n * // => -5\n *\n * clamp(-15, 0, 100);\n * // => 0\n *\n * clamp(120, 0, 100);\n * // => 100\n *\n * clamp(-5, NaN, 5); // If any of lower or upper bound are `NaN`, they will be converted to `0`.\n * // => 0\n *\n * clamp(120, 100, 0); // The order of lower and upper bounds is reversed (100 > 0)\n * // => 100\n */\nexport const clamp = (value, lower, upper) => {\n if (Number.isNaN(lower)) {\n lower = 0;\n }\n\n if (Number.isNaN(upper)) {\n upper = 0;\n }\n\n return Math.min(Math.max(value, Math.min(lower, upper)), Math.max(lower, upper));\n};\n","Object.defineProperty({},\"ModalElement\",{get:function(){return t},set:void 0,enumerable:!0,configurable:!0});let e=document.createElement(\"template\");e.innerHTML=/* html */`\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */class t extends HTMLElement{/** @type {Nullable} */#e=null;/** @type {Nullable} */#t=null;/** @type {ReturnType | undefined} */#o=void 0;constructor(){if(super(),!this.shadowRoot){let t=this.attachShadow({mode:\"open\"});t.appendChild(e.content.cloneNode(!0))}this.shadowRoot&&(this.#e=this.shadowRoot.querySelector(\"dialog\"),this.#t=this.shadowRoot.querySelector('slot[name=\"footer\"]'))}static get observedAttributes(){return[\"open\",\"no-header\",\"no-animations\",\"no-close-button\"]}/**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */attributeChangedCallback(e,t,o){if(null!==this.#e){if(\"open\"===e&&t!==o&&(this.open?(this.#e.showModal(),document.body&&(document.body.style.overflowY=\"hidden\"),this.dispatchEvent(new CustomEvent(\"me-open\",{bubbles:!0,composed:!0,detail:{element:this}}))):this.#e.close()),\"no-header\"===e&&t!==o){/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__header\");null!==e&&(e.hidden=this.noHeader)}if(\"no-animations\"===e&&t!==o&&this.#e.classList.toggle(\"dialog--no-animations\",this.noAnimations),\"no-close-button\"===e&&t!==o){/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__close\");null!==e&&(e.hidden=this.noCloseButton)}}}/**\n * Lifecycle method that is called when the element is added to the DOM.\n */connectedCallback(){this.#i(\"open\"),this.#i(\"staticBackdrop\"),this.#i(\"noHeader\"),this.#i(\"noAnimations\"),this.#i(\"noCloseButton\"),this.#i(\"fullscreen\"),this.#e?.addEventListener(\"click\",this.#a),this.#e?.addEventListener(\"close\",this.#l),this.#e?.addEventListener(\"cancel\",this.#s),this.#e?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\",this.#n),this.#t?.addEventListener(\"slotchange\",this.#r)}/**\n * Lifecycle method that is called when the element is removed from the DOM.\n */disconnectedCallback(){this.#o&&clearTimeout(this.#o),this.#e?.addEventListener(\"click\",this.#a),this.#e?.removeEventListener(\"close\",this.#l),this.#e?.removeEventListener(\"cancel\",this.#s),this.#e?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\",this.#n),this.#t?.removeEventListener(\"slotchange\",this.#r)}/**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */get open(){return this.hasAttribute(\"open\")}set open(e){e?this.setAttribute(\"open\",\"\"):this.removeAttribute(\"open\")}/**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */get staticBackdrop(){return this.hasAttribute(\"static-backdrop\")}set staticBackdrop(e){e?this.setAttribute(\"static-backdrop\",\"\"):this.removeAttribute(\"static-backdrop\")}/**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */get noHeader(){return this.hasAttribute(\"no-header\")}set noHeader(e){e?this.setAttribute(\"no-header\",\"\"):this.removeAttribute(\"no-header\")}/**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */get noAnimations(){return this.hasAttribute(\"no-animations\")}set noAnimations(e){e?this.setAttribute(\"no-animations\",\"\"):this.removeAttribute(\"no-animations\")}/**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */get noCloseButton(){return this.hasAttribute(\"no-close-button\")}set noCloseButton(e){e?this.setAttribute(\"no-close-button\",\"\"):this.removeAttribute(\"no-close-button\")}/**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */get fullscreen(){return this.hasAttribute(\"fullscreen\")}set fullscreen(e){e?this.setAttribute(\"fullscreen\",\"\"):this.removeAttribute(\"fullscreen\")}/**\n * Applies a pulse effect on the dialog.\n */#d(){this.#o||(this.#e?.classList.add(\"dialog--pulse\"),this.#o=setTimeout(()=>{this.#e?.classList.remove(\"dialog--pulse\"),clearTimeout(this.#o),this.#o=void 0},300))}/**\n * Handles the close event of the dialog.\n */#l=()=>{// This is needed because the dialog element does not reset\n// the open property when the dialog is closed by the user.\nthis.open=!1,document.body&&(document.body.style.overflowY=\"\"),this.dispatchEvent(new CustomEvent(\"me-close\",{bubbles:!0,composed:!0,detail:{element:this}}))};/**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */#s=e=>{let t=this.#c(\"escape-key\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),this.noAnimations||this.#d())};/**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */#n=e=>{let t=this.#c(\"close-button\");this.dispatchEvent(t),t.defaultPrevented&&(e.preventDefault(),this.noAnimations||this.#d())};/**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */#a=e=>{if(e.target!==e.currentTarget)return;let t=this.#c(\"backdrop-click\");if(this.dispatchEvent(t),t.defaultPrevented||this.staticBackdrop){this.noAnimations||this.#d();return}this.#e?.close()};/**\n * Handles the slotchange event of the footer slot.\n */#r=()=>{if(null===this.#e)return;/** @type {Nullable} */let e=this.#e.querySelector(\".dialog__footer\");if(null===e)return;let t=this.#t?.assignedNodes(),o=!!t&&t.length>0;e.hidden=!o};/**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */#c(e){return new CustomEvent(\"me-request-close\",{bubbles:!0,composed:!0,cancelable:!0,detail:{reason:e,element:this}})}/**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */#i(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}/**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */show(){this.open||(this.open=!0)}/**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */hide(){this.open&&(this.open=!1)}/**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */static defineCustomElement(e=\"modal-element\"){\"undefined\"==typeof window||window.customElements.get(e)||window.customElements.define(e,t)}}t.defineCustomElement();export{t as ModalElement};//# sourceMappingURL=modal-element-defined.js.map\n\n//# sourceMappingURL=modal-element-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $180b6dcf923bafc7$exports = {};\n\n$parcel$export($180b6dcf923bafc7$exports, \"ModalElement\", function () { return $180b6dcf923bafc7$export$32589115725b904b; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ const $180b6dcf923bafc7$var$PULSE_ANIMATION_DURATION = 300;\nconst $180b6dcf923bafc7$var$template = document.createElement(\"template\");\n$180b6dcf923bafc7$var$template.innerHTML = /* html */ `\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;\n/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */ class $180b6dcf923bafc7$export$32589115725b904b extends HTMLElement {\n /** @type {Nullable} */ #dialogEl = null;\n /** @type {Nullable} */ #footerSlotEl = null;\n /** @type {ReturnType | undefined} */ #pulseAnimationTimeout = void 0;\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($180b6dcf923bafc7$var$template.content.cloneNode(true));\n }\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector(\"dialog\");\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n }\n }\n static get observedAttributes() {\n return [\n \"open\",\n \"no-header\",\n \"no-animations\",\n \"no-close-button\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) return;\n if (name === \"open\" && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n if (document.body) document.body.style.overflowY = \"hidden\";\n this.dispatchEvent(new CustomEvent(\"me-open\", {\n bubbles: true,\n composed: true,\n detail: {\n element: this\n }\n }));\n } else this.#dialogEl.close();\n }\n if (name === \"no-header\" && oldValue !== newValue) {\n /** @type {Nullable} */ const headerEl = this.#dialogEl.querySelector(\".dialog__header\");\n if (headerEl !== null) headerEl.hidden = this.noHeader;\n }\n if (name === \"no-animations\" && oldValue !== newValue) this.#dialogEl.classList.toggle(\"dialog--no-animations\", this.noAnimations);\n if (name === \"no-close-button\" && oldValue !== newValue) {\n /** @type {Nullable} */ const closeBtnEl = this.#dialogEl.querySelector(\".dialog__close\");\n if (closeBtnEl !== null) closeBtnEl.hidden = this.noCloseButton;\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"open\");\n this.#upgradeProperty(\"staticBackdrop\");\n this.#upgradeProperty(\"noHeader\");\n this.#upgradeProperty(\"noAnimations\");\n this.#upgradeProperty(\"noCloseButton\");\n this.#upgradeProperty(\"fullscreen\");\n this.#dialogEl?.addEventListener(\"click\", this.#handleDialogClick);\n this.#dialogEl?.addEventListener(\"close\", this.#handleDialogClose);\n this.#dialogEl?.addEventListener(\"cancel\", this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener(\"submit\", this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener(\"slotchange\", this.#handleFooterSlotChange);\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener(\"click\", this.#handleDialogClick);\n this.#dialogEl?.removeEventListener(\"close\", this.#handleDialogClose);\n this.#dialogEl?.removeEventListener(\"cancel\", this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener(\"submit\", this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener(\"slotchange\", this.#handleFooterSlotChange);\n }\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */ get open() {\n return this.hasAttribute(\"open\");\n }\n set open(value) {\n if (value) this.setAttribute(\"open\", \"\");\n else this.removeAttribute(\"open\");\n }\n /**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */ get staticBackdrop() {\n return this.hasAttribute(\"static-backdrop\");\n }\n set staticBackdrop(value) {\n if (value) this.setAttribute(\"static-backdrop\", \"\");\n else this.removeAttribute(\"static-backdrop\");\n }\n /**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */ get noHeader() {\n return this.hasAttribute(\"no-header\");\n }\n set noHeader(value) {\n if (value) this.setAttribute(\"no-header\", \"\");\n else this.removeAttribute(\"no-header\");\n }\n /**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */ get noAnimations() {\n return this.hasAttribute(\"no-animations\");\n }\n set noAnimations(value) {\n if (value) this.setAttribute(\"no-animations\", \"\");\n else this.removeAttribute(\"no-animations\");\n }\n /**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */ get noCloseButton() {\n return this.hasAttribute(\"no-close-button\");\n }\n set noCloseButton(value) {\n if (value) this.setAttribute(\"no-close-button\", \"\");\n else this.removeAttribute(\"no-close-button\");\n }\n /**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */ get fullscreen() {\n return this.hasAttribute(\"fullscreen\");\n }\n set fullscreen(value) {\n if (value) this.setAttribute(\"fullscreen\", \"\");\n else this.removeAttribute(\"fullscreen\");\n }\n /**\n * Applies a pulse effect on the dialog.\n */ #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) return;\n this.#dialogEl?.classList.add(\"dialog--pulse\");\n this.#pulseAnimationTimeout = setTimeout(()=>{\n this.#dialogEl?.classList.remove(\"dialog--pulse\");\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, $180b6dcf923bafc7$var$PULSE_ANIMATION_DURATION);\n }\n /**\n * Handles the close event of the dialog.\n */ #handleDialogClose = ()=>{\n // This is needed because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n if (document.body) document.body.style.overflowY = \"\";\n this.dispatchEvent(new CustomEvent(\"me-close\", {\n bubbles: true,\n composed: true,\n detail: {\n element: this\n }\n }));\n };\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */ #handleDialogCancel = (evt)=>{\n const requestCloseEvent = this.#createRequestCloseEvent(\"escape-key\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */ #handleCloseButtonClick = (evt)=>{\n const requestCloseEvent = this.#createRequestCloseEvent(\"close-button\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */ #handleDialogClick = (evt)=>{\n if (evt.target !== evt.currentTarget) return;\n const requestCloseEvent = this.#createRequestCloseEvent(\"backdrop-click\");\n this.dispatchEvent(requestCloseEvent);\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n return;\n }\n this.#dialogEl?.close();\n };\n /**\n * Handles the slotchange event of the footer slot.\n */ #handleFooterSlotChange = ()=>{\n if (this.#dialogEl === null) return;\n /** @type {Nullable} */ const footerEl = this.#dialogEl.querySelector(\".dialog__footer\");\n if (footerEl === null) return;\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n footerEl.hidden = !hasFooterSlotNodes;\n };\n /**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */ #createRequestCloseEvent(reason) {\n return new CustomEvent(\"me-request-close\", {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason: reason,\n element: this\n }\n });\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */ show() {\n if (this.open) return;\n this.open = true;\n }\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */ hide() {\n if (!this.open) return;\n this.open = false;\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */ static defineCustomElement(elementName = \"modal-element\") {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $180b6dcf923bafc7$export$32589115725b904b);\n }\n}\n\n\n(0, $180b6dcf923bafc7$export$32589115725b904b).defineCustomElement();\n\n\nexport {$180b6dcf923bafc7$export$32589115725b904b as ModalElement};\n//# sourceMappingURL=modal-element-defined.js.map\n","import { ModalElement } from './modal-element.js';\n\nModalElement.defineCustomElement();\n\nexport { ModalElement };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nconst PULSE_ANIMATION_DURATION = 300;\nconst template = document.createElement('template');\n\ntemplate.innerHTML = /* html */`\n \n\n \n
\n
\n \n\n
\n \n
\n
\n\n \n\n
\n \n
\n
\n
\n`;\n\n/**\n * @summary A custom element that renders a modal dialog.\n * @extends HTMLElement\n *\n * @property {boolean} open - Determines if the modal is open or not.\n * @property {boolean} staticBackdrop - Determines if the modal should close when the backdrop is clicked.\n * @property {boolean} noHeader - Determines if the modal should have a header or not.\n * @property {boolean} noAnimations - Determines if the modal should have animations or not when opening and closing.\n * @property {boolean} noCloseButton - Determines if the modal should have a default close button or not.\n * @property {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @attribute {boolean} open - Determines if the modal is open or not.\n * @attribute {boolean} static-backdrop - Determines if the modal should close when the backdrop is clicked.\n * @attribute {boolean} no-header - Determines if the modal should have a header or not.\n * @attribute {boolean} no-animations - Determines if the modal should have animations or not when opening and closing.\n * @attribute {boolean} no-close-button - Determines if the modal should have a default close button or not.\n * @attribute {boolean} fullscreen - Determines if the modal should be fullscreen or not.\n *\n * @slot - The modal's main content (default/unnamed slot).\n * @slot header - The modal's header content, usually a title.\n * @slot footer - The modals' footer content. Usually used for buttons or other actions.\n * @slot close - The content of the close button that appears in the modal's header.\n *\n * @cssproperty --me-width - The width of the modal. Default is 32rem.\n * @cssproperty --me-height - The height of the modal. Default is fit-content.\n * @cssproperty --me-border-color - The border color of the modal. Default is initial.\n * @cssproperty --me-border-style - The border style of the modal. Default is solid.\n * @cssproperty --me-border-width - The border width of the modal. Default is initial.\n * @cssproperty --me-border-radius - The border radius of the modal. Default is 0.\n * @cssproperty --me-box-shadow - The box shadow of the modal. Default is none.\n * @cssproperty --me-background-color - The background color of the modal. Default is canvas.\n * @cssproperty --me-header-spacing - The spacing of the header. Default is 1rem.\n * @cssproperty --me-body-spacing - The spacing of the body. Default is 1rem.\n * @cssproperty --me-footer-spacing - The spacing of the footer. Default is 1rem.\n * @cssproperty --me-header-background-color - The background color of the header. Default is transparent.\n * @cssproperty --me-body-background-color - The background color of the body. Default is transparent.\n * @cssproperty --me-footer-background-color - The background color of the footer. Default is transparent.\n * @cssproperty --me-close-border-radius - The border radius of the close button. Default is 0.\n * @cssproperty --me-close-background-color - The background color of the close button. Default is transparent.\n * @cssproperty --me-backdrop-background - The background shorthand property of the backdrop. Default is rgba(0, 0, 0, 0.5).\n * @cssproperty --me-backdrop-filter - The backdrop filter property of the backdrop. Default is none.\n *\n * @csspart base - The base wrapper of the modal.\n * @csspart panel - The panel wrapper of the modal.\n * @csspart header - The header wrapper of the modal.\n * @csspart title - The title wrapper of the modal.\n * @csspart body - The body wrapper of the modal.\n * @csspart footer - The footer wrapper of the modal.\n * @csspart close - The close button of the modal.\n *\n * @fires me-open - Dispatched when the modal is opened.\n * @fires me-close - Dispatched when the modal is closed.\n * @fires me-request-close - Dispatched when the modal is about to close.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method show - Instance method. Opens the modal if it is closed, otherwise does nothing.\n * @method hide - Instance method. Closes the modal if it is open, otherwise does nothing.\n *\n * @tagname modal-element - This is the default tag name, unless overridden by the `defineCustomElement` method.\n */\nclass ModalElement extends HTMLElement {\n /** @type {Nullable} */\n #dialogEl = null;\n\n /** @type {Nullable} */\n #footerSlotEl = null;\n\n /** @type {ReturnType | undefined} */\n #pulseAnimationTimeout = void 0;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#dialogEl = this.shadowRoot.querySelector('dialog');\n this.#footerSlotEl = this.shadowRoot.querySelector('slot[name=\"footer\"]');\n }\n }\n\n static get observedAttributes() {\n return ['open', 'no-header', 'no-animations', 'no-close-button'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (this.#dialogEl === null) {\n return;\n }\n\n if (name === 'open' && oldValue !== newValue) {\n if (this.open) {\n this.#dialogEl.showModal();\n\n if (document.body) {\n document.body.style.overflowY = 'hidden';\n }\n\n this.dispatchEvent(new CustomEvent('me-open', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n }));\n } else {\n this.#dialogEl.close();\n }\n }\n\n if (name === 'no-header' && oldValue !== newValue) {\n /** @type {Nullable} */\n const headerEl = this.#dialogEl.querySelector('.dialog__header');\n\n if (headerEl !== null) {\n headerEl.hidden = this.noHeader;\n }\n }\n\n if (name === 'no-animations' && oldValue !== newValue) {\n this.#dialogEl.classList.toggle('dialog--no-animations', this.noAnimations);\n }\n\n if (name === 'no-close-button' && oldValue !== newValue) {\n /** @type {Nullable} */\n const closeBtnEl = this.#dialogEl.querySelector('.dialog__close');\n\n if (closeBtnEl !== null) {\n closeBtnEl.hidden = this.noCloseButton;\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('open');\n this.#upgradeProperty('staticBackdrop');\n this.#upgradeProperty('noHeader');\n this.#upgradeProperty('noAnimations');\n this.#upgradeProperty('noCloseButton');\n this.#upgradeProperty('fullscreen');\n\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.addEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.addEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.addEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.addEventListener('slotchange', this.#handleFooterSlotChange);\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#pulseAnimationTimeout && clearTimeout(this.#pulseAnimationTimeout);\n this.#dialogEl?.addEventListener('click', this.#handleDialogClick);\n this.#dialogEl?.removeEventListener('close', this.#handleDialogClose);\n this.#dialogEl?.removeEventListener('cancel', this.#handleDialogCancel);\n this.#dialogEl?.querySelector('form[method=\"dialog\"]')?.removeEventListener('submit', this.#handleCloseButtonClick);\n this.#footerSlotEl?.removeEventListener('slotchange', this.#handleFooterSlotChange);\n }\n\n /**\n * Deternimes if the modal is open or not.\n *\n * @type {boolean} - True if the modal is open, otherwise false.\n * @default false\n * @attribute open - Reflects the open property.\n */\n get open() {\n return this.hasAttribute('open');\n }\n\n set open(value) {\n if (value) {\n this.setAttribute('open', '');\n } else {\n this.removeAttribute('open');\n }\n }\n\n /**\n * Determines if the modal should close when the backdrop is clicked.\n *\n * @type {boolean} - True if the modal should close when the backdrop is clicked, otherwise false.\n * @default false\n * @attribute static-backdrop - Reflects the staticBackdrop property.\n */\n get staticBackdrop() {\n return this.hasAttribute('static-backdrop');\n }\n\n set staticBackdrop(value) {\n if (value) {\n this.setAttribute('static-backdrop', '');\n } else {\n this.removeAttribute('static-backdrop');\n }\n }\n\n /**\n * Determines if the modal should have a header or not.\n *\n * @type {boolean} - True if the modal should have a header, otherwise false.\n * @default false\n * @attribute no-header - Reflects the noHeader property.\n */\n get noHeader() {\n return this.hasAttribute('no-header');\n }\n\n set noHeader(value) {\n if (value) {\n this.setAttribute('no-header', '');\n } else {\n this.removeAttribute('no-header');\n }\n }\n\n /**\n * Determines if the modal should have animations or not when opening and closing.\n *\n * @type {boolean} - True if the modal should have animations, otherwise false.\n * @default false\n * @attribute no-animations - Reflects the noAnimations property.\n */\n get noAnimations() {\n return this.hasAttribute('no-animations');\n }\n\n set noAnimations(value) {\n if (value) {\n this.setAttribute('no-animations', '');\n } else {\n this.removeAttribute('no-animations');\n }\n }\n\n /**\n * Determines if the modal should have a default close button or not.\n *\n * @type {boolean} - True if the modal should have a close button, otherwise false.\n * @default false\n * @attribute no-close-button - Reflects the noCloseButton property.\n */\n get noCloseButton() {\n return this.hasAttribute('no-close-button');\n }\n\n set noCloseButton(value) {\n if (value) {\n this.setAttribute('no-close-button', '');\n } else {\n this.removeAttribute('no-close-button');\n }\n }\n\n /**\n * Determines if the modal should be fullscreen or not.\n *\n * @type {boolean} - True if the modal should be fullscreen, otherwise false.\n * @default false\n * @attribute fullscreen - Reflects the fullscreen property.\n */\n get fullscreen() {\n return this.hasAttribute('fullscreen');\n }\n\n set fullscreen(value) {\n if (value) {\n this.setAttribute('fullscreen', '');\n } else {\n this.removeAttribute('fullscreen');\n }\n }\n\n /**\n * Applies a pulse effect on the dialog.\n */\n #applyPulseEffectOnDialog() {\n if (this.#pulseAnimationTimeout) {\n return;\n }\n\n this.#dialogEl?.classList.add('dialog--pulse');\n\n this.#pulseAnimationTimeout = setTimeout(() => {\n this.#dialogEl?.classList.remove('dialog--pulse');\n clearTimeout(this.#pulseAnimationTimeout);\n this.#pulseAnimationTimeout = void 0;\n }, PULSE_ANIMATION_DURATION);\n }\n\n /**\n * Handles the close event of the dialog.\n */\n #handleDialogClose = () => {\n // This is needed because the dialog element does not reset\n // the open property when the dialog is closed by the user.\n this.open = false;\n\n if (document.body) {\n document.body.style.overflowY = '';\n }\n\n this.dispatchEvent(new CustomEvent('me-close', {\n bubbles: true,\n composed: true,\n detail: { element: this }\n }));\n };\n\n /**\n * Handles the cancel event of the dialog.\n * This event is fired when the user presses the escape key.\n *\n * @param {Event} evt - The cancel event.\n */\n #handleDialogCancel = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('escape-key');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the close button.\n *\n * @param {Event} evt - The click event.\n */\n #handleCloseButtonClick = evt => {\n const requestCloseEvent = this.#createRequestCloseEvent('close-button');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented) {\n evt.preventDefault();\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n }\n };\n\n /**\n * Handles the click event of the dialog.\n *\n * @param {MouseEvent} evt - The click event.\n */\n #handleDialogClick = evt => {\n if (evt.target !== evt.currentTarget) {\n return;\n }\n\n const requestCloseEvent = this.#createRequestCloseEvent('backdrop-click');\n\n this.dispatchEvent(requestCloseEvent);\n\n if (requestCloseEvent.defaultPrevented || this.staticBackdrop) {\n !this.noAnimations && this.#applyPulseEffectOnDialog();\n return;\n }\n\n this.#dialogEl?.close();\n };\n\n /**\n * Handles the slotchange event of the footer slot.\n */\n #handleFooterSlotChange = () => {\n if (this.#dialogEl === null) {\n return;\n }\n\n /** @type {Nullable} */\n const footerEl = this.#dialogEl.querySelector('.dialog__footer');\n\n if (footerEl === null) {\n return;\n }\n\n const footerSlotNodes = this.#footerSlotEl?.assignedNodes();\n const hasFooterSlotNodes = footerSlotNodes ? footerSlotNodes.length > 0 : false;\n\n footerEl.hidden = !hasFooterSlotNodes;\n };\n\n /**\n * Creates a request close event.\n *\n * @param {'close-button' | 'escape-key' | 'backdrop-click'} reason - The reason that the modal is about to close.\n */\n #createRequestCloseEvent(reason) {\n return new CustomEvent('me-request-close', {\n bubbles: true,\n composed: true,\n cancelable: true,\n detail: {\n reason,\n element: this\n }\n });\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'open' | 'staticBackdrop' | 'noHeader' | 'noAnimations' | 'noCloseButton' | 'fullscreen'} prop - The property to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Opens the modal if it is closed, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.show();\n */\n show() {\n if (this.open) {\n return;\n }\n\n this.open = true;\n }\n\n /**\n * Closes the modal if it is open, otherwise does nothing.\n * Make sure that the custom element is defined before calling this method.\n *\n * @example\n * const modal = document.querySelector('modal-element');\n * modal.hide();\n */\n hide() {\n if (!this.open) {\n return;\n }\n\n this.open = false;\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='modal-element']\n * @example\n * ModalElement.defineCustomElement('my-modal');\n */\n static defineCustomElement(elementName = 'modal-element') {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, ModalElement);\n }\n }\n}\n\nexport { ModalElement };\n","Object.defineProperty({},\"FilesDropzone\",{get:function(){return m},set:void 0,enumerable:!0,configurable:!0});let e=new Map([[\"aac\",\"audio/aac\"],[\"abw\",\"application/x-abiword\"],[\"arc\",\"application/x-freearc\"],[\"avif\",\"image/avif\"],[\"avi\",\"video/x-msvideo\"],[\"azw\",\"application/vnd.amazon.ebook\"],[\"bin\",\"application/octet-stream\"],[\"bmp\",\"image/bmp\"],[\"bz\",\"application/x-bzip\"],[\"bz2\",\"application/x-bzip2\"],[\"cda\",\"application/x-cdf\"],[\"csh\",\"application/x-csh\"],[\"css\",\"text/css\"],[\"csv\",\"text/csv\"],[\"doc\",\"application/msword\"],[\"docx\",\"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"],[\"eot\",\"application/vnd.ms-fontobject\"],[\"epub\",\"application/epub+zip\"],[\"gz\",\"application/gzip\"],[\"gif\",\"image/gif\"],[\"heic\",\"image/heic\"],[\"heif\",\"image/heif\"],[\"htm\",\"text/html\"],[\"html\",\"text/html\"],[\"ico\",\"image/vnd.microsoft.icon\"],[\"ics\",\"text/calendar\"],[\"jar\",\"application/java-archive\"],[\"jpeg\",\"image/jpeg\"],[\"jpg\",\"image/jpeg\"],[\"jxl\",\"image/jxl\"],[\"js\",\"text/javascript\"],[\"json\",\"application/json\"],[\"jsonld\",\"application/ld+json\"],[\"markdown\",\"text/markdown\"],[\"md\",\"text/markdown\"],[\"mid\",\"audio/midi\"],[\"midi\",\"audio/midi\"],[\"mjs\",\"text/javascript\"],[\"mp3\",\"audio/mpeg\"],[\"mp4\",\"video/mp4\"],[\"mpeg\",\"video/mpeg\"],[\"mpkg\",\"application/vnd.apple.installer+xml\"],[\"odp\",\"application/vnd.oasis.opendocument.presentation\"],[\"ods\",\"application/vnd.oasis.opendocument.spreadsheet\"],[\"odt\",\"application/vnd.oasis.opendocument.text\"],[\"oga\",\"audio/ogg\"],[\"ogv\",\"video/ogg\"],[\"ogx\",\"application/ogg\"],[\"opus\",\"audio/opus\"],[\"otf\",\"font/otf\"],[\"png\",\"image/png\"],[\"pdf\",\"application/pdf\"],[\"php\",\"application/x-httpd-php\"],[\"ppt\",\"application/vnd.ms-powerpoint\"],[\"pptx\",\"application/vnd.openxmlformats-officedocument.presentationml.presentation\"],[\"rar\",\"application/vnd.rar\"],[\"rtf\",\"application/rtf\"],[\"sh\",\"application/x-sh\"],[\"svg\",\"image/svg+xml\"],[\"swf\",\"application/x-shockwave-flash\"],[\"tar\",\"application/x-tar\"],[\"tif\",\"image/tiff\"],[\"tiff\",\"image/tiff\"],[\"ts\",\"video/mp2t\"],[\"ttf\",\"font/ttf\"],[\"txt\",\"text/plain\"],[\"vsd\",\"application/vnd.visio\"],[\"wav\",\"audio/wav\"],[\"weba\",\"audio/webm\"],[\"webm\",\"video/webm\"],[\"webp\",\"image/webp\"],[\"woff\",\"font/woff\"],[\"woff2\",\"font/woff2\"],[\"xhtml\",\"application/xhtml+xml\"],[\"xls\",\"application/vnd.ms-excel\"],[\"xlsx\",\"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"],[\"xml\",\"application/xml\"],[\"xul\",\"application/vnd.mozilla.xul+xml\"],[\"zip\",\"application/zip\"],[\"7z\",\"application/x-7z-compressed\"],[\"mkv\",\"video/x-matroska\"],[\"mov\",\"video/quicktime\"],[\"msg\",\"application/vnd.ms-outlook\"]]),t=[\".DS_Store\",\"Thumbs.db\"],o=t=>{let{name:o}=t;if(o&&-1!==o.lastIndexOf(\".\")&&!t.type){let i=(o.split(\".\").pop()||\"\").toLowerCase(),r=e.get(i);r&&Object.defineProperty(t,\"type\",{value:r,writable:!1,configurable:!1,enumerable:!0})}return t},i=(e,t)=>{let i=o(e);if(\"string\"!=typeof i.path){let{webkitRelativePath:o}=e;Object.defineProperty(i,\"path\",{value:\"string\"==typeof t?t:o||e.name,writable:!1,configurable:!1,enumerable:!0})}return i},r=async e=>await new Promise((t,o)=>{e.readEntries(t,o)}),a=async e=>{let t=[],o=await r(e);for(;o.length>0;)t.push(...o),o=await r(e);return t},n=e=>new Promise((t,o)=>{e.file(o=>t(i(o,e.fullPath)),o)}),s=async e=>{let o=[],i=[];for(let t of e){if(\"file\"!==t.kind)continue;let e=t.getAsEntry?t.getAsEntry():t.webkitGetAsEntry();i.push(e)}for(;i.length>0;){let e=i.shift();if(e){if(e.isFile){let i=await n(e);-1===t.indexOf(i.name)&&o.push(i)}else e.isDirectory&&i.push(...await a(e.createReader()))}}return o},d=async e=>{let o=[];for(let r of e)-1===t.indexOf(r.name)&&o.push(i(r));return o},l=async e=>e.dataTransfer?e.dataTransfer.items?await s(e.dataTransfer.items):await d(e.dataTransfer.files):await d(e.target.files),p=\"files-dropzone\",c=\"TOO_MANY_FILES\",h=document.createElement(\"template\"),u=`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;h.innerHTML=`\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;class m extends HTMLElement{#e=null;#t=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:\"open\"}).appendChild(h.content.cloneNode(!0)),this.shadowRoot&&(this.#e=this.shadowRoot.getElementById(\"fileInput\"),this.#t=this.shadowRoot.getElementById(\"dropzoneEl\"))}static get observedAttributes(){return[\"accept\",\"disabled\",\"multiple\",\"no-keyboard\"]}attributeChangedCallback(e,t,o){\"accept\"===e&&t!==o&&this.#e&&(this.#e.accept=this.accept),\"disabled\"===e&&t!==o&&this.#e&&(this.#e.disabled=this.disabled,this.disabled?this.#t?.removeAttribute(\"tabindex\"):this.#t?.setAttribute(\"tabindex\",\"0\")),\"multiple\"===e&&t!==o&&this.#e&&(this.#e.multiple=this.multiple),\"no-keyboard\"===e&&t!==o&&this.#t&&(this.noKeyboard?this.#t.removeAttribute(\"tabindex\"):this.#t.setAttribute(\"tabindex\",\"0\"))}connectedCallback(){this.#o(\"accept\"),this.#o(\"disabled\"),this.#o(\"maxFiles\"),this.#o(\"maxSize\"),this.#o(\"minSize\"),this.#o(\"multiple\"),this.#o(\"noClick\"),this.#o(\"noDrag\"),this.#o(\"noKeyboard\"),this.#o(\"autoFocus\"),this.#o(\"noStyle\"),this.#e?.addEventListener(\"change\",this.#i),this.#t?.addEventListener(\"dragenter\",this.#r),this.#t?.addEventListener(\"dragover\",this.#a),this.#t?.addEventListener(\"dragleave\",this.#n),this.#t?.addEventListener(\"drop\",this.#s),this.#t?.addEventListener(\"click\",this.#d),this.#t?.addEventListener(\"keyup\",this.#l),this.autoFocus&&this.#t?.focus()}disconnectedCallback(){this.#e?.removeEventListener(\"change\",this.#i),this.#t?.removeEventListener(\"dragenter\",this.#r),this.#t?.removeEventListener(\"dragover\",this.#a),this.#t?.removeEventListener(\"dragleave\",this.#n),this.#t?.removeEventListener(\"drop\",this.#s),this.#t?.removeEventListener(\"click\",this.#d),this.#t?.removeEventListener(\"keyup\",this.#l)}get accept(){return this.getAttribute(\"accept\")||\"\"}set accept(e){this.setAttribute(\"accept\",null!=e?e.toString():e)}get disabled(){return this.hasAttribute(\"disabled\")}set disabled(e){this.toggleAttribute(\"disabled\",!!e)}get maxFiles(){let e=Number(this.getAttribute(\"max-files\"))||0;return e<=0?1/0:Math.floor(Math.abs(e))}set maxFiles(e){this.setAttribute(\"max-files\",null!=e?e.toString():e)}get maxSize(){let e=this.getAttribute(\"max-size\");if(null===e)return 1/0;let t=Number(e);return Number.isNaN(t)?1/0:t}set maxSize(e){this.setAttribute(\"max-size\",null!=e?e.toString():e)}get minSize(){let e=this.getAttribute(\"min-size\");if(null===e)return 0;let t=Number(e);return Number.isNaN(t)?0:t}set minSize(e){this.setAttribute(\"min-size\",null!=e?e.toString():e)}get multiple(){return this.hasAttribute(\"multiple\")}set multiple(e){this.toggleAttribute(\"multiple\",!!e)}get noClick(){return this.hasAttribute(\"no-click\")}set noClick(e){this.toggleAttribute(\"no-click\",!!e)}get noDrag(){return this.hasAttribute(\"no-drag\")}set noDrag(e){this.toggleAttribute(\"no-drag\",!!e)}get noKeyboard(){return this.hasAttribute(\"no-keyboard\")}set noKeyboard(e){this.toggleAttribute(\"no-keyboard\",!!e)}get autoFocus(){return this.hasAttribute(\"auto-focus\")}set autoFocus(e){this.toggleAttribute(\"auto-focus\",!!e)}get noStyle(){return this.hasAttribute(\"no-style\")}set noStyle(e){this.toggleAttribute(\"no-style\",!!e)}#i=async e=>{try{this.#p(await l(e))}catch(e){this.dispatchEvent(new CustomEvent(`${p}-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}};#r=()=>{this.disabled||this.noDrag||this.dispatchEvent(new Event(`${p}-dragenter`,{bubbles:!0,composed:!0}))};#a=e=>{if(e.preventDefault(),this.disabled||this.noDrag){e.dataTransfer.dropEffect=\"none\";return}e.dataTransfer.dropEffect=\"copy\",this.#t&&(this.#t.classList.add(\"dropzone--dragover\"),this.#t.part.add(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${p}-dragover`,{bubbles:!0,composed:!0}))};#n=()=>{this.disabled||this.noDrag||(this.#t&&(this.#t.classList.remove(\"dropzone--dragover\"),this.#t.part.remove(\"dropzone--dragover\")),this.dispatchEvent(new Event(`${p}-dragleave`,{bubbles:!0,composed:!0})))};#s=async e=>{if(!this.disabled&&!this.noDrag){e.preventDefault(),this.#t&&(this.#t.classList.remove(\"dropzone--dragover\"),this.#t.part.remove(\"dropzone--dragover\"));try{this.#p(await l(e))}catch(e){this.dispatchEvent(new CustomEvent(`${p}-error`,{bubbles:!0,composed:!0,detail:{error:e}}))}}};#d=()=>{this.disabled||this.noClick||this.#e?.click()};#l=e=>{this.disabled||this.noKeyboard||\" \"!==e.key&&\"Enter\"!==e.key||this.#e?.click()};#p(e){if(!Array.isArray(e)||!e.length)return;let t=[],o=[],i=e.length;if(!this.multiple&&i>1)for(let t of e)o.push({file:t,errors:[{code:c,message:\"Too many files selected. Only 1 file is allowed.\"}]});else if(this.multiple&&i>this.maxFiles)for(let t of e)o.push({file:t,errors:[{code:c,message:`Too many files selected. Only ${this.maxFiles} ${this.maxFiles>1?\"files are\":\"file is\"} allowed.`}]});else for(let i of e){let e=function(e,t=\"\"){if(!t)return!0;let o=[...new Set(t.split(\",\").map(e=>e.trim()).filter(Boolean))],i=e.type,r=i.replace(/\\/.*$/,\"\");for(let t of o)if(\".\"===t.charAt(0)){if(-1!==e.name.toLowerCase().indexOf(t.toLowerCase(),e.name.length-t.length))return!0}else if(/\\/\\*$/.test(t)){if(r===t.replace(/\\/.*$/,\"\"))return!0}else if(i===t)return!0;return!1}(i,this.accept),r=i.size>this.maxSize,a=i.size0&&this.dispatchEvent(new CustomEvent(`${p}-drop-accepted`,{bubbles:!0,composed:!0,detail:{acceptedFiles:t}})),o.length>0&&this.dispatchEvent(new CustomEvent(`${p}-drop-rejected`,{bubbles:!0,composed:!0,detail:{rejectedFiles:o}})),this.#e&&(this.#e.value=this.#e.defaultValue)}openFileDialog(){this.disabled||this.#e?.click()}#o(e){if(Object.prototype.hasOwnProperty.call(this,e)){let t=this[e];delete this[e],this[e]=t}}static defineCustomElement(e=p){\"undefined\"==typeof window||window.customElements.get(e)||window.customElements.define(e,m)}}m.defineCustomElement();export{m as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","function $parcel$export(e, n, v, s) {\n Object.defineProperty(e, n, {get: v, set: s, enumerable: true, configurable: true});\n}\nvar $862aa3736b0514bc$exports = {};\n\n$parcel$export($862aa3736b0514bc$exports, \"FilesDropzone\", function () { return $862aa3736b0514bc$export$6ccd1735166caad9; });\n// @ts-check\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */ // @ts-check\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */ function $38f222170fd4d21a$export$7c47054fed488f80(file, acceptedTypeSpecifiers = \"\") {\n if (!acceptedTypeSpecifiers) return true;\n const acceptedMimeTypesList = [\n ...new Set(acceptedTypeSpecifiers.split(\",\").map((v)=>v.trim()).filter(Boolean))\n ];\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, \"\");\n for (const validType of acceptedMimeTypesList){\n if (validType.charAt(0) === \".\") {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) return true;\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, \"\")) return true;\n } else {\n if (fileMimeType === validType) return true;\n }\n }\n return false;\n}\n\n\n// @ts-check\n/**\n * A map of common file extensions and their associated MIME types.\n */ const $f31161edf38949e9$var$COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n [\n \"aac\",\n \"audio/aac\"\n ],\n [\n \"abw\",\n \"application/x-abiword\"\n ],\n [\n \"arc\",\n \"application/x-freearc\"\n ],\n [\n \"avif\",\n \"image/avif\"\n ],\n [\n \"avi\",\n \"video/x-msvideo\"\n ],\n [\n \"azw\",\n \"application/vnd.amazon.ebook\"\n ],\n [\n \"bin\",\n \"application/octet-stream\"\n ],\n [\n \"bmp\",\n \"image/bmp\"\n ],\n [\n \"bz\",\n \"application/x-bzip\"\n ],\n [\n \"bz2\",\n \"application/x-bzip2\"\n ],\n [\n \"cda\",\n \"application/x-cdf\"\n ],\n [\n \"csh\",\n \"application/x-csh\"\n ],\n [\n \"css\",\n \"text/css\"\n ],\n [\n \"csv\",\n \"text/csv\"\n ],\n [\n \"doc\",\n \"application/msword\"\n ],\n [\n \"docx\",\n \"application/vnd.openxmlformats-officedocument.wordprocessingml.document\"\n ],\n [\n \"eot\",\n \"application/vnd.ms-fontobject\"\n ],\n [\n \"epub\",\n \"application/epub+zip\"\n ],\n [\n \"gz\",\n \"application/gzip\"\n ],\n [\n \"gif\",\n \"image/gif\"\n ],\n [\n \"heic\",\n \"image/heic\"\n ],\n [\n \"heif\",\n \"image/heif\"\n ],\n [\n \"htm\",\n \"text/html\"\n ],\n [\n \"html\",\n \"text/html\"\n ],\n [\n \"ico\",\n \"image/vnd.microsoft.icon\"\n ],\n [\n \"ics\",\n \"text/calendar\"\n ],\n [\n \"jar\",\n \"application/java-archive\"\n ],\n [\n \"jpeg\",\n \"image/jpeg\"\n ],\n [\n \"jpg\",\n \"image/jpeg\"\n ],\n [\n \"jxl\",\n \"image/jxl\"\n ],\n [\n \"js\",\n \"text/javascript\"\n ],\n [\n \"json\",\n \"application/json\"\n ],\n [\n \"jsonld\",\n \"application/ld+json\"\n ],\n [\n \"markdown\",\n \"text/markdown\"\n ],\n [\n \"md\",\n \"text/markdown\"\n ],\n [\n \"mid\",\n \"audio/midi\"\n ],\n [\n \"midi\",\n \"audio/midi\"\n ],\n [\n \"mjs\",\n \"text/javascript\"\n ],\n [\n \"mp3\",\n \"audio/mpeg\"\n ],\n [\n \"mp4\",\n \"video/mp4\"\n ],\n [\n \"mpeg\",\n \"video/mpeg\"\n ],\n [\n \"mpkg\",\n \"application/vnd.apple.installer+xml\"\n ],\n [\n \"odp\",\n \"application/vnd.oasis.opendocument.presentation\"\n ],\n [\n \"ods\",\n \"application/vnd.oasis.opendocument.spreadsheet\"\n ],\n [\n \"odt\",\n \"application/vnd.oasis.opendocument.text\"\n ],\n [\n \"oga\",\n \"audio/ogg\"\n ],\n [\n \"ogv\",\n \"video/ogg\"\n ],\n [\n \"ogx\",\n \"application/ogg\"\n ],\n [\n \"opus\",\n \"audio/opus\"\n ],\n [\n \"otf\",\n \"font/otf\"\n ],\n [\n \"png\",\n \"image/png\"\n ],\n [\n \"pdf\",\n \"application/pdf\"\n ],\n [\n \"php\",\n \"application/x-httpd-php\"\n ],\n [\n \"ppt\",\n \"application/vnd.ms-powerpoint\"\n ],\n [\n \"pptx\",\n \"application/vnd.openxmlformats-officedocument.presentationml.presentation\"\n ],\n [\n \"rar\",\n \"application/vnd.rar\"\n ],\n [\n \"rtf\",\n \"application/rtf\"\n ],\n [\n \"sh\",\n \"application/x-sh\"\n ],\n [\n \"svg\",\n \"image/svg+xml\"\n ],\n [\n \"swf\",\n \"application/x-shockwave-flash\"\n ],\n [\n \"tar\",\n \"application/x-tar\"\n ],\n [\n \"tif\",\n \"image/tiff\"\n ],\n [\n \"tiff\",\n \"image/tiff\"\n ],\n [\n \"ts\",\n \"video/mp2t\"\n ],\n [\n \"ttf\",\n \"font/ttf\"\n ],\n [\n \"txt\",\n \"text/plain\"\n ],\n [\n \"vsd\",\n \"application/vnd.visio\"\n ],\n [\n \"wav\",\n \"audio/wav\"\n ],\n [\n \"weba\",\n \"audio/webm\"\n ],\n [\n \"webm\",\n \"video/webm\"\n ],\n [\n \"webp\",\n \"image/webp\"\n ],\n [\n \"woff\",\n \"font/woff\"\n ],\n [\n \"woff2\",\n \"font/woff2\"\n ],\n [\n \"xhtml\",\n \"application/xhtml+xml\"\n ],\n [\n \"xls\",\n \"application/vnd.ms-excel\"\n ],\n [\n \"xlsx\",\n \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n ],\n [\n \"xml\",\n \"application/xml\"\n ],\n [\n \"xul\",\n \"application/vnd.mozilla.xul+xml\"\n ],\n [\n \"zip\",\n \"application/zip\"\n ],\n [\n \"7z\",\n \"application/x-7z-compressed\"\n ],\n // Others\n [\n \"mkv\",\n \"video/x-matroska\"\n ],\n [\n \"mov\",\n \"video/quicktime\"\n ],\n [\n \"msg\",\n \"application/vnd.ms-outlook\"\n ]\n]);\nconst $f31161edf38949e9$var$FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n \".DS_Store\",\n \"Thumbs.db\" // Windows\n];\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */ const $f31161edf38949e9$var$toFileWithMimeType = (file)=>{\n const { name: name } = file;\n const hasExtension = name && name.lastIndexOf(\".\") !== -1;\n if (hasExtension && !file.type) {\n const extension = (name.split(\".\").pop() || \"\").toLowerCase();\n const type = $f31161edf38949e9$var$COMMON_MIME_TYPES.get(extension);\n if (type) Object.defineProperty(file, \"type\", {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return file;\n};\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */ const $f31161edf38949e9$var$toFileWithPath = (file, path)=>{\n const fileWithMimeType = $f31161edf38949e9$var$toFileWithMimeType(file);\n // @ts-ignore\n if (typeof fileWithMimeType.path !== \"string\") {\n const { webkitRelativePath: webkitRelativePath } = file;\n Object.defineProperty(fileWithMimeType, \"path\", {\n value: typeof path === \"string\" ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n return fileWithMimeType;\n};\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */ const $f31161edf38949e9$var$readEntriesPromise = async (directoryReader)=>{\n return await new Promise((resolve, reject)=>{\n directoryReader.readEntries(resolve, reject);\n });\n};\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */ const $f31161edf38949e9$var$readAllDirectoryEntries = async (directoryReader)=>{\n const entries = [];\n let readEntries = await $f31161edf38949e9$var$readEntriesPromise(directoryReader);\n while(readEntries.length > 0){\n entries.push(...readEntries);\n readEntries = await $f31161edf38949e9$var$readEntriesPromise(directoryReader);\n }\n return entries;\n};\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */ const $f31161edf38949e9$var$getFileFromFileEntry = (fileEntry)=>{\n return new Promise((resolve, reject)=>{\n fileEntry.file((file)=>resolve($f31161edf38949e9$var$toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */ const $f31161edf38949e9$var$getFilesFromDataTransferItemList = async (dataTransferItemList)=>{\n const files = [];\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n for (const item of dataTransferItemList){\n if (item.kind !== \"file\") continue;\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n queue.push(entry);\n }\n while(queue.length > 0){\n const entry = queue.shift();\n if (!entry) continue;\n else if (entry.isFile) {\n const file = await $f31161edf38949e9$var$getFileFromFileEntry(entry);\n if ($f31161edf38949e9$var$FILES_TO_IGNORE.indexOf(file.name) === -1) files.push(file);\n } else if (entry.isDirectory) queue.push(...await $f31161edf38949e9$var$readAllDirectoryEntries(entry.createReader()));\n }\n return files;\n};\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */ const $f31161edf38949e9$var$getFilesFromFileList = async (fileList)=>{\n const files = [];\n for (const file of fileList)if ($f31161edf38949e9$var$FILES_TO_IGNORE.indexOf(file.name) === -1) files.push($f31161edf38949e9$var$toFileWithPath(file));\n return files;\n};\nconst $f31161edf38949e9$export$6d52664cd15c442 = async (evt)=>{\n if (evt.dataTransfer) return evt.dataTransfer.items ? await $f31161edf38949e9$var$getFilesFromDataTransferItemList(evt.dataTransfer.items) : await $f31161edf38949e9$var$getFilesFromFileList(evt.dataTransfer.files);\n return await $f31161edf38949e9$var$getFilesFromFileList(evt.target.files);\n};\n\n\nconst $862aa3736b0514bc$var$COMPONENT_NAME = \"files-dropzone\";\nconst $862aa3736b0514bc$var$TOO_MANY_FILES = \"TOO_MANY_FILES\";\nconst $862aa3736b0514bc$var$FILE_TOO_LARGE = \"FILE_TOO_LARGE\";\nconst $862aa3736b0514bc$var$FILE_TOO_SMALL = \"FILE_TOO_SMALL\";\nconst $862aa3736b0514bc$var$INVALID_MIME_TYPE = \"INVALID_MIME_TYPE\";\nconst $862aa3736b0514bc$var$template = document.createElement(\"template\");\nconst $862aa3736b0514bc$var$styles = /* css */ `\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n$862aa3736b0514bc$var$template.innerHTML = /* html */ `\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} noClick - Prevents the file dialog from opening when the dropzone is clicked.\n * @property {boolean} noDrag - Prevents the dropzone from reacting to drag events.\n * @property {boolean} noKeyboard - Prevents the dropzone from reacting to keyboard events.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} no-click - Reflects the noClick property.\n * @attribute {boolean} no-drag - Reflects the noDrag property.\n * @attribute {boolean} no-keyboard - Reflects the noKeyboard property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */ class $862aa3736b0514bc$export$6ccd1735166caad9 extends HTMLElement {\n /** @type {Nullable} */ #fileInput = null;\n /** @type {Nullable} */ #dropzoneEl = null;\n constructor(){\n super();\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({\n mode: \"open\"\n });\n shadowRoot.appendChild($862aa3736b0514bc$var$template.content.cloneNode(true));\n }\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */ this.shadowRoot.getElementById(\"fileInput\");\n this.#dropzoneEl = this.shadowRoot.getElementById(\"dropzoneEl\");\n }\n }\n static get observedAttributes() {\n return [\n \"accept\",\n \"disabled\",\n \"multiple\",\n \"no-keyboard\"\n ];\n }\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */ attributeChangedCallback(name, oldValue, newValue) {\n if (name === \"accept\" && oldValue !== newValue && this.#fileInput) this.#fileInput.accept = this.accept;\n if (name === \"disabled\" && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n if (this.disabled) this.#dropzoneEl?.removeAttribute(\"tabindex\");\n else this.#dropzoneEl?.setAttribute(\"tabindex\", \"0\");\n }\n if (name === \"multiple\" && oldValue !== newValue && this.#fileInput) this.#fileInput.multiple = this.multiple;\n if (name === \"no-keyboard\" && oldValue !== newValue && this.#dropzoneEl) {\n if (this.noKeyboard) this.#dropzoneEl.removeAttribute(\"tabindex\");\n else this.#dropzoneEl.setAttribute(\"tabindex\", \"0\");\n }\n }\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */ connectedCallback() {\n this.#upgradeProperty(\"accept\");\n this.#upgradeProperty(\"disabled\");\n this.#upgradeProperty(\"maxFiles\");\n this.#upgradeProperty(\"maxSize\");\n this.#upgradeProperty(\"minSize\");\n this.#upgradeProperty(\"multiple\");\n this.#upgradeProperty(\"noClick\");\n this.#upgradeProperty(\"noDrag\");\n this.#upgradeProperty(\"noKeyboard\");\n this.#upgradeProperty(\"autoFocus\");\n this.#upgradeProperty(\"noStyle\");\n this.#fileInput?.addEventListener(\"change\", this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener(\"dragenter\", this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener(\"dragover\", this.#handleDragOver);\n this.#dropzoneEl?.addEventListener(\"dragleave\", this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener(\"drop\", this.#handleDrop);\n this.#dropzoneEl?.addEventListener(\"click\", this.#handleClick);\n this.#dropzoneEl?.addEventListener(\"keyup\", this.#handleKeyUp);\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */ disconnectedCallback() {\n this.#fileInput?.removeEventListener(\"change\", this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener(\"dragenter\", this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener(\"dragover\", this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener(\"dragleave\", this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener(\"drop\", this.#handleDrop);\n this.#dropzoneEl?.removeEventListener(\"click\", this.#handleClick);\n this.#dropzoneEl?.removeEventListener(\"keyup\", this.#handleKeyUp);\n }\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */ get accept() {\n return this.getAttribute(\"accept\") || \"\";\n }\n set accept(value) {\n this.setAttribute(\"accept\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */ get disabled() {\n return this.hasAttribute(\"disabled\");\n }\n set disabled(value) {\n this.toggleAttribute(\"disabled\", !!value);\n }\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */ get maxFiles() {\n const num = Number(this.getAttribute(\"max-files\")) || 0;\n if (num <= 0) return Infinity;\n return Math.floor(Math.abs(num));\n }\n set maxFiles(value) {\n this.setAttribute(\"max-files\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */ get maxSize() {\n const value = this.getAttribute(\"max-size\");\n if (value === null) return Infinity;\n const num = Number(value);\n return Number.isNaN(num) ? Infinity : num;\n }\n set maxSize(value) {\n this.setAttribute(\"max-size\", value != null ? value.toString() : value);\n }\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */ get minSize() {\n const value = this.getAttribute(\"min-size\");\n if (value === null) return 0;\n const num = Number(value);\n return Number.isNaN(num) ? 0 : num;\n }\n set minSize(value) {\n this.setAttribute(\"min-size\", value != null ? value.toString() : value);\n }\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */ get multiple() {\n return this.hasAttribute(\"multiple\");\n }\n set multiple(value) {\n this.toggleAttribute(\"multiple\", !!value);\n }\n /**\n * @type {boolean} - Prevents the file dialog from opening when the dropzone is clicked.\n * @default false\n * @attribute no-click - Reflects the noClick property.\n */ get noClick() {\n return this.hasAttribute(\"no-click\");\n }\n set noClick(value) {\n this.toggleAttribute(\"no-click\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from reacting to drag events.\n * @default false\n * @attribute no-drag - Reflects the noDrag property.\n */ get noDrag() {\n return this.hasAttribute(\"no-drag\");\n }\n set noDrag(value) {\n this.toggleAttribute(\"no-drag\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from reacting to keyboard events.\n * @default false\n * @attribute no-keyboard - Reflects the noKeyboard property.\n */ get noKeyboard() {\n return this.hasAttribute(\"no-keyboard\");\n }\n set noKeyboard(value) {\n this.toggleAttribute(\"no-keyboard\", !!value);\n }\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */ get autoFocus() {\n return this.hasAttribute(\"auto-focus\");\n }\n set autoFocus(value) {\n this.toggleAttribute(\"auto-focus\", !!value);\n }\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */ get noStyle() {\n return this.hasAttribute(\"no-style\");\n }\n set noStyle(value) {\n this.toggleAttribute(\"no-style\", !!value);\n }\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */ #handleFileInputChange = async (evt)=>{\n try {\n this.#handleFilesSelect(await (0, $f31161edf38949e9$export$6d52664cd15c442)(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n };\n /**\n * Handles the dragenter event of the dropzone.\n */ #handleDragEnter = ()=>{\n if (this.disabled || this.noDrag) return;\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleDragOver = (evt)=>{\n evt.preventDefault();\n if (this.disabled || this.noDrag) {\n evt.dataTransfer.dropEffect = \"none\";\n return;\n }\n evt.dataTransfer.dropEffect = \"copy\";\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add(\"dropzone--dragover\");\n this.#dropzoneEl.part.add(\"dropzone--dragover\");\n }\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the dragleave event of the dropzone.\n */ #handleDragLeave = ()=>{\n if (this.disabled || this.noDrag) return;\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove(\"dropzone--dragover\");\n this.#dropzoneEl.part.remove(\"dropzone--dragover\");\n }\n this.dispatchEvent(new Event(`${$862aa3736b0514bc$var$COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n }));\n };\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleDrop = async (evt)=>{\n if (this.disabled || this.noDrag) return;\n evt.preventDefault();\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove(\"dropzone--dragover\");\n this.#dropzoneEl.part.remove(\"dropzone--dragover\");\n }\n try {\n this.#handleFilesSelect(await (0, $f31161edf38949e9$export$6d52664cd15c442)(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: {\n error: error\n }\n }));\n }\n };\n /**\n * Handles the click event of the dropzone.\n */ #handleClick = ()=>{\n if (this.disabled || this.noClick) return;\n this.#fileInput?.click();\n };\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */ #handleKeyUp = (evt)=>{\n if (this.disabled || this.noKeyboard) return;\n if (evt.key === \" \" || evt.key === \"Enter\") this.#fileInput?.click();\n };\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */ #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) return;\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) for (const file of files)rejectedFiles.push({\n file: file,\n errors: [\n {\n code: $862aa3736b0514bc$var$TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }\n ]\n });\n else if (this.multiple && filesLength > this.maxFiles) // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files)rejectedFiles.push({\n file: file,\n errors: [\n {\n code: $862aa3736b0514bc$var$TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? \"files are\" : \"file is\"} allowed.`\n }\n ]\n });\n else // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files){\n const fileHasValidType = (0, $38f222170fd4d21a$export$7c47054fed488f80)(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) acceptedFiles.push(file);\n else {\n const errors = [];\n if (!fileHasValidType) errors.push({\n code: $862aa3736b0514bc$var$INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n if (fileExceedsMaxSize) errors.push({\n code: $862aa3736b0514bc$var$FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n if (fileIsSmallerThanMinSize) errors.push({\n code: $862aa3736b0514bc$var$FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n rejectedFiles.push({\n file: file,\n errors: errors\n });\n }\n }\n this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles: acceptedFiles,\n rejectedFiles: rejectedFiles\n }\n }));\n if (acceptedFiles.length > 0) this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles: acceptedFiles\n }\n }));\n if (rejectedFiles.length > 0) this.dispatchEvent(new CustomEvent(`${$862aa3736b0514bc$var$COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles: rejectedFiles\n }\n }));\n if (this.#fileInput) this.#fileInput.value = this.#fileInput.defaultValue;\n }\n /**\n * Opens the file dialog programmatically.\n */ openFileDialog() {\n if (this.disabled) return;\n this.#fileInput?.click();\n }\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'noClick' | 'noDrag' | 'noKeyboard' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */ #upgradeProperty(prop) {\n /** @type {any} */ const instance = this;\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */ static defineCustomElement(elementName = $862aa3736b0514bc$var$COMPONENT_NAME) {\n if (typeof window !== \"undefined\" && !window.customElements.get(elementName)) window.customElements.define(elementName, $862aa3736b0514bc$export$6ccd1735166caad9);\n }\n}\n\n\n(0, $862aa3736b0514bc$export$6ccd1735166caad9).defineCustomElement();\n\n\nexport {$862aa3736b0514bc$export$6ccd1735166caad9 as FilesDropzone};\n//# sourceMappingURL=files-dropzone-defined.js.map\n","import { FilesDropzone } from './files-dropzone.js';\n\nFilesDropzone.defineCustomElement();\n\nexport { FilesDropzone };\n","// @ts-check\n\n/**\n * Represents a value that may be of type T, or null.\n *\n * @template T\n * @typedef {T | null} Nullable\n */\n\nimport { isValidFile } from './utils/is-valid-file.js';\nimport { getFilesFromEvent } from './utils/files-selector.js';\n\nconst COMPONENT_NAME = 'files-dropzone';\nconst TOO_MANY_FILES = 'TOO_MANY_FILES';\nconst FILE_TOO_LARGE = 'FILE_TOO_LARGE';\nconst FILE_TOO_SMALL = 'FILE_TOO_SMALL';\nconst INVALID_MIME_TYPE = 'INVALID_MIME_TYPE';\nconst template = document.createElement('template');\n\nconst styles = /* css */`\n *,\n *::before,\n *::after {\n box-sizing: border-box;\n }\n\n :host([hidden]),\n [hidden] {\n display: none !important;\n }\n\n :host {\n --dropzone-border-width: 2px;\n --dropzone-border-style: dashed;\n --dropzone-border-radius: 0.25rem;\n --dropzone-border-color: #6c757d;\n --dropzone-border-color-dragover: #0d6efd;\n --dropzone-border-color-hover: var(--dropzone-border-color-dragover);\n --dropzone-background-color: #ffffff;\n --dropzone-background-color-dragover: #f4f4f5;\n --dropzone-background-color-hover: var(--dropzone-background-color-dragover);\n --dropzone-body-color: #3f3f46;\n --dropzone-body-color-dragover: var(--dropzone-body-color);\n --dropzone-body-color-hover: var(--dropzone-body-color-dragover);\n --dropzone-focus-shadow-rgb: 49,132,253;\n --dropzone-focus-box-shadow: 0 0 0 0.25rem rgba(var(--dropzone-focus-shadow-rgb), 0.5);\n --transition-duration: 0.2s; /* for backwards compatibility */\n --dropzone-transition-duration: var(--transition-duration);\n\n display: block;\n }\n\n :host(:not([no-style])) .dropzone {\n border: var(--dropzone-border-width) var(--dropzone-border-style) var(--dropzone-border-color);\n border-radius: var(--dropzone-border-radius);\n padding: 3rem 1rem;\n overflow: hidden;\n background-color: var(--dropzone-background-color);\n color: var(--dropzone-body-color);\n text-align: center;\n cursor: pointer;\n transition: border var(--dropzone-transition-duration) ease-in-out, background-color var(--dropzone-transition-duration) ease-in-out, color var(--dropzone-transition-duration) ease-in-out, box-shadow var(--dropzone-transition-duration) ease-in-out;\n }\n\n :host(:not([no-style])[no-click]) .dropzone {\n cursor: default;\n }\n\n :host(:not([no-style])[disabled]) .dropzone {\n opacity: 0.8;\n cursor: not-allowed;\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone--dragover {\n border-color: var(--dropzone-border-color-dragover);\n background-color: var(--dropzone-background-color-dragover);\n color: var(--dropzone-body-color-dragover);\n }\n\n :host(:not([no-style]):not([disabled])) .dropzone:focus-visible {\n outline: none;\n box-shadow: var(--dropzone-focus-box-shadow);\n }\n\n @media (hover: hover) {\n :host(:not([no-style]):not([disabled])) .dropzone:not(.dropzone--dragover):hover {\n border-color: var(--dropzone-border-color-hover);\n background-color: var(--dropzone-background-color-hover);\n color: var(--dropzone-body-color-hover);\n }\n }\n`;\n\ntemplate.innerHTML = /* html */`\n \n\n \n\n
\n Drag 'n' drop files here, or click to select files\n
\n`;\n\n/**\n * @summary A custom element that allows users to drag and drop files into it.\n * @documentation https://github.com/georapbox/files-dropzone-element\n *\n * @tagname files-dropzone - This is the default tag name, unless overridden by the `defineCustomElement` method.\n *\n * @property {string} accept - A comma-separated list of unique file type specifiers describing file types to allow.\n * @property {boolean} disabled - Determines whether the dropzone is disabled.\n * @property {number} maxFiles - The maximum number of files allowed to be dropped.\n * @property {number} maxSize - The maximum file size allowed in bytes.\n * @property {number} minSize - The minimum file size allowed in bytes.\n * @property {boolean} multiple - Allows multiple files to be dropped.\n * @property {boolean} noClick - Prevents the file dialog from opening when the dropzone is clicked.\n * @property {boolean} noDrag - Prevents the dropzone from reacting to drag events.\n * @property {boolean} noKeyboard - Prevents the dropzone from reacting to keyboard events.\n * @property {boolean} autoFocus - Automatically focuses the dropzone when it's connected to the DOM.\n * @property {boolean} noStyle - Prevents the dropzone from applying any styling.\n *\n * @attribute {string} accept - Reflects the accept property.\n * @attribute {boolean} disabled - Reflects the disabled property.\n * @attribute {number} max-files - Reflects the maxFiles property.\n * @attribute {number} max-size - Reflects the maxSize property.\n * @attribute {number} min-size - Reflects the minSize property.\n * @attribute {boolean} multiple - Reflects the multiple property.\n * @attribute {boolean} no-click - Reflects the noClick property.\n * @attribute {boolean} no-drag - Reflects the noDrag property.\n * @attribute {boolean} no-keyboard - Reflects the noKeyboard property.\n * @attribute {boolean} auto-focus - Reflects the autoFocus property.\n * @attribute {boolean} no-style - Reflects the noStyle property.\n *\n * @slot - The default slot content of the dropzone.\n *\n * @csspart dropzone - The dropzone element.\n * @csspart dropzone--dragover - The state of the dropzone when dragging over it.\n *\n * @cssproperty --dropzone-border-width - The border width of the dropzone.\n * @cssproperty --dropzone-border-style - The border style of the dropzone.\n * @cssproperty --dropzone-border-radius - The border radius of the dropzone.\n * @cssproperty --dropzone-border-color - The border color of the dropzone.\n * @cssproperty --dropzone-border-color-dragover - The border color of the dropzone when dragging over it.\n * @cssproperty --dropzone-border-color-hover - The border color of the dropzone when hovering over it.\n * @cssproperty --dropzone-background-color - The background color of the dropzone.\n * @cssproperty --dropzone-background-color-dragover - The background color of the dropzone when dragging over it.\n * @cssproperty --dropzone-background-color-hover - The background color of the dropzone when hovering over it.\n * @cssproperty --dropzone-body-color - The text color of the dropzone.\n * @cssproperty --dropzone-body-color-dragover - The text color of the dropzone when dragging over it.\n * @cssproperty --dropzone-body-color-hover - The text color of the dropzone when hovering over it.\n * @cssproperty --dropzone-focus-shadow-rgb - The RGB value of the dropzone's focus shadow.\n * @cssproperty --dropzone-focus-box-shadow - The box shadow of the dropzone when focused.\n * @cssproperty --dropzone-transition-duration - The transition's duration for the dropzone area.\n *\n * @event files-dropzone-drop - Fired when files are dropped.\n * @event files-dropzone-drop-accepted - Fired when files dropped files are accepted.\n * @event files-dropzone-drop-rejected - Fired when files dropped files are rejected.\n * @event files-dropzone-dragenter - Fired when files are dragged into the dropzone.\n * @event files-dropzone-dragover - Fired when files are dragged over the dropzone.\n * @event files-dropzone-dragleave - Fired when files are dragged out of the dropzone.\n * @event files-dropzone-error - Fired when there is any error in the process of reading dropped files or directories.\n *\n * @method defineCustomElement - Static method. Defines a custom element with the given name.\n * @method openFileDialog - Instance method. Opens the file dialog programmatically.\n */\nclass FilesDropzone extends HTMLElement {\n /** @type {Nullable} */\n #fileInput = null;\n\n /** @type {Nullable} */\n #dropzoneEl = null;\n\n constructor() {\n super();\n\n if (!this.shadowRoot) {\n const shadowRoot = this.attachShadow({ mode: 'open' });\n shadowRoot.appendChild(template.content.cloneNode(true));\n }\n\n if (this.shadowRoot) {\n this.#fileInput = /** @type {Nullable} */(this.shadowRoot.getElementById('fileInput'));\n this.#dropzoneEl = this.shadowRoot.getElementById('dropzoneEl');\n }\n }\n\n static get observedAttributes() {\n return ['accept', 'disabled', 'multiple', 'no-keyboard'];\n }\n\n /**\n * Lifecycle method that is called when attributes are changed, added, removed, or replaced.\n *\n * @param {string} name - The name of the attribute.\n * @param {string} oldValue - The old value of the attribute.\n * @param {string} newValue - The new value of the attribute.\n */\n attributeChangedCallback(name, oldValue, newValue) {\n if (name === 'accept' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.accept = this.accept;\n }\n\n if (name === 'disabled' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.disabled = this.disabled;\n\n if (this.disabled) {\n this.#dropzoneEl?.removeAttribute('tabindex');\n } else {\n this.#dropzoneEl?.setAttribute('tabindex', '0');\n }\n }\n\n if (name === 'multiple' && oldValue !== newValue && this.#fileInput) {\n this.#fileInput.multiple = this.multiple;\n }\n\n if (name === 'no-keyboard' && oldValue !== newValue && this.#dropzoneEl) {\n if (this.noKeyboard) {\n this.#dropzoneEl.removeAttribute('tabindex');\n } else {\n this.#dropzoneEl.setAttribute('tabindex', '0');\n }\n }\n }\n\n /**\n * Lifecycle method that is called when the element is added to the DOM.\n */\n connectedCallback() {\n this.#upgradeProperty('accept');\n this.#upgradeProperty('disabled');\n this.#upgradeProperty('maxFiles');\n this.#upgradeProperty('maxSize');\n this.#upgradeProperty('minSize');\n this.#upgradeProperty('multiple');\n this.#upgradeProperty('noClick');\n this.#upgradeProperty('noDrag');\n this.#upgradeProperty('noKeyboard');\n this.#upgradeProperty('autoFocus');\n this.#upgradeProperty('noStyle');\n\n this.#fileInput?.addEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.addEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.addEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.addEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.addEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.addEventListener('click', this.#handleClick);\n this.#dropzoneEl?.addEventListener('keyup', this.#handleKeyUp);\n\n this.autoFocus && this.#dropzoneEl?.focus();\n }\n\n /**\n * Lifecycle method that is called when the element is removed from the DOM.\n */\n disconnectedCallback() {\n this.#fileInput?.removeEventListener('change', this.#handleFileInputChange);\n this.#dropzoneEl?.removeEventListener('dragenter', this.#handleDragEnter);\n this.#dropzoneEl?.removeEventListener('dragover', this.#handleDragOver);\n this.#dropzoneEl?.removeEventListener('dragleave', this.#handleDragLeave);\n this.#dropzoneEl?.removeEventListener('drop', this.#handleDrop);\n this.#dropzoneEl?.removeEventListener('click', this.#handleClick);\n this.#dropzoneEl?.removeEventListener('keyup', this.#handleKeyUp);\n }\n\n /**\n * @type {string} - A comma-separated list of unique file type specifiers describing file types to allow.\n * @attribute accept - Reflects the accept property.\n */\n get accept() {\n return this.getAttribute('accept') || '';\n }\n\n set accept(value) {\n this.setAttribute('accept', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Determines whether the dropzone is disabled.\n * @default false\n * @attribute disabled - Reflects the disabled property.\n */\n get disabled() {\n return this.hasAttribute('disabled');\n }\n\n set disabled(value) {\n this.toggleAttribute('disabled', !!value);\n }\n\n /**\n * @type {number} - The maximum number of files allowed to be dropped.\n * @default Infinity\n * @attribute max-files - Reflects the maxFiles property.\n */\n get maxFiles() {\n const num = Number(this.getAttribute('max-files')) || 0;\n\n if (num <= 0) {\n return Infinity;\n }\n\n return Math.floor(Math.abs(num));\n }\n\n set maxFiles(value) {\n this.setAttribute('max-files', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The maximum file size allowed in bytes.\n * @default Infinity\n * @attribute max-size - Reflects the maxSize property.\n */\n get maxSize() {\n const value = this.getAttribute('max-size');\n\n if (value === null) {\n return Infinity;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? Infinity : num;\n }\n\n set maxSize(value) {\n this.setAttribute('max-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {number} - The minimum file size allowed in bytes.\n * @default 0\n * @attribute min-size - Reflects the minSize property.\n */\n get minSize() {\n const value = this.getAttribute('min-size');\n\n if (value === null) {\n return 0;\n }\n\n const num = Number(value);\n\n return Number.isNaN(num) ? 0 : num;\n }\n\n set minSize(value) {\n this.setAttribute('min-size', value != null ? value.toString() : value);\n }\n\n /**\n * @type {boolean} - Allows multiple files to be dropped.\n * @default false\n * @attribute multiple - Reflects the multiple property.\n */\n get multiple() {\n return this.hasAttribute('multiple');\n }\n\n set multiple(value) {\n this.toggleAttribute('multiple', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the file dialog from opening when the dropzone is clicked.\n * @default false\n * @attribute no-click - Reflects the noClick property.\n */\n get noClick() {\n return this.hasAttribute('no-click');\n }\n\n set noClick(value) {\n this.toggleAttribute('no-click', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from reacting to drag events.\n * @default false\n * @attribute no-drag - Reflects the noDrag property.\n */\n get noDrag() {\n return this.hasAttribute('no-drag');\n }\n\n set noDrag(value) {\n this.toggleAttribute('no-drag', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from reacting to keyboard events.\n * @default false\n * @attribute no-keyboard - Reflects the noKeyboard property.\n */\n get noKeyboard() {\n return this.hasAttribute('no-keyboard');\n }\n\n set noKeyboard(value) {\n this.toggleAttribute('no-keyboard', !!value);\n }\n\n /**\n * @type {boolean} - Automatically focuses the dropzone when it's connected to the DOM.\n * @default false\n * @attribute auto-focus - Reflects the autoFocus property.\n */\n get autoFocus() {\n return this.hasAttribute('auto-focus');\n }\n\n set autoFocus(value) {\n this.toggleAttribute('auto-focus', !!value);\n }\n\n /**\n * @type {boolean} - Prevents the dropzone from applying any styling.\n * @default false\n * @attribute no-style - Reflects the noStyle property.\n */\n get noStyle() {\n return this.hasAttribute('no-style');\n }\n\n set noStyle(value) {\n this.toggleAttribute('no-style', !!value);\n }\n\n /**\n * Handles the change event of the file input.\n *\n * @param {*} evt - The event object.\n */\n #handleFileInputChange = async evt => {\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n };\n\n /**\n * Handles the dragenter event of the dropzone.\n */\n #handleDragEnter = () => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragenter`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the dragover event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDragOver = evt => {\n evt.preventDefault();\n\n if (this.disabled || this.noDrag) {\n evt.dataTransfer.dropEffect = 'none';\n return;\n }\n\n evt.dataTransfer.dropEffect = 'copy';\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.add('dropzone--dragover');\n this.#dropzoneEl.part.add('dropzone--dragover');\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragover`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the dragleave event of the dropzone.\n */\n #handleDragLeave = () => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n this.dispatchEvent(new Event(`${COMPONENT_NAME}-dragleave`, {\n bubbles: true,\n composed: true\n }));\n };\n\n /**\n * Handles the drop event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleDrop = async evt => {\n if (this.disabled || this.noDrag) {\n return;\n }\n\n evt.preventDefault();\n\n if (this.#dropzoneEl) {\n this.#dropzoneEl.classList.remove('dropzone--dragover');\n this.#dropzoneEl.part.remove('dropzone--dragover');\n }\n\n try {\n this.#handleFilesSelect(await getFilesFromEvent(evt));\n } catch (error) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-error`, {\n bubbles: true,\n composed: true,\n detail: { error }\n }));\n }\n };\n\n /**\n * Handles the click event of the dropzone.\n */\n #handleClick = () => {\n if (this.disabled || this.noClick) {\n return;\n }\n\n this.#fileInput?.click();\n };\n\n /**\n * Handles the keyup event of the dropzone.\n *\n * @param {*} evt - The event object.\n */\n #handleKeyUp = evt => {\n if (this.disabled || this.noKeyboard) {\n return;\n }\n\n if (evt.key === ' ' || evt.key === 'Enter') {\n this.#fileInput?.click();\n }\n };\n\n /**\n * Handles the selection of files.\n *\n * @param {File[]} files - The files to handle.\n */\n #handleFilesSelect(files) {\n if (!Array.isArray(files) || !files.length) {\n return;\n }\n\n const acceptedFiles = [];\n const rejectedFiles = [];\n const filesLength = files.length;\n\n // If the component is not in multiple mode, reject all files.\n if (!this.multiple && filesLength > 1) {\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [{\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only 1 file is allowed.`\n }]\n });\n }\n } else if (this.multiple && filesLength > this.maxFiles) {\n // If the component is in multiple mode, but the number of files exceeds\n // the maxFiles attribute, reject all files.\n for (const file of files) {\n rejectedFiles.push({\n file,\n errors: [{\n code: TOO_MANY_FILES,\n message: `Too many files selected. Only ${this.maxFiles} ${this.maxFiles > 1 ? 'files are' : 'file is'} allowed.`\n }]\n });\n }\n } else {\n // Validate each file. If it's valid, add it to the accepted files array,\n // otherwise add it to the rejected files array.\n for (const file of files) {\n const fileHasValidType = isValidFile(file, this.accept);\n const fileExceedsMaxSize = file.size > this.maxSize;\n const fileIsSmallerThanMinSize = file.size < this.minSize;\n\n if (fileHasValidType && !fileExceedsMaxSize && !fileIsSmallerThanMinSize) {\n acceptedFiles.push(file);\n } else {\n const errors = [];\n\n if (!fileHasValidType) {\n errors.push({\n code: INVALID_MIME_TYPE,\n message: `File type \"${file.type}\" is not accepted.`\n });\n }\n\n if (fileExceedsMaxSize) {\n errors.push({\n code: FILE_TOO_LARGE,\n message: `File size ${file.size} exceeds the maximum size of ${this.maxSize}.`\n });\n }\n\n if (fileIsSmallerThanMinSize) {\n errors.push({\n code: FILE_TOO_SMALL,\n message: `File size ${file.size} is smaller than the minimum size of ${this.minSize}.`\n });\n }\n\n rejectedFiles.push({ file, errors });\n }\n }\n }\n\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles,\n rejectedFiles\n }\n }));\n\n if (acceptedFiles.length > 0) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop-accepted`, {\n bubbles: true,\n composed: true,\n detail: {\n acceptedFiles\n }\n }));\n }\n\n if (rejectedFiles.length > 0) {\n this.dispatchEvent(new CustomEvent(`${COMPONENT_NAME}-drop-rejected`, {\n bubbles: true,\n composed: true,\n detail: {\n rejectedFiles\n }\n }));\n }\n\n if (this.#fileInput) {\n this.#fileInput.value = this.#fileInput.defaultValue;\n }\n }\n\n /**\n * Opens the file dialog programmatically.\n */\n openFileDialog() {\n if (this.disabled) {\n return;\n }\n\n this.#fileInput?.click();\n }\n\n /**\n * This is to safe guard against cases where, for instance, a framework may have added the element to the page and set a\n * value on one of its properties, but lazy loaded its definition. Without this guard, the upgraded element would miss that\n * property and the instance property would prevent the class property setter from ever being called.\n *\n * https://developers.google.com/web/fundamentals/web-components/best-practices#lazy-properties\n *\n * @param {'accept' | 'disabled' | 'maxFiles' | 'maxSize' | 'minSize' | 'multiple' | 'noClick' | 'noDrag' | 'noKeyboard' | 'autoFocus' | 'noStyle'} prop - The property name to upgrade.\n */\n #upgradeProperty(prop) {\n /** @type {any} */\n const instance = this;\n\n if (Object.prototype.hasOwnProperty.call(instance, prop)) {\n const value = instance[prop];\n delete instance[prop];\n instance[prop] = value;\n }\n }\n\n /**\n * Defines a custom element with the given name.\n * The name must contain a dash (-).\n *\n * @param {string} [elementName='files-dropzone'] - The name of the custom element.\n * @example\n *\n * FilesDropzone.defineCustomElement('my-dropzone');\n */\n static defineCustomElement(elementName = COMPONENT_NAME) {\n if (typeof window !== 'undefined' && !window.customElements.get(elementName)) {\n window.customElements.define(elementName, FilesDropzone);\n }\n }\n}\n\nexport { FilesDropzone };\n","// @ts-check\n\n/**\n * Checks if a file is valid based on the accepted file type specifiers.\n *\n * @param {File} file - The File object to validate.\n * @param {string} [acceptedTypeSpecifiers=''] - The accepted file type specifiers.\n * @returns {boolean} - True if the file is valid, false otherwise.\n */\nexport function isValidFile(file, acceptedTypeSpecifiers = '') {\n if (!acceptedTypeSpecifiers) {\n return true;\n }\n\n const acceptedMimeTypesList = [\n ...new Set(acceptedTypeSpecifiers.split(',').map(v => v.trim()).filter(Boolean))\n ];\n\n const fileMimeType = file.type;\n const baseMimeType = fileMimeType.replace(/\\/.*$/, '');\n\n for (const validType of acceptedMimeTypesList) {\n if (validType.charAt(0) === '.') {\n if (file.name.toLowerCase().indexOf(validType.toLowerCase(), file.name.length - validType.length) !== -1) {\n return true;\n }\n } else if (/\\/\\*$/.test(validType)) {\n // Check for mime type that looks like \"image/*\" or similar.\n if (baseMimeType === validType.replace(/\\/.*$/, '')) {\n return true;\n }\n } else {\n if (fileMimeType === validType) {\n return true;\n }\n }\n }\n\n return false;\n}\n","// @ts-check\n\n/**\n * A map of common file extensions and their associated MIME types.\n */\nconst COMMON_MIME_TYPES = new Map([\n // https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types\n ['aac', 'audio/aac'],\n ['abw', 'application/x-abiword'],\n ['arc', 'application/x-freearc'],\n ['avif', 'image/avif'],\n ['avi', 'video/x-msvideo'],\n ['azw', 'application/vnd.amazon.ebook'],\n ['bin', 'application/octet-stream'],\n ['bmp', 'image/bmp'],\n ['bz', 'application/x-bzip'],\n ['bz2', 'application/x-bzip2'],\n ['cda', 'application/x-cdf'],\n ['csh', 'application/x-csh'],\n ['css', 'text/css'],\n ['csv', 'text/csv'],\n ['doc', 'application/msword'],\n ['docx', 'application/vnd.openxmlformats-officedocument.wordprocessingml.document'],\n ['eot', 'application/vnd.ms-fontobject'],\n ['epub', 'application/epub+zip'],\n ['gz', 'application/gzip'],\n ['gif', 'image/gif'],\n ['heic', 'image/heic'],\n ['heif', 'image/heif'],\n ['htm', 'text/html'],\n ['html', 'text/html'],\n ['ico', 'image/vnd.microsoft.icon'],\n ['ics', 'text/calendar'],\n ['jar', 'application/java-archive'],\n ['jpeg', 'image/jpeg'],\n ['jpg', 'image/jpeg'],\n ['jxl', 'image/jxl'],\n ['js', 'text/javascript'],\n ['json', 'application/json'],\n ['jsonld', 'application/ld+json'],\n ['markdown', 'text/markdown'],\n ['md', 'text/markdown'],\n ['mid', 'audio/midi'],\n ['midi', 'audio/midi'],\n ['mjs', 'text/javascript'],\n ['mp3', 'audio/mpeg'],\n ['mp4', 'video/mp4'],\n ['mpeg', 'video/mpeg'],\n ['mpkg', 'application/vnd.apple.installer+xml'],\n ['odp', 'application/vnd.oasis.opendocument.presentation'],\n ['ods', 'application/vnd.oasis.opendocument.spreadsheet'],\n ['odt', 'application/vnd.oasis.opendocument.text'],\n ['oga', 'audio/ogg'],\n ['ogv', 'video/ogg'],\n ['ogx', 'application/ogg'],\n ['opus', 'audio/opus'],\n ['otf', 'font/otf'],\n ['png', 'image/png'],\n ['pdf', 'application/pdf'],\n ['php', 'application/x-httpd-php'],\n ['ppt', 'application/vnd.ms-powerpoint'],\n ['pptx', 'application/vnd.openxmlformats-officedocument.presentationml.presentation'],\n ['rar', 'application/vnd.rar'],\n ['rtf', 'application/rtf'],\n ['sh', 'application/x-sh'],\n ['svg', 'image/svg+xml'],\n ['swf', 'application/x-shockwave-flash'],\n ['tar', 'application/x-tar'],\n ['tif', 'image/tiff'],\n ['tiff', 'image/tiff'],\n ['ts', 'video/mp2t'],\n ['ttf', 'font/ttf'],\n ['txt', 'text/plain'],\n ['vsd', 'application/vnd.visio'],\n ['wav', 'audio/wav'],\n ['weba', 'audio/webm'],\n ['webm', 'video/webm'],\n ['webp', 'image/webp'],\n ['woff', 'font/woff'],\n ['woff2', 'font/woff2'],\n ['xhtml', 'application/xhtml+xml'],\n ['xls', 'application/vnd.ms-excel'],\n ['xlsx', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'],\n ['xml', 'application/xml'],\n ['xul', 'application/vnd.mozilla.xul+xml'],\n ['zip', 'application/zip'],\n ['7z', 'application/x-7z-compressed'],\n\n // Others\n ['mkv', 'video/x-matroska'],\n ['mov', 'video/quicktime'],\n ['msg', 'application/vnd.ms-outlook']\n]);\n\nconst FILES_TO_IGNORE = [\n // Thumbnail cache files for macOS and Windows\n '.DS_Store', // macOs\n 'Thumbs.db' // Windows\n];\n\n/**\n * Adds a `type` property to the file object if it doesn't have one and the file has an extension.\n * This is needed because Firefox doesn't add a type property to files dragged from the desktop.\n * @bug https://bugzilla.mozilla.org/show_bug.cgi?id=1424689\n *\n * @param {File} file - The file object to add the type property to.\n * @returns {File} - The file object with the type property added.\n */\nconst toFileWithMimeType = file => {\n const { name } = file;\n const hasExtension = name && name.lastIndexOf('.') !== -1;\n\n if (hasExtension && !file.type) {\n const extension = (name.split('.').pop() || '').toLowerCase();\n const type = COMMON_MIME_TYPES.get(extension);\n\n if (type) {\n Object.defineProperty(file, 'type', {\n value: type,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n }\n\n return file;\n};\n\n/**\n * Adds a `path` property to the file object if it doesn't have one.\n * If `path` is not provided, the `webkitRelativePath` property of the file will be used\n * or the file's name if `webkitRelativePath` is not available.\n *\n * @param {File} file - The file object to add the path property to.\n * @param {string} [path] - The path to set on the file object.\n * @returns {File} - The file object with the path property added.\n */\nconst toFileWithPath = (file, path) => {\n const fileWithMimeType = toFileWithMimeType(file);\n\n // @ts-ignore\n if (typeof fileWithMimeType.path !== 'string') {\n const { webkitRelativePath } = file;\n\n Object.defineProperty(fileWithMimeType, 'path', {\n value: typeof path === 'string' ? path : webkitRelativePath || file.name,\n writable: false,\n configurable: false,\n enumerable: true\n });\n }\n\n return fileWithMimeType;\n};\n\n/**\n * Wrap `FileSystemDirectoryReader.readEntries` in a promise to make working with read entries easier.\n * https://developer.mozilla.org/docs/Web/API/FileSystemDirectoryReader/readEntries\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readEntriesPromise = async directoryReader => {\n return await new Promise((resolve, reject) => {\n directoryReader.readEntries(resolve, reject);\n });\n};\n\n/**\n * Read all entries in a directory or sub-directory\n * by calling `readEntries` until it returns an empty array.\n *\n * @param {FileSystemDirectoryReader} directoryReader - The directory reader to read entries from.\n * @returns {Promise} - A promise that resolves with an array of `FileSystemEntry` objects.\n */\nconst readAllDirectoryEntries = async directoryReader => {\n const entries = [];\n let readEntries = await readEntriesPromise(directoryReader);\n\n while (readEntries.length > 0) {\n entries.push(...readEntries);\n readEntries = await readEntriesPromise(directoryReader);\n }\n\n return entries;\n};\n\n/**\n * Get a `File` object from a `FileSystemFileEntry` object.\n *\n * @param {FileSystemFileEntry} fileEntry - The file entry to get a `File` object from.\n * @returns {Promise} - A promise that resolves with a `File` object.\n */\nconst getFileFromFileEntry = fileEntry => {\n return new Promise((resolve, reject) => {\n fileEntry.file(file => resolve(toFileWithPath(file, fileEntry.fullPath)), reject);\n });\n};\n\n/**\n * Get an array of `File` objects from a `DataTransferItemList` object.\n *\n * @param {DataTransferItemList} dataTransferItemList - The item list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromDataTransferItemList = async dataTransferItemList => {\n const files = [];\n\n // Chromium browsers read only 100 files at a time as per the spec, so we need to use\n // BFS (Breadth-first search) to traverse the entire directory/file structure.\n // https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#javascript_content\n const queue = [];\n\n for (const item of dataTransferItemList) {\n if (item.kind !== 'file') {\n // Ignore non-file items, such as links.\n continue;\n }\n\n // https://developer.mozilla.org/docs/Web/API/DataTransferItem/webkitGetAsEntry\n // This function is implemented as `webkitGetAsEntry()` in non-WebKit browsers\n // including Firefox at this time but it may be renamed to `getAsEntry()` in the future.\n // @ts-ignore\n const entry = item.getAsEntry ? item.getAsEntry() : item.webkitGetAsEntry();\n\n queue.push(entry);\n }\n\n while (queue.length > 0) {\n const entry = queue.shift();\n\n if (!entry) {\n continue;\n } else if (entry.isFile) {\n const file = await getFileFromFileEntry(entry);\n\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(file);\n }\n } else if (entry.isDirectory) {\n queue.push(...await readAllDirectoryEntries(entry.createReader()));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from a `FileList` object.\n *\n * @param {FileList} fileList - The file list to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nconst getFilesFromFileList = async fileList => {\n const files = [];\n\n for (const file of fileList) {\n if (FILES_TO_IGNORE.indexOf(file.name) === -1) {\n files.push(toFileWithPath(file));\n }\n }\n\n return files;\n};\n\n/**\n * Get an array of `File` objects from an event.\n * This function supports both `drop` and `change` events.\n *\n * @param {*} evt - The event to get an array of `File` objects from.\n * @returns {Promise} - A promise that resolves with an array of `File` objects.\n */\nexport const getFilesFromEvent = async evt => {\n if (evt.dataTransfer) {\n return evt.dataTransfer.items\n ? await getFilesFromDataTransferItemList(evt.dataTransfer.items)\n : await getFilesFromFileList(evt.dataTransfer.files);\n }\n\n return await getFilesFromFileList(evt.target.files);\n};\n","/**\n * Removes one or more elements from an array at the specified index(es).\n *\n * @param {Array} array The initial array to remove elements from.\n * @param {Number} ...indexes The index(es) of the elements to be removed. Non numbers are ignored.\n * @throws {TypeError} If `array` is not array.\n * @returns {Array} The result array with the elements specified removed.\n * @example\n *\n * const arr = [1, 2, 3, 4, 5];\n *\n * remove(arr, 0);\n * // => [2, 3, 4, 5]\n *\n * remove(arr, 0, 1);\n * // => [3, 4, 5]\n *\n * remove(arr, 0, 4);\n * // => [2, 3, 4]\n *\n * remove(arr);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length);\n * // => [1, 2, 3, 4, 5]\n *\n * remove(arr, arr.length - 1);\n * // => [1, 2, 3, 4]\n *\n * remove(arr, NaN);\n * // => [1, 2, 3, 4, 5]\n */\nexport const arrayRemove = (array, ...indexes) => {\n if (!Array.isArray(array)) {\n throw new TypeError('Expected an array for first argument');\n }\n\n return array.filter((_, i) => indexes.indexOf(i) === -1);\n};\n","/**\n * Generates a unique id of the form `${prefix}-${randomString}-${suffix}`.\n *\n * @param {string} [prefix=''] - The prefix to use for the id.\n * @param {string} [suffix=''] - The suffix to use for the id.\n * @returns {string} - The unique id.\n */\nconst uid = (prefix = '', suffix = '') => {\n const prefixString = typeof prefix === 'string' && prefix !== '' ? prefix + '-' : '';\n const suffixString = typeof suffix === 'string' && suffix !== '' ? '-' + suffix : '';\n const randomString = Math.random().toString(36).substring(2, 8); // Pseudo-random string of six alphanumeric characters.\n\n return `${prefixString}${randomString}${suffixString}`;\n};\n\nexport { uid };\n","export const ACCEPTED_MIME_TYPES = ['image/jpg', 'image/jpeg', 'image/png', 'image/apng', 'image/gif', 'image/webp', 'image/avif'];\n","import AntonRegular from 'url:../assets/fonts/Anton/Anton-Regular.ttf';\nimport OswaldRegular from 'url:../assets/fonts/Oswald/Oswald-Regular.ttf';\nimport OswaldBold from 'url:../assets/fonts/Oswald/Oswald-Bold.ttf';\nimport RobotoRegular from 'url:../assets/fonts/Roboto/Roboto-Regular.ttf';\nimport RobotoBold from 'url:../assets/fonts/Roboto/Roboto-Bold.ttf';\nimport RobotoCondensedRegular from 'url:../assets/fonts/RobotoCondensed/RobotoCondensed-Regular.ttf';\nimport RobotoCondensedBold from 'url:../assets/fonts/RobotoCondensed/RobotoCondensed-Bold.ttf';\nimport CourierPrimeRegular from 'url:../assets/fonts/CourierPrime/CourierPrime-Regular.ttf';\nimport CourierPrimeBold from 'url:../assets/fonts/CourierPrime/CourierPrime-Bold.ttf';\nimport OpenSansRegular from 'url:../assets/fonts/OpenSans/OpenSans-Regular.ttf';\nimport OpenSansBold from 'url:../assets/fonts/OpenSans/OpenSans-Bold.ttf';\n\nexport const customFonts = [\n { name: 'Anton', label: 'Anton', path: AntonRegular, style: 'normal', weight: '400' },\n { name: 'Oswald-Regular', label: 'Oswald', path: OswaldRegular, style: 'normal', weight: '400' },\n { name: 'Oswald-Bold', label: 'Oswald Bold', path: OswaldBold, style: 'normal', weight: '700' },\n { name: 'Roboto-Regular', label: 'Roboto', path: RobotoRegular, style: 'normal', weight: '400' },\n { name: 'Roboto-Bold', label: 'Roboto Bold', path: RobotoBold, style: 'normal', weight: '700' },\n { name: 'RobotoCondensed-Regular', label: 'Roboto Condensed', path: RobotoCondensedRegular, style: 'normal', weight: '400' },\n { name: 'RobotoCondensed-Bold', label: 'Roboto Condensed Bold', path: RobotoCondensedBold, style: 'normal', weight: '700' },\n { name: 'CourierPrime-Regular', label: 'Courier Prime', path: CourierPrimeRegular, style: 'normal', weight: '400' },\n { name: 'CourierPrime-Bold', label: 'Courier Prime Bold', path: CourierPrimeBold, style: 'normal', weight: '700' },\n { name: 'OpenSans-Regular', label: 'Open Sans', path: OpenSansRegular, style: 'normal', weight: '400' },\n { name: 'OpenSans-Bold', label: 'Open Sans Bold', path: OpenSansBold, style: 'normal', weight: '400' }\n];\n\nexport const loadCustomFont = async (name, path, options = {}) => {\n try {\n const font = new FontFace(name, `url(${path})`, { ...options });\n await font.load();\n document.fonts.add(font);\n } catch (err) {\n console.error(err);\n }\n};\n","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"Anton-Regular.e58ab3fe.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"Oswald-Regular.89ec7d89.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"Oswald-Bold.0f6a7ca6.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"Roboto-Regular.ca197847.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"Roboto-Bold.fdb9b54a.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"RobotoCondensed-Regular.d585f5c7.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"RobotoCondensed-Bold.e1f96d4b.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"CourierPrime-Regular.3a25a501.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"CourierPrime-Bold.3d6bf689.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"OpenSans-Regular.edf9e01b.ttf\";","module.exports = require('./helpers/bundle-url').getBundleURL('8tAhj') + \"OpenSans-Bold.8fceb72b.ttf\";","import { ACCEPTED_MIME_TYPES } from './constants.js';\n\nexport const fileFromUrl = async (options = {}) => {\n const res = await fetch(options.url);\n const blob = await res.blob();\n const mimeType = options.mimeType || blob.type || '';\n\n if (!ACCEPTED_MIME_TYPES.includes(mimeType)) {\n throw new Error(`This is not an accepted image format. Accepted MIME types are: ${ACCEPTED_MIME_TYPES.join(', ')}`);\n }\n\n return new File([blob], options.filename || '', blob);\n};\n","const errorsContainer = document.getElementById('errorsContainer');\n\nconst hideError = evt => {\n const target = evt.currentTarget;\n target.removeEventListener('click', hideError);\n errorsContainer.removeChild(target.parentNode);\n};\n\nexport const toastAlert = (message = '', type = 'info') => {\n const types = ['info', 'warning', 'danger'];\n\n if (!types.includes(type)) {\n type = 'info';\n }\n\n const template = /* html */`\n ${message}\n \n `;\n\n const div = document.createElement('div');\n div.className = `alert alert-${type} alert-dismissible text-break mb-2 fade`;\n div.innerHTML = template;\n div.querySelector('button').addEventListener('click', hideError);\n errorsContainer.appendChild(div);\n setTimeout(() => div.classList.add('show'), 100);\n};\n","import { customFonts } from './custom-fonts.js';\n\nexport const createTextBox = (index, data = {}) => {\n const inputTemplate = /* html */`\n
\n \n\n \n\n
\n \n \n \n
\n
\n\n
\n
\n
\n \n\n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n \n \n
\n
\n\n
\n
\n \n \n
\n\n
\n \n \n
\n\n
\n
\n \n \n \n \n
\n
\n
\n\n
\n
\n
\n \n \n
\n
\n
\n
\n `;\n\n const fragment = document.createDocumentFragment();\n const div = document.createElement('div');\n\n div.className = 'bg-light border shadow-sm mb-3 rounded';\n div.setAttribute('data-section', 'textBox');\n div.setAttribute('data-index', index);\n div.innerHTML = inputTemplate;\n div.querySelector('[data-input=\"font\"]').value = data.font;\n div.querySelector('[data-input=\"textAlign\"]').value = data.textAlign;\n div.querySelector('[data-input=\"allCaps\"]').checked = data.allCaps;\n\n return fragment.appendChild(div);\n};\n","export const drawCanvas = (image, canvas, ctx, textOptions = []) => {\n if (image == null) {\n return;\n }\n\n ctx.clearRect(0, 0, canvas.width, canvas.height);\n\n if (typeof image === 'string') { // Assume it's a color\n ctx.fillStyle = image;\n ctx.fillRect(0, 0, canvas.width, canvas.height);\n } else {\n ctx.drawImage(image, 0, 0, canvas.width, canvas.height);\n }\n\n textOptions.forEach(function (item, index) {\n ctx.font = `${item.fontWeight} ${item.fontSize}px ${item.font}`;\n\n const multiplier = index + 1;\n const lineHeight = ctx.measureText('M').width + item.fontSize / 2;\n const xPos = canvas.width / 2;\n const shadowBlur = item.shadowBlur;\n const text = item.allCaps === true ? item.text.toUpperCase() : item.text;\n const textLines = text.split('\\n');\n\n ctx.fillStyle = item.fillColor;\n ctx.textAlign = item.textAlign;\n ctx.save();\n\n if (shadowBlur !== 0) {\n ctx.shadowOffsetX = 0;\n ctx.shadowOffsetY = 0;\n ctx.shadowBlur = shadowBlur;\n ctx.shadowColor = item.shadowColor;\n }\n\n if (item.rotate) {\n ctx.translate(xPos + item.offsetX, lineHeight * multiplier + item.offsetY);\n ctx.rotate(item.rotate * Math.PI / 180);\n textLines.forEach((text, index) => ctx.fillText(text, 0, index * lineHeight));\n ctx.rotate(-(item.rotate * Math.PI / 180));\n ctx.translate(-(xPos + item.offsetX), -(lineHeight * multiplier + item.offsetY));\n } else {\n textLines.forEach((text, index) => {\n ctx.fillText(text, xPos + item.offsetX, index * lineHeight + lineHeight * multiplier + item.offsetY);\n });\n }\n\n ctx.restore();\n });\n};"],"names":["$parcel$export","e","n","v","s","Object","defineProperty","get","set","enumerable","configurable","$parcel$interopDefault","a","__esModule","default","$parcel$global","globalThis","self","window","global","$parcel$modules","$parcel$inits","parcelRequire","id","exports","init","module","call","err","Error","code","register","parcelRegister","$94933cc6427541bd$export$c37129e465f64ef0","navigator","canShare","$0380ce8f1f064ccc$export$6503ec6e8aabbaf","$0380ce8f1f064ccc$var$mapping","Map","baseUrl","manifest","i","length","path","$7dd1ddf6834435ca$export$bdfd709ae4826697","$7dd1ddf6834435ca$var$bundleURL","value","$7dd1ddf6834435ca$var$getBundleURL","matches","stack","match","replace","getBundleURL","JSON","parse","$4f74a8126e204146$export$30b344bef3e55b67","$4f74a8126e204146$var$t","$4f74a8126e204146$var$e","document","createElement","innerHTML","HTMLElement","t","constructor","shadowRoot","attachShadow","mode","delegatesFocus","appendChild","content","cloneNode","querySelector","observedAttributes","attributeChangedCallback","toggleAttribute","disabled","setAttribute","toString","part","contains","toggle","connectedCallback","r","addEventListener","disconnectedCallback","removeEventListener","hasAttribute","shareUrl","getAttribute","shareTitle","shareText","shareFiles","Array","isArray","share","url","title","text","files","dispatchEvent","CustomEvent","bubbles","composed","detail","shareData","name","error","preventDefault","target","nodeName","assignedElements","flatten","find","prototype","hasOwnProperty","defineCustomElement","customElements","define","$636b0cf1ed0b9f88$export$cc30a98fe3890794","$636b0cf1ed0b9f88$var$t","Number","isNaN","Math","min","max","$636b0cf1ed0b9f88$var$e","$636b0cf1ed0b9f88$var$i","$636b0cf1ed0b9f88$var$o","o","l","getSupportedConstraints","isConnected","getTrackCapabilities","getTrackSettings","u","includes","facingMode","stopVideoStream","startVideoStream","cameraResolution","trim","split","map","width","height","pan","h","tilt","zoom","d","getElementById","c","m","p","g","b","f","isSupported","message","autoPlay","noImage","loading","calculateFileSize","capture","play","then","video","catch","finally","removeAttribute","from","childNodes","forEach","remove","getVideoTracks","applyConstraints","advanced","ideal","audio","mediaDevices","getUserMedia","srcObject","hidden","stop","getContext","videoWidth","videoHeight","drawImage","toDataURL","Image","src","dataURI","fetch","blob","size","getCapabilities","getSettings","$4da30046ce6d9325$export$32589115725b904b","$4da30046ce6d9325$var$e","open","showModal","body","style","overflowY","element","close","noHeader","classList","noAnimations","noCloseButton","clearTimeout","staticBackdrop","fullscreen","add","setTimeout","defaultPrevented","currentTarget","assignedNodes","cancelable","reason","show","hide","$7aad62ebc3d6fae8$export$6ccd1735166caad9","$7aad62ebc3d6fae8$var$e","$7aad62ebc3d6fae8$var$t","$7aad62ebc3d6fae8$var$o","lastIndexOf","type","pop","toLowerCase","writable","$7aad62ebc3d6fae8$var$i","webkitRelativePath","$7aad62ebc3d6fae8$var$r","Promise","readEntries","$7aad62ebc3d6fae8$var$a","push","$7aad62ebc3d6fae8$var$n","file","fullPath","$7aad62ebc3d6fae8$var$s","kind","getAsEntry","webkitGetAsEntry","shift","isFile","indexOf","isDirectory","createReader","$7aad62ebc3d6fae8$var$d","$7aad62ebc3d6fae8$var$l","dataTransfer","items","$7aad62ebc3d6fae8$var$p","$7aad62ebc3d6fae8$var$c","$7aad62ebc3d6fae8$var$h","$7aad62ebc3d6fae8$var$u","accept","multiple","noKeyboard","autoFocus","focus","maxFiles","floor","abs","maxSize","minSize","noClick","noDrag","noStyle","Event","dropEffect","click","key","errors","Set","filter","Boolean","charAt","test","acceptedFiles","rejectedFiles","defaultValue","openFileDialog","$5742c9e143620cb1$export$30a014203d0d7e4f","array","indexes","TypeError","_","$21c3f3a8dccfa4fd$export$e2a22331486dcca0","prefix","suffix","randomString","random","substring","$33dea9d9a6da4c9a$export$63e7bed68b07a85c","$b9a1dffffdf320f2$exports","$6f8f0ad93b4f4fec$exports","$60f12aeb358e1d01$exports","$b312cc3e2ac443c7$exports","$481315e8ee95f8f9$exports","$7cee0a691e2711a6$exports","$12b7043e62e67366$exports","$f224edc54658ebde$exports","$33ce2f42587a9c55$exports","$1375393a097acb0e$exports","$728f6ce83c7b6e27$exports","$055531bbd0af154c$export$6874249d87f2602a","label","weight","$055531bbd0af154c$export$59eceaef0c7797b2","options","font","FontFace","load","fonts","console","$008970865eefc93d$export$6539e087749cf9d3","res","mimeType","join","File","filename","$166cfb2484b08c80$var$errorsContainer","$166cfb2484b08c80$var$hideError","evt","removeChild","parentNode","$166cfb2484b08c80$export$af04143326425dbd","types","template","div","className","$50a37fdc18d479c2$export$293a4b86a6fe2398","index","data","inputTemplate","fillColor","shadowColor","_isSettingsOpen","fontSize","shadowBlur","rotate","offsetY","offsetX","fragment","createDocumentFragment","textAlign","checked","allCaps","$d346fdc99aed49b3$export$e653a2de0f3a8b89","image","canvas","ctx","textOptions","clearRect","fillStyle","fillRect","item","fontWeight","multiplier","lineHeight","measureText","xPos","textLines","toUpperCase","save","shadowOffsetX","shadowOffsetY","translate","PI","fillText","restore","$44ae6d9db4eaca0f$var$videoModal","$44ae6d9db4eaca0f$var$downloadModal","$44ae6d9db4eaca0f$var$canvas","$44ae6d9db4eaca0f$var$dropzoneEl","$44ae6d9db4eaca0f$var$instructionsEl","$44ae6d9db4eaca0f$var$ctx","$44ae6d9db4eaca0f$var$imageUploadMethodSelect","$44ae6d9db4eaca0f$var$fileSelectBtn","$44ae6d9db4eaca0f$var$imageUrlForm","$44ae6d9db4eaca0f$var$addTextboxBtn","$44ae6d9db4eaca0f$var$inputsContainer","$44ae6d9db4eaca0f$var$generateMemeBtn","$44ae6d9db4eaca0f$var$openVideoModalBtn","$44ae6d9db4eaca0f$var$downloadMemeBtn","$44ae6d9db4eaca0f$var$downloadMemePreview","$44ae6d9db4eaca0f$var$webShareComponent","$44ae6d9db4eaca0f$var$galleryEl","$44ae6d9db4eaca0f$var$gallerySearchEl","$44ae6d9db4eaca0f$var$galleryNoResultsEl","$44ae6d9db4eaca0f$var$solidColorForm","$44ae6d9db4eaca0f$var$uploadMethodEls","querySelectorAll","$44ae6d9db4eaca0f$var$selectedImage","$44ae6d9db4eaca0f$var$reqAnimFrame","$44ae6d9db4eaca0f$var$defaultTextOptions","$44ae6d9db4eaca0f$var$textOptions","$44ae6d9db4eaca0f$var$generateMeme","dataUrl","downloadLink","download","href","$44ae6d9db4eaca0f$var$onImageLoaded","MAX_WIDTH","MAX_HEIGHT","$44ae6d9db4eaca0f$var$handleFileSelect","reader","FileReader","result","readAsDataURL","$44ae6d9db4eaca0f$var$handleTextPropChange","prop","$44ae6d9db4eaca0f$var$handleImageUploadFromURL","form","submitButton","imageUrl","$44ae6d9db4eaca0f$var$moveText","offsetDir","sign","textBoxSection","offsetYInput","offsetXInput","requestAnimationFrame","$44ae6d9db4eaca0f$var$handleGalleryClick","button","closest","img","alt","newTextBox","textBoxIndex","textBoxEls","el","settingsEl","confirm","isOffsetYButton","isOffsetXButton","cancelAnimationFrame","query","galleryItems","capturePhotoComponent","$442be162a818aed4$export$c37129e465f64ef0","isWebShareSupported","$e179325634270afd$export$30b344bef3e55b67","$e179325634270afd$var$styles","$e179325634270afd$var$template","buttonSlot","buttonEl","getButton","oldValue","newValue","upgradeProperty","handleSlotChange","handleClick","instance","elementName","WebShare","$c290816263f90981$export$cc30a98fe3890794","$02ad8beec419df62$export$7d15b64cf5a3a4c4","lower","upper","$c290816263f90981$var$COMPONENT_NAME","$c290816263f90981$var$styles","$c290816263f90981$var$template","supportedConstraints","stream","canvasElement","outputElement","videoElement","captureButtonSlot","captureButton","facingModeButtonSlot","facingModeButton","trackCapabilities","trackSettings","emptyOutputElement","isValidFacingMode","x","widthInAllowedRange","heightInAllowedRange","panInAllowedRange","applyPTZ","tiltInAllowedRange","zoomInAllowedRange","getCaptureButton","getFacingModeButton","onVideoLoadedMetaData","onCaptureButtonSlotChange","onCapturePhotoButtonClick","onFacingModeButtonSlotChange","onFacingModeButtonClick","node","constraintName","constraintValue","track","constraints","eventDetail","CapturePhoto","$180b6dcf923bafc7$export$32589115725b904b","$180b6dcf923bafc7$var$template","dialogEl","footerSlotEl","pulseAnimationTimeout","headerEl","closeBtnEl","handleDialogClick","handleDialogClose","handleDialogCancel","handleCloseButtonClick","handleFooterSlotChange","applyPulseEffectOnDialog","requestCloseEvent","createRequestCloseEvent","footerEl","footerSlotNodes","hasFooterSlotNodes","ModalElement","$862aa3736b0514bc$export$6ccd1735166caad9","$f31161edf38949e9$var$COMMON_MIME_TYPES","$f31161edf38949e9$var$FILES_TO_IGNORE","$f31161edf38949e9$var$toFileWithMimeType","hasExtension","extension","$f31161edf38949e9$var$toFileWithPath","fileWithMimeType","$f31161edf38949e9$var$readEntriesPromise","directoryReader","resolve","reject","$f31161edf38949e9$var$readAllDirectoryEntries","entries","$f31161edf38949e9$var$getFileFromFileEntry","fileEntry","$f31161edf38949e9$var$getFilesFromDataTransferItemList","dataTransferItemList","queue","entry","$f31161edf38949e9$var$getFilesFromFileList","fileList","$f31161edf38949e9$export$6d52664cd15c442","$862aa3736b0514bc$var$COMPONENT_NAME","$862aa3736b0514bc$var$TOO_MANY_FILES","$862aa3736b0514bc$var$template","$862aa3736b0514bc$var$styles","fileInput","dropzoneEl","handleFileInputChange","handleDragEnter","handleDragOver","handleDragLeave","handleDrop","handleKeyUp","num","Infinity","handleFilesSelect","filesLength","fileHasValidType","acceptedTypeSpecifiers","acceptedMimeTypesList","fileMimeType","baseMimeType","validType","fileExceedsMaxSize","fileIsSmallerThanMinSize","FilesDropzone"],"version":3,"file":"index.bc158aed.js.map"} \ No newline at end of file diff --git a/docs/index.html b/docs/index.html index 170c8ad..83e75fa 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1 +1 @@ -Meme Generator
add image icon

Drag & Drop an image here or click to select an image from your device.

All uploaded images are processed locally in your browser. No data is sent to any server.

Image selection options
Text options
Licensed under The MIT License (MIT)
Capture image
Download Meme
meme preview
\ No newline at end of file +Meme Generator
add image icon

Drag & Drop an image here or click to select an image from your device.

All uploaded images are processed locally in your browser. No data is sent to any server.

Image selection options
Text options
Licensed under The MIT License (MIT)
Capture image
Download Meme
meme preview
\ No newline at end of file diff --git a/docs/service-worker.js b/docs/service-worker.js index 6c12eee..0530de9 100644 --- a/docs/service-worker.js +++ b/docs/service-worker.js @@ -1,2 +1,2 @@ -if(!self.define){let e,a={};const d=(d,i)=>(d=new URL(d+".js",i).href,a[d]||new Promise((a=>{if("document"in self){const e=document.createElement("script");e.src=d,e.onload=a,document.head.appendChild(e)}else e=d,importScripts(d),a()})).then((()=>{let e=a[d];if(!e)throw new Error(`Module ${d} didn’t register its module`);return e})));self.define=(i,f)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(a[r])return;let b={};const c=e=>d(e,r),n={module:{uri:r},exports:b,require:c};a[r]=Promise.all(i.map((e=>n[e]||c(e)))).then((e=>(f(...e),b)))}}define(["./workbox-1c3383c2"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"180.ad1ffa6f.png",revision:"e500d9d7377de6d701630c6345a20b99"},{url:"192.02439c4c.png",revision:"799182a75ab5b10e8b2088a717f0eff2"},{url:"384.3d08a4a6.png",revision:"3eb04d3a80b60e082d7f79e1614070fe"},{url:"512.00f88ae0.png",revision:"511ad055b1865aa9bda7886cb0b9e336"},{url:"add-image.bd815785.svg",revision:"8c00e51567cbd039981fffb87c61dab1"},{url:"always-has-been.08a66422.jpg",revision:"d1b6401abd9cb8d382b7246bdb8ce0b5"},{url:"anakin-padme.03c6b194.jpg",revision:"baa00e8faccb9c63073f1db59274bd0d"},{url:"Anton-Regular.e58ab3fe.ttf",revision:"055c4df4e2f8c7a4d4675cdd8fa68da0"},{url:"aperture.4bf28ce8.svg",revision:"1a6a5d3b06ba8aaa3e96658810752663"},{url:"bad-luck-brian.8b018588.jpg",revision:"2bb70408a0ab18038a376d80da91d336"},{url:"batman-slapping-robin.aa8b8054.jpg",revision:"6695faabd1eb772936f31ff0af36111d"},{url:"bell-curve.1167fe19.jpg",revision:"e26dac38583f6f98ea8ef98e4dab71e1"},{url:"ben-affleck-smoking.17cc6114.jpg",revision:"512c246cb818579340a6dc8dddea4f87"},{url:"camera-reverse.284e8ac9.svg",revision:"86e592b72bb2472bbacd0c823b3a3c78"},{url:"camera.ed7aa43f.svg",revision:"46f0c02466282ec5c4bf26141624316e"},{url:"captain-picard-facepalm.7690614a.jpg",revision:"926eecb6292d72fe2f99fd3113444c0b"},{url:"car-drift.9255750c.jpg",revision:"55b3735095d73c764704bccdda6f2bc1"},{url:"change-my-mind.b49b92c2.jpg",revision:"35e498b8b3c3b62e485ce4ffbe4cdfd1"},{url:"chevron-down.ad14d981.svg",revision:"5635cc35f04030576a62d2d649824495"},{url:"chevron-left.20a2f252.svg",revision:"a8334bfa7ef65b1095bfd54557d69beb"},{url:"chevron-right.1be074ac.svg",revision:"3d72992183afc0c2f0b6bf010dadc2a1"},{url:"chevron-up.f532d8b6.svg",revision:"e1bd8bbacf48b185c4b3deb18b9e0f2d"},{url:"CourierPrime-Bold.3d6bf689.ttf",revision:"4acfa45d29d240044e0075a8e58f0862"},{url:"CourierPrime-Regular.3a25a501.ttf",revision:"fba4686ed1d1b4ef05ab14db78805dbe"},{url:"disaster-girl.536b1af4.jpg",revision:"07542c2e7ea315f6a7b7311d2a88d074"},{url:"distracted-boyfriend.22708891.jpg",revision:"4ee61cd7c20689e2c8b7fa2dbffbdbc4"},{url:"drake-hotline-bling.99013af7.jpg",revision:"edce37df305e1b9c78d0a41ade363e29"},{url:"drowning-kid-in-the-pool.37435682.jpg",revision:"99e976a664709f7fe0b7141e2661a42b"},{url:"favicon-192.02439c4c.png",revision:"799182a75ab5b10e8b2088a717f0eff2"},{url:"finding-neverland.25f9c4f0.jpg",revision:"4557c9d30b0e3114953f9cc8e981c622"},{url:"gear.b3b5d1a5.svg",revision:"5e0b2045d7dc4768b1ceb199d83ab6f0"},{url:"gibson-jesus.1224d195.jpg",revision:"b26e0d89414371dfbf7a1e1bbada7e15"},{url:"girls-gossiping.da75b154.jpg",revision:"97f0d159d65349dfdd821f6294d8b177"},{url:"greta-thunberg-how-dare-you.ddceea0b.jpg",revision:"dbe7e341b66c0e71da9db2f49eddbd9c"},{url:"grinning-girl.9a1a3b6a.jpg",revision:"133c4124813f1dfeff00a9e0a735b5c3"},{url:"group-therapy.c82c3502.jpg",revision:"a79a27311d3969bf370b8846bea1789c"},{url:"hack-the-planet.29b5550a.jpg",revision:"207de9c3f83de707d99ea7255f743fc1"},{url:"hide-the-pain-harold.dc41d0f5.jpg",revision:"af3a4d69c625740558a9adc66967797c"},{url:"i-bet-hes-thinking-about-other-women.c80f1ce0.jpg",revision:"df6904f1480a0210525311a594cd51b7"},{url:"i-dont-always.cd8fe191.jpg",revision:"6c0fa2f7428f252d177a52b34c93aacb"},{url:"i-see-dead-people.89330beb.jpg",revision:"16ff33b79a8ce266b890d2f2e53fdbc1"},{url:"index.2a3e2367.js",revision:"98425f95ed93443bbc77856ae9bb12c2"},{url:"index.2a3e2367.js.map",revision:"0763b5a209ca923de1e22bb701fe9e4e"},{url:"index.2d751096.css",revision:"1d8c1a1683aefb80c6b66e1c26083268"},{url:"index.2d751096.css.map",revision:"5376065d735d84b64dfd306f44b89184"},{url:"index.6d051d2c.js",revision:"f858454bf705c242bab435d0af2c39f2"},{url:"index.6d051d2c.js.map",revision:"8abbc25e5cc2ea494570fbd440aad217"},{url:"index.89efe45b.js",revision:"6814a61841cd719f59765d1ee48ea09a"},{url:"index.89efe45b.js.map",revision:"c88920bec0571a6511e504850de79c03"},{url:"index.d44e81ec.js",revision:"b90a75d7c5128c18c30bf621d43c8122"},{url:"index.d44e81ec.js.map",revision:"4f7febc735b0a98935455f8329214edd"},{url:"index.html",revision:"8bd3e7e392189f72c3340d6a86f1354a"},{url:"jurassic-park-no-one-cares.4b16d8e3.jpg",revision:"5971adaaec085b176061d7d98577a089"},{url:"knight-with-arrow-in-helmet.70d7b8ea.jpg",revision:"2d51aa7ceccfacf6e1fae33cf5279abb"},{url:"laughing-leo.ff4cf9b5.png",revision:"ffd00816a11fb66f16d05a5a06506e3a"},{url:"leonardo-dicaprio-cheers.1f5072fc.jpg",revision:"0c9762d1044fde55cfccc6d3f8abfedb"},{url:"logo.02439c4c.png",revision:"799182a75ab5b10e8b2088a717f0eff2"},{url:"manifest.webmanifest",revision:"1e34d4d2fb0da2246a35db6beeace137"},{url:"matrix-morpheus.2a17fef0.jpg",revision:"4306d531845e95029b5219f178ce546c"},{url:"milk-girls.c67a099a.jpg",revision:"d2a3c2d80f01fb790a6557978920ec36"},{url:"monk-temptation.9fa9b52f.jpg",revision:"f993e88e46226fb560559b5c8392ba6e"},{url:"monkey_puppet.a1128702.jpg",revision:"e3dd1d281e372a02ca2955eb62ce7dbb"},{url:"nervous.ecca1da9.jpg",revision:"f9500924e2154f15ff3249573963e867"},{url:"obama-medal.da4528cd.jpg",revision:"0b7d29347fd9bdf850b46293c8870fd8"},{url:"office-congrats.f658c72e.jpg",revision:"5e5823dd68191151a2313a3ec158e9cf"},{url:"one-does-not-simply.bd73a129.jpg",revision:"94eaa0e921189e88fe35ba1954988564"},{url:"OpenSans-Bold.8fceb72b.ttf",revision:"8ff9b5735ccb338267f0034d83fe8214"},{url:"OpenSans-Regular.edf9e01b.ttf",revision:"22ab03a6b890f2f142a137a38bf1d4ae"},{url:"Oswald-Bold.0f6a7ca6.ttf",revision:"452bfeb5bf78e71cc3cd6e720ac24bd4"},{url:"Oswald-Regular.89ec7d89.ttf",revision:"a7ccbd3cd9a9ff21ec41086dcc23ebe6"},{url:"photo.0328c485.svg",revision:"6b3fccb8598a897d641cc1dc75ed3592"},{url:"plague-hackers.01c70709.jpg",revision:"70712ddea9f2dd86ec34c1ffedffb3d0"},{url:"Roboto-Bold.fdb9b54a.ttf",revision:"b8e42971dec8d49207a8c8e2b919a6ac"},{url:"Roboto-Regular.ca197847.ttf",revision:"8a36205bd9b83e03af0591a004bc97f4"},{url:"RobotoCondensed-Bold.e1f96d4b.ttf",revision:"e38804ae070b58fbf4fdd88fd6853929"},{url:"RobotoCondensed-Regular.d585f5c7.ttf",revision:"0134dd8fe6fe708de73909a71d842780"},{url:"sad-pablo-escobar.48ee550d.jpg",revision:"1a49f6decc10da3ee849a1f94132c794"},{url:"save.46fbf12f.svg",revision:"3e1d90c414fadfd6727cc77f150e79e5"},{url:"say-that-again-i-dare-you.0c8b53b9.jpg",revision:"948be03975e613eaa08ac7f284491b40"},{url:"screenshot.3fbaa9cf.png",revision:"9df64fac2f8267d4f7db45082d60b09c"},{url:"share.0fccb277.svg",revision:"19d01499fa1fe8707366653db087ebac"},{url:"shirley-temple-laugh.8125357d.png",revision:"c2e13fffe87a3a1ff91d5a955a280fe1"},{url:"sparta-leonidas.0b603b26.jpg",revision:"e9ba2efb8ff797d0a9adf13135927c82"},{url:"spinner.4452ed29.svg",revision:"609c6274c68c19f6badaf5488b6aeef2"},{url:"star-wars-yoda.c7579c93.jpg",revision:"951e4ee52db27001190248f449651c4b"},{url:"success-kid.5d6212f8.jpg",revision:"b58ffaf338ffc8f4f06ef45478365c13"},{url:"sweating-bullets.f3c2d84f.jpg",revision:"3c9c50281665c688cacdd0d1da8f8f7d"},{url:"tell-me-the-truth-I-am-ready-to-hear-it.34eb1bcc.png",revision:"ecd53156061e4fdabf386c5f802035cf"},{url:"think-about-it.f4fc185d.jpg",revision:"f70b62834ba3ec34a2c9f2a80a5068b9"},{url:"this-is-fine.db15aaeb.jpg",revision:"dac2b7e7d3b1f18c72e48373cb4275e1"},{url:"toilet_guy.812f73a4.jpg",revision:"3f488def302d190dca09eb12c878d228"},{url:"trash.d9edab78.svg",revision:"db8971c7dab936bbe799ede7c1b9ac4b"},{url:"two-buttons.a42b7a04.jpg",revision:"611756fac300eb0f010491cbd95dda28"},{url:"waiting-skeleton.26f2ec8f.jpg",revision:"0eef934549392da6aa193fb86f9a8ab2"},{url:"water-tank-leaking-fix.772173b9.png",revision:"3ebfc2b2c42be514ec35fd3b9948686a"},{url:"whisper-and-goosebumps.2bc61488.jpg",revision:"962ccff862d6c9d416a330c8be901be9"},{url:"x-x-everywhere.4732733a.jpg",revision:"ca16fab0846148556e776aec3ff00739"},{url:"you-guys-are-getting-paid.ba5678cc.png",revision:"feb2da8a1fae966adae92bd1f8318153"}],{})})); +if(!self.define){let e,a={};const d=(d,i)=>(d=new URL(d+".js",i).href,a[d]||new Promise((a=>{if("document"in self){const e=document.createElement("script");e.src=d,e.onload=a,document.head.appendChild(e)}else e=d,importScripts(d),a()})).then((()=>{let e=a[d];if(!e)throw new Error(`Module ${d} didn’t register its module`);return e})));self.define=(i,f)=>{const r=e||("document"in self?document.currentScript.src:"")||location.href;if(a[r])return;let b={};const c=e=>d(e,r),n={module:{uri:r},exports:b,require:c};a[r]=Promise.all(i.map((e=>n[e]||c(e)))).then((e=>(f(...e),b)))}}define(["./workbox-1c3383c2"],(function(e){"use strict";self.skipWaiting(),e.clientsClaim(),e.precacheAndRoute([{url:"180.ad1ffa6f.png",revision:"e500d9d7377de6d701630c6345a20b99"},{url:"192.02439c4c.png",revision:"799182a75ab5b10e8b2088a717f0eff2"},{url:"384.3d08a4a6.png",revision:"3eb04d3a80b60e082d7f79e1614070fe"},{url:"512.00f88ae0.png",revision:"511ad055b1865aa9bda7886cb0b9e336"},{url:"add-image.bd815785.svg",revision:"8c00e51567cbd039981fffb87c61dab1"},{url:"always-has-been.08a66422.jpg",revision:"d1b6401abd9cb8d382b7246bdb8ce0b5"},{url:"anakin-padme.03c6b194.jpg",revision:"baa00e8faccb9c63073f1db59274bd0d"},{url:"Anton-Regular.e58ab3fe.ttf",revision:"055c4df4e2f8c7a4d4675cdd8fa68da0"},{url:"aperture.4bf28ce8.svg",revision:"1a6a5d3b06ba8aaa3e96658810752663"},{url:"bad-luck-brian.8b018588.jpg",revision:"2bb70408a0ab18038a376d80da91d336"},{url:"batman-slapping-robin.aa8b8054.jpg",revision:"6695faabd1eb772936f31ff0af36111d"},{url:"bell-curve.1167fe19.jpg",revision:"e26dac38583f6f98ea8ef98e4dab71e1"},{url:"ben-affleck-smoking.17cc6114.jpg",revision:"512c246cb818579340a6dc8dddea4f87"},{url:"camera-reverse.284e8ac9.svg",revision:"86e592b72bb2472bbacd0c823b3a3c78"},{url:"camera.ed7aa43f.svg",revision:"46f0c02466282ec5c4bf26141624316e"},{url:"captain-picard-facepalm.7690614a.jpg",revision:"926eecb6292d72fe2f99fd3113444c0b"},{url:"car-drift.9255750c.jpg",revision:"55b3735095d73c764704bccdda6f2bc1"},{url:"change-my-mind.b49b92c2.jpg",revision:"35e498b8b3c3b62e485ce4ffbe4cdfd1"},{url:"chevron-down.ad14d981.svg",revision:"5635cc35f04030576a62d2d649824495"},{url:"chevron-left.20a2f252.svg",revision:"a8334bfa7ef65b1095bfd54557d69beb"},{url:"chevron-right.1be074ac.svg",revision:"3d72992183afc0c2f0b6bf010dadc2a1"},{url:"chevron-up.f532d8b6.svg",revision:"e1bd8bbacf48b185c4b3deb18b9e0f2d"},{url:"CourierPrime-Bold.3d6bf689.ttf",revision:"4acfa45d29d240044e0075a8e58f0862"},{url:"CourierPrime-Regular.3a25a501.ttf",revision:"fba4686ed1d1b4ef05ab14db78805dbe"},{url:"disaster-girl.536b1af4.jpg",revision:"07542c2e7ea315f6a7b7311d2a88d074"},{url:"distracted-boyfriend.22708891.jpg",revision:"4ee61cd7c20689e2c8b7fa2dbffbdbc4"},{url:"drake-hotline-bling.99013af7.jpg",revision:"edce37df305e1b9c78d0a41ade363e29"},{url:"drowning-kid-in-the-pool.37435682.jpg",revision:"99e976a664709f7fe0b7141e2661a42b"},{url:"favicon-192.02439c4c.png",revision:"799182a75ab5b10e8b2088a717f0eff2"},{url:"finding-neverland.25f9c4f0.jpg",revision:"4557c9d30b0e3114953f9cc8e981c622"},{url:"gear.b3b5d1a5.svg",revision:"5e0b2045d7dc4768b1ceb199d83ab6f0"},{url:"gibson-jesus.1224d195.jpg",revision:"b26e0d89414371dfbf7a1e1bbada7e15"},{url:"girls-gossiping.da75b154.jpg",revision:"97f0d159d65349dfdd821f6294d8b177"},{url:"greta-thunberg-how-dare-you.ddceea0b.jpg",revision:"dbe7e341b66c0e71da9db2f49eddbd9c"},{url:"grinning-girl.9a1a3b6a.jpg",revision:"133c4124813f1dfeff00a9e0a735b5c3"},{url:"group-therapy.c82c3502.jpg",revision:"a79a27311d3969bf370b8846bea1789c"},{url:"hack-the-planet.29b5550a.jpg",revision:"207de9c3f83de707d99ea7255f743fc1"},{url:"hide-the-pain-harold.dc41d0f5.jpg",revision:"af3a4d69c625740558a9adc66967797c"},{url:"i-bet-hes-thinking-about-other-women.c80f1ce0.jpg",revision:"df6904f1480a0210525311a594cd51b7"},{url:"i-dont-always.cd8fe191.jpg",revision:"6c0fa2f7428f252d177a52b34c93aacb"},{url:"i-see-dead-people.89330beb.jpg",revision:"16ff33b79a8ce266b890d2f2e53fdbc1"},{url:"index.0ec871bb.js",revision:"ee82720764a462f988bdd7d24f22e13a"},{url:"index.0ec871bb.js.map",revision:"1e83fed2f4852af9654792ddae6d9aba"},{url:"index.2d751096.css",revision:"1d8c1a1683aefb80c6b66e1c26083268"},{url:"index.2d751096.css.map",revision:"5376065d735d84b64dfd306f44b89184"},{url:"index.89efe45b.js",revision:"6814a61841cd719f59765d1ee48ea09a"},{url:"index.89efe45b.js.map",revision:"c88920bec0571a6511e504850de79c03"},{url:"index.bc158aed.js",revision:"2365edce2f35ba8f7f97af6ff1c71cef"},{url:"index.bc158aed.js.map",revision:"89a178de130b34f686b80b26a57a660a"},{url:"index.d44e81ec.js",revision:"b90a75d7c5128c18c30bf621d43c8122"},{url:"index.d44e81ec.js.map",revision:"4f7febc735b0a98935455f8329214edd"},{url:"index.html",revision:"2640cca834be9d42bad27748a7e5464f"},{url:"jurassic-park-no-one-cares.4b16d8e3.jpg",revision:"5971adaaec085b176061d7d98577a089"},{url:"knight-with-arrow-in-helmet.70d7b8ea.jpg",revision:"2d51aa7ceccfacf6e1fae33cf5279abb"},{url:"laughing-leo.ff4cf9b5.png",revision:"ffd00816a11fb66f16d05a5a06506e3a"},{url:"leonardo-dicaprio-cheers.1f5072fc.jpg",revision:"0c9762d1044fde55cfccc6d3f8abfedb"},{url:"logo.02439c4c.png",revision:"799182a75ab5b10e8b2088a717f0eff2"},{url:"manifest.webmanifest",revision:"1e34d4d2fb0da2246a35db6beeace137"},{url:"matrix-morpheus.2a17fef0.jpg",revision:"4306d531845e95029b5219f178ce546c"},{url:"milk-girls.c67a099a.jpg",revision:"d2a3c2d80f01fb790a6557978920ec36"},{url:"monk-temptation.9fa9b52f.jpg",revision:"f993e88e46226fb560559b5c8392ba6e"},{url:"monkey_puppet.a1128702.jpg",revision:"e3dd1d281e372a02ca2955eb62ce7dbb"},{url:"nervous.ecca1da9.jpg",revision:"f9500924e2154f15ff3249573963e867"},{url:"obama-medal.da4528cd.jpg",revision:"0b7d29347fd9bdf850b46293c8870fd8"},{url:"office-congrats.f658c72e.jpg",revision:"5e5823dd68191151a2313a3ec158e9cf"},{url:"one-does-not-simply.bd73a129.jpg",revision:"94eaa0e921189e88fe35ba1954988564"},{url:"OpenSans-Bold.8fceb72b.ttf",revision:"8ff9b5735ccb338267f0034d83fe8214"},{url:"OpenSans-Regular.edf9e01b.ttf",revision:"22ab03a6b890f2f142a137a38bf1d4ae"},{url:"Oswald-Bold.0f6a7ca6.ttf",revision:"452bfeb5bf78e71cc3cd6e720ac24bd4"},{url:"Oswald-Regular.89ec7d89.ttf",revision:"a7ccbd3cd9a9ff21ec41086dcc23ebe6"},{url:"photo.0328c485.svg",revision:"6b3fccb8598a897d641cc1dc75ed3592"},{url:"plague-hackers.01c70709.jpg",revision:"70712ddea9f2dd86ec34c1ffedffb3d0"},{url:"Roboto-Bold.fdb9b54a.ttf",revision:"b8e42971dec8d49207a8c8e2b919a6ac"},{url:"Roboto-Regular.ca197847.ttf",revision:"8a36205bd9b83e03af0591a004bc97f4"},{url:"RobotoCondensed-Bold.e1f96d4b.ttf",revision:"e38804ae070b58fbf4fdd88fd6853929"},{url:"RobotoCondensed-Regular.d585f5c7.ttf",revision:"0134dd8fe6fe708de73909a71d842780"},{url:"sad-pablo-escobar.48ee550d.jpg",revision:"1a49f6decc10da3ee849a1f94132c794"},{url:"save.46fbf12f.svg",revision:"3e1d90c414fadfd6727cc77f150e79e5"},{url:"say-that-again-i-dare-you.0c8b53b9.jpg",revision:"948be03975e613eaa08ac7f284491b40"},{url:"screenshot.3fbaa9cf.png",revision:"9df64fac2f8267d4f7db45082d60b09c"},{url:"share.0fccb277.svg",revision:"19d01499fa1fe8707366653db087ebac"},{url:"shirley-temple-laugh.8125357d.png",revision:"c2e13fffe87a3a1ff91d5a955a280fe1"},{url:"sparta-leonidas.0b603b26.jpg",revision:"e9ba2efb8ff797d0a9adf13135927c82"},{url:"spinner.4452ed29.svg",revision:"609c6274c68c19f6badaf5488b6aeef2"},{url:"star-wars-yoda.c7579c93.jpg",revision:"951e4ee52db27001190248f449651c4b"},{url:"success-kid.5d6212f8.jpg",revision:"b58ffaf338ffc8f4f06ef45478365c13"},{url:"sweating-bullets.f3c2d84f.jpg",revision:"3c9c50281665c688cacdd0d1da8f8f7d"},{url:"tell-me-the-truth-I-am-ready-to-hear-it.34eb1bcc.png",revision:"ecd53156061e4fdabf386c5f802035cf"},{url:"think-about-it.f4fc185d.jpg",revision:"f70b62834ba3ec34a2c9f2a80a5068b9"},{url:"this-is-fine.db15aaeb.jpg",revision:"dac2b7e7d3b1f18c72e48373cb4275e1"},{url:"toilet_guy.812f73a4.jpg",revision:"3f488def302d190dca09eb12c878d228"},{url:"trash.d9edab78.svg",revision:"db8971c7dab936bbe799ede7c1b9ac4b"},{url:"two-buttons.a42b7a04.jpg",revision:"611756fac300eb0f010491cbd95dda28"},{url:"waiting-skeleton.26f2ec8f.jpg",revision:"0eef934549392da6aa193fb86f9a8ab2"},{url:"water-tank-leaking-fix.772173b9.png",revision:"3ebfc2b2c42be514ec35fd3b9948686a"},{url:"whisper-and-goosebumps.2bc61488.jpg",revision:"962ccff862d6c9d416a330c8be901be9"},{url:"x-x-everywhere.4732733a.jpg",revision:"ca16fab0846148556e776aec3ff00739"},{url:"you-guys-are-getting-paid.ba5678cc.png",revision:"feb2da8a1fae966adae92bd1f8318153"}],{})})); //# sourceMappingURL=service-worker.js.map diff --git a/docs/service-worker.js.map b/docs/service-worker.js.map index 82e5039..47dbc68 100644 --- a/docs/service-worker.js.map +++ b/docs/service-worker.js.map @@ -1 +1 @@ -{"version":3,"file":"service-worker.js","sources":["../../../../../private/var/folders/vy/why3xmz53r57rfypb6dxq94c0000gp/T/387a71678df285ce0258c37aa2ecc163/service-worker.js"],"sourcesContent":["import {clientsClaim as workbox_core_clientsClaim} from '/Users/georgeraptis/Projects/@georapbox/meme-generator/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/georgeraptis/Projects/@georapbox/meme-generator/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"180.ad1ffa6f.png\",\n \"revision\": \"e500d9d7377de6d701630c6345a20b99\"\n },\n {\n \"url\": \"192.02439c4c.png\",\n \"revision\": \"799182a75ab5b10e8b2088a717f0eff2\"\n },\n {\n \"url\": \"384.3d08a4a6.png\",\n \"revision\": \"3eb04d3a80b60e082d7f79e1614070fe\"\n },\n {\n \"url\": \"512.00f88ae0.png\",\n \"revision\": \"511ad055b1865aa9bda7886cb0b9e336\"\n },\n {\n \"url\": \"add-image.bd815785.svg\",\n \"revision\": \"8c00e51567cbd039981fffb87c61dab1\"\n },\n {\n \"url\": \"always-has-been.08a66422.jpg\",\n \"revision\": \"d1b6401abd9cb8d382b7246bdb8ce0b5\"\n },\n {\n \"url\": \"anakin-padme.03c6b194.jpg\",\n \"revision\": \"baa00e8faccb9c63073f1db59274bd0d\"\n },\n {\n \"url\": \"Anton-Regular.e58ab3fe.ttf\",\n \"revision\": \"055c4df4e2f8c7a4d4675cdd8fa68da0\"\n },\n {\n \"url\": \"aperture.4bf28ce8.svg\",\n \"revision\": \"1a6a5d3b06ba8aaa3e96658810752663\"\n },\n {\n \"url\": \"bad-luck-brian.8b018588.jpg\",\n \"revision\": \"2bb70408a0ab18038a376d80da91d336\"\n },\n {\n \"url\": \"batman-slapping-robin.aa8b8054.jpg\",\n \"revision\": \"6695faabd1eb772936f31ff0af36111d\"\n },\n {\n \"url\": \"bell-curve.1167fe19.jpg\",\n \"revision\": \"e26dac38583f6f98ea8ef98e4dab71e1\"\n },\n {\n \"url\": \"ben-affleck-smoking.17cc6114.jpg\",\n \"revision\": \"512c246cb818579340a6dc8dddea4f87\"\n },\n {\n \"url\": \"camera-reverse.284e8ac9.svg\",\n \"revision\": \"86e592b72bb2472bbacd0c823b3a3c78\"\n },\n {\n \"url\": \"camera.ed7aa43f.svg\",\n \"revision\": \"46f0c02466282ec5c4bf26141624316e\"\n },\n {\n \"url\": \"captain-picard-facepalm.7690614a.jpg\",\n \"revision\": \"926eecb6292d72fe2f99fd3113444c0b\"\n },\n {\n \"url\": \"car-drift.9255750c.jpg\",\n \"revision\": \"55b3735095d73c764704bccdda6f2bc1\"\n },\n {\n \"url\": \"change-my-mind.b49b92c2.jpg\",\n \"revision\": \"35e498b8b3c3b62e485ce4ffbe4cdfd1\"\n },\n {\n \"url\": \"chevron-down.ad14d981.svg\",\n \"revision\": \"5635cc35f04030576a62d2d649824495\"\n },\n {\n \"url\": \"chevron-left.20a2f252.svg\",\n \"revision\": \"a8334bfa7ef65b1095bfd54557d69beb\"\n },\n {\n \"url\": \"chevron-right.1be074ac.svg\",\n \"revision\": \"3d72992183afc0c2f0b6bf010dadc2a1\"\n },\n {\n \"url\": \"chevron-up.f532d8b6.svg\",\n \"revision\": \"e1bd8bbacf48b185c4b3deb18b9e0f2d\"\n },\n {\n \"url\": \"CourierPrime-Bold.3d6bf689.ttf\",\n \"revision\": \"4acfa45d29d240044e0075a8e58f0862\"\n },\n {\n \"url\": \"CourierPrime-Regular.3a25a501.ttf\",\n \"revision\": \"fba4686ed1d1b4ef05ab14db78805dbe\"\n },\n {\n \"url\": \"disaster-girl.536b1af4.jpg\",\n \"revision\": \"07542c2e7ea315f6a7b7311d2a88d074\"\n },\n {\n \"url\": \"distracted-boyfriend.22708891.jpg\",\n \"revision\": \"4ee61cd7c20689e2c8b7fa2dbffbdbc4\"\n },\n {\n \"url\": \"drake-hotline-bling.99013af7.jpg\",\n \"revision\": \"edce37df305e1b9c78d0a41ade363e29\"\n },\n {\n \"url\": \"drowning-kid-in-the-pool.37435682.jpg\",\n \"revision\": \"99e976a664709f7fe0b7141e2661a42b\"\n },\n {\n \"url\": \"favicon-192.02439c4c.png\",\n \"revision\": \"799182a75ab5b10e8b2088a717f0eff2\"\n },\n {\n \"url\": \"finding-neverland.25f9c4f0.jpg\",\n \"revision\": \"4557c9d30b0e3114953f9cc8e981c622\"\n },\n {\n \"url\": \"gear.b3b5d1a5.svg\",\n \"revision\": \"5e0b2045d7dc4768b1ceb199d83ab6f0\"\n },\n {\n \"url\": \"gibson-jesus.1224d195.jpg\",\n \"revision\": \"b26e0d89414371dfbf7a1e1bbada7e15\"\n },\n {\n \"url\": \"girls-gossiping.da75b154.jpg\",\n \"revision\": \"97f0d159d65349dfdd821f6294d8b177\"\n },\n {\n \"url\": \"greta-thunberg-how-dare-you.ddceea0b.jpg\",\n \"revision\": \"dbe7e341b66c0e71da9db2f49eddbd9c\"\n },\n {\n \"url\": \"grinning-girl.9a1a3b6a.jpg\",\n \"revision\": \"133c4124813f1dfeff00a9e0a735b5c3\"\n },\n {\n \"url\": \"group-therapy.c82c3502.jpg\",\n \"revision\": \"a79a27311d3969bf370b8846bea1789c\"\n },\n {\n \"url\": \"hack-the-planet.29b5550a.jpg\",\n \"revision\": \"207de9c3f83de707d99ea7255f743fc1\"\n },\n {\n \"url\": \"hide-the-pain-harold.dc41d0f5.jpg\",\n \"revision\": \"af3a4d69c625740558a9adc66967797c\"\n },\n {\n \"url\": \"i-bet-hes-thinking-about-other-women.c80f1ce0.jpg\",\n \"revision\": \"df6904f1480a0210525311a594cd51b7\"\n },\n {\n \"url\": \"i-dont-always.cd8fe191.jpg\",\n \"revision\": \"6c0fa2f7428f252d177a52b34c93aacb\"\n },\n {\n \"url\": \"i-see-dead-people.89330beb.jpg\",\n \"revision\": \"16ff33b79a8ce266b890d2f2e53fdbc1\"\n },\n {\n \"url\": \"index.2a3e2367.js\",\n \"revision\": \"98425f95ed93443bbc77856ae9bb12c2\"\n },\n {\n \"url\": \"index.2a3e2367.js.map\",\n \"revision\": \"0763b5a209ca923de1e22bb701fe9e4e\"\n },\n {\n \"url\": \"index.2d751096.css\",\n \"revision\": \"1d8c1a1683aefb80c6b66e1c26083268\"\n },\n {\n \"url\": \"index.2d751096.css.map\",\n \"revision\": \"5376065d735d84b64dfd306f44b89184\"\n },\n {\n \"url\": \"index.6d051d2c.js\",\n \"revision\": \"f858454bf705c242bab435d0af2c39f2\"\n },\n {\n \"url\": \"index.6d051d2c.js.map\",\n \"revision\": \"8abbc25e5cc2ea494570fbd440aad217\"\n },\n {\n \"url\": \"index.89efe45b.js\",\n \"revision\": \"6814a61841cd719f59765d1ee48ea09a\"\n },\n {\n \"url\": \"index.89efe45b.js.map\",\n \"revision\": \"c88920bec0571a6511e504850de79c03\"\n },\n {\n \"url\": \"index.d44e81ec.js\",\n \"revision\": \"b90a75d7c5128c18c30bf621d43c8122\"\n },\n {\n \"url\": \"index.d44e81ec.js.map\",\n \"revision\": \"4f7febc735b0a98935455f8329214edd\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"8bd3e7e392189f72c3340d6a86f1354a\"\n },\n {\n \"url\": \"jurassic-park-no-one-cares.4b16d8e3.jpg\",\n \"revision\": \"5971adaaec085b176061d7d98577a089\"\n },\n {\n \"url\": \"knight-with-arrow-in-helmet.70d7b8ea.jpg\",\n \"revision\": \"2d51aa7ceccfacf6e1fae33cf5279abb\"\n },\n {\n \"url\": \"laughing-leo.ff4cf9b5.png\",\n \"revision\": \"ffd00816a11fb66f16d05a5a06506e3a\"\n },\n {\n \"url\": \"leonardo-dicaprio-cheers.1f5072fc.jpg\",\n \"revision\": \"0c9762d1044fde55cfccc6d3f8abfedb\"\n },\n {\n \"url\": \"logo.02439c4c.png\",\n \"revision\": \"799182a75ab5b10e8b2088a717f0eff2\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"1e34d4d2fb0da2246a35db6beeace137\"\n },\n {\n \"url\": \"matrix-morpheus.2a17fef0.jpg\",\n \"revision\": \"4306d531845e95029b5219f178ce546c\"\n },\n {\n \"url\": \"milk-girls.c67a099a.jpg\",\n \"revision\": \"d2a3c2d80f01fb790a6557978920ec36\"\n },\n {\n \"url\": \"monk-temptation.9fa9b52f.jpg\",\n \"revision\": \"f993e88e46226fb560559b5c8392ba6e\"\n },\n {\n \"url\": \"monkey_puppet.a1128702.jpg\",\n \"revision\": \"e3dd1d281e372a02ca2955eb62ce7dbb\"\n },\n {\n \"url\": \"nervous.ecca1da9.jpg\",\n \"revision\": \"f9500924e2154f15ff3249573963e867\"\n },\n {\n \"url\": \"obama-medal.da4528cd.jpg\",\n \"revision\": \"0b7d29347fd9bdf850b46293c8870fd8\"\n },\n {\n \"url\": \"office-congrats.f658c72e.jpg\",\n \"revision\": \"5e5823dd68191151a2313a3ec158e9cf\"\n },\n {\n \"url\": \"one-does-not-simply.bd73a129.jpg\",\n \"revision\": \"94eaa0e921189e88fe35ba1954988564\"\n },\n {\n \"url\": \"OpenSans-Bold.8fceb72b.ttf\",\n \"revision\": \"8ff9b5735ccb338267f0034d83fe8214\"\n },\n {\n \"url\": \"OpenSans-Regular.edf9e01b.ttf\",\n \"revision\": \"22ab03a6b890f2f142a137a38bf1d4ae\"\n },\n {\n \"url\": \"Oswald-Bold.0f6a7ca6.ttf\",\n \"revision\": \"452bfeb5bf78e71cc3cd6e720ac24bd4\"\n },\n {\n \"url\": \"Oswald-Regular.89ec7d89.ttf\",\n \"revision\": \"a7ccbd3cd9a9ff21ec41086dcc23ebe6\"\n },\n {\n \"url\": \"photo.0328c485.svg\",\n \"revision\": \"6b3fccb8598a897d641cc1dc75ed3592\"\n },\n {\n \"url\": \"plague-hackers.01c70709.jpg\",\n \"revision\": \"70712ddea9f2dd86ec34c1ffedffb3d0\"\n },\n {\n \"url\": \"Roboto-Bold.fdb9b54a.ttf\",\n \"revision\": \"b8e42971dec8d49207a8c8e2b919a6ac\"\n },\n {\n \"url\": \"Roboto-Regular.ca197847.ttf\",\n \"revision\": \"8a36205bd9b83e03af0591a004bc97f4\"\n },\n {\n \"url\": \"RobotoCondensed-Bold.e1f96d4b.ttf\",\n \"revision\": \"e38804ae070b58fbf4fdd88fd6853929\"\n },\n {\n \"url\": \"RobotoCondensed-Regular.d585f5c7.ttf\",\n \"revision\": \"0134dd8fe6fe708de73909a71d842780\"\n },\n {\n \"url\": \"sad-pablo-escobar.48ee550d.jpg\",\n \"revision\": \"1a49f6decc10da3ee849a1f94132c794\"\n },\n {\n \"url\": \"save.46fbf12f.svg\",\n \"revision\": \"3e1d90c414fadfd6727cc77f150e79e5\"\n },\n {\n \"url\": \"say-that-again-i-dare-you.0c8b53b9.jpg\",\n \"revision\": \"948be03975e613eaa08ac7f284491b40\"\n },\n {\n \"url\": \"screenshot.3fbaa9cf.png\",\n \"revision\": \"9df64fac2f8267d4f7db45082d60b09c\"\n },\n {\n \"url\": \"share.0fccb277.svg\",\n \"revision\": \"19d01499fa1fe8707366653db087ebac\"\n },\n {\n \"url\": \"shirley-temple-laugh.8125357d.png\",\n \"revision\": \"c2e13fffe87a3a1ff91d5a955a280fe1\"\n },\n {\n \"url\": \"sparta-leonidas.0b603b26.jpg\",\n \"revision\": \"e9ba2efb8ff797d0a9adf13135927c82\"\n },\n {\n \"url\": \"spinner.4452ed29.svg\",\n \"revision\": \"609c6274c68c19f6badaf5488b6aeef2\"\n },\n {\n \"url\": \"star-wars-yoda.c7579c93.jpg\",\n \"revision\": \"951e4ee52db27001190248f449651c4b\"\n },\n {\n \"url\": \"success-kid.5d6212f8.jpg\",\n \"revision\": \"b58ffaf338ffc8f4f06ef45478365c13\"\n },\n {\n \"url\": \"sweating-bullets.f3c2d84f.jpg\",\n \"revision\": \"3c9c50281665c688cacdd0d1da8f8f7d\"\n },\n {\n \"url\": \"tell-me-the-truth-I-am-ready-to-hear-it.34eb1bcc.png\",\n \"revision\": \"ecd53156061e4fdabf386c5f802035cf\"\n },\n {\n \"url\": \"think-about-it.f4fc185d.jpg\",\n \"revision\": \"f70b62834ba3ec34a2c9f2a80a5068b9\"\n },\n {\n \"url\": \"this-is-fine.db15aaeb.jpg\",\n \"revision\": \"dac2b7e7d3b1f18c72e48373cb4275e1\"\n },\n {\n \"url\": \"toilet_guy.812f73a4.jpg\",\n \"revision\": \"3f488def302d190dca09eb12c878d228\"\n },\n {\n \"url\": \"trash.d9edab78.svg\",\n \"revision\": \"db8971c7dab936bbe799ede7c1b9ac4b\"\n },\n {\n \"url\": \"two-buttons.a42b7a04.jpg\",\n \"revision\": \"611756fac300eb0f010491cbd95dda28\"\n },\n {\n \"url\": \"waiting-skeleton.26f2ec8f.jpg\",\n \"revision\": \"0eef934549392da6aa193fb86f9a8ab2\"\n },\n {\n \"url\": \"water-tank-leaking-fix.772173b9.png\",\n \"revision\": \"3ebfc2b2c42be514ec35fd3b9948686a\"\n },\n {\n \"url\": \"whisper-and-goosebumps.2bc61488.jpg\",\n \"revision\": \"962ccff862d6c9d416a330c8be901be9\"\n },\n {\n \"url\": \"x-x-everywhere.4732733a.jpg\",\n \"revision\": \"ca16fab0846148556e776aec3ff00739\"\n },\n {\n \"url\": \"you-guys-are-getting-paid.ba5678cc.png\",\n \"revision\": \"feb2da8a1fae966adae92bd1f8318153\"\n }\n], {});\n\n\n\n\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision"],"mappings":"0nBAoBAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,qCAEb,CAAA"} \ No newline at end of file +{"version":3,"file":"service-worker.js","sources":["../../../../../private/var/folders/vy/why3xmz53r57rfypb6dxq94c0000gp/T/be56239a5ef2006c1c4fef777615b086/service-worker.js"],"sourcesContent":["import {clientsClaim as workbox_core_clientsClaim} from '/Users/georgeraptis/Projects/@georapbox/meme-generator/node_modules/workbox-core/clientsClaim.mjs';\nimport {precacheAndRoute as workbox_precaching_precacheAndRoute} from '/Users/georgeraptis/Projects/@georapbox/meme-generator/node_modules/workbox-precaching/precacheAndRoute.mjs';/**\n * Welcome to your Workbox-powered service worker!\n *\n * You'll need to register this file in your web app.\n * See https://goo.gl/nhQhGp\n *\n * The rest of the code is auto-generated. Please don't update this file\n * directly; instead, make changes to your Workbox build configuration\n * and re-run your build process.\n * See https://goo.gl/2aRDsh\n */\n\n\n\n\n\n\n\n\nself.skipWaiting();\n\nworkbox_core_clientsClaim();\n\n\n/**\n * The precacheAndRoute() method efficiently caches and responds to\n * requests for URLs in the manifest.\n * See https://goo.gl/S9QRab\n */\nworkbox_precaching_precacheAndRoute([\n {\n \"url\": \"180.ad1ffa6f.png\",\n \"revision\": \"e500d9d7377de6d701630c6345a20b99\"\n },\n {\n \"url\": \"192.02439c4c.png\",\n \"revision\": \"799182a75ab5b10e8b2088a717f0eff2\"\n },\n {\n \"url\": \"384.3d08a4a6.png\",\n \"revision\": \"3eb04d3a80b60e082d7f79e1614070fe\"\n },\n {\n \"url\": \"512.00f88ae0.png\",\n \"revision\": \"511ad055b1865aa9bda7886cb0b9e336\"\n },\n {\n \"url\": \"add-image.bd815785.svg\",\n \"revision\": \"8c00e51567cbd039981fffb87c61dab1\"\n },\n {\n \"url\": \"always-has-been.08a66422.jpg\",\n \"revision\": \"d1b6401abd9cb8d382b7246bdb8ce0b5\"\n },\n {\n \"url\": \"anakin-padme.03c6b194.jpg\",\n \"revision\": \"baa00e8faccb9c63073f1db59274bd0d\"\n },\n {\n \"url\": \"Anton-Regular.e58ab3fe.ttf\",\n \"revision\": \"055c4df4e2f8c7a4d4675cdd8fa68da0\"\n },\n {\n \"url\": \"aperture.4bf28ce8.svg\",\n \"revision\": \"1a6a5d3b06ba8aaa3e96658810752663\"\n },\n {\n \"url\": \"bad-luck-brian.8b018588.jpg\",\n \"revision\": \"2bb70408a0ab18038a376d80da91d336\"\n },\n {\n \"url\": \"batman-slapping-robin.aa8b8054.jpg\",\n \"revision\": \"6695faabd1eb772936f31ff0af36111d\"\n },\n {\n \"url\": \"bell-curve.1167fe19.jpg\",\n \"revision\": \"e26dac38583f6f98ea8ef98e4dab71e1\"\n },\n {\n \"url\": \"ben-affleck-smoking.17cc6114.jpg\",\n \"revision\": \"512c246cb818579340a6dc8dddea4f87\"\n },\n {\n \"url\": \"camera-reverse.284e8ac9.svg\",\n \"revision\": \"86e592b72bb2472bbacd0c823b3a3c78\"\n },\n {\n \"url\": \"camera.ed7aa43f.svg\",\n \"revision\": \"46f0c02466282ec5c4bf26141624316e\"\n },\n {\n \"url\": \"captain-picard-facepalm.7690614a.jpg\",\n \"revision\": \"926eecb6292d72fe2f99fd3113444c0b\"\n },\n {\n \"url\": \"car-drift.9255750c.jpg\",\n \"revision\": \"55b3735095d73c764704bccdda6f2bc1\"\n },\n {\n \"url\": \"change-my-mind.b49b92c2.jpg\",\n \"revision\": \"35e498b8b3c3b62e485ce4ffbe4cdfd1\"\n },\n {\n \"url\": \"chevron-down.ad14d981.svg\",\n \"revision\": \"5635cc35f04030576a62d2d649824495\"\n },\n {\n \"url\": \"chevron-left.20a2f252.svg\",\n \"revision\": \"a8334bfa7ef65b1095bfd54557d69beb\"\n },\n {\n \"url\": \"chevron-right.1be074ac.svg\",\n \"revision\": \"3d72992183afc0c2f0b6bf010dadc2a1\"\n },\n {\n \"url\": \"chevron-up.f532d8b6.svg\",\n \"revision\": \"e1bd8bbacf48b185c4b3deb18b9e0f2d\"\n },\n {\n \"url\": \"CourierPrime-Bold.3d6bf689.ttf\",\n \"revision\": \"4acfa45d29d240044e0075a8e58f0862\"\n },\n {\n \"url\": \"CourierPrime-Regular.3a25a501.ttf\",\n \"revision\": \"fba4686ed1d1b4ef05ab14db78805dbe\"\n },\n {\n \"url\": \"disaster-girl.536b1af4.jpg\",\n \"revision\": \"07542c2e7ea315f6a7b7311d2a88d074\"\n },\n {\n \"url\": \"distracted-boyfriend.22708891.jpg\",\n \"revision\": \"4ee61cd7c20689e2c8b7fa2dbffbdbc4\"\n },\n {\n \"url\": \"drake-hotline-bling.99013af7.jpg\",\n \"revision\": \"edce37df305e1b9c78d0a41ade363e29\"\n },\n {\n \"url\": \"drowning-kid-in-the-pool.37435682.jpg\",\n \"revision\": \"99e976a664709f7fe0b7141e2661a42b\"\n },\n {\n \"url\": \"favicon-192.02439c4c.png\",\n \"revision\": \"799182a75ab5b10e8b2088a717f0eff2\"\n },\n {\n \"url\": \"finding-neverland.25f9c4f0.jpg\",\n \"revision\": \"4557c9d30b0e3114953f9cc8e981c622\"\n },\n {\n \"url\": \"gear.b3b5d1a5.svg\",\n \"revision\": \"5e0b2045d7dc4768b1ceb199d83ab6f0\"\n },\n {\n \"url\": \"gibson-jesus.1224d195.jpg\",\n \"revision\": \"b26e0d89414371dfbf7a1e1bbada7e15\"\n },\n {\n \"url\": \"girls-gossiping.da75b154.jpg\",\n \"revision\": \"97f0d159d65349dfdd821f6294d8b177\"\n },\n {\n \"url\": \"greta-thunberg-how-dare-you.ddceea0b.jpg\",\n \"revision\": \"dbe7e341b66c0e71da9db2f49eddbd9c\"\n },\n {\n \"url\": \"grinning-girl.9a1a3b6a.jpg\",\n \"revision\": \"133c4124813f1dfeff00a9e0a735b5c3\"\n },\n {\n \"url\": \"group-therapy.c82c3502.jpg\",\n \"revision\": \"a79a27311d3969bf370b8846bea1789c\"\n },\n {\n \"url\": \"hack-the-planet.29b5550a.jpg\",\n \"revision\": \"207de9c3f83de707d99ea7255f743fc1\"\n },\n {\n \"url\": \"hide-the-pain-harold.dc41d0f5.jpg\",\n \"revision\": \"af3a4d69c625740558a9adc66967797c\"\n },\n {\n \"url\": \"i-bet-hes-thinking-about-other-women.c80f1ce0.jpg\",\n \"revision\": \"df6904f1480a0210525311a594cd51b7\"\n },\n {\n \"url\": \"i-dont-always.cd8fe191.jpg\",\n \"revision\": \"6c0fa2f7428f252d177a52b34c93aacb\"\n },\n {\n \"url\": \"i-see-dead-people.89330beb.jpg\",\n \"revision\": \"16ff33b79a8ce266b890d2f2e53fdbc1\"\n },\n {\n \"url\": \"index.0ec871bb.js\",\n \"revision\": \"ee82720764a462f988bdd7d24f22e13a\"\n },\n {\n \"url\": \"index.0ec871bb.js.map\",\n \"revision\": \"1e83fed2f4852af9654792ddae6d9aba\"\n },\n {\n \"url\": \"index.2d751096.css\",\n \"revision\": \"1d8c1a1683aefb80c6b66e1c26083268\"\n },\n {\n \"url\": \"index.2d751096.css.map\",\n \"revision\": \"5376065d735d84b64dfd306f44b89184\"\n },\n {\n \"url\": \"index.89efe45b.js\",\n \"revision\": \"6814a61841cd719f59765d1ee48ea09a\"\n },\n {\n \"url\": \"index.89efe45b.js.map\",\n \"revision\": \"c88920bec0571a6511e504850de79c03\"\n },\n {\n \"url\": \"index.bc158aed.js\",\n \"revision\": \"2365edce2f35ba8f7f97af6ff1c71cef\"\n },\n {\n \"url\": \"index.bc158aed.js.map\",\n \"revision\": \"89a178de130b34f686b80b26a57a660a\"\n },\n {\n \"url\": \"index.d44e81ec.js\",\n \"revision\": \"b90a75d7c5128c18c30bf621d43c8122\"\n },\n {\n \"url\": \"index.d44e81ec.js.map\",\n \"revision\": \"4f7febc735b0a98935455f8329214edd\"\n },\n {\n \"url\": \"index.html\",\n \"revision\": \"2640cca834be9d42bad27748a7e5464f\"\n },\n {\n \"url\": \"jurassic-park-no-one-cares.4b16d8e3.jpg\",\n \"revision\": \"5971adaaec085b176061d7d98577a089\"\n },\n {\n \"url\": \"knight-with-arrow-in-helmet.70d7b8ea.jpg\",\n \"revision\": \"2d51aa7ceccfacf6e1fae33cf5279abb\"\n },\n {\n \"url\": \"laughing-leo.ff4cf9b5.png\",\n \"revision\": \"ffd00816a11fb66f16d05a5a06506e3a\"\n },\n {\n \"url\": \"leonardo-dicaprio-cheers.1f5072fc.jpg\",\n \"revision\": \"0c9762d1044fde55cfccc6d3f8abfedb\"\n },\n {\n \"url\": \"logo.02439c4c.png\",\n \"revision\": \"799182a75ab5b10e8b2088a717f0eff2\"\n },\n {\n \"url\": \"manifest.webmanifest\",\n \"revision\": \"1e34d4d2fb0da2246a35db6beeace137\"\n },\n {\n \"url\": \"matrix-morpheus.2a17fef0.jpg\",\n \"revision\": \"4306d531845e95029b5219f178ce546c\"\n },\n {\n \"url\": \"milk-girls.c67a099a.jpg\",\n \"revision\": \"d2a3c2d80f01fb790a6557978920ec36\"\n },\n {\n \"url\": \"monk-temptation.9fa9b52f.jpg\",\n \"revision\": \"f993e88e46226fb560559b5c8392ba6e\"\n },\n {\n \"url\": \"monkey_puppet.a1128702.jpg\",\n \"revision\": \"e3dd1d281e372a02ca2955eb62ce7dbb\"\n },\n {\n \"url\": \"nervous.ecca1da9.jpg\",\n \"revision\": \"f9500924e2154f15ff3249573963e867\"\n },\n {\n \"url\": \"obama-medal.da4528cd.jpg\",\n \"revision\": \"0b7d29347fd9bdf850b46293c8870fd8\"\n },\n {\n \"url\": \"office-congrats.f658c72e.jpg\",\n \"revision\": \"5e5823dd68191151a2313a3ec158e9cf\"\n },\n {\n \"url\": \"one-does-not-simply.bd73a129.jpg\",\n \"revision\": \"94eaa0e921189e88fe35ba1954988564\"\n },\n {\n \"url\": \"OpenSans-Bold.8fceb72b.ttf\",\n \"revision\": \"8ff9b5735ccb338267f0034d83fe8214\"\n },\n {\n \"url\": \"OpenSans-Regular.edf9e01b.ttf\",\n \"revision\": \"22ab03a6b890f2f142a137a38bf1d4ae\"\n },\n {\n \"url\": \"Oswald-Bold.0f6a7ca6.ttf\",\n \"revision\": \"452bfeb5bf78e71cc3cd6e720ac24bd4\"\n },\n {\n \"url\": \"Oswald-Regular.89ec7d89.ttf\",\n \"revision\": \"a7ccbd3cd9a9ff21ec41086dcc23ebe6\"\n },\n {\n \"url\": \"photo.0328c485.svg\",\n \"revision\": \"6b3fccb8598a897d641cc1dc75ed3592\"\n },\n {\n \"url\": \"plague-hackers.01c70709.jpg\",\n \"revision\": \"70712ddea9f2dd86ec34c1ffedffb3d0\"\n },\n {\n \"url\": \"Roboto-Bold.fdb9b54a.ttf\",\n \"revision\": \"b8e42971dec8d49207a8c8e2b919a6ac\"\n },\n {\n \"url\": \"Roboto-Regular.ca197847.ttf\",\n \"revision\": \"8a36205bd9b83e03af0591a004bc97f4\"\n },\n {\n \"url\": \"RobotoCondensed-Bold.e1f96d4b.ttf\",\n \"revision\": \"e38804ae070b58fbf4fdd88fd6853929\"\n },\n {\n \"url\": \"RobotoCondensed-Regular.d585f5c7.ttf\",\n \"revision\": \"0134dd8fe6fe708de73909a71d842780\"\n },\n {\n \"url\": \"sad-pablo-escobar.48ee550d.jpg\",\n \"revision\": \"1a49f6decc10da3ee849a1f94132c794\"\n },\n {\n \"url\": \"save.46fbf12f.svg\",\n \"revision\": \"3e1d90c414fadfd6727cc77f150e79e5\"\n },\n {\n \"url\": \"say-that-again-i-dare-you.0c8b53b9.jpg\",\n \"revision\": \"948be03975e613eaa08ac7f284491b40\"\n },\n {\n \"url\": \"screenshot.3fbaa9cf.png\",\n \"revision\": \"9df64fac2f8267d4f7db45082d60b09c\"\n },\n {\n \"url\": \"share.0fccb277.svg\",\n \"revision\": \"19d01499fa1fe8707366653db087ebac\"\n },\n {\n \"url\": \"shirley-temple-laugh.8125357d.png\",\n \"revision\": \"c2e13fffe87a3a1ff91d5a955a280fe1\"\n },\n {\n \"url\": \"sparta-leonidas.0b603b26.jpg\",\n \"revision\": \"e9ba2efb8ff797d0a9adf13135927c82\"\n },\n {\n \"url\": \"spinner.4452ed29.svg\",\n \"revision\": \"609c6274c68c19f6badaf5488b6aeef2\"\n },\n {\n \"url\": \"star-wars-yoda.c7579c93.jpg\",\n \"revision\": \"951e4ee52db27001190248f449651c4b\"\n },\n {\n \"url\": \"success-kid.5d6212f8.jpg\",\n \"revision\": \"b58ffaf338ffc8f4f06ef45478365c13\"\n },\n {\n \"url\": \"sweating-bullets.f3c2d84f.jpg\",\n \"revision\": \"3c9c50281665c688cacdd0d1da8f8f7d\"\n },\n {\n \"url\": \"tell-me-the-truth-I-am-ready-to-hear-it.34eb1bcc.png\",\n \"revision\": \"ecd53156061e4fdabf386c5f802035cf\"\n },\n {\n \"url\": \"think-about-it.f4fc185d.jpg\",\n \"revision\": \"f70b62834ba3ec34a2c9f2a80a5068b9\"\n },\n {\n \"url\": \"this-is-fine.db15aaeb.jpg\",\n \"revision\": \"dac2b7e7d3b1f18c72e48373cb4275e1\"\n },\n {\n \"url\": \"toilet_guy.812f73a4.jpg\",\n \"revision\": \"3f488def302d190dca09eb12c878d228\"\n },\n {\n \"url\": \"trash.d9edab78.svg\",\n \"revision\": \"db8971c7dab936bbe799ede7c1b9ac4b\"\n },\n {\n \"url\": \"two-buttons.a42b7a04.jpg\",\n \"revision\": \"611756fac300eb0f010491cbd95dda28\"\n },\n {\n \"url\": \"waiting-skeleton.26f2ec8f.jpg\",\n \"revision\": \"0eef934549392da6aa193fb86f9a8ab2\"\n },\n {\n \"url\": \"water-tank-leaking-fix.772173b9.png\",\n \"revision\": \"3ebfc2b2c42be514ec35fd3b9948686a\"\n },\n {\n \"url\": \"whisper-and-goosebumps.2bc61488.jpg\",\n \"revision\": \"962ccff862d6c9d416a330c8be901be9\"\n },\n {\n \"url\": \"x-x-everywhere.4732733a.jpg\",\n \"revision\": \"ca16fab0846148556e776aec3ff00739\"\n },\n {\n \"url\": \"you-guys-are-getting-paid.ba5678cc.png\",\n \"revision\": \"feb2da8a1fae966adae92bd1f8318153\"\n }\n], {});\n\n\n\n\n\n\n\n\n"],"names":["self","skipWaiting","workbox_core_clientsClaim","workbox_precaching_precacheAndRoute","url","revision"],"mappings":"0nBAoBAA,KAAKC,cAELC,EAAAA,eAQAC,EAAAA,iBAAoC,CAClC,CACEC,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,mBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,qCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,sBACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,oDACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,yBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,wBACPC,SAAY,oCAEd,CACED,IAAO,aACPC,SAAY,oCAEd,CACED,IAAO,0CACPC,SAAY,oCAEd,CACED,IAAO,2CACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,wCACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,mCACPC,SAAY,oCAEd,CACED,IAAO,6BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,uCACPC,SAAY,oCAEd,CACED,IAAO,iCACPC,SAAY,oCAEd,CACED,IAAO,oBACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,oCACPC,SAAY,oCAEd,CACED,IAAO,+BACPC,SAAY,oCAEd,CACED,IAAO,uBACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,uDACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,4BACPC,SAAY,oCAEd,CACED,IAAO,0BACPC,SAAY,oCAEd,CACED,IAAO,qBACPC,SAAY,oCAEd,CACED,IAAO,2BACPC,SAAY,oCAEd,CACED,IAAO,gCACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,sCACPC,SAAY,oCAEd,CACED,IAAO,8BACPC,SAAY,oCAEd,CACED,IAAO,yCACPC,SAAY,qCAEb,CAAA"} \ No newline at end of file