@popmelt.com/core 0.36.0 → 0.37.0
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/README.md +78 -23
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/skills/popmelt-core/SKILL.md +1 -0
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/codex-plugin/skills/popmelt-core/SKILL.md +1 -0
- package/dist/ExploreAttachment-IO3CNUWH.mjs +1 -0
- package/dist/PagePreviewLayer-KQ2FLIGX.mjs +1 -0
- package/dist/ParticipantRuntime-Y2BQVJSL.mjs +1 -0
- package/dist/PhoneHostGate-2G4BA5FP.mjs +1 -0
- package/dist/PopmeltTasteConnectedPane-H5QWBFD7.mjs +1 -0
- package/dist/PreviewRuntime-V2PZF462.mjs +1 -0
- package/dist/{QueuedReplies-ESIFFRKS.mjs → QueuedReplies-4APDDNQX.mjs} +1 -1
- package/dist/SamplePlacementOverlay-ELSP5AHM.mjs +1 -0
- package/dist/ShareProjectPane-OR2LS2A3.mjs +1 -0
- package/dist/SuppliedContext-SAQKEDWW.mjs +1 -0
- package/dist/ThreadErrorCard-OSHIWSHR.mjs +1 -0
- package/dist/ThreadPanel-YPL2HDUC.mjs +1 -0
- package/dist/adapter-react-three-fiber.d.mts +6 -2
- package/dist/adapter-react-three-fiber.mjs +1 -1
- package/dist/adapter-three.d.mts +34 -0
- package/dist/adapter-three.mjs +45 -1
- package/dist/bridge-entry.mjs +1 -1
- package/dist/bridgeSSEStream-6OMAFDFW.mjs +1 -0
- package/dist/bridgeWebSocketStream-WIOGOPJW.mjs +1 -0
- package/dist/browser-runtime-O3EKN3FI.mjs +1 -0
- package/dist/browser.d.mts +4 -4
- package/dist/browser.mjs +1 -1
- package/dist/canvas-chat-note-O3USBECW.mjs +1 -0
- package/dist/checkFixture-SOSI7AT4.mjs +1 -0
- package/dist/chunk-3VOEPWRL.mjs +1 -0
- package/dist/chunk-4OEHQ6M7.mjs +24 -0
- package/dist/chunk-4YQWU5YB.mjs +1 -0
- package/dist/chunk-5IZHN3A7.mjs +1 -0
- package/dist/chunk-6EO73WJN.mjs +1 -0
- package/dist/chunk-6O5QLRSA.mjs +1 -0
- package/dist/chunk-76WRZ2NH.mjs +1 -0
- package/dist/chunk-A4GARXVQ.mjs +1 -0
- package/dist/chunk-AAMUU2QA.mjs +1 -0
- package/dist/chunk-AGCS65LT.mjs +1 -0
- package/dist/chunk-AGYBVMHX.mjs +1 -0
- package/dist/{chunk-RR4SHK7O.mjs → chunk-AOTDTBQO.mjs} +1 -1
- package/dist/chunk-ATLUO4G7.mjs +1 -0
- package/dist/chunk-AYZUOBFI.mjs +1 -0
- package/dist/chunk-B22WBEQC.mjs +1 -0
- package/dist/chunk-B2ISA6V6.mjs +1 -0
- package/dist/chunk-B4DYUYX4.mjs +1 -0
- package/dist/chunk-BVGHHT3Y.mjs +1 -0
- package/dist/{chunk-NDGM4DAP.mjs → chunk-BYASSHKJ.mjs} +1 -1
- package/dist/chunk-C2ZSNUXQ.mjs +1 -0
- package/dist/chunk-CIA6WVXQ.mjs +1 -0
- package/dist/chunk-CIKFUS7J.mjs +1 -0
- package/dist/chunk-CK3CDA3L.mjs +1 -0
- package/dist/{chunk-AH6LZOQC.mjs → chunk-DO46YJCX.mjs} +1 -1
- package/dist/chunk-DRPRASD6.mjs +1 -0
- package/dist/chunk-EBJ23A7F.mjs +1 -0
- package/dist/chunk-ECMLCGAM.mjs +1 -0
- package/dist/chunk-EILBHZDX.mjs +1 -0
- package/dist/{chunk-DOCRI237.mjs → chunk-ELKVFX2O.mjs} +1 -1
- package/dist/{chunk-EXIUW3JX.mjs → chunk-EUFR7R5Q.mjs} +1 -1
- package/dist/chunk-EZVFCJEG.mjs +1 -0
- package/dist/chunk-FHCKFQBY.mjs +1 -0
- package/dist/chunk-FJWWBKCQ.mjs +1 -0
- package/dist/chunk-FON4QY7P.mjs +1 -0
- package/dist/chunk-GLF7Z5IR.mjs +1 -0
- package/dist/chunk-HAZXZ5TU.mjs +1 -0
- package/dist/chunk-HKHZBKAN.mjs +1 -0
- package/dist/chunk-I6FJ533W.mjs +1 -0
- package/dist/chunk-I7AI52RX.mjs +1 -0
- package/dist/{chunk-YHYFWNN6.mjs → chunk-IAXSC2ZN.mjs} +1 -1
- package/dist/chunk-IGKU4YIV.mjs +1 -0
- package/dist/chunk-IW7V7WNL.mjs +1 -0
- package/dist/chunk-JCW2WY7X.mjs +1 -0
- package/dist/chunk-JEGBAHYK.mjs +1 -0
- package/dist/chunk-JLK3VRBT.mjs +1 -0
- package/dist/chunk-KCDHP4N3.mjs +1 -0
- package/dist/chunk-KF73S7MG.mjs +1 -0
- package/dist/chunk-L6S66APQ.mjs +1 -0
- package/dist/chunk-LH7HKUCK.mjs +1 -0
- package/dist/chunk-LOUWY55X.mjs +1 -0
- package/dist/chunk-LXFKOYLK.mjs +1 -0
- package/dist/chunk-MDPZUECK.mjs +1 -0
- package/dist/chunk-MHWIFSXJ.mjs +1 -0
- package/dist/chunk-MPEVFQ43.mjs +1 -0
- package/dist/{chunk-57FM7XQV.mjs → chunk-NI77Y3WC.mjs} +1 -1
- package/dist/chunk-NXTWB3A7.mjs +1 -0
- package/dist/chunk-OA63PYHZ.mjs +1 -0
- package/dist/chunk-OFJUTWJU.mjs +1 -0
- package/dist/chunk-OREALBUO.mjs +1 -0
- package/dist/chunk-OVZ4CQGM.mjs +1 -0
- package/dist/chunk-PILMDBAX.mjs +1 -0
- package/dist/chunk-PLE6FFKY.mjs +1 -0
- package/dist/chunk-PRPXMDZ7.mjs +1 -0
- package/dist/chunk-PWQB3FIW.mjs +1 -0
- package/dist/chunk-ROKRMYFR.mjs +1 -0
- package/dist/chunk-SNAJBV7T.mjs +30 -0
- package/dist/chunk-SOGN7S54.mjs +1 -0
- package/dist/chunk-SOT33EQ4.mjs +1 -0
- package/dist/chunk-SQA27YGA.mjs +1 -0
- package/dist/chunk-SUAHDXJZ.mjs +1 -0
- package/dist/chunk-TCGXG7UA.mjs +1 -0
- package/dist/chunk-TMSGNHXH.mjs +1 -0
- package/dist/chunk-TQ3SP5TE.mjs +1 -0
- package/dist/chunk-UTP56NCY.mjs +1 -0
- package/dist/chunk-W2QQVB2H.mjs +1 -0
- package/dist/chunk-WC4ZNVFM.mjs +1 -0
- package/dist/chunk-WDSFOF2E.mjs +1 -0
- package/dist/chunk-WP2SHSCG.mjs +1 -0
- package/dist/chunk-X6I6KQDG.mjs +1 -0
- package/dist/chunk-XJJDBMZI.mjs +1 -0
- package/dist/chunk-XY7YW7SH.mjs +1 -0
- package/dist/chunk-YMWXWXPV.mjs +1 -0
- package/dist/chunk-YU3ZY76H.mjs +1 -0
- package/dist/chunk-YVT3J6JB.mjs +1 -0
- package/dist/chunk-YYFF2X3L.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/codex-note-context-UI55CWRI.mjs +1 -0
- package/dist/codex-project-LIU27RXA.mjs +1 -0
- package/dist/codex-session-registry-YNU6LEVH.mjs +1 -0
- package/dist/codex-store-mount-EPETPOBA.mjs +1 -0
- package/dist/{dev-server-DtX2_HCa.d.mts → dev-server-BRrhkH5t.d.mts} +11 -1
- package/dist/dev-server-WYB2CRC5.mjs +1 -0
- package/dist/focus-inspection-42IEM45O.mjs +1 -0
- package/dist/guest-admission.d.mts +2 -0
- package/dist/guest-admission.mjs +1 -0
- package/dist/guest-live-canvas.d.mts +2 -0
- package/dist/guest-live-canvas.mjs +1 -0
- package/dist/index.d.mts +6 -6
- package/dist/index.mjs +1 -1
- package/dist/invitationLink-LUIIOAEZ.mjs +1 -0
- package/dist/inviteQr-HVHH45SN.mjs +1 -0
- package/dist/inviteQr-U77MLSEQ.mjs +1 -0
- package/dist/media.d.mts +3 -3
- package/dist/memory-store.d.mts +5 -1
- package/dist/page-interaction-TV3P6B3X.mjs +1 -0
- package/dist/page-planes-2ZepTpen.d.mts +817 -0
- package/dist/participantBootstrap-BuTrTQbo.d.mts +22 -0
- package/dist/{participantBootstrap-DFJlcKRI.d.mts → participantBootstrap-DuosDN9G.d.mts} +9 -3
- package/dist/peer-client-RSC6EGAF.mjs +1 -0
- package/dist/plain-html-EF7MUNRZ.mjs +1 -0
- package/dist/plugin-astro.d.mts +5 -2
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-next.mjs +1 -1
- package/dist/plugin-nuxt.d.mts +4 -2
- package/dist/plugin-nuxt.mjs +1 -1
- package/dist/plugin-vite.d.mts +69 -9
- package/dist/plugin-vite.mjs +1 -1
- package/dist/qr-encoder.mjs +3 -0
- package/dist/server.d.mts +42 -19
- package/dist/server.mjs +1 -1
- package/dist/shared-page-GO76UP7I.mjs +1 -0
- package/dist/{subjects-DdavjSTL.d.mts → subjects-BhO1x5tz.d.mts} +80 -1
- package/dist/taste-proposal-session-DBOUA54V.mjs +1 -0
- package/dist/toolbarFonts-GVPRHJGB.mjs +1 -0
- package/dist/{types-g9YCBx4Z.d.mts → types-CggBG-H6.d.mts} +1 -137
- package/dist/{video-adapter-DB6Hex1f.d.mts → video-adapter-B8J5awc_.d.mts} +2 -2
- package/dist/workspace-snapshot-6LN7U2NJ.mjs +1 -0
- package/package.json +45 -22
- package/samples/README.md +32 -0
- package/samples/build.d.mts +16 -0
- package/samples/build.mjs +138 -0
- package/dist/ExploreAttachment-H5WPEAZB.mjs +0 -1
- package/dist/PagePreviewLayer-WCYOBKAS.mjs +0 -1
- package/dist/ParticipantRuntime-HEC26AER.mjs +0 -1
- package/dist/PhoneHostGate-Q2AXVOSH.mjs +0 -1
- package/dist/PopmeltTasteConnectedPane-B7DHQKRQ.mjs +0 -1
- package/dist/PreviewRuntime-H2UOLP6T.mjs +0 -1
- package/dist/SuppliedContext-7ASO6GAW.mjs +0 -1
- package/dist/ThreadErrorCard-6R7W3RGZ.mjs +0 -1
- package/dist/ThreadPanel-3IS7GUYS.mjs +0 -1
- package/dist/bridgeSSEStream-K3UIMBTC.mjs +0 -1
- package/dist/bridgeWebSocketStream-2SUZUBE3.mjs +0 -1
- package/dist/browser-runtime-ILNTJLZ5.mjs +0 -1
- package/dist/canvas-chat-note-MGAEUYJO.mjs +0 -1
- package/dist/checkFixture-YE2ROOLL.mjs +0 -1
- package/dist/chunk-26P7UUHT.mjs +0 -1
- package/dist/chunk-2P2NUZW7.mjs +0 -1
- package/dist/chunk-3SEXH3AZ.mjs +0 -1
- package/dist/chunk-3XJEC6LS.mjs +0 -1
- package/dist/chunk-4LHTPRFY.mjs +0 -1
- package/dist/chunk-5D2ADU7H.mjs +0 -1
- package/dist/chunk-5K7SACPW.mjs +0 -1
- package/dist/chunk-67QNAAUC.mjs +0 -1
- package/dist/chunk-7CGKO4IU.mjs +0 -30
- package/dist/chunk-BACXPVHP.mjs +0 -1
- package/dist/chunk-DC47WNPG.mjs +0 -1
- package/dist/chunk-DJTGR3RO.mjs +0 -1
- package/dist/chunk-DLUNNAZC.mjs +0 -1
- package/dist/chunk-EX63NVDN.mjs +0 -1
- package/dist/chunk-FLTHWLRC.mjs +0 -1
- package/dist/chunk-G6RYESYI.mjs +0 -1
- package/dist/chunk-G7JR5Z3P.mjs +0 -1
- package/dist/chunk-GBVPRXA3.mjs +0 -1
- package/dist/chunk-HAE5LUJX.mjs +0 -1
- package/dist/chunk-HU2XWUJC.mjs +0 -1
- package/dist/chunk-HV7HRQ2S.mjs +0 -1
- package/dist/chunk-J4WDYITA.mjs +0 -1
- package/dist/chunk-L7QONR4K.mjs +0 -1
- package/dist/chunk-LVEMYZOA.mjs +0 -1
- package/dist/chunk-MSWXKP77.mjs +0 -1
- package/dist/chunk-NSCO633B.mjs +0 -1
- package/dist/chunk-NWE5PYKM.mjs +0 -1
- package/dist/chunk-O4HZP3RP.mjs +0 -1
- package/dist/chunk-OAHYSDJ4.mjs +0 -1
- package/dist/chunk-PNTM77NT.mjs +0 -1
- package/dist/chunk-RUTWU5W2.mjs +0 -1
- package/dist/chunk-TLREGQQB.mjs +0 -1
- package/dist/chunk-TUXBMJQZ.mjs +0 -1
- package/dist/chunk-V2I7PSJW.mjs +0 -1
- package/dist/chunk-WDAXARLI.mjs +0 -1
- package/dist/chunk-WHJEKDNP.mjs +0 -1
- package/dist/chunk-X2Q3H6X7.mjs +0 -1
- package/dist/chunk-XJQJQ5V5.mjs +0 -1
- package/dist/chunk-XT6PHPPG.mjs +0 -1
- package/dist/chunk-YD3PDEFX.mjs +0 -1
- package/dist/chunk-ZDXQ7WNW.mjs +0 -1
- package/dist/codex-note-context-YFURG7VL.mjs +0 -1
- package/dist/codex-project-3NSU5OWL.mjs +0 -1
- package/dist/codex-session-registry-ONODFWFD.mjs +0 -1
- package/dist/focus-inspection-SZJ5KP23.mjs +0 -1
- package/dist/peer-client-56EAHIGF.mjs +0 -1
- package/dist/taste-proposal-session-XU4N7RUV.mjs +0 -1
- package/dist/workspace-snapshot-RTTXNNUX.mjs +0 -1
package/dist/chunk-LVEMYZOA.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";var e=new WeakMap,n=new WeakMap;function t(t,a){a&&(e.set(t,a),n.set(a,t))}function a(t){let a=e.get(t);return a?.isConnected&&n.get(a)===t?a.getBoundingClientRect():null}export{t as a,a as b};
|
package/dist/chunk-MSWXKP77.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{forwardRef as a}from"react";import{jsxs as h,Fragment as d,jsx as t}from"react/jsx-runtime";function e(d,t){return a(function({size:a=24,width:e=a,height:i=a,color:c="currentColor",className:l,children:r,...p},n){let M=!!r||Object.keys(p).some(a=>a.startsWith("aria-")||"role"===a||"title"===a);return h("svg",{ref:n,xmlns:"http://www.w3.org/2000/svg",width:e,height:i,viewBox:"0 0 24 24",fill:"none",stroke:c,strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round",className:l?`lucide ${d} ${l}`:`lucide ${d}`,"aria-hidden":!M||void 0,...p,children:[t,r]})})}var i=e("lucide-smartphone",h(d,{children:[t("rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2"}),t("path",{d:"M12 18h.01"})]})),c=e("lucide-a-large-small",h(d,{children:[t("path",{d:"m15 16 2.536-7.328a1.02 1.02 1 0 1 1.928 0L22 16"}),t("path",{d:"M15.697 14h5.606"}),t("path",{d:"m2 16 4.039-9.69a.5.5 0 0 1 .923 0L11 16"}),t("path",{d:"M3.304 13h6.392"})]})),l=e("lucide-text-align-center lucide-align-center",h(d,{children:[t("path",{d:"M21 5H3"}),t("path",{d:"M17 12H7"}),t("path",{d:"M19 19H5"})]})),r=e("lucide-align-center-vertical",h(d,{children:[t("path",{d:"M12 2v20"}),t("path",{d:"M8 10H4a2 2 0 0 1-2-2V6c0-1.1.9-2 2-2h4"}),t("path",{d:"M16 10h4a2 2 0 0 0 2-2V6a2 2 0 0 0-2-2h-4"}),t("path",{d:"M8 20H7a2 2 0 0 1-2-2v-2c0-1.1.9-2 2-2h1"}),t("path",{d:"M16 14h1a2 2 0 0 1 2 2v2a2 2 0 0 1-2 2h-1"})]})),p=e("lucide-align-end-vertical",h(d,{children:[t("rect",{width:"16",height:"6",x:"2",y:"4",rx:"2"}),t("rect",{width:"9",height:"6",x:"9",y:"14",rx:"2"}),t("path",{d:"M22 22V2"})]})),n=e("lucide-align-horizontal-justify-center",h(d,{children:[t("rect",{width:"6",height:"14",x:"2",y:"5",rx:"2"}),t("rect",{width:"6",height:"10",x:"16",y:"7",rx:"2"}),t("path",{d:"M12 2v20"})]})),M=e("lucide-align-horizontal-justify-end",h(d,{children:[t("rect",{width:"6",height:"14",x:"2",y:"5",rx:"2"}),t("rect",{width:"6",height:"10",x:"12",y:"7",rx:"2"}),t("path",{d:"M22 2v20"})]})),s=e("lucide-align-horizontal-justify-start",h(d,{children:[t("rect",{width:"6",height:"14",x:"6",y:"5",rx:"2"}),t("rect",{width:"6",height:"10",x:"16",y:"7",rx:"2"}),t("path",{d:"M2 2v20"})]})),u=e("lucide-align-horizontal-space-around",h(d,{children:[t("rect",{width:"6",height:"10",x:"9",y:"7",rx:"2"}),t("path",{d:"M4 22V2"}),t("path",{d:"M20 22V2"})]})),o=e("lucide-align-horizontal-space-between",h(d,{children:[t("rect",{width:"6",height:"14",x:"3",y:"5",rx:"2"}),t("rect",{width:"6",height:"10",x:"15",y:"7",rx:"2"}),t("path",{d:"M3 2v20"}),t("path",{d:"M21 2v20"})]})),x=e("lucide-text-align-justify lucide-align-justify",h(d,{children:[t("path",{d:"M3 5h18"}),t("path",{d:"M3 12h18"}),t("path",{d:"M3 19h18"})]})),v=e("lucide-text-align-start lucide-text lucide-align-left",h(d,{children:[t("path",{d:"M21 5H3"}),t("path",{d:"M15 12H3"}),t("path",{d:"M17 19H3"})]})),g=e("lucide-text-align-end lucide-align-right",h(d,{children:[t("path",{d:"M21 5H3"}),t("path",{d:"M21 12H9"}),t("path",{d:"M21 19H7"})]})),m=e("lucide-align-start-vertical",h(d,{children:[t("rect",{width:"9",height:"6",x:"6",y:"14",rx:"2"}),t("rect",{width:"16",height:"6",x:"6",y:"4",rx:"2"}),t("path",{d:"M2 2v20"})]})),y=e("lucide-archive",h(d,{children:[t("rect",{width:"20",height:"5",x:"2",y:"3",rx:"1"}),t("path",{d:"M4 8v11a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8"}),t("path",{d:"M10 12h4"})]})),w=e("lucide-arrow-down",h(d,{children:[t("path",{d:"M12 5v14"}),t("path",{d:"m19 12-7 7-7-7"})]})),H=e("lucide-arrow-left",h(d,{children:[t("path",{d:"m12 19-7-7 7-7"}),t("path",{d:"M19 12H5"})]})),z=e("lucide-arrow-left-right",h(d,{children:[t("path",{d:"M8 3 4 7l4 4"}),t("path",{d:"M4 7h16"}),t("path",{d:"m16 21 4-4-4-4"}),t("path",{d:"M20 17H4"})]})),f=e("lucide-arrow-right",h(d,{children:[t("path",{d:"M5 12h14"}),t("path",{d:"m12 5 7 7-7 7"})]})),V=e("lucide-arrow-up-right",h(d,{children:[t("path",{d:"M7 7h10v10"}),t("path",{d:"M7 17 17 7"})]})),L=e("lucide-ban",h(d,{children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M4.929 4.929 19.07 19.071"})]})),k=e("lucide-between-horizontal-start lucide-between-horizonal-start",h(d,{children:[t("rect",{width:"13",height:"7",x:"8",y:"3",rx:"1"}),t("path",{d:"m2 9 3 3-3 3"}),t("rect",{width:"13",height:"7",x:"8",y:"14",rx:"1"})]})),b=e("lucide-between-vertical-end",h(d,{children:[t("rect",{width:"7",height:"13",x:"3",y:"3",rx:"1"}),t("path",{d:"m9 22 3-3 3 3"}),t("rect",{width:"7",height:"13",x:"14",y:"3",rx:"1"})]})),A=e("lucide-blend",h(d,{children:[t("circle",{cx:"15",cy:"9",r:"7"}),t("circle",{cx:"9",cy:"15",r:"7"})]})),j=e("lucide-letter-b lucide-bold",t("path",{d:"M6 12h9a4 4 0 010 8H7a1 1 0 01-1-1V5a1 1 0 011-1h7a4 4 0 010 8"})),C=e("lucide-bot",h(d,{children:[t("path",{d:"M12 8V4H8"}),t("rect",{width:"16",height:"12",x:"4",y:"8",rx:"2"}),t("path",{d:"M2 14h2"}),t("path",{d:"M20 14h2"}),t("path",{d:"M15 13v2"}),t("path",{d:"M9 13v2"})]})),q=e("lucide-brain",h(d,{children:[t("path",{d:"M12 18V5"}),t("path",{d:"M15 13a4.17 4.17 0 01-3-4 4.17 4.17 0 01-3 4"}),t("path",{d:"M17.707 6.294A3 3 0 1012 5a3 3 0 10-5.707 1.294"}),t("path",{d:"M17.996 5.125a4 4 0 012.526 5.77"}),t("path",{d:"M18 18a4 4 0 002-7.465"}),t("path",{d:"M19.967 17.482a4 4 0 11-7.967.517 4 4 0 11-7.967-.517"}),t("path",{d:"M6 18a4 4 0 01-2-7.465"}),t("path",{d:"M6.004 5.125a4 4 0 00-2.526 5.77"})]})),N=e("lucide-check",t("path",{d:"M20 6 9 17l-5-5"})),Z=e("lucide-chevron-down",t("path",{d:"m6 9 6 6 6-6"})),$=e("lucide-chevron-left",t("path",{d:"m15 18-6-6 6-6"})),B=e("lucide-chevron-right",t("path",{d:"m9 18 6-6-6-6"})),O=e("lucide-circle-dashed",h(d,{children:[t("path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0"}),t("path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0"}),t("path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7"}),t("path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8"}),t("path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69"}),t("path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8"}),t("path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69"}),t("path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7"})]})),W=e("lucide-clock",h(d,{children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M12 6v6l4 2"})]})),D=e("lucide-command",t("path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3"})),E=e("lucide-component",h(d,{children:[t("path",{d:"M15.536 11.293a1 1 0 0 0 0 1.414l2.376 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"}),t("path",{d:"M2.297 11.293a1 1 0 0 0 0 1.414l2.377 2.377a1 1 0 0 0 1.414 0l2.377-2.377a1 1 0 0 0 0-1.414L6.088 8.916a1 1 0 0 0-1.414 0z"}),t("path",{d:"M8.916 17.912a1 1 0 0 0 0 1.415l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.415l-2.377-2.376a1 1 0 0 0-1.414 0z"}),t("path",{d:"M8.916 4.674a1 1 0 0 0 0 1.414l2.377 2.376a1 1 0 0 0 1.414 0l2.377-2.376a1 1 0 0 0 0-1.414l-2.377-2.377a1 1 0 0 0-1.414 0z"})]})),F=e("lucide-copy",h(d,{children:[t("rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2"}),t("path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"})]})),G=e("lucide-corner-down-left",h(d,{children:[t("path",{d:"M20 4v7a4 4 0 0 1-4 4H4"}),t("path",{d:"m9 10-5 5 5 5"})]})),I=e("lucide-eye",h(d,{children:[t("path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0"}),t("circle",{cx:"12",cy:"12",r:"3"})]})),J=e("lucide-eye-off",h(d,{children:[t("path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49"}),t("path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242"}),t("path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143"}),t("path",{d:"m2 2 20 20"})]})),K=e("lucide-fingerprint-pattern lucide-fingerprint",h(d,{children:[t("path",{d:"M12 10a2 2 0 0 0-2 2c0 1.02-.1 2.51-.26 4"}),t("path",{d:"M14 13.12c0 2.38 0 6.38-1 8.88"}),t("path",{d:"M17.29 21.02c.12-.6.43-2.3.5-3.02"}),t("path",{d:"M2 12a10 10 0 0 1 18-6"}),t("path",{d:"M2 16h.01"}),t("path",{d:"M21.8 16c.2-2 .131-5.354 0-6"}),t("path",{d:"M5 19.5C5.5 18 6 15 6 12a6 6 0 0 1 .34-2"}),t("path",{d:"M8.65 22c.21-.66.45-1.32.57-2"}),t("path",{d:"M9 6.8a6 6 0 0 1 9 5.2v2"})]})),P=e("lucide-folder",t("path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z"})),Q=e("lucide-hand",h(d,{children:[t("path",{d:"M18 11V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2"}),t("path",{d:"M14 10V4a2 2 0 0 0-2-2a2 2 0 0 0-2 2v2"}),t("path",{d:"M10 10.5V6a2 2 0 0 0-2-2a2 2 0 0 0-2 2v8"}),t("path",{d:"M18 8a2 2 0 1 1 4 0v6a8 8 0 0 1-8 8h-2c-2.8 0-4.5-.86-5.99-2.34l-3.6-3.6a2 2 0 0 1 2.83-2.82L7 15"})]})),R=e("lucide-rotate-ccw-clock lucide-history",h(d,{children:[t("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),t("path",{d:"M3 3v5h5"}),t("path",{d:"M12 7v5l4 2"})]})),S=e("lucide-image",h(d,{children:[t("rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2"}),t("circle",{cx:"9",cy:"9",r:"2"}),t("path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21"})]})),T=e("lucide-info",h(d,{children:[t("circle",{cx:"12",cy:"12",r:"10"}),t("path",{d:"M12 16v-4"}),t("path",{d:"M12 8h.01"})]})),U=e("lucide-link-2",h(d,{children:[t("path",{d:"M9 17H7A5 5 0 0 1 7 7h2"}),t("path",{d:"M15 7h2a5 5 0 1 1 0 10h-2"}),t("line",{x1:"8",x2:"16",y1:"12",y2:"12"})]})),X=e("lucide-loader-circle lucide-loader-2",t("path",{d:"M21 12a9 9 0 1 1-6.219-8.56"})),Y=e("lucide-lock",h(d,{children:[t("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),t("path",{d:"M7 11V7a5 5 0 0 1 10 0v4"})]})),_=e("lucide-lock-open lucide-unlock",h(d,{children:[t("rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2"}),t("path",{d:"M7 11V7a5 5 0 0 1 9.9-1"})]})),aa=e("lucide-log-out",h(d,{children:[t("path",{d:"m16 17 5-5-5-5"}),t("path",{d:"M21 12H9"}),t("path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4"})]})),ha=e("lucide-maximize-2",h(d,{children:[t("path",{d:"M15 3h6v6"}),t("path",{d:"m21 3-7 7"}),t("path",{d:"m3 21 7-7"}),t("path",{d:"M9 21H3v-6"})]})),da=e("lucide-message-circle",t("path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"})),ta=e("lucide-message-circle-question-mark lucide-message-circle-question",h(d,{children:[t("path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719"}),t("path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3"}),t("path",{d:"M12 17h.01"})]})),ea=e("lucide-minimize-2",h(d,{children:[t("path",{d:"m14 10 7-7"}),t("path",{d:"M20 10h-6V4"}),t("path",{d:"m3 21 7-7"}),t("path",{d:"M4 14h6v6"})]})),ia=e("lucide-minus",t("path",{d:"M5 12h14"})),ca=e("lucide-monitor",h(d,{children:[t("rect",{width:"20",height:"14",x:"2",y:"3",rx:"2"}),t("line",{x1:"8",x2:"16",y1:"21",y2:"21"}),t("line",{x1:"12",x2:"12",y1:"17",y2:"21"})]})),la=e("lucide-moon",t("path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401"})),ra=e("lucide-move",h(d,{children:[t("path",{d:"M12 2v20"}),t("path",{d:"m15 19-3 3-3-3"}),t("path",{d:"m19 9 3 3-3 3"}),t("path",{d:"M2 12h20"}),t("path",{d:"m5 9-3 3 3 3"}),t("path",{d:"m9 5 3-3 3 3"})]})),pa=e("lucide-move-horizontal",h(d,{children:[t("path",{d:"m18 8 4 4-4 4"}),t("path",{d:"M2 12h20"}),t("path",{d:"m6 8-4 4 4 4"})]})),na=e("lucide-move-vertical",h(d,{children:[t("path",{d:"M12 2v20"}),t("path",{d:"m8 18 4 4 4-4"}),t("path",{d:"m8 6 4-4 4 4"})]})),Ma=e("lucide-octagon-alert lucide-alert-octagon",h(d,{children:[t("path",{d:"M12 16h.01"}),t("path",{d:"M12 8v4"}),t("path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z"})]})),sa=e("lucide-palette",h(d,{children:[t("path",{d:"M12 22a1 1 0 0 1 0-20 10 9 0 0 1 10 9 5 5 0 0 1-5 5h-2.25a1.75 1.75 0 0 0-1.4 2.8l.3.4a1.75 1.75 0 0 1-1.4 2.8z"}),t("circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor"}),t("circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor"}),t("circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor"}),t("circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor"})]})),ua=e("lucide-pause",h(d,{children:[t("rect",{x:"14",y:"3",width:"5",height:"18",rx:"1"}),t("rect",{x:"5",y:"3",width:"5",height:"18",rx:"1"})]})),oa=e("lucide-pen-line lucide-edit-3",h(d,{children:[t("path",{d:"M13 21h8"}),t("path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z"})]})),xa=e("lucide-play",t("path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z"})),va=e("lucide-plug",h(d,{children:[t("path",{d:"M12 22v-5"}),t("path",{d:"M15 8V2"}),t("path",{d:"M17 8a1 1 0 0 1 1 1v4a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1z"}),t("path",{d:"M9 8V2"})]})),ga=e("lucide-plus",h(d,{children:[t("path",{d:"M5 12h14"}),t("path",{d:"M12 5v14"})]})),ma=e("lucide-refresh-cw",h(d,{children:[t("path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8"}),t("path",{d:"M21 3v5h-5"}),t("path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16"}),t("path",{d:"M8 16H3v5"})]})),ya=e("lucide-reply",h(d,{children:[t("path",{d:"M20 18v-2a4 4 0 0 0-4-4H4"}),t("path",{d:"m9 17-5-5 5-5"})]})),wa=e("lucide-rotate-ccw",h(d,{children:[t("path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8"}),t("path",{d:"M3 3v5h5"})]})),Ha=e("lucide-rotate-cw",h(d,{children:[t("path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8"}),t("path",{d:"M21 3v5h-5"})]})),za=e("lucide-ruler",h(d,{children:[t("path",{d:"M21.3 15.3a2.4 2.4 0 0 1 0 3.4l-2.6 2.6a2.4 2.4 0 0 1-3.4 0L2.7 8.7a2.41 2.41 0 0 1 0-3.4l2.6-2.6a2.41 2.41 0 0 1 3.4 0Z"}),t("path",{d:"m14.5 12.5 2-2"}),t("path",{d:"m11.5 9.5 2-2"}),t("path",{d:"m8.5 6.5 2-2"}),t("path",{d:"m17.5 15.5 2-2"})]})),fa=e("lucide-scaling",h(d,{children:[t("path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7"}),t("path",{d:"M14 15H9v-5"}),t("path",{d:"M16 3h5v5"}),t("path",{d:"M21 3 9 15"})]})),Va=e("lucide-search",h(d,{children:[t("path",{d:"m21 21-4.34-4.34"}),t("circle",{cx:"11",cy:"11",r:"8"})]})),La=e("lucide-send",h(d,{children:[t("path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z"}),t("path",{d:"m21.854 2.147-10.94 10.939"})]})),ka=e("lucide-send-horizontal lucide-send-horizonal",h(d,{children:[t("path",{d:"M3.714 3.048a.498.498 0 0 0-.683.627l2.843 7.627a2 2 0 0 1 0 1.396l-2.842 7.627a.498.498 0 0 0 .682.627l18-8.5a.5.5 0 0 0 0-.904z"}),t("path",{d:"M6 12h16"})]})),ba=e("lucide-settings",h(d,{children:[t("path",{d:"M9.671 4.136a2.34 2.34 0 0 1 4.659 0 2.34 2.34 0 0 0 3.319 1.915 2.34 2.34 0 0 1 2.33 4.033 2.34 2.34 0 0 0 0 3.831 2.34 2.34 0 0 1-2.33 4.033 2.34 2.34 0 0 0-3.319 1.915 2.34 2.34 0 0 1-4.659 0 2.34 2.34 0 0 0-3.32-1.915 2.34 2.34 0 0 1-2.33-4.033 2.34 2.34 0 0 0 0-3.831A2.34 2.34 0 0 1 6.35 6.051a2.34 2.34 0 0 0 3.319-1.915"}),t("circle",{cx:"12",cy:"12",r:"3"})]})),Aa=e("lucide-signal",h(d,{children:[t("path",{d:"M2 20h.01"}),t("path",{d:"M7 20v-4"}),t("path",{d:"M12 20v-8"}),t("path",{d:"M17 20V8"}),t("path",{d:"M22 4v16"})]})),ja=e("lucide-signal-high",h(d,{children:[t("path",{d:"M2 20h.01"}),t("path",{d:"M7 20v-4"}),t("path",{d:"M12 20v-8"}),t("path",{d:"M17 20V8"})]})),Ca=e("lucide-signal-low",h(d,{children:[t("path",{d:"M2 20h.01"}),t("path",{d:"M7 20v-4"})]})),qa=e("lucide-signal-medium",h(d,{children:[t("path",{d:"M2 20h.01"}),t("path",{d:"M7 20v-4"}),t("path",{d:"M12 20v-8"})]})),Na=e("lucide-signal-zero",t("path",{d:"M2 20h.01"})),Za=e("lucide-sliders-horizontal",h(d,{children:[t("path",{d:"M10 5H3"}),t("path",{d:"M12 19H3"}),t("path",{d:"M14 3v4"}),t("path",{d:"M16 17v4"}),t("path",{d:"M21 12h-9"}),t("path",{d:"M21 19h-5"}),t("path",{d:"M21 5h-7"}),t("path",{d:"M8 10v4"}),t("path",{d:"M8 12H3"})]})),$a=e("lucide-square-mouse-pointer lucide-inspect",h(d,{children:[t("path",{d:"M12.034 12.681a.498.498 0 0 1 .647-.647l9 3.5a.5.5 0 0 1-.033.943l-3.444 1.068a1 1 0 0 0-.66.66l-1.067 3.443a.5.5 0 0 1-.943.033z"}),t("path",{d:"M21 11V5a2 2 0 0 0-2-2H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h6"})]})),Ba=e("lucide-stretch-horizontal",h(d,{children:[t("rect",{width:"20",height:"6",x:"2",y:"4",rx:"2"}),t("rect",{width:"20",height:"6",x:"2",y:"14",rx:"2"})]})),Oa=e("lucide-sun",h(d,{children:[t("circle",{cx:"12",cy:"12",r:"4"}),t("path",{d:"M12 2v2"}),t("path",{d:"M12 20v2"}),t("path",{d:"m4.93 4.93 1.41 1.41"}),t("path",{d:"m17.66 17.66 1.41 1.41"}),t("path",{d:"M2 12h2"}),t("path",{d:"M20 12h2"}),t("path",{d:"m6.34 17.66-1.41 1.41"}),t("path",{d:"m19.07 4.93-1.41 1.41"})]})),Wa=e("lucide-terminal",h(d,{children:[t("path",{d:"M12 19h8"}),t("path",{d:"m4 17 6-6-6-6"})]})),Da=e("lucide-thumbs-up",h(d,{children:[t("path",{d:"M15 5.88 14 10h5.83a2 2 0 0 1 1.92 2.56l-2.33 8A2 2 0 0 1 17.5 22H4a2 2 0 0 1-2-2v-8a2 2 0 0 1 2-2h2.76a2 2 0 0 0 1.79-1.11L12 2a3.13 3.13 0 0 1 3 3.88Z"}),t("path",{d:"M7 10v12"})]})),Ea=e("lucide-trash lucide-trash-2",h(d,{children:[t("path",{d:"M10 11v6"}),t("path",{d:"M14 11v6"}),t("path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"}),t("path",{d:"M3 6h18"}),t("path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2"})]})),Fa=e("lucide-triangle-alert lucide-alert-triangle",h(d,{children:[t("path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3"}),t("path",{d:"M12 9v4"}),t("path",{d:"M12 17h.01"})]})),Ga=e("lucide-user",h(d,{children:[t("path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2"}),t("circle",{cx:"12",cy:"7",r:"4"})]})),Ia=e("lucide-user-plus",h(d,{children:[t("path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2"}),t("circle",{cx:"9",cy:"7",r:"4"}),t("line",{x1:"19",x2:"19",y1:"8",y2:"14"}),t("line",{x1:"22",x2:"16",y1:"11",y2:"11"})]})),Ja=e("lucide-x",h(d,{children:[t("path",{d:"M18 6 6 18"}),t("path",{d:"m6 6 12 12"})]})),Ka=e("lucide-zap",t("path",{d:"M15.914 4a1.5 1.5 0 00-2.474-1.561l-9 9A1.5 1.5 0 005.5 14h4.002a.5.5 0 01.471.666L8.086 20a1.5 1.5 0 002.475 1.56l9-9A1.5 1.5 0 0018.5 10h-3.997a.5.5 0 01-.472-.667z"}));export{ta as $,C as A,Ca as Aa,q as B,qa as Ba,N as C,Na as Ca,Z as D,Za as Da,$ as E,$a as Ea,B as F,Ba as Fa,O as G,Oa as Ga,W as H,Wa as Ha,D as I,Da as Ia,E as J,Ea as Ja,F as K,Fa as Ka,G as L,Ga as La,I as M,Ia as Ma,J as N,Ja as Na,K as O,Ka as Oa,P,Q,R,S,T,U,X as V,Y as W,_ as X,aa as Y,ha as Z,da as _,e as a,ea as aa,i as b,ia as ba,c,ca,l as d,la as da,r as e,ra as ea,p as f,pa as fa,n as g,na as ga,M as h,Ma as ha,s as i,sa as ia,u as j,ua as ja,o as k,oa as ka,x as l,xa as la,v as m,va as ma,g as n,ga as na,m as o,ma as oa,y as p,ya as pa,w as q,wa as qa,H as r,Ha as ra,z as s,za as sa,f as t,fa as ta,V as u,Va as ua,L as v,La as va,k as w,ka as wa,b as x,ba as xa,A as y,Aa as ya,j as z,ja as za};
|
package/dist/chunk-NSCO633B.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{createContext as e}from"react";var t=e(null),n=e(void 0);function i(e,t){let n=new Set;for(let t of e){if("done"!==t.type&&"error"!==t.type)continue;let e=String(t.data.jobId??"");e&&n.add(e)}return t&&n.add(t),n}function r(e,t,n){let i=new Set(t);return e.filter(e=>!i.has(e)&&!n.has(e))}function l(e,t,n,i,r){if(!e)return null;let l=n=>!r.has(n)&&(t[n]?.threadId===e||i[n]===e);return n.find(l)??Object.keys(t).find(l)??null}function o(e,t){return new Set(e.filter(e=>"human"===e.lastMessageRole&&!t.has(e.id)).map(e=>e.id))}function a(e){return new Set(e.flatMap(e=>e.acknowledgedJobIds??[]))}function c(e){return new Set(e.filter(e=>!e.pendingQuestion).map(e=>e.id))}function s(e,t){return!t||e.some(e=>!(e.jobId!==t||"assistant"!==e.role&&!e.error&&!e.cancelled||e.queued))}function u(e,t){let n=`${t||"/"}:`;return e.startsWith(n)?e.slice(n.length)||null:e.startsWith("/")?null:e}function f(e,t,n){let i=new Map,r=new Map;for(let n of e)if(0===(n.targetBindings?.length??0))for(let e of n.elementIdentifiers??[]){let n=u(e,t);n&&r.set(n,(r.get(n)??0)+1)}for(let l of e){if(!l.lifecycle?.jobId)continue;let e={...l.lifecycle,jobId:l.lifecycle.jobId,color:l.color,title:l.title,annotationNumber:l.annotationNumber};if((l.targetBindings?.length??0)>0)for(let r of l.targetBindings??[]){if("opaque"===r.anchor.type){let t=n?.(r.anchor);if(!t?.length)continue;i.set(r.id,{...e,targetBindingId:r.id,selectors:t,continuationEligible:r.continuationEligible??!1});continue}if(r.anchor.pathname!==t)continue;let l=[r.anchor.runtimeSelector,r.anchor.structuralSelector,...r.anchor.legacySelectors??[]].filter(e=>!!e);i.set(r.id,{...e,targetBindingId:r.id,selectors:l,continuationEligible:r.continuationEligible??!1,...r.anchor.targetFingerprint?{targetFingerprint:r.anchor.targetFingerprint}:{}})}else for(let n of l.elementIdentifiers??[]){let o=u(n,t);o&&![...i.values()].some(e=>e.selectors?.includes(o))&&i.set(`legacy:${l.lifecycle.threadId}:${o}`,{...e,selectors:[o],continuationEligible:1===(l.elementIdentifiers?.length??0)&&1===r.get(o)})}}return i}export{t as a,n as b,i as c,r as d,l as e,o as f,a as g,c as h,s as i,u as j,f as k};
|
package/dist/chunk-NWE5PYKM.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as t,f as e}from"./chunk-DLUNNAZC.mjs";import{i as a,r,z as i}from"./chunk-7CGKO4IU.mjs";import{readFile as o,realpath as n,mkdir as s,writeFile as c}from"fs/promises";import{createHash as p}from"crypto";import{join as d,resolve as l}from"path";function u(t,e){let a=p("sha256").update(e).digest("hex");return d(t,".popmelt","participant-agents",a+".json")}async function f(t,a){if(a.storeId!==t.storeId)return{ok:!1,body:{status:"writable_store_required"}};if("string"!=typeof a.threadId||!a.threadId||"string"!=typeof a.text||!a.text.trim()||a.text.length>8e3)return{ok:!1,body:{status:"invalid_note"}};let r;try{r=await m(t,t.sessionId,!0)}catch(t){if("ENOENT"!==t.code)throw t;return{ok:!1,body:{status:"participant_invitation_required"}}}if(!r)return{ok:!1,body:{status:"enrolled_bridge_required"}};let i=await e(r.endpoint,"/participants/thread-note",{...r.request,method:"POST",signal:AbortSignal.timeout(3e4),body:JSON.stringify({storeId:t.storeId,threadId:a.threadId,reply:a.text,sessionId:t.sessionId,requestId:a.requestId})});return{ok:i.response.ok,body:i.body}}async function m(t,i,s=!1){let c=await o(d(t.projectRoot,".popmelt","participant-bridge.json"),"utf8").then(JSON.parse).catch(e=>{if("ENOENT"!==e.code||!t.bridgePort)throw e;return{projectId:t.projectId,port:t.bridgePort}});if(c.projectId!==t.projectId||!Number.isInteger(c.port)||c.port<1||c.port>65535)return null;let p={redirect:"error",signal:AbortSignal.timeout(3e3)},l=await e(c,"/status",p);if(!l.response.ok||l.body?.projectId!==t.projectId)return null;let f,m=u(t.projectRoot,i);try{f=JSON.parse(await o(m,"utf8"))}catch(l){if("ENOENT"!==l.code||!s)throw l;let u=await n(t.projectRoot),h=r(i);if(a(u)!==t.projectId||!h)return null;let g=JSON.parse(await o(d(u,".popmelt","participant-host.json"),"utf8"));if(!(await e(c,"/participants/agent-join",{...p,method:"POST",headers:{"X-Popmelt-Participant-Id":g.participantId,"X-Popmelt-Participant-Token":g.token},body:JSON.stringify({sessionId:i,name:h,headless:!0})})).response.ok)return null;f=JSON.parse(await o(m,"utf8"))}return{endpoint:c,request:{...p,headers:{"X-Popmelt-Participant-Id":f.participantId,"X-Popmelt-Participant-Token":f.token}}}}async function h(t,a,r){let i=[t,...t.mountedStores].find(t=>t.storeId===a.storeId);if(!i||r&&i!==t)return{ok:!1,body:{status:"store_unavailable"}};if(r&&("string"!=typeof a.threadId||!a.threadId))return{ok:!1,body:{status:"thread_required"}};let o=await m(i,t.sessionId,r).catch(t=>{if("ENOENT"===t.code)return null;throw t});if(!o)return{ok:!1,body:{status:"enrolled_bridge_required",message:"Join this project as a Popmelt peer and check that its bridge is running."}};let{endpoint:n,request:s}=o,c=await e(n,r?t.sessionId.startsWith("claude:")?"/participants/link-claude-chat":"/participants/link-codex-chat":"/participants/check-claude-notes",{...s,method:"POST",body:JSON.stringify({sessionId:t.sessionId,...r?{threadId:a.threadId}:{}})});return{ok:c.response.ok,body:c.body}}async function g(r,l,f={}){if(t())return{status:"already_managed_by_bridge"};if((await e(r,"/status",{redirect:"error",signal:AbortSignal.timeout(3e3)})).body?.participantSessions)return async function(t,r,l){if(!l.projectRoot)throw new Error("Participant connections require the active project root");let f=await n(l.projectRoot);if(a(f)!==t.projectId)throw new Error("Participant project does not match");let m,h,g=d(f,".popmelt"),w=p("sha256").update(r).digest("hex"),I=async(a,r,i)=>{let o=await e(t,"/participants/"+a,{method:"POST",redirect:"error",headers:{"X-Popmelt-Participant-Id":r.participantId,"X-Popmelt-Participant-Token":r.token},body:JSON.stringify(i),signal:AbortSignal.timeout(9e4)}),n=o.body;if(!o.response.ok||n.error)throw new Error(n.error??"Participant connection unavailable");return n};try{m=JSON.parse(await o(u(f,r),"utf8"))}catch(t){if("ENOENT"!==t.code)throw t;if(!l.name)return{status:"participant_invitation_required"};let e=JSON.parse(await o(d(g,"participant-host.json"),"utf8")),a=await I("agent-join",e,{sessionId:r,name:l.name});m=a.credential,h=a.participant}if(!l.action){let t=await I("agent-connect",m,{});return{status:"participant_connected",participantId:m.participantId,participant:t.participant??h}}let y=await I("agent-act",m,{action:i(l.action)}),b=y.evidence;if(b?.frame?.image){let t=b.frame.image;if(!/^data:image\/jpeg;base64,[A-Za-z0-9+/=]+$/.test(t)||t.length>7e5)throw new Error("Invalid participant preview");let e=d(g,"artifacts","participant-previews");await s(e,{recursive:!0,mode:448});let a=d(e,w+".jpg");return await c(a,Buffer.from(t.slice(t.indexOf(",")+1),"base64"),{mode:384}),{status:"participant_connected",participant:y.participant,evidence:{...b,frame:{imagePath:a,targets:b.frame.targets}}}}return{status:"participant_connected",participant:y.participant,evidence:y.evidence}}(r,l,f);let m=async(t,a)=>{let i=await e(r,`/peers/${t}`,{method:"POST",body:JSON.stringify(a),signal:AbortSignal.timeout(5e4)}),o=i.body;if(!i.response.ok||o?.error)throw new Error(o?.error??"Peer connection unavailable");return o},h=await m("join",{sessionId:l,name:f.name}),g=f.action?await m("act",{token:h.token,clientId:f.clientId,action:i(f.action)}):h,w=g.peer;return{...g.status?{status:g.status}:{},...w?{peer:{...w,state:w.state?{annotations:w.state.annotations,styleModifications:w.state.styleModifications,textModifications:w.state.textModifications,undoDepth:w.state.undoStack.length,redoDepth:w.state.redoStack.length}:null}}:{},...g.evidence?{evidence:g.evidence}:{},clients:h.clients}}async function w(t){let r=e=>{let a=t.indexOf(e);return a>=0?t[a+1]:void 0},i=r("--session");if(!i)throw new Error("Usage: popmelt peer --session <stable-agent-session> [--project-root <active-project>] [--name <your-name>] [--client <canvas-id>] [--action <JSON>]");let s=await n(l(r("--project-root")??process.cwd())),c=JSON.parse(await o(d(s,".popmelt","bridge.lock"),"utf8")),p=a(s),u=await e({port:c.port,projectId:p},"/status",{signal:AbortSignal.timeout(3e3)});if(!u.response.ok||u.body.projectRoot!==s&&(!u.body.participantSessions||u.body.projectId!==p))throw new Error("No matching running project bridge");let f=r("--action");console.log(JSON.stringify(await g({port:c.port,projectId:p},i,{name:r("--name"),projectRoot:s,clientId:r("--client"),action:f?JSON.parse(f):void 0}),null,2))}export{u as a,f as b,m as c,h as d,g as e,w as f};
|
package/dist/chunk-O4HZP3RP.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{a as e}from"./chunk-XTOCFTVW.mjs";function t(){return{schemaVersion:1,name:"",constraints:[{id:"basis",name:"basis",kind:"layout",value:"16",parentId:null,derivative:1,scale:.75},{id:"padding",name:"padding",kind:"layout",value:"",parentId:"basis",derivative:2,scale:1},{id:"gap",name:"gap",kind:"layout",value:"16",parentId:null,derivative:1,scale:.75},{id:"radii",name:"radii",kind:"layout",value:"",parentId:null,derivative:1,scale:.75},...r(),{id:"primary",name:"primary",kind:"color",value:"oklch(65% 0.16 265)",parentId:null,derivative:0,scale:.125},{id:"secondary",name:"secondary",kind:"color",value:"",parentId:"primary",derivative:30,scale:.125},{id:"tertiary",name:"tertiary",kind:"color",value:"",parentId:"primary",derivative:60,scale:.125}],tokens:[{id:"semantic-color",name:"semantic_color",value:"@primary: 1"},{id:"ad-hoc-spacer",name:"ad-hoc-spacer",value:"@basis: 2"},{id:"ad-hoc-color",name:"ad-hoc-color",value:"#123ccc"},{id:"shadow-lg",name:"shadow-lg",value:"0 10px 15px rgba(0, 0, 0, 0.5)"}]}}function r(){return["body","heading"].flatMap(e=>[{id:`${e}-family`,name:`${e}-family`,kind:"font",group:"typography",typographyRole:e,value:"body"===e?"system-ui, sans-serif":"",parentId:"heading"===e?"body-family":null,derivative:1,scale:1},...["size","height","weight"].map(t=>({id:`${e}-${t}`,name:`${e}-${t}`,kind:"layout",group:"typography",typographyRole:e,value:"weight"===t&&"body"===e?"400":"",parentId:"size"===t?"body"===e?"basis":"body-size":"height"===t?`${e}-size`:"body"===e?null:"body-weight",derivative:"height"===t?1.5:"size"===t?2:1,scale:"weight"===t?100:.125,..."weight"===t?{scaleMode:"increment"}:{}}))])}function n(e){let t={text:"body-size",height:"body-height",weight:"body-weight"},n=e.constraints.filter(e=>t[e.id]);if(!n.length)return e;let i=[...e.constraints];for(let e of r()){if(i.some(t=>t.id===e.id))continue;let r=n.find(r=>t[r.id]===e.id);i.push(r?{...r,id:e.id,name:e.name,group:e.group,typographyRole:e.typographyRole}:e)}let a=i.filter(e=>!t[e.id]).map(e=>({...e})),o=e=>{let r=new Set([e.id]);for(;e.parentId&&t[e.parentId];){let t=i.find(t=>t.id===e.parentId);if(!t||r.has(e.parentId)){e.parentId=null,e.value="";break}if(r.add(e.parentId),e.derivative*=t.derivative,e.parentId=t.parentId,!t.parentId){try{e.value=f(p(i,e.id))}catch{e.value=t.value}e.derivative=1}}};a.filter(e=>"body"===e.typographyRole).forEach(o);for(let e of a){if(!e.parentId||!t[e.parentId])continue;let r=t[e.parentId];try{let t=p(i,e.parentId),n=p(a,r);if("layout"!==t.kind||"layout"!==n.kind||t.unit!==n.unit||!n.value||c(a,e.id,r))throw Error("Keep the original root");e.derivative*=t.value/n.value,e.parentId=r}catch{o(e)}}let s=new Map(n.map(e=>[e.name.toLowerCase(),t[e.id]]));return n.some(e=>"text"===e.id)&&(s.set("text","body-size"),s.set("size","body-size")),{...e,constraints:a,tokens:e.tokens.map(e=>({...e,value:e.value.replace(/"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|url\([^)]*\)|@([\w-]+)(?::\s*[+-]?(?:\d+\.?\d*|\.\d+))?/gi,(e,t)=>{if(!t)return e;let r=s.get(t.toLowerCase());if(!r)return e;let n=e.replace(`@${t}`,`@${r}`),o=v(i,e),l=v(a,n);return!o||l&&f(o)===f(l)?n:f(o)})}))}}var i="[+-]?(?:\\d+\\.?\\d*|\\.\\d+)",a=new RegExp(`^(${i})(px|rem|em|%|vw|vh|vmin|vmax|ch)?$`,"i"),o=new RegExp(`^oklch\\(\\s*(${i})(%)?\\s+(${i})\\s+(${i})(?:deg)?\\s*\\)$`,"i"),s=e=>(e%360+360)%360,l=e=>Math.max(0,Math.min(1,e)),d=e=>Number(e.toFixed(4));function u(e,t){if("font"===e){let r=t.trim();if(!r||!/[a-z\u0080-\uffff]/i.test(r)||r.length>160||/[;{}()@]|[<>]/.test(r)||[...r].some(e=>e.charCodeAt(0)<32))throw Error("Use a font family or comma-separated font stack");return{kind:e,value:r}}if("layout"===e){let r=t.trim().match(a);if(!r||!Number.isFinite(Number(r[1]))||Number(r[1])<0)throw Error("Use a positive length, like 24px or 1.5rem");return{kind:e,value:Number(r[1]),unit:r[2]?.toLowerCase()??""}}let r=t.trim().match(o);if(!r)throw Error("Use OKLCH, like oklch(65% 0.16 265)");let n=Number(r[1])/(r[2]?100:1),i=Number(r[3]),l=Number(r[4]);if(![n,i,l].every(Number.isFinite)||n<0||n>1||i<0)throw Error("Lightness must be 0–100% and chroma cannot be negative");return{kind:e,l:n,c:i,h:s(l)}}function c(e,t,r){let n=e.find(e=>e.id===t),i=e.find(e=>e.id===r);if(!n||!i)return"Choose an existing constraint";if(n.kind!==i.kind)return"Connect constraints of the same type";if("increment"===n.scaleMode!=("increment"===i.scaleMode))return"Connect weights to weights, and lengths to lengths";let a=new Set([t]);for(;i;){if(a.has(i.id))return"That connection would create a cycle";if(a.add(i.id),!i.parentId)break;if(i=e.find(e=>e.id===i.parentId),!i)return"The parent reference is missing"}return null}function p(e,t,r=0){let n=new Set,i=t=>{if(n.has(t))throw Error("Circular reference");n.add(t);let r=e.find(e=>e.id===t);if(!r)throw Error("The parent reference is missing");if(!Number.isFinite(r.derivative))throw Error("Use a finite derivative");if(!r.parentId)return u(r.kind,r.value);let a=e.find(e=>e.id===r.parentId);if(a&&"increment"===r.scaleMode!=("increment"===a.scaleMode))throw Error("Connect weights to weights, and lengths to lengths");let o=i(r.parentId);if(o.kind!==r.kind)throw Error("Connect constraints of the same type");if("font"===o.kind)return o;if("layout"===o.kind){if(r.derivative<0)throw Error("The derivative cannot be negative");return{...o,value:o.value*r.derivative}}return{...o,h:s(o.h+r.derivative)}},a=i(t),o=e.find(e=>e.id===t);if("font"===a.kind){if(0!==r)throw Error("Font families do not have numeric steps");return a}if(!Number.isFinite(r)||!Number.isFinite(o.scale))throw Error("Use a finite step");if("layout"===a.kind){if("increment"===o.scaleMode?o.scale<=0:o.scale<0)throw Error("Use a nonnegative growth rate or a positive weight increment");let e="increment"===o.scaleMode?Math.max(0,a.value+o.scale*r):a.value*(1+o.scale)**r;if(!Number.isFinite(e))throw Error("The scaled value is too large");return{...a,value:0===r?e:Math.round(e)}}return{...a,l:l(a.l+o.scale*r)}}function f(e){return"font"===e.kind?e.value:"layout"===e.kind?`${d(e.value)}${e.unit}`:`oklch(${d(100*e.l)}% ${d(e.c)} ${d(e.h)}${void 0===e.alpha?"":` / ${d(e.alpha)}`})`}function m(e){let t=e.trim().match(new RegExp(`^@([^:@/(),]+?)(?::\\s*(${i}))?(?:\\s*/\\s*(${i}%?))?$`));return!t||!t[1].trim()||void 0===t[2]&&/\s/.test(t[1].trim())||void 0!==t[2]&&!Number.isFinite(Number(t[2]))||void 0!==t[3]&&null===h(t[3])?null:{name:t[1].trim(),step:void 0===t[2]?null:Number(t[2]),...void 0===t[3]?{}:{opacity:t[3]}}}function h(e){if(!new RegExp(`^${i}%?$`).test(e))return null;let t=parseFloat(e)/(e.endsWith("%")?100:1);return Number.isFinite(t)&&t>=0&&t<=1?t:null}function v(e,t){let r=m(t);if(!r)return null;let n=e.find(e=>e.name.toLowerCase()===r.name.toLowerCase());if(!n)return null;try{let t=p(e,n.id,r.step??0);return void 0===r.opacity?t:"color"===t.kind?{...t,alpha:h(r.opacity)}:null}catch{return null}}function g(e,t,r){let n=e.find(e=>e.id===t);if("layout"!==n?.kind)return n?.derivative??0;try{let n=p(e,t),i=p(e,r);if("layout"===n.kind&&"layout"===i.kind&&n.unit===i.unit&&0!==i.value){let e=n.value/i.value;if(Number.isFinite(e))return e}}catch{}return 1}function y(e,t){let r=f(p(e,t));return e.map(e=>e.id===t?{...e,parentId:null,value:r}:e)}function k(e,t){let r=new Set;for(let n=0;n<32;n+=1){if(r.has(e))return;if(r.add(e),e&&"object"==typeof e){let t=e;e=t.$value??t.ref;continue}if("string"!=typeof e)return;let n=e.trim(),i=n.replace(/^\{(.+)\}$/,"$1").replace(/^var\(--([^,)]+)\)$/,"$1").replace(/^var\(principles\.([^,)]+)\)$/,"$1").replace(/^principles\./,"");if(!Object.hasOwn(t,i)){if(/\b(currentcolor|inherit|initial|unset|revert|var|env|light-dark)\b/i.test(n))return;if(typeof CSS<"u"&&CSS.supports)return CSS.supports("color",n)?n:void 0;if(typeof document<"u"){let e=document.createElement("span").style;return e.color=n,e.color?n:void 0}return}e=t[i]}}var b=/^@([\w-]+)(?::\s*[+-]?(?:\d+\.?\d*|\.\d+)(?![\w.]))?(?![\w-]|\s*:)/,w=/^(?:px|rem|em|ex|ch|cap|ic|lh|rlh|vw|vh|vi|vb|vmin|vmax|[sld]v[whib]|cm|mm|q|in|pt|pc|%)$/i,I=e=>String(Number(e.toPrecision(12)));function $(e,t){if(e.length>4096||!/^calc\(/i.test(e))return null;let r=5,n=0,i=()=>{throw Error("Invalid calc expression")},a=()=>{for(;/\s/.test(e[r]??"")&&r<e.length;)r++},o=(e,t="")=>!Number.isFinite(e)||t&&!w.test(t)?i():{kind:t?"length":"number",terms:new Map([[t.toLowerCase(),e]])},s=(e,t)=>({...e,terms:new Map([...e.terms].map(([e,r])=>{let n=r*t;return Number.isFinite(n)||i(),[e,n]}))}),l=()=>{a(),++n>32&&i();try{let n=e[r];if("+"===n||"-"===n)return r++,s(l(),"-"===n?-1:1);if("("===e[r]||/^calc\(/i.test(e.slice(r))){r+="("===e[r]?1:5;let t=u();return a(),")"!==e[r++]&&i(),t}let d=e.slice(r).match(b)?.[0];if(d){r+=d.length;let e=v(t,d);if("layout"!==e?.kind)return i();let n=t.find(e=>e.name.toLowerCase()===d.slice(1).split(":")[0].trim().toLowerCase());return o(e.value,e.unit||("increment"===n?.scaleMode?"":"px"))}let c=e.slice(r).match(/^(\d+\.?\d*|\.\d+)(e[+-]?\d+)?([a-z]+|%)?/i);return c?(r+=c[0].length,o(Number(c[1]+(c[2]??"")),c[3])):i()}finally{n--}},d=()=>{let t=l();for(;;){a();let n=e[r];if("*"!==n&&"/"!==n)return t;r++;let o=l();if("/"===n){let e=o.terms.get("");if("number"!==o.kind||!e)return i();t=s(t,1/e)}else if("number"===o.kind)t=s(t,o.terms.get(""));else{if("number"!==t.kind)return i();t=s(o,t.terms.get(""))}}},u=()=>{let t=d();for(;;){a();let n=e[r];if("+"!==n&&"-"!==n)return t;r++;let o=d();if(t.kind!==o.kind)return i();for(let[e,r]of o.terms){let a=(t.terms.get(e)??0)+r*("-"===n?-1:1);Number.isFinite(a)||i(),t.terms.set(e,a)}}};try{let t=u();if(a(),")"!==e[r++]||e.slice(r).trim())return null;let n=[...t.terms].filter(([,e])=>0!==e);n.length||n.push([t.terms.keys().next().value??"",0]);let[i,o]=n[0];return{css:1===n.length?`${I(o)}${i}`:`calc(${n.map(([e,t],r)=>`${r?t<0?" - ":" + ":t<0?"-":""}${I(Math.abs(t))}${e}`).join("")})`,kind:t.kind,...1===n.length?{value:o,unit:i}:{}}}catch{return null}}function E(e,t){let r=e;for(let n of function(e){let t=[],r=/url\((?:"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|[^)'"])*\)|"(?:\\.|[^"\\])*"|'(?:\\.|[^'\\])*'|\/\*[\s\S]*?\*\/|\bcalc\(/gi;for(let n;n=r.exec(e);){if(!/^calc\(/i.test(n[0]))continue;let i=1,a=r.lastIndex;for(;a<e.length&&i;)"("===e[a]?i++:")"===e[a]&&i--,a++;t.push({start:n.index,end:a,text:e.slice(n.index,a)}),r.lastIndex=a}return t}(e).reverse()){let e=$(n.text,t);if(!e)return null;r=r.slice(0,n.start)+e.css+r.slice(n.end)}return r}function x(e,t){let r=[],n=(e,t,n)=>{let i=k(e,{});i&&r.push({start:t,end:n,color:i})},i=(e,a=0,o=!1)=>{let s=0;for(;s<e.length;){let l=e[s];if('"'===l||"'"===l){let t=l;for(s++;s<e.length;s++)if("\\"===e[s])s++;else if(e[s]===t){s++;break}continue}if(e.startsWith("/*",s)){let t=e.indexOf("*/",s+2);s=t<0?e.length:t+2;continue}if("@"===l){let n=e.slice(s).match(/^@([^:@(),/]+):\s*([+-]?(?:\d+\.?\d*|\.\d+))(?![\w.])(?:\s*\/\s*[+-]?(?:\d+\.?\d*|\.\d+)%?(?![\w.%]))?(?!\s*\/)/),i=e.slice(s).match(/^@([\w-]+)(?![\w-]|\s*:)(?:\s*\/\s*([+-]?(?:\d+\.?\d*|\.\d+)%?)(?![\w.%]))?(?!\s*\/)/),l=o?e.slice(s).match(b):n??i;if(l){let e=v(t,l[0]),n=m(l[0]);n&&r.push({start:a+s,end:a+s+l[0].length,color:"color"===e?.kind?f(e):null,reference:n,...o?{math:!0}:{}}),s+=l[0].length}else s+=e.slice(s).match(/^@[^\s,()]*(?:\s*:\s*[^\s,()]*)?/)?.[0].length??1;continue}let d=e.slice(s).match(/^(?:#[\w-]+|[\w-]+)/)?.[0];if(!d){s++;continue}let u=s;if(s+=d.length,"("!==e[s]){o||n(d,a+u,a+s);continue}let c=++s,p=1,h="";for(;s<e.length&&p;){let t=e[s++];"\\"!==t?h?t===h&&(h=""):'"'===t||"'"===t?h=t:"("===t?p++:")"===t&&p--:s++}if(p)continue;let g=k(e.slice(u,s),{});g?r.push({start:a+u,end:a+s,color:g}):/^(?:(?:repeating-)?(?:linear|radial|conic)-gradient|drop-shadow|calc)$/i.test(d)&&i(e.slice(c,s-1),a+c,o||"calc"===d.toLowerCase())}};return i(e),r}function C(e,t){return x(e,t).flatMap(e=>e.color?[{...e,color:e.color}]:[])}function N(e,t){return x(e,t).flatMap(({reference:e,start:t,end:r,math:n})=>e?[{...e,start:t,end:r,...n?{math:!0}:{}}]:[])}function S(e,t){return C(e,t).map(({color:e})=>e)}function A(e,t){let r=N(e,t);return null!==E(e,t)&&r.length===(e.match(/@/g)?.length??0)&&r.every(({start:r,end:n})=>null!==v(t,e.slice(r,n)))}function F(e,t,r=!1){let n=E(e,t);if(null===n)return null;let i=n;for(let e of N(n,t).reverse()){let a=v(t,n.slice(e.start,e.end));if(!a)return null;i=i.slice(0,e.start)+f(a)+(r&&"layout"===a.kind&&!a.unit?"px":"")+i.slice(e.end)}return i}function M(e,t,r,n){if(void 0!==n){let i=N(e,r)[n];return!i||void 0!==i.opacity&&"color"!==t.kind||i.math&&"layout"!==t.kind?null:e.slice(0,i.start)+`@${t.name}${null===i.step?"":`: ${i.step}`}${void 0===i.opacity?"":` / ${i.opacity}`}`+e.slice(i.end)}let i=m(e);if(i||!e.trim())return void 0!==i?.opacity&&"color"!==t.kind?null:`@${t.name}${null===i?.step?"":`: ${i?.step??0}`}${void 0===i?.opacity?"":` / ${i.opacity}`}`;let a=C(e,r);if("color"===t.kind&&1===a.length){let{start:r,end:n}=a[0],i=m(e.slice(r,n));return`${e.slice(0,r)}@${t.name}${null===i?.step?"":`: ${i?.step??0}`}${void 0===i?.opacity?"":` / ${i.opacity}`}${e.slice(n)}`}return/^[+-]?(?:\d+\.?\d*|\.\d+)(?:[a-z%]+)?$/i.test(e.trim())?`@${t.name}: 0`:null}var U=["page","body","heading","muted","card","button","input"],R=["color","backgroundColor","border","borderColor","borderWidth","borderRadius","boxShadow","padding","paddingInline","paddingBlock","gap","fontFamily","fontSize","fontWeight","lineHeight","letterSpacing","opacity"];function z(e){var t;let r={};for(let n of e.usage??[]){if(!U.includes(n.target)||!R.includes(n.property))continue;let i=null;try{if("token"===n.source.kind){let t=e.tokens.find(e=>e.id===n.source.id);t&&(i=F(t.value,e.constraints,!["fontWeight","opacity"].includes(n.property)))}else if("dimension"===n.source.kind){let t=p(e.constraints,n.source.id,n.source.step??0);i=f(t),"layout"===t.kind&&!t.unit&&!["fontWeight","opacity"].includes(n.property)&&(i+="px")}}catch{continue}(i&&/^-?\d+(?:\.\d+)?$/.test(i)&&["fontSize","letterSpacing","padding","paddingInline","paddingBlock","gap","borderRadius","borderWidth"].includes(n.property)&&(i+="px"),!i||/[;{}]|\b(?:url|expression|var)\s*\(/i.test(i)||i.includes("\\")||[...i].some(e=>e.charCodeAt(0)<32)||typeof CSS<"u"&&CSS.supports&&!CSS.supports(n.property.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),i))||((r[t=n.target]??(r[t]={}))[n.property]=["fontWeight","opacity"].includes(n.property)&&Number.isFinite(Number(i))?Number(i):i)}return r}var T=class extends Error{};function L(){let e=t();return{...e,tokens:[],constraints:e.constraints.map(e=>({...e,value:"",parentId:null}))}}var j=(e,t=512)=>"string"==typeof e&&e.length<=t&&![...e].some(e=>e.charCodeAt(0)<32)&&!/[;{}]|\b(?:url|expression)\s*\(/i.test(e);function O(e,t){if(!t||"object"!=typeof t||Array.isArray(t)||Object.keys(t).some(e=>!["name","constraints","tokens","usage","featuredComponentId"].includes(e)))throw Error("Invalid proposal patch.");let r=structuredClone(e);if(void 0!==t.featuredComponentId){if(null!==t.featuredComponentId&&!r.fragments?.some(e=>e.id===t.featuredComponentId))throw Error("The featured component must belong to this Taste.");r.featuredComponentId=t.featuredComponentId}if(void 0!==t.name){if("string"!=typeof t.name||t.name.length>80)throw Error("Invalid name.");r.name=t.name}if(void 0!==t.constraints){if(!Array.isArray(t.constraints)||t.constraints.length>32)throw Error("Invalid dimensions.");let e=new Set;for(let n of t.constraints){if(!n||"object"!=typeof n||Object.keys(n).some(e=>!["id","value","parentId","derivative","scale"].includes(e)))throw Error("Invalid dimension patch.");let t=r.constraints.find(e=>e.id===n.id);if(!t||e.has(n.id))throw Error("Unknown or duplicate dimension ID.");if(e.add(n.id),Object.assign(t,n),!j(t.value)||!Number.isFinite(t.derivative)||!Number.isFinite(t.scale)||t.scale<0||"increment"===t.scaleMode&&t.scale<=0||"color"===t.kind&&t.scale>1||"font"===t.kind&&(1!==t.scale||1!==t.derivative)||"layout"===t.kind&&t.derivative<0||null!==t.parentId&&!r.constraints.some(e=>e.id===t.parentId&&e.kind===t.kind))throw Error(`Invalid ${t.id} dimension.`)}for(let e of r.constraints)(e.value||e.parentId)&&p(r.constraints,e.id)}if(void 0!==t.tokens){if(!Array.isArray(t.tokens)||t.tokens.length>128)throw Error("Invalid tokens.");let e=new Set,n=new Set;for(let r of t.tokens){if(!r||"string"!=typeof r.id||!/^[a-zA-Z0-9_-]{1,80}$/.test(r.id)||"string"!=typeof r.name||!/^[a-zA-Z][a-zA-Z0-9_-]{0,63}$/.test(r.name)||!j(r.value)||e.has(r.id)||n.has(r.name))throw Error("Invalid or duplicate token.");e.add(r.id),n.add(r.name)}r.tokens=structuredClone(t.tokens)}void 0!==t.usage&&(r.usage=structuredClone(t.usage));for(let e of r.tokens)if(!A(e.value,r.constraints))throw Error(`Invalid reference or calc expression in ${e.name}.`);if(!Array.isArray(r.usage??[])||(r.usage?.length??0)>128)throw Error("Invalid usage mappings.");for(let e of r.usage??[])if(!e||Object.keys(e).some(e=>!["target","property","source"].includes(e))||!U.includes(e.target)||!R.includes(e.property)||!e.source||Object.keys(e.source).some(e=>!["kind","id","step"].includes(e))||!["token","dimension"].includes(e.source.kind)||!("token"===e.source.kind?r.tokens:r.constraints).some(t=>t.id===e.source.id)||void 0!==e.source.step&&(!Number.isInteger(e.source.step)||Math.abs(e.source.step)>100))throw Error("Usage must reference an existing token or dimension.");return r}function W(e,r=!0,n=!0){let i=t(),a={past:[],future:[]},o={current:{past:[],future:[]}},s={available:r,revision:crypto.randomUUID(),runId:"",openRequest:"",open:!1,mode:"empty",state:e?"complete":"idle",message:"",draft:e??null},l=new Set,d=null,u=new Set,c=e=>{d={id:crypto.randomUUID(),target:e,expiresAt:Date.now()+2e3},u.forEach(e=>e())},m=()=>{d=null,u.forEach(e=>e())},h=e=>{s={...s,...e,revision:crypto.randomUUID()},l.forEach(e=>e())},v={setCreationAllowed(e){n=e},history:o,getLookSnapshot:()=>d,subscribeLook:e=>(u.add(e),()=>{u.delete(e)}),setAvailable(e){s.available!==e&&h({available:e})},getSnapshot:()=>s,subscribe:e=>(l.add(e),()=>{l.delete(e)}),create(e="template",r=!1){if(!n)throw Error("An active subscription is required to create a Taste.");m(),"template"===e&&!r&&(i=t()),"template"===e?(r||(a.past=[],a.future=[]),o.current=a):o.current={past:[],future:[]},h({open:!0,openRequest:crypto.randomUUID(),runId:crypto.randomUUID(),mode:e,state:"extract"===e?"running":"complete",message:"",draft:"template"===e?i:L()})},edit(e){"running"!==s.state&&("template"===s.mode&&(i=e),h({draft:e}))},addFragment(e,t){if(s.runId!==e||!s.open||"running"===s.state||!s.draft)throw Error("This proposal has changed. Capture the component again.");let r=s.draft;if((r.fragments?.length??0)>=16)throw Error("A proposal can contain up to 16 components.");if(r.fragments?.some(e=>e.id===t.fragment.id))throw Error("This component was already captured.");if(t.tokens.some(e=>r.tokens.some(t=>t.id===e.id||t.name===e.name)))throw Error("A component token conflicts with a shared token. Retry capture.");let n=O({...r,usage:[]},{tokens:t.tokens}),i=e=>{for(let t of Object.values(e.styles))if(!("token"===t.kind?[...r.tokens,...n.tokens]:n.constraints).some(e=>e.id===t.id))throw Error("A referenced Taste value was removed. Retry capture.");e.children.forEach(e=>{"string"!=typeof e&&i(e)})};i(t.fragment.root);let a={...r,fragments:[...r.fragments??[],{...t.fragment,tokens:t.tokens}]};return o.current.past.push(r),o.current.past.length>100&&o.current.past.shift(),o.current.future=[],v.edit(a),a},stream(e,t){s.runId===e&&"running"===s.state&&h(t)},close(){m(),h({open:!1,..."running"===s.state?{state:"error",message:"Extraction stopped. Retry or continue editing the partial draft."}:{}})},command(e){let t=(e,t={})=>({status:e,...s,...t,saved:!1,applied:!1});if(void 0!==e.target&&"inspect"!==e.action)return t("invalid",{error:"target is only supported for inspection."});if("inspect"===e.action){let r=e.target;if(void 0!==r){let{draft:e,...t}=s,n=(e,r={})=>({status:e,...t,saved:!1,applied:!1,...r});if(!r||!["dimension","token"].includes(r.kind)||"string"!=typeof r.id||!r.id||r.id.length>200)return n("invalid");let i=("dimension"===r.kind?e?.constraints:e?.tokens)?.find(e=>e.id===r.id);if(!i||!e)return n("not_found",{target:r});let a,o=null;try{o="dimension"===r.kind?f(p(e.constraints,r.id)):F(i.value,e.constraints)}catch(e){a=e instanceof Error?e.message:"Not resolved yet"}return c({kind:r.kind,id:r.id}),n("ok",{target:r,row:i,resolved:o,...a?{resolutionError:a}:{}})}return s.draft&&c(null),t("ok")}if(!s.available)return t("unavailable",{error:"The host Taste panel is not available in this browser."});if(!["create","modify"].includes(e.action))return t("invalid",{error:"Unknown proposal action."});if(!e.expectedRevision||e.expectedRevision!==s.revision)return t("conflict");if("running"===s.state)return t("busy");try{if("create"===e.action){let t=e.mode??"template";if(!["template","empty","extract"].includes(t)||e.patch)throw Error("Create accepts a mode; modify the returned draft separately.");v.create(t)}else{if(!s.draft)return t("not_found");let r=O(s.draft,e.patch);o.current.past=[...o.current.past.slice(-99),s.draft],o.current.future=[],"template"===s.mode&&(i=r),h({draft:r,open:!0,openRequest:crypto.randomUUID()})}return t("ok")}catch(e){return t("invalid",{error:e instanceof Error?e.message:"Invalid patch."})}}};return v}var D=W(null,!1,!1);e.connect(D);export{t as a,n as b,u as c,c as d,p as e,f,m as g,h,v as i,g as j,y as k,k as l,$ as m,E as n,C as o,N as p,S as q,F as r,M as s,z as t,T as u,L as v,W as w,D as x};
|
package/dist/chunk-OAHYSDJ4.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{c as e}from"./chunk-G7JR5Z3P.mjs";import{a as t,z as o,u as i,w as n,x as r,v as s,A as a}from"./chunk-HU2XWUJC.mjs";import{v as d}from"./chunk-WHJEKDNP.mjs";var c="__popmelt_code_preview";function f(e,t){let o=new URL(e,t);if(o.origin!==new URL(t).origin||!/^https?:$/.test(o.protocol))throw new Error("Code previews must use the same application origin");return o.hash="",o.searchParams.delete("popmelt"),o.searchParams.set(c,"1"),o.href}function l(f,l){if(!new URL(location.href).searchParams.has(c))return!1;if(parent===window)return!0;window.__POPMELT_CODE_PREVIEW__?.dispose();let m=t,u="",p=!1,w=0,h=new Map,_=()=>{for(let[e,t]of h)null===t?e.removeAttribute("data-pm"):e.setAttribute("data-pm",t);h.clear()},E=new e(l?.get()??[]),M=()=>{for(let e of m.annotations)e.target&&E.resolve(e.target)},P=()=>{o(m.domModifications),i(m.styleModifications),n(m.textModifications),M();for(let e of m.annotations){let t=e.linkedSelector?.match(/^\[data-pm="([^"]+)"\]$/)?.[1];if(!t)continue;let o=d(e.linkedSelector,e.elements?.[0]);o&&(h.has(o)||h.set(o,o.getAttribute("data-pm")),o.setAttribute("data-pm",t))}},v=new MutationObserver(e=>{e.some(e=>e.addedNodes.length)&&(cancelAnimationFrame(w),w=requestAnimationFrame(()=>{v.disconnect(),P(),b()}))}),b=()=>v.observe(document.body,{childList:!0,subtree:!0}),g=()=>{let e=E;e.whenReady().then(()=>{!p&&E===e&&(M(),document.dispatchEvent(new Event("popmelt-subjects-ready")))})},y=l?.subscribe(()=>{E.destroy(),E=new e(l.get()),M(),g()});g();let L={dispose(){p||(p=!0,v.disconnect(),y?.(),E.destroy(),cancelAnimationFrame(w),window.removeEventListener("pagehide",L.dispose),window.__POPMELT_CODE_PREVIEW__===L&&delete window.__POPMELT_CODE_PREVIEW__,r(m.textModifications),s(m.styleModifications,!0),a(m.domModifications),_())},source:f,getSubjects:()=>E,update(e){if(p)throw new Error("Preview runtime closed");if(e.draft.source&&e.draft.source.sourceId!==f.sourceId)throw new Error("This draft belongs to a different source");let o=JSON.stringify([e.planeId,e.draft.revision,e.draft.source?.sourceId,e.draft.source?.revision]);if(u===o)return;let i=structuredClone(e.draft.state??t),n=e=>!e.pathname||e.pathname===location.pathname,d={...i,annotations:i.annotations.filter(n),styleModifications:i.styleModifications.filter(n),textModifications:i.textModifications.filter(n),domModifications:i.domModifications.filter(n)};v.disconnect(),r(m.textModifications),s(m.styleModifications,!0),a(m.domModifications),_(),m=d,P(),b(),u=o}};return window.__POPMELT_CODE_PREVIEW__=L,b(),window.addEventListener("pagehide",L.dispose,{once:!0}),!0}export{f as a,l as b};
|
package/dist/chunk-PNTM77NT.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{a as e}from"./chunk-G6RYESYI.mjs";import{ua as t,A as r,B as n,Oa as i,D as o}from"./chunk-MSWXKP77.mjs";import{a as l}from"./chunk-57FM7XQV.mjs";import{useId as a,useState as s,useRef as d,useCallback as u,useLayoutEffect as c,useEffect as p,useMemo as f}from"react";import{jsx as L,jsxs as h,Fragment as m}from"react/jsx-runtime";var v={id:"",label:"Codex default",source:"cli",isDefault:!0};function g(e){return[v,...e.filter(e=>""!==e.id)]}var C={id:"",label:"Claude default",source:"static"};function b(e){return/^claude-(?:ai|code)(?:$|[-.])/i.test(e)}function x(e){return[C,...e.filter(e=>e.id&&!b(e.id))]}function y({size:e=16,style:t}){return L("svg",{width:e,height:e,viewBox:"0 0 1200 1200",fill:"currentColor",stroke:"none",style:{flexShrink:0,...t},children:L("path",{d:"M 233.959793 800.214905 L 468.644287 668.536987 L 472.590637 657.100647 L 468.644287 650.738403 L 457.208069 650.738403 L 417.986633 648.322144 L 283.892639 644.69812 L 167.597321 639.865845 L 54.926208 633.825623 L 26.577238 627.785339 L 3.3e-05 592.751709 L 2.73832 575.27533 L 26.577238 559.248352 L 60.724873 562.228149 L 136.187973 567.382629 L 249.422867 575.194763 L 331.570496 580.026978 L 453.261841 592.671082 L 472.590637 592.671082 L 475.328857 584.859009 L 468.724915 580.026978 L 463.570557 575.194763 L 346.389313 495.785217 L 219.543671 411.865906 L 153.100723 363.543762 L 117.181267 339.060425 L 99.060455 316.107361 L 91.248367 266.01355 L 123.865784 230.093994 L 167.677887 233.073853 L 178.872513 236.053772 L 223.248367 270.201477 L 318.040283 343.570496 L 441.825592 434.738342 L 459.946411 449.798706 L 467.194672 444.64447 L 468.080597 441.020203 L 459.946411 427.409485 L 392.617493 305.718323 L 320.778564 181.932983 L 288.80542 130.630859 L 280.348999 99.865845 C 277.369171 87.221436 275.194641 76.590698 275.194641 63.624268 L 312.322174 13.20813 L 332.8591 6.604126 L 382.389313 13.20813 L 403.248352 31.328979 L 434.013519 101.71814 L 483.865753 212.537048 L 561.181274 363.221497 L 583.812134 407.919434 L 595.892639 449.315491 L 600.40271 461.959839 L 608.214783 461.959839 L 608.214783 454.711609 L 614.577271 369.825623 L 626.335632 265.61084 L 637.771851 131.516846 L 641.718201 93.745117 L 660.402832 48.483276 L 697.530334 24.000122 L 726.52356 37.852417 L 750.362549 72 L 747.060486 94.067139 L 732.886047 186.201416 L 705.100708 330.52356 L 686.979919 427.167847 L 697.530334 427.167847 L 709.61084 415.087341 L 758.496704 350.174561 L 840.644348 247.490051 L 876.885925 206.738342 L 919.167847 161.71814 L 946.308838 140.29541 L 997.61084 140.29541 L 1035.38269 196.429626 L 1018.469849 254.416199 L 965.637634 321.422852 L 921.825562 378.201538 L 859.006714 462.765259 L 819.785278 530.41626 L 823.409424 535.812073 L 832.75177 534.92627 L 974.657776 504.724915 L 1051.328979 490.872559 L 1142.818848 475.167786 L 1184.214844 494.496582 L 1188.724854 514.147644 L 1172.456421 554.335693 L 1074.604126 578.496765 L 959.838989 601.449829 L 788.939636 641.879272 L 786.845764 643.409485 L 789.261841 646.389343 L 866.255127 653.637634 L 899.194702 655.409424 L 979.812134 655.409424 L 1129.932861 666.604187 L 1169.154419 692.537109 L 1192.671265 724.268677 L 1188.724854 748.429688 L 1128.322144 779.194641 L 1046.818848 759.865845 L 856.590759 714.604126 L 791.355774 698.335754 L 782.335693 698.335754 L 782.335693 703.731567 L 836.69812 756.885986 L 936.322205 846.845581 L 1061.073975 962.81897 L 1067.436279 991.490112 L 1051.409424 1014.120911 L 1034.496704 1011.704712 L 924.885986 929.234924 L 882.604126 892.107544 L 786.845764 811.48999 L 780.483276 811.48999 L 780.483276 819.946289 L 802.550415 852.241699 L 919.087341 1027.409424 L 925.127625 1081.127686 L 916.671204 1098.604126 L 886.469849 1109.154419 L 853.288696 1103.114136 L 785.073914 1007.355835 L 714.684631 899.516785 L 657.906067 802.872498 L 650.979858 806.81897 L 617.476624 1167.704834 L 601.771851 1186.147705 L 565.530212 1200 L 535.328857 1177.046997 L 519.302124 1139.919556 L 535.328857 1066.550537 L 554.657776 970.792053 L 570.362488 894.68457 L 584.536926 800.134277 L 592.993347 768.724976 L 592.429626 766.630859 L 585.503479 767.516968 L 514.22821 865.369263 L 405.825531 1011.865906 L 320.053711 1103.677979 L 299.516815 1111.812256 L 263.919525 1093.369263 L 267.221497 1060.429688 L 287.114136 1031.114136 L 405.825531 880.107361 L 477.422913 786.52356 L 523.651062 732.483276 L 523.328918 724.671265 L 520.590698 724.671265 L 205.288605 929.395935 L 149.154434 936.644409 L 124.993355 914.01355 L 127.973183 876.885986 L 139.409409 864.80542 L 234.201385 799.570435 L 233.879227 799.8927 Z"})})}function w({size:e=16,style:t,gradient:r}){let n=a();return h("svg",{width:e,height:e,viewBox:"1.7 1.7 20.6 20.6",fill:r?`url(#${n})`:"currentColor",stroke:"none",style:{flexShrink:0,...t},children:[r&&L("defs",{children:h("linearGradient",{id:n,x2:"0%",y2:"100%",children:[L("stop",{offset:"0%",stopColor:"#aca6ff"}),L("stop",{offset:"50%",stopColor:"#7a9cff"}),L("stop",{offset:"100%",stopColor:"#3f49ff"})]})}),L("path",{fillRule:"evenodd",d:"M9.3316 2.03768C11.1644 1.54688 13.0268 2.04668 14.356 3.20174C16.0859 2.86512 17.9511 3.36418 19.2935 4.70663C20.6356 6.04882 21.1326 7.91288 20.7964 9.64217C21.9527 10.9716 22.4534 12.8349 21.9625 14.6685C21.4711 16.5025 20.1051 17.8657 18.439 18.439C17.8658 20.1047 16.503 21.47 14.6695 21.9615C12.8356 22.4528 10.9727 21.9519 9.64312 20.7955C7.91371 21.1319 6.04993 20.635 4.70757 19.2926C3.36558 17.9505 2.86659 16.0866 3.20269 14.357C2.04693 13.0273 1.54757 11.1638 2.03863 9.33065C2.52997 7.49759 3.89436 6.13282 5.56011 5.55917C6.13382 3.8935 7.49837 2.52891 9.3316 2.03768Z M16.0005 13.5992C16.4972 13.5995 16.9007 14.0029 16.9009 14.4996C16.9009 14.9965 16.4974 15.3997 16.0005 15.4H13.0005C12.5035 15.4 12.1002 14.9967 12.1002 14.4996C12.1004 14.0027 12.5036 13.5992 13.0005 13.5992H16.0005Z M8.03765 8.72811C8.46377 8.47284 9.01638 8.61074 9.27203 9.03671L10.6177 11.2789C10.8836 11.7221 10.8834 12.277 10.6177 12.7203L9.27203 14.9625C9.01633 15.3887 8.46385 15.5267 8.03765 15.2711C7.61143 15.0153 7.47333 14.4629 7.72906 14.0367L8.95074 11.9996L7.72906 9.96249C7.47341 9.53628 7.61146 8.98382 8.03765 8.72811Z"})]})}function k({size:e=16,style:t}){return L("svg",{width:e,height:e,viewBox:"0 0 49.7202 40.0402",fill:"currentColor",stroke:"none",style:{flexShrink:0,...t},children:L("path",{d:"M29.8768 25.3531C30.9809 25.3531 31.876 26.2481 31.876 27.3522V31.3505C31.876 32.4545 30.9809 33.3496 29.8768 33.3496C28.7727 33.3496 27.8777 32.4545 27.8777 31.3505V27.3522C27.8777 26.2481 28.7727 25.3531 29.8768 25.3531ZM19.8812 25.3531C20.9852 25.3531 21.8803 26.2481 21.8803 27.3522V31.3505C21.8803 32.4545 20.9852 33.3496 19.8812 33.3496C18.7771 33.3496 17.882 32.4545 17.882 31.3505V27.3522C17.882 26.2481 18.7771 25.3531 19.8812 25.3531ZM24.8601 40.8772C36.974 40.8772 46.9603 33.8278 48.6801 30.8403C48.8058 30.6218 48.8464 30.3723 48.8464 30.1202V24.8018C48.8464 24.5813 48.8124 24.3622 48.7308 24.1574C47.9871 22.2899 46.0394 19.5773 43.5257 18.8495C43.1925 17.994 42.6989 16.7433 42.2384 15.8201C42.3154 15.1138 42.3426 14.3853 42.3426 13.6492C42.3426 10.99 41.7789 8.65743 40.0805 6.92044C39.2872 6.10915 38.3028 5.48684 37.1355 5.01903C34.3398 2.74775 30.2723 0.837036 24.8169 0.837036C19.3616 0.837036 15.3805 2.74775 12.5847 5.01903C11.4174 5.48684 10.433 6.10915 9.63975 6.92044C7.9413 8.65743 7.37764 10.99 7.37764 13.6492C7.37764 14.3853 7.40477 15.1138 7.48186 15.8201C7.02133 16.7433 6.52774 17.994 6.19449 18.8495C3.68082 19.5773 1.73309 22.2899 0.989389 24.1574C0.907813 24.3622 0.873779 24.5813 0.873779 24.8018V30.1202C0.873779 30.3723 0.914376 30.6218 1.04014 30.8403C2.75994 33.8278 12.7462 40.8772 24.8601 40.8772ZM26.485 13.0046C26.4 12.3422 26.3595 11.749 26.3584 11.2191L26.3584 11.1772C26.361 9.63975 26.6971 8.63938 27.2339 8.02499C27.9156 7.2448 29.3246 6.64707 32.2941 6.96844C35.3026 7.29402 36.9842 8.04072 37.9376 9.01574C38.8606 9.95971 39.3455 11.372 39.3455 13.6492C39.3455 16.0687 38.9969 17.4982 38.2302 18.3678C37.5012 19.1946 36.0656 19.8674 32.9214 19.8674C30.5041 19.8674 29.1221 19.0812 28.2386 17.9939C27.2899 16.8264 26.7559 15.1161 26.485 13.0046ZM23.2353 13.0046C23.3203 12.3422 23.3607 11.749 23.3619 11.2191L23.3619 11.1772C23.3592 9.63974 23.0232 8.63937 22.4863 8.02498C21.8046 7.24479 20.3957 6.64707 17.4261 6.96843C14.4176 7.29402 12.736 8.04071 11.7826 9.01573C10.8596 9.9597 10.3747 11.372 10.3747 13.6492C10.3747 16.0687 10.7234 17.4982 11.49 18.3677C12.219 19.1946 13.6546 19.8674 16.7989 19.8674C19.2161 19.8674 20.5981 19.0812 21.4816 17.9939C22.4304 16.8264 22.9643 15.1161 23.2353 13.0046ZM25.2042 18.8676L25.0543 18.8676C24.8715 18.8678 24.6005 18.868 24.516 18.8676C24.3045 19.2218 24.0693 19.5618 23.8075 19.884C22.2697 21.7764 19.9741 22.8644 16.7988 22.8644C13.3524 22.8644 10.8266 22.1471 9.24196 20.3498C9.15187 20.2476 9.07125 20.1406 9.07125 20.1406L8.87613 20.3498V33.5049C11.7429 35.0628 17.8959 37.8586 24.8601 37.8586C31.8243 37.8586 37.9773 35.0628 40.8441 33.5049V20.3498L40.649 20.1406C40.649 20.1406 40.5829 20.231 40.4783 20.3498C38.8936 22.1471 36.3678 22.8644 32.9214 22.8644C29.7461 22.8644 27.4506 21.7764 25.9127 19.884C25.6509 19.5618 25.4157 19.2218 25.2042 18.8676Z",fillRule:"evenodd",clipRule:"evenodd"})})}function M({size:e=16,style:t,gradient:r}){let n=a();return h("svg",{width:e,height:e,viewBox:"8 8 48 48",fill:"none",style:{flexShrink:0,...t},children:[r&&L("defs",{children:h("linearGradient",{id:n,x2:"65%",y2:"115%",children:[L("stop",{offset:"0%",stopColor:"#df5ecc"}),L("stop",{offset:"57%",stopColor:"#8b65ec"}),L("stop",{offset:"100%",stopColor:"#79b3e7"})]})}),L("path",{fill:r?`url(#${n})`:"currentColor",d:"M14 16h36v8H40v32h-8V24h-6v22h-8V24h-4z"})]})}function E({provider:e,size:t=16,style:r,gradient:n}){return"codex"===e?L(w,{size:t,style:r,gradient:n}):"opencode"===e?h("svg",{width:t,height:t,viewBox:"0 0 16 16","aria-hidden":"true",style:r,children:[L("path",{fill:"currentColor",fillRule:"evenodd",d:"M2 1h12v14H2zM5 4v8h6V4z"}),L("path",{fill:"currentColor",opacity:".4",d:"M5 8h6v4H5z"})]}):"copilot"===e?L(k,{size:t,style:r}):"omp"===e?L(M,{size:t,style:r,gradient:n}):L(y,{size:t,style:r})}var S=[{effort:"low"},{effort:"medium"},{effort:"high"},{effort:"xhigh"},{effort:"max"}],T=[C,{id:"claude-opus-4-6",label:"Opus 4.6",source:"static",supportedReasoningLevels:S},{id:"claude-sonnet-4-6",label:"Sonn 4.6",source:"static",supportedReasoningLevels:S}],z=[v],P=[{id:"",label:"Default",source:"static"}],R=[{id:"",label:"OMP default",source:"static"}],I={claude:T,codex:z,copilot:P,omp:R,opencode:[{id:"",label:"OpenCode default",source:"static"}]},D=[...T,...z,...P,...R];function V(e,t){if("copilot"===t&&!e)return"Copilot";if("opencode"===t&&!e)return"OpenCode";if("omp"===t&&!e)return"OMP";if(!e)return"codex"===t?"Codex":"Claude Code";let r=D.find(t=>t.id===e);return r?r.label:e.replace(/-\d{8,}$/,"")}var $=100,F=200,O={surface:null,phase:"visible"};function H({openDelayMs:e=100,exitDurationMs:t=200,pinnedSurface:r=null}={}){let[n,i]=s(O),o=d(O),l=d(null),a=d(r);a.current=r;let f=d(null),L=d(null),h=u(e=>{o.current.surface===e.surface&&o.current.phase===e.phase||(o.current=e,i(e))},[]),m=u(()=>{f.current&&(clearTimeout(f.current),f.current=null)},[]),v=u(()=>{L.current&&(clearTimeout(L.current),L.current=null)},[]),g=u(e=>{l.current=e,m(),v(),h({surface:e,phase:"visible"})},[v,m,h]),C=u(t=>{if(!a.current||o.current.surface!==a.current||t===a.current){if(l.current=t,m(),v(),null!==o.current.surface)return void h({surface:t,phase:"visible"});f.current=setTimeout(()=>{f.current=null,l.current===t&&h({surface:t,phase:"visible"})},e)}},[v,m,e,h]),b=u(e=>{e!==a.current&&(l.current===e&&(l.current=null),m(),o.current.surface===e&&(v(),h({surface:e,phase:"exiting"}),L.current=setTimeout(()=>{L.current=null,null===l.current&&h(O)},t)))},[v,m,t,h]),x=u(e=>{e&&o.current.surface!==e||(l.current=null,m(),v(),h(O))},[v,m,h]);return c(()=>{r&&o.current.surface===r&&g(r)},[r,g]),p(()=>()=>{m(),v()},[v,m]),{surface:n.surface,phase:n.phase,enter:C,leave:b,show:g,dismiss:x}}function A(e){let t=(e.id||e.label).replace(/^.*\//,"").match(/(?:^|[\s-])(\d+)(?:[.\s-](\d{1,2}))?/);return t?1e3*Number(t[1])+Number(t[2]??0):0}function X(e){if(void 0!==e.tierRank)return e.tierRank;let t=`${e.id} ${e.label}`.toLowerCase();return/\b(nano|spark|haiku)\b/.test(t)?1:/\b(mini|luna|flash)\b/.test(t)?2:/\b(terra|sonnet)\b/.test(t)?3:/\b(sol|opus|pro)\b/.test(t)?4:/\b(fable|ultra)\b/.test(t)?5:3}function B(e){let t=e.length>0&&e.every(({model:e})=>e.releaseDate&&Number.isFinite(Date.parse(e.releaseDate)));return[...e].sort((e,r)=>(t?Date.parse(e.model.releaseDate)-Date.parse(r.model.releaseDate):A(e.model)-A(r.model))||X(e.model)-X(r.model)||(r.model.catalogPriority??-r.index)-(e.model.catalogPriority??-e.index))}function N(e,t){return B(t.map((e,t)=>({index:t,model:e})))}function Z(e){let t=e?.speedTiers?.filter(e=>"default"!==e.id);return t?.length?[{value:"default",label:"Normal"},...t.map(e=>({value:e.id,label:e.label}))]:[]}function j(e,t){let r=t.serviceTier;if(!r||"default"===r||e.speedTiers?.some(({id:e})=>e===r))return t;let n="fast"===r&&e.speedTiers?.some(({id:e})=>"priority"===e);return{...t,serviceTier:n?"priority":void 0}}function G(e,t){return t?B(e.flatMap((e,r)=>e.upstreamProvider===t?[{index:r,model:e}]:[])):[]}function Y(e){let t={anthropic:"Anthropic","openai-codex":"OpenAI Codex",openai:"OpenAI",openrouter:"OpenRouter"};return t[e]?t[e]:e.split(/[-_]/).filter(Boolean).map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}function W(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"")}function U(e,t,r){let n=e.getRootNode().elementFromPoint?.(t,r)??e.ownerDocument.elementFromPoint?.(t,r);return n instanceof Node&&e.contains(n)}function q(e,t,r,n){let i=()=>{e.removeEventListener("pointermove",l,!0),e.removeEventListener("pointerup",o,!0),e.removeEventListener("pointercancel",o,!0),e.defaultView?.removeEventListener("blur",a)},o=e=>{e.pointerId===t&&(i(),r(e))},l=e=>{if(e.pointerId===t){if("mouse"===e.pointerType&&!(1&e.buttons))return void o(e);n?.(e)}},a=()=>{i(),r(null)};return e.addEventListener("pointermove",l,!0),e.addEventListener("pointerup",o,!0),e.addEventListener("pointercancel",o,!0),e.defaultView?.addEventListener("blur",a),i}function K(e,t){if(!t.width||!t.height)return null;let r=e.x<t.left?t.left-e.x:e.x-t.right,n=e.y<t.top?t.top-e.y:e.y-t.bottom;return r<=0&&n<=0?null:n>=r?{axis:"y",distance:n,direction:e.y<t.top?1:-1,start:t.left,end:t.right}:{axis:"x",distance:r,direction:e.x<t.left?1:-1,start:t.top,end:t.bottom}}function Q(e,t,r,n){let i=e.ownerDocument,o=n?.trigger,l=null,a=null,s=null,d=!1,u=e=>{d!==e&&(d=e,n?.onHoldChange?.(e))},c=({x:t,y:r})=>U(e,t,r)||!(!o||!U(o,t,r)),p=()=>{null!==l&&(cancelAnimationFrame(l),l=null)},f=()=>r?.()??(n?e:null),L=(e,r)=>{a?.(),p(),u(!0);let n=e,o=null,l=0,s=0,d=performance.now(),L=d+320,h=(e=!1)=>{a=null,u(!1),cancelAnimationFrame(x),clearTimeout(y),i.removeEventListener("pointermove",v,!0),i.removeEventListener("pointerdown",g,!0),i.removeEventListener("keydown",C,!0),i.defaultView?.removeEventListener("blur",b),e&&!c(n)&&(p(),t(n))},m=()=>{if(!o)return;if(c(n))return void h();let t="x"===o.axis?"y":"x",r=(n[o.axis]-e[o.axis])*o.direction,i=Math.max(0,r/o.distance),a=e[t],u=a+(o.start-a)*i,p=a+(o.end-a)*i,f=6+28*(1-i);if(r<l-6||i>1||n[t]<u-f||n[t]>p+f)return void h(!0);if(l=Math.max(l,r),r-s<12)return;s=r;let m=performance.now(),v=Math.min(d+560,m+160);v<=L||(L=v,clearTimeout(y),y=setTimeout(()=>h(!0),L-m))},v=e=>{"mouse"===e.pointerType&&(n={x:e.clientX,y:e.clientY},m())},g=e=>{n={x:e.clientX,y:e.clientY},h(!0)},C=e=>{"Escape"===e.key&&h(!0)},b=()=>h(!0),x=requestAnimationFrame(()=>{let t=f(),n=t?.getBoundingClientRect();!n||r&&t===r.pane&&n.left===r.bounds.left&&n.top===r.bounds.top&&n.width===r.bounds.width&&n.height===r.bounds.height?h(!0):(o=K(e,n),o?m():h(!0))}),y=setTimeout(()=>h(!0),320);a=h,i.addEventListener("pointermove",v,!0),i.addEventListener("pointerdown",g,!0),i.addEventListener("keydown",C,!0),i.defaultView?.addEventListener("blur",b)},h=r=>{if(null!==s||a||"touch"===r.pointerType)return;let i=r.relatedTarget;if(i instanceof Node&&(e.contains(i)||o?.contains(i)))return;let d={x:r.clientX,y:r.clientY};n&&"mouse"===r.pointerType?L(d):(p(),l=requestAnimationFrame(()=>{l=null,!a&&null===s&&!c(d)&&t(d)}))},m=e=>{if(null!==s||a||0===e.detail||"pointerType"in e&&"mouse"!==e.pointerType)return;let t=f();if(!(t&&e.target instanceof Node&&t.contains(e.target)))return;let r={x:e.clientX,y:e.clientY},n=t.getBoundingClientRect();K(r,n)||L(r,{pane:t,bounds:n})},v=e=>{if(s=null,"mouse"===e?.pointerType){let r={x:e.clientX,y:e.clientY};if("pointercancel"!==e.type)return void L(r);if(!c(r))return u(!1),void t(r)}u(!1)},g=e=>{0!==e.button||s||!(e.target instanceof Element)||!e.target.closest("[data-model-scrub]")||(a?.(),p(),s=q(i,e.pointerId,v),u(!0))};return(r||n)&&e.addEventListener("click",m,!0),e.addEventListener("pointerout",h),e.addEventListener("pointerover",p),o?.addEventListener("pointerout",h),o?.addEventListener("pointerover",p),n&&e.addEventListener("pointerdown",g,!0),()=>{p(),a?.(),s?.(),u(!1),e.removeEventListener("click",m,!0),e.removeEventListener("pointerout",h),e.removeEventListener("pointerover",p),o?.removeEventListener("pointerout",h),o?.removeEventListener("pointerover",p),e.removeEventListener("pointerdown",g,!0)}}var _=e,J={WebkitUserSelect:"none",userSelect:"none"},ee={minimal:"Minimal",low:"Low",medium:"Medium",high:"High",xhigh:"X-high",max:"Max",ultra:"Ultra"};function te(e){let t=e.replace(/-/g," ").replace(/^claude\s+/i,"").replace(/^GPT\s*/i,"GPT ").replace(/^Sonn\b/i,"Sonnet").replace(/^(fable|opus|sonnet)\b/i,e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()),r=t.match(/^GPT\s+(\d+)(?:\.(\d+))?\b/i);if(!r)return t;let n=Number(r[1]),i=Number(r[2]??0);return n>5||5===n&&i>=6?t.replace(/^GPT\s+/i,""):t}function re({count:e,index:t,pill:r}){let n=Math.min(e,7),i=t<0?-1:e<=1?0:Math.round(t*(n-1)/(e-1));return L("span",{title:t>=0?`${t+1} of ${e}`:void 0,style:{alignItems:"center",background:r?"var(--picker-control)":"transparent",borderRadius:9,display:"inline-flex",gap:2,justifyContent:"center",padding:r?"2px 4px":4,transition:"background-color 120ms ease, padding 120ms ease"},children:Array.from({length:n},(e,t)=>{let r=t===i;return L("span",{style:0!==t||r?{background:"currentColor",opacity:r?1:.55,borderRadius:999,height:r?3:2,width:r?3:2,transition:"background-color 120ms ease, height 120ms ease, width 120ms ease"}:{background:"currentColor",opacity:.45,borderRadius:2,height:6,width:1,transition:"background-color 120ms ease, height 120ms ease, width 120ms ease"}},t)})})}function ne({icon:e,options:t,selectedIndex:r,displayLabel:n,onSelect:i,scrub:o=!1,settingLabel:l}){let a=d(null),u=d(!1),[p,f]=s(!1),[m,v]=s(!1),g=r>=0&&r<t.length?r:0,C=t[g],b=!i||t.length<=1,x=r<0?"Inherit":C?.label,y=d({onSelect:i,count:t.length});c(()=>{y.current={onSelect:i,count:t.length},(!o||b)&&a.current&&(a.current(),v(!1))},[b,i,t.length,o]),c(()=>()=>a.current?.(),[]);return h("button",{type:"button","aria-label":l?`${l}: ${x}`:void 0,disabled:b,onPointerDown:e=>{if(!o||b||0!==e.button||a.current)return;let t=e.currentTarget,{pointerId:n,clientX:i}=e,l=t.getBoundingClientRect(),s=t.ownerDocument.defaultView,d=s?.visualViewport,c=d?.offsetLeft??0,p=c+(d?.width??s?.innerWidth??l.right),f=Math.max(l.left,c)+4,L=Math.min(l.right,p)-4,h=!1,m=r;u.current=!1,v(!0);let C=e=>{let t=e-i,{count:r,onSelect:n}=y.current,o=Math.min(g,r-1),l=t<0?o:r-1-o,a=Math.max(1,t<0?i-f:L-i);if(!h&&Math.abs(t)<Math.min(4,a))return;h=!0;let s=Math.min(22,a/Math.max(1,l)),d=Math.max(0,Math.min(r-1,o+Math.round(t/s)));d!==m&&(m=d,n?.(d))},x=q(t.ownerDocument,n,e=>{"pointerup"===e?.type&&C(e.clientX),a.current?.(),v(!1),u.current=!!e&&"pointercancel"!==e.type&&(h||!U(t,e.clientX,e.clientY))},e=>C(e.clientX));a.current=()=>{a.current=null,x(),t.hasPointerCapture(n)&&t.releasePointerCapture(n)},t.setPointerCapture(n)},"data-model-scrub":o&&!b?"":void 0,onMouseEnter:()=>f(!0),onMouseLeave:()=>f(!1),onClick:e=>{let n=u.current;u.current=!1,!(e.detail>0&&n)&&(b||i(((r<0?-1:g)+1)%t.length))},style:{alignItems:"center",background:"transparent",border:0,borderRadius:24,color:p||m?"var(--picker-primary)":"var(--picker-secondary)",cursor:b?"default":o?"ew-resize":"pointer",display:"flex",fontFamily:_,fontSize:12,height:30,justifyContent:"space-between",letterSpacing:"0.12px",padding:"8px 6px 8px 10px",touchAction:o?"none":"auto",...J,width:"100%",transition:"background-color 120ms ease, color 120ms ease"},children:[h("span",{style:{alignItems:"center",display:"inline-flex",gap:6,minWidth:0},children:[L(e,{"aria-hidden":"true",size:12,strokeWidth:1.75}),L("span",{style:{...J,lineHeight:1.35,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:l??n??C?.label??"Unavailable"})]}),h("span",{style:{alignItems:"center",display:"inline-flex",gap:2},children:[l&&L("span",{style:{...J,fontSize:11},children:x}),L(re,{count:t.length,index:r,pill:p||m})]})]})}function ie({theme:e,visible:o,style:a,provider:u,availableProviders:c=[],models:v,modelIndex:g,agentSettings:C={},onProviderChange:b,onModelChange:x,onAgentSettingsChange:y,triggerRef:w,onHoverExit:k,onHoverHoldChange:M}){let S=d(null);p(()=>{let e=S.current,t=w?.current;if(o&&e&&t&&k)return Q(e,k,void 0,{trigger:t,onHoldChange:M})},[o,w,k,M]);let T="dark"===e?"light":"dark",z=l[T],P=v[g]??v[0],R=f(()=>function(e){return[...new Set(e.flatMap(e=>e.upstreamProvider?[e.upstreamProvider]:[]))]}(v),[v]),I=P?.upstreamProvider??R[0],[D,V]=s(""),[$,F]=s(!1),[O,H]=s(!1),A=f(()=>function(e,t){let r=W(t);return r?e.filter(e=>W(`${e} ${Y(e)}`).includes(r)):e}(R,D),[D,R]),X=function(e,t){if(!e||!t)return"";let r=Y(e);return W(`${e} ${r}`).includes(W(t))?r:""}(A[0],D),B=X.toLowerCase().indexOf(D.trim().toLowerCase());p(()=>{$||V(I?Y(I):"")},[$,I]);let j=e=>{let t=function(e,t){let r=G(e,t);return r.find(e=>e.model.isDefault)?.index??r[0]?.index??0}(v,e);V(Y(e)),F(!1),x?.(t)},U=f(()=>"omp"===u?G(v,I):N(0,v),[v,u,I]),q=U.findIndex(e=>e.index===g),K=U.map(e=>({value:String(e.index),label:te(e.model.label)})),J="claude"===u?["low","medium","high","xhigh","max"]:["low","medium","high","xhigh"],re=P?.supportedReasoningLevels?.map(e=>e.effort)??J,ie=re.map(e=>({value:e,label:ee[e]??e})),oe=C.reasoningEffort??P?.defaultReasoningLevel??re[0],le=Math.max(0,re.indexOf(oe??"")),ae=Z(P),se=f(()=>U.some(({model:e})=>Z(e).length>0),[U]),de=ae.findIndex(e=>e.value===C.serviceTier),ue=["codex","claude","omp","copilot","opencode"].filter(e=>0===c.length||c.includes(e));return h("div",{"data-model-picker":!0,"data-popmelt-font":"sans",ref:S,style:{"--picker-control":z.control,"--picker-primary":z.primary,"--picker-secondary":"dark"===T?z.threadPrimary:z.hoverForeground,colorScheme:T,color:z.primary,background:z.raisedSurface,border:`1px solid ${z.border}`,borderRadius:20,bottom:39,boxSizing:"border-box",display:"flex",flexDirection:"column",left:0,opacity:o?1:0,padding:4,pointerEvents:o?"auto":"none",fontFamily:_,position:"absolute",transition:"opacity 120ms ease",width:Math.max(se?152:139,32*ue.length),zIndex:4,...a},children:[L("div",{style:{display:"flex",width:"100%"},children:ue.map(e=>{let t=u===e;return L("button",{type:"button","aria-label":"Use "+("codex"===e?"GPT":"claude"===e?"Claude":"copilot"===e?"Copilot":"opencode"===e?"OpenCode":"OMP"),"aria-pressed":t,disabled:!b,onClick:()=>b?.(e),style:{alignItems:"center",background:t?z.control:"transparent",border:0,borderRadius:24,color:t?z.primary:"var(--picker-secondary)",cursor:b?"pointer":"default",display:"flex",flex:1,justifyContent:"center",padding:"8px 10px",transition:"background-color 120ms ease, color 120ms ease"},children:L(E,{provider:e,size:12})},e)})}),"omp"===u&&R.length>0&&h("div",{style:{position:"relative",width:"100%"},children:[L(t,{"aria-hidden":"true",size:12,strokeWidth:1.75,style:{color:z.secondary,left:10,opacity:O?1:0,pointerEvents:"none",position:"absolute",top:8,transition:"opacity 120ms ease",zIndex:3}}),$&&X&&L("div",{"aria-hidden":"true",style:{color:z.secondary,fontFamily:_,fontSize:12,height:28,left:0,lineHeight:"28px",overflow:"hidden",padding:O?"0 10px 0 28px":"0 10px",pointerEvents:"none",position:"absolute",right:0,top:0,transition:"padding-left 120ms ease",whiteSpace:"pre",zIndex:1},children:B>=0?h(m,{children:[X.slice(0,B),L("span",{style:{color:z.primary},children:X.slice(B,B+D.trim().length)}),X.slice(B+D.trim().length)]}):X}),L("input",{"aria-label":"OMP provider","aria-autocomplete":"inline",autoComplete:"off",onBlur:()=>{F(!1)},onChange:e=>{V(e.currentTarget.value),F(!0)},onFocus:e=>{F(!0),e.currentTarget.select()},onKeyDown:e=>{if("Enter"===e.key){let t=A[0];t&&(e.preventDefault(),j(t),e.currentTarget.blur())}else if("Tab"===e.key){let e=A[0];e&&X&&j(e)}else"Escape"===e.key&&e.currentTarget.blur()},onMouseEnter:()=>H(!0),onMouseLeave:()=>H(!1),placeholder:"Provider",value:D,style:{background:"transparent",border:0,borderRadius:0,boxSizing:"border-box",color:$&&X?"transparent":$||O?z.primary:"var(--picker-secondary)",caretColor:$&&!X?z.primary:"transparent",cursor:$?"text":"pointer",fontFamily:_,fontSize:12,height:28,outline:"none",padding:O?"6px 10px 6px 28px":"6px 10px",position:"relative",transition:"color 120ms ease, padding-left 120ms ease",width:"100%",zIndex:2}})]}),L(ne,{icon:r,options:K,selectedIndex:q,displayLabel:q<0&&P?te(P.label):void 0,onSelect:x?e=>{let t=U[e];t&&x?.(t.index)}:void 0,scrub:o}),"opencode"!==u&&L(ne,{icon:n,options:ie,selectedIndex:le,onSelect:y?e=>y({...C,reasoningEffort:ie[e].value}):void 0,scrub:o}),ae.length>0&&L(ne,{icon:i,settingLabel:"Speed",options:ae,selectedIndex:de,onSelect:y?e=>y({...C,serviceTier:ae[e].value}):void 0,scrub:o})]})}function oe({triggerRef:e,provider:t,open:r,onClick:n,onMouseEnter:i,onMouseLeave:l,style:a}){let[d,u]=s(!1);return h("button",{type:"button",ref:e,"data-model-picker":!0,"aria-expanded":r,"aria-label":"Choose model settings",onMouseEnter:()=>{u(!0),i?.()},onMouseLeave:()=>{u(!1),l?.()},onClick:n,style:{alignItems:"center",background:r||d?"var(--popmelt-thread-control, #eaeaea)":"transparent",border:0,borderRadius:40,color:"var(--popmelt-thread-muted-strong, #888)",cursor:"pointer",display:"flex",gap:2,height:24,padding:"0 3px 0 6px",...a,transition:"background-color 120ms ease, color 120ms ease"},children:[L(E,{provider:t,size:14}),L(o,{"aria-hidden":"true",size:12,strokeWidth:1.75,style:{transform:r?"rotate(180deg)":"rotate(0deg)",transition:"transform 120ms ease"}})]})}export{g as a,b,x as c,y as d,w as e,E as f,T as g,I as h,V as i,$ as j,F as k,H as l,N as m,Z as n,j as o,U as p,Q as q,ie as r,oe as s};
|
package/dist/chunk-RUTWU5W2.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{j as e}from"./chunk-NSCO633B.mjs";import{a as t}from"./chunk-G7JR5Z3P.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-TLREGQQB.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{b as e,a as t}from"./chunk-NSCO633B.mjs";import{f as n}from"./chunk-J4WDYITA.mjs";import{b as r,aa as o,S as i,P as a,L as l,C as s,B as d,J as c,H as u,F as p,G as h,M as m,K as f,I as g,O as y,ea as x,ga as v,N as C,Y as w,da as b,E as k,V as I,U as S,X as M,ia as $}from"./chunk-26P7UUHT.mjs";import{a as E}from"./chunk-G2ZHJXHZ.mjs";import{b as A,a as H}from"./chunk-G6RYESYI.mjs";import{S as T,H as R,ha as j,$ as P,Ka as z,pa as N,c as V,z as B,w as L,x as W,m as Z,ia as F,ea as D,ta as O,ra as _,G as q,y as Y,fa as J,ga as K,Da as X,o as G,e as Q,f as U,Fa as ee,i as te,g as ne,h as re,k as oe,j as ie,d as ae,n as le,l as se}from"./chunk-MSWXKP77.mjs";import{b as de,a as ce}from"./chunk-G7JR5Z3P.mjs";import{a as ue}from"./chunk-HU2XWUJC.mjs";import{f as pe,c as he}from"./chunk-XT6PHPPG.mjs";import{x as me,y as fe,d as ge,b as ye,j as xe,w as ve,K as Ce,M as we,L as be,N as ke,k as Ie,g as Se,f as Me,I as $e,i as Ee,n as Ae}from"./chunk-HAE5LUJX.mjs";import{b as He,a as Te}from"./chunk-53SKVMWR.mjs";import{c as Re,a as je}from"./chunk-57FM7XQV.mjs";import{a as Pe}from"./chunk-LVEMYZOA.mjs";import{d as ze,m as Ne,v as Ve,u as Be,p as Le}from"./chunk-WHJEKDNP.mjs";import{createContext as We,useMemo as Ze,useState as Fe,useEffect as De,useCallback as Oe,useRef as _e,useLayoutEffect as qe,useContext as Ye,useReducer as Je}from"react";import{jsxs as Ke,jsx as Xe,Fragment as Ge}from"react/jsx-runtime";function Qe(e){let{selector:t,durableSelector:n,pathname:r,annotationNumber:o,changes:i}=e;return{selector:t,durableSelector:n,pathname:r,annotationNumber:o,changes:i.map(({property:e,original:t,modified:n,token:r})=>({property:e,original:t,modified:n,token:r}))}}function Ue(e,t){if((e.pathname??"")!==(t.pathname??"")||e.selector!==t.selector&&(!e.durableSelector||e.durableSelector!==t.durableSelector))return!1;let n=e=>JSON.stringify(e.map(({property:e,original:t,modified:n,token:r})=>[e,t,n,r??null]).sort((e,t)=>String(e[0]).localeCompare(String(t[0]))));return n(e.changes)===n(t.changes)}function et(e,t,n,r=new Set){let o=new Map(t.filter(e=>e.authorId===n).flatMap(e=>e.annotations?.map(({id:t})=>[t,e.threadId])??[])),i=!1,a=e.annotations.map(e=>{if(r.has(e.id)&&["pending","sending"].includes(e.status??"pending"))return i=!0,{...e,status:"awaiting_review"};let t="sending"===e.status&&!!e.threadId&&e.threadId===o.get(e.id);return"pending"!==(e.status??"pending")&&!t||e.threadId&&e.threadId!==o.get(e.id)||!o.has(e.id)?e:(i=!0,{...e,threadId:o.get(e.id)??e.threadId,status:"awaiting_review"})}),l=!1,s=e.styleModifications.map(e=>{if(e.captured)return e;let r=[...t].reverse().find(t=>t.authorId===n&&t.threadId&&t.styleModifications?.some(t=>Ue(e,t)));return r?.threadId?(l=!0,{...e,awaitingReview:{submissionId:r.id,threadId:r.threadId}}):e});return i||l?{...e,annotations:i?a:e.annotations,styleModifications:l?s:e.styleModifications}:e}function tt(e){if(e.awaitingReview)return{jobId:`suggestion:${e.awaitingReview.submissionId}`,threadId:e.awaitingReview.threadId,status:"awaiting_review",selectors:[e.selector],annotationNumber:e.annotationNumber}}function nt(e,t){if(!t)return e;let n=e.activeColor!==t,r=e.annotations.map(e=>e.color===t?e:(n=!0,{...e,color:t}));return n?{...e,activeColor:t,annotations:r}:e}function rt(e,t){return t.selectors??(t.targetBindingId?[]:[e])}function ot(e,t,n){let r=[...new Set(e)];if(1!==r.length)return;let o=n(r[0]);if(!o)return;let i=t.filter(e=>!(!e.threadId||!e.linkedSelector||"pending"===e.status)&&n(e.linkedSelector)===o),a=[...new Set(i.map(e=>e.threadId))];return 1===a.length?{threadId:a[0],targetBindingId:i.find(e=>e.targetBindingId)?.targetBindingId,color:i.find(e=>e.color)?.color,selectorAliases:[...new Set([r[0],...i.map(e=>e.linkedSelector)])]}:void 0}function it(e,t,n,r){let o=[...new Set(e)];return 1!==o.length?n:st(o[0],t,r)?.color??n}function at(e,t){let n=[...new Set(e)];if(1!==n.length)return;let r=st(n[0],t);return r?.continuationEligible?r.threadId:void 0}function lt(e,t){let n=[...new Set(e)];if(1!==n.length)return;let r=st(n[0],t);return r?.continuationEligible?r.targetBindingId:void 0}function st(e,t,n){for(let[n,r]of t)if(rt(n,r).includes(e))return r;if(!n)return;let r=n(e);if(r)for(let[e,o]of t)if(rt(e,o).some(e=>n(e)===r))return o}function dt(e,t,n){let r=new Map(e);for(let[o,i]of e)i.threadId===t&&r.set(o,{...i,jobId:n,threadId:t,status:"in_flight",label:void 0});return r}function ct(e,t){let n=new Set;for(let[r,o]of e)if(t.has(o.threadId))for(let e of rt(r,o))n.add(e);return n}function ut(e,t,n,r,o,i){let a=new Set(o);for(let[n,r]of e)if(r.jobId===t)for(let e of rt(n,r))a.add(e);let l=new Map(e);for(let e of a){let o=[...l].find(([t,n])=>rt(t,n).includes(e)),a=o?.[1];if(a&&a.jobId!==t)continue;let s=i??a?.threadId;if(!s)continue;let d=o?.[0]??`job:${t}:${e}`;l.set(d,{...a,jobId:t,threadId:s,status:n,label:r,selectors:a?.selectors??[e]})}return l}function pt(e,t,n){let r=new Map(e);for(let[e,o]of t)n.has(o.jobId)&&r.set(e,o);return r}function ht(e,t,n,r){if(!r)return new Map;let o=new Map;for(let[r,i]of e){if(t.has(i.threadId))continue;let e=n.indexOf(i.threadId);o.set(r,{...i,annotationNumber:i.annotationNumber??(e>=0?e+1:void 0)})}return o}function mt(e,t,n){if(t)return e?t.jobId===n?t:void 0:t}var ft=Number.MAX_SAFE_INTEGER;function gt(e){return`${e.pathname??"*"}\0${e.selector}`}function yt(e,t){return`element:${e??"*"}\0${t}`}function xt({annotations:e,styleModifications:t,textModifications:n}){let r=new Map,o=0,i=new Map;for(let t of e)t.groupId&&t.linkedSelector&&i.set(t.groupId,{selector:t.linkedSelector,pathname:t.pathname});for(let t of e){let e=t.groupId?i.get(t.groupId):t.linkedSelector?{selector:t.linkedSelector,pathname:t.pathname}:void 0,n=e?yt(e.pathname,e.selector):`annotation:${t.groupId??t.id}`,a=r.get(n);a?(a.createdAt=Math.min(a.createdAt,t.timestamp),a.annotationIds.push(t.id)):r.set(n,{key:n,createdAt:t.timestamp,stableIndex:o++,annotationIds:[t.id]})}let a=e=>{let t=gt(e),n=`element:${t}`,i=e.createdAt??ft,a=r.get(n);if(a)return a.createdAt=Math.min(a.createdAt,i),void(a.modificationKey=t);r.set(n,{key:n,createdAt:i,stableIndex:o++,annotationIds:[],modificationKey:t})};t.forEach(a),n.forEach(a);let l=new Map,s=new Map,d=[...r.values()].sort((e,t)=>e.createdAt-t.createdAt||e.stableIndex-t.stableIndex);return d.forEach((e,t)=>{let n=t+1;e.annotationIds.forEach(e=>l.set(e,n)),e.modificationKey&&s.set(e.modificationKey,n)}),{annotationNumberById:l,modificationNumberByKey:s,count:d.length}}function vt(e){let t=new Set,n=new Map;for(let t of e){if(!t.linkedSelector)continue;let e=n.get(t.linkedSelector)||[];e.push(t),n.set(t.linkedSelector,e)}let r=new Set,o=new Set;for(let e of n.values()){if(e.length<=1){e[0]?.groupId&&o.add(e[0].groupId);continue}e.sort((e,t)=>t.timestamp-e.timestamp);let n=e[0];n.groupId&&o.add(n.groupId);for(let n=1;n<e.length;n++){let o=e[n];t.add(o),o.groupId&&r.add(o.groupId)}}for(let n of e)n.groupId&&r.has(n.groupId)&&!o.has(n.groupId)&&t.add(n);return t}function Ct({state:e,pageAnnotations:t,pageStyleModifications:n,pageTextModifications:r}){let o=Ze(()=>vt(e.annotations),[e.annotations]),i=Ze(()=>xt({annotations:t.filter(e=>!o.has(e)),styleModifications:n,textModifications:r}),[t,n,r,o]),a=Ze(()=>{let e=new Map,t=t=>{let n=i.modificationNumberByKey.get(gt(t));if(void 0===n)return;let r=e.get(t.selector);(void 0===r||n<r)&&e.set(t.selector,n)};return n.forEach(t),r.forEach(t),e},[n,r,i.modificationNumberByKey]);return{supersededAnnotations:o,stagedArtifactOrder:i,annotationGroupMap:i.annotationNumberById,pageModificationNumberBySelector:a}}var wt="The content or target changed while capturing. Review your changes and send again.";function bt(e){return{id:e.id,type:e.type,text:e.text,groupId:e.groupId,pathname:e.pathname,linkedSelector:e.linkedSelector,target:e.target,targetBindingId:e.targetBindingId,threadId:e.threadId,elements:e.elements,region:e.region,points:e.linkedSelector||e.target?e.points.slice(1):e.points,attachments:e.attachments,imageCount:e.imageCount,interactionEpisode:e.interactionEpisode,status:"sending"===e.status?"pending":e.status??"pending"}}function kt(e,t){let n=new Map(t.annotations.map(e=>[e.id,e]));return e.annotations.every(e=>{let t=n.get(e.id);return t&&(t===e||r(bt(e),bt(t)))})&&["styleModifications","textModifications","domModifications","spacingTokenChanges"].every(n=>e[n].every(e=>t[n].some(t=>r(e,t))))}function It(e){let t=e instanceof Error?e.message:"";return t===wt||"Page context could not be captured. Try sending again."===t?t:t.startsWith("Draft changed during capture")?"The saved draft changed during capture. Review it and send again.":"The host removed an annotation in this request"===t?"One of these annotations was removed. Review the remaining draft and send again.":/failed to fetch|network|offline|disconnect|closed|sync paused/i.test(t)?"The bridge connection was interrupted. Check the thread before retrying.":"Popmelt couldn’t confirm delivery. Check the thread before retrying."}async function St(e,t,n,r){let o=n=>{e.length&&t({type:"SET_ANNOTATION_STATUS",payload:{ids:e,status:n,..."pending"===n?{from:"sending"}:{}}})};o("sending");let i=!1;try{return i=await n(),i}catch(e){return console.error("[Popmelt] Annotation send failed:",e),r?.(e),!1}finally{i||o("pending")}}var Mt="devtools-active-text";async function $t(e,t,n){if(e.current)return n;e.current=!0;try{return await t()}finally{e.current=!1}}function Et(e){e.removeItem(Mt)}function At(e){return!("Enter"!==e.key||!e.metaKey&&!e.ctrlKey)&&(e.preventDefault(),e.stopPropagation(),!0)}function Ht(e){return!!e&&(void 0!==e.originalText?e.text!==e.originalText:e.text.trim().length>0||!!e.hasInteractionEpisode)}var Tt={expanded:"devtools-toolbar-expanded",annotations:"devtools-annotations",styleMods:"devtools-style-modifications",textMods:"devtools-text-modifications",domMods:"devtools-dom-modifications",spacingChanges:"devtools-spacing-changes",tool:"devtools-active-tool",color:"devtools-next-thread-color",legacyColor:"devtools-active-color",stroke:"devtools-stroke-width",inspected:"devtools-inspected-element"};function Rt(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}function jt(e,t){return{styleModifications:Rt(e.getItem(t.styleMods)),textModifications:Rt(e.getItem(t.textMods)),domModifications:Rt(e.getItem(t.domMods)),spacingTokenChanges:Rt(e.getItem(t.spacingChanges))}}function Pt(e,t){return`${e}:project:${encodeURIComponent(t.trim())}`}function zt(e){return{expanded:Pt(Tt.expanded,e),annotations:Pt(Tt.annotations,e),styleMods:Pt(Tt.styleMods,e),textMods:Pt(Tt.textMods,e),domMods:Pt(Tt.domMods,e),spacingChanges:Pt(Tt.spacingChanges,e),tool:Pt(Tt.tool,e),color:Pt(Tt.color,e),stroke:Pt(Tt.stroke,e),inspected:Pt(Tt.inspected,e)}}function Nt(e){return Pt("popmelt-workspace-generation",e)}function Vt(e,t){let n=e.getItem(Nt(t));if(null===n||""===n.trim())return null;let r=Number(n);return Number.isInteger(r)&&r>=0?r:null}function Bt(e,t){return!(!Number.isInteger(t)||t<0)&&t>(e??0)}function Lt(e,t){return"string"==typeof e.pathname&&e.pathname===t}function Wt(e){let{storage:t,projectId:n,pathname:r,selectorExists:o}=e,i=zt(n),a=Pt("popmelt-annotation-workspace-migration-v1",n);if("complete"===t.getItem(a))return i;let l=function(e,t,n){return e.filter(e=>!(!e||"string"!=typeof e.id||!Lt(e,t)||"pending"!==(e.status??"pending")||e.threadId||!e.target&&e.linkedSelector&&!n(e.linkedSelector)))}(function(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t:[]}catch{return[]}}(t.getItem(Tt.annotations)),r,o);null===t.getItem(i.annotations)&&t.setItem(i.annotations,JSON.stringify(l));let s=[["expanded",Tt.expanded],["tool",Tt.tool],["color",Tt.color],["stroke",Tt.stroke]];for(let[e,n]of s){let r="color"===e?t.getItem(n)??t.getItem(Tt.legacyColor):t.getItem(n);null!==r&&null===t.getItem(i[e])&&t.setItem(i[e],r)}for(let e of[i.styleMods,i.textMods,i.domMods,i.spacingChanges])null===t.getItem(e)&&t.setItem(e,"[]");null===t.getItem(i.inspected)&&t.removeItem(i.inspected),t.setItem(a,"complete");for(let e of Object.values(Tt))t.removeItem(e);return i}function Zt(e,t,n=new Set){let r=function(e){let t=new Map;for(let n of e)n.groupId&&n.threadId&&t.set(n.groupId,n.threadId);return t}(e);return e.filter(e=>{let o=function(e,t){return e.threadId??(e.groupId?t.get(e.groupId):void 0)}(e,r);return Lt(e,t)&&"dismissed"!==e.status&&(!o||!n.has(o))})}function Ft(e,t,n,r=new Set,o=new Map){let i=new Set;for(let e of Zt(t,n,r))e.linkedSelector&&i.add(e.linkedSelector);for(let[e,t]of o)if(!r.has(t.threadId))for(let n of t.selectors??[e])i.add(n);return e.filter(e=>(!e.pathname||e.pathname===n)&&(!e.captured||i.has(e.selector)||!!e.durableSelector&&i.has(e.durableSelector)))}function Dt({state:e,activeText:t,currentPathname:n,dismissedThreadIds:r,modifiedElementThreadStates:o}){let i=Ze(()=>Zt(e.annotations,n,r),[e.annotations,n,r]),a=Ze(()=>Ft(e.styleModifications,e.annotations,n,r,o),[e.annotations,e.styleModifications,n,r,o]),l=Ze(()=>Ft(e.textModifications,e.annotations,n,r,o),[e.annotations,e.textModifications,n,r,o]),s=Ze(()=>{let t=new Set,r=e=>!(e.captured||e.pathname&&e.pathname!==n);for(let n of e.styleModifications)r(n)&&!n.awaitingReview&&t.add(`element:${n.selector}`);for(let n of e.textModifications)r(n)&&t.add(`element:${n.selector}`);for(let n of e.domModifications)r(n)&&t.add(`element:${n.selector}`);for(let n of e.spacingTokenChanges)n.captured||t.add(`spacing:${n.tokenPath}`);for(let n of e.spacingTokenMods)n.captured||t.add(`spacing:${n.tokenPath}`);return t},[n,e.domModifications,e.spacingTokenChanges,e.spacingTokenMods,e.styleModifications,e.textModifications]),d=Ze(()=>function(e,t,n=[]){let r=new Set(e.filter(e=>"pending"===(e.status??"pending")).map(e=>`annotation:${e.groupId||e.id}`));t?.isNew&&!t.domEdit&&(t.text.trim()||t.interactionEpisode?.steps.length)&&r.add(`annotation:${t.groupId||t.id}`);for(let e of n)r.add(`edit:${e}`);return r.size}(e.annotations,t,s),[e.annotations,t,s]),c=Ze(()=>e.annotations.filter(e=>"text"===e.type&&e.text&&"pending"===(e.status??"pending")).sort((e,t)=>t.timestamp-e.timestamp),[e.annotations]);return{pageAnnotations:i,pageStyleModifications:a,pageTextModifications:l,pendingBundleCount:d,pendingTextAnnotations:c}}function Ot(e,t="host",n){let[r,o]=Fe(()=>n?.read().selectedId??t),[i,a]=Fe(null);De(()=>{o(n?.read().selectedId??t),a(null)},[n,t]);let l=Oe(e=>{n?.select(e),o(e),a(null)},[n]),s=Oe(e=>a(e),[]),d=Oe(e=>{a(t=>t===e?null:t)},[]);return De(()=>{let t=()=>a(null);e||t();let n=()=>{document.hidden&&t()};return window.addEventListener("blur",t),document.addEventListener("visibilitychange",n),()=>{window.removeEventListener("blur",t),document.removeEventListener("visibilitychange",n)}},[e]),{selectedId:r,viewedId:e?i??r:r,isPeeking:e&&null!==i&&i!==r,select:l,peek:s,leave:d}}function _t({name:e,isOwnPlane:t,color:n,changed:r}){return Ke("div",{"data-devtools":"peer-plane-label","data-popmelt-font":"mono",role:"status",title:r?"Source changed beneath staged work. Editing, clearing, commenting or sending acknowledges the affected work; viewing alone does not.":void 0,style:{position:"fixed",bottom:8,left:"50%",transform:"translateX(-50%)",maxWidth:"calc(100vw - 32px)",boxSizing:"border-box",padding:"4px 8px",borderRadius:8,background:n,color:"#fff",fontFamily:A,fontSize:12,fontWeight:500,lineHeight:"16px",textOverflow:"ellipsis",whiteSpace:"nowrap",overflow:"hidden",zIndex:10002},children:[t?"Your plane":`${e}’s plane`,r&&" (source changed)"]})}function qt(e,t=[],n=""){let r=new Map;if(!e)return r;let o=et(e,t,n),i=vt(o.annotations),a=o.annotations.filter(e=>!i.has(e)),l=xt({...o,annotations:a});for(let e of a){let t=l.annotationNumberById.get(e.id);e.threadId&&void 0!==t&&!r.has(e.threadId)&&r.set(e.threadId,t)}for(let e of o.styleModifications){let t=e.awaitingReview?.threadId,n=l.modificationNumberByKey.get(gt(e));t&&void 0!==n&&!r.has(t)&&r.set(t,n)}return r}var Yt=We(null);function Jt(e,t){return JSON.stringify([e,t??null])}function Kt(e){return(e.annotations?.length?e.annotations:[{id:void 0,label:"Submitted changes"}]).map(t=>({submission:e,annotation:t,key:Jt(e.id,t.id)}))}function Xt(e,t){return e.filter(e=>e.threadId===t).flatMap(e=>Kt(e).map(e=>e.key))}function Gt(e,t){let n=[],r=()=>{try{let r=JSON.parse(e.getItem(t)??"[]");Array.isArray(r)&&(n=[...new Set([...r.filter(e=>"string"==typeof e),...n])].slice(-1e3))}catch{}return n},o=o=>{let i=r(),a=o.filter(e=>!i.includes(e));if(!a.length)return i;let l=[...new Set([...i,...a])].slice(-1e3);n=l;try{e.setItem(t,JSON.stringify(l))}catch{}return l};return{read:r,markMany:o,mark:e=>o([e])}}function Qt(e){return(e%360+360)%360}function Ut(e){let t=e.match(/oklch\([^)]*\s+([\d.]+)\s*\)/i);if(!t?.[1])return null;let n=Number.parseFloat(t[1]);return Number.isFinite(n)?Qt(n):null}function en(e){return`oklch(0.628 0.258 ${Qt(e)})`}function tn(e){return en((Ut(e)??29)+60)}function nn(e){return new Set(e.filter(e=>e.groupId&&e.threadId).map(e=>e.groupId))}function rn(e,t){let n=!(!e.groupId||!t.has(e.groupId));return!("pending"!==(e.status??"pending")||e.threadId||n||e.replyCount&&e.replyCount>0)}function on(e,t,n){return e.threadId?`thread:${e.threadId}`:e.groupId&&n.has(e.groupId)?`thread-group:${e.groupId}`:e.groupId?`group:${e.groupId}`:e.id?`annotation:${e.id}`:`annotation-index:${t}`}function an(e,t){let n=Math.abs(Qt(e)-Qt(t));return Math.min(n,360-n)<.5}function ln(e,t,n){let r=Ut(e)??29,o=Math.round(6),i=nn(t),a=t.flatMap((e,t)=>{if(!e.color)return[];if(n&&e.pathname&&e.pathname!==n)return[];if(rn(e,i))return[];let r=Ut(e.color);return null===r?[]:[{hue:r,key:on(e,t,i)}]}),l=en(r),s=Number.POSITIVE_INFINITY;for(let e=0;e<o;e+=1){let t=Qt(r+60*e),n=new Set(a.filter(e=>an(e.hue,t)).map(e=>e.key));if(0===n.size)return en(t);n.size<s&&(s=n.size,l=en(t))}return l}function sn(e,t){let n=nn(e);return e.map(e=>rn(e,n)?{...e,color:t}:e)}function dn(e){let t=new Set(e.annotationIds),n={color:e.color,threadId:e.threadId,pathname:e.pathname},r=e.annotations.map(n=>n.id&&t.has(n.id)?{...n,color:e.color,threadId:e.threadId}:n);return r.push(n),ln(tn(e.color),r,e.pathname)}function cn(e,t){return e.find(e=>e.color)?.color??t}function un(e){let t=[...e.annotations].sort((e,t)=>t.timestamp-e.timestamp),n=nn(e.annotations),r=t.find(e=>rn(e,n)&&!!e.color);if(r?.color)return ln(r.color,e.annotations,e.currentPathname);if(e.savedCursor)return ln(e.savedCursor,e.annotations,e.currentPathname);let o=t.find(e=>!(!e.threadId||!e.color));return ln(o?.color?tn(o.color):e.legacyColor??en(29),e.annotations,e.currentPathname)}var pn=["circle","square","diamond","hexagon"];function hn(e="circle",t=26){return{circle:19,square:17.5,diamond:20,hexagon:19}[e]*t/24}var mn=e=>e.map((t,n)=>{let r=e=>{let n=Math.hypot(e[0]-t[0],e[1]-t[1]),r=Math.min(3,n/2)/n;return[t[0]+(e[0]-t[0])*r,t[1]+(e[1]-t[1])*r].join(" ")};return`${n?"L":"M"}${r(e[(n+e.length-1)%e.length])} Q${t.join(" ")} ${r(e[(n+1)%e.length])}`}).join(" ")+" Z",fn={diamond:mn([[12,1],[23,12],[12,23],[1,12]]),hexagon:mn([[12,2],[21,7],[21,17],[12,22],[3,17],[3,7]])},gn=[210,150,270,90,330,30].map(e=>Qt(29+e)),yn=[.68,.5,.82,.59,.75,.43];function xn(e){if("host"===e.identity?.relationship)return"circle";if(e.shape&&pn.includes(e.shape))return e.shape;let t=/^oklch\(([\d.]+) ([\d.]+) ([\d.]+)\)$/.exec(e.color??"");if(t){let n=yn.indexOf(Number(t[1])),r=gn.indexOf(Number(t[3])),o=Math.round(4*(.14/Number(t[2])-1)),i=(o*yn.length+n)*gn.length+r;if(n>=0&&r>=0&&o>=0&&Number.isSafeInteger(i)&&vn(i)===e.color)return function(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Invalid peer color slot");return pn[([0,2,3,0,1,1][e%6]+Math.floor(e/6))%4]}(i)}return"circle"}function vn(e){if(!Number.isSafeInteger(e)||e<0)throw new Error("Invalid peer color slot");let t=Math.floor(e/gn.length),n=yn;return`oklch(${n[t%n.length]} ${.14/(1+.25*Math.floor(t/n.length))} ${gn[e%gn.length]})`}function Cn(e,t,n){return"host"===e?.identity.relationship?e.identity.id===t?n:e.color??ue.activeColor:e?.color??vn(0)}function wn(e){return"inspect"!==e.type&&"style"!==e.type&&"comment"!==e.type&&"attention"!==e.type||!e.selector?null:{selector:e.selector,plane:"inspect"===e.type?e.plane??"own":"own",activity:"attention"===e.type?e.activity??"looking":"inspect"===e.type?"looking":"working"}}function bn(e){return function(e){let t=e.replace(/^\uFEFF/,"").trim().replace(/^<\?xml[\s\S]*?\?>\s*/i,"").replace(/^(?:<!--[\s\S]*?-->\s*)+/i,"").replace(/^<!doctype\s+svg[\s\S]*?>\s*/i,"");return/^<svg(?:\s|>)[\s\S]*<\/svg>\s*$/i.test(t)}(e)?{blob:new Blob([e],{type:"image/svg+xml"}),kind:"svg",name:"figma-selection.svg"}:e.length>=8192?{blob:new Blob([e],{type:"text/plain"}),kind:"text",name:"pasted-context.txt"}:null}function kn(e){return e<1024?`${e} B`:e<1048576?`${Math.round(e/1024)} KB`:`${(e/1048576).toFixed(1)} MB`}function In(e){return`${e} image${e>1?"s":""} attached`}function Sn(e){return e<=0?0:32+7.2*String(e).length}function Mn({imageCount:e,color:t,layered:n=!1}){return e<=0?null:Ke("div",{"data-devtools":"active-image-attachment-badge",role:"img","aria-label":In(e),title:In(e),style:{position:"relative",flex:"0 0 auto",display:"flex",marginRight:-2,zIndex:2},children:[Xe("span",{"aria-hidden":!0,style:{position:"absolute",left:-4,top:"50%",width:14.142,height:14.142,transform:"translateY(-50%)",display:"grid",placeItems:"center",pointerEvents:"none",maskImage:n?He:void 0,WebkitMaskImage:n?He:void 0},children:Xe("span",{style:{width:10,height:10,background:t,transform:"rotate(-45deg)"}})}),Ke("span",{style:{position:"relative",display:"flex",alignItems:"center",gap:4,height:22,padding:n?"0 8px 0 10px":"0 8px",borderRadius:8,backgroundColor:t,color:"#fff",font:`12px/1.2 ${H}`,whiteSpace:"nowrap",maskImage:n?Te:void 0,WebkitMaskImage:n?Te:void 0},children:[Xe(T,{size:12,strokeWidth:2,"aria-hidden":!0}),e]})]})}function $n({point:e,scroll:t,attachments:n,showAttachments:r,onRemoveAttachment:o}){return Xe(Ge,{children:r&&n.length>0&&Xe("div",{"data-devtools":!0,style:{position:"fixed",left:e.x-8-t.x,top:e.y-4-t.y-24,zIndex:10001,display:"flex",gap:4,flexWrap:"wrap",maxWidth:400},children:n.map(e=>Ke("button",{type:"button",title:"Remove attachment",onMouseDown:e=>e.preventDefault(),onClick:()=>o(e.id),style:{appearance:"none",border:0,borderRadius:8,background:"rgba(0,0,0,0.72)",color:"#fff",cursor:"pointer",font:"11px/16px system-ui, sans-serif",padding:"2px 7px",whiteSpace:"nowrap"},children:[e.name," · ",kn(e.size)," ×"]},e.id))})})}function En({query:e,border:t,background:n,foreground:r,renderIcon:o}){return Ke("span",{"aria-hidden":"true","data-popmelt-sticker-query":!0,style:{position:"absolute",left:"50%",top:44,minWidth:24,height:24,display:"flex",alignItems:"center",justifyContent:"center",gap:4,padding:"0 10px",boxSizing:"border-box",border:`1px solid ${t}`,borderRadius:12,background:n,color:r,fontSize:11,fontWeight:600,letterSpacing:.22,lineHeight:1,whiteSpace:"nowrap",transform:"translateX(-50%)",zIndex:4},children:[e.tokens.map((e,t)=>"icon"===e.kind?Xe("span",{"aria-label":e.label,"data-popmelt-sticker-query-token":"icon",style:{display:"inline-flex",color:r,flexShrink:0},children:o(e)},`${e.label}-${t}`):Xe("span",{"data-popmelt-sticker-query-token":"label",style:{color:r,opacity:.72},children:e.label},`${e.label}-${t}`)),e.typed?Xe("span",{children:e.typed}):Ke("span",{style:{display:"inline-flex",alignItems:"center",gap:0,color:r,opacity:.58,fontWeight:500},children:[Xe("span",{"data-popmelt-sticker-query-caret":!0,style:{width:1,height:11,flexShrink:0,background:r,animation:"popmeltStickerQueryCaret 900ms steps(1, end) infinite"}}),Xe("span",{children:e.fallback})]}),e.completion&&Xe("span",{style:{color:r,opacity:.62},children:e.completion}),e.fallback&&e.typed&&Ke("span",{style:{color:r,opacity:.68},children:["→ ",e.fallback]})]})}var An=106,Hn=42,Tn=24,Rn=250,jn=32,Pn="cubic-bezier(0.16, 1, 0.3, 1)",zn=[0,180,240,300];function Nn(e,t,n=42,r=40,o=An){let i=e.left+o,a=e.top+n,l=Math.min(i,t.right)-Math.max(e.left,t.left),s=Math.min(a,t.bottom)-Math.max(e.top,t.top);if(l<=0||s<=0)return 1;let d=Math.min(l,s);return Math.max(0,1-d/r)}function Vn(e,t,n,r=42,o=80,i=8,a=An){let l=Math.min(Math.max(e.x,n.left),n.right),s=Math.min(Math.max(e.y,n.top),n.bottom),d={x:l-e.x,y:s-e.y},c=Math.hypot(d.x,d.y);if(0===c)return 0;let u=d.x/c,p=d.y/c,h=[{x:t.left,y:t.top},{x:t.left+a,y:t.top},{x:t.left,y:t.top+r},{x:t.left+a,y:t.top+r}],m=Math.max(0,...h.map(t=>(t.x-e.x)*u+(t.y-e.y)*p)),f=Math.max(o,m+i);return Math.min(1,c/f)}var Bn={padding:"padding",margin:"margin",border:"border",radius:"radius",stack:"stack-vertical",grid:"grid",text:"text-size",color:"palette",transform:"transform-translate",opacity:"opacity"},Ln={top:0,right:90,bottom:180,left:270},Wn={"top-right":0,"bottom-right":90,"bottom-left":180,"top-left":270};function Zn({name:e}){switch(e){case"padding":return Xe("path",{d:"M9.333 0.375C10.701 0.375 11.625 1.662 11.625 3V9C11.625 10.338 10.701 11.625 9.333 11.625H2.667C1.299 11.625 0.375 10.338 0.375 9V3C0.375 1.662 1.299 0.375 2.667 0.375H9.333ZM2.667 1.625C2.194 1.625 1.625 2.129 1.625 3V9C1.625 9.871 2.194 10.375 2.667 10.375H9.333C9.806 10.375 10.375 9.871 10.375 9V3C10.375 2.129 9.806 1.625 9.333 1.625H2.667ZM7.375 3A0.625 0.625 0 0 1 7.375 4.25H4.625A0.625 0.625 0 0 1 4.625 3H7.375Z",fill:"currentColor"});case"padding-top":return Xe("path",{d:"M9.333 1.375C10.701 1.375 11.625 2.662 11.625 4V10A0.625 0.625 0 0 1 10.375 10V4C10.375 3.129 9.806 2.625 9.333 2.625H2.667C2.194 2.625 1.625 3.129 1.625 4V10A0.625 0.625 0 0 1 0.375 10V4C0.375 2.662 1.299 1.375 2.667 1.375H9.333ZM7.375 5A0.625 0.625 0 0 1 7.375 6.25H4.625A0.625 0.625 0 0 1 4.625 5H7.375Z",fill:"currentColor"});case"padding-x":return Xe("path",{d:"M2.75 0.375C3.095 0.375 3.375 0.655 3.375 1S3.095 1.625 2.75 1.625C2.344 1.625 2.073 1.759 1.904 1.929C1.733 2.101 1.625 2.354 1.625 2.667V9.333C1.625 9.646 1.733 9.899 1.904 10.071C2.073 10.241 2.344 10.375 2.75 10.375C3.095 10.375 3.375 10.655 3.375 11S3.095 11.625 2.75 11.625C2.052 11.625 1.448 11.386 1.018 10.952C0.59 10.522 0.375 9.941 0.375 9.333V2.667C0.375 2.059 0.59 1.478 1.018 1.048C1.448 0.614 2.052 0.375 2.75 0.375ZM9.25 0.375C9.948 0.375 10.552 0.614 10.982 1.048C11.41 1.478 11.625 2.059 11.625 2.667V9.333C11.625 9.941 11.41 10.522 10.982 10.952C10.552 11.386 9.948 11.625 9.25 11.625C8.905 11.625 8.625 11.345 8.625 11S8.905 10.375 9.25 10.375C9.656 10.375 9.927 10.241 10.096 10.071C10.267 9.899 10.375 9.646 10.375 9.333V2.667C10.375 2.354 10.267 2.101 10.096 1.929C9.927 1.759 9.656 1.625 9.25 1.625C8.905 1.625 8.625 1.345 8.625 1S8.905 0.375 9.25 0.375ZM8.079 5.25C8.424 5.25 8.704 5.53 8.704 5.875S8.424 6.5 8.079 6.5H3.921C3.576 6.5 3.296 6.22 3.296 5.875S3.576 5.25 3.921 5.25H8.079Z",fill:"currentColor"});case"padding-y":return Xe("path",{d:"M11.625 2.75C11.625 3.095 11.346 3.375 11 3.375S10.375 3.095 10.375 2.75C10.375 2.344 10.241 2.073 10.072 1.904C9.899 1.733 9.646 1.625 9.333 1.625H2.667C2.355 1.625 2.102 1.733 1.929 1.904C1.759 2.073 1.625 2.344 1.625 2.75C1.625 3.095 1.346 3.375 1 3.375S0.375 3.095 0.375 2.75C0.375 2.052 0.615 1.448 1.048 1.018C1.479 0.59 2.06 0.375 2.667 0.375H9.333C9.941 0.375 10.522 0.59 10.953 1.018C11.386 1.448 11.625 2.052 11.625 2.75ZM11.625 9.25C11.625 9.948 11.386 10.552 10.953 10.982C10.522 11.41 9.941 11.625 9.333 11.625H2.667C2.06 11.625 1.479 11.41 1.048 10.982C0.615 10.552 0.375 9.948 0.375 9.25C0.375 8.905 0.655 8.625 1 8.625S1.625 8.905 1.625 9.25C1.625 9.656 1.759 9.927 1.929 10.096C2.102 10.267 2.355 10.375 2.667 10.375H9.333C9.646 10.375 9.899 10.267 10.072 10.096C10.241 9.927 10.375 9.656 10.375 9.25C10.375 8.905 10.655 8.625 11 8.625S11.625 8.905 11.625 9.25ZM6.75 8.079C6.75 8.424 6.471 8.704 6.125 8.704S5.5 8.424 5.5 8.079V3.921C5.5 3.576 5.78 3.296 6.125 3.296S6.75 3.576 6.75 3.921V8.079Z",fill:"currentColor"});case"margin":return Xe("path",{d:"M9.333 4.525C10.701 4.525 11.625 5.812 11.625 7.15V8.15C11.625 9.488 10.701 10.775 9.333 10.775H2.667C1.299 10.775 0.375 9.488 0.375 8.15V7.15C0.375 5.812 1.299 4.525 2.667 4.525H9.333ZM2.667 5.775C2.194 5.775 1.625 6.279 1.625 7.15V8.15C1.625 9.021 2.194 9.525 2.667 9.525H9.333C9.806 9.525 10.375 9.021 10.375 8.15V7.15C10.375 6.279 9.806 5.775 9.333 5.775H2.667ZM8.375 1.2A0.625 0.625 0 0 1 8.375 2.45H3.625A0.625 0.625 0 0 1 3.625 1.2H8.375Z",fill:"currentColor"});case"margin-top":return Xe("path",{d:"M9.333 4.575C10.701 4.575 11.625 5.862 11.625 7.2V10.2A0.625 0.625 0 0 1 10.375 10.2V7.2C10.375 6.329 9.806 5.825 9.333 5.825H2.667C2.194 5.825 1.625 6.329 1.625 7.2V10.2A0.625 0.625 0 0 1 0.375 10.2V7.2C0.375 5.862 1.299 4.575 2.667 4.575H9.333ZM8.375 1.25A0.625 0.625 0 0 1 8.375 2.5H3.625A0.625 0.625 0 0 1 3.625 1.25H8.375Z",fill:"currentColor"});case"margin-x":return Xe("path",{d:"M11.277 2.902C11.622 2.902 11.902 3.182 11.902 3.527V8.277C11.902 8.622 11.622 8.902 11.277 8.902S10.652 8.622 10.652 8.277V3.527C10.652 3.182 10.931 2.902 11.277 2.902ZM0.724 2.901C1.069 2.901 1.349 3.181 1.349 3.526V8.276C1.349 8.621 1.069 8.901 0.724 8.901S0.099 8.621 0.099 8.276V3.527C0.099 3.182 0.379 2.901 0.724 2.901ZM7.333 3.325C8.643 3.325 9.543 4.506 9.617 5.781C9.62 5.805 9.625 5.829 9.625 5.853L9.622 5.901L9.625 5.95C9.625 5.974 9.62 5.998 9.617 6.021C9.544 7.297 8.643 8.478 7.333 8.478H4.667C3.357 8.478 2.456 7.297 2.382 6.021C2.379 5.998 2.375 5.974 2.375 5.95L2.377 5.901L2.375 5.853C2.375 5.829 2.379 5.805 2.382 5.781C2.456 4.506 3.358 3.325 4.667 3.325H7.333ZM4.667 4.575C4.203 4.575 3.647 5.06 3.626 5.901C3.647 6.742 4.203 7.228 4.667 7.228H7.333C7.798 7.228 8.352 6.742 8.372 5.901C8.351 5.06 7.798 4.575 7.333 4.575H4.667Z",fill:"currentColor"});case"margin-y":return Xe("path",{d:"M8.375 10.001C8.72 10.001 9 10.281 9 10.626S8.72 11.251 8.375 11.251H3.625C3.28 11.251 3 10.971 3 10.626S3.28 10.001 3.625 10.001H8.375ZM9.333 3.325C10.642 3.325 11.543 4.506 11.617 5.781C11.62 5.805 11.625 5.829 11.625 5.853L11.622 5.901L11.625 5.95C11.625 5.974 11.619 5.998 11.617 6.021C11.543 7.297 10.643 8.478 9.333 8.478H2.667C1.357 8.478 0.455 7.297 0.381 6.021C0.379 5.998 0.375 5.974 0.375 5.95L0.377 5.901L0.375 5.853C0.375 5.829 0.379 5.805 0.381 5.781C0.456 4.506 1.357 3.325 2.667 3.325H9.333ZM2.667 4.575C2.202 4.575 1.648 5.061 1.627 5.901C1.647 6.742 2.202 7.228 2.667 7.228H9.333C9.797 7.228 10.352 6.742 10.373 5.901C10.352 5.06 9.797 4.575 9.333 4.575H2.667ZM8.376 0.751C8.721 0.751 9.001 1.031 9.001 1.376S8.72 2.001 8.376 2.001H3.626C3.28 2.001 3.001 1.72 3.001 1.375S3.281 0.751 3.626 0.751H8.376Z",fill:"currentColor"});case"border":return Xe(Ge,{children:Xe("path",{d:"M4 1.25H8M4 10.75H8M1.25 8V4M10.75 8V4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});case"radius":return Xe(Ge,{children:Xe("path",{d:"M3.25 1.25C2.145 1.25 1.25 2.145 1.25 3.25M10.75 3.25C10.75 2.145 9.855 1.25 8.75 1.25M3.25 10.75C2.145 10.75 1.25 9.855 1.25 8.75M10.75 8.75C10.75 9.855 9.855 10.75 8.75 10.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})});case"gap-x":return Ke(Ge,{children:[Xe("path",{d:"M6.625 9.375A0.625 0.625 0 0 1 5.375 9.375V2.625A0.625 0.625 0 0 1 6.625 2.625V9.375Z",fill:"currentColor"}),Xe("circle",{cx:"1.252",cy:"1.248",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"10.748",cy:"1.248",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"1.252",cy:"6",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"10.748",cy:"6",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"1.252",cy:"10.752",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"10.748",cy:"10.752",r:"0.748",fill:"currentColor"})]});case"gap-y":return Ke(Ge,{children:[Xe("path",{d:"M9.375 5.375A0.625 0.625 0 0 1 9.375 6.625H2.625A0.625 0.625 0 0 1 2.625 5.375H9.375Z",fill:"currentColor"}),Xe("circle",{cx:"1.248",cy:"10.748",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"1.248",cy:"1.252",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"6",cy:"10.748",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"6",cy:"1.252",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"10.752",cy:"10.748",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"10.752",cy:"1.252",r:"0.748",fill:"currentColor"})]});case"border-top":return Ke(Ge,{children:[Xe("path",{d:"M3.25 0.5A0.75 0.75 0 0 1 3.25 2C2.56 2 2 2.56 2 3.25V8.75C2 9.44 2.56 10 3.25 10A0.75 0.75 0 0 1 3.25 11.5C1.731 11.5 0.5 10.269 0.5 8.75V3.25C0.5 1.731 1.731 0.5 3.25 0.5Z",fill:"currentColor"}),Xe("circle",{cx:"10.748",cy:"10.752",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"6.625",cy:"10.752",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"10.748",cy:"6",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"10.748",cy:"1.248",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"6.625",cy:"1.248",r:"0.748",fill:"currentColor"})]});case"radius-top-right":return Ke(Ge,{children:[Xe("path",{d:"M8.25 1.25H8.75A2 2 0 0 1 10.75 3.25V3.75",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"}),Xe("circle",{cx:"9.748",cy:"9.748",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"2.248",cy:"9.748",r:"0.748",fill:"currentColor"}),Xe("circle",{cx:"2.248",cy:"2.248",r:"0.748",fill:"currentColor"})]});case"stack-vertical":case"stack-horizontal":return Xe("path",{d:"M9.333 0.375C10.701 0.375 11.625 1.662 11.625 3V9C11.625 10.338 10.701 11.625 9.333 11.625H2.667C1.299 11.625 0.375 10.338 0.375 9V3C0.375 1.662 1.299 0.375 2.667 0.375H9.333ZM1.625 6.625V9C1.625 9.871 2.194 10.375 2.667 10.375H9.333C9.806 10.375 10.375 9.871 10.375 9V6.625H1.625ZM2.667 1.625C2.194 1.625 1.625 2.129 1.625 3V5.375H10.375V3C10.375 2.129 9.806 1.625 9.333 1.625H2.667Z",fill:"currentColor"});case"align":return Ke(Ge,{children:[Xe("path",{d:"M1 2H11M2.5 5.25H9.5M4 8.5H8",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),Xe("path",{d:"M6 0.75V10.75",stroke:"currentColor",strokeWidth:"0.75",strokeDasharray:"1 2"})]});case"justify":return Ke(Ge,{children:[Xe("path",{d:"M1 1.5V10.5M11 1.5V10.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),Xe("path",{d:"M3 3H9M3 6H9M3 9H9",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"})]});case"grid":return Xe("path",{d:"M9.333 0.375C10.701 0.375 11.625 1.662 11.625 3V9C11.625 10.338 10.701 11.625 9.333 11.625H2.667C1.299 11.625 0.375 10.338 0.375 9V3C0.375 1.662 1.299 0.375 2.667 0.375H9.333ZM6.625 10.375H9.333C9.806 10.375 10.375 9.871 10.375 9V6.625H6.625V10.375ZM1.625 9C1.625 9.871 2.194 10.375 2.667 10.375H5.375V6.625H1.625V9ZM6.625 5.375H10.375V3C10.375 2.129 9.806 1.625 9.333 1.625H6.625V5.375ZM2.667 1.625C2.194 1.625 1.625 2.129 1.625 3V5.375H5.375V1.625H2.667Z",fill:"currentColor"});case"grid-rows":return Xe("path",{d:"M4.512 0.385C5.781 0.491 6.625 1.721 6.625 3V9C6.625 10.279 5.78 11.508 4.511 11.614C4.477 11.62 4.443 11.625 4.408 11.625H2.666C1.299 11.625 0.375 10.338 0.375 9V3C0.375 1.662 1.299 0.375 2.667 0.375H4.409C4.444 0.375 4.478 0.379 4.512 0.385ZM10.748 10.004C11.161 10.004 11.497 10.339 11.497 10.752C11.497 11.165 11.161 11.5 10.748 11.5C10.335 11.5 10 11.165 10 10.752C10 10.339 10.335 10.004 10.748 10.004ZM1.625 9C1.625 9.871 2.193 10.375 2.666 10.375H4.333C4.806 10.375 5.375 9.871 5.375 9V6.625H1.625V9ZM10.748 5.252C11.161 5.252 11.497 5.587 11.497 6C11.497 6.413 11.161 6.748 10.748 6.748C10.335 6.748 10 6.413 10 6C10 5.587 10.335 5.252 10.748 5.252ZM2.667 1.625C2.194 1.625 1.625 2.129 1.625 3V5.375H5.375V3C5.375 2.129 4.806 1.625 4.333 1.625H2.667ZM10.748 0.5C11.161 0.5 11.497 0.835 11.497 1.248C11.497 1.661 11.161 1.997 10.748 1.997C10.335 1.997 10 1.661 10 1.248C10 0.835 10.335 0.5 10.748 0.5Z",fill:"currentColor"});case"grid-columns":return Xe("path",{d:"M0.321 7.424C0.427 6.155 1.657 5.311 2.936 5.311H8.936C10.215 5.311 11.444 6.156 11.55 7.425C11.556 7.458 11.561 7.493 11.561 7.528V9.27C11.56 10.637 10.274 11.561 8.936 11.561H2.936C1.598 11.561 0.311 10.636 0.311 9.269V7.527C0.311 7.492 0.315 7.458 0.321 7.424ZM9.94 1.188C9.94 0.775 10.275 0.439 10.688 0.439C11.101 0.439 11.437 0.774 11.437 1.188C11.437 1.601 11.101 1.936 10.688 1.936C10.275 1.936 9.94 1.601 9.94 1.188ZM8.936 10.311C9.806 10.311 10.31 9.743 10.311 9.27V7.603C10.311 7.129 9.807 6.561 8.936 6.561H6.561V10.311H8.936ZM5.188 1.188C5.188 0.775 5.523 0.439 5.936 0.439C6.349 0.439 6.685 0.774 6.685 1.188C6.685 1.601 6.349 1.936 5.936 1.936C5.523 1.936 5.188 1.601 5.188 1.188ZM1.561 9.269C1.561 9.742 2.065 10.311 2.936 10.311H5.311V6.561H2.936C2.065 6.561 1.561 7.129 1.561 7.603V9.269ZM0.436 1.188C0.436 0.774 0.772 0.439 1.185 0.439C1.598 0.439 1.933 0.775 1.933 1.188C1.933 1.601 1.598 1.936 1.185 1.936C0.772 1.936 0.436 1.601 0.436 1.188Z",fill:"currentColor"})}}function Fn({family:e,size:t=12,step:n,subproperty:r="all"}){let o=function(e,t="all"){return Ie(e,t)?{name:"palette",rotation:0}:"stack"===e?"horizontal"===t?{name:"stack-horizontal",rotation:90}:"align"===t?{name:"align",rotation:0}:"justify"===t?{name:"justify",rotation:0}:{name:"stack-vertical",rotation:0}:"grid"===e?{name:"rows"===t?"grid-rows":"columns"===t?"grid-columns":"grid",rotation:90}:"text"===e?{name:"weight"===t?"text-weight":"line-height"===t?"text-leading":"letter-spacing"===t?"text-tracking":"text-align"===t?"text-align":"text-size",rotation:0}:"transform"===e?{name:"scale"===t?"transform-scale":"rotate"===t?"transform-rotate":"transform-translate",rotation:0}:"opacity"===e?{name:"mix-blend"===t?"mix-blend":"opacity",rotation:0}:"all"===t?{name:Bn[e],rotation:0}:"radius"===e?{name:"radius-top-right",rotation:Wn[t]??0}:{name:"padding"===e?"x"===t?"padding-x":"y"===t?"padding-y":"padding-top":"margin"===e?"x"===t?"margin-x":"y"===t?"margin-y":"margin-top":"border-top",rotation:("border"===e?90:0)+(Ln[t]??0)}}(e,r),i="text-size"===o.name?V:"text-weight"===o.name?B:"text-leading"===o.name?L:"text-tracking"===o.name?W:"text-align"===o.name?Z:"palette"===o.name?F:"transform-translate"===o.name?D:"transform-scale"===o.name?O:"transform-rotate"===o.name?_:"opacity"===o.name?q:"mix-blend"===o.name?Y:null;return i?Xe(i,{"aria-hidden":"true","data-popmelt-sticker-icon":`${e}-${r}`,width:t,height:t,strokeWidth:2.5,style:{display:"block",transform:o.rotation?`rotate(${o.rotation}deg)`:void 0,transition:"width 250ms ease, height 250ms ease"}}):Xe("svg",{"aria-hidden":"true","data-popmelt-sticker-icon":`${e}-${r}`,viewBox:"0 0 12 12",fill:"none",style:{width:t,height:t,display:"block",transform:o.rotation?`rotate(${o.rotation}deg)`:void 0,transition:"width 250ms ease, height 250ms ease"},children:Xe(Zn,{name:o.name})})}function Dn(e,t){let n=(Ee.indexOf(e)+t%Ee.length+Ee.length)%Ee.length;return Ee[n]}function On(e,t){let n=Ee.indexOf(e),r=(Ee.indexOf(t)-n+Ee.length)%Ee.length;return r<=Ee.length/2?r:r-Ee.length}function _n(e,t,n,r="all"){let o=Ae(e,r),i=(o.indexOf(t)+n%o.length+o.length)%o.length;return o[i]}function qn(e,t,n,r="all"){let o=Ae(e,r),i=o.indexOf(t),a=(o.indexOf(n)-i+o.length)%o.length;return a<=o.length/2?a:a-o.length}function Yn({offset:e,colors:t,renderItem:n,showControl:r=!0,activeColor:o,snapActiveColor:i=!1}){let a=[e-2,e-1,e,e+1,e+2];return Ke("div",{style:{position:"relative",width:96,height:32,overflow:"hidden"},children:[r&&Xe("span",{"aria-hidden":"true",style:{position:"absolute",left:jn,top:0,width:jn,height:jn,borderRadius:16,background:t.control}}),Xe("div",{"data-popmelt-sticker-rail":!0,style:{position:"absolute",inset:0,transform:`translateX(${-e*jn}px)`,transition:"transform 250ms ease",willChange:"transform"},children:a.map(r=>{let a=r===e;return Xe("span",{style:{position:"absolute",left:jn+r*jn,top:0,width:jn,height:jn,display:"flex",alignItems:"center",justifyContent:"center",color:a?o??t.primary:t.mutedStrong,transition:i?"none":`color 400ms ${Pn}`},children:n(r,a)},r)})})]})}function Jn({family:e,colors:t,showControl:n=!0,activeColor:r,snapActiveColor:o}){let i=_e(e),a=_e(e),[l,s]=Fe(0);return qe(()=>{if(a.current===e)return;let t=On(a.current,e);a.current=e,s(e=>e+t)},[e]),Xe(Yn,{offset:l,colors:t,showControl:n,activeColor:r,snapActiveColor:o,renderItem:(e,t)=>{let n=Dn(i.current,e);return Xe(Fn,{family:n,subproperty:"all",size:t?14:12})}})}function Kn({color:e,colors:t,showControl:n=!0}){let r=_e(e),o=_e(e),[i,a]=Fe(0);return qe(()=>{if(o.current===e)return;let t=Se(o.current,e);o.current=e,a(e=>e+t)},[e]),Xe(Yn,{offset:i,colors:t,showControl:n,renderItem:(e,t)=>{let n=Me(r.current,e),o=t?14:12;return Xe("span",{"aria-label":n,"data-popmelt-sticker-color":n,style:{width:o,height:o,borderRadius:"50%",background:ge(n,ye),boxShadow:"inset 0 0 0 1px rgb(0 0 0 / 0.08)",transition:"width 250ms ease, height 250ms ease"}})}})}function Xn({name:e,size:t}){let n="align-start"===e?G:"align-center"===e?Q:"align-end"===e?U:"align-stretch"===e?ee:"justify-start"===e?te:"justify-center"===e?ne:"justify-end"===e?re:"justify-between"===e?oe:"justify-around"===e?ie:"text-align-left"===e?Z:"text-align-center"===e?ae:"text-align-right"===e?le:"text-align-justify"===e?se:null;return n?Xe(n,{"aria-hidden":"true","data-popmelt-sticker-step-icon":e,width:t,height:t,strokeWidth:2.25,style:{display:"block"}}):Xe("svg",{"aria-hidden":"true","data-popmelt-sticker-step-icon":e,width:t,height:t,viewBox:"0 0 14 14",fill:"none",style:{display:"block"},children:Ke(Ge,"align-baseline"===e?{children:[Xe("path",{d:"M1.5 10.5H12.5",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),Xe("path",{d:"M3 8V4.75M3 4.75H6.5M6.5 4.75V8M8.5 8V6M8.5 6H11M11 6V8",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round",strokeLinejoin:"round"})]}:{children:[Xe("path",{d:"M1.5 2V12M12.5 2V12",stroke:"currentColor",strokeWidth:"1.25",strokeLinecap:"round"}),Xe("rect",{x:"3.25",y:"4.75",width:"2",height:"4.5",rx:"1",fill:"currentColor"}),Xe("rect",{x:"8.75",y:"4.75",width:"2",height:"4.5",rx:"1",fill:"currentColor"}),Xe("circle",{cx:"7",cy:"7",r:"0.75",fill:"currentColor"})]})})}function Gn({family:e,step:t,subproperty:n,colors:r,showControl:o=!0,unavailable:i=!1,activeColor:a,snapActiveColor:l=!1}){let s=_e(t),d=_e(t),[c,u]=Fe(0);return De(()=>{if(d.current===t)return;let r=qn(e,d.current,t,n);d.current=t,u(e=>e+r)},[e,t,n]),Xe(Yn,{offset:c,colors:r,showControl:o,activeColor:a??(i?r.muted:r.primary),snapActiveColor:l,renderItem:(t,r)=>{let o=_n(e,s.current,t,n),a=function(e,t,n){if("stack"===e&&"align"===t){if("start"===n)return"align-start";if("center"===n)return"align-center";if("end"===n)return"align-end";if("stretch"===n)return"align-stretch";if("baseline"===n)return"align-baseline"}if("stack"===e&&"justify"===t){if("start"===n)return"justify-start";if("center"===n)return"justify-center";if("end"===n)return"justify-end";if("between"===n)return"justify-between";if("around"===n)return"justify-around";if("evenly"===n)return"justify-evenly"}if("text"===e&&"text-align"===t){if("left"===n)return"text-align-left";if("center"===n)return"text-align-center";if("right"===n)return"text-align-right";if("justify"===n)return"text-align-justify"}return null}(e,n,o);return Xe("span",{"data-popmelt-sticker-step-unavailable":r&&i?"true":void 0,style:{alignItems:"center",display:"flex",fontSize:r?14:12,justifyContent:"center",transition:"font-size 250ms ease"},children:a?Xe(Xn,{name:a,size:r?14:12}):$e(o,e,n)})}})}function Qn(e){return"family"===e?0:35}function Un(e){return"family"===e?jn/Tn:1}function er(e){return"family"===e?14/(12*Un(e)):1}function tr(e,t,n){return`${e}:${t}:${n}`}function nr(e,t,n){return!!xe(n)&&("color"===e?"family"!==t:("text"===e||"border"===e)&&"value"===t)}function rr({family:e,step:t,subproperty:n,stage:r,accentColor:o,applyPulse:i=0,snapPulse:a=0,stepUnavailable:l=!1,colors:s}){let d=function(e,t="padding",n="all"){return Ie(t,n)?"family"===e?{family:0,variant:-jn,value:-64}:"variant"===e?{family:jn,variant:0,value:-jn}:{family:64,variant:jn,value:0}:"family"===e?{family:0,variant:-64,value:-jn}:{family:jn,variant:-jn,value:0}}(r,e,n),c=_e(r),u=_e(i),p=_e(a),[h,m]=Fe(!1),f=p.current!==a;qe(()=>{p.current=a},[a]),qe(()=>{let e=c.current!==r&&"family"!==r,t="value"===r&&u.current!==i;if(c.current=r,u.current=i,!e&&!t)return;m(!0);let n=window.requestAnimationFrame(()=>m(!1));return()=>window.cancelAnimationFrame(n)},[i,r]);let g=e=>({position:"absolute",left:0,right:0,top:4,height:jn,transform:`translateY(${e}px)`,transition:f?"none":"transform 250ms ease",willChange:"transform"});return Ke("div",{"data-popmelt-sticker-depth-rail":r,style:{position:"relative",width:96,height:40,marginBlock:-4,overflow:"hidden",zIndex:2},children:[Xe("span",{"aria-hidden":"true","data-popmelt-sticker-depth-control":!0,style:{position:"absolute",left:jn,top:4,width:jn,height:jn,borderRadius:16,background:h?o:s.control,transition:h?"none":`background 400ms ${Pn}`}}),Xe("div",{"aria-hidden":"family"!==r,"data-popmelt-sticker-depth-row":"family",style:g(d.family),children:Xe(Jn,{family:e,colors:s,showControl:!1,activeColor:h?s.surface:s.primary,snapActiveColor:h})}),Xe("div",{"aria-hidden":"variant"!==r,"data-popmelt-sticker-depth-row":"variant",style:g(d.variant),children:Ie(e,n)&&xe(n)&&Xe(Kn,{color:n,colors:s,showControl:!1})}),Xe("div",{"aria-hidden":"value"!==r,"data-popmelt-sticker-depth-row":"value",style:g(d.value),children:Xe(Gn,{family:e,step:t,subproperty:n,colors:s,showControl:!1,unavailable:l,activeColor:h?s.surface:void 0,snapActiveColor:h},tr(r,e,n))})]})}function or(e,t,n=42,r=An){let o=e.x+10,i=e.y+10;return{left:Math.min(Math.max(8,o),Math.max(8,t.width-r-8)),top:Math.min(Math.max(8,i),Math.max(8,t.height-n-8))}}function ir(e,t,n){return n?0:Math.min(e,t)}function ar({cursor:e,family:t,step:n,subproperty:r,stage:i,accentColor:a,applyPulse:l=0,contextLabelPulse:s=0,depthSnapPulse:d=0,rejectPulse:c=0,stepUnavailable:u=!1,query:p=null,toolbarElement:h,controlBounds:m,threadElement:f,annotationRailHovered:g=!1}){let[y]=Re(),x=je[y],v=`color-mix(in srgb, ${x.actionForeground} 16%, ${x.actionSurface})`,C=me(t,r),w=_e(t),b=_e(i),k=_e(r),I=_e(i),S=_e(l),M=_e(s),$=_e(c),E=_e(null),A=_e(!1),T=_e(!1),R=_e(0),j=_e(0),P=_e(0),z=_e(0),[N,V]=Fe(null),[B,L]=Fe(!1),[W,Z]=Fe(!1),[F,D]=Fe(!1),[O,_]=Fe(null),[q,Y]=Fe(!1),[J,K]=Fe(0),[X,G]=Fe(!1),[Q,U]=Fe(!1);qe(()=>{if($.current===c)return;$.current=c,U(!1);let e=window.requestAnimationFrame(()=>U(!0)),t=window.setTimeout(()=>U(!1),240);return()=>{window.cancelAnimationFrame(e),window.clearTimeout(t)}},[c]),qe(()=>{let e=I.current!==i&&"family"!==i,t="value"===i&&S.current!==l;if(I.current=i,S.current=l,!e&&!t)return;G(!0);let n=window.requestAnimationFrame(()=>G(!1));return()=>window.cancelAnimationFrame(n)},[l,i]),qe(()=>{let e="family"!==b.current&&"family"===i;b.current=i;let n=(e=!1)=>{R.current&&window.cancelAnimationFrame(R.current),e||window.clearTimeout(j.current),window.clearTimeout(P.current),window.clearTimeout(z.current),R.current=0,e||(j.current=0),P.current=0,z.current=0},r=e=>{P.current=window.setTimeout(()=>{Z(e),T.current=!1,L(!1)},750),z.current=window.setTimeout(()=>{A.current=!1,V(null)},984)};if("family"!==i){if(n(),w.current=t,!A.current)return;return Z(!0),T.current=!1,L(!1),void(z.current=window.setTimeout(()=>{A.current=!1,V(null)},Rn))}if(w.current!==t||e){if(w.current=t,A.current=!0,V(t),e)return n(),Z(!1),D(!0),T.current=!0,L(!0),j.current=window.setTimeout(()=>{j.current=0,D(!1)},Rn),void r(!1);j.current||(n(!0),D(!1),Z(!1),T.current||(T.current=!0,L(!0)),r(!1))}},[t,i]),De(()=>()=>{window.cancelAnimationFrame(R.current),window.clearTimeout(j.current),window.clearTimeout(P.current),window.clearTimeout(z.current)},[]),De(()=>{let e=M.current!==s;if(M.current=s,!function(e,t,n="all"){return"value"===t||Ie(e,n)&&"variant"===t}(t,i,r))return _(null),Y(!1),void(k.current=r);if(w.current!==t)return k.current=r,_(null),void Y(!1);if(k.current===r&&!e)return;k.current=r,Y(e),_(e?function(e,t){let n=ve(e),r=fe(e,t);return r===n?n:`${n} ${r}`}(t,r):fe(t,r));let n=window.setTimeout(()=>{_(null),Y(!1)},750);return()=>window.clearTimeout(n)},[s,t,i,r]),qe(()=>{O&&E.current?K(E.current.scrollWidth):K(0)},[O]);let ee=function(e,t=7.5){return null===e?Tn:Math.max(39,18+2*t+Math.ceil(e))}(O?J:null,q?10:7.5),te=q?10:7.5,ne=O?0:140,re=p||"family"!==i||N?68:Hn,oe=Ze(()=>or(e,m?.viewport??{width:typeof window>"u"?An:window.innerWidth,height:typeof window>"u"?Hn:window.innerHeight},re),[re,e,m?.viewport]),ie=h?Nn(oe,h.getBoundingClientRect(),re):1,ae=f?Vn(e,oe,f.getBoundingClientRect(),re):1,le=m?.compact?function(e,t,n,r,o){let i,a=8,l=o-r-8,s=1;for(let d of n){let n=Math.max(d.left-e.x,e.x-d.right,0),c=Math.max(d.top-e.y,e.y-d.bottom,0);if(s=Math.min(s,Math.hypot(n,c)/12),t.left+An<=d.left||t.left>=d.right)continue;let u=(d.top+d.bottom)/2<o/2,p=u?d.bottom+1:d.top-1-r;u?a=Math.max(a,p):l=Math.min(l,p);let h=u?t.top<=p:t.top>=p,m=u?e.y-d.bottom:d.top-e.y;if(!h||m<0)continue;let f=Math.max(n/12,Math.max(0,m-1)/r);f<s&&(s=f,i=u?0:r)}let d=Math.max(a,Math.min(t.top,l));return{top:d,scale:s,originY:i??Math.min(r,Math.max(0,e.y-d))}}(e,oe,m.bounds,re,m.viewport?.height??window.innerHeight):void 0,se=le?.scale??m?.bounds.reduce((t,n)=>Math.min(t,Vn(e,oe,n,re,40)),1)??1,de=ir(Math.min(ie,se),ae,g),ce=le?.top??oe.top,ue={position:"fixed",left:oe.left,top:ce,width:An,height:Hn,display:"flex",alignItems:"center",justifyContent:"center",gap:1,boxSizing:"border-box",padding:4,border:`1px solid ${x.border}`,borderRadius:22,background:x.surface,color:x.primary,fontFamily:H,fontSize:12,fontWeight:600,lineHeight:1,pointerEvents:"none",overflow:"visible",opacity:de,transform:`scale(${de})`,transformOrigin:`${e.x-oe.left}px ${le?.originY??e.y-ce}px`,visibility:0===de?"hidden":"visible",animation:Q?"popmeltStickerReject 220ms ease-out":void 0,zIndex:2147483647,colorScheme:y},pe=p?function(e){return[...e.tokens.map(e=>e.label),`${e.typed}${e.completion||e.fallback}`].filter(Boolean).join(" ")}(p):"";return Ke("div",{role:"status","aria-label":p?`Sticker search: ${pe||"search tokens"}`:`Sticker ${i}: ${"family"===i?t:"variant"===i?C:`${n} ${C}`}`,"data-devtools":"sticker-hud","data-popmelt-sticker-hud":!0,"aria-hidden":g||void 0,style:ue,children:[Xe("style",{children:`@keyframes popmeltStickerReject {\n ${o}\n }\n @keyframes popmeltStickerFamilyLabelEnter {\n from {\n opacity: 0;\n transform: translate(-50%, 10px) scale(0.9);\n }\n to {\n opacity: 1;\n transform: translate(-50%, 0) scale(1);\n }\n }\n @keyframes popmeltStickerQueryCaret {\n 0%, 45% { opacity: 1; }\n 55%, 100% { opacity: 0; }\n }`}),Xe("span",{"aria-hidden":"true","data-popmelt-sticker-wheel-shell":!0,style:{position:"absolute",inset:1,borderRadius:21,background:x.surface,zIndex:1}}),Xe(rr,{family:t,step:n,subproperty:r,stage:i,accentColor:a,applyPulse:l,snapPulse:d,stepUnavailable:u,colors:x}),!p&&Ke("span",{"aria-hidden":"true","data-popmelt-sticker-token-context":!0,"data-popmelt-sticker-token-context-stage":i,"data-popmelt-sticker-token-context-expanded":O?"true":"false",style:{position:"absolute",left:(An-ee)/2,top:9,width:ee,height:Tn,display:"flex",alignItems:"center",justifyContent:"center",gap:O?4:0,padding:O?`0 ${te}px`:0,boxSizing:"border-box",border:`1px solid ${v}`,borderRadius:12,background:x.actionSurface,color:x.actionForeground,transform:`translateY(${Qn(i)}px) scale(${Un(i)})`,transition:`left ${ne}ms ease-out, width ${ne}ms ease-out, gap ${ne}ms ease-out, padding ${ne}ms ease-out, transform 250ms ease`,transformOrigin:"center",willChange:"left, width, transform",overflow:"hidden",zIndex:0},children:[Xe("span",{style:{display:"block",transform:`scale(${er(i)})`,transition:"transform 250ms ease",transformOrigin:"center"},children:nr(t,i,r)?Xe("span",{"data-popmelt-sticker-color-context":r,style:{display:"block",width:12,height:12,borderRadius:"50%",background:ge(r,"value"===i?n:ye),boxShadow:"inset 0 0 0 1px rgb(255 255 255 / 0.16)"}}):Xe(Fn,{family:t,subproperty:"text"===t&&"variant"===i&&xe(r)?"color":r})}),Xe("span",{ref:E,"data-popmelt-sticker-subproperty-label":!0,style:{flexShrink:0,opacity:O&&J>0?1:0,color:x.actionForeground,fontSize:11,fontWeight:600,letterSpacing:.22,lineHeight:1,whiteSpace:"nowrap",transition:"opacity 120ms ease"},children:O})]}),p&&Xe(En,{query:p,border:v,background:x.actionSurface,foreground:x.actionForeground,renderIcon:e=>Xe(Fn,{family:e.family,subproperty:e.subproperty,size:12})}),Xe("span",{"aria-hidden":"true","data-popmelt-sticker-depth-burst":!0,style:{position:"absolute",left:37,top:5,width:jn,height:jn,overflow:"visible",pointerEvents:"none",zIndex:3},children:zn.map(e=>Xe("span",{style:{position:"absolute",left:"50%",top:"50%",width:4,height:1.5,borderRadius:1,background:a,opacity:X?1:0,transform:`translate(-50%, -50%) rotate(${e}deg) translateX(${X?17:30}px) scaleX(${X?.7:1})`,transformOrigin:"center",transition:X?"none":"transform 180ms cubic-bezier(0.16, 1, 0.3, 1), opacity 180ms ease-out",willChange:"transform, opacity"}},e))}),!p&&N&&Xe("span",{"data-popmelt-sticker-family-label":!0,style:{position:"absolute",left:"50%",top:44,height:Tn,display:"flex",alignItems:"center",justifyContent:"center",padding:"0 10px",boxSizing:"border-box",opacity:B?1:0,transform:`translate(-50%, ${W?-35:0}px) scale(${W?.9:1})`,transformOrigin:"center",transition:"transform 250ms ease, opacity 200ms ease",animation:B&&F?"popmeltStickerFamilyLabelEnter 250ms ease":void 0,border:`1px solid ${v}`,borderRadius:12,background:x.actionSurface,color:x.actionForeground,fontSize:11,fontWeight:600,letterSpacing:.22,lineHeight:1,whiteSpace:"nowrap",willChange:"transform, opacity",zIndex:0},children:ve(N)})]})}var lr=["reviewing","considering","thinking","zhuzhing","iterating","tweaking","reflecting","noodling","pondering","finessing","polishing","riffing"];function sr(e){if(e.subjectLabel)return`<${e.subjectLabel}>`;let t=e.dataAttributes?.["data-popmelt-label"]?.trim();if(t)return t;let n=e.tagName,r=e.id?`#${e.id}`:"",o=e.className?`.${e.className.split(" ").slice(0,2).join(".")}`:"";return e.reactComponent?`<${e.reactComponent}> ${n}${r}${o}`:`${n}${r}${o}`}var dr=["id","data-pm","data-popmelt-frame","data-testid","data-test","data-cy","data-popmelt-media-id","data-popmelt-see-id","data-popmelt-subject-key","aria-label","name","href"],cr=["style","class","open","hidden","aria-hidden","data-state"];function ur(e){let t=new Set(dr);for(let n of e){/\.[\w\\-]/.test(n)&&t.add("class");for(let e of n.matchAll(/\[\s*([\w:-]+)/g))t.add(e[1]);if(/:(checked|disabled|enabled|required|optional|read-only|read-write)\b/.test(n))for(let e of["checked","selected","disabled","required","readonly","contenteditable"])t.add(e)}return{attributes:[...new Set([...t,...cr])],changesIdentity:e=>"attributes"!==e.type||t.has(e.attributeName??"")}}var pr=12,hr=.24,mr=8;function fr(e){return{...l(),display:"flex",alignItems:"center",gap:4,backgroundColor:e,color:"#fff",fontSize:12,lineHeight:12*a+"px",fontFamily:i,letterSpacing:"0.24px",padding:"0 8px",borderRadius:8,whiteSpace:"nowrap",maxWidth:400}}var gr={overflow:"hidden",textOverflow:"ellipsis",flex:1,minWidth:0};function yr(e,t){return!(!t||e!==t&&!e.contains(t))}function xr(e){let t=new Set(["resolved","needs_review","waiting_input","failed"]);return!!("text"===e.type&&e.text&&e.linkedSelector&&e.status&&t.has(e.status)&&e.threadId)}function vr(e){let t=e.status??"pending",n=new Set(["pending","sending","in_flight","resolved","waiting_input","failed"]);return!!("text"===e.type&&e.text&&e.linkedSelector&&n.has(t))}function Cr(e){return e.isInFlight?"#888888":e.comment?!1===e.comment.pending?"#888888":e.threadAccentColor:e.isInFlight||e.hasThreadState||e.hasStickers?"#888888":e.accentColor}function wr(e,t){let n=e.get(t);return!!n&&(clearTimeout(n),e.delete(t),!0)}function br(e,t,n){return null!==e&&e.selector===t&&e.expandedIndices.includes(n)}function kr(e,t){return e?.selector===t?null:e}function Ir({selector:e,label:t,tokens:n}){return JSON.stringify([e,t,n])}function Sr({hasElementChanges:e=!1,hasPendingChanges:t,hasThreadState:n,isHovered:r,hasTimedReveal:o,isRevealedSticker:i}){let a=(e||t||n)&&!r;return{annotationCollapsed:a,stickerCollapsed:a&&!i,sendCompact:a&&!o}}function Mr({property:e}){let t,n=/^(padding|margin)(?:-(top|right|bottom|left))?$/.exec(e);n&&(t={family:n[1],subproperty:n[2]??"all"});let r=/^border-(top|right|bottom|left)-width$/.exec(e);r&&(t={family:"border",subproperty:r[1]});let o=/^border-(top-left|top-right|bottom-right|bottom-left)-radius$/.exec(e);o&&(t={family:"radius",subproperty:o[1]});let i={"border-width":["border","all"],"border-radius":["radius","all"],"font-size":["text","size"],"font-weight":["text","weight"],"line-height":["text","line-height"],"letter-spacing":["text","letter-spacing"],"text-align":["text","text-align"],"flex-direction":["stack","direction"],"align-items":["stack","align"],"justify-content":["stack","justify"],gap:["stack","gap"],"grid-template-columns":["grid","columns"],"grid-template-rows":["grid","rows"],translate:["transform","translate"],scale:["transform","scale"],rotate:["transform","rotate"],opacity:["opacity","opacity"],"mix-blend-mode":["opacity","mix-blend"]}[e];if(i&&(t={family:i[0],subproperty:i[1]}),t)return Xe(Fn,{...t});let a=/(^|-)color$|^(fill|stroke)$/.test(e)?F:/(^|-)(width|inline-size)$/.test(e)?J:/(^|-)(height|block-size)$/.test(e)?K:X;return Xe(a,{"aria-hidden":"true","data-popmelt-property-icon":e,size:12,strokeWidth:2.5,style:{display:"block"}})}function $r({chip:e}){return e.selection?Xe(Fn,{...e.selection}):Xe(Mr,{property:e.custom.property})}function Er(e){return e.comment?.threadState??e.threadState}function Ar(e){return sr(e.element)}function Hr(e,t,n){return function(e,t,n){if(void 0===n.avoidLeft&&void 0===n.avoidRight)return!0;let r=typeof window<"u"?window.innerWidth:9999,o=n.avoidLeft??0,i=n.avoidRight??r;return e+t>o&&e<i}(t,n,e)?e:{}}function Tr(e){let t=e.stickers.map(e=>e.token).join(""),n=e.comment?.text??e.label;return Math.min(720,44+7.2*n.length+7.2*t.length)}function Rr(e,t){return t||!1===e?.pending?0:e?.imageCount??0}function jr(e,t,n,r,o,i){return`translate(${"right"===n?`max(calc(-100% + ${r}px), calc(0px - max(0px, ${e}px)))`:`min(0px, calc(100vw - max(0px, ${e}px) - 100%))`}, min(max(0px, calc(${void 0!==o?`${o}px`:"0px"} - max(0px, ${t}px))), calc(${void 0!==i?`${i}px`:"100dvh"} - max(0px, ${t}px) - 100%)))`}function Pr({left:e,top:t,avoidTop:n,avoidBottom:r,anchor:o,horizontalAlignment:i="left",visualRef:a,style:l,children:s,...d}){let c=k(o),u=e-c.left,p=t-c.top;return Xe("div",{"data-devtools":"badge-hit-area",...d,style:{position:"fixed",left:`max(0px, ${u}px)`,top:`max(0px, ${p}px)`,padding:`${c.top}px ${c.right}px ${c.bottom}px ${c.left}px`,transform:jr(u,p,i,c.left+c.right,n,r),...l},children:Xe("div",{ref:a,children:s})})}function zr({targetDocument:e,subjectRegistry:t,projectedTargets:n,readOnly:r=!1,focusedSelector:o,threadAccessory:i,styleModifications:a,textModifications:l,stagedComments:w,accentColor:k,annotationNumberBySelector:I,inFlightSelectors:S,inFlightAnnotationIds:M,activeAnnotationIds:$,inFlightSelectorJobIds:A,waitingApprovalJobIds:H,inFlightSelectorColors:T,toolbarRef:V,onHoverSelector:B,sendHintSelector:L,pendingBundleCount:W=1,onHoverSendBundle:Z,onSend:F,onSelectSticker:D,onDeleteSticker:O,threadStates:_,onViewThread:q,hoveredElement:Y,hoveredElementInfo:J,showHoverIdentifier:K=!1,onEditComment:X,onDeleteComment:G,onDeletePeerComment:Q,onDeletePeerStyles:U,onDiscardTextChanges:ee,onArchiveThread:te,onClearInteractionEpisode:ne,onEditSubject:re,onDeleteSubject:oe,onHoverSubjectLabel:ie,activeCommentEntry:ae,refreshKey:le}){let se=Ye(s),ce=Ye(E),[ue,me]=Fe([]),[fe,ge]=Fe(null),[ye,xe]=Fe(null),[ve,Ie]=Fe(()=>new Map),Se=_e(new Map),Me=_e(new Map),$e=_e(new Map),Ee=_e(new Map),Ae=_e(new Map),Re=_e(new Map),je=Oe(e=>{wr(Ae.current,e)},[]),Ne=Oe(e=>{!function(e,t,n,r=1e3){wr(e,t),e.set(t,setTimeout(()=>{e.delete(t),n()},r))}(Ae.current,e,()=>{xe(t=>t===e?null:t),ge(t=>t?.selector===e?null:t)})},[]),Le=Oe((e,t,n)=>{ge(r=>function(e,t){return e&&e.selector===t.selector?t.index===e.index?e:{...t,expandedIndices:t.index>e.index?[...new Set([...e.expandedIndices,t.index])]:[...new Set([...e.expandedIndices.filter(e=>e<=t.index),t.index])]}:{...t,expandedIndices:[t.index]}}(r,{selector:e,target:t,index:n}))},[]),We=Oe(e=>!!S?.has(e.selector)||!!e.comment&&!!$?.has(e.comment.id),[$,S]),Ze=Oe((e,t)=>!We(e)&&(!!e.comment&&!!M?.has(e.comment.id)||"in_flight"===t?.status),[We,M]),Je=Oe(e=>{let t=mt(e.hasPendingChanges,Er(e),A?.get(e.selector));return function({isInFlight:e,isQueued:t=!1,threadStatus:n}){return e?"working":t||"in_flight"===n?"queued":"waiting_input"===n?"question":"failed"===n?"failed":"resolved"===n?"replied":"draft"}({isInFlight:We(e),isQueued:Ze(e,t),threadStatus:t?.status})},[We,Ze,A]),Qe=ue.filter(e=>e.hasPendingChanges||!!Er(e)).map(e=>Ir({selector:e.selector,label:e.label,tokens:[...e.stickers.map(e=>e.token),..."draft"===Je(e)?[]:[`status:${Je(e)}`]]})).join("|");qe(()=>{let e=new Set,t=new Map,n=new Set,r=new Set;for(let o of ue){let i=Er(o);if(!o.hasPendingChanges&&!i)continue;e.add(o.selector);let a=Je(o),l=Ir({selector:o.selector,label:o.label,tokens:[...o.stickers.map(e=>e.token),..."draft"===a?[]:[`status:${a}`]]});if(Se.current.get(o.selector)===l)continue;Se.current.set(o.selector,l);let s=$e.current.get(o.selector);$e.current.set(o.selector,a),"working"===a&&"working"!==s&&r.add(o.selector);let d=Me.current.get(o.selector),c=new Map,u=null;for(let e of o.stickers){let t=Ce(e);c.set(t,e.token),d?.get(t)!==e.token&&(u=t)}if(Me.current.set(o.selector,c),!o.hasPendingChanges&&(void 0===s||"draft"===s&&"queued"!==a&&"working"!==a)){let e=Ee.current.get(o.selector);e&&clearTimeout(e),Ee.current.delete(o.selector),n.add(o.selector);continue}t.set(o.selector,u);let p=Ee.current.get(o.selector);p&&clearTimeout(p),Ee.current.set(o.selector,setTimeout(()=>{Ie(e=>{if(!e.has(o.selector))return e;let t=new Map(e);return t.delete(o.selector),t}),Ee.current.delete(o.selector)},1e3))}for(let[t,n]of Ee.current)e.has(t)||(clearTimeout(n),Ee.current.delete(t),Se.current.delete(t),Me.current.delete(t),$e.current.delete(t));r.size>0&&ge(e=>e&&r.has(e.selector)?null:e),Ie(r=>{let o=new Map([...r].filter(([t])=>e.has(t)));for(let[e,n]of t)o.set(e,n);for(let e of n)o.delete(e);return o.size===r.size&&[...o].every(([e,t])=>r.get(e)===t)?r:o})},[ue,Qe,Je]),De(()=>()=>{for(let e of Ee.current.values())clearTimeout(e);Ee.current.clear();for(let e of Ae.current.values())clearTimeout(e);Ae.current.clear(),Se.current.clear(),Me.current.clear(),$e.current.clear()},[]);let Ue=S&&S.size>0||$&&$.size>0,{charIndex:et,word:nt}=function(e){let t=Ye(s),[n,r]=Fe(0),[o,i]=Fe(()=>Math.floor(Math.random()*lr.length));return De(()=>{if(!e||!t)return;let n=setInterval(()=>r(e=>(e+1)%3),250),o=setInterval(()=>i(e=>(e+1)%lr.length),3e3);return()=>{clearInterval(n),clearInterval(o)}},[e,t]),{charIndex:n,word:lr[o]}}(!!Ue);De(()=>{if(!se)return;let t=null,r=!1,o=e??document,i=ur([...w.flatMap(e=>[e.selector,e.element.selector]),...a.flatMap(e=>[e.selector,e.element.selector]),...l.flatMap(e=>[e.selector,e.element.selector]),...Array.from(_??[]).flatMap(([e,t])=>t.selectors??[e])]),s=(e,t)=>n?null:Ve(e,t,o),c=()=>{let t=[],r=new Map,i=t=>(r.has(t)||r.set(t,n?null:e?(e=>{try{let t=o.querySelectorAll(e);return 1===t.length?t[0]:null}catch{return null}})(t):he(t)),r.get(t)),d=new Map;for(let e of w)d.set(e.selector,{selector:e.selector,element:e.element,styleChangeCount:0,textChangeCount:0,hasPendingChanges:!1!==e.pending,stickers:[],comment:e});for(let e of a){let t=d.get(e.selector),n=[...t?.stickers??[]];if(be(e.captured,A?.get(e.selector)))for(let t of ke(e.changes)){let e=Ce(t);n.some(t=>Ce(t)===e)||n.push(t)}d.set(e.selector,{selector:e.selector,element:e.element,styleChangeCount:(t?.styleChangeCount??0)+e.changes.length,textChangeCount:t?.textChangeCount??0,modifiedText:t?.modifiedText,hasPendingChanges:(t?.hasPendingChanges??!1)||!e.captured&&!e.awaitingReview,threadState:tt(e)??t?.threadState,stickers:n,comment:t?.comment})}for(let e of l){let t=d.get(e.selector);d.set(e.selector,{selector:e.selector,element:t?.element??e.element,styleChangeCount:t?.styleChangeCount??0,textChangeCount:1,modifiedText:e.modified,hasPendingChanges:(t?.hasPendingChanges??!1)||!e.captured,stickers:t?.stickers??[],threadState:t?.threadState,comment:t?.comment})}let c=new Set,u=new Set,p=new Set;for(let e of d.values()){let t=e.comment?.threadState;t?.threadId&&u.add(t.threadId),t?.targetBindingId&&p.add(t.targetBindingId)}for(let[e,t]of d){let n=s(e,t.element);n&&(t.resolvedElement=n),n&&c.add(n)}for(let[e,t]of _??[]){if(n||u.has(t.threadId)||t.targetBindingId&&p.has(t.targetBindingId))continue;let r=Be(t.selectors??[e],t.targetFingerprint,o);if("matched"!==r.status)continue;let{element:i}=r,a=t.selectors?.[0]??e;!i||c.has(i)||(c.add(i),d.set(a,{selector:a,element:{...pe(i),selector:a},styleChangeCount:0,textChangeCount:0,hasPendingChanges:!1,stickers:[],resolvedElement:i,threadState:t}))}Array.from(d.values()).forEach(e=>{let r=e.transientElement??e.resolvedElement??s(e.selector,e.element),o=n?.get(e.selector);if(!r&&!o)return;let a=function(e){return e.textChangeCount>0&&0===e.styleChangeCount?{label:`Text changed: ${e.modifiedText?.replace(/\s+/g," ").trim()||"Empty text"}`}:{label:e.elementLabel}}({elementLabel:Ar(e),styleChangeCount:e.styleChangeCount,textChangeCount:e.textChangeCount,modifiedText:e.modifiedText}),l=e.comment?.threadState??e.threadState??(_?st(e.selector,_,i):void 0);t.push({threadState:l,selector:e.selector,label:e.threadState?.title?.trim()||a.label,annotationNumber:e.transientElement?void 0:e.comment?.annotationNumber??l?.annotationNumber??I.get(e.selector),domElement:r,projectedRect:o,hasPendingChanges:e.hasPendingChanges,hasElementChanges:e.styleChangeCount>0||e.textChangeCount>0,stickers:e.stickers,transient:!!e.transientElement,comment:e.comment})}),me(e=>function(e,t){return e.length===t.length&&e.every((e,n)=>{let r=t[n];return e.selector===r.selector&&e.label===r.label&&e.annotationNumber===r.annotationNumber&&e.domElement===r.domElement&&e.projectedRect===r.projectedRect&&e.threadState===r.threadState&&e.comment===r.comment&&e.hasPendingChanges===r.hasPendingChanges&&e.hasElementChanges===r.hasElementChanges&&e.transient===r.transient&&e.stickers.length===r.stickers.length&&e.stickers.every((e,t)=>{let n=r.stickers[t];return e.token===n.token&&e.selection===n.selection&&Ce(e)===Ce(n)})})}(e,t)?e:t)},u=()=>{r||null!==t||(t=requestAnimationFrame(()=>{t=null,c()}))};if(c(),n)return;window.addEventListener("resize",u,!0);let p=new MutationObserver(e=>{e.some(i.changesIdentity)&&u()});p.observe(o.body,{attributes:!0,childList:!0,characterData:!0,subtree:!0,attributeFilter:i.attributes}),window.addEventListener("load",u),o.fonts?.ready?.then(u);let h=[...a,...l].some(e=>e.selector.startsWith("@frame("))||w.some(e=>e.selector.startsWith("@frame("))?d(u):void 0;return()=>{r=!0,h?.(),window.removeEventListener("resize",u,!0),window.removeEventListener("load",u),p.disconnect(),t&&cancelAnimationFrame(t)}},[se,I,w,a,l,_,A,e,n]);let rt=K&&!ye&&Y&&J?.selector&&!ue.some(e=>e.domElement===Y)?{selector:J.selector,label:Ar({element:J}),annotationNumber:void 0,domElement:Y,hasPendingChanges:!1,hasElementChanges:!1,stickers:[],transient:!0}:null,ot=rt?[...ue,rt]:ue;if(0===ot.length)return null;let it=se?V?.current?.getBoundingClientRect():void 0,at=!!it&&it.top<window.innerHeight/2,lt=it?{avoidTop:at?it.bottom+8:void 0,avoidBottom:at?void 0:it.top-8,avoidLeft:it.left-8,avoidRight:it.right+8}:{},dt=e=>i?.threadId&&i.threadId===(e.comment?.threadId??Er(e)?.threadId)?i:void 0,ct=e=>ce?.preview&&ce.preview.threadId===(e.comment?.threadId??Er(e)?.threadId),ut=e=>{let t=ae?.element===e.domElement,n=mt(e.hasPendingChanges,Er(e),A?.get(e.selector)),r=We(e),o=Ze(e,n),i=H?.has(A?.get(e.selector)??n?.jobId??""),a=e.comment?.awaitingReview?"Awaiting review":i?"Approval needed":r?nt||"Thinking":o?"Queued":"in_flight"===n?.status?"Thinking":"waiting_input"===n?.status?"Question":"failed"===n?.status?"Failed":n?.label??"Replied";return(t?ae.width+(ae.trailingWidth??0)+Tr(e):Tr(e)+Sn(Rr(e.comment,r||!!n))+b(e.comment?.interactionEpisodeStepCount??0))+(dt(e)?.width??(n||e.comment?.awaitingReview?28+7.2*a.length:0))+(ct(e)?m+2:0)},pt=ot.find(e=>e.transient)??ot.find(e=>e.domElement&&yr(e.domElement,Y)||ye===e.selector||fe?.selector===e.selector)??(r?ot.find(e=>e.selector===o):void 0),ht=(()=>{if(!pt)return null;let e=pt.projectedRect,t=e?{...e,right:e.left+e.width,bottom:e.top+e.height}:pt.domElement?ze(pt.domElement):void 0;if(!t)return null;let n=ut(pt),r=c(t,22,2,window.innerHeight,n,window.innerWidth);return u(r,n,22)})(),ft=fr(k),gt=gr;return Ke(Ge,{children:[Xe("style",{dangerouslySetInnerHTML:{__html:'\n[data-devtools="badge"]::selection,\n[data-devtools="badge"] *::selection {\n background: #000000;\n color: #ffffff;\n}\n.popmelt-staged-sticker-group {\n display: flex;\n align-items: center;\n isolation: isolate;\n}\n.popmelt-staged-sticker-layer {\n position: relative;\n align-self: stretch;\n display: flex;\n align-items: center;\n margin-right: -2px;\n}\n.popmelt-staged-sticker-pointer {\n position: absolute;\n left: -4px;\n top: 50%;\n width: 14.142px;\n height: 14.142px;\n display: flex;\n align-items: center;\n justify-content: center;\n transform: translateY(-50%);\n pointer-events: none;\n}\n.popmelt-staged-sticker-pointer::before {\n content: \'\';\n width: 10px;\n height: 10px;\n background: var(--popmelt-staged-accent);\n transform: rotate(-45deg);\n}\n.popmelt-collapsible-badge-detail {\n max-width: 400px;\n opacity: 1;\n overflow: hidden;\n transition: max-width 180ms cubic-bezier(0.2, 0, 0, 1), opacity 100ms linear;\n}\n.popmelt-collapsible-badge-detail-inner {\n display: block;\n min-width: 0;\n overflow: hidden;\n padding-left: 4px;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n[data-popmelt-collapsed="true"] .popmelt-collapsible-badge-detail {\n max-width: 0;\n opacity: 0;\n}\n@supports (interpolate-size: allow-keywords) {\n .popmelt-collapsible-badge-detail {\n width: max-content;\n interpolate-size: allow-keywords;\n transition: width 180ms cubic-bezier(0.2, 0, 0, 1), opacity 100ms linear;\n }\n [data-popmelt-collapsed="true"] .popmelt-collapsible-badge-detail {\n width: 0;\n max-width: 400px;\n }\n}\n[data-popmelt-snap-collapse="true"] .popmelt-collapsible-badge-detail {\n transition: none;\n}\n@media (prefers-reduced-motion: reduce) {\n .popmelt-collapsible-badge-detail {\n transition: none;\n }\n}\n'}}),ot.map(e=>{let n=dt(e),i=ae?.element===e.domElement,s=mt(e.hasPendingChanges,Er(e),A?.get(e.selector)),d=We(e),c=Ze(e,s),w=function(e,t,n,r){return t?r?.get(e)??n:n}(e.selector,d,k,T),b=function(e,t,n){return n?.color?n.color:!1===t?.pending&&(t.threadState||t.awaitingReview)?t.color:e}(w,e.comment,Er(e)),I=function(e,t){return t?"#888888":e}(b,d||"in_flight"===s?.status),S=H?.has(A?.get(e.selector)??s?.jobId??""),M=e.comment?.awaitingReview||"awaiting_review"===s?.status,$=M?"Awaiting review":S?"Approval needed":d?nt||"Thinking":c?"Queued":"in_flight"===s?.status?"Thinking":"waiting_input"===s?.status?"Question":"failed"===s?.status?"Failed":s?.label??"Replied",E=!(!e.domElement||!yr(e.domElement,Y)),V=ye===e.selector,_=ve.has(e.selector),J=ve.get(e.selector),K=!!s||!1===e.comment?.pending,se=Sr({hasElementChanges:e.hasElementChanges,hasPendingChanges:e.hasPendingChanges,hasThreadState:K,isHovered:r&&o===e.selector||E||V||br(fe,e.selector,0),hasTimedReveal:_,isRevealedSticker:!1}),ce=e.stickers.length+1,ue=Sr({hasElementChanges:e.hasElementChanges,hasPendingChanges:e.hasPendingChanges,hasThreadState:K,isHovered:br(fe,e.selector,ce),hasTimedReveal:_,isRevealedSticker:!1}),pe=Sr({hasElementChanges:e.hasElementChanges,hasPendingChanges:e.hasPendingChanges,hasThreadState:K,isHovered:r&&o===e.selector||E||V||br(fe,e.selector,ce),hasTimedReveal:_,isRevealedSticker:_}),he=ut(e),me=(i?ae.imageCount:Rr(e.comment,d||!!s))??0,be=e.stickers.length>0||me>0,ke=p({hasCommentEntry:i||!!e.comment,stagedChangeCount:e.stickers.length+ +(me>0)}),Ie=d||!!s||!!e.comment?.awaitingReview,Se=!Ie&&e.selector===L,Me=!i&&se.annotationCollapsed&&pe.stickerCollapsed&&ue.sendCompact&&!_&&fe?.selector!==e.selector,$e=Me?h({annotationNumber:e.annotationNumber,stickerCount:e.stickers.length,interactionEpisodeStepCount:e.comment?.interactionEpisodeStepCount??0,hasStatus:Ie,hasSend:Se,controlGap:ke})+Sn(me)+(ct(e)?m+ke:0):he;return Xe(f,{element:e.domElement,projectedRect:e.projectedRect,onRemove:e.comment&&Q?()=>Q(e.comment.id):U&&a.some(t=>t.selector===e.selector)?()=>U(a.filter(t=>t.selector===e.selector)):void 0,onActivate:e.comment?.threadId||s?.threadId?()=>q?.(e.comment?.threadId??s?.threadId):void 0,hideOutline:!(r&&pt===e),color:b,fillOpacity:.1,outlineZIndex:10002,subjectRegistry:t,hideTooltip:!0,railGap:2,railWidth:he,refreshKey:le,renderRail:t=>{let o=Re.current.get(e.selector)?.getBoundingClientRect(),p=o?.width?o:u(t,he,22),h=!!(Me&&pt!==e&&ht&&g(p,ht));if(pt!==e&&ht&&g(u(t,$e,22),ht))return null;let m="right"===t.horizontalAlignment?t.left-he:t.left,f=Hr(lt,m,he);if(e.transient){let n=e.domElement?de(e.domElement):null;return Xe(Pr,{"data-popmelt-rail-priority":"intent","data-popmelt-subject-label-action":n?"true":void 0,"data-popmelt-subject-adapter":n?.adapter,"data-popmelt-subject-key":n?.key,left:t.left,top:t.top,avoidTop:f.avoidTop,avoidBottom:f.avoidBottom,anchor:t.anchor,horizontalAlignment:t.horizontalAlignment,style:{zIndex:10001,pointerEvents:n?"auto":"none",cursor:n?"pointer":void 0},onPointerDown:e=>{n&&e.stopPropagation()},onClick:e=>{n&&(e.preventDefault(),e.stopPropagation(),re?.(n))},onContextMenu:e=>{n&&(e.preventDefault(),e.stopPropagation(),oe?.(n))},onMouseEnter:()=>{n&&ie?.(n)},onMouseLeave:()=>ie?.(null),children:Xe("div",{"data-devtools":"steer-element-identifier",ref:t=>{e.domElement&&Pe(e.domElement,t)},"data-popmelt-subject-label-action":n?"true":void 0,style:{...ft,borderRadius:e.domElement===document.body?y("bottom-left"):y(t.anchor)},children:Xe("span",{style:gt,children:e.label})})})}return Xe(Pr,{"data-popmelt-rail-priority":"history","data-popmelt-snap-collapse":h||void 0,visualRef:t=>{t?Re.current.set(e.selector,t):Re.current.delete(e.selector)},left:t.left,top:t.top,avoidTop:f.avoidTop,avoidBottom:f.avoidBottom,anchor:t.anchor,horizontalAlignment:t.horizontalAlignment,onClick:()=>{if(i)return;let t=function(e,t){if(e){if(e.threadId)return{type:"open-thread",threadId:e.threadId};if(!1!==e.pending)return{type:"edit-comment",annotationId:e.id};if(e.threadState?.threadId)return{type:"open-thread",threadId:e.threadState.threadId}}return t?{type:"open-thread",threadId:t}:{type:"none"}}(e.comment,e.comment?.threadId??s?.threadId);"edit-comment"===t.type?X?.(t.annotationId):"open-thread"===t.type&&q?.(t.threadId)},onContextMenu:t=>{if(t.preventDefault(),t.stopPropagation(),e.comment&&Q)Q(e.comment.id);else{if(U){let t=a.filter(t=>t.selector===e.selector);if(t.length)return void U(t)}e.comment&&!1!==e.comment.pending&&G?(je(e.selector),ge(t=>kr(t,e.selector)),xe(t=>t===e.selector?null:t),B?.(null),G(e.comment.id)):l.some(t=>t.selector===e.selector&&!t.captured)?ee?.(e.selector):!e.hasPendingChanges&&!d&&"resolved"===s?.status&&te?.(s.threadId)}},onMouseEnter:()=>{je(e.selector),xe(e.selector),B?.(e.selector)},onMouseLeave:()=>{Ne(e.selector),B?.(null)},style:{zIndex:i?10002:1e4,cursor:i?"text":"pointer",pointerEvents:"auto"},children:Ke("div",{ref:t=>{e.domElement&&Pe(e.domElement,t)},style:{display:"flex",alignItems:"center",gap:ke},children:[i?ae.render(t.anchor):Ke("div",{"data-devtools":"badge","data-popmelt-collapsed":se.annotationCollapsed,onMouseEnter:()=>Le(e.selector,"annotation",0),style:{...ft,...n&&{maxWidth:`min(400px, calc(100vw - ${n.width+24}px))`},backgroundColor:Cr({accentColor:k,threadAccentColor:b,comment:e.comment,isInFlight:d,hasThreadState:!!s,hasStickers:e.stickers.length>0}),gap:0,letterSpacing:e.comment?0:ft.letterSpacing,borderRadius:e.domElement===document.body?y("bottom-left"):y(t.anchor)},children:[Xe("span",{style:{fontWeight:600},children:e.annotationNumber}),Xe("span",{className:"popmelt-collapsible-badge-detail",children:Xe("span",{className:"popmelt-collapsible-badge-detail-inner",style:{...gt,paddingLeft:e.comment?0:void 0},children:e.comment?Ke(Ge,{children:[".",Xe("span",{style:{marginLeft:2},children:n?n.formatText(e.comment.text):e.comment.text})]}):Ke(Ge,{children:[". ",e.label]})})})]}),!be&&Xe(x,{stepCount:i?0:e.comment?.interactionEpisodeStepCount??0,onClear:!1!==e.comment?.pending&&ne?()=>ne(e.comment.id):void 0,submitted:!1===e.comment?.pending}),be&&Ke("div",{className:"popmelt-staged-sticker-group",children:[e.stickers.map((t,n)=>{let o=Ce(t),i=Sr({hasElementChanges:e.hasElementChanges,hasPendingChanges:e.hasPendingChanges,hasThreadState:!!s,isHovered:br(fe,e.selector,n+1),hasTimedReveal:_,isRevealedSticker:_&&o===J}),a=we(n,e.stickers.length+ +(me>0)),l=0===n?void 0:Te;return Ke("div",{className:"popmelt-staged-sticker-layer",style:{zIndex:a.zIndex},children:[Xe("span",{"aria-hidden":!0,className:"popmelt-staged-sticker-pointer",style:{"--popmelt-staged-accent":I,WebkitMaskImage:0===n?void 0:He,maskImage:0===n?void 0:He}}),Ke("button",{type:"button","data-devtools":"staged-sticker","data-popmelt-style-property":t.custom?.property,title:t.custom?`${t.custom.property}: ${t.custom.value}`:void 0,"data-popmelt-collapsed":i.stickerCollapsed,onMouseEnter:()=>Le(e.selector,o,n+1),"aria-label":t.custom?`Custom ${t.custom.property}: ${t.custom.value}`:`${r?"Staged":"Edit staged"} ${t.token} sticker`,onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:n=>{n.preventDefault(),n.stopPropagation(),t.selection&&D?.(e.selector,t.selection)},onContextMenu:n=>{n.preventDefault(),n.stopPropagation(),je(e.selector),ge(t=>kr(t,e.selector)),B?.(null),t.selection&&O?.(e.selector,t.selection)},style:{...ft,position:"relative",height:"100%",minHeight:22,appearance:"none",border:0,margin:0,paddingLeft:a.paddingLeft,paddingRight:a.paddingRight,gap:0,cursor:t.selection&&(D||O)?"pointer":"default",backgroundColor:I,WebkitMaskImage:l,maskImage:l},children:[Xe($r,{chip:t}),Xe("span",{className:"popmelt-collapsible-badge-detail",children:Xe("span",{className:"popmelt-collapsible-badge-detail-inner",children:t.token})})]})]},o)}),Xe(Mn,{imageCount:me,color:I,layered:e.stickers.length>0}),!i&&(e.comment?.interactionEpisodeStepCount??0)>0&&Xe("div",{className:"popmelt-staged-sticker-layer",style:{zIndex:1},children:Xe(x,{stepCount:e.comment.interactionEpisodeStepCount,layered:!0,onClear:!1!==e.comment?.pending&&ne?()=>ne(e.comment.id):void 0,submitted:!1===e.comment?.pending})}),Se&&Xe(v,{bundleCount:W,compact:ue.sendCompact,layered:!0,onHoverChange:t=>{t&&Le(e.selector,"send",ce),Z?.(t)},onSend:F,style:{position:"relative",zIndex:(e.comment?.interactionEpisodeStepCount??0)>0?0:1}})]}),n?.controls,Xe(C,{threadId:e.comment?.threadId??s?.threadId,color:b}),!n&&Ie&&Xe("button",{type:"button","data-devtools":"annotation-badge","data-popmelt-collapsed":pe.stickerCollapsed,onMouseEnter:()=>Le(e.selector,"thread-status",ce),"aria-label":s?`${$}. Open thread`:$,onPointerDown:e=>{e.preventDefault(),e.stopPropagation()},onClick:t=>{t.preventDefault(),t.stopPropagation();let n=e.comment?.threadId??s?.threadId;n&&q?.(n)},style:{...ft,appearance:"none",border:0,margin:0,cursor:s&&q?"pointer":"default",backgroundColor:b,gap:0},children:Ke(Ge,M?{children:[Xe(R,{size:12,strokeWidth:2.25}),Xe("span",{className:"popmelt-collapsible-badge-detail",children:Xe("span",{className:"popmelt-collapsible-badge-detail-inner",children:$})})]}:d?{children:[S?Xe(j,{size:12,"aria-label":"Approval needed"}):Xe("svg",{width:"11",height:"11",viewBox:"0 0 24 24",fill:"currentColor",style:{verticalAlign:"middle"},children:Ke(Ge,1===et?{children:[Xe("circle",{cx:"7",cy:"7",r:"2"}),Xe("circle",{cx:"17",cy:"7",r:"2"}),Xe("circle",{cx:"7",cy:"17",r:"2"}),Xe("circle",{cx:"17",cy:"17",r:"2"})]}:{children:[Xe("circle",{cx:"12",cy:"6",r:"2"}),Xe("circle",{cx:"6",cy:"12",r:"2"}),Xe("circle",{cx:"18",cy:"12",r:"2"}),Xe("circle",{cx:"12",cy:"18",r:"2"})]})}),Xe("span",{className:"popmelt-collapsible-badge-detail",children:Xe("span",{className:"popmelt-collapsible-badge-detail-inner",style:{opacity:.8},children:$})})]}:{children:[c?Xe(R,{"data-devtools":"queued-status-icon",size:12,strokeWidth:2.25,style:{verticalAlign:"middle",opacity:.6}}):"waiting_input"===s?.status?Xe(P,{"data-devtools":"question-status-icon",size:12,strokeWidth:2.25,style:{transform:"translateY(-0.5px)",flexShrink:0}}):Xe("failed"===s?.status?z:N,{size:12,strokeWidth:2.25}),Xe("span",{className:"popmelt-collapsible-badge-detail",children:Xe("span",{className:"popmelt-collapsible-badge-detail-inner",children:$})})]})}),Se&&!be&&Xe(v,{bundleCount:W,compact:ue.sendCompact,onHoverChange:t=>{t&&Le(e.selector,"send",ce),Z?.(t)},onSend:F})]})})}},`${e.transient?"intent":"history"}:${e.selector}`)})]})}var Nr=4;function Vr(e,t){return e.left<t.right&&e.right>t.left&&e.top<t.bottom&&e.bottom>t.top}function Br(e,t){return function(e,t){return e===t||Le(e,t)||Le(t,e)}(e,t)||null!==Ne(e)&&Ne(e)===Ne(t)}function Lr(e){let t=0,n=Ne(e);for(;n;)t+=1,n=Ne(n);return t}function Wr(e,t){return Ve(e,t?.[0])}function Zr(e){return!(!e.linkedSelector||"body"!==e.elements?.[0]?.tagName.toLowerCase())}function Fr(e){let t=c(e,22,2,window.innerHeight);return{x:t.left+window.scrollX+8,y:t.top+window.scrollY+4}}function Dr(e){let t=e?.getBoundingClientRect();return!t||typeof window>"u"?{}:t.top<window.innerHeight/2?{avoidTop:t.bottom+8,avoidLeft:t.left-8,avoidRight:t.right+8}:{avoidBottom:t.top-8,avoidLeft:t.left-8,avoidRight:t.right+8}}function Or(e,t){if(0===t.size)return null;let n=new Set,r=new Set;for(let o of e)t.has(o.id)&&(o.groupId&&n.add(o.groupId),o.threadId&&r.add(o.threadId));for(let t of e)t.groupId&&n.has(t.groupId)&&t.threadId&&r.add(t.threadId);let o=new Set(t);for(let t of e)(t.groupId&&n.has(t.groupId)||t.threadId&&r.has(t.threadId))&&o.add(t.id);return o}function _r(e,t,n=0,r,o,i=90){let a=e.left+window.scrollX+8,l="top-left"===t?e.top+window.scrollY-4-22-22*n+4:e.bottom+window.scrollY+4+4+22*n,s=window.scrollY+4,d=window.scrollY+window.innerHeight-22-4,c=null;if(r&&void 0!==o){let t=r.getBoundingClientRect(),n=e.left;if(n+o+16+i>t.left&&n<t.right)if(t.top<window.innerHeight/2){let e=window.scrollY+t.bottom+4;e>s&&(s=e,c="top")}else{let e=window.scrollY+t.top-22-4;e<d&&(d=e,c="bottom")}}return s>d&&(d=s),l<s?l="top"===c?s:e.top+window.scrollY+4:l>d&&(l="bottom"===c?d:Math.max(e.top+window.scrollY+4,d)),{x:a,y:l}}var qr=new Set(["resolved","needs_review","waiting_input","failed"]);function Yr(e){return e.linkedSelector??(e.target?ce(e.target):void 0)}function Jr(e,t){let n=e.groupId?t.filter(t=>t.groupId===e.groupId):[e],r=n.find(e=>void 0!==e.status&&qr.has(e.status)),o=n.find(e=>e.threadId),i=n.find(e=>Yr(e)),a=i?Yr(i):void 0;if(!r?.status||!o?.threadId||!a)return;let l=n.find(e=>e.targetBindingId),s=n.find(e=>e.replyJobIds?.length);return{status:r.status,threadId:o.threadId,targetBindingId:l?.targetBindingId,replyJobIds:s?.replyJobIds,linkedSelector:a,elements:i?.elements}}function Kr({resolveElement:e,projectedSelectors:t,activeText:n,activeColor:r,annotations:o,annotationNumberById:i,focusedThreadAnnotationId:a,hiddenCollidingAnnotationIds:l,modifiedElementThreadStates:s,nestedCollidingAnnotationCountById:d,nestedCollidingAnnotationIdsById:c,pageAnnotations:u,pageStyleModifications:p,pageTextModifications:h,sendHintAnchorId:m,supersededAnnotations:f,visibleCollisionRepresentativeByAnnotationId:g,activeTextSendHintId:y,targetResolutionRevision:x}){let v=Oe((n,r)=>t?null:e?e(n,r):Wr(n,r),[x,e,t]),C=Ze(()=>{let e=[],n=new Set,r=[...u].sort((e,t)=>t.timestamp-e.timestamp);for(let o of r){if("text"!==o.type||!o.text||!o.linkedSelector||f.has(o)||l.has(o.id))continue;let r=o.status??(o.captured?"in_flight":"pending");if(!["pending","sending","in_flight","awaiting_review"].includes(r))continue;let a=i.get(o.id);if(void 0===a||n.has(o.linkedSelector))continue;let s=v(o.linkedSelector,o.elements),d=o.elements?.[0];!s&&(!t?.has(o.linkedSelector)||!d)||(n.add(o.linkedSelector),e.push({id:o.id,selector:o.linkedSelector,text:o.text.replace(/\n/g," "),annotationNumber:a,color:o.color,element:d??pe(s),pending:"pending"===r,awaitingReview:"awaiting_review"===r,threadId:o.threadId,imageCount:o.imageCount??0,interactionEpisodeStepCount:o.interactionEpisode?.steps.length}))}return e},[i,l,u,f,v,t]),w=Ze(()=>new Set(C.map(e=>e.id)),[C]),b=Ze(()=>{let e=new Map;for(let t of u){if("text"!==t.type)continue;let n=Jr(t,u);n&&e.set(t.id,n)}return e},[u]),k=Ze(()=>{let e=[],n=new Set,r=[...u].sort((e,t)=>+(t.id===a)-+(e.id===a)||t.timestamp-e.timestamp);for(let o of r){let r=b.get(o.id);if(!r||!xr({...o,status:r.status,threadId:r.threadId,linkedSelector:r.linkedSelector})||!o.text||f.has(o)||l.has(o.id)||n.has(r.linkedSelector))continue;let a=i.get(o.id);if(void 0===a)continue;let s=v(r.linkedSelector,r.elements),d=r.elements?.[0];!s&&(!t?.has(r.linkedSelector)||!d)||(n.add(r.linkedSelector),e.push({id:o.id,selector:r.linkedSelector,text:o.text.replace(/\n/g," "),annotationNumber:a,color:o.color,element:d??pe(s),pending:!1,imageCount:o.imageCount??0,interactionEpisodeStepCount:o.interactionEpisode?.steps.length,threadState:{jobId:r.replyJobIds?.[r.replyJobIds.length-1]??r.threadId,threadId:r.threadId,targetBindingId:r.targetBindingId,annotationNumber:a,status:"waiting_input"===r.status?"waiting_input":"failed"===r.status?"failed":"resolved",label:"waiting_input"===r.status?"Question":"failed"===r.status?"Failed":"Replied"}}))}return e},[i,a,l,u,b,f,v,t]),I=Ze(()=>[...C,...k],[k,C]),S=Ze(()=>{let e=new Set,t=new Set,n=new Set,r=new Set;for(let[e,o]of s??[])if("matched"===Be(o.selectors??[e],o.targetFingerprint).status){t.add(o.threadId),o.targetBindingId&&n.add(o.targetBindingId);for(let e of o.selectors??[])r.add(e);!o.targetBindingId&&!o.selectors?.length&&r.add(e)}for(let o of u){let i=b.get(o.id),a=o.groupId?u.filter(e=>e.groupId===o.groupId):[o],s=a.map(Yr).find(e=>!!e),d=a.find(e=>e.threadId)?.threadId,c=a.find(e=>e.targetBindingId)?.targetBindingId;"text"===o.type&&o.text&&s&&!f.has(o)&&!l.has(o.id)&&((d&&t.has(d)||c&&n.has(c)||r.has(s)||i&&xr({...o,status:i.status,threadId:i.threadId,linkedSelector:i.linkedSelector})&&v(i.linkedSelector,i.elements))&&e.add(o.id))}return e},[l,s,u,b,f,v]),M=Ze(()=>{let e=new Set;for(let t of u)vr(t)&&t.linkedSelector&&!f.has(t)&&!l.has(t.id)&&v(t.linkedSelector,t.elements)&&e.add(t.id);return e},[l,u,f,v]),$=Ze(()=>{let e=new Set(M);for(let t of w)e.add(t);for(let t of S)e.add(t);return e},[M,S,w]),E=Ze(()=>new Map(I.map(e=>[e.selector,e.color])),[I]),A=Ze(()=>new Set([...l,...$]),[$,l]),H=Ze(()=>{if(!n?.linkedSelector||n.domEdit)return null;let e=v(n.linkedSelector,n.elements);if(!e)return null;let t=[...p,...h].find(t=>!t.captured&&Wr(t.selector,[t.element])===e),r=u.find(e=>e.id===n.id),o=!(n.isNew||!r||!vr(r));return t||o?{element:e,selector:t?.selector??n.linkedSelector}:null},[n,u,p,h,v]),T=m===y?m:m?g.get(m)??m:null,R=Ze(()=>{if(T===y)return n?.text.trim()?H?.selector??null:null;if(T&&T!==y)return C.find(e=>e.id===T)?.selector??null;for(let e=h.length-1;e>=0;e-=1){let t=h[e];if(t&&!t.captured)return t.selector}for(let e=p.length-1;e>=0;e-=1){let t=p[e];if(t&&!t.captured&&!t.awaitingReview)return t.selector}return null},[n,H,y,p,h,C,T]),j=n?n.isNew?y:n.id:null,P=j?d.get(j)??0:0,z=j?c.get(j)??[]:[],N=n?.isNew?void 0:o.find(e=>e.id===n?.id),V="pending"===(N?.status??(N?.captured?"in_flight":"pending"))?N?.color??r:"#8c8c8c",B=Ze(()=>u.filter(e=>!(f.has(e)||l.has(e.id)||$.has(e.id)||n&&!n.isNew&&e.id===n.id)),[n,$,l,u,f]);return{activeTextAnnotation:N,activeTextCollisionId:j,activeTextModifiedRail:H,activeTextNestedAnnotationCount:P,activeTextNestedAnnotationIds:z,activeTextNestedBadgeColor:V,elementRailColorBySelector:E,elementRailCommentIds:$,elementRailComments:I,hiddenAnnotationBadgeIds:A,modifiedElementSendHintSelector:R,stagedElementComments:C,visibleCanvasAnnotations:B,visibleSendHintAnchorId:T}}function Xr(e){if(e.length<2)return null;let t=e[0],n=e[e.length-1];return t&&n?[t,n]:null}function Gr(e,t,n){return e.map(e=>({x:e.x-t,y:e.y-n}))}function Qr(e,t,n,r,o,i){let a=String(r);e.font="600 11px system-ui, -apple-system, sans-serif";let l=e.measureText(a).width+8,s=t-l/2,d=n+i/2+2;e.fillStyle=o,e.fillRect(s,d,l,19),e.fillStyle="#ffffff",e.textBaseline="middle",e.fillText(a,s+4,d+9.5)}function Ur(e,t){if(e.points.length<2&&"text"!==e.type)return null;switch(e.type){case"rectangle":case"freehand":{let t,n;if("freehand"===e.type)t=Math.min(...e.points.map(e=>e.x)),n=Math.max(...e.points.map(e=>e.y));else{let r=e.points[0],o=e.points[e.points.length-1];t=Math.min(r.x,o.x),n=Math.max(r.y,o.y)}return{x:t,y:n}}case"circle":{let t=e.points[0],n=e.points[e.points.length-1];return{x:Math.min(t.x,n.x),y:(Math.min(t.y,n.y)+Math.max(t.y,n.y))/2}}case"line":{let t=e.points[0],n=e.points[e.points.length-1],r=t.y>n.y?t:n;return{x:r.x,y:r.y}}default:return null}}function eo(){let e=_e(null),t=Oe(()=>{let t=e.current;if(!t)return;let n=t.getContext("2d");n&&n.clearRect(0,0,t.width,t.height)},[]),r=Oe((t,r,o,i=1,a=!1,l=!1)=>{let s=e.current;if(!s)return;let d=s.getContext("2d");if(!d)return;let c=t.status??(t.captured?"in_flight":"pending"),u="pending"===c?t.color:"#8c8c8c";switch(d.save(),d.globalAlpha=i,t.region&&n(d,t.region.points,u,!l),t.type){case"freehand":((e,t,n,r)=>{let o=Xr(t);if(!o)return;let[i,a]=o;e.beginPath(),e.strokeStyle=n,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",e.moveTo(i.x,i.y);for(let n=1;n<t.length-1;n++){let r=t[n],o=t[n+1];!r||!o||e.quadraticCurveTo(r.x,r.y,(r.x+o.x)/2,(r.y+o.y)/2)}e.lineTo(a.x,a.y),e.stroke()})(d,t.points,u,t.strokeWidth);break;case"line":((e,t,n,r)=>{let o=Xr(t);if(!o)return;let[i,a]=o;e.beginPath(),e.strokeStyle=n,e.lineWidth=r,e.lineCap="round",e.moveTo(i.x,i.y),e.lineTo(a.x,a.y),e.stroke()})(d,t.points,u,t.strokeWidth);break;case"rectangle":((e,t,n,r)=>{let o=Xr(t);if(!o)return;let[i,a]=o;e.beginPath(),e.strokeStyle=n,e.lineWidth=r,e.lineCap="round",e.lineJoin="round",e.strokeRect(Math.min(i.x,a.x),Math.min(i.y,a.y),Math.abs(a.x-i.x),Math.abs(a.y-i.y))})(d,t.points,u,t.strokeWidth);break;case"circle":((e,t,n,r)=>{let o=Xr(t);if(!o)return;let[i,a]=o,l=(i.x+a.x)/2,s=(i.y+a.y)/2,d=Math.abs(a.x-i.x)/2,c=Math.abs(a.y-i.y)/2;e.beginPath(),e.strokeStyle=n,e.lineWidth=r,e.ellipse(l,s,d,c,0,0,2*Math.PI),e.stroke()})(d,t.points,u,t.strokeWidth);break;case"text":if(t.text&&t.points[0]){let e="pending"===c?"#ffffff":"#dddddd";w(d,t.points[0],t.text,u,t.fontSize,r,t.points[0].x,o,e,Zr(t)?"bottom-left":t.linkedAnchor,a)}}d.restore()},[]),o=Oe((t,n)=>{let r=e.current;if(!r||t.points.length<2)return;let o=r.getContext("2d");if(o){if(o.fillStyle="#ffffff",o.strokeStyle=t.color,o.lineWidth=1.5,"line"===t.type){return void[t.points[0],t.points[t.points.length-1]].forEach(e=>{o.beginPath(),o.arc(e.x,e.y,n/2,0,2*Math.PI),o.fill(),o.stroke()})}if("circle"===t.type){let e=t.points[0],r=t.points[t.points.length-1],i=Math.min(e.x,r.x),a=Math.max(e.x,r.x),l=Math.min(e.y,r.y),s=Math.max(e.y,r.y),d=(i+a)/2,c=(l+s)/2;return void[{x:d,y:l},{x:d,y:s},{x:i,y:c},{x:a,y:c}].forEach(e=>{o.beginPath(),o.rect(e.x-n/2,e.y-n/2,n,n),o.fill(),o.stroke()})}if("rectangle"===t.type||"freehand"===t.type){let e,r,i,a;if("freehand"===t.type)e=Math.min(...t.points.map(e=>e.x)),r=Math.max(...t.points.map(e=>e.x)),i=Math.min(...t.points.map(e=>e.y)),a=Math.max(...t.points.map(e=>e.y));else{let n=t.points[0],o=t.points[t.points.length-1];e=Math.min(n.x,o.x),r=Math.max(n.x,o.x),i=Math.min(n.y,o.y),a=Math.max(n.y,o.y)}[{x:e,y:i},{x:r,y:i},{x:e,y:a},{x:r,y:a}].forEach(e=>{o.beginPath(),o.rect(e.x-n/2,e.y-n/2,n,n),o.fill(),o.stroke()})}}},[]),i=Oe((n,i,a,l=0,s=0,d,c,u,p,h,m=.5,f,g)=>{if(t(),n.forEach(e=>{let t={...e,points:Gr(e.points,l,s),...e.region?{region:{...e.region,points:Gr(e.region.points,l,s)}}:{}},n=d?.get(e.id),o=h?.has(e.id)??!1,i=!!c?.size,a=c?.has(e.id)??!1,y=i?a?1:.2:!p||p.has(e.id)||o?1:m;r(t,n,u,y,f?.has(e.id),g?.has(e.id))}),i&&i.length>0&&a){let t=e.current?.getContext("2d");for(let e of i){let r=n.find(t=>t.id===e);if(r){let e=h?.has(r.id)??!1,i=!!c?.size,u=c?.has(r.id)??!1,f=i?u?1:.2:!p||p.has(r.id)||e?1:m,g={...r,points:Gr(r.points,l,s)};if(t?.save(),t&&(t.globalAlpha=f),o(g,a),t&&"text"!==r.type&&d&&(!r.groupId||!n.some(e=>e.groupId===r.groupId&&"text"===e.type))){let e=d.get(r.id);if(void 0!==e){let n=Ur(g);if(n){let o="pending"===(r.status??(r.captured?"in_flight":"pending"))?r.color:"#999999";Qr(t,n.x,n.y,e,o,a)}}}t?.restore()}}}},[t,r,o]),a=Oe(()=>{let t=e.current;if(!t)return;let n=window.devicePixelRatio||1,r=window.visualViewport?.width??window.innerWidth,o=window.visualViewport?.height??window.innerHeight;t.width=r*n,t.height=o*n;let i=t.getContext("2d");i&&i.scale(n,n)},[]);return{canvasRef:e,clearCanvas:t,drawAnnotation:r,redrawAll:i,resizeCanvas:a}}var to=new Set;function no({annotations:e,annotationGroupMap:t,targetDocument:n,color:r,onViewThread:o,onDelete:l}){let{canvasRef:s,redrawAll:d,resizeCanvas:c}=eo(),[u,p]=Fe({x:0,y:0,revision:0}),[h,m]=Fe([]);qe(()=>{let e=n.defaultView,t=()=>{let t=e?.frameElement?.getBoundingClientRect();p(n=>({x:(t?.left??0)-(e?.scrollX??0),y:(t?.top??0)-(e?.scrollY??0),revision:n.revision+1}))};return t(),e?.addEventListener("scroll",t,{passive:!0}),window.addEventListener("resize",t),()=>{e?.removeEventListener("scroll",t),window.removeEventListener("resize",t)}},[n]);let f=Ze(()=>Zt(e,n.location?.pathname??"/").filter(e=>e.points.length>0).map(e=>({...e,color:r,...e.region?{region:{...e.region,points:e.region.points.map(e=>({x:e.x+u.x,y:e.y+u.y}))}}:{},points:e.points.map(e=>({x:e.x+u.x,y:e.y+u.y}))})),[e,r,n,u]);return qe(()=>{if(!f.length)return void m([]);c(),d(f,[],void 0,0,0,t);let e=s.current?.getContext("2d");e&&m(f.map(n=>{if("text"!==n.type){let e=function(e){if(0===e.length)return{x:0,y:0,width:0,height:0};let t=e.map(e=>e.x),n=e.map(e=>e.y),r=Math.min(...t),o=Math.max(...t),i=Math.min(...n);return{x:r,y:i,width:o-r,height:Math.max(...n)-i}}(n.points);return{annotation:n,left:e.x,top:e.y,width:Math.max(12,e.width),height:Math.max(12,e.height)}}let r=n.fontSize??12,o=t.get(n.id),l=`${void 0===o?"":`${o}. `}${(n.text??"").replace(/\n/g," ")}`,s=n.points[0];e.font=`${r}px ${i}`;let d=e.measureText(I(e,l,S(s.x))).width+16,c=M(s,r,void 0,d);return{annotation:n,left:c.x-8,top:c.y-4,width:d,height:r*a+8}}))},[f,t,s,d,c]),f.length?Ke(Ge,{children:[Xe("canvas",{ref:s,"aria-hidden":!0,style:{position:"fixed",inset:0,width:"100vw",height:"100vh",pointerEvents:"none",zIndex:9999}}),h.map(({annotation:e,...t})=>Xe("button",{type:"button","data-devtools":"peer-canvas-annotation","data-annotation-id":e.id,"aria-label":e.text??"Annotation",onClick:t=>{t.stopPropagation(),e.threadId&&o?.(e.threadId)},onPointerDown:e=>e.stopPropagation(),onContextMenu:l?t=>{t.preventDefault(),t.stopPropagation(),l(e.id)}:void 0,style:{...t,position:"fixed",padding:0,border:0,background:"transparent",pointerEvents:"auto",cursor:e.threadId?"pointer":"default",zIndex:9999}},e.id)),Xe($,{annotations:f,supersededAnnotations:to,annotationGroupMap:t,scrollX:0,scrollY:0,onViewThread:o,canvasRef:s,pendingBundleCount:0})]}):null}var ro=new Set,oo=new Map,io=new Map,ao=new Map;function lo({peer:n,targetDocument:r,projectedTargets:o,hoveredElement:i,getSubjects:a,onApprove:l,focusedAnnotationId:s}){let d=Ye(e),c=Ye(t),u=c?.isHost&&"guest"===n.identity.relationship&&c.deletePeerAnnotations&&!c.view?.isPeeking?e=>{c.deletePeerAnnotations(n.identity.id,[e]).catch(()=>{})}:void 0,p=Ze(()=>nt(et(n.state??ue,c?.pendingSubmissions??[],n.identity.id),"guest"===n.identity.relationship?n.color:void 0),[n.state,n.identity.id,n.identity.relationship,n.color,c?.pendingSubmissions]),h=c?.isHost&&"guest"===n.identity.relationship&&c.deletePeerStyles&&!c.view?.isPeeking?e=>{c.deletePeerStyles(n.identity.id,e.map(Qe)).catch(()=>{})}:void 0,[m,f]=Fe(0),g=Ze(()=>ur((n.state?.annotations??[]).flatMap(e=>[e.linkedSelector,e.elements?.[0]?.selector].filter(e=>!!e))),[n.state?.annotations]);De(()=>{if(!r||o)return;let e=new MutationObserver(e=>{e.some(g.changesIdentity)&&f(e=>e+1)});return e.observe(r.body,{childList:!0,characterData:!0,subtree:!0,attributes:!0,attributeFilter:g.attributes}),()=>e.disconnect()},[r,o,g]);let y=Oe((e,t)=>!r||o?null:Ve(e,t?.[0],r),[r,o]),x=Ze(()=>o?new Set(o.keys()):void 0,[o]),v=Ct({state:p,pageAnnotations:p.annotations,pageStyleModifications:p.styleModifications,pageTextModifications:p.textModifications}),C=p.annotations.find(e=>e.id===s)?.linkedSelector,w=[...p.annotations].filter(e=>!e.captured&&!v.supersededAnnotations.has(e)).sort((e,t)=>t.timestamp-e.timestamp)[0],b=Kr({resolveElement:y,projectedSelectors:x,activeText:null,activeColor:n.color,annotations:p.annotations,annotationNumberById:v.annotationGroupMap,hiddenCollidingAnnotationIds:ro,nestedCollidingAnnotationCountById:oo,nestedCollidingAnnotationIdsById:io,pageAnnotations:p.annotations,pageStyleModifications:p.styleModifications,pageTextModifications:p.textModifications,sendHintAnchorId:w?.id??null,supersededAnnotations:v.supersededAnnotations,visibleCollisionRepresentativeByAnnotationId:ao,activeTextSendHintId:"",targetResolutionRevision:n.revision+m});return Ke("div",{"data-devtools":"peer-rails","data-peer-id":n.identity.id,"aria-label":`${n.identity.name}'s suggestions`,children:[r&&!o&&Xe(no,{annotations:b.visibleCanvasAnnotations,annotationGroupMap:v.annotationGroupMap,targetDocument:r,color:n.color,onViewThread:d,onDelete:u}),Xe(zr,{targetDocument:r,projectedTargets:o,hoveredElement:i,subjectRegistry:a?.(),readOnly:!0,onDeletePeerComment:u,onDeletePeerStyles:h,styleModifications:p.styleModifications,textModifications:p.textModifications,stagedComments:b.elementRailComments,accentColor:n.color,annotationNumberBySelector:v.pageModificationNumberBySelector,sendHintSelector:l?b.modifiedElementSendHintSelector:null,pendingBundleCount:v.stagedArtifactOrder.count,onSend:l,onViewThread:d,focusedSelector:C,refreshKey:n.revision})]})}function so(e,t){let[n,r]=Je(e=>e+1,0),o=Date.now(),i=t?e.filter(e=>e.startedAt<=o&&o<e.expiresAt+2e3).map(e=>({presence:e,engaged:!e.ended&&o<e.expiresAt})):[],a=Math.min(...i.map(({presence:e,engaged:t})=>t?e.expiresAt:e.expiresAt+2e3));return De(()=>{if(!t||!Number.isFinite(a))return;let e=setTimeout(r,Math.max(0,a-Date.now()));return window.addEventListener("focus",r),document.addEventListener("visibilitychange",r),()=>{clearTimeout(e),window.removeEventListener("focus",r),document.removeEventListener("visibilitychange",r)}},[t,a,n]),i}export{Et as $,Vn as A,un as Aa,or as B,hn as Ba,ir as C,fn as Ca,ar as D,xn as Da,zr as E,Cn as Ea,Nr as F,Vr as G,Br as H,Lr as I,Wr as J,Zr as K,Fr as L,Dr as M,Or as N,_r as O,Kr as P,gt as Q,xt as R,vt as S,Ct as T,eo as U,wt as V,kt as W,It as X,St as Y,Mt as Z,$t as _,Ue as a,At as aa,et as b,Ht as ba,nt as c,jt as ca,wn as d,Pt as da,sr as e,zt as ea,ur as f,Nt as fa,bn as g,Vt as ga,Sn as h,Bt as ha,Mn as i,Wt as ia,$n as j,Dt as ja,pr as k,lo as ka,hr as l,Ot as la,mr as m,so as ma,fr as n,_t as na,ot as o,qt as oa,it as p,Yt as pa,at as q,Jt as qa,lt as r,Kt as ra,xr as s,Xt as sa,vr as t,Gt as ta,dt as u,Ut as ua,ct as v,en as va,ut as w,ln as wa,pt as x,sn as xa,ht as y,dn as ya,Nn as z,cn as za};
|
package/dist/chunk-TUXBMJQZ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{forwardRef as e,useId as t,useRef as n,useState as r,useLayoutEffect as o,useEffect as i}from"react";import{createPortal as l}from"react-dom";import{jsx as a,jsxs as d}from"react/jsx-runtime";var c=e(function({style:e,...t},n){return a("span",{...t,ref:n,role:"tooltip",style:{background:"var(--popmelt-thread-raised, #222)",color:"var(--popmelt-thread-primary, #eee)",borderRadius:16,boxSizing:"border-box",...e}})}),s=new WeakMap;function u(e){return e.closest("[data-popmelt-tooltip-group]")??e.parentElement}function p({hint:e,above:t,anchorRef:n,children:r,...o}){return a(h,{hint:e??o["aria-label"],above:t,anchorRef:n,children:e=>a("button",{type:"button",...o,"aria-describedby":e,children:r})})}function h({hint:e,above:p,anchorRef:h,children:m}){let f=t(),v=n(null),b=n(null),g=n(!1),y=n(!1),[x,w]=r("closed"),R="entering"===x||"instant"===x,E="closed"!==x?v.current:null,M=E?.closest('[data-popmelt-tooltip-boundary], [data-devtools="thread-panel"]'),L=E?.getRootNode(),W=M??(L&&"host"in L?L:E?.ownerDocument.body);function k(t,n){if(!e)return;let r=u(t),o=r&&s.get(r),i=!1;if(o&&o.tip!==b.current){let e=t.ownerDocument.defaultView;i=n&&!!e&&Number(e.getComputedStyle(o.tip).opacity)>0,o.close()}w(i?"instant":"entering")}return o(()=>{let e=b.current,t=E?.ownerDocument.defaultView;if(!E||!e||!t)return;let n=h?.current??E,r=()=>{let r=M?.getBoundingClientRect(),o=n.getBoundingClientRect(),i=Math.max(r?.left??0,0)+8,l=Math.min(r?.right??t.innerWidth,t.innerWidth)-8,a=Math.max(r?.top??0,0)+8,d=Math.min(r?.bottom??t.innerHeight,t.innerHeight)-8;e.style.maxWidth=Math.max(0,Math.min(180,l-i))+"px";let{width:c,height:s}=e.getBoundingClientRect();if(o.right<=i||o.left>=l||o.bottom<=a||o.top>=d||c>l-i||s>d-a)return void(e.style.visibility="hidden");let u=(e,t,n)=>Math.max(t,Math.min(e,n)),h=u(o.left+(o.width-c)/2,i,l-c),m=o.top-s-4,f=o.bottom+4,v=u((p?m>=a:f+s>d)?m:f,a,d-s);e.style.left=h-(r?.left??0)-(M?.clientLeft??0)+"px",e.style.top=v-(r?.top??0)-(M?.clientTop??0)+"px",e.style.visibility="visible"};r();let o=new t.ResizeObserver(r);o.observe(E),n!==E&&o.observe(n),o.observe(e),M&&o.observe(M);let i=E.getRootNode();return i.addEventListener("scroll",r,!0),t.addEventListener("resize",r),()=>{o.disconnect(),i.removeEventListener("scroll",r,!0),t.removeEventListener("resize",r)}},[E,h,M,p,e]),o(()=>{let e=E&&u(E),t=b.current;if(!e||!t)return;let n={tip:t,close:()=>w("closed")};return s.set(e,n),()=>{s.get(e)===n&&s.delete(e)}},[E]),o(()=>{let e=b.current,t=E?.ownerDocument.defaultView;if(!e||!t)return;let n="instant"!==x&&!t.matchMedia("(prefers-reduced-motion: reduce)").matches;if(e.style.transition=n?"opacity 120ms ease-out":"none","entering"===x&&t.getComputedStyle(e).opacity,e.style.opacity=R?"1":"0",!R){if(!n)return void w("closed");let e=t.setTimeout(()=>w("closed"),120);return()=>t.clearTimeout(e)}},[E,R,x]),i(()=>{let e=v.current?.ownerDocument;if(!R||!e)return;let t=e=>{"Escape"===e.key&&(w("closed"),e.stopPropagation())};return e.addEventListener("keydown",t,!0),()=>e.removeEventListener("keydown",t,!0)},[R]),d("span",{ref:v,style:{position:"relative",display:"inline-flex",minWidth:0},onPointerEnter:e=>{"touch"!==e.pointerType&&(g.current=!0,k(e.currentTarget,!0))},onPointerLeave:()=>{g.current=!1,y.current||w(e=>"closed"===e?e:"leaving")},onFocus:e=>{y.current=e.target.matches(":focus-visible"),y.current&&k(e.currentTarget,!1)},onBlur:()=>{y.current=!1,g.current||w(e=>"closed"===e?e:"leaving")},children:[m(R&&e?f:void 0),W&&e&&l(a(c,{ref:b,id:f,"aria-hidden":!R||void 0,style:{position:M?"absolute":"fixed",opacity:0,visibility:"hidden",background:"var(--popmelt-thread-action, #222)",color:"var(--popmelt-thread-on-action, #eee)",whiteSpace:"normal",overflowWrap:"anywhere",zIndex:20,width:"max-content",maxWidth:180,pointerEvents:"none",fontSize:12,fontWeight:500,lineHeight:1.35,padding:"5px 8px",borderRadius:8},children:e}),W)]})}export{c as a,p as b};
|
package/dist/chunk-V2I7PSJW.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";function t(t){return!(!t||"http://www.w3.org/1999/xhtml"!==t.namespaceURI&&"http://www.w3.org/2000/svg"!==t.namespaceURI)}export{t as a};
|
package/dist/chunk-WDAXARLI.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";import{b as e}from"./chunk-DOCRI237.mjs";import{a as t,b as n,h as a}from"./chunk-DJTGR3RO.mjs";import{b as i,a as o,c as r,d as s,e as l,s as m,r as c}from"./chunk-DC47WNPG.mjs";import{createContext as u,domToCanvas as p,destroyContext as h}from"modern-screenshot";import{useId as d,useState as f,useLayoutEffect as g}from"react";async function v(m,c){if(m&&m.pathname===location.pathname)try{let d=i(m),f=o(d.element),g=d.legacyScene||(f&&(f===d.element||d.element?.closest("svg,canvas"))?f:null),v=g?"component":"element",x=g??r(d,"element",!1);if(!x||x.closest("[data-popmelt-explore-original],[data-popmelt-explore-scene]"))return;let{width:b,height:w}=x.getBoundingClientRect();if(b<=0||w<=0)return;let y=getComputedStyle(x),$={capturedAt:Date.now(),backdrop:e(x),selector:m.selector,pathname:m.pathname,scope:v,width:b,height:w,viewport:{width:innerWidth,height:innerHeight},textFonts:l(x),style:Object.fromEntries(s.map(e=>[e,y.getPropertyValue(e)]))};try{let e=t(),i=c&&(x.matches("canvas")||x.querySelector("canvas"))?await n(e,c):[],o=await a(i,async()=>{let t=await n(e,()=>u(x,{width:Math.ceil(b),height:Math.ceil(w),scale:Math.min(2,512/Math.max(b,w)),timeout:1500,backgroundColor:$.backdrop,style:{margin:"0",position:"static",transform:"none"},filter:e=>!(e instanceof Element&&e.matches("[data-devtools],[data-popmelt-root],[data-popmelt-explore-preview]"))}));try{return await n(e,()=>p(t))}finally{h(t)}});for(;o.width&&o.height;){let e=o.toDataURL("image/webp",.8);if(e.length<=96e3&&/^data:image\/(webp|png);base64,/.test(e)){$.still=e;break}if(Math.max(o.width,o.height)<32)break;let t=document.createElement("canvas");t.width=Math.max(1,Math.floor(o.width/2)),t.height=Math.max(1,Math.floor(o.height/2)),t.getContext("2d").drawImage(o,0,0,t.width,t.height),o=t}}catch{}return $}catch{return}}async function x(e,t){let n=1===e.annotations.length&&e.annotations[0];n&&m(n.instruction??"")&&(e.exploreCapture=await v(c(n,location.pathname),t))}function b(e,t,n){let a=e.flatMap(({requestedAt:e,resolvedAt:a})=>Number.isFinite(e)&&Number.isFinite(a)?[[Math.max(t,e),Math.min(n,a)]]:[]).sort((e,t)=>e[0]-t[0]),i=t,o=0;for(let[e,t]of a)o+=Math.max(0,t-Math.max(i,e)),i=Math.max(i,t);return o}function w(e){let t=new Map,n=new Set;for(let a of e)if("approval"===a.type){let e=a.data.approval;t.set(e.id,e)}else("done"===a.type||"error"===a.type)&&n.add(String(a.data.jobId));return new Set([...t.values()].filter(e=>"pending"===e.status&&!n.has(e.jobId)).map(e=>e.jobId))}function y(e,t){if(!e?.frames?.length)return[];let n=new Map;for(let t of e.steps){let e=t.visuals?.afterFrameId;e&&!n.has(e)&&n.set(e,t.action?.label?`After ${t.action.label}`:"Resulting state")}return e.frames.flatMap((e,a)=>{let i=t[e.imageIndex];return i?[{id:e.id,imageIndex:e.imageIndex,label:0===a?"Initial state":n.get(e.id)??"State",url:i}]:[]})}function $(e){let t=e.instruction?.trim();return t?e.attachments?.some(e=>e.name?.trim()===t)?null:t:null}function M(e,t){let n=e?.tagName?.toLowerCase(),a=e?.id?`#${e.id}`:"",i=e?.className?`.${e.className.trim().split(/\s+/).slice(0,2).join(".")}`:"",o=n?`${n}${a}${i}`:t;return e?.reactComponent?`<${e.reactComponent}> ${o}`:o}function k(e){let t=e.elements?.[0]?.reactComponent||e.elements?.[0]?.tagName||e.linkedSelector,n=e.type&&"annotation"!==e.type?`${e.type} annotation`:"Annotation";return t?`${n} on ${t}`:n}function E(e){let t=e.annotations.map(e=>{let t=e.interactionEpisode?.steps.length??0;return{kind:"annotation",annotationId:e.id,pathname:e.pathname,text:$(e)??k(e),...t>0?{interactionEpisodeStepCount:t}:{}}}),n=new Map,a=e=>{let a=`${e.pathname??""}:${e.durableSelector??e.selector}`,i=n.get(a);if(i)return i.changes.push(e.text),void(void 0!==e.annotationNumber&&(void 0===i.annotationNumber||e.annotationNumber<i.annotationNumber)&&(i.annotationNumber=e.annotationNumber));let o={kind:"changes",elementKey:a,elementLabel:M(e.element,e.selector),...void 0!==e.annotationNumber?{annotationNumber:e.annotationNumber}:{},pathname:e.pathname,changes:[e.text]};n.set(a,o),t.push(o)};for(let t of e.styleModifications??[])for(let e of t.changes)a({...t,text:`${e.property}: ${e.original||"unset"} → ${e.modified||"unset"}${e.token?` (${e.token})`:""}`});for(let t of e.textModifications??[])a({...t,text:`Text: ${t.original||"empty"} → ${t.modified||"empty"}`});for(let t of e.domModifications??[])a({...t,text:"copy"===t.operation?"Copied element":"Moved element"});return e.spacingTokenChanges?.length&&t.push({kind:"changes",elementKey:"spacing-tokens",elementLabel:"Spacing tokens",changes:e.spacingTokenChanges.map(e=>`${e.tokenName}: ${e.originalPx}px → ${e.newPx}px`)}),t}function C(e){let t=e.annotations.flatMap(e=>{let t=$(e);return t?[{instruction:t,pathname:e.pathname}]:[]});if(0===t.length)return;if(new Set(t.map(e=>e.pathname).filter(Boolean)).size<=1)return t.map(e=>e.instruction).join("\n\n");let n=new Map;for(let e of t){let t=e.pathname||"(unknown)",a=n.get(t)??[];a.push(e.instruction),n.set(t,a)}return[...n.entries()].map(([e,t])=>`\`${e}\`\n${t.map(e=>`- ${e}`).join("\n")}`).join("\n")}function N(e,t=96){let n=e.replace(/\s+/g," ").trim();return n.length>t?`${n.slice(0,Math.max(0,t-3))}...`:n}function S(e,t){let n=d(),[a,i]=f(-1),[o,r]=f(!1),s=t.some(({suffix:e})=>e);g(()=>{let t=e.current;if(!t||!s)return;let n=()=>i(t.matches(":focus")&&t.selectionStart===t.selectionEnd?t.selectionEnd:-1),a=()=>i(-1);return n(),t.addEventListener("selectionchange",n),t.addEventListener("select",n),t.addEventListener("input",n),t.addEventListener("focus",n),t.addEventListener("blur",a),()=>{t.removeEventListener("selectionchange",n),t.removeEventListener("select",n),t.removeEventListener("input",n),t.removeEventListener("focus",n),t.removeEventListener("blur",a)}},[s,e]);let l=o?void 0:t.find(({start:e,token:t,suffix:n})=>n&&e+t.length===a);return{active:l,complete:function(e,t){let n=e.currentTarget;if(!l||"Tab"!==e.key||e.shiftKey||e.altKey||e.ctrlKey||e.metaKey||e.nativeEvent.isComposing||n.selectionStart!==a||n.selectionEnd!==a)return!1;e.preventDefault(),e.stopPropagation();let i=/\s/.test(n.value.charAt(a)),o=l.suffix+(i?"":" ");return n.ownerDocument.execCommand?.("insertText",!1,o)||(n.setRangeText(o,a,a,"end"),t()),i&&n.setSelectionRange(a+o.length+1,a+o.length+1),!0},hintId:n,inputProps:{"aria-autocomplete":l?"inline":void 0,"aria-describedby":l?n:void 0,onCompositionStart:()=>r(!0),onCompositionEnd:()=>r(!1)}}}function j(e,t,n){return n?.activePreview?n.annotationNumber:e??t}function L(e,t){return e?.trim()?e.trim():function(e){let t=e?.requestItems?.flatMap(e=>"annotation"===e.kind&&e.text.trim()?[e.text.trim()]:[]);if(t?.length)return t.join("; ");let n=e?.requestItems?.flatMap(e=>"changes"===e.kind?[`${e.elementLabel} [${e.changes.join(", ")}]`]:[]);return n?.length?n.join("; "):e?.requestText?.trim()||void 0}(t.find(e=>"human"===e.role))}export{v as a,x as b,b as c,w as d,y as e,E as f,C as g,N as h,S as i,j,L as k};
|
package/dist/chunk-WHJEKDNP.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use client";function t(t){if(typeof document<"u"&&t===document)return null;try{let e=t.defaultView?.frameElement;return"iframe"===e?.localName?e:null}catch{return null}}function e(t){if("iframe"!==t.localName||t.closest("[data-devtools],[data-popmelt-peer-surface]"))return null;try{let e=t.contentDocument;return e?.documentElement?e:null}catch{return null}}function n(t){let e=t.getBoundingClientRect(),n=t.offsetWidth?e.width/t.offsetWidth:1,r=t.offsetHeight?e.height/t.offsetHeight:1;return{x:e.left+t.clientLeft*n,y:e.top+t.clientTop*r,sx:n,sy:r}}function r(e,r){let{left:l,top:o,width:i,height:u}=e,a=t(r);for(;a;){let e=n(a);l=e.x+l*e.sx,o=e.y+o*e.sy,i*=e.sx,u*=e.sy,a=t(a.ownerDocument)}return new DOMRect(l,o,i,u)}function l(t){return r(t.getBoundingClientRect(),t.ownerDocument)}function o(e,r,l){let o=[],i=t(l);for(;i;)o.unshift(i),i=t(i.ownerDocument);for(let t of o){let l=n(t);e=(e-l.x)/l.sx,r=(r-l.y)/l.sy}return{x:e,y:r}}function i(t){return t.ownerDocument.defaultView??window}function u(t){return!(!t||"http://www.w3.org/1999/xhtml"!==t.namespaceURI)}function a(e,n=document){if(e===n)return!0;let r=t(e);return!(!r?.isConnected||r.contentDocument!==e||!a(r.ownerDocument,n))}function s(e,n){if(!a(n))return new DOMRect(0,0,0,0);let l=e.left,o=e.top,i=e.right,u=e.bottom;for(let e=t(n);e;e=t(e.ownerDocument)){let t=r({left:0,top:0,width:e.clientWidth,height:e.clientHeight},e.contentDocument);l=Math.max(l,t.left),o=Math.max(o,t.top),i=Math.min(i,t.right),u=Math.min(u,t.bottom)}return new DOMRect(l,o,Math.max(0,i-l),Math.max(0,u-o))}var f="@frame(";function c(t,e){return`${f}${encodeURIComponent(JSON.stringify({selector:t,url:e.URL}))}) `}function h(t){if(!t.startsWith(f))return null;let e=t.indexOf(") ");if(e<0)return null;try{let n=JSON.parse(decodeURIComponent(t.slice(7,e)));return"string"!=typeof n.selector||"string"!=typeof n.url?null:{...n,rest:t.slice(e+2)}}catch{return null}}var m=" >>> ";function d(t){return Array.from(t.querySelectorAll("*")).flatMap(t=>t.shadowRoot?[t.shadowRoot]:[])}function g(t=document){let e=[t];for(let t of e)e.push(...d(t));return e}function p(t,n=document){if(t.startsWith(f)){let r=h(t);if(!r)return null;let l=r.selector.startsWith(f)||r.selector.includes(m)?[p(r.selector,n)].filter(t=>!!t):g(n).flatMap(t=>Array.from(t.querySelectorAll(r.selector))),o=1===l.length?l[0]:null,i=o&&e(o);return i&&i.URL===r.url?p(r.rest,i):null}let r=t.split(m);if(r.length>1){let t=n,e=null;for(let n=0;n<r.length;n+=1){if(e=t.querySelector(r[n]),!e)return null;if(n<r.length-1){if(!e.shadowRoot)return null;t=e.shadowRoot}}return e}let l=[n];for(let e of l){let n=e.querySelector(t);if(n)return n;l.push(...d(e))}return null}function y(t){if(t.parentElement)return t.parentElement;let e=t.getRootNode();return"host"in e?e.host:null}function w(t,e){return e.startsWith(f)||e.includes(m)?p(e)===t:t.matches(e)}function b(t,e){let n=t;for(;n;){if(n.matches(e))return n;n=y(n)}return null}function S(t,e){let n=e;for(;n;){if(n===t)return!0;n=y(n)}return!1}var x=new WeakMap;function v(t){let e=t.getAttribute("style");return t.style.setProperty("pointer-events","auto","important"),()=>{null===e?t.removeAttribute("style"):t.setAttribute("style",e)}}function A(t,n,r,l=t=>[t],o){let i=[];for(let l of t.querySelectorAll("iframe")){if(!e(l))continue;let t=l.getBoundingClientRect();n<t.left||n>t.right||r<t.top||r>t.bottom||"none"===l.ownerDocument.defaultView?.getComputedStyle(l).pointerEvents&&i.push(v(l))}try{let e=()=>{let e="function"==typeof t.elementsFromPoint?t.elementsFromPoint(n,r):[],l=t.elementFromPoint?.(n,r)??null;return(l&&!e.includes(l)?[l,...e]:e).filter(e=>9===t.nodeType||e.getRootNode()===t)},i=e(),u=i;if(o){let n=function(t){let e=9===t.nodeType?t:t.ownerDocument,n="* { pointer-events: auto !important; }",r=[];try{let l=e.defaultView?.CSSStyleSheet;if(l?.prototype.replaceSync&&"adoptedStyleSheets"in t){let o=x.get(e);o||(o=new l,o.replaceSync(n),x.set(e,o));let i=[...t.adoptedStyleSheets];t.adoptedStyleSheets=[...i,o],r.push(()=>{t.adoptedStyleSheets=i})}else{let l=e.createElement("style");l.textContent=n,(9===t.nodeType?e.head??e.documentElement:t).appendChild(l),r.push(()=>l.remove())}for(let e of t.querySelectorAll('[style*="pointer-events"]'))"none"!==e.style.getPropertyValue("pointer-events")||"important"!==e.style.getPropertyPriority("pointer-events")||r.push(v(e))}catch(t){throw r.reverse().forEach(t=>t()),t}return()=>r.reverse().forEach(t=>t())}(t);try{u=e()}finally{n()}u=u.filter(t=>i.includes(t)||o(t))}return u.flatMap(l)}finally{i.forEach(t=>t())}}function R(t,n,r=document,l){let i=[],u=new Set,a=9===r.nodeType?r:r.ownerDocument,s=o(t,n,a);for(let o of g(r).reverse())for(let r of A(o,s.x,s.y,r=>{let o=e(r);return o?[...R(t,n,o,l),r]:[r]},l))u.has(r)||(u.add(r),i.push(r));return i}function C(){return m}var D=["id","data-testid","data-test","data-cy","data-popmelt-media-id","aria-label","name","href"],M=t=>t.replace(/\s+/g," ").trim();function O(t){return"id"===t||"data-popmelt-media-id"===t||/^data-(?:testid|test|cy)(?:-[a-z0-9_-]+)?$/.test(t)}function N(t,e){return!(!(e&&e.length<=200)||"id"===t&&/^(radix-|:|_r_)/.test(e))}function W(t){let e={},n=new Set([...D,...t.getAttributeNames().filter(O)]);for(let r of n){let n=t.getAttribute(r);n&&N(r,n)&&(e[r]=n)}let r=M(t.querySelector("h1,h2,h3,h4,h5,h6")?.textContent??""),l=M(Array.from(t.childNodes).filter(t=>3===t.nodeType).map(t=>t.textContent).join(" "));return{tag:t.tagName.toLowerCase(),...Object.keys(e).length?{attributes:e}:{},...r&&r.length<=200?{heading:r}:{},...l&&l.length<=200?{text:l}:{}}}function E(t,e,n=document){let r=g(n),l=t=>{try{return r.flatMap(e=>Array.from(e.querySelectorAll(t)))}catch{return[]}},o=!(!e||!(e.heading||e.text||Object.keys(e.attributes??{}).length)),i=t=>{if(!e||!o)return!0;let n=W(t);return n.tag===e.tag&&(!e.heading||n.heading===e.heading)&&(!e.text||n.text===e.text)&&Object.entries(e.attributes??{}).every(([e,n])=>t.getAttribute(e)===n)};for(let r of t){if(r.includes(" >>> ")||r.startsWith("@frame(")){try{let t=p(r,n),l=h(r),o=Object.entries(e?.attributes??{}).filter(([t])=>O(t)),u=l&&t&&(l.rest.startsWith("[data-pm=")||o.length>0&&t.tagName.toLowerCase()===e?.tag&&o.every(([e,n])=>t.getAttribute(e)===n));if(t&&(u||i(t)))return{status:"matched",element:t}}catch{}continue}let t=l(r);if(1===t.length&&(/^\[data-pm=/.test(r)||!o))return{status:"matched",element:t[0]}}if(!o||t.some(t=>t.includes(" >>> ")||t.startsWith("@frame("))||!/^[a-z][a-z0-9-]*$/.test(e.tag))return{status:"missing"};let u=l(e.tag);if(u.length>500)return{status:"ambiguous"};let a=Object.entries(e.attributes??{}).filter(([t])=>O(t));if(a.length){let t=u.filter(t=>a.every(([e,n])=>t.getAttribute(e)===n));return 1===t.length?{status:"matched",element:t[0]}:{status:t.length?"ambiguous":"missing"}}let s=u.filter(i);return 1===s.length?{status:"matched",element:s[0]}:{status:s.length?"ambiguous":"missing"}}function q(t,e,n=document){let r={};if(e)for(let[t,n]of Object.entries({...e.dataAttributes,...e.id?{id:e.id}:{}}))O(t)&&N(t,n)&&(r[t]=n);let l=e?.targetFingerprint?.tag??e?.tagName?.toLowerCase(),o=e&&l?{...e.targetFingerprint,tag:l,attributes:{...r,...e.targetFingerprint?.attributes}}:e?.targetFingerprint,i=E([t,e?.selector].filter(t=>!!t),o,n);return"matched"===i.status?i.element:null}export{t as a,e as b,r as c,l as d,o as e,i as f,u as g,a as h,s as i,c as j,g as k,p as l,y as m,w as n,b as o,S as p,R as q,C as r,O as s,W as t,E as u,q as v};
|