@fkn/lib 0.9.52 → 0.9.53

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.
Files changed (67) hide show
  1. package/{account-generation-BZ_gXQoZ.js → account-generation-BgiEc3fw.js} +1 -1
  2. package/{account-generation-D8wbg2Lb.cjs → account-generation-C5rMCyt1.cjs} +1 -1
  3. package/{account-storage-C38Ydzh-.js → account-storage-DptsMWKl.js} +2 -2
  4. package/{account-storage-BT2pPuWs.cjs → account-storage-IAVrRXTF.cjs} +1 -1
  5. package/account.cjs +1 -1
  6. package/account.js +2 -2
  7. package/api-6wTec7WK.cjs +3 -0
  8. package/{api-BrqGe-Yz.js → api-CX9w35R2.js} +43 -63
  9. package/{api-eOIMGYAJ.d.ts → api-mHRuM_Sd.d.ts} +1 -1
  10. package/api.cjs +1 -1
  11. package/api.d.ts +2 -2
  12. package/api.js +1 -1
  13. package/cloud/dns.d.ts +1 -1
  14. package/cloud/fetch.cjs +1 -1
  15. package/cloud/fetch.d.ts +1 -1
  16. package/cloud/fetch.js +1 -1
  17. package/cloud/fs.cjs +1 -1
  18. package/cloud/fs.js +1 -1
  19. package/cloud/net.d.ts +1 -1
  20. package/{cloud-DyXqlXh9.js → cloud-CMEnCSBw.js} +3 -3
  21. package/{cloud-DrgnsG8_.d.ts → cloud-Dykm74YZ.d.ts} +2 -2
  22. package/{cloud-CCMu_LZl.cjs → cloud-kg1hOpPJ.cjs} +1 -1
  23. package/cloud.cjs +1 -1
  24. package/cloud.d.ts +3 -3
  25. package/cloud.js +2 -2
  26. package/{contract-De1rQSCD.d.ts → contract-BN0cD-Oq.d.ts} +5 -4
  27. package/contract.d.ts +1 -1
  28. package/dgram.cjs +1 -1
  29. package/dgram.d.ts +2 -2
  30. package/dgram.js +1 -1
  31. package/dns.cjs +1 -1
  32. package/dns.d.ts +1 -1
  33. package/dns.js +1 -1
  34. package/{extension-D-MgH488.cjs → extension-BdAR-wQ0.cjs} +1 -1
  35. package/{extension-Cqd8OFr3.js → extension-DiyykwoW.js} +3 -3
  36. package/extension.cjs +1 -1
  37. package/extension.js +2 -2
  38. package/fs/promises.cjs +1 -1
  39. package/fs/promises.js +1 -1
  40. package/{fs-BUf_-umC.cjs → fs-CPsnX6ti.cjs} +1 -1
  41. package/{fs-BaZ7k_5D.js → fs-Cd1HK3C3.js} +2 -2
  42. package/fs.cjs +1 -1
  43. package/fs.js +2 -2
  44. package/http.d.ts +1 -1
  45. package/index.cjs +1 -1
  46. package/index.d.ts +2 -2
  47. package/index.js +5 -5
  48. package/{lib-B3BXMegM.cjs → lib-C0xyv8BQ.cjs} +1 -1
  49. package/{lib-ERmfLvVp.js → lib-C5N2rmbj.js} +1 -23
  50. package/{net-2q-K92j1.d.ts → net-Dq1KyRP0.d.ts} +2 -2
  51. package/net.cjs +1 -1
  52. package/net.d.ts +1 -1
  53. package/net.js +1 -1
  54. package/package.json +1 -1
  55. package/packages.cjs +1 -1
  56. package/packages.d.ts +1 -1
  57. package/packages.js +1 -1
  58. package/{proxy-CjxVIiz2.d.ts → proxy-Cer0Iarp.d.ts} +2 -2
  59. package/{proxy-CKNx2dKf.cjs → proxy-DhalpZoN.cjs} +1 -1
  60. package/{proxy-Bwr-0XVF.js → proxy-v_Z5aPh2.js} +1 -1
  61. package/rooms.cjs +1 -1
  62. package/rooms.d.ts +11 -11
  63. package/rooms.js +1 -2
  64. package/storage.cjs +1 -1
  65. package/storage.d.ts +1 -1
  66. package/storage.js +3 -3
  67. package/api-2ecr7axy.cjs +0 -3
@@ -1,4 +1,4 @@
1
- import { c as e, l as t, u as n } from "./api-BrqGe-Yz.js";
1
+ import { c as e, l as t, u as n } from "./api-CX9w35R2.js";
2
2
  //#region src/account-generation.ts
3
3
  var r = 0, i = /* @__PURE__ */ new Set(), a = 2e3, o = null, s = (e) => {
4
4
  e?.switched !== !1 && (r += 1, o &&= (clearTimeout(o.timer), null));
@@ -1 +1 @@
1
- const e=require("./api-2ecr7axy.cjs");var t=0,n=new Set,r=2e3,i=null,a=e=>{e?.switched!==!1&&(t+=1,i&&=(clearTimeout(i.timer),null));for(let e of[...n])try{e()}catch{}},o=!1,s=0,c=()=>{let t=e.c();t&&s!==t.epoch&&(s=t.epoch,Promise.resolve(t.remote.account.onChange(a)).catch(()=>{s===t.epoch&&(s=0)}))},l=()=>{!o&&e.l&&(o=!0,e.u(c))},u=()=>t,d=e=>(n.add(e),l(),()=>{n.delete(e)}),f=e=>{if(e!==t||i?.generation===e)return;let n=setTimeout(()=>{i?.timer===n&&(i=null,t===e&&a({switched:!0}))},r);i={generation:e,timer:n}};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
1
+ const e=require("./api-6wTec7WK.cjs");var t=0,n=new Set,r=2e3,i=null,a=e=>{e?.switched!==!1&&(t+=1,i&&=(clearTimeout(i.timer),null));for(let e of[...n])try{e()}catch{}},o=!1,s=0,c=()=>{let t=e.c();t&&s!==t.epoch&&(s=t.epoch,Promise.resolve(t.remote.account.onChange(a)).catch(()=>{s===t.epoch&&(s=0)}))},l=()=>{!o&&e.l&&(o=!0,e.u(c))},u=()=>t,d=e=>(n.add(e),l(),()=>{n.delete(e)}),f=e=>{if(e!==t||i?.generation===e)return;let n=setTimeout(()=>{i?.timer===n&&(i=null,t===e&&a({switched:!0}))},r);i={generation:e,timer:n}};Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return u}});
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { o as t } from "./api-BrqGe-Yz.js";
2
+ import { o as t } from "./api-CX9w35R2.js";
3
3
  import { STORAGE_ACCOUNT_CHANGED as n, STORAGE_ACCOUNT_PIN_UNSUPPORTED as r, STORAGE_NOT_FOUND as i } from "./messages.js";
4
- import { n as a, r as o, t as s } from "./account-generation-BZ_gXQoZ.js";
4
+ import { n as a, r as o, t as s } from "./account-generation-BgiEc3fw.js";
5
5
  //#region src/account-storage.ts
6
6
  var c = /* @__PURE__ */ e({
7
7
  StorageAccountChangedError: () => f,
@@ -1 +1 @@
1
- const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-2ecr7axy.cjs"),n=require("./messages.cjs"),r=require("./account-generation-D8wbg2Lb.cjs");var i=e.t({StorageAccountChangedError:()=>c,StorageAccountPinUnsupportedError:()=>l,StorageLockedError:()=>a,StorageNotFoundError:()=>o,availability:()=>k,available:()=>w,captureAccount:()=>p,encryption:()=>L,isAccountChanged:()=>u,isInvalidPin:()=>d,isNotFound:()=>s,knownPin:()=>y,list:()=>A,pinFor:()=>b,quota:()=>j,readFile:()=>M,readFileSealed:()=>P,remove:()=>I,unlock:()=>R,writeFile:()=>F}),a=class extends Error{code=`FKN_E2E_LOCKED`;constructor(){super(`storage locked: connect the app again to open encrypted data`)}},o=class extends Error{code=n.STORAGE_NOT_FOUND;constructor(e=`storage: no object at that path`){super(e)}},s=e=>e?.code===n.STORAGE_NOT_FOUND,c=class extends Error{code=n.STORAGE_ACCOUNT_CHANGED;constructor(e=`storage: the signed-in account changed, so this call was not made`){super(e)}},l=class extends Error{code=n.STORAGE_ACCOUNT_PIN_UNSUPPORTED;constructor(e=`storage: the FKN broker cannot pin calls to an account yet, so nothing was sent`){super(e)}},u=e=>e?.code===`FKN_ACCOUNT_CHANGED`||e instanceof Error&&e.message.startsWith(`fkn:account-changed`),d=e=>e instanceof Error&&e.message.startsWith(`fkn:account-pin-invalid`),f=e=>{throw e instanceof Error&&e.message.startsWith(`fkn:e2e-locked`)?new a:s(e)?new o(e.message):u(e)?new c:e instanceof Error&&e.message.startsWith(`fkn:account-pin-unsupported`)?new l:e instanceof Error&&(/^not found$/i.test(e.message)||/\(404\)$/.test(e.message))?new o(e.message):e},p=()=>(r.n(),{generation:r.t()}),m=new Map,h=null,g=e=>typeof e?.accountPin==`function`,_=(e,t)=>{let n=Promise.resolve(t.accountPin()).then(t=>{if(typeof t!=`string`||!t)throw Error(`storage: the broker answered no account pin`);return r.t()===e&&m.set(e,t),t});return h={generation:e,pin:n},n.catch(()=>{h?.pin===n&&(h=null)}),n},v=async(e,t)=>{let n=m.get(e.generation);if(n!==void 0)return n;if(e.generation!==r.t())throw new c;let i=await(h?.generation===e.generation?h.pin:_(e.generation,t)).catch(f);if(e.generation!==r.t())throw new c;return i},y=e=>m.get(e.generation),b=async e=>{let n=(await t.o).cloud.fs;if(!g(n))throw new l;return v(e,n)},x=e=>{for(let[t,n]of m)if(n===e)return t},S=e=>e?.pin??p(),C=async(e,n)=>{let i=(await t.o).cloud.fs;if(!g(i))throw new l;let a=`pin`in e?e.pin:await v(e,i);if(!g(i))throw new l;return n(i,{accountPin:a}).catch(t=>{if(u(t)){let t=`generation`in e?e.generation:x(a);t!==void 0&&r.r(t)}return f(t)})},w=()=>t.o.then(e=>e.cloud.fs.available()).catch(()=>!1),T=8e3,E=1e3,D=!1,O=async()=>{let e=(await t.o).cloud.fs;return typeof e.availability==`function`?e.availability():await e.available()?`connected`:`disconnected`},k=async()=>{let e=D?E:T,t=await new Promise(t=>{let n=setTimeout(()=>t(`timeout`),e);O().then(e=>{clearTimeout(n),t(e)},()=>{clearTimeout(n),t(`unknown`)})});return t===`timeout`?(D=!0,`unknown`):(D=!1,t)},A=e=>C(S(e),(e,t)=>e.list(t)),j=()=>t.o.then(e=>e.cloud.fs.quota()),M=async(e,t)=>{let n=await C(S(t),(t,n)=>t.readFile(e,n));return new Blob([n])},N=e=>{if(e===null||!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toISOString()},P=async(e,t)=>C(S(t),async(t,n)=>{let r=t;if(typeof r.readFileSealed!=`function`)return{data:await t.readFile(e,n),sealedAt:null};let i=await r.readFileSealed(e,n);return{data:i.bytes,sealedAt:N(i.sealedAt)}}),F=async(e,t,n)=>{let r=S(n),i=t instanceof Blob?new Uint8Array(await t.arrayBuffer()):t;await C(r,(t,r)=>t.writeFile(e,i,n?.contentType??null,r))},I=async(e,t)=>{await C(S(t),(t,n)=>t.remove(e,n))},L=()=>t.o.then(e=>e.cloud.fs.encryption()),R=()=>t.o.then(e=>e.cloud.fs.unlock());Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return R}});
1
+ const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-6wTec7WK.cjs"),n=require("./messages.cjs"),r=require("./account-generation-C5rMCyt1.cjs");var i=e.t({StorageAccountChangedError:()=>c,StorageAccountPinUnsupportedError:()=>l,StorageLockedError:()=>a,StorageNotFoundError:()=>o,availability:()=>k,available:()=>w,captureAccount:()=>p,encryption:()=>L,isAccountChanged:()=>u,isInvalidPin:()=>d,isNotFound:()=>s,knownPin:()=>y,list:()=>A,pinFor:()=>b,quota:()=>j,readFile:()=>M,readFileSealed:()=>P,remove:()=>I,unlock:()=>R,writeFile:()=>F}),a=class extends Error{code=`FKN_E2E_LOCKED`;constructor(){super(`storage locked: connect the app again to open encrypted data`)}},o=class extends Error{code=n.STORAGE_NOT_FOUND;constructor(e=`storage: no object at that path`){super(e)}},s=e=>e?.code===n.STORAGE_NOT_FOUND,c=class extends Error{code=n.STORAGE_ACCOUNT_CHANGED;constructor(e=`storage: the signed-in account changed, so this call was not made`){super(e)}},l=class extends Error{code=n.STORAGE_ACCOUNT_PIN_UNSUPPORTED;constructor(e=`storage: the FKN broker cannot pin calls to an account yet, so nothing was sent`){super(e)}},u=e=>e?.code===`FKN_ACCOUNT_CHANGED`||e instanceof Error&&e.message.startsWith(`fkn:account-changed`),d=e=>e instanceof Error&&e.message.startsWith(`fkn:account-pin-invalid`),f=e=>{throw e instanceof Error&&e.message.startsWith(`fkn:e2e-locked`)?new a:s(e)?new o(e.message):u(e)?new c:e instanceof Error&&e.message.startsWith(`fkn:account-pin-unsupported`)?new l:e instanceof Error&&(/^not found$/i.test(e.message)||/\(404\)$/.test(e.message))?new o(e.message):e},p=()=>(r.n(),{generation:r.t()}),m=new Map,h=null,g=e=>typeof e?.accountPin==`function`,_=(e,t)=>{let n=Promise.resolve(t.accountPin()).then(t=>{if(typeof t!=`string`||!t)throw Error(`storage: the broker answered no account pin`);return r.t()===e&&m.set(e,t),t});return h={generation:e,pin:n},n.catch(()=>{h?.pin===n&&(h=null)}),n},v=async(e,t)=>{let n=m.get(e.generation);if(n!==void 0)return n;if(e.generation!==r.t())throw new c;let i=await(h?.generation===e.generation?h.pin:_(e.generation,t)).catch(f);if(e.generation!==r.t())throw new c;return i},y=e=>m.get(e.generation),b=async e=>{let n=(await t.o).cloud.fs;if(!g(n))throw new l;return v(e,n)},x=e=>{for(let[t,n]of m)if(n===e)return t},S=e=>e?.pin??p(),C=async(e,n)=>{let i=(await t.o).cloud.fs;if(!g(i))throw new l;let a=`pin`in e?e.pin:await v(e,i);if(!g(i))throw new l;return n(i,{accountPin:a}).catch(t=>{if(u(t)){let t=`generation`in e?e.generation:x(a);t!==void 0&&r.r(t)}return f(t)})},w=()=>t.o.then(e=>e.cloud.fs.available()).catch(()=>!1),T=8e3,E=1e3,D=!1,O=async()=>{let e=(await t.o).cloud.fs;return typeof e.availability==`function`?e.availability():await e.available()?`connected`:`disconnected`},k=async()=>{let e=D?E:T,t=await new Promise(t=>{let n=setTimeout(()=>t(`timeout`),e);O().then(e=>{clearTimeout(n),t(e)},()=>{clearTimeout(n),t(`unknown`)})});return t===`timeout`?(D=!0,`unknown`):(D=!1,t)},A=e=>C(S(e),(e,t)=>e.list(t)),j=()=>t.o.then(e=>e.cloud.fs.quota()),M=async(e,t)=>{let n=await C(S(t),(t,n)=>t.readFile(e,n));return new Blob([n])},N=e=>{if(e===null||!Number.isFinite(e))return null;let t=new Date(e);return Number.isNaN(t.getTime())?null:t.toISOString()},P=async(e,t)=>C(S(t),async(t,n)=>{let r=t;if(typeof r.readFileSealed!=`function`)return{data:await t.readFile(e,n),sealedAt:null};let i=await r.readFileSealed(e,n);return{data:i.bytes,sealedAt:N(i.sealedAt)}}),F=async(e,t,n)=>{let r=S(n),i=t instanceof Blob?new Uint8Array(await t.arrayBuffer()):t;await C(r,(t,r)=>t.writeFile(e,i,n?.contentType??null,r))},I=async(e,t)=>{await C(S(t),(t,n)=>t.remove(e,n))},L=()=>t.o.then(e=>e.cloud.fs.encryption()),R=()=>t.o.then(e=>e.cloud.fs.unlock());Object.defineProperty(exports,"_",{enumerable:!0,get:function(){return P}}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,"b",{enumerable:!0,get:function(){return F}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return y}}),Object.defineProperty(exports,"g",{enumerable:!0,get:function(){return M}}),Object.defineProperty(exports,"h",{enumerable:!0,get:function(){return j}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return b}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return k}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,"v",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"y",{enumerable:!0,get:function(){return R}});
package/account.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-2ecr7axy.cjs"),n=require("./account-generation-D8wbg2Lb.cjs");var r=e.t({info:()=>o,login:()=>i,logout:()=>a,onChange:()=>s}),i=async()=>typeof window>`u`?!1:(await t.o).account.login(location.origin).catch(()=>!1),a=async()=>{typeof window<`u`&&await(await t.o).account.logout().catch(()=>{})},o=async()=>{if(typeof window>`u`)return null;let e=await t.o.then(e=>e.account.info()).catch(()=>null);return e?{name:e.name,image:e.image,premium:e.premium,premiumUntil:e.premiumUntil?Date.parse(e.premiumUntil):null}:null},s=async e=>t.l?n.i(e):()=>{};exports.info=o,exports.login=i,exports.logout=a,exports.onChange=s,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-6wTec7WK.cjs"),n=require("./account-generation-C5rMCyt1.cjs");var r=e.t({info:()=>o,login:()=>i,logout:()=>a,onChange:()=>s}),i=async()=>typeof window>`u`?!1:(await t.o).account.login(location.origin).catch(()=>!1),a=async()=>{typeof window<`u`&&await(await t.o).account.logout().catch(()=>{})},o=async()=>{if(typeof window>`u`)return null;let e=await t.o.then(e=>e.account.info()).catch(()=>null);return e?{name:e.name,image:e.image,premium:e.premium,premiumUntil:e.premiumUntil?Date.parse(e.premiumUntil):null}:null},s=async e=>t.l?n.i(e):()=>{};exports.info=o,exports.login=i,exports.logout=a,exports.onChange=s,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return r}});
package/account.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { l as t, o as n } from "./api-BrqGe-Yz.js";
3
- import { i as r } from "./account-generation-BZ_gXQoZ.js";
2
+ import { l as t, o as n } from "./api-CX9w35R2.js";
3
+ import { i as r } from "./account-generation-BgiEc3fw.js";
4
4
  //#region src/account.ts
5
5
  var i = /* @__PURE__ */ e({
6
6
  info: () => s,
@@ -0,0 +1,3 @@
1
+ let e=require("osra");var t=1e4,n=16,r=e=>{let t;try{t=e.contentWindow}catch{return!0}if(!t)return!0;try{let e=t.location.href;return e!==``&&e!==`about:blank`}catch{return!0}},i=(e,i=t)=>new Promise(t=>{if(r(e))return t();let a=()=>{clearInterval(o),clearTimeout(s),e.removeEventListener(`load`,a),t()},o=setInterval(()=>{r(e)&&a()},n),s=setTimeout(a,i);e.addEventListener(`load`,a)}),a=32,o=8,s=120,c=typeof CSS<`u`&&CSS.supports(`clip-path`,`path('M0 0H1V1H0Z')`),l=typeof CSS<`u`&&CSS.supports(`clip-path`,`polygon(nonzero, 0px 0px, 1px 0px, 1px 1px)`),u=e=>{let t=e.style;t.setProperty(`display`,`block`,`important`),t.setProperty(`position`,`fixed`,`important`),t.setProperty(`top`,`0`,`important`),t.setProperty(`left`,`0`,`important`),t.setProperty(`width`,`100%`,`important`),t.setProperty(`height`,`100%`,`important`),t.setProperty(`border`,`none`,`important`),t.setProperty(`padding`,`0`,`important`),t.setProperty(`box-sizing`,`border-box`,`important`),t.setProperty(`clip-path`,`inset(100%)`,`important`),t.setProperty(`background`,`transparent`),t.setProperty(`color-scheme`,`normal`),t.setProperty(`z-index`,`2147483647`),e.setAttribute(`title`,`FKN`)},d=({x:e,y:t,width:n,height:r,radius:i})=>{if(!i)return`M${e} ${t}h${n}v${r}h${-n}Z`;let a=Math.min(n,r)/2,[o,s,c,l]=i.map(e=>Math.max(0,Math.min(e,a)));return`M${e+o} ${t}h${n-o-s}a${s} ${s} 0 0 1 ${s} ${s}v${r-s-c}a${c} ${c} 0 0 1 ${-c} ${c}h${-(n-c-l)}a${l} ${l} 0 0 1 ${-l} ${-l}v${-(r-l-o)}a${o} ${o} 0 0 1 ${o} ${-o}Z`},f=()=>c&&l,p=({x:e,y:t,width:n,height:r})=>[[e,t],[e+n,t],[e+n,t+r],[e,t+r],[e,t]],m=e=>{let t=e[0];if(!t)return[];let n=p(t)[0],r=[];return e.forEach((t,i)=>{r.push(...p(t)),i>0&&i<e.length-1&&r.push(n)}),r},h=e=>`polygon(nonzero, ${m(e).map(([e,t])=>`${e}px ${t}px`).join(`, `)})`,g=({x:e,y:t,width:n,height:r,radius:i},a)=>{let o=`${t}px ${a.width-e-n}px ${a.height-t-r}px ${e}px`;return i?`inset(${o} round ${i.map(e=>`${e}px`).join(` `)})`:`inset(${o})`},ee=(e,t,n)=>{if(t)return`none`;if(e.length===0)return`inset(100%)`;let r=e.length===1?e[0]:void 0;return r?g(r,n):l&&e.length<=5&&!e.some(e=>e.radius)?h(e):`path('${e.map(d).join(``)}')`},te=e=>{if(e.length<2)return null;let t=Math.min(...e.map(e=>e.x)),n=Math.min(...e.map(e=>e.y));return{x:t,y:n,width:Math.max(...e.map(e=>e.x+e.width))-t,height:Math.max(...e.map(e=>e.y+e.height))-n}},ne=(e,t,n)=>t>=e.x&&t<e.x+e.width&&n>=e.y&&n<e.y+e.height,re=16,_=(e,t,n)=>t===1?e*re:t===2?e*n:e,ie=(e,t,n)=>{let r=getComputedStyle(e);return n!==0&&/auto|scroll/.test(r.overflowY)&&e.scrollHeight>e.clientHeight?!0:t!==0&&/auto|scroll/.test(r.overflowX)&&e.scrollWidth>e.clientWidth},ae=(e,t,n)=>{for(let r=e;r;r=r.parentElement)if(ie(r,t,n))return r;return document.scrollingElement},v=null,y=null,b=e=>({width:e.offsetWidth||window.innerWidth,height:e.offsetHeight||window.innerHeight}),x=e=>{if(!y||!v||!ne(y,e.clientX,e.clientY))return;let t=document.elementFromPoint(e.clientX,e.clientY);if(!t||t===v)return;let n=_(e.deltaX,e.deltaMode,window.innerWidth),r=_(e.deltaY,e.deltaMode,window.innerHeight),i=ae(t,n,r);i&&(i.scrollBy({left:n,top:r,behavior:`instant`}),e.cancelable&&e.preventDefault())},oe=e=>{let t=y!==null;y=e,t!==(e!==null)&&(e?window.addEventListener(`wheel`,x,{capture:!0,passive:!1}):window.removeEventListener(`wheel`,x,{capture:!0}))},S=0,se=e=>{if(e===S)return;S=e;let t=document.documentElement.style;e>0?(t.setProperty(`margin-top`,`${e}px`,`important`),t.setProperty(`--fkn-inset-top`,`${e}px`)):(t.removeProperty(`margin-top`),t.removeProperty(`--fkn-inset-top`))},C=(e,{modal:t,rects:n,inset:r},i)=>{if(se(r),!c){let r=t||n.length>0;e.style.setProperty(`pointer-events`,r?`auto`:`none`,`important`),e.style.setProperty(`visibility`,r?`visible`:`hidden`,`important`);return}let a=ee(n,t,i),o=a===`none`||CSS.supports(`clip-path`,a)?a:`inset(100%)`;e.style.setProperty(`clip-path`,o,`important`),oe(t||o!==a?null:te(n))},ce=e=>{if(typeof e!=`object`||!e)return 0;let{top:t}=e;return typeof t!=`number`||!Number.isFinite(t)||t<=0?0:Math.min(Math.round(t),s)},le=e=>{if(Array.isArray(e)&&e.length===4&&e.every(e=>typeof e==`number`&&Number.isFinite(e)&&e>=0))return e.some(e=>e>0)?e:void 0},ue=(e,t)=>{if(typeof e!=`object`||!e)return null;let{x:n,y:r,width:i,height:a}=e;if(![n,r,i,a].every(e=>typeof e==`number`&&Number.isFinite(e)))return null;let o=t.width,s=t.height,c=Math.max(0,Math.min(Math.round(n),o)),l=Math.max(0,Math.min(Math.round(r),s)),u=Math.max(c,Math.min(Math.round(n+i),o)),d=Math.max(l,Math.min(Math.round(r+a),s)),f=le(e.radius);return{x:c,y:l,width:u-c,height:d-l,...f?{radius:f}:{}}},w={"not-rendered":`this page is not painting it at all, so it or an ancestor is display:none, or the frame was moved out of the layout`,clipped:`it is clipped away or positioned outside the viewport`,"not-shown":`it is rendered but would not be seen, so either something is drawn over it, or it or an ancestor has opacity below 1, visibility:hidden, or a filter`},de=e=>Array.isArray(e)?e.slice(0,o).flatMap(e=>{if(typeof e!=`object`||!e)return[];let{kind:t,cause:n,level:r}=e;return typeof t!=`string`||t.length>40||typeof n!=`string`||!(n in w)||r!==`full`&&r!==`liveness`?[]:[{kind:t,cause:n,level:r}]}):[],T=new Set,fe=e=>{for(let{kind:t,cause:n,level:r}of e)T.has(t)||(T.add(t),console.error(`[FKN] The FKN ${JSON.stringify(t)} is not visible on this page: ${w[n]}. Nobody using this page can see or answer it.
2
+ @fkn/lib draws its UI inside <iframe title="FKN"> and sets display, position, top, left, width, height, border, padding, box-sizing, clip-path and z-index on that element. Leave those as they are, then check for an ancestor with opacity, visibility, display or a clipping transform, and for an element stacked above it.`+(r===`liveness`?`
3
+ This browser reports limited detail, so the cause above is a best guess.`:``)))},E=(e,t)=>{if(typeof e!=`object`||!e)return null;let n=e,r=(Array.isArray(n.rects)?n.rects.slice(0,a):[]).map(e=>ue(e,t)).filter(e=>e!==null&&e.width>0&&e.height>0);return{modal:n.modal===!0,rects:r,hidden:de(n.hidden),inset:ce(n.inset)}},pe=()=>v!==null,D=null,O=null,me=()=>{if(!v||D===null)return;let e=b(v),t=E(D,e);t&&C(v,t,e)},he=e=>{typeof ResizeObserver<`u`&&(O??=new ResizeObserver(me),O.disconnect(),O.observe(e))},ge=e=>{u(e),C(e,{modal:!1,rects:[],hidden:[],inset:0},b(e)),v=e,he(e)},_e=e=>{if(!v)return;let t=b(v),n=E(e,t);n&&(D=e,C(v,n,t),fe(n.hidden))},ve=`fkn.app,fkn.dev,sdbx.app,horionsoftware.com,webvpn.dev,fknmail.app,clairv.app,fkn.cloudflareaccess.com,me-62e.workers.dev,62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.eu.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.fedramp.r2.cloudflarestorage.com,pub-8a3dc68041874c7e9c9a54bde972605a.r2.dev,pub-3d97d79220b94243812e60b0e742f2c5.r2.dev,pub-f8bd4876cc3c4b4a951715da5958e49c.r2.dev,web-b3z.pages.dev,fkn-console.pages.dev,dev-dms.pages.dev,fkn-www.pages.dev,fkn-homepage.pages.dev,fkn-sandbox.pages.dev,internal-3ar.pages.dev,stub-ben.pages.dev,ripple-3t3.pages.dev,media-player-e3s.pages.dev,youtube-3c4.pages.dev,horionsoftware.pages.dev,container-ckf.pages.dev,stub-plugin.pages.dev,plugins.banou.dev`.split(`,`),k=e=>e.toLowerCase().replace(/\.+$/,``),ye=[`79.127.204.69`,`152.233.49.59`],be=e=>{let t;try{t=new URL(`http://${e.includes(`:`)&&!e.startsWith(`[`)?`[${e}]`:e}/`).hostname}catch{return}let n=/^\[(?:::ffff:|64:ff9b::)([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(n){let e=parseInt(n[1],16),t=parseInt(n[2],16);return[e>>8,e&255,t>>8,t&255].join(`.`)}return/^\d+\.\d+\.\d+\.\d+$/.test(t)?t:void 0},xe=e=>{let t=k(e);return ve.some(e=>t===e||t.endsWith(`.${e}`))},Se=e=>{if(xe(e))return!0;let t=be(k(e));return t!==void 0&&ye.includes(t)},Ce=e=>{let t=typeof e==`string`?e:e instanceof URL?e.href:e.url,n;try{n=new URL(t)}catch{return}if(Se(n.hostname))throw Error(`fetch refuses FKN platform domains (${n.hostname})`)},we=`autoplay.fullscreen.picture-in-picture.encrypted-media.screen-wake-lock.speaker-selection.captured-surface-control.camera.microphone.display-capture.geolocation.midi.usb.serial.hid.bluetooth.gamepad.keyboard-map.xr-spatial-tracking.accelerometer.gyroscope.magnetometer.ambient-light-sensor.compute-pressure.clipboard-read.clipboard-write.storage-access.window-management.local-fonts.idle-detection.web-share.sync-xhr.unload.payment.publickey-credentials-get.publickey-credentials-create.otp-credentials.identity-credentials-get.digital-credentials-get.local-network.local-network-access.loopback-network`.split(`.`),Te=()=>{try{let e=globalThis.document?.featurePolicy?.features?.();return e===void 0?void 0:new Set(e)}catch{return}},A=(e=!0,t=Te())=>[...we,...e?[`cross-origin-isolated`]:[]].filter(e=>t===void 0||t.has(e)).join(`; `),j=`https://fkn.app`,M=typeof globalThis<`u`&&globalThis.document?globalThis.document:void 0,N=typeof globalThis<`u`&&globalThis.crossOriginIsolated===!0,P=`${j}/api${N?`?coi=1`:``}`,Ee=`fkn-api-port`,De=`fkn-api-port-ack`,Oe=2e3,ke=()=>{if(!M||typeof window>`u`||window.parent===window)return Promise.resolve(void 0);let e;try{e=window.parent}catch{return Promise.resolve(void 0)}let t=new MessageChannel;return new Promise(n=>{let r=e=>{if(clearTimeout(a),t.port1.removeEventListener(`message`,i),!e)try{t.port1.close()}catch{}n(e)},i=e=>{e.data?.type===De&&r(t.port1)},a=setTimeout(()=>r(void 0),Oe);t.port1.addEventListener(`message`,i),t.port1.start();try{e.postMessage({type:Ee},j,[t.port2])}catch{r(void 0)}})},F,Ae=()=>{if(F||!M)return F;let e=M.querySelector(`iframe[src="${P}"]`);if(e)F=e;else{let e=M.createElement(`iframe`);e.setAttribute(`allow`,A(N)),e.src=P,M.body.appendChild(e),F=e}return ge(F),F},I=(async()=>{if(!M)return;let e=await ke();if(e)return{receive:e,emit:e};let t=Ae();if(!t)return;await i(t);let n=t.contentWindow;return n?{receive:window,emit:n}:void 0})(),je=(e,{boundRetired:t=e=>e}={})=>{let n,r=0,i=!1,a=()=>{},o=()=>new Promise(e=>{a=e}),s=o(),c=s,l=new Set,u=new Set,d=0,f=0,p=()=>{let e=[...u];u.clear();let t=Error(`FKN: the broker was replaced while this call was pending; retry it`);for(let n of e)try{n(t)}catch{}};(async()=>{for await(let t of e){let e=++r;n={remote:t,epoch:e};let i=a;s=o(),i(t),p();for(let n of[...l])try{n(t,e)}catch{}}})().catch(()=>{});let m=async(e,r)=>{let a=n?.remote??await(i?t(s):s);for(let t of e.slice(0,-1))a=a[t];let o=a[e[e.length-1]??``];d=Date.now(),f+=1;let c=()=>{},l=new Promise((e,t)=>{c=t});u.add(c);try{return await Promise.race([Promise.resolve(o.apply(a,r)),l])}finally{--f,u.delete(c),d=Date.now()}},h=new Map,g=e=>{let t=e.join(`\0`),r=h.get(t);if(r)return r;let i=new Proxy(function(){},{get:(t,r)=>{if(typeof r!=`string`||r===`then`)return;let i=n;if(i){let t=i.remote;for(let n of e)t=t?.[n];if(t?.[r]===void 0)return}return g([...e,r])},apply:(t,n,r)=>m(e,r)});return h.set(t,i),i};return{facade:g([]),first:c.then(()=>{}),current:()=>n,onEpoch:e=>{if(l.add(e),n)try{e(n.remote,n.epoch)}catch{}return()=>{l.delete(e)}},lastCall:()=>d,inFlight:()=>f,routable:()=>n?Promise.resolve():s.then(()=>{}),retire:()=>{i=!0,n=void 0,p()}}},L=!1,R=new Set,z=()=>L,Me=()=>{if(!L){L=!0;for(let e of[...R])try{e()}catch{}R.clear()}},B=e=>{L?e():R.add(e)},Ne=typeof window<`u`||typeof self<`u`,V=async()=>{if(typeof window<`u`)return I;if(typeof self<`u`)return{receive:self,emit:self}},H=`fkn-api`,Pe=`fkn-api-window`,Fe={async*[Symbol.asyncIterator](){let t=await V();if(!t){await new Promise(()=>{});return}if(!z()){let n=new AbortController;B(()=>n.abort());for await(let r of(0,e.expose)({},{key:H,transport:t,unregisterSignal:n.signal})){if(n.signal.aborted)break;yield r}}yield*(0,e.expose)({},{key:Pe,transport:t})}},U=!1,W=V().then(t=>new Promise(n=>{if(!t)return;let{receive:r}=t,i=t=>{(0,e.checkOsraMessageKey)(t.data,H)&&(r.removeEventListener(`message`,i),U=!0,n())};r.addEventListener(`message`,i)})),G=je(Fe,{boundRetired:e=>Promise.race([e,W.then(()=>Q(e,()=>new Z))])});B(()=>G.retire());var K=Promise.race([G.first,new Promise(e=>B(e))]).then(()=>G.facade),q=8e3,J=1e3,Y=!1,X=class extends Error{constructor(e,t){super(`@fkn/lib: no broker connection within ${t}ms, so ${e} could not be requested`),this.name=`BrokerUnreachableError`}},Z=class extends Error{constructor(){super(`FKN @fkn/lib: this page relays its FKN channel to a worker, and the FKN page it reached predates a channel of the page's own; reload`),this.name=`OwnChannelUnavailableError`}},Q=(e,t)=>{let n=Y?J:q;return Promise.race([e,new Promise((e,r)=>setTimeout(()=>{Y=!0,r(t(n))},n))])},Ie=e=>z()?Q(G.routable().then(()=>G.facade),t=>U?new Z:new X(e,t)):Q(K,t=>new X(e,t));B(()=>{W.then(()=>{let e=setTimeout(()=>console.error(new Z),q);G.routable().then(()=>clearTimeout(e))})});var $=G.onEpoch,Le=G.current,Re=G.lastCall,ze=G.inFlight;$(e=>{pe()&&e.overlay.setHost(_e,{exactClips:f()}).catch(()=>{})}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return $}});
@@ -161,29 +161,7 @@ var n = 1e4, r = 16, i = (e) => {
161
161
  if (!v) return;
162
162
  let t = b(v), n = E(e, t);
163
163
  n && (D = e, C(v, n, t), pe(n.hidden));
164
- }, ye = [
165
- "fkn.app",
166
- "fkn.dev",
167
- "sdbx.app",
168
- "fkn.cloudflareaccess.com",
169
- "horionsoftware.com",
170
- "62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com",
171
- "web-b3z.pages.dev",
172
- "fkn-console.pages.dev",
173
- "dev-dms.pages.dev",
174
- "fkn-www.pages.dev",
175
- "fkn-homepage.pages.dev",
176
- "fkn-sandbox.pages.dev",
177
- "internal-3ar.pages.dev",
178
- "stub-ben.pages.dev",
179
- "ripple-3t3.pages.dev",
180
- "media-player-e3s.pages.dev",
181
- "youtube-3c4.pages.dev",
182
- "horionsoftware.pages.dev",
183
- "container-ckf.pages.dev",
184
- "stub-plugin.pages.dev",
185
- "stub.plugins.banou.dev"
186
- ], be = (e) => e.replace(/\.+$/, ""), xe = ["79.127.204.69", "152.233.49.59"], Se = (e) => {
164
+ }, ye = /* @__PURE__ */ "fkn.app,fkn.dev,sdbx.app,horionsoftware.com,webvpn.dev,fknmail.app,clairv.app,fkn.cloudflareaccess.com,me-62e.workers.dev,62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.eu.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.fedramp.r2.cloudflarestorage.com,pub-8a3dc68041874c7e9c9a54bde972605a.r2.dev,pub-3d97d79220b94243812e60b0e742f2c5.r2.dev,pub-f8bd4876cc3c4b4a951715da5958e49c.r2.dev,web-b3z.pages.dev,fkn-console.pages.dev,dev-dms.pages.dev,fkn-www.pages.dev,fkn-homepage.pages.dev,fkn-sandbox.pages.dev,internal-3ar.pages.dev,stub-ben.pages.dev,ripple-3t3.pages.dev,media-player-e3s.pages.dev,youtube-3c4.pages.dev,horionsoftware.pages.dev,container-ckf.pages.dev,stub-plugin.pages.dev,plugins.banou.dev".split(","), k = (e) => e.toLowerCase().replace(/\.+$/, ""), be = ["79.127.204.69", "152.233.49.59"], xe = (e) => {
187
165
  let t;
188
166
  try {
189
167
  t = new URL(`http://${e.includes(":") && !e.startsWith("[") ? `[${e}]` : e}/`).hostname;
@@ -201,11 +179,13 @@ var n = 1e4, r = 16, i = (e) => {
201
179
  ].join(".");
202
180
  }
203
181
  return /^\d+\.\d+\.\d+\.\d+$/.test(t) ? t : void 0;
182
+ }, Se = (e) => {
183
+ let t = k(e);
184
+ return ye.some((e) => t === e || t.endsWith(`.${e}`));
204
185
  }, Ce = (e) => {
205
- let t = be(e);
206
- if (ye.some((e) => t === e || t.endsWith(`.${e}`))) return !0;
207
- let n = Se(t);
208
- return n !== void 0 && xe.includes(n);
186
+ if (Se(e)) return !0;
187
+ let t = xe(k(e));
188
+ return t !== void 0 && be.includes(t);
209
189
  }, we = (e) => {
210
190
  let t = typeof e == "string" ? e : e instanceof URL ? e.href : e.url, n;
211
191
  try {
@@ -214,14 +194,14 @@ var n = 1e4, r = 16, i = (e) => {
214
194
  return;
215
195
  }
216
196
  if (Ce(n.hostname)) throw Error(`fetch refuses FKN platform domains (${n.hostname})`);
217
- }, k = /* @__PURE__ */ "autoplay.fullscreen.picture-in-picture.encrypted-media.screen-wake-lock.speaker-selection.captured-surface-control.camera.microphone.display-capture.geolocation.midi.usb.serial.hid.bluetooth.gamepad.keyboard-map.xr-spatial-tracking.accelerometer.gyroscope.magnetometer.ambient-light-sensor.compute-pressure.clipboard-read.clipboard-write.storage-access.window-management.local-fonts.idle-detection.web-share.sync-xhr.unload.payment.publickey-credentials-get.publickey-credentials-create.otp-credentials.identity-credentials-get.digital-credentials-get.local-network.local-network-access.loopback-network".split("."), Te = () => {
197
+ }, Te = /* @__PURE__ */ "autoplay.fullscreen.picture-in-picture.encrypted-media.screen-wake-lock.speaker-selection.captured-surface-control.camera.microphone.display-capture.geolocation.midi.usb.serial.hid.bluetooth.gamepad.keyboard-map.xr-spatial-tracking.accelerometer.gyroscope.magnetometer.ambient-light-sensor.compute-pressure.clipboard-read.clipboard-write.storage-access.window-management.local-fonts.idle-detection.web-share.sync-xhr.unload.payment.publickey-credentials-get.publickey-credentials-create.otp-credentials.identity-credentials-get.digital-credentials-get.local-network.local-network-access.loopback-network".split("."), Ee = () => {
218
198
  try {
219
199
  let e = globalThis.document?.featurePolicy?.features?.();
220
200
  return e === void 0 ? void 0 : new Set(e);
221
201
  } catch {
222
202
  return;
223
203
  }
224
- }, A = (e = !0, t = Te()) => [...k, ...e ? ["cross-origin-isolated"] : []].filter((e) => t === void 0 || t.has(e)).join("; "), j = "https://fkn.app", M = typeof globalThis < "u" && globalThis.document ? globalThis.document : void 0, N = typeof globalThis < "u" && globalThis.crossOriginIsolated === !0, P = `${j}/api${N ? "?coi=1" : ""}`, Ee = "fkn-api-port", De = "fkn-api-port-ack", Oe = 2e3, ke = () => {
204
+ }, A = (e = !0, t = Ee()) => [...Te, ...e ? ["cross-origin-isolated"] : []].filter((e) => t === void 0 || t.has(e)).join("; "), j = "https://fkn.app", M = typeof globalThis < "u" && globalThis.document ? globalThis.document : void 0, N = typeof globalThis < "u" && globalThis.crossOriginIsolated === !0, P = `${j}/api${N ? "?coi=1" : ""}`, F = "fkn-api-port", De = "fkn-api-port-ack", Oe = 2e3, ke = () => {
225
205
  if (!M || typeof window > "u" || window.parent === window) return Promise.resolve(void 0);
226
206
  let e;
227
207
  try {
@@ -241,21 +221,21 @@ var n = 1e4, r = 16, i = (e) => {
241
221
  }, a = setTimeout(() => r(void 0), Oe);
242
222
  t.port1.addEventListener("message", i), t.port1.start();
243
223
  try {
244
- e.postMessage({ type: Ee }, j, [t.port2]);
224
+ e.postMessage({ type: F }, j, [t.port2]);
245
225
  } catch {
246
226
  r(void 0);
247
227
  }
248
228
  });
249
- }, F, Ae = () => {
250
- if (F || !M) return F;
229
+ }, I, Ae = () => {
230
+ if (I || !M) return I;
251
231
  let e = M.querySelector(`iframe[src="${P}"]`);
252
- if (e) F = e;
232
+ if (e) I = e;
253
233
  else {
254
234
  let e = M.createElement("iframe");
255
- e.setAttribute("allow", A(N)), e.src = P, M.body.appendChild(e), F = e;
235
+ e.setAttribute("allow", A(N)), e.src = P, M.body.appendChild(e), I = e;
256
236
  }
257
- return _e(F), F;
258
- }, I = (async () => {
237
+ return _e(I), I;
238
+ }, L = (async () => {
259
239
  if (!M) return;
260
240
  let e = await ke();
261
241
  if (e) return {
@@ -346,33 +326,33 @@ var n = 1e4, r = 16, i = (e) => {
346
326
  i = !0, n = void 0, p();
347
327
  }
348
328
  };
349
- }, L = !1, R = /* @__PURE__ */ new Set(), z = () => L, Me = () => {
350
- if (!L) {
351
- L = !0;
352
- for (let e of [...R]) try {
329
+ }, R = !1, z = /* @__PURE__ */ new Set(), B = () => R, Me = () => {
330
+ if (!R) {
331
+ R = !0;
332
+ for (let e of [...z]) try {
353
333
  e();
354
334
  } catch {}
355
- R.clear();
335
+ z.clear();
356
336
  }
357
- }, B = (e) => {
358
- L ? e() : R.add(e);
359
- }, Ne = typeof window < "u" || typeof self < "u", V = async () => {
360
- if (typeof window < "u") return I;
337
+ }, V = (e) => {
338
+ R ? e() : z.add(e);
339
+ }, Ne = typeof window < "u" || typeof self < "u", H = async () => {
340
+ if (typeof window < "u") return L;
361
341
  if (typeof self < "u") return {
362
342
  receive: self,
363
343
  emit: self
364
344
  };
365
- }, H = "fkn-api", Pe = "fkn-api-window", Fe = { async *[Symbol.asyncIterator]() {
366
- let e = await V();
345
+ }, U = "fkn-api", Pe = "fkn-api-window", Fe = { async *[Symbol.asyncIterator]() {
346
+ let e = await H();
367
347
  if (!e) {
368
348
  await new Promise(() => {});
369
349
  return;
370
350
  }
371
- if (!z()) {
351
+ if (!B()) {
372
352
  let n = new AbortController();
373
- B(() => n.abort());
353
+ V(() => n.abort());
374
354
  for await (let r of t({}, {
375
- key: H,
355
+ key: U,
376
356
  transport: e,
377
357
  unregisterSignal: n.signal
378
358
  })) {
@@ -384,15 +364,15 @@ var n = 1e4, r = 16, i = (e) => {
384
364
  key: Pe,
385
365
  transport: e
386
366
  });
387
- } }, U = !1, W = V().then((t) => new Promise((n) => {
367
+ } }, W = !1, G = H().then((t) => new Promise((n) => {
388
368
  if (!t) return;
389
369
  let { receive: r } = t, i = (t) => {
390
- e(t.data, H) && (r.removeEventListener("message", i), U = !0, n());
370
+ e(t.data, U) && (r.removeEventListener("message", i), W = !0, n());
391
371
  };
392
372
  r.addEventListener("message", i);
393
- })), G = je(Fe, { boundRetired: (e) => Promise.race([e, W.then(() => Q(e, () => new Z()))]) });
394
- B(() => G.retire());
395
- var K = Promise.race([G.first, new Promise((e) => B(e))]).then(() => G.facade), q = 8e3, J = 1e3, Y = !1, X = class extends Error {
373
+ })), K = je(Fe, { boundRetired: (e) => Promise.race([e, G.then(() => Q(e, () => new Z()))]) });
374
+ V(() => K.retire());
375
+ var q = Promise.race([K.first, new Promise((e) => V(e))]).then(() => K.facade), J = 8e3, Ie = 1e3, Y = !1, X = class extends Error {
396
376
  constructor(e, t) {
397
377
  super(`@fkn/lib: no broker connection within ${t}ms, so ${e} could not be requested`), this.name = "BrokerUnreachableError";
398
378
  }
@@ -401,20 +381,20 @@ var K = Promise.race([G.first, new Promise((e) => B(e))]).then(() => G.facade),
401
381
  super("FKN @fkn/lib: this page relays its FKN channel to a worker, and the FKN page it reached predates a channel of the page's own; reload"), this.name = "OwnChannelUnavailableError";
402
382
  }
403
383
  }, Q = (e, t) => {
404
- let n = Y ? J : q;
384
+ let n = Y ? Ie : J;
405
385
  return Promise.race([e, new Promise((e, r) => setTimeout(() => {
406
386
  Y = !0, r(t(n));
407
387
  }, n))]);
408
- }, Ie = (e) => z() ? Q(G.routable().then(() => G.facade), (t) => U ? new Z() : new X(e, t)) : Q(K, (t) => new X(e, t));
409
- B(() => {
410
- W.then(() => {
411
- let e = setTimeout(() => console.error(new Z()), q);
412
- G.routable().then(() => clearTimeout(e));
388
+ }, Le = (e) => B() ? Q(K.routable().then(() => K.facade), (t) => W ? new Z() : new X(e, t)) : Q(q, (t) => new X(e, t));
389
+ V(() => {
390
+ G.then(() => {
391
+ let e = setTimeout(() => console.error(new Z()), J);
392
+ K.routable().then(() => clearTimeout(e));
413
393
  });
414
394
  });
415
- var $ = G.onEpoch, Le = G.current, Re = G.lastCall, ze = G.inFlight;
395
+ var $ = K.onEpoch, Re = K.current, ze = K.lastCall, Be = K.inFlight;
416
396
  $((e) => {
417
397
  me() && e.overlay.setHost(ve, { exactClips: p() }).catch(() => {});
418
398
  });
419
399
  //#endregion
420
- export { Re as a, Le as c, Me as d, I as f, ze as i, Ne as l, A as m, X as n, K as o, we as p, Z as r, Ie as s, q as t, $ as u };
400
+ export { ze as a, Re as c, Me as d, L as f, Be as i, Ne as l, A as m, X as n, q as o, we as p, Z as r, Le as s, J as t, $ as u };
@@ -1,4 +1,4 @@
1
- import { D as IpFamily, Ft as UdpDatagram, H as ProxyFetchInput, Ht as WriteData, I as PackagesErrorCode, It as UdpSocketOptions, J as RoomClaimOptions, K as Resolvers, N as OverlayState, Nt as TcpSocketOptions, P as PackageQuery, Q as RoomEvent, R as PickOptions, T as InstallOptions, Tt as StoragePutWire, V as ProxyFetchInit, a as AccountChange, at as RoomPermission, b as FrameConsentAnswer, c as AdoptRequest, d as ConflictRequest, et as RoomJoinOptions, it as RoomOpenOptions, jt as TcpSocketListenerOptions, l as AdoptState, m as ConnectOptions, o as AccountPinOptions, p as ConnectAvailability, st as RoomsErrorCode, tt as RoomMailbox, u as ConflictChoice, x as FrameConsentRequest, xt as StorageErrorCode, z as Placement } from "./contract-De1rQSCD.js";
1
+ import { D as IpFamily, Ft as UdpDatagram, H as ProxyFetchInput, Ht as WriteData, I as PackagesErrorCode, It as UdpSocketOptions, J as RoomClaimOptions, K as Resolvers, N as OverlayState, Nt as TcpSocketOptions, P as PackageQuery, Q as RoomEvent, R as PickOptions, T as InstallOptions, Tt as StoragePutWire, V as ProxyFetchInit, a as AccountChange, at as RoomPermission, b as FrameConsentAnswer, c as AdoptRequest, d as ConflictRequest, et as RoomJoinOptions, it as RoomOpenOptions, jt as TcpSocketListenerOptions, l as AdoptState, m as ConnectOptions, o as AccountPinOptions, p as ConnectAvailability, st as RoomsErrorCode, tt as RoomMailbox, u as ConflictChoice, x as FrameConsentRequest, xt as StorageErrorCode, z as Placement } from "./contract-BN0cD-Oq.js";
2
2
  import { o as TcpSocketOption, x as UdpSocketOption } from "./wire-Fk5pJaoy.js";
3
3
  import { Remote } from "osra";
4
4
  //#region src/api-epochs.d.ts
package/api.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./api-2ecr7axy.cjs");exports.API_DEADLINE_MS=e.t,exports.BrokerUnreachableError=e.n,exports.OwnChannelUnavailableError=e.r,exports.apiInFlight=e.i,exports.apiLastCall=e.a,exports.apiPromise=e.o,exports.apiWithin=e.s,exports.currentApiEpoch=e.c,exports.hasTransport=e.l,exports.onApiEpoch=e.u;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./api-6wTec7WK.cjs");exports.API_DEADLINE_MS=e.t,exports.BrokerUnreachableError=e.n,exports.OwnChannelUnavailableError=e.r,exports.apiInFlight=e.i,exports.apiLastCall=e.a,exports.apiPromise=e.o,exports.apiWithin=e.s,exports.currentApiEpoch=e.c,exports.hasTransport=e.l,exports.onApiEpoch=e.u;
package/api.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { K as Resolvers } from "./contract-De1rQSCD.js";
2
- import { a as apiLastCall, c as currentApiEpoch, i as apiInFlight, l as hasTransport, n as BrokerUnreachableError, o as apiPromise, r as OwnChannelUnavailableError, s as apiWithin, t as API_DEADLINE_MS, u as onApiEpoch } from "./api-eOIMGYAJ.js";
1
+ import { K as Resolvers } from "./contract-BN0cD-Oq.js";
2
+ import { a as apiLastCall, c as currentApiEpoch, i as apiInFlight, l as hasTransport, n as BrokerUnreachableError, o as apiPromise, r as OwnChannelUnavailableError, s as apiWithin, t as API_DEADLINE_MS, u as onApiEpoch } from "./api-mHRuM_Sd.js";
3
3
  export { API_DEADLINE_MS, BrokerUnreachableError, OwnChannelUnavailableError, type Resolvers, apiInFlight, apiLastCall, apiPromise, apiWithin, currentApiEpoch, hasTransport, onApiEpoch };
package/api.js CHANGED
@@ -1,2 +1,2 @@
1
- import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./api-BrqGe-Yz.js";
1
+ import { a as e, c as t, i as n, l as r, n as i, o as a, r as o, s, t as c, u as l } from "./api-CX9w35R2.js";
2
2
  export { c as API_DEADLINE_MS, i as BrokerUnreachableError, o as OwnChannelUnavailableError, n as apiInFlight, e as apiLastCall, a as apiPromise, s as apiWithin, t as currentApiEpoch, r as hasTransport, l as onApiEpoch };
package/cloud/dns.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { s as AddressLookupResult } from "../contract-De1rQSCD.js";
1
+ import { s as AddressLookupResult } from "../contract-BN0cD-Oq.js";
2
2
  import { lookup } from "../dns.js";
3
3
  export { type AddressLookupResult, lookup };
package/cloud/fetch.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../proxy-CKNx2dKf.cjs");exports.fetch=e.t;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../proxy-DhalpZoN.cjs");exports.fetch=e.t;
package/cloud/fetch.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { t as cloudFetch } from "../proxy-CjxVIiz2.js";
1
+ import { t as cloudFetch } from "../proxy-Cer0Iarp.js";
2
2
  export { cloudFetch as fetch };
package/cloud/fetch.js CHANGED
@@ -1,2 +1,2 @@
1
- import { t as e } from "../proxy-Bwr-0XVF.js";
1
+ import { t as e } from "../proxy-v_Z5aPh2.js";
2
2
  export { e as fetch };
package/cloud/fs.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BIInC43l.cjs"),t=require("../node-fs-vsWuoMGa.cjs"),n=require("../messages.cjs"),r=require("../account-storage-BT2pPuWs.cjs");var i=e.t({STORAGE_ACCOUNT_CHANGED:()=>n.STORAGE_ACCOUNT_CHANGED,STORAGE_ACCOUNT_PIN_UNSUPPORTED:()=>n.STORAGE_ACCOUNT_PIN_UNSUPPORTED,STORAGE_NOT_FOUND:()=>n.STORAGE_NOT_FOUND,StorageAccountChangedError:()=>r.t,StorageAccountPinUnsupportedError:()=>r.n,StorageLockedError:()=>r.r,StorageNotFoundError:()=>r.i,availability:()=>r.o,available:()=>a,encryption:()=>r.c,isAccountChanged:()=>r.l,isNotFound:()=>r.d,list:()=>h,mkdir:()=>d,promises:()=>m,quota:()=>r.h,readFile:()=>o,readFileSealed:()=>g,readdir:()=>u,rename:()=>l,rm:()=>f,stat:()=>p,unlink:()=>c,unlock:()=>r.y,writeFile:()=>s}),{available:a,readFile:o,writeFile:s,unlink:c,rename:l,readdir:u,mkdir:d,rm:f,stat:p,promises:m}=t.t(r.a,{memfs:!1}),h=()=>r.p(),g=e=>r._(e);exports.STORAGE_ACCOUNT_CHANGED=n.STORAGE_ACCOUNT_CHANGED,exports.STORAGE_ACCOUNT_PIN_UNSUPPORTED=n.STORAGE_ACCOUNT_PIN_UNSUPPORTED,exports.STORAGE_NOT_FOUND=n.STORAGE_NOT_FOUND,exports.StorageAccountChangedError=r.t,exports.StorageAccountPinUnsupportedError=r.n,exports.StorageLockedError=r.r,exports.StorageNotFoundError=r.i,exports.availability=r.o,exports.available=a,exports.encryption=r.c,exports.isAccountChanged=r.l,exports.isNotFound=r.d,exports.list=h,exports.mkdir=d,exports.promises=m,exports.quota=r.h,exports.readFile=o,exports.readFileSealed=g,exports.readdir=u,exports.rename=l,exports.rm=f,exports.stat=p,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}}),exports.unlink=c,exports.unlock=r.y,exports.writeFile=s;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BIInC43l.cjs"),t=require("../node-fs-vsWuoMGa.cjs"),n=require("../messages.cjs"),r=require("../account-storage-IAVrRXTF.cjs");var i=e.t({STORAGE_ACCOUNT_CHANGED:()=>n.STORAGE_ACCOUNT_CHANGED,STORAGE_ACCOUNT_PIN_UNSUPPORTED:()=>n.STORAGE_ACCOUNT_PIN_UNSUPPORTED,STORAGE_NOT_FOUND:()=>n.STORAGE_NOT_FOUND,StorageAccountChangedError:()=>r.t,StorageAccountPinUnsupportedError:()=>r.n,StorageLockedError:()=>r.r,StorageNotFoundError:()=>r.i,availability:()=>r.o,available:()=>a,encryption:()=>r.c,isAccountChanged:()=>r.l,isNotFound:()=>r.d,list:()=>h,mkdir:()=>d,promises:()=>m,quota:()=>r.h,readFile:()=>o,readFileSealed:()=>g,readdir:()=>u,rename:()=>l,rm:()=>f,stat:()=>p,unlink:()=>c,unlock:()=>r.y,writeFile:()=>s}),{available:a,readFile:o,writeFile:s,unlink:c,rename:l,readdir:u,mkdir:d,rm:f,stat:p,promises:m}=t.t(r.a,{memfs:!1}),h=()=>r.p(),g=e=>r._(e);exports.STORAGE_ACCOUNT_CHANGED=n.STORAGE_ACCOUNT_CHANGED,exports.STORAGE_ACCOUNT_PIN_UNSUPPORTED=n.STORAGE_ACCOUNT_PIN_UNSUPPORTED,exports.STORAGE_NOT_FOUND=n.STORAGE_NOT_FOUND,exports.StorageAccountChangedError=r.t,exports.StorageAccountPinUnsupportedError=r.n,exports.StorageLockedError=r.r,exports.StorageNotFoundError=r.i,exports.availability=r.o,exports.available=a,exports.encryption=r.c,exports.isAccountChanged=r.l,exports.isNotFound=r.d,exports.list=h,exports.mkdir=d,exports.promises=m,exports.quota=r.h,exports.readFile=o,exports.readFileSealed=g,exports.readdir=u,exports.rename=l,exports.rm=f,exports.stat=p,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}}),exports.unlink=c,exports.unlock=r.y,exports.writeFile=s;
package/cloud/fs.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { t as e } from "../rolldown-runtime-Dy4uBu1J.js";
2
2
  import { t } from "../node-fs-DY2fO5zd.js";
3
3
  import { STORAGE_ACCOUNT_CHANGED as n, STORAGE_ACCOUNT_PIN_UNSUPPORTED as r, STORAGE_NOT_FOUND as i } from "../messages.js";
4
- import { _ as a, a as o, c as s, d as c, h as l, i as u, l as d, n as f, o as p, p as m, r as h, t as g, y as _ } from "../account-storage-C38Ydzh-.js";
4
+ import { _ as a, a as o, c as s, d as c, h as l, i as u, l as d, n as f, o as p, p as m, r as h, t as g, y as _ } from "../account-storage-DptsMWKl.js";
5
5
  //#region src/cloud/fs.ts
6
6
  var v = /* @__PURE__ */ e({
7
7
  STORAGE_ACCOUNT_CHANGED: () => n,
package/cloud/net.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-2q-K92j1.js";
1
+ import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-Dq1KyRP0.js";
2
2
  export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
@@ -1,9 +1,9 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { D as t, E as n, N as r, O as i, T as a, _ as o, c as s, f as c, ft as l, g as u, h as d, j as f, k as p, l as m, m as h, o as g, p as _, s as v, u as y, x as b, y as x } from "./lib-ERmfLvVp.js";
2
+ import { D as t, E as n, N as r, O as i, T as a, _ as o, c as s, f as c, ft as l, g as u, h as d, j as f, k as p, l as m, m as h, o as g, p as _, s as v, u as y, x as b, y as x } from "./lib-C5N2rmbj.js";
3
3
  import { c as S, m as C, t as w } from "./hosts-t7CKGTRz.js";
4
- import { l as T, m as E, n as D, o as O, s as k } from "./api-BrqGe-Yz.js";
4
+ import { l as T, m as E, n as D, o as O, s as k } from "./api-CX9w35R2.js";
5
5
  import { r as A } from "./busy-DsMWrSzc.js";
6
- import { t as j } from "./proxy-Bwr-0XVF.js";
6
+ import { t as j } from "./proxy-v_Z5aPh2.js";
7
7
  import { frameFetchVerdict as M } from "./attach-policy.js";
8
8
  import { ATTACH_FRAME_KEY as N, ATTACH_WINDOW_KEY as ee, ATTACH_WINDOW_MESSAGE as P, WINDOW_HANDSHAKE_TIMEOUT_MS as te } from "./contract.js";
9
9
  import { t as ne } from "./dns.js";
@@ -1,8 +1,8 @@
1
1
  import { r as AttachFrameFunction } from "./index-BQ5OZQhf.js";
2
- import { t as cloudFetch } from "./proxy-CjxVIiz2.js";
2
+ import { t as cloudFetch } from "./proxy-Cer0Iarp.js";
3
3
  import { t as dns_d_exports } from "./dns.js";
4
4
  import { n as fs_d_exports } from "./fs-BZv2djbS.js";
5
- import { s as net_d_exports } from "./net-2q-K92j1.js";
5
+ import { s as net_d_exports } from "./net-Dq1KyRP0.js";
6
6
  import { t as dgram_d_exports } from "./dgram.js";
7
7
  import { t as http_d_exports } from "./http.js";
8
8
  //#region src/cloud/frame.d.ts
@@ -1 +1 @@
1
- const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-B3BXMegM.cjs"),n=require("./hosts-GNBhZO3-.cjs"),r=require("./api-2ecr7axy.cjs"),i=require("./busy-BXbVH595.cjs"),a=require("./proxy-CKNx2dKf.cjs"),o=require("./attach-policy.cjs"),s=require("./contract.cjs"),c=require("./dns.cjs"),l=require("./cloud/fs.cjs"),u=require("./net.cjs"),d=require("./dgram.cjs"),f=require("./http.cjs");let p=require("osra");var m=async()=>{let e=()=>r.s(`frame consent`);try{let t=await e();return{request:typeof t.frameConsent.request==`function`?t.frameConsent.request:void 0,ensure:t.frameConsent.ensure}}catch(t){if(!(t instanceof r.n))throw t;return{request:void 0,ensure:t=>e().then(e=>e.frameConsent.ensure(t))}}},h=`frame: this frame no longer holds the document the app attached it to`,g=!1,_=()=>{g||(g=!0,console.warn(`[fkn-frame] this FKN broker is too old to ask for permission categories, so nothing was asked for upfront and each capability is asked for as it is first used. Reloading the page picks up the current broker.`))},v=e=>[...e].flatMap(e=>{try{return[new URL(e).hostname]}catch{return[]}}),y=e=>typeof e?.reason==`string`?{reason:e.reason}:{},b=(e,t,n)=>n===null?`frame.${e}: the user did not grant ${t} here`:`frame.${e}: the user did not grant ${t} on ${n}`,x=e=>{let{assertLive:r,attach:i,consent:a,current:s,declaredHosts:c,documentHost:l,freshBlank:u,session:d,approvedOrigins:f}=e,p=new Set,m=()=>{try{return new URL(s()).hostname}catch{return``}},g=async()=>l?await l():m(),x=()=>n.t([...c,...v(f)]),S=async(e,t)=>(await e([t]))[0]??!1;return{gate:async({operation:e,args:s,phase:l})=>{r();let _=n.m(e,s);if(_===null)return;let v=t.h(_);if(v===void 0||v===`auto`)return;if(e===`fetch`){let e=o.frameFetchVerdict({session:d,declaredHosts:c,approvedOrigins:f},l===`ensure`?void 0:s[0],{classifier:`fetchTarget`});if(l===`ensure`&&!d)throw t.k(e.kind===`refuse`?e.reason:``,`fetch`);if(l!==`ensure`&&e.kind===`refuse`)throw t.k(e.reason,`fetch`);let{request:r,ensure:i}=await a();if(!r){if(e.kind===`refuse`)throw t.k(e.reason,`fetch`);if(!await i({scope:n.c(s[0],s[1]).scope,hosts:e.promptHosts}))throw t.k(`frame.fetch: the user did not grant this`,`fetch`);return}let u=e.kind===`consent`?e.targetHost:await g(),p=n.t([u,...c]);if(!p.length)throw t.k(`frame: navigate the frame before fetch`,`fetch`);if(await S(r,{category:`network`,hosts:p,...y(t.T(s))})===!1)throw t.k(b(`fetch`,`network`,u||null),`fetch`);return}let C=await g();if(!C)throw t.k(`frame: navigate the frame before ${e}`,e);if(!x().includes(C))throw t.k(h,e);let w=t.m(_);if(w===void 0||w===`evaluation`&&C===m()&&await u?.()||v===`critical`&&p.has(`${_} ${C}`))return;let{request:T}=await a();if(!T)return;let E=n.t([C,...c]),D=y(t.T(s)),O=v===`critical`?{key:_,hosts:E,attach:i,...D}:{category:w,hosts:E,...D},k=await S(T,O);if(k===!1)throw t.k(b(e,w,null),e);if(k===`once`&&l!==`ensure`)for(let e of E)p.add(`${_} ${e}`)},requestCategories:async e=>{r(),t.f(`frame.requestPermissions`,e);let o=await g(),s=n.t(o?[o,...c]:c);if(!s.length)throw TypeError(`frame.requestPermissions: navigate the frame or declare domains first`);let l=e.map(e=>{let n=e.key;return n===void 0?{named:void 0,critical:!1,category:e.category}:{named:n,critical:t.h(n)===`critical`,category:t.p(n)}}),u=({named:e,critical:t,category:n},r)=>({category:n,...t?{key:e}:{},hosts:s,allow:r}),{request:d}=await a();if(!d)return _(),l.map(e=>u(e,!1));let f=await d(l.map(({named:t,critical:n,category:r},a)=>{let o=y(e[a]);return n?{key:t,hosts:s,attach:i,...o}:{category:r,hosts:s,...o}}));return l.map((e,t)=>u(e,f[t]!==void 0&&f[t]!==!1))},boundary:x}},S=e=>e,C=5e3,w=new Set([]),T=()=>`https://fkn.app`,E=e=>e===`persistent`?``:`incognito-${crypto.randomUUID()}`,D=(e,n,r)=>{let i,a=new Promise((e,a)=>{i=setTimeout(()=>a(typeof r==`string`?new t.E(r):r()),n)});return Promise.race([e,a]).finally(()=>clearTimeout(i))},O=e=>Object.assign(Error(e),{name:t.D}),k=`frame.postMessage: this FKN page predates frame messaging; reload the app to load the current one`,A=`frame.addScriptTag: this render proxy predates addScriptTag; reload the app`,j=`frame.addScriptTag: no answer within ${t.l}ms; the script may or may not have run`,M=`frame.clearCookies: this FKN page predates clearCookies; reload the app to load the current one`,N=`frame.clearCookies: this attachment reaches no site yet; attach a url, goto one, or declare it in domains`,P=3e4,F=`attachFrame: this FKN page predates storageState; reload the app to load the current one`,I=2e4,L=async(e,n)=>{if(typeof e.seed!=`function`)throw t.N(F,`storageState`,`cloud`);try{await D(e.seed(n),I,`attachFrame: the render proxy did not take the storageState seed`)}catch(e){throw t.O(e)?t.N(F,`storageState`,`cloud`):e}},ee=`frame.clearCookies: the render proxy did not answer within ${P}ms; the cookies may or may not be gone, and calling it again is safe`,R=e=>t.O(e)&&e.message===t.j(`addScriptTag`).message,z=!1,te=()=>{z||(z=!0,console.warn(`[fkn-frame] this FKN page predates frame messaging, so the page's messages and documents are never reported. Reloading the app loads the current one.`))},B=({from:e,origin:t,attach:n,signal:r})=>i=>{let a=r=>{if(r.source===null||r.source!==e()||r.origin!==t)return;let a=r.data;typeof a==`object`&&a&&a.type===`fkn-frame-message`&&a.attach===n&&typeof a.origin==`string`&&(a.kind===`message`?i({type:`message`,data:a.data,origin:a.origin,ports:r.ports}):a.kind===`document`&&i({type:`document`,origin:a.origin}))};return window.addEventListener(`message`,a,{signal:r}),()=>window.removeEventListener(`message`,a)},ne=e=>{if(typeof e!=`function`)return()=>Promise.resolve(e);let t=null;return()=>t??=e().catch(e=>{throw t=null,e})},V=({control:e,target:n,blank:r=!1,session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,guard:l,consent:u,onNavigated:d,relay:f})=>{let p=n,m=r&&i!==``,g=async()=>{if(!m)return!1;let t=typeof e.blank==`function`?await l(()=>e.blank()):``;return(typeof t!=`string`||t.split(`#`)[0]!==n.split(`#`)[0])&&(m=!1),m},_=Promise.resolve(),{gate:v,requestCategories:y,boundary:b}=x({session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,documentHost:typeof e.documentHost==`function`?()=>l(()=>e.documentHost()):void 0,current:()=>p,consent:ne(u),freshBlank:g});return t.y({backend:`cloud`,executor:{execute:(n,r,i)=>w.has(r)?Promise.reject(t.j(r,`cloud`)):(c(),l(()=>e.executeLocator(n,r,i))),highlight:async()=>{}},gate:v,requestPermissions:y,evaluate:async(n,r)=>(c(),await v({parts:[],operation:`evaluate`,args:[n],phase:`execute`}),D(l(()=>e.executeLocator([],`evaluate`,[n,r])),t.l,t.u)),addScriptTag:async(n,r)=>{c();let i=[n,r];await v({parts:[],operation:`addScriptTag`,args:i,phase:`execute`});try{await D(l(()=>e.executeLocator([],`addScriptTag`,i)),t.l,j)}catch(e){throw R(e)?t.N(A,`addScriptTag`,`cloud`):e}},clearCookies:async n=>{if(c(),typeof e.clearCookies!=`function`)throw t.N(M,`clearCookies`,`cloud`);if(b().length===0)throw t.k(N,`clearCookies`);await D(l(()=>e.clearCookies(n)),P,ee)},postMessage:(n,r,i)=>{if(c(),typeof e.messaging!=`function`)throw t.N(k,`postMessage`,`cloud`);if(r!==`*`&&!b().includes(new URL(r).hostname))throw t.k(h,`postMessage`);let{port1:a,port2:o}=new MessageChannel;a.postMessage({data:n,transfer:i},i);let s=[o,r],u=_.then(async()=>(await v({parts:[],operation:`postMessage`,args:s,phase:`execute`}),{answer:l(()=>e.executeLocator([],`postMessage`,s))}));return _=u.catch(()=>{}),u.then(async({answer:e})=>{await e})},listen:t=>(typeof e.messaging!=`function`&&te(),f(t)),goto:async(n,{timeout:r,...i}={})=>{let a=new URL(n,location.href).href;c(),m=!1;let s=(()=>{try{return new URL(a).origin}catch{return``}})(),u=s!==``&&!o.has(s);u&&o.add(s);try{await D(l(()=>e.goto(a,r===void 0?i:{...i,timeoutMs:r})),(r??3e4)+C,`cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded`)}catch(e){throw u&&o.delete(s),t.c(e)}p=a,d()},url:()=>p})},re=250,ie=500,ae=65e3,oe=2e3,se=2e3,ce=2,le=2e3,ue=2e3,H=({origin:e,target:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-window`,e);return a.searchParams.set(`attach`,i),t&&a.searchParams.set(`url`,t),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.href},de=(e,t)=>{let n=document.createElement(`iframe`),r=new URL(`/attach-jar`,e);return r.searchParams.set(`attach`,t),n.src=r.href,n.tabIndex=-1,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`style`,`display:none`),(document.body??document.documentElement).appendChild(n),n},fe=(e,t)=>{let n=new MutationObserver(()=>{e.isConnected||t.aborted||(n.disconnect(),console.warn(`cloud.attachFrame: the window's jar anchor was removed from this page, so a sign-in in the window no longer reaches this app's cookie jar`))});e.parentNode&&n.observe(e.parentNode,{childList:!0}),n.observe(document.documentElement,{childList:!0}),t.addEventListener(`abort`,()=>n.disconnect(),{once:!0})},U=()=>O(`cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window`),W=()=>O(`cloud.attachFrame: the attached window stopped answering; attach a fresh window`),G=()=>O(`cloud.attachFrame: the window went away before it connected; attach a fresh window`),pe=()=>O(`cloud.attachFrame: the window closed before it connected. Either the user closed it, or this page's Cross-Origin-Opener-Policy cut its link to the window`),me=async(e,r,a)=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:o=[],permissions:c}=e,{url:l,width:u,height:d}=t.s(e.window);if(window.origin===`null`)throw new t._(`opaque-opener`);let f=T(),m=crypto.randomUUID(),h=E(r),g=n.t(o),_=new Set;l&&_.add(new URL(l).origin);let v=r===`persistent`?de(f,m):null,y=window.open(H({origin:f,target:a===void 0?l:``,session:h,domains:g,attach:m}),`_blank`,`popup,width=${u},height=${d}`);if(!y)throw v?.remove(),new t.g;let b=new AbortController,x=!1,C=null,w=(e,t=!1)=>{if(C===null){C=e,b.abort(t?W():U());try{y.closed||y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.detach,attach:m,...t?{unanswered:t}:{}},f)}catch{}v&&setTimeout(()=>v.remove(),ue)}};v&&fe(v,b.signal);let O=new Promise((e,t)=>{b.signal.addEventListener(`abort`,()=>t(b.signal.reason),{once:!0})});O.catch(()=>{});let k=O.then(()=>{},()=>{}),A=()=>{if(b.signal.aborted)throw b.signal.reason},j=e=>b.signal.aborted?Promise.reject(b.signal.reason):Promise.race([e(),O]),M=e=>e.source===y&&e.origin===f;window.addEventListener(`message`,e=>{if(!M(e))return;let n=e.data;typeof n==`object`&&n&&n.attach===m&&(n.type===s.ATTACH_WINDOW_MESSAGE.refused?w(new t._(n.reason)):n.type===s.ATTACH_WINDOW_MESSAGE.gone&&w(x?U():G()))},{signal:b.signal}),window.addEventListener(`pagehide`,()=>w(U()),{signal:b.signal});let N=()=>{try{y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.hello,attach:m},f)}catch{}};N();let P=setInterval(N,re),F=setInterval(()=>{y.closed&&w(x?U():pe())},ie);b.signal.addEventListener(`abort`,()=>{clearInterval(P),clearInterval(F)},{once:!0});let I=async e=>{try{return await Promise.race([e,O])}catch(e){throw C??e}};try{let e=await I(D((0,p.expose)({},{key:s.ATTACH_WINDOW_KEY,transport:{emit:(e,t)=>y.postMessage(e,f,t??[]),receive:e=>{let t=t=>{M(t)&&e(t.data,{source:t.source,origin:t.origin})};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}},unregisterSignal:b.signal,revivableModules:S(t.ft)}),s.WINDOW_HANDSHAKE_TIMEOUT_MS,`cloud.attachFrame: timed out connecting to the window`));x=!0,clearInterval(P);let n=0,r=setInterval(()=>{D(j(()=>e.ping()),se,`ping`).then(()=>{n=0},()=>{b.signal.aborted||(document.visibilityState===`hidden`?n=0:++n>=ce&&w(W(),!0))})},oe);b.signal.addEventListener(`abort`,()=>clearInterval(r),{once:!0}),await I(D(e.ready(),ae,`cloud.attachFrame: the window never became ready`)),a!==void 0&&await I(L(e,a)),i.r(`attached frame`,b.signal);let o=V({control:e,target:l,session:h,declaredHosts:g,approvedOrigins:_,attach:m,assertLive:A,guard:j,consent:{request:t=>j(()=>e.requestConsent(t)),ensure:t=>j(()=>e.requestConsent([t])).then(([e])=>e!==void 0&&e!==!1)},onNavigated:()=>{},relay:B({from:()=>y,origin:f,attach:m,signal:b.signal})}),u=null,d=Object.assign(o,{close:()=>u??=(async()=>{b.signal.aborted||await D(Promise.allSettled([j(()=>e.flushCookies()),j(()=>e.sweepStorage())]),le,`close`).catch(()=>{});try{y.close()}catch{}w(U())})(),closed:k});return a!==void 0&&l&&await I(d.goto(l)),c?.length&&await I(d.requestPermissions(c)),d}catch(e){let n=C??e;if(!(n instanceof t._))try{y.close()}catch{}throw w(n),n}},he=2e4,K=65e3,q=e=>!e||e===`about:blank`,ge=`cloud.attachFrame: this FKN page predates blank pages; reload the app to load the current one`,_e=`cloud.attachFrame: cookies: 'native' needs the FKN browser extension; the cloud render proxy has no browser cookies`,J=e=>e.split(`#`)[0]??``,Y=({iframe:e,lockdown:n,cookies:r,blank:i})=>{if(i===void 0)return``;if(typeof i!=`object`||!i)throw TypeError(`attachFrame: blank must be an object { url }`);let a=Object.keys(i).find(e=>e!==`url`);if(a!==void 0)throw TypeError(`attachFrame: blank takes { url }, not "${a}"`);let{url:o}=i,s=(()=>{try{return typeof o==`string`?new URL(o):null}catch{return null}})();if(!s||s.protocol!==`http:`&&s.protocol!==`https:`)throw TypeError(`attachFrame: blank.url must be an absolute http or https url, not "${String(o)}"`);let c=e.getAttribute(`src`)??``;if(!q(c))throw TypeError(`attachFrame: blank needs an iframe with no src; this one has "${c}"`);if(n)throw TypeError(`attachFrame: blank does not combine with lockdown`);if(r===`native`)throw TypeError(`attachFrame: blank runs on the cloud render proxy, which has no browser cookies; pass cookies: 'persistent' or 'ephemeral'`);if(t.x(s.href),!Ee())throw Error(`attachFrame: a blank page is served by the cloud render proxy, which this build does not configure`);return s.href},ve=({target:e,blank:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-frame`,T());return t?a.searchParams.set(`blank`,t):e&&a.searchParams.set(`url`,e),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.searchParams.set(`attach`,i),a.href},ye=(e,t)=>{let n=()=>{a(),t()},r=e.parentNode,i=new MutationObserver(()=>{(!e.isConnected||e.parentNode!==r)&&(a(),t())}),a=()=>{window.removeEventListener(`pagehide`,n),i.disconnect()};window.addEventListener(`pagehide`,n,{once:!0}),r&&i.observe(r,{childList:!0}),e.isConnected||(a(),t())},be=()=>O(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),xe=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},Se=[300,1200,4e3],X=e=>{let t=()=>{if(!e.isConnected)return;let t=e.style.height,n=e.getBoundingClientRect();n.height&&(e.style.height=`${n.height-1}px`,setTimeout(()=>{e.style.height=t},50))};t();for(let e of Se)setTimeout(t,e)},Ce=e=>{let t=e.getAttribute(`sandbox`);if(t===null)return;let n=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),r=[`allow-scripts`,`allow-same-origin`].filter(e=>!n.has(e));if(r.length)throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(` and `)} for the render proxy to load`)},we=async(e,n)=>{let r=typeof e.blank==`function`?await D(e.blank(),K,`cloud.attachFrame: the render proxy never became ready`):``;if(typeof r!=`string`||J(r)!==J(n))throw t.N(ge,`blank`,`cloud`)},Te=async(e,a,o)=>{let c=Y(e),{iframe:l,domains:u=[],permissions:d}=e;if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);if(!l.isConnected)throw Error(`cloud.attachFrame: the iframe must be connected to the document before attaching`);Ce(l);let f=l.getAttribute(`src`)??``,h=(()=>{if(q(f))return null;try{return new URL(l.src||f,location.href)}catch{throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${f}`)}})();if(h){let e=new URL(`/attach-frame`,T());if(h.origin===e.origin&&h.pathname===e.pathname)throw Error(`cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe`)}let g=h?.href??``;g&&t.x(g);let _=o===void 0?g:``,v=E(a),y=n.t(u),b=new Set;try{b.add(new URL(c||g).origin)}catch{}let x=new AbortController,C=l.referrerPolicy,w=l.allow,O=crypto.randomUUID();if(l.referrerPolicy=`origin`,l.allow=xe(r.m(),l.allow),l.src=ve({target:_,blank:c,session:v,domains:y,attach:O}),!l.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let e=await D((0,p.expose)({},{key:s.ATTACH_FRAME_KEY,origin:T(),transport:{receive:window,emit:l.contentWindow},unregisterSignal:x.signal,revivableModules:S(t.ft)}),he,`cloud.attachFrame: timed out connecting to the render proxy page`);await D(e.ready(),K,`cloud.attachFrame: the render proxy never became ready`),c&&await we(e,c),o!==void 0&&await L(e,o),(g||c)&&X(l),ye(l,()=>x.abort()),i.r(`attached frame`,x.signal);let n=l.contentWindow,r=V({control:e,target:c||g,blank:c!==``,session:v,declaredHosts:y,approvedOrigins:b,attach:O,assertLive:()=>{if(x.signal.aborted||!l.isConnected||l.contentWindow!==n)throw x.abort(),be()},guard:e=>e(),consent:m,onNavigated:()=>X(l),relay:B({from:()=>n,origin:T(),attach:O,signal:x.signal})});return o!==void 0&&g&&await r.goto(g),d?.length&&await r.requestPermissions(d),r}catch(e){throw x.abort(),l.referrerPolicy=C,l.allow=w,l.src=_||`about:blank`,e}},Z=(async e=>{let{kind:n,cookies:r,storageState:i}=t.o(e);if(r===`native`)throw TypeError(_e);return n===`window`?me(e,r,i):Te(e,r,i)}),Ee=()=>typeof window<`u`&&!0,Q=async()=>{let e=await r.o.then(e=>e.cloud.quota());return{premium:e.premium,overQuota:e.overQuota,throttled:e.overQuota&&!e.premium,usedBytes:e.usedBytes,limitBytes:e.limitBytes,remainingBytes:e.remaining,bytesPerSecond:e.bytesPerSecond,bitsPerSecond:e.bytesPerSecond*8}},De=e.t({attachFrame:()=>Z,available:()=>$,dgram:()=>d.t,dns:()=>c.t,fetch:()=>a.t,fs:()=>l.t,http:()=>f.t,net:()=>u.t,quota:()=>Q}),$=()=>r.l;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
1
+ const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-C0xyv8BQ.cjs"),n=require("./hosts-GNBhZO3-.cjs"),r=require("./api-6wTec7WK.cjs"),i=require("./busy-BXbVH595.cjs"),a=require("./proxy-DhalpZoN.cjs"),o=require("./attach-policy.cjs"),s=require("./contract.cjs"),c=require("./dns.cjs"),l=require("./cloud/fs.cjs"),u=require("./net.cjs"),d=require("./dgram.cjs"),f=require("./http.cjs");let p=require("osra");var m=async()=>{let e=()=>r.s(`frame consent`);try{let t=await e();return{request:typeof t.frameConsent.request==`function`?t.frameConsent.request:void 0,ensure:t.frameConsent.ensure}}catch(t){if(!(t instanceof r.n))throw t;return{request:void 0,ensure:t=>e().then(e=>e.frameConsent.ensure(t))}}},h=`frame: this frame no longer holds the document the app attached it to`,g=!1,_=()=>{g||(g=!0,console.warn(`[fkn-frame] this FKN broker is too old to ask for permission categories, so nothing was asked for upfront and each capability is asked for as it is first used. Reloading the page picks up the current broker.`))},v=e=>[...e].flatMap(e=>{try{return[new URL(e).hostname]}catch{return[]}}),y=e=>typeof e?.reason==`string`?{reason:e.reason}:{},b=(e,t,n)=>n===null?`frame.${e}: the user did not grant ${t} here`:`frame.${e}: the user did not grant ${t} on ${n}`,x=e=>{let{assertLive:r,attach:i,consent:a,current:s,declaredHosts:c,documentHost:l,freshBlank:u,session:d,approvedOrigins:f}=e,p=new Set,m=()=>{try{return new URL(s()).hostname}catch{return``}},g=async()=>l?await l():m(),x=()=>n.t([...c,...v(f)]),S=async(e,t)=>(await e([t]))[0]??!1;return{gate:async({operation:e,args:s,phase:l})=>{r();let _=n.m(e,s);if(_===null)return;let v=t.h(_);if(v===void 0||v===`auto`)return;if(e===`fetch`){let e=o.frameFetchVerdict({session:d,declaredHosts:c,approvedOrigins:f},l===`ensure`?void 0:s[0],{classifier:`fetchTarget`});if(l===`ensure`&&!d)throw t.k(e.kind===`refuse`?e.reason:``,`fetch`);if(l!==`ensure`&&e.kind===`refuse`)throw t.k(e.reason,`fetch`);let{request:r,ensure:i}=await a();if(!r){if(e.kind===`refuse`)throw t.k(e.reason,`fetch`);if(!await i({scope:n.c(s[0],s[1]).scope,hosts:e.promptHosts}))throw t.k(`frame.fetch: the user did not grant this`,`fetch`);return}let u=e.kind===`consent`?e.targetHost:await g(),p=n.t([u,...c]);if(!p.length)throw t.k(`frame: navigate the frame before fetch`,`fetch`);if(await S(r,{category:`network`,hosts:p,...y(t.T(s))})===!1)throw t.k(b(`fetch`,`network`,u||null),`fetch`);return}let C=await g();if(!C)throw t.k(`frame: navigate the frame before ${e}`,e);if(!x().includes(C))throw t.k(h,e);let w=t.m(_);if(w===void 0||w===`evaluation`&&C===m()&&await u?.()||v===`critical`&&p.has(`${_} ${C}`))return;let{request:T}=await a();if(!T)return;let E=n.t([C,...c]),D=y(t.T(s)),O=v===`critical`?{key:_,hosts:E,attach:i,...D}:{category:w,hosts:E,...D},k=await S(T,O);if(k===!1)throw t.k(b(e,w,null),e);if(k===`once`&&l!==`ensure`)for(let e of E)p.add(`${_} ${e}`)},requestCategories:async e=>{r(),t.f(`frame.requestPermissions`,e);let o=await g(),s=n.t(o?[o,...c]:c);if(!s.length)throw TypeError(`frame.requestPermissions: navigate the frame or declare domains first`);let l=e.map(e=>{let n=e.key;return n===void 0?{named:void 0,critical:!1,category:e.category}:{named:n,critical:t.h(n)===`critical`,category:t.p(n)}}),u=({named:e,critical:t,category:n},r)=>({category:n,...t?{key:e}:{},hosts:s,allow:r}),{request:d}=await a();if(!d)return _(),l.map(e=>u(e,!1));let f=await d(l.map(({named:t,critical:n,category:r},a)=>{let o=y(e[a]);return n?{key:t,hosts:s,attach:i,...o}:{category:r,hosts:s,...o}}));return l.map((e,t)=>u(e,f[t]!==void 0&&f[t]!==!1))},boundary:x}},S=e=>e,C=5e3,w=new Set([]),T=()=>`https://fkn.app`,E=e=>e===`persistent`?``:`incognito-${crypto.randomUUID()}`,D=(e,n,r)=>{let i,a=new Promise((e,a)=>{i=setTimeout(()=>a(typeof r==`string`?new t.E(r):r()),n)});return Promise.race([e,a]).finally(()=>clearTimeout(i))},O=e=>Object.assign(Error(e),{name:t.D}),k=`frame.postMessage: this FKN page predates frame messaging; reload the app to load the current one`,A=`frame.addScriptTag: this render proxy predates addScriptTag; reload the app`,j=`frame.addScriptTag: no answer within ${t.l}ms; the script may or may not have run`,M=`frame.clearCookies: this FKN page predates clearCookies; reload the app to load the current one`,N=`frame.clearCookies: this attachment reaches no site yet; attach a url, goto one, or declare it in domains`,P=3e4,F=`attachFrame: this FKN page predates storageState; reload the app to load the current one`,I=2e4,L=async(e,n)=>{if(typeof e.seed!=`function`)throw t.N(F,`storageState`,`cloud`);try{await D(e.seed(n),I,`attachFrame: the render proxy did not take the storageState seed`)}catch(e){throw t.O(e)?t.N(F,`storageState`,`cloud`):e}},ee=`frame.clearCookies: the render proxy did not answer within ${P}ms; the cookies may or may not be gone, and calling it again is safe`,R=e=>t.O(e)&&e.message===t.j(`addScriptTag`).message,z=!1,te=()=>{z||(z=!0,console.warn(`[fkn-frame] this FKN page predates frame messaging, so the page's messages and documents are never reported. Reloading the app loads the current one.`))},B=({from:e,origin:t,attach:n,signal:r})=>i=>{let a=r=>{if(r.source===null||r.source!==e()||r.origin!==t)return;let a=r.data;typeof a==`object`&&a&&a.type===`fkn-frame-message`&&a.attach===n&&typeof a.origin==`string`&&(a.kind===`message`?i({type:`message`,data:a.data,origin:a.origin,ports:r.ports}):a.kind===`document`&&i({type:`document`,origin:a.origin}))};return window.addEventListener(`message`,a,{signal:r}),()=>window.removeEventListener(`message`,a)},ne=e=>{if(typeof e!=`function`)return()=>Promise.resolve(e);let t=null;return()=>t??=e().catch(e=>{throw t=null,e})},V=({control:e,target:n,blank:r=!1,session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,guard:l,consent:u,onNavigated:d,relay:f})=>{let p=n,m=r&&i!==``,g=async()=>{if(!m)return!1;let t=typeof e.blank==`function`?await l(()=>e.blank()):``;return(typeof t!=`string`||t.split(`#`)[0]!==n.split(`#`)[0])&&(m=!1),m},_=Promise.resolve(),{gate:v,requestCategories:y,boundary:b}=x({session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,documentHost:typeof e.documentHost==`function`?()=>l(()=>e.documentHost()):void 0,current:()=>p,consent:ne(u),freshBlank:g});return t.y({backend:`cloud`,executor:{execute:(n,r,i)=>w.has(r)?Promise.reject(t.j(r,`cloud`)):(c(),l(()=>e.executeLocator(n,r,i))),highlight:async()=>{}},gate:v,requestPermissions:y,evaluate:async(n,r)=>(c(),await v({parts:[],operation:`evaluate`,args:[n],phase:`execute`}),D(l(()=>e.executeLocator([],`evaluate`,[n,r])),t.l,t.u)),addScriptTag:async(n,r)=>{c();let i=[n,r];await v({parts:[],operation:`addScriptTag`,args:i,phase:`execute`});try{await D(l(()=>e.executeLocator([],`addScriptTag`,i)),t.l,j)}catch(e){throw R(e)?t.N(A,`addScriptTag`,`cloud`):e}},clearCookies:async n=>{if(c(),typeof e.clearCookies!=`function`)throw t.N(M,`clearCookies`,`cloud`);if(b().length===0)throw t.k(N,`clearCookies`);await D(l(()=>e.clearCookies(n)),P,ee)},postMessage:(n,r,i)=>{if(c(),typeof e.messaging!=`function`)throw t.N(k,`postMessage`,`cloud`);if(r!==`*`&&!b().includes(new URL(r).hostname))throw t.k(h,`postMessage`);let{port1:a,port2:o}=new MessageChannel;a.postMessage({data:n,transfer:i},i);let s=[o,r],u=_.then(async()=>(await v({parts:[],operation:`postMessage`,args:s,phase:`execute`}),{answer:l(()=>e.executeLocator([],`postMessage`,s))}));return _=u.catch(()=>{}),u.then(async({answer:e})=>{await e})},listen:t=>(typeof e.messaging!=`function`&&te(),f(t)),goto:async(n,{timeout:r,...i}={})=>{let a=new URL(n,location.href).href;c(),m=!1;let s=(()=>{try{return new URL(a).origin}catch{return``}})(),u=s!==``&&!o.has(s);u&&o.add(s);try{await D(l(()=>e.goto(a,r===void 0?i:{...i,timeoutMs:r})),(r??3e4)+C,`cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded`)}catch(e){throw u&&o.delete(s),t.c(e)}p=a,d()},url:()=>p})},re=250,ie=500,ae=65e3,oe=2e3,se=2e3,ce=2,le=2e3,ue=2e3,H=({origin:e,target:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-window`,e);return a.searchParams.set(`attach`,i),t&&a.searchParams.set(`url`,t),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.href},de=(e,t)=>{let n=document.createElement(`iframe`),r=new URL(`/attach-jar`,e);return r.searchParams.set(`attach`,t),n.src=r.href,n.tabIndex=-1,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`style`,`display:none`),(document.body??document.documentElement).appendChild(n),n},fe=(e,t)=>{let n=new MutationObserver(()=>{e.isConnected||t.aborted||(n.disconnect(),console.warn(`cloud.attachFrame: the window's jar anchor was removed from this page, so a sign-in in the window no longer reaches this app's cookie jar`))});e.parentNode&&n.observe(e.parentNode,{childList:!0}),n.observe(document.documentElement,{childList:!0}),t.addEventListener(`abort`,()=>n.disconnect(),{once:!0})},U=()=>O(`cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window`),W=()=>O(`cloud.attachFrame: the attached window stopped answering; attach a fresh window`),G=()=>O(`cloud.attachFrame: the window went away before it connected; attach a fresh window`),pe=()=>O(`cloud.attachFrame: the window closed before it connected. Either the user closed it, or this page's Cross-Origin-Opener-Policy cut its link to the window`),me=async(e,r,a)=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:o=[],permissions:c}=e,{url:l,width:u,height:d}=t.s(e.window);if(window.origin===`null`)throw new t._(`opaque-opener`);let f=T(),m=crypto.randomUUID(),h=E(r),g=n.t(o),_=new Set;l&&_.add(new URL(l).origin);let v=r===`persistent`?de(f,m):null,y=window.open(H({origin:f,target:a===void 0?l:``,session:h,domains:g,attach:m}),`_blank`,`popup,width=${u},height=${d}`);if(!y)throw v?.remove(),new t.g;let b=new AbortController,x=!1,C=null,w=(e,t=!1)=>{if(C===null){C=e,b.abort(t?W():U());try{y.closed||y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.detach,attach:m,...t?{unanswered:t}:{}},f)}catch{}v&&setTimeout(()=>v.remove(),ue)}};v&&fe(v,b.signal);let O=new Promise((e,t)=>{b.signal.addEventListener(`abort`,()=>t(b.signal.reason),{once:!0})});O.catch(()=>{});let k=O.then(()=>{},()=>{}),A=()=>{if(b.signal.aborted)throw b.signal.reason},j=e=>b.signal.aborted?Promise.reject(b.signal.reason):Promise.race([e(),O]),M=e=>e.source===y&&e.origin===f;window.addEventListener(`message`,e=>{if(!M(e))return;let n=e.data;typeof n==`object`&&n&&n.attach===m&&(n.type===s.ATTACH_WINDOW_MESSAGE.refused?w(new t._(n.reason)):n.type===s.ATTACH_WINDOW_MESSAGE.gone&&w(x?U():G()))},{signal:b.signal}),window.addEventListener(`pagehide`,()=>w(U()),{signal:b.signal});let N=()=>{try{y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.hello,attach:m},f)}catch{}};N();let P=setInterval(N,re),F=setInterval(()=>{y.closed&&w(x?U():pe())},ie);b.signal.addEventListener(`abort`,()=>{clearInterval(P),clearInterval(F)},{once:!0});let I=async e=>{try{return await Promise.race([e,O])}catch(e){throw C??e}};try{let e=await I(D((0,p.expose)({},{key:s.ATTACH_WINDOW_KEY,transport:{emit:(e,t)=>y.postMessage(e,f,t??[]),receive:e=>{let t=t=>{M(t)&&e(t.data,{source:t.source,origin:t.origin})};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}},unregisterSignal:b.signal,revivableModules:S(t.ft)}),s.WINDOW_HANDSHAKE_TIMEOUT_MS,`cloud.attachFrame: timed out connecting to the window`));x=!0,clearInterval(P);let n=0,r=setInterval(()=>{D(j(()=>e.ping()),se,`ping`).then(()=>{n=0},()=>{b.signal.aborted||(document.visibilityState===`hidden`?n=0:++n>=ce&&w(W(),!0))})},oe);b.signal.addEventListener(`abort`,()=>clearInterval(r),{once:!0}),await I(D(e.ready(),ae,`cloud.attachFrame: the window never became ready`)),a!==void 0&&await I(L(e,a)),i.r(`attached frame`,b.signal);let o=V({control:e,target:l,session:h,declaredHosts:g,approvedOrigins:_,attach:m,assertLive:A,guard:j,consent:{request:t=>j(()=>e.requestConsent(t)),ensure:t=>j(()=>e.requestConsent([t])).then(([e])=>e!==void 0&&e!==!1)},onNavigated:()=>{},relay:B({from:()=>y,origin:f,attach:m,signal:b.signal})}),u=null,d=Object.assign(o,{close:()=>u??=(async()=>{b.signal.aborted||await D(Promise.allSettled([j(()=>e.flushCookies()),j(()=>e.sweepStorage())]),le,`close`).catch(()=>{});try{y.close()}catch{}w(U())})(),closed:k});return a!==void 0&&l&&await I(d.goto(l)),c?.length&&await I(d.requestPermissions(c)),d}catch(e){let n=C??e;if(!(n instanceof t._))try{y.close()}catch{}throw w(n),n}},he=2e4,K=65e3,q=e=>!e||e===`about:blank`,ge=`cloud.attachFrame: this FKN page predates blank pages; reload the app to load the current one`,_e=`cloud.attachFrame: cookies: 'native' needs the FKN browser extension; the cloud render proxy has no browser cookies`,J=e=>e.split(`#`)[0]??``,Y=({iframe:e,lockdown:n,cookies:r,blank:i})=>{if(i===void 0)return``;if(typeof i!=`object`||!i)throw TypeError(`attachFrame: blank must be an object { url }`);let a=Object.keys(i).find(e=>e!==`url`);if(a!==void 0)throw TypeError(`attachFrame: blank takes { url }, not "${a}"`);let{url:o}=i,s=(()=>{try{return typeof o==`string`?new URL(o):null}catch{return null}})();if(!s||s.protocol!==`http:`&&s.protocol!==`https:`)throw TypeError(`attachFrame: blank.url must be an absolute http or https url, not "${String(o)}"`);let c=e.getAttribute(`src`)??``;if(!q(c))throw TypeError(`attachFrame: blank needs an iframe with no src; this one has "${c}"`);if(n)throw TypeError(`attachFrame: blank does not combine with lockdown`);if(r===`native`)throw TypeError(`attachFrame: blank runs on the cloud render proxy, which has no browser cookies; pass cookies: 'persistent' or 'ephemeral'`);if(t.x(s.href),!Ee())throw Error(`attachFrame: a blank page is served by the cloud render proxy, which this build does not configure`);return s.href},ve=({target:e,blank:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-frame`,T());return t?a.searchParams.set(`blank`,t):e&&a.searchParams.set(`url`,e),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.searchParams.set(`attach`,i),a.href},ye=(e,t)=>{let n=()=>{a(),t()},r=e.parentNode,i=new MutationObserver(()=>{(!e.isConnected||e.parentNode!==r)&&(a(),t())}),a=()=>{window.removeEventListener(`pagehide`,n),i.disconnect()};window.addEventListener(`pagehide`,n,{once:!0}),r&&i.observe(r,{childList:!0}),e.isConnected||(a(),t())},be=()=>O(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),xe=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},Se=[300,1200,4e3],X=e=>{let t=()=>{if(!e.isConnected)return;let t=e.style.height,n=e.getBoundingClientRect();n.height&&(e.style.height=`${n.height-1}px`,setTimeout(()=>{e.style.height=t},50))};t();for(let e of Se)setTimeout(t,e)},Ce=e=>{let t=e.getAttribute(`sandbox`);if(t===null)return;let n=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),r=[`allow-scripts`,`allow-same-origin`].filter(e=>!n.has(e));if(r.length)throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(` and `)} for the render proxy to load`)},we=async(e,n)=>{let r=typeof e.blank==`function`?await D(e.blank(),K,`cloud.attachFrame: the render proxy never became ready`):``;if(typeof r!=`string`||J(r)!==J(n))throw t.N(ge,`blank`,`cloud`)},Te=async(e,a,o)=>{let c=Y(e),{iframe:l,domains:u=[],permissions:d}=e;if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);if(!l.isConnected)throw Error(`cloud.attachFrame: the iframe must be connected to the document before attaching`);Ce(l);let f=l.getAttribute(`src`)??``,h=(()=>{if(q(f))return null;try{return new URL(l.src||f,location.href)}catch{throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${f}`)}})();if(h){let e=new URL(`/attach-frame`,T());if(h.origin===e.origin&&h.pathname===e.pathname)throw Error(`cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe`)}let g=h?.href??``;g&&t.x(g);let _=o===void 0?g:``,v=E(a),y=n.t(u),b=new Set;try{b.add(new URL(c||g).origin)}catch{}let x=new AbortController,C=l.referrerPolicy,w=l.allow,O=crypto.randomUUID();if(l.referrerPolicy=`origin`,l.allow=xe(r.m(),l.allow),l.src=ve({target:_,blank:c,session:v,domains:y,attach:O}),!l.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let e=await D((0,p.expose)({},{key:s.ATTACH_FRAME_KEY,origin:T(),transport:{receive:window,emit:l.contentWindow},unregisterSignal:x.signal,revivableModules:S(t.ft)}),he,`cloud.attachFrame: timed out connecting to the render proxy page`);await D(e.ready(),K,`cloud.attachFrame: the render proxy never became ready`),c&&await we(e,c),o!==void 0&&await L(e,o),(g||c)&&X(l),ye(l,()=>x.abort()),i.r(`attached frame`,x.signal);let n=l.contentWindow,r=V({control:e,target:c||g,blank:c!==``,session:v,declaredHosts:y,approvedOrigins:b,attach:O,assertLive:()=>{if(x.signal.aborted||!l.isConnected||l.contentWindow!==n)throw x.abort(),be()},guard:e=>e(),consent:m,onNavigated:()=>X(l),relay:B({from:()=>n,origin:T(),attach:O,signal:x.signal})});return o!==void 0&&g&&await r.goto(g),d?.length&&await r.requestPermissions(d),r}catch(e){throw x.abort(),l.referrerPolicy=C,l.allow=w,l.src=_||`about:blank`,e}},Z=(async e=>{let{kind:n,cookies:r,storageState:i}=t.o(e);if(r===`native`)throw TypeError(_e);return n===`window`?me(e,r,i):Te(e,r,i)}),Ee=()=>typeof window<`u`&&!0,Q=async()=>{let e=await r.o.then(e=>e.cloud.quota());return{premium:e.premium,overQuota:e.overQuota,throttled:e.overQuota&&!e.premium,usedBytes:e.usedBytes,limitBytes:e.limitBytes,remainingBytes:e.remaining,bytesPerSecond:e.bytesPerSecond,bitsPerSecond:e.bytesPerSecond*8}},De=e.t({attachFrame:()=>Z,available:()=>$,dgram:()=>d.t,dns:()=>c.t,fetch:()=>a.t,fs:()=>l.t,http:()=>f.t,net:()=>u.t,quota:()=>Q}),$=()=>r.l;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
package/cloud.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-CKNx2dKf.cjs"),t=require("./cloud-CCMu_LZl.cjs"),n=require("./dns.cjs"),r=require("./cloud/fs.cjs"),i=require("./net.cjs"),a=require("./dgram.cjs"),o=require("./http.cjs");exports.attachFrame=t.i,exports.available=t.t,Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return n.t}}),exports.fetch=e.t,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return r.t}}),Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return i.t}}),exports.quota=t.r;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-DhalpZoN.cjs"),t=require("./cloud-kg1hOpPJ.cjs"),n=require("./dns.cjs"),r=require("./cloud/fs.cjs"),i=require("./net.cjs"),a=require("./dgram.cjs"),o=require("./http.cjs");exports.attachFrame=t.i,exports.available=t.t,Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return n.t}}),exports.fetch=e.t,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return r.t}}),Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return i.t}}),exports.quota=t.r;
package/cloud.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { t as cloudFetch } from "./proxy-CjxVIiz2.js";
2
- import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-DrgnsG8_.js";
1
+ import { t as cloudFetch } from "./proxy-Cer0Iarp.js";
2
+ import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-Dykm74YZ.js";
3
3
  import { t as dns_d_exports } from "./dns.js";
4
4
  import { n as fs_d_exports } from "./fs-BZv2djbS.js";
5
- import { s as net_d_exports } from "./net-2q-K92j1.js";
5
+ import { s as net_d_exports } from "./net-Dq1KyRP0.js";
6
6
  import { t as dgram_d_exports } from "./dgram.js";
7
7
  import { t as http_d_exports } from "./http.js";
8
8
  export { type QuotaStatus, attachFrame, available, dgram_d_exports as dgram, dns_d_exports as dns, cloudFetch as fetch, fs_d_exports as fs, http_d_exports as http, net_d_exports as net, quota };
package/cloud.js CHANGED
@@ -1,5 +1,5 @@
1
- import { t as e } from "./proxy-Bwr-0XVF.js";
2
- import { i as t, r as n, t as r } from "./cloud-DyXqlXh9.js";
1
+ import { t as e } from "./proxy-v_Z5aPh2.js";
2
+ import { i as t, r as n, t as r } from "./cloud-CMEnCSBw.js";
3
3
  import { t as i } from "./dns.js";
4
4
  import { t as a } from "./cloud/fs.js";
5
5
  import { t as o } from "./net.js";
@@ -686,8 +686,8 @@ type RoomClaimOptions = {
686
686
  * Whether the room keeps its messages. `false` claims the name and stores nothing: a message reaches
687
687
  * whoever is present and is kept nowhere, `backlog` answers an empty page, and `edit` and `delete` are
688
688
  * refused `invalid` (`rooms: the room keeps no messages`). The claim still reserves the name, locks it
689
- * to the key and keeps the owner, the blocks and the overrides when everyone leaves, and it still needs
690
- * premium. `true` or no value keeps a mailbox. Anything else is refused `invalid` (`rooms: malformed
689
+ * to the key and keeps the owner, the blocks and the overrides when everyone leaves, and it still counts
690
+ * toward the account's claims. `true` or no value keeps a mailbox. Anything else is refused `invalid` (`rooms: malformed
691
691
  * frame`).
692
692
  *
693
693
  * Read only when the call starts the claim: on a room the account already holds it is ignored, so an
@@ -816,8 +816,9 @@ type RoomHandle = {
816
816
  ok: true;
817
817
  }>;
818
818
  /**
819
- * keeps the name for the signed-in premium account, and a mailbox unless `mailbox` is false; the only
820
- * thing in rooms that premium buys. `description` says what the room is for, shown to the account in
819
+ * keeps the name for the signed-in account, and a mailbox unless `mailbox` is false. A free account holds
820
+ * 5 claims and a premium one 10, in any scope, `global` included; once premium lapses the account keeps its
821
+ * 5 oldest claims and the others are released 30 days later. `description` says what the room is for, shown to the account in
821
822
  * its fkn.app settings. `temporary` makes the claim end by itself that many milliseconds after its last
822
823
  * claim (`true` is 7 days); the broker carries it as a number of milliseconds and never as `true`.
823
824
  * `mailbox` is read only when the call starts the claim.
package/contract.d.ts CHANGED
@@ -1,4 +1,4 @@
1
1
  import { d as CookieMatchWire, u as ClearCookiesWire } from "./index-BQ5OZQhf.js";
2
- import { $ as RoomHandle, A as MiddleGotoOptions, At as SurfaceRect, B as ProxyFetch, Bt as WINDOW_JAR_MODE_TIMEOUT_MS, C as FrameMessageRelay, Ct as StorageProgress, D as IpFamily, Dt as StoredHandle, E as InstalledPackage, Et as StorageQuota, F as PackageResult, Ft as UdpDatagram, G as Radii, H as ProxyFetchInput, Ht as WriteData, I as PackagesErrorCode, It as UdpSocketOptions, J as RoomClaimOptions, K as Resolvers, L as PackagesFail, Lt as UdpSocketResult, M as OverlayRect, Mt as TcpSocketListenerResult, N as OverlayState, Nt as TcpSocketOptions, O as JAR_ANCHOR_MESSAGE, Ot as StoredObject, P as PackageQuery, Pt as TcpSocketResult, Q as RoomEvent, R as PickOptions, Rt as WINDOW_HANDSHAKE_TIMEOUT_MS, S as FrameFetchScope, St as StorageFail, T as InstallOptions, Tt as StoragePutWire, U as Quota, Ut as JarSeed, V as ProxyFetchInit, Vt as WindowMiddleControl, W as ROOM_TEMPORARY_MS, Wt as JarSeedCookie, X as RoomDefaults, Y as RoomCreateOptions, Z as RoomEnd, _ as DnsLookup, _t as ShellFrameMessage, a as AccountChange, at as RoomPermission, b as FrameConsentAnswer, bt as StorageEntry, c as AdoptRequest, ct as RoomsFail, d as ConflictRequest, dt as SHELL_FRAME_MESSAGE, et as RoomJoinOptions, f as ConflictSide, ft as SHELL_JAR_MESSAGE, g as DisplayLevel, gt as ShellControl, h as DisplayCause, ht as SetOverlayHost, i as Account, it as RoomOpenOptions, j as MountDescriptor, jt as TcpSocketListenerOptions, k as MiddleControl, kt as StoredPage, l as AdoptState, lt as SHELL_ATTACH_ERROR, m as ConnectOptions, mt as STORAGE_REFUSALS, n as ATTACH_WINDOW_KEY, nt as RoomMember, o as AccountPinOptions, ot as RoomPermissions, p as ConnectAvailability, pt as SHELL_JAR_UNREACHABLE, q as RoomBacklog, r as ATTACH_WINDOW_MESSAGE, rt as RoomMessage, s as AddressLookupResult, st as RoomsErrorCode, t as ATTACH_FRAME_KEY, tt as RoomMailbox, u as ConflictChoice, ut as SHELL_CONTROL_KEY, v as EncryptionState, vt as ShellGotoOptions, w as HiddenSurface, wt as StoragePutOptions, x as FrameConsentRequest, xt as StorageErrorCode, y as FRAME_MESSAGE, yt as ShellJarUnreachable, z as Placement, zt as WINDOW_HELLO_TIMEOUT_MS } from "./contract-De1rQSCD.js";
2
+ import { $ as RoomHandle, A as MiddleGotoOptions, At as SurfaceRect, B as ProxyFetch, Bt as WINDOW_JAR_MODE_TIMEOUT_MS, C as FrameMessageRelay, Ct as StorageProgress, D as IpFamily, Dt as StoredHandle, E as InstalledPackage, Et as StorageQuota, F as PackageResult, Ft as UdpDatagram, G as Radii, H as ProxyFetchInput, Ht as WriteData, I as PackagesErrorCode, It as UdpSocketOptions, J as RoomClaimOptions, K as Resolvers, L as PackagesFail, Lt as UdpSocketResult, M as OverlayRect, Mt as TcpSocketListenerResult, N as OverlayState, Nt as TcpSocketOptions, O as JAR_ANCHOR_MESSAGE, Ot as StoredObject, P as PackageQuery, Pt as TcpSocketResult, Q as RoomEvent, R as PickOptions, Rt as WINDOW_HANDSHAKE_TIMEOUT_MS, S as FrameFetchScope, St as StorageFail, T as InstallOptions, Tt as StoragePutWire, U as Quota, Ut as JarSeed, V as ProxyFetchInit, Vt as WindowMiddleControl, W as ROOM_TEMPORARY_MS, Wt as JarSeedCookie, X as RoomDefaults, Y as RoomCreateOptions, Z as RoomEnd, _ as DnsLookup, _t as ShellFrameMessage, a as AccountChange, at as RoomPermission, b as FrameConsentAnswer, bt as StorageEntry, c as AdoptRequest, ct as RoomsFail, d as ConflictRequest, dt as SHELL_FRAME_MESSAGE, et as RoomJoinOptions, f as ConflictSide, ft as SHELL_JAR_MESSAGE, g as DisplayLevel, gt as ShellControl, h as DisplayCause, ht as SetOverlayHost, i as Account, it as RoomOpenOptions, j as MountDescriptor, jt as TcpSocketListenerOptions, k as MiddleControl, kt as StoredPage, l as AdoptState, lt as SHELL_ATTACH_ERROR, m as ConnectOptions, mt as STORAGE_REFUSALS, n as ATTACH_WINDOW_KEY, nt as RoomMember, o as AccountPinOptions, ot as RoomPermissions, p as ConnectAvailability, pt as SHELL_JAR_UNREACHABLE, q as RoomBacklog, r as ATTACH_WINDOW_MESSAGE, rt as RoomMessage, s as AddressLookupResult, st as RoomsErrorCode, t as ATTACH_FRAME_KEY, tt as RoomMailbox, u as ConflictChoice, ut as SHELL_CONTROL_KEY, v as EncryptionState, vt as ShellGotoOptions, w as HiddenSurface, wt as StoragePutOptions, x as FrameConsentRequest, xt as StorageErrorCode, y as FRAME_MESSAGE, yt as ShellJarUnreachable, z as Placement, zt as WINDOW_HELLO_TIMEOUT_MS } from "./contract-BN0cD-Oq.js";
3
3
  import { o as TcpSocketOption, x as UdpSocketOption } from "./wire-Fk5pJaoy.js";
4
4
  export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AccountChange, AccountPinOptions, AddressLookupResult, AdoptRequest, AdoptState, type ClearCookiesWire, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, type CookieMatchWire, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FRAME_MESSAGE, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, FrameMessageRelay, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, type JarSeed, type JarSeedCookie, MiddleControl, MiddleGotoOptions, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, ROOM_TEMPORARY_MS, Radii, Resolvers, RoomBacklog, RoomClaimOptions, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_FRAME_MESSAGE, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, STORAGE_REFUSALS, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageErrorCode, StorageFail, StorageProgress, StoragePutOptions, StoragePutWire, StorageQuota, StoredHandle, StoredObject, StoredPage, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WINDOW_HANDSHAKE_TIMEOUT_MS, WINDOW_HELLO_TIMEOUT_MS, WINDOW_JAR_MODE_TIMEOUT_MS, WindowMiddleControl, WriteData };