ryugi-artifacts 1.51.1 → 1.51.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli.cjs +4 -4
- package/dist/server.cjs +1 -1
- package/dist/viewer/{ArtboardLayout-BZVGyDSM.js → ArtboardLayout-C5W1_hsL.js} +1 -1
- package/dist/viewer/Canvas-Cv06--ID.js +1 -0
- package/dist/viewer/{PreviewLayout-VfoLatHx.js → PreviewLayout-a_8RK85I.js} +2 -2
- package/dist/viewer/index.js +2 -2
- package/dist/viewer/preview.html +1 -1
- package/dist/viewer/preview.js +1 -1
- package/dist/viewer-lib/Canvas-K9UeSg4j.js +1371 -0
- package/dist/viewer-lib/{PreviewView-C4H6LbEb.js → PreviewView-cwr1vkQ0.js} +1 -1
- package/dist/viewer-lib/core.js +1 -1
- package/dist/viewer-lib/index.js +21 -21
- package/package.json +1 -1
- package/dist/viewer/Canvas-m5zHdW7S.js +0 -1
- package/dist/viewer-lib/Canvas-DOK6z2BX.js +0 -568
|
@@ -233,7 +233,7 @@ var $ = {
|
|
|
233
233
|
kgSjnq: "xcdf9qb",
|
|
234
234
|
$$css: !0
|
|
235
235
|
}
|
|
236
|
-
}, te = o(() => import("./shims.js").then(() => import("./SnapshotDocument-xXPe1i3_.js").then((e) => e.n))), ne = o(() => import("./Canvas-
|
|
236
|
+
}, te = o(() => import("./shims.js").then(() => import("./SnapshotDocument-xXPe1i3_.js").then((e) => e.n))), ne = o(() => import("./Canvas-K9UeSg4j.js").then((e) => e.n).then(({ Canvas: e }) => ({ default: e }))), re = () => () => {}, ie = () => {}, ae = /* @__PURE__ */ new Set();
|
|
237
237
|
function oe({ type: t, id: r, data: a, failed: o }) {
|
|
238
238
|
let { t: s } = e(), [d, f] = l(() => ({
|
|
239
239
|
width: innerWidth,
|
package/dist/viewer-lib/core.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import './stylex-Bl4LaHjz.css';
|
|
2
|
-
import { C as e, D as t, E as n, O as r, S as i, T as a, b as o, g as s, h as c, k as l, t as u, w as d, x as f, y as p } from "./PreviewView-
|
|
2
|
+
import { C as e, D as t, E as n, O as r, S as i, T as a, b as o, g as s, h as c, k as l, t as u, w as d, x as f, y as p } from "./PreviewView-cwr1vkQ0.js";
|
|
3
3
|
import { _ as m, a as h, c as g, d as _, f as v, g as y, h as b, i as x, l as S, m as C, n as w, p as T, r as E, s as D, t as O, u as k } from "./i18n-B_9P4TsB.js";
|
|
4
4
|
export { p as ARTIFACT_LOCATOR_SOURCE, n as ARTIFACT_TYPES, t as BOARD_TYPES, S as HTML_LANG, u as PreviewView, D as RELAY_REJECTED_CODE, O as Trans, s as ViewerProvider, l as cloudErrorDetails, w as createViewerI18n, E as i18n, o as isArtifactAddress, f as isArtifactId, i as isArtifactLocator, e as isArtifactType, r as isMediaBoard, d as isMintedArtifactId, v as isVisibility, a as mintArtifactId, T as ownLink, k as parseAcceptLanguage, C as publishState, b as publishing, y as readPublication, g as relayRejection, _ as resolveLocale, m as syncNote, x as t, c as useSystemTheme, h as useTranslation };
|
package/dist/viewer-lib/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import './stylex-Bl4LaHjz.css';
|
|
2
2
|
import './index-DLyi-yDq.css';
|
|
3
|
-
import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, a as s, b as c, c as l, f as u, g as d, h as f, i as p, k as m, l as h, m as g, n as _, o as v, p as y, r as b, s as x, t as S, u as C, v as ee, w, x as T, y as E } from "./PreviewView-
|
|
3
|
+
import { C as e, D as t, E as n, O as r, S as i, T as a, _ as o, a as s, b as c, c as l, f as u, g as d, h as f, i as p, k as m, l as h, m as g, n as _, o as v, p as y, r as b, s as x, t as S, u as C, v as ee, w, x as T, y as E } from "./PreviewView-cwr1vkQ0.js";
|
|
4
4
|
import { $ as D, At as O, Ct as k, Dt as A, Et as te, Ft as j, H as M, It as N, Mt as ne, Nt as re, Ot as ie, P as ae, Pt as oe, Q as P, R as F, S as se, St as I, Tt as L, U as R, W as ce, X as le, Y as ue, _t as de, a as z, at as fe, bt as pe, dt as me, f as he, ft as ge, gt as _e, ht as ve, i as ye, it as B, jt as V, kt as H, l as be, lt as xe, m as Se, mt as Ce, n as we, ot as Te, q as Ee, r as De, rt as Oe, s as ke, st as Ae, t as je, tt as Me, vt as Ne, wt as Pe, x as Fe, xt as Ie, y as Le, yt as Re } from "./motion-CEJYVOkn.js";
|
|
5
5
|
import { _ as ze, a as Be, c as Ve, d as He, f as Ue, g as We, h as Ge, i as U, l as Ke, m as qe, n as Je, o as W, p as Ye, r as Xe, s as Ze, t as Qe, u as $e } from "./i18n-B_9P4TsB.js";
|
|
6
6
|
import { a as et, c as tt, d as nt, f as rt, h as it, l as at, m as ot, n as st, o as ct, p as lt, t as ut, u as dt } from "./WarningsBadge-DU-Jdq4l.js";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
7
|
+
import { a as ft, c as pt, i as mt, l as ht, o as gt, r as _t, s as vt, t as yt, u as bt } from "./Canvas-K9UeSg4j.js";
|
|
8
|
+
import { t as xt } from "./tokens.stylex-CuqOcC9Y.js";
|
|
9
9
|
import * as G from "react";
|
|
10
10
|
import { memo as St, useCallback as K, useEffect as q, useEffectEvent as Ct, useId as wt, useLayoutEffect as Tt, useMemo as J, useRef as Y, useState as X, useSyncExternalStore as Et } from "react";
|
|
11
11
|
import { Fragment as Dt, jsx as Z, jsxs as Q } from "react/jsx-runtime";
|
|
@@ -1445,7 +1445,7 @@ function $r({ id: e, board: t, sandbox: n = "allow-scripts", src: i, interactive
|
|
|
1445
1445
|
height: t.h,
|
|
1446
1446
|
marginBottom: 36
|
|
1447
1447
|
},
|
|
1448
|
-
children: /* @__PURE__ */ Z(
|
|
1448
|
+
children: /* @__PURE__ */ Z(vt, {
|
|
1449
1449
|
barScale: 1,
|
|
1450
1450
|
barWidth: t.w,
|
|
1451
1451
|
src: i,
|
|
@@ -1591,7 +1591,7 @@ function li({ value: e, velocity: t }, n, r, i = 520, a = 28) {
|
|
|
1591
1591
|
}
|
|
1592
1592
|
//#endregion
|
|
1593
1593
|
//#region src/viewer/components/HandCursor.tsx
|
|
1594
|
-
var ui =
|
|
1594
|
+
var ui = xt.ink, di = 30, fi = "[data-hand-drawn], [data-hand-drawn] * { cursor: none !important; }", pi = (e) => Math.round(e * 100) / 100, mi = (e, t) => Math.abs(e.value - t) < 5e-4 && Math.abs(e.velocity) < .005;
|
|
1595
1595
|
function hi({ viewport: e, hand: t }) {
|
|
1596
1596
|
let n = Y(null), r = Y(t !== null), [i, a] = X(null), [o, s] = X({
|
|
1597
1597
|
pinch: 0,
|
|
@@ -1700,13 +1700,13 @@ function hi({ viewport: e, hand: t }) {
|
|
|
1700
1700
|
})]
|
|
1701
1701
|
}),
|
|
1702
1702
|
/* @__PURE__ */ Q("g", {
|
|
1703
|
-
fill:
|
|
1703
|
+
fill: xt.white,
|
|
1704
1704
|
children: [h, /* @__PURE__ */ Z("path", { d: ei })]
|
|
1705
1705
|
}),
|
|
1706
1706
|
/* @__PURE__ */ Z("path", {
|
|
1707
1707
|
d: d.d,
|
|
1708
1708
|
fill: "none",
|
|
1709
|
-
stroke:
|
|
1709
|
+
stroke: xt.white,
|
|
1710
1710
|
strokeLinecap: "round",
|
|
1711
1711
|
strokeWidth: "3.4"
|
|
1712
1712
|
}),
|
|
@@ -1721,13 +1721,13 @@ function hi({ viewport: e, hand: t }) {
|
|
|
1721
1721
|
/* @__PURE__ */ Z("path", {
|
|
1722
1722
|
d: f.d,
|
|
1723
1723
|
fill: "none",
|
|
1724
|
-
stroke:
|
|
1724
|
+
stroke: xt.white,
|
|
1725
1725
|
strokeLinecap: "round",
|
|
1726
1726
|
strokeWidth: "3.8"
|
|
1727
1727
|
}),
|
|
1728
1728
|
/* @__PURE__ */ Z("path", {
|
|
1729
1729
|
d: ei,
|
|
1730
|
-
fill:
|
|
1730
|
+
fill: xt.white
|
|
1731
1731
|
})
|
|
1732
1732
|
]
|
|
1733
1733
|
})] });
|
|
@@ -5415,7 +5415,7 @@ function Ql(e, t, n) {
|
|
|
5415
5415
|
showId: i + Zl + e.id <= r * a
|
|
5416
5416
|
};
|
|
5417
5417
|
}
|
|
5418
|
-
|
|
5418
|
+
xt.success, xt.danger;
|
|
5419
5419
|
var $l = (e, t) => new Date(e).toLocaleTimeString(t, {
|
|
5420
5420
|
hour: "2-digit",
|
|
5421
5421
|
minute: "2-digit",
|
|
@@ -5790,7 +5790,7 @@ function du({ view: e, boards: t, groups: n, allBoards: r, contentBase: i, versi
|
|
|
5790
5790
|
T !== null && t.map(([t, n]) => {
|
|
5791
5791
|
let r = x(n, e);
|
|
5792
5792
|
if (!r) return null;
|
|
5793
|
-
let l =
|
|
5793
|
+
let l = pt(a, n.file) && !o.has(t);
|
|
5794
5794
|
return /* @__PURE__ */ Z(ou, {
|
|
5795
5795
|
active: m === t,
|
|
5796
5796
|
board: n,
|
|
@@ -5798,7 +5798,7 @@ function du({ view: e, boards: t, groups: n, allBoards: r, contentBase: i, versi
|
|
|
5798
5798
|
contentBase: i,
|
|
5799
5799
|
fontsVersion: y,
|
|
5800
5800
|
id: t,
|
|
5801
|
-
interactive: l &&
|
|
5801
|
+
interactive: l && ht(n, a),
|
|
5802
5802
|
modified: f?.[t],
|
|
5803
5803
|
playing: s.has(t),
|
|
5804
5804
|
ready: l,
|
|
@@ -6214,7 +6214,7 @@ function wu(e, t) {
|
|
|
6214
6214
|
function Tu({ boards: e, versions: t, pending: n, view: i, viewport: a, active: o, gesturing: s }) {
|
|
6215
6215
|
let c = J(() => xu(), []), l = Y(/* @__PURE__ */ new Map()), u = Y(/* @__PURE__ */ new Map()), d = Y(/* @__PURE__ */ new Map()), f = Y(0), [p, m] = X(() => /* @__PURE__ */ new Map()), h = Y(p);
|
|
6216
6216
|
h.current = p;
|
|
6217
|
-
let [g, _] = X(Cu), [v, y] = X(0), b = K(() => y((e) => e + 1), []), x = J(() => e.filter(([e, i]) => !r(i) &&
|
|
6217
|
+
let [g, _] = X(Cu), [v, y] = X(0), b = K(() => y((e) => e + 1), []), x = J(() => e.filter(([e, i]) => !r(i) && pt(t, i.file) && !n.has(e)).map(([e, n]) => ({
|
|
6218
6218
|
id: e,
|
|
6219
6219
|
x: n.x,
|
|
6220
6220
|
y: n.y,
|
|
@@ -6710,7 +6710,7 @@ function Uu(e, t, n) {
|
|
|
6710
6710
|
}
|
|
6711
6711
|
//#endregion
|
|
6712
6712
|
//#region src/viewer/lib/inspector.ts
|
|
6713
|
-
var Wu = (e) => !!e && typeof e == "object" && !Array.isArray(e), Gu = (e, t) => typeof e == "string" && e.length <= t, Ku = (e) => typeof e == "number" && Number.isFinite(e) && Math.abs(e) <= 1e8, qu = (e) => Number.isSafeInteger(e) && e > 0, Ju = (e) => e === null || Wu(e) && Ku(e.x) && Ku(e.y) && Ku(e.width) && Ku(e.height) && e.width >= 0 && e.height >= 0, Yu = (e) =>
|
|
6713
|
+
var Wu = (e) => !!e && typeof e == "object" && !Array.isArray(e), Gu = (e, t) => typeof e == "string" && e.length <= t, Ku = (e) => typeof e == "number" && Number.isFinite(e) && Math.abs(e) <= 1e8, qu = (e) => Number.isSafeInteger(e) && e > 0, Ju = (e) => e === null || Wu(e) && Ku(e.x) && Ku(e.y) && Ku(e.width) && Ku(e.height) && e.width >= 0 && e.height >= 0, Yu = (e) => mt.includes(e), Xu = /* @__PURE__ */ new Set([
|
|
6714
6714
|
"Frame",
|
|
6715
6715
|
"Column",
|
|
6716
6716
|
"Row",
|
|
@@ -6755,7 +6755,7 @@ function Qu(e) {
|
|
|
6755
6755
|
"fixed",
|
|
6756
6756
|
"fill",
|
|
6757
6757
|
"hug"
|
|
6758
|
-
].includes(n.widthMode) && ["fixed", "hug"].includes(n.heightMode) && Wu(n.css) &&
|
|
6758
|
+
].includes(n.widthMode) && ["fixed", "hug"].includes(n.heightMode) && Wu(n.css) && mt.every((e) => Gu(n.css[e], 2e3));
|
|
6759
6759
|
break;
|
|
6760
6760
|
}
|
|
6761
6761
|
case "ryugi:inspect:targets":
|
|
@@ -7405,7 +7405,7 @@ function dd(e) {
|
|
|
7405
7405
|
wheelAt: ae,
|
|
7406
7406
|
panning: oe,
|
|
7407
7407
|
setSpaceHeld: o,
|
|
7408
|
-
cursor: s ? "grabbing" : oe ? "grab" : e === "comment" ?
|
|
7408
|
+
cursor: s ? "grabbing" : oe ? "grab" : e === "comment" ? _t : ft,
|
|
7409
7409
|
hand: s ? "pinch" : oe ? "open" : null,
|
|
7410
7410
|
handlers: {
|
|
7411
7411
|
onPointerDown: P,
|
|
@@ -9601,7 +9601,7 @@ function vf({ id: e, board: t, sandbox: n = "allow-scripts", src: i, siblings: a
|
|
|
9601
9601
|
height: t.h,
|
|
9602
9602
|
transform: `translate(${f.x}px, ${f.y}px) scale(${f.k})`
|
|
9603
9603
|
},
|
|
9604
|
-
children: r(t) ? /* @__PURE__ */ Z(
|
|
9604
|
+
children: r(t) ? /* @__PURE__ */ Z(gt, {
|
|
9605
9605
|
board: t,
|
|
9606
9606
|
id: e,
|
|
9607
9607
|
src: i,
|
|
@@ -9966,7 +9966,7 @@ function Mf({ id: e, canvas: t, layout: n, warnings: i, pending: a, contentBase:
|
|
|
9966
9966
|
},
|
|
9967
9967
|
children: [t && n ? /* @__PURE__ */ Q(ee, {
|
|
9968
9968
|
resetKey: t,
|
|
9969
|
-
children: [/* @__PURE__ */ Z(
|
|
9969
|
+
children: [/* @__PURE__ */ Z(yt, {
|
|
9970
9970
|
agent: f,
|
|
9971
9971
|
boardBase: L?.base,
|
|
9972
9972
|
boardSandbox: L?.sandbox,
|
|
@@ -10262,7 +10262,7 @@ function Pf({ id: e, artifact: t, canvas: n, layout: i, warnings: a, pending: o,
|
|
|
10262
10262
|
n && i && /* @__PURE__ */ Q(ee, {
|
|
10263
10263
|
resetKey: n,
|
|
10264
10264
|
children: [
|
|
10265
|
-
/* @__PURE__ */ Z(
|
|
10265
|
+
/* @__PURE__ */ Z(yt, {
|
|
10266
10266
|
agent: m,
|
|
10267
10267
|
boardBase: We?.base,
|
|
10268
10268
|
boardSandbox: We?.sandbox,
|
|
@@ -10306,7 +10306,7 @@ function Pf({ id: e, artifact: t, canvas: n, layout: i, warnings: a, pending: o,
|
|
|
10306
10306
|
[e]: (t[e] ?? 0) + 1
|
|
10307
10307
|
})),
|
|
10308
10308
|
onToggleParameters: ve,
|
|
10309
|
-
onTogglePlay: (e) => ue((t) =>
|
|
10309
|
+
onTogglePlay: (e) => ue((t) => bt(t, e))
|
|
10310
10310
|
}),
|
|
10311
10311
|
be.rejecting && Se && /* @__PURE__ */ Z("div", {
|
|
10312
10312
|
ref: S,
|
|
@@ -10558,6 +10558,6 @@ function Vf(e, t) {
|
|
|
10558
10558
|
}
|
|
10559
10559
|
//#endregion
|
|
10560
10560
|
//#region src/viewer/lib/version.ts
|
|
10561
|
-
var Hf = "1.51.
|
|
10561
|
+
var Hf = "1.51.2";
|
|
10562
10562
|
//#endregion
|
|
10563
10563
|
export { E as ARTIFACT_LOCATOR_SOURCE, n as ARTIFACT_TYPES, Nf as ArtboardView, rr as ArtifactThumbnail, t as BOARD_TYPES, ee as CanvasErrorBoundary, cr as EmbeddedCanvas, Ke as HTML_LANG, ve as HTML_SANDBOX, If as HtmlView, de as PHONE_QUERY, S as PreviewView, ur as PublicationStatus, Ze as RELAY_REJECTED_CODE, I as RailSwitch, pr as RyugiMark, lt as TYPE_GLYPHS, ot as TYPE_ICON_VIEWBOX, Qe as Trans, nr as TypeIcon, Hf as VIEWER_VERSION, d as ViewerProvider, k as anchorBlockIds, Pe as applyAgentOp, L as applyAgentThreadOp, tr as applyBoardAgentOp, er as applyBoardHumanOp, te as applyHumanOp, A as applyThreadOp, Xn as boardAnchors, _r as boardCommentsFromMessage, gr as boardCommentsFromPayload, m as cloudErrorDetails, rt as createRelayConnection, Je as createViewerI18n, ie as documentAnchors, Zn as emptyBoardComments, H as emptyComments, Rf as errorText, Xe as i18n, c as isArtifactAddress, T as isArtifactId, i as isArtifactLocator, e as isArtifactType, Bn as isChoiceRecord, r as isMediaBoard, w as isMintedArtifactId, O as isObject, zf as isPlanLimit, Ue as isVisibility, $n as mergeBoardComments, V as mergeComments, a as mintArtifactId, ne as openThread, Ye as ownLink, xr as pageLink, $e as parseAcceptLanguage, re as parseComments, Bf as planLimitMessage, qe as publishState, Ge as publishing, Yn as readBoardAnchor, Re as readCloudHeader, We as readPublication, Lf as relativeUpdatedAt, Ve as relayRejection, pe as reportCloudHeader, He as resolveLocale, Vf as responseErrorText, Qn as savedBoardComments, oe as savedComments, ze as syncNote, U as t, it as typeFaviconHref, j as unreadThreads, br as useCanvasData, Ie as useCloudHeader, Ne as useMedia, Sr as usePageQuery, _e as useSandboxFrame, f as useSystemTheme, Be as useTranslation, nt as useTypeFavicon, N as waitingOn };
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{i as e,n as t}from"./rolldown-runtime-COiEfhsA.js";import{i as n}from"./route-AvpwHtQ0.js";import{n as r,t as i}from"./jsx-runtime-CldxteV5.js";import{dt as a}from"./use-presence-9dVDVxFO.js";import{t as o}from"./maximize-2-DcJIGEuQ.js";import{t as s}from"./react-CeYd-wP1.js";import{t as c}from"./useTranslation-nbxMKAeb.js";import{l}from"./view-B3xgxhtB.js";import{t as u}from"./tokens.stylex-DEUtsSdt.js";var d={name:`repeat`,size:24,node:[[`path`,{d:`m17 2 4 4-4 4`,key:`nntrym`}],[`path`,{d:`M3 11v-1a4 4 0 0 1 4-4h14`,key:`84bu3i`}],[`path`,{d:`m7 22-4-4 4-4`,key:`1wqhfi`}],[`path`,{d:`M21 13v1a4 4 0 0 1-4 4H3`,key:`1rx37r`}]]};d.node;var f=a(d),p=e(r(),1);function m(e,t){let n=new Set(e);return n.delete(t)||n.add(t),n}var h=(e,t)=>(e[t]??0)>0,g=(e,t)=>e.interactive===!0&&h(t,e.file),_=(e,t,n,r)=>`${e}${t}?v=${n}${r>0?`&r=${r}`:``}`,v=i(),y=160,b=[1,1.5,2,.5],x=e=>{let t=Math.max(0,Math.floor(Number.isFinite(e)?e:0));return`${Math.floor(t/60)}:${String(t%60).padStart(2,`0`)}`};function S({playing:e}){return(0,v.jsx)(`svg`,{"aria-hidden":`true`,fill:`currentColor`,height:`16`,viewBox:`0 0 24 24`,width:`16`,children:[!1,!0].map(t=>(0,v.jsx)(s.g,{initial:!1,style:{transformOrigin:`12px 12px`},transition:{type:`spring`,duration:.3,bounce:0},animate:{opacity:+(e===t),scale:e===t?1:.25,filter:e===t?`blur(0px)`:`blur(4px)`},children:t?(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`rect`,{height:`16`,rx:`1`,width:`4`,x:`6`,y:`4`}),(0,v.jsx)(`rect`,{height:`16`,rx:`1`,width:`4`,x:`14`,y:`4`})]}):(0,v.jsx)(`path`,{d:`M8 4.6c-.9-.5-2 .1-2 1.1v12.6c0 1 1.1 1.6 2 1.1l11-6.3c.9-.5.9-1.7 0-2.2Z`})},String(t)))})}function C({src:e,title:t,barScale:n,barWidth:r,onExpand:i}){let{t:a}=c(),s=(0,p.useRef)(null),l=(0,p.useRef)(null),[u,d]=(0,p.useState)(!1),[m,h]=(0,p.useState)(0),[g,_]=(0,p.useState)(0),[C,w]=(0,p.useState)(1),[T,E]=(0,p.useState)(!1),[D,O]=(0,p.useState)(!1);(0,p.useEffect)(()=>{let e=s.current;if(!e)return;let t=()=>{O(!1),h(e.currentTime),_(e.duration),d(!e.paused)},n=[`loadedmetadata`,`timeupdate`,`play`,`pause`,`ended`,`seeked`],r=()=>O(!0);for(let r of n)e.addEventListener(r,t);return e.addEventListener(`error`,r),()=>{for(let r of n)e.removeEventListener(r,t);e.removeEventListener(`error`,r)}},[]);let k=()=>{let e=s.current;e&&(e.paused?e.play().catch(()=>d(!e.paused)):e.pause())},A=()=>{let e=b[(b.indexOf(C)+1)%b.length];s.current&&(s.current.playbackRate=e),w(e)},j=()=>{s.current&&(s.current.loop=!T),E(!T)},M=e=>{let t=s.current;if(!t||!Number.isFinite(t.duration)||t.duration<=0)return;let n=e.currentTarget.getBoundingClientRect();t.currentTime=Math.min(1,Math.max(0,(e.clientX-n.left)/n.width))*t.duration,h(t.currentTime)};return(0,v.jsxs)(v.Fragment,{children:[(0,v.jsx)(`video`,{muted:!0,playsInline:!0,preload:`metadata`,ref:s,src:e,title:t,className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq x19kjcj4 x1hpxl24 x47corl`}),(0,v.jsx)(`button`,{"data-video-surface":!0,"aria-label":a(u?`video.pauseTitle`:`video.playTitle`,{title:t}),type:`button`,onClick:e=>{(!e.detail||!l.current||Math.hypot(e.clientX-l.current.x,e.clientY-l.current.y)<4)&&k(),l.current=null},onKeyDown:e=>{(e.key===` `||e.key===`Enter`)&&e.stopPropagation()},onPointerDown:e=>{l.current={x:e.clientX,y:e.clientY}},className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1717udv xc342km xjbqb8w x1ypdohk x1t137rt x9v5kkp x1de99jn x1af67cj x1v57pqu`}),D&&(0,v.jsx)(`div`,{className:`x10l6tqk x10a8y8t xrvj5dj x1ku5rj1 x1tamke2 x193dt0t xyxeb8y xqfszdh x4z9k3i x2b8uid x47corl`,children:a(`video.failed`)}),r>=y&&(0,v.jsxs)(`div`,{"data-chrome":`video-controls`,onPointerDown:e=>e.stopPropagation(),className:`x10l6tqk xu96u03 xdsb8wn xc9qbxq x9f619 x78zum5 x6s0dn4 x1v2ro7d xaope02 x1hj3fc7 x193dt0t x178xt8z x13fuv20 xyky8oz x1fh8tye x1fao0z8 x1j6dyjg x67bb7w xt0e3qv x87ps6o`,style:{width:r,transform:`scale(${n})`},children:[(0,v.jsx)(`button`,{"aria-label":a(u?`video.pause`:`video.play`),type:`button`,onClick:k,className:`x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk`,children:(0,v.jsx)(S,{playing:u})}),(0,v.jsxs)(`span`,{className:`x2lah0s xss6m8b`,children:[x(m),` / `,x(g)]}),(0,v.jsxs)(`div`,{"aria-label":a(`video.progress`),"aria-valuemax":Math.round(g||0),"aria-valuemin":0,"aria-valuenow":Math.round(m),role:`slider`,tabIndex:0,onPointerDown:e=>{e.currentTarget.setPointerCapture?.(e.pointerId),M(e)},onPointerMove:e=>{e.buttons===1&&M(e)},className:`x1n2onr6 x98rzlu x1v9usgg x78zum5 x6s0dn4 x1ypdohk`,children:[(0,v.jsx)(`span`,{className:`x10l6tqk xu96u03 x3m8u43 xuoj239 x1q6ipvf`}),(0,v.jsx)(`span`,{className:`x10l6tqk xu96u03 xuoj239 x1l2ivya`,style:{width:`${g>0?m/g*100:0}%`}})]}),(0,v.jsxs)(`button`,{"aria-label":a(`video.speed`),type:`button`,onClick:A,className:`x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk x17s4nb9 x1s688f`,children:[C,`×`]}),(0,v.jsx)(`button`,{"aria-label":a(`video.loop`),"aria-pressed":T,type:`button`,onClick:j,...{0:{className:`x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk`},1:{className:`x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xjb2p0i x1j6dyjg x1ypdohk xymxiyj x1p2l8fb`}}[!T|0],children:(0,v.jsx)(f,{size:14})}),i&&(0,v.jsx)(`button`,{"aria-label":a(`video.expand`),type:`button`,onClick:i,className:`x2lah0s xrvj5dj x1ku5rj1 x1717udv xc342km xjbqb8w xagcll2 xazlcq2 xjb2p0i x1j6dyjg x1ypdohk`,children:(0,v.jsx)(o,{size:13})})]})]})}function w({id:e,board:t,src:n,zoom:r,onExpand:i}){return t.type===`video`?(0,v.jsx)(C,{barScale:1/r,barWidth:t.w*r,src:n,title:t.title??e,onExpand:i}):(0,v.jsx)(`img`,{alt:t.title??e,draggable:!1,src:n,className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq x19kjcj4 x1l2ivya x47corl`})}var T=[`width`,`height`,`position`,`flex-grow`,`display`,`flex-direction`,`align-items`,`gap`,`padding`,`background-color`,`opacity`,`border-radius`,`border-style`,`font-size`,`color`,`box-shadow`],E=`#0D99FF`,D=`M6.2 3.6C5 2.7 3.4 3.6 3.6 5.1L6 22.7C6.2 24.3 8.2 24.8 9.1 23.5L13 18.3C13.4 17.8 14 17.5 14.6 17.5L21.1 17.3C22.7 17.2 23.4 15.2 22.2 14.3Z`,O=`M13 3a9 9 0 0 1 0 18H4.5A1.5 1.5 0 0 1 3 19.5V13A10 10 0 0 1 13 3z`,k=(e,t,n)=>`url("data:image/svg+xml,${encodeURIComponent(e)}") ${t}, ${n}`,A=k(`<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 28 28'><path d='${D}' fill='none' stroke='white' stroke-width='4' stroke-linejoin='round'/><path d='${D}' fill='${E}'/></svg>`,`3 3`,`default`),j=k(`<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'><path d='${O}' fill='none' stroke='white' stroke-width='3' stroke-linejoin='round'/><path d='${O}' fill='${E}'/><path d='M13 8.2v7.6M9.2 12h7.6' stroke='white' stroke-width='2.2' stroke-linecap='round'/></svg>`,`3 21`,`crosshair`);function M(e,t){let n=e;for(;n.length>1;)n=n.slice(0,-1).map((e,r)=>({x:e.x+(n[r+1].x-e.x)*t,y:e.y+(n[r+1].y-e.y)*t}));return n[0]}function N(e,t,n){let r=t.x-e.x,i=t.y-e.y,a=-i,o=r;a<0&&(a=-a,o=-o);let s=(t,n)=>({x:e.x+r*t+a*n,y:e.y+i*t+o*n}),c=[e,s(.2,0),s(.3,-.5),s(1.55,1.25),s(1.35,.1),t];if(n!==void 0){let t=(n-135)*Math.PI/180,a=Math.hypot(r,i)*.2;c[1]={x:e.x+Math.cos(t)*a,y:e.y+Math.sin(t)*a}}let l=c.slice(0,-1).map((e,t)=>({x:5*(c[t+1].x-e.x),y:5*(c[t+1].y-e.y)})),u=[0],d=e;for(let e=1;e<=600;e++){let t=M(c,e/600);u.push(u[e-1]+Math.hypot(t.x-d.x,t.y-d.y)),d=t}let f=u[600];return{length:f,at(e){let t=Math.max(0,Math.min(1,e))*f,n=0,r=600;for(;r-n>1;){let e=n+r>>1;u[e]<t?n=e:r=e}let i=u[r]-u[n],a=(n+(i?(t-u[n])/i:0))/600,o=M(l,a);return{...M(c,a),angle:Math.atan2(o.y,o.x)*180/Math.PI+135}}}}function P({x:e,y:t,zoom:n,agent:r,title:i}){let a=`agent-${(0,p.useId)().replaceAll(/[^\w-]/g,``)}`,o=(0,p.useRef)(null),s=(0,p.useRef)(null),c=(0,p.useRef)(null),l=(0,p.useRef)(!1),d=(0,p.useRef)(n),f=e=>`translate(${e.x}px, ${e.y}px) scale(${1/d.current})`,m=e=>`translate(-3.43px, -3.43px) rotate(${e}deg)`,h=e=>{c.current=e,o.current&&(o.current.style.transform=f(e)),s.current&&(s.current.style.transform=m(e.angle))};(0,p.useLayoutEffect)(()=>{d.current=n,c.current&&h(c.current)},[n]),(0,p.useLayoutEffect)(()=>{let n=matchMedia(`(prefers-reduced-motion: reduce)`),r=c.current,i=0,a=()=>{cancelAnimationFrame(i),i=0,l.current=!1,h({x:e,y:t,angle:c.current?.angle??0})};if(!r||n.matches||Math.hypot(e-r.x,t-r.y)*d.current<2)a();else{let n=N(r,{x:e,y:t},l.current?r.angle:void 0),a=Math.min(1800,900+n.length*d.current*1.2),o=performance.now(),s=o;l.current=!0;let u=e=>{let t=Math.min(1,Math.max(0,(e-o)/a)),r=n.at(t**3*(t*(t*6-15)+10)),d=c.current.angle;r.angle=d+(((r.angle-d)%360+540)%360-180)*(1-Math.exp(-(e-s)/80)),s=e,l.current=t<1,h(r),i=t<1?requestAnimationFrame(u):0};i=requestAnimationFrame(u)}let o=()=>{n.matches&&a()};return n.addEventListener(`change`,o),()=>{cancelAnimationFrame(i),n.removeEventListener(`change`,o)}},[e,t]);let g=c.current??{x:e,y:t,angle:0};return(0,v.jsxs)(`div`,{"aria-label":`${r} last worked on ${i}`,ref:o,role:`status`,className:`x10l6tqk xu96u03 x13vifvy x1u8a7rm x47corl x1hj3fc7`,style:{transform:f(g)},children:[(0,v.jsxs)(`svg`,{"aria-hidden":`true`,height:`24`,ref:s,viewBox:`0 0 28 28`,width:`24`,className:`x1lliihq xqqlr9g x1gtfylx`,style:{transform:m(g.angle)},children:[(0,v.jsx)(`path`,{d:D,fill:`none`,stroke:u.white,strokeLinejoin:`round`,strokeWidth:`4`}),(0,v.jsx)(`defs`,{children:(0,v.jsxs)(`linearGradient`,{id:a,x1:`0`,x2:`1`,y1:`0`,y2:`1`,children:[(0,v.jsx)(`stop`,{offset:`0`,stopColor:u.selection}),(0,v.jsx)(`stop`,{offset:`1`,stopColor:u.agent})]})}),(0,v.jsx)(`path`,{d:D,fill:`url(#${a})`})]}),(0,v.jsx)(`span`,{className:`x10l6tqk x1trqr8e xv4lvxq x78zum5 x6s0dn4 x1219o5k x1w2h69v x25sj25 x1bjonze xdocmp1 xgs1500 x828b17 x1bqy6mi xqxj4xa x8r4el6 x1j6dyjg x1s688f x152skdk xuxw1ft xmj57et`,children:r})]})}var F=t({Canvas:()=>U});function I(e){if(!e)return{backgroundColor:u.paperWarm,color:u.inkWarm};let t=e.length===4?e.slice(1).split(``).map(e=>e+e).join(``):e.slice(1),[n,r,i]=[0,2,4].map(e=>{let n=parseInt(t.slice(e,e+2),16)/255;return n<=.04045?n/12.92:((n+.055)/1.055)**2.4});return{backgroundColor:e,color:.2126*n+.7152*r+.0722*i>.179?u.black:u.white}}var L=new Map,R=new Map,z=new Set;function B(e,t,n,r=!1){return{left:e.x,top:e.y,width:e.w,height:e.h,...t?{outlineWidth:`calc(2px / var(--zoom, 1))`}:{},...n?r?{visibility:`hidden`}:{display:`none`}:{}}}var V=(0,p.memo)(function({boardBase:e,boards:t,boardSandbox:r=`allow-scripts`,contentBase:i,culled:a=z,frameLoaded:o,frameRef:s,gesturing:c=!1,images:l=R,inspecting:u,pending:d,phases:f=L,playing:p,replays:m,versions:y,writing:b}){return t.map(([t,x])=>{if(n(x))return null;let S=h(y,x.file)&&!d.has(t),C=f.get(t)??`mounted`,w=l.get(t)??null,T=!!w&&(C===`unloaded`||C===`restoring`),E=S&&(C!==`unloaded`||!w),D=t===b;return(0,v.jsxs)(`div`,{"aria-busy":D||void 0,"data-board":t,...{0:{className:`x10l6tqk`},2:{className:`x10l6tqk x78zum5 x6s0dn4 xl56j7k xb3r6kr xahzvm9 x1qgsegg xaatb59 x1tjb3dp x47corl`},1:{className:`x10l6tqk xaatb59 x7vaw5c xsvltah`},3:{className:`x10l6tqk x78zum5 x6s0dn4 xl56j7k xb3r6kr xahzvm9 x1qgsegg x47corl xaatb59 x7vaw5c xsvltah`}}[!S<<1|!!D],style:B(x,D,a.has(t),C===`capturing`),children:[E&&(0,v.jsx)(`iframe`,{ref:s(t),sandbox:r,style:c?{pointerEvents:`none`}:void 0,title:x.title??t,src:_(e??i,x.file,y[x.file]??0,m[t]??0),onLoad:()=>o(t),...{0:{className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya x47corl x1qgsegg xaatb59 x1tjb3dp`},4:{className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya x1qgsegg xaatb59 x1tjb3dp x67bb7w`},2:{className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya xaatb59 x67bb7w x1de99jn x7vaw5c`},6:{className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya xaatb59 x67bb7w x1de99jn x7vaw5c`},1:{className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya x1qgsegg xaatb59 x1tjb3dp x47corl`},5:{className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya x1qgsegg xaatb59 x1tjb3dp x47corl`},3:{className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya xaatb59 x1de99jn x7vaw5c x47corl`},7:{className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq xc342km x1l2ivya xaatb59 x1de99jn x7vaw5c x47corl`}}[!!u<<2|!!(g(x,y)&&p.has(t))<<1|!!c]}),T&&(0,v.jsx)(`img`,{alt:``,decoding:`async`,draggable:!1,src:w,className:`x10l6tqk x10a8y8t xh8yej3 x5yr21d x1lliihq x47corl`}),!S&&(0,v.jsx)(`span`,{className:`x1bo0w0s xqfszdh xfifm61`,children:D?`Drawing…`:`Waiting…`})]},t)})});function H({boards:e,contentBase:t,culled:r=z,pending:i,versions:a,writing:o,zoom:s,onExpand:c}){return e.map(([e,l])=>{if(!n(l))return null;let u=h(a,l.file)&&!i.has(e),d=e===o;return(0,v.jsx)(`div`,{"aria-busy":d||void 0,"data-board":e,...{0:{className:`x10l6tqk`},2:{className:`x10l6tqk x78zum5 x6s0dn4 xl56j7k xb3r6kr xahzvm9 x1qgsegg xaatb59 x1tjb3dp x47corl`},1:{className:`x10l6tqk xaatb59 x7vaw5c xsvltah`},3:{className:`x10l6tqk x78zum5 x6s0dn4 xl56j7k xb3r6kr xahzvm9 x1qgsegg x47corl xaatb59 x7vaw5c xsvltah`}}[!u<<1|!!d],style:B(l,d,r.has(e)),children:u?(0,v.jsx)(w,{board:l,id:e,src:_(t,l.file,a[l.file]??0,0),zoom:s,onExpand:c&&(()=>c(e))}):(0,v.jsx)(`span`,{className:`x1bo0w0s xqfszdh xfifm61`,children:d?`Drawing…`:`Waiting…`})},e)})}function U({boardBase:e,boardSandbox:t,view:r,worldRef:i,phases:a,images:o,culled:s,gesturing:c,boards:u,notes:d,contentBase:f,versions:p,pending:m,playing:h,replays:g,inspecting:_,frameRef:y,frameLoaded:b,live:x,writing:S,agent:C,onExpand:w}){let T=S;if(x){T=void 0;let e=0;for(let[t,r]of u){let i=p[r.file]??0;n(r)||m.has(t)||i<=e||(T=t,e=i)}}let E=u.find(([e])=>e===T)?.[1];return(0,v.jsxs)(`div`,{ref:i,className:`x10l6tqk xu96u03 x13vifvy x1hj3fc7`,style:i?void 0:{transform:`translate(${r.x}px, ${r.y}px) scale(${r.k})`,"--zoom":r.k},children:[(0,v.jsx)(V,{boardBase:e,boardSandbox:t,boards:u,contentBase:f,culled:s,frameLoaded:b,frameRef:y,gesturing:c,images:o,inspecting:_,pending:m,phases:a,playing:h,replays:g,versions:p,writing:S,onExpand:w}),(0,v.jsx)(H,{boards:u,contentBase:f,culled:s,pending:m,versions:p,writing:S,zoom:r.k,onExpand:w}),d.map(([e,t])=>t.kind===`title`?(0,v.jsx)(`h2`,{className:`x10l6tqk x1ghz6dp x1xlr1w8 x1uo3zyz xjat59b xo2rkog x1bd091l`,style:{left:t.x,top:t.y,width:t.w,whiteSpace:t.w===void 0?`nowrap`:`normal`,fontSize:t.size??96,transform:`scale(${l(t.size??96,r.k)})`},children:t.text},e):(0,v.jsx)(`div`,{className:`x10l6tqk x12oqio5 x126k92a xj0a0fe x1pmbvsm`,style:{left:t.x,top:t.y,width:t.w??240,padding:16,fontSize:18,lineHeight:`27px`,...I(t.color)},children:t.text},e)),E&&(0,v.jsx)(P,{agent:C??`Agent`,title:E.title??T,x:E.x+Math.min(64,E.w*.15),y:E.y+Math.min(80,E.h*.2),zoom:r.k})]})}export{A as a,h as c,T as i,g as l,F as n,w as o,j as r,C as s,U as t,m as u};
|