diff --git a/assets/EmojiPicker-WZ8rM8R5.js b/assets/EmojiPicker-DW7ClCTU.js similarity index 95% rename from assets/EmojiPicker-WZ8rM8R5.js rename to assets/EmojiPicker-DW7ClCTU.js index ffbaee7..5e79d82 100644 --- a/assets/EmojiPicker-WZ8rM8R5.js +++ b/assets/EmojiPicker-DW7ClCTU.js @@ -1 +1 @@ -import{d as j,r as m,c as g,o as S,_ as k,a as n,b as l,w as I,v as b,e as s,F as _,f as p,t as y,g as E,S as C,p as w,h as x,i as L}from"./index-D8JBH5dW.js";const V=r=>(w("data-v-a46cbbed"),r=r(),x(),r),D={key:0},P=V(()=>s("label",{for:"emoji-search"},"Search",-1)),B={class:"emoji-body"},F=["onClick"],M=["src","onClick","alt"],v="https://fastly.jsdelivr.net/gh/limin04551/vue3-twemoji-picker/public/img/svg/",G=j({__name:"EmojiPicker",setup(r){const a=m(),c=m(""),d=t=>{C.loadFromString(t)},f=g(()=>{if(c.value){const t=[];for(const i of a.value){const e=[];for(const o of i.emojis)if(o.n.join("").includes(c.value.toLocaleLowerCase())){let u=o.u;e.push({...o,r:u})}e.length&&t.push({...i,emojis:e})}return t}else return a.value});return S(async()=>{const t=await k(()=>import("./emojis-BYzzbN0P.js"),[]);a.value=t.default}),(t,i)=>a.value&&a.value.length>0?(n(),l("div",D,[P,I(s("input",{"onUpdate:modelValue":i[0]||(i[0]=e=>c.value=e),id:"emoji-search",type:"text"},null,512),[[b,c.value]]),s("div",null,[(n(!0),l(_,null,p(f.value,e=>(n(),l("div",null,[s("h3",null,y(e.title),1),s("div",B,[(n(!0),l(_,null,p(e.emojis,o=>{var u;return n(),l("div",{class:"emoji-image",onClick:h=>d(v+o.u.u+".svg")},[s("img",{src:v+o.u.u+".svg",onClick:h=>d(o),loading:"lazy",alt:(u=o.n)==null?void 0:u.join(", "),onerror:'this.style.display = "none"'},null,8,M)],8,F)}),256))])]))),256))])])):E("",!0)}}),O=L(G,[["__scopeId","data-v-a46cbbed"]]);export{O as default}; +import{d as j,r as m,c as g,o as S,_ as k,a as n,b as l,w as I,v as b,e as s,F as _,f as p,t as y,g as E,S as C,p as w,h as x,i as L}from"./index-hkiIi-r-.js";const V=r=>(w("data-v-a46cbbed"),r=r(),x(),r),D={key:0},P=V(()=>s("label",{for:"emoji-search"},"Search",-1)),B={class:"emoji-body"},F=["onClick"],M=["src","onClick","alt"],v="https://fastly.jsdelivr.net/gh/limin04551/vue3-twemoji-picker/public/img/svg/",G=j({__name:"EmojiPicker",setup(r){const a=m(),c=m(""),d=t=>{C.loadFromString(t)},f=g(()=>{if(c.value){const t=[];for(const i of a.value){const e=[];for(const o of i.emojis)if(o.n.join("").includes(c.value.toLocaleLowerCase())){let u=o.u;e.push({...o,r:u})}e.length&&t.push({...i,emojis:e})}return t}else return a.value});return S(async()=>{const t=await k(()=>import("./emojis-BYzzbN0P.js"),[]);a.value=t.default}),(t,i)=>a.value&&a.value.length>0?(n(),l("div",D,[P,I(s("input",{"onUpdate:modelValue":i[0]||(i[0]=e=>c.value=e),id:"emoji-search",type:"text"},null,512),[[b,c.value]]),s("div",null,[(n(!0),l(_,null,p(f.value,e=>(n(),l("div",null,[s("h3",null,y(e.title),1),s("div",B,[(n(!0),l(_,null,p(e.emojis,o=>{var u;return n(),l("div",{class:"emoji-image",onClick:h=>d(v+o.u.u+".svg")},[s("img",{src:v+o.u.u+".svg",onClick:h=>d(o),loading:"lazy",alt:(u=o.n)==null?void 0:u.join(", "),onerror:'this.style.display = "none"'},null,8,M)],8,F)}),256))])]))),256))])])):E("",!0)}}),O=L(G,[["__scopeId","data-v-a46cbbed"]]);export{O as default}; diff --git a/assets/index-D8JBH5dW.js b/assets/index-hkiIi-r-.js similarity index 99% rename from assets/index-D8JBH5dW.js rename to assets/index-hkiIi-r-.js index 615cc5d..5cf3531 100644 --- a/assets/index-D8JBH5dW.js +++ b/assets/index-hkiIi-r-.js @@ -1,4 +1,4 @@ -const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EmojiPicker-WZ8rM8R5.js","assets/EmojiPicker-CnMA3mcn.css"])))=>i.map(i=>d[i]); +const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/EmojiPicker-DW7ClCTU.js","assets/EmojiPicker-CnMA3mcn.css"])))=>i.map(i=>d[i]); var he=Object.defineProperty;var pe=(t,e,n)=>e in t?he(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var P1=(t,e,n)=>pe(t,typeof e!="symbol"?e+"":e,n);(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const r of document.querySelectorAll('link[rel="modulepreload"]'))c(r);new MutationObserver(r=>{for(const s of r)if(s.type==="childList")for(const i of s.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&c(i)}).observe(document,{childList:!0,subtree:!0});function n(r){const s={};return r.integrity&&(s.integrity=r.integrity),r.referrerPolicy&&(s.referrerPolicy=r.referrerPolicy),r.crossOrigin==="use-credentials"?s.credentials="include":r.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function c(r){if(r.ep)return;r.ep=!0;const s=n(r);fetch(r.href,s)}})();/** * @vue/shared v3.4.37 * (c) 2018-present Yuxi (Evan) You and Vue contributors @@ -15,7 +15,7 @@ var he=Object.defineProperty;var pe=(t,e,n)=>e in t?he(t,e,{enumerable:!0,config * @vue/runtime-dom v3.4.37 * (c) 2018-present Yuxi (Evan) You and Vue contributors * @license MIT -**/const g5="http://www.w3.org/2000/svg",C5="http://www.w3.org/1998/Math/MathML",U1=typeof document<"u"?document:null,K2=U1&&U1.createElement("template"),m5={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,c)=>{const r=e==="svg"?U1.createElementNS(g5,t):e==="mathml"?U1.createElementNS(C5,t):n?U1.createElement(t,{is:n}):U1.createElement(t);return t==="select"&&c&&c.multiple!=null&&r.setAttribute("multiple",c.multiple),r},createText:t=>U1.createTextNode(t),createComment:t=>U1.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>U1.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,c,r,s){const i=n?n.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===s||!(r=r.nextSibling)););else{K2.innerHTML=c==="svg"?`${t}`:c==="mathml"?`${t}`:t;const o=K2.content;if(c==="svg"||c==="mathml"){const a=o.firstChild;for(;a.firstChild;)o.appendChild(a.firstChild);o.removeChild(a)}e.insertBefore(o,n)}return[i?i.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},F5=Symbol("_vtc");function v5(t,e,n){const c=t[F5];c&&(e=(e?[e,...c]:[...c]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const G2=Symbol("_vod"),_5=Symbol("_vsh"),M5=Symbol(""),y5=/(^|;)\s*display\s*:/;function w5(t,e,n){const c=t.style,r=r1(n);let s=!1;if(n&&!r){if(e)if(r1(e))for(const i of e.split(";")){const o=i.slice(0,i.indexOf(":")).trim();n[o]==null&&at(c,o,"")}else for(const i in e)n[i]==null&&at(c,i,"");for(const i in n)i==="display"&&(s=!0),at(c,i,n[i])}else if(r){if(e!==n){const i=c[M5];i&&(n+=";"+i),c.cssText=n,s=y5.test(n)}}else e&&t.removeAttribute("style");G2 in t&&(t[G2]=s?c.display:"",t[_5]&&(c.display="none"))}const W2=/\s*!important$/;function at(t,e,n){if(O(n))n.forEach(c=>at(t,e,c));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const c=b5(t,e);W2.test(n)?t.setProperty(p0(c),n.replace(W2,""),"important"):t[c]=n}}const Y2=["Webkit","Moz","ms"],Tt={};function b5(t,e){const n=Tt[e];if(n)return n;let c=u0(e);if(c!=="filter"&&c in t)return Tt[e]=c;c=f3(c);for(let r=0;rPt||(A5.then(()=>Pt=0),Pt=Date.now());function O5(t,e){const n=c=>{if(!c._vts)c._vts=Date.now();else if(c._vts<=n.attached)return;E1(T5(c,n.value),e,5,[c])};return n.value=t,n.attached=k5(),n}function T5(t,e){if(O(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(c=>r=>!r._stopped&&c&&c(r))}else return e}const Q2=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,P5=(t,e,n,c,r,s)=>{const i=r==="svg";e==="class"?v5(t,c,i):e==="style"?w5(t,n,c):pt(e)?Qt(e)||S5(t,e,n,c,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):L5(t,e,c,i))?(x5(t,e,c),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&q2(t,e,c,i,s,e!=="value")):(e==="true-value"?t._trueValue=c:e==="false-value"&&(t._falseValue=c),q2(t,e,c,i))};function L5(t,e,n,c){if(c)return!!(e==="innerHTML"||e==="textContent"||e in t&&Q2(e)&&R(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Q2(e)&&r1(n)?!1:e in t}const z0=t=>{const e=t.props["onUpdate:modelValue"]||!1;return O(e)?n=>ct(e,n):e};function $5(t){t.target.composing=!0}function t3(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const H1=Symbol("_assign"),R5={created(t,{modifiers:{lazy:e,trim:n,number:c}},r){t[H1]=z0(r);const s=c||r.props&&r.props.type==="number";Q1(t,e?"change":"input",i=>{if(i.target.composing)return;let o=t.value;n&&(o=o.trim()),s&&(o=ft(o)),t[H1](o)}),n&&Q1(t,"change",()=>{t.value=t.value.trim()}),e||(Q1(t,"compositionstart",$5),Q1(t,"compositionend",t3),Q1(t,"change",t3))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:c,trim:r,number:s}},i){if(t[H1]=z0(i),t.composing)return;const o=(s||t.type==="number")&&!/^0\d/.test(t.value)?ft(t.value):t.value,a=e??"";o!==a&&(document.activeElement===t&&t.type!=="range"&&(c&&e===n||r&&t.value.trim()===a)||(t.value=a))}},I5={deep:!0,created(t,e,n){t[H1]=z0(n),Q1(t,"change",()=>{const c=t._modelValue,r=U0(t),s=t.checked,i=t[H1];if(O(c)){const o=r2(c,r),a=o!==-1;if(s&&!a)i(c.concat(r));else if(!s&&a){const u=[...c];u.splice(o,1),i(u)}}else if(S0(c)){const o=new Set(c);s?o.add(r):o.delete(r),i(o)}else i(ae(t,s))})},mounted:e3,beforeUpdate(t,e,n){t[H1]=z0(n),e3(t,e,n)}};function e3(t,{value:e,oldValue:n},c){t._modelValue=e,O(e)?t.checked=r2(e,c.props.value)>-1:S0(e)?t.checked=e.has(c.props.value):e!==n&&(t.checked=B0(e,ae(t,!0)))}const V5={deep:!0,created(t,{value:e,modifiers:{number:n}},c){const r=S0(e);Q1(t,"change",()=>{const s=Array.prototype.filter.call(t.options,i=>i.selected).map(i=>n?ft(U0(i)):U0(i));t[H1](t.multiple?r?new Set(s):s:s[0]),t._assigning=!0,P3(()=>{t._assigning=!1})}),t[H1]=z0(c)},mounted(t,{value:e,modifiers:{number:n}}){n3(t,e)},beforeUpdate(t,e,n){t[H1]=z0(n)},updated(t,{value:e,modifiers:{number:n}}){t._assigning||n3(t,e)}};function n3(t,e,n){const c=t.multiple,r=O(e);if(!(c&&!r&&!S0(e))){for(let s=0,i=t.options.length;sString(d)===String(a)):o.selected=r2(e,a)>-1}else o.selected=e.has(a);else if(B0(U0(o),e)){t.selectedIndex!==s&&(t.selectedIndex=s);return}}!c&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function U0(t){return"_value"in t?t._value:t.value}function ae(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const N5=a1({patchProp:P5},m5);let c3;function U5(){return c3||(c3=N4(N5))}const j5=(...t)=>{const e=U5().createApp(...t),{mount:n}=e;return e.mount=c=>{const r=B5(c);if(!r)return;const s=e._component;!R(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.innerHTML="";const i=n(r,!1,D5(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},e};function D5(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function B5(t){return r1(t)?document.querySelector(t):t}const H5="modulepreload",K5=function(t){return"/"+t},r3={},G5=function(e,n,c){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.all(n.map(o=>{if(o=K5(o),o in r3)return;r3[o]=!0;const a=o.endsWith(".css"),u=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${u}`))return;const d=document.createElement("link");if(d.rel=a?"stylesheet":H5,a||(d.as="script",d.crossOrigin=""),d.href=o,i&&d.setAttribute("nonce",i),document.head.appendChild(d),a)return new Promise((F,v)=>{d.addEventListener("load",F),d.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${o}`)))})}))}return r.then(()=>e()).catch(s=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=s,window.dispatchEvent(i),!i.defaultPrevented)throw s})},W5=async()=>new Promise((t,e)=>{const n=document.createElement("input");n.type="file",n.accept=".svg",n.onchange=c=>{var s;const r=(s=c.target.files)==null?void 0:s[0];if(r){const i=new FileReader;i.onload=o=>{var u;const a=(u=o.target)==null?void 0:u.result;t(a)},i.onerror=o=>{e(o)},i.readAsText(r)}else e("No file selected")},n.click()}),Y5=` +**/const g5="http://www.w3.org/2000/svg",C5="http://www.w3.org/1998/Math/MathML",U1=typeof document<"u"?document:null,K2=U1&&U1.createElement("template"),m5={insert:(t,e,n)=>{e.insertBefore(t,n||null)},remove:t=>{const e=t.parentNode;e&&e.removeChild(t)},createElement:(t,e,n,c)=>{const r=e==="svg"?U1.createElementNS(g5,t):e==="mathml"?U1.createElementNS(C5,t):n?U1.createElement(t,{is:n}):U1.createElement(t);return t==="select"&&c&&c.multiple!=null&&r.setAttribute("multiple",c.multiple),r},createText:t=>U1.createTextNode(t),createComment:t=>U1.createComment(t),setText:(t,e)=>{t.nodeValue=e},setElementText:(t,e)=>{t.textContent=e},parentNode:t=>t.parentNode,nextSibling:t=>t.nextSibling,querySelector:t=>U1.querySelector(t),setScopeId(t,e){t.setAttribute(e,"")},insertStaticContent(t,e,n,c,r,s){const i=n?n.previousSibling:e.lastChild;if(r&&(r===s||r.nextSibling))for(;e.insertBefore(r.cloneNode(!0),n),!(r===s||!(r=r.nextSibling)););else{K2.innerHTML=c==="svg"?`${t}`:c==="mathml"?`${t}`:t;const o=K2.content;if(c==="svg"||c==="mathml"){const a=o.firstChild;for(;a.firstChild;)o.appendChild(a.firstChild);o.removeChild(a)}e.insertBefore(o,n)}return[i?i.nextSibling:e.firstChild,n?n.previousSibling:e.lastChild]}},F5=Symbol("_vtc");function v5(t,e,n){const c=t[F5];c&&(e=(e?[e,...c]:[...c]).join(" ")),e==null?t.removeAttribute("class"):n?t.setAttribute("class",e):t.className=e}const G2=Symbol("_vod"),_5=Symbol("_vsh"),M5=Symbol(""),y5=/(^|;)\s*display\s*:/;function w5(t,e,n){const c=t.style,r=r1(n);let s=!1;if(n&&!r){if(e)if(r1(e))for(const i of e.split(";")){const o=i.slice(0,i.indexOf(":")).trim();n[o]==null&&at(c,o,"")}else for(const i in e)n[i]==null&&at(c,i,"");for(const i in n)i==="display"&&(s=!0),at(c,i,n[i])}else if(r){if(e!==n){const i=c[M5];i&&(n+=";"+i),c.cssText=n,s=y5.test(n)}}else e&&t.removeAttribute("style");G2 in t&&(t[G2]=s?c.display:"",t[_5]&&(c.display="none"))}const W2=/\s*!important$/;function at(t,e,n){if(O(n))n.forEach(c=>at(t,e,c));else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{const c=b5(t,e);W2.test(n)?t.setProperty(p0(c),n.replace(W2,""),"important"):t[c]=n}}const Y2=["Webkit","Moz","ms"],Tt={};function b5(t,e){const n=Tt[e];if(n)return n;let c=u0(e);if(c!=="filter"&&c in t)return Tt[e]=c;c=f3(c);for(let r=0;rPt||(A5.then(()=>Pt=0),Pt=Date.now());function O5(t,e){const n=c=>{if(!c._vts)c._vts=Date.now();else if(c._vts<=n.attached)return;E1(T5(c,n.value),e,5,[c])};return n.value=t,n.attached=k5(),n}function T5(t,e){if(O(e)){const n=t.stopImmediatePropagation;return t.stopImmediatePropagation=()=>{n.call(t),t._stopped=!0},e.map(c=>r=>!r._stopped&&c&&c(r))}else return e}const Q2=t=>t.charCodeAt(0)===111&&t.charCodeAt(1)===110&&t.charCodeAt(2)>96&&t.charCodeAt(2)<123,P5=(t,e,n,c,r,s)=>{const i=r==="svg";e==="class"?v5(t,c,i):e==="style"?w5(t,n,c):pt(e)?Qt(e)||S5(t,e,n,c,s):(e[0]==="."?(e=e.slice(1),!0):e[0]==="^"?(e=e.slice(1),!1):L5(t,e,c,i))?(x5(t,e,c),!t.tagName.includes("-")&&(e==="value"||e==="checked"||e==="selected")&&q2(t,e,c,i,s,e!=="value")):(e==="true-value"?t._trueValue=c:e==="false-value"&&(t._falseValue=c),q2(t,e,c,i))};function L5(t,e,n,c){if(c)return!!(e==="innerHTML"||e==="textContent"||e in t&&Q2(e)&&R(n));if(e==="spellcheck"||e==="draggable"||e==="translate"||e==="form"||e==="list"&&t.tagName==="INPUT"||e==="type"&&t.tagName==="TEXTAREA")return!1;if(e==="width"||e==="height"){const r=t.tagName;if(r==="IMG"||r==="VIDEO"||r==="CANVAS"||r==="SOURCE")return!1}return Q2(e)&&r1(n)?!1:e in t}const z0=t=>{const e=t.props["onUpdate:modelValue"]||!1;return O(e)?n=>ct(e,n):e};function $5(t){t.target.composing=!0}function t3(t){const e=t.target;e.composing&&(e.composing=!1,e.dispatchEvent(new Event("input")))}const H1=Symbol("_assign"),R5={created(t,{modifiers:{lazy:e,trim:n,number:c}},r){t[H1]=z0(r);const s=c||r.props&&r.props.type==="number";Q1(t,e?"change":"input",i=>{if(i.target.composing)return;let o=t.value;n&&(o=o.trim()),s&&(o=ft(o)),t[H1](o)}),n&&Q1(t,"change",()=>{t.value=t.value.trim()}),e||(Q1(t,"compositionstart",$5),Q1(t,"compositionend",t3),Q1(t,"change",t3))},mounted(t,{value:e}){t.value=e??""},beforeUpdate(t,{value:e,oldValue:n,modifiers:{lazy:c,trim:r,number:s}},i){if(t[H1]=z0(i),t.composing)return;const o=(s||t.type==="number")&&!/^0\d/.test(t.value)?ft(t.value):t.value,a=e??"";o!==a&&(document.activeElement===t&&t.type!=="range"&&(c&&e===n||r&&t.value.trim()===a)||(t.value=a))}},I5={deep:!0,created(t,e,n){t[H1]=z0(n),Q1(t,"change",()=>{const c=t._modelValue,r=U0(t),s=t.checked,i=t[H1];if(O(c)){const o=r2(c,r),a=o!==-1;if(s&&!a)i(c.concat(r));else if(!s&&a){const u=[...c];u.splice(o,1),i(u)}}else if(S0(c)){const o=new Set(c);s?o.add(r):o.delete(r),i(o)}else i(ae(t,s))})},mounted:e3,beforeUpdate(t,e,n){t[H1]=z0(n),e3(t,e,n)}};function e3(t,{value:e,oldValue:n},c){t._modelValue=e,O(e)?t.checked=r2(e,c.props.value)>-1:S0(e)?t.checked=e.has(c.props.value):e!==n&&(t.checked=B0(e,ae(t,!0)))}const V5={deep:!0,created(t,{value:e,modifiers:{number:n}},c){const r=S0(e);Q1(t,"change",()=>{const s=Array.prototype.filter.call(t.options,i=>i.selected).map(i=>n?ft(U0(i)):U0(i));t[H1](t.multiple?r?new Set(s):s:s[0]),t._assigning=!0,P3(()=>{t._assigning=!1})}),t[H1]=z0(c)},mounted(t,{value:e,modifiers:{number:n}}){n3(t,e)},beforeUpdate(t,e,n){t[H1]=z0(n)},updated(t,{value:e,modifiers:{number:n}}){t._assigning||n3(t,e)}};function n3(t,e,n){const c=t.multiple,r=O(e);if(!(c&&!r&&!S0(e))){for(let s=0,i=t.options.length;sString(d)===String(a)):o.selected=r2(e,a)>-1}else o.selected=e.has(a);else if(B0(U0(o),e)){t.selectedIndex!==s&&(t.selectedIndex=s);return}}!c&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}}function U0(t){return"_value"in t?t._value:t.value}function ae(t,e){const n=e?"_trueValue":"_falseValue";return n in t?t[n]:e}const N5=a1({patchProp:P5},m5);let c3;function U5(){return c3||(c3=N4(N5))}const j5=(...t)=>{const e=U5().createApp(...t),{mount:n}=e;return e.mount=c=>{const r=B5(c);if(!r)return;const s=e._component;!R(s)&&!s.render&&!s.template&&(s.template=r.innerHTML),r.innerHTML="";const i=n(r,!1,D5(r));return r instanceof Element&&(r.removeAttribute("v-cloak"),r.setAttribute("data-v-app","")),i},e};function D5(t){if(t instanceof SVGElement)return"svg";if(typeof MathMLElement=="function"&&t instanceof MathMLElement)return"mathml"}function B5(t){return r1(t)?document.querySelector(t):t}const H5="modulepreload",K5=function(t){return"/svg-emoji-corrupt/"+t},r3={},G5=function(e,n,c){let r=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const s=document.querySelector("meta[property=csp-nonce]"),i=(s==null?void 0:s.nonce)||(s==null?void 0:s.getAttribute("nonce"));r=Promise.all(n.map(o=>{if(o=K5(o),o in r3)return;r3[o]=!0;const a=o.endsWith(".css"),u=a?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${o}"]${u}`))return;const d=document.createElement("link");if(d.rel=a?"stylesheet":H5,a||(d.as="script",d.crossOrigin=""),d.href=o,i&&d.setAttribute("nonce",i),document.head.appendChild(d),a)return new Promise((F,v)=>{d.addEventListener("load",F),d.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${o}`)))})}))}return r.then(()=>e()).catch(s=>{const i=new Event("vite:preloadError",{cancelable:!0});if(i.payload=s,window.dispatchEvent(i),!i.defaultPrevented)throw s})},W5=async()=>new Promise((t,e)=>{const n=document.createElement("input");n.type="file",n.accept=".svg",n.onchange=c=>{var s;const r=(s=c.target.files)==null?void 0:s[0];if(r){const i=new FileReader;i.onload=o=>{var u;const a=(u=o.target)==null?void 0:u.result;t(a)},i.onerror=o=>{e(o)},i.readAsText(r)}else e("No file selected")},n.click()}),Y5=` e in t?he(t,e,{enumerable:!0,config `,q5=(t=1)=>{const e=[()=>`matrix(${Array.from({length:6},()=>Math.random()*10-5).join(", ")})`,()=>`matrix3d(${Array.from({length:16},()=>Math.random()*2-1).join(", ")})`,()=>`perspective(${Math.random()*1e3}px)`,()=>`rotate(${Math.random()*360}deg)`,()=>`rotate3d(${Math.random()}, ${Math.random()}, ${Math.random()}, ${Math.random()*360}deg)`,()=>`rotateX(${Math.random()*360}deg)`,()=>`rotateY(${Math.random()*360}deg)`,()=>`rotateZ(${Math.random()*360}deg)`,()=>`translate(${Math.random()*100}px, ${Math.random()*100}%)`,()=>`translate3d(${Math.random()*100}px, ${Math.random()*100}%, ${Math.random()*100}em)`,()=>`translateX(${Math.random()*100}em)`,()=>`translateY(${Math.random()*100}in)`,()=>`translateZ(${Math.random()*100}px)`,()=>`scale(${Math.random()*3}, ${Math.random()*3})`,()=>`scale3d(${Math.random()*3}, ${Math.random()*3}, ${Math.random()*3})`,()=>`scaleX(${Math.random()*3})`,()=>`scaleY(${Math.random()*3})`,()=>`scaleZ(${Math.random()*3})`,()=>`skew(${Math.random()*90}deg, ${Math.random()*90}deg)`,()=>`skewX(${Math.random()*90}deg)`,()=>`skewY(${Math.random()*Math.PI/2}rad)`],n=e[Math.floor(Math.random()*e.length)];return Array(t).fill(null).map(()=>`transform: ${n()};`).join(" ")},Z5=(t=1,e=0)=>{const n=[()=>`matrix(1, 0, 0, 1, 0, ${e})`,()=>`matrix3d(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, ${1+e})`,()=>`perspective(${1e3+e}px)`,()=>`rotate(${e}deg)`,()=>`rotate3d(1, 1, 1, ${e}deg)`,()=>`rotateX(${e}deg)`,()=>`rotateY(${e}deg)`,()=>`rotateZ(${e}deg)`,()=>`translate(${e}px, ${e}%)`,()=>`translate3d(${e}px, ${e}%, ${e}em)`,()=>`translateX(${e}em)`,()=>`translateY(${e}in)`,()=>`translateZ(${e}px)`,()=>`scale(${1+e}, ${1+e})`,()=>`scale3d(${1+e}, ${1+e}, ${1+e})`,()=>`scaleX(${1+e})`,()=>`scaleY(${1+e})`,()=>`scaleZ(${1+e})`,()=>`skew(${e}deg, ${e}deg)`,()=>`skewX(${e}deg)`,()=>`skewY(${e}rad)`],c=()=>n[Math.floor(Math.random()*n.length)]();return Array(t).fill(null).map(()=>`transform: ${c()};`).join(" ")},J5=[{id:"replace",name:"Replace",active:!0,description:"Replace the target values with a single value",function:(t,e,n,c)=>t.replace(e,n)},{id:"multiply",name:"Multiply",active:!0,description:"Multiply the target values by the selected value",function:(t,e,n,c)=>t.replace(e,r=>String(Math.trunc(Number(r)*Number(n))))},{id:"add",name:"Add",active:!0,description:"Add the selected value to the target values",function:(t,e,n,c)=>t.replace(e,r=>String(Math.trunc(Number(r)+Number(n))))},{id:"subtract",name:"Subtract",active:!0,description:"Subtract the selected value from the target values",function:(t,e,n,c)=>t.replace(e,r=>String(Math.trunc(Number(r)-Number(n))))},{id:"divide",name:"Divide",active:!0,description:"Divide the target values by the selected value",function:(t,e,n,c)=>t.replace(e,r=>String(Math.trunc(Number(r)/Number(n))))},{id:"transform",name:"Random transforms",active:!0,description:"Applies random transforms to the target values",random:!0,function:(t,e,n,c)=>(c.setAttribute("style",q5(Number(n))),t)},{id:"transform_addition",name:"Addition Transforms",active:!0,description:"Applies random transforms to the target values",random:!0,function:(t,e,n,c)=>(c.setAttribute("style",Z5(10,Number(n)/50)),t)}];class Q5{constructor(){P1(this,"parser",new DOMParser);P1(this,"svgElement",null);P1(this,"originalSvgString","");P1(this,"originalSvgNode",null);P1(this,"panZoom",null);P1(this,"targetValuesArray",[]);P1(this,"targetValuesRegexp",new RegExp("0","gi"));P1(this,"replaceValue","0");P1(this,"corruptionModes",B1(J5))}get currentCorruptionMode(){return this.corruptionModes.value.find(e=>e.active)}get disableCorrupt(){return this.targetValuesArray.length===0&&!this.currentCorruptionMode.random}async init(e,n){this.svgElement=e,this.panZoom=n,await this.loadFromString(Y5)}resetSvg(){this.setSvgElement(this.originalSvgString)}setSvgElement(e){var r,s,i,o;this.originalSvgString=e;const n=this.parser.parseFromString(e,"image/svg+xml").documentElement;(s=(r=this.svgElement)==null?void 0:r.value.firstChild)==null||s.remove(),(i=this.panZoom)==null||i.reset();const c=(o=this.svgElement)==null?void 0:o.value.appendChild(n);c&&(c.setAttribute("style","width: 100%; height: 100%;"),this.originalSvgNode=c.cloneNode(!0))}async loadFromString(e){let n=e;this.isSVGUrl(n)&&(n=await this.loadSvgFromUrl(n)),this.setSvgElement(n)}async loadSvgFromUrl(e){try{this.setSvgElement(X5);const n=await fetch(e);if(!n.ok)throw new Error(`HTTP error! status: ${n.status}`);const c=n.headers.get("content-type");if(!c||!c.includes("image/svg+xml"))throw new Error("The fetched content is not an SVG");return await n.text()}catch(n){throw alert(`Error fetching SVG: - ${n}`),n}}isSVGUrl(e){try{const n=new URL(e);return["http:","https:"].includes(n.protocol)?/\.svg$/i.test(n.pathname):!1}catch{return!1}}corruptSvg(){var i;if(this.disableCorrupt)return;const e=(i=this.svgElement)==null?void 0:i.value.querySelector("svg");if(!e)return;const n=e.querySelectorAll("path"),c=this.originalSvgNode.querySelectorAll("path"),r=Math.min(n.length,c.length),s=this.currentCorruptionMode.function;for(let o=0;o{n.active=n.id===e})}async exportSvgToPng(){var a;const e=(a=this.svgElement)==null?void 0:a.value.querySelector("svg");if(!e)return;const n=document.createElement("canvas"),c=n.getContext("2d");if(!c)return;const r=new XMLSerializer().serializeToString(e),s=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(s),o=new Image;o.onload=()=>{n.width=e.clientWidth,n.height=e.clientHeight,c.drawImage(o,0,0),URL.revokeObjectURL(i),n.toBlob(u=>{if(u){const d=document.createElement("a");d.href=URL.createObjectURL(u),d.download="corrupted.png",d.click(),URL.revokeObjectURL(d.href)}},"image/png")},o.src=i}}const p1=new Q5,t6={class:"input-slider"},e6=["for"],n6=["id","value"],c6=K0({__name:"RangeSlider",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,c=r=>{const s=r.target;n("update:modelValue",s.value)};return(r,s)=>($1(),j1("div",t6,[q("label",{for:r.id},$0(r.label)+": "+$0(r.modelValue),9,e6),q("input",ie({id:r.id},r.$attrs,{value:r.modelValue,onInput:c}),null,16,n6)]))}}),wt=(t,e)=>{const n=t.__vccOpts||t;for(const[c,r]of e)n[c]=r;return n},r6=wt(c6,[["__scopeId","data-v-f1f6fa04"]]),F2=t=>(i4("data-v-f5ef8259"),t=t(),o4(),t),s6={class:"panel"},i6={class:"panel__inner"},o6={class:"panel__section"},l6=F2(()=>q("div",null,[q("label",{for:"svg-input"},"SVG string or URL")],-1)),a6={class:"panel__section"},f6=F2(()=>q("span",null,"Corruption mode",-1)),u6=["value"],d6={key:0,class:"panel__section"},h6=F2(()=>q("span",null,"Target Values",-1)),p6={class:"section__target-values"},g6=["for"],C6=["id","value","onUpdate:modelValue"],m6={class:"panel__section"},F6={class:"panel__section"},v6={class:"section__corrupt-buttons"},_6={class:"panel__section"},M6=K0({__name:"Panel",setup(t){const e=B1(""),n=B1(new Array(10).fill(!1)),c=B1(0),r=p1.corruptionModes,s=a4(()=>G5(()=>import("./EmojiPicker-WZ8rM8R5.js"),__vite__mapDeps([0,1]))),i=async()=>{const F=await W5();await p1.loadFromString(F)},o=()=>{p1.setTargetValues(n.value),p1.corruptSvg()},a=()=>{p1.setReplaceValue(c.value),p1.corruptSvg()},u=qt({get(){return p1.currentCorruptionMode.id},set(F){p1.setCorruptionMode(F),p1.corruptSvg()}}),d=qt(()=>p1.currentCorruptionMode);return ot(e,()=>{p1.loadFromString(e.value)}),(F,v)=>{var S;return $1(),j1("div",s6,[q("div",i6,[q("div",o6,[q("div",{class:"input"},[l6,q("button",{class:"file-select",onClick:i},"Upload SVG")]),zt(q("input",{"onUpdate:modelValue":v[0]||(v[0]=x=>e.value=x),id:"svg-input",type:"text"},null,512),[[R5,e.value]])]),q("div",a6,[f6,q("div",null,[zt(q("select",{"onUpdate:modelValue":v[1]||(v[1]=x=>u.value=x)},[($1(!0),j1(S1,null,P2(F0(r),x=>($1(),j1("option",{key:x.id,value:x.id},$0(x.name),9,u6))),128))],512),[[V5,u.value]])])]),(S=d.value)!=null&&S.random?s5("",!0):($1(),j1("div",d6,[h6,q("div",p6,[($1(!0),j1(S1,null,P2(n.value,(x,T)=>($1(),j1("label",{for:"target-values-"+T},[zt(q("input",{id:"target-values-"+T,type:"checkbox",value:n.value[T],"onUpdate:modelValue":G=>n.value[T]=G,onChange:o},null,40,C6),[[I5,n.value[T]]]),se(" "+$0(T),1)],8,g6))),256))])])),q("div",m6,[i1(r6,{modelValue:c.value,"onUpdate:modelValue":v[2]||(v[2]=x=>c.value=x),label:d.value.name,id:"replace-value",step:"1",max:"100",min:"0",type:"range",onInput:a},null,8,["modelValue","label"])]),q("div",F6,[q("div",v6,[q("button",{class:"corrupt",onClick:v[3]||(v[3]=x=>F0(p1).corruptSvg())}," Corrupt SVG "),q("button",{class:"reset",onClick:v[4]||(v[4]=x=>F0(p1).resetSvg())}," Reset SVG "),q("button",{class:"download",onClick:v[5]||(v[5]=x=>F0(p1).exportSvgToPng())}," Download PNG ")])]),q("div",_6,[i1(F0(s))])])])}}}),y6=wt(M6,[["__scopeId","data-v-f5ef8259"]]);var c1=function(){return c1=Object.assign||function(e){for(var n,c=1,r=arguments.length;c-1&&t.splice(n,1),t.push(e)}function w6(t,e){if(e.touches){for(;t.length;)t.pop();return}var n=fe(t,e);n>-1&&t.splice(n,1)}function s3(t){t=t.slice(0);for(var e=t.pop(),n;n=t.pop();)e={clientX:(n.clientX-e.clientX)/2+e.clientX,clientY:(n.clientY-e.clientY)/2+e.clientY};return e}function Lt(t){if(t.length<2)return 0;var e=t[0],n=t[1];return Math.sqrt(Math.pow(Math.abs(n.clientX-e.clientX),2)+Math.pow(Math.abs(n.clientY-e.clientY),2))}var j0={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?j0={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(j0={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function $t(t,e,n,c){j0[t].split(" ").forEach(function(r){e.addEventListener(r,n,c)})}function Rt(t,e,n){j0[t].split(" ").forEach(function(c){e.removeEventListener(c,n)})}var b6=typeof document<"u"&&!!document.documentMode,It;function x6(){return It||(It=document.createElement("div").style)}var i3=["webkit","moz","ms"],tt={};function v2(t){if(tt[t])return tt[t];var e=x6();if(t in e)return tt[t]=t;for(var n=t[0].toUpperCase()+t.slice(1),c=i3.length;c--;){var r="".concat(i3[c]).concat(n);if(r in e)return tt[t]=r}}function et(t,e){return parseFloat(e[v2(t)])||0}function nt(t,e,n){n===void 0&&(n=window.getComputedStyle(t));var c=e==="border"?"Width":"";return{left:et("".concat(e,"Left").concat(c),n),right:et("".concat(e,"Right").concat(c),n),top:et("".concat(e,"Top").concat(c),n),bottom:et("".concat(e,"Bottom").concat(c),n)}}function v0(t,e,n){t.style[v2(e)]=n}function z6(t,e){var n=v2("transform");v0(t,"transition","".concat(n," ").concat(e.duration,"ms ").concat(e.easing))}function S6(t,e,n){var c=e.x,r=e.y,s=e.scale,i=e.isSVG;if(v0(t,"transform","scale(".concat(s,") translate(").concat(c,"px, ").concat(r,"px)")),i&&b6){var o=window.getComputedStyle(t).getPropertyValue("transform");t.setAttribute("transform",o)}}function Vt(t){var e=t.parentNode,n=window.getComputedStyle(t),c=window.getComputedStyle(e),r=t.getBoundingClientRect(),s=e.getBoundingClientRect();return{elem:{style:n,width:r.width,height:r.height,top:r.top,bottom:r.bottom,left:r.left,right:r.right,margin:nt(t,"margin",n),border:nt(t,"border",n)},parent:{style:c,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,padding:nt(e,"padding",c),border:nt(e,"border",c)}}}function E6(t){var e=t.ownerDocument,n=t.parentNode;return e&&n&&e.nodeType===9&&n.nodeType===1&&e.documentElement.contains(n)}function A6(t){return(t.getAttribute("class")||"").trim()}function k6(t,e){return t.nodeType===1&&" ".concat(A6(t)," ").indexOf(" ".concat(e," "))>-1}function O6(t,e){for(var n=t;n!=null;n=n.parentNode)if(k6(n,e.excludeClass)||e.exclude.indexOf(n)>-1)return!0;return!1}var T6=/^http:[\w\.\/]+svg$/;function P6(t){return T6.test(t.namespaceURI)&&t.nodeName.toLowerCase()!=="svg"}function L6(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var ue={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:function(t){t.preventDefault(),t.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:S6,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function de(t,e){if(!t)throw new Error("Panzoom requires an element as an argument");if(t.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!E6(t))throw new Error("Panzoom should be called on elements that have been attached to the DOM");e=c1(c1({},ue),e);var n=P6(t),c=t.parentNode;c.style.overflow=e.overflow,c.style.userSelect="none",c.style.touchAction=e.touchAction,(e.canvas?c:t).style.cursor=e.cursor,t.style.userSelect="none",t.style.touchAction=e.touchAction,v0(t,"transformOrigin",typeof e.origin=="string"?e.origin:n?"0 0":"50% 50%");function r(){c.style.overflow="",c.style.userSelect="",c.style.touchAction="",c.style.cursor="",t.style.cursor="",t.style.userSelect="",t.style.touchAction="",v0(t,"transformOrigin","")}function s(M){M===void 0&&(M={});for(var k in M)M.hasOwnProperty(k)&&(e[k]=M[k]);(M.hasOwnProperty("cursor")||M.hasOwnProperty("canvas"))&&(c.style.cursor=t.style.cursor="",(e.canvas?c:t).style.cursor=e.cursor),M.hasOwnProperty("overflow")&&(c.style.overflow=M.overflow),M.hasOwnProperty("touchAction")&&(c.style.touchAction=M.touchAction,t.style.touchAction=M.touchAction)}var i=0,o=0,a=1,u=!1;T(e.startScale,{animate:!1,force:!0}),setTimeout(function(){x(e.startX,e.startY,{animate:!1,force:!0})});function d(M,k,P){if(!P.silent){var I=new CustomEvent(M,{detail:k});t.dispatchEvent(I)}}function F(M,k,P){var I={x:i,y:o,scale:a,isSVG:n,originalEvent:P};return requestAnimationFrame(function(){typeof k.animate=="boolean"&&(k.animate?z6(t,k):v0(t,"transition","none")),k.setTransform(t,I,k),d(M,I,k),d("panzoomchange",I,k)}),I}function v(M,k,P,I){var z=c1(c1({},e),I),B={x:i,y:o,opts:z};if(!z.force&&(z.disablePan||z.panOnlyWhenZoomed&&a===z.startScale))return B;if(M=parseFloat(M),k=parseFloat(k),z.disableXAxis||(B.x=(z.relative?i:0)+M),z.disableYAxis||(B.y=(z.relative?o:0)+k),z.contain){var L=Vt(t),n1=L.elem.width/a,d1=L.elem.height/a,N1=n1*P,Y1=d1*P,_1=(N1-n1)/2,O1=(Y1-d1)/2;if(z.contain==="inside"){var C0=(-L.elem.margin.left-L.parent.padding.left+_1)/P,l=(L.parent.width-N1-L.parent.padding.left-L.elem.margin.left-L.parent.border.left-L.parent.border.right+_1)/P;B.x=Math.max(Math.min(B.x,l),C0);var f=(-L.elem.margin.top-L.parent.padding.top+O1)/P,h=(L.parent.height-Y1-L.parent.padding.top-L.elem.margin.top-L.parent.border.top-L.parent.border.bottom+O1)/P;B.y=Math.max(Math.min(B.y,h),f)}else if(z.contain==="outside"){var C0=(-(N1-L.parent.width)-L.parent.padding.left-L.parent.border.left-L.parent.border.right+_1)/P,l=(_1-L.parent.padding.left)/P;B.x=Math.max(Math.min(B.x,l),C0);var f=(-(Y1-L.parent.height)-L.parent.padding.top-L.parent.border.top-L.parent.border.bottom+O1)/P,h=(O1-L.parent.padding.top)/P;B.y=Math.max(Math.min(B.y,h),f)}}return z.roundPixels&&(B.x=Math.round(B.x),B.y=Math.round(B.y)),B}function S(M,k){var P=c1(c1({},e),k),I={scale:a,opts:P};if(!P.force&&P.disableZoom)return I;var z=e.minScale,B=e.maxScale;if(P.contain){var L=Vt(t),n1=L.elem.width/a,d1=L.elem.height/a;if(n1>1&&d1>1){var N1=L.parent.width-L.parent.border.left-L.parent.border.right,Y1=L.parent.height-L.parent.border.top-L.parent.border.bottom,_1=N1/n1,O1=Y1/d1;e.contain==="inside"?B=Math.min(B,_1,O1):e.contain==="outside"&&(z=Math.max(z,_1,O1))}}return I.scale=Math.min(Math.max(M,z),B),I}function x(M,k,P,I){var z=v(M,k,a,P);return i!==z.x||o!==z.y?(i=z.x,o=z.y,F("panzoompan",z.opts,I)):{x:i,y:o,scale:a,isSVG:n,originalEvent:I}}function T(M,k,P){var I=S(M,k),z=I.opts;if(!(!z.force&&z.disableZoom)){M=I.scale;var B=i,L=o;if(z.focal){var n1=z.focal;B=(n1.x/M-n1.x/a+i*M)/M,L=(n1.y/M-n1.y/a+o*M)/M}var d1=v(B,L,M,{relative:!1,force:!0});return i=d1.x,o=d1.y,a=M,F("panzoomzoom",z,P)}}function G(M,k){var P=c1(c1(c1({},e),{animate:!0}),k);return T(a*Math.exp((M?1:-1)*P.step),P)}function W(M){return G(!0,M)}function U(M){return G(!1,M)}function j(M,k,P,I){var z=Vt(t),B={width:z.parent.width-z.parent.padding.left-z.parent.padding.right-z.parent.border.left-z.parent.border.right,height:z.parent.height-z.parent.padding.top-z.parent.padding.bottom-z.parent.border.top-z.parent.border.bottom},L=k.clientX-z.parent.left-z.parent.padding.left-z.parent.border.left-z.elem.margin.left,n1=k.clientY-z.parent.top-z.parent.padding.top-z.parent.border.top-z.elem.margin.top;n||(L-=z.elem.width/a/2,n1-=z.elem.height/a/2);var d1={x:L/B.width*(B.width*M),y:n1/B.height*(B.height*M)};return T(M,c1(c1({},P),{animate:!1,focal:d1}),I)}function t1(M,k){M.preventDefault();var P=c1(c1(c1({},e),k),{animate:!1}),I=M.deltaY===0&&M.deltaX?M.deltaX:M.deltaY,z=I<0?1:-1,B=S(a*Math.exp(z*P.step/3),P).scale;return j(B,M,P,M)}function g1(M){var k=c1(c1(c1({},e),{animate:!0,force:!0}),M);a=S(k.startScale,k).scale;var P=v(k.startX,k.startY,a,k);return i=P.x,o=P.y,F("panzoomreset",k)}var N,C1,f1,G1,A1,k1,u1=[];function W1(M){if(!O6(M.target,e)){Zt(u1,M),u=!0,e.handleStartEvent(M),N=i,C1=o,d("panzoomstart",{x:i,y:o,scale:a,isSVG:n,originalEvent:M},e);var k=s3(u1);f1=k.clientX,G1=k.clientY,A1=a,k1=Lt(u1)}}function s0(M){if(!(!u||N===void 0||C1===void 0||f1===void 0||G1===void 0)){Zt(u1,M);var k=s3(u1),P=u1.length>1,I=a;if(P){k1===0&&(k1=Lt(u1));var z=Lt(u1)-k1;I=S(z*e.step/80+A1).scale,j(I,k,{animate:!1},M)}(!P||e.pinchAndPan)&&x(N+(k.clientX-f1)/I,C1+(k.clientY-G1)/I,{animate:!1},M)}}function g0(M){u1.length===1&&d("panzoomend",{x:i,y:o,scale:a,isSVG:n,originalEvent:M},e),w6(u1,M),u&&(u=!1,N=C1=f1=G1=void 0)}var e1=!1;function X(){e1||(e1=!0,$t("down",e.canvas?c:t,W1),$t("move",document,s0,{passive:!0}),$t("up",document,g0,{passive:!0}))}function Y(){e1=!1,Rt("down",e.canvas?c:t,W1),Rt("move",document,s0),Rt("up",document,g0)}return e.noBind||X(),{bind:X,destroy:Y,eventNames:j0,getPan:function(){return{x:i,y:o}},getScale:function(){return a},getOptions:function(){return L6(e)},handleDown:W1,handleMove:s0,handleUp:g0,pan:x,reset:g1,resetStyle:r,setOptions:s,setStyle:function(M,k){return v0(t,M,k)},zoom:T,zoomIn:W,zoomOut:U,zoomToPoint:j,zoomWithWheel:t1}}de.defaultOptions=ue;const $6=K0({__name:"Canvas",setup(t){const e=B1(),n=B1();return N3(()=>{const c=de(e.value);e.value.addEventListener("wheel",r=>{c.zoomWithWheel(r)}),p1.init(n,c)}),(c,r)=>($1(),j1("div",{ref_key:"canvas",ref:e,class:"canvas"},[q("div",{ref_key:"svg",ref:n},null,512)],512))}}),R6=wt($6,[["__scopeId","data-v-d4935a7c"]]),I6={class:"root"},V6=K0({__name:"App",setup(t){return(e,n)=>($1(),j1("div",I6,[i1(R6),i1(y6)]))}}),N6=wt(V6,[["__scopeId","data-v-6d3b68f8"]]);j5(N6).mount("#app");export{S1 as F,p1 as S,G5 as _,$1 as a,j1 as b,qt as c,K0 as d,q as e,P2 as f,s5 as g,o4 as h,wt as i,N3 as o,i4 as p,B1 as r,$0 as t,R5 as v,zt as w}; + ${n}`),n}}isSVGUrl(e){try{const n=new URL(e);return["http:","https:"].includes(n.protocol)?/\.svg$/i.test(n.pathname):!1}catch{return!1}}corruptSvg(){var i;if(this.disableCorrupt)return;const e=(i=this.svgElement)==null?void 0:i.value.querySelector("svg");if(!e)return;const n=e.querySelectorAll("path"),c=this.originalSvgNode.querySelectorAll("path"),r=Math.min(n.length,c.length),s=this.currentCorruptionMode.function;for(let o=0;o{n.active=n.id===e})}async exportSvgToPng(){var a;const e=(a=this.svgElement)==null?void 0:a.value.querySelector("svg");if(!e)return;const n=document.createElement("canvas"),c=n.getContext("2d");if(!c)return;const r=new XMLSerializer().serializeToString(e),s=new Blob([r],{type:"image/svg+xml;charset=utf-8"}),i=URL.createObjectURL(s),o=new Image;o.onload=()=>{n.width=e.clientWidth,n.height=e.clientHeight,c.drawImage(o,0,0),URL.revokeObjectURL(i),n.toBlob(u=>{if(u){const d=document.createElement("a");d.href=URL.createObjectURL(u),d.download="corrupted.png",d.click(),URL.revokeObjectURL(d.href)}},"image/png")},o.src=i}}const p1=new Q5,t6={class:"input-slider"},e6=["for"],n6=["id","value"],c6=K0({__name:"RangeSlider",props:{modelValue:{},label:{},id:{}},emits:["update:modelValue"],setup(t,{emit:e}){const n=e,c=r=>{const s=r.target;n("update:modelValue",s.value)};return(r,s)=>($1(),j1("div",t6,[q("label",{for:r.id},$0(r.label)+": "+$0(r.modelValue),9,e6),q("input",ie({id:r.id},r.$attrs,{value:r.modelValue,onInput:c}),null,16,n6)]))}}),wt=(t,e)=>{const n=t.__vccOpts||t;for(const[c,r]of e)n[c]=r;return n},r6=wt(c6,[["__scopeId","data-v-f1f6fa04"]]),F2=t=>(i4("data-v-f5ef8259"),t=t(),o4(),t),s6={class:"panel"},i6={class:"panel__inner"},o6={class:"panel__section"},l6=F2(()=>q("div",null,[q("label",{for:"svg-input"},"SVG string or URL")],-1)),a6={class:"panel__section"},f6=F2(()=>q("span",null,"Corruption mode",-1)),u6=["value"],d6={key:0,class:"panel__section"},h6=F2(()=>q("span",null,"Target Values",-1)),p6={class:"section__target-values"},g6=["for"],C6=["id","value","onUpdate:modelValue"],m6={class:"panel__section"},F6={class:"panel__section"},v6={class:"section__corrupt-buttons"},_6={class:"panel__section"},M6=K0({__name:"Panel",setup(t){const e=B1(""),n=B1(new Array(10).fill(!1)),c=B1(0),r=p1.corruptionModes,s=a4(()=>G5(()=>import("./EmojiPicker-DW7ClCTU.js"),__vite__mapDeps([0,1]))),i=async()=>{const F=await W5();await p1.loadFromString(F)},o=()=>{p1.setTargetValues(n.value),p1.corruptSvg()},a=()=>{p1.setReplaceValue(c.value),p1.corruptSvg()},u=qt({get(){return p1.currentCorruptionMode.id},set(F){p1.setCorruptionMode(F),p1.corruptSvg()}}),d=qt(()=>p1.currentCorruptionMode);return ot(e,()=>{p1.loadFromString(e.value)}),(F,v)=>{var S;return $1(),j1("div",s6,[q("div",i6,[q("div",o6,[q("div",{class:"input"},[l6,q("button",{class:"file-select",onClick:i},"Upload SVG")]),zt(q("input",{"onUpdate:modelValue":v[0]||(v[0]=x=>e.value=x),id:"svg-input",type:"text"},null,512),[[R5,e.value]])]),q("div",a6,[f6,q("div",null,[zt(q("select",{"onUpdate:modelValue":v[1]||(v[1]=x=>u.value=x)},[($1(!0),j1(S1,null,P2(F0(r),x=>($1(),j1("option",{key:x.id,value:x.id},$0(x.name),9,u6))),128))],512),[[V5,u.value]])])]),(S=d.value)!=null&&S.random?s5("",!0):($1(),j1("div",d6,[h6,q("div",p6,[($1(!0),j1(S1,null,P2(n.value,(x,T)=>($1(),j1("label",{for:"target-values-"+T},[zt(q("input",{id:"target-values-"+T,type:"checkbox",value:n.value[T],"onUpdate:modelValue":G=>n.value[T]=G,onChange:o},null,40,C6),[[I5,n.value[T]]]),se(" "+$0(T),1)],8,g6))),256))])])),q("div",m6,[i1(r6,{modelValue:c.value,"onUpdate:modelValue":v[2]||(v[2]=x=>c.value=x),label:d.value.name,id:"replace-value",step:"1",max:"100",min:"0",type:"range",onInput:a},null,8,["modelValue","label"])]),q("div",F6,[q("div",v6,[q("button",{class:"corrupt",onClick:v[3]||(v[3]=x=>F0(p1).corruptSvg())}," Corrupt SVG "),q("button",{class:"reset",onClick:v[4]||(v[4]=x=>F0(p1).resetSvg())}," Reset SVG "),q("button",{class:"download",onClick:v[5]||(v[5]=x=>F0(p1).exportSvgToPng())}," Download PNG ")])]),q("div",_6,[i1(F0(s))])])])}}}),y6=wt(M6,[["__scopeId","data-v-f5ef8259"]]);var c1=function(){return c1=Object.assign||function(e){for(var n,c=1,r=arguments.length;c-1&&t.splice(n,1),t.push(e)}function w6(t,e){if(e.touches){for(;t.length;)t.pop();return}var n=fe(t,e);n>-1&&t.splice(n,1)}function s3(t){t=t.slice(0);for(var e=t.pop(),n;n=t.pop();)e={clientX:(n.clientX-e.clientX)/2+e.clientX,clientY:(n.clientY-e.clientY)/2+e.clientY};return e}function Lt(t){if(t.length<2)return 0;var e=t[0],n=t[1];return Math.sqrt(Math.pow(Math.abs(n.clientX-e.clientX),2)+Math.pow(Math.abs(n.clientY-e.clientY),2))}var j0={down:"mousedown",move:"mousemove",up:"mouseup mouseleave"};typeof window<"u"&&(typeof window.PointerEvent=="function"?j0={down:"pointerdown",move:"pointermove",up:"pointerup pointerleave pointercancel"}:typeof window.TouchEvent=="function"&&(j0={down:"touchstart",move:"touchmove",up:"touchend touchcancel"}));function $t(t,e,n,c){j0[t].split(" ").forEach(function(r){e.addEventListener(r,n,c)})}function Rt(t,e,n){j0[t].split(" ").forEach(function(c){e.removeEventListener(c,n)})}var b6=typeof document<"u"&&!!document.documentMode,It;function x6(){return It||(It=document.createElement("div").style)}var i3=["webkit","moz","ms"],tt={};function v2(t){if(tt[t])return tt[t];var e=x6();if(t in e)return tt[t]=t;for(var n=t[0].toUpperCase()+t.slice(1),c=i3.length;c--;){var r="".concat(i3[c]).concat(n);if(r in e)return tt[t]=r}}function et(t,e){return parseFloat(e[v2(t)])||0}function nt(t,e,n){n===void 0&&(n=window.getComputedStyle(t));var c=e==="border"?"Width":"";return{left:et("".concat(e,"Left").concat(c),n),right:et("".concat(e,"Right").concat(c),n),top:et("".concat(e,"Top").concat(c),n),bottom:et("".concat(e,"Bottom").concat(c),n)}}function v0(t,e,n){t.style[v2(e)]=n}function z6(t,e){var n=v2("transform");v0(t,"transition","".concat(n," ").concat(e.duration,"ms ").concat(e.easing))}function S6(t,e,n){var c=e.x,r=e.y,s=e.scale,i=e.isSVG;if(v0(t,"transform","scale(".concat(s,") translate(").concat(c,"px, ").concat(r,"px)")),i&&b6){var o=window.getComputedStyle(t).getPropertyValue("transform");t.setAttribute("transform",o)}}function Vt(t){var e=t.parentNode,n=window.getComputedStyle(t),c=window.getComputedStyle(e),r=t.getBoundingClientRect(),s=e.getBoundingClientRect();return{elem:{style:n,width:r.width,height:r.height,top:r.top,bottom:r.bottom,left:r.left,right:r.right,margin:nt(t,"margin",n),border:nt(t,"border",n)},parent:{style:c,width:s.width,height:s.height,top:s.top,bottom:s.bottom,left:s.left,right:s.right,padding:nt(e,"padding",c),border:nt(e,"border",c)}}}function E6(t){var e=t.ownerDocument,n=t.parentNode;return e&&n&&e.nodeType===9&&n.nodeType===1&&e.documentElement.contains(n)}function A6(t){return(t.getAttribute("class")||"").trim()}function k6(t,e){return t.nodeType===1&&" ".concat(A6(t)," ").indexOf(" ".concat(e," "))>-1}function O6(t,e){for(var n=t;n!=null;n=n.parentNode)if(k6(n,e.excludeClass)||e.exclude.indexOf(n)>-1)return!0;return!1}var T6=/^http:[\w\.\/]+svg$/;function P6(t){return T6.test(t.namespaceURI)&&t.nodeName.toLowerCase()!=="svg"}function L6(t){var e={};for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e}var ue={animate:!1,canvas:!1,cursor:"move",disablePan:!1,disableZoom:!1,disableXAxis:!1,disableYAxis:!1,duration:200,easing:"ease-in-out",exclude:[],excludeClass:"panzoom-exclude",handleStartEvent:function(t){t.preventDefault(),t.stopPropagation()},maxScale:4,minScale:.125,overflow:"hidden",panOnlyWhenZoomed:!1,pinchAndPan:!1,relative:!1,setTransform:S6,startX:0,startY:0,startScale:1,step:.3,touchAction:"none"};function de(t,e){if(!t)throw new Error("Panzoom requires an element as an argument");if(t.nodeType!==1)throw new Error("Panzoom requires an element with a nodeType of 1");if(!E6(t))throw new Error("Panzoom should be called on elements that have been attached to the DOM");e=c1(c1({},ue),e);var n=P6(t),c=t.parentNode;c.style.overflow=e.overflow,c.style.userSelect="none",c.style.touchAction=e.touchAction,(e.canvas?c:t).style.cursor=e.cursor,t.style.userSelect="none",t.style.touchAction=e.touchAction,v0(t,"transformOrigin",typeof e.origin=="string"?e.origin:n?"0 0":"50% 50%");function r(){c.style.overflow="",c.style.userSelect="",c.style.touchAction="",c.style.cursor="",t.style.cursor="",t.style.userSelect="",t.style.touchAction="",v0(t,"transformOrigin","")}function s(M){M===void 0&&(M={});for(var k in M)M.hasOwnProperty(k)&&(e[k]=M[k]);(M.hasOwnProperty("cursor")||M.hasOwnProperty("canvas"))&&(c.style.cursor=t.style.cursor="",(e.canvas?c:t).style.cursor=e.cursor),M.hasOwnProperty("overflow")&&(c.style.overflow=M.overflow),M.hasOwnProperty("touchAction")&&(c.style.touchAction=M.touchAction,t.style.touchAction=M.touchAction)}var i=0,o=0,a=1,u=!1;T(e.startScale,{animate:!1,force:!0}),setTimeout(function(){x(e.startX,e.startY,{animate:!1,force:!0})});function d(M,k,P){if(!P.silent){var I=new CustomEvent(M,{detail:k});t.dispatchEvent(I)}}function F(M,k,P){var I={x:i,y:o,scale:a,isSVG:n,originalEvent:P};return requestAnimationFrame(function(){typeof k.animate=="boolean"&&(k.animate?z6(t,k):v0(t,"transition","none")),k.setTransform(t,I,k),d(M,I,k),d("panzoomchange",I,k)}),I}function v(M,k,P,I){var z=c1(c1({},e),I),B={x:i,y:o,opts:z};if(!z.force&&(z.disablePan||z.panOnlyWhenZoomed&&a===z.startScale))return B;if(M=parseFloat(M),k=parseFloat(k),z.disableXAxis||(B.x=(z.relative?i:0)+M),z.disableYAxis||(B.y=(z.relative?o:0)+k),z.contain){var L=Vt(t),n1=L.elem.width/a,d1=L.elem.height/a,N1=n1*P,Y1=d1*P,_1=(N1-n1)/2,O1=(Y1-d1)/2;if(z.contain==="inside"){var C0=(-L.elem.margin.left-L.parent.padding.left+_1)/P,l=(L.parent.width-N1-L.parent.padding.left-L.elem.margin.left-L.parent.border.left-L.parent.border.right+_1)/P;B.x=Math.max(Math.min(B.x,l),C0);var f=(-L.elem.margin.top-L.parent.padding.top+O1)/P,h=(L.parent.height-Y1-L.parent.padding.top-L.elem.margin.top-L.parent.border.top-L.parent.border.bottom+O1)/P;B.y=Math.max(Math.min(B.y,h),f)}else if(z.contain==="outside"){var C0=(-(N1-L.parent.width)-L.parent.padding.left-L.parent.border.left-L.parent.border.right+_1)/P,l=(_1-L.parent.padding.left)/P;B.x=Math.max(Math.min(B.x,l),C0);var f=(-(Y1-L.parent.height)-L.parent.padding.top-L.parent.border.top-L.parent.border.bottom+O1)/P,h=(O1-L.parent.padding.top)/P;B.y=Math.max(Math.min(B.y,h),f)}}return z.roundPixels&&(B.x=Math.round(B.x),B.y=Math.round(B.y)),B}function S(M,k){var P=c1(c1({},e),k),I={scale:a,opts:P};if(!P.force&&P.disableZoom)return I;var z=e.minScale,B=e.maxScale;if(P.contain){var L=Vt(t),n1=L.elem.width/a,d1=L.elem.height/a;if(n1>1&&d1>1){var N1=L.parent.width-L.parent.border.left-L.parent.border.right,Y1=L.parent.height-L.parent.border.top-L.parent.border.bottom,_1=N1/n1,O1=Y1/d1;e.contain==="inside"?B=Math.min(B,_1,O1):e.contain==="outside"&&(z=Math.max(z,_1,O1))}}return I.scale=Math.min(Math.max(M,z),B),I}function x(M,k,P,I){var z=v(M,k,a,P);return i!==z.x||o!==z.y?(i=z.x,o=z.y,F("panzoompan",z.opts,I)):{x:i,y:o,scale:a,isSVG:n,originalEvent:I}}function T(M,k,P){var I=S(M,k),z=I.opts;if(!(!z.force&&z.disableZoom)){M=I.scale;var B=i,L=o;if(z.focal){var n1=z.focal;B=(n1.x/M-n1.x/a+i*M)/M,L=(n1.y/M-n1.y/a+o*M)/M}var d1=v(B,L,M,{relative:!1,force:!0});return i=d1.x,o=d1.y,a=M,F("panzoomzoom",z,P)}}function G(M,k){var P=c1(c1(c1({},e),{animate:!0}),k);return T(a*Math.exp((M?1:-1)*P.step),P)}function W(M){return G(!0,M)}function U(M){return G(!1,M)}function j(M,k,P,I){var z=Vt(t),B={width:z.parent.width-z.parent.padding.left-z.parent.padding.right-z.parent.border.left-z.parent.border.right,height:z.parent.height-z.parent.padding.top-z.parent.padding.bottom-z.parent.border.top-z.parent.border.bottom},L=k.clientX-z.parent.left-z.parent.padding.left-z.parent.border.left-z.elem.margin.left,n1=k.clientY-z.parent.top-z.parent.padding.top-z.parent.border.top-z.elem.margin.top;n||(L-=z.elem.width/a/2,n1-=z.elem.height/a/2);var d1={x:L/B.width*(B.width*M),y:n1/B.height*(B.height*M)};return T(M,c1(c1({},P),{animate:!1,focal:d1}),I)}function t1(M,k){M.preventDefault();var P=c1(c1(c1({},e),k),{animate:!1}),I=M.deltaY===0&&M.deltaX?M.deltaX:M.deltaY,z=I<0?1:-1,B=S(a*Math.exp(z*P.step/3),P).scale;return j(B,M,P,M)}function g1(M){var k=c1(c1(c1({},e),{animate:!0,force:!0}),M);a=S(k.startScale,k).scale;var P=v(k.startX,k.startY,a,k);return i=P.x,o=P.y,F("panzoomreset",k)}var N,C1,f1,G1,A1,k1,u1=[];function W1(M){if(!O6(M.target,e)){Zt(u1,M),u=!0,e.handleStartEvent(M),N=i,C1=o,d("panzoomstart",{x:i,y:o,scale:a,isSVG:n,originalEvent:M},e);var k=s3(u1);f1=k.clientX,G1=k.clientY,A1=a,k1=Lt(u1)}}function s0(M){if(!(!u||N===void 0||C1===void 0||f1===void 0||G1===void 0)){Zt(u1,M);var k=s3(u1),P=u1.length>1,I=a;if(P){k1===0&&(k1=Lt(u1));var z=Lt(u1)-k1;I=S(z*e.step/80+A1).scale,j(I,k,{animate:!1},M)}(!P||e.pinchAndPan)&&x(N+(k.clientX-f1)/I,C1+(k.clientY-G1)/I,{animate:!1},M)}}function g0(M){u1.length===1&&d("panzoomend",{x:i,y:o,scale:a,isSVG:n,originalEvent:M},e),w6(u1,M),u&&(u=!1,N=C1=f1=G1=void 0)}var e1=!1;function X(){e1||(e1=!0,$t("down",e.canvas?c:t,W1),$t("move",document,s0,{passive:!0}),$t("up",document,g0,{passive:!0}))}function Y(){e1=!1,Rt("down",e.canvas?c:t,W1),Rt("move",document,s0),Rt("up",document,g0)}return e.noBind||X(),{bind:X,destroy:Y,eventNames:j0,getPan:function(){return{x:i,y:o}},getScale:function(){return a},getOptions:function(){return L6(e)},handleDown:W1,handleMove:s0,handleUp:g0,pan:x,reset:g1,resetStyle:r,setOptions:s,setStyle:function(M,k){return v0(t,M,k)},zoom:T,zoomIn:W,zoomOut:U,zoomToPoint:j,zoomWithWheel:t1}}de.defaultOptions=ue;const $6=K0({__name:"Canvas",setup(t){const e=B1(),n=B1();return N3(()=>{const c=de(e.value);e.value.addEventListener("wheel",r=>{c.zoomWithWheel(r)}),p1.init(n,c)}),(c,r)=>($1(),j1("div",{ref_key:"canvas",ref:e,class:"canvas"},[q("div",{ref_key:"svg",ref:n},null,512)],512))}}),R6=wt($6,[["__scopeId","data-v-d4935a7c"]]),I6={class:"root"},V6=K0({__name:"App",setup(t){return(e,n)=>($1(),j1("div",I6,[i1(R6),i1(y6)]))}}),N6=wt(V6,[["__scopeId","data-v-6d3b68f8"]]);j5(N6).mount("#app");export{S1 as F,p1 as S,G5 as _,$1 as a,j1 as b,qt as c,K0 as d,q as e,P2 as f,s5 as g,o4 as h,wt as i,N3 as o,i4 as p,B1 as r,$0 as t,R5 as v,zt as w}; diff --git a/index.html b/index.html index 57f44d9..4e20de4 100644 --- a/index.html +++ b/index.html @@ -2,11 +2,11 @@ - + Vite + Vue + TS - - + +