"use strict";const e=require("../../../../../common/vendor.js");require("../../../../adapter-vue.js");const i=require("../../../../utils/env.js"),n=require("../../../../../common/assets.js"),o=require("../../utils/utils.js"),a=require("../../offlinePushInfoManager/index.js"),r=require("../../config.js");Math||u();const u=()=>"../toolbar-item-container/index.js",l=e.defineComponent({__name:"index",props:{imageSourceType:{type:String,default:"album"}},setup(u){const l=u,t=e.ref(),s=e.ref(),c={web_album:{icon:"dark"===r.ChatConfig.getTheme()?n.imageIconDark:n.imageIconLight,title:"图片"},uni_album:{icon:n.imageUniIcon,title:"图片"},uni_camera:{icon:n.cameraUniIcon,title:"拍照"}};e.Jt.watch(e.o.CONV,{currentConversation:e=>{s.value=e}});const d=e.computed((()=>i.isUniFrameWork?"camera"===l.imageSourceType?c.uni_camera:c.uni_album:c.web_album)),m=()=>{var n,o,a,r;i.isUniFrameWork?i.isWeChat&&(null==(n=e.i)?void 0:n.chooseMedia)?null==(o=e.i)||o.chooseMedia({count:1,mediaType:["image"],sizeType:["original","compressed"],sourceType:[l.imageSourceType],success:function(e){v(e)}}):null==(a=e.i)||a.chooseImage({count:1,sourceType:[l.imageSourceType],success:function(e){v(e)}}):(null==(r=t.value)?void 0:r.click)&&t.value.click()},p=e=>{var i,n;(null==(n=null==(i=null==e?void 0:e.target)?void 0:i.files)?void 0:n.length)<=0||(v(null==e?void 0:e.target),e.target.value="")},v=i=>{var n,r,u,l,t;if(!i)return;const c={to:(null==(r=null==(n=null==s?void 0:s.value)?void 0:n.groupProfile)?void 0:r.groupID)||(null==(l=null==(u=null==s?void 0:s.value)?void 0:u.userProfile)?void 0:l.userID),conversationType:null==(t=null==s?void 0:s.value)?void 0:t.type,payload:{file:i},needReadReceipt:o.isEnabledMessageReadReceiptGlobal()},d={conversation:s.value,payload:c.payload,messageType:e.qt.TYPES.MSG_IMAGE},m={offlinePushInfo:a.OfflinePushInfoManager.create(d)};e.Qt.sendImageMessage(c,m)};return(n,o)=>e.e({a:!e.unref(i.isUniFrameWork)},e.unref(i.isUniFrameWork)?{}:{b:e.o$1(p),c:e.n(!e.unref(i.isPC)&&"image-upload-h5")},{d:e.o$1(m),e:e.p({iconFile:e.unref(d).icon,title:e.unref(d).title,iconWidth:e.unref(i.isUniFrameWork)?"32px":"20px",iconHeight:e.unref(i.isUniFrameWork)?"25px":"18px",needDialog:!1})})}}),t=e._export_sfc(l,[["__scopeId","data-v-85be0b12"]]);wx.createComponent(t);
