PageSourceSearch

https://mintminer.com/assets/CustomPageView-LnsuP_mQ.js

js mintminer.com collected 2026-10-06 08:10:17 UTC 8,357 bytes, 1 lines download raw bytes

1import{d as se,r as d,c as _,X as oe,w as ae,o as re,a as ie,D as le,K as ce,B as s,z as m,k as B,G as l,u as f,Q as H,R as V,F as ue,V as de,H as me,C as c,U as fe,A as he,n as j}from"./vendor-vue-Dzwqm9Y9.js";import{a as pe,u as _e,b as ve,_ as T,q as F,D as ge}from"./index-BB-1BiLf.js";import{_ as we}from"./AppLayout.vue_vue_type_script_setup_true_lang-DU-NXSvm.js";import{d as xe,p as ke}from"./vendor-misc-B-nM3tYW.js";import{u as ye}from"./vendor-i18n-BuoWFzps.js";import"./AppHeader.vue_vue_type_style_index_0_scoped_80f3916c_lang-CWJeTQGo.js";import"./useClipboard-00CrFCqB.js";import"./featureFlags-DuhANbyz.js";import"./LocaleSwitcher-DwqRgoPh.js";/* empty css                                                                       */const Ee="user_id",be="token",Ce="theme",De="lang",Se="ui_mode",Pe="embedded",Me="src_host",Re="src_url";function $e(v,a,C,M="light",h){if(!v)return v;try{const r=new URL(v);return a&&r.searchParams.set(Ee,String(a)),C&&r.searchParams.set(be,C),r.searchParams.set(Ce,M),h&&r.searchParams.set(De,h),r.searchParams.set(Se,Pe),typeof window<"u"&&(r.searchParams.set(Me,window.location.origin),r.searchParams.set(Re,window.location.href)),r.toString()}catch{return v}}function K(){return typeof document>"u"?"light":document.documentElement.classList.contains("dark")?"dark":"light"}const Ie={class:"custom-page-layout"},Ue={class:"card flex-1 min-h-0 overflow-hidden"},Be={key:0,class:"flex h-full items-center justify-center py-12"},Te={key:1,class:"flex h-full items-center justify-center p-10 text-center"},Ae={class:"max-w-md"},Ye={class:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-gray-100 dark:bg-dark-700"},Le={class:"text-lg font-semibold text-gray-900 dark:text-white"},ze={class:"mt-2 text-sm text-gray-500 dark:text-dark-400"},He={key:2,class:"flex h-full overflow-hidden"},Ve={class:"toc-sidebar"},je={class:"toc-header"},Fe={class:"toc-title"},Ke={class:"toc-nav"},Ne=["href","onClick"],Oe={class:"ml-1 text-xs"},Qe=["innerHTML"],qe={key:3,class:"flex h-full items-center justify-center p-10 text-center"},We={class:"max-w-md"},Ge={class:"mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-full bg-gray-100 dark:bg-dark-700"},Xe={class:"text-lg font-semibold text-gray-900 dark:text-white"},Je={class:"mt-2 text-sm text-gray-500 dark:text-dark-400"},Ze={key:4,class:"custom-embed-shell"},et=["href"],tt=["src"],nt=se({__name:"CustomPageView",setup(v){const{t:a,locale:C}=ye(),M=oe(),h=pe(),r=_e(),N=ve(),g=d(!1),R=d("light"),w=d(""),D=d(null),u=d([]),x=d(typeof window<"u"?window.innerWidth>768:!0),S=d("");let k=null;const O=_(()=>M.params.id),P=_(()=>{var o;const t=O.value,n=(((o=h.cachedPublicSettings)==null?void 0:o.custom_menu_items)??[]).find(i=>i.id===t)??null;return n||(r.isAdmin?N.customMenuItems.find(i=>i.id===t)??null:null)}),A=_(()=>{var e;const t=P.value;return t?t.page_slug?t.page_slug:(e=t.url)!=null&&e.startsWith("md:")?t.url.slice(3):"":""}),$=_(()=>!!A.value),I=_(()=>{var t;return!P.value||$.value?"":$e(P.value.url,(t=r.user)==null?void 0:t.id,r.token,R.value,C.value)}),Q=_(()=>{if($.value)return!1;const t=I.value;return t.startsWith("http://")||t.startsWith("https://")});function q(t,e){const n=t.toLowerCase().replace(/[^\w一-鿿]+/g,"-").replace(/^-+|-+$/g,"");return n?`${n}-${e}`:`heading-${e}`}function W(t){const e=t.trim();if(!e||/^[a-z][a-z0-9+.-]*:/i.test(e)||e.startsWith("//")||e.startsWith("/"))return!1;const[n]=e.split(/([?#].*)/,2);return n.split("/").filter(o=>o&&o!==".").every(o=>o!==".."&&!o.includes("\\"))}function G(t,e){const n=e.trim(),[o,i=""]=n.split(/([?#].*)/,2),y=o.split("/").filter(p=>p&&p!==".").map(p=>encodeURIComponent(p)).join("/");return F(`/pages/${encodeURIComponent(t)}/images/${y}${i}`)}async function X(t){g.value=!0,u.value=[],S.value="";try{const e=await fetch(F(`/pages/${encodeURIComponent(t)}`),{headers:r.token?{Authorization:`Bearer ${r.token}`}:{}});if(!e.ok){w.value=`<p class="text-red-500">${a("common.pageNotFound")}</p>`;return}let n=await e.text();n=n.replace(/!\[([^\]]*)\]\(([^)]+)\)/g,(Y,E,b)=>W(b)?`![${E}](${G(t,b)})`:Y);const o=xe.parse(n),i=ke.sanitize(o,{ADD_TAGS:["iframe"],ADD_ATTR:["allowfullscreen","frameborder","src"]}),y=[];let p=0;const te=i.replace(/<(h[1-4])[^>]*>(.*?)<\/h[1-4]>/gi,(Y,E,b)=>{const ne=parseInt(E[1]),L=b.replace(/<[^>]+>/g,"").trim(),z=q(L,p++);return y.push({id:z,text:L,level:ne}),`<${E} id="${z}">${b}</${E}>`});w.value=te,u.value=y}catch{w.value='<p class="text-red-500">Failed to load page</p>'}finally{g.value=!1,await j(),await j(),ee()}}function J(t){const e=D.value;if(!e)return;const n=e.querySelector(`#${CSS.escape(t)}`);n&&(n.scrollIntoView({behavior:"smooth",block:"start"}),S.value=t,window.innerWidth<=640&&(x.value=!1))}let U=0;function Z(){U||(U=requestAnimationFrame(()=>{U=0;const t=D.value;if(!t||u.value.length===0)return;const e=t.getBoundingClientRect();let n="";for(const o of u.value){const i=t.querySelector(`#${CSS.escape(o.id)}`);i&&i.getBoundingClientRect().top-e.top<=100&&(n=o.id)}S.value=n}))}function ee(){const t=D.value;
1t&&t.querySelectorAll("pre").forEach(e=>{if(e.querySelector(".copy-btn"))return;const n=document.createElement("button");n.className="copy-btn",n.textContent=a("customPage.copyCode"),n.addEventListener("click",async()=>{var i;const o=((i=e.querySelector("code"))==null?void 0:i.textContent)??e.textContent??"";try{await navigator.clipboard.writeText(o),n.textContent=a("customPage.copiedCode"),setTimeout(()=>{n.textContent=a("customPage.copyCode")},2e3)}catch{n.textContent=a("customPage.copyCodeFailed"),setTimeout(()=>{n.textContent=a("customPage.copyCode")},2e3)}}),e.style.position="relative",e.appendChild(n)})}return ae(A,t=>{t?X(t):(w.value="",u.value=[])},{immediate:!0}),re(async()=>{if(R.value=K(),typeof document<"u"&&(k=new MutationObserver(()=>{R.value=K()}),k.observe(document.documentElement,{attributes:!0,attributeFilter:["class"]})),!h.publicSettingsLoaded){g.value=!0;try{await h.fetchPublicSettings()}finally{g.value=!1}}}),ie(()=>{k&&(k.disconnect(),k=null)}),(t,e)=>(c(),le(we,null,{default:ce(()=>[s("div",Ie,[s("div",Ue,[g.value?(c(),m("div",Be,[...e[2]||(e[2]=[s("div",{class:"h-8 w-8 animate-spin rounded-full border-2 border-primary-500 border-t-transparent"},null,-1)])])):P.value?$.value?(c(),m("div",He,[H(s("aside",Ve,[s("div",je,[s("span",Fe,l(f(a)("customPage.tableOfContents")),1),s("button",{class:"toc-close-btn",onClick:e[0]||(e[0]=n=>x.value=!1)},[...e[3]||(e[3]=[s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[s("path",{d:"M15 18l-6-6 6-6"})],-1)])])]),s("nav",Ke,[(c(!0),m(ue,null,de(u.value,n=>(c(),m("a",{key:n.id,href:"#"+n.id,class:he(["toc-item",[`toc-level-${n.level}`,{"toc-active":S.value===n.id}]]),onClick:fe(o=>J(n.id),["prevent"])},l(n.text),11,Ne))),128))])],512),[[V,x.value]]),H(s("button",{class:"toc-toggle-btn",onClick:e[1]||(e[1]=n=>x.value=!0)},[e[4]||(e[4]=s("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor","stroke-width":"2","stroke-linecap":"round","stroke-linejoin":"round"},[s("path",{d:"M3 12h18M3 6h18M3 18h18"})],-1)),s("span",Oe,l(f(a)("customPage.tableOfContents")),1)],512),[[V,!x.value&&u.value.length>0]]),s("div",{ref_key:"markdownContainer",ref:D,class:"markdown-page-content flex-1 h-full overflow-auto p-6 md:p-10",innerHTML:w.value,onScroll:Z},null,40,Qe)])):Q.value?(c(),m("div",Ze,[s("a",{href:I.value,target:"_blank",rel:"noopener noreferrer",class:"btn btn-secondary btn-sm custom-open-fab"},[B(T,{name:"externalLink",size:"sm",class:"mr-1.5","stroke-width":2}),me(" "+l(f(a)("customPage.openInNewTab")),1)],8,et),s("iframe",{src:I.value,class:"custom-embed-frame",allowfullscreen:""},null,8,tt)])):(c(),m("div",qe,[s("div",We,[s("div",Ge,[B(T,{name:"link",size:"lg",class:"text-gray-400"})]),s("h3",Xe,l(f(a)("customPage.notConfiguredTitle")),1),s("p",Je,l(f(a)("customPage.notConfiguredDesc")),1)])])):(c(),m("div",Te,[s("div",Ae,[s("div",Ye,[B(T,{name:"link",size:"lg",class:"text-gray-400"})]),s("h3",Le,l(f(a)("customPage.notFoundTitle")),1),s("p",ze,l(f(a)("customPage.notFoundDesc")),1)])]))])])]),_:1}))}}),ft=ge(nt,[["__scopeId","data-v-f6143869"]]);export{ft as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.