2 lines
122 KiB
JavaScript
2 lines
122 KiB
JavaScript
(window.webpackJsonp=window.webpackJsonp||[]).push([[56],{1007:function(e,t,n){"use strict";var r=n(2),a=n(3),o=n.n(a),c=n(11),i=n.n(c),s=Array.from(Array(12),(function(e,t){return Object(r.b)("span",{className:"Spinner-blade-12"},t)}));function l(e){var t=e.className,n=e.white,a=e.large;return Object(r.b)("div",{className:i()("Spinner-blade",t,{"Spinner-blade--large":a,"Spinner-blade--white":n}),children:s})}l.propTypes={className:o.a.string,large:o.a.bool,white:o.a.bool};var u=l;t.a=u},1013:function(e,t,n){e.exports=n(369),e.exports.CJKSpace=n(1273).CJKSpace},1017:function(e,t,n){"use strict";n.d(t,"b",(function(){return N})),n.d(t,"a",(function(){return d}));var r=n(3),a=n.n(r),o=n(1),c=n(11),i=n.n(c),s=n(177),l=n(5),u=function(e){var t=e.title,n=e.subtitle,r=e.attrInfo,a=e.coverUrl,o=e.avatarUrl,c=e.avatarFit;return Object(l.g)("div",null,a&&Object(l.g)("div",{className:"HoverCard-coverContainer"},Object(l.g)("img",{className:"HoverCard-cover",src:a,alt:"cover"})),Object(l.g)("div",{className:i()("HoverCard-titleContainer",{"HoverCard-titleContainer--noAvatar":!a})},o&&Object(l.g)(s.a,{size:68,className:"HoverCard-avatar",url:o,imgFit:c}),Object(l.g)("div",{className:i()("HoverCard-titleText",{"HoverCard-titleText--noAvatar":!o})},Object(l.g)("div",{className:"HoverCard-title"},t),n&&Object(l.g)("div",{className:"HoverCard-subtitle"},n)),r&&Object(l.g)("div",{className:"HoverCard-attrInfo"},r)))};u.propTypes={title:a.a.node,subtitle:a.a.node,attrInfo:a.a.node,coverUrl:a.a.string,avatarUrl:a.a.string,avatarFit:a.a.oneOf(["fill","contain","cover","none","scale-down"])};var d=u,p=n(20),f=n.n(p),h=n(21),b=n.n(h),m=n(22),v=n.n(m),g=n(23),O=n.n(g),j=n(13),y=n.n(j),w=n(33),C=n.n(w),k=n(41),E=n.n(k),R=n(83),M=n.n(R),x=n(375),S=n(138);function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=y()(e);if(t){var a=y()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return O()(this,n)}}var I=function(e){v()(n,e);var t=T(n);function n(){var e;f()(this,n);for(var r=arguments.length,a=new Array(r),o=0;o<r;o++)a[o]=arguments[o];return(e=t.call.apply(t,[this].concat(a))).state={opened:!1,placement:null,loaderStyle:null},e.handleOpen=function(t){var n=t.arrowStyle,r=t.placement,a=e.props.onOpen;a&&a(),e.setState({opened:!0,placement:r,loaderStyle:n})},e.handleClose=function(){var t=e.props.onClose;t&&t(),e.setState({opened:!1})},e}return b()(n,[{key:"render",value:function(){var e=M()(this.props,["onOpen","onClose"]),t=e.toggler,n=e.children,r=e.isLoading,a=e.onRef,c=e.size,s=E()(e,["toggler","children","isLoading","onRef","size"]),u=this.state,d=u.opened,p=u.loaderStyle;return Object(l.g)(S.a,C()({noLayer:!0,toggler:Object(l.g)("div",null,t),toggleEvent:"hover",targetClassName:"HoverCard-popoverTarget",placement:"bottom-left",onOpen:this.handleOpen,onClose:this.handleClose},s),Object(l.g)("div",{className:i()("HoverCard-container",{"HoverCard-container--large":"large"===c}),ref:a},r&&Object(l.g)("div",{className:"HoverCard-loading",style:p},Object(l.g)(x.a,null)),Object(l.g)("div",{className:i()("HoverCard",{"HoverCard--isLoading":r||!d})},o.Children.map(n,(function(e){return e&&("string"==typeof e?Object(l.g)("div",{className:"HoverCard-item"},e):Object(o.cloneElement)(e,{className:i()("HoverCard-item",e.props.className)}))})))))}}]),n}(o.Component);I.propTypes={toggler:a.a.node.isRequired,isLoading:a.a.bool,onOpen:a.a.func,onClose:a.a.func,size:a.a.oneOf(["default","large"])},I.defaultProps={margin:16,align:"left",topExcludedHeight:60,size:"default"};var N=I},1023:function(e,t,n){"use strict";n.d(t,"a",(function(){return s}));var r=n(0),a=n(6),o=n(25),c=n(24),i=Object(a.a)("user",["UPDATE_FOLLOWERS_PIN"]).UPDATE_FOLLOWERS_PIN;function s(e,t,n){return function(a,s){var l=s(),u=l.entities.users,d=l.currentUser,p=u[e];return a(n?Object(o.h)(c.U.blocked,"red"):{urlToken:d,userUrlToken:e,expect:t,API:{types:i,endpoint:"members/".concat(e,"/followers"),method:t?"POST":"DELETE"},UPDATE:{request:{users:Object(r.a)({},e,{isFollowing:t})},failure:{users:Object(r.a)({},e,p)},success:function(t){return{users:Object(r.a)({},e,t)}}}})}}},1066:function(e,t,n){"use strict";n.d(t,"a",(function(){return f}));var r,a=n(43),o=n(0),c=n(2),i=n(78),s=n(1),l=n(73),u=n(24),d=n(992),p=n(373),f={comment_img:"comment_img",dynamic_top:"dynamic_top",comment_sticker:"comment_sticker",block_keyword:"block_keyword"},h=(r={},Object(o.a)(r,f.comment_img,"https://pic1.zhimg.com/v2-1b6677f81c2df41f55332474e15bc5a8.png"),Object(o.a)(r,f.dynamic_top,"https://pic1.zhimg.com/v2-e16a265a43592abd5b98fceef02a1614.png"),Object(o.a)(r,f.comment_sticker,"https://pic1.zhimg.com/v2-183a98cd480d24cd3e3246ba7a26303b.png"),Object(o.a)(r,f.block_keyword,"https://pic3.zhimg.com/v2-0ad4e8aa43c3279cc7536f2fb7ac8348.png"),r);t.b=Object(d.a)((function(e){var t=e.show,n=e.setShow,r=e.type,o=e.isLogin,d=Object(s.useState)(""),f=Object(a.a)(d,2),b=f[0],m=f[1],v=Object(s.useState)(!1),g=Object(a.a)(v,2),O=g[0],j=g[1],y=Object(p.b)(),w=Object(i.c)((function(){t&&n(!1)})),C=Object(i.c)((function(){window.open(u.F,"_blank")}));return Object(s.useEffect)((function(){!b&&o&&(j(!0),y("/api/v4/unlimited/vip_rights/popup?token="+r).then((function(e){m(e.payload.button.text)})).catch((function(){})).then((function(){j(!1)})))}),[t]),Object(c.b)(l.b,{css:{".Modal-content":{padding:0,marginTop:0}},onClose:w,children:t&&!O&&Object(c.c)(c.a,{children:[Object(c.b)("img",{src:h[r],css:{height:"230px",width:"400px",display:"block"}}),Object(c.b)("div",{css:{padding:20},children:Object(c.b)("div",{css:function(e){return{padding:8,background:"linear-gradient(135deg, ".concat(e.colors.GYL06A," 0.2%, ").concat(e.colors.GYL08A," 100%)"),borderRadius:3,textAlign:"center",fontsize:14,color:e.colors.GYL12A,userSelect:"none","&:hover":{cursor:"pointer"}}},onClick:C,children:b||"开通会员立即解锁"})})]})})}))},1067:function(e,t,n){var r=n(583),a=n(259),o=n(257),c=n(93),i=n(207),s=n(258),l=n(256),u=n(325),d=Object.prototype.hasOwnProperty;e.exports=function(e){if(null==e)return!0;if(i(e)&&(c(e)||"string"==typeof e||"function"==typeof e.splice||s(e)||u(e)||o(e)))return!e.length;var t=a(e);if("[object Map]"==t||"[object Set]"==t)return!e.size;if(l(e))return!r(e).length;for(var n in e)if(d.call(e,n))return!1;return!0}},1102:function(e,t,n){"use strict";n.d(t,"b",(function(){return o}));var r=n(63),a={400:"请求参数有误",401:"用户认证失败",403:"服务已拒绝",404:"资源不存在",405:"请求方式有误",410:"资源已解散",502:"网关错误",503:"服务无响应",504:"网关超时"},o=function(e){var t;return(null==e||null===(t=e.payload)||void 0===t?void 0:t.message)||(null==e?void 0:e.status)&&a[e.status]||"操作失败"};t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};r.a.dispatch("ui/showToast",{icon:"fail",text:o(e)})}},1103:function(e,t,n){"use strict";var r=n(43),a=n(2),o=n(1),c=n(71),i=n.n(c),s=n(27),l=n(380),u=Object(s.connect)((function(e){return{hasData:e.emoticons.emoticonGroupList.length>0}}));t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.alwaysShow,n=void 0!==t&&t;return function(e){return u(i()((function(t){var c=t.hasData,i=Object(o.useState)(!1),u=Object(r.a)(i,2),d=u[0],p=u[1],f=Object(s.useDispatch)();return Object(o.useEffect)((function(){c?p(!0):f(Object(l.d)()).then((function(e){var t=e.payload.data[0].id;f(Object(l.e)(t)),p(!0)})).catch((function(){p(!0)}))}),[f,c]),(!d||!n)&&Object(a.b)(e,Object.assign({},t))}),e))}}},1116:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(16),c=n(17),i=n(9),s=n(2),l=n(1),u=n(27),d=n(19),p=n(3),f=n.n(p),h=n(11),b=n.n(h),m=n(262),v=n.n(m),g=n(78),O=n(232),j=n(380),y=n(36),w=n(234),C=n(1066),k=n(43),E=n(156);function R(e){var t,n,r,a,o,c,i,u,d,p=e.className,f=e.emoticonGroupList,h=e.curEmoticonGroupId,m=e.onGroupSelected,v=e.vipEnabled,O=Object(l.useRef)(),j=Object(E.a)(v,f),y=(t=O,n=Object(l.useState)({left:null,x:null}),r=Object(k.a)(n,2),a=r[0],o=r[1],c=Object(l.useState)(!1),i=Object(k.a)(c,2),u=i[0],d=i[1],{onMouseDown:Object(g.c)((function(e){var n;d(!0);var r=null===(n=t.current)||void 0===n?void 0:n.scrollLeft,a=e.clientX;o({left:r,x:a}),e.preventDefault()})),onMouseMove:Object(g.c)((function(e){if(u){var n=e.clientX-a.x;t.current&&(t.current.scrollLeft=a.left-n)}})),onMouseUp:Object(g.c)((function(){u&&d(!1)}))});return Object(s.b)("div",{className:b()("EmoticonsFooter",p),children:Object(s.b)("ul",Object.assign({className:"EmoticonsFooter-items",ref:O},y,{children:j.map((function(e){return Object(s.b)("li",{className:b()("EmoticonsFooter-item",{"EmoticonsFooter-item--selected":h===e.id}),onClick:function(){m(e.id)},children:Object(s.b)("img",{src:e.iconUrl,className:"EmoticonsFooter-itemIcon"})},e.id)}))}))})}var M=n(1007);function x(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var S=function(e){Object(o.a)(n,e);var t=x(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).handleMouseEnter=function(e,t){e.dynamicImageUrl&&(t.target.src=e.dynamicImageUrl)},e.handleMouseLeave=function(e,t){e.dynamicImageUrl&&(t.target.src=e.staticImageUrl)},e.handleSelectEmoticon=function(t,n){(0,e.props.onSelectEmoticon)(t,n)},e}return Object(a.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.type,r=t.data,a=void 0===r?[]:r;return 0===a.length?Object(s.b)(M.a,{className:"EmoticonPanel-spinner"}):Object(s.b)("ul",{className:"EmoticonPanel",children:a.map((function(t){return Object(s.c)(O.a,{zaType:"Button",zaText:t.title,zaEventType:"Click",zaBlock:"vip"===n?"VipEmoticon":"Emoticon",as:"li",className:b()("EmoticonPanel-item",{"EmoticonPanel-item--big":"emoji"!==n}),onClick:function(){e.handleSelectEmoticon(t,n)},children:[Object(s.b)("img",{src:t.staticImageUrl,title:"emoji"===n?t.title:"",className:b()({"EmoticonPanel-itemImg--small":"emoji"===n,"EmoticonPanel-itemImg--big":"emoji"!==n}),onMouseOver:function(n){e.handleMouseEnter(t,n)},onMouseOut:function(n){e.handleMouseLeave(t,n)},alt:t.title}),"emoji"!==n&&Object(s.b)("span",{className:"EmoticonPanel-itemTitle",children:t.title})]},t.id)}))})}}]),n}(l.Component);function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}S.propTypes={type:f.a.string.isRequired,data:f.a.array.isRequired,onSelectEmoticon:f.a.func.isRequired};var I=function(e){Object(o.a)(n,e);var t=T(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).getCurEmoticonGroupPanleData=function(){var t=e.props,n=t.curEmoticonGroupId;return t.emoticonPanelList.filter((function(e){return e.groupId===n}))},e}return Object(a.a)(n,[{key:"render",value:function(){var e=this.props,t=e.changeSelectedEmoticonPanel,n=e.curEmoticonPanelId,r=e.className,a=this.getCurEmoticonGroupPanleData();return a.length<=1?null:Object(s.b)("ul",{className:b()("EmoticonPagination",r),children:a.map((function(e){return Object(s.b)("li",{className:b()("EmoticonPagination-bullet",{"EmoticonPagination-bullet--active":e.id===n}),onClick:function(){t(e.id)}},e.id)}))})}}]),n}(l.Component);I.propsTypes={className:f.a.string};var N=Object(u.connect)((function(e){var t=e.emoticons;return{curEmoticonGroupId:t.curEmoticonGroupId,emoticonPanelList:t.emoticonPanelList,curEmoticonPanelId:t.curEmoticonPanelId}}),{changeSelectedEmoticonPanel:j.b})(I),B=n(0),P=n(835),_=n(24);function z(e){var t=e.show,n=e.onClick,r=Object(g.c)((function(){null==n||n()}));return t&&Object(s.c)(O.a,{zaType:"Button",zaEventType:"Click",zaAction:"OpenUrl",zaBlock:"VipBrand",extra:{link:{url:_.F}},css:function(e){return Object(B.a)({backgroundColor:e.colorMod(e.colors.GYL08A).alpha(.25),color:e.colors.GYL12A,display:"flex",alignItems:"center",justifyContent:"center",height:"25px",fontSize:"12px",lineHeight:"17px",userSelect:"none"},"&:hover",{cursor:"pointer"})},onClick:r,children:["开通会员解锁全部会员表情 ",Object(s.b)(P.a,{})]})}function A(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var L={containerClass:"Emoticons-panelContainer",ContainerEl:"ul",threshold:10},U=function(e){Object(o.a)(n,e);var t=A(n);function n(e){var a;return Object(r.a)(this,n),(a=t.call(this,e)).state={showVipStickerModal:!1},a.setShowVipStickerModal=function(e){a.setState({showVipStickerModal:e})},a.handleGetSwiperInstance=function(e){a.mousetrap=new v.a,a.swiperInstance=e,a.mousetrap.bind("left",(function(){e.slidePrev()})),a.mousetrap.bind("right",(function(){e.slideNext()}))},a.handleEmoticonGroupSelected=function(e){var t=a.props,n=t.getEmoticonsDetail,r=t.emoticonGroupDetail,o=t.changeSelectedEmoticonGroup,c=t.changeSelectedEmoticonPanel;r[e]||n(e),o(e),c("".concat(e,"-0"))},a.handleSlideChange=function(){var e=a.props,t=e.emoticonPanelList,n=e.getEmoticonsDetail,r=e.changeSelectedEmoticonPanel,o=e.changeSelectedEmoticonGroup;if(a.swiperInstance){var c=t[a.swiperInstance.activeIndex];r(c.id),o(c.groupId),0===c.data.length&&n(c.groupId)}},a.handleRequestVip=function(){a.setShowVipStickerModal(!0)},a.handleSelectEmoticon=function(e,t){var n=a.props,r=n.onSelectEmoticon,o=n.isVip;"vip"!==t||o?r(e,t):a.handleRequestVip()},a.swiperInstance=Object(l.createRef)(),a}return Object(a.a)(n,[{key:"componentWillUnmount",value:function(){var e=this.props,t=e.changeSelectedEmoticonGroup,n=e.changeSelectedEmoticonPanel,r=e.emoticonPanelList;t(r[0].groupId),n(r[0].id),this.mousetrap.reset()}},{key:"render",value:function(){var e=this,t=this.props,n=t.className,r=t.emoticonGroupList,a=void 0===r?[]:r,o=t.curEmoticonGroupId,c=t.emoticonPanelList,i=t.curEmoticonPanelId,l=t.isVip,u=t.vipEnabled,d=void 0!==u&&u,p=t.Swiper,f=this.state.showVipStickerModal,h=this.setShowVipStickerModal,m=Object(E.a)(d,c);return Object(s.b)(O.b,{block:"EmoticonsCard",children:Object(s.c)("div",{className:b()("Emoticons",n),children:[p?Object(s.b)(p,Object.assign({},L,{activeSlideKey:i,getSwiper:this.handleGetSwiperInstance,on:{slideChange:this.handleSlideChange},children:m.map((function(t){return Object(s.b)("li",{className:"Emoticons-panels-item",children:Object(s.b)(S,{type:t.type,data:t.data,onSelectEmoticon:e.handleSelectEmoticon})},t.id)}))})):Object(s.b)("div",{css:{height:183}}),Object(s.b)(N,{className:"Emoticons-Pagination"}),Object(s.b)(z,{show:d&&!l,onClick:this.handleRequestVip}),Object(s.b)(R,{emoticonGroupList:a,curEmoticonGroupId:o,onGroupSelected:this.handleEmoticonGroupSelected,vipEnabled:d}),Object(s.b)(C.b,{show:f,setShow:h,type:C.a.comment_sticker})]})})}}]),n}(l.Component);U.propTypes={className:f.a.string,onSelectEmoticon:f.a.func};t.a=Object(d.compose)(Object(u.connect)((function(e){var t=e.emoticons,n=t.emoticonGroupList,r=t.curEmoticonGroupId,a=t.emoticonGroupDetail,o=t.emoticonPanelList;return{emoticonGroupList:n,curEmoticonGroupId:r,emoticonGroupDetail:a,emoticonPanelList:void 0===o?[]:o,curEmoticonPanelId:t.curEmoticonPanelId,isVip:Object(y.j)(e)}}),{getEmoticonsDetail:j.e,changeSelectedEmoticonGroup:j.a,changeSelectedEmoticonPanel:j.b}),Object(w.a)(null),(function(e){return function(t){var r=Object(g.d)((function(){return n.e(45).then(n.t.bind(null,2609,7))}));return Object(s.b)(e,Object.assign({},t,{Swiper:r}))}}))(U)},1120:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(16),c=n(17),i=n(9),s=n(2);function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var u=function(e){Object(o.a)(n,e);var t=l(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){var e=this.props,t=e.isFollowed,n=e.isFollowing;return t?Object(s.b)("span",{className:"FollowStatus",children:n?"相互关注":"关注了你"}):null}}]),n}(n(1).Component);t.a=u},1150:function(e,t,n){"use strict";n.r(t);var r=n(35),a=n(14),o=n(15),c=n(16),i=n(17),s=n(9),l=n(2),u=n(3),d=n.n(u),p=n(1),f=n(27),h=n(34),b=n(90),m=n(30),v=n(1822),g=n(1674),O=n(112),j=n.n(O),y=n(1013),w=n(370),C=n(47),k=n(977),E=n(1017),R=n(372),M=n(1458),x=n(119),S=n(24),T=n(908),I=n(101),N=n(956),B=n(1120);function P(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(s.a)(e);if(t){var a=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var _=function(e,t){return e.map((function(e){return t[e]})).slice(0,3)},z=Object(C.isBrowser)()?j()(_,(function(e,t){return"".concat(e.join(","),"-").concat(t.length)})):_,A=[];var L=function(e){return Object(l.b)(b.Flex,Object.assign({css:{"&:not(:last-child)":{marginBottom:8}}},e))},U=function(e){Object(c.a)(n,e);var t=P(n);function n(){var e;Object(a.a)(this,n);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).state={isLoading:!1,childModalOpened:!1},e.loadUserProfile=function(){var t=e.props,n=t.id,r=t.urlToken;return(0,t.dispatch)(Object(x.i)(r||n,!1))},e.load=function(){var t=e.props,n=t.id;(t.urlToken||n)&&(e.setState({isLoading:!0}),e.loadUserProfile().then((function(){return e.setState({isLoading:!1})})),e.loadMutuals())},e.loadMutuals=function(){var t=e.props,n=t.user,r=t.dispatch,a=t.mutuals;return!(void 0===a?[]:a).length&&e.context.currentUser&&n?r(Object(x.f)(n.urlToken,"mutuals")):Promise.resolve()},e.track=function(){var t=e.props.user;e.hoverCardElement&&t&&(m.a.setModule(e.hoverCardElement,{module:"UserItem"},{card:{content:{type:"User",member_hash_id:t.id}}}),m.a.trackCardShow(e.hoverCardElement))},e.handleOpen=function(){e.load(),e.track()},e}return Object(o.a)(n,[{key:"render",value:function(){var e,t,n=this,a=this.props,o=a.toggler,c=a.user,i=a.id,s=a.urlToken,u=a.mutuals,d=void 0===u?[]:u,p=a.onRef,f=Object(r.a)(a,["toggler","user","id","urlToken","mutuals","onRef"]),m=c||{},O=m.isOrg,j=m.headline,C=m.avatarUrl,x=m.badge,P=m.badgeV2,_=m.answerCount,z=m.articlesCount,A=m.followerCount,U=m.employments,F=m.coverUrl,H=m.gender,D=m.isFollowed,V=m.isFollowing,q=this.state,G=q.isLoading,K=q.childModalOpened,W=d.length,J=Object(w.e)(P||x),Z=J.bestAnswerer,Q=J.identity,Y="//www.zhihu.com/".concat(O?"org":"people","/").concat(s||i),X=this.context.currentUser,$=X&&c&&X.urlToken===c.urlToken,ee=W>0&&!$,te=U&&U[0];if(null==Q?void 0:Q.length)t=Object(l.c)(L,{children:[Object(l.b)("a",{href:"".concat(S.E,"/account/verification/intro"),target:"_blank",rel:"noopener noreferrer",css:{marginRight:".3em"},children:Object(l.b)(w.a,{})}),Object(l.b)("div",{children:Q.slice(0,2).map((function(e){return e.description})).join(",")})]});else if(te){var ne=te.company,re=te.job;t=Object(l.c)(L,{children:[(ne||re)&&Object(l.b)(b.Box,{as:"span",mr:".3em",color:"GBL05A",children:Object(l.b)(v.a,{text:!0,center:!0})}),Object(l.c)("div",{children:[ne&&ne.name,ne&&re&&Object(l.b)(b.Box,{display:"inline-block",width:"1px",height:"10px",mx:"8px",bg:"GBK09A"}),re&&re.name]})]})}else t=null;return Object(l.c)(E.b,Object.assign({toggler:o,onOpen:this.handleOpen,isLoading:G,globalClose:!K,stickHover:K,preventCloseOnTarget:!0},f,{onRef:function(e){p&&"function"==typeof p&&p(e),n.hoverCardElement=e},children:[Object(l.b)(E.a,{coverUrl:F,title:Object(l.c)("span",{css:{display:"flex"},children:[Object(l.b)(T.a,{user:c,noHoverCard:!0}),Object(l.b)(B.a,{isFollowed:D,isFollowing:V})]}),subtitle:j&&Object(l.b)(R.a,{inline:!0,html:j}),avatarUrl:C}),(t||Z||ee)&&Object(l.c)("div",{children:[t,Boolean(null==Z||null===(e=Z.topics)||void 0===e?void 0:e.length)&&Object(l.c)(L,{children:[Object(l.b)("span",{css:{marginRight:".3em"},children:Object(l.b)(w.b,{})}),Object(l.c)("div",{children:[Object(l.b)(N.a,{expandable:!1,noHoverCard:!0,topics:Z.topics,user:c}),"的优秀答主"]})]}),ee&&Object(l.c)(L,{color:"GBL05A",children:[Object(l.b)(b.Box,{mr:".3em",children:Object(l.b)(g.a,{text:!0,center:!0})}),Object(l.b)("div",{children:Object(l.c)(y.CJKSpace,{children:[d.map((function(e,t){return Object(l.c)(h.Link,{to:"//www.zhihu.com/".concat(O?"org":"people","/").concat(e.urlToken),target:"_blank",children:[e.name,t<W-1&&"、"]},t)})),"也关注了",S.N[H]]})})]})]}),Object(l.c)("div",{children:[Object(l.c)(k.a,{children:[Object(l.b)(k.a.Item,{tag:I.a,preset:"plain",to:"".concat(Y,"/answers"),name:"回答",value:_,target:"_blank"}),Object(l.b)(k.a.Item,{tag:I.a,preset:"plain",to:"".concat(Y,"/posts"),name:"文章",value:z,target:"_blank"}),Object(l.b)(k.a.Item,{tag:I.a,preset:"plain",to:"".concat(Y,"/followers"),name:"关注者",value:A,target:"_blank"})]}),c&&!$&&Object(l.b)(M.a,{className:"HoverCard-buttons",user:c,onModalOpen:function(){n.hoverCardElement.style.opacity="0",n.setState({childModalOpened:!0})},onModalClose:function(){return n.setState({childModalOpened:!1})}})]})]}))}}]),n}(p.PureComponent);U.contextTypes={currentUser:d.a.object},t.default=Object(f.connect)((function(e,t){var n=t.id,r=t.urlToken,a=e.entities,o=e.people.mutualsByUser,c=a.users[r]||Object.values(a.users).find((function(e){return e.id===n}))||t.user,i=o[r||n]||{ids:A,isFetching:!1},s=i.ids,l=i.isFetching;return{user:c,mutuals:z(s,a.users),isFetching:l}}))(U)},1167:function(e,t,n){"use strict";var r=n(43),a=n(2),o=n(71),c=n.n(o),i=n(7),s=n(156),l=n(4),u=n(122);function d(e){return e.reduce((function(e,t){var n;return[].concat(Object(l.a)(e),Object(l.a)(null!==(n=t.stickers)&&void 0!==n?n:[]))}),[])}var p=function(){return window.zh_emoticon?Promise.resolve(d(window.zh_emoticon)):Object(u.loadScript)("https://unpkg.zhimg.com/@cfe/emoticon@1.2.2/lib/emoticon.js").then((function(){return window.zh_emoticon?d(window.zh_emoticon):[]}))},f=n(1);t.a=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.alwaysShow,n=void 0!==t&&t;return function(e){return c()((function(t){var o=Object(f.useState)(!1),c=Object(r.a)(o,2),l=c[0],u=c[1];return Object(f.useEffect)((function(){Object(s.c)()?u(!0):p().then((function(e){Object(s.e)(Object(i.camelizeKeys)(e)),u(!0)})).catch((function(){u(!0)}))}),[]),(l||n)&&Object(a.b)(e,Object.assign({},t))}),e)}}},1170:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),c=function(e){return a.a.createElement(o.a,e,a.a.createElement("defs",null,a.a.createElement("linearGradient",{id:"id-3811055512-a",x1:"11.015%",x2:"87.655%",y1:"18.594%",y2:"96.14%"},a.a.createElement("stop",{offset:"0%",stopColor:"#F2D9B6"}),a.a.createElement("stop",{offset:"100%",stopColor:"#BF8B43"}))),a.a.createElement("path",{fill:"url(#id-3811055512-a)",d:"M21.351 4.858A3.115 3.115 0 0 1 22.93 7.56v8.88a3.115 3.115 0 0 1-1.578 2.702l-7.774 4.44a3.185 3.185 0 0 1-3.154 0l-7.774-4.44A3.115 3.115 0 0 1 1.07 16.44V7.56c0-1.115.602-2.145 1.578-2.702l7.774-4.44a3.185 3.185 0 0 1 3.154 0l7.774 4.44zm-2.475 1.904L13.16 3.507a2.347 2.347 0 0 0-2.32 0L5.124 6.762a2.283 2.283 0 0 0-1.16 1.982v6.512c0 .817.442 1.573 1.16 1.982l5.716 3.255a2.347 2.347 0 0 0 2.32 0l5.716-3.255a2.283 2.283 0 0 0 1.16-1.982V8.744c0-.817-.442-1.573-1.16-1.982zm-9.874 4.13L12 5.76l2.998 5.131 2.466-2.12v6.343c0 .49-.4.886-.893.886H7.429a.89.89 0 0 1-.893-.887V8.771l2.466 2.12z"}))};c.defaultProps={name:"VIP"},t.a=c},1171:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(66),c=n(16),i=n(17),s=n(9),l=n(2),u=n(1),d=n(27),p=n(31),f=n(73),h=n(119),b=n(25);function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(s.a)(e);if(t){var a=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var v=function(e){Object(c.a)(n,e);var t=m(n);function n(){var e;return Object(r.a)(this,n),(e=t.call(this)).handleShieldUser=e.handleShieldUser.bind(Object(o.a)(e)),e}return Object(a.a)(n,[{key:"handleShieldUser",value:function(){var e=this.props,t=e.dispatch,n=e.user.urlToken,r=e.onClose;t(Object(h.n)(n,!0)).then((function(){return t(Object(b.h)("屏蔽成功"))})),r()}},{key:"render",value:function(){var e=this.props,t=e.onClose,n=e.shown,r=e.user;return Object(l.b)(f.b,{onClose:t,title:"确定要屏蔽".concat(r.name,"?"),children:n&&Object(l.c)("div",{children:["屏蔽后,对方将不能关注你、向你发私信、评论你的实名回答、使用「@」提及你、邀请你回答问题,但仍然可以查看你的公开信息。",Object(l.c)(f.a,{direction:"horizontal",children:[Object(l.b)(p.c,{onClick:t,color:"grey",children:"取消"}),Object(l.b)(p.c,{preset:"primary",color:"blue",onClick:this.handleShieldUser,children:"确定"})]})]})})}}]),n}(u.Component);t.a=Object(d.connect)()(v)},1172:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),c=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M18.376 5.624c-3.498-3.499-9.254-3.499-12.752 0-3.499 3.498-3.499 9.254 0 12.752 3.498 3.499 9.254 3.499 12.752 0 3.499-3.498 3.499-9.14 0-12.752zm-1.693 1.693c2.37 2.37 2.596 6.094.678 8.69l-9.367-9.48c2.708-1.919 6.32-1.58 8.69.79zm-9.48 9.48c-2.37-2.37-2.595-6.095-.676-8.69l9.48 9.48c-2.822 1.918-6.433 1.58-8.803-.79z",fillRule:"evenodd"}))};c.defaultProps={name:"Ban"},t.a=c},1178:function(e,t,n){"use strict";n.d(t,"a",(function(){return O})),n.d(t,"b",(function(){return y}));var r=n(2),a=n(1),o=n(389),c=n(1287),i=n(14),s=n(15),l=n(16),u=n(17),d=n(9),p=n(3),f=n.n(p),h=n(11),b=n.n(h);function m(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(d.a)(e);if(t){var a=Object(d.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(u.a)(this,n)}}var v=function(e){Object(l.a)(n,e);var t=m(n);function n(){return Object(i.a)(this,n),t.apply(this,arguments)}return Object(s.a)(n,[{key:"render",value:function(){var e=this.props,t=e.showReport,n=e.className,a=e.onReportClick,o=e.onMessageDelete;return Object(r.c)("ul",{className:b()("ActionMenu",n),children:[Object(r.b)("li",{className:"ActionMenu-item",onClick:o,children:"删除"}),t&&Object(r.b)("li",{className:"ActionMenu-item",onClick:a,children:"举报"})]})}}]),n}(a.Component);v.propsTypes={className:f.a.string,showReport:f.a.bool,onMessageDelete:f.a.func.isRequired,onReportClick:f.a.func.isRequired};var g=function(e,t){var n=e.isOpen,i=e.onToggleMenu,s=e.onDeleteClick,l=e.onReportClick,u=e.showReport;Object(a.useEffect)((function(){if(n)return window.addEventListener("wheel",i),function(){window.removeEventListener("wheel",i)}}),[n,i]);var d=Object(a.useCallback)((function(e){e.stopPropagation(),i()}),[i]);return Object(r.c)(r.a,{children:[Object(r.b)("button",{type:"button",onClick:d,"aria-label":"更多",ref:t,className:"Chat-ActionMenuPopover-Button",children:Object(r.b)(c.a,{className:"Message-status--more"})}),Object(r.b)(o.a,{isOpen:n,fixed:!0,arrowed:!0,target:null==t?void 0:t.current,children:Object(r.b)(v,{onMessageDelete:s,onReportClick:l,showReport:u})})]})},O=Object(a.forwardRef)(g),j=n(43),y=function(e){var t=e.handleDeleteClick,n=e.handleReportClick,o=e.showReport,c=Object(a.useState)(!1),i=Object(j.a)(c,2),s=i[0],l=i[1],u=Object(a.useRef)(),d=Object(a.useCallback)((function(){l((function(e){return!e}))}),[]),p=Object(a.useCallback)((function(){l(!1)}),[]),f=function(e){s&&u.current&&!u.current.contains(e.target)&&(l(!1),e.stopPropagation(),e.preventDefault())};return Object(a.useEffect)((function(){return document.addEventListener("click",f),function(){document.removeEventListener("click",f)}}),[s]),{popover:Object(r.b)(O,{ref:u,isOpen:s,onToggleMenu:d,onDeleteClick:t,onReportClick:n,showReport:o}),handleMouseLeave:p}}},1181:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(16),c=n(17),i=n(9),s=n(2),l=n(1),u=n(27),d=n(438),p=n(137),f=n(436),h=n(36);function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var m=function(e){Object(o.a)(n,e);var t=b(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).handleReceiveMessage=function(t){var n=e.props;(0,n.handleReceiveMessage)(t,n.currentUser.id)},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.currentUser,n=e.setChatMqttStatus,r=e.isChatMqttExisted;t&&"guest"!==t.userType&&(r||(Object(d.a)([{name:"zhihu/message/v1/im/user/".concat(t.id,"/"),onMessage:this.handleReceiveMessage}]),n(!0)))}},{key:"render",value:function(){var e=this.props.children;return Object(s.b)("div",{children:e})}}]),n}(l.Component);t.a=Object(u.connect)((function(e){return{currentUser:Object(h.b)(e),isChatMqttExisted:e.chat.global.isChatMqttExisted}}),{handleReceiveMessage:p.l,setChatMqttStatus:f.b})(m)},1273:function(e,t,n){"use strict";var r=n(1),a=n(589),o="element",c="text",i="empty",s="fragment",l=function(e,t){return function e(n){var a,l=n.node;return n.type=(a=l,r.isValidElement(a)?o:function(e){return"string"==typeof e||"number"==typeof e}(a)?c:function(e){return null==e||"boolean"==typeof e}(a)?i:Array.isArray(a)?s:void 0),n.type===o?n.children=r.Children.map(l.props.children,(function(t){return e({node:t,parent:n})})):n.type===s&&(n.children=r.Children.map(l,(function(t){return e({node:t,parent:n})}))),t(n),n}({node:e,parent:null})},u=function e(t,n){return[t].concat(null==(r=n(t))?[]:function(t){return e(t,n)}(r));var r},d=function(e){var t=!1;return e.reduce((function(e,n){if(e&&n&&a(String(e.node),String(n.node))){var r=(i=n,s=u(e,(function(e){return e.parent})),l=u(i,(function(e){return e.parent})),d=s.findIndex((function(e){return l.includes(e)})),[s[d],s[d-1]]);c=r[1],(o=r[0]).children.splice(o.children.indexOf(c)+1,0,{node:" "}),t=!0}var o,c,i,s,l,d;return n})),t},p=function(e){if(!e)return null;var t=[],n=l(e,(function(e){e.type===c&&""!==e.node&&t.push(e)}));return t.length&&d(t)?function e(t){return Array.isArray(t.children)?t.type===s?r.Children.map(t.children.map(e),(function(e){return e})):r.createElement(t.node.type,t.node.props,r.Children.map(t.children.map(e),(function(e){return e}))):t.node}(n):e},f=function(e){var t=e.component,n=e.children;return r.createElement(t,{children:p(n)})};f.defaultProps={component:r.Fragment||"span"},t.CJKSpace=f},1280:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(16),c=n(17),i=n(9),s=n(2),l=n(1),u=n.n(l),d=n(27),p=n(3),f=n.n(p),h=n(11),b=n.n(h),m=n(19),v=n(375),g=n(368),O=n(137),j=n(1167),y=n(43),w=n(31),C=n(73),k=n(78),E=n(373),R=n(60),M="3d198a56310c02c4a83efb9f4a4c027e",x=["https://www.zhihu.com/staffService/"+M];var S=Object(l.createContext)({showModal:!1,setShowModal:function(){return null}});function T(e){var t=e.item,n=e.selected,r=e.onClick,a=Object(k.c)((function(){return r(t)}));return Object(s.b)(w.c,{label:t.name,color:n?w.a.Blue:w.a.Grey,preset:w.b.Secondary,css:{marginRight:"8px"},onClick:a},t.id)}function I(e){var t=e.senderId,n=e.showModal,r=e.onClose,a=Object(l.useState)([]),o=Object(y.a)(a,2),c=o[0],i=o[1],u=Object(l.useState)(null),p=Object(y.a)(u,2),f=p[0],h=p[1],b=Object(d.useDispatch)(),m=Object(E.b)();Object(l.useEffect)((function(){n&&m("/api/v4/customer_service/question_tag",{ignoreCode:!0}).then((function(e){var t;i((null===(t=e.payload)||void 0===t?void 0:t.data)||[])})).catch((function(){return null}))}),[n,m]);var v=Object(k.c)(Object(k.b)((function(e){m("/api/v4/customer_service/choose_question_tag",{method:"POST",body:{adminId:M,tagId:e.id},ignoreCode:!0}).catch((function(){return null})),b(Object(O.p)({contentType:R.a.text,receiverId:t,data:{text:e.name}})),r(),h(null)}),300)),g=Object(k.c)((function(e){h(e.id),v(e)}));return Object(s.b)(C.b,{css:{width:"694px",".Modal-content":{padding:"0 0 55px 0",marginTop:0}},onClose:r,children:n&&Object(s.c)(s.a,{children:[Object(s.b)("div",{css:function(e){return{padding:"12px 0 10px 20px",fontSize:"20px",lineHeight:"28px",borderBottom:"1px solid "+e.colors.GBK09A,color:e.colors.GBK02A}},children:"选个问题类型,小管家为你解答"}),c.map((function(e){return Object(s.c)(l.Fragment,{children:[Object(s.b)("div",{css:function(e){return{marginTop:"20px",paddingLeft:"20px",fontSize:"15px",lineHeight:"18px",color:e.colors.GBK03A}},children:e.categoryName}),Object(s.b)("div",{css:{marginTop:"16px",paddingLeft:"20px"},children:e.items.map((function(e){return Object(s.b)(T,{item:e,selected:f===e.id,onClick:g},e.id)}))})]},e.categoryId)}))]})})}var N=n(0),B=n(1288),P=n(175),_=n(243),z=n(962),A=n(1007),L=n(241),U=n(1171),F=n(927),H=n(90),D=n(30),V=function(e){var t=e.message,n=Object(l.useRef)(),r=Object(l.useState)(!1),a=Object(y.a)(r,2),o=a[0],c=a[1];return Object(s.b)(H.Text,{ref:n,color:o?"inherit":"primary",css:{cursor:o?"text":"pointer"},onClick:function(){o||(c(!0),D.a.trackEvent(n.current,{action:"Click",id:6880}))},dangerouslySetInnerHTML:{__html:o?t.richText||t.text:t.extraContent}})};var q=function(e){var t=e.message,n=e.senderId,r=e.sendMessage,a=Object(k.c)((function(e){if("A"===e.target.tagName&&e.target.href){var t=e.target.href,a=Object(F.parse)(t.split("?")[1]).message,o=t.match(/www.zhihu.com\/inbox\/([\d\w]+)/);(null==o?void 0:o[1])&&n===o[1]&&(e.preventDefault(),r({contentType:R.a.text,receiverId:n,data:{text:a}}))}}));return Object(s.b)("div",{className:b()("TextMessage",{"TextMessage-sender":"sender"===t.userType,"TextMessage-receiver":"receiver"===t.userType}),children:t.unfriendly&&"sender"===t.userType?Object(s.b)(V,{message:t}):Object(s.b)(H.Text,{onClick:a,dangerouslySetInnerHTML:{__html:t.richText||t.text}})})},G=n(889),K=n(152);function W(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var J=function(e){Object(o.a)(n,e);var t=W(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).state={previewImg:null,imageUrl:e.props.image.url},e.getImageStyle=function(){var t=e.props.image,n=t.width,r=t.height,a=r/n;return r>R.d||n>R.d?a>1?{height:"".concat(R.d,"px"),minWidth:"".concat(R.g,"px")}:a<1?{width:"".concat(R.d,"px"),minHeight:"".concat(R.g,"px"),height:R.d*a}:{height:"".concat(R.d,"px"),width:"".concat(R.d,"px")}:{maxWidth:"".concat(R.d,"px"),maxHeight:"".concat(R.d,"px"),width:n,height:r}},e.isTempUrl=function(e){return e.startsWith("blob")},e.handleImageClick=function(t){var n=e.state.imageUrl;e.isTempUrl(n)||e.setState({previewImg:t.target})},e}return Object(a.a)(n,[{key:"componentDidUpdate",value:function(){var e=this,t=this.props.image.url,n=this.state.imageUrl;t!==n&&Object(K.loadImage)(t).then((function(){e.setState({imageUrl:t}),URL.revokeObjectURL(n)}))}},{key:"render",value:function(){var e=this,t=this.state,n=t.imageUrl,r=t.previewImg;return Object(s.c)("div",{children:[Object(s.b)("img",{className:b()("ImageMessage",{"ImageMessage--temp":this.isTempUrl(n)}),src:Object(K.imgUrl)(n,"hd"),onClick:this.handleImageClick,style:this.getImageStyle()}),r&&Object(s.b)(G.a,{className:"ImageMessage-ImageView",img:r,onClose:function(){return e.setState({previewImg:null})}})]})}}]),n}(l.Component);function Z(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}J.propTypes={image:f.a.shape({width:f.a.number,height:f.a.number,url:f.a.string})};var Q=function(e){Object(o.a)(n,e);var t=Z(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){var e=this.props.sticker.url;return Object(s.b)("img",{className:"StickerMessage",src:Object(K.imgUrl)(e,"xl")})}}]),n}(l.Component);Q.propTypes={sticker:f.a.shape({id:f.a.string,url:f.a.string})};var Y=n(7),X=n(942),$=n(232),ee=n(865),te=function(e){var t=e.result,n=e.isInMessage,r=e.onClick,a=t.name,o=t.coverPath,c=void 0===o?"https://i1.wp.com/pic4.zhimg.com/80/v2-231f5c4e7db8b6c08493a220be85705e_hd.png?ssl=1":o,i=t.className,s=void 0===i?"":i,l=t.intro;return u.a.createElement("div",{className:b()("KfeCollection-MessageEventCard",s,{"KfeCollection-MessageEventCard--InMessage":n}),onClick:r},u.a.createElement("img",{src:c,className:"KfeCollection-MessageEventCard-cover"}),u.a.createElement("div",{className:"KfeCollection-MessageEventCard-content"},u.a.createElement("div",{className:"KfeCollection-MessageEventCard-title"},a),u.a.createElement("div",{className:"KfeCollection-MessageEventCard-text"},l)))},ne=function(e){var t=e.result,n=e.onClick,r=e.isInMessage,a=void 0!==r&&r,o=e.hasClickZA,c=void 0===o||o,i=t.token,s=t.id;return u.a.createElement($.b,{block:"EcomMessageEventCard",content:{type:ee.e.event,id:s}},u.a.createElement($.e,{shouldTrackClick:c,zaType:"Card",zaAction:"Unknown",zaText:"留资卡片",zaEventType:"Unknown",onClick:function(e){c&&D.a.trackEvent(e.target,{id:a?9970:10048,action:"Click",name:"留资卡片"}),n(i)}},u.a.createElement(X.a,{options:[{},a?{card:{content:{id:String(s)}}}:{},{id:a?9968:10046,name:"留资卡片"}]},u.a.createElement(te,{result:t,isInMessage:a}))))};ne.propTypes={className:f.a.string,result:f.a.object.isRequired,extra:f.a.shape({ua:f.a.object,theme:f.a.string}).isRequired};var re=ne,ae=n(55),oe=n.n(ae),ce=n(128),ie=n(588);function se(){return(se=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e}).apply(this,arguments)}function le(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},o=Object.keys(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(e);for(r=0;r<o.length;r++)n=o[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var ue,de=[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(ue=ie.props)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(ue)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}(),["sx","variant"]),pe=new RegExp("^(".concat(de.join("|"),")$")),fe=/^m[trblxy]?$/,he=function(e){return function(t){var n={};for(var r in t)e(r||"")&&(n[r]=t[r]);return n}},be=he((function(e){return pe.test(e)})),me=he((function(e){return fe.test(e)})),ve=he((function(e){return!fe.test(e)})),ge=function(e){e.size;var t=le(e,["size"]);return u.a.createElement(ce.Box,se({as:"svg",xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"currentcolor"},t))},Oe=(Object(l.forwardRef)((function(e,t){return u.a.createElement(ce.Flex,se({ref:t,as:"label",tx:"forms",variant:"label"},e,{__css:{width:"100%"}}))})),Object(l.forwardRef)((function(e,t){return u.a.createElement(ce.Box,se({ref:t,as:"input",type:"text",tx:"forms",variant:"input"},e,{__css:{display:"block",width:"100%",p:2,appearance:"none",fontSize:"inherit",lineHeight:"inherit",border:"1px solid",borderRadius:"default",color:"inherit",bg:"transparent"}}))}))),je=function(e){return u.a.createElement(ge,e,u.a.createElement("path",{d:"M7 10l5 5 5-5z"}))},ye=(Object(l.forwardRef)((function(e,t){return u.a.createElement(ce.Flex,me(e),u.a.createElement(ce.Box,se({ref:t,as:"select",tx:"forms",variant:"select"},ve(e),{__css:{display:"block",width:"100%",p:2,appearance:"none",fontSize:"inherit",lineHeight:"inherit",border:"1px solid",borderRadius:"default",color:"inherit",bg:"transparent"}})),u.a.createElement(je,{sx:{ml:-28,alignSelf:"center",pointerEvents:"none"}}))})),Object(l.forwardRef)((function(e,t){return u.a.createElement(ce.Box,se({ref:t,as:"textarea",tx:"forms",variant:"textarea"},e,{__css:{display:"block",width:"100%",p:2,appearance:"none",fontSize:"inherit",lineHeight:"inherit",border:"1px solid",borderRadius:"default",color:"inherit",bg:"transparent"}}))})),function(e){return u.a.createElement(ge,e,u.a.createElement("path",{d:"M12 7c-2.76 0-5 2.24-5 5s2.24 5 5 5 5-2.24 5-5-2.24-5-5-5zm0-5C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))}),we=function(e){return u.a.createElement(ge,e,u.a.createElement("path",{d:"M12 2C6.48 2 2 6.48 2 12s4.48 10 10 10 10-4.48 10-10S17.52 2 12 2zm0 18c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8z"}))},Ce=function(e){return u.a.createElement(u.a.Fragment,null,u.a.createElement(ye,se({},e,{__css:{display:"none","input:checked ~ &":{display:"block"}}})),u.a.createElement(we,se({},e,{__css:{display:"block","input:checked ~ &":{display:"none"}}})))},ke=(Object(l.forwardRef)((function(e,t){var n=e.className,r=e.sx,a=e.variant,o=void 0===a?"radio":a,c=le(e,["className","sx","variant"]);return u.a.createElement(ce.Box,null,u.a.createElement(ce.Box,se({ref:t,as:"input",type:"radio"},c,{sx:{position:"absolute",opacity:0,zIndex:-1,width:1,height:1,overflow:"hidden"}})),u.a.createElement(ce.Box,se({as:Ce,"aria-hidden":"true",tx:"forms",variant:o,className:n,sx:r},be(c),{__css:{mr:2,borderRadius:9999,color:"gray","input:checked ~ &":{color:"primary"},"input:focus ~ &":{bg:"highlight"}}})))})),function(e){return u.a.createElement(ge,e,u.a.createElement("path",{d:"M19 3H5c-1.11 0-2 .9-2 2v14c0 1.1.89 2 2 2h14c1.11 0 2-.9 2-2V5c0-1.1-.89-2-2-2zm-9 14l-5-5 1.41-1.41L10 14.17l7.59-7.59L19 8l-9 9z"}))}),Ee=function(e){return u.a.createElement(ge,e,u.a.createElement("path",{d:"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2z"}))},Re=function(e){return u.a.createElement(u.a.Fragment,null,u.a.createElement(ke,se({},e,{__css:{display:"none","input:checked ~ &":{display:"block"}}})),u.a.createElement(Ee,se({},e,{__css:{display:"block","input:checked ~ &":{display:"none"}}})))},Me=(Object(l.forwardRef)((function(e,t){var n=e.className,r=e.sx,a=e.variant,o=void 0===a?"checkbox":a,c=le(e,["className","sx","variant"]);return u.a.createElement(ce.Box,null,u.a.createElement(ce.Box,se({ref:t,as:"input",type:"checkbox"},c,{sx:{position:"absolute",opacity:0,zIndex:-1,width:1,height:1,overflow:"hidden"}})),u.a.createElement(ce.Box,se({as:Re,"aria-hidden":"true",tx:"forms",variant:o,className:n,sx:r},be(c),{__css:{mr:2,borderRadius:4,color:"gray","input:checked ~ &":{color:"primary"},"input:focus ~ &":{color:"primary",bg:"highlight"}}})))})),Object(l.forwardRef)((function(e,t){var n=se({},e);return u.a.createElement(ce.Box,se({ref:t,as:"input",type:"range",tx:"forms",variant:"slider"},n,{__css:{display:"block",width:"100%",height:4,my:2,cursor:"pointer",appearance:"none",borderRadius:9999,color:"inherit",bg:"gray",":focus":{outline:"none",color:"primary"},"&::-webkit-slider-thumb":{appearance:"none",width:16,height:16,bg:"currentcolor",border:0,borderRadius:9999,variant:"forms.slider.thumb"}}}))})),Object(l.forwardRef)((function(e,t){var n=e.checked,r=le(e,["checked"]);return u.a.createElement(ce.Box,se({ref:t,as:"button",type:"button",role:"switch",tx:"forms",variant:"switch","aria-checked":n},r,{__css:{appearance:"none",m:0,p:0,width:40,height:24,color:"primary",bg:"transparent",border:"1px solid",borderColor:"primary",borderRadius:9999,"&[aria-checked=true]":{bg:"primary"},":focus":{outline:"none",boxShadow:"0 0 0 2px"}}}),u.a.createElement(ce.Box,{"aria-hidden":!0,style:{transform:n?"translateX(16px)":"translateX(0)"},sx:{mt:"-1px",ml:"-1px",width:24,height:24,borderRadius:9999,border:"1px solid",borderColor:"primary",bg:"background",transitionProperty:"transform",transitionTimingFunction:"ease-out",transitionDuration:"0.1s",variant:"forms.switch.thumb"}}))})),function(e){var t=e.className,n=void 0===t?"":t,r=e.eventData,a=e.onClose,o=e.onSubmit,c=e.extra,i=r.token,s=r.name,d=r.intro,p=r.submitText,f=c.originPhone,h=Object(l.useState)(f),m=oe()(h,2),v=m[0],g=m[1],O=function(e){D.a.trackEvent(e.target,{id:9972,action:"Submit"}),o({token:i,phone:v})};return u.a.createElement($.b,{block:"EcomMessageEventModal",content:{type:ee.e.event}},u.a.createElement($.e,{zaText:"留资卡片",zaType:"Popup"},u.a.createElement(X.a,{options:[{},{},{id:9971,name:"留资卡片"}]},u.a.createElement(C.b,{title:s,onClose:a,className:b()("KfeCollection-MessageEventModal",n),key:i},u.a.createElement("div",{className:"KfeCollection-MessageEventModal-intro"},d),u.a.createElement(Oe,{className:"KfeCollection-MessageEventModal-phone",placeholder:"点击输入用户手机号码",value:v,onChange:function(e){g(e.target.value)},fontSize:"14px",color:"GBK02A",width:"100%"}),u.a.createElement("div",{className:"KfeCollection-MessageEventModal-buttonGroup"},u.a.createElement($.a,{zaType:"Button",zaAction:"Unknown",zaText:"取消",onClick:function(e){D.a.trackEvent(e.target,{id:9972,action:"Cancel"}),a()}},u.a.createElement(w.c,{className:"KfeCollection-MessageEventModal-cancelButton"},"取消")),v?u.a.createElement($.a,{zaType:"Button",zaAction:"Unknown",zaText:p||"确认报名"},u.a.createElement(w.c,{onClick:O,preset:w.b.Primary,color:w.a.Blue,type:"submit"},p||"确认报名")):u.a.createElement(w.c,{onClick:O,disabled:!v,preset:w.b.Primary,color:w.a.Blue,type:"submit"},p||"确认报名"))))))});Me.propTypes={className:f.a.string,eventData:f.a.object.isRequired,extra:f.a.shape({ua:f.a.object,theme:f.a.string,originPhone:f.a.any}).isRequired,onClose:f.a.func,onSubmit:f.a.func};var xe=Me,Se=n(1102),Te=n(25),Ie=function(e){var t=e.senderId,n=e.message,r=e.isEcomMerchant,a=Object(d.useDispatch)(),o=Object(d.useSelector)((function(e){var t;return null===(t=e.account.accountInfo)||void 0===t?void 0:t.phoneNo})),c=Object(l.useState)({}),i=Object(y.a)(c,2),u=i[0],p=i[1],f=Object(l.useState)(!1),h=Object(y.a)(f,2),b=h[0],m=h[1],v=Object(l.useMemo)((function(){return Object(Y.camelizeKeys)(n)}),[n]),g=v.ecomCard,j=void 0===g?{}:g,w=Object(l.useMemo)((function(){return function(e){var t,n=e.data,r=void 0===n?{}:n,a=e.title;return{cardData:Object.assign({},r,{name:r.name||a,coverPath:r.cover}),sendModalData:Object.assign({},r,{name:r.name||a,submitText:null==r||null===(t=r.formFields)||void 0===t?void 0:t.submitText})}}(j)}),[j]),C=function(){m(!1)};return Object(s.c)(s.a,{children:[1===j.cardType&&Object(s.b)(re,{result:Object.assign({},w.cardData,{id:v.id}),extra:{},isInMessage:!0,hasClickZA:!r||r&&"sender"===n.userType,onClick:function(){return e={type:"event",info:w.sendModalData,camelMessage:v},t=e.info,void(r&&"receiver"===n.userType?a(Object(Te.h)("商家不能参与自己发起的活动哦")):(p(Object.assign({},t)),m(!0)));var e,t}}),2===j.cardType&&Object(s.b)(q,{message:Object.assign({},n,{text:"web 上暂不支持优惠券消息,请至 app 查看"})}),b&&Object(s.b)(xe,{eventData:u,extra:{originPhone:o},onSubmit:function(e){return function(e){var n=e.cardType,r=e.modalData;if(1===n){var o=r.token,c=r.phone,i={receiverId:t,phone:c};a(Object(O.o)({contentType:"ecomcard",token:o,data:i})).then((function(){C()})).catch(Se.a)}}({cardType:1,modalData:e})},onClose:C})]})},Ne=n(366),Be=function(e){return new RegExp(/https:\/\/www.zhihu.com\/inbox\/+[\s\S]*?is_ecom=1/).test(e)};var Pe=function(e){var t=e.senderId,n=e.message,r=e.isEcomMerchant,a=void 0!==r&&r,o=Object(d.useDispatch)(),c=Object($.i)().trackEvent,i=Object(l.useState)(""),u=Object(y.a)(i,2),p=u[0],f=u[1],h=Object(k.c)((function(e){if(!e)return"";var t=(new DOMParser).parseFromString(e,"text/html"),n=t.querySelectorAll("a");if(!n.length)return"";n.forEach((function(e){Be(e.href)&&e.setAttribute("data-za-not-track-link",!0)})),f(t.querySelector("body").innerHTML)}));Object(l.useEffect)((function(){h(n.richText||n.text)}),[h,n]);var m=Object(k.c)((function(e){var r,i,s,l,u=e.target,d=u.tagName,p=u.href;if("A"===d){if(p&&!Be(p))return;if(e.stopPropagation(),e.preventDefault(),a&&"receiver"===n.userType)return void o(Object(Te.h)("您不可以点击自己的卡片哦"));D.a.trackEvent(e.target,{id:9969,action:"Click",name:"欢迎语卡片"},{module:[{card:{content:{type:"Message",id:String(n.id)}}}]}),c({block:"EcomWelcome",action:"Unknown",eventType:"Click",elementLocation:{type:"Text",content:{type:"Message",id:n.id}}}),r=e,s=n.id,l=n.contentType,o(Object(O.p)({contentType:l,receiverId:t,data:(i={},Object(N.a)(i,l,n[l]),Object(N.a)(i,"text",r.target.text||"问题等待配置"),i),tempMessageId:s}))}}));return Object(s.b)("div",{className:b()("TextMessage","EcomWelcomeTextMessage",{"TextMessage-sender":"sender"===n.userType,"TextMessage-receiver":"receiver"===n.userType}),children:Object(s.b)($.b,{block:"MessageEcomWelcomeCard",content:{type:"Message",id:n.id},children:Object(s.b)($.e,{zaType:"Card",zaAction:"Unknown",zaText:"交付欢迎语卡片",zaEventType:"Unknown",onClick:m,children:Object(s.b)(Ne.a,{trackCardShow:!0,view:{id:9968,name:"欢迎语卡片"},extra:{module:[{card:{content:{id:String(n.id)}}}]},children:Object(s.b)(H.Text,{dangerouslySetInnerHTML:{__html:p}})})})})})},_e=n(176),ze=function(e){return(new Date).getTime()-Number(e)<864e5?Object(_e.toSmartString)(e):Object(_e.toAbsoluteDateTimeString)(e)},Ae=function(e){var t=e.time;if(!t)return null;var n=new Date(t);return Object(s.b)("time",{dateTime:n.toISOString(),children:ze(n)})},Le=Object(l.memo)(Ae),Ue=function(e){var t=e.message,n=e.onRequestReport,r=e.onRequestBlock,a=Object(l.useRef)(),o=Object(l.useContext)(S),c=o.showModal,i=o.setShowModal;return Object(s.b)(H.Text,{ref:a,m:"20px auto",p:"10px 12px",bg:"GBK10A",color:"GBK07A",maxWidth:388,minHeight:40,fontSize:12,sx:{lineHeight:"20px",borderRadius:"8px",a:{color:"primary"}},dangerouslySetInnerHTML:{__html:Object(l.useMemo)((function(){return t.text.replace("https://www.zhihu.com/report?report_location=1","#report").replace("http://www.zhihu.com/defriend","#block")}),[t.text])},onClick:function(e){var t=e.target.href;t&&(e.preventDefault(),n&&t.endsWith("#report")?(n(),D.a.trackEvent(a.current,{action:"Click",id:6882})):r&&t.endsWith("#block")?(r(),D.a.trackEvent(a.current,{action:"Click",id:6883})):!function(e){return x.includes(e)}(t)?window.open(t,"_blank"):c||i(!0))}})},Fe=n(1178);function He(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var De=function(e){Object(o.a)(n,e);var t=He(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).ref=Object(l.createRef)(),e.state={isMoreActionMenuShow:!1,isReportModalShow:!1,isShieldUserModalShown:!1},e.handleDocClick=function(t){e.state.isMoreActionMenuShow&&e.ref.current&&!e.ref.current.contains(t.target)&&(t.stopPropagation(),t.preventDefault(),e.setState({isMoreActionMenuShow:!1}))},e.toggleMoreActionMenu=function(){e.setState({isMoreActionMenuShow:!e.state.isMoreActionMenuShow})},e.handleMessageDelete=function(){var t=e.props,n=t.deleteMessage,r=t.message.id,a=t.sender.id;P.a.confirm(Object(s.b)("div",{style:{textAlign:"center"},children:"是否删除该条消息"}),{title:"删除消息"}).then((function(){return n(r,a)}),(function(){}))},e.handleReSendMessage=function(){var t=e.props,n=t.deleteLocalMessage,r=t.sender.id,a=t.sendMessage,o=t.message,c=o.id,i=o.contentType;if(i!==R.a.ecomcard)if(i!==R.a.image)n(c,r),a({contentType:i,receiverId:r,data:Object(N.a)({},i,o[i]),tempMessageId:c});else{var s=o.image.url;if(s.startsWith("blob")){var l=o.file,u=e.props,d=u.uploadImage,p=u.setImageSendFailure,f=c;d(l).then((function(e){return a({contentType:R.a.image,receiverId:r,data:{image:{height:e.payload.dataRawheight,width:e.payload.dataRawwidth,url:e.payload.src}},tempMessageId:f})})).then((function(){URL.revokeObjectURL(s)})).catch((function(){p({tempMessageId:f,receiverId:r,file:l})}))}else a({contentType:i,receiverId:r,data:Object(N.a)({},i,o[i]),tempMessageId:c})}},e.handleReSendIconClick=function(){P.a.confirm(null,{title:"是否重新发送消息"}).then((function(){e.handleReSendMessage()}),(function(){}))},e.renderMessage=function(t){var n=e.props,r=n.sender.id,a=n.isEcomMerchant,o=n.sendMessage,c=t.isEcomWelcomeCard;return t.contentType===R.a.text?c?Object(s.b)(Pe,{senderId:r,message:t,isEcomMerchant:a}):Object(s.b)(q,{message:t,senderId:r,sendMessage:o}):t.contentType===R.a.image?Object(s.b)(J,{image:t.image}):t.contentType===R.a.sticker?Object(s.b)(Q,{sticker:t.sticker}):t.contentType===R.a.ecomcard?Object(s.b)(Ie,{senderId:r,message:t,isEcomMerchant:a}):"web 上暂不支持此类消息,请至 app 查看"},e.toggleReportModal=function(){e.setState({isReportModalShow:!e.state.isReportModalShow})},e.renderMessageStatus=function(t){if(t===R.e.success){var n=e.state.isMoreActionMenuShow,r="receiver"===e.props.message.userType;return Object(s.b)("div",{className:"Message-status--wrapper",children:Object(s.b)(Fe.a,{ref:e.ref,isOpen:n,onToggleMenu:e.toggleMoreActionMenu,onDeleteClick:e.handleMessageDelete,onReportClick:e.toggleReportModal,showReport:!r})})}return t===R.e.loading?Object(s.b)(A.a,{className:"Message-status--loading"}):t===R.e.failure?Object(s.b)(B.a,{className:"Message-status--failure",onClick:e.handleReSendIconClick}):null},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){document.addEventListener("click",this.handleDocClick)}},{key:"componentWillUnmount",value:function(){document.removeEventListener("click",this.handleDocClick)}},{key:"render",value:function(){var e=this,t=this.props,n=t.message,r=t.sender,a=t.receiver,o=n.type,c=n.userType,i=n.status,l=n.showTime,u=n.createdTime,d=n.id,p=this.state,f=p.isReportModalShow,h=p.isShieldUserModalShown,m=Object(s.b)(s.a,{children:l&&Object(s.b)("p",{className:"Message-time",children:Object(s.b)(Le,{time:u})})});if("risk_tip"===o||"tip"===o)return Object(s.c)(s.a,{children:[m,f&&Object(s.b)(L.a,{type:"message",urlToken:n.associateId,shown:!0,onClose:this.toggleReportModal}),h&&Object(s.b)(U.a,{shown:h,onClose:function(){return e.setState({isShieldUserModalShown:!1})},user:r}),Object(s.b)(Ue,{message:n,onRequestReport:this.toggleReportModal,onRequestBlock:function(){e.setState({isShieldUserModalShown:!0})}})]});var v="receiver"===c?a:r;return Object(s.c)("div",{className:"Message-wrapper",children:[m,f&&Object(s.b)(L.a,{type:"message",urlToken:d,shown:!0,onClose:this.toggleReportModal}),Object(s.c)("div",{className:b()("Message",{"Message--reverse":"receiver"===c}),children:[Object(s.b)(z.a,{user:v,size:40}),Object(s.c)("div",{className:b()("Message-content",{"Message-content--reverse":"receiver"===c}),children:[this.renderMessage(n),Object(s.b)("div",{className:"Message-status",children:this.renderMessageStatus(i)})]})]})]})}}]),n}(l.Component);De.propsTypes={message:f.a.object,sender:f.a.object,receiver:f.a.object};var Ve=Object(d.connect)(null,{deleteMessage:O.f,deleteLocalMessage:O.e,sendMessage:O.p,setImageSendFailure:O.q,uploadImage:_.b})(De);function qe(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ge=function(e){Object(o.a)(n,e);var t=qe(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).state={showQuestionTagModal:!1},e.scrollToBottom=function(){e.messageBoxEle.scrollTop=e.messageBoxEle.scrollHeight},e.handleGetHistoryMessage=function(t){var n=e.props,r=n.isLoading,a=n.nextApiUrl,o=n.getHistoryMessages,c=n.senderId,i=n.isEnd;!t||r||i||o({senderId:c,nextApiUrl:a})},e.setShowQuestionTagModal=function(t){return e.setState({showQuestionTagModal:t})},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.getHistoryMessages,n=e.senderId,r=e.messages,a=e.setMessageRead,o=e.sender,c=void 0===o?{}:o;0!==r.length&&c.id?this.scrollToBottom():t({senderId:n}).catch((function(){location.href="//www.zhihu.com/messages"})),a(n)}},{key:"componentDidUpdate",value:function(e){var t=e.messages,n=void 0===t?[]:t,r=this.props,a=r.messages,o=r.setMessageRead,c=r.senderId,i=n[n.length-1]||{},s=a[a.length-1]||{};i.id!==s.id&&(this.scrollToBottom(),"sender"===s.userType&&o(c));var l=e.sender,u=(l=void 0===l?{}:l).id,d=this.props.sender;(d=void 0===d?{}:d).id!==u&&this.scrollToBottom()}},{key:"render",value:function(){var e=this,t=this.props,n=t.messages,r=t.receiver,a=t.sender,o=void 0===a?{}:a,c=t.senderId,i=t.isLoading,l=t.isEcomMerchant,u=this.state.showQuestionTagModal;return o.id?Object(s.c)(S.Provider,{value:{showModal:u,setShowModal:this.setShowQuestionTagModal},children:[Object(s.b)(g.b,{isLoading:i,onLoad:this.handleGetHistoryMessage,placeholder:Object(s.b)(v.a,{className:"MessagesBox-loading"}),isPrevDrained:!1,isDrained:!0,getContainer:function(e){return e},className:"MessagesBox",onRef:function(t){e.messageBoxEle=t},children:n.map((function(e){return Object(s.b)("div",{children:Object(s.b)(Ve,{message:e,receiver:r,sender:o,isEcomMerchant:l})},e.tempMessageId||e.id)}))}),Object(s.b)(I,{showModal:u,onClose:function(){return e.setShowQuestionTagModal(!1)},senderId:c})]}):Object(s.b)(v.a,{className:"MessagesBox-loading"})}}]),n}(l.Component);Ge.PropsTypes={senderId:f.a.string};var Ke=Object(m.compose)(Object(d.connect)((function(e,t){var n=t.senderId,r=e.chat.chats[n]||{},a=r.receiver,o=void 0===a?{}:a,c=r.sender,i=void 0===c?{}:c,s=r.messages,l=void 0===s?[]:s,u=r.isLoading,d=void 0!==u&&u,p=r.isEnd;return{receiver:o,sender:i,messages:l,isLoading:d,isEnd:void 0===p||p,nextApiUrl:r.nextApiUrl,isEcomMerchant:(e.chat.chats||{}).isEcomMerchant}}),{getHistoryMessages:O.k,setMessageRead:O.r}),Object(j.a)())(Ge),We=n(34),Je=n(111),Ze=n.n(Je),Qe=n(135),Ye=n(242),Xe=n(24),$e=n(961),et=n(1380);function tt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var nt=function(e){Object(o.a)(n,e);var t=tt(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).checkSize=function(t){var n=e.props.showNotification;if(t.size>1024*Xe.R*1024)return n("请上传小于 ".concat(Xe.R,"M 的图片。"),"red"),!1},e.sendImage=function(t){var n=t.file;(0,e.props.handleSendImage)(n)},e}return Object(a.a)(n,[{key:"render",value:function(){var e=this,t=this.props.className;return Object(s.b)($e.a,{accept:"image/png,image/jpeg",onRef:function(t){e.uploadInput=t},customUpload:this.sendImage,beforeUpload:this.checkSize,multiple:!0,children:Object(s.b)(et.a,{className:t})})}}]),n}(l.Component);nt.propTypes={senderId:f.a.string,className:f.a.string,handleSendImage:f.a.func};var rt=Object(d.connect)(null,{showNotification:Te.h})(nt),at=n(1381),ot=n(1103),ct=n(1116);function it(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var st=function(e){Object(o.a)(n,e);var t=it(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).state={isEmoticonsHidden:!0},e.toggleEmoticonPanel=function(){e.setState({isEmoticonsHidden:!e.state.isEmoticonsHidden})},e.handleSelectEmoticon=function(t,n){var r=e.props,a=r.insertEmoji,o=r.handleSendEmoticon;"emoji"===n?a(t.placeholder):o(t),e.toggleEmoticonPanel()},e}return Object(a.a)(n,[{key:"render",value:function(){var e=this.props.className,t=this.state.isEmoticonsHidden;return Object(s.c)("div",{className:"EmoticonTool",children:[!t&&Object(s.b)("div",{className:"EmoticonTool--mask",onClick:this.toggleEmoticonPanel}),!t&&Object(s.b)(ct.a,{className:"EmoticonTool-panel",onSelectEmoticon:this.handleSelectEmoticon}),Object(s.b)(at.a,{className:b()("EmoticonTool-icon",e),onClick:this.toggleEmoticonPanel})]})}}]),n}(l.Component);st.propTypes={senderId:f.a.string,className:f.a.string};var lt=Object(ot.a)()(st),ut=n(4),dt={0:{prefix:null,text:"免费",key:""},1:{prefix:"¥",key:"discountPrice"},2:{prefix:"¥",key:"discountPrice"},3:{suffix:"折",key:"discountRate"}},pt=function(e){var t=e.couponInfo,n=void 0===t?{}:t,r=n.couponType,a=dt[void 0===r?1:r],o=a.text||"discountPrice"===a.key?n[a.key]/100:n[a.key];return u.a.createElement("div",{className:b()("KfeCollection-MessageCouponCard-coupon")},a.prefix&&u.a.createElement("span",{className:b()("KfeCollection-MessageCouponCard-tag","tag-prefix")},a.prefix),o,a.suffix&&u.a.createElement("span",{className:b()("KfeCollection-MessageCouponCard-tag","tag-suffix")},a.suffix))},ft=function(e){var t=e.result,n=e.isInMessage,r=t.title,a=t.description,o=t.className,c=void 0===o?"KfeCollection-MessageCouponCard-orangeCoupon--light":o;return u.a.createElement("div",{className:b()("KfeCollection-MessageCouponCard",c,{"KfeCollection-MessageCouponCard--InMessage":n})},u.a.createElement("div",{className:"KfeCollection-MessageCouponCard-content"},u.a.createElement("div",{className:"KfeCollection-MessageCouponCard-title"},r),u.a.createElement("div",{className:"KfeCollection-MessageCouponCard-text"},a)),u.a.createElement(pt,{couponInfo:t}))},ht=function(e){var t=e.result,n=e.onClick,r=e.isInMessage,a=void 0!==r&&r,o=e.extra.theme,c=void 0===o?"light":o,i=t.id;return u.a.createElement($.b,{block:"EcomMessageCouponCard",content:{type:ee.e.coupon,id:i}},u.a.createElement($.a,{shouldTrackShow:!0,zaType:"Card",zaAction:"Unknown",zaText:"留资卡片",zaEventType:"Unknown",onClick:function(e){D.a.trackEvent(e.target,{id:10049,action:"Click",name:String(i)}),n()}},u.a.createElement(X.a,{options:[{},{},{id:10047,name:String(i)}]},u.a.createElement(ft,{result:t,isInMessage:a,theme:c}))))};ht.propTypes={className:f.a.string,result:f.a.object.isRequired,extra:f.a.shape({ua:f.a.object,theme:f.a.string,styles:f.a.object}).isRequired};var bt=ht,mt=n(255),vt=n(131),gt=Object.assign;var Ot=function(e){return u.a.createElement(vt.a,gt({width:"24",height:"24",fill:"none",viewBox:"0 0 26 26"},e),u.a.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z",opacity:".01"}),u.a.createElement("path",{fill:"#646464",d:"M16.875 7.149c.182 1.255-.302 3.01-1.436 5.369-.328.6-.62 1.479-.597 1.768.013.169.08.316.215.448l3.042-3.042a1.626 1.626 0 012.228-.068l.747.742c.611.612.634 1.59.068 2.228l-1.483 1.487c.455.17 1 .51 1.314.982.315.471.532 1.493.532 3.177 0 .663-.532 1.273-1.236 1.273l-6.062-.015c-.25.193-.528.346-.826.453l-2.161.652a.85.85 0 01-.844-.212c-.203-.203-.318-.5-.2-.896-.003.003-6.924.018-6.924.018A1.247 1.247 0 012 20.259l.013-1.49c-.013-.77.13-1.155.314-1.435.181-.274.443-.54.63-.73l.014-.013c.445-.452 1.444-.737 2.777-.98 2.487-.454 2.875-.819 2.915-1.325.01-.131-.162-.851-.548-1.606-1.255-2.444-1.705-3.934-1.49-5.502C6.944 4.827 8.662 3 11.752 3c3.09 0 4.776 1.77 5.122 4.149zm.65 6.886l-5.272 5.282c-.271.332-.678 1.873-.678 1.873s1.582-.41 1.92-.721l5.235-5.229-1.205-1.205zM8.11 7.382C8.391 5.7 9.513 4.506 11.754 4.5c2.241-.005 3.397 1.221 3.635 2.863.129.883-.288 2.394-1.285 4.469-.439.8-.81 1.918-.758 2.57a2.12 2.12 0 00.649 1.393l-2.577 2.582c-.557.62-.79 1.614-.79 1.614l-7.125.02.012-1.334c0-.408.08-.634.36-.873.233-.2.552-.34.877-.439.451-.11.918-.208 1.372-.303 1.016-.214 1.972-.415 2.563-.706.866-.426 1.378-1.061 1.472-1.954.075-.707-.72-2.44-.72-2.44S7.85 8.956 8.111 7.382zm10.34 9.91l-2.713 2.71 4.26.008s-.056-1.624-.213-2.012c-.082-.155-.275-.458-1.335-.707zm.575-4.752a.375.375 0 01.489.036l.71.717a.376.376 0 01-.036.489l-.574.574-1.206-1.206.617-.61z",fillRule:"evenodd",clipRule:"evenodd"}))},jt=Object.assign;var yt=function(e){return u.a.createElement(vt.a,jt({width:"24",height:"24",fill:"none",viewBox:"0 0 24 24"},e),u.a.createElement("path",{fill:"#fff",d:"M0 0h24v24H0z",opacity:".01"}),u.a.createElement("path",{fill:"#646464",d:"M3.004 18.5a2.285 2.285 0 002.285 2.284h13.736a2.285 2.285 0 002.285-2.285v-3.732a.763.763 0 00-.759-.846h-.01a1.526 1.526 0 01.01-3.053.763.763 0 00.759-.847V6.29a2.285 2.285 0 00-2.285-2.285H5.289A2.285 2.285 0 003.004 6.29v3.732a.763.763 0 00.759.846h.015a1.526 1.526 0 01-.015 3.053.763.763 0 00-.759.846v3.732zM17.5 12.394c0 1.423.975 2.62 2.293 2.957v3.147a.768.768 0 01-.767.768H5.289a.768.768 0 01-.767-.768v-3.147a3.054 3.054 0 000-5.915V6.29c0-.424.343-.768.767-.768h13.736c.424 0 .767.344.767.768v3.147a3.054 3.054 0 00-2.293 2.958zm-3.807 0a1.535 1.535 0 11-3.07 0 1.535 1.535 0 013.07 0zm1.517 0a3.052 3.052 0 11-6.104 0 3.052 3.052 0 016.104 0z",fillRule:"evenodd",clipRule:"evenodd"}))},wt=n(233),Ct=n.n(wt),kt=n(1067),Et=n.n(kt),Rt=function(e){var t=e.cardList,n=e.onSend,r=e.onClose,a=e.isEvent,o=a?re:bt;return Object(s.b)(C.b,{title:a?"活动":"优惠券",onClose:r,className:"EcomCardTool-Modal",children:Object(s.b)("ul",{className:"EcomCardTool-Modal--list",children:t.map((function(e,t){return Object(s.b)("li",{className:"EcomCardTool-Modal--cardItem",children:Object(s.b)(o,{result:e,extra:{},onClick:function(){return n(Object.assign({},e,{cardType:a?1:2}))}})},e.token||t)}))})})};Rt.propTypes={onClose:f.a.func.isRequired,cardList:f.a.array,onSend:f.a.func};var Mt=function(e){var t=e.senderId,n=e.className,r=e.isEvent,a=e.onHandleFirstInterActive,o=Object(d.useSelector)((function(e){return e.env.theme})),c=Object(d.useDispatch)(),i=Object(l.useState)(!1),u=Object(y.a)(i,2),p=u[0],f=u[1],h=Object(l.useState)([]),m=Object(y.a)(h,2),v=m[0],g=m[1],j=Object(k.c)((function(){c(Object(O.i)({senderId:t})).then((function(e){var t;return g(null===(t=e.payload)||void 0===t?void 0:t.data)}))})),w=Object(k.c)((function(){c(Object(O.h)()).then((function(e){var t,n,r;return n=null===(t=e.payload)||void 0===t?void 0:t.data,r=!Et()(n)&&n.map((function(e){return Object.assign({},e,{className:1===(null==e?void 0:e.template.id)?"KfeCollection-MessageCouponCard-orangeCoupon--".concat(o):"KfeCollection-MessageCouponCard-blueCoupon--".concat(o),description:e.intro})}))||[],void g(Object(ut.a)(r))}))}));Object(l.useEffect)((function(){r&&j()}),[r,j]),Object(l.useEffect)((function(){r||w()}),[r,w]);var C=r?Ot:yt,E=function(e){var n=e.token,r=e.cardType,o=e.id;(function(e){var n=e.token,r=e.cardType;if(a(),1===r){var o=Ze()("TempEventCard_");return c(Object(O.a)(t,o,r)),c(Object(O.n)({contentType:R.a.ecomcard,token:n,data:{receiverId:t,cardType:r},tempMessageId:o}))}return c(Object(O.n)({contentType:R.a.ecomcard,id:n,data:{receiverId:t,cardType:r}}))})({token:n||o,cardType:r}).then((function(){f(!1)})).catch(Ct.a)};return Object(s.b)($.b,{block:"EcomMessageEcomCardTool",content:{type:"Message"},children:Object(s.b)(Ne.a,{trackCardShow:!0,view:{id:r?9975:9976,url:"fakeurl://dialogue/user.*"},children:Object(s.c)("div",{className:"EcomCardTool",children:[Object(s.b)($.e,{shouldTrackClick:!0,zaText:r?"留资卡片":"优惠券卡片",zaType:"Button",zaEventType:"Click",children:Object(s.b)(C,{className:b()("EcomCardTool-icon",n),width:22,height:22,onClick:function(e){p||!Et()(v)?(f(!p),Object(mt.a)(e,{id:r?9978:9979,action:"Click"})):c(Object(Te.h)("请先去 ecom.zhihu.com 配置","red"))}})}),p&&Object(s.b)(Rt,{isEvent:r,cardList:v,onSend:function(e){return E(e)},onClose:function(){return f(!1)}})]})})})};Mt.propTypes={senderId:f.a.string,className:f.a.string,isEvent:f.a.bool,onHandleFirstInterActive:f.a.func};var xt=Mt;function St(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Tt=function(e){Object(o.a)(n,e);var t=St(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){var e=this.props,t=e.senderId,n=e.insertEmoji,r=e.handleSendImage,a=e.handleSendEmoticon,o=e.onHandleFirstInterActive,c=e.isEcomMerchant;return Object(s.c)("ul",{className:"ToolBar",children:[Object(s.b)("li",{className:"ToolBar-item",children:Object(s.b)(lt,{className:"ToolBar-Icon",senderId:t,insertEmoji:n,handleSendEmoticon:a})}),Object(s.b)("li",{className:"ToolBar-item",children:Object(s.b)(rt,{className:"ToolBar-Icon",senderId:t,handleSendImage:r})}),c&&Object(s.c)(s.a,{children:[Object(s.b)("li",{className:"ToolBar-item",children:Object(s.b)(xt,{isEvent:!0,className:"ToolBar-Icon",senderId:t,onHandleFirstInterActive:o},"event")},"event"),Object(s.b)("li",{className:"ToolBar-item",children:Object(s.b)(xt,{isEvent:!1,className:"ToolBar-Icon",senderId:t,onHandleFirstInterActive:o},"coupon")},"coupon")]})]})}}]),n}(l.Component);Tt.propTypes={senderId:f.a.string,insertEmoji:f.a.func,handleSendImage:f.a.func,handleSendEmoticon:f.a.func,onHandleFirstInterActive:f.a.func};var It=Object(d.connect)((function(e){return{isEcomMerchant:(e.chat.chats||{}).isEcomMerchant}}))(Tt),Nt=function(e){var t=Object(l.useState)(!1),n=Object(y.a)(t,2),r=n[0],a=n[1];return r?null:Object(s.b)(Bt,Object.assign({},e,{dispose:function(){return a(!0)}}))},Bt=function(e){var t=e.endSignal,n=void 0!==t&&t,r=e.dispose,a=Object(l.useState)(0),o=Object(y.a)(a,2),c=o[0],i=o[1];Object(l.useEffect)((function(){i(Date.now())}),[]);var s=Object(k.c)((function(e){var t=e-c;t>0&&t<=6e4&&(Object(mt.a)(null,{id:9980,action:"StatusReport"}),null==r||r())}));return Object(l.useEffect)((function(){if(n){var e=Date.now();s(e)}}),[s,n]),Object(k.i)(r,6e4),null};Nt.propTypes={endSignal:f.a.bool};var Pt=Nt;function _t(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var zt=function(e){Object(o.a)(n,e);var t=_t(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).state={cursorPosition:0,firstInteractive:!1},e.inputRef=Object(l.createRef)(),e.countDownTimer=null,e.handleSetFirsetInteractive=function(){e.setState({firstInteractive:!0})},e.checkSize=function(t){var n=e.props.showNotification;return!(t.size>1024*Xe.R*1024)||(n("请上传小于 ".concat(Xe.R,"M 的图片。"),"red"),!1)},e.handleKeyDown=function(t){var n=e.props,r=n.inputMessage,a=n.senderId,o=n.inputValue;13===t.keyCode&&(t.ctrlKey||t.metaKey)?r({senderId:a,inputValue:"".concat(o,"\n")}):13!==t.keyCode||t.shiftKey||e.handleSendTextMessage(t)},e.handleSendImage=function(t){var n;if(t&&e.checkSize(t)){var r=e.props,a=r.uploadImage,o=r.sendMessage,c=r.senderId,i=r.addTempImageMessage,s=r.setImageSendFailure,l=Ze()("TempImage_");e.handleSetFirsetInteractive(),Object(Ye.a)(t).then((function(e){var n=URL.createObjectURL(e);Object(K.loadImage)(n).then((function(r){var u=r.height,d=r.width;i(c,n,l,u,d),a(e).then((function(e){return o({contentType:R.a.image,receiverId:c,data:{image:{height:e.payload.dataRawheight,width:e.payload.dataRawwidth,url:e.payload.src}},tempMessageId:l})})).catch((function(){s({tempMessageId:l,receiverId:c,file:t})}))}))})),null===(n=e.inputRef.current)||void 0===n||n.focus()}},e.handleSendEmoticon=function(t){var n,r=t.id,a=t.dynamicImageUrl,o=t.staticImageUrl,c=t.title,i=e.props,s=i.senderId,l=i.sendMessage;e.handleSetFirsetInteractive(),l({contentType:"sticker",receiverId:s,data:{sticker:{sticker_id:r,url:a||o,title:c}}}),D.a.trackEvent(null,{id:3640,action:"Click",name:c}),null===(n=e.inputRef.current)||void 0===n||n.focus()},e.handleSendTextMessage=function(t){var n=e.props,r=n.senderId,a=n.sendMessage,o=n.inputValue,c=n.location.query,i=c.source_type,s=c.source_id;o.length>1e4?P.a.alert("发送文字不得超过 1 万字,请重新编辑后再次发送",{title:"发送失败"}):o.trim()&&(e.handleSetFirsetInteractive(),t.preventDefault(),a({contentType:R.a.text,receiverId:r,data:{text:o},sourceType:i,sourceId:s}),D.a.trackEvent(null,{id:5309,action:"Click"}))},e.insertEmoji=function(t){var n,r=e.props,a=r.inputMessage,o=r.senderId,c=r.inputValue,i=e.state.cursorPosition,s=[c.slice(0,i),t,c.slice(i)].join("");e.setState({cursorPosition:i+t.length}),a({senderId:o,inputValue:s}),D.a.trackEvent(null,{id:3641,action:"Click",name:t.slice(1,t.length-1)}),null===(n=e.inputRef.current)||void 0===n||n.focus()},e.handleBlur=function(t){e.setState({cursorPosition:t.target.selectionStart})},e.handleInputMessage=function(t){var n=e.props;(0,n.inputMessage)({senderId:n.senderId,inputValue:t.target.value})},e.handleInputRef=function(t){e.inputRef.current=t},e}return Object(a.a)(n,[{key:"componentDidMount",value:function(){this.inputRef.current&&(this.inputRef.current.focus(),this.inputRef.current.addEventListener("keydown",this.handleKeyDown))}},{key:"componentWillUnmount",value:function(){this.inputRef.current&&this.inputRef.current.removeEventListener("keydown",this.handleKeyDown)}},{key:"render",value:function(){var e=this.props,t=e.inputValue,n=e.senderId,r=e.sender;return(null==r?void 0:r.isForbidden)?Object(s.b)("div",{className:"InputBox",css:{justifyContent:"flex-end"},children:Object(s.b)("div",{className:"InputBox-footer",children:Object(s.c)("div",{className:"InputBox-footerDesc",css:{textAlign:"center",paddingRight:0},children:["要反馈",Object(s.b)(We.Link,{to:"/messages/3d198a56310c02c4a83efb9f4a4c027e",css:function(e){return{color:e.colors.GBK06A,fontWeight:"bold",paddingLeft:"4px"}},children:"@知乎小管家"})]})})}):Object(s.c)("div",{className:"InputBox",children:[Object(s.b)(Pt,{endSignal:this.state.firstInteractive}),Object(s.b)(It,{senderId:n,insertEmoji:this.insertEmoji,handleSendImage:this.handleSendImage,handleSendEmoticon:this.handleSendEmoticon,onHandleFirstInterActive:this.handleSetFirsetInteractive}),Object(s.b)(Qe.a,{multiline:!0,spread:!0,value:t,className:"InputBox-input",onRef:this.handleInputRef,onChange:this.handleInputMessage,onBlur:this.handleBlur}),Object(s.c)("div",{className:"InputBox-footer",children:[Object(s.b)("div",{className:"InputBox-footerDesc",children:"按 Enter 键发送"}),Object(s.b)(w.c,{preset:"primary",color:"blue",className:"InputBox-sendBtn",onClick:this.handleSendTextMessage,disabled:!t.trim(),children:"发送"})]})]})}}]),n}(l.Component);var At=Object(m.compose)(We.withRouter,Object(d.connect)((function(e,t){var n=t.senderId,r=(e.chat.chats[n]||{}).inputValue;return{inputValue:void 0===r?"":r}}),{sendMessage:O.p,inputMessage:O.m,uploadImage:_.b,addTempImageMessage:O.b,setImageSendFailure:O.q,showNotification:Te.h}))(zt),Lt=n(783);function Ut(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Ft=function(e){Object(o.a)(n,e);var t=Ut(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).state={isAlertShow:!0},e.handleCloseAlert=function(){e.setState({isAlertShow:!1})},e}return Object(a.a)(n,[{key:"render",value:function(){var e=this.props,t=e.message,n=e.className;return this.state.isAlertShow?Object(s.c)("div",{className:b()("AbnormalAlert",n),children:[Object(s.b)("span",{className:"AbnormalAlert-message",dangerouslySetInnerHTML:{__html:t}}),Object(s.b)(Lt.a,{className:"AbnormalAlert-icon",onClick:this.handleCloseAlert})]}):null}}]),n}(l.Component);Ft.propsTypes={message:f.a.object,className:f.a.string};var Ht=n(123),Dt=Object.assign;var Vt=function(e){return u.a.createElement(vt.a,Dt({width:"200",height:"88",fill:"none",viewBox:"0 0 200 88"},e),u.a.createElement("path",{fill:"#E3EAF1",d:"M90.78 11.188H52.292v66.743h9.43l1.259 8.04 12.754-8.04H90.78V11.189zM74.51 69.597l-7.488 4.713-.734-4.713h-5.389V19.47h21.186v50.126H74.51zM45.189 41.222H31.193c0-1.473.105-2.98.123-4.557V19.477H47.27v-4.054a4.224 4.224 0 00-1.262-2.99 4.307 4.307 0 00-3.024-1.238H18.072c.088-.277.175-.555.262-.797C19.192 7.834 21.938.002 21.938.002a13.32 13.32 0 00-7.54 2.183c-1.784 1.248-2.851 2.131-4.286 6.082-1.662 4.54-3.114 8.923-4.094 11.54C4.514 23.981.875 31.328.875 31.328a18.295 18.295 0 007.872-1.906c3.5-1.854 5.249-4.696 6.421-9.01l.28-.936h7.295v17.188c0 1.56-.14 3.067-.227 4.557H9.64a8.404 8.404 0 00-5.914 2.426 8.242 8.242 0 00-2.449 5.856h20.399a55.358 55.358 0 01-2.432 11.401 52.49 52.49 0 01-9.412 16.478A103.517 103.517 0 010 86.687s9.78 3.674 16.952-2.98c4.34-4.037 8.223-11.92 10.095-17.898a87.786 87.786 0 003.499-16.34h18.65v-4.28a3.918 3.918 0 00-1.169-2.81 4.022 4.022 0 00-2.838-1.157z"}),u.a.createElement("path",{fill:"#E3EAF1",d:"M35.222 58.361l-7.226 4.661 15.746 23.305a21.572 21.572 0 002.099-6.931 9.843 9.843 0 00-.875-6.775l-9.744-14.26zm125.555-14.01v-29.23a7322.86 7322.86 0 0029.496-1.507l2.659-.156c1.207-1.248 2.764-7.485 2.152-9.443-.228-.78-.665-2.08-1.995-1.733a103.979 103.979 0 01-13.366 2.27c-8.642 1.005-12.403 1.265-24.387 2.131-20.994 1.525-39.713 2.253-39.713 2.253a7.857 7.857 0 00.64 3.114 7.923 7.923 0 001.823 2.617 8.012 8.012 0 002.713 1.697 8.085 8.085 0 003.169.507c7.12-.294 17.494-.78 28.114-1.282v28.762h-39.941c0 2.197.881 4.303 2.449 5.857a8.406 8.406 0 005.914 2.425h31.578v22.11c0 2.772-1.452 3.725-3.849 3.794h-12.247a12.979 12.979 0 002.613 4.826 13.117 13.117 0 004.385 3.335 19.423 19.423 0 008.468.866c4.251-.208 9.272-2.581 9.272-11.158V52.633h35.252c1.067 0 2.091-.42 2.845-1.167A3.965 3.965 0 00200 48.648v-4.297h-39.223z"}),u.a.createElement("path",{fill:"#E3EAF1",d:"M133.169 24.611a7.192 7.192 0 00-2.065-1.914 7.273 7.273 0 00-5.476-.882 7.26 7.26 0 00-2.571 1.167l-1.172.85 13.296 18.279 6.998-5.06-9.01-12.44zm46.048-.617L169.455 36.8l6.997 5.198 14.119-18.522-1.172-.867a7.294 7.294 0 00-8.066-.49 7.196 7.196 0 00-2.116 1.876z"}))};function qt(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var Gt=function(e){Object(o.a)(n,e);var t=qt(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"componentDidMount",value:function(){var e=this.props,t=e.senderId,n=e.getEcomProfile;(0,e.getAccountInfo)(),t&&n(t)}},{key:"render",value:function(){var e=this.props,t=e.className,n=e.senderId,r=e.sender,a=e.warning,o=a.status,c=a.message,i=r||{},l=i.name,u=void 0===l?"":l,d=i.vipInfo,p=((void 0===d?{}:d)||{}).vipIcon;return n?Object(s.c)("div",{className:b()("ChatBox",t),children:[o&&Object(s.b)(Ft,{message:c,className:"ChatBox-alert"}),Object(s.c)("header",{className:"ChatBox-title",children:[Object(s.b)("span",{children:u}),p&&Object(s.b)("img",{src:p.url,className:"ChatBox-titleVipIcon"})]}),Object(s.b)("div",{className:"MessagesBox-wrapper",children:Object(s.b)(Ke,{senderId:n})}),Object(s.b)(At,{senderId:n,sender:r})]}):Object(s.b)("div",{className:"ChatBox-empty",children:Object(s.b)(Vt,{className:"ChatBox-emptyImage"})})}}]),n}(l.Component);Gt.propTypes={senderId:f.a.string,className:f.a.string};t.a=Object(d.connect)((function(e,t){var n=t.senderId,r=e.chat.chats[n]||{},a=r.receiver,o=void 0===a?{}:a,c=r.sender,i=void 0===c?{}:c,s=r.warning;return{receiver:o,sender:i,warning:void 0===s?{}:s}}),{getAccountInfo:Ht.e,getEcomProfile:O.j})(Gt)},1287:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),c=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M5 14a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm7 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4zm7 0a2 2 0 1 1 0-4 2 2 0 0 1 0 4z",fillRule:"evenodd"}))};c.defaultProps={name:"Dots"},t.a=c},1288:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),c=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M12 2C6.477 2 2 6.477 2 12s4.477 10 10 10 10-4.477 10-10S17.523 2 12 2zm-.034 2.966c1.949 0 1.485 1.807 1.485 2.211 0 .115-.785 7.79-.785 7.79h-1.4s-.785-7.623-.785-7.738c0-.416-.463-2.263 1.485-2.263zm1.057 13.522c-.294.287-.647.43-1.056.43-.41 0-.762-.142-1.058-.43a1.429 1.429 0 0 1-.443-1.07c0-.41.148-.762.443-1.057a1.443 1.443 0 0 1 1.058-.442c.409 0 .762.143 1.056.43.296.287.443.644.443 1.07 0 .427-.147.783-.443 1.07z",fillRule:"evenodd"}))};c.defaultProps={name:"Alert"},t.a=c},1329:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(14),a=n(15),o=n(16),c=n(17),i=n(9),s=n(2),l=n(1),u=n(3),d=n.n(u),p=n(73),f=n(31),h=n(783),b=n(1181),m=n(1280);function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var g=function(e){Object(o.a)(n,e);var t=v(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){var e=this.props,t=e.memberHashId,n=e.isModalShow,r=e.handleCloseModal;return Object(s.b)(p.b,{className:"ChatBoxModal",spread:!0,onClose:r,contentClassName:"ChatBoxModal-content",closeButton:Object(s.b)(f.c,{preset:"plain",className:"ChatBoxModal-closeButton",onClick:r,"aria-label":"关闭",children:Object(s.b)(h.a,{className:"ChatBoxModal-closeIcon"})}),children:n&&Object(s.b)(b.a,{handleReceiveMessage:this.handleReceiveMessage,children:Object(s.b)(m.a,{type:"default",senderId:t,className:"Chat-ChatBox"},t)})})}}]),n}(l.Component);g.propTypes={memberHashId:d.a.string,handleCloseModal:d.a.func,isModalShow:d.a.bool}},1380:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),c=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M13.25 5.5H6.868c-.755 0-1.368.613-1.368 1.368v10.264c0 .755.613 1.368 1.368 1.368h10.264c.755 0 1.368-.613 1.368-1.368V10.75H20v6.467A2.783 2.783 0 0 1 17.217 20H6.783A2.783 2.783 0 0 1 4 17.217V6.783A2.783 2.783 0 0 1 6.783 4h6.467v1.5zM8.158 13.4a1.033 1.033 0 0 1 1.744-.078l.258.37a.782.782 0 0 0 1.303-.031l1.332-2.113a1.173 1.173 0 0 1 2.01.043l2.03 3.537A1.25 1.25 0 0 1 15.748 17H8.25a1.252 1.252 0 0 1-1.085-1.873l.992-1.728zM9.5 11a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm3.75-5.5a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5zM18.5 4V2.25a.75.75 0 1 1 1.5 0V4h1.75a.75.75 0 1 1 0 1.5H20v1.75a.75.75 0 1 1-1.5 0V5.5h-1.75a.75.75 0 1 1 0-1.5h1.75zm.75 7.5a.75.75 0 1 1 0-1.5.75.75 0 0 1 0 1.5z"}))};c.defaultProps={name:"AddImage"},t.a=c},1381:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),c=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M7.523 13.5h8.954c-.228 2.47-2.145 4-4.477 4-2.332 0-4.25-1.53-4.477-4zM12 21a9 9 0 1 1 0-18 9 9 0 0 1 0 18zm0-1.5a7.5 7.5 0 1 0 0-15 7.5 7.5 0 0 0 0 15zm-3-8a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3zm6 0a1.5 1.5 0 1 1 0-3 1.5 1.5 0 0 1 0 3z"}))};c.defaultProps={name:"Emotion"},t.a=c},1410:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(16),c=n(17),i=n(9),s=n(2),l=n(3),u=n.n(l),d=n(1),p=n(27),f=n(11),h=n.n(f),b=n(1172),m=n(31),v=n(870),g=n(241),O=n(66),j=n(807),y=n(30),w=n(25),C=n(1329),k=n(24);function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var R=function(e){Object(o.a)(n,e);var t=E(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).state={modalShown:!1},e.handleSendMessage=function(){var t=e.props,n=t.onModalOpen,r=t.user.allowMessage,a=t.dispatch,o=t.doNotCheckAllowMessageSetting;r||void 0===r&&o?(e.setState({modalShown:!0}),n&&n()):a(Object(w.h)(k.U.blocked,"red")),y.a.trackEvent(Object(O.a)(e),{action:"Message",element:"Button",is_intent:!0})},e.handleCloseModal=function(){var t=e.props.onModalClose;e.setState({modalShown:!1}),t&&t()},e}return Object(a.a)(n,[{key:"render",value:function(){var e=this.props,t=e.user,n=e.preset,r=e.color,a=e.icon,o=e.label,c=e.className,i=e.tooltip,l=e.tooltipPreset,u=this.state.modalShown,d="3d198a56310c02c4a83efb9f4a4c027e"===t.id;return Object(s.c)(s.a,{children:[Object(s.b)(m.c,{preset:n,color:r,className:c,icon:a,label:o,onClick:this.context.authRequired(this.handleSendMessage,d?k.W.serviceAccountMessage:k.W.message),"data-tooltip":i,"data-tooltip-preset":l}),Object(s.b)(C.a,{memberHashId:t.id,handleCloseModal:this.handleCloseModal,isModalShow:u})]})}}]),n}(d.Component);R.propTypes={onModalOpen:u.a.func,onModalClose:u.a.func},R.defaultProps={preset:"outline",color:"grey",icon:j.a,label:"发私信",doNotCheckAllowMessageSetting:!1},R.contextTypes={authRequired:u.a.func};var M=Object(p.connect)()(R),x=n(119);function S(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var T=function(e){Object(o.a)(n,e);var t=S(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).state={reportModalShown:!1},e.handleShieldUser=function(){var t=e.props,n=t.user.urlToken,r=t.updateUserBlocking,a=t.showNotification;r(n,!1).then((function(){return a("屏蔽已取消")}))},e}return Object(a.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.user,r=t.user,a=r.urlToken,o=r.isBlocking,c=r.isOrg,i=t.className,l=t.buttonClassName,u=t.onModalOpen,d=t.onModalClose,p=this.context.authRequired,f=this.state.reportModalShown,O=h()("MemberButtonGroup",i);return o?Object(s.c)("div",{className:O,children:[Object(s.c)(m.c,{className:l,preset:"primary",color:"red",onClick:this.handleShieldUser,children:[Object(s.b)(b.a,{center:!0,text:!0})," 已屏蔽"]}),!c&&Object(s.c)(m.c,{className:l,onClick:p((function(){e.setState({reportModalShown:!0}),u&&u()}),k.W.report),children:["举报用户",Object(s.b)(g.a,{shown:f,onClose:function(){e.setState({reportModalShown:!1}),d&&d()},type:"member",urlToken:a,zaEnabled:!0})]})]}):Object(s.c)("div",{className:O,children:[Object(s.b)(v.a,{id:a,type:n.type,gender:n.gender,isFollowing:n.isFollowing,className:l,preset:v.a.PRESETS.primary}),Object(s.b)(M,{user:n,className:l,onModalOpen:u,onModalClose:d})]})}}]),n}(d.Component);T.contextTypes={authRequired:u.a.func},T.propTypes={user:u.a.object.isRequired,buttonClassName:u.a.string,onModalOpen:u.a.func,onModalClose:u.a.func};t.a=Object(p.connect)(null,{updateUserBlocking:x.n,showNotification:w.h})(T)},1458:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(16),c=n(17),i=n(9),s=n(2),l=n(3),u=n.n(l),d=n(1),p=n(11),f=n.n(p),h=n(31),b=n(30),m=n(1410),v=n(24);function g(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var O=function(e){Object(o.a)(n,e);var t=g(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){var e=this,t=this.props,n=t.user,r=t.user.isOrg,a=t.className,o=t.buttonClassName,c=t.onModalOpen,i=t.onModalClose,l=this.context,u=l.currentUser,d=l.authRequired,p=l.router,g=f()("ProfileButtonGroup",a);return u&&n.urlToken===u.urlToken?Object(s.b)("div",{className:g,children:Object(s.c)(h.c,{color:"blue",className:o,onClick:d((function(){b.a.trackEvent(e,{action:"OpenUrl",element:"Link"},{link:{url:"".concat(location.origin,"/people/edit")}}),p.push("/people/edit")}),v.W.editProfile),children:["编辑",r?"机构":"个人","资料"]})}):Object(s.b)(m.a,{user:n,className:g,buttonClassName:o,onModalOpen:c,onModalClose:i})}}]),n}(d.Component);O.contextTypes={router:u.a.object.isRequired,currentUser:u.a.object,authRequired:u.a.func},O.propTypes={user:u.a.object.isRequired,buttonClassName:u.a.string,onModalOpen:u.a.func,onModalClose:u.a.func},t.a=O},1674:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),c=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M9.676 11.252c-.243.433-.542.85-.494 1.237.189 1.509 2.938 1.807 3.746 2.816.59.736.835 1.852.892 3.725.01.303 0 .97-.867.97H1.933c-.915 0-.925-.643-.915-.936.062-1.877.292-3.02.895-3.76.812-.994 3.743-1.267 3.872-2.872.03-.361-.246-.74-.493-1.18C3.917 8.802 3.39 4 7.466 4s3.506 4.941 2.21 7.252zm8.073.79l.002.641c1.57 1.766 4.47 1.307 4.851 3.166.125.61.328 1.538.384 3.232.009.284.014.919-.905.919-.92 0-5.523-.021-6.875-.019 0-2.806-.144-5.987-2.707-6.285.537-.331 1.725-.504 2.178-1.013l.002-.64c-.881.118-2.679-.541-2.679-.541.61-.64.747-1.387 1.192-4.317.355-2.93 2.835-2.903 3.022-2.903.187 0 2.667-.027 3.028 2.903.439 2.93.577 3.677 1.186 4.317 0 0-1.797.659-2.68.54z",fillRule:"evenodd"}))};c.defaultProps={name:"Users"},t.a=c},1822:function(e,t,n){"use strict";var r=n(1),a=n.n(r),o=n(18),c=function(e){return a.a.createElement(o.a,e,a.a.createElement("path",{d:"M17 6.998h3.018c1.098 0 1.975.89 1.982 2.002v10a1.993 1.993 0 0 1-1.987 2H3.98A1.983 1.983 0 0 1 2 19l.009-10.003c0-1.11.873-1.999 1.971-1.999L7 7V5c.016-1.111.822-2 2-2h6c.98 0 1.86.889 2 2v1.998zM9 7h6V5.5s0-.5-.5-.5h-5c-.504 0-.5.5-.5.5V7z",fillRule:"evenodd"}))};c.defaultProps={name:"Company"},t.a=c},848:function(e,t,n){"use strict";n.d(t,"a",(function(){return m}));var r=n(35),a=n(43),o=n(2),c=n(1),i=n(63),s=n(90),l=n(232),u=n(69),d=n.n(u),p=n(367),f=function(e){return/^\w+:\/\//.test(e)?e:location.origin+e},h=function(e,t){var n=t.params,r=t.onRequestOpen,o=Object(p.b)();return function(t){var c=e.href,s=e.onClick;if(s&&s(t),!t.defaultPrevented){var l=function(e,t){if(!t)return e;var n=e.split("#"),r=Object(a.a)(n,2),o=r[0],c=r[1],i=o+(o.includes("?")?"&":"?")+t;return c?i+"#"+c:i}(f(c),n);return o.ZhihuHybrid?(t.preventDefault(),void i.a.dispatch("base/openURL",{url:l})):o.isMiniProgram?(t.preventDefault(),void function(e,t){var n,r=function(){var n,r,a,o=null,c=null;if(t.WxMiniProgram)o=null===(r=window.wx)||void 0===r||null===(a=r.miniProgram)||void 0===a?void 0:a.navigateTo;else if(t.JDMiniProgram){var i,s;o=null===(i=window.jd)||void 0===i||null===(s=i.miniProgram)||void 0===s?void 0:s.navigateTo}var l,u=null===(n=/\/topic\/(\d+)/.exec(e))||void 0===n?void 0:n[1];(u&&(t.WxMiniProgram?c="/pages/topic?id=".concat(u):t.JDMiniProgram&&(c="/pages/topic/index?id=".concat(u))),c)?null===(l=o)||void 0===l||l({url:c}):/^http(s)?:/.test(e)&&(location.href=e)};!t.WxMiniProgram||(null===(n=window.WeixinJSBridge)||void 0===n?void 0:n.invoke)?r():document.addEventListener("WeixinJSBridgeReady",r,!1)}(l,o)):void((null==r?void 0:r({ua:o,url:l}))&&t.preventDefault())}}},b=function(e,t){var n=t.extra;return{zaType:"Button",zaAction:"OpenUrl",zaEventType:"Click",shouldTrackClick:!0,extra:d()({link:{get url(){return f(e)}}},n)}},m=Object(c.forwardRef)((function(e,t){var n=e.params,a=e.onRequestOpen,c=e.extra,i=Object(r.a)(e,["params","onRequestOpen","extra"]);return Object(o.b)(l.c,Object.assign({as:s.Link},b(i.href,{extra:c}),i,{ref:t,onClick:h(i,{params:n,onRequestOpen:a})}))}));t.b=function(e){var t=e.params,n=e.onRequestOpen,a=e.children,o=e.extra,i=Object(r.a)(e,["params","onRequestOpen","children","extra"]);return Object(c.cloneElement)(a,Object(l.j)(Object.assign({},b(a.props.href,{extra:o}),i,{ref:a.ref,onClick:h(a.props,{params:t,onRequestOpen:n})})))}},865:function(e,t,n){"use strict";n.d(t,"c",(function(){return i})),n.d(t,"a",(function(){return o})),n.d(t,"b",(function(){return c})),n.d(t,"d",(function(){return a})),n.d(t,"e",(function(){return s})),n.d(t,"f",(function(){return l}));var r={general:"general",live:"live",publication:"publication",album:"album",special:"special",manga:"manga"},a=(Object.assign({},r,{album_chapter:r.album,album_video_chapter:r.album,album_paid_column:r.album,paid_column_chapter:r.album,training:r.album,training_bundle:r.album,training_chapter:r.album,web_literature:r.publication,instabook:r.publication,ebook_audio:r.publication,publication_chapter:r.publication,publication_paid_magazine:r.publication,magazine_section:r.publication,paid_answer:r.album,assessment:r.album}),{live:"Live 讲座",album:"盐选专栏",album_paid_column:"盐选专栏",album_chapter:"盐选专栏",album_video_chapter:"盐选专栏",paid_column_chapter:"盐选专栏",publication:"电子书",publication_chapter:"电子书章节",instabook:"讲书",ebook_audio:"有声书",publication_paid_magazine:"盐选杂志",special:"专题",training:"训练营",training_bundle:"训练营",training_chapter:"训练营",web_literature:"网络文学",magazine_section:"杂志文章",manga:"漫画"}),o={live:"Live 讲座",album:"盐选专栏",album_chapter:"盐选专栏",album_video_chapter:"盐选专栏",album_paid_column:"盐选专栏",paid_column_chapter:"盐选专栏",assessment:"盐选专栏",training:"盐选专栏",training_bundle:"盐选专栏",training_chapter:"盐选专栏",publication:"电子书",publication_chapter:"电子书",instabook:"电子书",ebook_audio:"电子书",publication_paid_magazine:"电子书",special:"电子书",web_literature:"电子书",magazine_section:"电子书",manga:"电子书"},c={live:r.live,album:r.album,album_chapter:r.album,album_paid_column:r.album,album_video_chapter:r.album,training:r.album,training_bundle:r.album,training_chapter:r.album,paid_column_chapter:r.album,assessment:r.album,publication:r.publication,publication_chapter:r.publication,instabook:r.publication,ebook_audio:r.publication,publication_paid_magazine:r.publication,special:r.publication,web_literature:r.publication,magazine_section:r.publication,manga:r.publication},i=["live","album","album_chapter","album_video_chapter","paid_column_chapter","publication_chapter","magazine_section","album_paid_column","assessment","special"],s={paidAnswer:"PaidAnswer",paidPost:"PaidPost"},l={paid_magazine:"PaidMagazine",paid_column:"PaidColumn",album:"RemixAlbum",ebook:"EBook",instabook:"InstaBook",literature:"Literature",training:"Training",training_bundle:"TrainingBundle",special:"Special",ebook_audio:"AudioBook",live:"Live",publication:"EBook",web_literature:"EBook",album_chapter:"RemixAlbum",album_paid_column:"RemixAlbum",album_video_chapter:"RemixAlbum",manga:"Manga",free_conversation:"FreeConversation",event:"Event",Onebox:"OneBox"}},870:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(16),c=n(17),i=n(9),s=n(2),l=n(3),u=n.n(l),d=n(1),p=n(19),f=n(27),h=n(11),b=n.n(h),m=n(940),v=n.n(m),g=n(811),O=n(31),j=n(30),y=n(232),w=n(378),C=n(53),k=n(1023),E=n(97),R=n(102),M=n(185),x=n(323),S=n(386),T=n(153),I=n(379),N=n(24);function B(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var P={default:"default",primary:"primary"},_=function(e){Object(o.a)(n,e);var t=B(n);function n(){var e;Object(r.a)(this,n);for(var a=arguments.length,o=new Array(a),c=0;c<a;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).zaRef=Object(d.createRef)(),e.state={hovered:!1,isFetching:!1},e.handleMouseEnter=function(){e.setState({hovered:!0})},e.handleMouseLeave=function(){e.setState({hovered:!1})},e.toggleFollow=function(t){var n=e.props,r=n.isFollowing,a=n.type,o=n.id,c=n.zaId,i=n.useCustomZa,s=n.onFollowButtonClick,l=!r;i||(j.a.trackEvent(t.target,Object.assign({action:l?"Follow":"UnFollow",element:"Button",element_name:N.ab[a]},c&&{id:c})),e.zaRef.current.trackEvent({action:l?"Follow":"UnFollow",eventType:"Click",elementLocation:{type:"Button"}}));var u="toggleFollow".concat(a.slice(0,1).toUpperCase()).concat(a.slice(1)),d=e.props[u](o,l);v()(d)&&(e.setState({isFetching:!0}),d.then((function(){e.setState({isFetching:!1}),s&&s()})).catch((function(){return e.setState({isFetching:!1})})))},e.handleToggleFollow=function(t){e.props.authRequired?e.props.authRequired(e.toggleFollow,N.W.follow,!0)(t):e.props.ua.Zhihu?e.toggleFollow(t):e.context.authRequired(e.toggleFollow,N.W.follow)(t)},e.handleClick=function(t){var n=e.props.onClick;n&&!n(t)||(e.handleToggleFollow(t),t.stopPropagation())},e}return Object(a.a)(n,[{key:"render",value:function(){var e,t,n,r=this.state.hovered,a=this.props,o=a.onRef,c=a.preset,i=a.entityHidden,l=a.type,u=a.isFollowing,d=a.gender,p=a.className,f=a.children,h=a.isMobile,m=a.disabled;u?(e="primary",n=r?"取消关注":"已关注",t={color:"grey"}):(e=c,t={color:"blue"},n=f||("people"===l||"rewardPeople"===l?[Object(s.b)(g.a,{className:"FollowButton-icon",text:!0,center:!0},"icon"),"关注".concat("number"==typeof d&&-1!==d?N.N[d]:"")]:"关注".concat(i?"":w.b[l])));var v=this.state.isFetching;return Object(s.c)(O.c,Object.assign({onRef:o,preset:e,onClick:this.handleClick,className:b()("FollowButton",p)},t,!h&&{onMouseEnter:this.handleMouseEnter,onMouseLeave:this.handleMouseLeave},{disabled:m||v,children:[Object(s.b)(y.d,{ref:this.zaRef}),n]}))}}]),n}(d.Component);_.contextTypes={authRequired:u.a.func},_.propTypes={preset:u.a.oneOf(Object.values(P)),type:u.a.oneOf(w.a).isRequired,id:u.a.oneOfType([u.a.number,u.a.string]).isRequired,zaId:u.a.number,useCustomZa:u.a.bool},_.defaultTypes={preset:P.default},_.PRESETS=P;t.a=Object(p.compose)(Object(f.connect)((function(e){return{ua:e.env.userAgent,isMobile:Object(C.d)(e,{includeTablet:!0})}}),{toggleFollowQuestion:R.nb,toggleFollowCollection:M.d,toggleFollowColumn:x.e,toggleFollowRoundtable:S.m,toggleFollowTopic:T.M,toggleFollowPeople:E.a,toggleFollowRewardPeople:I.o,toggleFollowClub_mask:k.a}))(_)},889:function(e,t,n){"use strict";var r=n(20),a=n.n(r),o=n(21),c=n.n(o),i=n(22),s=n.n(i),l=n(23),u=n.n(l),d=n(13),p=n.n(d),f=n(3),h=n.n(f),b=n(1),m=n.n(b),v=n(11),g=n.n(v),O=n(937),j=n(152),y=n(79),w=n.n(y),C=n(143),k=n(5);function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var a=p()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return u()(this,n)}}var R={top:10,left:20},M={top:0,left:0};var x=function(e){s()(n,e);var t=E(n);function n(){var e;a()(this,n);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).scrollerRef=m.a.createRef(),e.state={transEnded:!1,rect:null,translate:null,scale:null},e.getBoundingClientRect=function(){var t=e.props,n=t.img,r=t.data,a=n.getBoundingClientRect(),o=a.left,c=a.top,i=a.width,s=a.height,l=r.width,u=r.height,d={left:o,top:c,width:i,height:s},p=1;return l>u?(d.height=s,p=s/u,d.width=l*p,d.left=o+(i-d.width)/2,d.top=c+(s-d.height)/2):l<u&&(d.width=i,p=i/l,d.height=u*p,d.left=o+(i-d.width)/2,d.top=c+(s-d.height)/2),d},e.handleClick=function(t){t.stopPropagation(),e.setState({translate:null,scale:null})},e.handleTransitionEnd=function(){var t=e.state,n=t.translate,r=t.scale,a=e.props.onClose;n&&r?(e.setState({transEnded:!0}),e.scrollerRef.current.style.overflow="auto"):a()},e}return c()(n,[{key:"componentWillMount",value:function(){var e=this.props,t=e.img,n=e.isOriginalUrl;this.originalSrc!==this.currentSrc&&((new Image).src=this.originalSrc);this.setState({rect:!1===n?this.getBoundingClientRect():t.getBoundingClientRect()})}},{key:"componentDidMount",value:function(){var e=this;Object(O.disableBodyScroll)(this.scrollerRef.current);var t=this.props.img;setTimeout((function(){return e.setState(Object.assign({},e.computeTransition(e.state.rect,{width:t.dataset.rawwidth||t.naturalWidth})))}))}},{key:"componentWillUnmount",value:function(){Object(O.enableBodyScroll)(this.scrollerRef.current)}},{key:"computeTransition",value:function(e,t){var n,r=this.props,a=r.transitionType,o=r.data,c=w()(navigator.userAgent).Mobile?M:R,i=c.top,s=c.left,l=window,u={left:0,top:0,width:l.innerWidth,height:l.innerHeight},d=function(e){return{x:e.left+e.width/2,y:e.top+e.height/2}}(u),p={width:u.width-2*s,height:u.height-2*i},f={},h={};return 1===a?(f.width=p.width>o.width?o.width:p.width,n=f.width/o.width,f.height=o.height*n,h={x:(p.width-f.width)/2+s,y:f.height<p.height?(p.height-f.height)/2+i:R.top}):(f.width=p.width>t.width?t.width:p.width,n=f.width/e.width,f.height=e.height*n,h={x:d.x-e.width/2,y:(f.height<p.height?d.y:R.top+f.height/2)-e.height/2}),{translate:h,scale:n}}},{key:"render",value:function(){var e,t=this,n=this.props,r=n.img,a=n.isOriginalUrl,o=n.data,c=n.transitionType,i=n.className,s=this.state,l=s.translate,u=s.scale,d=s.rect,p=s.transEnded,f=l&&u,h=1,b="";if(1===c){var m=(w()(navigator.userAgent).Mobile?M:R).left;e=Math.min(window.innerWidth-2*m,o.width);var v=d.width/e;b=f?"translate(".concat(l.x,"px, ").concat(l.y,"px) scale(1) "):"translate(".concat(d.left,"px, ").concat(d.top,"px) scale(").concat(v,") "),h=f?1:0}else b=f?"translate(".concat(l.x,"px ,").concat(l.y,"px) scale(").concat(u,") "):"translate(".concat(d.left,"px,").concat(d.top,"px)");return Object(k.g)(C.a,null,Object(k.g)("div",{className:g()("ImageView",i,{"is-active":f}),style:{paddingBottom:R.top},onClick:this.handleClick},Object(k.g)("div",{className:"ImageView-inner",ref:this.scrollerRef},Object(k.g)("img",{ref:function(e){t.imgEl=e},src:!1===a?Object(j.imgUrl)(r.dataset.original,"r"):p&&this.originalSrc||this.currentSrc,className:g()("ImageView-img",{"ImageView-transformOrigin":1===c}),style:{width:e||d.width,transform:b,opacity:h},onTransitionEnd:this.handleTransitionEnd,alt:"preview"}))))}},{key:"originalSrc",get:function(){return this.props.img.dataset.original}},{key:"currentSrc",get:function(){var e=this.props.img;return e.currentSrc||e.src}}]),n}(b.Component);x.propTypes={img:h.a.object.isRequired,onClose:h.a.func.isRequired};t.a=x},894:function(e,t,n){"use strict";function r(e){var t=e.id,n=e.name,r=e.urlToken;return"0"===t||"知乎用户"===n?null:Boolean(r||t)}n.d(t,"a",(function(){return r}))},903:function(e,t,n){"use strict";var r=n(35),a=n(2),o=n(27),c=n(78),i=n(53),s=n(1),l=n(233),u=n.n(l),d=n(34),p=n(63),f=n(30);function h(e,t){var n=e.isPinProfile,o=e.user,i=e.isPinDaily,s=e.onClick,l=void 0===s?u.a:s,h=e.children,b=Object(r.a)(e,["isPinProfile","user","isPinDaily","onClick","children"]),m=o.id,v=o.urlToken,g=o.isOrg,O=o.url,j=o.maskLevel,y="//www.zhihu.com/".concat(g?"org":"people","/").concat(v||m),w="zhihu://pin".concat(O,"/moments"),C=Object(c.c)((function(e){i&&"A"===e.target.nodeName&&f.a.trackEvent(e.target,{id:2065}),n&&(e.preventDefault(),p.a.dispatch("base/openURL",{url:w})),j&&e.preventDefault(),l(e)}));return Object(a.b)(d.Link,Object.assign({ref:t,to:y,target:"_blank",onClick:C,className:"UserLink-link","data-za-detail-view-element_name":"User"},b,{children:h}))}var b=Object(s.forwardRef)(h),m=n(894);t.a=function(e){var t=e.user,s=e.noHoverCard,l=e.noLink,u=e.children,d=Object(r.a)(e,["user","noHoverCard","noLink","children"]),p=t.id,f=t.urlToken,h=!Object(m.a)(t)||l,v=Object(o.useSelector)((function(e){return Object(i.d)(e,{includeTablet:!0})})),g=null!=s?s:v,O=Object(c.d)((function(){return n.e(56).then(n.bind(null,1150))}),!g);if(h)return u||null;var j=Object(a.b)(b,Object.assign({},d,{user:t,children:u}));return g||!O?j:Object(a.b)(O,{toggler:j,id:p,urlToken:f,user:t})}},908:function(e,t,n){"use strict";n.d(t,"a",(function(){return p}));var r=n(35),a=n(2),o=n(11),c=n.n(o),i=n(370),s=n(894),l=n(955),u=n(891),d=n(903);function p(e){var t,n,o=e.className,p=e.showVipIcon,f=e.vipIconZaViewName,h=e.user,b=void 0===h?{}:h,m=e.noBadge,v=e.children,g=e.badgeProps,O=void 0===g?{}:g,j=Object(r.a)(e,["className","showVipIcon","vipIconZaViewName","user","noBadge","children","badgeProps"]),y=Object(s.a)(b),w=y&&!m,C=null===(t=b.vipInfo)||void 0===t?void 0:t.isVip,k=y&&p&&(null===(n=b.vipInfo)||void 0===n?void 0:n.vipIcon);return Object(a.c)("span",{className:c()("UserLink",o),children:[Object(a.b)(d.a,Object.assign({},j,{user:b,children:v||b.name})),w&&Object(a.b)(i.c,Object.assign({css:{marginLeft:".3em"},isOrg:b.isOrg,badge:b.badgeV2||b.badge,linkify:!0,enableTooltip:!0},O)),C&&Object(a.b)(l.a,{css:{marginLeft:".3em"}}),k&&Object(a.b)(u.a,{vipIcon:b.vipInfo.vipIcon,zaViewName:f})]})}},927:function(e,t,n){e.exports=n(58)(202)},937:function(e,t,n){var r,a,o;a=[t],void 0===(o="function"==typeof(r=function(e){"use strict";function t(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}Object.defineProperty(e,"__esModule",{value:!0});var n=!1;if("undefined"!=typeof window){var r={get passive(){n=!0}};window.addEventListener("testPassive",null,r),window.removeEventListener("testPassive",null,r)}function a(e){return s.some((function(t){return!(!t.options.allowTouchMove||!t.options.allowTouchMove(e))}))}function o(e){var t=e||window.event;return!!a(t.target)||1<t.touches.length||(t.preventDefault&&t.preventDefault(),!1)}function c(){setTimeout((function(){void 0!==p&&(document.body.style.paddingRight=p,p=void 0),void 0!==d&&(document.body.style.overflow=d,d=void 0)}))}var i="undefined"!=typeof window&&window.navigator&&window.navigator.platform&&(/iP(ad|hone|od)/.test(window.navigator.platform)||"MacIntel"===window.navigator.platform&&1<window.navigator.maxTouchPoints),s=[],l=!1,u=-1,d=void 0,p=void 0;e.disableBodyScroll=function(e,r){if(i){if(!e)return void console.error("disableBodyScroll unsuccessful - targetElement must be provided when calling disableBodyScroll on IOS devices.");if(e&&!s.some((function(t){return t.targetElement===e}))){var c={targetElement:e,options:r||{}};s=[].concat(t(s),[c]),e.ontouchstart=function(e){1===e.targetTouches.length&&(u=e.targetTouches[0].clientY)},e.ontouchmove=function(t){var n,r,c,i;1===t.targetTouches.length&&(r=e,i=(n=t).targetTouches[0].clientY-u,a(n.target)||(r&&0===r.scrollTop&&0<i||(c=r)&&c.scrollHeight-c.scrollTop<=c.clientHeight&&i<0?o(n):n.stopPropagation()))},l||(document.addEventListener("touchmove",o,n?{passive:!1}:void 0),l=!0)}}else{h=r,setTimeout((function(){if(void 0===p){var e=!!h&&!0===h.reserveScrollBarGap,t=window.innerWidth-document.documentElement.clientWidth;e&&0<t&&(p=document.body.style.paddingRight,document.body.style.paddingRight=t+"px")}void 0===d&&(d=document.body.style.overflow,document.body.style.overflow="hidden")}));var f={targetElement:e,options:r||{}};s=[].concat(t(s),[f])}var h},e.clearAllBodyScrollLocks=function(){i?(s.forEach((function(e){e.targetElement.ontouchstart=null,e.targetElement.ontouchmove=null})),l&&(document.removeEventListener("touchmove",o,n?{passive:!1}:void 0),l=!1),s=[],u=-1):(c(),s=[])},e.enableBodyScroll=function(e){if(i){if(!e)return void console.error("enableBodyScroll unsuccessful - targetElement must be provided when calling enableBodyScroll on IOS devices.");e.ontouchstart=null,e.ontouchmove=null,s=s.filter((function(t){return t.targetElement!==e})),l&&0===s.length&&(document.removeEventListener("touchmove",o,n?{passive:!1}:void 0),l=!1)}else(s=s.filter((function(t){return t.targetElement!==e}))).length||c()}})?r.apply(t,a):r)||(e.exports=o)},940:function(e,t){function n(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof e.then}e.exports=n,e.exports.default=n},942:function(e,t,n){"use strict";var r=n(74),a=n.n(r),o=n(20),c=n.n(o),i=n(21),s=n.n(i),l=n(92),u=n.n(l),d=n(22),p=n.n(d),f=n(23),h=n.n(f),b=n(13),m=n.n(b),v=n(3),g=n.n(v),O=n(1),j=n.n(O),y=n(39),w=n(64),C=n.n(w),k=n(384),E=n.n(k),R=n(30),M=n(71),x=n.n(M);var S=function(e,t){return function(n){var r=t(n);return x()(r,n),r.displayName="".concat(e,"(").concat(function(e){return e.displayName||e.name||"Component"}(n),")"),r}};function T(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=m()(e);if(t){var a=m()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return h()(this,n)}}function I(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var N=C()((function(){var e=new IntersectionObserver((function(t){t.forEach((function(t){if(0!==t.intersectionRatio){var n=t.target;e.unobserve(n),n.handleChange&&(n.handleChange(),n.handleChange=null)}}))}),{threshold:[.1]});return e})),B=function(e,t,n,r){return S("track",(function(a){return function(o){p()(l,o);var i=T(l);function l(){var e;c()(this,l);for(var t=arguments.length,n=new Array(t),r=0;r<t;r++)n[r]=arguments[r];return e=i.call.apply(i,[this].concat(n)),I(u()(e),"values_",{}),I(u()(e),"trackCardShow",(function(){var t=e.values,n=t.viewInfo,r=t.extraInfo;R.a.trackCardShow(e.element,n,r)})),e}return s()(l,[{key:"parseValues",value:function(){var a,o=this,c=function(e){return"function"==typeof e?e(o.props):e};this.values={viewLocation:e,moduleInfo:(a=c(t),a?a.type||a.sub_type?{card:{card_type:"Content",content:a}}:a:null),viewInfo:c(n),extraInfo:c(r)}}},{key:"setModule",value:function(){var e=this.values,t=e.viewLocation,n=e.moduleInfo;R.a.setModule(this.element,t,n)}},{key:"componentDidMount",value:function(){this.element=Object(y.findDOMNode)(this),this.parseValues(),this.values.viewInfo&&(this.element.handleChange=this.trackCardShow,N().observe(this.element))}},{key:"componentDidUpdate",value:function(){this.parseValues()}},{key:"componentWillUnmount",value:function(){this.values.viewInfo&&(N().unobserve(this.element),this.element.handleChange=null),this.element=null}},{key:"render",value:function(){return j.a.createElement(a,this.props)}},{key:"values",get:function(){return this.values_},set:function(e){E()(e,this.values_)||(this.values_=e,this.setModule())}}]),l}(O.Component)}))},P=function(e){p()(n,e);var t=T(n);function n(){var e;c()(this,n);for(var r=arguments.length,o=new Array(r),i=0;i<r;i++)o[i]=arguments[i];return e=t.call.apply(t,[this].concat(o)),I(u()(e),"Component",B.apply(void 0,a()(e.props.options))((function(){return e.props.children}))),e}return s()(n,[{key:"render",value:function(){return"undefined"!=typeof window&&window.IntersectionObserver?j.a.createElement(this.Component,null):this.props.children}}]),n}(O.Component);I(P,"propTypes",{children:g.a.element.isRequired,options:g.a.array.isRequired});t.a=P},955:function(e,t,n){"use strict";n.d(t,"a",(function(){return g}));var r=n(14),a=n(15),o=n(16),c=n(17),i=n(9),s=n(2),l=n(1),u=n(11),d=n.n(u);function p(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}var f=function(e){Object(o.a)(n,e);var t=p(n);function n(){return Object(r.a)(this,n),t.apply(this,arguments)}return Object(a.a)(n,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.children;return Object(s.b)("div",{className:d()("Badge",t),children:n})}}]),n}(l.Component),h=n(232),b=n(1170),m=n(24);function v(e){return Object(s.b)(h.a,Object.assign({as:"a",href:m.F,target:"_blank",rel:"noopener noreferrer",zaBlock:"VipBadge",zaType:"Button",zaEventType:"Click",zaAction:"OpenUrl",extra:{link:{url:m.F}}},e,{children:Object(s.b)(b.a,{css:{height:"1em",width:"1em","&:hover":{cursor:"pointer"}},center:!0})}))}var g=Object(l.memo)(v);t.b=f},956:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(66),c=n(16),i=n(17),s=n(9),l=n(2),u=n(3),d=n.n(u),p=n(1),f=n(34),h=n(31),b=n(957),m=n(24);function v(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(s.a)(e);if(t){var a=Object(s.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(i.a)(this,n)}}var g=function(e){Object(c.a)(n,e);var t=v(n);function n(){var e;return Object(r.a)(this,n),(e=t.call(this)).state={expanded:!1},e.onExpand=e.handleExpand.bind(Object(o.a)(e)),e}return Object(a.a)(n,[{key:"handleExpand",value:function(){this.setState({expanded:!0})}},{key:"render",value:function(){var e=this.props,t=e.topics,n=e.user,r=e.ellipsisLength,a=e.expandable,o=e.privacyEnabled,c=e.showPrivacyPage,i=this.state.expanded,s="等 ".concat(t.length," 个"),u=t;return i||(u=t.slice(0,r)),0===t.length?null:Object(l.c)("span",{children:[u.map((function(e,t){return Object(l.c)("span",{children:[Object(l.b)(b.a,{showPrivacyPage:o&&c,authWrapperClassName:"ProfileMainPrivacy-authWrapper",authChild:Object(l.b)("span",{className:"ProfileMainPrivacy-pointerWrapper",children:e.name}),children:Object(l.b)(f.Link,{to:"".concat(m.D,"/").concat(n.isOrg?"org":"people","/").concat(n.urlToken,"/creations/").concat(e.id),children:e.name})}),t<u.length-1?"、":" "]},t)})),!i&&t.length>r&&(a?Object(l.b)(h.c,{preset:"plain",onClick:this.onExpand,children:s}):s),"话题"]})}}]),n}(p.Component);g.propTypes={topics:d.a.array.isRequired,user:d.a.object,ellipsisLength:d.a.number,expandable:d.a.bool,noHoverCard:d.a.bool,privacyEnabled:d.a.bool,showPrivacyPage:d.a.bool},g.defaultProps={ellipsisLength:3,expandable:!0,noHoverCard:!1},t.a=g},957:function(e,t,n){"use strict";n.d(t,"a",(function(){return c}));var r=n(2),a=n(1),o=n(399),c=function(e){var t=e.children,n=e.showPrivacyPage,c=e.authWrapperClassName,i=e.authChild,s=a.Children.only(t),l=i?a.Children.only(i):s;return n?Object(r.b)(o.a,{wrapperClassName:c,loginButton:l}):s}},961:function(e,t,n){"use strict";n.d(t,"a",(function(){return y}));var r=n(20),a=n.n(r),o=n(21),c=n.n(o),i=n(22),s=n.n(i),l=n(23),u=n.n(l),d=n(13),p=n.n(d),f=n(1),h=n.n(f),b=n(11),m=n.n(b),v=n(111),g=n.n(v),O=n(5);function j(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var a=p()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return u()(this,n)}}var y=function(e){s()(n,e);var t=j(n);function n(){var e;a()(this,n);for(var r=arguments.length,o=new Array(r),c=0;c<r;c++)o[c]=arguments[c];return(e=t.call.apply(t,[this].concat(o))).state={uid:g()()},e.handleChange=function(t){var n=t.target.files;n&&e.uploadFiles(n),e.setState({uid:g()()})},e.uploadFiles=function(t){var n=e.props.multiple,r=g()(),a=Array.prototype.slice.call(t);n?a.map((function(t){e.upload(t,r)})):e.upload(a[0],r)},e.upload=function(t,n){var r,a=e.props,o=a.beforeUpload,c=a.customUpload,i=a.onStart,s=a.onSuccess,l=a.onError;if(o&&(r=o(t)),!1!==r&&c){var u={file:t,uid:n,status:"uploading"};i&&i(u),Promise.resolve().then((function(){return c({file:t})})).then((function(e){s&&s(Object.assign({},u,{remoteInfo:e,status:"success"}))})).catch((function(e){l&&l(Object.assign({},u,{remoteInfo:e,status:"error"}))}))}},e}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.accept,r=e.multiple,a=e.disabled,o=e.onRef,c=e.onClick,i=e.children;return Object(O.g)("label",{className:m()("UploadPicture-wrapper",t)},Object(O.g)("input",{type:"file",accept:n,multiple:r,className:"UploadPicture-input",disabled:a,ref:o,onChange:this.handleChange,onClick:c}),i)}}]),n}(h.a.Component);y.defaultProps={multiple:!1,disabled:!1}},962:function(e,t,n){"use strict";var r=n(35),a=n(2),o=n(370),c=n(90),i=n(848),s=n(112),l=n.n(s),u=n(152),d=l()(u.findImageSpec),p=function(e,t){return Object(u.imgUrl)(e,d(t))};t.a=function(e){var t=e.user,n=e.size,s=void 0===n?38:n,l=e.noBadge,u=void 0!==l&&l,d=e.noLink,f=void 0!==d&&d,h=e.linkProps,b=Object(r.a)(e,["user","size","noBadge","noLink","linkProps"]),m=t.avatarUrl,v=t.isOrg,g=t.urlToken,O=!f&&g?"https://www.zhihu.com/".concat(v?"org":"people","/").concat(g):null,j=Object(a.b)(c.Image,{loading:"lazy",src:p(m,s),srcSet:"".concat(p(m,2*s)," 2x"),size:s,display:"block",css:{borderRadius:"50%"}});return Object(a.c)(c.Box,Object.assign({display:"inline-block",size:s,css:{position:"relative"}},b,{children:[O?Object(a.b)(i.a,Object.assign({href:O,target:"_blank"},h,{children:j})):j,!u&&Object(a.b)(o.c,{css:Object(o.f)(s),isOrg:v,badge:t.badgeV2||t.badge,linkify:!f,enableTooltip:!0})]}))}},977:function(e,t,n){"use strict";var r=n(20),a=n.n(r),o=n(21),c=n.n(o),i=n(22),s=n.n(i),l=n(23),u=n.n(l),d=n(13),p=n.n(d),f=n(33),h=n.n(f),b=n(41),m=n.n(b),v=n(3),g=n.n(v),O=n(1),j=n(11),y=n.n(j),w=n(365),C=n(31),k=n(5);function E(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=p()(e);if(t){var a=p()(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return u()(this,n)}}function R(e){var t=e.className,n=e.tag,r=e.name,a=e.value,o=m()(e,["className","tag","name","value"]),c="div";return n?c=n:o.href?c="a":o.onClick&&(c=C.c),Object(k.g)(c,h()({className:y()("NumberBoard-item",t)},o),Object(k.g)("div",{className:"NumberBoard-itemInner"},Object(k.g)("div",{className:"NumberBoard-itemName"},r),Object(k.g)("strong",{className:"NumberBoard-itemValue",title:a},Object(w.formatNumber)(a))))}var M=function(e){s()(n,e);var t=E(n);function n(){return a()(this,n),t.apply(this,arguments)}return c()(n,[{key:"render",value:function(){var e=this.props,t=e.className,n=e.divider,r=e.children,a=e.items,o=m()(e,["className","divider","children","items"]);return Object(k.g)("div",h()({className:y()("NumberBoard",t,{"NumberBoard--divider":n})},o),r||a.map((function(e){return Object(k.g)(R,h()({key:e.name},e))})))}}]),n}(O.Component);M.propTypes={divider:g.a.bool},M.defaultProps={divider:!1},M.Item=R;var x=M;t.a=x},992:function(e,t,n){"use strict";var r=n(14),a=n(15),o=n(16),c=n(17),i=n(9),s=n(2),l=n(1),u=n(3),d=n.n(u),p=n(71),f=n.n(p),h=n(403);function b(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=Object(i.a)(e);if(t){var a=Object(i.a)(this).constructor;n=Reflect.construct(r,arguments,a)}else n=r.apply(this,arguments);return Object(c.a)(this,n)}}t.a=function(e){var t=function(t){Object(o.a)(c,t);var n=b(c);function c(){return Object(r.a)(this,c),n.apply(this,arguments)}return Object(a.a)(c,[{key:"render",value:function(){var t=this.props.currentUser,n=this.context.authRequired,r=void 0===n?function(){}:n;return Object(s.b)(e,Object.assign({isLogin:t&&"guest"!==t.userType,authRequired:r},this.props))}}]),c}(l.Component);return t.contextTypes={authRequired:d.a.func},f()(Object(h.b)(t),e)}}}]);
|
||
//# sourceMappingURL=main.user-hover-card.a78b4d4fd47ff6778629.js.map
|