@omg-dev/app 0.6.207 → 0.6.208

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,9 +1,16 @@
1
1
  import { jsx as e } from "react/jsx-runtime";
2
- import { Q as n } from "./embedded-3jnliWKp.js";
2
+ import { Q as n } from "./embedded-CZGAlfpI.js";
3
3
  const t = `# Changelog
4
4
 
5
5
  Recent product updates and deployment notes.
6
6
 
7
+ ## October 9, 2026 - On-device web dictation (v0.6.208)
8
+
9
+ - Web dictation starts with your current transcription service. After Whistle downloads and loads in your browser, Auto switches to on-device transcription between recordings.
10
+ - In Settings > More, choose Auto, Cloud, or Local. Your choice stays in this browser. Auto uses cloud if local transcription fails. Local does not upload recordings.
11
+ - Local dictation supports English, German, French, Spanish, Italian, Dutch, and Polish. It shows the transcript after recording stops. Chinese and Cantonese selections use cloud in Auto mode.
12
+ - The composer fade stays above the phone preview card.
13
+
7
14
  ## October 8, 2026 - Sign-in for published web apps (v0.6.207)
8
15
 
9
16
  - When you ask for sign-in, the agent uses your omg.dev sign-in. It no longer builds its own login form.
@@ -2,7 +2,7 @@ import { jsx as e, jsxs as o, Fragment as te } from "react/jsx-runtime";
2
2
  import { memo as ne, useState as c, useRef as E, useCallback as v, useEffect as T, useMemo as q, Suspense as U } from "react";
3
3
  import { createPortal as re } from "react-dom";
4
4
  import { cn as y } from "cnfast";
5
- import { F as oe, ab as se, aa as W, ac as ae, X as I, ad as ie, ae as le, L as H, af as de, E as ce, m as me, ag as j } from "./embedded-3jnliWKp.js";
5
+ import { F as oe, ab as se, aa as W, ac as ae, X as I, ad as ie, ae as le, L as H, af as de, E as ce, m as me, ag as j } from "./embedded-CZGAlfpI.js";
6
6
  import { c as ue } from "./create-BOwd_pad.js";
7
7
  /**
8
8
  * @license lucide-react v0.577.0 - ISC
@@ -1,7 +1,7 @@
1
1
  import { jsxs as U, jsx as F, Fragment as vA } from "react/jsx-runtime";
2
2
  import { useState as L, useRef as R, useEffect as p, useCallback as q } from "react";
3
- import { F as ZA, q as wQ, X as CA, ah as sQ, E as tQ, ai as eQ, a9 as aQ, aa as MQ, aj as hQ, R as NQ, m as cQ } from "./embedded-3jnliWKp.js";
4
- import { K as jA, C as PA } from "./keyboard-BzfMTs67.js";
3
+ import { F as ZA, q as wQ, X as CA, ah as sQ, E as tQ, ai as eQ, a9 as aQ, aa as MQ, aj as hQ, R as NQ, m as cQ } from "./embedded-CZGAlfpI.js";
4
+ import { K as jA, C as PA } from "./keyboard-Btjmprtv.js";
5
5
  /**
6
6
  * @license lucide-react v0.577.0 - ISC
7
7
  *
@@ -0,0 +1,2 @@
1
+ (function(){"use strict";var te=(()=>{var D=globalThis.document?.currentScript?.src;return async function(E={}){var c=E,T=!!globalThis.window,N=!!globalThis.WorkerGlobalScope,C=globalThis.process?.versions?.node&&globalThis.process?.type!="renderer",j="./this.program";typeof __filename<"u"?D=__filename:N&&(D=self.location.href);var B="";function I(e){return B+e}var A,S;if(C){var O=require("node:fs");B=__dirname+"/",S=e=>{e=ye(e)?new URL(e):e;var r=O.readFileSync(e);return r},A=async(e,r=!0)=>{e=ye(e)?new URL(e):e;var t=O.readFileSync(e,r?void 0:"utf8");return t},process.argv.length>1&&(j=process.argv[1].replace(/\\/g,"/")),process.argv.slice(2)}else if(T||N){try{B=new URL(".",D).href}catch{}N&&(S=e=>{var r=new XMLHttpRequest;return r.open("GET",e,!1),r.responseType="arraybuffer",r.send(null),new Uint8Array(r.response)}),A=async e=>{var r=await fetch(e,{credentials:"same-origin"});if(r.ok)return r.arrayBuffer();throw new Error(r.status+" : "+r.url)}}var X=console.log.bind(console),x=console.error.bind(console),J,ge=!1,ye=e=>e.startsWith("file://");function $e(){return ae.buffer}function pe(){if(!F?.buffer?.resizable){var e=$e();F=new Int8Array(e),oe=new Int16Array(e),c.HEAPU8=q=new Uint8Array(e),P=new Int32Array(e),w=new Uint32Array(e),M=new BigInt64Array(e)}}function xe(){!c.noFSInit&&!n.initialized&&n.init(),ee.r(),n.ignorePermissions=!1}function R(e){e=`Aborted(${e})`,x(e),ge=!0,e+=". Build with -sASSERTIONS for more info.";var r=new WebAssembly.RuntimeError(e);throw r}var se;function We(){return I("needle.wasm")}function qe(e){if(e==se&&J)return new Uint8Array(J);if(S)return S(e);throw"both async and sync fetching of the wasm failed"}async function Xe(e){if(!J)try{var r=await A(e);return new Uint8Array(r)}catch{}return qe(e)}async function Ge(e,r){try{var t=await Xe(e),o=await WebAssembly.instantiate(t,r);return o}catch(a){x(`failed to asynchronously prepare wasm: ${a}`),R(a)}}async function Ve(e,r,t){if(!e&&!C)try{var o=fetch(r,{credentials:"same-origin"}),a=await WebAssembly.instantiateStreaming(o,t);return a}catch(i){x(`wasm streaming compile failed: ${i}`),x("falling back to ArrayBuffer instantiation")}return Ge(r,t)}function Ke(){var e={a:xr};return e}async function Ye(){function e(i){return ee=i.exports,$r(ee),pe(),ee}function r(i){return e(i.instance)}var t=Ke();se??=We();var o=await Ve(J,se,t),a=r(o);return a}var F,Je=e=>ze(e),Qe=()=>Le(),w;class Ze{constructor(r){this.excPtr=r,this.ptr=r-24}set_type(r){w[this.ptr+4>>2]=r}get_type(){return w[this.ptr+4>>2]}set_destructor(r){w[this.ptr+8>>2]=r}get_destructor(){return w[this.ptr+8>>2]}set_caught(r){r=r?1:0,F[this.ptr+12]=r}get_caught(){return F[this.ptr+12]!=0}set_rethrown(r){r=r?1:0,F[this.ptr+13]=r}get_rethrown(){return F[this.ptr+13]!=0}init(r,t){this.set_adjusted_ptr(0),this.set_type(r),this.set_destructor(t)}set_adjusted_ptr(r){w[this.ptr+16>>2]=r}get_adjusted_ptr(){return w[this.ptr+16>>2]}}var er=(e,r,t)=>{var o=new Ze(e);o.init(r,t),R()},P,ne=()=>{var e=P[+_.varargs>>2];return _.varargs+=4,e},G=ne,y={isAbs:e=>e.charAt(0)==="/",splitPath:e=>{var r=/^(\/?|)([\s\S]*?)((?:\.{1,2}|[^\/]+?|)(\.[^.\/]*|))(?:[\/]*)$/;return r.exec(e).slice(1)},normalizeArray:(e,r)=>{for(var t=0,o=e.length-1;o>=0;o--){var a=e[o];a==="."?e.splice(o,1):a===".."?(e.splice(o,1),t++):t&&(e.splice(o,1),t--)}if(r)for(;t;t--)e.unshift("..");return e},normalize:e=>{var r=y.isAbs(e),t=e.slice(-1)==="/";return e=y.normalizeArray(e.split("/").filter(o=>!!o),!r).join("/"),!e&&!r&&(e="."),e&&t&&(e+="/"),(r?"/":"")+e},dirname:e=>{var r=y.splitPath(e),t=r[0],o=r[1];return!t&&!o?".":(o&&(o=o.slice(0,-1)),t+o)},basename:e=>e&&e.match(/([^\/]+|\/)\/*$/)[1],join:(...e)=>y.normalize(e.join("/")),join2:(e,r)=>y.normalize(e+"/"+r)},rr=()=>{if(C){var e=require("node:crypto");return r=>(e.randomFillSync(r),0)}return r=>(crypto.getRandomValues(r),0)},_e=e=>(_e=rr())(e),V={resolve:(...e)=>{for(var r="",t=!1,o=e.length-1;o>=-1&&!t;o--){var a=o>=0?e[o]:n.cwd();if(typeof a!="string")throw new TypeError("Arguments to path.resolve must be strings");if(!a)return"";r=a+"/"+r,t=y.isAbs(a)}return r=y.normalizeArray(r.split("/").filter(i=>!!i),!t).join("/"),(t?"/":"")+r||"."},relative:(e,r)=>{e=V.resolve(e).slice(1),r=V.resolve(r).slice(1);function t(d){for(var g=0;g<d.length&&d[g]==="";g++);for(var p=d.length-1;p>=0&&d[p]==="";p--);return g>p?[]:d.slice(g,p-g+1)}for(var o=t(e.split("/")),a=t(r.split("/")),i=Math.min(o.length,a.length),s=i,l=0;l<i;l++)if(o[l]!==a[l]){s=l;break}for(var f=[],l=s;l<o.length;l++)f.push("..");return f=f.concat(a.slice(s)),f.join("/")}},Ee=globalThis.TextDecoder&&new TextDecoder,tr=(e,r,t,o)=>{var a=r+t;if(o)return a;for(;e[r]&&!(r>=a);)++r;return r},K=(e,r=0,t,o)=>{var a=tr(e,r,t,o);if(a-r>16&&e.buffer&&Ee)return Ee.decode(e.subarray(r,a));for(var i="";r<a;){var s=e[r++];if(!(s&128)){i+=String.fromCharCode(s);continue}var l=e[r++]&63;if((s&224)==192){i+=String.fromCharCode((s&31)<<6|l);continue}var f=e[r++]&63;if((s&240)==224?s=(s&15)<<12|l<<6|f:s=(s&7)<<18|l<<12|f<<6|e[r++]&63,s<65536)i+=String.fromCharCode(s);else{var d=s-65536;i+=String.fromCharCode(55296|d>>10,56320|d&1023)}}return i},le=[],fe=e=>{for(var r=0,t=0;t<e.length;++t){var o=e.charCodeAt(t);o<=127?r++:o<=2047?r+=2:o>=55296&&o<=57343?(r+=4,++t):r+=3}return r},ke=(e,r,t,o)=>{if(!(o>0))return 0;for(var a=t,i=t+o-1,s=0;s<e.length;++s){var l=e.codePointAt(s);if(l<=127){if(t>=i)break;r[t++]=l}else if(l<=2047){if(t+1>=i)break;r[t++]=192|l>>6,r[t++]=128|l&63}else if(l<=65535){if(t+2>=i)break;r[t++]=224|l>>12,r[t++]=128|l>>6&63,r[t++]=128|l&63}else{if(t+3>=i)break;r[t++]=240|l>>18,r[t++]=128|l>>12&63,r[t++]=128|l>>6&63,r[t++]=128|l&63,s++}}return r[t]=0,t-a},de=(e,r,t)=>{var o=fe(e)+1,a=new Array(o),i=ke(e,a,0,a.length);return a.length=i,a},nr=()=>{if(!le.length){var e=null;if(C){var r=256,t=Buffer.alloc(r),o=0,a=process.stdin.fd;try{o=O.readSync(a,t,0,r)}catch(i){if(i.toString().includes("EOF"))o=0;else throw i}o>0&&(e=t.slice(0,o).toString("utf-8"))}else globalThis.window?.prompt&&(e=window.prompt("Input: "),e!==null&&(e+=`
2
+ `));if(!e)return null;le=de(e)}return le.shift()},W={ttys:[],init(){},shutdown(){},register(e,r){W.ttys[e]={input:[],output:[],ops:r},n.registerDevice(e,W.stream_ops)},stream_ops:{open(e){var r=W.ttys[e.node.rdev];if(!r)throw new n.ErrnoError(43);e.tty=r,e.seekable=!1},close(e){e.tty.ops.fsync(e.tty)},fsync(e){e.tty.ops.fsync(e.tty)},read(e,r,t,o,a){if(!e.tty||!e.tty.ops.get_char)throw new n.ErrnoError(60);for(var i=0,s=0;s<o;s++){var l;try{l=e.tty.ops.get_char(e.tty)}catch{throw new n.ErrnoError(29)}if(l===void 0&&i===0)throw new n.ErrnoError(6);if(l==null)break;i++,r[t+s]=l}return i&&(e.node.atime=Date.now()),i},write(e,r,t,o,a){if(!e.tty||!e.tty.ops.put_char)throw new n.ErrnoError(60);try{for(var i=0;i<o;i++)e.tty.ops.put_char(e.tty,r[t+i])}catch{throw new n.ErrnoError(29)}return o&&(e.node.mtime=e.node.ctime=Date.now()),i}},default_tty_ops:{get_char(e){return nr()},put_char(e,r){r===null||r===10?(X(K(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&(X(K(e.output)),e.output=[])},ioctl_tcgets(e){return{c_iflag:25856,c_oflag:5,c_cflag:191,c_lflag:35387,c_cc:[3,28,127,21,4,0,1,0,17,19,26,0,18,15,23,22,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]}},ioctl_tcsets(e,r,t){return 0},ioctl_tiocgwinsz(e){return[24,80]}},default_tty1_ops:{put_char(e,r){r===null||r===10?(x(K(e.output)),e.output=[]):r!=0&&e.output.push(r)},fsync(e){e.output?.length>0&&(x(K(e.output)),e.output=[])}}},q,or=(e,r)=>q.fill(0,e,e+r),be=(e,r)=>Math.ceil(e/r)*r,Se=e=>{e=be(e,65536);var r=Re(65536,e);return r&&or(r,e),r},u={ops_table:null,mount(e){return u.createNode(null,"/",16895,0)},createNode(e,r,t,o){if(n.isBlkdev(t)||n.isFIFO(t))throw new n.ErrnoError(63);u.ops_table||={dir:{node:{getattr:u.node_ops.getattr,setattr:u.node_ops.setattr,lookup:u.node_ops.lookup,mknod:u.node_ops.mknod,rename:u.node_ops.rename,unlink:u.node_ops.unlink,rmdir:u.node_ops.rmdir,readdir:u.node_ops.readdir,symlink:u.node_ops.symlink},stream:{llseek:u.stream_ops.llseek}},file:{node:{getattr:u.node_ops.getattr,setattr:u.node_ops.setattr},stream:{llseek:u.stream_ops.llseek,read:u.stream_ops.read,write:u.stream_ops.write,mmap:u.stream_ops.mmap,msync:u.stream_ops.msync}},link:{node:{getattr:u.node_ops.getattr,setattr:u.node_ops.setattr,readlink:u.node_ops.readlink},stream:{}},chrdev:{node:{getattr:u.node_ops.getattr,setattr:u.node_ops.setattr},stream:n.chrdev_stream_ops}};var a=n.createNode(e,r,t,o);return n.isDir(a.mode)?(a.node_ops=u.ops_table.dir.node,a.stream_ops=u.ops_table.dir.stream,a.contents={}):n.isFile(a.mode)?(a.node_ops=u.ops_table.file.node,a.stream_ops=u.ops_table.file.stream,a.usedBytes=0,a.contents=u.emptyFileContents??=new Uint8Array(0)):n.isLink(a.mode)?(a.node_ops=u.ops_table.link.node,a.stream_ops=u.ops_table.link.stream):n.isChrdev(a.mode)&&(a.node_ops=u.ops_table.chrdev.node,a.stream_ops=u.ops_table.chrdev.stream),a.atime=a.mtime=a.ctime=Date.now(),e&&(e.contents[r]=a,e.atime=e.mtime=e.ctime=a.atime),a},getFileDataAsTypedArray(e){return e.contents.subarray(0,e.usedBytes)},expandFileStorage(e,r){var t=e.contents.length;if(!(t>=r)){var o=1024*1024;r=Math.max(r,t*(t<o?2:1.125)>>>0),t&&(r=Math.max(r,256));var a=u.getFileDataAsTypedArray(e);e.contents=new Uint8Array(r),e.contents.set(a)}},resizeFileStorage(e,r){if(e.usedBytes!=r){var t=e.contents;e.contents=new Uint8Array(r),e.contents.set(t.subarray(0,Math.min(r,e.usedBytes))),e.usedBytes=r}},node_ops:{getattr(e){var r={};return r.dev=n.isChrdev(e.mode)?e.id:1,r.ino=e.id,r.mode=e.mode,r.nlink=1,r.uid=0,r.gid=0,r.rdev=e.rdev,n.isDir(e.mode)?r.size=4096:n.isFile(e.mode)?r.size=e.usedBytes:n.isLink(e.mode)?r.size=e.link.length:r.size=0,r.atime=new Date(e.atime),r.mtime=new Date(e.mtime),r.ctime=new Date(e.ctime),r.blksize=4096,r.blocks=Math.ceil(r.size/r.blksize),r},setattr(e,r){for(const t of["mode","atime","mtime","ctime"])r[t]!=null&&(e[t]=r[t]);r.size!==void 0&&u.resizeFileStorage(e,r.size)},lookup(e,r){throw u.doesNotExistError||(u.doesNotExistError=new n.ErrnoError(44),u.doesNotExistError.stack="<generic error, no stack>"),u.doesNotExistError},mknod(e,r,t,o){return u.createNode(e,r,t,o)},rename(e,r,t){var o;try{o=n.lookupNode(r,t)}catch{}if(o){if(n.isDir(e.mode))for(var a in o.contents)throw new n.ErrnoError(55);n.hashRemoveNode(o)}delete e.parent.contents[e.name],r.contents[t]=e,e.name=t,r.ctime=r.mtime=e.parent.ctime=e.parent.mtime=Date.now()},unlink(e,r){delete e.contents[r],e.ctime=e.mtime=Date.now()},rmdir(e,r){var t=n.lookupNode(e,r);for(var o in t.contents)throw new n.ErrnoError(55);delete e.contents[r],e.ctime=e.mtime=Date.now()},readdir(e){return[".","..",...Object.keys(e.contents)]},symlink(e,r,t){var o=u.createNode(e,r,41471,0);return o.link=t,o},readlink(e){if(!n.isLink(e.mode))throw new n.ErrnoError(28);return e.link}},stream_ops:{read(e,r,t,o,a){var i=e.node.contents;if(a>=e.node.usedBytes)return 0;var s=Math.min(e.node.usedBytes-a,o);return r.set(i.subarray(a,a+s),t),s},write(e,r,t,o,a,i){if(r.buffer===F.buffer&&(i=!1),!o)return 0;var s=e.node;return s.mtime=s.ctime=Date.now(),i?(s.contents=r.subarray(t,t+o),s.usedBytes=o):s.usedBytes===0&&a===0?(s.contents=r.slice(t,t+o),s.usedBytes=o):(u.expandFileStorage(s,a+o),s.contents.set(r.subarray(t,t+o),a),s.usedBytes=Math.max(s.usedBytes,a+o)),o},llseek(e,r,t){var o=r;if(t===1?o+=e.position:t===2&&n.isFile(e.node.mode)&&(o+=e.node.usedBytes),o<0)throw new n.ErrnoError(28);return o},mmap(e,r,t,o,a){if(!n.isFile(e.node.mode))throw new n.ErrnoError(43);var i,s,l=e.node.contents;if(!(a&2)&&l.buffer===F.buffer)s=!1,i=l.byteOffset;else{if(s=!0,i=Se(r),!i)throw new n.ErrnoError(48);l&&((t>0||t+r<l.length)&&(l.subarray?l=l.subarray(t,t+r):l=Array.prototype.slice.call(l,t,t+r)),F.set(l,i))}return{ptr:i,allocated:s}},msync(e,r,t,o,a){return u.stream_ops.write(e,r,0,o,t,!1),0}}},ar=e=>{if(typeof e!="string")return e;var r={r:0,"r+":2,w:577,"w+":578,a:1089,"a+":1090},t=r[e];if(typeof t>"u")throw new Error(`Unknown file open mode: ${e}`);return t},Fe=e=>(typeof e=="string"&&(e=de(e)),e.subarray||(e=new Uint8Array(e)),e),ce=(e,r)=>{var t=0;return e&&(t|=365),r&&(t|=146),t},ir=async e=>{var r=await A(e);return new Uint8Array(r)},sr=(...e)=>n.createDataFile(...e),De=null,lr=async()=>De,Q=0,Ae=null,fr=e=>{Q--,Q||Ae()},dr=e=>{Q||(De=new Promise(r=>Ae=r)),Q++},cr=[],ur=async(e,r)=>{typeof Browser<"u"&&Browser.init();for(var t of cr)if(t.canHandle(r))return t.handle(e,r);return e},Pe=async(e,r,t,o,a,i,s,l)=>{var f=r?V.resolve(y.join2(e,r)):e;dr();try{var d=t;typeof t=="string"&&(d=await ir(t)),d=await ur(d,f),l?.(),i||sr(e,r,d,o,a,s)}finally{fr()}},vr=(e,r,t,o,a,i,s,l,f,d)=>{Pe(e,r,t,o,a,l,f,d).then(i).catch(s)},n={root:null,mounts:[],devices:{},streams:[],nextInode:1,nameTable:null,currentPath:"/",initialized:!1,ignorePermissions:!0,filesystems:null,syncFSRequests:0,ErrnoError:class{name="ErrnoError";constructor(e){this.errno=e}},FSStream:class{shared={};get object(){return this.node}set object(e){this.node=e}get isRead(){return(this.flags&2097155)!==1}get isWrite(){return(this.flags&2097155)!==0}get isAppend(){return this.flags&1024}get flags(){return this.shared.flags}set flags(e){this.shared.flags=e}get position(){return this.shared.position}set position(e){this.shared.position=e}},FSNode:class{node_ops={};stream_ops={};readMode=365;writeMode=146;mounted=null;constructor(e,r,t,o){e||(e=this),this.parent=e,this.mount=e.mount,this.id=n.nextInode++,this.name=r,this.mode=t,this.rdev=o,this.atime=this.mtime=this.ctime=Date.now()}get read(){return(this.mode&this.readMode)===this.readMode}set read(e){e?this.mode|=this.readMode:this.mode&=~this.readMode}get write(){return(this.mode&this.writeMode)===this.writeMode}set write(e){e?this.mode|=this.writeMode:this.mode&=~this.writeMode}get isFolder(){return n.isDir(this.mode)}get isDevice(){return n.isChrdev(this.mode)}addListener(e,r=!1){var t={cb:e,exclusive:r},o=this.listeners??=new Set;return o.add(t),{listeners:o,entry:t}}notifyListeners(e){if(this.listeners){var r;for(var t of this.listeners)t.exclusive?(r||=[]).push(t):t.cb(e);if(r){var o=(this.exclTurn||0)%r.length;this.exclTurn=o+1,r[o].cb(e)}}}},lookupPath(e,r={}){if(!e)throw new n.ErrnoError(44);r.follow_mount??=!0,y.isAbs(e)||(e=n.cwd()+"/"+e);e:for(var t=0;t<40;t++){for(var o=e.split("/").filter(d=>!!d),a=n.root,i="/",s=0;s<o.length;s++){var l=s===o.length-1;if(l&&r.parent)break;if(o[s]!=="."){if(o[s]===".."){if(i=y.dirname(i),n.isRoot(a)){e=i+"/"+o.slice(s+1).join("/"),t--;continue e}else a=a.parent;continue}i=y.join2(i,o[s]);try{a=n.lookupNode(a,o[s])}catch(d){if(d?.errno===44&&l&&r.noent_okay)return{path:i};throw d}if(n.isMountpoint(a)&&(!l||r.follow_mount)&&(a=a.mounted.root),n.isLink(a.mode)&&(!l||r.follow)){if(!a.node_ops.readlink)throw new n.ErrnoError(52);var f=a.node_ops.readlink(a);y.isAbs(f)||(f=y.dirname(i)+"/"+f),e=f+"/"+o.slice(s+1).join("/");continue e}}}return{path:i,node:a}}throw new n.ErrnoError(32)},getPath(e){for(var r;;){if(n.isRoot(e)){var t=e.mount.mountpoint;return r?t[t.length-1]!=="/"?`${t}/${r}`:t+r:t}r=r?`${e.name}/${r}`:e.name,e=e.parent}},hashName(e,r){for(var t=0,o=0;o<r.length;o++)t=(t<<5)-t+r.charCodeAt(o)|0;return(e+t>>>0)%n.nameTable.length},hashAddNode(e){var r=n.hashName(e.parent.id,e.name);e.name_next=n.nameTable[r],n.nameTable[r]=e},hashRemoveNode(e){var r=n.hashName(e.parent.id,e.name);if(n.nameTable[r]===e)n.nameTable[r]=e.name_next;else for(var t=n.nameTable[r];t;){if(t.name_next===e){t.name_next=e.name_next;break}t=t.name_next}},lookupNode(e,r){var t=n.mayLookup(e);if(t)throw new n.ErrnoError(t);for(var o=n.hashName(e.id,r),a=n.nameTable[o];a;a=a.name_next){var i=a.name;if(a.parent.id===e.id&&i===r)return a}return n.lookup(e,r)},createNode(e,r,t,o){var a=new n.FSNode(e,r,t,o);return n.hashAddNode(a),a},destroyNode(e){n.hashRemoveNode(e)},isRoot(e){return e===e.parent},isMountpoint(e){return!!e.mounted},isFile(e){return(e&61440)===32768},isDir(e){return(e&61440)===16384},isLink(e){return(e&61440)===40960},isChrdev(e){return(e&61440)===8192},isBlkdev(e){return(e&61440)===24576},isFIFO(e){return(e&61440)===4096},isSocket(e){return(e&49152)===49152},flagsToPermissionString(e){var r=["r","w","rw"][e&3];return e&512&&(r+="w"),r},nodePermissions(e,r){return n.ignorePermissions?0:r.includes("r")&&!(e.mode&292)||r.includes("w")&&!(e.mode&146)||r.includes("x")&&!(e.mode&73)?2:0},mayLookup(e){if(!n.isDir(e.mode))return 54;var r=n.nodePermissions(e,"x");return r||(e.node_ops.lookup?0:2)},mayCreate(e,r){if(!n.isDir(e.mode))return 54;try{var t=n.lookupNode(e,r);return 20}catch{}return n.nodePermissions(e,"wx")},mayDelete(e,r,t){var o;try{o=n.lookupNode(e,r)}catch(i){return i.errno}var a=n.nodePermissions(e,"wx");if(a)return a;if(t){if(!n.isDir(o.mode))return 54;if(n.isRoot(o)||n.getPath(o)===n.cwd())return 10}else if(n.isDir(o.mode))return 31;return 0},mayOpen(e,r){if(!e)return 44;if(n.isLink(e.mode))return 32;var t=n.flagsToPermissionString(r);return n.isDir(e.mode)&&(t!=="r"||r&576)?31:n.nodePermissions(e,t)},checkOpExists(e,r){if(!e)throw new n.ErrnoError(r);return e},MAX_OPEN_FDS:4096,nextfd(){for(var e=0;e<=n.MAX_OPEN_FDS;e++)if(!n.streams[e])return e;throw new n.ErrnoError(33)},getStreamChecked(e){var r=n.getStream(e);if(!r)throw new n.ErrnoError(8);return r},getStream:e=>n.streams[e],createStream(e,r=-1){return e=Object.assign(new n.FSStream,e),r==-1&&(r=n.nextfd()),e.fd=r,n.streams[r]=e,e},closeStream(e){n.streams[e]=null},dupStream(e,r=-1){var t=n.createStream(e,r);return t.stream_ops?.dup?.(t),t},doSetAttr(e,r,t){var o=e?.stream_ops.setattr,a=o?e:r;o??=r.node_ops.setattr,n.checkOpExists(o,63);try{o(a,t)}catch(i){throw i instanceof RangeError?new n.ErrnoError(22):i}},chrdev_stream_ops:{open(e){var r=n.getDevice(e.node.rdev);e.stream_ops=r.stream_ops,e.stream_ops.open?.(e)},llseek(){throw new n.ErrnoError(70)}},major:e=>e>>8,minor:e=>e&255,makedev:(e,r)=>e<<8|r,registerDevice(e,r){n.devices[e]={stream_ops:r}},getDevice:e=>n.devices[e],getMounts(e){for(var r=[],t=[e];t.length;){var o=t.pop();r.push(o),t.push(...o.mounts)}return r},syncfs(e,r){typeof e=="function"&&(r=e,e=!1),n.syncFSRequests++,n.syncFSRequests>1&&x(`warning: ${n.syncFSRequests} FS.syncfs operations in flight at once, probably just doing extra work`);var t=n.getMounts(n.root.mount),o=0;function a(l){return n.syncFSRequests--,r(l)}function i(l){if(l)return i.errored?void 0:(i.errored=!0,a(l));++o>=t.length&&a(null)}for(var s of t)s.type.syncfs?s.type.syncfs(s,e,i):i(null)},mount(e,r,t){var o=t==="/",a=!t,i;if(o&&n.root)throw new n.ErrnoError(10);if(!o&&!a){var s=n.lookupPath(t,{follow_mount:!1});if(t=s.path,i=s.node,n.isMountpoint(i))throw new n.ErrnoError(10);if(!n.isDir(i.mode))throw new n.ErrnoError(54)}var l={type:e,opts:r,mountpoint:t,mounts:[]},f=e.mount(l);return f.mount=l,l.root=f,o?n.root=f:i&&(i.mounted=l,i.mount&&i.mount.mounts.push(l)),f},unmount(e){var r=n.lookupPath(e,{follow_mount:!1});if(!n.isMountpoint(r.node))throw new n.ErrnoError(28);var t=r.node,o=t.mounted,a=n.getMounts(o);for(var[i,s]of Object.entries(n.nameTable))for(;s;){var l=s.name_next;a.includes(s.mount)&&n.destroyNode(s),s=l}t.mounted=null;var f=t.mount.mounts.indexOf(o);t.mount.mounts.splice(f,1)},lookup(e,r){return e.node_ops.lookup(e,r)},mknod(e,r,t){var o=n.lookupPath(e,{parent:!0}),a=o.node,i=y.basename(e);if(!i)throw new n.ErrnoError(28);if(i==="."||i==="..")throw new n.ErrnoError(20);var s=n.mayCreate(a,i);if(s)throw new n.ErrnoError(s);if(!a.node_ops.mknod)throw new n.ErrnoError(63);return a.node_ops.mknod(a,i,r,t)},statfs(e){return n.statfsNode(n.lookupPath(e,{follow:!0}).node)},statfsStream(e){return n.statfsNode(e.node)},statfsNode(e){var r={bsize:4096,frsize:4096,blocks:1e6,bfree:5e5,bavail:5e5,files:n.nextInode,ffree:n.nextInode-1,fsid:42,flags:2,namelen:255};return e.node_ops.statfs&&Object.assign(r,e.node_ops.statfs(e.mount.opts.root)),r},create(e,r=438){return r&=4095,r|=32768,n.mknod(e,r,0)},mkdir(e,r=511){return r&=1023,r|=16384,n.mknod(e,r,0)},mkdirTree(e,r){var t=e.split("/"),o="";for(var a of t)if(a){(o||y.isAbs(e))&&(o+="/"),o+=a;try{n.mkdir(o,r)}catch(i){if(i.errno!=20)throw i}}},mkdev(e,r,t){return typeof t>"u"&&(t=r,r=438),r|=8192,n.mknod(e,r,t)},symlink(e,r){if(!V.resolve(e))throw new n.ErrnoError(44);var t=n.lookupPath(r,{parent:!0}),o=t.node;if(!o)throw new n.ErrnoError(44);var a=y.basename(r),i=n.mayCreate(o,a);if(i)throw new n.ErrnoError(i);if(!o.node_ops.symlink)throw new n.ErrnoError(63);return o.node_ops.symlink(o,a,e)},link(e,r,t){var o=n.lookupPath(r,{parent:!0}),a=o.node;if(!a)throw new n.ErrnoError(44);var i=y.basename(r),s=n.mayCreate(a,i);if(s)throw new n.ErrnoError(s);if(!a.node_ops.link)throw new n.ErrnoError(34);return a.node_ops.link(a,i,e,t)},rename(e,r){var t=y.dirname(e),o=y.dirname(r),a=y.basename(e),i=y.basename(r),s,l,f;if(s=n.lookupPath(e,{parent:!0}),l=s.node,s=n.lookupPath(r,{parent:!0}),f=s.node,!l||!f)throw new n.ErrnoError(44);if(l.mount!==f.mount)throw new n.ErrnoError(75);var d=n.lookupNode(l,a),g=V.relative(e,o);if(g.charAt(0)!==".")throw new n.ErrnoError(28);if(g=V.relative(r,t),g.charAt(0)!==".")throw new n.ErrnoError(55);var p;try{p=n.lookupNode(f,i)}catch{}if(d!==p){var v=n.isDir(d.mode),h=n.mayDelete(l,a,v);if(h)throw new n.ErrnoError(h);if(h=p?n.mayDelete(f,i,v):n.mayCreate(f,i),h)throw new n.ErrnoError(h);if(!l.node_ops.rename)throw new n.ErrnoError(63);if(n.isMountpoint(d)||p&&n.isMountpoint(p))throw new n.ErrnoError(10);if(f!==l&&(h=n.nodePermissions(l,"w"),h))throw new n.ErrnoError(h);n.hashRemoveNode(d);try{l.node_ops.rename(d,f,i),d.parent=f}catch(m){throw m}finally{n.hashAddNode(d)}}},rmdir(e){var r=n.lookupPath(e,{parent:!0}),t=r.node,o=y.basename(e),a=n.lookupNode(t,o),i=n.mayDelete(t,o,!0);if(i)throw new n.ErrnoError(i);if(!t.node_ops.rmdir)throw new n.ErrnoError(63);if(n.isMountpoint(a))throw new n.ErrnoError(10);t.node_ops.rmdir(t,o),n.destroyNode(a)},readdir(e){var r=n.lookupPath(e,{follow:!0}),t=r.node,o=n.checkOpExists(t.node_ops.readdir,54);return o(t)},unlink(e){var r=n.lookupPath(e,{parent:!0}),t=r.node;if(!t)throw new n.ErrnoError(44);var o=y.basename(e),a=n.lookupNode(t,o),i=n.mayDelete(t,o,!1);if(i)throw new n.ErrnoError(i);if(!t.node_ops.unlink)throw new n.ErrnoError(63);if(n.isMountpoint(a))throw new n.ErrnoError(10);t.node_ops.unlink(t,o),n.destroyNode(a)},readlink(e){var r=n.lookupPath(e),t=r.node;if(!t)throw new n.ErrnoError(44);if(!t.node_ops.readlink)throw new n.ErrnoError(28);return t.node_ops.readlink(t)},stat(e,r){var t=n.lookupPath(e,{follow:!r}),o=t.node,a=n.checkOpExists(o.node_ops.getattr,63);return a(o)},fstat(e){var r=n.getStreamChecked(e),t=r.node,o=r.stream_ops.getattr,a=o?r:t;return o??=t.node_ops.getattr,n.checkOpExists(o,63),o(a)},lstat(e){return n.stat(e,!0)},doChmod(e,r,t,o){n.doSetAttr(e,r,{mode:t&4095|r.mode&-4096,ctime:Date.now(),dontFollow:o})},chmod(e,r,t){var o;if(typeof e=="string"){var a=n.lookupPath(e,{follow:!t});o=a.node}else o=e;n.doChmod(null,o,r,t)},lchmod(e,r){n.chmod(e,r,!0)},fchmod(e,r){var t=n.getStreamChecked(e);n.doChmod(t,t.node,r,!1)},doChown(e,r,t){n.doSetAttr(e,r,{timestamp:Date.now(),dontFollow:t})},chown(e,r,t,o){var a;if(typeof e=="string"){var i=n.lookupPath(e,{follow:!o});a=i.node}else a=e;n.doChown(null,a,o)},lchown(e,r,t){n.chown(e,r,t,!0)},fchown(e,r,t){var o=n.getStreamChecked(e);n.doChown(o,o.node,!1)},doTruncate(e,r,t){if(n.isDir(r.mode))throw new n.ErrnoError(31);if(!n.isFile(r.mode))throw new n.ErrnoError(28);var o=n.nodePermissions(r,"w");if(o)throw new n.ErrnoError(o);n.doSetAttr(e,r,{size:t,timestamp:Date.now()})},truncate(e,r){if(r<0)throw new n.ErrnoError(28);var t;if(typeof e=="string"){var o=n.lookupPath(e,{follow:!0});t=o.node}else t=e;n.doTruncate(null,t,r)},ftruncate(e,r){var t=n.getStreamChecked(e);if(r<0||(t.flags&2097155)===0)throw new n.ErrnoError(28);n.doTruncate(t,t.node,r)},utime(e,r,t,o){var a=n.lookupPath(e,{follow:!o});n.doSetAttr(null,a.node,{atime:r,mtime:t,dontFollow:o})},open(e,r,t=438){if(e==="")throw new n.ErrnoError(44);r=ar(r),r&64?t=t&4095|32768:t=0;var o,a;if(typeof e=="object")o=e;else{a=e.endsWith("/");var i=n.lookupPath(e,{follow:!(r&131072),noent_okay:!0});o=i.node,e=i.path}var s=!1;if(r&64)if(o){if(r&128)throw new n.ErrnoError(20)}else{if(a)throw new n.ErrnoError(31);o=n.mknod(e,t|511,0),s=!0}if(!o)throw new n.ErrnoError(44);if(n.isChrdev(o.mode)&&(r&=-513),r&65536&&!n.isDir(o.mode))throw new n.ErrnoError(54);if(!s){var l=n.mayOpen(o,r);if(l)throw new n.ErrnoError(l)}r&512&&!s&&n.truncate(o,0),r&=-131713;var f=n.createStream({node:o,path:n.getPath(o),flags:r,seekable:!0,position:0,stream_ops:o.stream_ops,ungotten:[],error:!1});return f.stream_ops.open&&f.stream_ops.open(f),s&&n.chmod(o,t&511),f},close(e){if(n.isClosed(e))throw new n.ErrnoError(8);e.getdents&&(e.getdents=null),e.node?.notifyListeners(32);try{e.stream_ops.close&&e.stream_ops.close(e)}catch(r){throw r}finally{n.closeStream(e.fd)}e.fd=null},isClosed(e){return e.fd===null},llseek(e,r,t){if(n.isClosed(e))throw new n.ErrnoError(8);if(!e.seekable||!e.stream_ops.llseek)throw new n.ErrnoError(70);if(t!=0&&t!=1&&t!=2)throw new n.ErrnoError(28);return e.position=e.stream_ops.llseek(e,r,t),e.ungotten=[],e.position},read(e,r,t,o,a){if(o<0||a<0)throw new n.ErrnoError(28);if(n.isClosed(e))throw new n.ErrnoError(8);if((e.flags&2097155)===1)throw new n.ErrnoError(8);if(n.isDir(e.node.mode))throw new n.ErrnoError(31);if(!e.stream_ops.read)throw new n.ErrnoError(28);var i=typeof a<"u";if(!i)a=e.position;else if(!e.seekable)throw new n.ErrnoError(70);var s=e.stream_ops.read(e,r,t,o,a);return i||(e.position+=s),s},write(e,r,t,o,a,i){if(o<0||a<0)throw new n.ErrnoError(28);if(n.isClosed(e))throw new n.ErrnoError(8);if((e.flags&2097155)===0)throw new n.ErrnoError(8);if(n.isDir(e.node.mode))throw new n.ErrnoError(31);if(!e.stream_ops.write)throw new n.ErrnoError(28);e.seekable&&e.flags&1024&&n.llseek(e,0,2);var s=typeof a<"u";if(!s)a=e.position;else if(!e.seekable)throw new n.ErrnoError(70);var l=e.stream_ops.write(e,r,t,o,a,i);return s||(e.position+=l),l},mmap(e,r,t,o,a){if((o&2)!==0&&(a&2)===0&&(e.flags&2097155)!==2)throw new n.ErrnoError(2);if((e.flags&2097155)===1)throw new n.ErrnoError(2);if(!e.stream_ops.mmap)throw new n.ErrnoError(43);if(!r)throw new n.ErrnoError(28);return e.stream_ops.mmap(e,r,t,o,a)},msync(e,r,t,o,a){return e.stream_ops.msync?e.stream_ops.msync(e,r,t,o,a):0},ioctl(e,r,t){if(!e.stream_ops.ioctl)throw new n.ErrnoError(59);return e.stream_ops.ioctl(e,r,t)},readFile(e,r={}){r.flags=r.flags??0,r.encoding=r.encoding??"binary",r.encoding!=="utf8"&&r.encoding!=="binary"&&R(`Invalid encoding type "${r.encoding}"`);var t=n.open(e,r.flags),o=n.stat(e),a=o.size,i=new Uint8Array(a);return n.read(t,i,0,a,0),r.encoding==="utf8"&&(i=K(i)),n.close(t),i},writeFile(e,r,t={}){t.flags=t.flags??577;var o=n.open(e,t.flags,t.mode);r=Fe(r),n.write(o,r,0,r.byteLength,void 0,t.canOwn),n.close(o)},cwd:()=>n.currentPath,chdir(e){var r=n.lookupPath(e,{follow:!0});if(r.node===null)throw new n.ErrnoError(44);if(!n.isDir(r.node.mode))throw new n.ErrnoError(54);var t=n.nodePermissions(r.node,"x");if(t)throw new n.ErrnoError(t);n.currentPath=r.path},createDefaultDirectories(){n.mkdir("/tmp"),n.mkdir("/home"),n.mkdir("/home/web_user")},createDefaultDevices(){n.mkdir("/dev"),n.registerDevice(n.makedev(1,3),{read:()=>0,write:(o,a,i,s,l)=>s,llseek:()=>0}),n.mkdev("/dev/null",n.makedev(1,3)),W.register(n.makedev(5,0),W.default_tty_ops),W.register(n.makedev(6,0),W.default_tty1_ops),n.mkdev("/dev/tty",n.makedev(5,0)),n.mkdev("/dev/tty1",n.makedev(6,0));var e=new Uint8Array(1024),r=0,t=()=>(r===0&&(_e(e),r=e.byteLength),e[--r]);n.createDevice("/dev","random",t),n.createDevice("/dev","urandom",t),n.mkdir("/dev/shm"),n.mkdir("/dev/shm/tmp")},createSpecialDirectories(){n.mkdir("/proc");var e=n.mkdir("/proc/self");n.mkdir("/proc/self/fd"),n.mount({mount(){var r=n.createNode(e,"fd",16895,73);return r.stream_ops={llseek:u.stream_ops.llseek},r.node_ops={lookup(t,o){var a=+o,i=n.getStreamChecked(a),s={parent:null,mount:{mountpoint:"fake"},node_ops:{readlink:()=>i.path},id:a+1};return s.parent=s,s},readdir(){return Array.from(n.streams.entries()).filter(([t,o])=>o).map(([t,o])=>t.toString())}},r}},{},"/proc/self/fd")},createStandardStreams(e,r,t){e?n.createDevice("/dev","stdin",e):n.symlink("/dev/tty","/dev/stdin"),r?n.createDevice("/dev","stdout",null,r):n.symlink("/dev/tty","/dev/stdout"),t?n.createDevice("/dev","stderr",null,t):n.symlink("/dev/tty1","/dev/stderr"),n.open("/dev/stdin",0),n.open("/dev/stdout",1),n.open("/dev/stderr",1)},staticInit(){n.nameTable=new Array(4096),n.mount(u,{},"/"),n.createDefaultDirectories(),n.createDefaultDevices(),n.createSpecialDirectories(),n.filesystems={MEMFS:u}},init(e,r,t){n.initialized=!0,n.createStandardStreams(e,r,t)},quit(){n.initialized=!1;for(var e of n.streams)e&&n.close(e)},findObject(e,r){var t=n.analyzePath(e,r);return t.exists?t.object:null},analyzePath(e,r){try{var t=n.lookupPath(e,{follow:!r});e=t.path}catch{}var o={isRoot:!1,exists:!1,error:0,name:null,path:null,object:null,parentExists:!1,parentPath:null,parentObject:null};try{var t=n.lookupPath(e,{parent:!0});o.parentExists=!0,o.parentPath=t.path,o.parentObject=t.node,o.name=y.basename(e),t=n.lookupPath(e,{follow:!r}),o.exists=!0,o.path=t.path,o.object=t.node,o.name=t.node.name,o.isRoot=t.path==="/"}catch(a){o.error=a.errno}return o},createPath(e,r,t,o){e=typeof e=="string"?e:n.getPath(e);for(var a=r.split("/").reverse();a.length;){var i=a.pop();if(i){var s=y.join2(e,i);try{n.mkdir(s)}catch(l){if(l.errno!=20)throw l}e=s}}return s},createFile(e,r,t,o,a){var i=y.join2(typeof e=="string"?e:n.getPath(e),r),s=ce(o,a);return n.create(i,s)},createDataFile(e,r,t,o,a,i){var s=r;e&&(e=typeof e=="string"?e:n.getPath(e),s=r?y.join2(e,r):e);var l=ce(o,a),f=n.create(s,l);if(t){t=Fe(t),n.chmod(f,l|146);var d=n.open(f,577);n.write(d,t,0,t.length,0,i),n.close(d),n.chmod(f,l)}},createDevice(e,r,t,o){var a=y.join2(typeof e=="string"?e:n.getPath(e),r),i=ce(!!t,!!o);n.createDevice.major??=64;var s=n.makedev(n.createDevice.major++,0);return n.registerDevice(s,{open(l){l.seekable=!1},close(l){o?.buffer?.length&&o(10)},read(l,f,d,g,p){for(var v=0,h=0;h<g;h++){var m;try{m=t()}catch{throw new n.ErrnoError(29)}if(m===void 0&&v===0)throw new n.ErrnoError(6);if(m==null)break;v++,f[d+h]=m}return v&&(l.node.atime=Date.now()),v},write(l,f,d,g,p){for(var v=0;v<g;v++)try{o(f[d+v])}catch{throw new n.ErrnoError(29)}return g&&(l.node.mtime=l.node.ctime=Date.now()),v}}),n.mkdev(a,i,s)},forceLoadFile(e){if(e.isDevice||e.isFolder||e.link||e.contents)return!0;if(globalThis.XMLHttpRequest)R("Lazy loading should have been performed (contents set) in createLazyFile, but it was not. Lazy loading only works in web workers. Use --embed-file or --preload-file in emcc on the main thread.");else try{e.contents=S(e.url)}catch{throw new n.ErrnoError(29)}},createLazyFile(e,r,t,o,a){class i{lengthKnown=!1;chunks=[];get(v){if(!(v>this.length-1||v<0)){var h=v%this.chunkSize,m=v/this.chunkSize|0;return this.getter(m)[h]}}setDataGetter(v){this.getter=v}cacheLength(){var v=new XMLHttpRequest;v.open("HEAD",t,!1),v.send(null),v.status>=200&&v.status<300||v.status===304||R(`Couldn't load ${t}. Status: ${v.status}`);var h=Number(v.getResponseHeader("Content-length")),m,b=(m=v.getResponseHeader("Accept-Ranges"))&&m==="bytes",z=(m=v.getResponseHeader("Content-Encoding"))&&m==="gzip",U=1024*1024;b||(U=h);var L=(H,Y)=>{H>Y&&R(`invalid range (${H}, ${Y}) or no bytes requested!`),Y>h-1&&R(`only ${h} bytes available! programmer error!`);var k=new XMLHttpRequest;return k.open("GET",t,!1),h!==U&&k.setRequestHeader("Range",`bytes=${H}-${Y}`),k.responseType="arraybuffer",k.overrideMimeType&&k.overrideMimeType("text/plain; charset=x-user-defined"),k.send(null),k.status>=200&&k.status<300||k.status===304||R(`Couldn't load ${t}. Status: ${k.status}`),k.response!==void 0?new Uint8Array(k.response||[]):de(k.responseText??"")},re=this;re.setDataGetter(H=>{var Y=H*U,k=(H+1)*U-1;return k=Math.min(k,h-1),typeof re.chunks[H]>"u"&&(re.chunks[H]=L(Y,k)),typeof re.chunks[H]>"u"&&R("doXHR failed!"),re.chunks[H]}),(z||!h)&&(U=h=1,h=this.getter(0).length,U=h,X("LazyFiles on gzip forces download of the whole file when length is accessed")),this._length=h,this._chunkSize=U,this.lengthKnown=!0}get length(){return this.lengthKnown||this.cacheLength(),this._length}get chunkSize(){return this.lengthKnown||this.cacheLength(),this._chunkSize}}if(globalThis.XMLHttpRequest){N||R("Cannot do synchronous binary XHRs outside webworkers in modern browsers. Use --embed-file or --preload-file in emcc");var s=new i,l={isDevice:!1,contents:s}}else var l={isDevice:!1,url:t};var f=n.createFile(e,r,l,o,a);l.contents?f.contents=l.contents:l.url&&(f.contents=null,f.url=l.url),Object.defineProperties(f,{usedBytes:{get:function(){return this.contents.length}}});var d={};for(const[p,v]of Object.entries(f.stream_ops))d[p]=(...h)=>(n.forceLoadFile(f),v(...h));function g(p,v,h,m,b){var z=p.node.contents;if(b>=z.length)return 0;var U=Math.min(z.length-b,m);if(z.slice)for(var L=0;L<U;L++)v[h+L]=z[b+L];else for(var L=0;L<U;L++)v[h+L]=z.get(b+L);return U}return d.read=(p,v,h,m,b)=>(n.forceLoadFile(f),g(p,v,h,m,b)),d.mmap=(p,v,h,m,b)=>{n.forceLoadFile(f);var z=Se(v);if(!z)throw new n.ErrnoError(48);return g(p,F,z,v,h),{ptr:z,allocated:!0}},f.stream_ops=d,f}},ue=(e,r,t)=>e?K(q,e,r,t):"",M,_={currentUmask:18,calculateAt(e,r,t){if(y.isAbs(r))return r;var o;if(e===-100)o=n.cwd();else{var a=_.getStreamFromFD(e);o=a.path}if(r.length==0){if(!t)throw new n.ErrnoError(44);return o}return o+"/"+r},writeStat(e,r){w[e>>2]=r.dev,w[e+4>>2]=r.mode,w[e+8>>2]=r.nlink,w[e+12>>2]=r.uid,w[e+16>>2]=r.gid,w[e+20>>2]=r.rdev,M[e+24>>3]=BigInt(r.size),P[e+32>>2]=4096,P[e+36>>2]=r.blocks;var t=r.atime.getTime(),o=r.mtime.getTime(),a=r.ctime.getTime();return M[e+40>>3]=BigInt(Math.floor(t/1e3)),w[e+48>>2]=t%1e3*1e3*1e3,M[e+56>>3]=BigInt(Math.floor(o/1e3)),w[e+64>>2]=o%1e3*1e3*1e3,M[e+72>>3]=BigInt(Math.floor(a/1e3)),w[e+80>>2]=a%1e3*1e3*1e3,M[e+88>>3]=BigInt(r.ino),0},writeStatFs(e,r){w[e+4>>2]=r.bsize,w[e+60>>2]=r.bsize,M[e+8>>3]=BigInt(r.blocks),M[e+16>>3]=BigInt(r.bfree),M[e+24>>3]=BigInt(r.bavail),M[e+32>>3]=BigInt(r.files),M[e+40>>3]=BigInt(r.ffree),w[e+48>>2]=r.fsid,w[e+64>>2]=r.flags,w[e+56>>2]=r.namelen},doMsync(e,r,t,o,a){if(!n.isFile(r.node.mode))throw new n.ErrnoError(43);if(o&2)return 0;var i=q.subarray(e,e+t);n.msync(r,i,a,t,o)},getStreamFromFD(e){var r=n.getStreamChecked(e);return r},varargs:void 0,getStr(e){var r=ue(e);return r}},oe;function hr(e,r,t){_.varargs=t;try{var o=_.getStreamFromFD(e);switch(r){case 0:{var a=ne();if(a<0)return-28;for(;n.streams[a];)a++;var i;return i=n.dupStream(o,a),i.fd}case 1:case 2:return 0;case 3:return o.flags;case 4:{var a=ne(),s=289792;return o.flags=o.flags&~s|a&s,0}case 12:{var a=G(),l=0;return oe[a+l>>1]=2,0}case 13:case 14:return 0}return-28}catch(f){if(typeof n>"u"||f.name!=="ErrnoError")throw f;return-f.errno}}function mr(e,r,t){_.varargs=t;try{var o=_.getStreamFromFD(e);switch(r){case 21509:return o.tty?0:-59;case 21505:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tcgets){var a=o.tty.ops.ioctl_tcgets(o),i=G();P[i>>2]=a.c_iflag||0,P[i+4>>2]=a.c_oflag||0,P[i+8>>2]=a.c_cflag||0,P[i+12>>2]=a.c_lflag||0;for(var s=0;s<32;s++)F[i+s+17]=a.c_cc[s]||0;return 0}return 0}case 21510:case 21511:case 21512:return o.tty?0:-59;case 21506:case 21507:case 21508:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tcsets){for(var i=G(),l=P[i>>2],f=P[i+4>>2],d=P[i+8>>2],g=P[i+12>>2],p=[],s=0;s<32;s++)p.push(F[i+s+17]);return o.tty.ops.ioctl_tcsets(o.tty,r,{c_iflag:l,c_oflag:f,c_cflag:d,c_lflag:g,c_cc:p})}return 0}case 21519:{if(!o.tty)return-59;var i=G();return P[i>>2]=0,0}case 21520:return o.tty?-28:-59;case 21537:case 21531:{var i=G();return n.ioctl(o,r,i)}case 21523:{if(!o.tty)return-59;if(o.tty.ops.ioctl_tiocgwinsz){var v=o.tty.ops.ioctl_tiocgwinsz(o.tty),i=G();oe[i>>1]=v[0],oe[i+2>>1]=v[1]}return 0}case 21524:return o.tty?0:-59;case 21515:return o.tty?0:-59;default:return-28}}catch(h){if(typeof n>"u"||h.name!=="ErrnoError")throw h;return-h.errno}}function wr(e,r,t,o){_.varargs=o;try{r=_.getStr(r),r=_.calculateAt(e,r);var a=o?ne():0;return t&64&&(a&=~_.currentUmask),n.open(r,t,a).fd}catch(i){if(typeof n>"u"||i.name!=="ErrnoError")throw i;return-i.errno}}function gr(e){try{return e=_.getStr(e),n.rmdir(e),0}catch(r){if(typeof n>"u"||r.name!=="ErrnoError")throw r;return-r.errno}}function yr(e,r,t){try{if(r=_.getStr(r),r=_.calculateAt(e,r),!t)n.unlink(r);else if(t===512)n.rmdir(r);else return-28;return 0}catch(o){if(typeof n>"u"||o.name!=="ErrnoError")throw o;return-o.errno}}var pr=()=>R(""),_r=9007199254740992,Er=-9007199254740992,Me=e=>e<Er||e>_r?NaN:Number(e);function kr(e,r,t,o,a,i){i=Me(i);try{var s=_.getStreamFromFD(a);t&2&&_.doMsync(e,s,r,o,i)}catch(l){if(typeof n>"u"||l.name!=="ErrnoError")throw l;return-l.errno}}var Te=(e,r,t)=>ke(e,q,r,t),br=()=>performance.now(),Sr=()=>Date.now(),Fr=e=>e>=0&&e<=3;function Dr(e,r,t){if(!Fr(e))return 28;var o;e===0?o=Sr():o=br();var a=Math.round(o*1e3*1e3);return M[t>>3]=BigInt(a),0}var Ar=()=>2147483648,Pr=e=>{var r=ae.buffer.byteLength,t=(e-r+65535)/65536|0;try{return ae.grow(t),pe(),1}catch{}},Mr=e=>{var r=q.length;e>>>=0;var t=Ar();if(e>t)return!1;for(var o=1;o<=4;o*=2){var a=r*(1+.2/o);a=Math.min(a,e+100663296);var i=Math.min(t,be(Math.max(e,a),65536)),s=Pr(i);if(s)return!0}return!1},ve={},Tr=()=>j,Z=()=>{if(!Z.strings){var e=(globalThis.navigator?.language??"C").replace("-","_")+".UTF-8",r={USER:"web_user",LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:e,_:Tr()};for(var t in ve)ve[t]===void 0?delete r[t]:r[t]=ve[t];var o=[];for(var t in r)o.push(`${t}=${r[t]}`);Z.strings=o}return Z.strings},Nr=(e,r)=>{var t=0,o=0;for(var a of Z()){var i=r+t;w[e+o>>2]=i,t+=Te(a,i,1/0)+1,o+=4}return 0},Cr=(e,r)=>{var t=Z();w[e>>2]=t.length;var o=0;for(var a of t)o+=fe(a)+1;return w[r>>2]=o,0};function Br(e){try{var r=_.getStreamFromFD(e);return n.close(r),0}catch(t){if(typeof n>"u"||t.name!=="ErrnoError")throw t;return t.errno}}var Rr=(e,r,t,o)=>{for(var a=0,i=0;i<t;i++){var s=w[r>>2],l=w[r+4>>2];r+=8;try{var f=n.read(e,F,s,l,o)}catch(d){if(a>0&&d instanceof n.ErrnoError&&(d.errno==6||d.errno==6))break;throw d}if(f<0)return-1;if(a+=f,f<l)break}return a};function zr(e,r,t,o){try{var a=_.getStreamFromFD(e),i=Rr(a,r,t);return w[o>>2]=i,0}catch(s){if(typeof n>"u"||s.name!=="ErrnoError")throw s;return s.errno}}function Ur(e,r,t,o){r=Me(r);try{if(isNaN(r))return 22;var a=_.getStreamFromFD(e);return n.llseek(a,r,t),M[o>>3]=BigInt(a.position),a.getdents&&r===0&&t===0&&(a.getdents=null),0}catch(i){if(typeof n>"u"||i.name!=="ErrnoError")throw i;return i.errno}}var Lr=(e,r,t,o)=>{if(t==1)return n.write(e,F,w[r>>2],w[r+4>>2],o);for(var a=0,i=0,s=r;i<t;i++,s+=8)a+=w[s+4>>2];for(var l=new Uint8Array(a),f=0,i=0;i<t;i++,r+=8){var d=w[r>>2],g=w[r+4>>2];l.set(q.subarray(d,d+g),f),f+=g}return n.write(e,l,0,a,o)};function jr(e,r,t,o){try{var a=_.getStreamFromFD(e),i=Lr(a,r,t);return w[o>>2]=i,0}catch(s){if(typeof n>"u"||s.name!=="ErrnoError")throw s;return s.errno}}var Ne=e=>{var r=c["_"+e];return r},Ir=(e,r)=>{F.set(e,r)},Ce=e=>Ue(e),Or=e=>{var r=fe(e)+1,t=Ce(r);return Te(e,t,r),t},Be=(e,r,t,o,a)=>{var i={string:m=>{var b=0;return m!=null&&m!==0&&(b=Or(m)),b},array:m=>{var b=Ce(m.length);return Ir(m,b),b}};function s(m){return r==="string"?ue(m):r==="boolean"?!!m:m}var l=Ne(e),f=[],d=0;if(o)for(var g=0;g<o.length;g++){var p=i[t[g]];p?(d===0&&(d=Qe()),f[g]=p(o[g])):f[g]=o[g]}var v=l(...f);function h(m){return d!==0&&Je(d),s(m)}return v=h(v),v},Hr=(e,r,t,o)=>{var a=!t||t.every(s=>s==="number"||s==="boolean"),i=r!=="string";return i&&a&&!o?Ne(e):(...s)=>Be(e,r,t,s)};n.createPreloadedFile=vr,n.preloadFile=Pe,n.staticInit(),c.wasmBinary&&(J=c.wasmBinary),c.ccall=Be,c.cwrap=Hr,c.UTF8ToString=ue;var Re,ze,Ue,Le,ae;function $r(e){c._needle_last_error=e.s,c._needle_init=e.t,c._needle_reset=e.u,c._needle_stream_transcribe_process=e.v,c._needle_stream_transcribe_stop=e.w,c._needle_transcribe=e.x,c._needle_load=e.y,c._needle_models=e.z,c._needle_set_audio=e.A,c._needle_complete=e.B,c._needle_embed=e.C,c._free=e.D,c._malloc=e.E,Re=e.F,ze=e.G,Ue=e.H,Le=e.I,ae=e.q,e.__indirect_function_table}var xr={a:er,d:hr,i:mr,p:wr,n:gr,o:yr,e:pr,f:kr,l:Dr,m:Mr,j:Nr,k:Cr,b:Br,h:zr,g:Ur,c:jr};async function Wr(){Q&&await lr(),!ge&&xe()}var ee;return ee=await Ye(),await Wr(),c}})();typeof exports=="object"&&typeof module=="object"?(module.exports=te,module.exports.default=te):typeof define=="function"&&define.amd&&define([],()=>te);const $=self,je="https://huggingface.co/Cactus-Compute/needle3/resolve/2ae11323dc000f5e70c49f7403efa6af12ba9e67/wasm/needle.wasm",Ie="https://huggingface.co/Cactus-Compute/whistle/resolve/b358ddadd89b7a713b5aa131f23032d3cca1b251/whistle.cact",he="omg-whistle-v1";let ie=null,me=null;async function we(D,E=!1){const c=await caches.open(he).catch(()=>null),T=await c?.match(D);if(T)return new Uint8Array(await T.arrayBuffer());const N=await fetch(D);if(!N.ok)throw new Error(`Model download failed (${N.status})`);const C=N.body?.getReader();if(!C)throw new Error("Model download is unavailable");const j=Number(N.headers.get("Content-Length"))||(E?169e5:0),B=[];let I=0;for(;;){const{done:O,value:X}=await C.read();if(O)break;B.push(X),I+=X.length,E&&$.postMessage({type:"progress",progress:Math.min(99,Math.round(I/j*100))})}const A=new Uint8Array(I);let S=0;for(const O of B)A.set(O,S),S+=O.length;return await c?.put(D,new Response(A,{headers:{"Content-Type":"application/octet-stream"}})).catch(()=>{}),A}async function Oe(){const D=await we(je),E=await we(Ie,!0);$.postMessage({type:"loading"});const c=await te({wasmBinary:D}),T=c._malloc(E.length);if(!T)throw new Error("Not enough memory to load Whistle");try{if(c.HEAPU8.set(E,T),c._needle_load(T,BigInt(E.length))<0)throw new Error(c.UTF8ToString(c._needle_last_error()))}finally{c._free(T)}ie=c,$.postMessage({type:"ready"})}function He(D,E){if(!ie)throw new Error("Whistle is not ready");const c=ie,T=65536,N=[];for(let C=0;C<D.length;C+=48e4){const j=D.subarray(C,C+48e4),B=c._malloc(j.byteLength),I=c._malloc(T),A=new TextEncoder().encode(E==="auto"?"":`${E}\0`),S=A.length?c._malloc(A.length):0;try{if(!B||!I||A.length&&!S)throw new Error("Not enough memory to transcribe");if(c.HEAPU8.set(new Uint8Array(j.buffer,j.byteOffset,j.byteLength),B),S&&c.HEAPU8.set(A,S),c._needle_transcribe(B,j.length,S,0,0,I,T)<0)throw new Error(c.UTF8ToString(c._needle_last_error()));const O=JSON.parse(c.UTF8ToString(I));N.push(O.text.trim())}finally{c._free(B),c._free(I),S&&c._free(S)}}return N.filter(Boolean).join(" ")}$.onmessage=D=>{const E=D.data;if(E.type==="load")me??=Oe().catch(async c=>{throw await caches.delete(he).catch(()=>{}),c}),me.catch(c=>{$.postMessage({type:"error",error:String(c)})});else if(E.type==="transcribe")try{$.postMessage({type:"result",id:E.id,text:He(new Float32Array(E.samples),E.language)})}catch(c){$.postMessage({type:"error",id:E.id,error:String(c)})}}})();
@@ -1,6 +1,6 @@
1
1
  import { jsx as r, jsxs as c } from "react/jsx-runtime";
2
2
  import { useState as x, useEffect as h, useMemo as b } from "react";
3
- import { H as y, I as N, J as w, N as k, L as v, O as I, l as A, j } from "./embedded-3jnliWKp.js";
3
+ import { H as y, I as N, J as w, N as k, L as v, O as I, l as A, j } from "./embedded-CZGAlfpI.js";
4
4
  import { cn as g } from "cnfast";
5
5
  const u = {
6
6
  "needs-you": "Needs you",
@@ -1,7 +1,7 @@
1
1
  import { jsx as ao } from "react/jsx-runtime";
2
2
  import { useRef as Dt, useCallback as Lt, useSyncExternalStore as ut, useEffect as so } from "react";
3
3
  import { g as io } from "./_commonjsHelpers-C6fGbg64.js";
4
- import { ao as uo } from "./embedded-3jnliWKp.js";
4
+ import { ao as uo } from "./embedded-CZGAlfpI.js";
5
5
  var Ar = "vercel.ai.error", co = Symbol.for(Ar), Ut, Ft, se = class Nr extends (Ft = Error, Ut = co, Ft) {
6
6
  /**
7
7
  * Creates an AI SDK Error.
@@ -1,5 +1,5 @@
1
1
  import { jsxs as t, jsx as e, Fragment as M } from "react/jsx-runtime";
2
- import { n as Q, R as z, B as u, L as R, p as j, q as E, M as Y, s as U, u as D, v as f, T as _, w as L, x as Z, y as T, z as ee, E as ne, X as te, K as se } from "./embedded-3jnliWKp.js";
2
+ import { n as Q, R as z, B as u, L as R, p as j, q as E, M as Y, s as U, u as D, v as f, T as _, w as L, x as Z, y as T, z as ee, E as ne, X as te, K as se } from "./embedded-CZGAlfpI.js";
3
3
  import { cn as w } from "cnfast";
4
4
  import { useState as O } from "react";
5
5
  function K(l) {
@@ -1,8 +1,8 @@
1
1
  import { jsxs as u, jsx as n, Fragment as X } from "react/jsx-runtime";
2
2
  import { useState as v, useRef as y, useCallback as l, useEffect as b } from "react";
3
3
  import { R as ae, a as ce, d as ie } from "./computer-pointer-C3VB2laK.js";
4
- import { F as ne, aa as Z, a9 as le, B as g, R as ue, X as de, L as ee, ak as me } from "./embedded-3jnliWKp.js";
5
- import { K as pe, C as he } from "./keyboard-BzfMTs67.js";
4
+ import { F as ne, aa as Z, a9 as le, B as g, R as ue, X as de, L as ee, ak as me } from "./embedded-CZGAlfpI.js";
5
+ import { K as pe, C as he } from "./keyboard-Btjmprtv.js";
6
6
  /**
7
7
  * @license lucide-react v0.577.0 - ISC
8
8
  *
@@ -1,6 +1,6 @@
1
1
  import { jsxs as s, jsx as t, Fragment as le } from "react/jsx-runtime";
2
2
  import { useState as m, useMemo as Q, useEffect as B, useCallback as U, useRef as V, useContext as ie } from "react";
3
- import { F as W, aa as Y, B as O, al as I, am as q, m as X, T as L, an as ce } from "./embedded-3jnliWKp.js";
3
+ import { F as W, aa as Y, B as O, al as I, am as q, m as X, T as L, an as ce } from "./embedded-CZGAlfpI.js";
4
4
  /**
5
5
  * @license lucide-react v0.577.0 - ISC
6
6
  *