@integrity-labs/agt-cli 0.28.1231 → 0.28.1233

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.
Files changed (32) hide show
  1. package/dist/bin/agt.js +11 -6
  2. package/dist/bin/agt.js.map +1 -1
  3. package/dist/{chunk-KJAY4IUW.js → chunk-4FLMCHQB.js} +2 -2
  4. package/dist/{chunk-FB7WULTV.js → chunk-DQEUE2X2.js} +2 -2
  5. package/dist/{chunk-BFQKF46D.js → chunk-HI4JD2K2.js} +17 -3
  6. package/dist/{chunk-BFQKF46D.js.map → chunk-HI4JD2K2.js.map} +1 -1
  7. package/dist/{chunk-YQIXA6TX.js → chunk-VGEMWYW3.js} +32 -6
  8. package/dist/chunk-VGEMWYW3.js.map +1 -0
  9. package/dist/{chunk-IRIZBER7.js → chunk-XXIALNTU.js} +213 -1
  10. package/dist/chunk-XXIALNTU.js.map +1 -0
  11. package/dist/{claude-code-updater-HUMYEBO2.js → claude-code-updater-UTFTOX3B.js} +3 -3
  12. package/dist/{claude-pair-runtime-5PYUWRH6.js → claude-pair-runtime-DI43DJ4P.js} +3 -3
  13. package/dist/lib/manager-worker.js +32 -21
  14. package/dist/lib/manager-worker.js.map +1 -1
  15. package/dist/mcp/direct-chat-channel.js +212 -0
  16. package/dist/mcp/index.js +212 -0
  17. package/dist/mcp/origami.js +212 -0
  18. package/dist/mcp/slack-channel.js +212 -0
  19. package/dist/mcp/telegram-channel.js +212 -0
  20. package/dist/{persistent-session-73LJPKT2.js → persistent-session-S57KHU34.js} +4 -4
  21. package/dist/{responsiveness-probe-QVIGL5BH.js → responsiveness-probe-TFPKYDPB.js} +4 -4
  22. package/dist/{session-auth-dead-XLWG3MJF.js → session-auth-dead-EYJAWW46.js} +3 -3
  23. package/package.json +1 -1
  24. package/dist/chunk-IRIZBER7.js.map +0 -1
  25. package/dist/chunk-YQIXA6TX.js.map +0 -1
  26. /package/dist/{chunk-KJAY4IUW.js.map → chunk-4FLMCHQB.js.map} +0 -0
  27. /package/dist/{chunk-FB7WULTV.js.map → chunk-DQEUE2X2.js.map} +0 -0
  28. /package/dist/{claude-code-updater-HUMYEBO2.js.map → claude-code-updater-UTFTOX3B.js.map} +0 -0
  29. /package/dist/{claude-pair-runtime-5PYUWRH6.js.map → claude-pair-runtime-DI43DJ4P.js.map} +0 -0
  30. /package/dist/{persistent-session-73LJPKT2.js.map → persistent-session-S57KHU34.js.map} +0 -0
  31. /package/dist/{responsiveness-probe-QVIGL5BH.js.map → responsiveness-probe-TFPKYDPB.js.map} +0 -0
  32. /package/dist/{session-auth-dead-XLWG3MJF.js.map → session-auth-dead-EYJAWW46.js.map} +0 -0
@@ -39208,6 +39208,216 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
39208
39208
  });
39209
39209
  })();</script>`;
39210
39210
 
39211
+ // ../core/dist/integrations/augmented-live/deck-phone-fit.js
39212
+ var DECK_PHONE_FILL_MAX_HEIGHT_PX = 500;
39213
+ var DECK_PHONE_FILL_MIN_WIDTH_PX = 560;
39214
+ var FIXER = String.raw`(function () {
39215
+ // ENG-8819: phone fit for Ninja Canvas slide decks, injected by the viewer shell so it
39216
+ // reaches decks that are already published. Acts only on a deck (a #stage holding
39217
+ // .slide elements); every other page is left alone.
39218
+ var stage = document.getElementById('stage');
39219
+ if (!stage || !stage.querySelector('.slide')) return;
39220
+ var root = document.documentElement;
39221
+ var css = document.createElement('style');
39222
+ css.id = 'agt-deck-phone-fit';
39223
+ css.textContent =
39224
+ // The stage is a flex item in deck mode. Without this it shrinks to the viewport
39225
+ // width before it is scaled, so a phone in landscape got a narrow, clipped slide.
39226
+ 'html.deck-js #stage{flex-shrink:0}' +
39227
+ // Fill-width mode (short landscape screens): the slide is wider than tall enough
39228
+ // to fit, so let the page scroll vertically instead of letterboxing it.
39229
+ 'html.deck-js.agt-fill,html.deck-js.agt-fill body{height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto}' +
39230
+ 'html.deck-js.agt-fill body{display:block}' +
39231
+ 'html.deck-js.agt-fill #stage{transform:none!important;transform-origin:0 0}' +
39232
+ // Room to scroll the end of the page clear of the viewer chrome fixed along the
39233
+ // bottom edge (the HUD row in landscape; Download and the badge in portrait).
39234
+ 'html.deck-js.agt-fill body{padding-bottom:76px}' +
39235
+ 'html:not(.deck-js) body{padding-bottom:124px}' +
39236
+ // Portrait reads as a scrolling page, so the rotate prompt is not needed (and sat on
39237
+ // top of the viewer Download button).
39238
+ 'html:not(.deck-js) #rotate-hint{display:none!important}';
39239
+ (document.head || root).appendChild(css);
39240
+
39241
+ // Shared with the shell's chrome CSS (deckPhoneChromeCss), so the slide only fills
39242
+ // the width where the shell has also moved Download and the badge out of its way.
39243
+ var PHONE_MAX_H = __AGT_MAX_H__, PHONE_MIN_W = __AGT_MIN_W__;
39244
+ var stageZoom0 = stage.style.zoom;
39245
+ var lastSlide = -1;
39246
+
39247
+ function activeIndex() {
39248
+ var s = stage.querySelectorAll('.slide');
39249
+ for (var i = 0; i < s.length; i++) if (s[i].classList.contains('is-active')) return i;
39250
+ return -1;
39251
+ }
39252
+
39253
+ function fitDeck() {
39254
+ var w = innerWidth, h = innerHeight;
39255
+ // The canvas is whatever the deck declares (1280x720 in the skeleton, but a deck
39256
+ // may set its own), read from layout: transform does not change offsetWidth.
39257
+ stage.style.zoom = stageZoom0;
39258
+ var cw = stage.offsetWidth || 1280, ch = stage.offsetHeight || 720;
39259
+ // Height binds when the window is wider than the canvas. On a phone in landscape
39260
+ // that left a third of the screen empty; fill the width and scroll instead.
39261
+ var fill = w / h > cw / ch && h <= PHONE_MAX_H && w >= PHONE_MIN_W;
39262
+ root.classList.toggle('agt-fill', fill);
39263
+ // Scale to the width the page actually lays out in. innerWidth includes a classic
39264
+ // (non-overlay) scrollbar, and fill mode always scrolls, so on a short desktop
39265
+ // window that would push the slide's right edge under overflow-x:hidden. Read after
39266
+ // the class is on, so the scrollbar it turns on is already taken out.
39267
+ if (fill) stage.style.zoom = (root.clientWidth || w) / cw;
39268
+ var a = activeIndex();
39269
+ if (fill && a !== lastSlide) scrollTo(0, 0);
39270
+ lastSlide = a;
39271
+ }
39272
+
39273
+ // Narrow (portrait) mode stacks the slides as a page, but a slide authored for
39274
+ // 1280px still carries blocks that do not fit 390px, and they were clipped at the
39275
+ // right edge. In order, least destructive first: a multi-column grid becomes one
39276
+ // column, unwrappable text wraps, and only what still overflows (a cover canvas,
39277
+ // a diagram drawn at a fixed size) is scaled down to fit.
39278
+ var MARK = 'data-agt-fit';
39279
+ // Every inline value the narrow pass overwrites is recorded first and put back on
39280
+ // undo. Clearing to '' instead would wipe a deck's own inline layout (a
39281
+ // style="grid-template-columns:..." slide) the first time the phone rotated.
39282
+ var touched = [];
39283
+ function put(el, prop, val, mark) {
39284
+ touched.push([el, prop, el.style[prop]]);
39285
+ el.style[prop] = val;
39286
+ // Never downgrade a 'zoom' mark (Obi Wan 9a6ba37489c2): a zoomed block that is also
39287
+ // a grid child getting 'col' would lose the closest('[data-agt-fit="zoom"]')
39288
+ // exclusion, and passes 3 and 4 could wrap or zoom inside it again (a double scale).
39289
+ if (el.getAttribute(MARK) !== 'zoom') el.setAttribute(MARK, mark);
39290
+ }
39291
+ function undoNarrow() {
39292
+ for (var i = touched.length - 1; i >= 0; i--) {
39293
+ touched[i][0].style[touched[i][1]] = touched[i][2];
39294
+ touched[i][0].removeAttribute(MARK);
39295
+ }
39296
+ touched = [];
39297
+ }
39298
+ function overflowing(el, limit) {
39299
+ var r = el.getBoundingClientRect();
39300
+ return r.width > 0 && r.right > limit + 1;
39301
+ }
39302
+ function fitNarrow() {
39303
+ undoNarrow();
39304
+ var slides = stage.querySelectorAll('.slide');
39305
+ for (var j = 0; j < slides.length; j++) {
39306
+ var sl = slides[j], limit = sl.getBoundingClientRect().right;
39307
+ var all = sl.querySelectorAll('*'), k, el, cs;
39308
+ var padR = parseFloat(getComputedStyle(sl).paddingRight) || 0;
39309
+ // A block drawn at a fixed width wider than the column (a cover canvas) is a
39310
+ // picture, not a layout: scale it whole first, and never reflow inside it.
39311
+ for (k = 0; k < all.length; k++) {
39312
+ el = all[k];
39313
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
39314
+ cs = getComputedStyle(el);
39315
+ var fixedW = parseFloat(cs.width);
39316
+ var rr = el.getBoundingClientRect(), room = limit - padR - rr.left;
39317
+ if (/px$/.test(el.style.width || '') || (cs.display !== 'grid' && fixedW > room + 1 && room > 40 && el.children.length > 0 && overflowing(el, limit) && fixedW >= 600)) {
39318
+ if (!overflowing(el, limit) || room <= 40) continue;
39319
+ put(el, 'zoom', Math.max(0.2, room / rr.width), 'zoom');
39320
+ // The slide keeps its full-screen min-height; shrink it to the scaled
39321
+ // picture so there is no empty screen under it. Never below the picture.
39322
+ var sr = sl.getBoundingClientRect(), er = el.getBoundingClientRect();
39323
+ var need = Math.ceil(er.bottom - sr.top + (parseFloat(getComputedStyle(sl).paddingBottom) || 0));
39324
+ if (need > 80 && need < sr.height) put(sl, 'minHeight', need + 'px', 'slide');
39325
+ }
39326
+ }
39327
+ for (k = 0; k < all.length; k++) {
39328
+ el = all[k];
39329
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
39330
+ cs = getComputedStyle(el);
39331
+ if ((cs.display === 'grid' || cs.display === 'inline-grid') && cs.gridTemplateColumns.split(' ').length > 1 &&
39332
+ (el.scrollWidth > el.clientWidth + 1 || overflowing(el, limit))) {
39333
+ // A cell whose content is absolutely positioned took its height from the
39334
+ // row it shared; keep that height, or its drawing collapses on itself.
39335
+ var keep = [];
39336
+ for (var q = 0; q < el.children.length; q++) {
39337
+ var ch = el.children[q], abs = false, ds = ch.querySelectorAll('*');
39338
+ for (var z = 0; z < ds.length && !abs; z++) abs = getComputedStyle(ds[z]).position === 'absolute';
39339
+ keep.push(abs ? ch.getBoundingClientRect().height : 0);
39340
+ }
39341
+ put(el, 'gridTemplateColumns', 'minmax(0,1fr)', 'reflow');
39342
+ for (q = 0; q < el.children.length; q++) {
39343
+ if (keep[q] > 0 && el.children[q].getBoundingClientRect().height < keep[q] - 1) {
39344
+ put(el.children[q], 'minHeight', Math.round(keep[q]) + 'px', 'keep');
39345
+ }
39346
+ }
39347
+ for (var c = 0; c < el.children.length; c++) {
39348
+ if (getComputedStyle(el.children[c]).gridColumnStart !== 'auto') put(el.children[c], 'gridColumn', 'auto', 'col');
39349
+ }
39350
+ } else if (cs.display.indexOf('flex') > -1 && cs.flexDirection.indexOf('row') === 0 && cs.flexWrap === 'nowrap' &&
39351
+ el.children.length > 1 && overflowing(el.lastElementChild || el, limit)) {
39352
+ put(el, 'flexWrap', 'wrap', 'wrap');
39353
+ }
39354
+ }
39355
+ for (k = 0; k < all.length; k++) {
39356
+ el = all[k];
39357
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
39358
+ if (el.children.length === 0 && overflowing(el, limit) && getComputedStyle(el).whiteSpace.indexOf('nowrap') > -1) {
39359
+ put(el, 'whiteSpace', 'normal', 'text');
39360
+ }
39361
+ }
39362
+ for (k = 0; k < all.length; k++) {
39363
+ el = all[k];
39364
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
39365
+ if (!overflowing(el, limit)) continue;
39366
+ var r = el.getBoundingClientRect(), avail = limit - padR - r.left;
39367
+ if (avail <= 40) continue;
39368
+ put(el, 'zoom', Math.max(0.2, avail / r.width), 'zoom');
39369
+ }
39370
+ }
39371
+ }
39372
+
39373
+ // Obi Wan 73a833f8f833: the narrow (stacked) layout depends on WIDTH only, but iOS
39374
+ // fires resize and visualViewport resize as its toolbars collapse during an ordinary
39375
+ // scroll, changing only the height. Re-running fitNarrow there would revert and
39376
+ // re-measure every slide mid-scroll and could make the page jump. So a narrow re-fit
39377
+ // runs only when the width changed, when leaving deck mode, or on load (content sizes).
39378
+ var narrowW = -1;
39379
+ function apply() {
39380
+ try {
39381
+ if (root.classList.contains('deck-js')) {
39382
+ narrowW = -1;
39383
+ undoNarrow();
39384
+ fitDeck();
39385
+ } else {
39386
+ root.classList.remove('agt-fill');
39387
+ stage.style.zoom = stageZoom0;
39388
+ var nw = root.clientWidth || innerWidth;
39389
+ if (nw === narrowW) return;
39390
+ fitNarrow();
39391
+ narrowW = nw;
39392
+ }
39393
+ } catch (e) {
39394
+ // Never break the deck over a fit problem, but leave a trace (and a hook for
39395
+ // tests) rather than swallowing it.
39396
+ window.__agtDeckFitError = String((e && e.message) || e);
39397
+ }
39398
+ }
39399
+
39400
+ var t = 0;
39401
+ function later() {
39402
+ apply();
39403
+ // iOS reports the new size a beat after resize/orientationchange fires.
39404
+ clearTimeout(t);
39405
+ t = setTimeout(apply, 250);
39406
+ if (window.requestAnimationFrame) requestAnimationFrame(apply);
39407
+ }
39408
+ addEventListener('resize', later);
39409
+ addEventListener('orientationchange', later);
39410
+ // Load can change content sizes (images) at the same width, so it always re-fits.
39411
+ addEventListener('load', function () { narrowW = -1; later(); });
39412
+ if (window.visualViewport) visualViewport.addEventListener('resize', later);
39413
+ // Slide changes: keep fill mode scrolled to the top of the new slide.
39414
+ try { new MutationObserver(function () { if (root.classList.contains('agt-fill')) fitDeck(); })
39415
+ .observe(stage, { subtree: true, attributes: true, attributeFilter: ['class'] }); } catch (e) {}
39416
+ later();
39417
+ })();`;
39418
+ var DECK_PHONE_FIT_SOURCE = FIXER.replace("__AGT_MAX_H__", String(DECK_PHONE_FILL_MAX_HEIGHT_PX)).replace("__AGT_MIN_W__", String(DECK_PHONE_FILL_MIN_WIDTH_PX));
39419
+ var DECK_PHONE_FIT_SCRIPT = '<script id="agt-deck-phone-fit-js">' + DECK_PHONE_FIT_SOURCE + "</script>";
39420
+
39211
39421
  // ../core/dist/integrations/augmented-live/live-hosts.js
39212
39422
  function linkOpenerScript(frameId) {
39213
39423
  return 'function alOpenBar(u){var o=document.getElementById("al-open");if(o)o.parentNode.removeChild(o);var b=document.createElement("div");b.id="al-open";b.setAttribute("role","status");b.appendChild(document.createTextNode("Open link to "));var a=document.createElement("a");a.href=u.href;a.target="_blank";a.rel="noopener noreferrer";a.textContent=u.host;a.addEventListener("click",function(){setTimeout(function(){if(b.parentNode)b.parentNode.removeChild(b);},0);});b.appendChild(a);var x=document.createElement("button");x.type="button";x.setAttribute("aria-label","Dismiss");x.textContent="\xD7";x.addEventListener("click",function(){if(b.parentNode)b.parentNode.removeChild(b);});b.appendChild(x);document.body.appendChild(b);}window.addEventListener("message",function(e){var f=document.getElementById(' + JSON.stringify(frameId) + ');if(!f||e.source!==f.contentWindow||e.origin!=="null")return;var d=e.data;if(!d||d.type!=="al-open"||typeof d.url!=="string")return;var u;try{u=new URL(d.url);}catch(x){return;}if(u.protocol!=="https:"||u.username||u.password)return;var w=window.open(u.href,"_blank");if(w){try{w.opener=null;}catch(x){}}else{alOpenBar(u);}});';
@@ -39285,6 +39495,8 @@ var DOWNLOAD_MOBILE_MIN_HEIGHT_PX = 44;
39285
39495
  var DECK_ATTRIBUTION_NARROW_BOTTOM_PX = DOWNLOAD_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
39286
39496
  var VISIBILITY_BOTTOM_PX = DOWNLOAD_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
39287
39497
  var DECK_ATTRIBUTION_NARROW_WITH_VISIBILITY_BOTTOM_PX = VISIBILITY_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
39498
+ var DECK_PRINT_BUTTON_W_PX = 72;
39499
+ var DECK_PHONE_DOWNLOAD_BESIDE_PRINT_LEFT_PX = 16 + DECK_PRINT_BUTTON_W_PX + DECK_CHROME_GAP_PX;
39288
39500
 
39289
39501
  // ../core/dist/integrations/augmented-live/codec.js
39290
39502
  var DEFAULT_CHUNK_BUDGET_BYTES = 180 * 1024;
package/dist/mcp/index.js CHANGED
@@ -25319,6 +25319,216 @@ var MARKUP_BRIDGE_SCRIPT = `<script>(function(){
25319
25319
  });
25320
25320
  })();</script>`;
25321
25321
 
25322
+ // ../core/dist/integrations/augmented-live/deck-phone-fit.js
25323
+ var DECK_PHONE_FILL_MAX_HEIGHT_PX = 500;
25324
+ var DECK_PHONE_FILL_MIN_WIDTH_PX = 560;
25325
+ var FIXER = String.raw`(function () {
25326
+ // ENG-8819: phone fit for Ninja Canvas slide decks, injected by the viewer shell so it
25327
+ // reaches decks that are already published. Acts only on a deck (a #stage holding
25328
+ // .slide elements); every other page is left alone.
25329
+ var stage = document.getElementById('stage');
25330
+ if (!stage || !stage.querySelector('.slide')) return;
25331
+ var root = document.documentElement;
25332
+ var css = document.createElement('style');
25333
+ css.id = 'agt-deck-phone-fit';
25334
+ css.textContent =
25335
+ // The stage is a flex item in deck mode. Without this it shrinks to the viewport
25336
+ // width before it is scaled, so a phone in landscape got a narrow, clipped slide.
25337
+ 'html.deck-js #stage{flex-shrink:0}' +
25338
+ // Fill-width mode (short landscape screens): the slide is wider than tall enough
25339
+ // to fit, so let the page scroll vertically instead of letterboxing it.
25340
+ 'html.deck-js.agt-fill,html.deck-js.agt-fill body{height:auto;min-height:100%;overflow-x:hidden;overflow-y:auto}' +
25341
+ 'html.deck-js.agt-fill body{display:block}' +
25342
+ 'html.deck-js.agt-fill #stage{transform:none!important;transform-origin:0 0}' +
25343
+ // Room to scroll the end of the page clear of the viewer chrome fixed along the
25344
+ // bottom edge (the HUD row in landscape; Download and the badge in portrait).
25345
+ 'html.deck-js.agt-fill body{padding-bottom:76px}' +
25346
+ 'html:not(.deck-js) body{padding-bottom:124px}' +
25347
+ // Portrait reads as a scrolling page, so the rotate prompt is not needed (and sat on
25348
+ // top of the viewer Download button).
25349
+ 'html:not(.deck-js) #rotate-hint{display:none!important}';
25350
+ (document.head || root).appendChild(css);
25351
+
25352
+ // Shared with the shell's chrome CSS (deckPhoneChromeCss), so the slide only fills
25353
+ // the width where the shell has also moved Download and the badge out of its way.
25354
+ var PHONE_MAX_H = __AGT_MAX_H__, PHONE_MIN_W = __AGT_MIN_W__;
25355
+ var stageZoom0 = stage.style.zoom;
25356
+ var lastSlide = -1;
25357
+
25358
+ function activeIndex() {
25359
+ var s = stage.querySelectorAll('.slide');
25360
+ for (var i = 0; i < s.length; i++) if (s[i].classList.contains('is-active')) return i;
25361
+ return -1;
25362
+ }
25363
+
25364
+ function fitDeck() {
25365
+ var w = innerWidth, h = innerHeight;
25366
+ // The canvas is whatever the deck declares (1280x720 in the skeleton, but a deck
25367
+ // may set its own), read from layout: transform does not change offsetWidth.
25368
+ stage.style.zoom = stageZoom0;
25369
+ var cw = stage.offsetWidth || 1280, ch = stage.offsetHeight || 720;
25370
+ // Height binds when the window is wider than the canvas. On a phone in landscape
25371
+ // that left a third of the screen empty; fill the width and scroll instead.
25372
+ var fill = w / h > cw / ch && h <= PHONE_MAX_H && w >= PHONE_MIN_W;
25373
+ root.classList.toggle('agt-fill', fill);
25374
+ // Scale to the width the page actually lays out in. innerWidth includes a classic
25375
+ // (non-overlay) scrollbar, and fill mode always scrolls, so on a short desktop
25376
+ // window that would push the slide's right edge under overflow-x:hidden. Read after
25377
+ // the class is on, so the scrollbar it turns on is already taken out.
25378
+ if (fill) stage.style.zoom = (root.clientWidth || w) / cw;
25379
+ var a = activeIndex();
25380
+ if (fill && a !== lastSlide) scrollTo(0, 0);
25381
+ lastSlide = a;
25382
+ }
25383
+
25384
+ // Narrow (portrait) mode stacks the slides as a page, but a slide authored for
25385
+ // 1280px still carries blocks that do not fit 390px, and they were clipped at the
25386
+ // right edge. In order, least destructive first: a multi-column grid becomes one
25387
+ // column, unwrappable text wraps, and only what still overflows (a cover canvas,
25388
+ // a diagram drawn at a fixed size) is scaled down to fit.
25389
+ var MARK = 'data-agt-fit';
25390
+ // Every inline value the narrow pass overwrites is recorded first and put back on
25391
+ // undo. Clearing to '' instead would wipe a deck's own inline layout (a
25392
+ // style="grid-template-columns:..." slide) the first time the phone rotated.
25393
+ var touched = [];
25394
+ function put(el, prop, val, mark) {
25395
+ touched.push([el, prop, el.style[prop]]);
25396
+ el.style[prop] = val;
25397
+ // Never downgrade a 'zoom' mark (Obi Wan 9a6ba37489c2): a zoomed block that is also
25398
+ // a grid child getting 'col' would lose the closest('[data-agt-fit="zoom"]')
25399
+ // exclusion, and passes 3 and 4 could wrap or zoom inside it again (a double scale).
25400
+ if (el.getAttribute(MARK) !== 'zoom') el.setAttribute(MARK, mark);
25401
+ }
25402
+ function undoNarrow() {
25403
+ for (var i = touched.length - 1; i >= 0; i--) {
25404
+ touched[i][0].style[touched[i][1]] = touched[i][2];
25405
+ touched[i][0].removeAttribute(MARK);
25406
+ }
25407
+ touched = [];
25408
+ }
25409
+ function overflowing(el, limit) {
25410
+ var r = el.getBoundingClientRect();
25411
+ return r.width > 0 && r.right > limit + 1;
25412
+ }
25413
+ function fitNarrow() {
25414
+ undoNarrow();
25415
+ var slides = stage.querySelectorAll('.slide');
25416
+ for (var j = 0; j < slides.length; j++) {
25417
+ var sl = slides[j], limit = sl.getBoundingClientRect().right;
25418
+ var all = sl.querySelectorAll('*'), k, el, cs;
25419
+ var padR = parseFloat(getComputedStyle(sl).paddingRight) || 0;
25420
+ // A block drawn at a fixed width wider than the column (a cover canvas) is a
25421
+ // picture, not a layout: scale it whole first, and never reflow inside it.
25422
+ for (k = 0; k < all.length; k++) {
25423
+ el = all[k];
25424
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
25425
+ cs = getComputedStyle(el);
25426
+ var fixedW = parseFloat(cs.width);
25427
+ var rr = el.getBoundingClientRect(), room = limit - padR - rr.left;
25428
+ if (/px$/.test(el.style.width || '') || (cs.display !== 'grid' && fixedW > room + 1 && room > 40 && el.children.length > 0 && overflowing(el, limit) && fixedW >= 600)) {
25429
+ if (!overflowing(el, limit) || room <= 40) continue;
25430
+ put(el, 'zoom', Math.max(0.2, room / rr.width), 'zoom');
25431
+ // The slide keeps its full-screen min-height; shrink it to the scaled
25432
+ // picture so there is no empty screen under it. Never below the picture.
25433
+ var sr = sl.getBoundingClientRect(), er = el.getBoundingClientRect();
25434
+ var need = Math.ceil(er.bottom - sr.top + (parseFloat(getComputedStyle(sl).paddingBottom) || 0));
25435
+ if (need > 80 && need < sr.height) put(sl, 'minHeight', need + 'px', 'slide');
25436
+ }
25437
+ }
25438
+ for (k = 0; k < all.length; k++) {
25439
+ el = all[k];
25440
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
25441
+ cs = getComputedStyle(el);
25442
+ if ((cs.display === 'grid' || cs.display === 'inline-grid') && cs.gridTemplateColumns.split(' ').length > 1 &&
25443
+ (el.scrollWidth > el.clientWidth + 1 || overflowing(el, limit))) {
25444
+ // A cell whose content is absolutely positioned took its height from the
25445
+ // row it shared; keep that height, or its drawing collapses on itself.
25446
+ var keep = [];
25447
+ for (var q = 0; q < el.children.length; q++) {
25448
+ var ch = el.children[q], abs = false, ds = ch.querySelectorAll('*');
25449
+ for (var z = 0; z < ds.length && !abs; z++) abs = getComputedStyle(ds[z]).position === 'absolute';
25450
+ keep.push(abs ? ch.getBoundingClientRect().height : 0);
25451
+ }
25452
+ put(el, 'gridTemplateColumns', 'minmax(0,1fr)', 'reflow');
25453
+ for (q = 0; q < el.children.length; q++) {
25454
+ if (keep[q] > 0 && el.children[q].getBoundingClientRect().height < keep[q] - 1) {
25455
+ put(el.children[q], 'minHeight', Math.round(keep[q]) + 'px', 'keep');
25456
+ }
25457
+ }
25458
+ for (var c = 0; c < el.children.length; c++) {
25459
+ if (getComputedStyle(el.children[c]).gridColumnStart !== 'auto') put(el.children[c], 'gridColumn', 'auto', 'col');
25460
+ }
25461
+ } else if (cs.display.indexOf('flex') > -1 && cs.flexDirection.indexOf('row') === 0 && cs.flexWrap === 'nowrap' &&
25462
+ el.children.length > 1 && overflowing(el.lastElementChild || el, limit)) {
25463
+ put(el, 'flexWrap', 'wrap', 'wrap');
25464
+ }
25465
+ }
25466
+ for (k = 0; k < all.length; k++) {
25467
+ el = all[k];
25468
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
25469
+ if (el.children.length === 0 && overflowing(el, limit) && getComputedStyle(el).whiteSpace.indexOf('nowrap') > -1) {
25470
+ put(el, 'whiteSpace', 'normal', 'text');
25471
+ }
25472
+ }
25473
+ for (k = 0; k < all.length; k++) {
25474
+ el = all[k];
25475
+ if (el.closest('[' + MARK + '="zoom"]')) continue;
25476
+ if (!overflowing(el, limit)) continue;
25477
+ var r = el.getBoundingClientRect(), avail = limit - padR - r.left;
25478
+ if (avail <= 40) continue;
25479
+ put(el, 'zoom', Math.max(0.2, avail / r.width), 'zoom');
25480
+ }
25481
+ }
25482
+ }
25483
+
25484
+ // Obi Wan 73a833f8f833: the narrow (stacked) layout depends on WIDTH only, but iOS
25485
+ // fires resize and visualViewport resize as its toolbars collapse during an ordinary
25486
+ // scroll, changing only the height. Re-running fitNarrow there would revert and
25487
+ // re-measure every slide mid-scroll and could make the page jump. So a narrow re-fit
25488
+ // runs only when the width changed, when leaving deck mode, or on load (content sizes).
25489
+ var narrowW = -1;
25490
+ function apply() {
25491
+ try {
25492
+ if (root.classList.contains('deck-js')) {
25493
+ narrowW = -1;
25494
+ undoNarrow();
25495
+ fitDeck();
25496
+ } else {
25497
+ root.classList.remove('agt-fill');
25498
+ stage.style.zoom = stageZoom0;
25499
+ var nw = root.clientWidth || innerWidth;
25500
+ if (nw === narrowW) return;
25501
+ fitNarrow();
25502
+ narrowW = nw;
25503
+ }
25504
+ } catch (e) {
25505
+ // Never break the deck over a fit problem, but leave a trace (and a hook for
25506
+ // tests) rather than swallowing it.
25507
+ window.__agtDeckFitError = String((e && e.message) || e);
25508
+ }
25509
+ }
25510
+
25511
+ var t = 0;
25512
+ function later() {
25513
+ apply();
25514
+ // iOS reports the new size a beat after resize/orientationchange fires.
25515
+ clearTimeout(t);
25516
+ t = setTimeout(apply, 250);
25517
+ if (window.requestAnimationFrame) requestAnimationFrame(apply);
25518
+ }
25519
+ addEventListener('resize', later);
25520
+ addEventListener('orientationchange', later);
25521
+ // Load can change content sizes (images) at the same width, so it always re-fits.
25522
+ addEventListener('load', function () { narrowW = -1; later(); });
25523
+ if (window.visualViewport) visualViewport.addEventListener('resize', later);
25524
+ // Slide changes: keep fill mode scrolled to the top of the new slide.
25525
+ try { new MutationObserver(function () { if (root.classList.contains('agt-fill')) fitDeck(); })
25526
+ .observe(stage, { subtree: true, attributes: true, attributeFilter: ['class'] }); } catch (e) {}
25527
+ later();
25528
+ })();`;
25529
+ var DECK_PHONE_FIT_SOURCE = FIXER.replace("__AGT_MAX_H__", String(DECK_PHONE_FILL_MAX_HEIGHT_PX)).replace("__AGT_MIN_W__", String(DECK_PHONE_FILL_MIN_WIDTH_PX));
25530
+ var DECK_PHONE_FIT_SCRIPT = '<script id="agt-deck-phone-fit-js">' + DECK_PHONE_FIT_SOURCE + "</script>";
25531
+
25322
25532
  // ../core/dist/integrations/augmented-live/live-hosts.js
25323
25533
  function linkOpenerScript(frameId) {
25324
25534
  return 'function alOpenBar(u){var o=document.getElementById("al-open");if(o)o.parentNode.removeChild(o);var b=document.createElement("div");b.id="al-open";b.setAttribute("role","status");b.appendChild(document.createTextNode("Open link to "));var a=document.createElement("a");a.href=u.href;a.target="_blank";a.rel="noopener noreferrer";a.textContent=u.host;a.addEventListener("click",function(){setTimeout(function(){if(b.parentNode)b.parentNode.removeChild(b);},0);});b.appendChild(a);var x=document.createElement("button");x.type="button";x.setAttribute("aria-label","Dismiss");x.textContent="\xD7";x.addEventListener("click",function(){if(b.parentNode)b.parentNode.removeChild(b);});b.appendChild(x);document.body.appendChild(b);}window.addEventListener("message",function(e){var f=document.getElementById(' + JSON.stringify(frameId) + ');if(!f||e.source!==f.contentWindow||e.origin!=="null")return;var d=e.data;if(!d||d.type!=="al-open"||typeof d.url!=="string")return;var u;try{u=new URL(d.url);}catch(x){return;}if(u.protocol!=="https:"||u.username||u.password)return;var w=window.open(u.href,"_blank");if(w){try{w.opener=null;}catch(x){}}else{alOpenBar(u);}});';
@@ -25381,6 +25591,8 @@ var DOWNLOAD_MOBILE_MIN_HEIGHT_PX = 44;
25381
25591
  var DECK_ATTRIBUTION_NARROW_BOTTOM_PX = DOWNLOAD_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
25382
25592
  var VISIBILITY_BOTTOM_PX = DOWNLOAD_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
25383
25593
  var DECK_ATTRIBUTION_NARROW_WITH_VISIBILITY_BOTTOM_PX = VISIBILITY_BOTTOM_PX + DOWNLOAD_MOBILE_MIN_HEIGHT_PX + DECK_CHROME_GAP_PX;
25594
+ var DECK_PRINT_BUTTON_W_PX = 72;
25595
+ var DECK_PHONE_DOWNLOAD_BESIDE_PRINT_LEFT_PX = 16 + DECK_PRINT_BUTTON_W_PX + DECK_CHROME_GAP_PX;
25384
25596
 
25385
25597
  // ../core/dist/integrations/augmented-live/codec.js
25386
25598
  var DEFAULT_CHUNK_BUDGET_BYTES = 180 * 1024;