@popmelt.com/core 0.33.0 → 0.33.1
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/dist/ExploreAttachment-VKCCEIM7.mjs +1 -0
- package/dist/ParticipantRuntime-YS5SIZUQ.mjs +1 -0
- package/dist/PopmeltTasteConnectedPane-FKIJM3C7.mjs +1 -215
- package/dist/PreviewRuntime-LFPK56NW.mjs +1 -2
- package/dist/QueuedReplies-ZYUDSTS2.mjs +1 -46
- package/dist/SuppliedContext-RWN6UR3K.mjs +1 -2
- package/dist/ThreadErrorCard-7J62GD5W.mjs +1 -2
- package/dist/ThreadPanel-KVNM67WO.mjs +1 -0
- package/dist/adapter-react-three-fiber.mjs +1 -2
- package/dist/bridge-entry.mjs +1 -1
- package/dist/bridge-recovery-3IQN3U6D.mjs +1 -2
- package/dist/bridgeSSEStream-NEYI73TC.mjs +1 -4
- package/dist/bridgeWebSocketStream-H3DCP4T3.mjs +1 -2
- package/dist/browser-runtime-AP35S5MK.mjs +1 -0
- package/dist/browser.mjs +1 -2
- package/dist/canvas-chat-note-NHYL3T6J.mjs +1 -2
- package/dist/checkFixture-MWBOYIM2.mjs +1 -0
- package/dist/chunk-27ADDVGC.mjs +1 -3
- package/dist/chunk-2IASPT6L.mjs +1 -2
- package/dist/chunk-2P2NUZW7.mjs +1 -2
- package/dist/chunk-2VCHBI7Y.mjs +1 -11
- package/dist/chunk-2ZJ4FBTG.mjs +1 -2
- package/dist/chunk-4LHTPRFY.mjs +1 -2
- package/dist/chunk-5K7SACPW.mjs +1 -2
- package/dist/chunk-6V2VCKPG.mjs +1 -53
- package/dist/chunk-6VXFTT5U.mjs +1 -2
- package/dist/chunk-75PQGTKX.mjs +1 -2
- package/dist/chunk-BVTLSUQT.mjs +1 -2
- package/dist/chunk-CPOYMGYY.mjs +1 -2
- package/dist/chunk-DNOKP3JS.mjs +1 -2
- package/dist/chunk-EAV2VV2V.mjs +1 -2
- package/dist/chunk-EX63NVDN.mjs +1 -2
- package/dist/chunk-F5XSNRGT.mjs +1 -2
- package/dist/chunk-GASEZICN.mjs +1 -2
- package/dist/chunk-H7XMDLGU.mjs +30 -0
- package/dist/{chunk-C5WXW6VL.mjs → chunk-HVD5ZG6W.mjs} +1 -1
- package/dist/chunk-J3UIBBU2.mjs +1 -2
- package/dist/chunk-J4WDYITA.mjs +1 -2
- package/dist/chunk-JMMP5JSP.mjs +1 -2
- package/dist/chunk-LVEMYZOA.mjs +1 -2
- package/dist/chunk-N2QUNHV6.mjs +1 -0
- package/dist/chunk-N2ZEZCHO.mjs +1 -2
- package/dist/{chunk-HNCV37XO.mjs → chunk-N6JTX4PD.mjs} +1 -1
- package/dist/chunk-O4HZP3RP.mjs +1 -2
- package/dist/chunk-ODIGT4YJ.mjs +1 -17
- package/dist/chunk-PQT5FYN5.mjs +1 -2
- package/dist/chunk-PSSHCTJ2.mjs +1 -8
- package/dist/chunk-RESPUCV7.mjs +1 -0
- package/dist/chunk-SHAIHRV2.mjs +1 -0
- package/dist/chunk-V2I7PSJW.mjs +1 -2
- package/dist/{chunk-H2UYAUX3.mjs → chunk-VPPVURBR.mjs} +1 -1
- package/dist/chunk-W5NIRROD.mjs +1 -7
- package/dist/chunk-WHJEKDNP.mjs +1 -2
- package/dist/chunk-XKD2ABCO.mjs +1 -7
- package/dist/chunk-XTOCFTVW.mjs +1 -2
- package/dist/chunk-YLKEDOII.mjs +31 -0
- package/dist/chunk-ZHJZPC7U.mjs +1 -2
- package/dist/cli.mjs +1 -1
- package/dist/codex-note-context-4JYQ437H.mjs +2 -0
- package/dist/{codex-project-7VYHYTWO.mjs → codex-project-FA4EK6VR.mjs} +1 -1
- package/dist/focus-inspection-VBS5656D.mjs +1 -2
- package/dist/index.mjs +1 -2
- package/dist/media.mjs +1 -2
- package/dist/{peer-client-MTWZG2FB.mjs → peer-client-KJCPXT76.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/taste-proposal-session-XU4N7RUV.mjs +1 -2
- package/dist/workspace-snapshot-RTTXNNUX.mjs +1 -2
- package/package.json +1 -1
- package/dist/ExploreAttachment-CLFSAWKM.mjs +0 -260
- package/dist/ParticipantRuntime-HW3MOZI5.mjs +0 -139
- package/dist/ThreadPanel-RJIHV3P6.mjs +0 -197
- package/dist/browser-runtime-JJHSKIKD.mjs +0 -2
- package/dist/checkFixture-TJDFGPQI.mjs +0 -2
- package/dist/chunk-7IJGE5AK.mjs +0 -31
- package/dist/chunk-I63OQTCF.mjs +0 -347
- package/dist/chunk-J5SC3R5L.mjs +0 -2
- package/dist/chunk-PHKDIU3X.mjs +0 -30
- package/dist/chunk-XMKYGH62.mjs +0 -142
- package/dist/codex-note-context-YHKPQ4WP.mjs +0 -2
- /package/dist/{chunk-DMWB3IRD.mjs → chunk-QOJCTLQW.mjs} +0 -0
package/dist/chunk-27ADDVGC.mjs
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{f as H}from"./chunk-J4WDYITA.mjs";import{l as W,d as z}from"./chunk-WHJEKDNP.mjs";import{destroyContext as F,domToCanvas as J,createContext as X}from"modern-screenshot";function A(t,e,n){if(t===null||typeof t=="string"||typeof t=="boolean")return;if(typeof t=="number"){if(!Number.isFinite(t))throw new TypeError(`Comment metadata at ${e} must be finite.`);return}if(typeof t!="object")throw new TypeError(`Comment metadata at ${e} must be JSON-serializable.`);if(n.has(t))throw new TypeError(`Comment metadata at ${e} contains a cycle.`);let r=Object.getPrototypeOf(t);if(!Array.isArray(t)&&r!==Object.prototype&&r!==null)throw new TypeError(`Comment metadata at ${e} must use plain objects and arrays.`);if(n.add(t),Array.isArray(t))t.forEach((i,o)=>A(i,`${e}[${o}]`,n));else for(let[i,o]of Object.entries(t))A(o,`${e}.${i}`,n);n.delete(t)}function q(t){if(t===void 0)return;if(t===null||Array.isArray(t)||typeof t!="object")throw new TypeError("Comment metadata must be a JSON object.");A(t,"meta",new Set);let e=JSON.stringify(t);if(new TextEncoder().encode(e).byteLength>65536)throw new RangeError("Comment metadata exceeds the 65536 byte limit.");return JSON.parse(e)}var C="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",G=1500,Q=5e3,K=24e6,V=16e3,Z=4,_=["position","inset","top","right","bottom","left","z-index","display","visibility","opacity","overflow","overflow-x","overflow-y","box-sizing","box-decoration-break","float","clear","width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-width","border-style","border-color","border-top","border-right","border-bottom","border-left","border-radius","outline","outline-offset","box-shadow","background","background-color","background-image","background-size","background-position","background-repeat","background-clip","background-origin","color","font","font-family","font-size","font-style","font-weight","font-stretch","font-variant","line-height","letter-spacing","text-align","text-decoration","text-indent","text-overflow","text-shadow","text-transform","white-space","word-break","overflow-wrap","vertical-align","direction","writing-mode","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","align-content","align-items","align-self","justify-content","justify-items","justify-self","gap","row-gap","column-gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-row","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","order","columns","column-count","column-fill","column-rule","column-span","column-width","list-style","list-style-image","list-style-position","list-style-type","object-fit","object-position","aspect-ratio","transform","transform-box","transform-origin","transform-style","perspective","perspective-origin","backface-visibility","clip","clip-path","filter","backdrop-filter","mix-blend-mode","isolation","mask","mask-image","mask-position","mask-repeat","mask-size","content","quotes","counter-increment","counter-reset","appearance","accent-color","caret-color","cursor","pointer-events","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity"];async function tt(t,e){try{let n=await t();if(n)return n}catch{}return e()}var S=new Map,$=new WeakMap,et=1;function p(){return typeof performance<"u"?performance.now():Date.now()}function R(t){if(t?.debug!==void 0)return t.debug;if(typeof window>"u")return!1;try{return window.localStorage.getItem("popmelt:screenshot-debug")==="true"}catch{return!1}}function nt(t){let e=0,n=0;for(let r of t.querySelectorAll("img[src]"))P(r.currentSrc||r.src)&&(e++,(!r.complete||r.naturalWidth===0)&&n++);return{remoteImages:e,unresolvedRemoteImages:n}}function ot(t){return new Promise((e,n)=>{let r=new FileReader;r.onload=()=>e(String(r.result)),r.onerror=()=>n(r.error??new Error("Asset could not be read")),r.readAsDataURL(t)})}function rt(t,e){let n=null;return async r=>{if(!P(r))return!1;n??(n=Date.now()+t);let i=n-Date.now();if(i<=0)return e(),C;let o=new AbortController,a=setTimeout(()=>o.abort(),i);try{let s=await fetch(r,{cache:"force-cache",mode:"cors",signal:o.signal});if(!s.ok)throw new Error(`Asset returned ${s.status}`);return await ot(await s.blob())}catch{return e(),C}finally{clearTimeout(a)}}}function at(t,e,n){let r=$.get(t);r||(r=et++,$.set(t,r));let i=e.filter(o=>(o.status??"pending")==="pending").map(o=>{let a=o.points[0],s=o.points[o.points.length-1];return`${o.id}:${o.points.length}:${a?.x??""}:${a?.y??""}:${s?.x??""}:${s?.y??""}`}).join("|");return[r,window.location.href,window.innerWidth,window.innerHeight,n?.dpr??window.devicePixelRatio??1,n?.viewportOnly?window.scrollY:"",i].join("::")}function it(t,e,n){let r=Math.min(e,n);return{top:Math.max(0,Math.min(t,n-r)),height:r,annotations:[]}}function P(t){if(typeof window>"u")return!1;try{let e=new URL(t,window.location.href);return e.protocol!=="http:"&&e.protocol!=="https:"?!1:e.origin!==window.location.origin}catch{return!1}}function lt(t){let e=document.createElement("canvas").getContext("2d");return e?(e.fillStyle=t,e.fillStyle):"#888888"}function j(t,e=[],n,r,i=[],o=[],a){let s=new Map,c=[];for(let l of t)if(l.groupId){let m=s.get(l.groupId)||[];m.push(l),s.set(l.groupId,m)}else c.push(l);let u=[];for(let[l,m]of s){let h=m.find(d=>d.type!=="text"),g=m.find(d=>d.type==="text");if(h){let d=h.linkedSelector||g?.linkedSelector,f=g?.imageCount||h.imageCount,w=g?.attachments||h.attachments,y=g?.interactionEpisode||h.interactionEpisode,v=h.pathname||g?.pathname;u.push({id:h.id,type:h.type,instruction:g?.text,...d?{linkedSelector:d}:{},...h.target||g?.target?{target:h.target??g?.target}:{},...v?{pathname:v}:{},elements:h.elements||[],...f?{imageCount:f}:{},...w?.length?{attachments:w}:{},...y?{interactionEpisode:y}:{}})}}for(let l of c)u.push({id:l.id,type:l.type,instruction:l.type==="text"?l.text:void 0,...l.linkedSelector?{linkedSelector:l.linkedSelector}:{},...l.target?{target:l.target}:{},...l.pathname?{pathname:l.pathname}:{},elements:l.elements||[],...l.region?{region:l.region}:{},...l.imageCount?{imageCount:l.imageCount}:{},...l.attachments?.length?{attachments:l.attachments}:{},...l.interactionEpisode?{interactionEpisode:l.interactionEpisode}:{}});return{timestamp:new Date().toISOString(),url:window.location.href,viewport:{width:window.innerWidth,height:window.innerHeight},scrollPosition:{x:window.scrollX,y:window.scrollY},annotations:u,styleModifications:e,...i.length>0?{textModifications:i}:{},...o.length>0?{domModifications:o}:{},...n?{inspectedElement:n}:{},...r&&r.length>0?{spacingTokenChanges:r}:{},...a?{meta:a}:{}}}function st(t){if(!t.points||t.points.length===0)return null;let e=[...t.points,...t.region?.points??[]],n=e.map(i=>i.x),r=e.map(i=>i.y);return{minX:Math.min(...n),minY:Math.min(...r),maxX:Math.max(...n),maxY:Math.max(...r)}}function ct(t,e){if(t.length===0)return[];let n=t.map(l=>({annotation:l,bounds:st(l)})).filter(l=>l.bounds!==null);if(n.length===0)return[];n.sort((l,m)=>l.bounds.minY-m.bounds.minY);let r=Math.min(...n.map(l=>l.bounds.minY)),i=Math.max(...n.map(l=>l.bounds.maxY));if(i-r<=e){let l=(r+i)/2,m=Math.max(0,l-e/2);return[{top:m,bottom:m+e,annotations:t}]}let o=[],a=50,s=Math.max(0,r-a),c=[],u=s;for(let{annotation:l,bounds:m}of n){let h=m.maxY+a;if(h-s<=e)c.push(l),u=Math.max(u,h);else{if(c.length>0){let g=(s+u)/2,d=Math.max(0,g-e/2);o.push({top:d,bottom:d+e,annotations:c})}s=Math.max(0,m.minY-a),c=[l],u=m.maxY+a}}if(c.length>0){let l=(s+u)/2,m=Math.max(0,l-e/2);o.push({top:m,bottom:m+e,annotations:c})}return o}function dt(t){let e=new Map;for(let n of t)if(n.linkedSelector)try{let r=W(n.linkedSelector);if(r){let i=z(r);e.set(n.id,{x:i.left+window.scrollX,y:i.top+window.scrollY,width:i.width,height:i.height})}}catch{}return e}function T(t,e,n,r,i){if(t.save(),t.scale(r,r),i)for(let o of e){let a=i.get(o.id);if(!a)continue;let s=a.y-n;t.fillStyle=o.color,t.globalAlpha=.05,t.fillRect(a.x,s,a.width,a.height),t.globalAlpha=1,t.strokeStyle=o.color,t.lineWidth=1,t.setLineDash([2,4]),t.strokeRect(a.x,s,a.width,a.height),t.setLineDash([])}for(let o of e){let a=o.points.map(s=>({x:s.x,y:s.y-n}));switch(t.strokeStyle=o.color,t.fillStyle=o.color,t.lineWidth=o.strokeWidth,t.lineCap="round",t.lineJoin="round",o.region&&H(t,o.region.points.map(s=>({x:s.x,y:s.y-n})),o.color),o.type){case"freehand":if(a.length<2)break;t.beginPath(),t.moveTo(a[0].x,a[0].y);for(let s=1;s<a.length;s++)t.lineTo(a[s].x,a[s].y);t.stroke();break;case"line":if(a.length<2)break;t.beginPath(),t.moveTo(a[0].x,a[0].y),t.lineTo(a[a.length-1].x,a[a.length-1].y),t.stroke();break;case"rectangle":{if(a.length<2)break;let s=a[0],c=a[a.length-1],u=Math.min(s.x,c.x),l=Math.min(s.y,c.y),m=Math.abs(c.x-s.x),h=Math.abs(c.y-s.y);t.strokeRect(u,l,m,h);break}case"circle":{if(a.length<2)break;let s=a[0],c=a[a.length-1],u=(s.x+c.x)/2,l=(s.y+c.y)/2,m=Math.abs(c.x-s.x)/2,h=Math.abs(c.y-s.y)/2;t.beginPath(),t.ellipse(u,l,m,h,0,0,Math.PI*2),t.stroke();break}case"text":{if(!o.text||a.length<1)break;let s=a[0],c=o.fontSize||16;t.font=`${c}px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`,t.fillStyle=o.color;let u=(o.imageCount&&o.imageCount>0?`[${o.imageCount} image${o.imageCount>1?"s":""}] ${o.text}`:o.text).split(`
|
|
3
|
-
`),l=c*1.2,m=4,h=0;for(let g of u)h=Math.max(h,t.measureText(g).width);t.fillRect(s.x-m,s.y-m,h+m*2,u.length*l+m*2),t.fillStyle="#ffffff",u.forEach((g,d)=>{t.fillText(g,s.x,s.y+c+d*l)});break}}}t.restore()}async function mt(t,e,n=[],r){let i=at(t,n,r),o=S.get(i);if(o)return R(r)&&console.debug("[Screenshot] Reusing in-flight capture",i),o;let a=vt(t,n,r).finally(()=>S.delete(i));return S.set(i,a),a}function ht(){let t=getComputedStyle(document.documentElement).backgroundColor;return t&&t!=="rgba(0, 0, 0, 0)"&&t!=="transparent"?t:"#ffffff"}function ut(t){return t instanceof HTMLElement?t.id==="devtools-canvas"||t.id==="devtools-toolbar"||t.id==="devtools-scrim"?!1:t.dataset.devtools===void 0:!0}function gt(t,e,n,r){return t.length===0?[{top:Math.max(0,Math.min(r,Math.max(0,n-e))),height:Math.min(e,n||e),annotations:[]}]:t.map(i=>{let o=Math.min(e,n||e);return{top:Math.max(0,Math.min(i.top,Math.max(0,n-o))),height:o,annotations:i.annotations}})}function ft(t,e,n){if(t.length===0)return null;let r=Math.min(...t.map(a=>a.top)),i=Math.max(...t.map(a=>a.top+a.height))-r,o=e*i*n*n;return i>V||o>K?null:{top:r,height:i}}async function pt(t,e){let n=[];for(let r of t){let i=Object.getOwnPropertyDescriptor(r.element,"toDataURL");try{Object.defineProperty(r.element,"toDataURL",{configurable:!0,value:()=>r.dataUrl}),n.push(()=>{i?Object.defineProperty(r.element,"toDataURL",i):Reflect.deleteProperty(r.element,"toDataURL")})}catch{}}try{return await e()}finally{for(let r of n.reverse())r()}}async function wt(t,e,n,r,i,o,a,s){let c=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)>window.innerHeight*Z||t.querySelectorAll("*").length>2500,u=s?await s():[];return pt(u,()=>X(t,{autoDestruct:!1,filter:ut,features:{restoreScrollPosition:!0},onCloneNode:l=>{t===document.body&&(l.style.margin=getComputedStyle(t).margin)},onCloneEachNode:l=>{if(l.nodeType===1&&l.localName==="html"&&l.ownerDocument!==document){let m=l.style;m.overflow="hidden",m.display="inline-block",m.clipPath=`inset(0 round ${m.borderRadius||"0px"})`}},scale:r,backgroundColor:ht(),width:n,height:e.height,style:{transform:`translate(${-window.scrollX}px, ${-e.top}px)`,transformOrigin:"top left"},timeout:i,debug:o,includeStyleProperties:c?[..._]:null,fetchFn:rt(i,()=>{a.remoteAssetFallbacks++}),fetch:{requestInit:{cache:"force-cache"},placeholderImage:C}}))}async function yt(t,e,n){return t.width=n,t.height=e.height,t.style={transform:`translate(${-window.scrollX}px, ${-e.top}px)`,transformOrigin:"top left"},J(t)}async function bt(t,e,n){let r=document.createElement("canvas");r.width=e,r.height=n;let i=r.getContext("2d");if(!i)throw new Error("Canvas context unavailable");if(typeof createImageBitmap=="function"){let s=await createImageBitmap(t);return i.drawImage(s,0,0,e,n),s.close(),r}let o=new Image,a=URL.createObjectURL(t);try{return await new Promise((s,c)=>{o.onload=()=>s(),o.onerror=()=>c(new Error("Native screenshot could not be decoded")),o.src=a}),i.drawImage(o,0,0,e,n),r}finally{URL.revokeObjectURL(a)}}async function L(t,e,n,r,i,o){if(r?.nativeCapture){let u=p();try{let l=await r.nativeCapture({url:window.location.href,clip:{x:window.scrollX,y:t.top,width:e,height:t.height},scale:n});if(o.nativeMs+=p()-u,l)return o.mode=o.renderMs>0||o.contextMs>0?"mixed":"native",bt(l,Math.round(e*n),Math.round(t.height*n))}catch(l){o.nativeMs+=p()-u,R(r)&&console.debug("[Screenshot] Native capture unavailable; using DOM fallback",l)}}let a=await i(),s=p(),c=await yt(a,t,e);return o.renderMs+=p()-s,o.mode=o.mode==="native"?"mixed":"dom",c}function U(t,e,n,r,i,o){let a=document.createElement("canvas");a.width=Math.round(r*i),a.height=Math.round(n.height*i);let s=a.getContext("2d");if(!s)throw new Error("Canvas context unavailable");let c=Math.round((n.top-e)*i);return s.drawImage(t,0,c,a.width,a.height,0,0,a.width,a.height),T(s,n.annotations,n.top,i,o),a}function xt(t){if(t.length===1)return t[0];let e=document.createElement("canvas");e.width=t[0]?.width??0,e.height=t.reduce((i,o)=>i+o.height,0);let n=e.getContext("2d");if(!n)throw new Error("Canvas context unavailable");let r=0;for(let i of t)n.drawImage(i,0,r),r+=i.height;return e}function Mt(t,e="image/webp",n=.8){return new Promise(r=>t.toBlob(r,e,n))}async function vt(t,e,n){let r=p(),i=n?.dpr??(window.devicePixelRatio||1),o=window.innerWidth,a=window.innerHeight,s=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),c=Math.max(250,n?.mediaTimeoutMs??G),u=R(n),l=e.filter(b=>(b.status??"pending")==="pending"),m=dt(l),h=n?.viewportOnly?[it(window.scrollY,a,s)]:gt(ct(l,a),a,s,window.scrollY),g=nt(t),d={startedAt:r,mode:"dom",mediaTimeoutMs:c,ranges:h.length,...g,remoteAssetFallbacks:0,nativeMs:0,contextMs:0,renderMs:0,compositeMs:0,encodeMs:0};console.log("[Screenshot] Starting capture with",l.length,"active annotations (filtered",e.length-l.length,"captured);",`${h.length} range(s), ${g.remoteImages} remote image(s), ${g.unresolvedRemoteImages} unresolved`);let f=null,w=null,y=ft(h,o,i),v=y??h[0],E=async()=>{if(!f){let b=p();f=wt(t,v,o,i,c,u,d,n?.captureSurfaces).then(x=>(w=x,d.contextMs+=p()-b,x))}return f};try{let b=p(),x;if(y){let M=await L(y,o,i,n,E,d);x=h.map(k=>U(M,y.top,k,o,i,m))}else{x=[];for(let M of h){let k=await L(M,o,i,n,E,d);x.push(U(k,M.top,M,o,i,m))}}let Y=xt(x);d.compositeMs+=p()-b-d.renderMs-d.nativeMs-d.contextMs;let N=p(),I=await Mt(Y);d.encodeMs=p()-N;let O=p()-d.startedAt,B={mode:d.mode,totalMs:Math.round(O),mediaTimeoutMs:d.mediaTimeoutMs,ranges:d.ranges,remoteImages:d.remoteImages,unresolvedRemoteImages:d.unresolvedRemoteImages,remoteAssetFallbacks:d.remoteAssetFallbacks,nativeMs:Math.round(d.nativeMs),contextMs:Math.round(d.contextMs),renderMs:Math.round(d.renderMs),compositeMs:Math.max(0,Math.round(d.compositeMs)),encodeMs:Math.round(d.encodeMs),overBudget:O>Q};return console.log("[Screenshot] Capture complete",JSON.stringify(B)),I?[I]:[]}catch(b){return console.error("[Screenshot] Capture failed:",b),[]}finally{w&&F(w)}}async function D(t){if(t.length===0)return null;if(t.length===1)return t[0];let e=await Promise.all(t.map(s=>new Promise((c,u)=>{let l=new Image;l.onload=()=>c(l),l.onerror=u,l.src=URL.createObjectURL(s)}))),n=e[0].width,r=e.reduce((s,c)=>s+c.height,0),i=document.createElement("canvas");i.width=n,i.height=r;let o=i.getContext("2d");if(!o)return null;let a=0;for(let s of e)o.drawImage(s,0,a),a+=s.height,URL.revokeObjectURL(s.src);return new Promise(s=>{i.toBlob(c=>s(c),"image/webp",.8)})}async function kt(t,e,n,r,i){try{let o=Array.isArray(t)?t:[t];if(o.length===0)return!1;let a=await D(o);if(!a)return!1;let s=a;if(a.type!=="image/png"){let g=new Image,d=URL.createObjectURL(a);await new Promise(w=>{g.onload=()=>w(),g.src=d}),URL.revokeObjectURL(d);let f=document.createElement("canvas");f.width=g.naturalWidth,f.height=g.naturalHeight,f.getContext("2d").drawImage(g,0,0),s=await new Promise(w=>f.toBlob(y=>w(y),"image/png"))}let c={"image/png":s},u=e&&e.length>0,l=n&&n.length>0,m=r&&r.length>0,h=i&&i.length>0;if(u||l||m||h){let g=e?e.filter(d=>(d.status??"pending")==="pending"):[];if(g.length>0||l||m||h){let d=j(g,n||[],void 0,void 0,r||[],i||[]),f=new Blob([JSON.stringify(d,null,2)],{type:"text/plain"});c["text/plain"]=f}}return await navigator.clipboard.write([new ClipboardItem(c)]),!0}catch(o){return console.warn("Clipboard write failed:",o),!1}}export{q as a,tt as b,lt as c,j as d,T as e,mt as f,D as g,kt as h};
|
|
1
|
+
"use client";import{f as e}from"./chunk-J4WDYITA.mjs";import{l as t,d as n}from"./chunk-WHJEKDNP.mjs";import{destroyContext as o,domToCanvas as r,createContext as i}from"modern-screenshot";function a(e,t,n){if(null===e||"string"==typeof e||"boolean"==typeof e)return;if("number"==typeof e){if(!Number.isFinite(e))throw new TypeError(`Comment metadata at ${t} must be finite.`);return}if("object"!=typeof e)throw new TypeError(`Comment metadata at ${t} must be JSON-serializable.`);if(n.has(e))throw new TypeError(`Comment metadata at ${t} contains a cycle.`);let o=Object.getPrototypeOf(e);if(!Array.isArray(e)&&o!==Object.prototype&&null!==o)throw new TypeError(`Comment metadata at ${t} must use plain objects and arrays.`);if(n.add(e),Array.isArray(e))e.forEach((e,o)=>a(e,`${t}[${o}]`,n));else for(let[o,r]of Object.entries(e))a(r,`${t}.${o}`,n);n.delete(e)}function l(e){if(void 0===e)return;if(null===e||Array.isArray(e)||"object"!=typeof e)throw new TypeError("Comment metadata must be a JSON object.");a(e,"meta",new Set);let t=JSON.stringify(e);if((new TextEncoder).encode(t).byteLength>65536)throw new RangeError("Comment metadata exceeds the 65536 byte limit.");return JSON.parse(t)}var s="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7",c=24e6,d=["position","inset","top","right","bottom","left","z-index","display","visibility","opacity","overflow","overflow-x","overflow-y","box-sizing","box-decoration-break","float","clear","width","min-width","max-width","height","min-height","max-height","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","border","border-width","border-style","border-color","border-top","border-right","border-bottom","border-left","border-radius","outline","outline-offset","box-shadow","background","background-color","background-image","background-size","background-position","background-repeat","background-clip","background-origin","color","font","font-family","font-size","font-style","font-weight","font-stretch","font-variant","line-height","letter-spacing","text-align","text-decoration","text-indent","text-overflow","text-shadow","text-transform","white-space","word-break","overflow-wrap","vertical-align","direction","writing-mode","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","align-content","align-items","align-self","justify-content","justify-items","justify-self","gap","row-gap","column-gap","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-row","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","order","columns","column-count","column-fill","column-rule","column-span","column-width","list-style","list-style-image","list-style-position","list-style-type","object-fit","object-position","aspect-ratio","transform","transform-box","transform-origin","transform-style","perspective","perspective-origin","backface-visibility","clip","clip-path","filter","backdrop-filter","mix-blend-mode","isolation","mask","mask-image","mask-position","mask-repeat","mask-size","content","quotes","counter-increment","counter-reset","appearance","accent-color","caret-color","cursor","pointer-events","fill","fill-opacity","fill-rule","stroke","stroke-width","stroke-opacity"];async function m(e,t){try{let t=await e();if(t)return t}catch{}return t()}var h=new Map,u=new WeakMap,g=1;function f(){return typeof performance<"u"?performance.now():Date.now()}function p(e){if(void 0!==e?.debug)return e.debug;if(typeof window>"u")return!1;try{return"true"===window.localStorage.getItem("popmelt:screenshot-debug")}catch{return!1}}function w(e,t){let n=null;return async o=>{if(!b(o))return!1;n??(n=Date.now()+e);let r=n-Date.now();if(r<=0)return t(),s;let i=new AbortController,a=setTimeout(()=>i.abort(),r);try{let e=await fetch(o,{cache:"force-cache",mode:"cors",signal:i.signal});if(!e.ok)throw new Error(`Asset returned ${e.status}`);return await function(e){return new Promise((t,n)=>{let o=new FileReader;o.onload=()=>t(String(o.result)),o.onerror=()=>n(o.error??new Error("Asset could not be read")),o.readAsDataURL(e)})}(await e.blob())}catch{return t(),s}finally{clearTimeout(a)}}}function y(e,t,n){let o=Math.min(t,n);return{top:Math.max(0,Math.min(e,n-o)),height:o,annotations:[]}}function b(e){if(typeof window>"u")return!1;try{let t=new URL(e,window.location.href);return("http:"===t.protocol||"https:"===t.protocol)&&t.origin!==window.location.origin}catch{return!1}}function x(e){let t=document.createElement("canvas").getContext("2d");return t?(t.fillStyle=e,t.fillStyle):"#888888"}function M(e,t=[],n,o,r=[],i=[],a){let l=new Map,s=[];for(let t of e)if(t.groupId){let e=l.get(t.groupId)||[];e.push(t),l.set(t.groupId,e)}else s.push(t);let c=[];for(let[e,t]of l){let e=t.find(e=>"text"!==e.type),n=t.find(e=>"text"===e.type);if(e){let t=e.linkedSelector||n?.linkedSelector,o=n?.imageCount||e.imageCount,r=n?.attachments||e.attachments,i=n?.interactionEpisode||e.interactionEpisode,a=e.pathname||n?.pathname;c.push({id:e.id,type:e.type,instruction:n?.text,...t?{linkedSelector:t}:{},...e.target||n?.target?{target:e.target??n?.target}:{},...a?{pathname:a}:{},elements:e.elements||[],...o?{imageCount:o}:{},...r?.length?{attachments:r}:{},...i?{interactionEpisode:i}:{}})}}for(let e of s)c.push({id:e.id,type:e.type,instruction:"text"===e.type?e.text:void 0,...e.linkedSelector?{linkedSelector:e.linkedSelector}:{},...e.target?{target:e.target}:{},...e.pathname?{pathname:e.pathname}:{},elements:e.elements||[],...e.region?{region:e.region}:{},...e.imageCount?{imageCount:e.imageCount}:{},...e.attachments?.length?{attachments:e.attachments}:{},...e.interactionEpisode?{interactionEpisode:e.interactionEpisode}:{}});return{timestamp:(new Date).toISOString(),url:window.location.href,viewport:{width:window.innerWidth,height:window.innerHeight},scrollPosition:{x:window.scrollX,y:window.scrollY},annotations:c,styleModifications:t,...r.length>0?{textModifications:r}:{},...i.length>0?{domModifications:i}:{},...n?{inspectedElement:n}:{},...o&&o.length>0?{spacingTokenChanges:o}:{},...a?{meta:a}:{}}}function v(e){if(!e.points||0===e.points.length)return null;let t=[...e.points,...e.region?.points??[]],n=t.map(e=>e.x),o=t.map(e=>e.y);return{minX:Math.min(...n),minY:Math.min(...o),maxX:Math.max(...n),maxY:Math.max(...o)}}function k(e){let o=new Map;for(let r of e)if(r.linkedSelector)try{let e=t(r.linkedSelector);if(e){let t=n(e);o.set(r.id,{x:t.left+window.scrollX,y:t.top+window.scrollY,width:t.width,height:t.height})}}catch{}return o}function A(t,n,o,r,i){if(t.save(),t.scale(r,r),i)for(let e of n){let n=i.get(e.id);if(!n)continue;let r=n.y-o;t.fillStyle=e.color,t.globalAlpha=.05,t.fillRect(n.x,r,n.width,n.height),t.globalAlpha=1,t.strokeStyle=e.color,t.lineWidth=1,t.setLineDash([2,4]),t.strokeRect(n.x,r,n.width,n.height),t.setLineDash([])}for(let r of n){let n=r.points.map(e=>({x:e.x,y:e.y-o}));switch(t.strokeStyle=r.color,t.fillStyle=r.color,t.lineWidth=r.strokeWidth,t.lineCap="round",t.lineJoin="round",r.region&&e(t,r.region.points.map(e=>({x:e.x,y:e.y-o})),r.color),r.type){case"freehand":if(n.length<2)break;t.beginPath(),t.moveTo(n[0].x,n[0].y);for(let e=1;e<n.length;e++)t.lineTo(n[e].x,n[e].y);t.stroke();break;case"line":if(n.length<2)break;t.beginPath(),t.moveTo(n[0].x,n[0].y),t.lineTo(n[n.length-1].x,n[n.length-1].y),t.stroke();break;case"rectangle":{if(n.length<2)break;let e=n[0],o=n[n.length-1],r=Math.min(e.x,o.x),i=Math.min(e.y,o.y),a=Math.abs(o.x-e.x),l=Math.abs(o.y-e.y);t.strokeRect(r,i,a,l);break}case"circle":{if(n.length<2)break;let e=n[0],o=n[n.length-1],r=(e.x+o.x)/2,i=(e.y+o.y)/2,a=Math.abs(o.x-e.x)/2,l=Math.abs(o.y-e.y)/2;t.beginPath(),t.ellipse(r,i,a,l,0,0,2*Math.PI),t.stroke();break}case"text":{if(!r.text||n.length<1)break;let e=n[0],o=r.fontSize||16;t.font=`${o}px -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif`,t.fillStyle=r.color;let i=(r.imageCount&&r.imageCount>0?`[${r.imageCount} image${r.imageCount>1?"s":""}] ${r.text}`:r.text).split("\n"),a=1.2*o,l=4,s=0;for(let e of i)s=Math.max(s,t.measureText(e).width);t.fillRect(e.x-l,e.y-l,s+2*l,i.length*a+2*l),t.fillStyle="#ffffff",i.forEach((n,r)=>{t.fillText(n,e.x,e.y+o+r*a)});break}}}t.restore()}async function S(e,t,n=[],r){let a=function(e,t,n){let o=u.get(e);o||(o=g++,u.set(e,o));let r=t.filter(e=>"pending"===(e.status??"pending")).map(e=>{let t=e.points[0],n=e.points[e.points.length-1];return`${e.id}:${e.points.length}:${t?.x??""}:${t?.y??""}:${n?.x??""}:${n?.y??""}`}).join("|");return[o,window.location.href,window.innerWidth,window.innerHeight,n?.dpr??window.devicePixelRatio??1,n?.viewportOnly?window.scrollY:"",r].join("::")}(e,n,r),l=h.get(a);if(l)return p(r)&&console.debug("[Screenshot] Reusing in-flight capture",a),l;let m=async function(e,t,n){let r=f(),a=n?.dpr??(window.devicePixelRatio||1),l=window.innerWidth,m=window.innerHeight,h=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),u=Math.max(250,n?.mediaTimeoutMs??1500),g=p(n),x=t.filter(e=>"pending"===(e.status??"pending")),M=k(x),A=n?.viewportOnly?[y(window.scrollY,m,h)]:function(e,t,n,o){return 0===e.length?[{top:Math.max(0,Math.min(o,Math.max(0,n-t))),height:Math.min(t,n||t),annotations:[]}]:e.map(e=>{let o=Math.min(t,n||t);return{top:Math.max(0,Math.min(e.top,Math.max(0,n-o))),height:o,annotations:e.annotations}})}(function(e,t){if(0===e.length)return[];let n=e.map(e=>({annotation:e,bounds:v(e)})).filter(e=>null!==e.bounds);if(0===n.length)return[];n.sort((e,t)=>e.bounds.minY-t.bounds.minY);let o=Math.min(...n.map(e=>e.bounds.minY)),r=Math.max(...n.map(e=>e.bounds.maxY));if(r-o<=t){let n=(o+r)/2,i=Math.max(0,n-t/2);return[{top:i,bottom:i+t,annotations:e}]}let i=[],a=Math.max(0,o-50),l=[],s=a;for(let{annotation:e,bounds:o}of n){let n=o.maxY+50;if(n-a<=t)l.push(e),s=Math.max(s,n);else{if(l.length>0){let e=(a+s)/2,n=Math.max(0,e-t/2);i.push({top:n,bottom:n+t,annotations:l})}a=Math.max(0,o.minY-50),l=[e],s=o.maxY+50}}if(l.length>0){let e=(a+s)/2,n=Math.max(0,e-t/2);i.push({top:n,bottom:n+t,annotations:l})}return i}(x,m),m,h,window.scrollY),S=function(e){let t=0,n=0;for(let o of e.querySelectorAll("img[src]"))b(o.currentSrc||o.src)&&(t++,(!o.complete||0===o.naturalWidth)&&n++);return{remoteImages:t,unresolvedRemoteImages:n}}(e),O={startedAt:r,mode:"dom",mediaTimeoutMs:u,ranges:A.length,...S,remoteAssetFallbacks:0,nativeMs:0,contextMs:0,renderMs:0,compositeMs:0,encodeMs:0};console.log("[Screenshot] Starting capture with",x.length,"active annotations (filtered",t.length-x.length,"captured);",`${A.length} range(s), ${S.remoteImages} remote image(s), ${S.unresolvedRemoteImages} unresolved`);let $=null,j=null,P=function(e,t,n){if(0===e.length)return null;let o=Math.min(...e.map(e=>e.top)),r=Math.max(...e.map(e=>e.top+e.height))-o,i=t*r*n*n;return r>16e3||i>c?null:{top:o,height:r}}(A,l,a),L=P??A[0],T=async()=>{if(!$){let t=f();$=async function(e,t,n,o,r,a,l,c){let m=Math.max(document.body.scrollHeight,document.documentElement.scrollHeight)>4*window.innerHeight||e.querySelectorAll("*").length>2500,h=c?await c():[];return async function(e,t){let n=[];for(let t of e){let e=Object.getOwnPropertyDescriptor(t.element,"toDataURL");try{Object.defineProperty(t.element,"toDataURL",{configurable:!0,value:()=>t.dataUrl}),n.push(()=>{e?Object.defineProperty(t.element,"toDataURL",e):Reflect.deleteProperty(t.element,"toDataURL")})}catch{}}try{return await t()}finally{for(let e of n.reverse())e()}}(h,()=>i(e,{autoDestruct:!1,filter:E,features:{restoreScrollPosition:!0},onCloneNode:t=>{e===document.body&&(t.style.margin=getComputedStyle(e).margin)},onCloneEachNode:e=>{if(1===e.nodeType&&"html"===e.localName&&e.ownerDocument!==document){let t=e.style;t.overflow="hidden",t.display="inline-block",t.clipPath=`inset(0 round ${t.borderRadius||"0px"})`}},scale:o,backgroundColor:C(),width:n,height:t.height,style:{transform:`translate(${-window.scrollX}px, ${-t.top}px)`,transformOrigin:"top left"},timeout:r,debug:a,includeStyleProperties:m?[...d]:null,fetchFn:w(r,()=>{l.remoteAssetFallbacks++}),fetch:{requestInit:{cache:"force-cache"},placeholderImage:s}}))}(e,L,l,a,u,g,O,n?.captureSurfaces).then(e=>(j=e,O.contextMs+=f()-t,e))}return $};try{let e,t=f();if(P){let t=await R(P,l,a,n,T,O);e=A.map(e=>I(t,P.top,e,l,a,M))}else{e=[];for(let t of A){let o=await R(t,l,a,n,T,O);e.push(I(o,t.top,t,l,a,M))}}let o=function(e){if(1===e.length)return e[0];let t=document.createElement("canvas");t.width=e[0]?.width??0,t.height=e.reduce((e,t)=>e+t.height,0);let n=t.getContext("2d");if(!n)throw new Error("Canvas context unavailable");let o=0;for(let t of e)n.drawImage(t,0,o),o+=t.height;return t}(e);O.compositeMs+=f()-t-O.renderMs-O.nativeMs-O.contextMs;let r=f(),i=await function(e,t="image/webp",n=.8){return new Promise(o=>e.toBlob(o,t,n))}(o);O.encodeMs=f()-r;let s=f()-O.startedAt,c={mode:O.mode,totalMs:Math.round(s),mediaTimeoutMs:O.mediaTimeoutMs,ranges:O.ranges,remoteImages:O.remoteImages,unresolvedRemoteImages:O.unresolvedRemoteImages,remoteAssetFallbacks:O.remoteAssetFallbacks,nativeMs:Math.round(O.nativeMs),contextMs:Math.round(O.contextMs),renderMs:Math.round(O.renderMs),compositeMs:Math.max(0,Math.round(O.compositeMs)),encodeMs:Math.round(O.encodeMs),overBudget:s>5e3};return console.log("[Screenshot] Capture complete",JSON.stringify(c)),i?[i]:[]}catch(e){return console.error("[Screenshot] Capture failed:",e),[]}finally{j&&o(j)}}(e,n,r).finally(()=>h.delete(a));return h.set(a,m),m}function C(){let e=getComputedStyle(document.documentElement).backgroundColor;return e&&"rgba(0, 0, 0, 0)"!==e&&"transparent"!==e?e:"#ffffff"}function E(e){return!(e instanceof HTMLElement)||"devtools-canvas"!==e.id&&"devtools-toolbar"!==e.id&&"devtools-scrim"!==e.id&&void 0===e.dataset.devtools}async function R(e,t,n,o,i,a){if(o?.nativeCapture){let r=f();try{let i=await o.nativeCapture({url:window.location.href,clip:{x:window.scrollX,y:e.top,width:t,height:e.height},scale:n});if(a.nativeMs+=f()-r,i)return a.mode=a.renderMs>0||a.contextMs>0?"mixed":"native",async function(e,t,n){let o=document.createElement("canvas");o.width=t,o.height=n;let r=o.getContext("2d");if(!r)throw new Error("Canvas context unavailable");if("function"==typeof createImageBitmap){let i=await createImageBitmap(e);return r.drawImage(i,0,0,t,n),i.close(),o}let i=new Image,a=URL.createObjectURL(e);try{return await new Promise((e,t)=>{i.onload=()=>e(),i.onerror=()=>t(new Error("Native screenshot could not be decoded")),i.src=a}),r.drawImage(i,0,0,t,n),o}finally{URL.revokeObjectURL(a)}}(i,Math.round(t*n),Math.round(e.height*n))}catch(e){a.nativeMs+=f()-r,p(o)&&console.debug("[Screenshot] Native capture unavailable; using DOM fallback",e)}}let l=await i(),s=f(),c=await async function(e,t,n){return e.width=n,e.height=t.height,e.style={transform:`translate(${-window.scrollX}px, ${-t.top}px)`,transformOrigin:"top left"},r(e)}(l,e,t);return a.renderMs+=f()-s,a.mode="native"===a.mode?"mixed":"dom",c}function I(e,t,n,o,r,i){let a=document.createElement("canvas");a.width=Math.round(o*r),a.height=Math.round(n.height*r);let l=a.getContext("2d");if(!l)throw new Error("Canvas context unavailable");let s=Math.round((n.top-t)*r);return l.drawImage(e,0,s,a.width,a.height,0,0,a.width,a.height),A(l,n.annotations,n.top,r,i),a}async function O(e){if(0===e.length)return null;if(1===e.length)return e[0];let t=await Promise.all(e.map(e=>new Promise((t,n)=>{let o=new Image;o.onload=()=>t(o),o.onerror=n,o.src=URL.createObjectURL(e)}))),n=t[0].width,o=t.reduce((e,t)=>e+t.height,0),r=document.createElement("canvas");r.width=n,r.height=o;let i=r.getContext("2d");if(!i)return null;let a=0;for(let e of t)i.drawImage(e,0,a),a+=e.height,URL.revokeObjectURL(e.src);return new Promise(e=>{r.toBlob(t=>e(t),"image/webp",.8)})}async function $(e,t,n,o,r){try{let i=Array.isArray(e)?e:[e];if(0===i.length)return!1;let a=await O(i);if(!a)return!1;let l=a;if("image/png"!==a.type){let e=new Image,t=URL.createObjectURL(a);await new Promise(n=>{e.onload=()=>n(),e.src=t}),URL.revokeObjectURL(t);let n=document.createElement("canvas");n.width=e.naturalWidth,n.height=e.naturalHeight,n.getContext("2d").drawImage(e,0,0),l=await new Promise(e=>n.toBlob(t=>e(t),"image/png"))}let s={"image/png":l},c=t&&t.length>0,d=n&&n.length>0,m=o&&o.length>0,h=r&&r.length>0;if(c||d||m||h){let e=t?t.filter(e=>"pending"===(e.status??"pending")):[];if(e.length>0||d||m||h){let t=M(e,n||[],void 0,void 0,o||[],r||[]),i=new Blob([JSON.stringify(t,null,2)],{type:"text/plain"});s["text/plain"]=i}}return await navigator.clipboard.write([new ClipboardItem(s)]),!0}catch(e){return console.warn("Clipboard write failed:",e),!1}}export{l as a,m as b,x as c,M as d,A as e,S as f,O as g,$ as h};
|
package/dist/chunk-2IASPT6L.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{A as u}from"./chunk-BVTLSUQT.mjs";import{a as s}from"./chunk-75PQGTKX.mjs";import{r as c}from"./chunk-WHJEKDNP.mjs";function f(r,l){let e=r.split(c()),t=l;try{for(let[n,i]of e.entries()){let a=t.querySelectorAll(i);if(a.length!==1)return null;let o=a[0];if(n===e.length-1)return o;if(!o.shadowRoot)return null;t=o.shadowRoot}}catch{}return null}function p(r,l){return r.targetBindings?.length?r.targetBindings.flatMap(({anchor:e})=>{if(e.type==="opaque"){let n={adapter:e.adapter,key:e.key};return[{selector:s(n),subject:n}]}let t=e.structuralSelector??e.runtimeSelector;return e.pathname===l&&t?[{selector:t}]:[]}).slice(0,8):(r.elementIdentifiers??[]).flatMap(e=>{let t=u(e,l);return t?[{selector:t}]:[]}).slice(0,8)}export{f as a,p as b};
|
|
1
|
+
"use client";import{A as e}from"./chunk-BVTLSUQT.mjs";import{a as t}from"./chunk-75PQGTKX.mjs";import{r}from"./chunk-WHJEKDNP.mjs";function l(e,t){let l=e.split(r()),n=t;try{for(let[e,t]of l.entries()){let r=n.querySelectorAll(t);if(1!==r.length)return null;let o=r[0];if(e===l.length-1)return o;if(!o.shadowRoot)return null;n=o.shadowRoot}}catch{}return null}function n(r,l){return r.targetBindings?.length?r.targetBindings.flatMap(({anchor:e})=>{if("opaque"===e.type){let r={adapter:e.adapter,key:e.key};return[{selector:t(r),subject:r}]}let r=e.structuralSelector??e.runtimeSelector;return e.pathname===l&&r?[{selector:r}]:[]}).slice(0,8):(r.elementIdentifiers??[]).flatMap(t=>{let r=e(t,l);return r?[{selector:r}]:[]}).slice(0,8)}export{l as a,n as b};
|
package/dist/chunk-2P2NUZW7.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var n={capacity:{label:"At capacity",message:"The model provider is temporarily unavailable. Try again shortly."},rate_limited:{label:"Rate limited",message:"The model provider is receiving too many requests. Try again shortly."},timeout:{label:"Timed out",message:"The model took too long to respond. Try again."},connection:{label:"Connection lost",message:"The model provider disconnected before the run completed. Try again."},authentication:{label:"Sign-in required",message:"The model provider needs to be authenticated before this run can continue."},send_rejected:{label:"Not sent",message:"This reply did not reach the thread. Try again when the connection is ready."},failed:{label:"Failed",message:"The model could not complete this run. Try again, or inspect the job diagnostics if the problem continues."}};function a(t){let e=typeof t=="string"?t:(()=>{try{return JSON.stringify(t)}catch{return String(t??"")}})();return/\b(?:http\s*)?503\b|server at capacity|\bat capacity\b|resource[_\s-]?exhausted|temporarily unavailable/i.test(e)?"capacity":/\b(?:http\s*)?429\b|rate[_\s-]?limit|too many requests/i.test(e)?"rate_limited":/timed?\s*out|timeout/i.test(e)?"timeout":/auth(?:entication|orization)? required|oauth|not authenticated|sign[ -]?in required|unauthorized|\b401\b/i.test(e)?"authentication":/transport channel closed|connection (?:closed|lost|reset)|socket hang up|network error|disconnected/i.test(e)?"connection":"failed"}function o(t,e){let i=e??a(t);return{kind:i,...n[i]}}export{o as a};
|
|
1
|
+
"use client";var e={capacity:{label:"At capacity",message:"The model provider is temporarily unavailable. Try again shortly."},rate_limited:{label:"Rate limited",message:"The model provider is receiving too many requests. Try again shortly."},timeout:{label:"Timed out",message:"The model took too long to respond. Try again."},connection:{label:"Connection lost",message:"The model provider disconnected before the run completed. Try again."},authentication:{label:"Sign-in required",message:"The model provider needs to be authenticated before this run can continue."},send_rejected:{label:"Not sent",message:"This reply did not reach the thread. Try again when the connection is ready."},failed:{label:"Failed",message:"The model could not complete this run. Try again, or inspect the job diagnostics if the problem continues."}};function t(t,i){let n=i??function(e){let t="string"==typeof e?e:(()=>{try{return JSON.stringify(e)}catch{return String(e??"")}})();return/\b(?:http\s*)?503\b|server at capacity|\bat capacity\b|resource[_\s-]?exhausted|temporarily unavailable/i.test(t)?"capacity":/\b(?:http\s*)?429\b|rate[_\s-]?limit|too many requests/i.test(t)?"rate_limited":/timed?\s*out|timeout/i.test(t)?"timeout":/auth(?:entication|orization)? required|oauth|not authenticated|sign[ -]?in required|unauthorized|\b401\b/i.test(t)?"authentication":/transport channel closed|connection (?:closed|lost|reset)|socket hang up|network error|disconnected/i.test(t)?"connection":"failed"}(t);return{kind:n,...e[n]}}export{t as a};
|
package/dist/chunk-2VCHBI7Y.mjs
CHANGED
|
@@ -1,11 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{a as c}from"./chunk-V2I7PSJW.mjs";function m(t,e){if(c(t)){let n=t.style.getPropertyValue(e);if(n)return n}let o=e.replace(/-([a-z])/g,(n,i)=>i.toUpperCase());try{for(let n of document.styleSheets)try{let i=n.cssRules||n.rules;for(let l of i)if(l instanceof CSSStyleRule&&t.matches(l.selectorText)){let s=l.style.getPropertyValue(e);if(s)return s;let a=l.style[o];if(a)return a}}catch{}}catch{}return null}function w(t){let e=window.getComputedStyle(t).display;return e==="flex"||e==="inline-flex"||e==="grid"||e==="inline-grid"}function y(t){let e=window.getComputedStyle(t);return{row:parseFloat(e.rowGap)||0,column:parseFloat(e.columnGap)||0}}function x(t){let e=[];for(let o of t){let n=e.find(i=>i.axis!==o.axis?!1:o.axis==="row"?Math.abs(i.y-o.y)<2&&Math.abs(i.h-o.h)<2:Math.abs(i.x-o.x)<2&&Math.abs(i.w-o.w)<2);if(n)if(o.axis==="row"){let i=Math.min(n.x,o.x),l=Math.max(n.x+n.w,o.x+o.w);n.x=i,n.w=l-i}else{let i=Math.min(n.y,o.y),l=Math.max(n.y+n.h,o.y+o.h);n.y=i,n.h=l-i}else e.push({...o})}return e}function b(t){let e=Array.from(t.children).filter(a=>{if(!(a instanceof HTMLElement))return!1;let r=window.getComputedStyle(a);return r.display!=="none"&&r.position!=="absolute"&&r.position!=="fixed"});if(e.length<2)return[];let o=[],n=t.getBoundingClientRect(),i=window.getComputedStyle(t).flexDirection,l=i==="column"||i==="column-reverse",s=6;for(let a=0;a<e.length-1;a++){let r=e[a].getBoundingClientRect(),u=e[a+1].getBoundingClientRect();if(u.left>r.right+.5&&o.push({axis:"column",x:r.right,y:n.top,w:u.left-r.right,h:n.height}),u.top>r.bottom+.5&&o.push({axis:"row",x:n.left,y:r.bottom,w:n.width,h:u.top-r.bottom}),!(u.left>r.right+.5)&&!(u.top>r.bottom+.5))if(l){let d=(r.bottom+u.top)/2;o.push({axis:"row",x:n.left,y:d-s/2,w:n.width,h:s})}else{let d=(r.right+u.left)/2;o.push({axis:"column",x:d-s/2,y:n.top,w:s,h:n.height})}}return x(o)}function R(t,e){let o=window.getComputedStyle(t),n=o.display;if(n!=="flex"&&n!=="inline-flex")return!1;let i=o.justifyContent;if(i!=="space-between"&&i!=="space-around"&&i!=="space-evenly"&&i!=="stretch")return!1;let l=o.flexDirection;return!(e!==(l==="column"||l==="column-reverse"?"row":"column")||parseFloat(e==="row"?o.rowGap:o.columnGap)>0)}function C(t){let e=window.getComputedStyle(t);return{top:parseFloat(e.paddingTop)||0,right:parseFloat(e.paddingRight)||0,bottom:parseFloat(e.paddingBottom)||0,left:parseFloat(e.paddingLeft)||0}}function F(t){let e=window.getComputedStyle(t);return{top:parseFloat(e.marginTop)||0,right:parseFloat(e.marginRight)||0,bottom:parseFloat(e.marginBottom)||0,left:parseFloat(e.marginLeft)||0}}function v(t){let e=window.getComputedStyle(t);return{topLeft:e.borderTopLeftRadius,topRight:e.borderTopRightRadius,bottomRight:e.borderBottomRightRadius,bottomLeft:e.borderBottomLeftRadius}}function S(t){let e=window.getComputedStyle(t);return{"top-left":parseFloat(e.borderTopLeftRadius)||0,"top-right":parseFloat(e.borderTopRightRadius)||0,"bottom-right":parseFloat(e.borderBottomRightRadius)||0,"bottom-left":parseFloat(e.borderBottomLeftRadius)||0}}function T(t){for(let e of t.childNodes)if(e.nodeType===Node.TEXT_NODE&&(e.textContent||"").trim().length>0)return!0;return!1}function L(t){let e=document.createRange(),o=!1;for(let d of t.childNodes)d.nodeType===Node.TEXT_NODE&&(d.textContent||"").trim().length>0&&(o||(e.setStart(d,0),o=!0),e.setEnd(d,d.textContent?.length??0));if(!o)return null;let n=e.getBoundingClientRect(),i=window.getComputedStyle(t),l=parseFloat(i.fontSize)||16,s=parseFloat(i.lineHeight);isNaN(s)&&(s=l*1.2);let a=Math.max(1,e.getClientRects().length),r=Math.max(n.height,a*s),u=(r-n.height)/2;return new DOMRect(n.x,n.y-u,n.width,r)}function M(t){let e=window.getComputedStyle(t),o=parseFloat(e.fontSize)||16,n=parseFloat(e.lineHeight);return isNaN(n)&&(n=o*1.2),{fontSize:o,lineHeight:n}}var h=new WeakMap,f="popmelt:preview-viewport-change";function E(t){let e=t.ownerDocument.defaultView;e&&h.get(e)?.schedule(),t.dispatchEvent(new Event(f,{bubbles:!0}))}function B(t){let e={listeners:new Set,rafId:null,schedule:()=>{e.rafId===null&&(e.rafId=t.requestAnimationFrame(()=>{e.rafId=null;for(let o of e.listeners)o()}))}};return h.set(t,e),t.addEventListener("scroll",e.schedule,{passive:!0,capture:!0}),t.addEventListener("resize",e.schedule),e}function N(t,e=window){let o=h.get(e)??B(e);return o.listeners.add(t),()=>{o.listeners.delete(t)&&(o.listeners.size>0||(e.removeEventListener("scroll",o.schedule,!0),e.removeEventListener("resize",o.schedule),o.rafId!==null&&e.cancelAnimationFrame(o.rafId),h.delete(e)))}}function p(t){return`
|
|
3
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">
|
|
4
|
-
<defs>
|
|
5
|
-
<mask id="cutout">
|
|
6
|
-
<rect width="100%" height="100%" fill="white" />
|
|
7
|
-
<rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" rx="${t.radius}" fill="black" />
|
|
8
|
-
</mask>
|
|
9
|
-
</defs>
|
|
10
|
-
<rect width="100%" height="100%" fill="white" mask="url(#cutout)" />
|
|
11
|
-
</svg>`}function g(t){return`url("data:image/svg+xml,${encodeURIComponent(t)}")`}var z=g(p({x:-100,y:-2,width:104,height:26,radius:10})),D=g(p({x:-100,y:-5.929,width:108,height:26,radius:10})),I=10;export{m as a,w as b,y as c,b as d,R as e,C as f,F as g,v as h,S as i,T as j,L as k,M as l,f as m,E as n,N as o,z as p,D as q,I as r};
|
|
1
|
+
"use client";import{a as t}from"./chunk-V2I7PSJW.mjs";function e(e,o){if(t(e)){let t=e.style.getPropertyValue(o);if(t)return t}let n=o.replace(/-([a-z])/g,(t,e)=>e.toUpperCase());try{for(let t of document.styleSheets)try{let i=t.cssRules||t.rules;for(let t of i)if(t instanceof CSSStyleRule&&e.matches(t.selectorText)){let e=t.style.getPropertyValue(o);if(e)return e;let i=t.style[n];if(i)return i}}catch{}}catch{}return null}function o(t){let e=window.getComputedStyle(t).display;return"flex"===e||"inline-flex"===e||"grid"===e||"inline-grid"===e}function n(t){let e=window.getComputedStyle(t);return{row:parseFloat(e.rowGap)||0,column:parseFloat(e.columnGap)||0}}function i(t){let e=Array.from(t.children).filter(t=>{if(!(t instanceof HTMLElement))return!1;let e=window.getComputedStyle(t);return"none"!==e.display&&"absolute"!==e.position&&"fixed"!==e.position});if(e.length<2)return[];let o=[],n=t.getBoundingClientRect(),i=window.getComputedStyle(t).flexDirection,r="column"===i||"column-reverse"===i;for(let t=0;t<e.length-1;t++){let i=e[t].getBoundingClientRect(),l=e[t+1].getBoundingClientRect();if(l.left>i.right+.5&&o.push({axis:"column",x:i.right,y:n.top,w:l.left-i.right,h:n.height}),l.top>i.bottom+.5&&o.push({axis:"row",x:n.left,y:i.bottom,w:n.width,h:l.top-i.bottom}),!(l.left>i.right+.5||l.top>i.bottom+.5))if(r){let t=(i.bottom+l.top)/2;o.push({axis:"row",x:n.left,y:t-3,w:n.width,h:6})}else{let t=(i.right+l.left)/2;o.push({axis:"column",x:t-3,y:n.top,w:6,h:n.height})}}return function(t){let e=[];for(let o of t){let t=e.find(t=>t.axis===o.axis&&("row"===o.axis?Math.abs(t.y-o.y)<2&&Math.abs(t.h-o.h)<2:Math.abs(t.x-o.x)<2&&Math.abs(t.w-o.w)<2));if(t)if("row"===o.axis){let e=Math.min(t.x,o.x),n=Math.max(t.x+t.w,o.x+o.w);t.x=e,t.w=n-e}else{let e=Math.min(t.y,o.y),n=Math.max(t.y+t.h,o.y+o.h);t.y=e,t.h=n-e}else e.push({...o})}return e}(o)}function r(t,e){let o=window.getComputedStyle(t),n=o.display;if("flex"!==n&&"inline-flex"!==n)return!1;let i=o.justifyContent;if("space-between"!==i&&"space-around"!==i&&"space-evenly"!==i&&"stretch"!==i)return!1;let r=o.flexDirection;return!(e!==("column"===r||"column-reverse"===r?"row":"column")||parseFloat("row"===e?o.rowGap:o.columnGap)>0)}function l(t){let e=window.getComputedStyle(t);return{top:parseFloat(e.paddingTop)||0,right:parseFloat(e.paddingRight)||0,bottom:parseFloat(e.paddingBottom)||0,left:parseFloat(e.paddingLeft)||0}}function a(t){let e=window.getComputedStyle(t);return{top:parseFloat(e.marginTop)||0,right:parseFloat(e.marginRight)||0,bottom:parseFloat(e.marginBottom)||0,left:parseFloat(e.marginLeft)||0}}function s(t){let e=window.getComputedStyle(t);return{topLeft:e.borderTopLeftRadius,topRight:e.borderTopRightRadius,bottomRight:e.borderBottomRightRadius,bottomLeft:e.borderBottomLeftRadius}}function u(t){let e=window.getComputedStyle(t);return{"top-left":parseFloat(e.borderTopLeftRadius)||0,"top-right":parseFloat(e.borderTopRightRadius)||0,"bottom-right":parseFloat(e.borderBottomRightRadius)||0,"bottom-left":parseFloat(e.borderBottomLeftRadius)||0}}function d(t){for(let e of t.childNodes)if(e.nodeType===Node.TEXT_NODE&&(e.textContent||"").trim().length>0)return!0;return!1}function h(t){let e=document.createRange(),o=!1;for(let n of t.childNodes)n.nodeType===Node.TEXT_NODE&&(n.textContent||"").trim().length>0&&(o||(e.setStart(n,0),o=!0),e.setEnd(n,n.textContent?.length??0));if(!o)return null;let n=e.getBoundingClientRect(),i=window.getComputedStyle(t),r=parseFloat(i.fontSize)||16,l=parseFloat(i.lineHeight);isNaN(l)&&(l=1.2*r);let a=Math.max(1,e.getClientRects().length),s=Math.max(n.height,a*l),u=(s-n.height)/2;return new DOMRect(n.x,n.y-u,n.width,s)}function f(t){let e=window.getComputedStyle(t),o=parseFloat(e.fontSize)||16,n=parseFloat(e.lineHeight);return isNaN(n)&&(n=1.2*o),{fontSize:o,lineHeight:n}}var p=new WeakMap,g="popmelt:preview-viewport-change";function c(t){let e=t.ownerDocument.defaultView;e&&p.get(e)?.schedule(),t.dispatchEvent(new Event(g,{bubbles:!0}))}function m(t,e=window){let o=p.get(e)??function(t){let e={listeners:new Set,rafId:null,schedule:()=>{null===e.rafId&&(e.rafId=t.requestAnimationFrame(()=>{e.rafId=null;for(let t of e.listeners)t()}))}};return p.set(t,e),t.addEventListener("scroll",e.schedule,{passive:!0,capture:!0}),t.addEventListener("resize",e.schedule),e}(e);return o.listeners.add(t),()=>{o.listeners.delete(t)&&(o.listeners.size>0||(e.removeEventListener("scroll",o.schedule,!0),e.removeEventListener("resize",o.schedule),null!==o.rafId&&e.cancelAnimationFrame(o.rafId),p.delete(e)))}}function w(t){return`\n<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%">\n <defs>\n <mask id="cutout">\n <rect width="100%" height="100%" fill="white" />\n <rect x="${t.x}" y="${t.y}" width="${t.width}" height="${t.height}" rx="${t.radius}" fill="black" />\n </mask>\n </defs>\n <rect width="100%" height="100%" fill="white" mask="url(#cutout)" />\n</svg>`}function y(t){return`url("data:image/svg+xml,${encodeURIComponent(t)}")`}var x=y(w({x:-100,y:-2,width:104,height:26,radius:10})),b=y(w({x:-100,y:-5.929,width:108,height:26,radius:10})),R=10;export{e as a,o as b,n as c,i as d,r as e,l as f,a as g,s as h,u as i,d as j,h as k,f as l,g as m,c as n,m as o,x as p,b as q,R as r};
|
package/dist/chunk-2ZJ4FBTG.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
import{c as a}from"./chunk-DNOKP3JS.mjs";import{a as u}from"./chunk-V2I7PSJW.mjs";var b={isAnnotating:!1,activeTool:"inspector",activeColor:"oklch(0.628 0.258 29)",strokeWidth:3,annotations:[],undoStack:[],redoStack:[],selectedAnnotationIds:[],lastSelectedId:null,styleModifications:[],textModifications:[],domModifications:[],spacingTokenChanges:[],spacingTokenMods:[]},f=new WeakMap,c=new WeakMap;function S(t,e){if(u(e))for(let[o,r]of c.get(t)??[])r.value?e.style.setProperty(o,r.value,r.priority):e.style.removeProperty(o)}function v(t,e){f.set(t,new Set(e))}function P(t){f.delete(t)}function d(t,e){return u(t)&&(f.get(t)?.has(e)??!1)}function p(t){let e=t.sticker;return e?e.family==="padding"||e.family==="margin"?e.subproperty==="all"?10:e.subproperty==="x"||e.subproperty==="y"?20:30:e.family==="radius"||e.family==="border"?e.subproperty==="all"?10:20:10:0}function x(t){return t.changes.map((e,o)=>({change:e,index:o})).sort((e,o)=>p(e.change)-p(o.change)||e.index-o.index).map(({change:e})=>e)}function m(t,e,o){if(u(t)){let r=c.get(t);r||(r=new Map,c.set(t,r)),r.has(e)||r.set(e,{value:t.style.getPropertyValue(e),priority:t.style.getPropertyPriority(e)}),t.style.setProperty(e,o,"important")}}function k(t,e,o,r=!1){if(u(t)){let n=r?c.get(t)?.get(e):void 0;n?.value?t.style.setProperty(e,n.value,n.priority):t.style.removeProperty(e),c.get(t)?.delete(e)}}function y(t){let e=a(t.selector);if(!e&&t.durableSelector&&(e=a(t.durableSelector),e)){let o=t.selector.match(/\[data-pm="([^"]+)"\]/)?.[1];o&&e.setAttribute("data-pm",o)}return e}function A(t){for(let e of t){let o=y(e);if(o)for(let r of x(e))d(o,r.property)||m(o,r.property,r.modified)}}function M(t,e=!1){for(let o of t){let r=a(o.selector);if(r)for(let n of o.changes)d(r,n.property)||k(r,n.property,n.original,e)}}function g(t){let e=a(t.selector);if(!e&&t.durableSelector&&(e=a(t.durableSelector),e)){let o=t.selector.match(/\[data-pm="([^"]+)"\]/)?.[1];o&&e.setAttribute("data-pm",o)}return e}function h(t,e){let o=t;for(let r of e)o=o?.childNodes[r]??null;return o?.nodeType===Node.TEXT_NODE?o:null}function V(t){for(let e of t){if(e.captured)continue;let o=g(e);if(!o)continue;let r=h(o,e.textNodePath);r&&r.nodeValue===e.original&&r.nodeValue!==e.modified&&(r.nodeValue=e.modified)}}function N(t){for(let e of t){if(e.captured)continue;let o=g(e);if(!o)continue;let r=h(o,e.textNodePath);r&&r.nodeValue===e.modified&&r.nodeValue!==e.original&&(r.nodeValue=e.original)}}function l(t,e){if(!t)return null;let o=a(t);if(!o&&e&&(o=a(e),o)){let r=t.match(/\[data-pm="([^"]+)"\]/)?.[1];r&&o.setAttribute("data-pm",r)}return o}function T(t){t.removeAttribute("data-pm"),t.querySelectorAll("[data-pm]").forEach(e=>e.removeAttribute("data-pm"))}function w(t,e){let o=e.match(/\[data-pm="([^"]+)"\]/)?.[1];o&&t.setAttribute("data-pm",o)}function s(t,e,o){let r=Array.from(t.children).filter(i=>i!==e),n=Math.max(0,Math.min(o,r.length));t.insertBefore(e,r[n]??null)}function D(t){for(let e of t){let o=l(e.targetParentSelector,e.targetParentDurableSelector);if(!o)continue;if(e.operation==="move"){let i=l(e.selector,e.durableSelector);if(!i||i===o||i.contains(o))continue;s(o,i,e.targetIndex);continue}if(l(e.selector,e.durableSelector))continue;let r=l(e.sourceSelector,e.sourceDurableSelector);if(!r)continue;let n=r.cloneNode(!0);n instanceof Element&&(T(n),w(n,e.selector),s(o,n,e.targetIndex))}}function I(t){for(let e of[...t].reverse()){if(e.operation==="copy"){l(e.selector,e.durableSelector)?.remove();continue}let o=l(e.selector,e.durableSelector),r=l(e.originalParentSelector,e.originalParentDurableSelector);!o||!r||o===r||o.contains(r)||s(r,o,e.originalIndex??r.children.length)}}export{b as a,S as b,v as c,P as d,m as e,y as f,A as g,M as h,V as i,N as j,D as k,I as l};
|
|
1
|
+
"use client";import{c as e}from"./chunk-DNOKP3JS.mjs";import{a as t}from"./chunk-V2I7PSJW.mjs";var o={isAnnotating:!1,activeTool:"inspector",activeColor:"oklch(0.628 0.258 29)",strokeWidth:3,annotations:[],undoStack:[],redoStack:[],selectedAnnotationIds:[],lastSelectedId:null,styleModifications:[],textModifications:[],domModifications:[],spacingTokenChanges:[],spacingTokenMods:[]},r=new WeakMap,n=new WeakMap;function l(e,o){if(t(o))for(let[t,r]of n.get(e)??[])r.value?o.style.setProperty(t,r.value,r.priority):o.style.removeProperty(t)}function a(e,t){r.set(e,new Set(t))}function i(e){r.delete(e)}function c(e,o){return t(e)&&(r.get(e)?.has(o)??!1)}function u(e){let t=e.sticker;return t?"padding"===t.family||"margin"===t.family?"all"===t.subproperty?10:"x"===t.subproperty||"y"===t.subproperty?20:30:"radius"===t.family||"border"===t.family?"all"===t.subproperty?10:20:10:0}function f(e){return e.changes.map((e,t)=>({change:e,index:t})).sort((e,t)=>u(e.change)-u(t.change)||e.index-t.index).map(({change:e})=>e)}function s(e,o,r){if(t(e)){let t=n.get(e);t||(t=new Map,n.set(e,t)),t.has(o)||t.set(o,{value:e.style.getPropertyValue(o),priority:e.style.getPropertyPriority(o)}),e.style.setProperty(o,r,"important")}}function d(e,o,r,l=!1){if(t(e)){let t=l?n.get(e)?.get(o):void 0;t?.value?e.style.setProperty(o,t.value,t.priority):e.style.removeProperty(o),n.get(e)?.delete(o)}}function p(t){let o=e(t.selector);if(!o&&t.durableSelector&&(o=e(t.durableSelector),o)){let e=t.selector.match(/\[data-pm="([^"]+)"\]/)?.[1];e&&o.setAttribute("data-pm",e)}return o}function m(e){for(let t of e){let e=p(t);if(e)for(let o of f(t))c(e,o.property)||s(e,o.property,o.modified)}}function y(t,o=!1){for(let r of t){let t=e(r.selector);if(t)for(let e of r.changes)c(t,e.property)||d(t,e.property,e.original,o)}}function g(t){let o=e(t.selector);if(!o&&t.durableSelector&&(o=e(t.durableSelector),o)){let e=t.selector.match(/\[data-pm="([^"]+)"\]/)?.[1];e&&o.setAttribute("data-pm",e)}return o}function h(e,t){let o=e;for(let e of t)o=o?.childNodes[e]??null;return o?.nodeType===Node.TEXT_NODE?o:null}function b(e){for(let t of e){if(t.captured)continue;let e=g(t);if(!e)continue;let o=h(e,t.textNodePath);o&&o.nodeValue===t.original&&o.nodeValue!==t.modified&&(o.nodeValue=t.modified)}}function S(e){for(let t of e){if(t.captured)continue;let e=g(t);if(!e)continue;let o=h(e,t.textNodePath);o&&o.nodeValue===t.modified&&o.nodeValue!==t.original&&(o.nodeValue=t.original)}}function v(t,o){if(!t)return null;let r=e(t);if(!r&&o&&(r=e(o),r)){let e=t.match(/\[data-pm="([^"]+)"\]/)?.[1];e&&r.setAttribute("data-pm",e)}return r}function P(e){e.removeAttribute("data-pm"),e.querySelectorAll("[data-pm]").forEach(e=>e.removeAttribute("data-pm"))}function k(e,t){let o=t.match(/\[data-pm="([^"]+)"\]/)?.[1];o&&e.setAttribute("data-pm",o)}function x(e,t,o){let r=Array.from(e.children).filter(e=>e!==t),n=Math.max(0,Math.min(o,r.length));e.insertBefore(t,r[n]??null)}function A(e){for(let t of e){let e=v(t.targetParentSelector,t.targetParentDurableSelector);if(!e)continue;if("move"===t.operation){let o=v(t.selector,t.durableSelector);if(!o||o===e||o.contains(e))continue;x(e,o,t.targetIndex);continue}if(v(t.selector,t.durableSelector))continue;let o=v(t.sourceSelector,t.sourceDurableSelector);if(!o)continue;let r=o.cloneNode(!0);r instanceof Element&&(P(r),k(r,t.selector),x(e,r,t.targetIndex))}}function M(e){for(let t of[...e].reverse()){if("copy"===t.operation){v(t.selector,t.durableSelector)?.remove();continue}let e=v(t.selector,t.durableSelector),o=v(t.originalParentSelector,t.originalParentDurableSelector);!e||!o||e===o||e.contains(o)||x(o,e,t.originalIndex??o.children.length)}}export{o as a,l as b,a as c,i as d,s as e,p as f,m as g,y as h,b as i,S as j,A as k,M as l};
|
package/dist/chunk-4LHTPRFY.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
var a=[4,2],s=a.join(" "),o=a[0]+a[1];export{a,s as b,o as c};
|
|
1
|
+
"use client";var a=[4,2],s=a.join(" "),o=a[0]+a[1];export{a,s as b,o as c};
|
package/dist/chunk-5K7SACPW.mjs
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
"use client";
|
|
2
|
-
function l(i){let t=Object.keys(i).find(n=>n.startsWith("__reactFiber$")||n.startsWith("__reactInternalInstance$"));if(!t)return null;let e=i[t],a=[],r=e?._debugSource;for(;e;){let n=e.type,s=n?.displayName||n?.name;s&&typeof s=="string"&&/^[A-Z]/.test(s)&&!s.startsWith("_")&&s!=="Fragment"&&a.unshift(s),e=e.return}return a.length>0?{name:a[a.length-1],path:a,...r?.fileName&&Number.isFinite(r.lineNumber)?{source:r}:{}}:null}function u(i){let t=Object.keys(i).find(r=>r.startsWith("__reactFiber$")||r.startsWith("__reactInternalInstance$"));if(!t)return[];let e=i[t],a=[];for(;e;){let r=e.type,n=typeof r=="function"||typeof r=="object"?r?.displayName||r?.name:null;n&&typeof n=="string"&&/^[A-Z]/.test(n)&&!n.startsWith("_")&&n!=="Fragment"&&a.push({name:n,fiber:e}),e=e.return}return a.reverse(),a}function f(i){let t=i,e=new Set;for(;t&&!e.has(t);){if(e.add(t),t.stateNode instanceof Element)return t.stateNode;t.child?t=t.child:t=null}return null}export{l as a,u as b,f as c};
|
|
1
|
+
"use client";function t(t){let e=Object.keys(t).find(t=>t.startsWith("__reactFiber$")||t.startsWith("__reactInternalInstance$"));if(!e)return null;let n=t[e],r=[],a=n?._debugSource;for(;n;){let t=n.type,e=t?.displayName||t?.name;e&&"string"==typeof e&&/^[A-Z]/.test(e)&&!e.startsWith("_")&&"Fragment"!==e&&r.unshift(e),n=n.return}return r.length>0?{name:r[r.length-1],path:r,...a?.fileName&&Number.isFinite(a.lineNumber)?{source:a}:{}}:null}function e(t){let e=Object.keys(t).find(t=>t.startsWith("__reactFiber$")||t.startsWith("__reactInternalInstance$"));if(!e)return[];let n=t[e],r=[];for(;n;){let t=n.type,e="function"==typeof t||"object"==typeof t?t?.displayName||t?.name:null;e&&"string"==typeof e&&/^[A-Z]/.test(e)&&!e.startsWith("_")&&"Fragment"!==e&&r.push({name:e,fiber:n}),n=n.return}return r.reverse(),r}function n(t){let e=t,n=new Set;for(;e&&!n.has(e);){if(n.add(e),e.stateNode instanceof Element)return e.stateNode;e=e.child?e.child:null}return null}export{t as a,e as b,n as c};
|