@urun-sh/core 0.6.19 → 0.6.21
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/dist/adapter/index.js +7 -7
- package/dist/adapter/index.mjs +1 -1
- package/dist/{app-FXXH6CQL.mjs → app-NML75AAK.mjs} +1 -1
- package/dist/{backoff-CQBrx4Ds.d.mts → backoff-B5QxmZqJ.d.mts} +7 -1
- package/dist/{backoff-CQBrx4Ds.d.ts → backoff-B5QxmZqJ.d.ts} +7 -1
- package/dist/{backoff-CfpAVDrd.d.ts → backoff-yR9l2-dr.d.mts} +7 -1
- package/dist/{backoff-CfpAVDrd.d.mts → backoff-yR9l2-dr.d.ts} +7 -1
- package/dist/chunk-LPCBAG4Z.mjs +30 -0
- package/dist/{chunk-K2P3YZVC.mjs → chunk-LYFGDF44.mjs} +3 -3
- package/dist/{chunk-DHPH24MA.mjs → chunk-Z36GINSW.mjs} +2 -2
- package/dist/index.browser.d.mts +4 -2
- package/dist/index.browser.d.ts +4 -2
- package/dist/index.browser.js +3 -3
- package/dist/index.browser.mjs +3 -3
- package/dist/index.d.mts +4 -2
- package/dist/index.d.ts +4 -2
- package/dist/index.js +6 -6
- package/dist/index.mjs +1 -1
- package/dist/internal.browser.d.mts +1 -1
- package/dist/internal.browser.d.ts +1 -1
- package/dist/internal.browser.js +2 -2
- package/dist/internal.browser.mjs +1 -1
- package/dist/internal.d.mts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +5 -5
- package/dist/internal.mjs +1 -1
- package/package.json +1 -1
- package/dist/chunk-VXPW2IFW.mjs +0 -30
package/dist/index.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { createRequire as __urunCreateRequire } from 'node:module'; const require = globalThis.require ?? __urunCreateRequire(import.meta.url);
|
|
2
|
-
import{$ as Tt,A as Ze,B as Qe,C as et,D as tt,E as rt,F as nt,G as it,H as ot,I as st,J as at,K as ct,L as dt,M as ut,N as lt,O as pt,P as mt,Q as gt,R as ft,S as ht,T as St,U as yt,V as bt,W as Et,X as vt,Y as wt,Z as kt,_ as _t,a as pe,aa as Rt,b as me,ba as xt,c as ge,ca as Ct,d as fe,da as At,e as he,ea as Pt,f as Se,fa as It,g as ye,h as be,i as xe,j as Ce,k as Ae,l as Pe,m as Ie,n as Me,o as Oe,p as De,q as Le,r as Ue,s as Ne,t as Fe,u as Be,v as We,w as Ge,x as je,y as Xe,z as Je}from"./chunk-VXPW2IFW.mjs";import{$ as ze,C as Ee,D as ve,E as we,F as ke,G as _e,H as O,J as Te,S as Re,V as $e,W as qe,X as Ve,a as M,aa as Ke,ba as He,c as q,ca as Ye,d as V,e as z,f as K,g as H,h as Y,i as X,j as J,k as Z,l as Q,m as ee,n as te,o as re,p as ne,q as ie,r as oe,s as se,t as ae,u as ce,v as de,w as ue,x as le}from"./chunk-K2P3YZVC.mjs";import"./chunk-NLAOQUYQ.mjs";var D="https://api.urun.sh",L="URUN_DEV";function Mt(){if(typeof process>"u")return!1;let i=process.env?.[L];if(typeof i!="string")return!1;let e=i.trim().toLowerCase();return e==="1"||e==="true"}var S=class extends Error{status;constructor(e,r){super(e),this.name="ClientTokenError",this.status=r}};async function Ot(i,e={}){if(!i)throw new S("[urun] createClientToken requires an org API key");let r=e.fetch??globalThis.fetch,o=O(e.baseUrl??D),t={};e.expiresIn!==void 0&&(t.expires_in=e.expiresIn),e.allowedFunctions!==void 0&&(t.allowed_functions=e.allowedFunctions),e.allowedOrigins!==void 0&&(t.allowed_origins=e.allowedOrigins),e.maxSessionS!==void 0&&(t.max_session_s=e.maxSessionS),e.subject!==void 0&&(t.subject=e.subject),e.metadata!==void 0&&(t.metadata=e.metadata),e.sharedApp&&(t.shared_app=!0),(e.dev??Mt())&&(t.dev=!0);let s;try{s=await r(`${o}/api/client-tokens`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(t)})}catch(p){throw new S(`[urun] client token mint request failed: ${p instanceof Error?p.message:String(p)}`)}let n={};try{n=await s.json()}catch{}if(!s.ok){let p=typeof n.message=="string"?n.message:`HTTP ${s.status}`;throw new S(`[urun] client token mint failed: ${p}`,s.status)}let c=typeof n.token=="string"?n.token:"",a=typeof n.org_id=="string"?n.org_id:"",l=typeof n.expires_at=="string"?Date.parse(n.expires_at):Number.NaN,d=typeof n.expires_in=="number"?n.expires_in:void 0;if(!c)throw new S("[urun] client token mint returned no token (control-plane contract violation)",s.status);let f=Number.isFinite(l)?new Date(l):new Date(Date.now()+(d??60)*1e3);return{token:c,expiresAt:f,orgId:a}}var U=3e4,N="stream:",x=class{_ws;_multiplexer;_pendingRpc=new Map;_rpcId=0;constructor(e,r){this._ws=e,this._multiplexer=r,this._ws.addEventListener("message",o=>{let t;try{t=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(t.rpcId&&this._pendingRpc.has(t.rpcId)){let s=this._pendingRpc.get(t.rpcId);this._pendingRpc.delete(t.rpcId),clearTimeout(s.timer),t.error?s.reject(new Error(t.error)):s.resolve(t.result)}})}async get(e){return this._sendRpc("store.get",{key:e})}async has(e){return await this._sendRpc("store.has",{key:e})}on(e,r){let o=`${N}${e}`;return this._multiplexer.on(o,t=>{r(t)})}emit(e,r){let o=`${N}${e}`,t=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{data:r};this._multiplexer.emit(o,t)}_getInternals(){return{multiplexer:this._multiplexer,ws:this._ws}}_sendRpc(e,r){return new Promise((o,t)=>{if(!this._ws||this._ws.readyState!==WebSocket.OPEN){t(new Error("WebSocket not open"));return}let s=String(++this._rpcId),n=setTimeout(()=>{this._pendingRpc.has(s)&&(this._pendingRpc.delete(s),t(new Error(`RPC request "${e}" timed out after ${U}ms`)))},U);this._pendingRpc.set(s,{resolve:o,reject:t,timer:n}),this._ws.send(JSON.stringify({rpcId:s,type:e,...r}))})}};function Dt(i){let o=`${i.baseUrl.replace(/\/$/,"").replace(/^http/,"ws")}/store/${encodeURIComponent(i.orgId)}`,t=new WebSocket(o);(i.jwt||i.apiKey)&&t.addEventListener("open",()=>{t.send(JSON.stringify({type:"auth",orgId:i.orgId,jwt:i.jwt,authProvider:i.authProvider,apiKey:i.apiKey}))});let s=new M(t);return new x(t,s)}var Lt='video/mp4; codecs="avc1.42E01E"';function Ut(i,e){let r=e?.codec??Lt,o=document.createElement("video");o.muted=!0,o.playsInline=!0;let t=new MediaSource,s=URL.createObjectURL(t);o.src=s,t.addEventListener("sourceopen",()=>{let p;try{p=t.addSourceBuffer(r)}catch(h){throw h instanceof DOMException&&h.name==="NotSupportedError"?new Error(`Codec not supported: "${r}". Ensure the codec string matches the fMP4 container format. Common values: video/mp4; codecs="avc1.42E01E" (H.264 Baseline), video/mp4; codecs="avc1.4D401F" (H.264 Main).`):h}let m=i.getReader();function u(){return p.updating?new Promise(h=>{p.addEventListener("updateend",()=>h(),{once:!0})}):Promise.resolve()}async function g(){try{for(;;){let{done:h,value:E}=await m.read();if(h){await u(),t.readyState==="open"&&t.endOfStream();return}await u();try{p.appendBuffer(E)}catch(w){if(w instanceof DOMException&&w.name==="QuotaExceededError"){let R=p.buffered;if(R.length>0){let $=R.start(R.length-1);p.remove(0,$),await u(),p.appendBuffer(E)}else throw w}else throw w}}}catch{if(t.readyState==="open")try{t.endOfStream("decode")}catch{}}}g()}),o.play().catch(()=>{});let n=o,c=n.captureStream??n.mozCaptureStream;if(!c)throw new Error("captureStream() is not supported in this browser. videoStream() requires HTMLMediaElement.captureStream() support.");let a=c.call(o),l=a.getTracks(),d=0,f=l.length;if(f===0)o.addEventListener("emptied",()=>{URL.revokeObjectURL(s)},{once:!0});else for(let p of l)p.addEventListener("ended",()=>{d++,d>=f&&URL.revokeObjectURL(s)});return a}function Nt(i){return i.status.startsWith("pending_")}var y=class extends Error{status;code;constructor(e,r){super(e),this.name="CreditsError",this.status=r.status,this.code=r.code,r.cause!==void 0&&(this.cause=r.cause),Object.setPrototypeOf(this,new.target.prototype)}},v=class extends y{constructor(e="[urun] credits: unauthorized",r="unauthorized"){super(e,{status:401,code:r}),this.name="CreditsUnauthorizedError",Object.setPrototypeOf(this,new.target.prototype)}};function Ft(i,e,r){let o=r||e||`HTTP ${i}`;return i===401?new v(o,e??"unauthorized"):new y(o,{status:i,code:e??`http_${i}`})}var k=class{constructor(e){this._options=e;this._base=`${e.functionsUrl.replace(/\/+$/,"")}/credits`}_options;_base;async getBalance(){let e=await this._request("GET","/balance");if(!e||typeof e!="object"||typeof e.org_id!="string")throw new y("[urun] credits: balance response missing org_id",{status:0,code:"bad_response"});return e}async getLedger(e={}){let o=(await this._request("GET","/ledger",{params:e.limit!==void 0?{limit:String(e.limit)}:void 0})).entries;return Array.isArray(o)?o:[]}async _request(e,r,o={}){let t=this._buildUrl(r,o.params),s=await this._resolveToken(),n=await this._fetch(t,e,s);if(n.status===401&&this._options.getAccessToken){let c=await this._options.getAccessToken({forceRefresh:!0,reason:"unauthorized"});c&&c!==s&&(s=c,n=await this._fetch(t,e,s))}if(!n.ok){let{code:c,message:a}=await this._readError(n);throw Ft(n.status,c,a)}return this._readJson(n)}_buildUrl(e,r){let o=`${this._base}${e}`,t=Object.entries(r??{}).filter(([,s])=>s!=null&&s!=="").map(([s,n])=>`${encodeURIComponent(s)}=${encodeURIComponent(n)}`).join("&");return t&&(o+=`?${t}`),o}_fetch(e,r,o){let t={Authorization:`Bearer ${o}`,apikey:o,Accept:"application/json","X-Tenant-Id":this._options.orgId};return this._options.authProvider&&(t["X-Auth-Provider"]=this._options.authProvider),fetch(e,{method:r,headers:t})}async _resolveToken(){if(this._options.getAccessToken){let r=await this._options.getAccessToken();if(r)return r}let e=this._options.jwt??this._options.apiKey;if(!e)throw new v("[urun] credits: no credential \u2014 provide one of apiKey, jwt, or getAccessToken");return e}async _readJson(e){try{return await e.json()}catch{return{}}}async _readError(e){try{let o=(await e.json()).error;if(o&&typeof o=="object"){let{code:t,message:s}=o;return{code:typeof t=="string"?t:void 0,message:typeof s=="string"?s:`HTTP ${e.status}`}}}catch{}return{message:`HTTP ${e.status}`}}};function Bt(i){return new k(i)}var _=class extends Error{constructor(){super("no getUserMedia in this environment \u2014 in headless/Node consumers, inject a media source via new CaptureController({ getUserMedia }) (e.g. a wrtc/werift capture)"),this.name="CaptureUnavailableError",Object.setPrototypeOf(this,new.target.prototype)}};function F(i){let e=[];return i.audio&&e.push("audio"),i.video&&e.push("video"),e.join("+")}function Wt(i,e){return e==="audio"?i.getAudioTracks():i.getVideoTracks()}function Gt(i,e){let r=i.getTracks();if(r.length===1&&r[0]===e)return i;try{return new MediaStream([e])}catch{return i}}function C(i,e){for(let r of[...i.lostListeners])try{r(e)}catch{}}var T=class{claims=new Map;injectedGetUserMedia;queue=Promise.resolve();constructor(e){this.injectedGetUserMedia=e?.getUserMedia}claim(e,r){return this.enqueue(async()=>{let o=this.claims.get(e);o&&(this.claims.delete(e),o.released=!0,o.track=null,o.stream=null,C(o,new Error(`${e} capture claim superseded by a newer claim`)));let t=this.createState(e,r);return this.claims.set(e,t),await this.converge(t),t.claim})}idle(){return this.queue.then(()=>{})}enqueue(e){let r=this.queue.then(e);return this.queue=r.then(()=>{},()=>{}),r}resolveGetUserMedia(){if(this.injectedGetUserMedia)return this.injectedGetUserMedia;let e=typeof navigator<"u"?navigator.mediaDevices:void 0;if(!e?.getUserMedia)throw new _;return r=>e.getUserMedia(r)}async converge(e){for(let n of this.claims.values())n.track&&(n.track.stop(),n.track=null,n.stream=null);if(this.claims.size===0)return;let r=this.resolveGetUserMedia(),o={audio:this.claims.get("audio")?.constraints??!1,video:this.claims.get("video")?.constraints??!1},t;try{t=await r(o)}catch(n){let c=`one-capture getUserMedia(${F(o)}) failed`,a=n instanceof Error?n.message:String(n);for(let l of[...this.claims.values()])if(this.claims.delete(l.kind),l.released=!0,l!==e){let d=new Error(`${c} \u2014 ${l.kind} capture lost: ${a||n}`);d.cause=n,C(l,d)}throw n}let s=[...this.claims.values()].sort((n,c)=>n===e?1:c===e?-1:0);for(let n of s){let c=Wt(t,n.kind)[0]??null;if(n.released){c?.stop();continue}if(!c){this.claims.delete(n.kind),n.released=!0;let a=Object.assign(new Error(`one-capture getUserMedia(${F(o)}) returned no ${n.kind} track`),{name:"NotFoundError"});if(n===e)throw a;C(n,a);continue}if(n.track=c,n.stream=Gt(t,c),n!==e)for(let a of[...n.trackListeners])try{a(c,n.stream)}catch{}}}createState(e,r){let o=this,t={kind:e,constraints:r,track:null,stream:null,released:!1,trackListeners:new Set,lostListeners:new Set,claim:{kind:e,get track(){return t.track},get stream(){return t.stream},update(s){return o.enqueue(async()=>{if(t.released)throw new Error(`${e} capture claim already released`);if(t.constraints=s,await o.converge(t),!t.track)throw new Error(`${e} capture update yielded no track`);return t.track})},release(){t.released||(t.released=!0,o.claims.get(e)===t&&o.claims.delete(e),t.track?.stop(),t.track=null,t.stream=null)},onTrack(s){return t.trackListeners.add(s),()=>t.trackListeners.delete(s)},onLost(s){return t.lostListeners.add(s),()=>t.lostListeners.delete(s)}}};return t}},jt=null;function $t(){return jt??=new T}var B="input",qt=30;function Vt(i){let e=i.now??Date.now,r=i.field??B,o=1e3/Math.max(i.hz??30,.001),t=new Set,s=0,n=0,c=0,a=0,l,d=null,f=!1,p=()=>{if(f)return;l=e(),a+=1;let u={keys:[...t],buttons:s,pointer:{x:n,y:c},seq:a,at:l};try{i.awareness.setLocalStateField(r,u)}catch{}},m=()=>{if(f)return;let u=e();if(l===void 0||u-l>=o){d&&(clearTimeout(d),d=null),p();return}if(d)return;let g=Math.max(o-(u-l),0);d=setTimeout(()=>{d=null,p()},g),d.unref?.()};return{keyDown(u){let g=String(u).toLowerCase();t.has(g)||(t.add(g),m())},keyUp(u){let g=String(u).toLowerCase();t.delete(g)&&m()},setButtons(u){let g=Number.isFinite(u)?Number(u):0;g!==s&&(s=g,m())},movePointer(u,g){let h=Number.isFinite(u)?Number(u):0,E=Number.isFinite(g)?Number(g):0;h===0&&E===0||(n+=h,c+=E,m())},heldKeys(){return[...t]},clear(){f||(t.clear(),s=0,d&&(clearTimeout(d),d=null),p())},dispose(){if(f)return;let u=t.size>0||s!==0;t.clear(),s=0,d&&(clearTimeout(d),d=null),u&&p(),f=!0}}}var zt=1024,Kt=.92,Ht=262144,Yt=256e3,A=[.9,.8,.7,.6,.5],W=.8,Xt=8;function I(i,e,r){if(!(i>0)||!(e>0))throw new Error(`reference image has no pixels (${i}x${e})`);let o=Math.min(1,r/Math.max(i,e));return{width:Math.max(1,Math.round(i*o)),height:Math.max(1,Math.round(e*o))}}async function Jt(i){if(typeof createImageBitmap!="function")throw new Error("this browser cannot decode images for reference capture (createImageBitmap unavailable)");return await createImageBitmap(i,{imageOrientation:"from-image"})}async function j(i,e,r){let o=await new Promise(t=>{i.toBlob(t,e,e==="image/jpeg"?r:void 0)});if(!o)throw new Error(`could not encode the reference image as ${e}`);return o}function G(i,e){console.warn(`[urun] reference image over the 256000-byte data-channel message budget (media/Chrome maxMessageSize 262144 would drop it SILENTLY): ${i} -> ${e} bytes`)}async function P(i,e,r,o,t){let s=document.createElement("canvas");s.width=e,s.height=r;let n=s.getContext("2d");if(!n)throw new Error("could not prepare the reference image (no 2d canvas context)");return o==="image/jpeg"&&(n.fillStyle="#fff",n.fillRect(0,0,e,r)),n.drawImage(i,0,0,e,r),await j(s,o,t)}async function Zt(i,e,r,o){let{width:t,height:s}=e,n=await P(i,t,s,r,o);if(n.size<=256e3)return{blob:n,width:t,height:s};if(r==="image/jpeg"){for(let a of A)if(!(a>=o)&&(n=await P(i,t,s,r,a),n.size<=256e3))return G(`quality ${o} -> ${a}`,n.size),{blob:n,width:t,height:s}}let c=r==="image/jpeg"?A[A.length-1]:o;for(let a=0;a<Xt;a++)if(t=Math.max(16,Math.round(t*W)),s=Math.max(16,Math.round(s*W)),n=await P(i,t,s,r,c),n.size<=256e3)return G(`downscaled to ${t}x${s} @ q${c}`,n.size),{blob:n,width:t,height:s};throw new Error(`this image cannot be sent: even at ${t}x${s} it is over the 256000-byte limit for one message. Try a smaller or less detailed picture.`)}async function Qt(i,e){let{maxSize:r=1024,type:o="image/jpeg",quality:t=.92,source:s}=e,n=await Jt(i);try{let c=I(n.width,n.height,r),a=await Zt(n,c,o,t);return{bytes:new Uint8Array(await a.blob.arrayBuffer()),type:o,width:a.width,height:a.height,source:s}}finally{n.close()}}function er(i){let e=i instanceof Error?i.name:"",r=i instanceof Error?i.message:String(i);switch(e){case"NotAllowedError":case"SecurityError":return"Camera access is turned off for this site. Allow the camera in your browser settings, then try again.";case"NotFoundError":case"OverconstrainedError":return"No camera was found on this device. You can upload a photo instead.";case"NotReadableError":case"AbortError":return"The camera is being used by another app. Close it, then try again.";default:break}return/has not shown a frame/i.test(r)?"The camera is still starting. Wait for the picture to appear, then take the photo.":/secure|https/i.test(r)?"The camera only works over a secure (https) connection.":/decode|not settled|createImageBitmap|encode|image/i.test(r)?"That file couldn't be read as an image. Try a JPEG or PNG photo.":"The camera couldn't be started. Check that no other app is using it, then try again."}function tr(){return typeof navigator>"u"||typeof window>"u"||!window.isSecureContext?!1:typeof navigator.mediaDevices?.getUserMedia=="function"}async function rr(i,e){let r=i.videoWidth,o=i.videoHeight;if(!(r>0)||!(o>0))throw new Error("the camera has not shown a frame yet");let{maxSize:t=1024,type:s="image/jpeg",quality:n=.92}=e??{},c=I(r,o,t),a=document.createElement("canvas");a.width=c.width,a.height=c.height;let l=a.getContext("2d");if(!l)throw new Error("could not prepare the reference image (no 2d canvas context)");s==="image/jpeg"&&(l.fillStyle="#fff",l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height);let d=await j(a,s,n);return{bytes:new Uint8Array(await d.arrayBuffer()),type:s,width:c.width,height:c.height,source:"camera"}}var nr=new Set(["w","a","s","d"]),b=(i,e)=>Math.min(e,Math.max(-e,i));function ir(i={}){let{panPerPixel:e=9e-4,zoomPerSecond:r=.35,strafePerSecond:o=.18,decayTauMs:t=900,frameRelax:s=.06,maxPan:n=.12,maxLogZoom:c=.22}=i,a=0,l=0,d=0,f=null,p=new Set;return{pointerDelta(m,u){a=b(a-m*e,n),l=b(l-u*e,n)},keyDown(m){let u=m.toLowerCase();nr.has(u)&&p.add(u)},keyUp(m){p.delete(m.toLowerCase())},clearKeys(){p.clear()},frameArrived(){let m=1-s;a*=m,l*=m,d*=m},tick(m){if(f===null){f=m;return}let u=Math.max(0,Math.min(100,m-f))/1e3;f=m,p.has("w")&&(d=b(d+r*u,c)),p.has("s")&&(d=b(d-r*u,c)),p.has("a")&&(a=b(a+o*u,n)),p.has("d")&&(a=b(a-o*u,n));let g=Math.exp(-u*1e3/t);a*=g,l*=g,d*=g},transform(){return{translateX:a,translateY:l,scale:Math.exp(d)}},isIdentity(m=5e-4){return Math.abs(a)<m&&Math.abs(l)<m&&Math.abs(d)<m},reset(){a=0,l=0,d=0,p.clear()}}}export{me as ACTIVATION_COLD_BOOT_AFTER_MS,ge as ACTIVATION_DEGRADED_AFTER_MS,he as ACTIVATION_HINT_PATH,pe as ACTIVATION_STILL_AFTER_MS,rt as ACTIVITY_DOM_EVENTS,Qe as ACTIVITY_FIELD,tt as ACTIVITY_STAMP_MIN_INTERVAL_MS,be as ActivationMonitor,It as App,Ee as BACKOFF_BASE_MS,we as BACKOFF_MAX_ATTEMPTS,ve as BACKOFF_MAX_MS,de as COLD_BOOT_WHEN_LIVE_TIMEOUT_MS,T as CaptureController,_ as CaptureUnavailableError,S as ClientTokenError,k as CreditsClient,y as CreditsError,v as CreditsUnauthorizedError,Ht as DATA_CHANNEL_MESSAGE_CEILING,xt as DEFAULT_DOC_SYNC_TIMEOUT_MS,D as DEFAULT_GATEWAY_URL,J as DEFAULT_PRODUCE_ACK_TIMEOUT_MS,Kt as DEFAULT_REFERENCE_JPEG_QUALITY,zt as DEFAULT_REFERENCE_MAX_SIZE,ce as DEFAULT_WHEN_LIVE_TIMEOUT_MS,ze as DERIVED_LEG_SEP,ht as DGRAM_HEADER_BYTES,ot as FOCUS_FIELD,ct as FOREGROUND_COALESCE_MS,bt as FrameReassembler,Xe as GENERATION_TICK_EMIT_INTERVAL_MS,Je as GENERATION_TICK_MAX_EXTRAPOLATION_MS,qt as INPUT_PRESENCE_DEFAULT_HZ,B as INPUT_PRESENCE_FIELD,Fe as InvalidDurationError,Se as LEGACY_ACTIVATION_HINT_PATH,fe as PLATFORM_DOC_NAME,Ne as PermanentLockedError,Ue as PinRequiresActiveTempError,at as PresenceTracker,Z as ProduceAckTimeoutError,De as RecordingNotFoundError,Ge as RecordingsClient,Me as RecordingsError,Oe as RecordingsUnauthorizedError,Q as RequestAbortError,ee as RequestCancelledError,Y as RequestDocSyncError,K as RequestError,H as RequestTimeoutError,Le as RetainNotTempError,Ae as RuntimeArtifactNotFoundError,Ie as RuntimeArtifactsClient,xe as RuntimeArtifactsError,Ce as RuntimeArtifactsUnauthorizedError,Ye as SIGNALING_PROTOCOL_VERSION,$e as STREAM_END,Ct as Session,oe as SessionAllocationError,At as SessionDirectory,z as SessionDirectoryError,V as SessionEndError,q as SessionEndUnavailableError,re as SessionFailedError,X as StreamDirectionConflict,_t as TransportNegotiator,ie as TransportSessionMismatchError,Tt as TransportSessionSignaling,L as URUN_DEV_ENV,it as USER_ACTIVITY_FIELD,st as USER_ACTIVITY_MIN_INTERVAL_MS,et as VISIBILITY_FIELD,Yt as WIRE_MESSAGE_BUDGET,mt as WT_CONTROL_FRAME_MAX,Et as WT_DATA_STREAM_VERSION,Rt as WebRtcSession,kt as WebTransportSession,ft as WtControlDecoder,vt as WtDataStreamParser,ye as activationHintFrom,tr as cameraCaptureAvailable,rr as captureStillFromVideo,ke as computeBackoffDelay,wt as consumeWtDataStreams,nt as createActivityTracker,ir as createCameraWarp,Ot as createClientToken,Bt as createCreditsClient,Vt as createInputPresencePublisher,je as createRecordingsClient,Pe as createRuntimeArtifactsClient,Dt as createStore,Ve as decodeStreamEnvelope,He as derivedLegName,Ke as derivedLegRole,te as describeSessionFailure,le as describeSessionPhase,qe as encodeStreamEnvelope,gt as encodeWtControlFrame,I as fitWithin,Be as isDurationString,ae as isPausedPhase,Nt as isPendingRecording,_e as isRetryableSessionError,se as isWakingPhase,pt as mediaRecorderChunkSource,Qt as normalizeReferenceImage,We as normalizeRetention,lt as observeLeaveConfirm,dt as observePageLifecycle,ut as observePageTeardown,St as parseDgramHeader,Re as prewake,er as referenceImageErrorMessage,Te as releaseSessionBeacon,Pt as sessionDirectory,ne as sessionFailureFromMediaError,$t as sharedCaptureController,Ut as videoStream,Ze as watchGenerationTick,ue as whenLive,yt as writeDgramHeader};
|
|
2
|
+
import{$ as Tt,A as Ze,B as Qe,C as et,D as tt,E as rt,F as nt,G as it,H as ot,I as st,J as at,K as ct,L as dt,M as ut,N as lt,O as pt,P as mt,Q as gt,R as ft,S as ht,T as St,U as yt,V as bt,W as Et,X as vt,Y as wt,Z as kt,_ as _t,a as pe,aa as Rt,b as me,ba as xt,c as ge,ca as Ct,d as fe,da as At,e as he,ea as Pt,f as Se,fa as It,g as ye,h as be,i as xe,j as Ce,k as Ae,l as Pe,m as Ie,n as Me,o as Oe,p as De,q as Le,r as Ue,s as Ne,t as Fe,u as Be,v as We,w as Ge,x as je,y as Xe,z as Je}from"./chunk-LPCBAG4Z.mjs";import{$ as ze,C as Ee,D as ve,E as we,F as ke,G as _e,H as O,J as Te,S as Re,V as $e,W as qe,X as Ve,a as M,aa as Ke,ba as He,c as q,ca as Ye,d as V,e as z,f as K,g as H,h as Y,i as X,j as J,k as Z,l as Q,m as ee,n as te,o as re,p as ne,q as ie,r as oe,s as se,t as ae,u as ce,v as de,w as ue,x as le}from"./chunk-LYFGDF44.mjs";import"./chunk-NLAOQUYQ.mjs";var D="https://api.urun.sh",L="URUN_DEV";function Mt(){if(typeof process>"u")return!1;let i=process.env?.[L];if(typeof i!="string")return!1;let e=i.trim().toLowerCase();return e==="1"||e==="true"}var S=class extends Error{status;constructor(e,r){super(e),this.name="ClientTokenError",this.status=r}};async function Ot(i,e={}){if(!i)throw new S("[urun] createClientToken requires an org API key");let r=e.fetch??globalThis.fetch,o=O(e.baseUrl??D),t={};e.expiresIn!==void 0&&(t.expires_in=e.expiresIn),e.allowedFunctions!==void 0&&(t.allowed_functions=e.allowedFunctions),e.allowedOrigins!==void 0&&(t.allowed_origins=e.allowedOrigins),e.maxSessionS!==void 0&&(t.max_session_s=e.maxSessionS),e.subject!==void 0&&(t.subject=e.subject),e.metadata!==void 0&&(t.metadata=e.metadata),e.sharedApp&&(t.shared_app=!0),(e.dev??Mt())&&(t.dev=!0);let s;try{s=await r(`${o}/api/client-tokens`,{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${i}`},body:JSON.stringify(t)})}catch(p){throw new S(`[urun] client token mint request failed: ${p instanceof Error?p.message:String(p)}`)}let n={};try{n=await s.json()}catch{}if(!s.ok){let p=typeof n.message=="string"?n.message:`HTTP ${s.status}`;throw new S(`[urun] client token mint failed: ${p}`,s.status)}let c=typeof n.token=="string"?n.token:"",a=typeof n.org_id=="string"?n.org_id:"",l=typeof n.expires_at=="string"?Date.parse(n.expires_at):Number.NaN,d=typeof n.expires_in=="number"?n.expires_in:void 0;if(!c)throw new S("[urun] client token mint returned no token (control-plane contract violation)",s.status);let f=Number.isFinite(l)?new Date(l):new Date(Date.now()+(d??60)*1e3);return{token:c,expiresAt:f,orgId:a}}var U=3e4,N="stream:",x=class{_ws;_multiplexer;_pendingRpc=new Map;_rpcId=0;constructor(e,r){this._ws=e,this._multiplexer=r,this._ws.addEventListener("message",o=>{let t;try{t=JSON.parse(typeof o.data=="string"?o.data:"")}catch{return}if(t.rpcId&&this._pendingRpc.has(t.rpcId)){let s=this._pendingRpc.get(t.rpcId);this._pendingRpc.delete(t.rpcId),clearTimeout(s.timer),t.error?s.reject(new Error(t.error)):s.resolve(t.result)}})}async get(e){return this._sendRpc("store.get",{key:e})}async has(e){return await this._sendRpc("store.has",{key:e})}on(e,r){let o=`${N}${e}`;return this._multiplexer.on(o,t=>{r(t)})}emit(e,r){let o=`${N}${e}`,t=typeof r=="object"&&r!==null&&!Array.isArray(r)?r:{data:r};this._multiplexer.emit(o,t)}_getInternals(){return{multiplexer:this._multiplexer,ws:this._ws}}_sendRpc(e,r){return new Promise((o,t)=>{if(!this._ws||this._ws.readyState!==WebSocket.OPEN){t(new Error("WebSocket not open"));return}let s=String(++this._rpcId),n=setTimeout(()=>{this._pendingRpc.has(s)&&(this._pendingRpc.delete(s),t(new Error(`RPC request "${e}" timed out after ${U}ms`)))},U);this._pendingRpc.set(s,{resolve:o,reject:t,timer:n}),this._ws.send(JSON.stringify({rpcId:s,type:e,...r}))})}};function Dt(i){let o=`${i.baseUrl.replace(/\/$/,"").replace(/^http/,"ws")}/store/${encodeURIComponent(i.orgId)}`,t=new WebSocket(o);(i.jwt||i.apiKey)&&t.addEventListener("open",()=>{t.send(JSON.stringify({type:"auth",orgId:i.orgId,jwt:i.jwt,authProvider:i.authProvider,apiKey:i.apiKey}))});let s=new M(t);return new x(t,s)}var Lt='video/mp4; codecs="avc1.42E01E"';function Ut(i,e){let r=e?.codec??Lt,o=document.createElement("video");o.muted=!0,o.playsInline=!0;let t=new MediaSource,s=URL.createObjectURL(t);o.src=s,t.addEventListener("sourceopen",()=>{let p;try{p=t.addSourceBuffer(r)}catch(h){throw h instanceof DOMException&&h.name==="NotSupportedError"?new Error(`Codec not supported: "${r}". Ensure the codec string matches the fMP4 container format. Common values: video/mp4; codecs="avc1.42E01E" (H.264 Baseline), video/mp4; codecs="avc1.4D401F" (H.264 Main).`):h}let m=i.getReader();function u(){return p.updating?new Promise(h=>{p.addEventListener("updateend",()=>h(),{once:!0})}):Promise.resolve()}async function g(){try{for(;;){let{done:h,value:E}=await m.read();if(h){await u(),t.readyState==="open"&&t.endOfStream();return}await u();try{p.appendBuffer(E)}catch(w){if(w instanceof DOMException&&w.name==="QuotaExceededError"){let R=p.buffered;if(R.length>0){let $=R.start(R.length-1);p.remove(0,$),await u(),p.appendBuffer(E)}else throw w}else throw w}}}catch{if(t.readyState==="open")try{t.endOfStream("decode")}catch{}}}g()}),o.play().catch(()=>{});let n=o,c=n.captureStream??n.mozCaptureStream;if(!c)throw new Error("captureStream() is not supported in this browser. videoStream() requires HTMLMediaElement.captureStream() support.");let a=c.call(o),l=a.getTracks(),d=0,f=l.length;if(f===0)o.addEventListener("emptied",()=>{URL.revokeObjectURL(s)},{once:!0});else for(let p of l)p.addEventListener("ended",()=>{d++,d>=f&&URL.revokeObjectURL(s)});return a}function Nt(i){return i.status.startsWith("pending_")}var y=class extends Error{status;code;constructor(e,r){super(e),this.name="CreditsError",this.status=r.status,this.code=r.code,r.cause!==void 0&&(this.cause=r.cause),Object.setPrototypeOf(this,new.target.prototype)}},v=class extends y{constructor(e="[urun] credits: unauthorized",r="unauthorized"){super(e,{status:401,code:r}),this.name="CreditsUnauthorizedError",Object.setPrototypeOf(this,new.target.prototype)}};function Ft(i,e,r){let o=r||e||`HTTP ${i}`;return i===401?new v(o,e??"unauthorized"):new y(o,{status:i,code:e??`http_${i}`})}var k=class{constructor(e){this._options=e;this._base=`${e.functionsUrl.replace(/\/+$/,"")}/credits`}_options;_base;async getBalance(){let e=await this._request("GET","/balance");if(!e||typeof e!="object"||typeof e.org_id!="string")throw new y("[urun] credits: balance response missing org_id",{status:0,code:"bad_response"});return e}async getLedger(e={}){let o=(await this._request("GET","/ledger",{params:e.limit!==void 0?{limit:String(e.limit)}:void 0})).entries;return Array.isArray(o)?o:[]}async _request(e,r,o={}){let t=this._buildUrl(r,o.params),s=await this._resolveToken(),n=await this._fetch(t,e,s);if(n.status===401&&this._options.getAccessToken){let c=await this._options.getAccessToken({forceRefresh:!0,reason:"unauthorized"});c&&c!==s&&(s=c,n=await this._fetch(t,e,s))}if(!n.ok){let{code:c,message:a}=await this._readError(n);throw Ft(n.status,c,a)}return this._readJson(n)}_buildUrl(e,r){let o=`${this._base}${e}`,t=Object.entries(r??{}).filter(([,s])=>s!=null&&s!=="").map(([s,n])=>`${encodeURIComponent(s)}=${encodeURIComponent(n)}`).join("&");return t&&(o+=`?${t}`),o}_fetch(e,r,o){let t={Authorization:`Bearer ${o}`,apikey:o,Accept:"application/json","X-Tenant-Id":this._options.orgId};return this._options.authProvider&&(t["X-Auth-Provider"]=this._options.authProvider),fetch(e,{method:r,headers:t})}async _resolveToken(){if(this._options.getAccessToken){let r=await this._options.getAccessToken();if(r)return r}let e=this._options.jwt??this._options.apiKey;if(!e)throw new v("[urun] credits: no credential \u2014 provide one of apiKey, jwt, or getAccessToken");return e}async _readJson(e){try{return await e.json()}catch{return{}}}async _readError(e){try{let o=(await e.json()).error;if(o&&typeof o=="object"){let{code:t,message:s}=o;return{code:typeof t=="string"?t:void 0,message:typeof s=="string"?s:`HTTP ${e.status}`}}}catch{}return{message:`HTTP ${e.status}`}}};function Bt(i){return new k(i)}var _=class extends Error{constructor(){super("no getUserMedia in this environment \u2014 in headless/Node consumers, inject a media source via new CaptureController({ getUserMedia }) (e.g. a wrtc/werift capture)"),this.name="CaptureUnavailableError",Object.setPrototypeOf(this,new.target.prototype)}};function F(i){let e=[];return i.audio&&e.push("audio"),i.video&&e.push("video"),e.join("+")}function Wt(i,e){return e==="audio"?i.getAudioTracks():i.getVideoTracks()}function Gt(i,e){let r=i.getTracks();if(r.length===1&&r[0]===e)return i;try{return new MediaStream([e])}catch{return i}}function C(i,e){for(let r of[...i.lostListeners])try{r(e)}catch{}}var T=class{claims=new Map;injectedGetUserMedia;queue=Promise.resolve();constructor(e){this.injectedGetUserMedia=e?.getUserMedia}claim(e,r){return this.enqueue(async()=>{let o=this.claims.get(e);o&&(this.claims.delete(e),o.released=!0,o.track=null,o.stream=null,C(o,new Error(`${e} capture claim superseded by a newer claim`)));let t=this.createState(e,r);return this.claims.set(e,t),await this.converge(t),t.claim})}idle(){return this.queue.then(()=>{})}enqueue(e){let r=this.queue.then(e);return this.queue=r.then(()=>{},()=>{}),r}resolveGetUserMedia(){if(this.injectedGetUserMedia)return this.injectedGetUserMedia;let e=typeof navigator<"u"?navigator.mediaDevices:void 0;if(!e?.getUserMedia)throw new _;return r=>e.getUserMedia(r)}async converge(e){for(let n of this.claims.values())n.track&&(n.track.stop(),n.track=null,n.stream=null);if(this.claims.size===0)return;let r=this.resolveGetUserMedia(),o={audio:this.claims.get("audio")?.constraints??!1,video:this.claims.get("video")?.constraints??!1},t;try{t=await r(o)}catch(n){let c=`one-capture getUserMedia(${F(o)}) failed`,a=n instanceof Error?n.message:String(n);for(let l of[...this.claims.values()])if(this.claims.delete(l.kind),l.released=!0,l!==e){let d=new Error(`${c} \u2014 ${l.kind} capture lost: ${a||n}`);d.cause=n,C(l,d)}throw n}let s=[...this.claims.values()].sort((n,c)=>n===e?1:c===e?-1:0);for(let n of s){let c=Wt(t,n.kind)[0]??null;if(n.released){c?.stop();continue}if(!c){this.claims.delete(n.kind),n.released=!0;let a=Object.assign(new Error(`one-capture getUserMedia(${F(o)}) returned no ${n.kind} track`),{name:"NotFoundError"});if(n===e)throw a;C(n,a);continue}if(n.track=c,n.stream=Gt(t,c),n!==e)for(let a of[...n.trackListeners])try{a(c,n.stream)}catch{}}}createState(e,r){let o=this,t={kind:e,constraints:r,track:null,stream:null,released:!1,trackListeners:new Set,lostListeners:new Set,claim:{kind:e,get track(){return t.track},get stream(){return t.stream},update(s){return o.enqueue(async()=>{if(t.released)throw new Error(`${e} capture claim already released`);if(t.constraints=s,await o.converge(t),!t.track)throw new Error(`${e} capture update yielded no track`);return t.track})},release(){t.released||(t.released=!0,o.claims.get(e)===t&&o.claims.delete(e),t.track?.stop(),t.track=null,t.stream=null)},onTrack(s){return t.trackListeners.add(s),()=>t.trackListeners.delete(s)},onLost(s){return t.lostListeners.add(s),()=>t.lostListeners.delete(s)}}};return t}},jt=null;function $t(){return jt??=new T}var B="input",qt=30;function Vt(i){let e=i.now??Date.now,r=i.field??B,o=1e3/Math.max(i.hz??30,.001),t=new Set,s=0,n=0,c=0,a=0,l,d=null,f=!1,p=()=>{if(f)return;l=e(),a+=1;let u={keys:[...t],buttons:s,pointer:{x:n,y:c},seq:a,at:l};try{i.awareness.setLocalStateField(r,u)}catch{}},m=()=>{if(f)return;let u=e();if(l===void 0||u-l>=o){d&&(clearTimeout(d),d=null),p();return}if(d)return;let g=Math.max(o-(u-l),0);d=setTimeout(()=>{d=null,p()},g),d.unref?.()};return{keyDown(u){let g=String(u).toLowerCase();t.has(g)||(t.add(g),m())},keyUp(u){let g=String(u).toLowerCase();t.delete(g)&&m()},setButtons(u){let g=Number.isFinite(u)?Number(u):0;g!==s&&(s=g,m())},movePointer(u,g){let h=Number.isFinite(u)?Number(u):0,E=Number.isFinite(g)?Number(g):0;h===0&&E===0||(n+=h,c+=E,m())},heldKeys(){return[...t]},clear(){f||(t.clear(),s=0,d&&(clearTimeout(d),d=null),p())},dispose(){if(f)return;let u=t.size>0||s!==0;t.clear(),s=0,d&&(clearTimeout(d),d=null),u&&p(),f=!0}}}var zt=1024,Kt=.92,Ht=262144,Yt=256e3,A=[.9,.8,.7,.6,.5],W=.8,Xt=8;function I(i,e,r){if(!(i>0)||!(e>0))throw new Error(`reference image has no pixels (${i}x${e})`);let o=Math.min(1,r/Math.max(i,e));return{width:Math.max(1,Math.round(i*o)),height:Math.max(1,Math.round(e*o))}}async function Jt(i){if(typeof createImageBitmap!="function")throw new Error("this browser cannot decode images for reference capture (createImageBitmap unavailable)");return await createImageBitmap(i,{imageOrientation:"from-image"})}async function j(i,e,r){let o=await new Promise(t=>{i.toBlob(t,e,e==="image/jpeg"?r:void 0)});if(!o)throw new Error(`could not encode the reference image as ${e}`);return o}function G(i,e){console.warn(`[urun] reference image over the 256000-byte data-channel message budget (media/Chrome maxMessageSize 262144 would drop it SILENTLY): ${i} -> ${e} bytes`)}async function P(i,e,r,o,t){let s=document.createElement("canvas");s.width=e,s.height=r;let n=s.getContext("2d");if(!n)throw new Error("could not prepare the reference image (no 2d canvas context)");return o==="image/jpeg"&&(n.fillStyle="#fff",n.fillRect(0,0,e,r)),n.drawImage(i,0,0,e,r),await j(s,o,t)}async function Zt(i,e,r,o){let{width:t,height:s}=e,n=await P(i,t,s,r,o);if(n.size<=256e3)return{blob:n,width:t,height:s};if(r==="image/jpeg"){for(let a of A)if(!(a>=o)&&(n=await P(i,t,s,r,a),n.size<=256e3))return G(`quality ${o} -> ${a}`,n.size),{blob:n,width:t,height:s}}let c=r==="image/jpeg"?A[A.length-1]:o;for(let a=0;a<Xt;a++)if(t=Math.max(16,Math.round(t*W)),s=Math.max(16,Math.round(s*W)),n=await P(i,t,s,r,c),n.size<=256e3)return G(`downscaled to ${t}x${s} @ q${c}`,n.size),{blob:n,width:t,height:s};throw new Error(`this image cannot be sent: even at ${t}x${s} it is over the 256000-byte limit for one message. Try a smaller or less detailed picture.`)}async function Qt(i,e){let{maxSize:r=1024,type:o="image/jpeg",quality:t=.92,source:s}=e,n=await Jt(i);try{let c=I(n.width,n.height,r),a=await Zt(n,c,o,t);return{bytes:new Uint8Array(await a.blob.arrayBuffer()),type:o,width:a.width,height:a.height,source:s}}finally{n.close()}}function er(i){let e=i instanceof Error?i.name:"",r=i instanceof Error?i.message:String(i);switch(e){case"NotAllowedError":case"SecurityError":return"Camera access is turned off for this site. Allow the camera in your browser settings, then try again.";case"NotFoundError":case"OverconstrainedError":return"No camera was found on this device. You can upload a photo instead.";case"NotReadableError":case"AbortError":return"The camera is being used by another app. Close it, then try again.";default:break}return/has not shown a frame/i.test(r)?"The camera is still starting. Wait for the picture to appear, then take the photo.":/secure|https/i.test(r)?"The camera only works over a secure (https) connection.":/decode|not settled|createImageBitmap|encode|image/i.test(r)?"That file couldn't be read as an image. Try a JPEG or PNG photo.":"The camera couldn't be started. Check that no other app is using it, then try again."}function tr(){return typeof navigator>"u"||typeof window>"u"||!window.isSecureContext?!1:typeof navigator.mediaDevices?.getUserMedia=="function"}async function rr(i,e){let r=i.videoWidth,o=i.videoHeight;if(!(r>0)||!(o>0))throw new Error("the camera has not shown a frame yet");let{maxSize:t=1024,type:s="image/jpeg",quality:n=.92}=e??{},c=I(r,o,t),a=document.createElement("canvas");a.width=c.width,a.height=c.height;let l=a.getContext("2d");if(!l)throw new Error("could not prepare the reference image (no 2d canvas context)");s==="image/jpeg"&&(l.fillStyle="#fff",l.fillRect(0,0,c.width,c.height)),l.drawImage(i,0,0,c.width,c.height);let d=await j(a,s,n);return{bytes:new Uint8Array(await d.arrayBuffer()),type:s,width:c.width,height:c.height,source:"camera"}}var nr=new Set(["w","a","s","d"]),b=(i,e)=>Math.min(e,Math.max(-e,i));function ir(i={}){let{panPerPixel:e=9e-4,zoomPerSecond:r=.35,strafePerSecond:o=.18,decayTauMs:t=900,frameRelax:s=.06,maxPan:n=.12,maxLogZoom:c=.22}=i,a=0,l=0,d=0,f=null,p=new Set;return{pointerDelta(m,u){a=b(a-m*e,n),l=b(l-u*e,n)},keyDown(m){let u=m.toLowerCase();nr.has(u)&&p.add(u)},keyUp(m){p.delete(m.toLowerCase())},clearKeys(){p.clear()},frameArrived(){let m=1-s;a*=m,l*=m,d*=m},tick(m){if(f===null){f=m;return}let u=Math.max(0,Math.min(100,m-f))/1e3;f=m,p.has("w")&&(d=b(d+r*u,c)),p.has("s")&&(d=b(d-r*u,c)),p.has("a")&&(a=b(a+o*u,n)),p.has("d")&&(a=b(a-o*u,n));let g=Math.exp(-u*1e3/t);a*=g,l*=g,d*=g},transform(){return{translateX:a,translateY:l,scale:Math.exp(d)}},isIdentity(m=5e-4){return Math.abs(a)<m&&Math.abs(l)<m&&Math.abs(d)<m},reset(){a=0,l=0,d=0,p.clear()}}}export{me as ACTIVATION_COLD_BOOT_AFTER_MS,ge as ACTIVATION_DEGRADED_AFTER_MS,he as ACTIVATION_HINT_PATH,pe as ACTIVATION_STILL_AFTER_MS,rt as ACTIVITY_DOM_EVENTS,Qe as ACTIVITY_FIELD,tt as ACTIVITY_STAMP_MIN_INTERVAL_MS,be as ActivationMonitor,It as App,Ee as BACKOFF_BASE_MS,we as BACKOFF_MAX_ATTEMPTS,ve as BACKOFF_MAX_MS,de as COLD_BOOT_WHEN_LIVE_TIMEOUT_MS,T as CaptureController,_ as CaptureUnavailableError,S as ClientTokenError,k as CreditsClient,y as CreditsError,v as CreditsUnauthorizedError,Ht as DATA_CHANNEL_MESSAGE_CEILING,xt as DEFAULT_DOC_SYNC_TIMEOUT_MS,D as DEFAULT_GATEWAY_URL,J as DEFAULT_PRODUCE_ACK_TIMEOUT_MS,Kt as DEFAULT_REFERENCE_JPEG_QUALITY,zt as DEFAULT_REFERENCE_MAX_SIZE,ce as DEFAULT_WHEN_LIVE_TIMEOUT_MS,ze as DERIVED_LEG_SEP,ht as DGRAM_HEADER_BYTES,ot as FOCUS_FIELD,ct as FOREGROUND_COALESCE_MS,bt as FrameReassembler,Xe as GENERATION_TICK_EMIT_INTERVAL_MS,Je as GENERATION_TICK_MAX_EXTRAPOLATION_MS,qt as INPUT_PRESENCE_DEFAULT_HZ,B as INPUT_PRESENCE_FIELD,Fe as InvalidDurationError,Se as LEGACY_ACTIVATION_HINT_PATH,fe as PLATFORM_DOC_NAME,Ne as PermanentLockedError,Ue as PinRequiresActiveTempError,at as PresenceTracker,Z as ProduceAckTimeoutError,De as RecordingNotFoundError,Ge as RecordingsClient,Me as RecordingsError,Oe as RecordingsUnauthorizedError,Q as RequestAbortError,ee as RequestCancelledError,Y as RequestDocSyncError,K as RequestError,H as RequestTimeoutError,Le as RetainNotTempError,Ae as RuntimeArtifactNotFoundError,Ie as RuntimeArtifactsClient,xe as RuntimeArtifactsError,Ce as RuntimeArtifactsUnauthorizedError,Ye as SIGNALING_PROTOCOL_VERSION,$e as STREAM_END,Ct as Session,oe as SessionAllocationError,At as SessionDirectory,z as SessionDirectoryError,V as SessionEndError,q as SessionEndUnavailableError,re as SessionFailedError,X as StreamDirectionConflict,_t as TransportNegotiator,ie as TransportSessionMismatchError,Tt as TransportSessionSignaling,L as URUN_DEV_ENV,it as USER_ACTIVITY_FIELD,st as USER_ACTIVITY_MIN_INTERVAL_MS,et as VISIBILITY_FIELD,Yt as WIRE_MESSAGE_BUDGET,mt as WT_CONTROL_FRAME_MAX,Et as WT_DATA_STREAM_VERSION,Rt as WebRtcSession,kt as WebTransportSession,ft as WtControlDecoder,vt as WtDataStreamParser,ye as activationHintFrom,tr as cameraCaptureAvailable,rr as captureStillFromVideo,ke as computeBackoffDelay,wt as consumeWtDataStreams,nt as createActivityTracker,ir as createCameraWarp,Ot as createClientToken,Bt as createCreditsClient,Vt as createInputPresencePublisher,je as createRecordingsClient,Pe as createRuntimeArtifactsClient,Dt as createStore,Ve as decodeStreamEnvelope,He as derivedLegName,Ke as derivedLegRole,te as describeSessionFailure,le as describeSessionPhase,qe as encodeStreamEnvelope,gt as encodeWtControlFrame,I as fitWithin,Be as isDurationString,ae as isPausedPhase,Nt as isPendingRecording,_e as isRetryableSessionError,se as isWakingPhase,pt as mediaRecorderChunkSource,Qt as normalizeReferenceImage,We as normalizeRetention,lt as observeLeaveConfirm,dt as observePageLifecycle,ut as observePageTeardown,St as parseDgramHeader,Re as prewake,er as referenceImageErrorMessage,Te as releaseSessionBeacon,Pt as sessionDirectory,ne as sessionFailureFromMediaError,$t as sharedCaptureController,Ut as videoStream,Ze as watchGenerationTick,ue as whenLive,yt as writeDgramHeader};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as AccessTokenOptions, e as AllocateSessionOptions, f as AllocatedSession, m as ChannelMessage, n as ChannelMultiplexer, o as ChannelName, r as DOC_SYNC_WIRE_CONTRACT_VERSION, s as DeferredChannelMultiplexer, t as DeferredDocConnector, w as DocConnection, x as DocConnectionState, y as DocConnector, z as DocServerUrlResolver, E as DocTokenSupplier, L as LoopbackStreamData, ai as SessionDocumentImpl, ap as SessionStartOptions, aB as StreamDataTransport, aG as TransportSession, aH as TransportSessionOptions, aX as allocateSession, aY as computeBackoffDelay, a_ as createPresence, a$ as createWebsocketDocConnector, b1 as deriveYjsServerUrl, bc as streamDataLabel, bd as transportStreamData } from './backoff-
|
|
1
|
+
export { a as AccessTokenOptions, e as AllocateSessionOptions, f as AllocatedSession, m as ChannelMessage, n as ChannelMultiplexer, o as ChannelName, r as DOC_SYNC_WIRE_CONTRACT_VERSION, s as DeferredChannelMultiplexer, t as DeferredDocConnector, w as DocConnection, x as DocConnectionState, y as DocConnector, z as DocServerUrlResolver, E as DocTokenSupplier, L as LoopbackStreamData, ai as SessionDocumentImpl, ap as SessionStartOptions, aB as StreamDataTransport, aG as TransportSession, aH as TransportSessionOptions, aX as allocateSession, aY as computeBackoffDelay, a_ as createPresence, a$ as createWebsocketDocConnector, b1 as deriveYjsServerUrl, bc as streamDataLabel, bd as transportStreamData } from './backoff-yR9l2-dr.mjs';
|
|
2
2
|
import 'yjs';
|
|
3
3
|
import 'y-protocols/awareness';
|
|
4
4
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { a as AccessTokenOptions, e as AllocateSessionOptions, f as AllocatedSession, m as ChannelMessage, n as ChannelMultiplexer, o as ChannelName, r as DOC_SYNC_WIRE_CONTRACT_VERSION, s as DeferredChannelMultiplexer, t as DeferredDocConnector, w as DocConnection, x as DocConnectionState, y as DocConnector, z as DocServerUrlResolver, E as DocTokenSupplier, L as LoopbackStreamData, ai as SessionDocumentImpl, ap as SessionStartOptions, aB as StreamDataTransport, aG as TransportSession, aH as TransportSessionOptions, aX as allocateSession, aY as computeBackoffDelay, a_ as createPresence, a$ as createWebsocketDocConnector, b1 as deriveYjsServerUrl, bc as streamDataLabel, bd as transportStreamData } from './backoff-
|
|
1
|
+
export { a as AccessTokenOptions, e as AllocateSessionOptions, f as AllocatedSession, m as ChannelMessage, n as ChannelMultiplexer, o as ChannelName, r as DOC_SYNC_WIRE_CONTRACT_VERSION, s as DeferredChannelMultiplexer, t as DeferredDocConnector, w as DocConnection, x as DocConnectionState, y as DocConnector, z as DocServerUrlResolver, E as DocTokenSupplier, L as LoopbackStreamData, ai as SessionDocumentImpl, ap as SessionStartOptions, aB as StreamDataTransport, aG as TransportSession, aH as TransportSessionOptions, aX as allocateSession, aY as computeBackoffDelay, a_ as createPresence, a$ as createWebsocketDocConnector, b1 as deriveYjsServerUrl, bc as streamDataLabel, bd as transportStreamData } from './backoff-yR9l2-dr.js';
|
|
2
2
|
import 'yjs';
|
|
3
3
|
import 'y-protocols/awareness';
|
|
4
4
|
|