"use strict";const e=require("../../../../../common/vendor.js");require("../../../../adapter-vue.js");const o=require("../../../../utils/env.js"),n=require("../../config.js");Math||(i+t)();const i=()=>"../../../common/Icon.js",t=()=>"../../../common/BottomPopup/index.js",r=e.defineComponent({__name:"index",props:{iconFile:{type:String,required:!0},title:{type:String,default:""},needDialog:{type:Boolean,default:!0},iconWidth:{type:String,default:"20px"},iconHeight:{type:String,default:"20px"},needBottomPopup:{type:Boolean,default:!1}},emits:["onIconClick","onDialogClose","onDialogShow"],setup(i,{expose:t,emit:r}){const a=i,l=r,u=e.ref("dark"===n.ChatConfig.getTheme()),s=e.ref(!1),c=e.ref(),d=e.ref(),f=()=>{l("onIconClick",d),o.isPC&&e.O.listen({domRefs:c.value,handler:m}),a.needDialog&&p(!s.value)},m=()=>{s.value=!1,l("onDialogClose",d)},p=e=>{if(s.value!==e)switch(s.value=e,e){case!0:l("onDialogShow",d);break;case!1:l("onDialogClose",d)}},g=()=>{s.value=!1};return t({toggleDialogDisplay:p}),(n,i)=>e.e({a:e.p({file:a.iconFile,width:a.iconWidth,height:a.iconHeight}),b:e.n(e.unref(o.isUniFrameWork)&&"toolbar-item-container-uni-icon"),c:e.o$1(f),d:e.unref(o.isUniFrameWork)},e.unref(o.isUniFrameWork)?{e:e.t(a.title)}:{},{f:a.needBottomPopup&&!e.unref(o.isPC)},a.needBottomPopup&&!e.unref(o.isPC)?{g:e.o$1((()=>{})),h:e.o$1(g),i:e.p({show:e.unref(s)})}:{},{j:e.unref(s),k:e.n(e.unref(u)&&"toolbar-item-container-dialog-dark"),l:e.n(!e.unref(o.isPC)&&"toolbar-item-container-h5-dialog"),m:e.n(e.unref(o.isUniFrameWork)&&"toolbar-item-container-uni-dialog"),n:e.n(!e.unref(o.isPC)&&"toolbar-item-container-h5"),o:e.n(e.unref(o.isUniFrameWork)&&"toolbar-item-container-uni")})}}),a=e._export_sfc(r,[["__scopeId","data-v-5e68d98a"]]);wx.createComponent(a);
