preact-missing-hooks 4.2.0 → 4.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,2 +1,2 @@
1
- import{useState as e,useCallback as t,useEffect as n,useMemo as r,useRef as o}from"preact/hooks";import{isValidElement as i,cloneElement as u}from"preact";import{useRef as c,useEffect as s}from"preact/compat";function a(){const[n,r]=e(!1);return[t(e=>{r(!0),Promise.resolve().then(()=>{e(),r(!1)})},[]),n]}function l(e,t,r){n(()=>{const n=e.current;if(!n)return;const o=new MutationObserver(t);return o.observe(n,r),()=>o.disconnect()},[e,t,r])}const d=new Map;function f(){return{emit:t((e,...t)=>{const n=d.get(e);n&&n.forEach(e=>e(...t))},[]),on:t((e,t)=>{let n=d.get(e);return n||(n=new Set,d.set(e,n)),n.add(t),()=>{n.delete(t),0===n.size&&d.delete(e)}},[])}}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(null,arguments)}function m(e,t,n="preserve"){return r(()=>{if(!e)return e;const r=e=>{if(!i(e))return e;const r=e.props||{};let o;o="override"===n?p({},r,t):p({},t,r);const c=null==r?void 0:r.style,s=null==t?void 0:t.style;return c&&s&&"object"==typeof c&&"object"==typeof s&&(o.style="override"===n?p({},c,s):p({},s,c)),u(e,o)};return Array.isArray(e)?e.map(r):r(e)},[e,t,n])}function v(){const[t,r]=e(()=>{if("undefined"==typeof window)return"no-preference";const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");return e.matches?"dark":t.matches?"light":"no-preference"});return n(()=>{if("undefined"==typeof window)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),t=e=>{r(e.matches?"dark":"light")},n=()=>{const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");r(e.matches?"dark":t.matches?"light":"no-preference")};e.addEventListener("change",t);const o=window.matchMedia("(prefers-color-scheme: light)");return o.addEventListener("change",n),()=>{e.removeEventListener("change",t),o.removeEventListener("change",n)}},[]),t}function g(){if("undefined"==typeof navigator)return{online:!0};const e={online:navigator.onLine},t=navigator.connection;return t&&(void 0!==t.effectiveType&&(e.effectiveType=t.effectiveType),void 0!==t.downlink&&(e.downlink=t.downlink),void 0!==t.rtt&&(e.rtt=t.rtt),void 0!==t.saveData&&(e.saveData=t.saveData),void 0!==t.type&&(e.connectionType=t.type)),e}function h(){const[t,r]=e(g);return n(()=>{if("undefined"==typeof window)return;const e=()=>r(g());window.addEventListener("online",e),window.addEventListener("offline",e);const t=navigator.connection;return null!=t&&t.addEventListener&&t.addEventListener("change",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e),null!=t&&t.removeEventListener&&t.removeEventListener("change",e)}},[]),t}function y(n={}){const{resetDelay:r=2e3}=n,[o,i]=e(!1),[u,c]=e(null),s=t(()=>{i(!1),c(null)},[]);return{copy:t(async e=>{if(c(null),"undefined"==typeof navigator||!navigator.clipboard){const e=new Error("Clipboard API is not available");return c(e),!1}try{return await navigator.clipboard.writeText(e),i(!0),r>0&&setTimeout(()=>i(!1),r),!0}catch(e){const t=e instanceof Error?e:new Error(String(e));return c(t),!1}},[r]),paste:t(async()=>{if(c(null),"undefined"==typeof navigator||!navigator.clipboard){const e=new Error("Clipboard API is not available");return c(e),""}try{return await navigator.clipboard.readText()}catch(e){const t=e instanceof Error?e:new Error(String(e));return c(t),""}},[]),copied:o,error:u,reset:s}}function w(e,t){const{onRageClick:r,threshold:i=5,timeWindow:u=1e3,distanceThreshold:c=30}=t,s=o(r);s.current=r;const a=o([]);n(()=>{const t=e.current;if(!t)return;const n=e=>{const t=Date.now(),n={time:t,x:e.clientX,y:e.clientY},r=t-u,o=a.current.filter(e=>e.time>=r);if(o.push(n),Infinity!==c){const t=o.filter(e=>{return t=e,r=n,Math.hypot(r.x-t.x,r.y-t.y)<=c;var t,r});if(t.length>=i)return s.current({count:t.length,event:e}),void(a.current=[])}else if(o.length>=i)return s.current({count:o.length,event:e}),void(a.current=[]);a.current=o};return t.addEventListener("click",n),()=>t.removeEventListener("click",n)},[e,i,u,c])}function b(r,i){const{mode:u,concurrency:c=4}=i,s="sequential"===u?1:Math.max(1,c),[a,l]=e(!1),[d,f]=e(void 0),[p,m]=e(void 0),[v,g]=e(0),h=o([]),y=o(0),w=o(0),b=o(!1),E=o(r);E.current=r;const k=t(()=>{g(h.current.length+w.current)},[]),x=t(()=>{if(b.current)return;if(w.current>=s)return;if(0===h.current.length)return 0===w.current&&l(!1),void k();h.current.sort((e,t)=>e.priority!==t.priority?e.priority-t.priority:e.sequence-t.sequence);const e=h.current.shift();w.current+=1,l(!0),k(),(0,E.current)(e.data).then(t=>{f(t),m(void 0),e.resolve(t)}).catch(t=>{m(t),e.reject(t)}).finally(()=>{w.current-=1,k(),x()}),h.current.length>0&&w.current<s&&x()},[s,k]),S=t((e,t)=>{var n;if(b.current)return Promise.reject(new Error("Worker is terminated"));const r=null!=(n=null==t?void 0:t.priority)?n:1,o=++y.current,i=new Promise((t,n)=>{h.current.push({data:e,priority:r,sequence:o,resolve:t,reject:n})});return k(),l(!0),queueMicrotask(x),i},[x,k]),T=t(()=>{const e=h.current;h.current=[],e.forEach(e=>e.reject(new Error("Task cleared from queue"))),k(),0===w.current&&l(!1)},[k]),I=t(()=>{b.current=!0,T()},[T]);return n(()=>()=>{b.current=!0},[]),{run:S,loading:a,result:d,error:p,queueSize:v,clearQueue:T,terminate:I}}const E=new Map;function k(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>{var t;return n(null!=(t=e.error)?t:new DOMException("Unknown IndexedDB error"))}})}function x(e,t){return t?e.then(e=>(null==t.onSuccess||t.onSuccess(e),e)).catch(e=>{throw null==t.onError||t.onError(e),e}):e}function S(t){const[r,i]=e(null),[u,c]=e(null),[s,a]=e(!1),l=o(t);return l.current=t,n(()=>{let e=!1;c(null),a(!1),i(null);const{name:t,version:n,tables:r}=l.current;return function(e){const t=`${e.name}_v${e.version}`;let n=E.get(t);return n||(n=function(e){return new Promise((t,n)=>{const r=indexedDB.open(e.name,e.version);r.onerror=()=>{var e;return n(null!=(e=r.error)?e:new DOMException("Failed to open database"))},r.onsuccess=()=>t(r.result),r.onupgradeneeded=t=>{const n=t.target.result,r=e.tables;for(const e of Object.keys(r)){const t=r[e];if(!n.objectStoreNames.contains(e)){var o;const r=n.createObjectStore(e,{keyPath:t.keyPath,autoIncrement:null!=(o=t.autoIncrement)&&o});if(t.indexes)for(const e of t.indexes)r.createIndex(e,e,{unique:!1})}}}})}(e),E.set(t,n),n)}({name:t,version:n,tables:r}).then(t=>{if(e)return void t.close();const n=function(e){return{get db(){return e},hasTable:t=>e.objectStoreNames.contains(t),table:t=>function(e,t){return function(e,t){function n(n){return e.transaction([t],n).objectStore(t)}return{insert:(e,t)=>x(k(n("readwrite").add(e)),t),update(e,t,r){const o=n("readwrite");return x(k(o.get(e)).then(e=>{if(void 0===e)throw new DOMException("Key not found","NotFoundError");const n=p({},e,t);return k(o.put(n))}).then(()=>{}),r)},delete:(e,t)=>x(k(n("readwrite").delete(e)).then(()=>{}),t),exists:e=>k(n("readonly").getKey(e)).then(e=>void 0!==e),query(e,t){const r=n("readonly").openCursor(),o=[];return x(new Promise((t,n)=>{r.onsuccess=()=>{const n=r.result;n?(e(n.value)&&o.push(n.value),n.continue()):t(o)},r.onerror=()=>{var e;return n(null!=(e=r.error)?e:new DOMException("Unknown error"))}}),t)},upsert:(e,t)=>x(k(n("readwrite").put(e)),t),bulkInsert(e,t){const r=n("readwrite"),o=[];if(0===e.length)return x(Promise.resolve(o),t);let i=0;return x(new Promise((t,n)=>{e.forEach((u,c)=>{const s=r.add(u);s.onsuccess=()=>{o[c]=s.result,i++,i===e.length&&t(o)},s.onerror=()=>{var e;return n(null!=(e=s.error)?e:new DOMException("Unknown error"))}})}),t)},clear:e=>x(k(n("readwrite").clear()).then(()=>{}),e),count:e=>x(k(n("readonly").count()),null!=e?e:{})}}(e,t)}(e,t),transaction(t,n,r,o){const i=e.transaction(t,n),u={table:e=>function(e,t){return function(e,t){function n(){return e.objectStore(t)}return{insert:(e,t)=>x(k(n().add(e)),t),update(e,t,r){const o=n();return x(k(o.get(e)).then(e=>{if(void 0===e)throw new DOMException("Key not found","NotFoundError");const n=p({},e,t);return k(o.put(n))}).then(()=>{}),r)},delete:(e,t)=>x(k(n().delete(e)).then(()=>{}),t),exists:e=>k(n().getKey(e)).then(e=>void 0!==e),query(e,t){const r=n().openCursor(),o=[];return x(new Promise((t,n)=>{r.onsuccess=()=>{const n=r.result;n?(e(n.value)&&o.push(n.value),n.continue()):t(o)},r.onerror=()=>{var e;return n(null!=(e=r.error)?e:new DOMException("Unknown error"))}}),t)},upsert:(e,t)=>x(k(n().put(e)),t),bulkInsert(e,t){const r=n(),o=[];if(0===e.length)return x(Promise.resolve(o),t);let i=0;return x(new Promise((t,n)=>{e.forEach((u,c)=>{const s=r.add(u);s.onsuccess=()=>{o[c]=s.result,i++,i===e.length&&t(o)},s.onerror=()=>{var e;return n(null!=(e=s.error)?e:new DOMException("Unknown error"))}})}),t)},clear:e=>x(k(n().clear()).then(()=>{}),e),count:e=>x(k(n().count()),null!=e?e:{})}}(e,t)}(i,e)},c=new Promise((e,t)=>{i.oncomplete=()=>e(),i.onerror=()=>{var e;return t(null!=(e=i.error)?e:new DOMException("Transaction failed"))}}),s=r(u);return function(e,t){return t?e.then(()=>null==t.onSuccess?void 0:t.onSuccess()).catch(e=>{throw null==t.onError||t.onError(e),e}):e}(Promise.resolve(s).then(()=>c),o)}}}(t);i(n),a(!0)}).catch(t=>{e||c(t)}),()=>{e=!0}},[t.name,t.version]),{db:r,isReady:s,error:u}}const T=/\b(?:25[0-5]|2[0-4]\d|1?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|1?\d{1,2})){3}\b/g,I=["stun:stun.l.google.com:19302"],M=3e3;function A(t={}){const{stunServers:r=I,timeout:i=M,onDetect:u}=t,[c,s]=e([]),[a,l]=e(!0),[d,f]=e(null),p=o(null),m=o(null),v=o(new Set),g=o(u);return g.current=u,n(()=>{if("undefined"==typeof window)return l(!1),void f("WebRTC IP detection is not available during SSR");if("undefined"==typeof RTCPeerConnection)return l(!1),void f("RTCPeerConnection is not available");const e=new Set;v.current=e;const t=()=>{m.current&&(clearTimeout(m.current),m.current=null),p.current&&(p.current.close(),p.current=null),l(!1)},n=t=>{e.has(t)||(e.add(t),s(e=>[...e,t]),null==g.current||g.current(t))};try{const e=new RTCPeerConnection({iceServers:[{urls:r}]});p.current=e,e.onicecandidate=e=>{const t=e.candidate;t&&t.candidate&&function(e){const t=e.match(T);return t?[...t]:[]}(t.candidate).forEach(n)},e.createDataChannel(""),e.createOffer().then(t=>e.setLocalDescription(t)).catch(e=>{f(e instanceof Error?e.message:"Failed to create offer"),t()}),m.current=setTimeout(()=>t(),i)}catch(e){f(e instanceof Error?e.message:"WebRTC setup failed"),t()}return()=>{t()}},[r.join(","),i]),{ips:c,loading:a,error:d}}function j(r){const{wasmUrl:i,exportName:u="compute",workerUrl:c,importObject:s}=r,[a,l]=e(void 0),[d,f]=e(!0),[p,m]=e(null),[v,g]=e(!1),h=o(null),y=o(null),w=o(null);return n(()=>{if("undefined"==typeof window)return m("useWasmCompute is not available during SSR"),void f(!1);if("undefined"==typeof Worker)return m("Worker is not supported in this environment"),void f(!1);if("undefined"==typeof WebAssembly||"function"!=typeof WebAssembly.instantiate)return m("WebAssembly is not supported in this environment"),void f(!1);m(null),g(!1);const e=function(e){if(e)return new Worker(e);const t=new Blob(["\nself.onmessage = async (e) => {\n const d = e.data;\n if (d.type === 'init') {\n try {\n const res = await fetch(d.wasmUrl);\n const buf = await res.arrayBuffer();\n const mod = await WebAssembly.instantiate(buf, d.importObject || {});\n self.wasmInstance = mod.instance;\n self.exportName = d.exportName || 'compute';\n self.postMessage({ type: 'ready' });\n } catch (err) {\n self.postMessage({ type: 'error', error: (err && err.message) || String(err) });\n }\n return;\n }\n if (d.type === 'compute') {\n try {\n const fn = self.wasmInstance.exports[self.exportName];\n if (typeof fn !== 'function') {\n self.postMessage({ type: 'error', error: 'Export \"' + self.exportName + '\" is not a function' });\n return;\n }\n const result = fn(d.input);\n self.postMessage({ type: 'result', result: result });\n } catch (err) {\n self.postMessage({ type: 'error', error: (err && err.message) || String(err) });\n }\n }\n};\n"],{type:"application/javascript"}),n=URL.createObjectURL(t),r=new Worker(n);return URL.revokeObjectURL(n),r}(c);h.current=e;const t=e=>{var t;const{type:n,result:r,error:o}=null!=(t=e.data)?t:{};return"ready"===n?(g(!0),void f(!1)):"error"===n?(m(null!=o?o:"Unknown error"),f(!1),void(w.current&&(w.current(new Error(o)),y.current=null,w.current=null))):void("result"===n&&(l(r),f(!1),y.current&&(y.current(r),y.current=null,w.current=null)))};return e.addEventListener("message",t),e.postMessage({type:"init",wasmUrl:i,exportName:u,importObject:null!=s?s:{}}),()=>{e.removeEventListener("message",t),e.terminate(),h.current=null,w.current&&(w.current(new Error("Worker terminated")),y.current=null,w.current=null)}},[i,u,c,s]),{compute:t(e=>new Promise((t,n)=>{h.current&&v?p?n(new Error(p)):(y.current=t,w.current=n,f(!0),h.current.postMessage({type:"compute",input:e})):n(new Error("WASM not ready"))}),[v,p]),result:a,loading:d,error:p,ready:v}}function O(t,i={}){const{maxHistory:u=100,throughputWindowMs:c=1e3}=i,[s,a]=e([]),[l,d]=e(0),[f,p]=e(0),[m,v]=e([]),[g,h]=e(0),y=o([]),w=o(0),b=o(0);n(()=>{if(!t)return;const e=e=>{const t=function(e){if(null==e||"object"!=typeof e)return null;const t=e.type;return"task_start"!==t&&"task_end"!==t&&"task_fail"!==t&&"queue_size"!==t?null:{type:t,taskId:"string"==typeof e.taskId?e.taskId:void 0,duration:"number"==typeof e.duration?e.duration:void 0,error:"string"==typeof e.error?e.error:void 0,size:"number"==typeof e.size?e.size:void 0,timestamp:Date.now()}}(e.data);if(t)if(v(e=>[...e,t].slice(-u)),"task_start"===t.type&&t.taskId)a(e=>e.includes(t.taskId)?e:[...e,t.taskId]);else if("task_end"===t.type){t.taskId&&a(e=>e.filter(e=>e!==t.taskId)),d(e=>e+1);const e=Date.now()-c;y.current=[...y.current.filter(t=>t>=e),t.timestamp],"number"==typeof t.duration&&(w.current+=t.duration,b.current+=1)}else"task_fail"===t.type?(t.taskId&&a(e=>e.filter(e=>e!==t.taskId)),p(e=>e+1)):"queue_size"===t.type&&"number"==typeof t.size&&h(t.size)};return t.addEventListener("message",e),()=>t.removeEventListener("message",e)},[t,u]);const E=r(()=>{const e=b.current;return e>0?w.current/e:0},[m]),k=r(()=>{const e=Date.now()-c;return y.current.filter(t=>t>=e).length/(c/1e3)},[m,c]),x=r(()=>({runningTasks:s,completedCount:l,failedCount:f,averageDurationMs:E,throughputPerSecond:k,currentQueueSize:g,totalProcessed:l+f,recentEventCount:m.length}),[s,l,f,E,k,g,m.length]);return{runningTasks:s,completedCount:l,failedCount:f,eventHistory:m,averageDurationMs:E,throughputPerSecond:k,currentQueueSize:g,progress:x}}function D(e,t){if(null==e)return"";const n=("string"==typeof e?e:String(e)).trim();return n.length>t?n.slice(0,t):n}function P(e){if(!Array.isArray(e))return[];const t=[];for(let n=0;n<e.length&&t.length<50;n++){const r=D(e[n],100);r&&t.push(r)}return t}function C(e){const t=D(e,2048);if(!t)return"";try{const e=new URL(t);if("http:"===e.protocol||"https:"===e.protocol)return t}catch(e){}return""}function L(e){try{if("undefined"==typeof window)return!1;const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility&&"0"!==t.opacity}catch(e){return!1}}function U(e){const t={};try{for(const n of Object.keys(e).slice(0,20)){const r=D(n,50);if(!r)continue;const o=e[n];"string"==typeof o?t[r]=o.slice(0,500):"number"==typeof o&&Number.isFinite(o)||"boolean"==typeof o?t[r]=o:Array.isArray(o)&&(t[r]=o.map(e=>D(e,200)).filter(Boolean).slice(0,20))}}catch(e){}return t}function N(){try{if("undefined"==typeof document||!document.querySelectorAll)return;document.querySelectorAll('script[data-llm="true"]').forEach(e=>e.remove())}catch(e){}}function q(e){const t=c(null);s(()=>{try{if("undefined"==typeof window)return;const n=function(e){return null==e||"object"!=typeof e?{route:"/"}:{route:D(e.route,2048)||"/",mode:"auto-extract"===e.mode?"auto-extract":"manual",title:void 0!==e.title?D(e.title,200):void 0,description:void 0!==e.description?D(e.description,2e3):void 0,tags:void 0!==e.tags?P(e.tags):void 0,canonicalUrl:void 0!==e.canonicalUrl?C(e.canonicalUrl):void 0,language:void 0!==e.language?D(e.language,20):void 0,ogType:void 0!==e.ogType?D(e.ogType,50):void 0,ogImage:void 0!==e.ogImage?C(e.ogImage):void 0,ogImageAlt:void 0!==e.ogImageAlt?D(e.ogImageAlt,200):void 0,siteName:void 0!==e.siteName?D(e.siteName,100):void 0,author:void 0!==e.author?D(e.author,200):void 0,publishedTime:void 0!==e.publishedTime?D(e.publishedTime,50):void 0,modifiedTime:void 0!==e.modifiedTime?D(e.modifiedTime,50):void 0,robots:void 0!==e.robots?D(e.robots,100):void 0,extra:void 0===e.extra||"object"!=typeof e.extra||Array.isArray(e.extra)?void 0:U(e.extra)}}(e),r=function(e){try{const r=(new Date).toISOString(),o={route:e.route,generatedAt:r};if("auto-extract"===e.mode){var t,n;const r=function(){const e={title:"",outline:[],description:""};try{if("undefined"==typeof document)return e;const t=D(document.title,200),n=[];let r="";try{const e=document.querySelectorAll("nav, footer, [role='navigation'], [role='contentinfo'], script, style, noscript"),t=t=>{for(const n of e)if(n.contains(t))return!0;return!1},o=document.querySelectorAll("h1, h2");for(const e of o){if(n.length>=50)break;if(L(e)&&!t(e)){const t=D(e.textContent,300);t&&n.push(t)}}const i=document.querySelectorAll("p"),u=[];for(const e of i){if(u.length>=3)break;if(L(e)&&!t(e)){const t=D(e.textContent,1e3);t&&u.push(t)}}r=u.join(" ").trim().slice(0,2e3)||""}catch(e){}return{title:t,outline:n,description:r}}catch(t){return e}}();o.title=(null!=(t=e.title)?t:r.title)||void 0,o.description=(null!=(n=e.description)?n:r.description)||void 0,r.outline.length>0&&(o.outline=r.outline)}else void 0!==e.title&&""!==e.title&&(o.title=e.title),void 0!==e.description&&""!==e.description&&(o.description=e.description);return e.tags&&e.tags.length>0&&(o.tags=e.tags),e.canonicalUrl&&(o.canonicalUrl=e.canonicalUrl),e.language&&(o.language=e.language),e.ogType&&(o.ogType=e.ogType),e.ogImage&&(o.ogImage=e.ogImage),e.ogImageAlt&&(o.ogImageAlt=e.ogImageAlt),e.siteName&&(o.siteName=e.siteName),e.author&&(o.author=e.author),e.publishedTime&&(o.publishedTime=e.publishedTime),e.modifiedTime&&(o.modifiedTime=e.modifiedTime),e.robots&&(o.robots=e.robots),e.extra&&Object.keys(e.extra).length>0&&(o.extra=e.extra),o}catch(t){var r;return{route:null!=(r=null==e?void 0:e.route)?r:"/",generatedAt:(new Date).toISOString()}}}(n),o=JSON.stringify(r);if(t.current===o)return;return t.current=o,N(),function(e){try{if("undefined"==typeof document||!document.head)return;const t=document.createElement("script");t.type="application/llm+json",t.setAttribute("data-llm","true"),t.textContent=JSON.stringify(e),document.head.appendChild(t)}catch(e){}}(r),()=>{N(),t.current=null}}catch(e){}},[null==e?void 0:e.route,null==e?void 0:e.mode,null==e?void 0:e.title,null==e?void 0:e.description,null==e?void 0:e.tags,null==e?void 0:e.canonicalUrl,null==e?void 0:e.language,null==e?void 0:e.ogType,null==e?void 0:e.ogImage,null==e?void 0:e.ogImageAlt,null==e?void 0:e.siteName,null==e?void 0:e.author,null==e?void 0:e.publishedTime,null==e?void 0:e.modifiedTime,null==e?void 0:e.robots])}export{y as useClipboard,f as useEventBus,S as useIndexedDB,q as useLLMMetadata,l as useMutationObserver,h as useNetworkState,v as usePreferredTheme,w as useRageClick,b as useThreadedWorker,a as useTransition,j as useWasmCompute,A as useWebRTCIP,O as useWorkerNotifications,m as useWrappedChildren};
1
+ import{useState as e,useCallback as t,useEffect as n,useMemo as r,useRef as o}from"preact/hooks";import{isValidElement as i,cloneElement as u}from"preact";import{useRef as c,useEffect as s}from"preact/compat";function a(){const[n,r]=e(!1);return[t(e=>{r(!0),Promise.resolve().then(()=>{e(),r(!1)})},[]),n]}function l(e,t,r){n(()=>{const n=e.current;if(!n)return;const o=new MutationObserver(t);return o.observe(n,r),()=>o.disconnect()},[e,t,r])}const d=new Map;function f(){return{emit:t((e,...t)=>{const n=d.get(e);n&&n.forEach(e=>e(...t))},[]),on:t((e,t)=>{let n=d.get(e);return n||(n=new Set,d.set(e,n)),n.add(t),()=>{n.delete(t),0===n.size&&d.delete(e)}},[])}}function p(){return p=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},p.apply(null,arguments)}function m(e,t,n="preserve"){return r(()=>{if(!e)return e;const r=e=>{if(!i(e))return e;const r=e.props||{};let o;o="override"===n?p({},r,t):p({},t,r);const c=null==r?void 0:r.style,s=null==t?void 0:t.style;return c&&s&&"object"==typeof c&&"object"==typeof s&&(o.style="override"===n?p({},c,s):p({},s,c)),u(e,o)};return Array.isArray(e)?e.map(r):r(e)},[e,t,n])}function v(){const[t,r]=e(()=>{if("undefined"==typeof window)return"no-preference";const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");return e.matches?"dark":t.matches?"light":"no-preference"});return n(()=>{if("undefined"==typeof window)return;const e=window.matchMedia("(prefers-color-scheme: dark)"),t=e=>{r(e.matches?"dark":"light")},n=()=>{const e=window.matchMedia("(prefers-color-scheme: dark)"),t=window.matchMedia("(prefers-color-scheme: light)");r(e.matches?"dark":t.matches?"light":"no-preference")};e.addEventListener("change",t);const o=window.matchMedia("(prefers-color-scheme: light)");return o.addEventListener("change",n),()=>{e.removeEventListener("change",t),o.removeEventListener("change",n)}},[]),t}function g(){if("undefined"==typeof navigator)return{online:!0};const e={online:navigator.onLine},t=navigator.connection;return t&&(void 0!==t.effectiveType&&(e.effectiveType=t.effectiveType),void 0!==t.downlink&&(e.downlink=t.downlink),void 0!==t.rtt&&(e.rtt=t.rtt),void 0!==t.saveData&&(e.saveData=t.saveData),void 0!==t.type&&(e.connectionType=t.type)),e}function h(){const[t,r]=e(g);return n(()=>{if("undefined"==typeof window)return;const e=()=>r(g());window.addEventListener("online",e),window.addEventListener("offline",e);const t=navigator.connection;return null!=t&&t.addEventListener&&t.addEventListener("change",e),()=>{window.removeEventListener("online",e),window.removeEventListener("offline",e),null!=t&&t.removeEventListener&&t.removeEventListener("change",e)}},[]),t}function y(n={}){const{resetDelay:r=2e3}=n,[o,i]=e(!1),[u,c]=e(null),s=t(()=>{i(!1),c(null)},[]);return{copy:t(async e=>{if(c(null),"undefined"==typeof navigator||!navigator.clipboard){const e=new Error("Clipboard API is not available");return c(e),!1}try{return await navigator.clipboard.writeText(e),i(!0),r>0&&setTimeout(()=>i(!1),r),!0}catch(e){const t=e instanceof Error?e:new Error(String(e));return c(t),!1}},[r]),paste:t(async()=>{if(c(null),"undefined"==typeof navigator||!navigator.clipboard){const e=new Error("Clipboard API is not available");return c(e),""}try{return await navigator.clipboard.readText()}catch(e){const t=e instanceof Error?e:new Error(String(e));return c(t),""}},[]),copied:o,error:u,reset:s}}function w(e,t){const{onRageClick:r,threshold:i=5,timeWindow:u=1e3,distanceThreshold:c=30}=t,s=o(r);s.current=r;const a=o([]);n(()=>{const t=e.current;if(!t)return;const n=e=>{const t=Date.now(),n={time:t,x:e.clientX,y:e.clientY},r=t-u,o=a.current.filter(e=>e.time>=r);if(o.push(n),Infinity!==c){const t=o.filter(e=>{return t=e,r=n,Math.hypot(r.x-t.x,r.y-t.y)<=c;var t,r});if(t.length>=i)return s.current({count:t.length,event:e}),void(a.current=[])}else if(o.length>=i)return s.current({count:o.length,event:e}),void(a.current=[]);a.current=o};return t.addEventListener("click",n),()=>t.removeEventListener("click",n)},[e,i,u,c])}function b(r,i){const{mode:u,concurrency:c=4}=i,s="sequential"===u?1:Math.max(1,c),[a,l]=e(!1),[d,f]=e(void 0),[p,m]=e(void 0),[v,g]=e(0),h=o([]),y=o(0),w=o(0),b=o(!1),E=o(r);E.current=r;const k=t(()=>{g(h.current.length+w.current)},[]),x=t(()=>{if(b.current)return;if(w.current>=s)return;if(0===h.current.length)return 0===w.current&&l(!1),void k();h.current.sort((e,t)=>e.priority!==t.priority?e.priority-t.priority:e.sequence-t.sequence);const e=h.current.shift();w.current+=1,l(!0),k(),(0,E.current)(e.data).then(t=>{f(t),m(void 0),e.resolve(t)}).catch(t=>{m(t),e.reject(t)}).finally(()=>{w.current-=1,k(),x()}),h.current.length>0&&w.current<s&&x()},[s,k]),T=t((e,t)=>{var n;if(b.current)return Promise.reject(new Error("Worker is terminated"));const r=null!=(n=null==t?void 0:t.priority)?n:1,o=++y.current,i=new Promise((t,n)=>{h.current.push({data:e,priority:r,sequence:o,resolve:t,reject:n})});return k(),l(!0),queueMicrotask(x),i},[x,k]),S=t(()=>{const e=h.current;h.current=[],e.forEach(e=>e.reject(new Error("Task cleared from queue"))),k(),0===w.current&&l(!1)},[k]),I=t(()=>{b.current=!0,S()},[S]);return n(()=>()=>{b.current=!0},[]),{run:T,loading:a,result:d,error:p,queueSize:v,clearQueue:S,terminate:I}}const E=new Map;function k(e){return new Promise((t,n)=>{e.onsuccess=()=>t(e.result),e.onerror=()=>{var t;return n(null!=(t=e.error)?t:new DOMException("Unknown IndexedDB error"))}})}function x(e,t){return t?e.then(e=>(null==t.onSuccess||t.onSuccess(e),e)).catch(e=>{throw null==t.onError||t.onError(e),e}):e}function T(t){const[r,i]=e(null),[u,c]=e(null),[s,a]=e(!1),l=o(t);return l.current=t,n(()=>{let e=!1;c(null),a(!1),i(null);const{name:t,version:n,tables:r}=l.current;return function(e){const t=`${e.name}_v${e.version}`;let n=E.get(t);return n||(n=function(e){return new Promise((t,n)=>{const r=indexedDB.open(e.name,e.version);r.onerror=()=>{var e;return n(null!=(e=r.error)?e:new DOMException("Failed to open database"))},r.onsuccess=()=>t(r.result),r.onupgradeneeded=t=>{const n=t.target.result,r=e.tables;for(const e of Object.keys(r)){const t=r[e];if(!n.objectStoreNames.contains(e)){var o;const r=n.createObjectStore(e,{keyPath:t.keyPath,autoIncrement:null!=(o=t.autoIncrement)&&o});if(t.indexes)for(const e of t.indexes)r.createIndex(e,e,{unique:!1})}}}})}(e),E.set(t,n),n)}({name:t,version:n,tables:r}).then(t=>{if(e)return void t.close();const n=function(e){return{get db(){return e},hasTable:t=>e.objectStoreNames.contains(t),table:t=>function(e,t){return function(e,t){function n(n){return e.transaction([t],n).objectStore(t)}return{insert:(e,t)=>x(k(n("readwrite").add(e)),t),update(e,t,r){const o=n("readwrite");return x(k(o.get(e)).then(e=>{if(void 0===e)throw new DOMException("Key not found","NotFoundError");const n=p({},e,t);return k(o.put(n))}).then(()=>{}),r)},delete:(e,t)=>x(k(n("readwrite").delete(e)).then(()=>{}),t),exists:e=>k(n("readonly").getKey(e)).then(e=>void 0!==e),query(e,t){const r=n("readonly").openCursor(),o=[];return x(new Promise((t,n)=>{r.onsuccess=()=>{const n=r.result;n?(e(n.value)&&o.push(n.value),n.continue()):t(o)},r.onerror=()=>{var e;return n(null!=(e=r.error)?e:new DOMException("Unknown error"))}}),t)},upsert:(e,t)=>x(k(n("readwrite").put(e)),t),bulkInsert(e,t){const r=n("readwrite"),o=[];if(0===e.length)return x(Promise.resolve(o),t);let i=0;return x(new Promise((t,n)=>{e.forEach((u,c)=>{const s=r.add(u);s.onsuccess=()=>{o[c]=s.result,i++,i===e.length&&t(o)},s.onerror=()=>{var e;return n(null!=(e=s.error)?e:new DOMException("Unknown error"))}})}),t)},clear:e=>x(k(n("readwrite").clear()).then(()=>{}),e),count:e=>x(k(n("readonly").count()),null!=e?e:{})}}(e,t)}(e,t),transaction(t,n,r,o){const i=e.transaction(t,n),u={table:e=>function(e,t){return function(e,t){function n(){return e.objectStore(t)}return{insert:(e,t)=>x(k(n().add(e)),t),update(e,t,r){const o=n();return x(k(o.get(e)).then(e=>{if(void 0===e)throw new DOMException("Key not found","NotFoundError");const n=p({},e,t);return k(o.put(n))}).then(()=>{}),r)},delete:(e,t)=>x(k(n().delete(e)).then(()=>{}),t),exists:e=>k(n().getKey(e)).then(e=>void 0!==e),query(e,t){const r=n().openCursor(),o=[];return x(new Promise((t,n)=>{r.onsuccess=()=>{const n=r.result;n?(e(n.value)&&o.push(n.value),n.continue()):t(o)},r.onerror=()=>{var e;return n(null!=(e=r.error)?e:new DOMException("Unknown error"))}}),t)},upsert:(e,t)=>x(k(n().put(e)),t),bulkInsert(e,t){const r=n(),o=[];if(0===e.length)return x(Promise.resolve(o),t);let i=0;return x(new Promise((t,n)=>{e.forEach((u,c)=>{const s=r.add(u);s.onsuccess=()=>{o[c]=s.result,i++,i===e.length&&t(o)},s.onerror=()=>{var e;return n(null!=(e=s.error)?e:new DOMException("Unknown error"))}})}),t)},clear:e=>x(k(n().clear()).then(()=>{}),e),count:e=>x(k(n().count()),null!=e?e:{})}}(e,t)}(i,e)},c=new Promise((e,t)=>{i.oncomplete=()=>e(),i.onerror=()=>{var e;return t(null!=(e=i.error)?e:new DOMException("Transaction failed"))}}),s=r(u);return function(e,t){return t?e.then(()=>null==t.onSuccess?void 0:t.onSuccess()).catch(e=>{throw null==t.onError||t.onError(e),e}):e}(Promise.resolve(s).then(()=>c),o)}}}(t);i(n),a(!0)}).catch(t=>{e||c(t)}),()=>{e=!0}},[t.name,t.version]),{db:r,isReady:s,error:u}}const S=/\b(?:25[0-5]|2[0-4]\d|1?\d{1,2})(?:\.(?:25[0-5]|2[0-4]\d|1?\d{1,2})){3}\b/g,I=["stun:stun.l.google.com:19302"],M=3e3;function A(t={}){const{stunServers:r=I,timeout:i=M,onDetect:u}=t,[c,s]=e([]),[a,l]=e(!0),[d,f]=e(null),p=o(null),m=o(null),v=o(new Set),g=o(u);return g.current=u,n(()=>{if("undefined"==typeof window)return l(!1),void f("WebRTC IP detection is not available during SSR");if("undefined"==typeof RTCPeerConnection)return l(!1),void f("RTCPeerConnection is not available");const e=new Set;v.current=e;const t=()=>{m.current&&(clearTimeout(m.current),m.current=null),p.current&&(p.current.close(),p.current=null),l(!1)},n=t=>{e.has(t)||(e.add(t),s(e=>[...e,t]),null==g.current||g.current(t))};try{const e=new RTCPeerConnection({iceServers:[{urls:r}]});p.current=e,e.onicecandidate=e=>{const t=e.candidate;t&&t.candidate&&function(e){const t=e.match(S);return t?[...t]:[]}(t.candidate).forEach(n)},e.createDataChannel(""),e.createOffer().then(t=>e.setLocalDescription(t)).catch(e=>{f(e instanceof Error?e.message:"Failed to create offer"),t()}),m.current=setTimeout(()=>t(),i)}catch(e){f(e instanceof Error?e.message:"WebRTC setup failed"),t()}return()=>{t()}},[r.join(","),i]),{ips:c,loading:a,error:d}}function L(r){const{wasmUrl:i,exportName:u="compute",workerUrl:c,importObject:s}=r,[a,l]=e(void 0),[d,f]=e(!0),[p,m]=e(null),[v,g]=e(!1),h=o(null),y=o(null),w=o(null);return n(()=>{if("undefined"==typeof window)return m("useWasmCompute is not available during SSR"),void f(!1);if("undefined"==typeof Worker)return m("Worker is not supported in this environment"),void f(!1);if("undefined"==typeof WebAssembly||"function"!=typeof WebAssembly.instantiate)return m("WebAssembly is not supported in this environment"),void f(!1);m(null),g(!1);const e=function(e){if(e)return new Worker(e);const t=new Blob(["\nself.onmessage = async (e) => {\n const d = e.data;\n if (d.type === 'init') {\n try {\n const res = await fetch(d.wasmUrl);\n const buf = await res.arrayBuffer();\n const mod = await WebAssembly.instantiate(buf, d.importObject || {});\n self.wasmInstance = mod.instance;\n self.exportName = d.exportName || 'compute';\n self.postMessage({ type: 'ready' });\n } catch (err) {\n self.postMessage({ type: 'error', error: (err && err.message) || String(err) });\n }\n return;\n }\n if (d.type === 'compute') {\n try {\n const fn = self.wasmInstance.exports[self.exportName];\n if (typeof fn !== 'function') {\n self.postMessage({ type: 'error', error: 'Export \"' + self.exportName + '\" is not a function' });\n return;\n }\n const result = fn(d.input);\n self.postMessage({ type: 'result', result: result });\n } catch (err) {\n self.postMessage({ type: 'error', error: (err && err.message) || String(err) });\n }\n }\n};\n"],{type:"application/javascript"}),n=URL.createObjectURL(t),r=new Worker(n);return URL.revokeObjectURL(n),r}(c);h.current=e;const t=e=>{var t;const{type:n,result:r,error:o}=null!=(t=e.data)?t:{};return"ready"===n?(g(!0),void f(!1)):"error"===n?(m(null!=o?o:"Unknown error"),f(!1),void(w.current&&(w.current(new Error(o)),y.current=null,w.current=null))):void("result"===n&&(l(r),f(!1),y.current&&(y.current(r),y.current=null,w.current=null)))};return e.addEventListener("message",t),e.postMessage({type:"init",wasmUrl:i,exportName:u,importObject:null!=s?s:{}}),()=>{e.removeEventListener("message",t),e.terminate(),h.current=null,w.current&&(w.current(new Error("Worker terminated")),y.current=null,w.current=null)}},[i,u,c,s]),{compute:t(e=>new Promise((t,n)=>{h.current&&v?p?n(new Error(p)):(y.current=t,w.current=n,f(!0),h.current.postMessage({type:"compute",input:e})):n(new Error("WASM not ready"))}),[v,p]),result:a,loading:d,error:p,ready:v}}function j(t,i={}){const{maxHistory:u=100,throughputWindowMs:c=1e3}=i,[s,a]=e([]),[l,d]=e(0),[f,p]=e(0),[m,v]=e([]),[g,h]=e(0),y=o([]),w=o(0),b=o(0);n(()=>{if(!t)return;const e=e=>{const t=function(e){if(null==e||"object"!=typeof e)return null;const t=e.type;return"task_start"!==t&&"task_end"!==t&&"task_fail"!==t&&"queue_size"!==t?null:{type:t,taskId:"string"==typeof e.taskId?e.taskId:void 0,duration:"number"==typeof e.duration?e.duration:void 0,error:"string"==typeof e.error?e.error:void 0,size:"number"==typeof e.size?e.size:void 0,timestamp:Date.now()}}(e.data);if(t)if(v(e=>[...e,t].slice(-u)),"task_start"===t.type&&t.taskId)a(e=>e.includes(t.taskId)?e:[...e,t.taskId]);else if("task_end"===t.type){t.taskId&&a(e=>e.filter(e=>e!==t.taskId)),d(e=>e+1);const e=Date.now()-c;y.current=[...y.current.filter(t=>t>=e),t.timestamp],"number"==typeof t.duration&&(w.current+=t.duration,b.current+=1)}else"task_fail"===t.type?(t.taskId&&a(e=>e.filter(e=>e!==t.taskId)),p(e=>e+1)):"queue_size"===t.type&&"number"==typeof t.size&&h(t.size)};return t.addEventListener("message",e),()=>t.removeEventListener("message",e)},[t,u]);const E=r(()=>{const e=b.current;return e>0?w.current/e:0},[m]),k=r(()=>{const e=Date.now()-c;return y.current.filter(t=>t>=e).length/(c/1e3)},[m,c]),x=r(()=>({runningTasks:s,completedCount:l,failedCount:f,averageDurationMs:E,throughputPerSecond:k,currentQueueSize:g,totalProcessed:l+f,recentEventCount:m.length}),[s,l,f,E,k,g,m.length]);return{runningTasks:s,completedCount:l,failedCount:f,eventHistory:m,averageDurationMs:E,throughputPerSecond:k,currentQueueSize:g,progress:x}}function C(e,t){if(null==e)return"";const n=("string"==typeof e?e:String(e)).trim();return n.length>t?n.slice(0,t):n}function O(e){if(!Array.isArray(e))return[];const t=[];for(let n=0;n<e.length&&t.length<50;n++){const r=C(e[n],100);r&&t.push(r)}return t}function D(e){const t=C(e,2048);if(!t)return"";try{const e=new URL(t);if("http:"===e.protocol||"https:"===e.protocol)return t}catch(e){}return""}function P(e){try{if("undefined"==typeof window)return!1;const t=window.getComputedStyle(e);return"none"!==t.display&&"hidden"!==t.visibility&&"0"!==t.opacity}catch(e){return!1}}function U(e){const t={};try{for(const n of Object.keys(e).slice(0,20)){const r=C(n,50);if(!r)continue;const o=e[n];"string"==typeof o?t[r]=o.slice(0,500):"number"==typeof o&&Number.isFinite(o)||"boolean"==typeof o?t[r]=o:Array.isArray(o)&&(t[r]=o.map(e=>C(e,200)).filter(Boolean).slice(0,20))}}catch(e){}return t}function N(){try{if("undefined"==typeof document||!document.querySelectorAll)return;document.querySelectorAll('script[data-llm="true"]').forEach(e=>e.remove())}catch(e){}}function q(e){const t=c(null);s(()=>{try{if("undefined"==typeof window)return;const n=function(e){return null==e||"object"!=typeof e?{route:"/"}:{route:C(e.route,2048)||"/",mode:"auto-extract"===e.mode?"auto-extract":"manual",title:void 0!==e.title?C(e.title,200):void 0,description:void 0!==e.description?C(e.description,2e3):void 0,tags:void 0!==e.tags?O(e.tags):void 0,canonicalUrl:void 0!==e.canonicalUrl?D(e.canonicalUrl):void 0,language:void 0!==e.language?C(e.language,20):void 0,ogType:void 0!==e.ogType?C(e.ogType,50):void 0,ogImage:void 0!==e.ogImage?D(e.ogImage):void 0,ogImageAlt:void 0!==e.ogImageAlt?C(e.ogImageAlt,200):void 0,siteName:void 0!==e.siteName?C(e.siteName,100):void 0,author:void 0!==e.author?C(e.author,200):void 0,publishedTime:void 0!==e.publishedTime?C(e.publishedTime,50):void 0,modifiedTime:void 0!==e.modifiedTime?C(e.modifiedTime,50):void 0,robots:void 0!==e.robots?C(e.robots,100):void 0,extra:void 0===e.extra||"object"!=typeof e.extra||Array.isArray(e.extra)?void 0:U(e.extra)}}(e),r=function(e){try{const r=(new Date).toISOString(),o={route:e.route,generatedAt:r};if("auto-extract"===e.mode){var t,n;const r=function(){const e={title:"",outline:[],description:""};try{if("undefined"==typeof document)return e;const t=C(document.title,200),n=[];let r="";try{const e=document.querySelectorAll("nav, footer, [role='navigation'], [role='contentinfo'], script, style, noscript"),t=t=>{for(const n of e)if(n.contains(t))return!0;return!1},o=document.querySelectorAll("h1, h2");for(const e of o){if(n.length>=50)break;if(P(e)&&!t(e)){const t=C(e.textContent,300);t&&n.push(t)}}const i=document.querySelectorAll("p"),u=[];for(const e of i){if(u.length>=3)break;if(P(e)&&!t(e)){const t=C(e.textContent,1e3);t&&u.push(t)}}r=u.join(" ").trim().slice(0,2e3)||""}catch(e){}return{title:t,outline:n,description:r}}catch(t){return e}}();o.title=(null!=(t=e.title)?t:r.title)||void 0,o.description=(null!=(n=e.description)?n:r.description)||void 0,r.outline.length>0&&(o.outline=r.outline)}else void 0!==e.title&&""!==e.title&&(o.title=e.title),void 0!==e.description&&""!==e.description&&(o.description=e.description);return e.tags&&e.tags.length>0&&(o.tags=e.tags),e.canonicalUrl&&(o.canonicalUrl=e.canonicalUrl),e.language&&(o.language=e.language),e.ogType&&(o.ogType=e.ogType),e.ogImage&&(o.ogImage=e.ogImage),e.ogImageAlt&&(o.ogImageAlt=e.ogImageAlt),e.siteName&&(o.siteName=e.siteName),e.author&&(o.author=e.author),e.publishedTime&&(o.publishedTime=e.publishedTime),e.modifiedTime&&(o.modifiedTime=e.modifiedTime),e.robots&&(o.robots=e.robots),e.extra&&Object.keys(e.extra).length>0&&(o.extra=e.extra),o}catch(t){var r;return{route:null!=(r=null==e?void 0:e.route)?r:"/",generatedAt:(new Date).toISOString()}}}(n),o=JSON.stringify(r);if(t.current===o)return;return t.current=o,N(),function(e){try{if("undefined"==typeof document||!document.head)return;const t=document.createElement("script");t.type="application/llm+json",t.setAttribute("data-llm","true"),t.textContent=JSON.stringify(e),document.head.appendChild(t)}catch(e){}}(r),()=>{N(),t.current=null}}catch(e){}},[null==e?void 0:e.route,null==e?void 0:e.mode,null==e?void 0:e.title,null==e?void 0:e.description,null==e?void 0:e.tags,null==e?void 0:e.canonicalUrl,null==e?void 0:e.language,null==e?void 0:e.ogType,null==e?void 0:e.ogImage,null==e?void 0:e.ogImageAlt,null==e?void 0:e.siteName,null==e?void 0:e.author,null==e?void 0:e.publishedTime,null==e?void 0:e.modifiedTime,null==e?void 0:e.robots])}const W="use-ref-print-target",R="use-ref-print-styles",z=`\n@media print {\n body * {\n visibility: hidden;\n }\n .${W},\n .${W} * {\n visibility: visible;\n }\n .${W} {\n position: absolute !important;\n left: 0 !important;\n top: 0 !important;\n width: 100% !important;\n }\n}\n`;function _(e,n={}){const{documentTitle:r}=n,i=o("");return{print:t(()=>{const t=e.current;if(!t||"undefined"==typeof window||!window.print)return;let n=document.getElementById(R);n||(n=document.createElement("style"),n.id=R,n.textContent=z,document.head.appendChild(n)),t.classList.add(W),r&&(i.current=document.title,document.title=r);const o=()=>{t.classList.remove(W),r&&void 0!==i.current&&(document.title=i.current)};if("onafterprint"in window){const e=()=>{o(),window.removeEventListener("afterprint",e)};window.addEventListener("afterprint",e)}window.print(),setTimeout(o,1e3)},[e,r])}}export{y as useClipboard,f as useEventBus,T as useIndexedDB,q as useLLMMetadata,l as useMutationObserver,h as useNetworkState,v as usePreferredTheme,w as useRageClick,_ as useRefPrint,b as useThreadedWorker,a as useTransition,L as useWasmCompute,A as useWebRTCIP,j as useWorkerNotifications,m as useWrappedChildren};
2
2
  //# sourceMappingURL=index.modern.mjs.map