(window.saladictEntry=window.saladictEntry||[]).push([[130],{1353:function(e,t,a){"use strict";a.d(t,"a",(function(){return l}));var n=a(0),i=a.n(n),c="undefined"!=typeof window?n.useLayoutEffect:n.useEffect;const l=e=>{const{tag:t="div",html:a,...l}=e,r=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,o]=Object(n.useState)(null);return c(()=>{if(r&&s){for(;s.childNodes.length>0;)s.childNodes[0].remove();s.appendChild(r)}},[r,s]),i.a.createElement(t,{...l,ref:o})}},681:function(e,t,a){"use strict";a.r(t),a.d(t,"DictWikipedia",(function(){return s}));var n=a(0),i=a.n(n),c=a(1),l=a(9),r=a(1353);const s=({result:e,searchText:t})=>{const[a,s]=Object(n.useState)(),{t:u}=Object(l.e)("content");Object(n.useEffect)(()=>{s([])},[e.langSelector]);const d=e=>{e.target.value&&t({id:"wikipedia",payload:{url:e.target.value}})};let m=null;return a&&a.length>0?m=i.a.createElement("select",{onChange:d,defaultValue:""},i.a.createElement("option",{key:"",value:""},u("chooseLang")),a.map(e=>i.a.createElement("option",{key:e.url,value:e.url},e.title))):e.langSelector&&(m=i.a.createElement("button",{className:"dictWikipedia-LangSelectorBtn",onClick:async()=>{s(await c.a.send({type:"DICT_ENGINE_METHOD",payload:{id:"wikipedia",method:"fetchLangList",args:[e.langSelector]}}))}},u("fetchLangList"))),i.a.createElement(i.a.Fragment,null,i.a.createElement("h1",{className:"dictWikipedia-Title"},e.title),m,i.a.createElement("div",{className:"dictWikipedia-Content",onClick:o},i.a.createElement(r.a,{className:"client-js",html:e.content})))};function o(e){if(!e.target.classList)return;let t=e.target;if(!t.classList.contains("section-heading")&&(t=t.parentElement,!t||!t.classList.contains("section-heading")))return;e.stopPropagation(),e.preventDefault(),t.classList.toggle("open-block");const a=t.nextElementSibling;if(a){const e=t.classList.contains("open-block").toString();a.classList.toggle("open-block"),a.setAttribute("aria-pressed",e),a.setAttribute("aria-expanded",e)}const n=t.querySelector(".mw-ui-icon-mf-arrow");n&&n.classList.toggle("mf-mw-ui-icon-rotate-flip")}t.default=s}}]);