Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}}),require(`../../chunk-Bmb41Sf3.cjs`);const e=require(`../../_plugin-vue_export-helper-D8jCH6HB.cjs`),t=require(`../../common/emoji/index.cjs`),n=require(`../icon/icon-constants.cjs`),r=require(`../skeleton/skeleton.cjs`);let i=require(`vue`);var a={compatConfig:{MODE:3},name:`DtEmoji`,components:{DtSkeleton:r.default},props:{code:{type:String,required:!0},size:{type:String,default:`500`,validator:e=>Object.keys(n.ICON_SIZE_MODIFIERS).includes(e)},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(){return this.emojiDataValid?this.emojiData?.custom?this.emojiData.image:[`100`,`200`].includes(this.size)?t.emojiImageUrlSmall+this.emojiData.key+t.emojiFileExtensionSmall:t.emojiImageUrlLarge+this.emojiData.key+t.emojiFileExtensionLarge:`invalid`},emojiAlt(){if(this.emojiDataValid)return this.emojiData.unicode_output?t.stringToUnicode(this.emojiData.unicode_output):this.emojiData.name},emojiLabel(){return this.emojiDataValid?this.ariaLabel?this.ariaLabel:this.emojiData.name:`Invalid Emoji`},emojiSize(){return n.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=t.codeToEmojiData(this.code)},imageLoaded(){this.imgLoading=!1},imageErrored(){this.imgLoading=!1}}},o=[`aria-label`,`alt`,`title`,`src`];function s(e,t,n,r,a,s){let c=(0,i.resolveComponent)(`dt-skeleton`);return(0,i.openBlock)(),(0,i.createElementBlock)(`span`,{class:(0,i.normalizeClass)([`d-emoji d-icon`,s.emojiSize])},[(0,i.withDirectives)((0,i.createVNode)(c,{offset:0,class:(0,i.normalizeClass)([`d-icon`,s.emojiSize]),"shape-option":{shape:`circle`,size:`100%`}},null,8,[`class`]),[[i.vShow,a.imgLoading&&n.showSkeleton]]),(0,i.withDirectives)((0,i.createElementVNode)(`img`,{ref:`emojiImg`,class:(0,i.normalizeClass)([`d-icon`,s.emojiSize,n.imgClass]),"aria-label":s.emojiLabel,alt:s.emojiAlt,title:s.emojiLabel,src:s.emojiSrc,onLoad:t[0]||(t[0]=(...e)=>s.imageLoaded&&s.imageLoaded(...e)),onError:t[1]||(t[1]=(...e)=>s.imageErrored&&s.imageErrored(...e))},null,42,o),[[i.vShow,!a.imgLoading]])],2)}var c=e.t(a,[[`render`,s]]);exports.default=c;
//# sourceMappingURL=emoji.cjs.map