@fkn/lib 0.9.50 → 0.9.52

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 (75) hide show
  1. package/{account-generation-hUekEHGW.js → account-generation-BZ_gXQoZ.js} +1 -1
  2. package/{account-generation-9VhfEDoW.cjs → account-generation-D8wbg2Lb.cjs} +1 -1
  3. package/{account-storage-C6hcXjG0.cjs → account-storage-BT2pPuWs.cjs} +1 -1
  4. package/{account-storage-C31d68BN.js → account-storage-C38Ydzh-.js} +2 -2
  5. package/account.cjs +1 -1
  6. package/account.js +2 -2
  7. package/api-2ecr7axy.cjs +3 -0
  8. package/{api-ySazPAwN.js → api-BrqGe-Yz.js} +130 -122
  9. package/{api-wnOQJEK6.d.ts → api-eOIMGYAJ.d.ts} +10 -9
  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-CCMu_LZl.cjs +1 -0
  21. package/{cloud-CWHjH89l.d.ts → cloud-DrgnsG8_.d.ts} +3 -3
  22. package/cloud-DyXqlXh9.js +556 -0
  23. package/cloud.cjs +1 -1
  24. package/cloud.d.ts +3 -3
  25. package/cloud.js +2 -2
  26. package/{contract-DGuGXxKd.d.ts → contract-De1rQSCD.d.ts} +7 -2
  27. package/contract.d.ts +2 -2
  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-Cqd8OFr3.js +95 -0
  35. package/extension-D-MgH488.cjs +1 -0
  36. package/{extension-C4Don9vi.d.ts → extension-kE9yzbkW.d.ts} +29 -8
  37. package/extension.cjs +1 -1
  38. package/extension.d.ts +3 -3
  39. package/extension.js +3 -3
  40. package/fs/promises.cjs +1 -1
  41. package/fs/promises.js +1 -1
  42. package/{fs-zERmcLRS.cjs → fs-BUf_-umC.cjs} +1 -1
  43. package/{fs-ClnOPmRF.js → fs-BaZ7k_5D.js} +2 -2
  44. package/fs.cjs +1 -1
  45. package/fs.js +2 -2
  46. package/http.d.ts +1 -1
  47. package/{index-DlBWSKwV.d.ts → index-BQ5OZQhf.d.ts} +19 -5
  48. package/index.cjs +1 -1
  49. package/index.d.ts +5 -5
  50. package/index.js +50 -50
  51. package/lib-B3BXMegM.cjs +53 -0
  52. package/{lib-B2cML3Tq.js → lib-ERmfLvVp.js} +423 -414
  53. package/{net-C2sulnNU.d.ts → net-2q-K92j1.d.ts} +2 -2
  54. package/net.cjs +1 -1
  55. package/net.d.ts +1 -1
  56. package/net.js +1 -1
  57. package/package.json +1 -1
  58. package/packages.cjs +1 -1
  59. package/packages.d.ts +1 -1
  60. package/packages.js +1 -1
  61. package/{proxy-BXkxwBxK.js → proxy-Bwr-0XVF.js} +1 -1
  62. package/{proxy-BfkfFsNI.cjs → proxy-CKNx2dKf.cjs} +1 -1
  63. package/{proxy-MVuD49E2.d.ts → proxy-CjxVIiz2.d.ts} +2 -2
  64. package/rooms.cjs +1 -1
  65. package/rooms.d.ts +1 -1
  66. package/rooms.js +1 -1
  67. package/storage.cjs +1 -1
  68. package/storage.d.ts +1 -1
  69. package/storage.js +3 -3
  70. package/api-DMnVye0K.cjs +0 -3
  71. package/cloud-CAN_iu2o.cjs +0 -1
  72. package/cloud-JXQKSDrW.js +0 -548
  73. package/extension-1Je_RJ6_.js +0 -94
  74. package/extension-4koB6bS6.cjs +0 -1
  75. package/lib-35d-3W0p.cjs +0 -53
@@ -1,4 +1,4 @@
1
- import { c as e, l as t, u as n } from "./api-ySazPAwN.js";
1
+ import { c as e, l as t, u as n } from "./api-BrqGe-Yz.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-DMnVye0K.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-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 +1 @@
1
- const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-DMnVye0K.cjs"),n=require("./messages.cjs"),r=require("./account-generation-9VhfEDoW.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-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,7 +1,7 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { o as t } from "./api-ySazPAwN.js";
2
+ import { o as t } from "./api-BrqGe-Yz.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-hUekEHGW.js";
4
+ import { n as a, r as o, t as s } from "./account-generation-BZ_gXQoZ.js";
5
5
  //#region src/account-storage.ts
6
6
  var c = /* @__PURE__ */ e({
7
7
  StorageAccountChangedError: () => f,
package/account.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-DMnVye0K.cjs"),n=require("./account-generation-9VhfEDoW.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-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}});
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-ySazPAwN.js";
3
- import { i as r } from "./account-generation-hUekEHGW.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";
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`,`fkn.cloudflareaccess.com`,`horionsoftware.com`,`62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com`,`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`,`stub.plugins.banou.dev`],ye=e=>e.replace(/\.+$/,``),be=[`79.127.204.69`,`152.233.49.59`],xe=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},Se=e=>{let t=ye(e);if(ve.some(e=>t===e||t.endsWith(`.${e}`)))return!0;let n=xe(t);return n!==void 0&&be.includes(n)},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(`.`),k=()=>{try{let e=globalThis.document?.featurePolicy?.features?.();return e===void 0?void 0:new Set(e)}catch{return}},A=(e=!0,t=k())=>[...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`:``}`,Te=`fkn-api-port`,F=`fkn-api-port-ack`,Ee=2e3,De=()=>{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===F&&r(t.port1)},a=setTimeout(()=>r(void 0),Ee);t.port1.addEventListener(`message`,i),t.port1.start();try{e.postMessage({type:Te},j,[t.port2])}catch{r(void 0)}})},I,Oe=()=>{if(I||!M)return I;let e=M.querySelector(`iframe[src="${P}"]`);if(e)I=e;else{let e=M.createElement(`iframe`);e.setAttribute(`allow`,A(N)),e.src=P,M.body.appendChild(e),I=e}return ge(I),I},L=(async()=>{if(!M)return;let e=await De();if(e)return{receive:e,emit:e};let t=Oe();if(!t)return;await i(t);let n=t.contentWindow;return n?{receive:window,emit:n}:void 0})(),ke=(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()}}},R=!1,z=new Set,B=()=>R,Ae=()=>{if(!R){R=!0;for(let e of[...z])try{e()}catch{}z.clear()}},V=e=>{R?e():z.add(e)},je=typeof window<`u`||typeof self<`u`,H=async()=>{if(typeof window<`u`)return L;if(typeof self<`u`)return{receive:self,emit:self}},U=`fkn-api`,Me=`fkn-api-window`,Ne={async*[Symbol.asyncIterator](){let t=await H();if(!t){await new Promise(()=>{});return}if(!B()){let n=new AbortController;V(()=>n.abort());for await(let r of(0,e.expose)({},{key:U,transport:t,unregisterSignal:n.signal})){if(n.signal.aborted)break;yield r}}yield*(0,e.expose)({},{key:Me,transport:t})}},W=!1,G=H().then(t=>new Promise(n=>{if(!t)return;let{receive:r}=t,i=t=>{(0,e.checkOsraMessageKey)(t.data,U)&&(r.removeEventListener(`message`,i),W=!0,n())};r.addEventListener(`message`,i)})),K=ke(Ne,{boundRetired:e=>Promise.race([e,G.then(()=>Q(e,()=>new Z))])});V(()=>K.retire());var q=Promise.race([K.first,new Promise(e=>V(e))]).then(()=>K.facade),J=8e3,Pe=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?Pe:J;return Promise.race([e,new Promise((e,r)=>setTimeout(()=>{Y=!0,r(t(n))},n))])},Fe=e=>B()?Q(K.routable().then(()=>K.facade),t=>W?new Z:new X(e,t)):Q(q,t=>new X(e,t));V(()=>{G.then(()=>{let e=setTimeout(()=>console.error(new Z),J);K.routable().then(()=>clearTimeout(e))})});var $=K.onEpoch,Ie=K.current,Le=K.lastCall,Re=K.inFlight;$(e=>{pe()&&e.overlay.setHost(_e,{exactClips:f()}).catch(()=>{})}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Ae}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return L}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return je}}),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 q}}),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 Fe}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return J}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return $}});
@@ -1,6 +1,6 @@
1
- import { expose as e } from "osra";
1
+ import { checkOsraMessageKey as e, expose as t } from "osra";
2
2
  //#region src/frame-ready.ts
3
- var t = 1e4, n = 16, r = (e) => {
3
+ var n = 1e4, r = 16, i = (e) => {
4
4
  let t;
5
5
  try {
6
6
  t = e.contentWindow;
@@ -14,43 +14,43 @@ var t = 1e4, n = 16, r = (e) => {
14
14
  } catch {
15
15
  return !0;
16
16
  }
17
- }, i = (e, i = t) => new Promise((t) => {
18
- if (r(e)) return t();
17
+ }, a = (e, t = n) => new Promise((n) => {
18
+ if (i(e)) return n();
19
19
  let a = () => {
20
- clearInterval(o), clearTimeout(s), e.removeEventListener("load", a), t();
20
+ clearInterval(o), clearTimeout(s), e.removeEventListener("load", a), n();
21
21
  }, o = setInterval(() => {
22
- r(e) && a();
23
- }, n), s = setTimeout(a, i);
22
+ i(e) && a();
23
+ }, r), s = setTimeout(a, t);
24
24
  e.addEventListener("load", a);
25
- }), 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) => {
25
+ }), o = 32, s = 8, c = 120, l = typeof CSS < "u" && CSS.supports("clip-path", "path('M0 0H1V1H0Z')"), u = typeof CSS < "u" && CSS.supports("clip-path", "polygon(nonzero, 0px 0px, 1px 0px, 1px 1px)"), d = (e) => {
26
26
  let t = e.style;
27
27
  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");
28
- }, d = ({ x: e, y: t, width: n, height: r, radius: i }) => {
28
+ }, f = ({ x: e, y: t, width: n, height: r, radius: i }) => {
29
29
  if (!i) return `M${e} ${t}h${n}v${r}h${-n}Z`;
30
30
  let a = Math.min(n, r) / 2, [o, s, c, l] = i.map((e) => Math.max(0, Math.min(e, a)));
31
31
  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`;
32
- }, f = () => c && l, p = ({ x: e, y: t, width: n, height: r }) => [
32
+ }, p = () => l && u, m = ({ x: e, y: t, width: n, height: r }) => [
33
33
  [e, t],
34
34
  [e + n, t],
35
35
  [e + n, t + r],
36
36
  [e, t + r],
37
37
  [e, t]
38
- ], m = (e) => {
38
+ ], h = (e) => {
39
39
  let t = e[0];
40
40
  if (!t) return [];
41
- let n = p(t)[0], r = [];
41
+ let n = m(t)[0], r = [];
42
42
  return e.forEach((t, i) => {
43
- r.push(...p(t)), i > 0 && i < e.length - 1 && r.push(n);
43
+ r.push(...m(t)), i > 0 && i < e.length - 1 && r.push(n);
44
44
  }), r;
45
- }, 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) => {
45
+ }, g = (e) => `polygon(nonzero, ${h(e).map(([e, t]) => `${e}px ${t}px`).join(", ")})`, ee = ({ x: e, y: t, width: n, height: r, radius: i }, a) => {
46
46
  let o = `${t}px ${a.width - e - n}px ${a.height - t - r}px ${e}px`;
47
47
  return i ? `inset(${o} round ${i.map((e) => `${e}px`).join(" ")})` : `inset(${o})`;
48
- }, ee = (e, t, n) => {
48
+ }, te = (e, t, n) => {
49
49
  if (t) return "none";
50
50
  if (e.length === 0) return "inset(100%)";
51
51
  let r = e.length === 1 ? e[0] : void 0;
52
- return r ? g(r, n) : l && e.length <= 5 && !e.some((e) => e.radius) ? h(e) : `path('${e.map(d).join("")}')`;
53
- }, _ = (e) => {
52
+ return r ? ee(r, n) : u && e.length <= 5 && !e.some((e) => e.radius) ? g(e) : `path('${e.map(f).join("")}')`;
53
+ }, ne = (e) => {
54
54
  if (e.length < 2) return null;
55
55
  let t = Math.min(...e.map((e) => e.x)), n = Math.min(...e.map((e) => e.y));
56
56
  return {
@@ -59,51 +59,51 @@ var t = 1e4, n = 16, r = (e) => {
59
59
  width: Math.max(...e.map((e) => e.x + e.width)) - t,
60
60
  height: Math.max(...e.map((e) => e.y + e.height)) - n
61
61
  };
62
- }, te = (e, t, n) => t >= e.x && t < e.x + e.width && n >= e.y && n < e.y + e.height, ne = 16, v = (e, t, n) => t === 1 ? e * ne : t === 2 ? e * n : e, re = (e, t, n) => {
62
+ }, re = (e, t, n) => t >= e.x && t < e.x + e.width && n >= e.y && n < e.y + e.height, ie = 16, _ = (e, t, n) => t === 1 ? e * ie : t === 2 ? e * n : e, ae = (e, t, n) => {
63
63
  let r = getComputedStyle(e);
64
64
  return n !== 0 && /auto|scroll/.test(r.overflowY) && e.scrollHeight > e.clientHeight ? !0 : t !== 0 && /auto|scroll/.test(r.overflowX) && e.scrollWidth > e.clientWidth;
65
- }, ie = (e, t, n) => {
66
- for (let r = e; r; r = r.parentElement) if (re(r, t, n)) return r;
65
+ }, oe = (e, t, n) => {
66
+ for (let r = e; r; r = r.parentElement) if (ae(r, t, n)) return r;
67
67
  return document.scrollingElement;
68
- }, y = null, b = null, x = (e) => ({
68
+ }, v = null, y = null, b = (e) => ({
69
69
  width: e.offsetWidth || window.innerWidth,
70
70
  height: e.offsetHeight || window.innerHeight
71
- }), S = (e) => {
72
- if (!b || !y || !te(b, e.clientX, e.clientY)) return;
71
+ }), x = (e) => {
72
+ if (!y || !v || !re(y, e.clientX, e.clientY)) return;
73
73
  let t = document.elementFromPoint(e.clientX, e.clientY);
74
- if (!t || t === y) return;
75
- let n = v(e.deltaX, e.deltaMode, window.innerWidth), r = v(e.deltaY, e.deltaMode, window.innerHeight), i = ie(t, n, r);
74
+ if (!t || t === v) return;
75
+ let n = _(e.deltaX, e.deltaMode, window.innerWidth), r = _(e.deltaY, e.deltaMode, window.innerHeight), i = oe(t, n, r);
76
76
  i && (i.scrollBy({
77
77
  left: n,
78
78
  top: r,
79
79
  behavior: "instant"
80
80
  }), e.cancelable && e.preventDefault());
81
- }, ae = (e) => {
82
- let t = b !== null;
83
- b = e, t !== (e !== null) && (e ? window.addEventListener("wheel", S, {
81
+ }, se = (e) => {
82
+ let t = y !== null;
83
+ y = e, t !== (e !== null) && (e ? window.addEventListener("wheel", x, {
84
84
  capture: !0,
85
85
  passive: !1
86
- }) : window.removeEventListener("wheel", S, { capture: !0 }));
87
- }, C = 0, oe = (e) => {
88
- if (e === C) return;
89
- C = e;
86
+ }) : window.removeEventListener("wheel", x, { capture: !0 }));
87
+ }, S = 0, ce = (e) => {
88
+ if (e === S) return;
89
+ S = e;
90
90
  let t = document.documentElement.style;
91
91
  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"));
92
- }, w = (e, { modal: t, rects: n, inset: r }, i) => {
93
- if (oe(r), !c) {
92
+ }, C = (e, { modal: t, rects: n, inset: r }, i) => {
93
+ if (ce(r), !l) {
94
94
  let r = t || n.length > 0;
95
95
  e.style.setProperty("pointer-events", r ? "auto" : "none", "important"), e.style.setProperty("visibility", r ? "visible" : "hidden", "important");
96
96
  return;
97
97
  }
98
- let a = ee(n, t, i), o = a === "none" || CSS.supports("clip-path", a) ? a : "inset(100%)";
99
- e.style.setProperty("clip-path", o, "important"), ae(t || o !== a ? null : _(n));
100
- }, se = (e) => {
98
+ let a = te(n, t, i), o = a === "none" || CSS.supports("clip-path", a) ? a : "inset(100%)";
99
+ e.style.setProperty("clip-path", o, "important"), se(t || o !== a ? null : ne(n));
100
+ }, le = (e) => {
101
101
  if (typeof e != "object" || !e) return 0;
102
102
  let { top: t } = e;
103
- return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? 0 : Math.min(Math.round(t), s);
104
- }, ce = (e) => {
103
+ return typeof t != "number" || !Number.isFinite(t) || t <= 0 ? 0 : Math.min(Math.round(t), c);
104
+ }, ue = (e) => {
105
105
  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;
106
- }, le = (e, t) => {
106
+ }, de = (e, t) => {
107
107
  if (typeof e != "object" || !e) return null;
108
108
  let { x: n, y: r, width: i, height: a } = e;
109
109
  if (![
@@ -112,7 +112,7 @@ var t = 1e4, n = 16, r = (e) => {
112
112
  i,
113
113
  a
114
114
  ].every((e) => typeof e == "number" && Number.isFinite(e))) return null;
115
- 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 = ce(e.radius);
115
+ 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 = ue(e.radius);
116
116
  return {
117
117
  x: c,
118
118
  y: l,
@@ -120,48 +120,48 @@ var t = 1e4, n = 16, r = (e) => {
120
120
  height: d - l,
121
121
  ...f ? { radius: f } : {}
122
122
  };
123
- }, T = {
123
+ }, w = {
124
124
  "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",
125
125
  clipped: "it is clipped away or positioned outside the viewport",
126
126
  "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"
127
- }, ue = (e) => Array.isArray(e) ? e.slice(0, o).flatMap((e) => {
127
+ }, fe = (e) => Array.isArray(e) ? e.slice(0, s).flatMap((e) => {
128
128
  if (typeof e != "object" || !e) return [];
129
129
  let { kind: t, cause: n, level: r } = e;
130
- return typeof t != "string" || t.length > 40 || typeof n != "string" || !(n in T) || r !== "full" && r !== "liveness" ? [] : [{
130
+ return typeof t != "string" || t.length > 40 || typeof n != "string" || !(n in w) || r !== "full" && r !== "liveness" ? [] : [{
131
131
  kind: t,
132
132
  cause: n,
133
133
  level: r
134
134
  }];
135
- }) : [], E = /* @__PURE__ */ new Set(), de = (e) => {
136
- for (let { kind: t, cause: n, level: r } of e) E.has(t) || (E.add(t), console.error(`[FKN] The FKN ${JSON.stringify(t)} is not visible on this page: ${T[n]}. Nobody using this page can see or answer it.
135
+ }) : [], T = /* @__PURE__ */ new Set(), pe = (e) => {
136
+ 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.
137
137
  @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" ? "\nThis browser reports limited detail, so the cause above is a best guess." : "")));
138
- }, D = (e, t) => {
138
+ }, E = (e, t) => {
139
139
  if (typeof e != "object" || !e) return null;
140
- let n = e, r = (Array.isArray(n.rects) ? n.rects.slice(0, a) : []).map((e) => le(e, t)).filter((e) => e !== null && e.width > 0 && e.height > 0);
140
+ let n = e, r = (Array.isArray(n.rects) ? n.rects.slice(0, o) : []).map((e) => de(e, t)).filter((e) => e !== null && e.width > 0 && e.height > 0);
141
141
  return {
142
142
  modal: n.modal === !0,
143
143
  rects: r,
144
- hidden: ue(n.hidden),
145
- inset: se(n.inset)
144
+ hidden: fe(n.hidden),
145
+ inset: le(n.inset)
146
146
  };
147
- }, fe = () => y !== null, O = null, k = null, pe = () => {
148
- if (!y || O === null) return;
149
- let e = x(y), t = D(O, e);
150
- t && w(y, t, e);
151
- }, me = (e) => {
152
- typeof ResizeObserver < "u" && (k ??= new ResizeObserver(pe), k.disconnect(), k.observe(e));
153
- }, he = (e) => {
154
- u(e), w(e, {
147
+ }, me = () => v !== null, D = null, O = null, he = () => {
148
+ if (!v || D === null) return;
149
+ let e = b(v), t = E(D, e);
150
+ t && C(v, t, e);
151
+ }, ge = (e) => {
152
+ typeof ResizeObserver < "u" && (O ??= new ResizeObserver(he), O.disconnect(), O.observe(e));
153
+ }, _e = (e) => {
154
+ d(e), C(e, {
155
155
  modal: !1,
156
156
  rects: [],
157
157
  hidden: [],
158
158
  inset: 0
159
- }, x(e)), y = e, me(e);
160
- }, ge = (e) => {
161
- if (!y) return;
162
- let t = x(y), n = D(e, t);
163
- n && (O = e, w(y, n, t), de(n.hidden));
164
- }, _e = [
159
+ }, b(e)), v = e, ge(e);
160
+ }, ve = (e) => {
161
+ if (!v) return;
162
+ let t = b(v), n = E(e, t);
163
+ n && (D = e, C(v, n, t), pe(n.hidden));
164
+ }, ye = [
165
165
  "fkn.app",
166
166
  "fkn.dev",
167
167
  "sdbx.app",
@@ -183,7 +183,7 @@ var t = 1e4, n = 16, r = (e) => {
183
183
  "container-ckf.pages.dev",
184
184
  "stub-plugin.pages.dev",
185
185
  "stub.plugins.banou.dev"
186
- ], ve = (e) => e.replace(/\.+$/, ""), ye = ["79.127.204.69", "152.233.49.59"], A = (e) => {
186
+ ], be = (e) => e.replace(/\.+$/, ""), xe = ["79.127.204.69", "152.233.49.59"], Se = (e) => {
187
187
  let t;
188
188
  try {
189
189
  t = new URL(`http://${e.includes(":") && !e.startsWith("[") ? `[${e}]` : e}/`).hostname;
@@ -201,28 +201,28 @@ var t = 1e4, n = 16, r = (e) => {
201
201
  ].join(".");
202
202
  }
203
203
  return /^\d+\.\d+\.\d+\.\d+$/.test(t) ? t : void 0;
204
- }, j = (e) => {
205
- let t = ve(e);
206
- if (_e.some((e) => t === e || t.endsWith(`.${e}`))) return !0;
207
- let n = A(t);
208
- return n !== void 0 && ye.includes(n);
209
- }, M = (e) => {
204
+ }, 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);
209
+ }, we = (e) => {
210
210
  let t = typeof e == "string" ? e : e instanceof URL ? e.href : e.url, n;
211
211
  try {
212
212
  n = new URL(t);
213
213
  } catch {
214
214
  return;
215
215
  }
216
- if (j(n.hostname)) throw Error(`fetch refuses FKN platform domains (${n.hostname})`);
217
- }, N = /* @__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("."), P = () => {
216
+ 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 = () => {
218
218
  try {
219
219
  let e = globalThis.document?.featurePolicy?.features?.();
220
220
  return e === void 0 ? void 0 : new Set(e);
221
221
  } catch {
222
222
  return;
223
223
  }
224
- }, F = (e = !0, t = P()) => [...N, ...e ? ["cross-origin-isolated"] : []].filter((e) => t === void 0 || t.has(e)).join("; "), I = "https://fkn.app", L = typeof globalThis < "u" && globalThis.document ? globalThis.document : void 0, R = typeof globalThis < "u" && globalThis.crossOriginIsolated === !0, z = `${I}/api${R ? "?coi=1" : ""}`, be = "fkn-api-port", xe = "fkn-api-port-ack", Se = 2e3, Ce = () => {
225
- if (!L || typeof window > "u" || window.parent === window) return Promise.resolve(void 0);
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 = () => {
225
+ if (!M || typeof window > "u" || window.parent === window) return Promise.resolve(void 0);
226
226
  let e;
227
227
  try {
228
228
  e = window.parent;
@@ -237,40 +237,40 @@ var t = 1e4, n = 16, r = (e) => {
237
237
  } catch {}
238
238
  n(e);
239
239
  }, i = (e) => {
240
- e.data?.type === xe && r(t.port1);
241
- }, a = setTimeout(() => r(void 0), Se);
240
+ e.data?.type === De && r(t.port1);
241
+ }, a = setTimeout(() => r(void 0), Oe);
242
242
  t.port1.addEventListener("message", i), t.port1.start();
243
243
  try {
244
- e.postMessage({ type: be }, I, [t.port2]);
244
+ e.postMessage({ type: Ee }, j, [t.port2]);
245
245
  } catch {
246
246
  r(void 0);
247
247
  }
248
248
  });
249
- }, B, we = () => {
250
- if (B || !L) return B;
251
- let e = L.querySelector(`iframe[src="${z}"]`);
252
- if (e) B = e;
249
+ }, F, Ae = () => {
250
+ if (F || !M) return F;
251
+ let e = M.querySelector(`iframe[src="${P}"]`);
252
+ if (e) F = e;
253
253
  else {
254
- let e = L.createElement("iframe");
255
- e.setAttribute("allow", F(R)), e.src = z, L.body.appendChild(e), B = e;
254
+ let e = M.createElement("iframe");
255
+ e.setAttribute("allow", A(N)), e.src = P, M.body.appendChild(e), F = e;
256
256
  }
257
- return he(B), B;
258
- }, V = (async () => {
259
- if (!L) return;
260
- let e = await Ce();
257
+ return _e(F), F;
258
+ }, I = (async () => {
259
+ if (!M) return;
260
+ let e = await ke();
261
261
  if (e) return {
262
262
  receive: e,
263
263
  emit: e
264
264
  };
265
- let t = we();
265
+ let t = Ae();
266
266
  if (!t) return;
267
- await i(t);
267
+ await a(t);
268
268
  let n = t.contentWindow;
269
269
  return n ? {
270
270
  receive: window,
271
271
  emit: n
272
272
  } : void 0;
273
- })(), Te = (e, { boundRetired: t = (e) => e } = {}) => {
273
+ })(), je = (e, { boundRetired: t = (e) => e } = {}) => {
274
274
  let n, r = 0, i = !1, a = () => {}, o = () => new Promise((e) => {
275
275
  a = e;
276
276
  }), s = o(), c = s, l = /* @__PURE__ */ new Set(), u = /* @__PURE__ */ new Set(), d = 0, f = 0, p = () => {
@@ -346,47 +346,53 @@ var t = 1e4, n = 16, r = (e) => {
346
346
  i = !0, n = void 0, p();
347
347
  }
348
348
  };
349
- }, H = !1, U = /* @__PURE__ */ new Set(), W = () => H, Ee = () => {
350
- if (!H) {
351
- H = !0;
352
- for (let e of [...U]) try {
349
+ }, L = !1, R = /* @__PURE__ */ new Set(), z = () => L, Me = () => {
350
+ if (!L) {
351
+ L = !0;
352
+ for (let e of [...R]) try {
353
353
  e();
354
354
  } catch {}
355
- U.clear();
355
+ R.clear();
356
356
  }
357
- }, G = (e) => {
358
- H ? e() : U.add(e);
359
- }, De = typeof window < "u" || typeof self < "u", Oe = async () => {
360
- if (typeof window < "u") return V;
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;
361
361
  if (typeof self < "u") return {
362
362
  receive: self,
363
363
  emit: self
364
364
  };
365
- }, ke = "fkn-api", Ae = "fkn-api-window", K = Te({ async *[Symbol.asyncIterator]() {
366
- let t = await Oe();
367
- if (!t) {
365
+ }, H = "fkn-api", Pe = "fkn-api-window", Fe = { async *[Symbol.asyncIterator]() {
366
+ let e = await V();
367
+ if (!e) {
368
368
  await new Promise(() => {});
369
369
  return;
370
370
  }
371
- if (!W()) {
371
+ if (!z()) {
372
372
  let n = new AbortController();
373
- G(() => n.abort());
374
- for await (let r of e({}, {
375
- key: ke,
376
- transport: t,
373
+ B(() => n.abort());
374
+ for await (let r of t({}, {
375
+ key: H,
376
+ transport: e,
377
377
  unregisterSignal: n.signal
378
378
  })) {
379
379
  if (n.signal.aborted) break;
380
380
  yield r;
381
381
  }
382
382
  }
383
- yield* e({}, {
384
- key: Ae,
385
- transport: t
383
+ yield* t({}, {
384
+ key: Pe,
385
+ transport: e
386
386
  });
387
- } }, { boundRetired: (e) => Q(e, () => new Z()) });
388
- G(() => K.retire());
389
- var q = Promise.race([K.first, new Promise((e) => G(e))]).then(() => K.facade), J = 8e3, je = 1e3, Y = !1, X = class extends Error {
387
+ } }, U = !1, W = V().then((t) => new Promise((n) => {
388
+ if (!t) return;
389
+ let { receive: r } = t, i = (t) => {
390
+ e(t.data, H) && (r.removeEventListener("message", i), U = !0, n());
391
+ };
392
+ 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 {
390
396
  constructor(e, t) {
391
397
  super(`@fkn/lib: no broker connection within ${t}ms, so ${e} could not be requested`), this.name = "BrokerUnreachableError";
392
398
  }
@@ -395,18 +401,20 @@ var q = Promise.race([K.first, new Promise((e) => G(e))]).then(() => K.facade),
395
401
  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";
396
402
  }
397
403
  }, Q = (e, t) => {
398
- let n = Y ? je : J;
404
+ let n = Y ? J : q;
399
405
  return Promise.race([e, new Promise((e, r) => setTimeout(() => {
400
406
  Y = !0, r(t(n));
401
407
  }, n))]);
402
- }, Me = (e) => W() ? Q(K.routable().then(() => K.facade), () => new Z()) : Q(q, (t) => new X(e, t));
403
- G(() => {
404
- let e = setTimeout(() => console.error(new Z()), J);
405
- K.routable().then(() => clearTimeout(e));
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));
413
+ });
406
414
  });
407
- var $ = K.onEpoch, Ne = K.current, Pe = K.lastCall, Fe = K.inFlight;
415
+ var $ = G.onEpoch, Le = G.current, Re = G.lastCall, ze = G.inFlight;
408
416
  $((e) => {
409
- fe() && e.overlay.setHost(ge, { exactClips: f() }).catch(() => {});
417
+ me() && e.overlay.setHost(ve, { exactClips: p() }).catch(() => {});
410
418
  });
411
419
  //#endregion
412
- export { Pe as a, Ne as c, Ee as d, V as f, Fe as i, De as l, F as m, X as n, q as o, M as p, Z as r, Me as s, J as t, $ as u };
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 };
@@ -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-DGuGXxKd.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-De1rQSCD.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
@@ -15,8 +15,8 @@ type Api = Remote<Resolvers>;
15
15
  * A window realm that relays its channel to a worker (`relayWorker`) moves its own calls to a channel
16
16
  * of their own, never back to the relayed one. There it also settles once the realm relays, a call in
17
17
  * flight on the relayed channel then rejects as on a replacement, and a call waits for the realm's own
18
- * channel within the deadline below, rejecting with `OwnChannelUnavailableError` when the broker never
19
- * answers there.
18
+ * channel, rejecting with `OwnChannelUnavailableError` when the broker answers on the relayed channel
19
+ * and not there within the deadline below.
20
20
  */
21
21
  declare const apiPromise: Promise<Api>;
22
22
  /**
@@ -35,19 +35,20 @@ declare class BrokerUnreachableError extends Error {
35
35
  }
36
36
  /**
37
37
  * A page's own call, refused because the page relays its FKN channel to a worker (`relayWorker`) and
38
- * the broker never answered on the page's own channel within the deadline: a broker document from
39
- * before that channel, as fkn.app's service worker can still serve from its cache. The page's own
40
- * calls never fall back to the relayed channel, so this is the answer until a reload reaches a newer
41
- * broker. The relayed worker's calls are unaffected.
38
+ * the broker, once it answered on the relayed channel, did not answer on the page's own within the
39
+ * deadline: a broker document from before that channel, as fkn.app's service worker can still serve
40
+ * from its cache. A broker that has not answered at all is waited for, never refused with this. The
41
+ * page's own calls never fall back to the relayed channel, so this is the answer until a reload
42
+ * reaches a newer broker. The relayed worker's calls are unaffected.
42
43
  *
43
44
  * What the page registered on the relayed channel went with it: FKN's UI over this page is no longer
44
45
  * placed and account changes are no longer heard. So the realm also logs this error once with
45
- * `console.error` when the deadline passes, whether or not the page calls.
46
+ * `console.error` when that deadline passes, whether or not the page calls.
46
47
  */
47
48
  declare class OwnChannelUnavailableError extends Error {
48
49
  constructor();
49
50
  }
50
- /** In a realm that relays, this waits for the realm's own channel and rejects with `OwnChannelUnavailableError` instead. */
51
+ /** In a realm that relays, this waits for the realm's own channel, refusing with `OwnChannelUnavailableError` once the broker has answered on the relayed one. */
51
52
  declare const apiWithin: (what: string) => Promise<Api>;
52
53
  /**
53
54
  * Runs for the current broker connection on subscribe (if one exists) and for every later one.
package/api.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./api-DMnVye0K.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-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;
package/api.d.ts CHANGED
@@ -1,3 +1,3 @@
1
- import { K as Resolvers } from "./contract-DGuGXxKd.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-wnOQJEK6.js";
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";
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-ySazPAwN.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-BrqGe-Yz.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-DGuGXxKd.js";
1
+ import { s as AddressLookupResult } from "../contract-De1rQSCD.js";
2
2
  import { lookup } from "../dns.js";
3
3
  export { type AddressLookupResult, lookup };