(window.saladictEntry=window.saladictEntry||[]).push([[126],{1353:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(0),c=a.n(n),r="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;const l=e=>{const{tag:t="div",html:a,...l}=e,i=Object(n.useMemo)(()=>{try{const e=document.createDocumentFragment(),t=(new DOMParser).parseFromString(a,"text/html");return Array.from(t.body.childNodes).forEach(t=>{e.appendChild(t)}),e}catch(e){!1}return null},[a]),[s,d]=Object(n.useState)(null);return r(()=>{if(i&&s){for(;s.childNodes.length>0;)s.childNodes[0].remove();s.appendChild(i)}},[i,s]),c.a.createElement(t,{...l,ref:d})}},672:function(e,t,a){"use strict";a.r(t),a.d(t,"DictRenren",(function(){return d}));var n=a(0),c=a.n(n),r=a(123),l=a(1),i=a(1353);const s=({slide:e})=>{const[t,a]=Object(n.useState)(240),[l,s]=Object(n.useState)(!1);return Object(n.useEffect)(()=>{s(!1)},[e.cover]),c.a.createElement("div",{className:"dictRenren-Slide"},c.a.createElement("div",{className:"dictRenren-Slide_Speaker"},c.a.createElement(r.c,{src:e.mp3,width:20})),c.a.createElement("figure",{style:{height:t}},c.a.createElement("img",{src:e.cover,alt:e.en,className:"dictRenren-Slide_Cover"+(l?" isLoaded":""),onLoad:e=>{a(e.currentTarget.height),s(!0)}}),c.a.createElement("figcaption",null,c.a.createElement(i.a,{tag:"p",html:e.en,className:"dictRenren-Slide_En"}),c.a.createElement("p",{className:"dictRenren-Slide_Chs"},e.chs))))},d=({result:e})=>{const[t,a]=Object(n.useState)(0),[r,i]=Object(n.useState)({});Object(n.useEffect)(()=>{a(0)},[e]);return c.a.createElement(c.a.Fragment,null,c.a.createElement("select",{onChange:e=>a(Number(e.currentTarget.value)||0),value:t},e.map((e,t)=>c.a.createElement("option",{key:e.key,value:t},e.title))),r[e[t].key]?r[e[t].key].map(e=>c.a.createElement(s,{key:e.cover+e.mp3,slide:e})):c.a.createElement(c.a.Fragment,null,c.a.createElement(s,{slide:e[t].slide}),c.a.createElement("a",{className:"dictRenren-Detail",href:e[t].detail,onClick:async a=>{a.preventDefault(),a.stopPropagation();const n=e[t],c=await l.a.send({type:"DICT_ENGINE_METHOD",payload:{id:"renren",method:"getDetail",args:[n.detail]}});c&&c.length>0&&i(e=>({...e,[n.key]:c}))}},"⤋查看详情"),e[t].context.map(e=>c.a.createElement("div",{key:e.title,className:"dictRenren-Ctx"},c.a.createElement("p",{className:"dictRenren-Ctx_Title"},e.title),c.a.createElement("div",{className:"dictRenren-Ctx_Subtitles"},e.content.map(e=>c.a.createElement("p",{key:e},e)))))))};t.default=d}}]);