window.addEventListener('message', function (event) { try { const data = JSON.parse(event.data); if (data.action === 'openUrl' && data.url) { window.open(data.url, '_blank'); } } catch (e) { } }); _theme = localStorage.getItem('theme'); if (!_theme) { _theme = window.matchMedia('(prefers-color-scheme: dark)').matches ? 'dark' : 'light'; localStorage.setItem('theme', _theme); } setInterval(() => { let iframe = document.getElementById('iframe'); if (!iframe) { return ; } let theme = localStorage.getItem('theme'); const data = { 'data-theme': theme, }; iframe.contentWindow.postMessage(JSON.stringify(data), '*'); }, 100); if (navigator.userAgent.toLowerCase().indexOf('safari') !== -1) document.body.classList.add('is-safari'); // ////// remove AutoScroll // // function removeEventListenersFromElement(elementId) { // // 获取元素 // const element = document.getElementById(elementId); // if (element) { // // 创建一个新的元素,保留旧元素的属性(如样式、ID等) // const newElement = document.createElement(element.tagName); // // 复制旧元素的所有属性 // for (const attr of element.attributes) { // newElement.setAttribute(attr.name, attr.value); // } // // // 移动所有子元素到新的元素中 // while (element.firstChild) { // newElement.appendChild(element.firstChild); // } // // // 替换旧元素 // element.parentNode.replaceChild(newElement, element); // // console.log(`所有事件监听器已从ID为 ${elementId} 的元素中移除`); // // // 将该元素移动到底部 // newElement.scrollTop = newElement.scrollHeight; // } else { // console.log(`未找到 ID 为 ${elementId} 的元素`); // } // } // // let autoScroll = localStorage.getItem("autoScroll"); // // if (autoScroll == null) { // autoScroll = true; // } else { // if (autoScroll === "false") { // autoScroll = false; // } else { // autoScroll = true; // } // } // // let removeAutoScrollTimer = setInterval(function() { // // 选择所有的 '.member[data-v-845f50eb]' 元素 // var removeAutoScrollMember = document.getElementById("scrollRef"); // // 循环 // if (removeAutoScrollMember) { // if (!autoScroll) { // removeEventListenersFromElement("scrollRef"); // } // clearInterval(removeAutoScrollTimer); // } // }, 100); // // function clickRemoveAutoScroll () { // autoScroll = !autoScroll; // if (autoScroll) { // localStorage.setItem("autoScroll", "true"); // document.getElementById("AutoScrollTips").style.display = "inline-block"; // buttonClassName = "rounded-[10px] flex items-center dark:text-[#d9f2f1] select-none transition-all hover:border-[#5782f4] whitespace-nowrap bg-primary text-white cursor-pointer px-2 h-[24px] text-[12px]" // // // 将classname变成新的 // document.getElementById("AutoScrollBtn").classList = buttonClassName; // // } else { // removeEventListenersFromElement("scrollRef"); // localStorage.setItem("autoScroll", "false"); // document.getElementById("AutoScrollTips").style.display = "none"; // buttonClassName = "rounded-[10px] flex items-center dark:text-[#d9f2f1] select-none transition-all hover:border-[#5782f4] whitespace-nowrap bg-[#DCE4E8] dark:bg-[#40484C] hover:dark:text-[#C0C8CC] cursor-pointer px-2 h-[24px] text-[12px]" // document.getElementById("AutoScrollBtn").classList = buttonClassName; // } // } // // // // 获取每个节点 document.getElementsByClassName("leading-relaxed break-words") // removeAutoScrollDomTimer = setInterval(function() { // let removeAutoScrollDomMembers = document.getElementsByClassName("rounded-[10px] flex items-center dark:text-[#d9f2f1] select-none transition-all hover:border-[#5782f4] whitespace-nowrap bg-[#DCE4E8] dark:bg-[#40484C] hover:dark:text-[#C0C8CC] cursor-pointer px-2 h-[24px] text-[12px]"); // // let removeAutoScrollDomInserted = false; // let scrollBar = document.getElementsByClassName("flex space-x-3 items-center") // // Array.from(scrollBar).forEach(element => { // if (element.innerHTML.includes("M365.269333 521.813333c3.904-6.165333 10.837333-9.877333 18.325334-9.813333 7.466667 0.064 14.421333 3.904 18.368 10.133333l87.957333 138.666667-36.629333 21.888-48.298667-76.16v235.882667h-42.666667V606.933333l-48.213333 76.032-36.8-22.506666 87.957333-138.666667zM599.936 832.576c3.904 6.186667 10.837333 9.898667 18.325333 9.813333 7.466667-0.042667 14.421333-3.882667 18.368-10.112l87.957334-138.666666-36.629334-21.888-48.298666 76.16V512h-42.666667v235.434667l-48.213333-76.010667L512 693.909333l87.936 138.666667zM736 405.333333v-64c0-123.712-100.288-224-224-224S288 217.621333 288 341.333333v64h-42.666667v-64c0-147.285333 119.381333-266.666667 266.666667-266.666666S778.666667 194.048 778.666667 341.333333v64h-42.666667z") ){ // removeAutoScrollDomInserted = true; // } // }) // // if (!removeAutoScrollDomInserted) { // Array.from(removeAutoScrollDomMembers).forEach(element => { // // let buttonClassName = ""; // // if (autoScroll) { // buttonClassName = "rounded-[10px] flex items-center dark:text-[#d9f2f1] select-none transition-all hover:border-[#5782f4] whitespace-nowrap bg-primary text-white cursor-pointer px-2 h-[24px] text-[12px]" // } else { // buttonClassName = "rounded-[10px] flex items-center dark:text-[#d9f2f1] select-none transition-all hover:border-[#5782f4] whitespace-nowrap bg-[#DCE4E8] dark:bg-[#40484C] hover:dark:text-[#C0C8CC] cursor-pointer px-2 h-[24px] text-[12px]" // } // // if (element.innerHTML.includes("导出文档")) { // // 父元素最后增加一个子元素 // element.insertAdjacentHTML('afterend', `
`); // } else if (element.innerHTML.includes("M747.405104 190.174213q-11.246862 0-18.915177-7.668315t-12.780525-17.892735-7.668315-20.960061-2.556105-16.870293l0-126.782808 2.044884 0q9.201978 0 17.381514 2.556105t19.937619 9.713199 28.628376 20.960061 42.431343 36.296691q27.605934 24.538608 43.965006 41.920122t25.049829 28.628376 10.735641 19.426398 2.044884 14.314188l0 16.359072-150.298974 0zM764.786618 796.48232q-36.807912 7.157094-65.436288 19.426398-24.538608 11.246862-43.965006 30.67326t-16.359072 49.077216q2.044884 20.44884 3.067326 36.296691t2.044884 29.139597l-382.393309 0q-19.426398 0-42.431343-11.246862t-42.942564-29.650818-33.229365-42.431343-13.291746-48.565995l0-697.305446q0-21.471282 9.713199-44.987448t26.583492-42.431343 38.341575-31.695702 44.987448-12.780525l391.595287 0 0 127.80525q0 20.44884 6.134652 42.431343t19.426398 41.408901 33.740586 31.695702 48.054774 12.269304l149.276532 0 0 305.710159-41.920122 66.45873-89.974896-105.311526q-17.381514 19.426398-29.650818 38.852796-11.246862 17.381514-20.44884 37.319133t-11.246862 40.386459l-383.415751 0q-26.583492 0-44.987448 18.915177t-18.403956 45.498669 18.403956 44.987448 44.987448 18.403956l383.415751 0q23.516166 0 38.852796-12.269304 5.11221 9.201978 8.690757 17.381514t6.645873 13.291746q4.089768 6.134652 6.134652 11.246862zM321.046789 383.415751q-26.583492 0-44.987448 18.915177t-18.403956 45.498669 18.403956 44.987448 44.987448 18.403956l383.415751 0q26.583492 0 45.498669-18.403956t18.915177-44.987448-18.915177-45.498669-45.498669-18.915177l-383.415751 0zM954.960831 881.345006q6.134652 3.067326 18.403956 7.157094t24.027387 11.758083 20.44884 21.471282 7.668315 36.296691q-1.022442 27.605934-16.359072 43.453785t-35.78547 20.44884-41.408901-2.044884-32.206923-25.049829q-14.314188-23.516166-12.780525-46.521111t5.623431-48.565995q2.044884-14.314188-0.511221-20.44884t-5.623431-11.246862q-2.044884-2.044884-5.623431-6.645873t-6.645873-9.713199q-4.089768-5.11221-8.179536-11.246862-3.067326 5.11221-7.157094 9.201978-3.067326 4.089768-6.645873 9.201978t-6.645873 10.22442q-7.157094 9.201978-7.668315 15.33663t1.533663 14.314188q1.022442 4.089768 2.556105 15.33663t1.022442 25.56105-5.11221 30.162039-15.847851 30.162039q-15.33663 18.403956-35.78547 22.493724t-39.364017-2.556105-32.206923-22.493724-13.291746-38.341575q-1.022442-21.471282 7.157094-35.78547t20.44884-23.516166 25.56105-14.825409 22.493724-8.690757q18.403956-7.157094 25.56105-12.780525t13.291746-13.802967q3.067326-4.089768 7.668315-10.735641t9.713199-12.780525q5.11221-7.157094 10.22442-15.33663-4.089768-4.089768-8.179536-10.22442-4.089768-5.11221-9.713199-12.269304t-11.758083-16.359072q-7.157094-8.179536-14.314188-19.937619t-13.291746-23.516166-10.735641-21.471282-5.623431-14.825409q-4.089768-10.22442-6.134652-26.583492t6.134652-21.471282 11.246862-0.511221 9.201978 12.780525q2.044884 4.089768 14.314188 23.004945t26.583492 39.364017q16.359072 25.56105 34.763028 55.211868 15.33663-24.538608 27.605934-46.00989 11.246862-18.403956 21.471282-35.78547t14.314188-23.516166q7.157094-12.269304 11.758083-18.915177t6.645873-8.690757 6.645873-0.511221 7.668315 6.645873q2.044884 5.11221 1.533663 13.802967t-2.556105 26.072271q-2.044884 8.179536-6.645873 18.403956t-9.713199 20.44884-10.22442 19.426398-8.179536 13.291746q-3.067326 5.11221-9.713199 13.291746t-12.780525 16.359072q-7.157094 10.22442-15.33663 20.44884 5.11221 8.179536 9.201978 14.314188t7.668315 11.758083 5.623431 8.690757q6.134652 11.246862 18.915177 21.471282t25.049829 16.359072zM773.988596 980.521881q14.314188 0 24.027387-9.713199t9.713199-24.027387-9.713199-24.027387-24.027387-9.713199-24.027387 9.713199-9.713199 24.027387 9.713199 24.027387 24.027387 9.713199zM957.005715 993.813627q15.33663 0 26.072271-10.735641t10.735641-26.072271-10.735641-26.072271-26.072271-10.735641-26.072271 10.735641-10.735641 26.072271 10.735641 26.072271 26.072271 10.735641z")){ // element.insertAdjacentHTML('afterend', ` `); // } // }); // } // // }, 100); // let dallEImageChangeTimer = setInterval(function() { // // 选择所有的 '.n-tabs-tab n-tabs-tab--active' 元素 // let dallEImageSelect = document.getElementsByClassName("n-tabs-tab n-tabs-tab--active"); // let dallEImageMembers = document.getElementsByClassName("n-tab-pane"); // // let isdallE = false; // let dallEImageInserted = false; // // Array.from(dallEImageSelect).forEach(element => { // if (element.innerHTML.includes("Dall.E")) { // isdallE = true; // } // }); // // Array.from(dallEImageMembers).forEach(element => { // if (element.innerHTML.includes("{{dallEImageInserted}}")) { // dallEImageInserted = true; // } // }); // // if (!dallEImageInserted && isdallE) { // // 检查是否已经插入了样式 // if (!document.getElementById("dallEStyles")) { // let styleElement = document.createElement("style"); // styleElement.id = "dallEStyles"; // styleElement.innerHTML = ` // .text-transparent { // color: transparent; // } // .hover\\:bg-gray-800:hover { // --tw-bg-opacity: 1; // background-color: rgb(31 41 55 / var(--tw-bg-opacity)); /* #1f2937 */ // } // .hover\\:bg-opacity-60:hover { // --tw-bg-opacity: 0.6; // } // .hover\\:text-white:hover { // --tw-text-opacity: 1; // color: rgb(255 255 255 / var(--tw-text-opacity)); /* #ffffff */ // } // `; // document.head.appendChild(styleElement); // } // // // Loop through the tab panes // Array.from(dallEImageMembers).forEach(element => { // Array.from(element.getElementsByClassName("w-full h-full p-[14px]")).forEach(innerElement => { // // Create the new element to insert // let newElement = document.createElement("div"); // newElement.innerHTML = `