From bd276c924de0872e288ac52dfb6ba29fb38c6aa6 Mon Sep 17 00:00:00 2001 From: mustakshif Date: Mon, 14 Oct 2024 00:34:54 +0800 Subject: [PATCH] fix(colorful-asri): adjust accent color settings and improve UI consistency - Simplify CSS for accent color options, removing unnecessary selectors and properties - Enhance the "pick color" option by hiding the SVG icon on iOS and making the color picker visible - Refine the "follow system accent" option, improving its selected state visual feedback - Adjust the "use separate scheme" option to remove redundant styling - Improve consistency in label styling for color-related menu items --- src/modules/configsMenu/makeItems.ts | 4 +- style/features/colorful-asri.scss | 115 ++++++++++++--------------- theme.css | 2 +- theme.js | 2 +- 4 files changed, 57 insertions(+), 66 deletions(-) diff --git a/src/modules/configsMenu/makeItems.ts b/src/modules/configsMenu/makeItems.ts index 76109f0..c730b20 100644 --- a/src/modules/configsMenu/makeItems.ts +++ b/src/modules/configsMenu/makeItems.ts @@ -115,9 +115,9 @@ function createMenuItems() { const asriConfigMenuHTML = ` \n \n `,c=`\n \n \n \n \n \n \n `,s=`\n \n \n \n ${a.afwdDocMenuLabel}\n \n \n \n
\n
\n ${"doc"===n?c:u}\n \n \n
\n
\n `;o.innerHTML=s,e.insertBefore(o,null===(t=e.lastChild)||void 0===t?void 0:t.previousSibling),e.insertBefore(i,o)}))}(n);let u=yield(0,i.m)(t).then((n=>n["custom-afwd"]));if(u||(u=""),u=u.split(" "),u.length>0&&e){if(u.forEach((n=>{const t=document.getElementById(`afwdMenuItem-${n}`);t&&(t.querySelector("input").checked=!0)})),u.includes("all")){const n=null==r?void 0:r.querySelectorAll("button[id^=afwdMenuItem]:not(#afwdMenuItem-all, #afwdMenuItem-clear)");null==n||n.forEach((n=>{n.classList.add("b3-menu__item--disabled"),n.querySelector("input").disabled=!0}))}}else if(u.length>0){const n=document.getElementById(`afwdMenuItem-${u[0]}`);n&&n.classList.add("b3-menu__item--selected")}!function(n,t,e){const o=null==r?void 0:r.querySelectorAll("button[id^=afwdMenuItem]:not(#afwdMenuItem-clear)");let u=[];if(!o)return;const c=[...o].filter((n=>"afwdMenuItem-all"!==n.id));n?null==o||o.forEach((n=>{n.onclick=o=>{if(n.classList.contains("b3-menu__item--disabled"))return;const s=n.querySelector("input"),l=n.id.split("-")[1];let r=s.checked;o.target===s?r=!r:s.checked=!r,r?"all"===l?(c.forEach((n=>{n.classList.remove("b3-menu__item--disabled"),n.querySelector("input").disabled=!1})),e=u.length>0?u:[]):e=e.filter((n=>n!==l)):"all"===l?(e.includes("all")||(u=e),e=["all"],c.forEach((n=>{n.classList.add("b3-menu__item--disabled"),n.querySelector("input").disabled=!0}))):e.push(l),(0,i._)(t,{"custom-afwd":e.join(" ")||""})}})):null==o||o.forEach(((n,o,u)=>{n.onclick=()=>{const c=n.id.split("-")[1];n.classList.contains("b3-menu__item--selected")?(e=[],n.classList.remove("b3-menu__item--selected")):(e=[c],n.classList.add("b3-menu__item--selected"),u[1-o].classList.remove("b3-menu__item--selected")),(0,i._)(t,{"custom-afwd":(null==e?void 0:e.join(" "))||""})}}));const s=document.getElementById("afwdMenuItem-clear");s&&(s.onclick=()=>{e=[],u=[],(0,i._)(t,{"custom-afwd":""}),o.forEach((t=>{if(t.classList.remove("b3-menu__item--disabled"),t.classList.remove("b3-menu__item--selected"),n){const n=t.querySelector("input");n.disabled=!1,n.checked=!1}}))})}(e,t,u)}))}(v,b)}))},t.v=function(){null===c.h||void 0===c.h||c.h.forEach((n=>{(n.querySelector(".file-tree")?[]:n.querySelectorAll(".protyle-wysiwyg")).forEach((n=>{n.style.removeProperty("--protyle-spacing"),n.dataset.p=void 0}))}))};const i=e(613),u=e(629),c=e(216),s=e(787);t.t=(0,u.k)(d,200);const l=["NodeParagraph","NodeTable","NodeAttributeView","NodeSuperBlock","NodeVideo","NodeWidget","NodeIFrame"];let r,a=s.M;function d(){null===c.h||void 0===c.h||c.h.forEach((n=>{let t=n.querySelector(".file-tree")?[]:n.querySelectorAll(".protyle-wysiwyg");setTimeout((()=>{t.forEach((n=>{let t;t=n.style.paddingLeft,t!==n.dataset.p&&(n.style.setProperty("--protyle-spacing",t),n.dataset.p=t)}))}),300)}))}},787:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.followSysAccentColor=t.M=void 0,t.S=function(){return o(this,void 0,void 0,(function*(){var n;t.M=yield b(),function(){return o(this,void 0,void 0,(function*(){yield(0,i.getFile)("/data/snippets/Asri.config.json").then((n=>n&&200===n.status?n.json():null)).then((n=>{var e,o;n?(t.followSysAccentColor=!!n.followSysAccentColor,l.followSysAccentColor=t.followSysAccentColor,l.chroma=null!==(e=n.chroma)&&void 0!==e?e:"1",l.userCustomColor=null!==(o=n.userCustomColor)&&void 0!==o?o:"#3478f6"):t.followSysAccentColor=l.followSysAccentColor}))}))}().then((()=>{s.I.O&&(s.I.P||s.I.T||s.I.j?(document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor),k(l.userCustomColor)):t.followSysAccentColor?document.documentElement.style.removeProperty("--asri-user-custom-accent"):(document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor),k(l.userCustomColor)),document.documentElement.style.setProperty("--asri-c-factor",l.chroma),v="0"===l.chroma,w(l.chroma),g())})),s.I.O&&(null===(n=s.L.A)||void 0===n||n.addEventListener("click",p))}))},t.R=function(){var n;document.documentElement.style.removeProperty("--asri-user-custom-accent"),document.documentElement.style.removeProperty("--asri-sys-accent-grayscale"),document.documentElement.style.removeProperty("--asri-c-factor"),document.documentElement.style.removeProperty("--asri-sys-accent"),document.documentElement.style.removeProperty("--asri-sys-accent-accessible"),document.documentElement.style.removeProperty("--asri-c-0"),document.documentElement.style.removeProperty("--asri-on-primary-reverse"),null===(n=s.L.A)||void 0===n||n.removeEventListener("click",p),document.querySelectorAll(".asri-config").forEach((n=>n.remove()))},t.u=b,t.C=g;const i=e(613),u=e(571),c=e(629),s=e(49),l={followSysAccentColor:!0,chroma:"1",userCustomColor:""};let r,a,d,f,m,_=!1,v=!1;function b(){return o(this,void 0,void 0,(function*(){let n;try{return n=["zh_CN","zh_CHT","en_US"].includes(s.I.lang)?yield fetch(`/appearance/themes/Asri/i18n/${s.I.lang}.json`):yield fetch("/appearance/themes/Asri/i18n/en_US.json"),t.M=yield n.json(),t.M}catch(n){throw n}}))}function h(){return o(this,void 0,void 0,(function*(){yield(0,i.$)("/data/snippets/Asri.config.json",JSON.stringify(l,void 0,4))}))}function p(){return o(this,void 0,void 0,(function*(){Object.keys(t.M).length||(t.M=yield b()),setTimeout(y,0)}))}function y(){var n,e;if(document.querySelector(".asri-config"))return;const o=document.querySelector('#commonMenu[data-name="barmode"] .b3-menu__items');if(!o)return;const i=`\n \n \n \n \n`,u=document.createRange().createContextualFragment(i);o.appendChild(u),a=document.getElementById("followSysAccent"),d=document.getElementById("pickColor"),f=document.getElementById("asriChromaSlider"),m=d.lastElementChild,a&&d&&f&&m&&(a.classList.toggle("b3-menu__item--selected",t.followSysAccentColor),d.classList.toggle("b3-menu__item--selected",!t.followSysAccentColor),f.value=l.chroma||"1",f.parentElement.ariaLabel=t.M.asriChroma+l.chroma,function(){if(!(a&&d&&f&&m))return;const n=(0,c.k)((()=>h()),200);s.I.P||s.I.T||s.I.j?a.classList.add("fn__none"):a.addEventListener("click",e);function e(){t.followSysAccentColor?(t.followSysAccentColor=!1,a.classList.remove("b3-menu__item--selected"),d.classList.add("b3-menu__item--selected"),document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor||r||"#3478f6"),w(l.chroma),k(l.userCustomColor||r||"#3478f6"),l.followSysAccentColor=!1):(t.followSysAccentColor=!0,a.classList.add("b3-menu__item--selected"),d.classList.remove("b3-menu__item--selected"),document.documentElement.style.removeProperty("--asri-user-custom-accent"),l.followSysAccentColor=!0,g()),h()}function o(){t.followSysAccentColor&&(t.followSysAccentColor=!1,a.classList.remove("b3-menu__item--selected"),d.classList.add("b3-menu__item--selected"),document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor),w(l.chroma),k(l.userCustomColor),l.userCustomColor=l.userCustomColor,l.followSysAccentColor=!1,h())}function i(){const n=m.value;document.documentElement.style.setProperty("--asri-user-custom-accent",n),k(n)}function u(){a.classList.remove("b3-menu__item--selected"),d.classList.add("b3-menu__item--selected"),k(m.value),l.userCustomColor=m.value,t.followSysAccentColor=!1,l.followSysAccentColor=!1,h()}function _(){const e=this.value;document.documentElement.style.setProperty("--asri-c-factor",e),this.parentElement.ariaLabel=t.M.asriChroma+e,l.chroma=e,v="0"===e,w(e),n()}d.addEventListener("click",o),m.addEventListener("input",i),m.addEventListener("change",u),f.addEventListener("input",_)}())}function g(){if(!(s.I.P||s.I.T||s.I.j)){const n="#"+u.remote.systemPreferences.getAccentColor().slice(0,6),e=(0,c.N)(n);if(!e)return;r!==n&&(document.documentElement.style.setProperty("--asri-sys-accent",n),e.s>.28?document.documentElement.style.setProperty("--asri-sys-accent-accessible",n):document.documentElement.style.removeProperty("--asri-sys-accent-accessible"),_=0===e.s,document.body.classList.add("asri-mode-transition"),setTimeout((()=>{document.body.classList.remove("asri-mode-transition")}),350),r=n),t.followSysAccentColor&&(w(e.s),k(n))}}function w(n){return"0"===String(n)||t.followSysAccentColor&&_||v?(document.documentElement.style.setProperty("--asri-c-0","0"),!0):(document.documentElement.style.removeProperty("--asri-c-0"),!1)}t.followSysAccentColor=!0;const x="light"===s.I.B?.81:.79;function k(n){const t=(0,c.F)(n);t&&(t>x?document.documentElement.style.setProperty("--asri-on-primary-reverse","light"===s.I.B?".4":".3"):document.documentElement.style.removeProperty("--asri-on-primary-reverse"))}},344:(n,t)=>{function e(){document.body.classList.toggle("has-exportimg",!!document.querySelector('[data-key="dialog-exportimage"]'))}Object.defineProperty(t,"__esModule",{value:!0}),t.D=function(n,t){e()},t.V=e},818:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.H=function(){return o(this,void 0,void 0,(function*(){const n=u.L.J?u.L.J:yield(0,i.l)("#dockLeft");u.L.U||(yield(0,i.l)(".layout__dockl"));const t=u.L.W;for(let e of[n,t]){let t=(0,c.K)(e===n?"L":"R"),o=(0,c.Y)(e===n?"L":"R");t&&o?null==e||e.classList.add("dock-layout-expanded"):null==e||e.classList.remove("dock-layout-expanded")}}))},t.q=function(){return o(this,void 0,void 0,(function*(){var n,t,e;if(u.I.T)return;const o=yield(0,c.G)(),i=!(0,c.K)("B")&&(0,c.Y)("B");null===(n=u.L.toolbar)||void 0===n||n.nextElementSibling.classList.toggle("has-dockb",o),null===(t=u.L.toolbar)||void 0===t||t.nextElementSibling.classList.toggle("has-layout-dockb-float",i),null===(e=u.L.X)||void 0===e||e.classList.toggle("has-layout-dockb-float",i)}))},t.Z=function(){var n,t;null===(n=u.L.toolbar)||void 0===n||n.nextElementSibling.classList.remove("has-dockb"),null===(t=u.L.toolbar)||void 0===t||t.nextElementSibling.classList.remove("has-layout-dockb-float")},t.nn=function(){var n;null===(n=document.querySelector(".dock-layout-expanded"))||void 0===n||n.classList.remove("dock-layout-expanded")};const i=e(629),u=e(49),c=e(216)},937:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.tn=void 0,t.en=u,t.un=function(){document.querySelectorAll(".protyle .protyle-background.without-icon").forEach((n=>{n.classList.remove("without-icon")}))};const i=e(629);function u(){return o(this,void 0,void 0,(function*(){let n=yield(0,i.cn)(".protyle-top>.protyle-background");null==n||n.forEach((n=>{var t;!(null===(t=n.querySelector(".protyle-background__img img"))||void 0===t?void 0:t.classList.contains("fn__none"))&&n.querySelector(".protyle-background__icon.fn__none")?n.classList.add("without-icon"):n.classList.remove("without-icon")}))}))}t.tn=(0,i.k)(u)},261:(n,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sn=function(){i.forEach((({ln:n,className:t})=>{n&&document.body.classList.add(t)}))},t.rn=function(){i.forEach((({className:n})=>{document.body.classList.remove(n)}))};const o=e(49),i=[{ln:o.I.an,className:"body-asri--mac"},{ln:o.I.j,className:"body-asri--linux"},{ln:o.I.T,className:"body-asri--mobile"},{ln:o.I.P,className:"body-asri--browser"},{ln:o.I.dn,className:"body-asri--android"},{ln:o.I.fn,className:"body-asri--iosApp"},{ln:o.I.mn,className:"body-asri--readOnly"}]},2:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._n=t.vn=t.bn=void 0,t.hn=function(){return o(this,void 0,void 0,(function*(){(0,_.sn)(),(0,v.pn)(),(0,y.yn)(),(0,h.gn)(),(0,a.S)(),s.I.T||(yield(0,l.wn)(),yield(0,p.xn)("initials"),(0,p.kn)()),P(),(0,f.q)(),(0,h.Mn)(),g.start(document,"mouseup"),w.start(document,"dragend"),x.start(document,"keyup"),M.observe(document.body,c.Sn),k.observe(document.body,{childList:!0}),s.L.On||(yield(0,u.l)(".layout__center")),s.I.T||(S.observe(s.L.On),O.observe(document.body))}))},t.In=function(){return o(this,void 0,void 0,(function*(){(0,_.rn)(),(0,v.Pn)(),(0,y.Tn)(),(0,h.jn)(),s.I.T||(yield(0,p.An)()),(0,f.nn)(),(0,b.Ln)(),(0,m.un)(),(0,r.v)(),(0,f.Z)(),(0,h.Rn)(),g.remove(document,"mouseup"),w.remove(document,"dragend"),x.remove(document,"keyup"),M.disconnect(),k.disconnect((()=>{document.body.classList.remove("has-exportimg")})),document.body.classList.remove("body-asri--fullscreen"),s.I.T||(S.disconnect(),O.disconnect()),(0,a.R)()}))};const i=e(796),u=e(629),c=e(766),s=e(49),l=e(216),r=e(12),a=e(787),d=e(344),f=e(818),m=e(937),_=e(261),v=e(832),b=e(844),h=e(414),p=e(376),y=e(130),g=new i.Cn(I),w=new i.Cn(I),x=new i.Cn(I),k=new c.$n((0,u.k)(d.D,500)),M=new c.$n((function(n,t){var e;for(let t of n)t.target.classList.contains("b3-list-item--focus")&&((0,b.Nn)(),(0,m.tn)()),t.target===document.body&&((null===(e=t.oldValue)||void 0===e?void 0:e.includes("body--blur"))||t.target.className.includes("body--blur"))&&(0,l.wn)().then((()=>{P(),!s.I.fn&&a.followSysAccentColor&&s.I.O&&(0,a.C)()}))})),S=new c.Bn((function(n,e){(0,p.zn)(0,t.bn,l.Fn).then(p.Dn),(0,r.t)(),(0,h.Vn)()})),O=new c.Bn((function(n,e){for(let e of n){t.bn=!0,T();const{inlineSize:n}=e.contentBoxSize[0];if(e.target instanceof HTMLElement){if(!e.target.dataset.Hn){e.target.dataset.Hn=n+"";continue}const o=n-parseFloat(e.target.dataset.Hn);e.target.dataset.Hn=n+"",t._n=o}}}));function I(n){P(n),(0,r.i)(n)}function P(n){return o(this,void 0,void 0,(function*(){function t(){setTimeout((()=>o(this,void 0,void 0,(function*(){(0,f.H)(),(0,m.tn)(),(0,h.Vn)(),(0,h.gn)(),yield(0,l.wn)(),(0,r.o)(),(0,f.q)(),(0,h.Mn)(),!s.I.fn&&a.followSysAccentColor&&s.I.O&&(0,a.C)()}))),0)}n?(n.type.startsWith("mouse")||n.type.startsWith("drag")||n instanceof KeyboardEvent&&("Control"===n.key||"Alt"===n.key||"Shift"===n.key||"Meta"===n.key))&&(t(),setTimeout((()=>{(0,p.En)(),(0,p.zn)(0,!1,l.Fn).then(p.Dn)}),0)):(t(),(0,p.zn)().then(p.Dn))}))}t.bn=!1,t._n=0;const T=(0,u.k)((()=>{t.bn=!1,(0,p.Jn)(),(0,l.Un)(),l.Fn||(0,p.En)(),(0,p.zn)(t._n,t.bn,l.Fn).then(p.Dn),t._n=0}),200)},832:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.pn=function(){return o(this,void 0,void 0,(function*(){if(u||c)for(let n=0;nn.classList.remove("has-focus")))};const i=e(629),u=e(49),{T:c}=u.I;function s(){return o(this,void 0,void 0,(function*(){if(c)return;u.L.U||(yield(0,i.l)(".layout__dockl"));let n=document.querySelectorAll(".file-tree .b3-list-item--focus");n.length&&(document.querySelectorAll(".file-tree .has-focus").forEach((n=>n.classList.remove("has-focus"))),n.forEach((n=>{n.nextElementSibling&&"UL"===n.nextElementSibling.tagName&&!n.nextElementSibling.classList.contains("fn__none")||n.parentNode instanceof Element&&n.parentNode.classList.add("has-focus")})))}))}t.Nn=(0,i.k)(s)},414:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Vn=void 0,t.Yn=s,t.gn=function(){const n=(0,i.qn)()?0:32;document.body.style.setProperty("--status-height",`${n}px`)},t.jn=function(){document.body.style.removeProperty("--status-height"),setTimeout((()=>{var n,t;null===(n=document.getElementById("status"))||void 0===n||n.style.removeProperty("max-width"),null===(t=document.getElementById("status"))||void 0===t||t.style.removeProperty("transform")}),200)},t.Mn=function(){var n,t;if(!(0,i.qn)()){const e=null===(n=u.L.Gn)||void 0===n?void 0:n.querySelectorAll(".layout__center .layout-tab-container"),o=u.L.status;null==e||e.forEach((n=>{let t=n.querySelector(".file-tree");t&&!t.classList.contains("fn__none")&&(0,c.Qn)(n,o)?n.style.paddingBottom="35px":n.style.removeProperty("padding-bottom")}));const i=document.getElementById("searchList"),s=document.getElementById("searchPreview");(i||s)&&((0,c.Qn)(i,o)?i.style.paddingBottom="35px":i.style.removeProperty("padding-bottom"),(0,c.Qn)(s,o)?s.style.paddingBottom="35px":s.style.removeProperty("padding-bottom"));const l=document.getElementById("viewerContainer");l&&((0,c.Qn)(l,o)?l.style.paddingBottom="35px":l.style.removeProperty("padding-bottom")),null===(t=u.L.Gn)||void 0===t||t.querySelectorAll(".card__main").forEach((n=>{n&&((0,c.Qn)(n,o)?n.style.paddingBottom="35px":n.style.removeProperty("padding-bottom"))}))}},t.Rn=function(){var n,t;null===(n=u.L.Gn)||void 0===n||n.querySelectorAll(".layout__center .layout-tab-container").forEach((n=>{n.style.removeProperty("padding-bottom")})),null===(t=u.L.Gn)||void 0===t||t.querySelectorAll(".card__main").forEach((n=>{n.style.removeProperty("padding-bottom")}));const e=document.getElementById("searchList"),o=document.getElementById("searchPreview"),i=document.getElementById("viewerContainer");for(const n of[e,o,i])n&&n.style.removeProperty("padding-bottom")};const i=e(216),u=e(49),c=e(629);function s(){return o(this,void 0,void 0,(function*(){var n,t;if(!u.I.T&&!u.I.Xn)if(u.L.status||(yield(0,c.l)("#status")),yield(0,i.G)())null===(n=u.L.status)||void 0===n||n.style.removeProperty("max-width"),null===(t=u.L.status)||void 0===t||t.style.removeProperty("transform");else{function e(n,t){u.L.status.style.transform=`translate(${n}px, ${t}px)`}let o=(u.L.Gn||(yield(0,c.l)("#layouts"))).querySelector(".layout__center");if(o&&u.L.Zn&&!u.L.status.classList.contains(".fn__none")){let s=u.L.Zn.clientWidth,l=o.clientWidth,r=0;u.L.nt||(yield(0,c.l)(".layout__dockb")),r=u.L.nt&&!u.L.nt.classList.contains(".fn__none")&&(0,i.K)("B")?-1*u.L.nt.clientHeight:0,u.L.status.style.maxWidth=l-12+"px";let a=(0,i.tt)("R"),d=!(0,i.K)("R")&&(0,i.Y)("R");a&&d?e(0,r):!a&&d?e(-40,r):a||d?a&&!d&&e(-1*s,r):e(-1*(s+40),r)}}}))}t.Vn=(0,c.k)(s)},376:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.xn=y,t.Jn=function(){return o(this,void 0,void 0,(function*(){u.I.an&&((0,c.isFullScreen)()?(document.body.classList.add("body-asri--fullscreen"),v-=p?0:88,p=!0):(document.body.classList.remove("body-asri--fullscreen"),null==l||l.style.setProperty("width","0px"),v=yield y("initials","L"),null==l||l.style.removeProperty("width"),p=!1))}))},t.zn=function(){return o(this,arguments,void 0,(function*(n=0,t=!1,e=!1){if(u.I.Xn||u.I.T)return{et:!1,ot:0};let c=u.L.On||(yield(0,i.l)(".layout__center"));return new Promise((i=>o(this,void 0,void 0,(function*(){var o,s,r,a,d,g;t&&(b+=n),v&&b||(yield y("initials")),f=c.getBoundingClientRect(),_=u.L.it.getBoundingClientRect(),m=u.L.ut.getBoundingClientRect();let w=f.left,x=f.right,k=u.L.ct.getBoundingClientRect().left;t||(w>v+8?(null==h||h.style.setProperty("--topbar-left-spacing","0"),u.I.an&&p||(yield y("initials","L")),null==l||l.classList.remove("asri-expanded")):u.I.an&&!u.I.P?(h.style.setProperty("--topbar-left-spacing",w-_.right+4+"px"),null==l||l.classList.add("asri-expanded")):(h.style.setProperty("--topbar-left-spacing",w-m.right+4+"px"),null==l||l.classList.add("asri-expanded")),xo(this,void 0,void 0,(function*(){let t,e=n.querySelector('.fn__flex-column[data-type="wnd"] > .fn__flex:first-child');t=null==e?void 0:e.getBoundingClientRect();let o=t.leftd.right?t.right-d.right+8:0;(0,i.Qn)(e,u.L.st)||(0,i.Qn)(e,u.L.toolbar)?(e.style.paddingLeft=o+"px",e.style.paddingRight=c+"px",t.right-c-240d.right&&t.right>d.right?(e.style.paddingTop="42px",e.style.paddingLeft="0",e.style.paddingRight="0"):e.style.removeProperty("padding-top")):(e.style.removeProperty("padding-left"),e.style.removeProperty("padding-right"),e.style.removeProperty("padding-top"))})))))}))},t.kn=function(){return o(this,void 0,void 0,(function*(){!function(){if(u.I.T)return;s=g("AsriPluginsIconsDivider",void 0,u.L.st),l=u.I.an&&!u.I.P?g("AsriTopbarLeftSpacing",void 0,u.L.it):g("AsriTopbarLeftSpacing",void 0,u.L.ut),r=u.I.an||u.I.P?g("AsriTopbarRightSpacing"):g("AsriTopbarRightSpacing",u.L.ct);const n=document.createElementNS("http://www.w3.org/2000/svg","svg");null==r||r.appendChild(n.cloneNode(!0)),null==s||s.appendChild(n.cloneNode(!0)),null==l||l.appendChild(n.cloneNode(!0))}()}))},t.An=function(){return o(this,void 0,void 0,(function*(){var n,t;yield(0,c.wn)(),function(){s&&(s.remove(),s=void 0);l&&(l.remove(),l=void 0);r&&(r.remove(),r=void 0)}(),null===c.h||void 0===c.h||c.h.forEach((n=>{let t=n.firstElementChild;t.style.removeProperty("padding-top"),t.style.removeProperty("padding-left"),t.style.removeProperty("padding-right")})),u.L.On.dataset.Hn=void 0,document.body.dataset.Hn=void 0,null===(n=u.L.W)||void 0===n||n.style.removeProperty("--avoid-topbar"),null===(t=u.L.Zn)||void 0===t||t.style.removeProperty("--avoid-topbar")}))},t.En=function(){return o(this,void 0,void 0,(function*(){l&&r&&(l.style.setProperty("width","0px"),r.style.setProperty("width","0px"),yield y("initials"),l.style.removeProperty("width"),r.style.removeProperty("width"))}))};const i=e(629),u=e(49),c=e(216);let s,l,r,a,d,f,m,_,v,b,h=u.L.toolbar,p=!1;function y(){return o(this,arguments,void 0,(function*(n="rect",...t){const e=u.L.st||(yield(0,i.l)("#drag"));return!e||u.I.Xn?-1:new Promise((o=>{"initials"===n?(t.length&&!t.includes("L")||(v=e.getBoundingClientRect().left,o(v)),t.length&&!t.includes("R")||(b=e.getBoundingClientRect().right,o(b))):(d=e.getBoundingClientRect(),o(d))}))}))}function g(n,t=void 0,e=void 0){if(document.getElementById(n))return;if(!u.L.toolbar)return;let o=document.createElement("div");return o.id=n,t?u.L.toolbar.insertBefore(o,t):e?u.L.toolbar.insertBefore(o,e.nextSibling):u.L.toolbar.appendChild(o),o}},130:(n,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.yn=function(){i.I.an&&(i.I.P||u(16),i.I.Xn&&u(14))},t.Tn=function(){i.I.an&&(i.I.P||u(8),i.I.Xn&&u(8,13))};const o=e(571),i=e(49);function u(n,t=n){o.remote&&o.remote.getCurrentWindow().setWindowButtonPosition({x:n,y:t})}},613:function(n,t){var e=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};function o(n){return e(this,void 0,void 0,(function*(){let t=yield n;return 0===t.code?t.data:null}))}function i(n,t){return e(this,void 0,void 0,(function*(){let e=null;return yield fetch(n,{body:JSON.stringify(t),method:"POST",headers:{Authorization:"Token "}}).then((function(n){e=n.json()})),e}))}Object.defineProperty(t,"__esModule",{value:!0}),t.getFile=function(n){return e(this,void 0,void 0,(function*(){const t=yield fetch("/api/file/getFile",{method:"POST",headers:{Authorization:"Token ''"},body:JSON.stringify({path:n})});return t.ok?t:null}))},t.$=function(n,t){return e(this,arguments,void 0,(function*(n,t,e=!1,o=Date.now()){let i=new Blob([t]),u=n.split("/").pop(),c=new File([i],u),s=new FormData;s.append("path",n),s.append("file",c),s.append("isDir",String(e)),s.append("modTime",String(o));const l=yield fetch("/api/file/putFile",{body:s,method:"POST",headers:{Authorization:"Token ''"}});return l.ok?yield l.json():null}))},t._=function(n,t){return e(this,void 0,void 0,(function*(){return o(i("/api/attr/setBlockAttrs",{id:n,attrs:t}))}))},t.m=function(n){return e(this,void 0,void 0,(function*(){return o(i("/api/attr/getBlockAttrs",{id:n}))}))}},571:(n,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.remote=void 0;const o=e(49);t.remote=o.I.P||o.I.T?null:e(21)},796:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Cn=void 0;t.Cn=class{constructor(n){this.lt=n}start(n,t,e){n.addEventListener(t,this.lt,e)}remove(n,t,e){n.removeEventListener(t,this.lt,e)}}},629:function(n,t){var e=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};function o(n,t){let e=!1;return n&&t&&(e=n.right>t.left&&n.bottom>t.top&&n.left{e&&clearTimeout(e),e=setTimeout((()=>{n(...o),e=null}),t)}},t.N=function(n){if(!n)return;const t=parseInt(n.substring(1,3),16)/255,e=parseInt(n.substring(3,5),16)/255,o=parseInt(n.substring(5,7),16)/255,i=Math.max(t,e,o),u=Math.min(t,e,o),c=(i+u)/2;if(i===u)return{dt:0,s:0,ft:c};let s=0;const l=i-u,r=c>.5?l/(2-i-u):l/(i+u);switch(i){case t:s=(e-o)/l+(e.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,o=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92;let i=.4124564*t+.3575761*e+.1804375*o,u=.2126729*t+.7151522*e+.072175*o,c=.0193339*t+.119192*e+.9503041*o,s=.8189330101*i+.3618667424*u-.1288597137*c,l=.0329845436*i+.9293118715*u+.0361456387*c,r=.0482003018*i+.2643662691*u+.633851707*c;return s=Math.cbrt(s),l=Math.cbrt(l),r=Math.cbrt(r),.2104542553*s+.793617785*l-.0040720468*r},t._t=function(){document.body.classList.add("asri-mode-transition"),setTimeout((()=>{document.body.classList.remove("asri-mode-transition")}),350)},t.Qn=function(n,t){if(!n||!t)return!1;let e,i;e=n.getBoundingClientRect(),i=t.getBoundingClientRect();return o(e,i)},t.vt=function(n,t){return e(this,void 0,void 0,(function*(){return!(!n||!t)&&new Promise((e=>{let i,u;i=n.getBoundingClientRect(),u=t.getBoundingClientRect();e(o(i,u))}))}))},t.bt=function(n,t){if(!n.length||!t.length)return!1;const e=new Set(n),o=new Set(t);if(e.size!==o.size)return!1;for(const n of e)if(!o.has(n))return!1;return!0},t.l=function(n){return e(this,arguments,void 0,(function*(n,t=document,e=10,o=200){let i=0;for(;isetTimeout(n,o))),i++}}))},t.cn=function(n){return e(this,arguments,void 0,(function*(n,t=document,e=10,o=200){let i=0;for(;i0)return e;yield new Promise((n=>setTimeout(n,o))),i++}}))}},766:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Sn=t.$n=t.Bn=void 0;t.Bn=class{constructor(n){this.lt=(t,e)=>n(t,e),this.ht=new ResizeObserver(this.lt)}observe(n,t){this.ht.observe(n,t)}disconnect(n){this.ht.disconnect(),n&&n()}unobserve(n){this.ht.unobserve(n)}};t.$n=class{constructor(n){this.lt=(t,e)=>n(t,e),this.yt=new MutationObserver(this.lt)}observe(n,t){this.yt.observe(n,t)}disconnect(n){this.yt.disconnect(),n&&n()}},t.Sn={attributes:!0,subtree:!0,attributeFilter:["class"],attributeOldValue:!0}},49:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.I=t.L=void 0;const e=navigator.userAgent;let o=null,i=null,u=null,c=null,s=null,l=null,r=null,a=null,d=null,f=null,m=null,_=null,v=null,b=null,h=null,p=null,y=null,g=null;t.L={get Gn(){return null!=o?o:o=document.getElementById("layouts")},get On(){return null!=i?i:i=document.querySelector(".layout__center")},get toolbar(){return null!=u?u:u=document.getElementById("toolbar")},get J(){return null!=c?c:c=document.getElementById("dockLeft")},get W(){return null!=s?s:s=document.getElementById("dockRight")},get X(){return null!=l?l:l=document.getElementById("dockBottom")},get status(){return null!=r?r:r=document.getElementById("status")},get U(){return null!=a?a:a=document.querySelector(".layout__dockl")},get Zn(){return null!=d?d:d=document.querySelector(".layout__dockr")},get nt(){return null!=f?f:f=document.querySelector(".layout__dockb")},get it(){return null!=m?m:m=document.getElementById("barSync")},get ut(){return null!=_?_:_=document.getElementById("barForward")},get gt(){return null!=v?v:v=document.getElementById("toolbarVIP")},get st(){return null!=b?b:b=document.getElementById("drag")},get wt(){return null!=h?h:h=document.getElementById("barPlugins")},get ct(){return null!=p?p:p=document.getElementById("barSearch")},get A(){return null!=y?y:y=document.getElementById("barMode")},get xt(){return null!=g?g:g=document.getElementById("barMore")}},t.I={an:navigator.platform.indexOf("Mac")>-1,j:navigator.platform.indexOf("Linux")>-1,dn:/Android/.test(e),T:!!document.getElementById("sidebar"),P:!e.startsWith("SiYuan")||e.indexOf("iPad")>-1||/Android/.test(e)&&!/(?:Mobile)/.test(e),Xn:document.body.classList.contains("body--window"),fn:(/iOS/i.test(e)||/iPad/i.test(e))&&/AppleWebKit/i.test(e)&&e.startsWith("SiYuan/"),lang:window.siyuan.config.lang,O:CSS.supports("color","oklch(from red calc(l * 0.5) 0 h)"),mn:window.siyuan.config.readonly,B:window.siyuan.config.appearance.mode>0?"dark":"light"}},216:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.h=t.kt=t.Fn=void 0,t.Un=s,t.K=function(n){const t="B"===n?c.L.nt:"L"===n?c.L.U:c.L.Zn;return!(!t||t.classList.contains("layout--float"))},t.Y=function(n){const t="B"===n?c.L.nt:"L"===n?c.L.U:c.L.Zn;let e;if(!t)return!1;e="B"===n?t.style.height:t.style.width;return!(!e||"0px"===e)},t.tt=function(n="L"){const t="B"===n?c.L.X:"L"===n?c.L.J:c.L.W;return!(!t||!t.classList.contains("fn__none"))},t.G=function(){return o(this,void 0,void 0,(function*(){return c.L.X||(yield(0,u.l)(".layout__dockb")),!(!c.L.X||c.L.X.classList.contains("fn__none"))}))},t.isFullScreen=function(){return!(!i.remote||!i.remote.getCurrentWindow().isFullScreen())},t.qn=function(){return!(!c.L.status||!c.L.status.classList.contains("fn__none"))},t.wn=function(){return o(this,void 0,void 0,(function*(){return yield(0,u.cn)('.layout__center [data-type="wnd"]').then((n=>{t.h=n})),t.h}))};const i=e(571),u=e(629),c=e(49);function s(){var n,e;c.L.toolbar&&(t.Fn=(null===(n=c.L.toolbar)||void 0===n?void 0:n.scrollWidth)>c.L.toolbar.clientWidth,(null===(e=c.L.xt)||void 0===e?void 0:e.classList.contains("fn__none"))||(t.Fn=!0))}t.Fn=!1,t.kt=(0,u.k)(s),t.h=document.querySelectorAll('.layout__center [data-type="wnd"]')},21:n=>{n.exports=require("@electron/remote")}},t={};function e(o){var i=t[o];if(void 0!==i)return i.exports;var u=t[o]={exports:{}};return n[o].call(u.exports,u,u.exports,e),u.exports}(()=>{const n=e(2),t=e(629);(0,n.hn)(),window.destroyTheme=()=>{(0,t._t)(),(0,n.In)()}})()})(); \ No newline at end of file +(()=>{"use strict";var n={12:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.t=void 0,t.o=d,t.i=function(n){return o(this,void 0,void 0,(function*(){var t,e,c;if("mouseup"!==n.type)return;a||(a=yield(0,s.u)());const d=n.target,f=d.closest(".ariaLabel");if(!f)return;const m=f.dataset.type,_=d.closest(".protyle-title__icon")||"doc"===f.dataset.type?"doc":void 0,v=l.includes(m)?m:_;if(!v)return;const b="doc"===v?null!==(t=f.parentElement.dataset.nodeId)&&void 0!==t?t:null===(c=null===(e=f.closest(".protyle"))||void 0===e?void 0:e.querySelector(".protyle-title"))||void 0===c?void 0:c.dataset.nodeId:f.dataset.nodeId;r=yield(0,u.l)("#commonMenu:not(.fn__none)"),function(n,t){o(this,void 0,void 0,(function*(){const e="doc"===n;!function(n){o(this,void 0,void 0,(function*(){var t;if(!r||document.getElementById("afwdMenuItem-clear"))return;const e=r.lastChild,o=document.createElement("button");o.className="b3-menu__item";const i=document.createElement("button");i.className="b3-menu__separator";const u=`\n \n \n `,c=`\n \n \n \n \n \n \n `,s=`\n \n \n \n ${a.afwdDocMenuLabel}\n \n \n \n
\n
\n ${"doc"===n?c:u}\n \n \n
\n
\n `;o.innerHTML=s,e.insertBefore(o,null===(t=e.lastChild)||void 0===t?void 0:t.previousSibling),e.insertBefore(i,o)}))}(n);let u=yield(0,i.m)(t).then((n=>n["custom-afwd"]));if(u||(u=""),u=u.split(" "),u.length>0&&e){if(u.forEach((n=>{const t=document.getElementById(`afwdMenuItem-${n}`);t&&(t.querySelector("input").checked=!0)})),u.includes("all")){const n=null==r?void 0:r.querySelectorAll("button[id^=afwdMenuItem]:not(#afwdMenuItem-all, #afwdMenuItem-clear)");null==n||n.forEach((n=>{n.classList.add("b3-menu__item--disabled"),n.querySelector("input").disabled=!0}))}}else if(u.length>0){const n=document.getElementById(`afwdMenuItem-${u[0]}`);n&&n.classList.add("b3-menu__item--selected")}!function(n,t,e){const o=null==r?void 0:r.querySelectorAll("button[id^=afwdMenuItem]:not(#afwdMenuItem-clear)");let u=[];if(!o)return;const c=[...o].filter((n=>"afwdMenuItem-all"!==n.id));n?null==o||o.forEach((n=>{n.onclick=o=>{if(n.classList.contains("b3-menu__item--disabled"))return;const s=n.querySelector("input"),l=n.id.split("-")[1];let r=s.checked;o.target===s?r=!r:s.checked=!r,r?"all"===l?(c.forEach((n=>{n.classList.remove("b3-menu__item--disabled"),n.querySelector("input").disabled=!1})),e=u.length>0?u:[]):e=e.filter((n=>n!==l)):"all"===l?(e.includes("all")||(u=e),e=["all"],c.forEach((n=>{n.classList.add("b3-menu__item--disabled"),n.querySelector("input").disabled=!0}))):e.push(l),(0,i._)(t,{"custom-afwd":e.join(" ")||""})}})):null==o||o.forEach(((n,o,u)=>{n.onclick=()=>{const c=n.id.split("-")[1];n.classList.contains("b3-menu__item--selected")?(e=[],n.classList.remove("b3-menu__item--selected")):(e=[c],n.classList.add("b3-menu__item--selected"),u[1-o].classList.remove("b3-menu__item--selected")),(0,i._)(t,{"custom-afwd":(null==e?void 0:e.join(" "))||""})}}));const s=document.getElementById("afwdMenuItem-clear");s&&(s.onclick=()=>{e=[],u=[],(0,i._)(t,{"custom-afwd":""}),o.forEach((t=>{if(t.classList.remove("b3-menu__item--disabled"),t.classList.remove("b3-menu__item--selected"),n){const n=t.querySelector("input");n.disabled=!1,n.checked=!1}}))})}(e,t,u)}))}(v,b)}))},t.v=function(){null===c.h||void 0===c.h||c.h.forEach((n=>{(n.querySelector(".file-tree")?[]:n.querySelectorAll(".protyle-wysiwyg")).forEach((n=>{n.style.removeProperty("--protyle-spacing"),n.dataset.p=void 0}))}))};const i=e(613),u=e(629),c=e(216),s=e(787);t.t=(0,u.k)(d,200);const l=["NodeParagraph","NodeTable","NodeAttributeView","NodeSuperBlock","NodeVideo","NodeWidget","NodeIFrame"];let r,a=s.M;function d(){null===c.h||void 0===c.h||c.h.forEach((n=>{let t=n.querySelector(".file-tree")?[]:n.querySelectorAll(".protyle-wysiwyg");setTimeout((()=>{t.forEach((n=>{let t;t=n.style.paddingLeft,t!==n.dataset.p&&(n.style.setProperty("--protyle-spacing",t),n.dataset.p=t)}))}),300)}))}},787:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.followSysAccentColor=t.M=void 0,t.S=function(){return o(this,void 0,void 0,(function*(){var n;t.M=yield b(),function(){return o(this,void 0,void 0,(function*(){yield(0,i.getFile)("/data/snippets/Asri.config.json").then((n=>n&&200===n.status?n.json():null)).then((n=>{var e,o;n?(t.followSysAccentColor=!!n.followSysAccentColor,l.followSysAccentColor=t.followSysAccentColor,l.chroma=null!==(e=n.chroma)&&void 0!==e?e:"1",l.userCustomColor=null!==(o=n.userCustomColor)&&void 0!==o?o:"#3478f6"):t.followSysAccentColor=l.followSysAccentColor}))}))}().then((()=>{s.I.O&&(s.I.P||s.I.T||s.I.j?(document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor),k(l.userCustomColor)):t.followSysAccentColor?document.documentElement.style.removeProperty("--asri-user-custom-accent"):(document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor),k(l.userCustomColor)),document.documentElement.style.setProperty("--asri-c-factor",l.chroma),v="0"===l.chroma,w(l.chroma),g())})),s.I.O&&(null===(n=s.L.A)||void 0===n||n.addEventListener("click",p))}))},t.R=function(){var n;document.documentElement.style.removeProperty("--asri-user-custom-accent"),document.documentElement.style.removeProperty("--asri-sys-accent-grayscale"),document.documentElement.style.removeProperty("--asri-c-factor"),document.documentElement.style.removeProperty("--asri-sys-accent"),document.documentElement.style.removeProperty("--asri-sys-accent-accessible"),document.documentElement.style.removeProperty("--asri-c-0"),document.documentElement.style.removeProperty("--asri-on-primary-reverse"),null===(n=s.L.A)||void 0===n||n.removeEventListener("click",p),document.querySelectorAll(".asri-config").forEach((n=>n.remove()))},t.u=b,t.C=g;const i=e(613),u=e(571),c=e(629),s=e(49),l={followSysAccentColor:!0,chroma:"1",userCustomColor:""};let r,a,d,f,m,_=!1,v=!1;function b(){return o(this,void 0,void 0,(function*(){let n;try{return n=["zh_CN","zh_CHT","en_US"].includes(s.I.lang)?yield fetch(`/appearance/themes/Asri/i18n/${s.I.lang}.json`):yield fetch("/appearance/themes/Asri/i18n/en_US.json"),t.M=yield n.json(),t.M}catch(n){throw n}}))}function h(){return o(this,void 0,void 0,(function*(){yield(0,i.$)("/data/snippets/Asri.config.json",JSON.stringify(l,void 0,4))}))}function p(){return o(this,void 0,void 0,(function*(){Object.keys(t.M).length||(t.M=yield b()),setTimeout(y,0)}))}function y(){var n,e;if(document.querySelector(".asri-config"))return;const o=document.querySelector('#commonMenu[data-name="barmode"] .b3-menu__items');if(!o)return;const i=`\n \n \n \n \n`,u=document.createRange().createContextualFragment(i);o.appendChild(u),a=document.getElementById("followSysAccent"),d=document.getElementById("pickColor"),f=document.getElementById("asriChromaSlider"),m=d.lastElementChild,a&&d&&f&&m&&(a.classList.toggle("b3-menu__item--selected",t.followSysAccentColor),d.classList.toggle("b3-menu__item--selected",!t.followSysAccentColor),f.value=l.chroma||"1",f.parentElement.ariaLabel=t.M.asriChroma+l.chroma,function(){if(!(a&&d&&f&&m))return;const n=(0,c.k)((()=>h()),200);s.I.P||s.I.T||s.I.j?a.classList.add("fn__none"):a.addEventListener("click",e);function e(){t.followSysAccentColor?(t.followSysAccentColor=!1,a.classList.remove("b3-menu__item--selected"),d.classList.add("b3-menu__item--selected"),document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor||r||"#3478f6"),w(l.chroma),k(l.userCustomColor||r||"#3478f6"),l.followSysAccentColor=!1):(t.followSysAccentColor=!0,a.classList.add("b3-menu__item--selected"),d.classList.remove("b3-menu__item--selected"),document.documentElement.style.removeProperty("--asri-user-custom-accent"),l.followSysAccentColor=!0,g()),h()}function o(){t.followSysAccentColor&&(t.followSysAccentColor=!1,a.classList.remove("b3-menu__item--selected"),d.classList.add("b3-menu__item--selected"),document.documentElement.style.setProperty("--asri-user-custom-accent",l.userCustomColor),w(l.chroma),k(l.userCustomColor),l.userCustomColor=l.userCustomColor,l.followSysAccentColor=!1,h())}function i(){const n=m.value;document.documentElement.style.setProperty("--asri-user-custom-accent",n),k(n)}function u(){a.classList.remove("b3-menu__item--selected"),d.classList.add("b3-menu__item--selected"),k(m.value),l.userCustomColor=m.value,t.followSysAccentColor=!1,l.followSysAccentColor=!1,h()}function _(){const e=this.value;document.documentElement.style.setProperty("--asri-c-factor",e),this.parentElement.ariaLabel=t.M.asriChroma+e,l.chroma=e,v="0"===e,w(e),n()}d.addEventListener("click",o),m.addEventListener("input",i),m.addEventListener("change",u),f.addEventListener("input",_)}())}function g(){if(!(s.I.P||s.I.T||s.I.j)){const n="#"+u.remote.systemPreferences.getAccentColor().slice(0,6),e=(0,c.N)(n);if(!e)return;r!==n&&(document.documentElement.style.setProperty("--asri-sys-accent",n),e.s>.28?document.documentElement.style.setProperty("--asri-sys-accent-accessible",n):document.documentElement.style.removeProperty("--asri-sys-accent-accessible"),_=0===e.s,document.body.classList.add("asri-mode-transition"),setTimeout((()=>{document.body.classList.remove("asri-mode-transition")}),350),r=n),t.followSysAccentColor&&(w(e.s),k(n))}}function w(n){return"0"===String(n)||t.followSysAccentColor&&_||v?(document.documentElement.style.setProperty("--asri-c-0","0"),!0):(document.documentElement.style.removeProperty("--asri-c-0"),!1)}t.followSysAccentColor=!0;const x="light"===s.I.B?.81:.79;function k(n){const t=(0,c.F)(n);t&&(t>x?document.documentElement.style.setProperty("--asri-on-primary-reverse","light"===s.I.B?".4":".3"):document.documentElement.style.removeProperty("--asri-on-primary-reverse"))}},344:(n,t)=>{function e(){document.body.classList.toggle("has-exportimg",!!document.querySelector('[data-key="dialog-exportimage"]'))}Object.defineProperty(t,"__esModule",{value:!0}),t.D=function(n,t){e()},t.V=e},818:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.H=function(){return o(this,void 0,void 0,(function*(){const n=u.L.J?u.L.J:yield(0,i.l)("#dockLeft");u.L.U||(yield(0,i.l)(".layout__dockl"));const t=u.L.W;for(let e of[n,t]){let t=(0,c.K)(e===n?"L":"R"),o=(0,c.Y)(e===n?"L":"R");t&&o?null==e||e.classList.add("dock-layout-expanded"):null==e||e.classList.remove("dock-layout-expanded")}}))},t.q=function(){return o(this,void 0,void 0,(function*(){var n,t,e;if(u.I.T)return;const o=yield(0,c.G)(),i=!(0,c.K)("B")&&(0,c.Y)("B");null===(n=u.L.toolbar)||void 0===n||n.nextElementSibling.classList.toggle("has-dockb",o),null===(t=u.L.toolbar)||void 0===t||t.nextElementSibling.classList.toggle("has-layout-dockb-float",i),null===(e=u.L.X)||void 0===e||e.classList.toggle("has-layout-dockb-float",i)}))},t.Z=function(){var n,t;null===(n=u.L.toolbar)||void 0===n||n.nextElementSibling.classList.remove("has-dockb"),null===(t=u.L.toolbar)||void 0===t||t.nextElementSibling.classList.remove("has-layout-dockb-float")},t.nn=function(){var n;null===(n=document.querySelector(".dock-layout-expanded"))||void 0===n||n.classList.remove("dock-layout-expanded")};const i=e(629),u=e(49),c=e(216)},937:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.tn=void 0,t.en=u,t.un=function(){document.querySelectorAll(".protyle .protyle-background.without-icon").forEach((n=>{n.classList.remove("without-icon")}))};const i=e(629);function u(){return o(this,void 0,void 0,(function*(){let n=yield(0,i.cn)(".protyle-top>.protyle-background");null==n||n.forEach((n=>{var t;!(null===(t=n.querySelector(".protyle-background__img img"))||void 0===t?void 0:t.classList.contains("fn__none"))&&n.querySelector(".protyle-background__icon.fn__none")?n.classList.add("without-icon"):n.classList.remove("without-icon")}))}))}t.tn=(0,i.k)(u)},261:(n,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.sn=function(){i.forEach((({ln:n,className:t})=>{n&&document.body.classList.add(t)}))},t.rn=function(){i.forEach((({className:n})=>{document.body.classList.remove(n)}))};const o=e(49),i=[{ln:o.I.an,className:"body-asri--mac"},{ln:o.I.j,className:"body-asri--linux"},{ln:o.I.T,className:"body-asri--mobile"},{ln:o.I.P,className:"body-asri--browser"},{ln:o.I.dn,className:"body-asri--android"},{ln:o.I.fn,className:"body-asri--iosApp"},{ln:o.I.mn,className:"body-asri--readOnly"}]},2:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t._n=t.vn=t.bn=void 0,t.hn=function(){return o(this,void 0,void 0,(function*(){(0,_.sn)(),(0,v.pn)(),(0,y.yn)(),(0,h.gn)(),(0,a.S)(),s.I.T||(yield(0,l.wn)(),yield(0,p.xn)("initials"),(0,p.kn)()),P(),(0,f.q)(),(0,h.Mn)(),g.start(document,"mouseup"),w.start(document,"dragend"),x.start(document,"keyup"),M.observe(document.body,c.Sn),k.observe(document.body,{childList:!0}),s.L.On||(yield(0,u.l)(".layout__center")),s.I.T||(S.observe(s.L.On),O.observe(document.body))}))},t.In=function(){return o(this,void 0,void 0,(function*(){(0,_.rn)(),(0,v.Pn)(),(0,y.Tn)(),(0,h.jn)(),s.I.T||(yield(0,p.An)()),(0,f.nn)(),(0,b.Ln)(),(0,m.un)(),(0,r.v)(),(0,f.Z)(),(0,h.Rn)(),g.remove(document,"mouseup"),w.remove(document,"dragend"),x.remove(document,"keyup"),M.disconnect(),k.disconnect((()=>{document.body.classList.remove("has-exportimg")})),document.body.classList.remove("body-asri--fullscreen"),s.I.T||(S.disconnect(),O.disconnect()),(0,a.R)()}))};const i=e(796),u=e(629),c=e(766),s=e(49),l=e(216),r=e(12),a=e(787),d=e(344),f=e(818),m=e(937),_=e(261),v=e(832),b=e(844),h=e(414),p=e(376),y=e(130),g=new i.Cn(I),w=new i.Cn(I),x=new i.Cn(I),k=new c.$n((0,u.k)(d.D,500)),M=new c.$n((function(n,t){var e;for(let t of n)t.target.classList.contains("b3-list-item--focus")&&((0,b.Nn)(),(0,m.tn)()),t.target===document.body&&((null===(e=t.oldValue)||void 0===e?void 0:e.includes("body--blur"))||t.target.className.includes("body--blur"))&&(0,l.wn)().then((()=>{P(),!s.I.fn&&a.followSysAccentColor&&s.I.O&&(0,a.C)()}))})),S=new c.Bn((function(n,e){(0,p.zn)(0,t.bn,l.Fn).then(p.Dn),(0,r.t)(),(0,h.Vn)()})),O=new c.Bn((function(n,e){for(let e of n){t.bn=!0,T();const{inlineSize:n}=e.contentBoxSize[0];if(e.target instanceof HTMLElement){if(!e.target.dataset.Hn){e.target.dataset.Hn=n+"";continue}const o=n-parseFloat(e.target.dataset.Hn);e.target.dataset.Hn=n+"",t._n=o}}}));function I(n){P(n),(0,r.i)(n)}function P(n){return o(this,void 0,void 0,(function*(){function t(){setTimeout((()=>o(this,void 0,void 0,(function*(){(0,f.H)(),(0,m.tn)(),(0,h.Vn)(),(0,h.gn)(),yield(0,l.wn)(),(0,r.o)(),(0,f.q)(),(0,h.Mn)(),!s.I.fn&&a.followSysAccentColor&&s.I.O&&(0,a.C)()}))),0)}n?(n.type.startsWith("mouse")||n.type.startsWith("drag")||n instanceof KeyboardEvent&&("Control"===n.key||"Alt"===n.key||"Shift"===n.key||"Meta"===n.key))&&(t(),setTimeout((()=>{(0,p.En)(),(0,p.zn)(0,!1,l.Fn).then(p.Dn)}),0)):(t(),(0,p.zn)().then(p.Dn))}))}t.bn=!1,t._n=0;const T=(0,u.k)((()=>{t.bn=!1,(0,p.Jn)(),(0,l.Un)(),l.Fn||(0,p.En)(),(0,p.zn)(t._n,t.bn,l.Fn).then(p.Dn),t._n=0}),200)},832:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.pn=function(){return o(this,void 0,void 0,(function*(){if(u||c)for(let n=0;nn.classList.remove("has-focus")))};const i=e(629),u=e(49),{T:c}=u.I;function s(){return o(this,void 0,void 0,(function*(){if(c)return;u.L.U||(yield(0,i.l)(".layout__dockl"));let n=document.querySelectorAll(".file-tree .b3-list-item--focus");n.length&&(document.querySelectorAll(".file-tree .has-focus").forEach((n=>n.classList.remove("has-focus"))),n.forEach((n=>{n.nextElementSibling&&"UL"===n.nextElementSibling.tagName&&!n.nextElementSibling.classList.contains("fn__none")||n.parentNode instanceof Element&&n.parentNode.classList.add("has-focus")})))}))}t.Nn=(0,i.k)(s)},414:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.Vn=void 0,t.Yn=s,t.gn=function(){const n=(0,i.qn)()?0:32;document.body.style.setProperty("--status-height",`${n}px`)},t.jn=function(){document.body.style.removeProperty("--status-height"),setTimeout((()=>{var n,t;null===(n=document.getElementById("status"))||void 0===n||n.style.removeProperty("max-width"),null===(t=document.getElementById("status"))||void 0===t||t.style.removeProperty("transform")}),200)},t.Mn=function(){var n,t;if(!(0,i.qn)()){const e=null===(n=u.L.Gn)||void 0===n?void 0:n.querySelectorAll(".layout__center .layout-tab-container"),o=u.L.status;null==e||e.forEach((n=>{let t=n.querySelector(".file-tree");t&&!t.classList.contains("fn__none")&&(0,c.Qn)(n,o)?n.style.paddingBottom="35px":n.style.removeProperty("padding-bottom")}));const i=document.getElementById("searchList"),s=document.getElementById("searchPreview");(i||s)&&((0,c.Qn)(i,o)?i.style.paddingBottom="35px":i.style.removeProperty("padding-bottom"),(0,c.Qn)(s,o)?s.style.paddingBottom="35px":s.style.removeProperty("padding-bottom"));const l=document.getElementById("viewerContainer");l&&((0,c.Qn)(l,o)?l.style.paddingBottom="35px":l.style.removeProperty("padding-bottom")),null===(t=u.L.Gn)||void 0===t||t.querySelectorAll(".card__main").forEach((n=>{n&&((0,c.Qn)(n,o)?n.style.paddingBottom="35px":n.style.removeProperty("padding-bottom"))}))}},t.Rn=function(){var n,t;null===(n=u.L.Gn)||void 0===n||n.querySelectorAll(".layout__center .layout-tab-container").forEach((n=>{n.style.removeProperty("padding-bottom")})),null===(t=u.L.Gn)||void 0===t||t.querySelectorAll(".card__main").forEach((n=>{n.style.removeProperty("padding-bottom")}));const e=document.getElementById("searchList"),o=document.getElementById("searchPreview"),i=document.getElementById("viewerContainer");for(const n of[e,o,i])n&&n.style.removeProperty("padding-bottom")};const i=e(216),u=e(49),c=e(629);function s(){return o(this,void 0,void 0,(function*(){var n,t;if(!u.I.T&&!u.I.Xn)if(u.L.status||(yield(0,c.l)("#status")),yield(0,i.G)())null===(n=u.L.status)||void 0===n||n.style.removeProperty("max-width"),null===(t=u.L.status)||void 0===t||t.style.removeProperty("transform");else{function e(n,t){u.L.status.style.transform=`translate(${n}px, ${t}px)`}let o=(u.L.Gn||(yield(0,c.l)("#layouts"))).querySelector(".layout__center");if(o&&u.L.Zn&&!u.L.status.classList.contains(".fn__none")){let s=u.L.Zn.clientWidth,l=o.clientWidth,r=0;u.L.nt||(yield(0,c.l)(".layout__dockb")),r=u.L.nt&&!u.L.nt.classList.contains(".fn__none")&&(0,i.K)("B")?-1*u.L.nt.clientHeight:0,u.L.status.style.maxWidth=l-12+"px";let a=(0,i.tt)("R"),d=!(0,i.K)("R")&&(0,i.Y)("R");a&&d?e(0,r):!a&&d?e(-40,r):a||d?a&&!d&&e(-1*s,r):e(-1*(s+40),r)}}}))}t.Vn=(0,c.k)(s)},376:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.xn=y,t.Jn=function(){return o(this,void 0,void 0,(function*(){u.I.an&&((0,c.isFullScreen)()?(document.body.classList.add("body-asri--fullscreen"),v-=p?0:88,p=!0):(document.body.classList.remove("body-asri--fullscreen"),null==l||l.style.setProperty("width","0px"),v=yield y("initials","L"),null==l||l.style.removeProperty("width"),p=!1))}))},t.zn=function(){return o(this,arguments,void 0,(function*(n=0,t=!1,e=!1){if(u.I.Xn||u.I.T)return{et:!1,ot:0};let c=u.L.On||(yield(0,i.l)(".layout__center"));return new Promise((i=>o(this,void 0,void 0,(function*(){var o,s,r,a,d,g;t&&(b+=n),v&&b||(yield y("initials")),f=c.getBoundingClientRect(),_=u.L.it.getBoundingClientRect(),m=u.L.ut.getBoundingClientRect();let w=f.left,x=f.right,k=u.L.ct.getBoundingClientRect().left;t||(w>v+8?(null==h||h.style.setProperty("--topbar-left-spacing","0"),u.I.an&&p||(yield y("initials","L")),null==l||l.classList.remove("asri-expanded")):u.I.an&&!u.I.P?(h.style.setProperty("--topbar-left-spacing",w-_.right+4+"px"),null==l||l.classList.add("asri-expanded")):(h.style.setProperty("--topbar-left-spacing",w-m.right+4+"px"),null==l||l.classList.add("asri-expanded")),xo(this,void 0,void 0,(function*(){let t,e=n.querySelector('.fn__flex-column[data-type="wnd"] > .fn__flex:first-child');t=null==e?void 0:e.getBoundingClientRect();let o=t.leftd.right?t.right-d.right+8:0;(0,i.Qn)(e,u.L.st)||(0,i.Qn)(e,u.L.toolbar)?(e.style.paddingLeft=o+"px",e.style.paddingRight=c+"px",t.right-c-240d.right&&t.right>d.right?(e.style.paddingTop="42px",e.style.paddingLeft="0",e.style.paddingRight="0"):e.style.removeProperty("padding-top")):(e.style.removeProperty("padding-left"),e.style.removeProperty("padding-right"),e.style.removeProperty("padding-top"))})))))}))},t.kn=function(){return o(this,void 0,void 0,(function*(){!function(){if(u.I.T)return;s=g("AsriPluginsIconsDivider",void 0,u.L.st),l=u.I.an&&!u.I.P?g("AsriTopbarLeftSpacing",void 0,u.L.it):g("AsriTopbarLeftSpacing",void 0,u.L.ut),r=u.I.an||u.I.P?g("AsriTopbarRightSpacing"):g("AsriTopbarRightSpacing",u.L.ct);const n=document.createElementNS("http://www.w3.org/2000/svg","svg");null==r||r.appendChild(n.cloneNode(!0)),null==s||s.appendChild(n.cloneNode(!0)),null==l||l.appendChild(n.cloneNode(!0))}()}))},t.An=function(){return o(this,void 0,void 0,(function*(){var n,t;yield(0,c.wn)(),function(){s&&(s.remove(),s=void 0);l&&(l.remove(),l=void 0);r&&(r.remove(),r=void 0)}(),null===c.h||void 0===c.h||c.h.forEach((n=>{let t=n.firstElementChild;t.style.removeProperty("padding-top"),t.style.removeProperty("padding-left"),t.style.removeProperty("padding-right")})),u.L.On.dataset.Hn=void 0,document.body.dataset.Hn=void 0,null===(n=u.L.W)||void 0===n||n.style.removeProperty("--avoid-topbar"),null===(t=u.L.Zn)||void 0===t||t.style.removeProperty("--avoid-topbar")}))},t.En=function(){return o(this,void 0,void 0,(function*(){l&&r&&(l.style.setProperty("width","0px"),r.style.setProperty("width","0px"),yield y("initials"),l.style.removeProperty("width"),r.style.removeProperty("width"))}))};const i=e(629),u=e(49),c=e(216);let s,l,r,a,d,f,m,_,v,b,h=u.L.toolbar,p=!1;function y(){return o(this,arguments,void 0,(function*(n="rect",...t){const e=u.L.st||(yield(0,i.l)("#drag"));return!e||u.I.Xn?-1:new Promise((o=>{"initials"===n?(t.length&&!t.includes("L")||(v=e.getBoundingClientRect().left,o(v)),t.length&&!t.includes("R")||(b=e.getBoundingClientRect().right,o(b))):(d=e.getBoundingClientRect(),o(d))}))}))}function g(n,t=void 0,e=void 0){if(document.getElementById(n))return;if(!u.L.toolbar)return;let o=document.createElement("div");return o.id=n,t?u.L.toolbar.insertBefore(o,t):e?u.L.toolbar.insertBefore(o,e.nextSibling):u.L.toolbar.appendChild(o),o}},130:(n,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.yn=function(){i.I.an&&(i.I.P||u(16),i.I.Xn&&u(14))},t.Tn=function(){i.I.an&&(i.I.P||u(8),i.I.Xn&&u(8,13))};const o=e(571),i=e(49);function u(n,t=n){o.remote&&o.remote.getCurrentWindow().setWindowButtonPosition({x:n,y:t})}},613:function(n,t){var e=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};function o(n){return e(this,void 0,void 0,(function*(){let t=yield n;return 0===t.code?t.data:null}))}function i(n,t){return e(this,void 0,void 0,(function*(){let e=null;return yield fetch(n,{body:JSON.stringify(t),method:"POST",headers:{Authorization:"Token "}}).then((function(n){e=n.json()})),e}))}Object.defineProperty(t,"__esModule",{value:!0}),t.getFile=function(n){return e(this,void 0,void 0,(function*(){const t=yield fetch("/api/file/getFile",{method:"POST",headers:{Authorization:"Token ''"},body:JSON.stringify({path:n})});return t.ok?t:null}))},t.$=function(n,t){return e(this,arguments,void 0,(function*(n,t,e=!1,o=Date.now()){let i=new Blob([t]),u=n.split("/").pop(),c=new File([i],u),s=new FormData;s.append("path",n),s.append("file",c),s.append("isDir",String(e)),s.append("modTime",String(o));const l=yield fetch("/api/file/putFile",{body:s,method:"POST",headers:{Authorization:"Token ''"}});return l.ok?yield l.json():null}))},t._=function(n,t){return e(this,void 0,void 0,(function*(){return o(i("/api/attr/setBlockAttrs",{id:n,attrs:t}))}))},t.m=function(n){return e(this,void 0,void 0,(function*(){return o(i("/api/attr/getBlockAttrs",{id:n}))}))}},571:(n,t,e)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.remote=void 0;const o=e(49);t.remote=o.I.P||o.I.T?null:e(21)},796:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Cn=void 0;t.Cn=class{constructor(n){this.lt=n}start(n,t,e){n.addEventListener(t,this.lt,e)}remove(n,t,e){n.removeEventListener(t,this.lt,e)}}},629:function(n,t){var e=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};function o(n,t){let e=!1;return n&&t&&(e=n.right>t.left&&n.bottom>t.top&&n.left{e&&clearTimeout(e),e=setTimeout((()=>{n(...o),e=null}),t)}},t.N=function(n){if(!n)return;const t=parseInt(n.substring(1,3),16)/255,e=parseInt(n.substring(3,5),16)/255,o=parseInt(n.substring(5,7),16)/255,i=Math.max(t,e,o),u=Math.min(t,e,o),c=(i+u)/2;if(i===u)return{dt:0,s:0,ft:c};let s=0;const l=i-u,r=c>.5?l/(2-i-u):l/(i+u);switch(i){case t:s=(e-o)/l+(e.04045?Math.pow((t+.055)/1.055,2.4):t/12.92,e=e>.04045?Math.pow((e+.055)/1.055,2.4):e/12.92,o=o>.04045?Math.pow((o+.055)/1.055,2.4):o/12.92;let i=.4124564*t+.3575761*e+.1804375*o,u=.2126729*t+.7151522*e+.072175*o,c=.0193339*t+.119192*e+.9503041*o,s=.8189330101*i+.3618667424*u-.1288597137*c,l=.0329845436*i+.9293118715*u+.0361456387*c,r=.0482003018*i+.2643662691*u+.633851707*c;return s=Math.cbrt(s),l=Math.cbrt(l),r=Math.cbrt(r),.2104542553*s+.793617785*l-.0040720468*r},t._t=function(){document.body.classList.add("asri-mode-transition"),setTimeout((()=>{document.body.classList.remove("asri-mode-transition")}),350)},t.Qn=function(n,t){if(!n||!t)return!1;let e,i;e=n.getBoundingClientRect(),i=t.getBoundingClientRect();return o(e,i)},t.vt=function(n,t){return e(this,void 0,void 0,(function*(){return!(!n||!t)&&new Promise((e=>{let i,u;i=n.getBoundingClientRect(),u=t.getBoundingClientRect();e(o(i,u))}))}))},t.bt=function(n,t){if(!n.length||!t.length)return!1;const e=new Set(n),o=new Set(t);if(e.size!==o.size)return!1;for(const n of e)if(!o.has(n))return!1;return!0},t.l=function(n){return e(this,arguments,void 0,(function*(n,t=document,e=10,o=200){let i=0;for(;isetTimeout(n,o))),i++}}))},t.cn=function(n){return e(this,arguments,void 0,(function*(n,t=document,e=10,o=200){let i=0;for(;i0)return e;yield new Promise((n=>setTimeout(n,o))),i++}}))}},766:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.Sn=t.$n=t.Bn=void 0;t.Bn=class{constructor(n){this.lt=(t,e)=>n(t,e),this.ht=new ResizeObserver(this.lt)}observe(n,t){this.ht.observe(n,t)}disconnect(n){this.ht.disconnect(),n&&n()}unobserve(n){this.ht.unobserve(n)}};t.$n=class{constructor(n){this.lt=(t,e)=>n(t,e),this.yt=new MutationObserver(this.lt)}observe(n,t){this.yt.observe(n,t)}disconnect(n){this.yt.disconnect(),n&&n()}},t.Sn={attributes:!0,subtree:!0,attributeFilter:["class"],attributeOldValue:!0}},49:(n,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.I=t.L=void 0;const e=navigator.userAgent;let o=null,i=null,u=null,c=null,s=null,l=null,r=null,a=null,d=null,f=null,m=null,_=null,v=null,b=null,h=null,p=null,y=null,g=null;t.L={get Gn(){return null!=o?o:o=document.getElementById("layouts")},get On(){return null!=i?i:i=document.querySelector(".layout__center")},get toolbar(){return null!=u?u:u=document.getElementById("toolbar")},get J(){return null!=c?c:c=document.getElementById("dockLeft")},get W(){return null!=s?s:s=document.getElementById("dockRight")},get X(){return null!=l?l:l=document.getElementById("dockBottom")},get status(){return null!=r?r:r=document.getElementById("status")},get U(){return null!=a?a:a=document.querySelector(".layout__dockl")},get Zn(){return null!=d?d:d=document.querySelector(".layout__dockr")},get nt(){return null!=f?f:f=document.querySelector(".layout__dockb")},get it(){return null!=m?m:m=document.getElementById("barSync")},get ut(){return null!=_?_:_=document.getElementById("barForward")},get gt(){return null!=v?v:v=document.getElementById("toolbarVIP")},get st(){return null!=b?b:b=document.getElementById("drag")},get wt(){return null!=h?h:h=document.getElementById("barPlugins")},get ct(){return null!=p?p:p=document.getElementById("barSearch")},get A(){return null!=y?y:y=document.getElementById("barMode")},get xt(){return null!=g?g:g=document.getElementById("barMore")}},t.I={an:navigator.platform.indexOf("Mac")>-1,j:navigator.platform.indexOf("Linux")>-1,dn:/Android/.test(e),T:!!document.getElementById("sidebar"),P:!e.startsWith("SiYuan")||e.indexOf("iPad")>-1||/Android/.test(e)&&!/(?:Mobile)/.test(e),Xn:document.body.classList.contains("body--window"),fn:(/iOS/i.test(e)||/iPad/i.test(e))&&/AppleWebKit/i.test(e)&&e.startsWith("SiYuan/"),lang:window.siyuan.config.lang,O:CSS.supports("color","oklch(from red calc(l * 0.5) 0 h)"),mn:window.siyuan.config.readonly,B:window.siyuan.config.appearance.mode>0?"dark":"light"}},216:function(n,t,e){var o=this&&this.__awaiter||function(n,t,e,o){return new(e||(e=Promise))((function(i,u){function c(n){try{l(o.next(n))}catch(n){u(n)}}function s(n){try{l(o.throw(n))}catch(n){u(n)}}function l(n){var t;n.done?i(n.value):(t=n.value,t instanceof e?t:new e((function(n){n(t)}))).then(c,s)}l((o=o.apply(n,t||[])).next())}))};Object.defineProperty(t,"__esModule",{value:!0}),t.h=t.kt=t.Fn=void 0,t.Un=s,t.K=function(n){const t="B"===n?c.L.nt:"L"===n?c.L.U:c.L.Zn;return!(!t||t.classList.contains("layout--float"))},t.Y=function(n){const t="B"===n?c.L.nt:"L"===n?c.L.U:c.L.Zn;let e;if(!t)return!1;e="B"===n?t.style.height:t.style.width;return!(!e||"0px"===e)},t.tt=function(n="L"){const t="B"===n?c.L.X:"L"===n?c.L.J:c.L.W;return!(!t||!t.classList.contains("fn__none"))},t.G=function(){return o(this,void 0,void 0,(function*(){return c.L.X||(yield(0,u.l)(".layout__dockb")),!(!c.L.X||c.L.X.classList.contains("fn__none"))}))},t.isFullScreen=function(){return!(!i.remote||!i.remote.getCurrentWindow().isFullScreen())},t.qn=function(){return!(!c.L.status||!c.L.status.classList.contains("fn__none"))},t.wn=function(){return o(this,void 0,void 0,(function*(){return yield(0,u.cn)('.layout__center [data-type="wnd"]').then((n=>{t.h=n})),t.h}))};const i=e(571),u=e(629),c=e(49);function s(){var n,e;c.L.toolbar&&(t.Fn=(null===(n=c.L.toolbar)||void 0===n?void 0:n.scrollWidth)>c.L.toolbar.clientWidth,(null===(e=c.L.xt)||void 0===e?void 0:e.classList.contains("fn__none"))||(t.Fn=!0))}t.Fn=!1,t.kt=(0,u.k)(s),t.h=document.querySelectorAll('.layout__center [data-type="wnd"]')},21:n=>{n.exports=require("@electron/remote")}},t={};function e(o){var i=t[o];if(void 0!==i)return i.exports;var u=t[o]={exports:{}};return n[o].call(u.exports,u,u.exports,e),u.exports}(()=>{const n=e(2),t=e(629);(0,n.hn)(),window.destroyTheme=()=>{(0,t._t)(),(0,n.In)()}})()})(); \ No newline at end of file