"use strict";const t=require("vue"),d={transform:"rotate(var(--r, 0deg)) scale(var(--sx, 1), var(--sy, 1))"},l={mdi:{size:24,viewbox:"0 0 24 24"},"simple-icons":{size:24,viewbox:"0 0 24 24"},default:{size:0,viewbox:"0 0 0 0"}},h={props:{type:{type:String,required:!0},path:{type:[String,Object,Array],required:!1},pathString:{type:[Array,String,Object],required:!1}},setup(e){return()=>e.type==="fad"?(console.warn("vue3-icon does not currently support Duotone FontAwesome icons"),t.h("path")):Array.isArray(e.path)?t.h("g",{style:{fill:"currentcolor"}},e.path.map(n=>typeof n=="string"?t.h("path",{d:n}):t.h("path",{...n}))):t.h("path",{d:e.pathString,style:{fill:"currentcolor"}})}},y={name:"icon",props:{type:{type:String,default:"mdi"},faIcon:{type:Object,default:null},path:{type:[String,Object,Array]},size:{type:[Number,String],default:24},viewbox:{type:String,required:!1},flip:{type:String,default:"",validator:e=>["","horizontal","vertical","both"].includes(e)},rotate:{type:[Number,String],default:0},noNamespace:{type:Boolean,default:!1},noStyles:{type:Boolean,default:!1},noDimensions:{type:Boolean,default:!1}},setup(e){if(!e.path&&!e.faIcon)return console.warn("vue3-icon requires either a 'path' or an 'fa-icon' property"),()=>t.h("div");const n=t.computed(()=>{var a;return((a=e.faIcon)==null?void 0:a.prefix)||e.type}),i=t.computed(()=>parseInt(e.rotate,10)),r=t.computed(()=>l[n.value]||l.default),u=t.computed(()=>parseInt(e.size,10)||r.value.size),o=t.computed(()=>e.faIcon?`0 0 ${e.faIcon.icon[0]} ${e.faIcon.icon[1]}`:!1),c=t.computed(()=>o.value||e.viewbox||r.value.viewbox),s=t.computed(()=>{if(e.noStyles!==!0)return{...d,"--sx":["both","horizontal"].includes(e.flip)?"-1":"1","--sy":["both","vertical"].includes(e.flip)?"-1":"1","--r":isNaN(i.value)?i.value:i.value+"deg"}}),f=t.computed(()=>{var a;return e.faIcon?(a=e.faIcon)==null?void 0:a.icon[4]:e.type==="simple-icons"&&typeof e.path=="object"?e.path.path:e.path});return()=>t.h("svg",{xmlns:e.noNamespace!==!0?"http://www.w3.org/2000/svg":void 0,style:s.value,class:["vue3-icon"],width:e.noDimensions!==!0?u.value:void 0,height:e.noDimensions!==!0?u.value:void 0,viewBox:c.value},[t.h(h,{path:e.path,type:n.value,pathString:f.value})])}};module.exports=y;