From 9218624862d5ed9baf53d641be5ac027e2041663 Mon Sep 17 00:00:00 2001 From: Corsair-cxs <1494089474@qq.com> Date: Tue, 23 Jun 2026 22:47:12 +0800 Subject: [PATCH] Bundle frontend styles locally --- backend/internal/web/public/assets/index.js | 2 +- .../dist/cerulean/bootstrap.min.css | 12 +++++ .../dist/cosmo/bootstrap.min.css | 12 +++++ .../dist/cyborg/bootstrap.min.css | 12 +++++ .../dist/darkly/bootstrap.min.css | 12 +++++ .../dist/emerald/bootstrap.min.css | 12 +++++ .../dist/flatly/bootstrap.min.css | 12 +++++ .../dist/grass/bootstrap.min.css | 12 +++++ .../dist/grayscale/bootstrap.min.css | 12 +++++ .../dist/journal/bootstrap.min.css | 12 +++++ .../dist/litera/bootstrap.min.css | 12 +++++ .../dist/lumen/bootstrap.min.css | 12 +++++ .../dist/lux/bootstrap.min.css | 12 +++++ .../dist/materia/bootstrap.min.css | 12 +++++ .../dist/minty/bootstrap.min.css | 12 +++++ .../dist/morph/bootstrap.min.css | 12 +++++ .../dist/ocean/bootstrap.min.css | 12 +++++ .../dist/pulse/bootstrap.min.css | 12 +++++ .../dist/quartz/bootstrap.min.css | 12 +++++ .../dist/sand/bootstrap.min.css | 12 +++++ .../dist/sandstone/bootstrap.min.css | 12 +++++ .../dist/simplex/bootstrap.min.css | 12 +++++ .../dist/sketchy/bootstrap.min.css | 12 +++++ .../dist/slate/bootstrap.min.css | 12 +++++ .../dist/solar/bootstrap.min.css | 12 +++++ .../dist/spacelab/bootstrap.min.css | 12 +++++ .../dist/superhero/bootstrap.min.css | 12 +++++ .../dist/united/bootstrap.min.css | 12 +++++ .../dist/vapor/bootstrap.min.css | 12 +++++ .../dist/wood/bootstrap.min.css | 12 +++++ .../dist/yeti/bootstrap.min.css | 12 +++++ .../dist/zephyr/bootstrap.min.css | 12 +++++ .../font/bootstrap-icons.min.css | 5 ++ .../font/fonts/bootstrap-icons.woff | Bin 0 -> 176032 bytes .../font/fonts/bootstrap-icons.woff2 | Bin 0 -> 130396 bytes backend/internal/web/templates/index.html | 4 +- frontend/package-lock.json | 46 +++++++++++++++++- frontend/package.json | 3 ++ frontend/src/components/Header.tsx | 28 ++++++----- frontend/tsconfig.app.json | 1 + frontend/tsconfig.node.json | 1 + frontend/vite.config.ts | 45 ++++++++++++++++- 42 files changed, 489 insertions(+), 18 deletions(-) create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/cerulean/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/cosmo/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/cyborg/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/darkly/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/emerald/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/flatly/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/grass/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/grayscale/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/journal/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/litera/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/lumen/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/lux/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/materia/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/minty/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/morph/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/ocean/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/pulse/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/quartz/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/sand/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/sandstone/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/simplex/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/sketchy/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/slate/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/solar/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/spacelab/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/superhero/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/united/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/vapor/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/wood/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/yeti/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/aceberg-bootswatch-fork/dist/zephyr/bootstrap.min.css create mode 100644 backend/internal/web/public/vendor/bootstrap-icons/font/bootstrap-icons.min.css create mode 100644 backend/internal/web/public/vendor/bootstrap-icons/font/fonts/bootstrap-icons.woff create mode 100644 backend/internal/web/public/vendor/bootstrap-icons/font/fonts/bootstrap-icons.woff2 diff --git a/backend/internal/web/public/assets/index.js b/backend/internal/web/public/assets/index.js index f5fff0f..a60b2f5 100644 --- a/backend/internal/web/public/assets/index.js +++ b/backend/internal/web/public/assets/index.js @@ -1,2 +1,2 @@ const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/History.js","assets/MacHistory.js","assets/HostPage.js"])))=>i.map(i=>d[i]); -(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const o of s)if(o.type==="childList")for(const i of o.addedNodes)i.tagName==="LINK"&&i.rel==="modulepreload"&&r(i)}).observe(document,{childList:!0,subtree:!0});function n(s){const o={};return s.integrity&&(o.integrity=s.integrity),s.referrerPolicy&&(o.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?o.credentials="include":s.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(s){if(s.ep)return;s.ep=!0;const o=n(s);fetch(s.href,o)}})();const w={context:void 0,registry:void 0,effects:void 0,done:!1,getContextId(){return it(this.context.count)},getNextContextId(){return it(this.context.count++)}};function it(e){const t=String(e),n=t.length-1;return w.context.id+(n?String.fromCharCode(96+n):"")+t}function ie(e){w.context=e}const yt=!1,qt=(e,t)=>e===t,M=Symbol("solid-proxy"),Gt=typeof Proxy=="function",Ve=Symbol("solid-track"),ve={equals:qt};let wt=Ct;const G=1,$e=2,bt={owned:null,cleanups:null,context:null,owner:null},De={};var v=null;let je=null,Xt=null,S=null,D=null,q=null,Oe=0;function ae(e,t){const n=S,r=v,s=e.length===0,o=t===void 0?r:t,i=s?bt:{owned:null,cleanups:null,context:o?o.context:null,owner:o},l=s?e:()=>e(()=>j(()=>ue(i)));v=i,S=null;try{return B(l,!0)}finally{S=n,v=r}}function C(e,t){t=t?Object.assign({},ve,t):ve;const n={value:e,observers:null,observerSlots:null,comparator:t.equals||void 0},r=s=>(typeof s=="function"&&(s=s(n.value)),xt(n,s));return[_t.bind(n),r]}function Yt(e,t,n){const r=Le(e,t,!0,G);re(r)}function T(e,t,n){const r=Le(e,t,!1,G);re(r)}function Jt(e,t,n){wt=rn;const r=Le(e,t,!1,G);r.user=!0,q?q.push(r):re(r)}function R(e,t,n){n=n?Object.assign({},ve,n):ve;const r=Le(e,t,!0,0);return r.observers=null,r.observerSlots=null,r.comparator=n.equals||void 0,re(r),_t.bind(r)}function zt(e){return e&&typeof e=="object"&&"then"in e}function Qt(e,t,n){let r,s,o;r=!0,s=e,o={};let i=null,l=De,a=null,f=!1,u="initialValue"in o,c=typeof r=="function"&&R(r);const h=new Set,[d,b]=(o.storage||C)(o.initialValue),[g,p]=C(void 0),[$,m]=C(void 0,{equals:!1}),[k,_]=C(u?"ready":"unresolved");w.context&&(a=w.getNextContextId(),o.ssrLoadFrom==="initial"?l=o.initialValue:w.load&&w.has(a)&&(l=w.load(a)));function I(y,A,O,X){return i===y&&(i=null,X!==void 0&&(u=!0),(y===l||A===l)&&o.onHydrated&&queueMicrotask(()=>o.onHydrated(X,{value:A})),l=De,H(A,O)),A}function H(y,A){B(()=>{A===void 0&&b(()=>y),_(A!==void 0?"errored":u?"ready":"unresolved"),p(A);for(const O of h.keys())O.decrement();h.clear()},!1)}function V(){const y=en,A=d(),O=g();if(O!==void 0&&!i)throw O;return S&&S.user,A}function Y(y=!0){if(y!==!1&&f)return;f=!1;const A=c?c():r;if(A==null||A===!1){I(i,j(d));return}const O=l!==De?l:j(()=>s(A,{value:d(),refetching:y}));return zt(O)?(i=O,"value"in O?(O.status==="success"?I(i,O.value,void 0,A):I(i,void 0,qe(O.value),A),O):(f=!0,queueMicrotask(()=>f=!1),B(()=>{_(u?"refreshing":"pending"),m()},!1),O.then(X=>I(O,X,void 0,A),X=>I(O,void 0,qe(X),A)))):(I(i,O,void 0,A),O)}return Object.defineProperties(V,{state:{get:()=>k()},error:{get:()=>g()},loading:{get(){const y=k();return y==="pending"||y==="refreshing"}},latest:{get(){if(!u)return V();const y=g();if(y&&!i)throw y;return d()}}}),c?Yt(()=>Y(!1)):Y(!1),[V,{refetch:Y,mutate:b}]}function vt(e){return B(e,!1)}function j(e){if(S===null)return e();const t=S;S=null;try{return e()}finally{S=t}}function Qe(e,t,n){const r=Array.isArray(e);let s,o=n&&n.defer;return i=>{let l;if(r){l=Array(e.length);for(let f=0;ft(l,s,i));return s=l,a}}function $t(e){Jt(()=>j(e))}function Ie(e){return v===null||(v.cleanups===null?v.cleanups=[e]:v.cleanups.push(e)),e}function We(){return S}function Ze(){return v}function St(e,t){const n=v,r=S;v=e,S=null;try{return B(t,!0)}catch(s){tt(s)}finally{v=n,S=r}}function Zt(e){const t=S,n=v;return Promise.resolve().then(()=>{S=t,v=n;let r;return B(e,!1),S=v=null,r?r.done:void 0})}const[Vr,Wr]=C(!1);function At(e,t){const n=Symbol("context");return{id:n,Provider:sn(n),defaultValue:e}}function Pt(e){let t;return v&&v.context&&(t=v.context[e.id])!==void 0?t:e.defaultValue}function et(e){const t=R(e),n=R(()=>Ge(t()));return n.toArray=()=>{const r=n();return Array.isArray(r)?r:r!=null?[r]:[]},n}let en;function _t(){if(this.sources&&this.state)if(this.state===G)re(this);else{const e=D;D=null,B(()=>Ae(this),!1),D=e}if(S){const e=this.observers?this.observers.length:0;S.sources?(S.sources.push(this),S.sourceSlots.push(e)):(S.sources=[this],S.sourceSlots=[e]),this.observers?(this.observers.push(S),this.observerSlots.push(S.sources.length-1)):(this.observers=[S],this.observerSlots=[S.sources.length-1])}return this.value}function xt(e,t,n){let r=e.value;return(!e.comparator||!e.comparator(r,t))&&(e.value=t,e.observers&&e.observers.length&&B(()=>{for(let s=0;s1e6)throw D=[],new Error},!1)),t}function re(e){if(!e.fn)return;ue(e);const t=Oe;tn(e,e.value,t)}function tn(e,t,n){let r;const s=v,o=S;S=v=e;try{r=e.fn(t)}catch(i){return e.pure&&(e.state=G,e.owned&&e.owned.forEach(ue),e.owned=null),e.updatedAt=n+1,tt(i)}finally{S=o,v=s}(!e.updatedAt||e.updatedAt<=n)&&(e.updatedAt!=null&&"observers"in e?xt(e,r):e.value=r,e.updatedAt=n)}function Le(e,t,n,r=G,s){const o={fn:e,state:r,updatedAt:null,owned:null,sources:null,sourceSlots:null,cleanups:null,value:t,owner:v,context:v?v.context:null,pure:n};return v===null||v!==bt&&(v.owned?v.owned.push(o):v.owned=[o]),o}function Se(e){if(e.state===0)return;if(e.state===$e)return Ae(e);if(e.suspense&&j(e.suspense.inFallback))return e.suspense.effects.push(e);const t=[e];for(;(e=e.owner)&&(!e.updatedAt||e.updatedAt=0;n--)if(e=t[n],e.state===G)re(e);else if(e.state===$e){const r=D;D=null,B(()=>Ae(e,t[0]),!1),D=r}}function B(e,t){if(D)return e();let n=!1;t||(D=[]),q?n=!0:q=[],Oe++;try{const r=e();return nn(n),r}catch(r){n||(q=null),D=null,tt(r)}}function nn(e){if(D&&(Ct(D),D=null),e)return;const t=q;q=null,t.length&&B(()=>wt(t),!1)}function Ct(e){for(let t=0;t=0;t--)ue(e.tOwned[t]);delete e.tOwned}if(e.owned){for(t=e.owned.length-1;t>=0;t--)ue(e.owned[t]);e.owned=null}if(e.cleanups){for(t=e.cleanups.length-1;t>=0;t--)e.cleanups[t]();e.cleanups=null}e.state=0}function qe(e){return e instanceof Error?e:new Error(typeof e=="string"?e:"Unknown error",{cause:e})}function tt(e,t=v){throw qe(e)}function Ge(e){if(typeof e=="function"&&!e.length)return Ge(e());if(Array.isArray(e)){const t=[];for(let n=0;ns=j(()=>(v.context={...v.context,[e]:r.value},et(()=>r.children))),void 0),s}}const on=Symbol("fallback");function lt(e){for(let t=0;t1?[]:null;return Ie(()=>lt(o)),()=>{let a=e()||[],f=a.length,u,c;return a[Ve],j(()=>{let d,b,g,p,$,m,k,_,I;if(f===0)i!==0&&(lt(o),o=[],r=[],s=[],i=0,l&&(l=[])),n.fallback&&(r=[on],s[0]=ae(H=>(o[0]=H,n.fallback())),i=1);else if(i===0){for(s=new Array(f),c=0;c=m&&_>=m&&r[k]===a[_];k--,_--)g[_]=s[k],p[_]=o[k],l&&($[_]=l[k]);for(d=new Map,b=new Array(_+1),c=_;c>=m;c--)I=a[c],u=d.get(I),b[c]=u===void 0?-1:u,d.set(I,c);for(u=m;u<=k;u++)I=r[u],c=d.get(I),c!==void 0&&c!==-1?(g[c]=s[u],p[c]=o[u],l&&($[c]=l[u]),c=b[c],d.set(I,c)):o[u]();for(c=m;ce(t||{}))}function ye(){return!0}const an={get(e,t,n){return t===M?n:e.get(t)},has(e,t){return t===M?!0:e.has(t)},set:ye,deleteProperty:ye,getOwnPropertyDescriptor(e,t){return{configurable:!0,enumerable:!0,get(){return e.get(t)},set:ye,deleteProperty:ye}},ownKeys(e){return e.keys()}};function Fe(e){return(e=typeof e=="function"?e():e)?e:{}}function cn(){for(let e=0,t=this.length;e=0;l--){const a=Fe(e[l])[i];if(a!==void 0)return a}},has(i){for(let l=e.length-1;l>=0;l--)if(i in Fe(e[l]))return!0;return!1},keys(){const i=[];for(let l=0;l=0;i--){const l=e[i];if(!l)continue;const a=Object.getOwnPropertyNames(l);for(let f=a.length-1;f>=0;f--){const u=a[f];if(u==="__proto__"||u==="constructor")continue;const c=Object.getOwnPropertyDescriptor(l,u);if(!r[u])r[u]=c.get?{enumerable:!0,configurable:!0,get:cn.bind(n[u]=[c.get.bind(l)])}:c.value!==void 0?c:void 0;else{const h=n[u];h&&(c.get?h.push(c.get.bind(l)):c.value!==void 0&&h.push(()=>c.value))}}}const s={},o=Object.keys(r);for(let i=o.length-1;i>=0;i--){const l=o[i],a=r[l];a&&a.get?Object.defineProperty(s,l,a):s[l]=a?a.value:void 0}return s}function He(e){let t,n;const r=s=>{const o=w.context;if(o){const[l,a]=C();w.count||(w.count=0),w.count++,(n||(n=e())).then(f=>{!w.done&&ie(o),w.count--,a(()=>f.default),ie()}),t=l}else if(!t){const[l]=Qt(()=>(n||(n=e())).then(a=>a.default));t=l}let i;return R(()=>(i=t())?j(()=>{if(!o||w.done)return i(s);const l=w.context;ie(o);const a=i(s);return ie(l),a}):"")};return r.preload=()=>n||((n=e()).then(s=>t=()=>s.default),n),r}const fn=e=>`Stale read from <${e}>.`;function nt(e){const t="fallback"in e&&{fallback:()=>e.fallback};return R(ln(()=>e.each,e.children,t||void 0))}function fe(e){const t=e.keyed,n=R(()=>e.when,void 0,void 0),r=t?n:R(n,void 0,{equals:(s,o)=>!s==!o});return R(()=>{const s=r();if(s){const o=e.children;return typeof o=="function"&&o.length>0?j(()=>o(t?s:()=>{if(!j(r))throw fn("Show");return n()})):o}return e.fallback},void 0,void 0)}function dn(e,t,n){let r=n.length,s=t.length,o=r,i=0,l=0,a=t[s-1].nextSibling,f=null;for(;iu-l){const b=t[i];for(;l{s=o,t===document?e():L(t,e(),t.firstChild?null:void 0,n)},r.owner),()=>{s(),t.textContent=""}}function N(e,t,n,r){let s;const o=()=>{const l=document.createElement("template");return l.innerHTML=e,l.content.firstChild},i=()=>(s||(s=o())).cloneNode(!0);return i.cloneNode=i,i}function se(e,t=window.document){const n=t[at]||(t[at]=new Set);for(let r=0,s=e.length;rPe(e,t(),s,n),r)}function rt(e){return!!w.context&&!w.done&&(!e||e.isConnected)}function pn(e){if(w.registry&&w.events&&w.events.find(([a,f])=>f===e))return;let t=e.target;const n=`$$${e.type}`,r=e.target,s=e.currentTarget,o=a=>Object.defineProperty(e,"target",{configurable:!0,value:a}),i=()=>{const a=t[n];if(a&&!t.disabled){const f=t[`${n}Data`];if(f!==void 0?a.call(t,f,e):a.call(t,e),e.cancelBubble)return}return t.host&&typeof t.host!="string"&&!t.host._$host&&t.contains(e.target)&&o(t.host),!0},l=()=>{for(;i()&&(t=t._$host||t.parentNode||t.host););};if(Object.defineProperty(e,"currentTarget",{configurable:!0,get(){return t||document}}),w.registry&&!w.done&&(w.done=_$HY.done=!0),e.composedPath){const a=e.composedPath();o(a[0]);for(let f=0;f{let a=t();for(;typeof a=="function";)a=a();n=Pe(e,a,n,r)}),()=>n;if(Array.isArray(t)){const a=[],f=n&&Array.isArray(n);if(Xe(a,t,n,s))return T(()=>n=Pe(e,a,n,r,!0)),()=>n;if(o){if(!a.length)return n;if(r===void 0)return n=[...e.childNodes];let u=a[0];if(u.parentNode!==e)return n;const c=[u];for(;(u=u.nextSibling)!==r;)c.push(u);return n=c}if(a.length===0){if(n=te(e,n,r),l)return n}else f?n.length===0?ct(e,a,r):dn(e,n,a):(n&&te(e),ct(e,a));n=a}else if(t.nodeType){if(o&&t.parentNode)return n=l?[t]:t;if(Array.isArray(n)){if(l)return n=te(e,n,r,t);te(e,n,null,t)}else n==null||n===""||!e.firstChild?e.appendChild(t):e.replaceChild(t,e.firstChild);n=t}}return n}function Xe(e,t,n,r){let s=!1;for(let o=0,i=t.length;o=0;i--){const l=t[i];if(s!==l){const a=l.parentNode===e;!o&&!i?a?e.replaceChild(s,l):e.insertBefore(s,n):a&&l.remove()}else o=!0}}else e.insertBefore(s,n);return[s]}const mn=!1,yn="modulepreload",wn=function(e){return"/"+e},ut={},Ue=function(t,n,r){let s=Promise.resolve();if(n&&n.length>0){document.getElementsByTagName("link");const i=document.querySelector("meta[property=csp-nonce]"),l=(i==null?void 0:i.nonce)||(i==null?void 0:i.getAttribute("nonce"));s=Promise.allSettled(n.map(a=>{if(a=wn(a),a in ut)return;ut[a]=!0;const f=a.endsWith(".css"),u=f?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${a}"]${u}`))return;const c=document.createElement("link");if(c.rel=f?"stylesheet":yn,f||(c.as="script"),c.crossOrigin="",c.href=a,l&&c.setAttribute("nonce",l),document.head.appendChild(c),f)return new Promise((h,d)=>{c.addEventListener("load",h),c.addEventListener("error",()=>d(new Error(`Unable to preload CSS for ${a}`)))})}))}function o(i){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=i,window.dispatchEvent(l),!l.defaultPrevented)throw i}return s.then(i=>{for(const l of i||[])l.status==="rejected"&&o(l.reason);return t().catch(o)})};function Ot(){let e=new Set;function t(s){return e.add(s),()=>e.delete(s)}let n=!1;function r(s,o){if(n)return!(n=!1);const i={to:s,options:o,defaultPrevented:!1,preventDefault:()=>i.defaultPrevented=!0};for(const l of e)l.listener({...i,from:l.location,retry:a=>{a&&(n=!0),l.navigate(s,{...o,resolve:!1})}});return!i.defaultPrevented}return{subscribe:t,confirm:r}}let Ye;function st(){(!window.history.state||window.history.state._depth==null)&&window.history.replaceState({...window.history.state,_depth:window.history.length-1},""),Ye=window.history.state._depth}st();function bn(e){return{...e,_depth:window.history.state&&window.history.state._depth}}function vn(e,t){let n=!1;return()=>{const r=Ye;st();const s=r==null?null:Ye-r;if(n){n=!1;return}s&&t(s)?(n=!0,window.history.go(-s)):e()}}const $n=/^(?:[a-z0-9]+:)?\/\//i,Sn=/^\/+|(\/)\/+$/g,It="http://sr";function ce(e,t=!1){const n=e.replace(Sn,"$1");return n?t||/^[?#]/.test(n)?n:"/"+n:""}function be(e,t,n){if($n.test(t))return;const r=ce(e),s=n&&ce(n);let o="";return!s||t.startsWith("/")?o=r:s.toLowerCase().indexOf(r.toLowerCase())!==0?o=r+s:o=s,(o||"/")+ce(t,!o)}function An(e,t){if(e==null)throw new Error(t);return e}function Pn(e,t){return ce(e).replace(/\/*(\*.*)?$/g,"")+ce(t)}function Lt(e){const t={};return e.searchParams.forEach((n,r)=>{r in t?Array.isArray(t[r])?t[r].push(n):t[r]=[t[r],n]:t[r]=n}),t}function _n(e,t,n){const[r,s]=e.split("/*",2),o=r.split("/").filter(Boolean),i=o.length;return l=>{const a=l.split("/").filter(Boolean),f=a.length-i;if(f<0||f>0&&s===void 0&&!t)return null;const u={path:i?"":"/",params:{}},c=h=>n===void 0?void 0:n[h];for(let h=0;hr===e;return t===void 0?!0:typeof t=="string"?n(t):typeof t=="function"?t(e):Array.isArray(t)?t.some(n):t instanceof RegExp?t.test(e):!1}function xn(e){const[t,n]=e.pattern.split("/*",2),r=t.split("/").filter(Boolean);return r.reduce((s,o)=>s+(o.startsWith(":")?2:3),r.length-(n===void 0?0:1))}function Rt(e){const t=new Map,n=Ze();return new Proxy({},{get(r,s){return t.has(s)||St(n,()=>t.set(s,R(()=>e()[s]))),t.get(s)()},getOwnPropertyDescriptor(){return{enumerable:!0,configurable:!0}},ownKeys(){return Reflect.ownKeys(e())}})}function Nt(e){let t=/(\/?\:[^\/]+)\?/.exec(e);if(!t)return[e];let n=e.slice(0,t.index),r=e.slice(t.index+t[0].length);const s=[n,n+=t[1]];for(;t=/^(\/\:[^\/]+)\?/.exec(r);)s.push(n+=t[1]),r=r.slice(t[0].length);return Nt(r).reduce((o,i)=>[...o,...s.map(l=>l+i)],[])}const Cn=100,Tt=At(),Dt=At(),En=()=>An(Pt(Tt)," and 'use' router primitives can be only used inside a Route."),qr=()=>En().params;function kn(e,t=""){const{component:n,preload:r,load:s,children:o,info:i}=e,l=!o||Array.isArray(o)&&!o.length,a={key:e,component:n,preload:r||s,info:i};return jt(e.path).reduce((f,u)=>{for(const c of Nt(u)){const h=Pn(t,c);let d=l?h:h.split("/*",1)[0];d=d.split("/").map(b=>b.startsWith(":")||b.startsWith("*")?b:encodeURIComponent(b)).join("/"),f.push({...a,originalPath:u,pattern:d,matcher:_n(d,!l,e.matchFilters)})}return f},[])}function On(e,t=0){return{routes:e,score:xn(e[e.length-1])*1e4-t,matcher(n){const r=[];for(let s=e.length-1;s>=0;s--){const o=e[s],i=o.matcher(n);if(!i)return null;r.unshift({...i,route:o})}return r}}}function jt(e){return Array.isArray(e)?e:[e]}function Ft(e,t="",n=[],r=[]){const s=jt(e);for(let o=0,i=s.length;oi.score-o.score)}function Me(e,t){for(let n=0,r=e.length;n{const c=e();try{return new URL(c,r)}catch{return console.error(`Invalid path ${c}`),u}},r,{equals:(u,c)=>u.href===c.href}),o=R(()=>s().pathname),i=R(()=>s().search,!0),l=R(()=>s().hash),a=()=>"",f=Qe(i,()=>Lt(s()));return{get pathname(){return o()},get search(){return i()},get hash(){return l()},get state(){return t()},get key(){return a()},query:n?n(f):Rt(f)}}let z;function Ln(){return z}function Rn(e,t,n,r={}){const{signal:[s,o],utils:i={}}=e,l=i.parsePath||(P=>P),a=i.renderPath||(P=>P),f=i.beforeLeave||Ot(),u=be("",r.base||"");if(u===void 0)throw new Error(`${u} is not a valid base path`);u&&!s().value&&o({value:u,replace:!0,scroll:!1});const[c,h]=C(!1);let d;const b=(P,E)=>{E.value===g()&&E.state===$()||(d===void 0&&h(!0),z=P,d=E,Zt(()=>{d===E&&(p(d.value),m(d.state),I[1](F=>F.filter(Z=>Z.pending)))}).finally(()=>{d===E&&vt(()=>{z=void 0,P==="navigate"&&X(d),h(!1),d=void 0})}))},[g,p]=C(s().value),[$,m]=C(s().state),k=In(g,$,i.queryWrapper),_=[],I=C([]),H=R(()=>typeof r.transformUrl=="function"?Me(t(),r.transformUrl(k.pathname)):Me(t(),k.pathname)),V=()=>{const P=H(),E={};for(let F=0;Fu,outlet:()=>null,resolvePath(P){return be(u,P)}};return T(Qe(s,P=>b("native",P),{defer:!0})),{base:y,location:k,params:Y,isRouting:c,renderPath:a,parsePath:l,navigatorFactory:O,matches:H,beforeLeave:f,preloadRoute:Wt,singleFlight:r.singleFlight===void 0?!0:r.singleFlight,submissions:I};function A(P,E,F){j(()=>{if(typeof E=="number"){E&&(i.go?i.go(E):console.warn("Router integration does not support relative routing"));return}const Z=!E||E[0]==="?",{replace:Ne,resolve:ee,scroll:Te,state:oe}={replace:!1,resolve:!Z,scroll:!0,...F},me=ee?P.resolvePath(E):be(Z&&k.pathname||"",E);if(me===void 0)throw new Error(`Path '${E}' is not a routable path`);if(_.length>=Cn)throw new Error("Too many redirects");const ot=g();(me!==ot||oe!==$())&&(mn||f.confirm(me,F)&&(_.push({value:ot,replace:Ne,scroll:Te,state:$()}),b("navigate",{value:me,state:oe})))})}function O(P){return P=P||Pt(Dt)||y,(E,F)=>A(P,E,F)}function X(P){const E=_[0];E&&(o({...P,replace:E.replace,scroll:E.scroll}),_.length=0)}function Wt(P,E){const F=Me(t(),P.pathname),Z=z;z="preload";for(let Ne in F){const{route:ee,params:Te}=F[Ne];ee.component&&ee.component.preload&&ee.component.preload();const{preload:oe}=ee;E&&oe&&St(n(),()=>oe({params:Te,location:{pathname:P.pathname,search:P.search,hash:P.hash,query:Lt(P),state:null,key:""},intent:"preload"}))}z=Z}}function Nn(e,t,n,r){const{base:s,location:o,params:i}=e,{pattern:l,component:a,preload:f}=r().route,u=R(()=>r().path);a&&a.preload&&a.preload();const c=f?f({params:i,location:o,intent:z||"initial"}):void 0;return{parent:t,pattern:l,path:u,outlet:()=>a?x(a,{params:i,location:o,data:c,get children(){return n()}}):n(),resolvePath(d){return be(s.path(),d,u())}}}const Tn=e=>t=>{const{base:n}=t,r=et(()=>t.children),s=R(()=>Ft(r(),t.base||""));let o;const i=Rn(e,s,()=>o,{base:n,singleFlight:t.singleFlight,transformUrl:t.transformUrl});return e.create&&e.create(i),x(Tt.Provider,{value:i,get children(){return x(Dn,{routerState:i,get root(){return t.root},get preload(){return t.rootPreload||t.rootLoad},get children(){return[R(()=>(o=Ze())&&null),x(jn,{routerState:i,get branches(){return s()}})]}})}})};function Dn(e){const t=e.routerState.location,n=e.routerState.params,r=R(()=>e.preload&&j(()=>{e.preload({params:n,location:t,intent:Ln()||"initial"})}));return x(fe,{get when(){return e.root},keyed:!0,get fallback(){return e.children},children:s=>x(s,{params:n,location:t,get data(){return r()},get children(){return e.children}})})}function jn(e){const t=[];let n;const r=R(Qe(e.routerState.matches,(s,o,i)=>{let l=o&&s.length===o.length;const a=[];for(let f=0,u=s.length;f{t[f]=d,a[f]=Nn(e.routerState,a[f-1]||e.routerState.base,ft(()=>r()[f+1]),()=>e.routerState.matches()[f])}))}return t.splice(s.length).forEach(f=>f()),i&&l?i:(n=a[0],a)}));return ft(()=>r()&&n)()}const ft=e=>()=>x(fe,{get when(){return e()},keyed:!0,children:t=>x(Dt.Provider,{value:t,get children(){return t.outlet()}})}),we=e=>{const t=et(()=>e.children);return un(e,{get children(){return t()}})};function Fn([e,t],n,r){return[e,r?s=>t(r(s)):t]}function Hn(e){let t=!1;const n=s=>typeof s=="string"?{value:s}:s,r=Fn(C(n(e.get()),{equals:(s,o)=>s.value===o.value&&s.state===o.state}),void 0,s=>(!t&&e.set(s),w.registry&&!w.done&&(w.done=!0),s));return e.init&&Ie(e.init((s=e.get())=>{t=!0,r[1](n(s)),t=!1})),Tn({signal:r,create:e.create,utils:e.utils})}function Un(e,t,n){return e.addEventListener(t,n),()=>e.removeEventListener(t,n)}function Kn(e,t){const n=e&&document.getElementById(e);n?n.scrollIntoView():t&&window.scrollTo(0,0)}const Mn=new Map;function Bn(e=!0,t=!1,n="/_server",r){return s=>{const o=s.base.path(),i=s.navigatorFactory(s.base);let l,a;function f(g){return g.namespaceURI==="http://www.w3.org/2000/svg"}function u(g){if(g.defaultPrevented||g.button!==0||g.metaKey||g.altKey||g.ctrlKey||g.shiftKey)return;const p=g.composedPath().find(H=>H instanceof Node&&H.nodeName.toUpperCase()==="A");if(!p||t&&!p.hasAttribute("link"))return;const $=f(p),m=$?p.href.baseVal:p.href;if(($?p.target.baseVal:p.target)||!m&&!p.hasAttribute("state"))return;const _=(p.getAttribute("rel")||"").split(/\s+/);if(p.hasAttribute("download")||_&&_.includes("external"))return;const I=$?new URL(m,document.baseURI):new URL(m);if(!(I.origin!==window.location.origin||o&&I.pathname&&!I.pathname.toLowerCase().startsWith(o.toLowerCase())))return[p,I]}function c(g){const p=u(g);if(!p)return;const[$,m]=p,k=s.parsePath(m.pathname+m.search+m.hash),_=$.getAttribute("state");g.preventDefault(),i(k,{resolve:!1,replace:$.hasAttribute("replace"),scroll:!$.hasAttribute("noscroll"),state:_?JSON.parse(_):void 0})}function h(g){const p=u(g);if(!p)return;const[$,m]=p;r&&(m.pathname=r(m.pathname)),s.preloadRoute(m,$.getAttribute("preload")!=="false")}function d(g){clearTimeout(l);const p=u(g);if(!p)return a=null;const[$,m]=p;a!==$&&(r&&(m.pathname=r(m.pathname)),l=setTimeout(()=>{s.preloadRoute(m,$.getAttribute("preload")!=="false"),a=$},20))}function b(g){if(g.defaultPrevented)return;let p=g.submitter&&g.submitter.hasAttribute("formaction")?g.submitter.getAttribute("formaction"):g.target.getAttribute("action");if(!p)return;if(!p.startsWith("https://action/")){const m=new URL(p,It);if(p=s.parsePath(m.pathname+m.search),!p.startsWith(n))return}if(g.target.method.toUpperCase()!=="POST")throw new Error("Only POST forms are supported for Actions");const $=Mn.get(p);if($){g.preventDefault();const m=new FormData(g.target,g.submitter);$.call({r:s,f:g.target},g.target.enctype==="multipart/form-data"?m:new URLSearchParams(m))}}se(["click","submit"]),document.addEventListener("click",c),e&&(document.addEventListener("mousemove",d,{passive:!0}),document.addEventListener("focusin",h,{passive:!0}),document.addEventListener("touchstart",h,{passive:!0})),document.addEventListener("submit",b),Ie(()=>{document.removeEventListener("click",c),e&&(document.removeEventListener("mousemove",d),document.removeEventListener("focusin",h),document.removeEventListener("touchstart",h)),document.removeEventListener("submit",b)})}}function Vn(e){const t=()=>{const r=window.location.pathname.replace(/^\/+/,"/")+window.location.search,s=window.history.state&&window.history.state._depth&&Object.keys(window.history.state).length===1?void 0:window.history.state;return{value:r+window.location.hash,state:s}},n=Ot();return Hn({get:t,set({value:r,replace:s,scroll:o,state:i}){s?window.history.replaceState(bn(i),"",r):window.history.pushState(i,"",r),Kn(decodeURIComponent(window.location.hash.slice(1)),o),st()},init:r=>Un(window,"popstate",vn(r,s=>{if(s&&s<0)return!n.confirm(s);{const o=t();return!n.confirm(o.value,{state:o.state})}})),create:Bn(e.preload,e.explicitLinks,e.actionBase,e.transformUrl),utils:{go:r=>window.history.go(r),beforeLeave:n}})(e)}const Je=Symbol("store-raw"),ne=Symbol("store-node"),W=Symbol("store-has"),Ht=Symbol("store-self");function Ut(e){let t=e[M];if(!t&&(Object.defineProperty(e,M,{value:t=new Proxy(e,Gn)}),!Array.isArray(e))){const n=Object.keys(e),r=Object.getOwnPropertyDescriptors(e);for(let s=0,o=n.length;se[M][t]),n}function Kt(e){We()&&he(xe(e,ne),Ht)()}function qn(e){return Kt(e),Reflect.ownKeys(e)}const Gn={get(e,t,n){if(t===Je)return e;if(t===M)return n;if(t===Ve)return Kt(e),n;const r=xe(e,ne),s=r[t];let o=s?s():e[t];if(t===ne||t===W||t==="__proto__")return o;if(!s){const i=Object.getOwnPropertyDescriptor(e,t);We()&&(typeof o!="function"||e.hasOwnProperty(t))&&!(i&&i.get)&&(o=he(r,t,o)())}return _e(o)?Ut(o):o},has(e,t){return t===Je||t===M||t===Ve||t===ne||t===W||t==="__proto__"?!0:(We()&&he(xe(e,W),t)(),t in e)},set(){return!0},deleteProperty(){return!0},ownKeys:qn,getOwnPropertyDescriptor:Wn};function Ce(e,t,n,r=!1){if(!r&&e[t]===n)return;const s=e[t],o=e.length;n===void 0?(delete e[t],e[W]&&e[W][t]&&s!==void 0&&e[W][t].$()):(e[t]=n,e[W]&&e[W][t]&&s===void 0&&e[W][t].$());let i=xe(e,ne),l;if((l=he(i,t,s))&&l.$(()=>n),Array.isArray(e)&&e.length!==o){for(let a=e.length;a1){r=t.shift();const i=typeof r,l=Array.isArray(e);if(Array.isArray(r)){for(let a=0;a1){le(e[r],t,[r].concat(n));return}s=e[r],n=[r].concat(n)}let o=t[0];typeof o=="function"&&(o=o(s,n),o===s)||r===void 0&&o==null||(o=de(o),r===void 0||_e(s)&&_e(o)&&!Array.isArray(o)?Mt(s,o):Ce(e,r,o))}function Yn(...[e,t]){const n=de(e||{}),r=Array.isArray(n),s=Ut(n);function o(...i){vt(()=>{r&&i.length===1?Xn(n,i[0]):le(n,i)})}return[s,o]}const U="http://0.0.0.0:8840",Jn=async()=>{const e=U+"/api/all";return await(await fetch(e)).json()},zn=async()=>{const e=U+"/api/config";return await(await fetch(e)).json()},Gr=async()=>{const e=U+"/api/version";return await(await fetch(e)).json()},Xr=async()=>{const e=U+"/api/notify_test";await fetch(e)},Qn=async()=>{const e=U+"/api/rescan";await fetch(e)},dt=async(e,t,n)=>{const r=U+"/api/edit/"+e+"/"+t+"/"+n;return await(await fetch(r)).json()},Yr=async e=>{const t=U+"/api/host/"+e;return await(await fetch(t)).json()},Zn=async e=>{const t=U+"/api/host/del/"+e;return await(await fetch(t)).json()},Jr=async(e,t)=>{const n=U+"/api/port/"+e+"/"+t;return await(await fetch(n)).json()},zr=async e=>{const t=U+"/api/history/"+e+"/?num=210";return await(await fetch(t)).json()},Qr=async(e,t)=>{const n=U+"/api/history/"+e+"/"+t;return await(await fetch(n)).json()},Zr=async e=>{const t=U+"/api/wol/"+e;return await(await fetch(t)).json()},es={ID:0,Name:"",DNS:"",Iface:"",IP:"",Mac:"",Hw:"",Date:"",Known:0,Now:0},er={Host:"",Port:"",Theme:"",Color:"",DirPath:"",Timeout:120,NodePath:"",LogLevel:"",Ifaces:"",ArpArgs:"",ArpStrs:[],TrimHist:48,ShoutURL:"",UseDB:"",PGConnect:"",InfluxEnable:!1,InfluxAddr:"",InfluxToken:"",InfluxOrg:"",InfluxBucket:"",InfluxSkipTLS:!1,PrometheusEnable:!1},[Re,ge]=Yn([]),[Ee,tr]=C([]),[nr,rr]=C([]),[J,sr]=C(er),[ze,or]=C(!1),[ts,ns]=C(200),[rs,ht]=C(!1),[Bt,ir]=C([]);let gt="ID";function lr(){const e=localStorage.getItem("filterField"),t=localStorage.getItem("filterValue");ke(e,t)}function ke(e,t){let n=Re;switch(gt==e&&(n=Ee()),gt=e,localStorage.setItem("filterField",e),localStorage.setItem("filterValue",t),e){case"Iface":n=n.filter(r=>r.Iface==t);break;case"Known":n=n.filter(r=>r.Known==t);break;case"Now":n=n.filter(r=>r.Now==t);break;default:n=Ee()}ge(n)}let K=!1,Be="";function ar(){const e=localStorage.getItem("sortField");K=JSON.parse(localStorage.getItem("sortDown")),K=!K,Vt(e)}function Vt(e){e!=Be?(Be=e,K=!K):(Be="",K=!K),localStorage.setItem("sortDown",K.toString()),localStorage.setItem("sortField",e);let t=Ee();e=="IP"?t.sort((n,r)=>ur(n,r,K)):t.sort((n,r)=>cr(n,r,e,K)),ge(t)}function cr(e,t,n,r){return e[n]>t[n]?r?1:-1:r?-1:1}function ur(e,t,n){const r=pt(e),s=pt(t);return n?r-s:s-r}function pt(e){return Number(e.IP.split(".").map(t=>`000${t}`.slice(-3)).join(""))}function fr(){pe(),ke("ID",0),setInterval(()=>{pe()},6e4)}async function pe(){const e=await Jn();e!==null&&(ge(e),tr(e),dr(),ar(),lr())}function dr(){let e=[];for(let t of Re)e.includes(t.Iface)||e.push(t.Iface);rr(e)}const hr=(e,t)=>{let n;const r=()=>clearTimeout(n);return Ze()&&Ie(r),Object.assign((...o)=>{n!==void 0&&r(),n=setTimeout(()=>e(...o),t)},{clear:r})};var gr=N(''),pr=N(''),mr=N(""),yr=N(""),wr=N('.
'),br=N(""),vr=N('');function $r(e){const[t,n]=C(e.host.Name),r=()=>{const u=t().trim();if(u!=="")return u;const c=(e.host.Hw||"").trim();if(c!==""&&!c.startsWith("(Unknown"))return c;const h=(e.host.Mac||"").trim();return h!==""?"Unknown "+h.slice(-5):"Unknown"};let s=gr();e.host.Now==1&&(s=pr());let o;e.host.Known===1?o=!0:o=!1;const i=hr(async u=>{await dt(e.host.ID,u,"")},300),l=async u=>{n(u),i(u)},a=async()=>{await dt(e.host.ID,t(),"toggle")},f=u=>{const c=e.host.ID;ir(h=>u?h.includes(c)?h:[...h,c]:h.filter(d=>d!==c))};return(()=>{var u=wr(),c=u.firstChild,h=c.firstChild,d=c.nextSibling,b=d.nextSibling,g=b.nextSibling,p=g.firstChild,$=g.nextSibling,m=$.nextSibling,k=m.nextSibling,_=k.nextSibling,I=_.firstChild,H=I.firstChild,V=_.nextSibling,Y=V.nextSibling;return L(c,()=>e.index,h),L(d,x(fe,{get when(){return ze()},get fallback(){return(()=>{var y=br();return L(y,r),T(()=>kt(y,t().trim()===""?"text-muted":"")),y})()},get children(){var y=mr();return y.$$input=A=>l(A.target.value),T(()=>y.value=t()),y}})),L(b,()=>e.host.Iface),L(p,()=>e.host.IP),L($,()=>e.host.Mac),L(m,()=>e.host.Hw.slice(0,12)+".."),L(k,()=>e.host.Date),H.$$click=a,H.checked=o,L(V,s),L(Y,x(fe,{get when(){return ze()},get fallback(){return(()=>{var y=vr();return T(()=>Q(y,"href","/host/"+e.host.ID)),y})()},get children(){var y=yr();return y.addEventListener("change",A=>f(A.target.checked)),T(()=>y.checked=Bt().includes(e.host.ID)),y}})),T(y=>{var A="http://"+e.host.IP,O=e.host.Hw;return A!==y.e&&Q(p,"href",y.e=A),O!==y.t&&Q(m,"title",y.t=O),y},{e:void 0,t:void 0}),u})()}se(["input","click"]);var Sr=N(''),Ar=N(' ');function Pr(){const[e,t]=C("");(()=>{let s=localStorage.getItem("sortField");s==="Mac"&&(s="MAC"),s==="Hw"&&(s="Hardware"),s==="Now"&&(s="On"),t(s)})();const r=s=>{t(s),s==="MAC"&&(s="Mac"),s==="Hardware"&&(s="Hw"),s==="On"&&(s="Now"),Vt(s)};return(()=>{var s=Sr(),o=s.firstChild,i=o.firstChild,l=i.nextSibling;return L(o,x(nt,{each:["Name","Iface","IP","MAC","Hardware","Date","Known","On"],children:a=>(()=>{var f=Ar(),u=f.firstChild,c=u.nextSibling;return L(f,a,u),c.$$click=r,c.$$clickData=a,Q(c,"title","Sort by "+a),T(h=>gn(f,a===e()?"color: var(--bs-primary);":"",h)),f})()}),l),s})()}se(["click"]);var _r=N('