@popmelt.com/core 0.41.1 → 0.41.2
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/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/codex-plugin/assets/popmelt-logo.svg +1 -1
- package/dist/{ExploreAttachment-PTK4YHVE.mjs → ExploreAttachment-GTHGWP6E.mjs} +1 -1
- package/dist/PagePreviewLayer-FHYXOFOZ.mjs +1 -0
- package/dist/{ParticipantRuntime-ELXK42P7.mjs → ParticipantRuntime-NY7N7HFZ.mjs} +1 -1
- package/dist/PhoneHostGate-RXW6DVQD.mjs +1 -0
- package/dist/PopmeltTasteConnectedPane-6T3F6ZNL.mjs +1 -0
- package/dist/{QueuedReplies-ESF5UL3J.mjs → QueuedReplies-U7GLT6QK.mjs} +1 -1
- package/dist/{ShareProjectPane-P5HAKBKX.mjs → ShareProjectPane-AFQS4SEM.mjs} +1 -1
- package/dist/{SuppliedContext-ADMN2D2I.mjs → SuppliedContext-V62BO3EY.mjs} +1 -1
- package/dist/{ThreadErrorCard-QGTWIV7B.mjs → ThreadErrorCard-L7F7VX6H.mjs} +1 -1
- package/dist/ThreadPanel-ZXEPKB2P.mjs +1 -0
- package/dist/bridge-entry.mjs +1 -1
- package/dist/{bridgeSSEStream-2KKFO64A.mjs → bridgeSSEStream-AUMOLOCC.mjs} +1 -1
- package/dist/{bridgeWebSocketStream-XTHQPBPI.mjs → bridgeWebSocketStream-PE5XBFAM.mjs} +1 -1
- package/dist/{browser-runtime-OWU4CMJB.mjs → browser-runtime-FFURXKEP.mjs} +1 -1
- package/dist/browser.mjs +1 -1
- package/dist/canvas-chat-note-RGALD6IH.mjs +1 -0
- package/dist/{checkFixture-VWHN4ZNH.mjs → checkFixture-ZD5UD7OR.mjs} +1 -1
- package/dist/{chunk-P6XIVHP5.mjs → chunk-2B62TYAL.mjs} +1 -1
- package/dist/{chunk-VJKC2RJB.mjs → chunk-2EQSGPAN.mjs} +1 -1
- package/dist/{chunk-SHIN4R4V.mjs → chunk-2IPPW6IP.mjs} +1 -1
- package/dist/{chunk-ENXCO63D.mjs → chunk-3IS5RGG6.mjs} +1 -1
- package/dist/{chunk-SIGOY5GG.mjs → chunk-44KCB7YO.mjs} +1 -1
- package/dist/chunk-4XBW5E6L.mjs +1 -0
- package/dist/{chunk-WP44H6DL.mjs → chunk-5GQXAV54.mjs} +2 -2
- package/dist/{chunk-YHCZYT4T.mjs → chunk-63F7KX4E.mjs} +1 -1
- package/dist/{chunk-YG3RSK5J.mjs → chunk-6VZCE37E.mjs} +1 -1
- package/dist/chunk-7NXVLIDS.mjs +1 -0
- package/dist/{chunk-SMIEQSM5.mjs → chunk-7XGXFP5L.mjs} +1 -1
- package/dist/{chunk-SZQTGYPS.mjs → chunk-B5NNYNRA.mjs} +1 -1
- package/dist/{chunk-G7UU6M76.mjs → chunk-BDSIJTX5.mjs} +1 -1
- package/dist/{chunk-3UE2DLFY.mjs → chunk-BWBGZZG7.mjs} +1 -1
- package/dist/{chunk-VI3DNZM4.mjs → chunk-DLXTHDBS.mjs} +1 -1
- package/dist/{chunk-HFKGW34E.mjs → chunk-EKRMVMQ4.mjs} +1 -1
- package/dist/{chunk-GYKRKAEF.mjs → chunk-FLHUSWSY.mjs} +1 -1
- package/dist/{chunk-FQH24XFS.mjs → chunk-FQRYGTZ3.mjs} +1 -1
- package/dist/{chunk-5TCWBNV4.mjs → chunk-JXXK3Z5E.mjs} +1 -1
- package/dist/{chunk-YTMUAK4P.mjs → chunk-KNMBEVHX.mjs} +1 -1
- package/dist/{chunk-DMKBAI2Z.mjs → chunk-KYOD2RVN.mjs} +1 -1
- package/dist/{chunk-IC4G3NXR.mjs → chunk-MBEFYXSZ.mjs} +1 -1
- package/dist/{chunk-77DD4HQE.mjs → chunk-OTMGCIRL.mjs} +1 -1
- package/dist/{chunk-VSWRWS2H.mjs → chunk-P5ESNJTD.mjs} +1 -1
- package/dist/chunk-QRFIQC2P.mjs +1 -0
- package/dist/{chunk-7D4BUDKG.mjs → chunk-SHYAV76M.mjs} +1 -1
- package/dist/{chunk-FAEFYWCY.mjs → chunk-TNVYP6S4.mjs} +1 -1
- package/dist/{chunk-EWNSX5BF.mjs → chunk-VTOLKIBD.mjs} +1 -1
- package/dist/chunk-WMCWSV2W.mjs +1 -0
- package/dist/chunk-WVGFWHL3.mjs +1 -0
- package/dist/{chunk-LZV3IYTM.mjs → chunk-YIKAZQRM.mjs} +1 -1
- package/dist/cli.mjs +1 -1
- package/dist/codex-note-context-ECY4QU74.mjs +1 -0
- package/dist/{codex-project-YSALZU44.mjs → codex-project-J7C4YAM2.mjs} +1 -1
- package/dist/{codex-store-mount-VHUHC2ZA.mjs → codex-store-mount-FPS3CDO4.mjs} +1 -1
- package/dist/dev-server-5CHO7PTQ.mjs +1 -0
- package/dist/guest-admission.mjs +1 -1
- package/dist/guest-live-canvas.mjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{page-interaction-74JGNCZ5.mjs → page-interaction-ZXM6ZLL4.mjs} +1 -1
- package/dist/{peer-client-TSTD27DV.mjs → peer-client-4WNS5XZ4.mjs} +1 -1
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-nuxt.mjs +1 -1
- package/dist/plugin-vite.mjs +1 -1
- package/dist/server.mjs +1 -1
- package/dist/shared-page-3AVCYUOT.mjs +1 -0
- package/package.json +1 -1
- package/dist/PagePreviewLayer-HMKZL5VB.mjs +0 -1
- package/dist/PhoneHostGate-5S2WCM3W.mjs +0 -1
- package/dist/PopmeltTasteConnectedPane-BILMI6L2.mjs +0 -1
- package/dist/ThreadPanel-Z76WNKPP.mjs +0 -1
- package/dist/canvas-chat-note-XMVKWL2J.mjs +0 -1
- package/dist/chunk-HM6EBJVO.mjs +0 -1
- package/dist/chunk-ITLRSHNZ.mjs +0 -1
- package/dist/chunk-J3IPAD7E.mjs +0 -1
- package/dist/chunk-OEJXPUAR.mjs +0 -1
- package/dist/chunk-TRRNHBEH.mjs +0 -1
- package/dist/codex-note-context-PM4TA6WR.mjs +0 -1
- package/dist/dev-server-KE4NM4WM.mjs +0 -1
- package/dist/shared-page-6AUYAPJ3.mjs +0 -1
- /package/dist/{chunk-DPLSL33X.mjs → chunk-RG2CK6VE.mjs} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as e,b as t,c as r}from"./chunk-VJKC2RJB.mjs";import"./chunk-PCUUOIFD.mjs";import{a,b as i}from"./chunk-YHCZYT4T.mjs";import{a as n}from"./chunk-ITLRSHNZ.mjs";import{b as s}from"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-GLF7Z5IR.mjs";import"./chunk-KD2AOPYP.mjs";import"./chunk-KF73S7MG.mjs";import{execFile as o}from"child_process";import{createHash as l,randomBytes as c}from"crypto";import{mkdir as p,mkdtemp as u,readFile as f,readdir as m,realpath as d,rm as h,stat as g}from"fs/promises";import{extname as w,join as y,relative as v,resolve as b,sep as x}from"path";import{promisify as S}from"util";import{parse as E,serialize as R}from"parse5";var j=S(o),N=33554432,L=(e,t)=>e.attrs.find(e=>e.name===t)?.value;async function k(o,S,k,A,P){let T=async(e,t,r)=>{let n=new URL(k,t),o=await fetch(n,{redirect:"manual",headers:{Accept:"text/html"},signal:AbortSignal.timeout(15e3)});if(200!==o.status||!o.headers.get("content-type")?.includes("text/html"))throw await(o.body?.cancel()),Error("Page unavailable");return async function(e,t,r,n,o){let p=c(18).toString("base64"),u=Buffer.byteLength(r);if(u>N)throw Error("Shared page exceeds the preview size limit");async function h(r,a,s){let l=new URL(r,a);if(l.origin!==t.origin||l.username||l.password)return;let c=decodeURIComponent(l.pathname);if(c.split("/").some(e=>e.startsWith(".")||"node_modules"===e)||/[\\%?#]/.test(c)||i(c)||!s.has(w(c).toLowerCase()))return;let p="next"===n&&c.startsWith("/_next/static/"),m=p?y(e,".next","static"):o,h=b(m,"."+(p?c.slice(13):c));if(h.startsWith(m+x))try{if(await d(h)!==h)return;let e=await g(h);if(!e.isFile()||e.size>N-u)throw Error("Shared page exceeds the preview size limit");return u+=e.size,{data:await f(h),url:l}}catch(e){if("ENOENT"!==e.code)throw e}}let v=new Set(Object.keys(a).filter(e=>".css"!==e)),S=new Set,j=Object.create(null),k=async(e,r)=>{if(e.startsWith("data:"))return e;let i=new URL(e,r);if(i.origin===t.origin&&j[i.pathname])return j[i.pathname];let n=await h(e,r,v),s=n?"data:"+a[w(n.url.pathname).toLowerCase()]+";base64,"+n.data.toString("base64"):"";return s.startsWith("data:image/")&&(j[i.pathname]=s),s};async function A(e,t){let r=/url\(\s*(['"]?)([^)'"]+)\1\s*\)/gi,a=0,i="";for(let n of e.matchAll(r))n[2].startsWith("#")||(i+=e.slice(a,n.index)+"url("+JSON.stringify(await k(n[2].trim(),t))+")",a=n.index+n[0].length);return i+e.slice(a)}let P=E(r);function T(e,t){e.childNodes=[{nodeName:"#text",value:t,parentNode:e}]}let _=new Set,I=new Set,U=new Set,H=new Set([".js",".mjs"]);function z(e){_.add(e.url.pathname);let t=e.data.toString();for(let e of t.matchAll(/["'](\/(?:[A-Za-z0-9_.%~-]+\/)*[A-Za-z0-9_.%~-]+\.(?:png|jpe?g|gif|webp|avif|svg|ico))["']/gi))S.add(e[1]);for(let e of t.matchAll(/["'](?:\/_next\/)?(static\/chunks\/[\w./%-]+\.js)["']/g))I.add("/_next/"+e[1]);for(let e of t.matchAll(/\b[\w$]+\.e\((\d+)\)/g))U.add(e[1]);return('if(document.currentScript)document.currentScript.setAttribute("src",'+JSON.stringify(e.url.pathname).replace(/</g,"\\u003c")+");\n"+t).replace(/<\/script/gi,"<\\/script")}let D=function(e,t){let r="popmelt-module:/",a=new Map,i=new Map,n=new Map,s=new Map;function o(t,r){if(r&&"object"==typeof r)for(let[a,i]of Object.entries(r)){let r=/^(?:\.{0,2}\/|https?:)/.test(a)?new URL(a,e).href:a;t.has(r)||t.set(r,"string"==typeof i?new URL(i,e).href:null)}}function l(e,t){if(e.has(t))return e.get(t);let r=[...e.keys()].filter(e=>e.endsWith("/")&&t.startsWith(e)).sort((e,t)=>t.length-e.length)[0];if(r){let a=e.get(r);return a?.endsWith("/")?a+t.slice(r.length):null}}function c(t){let i=new URL(t,e).href,n=a.get(i)??"entry-"+a.size;return a.set(i,n),r+n+".js"}return{entry:c,importMap(t){let r=JSON.parse(t);o(n,r.imports);for(let[t,a]of Object.entries(r.scopes??{})){let r=new URL(t,e).href,i=s.get(r)??new Map;o(i,a),s.set(r,i)}},inline(t){let r=new URL(e);return r.hash="inline-"+i.size,i.set(r.href,t),c(r.href)},async compile(){if(!a.size)return;let o={name:"invited-page-modules",setup(r){r.onResolve({filter:/.*/},t=>{let r,a=t.importer||e.href,i=/^(?:\.{0,2}\/|https?:\/\/)/.test(t.path),o=i?new URL(t.path,a).href:t.path;if("entry-point"!==t.kind){for(let e of[...s.keys()].filter(e=>a===e||e.endsWith("/")&&a.startsWith(e)).sort((e,t)=>t.length-e.length))if(r=l(s.get(e),o),void 0!==r)break;void 0===r&&(r=l(n,o))}if(null===r||!i&&!r)return{external:!0};let c=new URL(r??o);return c.origin!==e.origin?{path:c.href,external:!0}:{path:c.href,namespace:"page"}}),r.onLoad({filter:/.*/,namespace:"page"},async({path:r})=>{let a=i.get(r)??(await t(r,e))?.data.toString();if(void 0===a)throw new Error("Invited page module unavailable");return{contents:a,loader:"js"}})}},{build:c}=await(import("esbuild")),p=await c({entryPoints:[...a].map(([e,t])=>({in:e,out:t})),bundle:!0,splitting:!0,format:"esm",platform:"browser",publicPath:r,write:!1,outdir:"/",logLevel:"silent",legalComments:"none",minify:!0,plugins:[o]});return Object.fromEntries(p.outputFiles.map(e=>[r+e.path.split(/[\\/]/).pop(),"data:text/javascript;base64,"+Buffer.from(e.contents).toString("base64")]))}}}(t,(e,t)=>h(e,t,H)),W=new Set;await async function e(r){let a=[];for(let i of r.childNodes){if("tagName"in i){let r=i.tagName;if(["base","iframe","frame","embed","object"].includes(r)||"meta"===r&&L(i,"http-equiv"))continue;if("html"===n)for(let e of i.attrs)/^on[a-z]+$/.test(e.name)&&W.add("'sha256-"+l("sha256").update(e.value).digest("base64")+"'");if("astro"===n&&"astro-island"===r)for(let e of i.attrs)["component-url","renderer-url","before-hydration-url"].includes(e.name)&&e.value&&(e.value=D.entry(e.value));if("script"===r){let e=()=>i.childNodes.map(e=>"value"in e?e.value:"").join("");if("next"!==n&&"importmap"===L(i,"type")){D.importMap(e());continue}let r,a=L(i,"src");if("next"!==n&&"module"===L(i,"type")){let t=a?D.entry(a):D.inline(e());T(i,"import "+JSON.stringify(t)+";")}else if(a){if(void 0!==L(i,"nomodule"))continue;let e=await h(a,t,H);if(!e)continue;"next"===n?T(i,z(e)):r="data:text/javascript;base64,"+e.data.toString("base64")}i.attrs=i.attrs.filter(e=>["type","id","async","defer"].includes(e.name)||e.name.startsWith("data-")),r&&i.attrs.push({name:"src",value:r}),i.attrs.push({name:"nonce",value:p})}else if("link"===r){if("stylesheet"!==L(i,"rel"))continue;let e=await h(L(i,"href")??"",t,new Set([".css"]));if(!e)continue;i.tagName=i.nodeName="style",i.attrs=[],T(i,(await A(e.data.toString(),e.url)).replace(/<\/style/gi,"<\\/style"))}else if("style"===r)for(let e of i.childNodes)"value"in e&&(e.value=(await A(e.value,t)).replace(/<\/style/gi,"<\\/style"));else if("img"===r){let e=L(i,"src")??"";e.startsWith("/_next/image?")&&(e=new URL(e,t).searchParams.get("url")??""),i.attrs=i.attrs.filter(e=>"src"!==e.name&&"srcset"!==e.name),e&&(await k(e,t),i.attrs.push({name:"src",value:e}))}await e(i)}a.push(i)}r.childNodes=a}(P);let F=[],J=await D.compile();J&&F.push('<script type="importmap" nonce="'+p+'">'+JSON.stringify({imports:J})+"<\/script>");let B=U.size?await m(y(e,".next","static","chunks")):[],C=new Map;for(let e of B){let t=/^(\d+)[.-][\w.-]+\.js$/.exec(e);if(t){let r=t[1],a=C.get(r)??[];a.push("/_next/static/chunks/"+e),C.set(r,a)}}let q=()=>{for(let e of U)for(let t of C.get(e)??[])I.add(t);U.clear()};q();for(let e of I){if(_.has(e))continue;let r=await h(e,t,H);r&&F.push('<script nonce="'+p+'">'+z(r)+"<\/script>"),q()}for(let e of S)await k(e,t);let K="("+O.toString()+")("+JSON.stringify(j).replace(/</g,"\\u003c")+","+JSON.stringify(t.pathname).replace(/</g,"\\u003c")+");",Y=Buffer.from(await s("live-canvas")).toString().replace(/<\/script/gi,"<\\/script");return{body:R(P).replace(/<head(?: [^>]*)?>/i,e=>e+'<meta name="popmelt-live-canvas" content="1"><script nonce="'+p+'">('+M.toString()+")();"+K+"\n"+Y+"<\/script>"+F.join("")),policy:"sandbox allow-scripts; default-src 'none'; script-src 'nonce-"+p+"'"+(J?" data:":"")+(W.size?"; script-src-attr 'unsafe-hashes' "+[...W].join(" "):"")+"; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; form-action 'none'; base-uri 'none'; frame-ancestors 'self'"}}(e,n,await o.text(),A,r)};if("html"===A){let e=await r(o,A,o,void 0,{});try{return await T(o,e.origin,o)}finally{await e.close()}}let _=y(o,".popmelt");await p(_,{recursive:!0});let I,U=await u(y(_,"interact-"));try{let a=await(await n(o,U)).capture(),i=async e=>(await j("git",e,{cwd:o,env:{...process.env,GIT_INDEX_FILE:y(U,"index")}})).stdout.trim(),s=await i(["rev-parse","--show-toplevel"]),l=y(U,"checkout");await j("git",["init","--quiet","--template=",l]),await i(["read-tree",a]),await i(["-C",s,"checkout-index","--all","--prefix="+l+x]);let c=y(l,v(s,o)),{cli:p}=await t(o,A),u="next"===A?await e(S):{},f="nuxt"===A?["--input-type=module","-e","\nimport { loadNuxt, buildNuxt } from 'nuxt/kit';\nimport { createRequire } from 'node:module';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nconst require = createRequire(import.meta.url);\nconst routerPath = createRequire(require.resolve('nuxt/package.json')).resolve('vue-router');\nconst { createMemoryHistory, createRouter } = await import(routerPath);\nconst route = process.argv[1];\nconst options = resolve('.popmelt-router.mjs');\nawait writeFile(options, 'import { createMemoryHistory } from ' + JSON.stringify(routerPath) +\n ';export default { history: () => createMemoryHistory() };');\nconst nuxt = await loadNuxt({ cwd: process.cwd(), dev: false, overrides: {\n nitro: { preset: 'node-server' }, experimental: { appManifest: false, payloadExtraction: false },\n vite: { build: { modulePreload: false } },\n hooks: {\n 'pages:routerOptions'({files}) { files.push({path: options}); },\n 'pages:resolved'(pages) {\n if (!pages.length) return;\n const record = page => ({ path: page.path, alias: page.alias ?? [],\n component: {}, meta: { page }, children: (page.children || []).map(record) });\n const router = createRouter({ history: createMemoryHistory(), routes: pages.map(record) });\n const selected = new Set(router.resolve(route).matched.map(r => r.meta.page));\n const trim = list => {\n for (let i = list.length - 1; i >= 0; i--) {\n const page = list[i];\n if (!selected.has(page)) list.splice(i, 1);\n else if (page.children) trim(page.children);\n }\n };\n trim(pages);\n },\n },\n}});\ntry { await buildNuxt(nuxt); } finally { await nuxt.close(); }\n",k]:[p,"build",..."next"===A?[...P?[P]:[],"--experimental-build-mode","compile"]:[]];await j(process.execPath,f,{cwd:c,timeout:18e4,maxBuffer:8388608,env:{...u,PATH:process.env.PATH,HOME:process.env.HOME,TMPDIR:process.env.TMPDIR,SystemRoot:process.env.SystemRoot,CI:"1",NODE_ENV:"production",NEXT_TELEMETRY_DISABLED:"1",ASTRO_TELEMETRY_DISABLED:"1",NUXT_TELEMETRY_DISABLED:"1",POPMELT_PLANE_RENDERER:"1"}}),I=await r(c,A,s,void 0,u,!0);let m=y(c,"nuxt"===A?".output/public":"astro"===A?(await g(y(c,"dist/client")).catch(()=>{}))?.isDirectory()?"dist/client":"dist":"public");return await T(c,I.origin,m)}finally{try{await(I?.close())}finally{await h(U,{recursive:!0,force:!0,maxRetries:3})}}}function M(){Object.defineProperty(navigator,"locks",{value:void 0});let e=new Map;Object.defineProperty(document,"cookie",{get:()=>Array.from(e,([e,t])=>e+"="+t).join("; "),set:t=>{let[r,...a]=String(t).split(";"),i=r.indexOf("=");if(i<1)return;let n=r.slice(0,i).trim();a.some(e=>/^\s*max-age=0\s*$/i.test(e))?e.delete(n):e.set(n,r.slice(i+1))}});for(let e of["localStorage","sessionStorage"]){let t=new Map;Object.defineProperty(window,e,{value:{get length(){return t.size},key:e=>Array.from(t.keys())[e]??null,getItem:e=>t.get(String(e))??null,setItem:(e,r)=>{t.set(String(e),String(r))},removeItem:e=>{t.delete(String(e))},clear:()=>t.clear()}})}}function O(e,t){let r=new URL(t,location.href);function a(t){if(t&&!t.startsWith("data:"))try{let a=new URL(t,r);if(a.origin!==r.origin)return;if("/_next/image"===a.pathname&&(a=new URL(a.searchParams.get("url")??"",r)),a.origin===r.origin)return e[a.pathname]}catch{}}function i(e){if(e instanceof HTMLImageElement){let t=a(e.getAttribute("src")??"");t&&(e.removeAttribute("srcset"),e.src=t)}else if(e instanceof HTMLVideoElement){let t=a(e.getAttribute("poster")??"");t&&(e.poster=t)}}new MutationObserver(e=>{for(let t of e)if("attributes"===t.type)i(t.target);else for(let e of t.addedNodes)e instanceof Element&&(i(e),e.querySelectorAll("img,video[poster]").forEach(i))}).observe(document,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["src","poster","srcset"]})}function A(e,t,r,a){let i,n="";return async(s,o)=>{let l=o+"\n"+s;for(;i&&n!==l;){let e=i;await e.catch(()=>{}),i===e&&(i=void 0)}if(!i||n!==l){n=l;let o=k(e,t,s,r,a);i=o,o.catch(()=>{i===o&&(i=void 0)})}return i}}export{A as pageInteraction};
|
|
1
|
+
import{a as e,b as t,c as r}from"./chunk-2EQSGPAN.mjs";import"./chunk-PCUUOIFD.mjs";import{a,b as i}from"./chunk-63F7KX4E.mjs";import{a as n}from"./chunk-WVGFWHL3.mjs";import{b as s}from"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-GLF7Z5IR.mjs";import"./chunk-KD2AOPYP.mjs";import"./chunk-KF73S7MG.mjs";import{execFile as o}from"child_process";import{createHash as l,randomBytes as c}from"crypto";import{mkdir as p,mkdtemp as u,readFile as f,readdir as m,realpath as d,rm as h,stat as g}from"fs/promises";import{extname as w,join as y,relative as v,resolve as b,sep as x}from"path";import{promisify as S}from"util";import{parse as E,serialize as j}from"parse5";var N=S(o),R=33554432,L=(e,t)=>e.attrs.find(e=>e.name===t)?.value;async function k(o,S,k,A,P){let _=async(e,t,r)=>{let n=new URL(k,t),o=await fetch(n,{redirect:"manual",headers:{Accept:"text/html"},signal:AbortSignal.timeout(15e3)});if(200!==o.status||!o.headers.get("content-type")?.includes("text/html"))throw await(o.body?.cancel()),Error("Page unavailable");return async function(e,t,r,n,o){let p=c(18).toString("base64"),u=Buffer.byteLength(r);if(u>R)throw Error("Shared page exceeds the preview size limit");async function h(r,a,s){let l=new URL(r,a);if(l.origin!==t.origin||l.username||l.password)return;let c=decodeURIComponent(l.pathname);if(c.split("/").some(e=>e.startsWith(".")||"node_modules"===e)||/[\\%?#]/.test(c)||i(c)||!s.has(w(c).toLowerCase()))return;let p="next"===n&&c.startsWith("/_next/static/"),m=p?y(e,".next","static"):o,h=b(m,"."+(p?c.slice(13):c));if(h.startsWith(m+x))try{if(await d(h)!==h)return;let e=await g(h);if(!e.isFile()||e.size>R-u)throw Error("Shared page exceeds the preview size limit");return u+=e.size,{data:await f(h),url:l}}catch(e){if("ENOENT"!==e.code)throw e}}let v=new Set(Object.keys(a).filter(e=>".css"!==e)),S=new Set,N=Object.create(null),k=async(e,r)=>{if(e.startsWith("data:"))return e;let i=new URL(e,r);if(i.origin===t.origin&&N[i.pathname])return N[i.pathname];let n=await h(e,r,v),s=n?"data:"+a[w(n.url.pathname).toLowerCase()]+";base64,"+n.data.toString("base64"):"";return s.startsWith("data:image/")&&(N[i.pathname]=s),s};async function A(e,t){let r=/url\(\s*(['"]?)([^)'"]+)\1\s*\)/gi,a=0,i="";for(let n of e.matchAll(r))n[2].startsWith("#")||(i+=e.slice(a,n.index)+"url("+JSON.stringify(await k(n[2].trim(),t))+")",a=n.index+n[0].length);return i+e.slice(a)}let P=E(r);function _(e,t){e.childNodes=[{nodeName:"#text",value:t,parentNode:e}]}let I=new Set,U=new Set,T=new Set,W=new Set([".js",".mjs"]);function z(e){I.add(e.url.pathname);let t=e.data.toString();for(let e of t.matchAll(/["'](\/(?:[A-Za-z0-9_.%~-]+\/)*[A-Za-z0-9_.%~-]+\.(?:png|jpe?g|gif|webp|avif|svg|ico))["']/gi))S.add(e[1]);for(let e of t.matchAll(/["'](?:\/_next\/)?(static\/chunks\/[\w./%-]+\.js)["']/g))U.add("/_next/"+e[1]);for(let e of t.matchAll(/\b[\w$]+\.e\((\d+)\)/g))T.add(e[1]);return('if(document.currentScript)document.currentScript.setAttribute("src",'+JSON.stringify(e.url.pathname).replace(/</g,"\\u003c")+");\n"+t).replace(/<\/script/gi,"<\\/script")}let D=function(e,t){let r="popmelt-module:/",a=new Map,i=new Map,n=new Map,s=new Map;function o(t,r){if(r&&"object"==typeof r)for(let[a,i]of Object.entries(r)){let r=/^(?:\.{0,2}\/|https?:)/.test(a)?new URL(a,e).href:a;t.has(r)||t.set(r,"string"==typeof i?new URL(i,e).href:null)}}function l(e,t){if(e.has(t))return e.get(t);let r=[...e.keys()].filter(e=>e.endsWith("/")&&t.startsWith(e)).sort((e,t)=>t.length-e.length)[0];if(r){let a=e.get(r);return a?.endsWith("/")?a+t.slice(r.length):null}}function c(t){let i=new URL(t,e).href,n=a.get(i)??"entry-"+a.size;return a.set(i,n),r+n+".js"}return{entry:c,importMap(t){let r=JSON.parse(t);o(n,r.imports);for(let[t,a]of Object.entries(r.scopes??{})){let r=new URL(t,e).href,i=s.get(r)??new Map;o(i,a),s.set(r,i)}},inline(t){let r=new URL(e);return r.hash="inline-"+i.size,i.set(r.href,t),c(r.href)},async compile(){if(!a.size)return;let o={name:"invited-page-modules",setup(r){r.onResolve({filter:/.*/},t=>{let r,a=t.importer||e.href,i=/^(?:\.{0,2}\/|https?:\/\/)/.test(t.path),o=i?new URL(t.path,a).href:t.path;if("entry-point"!==t.kind){for(let e of[...s.keys()].filter(e=>a===e||e.endsWith("/")&&a.startsWith(e)).sort((e,t)=>t.length-e.length))if(r=l(s.get(e),o),void 0!==r)break;void 0===r&&(r=l(n,o))}if(null===r||!i&&!r)return{external:!0};let c=new URL(r??o);return c.origin!==e.origin?{path:c.href,external:!0}:{path:c.href,namespace:"page"}}),r.onLoad({filter:/.*/,namespace:"page"},async({path:r})=>{let a=i.get(r)??(await t(r,e))?.data.toString();if(void 0===a)throw new Error("Invited page module unavailable");return{contents:a,loader:"js"}})}},{build:c}=await(import("esbuild")),p=await c({entryPoints:[...a].map(([e,t])=>({in:e,out:t})),bundle:!0,splitting:!0,format:"esm",platform:"browser",publicPath:r,write:!1,outdir:"/",logLevel:"silent",legalComments:"none",minify:!0,plugins:[o]});return Object.fromEntries(p.outputFiles.map(e=>[r+e.path.split(/[\\/]/).pop(),"data:text/javascript;base64,"+Buffer.from(e.contents).toString("base64")]))}}}(t,(e,t)=>h(e,t,W)),F=new Set;await async function e(r){let a=[];for(let i of r.childNodes){if("tagName"in i){let r=i.tagName;if(["base","iframe","frame","embed","object"].includes(r)||"meta"===r&&L(i,"http-equiv"))continue;if("html"===n)for(let e of i.attrs)/^on[a-z]+$/.test(e.name)&&F.add("'sha256-"+l("sha256").update(e.value).digest("base64")+"'");if("astro"===n&&"astro-island"===r)for(let e of i.attrs)["component-url","renderer-url","before-hydration-url"].includes(e.name)&&e.value&&(e.value=D.entry(e.value));if("script"===r){let e=()=>i.childNodes.map(e=>"value"in e?e.value:"").join("");if("next"!==n&&"importmap"===L(i,"type")){D.importMap(e());continue}let r,a=L(i,"src");if("next"!==n&&"module"===L(i,"type")){let t=a?D.entry(a):D.inline(e());_(i,"import "+JSON.stringify(t)+";")}else if(a){if(void 0!==L(i,"nomodule"))continue;let e=await h(a,t,W);if(!e)continue;"next"===n?_(i,z(e)):r="data:text/javascript;base64,"+e.data.toString("base64")}i.attrs=i.attrs.filter(e=>["type","id","async","defer"].includes(e.name)||e.name.startsWith("data-")),r&&i.attrs.push({name:"src",value:r}),i.attrs.push({name:"nonce",value:p})}else if("link"===r){if("stylesheet"!==L(i,"rel"))continue;let e=await h(L(i,"href")??"",t,new Set([".css"]));if(!e)continue;i.tagName=i.nodeName="style",i.attrs=[],_(i,(await A(e.data.toString(),e.url)).replace(/<\/style/gi,"<\\/style"))}else if("style"===r)for(let e of i.childNodes)"value"in e&&(e.value=(await A(e.value,t)).replace(/<\/style/gi,"<\\/style"));else if("img"===r){let e=L(i,"src")??"";e.startsWith("/_next/image?")&&(e=new URL(e,t).searchParams.get("url")??""),i.attrs=i.attrs.filter(e=>"src"!==e.name&&"srcset"!==e.name),e&&(await k(e,t),i.attrs.push({name:"src",value:e}))}await e(i)}a.push(i)}r.childNodes=a}(P);let H=[],B=await D.compile();B&&H.push('<script type="importmap" nonce="'+p+'">'+JSON.stringify({imports:B})+"<\/script>");let J=T.size?await m(y(e,".next","static","chunks")):[],q=new Map;for(let e of J){let t=/^(\d+)[.-][\w.-]+\.js$/.exec(e);if(t){let r=t[1],a=q.get(r)??[];a.push("/_next/static/chunks/"+e),q.set(r,a)}}let C=()=>{for(let e of T)for(let t of q.get(e)??[])U.add(t);T.clear()};C();for(let e of U){if(I.has(e))continue;let r=await h(e,t,W);r&&H.push('<script nonce="'+p+'">'+z(r)+"<\/script>"),C()}for(let e of S)await k(e,t);let K="("+O.toString()+")("+JSON.stringify(N).replace(/</g,"\\u003c")+","+JSON.stringify(t.pathname).replace(/</g,"\\u003c")+");",G=Buffer.from(await s("live-canvas")).toString().replace(/<\/script/gi,"<\\/script");return{body:j(P).replace(/<head(?: [^>]*)?>/i,e=>e+'<meta name="popmelt-live-canvas" content="1"><script nonce="'+p+'">('+M.toString()+")();"+K+"\n"+G+"<\/script>"+H.join("")),policy:"sandbox allow-scripts; default-src 'none'; script-src 'nonce-"+p+"'"+(B?" data:":"")+(F.size?"; script-src-attr 'unsafe-hashes' "+[...F].join(" "):"")+"; style-src 'unsafe-inline'; img-src data:; font-src data:; connect-src 'none'; form-action 'none'; base-uri 'none'; frame-ancestors 'self'"}}(e,n,await o.text(),A,r)};if("html"===A){let e=await r(o,A,o,void 0,{});try{return await _(o,e.origin,o)}finally{await e.close()}}let I=y(o,".popmelt");await p(I,{recursive:!0});let U,T=await u(y(I,"interact-"));try{let a=await(await n(o,T)).capture(),i=async e=>(await N("git",e,{cwd:o,env:{...process.env,GIT_INDEX_FILE:y(T,"index")}})).stdout.trim(),s=await i(["rev-parse","--show-toplevel"]),l=y(T,"checkout");await N("git",["init","--quiet","--template=",l]),await i(["read-tree",a]),await i(["-C",s,"checkout-index","--all","--prefix="+l+x]);let c=y(l,v(s,o)),{cli:p}=await t(o,A),u="next"===A?await e(S):{},f="nuxt"===A?["--input-type=module","-e","\nimport { loadNuxt, buildNuxt } from 'nuxt/kit';\nimport { createRequire } from 'node:module';\nimport { writeFile } from 'node:fs/promises';\nimport { resolve } from 'node:path';\nconst require = createRequire(import.meta.url);\nconst routerPath = createRequire(require.resolve('nuxt/package.json')).resolve('vue-router');\nconst { createMemoryHistory, createRouter } = await import(routerPath);\nconst route = process.argv[1];\nconst options = resolve('.popmelt-router.mjs');\nawait writeFile(options, 'import { createMemoryHistory } from ' + JSON.stringify(routerPath) +\n ';export default { history: () => createMemoryHistory() };');\nconst nuxt = await loadNuxt({ cwd: process.cwd(), dev: false, overrides: {\n nitro: { preset: 'node-server' }, experimental: { appManifest: false, payloadExtraction: false },\n vite: { build: { modulePreload: false } },\n hooks: {\n 'pages:routerOptions'({files}) { files.push({path: options}); },\n 'pages:resolved'(pages) {\n if (!pages.length) return;\n const record = page => ({ path: page.path, alias: page.alias ?? [],\n component: {}, meta: { page }, children: (page.children || []).map(record) });\n const router = createRouter({ history: createMemoryHistory(), routes: pages.map(record) });\n const selected = new Set(router.resolve(route).matched.map(r => r.meta.page));\n const trim = list => {\n for (let i = list.length - 1; i >= 0; i--) {\n const page = list[i];\n if (!selected.has(page)) list.splice(i, 1);\n else if (page.children) trim(page.children);\n }\n };\n trim(pages);\n },\n },\n}});\ntry { await buildNuxt(nuxt); } finally { await nuxt.close(); }\n",k]:[p,"build",..."next"===A?[...P?[P]:[],"--experimental-build-mode","compile"]:[]];await N(process.execPath,f,{cwd:c,timeout:18e4,maxBuffer:8388608,env:{...u,PATH:process.env.PATH,HOME:process.env.HOME,TMPDIR:process.env.TMPDIR,SystemRoot:process.env.SystemRoot,CI:"1",NODE_ENV:"production",NEXT_TELEMETRY_DISABLED:"1",ASTRO_TELEMETRY_DISABLED:"1",NUXT_TELEMETRY_DISABLED:"1",POPMELT_PLANE_RENDERER:"1"}}),U=await r(c,A,s,void 0,u,!0);let m=y(c,"nuxt"===A?".output/public":"astro"===A?(await g(y(c,"dist/client")).catch(()=>{}))?.isDirectory()?"dist/client":"dist":"public");return await _(c,U.origin,m)}finally{try{await(U?.close())}finally{await h(T,{recursive:!0,force:!0,maxRetries:3})}}}function M(){Object.defineProperty(navigator,"locks",{value:void 0});let e=new Map;Object.defineProperty(document,"cookie",{get:()=>Array.from(e,([e,t])=>e+"="+t).join("; "),set:t=>{let[r,...a]=String(t).split(";"),i=r.indexOf("=");if(i<1)return;let n=r.slice(0,i).trim();a.some(e=>/^\s*max-age=0\s*$/i.test(e))?e.delete(n):e.set(n,r.slice(i+1))}});for(let e of["localStorage","sessionStorage"]){let t=new Map;Object.defineProperty(window,e,{value:{get length(){return t.size},key:e=>Array.from(t.keys())[e]??null,getItem:e=>t.get(String(e))??null,setItem:(e,r)=>{t.set(String(e),String(r))},removeItem:e=>{t.delete(String(e))},clear:()=>t.clear()}})}}function O(e,t){let r=new URL(t,location.href);function a(t){if(t&&!t.startsWith("data:"))try{let a=new URL(t,r);if(a.origin!==r.origin)return;if("/_next/image"===a.pathname&&(a=new URL(a.searchParams.get("url")??"",r)),a.origin===r.origin)return e[a.pathname]}catch{}}function i(e){if(e instanceof HTMLImageElement){let t=a(e.getAttribute("src")??"");t&&(e.removeAttribute("srcset"),e.src=t)}else if(e instanceof HTMLVideoElement){let t=a(e.getAttribute("poster")??"");t&&(e.poster=t)}}new MutationObserver(e=>{for(let t of e)if("attributes"===t.type)i(t.target);else for(let e of t.addedNodes)e instanceof Element&&(i(e),e.querySelectorAll("img,video[poster]").forEach(i))}).observe(document,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["src","poster","srcset"]})}function A(e,t,r,a){let i,n="";return async(s,o)=>{let l=o+"\n"+s;for(;i&&n!==l;){let e=i;await e.catch(()=>{}),i===e&&(i=void 0)}if(!i||n!==l){n=l;let o=k(e,t,s,r,a);i=o,o.catch(()=>{i===o&&(i=void 0)})}return i}}export{A as pageInteraction};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m,b as n,c as s,d as r,e as t,f as o}from"./chunk-
|
|
1
|
+
import{a as m,b as n,c as s,d as r,e as t,f as o}from"./chunk-DLXTHDBS.mjs";import"./chunk-7XGXFP5L.mjs";import"./chunk-BDSIJTX5.mjs";import"./chunk-2EQSGPAN.mjs";import"./chunk-PCUUOIFD.mjs";import"./chunk-63F7KX4E.mjs";import"./chunk-5GQXAV54.mjs";import"./chunk-ALWPAFIW.mjs";import"./chunk-BSVZXOOS.mjs";import"./chunk-7OATJ6BO.mjs";import"./chunk-NC7YXD7Q.mjs";import"./chunk-KOHR4LAQ.mjs";import"./chunk-UNUYNWTJ.mjs";import"./chunk-WVGFWHL3.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-72CUIZA2.mjs";import"./chunk-GLF7Z5IR.mjs";import"./chunk-KD2AOPYP.mjs";import"./chunk-KF73S7MG.mjs";import"./chunk-NOHXTT24.mjs";export{m as agentCredentialFile,t as callPeer,r as canvasChatRequest,s as enrolledCanvasEndpoint,o as runPeerCommand,n as sendThreadNote};
|
package/dist/plugin-astro.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as t}from"./chunk-
|
|
1
|
+
import{b as t}from"./chunk-TNVYP6S4.mjs";import"./chunk-4O6YFMWF.mjs";import"./chunk-LWPNOBGS.mjs";import"./chunk-UNUYNWTJ.mjs";import"./chunk-WVGFWHL3.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-72CUIZA2.mjs";import"./chunk-GLF7Z5IR.mjs";import"./chunk-KD2AOPYP.mjs";import"./chunk-KF73S7MG.mjs";import"./chunk-RG2CK6VE.mjs";import"./chunk-NOHXTT24.mjs";import{fileURLToPath as e}from"url";function n(n={}){return{name:"popmelt",hooks:{"astro:config:setup"({command:r,config:i,updateConfig:s,injectScript:m}){if("dev"!==r||"1"===process.env.POPMELT_PLANE_RENDERER)return;let{client:a=!0,...d}=n;s({vite:{plugins:[t({...d,projectRoot:n.projectRoot??e(i.root)},"astro")],optimizeDeps:{include:a?["react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client"]:[]}}}),m("page",a?o:"\nimport { bridgeUrl, projectId } from 'virtual:popmelt/bridge';\nif (bridgeUrl) window.__POPMELT_BRIDGE_URL__ = bridgeUrl;\nif (projectId) window.__POPMELT_PROJECT_ID__ = projectId;\n")}}}}var o="\nimport { bridgeUrl, projectId } from 'virtual:popmelt/bridge';\nimport { navigate } from 'astro:transitions/client';\nlet disposed = false;\nlet mounting;\nconst start = () => {\n if (disposed || mounting || !bridgeUrl || !projectId) return;\n mounting = Promise.resolve(import.meta.hot?.data.cleanup).then(async () => {\n if (disposed) return;\n const { mountPopmelt } = await import('@popmelt.com/core/browser');\n if (disposed) return;\n const handle = await mountPopmelt({ enabled: true, bridgeUrl, projectId, navigate });\n return handle;\n }).catch(error => { console.warn('[popmelt] startup failed:', error); });\n};\n// The standalone hosts live outside body, so Astro's body swaps retain them.\ndocument.addEventListener('astro:page-load', start);\nif (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start, { once: true });\nelse start();\nimport.meta.hot?.dispose(data => {\n if (disposed) return;\n disposed = true;\n document.removeEventListener('astro:page-load', start);\n document.removeEventListener('DOMContentLoaded', start);\n data.cleanup = mounting?.then(handle => handle?.unmount());\n});\n";export{n as popmelt};
|
package/dist/plugin-nuxt.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as e,c as t}from"./chunk-
|
|
1
|
+
import{b as e,c as t}from"./chunk-RG2CK6VE.mjs";import{b as o}from"./chunk-NOHXTT24.mjs";import{addPluginTemplate as n,defineNuxtModule as r}from"nuxt/kit";var p=r({meta:{name:"@popmelt.com/core/nuxt",configKey:"popmelt"},async setup(r,p){if(!p.options.dev||"1"===process.env.POPMELT_PLANE_RENDERER)return;let s={config:{server:p.options.devServer},middlewares:{use(){}}},i=await e({...r,projectRoot:r.projectRoot??p.options.rootDir},s,3e3,void 0,"nuxt");if(null===i.port)return;i.updateOrigin&&p.hook("listen",async(e,t)=>{s.httpServer=e;let o=e.address();if(!o||"string"==typeof o)return;let n="127.0.0.1"===o.address?"127.0.0.1":"::1"===o.address?"[::1]":"localhost";await i.updateOrigin(`${t.https?"https":"http"}://${n}:${o.port}`)}),p.hook("nitro:config",e=>{e.routeRules??={},Object.assign(e.routeRules,{...i.bootstrap?.planeApps&&{"/__popmelt/planes/**":{proxy:{to:`http://127.0.0.1:${i.port}/__popmelt/planes/**`,headers:{"x-popmelt-project-id":i.projectId}}}},...i.bootstrap&&{"/__popmelt/host":{proxy:`http://127.0.0.1:${i.port}/__popmelt/host?projectId=${encodeURIComponent(i.projectId)}`}},"/popmelt/phone":{proxy:`http://127.0.0.1:${i.port}/phone-host`}})}),p.hook("vite:extend",({config:e})=>{e.server??={},e.server.fs??={},e.server.fs.strict=!0,e.server.fs.deny=[...e.server.fs.deny??[".env",".env.*","*.{crt,pem}","**/.git/**"],"**/.popmelt","**/.popmelt/**"],e.server.watch??={};let t=e.server.watch.ignored;e.server.watch.ignored=[...Array.isArray(t)?t:t?[t]:[],"**/.popmelt/**"],e.optimizeDeps??={},e.optimizeDeps.include=[...new Set([...e.optimizeDeps.include??[],"react","react/jsx-runtime","react/jsx-dev-runtime","react-dom","react-dom/client"])]});let d=await t(i,s),a=d?o(d):void 0;p.hook("close",async()=>{a?.(),await(d?.release())}),n({filename:"popmelt.client.mjs",mode:"client",getContents:()=>`import { defineNuxtPlugin } from '#app';\nexport default defineNuxtPlugin((nuxtApp) => {\n let disposed = false;\n let mounting;\n const bridgeUrl = ${JSON.stringify(`http://localhost:${i.port}`)};\n const projectId = ${JSON.stringify(i.projectId)};\n ${i.bootstrap?`window.__POPMELT_PARTICIPANTS__=${JSON.stringify(i.bootstrap)};`:""}\n const dispose = () => {\n if (disposed) return;\n disposed = true;\n void mounting?.then(handle => handle?.unmount());\n };\n nuxtApp.hook('app:mounted', () => {\n if (disposed || mounting) return;\n mounting = import('@popmelt.com/core/browser').then(({ mountPopmelt }) => {\n if (disposed) return;\n return mountPopmelt({\n enabled: true,\n bridgeUrl,\n projectId,\n navigate: (url) => nuxtApp.$router.push(url),\n });\n }).then(handle => {\n if (disposed) handle?.unmount();\n return handle;\n }).catch(error => { console.warn('[popmelt] startup failed:', error); });\n });\n nuxtApp.vueApp.onUnmount(dispose);\n import.meta.hot?.dispose(dispose);\n});`})}});export{p as default};
|
package/dist/plugin-vite.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m,b as p}from"./chunk-
|
|
1
|
+
import{a as m,b as p}from"./chunk-TNVYP6S4.mjs";import"./chunk-4O6YFMWF.mjs";import"./chunk-LWPNOBGS.mjs";import"./chunk-UNUYNWTJ.mjs";import"./chunk-WVGFWHL3.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-72CUIZA2.mjs";import"./chunk-GLF7Z5IR.mjs";import"./chunk-KD2AOPYP.mjs";import"./chunk-KF73S7MG.mjs";import"./chunk-RG2CK6VE.mjs";import"./chunk-NOHXTT24.mjs";export{m as participantPlanes,p as popmelt};
|
package/dist/server.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as t,b as s,c as m}from"./chunk-
|
|
1
|
+
import{a as t,b as s,c as m}from"./chunk-BDSIJTX5.mjs";import"./chunk-2EQSGPAN.mjs";import"./chunk-PCUUOIFD.mjs";import"./chunk-63F7KX4E.mjs";import{i as a,j as r,k as i,l as p}from"./chunk-5GQXAV54.mjs";import"./chunk-ALWPAFIW.mjs";import"./chunk-BSVZXOOS.mjs";import"./chunk-7OATJ6BO.mjs";import{a as n,b as o}from"./chunk-NC7YXD7Q.mjs";import"./chunk-KOHR4LAQ.mjs";import{b as c,d as e,e as u}from"./chunk-UNUYNWTJ.mjs";import{b as j}from"./chunk-WVGFWHL3.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-72CUIZA2.mjs";import"./chunk-GLF7Z5IR.mjs";import"./chunk-KD2AOPYP.mjs";import"./chunk-KF73S7MG.mjs";import"./chunk-NOHXTT24.mjs";export{p as ImprintService,a as ImprintStore,u as createParticipantDevBootstrap,c as createParticipantGuestAccess,e as createParticipantHostEntry,j as createParticipantPlaneApps,i as formatImprintPrompt,n as imprintExplanationRef,t as managedParticipantBrowser,r as parseImprintDraft,o as qualifyImprintRelation,m as startDevelopmentSession,s as startPopmelt};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as a,d as r}from"./chunk-63F7KX4E.mjs";import"./chunk-HKHZBKAN.mjs";import"./chunk-CIKFUS7J.mjs";import"./chunk-KF73S7MG.mjs";export{r as createSharedPageReader,a as sharedPagePath};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";export{f as PagePreviewLayer}from"./chunk-SIGOY5GG.mjs";import"./chunk-J3IPAD7E.mjs";import"./chunk-JWWWU4GY.mjs";import"./chunk-Q6N77LIS.mjs";import"./chunk-FHCKFQBY.mjs";import"./chunk-APP5IYTE.mjs";import"./chunk-VOL4KS67.mjs";import"./chunk-53SKVMWR.mjs";import"./chunk-AOTDTBQO.mjs";import"./chunk-WP2SHSCG.mjs";import"./chunk-LH7HKUCK.mjs";import"./chunk-ZVDKW7TO.mjs";import"./chunk-Q6C7ZA3H.mjs";import"./chunk-7D4BUDKG.mjs";import"./chunk-OEJXPUAR.mjs";import"./chunk-HM6EBJVO.mjs";import"./chunk-SUAHDXJZ.mjs";import"./chunk-YGP6PPOZ.mjs";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{a as r,d as t}from"./chunk-YTMUAK4P.mjs";import"./chunk-UFU5IA3G.mjs";import"./chunk-EO3SHOXX.mjs";import"./chunk-FQH24XFS.mjs";import"./chunk-SOGN7S54.mjs";import"./chunk-SHIN4R4V.mjs";import"./chunk-EHM2ZBQU.mjs";import"./chunk-IC4G3NXR.mjs";import"./chunk-PRZ6C5X3.mjs";import"./chunk-VOL4KS67.mjs";import"./chunk-VLTK7KWK.mjs";import"./chunk-EWNSX5BF.mjs";import"./chunk-G2ZHJXHZ.mjs";import"./chunk-53SKVMWR.mjs";import"./chunk-TMW3SI7F.mjs";import"./chunk-RK6UROPO.mjs";import"./chunk-AOTDTBQO.mjs";import"./chunk-2F2BVGFH.mjs";import"./chunk-RWZ7SVMO.mjs";import"./chunk-HAZXZ5TU.mjs";import"./chunk-YTIDSDPP.mjs";import"./chunk-KF35YUNZ.mjs";import"./chunk-VBH2YQLG.mjs";import"./chunk-VXRRHXUP.mjs";import"./chunk-WP2SHSCG.mjs";import"./chunk-AAMUU2QA.mjs";import"./chunk-LH7HKUCK.mjs";import"./chunk-5TCWBNV4.mjs";import"./chunk-EILBHZDX.mjs";import"./chunk-ZVDKW7TO.mjs";import"./chunk-HQVWOBYH.mjs";import"./chunk-Q6C7ZA3H.mjs";import"./chunk-OREALBUO.mjs";import"./chunk-CK3CDA3L.mjs";import"./chunk-7D4BUDKG.mjs";import{b as o}from"./chunk-OEJXPUAR.mjs";import"./chunk-KE4MQBRY.mjs";import"./chunk-B4DYUYX4.mjs";import{d as n,f as i,c as m,a as e}from"./chunk-HM6EBJVO.mjs";import"./chunk-ADRWR5GI.mjs";import"./chunk-SUAHDXJZ.mjs";import"./chunk-PRPXMDZ7.mjs";import"./chunk-YGP6PPOZ.mjs";import{useState as c,useEffect as s,cloneElement as p}from"react";import{jsxs as h,jsx as u}from"react/jsx-runtime";function j({children:j,projectId:k,participantConfig:a}){let[l,d]=c(null),[I,H]=c("");if(s(()=>{let t,m,c=!1;return d(null),H(""),n(k).then(async n=>{if(c)return;let s=location.origin+e;m=i(s,n);let p=await o(s+"/status",{signal:AbortSignal.timeout(6e3)}),h=p.ok?await p.json():null;if(h?.projectId!==n.projectId)throw new Error("Phone access expired. Create a fresh pairing link in the project terminal.");if(!c){if(h.phoneParticipantId)t=await r({projectId:n.projectId,bridgeUrl:s,credential:{participantId:h.phoneParticipantId,token:""},runtimeStorage:sessionStorage,observedSource:{sourceId:n.projectId,revision:a?.revision??"unversioned"}});else if(a)throw new Error("This phone is not connected to the multiplayer host.");c?t?.dispose():d({bridgeUrl:s,projectId:n.projectId,connection:t})}}).catch(r=>{m?.(),c||H(r instanceof Error?r.message:"Phone pairing failed.")}),()=>{c=!0,t?.dispose(),m?.()}},[k,a]),I)return h("p",{role:"alert","data-devtools":"phone-pairing-error",children:[I," ",u("button",{type:"button",onClick:m,children:"Forget this pairing"})]});if(!l)return null;let U=p(j,{bridgeUrl:l.bridgeUrl,projectId:l.projectId});return l.connection?u(t,{connection:l.connection,onAccessRemoved:m,children:U}):U}export{j as PhoneHostGate};
|