"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const i=require("../../common/emoji/index.cjs"),r=require("../../_plugin-vue2_normalizer-e_CkxkSV.cjs"),n=require("../skeleton/skeleton.cjs"),o=require("../icon/icon-constants.cjs"),s={name:"DtEmoji",components:{DtSkeleton:n.default},props:{code:{type:String,required:!0},size:{type:String,default:"500",validator:t=>Object.keys(o.ICON_SIZE_MODIFIERS).includes(t)},imgClass:{type:[String,Object,Array],default:""},ariaLabel:{type:String,default:null},showSkeleton:{type:Boolean,default:!0}},data(){return{emojiData:null,imgLoading:!1}},computed:{emojiDataValid(){return!!this.emojiData},emojiSrc(){var t;return this.emojiDataValid?(t=this.emojiData)!=null&&t.custom?this.emojiData.image:["100","200"].includes(this.size)?i.emojiImageUrlSmall+this.emojiData.key+i.emojiFileExtensionSmall:i.emojiImageUrlLarge+this.emojiData.key+i.emojiFileExtensionLarge:"invalid"},emojiAlt(){if(this.emojiDataValid)return this.emojiData.unicode_output?i.stringToUnicode(this.emojiData.unicode_output):this.emojiData.name},emojiLabel(){return this.emojiDataValid?this.ariaLabel?this.ariaLabel:this.emojiData.name:"Invalid Emoji"},emojiSize(){return o.ICON_SIZE_MODIFIERS[this.size]}},watch:{code:{handler:function(){this.getEmojiData()},immediate:!0},emojiSrc:{handler:async function(){this.imgLoading=!0},immediate:!0}},methods:{getEmojiData(){this.emojiData=i.codeToEmojiData(this.code)},imageLoaded(){this.imgLoading=!1},imageErrored(){this.imgLoading=!1}}};var m=function(){var e=this,a=e._self._c;return a("span",{class:["d-emoji d-icon",e.emojiSize]},[a("dt-skeleton",{directives:[{name:"show",rawName:"v-show",value:e.imgLoading&&e.showSkeleton,expression:"imgLoading && showSkeleton"}],class:["d-icon",e.emojiSize],attrs:{offset:0,"shape-option":{shape:"circle",size:"100%"}}}),a("img",{directives:[{name:"show",rawName:"v-show",value:!e.imgLoading,expression:"!imgLoading"}],ref:"emojiImg",class:["d-icon",e.emojiSize,e.imgClass],attrs:{"aria-label":e.emojiLabel,alt:e.emojiAlt,title:e.emojiLabel,src:e.emojiSrc},on:{load:e.imageLoaded,error:e.imageErrored}})],1)},l=[],d=r.n(s,m,l);const u=d.exports;exports.default=u;
//# sourceMappingURL=emoji.cjs.map
