@popmelt.com/core 0.33.1 → 0.35.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 +23 -840
- package/THIRD_PARTY_NOTICES.md +46 -0
- package/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/codex-plugin/.codex-plugin/plugin.json +1 -1
- package/dist/ExploreAttachment-TTEKD4AU.mjs +1 -0
- package/dist/PagePreviewLayer-TJZOJBSD.mjs +1 -0
- package/dist/ParticipantRuntime-BQAOTSQZ.mjs +1 -0
- package/dist/PhoneHostGate-LNSDZOG2.mjs +1 -0
- package/dist/PopmeltTasteConnectedPane-NCCF7YUX.mjs +1 -0
- package/dist/{PreviewRuntime-LFPK56NW.mjs → PreviewRuntime-H2UOLP6T.mjs} +1 -1
- package/dist/QueuedReplies-LQUBEZ6K.mjs +1 -0
- package/dist/SuppliedContext-YKQSMF3J.mjs +1 -0
- package/dist/ThreadErrorCard-4MOA34C4.mjs +1 -0
- package/dist/ThreadPanel-T6IXWFLA.mjs +1 -0
- package/dist/adapter-react-three-fiber.d.mts +1 -1
- package/dist/bridge-entry.mjs +1 -1
- package/dist/bridgeSSEStream-K3UIMBTC.mjs +1 -0
- package/dist/{bridgeWebSocketStream-H3DCP4T3.mjs → bridgeWebSocketStream-2SUZUBE3.mjs} +1 -1
- package/dist/browser-runtime-HQM2Y6EL.mjs +1 -0
- package/dist/browser.d.mts +4 -4
- package/dist/browser.mjs +1 -1
- package/dist/{canvas-chat-note-NHYL3T6J.mjs → canvas-chat-note-MGAEUYJO.mjs} +1 -1
- package/dist/{checkFixture-MWBOYIM2.mjs → checkFixture-BXILOUP5.mjs} +1 -1
- package/dist/chunk-53SKVMWR.mjs +1 -0
- package/dist/chunk-57FM7XQV.mjs +1 -0
- package/dist/chunk-5D2ADU7H.mjs +1 -0
- package/dist/chunk-66VOM5NA.mjs +1 -0
- package/dist/chunk-67QNAAUC.mjs +1 -0
- package/dist/chunk-6LBPTCGC.mjs +1 -0
- package/dist/chunk-APP5IYTE.mjs +1 -0
- package/dist/chunk-AYDREFWN.mjs +1 -0
- package/dist/chunk-CRJPE33X.mjs +1 -0
- package/dist/chunk-DC47WNPG.mjs +1 -0
- package/dist/chunk-DJTGR3RO.mjs +1 -0
- package/dist/chunk-DOCRI237.mjs +1 -0
- package/dist/chunk-DOJBWTT5.mjs +1 -0
- package/dist/chunk-F45IVFS3.mjs +1 -0
- package/dist/chunk-G2ZHJXHZ.mjs +1 -0
- package/dist/{chunk-75PQGTKX.mjs → chunk-G7JR5Z3P.mjs} +1 -1
- package/dist/chunk-GKOMTSWV.mjs +1 -0
- package/dist/{chunk-EAV2VV2V.mjs → chunk-HAE5LUJX.mjs} +1 -1
- package/dist/chunk-HU2XWUJC.mjs +1 -0
- package/dist/{chunk-IKCHOC3U.mjs → chunk-HV7HRQ2S.mjs} +0 -1
- package/dist/chunk-KTRMNVPZ.mjs +1 -0
- package/dist/chunk-M5P6VHZY.mjs +1 -0
- package/dist/chunk-N4737FRL.mjs +1 -0
- package/dist/{chunk-JMMP5JSP.mjs → chunk-NDGM4DAP.mjs} +1 -1
- package/dist/chunk-NSCO633B.mjs +1 -0
- package/dist/{chunk-GASEZICN.mjs → chunk-OAHYSDJ4.mjs} +1 -1
- package/dist/chunk-PH2MLB3T.mjs +1 -0
- package/dist/chunk-PYGRFSUU.mjs +1 -0
- package/dist/chunk-Q6C7ZA3H.mjs +1 -0
- package/dist/chunk-Q6N77LIS.mjs +1 -0
- package/dist/chunk-Q74FBX2I.mjs +1 -0
- package/dist/chunk-R34FOW4D.mjs +1 -0
- package/dist/chunk-R3AJWOID.mjs +1 -0
- package/dist/chunk-RK6UROPO.mjs +1 -0
- package/dist/chunk-RR4SHK7O.mjs +1 -0
- package/dist/{chunk-GL4I4MI6.mjs → chunk-RUJC32MA.mjs} +1 -1
- package/dist/{chunk-2IASPT6L.mjs → chunk-RUTWU5W2.mjs} +1 -1
- package/dist/chunk-S7BCEQKP.mjs +1 -0
- package/dist/{chunk-HVD5ZG6W.mjs → chunk-T4CCY2EL.mjs} +1 -1
- package/dist/chunk-TH7DML4A.mjs +1 -0
- package/dist/chunk-UEGDSECJ.mjs +1 -0
- package/dist/chunk-WDAXARLI.mjs +1 -0
- package/dist/chunk-XG2YIAJS.mjs +1 -0
- package/dist/chunk-XM6RE6HT.mjs +1 -0
- package/dist/{chunk-DNOKP3JS.mjs → chunk-XT6PHPPG.mjs} +1 -1
- package/dist/chunk-Y3SF5YCR.mjs +1 -0
- package/dist/chunk-YFDD7HGT.mjs +1 -0
- package/dist/chunk-ZG6XHKYO.mjs +1 -0
- package/dist/chunk-ZG7MAEEV.mjs +30 -0
- package/dist/chunk-ZSL57PQ7.mjs +1 -0
- package/dist/chunk-ZVDKW7TO.mjs +1 -0
- package/dist/cli.mjs +1 -1
- package/dist/codex-note-context-OUG4S6XE.mjs +1 -0
- package/dist/codex-project-B5466BL6.mjs +1 -0
- package/dist/{codex-session-registry-SPRWY2WW.mjs → codex-session-registry-ONODFWFD.mjs} +1 -2
- package/dist/focus-inspection-SZJ5KP23.mjs +1 -0
- package/dist/index.d.mts +30 -5
- package/dist/index.mjs +1 -1
- package/dist/media.d.mts +3 -3
- package/dist/memory-store.mjs +1 -1
- package/dist/{participantBootstrap-ClKpD2qC.d.mts → participantBootstrap-DFJlcKRI.d.mts} +2 -2
- package/dist/peer-client-SCSWLRCX.mjs +1 -0
- package/dist/plugin-astro.mjs +1 -1
- package/dist/plugin-next.mjs +1 -1
- package/dist/plugin-nuxt.mjs +1 -1
- package/dist/plugin-vite.mjs +1 -1
- package/dist/server.d.mts +3 -3
- package/dist/server.mjs +1 -1
- package/dist/steerStyles-E76E44PI.mjs +1 -0
- package/dist/{subjects-EWAR5-0S.d.mts → subjects-DdavjSTL.d.mts} +12 -0
- package/dist/{video-adapter-BUMpNTCP.d.mts → video-adapter-DB6Hex1f.d.mts} +1 -1
- package/package.json +1 -3
- package/dist/ExploreAttachment-VKCCEIM7.mjs +0 -1
- package/dist/ParticipantRuntime-YS5SIZUQ.mjs +0 -1
- package/dist/PopmeltTasteConnectedPane-FKIJM3C7.mjs +0 -1
- package/dist/QueuedReplies-ZYUDSTS2.mjs +0 -1
- package/dist/SuppliedContext-RWN6UR3K.mjs +0 -1
- package/dist/ThreadErrorCard-7J62GD5W.mjs +0 -1
- package/dist/ThreadPanel-KVNM67WO.mjs +0 -1
- package/dist/bridgeSSEStream-NEYI73TC.mjs +0 -1
- package/dist/browser-runtime-AP35S5MK.mjs +0 -1
- package/dist/chunk-27ADDVGC.mjs +0 -1
- package/dist/chunk-2VCHBI7Y.mjs +0 -1
- package/dist/chunk-2ZJ4FBTG.mjs +0 -1
- package/dist/chunk-6V2VCKPG.mjs +0 -1
- package/dist/chunk-6VXFTT5U.mjs +0 -1
- package/dist/chunk-BVTLSUQT.mjs +0 -1
- package/dist/chunk-CPOYMGYY.mjs +0 -1
- package/dist/chunk-H7XMDLGU.mjs +0 -30
- package/dist/chunk-N2QUNHV6.mjs +0 -1
- package/dist/chunk-N6JTX4PD.mjs +0 -2
- package/dist/chunk-ODIGT4YJ.mjs +0 -1
- package/dist/chunk-PSSHCTJ2.mjs +0 -1
- package/dist/chunk-QOJCTLQW.mjs +0 -1
- package/dist/chunk-RESPUCV7.mjs +0 -1
- package/dist/chunk-SHAIHRV2.mjs +0 -1
- package/dist/chunk-VPPVURBR.mjs +0 -2
- package/dist/chunk-W5NIRROD.mjs +0 -1
- package/dist/chunk-XKD2ABCO.mjs +0 -1
- package/dist/chunk-YLKEDOII.mjs +0 -31
- package/dist/chunk-ZHJZPC7U.mjs +0 -1
- package/dist/codex-note-context-4JYQ437H.mjs +0 -2
- package/dist/codex-project-FA4EK6VR.mjs +0 -2
- package/dist/focus-inspection-VBS5656D.mjs +0 -1
- package/dist/peer-client-KJCPXT76.mjs +0 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";var e={production:{issuer:"https://popmelt.com",resource:"https://mcp.popmelt.com"},staging:{issuer:"https://webapp-staging-1bed.up.railway.app",resource:"https://mcp-staging-8731.up.railway.app"}};function t(t){if("string"!=typeof t)throw new Error("Unexpected sign-in destination.");let r=new URL(t);if(!Object.values(e).some(({issuer:e})=>r.origin===e)||"/mcp/grant"!==r.pathname||r.username||r.password||r.hash)throw new Error("Unexpected sign-in destination.");return r}export{t as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){if(e.length>256e3)throw Error("Paragraph draft is too large.");let t=JSON.parse(e);if(!Array.isArray(t)||!t.length||t.length>4096||t.some(e=>!(e&&Array.isArray(e.path)&&e.path.length&&!(e.path.length>128)&&e.path.every(e=>"number"==typeof e&&Number.isSafeInteger(e)&&e>=0)&&Array.isArray(e.parts)&&e.parts.length&&e.parts.every(e=>"string"==typeof e)))||t.reduce((e,t)=>e+t.parts.length-1,0)>512)throw Error("Invalid paragraph draft.");return t}var t=["slate","gray","zinc","neutral","stone","red","orange","amber","yellow","lime","green","emerald","teal","cyan","sky","blue","indigo","violet","purple","fuchsia","pink","rose"],r=[50,100,200,300,400,500,600,700,800,900,950],o={slate:{50:"#f8fafc",100:"#f1f5f9",200:"#e2e8f0",300:"#cbd5e1",400:"#94a3b8",500:"#64748b",600:"#475569",700:"#334155",800:"#1e293b",900:"#0f172a",950:"#020617"},gray:{50:"#f9fafb",100:"#f3f4f6",200:"#e5e7eb",300:"#d1d5db",400:"#9ca3af",500:"#6b7280",600:"#4b5563",700:"#374151",800:"#1f2937",900:"#111827",950:"#030712"},zinc:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#a1a1aa",500:"#71717a",600:"#52525b",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},neutral:{50:"#fafafa",100:"#f5f5f5",200:"#e5e5e5",300:"#d4d4d4",400:"#a3a3a3",500:"#737373",600:"#525252",700:"#404040",800:"#262626",900:"#171717",950:"#0a0a0a"},stone:{50:"#fafaf9",100:"#f5f5f4",200:"#e7e5e4",300:"#d6d3d1",400:"#a8a29e",500:"#78716c",600:"#57534e",700:"#44403c",800:"#292524",900:"#1c1917",950:"#0c0a09"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},orange:{50:"#fff7ed",100:"#ffedd5",200:"#fed7aa",300:"#fdba74",400:"#fb923c",500:"#f97316",600:"#ea580c",700:"#c2410c",800:"#9a3412",900:"#7c2d12",950:"#431407"},amber:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},yellow:{50:"#fefce8",100:"#fef9c3",200:"#fef08a",300:"#fde047",400:"#facc15",500:"#eab308",600:"#ca8a04",700:"#a16207",800:"#854d0e",900:"#713f12",950:"#422006"},lime:{50:"#f7fee7",100:"#ecfccb",200:"#d9f99d",300:"#bef264",400:"#a3e635",500:"#84cc16",600:"#65a30d",700:"#4d7c0f",800:"#3f6212",900:"#365314",950:"#1a2e05"},green:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},emerald:{50:"#ecfdf5",100:"#d1fae5",200:"#a7f3d0",300:"#6ee7b7",400:"#34d399",500:"#10b981",600:"#059669",700:"#047857",800:"#065f46",900:"#064e3b",950:"#022c22"},teal:{50:"#f0fdfa",100:"#ccfbf1",200:"#99f6e4",300:"#5eead4",400:"#2dd4bf",500:"#14b8a6",600:"#0d9488",700:"#0f766e",800:"#115e59",900:"#134e4a",950:"#042f2e"},cyan:{50:"#ecfeff",100:"#cffafe",200:"#a5f3fc",300:"#67e8f9",400:"#22d3ee",500:"#06b6d4",600:"#0891b2",700:"#0e7490",800:"#155e75",900:"#164e63",950:"#083344"},sky:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},blue:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},indigo:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},violet:{50:"#f5f3ff",100:"#ede9fe",200:"#ddd6fe",300:"#c4b5fd",400:"#a78bfa",500:"#8b5cf6",600:"#7c3aed",700:"#6d28d9",800:"#5b21b6",900:"#4c1d95",950:"#2e1065"},purple:{50:"#faf5ff",100:"#f3e8ff",200:"#e9d5ff",300:"#d8b4fe",400:"#c084fc",500:"#a855f7",600:"#9333ea",700:"#7e22ce",800:"#6b21a8",900:"#581c87",950:"#3b0764"},fuchsia:{50:"#fdf4ff",100:"#fae8ff",200:"#f5d0fe",300:"#f0abfc",400:"#e879f9",500:"#d946ef",600:"#c026d3",700:"#a21caf",800:"#86198f",900:"#701a75",950:"#4a044e"},pink:{50:"#fdf2f8",100:"#fce7f3",200:"#fbcfe8",300:"#f9a8d4",400:"#f472b6",500:"#ec4899",600:"#db2777",700:"#be185d",800:"#9d174d",900:"#831843",950:"#500724"},rose:{50:"#fff1f2",100:"#ffe4e6",200:"#fecdd3",300:"#fda4af",400:"#fb7185",500:"#f43f5e",600:"#e11d48",700:"#be123c",800:"#9f1239",900:"#881337",950:"#4c0519"}},a=["padding","margin","border","radius","stack","grid","text","color","transform","opacity"],i=[0,1,2,3,4,6,8,10,12,16],f=[-16,-12,-10,-8,-6,-4,-3,-2,-1,0,1,2,3,4,6,8,10,12,16],n=["vertical","horizontal"],l=["stretch","start","center","end","baseline"],d=["start","center","end","between","around","evenly"],c=[1,2,3,4,5,6],s=["xs","sm","base","lg","xl","2xl","3xl","4xl"],p=[300,400,500,600,700,800],u=["none","tight","snug","normal","relaxed","loose"],g=["tighter","tight","normal","wide","wider","widest"],b=["left","center","right","justify"],m=[25,50,75,90,95,100,105,110,125,150],h=[-180,-90,-45,-25,-12,-6,-3,-2,-1,0,1,2,3,6,12,25,45,90,180],y=[0,5,10,20,25,30,40,50,60,70,75,80,90,95,100],x=["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],w={padding:i,margin:i,border:[0,1,2,4,8],radius:i},$={padding:"p",margin:"m",border:"border",radius:"rounded",stack:"flex",grid:"grid",text:"text",color:"text",transform:"transform",opacity:"opacity"},k={padding:"Padding",margin:"Margin",border:"Borders",radius:"Radii",stack:"Flexbox",grid:"Grid",text:"Fonts",color:"Background",transform:"Transform",opacity:"Opacity"},v={padding:["all","x","y","top","right","bottom","left"],margin:["all","x","y","top","right","bottom","left"],border:["all","top","right","bottom","left","color"],radius:["all","top-left","top-right","bottom-right","bottom-left"],stack:["direction","gap","align","justify"],grid:["gap","rows","columns"],text:["size","weight","line-height","letter-spacing","text-align","color"],color:t,transform:["translate","scale","rotate"],opacity:["opacity","mix-blend"]};function S(e){return t.includes(e)}var E=e=>encodeURIComponent(e),I=e=>`%3Cdefs%3E%3Cfilter id='cursor-shadow' x='-35%25' y='-35%25' width='170%25' height='180%25'%3E%3CfeDropShadow dx='0' dy='.5' stdDeviation='.35' flood-color='black' flood-opacity='.22'/%3E%3CfeDropShadow dx='0' dy='.75' stdDeviation='.65' flood-color='${E(e)}' flood-opacity='.42'/%3E%3CfeDropShadow dx='0' dy='1.25' stdDeviation='1.1' flood-color='${E(e)}' flood-opacity='.24'/%3E%3C/filter%3E%3C/defs%3E`;function j(e,t="all"){let o=N(e,t);return"color"===e||("text"===e||"border"===e)&&function(e,t){return"color"===e||("text"===e||"border"===e)&&("color"===t||S(t))}(e,o)?r:"stack"===e?"direction"===o?n:"align"===o?l:"justify"===o?d:i:"grid"===e?"gap"===o?i:c:"text"===e?"weight"===o?p:"line-height"===o?u:"letter-spacing"===o?g:"text-align"===o?b:s:"transform"===e?"scale"===o?m:"rotate"===o?h:f:"opacity"===e?"mix-blend"===o?x:y:w[e]}function O(e){return v[e]}function N(e,t){if("stack"===e&&("vertical"===t||"horizontal"===t))return"direction";if(("text"===e||"border"===e)&&S(t))return t;let r=O(e);return r.includes(t)?t:r[0]}function z(e){return k[e]}function A(e,t){let r=N(e,t);if("color"===e)return"background-color";if("stack"===e)return"direction"===r?"flex-direction":"align"===r?"align-items":"justify"===r?"justify-content":"gap";if("grid"===e)return"rows"===r?"grid-template-rows":"columns"===r?"grid-template-columns":"gap";if("text"===e)return"color"===r||S(r)?"color":"weight"===r?"font-weight":"line-height"===r?"line-height":"letter-spacing"===r?"letter-spacing":"text-align"===r?"text-align":"font-size";if("border"===e&&("color"===r||S(r)))return"border-color";if("transform"===e)return r;if("opacity"===e)return"mix-blend"===r?"mix-blend-mode":"opacity";if("radius"===e)return"all"===r?"border-radius":`border-${r}-radius`;let o="border"===e?"border":e,a="border"===e?"width":"";return"all"===r?a?`${o}-${a}`:o:"padding"!==e&&"margin"!==e||"x"!==r?"padding"!==e&&"margin"!==e||"y"!==r?a?`${o}-${r}-${a}`:`${o}-${r}`:`${o}-top`:`${o}-left`}function C(e){let t=N("border",e);return"all"===t?"border-style":`border-${t}-style`}function D(e,t,r){let o=N(e,r);if("color"===e)return`bg-${o}-${t}`;if("stack"===e)return"direction"===o?"horizontal"===t?"flex-row":"flex-col":"gap"===o?`gap-${t}`:"align"===o?`items-${t}`:`justify-${t}`;if("grid"===e)return"gap"===o?`gap-${t}`:`${"rows"===o?"grid-rows":"grid-cols"}-${t}`;if("text"===e)return S(o)?`text-${o}-${t}`:"size"===o?`text-${t}`:"weight"===o?J[t]:"line-height"===o?`leading-${t}`:"letter-spacing"===o?`tracking-${t}`:`text-${t}`;if("border"===e&&S(o))return`border-${o}-${t}`;if("transform"===e)return`${o}-${t}`;if("opacity"===e)return"mix-blend"===o?`mix-blend-${t}`:`opacity-${t}`;let a=$[e];if("all"===o)return`${a}-${t}`;let i="top-left"===o?"tl":"top-right"===o?"tr":"bottom-right"===o?"br":"bottom-left"===o?"bl":o[0];return"padding"===e||"margin"===e?`${a}${i}-${t}`:`${a}-${i}-${t}`}function M(e,t,r="all"){let a=N(e,r);if("color"===e||("text"===e||"border"===e)&&S(a))return function(e,t){return o[e][t]}(a,t);if("stack"===e){if("direction"===a)return"horizontal"===t?"row":"column";if("align"===a)return"start"===t?"flex-start":"end"===t?"flex-end":String(t);if("justify"===a)return"start"===t?"flex-start":"end"===t?"flex-end":"between"===t||"around"===t||"evenly"===t?`space-${t}`:String(t)}return"grid"===e&&"gap"!==a?`repeat(${t}, minmax(0, 1fr))`:"text"===e?"size"===a?`${F[t]}px`:"weight"===a?String(t):"line-height"===a?String(R[t]):"letter-spacing"===a?`${U[t]}em`:String(t):"transform"===e?"scale"===a?String(Number(t)/100):"rotate"===a?`${t}deg`:`${4*Number(t)}px ${4*Number(t)}px`:"opacity"===e?String("mix-blend"===a?t:Number(t)/100):"number"!=typeof t?"0px":`${"border"===e?t:4*t}px`}function P(e,t,r){let o=N(e,t);return"padding"!==e&&"margin"!==e||"x"!==o&&"y"!==o?[]:[{property:"x"===o?`${e}-right`:`${e}-bottom`,value:M(e,r??0,o),token:D(e,r??0,o)}]}function B(e){return"stack"===e?"flex":"grid"===e?"grid":null}(function(e="black"){I(e),E(e)})(),function(e="black"){I(e),E(e)}();var F={xs:12,sm:14,base:16,lg:18,xl:20,"2xl":24,"3xl":30,"4xl":36},J={300:"font-light",400:"font-normal",500:"font-medium",600:"font-semibold",700:"font-bold",800:"font-extrabold"},R={none:1,tight:1.25,snug:1.375,normal:1.5,relaxed:1.625,loose:2},U={tighter:-.05,tight:-.025,normal:0,wide:.025,wider:.05,widest:.1};function G(e){return e.selection?`${e.selection.family}:${e.selection.subproperty}`:`custom:${e.custom.property}`}function T(e){return e.sticker?{token:e.sticker.axisSteps?`translate-x-${e.sticker.axisSteps.x}-y-${e.sticker.axisSteps.y}`:D(e.sticker.family,e.sticker.step,e.sticker.subproperty),selection:e.sticker}:{token:e.modified,custom:{property:e.property,value:e.modified}}}var W=/^(?:@[a-zA-Z][\w-]{0,63}|~?(?:0|[1-9]\d{0,3})(?:\.(?:0|[1-9]\d{0,3})){0,31}|)$/;function Z(e,t){let r="text"===t?e.replace(/\/text\/(?:0|[1-9]\d{0,3})$/,""):e;return W.test(r)}function q(e){let t=new Map;for(let r of e){let e=JSON.stringify([r.batchId,r.option,r.part]),o=t.get(e);o||(o={element:r,dimensions:new Map},t.set(e,o));let a=T({property:r.property,original:r.from,modified:"paragraphs"===r.property?"Paragraphs":r.to,sticker:r.sticker}),i=G(a),f=o.dimensions.get(i);f?f.edits.push(r):o.dimensions.set(i,{chip:a,edits:[r]})}return t}function H(e,t){let r=new Map;for(let o of[...e,...t]){let e=o.part+":"+o.property,t=r.get(e)?.from??o.from;t===o.to?r.delete(e):(r.delete(e),r.set(e,{...o,from:t}))}return[...r.values()]}function K(e){let t=Object.create(null);for(let{batchId:r,option:o,part:a,property:i,to:f}of e){let e=t[r]??=Object.create(null),n=e[o]??=Object.create(null);(n[a]??=Object.create(null))[i]=f}return t}function L(e){if(void 0===e)return[];if(!Array.isArray(e)||e.length>512)throw new Error("Invalid Steer edits.");return e.map(e=>{let t=Q(e);if("paragraphs"!==t.property&&t.from.length>512)throw new Error("Invalid Steer edit.");if("text"===t.property&&(!t.to.trim()||t.to.length>220))throw new Error("Option text must contain 1–220 characters.");return t})}function Q(t){if(!t||"object"!=typeof t)throw new Error("Invalid Steer edit.");let{batchId:r,option:o,part:i,property:f,from:n,to:l,sticker:d}=t;if("string"!=typeof r||"number"!=typeof o||!Number.isInteger(o)||"string"!=typeof i||"string"!=typeof f||"string"!=typeof n||"string"!=typeof l||("text"===f||"paragraphs"===f)&&void 0!==d)throw new Error("Invalid Steer edit.");"paragraphs"===f?(e(n),e(l)):"text"!==f&&_({[f]:l});let c={batchId:r,option:o,part:i,property:f,from:n,to:l};if(void 0===d)return c;let{family:s,subproperty:p,step:u,axisSteps:g}=d;if(!a.includes(s)||N(s,p)!==p||!j(s,p).includes(u))throw new Error("Invalid Steer dimension.");let b={family:s,subproperty:p,step:u};if(void 0===g)return{...c,sticker:b};let m=j("transform","translate");if("transform"!==s||"translate"!==p||!m.includes(g.x)||!m.includes(g.y))throw new Error("Invalid Steer translation.");return{...c,sticker:{...b,axisSteps:{x:g.x,y:g.y}}}}var V=new Map;function X(e,t){V.has(e)||V.set(e,new Set),V.get(e).add(t)}for(let e of a){let r=B(e);r&&X("display",r);for(let r of O(e))for(let o of"color"===r?t:[r]){let t=j(e,o);for(let r of t){let a=A(e,o);X(a,M(e,r,o));for(let t of P(e,o,r))X(t.property,t.value);if("border"===e&&a.endsWith("width")&&X(C(o),"solid"),"translate"===a)for(let e of t)X(a,4*Number(r)+"px "+4*Number(e)+"px")}}}function Y(e){if(!e||"object"!=typeof e||Array.isArray(e))throw new Error("Invalid Steer draft.");return Object.entries(e)}function _(e){return Object.fromEntries(Y(e).map(([e,t])=>{if("string"!=typeof t||!V.get(e)?.has(t))throw new Error("Unsupported Steer declaration: "+e);return[e,t]}))}function ee(t,r){if(void 0===r)return t;let o=structuredClone(t);for(let[t,a]of Y(r)){let r=o.messages.find(e=>e.batch?.id===t)?.batch;if(!r)throw new Error("Steer draft refers to an unknown batch.");for(let[t,o]of Y(a)){let a=/^[0-5]$/.test(t)&&r.options[Number(t)];if(!a)throw new Error("Steer draft refers to an unknown option.");for(let[t,r]of Y(o)){if("fixture"in a){if(!Y(r).every(([e])=>Z(t,e)))throw new Error("Invalid fixture part.");let{text:o,paragraphs:a,...i}=Object.fromEntries(Y(r));if(void 0!==o&&"string"!=typeof o)throw new Error("Invalid fixture text.");if(void 0!==a){if("string"!=typeof a)throw Error("Invalid paragraph draft.");e(a)}_(i);continue}if(!/^(?:[0-7](?:\.[0-7]){0,3})?(?:\/label)?$/.test(t))throw new Error("Invalid specimen path.");let[o,i]=t.split("/"),f=a.root;for(let e of o?o.split("."):[])f=f?.children?.[Number(e)];if(!f||i&&(!f.label||"text"===f.kind))throw new Error("Steered element no longer exists.");let{text:n,...l}=Object.fromEntries(Y(r));if(void 0!==n){if("string"!=typeof n||!i&&"text"!==f.kind)throw new Error("Invalid specimen text.");f.label=n}if(Object.keys(l).length){let e=i?"labelStyle":"style";f[e]={...f[e],..._(l)}}}}}return o}export{t as a,a as b,j as c,O as d,z as e,D as f,M as g,q as h,H as i,K as j,L as k,Q as l,_ as m,ee as n};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";function t(t){return t<=480}function n(n){return t(n)?8:16}function a(t){let a=n(t);return t<=480?Math.max(0,t-2*a):Math.min(360,Math.max(0,t-2*a))}export{t as a,n as b,a as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";function t(t){let e=t.map(t=>{let e=t/255;return e<=.04045?e/12.92:((e+.055)/1.055)**2.4});return.2126*e[0]+.7152*e[1]+.0722*e[2]}function e(e,n){let l=t(e),a=t(n);return(Math.max(l,a)+.05)/(Math.min(l,a)+.05)}function n(){if(typeof CanvasRenderingContext2D>"u")return;let t=document.createElement("canvas");t.width=t.height=1;let e=t.getContext("2d",{willReadFrequently:!0});return e?(t,n)=>{e.fillStyle=n,e.fillRect(0,0,1,1),e.fillStyle=t,e.fillRect(0,0,1,1);let l=e.getImageData(0,0,1,1).data;return[l[0],l[1],l[2]]}:void 0}export{t as a,e as b,n as c};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use client";function e(t,r,a){if(null===t||"string"==typeof t||"boolean"==typeof t)return;if("number"==typeof t){if(!Number.isFinite(t))throw new TypeError(`Comment metadata at ${r} must be finite.`);return}if("object"!=typeof t)throw new TypeError(`Comment metadata at ${r} must be JSON-serializable.`);if(a.has(t))throw new TypeError(`Comment metadata at ${r} contains a cycle.`);let o=Object.getPrototypeOf(t);if(!Array.isArray(t)&&o!==Object.prototype&&null!==o)throw new TypeError(`Comment metadata at ${r} must use plain objects and arrays.`);if(a.add(t),Array.isArray(t))t.forEach((t,o)=>e(t,`${r}[${o}]`,a));else for(let[o,n]of Object.entries(t))e(n,`${r}.${o}`,a);a.delete(t)}function t(t){if(void 0===t)return;if(null===t||Array.isArray(t)||"object"!=typeof t)throw new TypeError("Comment metadata must be a JSON object.");e(t,"meta",new Set);let r=JSON.stringify(t);if((new TextEncoder).encode(r).byteLength>65536)throw new RangeError("Comment metadata exceeds the 65536 byte limit.");return JSON.parse(r)}export{t as a};
|