"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var n=require("vue-demi");const o={"<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#039;","&":"&amp;"};let e=0;var t=n=>n.replace(/[<>"&]/g,(n=>o[n]||n)),v=n=>n+e++;const r={},i=n=>{const{name:o,paths:e=[],d:t,polygons:v=[],points:i}=n;t&&e.push({d:t}),i&&v.push({points:i}),r[o]=Object.assign({},n,{paths:e,polygons:v}),r[o].minX||(r[o].minX=0),r[o].minY||(r[o].minY=0)},a=n.defineComponent({name:"OhVueIcon",props:{name:{type:String,validator:n=>!n||n in r||(console.warn(`Invalid prop: prop "name" is referring to an unregistered icon "${n}".\nPlease make sure you have imported this icon before using it.`),!1)},title:String,fill:String,scale:{type:[Number,String],default:1},animation:{validator:n=>["spin","spin-pulse","wrench","ring","pulse","flash","float"].includes(n)},hover:Boolean,flip:{validator:n=>["horizontal","vertical","both"].includes(n)},speed:{validator:n=>"fast"===n||"slow"===n},label:String,inverse:Boolean},setup(o){const e=n.ref([]),t=n.reactive({outerScale:1.2,x:null,y:null}),i=n.reactive({width:0,height:0}),a=n.computed((()=>{const n=Number(o.scale);return isNaN(n)||n<=0?(console.warn('Invalid prop: prop "scale" should be a number over 0.'),t.outerScale):n*t.outerScale})),s=n.computed((()=>({"ov-icon":!0,"ov-inverse":o.inverse,"ov-flip-horizontal":"horizontal"===o.flip,"ov-flip-vertical":"vertical"===o.flip,"ov-flip-both":"both"===o.flip,"ov-spin":"spin"===o.animation,"ov-spin-pulse":"spin-pulse"===o.animation,"ov-wrench":"wrench"===o.animation,"ov-ring":"ring"===o.animation,"ov-pulse":"pulse"===o.animation,"ov-flash":"flash"===o.animation,"ov-float":"float"===o.animation,"ov-hover":o.hover,"ov-fast":"fast"===o.speed,"ov-slow":"slow"===o.speed}))),l=n.computed((()=>o.name?r[o.name]:null)),h=n.computed((()=>l.value?`${l.value.minX} ${l.value.minY} ${l.value.width} ${l.value.height}`:`0 0 ${f.value} ${u.value}`)),p=n.computed((()=>{if(!l.value)return 1;const{width:n,height:o}=l.value;return Math.max(n,o)/16})),f=n.computed((()=>i.width||l.value&&l.value.width/p.value*a.value||0)),u=n.computed((()=>i.height||l.value&&l.value.height/p.value*a.value||0)),m=n.computed((()=>1!==a.value&&{fontSize:a.value+"em"})),c=n.computed((()=>{if(!l.value||!l.value.raw)return null;const n={};let o=l.value.raw;return o=o.replace(/\s(?:xml:)?id=(["']?)([^"')\s]+)\1/g,((o,e,t)=>{const r=v("vat-");return n[t]=r,` id="${r}"`})),o=o.replace(/#(?:([^'")\s]+)|xpointer\(id\((['"]?)([^')]+)\2\)\))/g,((o,e,t,v)=>{const r=e||v;return r&&n[r]?`#${n[r]}`:o})),o})),d=n.computed((()=>l.value&&l.value.attr?l.value.attr:{})),g=()=>{if(!o.name&&null!==o.name&&0===e.value.length)return void console.warn('Invalid prop: prop "name" is required.');if(l.value)return;let n=0,t=0;e.value.forEach((o=>{o.outerScale=a.value,n=Math.max(n,o.width),t=Math.max(t,o.height)})),i.width=n,i.height=t,e.value.forEach((o=>{o.x=(n-o.width)/2,o.y=(t-o.height)/2}))};return n.onMounted((()=>{g()})),n.onUpdated((()=>{g()})),{...n.toRefs(t),children:e,icon:l,klass:s,style:m,width:f,height:u,box:h,attribs:d,raw:c}},created(){const n=this.$parent;n&&n.children&&n.children.push(this)},render(){const o=Object.assign({role:this.$attrs.role||(this.label||this.title?"img":null),"aria-label":this.label||null,"aria-hidden":!(this.label||this.title),width:this.width,height:this.height,viewBox:this.box},this.attribs);this.attribs.stroke?o.stroke=this.fill?this.fill:"currentColor":o.fill=this.fill?this.fill:"currentColor",this.x&&(o.x=this.x.toString()),this.y&&(o.y=this.y.toString());let e={class:this.klass,style:this.style};if(n.isVue2?e.attrs=o:e=Object.assign(e,o),this.raw){const o=this.title?`<title>${t(this.title)}</title>${this.raw}`:this.raw;n.isVue2?e.domProps={innerHTML:o}:e.innerHTML=o}const v=this.title?[n.h("title",this.title)]:[],r=(o,e,t)=>n.isVue2?n.h(o,{attrs:e,key:`${o}-${t}`}):n.h(o,{...e,key:`${o}-${t}`});return n.h("svg",e,this.raw?void 0:v.concat([this.$slots.default?n.isVue2?this.$slots.default:this.$slots.default():this.icon?[...this.icon.paths.map(((n,o)=>r("path",n,o))),...this.icon.polygons.map(((n,o)=>r("polygon",n,o)))]:[]]))}});function s(n,o){void 0===o&&(o={});var e=o.insertAt;if(n&&"undefined"!=typeof document){var t=document.head||document.getElementsByTagName("head")[0],v=document.createElement("style");v.type="text/css","top"===e&&t.firstChild?t.insertBefore(v,t.firstChild):t.appendChild(v),v.styleSheet?v.styleSheet.cssText=n:v.appendChild(document.createTextNode(n))}}s(".ov-icon {\n  display: inline-block;\n  overflow: visible;\n  vertical-align: -0.2em;\n}\n");s("/* ---------------- spin ---------------- */\n.ov-spin:not(.ov-hover),\n.ov-spin.ov-hover:hover,\n.ov-parent.ov-hover:hover > .ov-spin {\n  animation: ov-spin 1s linear infinite;\n}\n\n.ov-spin:not(.ov-hover).ov-fast,\n.ov-spin.ov-hover.ov-fast:hover,\n.ov-parent.ov-hover:hover > .ov-spin.ov-fast {\n  animation: ov-spin 0.7s linear infinite;\n}\n\n.ov-spin:not(.ov-hover).ov-slow,\n.ov-spin.ov-hover.ov-slow:hover,\n.ov-parent.ov-hover:hover > .ov-spin.ov-slow {\n  animation: ov-spin 2s linear infinite;\n}\n\n/* ---------------- spin-pulse ---------------- */\n\n.ov-spin-pulse:not(.ov-hover),\n.ov-spin-pulse.ov-hover:hover,\n.ov-parent.ov-hover:hover > .ov-spin-pulse {\n  animation: ov-spin 1s infinite steps(8);\n}\n\n.ov-spin-pulse:not(.ov-hover).ov-fast,\n.ov-spin-pulse.ov-hover.ov-fast:hover,\n.ov-parent.ov-hover:hover > .ov-spin-pulse.ov-fast {\n  animation: ov-spin 0.7s infinite steps(8);\n}\n\n.ov-spin-pulse:not(.ov-hover).ov-slow,\n.ov-spin-pulse.ov-hover.ov-slow:hover,\n.ov-parent.ov-hover:hover > .ov-spin-pulse.ov-slow {\n  animation: ov-spin 2s infinite steps(8);\n}\n\n@keyframes ov-spin {\n  0% {\n    transform: rotate(0deg);\n  }\n  100% {\n    transform: rotate(360deg);\n  }\n}\n\n/* ---------------- wrench ---------------- */\n.ov-wrench:not(.ov-hover),\n.ov-wrench.ov-hover:hover,\n.ov-parent.ov-hover:hover > .ov-wrench {\n  animation: ov-wrench 2.5s ease infinite;\n}\n\n.ov-wrench:not(.ov-hover).ov-fast,\n.ov-wrench.ov-hover.ov-fast:hover,\n.ov-parent.ov-hover:hover > .ov-wrench.ov-fast {\n  animation: ov-wrench 1.2s ease infinite;\n}\n\n.ov-wrench:not(.ov-hover).ov-slow,\n.ov-wrench.ov-hover.ov-slow:hover,\n.ov-parent.ov-hover:hover > .ov-wrench.ov-slow {\n  animation: ov-wrench 3.7s ease infinite;\n}\n\n@keyframes ov-wrench {\n  0% {\n    transform: rotate(-12deg);\n  }\n\n  8% {\n    transform: rotate(12deg);\n  }\n\n  10%, 28%, 30%, 48%, 50%, 68% {\n    transform: rotate(24deg);\n  }\n\n  18%, 20%, 38%, 40%, 58%, 60% {\n    transform: rotate(-24deg);\n  }\n\n  75%, 100% {\n    transform: rotate(0deg);\n  }\n}\n\n/* ---------------- ring ---------------- */\n.ov-ring:not(.ov-hover),\n.ov-ring.ov-hover:hover,\n.ov-parent.ov-hover:hover > .ov-ring {\n  animation: ov-ring 2s ease infinite;\n}\n\n.ov-ring:not(.ov-hover).ov-fast,\n.ov-ring.ov-hover.ov-fast:hover,\n.ov-parent.ov-hover:hover > .ov-ring.ov-fast {\n  animation: ov-ring 1s ease infinite;\n}\n\n.ov-ring:not(.ov-hover).ov-slow,\n.ov-ring.ov-hover.ov-slow:hover,\n.ov-parent.ov-hover:hover > .ov-ring.ov-slow {\n  animation: ov-ring 3s ease infinite;\n}\n\n@keyframes ov-ring {\n  0% {\n    transform: rotate(-15deg);\n  }\n\n  2% {\n    transform: rotate(15deg);\n  }\n\n  4%, 12% {\n    transform: rotate(-18deg);\n  }\n\n  6% {\n    transform: rotate(18deg);\n  }\n\n  8% {\n    transform: rotate(-22deg);\n  }\n\n  10% {\n    transform: rotate(22deg);\n  }\n\n  12% {\n    transform: rotate(-18deg);\n  }\n\n  14% {\n    transform: rotate(18deg);\n  }\n\n  16% {\n    transform: rotate(-12deg);\n  }\n\n  18% {\n    transform: rotate(12deg);\n  }\n\n  20%, 100% {\n    transform: rotate(0deg);\n  }\n}\n\n/* ---------------- pulse ---------------- */\n.ov-pulse:not(.ov-hover),\n.ov-pulse.ov-hover:hover,\n.ov-parent.ov-hover:hover > .ov-pulse {\n  animation: ov-pulse 2s linear infinite;\n}\n\n.ov-pulse:not(.ov-hover).ov-fast,\n.ov-pulse.ov-hover.ov-fast:hover,\n.ov-parent.ov-hover:hover > .ov-pulse.ov-fast {\n  animation: ov-pulse 1s linear infinite;\n}\n\n.ov-pulse:not(.ov-hover).ov-slow,\n.ov-pulse.ov-hover.ov-slow:hover,\n.ov-parent.ov-hover:hover > .ov-pulse.ov-slow {\n  animation: ov-pulse 3s linear infinite;\n}\n\n@keyframes ov-pulse {\n  0% {\n    transform: scale(1.1);\n  }\n\n  50% {\n    transform: scale(0.8);\n  }\n\n  100% {\n    transform: scale(1.1);\n  }\n}\n\n/* ---------------- flash ---------------- */\n.ov-flash:not(.ov-hover),\n.ov-flash.ov-hover:hover,\n.ov-parent.ov-hover:hover > .ov-flash {\n  animation: ov-flash 2s ease infinite;\n}\n\n.ov-flash:not(.ov-hover).ov-fast,\n.ov-flash.ov-hover.ov-fast:hover,\n.ov-parent.ov-hover:hover > .ov-flash.ov-fast {\n  animation: ov-flash 1s ease infinite;\n}\n\n.ov-flash:not(.ov-hover).ov-slow,\n.ov-flash.ov-hover.ov-slow:hover,\n.ov-parent.ov-hover:hover > .ov-flash.ov-slow {\n  animation: ov-flash 3s ease infinite;\n}\n\n@keyframes ov-flash {\n  0%, 100%, 50%{\n    opacity: 1;\n  }\n  25%, 75%{\n    opacity: 0;\n  }\n}\n\n/* ---------------- float ---------------- */\n.ov-float:not(.ov-hover),\n.ov-float.ov-hover:hover,\n.ov-parent.ov-hover:hover > .ov-float {\n  animation: ov-float 2s linear infinite;\n}\n\n.ov-float:not(.ov-hover).ov-fast,\n.ov-float.ov-hover.ov-fast:hover,\n.ov-parent.ov-hover:hover > .ov-float.ov-fast {\n  animation: ov-float 1s linear infinite;\n}\n\n.ov-float:not(.ov-hover).ov-slow,\n.ov-float.ov-hover.ov-slow:hover,\n.ov-parent.ov-hover:hover > .ov-float.ov-slow {\n  animation: ov-float 3s linear infinite;\n}\n\n@keyframes ov-float {\n  0%, 100% {\n    transform: translateY(-3px);\n  }\n  50% {\n    transform: translateY(3px);\n  }\n}\n");s(".ov-flip-horizontal {\n  transform: scale(-1, 1);\n}\n\n.ov-flip-vertical {\n  transform: scale(1, -1);\n}\n\n.ov-flip-both {\n  transform: scale(-1, -1);\n}\n\n.ov-inverse {\n  color: #fff;\n}\n"),exports.OhVueIcon=a,exports.addIcons=(...n)=>{for(const o of n)i(o)},exports.listIcons=()=>r;
//# sourceMappingURL=index.cjs.min.js.map
