@fkn/lib 0.9.53 → 0.9.54
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.
- package/{account-generation-BgiEc3fw.js → account-generation-CTB1J33G.js} +4 -3
- package/account-generation-DOuApHq5.cjs +1 -0
- package/{account-storage-IAVrRXTF.cjs → account-storage-CL0wLuQw.cjs} +1 -1
- package/{account-storage-DHl6bXdb.d.ts → account-storage-Co9IvkPr.d.ts} +3 -3
- package/{account-storage-DptsMWKl.js → account-storage-D1RiskV6.js} +2 -2
- package/account.cjs +1 -1
- package/account.d.ts +21 -11
- package/account.js +2 -2
- package/{api-CX9w35R2.js → api-BYtMzj8u.js} +1 -1
- package/{api-mHRuM_Sd.d.ts → api-C-VvG5P-.d.ts} +833 -1
- package/{api-6wTec7WK.cjs → api-Csb5b8dE.cjs} +1 -1
- package/api.cjs +1 -1
- package/api.d.ts +2 -2
- package/api.js +1 -1
- package/cloud/dns.d.ts +1 -1
- package/cloud/fetch.cjs +1 -1
- package/cloud/fetch.d.ts +1 -1
- package/cloud/fetch.js +1 -1
- package/cloud/fs/promises.d.ts +1 -1
- package/cloud/fs.cjs +1 -1
- package/cloud/fs.d.ts +2 -2
- package/cloud/fs.js +1 -1
- package/cloud/net.d.ts +1 -1
- package/{cloud-CMEnCSBw.js → cloud-8sJ1Sg8n.js} +3 -3
- package/{cloud-kg1hOpPJ.cjs → cloud-CI6WMBPa.cjs} +1 -1
- package/{cloud-Dykm74YZ.d.ts → cloud-S8hQywqV.d.ts} +3 -3
- package/cloud.cjs +1 -1
- package/cloud.d.ts +4 -4
- package/cloud.js +2 -2
- package/{contract-BN0cD-Oq.d.ts → contract-CMQOic3K.d.ts} +29 -0
- package/contract.d.ts +1 -1
- package/dgram.cjs +1 -1
- package/dgram.d.ts +2 -2
- package/dgram.js +1 -1
- package/dns.cjs +1 -1
- package/dns.d.ts +1 -1
- package/dns.js +1 -1
- package/{extension-BdAR-wQ0.cjs → extension-BXI3MVXw.cjs} +1 -1
- package/{extension-DiyykwoW.js → extension-BmqjgSIQ.js} +3 -3
- package/extension.cjs +1 -1
- package/extension.js +2 -2
- package/fs/promises.cjs +1 -1
- package/fs/promises.d.ts +1 -1
- package/fs/promises.js +1 -1
- package/{fs-CPsnX6ti.cjs → fs-CPU00CI3.cjs} +1 -1
- package/{fs-BZv2djbS.d.ts → fs-DCJAYoYy.d.ts} +1 -1
- package/{fs-Cd1HK3C3.js → fs-ohcMNiu2.js} +2 -2
- package/fs.cjs +1 -1
- package/fs.d.ts +2 -2
- package/fs.js +2 -2
- package/http.d.ts +1 -1
- package/{index-DawD_N1P.d.ts → index-57lTXnoe.d.ts} +1 -1
- package/index.cjs +1 -1
- package/index.d.ts +4 -4
- package/index.js +5 -5
- package/{lib-C5N2rmbj.js → lib-BGAmzIcU.js} +1 -1
- package/{lib-C0xyv8BQ.cjs → lib-BiQ6cOZ7.cjs} +1 -1
- package/{net-Dq1KyRP0.d.ts → net-B8YQuB9E.d.ts} +2 -2
- package/net.cjs +1 -1
- package/net.d.ts +1 -1
- package/net.js +1 -1
- package/package.json +1 -1
- package/packages.cjs +1 -1
- package/packages.d.ts +15 -2
- package/packages.js +114 -113
- package/{proxy-DhalpZoN.cjs → proxy-CL8j00ao.cjs} +1 -1
- package/{proxy-Cer0Iarp.d.ts → proxy-ClDBa5il.d.ts} +2 -2
- package/{proxy-v_Z5aPh2.js → proxy-vAsYHMIa.js} +1 -1
- package/rooms.cjs +1 -1
- package/rooms.d.ts +1 -1
- package/rooms.js +99 -88
- package/storage.cjs +1 -1
- package/storage.d.ts +1 -1
- package/storage.js +3 -3
- package/account-generation-C5rMCyt1.cjs +0 -1
|
@@ -1,3 +1,3 @@
|
|
|
1
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
2
|
@fkn/lib draws its UI inside <iframe title="FKN"> and sets display, position, top, left, width, height, border, padding, box-sizing, clip-path and z-index on that element. Leave those as they are, then check for an ancestor with opacity, visibility, display or a clipping transform, and for an element stacked above it.`+(r===`liveness`?`
|
|
3
|
-
This browser reports limited detail, so the cause above is a best guess.`:``)))},E=(e,t)=>{if(typeof e!=`object`||!e)return null;let n=e,r=(Array.isArray(n.rects)?n.rects.slice(0,a):[]).map(e=>ue(e,t)).filter(e=>e!==null&&e.width>0&&e.height>0);return{modal:n.modal===!0,rects:r,hidden:de(n.hidden),inset:ce(n.inset)}},pe=()=>v!==null,D=null,O=null,me=()=>{if(!v||D===null)return;let e=b(v),t=E(D,e);t&&C(v,t,e)},he=e=>{typeof ResizeObserver<`u`&&(O??=new ResizeObserver(me),O.disconnect(),O.observe(e))},ge=e=>{u(e),C(e,{modal:!1,rects:[],hidden:[],inset:0},b(e)),v=e,he(e)},_e=e=>{if(!v)return;let t=b(v),n=E(e,t);n&&(D=e,C(v,n,t),fe(n.hidden))},ve=`fkn.app,fkn.dev,sdbx.app,horionsoftware.com,webvpn.dev,fknmail.app,clairv.app,fkn.cloudflareaccess.com,me-62e.workers.dev,62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.eu.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.fedramp.r2.cloudflarestorage.com,pub-8a3dc68041874c7e9c9a54bde972605a.r2.dev,pub-3d97d79220b94243812e60b0e742f2c5.r2.dev,pub-f8bd4876cc3c4b4a951715da5958e49c.r2.dev,web-b3z.pages.dev,fkn-console.pages.dev,dev-dms.pages.dev,fkn-www.pages.dev,fkn-homepage.pages.dev,fkn-sandbox.pages.dev,internal-3ar.pages.dev,stub-ben.pages.dev,ripple-3t3.pages.dev,media-player-e3s.pages.dev,youtube-3c4.pages.dev,horionsoftware.pages.dev,container-ckf.pages.dev,stub-plugin.pages.dev,plugins.banou.dev`.split(`,`),k=e=>e.toLowerCase().replace(/\.+$/,``),ye=[`79.127.204.69`,`152.233.49.59`],be=e=>{let t;try{t=new URL(`http://${e.includes(`:`)&&!e.startsWith(`[`)?`[${e}]`:e}/`).hostname}catch{return}let n=/^\[(?:::ffff:|64:ff9b::)([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(n){let e=parseInt(n[1],16),t=parseInt(n[2],16);return[e>>8,e&255,t>>8,t&255].join(`.`)}return/^\d+\.\d+\.\d+\.\d+$/.test(t)?t:void 0},xe=e=>{let t=k(e);return ve.some(e=>t===e||t.endsWith(`.${e}`))},Se=e=>{if(xe(e))return!0;let t=be(k(e));return t!==void 0&&ye.includes(t)},Ce=e=>{let t=typeof e==`string`?e:e instanceof URL?e.href:e.url,n;try{n=new URL(t)}catch{return}if(Se(n.hostname))throw Error(`fetch refuses FKN platform domains (${n.hostname})`)},we=`autoplay.fullscreen.picture-in-picture.encrypted-media.screen-wake-lock.speaker-selection.captured-surface-control.camera.microphone.display-capture.geolocation.midi.usb.serial.hid.bluetooth.gamepad.keyboard-map.xr-spatial-tracking.accelerometer.gyroscope.magnetometer.ambient-light-sensor.compute-pressure.clipboard-read.clipboard-write.storage-access.window-management.local-fonts.idle-detection.web-share.sync-xhr.unload.payment.publickey-credentials-get.publickey-credentials-create.otp-credentials.identity-credentials-get.digital-credentials-get.local-network.local-network-access.loopback-network`.split(`.`),Te=()=>{try{let e=globalThis.document?.featurePolicy?.features?.();return e===void 0?void 0:new Set(e)}catch{return}},A=(e=!0,t=Te())=>[...we,...e?[`cross-origin-isolated`]:[]].filter(e=>t===void 0||t.has(e)).join(`; `),j=`https://fkn.app`,M=typeof globalThis<`u`&&globalThis.document?globalThis.document:void 0,N=typeof globalThis<`u`&&globalThis.crossOriginIsolated===!0,P=`${j}/api${N?`?coi=1`:``}`,Ee=`fkn-api-port`,De=`fkn-api-port-ack`,Oe=2e3,ke=()=>{if(!M||typeof window>`u`||window.parent===window)return Promise.resolve(void 0);let e;try{e=window.parent}catch{return Promise.resolve(void 0)}let t=new MessageChannel;return new Promise(n=>{let r=e=>{if(clearTimeout(a),t.port1.removeEventListener(`message`,i),!e)try{t.port1.close()}catch{}n(e)},i=e=>{e.data?.type===De&&r(t.port1)},a=setTimeout(()=>r(void 0),Oe);t.port1.addEventListener(`message`,i),t.port1.start();try{e.postMessage({type:Ee},j,[t.port2])}catch{r(void 0)}})},F,Ae=()=>{if(F||!M)return F;let e=M.querySelector(`iframe[src="${P}"]`);if(e)F=e;else{let e=M.createElement(`iframe`);e.setAttribute(`allow`,A(N)),e.src=P,M.body.appendChild(e),F=e}return ge(F),F},I=(async()=>{if(!M)return;let e=await ke();if(e)return{receive:e,emit:e};let t=Ae();if(!t)return;await i(t);let n=t.contentWindow;return n?{receive:window,emit:n}:void 0})(),je=(e,{boundRetired:t=e=>e}={})=>{let n,r=0,i=!1,a=()=>{},o=()=>new Promise(e=>{a=e}),s=o(),c=s,l=new Set,u=new Set,d=0,f=0,p=()=>{let e=[...u];u.clear();let t=Error(`FKN: the broker was replaced while this call was pending; retry it`);for(let n of e)try{n(t)}catch{}};(async()=>{for await(let t of e){let e=++r;n={remote:t,epoch:e};let i=a;s=o(),i(t),p();for(let n of[...l])try{n(t,e)}catch{}}})().catch(()=>{});let m=async(e,r)=>{let a=n?.remote??await(i?t(s):s);for(let t of e.slice(0,-1))a=a[t];let o=a[e[e.length-1]??``];d=Date.now(),f+=1;let c=()=>{},l=new Promise((e,t)=>{c=t});u.add(c);try{return await Promise.race([Promise.resolve(o.apply(a,r)),l])}finally{--f,u.delete(c),d=Date.now()}},h=new Map,g=e=>{let t=e.join(`\0`),r=h.get(t);if(r)return r;let i=new Proxy(function(){},{get:(t,r)=>{if(typeof r!=`string`||r===`then`)return;let i=n;if(i){let t=i.remote;for(let n of e)t=t?.[n];if(t?.[r]===void 0)return}return g([...e,r])},apply:(t,n,r)=>m(e,r)});return h.set(t,i),i};return{facade:g([]),first:c.then(()=>{}),current:()=>n,onEpoch:e=>{if(l.add(e),n)try{e(n.remote,n.epoch)}catch{}return()=>{l.delete(e)}},lastCall:()=>d,inFlight:()=>f,routable:()=>n?Promise.resolve():s.then(()=>{}),retire:()=>{i=!0,n=void 0,p()}}},L=!1,R=new Set,z=()=>L,Me=()=>{if(!L){L=!0;for(let e of[...R])try{e()}catch{}R.clear()}},B=e=>{L?e():R.add(e)},Ne=typeof window<`u`||typeof self<`u`,V=async()=>{if(typeof window<`u`)return I;if(typeof self<`u`)return{receive:self,emit:self}},H=`fkn-api`,Pe=`fkn-api-window`,Fe={async*[Symbol.asyncIterator](){let t=await V();if(!t){await new Promise(()=>{});return}if(!z()){let n=new AbortController;B(()=>n.abort());for await(let r of(0,e.expose)({},{key:H,transport:t,unregisterSignal:n.signal})){if(n.signal.aborted)break;yield r}}yield*(0,e.expose)({},{key:Pe,transport:t})}},U=!1,W=V().then(t=>new Promise(n=>{if(!t)return;let{receive:r}=t,i=t=>{(0,e.checkOsraMessageKey)(t.data,H)&&(r.removeEventListener(`message`,i),U=!0,n())};r.addEventListener(`message`,i)})),G=je(Fe,{boundRetired:e=>Promise.race([e,W.then(()=>Q(e,()=>new Z))])});B(()=>G.retire());var K=Promise.race([G.first,new Promise(e=>B(e))]).then(()=>G.facade),q=8e3,J=1e3,Y=!1,X=class extends Error{constructor(e,t){super(`@fkn/lib: no broker connection within ${t}ms, so ${e} could not be requested`),this.name=`BrokerUnreachableError`}},Z=class extends Error{constructor(){super(`FKN @fkn/lib: this page relays its FKN channel to a worker, and the FKN page it reached predates a channel of the page's own; reload`),this.name=`OwnChannelUnavailableError`}},Q=(e,t)=>{let n=Y?J:q;return Promise.race([e,new Promise((e,r)=>setTimeout(()=>{Y=!0,r(t(n))},n))])},Ie=e=>z()?Q(G.routable().then(()=>G.facade),t=>U?new Z:new X(e,t)):Q(K,t=>new X(e,t));B(()=>{W.then(()=>{let e=setTimeout(()=>console.error(new Z),q);G.routable().then(()=>clearTimeout(e))})});var $=G.onEpoch,Le=G.current,Re=G.lastCall,ze=G.inFlight;$(e=>{pe()&&e.overlay.setHost(_e,{exactClips:f()}).catch(()=>{})}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return $}});
|
|
3
|
+
This browser reports limited detail, so the cause above is a best guess.`:``)))},E=(e,t)=>{if(typeof e!=`object`||!e)return null;let n=e,r=(Array.isArray(n.rects)?n.rects.slice(0,a):[]).map(e=>ue(e,t)).filter(e=>e!==null&&e.width>0&&e.height>0);return{modal:n.modal===!0,rects:r,hidden:de(n.hidden),inset:ce(n.inset)}},pe=()=>v!==null,D=null,O=null,me=()=>{if(!v||D===null)return;let e=b(v),t=E(D,e);t&&C(v,t,e)},he=e=>{typeof ResizeObserver<`u`&&(O??=new ResizeObserver(me),O.disconnect(),O.observe(e))},ge=e=>{u(e),C(e,{modal:!1,rects:[],hidden:[],inset:0},b(e)),v=e,he(e)},_e=e=>{if(!v)return;let t=b(v),n=E(e,t);n&&(D=e,C(v,n,t),fe(n.hidden))},ve=`fkn.app,fkn.dev,sdbx.app,horionsoftware.com,webvpn.dev,fknmail.app,clairv.app,fkn.cloudflareaccess.com,me-62e.workers.dev,62e9d4fbf21d90ebd4342e54b4babbd3.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.eu.r2.cloudflarestorage.com,62e9d4fbf21d90ebd4342e54b4babbd3.fedramp.r2.cloudflarestorage.com,pub-8a3dc68041874c7e9c9a54bde972605a.r2.dev,pub-3d97d79220b94243812e60b0e742f2c5.r2.dev,pub-f8bd4876cc3c4b4a951715da5958e49c.r2.dev,web-b3z.pages.dev,fkn-console.pages.dev,dev-dms.pages.dev,fkn-www.pages.dev,fkn-homepage.pages.dev,fkn-sandbox.pages.dev,internal-3ar.pages.dev,stub-ben.pages.dev,ripple-3t3.pages.dev,media-player-e3s.pages.dev,youtube-3c4.pages.dev,horionsoftware.pages.dev,container-ckf.pages.dev,stub-plugin.pages.dev,social-3n2.pages.dev,plugins.banou.dev`.split(`,`),k=e=>e.toLowerCase().replace(/\.+$/,``),ye=[`79.127.204.69`,`152.233.49.59`],be=e=>{let t;try{t=new URL(`http://${e.includes(`:`)&&!e.startsWith(`[`)?`[${e}]`:e}/`).hostname}catch{return}let n=/^\[(?:::ffff:|64:ff9b::)([0-9a-f]{1,4}):([0-9a-f]{1,4})\]$/.exec(t);if(n){let e=parseInt(n[1],16),t=parseInt(n[2],16);return[e>>8,e&255,t>>8,t&255].join(`.`)}return/^\d+\.\d+\.\d+\.\d+$/.test(t)?t:void 0},xe=e=>{let t=k(e);return ve.some(e=>t===e||t.endsWith(`.${e}`))},Se=e=>{if(xe(e))return!0;let t=be(k(e));return t!==void 0&&ye.includes(t)},Ce=e=>{let t=typeof e==`string`?e:e instanceof URL?e.href:e.url,n;try{n=new URL(t)}catch{return}if(Se(n.hostname))throw Error(`fetch refuses FKN platform domains (${n.hostname})`)},we=`autoplay.fullscreen.picture-in-picture.encrypted-media.screen-wake-lock.speaker-selection.captured-surface-control.camera.microphone.display-capture.geolocation.midi.usb.serial.hid.bluetooth.gamepad.keyboard-map.xr-spatial-tracking.accelerometer.gyroscope.magnetometer.ambient-light-sensor.compute-pressure.clipboard-read.clipboard-write.storage-access.window-management.local-fonts.idle-detection.web-share.sync-xhr.unload.payment.publickey-credentials-get.publickey-credentials-create.otp-credentials.identity-credentials-get.digital-credentials-get.local-network.local-network-access.loopback-network`.split(`.`),Te=()=>{try{let e=globalThis.document?.featurePolicy?.features?.();return e===void 0?void 0:new Set(e)}catch{return}},A=(e=!0,t=Te())=>[...we,...e?[`cross-origin-isolated`]:[]].filter(e=>t===void 0||t.has(e)).join(`; `),j=`https://fkn.app`,M=typeof globalThis<`u`&&globalThis.document?globalThis.document:void 0,N=typeof globalThis<`u`&&globalThis.crossOriginIsolated===!0,P=`${j}/api${N?`?coi=1`:``}`,Ee=`fkn-api-port`,De=`fkn-api-port-ack`,Oe=2e3,ke=()=>{if(!M||typeof window>`u`||window.parent===window)return Promise.resolve(void 0);let e;try{e=window.parent}catch{return Promise.resolve(void 0)}let t=new MessageChannel;return new Promise(n=>{let r=e=>{if(clearTimeout(a),t.port1.removeEventListener(`message`,i),!e)try{t.port1.close()}catch{}n(e)},i=e=>{e.data?.type===De&&r(t.port1)},a=setTimeout(()=>r(void 0),Oe);t.port1.addEventListener(`message`,i),t.port1.start();try{e.postMessage({type:Ee},j,[t.port2])}catch{r(void 0)}})},F,Ae=()=>{if(F||!M)return F;let e=M.querySelector(`iframe[src="${P}"]`);if(e)F=e;else{let e=M.createElement(`iframe`);e.setAttribute(`allow`,A(N)),e.src=P,M.body.appendChild(e),F=e}return ge(F),F},I=(async()=>{if(!M)return;let e=await ke();if(e)return{receive:e,emit:e};let t=Ae();if(!t)return;await i(t);let n=t.contentWindow;return n?{receive:window,emit:n}:void 0})(),je=(e,{boundRetired:t=e=>e}={})=>{let n,r=0,i=!1,a=()=>{},o=()=>new Promise(e=>{a=e}),s=o(),c=s,l=new Set,u=new Set,d=0,f=0,p=()=>{let e=[...u];u.clear();let t=Error(`FKN: the broker was replaced while this call was pending; retry it`);for(let n of e)try{n(t)}catch{}};(async()=>{for await(let t of e){let e=++r;n={remote:t,epoch:e};let i=a;s=o(),i(t),p();for(let n of[...l])try{n(t,e)}catch{}}})().catch(()=>{});let m=async(e,r)=>{let a=n?.remote??await(i?t(s):s);for(let t of e.slice(0,-1))a=a[t];let o=a[e[e.length-1]??``];d=Date.now(),f+=1;let c=()=>{},l=new Promise((e,t)=>{c=t});u.add(c);try{return await Promise.race([Promise.resolve(o.apply(a,r)),l])}finally{--f,u.delete(c),d=Date.now()}},h=new Map,g=e=>{let t=e.join(`\0`),r=h.get(t);if(r)return r;let i=new Proxy(function(){},{get:(t,r)=>{if(typeof r!=`string`||r===`then`)return;let i=n;if(i){let t=i.remote;for(let n of e)t=t?.[n];if(t?.[r]===void 0)return}return g([...e,r])},apply:(t,n,r)=>m(e,r)});return h.set(t,i),i};return{facade:g([]),first:c.then(()=>{}),current:()=>n,onEpoch:e=>{if(l.add(e),n)try{e(n.remote,n.epoch)}catch{}return()=>{l.delete(e)}},lastCall:()=>d,inFlight:()=>f,routable:()=>n?Promise.resolve():s.then(()=>{}),retire:()=>{i=!0,n=void 0,p()}}},L=!1,R=new Set,z=()=>L,Me=()=>{if(!L){L=!0;for(let e of[...R])try{e()}catch{}R.clear()}},B=e=>{L?e():R.add(e)},Ne=typeof window<`u`||typeof self<`u`,V=async()=>{if(typeof window<`u`)return I;if(typeof self<`u`)return{receive:self,emit:self}},H=`fkn-api`,Pe=`fkn-api-window`,Fe={async*[Symbol.asyncIterator](){let t=await V();if(!t){await new Promise(()=>{});return}if(!z()){let n=new AbortController;B(()=>n.abort());for await(let r of(0,e.expose)({},{key:H,transport:t,unregisterSignal:n.signal})){if(n.signal.aborted)break;yield r}}yield*(0,e.expose)({},{key:Pe,transport:t})}},U=!1,W=V().then(t=>new Promise(n=>{if(!t)return;let{receive:r}=t,i=t=>{(0,e.checkOsraMessageKey)(t.data,H)&&(r.removeEventListener(`message`,i),U=!0,n())};r.addEventListener(`message`,i)})),G=je(Fe,{boundRetired:e=>Promise.race([e,W.then(()=>Q(e,()=>new Z))])});B(()=>G.retire());var K=Promise.race([G.first,new Promise(e=>B(e))]).then(()=>G.facade),q=8e3,J=1e3,Y=!1,X=class extends Error{constructor(e,t){super(`@fkn/lib: no broker connection within ${t}ms, so ${e} could not be requested`),this.name=`BrokerUnreachableError`}},Z=class extends Error{constructor(){super(`FKN @fkn/lib: this page relays its FKN channel to a worker, and the FKN page it reached predates a channel of the page's own; reload`),this.name=`OwnChannelUnavailableError`}},Q=(e,t)=>{let n=Y?J:q;return Promise.race([e,new Promise((e,r)=>setTimeout(()=>{Y=!0,r(t(n))},n))])},Ie=e=>z()?Q(G.routable().then(()=>G.facade),t=>U?new Z:new X(e,t)):Q(K,t=>new X(e,t));B(()=>{W.then(()=>{let e=setTimeout(()=>console.error(new Z),q);G.routable().then(()=>clearTimeout(e))})});var $=G.onEpoch,Le=G.current,Re=G.lastCall,ze=G.inFlight;$(e=>{pe()&&e.overlay.setHost(_e,{exactClips:f()}).catch(()=>{})}),Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Re}}),Object.defineProperty(exports,"c",{enumerable:!0,get:function(){return Le}}),Object.defineProperty(exports,"d",{enumerable:!0,get:function(){return Me}}),Object.defineProperty(exports,"f",{enumerable:!0,get:function(){return I}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return ze}}),Object.defineProperty(exports,"l",{enumerable:!0,get:function(){return Ne}}),Object.defineProperty(exports,"m",{enumerable:!0,get:function(){return A}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return X}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return K}}),Object.defineProperty(exports,"p",{enumerable:!0,get:function(){return Ce}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"s",{enumerable:!0,get:function(){return Ie}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return q}}),Object.defineProperty(exports,"u",{enumerable:!0,get:function(){return $}});
|
package/api.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./api-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./api-Csb5b8dE.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-
|
|
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-
|
|
1
|
+
import { K as Resolvers } from "./contract-CMQOic3K.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-C-VvG5P-.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-
|
|
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-BYtMzj8u.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
package/cloud/fetch.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../proxy-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../proxy-CL8j00ao.cjs");exports.fetch=e.t;
|
package/cloud/fetch.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as cloudFetch } from "../proxy-
|
|
1
|
+
import { t as cloudFetch } from "../proxy-ClDBa5il.js";
|
|
2
2
|
export { cloudFetch as fetch };
|
package/cloud/fetch.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { t as e } from "../proxy-
|
|
1
|
+
import { t as e } from "../proxy-vAsYHMIa.js";
|
|
2
2
|
export { e as fetch };
|
package/cloud/fs/promises.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions } from "../../index-BQgZVQl7.js";
|
|
2
|
-
import "../../fs-
|
|
2
|
+
import "../../fs-DCJAYoYy.js";
|
|
3
3
|
//#region src/cloud/fs-promises.d.ts
|
|
4
4
|
export declare const readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>, writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, unlink: (path: import("node:fs").PathLike) => Promise<void>, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>, readdir: (path: import("node:fs").PathLike) => Promise<string[]>, mkdir: (_path?: import("node:fs").PathLike, _options?: MakeOptions) => Promise<void>, rm: (path: import("node:fs").PathLike, options?: {
|
|
5
5
|
recursive?: boolean;
|
package/cloud/fs.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BIInC43l.cjs"),t=require("../node-fs-vsWuoMGa.cjs"),n=require("../messages.cjs"),r=require("../account-storage-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("../rolldown-runtime-BIInC43l.cjs"),t=require("../node-fs-vsWuoMGa.cjs"),n=require("../messages.cjs"),r=require("../account-storage-CL0wLuQw.cjs");var i=e.t({STORAGE_ACCOUNT_CHANGED:()=>n.STORAGE_ACCOUNT_CHANGED,STORAGE_ACCOUNT_PIN_UNSUPPORTED:()=>n.STORAGE_ACCOUNT_PIN_UNSUPPORTED,STORAGE_NOT_FOUND:()=>n.STORAGE_NOT_FOUND,StorageAccountChangedError:()=>r.t,StorageAccountPinUnsupportedError:()=>r.n,StorageLockedError:()=>r.r,StorageNotFoundError:()=>r.i,availability:()=>r.o,available:()=>a,encryption:()=>r.c,isAccountChanged:()=>r.l,isNotFound:()=>r.d,list:()=>h,mkdir:()=>d,promises:()=>m,quota:()=>r.h,readFile:()=>o,readFileSealed:()=>g,readdir:()=>u,rename:()=>l,rm:()=>f,stat:()=>p,unlink:()=>c,unlock:()=>r.y,writeFile:()=>s}),{available:a,readFile:o,writeFile:s,unlink:c,rename:l,readdir:u,mkdir:d,rm:f,stat:p,promises:m}=t.t(r.a,{memfs:!1}),h=()=>r.p(),g=e=>r._(e);exports.STORAGE_ACCOUNT_CHANGED=n.STORAGE_ACCOUNT_CHANGED,exports.STORAGE_ACCOUNT_PIN_UNSUPPORTED=n.STORAGE_ACCOUNT_PIN_UNSUPPORTED,exports.STORAGE_NOT_FOUND=n.STORAGE_NOT_FOUND,exports.StorageAccountChangedError=r.t,exports.StorageAccountPinUnsupportedError=r.n,exports.StorageLockedError=r.r,exports.StorageNotFoundError=r.i,exports.availability=r.o,exports.available=a,exports.encryption=r.c,exports.isAccountChanged=r.l,exports.isNotFound=r.d,exports.list=h,exports.mkdir=d,exports.promises=m,exports.quota=r.h,exports.readFile=o,exports.readFileSealed=g,exports.readdir=u,exports.rename=l,exports.rm=f,exports.stat=p,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return i}}),exports.unlink=c,exports.unlock=r.y,exports.writeFile=s;
|
package/cloud/fs.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as Stats } from "../index-BQgZVQl7.js";
|
|
2
|
-
import { _ as unlock, a as StorageAccountChangedError, c as StorageNotFoundError, d as availability, g as quota, h as isNotFound, i as SealedRead, l as StorageQuota, m as isAccountChanged, n as EncryptionStatus, o as StorageAccountPinUnsupportedError, p as encryption, r as FileEntry, s as StorageLockedError, t as CloudAvailability } from "../account-storage-
|
|
2
|
+
import { _ as unlock, a as StorageAccountChangedError, c as StorageNotFoundError, d as availability, g as quota, h as isNotFound, i as SealedRead, l as StorageQuota, m as isAccountChanged, n as EncryptionStatus, o as StorageAccountPinUnsupportedError, p as encryption, r as FileEntry, s as StorageLockedError, t as CloudAvailability } from "../account-storage-Co9IvkPr.js";
|
|
3
3
|
import { c as STORAGE_ACCOUNT_CHANGED, l as STORAGE_ACCOUNT_PIN_UNSUPPORTED, u as STORAGE_NOT_FOUND } from "../messages-AdPfdoLV.js";
|
|
4
|
-
import { a as promises, c as readdir, d as stat, f as unlink, i as mkdir, l as rename, o as readFile, p as writeFile, r as list, s as readFileSealed, t as available, u as rm } from "../fs-
|
|
4
|
+
import { a as promises, c as readdir, d as stat, f as unlink, i as mkdir, l as rename, o as readFile, p as writeFile, r as list, s as readFileSealed, t as available, u as rm } from "../fs-DCJAYoYy.js";
|
|
5
5
|
export { type CloudAvailability, type EncryptionStatus, type FileEntry, STORAGE_ACCOUNT_CHANGED, STORAGE_ACCOUNT_PIN_UNSUPPORTED, STORAGE_NOT_FOUND, type SealedRead, type Stats, StorageAccountChangedError, StorageAccountPinUnsupportedError, StorageLockedError, StorageNotFoundError, type StorageQuota, availability, available, encryption, isAccountChanged, isNotFound, list, mkdir, promises, quota, readFile, readFileSealed, readdir, rename, rm, stat, unlink, unlock, writeFile };
|
package/cloud/fs.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "../rolldown-runtime-Dy4uBu1J.js";
|
|
2
2
|
import { t } from "../node-fs-DY2fO5zd.js";
|
|
3
3
|
import { STORAGE_ACCOUNT_CHANGED as n, STORAGE_ACCOUNT_PIN_UNSUPPORTED as r, STORAGE_NOT_FOUND as i } from "../messages.js";
|
|
4
|
-
import { _ as a, a as o, c as s, d as c, h as l, i as u, l as d, n as f, o as p, p as m, r as h, t as g, y as _ } from "../account-storage-
|
|
4
|
+
import { _ as a, a as o, c as s, d as c, h as l, i as u, l as d, n as f, o as p, p as m, r as h, t as g, y as _ } from "../account-storage-D1RiskV6.js";
|
|
5
5
|
//#region src/cloud/fs.ts
|
|
6
6
|
var v = /* @__PURE__ */ e({
|
|
7
7
|
STORAGE_ACCOUNT_CHANGED: () => n,
|
package/cloud/net.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-
|
|
1
|
+
import { a as createConnection, c as isIP, i as connect, l as isIPv4, n as Socket, o as createServer, r as _default, t as Server, u as isIPv6 } from "../net-B8YQuB9E.js";
|
|
2
2
|
export { Server, Socket, _default, _default as default, connect, createConnection, createServer, isIP, isIPv4, isIPv6 };
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { D as t, E as n, N as r, O as i, T as a, _ as o, c as s, f as c, ft as l, g as u, h as d, j as f, k as p, l as m, m as h, o as g, p as _, s as v, u as y, x as b, y as x } from "./lib-
|
|
2
|
+
import { D as t, E as n, N as r, O as i, T as a, _ as o, c as s, f as c, ft as l, g as u, h as d, j as f, k as p, l as m, m as h, o as g, p as _, s as v, u as y, x as b, y as x } from "./lib-BGAmzIcU.js";
|
|
3
3
|
import { c as S, m as C, t as w } from "./hosts-t7CKGTRz.js";
|
|
4
|
-
import { l as T, m as E, n as D, o as O, s as k } from "./api-
|
|
4
|
+
import { l as T, m as E, n as D, o as O, s as k } from "./api-BYtMzj8u.js";
|
|
5
5
|
import { r as A } from "./busy-DsMWrSzc.js";
|
|
6
|
-
import { t as j } from "./proxy-
|
|
6
|
+
import { t as j } from "./proxy-vAsYHMIa.js";
|
|
7
7
|
import { frameFetchVerdict as M } from "./attach-policy.js";
|
|
8
8
|
import { ATTACH_FRAME_KEY as N, ATTACH_WINDOW_KEY as ee, ATTACH_WINDOW_MESSAGE as P, WINDOW_HANDSHAKE_TIMEOUT_MS as te } from "./contract.js";
|
|
9
9
|
import { t as ne } from "./dns.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-C0xyv8BQ.cjs"),n=require("./hosts-GNBhZO3-.cjs"),r=require("./api-6wTec7WK.cjs"),i=require("./busy-BXbVH595.cjs"),a=require("./proxy-DhalpZoN.cjs"),o=require("./attach-policy.cjs"),s=require("./contract.cjs"),c=require("./dns.cjs"),l=require("./cloud/fs.cjs"),u=require("./net.cjs"),d=require("./dgram.cjs"),f=require("./http.cjs");let p=require("osra");var m=async()=>{let e=()=>r.s(`frame consent`);try{let t=await e();return{request:typeof t.frameConsent.request==`function`?t.frameConsent.request:void 0,ensure:t.frameConsent.ensure}}catch(t){if(!(t instanceof r.n))throw t;return{request:void 0,ensure:t=>e().then(e=>e.frameConsent.ensure(t))}}},h=`frame: this frame no longer holds the document the app attached it to`,g=!1,_=()=>{g||(g=!0,console.warn(`[fkn-frame] this FKN broker is too old to ask for permission categories, so nothing was asked for upfront and each capability is asked for as it is first used. Reloading the page picks up the current broker.`))},v=e=>[...e].flatMap(e=>{try{return[new URL(e).hostname]}catch{return[]}}),y=e=>typeof e?.reason==`string`?{reason:e.reason}:{},b=(e,t,n)=>n===null?`frame.${e}: the user did not grant ${t} here`:`frame.${e}: the user did not grant ${t} on ${n}`,x=e=>{let{assertLive:r,attach:i,consent:a,current:s,declaredHosts:c,documentHost:l,freshBlank:u,session:d,approvedOrigins:f}=e,p=new Set,m=()=>{try{return new URL(s()).hostname}catch{return``}},g=async()=>l?await l():m(),x=()=>n.t([...c,...v(f)]),S=async(e,t)=>(await e([t]))[0]??!1;return{gate:async({operation:e,args:s,phase:l})=>{r();let _=n.m(e,s);if(_===null)return;let v=t.h(_);if(v===void 0||v===`auto`)return;if(e===`fetch`){let e=o.frameFetchVerdict({session:d,declaredHosts:c,approvedOrigins:f},l===`ensure`?void 0:s[0],{classifier:`fetchTarget`});if(l===`ensure`&&!d)throw t.k(e.kind===`refuse`?e.reason:``,`fetch`);if(l!==`ensure`&&e.kind===`refuse`)throw t.k(e.reason,`fetch`);let{request:r,ensure:i}=await a();if(!r){if(e.kind===`refuse`)throw t.k(e.reason,`fetch`);if(!await i({scope:n.c(s[0],s[1]).scope,hosts:e.promptHosts}))throw t.k(`frame.fetch: the user did not grant this`,`fetch`);return}let u=e.kind===`consent`?e.targetHost:await g(),p=n.t([u,...c]);if(!p.length)throw t.k(`frame: navigate the frame before fetch`,`fetch`);if(await S(r,{category:`network`,hosts:p,...y(t.T(s))})===!1)throw t.k(b(`fetch`,`network`,u||null),`fetch`);return}let C=await g();if(!C)throw t.k(`frame: navigate the frame before ${e}`,e);if(!x().includes(C))throw t.k(h,e);let w=t.m(_);if(w===void 0||w===`evaluation`&&C===m()&&await u?.()||v===`critical`&&p.has(`${_} ${C}`))return;let{request:T}=await a();if(!T)return;let E=n.t([C,...c]),D=y(t.T(s)),O=v===`critical`?{key:_,hosts:E,attach:i,...D}:{category:w,hosts:E,...D},k=await S(T,O);if(k===!1)throw t.k(b(e,w,null),e);if(k===`once`&&l!==`ensure`)for(let e of E)p.add(`${_} ${e}`)},requestCategories:async e=>{r(),t.f(`frame.requestPermissions`,e);let o=await g(),s=n.t(o?[o,...c]:c);if(!s.length)throw TypeError(`frame.requestPermissions: navigate the frame or declare domains first`);let l=e.map(e=>{let n=e.key;return n===void 0?{named:void 0,critical:!1,category:e.category}:{named:n,critical:t.h(n)===`critical`,category:t.p(n)}}),u=({named:e,critical:t,category:n},r)=>({category:n,...t?{key:e}:{},hosts:s,allow:r}),{request:d}=await a();if(!d)return _(),l.map(e=>u(e,!1));let f=await d(l.map(({named:t,critical:n,category:r},a)=>{let o=y(e[a]);return n?{key:t,hosts:s,attach:i,...o}:{category:r,hosts:s,...o}}));return l.map((e,t)=>u(e,f[t]!==void 0&&f[t]!==!1))},boundary:x}},S=e=>e,C=5e3,w=new Set([]),T=()=>`https://fkn.app`,E=e=>e===`persistent`?``:`incognito-${crypto.randomUUID()}`,D=(e,n,r)=>{let i,a=new Promise((e,a)=>{i=setTimeout(()=>a(typeof r==`string`?new t.E(r):r()),n)});return Promise.race([e,a]).finally(()=>clearTimeout(i))},O=e=>Object.assign(Error(e),{name:t.D}),k=`frame.postMessage: this FKN page predates frame messaging; reload the app to load the current one`,A=`frame.addScriptTag: this render proxy predates addScriptTag; reload the app`,j=`frame.addScriptTag: no answer within ${t.l}ms; the script may or may not have run`,M=`frame.clearCookies: this FKN page predates clearCookies; reload the app to load the current one`,N=`frame.clearCookies: this attachment reaches no site yet; attach a url, goto one, or declare it in domains`,P=3e4,F=`attachFrame: this FKN page predates storageState; reload the app to load the current one`,I=2e4,L=async(e,n)=>{if(typeof e.seed!=`function`)throw t.N(F,`storageState`,`cloud`);try{await D(e.seed(n),I,`attachFrame: the render proxy did not take the storageState seed`)}catch(e){throw t.O(e)?t.N(F,`storageState`,`cloud`):e}},ee=`frame.clearCookies: the render proxy did not answer within ${P}ms; the cookies may or may not be gone, and calling it again is safe`,R=e=>t.O(e)&&e.message===t.j(`addScriptTag`).message,z=!1,te=()=>{z||(z=!0,console.warn(`[fkn-frame] this FKN page predates frame messaging, so the page's messages and documents are never reported. Reloading the app loads the current one.`))},B=({from:e,origin:t,attach:n,signal:r})=>i=>{let a=r=>{if(r.source===null||r.source!==e()||r.origin!==t)return;let a=r.data;typeof a==`object`&&a&&a.type===`fkn-frame-message`&&a.attach===n&&typeof a.origin==`string`&&(a.kind===`message`?i({type:`message`,data:a.data,origin:a.origin,ports:r.ports}):a.kind===`document`&&i({type:`document`,origin:a.origin}))};return window.addEventListener(`message`,a,{signal:r}),()=>window.removeEventListener(`message`,a)},ne=e=>{if(typeof e!=`function`)return()=>Promise.resolve(e);let t=null;return()=>t??=e().catch(e=>{throw t=null,e})},V=({control:e,target:n,blank:r=!1,session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,guard:l,consent:u,onNavigated:d,relay:f})=>{let p=n,m=r&&i!==``,g=async()=>{if(!m)return!1;let t=typeof e.blank==`function`?await l(()=>e.blank()):``;return(typeof t!=`string`||t.split(`#`)[0]!==n.split(`#`)[0])&&(m=!1),m},_=Promise.resolve(),{gate:v,requestCategories:y,boundary:b}=x({session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,documentHost:typeof e.documentHost==`function`?()=>l(()=>e.documentHost()):void 0,current:()=>p,consent:ne(u),freshBlank:g});return t.y({backend:`cloud`,executor:{execute:(n,r,i)=>w.has(r)?Promise.reject(t.j(r,`cloud`)):(c(),l(()=>e.executeLocator(n,r,i))),highlight:async()=>{}},gate:v,requestPermissions:y,evaluate:async(n,r)=>(c(),await v({parts:[],operation:`evaluate`,args:[n],phase:`execute`}),D(l(()=>e.executeLocator([],`evaluate`,[n,r])),t.l,t.u)),addScriptTag:async(n,r)=>{c();let i=[n,r];await v({parts:[],operation:`addScriptTag`,args:i,phase:`execute`});try{await D(l(()=>e.executeLocator([],`addScriptTag`,i)),t.l,j)}catch(e){throw R(e)?t.N(A,`addScriptTag`,`cloud`):e}},clearCookies:async n=>{if(c(),typeof e.clearCookies!=`function`)throw t.N(M,`clearCookies`,`cloud`);if(b().length===0)throw t.k(N,`clearCookies`);await D(l(()=>e.clearCookies(n)),P,ee)},postMessage:(n,r,i)=>{if(c(),typeof e.messaging!=`function`)throw t.N(k,`postMessage`,`cloud`);if(r!==`*`&&!b().includes(new URL(r).hostname))throw t.k(h,`postMessage`);let{port1:a,port2:o}=new MessageChannel;a.postMessage({data:n,transfer:i},i);let s=[o,r],u=_.then(async()=>(await v({parts:[],operation:`postMessage`,args:s,phase:`execute`}),{answer:l(()=>e.executeLocator([],`postMessage`,s))}));return _=u.catch(()=>{}),u.then(async({answer:e})=>{await e})},listen:t=>(typeof e.messaging!=`function`&&te(),f(t)),goto:async(n,{timeout:r,...i}={})=>{let a=new URL(n,location.href).href;c(),m=!1;let s=(()=>{try{return new URL(a).origin}catch{return``}})(),u=s!==``&&!o.has(s);u&&o.add(s);try{await D(l(()=>e.goto(a,r===void 0?i:{...i,timeoutMs:r})),(r??3e4)+C,`cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded`)}catch(e){throw u&&o.delete(s),t.c(e)}p=a,d()},url:()=>p})},re=250,ie=500,ae=65e3,oe=2e3,se=2e3,ce=2,le=2e3,ue=2e3,H=({origin:e,target:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-window`,e);return a.searchParams.set(`attach`,i),t&&a.searchParams.set(`url`,t),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.href},de=(e,t)=>{let n=document.createElement(`iframe`),r=new URL(`/attach-jar`,e);return r.searchParams.set(`attach`,t),n.src=r.href,n.tabIndex=-1,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`style`,`display:none`),(document.body??document.documentElement).appendChild(n),n},fe=(e,t)=>{let n=new MutationObserver(()=>{e.isConnected||t.aborted||(n.disconnect(),console.warn(`cloud.attachFrame: the window's jar anchor was removed from this page, so a sign-in in the window no longer reaches this app's cookie jar`))});e.parentNode&&n.observe(e.parentNode,{childList:!0}),n.observe(document.documentElement,{childList:!0}),t.addEventListener(`abort`,()=>n.disconnect(),{once:!0})},U=()=>O(`cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window`),W=()=>O(`cloud.attachFrame: the attached window stopped answering; attach a fresh window`),G=()=>O(`cloud.attachFrame: the window went away before it connected; attach a fresh window`),pe=()=>O(`cloud.attachFrame: the window closed before it connected. Either the user closed it, or this page's Cross-Origin-Opener-Policy cut its link to the window`),me=async(e,r,a)=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:o=[],permissions:c}=e,{url:l,width:u,height:d}=t.s(e.window);if(window.origin===`null`)throw new t._(`opaque-opener`);let f=T(),m=crypto.randomUUID(),h=E(r),g=n.t(o),_=new Set;l&&_.add(new URL(l).origin);let v=r===`persistent`?de(f,m):null,y=window.open(H({origin:f,target:a===void 0?l:``,session:h,domains:g,attach:m}),`_blank`,`popup,width=${u},height=${d}`);if(!y)throw v?.remove(),new t.g;let b=new AbortController,x=!1,C=null,w=(e,t=!1)=>{if(C===null){C=e,b.abort(t?W():U());try{y.closed||y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.detach,attach:m,...t?{unanswered:t}:{}},f)}catch{}v&&setTimeout(()=>v.remove(),ue)}};v&&fe(v,b.signal);let O=new Promise((e,t)=>{b.signal.addEventListener(`abort`,()=>t(b.signal.reason),{once:!0})});O.catch(()=>{});let k=O.then(()=>{},()=>{}),A=()=>{if(b.signal.aborted)throw b.signal.reason},j=e=>b.signal.aborted?Promise.reject(b.signal.reason):Promise.race([e(),O]),M=e=>e.source===y&&e.origin===f;window.addEventListener(`message`,e=>{if(!M(e))return;let n=e.data;typeof n==`object`&&n&&n.attach===m&&(n.type===s.ATTACH_WINDOW_MESSAGE.refused?w(new t._(n.reason)):n.type===s.ATTACH_WINDOW_MESSAGE.gone&&w(x?U():G()))},{signal:b.signal}),window.addEventListener(`pagehide`,()=>w(U()),{signal:b.signal});let N=()=>{try{y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.hello,attach:m},f)}catch{}};N();let P=setInterval(N,re),F=setInterval(()=>{y.closed&&w(x?U():pe())},ie);b.signal.addEventListener(`abort`,()=>{clearInterval(P),clearInterval(F)},{once:!0});let I=async e=>{try{return await Promise.race([e,O])}catch(e){throw C??e}};try{let e=await I(D((0,p.expose)({},{key:s.ATTACH_WINDOW_KEY,transport:{emit:(e,t)=>y.postMessage(e,f,t??[]),receive:e=>{let t=t=>{M(t)&&e(t.data,{source:t.source,origin:t.origin})};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}},unregisterSignal:b.signal,revivableModules:S(t.ft)}),s.WINDOW_HANDSHAKE_TIMEOUT_MS,`cloud.attachFrame: timed out connecting to the window`));x=!0,clearInterval(P);let n=0,r=setInterval(()=>{D(j(()=>e.ping()),se,`ping`).then(()=>{n=0},()=>{b.signal.aborted||(document.visibilityState===`hidden`?n=0:++n>=ce&&w(W(),!0))})},oe);b.signal.addEventListener(`abort`,()=>clearInterval(r),{once:!0}),await I(D(e.ready(),ae,`cloud.attachFrame: the window never became ready`)),a!==void 0&&await I(L(e,a)),i.r(`attached frame`,b.signal);let o=V({control:e,target:l,session:h,declaredHosts:g,approvedOrigins:_,attach:m,assertLive:A,guard:j,consent:{request:t=>j(()=>e.requestConsent(t)),ensure:t=>j(()=>e.requestConsent([t])).then(([e])=>e!==void 0&&e!==!1)},onNavigated:()=>{},relay:B({from:()=>y,origin:f,attach:m,signal:b.signal})}),u=null,d=Object.assign(o,{close:()=>u??=(async()=>{b.signal.aborted||await D(Promise.allSettled([j(()=>e.flushCookies()),j(()=>e.sweepStorage())]),le,`close`).catch(()=>{});try{y.close()}catch{}w(U())})(),closed:k});return a!==void 0&&l&&await I(d.goto(l)),c?.length&&await I(d.requestPermissions(c)),d}catch(e){let n=C??e;if(!(n instanceof t._))try{y.close()}catch{}throw w(n),n}},he=2e4,K=65e3,q=e=>!e||e===`about:blank`,ge=`cloud.attachFrame: this FKN page predates blank pages; reload the app to load the current one`,_e=`cloud.attachFrame: cookies: 'native' needs the FKN browser extension; the cloud render proxy has no browser cookies`,J=e=>e.split(`#`)[0]??``,Y=({iframe:e,lockdown:n,cookies:r,blank:i})=>{if(i===void 0)return``;if(typeof i!=`object`||!i)throw TypeError(`attachFrame: blank must be an object { url }`);let a=Object.keys(i).find(e=>e!==`url`);if(a!==void 0)throw TypeError(`attachFrame: blank takes { url }, not "${a}"`);let{url:o}=i,s=(()=>{try{return typeof o==`string`?new URL(o):null}catch{return null}})();if(!s||s.protocol!==`http:`&&s.protocol!==`https:`)throw TypeError(`attachFrame: blank.url must be an absolute http or https url, not "${String(o)}"`);let c=e.getAttribute(`src`)??``;if(!q(c))throw TypeError(`attachFrame: blank needs an iframe with no src; this one has "${c}"`);if(n)throw TypeError(`attachFrame: blank does not combine with lockdown`);if(r===`native`)throw TypeError(`attachFrame: blank runs on the cloud render proxy, which has no browser cookies; pass cookies: 'persistent' or 'ephemeral'`);if(t.x(s.href),!Ee())throw Error(`attachFrame: a blank page is served by the cloud render proxy, which this build does not configure`);return s.href},ve=({target:e,blank:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-frame`,T());return t?a.searchParams.set(`blank`,t):e&&a.searchParams.set(`url`,e),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.searchParams.set(`attach`,i),a.href},ye=(e,t)=>{let n=()=>{a(),t()},r=e.parentNode,i=new MutationObserver(()=>{(!e.isConnected||e.parentNode!==r)&&(a(),t())}),a=()=>{window.removeEventListener(`pagehide`,n),i.disconnect()};window.addEventListener(`pagehide`,n,{once:!0}),r&&i.observe(r,{childList:!0}),e.isConnected||(a(),t())},be=()=>O(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),xe=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},Se=[300,1200,4e3],X=e=>{let t=()=>{if(!e.isConnected)return;let t=e.style.height,n=e.getBoundingClientRect();n.height&&(e.style.height=`${n.height-1}px`,setTimeout(()=>{e.style.height=t},50))};t();for(let e of Se)setTimeout(t,e)},Ce=e=>{let t=e.getAttribute(`sandbox`);if(t===null)return;let n=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),r=[`allow-scripts`,`allow-same-origin`].filter(e=>!n.has(e));if(r.length)throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(` and `)} for the render proxy to load`)},we=async(e,n)=>{let r=typeof e.blank==`function`?await D(e.blank(),K,`cloud.attachFrame: the render proxy never became ready`):``;if(typeof r!=`string`||J(r)!==J(n))throw t.N(ge,`blank`,`cloud`)},Te=async(e,a,o)=>{let c=Y(e),{iframe:l,domains:u=[],permissions:d}=e;if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);if(!l.isConnected)throw Error(`cloud.attachFrame: the iframe must be connected to the document before attaching`);Ce(l);let f=l.getAttribute(`src`)??``,h=(()=>{if(q(f))return null;try{return new URL(l.src||f,location.href)}catch{throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${f}`)}})();if(h){let e=new URL(`/attach-frame`,T());if(h.origin===e.origin&&h.pathname===e.pathname)throw Error(`cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe`)}let g=h?.href??``;g&&t.x(g);let _=o===void 0?g:``,v=E(a),y=n.t(u),b=new Set;try{b.add(new URL(c||g).origin)}catch{}let x=new AbortController,C=l.referrerPolicy,w=l.allow,O=crypto.randomUUID();if(l.referrerPolicy=`origin`,l.allow=xe(r.m(),l.allow),l.src=ve({target:_,blank:c,session:v,domains:y,attach:O}),!l.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let e=await D((0,p.expose)({},{key:s.ATTACH_FRAME_KEY,origin:T(),transport:{receive:window,emit:l.contentWindow},unregisterSignal:x.signal,revivableModules:S(t.ft)}),he,`cloud.attachFrame: timed out connecting to the render proxy page`);await D(e.ready(),K,`cloud.attachFrame: the render proxy never became ready`),c&&await we(e,c),o!==void 0&&await L(e,o),(g||c)&&X(l),ye(l,()=>x.abort()),i.r(`attached frame`,x.signal);let n=l.contentWindow,r=V({control:e,target:c||g,blank:c!==``,session:v,declaredHosts:y,approvedOrigins:b,attach:O,assertLive:()=>{if(x.signal.aborted||!l.isConnected||l.contentWindow!==n)throw x.abort(),be()},guard:e=>e(),consent:m,onNavigated:()=>X(l),relay:B({from:()=>n,origin:T(),attach:O,signal:x.signal})});return o!==void 0&&g&&await r.goto(g),d?.length&&await r.requestPermissions(d),r}catch(e){throw x.abort(),l.referrerPolicy=C,l.allow=w,l.src=_||`about:blank`,e}},Z=(async e=>{let{kind:n,cookies:r,storageState:i}=t.o(e);if(r===`native`)throw TypeError(_e);return n===`window`?me(e,r,i):Te(e,r,i)}),Ee=()=>typeof window<`u`&&!0,Q=async()=>{let e=await r.o.then(e=>e.cloud.quota());return{premium:e.premium,overQuota:e.overQuota,throttled:e.overQuota&&!e.premium,usedBytes:e.usedBytes,limitBytes:e.limitBytes,remainingBytes:e.remaining,bytesPerSecond:e.bytesPerSecond,bitsPerSecond:e.bytesPerSecond*8}},De=e.t({attachFrame:()=>Z,available:()=>$,dgram:()=>d.t,dns:()=>c.t,fetch:()=>a.t,fs:()=>l.t,http:()=>f.t,net:()=>u.t,quota:()=>Q}),$=()=>r.l;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-BiQ6cOZ7.cjs"),n=require("./hosts-GNBhZO3-.cjs"),r=require("./api-Csb5b8dE.cjs"),i=require("./busy-BXbVH595.cjs"),a=require("./proxy-CL8j00ao.cjs"),o=require("./attach-policy.cjs"),s=require("./contract.cjs"),c=require("./dns.cjs"),l=require("./cloud/fs.cjs"),u=require("./net.cjs"),d=require("./dgram.cjs"),f=require("./http.cjs");let p=require("osra");var m=async()=>{let e=()=>r.s(`frame consent`);try{let t=await e();return{request:typeof t.frameConsent.request==`function`?t.frameConsent.request:void 0,ensure:t.frameConsent.ensure}}catch(t){if(!(t instanceof r.n))throw t;return{request:void 0,ensure:t=>e().then(e=>e.frameConsent.ensure(t))}}},h=`frame: this frame no longer holds the document the app attached it to`,g=!1,_=()=>{g||(g=!0,console.warn(`[fkn-frame] this FKN broker is too old to ask for permission categories, so nothing was asked for upfront and each capability is asked for as it is first used. Reloading the page picks up the current broker.`))},v=e=>[...e].flatMap(e=>{try{return[new URL(e).hostname]}catch{return[]}}),y=e=>typeof e?.reason==`string`?{reason:e.reason}:{},b=(e,t,n)=>n===null?`frame.${e}: the user did not grant ${t} here`:`frame.${e}: the user did not grant ${t} on ${n}`,x=e=>{let{assertLive:r,attach:i,consent:a,current:s,declaredHosts:c,documentHost:l,freshBlank:u,session:d,approvedOrigins:f}=e,p=new Set,m=()=>{try{return new URL(s()).hostname}catch{return``}},g=async()=>l?await l():m(),x=()=>n.t([...c,...v(f)]),S=async(e,t)=>(await e([t]))[0]??!1;return{gate:async({operation:e,args:s,phase:l})=>{r();let _=n.m(e,s);if(_===null)return;let v=t.h(_);if(v===void 0||v===`auto`)return;if(e===`fetch`){let e=o.frameFetchVerdict({session:d,declaredHosts:c,approvedOrigins:f},l===`ensure`?void 0:s[0],{classifier:`fetchTarget`});if(l===`ensure`&&!d)throw t.k(e.kind===`refuse`?e.reason:``,`fetch`);if(l!==`ensure`&&e.kind===`refuse`)throw t.k(e.reason,`fetch`);let{request:r,ensure:i}=await a();if(!r){if(e.kind===`refuse`)throw t.k(e.reason,`fetch`);if(!await i({scope:n.c(s[0],s[1]).scope,hosts:e.promptHosts}))throw t.k(`frame.fetch: the user did not grant this`,`fetch`);return}let u=e.kind===`consent`?e.targetHost:await g(),p=n.t([u,...c]);if(!p.length)throw t.k(`frame: navigate the frame before fetch`,`fetch`);if(await S(r,{category:`network`,hosts:p,...y(t.T(s))})===!1)throw t.k(b(`fetch`,`network`,u||null),`fetch`);return}let C=await g();if(!C)throw t.k(`frame: navigate the frame before ${e}`,e);if(!x().includes(C))throw t.k(h,e);let w=t.m(_);if(w===void 0||w===`evaluation`&&C===m()&&await u?.()||v===`critical`&&p.has(`${_} ${C}`))return;let{request:T}=await a();if(!T)return;let E=n.t([C,...c]),D=y(t.T(s)),O=v===`critical`?{key:_,hosts:E,attach:i,...D}:{category:w,hosts:E,...D},k=await S(T,O);if(k===!1)throw t.k(b(e,w,null),e);if(k===`once`&&l!==`ensure`)for(let e of E)p.add(`${_} ${e}`)},requestCategories:async e=>{r(),t.f(`frame.requestPermissions`,e);let o=await g(),s=n.t(o?[o,...c]:c);if(!s.length)throw TypeError(`frame.requestPermissions: navigate the frame or declare domains first`);let l=e.map(e=>{let n=e.key;return n===void 0?{named:void 0,critical:!1,category:e.category}:{named:n,critical:t.h(n)===`critical`,category:t.p(n)}}),u=({named:e,critical:t,category:n},r)=>({category:n,...t?{key:e}:{},hosts:s,allow:r}),{request:d}=await a();if(!d)return _(),l.map(e=>u(e,!1));let f=await d(l.map(({named:t,critical:n,category:r},a)=>{let o=y(e[a]);return n?{key:t,hosts:s,attach:i,...o}:{category:r,hosts:s,...o}}));return l.map((e,t)=>u(e,f[t]!==void 0&&f[t]!==!1))},boundary:x}},S=e=>e,C=5e3,w=new Set([]),T=()=>`https://fkn.app`,E=e=>e===`persistent`?``:`incognito-${crypto.randomUUID()}`,D=(e,n,r)=>{let i,a=new Promise((e,a)=>{i=setTimeout(()=>a(typeof r==`string`?new t.E(r):r()),n)});return Promise.race([e,a]).finally(()=>clearTimeout(i))},O=e=>Object.assign(Error(e),{name:t.D}),k=`frame.postMessage: this FKN page predates frame messaging; reload the app to load the current one`,A=`frame.addScriptTag: this render proxy predates addScriptTag; reload the app`,j=`frame.addScriptTag: no answer within ${t.l}ms; the script may or may not have run`,M=`frame.clearCookies: this FKN page predates clearCookies; reload the app to load the current one`,N=`frame.clearCookies: this attachment reaches no site yet; attach a url, goto one, or declare it in domains`,P=3e4,F=`attachFrame: this FKN page predates storageState; reload the app to load the current one`,I=2e4,L=async(e,n)=>{if(typeof e.seed!=`function`)throw t.N(F,`storageState`,`cloud`);try{await D(e.seed(n),I,`attachFrame: the render proxy did not take the storageState seed`)}catch(e){throw t.O(e)?t.N(F,`storageState`,`cloud`):e}},ee=`frame.clearCookies: the render proxy did not answer within ${P}ms; the cookies may or may not be gone, and calling it again is safe`,R=e=>t.O(e)&&e.message===t.j(`addScriptTag`).message,z=!1,te=()=>{z||(z=!0,console.warn(`[fkn-frame] this FKN page predates frame messaging, so the page's messages and documents are never reported. Reloading the app loads the current one.`))},B=({from:e,origin:t,attach:n,signal:r})=>i=>{let a=r=>{if(r.source===null||r.source!==e()||r.origin!==t)return;let a=r.data;typeof a==`object`&&a&&a.type===`fkn-frame-message`&&a.attach===n&&typeof a.origin==`string`&&(a.kind===`message`?i({type:`message`,data:a.data,origin:a.origin,ports:r.ports}):a.kind===`document`&&i({type:`document`,origin:a.origin}))};return window.addEventListener(`message`,a,{signal:r}),()=>window.removeEventListener(`message`,a)},ne=e=>{if(typeof e!=`function`)return()=>Promise.resolve(e);let t=null;return()=>t??=e().catch(e=>{throw t=null,e})},V=({control:e,target:n,blank:r=!1,session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,guard:l,consent:u,onNavigated:d,relay:f})=>{let p=n,m=r&&i!==``,g=async()=>{if(!m)return!1;let t=typeof e.blank==`function`?await l(()=>e.blank()):``;return(typeof t!=`string`||t.split(`#`)[0]!==n.split(`#`)[0])&&(m=!1),m},_=Promise.resolve(),{gate:v,requestCategories:y,boundary:b}=x({session:i,declaredHosts:a,approvedOrigins:o,attach:s,assertLive:c,documentHost:typeof e.documentHost==`function`?()=>l(()=>e.documentHost()):void 0,current:()=>p,consent:ne(u),freshBlank:g});return t.y({backend:`cloud`,executor:{execute:(n,r,i)=>w.has(r)?Promise.reject(t.j(r,`cloud`)):(c(),l(()=>e.executeLocator(n,r,i))),highlight:async()=>{}},gate:v,requestPermissions:y,evaluate:async(n,r)=>(c(),await v({parts:[],operation:`evaluate`,args:[n],phase:`execute`}),D(l(()=>e.executeLocator([],`evaluate`,[n,r])),t.l,t.u)),addScriptTag:async(n,r)=>{c();let i=[n,r];await v({parts:[],operation:`addScriptTag`,args:i,phase:`execute`});try{await D(l(()=>e.executeLocator([],`addScriptTag`,i)),t.l,j)}catch(e){throw R(e)?t.N(A,`addScriptTag`,`cloud`):e}},clearCookies:async n=>{if(c(),typeof e.clearCookies!=`function`)throw t.N(M,`clearCookies`,`cloud`);if(b().length===0)throw t.k(N,`clearCookies`);await D(l(()=>e.clearCookies(n)),P,ee)},postMessage:(n,r,i)=>{if(c(),typeof e.messaging!=`function`)throw t.N(k,`postMessage`,`cloud`);if(r!==`*`&&!b().includes(new URL(r).hostname))throw t.k(h,`postMessage`);let{port1:a,port2:o}=new MessageChannel;a.postMessage({data:n,transfer:i},i);let s=[o,r],u=_.then(async()=>(await v({parts:[],operation:`postMessage`,args:s,phase:`execute`}),{answer:l(()=>e.executeLocator([],`postMessage`,s))}));return _=u.catch(()=>{}),u.then(async({answer:e})=>{await e})},listen:t=>(typeof e.messaging!=`function`&&te(),f(t)),goto:async(n,{timeout:r,...i}={})=>{let a=new URL(n,location.href).href;c(),m=!1;let s=(()=>{try{return new URL(a).origin}catch{return``}})(),u=s!==``&&!o.has(s);u&&o.add(s);try{await D(l(()=>e.goto(a,r===void 0?i:{...i,timeoutMs:r})),(r??3e4)+C,`cloud.attachFrame: the render proxy did not answer goto; the frame may have been detached or its page reloaded`)}catch(e){throw u&&o.delete(s),t.c(e)}p=a,d()},url:()=>p})},re=250,ie=500,ae=65e3,oe=2e3,se=2e3,ce=2,le=2e3,ue=2e3,H=({origin:e,target:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-window`,e);return a.searchParams.set(`attach`,i),t&&a.searchParams.set(`url`,t),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.href},de=(e,t)=>{let n=document.createElement(`iframe`),r=new URL(`/attach-jar`,e);return r.searchParams.set(`attach`,t),n.src=r.href,n.tabIndex=-1,n.setAttribute(`aria-hidden`,`true`),n.setAttribute(`style`,`display:none`),(document.body??document.documentElement).appendChild(n),n},fe=(e,t)=>{let n=new MutationObserver(()=>{e.isConnected||t.aborted||(n.disconnect(),console.warn(`cloud.attachFrame: the window's jar anchor was removed from this page, so a sign-in in the window no longer reaches this app's cookie jar`))});e.parentNode&&n.observe(e.parentNode,{childList:!0}),n.observe(document.documentElement,{childList:!0}),t.addEventListener(`abort`,()=>n.disconnect(),{once:!0})},U=()=>O(`cloud.attachFrame: the attached window closed, reloaded or left the page FKN attached; attach a fresh window`),W=()=>O(`cloud.attachFrame: the attached window stopped answering; attach a fresh window`),G=()=>O(`cloud.attachFrame: the window went away before it connected; attach a fresh window`),pe=()=>O(`cloud.attachFrame: the window closed before it connected. Either the user closed it, or this page's Cross-Origin-Opener-Policy cut its link to the window`),me=async(e,r,a)=>{if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);let{domains:o=[],permissions:c}=e,{url:l,width:u,height:d}=t.s(e.window);if(window.origin===`null`)throw new t._(`opaque-opener`);let f=T(),m=crypto.randomUUID(),h=E(r),g=n.t(o),_=new Set;l&&_.add(new URL(l).origin);let v=r===`persistent`?de(f,m):null,y=window.open(H({origin:f,target:a===void 0?l:``,session:h,domains:g,attach:m}),`_blank`,`popup,width=${u},height=${d}`);if(!y)throw v?.remove(),new t.g;let b=new AbortController,x=!1,C=null,w=(e,t=!1)=>{if(C===null){C=e,b.abort(t?W():U());try{y.closed||y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.detach,attach:m,...t?{unanswered:t}:{}},f)}catch{}v&&setTimeout(()=>v.remove(),ue)}};v&&fe(v,b.signal);let O=new Promise((e,t)=>{b.signal.addEventListener(`abort`,()=>t(b.signal.reason),{once:!0})});O.catch(()=>{});let k=O.then(()=>{},()=>{}),A=()=>{if(b.signal.aborted)throw b.signal.reason},j=e=>b.signal.aborted?Promise.reject(b.signal.reason):Promise.race([e(),O]),M=e=>e.source===y&&e.origin===f;window.addEventListener(`message`,e=>{if(!M(e))return;let n=e.data;typeof n==`object`&&n&&n.attach===m&&(n.type===s.ATTACH_WINDOW_MESSAGE.refused?w(new t._(n.reason)):n.type===s.ATTACH_WINDOW_MESSAGE.gone&&w(x?U():G()))},{signal:b.signal}),window.addEventListener(`pagehide`,()=>w(U()),{signal:b.signal});let N=()=>{try{y.postMessage({type:s.ATTACH_WINDOW_MESSAGE.hello,attach:m},f)}catch{}};N();let P=setInterval(N,re),F=setInterval(()=>{y.closed&&w(x?U():pe())},ie);b.signal.addEventListener(`abort`,()=>{clearInterval(P),clearInterval(F)},{once:!0});let I=async e=>{try{return await Promise.race([e,O])}catch(e){throw C??e}};try{let e=await I(D((0,p.expose)({},{key:s.ATTACH_WINDOW_KEY,transport:{emit:(e,t)=>y.postMessage(e,f,t??[]),receive:e=>{let t=t=>{M(t)&&e(t.data,{source:t.source,origin:t.origin})};return window.addEventListener(`message`,t),()=>window.removeEventListener(`message`,t)}},unregisterSignal:b.signal,revivableModules:S(t.ft)}),s.WINDOW_HANDSHAKE_TIMEOUT_MS,`cloud.attachFrame: timed out connecting to the window`));x=!0,clearInterval(P);let n=0,r=setInterval(()=>{D(j(()=>e.ping()),se,`ping`).then(()=>{n=0},()=>{b.signal.aborted||(document.visibilityState===`hidden`?n=0:++n>=ce&&w(W(),!0))})},oe);b.signal.addEventListener(`abort`,()=>clearInterval(r),{once:!0}),await I(D(e.ready(),ae,`cloud.attachFrame: the window never became ready`)),a!==void 0&&await I(L(e,a)),i.r(`attached frame`,b.signal);let o=V({control:e,target:l,session:h,declaredHosts:g,approvedOrigins:_,attach:m,assertLive:A,guard:j,consent:{request:t=>j(()=>e.requestConsent(t)),ensure:t=>j(()=>e.requestConsent([t])).then(([e])=>e!==void 0&&e!==!1)},onNavigated:()=>{},relay:B({from:()=>y,origin:f,attach:m,signal:b.signal})}),u=null,d=Object.assign(o,{close:()=>u??=(async()=>{b.signal.aborted||await D(Promise.allSettled([j(()=>e.flushCookies()),j(()=>e.sweepStorage())]),le,`close`).catch(()=>{});try{y.close()}catch{}w(U())})(),closed:k});return a!==void 0&&l&&await I(d.goto(l)),c?.length&&await I(d.requestPermissions(c)),d}catch(e){let n=C??e;if(!(n instanceof t._))try{y.close()}catch{}throw w(n),n}},he=2e4,K=65e3,q=e=>!e||e===`about:blank`,ge=`cloud.attachFrame: this FKN page predates blank pages; reload the app to load the current one`,_e=`cloud.attachFrame: cookies: 'native' needs the FKN browser extension; the cloud render proxy has no browser cookies`,J=e=>e.split(`#`)[0]??``,Y=({iframe:e,lockdown:n,cookies:r,blank:i})=>{if(i===void 0)return``;if(typeof i!=`object`||!i)throw TypeError(`attachFrame: blank must be an object { url }`);let a=Object.keys(i).find(e=>e!==`url`);if(a!==void 0)throw TypeError(`attachFrame: blank takes { url }, not "${a}"`);let{url:o}=i,s=(()=>{try{return typeof o==`string`?new URL(o):null}catch{return null}})();if(!s||s.protocol!==`http:`&&s.protocol!==`https:`)throw TypeError(`attachFrame: blank.url must be an absolute http or https url, not "${String(o)}"`);let c=e.getAttribute(`src`)??``;if(!q(c))throw TypeError(`attachFrame: blank needs an iframe with no src; this one has "${c}"`);if(n)throw TypeError(`attachFrame: blank does not combine with lockdown`);if(r===`native`)throw TypeError(`attachFrame: blank runs on the cloud render proxy, which has no browser cookies; pass cookies: 'persistent' or 'ephemeral'`);if(t.x(s.href),!Ee())throw Error(`attachFrame: a blank page is served by the cloud render proxy, which this build does not configure`);return s.href},ve=({target:e,blank:t,session:n,domains:r,attach:i})=>{let a=new URL(`/attach-frame`,T());return t?a.searchParams.set(`blank`,t):e&&a.searchParams.set(`url`,e),n&&a.searchParams.set(`session`,n),r.length&&a.searchParams.set(`domains`,r.join(`,`)),a.searchParams.set(`attach`,i),a.href},ye=(e,t)=>{let n=()=>{a(),t()},r=e.parentNode,i=new MutationObserver(()=>{(!e.isConnected||e.parentNode!==r)&&(a(),t())}),a=()=>{window.removeEventListener(`pagehide`,n),i.disconnect()};window.addEventListener(`pagehide`,n,{once:!0}),r&&i.observe(r,{childList:!0}),e.isConnected||(a(),t())},be=()=>O(`cloud.attachFrame: the attached iframe left the document or was reloaded; attach a fresh iframe`),xe=(e,t)=>{let n=[...e.split(`;`),...t.split(`;`)].map(e=>e.trim()).filter(Boolean);return[...new Set(n)].join(`; `)},Se=[300,1200,4e3],X=e=>{let t=()=>{if(!e.isConnected)return;let t=e.style.height,n=e.getBoundingClientRect();n.height&&(e.style.height=`${n.height-1}px`,setTimeout(()=>{e.style.height=t},50))};t();for(let e of Se)setTimeout(t,e)},Ce=e=>{let t=e.getAttribute(`sandbox`);if(t===null)return;let n=new Set(t.toLowerCase().split(/\s+/).filter(Boolean)),r=[`allow-scripts`,`allow-same-origin`].filter(e=>!n.has(e));if(r.length)throw Error(`cloud.attachFrame: the iframe's sandbox attribute must include ${r.join(` and `)} for the render proxy to load`)},we=async(e,n)=>{let r=typeof e.blank==`function`?await D(e.blank(),K,`cloud.attachFrame: the render proxy never became ready`):``;if(typeof r!=`string`||J(r)!==J(n))throw t.N(ge,`blank`,`cloud`)},Te=async(e,a,o)=>{let c=Y(e),{iframe:l,domains:u=[],permissions:d}=e;if(typeof window>`u`)throw Error(`cloud.attachFrame needs a window realm`);if(!l.isConnected)throw Error(`cloud.attachFrame: the iframe must be connected to the document before attaching`);Ce(l);let f=l.getAttribute(`src`)??``,h=(()=>{if(q(f))return null;try{return new URL(l.src||f,location.href)}catch{throw Error(`cloud.attachFrame: the iframe src is not a valid URL: ${f}`)}})();if(h){let e=new URL(`/attach-frame`,T());if(h.origin===e.origin&&h.pathname===e.pathname)throw Error(`cloud.attachFrame: this iframe is already attached; navigate with the Frame returned by that attach or use a fresh iframe`)}let g=h?.href??``;g&&t.x(g);let _=o===void 0?g:``,v=E(a),y=n.t(u),b=new Set;try{b.add(new URL(c||g).origin)}catch{}let x=new AbortController,C=l.referrerPolicy,w=l.allow,O=crypto.randomUUID();if(l.referrerPolicy=`origin`,l.allow=xe(r.m(),l.allow),l.src=ve({target:_,blank:c,session:v,domains:y,attach:O}),!l.contentWindow)throw Error(`cloud.attachFrame: the iframe window is not available`);try{let e=await D((0,p.expose)({},{key:s.ATTACH_FRAME_KEY,origin:T(),transport:{receive:window,emit:l.contentWindow},unregisterSignal:x.signal,revivableModules:S(t.ft)}),he,`cloud.attachFrame: timed out connecting to the render proxy page`);await D(e.ready(),K,`cloud.attachFrame: the render proxy never became ready`),c&&await we(e,c),o!==void 0&&await L(e,o),(g||c)&&X(l),ye(l,()=>x.abort()),i.r(`attached frame`,x.signal);let n=l.contentWindow,r=V({control:e,target:c||g,blank:c!==``,session:v,declaredHosts:y,approvedOrigins:b,attach:O,assertLive:()=>{if(x.signal.aborted||!l.isConnected||l.contentWindow!==n)throw x.abort(),be()},guard:e=>e(),consent:m,onNavigated:()=>X(l),relay:B({from:()=>n,origin:T(),attach:O,signal:x.signal})});return o!==void 0&&g&&await r.goto(g),d?.length&&await r.requestPermissions(d),r}catch(e){throw x.abort(),l.referrerPolicy=C,l.allow=w,l.src=_||`about:blank`,e}},Z=(async e=>{let{kind:n,cookies:r,storageState:i}=t.o(e);if(r===`native`)throw TypeError(_e);return n===`window`?me(e,r,i):Te(e,r,i)}),Ee=()=>typeof window<`u`&&!0,Q=async()=>{let e=await r.o.then(e=>e.cloud.quota());return{premium:e.premium,overQuota:e.overQuota,throttled:e.overQuota&&!e.premium,usedBytes:e.usedBytes,limitBytes:e.limitBytes,remainingBytes:e.remaining,bytesPerSecond:e.bytesPerSecond,bitsPerSecond:e.bytesPerSecond*8}},De=e.t({attachFrame:()=>Z,available:()=>$,dgram:()=>d.t,dns:()=>c.t,fetch:()=>a.t,fs:()=>l.t,http:()=>f.t,net:()=>u.t,quota:()=>Q}),$=()=>r.l;Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return Y}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return Z}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return De}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return Q}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return $}});
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { r as AttachFrameFunction } from "./index-BQ5OZQhf.js";
|
|
2
|
-
import { t as cloudFetch } from "./proxy-
|
|
2
|
+
import { t as cloudFetch } from "./proxy-ClDBa5il.js";
|
|
3
3
|
import { t as dns_d_exports } from "./dns.js";
|
|
4
|
-
import { n as fs_d_exports } from "./fs-
|
|
5
|
-
import { s as net_d_exports } from "./net-
|
|
4
|
+
import { n as fs_d_exports } from "./fs-DCJAYoYy.js";
|
|
5
|
+
import { s as net_d_exports } from "./net-B8YQuB9E.js";
|
|
6
6
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
7
7
|
import { t as http_d_exports } from "./http.js";
|
|
8
8
|
//#region src/cloud/frame.d.ts
|
package/cloud.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./proxy-CL8j00ao.cjs"),t=require("./cloud-CI6WMBPa.cjs"),n=require("./dns.cjs"),r=require("./cloud/fs.cjs"),i=require("./net.cjs"),a=require("./dgram.cjs"),o=require("./http.cjs");exports.attachFrame=t.i,exports.available=t.t,Object.defineProperty(exports,"dgram",{enumerable:!0,get:function(){return a.t}}),Object.defineProperty(exports,"dns",{enumerable:!0,get:function(){return n.t}}),exports.fetch=e.t,Object.defineProperty(exports,"fs",{enumerable:!0,get:function(){return r.t}}),Object.defineProperty(exports,"http",{enumerable:!0,get:function(){return o.t}}),Object.defineProperty(exports,"net",{enumerable:!0,get:function(){return i.t}}),exports.quota=t.r;
|
package/cloud.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { t as cloudFetch } from "./proxy-
|
|
2
|
-
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-
|
|
1
|
+
import { t as cloudFetch } from "./proxy-ClDBa5il.js";
|
|
2
|
+
import { a as attachFrame, i as quota, r as QuotaStatus, t as available } from "./cloud-S8hQywqV.js";
|
|
3
3
|
import { t as dns_d_exports } from "./dns.js";
|
|
4
|
-
import { n as fs_d_exports } from "./fs-
|
|
5
|
-
import { s as net_d_exports } from "./net-
|
|
4
|
+
import { n as fs_d_exports } from "./fs-DCJAYoYy.js";
|
|
5
|
+
import { s as net_d_exports } from "./net-B8YQuB9E.js";
|
|
6
6
|
import { t as dgram_d_exports } from "./dgram.js";
|
|
7
7
|
import { t as http_d_exports } from "./http.js";
|
|
8
8
|
export { type QuotaStatus, attachFrame, available, dgram_d_exports as dgram, dns_d_exports as dns, cloudFetch as fetch, fs_d_exports as fs, http_d_exports as http, net_d_exports as net, quota };
|
package/cloud.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { t as e } from "./proxy-
|
|
2
|
-
import { i as t, r as n, t as r } from "./cloud-
|
|
1
|
+
import { t as e } from "./proxy-vAsYHMIa.js";
|
|
2
|
+
import { i as t, r as n, t as r } from "./cloud-8sJ1Sg8n.js";
|
|
3
3
|
import { t as i } from "./dns.js";
|
|
4
4
|
import { t as a } from "./cloud/fs.js";
|
|
5
5
|
import { t as o } from "./net.js";
|
|
@@ -634,10 +634,33 @@ type RoomOpenOptions = {
|
|
|
634
634
|
defaults?: Partial<RoomDefaults>;
|
|
635
635
|
/** the room key, 32 bytes base64url, minted when absent. Deriving one from something people already share is how a name becomes a rendezvous. */
|
|
636
636
|
key?: string;
|
|
637
|
+
/**
|
|
638
|
+
* Join without the account. The room is shown no account, and a member id made for this tab and this
|
|
639
|
+
* room alone, so neither the room nor any app in it can link the visit to the account, or to a visit
|
|
640
|
+
* after a leave or from a tab opened on its own: it looks like any signed-out visitor. The tab keeps the
|
|
641
|
+
* id until it leaves the room or closes, so a dropped connection, a reload or a replaced fkn.app document
|
|
642
|
+
* comes back as the same member, and so does a tab duplicated from it, which starts with a copy.
|
|
643
|
+
*
|
|
644
|
+
* A guest gets what a signed-out visitor gets, and nothing more. It needs the room's key, takes a seat
|
|
645
|
+
* under the member cap, and sends and receives as the room's defaults allow. A block holds it out by its
|
|
646
|
+
* member id and by its network, never by account. Its traffic is metered by its network address, never
|
|
647
|
+
* under the account or its premium. In a room it brings into being it is the owner while it is there,
|
|
648
|
+
* as anyone is. In a claimed room it never holds the owner's seat, even when the claim is its own
|
|
649
|
+
* account's, so `room.owner` is not `room.self.id` and the owner's changes are refused `denied`
|
|
650
|
+
* (`rooms: not the room owner`). `claim` is refused `denied` (`rooms: claiming needs an account`).
|
|
651
|
+
*
|
|
652
|
+
* `true` or `false`; anything else is refused `invalid`. An fkn.app older than this option refuses it
|
|
653
|
+
* `unavailable` (`rooms: guest joins are not available`, or `rooms: rooms are unavailable` when it took
|
|
654
|
+
* over from a newer fkn.app during the call) before anything is joined: it never falls back to a join
|
|
655
|
+
* with the account.
|
|
656
|
+
*/
|
|
657
|
+
guest?: boolean;
|
|
637
658
|
};
|
|
638
659
|
type RoomCreateOptions = RoomOpenOptions;
|
|
639
660
|
type RoomJoinOptions = {
|
|
640
661
|
signal?: AbortSignal;
|
|
662
|
+
/** as on `RoomOpenOptions` */
|
|
663
|
+
guest?: boolean;
|
|
641
664
|
};
|
|
642
665
|
/**
|
|
643
666
|
* How long a temporary claim may last, in milliseconds: `default` is what `temporary: true` means (7
|
|
@@ -1223,6 +1246,12 @@ type Resolvers = {
|
|
|
1223
1246
|
/** `open` under a random name */
|
|
1224
1247
|
create: (options?: RoomCreateOptions) => Promise<RoomsFail | RoomHandle>;
|
|
1225
1248
|
join: (invite: string, options?: RoomJoinOptions) => Promise<RoomsFail | RoomHandle>;
|
|
1249
|
+
/** the same three, joining with no account and a member id of this tab's own. Which resolver is called decides it: these ignore `guest` on the options, and the plain three never make a guest, whatever their options say */
|
|
1250
|
+
guest: {
|
|
1251
|
+
open: (name: string, options?: RoomOpenOptions) => Promise<RoomsFail | RoomHandle>;
|
|
1252
|
+
create: (options?: RoomCreateOptions) => Promise<RoomsFail | RoomHandle>;
|
|
1253
|
+
join: (invite: string, options?: RoomJoinOptions) => Promise<RoomsFail | RoomHandle>;
|
|
1254
|
+
};
|
|
1226
1255
|
};
|
|
1227
1256
|
/**
|
|
1228
1257
|
* Objects sealed here under a key the app holds and served to anyone holding the url. `put`, `list`
|
package/contract.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { d as CookieMatchWire, u as ClearCookiesWire } from "./index-BQ5OZQhf.js";
|
|
2
|
-
import { $ as RoomHandle, A as MiddleGotoOptions, At as SurfaceRect, B as ProxyFetch, Bt as WINDOW_JAR_MODE_TIMEOUT_MS, C as FrameMessageRelay, Ct as StorageProgress, D as IpFamily, Dt as StoredHandle, E as InstalledPackage, Et as StorageQuota, F as PackageResult, Ft as UdpDatagram, G as Radii, H as ProxyFetchInput, Ht as WriteData, I as PackagesErrorCode, It as UdpSocketOptions, J as RoomClaimOptions, K as Resolvers, L as PackagesFail, Lt as UdpSocketResult, M as OverlayRect, Mt as TcpSocketListenerResult, N as OverlayState, Nt as TcpSocketOptions, O as JAR_ANCHOR_MESSAGE, Ot as StoredObject, P as PackageQuery, Pt as TcpSocketResult, Q as RoomEvent, R as PickOptions, Rt as WINDOW_HANDSHAKE_TIMEOUT_MS, S as FrameFetchScope, St as StorageFail, T as InstallOptions, Tt as StoragePutWire, U as Quota, Ut as JarSeed, V as ProxyFetchInit, Vt as WindowMiddleControl, W as ROOM_TEMPORARY_MS, Wt as JarSeedCookie, X as RoomDefaults, Y as RoomCreateOptions, Z as RoomEnd, _ as DnsLookup, _t as ShellFrameMessage, a as AccountChange, at as RoomPermission, b as FrameConsentAnswer, bt as StorageEntry, c as AdoptRequest, ct as RoomsFail, d as ConflictRequest, dt as SHELL_FRAME_MESSAGE, et as RoomJoinOptions, f as ConflictSide, ft as SHELL_JAR_MESSAGE, g as DisplayLevel, gt as ShellControl, h as DisplayCause, ht as SetOverlayHost, i as Account, it as RoomOpenOptions, j as MountDescriptor, jt as TcpSocketListenerOptions, k as MiddleControl, kt as StoredPage, l as AdoptState, lt as SHELL_ATTACH_ERROR, m as ConnectOptions, mt as STORAGE_REFUSALS, n as ATTACH_WINDOW_KEY, nt as RoomMember, o as AccountPinOptions, ot as RoomPermissions, p as ConnectAvailability, pt as SHELL_JAR_UNREACHABLE, q as RoomBacklog, r as ATTACH_WINDOW_MESSAGE, rt as RoomMessage, s as AddressLookupResult, st as RoomsErrorCode, t as ATTACH_FRAME_KEY, tt as RoomMailbox, u as ConflictChoice, ut as SHELL_CONTROL_KEY, v as EncryptionState, vt as ShellGotoOptions, w as HiddenSurface, wt as StoragePutOptions, x as FrameConsentRequest, xt as StorageErrorCode, y as FRAME_MESSAGE, yt as ShellJarUnreachable, z as Placement, zt as WINDOW_HELLO_TIMEOUT_MS } from "./contract-
|
|
2
|
+
import { $ as RoomHandle, A as MiddleGotoOptions, At as SurfaceRect, B as ProxyFetch, Bt as WINDOW_JAR_MODE_TIMEOUT_MS, C as FrameMessageRelay, Ct as StorageProgress, D as IpFamily, Dt as StoredHandle, E as InstalledPackage, Et as StorageQuota, F as PackageResult, Ft as UdpDatagram, G as Radii, H as ProxyFetchInput, Ht as WriteData, I as PackagesErrorCode, It as UdpSocketOptions, J as RoomClaimOptions, K as Resolvers, L as PackagesFail, Lt as UdpSocketResult, M as OverlayRect, Mt as TcpSocketListenerResult, N as OverlayState, Nt as TcpSocketOptions, O as JAR_ANCHOR_MESSAGE, Ot as StoredObject, P as PackageQuery, Pt as TcpSocketResult, Q as RoomEvent, R as PickOptions, Rt as WINDOW_HANDSHAKE_TIMEOUT_MS, S as FrameFetchScope, St as StorageFail, T as InstallOptions, Tt as StoragePutWire, U as Quota, Ut as JarSeed, V as ProxyFetchInit, Vt as WindowMiddleControl, W as ROOM_TEMPORARY_MS, Wt as JarSeedCookie, X as RoomDefaults, Y as RoomCreateOptions, Z as RoomEnd, _ as DnsLookup, _t as ShellFrameMessage, a as AccountChange, at as RoomPermission, b as FrameConsentAnswer, bt as StorageEntry, c as AdoptRequest, ct as RoomsFail, d as ConflictRequest, dt as SHELL_FRAME_MESSAGE, et as RoomJoinOptions, f as ConflictSide, ft as SHELL_JAR_MESSAGE, g as DisplayLevel, gt as ShellControl, h as DisplayCause, ht as SetOverlayHost, i as Account, it as RoomOpenOptions, j as MountDescriptor, jt as TcpSocketListenerOptions, k as MiddleControl, kt as StoredPage, l as AdoptState, lt as SHELL_ATTACH_ERROR, m as ConnectOptions, mt as STORAGE_REFUSALS, n as ATTACH_WINDOW_KEY, nt as RoomMember, o as AccountPinOptions, ot as RoomPermissions, p as ConnectAvailability, pt as SHELL_JAR_UNREACHABLE, q as RoomBacklog, r as ATTACH_WINDOW_MESSAGE, rt as RoomMessage, s as AddressLookupResult, st as RoomsErrorCode, t as ATTACH_FRAME_KEY, tt as RoomMailbox, u as ConflictChoice, ut as SHELL_CONTROL_KEY, v as EncryptionState, vt as ShellGotoOptions, w as HiddenSurface, wt as StoragePutOptions, x as FrameConsentRequest, xt as StorageErrorCode, y as FRAME_MESSAGE, yt as ShellJarUnreachable, z as Placement, zt as WINDOW_HELLO_TIMEOUT_MS } from "./contract-CMQOic3K.js";
|
|
3
3
|
import { o as TcpSocketOption, x as UdpSocketOption } from "./wire-Fk5pJaoy.js";
|
|
4
4
|
export { ATTACH_FRAME_KEY, ATTACH_WINDOW_KEY, ATTACH_WINDOW_MESSAGE, Account, AccountChange, AccountPinOptions, AddressLookupResult, AdoptRequest, AdoptState, type ClearCookiesWire, ConflictChoice, ConflictRequest, ConflictSide, ConnectAvailability, ConnectOptions, type CookieMatchWire, DisplayCause, DisplayLevel, DnsLookup, EncryptionState, FRAME_MESSAGE, FrameConsentAnswer, FrameConsentRequest, FrameFetchScope, FrameMessageRelay, HiddenSurface, InstallOptions, InstalledPackage, IpFamily, JAR_ANCHOR_MESSAGE, type JarSeed, type JarSeedCookie, MiddleControl, MiddleGotoOptions, MountDescriptor, OverlayRect, OverlayState, PackageQuery, PackageResult, PackagesErrorCode, PackagesFail, PickOptions, Placement, ProxyFetch, ProxyFetchInit, ProxyFetchInput, Quota, ROOM_TEMPORARY_MS, Radii, Resolvers, RoomBacklog, RoomClaimOptions, RoomCreateOptions, RoomDefaults, RoomEnd, RoomEvent, RoomHandle, RoomJoinOptions, RoomMailbox, RoomMember, RoomMessage, RoomOpenOptions, RoomPermission, RoomPermissions, RoomsErrorCode, RoomsFail, SHELL_ATTACH_ERROR, SHELL_CONTROL_KEY, SHELL_FRAME_MESSAGE, SHELL_JAR_MESSAGE, SHELL_JAR_UNREACHABLE, STORAGE_REFUSALS, SetOverlayHost, ShellControl, ShellFrameMessage, ShellGotoOptions, ShellJarUnreachable, StorageEntry, StorageErrorCode, StorageFail, StorageProgress, StoragePutOptions, StoragePutWire, StorageQuota, StoredHandle, StoredObject, StoredPage, SurfaceRect, TcpSocketListenerOptions, TcpSocketListenerResult, type TcpSocketOption, TcpSocketOptions, TcpSocketResult, UdpDatagram, type UdpSocketOption, UdpSocketOptions, UdpSocketResult, WINDOW_HANDSHAKE_TIMEOUT_MS, WINDOW_HELLO_TIMEOUT_MS, WINDOW_JAR_MODE_TIMEOUT_MS, WindowMiddleControl, WriteData };
|
package/dgram.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-6wTec7WK.cjs"),n=require("./busy-BXbVH595.cjs"),r=require("./utils-BpHmMkIR.cjs"),i=require("./wire.cjs");let a=require("buffer"),o=require("events"),s=require("ip-address");var c=e.t({Socket:()=>l,createSocket:()=>h,default:()=>g}),l=class extends o.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_busyRelease;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type,e.connection&&this.__webvpn_udp_socket_init__(e.connection)}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){if(!this._webVPNUdpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before bind`));return}this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:i.UDP_PORT_ACK_TYPE,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,r,i=0;for(;i+4<=e.byteLength;){let o=t.getUint32(i);i+=4;let s=i+o;if(s>e.byteLength)break;let c=i+4,l=t.getUint8(c);c+=1;let u,d,f;if(l===2){if(!this._remoteAddress){i=s;continue}u=this._remoteAddress.address,d=this._remoteAddress.family,f=this._remoteAddress.port}else{let n=new Uint8Array(e,c,l===0?4:16);l===0?(d=`IPv4`,u=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(d=`IPv6`,u=p(n)),c+=n.byteLength,f=t.getUint16(c),c+=2}let m=t.getUint32(c);c+=4;try{this.emit(`message`,a.Buffer.from(e.slice(c,c+m)),{address:u,family:d,port:f,size:m})}catch(e){n||(n=!0,r=e)}i=s}if(n)throw r}_peerTail(e,t){if(e===void 0||t===void 0)return u;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=s.Address4.isValid(e)?f(e):m(e),a=new Uint8Array(1+i.byteLength+2);return a[0]=i.byteLength===4?0:1,a.set(i,1),new DataView(a.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,a),a}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(s.Address4.isValid(e)){let n=f(e),r=t&&s.Address4.isValid(t)?f(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(s.Address6.isValid(e)){let t=m(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let n=r.i(...e),i=this._type===`udp6`?`::`:`0.0.0.0`,a=this.__webvpn_udp_socket_init__(t.s(`a udp socket`).then(e=>e.cloud.webvpn.udpSocket({type:this._type,address:n.address??i,port:n.port,dataPort:!0})));return n.callback&&a.then(e=>{e&&n.callback.call(this)}),this}__webvpn_udp_socket_init__(e,t){return t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort}),this._busyRelease??=n.t(`udp socket`),this._webVPNUdpSocketPromise=e.then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,a.Buffer.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`listening`)}),this._webVPNUdpSocketPromise}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(s.Address4.isValid(e)){let n=f(e),r=t&&s.Address4.isValid(t)?f(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(s.Address6.isValid(e)){let t=m(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=r.a(...e),n=d(t.message),i=n;if(t.hasRange){let{offset:e,length:r}=t;if(!Number.isInteger(e)||e<0||e>n.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(r)||r<0||r>n.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});i=n.subarray(e,e+r)}let a=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,r=t.address??a,o=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(o||s.Address4.isValid(r)||s.Address6.isValid(r))){this._portSend(i,o?void 0:r,o?void 0:t.port),n?.call(this,null,i.byteLength);return}e.send({port:t.port,address:r,message:i.byteOffset===0&&i.byteLength===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}).then(()=>n?.call(this,null,i.byteLength),e=>n?n.call(this,e,0):this.emit(`error`,e))})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},u=new Uint8Array([2]),d=e=>{if(typeof e==`string`)return r.s.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(d),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},f=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},p=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},m=e=>{let t=new s.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},h=(e,t)=>{let n=new l(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},g={Socket:l,createSocket:h};exports.Socket=l,exports.createSocket=h,exports.default=g,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-Csb5b8dE.cjs"),n=require("./busy-BXbVH595.cjs"),r=require("./utils-BpHmMkIR.cjs"),i=require("./wire.cjs");let a=require("buffer"),o=require("events"),s=require("ip-address");var c=e.t({Socket:()=>l,createSocket:()=>h,default:()=>g}),l=class extends o.EventEmitter{_type;_localAddress;_remoteAddress;_connectedLocally;_connectGeneration=0;_destroyed=!1;_busyRelease;_webVPNUdpSocketPromise;_dataPort;_socketId;_sendQueue=[];_sendQueueBytes=0;_sendFlushScheduled=!1;_peerTailCache=new Map;constructor(e){if(super(e),!e)throw Error(`Missing options`);this._type=e.type,e.connection&&this.__webvpn_udp_socket_init__(e.connection)}_lastRecvBufferSize=0;_lastSendBufferSize=0;_lastTtl=64;_lastMulticastTtl=1;_lastMulticastLoopback=!0;_setUdpOption(e){if(!this._webVPNUdpSocketPromise){this.emit(`error`,Error(`Cannot set socket option before bind`));return}this._webVPNUdpSocketPromise.then(async t=>{if(t)try{await t.setOption(e)}catch(e){this.emit(`error`,e)}})}_dataPortAcks=!1;_dataPortConsumedBytes=0;_dataPortAckedBytes=0;_ackDataPortBatch(e){if(!this._dataPortAcks||!this._dataPort||(this._dataPortConsumedBytes+=e,this._dataPortAckedBytes!==0&&this._dataPortConsumedBytes-this._dataPortAckedBytes<524288))return;this._dataPortAckedBytes=this._dataPortConsumedBytes;let t={type:i.UDP_PORT_ACK_TYPE,consumedBytes:this._dataPortConsumedBytes};this._dataPort.postMessage(t)}_onTransportClosed(e){this._destroyed||(this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0,this.listenerCount(`error`)>0&&this.emit(`error`,Error(e||`WebVPN session closed`)),this.emit(`close`))}_onDataPortBatch(e){let t=new DataView(e),n=!1,r,i=0;for(;i+4<=e.byteLength;){let o=t.getUint32(i);i+=4;let s=i+o;if(s>e.byteLength)break;let c=i+4,l=t.getUint8(c);c+=1;let u,d,f;if(l===2){if(!this._remoteAddress){i=s;continue}u=this._remoteAddress.address,d=this._remoteAddress.family,f=this._remoteAddress.port}else{let n=new Uint8Array(e,c,l===0?4:16);l===0?(d=`IPv4`,u=`${n[0]}.${n[1]}.${n[2]}.${n[3]}`):(d=`IPv6`,u=p(n)),c+=n.byteLength,f=t.getUint16(c),c+=2}let m=t.getUint32(c);c+=4;try{this.emit(`message`,a.Buffer.from(e.slice(c,c+m)),{address:u,family:d,port:f,size:m})}catch(e){n||(n=!0,r=e)}i=s}if(n)throw r}_peerTail(e,t){if(e===void 0||t===void 0)return u;let n=`${e}|${t}`,r=this._peerTailCache.get(n);if(r)return r;let i=s.Address4.isValid(e)?f(e):m(e),a=new Uint8Array(1+i.byteLength+2);return a[0]=i.byteLength===4?0:1,a.set(i,1),new DataView(a.buffer).setUint16(1+i.byteLength,t),this._peerTailCache.size>=4096&&this._peerTailCache.clear(),this._peerTailCache.set(n,a),a}_portSend(e,t,n){let r=this._peerTail(t,n),i=new Uint8Array(8+r.byteLength+4+e.byteLength),a=new DataView(i.buffer);a.setUint32(0,i.byteLength-4),a.setUint32(4,this._socketId),i.set(r,8),a.setUint32(8+r.byteLength,e.byteLength),i.set(e,12+r.byteLength),this._sendQueue.push(i),this._sendQueueBytes+=i.byteLength,!this._sendFlushScheduled&&(this._sendFlushScheduled=!0,queueMicrotask(()=>{this._sendFlushScheduled=!1;let e=this._sendQueue,t=this._sendQueueBytes;if(this._sendQueue=[],this._sendQueueBytes=0,!e.length||!this._dataPort)return;let n=new Uint8Array(t),r=0;for(let t of e)n.set(t,r),r+=t.byteLength;this._dataPort.postMessage(n.buffer,[n.buffer])}))}addMembership(e,t){if(s.Address4.isValid(e)){let n=f(e),r=t&&s.Address4.isValid(t)?f(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:5,group:n,interface:r})}else if(s.Address6.isValid(e)){let t=m(e);this._setUdpOption({type:7,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}address(){if(!this._localAddress)throw Error(`EBADF`);return this._localAddress}bind(...e){let n=r.i(...e),i=this._type===`udp6`?`::`:`0.0.0.0`,a=this.__webvpn_udp_socket_init__(t.s(`a udp socket`).then(e=>e.cloud.webvpn.udpSocket({type:this._type,address:n.address??i,port:n.port,dataPort:!0})));return n.callback&&a.then(e=>{e&&n.callback.call(this)}),this}__webvpn_udp_socket_init__(e,t){return t&&(this._localAddress={address:t.localAddress,family:t.localFamily,port:t.localPort}),this._busyRelease??=n.t(`udp socket`),this._webVPNUdpSocketPromise=e.then(e=>{if(e.dataPort)this._socketId=e.socketId,this._dataPort=e.dataPort,this._dataPortAcks=e.dataPortAcks===!0,this._dataPort.onmessage=e=>{try{this._onDataPortBatch(e.data)}finally{this._ackDataPortBatch(e.data.byteLength)}};else{let t=e.dataReadableStream.getReader();(async()=>{for(;;){let{value:e,done:n}=await t.read();if(n)return;this.emit(`message`,a.Buffer.from(e.data),{address:e.address,family:e.family,port:e.port,size:e.size})}})().catch(e=>this._onTransportClosed(e instanceof Error?e.message:void 0))}return e.closed?.then(e=>this._onTransportClosed(e?.reason)).catch(()=>{}),this._localAddress={address:e.localAddress,family:e.localFamily,port:e.localPort},e}).catch(e=>{this.emit(`error`,e)}),this._webVPNUdpSocketPromise.then(e=>{if(!e){this._busyRelease?.();return}this.emit(`listening`)}),this._webVPNUdpSocketPromise}close(e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);return this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=this._destroyed;this._destroyed=!0,this._busyRelease?.(),this._dataPort?.close(),this._dataPort=void 0;try{await t.close()}finally{try{e&&e()}finally{n||this.emit(`close`)}}}).catch(()=>{}),this}connect(...e){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(async t=>{if(!t)throw Error(`Socket not bound`);let n=e[0],r=this._type===`udp6`?`::1`:`127.0.0.1`,i=typeof e[1]==`string`?e[1]:r,a=typeof e.at(-1)==`function`?e.at(-1):void 0,o=await t.connect({remotePort:n,remoteAddress:i});this._connectedLocally=o?.local===!0,this._remoteAddress=o?.address?{address:o.address,family:o.family,port:o.port}:{address:i,family:this._type===`udp6`?`IPv6`:`IPv4`,port:n},this._connectGeneration+=1,a&&a()}).catch(e=>{this.emit(`error`,e)})}disconnect(){if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);let e=this._remoteAddress,t=this._connectedLocally,n=this._connectGeneration;this._remoteAddress=void 0,this._connectedLocally=void 0,this._webVPNUdpSocketPromise.then(e=>e?.disconnect?.()).catch(r=>{this._connectGeneration===n&&(this._remoteAddress=e,this._connectedLocally=t),this.emit(`error`,r)})}dropMembership(e,t){if(s.Address4.isValid(e)){let n=f(e),r=t&&s.Address4.isValid(t)?f(t):new Uint8Array([0,0,0,0]);this._setUdpOption({type:6,group:n,interface:r})}else if(s.Address6.isValid(e)){let t=m(e);this._setUdpOption({type:8,group:t,ifIndex:0})}else this.emit(`error`,Error(`Invalid multicast address: ${e}`))}getRecvBufferSize(){return this._lastRecvBufferSize}getSendBufferSize(){return this._lastSendBufferSize}getSendQueueSize(){return 0}getSendQueueCount(){return 0}ref(){return this}remoteAddress(){if(!this._remoteAddress)throw Error(`ERR_SOCKET_DGRAM_NOT_CONNECTED`);return{address:this._remoteAddress.address,family:this._remoteAddress.family,port:this._remoteAddress.port}}send(...e){this._webVPNUdpSocketPromise||this.bind();let t=r.a(...e),n=d(t.message),i=n;if(t.hasRange){let{offset:e,length:r}=t;if(!Number.isInteger(e)||e<0||e>n.byteLength)throw Object.assign(RangeError(`"offset" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});if(!Number.isInteger(r)||r<0||r>n.byteLength-e)throw Object.assign(RangeError(`"length" is outside of buffer bounds`),{code:`ERR_BUFFER_OUT_OF_BOUNDS`});i=n.subarray(e,e+r)}let a=this._type===`udp6`?`::1`:`127.0.0.1`;if(!this._webVPNUdpSocketPromise)throw Error(`Socket not bound`);this._webVPNUdpSocketPromise.then(e=>{if(!e)throw Error(`Socket not bound`);let n=t.callback,r=t.address??a,o=this._remoteAddress!==void 0&&t.address===void 0;if(this._dataPort&&(o||s.Address4.isValid(r)||s.Address6.isValid(r))){this._portSend(i,o?void 0:r,o?void 0:t.port),n?.call(this,null,i.byteLength);return}e.send({port:t.port,address:r,message:i.byteOffset===0&&i.byteLength===i.buffer.byteLength?i.buffer:i.buffer.slice(i.byteOffset,i.byteOffset+i.byteLength)}).then(()=>n?.call(this,null,i.byteLength),e=>n?n.call(this,e,0):this.emit(`error`,e))})}setBroadcast(e){this._setUdpOption({type:0,value:e})}setMulticastInterface(e){}setMulticastLoopback(e){return this._setUdpOption({type:3,value:e}),this._setUdpOption({type:4,value:e}),this._lastMulticastLoopback=e,e}setMulticastTTL(e){return this._setUdpOption({type:2,value:e}),this._lastMulticastTtl=e,e}setRecvBufferSize(e){this._setUdpOption({type:10,value:e}),this._lastRecvBufferSize=e}setSendBufferSize(e){this._setUdpOption({type:9,value:e}),this._lastSendBufferSize=e}setTTL(e){return this._setUdpOption({type:1,value:e}),this._lastTtl=e,e}unref(){return this}addSourceSpecificMembership(e,t,n){}dropSourceSpecificMembership(e,t,n){}async[Symbol.asyncDispose](){await new Promise(e=>{this.close(e)})}},u=new Uint8Array([2]),d=e=>{if(typeof e==`string`)return r.s.encode(e);if(e instanceof Uint8Array)return e;if(ArrayBuffer.isView(e))return new Uint8Array(e.buffer,e.byteOffset,e.byteLength);if(Array.isArray(e)){let t=e.map(d),n=new Uint8Array(t.reduce((e,t)=>e+t.byteLength,0)),r=0;for(let e of t)n.set(e,r),r+=e.byteLength;return n}return new Uint8Array(e)},f=e=>{let t=e.split(`.`).map(e=>parseInt(e,10));if(t.length!==4||t.some(e=>Number.isNaN(e)||e<0||e>255))throw Error(`Invalid IPv4 address: ${e}`);return new Uint8Array(t)},p=e=>{let t=[];for(let n=0;n<16;n+=2)t.push(e[n]<<8|e[n+1]);let n=-1,r=1;for(let e=0;e<8;){if(t[e]!==0){e++;continue}let i=e;for(;i<8&&t[i]===0;)i++;i-e>r&&(n=e,r=i-e),e=i}return n===-1?t.map(e=>e.toString(16)).join(`:`):`${t.slice(0,n).map(e=>e.toString(16)).join(`:`)}::${t.slice(n+r).map(e=>e.toString(16)).join(`:`)}`},m=e=>{let t=new s.Address6(e).getBitsBase16(0,128).match(/.{2}/g);if(!t||t.length!==16)throw Error(`Invalid IPv6 address: ${e}`);return new Uint8Array(t.map(e=>parseInt(e,16)))},h=(e,t)=>{let n=new l(typeof e==`string`?{type:e}:e);return t&&n.on(`message`,t),n},g={Socket:l,createSocket:h};exports.Socket=l,exports.createSocket=h,exports.default=g,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return c}});
|
package/dgram.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { K as Resolvers, Lt as UdpSocketResult } from "./contract-
|
|
1
|
+
import { K as Resolvers, Lt as UdpSocketResult } from "./contract-CMQOic3K.js";
|
|
2
2
|
import { x as UdpSocketOption } from "./wire-Fk5pJaoy.js";
|
|
3
|
-
import "./api-
|
|
3
|
+
import "./api-C-VvG5P-.js";
|
|
4
4
|
import { Buffer } from "buffer";
|
|
5
5
|
import { AddressInfo } from "net";
|
|
6
6
|
import { EventEmitter } from "events";
|
package/dgram.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { s as t } from "./api-
|
|
2
|
+
import { s as t } from "./api-BYtMzj8u.js";
|
|
3
3
|
import { t as n } from "./busy-DsMWrSzc.js";
|
|
4
4
|
import { a as r, i, s as a } from "./utils-Cyq8uJiy.js";
|
|
5
5
|
import { UDP_PORT_ACK_TYPE as o } from "./wire.js";
|
package/dns.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./api-Csb5b8dE.cjs");var n=e.t({lookup:()=>r}),r=(e,n)=>t.o.then(t=>t.cloud.dns.lookup(e,n));exports.lookup=r,Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return n}});
|
package/dns.d.ts
CHANGED
package/dns.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { o as t } from "./api-
|
|
2
|
+
import { o as t } from "./api-BYtMzj8u.js";
|
|
3
3
|
//#region src/dns.ts
|
|
4
4
|
var n = /* @__PURE__ */ e({ lookup: () => r }), r = (e, n) => t.then((t) => t.cloud.dns.lookup(e, n));
|
|
5
5
|
//#endregion
|
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-
|
|
1
|
+
const e=require("./rolldown-runtime-BIInC43l.cjs"),t=require("./lib-BiQ6cOZ7.cjs"),n=require("./api-Csb5b8dE.cjs"),r=require("./proxy-CL8j00ao.cjs"),i=require("./desktop.cjs");var a=`BackgroundStoppedError`,o=e=>t.d(e)&&e.name===`BackgroundStoppedError`,s=async e=>{if(t.Z(`promptInstall`,e),typeof window>`u`)return!1;if(t.rt())return!0;let r=await n.o,i=null,a=new Promise(e=>{i=()=>{t.rt()&&e(!0)},t.nt.addEventListener(`statuschange`,i)}),o=r.installPrompt.show(e).then(()=>!1),s=await Promise.race([a,o]);return i&&t.nt.removeEventListener(`statuschange`,i),await r.installPrompt.hide().catch(()=>{}),s},c=null;t.at(()=>(c||=s().then(()=>void 0).finally(()=>{c=null}),c));var l=()=>typeof document<`u`&&t.rt(),u=async(e,a)=>{if(n.p(e),t.Z(`fetch`,a?.reason),a?.credentials===`include`){if(typeof document>`u`)throw Error(`fetch with credentials needs the FKN extension, which only exists in window realms`);return t.W(e,a)}return l()?t.W(e,{...a,credentials:`omit`}):i.available()?i.fetch(e,a):r.t(e,a)},d=e.t({ATTACH_FRAME_EVENT_KEY:()=>t.i,BACKGROUND_STOPPED:()=>a,CATEGORIES:()=>t.w,EXTENSION_ABI:()=>5,ExtensionOperationUnsupportedError:()=>t.ct,ExtensionOutdatedError:()=>t.lt,FORGEABLE_HEADERS:()=>t.Q,FrameWindowBlockedError:()=>t.g,FrameWindowRefusedError:()=>t._,LOCATOR_DENIED:()=>t.A,LOCATOR_ERROR:()=>t.F,LOCATOR_INVALID:()=>t.L,LOCATOR_UNSUPPORTED:()=>t.D,MAX_REASON_LENGTH:()=>100,PERMISSION_DENIED:()=>t.t,REQUIRED_EXTENSION_ABI:()=>0,TimeoutError:()=>t.E,assertAttachableFrameUrl:()=>t.x,assertFetchableUrl:()=>t.U,assertForgeableHeaders:()=>t.$,assertLockdownApplicable:()=>t.S,assertOneCookieIdentity:()=>t.et,attachFrame:()=>t.a,attachFramePermission:()=>t.v,available:()=>l,box:()=>t.pt,cookies:()=>t.V,createFrame:()=>t.y,createVideoElementHandle:()=>t.mt,events:()=>t.nt,extension:()=>t.nt,fetch:()=>t.W,fetchCredentialedPermission:()=>t.G,fetchLocalPermission:()=>t.K,fetchPermission:()=>t.q,gotoPermission:()=>t.b,handleRevivableModules:()=>t.ft,hasForgedCookie:()=>t.tt,isBackgroundStopped:()=>o,isBlockedFetchUrl:()=>t.J,isBlockedFrameUrl:()=>t.C,isExtensionExposed:()=>t.rt,isLocalNetworkUrl:()=>t.Y,isLocatorDenied:()=>t.I,isLocatorInvalid:()=>t.M,isLocatorUnsupported:()=>t.O,isPermissionDenied:()=>t.n,isTerminalError:()=>t.P,isType:()=>t.ht,modifyRequestHeadersPermission:()=>t.R,permissions:()=>t.r,promptInstall:()=>s,readCookiePermission:()=>t.H,readExtensionHandshake:()=>t.it,removeRequestHeaderRule:()=>t.z,revive:()=>t.gt,setMissingExtensionHandler:()=>t.at,setRequestHeaderRule:()=>t.B,supportsOperation:()=>t.dt,type:()=>t._t,waitForExtensionExposure:()=>t.ot});Object.defineProperty(exports,"a",{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,"i",{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,"n",{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,"o",{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,"r",{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,"t",{enumerable:!0,get:function(){return d}});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { t as e } from "./rolldown-runtime-Dy4uBu1J.js";
|
|
2
|
-
import { $ as t, A as n, B as r, C as i, D as a, E as o, F as s, G as c, H as l, I as u, J as ee, K as te, L as ne, M as re, O as ie, P as ae, Q as d, R as f, S as p, U as m, V as h, W as g, Y as _, Z as v, _ as y, _t as b, a as x, at as S, b as C, ct as w, d as T, dt as E, et as D, ft as O, g as k, gt as A, ht as j, i as M, it as N, lt as P, mt as oe, n as F, nt as I, ot as L, pt as R, q as z, r as B, rt as V, t as H, tt as U, v as W, w as G, x as K, y as q, z as se } from "./lib-
|
|
3
|
-
import { o as ce, p as le } from "./api-
|
|
4
|
-
import { t as ue } from "./proxy-
|
|
2
|
+
import { $ as t, A as n, B as r, C as i, D as a, E as o, F as s, G as c, H as l, I as u, J as ee, K as te, L as ne, M as re, O as ie, P as ae, Q as d, R as f, S as p, U as m, V as h, W as g, Y as _, Z as v, _ as y, _t as b, a as x, at as S, b as C, ct as w, d as T, dt as E, et as D, ft as O, g as k, gt as A, ht as j, i as M, it as N, lt as P, mt as oe, n as F, nt as I, ot as L, pt as R, q as z, r as B, rt as V, t as H, tt as U, v as W, w as G, x as K, y as q, z as se } from "./lib-BGAmzIcU.js";
|
|
3
|
+
import { o as ce, p as le } from "./api-BYtMzj8u.js";
|
|
4
|
+
import { t as ue } from "./proxy-vAsYHMIa.js";
|
|
5
5
|
import { available as de, fetch as J } from "./desktop.js";
|
|
6
6
|
//#region ../web-extension/lib/utils/background-stopped.js
|
|
7
7
|
var Y = "BackgroundStoppedError", X = (e) => T(e) && e.name === "BackgroundStoppedError", Z = async (e) => {
|
package/extension.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-
|
|
1
|
+
Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});const e=require("./lib-BiQ6cOZ7.cjs"),t=require("./extension-BXI3MVXw.cjs");exports.ATTACH_FRAME_EVENT_KEY=e.i,exports.BACKGROUND_STOPPED=t.a,exports.CATEGORIES=e.w,exports.EXTENSION_ABI=e.st,exports.ExtensionOperationUnsupportedError=e.ct,exports.ExtensionOutdatedError=e.lt,exports.FORGEABLE_HEADERS=e.Q,exports.FrameWindowBlockedError=e.g,exports.FrameWindowRefusedError=e._,exports.LOCATOR_DENIED=e.A,exports.LOCATOR_ERROR=e.F,exports.LOCATOR_INVALID=e.L,exports.LOCATOR_UNSUPPORTED=e.D,exports.MAX_REASON_LENGTH=e.X,exports.PERMISSION_DENIED=e.t,exports.REQUIRED_EXTENSION_ABI=e.ut,exports.TimeoutError=e.E,exports.assertAttachableFrameUrl=e.x,exports.assertFetchableUrl=e.U,exports.assertForgeableHeaders=e.$,exports.assertLockdownApplicable=e.S,exports.assertOneCookieIdentity=e.et,exports.attachFrame=e.a,exports.attachFramePermission=e.v,exports.available=t.r,exports.box=e.pt,exports.cookies=e.V,exports.createFrame=e.y,exports.createVideoElementHandle=e.mt,exports.events=e.nt,exports.extension=e.nt,exports.fetch=e.W,exports.fetchCredentialedPermission=e.G,exports.fetchLocalPermission=e.K,exports.fetchPermission=e.q,exports.gotoPermission=e.b,exports.handleRevivableModules=e.ft,exports.hasForgedCookie=e.tt,exports.isBackgroundStopped=t.o,exports.isBlockedFetchUrl=e.J,exports.isBlockedFrameUrl=e.C,exports.isExtensionExposed=e.rt,exports.isLocalNetworkUrl=e.Y,exports.isLocatorDenied=e.I,exports.isLocatorInvalid=e.M,exports.isLocatorUnsupported=e.O,exports.isPermissionDenied=e.n,exports.isTerminalError=e.P,exports.isType=e.ht,exports.modifyRequestHeadersPermission=e.R,exports.permissions=e.r,exports.promptInstall=t.i,exports.readCookiePermission=e.H,exports.readExtensionHandshake=e.it,exports.removeRequestHeaderRule=e.z,exports.revive=e.gt,exports.setMissingExtensionHandler=e.at,exports.setRequestHeaderRule=e.B,exports.supportsOperation=e.dt,exports.type=e._t,exports.waitForExtensionExposure=e.ot;
|
package/extension.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, O as m, P as h, Q as g, R as _, S as v, U as y, V as b, W as x, X as S, Y as C, _ as w, _t as T, a as E, at as D, b as O, ct as k, dt as ee, et as A, ft as j, g as M, gt as N, ht as P, i as F, it as I, lt as L, mt as R, n as z, nt as B, ot as V, pt as H, q as U, r as W, rt as G, st as K, t as q, tt as J, ut as Y, v as X, w as Z, x as Q, y as $, z as te } from "./lib-
|
|
2
|
-
import { a as ne, i as re, o as ie, r as ae } from "./extension-
|
|
1
|
+
import { $ as e, A as t, B as n, C as r, D as i, E as a, F as o, G as s, H as c, I as l, J as u, K as d, L as f, M as p, O as m, P as h, Q as g, R as _, S as v, U as y, V as b, W as x, X as S, Y as C, _ as w, _t as T, a as E, at as D, b as O, ct as k, dt as ee, et as A, ft as j, g as M, gt as N, ht as P, i as F, it as I, lt as L, mt as R, n as z, nt as B, ot as V, pt as H, q as U, r as W, rt as G, st as K, t as q, tt as J, ut as Y, v as X, w as Z, x as Q, y as $, z as te } from "./lib-BGAmzIcU.js";
|
|
2
|
+
import { a as ne, i as re, o as ie, r as ae } from "./extension-BmqjgSIQ.js";
|
|
3
3
|
export { F as ATTACH_FRAME_EVENT_KEY, ne as BACKGROUND_STOPPED, Z as CATEGORIES, K as EXTENSION_ABI, k as ExtensionOperationUnsupportedError, L as ExtensionOutdatedError, g as FORGEABLE_HEADERS, M as FrameWindowBlockedError, w as FrameWindowRefusedError, t as LOCATOR_DENIED, o as LOCATOR_ERROR, f as LOCATOR_INVALID, i as LOCATOR_UNSUPPORTED, S as MAX_REASON_LENGTH, q as PERMISSION_DENIED, Y as REQUIRED_EXTENSION_ABI, a as TimeoutError, Q as assertAttachableFrameUrl, y as assertFetchableUrl, e as assertForgeableHeaders, v as assertLockdownApplicable, A as assertOneCookieIdentity, E as attachFrame, X as attachFramePermission, ae as available, H as box, b as cookies, $ as createFrame, R as createVideoElementHandle, B as events, B as extension, x as fetch, s as fetchCredentialedPermission, d as fetchLocalPermission, U as fetchPermission, O as gotoPermission, j as handleRevivableModules, J as hasForgedCookie, ie as isBackgroundStopped, u as isBlockedFetchUrl, r as isBlockedFrameUrl, G as isExtensionExposed, C as isLocalNetworkUrl, l as isLocatorDenied, p as isLocatorInvalid, m as isLocatorUnsupported, z as isPermissionDenied, h as isTerminalError, P as isType, _ as modifyRequestHeadersPermission, W as permissions, re as promptInstall, c as readCookiePermission, I as readExtensionHandshake, te as removeRequestHeaderRule, N as revive, D as setMissingExtensionHandler, n as setRequestHeaderRule, ee as supportsOperation, T as type, V as waitForExtensionExposure };
|
package/fs/promises.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-
|
|
1
|
+
Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});const e=require("../fs-CPU00CI3.cjs");var{readFile:t,writeFile:n,appendFile:r,unlink:i,rename:a,readdir:o,mkdir:s,rm:c,rmdir:l,stat:u,lstat:d,access:f}=e.v,p=e.v;exports.access=f,exports.appendFile=r,exports.default=p,exports.lstat=d,exports.mkdir=s,exports.readFile=t,exports.readdir=o,exports.rename=a,exports.rm=c,exports.rmdir=l,exports.stat=u,exports.unlink=i,exports.writeFile=n;
|
package/fs/promises.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as WriteData, i as Stats, n as MakeOptions, o as WriteOptions, r as ReadOptions } from "../index-BQgZVQl7.js";
|
|
2
|
-
import { v as promises } from "../index-
|
|
2
|
+
import { v as promises } from "../index-57lTXnoe.js";
|
|
3
3
|
//#region src/fs/promises.d.ts
|
|
4
4
|
export declare const readFile: (path: import("node:fs").PathLike, options?: ReadOptions) => Promise<Buffer | string>, writeFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, appendFile: (path: import("node:fs").PathLike, data: WriteData, options?: WriteOptions) => Promise<void>, unlink: (path: import("node:fs").PathLike) => Promise<void>, rename: (from: import("node:fs").PathLike, to: import("node:fs").PathLike) => Promise<void>, readdir: (path: import("node:fs").PathLike) => Promise<string[]>, mkdir: (path: import("node:fs").PathLike, options?: MakeOptions) => Promise<void>, rm: (path: import("node:fs").PathLike, options?: {
|
|
5
5
|
recursive?: boolean;
|
package/fs/promises.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { v as e } from "../fs-
|
|
1
|
+
import { v as e } from "../fs-ohcMNiu2.js";
|
|
2
2
|
//#region src/fs/promises.ts
|
|
3
3
|
var { readFile: t, writeFile: n, appendFile: r, unlink: i, rename: a, readdir: o, mkdir: s, rm: c, rmdir: l, stat: u, lstat: d, access: f } = e, p = e;
|
|
4
4
|
//#endregion
|