@fkn/lib 0.9.41 → 0.9.43

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 (76) hide show
  1. package/{account-generation-CSnZiN18.cjs → account-generation-B-6Pn0b5.cjs} +1 -1
  2. package/{account-generation-D7TpIoKt.js → account-generation-XNWOvLea.js} +5 -5
  3. package/account.cjs +1 -1
  4. package/account.js +6 -6
  5. package/api--LOXTOpv.cjs +3 -0
  6. package/{api-Dp-2AT3u.js → api-DIgTslNb.js} +154 -114
  7. package/{api-Cbty0JUM.d.ts → api-H1TzWitc.d.ts} +24 -2
  8. package/api.cjs +1 -1
  9. package/api.d.ts +3 -3
  10. package/api.js +2 -2
  11. package/attach-policy.cjs +1 -1
  12. package/attach-policy.js +2 -2
  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-Bx64HSkQ.cjs +1 -0
  21. package/cloud-D-vDUzzx.js +552 -0
  22. package/{cloud-4t1WoEZn.d.ts → cloud-Y0FzWpFT.d.ts} +5 -3
  23. package/cloud.cjs +1 -1
  24. package/cloud.d.ts +3 -3
  25. package/cloud.js +2 -2
  26. package/{contract-BRc2ptdC.d.ts → contract-DJxGa8lb.d.ts} +141 -7
  27. package/contract.d.ts +3 -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-DMU-CwMw.d.ts → extension-BtDg-F2g.d.ts} +40 -4
  35. package/extension-CzZn0bY2.js +94 -0
  36. package/extension-DvFf7uoG.cjs +1 -0
  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-q7Kg51hq.js → fs-CVnmXRf7.js} +1 -1
  43. package/{fs-BTyRnUPI.cjs → fs-p0bOOj5n.cjs} +1 -1
  44. package/fs.cjs +1 -1
  45. package/fs.js +2 -2
  46. package/{hosts-9dYv63ud.cjs → hosts-GNBhZO3-.cjs} +1 -1
  47. package/{hosts-BzbzOhG8.js → hosts-t7CKGTRz.js} +4 -1
  48. package/http.d.ts +1 -1
  49. package/{index-D2CA-NX5.d.ts → index-Cgnfjh9o.d.ts} +530 -51
  50. package/index.cjs +1 -1
  51. package/index.d.ts +16 -16
  52. package/index.js +56 -53
  53. package/{lib-C4Eeg9eM.js → lib-C3UwxjVs.js} +755 -501
  54. package/lib-fqQfEPk6.cjs +53 -0
  55. package/{net-CcEZP6Bb.d.ts → net-BOswhyfE.d.ts} +2 -2
  56. package/net.cjs +1 -1
  57. package/net.d.ts +1 -1
  58. package/net.js +1 -1
  59. package/package.json +1 -1
  60. package/packages.cjs +1 -1
  61. package/packages.d.ts +1 -1
  62. package/packages.js +14 -14
  63. package/{proxy-DjoPtJH9.cjs → proxy-CFK-KiwE.cjs} +1 -1
  64. package/{proxy-DMTdQ4dN.js → proxy-Dixbk1WL.js} +1 -1
  65. package/{proxy-D6YtsO1g.d.ts → proxy-ylK5lpw8.d.ts} +2 -2
  66. package/rooms.cjs +1 -1
  67. package/rooms.d.ts +1 -1
  68. package/rooms.js +11 -11
  69. package/{storage-BS5WMO4f.cjs → storage-D2cUJlVH.cjs} +1 -1
  70. package/{storage-BWmGrO6a.js → storage-Dn1gTLSZ.js} +2 -2
  71. package/api-jOTOA-5n.cjs +0 -3
  72. package/cloud-BLv19j-W.js +0 -480
  73. package/cloud-D7aQY4GH.cjs +0 -1
  74. package/extension-B9v933cT.js +0 -89
  75. package/extension-D2zMdc2f.cjs +0 -1
  76. package/lib-BfAg9mHD.cjs +0 -53
package/index.cjs CHANGED
@@ -1 +1 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-BfAg9mHD.cjs"),n=require("./api-jOTOA-5n.cjs"),r=require("./busy-Dv8wzE5M.cjs"),i=require("./cloud-D7aQY4GH.cjs"),a=require("./dns.cjs"),o=require("./net.cjs"),s=require("./dgram.cjs"),c=require("./http.cjs"),l=require("./extension-D2zMdc2f.cjs"),u=require("./desktop.cjs"),d=require("./fs-BTyRnUPI.cjs"),f=require("./opfs.cjs"),p=require("./packages.cjs"),m=require("./rooms.cjs"),h=require("./account.cjs"),g=require("./connect-button-BpXDs7tw.cjs");let _=require("osra");var v=1e4,y=150,b=()=>new Promise(e=>{if(t.J())return e(!0);let n,r=setTimeout(()=>i(t.J()),v),i=t=>{clearTimeout(n),clearTimeout(r),o.disconnect(),document.removeEventListener(`readystatechange`,s),e(t)},a=()=>{clearTimeout(n),n=setTimeout(()=>i(t.J()),y)},o=new MutationObserver(()=>{t.J()&&i(!0)}),s=()=>{document.readyState===`complete`&&!t.J()&&a()};o.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-fkn-extension`]}),document.addEventListener(`readystatechange`,s),document.readyState===`complete`&&a()}),x=(async e=>{if(t.o(e)===`window`){let n=e;return l.r()?t.a(n):i.a()?i.i(n):t.a(n)}return S(e)}),S=async e=>l.r()||e.lockdown||!i.a()||await b()?t.a(e):i.i(e),C=`https://fkn.app`,w=async(e,t)=>{if(typeof window>`u`)throw Error(`FKN @fkn/lib: relayWorker must be called from the main thread`);let i=await n.u;if(!i)throw Error(`FKN @fkn/lib: relayWorker found no FKN transport in this realm`);let a=r.t(`relayed worker`);t?.unregisterSignal?.aborted?a():t?.unregisterSignal?.addEventListener(`abort`,a,{once:!0});let o=i.emit instanceof MessagePort?{}:{originA:t?.originA??C,originB:t?.originB??`*`};(0,_.relay)(i,e,{key:`fkn-api`,...o,unregisterSignal:t?.unregisterSignal})},T=async()=>typeof window>`u`?!1:(await n.a).connect.prompt(location.origin).catch(()=>!1),E=async()=>typeof window>`u`?null:(await n.a).relay.prompt().catch(()=>null),D=new Set,O=e=>(D.add(e),()=>{D.delete(e)}),k=()=>{if(D.size===0)return!1;for(let e of[...D])try{e()}catch{}return!0},A=(e,t)=>{if(typeof e?.onUpdateTaken==`function`)return Promise.resolve(e.onUpdateTaken(t))},j=e.t({applyUpdate:()=>W,busyReasons:()=>U,onUpdate:()=>R,onUpdateTaken:()=>z,updateReady:()=>M}),M=async()=>typeof window>`u`?!1:n.a.then(e=>e.shell?.updateReady()).then(e=>e===!0).catch(()=>!1),N=new Set,P=!1,F=()=>{P=!0;for(let e of[...N])try{e()}catch{}},I=0,L=()=>{let e=n.s();e&&N.size!==0&&I!==e.epoch&&(I=e.epoch,P=!1,Promise.resolve(e.remote.shell?.onUpdate(F)).catch(()=>{I===e.epoch&&(I=0)}))};typeof window<`u`&&n.l(L);var R=async e=>{if(typeof window>`u`)return()=>{};if(N.add(e),P)try{e()}catch{}return L(),()=>{N.delete(e)}},z=e=>typeof window>`u`?()=>{}:O(e),B=0,V=!1,H=()=>{if(!k()&&!V){V=!0;try{location.reload()}catch{}}};typeof window<`u`&&n.l(()=>{let e=n.s();if(!e||B===e.epoch)return;B=e.epoch;let t=A(e.remote.shell,H);if(!t){B=0;return}t.catch(()=>{B===e.epoch&&(B=0)})});var U=()=>r.n(),W=async()=>typeof window>`u`?!1:n.a.then(e=>e.shell?.applyUpdate()).then(e=>e===!0).catch(()=>!1);exports.ATTACH_FRAME_EVENT_KEY=t.i,exports.CATEGORIES=t.b,exports.EXTENSION_ABI=t.Q,exports.ExtensionOperationUnsupportedError=t.$,exports.ExtensionOutdatedError=t.et,exports.FORGEABLE_HEADERS=t.U,exports.FrameWindowBlockedError=t.f,exports.FrameWindowRefusedError=t.p,exports.LOCATOR_DENIED=t.T,exports.LOCATOR_ERROR=t.k,exports.LOCATOR_UNSUPPORTED=t.x,exports.PERMISSION_DENIED=t.t,exports.REQUIRED_EXTENSION_ABI=t.tt,Object.defineProperty(exports,"account",{enumerable:!0,get:function(){return h.t}}),exports.assertAttachableFrameUrl=t._,exports.assertFetchableUrl=t.I,exports.assertForgeableHeaders=t.W,exports.assertLockdownApplicable=t.v,exports.assertOneCookieIdentity=t.G,exports.attachFrame=x,exports.attachFramePermission=t.m,exports.box=t.it,Object.defineProperty(exports,"cloud",{enumerable:!0,get:function(){return i.n}}),exports.connect=T,exports.connectButtonUrl=g.t,exports.cookies=t.P,exports.createFrame=t.h,exports.createVideoElementHandle=t.at,Object.defineProperty(exports,"desktop",{enumerable:!0,get:function(){return u.t}}),Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return s.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,"extension",{enumerable:!0,get:function(){return l.t}}),exports.fetch=l.n,exports.fetchCredentialedPermission=t.R,exports.fetchLocalPermission=t.z,exports.fetchPermission=t.B,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return d.u}}),exports.gotoPermission=t.g,exports.handleRevivableModules=t.rt,exports.hasForgedCookie=t.K,Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return c.t}}),exports.isBlockedFetchUrl=t.V,exports.isBlockedFrameUrl=t.y,exports.isExtensionExposed=t.J,exports.isLocalNetworkUrl=t.H,exports.isLocatorDenied=t.A,exports.isLocatorUnsupported=t.S,exports.isPermissionDenied=t.n,exports.isTerminalError=t.O,exports.isType=t.ot,exports.modifyRequestHeadersPermission=t.j,Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"opfs",{enumerable:!0,get:function(){return f.t}}),Object.defineProperty(exports,"packages",{enumerable:!0,get:function(){return p.t}}),exports.permissions=t.r,exports.promptInstall=l.i,exports.promptRelay=E,exports.readCookiePermission=t.F,exports.readExtensionHandshake=t.Y,exports.relayWorker=w,exports.removeRequestHeaderRule=t.M,exports.revive=t.st,Object.defineProperty(exports,"rooms",{enumerable:!0,get:function(){return m.t}}),exports.setMissingExtensionHandler=t.X,exports.setRequestHeaderRule=t.N,Object.defineProperty(exports,"shell",{enumerable:!0,get:function(){return j}}),exports.supportsOperation=t.nt,exports.type=t.ct,exports.waitForExtensionExposure=t.Z;
1
+ Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-fqQfEPk6.cjs"),n=require("./extension-DvFf7uoG.cjs"),r=require("./api--LOXTOpv.cjs"),i=require("./busy-Dv8wzE5M.cjs"),a=require("./cloud-Bx64HSkQ.cjs"),o=require("./dns.cjs"),s=require("./net.cjs"),c=require("./dgram.cjs"),l=require("./http.cjs"),u=require("./desktop.cjs"),d=require("./fs-p0bOOj5n.cjs"),f=require("./opfs.cjs"),p=require("./packages.cjs"),m=require("./rooms.cjs"),h=require("./account.cjs"),g=require("./connect-button-BpXDs7tw.cjs");let _=require("osra");var v=1e4,y=150,b=()=>new Promise(e=>{if(t.et())return e(!0);let n,r=setTimeout(()=>i(t.et()),v),i=t=>{clearTimeout(n),clearTimeout(r),o.disconnect(),document.removeEventListener(`readystatechange`,s),e(t)},a=()=>{clearTimeout(n),n=setTimeout(()=>i(t.et()),y)},o=new MutationObserver(()=>{t.et()&&i(!0)}),s=()=>{document.readyState===`complete`&&!t.et()&&a()};o.observe(document.documentElement,{attributes:!0,attributeFilter:[`data-fkn-extension`]}),document.addEventListener(`readystatechange`,s),document.readyState===`complete`&&a()}),x=(async e=>{let{kind:n,cookies:r}=t.o(e);if(n===`window`){let n=e;return r===`native`?t.a(n):a.i(n)}let i=e;return r===`native`?S(i):a.i(i)}),S=async e=>(a.a(e),await b(),t.a(e)),C=`https://fkn.app`,w=async(e,t)=>{if(typeof window>`u`)throw Error(`FKN @fkn/lib: relayWorker must be called from the main thread`);let n=await r.f;if(!n)throw Error(`FKN @fkn/lib: relayWorker found no FKN transport in this realm`);r.d();let a=i.t(`relayed worker`);t?.unregisterSignal?.aborted?a():t?.unregisterSignal?.addEventListener(`abort`,a,{once:!0});let o=n.emit instanceof MessagePort?{}:{originA:t?.originA??C,originB:t?.originB??`*`};(0,_.relay)(n,e,{key:`fkn-api`,...o,unregisterSignal:t?.unregisterSignal})},T=async()=>typeof window>`u`?!1:(await r.o).connect.prompt(location.origin).catch(()=>!1),E=async()=>typeof window>`u`?null:(await r.o).relay.prompt().catch(()=>null),D=new Set,O=e=>(D.add(e),()=>{D.delete(e)}),k=()=>{if(D.size===0)return!1;for(let e of[...D])try{e()}catch{}return!0},A=(e,t)=>{if(typeof e?.onUpdateTaken==`function`)return Promise.resolve(e.onUpdateTaken(t))},j=e.t({applyUpdate:()=>W,busyReasons:()=>U,onUpdate:()=>R,onUpdateTaken:()=>z,updateReady:()=>M}),M=async()=>typeof window>`u`?!1:r.o.then(e=>e.shell?.updateReady()).then(e=>e===!0).catch(()=>!1),N=new Set,P=!1,F=()=>{P=!0;for(let e of[...N])try{e()}catch{}},I=0,L=()=>{let e=r.c();e&&N.size!==0&&I!==e.epoch&&(I=e.epoch,P=!1,Promise.resolve(e.remote.shell?.onUpdate(F)).catch(()=>{I===e.epoch&&(I=0)}))};typeof window<`u`&&r.u(L);var R=async e=>{if(typeof window>`u`)return()=>{};if(N.add(e),P)try{e()}catch{}return L(),()=>{N.delete(e)}},z=e=>typeof window>`u`?()=>{}:O(e),B=0,V=!1,H=()=>{if(!k()&&!V){V=!0;try{location.reload()}catch{}}};typeof window<`u`&&r.u(()=>{let e=r.c();if(!e||B===e.epoch)return;B=e.epoch;let t=A(e.remote.shell,H);if(!t){B=0;return}t.catch(()=>{B===e.epoch&&(B=0)})});var U=()=>i.n(),W=async()=>typeof window>`u`?!1:r.o.then(e=>e.shell?.applyUpdate()).then(e=>e===!0).catch(()=>!1);exports.ATTACH_FRAME_EVENT_KEY=t.i,exports.BACKGROUND_STOPPED=n.a,exports.CATEGORIES=t.w,exports.EXTENSION_ABI=t.it,exports.ExtensionOperationUnsupportedError=t.at,exports.ExtensionOutdatedError=t.ot,exports.FORGEABLE_HEADERS=t.Y,exports.FrameWindowBlockedError=t.g,exports.FrameWindowRefusedError=t._,exports.LOCATOR_DENIED=t.k,exports.LOCATOR_ERROR=t.P,exports.LOCATOR_INVALID=t.I,exports.LOCATOR_UNSUPPORTED=t.E,exports.PERMISSION_DENIED=t.t,exports.REQUIRED_EXTENSION_ABI=t.st,exports.TimeoutError=t.T,Object.defineProperty(exports,"account",{enumerable:!0,get:function(){return h.t}}),exports.assertAttachableFrameUrl=t.x,exports.assertFetchableUrl=t.H,exports.assertForgeableHeaders=t.X,exports.assertLockdownApplicable=t.S,exports.assertOneCookieIdentity=t.Z,exports.attachFrame=x,exports.attachFramePermission=t.v,exports.box=t.ut,Object.defineProperty(exports,"cloud",{enumerable:!0,get:function(){return a.n}}),exports.connect=T,exports.connectButtonUrl=g.t,exports.cookies=t.B,exports.createFrame=t.y,exports.createVideoElementHandle=t.dt,Object.defineProperty(exports,"desktop",{enumerable:!0,get:function(){return u.t}}),Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return c.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"extension",{enumerable:!0,get:function(){return n.t}}),exports.fetch=n.n,exports.fetchCredentialedPermission=t.W,exports.fetchLocalPermission=t.G,exports.fetchPermission=t.K,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return d.u}}),exports.gotoPermission=t.b,exports.handleRevivableModules=t.lt,exports.hasForgedCookie=t.Q,Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return l.t}}),exports.isBackgroundStopped=n.o,exports.isBlockedFetchUrl=t.q,exports.isBlockedFrameUrl=t.C,exports.isExtensionExposed=t.et,exports.isLocalNetworkUrl=t.J,exports.isLocatorDenied=t.F,exports.isLocatorInvalid=t.j,exports.isLocatorUnsupported=t.D,exports.isPermissionDenied=t.n,exports.isTerminalError=t.N,exports.isType=t.ft,exports.modifyRequestHeadersPermission=t.L,Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return s.t}}),Object.defineProperty(exports,"opfs",{enumerable:!0,get:function(){return f.t}}),Object.defineProperty(exports,"packages",{enumerable:!0,get:function(){return p.t}}),exports.permissions=t.r,exports.promptInstall=n.i,exports.promptRelay=E,exports.readCookiePermission=t.V,exports.readExtensionHandshake=t.tt,exports.relayWorker=w,exports.removeRequestHeaderRule=t.R,exports.revive=t.pt,Object.defineProperty(exports,"rooms",{enumerable:!0,get:function(){return m.t}}),exports.setMissingExtensionHandler=t.nt,exports.setRequestHeaderRule=t.z,Object.defineProperty(exports,"shell",{enumerable:!0,get:function(){return j}}),exports.supportsOperation=t.ct,exports.type=t.mt,exports.waitForExtensionExposure=t.rt;
package/index.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  import { t as account_d_exports } from "./account.js";
2
- import { A as CATEGORIES, B as revive, C as gotoPermission, D as PermissionGrant, E as LegacyPermissionRequest, F as RemoteVideoElement, G as OperationRequest, H as Executor, I as VideoElementState, K as SelectorPart, L as box, M as PermissionCategory, N as handleRevivableModules, O as PermissionRequest, P as BoxedVideoElement, R as createVideoElementHandle, S as createFrame, T as CategoryRequest, U as Gate, V as type, W as GateTools, _ as FrameWindowRefusedError, a as AttachWindowOptions, b as WindowFrame, c as FrameBackendEvent, d as FrameEventMap, f as FrameMessageEvent, g as FrameWindowRefusal, h as FrameWindowOptions, i as AttachFrameOptions, j as CategoryMeta, k as permissions, l as FrameDocumentEvent, m as FrameWindowBlockedError, o as Frame, p as FramePostMessageOptions, r as AttachFrameFunction, s as FrameBackend, t as ATTACH_FRAME_EVENT_KEY, u as FrameEventListener, v as GotoOptions, w as CategoryGrant, x as attachFramePermission, y as Locator, z as isType } from "./index-D2CA-NX5.js";
3
- import { A as readCookiePermission, B as FORGEABLE_HEADERS, C as RequestHeaderRule, D as CookieDetails, E as setRequestHeaderRule, F as fetchCredentialedPermission, G as LOCATOR_ERROR, H as assertOneCookieIdentity, I as fetchLocalPermission, J as isLocatorUnsupported, K as LOCATOR_UNSUPPORTED, L as fetchPermission, M as ProxyFetchRequest, N as assertFetchableUrl, O as SiteCookie, R as isBlockedFetchUrl, S as HeaderOperation, T as removeRequestHeaderRule, U as hasForgedCookie, V as assertForgeableHeaders, W as LOCATOR_DENIED, Y as isTerminalError, _ as PermissionDeniedError, b as assertLockdownApplicable, c as setMissingExtensionHandler, d as ExtensionHandshake, f as ExtensionOperationUnsupportedError, g as PERMISSION_DENIED, h as supportsOperation, i as promptInstall, j as FetchInit, k as cookies, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as isLocatorDenied, s as readExtensionHandshake, t as extension_d_exports, u as EXTENSION_ABI, v as isPermissionDenied, w as modifyRequestHeadersPermission, x as isBlockedFrameUrl, y as assertAttachableFrameUrl, z as isLocalNetworkUrl } from "./extension-DMU-CwMw.js";
4
- import { n as cloud_d_exports } from "./cloud-4t1WoEZn.js";
2
+ import { $ as GateTools, A as attachFramePermission, B as CategoryMeta, C as FrameWindowRefusal, D as StorageState, E as Locator, F as LegacyPermissionRequest, G as VideoElementState, H as handleRevivableModules, I as PermissionGrant, J as isType, K as box, L as PermissionRequest, M as gotoPermission, N as CategoryGrant, O as StorageStateCookie, P as CategoryRequest, Q as Gate, R as permissions, S as FrameWindowOptions, T as GotoOptions, U as BoxedVideoElement, V as PermissionCategory, W as RemoteVideoElement, X as type, Y as revive, Z as Executor, _ as FrameEventMap, a as AttachCookies, b as FramePostMessageOptions, c as BlankPage, d as CookieMatchWire, et as OperationRequest, f as Frame, g as FrameEventListener, h as FrameDocumentEvent, i as AddScriptTagOptions, j as createFrame, k as WindowFrame, l as ClearCookiesOptions, m as FrameBackendEvent, o as AttachFrameOptions, p as FrameBackend, q as createVideoElementHandle, r as AttachFrameFunction, s as AttachWindowOptions, t as ATTACH_FRAME_EVENT_KEY, tt as SelectorPart, u as ClearCookiesWire, v as FrameLocator, w as FrameWindowRefusedError, x as FrameWindowBlockedError, y as FrameMessageEvent, z as CATEGORIES } from "./index-Cgnfjh9o.js";
3
+ import { $ as isLocatorInvalid, A as CookieDetails, B as fetchPermission, C as assertLockdownApplicable, D as modifyRequestHeadersPermission, E as RequestHeaderRule, F as ProxyFetchRequest, G as assertOneCookieIdentity, H as isLocalNetworkUrl, I as assertFetchableUrl, J as LOCATOR_ERROR, K as hasForgedCookie, M as cookies, N as readCookiePermission, O as removeRequestHeaderRule, P as FetchInit, Q as isLocatorDenied, R as fetchCredentialedPermission, S as assertAttachableFrameUrl, T as HeaderOperation, U as FORGEABLE_HEADERS, V as isBlockedFetchUrl, W as assertForgeableHeaders, X as LOCATOR_UNSUPPORTED, Y as LOCATOR_INVALID, Z as TimeoutError, _ as BackgroundStoppedError, b as PermissionDeniedError, c as setMissingExtensionHandler, d as ExtensionHandshake, et as isLocatorUnsupported, f as ExtensionOperationUnsupportedError, g as BACKGROUND_STOPPED, h as supportsOperation, i as promptInstall, j as SiteCookie, k as setRequestHeaderRule, l as waitForExtensionExposure, m as REQUIRED_EXTENSION_ABI, n as fetch, o as isExtensionExposed, p as ExtensionOutdatedError, q as LOCATOR_DENIED, s as readExtensionHandshake, t as extension_d_exports, tt as isTerminalError, u as EXTENSION_ABI, v as isBackgroundStopped, w as isBlockedFrameUrl, x as isPermissionDenied, y as PERMISSION_DENIED, z as fetchLocalPermission } from "./extension-BtDg-F2g.js";
4
+ import { n as cloud_d_exports } from "./cloud-Y0FzWpFT.js";
5
5
  import { t as dns_d_exports } from "./dns.js";
6
- import { s as net_d_exports } from "./net-CcEZP6Bb.js";
6
+ import { s as net_d_exports } from "./net-BOswhyfE.js";
7
7
  import { t as dgram_d_exports } from "./dgram.js";
8
8
  import { t as http_d_exports } from "./http.js";
9
9
  import { t as desktop_d_exports } from "./desktop.js";
@@ -14,19 +14,19 @@ import { t as rooms_d_exports } from "./rooms.js";
14
14
  import { t as connectButtonUrl } from "./connect-button-Cp0NS95-.js";
15
15
  //#region src/frame.d.ts
16
16
  /**
17
- * Attaches FKN to an iframe the app mounted, on the extension when it is installed and on the cloud
18
- * render proxy otherwise, or with `{ window }` opens the attachment in a window of its own.
17
+ * Attaches FKN to an iframe the app mounted, or with `{ window }` opens the attachment in a window
18
+ * of its own. `cookies` picks the jar and with it the backend (`AttachCookies`): `'persistent'`, the
19
+ * default, and `'ephemeral'` run on the cloud render proxy whatever is installed, and never wait for
20
+ * the extension; `'native'` runs on the extension, waiting for it to expose itself while the page
21
+ * loads (at most 10000 ms) and showing the install prompt when it does not. A `blank` attach is the
22
+ * cloud render proxy's alone, so beside `'native'` it is a TypeError. `frame.backend()` says which
23
+ * backend serves an attachment.
19
24
  *
20
25
  * A window opens before the first await, so call this directly in the click or key handler whose
21
- * activation opens it. It never waits for the extension to expose itself: a click lands on a loaded
22
- * page, where the extension has exposed itself or never will.
23
- *
24
- * In this release only the cloud backend serves a window. With the extension installed, a window
25
- * is refused at once with `ExtensionOperationUnsupportedError` (operation `'attachWindow'`), before
26
- * anything opens or is waited for, so the same click can still open one with
27
- * `cloud.attachFrame({ window })`. That window runs on this app's cloud cookie jar, not on the
28
- * extension's: a sign-in made in it reaches this app's cloud frames, never an iframe attached
29
- * through the extension.
26
+ * activation opens it. On `'persistent'` or `'ephemeral'` it opens on the cloud, extension or not. On
27
+ * `'native'` it is refused at once with `ExtensionOperationUnsupportedError` (operation
28
+ * `'attachWindow'`), before anything opens or is waited for, so the same click can still open one on
29
+ * another value.
30
30
  */
31
31
  export declare const attachFrame: AttachFrameFunction;
32
32
  //#endregion
@@ -129,4 +129,4 @@ declare const busyReasons: () => string[];
129
129
  */
130
130
  declare const applyUpdate: () => Promise<boolean>;
131
131
  //#endregion
132
- export { ATTACH_FRAME_EVENT_KEY, AttachFrameOptions, AttachWindowOptions, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, CookieDetails, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, VideoElementState, WindowFrame, account_d_exports as account, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFramePermission, box, cloud_d_exports as cloud, connectButtonUrl, cookies, createFrame, createVideoElementHandle, desktop_d_exports as desktop, dgram_d_exports as dgram, dns_d_exports as dns, extension_d_exports as extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, index_d_exports as fs, gotoPermission, handleRevivableModules, hasForgedCookie, http_d_exports as http, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, net_d_exports as net, index_d_exports$1 as opfs, packages_d_exports as packages, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, rooms_d_exports as rooms, setMissingExtensionHandler, setRequestHeaderRule, shell_d_exports as shell, supportsOperation, type, waitForExtensionExposure };
132
+ export { ATTACH_FRAME_EVENT_KEY, AddScriptTagOptions, AttachCookies, AttachFrameOptions, AttachWindowOptions, BACKGROUND_STOPPED, type BackgroundStoppedError, BlankPage, BoxedVideoElement, CATEGORIES, CategoryGrant, type CategoryMeta, CategoryRequest, ClearCookiesOptions, ClearCookiesWire, CookieDetails, CookieMatchWire, EXTENSION_ABI, type Executor, type ExtensionHandshake, ExtensionOperationUnsupportedError, ExtensionOutdatedError, FORGEABLE_HEADERS, FetchInit, Frame, FrameBackend, FrameBackendEvent, FrameDocumentEvent, FrameEventListener, FrameEventMap, FrameLocator, FrameMessageEvent, FramePostMessageOptions, FrameWindowBlockedError, FrameWindowOptions, FrameWindowRefusal, FrameWindowRefusedError, type Gate, type GateTools, GotoOptions, HeaderOperation, LOCATOR_DENIED, LOCATOR_ERROR, LOCATOR_INVALID, LOCATOR_UNSUPPORTED, LegacyPermissionRequest, Locator, type OperationRequest, PERMISSION_DENIED, type PermissionCategory, type PermissionDeniedError, PermissionGrant, PermissionRequest, ProxyFetchRequest, REQUIRED_EXTENSION_ABI, RemoteVideoElement, RequestHeaderRule, type SelectorPart, SiteCookie, StorageState, StorageStateCookie, TimeoutError, VideoElementState, WindowFrame, account_d_exports as account, assertAttachableFrameUrl, assertFetchableUrl, assertForgeableHeaders, assertLockdownApplicable, assertOneCookieIdentity, attachFramePermission, box, cloud_d_exports as cloud, connectButtonUrl, cookies, createFrame, createVideoElementHandle, desktop_d_exports as desktop, dgram_d_exports as dgram, dns_d_exports as dns, extension_d_exports as extension, fetch, fetchCredentialedPermission, fetchLocalPermission, fetchPermission, index_d_exports as fs, gotoPermission, handleRevivableModules, hasForgedCookie, http_d_exports as http, isBackgroundStopped, isBlockedFetchUrl, isBlockedFrameUrl, isExtensionExposed, isLocalNetworkUrl, isLocatorDenied, isLocatorInvalid, isLocatorUnsupported, isPermissionDenied, isTerminalError, isType, modifyRequestHeadersPermission, net_d_exports as net, index_d_exports$1 as opfs, packages_d_exports as packages, permissions, promptInstall, readCookiePermission, readExtensionHandshake, removeRequestHeaderRule, revive, rooms_d_exports as rooms, setMissingExtensionHandler, setRequestHeaderRule, shell_d_exports as shell, supportsOperation, type, waitForExtensionExposure };
package/index.js CHANGED
@@ -1,87 +1,90 @@
1
1
  import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
2
- import { $ as t, A as n, B as r, F as i, G as a, H as o, I as s, J as c, K as l, M as ee, N as te, O as ne, P as re, Q as ie, R as ae, S as oe, T as se, U as u, V as d, W as ce, X as le, Y as ue, Z as de, _ as f, a as p, at as m, b as h, ct as g, et as _, f as v, g as y, h as b, i as x, it as S, j as C, k as w, m as T, n as E, nt as D, o as O, ot as k, p as A, r as j, rt as M, st as N, t as P, tt as F, v as I, x as L, y as R, z } from "./lib-C4Eeg9eM.js";
3
- import { a as B, l as V, s as H, u as fe } from "./api-Dp-2AT3u.js";
4
- import { n as pe, t as me } from "./busy-B189uX--.js";
5
- import { a as U, i as W, n as he } from "./cloud-BLv19j-W.js";
6
- import { t as ge } from "./dns.js";
7
- import { t as _e } from "./net.js";
8
- import { t as ve } from "./dgram.js";
9
- import { t as G } from "./http.js";
10
- import { i as ye, n as be, r as K, t as xe } from "./extension-B9v933cT.js";
11
- import { t as Se } from "./desktop.js";
12
- import { u as Ce } from "./fs-q7Kg51hq.js";
13
- import { t as we } from "./opfs.js";
14
- import { t as Te } from "./packages.js";
15
- import { t as Ee } from "./rooms.js";
16
- import { t as De } from "./account.js";
17
- import { t as Oe } from "./connect-button-DtsN3X1J.js";
18
- import { relay as ke } from "osra";
2
+ import { B as t, C as n, D as r, E as i, F as a, G as o, H as ee, I as te, J as ne, K as s, L as re, N as ie, P as ae, Q as c, R as l, S as oe, T as se, V as ce, W as le, X as ue, Y as de, Z as u, _ as d, a as f, at as p, b as m, ct as h, dt as g, et as _, ft as v, g as y, i as b, it as x, j as S, k as C, lt as w, mt as T, n as E, nt as D, o as O, ot as k, pt as A, q as j, r as M, rt as N, st as P, t as F, tt as I, ut as L, v as R, w as z, x as B, y as V, z as H } from "./lib-C3UwxjVs.js";
3
+ import { a as fe, i as pe, n as me, o as he, t as ge } from "./extension-CzZn0bY2.js";
4
+ import { c as U, d as _e, f as ve, o as W, u as G } from "./api-DIgTslNb.js";
5
+ import { n as ye, t as be } from "./busy-B189uX--.js";
6
+ import { a as xe, i as K, n as Se } from "./cloud-D-vDUzzx.js";
7
+ import { t as Ce } from "./dns.js";
8
+ import { t as we } from "./net.js";
9
+ import { t as Te } from "./dgram.js";
10
+ import { t as Ee } from "./http.js";
11
+ import { t as De } from "./desktop.js";
12
+ import { u as Oe } from "./fs-CVnmXRf7.js";
13
+ import { t as ke } from "./opfs.js";
14
+ import { t as Ae } from "./packages.js";
15
+ import { t as je } from "./rooms.js";
16
+ import { t as Me } from "./account.js";
17
+ import { t as Ne } from "./connect-button-DtsN3X1J.js";
18
+ import { relay as Pe } from "osra";
19
19
  //#region src/frame.ts
20
- var Ae = 1e4, je = 150, Me = () => new Promise((e) => {
21
- if (c()) return e(!0);
22
- let t, n = setTimeout(() => r(c()), Ae), r = (r) => {
20
+ var Fe = 1e4, Ie = 150, Le = () => new Promise((e) => {
21
+ if (_()) return e(!0);
22
+ let t, n = setTimeout(() => r(_()), Fe), r = (r) => {
23
23
  clearTimeout(t), clearTimeout(n), a.disconnect(), document.removeEventListener("readystatechange", o), e(r);
24
24
  }, i = () => {
25
- clearTimeout(t), t = setTimeout(() => r(c()), je);
25
+ clearTimeout(t), t = setTimeout(() => r(_()), Ie);
26
26
  }, a = new MutationObserver(() => {
27
- c() && r(!0);
27
+ _() && r(!0);
28
28
  }), o = () => {
29
- document.readyState === "complete" && !c() && i();
29
+ document.readyState === "complete" && !_() && i();
30
30
  };
31
31
  a.observe(document.documentElement, {
32
32
  attributes: !0,
33
33
  attributeFilter: ["data-fkn-extension"]
34
34
  }), document.addEventListener("readystatechange", o), document.readyState === "complete" && i();
35
- }), Ne = (async (e) => {
36
- if (O(e) === "window") {
35
+ }), Re = (async (e) => {
36
+ let { kind: t, cookies: n } = O(e);
37
+ if (t === "window") {
37
38
  let t = e;
38
- return K() ? p(t) : U() ? W(t) : p(t);
39
+ return n === "native" ? f(t) : K(t);
39
40
  }
40
- return Pe(e);
41
- }), Pe = async (e) => K() || e.lockdown || !U() || await Me() ? p(e) : W(e), Fe = "https://fkn.app", Ie = async (e, t) => {
41
+ let r = e;
42
+ return n === "native" ? ze(r) : K(r);
43
+ }), ze = async (e) => (xe(e), await Le(), f(e)), Be = "https://fkn.app", Ve = async (e, t) => {
42
44
  if (typeof window > "u") throw Error("FKN @fkn/lib: relayWorker must be called from the main thread");
43
- let n = await fe;
45
+ let n = await ve;
44
46
  if (!n) throw Error("FKN @fkn/lib: relayWorker found no FKN transport in this realm");
45
- let r = me("relayed worker");
47
+ _e();
48
+ let r = be("relayed worker");
46
49
  t?.unregisterSignal?.aborted ? r() : t?.unregisterSignal?.addEventListener("abort", r, { once: !0 });
47
50
  let i = n.emit instanceof MessagePort ? {} : {
48
- originA: t?.originA ?? Fe,
51
+ originA: t?.originA ?? Be,
49
52
  originB: t?.originB ?? "*"
50
53
  };
51
- ke(n, e, {
54
+ Pe(n, e, {
52
55
  key: "fkn-api",
53
56
  ...i,
54
57
  unregisterSignal: t?.unregisterSignal
55
58
  });
56
- }, Le = async () => typeof window > "u" ? !1 : (await B).connect.prompt(location.origin).catch(() => !1), Re = async () => typeof window > "u" ? null : (await B).relay.prompt().catch(() => null), q = /* @__PURE__ */ new Set(), ze = (e) => (q.add(e), () => {
59
+ }, He = async () => typeof window > "u" ? !1 : (await W).connect.prompt(location.origin).catch(() => !1), Ue = async () => typeof window > "u" ? null : (await W).relay.prompt().catch(() => null), q = /* @__PURE__ */ new Set(), We = (e) => (q.add(e), () => {
57
60
  q.delete(e);
58
- }), Be = () => {
61
+ }), Ge = () => {
59
62
  if (q.size === 0) return !1;
60
63
  for (let e of [...q]) try {
61
64
  e();
62
65
  } catch {}
63
66
  return !0;
64
- }, Ve = (e, t) => {
67
+ }, Ke = (e, t) => {
65
68
  if (typeof e?.onUpdateTaken == "function") return Promise.resolve(e.onUpdateTaken(t));
66
- }, He = /* @__PURE__ */ e({
67
- applyUpdate: () => Ye,
68
- busyReasons: () => Je,
69
- onUpdate: () => Ge,
70
- onUpdateTaken: () => Ke,
71
- updateReady: () => Ue
72
- }), Ue = async () => typeof window > "u" ? !1 : B.then((e) => e.shell?.updateReady()).then((e) => e === !0).catch(() => !1), J = /* @__PURE__ */ new Set(), Y = !1, We = () => {
69
+ }, qe = /* @__PURE__ */ e({
70
+ applyUpdate: () => et,
71
+ busyReasons: () => $e,
72
+ onUpdate: () => Xe,
73
+ onUpdateTaken: () => Ze,
74
+ updateReady: () => Je
75
+ }), Je = async () => typeof window > "u" ? !1 : W.then((e) => e.shell?.updateReady()).then((e) => e === !0).catch(() => !1), J = /* @__PURE__ */ new Set(), Y = !1, Ye = () => {
73
76
  Y = !0;
74
77
  for (let e of [...J]) try {
75
78
  e();
76
79
  } catch {}
77
80
  }, X = 0, Z = () => {
78
- let e = H();
79
- e && J.size !== 0 && X !== e.epoch && (X = e.epoch, Y = !1, Promise.resolve(e.remote.shell?.onUpdate(We)).catch(() => {
81
+ let e = U();
82
+ e && J.size !== 0 && X !== e.epoch && (X = e.epoch, Y = !1, Promise.resolve(e.remote.shell?.onUpdate(Ye)).catch(() => {
80
83
  X === e.epoch && (X = 0);
81
84
  }));
82
85
  };
83
- typeof window < "u" && V(Z);
84
- var Ge = async (e) => {
86
+ typeof window < "u" && G(Z);
87
+ var Xe = async (e) => {
85
88
  if (typeof window > "u") return () => {};
86
89
  if (J.add(e), Y) try {
87
90
  e();
@@ -89,19 +92,19 @@ var Ge = async (e) => {
89
92
  return Z(), () => {
90
93
  J.delete(e);
91
94
  };
92
- }, Ke = (e) => typeof window > "u" ? () => {} : ze(e), Q = 0, $ = !1, qe = () => {
93
- if (!Be() && !$) {
95
+ }, Ze = (e) => typeof window > "u" ? () => {} : We(e), Q = 0, $ = !1, Qe = () => {
96
+ if (!Ge() && !$) {
94
97
  $ = !0;
95
98
  try {
96
99
  location.reload();
97
100
  } catch {}
98
101
  }
99
102
  };
100
- typeof window < "u" && V(() => {
101
- let e = H();
103
+ typeof window < "u" && G(() => {
104
+ let e = U();
102
105
  if (!e || Q === e.epoch) return;
103
106
  Q = e.epoch;
104
- let t = Ve(e.remote.shell, qe);
107
+ let t = Ke(e.remote.shell, Qe);
105
108
  if (!t) {
106
109
  Q = 0;
107
110
  return;
@@ -110,6 +113,6 @@ typeof window < "u" && V(() => {
110
113
  Q === e.epoch && (Q = 0);
111
114
  });
112
115
  });
113
- var Je = () => pe(), Ye = async () => typeof window > "u" ? !1 : B.then((e) => e.shell?.applyUpdate()).then((e) => e === !0).catch(() => !1);
116
+ var $e = () => ye(), et = async () => typeof window > "u" ? !1 : W.then((e) => e.shell?.applyUpdate()).then((e) => e === !0).catch(() => !1);
114
117
  //#endregion
115
- export { x as ATTACH_FRAME_EVENT_KEY, h as CATEGORIES, ie as EXTENSION_ABI, t as ExtensionOperationUnsupportedError, _ as ExtensionOutdatedError, u as FORGEABLE_HEADERS, v as FrameWindowBlockedError, A as FrameWindowRefusedError, se as LOCATOR_DENIED, w as LOCATOR_ERROR, L as LOCATOR_UNSUPPORTED, P as PERMISSION_DENIED, F as REQUIRED_EXTENSION_ABI, De as account, f as assertAttachableFrameUrl, s as assertFetchableUrl, ce as assertForgeableHeaders, I as assertLockdownApplicable, a as assertOneCookieIdentity, Ne as attachFrame, T as attachFramePermission, S as box, he as cloud, Le as connect, Oe as connectButtonUrl, re as cookies, b as createFrame, m as createVideoElementHandle, Se as desktop, ve as dgram, ge as dns, xe as extension, be as fetch, ae as fetchCredentialedPermission, z as fetchLocalPermission, r as fetchPermission, Ce as fs, y as gotoPermission, M as handleRevivableModules, l as hasForgedCookie, G as http, d as isBlockedFetchUrl, R as isBlockedFrameUrl, c as isExtensionExposed, o as isLocalNetworkUrl, n as isLocatorDenied, oe as isLocatorUnsupported, E as isPermissionDenied, ne as isTerminalError, k as isType, C as modifyRequestHeadersPermission, _e as net, we as opfs, Te as packages, j as permissions, ye as promptInstall, Re as promptRelay, i as readCookiePermission, ue as readExtensionHandshake, Ie as relayWorker, ee as removeRequestHeaderRule, N as revive, Ee as rooms, le as setMissingExtensionHandler, te as setRequestHeaderRule, He as shell, D as supportsOperation, g as type, de as waitForExtensionExposure };
118
+ export { b as ATTACH_FRAME_EVENT_KEY, fe as BACKGROUND_STOPPED, z as CATEGORIES, x as EXTENSION_ABI, p as ExtensionOperationUnsupportedError, k as ExtensionOutdatedError, de as FORGEABLE_HEADERS, y as FrameWindowBlockedError, d as FrameWindowRefusedError, C as LOCATOR_DENIED, ae as LOCATOR_ERROR, te as LOCATOR_INVALID, i as LOCATOR_UNSUPPORTED, F as PERMISSION_DENIED, P as REQUIRED_EXTENSION_ABI, se as TimeoutError, Me as account, B as assertAttachableFrameUrl, ee as assertFetchableUrl, ue as assertForgeableHeaders, oe as assertLockdownApplicable, u as assertOneCookieIdentity, Re as attachFrame, R as attachFramePermission, L as box, Se as cloud, He as connect, Ne as connectButtonUrl, t as cookies, V as createFrame, g as createVideoElementHandle, De as desktop, Te as dgram, Ce as dns, ge as extension, me as fetch, le as fetchCredentialedPermission, o as fetchLocalPermission, s as fetchPermission, Oe as fs, m as gotoPermission, w as handleRevivableModules, c as hasForgedCookie, Ee as http, he as isBackgroundStopped, j as isBlockedFetchUrl, n as isBlockedFrameUrl, _ as isExtensionExposed, ne as isLocalNetworkUrl, a as isLocatorDenied, S as isLocatorInvalid, r as isLocatorUnsupported, E as isPermissionDenied, ie as isTerminalError, v as isType, re as modifyRequestHeadersPermission, we as net, ke as opfs, Ae as packages, M as permissions, pe as promptInstall, Ue as promptRelay, ce as readCookiePermission, I as readExtensionHandshake, Ve as relayWorker, l as removeRequestHeaderRule, A as revive, je as rooms, D as setMissingExtensionHandler, H as setRequestHeaderRule, qe as shell, h as supportsOperation, T as type, N as waitForExtensionExposure };