"use strict";(wx.webpackJsonp=wx.webpackJsonp||[]).push([[3832],{6142:function(t,e,o){var n=o(1413),c=o(9439),r=o(1515),l=o(2954),i=o.n(l),s=o(2180),u=o(4184),a=o.n(u),h=o(7294),f=o(9601),d=o(6028),p=o(5893),Z=i().getSystemInfoSync().windowWidth,g=32,m=function convertPx(t){return t/750*Z},x="#333333",b=function ToolTip(t,e){var o=(0,h.useId)(),l=(0,h.useState)({}),u=(0,c.Z)(l,2)[1],Z=t.placement,b=void 0===Z?"top-start":Z,v=t.defaultVisible,w=void 0!==v&&v,y=t.onVisibleChange,S=t.children,j=t.content,C=void 0===j?"请填入提示信息":j,H=t.customClassName,k=t.customStyle,G=t.customContentStyle,N=t.customContainerStyle,R=t.childrenNode,W=(0,h.useState)(w),I=(0,c.Z)(W,2),M=I[0],E=I[1],T=(0,h.useRef)(y);T.current=y,(0,h.useImperativeHandle)(e,(function(){return{show:function show(){return E(!0)},hide:function hide(){return E(!1)},visible:M}}),[M]);var V=(0,h.useCallback)((function(){E((function(t){var e;return null===(e=T.current)||void 0===e||e.call(T,!t),!t}))}),[]),J=(0,h.useCallback)((function(){var t;E(!1),null===(t=T.current)||void 0===t||t.call(T,!1)}),[]),Q=(0,h.useMemo)((function(){return{top:"bottom",right:"left",bottom:"top",left:"right"}[b.split("-")[0]]}),[b]),q=(0,h.useState)({}),z=(0,c.Z)(q,2),A=z[0],F=z[1],L=(0,h.useRef)(A);L.current=A;var O=(0,h.useRef)(null);(0,h.useEffect)((function(){M&&!O.current&&(0,s.nextTick)((function(){i().createSelectorQuery().select("#content-".concat(o)).boundingClientRect((function(t){console.log("contextRectRef",t),O.current=t,u({})})).exec()}))}),[M,O.current]),(0,h.useEffect)((function(){console.log("useLayoutEffect");var t=i().createSelectorQuery();t.selectViewport().scrollOffset(),t.exec((function(t){console.log(t[0]),console.log(t[1]),F(t[0]),L.current=t[0]}))}),[]);var P=(0,h.useMemo)((function(){if(!O.current)return{top:"9999px"};switch(console.log("getArrowSide==>",Q,R),Q){case"bottom":return{left:R.cellWidth/2-m(g)/2,top:-m(g),right:"",bottom:""};case"left":return{left:R.cellWidth,right:"",top:R.cellHeight/2-m(g)/2,bottom:""};case"top":return{left:R.cellWidth/2-m(g)/2,right:"",top:R.cellHeight,bottom:""};case"right":return{left:-m(g),right:"",top:R.cellHeight/2-m(g)/2,bottom:""}}}),[Q,R,O.current]),B=(0,h.useMemo)((function(){var t=b.split("-")[1];console.log("placementSide",t);var e={},o=O.current;if(!o)return{top:"9999px"};switch(console.log("contextRect",o),Q){case"bottom":return e={bottom:m(g)-5,top:""},"start"===t?(0,n.Z)((0,n.Z)({},e),{},{left:0,right:""}):"end"===t?(0,n.Z)((0,n.Z)({},e),{},{left:"",right:0}):(0,n.Z)((0,n.Z)({},e),{},{left:"".concat(-((null==o?void 0:o.width)/2-R.cellWidth/2),"px"),right:""});case"left":return e={left:R.cellWidth+m(g)-5,right:""},"start"===t?(0,n.Z)((0,n.Z)({},e),{},{top:0,bottom:""}):"end"===t?(0,n.Z)((0,n.Z)({},e),{},{top:"",bottom:"".concat(-R.cellHeight,"px")}):(0,n.Z)((0,n.Z)({},e),{},{top:"".concat(-(o.height/2-R.cellHeight/2),"px"),bottom:""});case"top":return e={top:R.cellHeight+m(g)-5,bottom:""},"start"===t?(0,n.Z)((0,n.Z)({},e),{},{left:0,right:""}):"end"===t?(0,n.Z)((0,n.Z)({},e),{},{left:"",right:0}):(0,n.Z)((0,n.Z)({},e),{},{left:"".concat(-((null==o?void 0:o.width)/2-R.cellWidth/2),"px"),right:""});case"right":return e={left:"",right:m(g)-5},"start"===t?(0,n.Z)((0,n.Z)({},e),{},{top:0,bottom:""}):"end"===t?(0,n.Z)((0,n.Z)({},e),{},{top:"",bottom:"".concat(-R.cellHeight,"px")}):(0,n.Z)((0,n.Z)({},e),{},{top:"".concat(-(o.height/2-R.cellHeight/2),"px"),bottom:""})}}),[Q,R,O.current]),D=(0,h.useMemo)((function(){return(0,p.jsxs)(r.G7,{className:a()(f.Z.tooltip,M?"":f.Z["tooltip-hidden"],H),style:k,children:[(0,p.jsx)(r.G7,{className:a()(f.Z.arrowIcon,f.Z["arrowIcon-".concat(Q)]),style:P,children:(0,p.jsx)(d.Z,{name:"icon-shouqi1",size:g,color:x})}),(0,p.jsx)(r.G7,{className:f.Z["tooltip-inner"],id:"content-".concat(o),style:(0,n.Z)((0,n.Z)({},B),G),children:(0,p.jsx)(r.G7,{className:f.Z["tooltip-inner-content"],children:C})})]})}),[C,Q,M,P,B]);return(0,p.jsxs)(p.Fragment,{children:[(0,p.jsx)(r.G7,{className:a()(f.Z.mark,M?"":f.Z["tooltip-hidden"]),onClick:J}),(0,p.jsx)(r.G7,{style:N,children:(0,p.jsxs)(r.G7,{className:f.Z["tooltip-container"],children:[(0,p.jsx)(r.G7,{onClick:V,children:S}),D]})})]})};e.Z=(0,h.forwardRef)(b)}}]);