frameboard 0.48.0 → 0.50.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/dist/cli.js CHANGED
@@ -1,5 +1,4 @@
1
1
  #!/usr/bin/env node
2
- import { createRequire } from "node:module";
3
2
  import childProcess, { execFile, spawn } from "node:child_process";
4
3
  import { EventEmitter, once } from "node:events";
5
4
  import * as sp from "node:path";
@@ -9,12 +8,13 @@ import process$1, { versions } from "node:process";
9
8
  import { isDeepStrictEqual, promisify, stripVTControlCharacters } from "node:util";
10
9
  import { constants as constants$1, copyFile, cp, link, lstat, mkdir, mkdtemp, open as open$1, readFile, readdir, readlink, realpath, rename, rm, rmdir, stat, utimes, writeFile } from "node:fs/promises";
11
10
  import { createHash, randomBytes, randomUUID, timingSafeEqual } from "node:crypto";
12
- import { setTimeout as setTimeout$1 } from "node:timers/promises";
11
+ import { setImmediate as setImmediate$1, setTimeout as setTimeout$1 } from "node:timers/promises";
13
12
  import { fileURLToPath, pathToFileURL } from "node:url";
14
13
  import { STATUS_CODES, ServerResponse, createServer } from "node:http";
15
14
  import { Http2ServerRequest, constants as constants$2 } from "node:http2";
16
15
  import { Readable } from "node:stream";
17
16
  import { homedir, networkInterfaces, release as release$2, tmpdir, type } from "node:os";
17
+ import { createRequire } from "node:module";
18
18
  // \0rolldown/runtime.js
19
19
  var __create = Object.create;
20
20
  var __defProp = Object.defineProperty;
@@ -3491,8 +3491,8 @@ function optionalKeys(shape) {
3491
3491
  }
3492
3492
  const NUMBER_FORMAT_RANGES = /*@__PURE__*/ (() => ({
3493
3493
  safeint: [Number.MIN_SAFE_INTEGER, Number.MAX_SAFE_INTEGER],
3494
- int32: [-2147483648, 2147483647],
3495
- uint32: [0, 4294967295],
3494
+ int32: [-0x80000000, 0x7fffffff],
3495
+ uint32: [0, 0xffffffff],
3496
3496
  float32: [-34028234663852886e22, 34028234663852886e22],
3497
3497
  float64: [-Number.MAX_VALUE, Number.MAX_VALUE]
3498
3498
  }))();
@@ -5670,9 +5670,7 @@ function mergeValues(a, b) {
5670
5670
  };
5671
5671
  const newArray = [];
5672
5672
  for (let index = 0; index < a.length; index++) {
5673
- const itemA = a[index];
5674
- const itemB = b[index];
5675
- const sharedValue = mergeValues(itemA, itemB);
5673
+ const sharedValue = mergeValues(a[index], b[index]);
5676
5674
  if (!sharedValue.valid) return {
5677
5675
  valid: false,
5678
5676
  mergeErrorPath: [index, ...sharedValue.mergeErrorPath]
@@ -6381,7 +6379,7 @@ function bucketFor(state, inst) {
6381
6379
  }
6382
6380
  let handoff;
6383
6381
  const open = [];
6384
- const memo = {
6382
+ const memo$1 = {
6385
6383
  alloc(_inst, payload, empty) {
6386
6384
  const bucket = handoff;
6387
6385
  if (!bucket) return empty;
@@ -6475,7 +6473,7 @@ const memo = {
6475
6473
  };
6476
6474
  /** The memoizer that gives containers cycle support. `zod` installs it by default; `zod/mini` opts in with `config({ memoizer: memoizer() })`. */
6477
6475
  function memoizer() {
6478
- return memo;
6476
+ return memo$1;
6479
6477
  }
6480
6478
  /** Whether this value is a node a back-edge resolved to before it finished. */
6481
6479
  function isBackEdge(ctx, value) {
@@ -7748,8 +7746,7 @@ const dateProcessor = (schema, ctx, json, params) => {
7748
7746
  handleUnrepresentable(schema, ctx, json, params, "Date cannot be represented in JSON Schema");
7749
7747
  };
7750
7748
  const enumProcessor = (schema, _ctx, json, _params) => {
7751
- const def = schema._zod.def;
7752
- const values = getEnumValues(def.entries);
7749
+ const values = getEnumValues(schema._zod.def.entries);
7753
7750
  if (values.length === 0) {
7754
7751
  json.not = {};
7755
7752
  return;
@@ -9393,6 +9390,15 @@ function frameSizeOf(name) {
9393
9390
  height
9394
9391
  };
9395
9392
  }
9393
+ /**
9394
+ * The width a trailing `-<px>` in a frame's name states, as `overview-390`
9395
+ * does. Only a width a size above names counts, so a counter or a year states
9396
+ * none.
9397
+ */
9398
+ function namedWidth(name) {
9399
+ const suffix = /-(\d+)$/.exec(name)?.[1];
9400
+ return [...Object.values(FRAME_SIZES), ...DEVICE_SIZES].find(({ width }) => String(width) === suffix)?.width;
9401
+ }
9396
9402
  /** The preset whose range holds a width, or none below the phone range. */
9397
9403
  function presetAt(width) {
9398
9404
  return Object.keys(PRESET_RANGES).filter(isFrameSizePreset).find((preset) => {
@@ -10483,14 +10489,15 @@ var require_tokenize = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10483
10489
  const RE_WORD_END = /[\t\n\f\r !"#'():;@[\\\]{}]|\/(?=\*)/g;
10484
10490
  const RE_BAD_BRACKET = /.[\r\n"'(/\\]/;
10485
10491
  const RE_HEX_ESCAPE = /[\da-f]/i;
10492
+ const RE_URL_NAME = /(^|[\t\n\f\r "'(),/:;[\]{}])url$/i;
10493
+ const RE_QUOTED = /[\t\n\f\r ]*["']/y;
10486
10494
  module.exports = function tokenizer(input, options = {}) {
10487
10495
  let css = input.css.valueOf();
10488
10496
  let ignore = options.ignoreErrors;
10489
10497
  let code, content, escape, next, quote;
10490
- let currentToken, escaped, escapePos, n, prev;
10498
+ let currentToken, escaped, escapePos;
10491
10499
  let length = css.length;
10492
10500
  let pos = 0;
10493
- let buffer = [];
10494
10501
  let returned = [];
10495
10502
  let lastBadParen = -1;
10496
10503
  function position() {
@@ -10537,9 +10544,8 @@ var require_tokenize = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10537
10544
  break;
10538
10545
  }
10539
10546
  case OPEN_PARENTHESES:
10540
- prev = buffer.length ? buffer.pop()[1] : "";
10541
- n = css.charCodeAt(pos + 1);
10542
- if (prev === "url" && n !== SINGLE_QUOTE && n !== DOUBLE_QUOTE && n !== SPACE && n !== NEWLINE && n !== TAB && n !== FEED && n !== CR) {
10547
+ RE_QUOTED.lastIndex = pos + 1;
10548
+ if (RE_URL_NAME.test(css.substring(pos - 4, pos)) && !RE_QUOTED.test(css)) {
10543
10549
  next = pos;
10544
10550
  do {
10545
10551
  escaped = false;
@@ -10676,7 +10682,6 @@ var require_tokenize = /* @__PURE__ */ __commonJSMin(((exports, module) => {
10676
10682
  pos,
10677
10683
  next
10678
10684
  ];
10679
- buffer.push(currentToken);
10680
10685
  pos = next;
10681
10686
  }
10682
10687
  }
@@ -10800,8 +10805,9 @@ var require_css_syntax_error = /* @__PURE__ */ __commonJSMin(((exports, module)
10800
10805
  if (number === this.line) {
10801
10806
  if (line.length > 160) {
10802
10807
  let padding = 20;
10808
+ let endColumn = typeof this.endColumn === "number" ? this.endColumn : this.column;
10803
10809
  let subLineStart = Math.max(0, this.column - padding);
10804
- let subLineEnd = Math.max(this.column + padding, this.endColumn + padding);
10810
+ let subLineEnd = Math.max(this.column + padding, endColumn + padding);
10805
10811
  let subLine = line.slice(subLineStart, subLineEnd);
10806
10812
  let spacing = aside(gutter.replace(/\d/g, " ")) + line.slice(0, Math.min(this.column - 1, 19)).replace(/[^\t]/g, " ");
10807
10813
  return mark(">") + aside(gutter) + highlight(subLine) + "\n " + spacing + mark("^");
@@ -13679,7 +13685,7 @@ var require_source_map_consumer = /* @__PURE__ */ __commonJSMin(((exports) => {
13679
13685
  * strings, fractions, etc).
13680
13686
  */
13681
13687
  function isValidOffset(aValue) {
13682
- return typeof aValue === "number" && aValue >= 0 && aValue <= 9007199254740991 && Math.floor(aValue) === aValue;
13688
+ return typeof aValue === "number" && aValue >= 0 && aValue <= 0x1fffffffffffff && Math.floor(aValue) === aValue;
13683
13689
  }
13684
13690
  IndexedSourceMapConsumer.prototype = Object.create(SourceMapConsumer.prototype);
13685
13691
  IndexedSourceMapConsumer.prototype.constructor = SourceMapConsumer;
@@ -14712,7 +14718,7 @@ var require_map_generator = /* @__PURE__ */ __commonJSMin(((exports, module) =>
14712
14718
  while ((startIndex = this.css.indexOf(annotation, cursor)) !== -1) {
14713
14719
  let endIndex = this.css.indexOf("*/", startIndex + 21);
14714
14720
  if (endIndex === -1) break;
14715
- while (startIndex > cursor && this.css[startIndex - 1] === "\n") startIndex--;
14721
+ if (endIndex + 2 === this.css.length || /[\t\n\f\r ]/.test(this.css[endIndex + 2])) while (startIndex > cursor && (this.css[startIndex - 1] === "\n" || this.css[startIndex - 1] === "\r")) startIndex--;
14716
14722
  css += this.css.slice(cursor, startIndex);
14717
14723
  cursor = endIndex + 2;
14718
14724
  }
@@ -16070,7 +16076,7 @@ var require_processor = /* @__PURE__ */ __commonJSMin(((exports, module) => {
16070
16076
  let Root = require_root();
16071
16077
  var Processor = class {
16072
16078
  constructor(plugins = []) {
16073
- this.version = "8.5.32";
16079
+ this.version = "8.5.33";
16074
16080
  this.plugins = this.normalize(plugins);
16075
16081
  }
16076
16082
  normalize(plugins) {
@@ -16234,8 +16240,8 @@ const UNDEFINED_CODE_POINTS = /* @__PURE__ */ new Set([
16234
16240
  917503,
16235
16241
  983038,
16236
16242
  983039,
16237
- 1048574,
16238
- 1048575,
16243
+ 0xffffe,
16244
+ 0xfffff,
16239
16245
  1114110,
16240
16246
  1114111
16241
16247
  ]);
@@ -16600,9 +16606,9 @@ function replaceCodePoint(codePoint) {
16600
16606
  */
16601
16607
  const htmlDecodeData = ["Q=¨`p0AEligMPacutebrevecircyfrgravelphamacrndogonpfpplyFunctionringscrsigntildeumlBackslashrvwedcyecausernoullistafropfrevescrumpeqCHcyOPYacutepitalDifferentialDyleyscaronedilirconintdotedillanterDotfrhiircleDotMinusPlusTimeslockwiseContourIntegralseCurlyDoubleQuoteQuoteolonengruentinttourIntegralpfroductunterClockwiseContourIntegralrossscrupCapDDotrahdJcyScyZcyaggerrrshvcaronyeltafriacriticalAcuteDotubleAcuteGraveTildemondfferentialDopftDotEqualubleContourIntegralDotwnArrowLeftArrowRightArrowTeeongLeftArrowRightArrowRightArrowRightArrowTeeUpArrowDownArrowVerticalBarwnArrowBarUpArrowBreveLeftRightVectorTeeVectorVectorBarRightTeeVectorVectorBarTeeArrowarrowscrtrokENGTHacutecaronircydotfrgravelementmacrptySmallSquareVerySmallSquareogonpfpsilonqualTildeilibriumscrimtaumlxistsponentialEFcyfrilledSmallSquareVerySmallSquareopfrAlluriertrfscrGJcyTammadbrevecedilircydotfrgopfreaterEqualLessFullEqualGreaterLessSlantEqualTildescrtHARDcyacektcircfrilbertSpaceopfrizontalLinescrtrokumpDownHumpEqualIEcyJligOcyacutecircydotfrgravemacrginaryIpliesntegralrsectionvisibleCommaTimesogonpftascrtildeukcymlJcircyfropfscrercyukcyKHcyJcyappacedilyfropfscrLJcyTacutembdangplacetrfrrcaronedilyeftAngleBracketrrowBarRightArrowCeilingDoubleBracketwnTeeVectorVectorBarFloorRightArrowVectorTeeArrowVectorriangleBarEqualUpDownVectorTeeVectorVectorBarVectorBararrowrightarrowssEqualGreaterFullEqualGreaterLessSlantEqualTildefrleftarrowmidotongLeftArrowRightArrowRightArrowleftarrowrightarrowrightarrowpfwerLeftArrowRightArrowscrhtroktMapcyediumSpacellintrffrinusPlusopfscruNJcyacutecaronedilyegativeMediumSpaceThickSpacenSpaceVeryThinSpacestedGreaterGreaterLessLesswLinefroBreaknBreakingSpacepftCongruentupCapDoubleVerticalBarElementqualTildexistsGreaterEqualFullEqualGreaterLessSlantEqualTildeHumpDownHumpEqualLeftTriangleBarEqualssEqualGreaterLessSlantEqualTildeNestedGreaterGreaterLessLessPrecedesEqualSlantEqualReverseElementightTriangleBarEqualSquareSubsetEqualpersetEqualubsetEqualcceedsEqualSlantEqualTildepersetEqualTildeEqualFullEqualTildeVerticalBarscrtildeuOEligacutecircydblacfrgravemacregaicronopfpenCurlyDoubleQuoteQuoterscrlashtildemesumlverBarraceketParenthesisPartialDcyfrhiilusMinusoincareplanepfrecedesEqualSlantEqualTildeimeoductportionalscriQUOTfropfscrRBarrEGacutengrrtlcaronedilyeverseElementquilibriumUpEquilibriumfrhoightAngleBracketrrowBarLeftArrowCeilingDoubleBracketwnTeeVectorVectorBarFloorTeeArrowVectorriangleBarEqualUpDownVectorTeeVectorVectorBarVectorBararrowopfundImpliesrightarrowscrhuleDelayedSHCHcycyOFTcyacutecaronedilircyfrhortDownArrowLeftArrowRightArrowUpArrowigmamallCircleopfqrtuareIntersectionSubsetEqualpersetEqualUnionscrtarubsetEqualcceedsEqualSlantEqualTildehThatmpersetEqualsetTHORNRADESHcycyabucaronedilyfrhereforetaickSpacenSpaceildeEqualFullEqualTildeopfripleDotscrtrokUacuterrocirbrcyevecircydblacfrgravemacrnderBarraceketParenthesisionPlusogonpfpArrowBarDownArrowDownArrowEquilibriumTeeArrowarrowdownarrowperLeftArrowRightArrowsilonringscrtildeumlVDashbarcydashleerbarticalBarLineSeparatorTildeyThinSpacefropfscrvdashWcircedgefropfscrXfriopfscrYAcyIcyUcyacutecircyfropfscrumlZHcyacutecaronydoteroWidthSpacetafropfscraacutebrevecEdircuteyeligfrgravelefsymphphamacrlgpndanddslopevgelemsdaabcdefghrtvbdsphtzarrogonpfpEacireidosproxeqringscrtympeqtildeumlwconintintbNotackcongepsilonprimesimeqrveewedgebrktbrkcongydquoecausemptyvpsirnoutahweenfrigcapircupodotplustimessqcuptartriangledownupuplusveewedgekarowlacklozengesquaretriangledownleftrightnkk12434ocknequivotopfttomwtiexDLRlrHDUduULRlrVHLRhlrboxdLRlrhDUduminusplustimesuLRlrvHLRhlrprimerevevbarscremiimeolbhsubulletmpEeqcacutepandbrcupcapupdotsretoncapsronedilircupssmdotedilmptyvnterdotfrhcyeckmarkiirEceqlearrowleftrightdRSastcircdashefnintmidscirlubsuitoloneqmmatpfnlementxesngdotintpfrodysrrarrossscrubepetdotudarrlreprsclarrppbrcapcapupdotorsrarrmlyeqprecsuccveewedgerenvearrowleftrightveewedwconintintylctydArrHaraggerlethrrshvbkarowlaccaronydaggerrrotseqegltamptyvfishtrharlriamondsuitsegammasinvideontimesonxjcylcornropollarpfteqdotminusplussquareublebarwedgewnarrowdownarrowsharpoonleftrightrbkarowcornropscryoltroktdotrifuarrharwanglezcyigrarreDDototacutestercaronircolonydotefDotrgravesdotlinterslsdotmacrptysetvsp134ngspogonpfparsllussilonvqcircolonsimlantgtrlessualsestivDDvparslrDotarrscrdotimtahumlroxclistpectationonentialefallingdotseqcyemalefiligligligriligjliglatligtnsnofopfrallkvpartintrac123456823534584556878slownscrgElacutemmadpbrevecircydotelqqslantsccdotollesfrggimeljcylEajnEapproxeqqsimopfravescrimeltccirdotlParquestrapproxrrdoteqlessqlesslesssimvertneqqnEhArrairsplfmiltrdcyrcirwbarcirceartsuitlliprconfrksearowwarowoarrmthtokleftarrowrightarrowpfrbarscrlashtrokybullpheniacutecircyecyxclffrgraveiiintntnfinotajligmacrgelinepartthofpedncarefintieodottcalegersrcallarhkprodocygonpftaprodquestscrinEdotsvvtildeukcymljcircyfrmathopfscrercyukcykappavcedilyfrgreenhcyjcyopfscrlAarrrrtailBarrEgHaracuteemptyvgranmbdangdlepquorrbfsfshklpplsimtltailesbarrbrkracekkeslducaronedililubydcaquorrdharusharsheftarrowtailharpoondownupleftarrowsrightarrowsharpoonssquigarrowthreetimesgqqslantsccdotorgessapproxdoteqgtrqgtrgtrsimfishtloorrgEhardulblkjcylarrcornerhardtrimidotoustachenEapproxeqqsimoangrrbrkngleftarrowrightarrowmapstorightarrowoparrowleftrightparflustimeswastbarzengefparltrarrcornerhardmtrisaquocrhimegqbuortroktccirdothreeimeslarrquestrPariefurdsharuharvertneqqnEmDDotacrletesepstodownleftuprkercommaydasheasuredanglefrhoicrodastcirdotnusbdulcpdrnplusodelspfpscrtposultimapmapnGgtvLeftarrowrightarrowltvRightarrowVDashdashablacutengpEidosproxturalsbspumpecapronedilongdotupydasheArrarhkrowdotquivsearimxistsfrgEeqqslantssimtrhArrarrparisdvjcylArrEarrdreftarrowrightarrowqqslantsssimtriemidopftinEdotvabcnivabcparallelsltolintrcueeceqrArrarrcwightarrowtriesccueerhortmidparallelimeqmidparqsubepeubEeseteqqcceqpEeseteqqtglildelgrianglelefteqrightequmerospvDashHarrapdashgetinfinlArretrierArrtriesimwArrarhkrownearoSacutestcircydashblacivotsoldeligfcirrgonravethbarmintlarrcirrossinetmacregaicrondnusopfparerplusrarrderoffmigoforslopevscrlasholtildemesasumlvbarparallelsimltcyercntiodmilptenkfrhivmmatoneitchforkvlanckhkvusacirbcirdouemnsimtwomointintpfundrEapcueecapproxcurlyeqeqnapproxeqqsimsimimesnEapsimodfalarlinesurfptosimurelscriuncspqfrintopfprimescruaternionsintesteqotrAarrrrtailBarrHaraceutedicemptyvngdelequorrapbfscfshklpplsimtlwtailionalsbarrbrkracekkeslducaronedililubydcaldharquorshealinepartsctgfishtloorrhardulovightarrowtailharpoondownupleftarrowsharpoonsrightarrowssquigarrowthreetimesngsingdotseqlarrharmmoustachenmidoangrrbrkparflustimespargtpolintrarrsaquocrhqbuorthreeimesriefltriuluharxsacutebquocEaproncueedilircnEapsimpolintsimydotbeeArrarhkrowctmiswartminusnxtfrownharpchcyyortmidparallelyigmafvmdoteqgElEneplusrarrlarrmallsetminusshpeparslidletesoftcylbarpfpadesuitrqcapsupssubeseteqpesetequareffrarrscretmnmiletarftarfraightepsilonphinsubEdotedotmultnEeplusrarrseteqqneqqimubpccapproxcurlyeqeqnapproxeqqsimsimmngp123EdotsubedothsolublarrmultnEeplusseteqqneqqimubpwArrarhkrownwarzligtargetubrkcaronedilydotelrecfrhere4foretasymvickapproxsimnspkapsimornildemesbardntoeapbotcirforksaprimeradeiangledownlefteqqrighteqdoteminusplussbtimepeziumscryhcytrokwixtoheadleftarrowrightarrowuArrHaracuterrbrcyevecircydarrblacharfishtrgraveharlrblklcornerroptrimacrlogonpfparrowdownarrowharpoonleftrightlussihlonuparrowsrcornerropingtriscrtdotilderifuarrmlwanglevArrBarvDashangrtrepsilonkappanothingphiiroptorhosigmaubsetneqqpsetneqqthetariangleleftrightcydasheebareqlliprbartfrltrinsubpopfproprtriscrubnEepnEezigzagwcircedbargeqierpfropfpreathscrxcapircupdtrifrhArrarrilArrarrmapnisodotpflustimerArrarrscrqcupuplustriveewedgeyacuteycircyenfricyopfscrucymlzacutecaronydoteetrftafrhcyigrarropfscrwjnjC(D%D($(D'%$$ED($'$'$%$'%E$/D'$F%'D(D&#,%%&&$%$)%+%%$E$F$'$&$(#'D&$(%$&4%($(E'%&%($&$)%*$%$%$+)()')($:&5-($'($%*&&&/%%&)%@$'$F$%&&#%%)$&$&$&$(%%%&$(%$$%&%$E$2.&0,.(.(&'%.$F%$&&&(%6)&+*),---&*/1---)-.&)*+,).%*,&,*'('2+,+)1&'1,)2&'&*('($F%'#&D%D($(E&%$$&$ED($)$'%1(2$'%E$)$'((&+$&%%$%D&$(%-#&$E$3)2$F%'%+$&#'D$$'($$($(%&%$$&$E$$$F$./'*,***'*-*($F$$#)$'%$$'$%$.$&%/$&%'$.'(#'$'$&D(D'%$$&$%D($$%&&*%($%&('+%/,($'%E%%$&$($'E%#(%$$E$F$F%'$'#'$&$'$(%$$E$F$F#'D$$(%'%%%+%%$(%'%$$2(',&,-'*'0).+)1&'('-,)'&*(*)(*/&/('/),))/&')-&'('-%1','*'''-'($E$$%+$($/+-'-',+-'-%E%/(-$&%$%'$$#&$%$-%*$E$+$F$&$$#'$($(%'%$$5+-.)+0%5)+%($E$)%1%%%$&,'(&4&*''+H'(&*-(-L-J-'-M-(&O*H&/2F2((%*(***G*M*(&W,K&+.H.-&1'/3F3(&O2(.I4('H,(().H.-.H(I.(&(+(+,+(&.$FD($$#(D(D'%$$($ED($'%&%($F$6,($$$FE'D(&&D&$)('+&'.#+$%$E$%$$$+$/%%$$%)+(+-+(%&%(&*-%$F%$C'$E$&$F#(D%$(%%%%'%$(%'%$$$%/+-*0$%$%$3)'-&-,(*(0*.,)2&(((&+(+))*0&0((/*,*)0&().&(($&%-$-$&%$$-#)%%$($($$%'%'%&%$$E$0(,(-(*$'$-$F$&%')/))/(+)1()($F$&$%&&)(%)+(+-+(&(%$%$&(+(&&C($'$'%%$%%$$(%'%$$E$+&%%K&)$'(((,(($F$+$F%'C)%%''$'&&D'%$$($ED($'$*)',&(.%&('$'%E$)*&*,%,%.%&((%(%,%/(-%%'&$'$F$(D&#($&$%$'($$%%'&$'*+'+,+(&-$E$F$F$(#($'$E$F$F#F$$$F$F#'$&$&D($'%$$E$F$F$&#'$($(%$$&$0%%$%$&$FC)$($$%D%$E&E&%$D'$$%DD($)&%%&$'&%E$$%&&&$&(&$%$&$&%&&)%*$*$*$*$*$*$*$&%(%*$&&'$&'$'%E$$%$%'%$%%%%%')%D'$F%$%&(%D(D&$*%&#'$*'*'('&*%%'&&)%$&''$'%$$'$()$%(%&%'%%&$&'$E$('&'%&''''(&('&&/.%&(&&&($($.()(+0'0'0(&%%&'$&%%&$E&G%%$F%$&&%'%&'$'$'$&$'$'$'$'$&%'$'$'$&$'$'$'$'$'$'$&&&%'$'$'$&$'$'$'$'$&(&'&(&%'$'$'$&$'$'$'$'$'$'$$($'E'$F%&%%'$%%'$''$&'%%%'$'$($#)%$&&&(&&'%&&&D%&&%$'&&E'%&%&(%$&D'%(E%'($E$&%&('%$$%&$&$'%'..()%*$*&*'*'&$&(&&&'$'(&$'($)$%&($&$'%'))&%%'&&&%E&&F$'%$'%&$F%%'$&$'$$'$))$%&&%%')$%$&(&&'%&&&%&D%')$&+*'(&((F&&.-(%&%&$*%&$(#'$&$(%'%%%%'$$)%&$(%$$$%(&%%(D%%&%($(%D$''$$&'&*''$%$%(%&%$F&)*&&$&$(&&$(%E%$&%(&&(&'&)%/%*'-'..($*%'&&$F&$%%%'$'%%'$$'%&$)$&%)#(%%D(%'$(%%G$%'%$$&$$$'%D$$E'%$&&$$%)%$%$&&$'%&(&($%%'%($$%%%$'%E$&'%%&%%'&'$$(&'%&&**'%'&&&%(%%)$'%&$&%&%%$%E$D&%%$&%&%,&,#0$%$($(%&&&%D$'$G$&%&%&$&$F%'&$'$$*D(($H$($($($'%($G%($($'%'%($'%&%%&$F#%%$$(%&($%$$($'%$$&$$%$%$&$&(%$&%&&)$*$&D'%$E$$%$$'$&$$%$%$%$$%%%''%$&$'$%&$F$'$&%%'$'$D$%%&%%&%'%(%*'%&&&)((&'&&$K%E#'$(%%%'%'&$'&'$$&$'$()&%'%'$E$*&($'%'%.'-%E%'$F%'%'$(%'C)$$E&%$$&E&$%%DD($$%'&%%'%&$'$'&%''''&%%%%&$$%'%&(&%'%$&&&(''&(&'$&%&%E%%$'D($F%%'$'&'$($'$$$%'$'E%#(%$$E$'$F$F%'$'#(($$(%$$E$($&$&$F$F#(%%%'$'$$%$$&$(%)%'%'%%'$'%%$E&%%'$(%'%'%'%'%'&'%%$&&&$'D$'%&%'($&%'&)$$(%'&%%%%$$&%&($%(&(%%$$%*,''..%'-'-1$,+,-'-%$%$&$&(%$&%&&)$*$&D'%&*'&'()''&'&$(%'%D$$%$$''$($%&$&$$%&%)%'%&$(%')'$%%%''%$&$'$%&$'&%%&%.+-')'-%.,(%&&D&&%(%'&&%$&'&$$&'%$'%)%&($%$%&$(%E%$%%'$'$%%&%($%'D$%%&%%&%'%'%'%(%'&$'$'$$*&'$K%E#(D&%%&$'&%$&&)')')%%'$(%$$'$/$E$%D'%$&&&&F&%&($($)$$&%%$($(%E$$$F%'$$%)%&#F%D&D$,(-%D%D&D$-$(%'$'%'%E%$&D&E&%&'%&(%*$D&%F(D$&&&%'%&(F%%%$$'$$%&%''$(%%F%'%'&E%')$$E$E%$&$'D'H&D%&%$&$$'%&%&$$%$&$%$$&$'%D%&%%%$&*(-&$'D'H&D'$%&%$&%($$&$FE$&%(D(F(%)$)$&%(%)$)$$&'('E'D%(%$&&&D'$(E$'%&(D(D%,%&($$%&&&D&D%*)+%%'$($%&%&%((%%%'D'$'F*%,D&%(E&$'D'$'F*%,D$&E'%%%.0%,(1%$$%$&&&%$(%'%E%'%E&D%(%'&D&D'F%'&G%F$'%''$(%%'#%D(%%$&G$%$$'%'%%%%%'$'$'%D$&E'%$$'%$$&$'%&&'%&%$$'%&%(&$&&$F$&%&%&$$%&%$&%(%F$F$%'%%%(%$$&E'%%D(&&)%D&$'#&F$''&&'$&$$%$(&&&&&$&'$E$%&$%'%&$$%*%$$()$'%%%'''$'&'%($'$G%'&'&$$$*%EE&$$%$%%%&%$&$')'*'%'*(&(&'&%&($%%&%&&%%&(''''&$'%%&%'$F%$$(#F$&$F$($F$-'&%&(%E%#(%%%'$'$&$F&&%&%)%%'$'$'%E&%%'%'$(%'$'%'%'%'%'&'%'$%'&%('$'%&%'($&%'&)$$(%'&%%%%$$&%(%&($%%$&'&'''$%%E$$(%'%D$''$($%$&$$,-'(./%(-,+(.(-(-%%%-$'%&%$$()'$'$'&%%&%&&D&&%($&'%%)$'$(%E%$%%&%($$(%'%%'$'$''$)$$#)$'$$%$%%&&%&%$&&%&%%&%&&%)%&%$$&'$'$$'%''$(%E%%%%'%)'$%%$E&&$'%'&$%)(+E$$'($($%$&&&$'$&$'$&$'$&%&'&'$'$/&&%)%%&%%$&$'D$(%$&$'%%E$()&&$$'(D&%(D%&($(&+%'$($(&+%%$&&($&$$'$F%'%'%'$&'$%0+&&%$%&$&&&$'&&'&%'$&'&'&&)%+$)&,$'%'%($%%')'*'%'*(&(&'&%$%%%$F$F$F$&$&&'&&$'&&'(%&'&'&%'$&'&&)%+$)&,$'%'%($$'%''$(%%'D'#)%$$&$(%'%$$&$($E$(('&%(&($%,(&&&%&&&E&$'E&($)%($%%$&%$&&&&&D'&%%$($'%)+'+'/%+$+(0%&&&$&(&'&%&'%)$F&$%&%'$'%1*-#'$&D(%%$'&&D'%$$'%'%&$(%DD($''$%&$()%&&%&$'E$$'%E$)%,%.,(%&%%'$'&%+$()%&&%&%&$F$'%'%%'$$'E%$)#'$&'$$'$(%+&(&*&&'$'(&$'%&('K/D(J/D&('..($%$'$%&&&%%'%'&$$E$'$G'D$F$'$'$F%G(D&F(D$)#($(&%($%'$E$F$$$$%'$F#'%&%%$'$E$'%&$$$'%&$&$&$'%E&&%'$'%&$F%'$(%&$&$(C)&$$'%$D%$E$&$F$F$&E%#)$(%$$&$(%%$E$&$)$F$F$%%%0@0000H8H40H000047P00P@001000@0B0HP@:H9T8P000LB8d@800@I0<110000QQ8400P10030005940@410020000Q02000@0200000@P0101@8000440400000000808000000000@00000000P`0000000040400@0004<000000000008000030000000000P020T400020@0@00000000000000000000000000P0000000400400000400220080000100000000000000000P000000000000P000000@00402000000000@00000000000000000000040000000000000", "Æ&ÁĂÂА𝔄ÀΑĀ⩓Ą𝔸⁡Å𝒜≔ÃÄ∖⫧⌆Б∵ℬΒ𝔅𝔹˘ℬ≎Ч©Ć⋒ⅅℭČÇĈ∰Ċ¸·ℭΧ⊙⊖⊕⊗∲”’∷⩴≡∯∮ℂ∐∳⨯𝒞⋓≍ⅅ⤑ЂЅЏ‡↡⫤ĎД∇Δ𝔇´˙˝`˜⋄ⅆ𝔻¨⃜≐∯¨⇓⇐⇔⫤⟸⟺⟹⇒⊨⇑⇕∥↓⤓⇵̑⥐⥞↽⥖⥟⇁⥗⊤↧⇓𝒟ĐŊÐÉĚÊЭĖ𝔈È∈Ē◻▫Ę𝔼Ε⩵≂⇌ℰ⩳ΗË∃ⅇФ𝔉◼▪𝔽∀ℱℱЃ>ΓϜĞĢĜГĠ𝔊⋙𝔾≥⋛≧⪢≷⩾≳𝒢≫Ъˇ^Ĥℌℋℍ─ℋĦ≎≏ЕIJЁÍÎИİℑÌℑĪⅈ⇒∬∫⋂⁣⁢Į𝕀ΙℐĨІÏĴЙ𝔍𝕁𝒥ЈЄХЌΚĶК𝔎𝕂𝒦Љ<ĹΛ⟪ℒ↞ĽĻЛ⟨←⇤⇆⌈⟦⥡⇃⥙⌊↔⥎⊣↤⥚⊲⧏⊴⥑⥠↿⥘↼⥒⇐⇔⋚≦≶⪡⩽≲𝔏⋘⇚Ŀ⟵⟷⟶⟸⟺⟹𝕃↙↘ℒ↰Ł≪⤅М ℳ𝔐∓𝕄ℳΜЊŃŇŅН​​​​≫≪\n𝔑⁠\xA0ℕ⫬≢≭∦∉≠≂̸∄≯≱≧̸≫̸≹⩾̸≵≎̸≏̸⋪⧏̸⋬≮≰≸≪̸⩽̸≴⪢̸⪡̸⊀⪯̸⋠∌⋫⧐̸⋭⊏̸⋢⊐̸⋣⊂⃒⊈⊁⪰̸⋡≿̸⊃⃒⊉≁≄≇≉∤𝒩ÑΝŒÓÔОŐ𝔒ÒŌΩΟ𝕆“‘⩔𝒪ØÕ⨷Ö‾⏞⎴⏜∂П𝔓ΦΠ±ℌℙ⪻≺⪯≼≾″∏∷∝𝒫Ψ\"𝔔ℚ𝒬⤐®Ŕ⟫↠⤖ŘŖРℜ∋⇋⥯ℜΡ⟩→⇥⇄⌉⟧⥝⇂⥕⌋⊢↦⥛⊳⧐⊵⥏⥜↾⥔⇀⥓⇒ℝ⥰⇛ℛ↱⧴ЩШЬŚ⪼ŠŞŜС𝔖↓←→↑Σ∘𝕊√□⊓⊏⊑⊐⊒⊔𝒮⋆⋐⋐⊆≻⪰≽≿∋∑⋑⊃⊇⋑Þ™ЋЦ ΤŤŢТ𝔗∴Θ   ∼≃≅≈𝕋⃛𝒯ŦÚ↟⥉ЎŬÛУŰ𝔘ÙŪ_⏟⎵⏝⋃⊎Ų𝕌↑⤒⇅↕⥮⊥↥⇑⇕↖↗ϒΥŮ𝒰ŨÜ⊫⫫В⊩⫦⋁‖‖∣|❘≀ 𝔙𝕍𝒱⊪Ŵ⋀𝔚𝕎𝒲𝔛Ξ𝕏𝒳ЯЇЮÝŶЫ𝔜𝕐𝒴ŸЖŹŽЗŻ​Ζℨℤ𝒵áă∾∾̳∿â´аæ⁡𝔞àℵℵαā⨿&∧⩕⩜⩘⩚∠⦤∠∡⦨⦩⦪⦫⦬⦭⦮⦯∟⊾⦝∢Å⍼ą𝕒≈⩰⩯≊≋'≈≊å𝒶*≈≍ãä∳⨑⫭≌϶‵∽⋍⊽⌅⌅⎵⎶≌б„∵∵⦰϶ℬβℶ≬𝔟⋂◯⋃⨀⨁⨂⨆★▽△⨄⋁⋀⤍⧫▪▴▾◂▸␣▒░▓█=⃥≡⃥⌐𝕓⊥⊥⋈╗╔╖╓═╦╩╤╧╝╚╜╙║╬╣╠╫╢╟⧉╕╒┐┌─╥╨┬┴⊟⊞⊠╛╘┘└│╪╡╞┼┤├‵˘¦𝒷⁏∽⋍\\⧅⟈••≎⪮≏≏ć∩⩄⩉⩋⩇⩀∩︀⁁ˇ⩍čçĉ⩌⩐ċ¸⦲¢·𝔠ч✓✓χ○⧃ˆ≗↺↻®Ⓢ⊛⊚⊝≗⨐⫯⧂♣♣:≔≔,@∁∘∁ℂ≅⩭∮𝕔∐©℗↵✗𝒸⫏⫑⫐⫒⋯⤸⤵⋞⋟↶⤽∪⩈⩆⩊⊍⩅∪︀↷⤼⋞⋟⋎⋏¤↶↷⋎⋏∲∱⌭⇓⥥†ℸ↓‐⊣⤏˝ďдⅆ‡⇊⩷°δ⦱⥿𝔡⇃⇂⋄⋄♦♦¨ϝ⋲÷÷⋇⋇ђ⌞⌍$𝕕˙≐≑∸∔⊡⌆↓⇊⇃⇂⤐⌟⌌𝒹ѕ⧶đ⋱▿▾⇵⥯⦦џ⟿⩷≑é⩮ě≖ê≕эėⅇ≒𝔢⪚è⪖⪘⪙⏧ℓ⪕⪗ē∅∅∅   ŋ ę𝕖⋕⧣⩱εεϵ≖≕≂⪖⪕=≟≡⩸⧥≓⥱ℯ≐≂ηðë€!∃ℰⅇ≒ф♀ffiffffl𝔣fifj♭fl▱ƒ𝕗∀⋔⫙⨍½⅓¼⅕⅙⅛⅔⅖¾⅗⅜⅘⅚⅝⅞⁄⌢𝒻≧⪌ǵγϝ⪆ğĝгġ≥⋛≥≧⩾⩾⪩⪀⪂⪄⋛︀⪔𝔤≫⋙ℷѓ≷⪒⪥⪤≩⪊⪊⪈⪈≩⋧𝕘`ℊ≳⪎⪐>⪧⩺⋗⦕⩼⪆⥸⋗⋛⪌≷≳≩︀≩︀⇔ ½ℋъ↔⥈↭ℏĥ♥♥…⊹𝔥⤥⤦⇿∻↩↪𝕙―𝒽ℏħ⁃‐í⁣îие¡⇔𝔦ìⅈ⨌∭⧜℩ijīℑℐℑı⊷Ƶ∈℅∞⧝ı∫⊺ℤ⊺⨗⨼ёį𝕚ι⨼¿𝒾∈⋹⋵⋴⋳∈⁢ĩіïĵй𝔧ȷ𝕛𝒿јєκϰķк𝔨ĸхќ𝕜𝓀⇚⇐⤛⤎≦⪋⥢ĺ⦴ℒλ⟨⦑⟨⪅«←⇤⤟⤝↩↫⤹⥳↢⪫⤙⪭⪭︀⤌❲{[⦋⦏⦍ľļ⌈{л⤶“„⥧⥋↲≤←↢↽↼⇇↔⇆⇋↭⋋⋚≤≦⩽⩽⪨⩿⪁⪃⋚︀⪓⪅⋖⋚⪋≶≲⥼⌊𝔩≶⪑↽↼⥪▄љ≪⇇⌞⥫◺ŀ⎰⎰≨⪉⪉⪇⪇≨⋦⟬⇽⟦⟵⟷⟼⟶↫↬⦅𝕝⨭⨴∗_◊◊⧫(⦓⇆⌟⇋⥭‎⊿‹𝓁↰≲⪍⪏[‘‚ł<⪦⩹⋖⋋⋉⥶⩻⦖◃⊴◂⥊⥦≨︀≨︀∺¯♂✠✠↦↦↧↤↥▮⨩м—∡𝔪℧µ∣*⫰·−⊟∸⨪⫛…∓⊧𝕞∓𝓂∾μ⊸⊸⋙̸≫⃒≫̸⇍⇎⋘̸≪⃒≪̸⇏⊯⊮∇ń∠⃒≉⩰̸≋̸ʼn≉♮♮ℕ\xA0≎̸≏̸⩃ňņ≇⩭̸⩂н–≠⇗⤤↗↗≐̸≢⤨≂̸∄∄𝔫≧̸≱≱≧̸⩾̸⩾̸≵≯≯⇎↮⫲∋⋼⋺∋њ⇍≦̸↚‥≰↚↮≰≦̸⩽̸⩽̸≮≴≮⋪⋬∤𝕟¬∉⋹̸⋵̸∉⋷⋶∌∌⋾⋽∦∦⫽⃥∂̸⨔⊀⋠⪯̸⊀⪯̸⇏↛⤳̸↝̸↛⋫⋭⊁⋡⪰̸𝓃∤∦≁≄≄∤∦⋢⋣⊄⫅̸⊈⊂⃒⊈⫅̸⊁⪰̸⊅⫆̸⊉⊃⃒⊉⫆̸≹ñ≸⋪⋬⋫⋭ν#№ ⊭⤄≍⃒⊬≥⃒>⃒⧞⤂≤⃒<⃒⊴⃒⤃⊵⃒∼⃒⇖⤣↖↖⤧Ⓢó⊛⊚ôо⊝ő⨸⊙⦼œ⦿𝔬˛ò⧁⦵Ω∮↺⦾⦻‾⧀ōωο⦶⊖𝕠⦷⦹⊕∨↻⩝ℴℴªº⊶⩖⩗⩛ℴø⊘õ⊗⨶ö⌽∥¶∥⫳⫽∂п%.‰⊥‱𝔭φϕℳ☎π⋔ϖℏℎℏ+⨣⊞⨢∔⨥⩲±⨦⨧±⨕𝕡£≺⪳⪷≼⪯≺⪷≼⪯⪹⪵⋨≾′ℙ⪵⪹⋨∏⌮⌒⌓∝∝≾⊰𝓅ψ 𝔮⨌𝕢⁗𝓆ℍ⨖?≟\"⇛⇒⤜⤏⥤∽̱ŕ√⦳⟩⦒⦥⟩»→⥵⇥⤠⤳⤞↪↬⥅⥴↣↝⤚∶ℚ⤍❳}]⦌⦎⦐řŗ⌉}р⤷⥩””↳ℜℛℜℝ▭®⥽⌋𝔯⇁⇀⥬ρϱ→↣⇁⇀⇄⇌⇉↝⋌˚≓⇄⇌‏⎱⎱⫮⟭⇾⟧⦆𝕣⨮⨵)⦔⨒⇉›𝓇↱]’’⋌⋊▹⊵▸⧎⥨℞ś‚≻⪴⪸š≽⪰şŝ⪶⪺⋩⨓≿с⋅⊡⩦⇘⤥↘↘§;⤩∖∖✶𝔰⌢♯щш∣∥­σςς∼⩪≃≃⪞⪠⪝⪟≆⨤⥲←∖⨳⧤∣⌣⪪⪬⪬︀ь/⧄⌿𝕤♠♠∥⊓⊓︀⊔⊔︀⊏⊑⊏⊑⊐⊒⊐⊒□□▪▪→𝓈∖⌣⋆☆★ϵϕ¯⊂⫅⪽⊆⫃⫁⫋⊊⪿⥹⊂⊆⫅⊊⫋⫇⫕⫓≻⪸≽⪰⪺⪶⋩≿∑♪⊃¹²³⫆⪾⫘⊇⫄⟉⫗⥻⫂⫌⊋⫀⊃⊇⫆⊋⫌⫈⫔⫖⇙⤦↙↙⤪ß⌖τ⎴ťţт⃛⌕𝔱∴∴θϑϑ≈∼ ≈∼þ˜×⊠⨱⨰∭⤨⊤⌶⫱𝕥⫚⤩‴™▵▿◃⊴≜▹⊵◬≜⨺⨹⧍⨻⏢𝓉цћŧ≬↞↠⇑⥣ú↑ўŭûу⇅ű⥮⥾𝔲ù↿↾▀⌜⌜⌏◸ū¨ų𝕦↑↕↿↾⊎υϒυ⇈⌝⌝⌎ů◹𝓊⋰ũ▵▴⇈ü⦧⇕⫨⫩⊨⦜ϵϰ∅ϕϖ∝↕ϱς⊊︀⫋︀⊋︀⫌︀ϑ⊲⊳в⊢∨⊻≚⋮||𝔳⊲⊂⃒⊃⃒𝕧∝⊳𝓋⫋︀⊊︀⫌︀⊋︀⦚ŵ⩟∧≙℘𝔴𝕨℘≀≀𝓌⋂◯⋃▽𝔵⟺⟷ξ⟸⟵⟼⋻⨀𝕩⨁⨂⟹⟶𝓍⨆⨄△⋁⋀ýяŷы¥𝔶ї𝕪𝓎юÿźžзżℨζ𝔷ж⇝𝕫𝓏‍‌"];
16602
16608
  /** Multiplier deriving the first candidate bucket from a key. */
16603
- const BUCKET_HASH_1 = 2654435761;
16609
+ const BUCKET_HASH_1 = 0x9e3779b1;
16604
16610
  /** Multiplier deriving the second candidate bucket from a key. */
16605
- const BUCKET_HASH_2 = 2246822507;
16611
+ const BUCKET_HASH_2 = 0x85ebca6b;
16606
16612
  /** Size of the (c0,c1) class table (10-bit index). */
16607
16613
  const PAIR_TABLE_SIZE = 1024;
16608
16614
  /**
@@ -25412,9 +25418,9 @@ async function isDirectory(path) {
25412
25418
  }
25413
25419
  }
25414
25420
  // package.json
25415
- var version$1 = "0.48.0";
25416
- var dependencies = { "playwright-core": "1.65.0" };
25417
- var peerDependencies = { "oxfmt": "0.78.0" };
25421
+ var version$1 = "0.50.0";
25422
+ var dependencies = { "playwright-core": "1.65.1" };
25423
+ var peerDependencies = { "oxfmt": "0.79.0" };
25418
25424
  // src/shared/version.ts
25419
25425
  const version = version$1;
25420
25426
  // src/cli/client-dir.ts
@@ -25717,7 +25723,7 @@ async function release(root, session, frame, now) {
25717
25723
  * frame hugs neither axis.
25718
25724
  */
25719
25725
  async function addFrame(root, ref, options) {
25720
- const { journal } = options;
25726
+ const { journal, onNamedWidth } = options;
25721
25727
  const frame = await resolveFrameRef(root, ref, {
25722
25728
  ...options,
25723
25729
  allowMissing: true
@@ -25725,30 +25731,38 @@ async function addFrame(root, ref, options) {
25725
25731
  const page = pageDir(frame);
25726
25732
  const reserved = options.x === void 0 && options.y === void 0 ? await reservedBox(root, refOf$1(frame)) : void 0;
25727
25733
  const sized = options.size !== void 0 || options.width !== void 0 || options.height !== void 0;
25728
- const size = reserved && !sized ? {
25734
+ const statedSize = reserved && !sized ? {
25729
25735
  width: reserved.width,
25730
25736
  height: reserved.height
25731
25737
  } : sizeOf(options);
25732
25738
  const scroll = options.scroll ?? false;
25733
- const hugs = scroll ? {
25739
+ const statedHugs = scroll ? {
25734
25740
  hugWidth: false,
25735
25741
  hugHeight: false
25736
25742
  } : reserved && !sized ? {
25737
25743
  hugWidth: reserved.hugWidth ?? false,
25738
25744
  hugHeight: reserved.hugHeight ?? false
25739
25745
  } : hugsOf(options);
25746
+ let named;
25740
25747
  await withLayouts([page], async (layouts) => {
25741
25748
  const layout = layoutAt(layouts, page);
25742
25749
  const exists = existsSync(frame.path);
25743
25750
  if (exists && layout.hasEntry(frame.name)) throw new FrameboardError("name-taken", `${frame.project}/${frame.page}/${frame.name} is already a placed frame.`, { ref: refOf$1(frame) });
25744
25751
  if (exists && options.body !== void 0) throw new FrameboardError("name-taken", `${frame.project}/${frame.page}/${frame.name} already has a file, so nothing was written into it.`, { ref: refOf$1(frame) });
25752
+ if (onNamedWidth && !reserved && !sized && !layout.hasEntry(frame.name)) named = namedWidth(frame.name);
25753
+ const size = named === void 0 ? statedSize : { width: named };
25754
+ const hugs = named === void 0 ? statedHugs : {
25755
+ ...statedHugs,
25756
+ hugWidth: false
25757
+ };
25758
+ const showDevice = options.showDevice || named !== void 0;
25745
25759
  const names = exists ? layout.names : [...layout.names, frame.name].sort();
25746
25760
  const placed = placeFrames(layout.file.frames, names.filter((name) => layout.hasEntry(name)));
25747
25761
  const stale = placed.get(frame.name);
25748
25762
  const width = size.width ?? stale?.box.width ?? FRAME_SIZES["desktop"].width;
25749
25763
  const computed = stale ?? placeNext([...placed.values()], {
25750
25764
  width,
25751
- device: options.showDevice ? deviceForWidth(width) : null
25765
+ device: showDevice ? deviceForWidth(width) : null
25752
25766
  });
25753
25767
  const widths = linkedWidths(refOf$1(frame), options.widths, {
25754
25768
  width,
@@ -25772,10 +25786,11 @@ async function addFrame(root, ref, options) {
25772
25786
  ...hugs,
25773
25787
  scroll,
25774
25788
  widths,
25775
- ...options.showDevice ? { showDevice: true } : {}
25789
+ ...showDevice ? { showDevice: true } : {}
25776
25790
  });
25777
25791
  layout.renumber();
25778
25792
  }, journal);
25793
+ if (named !== void 0) onNamedWidth?.(named);
25779
25794
  return frameRecord(root, frame.project, frame.page, frame.name);
25780
25795
  }
25781
25796
  /**
@@ -26908,7 +26923,11 @@ const toRequestError = (e) => {
26908
26923
  return new RequestError(e.message, { cause: e });
26909
26924
  };
26910
26925
  const GlobalRequest = global.Request;
26911
- var Request$1 = class extends GlobalRequest {
26926
+ var Request$1 = class Request$1 extends GlobalRequest {
26927
+ static [Symbol.hasInstance](instance) {
26928
+ if (this === Request$1) return instance instanceof GlobalRequest || Function.prototype[Symbol.hasInstance].call(this, instance);
26929
+ return Function.prototype[Symbol.hasInstance].call(this, instance);
26930
+ }
26912
26931
  constructor(input, options) {
26913
26932
  if (typeof input === "object" && getRequestCache in input) {
26914
26933
  const hasReplacementBody = options !== void 0 && "body" in options && options.body != null;
@@ -26947,8 +26966,8 @@ const readBodyBufferedBeforeDisconnect = (incoming, chunks) => {
26947
26966
  else if (incomingWithRecovery[bodyBufferedLengthBeforeDisconnectKey] !== void 0 && incoming.readableLength !== incomingWithRecovery[bodyBufferedLengthBeforeDisconnectKey]) result = newBodyUnusableError();
26948
26967
  else {
26949
26968
  const bodyChunks = chunks ?? [];
26950
- const chunk = incoming.read();
26951
- if (chunk !== null) bodyChunks.push(toBufferChunk(chunk, incoming.readableEncoding));
26969
+ let chunk;
26970
+ while ((chunk = incoming.read()) !== null) bodyChunks.push(toBufferChunk(chunk, incoming.readableEncoding));
26952
26971
  const buffer = bodyChunks.length === 1 ? bodyChunks[0] : Buffer.concat(bodyChunks);
26953
26972
  result = buffer;
26954
26973
  const contentLength = incoming.headers["content-length"];
@@ -27285,6 +27304,9 @@ Object.defineProperty(requestPrototype, "blob", { value: function() {
27285
27304
  return new Response(buf, type ? { headers: { "content-type": type } } : void 0).blob();
27286
27305
  });
27287
27306
  } });
27307
+ Object.defineProperty(requestPrototype, "bytes", { value: function() {
27308
+ return this.arrayBuffer().then((buf) => new Uint8Array(buf));
27309
+ } });
27288
27310
  Object.defineProperty(requestPrototype, "json", { value: function() {
27289
27311
  if (this[bodyConsumedDirectlyKey]) return rejectBodyUnusable();
27290
27312
  return this.text().then(JSON.parse);
@@ -27339,6 +27361,10 @@ const GlobalResponse = global.Response;
27339
27361
  var Response$1 = class Response$1 {
27340
27362
  #body;
27341
27363
  #init;
27364
+ static [Symbol.hasInstance](instance) {
27365
+ if (this === Response$1) return instance instanceof GlobalResponse || Function.prototype[Symbol.hasInstance].call(this, instance);
27366
+ return Function.prototype[Symbol.hasInstance].call(this, instance);
27367
+ }
27342
27368
  [getResponseCache]() {
27343
27369
  const cache = this[cacheKey];
27344
27370
  const liveHeaders = cache && cache[2] instanceof Headers ? cache[2] : void 0;
@@ -27359,7 +27385,7 @@ var Response$1 = class Response$1 {
27359
27385
  this[getResponseCache]();
27360
27386
  return;
27361
27387
  }
27362
- this.#init = init instanceof Response$1 ? init.#init : init;
27388
+ this.#init = #init in init ? init.#init : init;
27363
27389
  headers = new Headers(init.headers);
27364
27390
  } else this.#init = init;
27365
27391
  if (body == null || typeof body === "string" || typeof body?.getReader !== "undefined" || body instanceof Blob || body instanceof Uint8Array) this[cacheKey] = [
@@ -27400,6 +27426,7 @@ var Response$1 = class Response$1 {
27400
27426
  [
27401
27427
  "arrayBuffer",
27402
27428
  "blob",
27429
+ "bytes",
27403
27430
  "clone",
27404
27431
  "formData",
27405
27432
  "json",
@@ -28069,6 +28096,7 @@ const handleParsingAllValues = (form, key, value) => {
28069
28096
  * @param {BodyData} form - The form data object.
28070
28097
  * @param {string} key - The dot notation key.
28071
28098
  * @param {BodyDataValue} value - The value to assign.
28099
+ * @param {{ count: number }} state - The state object tracking nesting depth.
28072
28100
  */
28073
28101
  const handleParsingNestedValues = (form, key, value, state) => {
28074
28102
  if (/(?:^|\.)__proto__\./.test(key)) return;
@@ -30694,7 +30722,7 @@ function createChangeTracker(root, { now = () => /* @__PURE__ */ new Date(), log
30694
30722
  };
30695
30723
  return {
30696
30724
  prime: async (board) => {
30697
- const [saved] = await Promise.all([loadChanges(root, logCap), ...framesOf$2(board).map(({ ref, path }) => hold(ref, path))]);
30725
+ const [saved] = await Promise.all([loadChanges(root, logCap), ...framesOf$4(board).map(({ ref, path }) => hold(ref, path))]);
30698
30726
  changes.push(...saved.changes);
30699
30727
  for (const change of saved.changes) {
30700
30728
  const source = change.before ? saved.versions.get(change.before) : void 0;
@@ -30724,7 +30752,7 @@ function createChangeTracker(root, { now = () => /* @__PURE__ */ new Date(), log
30724
30752
  },
30725
30753
  update: async (board, paths, claims) => {
30726
30754
  batches += 1;
30727
- const frames = framesOf$2(board);
30755
+ const frames = framesOf$4(board);
30728
30756
  const present = new Set(frames.map(({ ref }) => ref));
30729
30757
  for (const [ref, file] of held) {
30730
30758
  if (present.has(ref)) continue;
@@ -30815,7 +30843,7 @@ function writtenPaths(step) {
30815
30843
  return [];
30816
30844
  });
30817
30845
  }
30818
- function framesOf$2(board) {
30846
+ function framesOf$4(board) {
30819
30847
  return board.projects.flatMap((project) => project.pages.flatMap((page) => page.frames.map((frame) => ({
30820
30848
  ref: frame.ref,
30821
30849
  path: frame.path
@@ -34090,7 +34118,7 @@ var _t = class {
34090
34118
  };
34091
34119
  }
34092
34120
  };
34093
- var F = 16777215;
34121
+ var F = 0xffffff;
34094
34122
  var O = 24;
34095
34123
  var kt = 1;
34096
34124
  var Vt = 2;
@@ -36640,7 +36668,7 @@ const xmlEncodeRegex = /["&'<>\u0080-\uFFFF]/g;
36640
36668
  * @param code Code unit to test.
36641
36669
  */
36642
36670
  function isXmlEscapable(code) {
36643
- return code >= 128 || code >= 32 && code < 64 && (1342177476 >>> code & 1) === 1;
36671
+ return code >= 128 || code >= 32 && code < 64 && (0x500000c4 >>> code & 1) === 1;
36644
36672
  }
36645
36673
  /**
36646
36674
  * Encodes all non-ASCII characters, as well as characters not valid in XML
@@ -38493,7 +38521,7 @@ function buildCascade(source, tokens, { properties = READ } = {}) {
38493
38521
  compiled.declarations = declared.flatMap((node) => node.type === "decl" ? [{
38494
38522
  property: node.prop.startsWith("--") ? node.prop : node.prop.toLowerCase(),
38495
38523
  value: node.value,
38496
- important: node.important,
38524
+ important: node.important === true,
38497
38525
  inline: false,
38498
38526
  specificity,
38499
38527
  order: order++,
@@ -38673,7 +38701,7 @@ function inlineDeclarations$1(element, reads) {
38673
38701
  declarations.push({
38674
38702
  property: node.prop.startsWith("--") ? node.prop : node.prop.toLowerCase(),
38675
38703
  value: node.value,
38676
- important: node.important,
38704
+ important: node.important === true,
38677
38705
  inline: true,
38678
38706
  specificity: [
38679
38707
  0,
@@ -46012,9 +46040,9 @@ function integer$1(value) {
46012
46040
  return typeof value === "number" && Number.isSafeInteger(value) ? value : null;
46013
46041
  }
46014
46042
  // src/server/sourcing/pack-glb.ts
46015
- const GLB_MAGIC = 1179937895;
46043
+ const GLB_MAGIC = 0x46546c67;
46016
46044
  const GLB_VERSION = 2;
46017
- const JSON_CHUNK = 1313821514;
46045
+ const JSON_CHUNK = 0x4e4f534a;
46018
46046
  const BIN_CHUNK = 5130562;
46019
46047
  const CHUNK_HEADER_BYTES = 8;
46020
46048
  /** The texture formats a glTF viewer reads with no extension named. */
@@ -49282,7 +49310,7 @@ function ruleValues(source) {
49282
49310
  declaration: {
49283
49311
  selector: written,
49284
49312
  property,
49285
- important: node.important
49313
+ important: node.important === true
49286
49314
  }
49287
49315
  });
49288
49316
  }
@@ -49325,7 +49353,7 @@ function inlineDeclarations(element) {
49325
49353
  declarations.push({
49326
49354
  property: normalProperty(node.prop),
49327
49355
  value: node.value.trim(),
49328
- important: node.important
49356
+ important: node.important === true
49329
49357
  });
49330
49358
  });
49331
49359
  return declarations;
@@ -51997,7 +52025,7 @@ function contentFormat() {
51997
52025
  `turn left or right turns a phone, a tablet, or a foldable a quarter, with the island on the left side for left and the right for right, and absent stands it upright. A phone's or a tablet's first turn keeps the box's upright width and height in upright, and the upright width still picks the device, so a turned phone reads as a phone however wide its box. A fixed or scroll box swaps its sides, and a hugging one takes the reference height of its upright width, ${FRAME_SIZES.phone.height} px for a phone, and hugs its height at that width. A turned phone draws no status bar and insets its page ${STATUS_BAR.height} px from each short side instead, with both strips in the page's own fill so the island stands over no content, and its buttons stand on its long edges: an ${FRAME_SIZES.phone.height} by ${FRAME_SIZES.phone.width} turned box shows a page ${FRAME_SIZES.phone.height - 2 * STATUS_BAR.height} by ${FRAME_SIZES.phone.width}, and a hugging one hugs at that page width. list reports turn while the frame is turned, shown or not, and never upright. Turning upright restores the kept size, even after a hand resize of the turned box. A turned foldable keeps no upright, since its pose gives its screen: its box is that screen with the sides swapped, ${POSE_SIZES.closed.height} by ${POSE_SIZES.closed.width} closed and ${POSE_SIZES.open.height} by ${POSE_SIZES.open.width} half or open, its island sits where the quarter turn puts it, its fold runs across the screen, and its page insets ${sideInset("foldable", "left")} px from each side edge in the page's own fill as a turned phone's does, so a turned closed box shows a page ${POSE_SIZES.closed.height - 2 * sideInset("foldable", "left")} by ${POSE_SIZES.closed.width}. A fold keeps the turn and takes the new pose's swapped screen, upright restores the pose's screen, and --no-foldable stands it upright at that screen. frame device <frame-ref> --turn <upright|left|right> sets it, writing the layout entry alone, and a quarter turn refuses a laptop, a frame showing no device, and a frame holding extra widths, each with usage. A turned frame refuses new extra widths, and naming a turned phone or tablet the foldable stands it upright first. A phone's or a tablet's turn with no readable upright, or a value no reader knows, reads as upright.`,
51998
52026
  `foldable true has the frame name the foldable device over the one its width picks, and pose folds it: closed is the cover screen at ${POSE_SIZES.closed.width} by ${POSE_SIZES.closed.height}, and half and open are the inner screen at ${POSE_SIZES.open.width} by ${POSE_SIZES.open.height}, half shading the fold. Naming a foldable or setting a pose sets the box's width and height to that screen and turns both hug flags off, and writes the layout entry alone, never the frame file, so one file shows every pose and its content reflows as on the device. The body stands ${BEZELS.foldable.border} px past the box on every side. A newly named foldable starts in the pose nearest its width, closed up to 678 px wide and open past it. list reports device as foldable while it shows, and pose on every frame naming one, shown or not. With showDevice off the box keeps its pose's size and no body draws. A foldable draws no linked width and refuses a new one, and widths its entry held from before stay in the file undrawn, draw again once --no-foldable un-names it, and clear on frame resize --no-widths. Any other value of foldable reads as width-picked, a pose no reader knows reads as closed, and both are kept on write. An older Frameboard rewriting the entry may drop both keys, leaving a width-picked frame at the pose's size. frame device <frame-ref> --foldable names it and shows it, --pose <closed|half|open> folds it, and --no-foldable hands the pick back to the width at the size it stands.`,
51999
52027
  `An axis that hugs takes its size from the frame's content: a running serve measures it after each write to the frame file and when frame add places a file already written, its width at most ${FRAME_SIZES.desktop.width} px, and writes width and height alone, never a flag. Content sized off the viewport keeps the box it has.`,
52000
- "frame add with no size hugs both axes, --size or --width fixes the width and hugs the height, and --height fixes the height alone, its box standing in until serve measures. frame resize and a hand resize fix each axis they set, and frame fit sets the height and turns hugHeight on.",
52028
+ "frame add with no size hugs both axes, --size or --width fixes the width and hugs the height, and --height fixes the height alone, its box standing in until serve measures. With no --size, --width, or --height, no reserved box, and no entry left in layout.json by a missing file, frame add takes a name ending in -<px>, such as overview-390, as --width 390 with showDevice on, where <px> is the width of a size in frameSizes, and any other ending hugs both axes. frame resize and a hand resize fix each axis they set, and frame fit sets the height and turns hugHeight on.",
52001
52029
  "Frames sort by order, then name, and a write that changes order renumbers the page from 0.",
52002
52030
  `A frame file with no entry is unplaced: it reads at desktop size, y 0, 80 px past the right edge of every frame placed before it in name order. frame add places it 80 px past the placed frames alone, so the first unplaced file keeps that box and any later one moves left.`,
52003
52031
  "An entry with no frame file beside it is ignored on read and kept on write.",
@@ -52455,11 +52483,22 @@ function registerFrame(program, context) {
52455
52483
  data: record,
52456
52484
  human: `${what} ${record.ref}`
52457
52485
  });
52458
- act(withPosition(withSize(verb("add", "Place a frame past every frame, as written when its file exists and with a skeleton file only when none does, so write the file first to show no empty box. Each axis no size names hugs its content, so a preset or --width fixes the width and the height hugs.").option("--scroll", SCROLL_HELP).option("--widths <list>", WIDTHS_HELP, parseWidths).addOption(new Option("--device <on>", DEVICE_HELP).choices(DEVICE_ON)))), context, async ([ref = ""], { device, ...options }) => done(await addFrame(await boardOf(options, io), ref, {
52459
- ...options,
52460
- ...device ? { showDevice: true } : {},
52461
- cwd: io.cwd
52462
- }), "Added"));
52486
+ act(withPosition(withSize(verb("add", "Place a frame past every frame, as written when its file exists and with a skeleton file only when none does, so write the file first to show no empty box. Each axis no size names hugs its content, so a preset or --width fixes the width and the height hugs. With no size, and no reserved box or entry already in layout.json, a name ending in -<px> for a width a size names, such as overview-390, fixes that width and turns the device on.").option("--scroll", SCROLL_HELP).option("--widths <list>", WIDTHS_HELP, parseWidths).addOption(new Option("--device <on>", DEVICE_HELP).choices(DEVICE_ON)))), context, async ([ref = ""], { device, ...options }) => {
52487
+ let named;
52488
+ const data = await addFrame(await boardOf(options, io), ref, {
52489
+ ...options,
52490
+ ...device ? { showDevice: true } : {},
52491
+ onNamedWidth: (width) => {
52492
+ named = width;
52493
+ },
52494
+ cwd: io.cwd
52495
+ });
52496
+ const sized = named === void 0 ? "" : `, ${named} px wide from its name`;
52497
+ return {
52498
+ data,
52499
+ human: `Added ${data.ref}${sized}`
52500
+ };
52501
+ });
52463
52502
  act(verb("duplicate", "Copy a frame file byte for byte, on top").option("--to <page-ref>", "the page to copy into, defaulting to its own").option("--name <new>", "name of the copy, defaulting to the next free -2, -3"), context, async ([ref = ""], options) => done(await duplicateFrame(await boardOf(options, io), ref, {
52464
52503
  ...options,
52465
52504
  cwd: io.cwd
@@ -52579,7 +52618,7 @@ const BUNDLED_MODELS = [
52579
52618
  for: "image",
52580
52619
  folder: "diffusion_models",
52581
52620
  file: "flux-2-klein-4b-fp8.safetensors",
52582
- bytes: 4070624520,
52621
+ bytes: 0xf2a0cd08,
52583
52622
  url: "https://huggingface.co/black-forest-labs/FLUX.2-klein-4b-fp8/resolve/main/flux-2-klein-4b-fp8.safetensors"
52584
52623
  },
52585
52624
  {
@@ -52621,7 +52660,7 @@ const BUNDLED_MODEL_FILES = [
52621
52660
  for: "model",
52622
52661
  folder: "vae",
52623
52662
  file: "trellis_2_shape_vae_bf16.safetensors",
52624
- bytes: 1095844024,
52663
+ bytes: 0x415140b8,
52625
52664
  url: "https://huggingface.co/Comfy-Org/Pixal3D/resolve/main/vae/trellis_2_shape_vae_bf16.safetensors"
52626
52665
  },
52627
52666
  {
@@ -52635,7 +52674,7 @@ const BUNDLED_MODEL_FILES = [
52635
52674
  for: "model",
52636
52675
  folder: "clip_vision",
52637
52676
  file: "dino_v3_L_naf_fp32.safetensors",
52638
- bytes: 1215214176,
52677
+ bytes: 0x486eb260,
52639
52678
  url: "https://huggingface.co/Comfy-Org/Pixal3D/resolve/main/clip_vision/dino_v3_L_naf_fp32.safetensors"
52640
52679
  },
52641
52680
  {
@@ -55030,12 +55069,15 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
55030
55069
  else protocols = [options.protocols];
55031
55070
  } else protocols = [protocols];
55032
55071
  }
55033
- initAsClient(this, address, protocols, options);
55034
- } else {
55035
- this._autoPong = options.autoPong;
55036
- this._closeTimeout = options.closeTimeout;
55037
- this._isServer = true;
55072
+ options = initAsClient(this, address, protocols, options);
55073
+ } else this._isServer = true;
55074
+ if (options.autoPong) {
55075
+ this._autoPong = true;
55076
+ this._autoPongComplete = () => autoPongComplete(this);
55077
+ this._pendingAutoPongs = 0;
55078
+ this._maxPendingAutoPongs = options.maxPendingAutoPongs | 0;
55038
55079
  }
55080
+ this._closeTimeout = options.closeTimeout;
55039
55081
  }
55040
55082
  /**
55041
55083
  * For historical reasons, the custom "nodebuffer" type is used by the default
@@ -55476,6 +55518,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
55476
55518
  * fragments
55477
55519
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
55478
55520
  * size
55521
+ * @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
55522
+ * pending automatic pongs
55479
55523
  * @param {Number} [options.maxRedirects=10] The maximum number of redirects
55480
55524
  * allowed
55481
55525
  * @param {String} [options.origin] Value of the `Origin` or
@@ -55486,6 +55530,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
55486
55530
  * `Sec-WebSocket-Version` header
55487
55531
  * @param {Boolean} [options.skipUTF8Validation=false] Specifies whether or
55488
55532
  * not to skip UTF-8 validation for text and close messages
55533
+ * @return {Object} The resolved options object used for initialization
55489
55534
  * @private
55490
55535
  */
55491
55536
  function initAsClient(websocket, address, protocols, options) {
@@ -55496,7 +55541,8 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
55496
55541
  protocolVersion: protocolVersions[1],
55497
55542
  maxBufferedChunks: 262144,
55498
55543
  maxFragments: 16384,
55499
- maxPayload: 104857600,
55544
+ maxPayload: 0x6400000,
55545
+ maxPendingAutoPongs: 60,
55500
55546
  skipUTF8Validation: false,
55501
55547
  perMessageDeflate: true,
55502
55548
  followRedirects: false,
@@ -55512,8 +55558,6 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
55512
55558
  path: void 0,
55513
55559
  port: void 0
55514
55560
  };
55515
- websocket._autoPong = opts.autoPong;
55516
- websocket._closeTimeout = opts.closeTimeout;
55517
55561
  if (!protocolVersions.includes(opts.protocolVersion)) throw new RangeError(`Unsupported protocol version: ${opts.protocolVersion} (supported versions: ${protocolVersions.join(", ")})`);
55518
55562
  let parsedUrl;
55519
55563
  if (address instanceof URL) parsedUrl = address;
@@ -55703,6 +55747,7 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
55703
55747
  });
55704
55748
  if (opts.finishRequest) opts.finishRequest(req, websocket);
55705
55749
  else req.end();
55750
+ return opts;
55706
55751
  }
55707
55752
  /**
55708
55753
  * Emit the `'error'` and `'close'` events.
@@ -55859,10 +55904,25 @@ var require_websocket = /* @__PURE__ */ __commonJSMin(((exports, module) => {
55859
55904
  */
55860
55905
  function receiverOnPing(data) {
55861
55906
  const websocket = this[kWebSocket];
55862
- if (websocket._autoPong) websocket.pong(data, !this._isServer, NOOP);
55907
+ if (websocket._autoPong && websocket.readyState === WebSocket.OPEN) {
55908
+ if (websocket._maxPendingAutoPongs > 0 && websocket._pendingAutoPongs >= websocket._maxPendingAutoPongs) websocket.terminate();
55909
+ else {
55910
+ websocket._pendingAutoPongs++;
55911
+ websocket.pong(data, !this._isServer, websocket._autoPongComplete);
55912
+ }
55913
+ }
55863
55914
  websocket.emit("ping", data);
55864
55915
  }
55865
55916
  /**
55917
+ * The callback for automatic pong responses.
55918
+ *
55919
+ * @param {WebSocket} websocket The WebSocket instance
55920
+ * @private
55921
+ */
55922
+ function autoPongComplete(websocket) {
55923
+ websocket._pendingAutoPongs--;
55924
+ }
55925
+ /**
55866
55926
  * The listener of the `Receiver` `'pong'` event.
55867
55927
  *
55868
55928
  * @param {Buffer} data The data included in the pong frame
@@ -56165,6 +56225,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
56165
56225
  * fragments
56166
56226
  * @param {Number} [options.maxPayload=104857600] The maximum allowed message
56167
56227
  * size
56228
+ * @param {Number} [options.maxPendingAutoPongs=60] The maximum number of
56229
+ * pending automatic pongs
56168
56230
  * @param {Boolean} [options.noServer=false] Enable no server mode
56169
56231
  * @param {String} [options.path] Accept only connections matching this path
56170
56232
  * @param {(Boolean|Object)} [options.perMessageDeflate=false] Enable/disable
@@ -56186,7 +56248,8 @@ var require_websocket_server = /* @__PURE__ */ __commonJSMin(((exports, module)
56186
56248
  autoPong: true,
56187
56249
  maxBufferedChunks: 262144,
56188
56250
  maxFragments: 16384,
56189
- maxPayload: 104857600,
56251
+ maxPayload: 0x6400000,
56252
+ maxPendingAutoPongs: 60,
56190
56253
  skipUTF8Validation: false,
56191
56254
  perMessageDeflate: false,
56192
56255
  handleProtocols: null,
@@ -58402,7 +58465,7 @@ const defaultOptions = {
58402
58465
  directoryFilter: (_entryInfo) => true,
58403
58466
  type: EntryTypes.FILE_TYPE,
58404
58467
  lstat: false,
58405
- depth: 2147483648,
58468
+ depth: 0x80000000,
58406
58469
  alwaysStat: false,
58407
58470
  highWaterMark: 256
58408
58471
  };
@@ -61784,26 +61847,55 @@ function createBoardFindings(root, tokens = null) {
61784
61847
  const off = /* @__PURE__ */ new Map();
61785
61848
  const on = (ref, list) => withoutOff(list ?? [], off.get(projectOf(ref)));
61786
61849
  const merged = (ref, own) => [
61787
- ...own,
61850
+ ...own.findings,
61788
61851
  ...on(ref, change.get(ref)),
61789
- ...on(ref, browser.get(ref))
61852
+ ...on(ref, browser.get(ref)?.findings)
61790
61853
  ];
61791
61854
  return {
61855
+ prime: (board, stored) => {
61856
+ for (const project of board.projects) off.set(project.name, readConfig(root, project.name).off);
61857
+ for (const ref of framesOf$3(board).keys()) {
61858
+ const { checks, rendered } = stored[ref] ?? {};
61859
+ if (checks) held.set(ref, checks);
61860
+ if (rendered) browser.set(ref, rendered);
61861
+ }
61862
+ },
61863
+ kept: () => {
61864
+ const frames = {};
61865
+ for (const [ref, { key, findings }] of held) if (key !== void 0) frames[ref] = { checks: {
61866
+ key,
61867
+ findings
61868
+ } };
61869
+ for (const [ref, { key, findings }] of browser) {
61870
+ if (key === void 0) continue;
61871
+ frames[ref] = {
61872
+ ...frames[ref],
61873
+ rendered: {
61874
+ key,
61875
+ findings
61876
+ }
61877
+ };
61878
+ }
61879
+ return frames;
61880
+ },
61792
61881
  all: () => Object.fromEntries([...held].map(([ref, own]) => [ref, merged(ref, own)])),
61793
- setRendered: (ref, findings) => {
61794
- browser.set(ref, findings);
61882
+ setRendered: (ref, findings, key) => {
61883
+ browser.set(ref, {
61884
+ findings,
61885
+ key
61886
+ });
61795
61887
  const own = held.get(ref);
61796
61888
  return own ? { [ref]: merged(ref, own) } : {};
61797
61889
  },
61798
- rendered: (refs) => Object.fromEntries(refs.map((ref) => [ref, on(ref, browser.get(ref))])),
61890
+ rendered: (refs) => Object.fromEntries(refs.map((ref) => [ref, on(ref, browser.get(ref)?.findings)])),
61799
61891
  setChanged: (ref, findings) => {
61800
61892
  change.set(ref, findings);
61801
61893
  const own = held.get(ref);
61802
61894
  return own ? { [ref]: merged(ref, own) } : {};
61803
61895
  },
61804
61896
  changed: (refs) => Object.fromEntries(refs.map((ref) => [ref, on(ref, change.get(ref))])),
61805
- update: (board, paths) => {
61806
- const frames = framesOf$1(board);
61897
+ update: (board, refs, keys) => {
61898
+ const frames = framesOf$3(board);
61807
61899
  for (const ref of [
61808
61900
  ...held.keys(),
61809
61901
  ...change.keys(),
@@ -61813,7 +61905,6 @@ function createBoardFindings(root, tokens = null) {
61813
61905
  change.delete(ref);
61814
61906
  browser.delete(ref);
61815
61907
  }
61816
- const refs = paths === "all" ? [...frames.keys()] : recheckRefs(root, paths, board, tokens);
61817
61908
  const contexts = /* @__PURE__ */ new Map();
61818
61909
  const changed = {};
61819
61910
  for (const ref of refs) {
@@ -61827,8 +61918,12 @@ function createBoardFindings(root, tokens = null) {
61827
61918
  }
61828
61919
  const findings = checkOne(root, frame, context);
61829
61920
  if (findings === null) continue;
61830
- held.set(ref, findings);
61831
- changed[ref] = merged(ref, findings);
61921
+ const own = {
61922
+ findings,
61923
+ key: keys?.get(ref)
61924
+ };
61925
+ held.set(ref, own);
61926
+ changed[ref] = merged(ref, own);
61832
61927
  }
61833
61928
  return changed;
61834
61929
  }
@@ -61855,7 +61950,7 @@ function recheckRefs(root, paths, board, tokens = null) {
61855
61950
  function projectOf(ref) {
61856
61951
  return ref.slice(0, ref.indexOf("/"));
61857
61952
  }
61858
- function framesOf$1(board) {
61953
+ function framesOf$3(board) {
61859
61954
  const frames = /* @__PURE__ */ new Map();
61860
61955
  for (const project of board.projects) for (const page of project.pages) for (const frame of page.frames) frames.set(frame.ref, frame);
61861
61956
  return frames;
@@ -62022,23 +62117,46 @@ function send(socket, message) {
62022
62117
  * empty, or failing frame keeping its box. A failing one is reported through
62023
62118
  * `report`, the server's log unless a test stands in, since nothing retries it.
62024
62119
  */
62025
- function createHug({ root, measure, report = (line) => console.error(line) }) {
62120
+ function createHug({ root, measure, remember = async () => () => {}, report = (line) => console.error(line) }) {
62026
62121
  let queue = Promise.resolve();
62027
62122
  let closed = false;
62028
- const run = async (board, refs, parts) => {
62123
+ const run = async (board, refs, parts, begun = /* @__PURE__ */ new Map()) => {
62029
62124
  const pages = /* @__PURE__ */ new Map();
62125
+ const stored = (frame, size) => {
62126
+ const own = begun.get(frame.ref);
62127
+ begun.delete(frame.ref);
62128
+ if (!own) return;
62129
+ const whole = {
62130
+ ...own.size,
62131
+ ...size
62132
+ };
62133
+ if (parts === "own" && huggingFrames(board, [frame.ref], "linked").length > 0) begun.set(frame.ref, {
62134
+ ...own,
62135
+ size: whole
62136
+ });
62137
+ else own.done(whole);
62138
+ };
62030
62139
  let stale = false;
62031
62140
  for (const frame of huggingFrames(board, refs, parts)) {
62032
62141
  if (closed) return false;
62033
62142
  let size;
62034
62143
  try {
62144
+ if (parts !== "linked") begun.set(frame.ref, {
62145
+ done: await remember(frame),
62146
+ size: {}
62147
+ });
62035
62148
  size = await measureParts(measure, frame, parts);
62036
62149
  } catch (error) {
62150
+ if (isCode(error, "fit-unbounded")) stored(frame, {});
62151
+ else begun.delete(frame.ref);
62037
62152
  report(`frameboard: ${frame.ref} keeps its box, since its measure failed: ${failureOf(error)}`);
62038
- if (error instanceof FrameboardError && error.code === "browser-not-found") break;
62153
+ if (isCode(error, "browser-not-found")) break;
62154
+ continue;
62155
+ }
62156
+ if (Object.keys(size).length === 0) {
62157
+ stored(frame, size);
62039
62158
  continue;
62040
62159
  }
62041
- if (Object.keys(size).length === 0) continue;
62042
62160
  stale ||= frame.hugWidth && size.width !== void 0 && size.width !== frame.box.width || frame.hugHeight && size.height !== void 0 && size.height !== frame.box.height;
62043
62161
  const page = `${frame.project}/${frame.page}`;
62044
62162
  pages.set(page, [...pages.get(page) ?? [], {
@@ -62050,25 +62168,28 @@ function createHug({ root, measure, report = (line) => console.error(line) }) {
62050
62168
  for (const [page, measured] of pages) {
62051
62169
  if (closed) break;
62052
62170
  const unchanged = await Promise.all(measured.map(({ frame }) => unchangedSince(frame)));
62053
- const sizes = Object.fromEntries(measured.filter((_, index) => unchanged[index]).map(({ frame, size }) => [frame.name, size]));
62054
- if (Object.keys(sizes).length === 0) continue;
62171
+ const current = measured.filter((_, index) => unchanged[index]);
62172
+ if (current.length === 0) continue;
62173
+ const sizes = Object.fromEntries(current.map(({ frame, size }) => [frame.name, size]));
62055
62174
  try {
62056
62175
  const names = await setMeasured(root, page, sizes, { cwd: root });
62057
62176
  written ||= names.length > 0;
62177
+ for (const { frame, size } of current) stored(frame, size);
62058
62178
  } catch (error) {
62059
62179
  if (!(error instanceof FrameboardError)) throw error;
62060
62180
  }
62061
62181
  }
62062
62182
  return written || stale;
62063
62183
  };
62064
- const enqueue = (board, refs, parts) => {
62184
+ const enqueue = (board, refs, parts, begun) => {
62065
62185
  if (closed || huggingFrames(board, refs, parts).length === 0) return;
62066
- queue = queue.then(() => run(board, refs, parts)).catch(() => {});
62186
+ queue = queue.then(() => run(board, refs, parts, begun)).catch(() => {});
62067
62187
  };
62068
62188
  return {
62069
62189
  now: async (board, refs) => {
62070
- const stale = await run(board, refs, "own");
62071
- enqueue(board, refs, "linked");
62190
+ const begun = /* @__PURE__ */ new Map();
62191
+ const stale = await run(board, refs, "own", begun);
62192
+ enqueue(board, refs, "linked", begun);
62072
62193
  return stale;
62073
62194
  },
62074
62195
  later: (board, refs) => enqueue(board, refs, "all"),
@@ -62152,6 +62273,217 @@ function ownFileRefs(board, paths) {
62152
62273
  const written = new Set(paths);
62153
62274
  return board.projects.flatMap((project) => project.pages).flatMap((page) => page.frames).filter((frame) => written.has(frame.path)).map((frame) => frame.ref);
62154
62275
  }
62276
+ // src/server/live/remembered.ts
62277
+ const STORE_FILE = "checks.json";
62278
+ /** How long a landed result waits, so a sweep of the board saves in few writes. */
62279
+ const SAVE_MS = 2e3;
62280
+ const keptSchema = object$1({
62281
+ key: string$1(),
62282
+ findings: array$1(findingSchema)
62283
+ });
62284
+ const storeSchema = looseObject({
62285
+ version: literal(1),
62286
+ frames: record(string$1(), object$1({
62287
+ checks: keptSchema.optional(),
62288
+ rendered: keptSchema.optional(),
62289
+ measured: string$1().optional(),
62290
+ outside: array$1(string$1()).optional()
62291
+ }))
62292
+ });
62293
+ /**
62294
+ * Keys frames by the bytes of their file, project file, and token sheets, the
62295
+ * path, size, and time of what else their folders hold or they load, and the
62296
+ * Frameboard version, which pins the rules, the browser, and the faces.
62297
+ */
62298
+ function createFrameKeys(root, { tokens = null, version: version$3 = version } = {}) {
62299
+ let boardSheet;
62300
+ const projects = /* @__PURE__ */ new Map();
62301
+ const pages = /* @__PURE__ */ new Map();
62302
+ const readBoardSheet = async () => {
62303
+ const path = boardSheetPath(root, tokens);
62304
+ return path && `${boardPath(root, path)}\n${await fileHash(path)}`;
62305
+ };
62306
+ const readProject = async (dir) => contentHash(JSON.stringify(await Promise.all([
62307
+ fileHash(join(dir, PROJECT_FILE)),
62308
+ fileHash(join(dir, TOKEN_FILE)),
62309
+ filesUnder(join(dir, ASSETS_FOLDER))
62310
+ ])));
62311
+ return {
62312
+ of: async (frame, stored) => {
62313
+ let source;
62314
+ try {
62315
+ source = await readFile(frame.path, "utf8");
62316
+ } catch {
62317
+ return null;
62318
+ }
62319
+ const { project, page } = frame;
62320
+ const [sheet, inProject, inPage] = await Promise.all([
62321
+ boardSheet ??= readBoardSheet(),
62322
+ memo(projects, project, () => readProject(join(root, project))),
62323
+ memo(pages, `${project}/${page}`, () => readPage(join(root, project, page)))
62324
+ ]);
62325
+ let outside;
62326
+ try {
62327
+ outside = stored ? [...stored] : outsideLoads(root, frame, source);
62328
+ } catch {
62329
+ return null;
62330
+ }
62331
+ const checks = contentHash(JSON.stringify([
62332
+ version$3,
62333
+ contentHash(source),
62334
+ frame.kit ?? null,
62335
+ sheet,
62336
+ inProject,
62337
+ inPage.beside,
62338
+ /<(?:iframe|object|embed)\b/i.test(source) ? inPage.frames : null,
62339
+ await Promise.all(outside.map((path) => describeFile(join(root, path))))
62340
+ ]));
62341
+ const drawn = [frame.device ?? null, frame.turn ?? null];
62342
+ return {
62343
+ outside,
62344
+ checks,
62345
+ rendered: contentHash(JSON.stringify([
62346
+ checks,
62347
+ frame.box.width,
62348
+ frame.box.height,
62349
+ frame.widths.map(({ width, height }) => [width, height]),
62350
+ drawn,
62351
+ frame.scroll,
62352
+ frame.hugHeight
62353
+ ])),
62354
+ measured: (size = {}) => contentHash(JSON.stringify([
62355
+ checks,
62356
+ (frame.hugWidth ? size.width : void 0) ?? frame.box.width,
62357
+ (frame.hugHeight ? size.height : void 0) ?? frame.box.height,
62358
+ frame.widths.map(({ width, height }) => [width, (frame.hugHeight ? size.widths?.find((each) => each.width === width)?.height : void 0) ?? height]),
62359
+ drawn,
62360
+ frame.hugWidth,
62361
+ frame.hugHeight
62362
+ ]))
62363
+ };
62364
+ },
62365
+ drop: (paths) => {
62366
+ for (const path of paths) {
62367
+ const [project, page] = relative(root, path).split(sep);
62368
+ if (path === tokens || project === "tokens.css") boardSheet = void 0;
62369
+ if (!project) continue;
62370
+ projects.delete(project);
62371
+ pages.delete(`${project}/${page}`);
62372
+ }
62373
+ }
62374
+ };
62375
+ }
62376
+ function rememberedPath(root) {
62377
+ return join(root, RUN_FOLDER, STORE_FILE);
62378
+ }
62379
+ /** `.run/checks.json`, a cache written whole from what `held` answers. */
62380
+ function createRememberedStore(root, held) {
62381
+ let timer;
62382
+ let closed = false;
62383
+ let saving = Promise.resolve();
62384
+ const save = () => {
62385
+ clearTimeout(timer);
62386
+ timer = void 0;
62387
+ saving = saving.then(async () => {
62388
+ await ensureRunFolder(root);
62389
+ await writeRecord(rememberedPath(root), {
62390
+ version: 1,
62391
+ frames: held()
62392
+ });
62393
+ }).catch(() => {});
62394
+ };
62395
+ return {
62396
+ load: async () => {
62397
+ try {
62398
+ const text = await readFile(rememberedPath(root), "utf8");
62399
+ return storeSchema.parse(JSON.parse(text)).frames;
62400
+ } catch {
62401
+ return {};
62402
+ }
62403
+ },
62404
+ saveSoon: () => {
62405
+ if (!closed) timer ??= setTimeout(save, SAVE_MS);
62406
+ },
62407
+ close: () => {
62408
+ closed = true;
62409
+ if (timer !== void 0) save();
62410
+ return saving;
62411
+ }
62412
+ };
62413
+ }
62414
+ function memo(held, name, read) {
62415
+ const before = held.get(name);
62416
+ if (before) return before;
62417
+ const reading = read();
62418
+ held.set(name, reading);
62419
+ return reading;
62420
+ }
62421
+ async function fileHash(path) {
62422
+ try {
62423
+ return contentHash(await readFile(path));
62424
+ } catch {
62425
+ return null;
62426
+ }
62427
+ }
62428
+ async function readPage(dir) {
62429
+ const entries = await entriesOf(dir);
62430
+ const isFrame = ({ name }) => name.endsWith(FRAME_EXTENSION);
62431
+ return {
62432
+ beside: await describeAll(dir, entries.filter((entry) => !isFrame(entry) && !entry.name.includes(`.html.`) && entry.name !== "layout.json" && entry.name !== "notes.json")),
62433
+ frames: entries.filter(isFrame).map(({ name }) => name)
62434
+ };
62435
+ }
62436
+ /**
62437
+ * The board paths of every local file a frame loads, through its sheets too,
62438
+ * that no folder's files already cover, missing ones included.
62439
+ */
62440
+ function outsideLoads(root, { project, page, name }, source) {
62441
+ const frame = frameFrom({
62442
+ root,
62443
+ project,
62444
+ page,
62445
+ name
62446
+ }, source);
62447
+ const folders = [frame.pageDir, join(frame.projectDir, ASSETS_FOLDER)];
62448
+ const targets = frameLoads(frame).flatMap(({ url, base }) => localTarget(url, base) ?? []);
62449
+ return [...new Set(targets)].filter((path) => !folders.some((folder) => isInside(folder, path) && !relative(folder, path).split(sep).some(isLeftOut))).map((path) => boardPath(root, path)).sort();
62450
+ }
62451
+ /** Every file under `dir` as its path, size, and time, in path order. */
62452
+ async function filesUnder(dir) {
62453
+ return describeAll(dir, await entriesOf(dir));
62454
+ }
62455
+ async function describeAll(dir, entries) {
62456
+ return (await Promise.all(entries.map(async (entry) => {
62457
+ const path = join(dir, entry.name);
62458
+ return entry.isDirectory() ? filesUnder(path) : [await describeFile(path)];
62459
+ }))).flat();
62460
+ }
62461
+ /** A file's path, size, time, and real path, so a link never walked still moves with its target. */
62462
+ async function describeFile(path) {
62463
+ try {
62464
+ const [{ size, mtimeMs }, real] = await Promise.all([stat(path), realpath(path)]);
62465
+ return [
62466
+ path,
62467
+ size,
62468
+ mtimeMs,
62469
+ real
62470
+ ].join("\n");
62471
+ } catch {
62472
+ return path;
62473
+ }
62474
+ }
62475
+ /** What the watcher ignores, and the license record beside a sourced file, which no frame renders. */
62476
+ function isLeftOut(name) {
62477
+ return name.startsWith(".") || name.endsWith(".lock") || name.endsWith(".tmp") || name.endsWith(".license.json");
62478
+ }
62479
+ /** A folder's entries by name, none for a missing one. */
62480
+ async function entriesOf(dir) {
62481
+ try {
62482
+ return (await readdir(dir, { withFileTypes: true })).filter(({ name }) => !isLeftOut(name)).sort((a, b) => a.name < b.name ? -1 : a.name > b.name ? 1 : 0);
62483
+ } catch {
62484
+ return [];
62485
+ }
62486
+ }
62155
62487
  // src/server/live/rendered-findings.ts
62156
62488
  /**
62157
62489
  * Runs `check` at the own box and each linked width, leaving out a linked
@@ -62192,10 +62524,11 @@ function sameness(finding) {
62192
62524
  function createRenderedFindings({ check, onResult }) {
62193
62525
  const seen = /* @__PURE__ */ new Map();
62194
62526
  let known = /* @__PURE__ */ new Map();
62195
- const pending = /* @__PURE__ */ new Map();
62527
+ let pending = /* @__PURE__ */ new Map();
62196
62528
  const generation = /* @__PURE__ */ new Map();
62197
62529
  let running = null;
62198
62530
  let failure = null;
62531
+ const missed = /* @__PURE__ */ new Set();
62199
62532
  let closed = false;
62200
62533
  let waiters = [];
62201
62534
  const busy = (refs) => refs.some((ref) => ref === running || pending.has(ref));
@@ -62219,17 +62552,21 @@ function createRenderedFindings({ check, onResult }) {
62219
62552
  const asked = generation.get(ref);
62220
62553
  const current = () => !closed && generation.get(ref) === asked;
62221
62554
  check(frame).then((findings) => {
62222
- const recovered = failure !== null;
62223
62555
  failure = null;
62224
- if (findings && current()) onResult(ref, findings);
62225
- if (!recovered) return;
62226
- for (const [other, record] of known) if (other !== ref && !pending.has(other)) enqueue(other, record);
62556
+ missed.delete(ref);
62557
+ if (findings && current()) onResult(ref, findings, true);
62558
+ for (const other of missed) {
62559
+ const record = known.get(other);
62560
+ if (record && !pending.has(other)) enqueue(other, record);
62561
+ }
62562
+ missed.clear();
62227
62563
  }).catch((error) => {
62228
62564
  if (error instanceof FrameboardError && error.code === "browser-not-found") {
62229
62565
  failure = "browser-not-found";
62566
+ missed.add(ref);
62230
62567
  return;
62231
62568
  }
62232
- if (current()) onResult(ref, []);
62569
+ if (current()) onResult(ref, [], false);
62233
62570
  }).finally(() => {
62234
62571
  running = null;
62235
62572
  notify();
@@ -62237,10 +62574,16 @@ function createRenderedFindings({ check, onResult }) {
62237
62574
  });
62238
62575
  };
62239
62576
  return {
62577
+ prime: (board, refs) => {
62578
+ const frames = framesOf$2(board);
62579
+ for (const ref of refs) {
62580
+ const frame = frames.get(ref);
62581
+ if (frame) seen.set(ref, drawnFrom(frame));
62582
+ }
62583
+ },
62240
62584
  queue: (board, refs) => {
62241
62585
  if (closed) return;
62242
- const frames = /* @__PURE__ */ new Map();
62243
- for (const project of board.projects) for (const page of project.pages) for (const frame of page.frames) frames.set(frame.ref, frame);
62586
+ const frames = framesOf$2(board);
62244
62587
  for (const ref of [...seen.keys(), ...pending.keys()]) {
62245
62588
  if (frames.has(ref)) continue;
62246
62589
  seen.delete(ref);
@@ -62250,7 +62593,7 @@ function createRenderedFindings({ check, onResult }) {
62250
62593
  known = frames;
62251
62594
  const due = new Set(refs);
62252
62595
  for (const [ref, frame] of frames) {
62253
- const from = `${[frame.box, ...frame.widths].map(({ width, height }) => `${width}x${height}`).join(",")}@${frame.modifiedAt}`;
62596
+ const from = drawnFrom(frame);
62254
62597
  if (seen.get(ref) !== from) due.add(ref);
62255
62598
  seen.set(ref, from);
62256
62599
  }
@@ -62261,6 +62604,11 @@ function createRenderedFindings({ check, onResult }) {
62261
62604
  notify();
62262
62605
  pump();
62263
62606
  },
62607
+ front: (refs) => {
62608
+ const named = new Set(refs);
62609
+ const queued = [...pending];
62610
+ pending = new Map([...queued.filter(([ref]) => named.has(ref)), ...queued.filter(([ref]) => !named.has(ref))]);
62611
+ },
62264
62612
  settle: (refs) => new Promise((resolve) => {
62265
62613
  waiters.push({
62266
62614
  refs,
@@ -62276,6 +62624,13 @@ function createRenderedFindings({ check, onResult }) {
62276
62624
  }
62277
62625
  };
62278
62626
  }
62627
+ /** What a frame renders from, being its boxes and file time. */
62628
+ function drawnFrom(frame) {
62629
+ return `${[frame.box, ...frame.widths].map(({ width, height }) => `${width}x${height}`).join(",")}@${frame.modifiedAt}`;
62630
+ }
62631
+ function framesOf$2(board) {
62632
+ return new Map(board.projects.flatMap((project) => project.pages).flatMap((page) => page.frames).map((frame) => [frame.ref, frame]));
62633
+ }
62279
62634
  // src/server/live/selection.ts
62280
62635
  /**
62281
62636
  * The selection the open board shows, as the last writing tab to report it
@@ -62298,6 +62653,62 @@ function createSelectionHolder(tabs) {
62298
62653
  tabs
62299
62654
  };
62300
62655
  }
62656
+ // src/server/live/start-checks.ts
62657
+ /** Frames per slice, about 25 ms of a static check. */
62658
+ const SLICE_SIZE = 8;
62659
+ /**
62660
+ * The start's static check, in slices with the event loop free between them,
62661
+ * so a hello, a batch, or a route never waits on the whole board.
62662
+ */
62663
+ function createStartChecks({ check, inTurn = (task) => task(), pause = () => setImmediate$1(), size = SLICE_SIZE }) {
62664
+ let waiting = [];
62665
+ let checking = [];
62666
+ let closed = false;
62667
+ let waiters = [];
62668
+ const notify = () => {
62669
+ const left = /* @__PURE__ */ new Set([...waiting, ...checking]);
62670
+ const still = waiters.filter(({ refs }) => !closed && refs.some((ref) => left.has(ref)));
62671
+ const done = waiters.filter((waiter) => !still.includes(waiter));
62672
+ waiters = still;
62673
+ for (const { resolve } of done) resolve();
62674
+ };
62675
+ return {
62676
+ run: async (refs) => {
62677
+ if (closed) return;
62678
+ waiting.push(...refs);
62679
+ while (waiting.length > 0) {
62680
+ await pause();
62681
+ await inTurn(async () => {
62682
+ checking = waiting.splice(0, size);
62683
+ if (checking.length > 0) await check(checking);
62684
+ }).catch(() => {});
62685
+ checking = [];
62686
+ notify();
62687
+ }
62688
+ },
62689
+ drop: (refs) => {
62690
+ const dropped = new Set(refs);
62691
+ waiting = waiting.filter((ref) => !dropped.has(ref));
62692
+ notify();
62693
+ },
62694
+ front: (refs) => {
62695
+ const named = new Set(refs);
62696
+ waiting = [...waiting.filter((ref) => named.has(ref)), ...waiting.filter((ref) => !named.has(ref))];
62697
+ },
62698
+ settle: (refs) => new Promise((resolve) => {
62699
+ waiters.push({
62700
+ refs,
62701
+ resolve
62702
+ });
62703
+ notify();
62704
+ }),
62705
+ close: () => {
62706
+ closed = true;
62707
+ waiting = [];
62708
+ notify();
62709
+ }
62710
+ };
62711
+ }
62301
62712
  // src/server/notes/delivery.ts
62302
62713
  /**
62303
62714
  * The listener registry and queue, a note staying `queued` until acked, with
@@ -62603,7 +63014,7 @@ async function startServer({ strictPort = true, port, ...options }) {
62603
63014
  });
62604
63015
  }
62605
63016
  }
62606
- async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch, dispatch, openRoute }) {
63017
+ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch, pause, dispatch, openRoute }) {
62607
63018
  const tabs = new BoardTabs();
62608
63019
  const tickets = createTickets();
62609
63020
  let bound = 0;
@@ -62640,6 +63051,54 @@ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch
62640
63051
  await emptyTrash(root);
62641
63052
  const tracker = createChangeTracker(root);
62642
63053
  const saveLog = () => tracker.save().catch(() => {});
63054
+ const keys = createFrameKeys(root, { tokens });
63055
+ const outside = /* @__PURE__ */ new Map();
63056
+ const keysOf = async (frame) => {
63057
+ const now = await keys.of(frame);
63058
+ if (now) outside.set(frame.ref, now.outside);
63059
+ return now;
63060
+ };
63061
+ const measured = /* @__PURE__ */ new Map();
63062
+ const store = createRememberedStore(root, () => {
63063
+ const frames = findings.kept();
63064
+ for (const { ref } of scanned.board ? framesOf$1(scanned.board) : []) {
63065
+ const key = measured.get(ref);
63066
+ if (key !== void 0) frames[ref] = {
63067
+ ...frames[ref],
63068
+ measured: key
63069
+ };
63070
+ const files = outside.get(ref) ?? [];
63071
+ if (files.length > 0) frames[ref] = {
63072
+ ...frames[ref],
63073
+ outside: files
63074
+ };
63075
+ }
63076
+ return frames;
63077
+ });
63078
+ /** Rechecks `refs` in the scan turn, keeping each result under what it was read from. */
63079
+ const recheck = async (board, refs) => {
63080
+ const asked = new Set(refs);
63081
+ const named = await Promise.all(framesOf$1(board).filter(({ ref }) => asked.has(ref)).map(async (frame) => {
63082
+ const key = (await keysOf(frame))?.checks;
63083
+ return key === void 0 ? [] : [[frame.ref, key]];
63084
+ }));
63085
+ const changed = findings.update(board, refs, new Map(named.flat()));
63086
+ startChecks.drop(Object.keys(changed));
63087
+ if (Object.keys(changed).length > 0) store.saveSoon();
63088
+ return changed;
63089
+ };
63090
+ const startChecks = createStartChecks({
63091
+ inTurn,
63092
+ pause,
63093
+ check: async (refs) => {
63094
+ if (closing || !scanned.board) return;
63095
+ const changed = await recheck(scanned.board, refs);
63096
+ if (Object.keys(changed).length > 0) hub.broadcast({
63097
+ type: "findings",
63098
+ findings: changed
63099
+ });
63100
+ }
63101
+ });
62643
63102
  const settling = /* @__PURE__ */ new Map();
62644
63103
  const raised = /* @__PURE__ */ new Map();
62645
63104
  const graces = /* @__PURE__ */ new Map();
@@ -62765,8 +63224,10 @@ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch
62765
63224
  })
62766
63225
  });
62767
63226
  await thumbnails.empty();
63227
+ let rendering;
62768
63228
  const rendered = createRenderedFindings({
62769
63229
  check: async (frame) => {
63230
+ rendering = (await keysOf(frame))?.rendered;
62770
63231
  const list = await acrossWidths(frame, async (box) => checkRendered(await browser.get(), {
62771
63232
  baseUrl: baseUrl(),
62772
63233
  root,
@@ -62784,10 +63245,11 @@ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch
62784
63245
  if (list === null) return null;
62785
63246
  return await modifiedAt(frame.path) === frame.modifiedAt ? list : null;
62786
63247
  },
62787
- onResult: (ref, list) => {
63248
+ onResult: (ref, list, ran) => {
62788
63249
  const before = findings.rendered([ref])[ref];
63250
+ const changed = findings.setRendered(ref, list, ran ? rendering : void 0);
63251
+ store.saveSoon();
62789
63252
  if (JSON.stringify(before) === JSON.stringify(list)) return;
62790
- const changed = findings.setRendered(ref, list);
62791
63253
  if (Object.keys(changed).length > 0) hub.broadcast({
62792
63254
  type: "findings",
62793
63255
  findings: changed
@@ -62803,7 +63265,15 @@ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch
62803
63265
  });
62804
63266
  const hug = createHug({
62805
63267
  root,
62806
- measure
63268
+ measure,
63269
+ remember: async (frame) => {
63270
+ const at = await keysOf(frame);
63271
+ return (size) => {
63272
+ if (!at) return;
63273
+ measured.set(frame.ref, at.measured(size));
63274
+ store.saveSoon();
63275
+ };
63276
+ }
62807
63277
  });
62808
63278
  const assetUsage = createAssetUsage(root);
62809
63279
  const preview = createPreviewSlot({
@@ -62838,12 +63308,15 @@ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch
62838
63308
  try {
62839
63309
  const board = await scanBoard(root);
62840
63310
  rendered.queue(board, []);
63311
+ startChecks.front(refs);
63312
+ rendered.front(refs);
62841
63313
  const held = await tracker.update(board, refs.map((ref) => join(root, ...ref.split("/")) + FRAME_EXTENSION), await claims.read());
62842
63314
  if (held.length > 0) settleLater(held);
62843
63315
  } catch {}
62844
63316
  }),
62845
63317
  settle: async (refs) => {
62846
63318
  await Promise.all(refs.map((ref) => graces.get(ref)));
63319
+ await startChecks.settle(refs);
62847
63320
  await rendered.settle(refs);
62848
63321
  },
62849
63322
  rendered: findings.rendered,
@@ -62890,15 +63363,26 @@ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch
62890
63363
  throw error;
62891
63364
  });
62892
63365
  server.on("upgrade", hub.handleUpgrade);
63366
+ let checkedAtStart = Promise.resolve();
62893
63367
  const measuredAtStart = inTurn(async () => {
62894
63368
  await landReserved(root, /* @__PURE__ */ new Date()).catch(() => []);
62895
63369
  const board = await scanBoard(root);
62896
- const stale = await writtenSinceLayout(board).catch(() => []);
63370
+ const written = await writtenSinceLayout(board).catch(() => []);
62897
63371
  scanned.board = board;
62898
- await tracker.prime(board);
62899
- findings.update(board, "all");
63372
+ const [stored] = await Promise.all([store.load(), tracker.prime(board)]);
63373
+ const held = await unmoved(board, stored, keys);
63374
+ const refs = Object.keys(held);
63375
+ findings.prime(board, held);
63376
+ rendered.prime(board, refs.filter((ref) => held[ref]?.rendered));
63377
+ for (const ref of refs) {
63378
+ const key = held[ref]?.measured;
63379
+ if (key !== void 0) measured.set(ref, key);
63380
+ outside.set(ref, stored[ref]?.outside ?? []);
63381
+ }
63382
+ const stale = written.filter((ref) => !measured.has(ref));
62900
63383
  if (stale.length === 0) rendered.queue(board, []);
62901
- hug.later(board, frameRefs(board).filter((ref) => !stale.includes(ref)));
63384
+ hug.later(board, refs.filter((ref) => !measured.has(ref) && !stale.includes(ref)));
63385
+ checkedAtStart = startChecks.run(refs.filter((ref) => !held[ref]?.checks));
62902
63386
  return {
62903
63387
  board,
62904
63388
  stale
@@ -62918,7 +63402,7 @@ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch
62918
63402
  data: latest
62919
63403
  });
62920
63404
  shown.board = latest;
62921
- const changed = findings.update(latest, framePaths(latest).filter(([ref]) => stale.includes(ref)).map(([, path]) => path));
63405
+ const changed = await recheck(latest, stale);
62922
63406
  if (Object.keys(changed).length > 0) hub.broadcast({
62923
63407
  type: "findings",
62924
63408
  findings: changed
@@ -62930,13 +63414,14 @@ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch
62930
63414
  claims.push();
62931
63415
  const watcher = await watchBoard(root, tokens ? [tokens] : []);
62932
63416
  watcher.onBatch(assetUsage.drop);
63417
+ watcher.onBatch(keys.drop);
62933
63418
  watcher.onBatch((paths) => {
62934
63419
  const rest = paths.filter((path) => path !== claims.path);
62935
63420
  if (rest.length < paths.length) claims.push();
62936
63421
  if (rest.length === 0) return;
62937
63422
  inTurn(() => pushBatch(root, tokens ?? null, rest, {
62938
63423
  hub,
62939
- findings,
63424
+ recheck,
62940
63425
  rendered,
62941
63426
  delivery,
62942
63427
  tracker,
@@ -62961,6 +63446,7 @@ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch
62961
63446
  boardUrl,
62962
63447
  close: () => {
62963
63448
  closing ??= (async () => {
63449
+ startChecks.close();
62964
63450
  rendered.close();
62965
63451
  hug.close();
62966
63452
  claims.close();
@@ -62981,11 +63467,13 @@ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch
62981
63467
  server.closeAllConnections();
62982
63468
  });
62983
63469
  await measuredAtStart;
63470
+ await checkedAtStart;
62984
63471
  let tail;
62985
63472
  do {
62986
63473
  tail = scanning;
62987
63474
  await tail;
62988
63475
  } while (tail !== scanning);
63476
+ await store.close();
62989
63477
  })();
62990
63478
  return closing;
62991
63479
  }
@@ -62995,7 +63483,7 @@ async function listen({ clientDir, facesDir, root, tokens, port, openUrl, launch
62995
63483
  * One rescan per batch, pushing the board, then reloads, then findings, then
62996
63484
  * notes, an agent's changes waiting out the grace before the board hears.
62997
63485
  */
62998
- async function pushBatch(root, tokens, paths, { hub, findings, rendered, delivery, tracker, claims, thumbnails, hug, settleLater, moved, shown, scanned }) {
63486
+ async function pushBatch(root, tokens, paths, { hub, recheck, rendered, delivery, tracker, claims, thumbnails, hug, settleLater, moved, shown, scanned }) {
62999
63487
  let board;
63000
63488
  let own;
63001
63489
  let placed;
@@ -63053,19 +63541,31 @@ async function pushBatch(root, tokens, paths, { hub, findings, rendered, deliver
63053
63541
  }
63054
63542
  const held = await tracker.update(board, paths, await claims.read());
63055
63543
  if (held.length > 0) settleLater(held);
63056
- const changed = findings.update(board, paths);
63544
+ const due = recheckRefs(root, paths, board, tokens);
63545
+ const changed = await recheck(board, due);
63057
63546
  if (Object.keys(changed).length > 0) hub.broadcast({
63058
63547
  type: "findings",
63059
63548
  findings: changed
63060
63549
  });
63061
- rendered.queue(board, recheckRefs(root, paths, board, tokens));
63550
+ rendered.queue(board, due);
63062
63551
  await pushNotes(root, paths, hub, delivery);
63063
63552
  }
63064
- function frameRefs(board) {
63065
- return framePaths(board).map(([ref]) => ref);
63553
+ function framesOf$1(board) {
63554
+ return board.projects.flatMap((project) => project.pages).flatMap((page) => page.frames);
63066
63555
  }
63067
- function framePaths(board) {
63068
- return board.projects.flatMap((project) => project.pages).flatMap((page) => page.frames).map((frame) => [frame.ref, frame.path]);
63556
+ /** Every frame's stored results whose inputs held still, keyed in board order. */
63557
+ async function unmoved(board, stored, keys) {
63558
+ const frames = await Promise.all(framesOf$1(board).map(async (frame) => {
63559
+ const { checks, rendered, measured, outside } = stored[frame.ref] ?? {};
63560
+ const now = await keys.of(frame, outside ?? []);
63561
+ const held = {
63562
+ ...now && checks?.key === now.checks ? { checks } : {},
63563
+ ...now && rendered?.key === now.rendered ? { rendered } : {},
63564
+ ...now && measured === now.measured() ? { measured } : {}
63565
+ };
63566
+ return [frame.ref, held];
63567
+ }));
63568
+ return Object.fromEntries(frames);
63069
63569
  }
63070
63570
  /**
63071
63571
  * The content hash of each named frame's file as it stands now, which is