"use strict";(self.webpackChunk_topthink_assistant=self.webpackChunk_topthink_assistant||[]).push([[295],{829:function(t,e,o){o(2379);e.Z="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CiAgICA8cGF0aCBmaWxsPSIjMjZCRjRDIiBkPSJNMCAwaDYwdjYwSDB6Ii8+CiAgICA8cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIKICAgICAgICAgIGQ9Ik0xMy4zMzMgMjkuNDkzQzEzLjMzMyAyMS40NjcgMjAuODE1IDE1IDMwIDE1YzkuMTg1IDAgMTYuNjY3IDYuNDY3IDE2LjY2NyAxNC40OTMgMCA4LjAyNS03LjQ4MiAxNC40OTMtMTYuNjY3IDE0LjQ5My0yLjUxMyAwLTQuOTUyLS40OTQtNy4wNC0xLjM4MWExLjY5NyAxLjY5NyAwIDAxLS40NzctLjE3OGwtLjIwNS0uMTAxYTIuMjk2IDIuMjk2IDAgMDAtMS41NjEtLjA5M2wtNS4xMzggMS41MjVjLS44Mi4yNDQtMS42OS0uMjAxLTEuOTQxLS45OTNhMS40NTQgMS40NTQgMCAwMS4wNzktMS4wOGwxLjQ0My0yLjk2N2EzIDMgMCAwMC0uMDEzLTIuNjc1Yy0xLjE4Ni0yLjAxNC0xLjgxNC00LjI0My0xLjgxNC02LjU1em0xNi42NjggNi4zNjhjLTIuNjc0IDAtNC45Mi0xLjY4LTUuNTU3LTMuOTUzbDExLjExMi4wMDljLS42NCAyLjI2OC0yLjg4NCAzLjk0NC01LjU1NSAzLjk0NHoiCiAgICAgICAgICBmaWxsPSIjZmZmIi8+Cjwvc3ZnPgo="},3571:function(t,e,o){o.d(e,{C:function(){return n},T:function(){return i}});var r=o(61);const i=r.I0,n=r.v9},623:function(t,e,o){o.d(e,{$Z:function(){return i},ZN:function(){return n}});const r=(0,o(3812).oM)({name:"window",initialState:{},reducers:{show(t,e){t.name=e.payload},toggle(t,e){t.name=t.name===e.payload?void 0:e.payload}}}),{show:i,toggle:n}=r.actions;e.ZP=r.reducer},2295:function(t,e,o){o.r(e),o.d(e,{default:function(){return ae}});o(7313);var r=o(4081),i=o.n(r),n=o(5670),a=o.n(n),c=o(264),l=o(3812),s=o(623);const d=(0,l.oM)({name:"doc",initialState:{mode:"normal"},reducers:{setUrl(t,e){t.url=e.payload},setMode(t,e){t.mode=e.payload}},extraReducers(t){t.addCase(s.$Z,((t,e)=>{"doc"!==e.payload&&(t.mode="normal")}))}}),{setUrl:p,setMode:h}=d.actions;var x=d.reducer;var u=(0,l.oM)({name:"context",initialState:{baseUrl:"",sessionId:"",config:{appearance:{window:{tone:"#3c60ff",sideMargin:24,bottomMargin:48},button:{color:"#585a5a",background:"#FFFFFF",size:"normal",sideMargin:24,bottomMargin:48,hidden:!1}},chat:{enable:!1},doc:{enable:!1},gotop:{enable:!1},broadcast:{enable:!1},robot:{enable:!1},customs:[],scripts:""}},reducers:{}}).reducer;function g(){let t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return(0,l.xC)({reducer:{context:u,window:s.ZP,doc:x},preloadedState:t})}var m=o(3080),f=o(61),b=o(5295),w=o(1604),v=o(8933),j=o(5264),y=o(3571),C=o(2379);function k(){const t=(0,y.T)(),{visible:e,robot:o}=(0,y.C)((t=>{let{window:e,context:{config:{robot:o}}}=t;return{visible:"chat"===e.name||"robot"===e.name,robot:o}})),r=(0,C.useCallback)((()=>{t(e?(0,s.$Z)(void 0):(0,s.$Z)(o.enable?"robot":"chat"))}),[e]);return(0,c.jsx)($,{tooltip:"在线客服",onClick:r,children:(0,c.jsx)(j.r,{})})}var z=o(2793);function M(){const[t]=(0,y.C)((t=>["doc"===t.window.name])),e=(0,f.I0)();return(0,c.jsx)($,{tooltip:"文档中心",onClick:()=>e((0,s.$Z)(t?void 0:"doc")),children:(0,c.jsx)(z.r,{})})}var Z=o(341);const E=t=>Z.default.find((e=>e.name===t));function I(t){let{item:e,index:o}=t;const r=(0,C.useMemo)((()=>E(e.icon)?.Component),[e.icon]),i=(0,y.T)(),n=`custom-${o}`;if(!r)return null;const a=(0,c.jsx)(r,{});return(0,c.jsx)($,{tooltip:e.title,onClick:()=>i((0,s.ZN)(n)),children:a})}var N=o(4039);const L=768,A={desktop:"desktop",mobile:"mobile"};function S(){function t(){return window.innerWidth>L?A.desktop:A.mobile}const[e,o]=(0,C.useState)(t);return(0,C.useEffect)((()=>{function e(){o(t())}return window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[]),e}var O=o(1672);function F(){const[t]=(0,y.C)((t=>["feedback"===t.window.name])),e=(0,f.I0)();return(0,c.jsx)($,{tooltip:"反馈建议",onClick:()=>e((0,s.$Z)(t?void 0:"feedback")),children:(0,c.jsx)(O.r,{})})}const $=function(t){let{children:e,tooltip:o,onClick:r}=t;const i=(0,c.jsx)(D,{onClick:r,children:e});if(o){const t={placement:"left",getTooltipContainer:t=>t.parentElement||document.body};let e;return e="object"==typeof o&&o.hasOwnProperty("overlay")?o:{overlay:o},(0,c.jsx)(N.Z,{...t,...e,children:i})}return i},T=function(){return(0,v.Z)()>500?(0,c.jsx)($,{tooltip:"回到顶部",onClick:()=>window.scrollTo({top:0,behavior:"smooth"}),children:(0,c.jsx)(w.r,{})}):null};function P(){const{robot:t,chat:e,doc:o,gotop:r,customs:i,feedback:n}=(0,y.C)((t=>{let{context:{config:e}}=t;return e})),a=S();return(0,c.jsxs)(H,{children:[r.enable&&(0,c.jsx)(T,{}),"desktop"===a&&o.enable&&(0,c.jsx)(M,{}),"desktop"===a&&(e.enable||t.enable)&&(0,c.jsx)(k,{}),"desktop"===a&&n&&(0,c.jsx)(F,{}),"desktop"===a&&i.map(((t,e)=>(0,c.jsx)(I,{index:e,item:t},e)))]})}const D=m.ZP.div` width: var(--tas-button-size, 40px); height: var(--tas-button-size, 40px); background: var(--tas-button-background, #FFFFFF); box-shadow: 0 1px 4px -2px rgb(0 0 0 / 13%), 0 2px 8px rgb(0 0 0 / 8%), 0 8px 16px 4px rgb(0 0 0 / 4%); border-radius: 50%; display: flex; align-items: center; justify-content: space-around; cursor: pointer; margin-top: 10px; color: var(--tas-button-color, #585a5a); svg { width: 65%; height: 65%; fill: currentColor; } `,H=m.ZP.div` position: fixed; right: var(--tas-button-side-margin, 24px); bottom: var(--tas-button-bottom-margin, 48px); z-index: 4000; display: flex; flex-direction: column; .rc-tooltip.rc-tooltip-zoom-appear, .rc-tooltip.rc-tooltip-zoom-enter { opacity: 0; } .rc-tooltip.rc-tooltip-zoom-enter, .rc-tooltip.rc-tooltip-zoom-leave { display: block; } .rc-tooltip-zoom-enter, .rc-tooltip-zoom-appear { opacity: 0; animation-duration: 0.3s; animation-fill-mode: both; animation-timing-function: cubic-bezier(0.18, 0.89, 0.32, 1.28); animation-play-state: paused; } .rc-tooltip-zoom-leave { animation-duration: 0.3s; animation-fill-mode: both; animation-timing-function: cubic-bezier(0.6, -0.3, 0.74, 0.05); animation-play-state: paused; } .rc-tooltip-zoom-enter.rc-tooltip-zoom-enter-active, .rc-tooltip-zoom-appear.rc-tooltip-zoom-appear-active { animation-name: rcToolTipZoomIn; animation-play-state: running; } .rc-tooltip-zoom-leave.rc-tooltip-zoom-leave-active { animation-name: rcToolTipZoomOut; animation-play-state: running; } @keyframes rcToolTipZoomIn { 0% { opacity: 0; transform-origin: 50% 50%; transform: scale(0, 0); } 100% { opacity: 1; transform-origin: 50% 50%; transform: scale(1, 1); } } @keyframes rcToolTipZoomOut { 0% { opacity: 1; transform-origin: 50% 50%; transform: scale(1, 1); } 100% { opacity: 0; transform-origin: 50% 50%; transform: scale(0, 0); } } .rc-tooltip { position: absolute; z-index: 1070; display: block; visibility: visible; font-size: 12px; line-height: 1.5; opacity: 0.9; } .rc-tooltip-hidden { display: none; } .rc-tooltip-placement-top, .rc-tooltip-placement-topLeft, .rc-tooltip-placement-topRight { padding: 5px 0 9px 0; } .rc-tooltip-placement-right, .rc-tooltip-placement-rightTop, .rc-tooltip-placement-rightBottom { padding: 0 5px 0 9px; } .rc-tooltip-placement-bottom, .rc-tooltip-placement-bottomLeft, .rc-tooltip-placement-bottomRight { padding: 9px 0 5px 0; } .rc-tooltip-placement-left, .rc-tooltip-placement-leftTop, .rc-tooltip-placement-leftBottom { padding: 0 9px 0 5px; } .rc-tooltip-inner { padding: 8px 10px; color: #fff; text-align: left; text-decoration: none; background-color: #373737; border-radius: 6px; box-shadow: 0 0 4px rgba(0, 0, 0, 0.17); } .rc-tooltip-arrow { position: absolute; width: 0; height: 0; border-color: transparent; border-style: solid; } .rc-tooltip-placement-top .rc-tooltip-arrow, .rc-tooltip-placement-topLeft .rc-tooltip-arrow, .rc-tooltip-placement-topRight .rc-tooltip-arrow { bottom: 4px; margin-left: -5px; border-width: 5px 5px 0; border-top-color: #373737; } .rc-tooltip-placement-top .rc-tooltip-arrow { left: 50%; } .rc-tooltip-placement-topLeft .rc-tooltip-arrow { left: 15%; } .rc-tooltip-placement-topRight .rc-tooltip-arrow { right: 15%; } .rc-tooltip-placement-right .rc-tooltip-arrow, .rc-tooltip-placement-rightTop .rc-tooltip-arrow, .rc-tooltip-placement-rightBottom .rc-tooltip-arrow { left: 4px; margin-top: -5px; border-width: 5px 5px 5px 0; border-right-color: #373737; } .rc-tooltip-placement-right .rc-tooltip-arrow { top: 50%; } .rc-tooltip-placement-rightTop .rc-tooltip-arrow { top: 15%; margin-top: 0; } .rc-tooltip-placement-rightBottom .rc-tooltip-arrow { bottom: 15%; } .rc-tooltip-placement-left .rc-tooltip-arrow, .rc-tooltip-placement-leftTop .rc-tooltip-arrow, .rc-tooltip-placement-leftBottom .rc-tooltip-arrow { right: 4px; margin-top: -5px; border-width: 5px 0 5px 5px; border-left-color: #373737; } .rc-tooltip-placement-left .rc-tooltip-arrow { top: 50%; } .rc-tooltip-placement-leftTop .rc-tooltip-arrow { top: 15%; margin-top: 0; } .rc-tooltip-placement-leftBottom .rc-tooltip-arrow { bottom: 15%; } .rc-tooltip-placement-bottom .rc-tooltip-arrow, .rc-tooltip-placement-bottomLeft .rc-tooltip-arrow, .rc-tooltip-placement-bottomRight .rc-tooltip-arrow { top: 4px; margin-left: -5px; border-width: 0 5px 5px; border-bottom-color: #373737; } .rc-tooltip-placement-bottom .rc-tooltip-arrow { left: 50%; } .rc-tooltip-placement-bottomLeft .rc-tooltip-arrow { left: 15%; } .rc-tooltip-placement-bottomRight .rc-tooltip-arrow { right: 15%; } `;var _;function G(){return G=Object.assign?Object.assign.bind():function(t){for(var e=1;eC.createElement("svg",G({width:16,height:16,xmlns:"http://www.w3.org/2000/svg"},t),_||(_=C.createElement("path",{d:"M10 1v2.001h3V6h2V1h-5zM1 1v5h2V3.001h3V1H1zm12 9v3.001h-3V15h5v-5h-2zM1 10v5h5v-1.999H3V10H1z",fill:"#fff",fillRule:"evenodd"})));var V;function Y(){return Y=Object.assign?Object.assign.bind():function(t){for(var e=1;eC.createElement("svg",Y({width:16,height:16,xmlns:"http://www.w3.org/2000/svg"},t),V||(V=C.createElement("path",{d:"M1 10v2.001h3V15h2v-5H1zm9 0v5h2v-2.999h3V10h-5zM4 1v3.001H1V6h5V1H4zm6 0v5h5V4.001h-3V1h-2z",fill:"#fff",fillRule:"evenodd"})));var W;function U(){return U=Object.assign?Object.assign.bind():function(t){for(var e=1;eC.createElement("svg",U({width:16,height:16,xmlns:"http://www.w3.org/2000/svg"},t),W||(W=C.createElement("path",{d:"m8 16 4-5H9V5h3L8 0 4 5h3v6H4z",fill:"#FFF"})));var J;function X(){return X=Object.assign?Object.assign.bind():function(t){for(var e=1;eC.createElement("svg",X({width:16,height:16,xmlns:"http://www.w3.org/2000/svg"},t),J||(J=C.createElement("path",{d:"M12 13H9v3H7v-3H4l4-5 4 5zm0-10L8 8 4 3l3-.001V0h2v2.999L12 3z",fill:"#FFF"})));var K;function tt(){return tt=Object.assign?Object.assign.bind():function(t){for(var e=1;eC.createElement("svg",tt({width:10,height:10,viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),K||(K=C.createElement("path",{d:"M11.78 1.28A.75.75 0 0 0 10.72.22L6 4.94 1.28.22A.75.75 0 1 0 .22 1.28L4.94 6 .22 10.72a.75.75 0 1 0 1.06 1.06L6 7.06l4.72 4.72a.75.75 0 1 0 1.06-1.06L7.06 6l4.72-4.72Z"})));var ot;function rt(){return rt=Object.assign?Object.assign.bind():function(t){for(var e=1;eC.createElement("svg",rt({className:"link_svg__icon",viewBox:"0 0 1024 1024",xmlns:"http://www.w3.org/2000/svg",width:12,height:12},t),ot||(ot=C.createElement("path",{d:"M864 640a32 32 0 0 1 64 0v224.096A63.936 63.936 0 0 1 864.096 928H159.904A63.936 63.936 0 0 1 96 864.096V159.904C96 124.608 124.64 96 159.904 96H384a32 32 0 0 1 0 64H192.064A31.904 31.904 0 0 0 160 192.064v639.872A31.904 31.904 0 0 0 192.064 864h639.872A31.904 31.904 0 0 0 864 831.936V640zm-485.184 52.48a31.84 31.84 0 0 1-45.12-.128 31.808 31.808 0 0 1-.128-45.12L815.04 166.048l-176.128.736a31.392 31.392 0 0 1-31.584-31.744 32.32 32.32 0 0 1 31.84-32l255.232-1.056a31.36 31.36 0 0 1 31.584 31.584L924.928 388.8a32.32 32.32 0 0 1-32 31.84 31.392 31.392 0 0 1-31.712-31.584l.736-179.392L378.816 692.48z",fill:"#333"})));var nt=o(2710),at=o.n(nt),ct=o(9503);function lt(t){let{base:e}=t;const[o,r,i,n]=(0,y.C)((t=>{let{window:e,doc:o,context:{config:r}}=t;return["doc"===e.name,o.mode,o.url,r.appearance]})),a=(0,y.T)(),[l,d]=(0,C.useState)(e),[x,u]=(0,C.useState)(!1),[g,m]=(0,ct.iP)(),f=(0,C.useCallback)(((t,e)=>({x:t-420-n.window.sideMargin,y:e-630-n.window.bottomMargin})),[n]),[b,w]=(0,C.useState)((()=>f(g,m)));(0,C.useEffect)((()=>{w(f(g,m))}),[g,m]);const v=(0,C.useCallback)((()=>{a(h("center"!==r?"center":"normal"))}),[r]),j=(0,C.useCallback)((()=>{a(h("maximum"!==r?"maximum":"normal"))}),[r]),k=(0,C.useCallback)(((t,e)=>{w({x:e.x,y:e.y})}),[]),[z,M]=(0,C.useState)(null);return(0,C.useEffect)((()=>{z&&z.contentWindow&&i&&x&&(z.contentWindow.postMessage(["history","replace",i||e],"*"),a(p("")))}),[i,x]),(0,C.useEffect)((()=>{if(z&&z.contentWindow){const t=t=>{try{const[e,o,...r]=t.data;switch(e){case"bootstrapped":u(!0);break;case"history":switch(o){case"replace":case"push":d(r[0])}}}catch{}};return window.addEventListener("message",t),()=>{window.removeEventListener("message",t)}}}),[z]),o||z?(0,c.jsx)(xt,{$visible:o,children:(0,c.jsx)(at(),{handle:".handle",disabled:"normal"!==r,position:"normal"===r?b:{x:0,y:0},onStop:k,children:(0,c.jsxs)(gt,{$mode:r,children:[(0,c.jsxs)(ut,{className:"handle",children:[(0,c.jsx)(ht,{children:"文档中心"}),(0,c.jsxs)(pt,{children:[(0,c.jsx)(dt,{onClick:v,children:"center"===r?(0,c.jsx)(R,{}):(0,c.jsx)(B,{})}),(0,c.jsx)(dt,{onClick:j,children:"maximum"===r?(0,c.jsx)(q,{}):(0,c.jsx)(Q,{})}),(0,c.jsx)(dt,{onClick:()=>a((0,s.$Z)(void 0)),children:(0,c.jsx)(et,{})})]})]}),(0,c.jsx)("iframe",{ref:M,src:e}),(0,c.jsx)(st,{children:(0,c.jsxs)("a",{href:l,target:"_blank",children:["文档中心打开",(0,c.jsx)(it,{})]})})]})})}):null}const st=m.ZP.div` display: flex; align-items: center; justify-content: space-between; position: relative; padding: 0px 16px; height: 40px; line-height: 40px; box-shadow: 0 -1px 2px 0 rgba(0, 0, 0, 0.16); background: #ffffff; a { display: inline-flex; align-items: center; gap: 5px; font-size: 13px; color: #333; text-decoration: none; &:hover { color: var(--tas-window-tone, #3c60ff); text-decoration: none; } } `,dt=m.ZP.div` display: flex; align-items: center; cursor: pointer; svg { fill: #ffffff; } `,pt=m.ZP.div` flex-grow: 0; flex-shrink: 0; display: flex; align-items: center; gap: 12px; `,ht=m.ZP.div` flex: 1 1 auto; line-height: 32px; color: #fff; font-size: 16px; `,xt=m.ZP.div` position: fixed; width: 0; height: 0; top: 0; left: 0; z-index: 5000; ${t=>!t.$visible&&m.iv` display: none; `} * { box-sizing: border-box; } `,ut=m.ZP.div` height: 60px; background: var(--tas-window-tone, #3c60ff); cursor: move; display: flex; padding: 14px; align-items: center; `,gt=m.ZP.div` position: absolute; border-radius: 5px; overflow: hidden; box-shadow: 0 5px 40px rgb(0 0 0/16%); display: flex; flex-direction: column; width: 420px; height: 630px; color: #333; font-size: 14px; ${t=>"center"===t.$mode&&m.iv` top: 60px; bottom: 60px; left: 120px; right: 120px; position: fixed; width: auto; height: auto; z-index: 5000; ${ut} { cursor: auto; } `} ${t=>"maximum"===t.$mode&&m.iv` top: 0; bottom: 0; left: auto; right: 0; position: fixed; width: 530px; height: auto; z-index: 5000; border-radius: 0; ${ut} { cursor: auto; } `} iframe { flex: 1; background: #FFF; border: none; } `;o(5013),o(8770);var mt=o(4636),ft=o.n(mt);function bt(t){let{channelId:e}=t;const o=(0,y.T)(),[r,i]=(0,y.C)((t=>{let{context:{config:e},window:o}=t;return[e.appearance,"chat"===o.name]}));return(0,C.useEffect)((()=>{window._AIHECONG=window._AIHECONG||function(){(window._AIHECONG.z=window._AIHECONG.z||[]).push(arguments)},window._AIHECONG.z=window._AIHECONG.z||[],window._AIHECONG.z.unshift(["ini",{channelId:e,button:!1,appearance:{panel:{tone:r.window.tone,position:"right",sideMargin:r.window.sideMargin,bottomMargin:r.window.bottomMargin,radius:5,width:370,height:590,headHeight:75},panelMobile:{tone:r.window.tone,ratio:"part",headHeight:75}}}]),window._AIHECONG.z.push(["visibleCallback",t=>{"show"===t&&o((0,s.$Z)("chat")),"hide"===t&&o((0,s.$Z)(void 0))}]),ft()("https://static.ahc.ink/hecong.js",{async:!0})}),[]),(0,C.useEffect)((()=>{i?window._AIHECONG("showChat"):window._AIHECONG("hideChat")}),[i]),null}var wt=o(7646),vt=o.n(wt),jt=o(829);function yt(t){let{url:e}=t;const o=(0,C.useRef)(null);return(0,C.useEffect)((()=>{if(o.current){const t={text:e,width:160,height:160,dotScale:.6,dotScaleTiming:.6,correctLevel:vt().CorrectLevel.M,logo:jt.Z,logoWidth:43,logoHeight:43};new(vt())(o.current,t)}}),[e]),(0,c.jsx)(kt,{ref:o,children:(0,c.jsx)("p",{children:"微信扫一扫"})})}function Ct(t){let{url:e}=t;const[o]=(0,y.C)((t=>["chat"===t.window.name]));return o?(0,c.jsx)(yt,{url:e}):null}const kt=m.ZP.div` position: fixed; right: var(--tas-window-side-margin, 80px); bottom: var(--tas-window-bottom-margin, 48px); z-index: 4000; background: #ffffff; border-radius: 5px; overflow: hidden; box-shadow: 0 5px 40px rgb(0 0 0/16%); padding: 16px; display: flex; flex-direction: column-reverse; p { margin: 10px 0 0; text-align: center; } `,zt=t=>"function"==typeof t;var Mt=m.ZP.div.attrs({children:(0,c.jsx)(et,{})})` position: absolute; top: 4px; right: 4px; align-items: center; border-radius: 9999px; color: #C4C8CC; cursor: pointer; display: flex; height: 24px; justify-content: center; transition: background 0.3s cubic-bezier(0.5, 1, 0.89, 1); width: 24px; z-index: 20; &:hover { background-color: #e9ecef; } `;function Zt(t){let{broadcast:e}=t;const{image:o,url:r,expire_time:i,position:n,height:a}=e,[l,s]=function(t,e){const[o,r]=(0,C.useState)((()=>{const o=zt(e)?e():e,r=window.localStorage.getItem(t);try{return r?JSON.parse(r):o}catch(t){return o}})),i=(0,C.useRef)(o);return i.current=o,[o,(0,C.useCallback)((e=>{const o=zt(e)?e(i.current):e;window.localStorage.setItem(t,JSON.stringify(o)),r(o)}),[t])]}(`assistant-broadcast-${o}`,!0),d=S();if(i){if(Date.parse(i)s(!1)}),r?(0,c.jsx)("a",{href:r,onClick:()=>s(!1),target:"_blank",children:(0,c.jsx)("img",{src:o})}):(0,c.jsx)("img",{src:o})]});return"bottom"===n?(0,c.jsx)(It,{$height:a,children:p}):(0,c.jsx)(Nt,{children:p})}const Et=m.ZP.div` position: fixed; z-index: 3000; padding: 0; overflow: hidden; a { display: flex; } ${Mt} { display: none; } &:hover { ${Mt} { display: flex; } } `,It=(0,m.ZP)(Et)` right: 0; left: 0; bottom: 0; height: ${t=>t.$height||100}px; z-index: 4000; img { width: 100%; height: 100%; object-fit: cover; } `,Nt=(0,m.ZP)(Et)` right: var(--tas-window-side-margin, 80px); bottom: var(--tas-window-bottom-margin, 48px); border-radius: 5px; box-shadow: 0 5px 40px rgb(0 0 0/16%); img { max-width: 450px; max-height: 450px; } `;function Lt(t){let{item:e,index:o}=t;const r=`custom-${o}`,[i]=(0,y.C)((t=>[t.window.name===r]));if(i)switch(e.type){case"image":return(0,c.jsxs)(St,{children:[e.text&&(0,c.jsx)("p",{children:e.text}),(0,c.jsx)("img",{src:e.image})]});case"url":return(0,c.jsx)(At,{url:e.url})}return null}const At=t=>{let{url:e}=t;const o=(0,y.T)();return(0,C.useEffect)((()=>{o((0,s.$Z)(void 0)),window.open(e,"_blank")})),null},St=m.ZP.div` position: fixed; right: var(--tas-window-side-margin, 80px); bottom: var(--tas-window-bottom-margin, 48px); z-index: 4000; background: #ffffff; border-radius: 5px; overflow: hidden; box-shadow: 0 5px 40px rgb(0 0 0/16%); padding: 16px; display: flex; flex-direction: column-reverse; img { margin: 0; padding: 0; max-width: 300px; max-height: 300px; } p { margin: 10px 0 0; text-align: center; color: #333; } `;var Ot,Ft=o(4966);function $t(){return $t=Object.assign?Object.assign.bind():function(t){for(var e=1;eC.createElement("svg",$t({viewBox:"0 0 38 35",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg"},t),Ot||(Ot=C.createElement("path",{d:"M18.215.59a.875.875 0 0 1 1.57 0l4.89 9.907a.875.875 0 0 0 .658.479l10.934 1.589a.875.875 0 0 1 .484 1.492L28.84 21.77a.875.875 0 0 0-.252.775l1.868 10.889a.875.875 0 0 1-1.27.922l-9.779-5.141a.875.875 0 0 0-.814 0l-9.78 5.141a.875.875 0 0 1-1.269-.922l1.868-10.89a.875.875 0 0 0-.252-.774l-7.912-7.712a.875.875 0 0 1 .485-1.492l10.934-1.59a.875.875 0 0 0 .659-.478L18.216.59Z"})));var Pt=o.p+"media/stars-crop.ace50189.gif";o(7749),o(9929),o(555),o(6187),o(9011),o(825),o(6342);const Dt=(0,C.lazy)((()=>Promise.all([o.e(360),o.e(139)]).then(o.bind(o,4139)))),Ht=["非常不满意","不满意","一般","满意","非常满意"],_t={star:177.5,reason:377.5,complete:194},Gt=(t,e)=>localStorage.getItem(`_tas_f_${t}_${e}`),Bt=(t,e,o)=>localStorage.setItem(`_tas_f_${t}_${e}`,o);function Vt(t){let{feedback:e}=t;const{question:o}=e,[r,i]=(0,y.C)((t=>{let{context:{baseUrl:e,sessionId:o}}=t;return[e,o]})),n=(0,f.I0)(),[a,l]=(0,C.useState)(!1),[d,p]=(0,C.useState)("star"),[h,x]=(0,C.useState)(0),[u,g]=(0,C.useState)(),[m,b]=(0,C.useState)(),w=()=>{p("complete");const t=new FormData;t.append("sessionId",i),t.append("feedback",e.id),t.append("star",String(h)),u&&t.append("reason",u),m&&t.append("screenshot",function(t,e){const o=atob(t.split(",")[1]),r=new ArrayBuffer(o.length),i=new Uint8Array(r);for(let t=0;t{n((0,s.$Z)(void 0))}),2e3)};(0,C.useEffect)((()=>{h&&"star"==d&&(o.reason.enable?p("reason"):w())}),[h]);const v=(0,C.useRef)(null);return(0,c.jsxs)(te,{style:{height:_t[d]},children:[(0,c.jsx)(Mt,{onClick:()=>n((0,s.$Z)(void 0))}),"complete"==d?(0,c.jsxs)(Rt,{children:[(0,c.jsx)("img",{src:Pt}),(0,c.jsx)("p",{children:o.complete})]}):(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Kt,{children:o.title}),(0,c.jsx)(Ft.Z,{allowClear:!1,value:h,onChange:t=>{v.current?.focus(),x(t)},character:t=>{let{index:e,value:o}=t;return e=Number(e),o=Number(o),(0,c.jsxs)(c.Fragment,{children:[(0,c.jsx)(Tt,{}),o-1===e&&(0,c.jsx)(qt,{children:(0,c.jsx)("span",{children:Ht[e]})})]})}}),"reason"==d&&o.reason.enable&&(0,c.jsxs)(Xt,{children:[(0,c.jsxs)(Qt,{$focus:a,children:[(0,c.jsx)("textarea",{ref:v,autoFocus:!0,onFocus:()=>l(!0),onBlur:()=>l(!1),placeholder:o.reason.text,value:u,onChange:t=>g(t.target.value)}),o.reason.screenshot&&(0,c.jsx)(C.Suspense,{fallback:null,children:(0,c.jsx)(Dt,{active:!!m,onComplete:t=>{v.current?.focus(),b(t)}})})]}),(0,c.jsx)(Ut,{onClick:()=>w(),children:"提交"})]})]}),(0,c.jsx)(Wt,{children:(0,c.jsx)("a",{href:"https://www.topthink.com/product/assistant",target:"_blank",children:"顶想云提供技术支持"})})]})}function Yt(t){let{feedback:e}=t;const[o]=(0,y.C)((t=>["feedback"===t.window.name])),r=(0,f.I0)(),{distribution:i}=e;return(0,C.useEffect)((()=>{if("click"!=i.timing.handle){if(Gt(e.id,"s"))return;if(i.strategy.enable)switch(i.strategy.rate){case"mild":if(Number(Gt(e.id,"c"))>=1)return;break;case"moderate":const t=2592e5;if(Number(Gt(e.id,"c"))>=7||Date.now()-Number(Gt(e.id,"t")){Bt(e.id,"t",String(Date.now())),Bt(e.id,"c",String(Number(Gt(e.id,"c"))+1)),r((0,s.$Z)("feedback"))};"delay"==i.timing.handle?setTimeout(t,1e3*i.timing.delay):t()}}),[]),o?(0,c.jsx)(Vt,{feedback:e}):null}const Rt=m.ZP.div` padding-left: 8px; padding-right: 8px; text-align: center; font-size: 14px; line-height: 22px; color: #333; transition: all 0.2s ease-in; img { margin: auto; height: 91px; width: 160px; } p { margin-top: 0px; margin-bottom: 0px; width: 100%; word-break: break-all; text-align: center; font-size: 14px; line-height: 24px; color: #333; } `,Wt=m.ZP.div` padding-top: 16px; text-align: center; a { border-radius: .25rem; color: #C4C8CC; display: inline-block; font-size: 12px; line-height: 18px; padding-left: 4px; padding-right: 4px; text-align: center; text-decoration: none; transition: background 0.3s cubic-bezier(0.5, 1, 0.89, 1); &:hover { background-color: #F1F3F5; } } `,Ut=m.ZP.button` background: var(--tas-window-tone); border-color: var(--tas-window-tone); color: #FFFFFF; border-radius: 20px; border-style: solid; border-width: 1px; cursor: pointer; font-size: 13px; font-weight: 600; line-height: 20px; max-width: 100%; outline: 2px solid transparent; outline-offset: 2px; overflow: hidden; padding: 9px 16px; text-align: center; text-overflow: ellipsis; transition-duration: .3s; white-space: nowrap; width: 100%; &:hover { opacity: 0.9; } `,Qt=m.ZP.div` margin-bottom: 16px; overflow: hidden; background-color: white; border: 1px solid #E0E3E5; border-radius: 4px; height: 120px; display: flex; flex-direction: column; ${t=>{let{$focus:e}=t;return e&&m.iv` border-color: var(--tas-window-tone); `}}; textarea { height: auto; background-color: #FFFFFF; resize: none; color: #333; outline: 0; border-radius: 6px; margin: 0 2px; width: calc(100% - 4px); display: block; padding: 8px; font-size: 14px; line-height: 20px; border: 0; flex-grow: 1; overflow: auto; box-sizing: border-box; } `,Jt=m.F4` from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0px); } `,Xt=m.ZP.div` margin-top: 38px; animation: ${Jt} ease 0.3s; `,qt=m.ZP.div` position: absolute; bottom: -22px; width: 100%; white-space: nowrap; font-size: 12px; color: #4d4f52; justify-content: center; display: flex; `,Kt=m.ZP.div` font-size: 15px; font-weight: 600; color: #333; margin-bottom: 24px; `,te=m.ZP.div` position: fixed; z-index: 4001; overflow: hidden; right: var(--tas-window-side-margin, 80px); bottom: var(--tas-window-bottom-margin, 48px); border-radius: 5px; box-shadow: 0 5px 40px rgb(0 0 0/16%); padding: 24px 24px 12px; background: #fff; width: 320px; box-sizing: border-box; transition: height 0.3s; .rc-rate { padding: 0; list-style: none; display: flex; justify-content: space-between; margin: 16px -4px; } .rc-rate-rtl { direction: rtl; } .rc-rate-disabled .rc-rate-star { cursor: default; } .rc-rate-disabled .rc-rate-star:before, .rc-rate-disabled .rc-rate-star-content:before { cursor: default; } .rc-rate-disabled .rc-rate-star:hover { transform: scale(1); } .rc-rate-star { margin: 0; padding: 0; color: #e9e9e9; position: relative; display: flex; flex: 1 1 0%; justify-content: center; text-align: center; [role="radio"] { position: relative; margin-left: 4px; margin-right: 4px; display: flex; height: 40px; width: 100%; cursor: pointer; justify-content: center; border: 1px solid #E0E3E5; border-radius: 6px; transition-duration: 160ms; animation-duration: 800ms; svg { width: 24px; } } } .rc-rate-star-full { [role="radio"] { background-color: #FFEED6; border-color: #FFEED6; } } .rc-rate-rtl .rc-rate-star { margin-right: 0; margin-left: 8px; float: right; } .rc-rate-star-first, .rc-rate-star-second { display: flex; align-items: center; position: relative; color: #CED4DAFF; } .rc-rate-star-first { position: absolute; left: 0; top: 0; width: 50%; height: 100%; overflow: hidden; opacity: 0; } .rc-rate-rtl .rc-rate-star-first { right: 0; left: auto; } .rc-rate-star-half .rc-rate-star-first, .rc-rate-star-half .rc-rate-star-second { opacity: 1; } .rc-rate-star-half .rc-rate-star-first, .rc-rate-star-full .rc-rate-star-second { color: #E6A447FF; } `,ee=(0,C.lazy)((()=>Promise.all([o.e(891),o.e(995)]).then(o.bind(o,3995))));function oe(){const[t,e,o,r,i,n,a]=(0,y.C)((t=>{let{context:{config:e}}=t;return[e.appearance,e.robot,e.doc,e.chat,e.broadcast,e.customs,e.feedback]}));let l=null;if(r.enable)switch(r.channel){case"hecong":l=(0,c.jsx)(bt,{channelId:r.channelId});break;case"wechat":l=(0,c.jsx)(Ct,{url:r.url})}return(0,c.jsxs)(re,{appearance:t,children:[!t.button.hidden&&(0,c.jsx)(P,{}),o.enable&&(0,c.jsx)(lt,{base:o.url}),i.enable&&(0,c.jsx)(Zt,{broadcast:i}),a&&(0,c.jsx)(Yt,{feedback:a}),e.enable&&(0,c.jsx)(C.Suspense,{fallback:null,children:(0,c.jsx)(ee,{robot:e})}),l,n.map(((t,e)=>(0,c.jsx)(Lt,{index:e,item:t},e)))]})}const re=m.ZP.div` --tas-window-tone: ${t=>t.appearance.window.tone}; --tas-window-side-margin: ${t=>t.appearance.window.sideMargin}px; --tas-window-bottom-margin: ${t=>t.appearance.window.bottomMargin}px; --tas-button-color: ${t=>t.appearance.button.color}; --tas-button-background: ${t=>t.appearance.button.background}; --tas-button-size: ${t=>({small:"30px",normal:"40px",large:"50px"}[t.appearance.button.size])}; --tas-button-side-margin: ${t=>t.appearance.button.sideMargin}px; --tas-button-bottom-margin: ${t=>t.appearance.button.bottomMargin}px; * { font-family: PingFang SC, Helvetica Neue, Helvetica, Arial, Hiragino Sans GB, Heiti SC, Microsoft YaHei, WenQuanYi Micro Hei, sans-serif;; } `;function ie(t,e,o){!function(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}(t,e),e.set(t,o)}var ne=new WeakMap;class ae{constructor(t){ie(this,ne,{writable:!0,value:void 0});const e=document.createElement("div");document.body.appendChild(e);const o=e.attachShadow({mode:"closed"}),r=document.createElement("div");o.appendChild(r),a()(this,ne,g({context:t}));const n=(0,c.jsx)(m.LC,{target:o,children:(0,c.jsx)(f.zt,{store:i()(this,ne),children:(0,c.jsx)(oe,{})})});b.render(n,r);const{doc:l}=t.config;l.enable&&document.addEventListener("click",(t=>{let e=t.target;if(e.hasAttribute("data-tas-doc")||(e=e.closest("[data-tas-doc]")),e){const o=e.getAttribute("href")||e.getAttribute("data-url"),r=e.getAttribute("data-tas-doc")||void 0;o&&o.startsWith(l.url)&&(t.preventDefault(),this.openDoc(o,r))}}))}openDoc(t,e){t&&i()(this,ne)?.dispatch(p(t)),e&&i()(this,ne)?.dispatch(h(e)),i()(this,ne)?.dispatch((0,s.$Z)("doc"))}closeDoc(){i()(this,ne)?.dispatch((0,s.$Z)(void 0))}toggleDoc(){if(i()(this,ne)){const t=i()(this,ne).getState().window.name;i()(this,ne)?.dispatch((0,s.$Z)("doc"===t?void 0:"doc"))}}toggleChat(){if(i()(this,ne)){const t=i()(this,ne).getState().window.name;i()(this,ne)?.dispatch((0,s.$Z)("chat"===t?void 0:"chat"))}}toggleFeedback(){if(i()(this,ne)){const t=i()(this,ne).getState().window.name;i()(this,ne)?.dispatch((0,s.$Z)("feedback"===t?void 0:"feedback"))}}toggleCustom(t){if(i()(this,ne)){const e=i()(this,ne).getState().window.name;i()(this,ne)?.dispatch((0,s.$Z)(e===`custom-${t}`?void 0:`custom-${t}`))}}}}}]);