@f-office/docs-react 0.2.2 → 0.2.4

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/index.js CHANGED
@@ -1,32 +1,32 @@
1
- import { COMMANDS as e, NARROW as t, TARGETS as n, ariaKeys as r, available as i, commandIsCmd as a, copiedAddress as o, docxFile as s, fixedValue as c, keyTexts as l, linkOfElement as u, noInstalledFonts as d, pageCommand as f, parseView as ee, printTarget as te, readZoom as ne, setUrlTarget as re, setUrlValue as ie, shortcutRows as p, urlTarget as ae } from "@f-office/docs/chrome";
2
- import { createContext as m, use as h, useCallback as g, useEffect as _, useEffectEvent as v, useMemo as y, useRef as b, useState as x } from "react";
3
- import { DEFAULT_COMPATIFONT_CDN as oe, canReadInstalledFonts as se, compatifontCdnSource as ce, defineFOfficeDocsElement as le, fontFolder as ue, installedFonts as de, installedSource as fe, urlFontMode as pe } from "@f-office/docs";
4
- import { clsx as me } from "clsx";
5
- import { twMerge as S } from "tailwind-merge";
6
- import { Fragment as C, jsx as w, jsxs as T } from "react/jsx-runtime";
7
- import { CheckIcon as E, ChevronRightIcon as D, CircleIcon as he, FileUpIcon as ge, ListIcon as O, MonitorIcon as _e, MoonIcon as ve, SunIcon as k, XIcon as ye } from "lucide-react";
8
- import { ContextMenu as A, Dialog as j, Menubar as M } from "radix-ui";
1
+ import { COMMANDS as e, NARROW as t, TARGETS as n, ariaKeys as r, available as i, commandIsCmd as a, copiedAddress as o, docxFile as s, fixedValue as c, keyTexts as l, linkOfElement as u, noInstalledFonts as d, pageCommand as f, parseView as p, printTarget as ee, readZoom as te, setUrlTarget as ne, setUrlValue as re, shortcutRows as ie, urlTarget as ae } from "@f-office/docs/chrome";
2
+ import { createContext as oe, use as m, useCallback as h, useEffect as g, useEffectEvent as _, useMemo as v, useRef as y, useState as b } from "react";
3
+ import { DEFAULT_COMPATIFONT_CDN as x, canReadInstalledFonts as se, compatifontCdnSource as ce, defineFOfficeDocsElement as le, fontFolder as ue, installedFonts as de, installedSource as fe, urlFontMode as pe } from "@f-office/docs";
4
+ import { clsx as S } from "clsx";
5
+ import { twMerge as C } from "tailwind-merge";
6
+ import { Fragment as w, jsx as T, jsxs as E } from "react/jsx-runtime";
7
+ import { AlertCircleIcon as me, AlertTriangleIcon as he, CheckIcon as D, ChevronRightIcon as ge, CircleIcon as _e, FileUpIcon as O, ListIcon as ve, MonitorIcon as k, MoonIcon as ye, SunIcon as A, XIcon as j } from "lucide-react";
8
+ import { ContextMenu as M, Dialog as N, Menubar as P, Popover as F } from "radix-ui";
9
9
  // src/assets/logo-mark-dark.svg
10
- var be = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%202346%20512'%20width='2346'%20height='512'%3e%3ctitle%3eF-Office%20logo%3c/title%3e%3cdefs%3e%3c!--%20One%20puzzle%20piece%20(the%20top-left%20one),%20origin%20at%20the%20puzzle%20center.%20The%20other%20three%20pieces%20are%20this%20outline%20rotated%20by%2090,%20180,%20270.%20--%3e%3cpath%20id='piece'%20d='M-134%20-256%20H-3%20A2.5%202.5%200%200%201%20-0.5%20-253.5%20V-185.97%20A17.5%2017.5%200%200%200%2022.45%20-169.34%20A43.5%2043.5%200%201%201%2022.45%20-86.66%20A17.5%2017.5%200%200%200%20-0.5%20-70.03%20V-0.5%20H-70.03%20A16.5%2016.5%200%200%201%20-85.71%20-22.14%20A44.5%2044.5%200%201%200%20-170.29%20-22.14%20A16.5%2016.5%200%200%201%20-185.97%20-0.5%20H-253.5%20A2.5%202.5%200%200%201%20-256%20-3%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20The%20whole%20puzzle%20square:%20drawn%20in%20the%20seam%20color%20under%20the%20pieces,%20and%20used%20to%20keep%20the%20edge%20shading%20inside%20the%20puzzle.%20--%3e%3cpath%20id='plate'%20d='M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3cclipPath%20id='plate-clip'%3e%3cuse%20xlink:href='%23plate'/%3e%3c/clipPath%3e%3cpath%20id='outside'%20fill-rule='evenodd'%20d='M-320%20-320%20H320%20V320%20H-320%20Z%20M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20Piece%20fills:%20light%20at%20the%20top%20left%20of%20every%20piece,%20so%20each%20gradient%20is%20turned%20back%20by%20the%20rotation%20of%20its%20piece.%20--%3e%3clinearGradient%20id='fill-purple'%20x1='-170.31'%20y1='-254.74'%20x2='-1.36'%20y2='5.42'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23D697FF'/%3e%3cstop%20offset='0.5'%20stop-color='%237E5AF4'/%3e%3cstop%20offset='1'%20stop-color='%234137C8'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-pink'%20x1='40.82'%20y1='-222.24'%20x2='219.77'%20y2='53.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-90)'%3e%3cstop%20offset='0'%20stop-color='%23FFB0D8'/%3e%3cstop%20offset='0.5'%20stop-color='%23FB5D99'/%3e%3cstop%20offset='1'%20stop-color='%23C71878'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-cyan'%20x1='5.69'%20y1='1.26'%20x2='174.64'%20y2='261.42'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-180)'%3e%3cstop%20offset='0'%20stop-color='%238EF1FC'/%3e%3cstop%20offset='0.5'%20stop-color='%2300CEE7'/%3e%3cstop%20offset='1'%20stop-color='%23009DB7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-orange'%20x1='-215.18'%20y1='-46.24'%20x2='-36.23'%20y2='229.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-270)'%3e%3cstop%20offset='0'%20stop-color='%23FCDD64'/%3e%3cstop%20offset='0.5'%20stop-color='%23FF9525'/%3e%3cstop%20offset='1'%20stop-color='%23F57B20'/%3e%3c/linearGradient%3e%3c!--%20Edge%20shading%20of%20the%20pieces.%20'shade':%20a%20crisp%20dark%20rim%20inside%20the%20edges%20that%20face%20down%20and%20right,%20a%20soft%20band%20behind%20it,%20and%20a%20tight%20shadow%20cast%20onto%20the%20neighbors.%20'light':%20a%20crisp%20light%20rim%20inside%20the%20edges%20that%20face%20up%20and%20left,%20and%20a%20soft%20band%20behind%20it;%20the%20outside%20of%20the%20puzzle%20counts%20as%20filled%20there,%20so%20only%20the%20seams%20get%20it.%20--%3e%3cfilter%20id='shade'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='-1'%20dy='-1'%20result='up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='up'%20operator='out'%20result='dark-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='2'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='-5'%20dy='-5'%20result='soft-up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-up'%20operator='out'%20result='dark-band'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='0.7'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dx='0.8'%20dy='1.2'%20result='tight-off'/%3e%3cfeComposite%20in='tight-off'%20in2='SourceAlpha'%20operator='out'%20result='cast'/%3e%3cfeFlood%20flood-color='%23120C3A'%20flood-opacity='0.15'/%3e%3cfeComposite%20in2='cast'%20operator='in'%20result='cast-shadow'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.1'/%3e%3cfeComposite%20in2='dark-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.4'/%3e%3cfeComposite%20in2='dark-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='cast-shadow'/%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3cfilter%20id='light'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='1'%20dy='1'%20result='down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='down'%20operator='out'%20result='light-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='1.5'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='4'%20dy='4'%20result='soft-down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-down'%20operator='out'%20result='light-band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.38'/%3e%3cfeComposite%20in2='light-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.45'/%3e%3cfeComposite%20in2='light-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3c!--%20Colored%20glow%20and%20contact%20shadow%20under%20the%20pieces%20--%3e%3cfilter%20id='glow'%20x='-40%25'%20y='-40%25'%20width='180%25'%20height='180%25'%20color-interpolation-filters='sRGB'%3e%3cfeGaussianBlur%20in='SourceGraphic'%20stdDeviation='34'%20result='wide'/%3e%3cfeOffset%20in='wide'%20dy='16'%20result='wide-off'/%3e%3cfeComponentTransfer%20in='wide-off'%20result='color-glow'%3e%3cfeFuncA%20type='linear'%20slope='0.5'/%3e%3c/feComponentTransfer%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='9'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dy='10'%20result='tight-off'/%3e%3cfeFlood%20flood-color='%23202848'%20flood-opacity='0.07'/%3e%3cfeComposite%20in2='tight-off'%20operator='in'%20result='contact'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='color-glow'/%3e%3cfeMergeNode%20in='contact'/%3e%3c/feMerge%3e%3c/filter%3e%3c/defs%3e%3cg%20id='puzzle'%20transform='translate(256%20256)'%3e%3cg%20id='puzzle-glow'%20filter='url(%23glow)'%20clip-path='url(%23plate-clip)'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='pieces'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='edge-shade'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3c/g%3e%3c/g%3e%3cg%20id='edge-light'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cpath%20id='wordmark'%20fill='%23FFFFFF'%20transform='translate(662.00%20421)%20scale(0.46348)'%20d='M1241%20-729%20C1135%20-729%201050%20-693%20984%20-623%20C918%20-552%20886%20-463%20886%20-356%20C886%20-246%20918%20-156%20983%20-87%20C1047%20-17%201134%2017%201243%2017%20C1348%2017%201432%20-18%201495%20-88%20C1558%20-158%201590%20-247%201590%20-355%20C1590%20-469%201558%20-559%201495%20-627%20C1431%20-695%201347%20-729%201241%20-729Z%20M1896.7%20-713%20C1827.7%20-713%201777.7%20-700%201746.7%20-674%20C1714.7%20-648%201699.7%20-603%201699.7%20-539%20V-516%20H1617.7%20V-404%20H1699.7%20V0%20H1869.7%20V-404%20H1923.6%20H1969.7%20H2005.6%20V0%20H2175.6%20V-404%20H2275.6%20V-516%20H2173.6%20V-547%20C2173.6%20-565%202177.6%20-577%202185.6%20-583%20C2193.6%20-589%202210.6%20-592%202235.6%20-592%20C2251.6%20-592%202267.6%20-591%202281.6%20-590%20L2282.6%20-711%20C2246.6%20-712%202219.6%20-713%202202.6%20-713%20C2133.6%20-713%202083.6%20-700%202052.6%20-674%20C2020.6%20-648%202005.6%20-603%202005.6%20-539%20V-516%20H1969.7%20H1923.6%20H1867.7%20V-547%20C1867.7%20-565%201871.7%20-577%201879.7%20-583%20C1887.7%20-589%201904.7%20-592%201929.7%20-592%20C1945.7%20-592%201961.7%20-591%201975.7%20-590%20L1976.7%20-711%20C1940.7%20-712%201913.7%20-713%201896.7%20-713Z%20M0%20-712%20V0%20H187%20V-274%20H481%20V-420%20H187%20V-557%20H526%20V-712Z%20M2316.6%20-712%20V-584%20H2486.6%20V-712Z%20M1239%20-577%20C1289%20-577%201328%20-558%201357%20-519%20C1385%20-481%201400%20-428%201400%20-360%20C1400%20-289%201386%20-234%201358%20-195%20C1330%20-155%201290%20-136%201240%20-136%20C1188%20-136%201148%20-155%201119%20-195%20C1090%20-234%201076%20-288%201076%20-357%20C1076%20-425%201090%20-478%201120%20-518%20C1149%20-558%201189%20-577%201239%20-577Z%20M2795.6%20-530%20C2713.6%20-530%202647.6%20-504%202597.6%20-454%20C2547.6%20-403%202522.6%20-336%202522.6%20-253%20C2522.6%20-173%202547.6%20-109%202597.6%20-60%20C2647.6%20-11%202712.6%2014%202792.6%2014%20C2867.6%2014%202927.6%20-5%202972.6%20-42%20C3017.6%20-80%203044.6%20-133%203053.6%20-202%20L2891.6%20-203%20C2880.6%20-143%202849.6%20-113%202797.6%20-113%20C2763.6%20-113%202738.6%20-125%202720.6%20-150%20C2702.6%20-174%202693.6%20-209%202693.6%20-255%20C2693.6%20-303%202702.6%20-340%202720.6%20-367%20C2738.6%20-393%202764.6%20-407%202797.6%20-407%20C2821.6%20-407%202840.6%20-400%202856.6%20-386%20C2872.6%20-372%202881.6%20-353%202885.6%20-328%20H3049.6%20C3045.6%20-389%203019.6%20-438%202973.6%20-475%20C2927.6%20-511%202867.6%20-530%202795.6%20-530Z%20M3358.1%20-529%20C3276.1%20-529%203210.1%20-503%203159.1%20-451%20C3107.1%20-399%203082.1%20-333%203082.1%20-252%20C3082.1%20-170%203108.1%20-104%203161.1%20-56%20C3214.1%20-8%203282.1%2016%203364.1%2016%20C3429.1%2016%203484.1%201%203529.1%20-29%20C3574.1%20-59%203605.1%20-101%203622.1%20-157%20H3463.1%20C3441.1%20-117%203408.1%20-97%203366.1%20-97%20C3330.1%20-97%203301.1%20-107%203280.1%20-128%20C3259.1%20-149%203248.1%20-179%203248.1%20-217%20H3632.1%20V-232%20C3632.1%20-324%203607.1%20-396%203558.1%20-449%20C3509.1%20-502%203442.1%20-529%203358.1%20-529Z%20M2316.6%20-516%20V0%20H2486.6%20V-516Z%20M537%20-420%20V-274%20H848%20V-420Z%20M3359.1%20-415%20C3390.1%20-415%203415.1%20-405%203433.1%20-387%20C3451.1%20-369%203462.1%20-344%203465.1%20-314%20H3250.1%20C3260.1%20-381%203297.1%20-415%203359.1%20-415Z'/%3e%3c/svg%3e", N = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%202346%20512'%20width='2346'%20height='512'%3e%3ctitle%3eF-Office%20logo%3c/title%3e%3cdefs%3e%3c!--%20One%20puzzle%20piece%20(the%20top-left%20one),%20origin%20at%20the%20puzzle%20center.%20The%20other%20three%20pieces%20are%20this%20outline%20rotated%20by%2090,%20180,%20270.%20--%3e%3cpath%20id='piece'%20d='M-134%20-256%20H-3%20A2.5%202.5%200%200%201%20-0.5%20-253.5%20V-185.97%20A17.5%2017.5%200%200%200%2022.45%20-169.34%20A43.5%2043.5%200%201%201%2022.45%20-86.66%20A17.5%2017.5%200%200%200%20-0.5%20-70.03%20V-0.5%20H-70.03%20A16.5%2016.5%200%200%201%20-85.71%20-22.14%20A44.5%2044.5%200%201%200%20-170.29%20-22.14%20A16.5%2016.5%200%200%201%20-185.97%20-0.5%20H-253.5%20A2.5%202.5%200%200%201%20-256%20-3%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20The%20whole%20puzzle%20square:%20drawn%20in%20the%20seam%20color%20under%20the%20pieces,%20and%20used%20to%20keep%20the%20edge%20shading%20inside%20the%20puzzle.%20--%3e%3cpath%20id='plate'%20d='M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3cclipPath%20id='plate-clip'%3e%3cuse%20xlink:href='%23plate'/%3e%3c/clipPath%3e%3cpath%20id='outside'%20fill-rule='evenodd'%20d='M-320%20-320%20H320%20V320%20H-320%20Z%20M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20Piece%20fills:%20light%20at%20the%20top%20left%20of%20every%20piece,%20so%20each%20gradient%20is%20turned%20back%20by%20the%20rotation%20of%20its%20piece.%20--%3e%3clinearGradient%20id='fill-purple'%20x1='-170.31'%20y1='-254.74'%20x2='-1.36'%20y2='5.42'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23D697FF'/%3e%3cstop%20offset='0.5'%20stop-color='%237E5AF4'/%3e%3cstop%20offset='1'%20stop-color='%234137C8'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-pink'%20x1='40.82'%20y1='-222.24'%20x2='219.77'%20y2='53.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-90)'%3e%3cstop%20offset='0'%20stop-color='%23FFB0D8'/%3e%3cstop%20offset='0.5'%20stop-color='%23FB5D99'/%3e%3cstop%20offset='1'%20stop-color='%23C71878'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-cyan'%20x1='5.69'%20y1='1.26'%20x2='174.64'%20y2='261.42'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-180)'%3e%3cstop%20offset='0'%20stop-color='%238EF1FC'/%3e%3cstop%20offset='0.5'%20stop-color='%2300CEE7'/%3e%3cstop%20offset='1'%20stop-color='%23009DB7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-orange'%20x1='-215.18'%20y1='-46.24'%20x2='-36.23'%20y2='229.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-270)'%3e%3cstop%20offset='0'%20stop-color='%23FCDD64'/%3e%3cstop%20offset='0.5'%20stop-color='%23FF9525'/%3e%3cstop%20offset='1'%20stop-color='%23F57B20'/%3e%3c/linearGradient%3e%3c!--%20Edge%20shading%20of%20the%20pieces.%20'shade':%20a%20crisp%20dark%20rim%20inside%20the%20edges%20that%20face%20down%20and%20right,%20a%20soft%20band%20behind%20it,%20and%20a%20tight%20shadow%20cast%20onto%20the%20neighbors.%20'light':%20a%20crisp%20light%20rim%20inside%20the%20edges%20that%20face%20up%20and%20left,%20and%20a%20soft%20band%20behind%20it;%20the%20outside%20of%20the%20puzzle%20counts%20as%20filled%20there,%20so%20only%20the%20seams%20get%20it.%20--%3e%3cfilter%20id='shade'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='-1'%20dy='-1'%20result='up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='up'%20operator='out'%20result='dark-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='2'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='-5'%20dy='-5'%20result='soft-up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-up'%20operator='out'%20result='dark-band'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='0.7'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dx='0.8'%20dy='1.2'%20result='tight-off'/%3e%3cfeComposite%20in='tight-off'%20in2='SourceAlpha'%20operator='out'%20result='cast'/%3e%3cfeFlood%20flood-color='%23120C3A'%20flood-opacity='0.15'/%3e%3cfeComposite%20in2='cast'%20operator='in'%20result='cast-shadow'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.1'/%3e%3cfeComposite%20in2='dark-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.4'/%3e%3cfeComposite%20in2='dark-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='cast-shadow'/%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3cfilter%20id='light'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='1'%20dy='1'%20result='down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='down'%20operator='out'%20result='light-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='1.5'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='4'%20dy='4'%20result='soft-down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-down'%20operator='out'%20result='light-band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.38'/%3e%3cfeComposite%20in2='light-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.45'/%3e%3cfeComposite%20in2='light-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3c!--%20Colored%20glow%20and%20contact%20shadow%20under%20the%20pieces%20--%3e%3cfilter%20id='glow'%20x='-40%25'%20y='-40%25'%20width='180%25'%20height='180%25'%20color-interpolation-filters='sRGB'%3e%3cfeGaussianBlur%20in='SourceGraphic'%20stdDeviation='34'%20result='wide'/%3e%3cfeOffset%20in='wide'%20dy='16'%20result='wide-off'/%3e%3cfeComponentTransfer%20in='wide-off'%20result='color-glow'%3e%3cfeFuncA%20type='linear'%20slope='0.5'/%3e%3c/feComponentTransfer%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='9'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dy='10'%20result='tight-off'/%3e%3cfeFlood%20flood-color='%23202848'%20flood-opacity='0.07'/%3e%3cfeComposite%20in2='tight-off'%20operator='in'%20result='contact'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='color-glow'/%3e%3cfeMergeNode%20in='contact'/%3e%3c/feMerge%3e%3c/filter%3e%3c/defs%3e%3cg%20id='puzzle'%20transform='translate(256%20256)'%3e%3cg%20id='puzzle-glow'%20filter='url(%23glow)'%20clip-path='url(%23plate-clip)'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='pieces'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='edge-shade'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3c/g%3e%3c/g%3e%3cg%20id='edge-light'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cpath%20id='wordmark'%20fill='%231D1D1F'%20transform='translate(662.00%20421)%20scale(0.46348)'%20d='M1241%20-729%20C1135%20-729%201050%20-693%20984%20-623%20C918%20-552%20886%20-463%20886%20-356%20C886%20-246%20918%20-156%20983%20-87%20C1047%20-17%201134%2017%201243%2017%20C1348%2017%201432%20-18%201495%20-88%20C1558%20-158%201590%20-247%201590%20-355%20C1590%20-469%201558%20-559%201495%20-627%20C1431%20-695%201347%20-729%201241%20-729Z%20M1896.7%20-713%20C1827.7%20-713%201777.7%20-700%201746.7%20-674%20C1714.7%20-648%201699.7%20-603%201699.7%20-539%20V-516%20H1617.7%20V-404%20H1699.7%20V0%20H1869.7%20V-404%20H1923.6%20H1969.7%20H2005.6%20V0%20H2175.6%20V-404%20H2275.6%20V-516%20H2173.6%20V-547%20C2173.6%20-565%202177.6%20-577%202185.6%20-583%20C2193.6%20-589%202210.6%20-592%202235.6%20-592%20C2251.6%20-592%202267.6%20-591%202281.6%20-590%20L2282.6%20-711%20C2246.6%20-712%202219.6%20-713%202202.6%20-713%20C2133.6%20-713%202083.6%20-700%202052.6%20-674%20C2020.6%20-648%202005.6%20-603%202005.6%20-539%20V-516%20H1969.7%20H1923.6%20H1867.7%20V-547%20C1867.7%20-565%201871.7%20-577%201879.7%20-583%20C1887.7%20-589%201904.7%20-592%201929.7%20-592%20C1945.7%20-592%201961.7%20-591%201975.7%20-590%20L1976.7%20-711%20C1940.7%20-712%201913.7%20-713%201896.7%20-713Z%20M0%20-712%20V0%20H187%20V-274%20H481%20V-420%20H187%20V-557%20H526%20V-712Z%20M2316.6%20-712%20V-584%20H2486.6%20V-712Z%20M1239%20-577%20C1289%20-577%201328%20-558%201357%20-519%20C1385%20-481%201400%20-428%201400%20-360%20C1400%20-289%201386%20-234%201358%20-195%20C1330%20-155%201290%20-136%201240%20-136%20C1188%20-136%201148%20-155%201119%20-195%20C1090%20-234%201076%20-288%201076%20-357%20C1076%20-425%201090%20-478%201120%20-518%20C1149%20-558%201189%20-577%201239%20-577Z%20M2795.6%20-530%20C2713.6%20-530%202647.6%20-504%202597.6%20-454%20C2547.6%20-403%202522.6%20-336%202522.6%20-253%20C2522.6%20-173%202547.6%20-109%202597.6%20-60%20C2647.6%20-11%202712.6%2014%202792.6%2014%20C2867.6%2014%202927.6%20-5%202972.6%20-42%20C3017.6%20-80%203044.6%20-133%203053.6%20-202%20L2891.6%20-203%20C2880.6%20-143%202849.6%20-113%202797.6%20-113%20C2763.6%20-113%202738.6%20-125%202720.6%20-150%20C2702.6%20-174%202693.6%20-209%202693.6%20-255%20C2693.6%20-303%202702.6%20-340%202720.6%20-367%20C2738.6%20-393%202764.6%20-407%202797.6%20-407%20C2821.6%20-407%202840.6%20-400%202856.6%20-386%20C2872.6%20-372%202881.6%20-353%202885.6%20-328%20H3049.6%20C3045.6%20-389%203019.6%20-438%202973.6%20-475%20C2927.6%20-511%202867.6%20-530%202795.6%20-530Z%20M3358.1%20-529%20C3276.1%20-529%203210.1%20-503%203159.1%20-451%20C3107.1%20-399%203082.1%20-333%203082.1%20-252%20C3082.1%20-170%203108.1%20-104%203161.1%20-56%20C3214.1%20-8%203282.1%2016%203364.1%2016%20C3429.1%2016%203484.1%201%203529.1%20-29%20C3574.1%20-59%203605.1%20-101%203622.1%20-157%20H3463.1%20C3441.1%20-117%203408.1%20-97%203366.1%20-97%20C3330.1%20-97%203301.1%20-107%203280.1%20-128%20C3259.1%20-149%203248.1%20-179%203248.1%20-217%20H3632.1%20V-232%20C3632.1%20-324%203607.1%20-396%203558.1%20-449%20C3509.1%20-502%203442.1%20-529%203358.1%20-529Z%20M2316.6%20-516%20V0%20H2486.6%20V-516Z%20M537%20-420%20V-274%20H848%20V-420Z%20M3359.1%20-415%20C3390.1%20-415%203415.1%20-405%203433.1%20-387%20C3451.1%20-369%203462.1%20-344%203465.1%20-314%20H3250.1%20C3260.1%20-381%203297.1%20-415%203359.1%20-415Z'/%3e%3c/svg%3e", xe = 5e7, Se = 400, Ce = {
10
+ var be = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%202346%20512'%20width='2346'%20height='512'%3e%3ctitle%3eF-Office%20logo%3c/title%3e%3cdefs%3e%3c!--%20One%20puzzle%20piece%20(the%20top-left%20one),%20origin%20at%20the%20puzzle%20center.%20The%20other%20three%20pieces%20are%20this%20outline%20rotated%20by%2090,%20180,%20270.%20--%3e%3cpath%20id='piece'%20d='M-134%20-256%20H-3%20A2.5%202.5%200%200%201%20-0.5%20-253.5%20V-185.97%20A17.5%2017.5%200%200%200%2022.45%20-169.34%20A43.5%2043.5%200%201%201%2022.45%20-86.66%20A17.5%2017.5%200%200%200%20-0.5%20-70.03%20V-0.5%20H-70.03%20A16.5%2016.5%200%200%201%20-85.71%20-22.14%20A44.5%2044.5%200%201%200%20-170.29%20-22.14%20A16.5%2016.5%200%200%201%20-185.97%20-0.5%20H-253.5%20A2.5%202.5%200%200%201%20-256%20-3%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20The%20whole%20puzzle%20square:%20drawn%20in%20the%20seam%20color%20under%20the%20pieces,%20and%20used%20to%20keep%20the%20edge%20shading%20inside%20the%20puzzle.%20--%3e%3cpath%20id='plate'%20d='M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3cclipPath%20id='plate-clip'%3e%3cuse%20xlink:href='%23plate'/%3e%3c/clipPath%3e%3cpath%20id='outside'%20fill-rule='evenodd'%20d='M-320%20-320%20H320%20V320%20H-320%20Z%20M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20Piece%20fills:%20light%20at%20the%20top%20left%20of%20every%20piece,%20so%20each%20gradient%20is%20turned%20back%20by%20the%20rotation%20of%20its%20piece.%20--%3e%3clinearGradient%20id='fill-purple'%20x1='-170.31'%20y1='-254.74'%20x2='-1.36'%20y2='5.42'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23D697FF'/%3e%3cstop%20offset='0.5'%20stop-color='%237E5AF4'/%3e%3cstop%20offset='1'%20stop-color='%234137C8'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-pink'%20x1='40.82'%20y1='-222.24'%20x2='219.77'%20y2='53.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-90)'%3e%3cstop%20offset='0'%20stop-color='%23FFB0D8'/%3e%3cstop%20offset='0.5'%20stop-color='%23FB5D99'/%3e%3cstop%20offset='1'%20stop-color='%23C71878'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-cyan'%20x1='5.69'%20y1='1.26'%20x2='174.64'%20y2='261.42'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-180)'%3e%3cstop%20offset='0'%20stop-color='%238EF1FC'/%3e%3cstop%20offset='0.5'%20stop-color='%2300CEE7'/%3e%3cstop%20offset='1'%20stop-color='%23009DB7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-orange'%20x1='-215.18'%20y1='-46.24'%20x2='-36.23'%20y2='229.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-270)'%3e%3cstop%20offset='0'%20stop-color='%23FCDD64'/%3e%3cstop%20offset='0.5'%20stop-color='%23FF9525'/%3e%3cstop%20offset='1'%20stop-color='%23F57B20'/%3e%3c/linearGradient%3e%3c!--%20Edge%20shading%20of%20the%20pieces.%20'shade':%20a%20crisp%20dark%20rim%20inside%20the%20edges%20that%20face%20down%20and%20right,%20a%20soft%20band%20behind%20it,%20and%20a%20tight%20shadow%20cast%20onto%20the%20neighbors.%20'light':%20a%20crisp%20light%20rim%20inside%20the%20edges%20that%20face%20up%20and%20left,%20and%20a%20soft%20band%20behind%20it;%20the%20outside%20of%20the%20puzzle%20counts%20as%20filled%20there,%20so%20only%20the%20seams%20get%20it.%20--%3e%3cfilter%20id='shade'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='-1'%20dy='-1'%20result='up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='up'%20operator='out'%20result='dark-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='2'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='-5'%20dy='-5'%20result='soft-up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-up'%20operator='out'%20result='dark-band'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='0.7'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dx='0.8'%20dy='1.2'%20result='tight-off'/%3e%3cfeComposite%20in='tight-off'%20in2='SourceAlpha'%20operator='out'%20result='cast'/%3e%3cfeFlood%20flood-color='%23120C3A'%20flood-opacity='0.15'/%3e%3cfeComposite%20in2='cast'%20operator='in'%20result='cast-shadow'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.1'/%3e%3cfeComposite%20in2='dark-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.4'/%3e%3cfeComposite%20in2='dark-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='cast-shadow'/%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3cfilter%20id='light'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='1'%20dy='1'%20result='down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='down'%20operator='out'%20result='light-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='1.5'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='4'%20dy='4'%20result='soft-down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-down'%20operator='out'%20result='light-band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.38'/%3e%3cfeComposite%20in2='light-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.45'/%3e%3cfeComposite%20in2='light-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3c!--%20Colored%20glow%20and%20contact%20shadow%20under%20the%20pieces%20--%3e%3cfilter%20id='glow'%20x='-40%25'%20y='-40%25'%20width='180%25'%20height='180%25'%20color-interpolation-filters='sRGB'%3e%3cfeGaussianBlur%20in='SourceGraphic'%20stdDeviation='34'%20result='wide'/%3e%3cfeOffset%20in='wide'%20dy='16'%20result='wide-off'/%3e%3cfeComponentTransfer%20in='wide-off'%20result='color-glow'%3e%3cfeFuncA%20type='linear'%20slope='0.5'/%3e%3c/feComponentTransfer%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='9'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dy='10'%20result='tight-off'/%3e%3cfeFlood%20flood-color='%23202848'%20flood-opacity='0.07'/%3e%3cfeComposite%20in2='tight-off'%20operator='in'%20result='contact'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='color-glow'/%3e%3cfeMergeNode%20in='contact'/%3e%3c/feMerge%3e%3c/filter%3e%3c/defs%3e%3cg%20id='puzzle'%20transform='translate(256%20256)'%3e%3cg%20id='puzzle-glow'%20filter='url(%23glow)'%20clip-path='url(%23plate-clip)'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='pieces'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='edge-shade'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3c/g%3e%3c/g%3e%3cg%20id='edge-light'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cpath%20id='wordmark'%20fill='%23FFFFFF'%20transform='translate(662.00%20421)%20scale(0.46348)'%20d='M1241%20-729%20C1135%20-729%201050%20-693%20984%20-623%20C918%20-552%20886%20-463%20886%20-356%20C886%20-246%20918%20-156%20983%20-87%20C1047%20-17%201134%2017%201243%2017%20C1348%2017%201432%20-18%201495%20-88%20C1558%20-158%201590%20-247%201590%20-355%20C1590%20-469%201558%20-559%201495%20-627%20C1431%20-695%201347%20-729%201241%20-729Z%20M1896.7%20-713%20C1827.7%20-713%201777.7%20-700%201746.7%20-674%20C1714.7%20-648%201699.7%20-603%201699.7%20-539%20V-516%20H1617.7%20V-404%20H1699.7%20V0%20H1869.7%20V-404%20H1923.6%20H1969.7%20H2005.6%20V0%20H2175.6%20V-404%20H2275.6%20V-516%20H2173.6%20V-547%20C2173.6%20-565%202177.6%20-577%202185.6%20-583%20C2193.6%20-589%202210.6%20-592%202235.6%20-592%20C2251.6%20-592%202267.6%20-591%202281.6%20-590%20L2282.6%20-711%20C2246.6%20-712%202219.6%20-713%202202.6%20-713%20C2133.6%20-713%202083.6%20-700%202052.6%20-674%20C2020.6%20-648%202005.6%20-603%202005.6%20-539%20V-516%20H1969.7%20H1923.6%20H1867.7%20V-547%20C1867.7%20-565%201871.7%20-577%201879.7%20-583%20C1887.7%20-589%201904.7%20-592%201929.7%20-592%20C1945.7%20-592%201961.7%20-591%201975.7%20-590%20L1976.7%20-711%20C1940.7%20-712%201913.7%20-713%201896.7%20-713Z%20M0%20-712%20V0%20H187%20V-274%20H481%20V-420%20H187%20V-557%20H526%20V-712Z%20M2316.6%20-712%20V-584%20H2486.6%20V-712Z%20M1239%20-577%20C1289%20-577%201328%20-558%201357%20-519%20C1385%20-481%201400%20-428%201400%20-360%20C1400%20-289%201386%20-234%201358%20-195%20C1330%20-155%201290%20-136%201240%20-136%20C1188%20-136%201148%20-155%201119%20-195%20C1090%20-234%201076%20-288%201076%20-357%20C1076%20-425%201090%20-478%201120%20-518%20C1149%20-558%201189%20-577%201239%20-577Z%20M2795.6%20-530%20C2713.6%20-530%202647.6%20-504%202597.6%20-454%20C2547.6%20-403%202522.6%20-336%202522.6%20-253%20C2522.6%20-173%202547.6%20-109%202597.6%20-60%20C2647.6%20-11%202712.6%2014%202792.6%2014%20C2867.6%2014%202927.6%20-5%202972.6%20-42%20C3017.6%20-80%203044.6%20-133%203053.6%20-202%20L2891.6%20-203%20C2880.6%20-143%202849.6%20-113%202797.6%20-113%20C2763.6%20-113%202738.6%20-125%202720.6%20-150%20C2702.6%20-174%202693.6%20-209%202693.6%20-255%20C2693.6%20-303%202702.6%20-340%202720.6%20-367%20C2738.6%20-393%202764.6%20-407%202797.6%20-407%20C2821.6%20-407%202840.6%20-400%202856.6%20-386%20C2872.6%20-372%202881.6%20-353%202885.6%20-328%20H3049.6%20C3045.6%20-389%203019.6%20-438%202973.6%20-475%20C2927.6%20-511%202867.6%20-530%202795.6%20-530Z%20M3358.1%20-529%20C3276.1%20-529%203210.1%20-503%203159.1%20-451%20C3107.1%20-399%203082.1%20-333%203082.1%20-252%20C3082.1%20-170%203108.1%20-104%203161.1%20-56%20C3214.1%20-8%203282.1%2016%203364.1%2016%20C3429.1%2016%203484.1%201%203529.1%20-29%20C3574.1%20-59%203605.1%20-101%203622.1%20-157%20H3463.1%20C3441.1%20-117%203408.1%20-97%203366.1%20-97%20C3330.1%20-97%203301.1%20-107%203280.1%20-128%20C3259.1%20-149%203248.1%20-179%203248.1%20-217%20H3632.1%20V-232%20C3632.1%20-324%203607.1%20-396%203558.1%20-449%20C3509.1%20-502%203442.1%20-529%203358.1%20-529Z%20M2316.6%20-516%20V0%20H2486.6%20V-516Z%20M537%20-420%20V-274%20H848%20V-420Z%20M3359.1%20-415%20C3390.1%20-415%203415.1%20-405%203433.1%20-387%20C3451.1%20-369%203462.1%20-344%203465.1%20-314%20H3250.1%20C3260.1%20-381%203297.1%20-415%203359.1%20-415Z'/%3e%3c/svg%3e", xe = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='0%200%202346%20512'%20width='2346'%20height='512'%3e%3ctitle%3eF-Office%20logo%3c/title%3e%3cdefs%3e%3c!--%20One%20puzzle%20piece%20(the%20top-left%20one),%20origin%20at%20the%20puzzle%20center.%20The%20other%20three%20pieces%20are%20this%20outline%20rotated%20by%2090,%20180,%20270.%20--%3e%3cpath%20id='piece'%20d='M-134%20-256%20H-3%20A2.5%202.5%200%200%201%20-0.5%20-253.5%20V-185.97%20A17.5%2017.5%200%200%200%2022.45%20-169.34%20A43.5%2043.5%200%201%201%2022.45%20-86.66%20A17.5%2017.5%200%200%200%20-0.5%20-70.03%20V-0.5%20H-70.03%20A16.5%2016.5%200%200%201%20-85.71%20-22.14%20A44.5%2044.5%200%201%200%20-170.29%20-22.14%20A16.5%2016.5%200%200%201%20-185.97%20-0.5%20H-253.5%20A2.5%202.5%200%200%201%20-256%20-3%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20The%20whole%20puzzle%20square:%20drawn%20in%20the%20seam%20color%20under%20the%20pieces,%20and%20used%20to%20keep%20the%20edge%20shading%20inside%20the%20puzzle.%20--%3e%3cpath%20id='plate'%20d='M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3cclipPath%20id='plate-clip'%3e%3cuse%20xlink:href='%23plate'/%3e%3c/clipPath%3e%3cpath%20id='outside'%20fill-rule='evenodd'%20d='M-320%20-320%20H320%20V320%20H-320%20Z%20M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20Piece%20fills:%20light%20at%20the%20top%20left%20of%20every%20piece,%20so%20each%20gradient%20is%20turned%20back%20by%20the%20rotation%20of%20its%20piece.%20--%3e%3clinearGradient%20id='fill-purple'%20x1='-170.31'%20y1='-254.74'%20x2='-1.36'%20y2='5.42'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23D697FF'/%3e%3cstop%20offset='0.5'%20stop-color='%237E5AF4'/%3e%3cstop%20offset='1'%20stop-color='%234137C8'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-pink'%20x1='40.82'%20y1='-222.24'%20x2='219.77'%20y2='53.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-90)'%3e%3cstop%20offset='0'%20stop-color='%23FFB0D8'/%3e%3cstop%20offset='0.5'%20stop-color='%23FB5D99'/%3e%3cstop%20offset='1'%20stop-color='%23C71878'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-cyan'%20x1='5.69'%20y1='1.26'%20x2='174.64'%20y2='261.42'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-180)'%3e%3cstop%20offset='0'%20stop-color='%238EF1FC'/%3e%3cstop%20offset='0.5'%20stop-color='%2300CEE7'/%3e%3cstop%20offset='1'%20stop-color='%23009DB7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-orange'%20x1='-215.18'%20y1='-46.24'%20x2='-36.23'%20y2='229.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-270)'%3e%3cstop%20offset='0'%20stop-color='%23FCDD64'/%3e%3cstop%20offset='0.5'%20stop-color='%23FF9525'/%3e%3cstop%20offset='1'%20stop-color='%23F57B20'/%3e%3c/linearGradient%3e%3c!--%20Edge%20shading%20of%20the%20pieces.%20'shade':%20a%20crisp%20dark%20rim%20inside%20the%20edges%20that%20face%20down%20and%20right,%20a%20soft%20band%20behind%20it,%20and%20a%20tight%20shadow%20cast%20onto%20the%20neighbors.%20'light':%20a%20crisp%20light%20rim%20inside%20the%20edges%20that%20face%20up%20and%20left,%20and%20a%20soft%20band%20behind%20it;%20the%20outside%20of%20the%20puzzle%20counts%20as%20filled%20there,%20so%20only%20the%20seams%20get%20it.%20--%3e%3cfilter%20id='shade'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='-1'%20dy='-1'%20result='up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='up'%20operator='out'%20result='dark-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='2'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='-5'%20dy='-5'%20result='soft-up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-up'%20operator='out'%20result='dark-band'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='0.7'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dx='0.8'%20dy='1.2'%20result='tight-off'/%3e%3cfeComposite%20in='tight-off'%20in2='SourceAlpha'%20operator='out'%20result='cast'/%3e%3cfeFlood%20flood-color='%23120C3A'%20flood-opacity='0.15'/%3e%3cfeComposite%20in2='cast'%20operator='in'%20result='cast-shadow'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.1'/%3e%3cfeComposite%20in2='dark-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.4'/%3e%3cfeComposite%20in2='dark-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='cast-shadow'/%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3cfilter%20id='light'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='1'%20dy='1'%20result='down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='down'%20operator='out'%20result='light-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='1.5'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='4'%20dy='4'%20result='soft-down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-down'%20operator='out'%20result='light-band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.38'/%3e%3cfeComposite%20in2='light-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.45'/%3e%3cfeComposite%20in2='light-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3c!--%20Colored%20glow%20and%20contact%20shadow%20under%20the%20pieces%20--%3e%3cfilter%20id='glow'%20x='-40%25'%20y='-40%25'%20width='180%25'%20height='180%25'%20color-interpolation-filters='sRGB'%3e%3cfeGaussianBlur%20in='SourceGraphic'%20stdDeviation='34'%20result='wide'/%3e%3cfeOffset%20in='wide'%20dy='16'%20result='wide-off'/%3e%3cfeComponentTransfer%20in='wide-off'%20result='color-glow'%3e%3cfeFuncA%20type='linear'%20slope='0.5'/%3e%3c/feComponentTransfer%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='9'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dy='10'%20result='tight-off'/%3e%3cfeFlood%20flood-color='%23202848'%20flood-opacity='0.07'/%3e%3cfeComposite%20in2='tight-off'%20operator='in'%20result='contact'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='color-glow'/%3e%3cfeMergeNode%20in='contact'/%3e%3c/feMerge%3e%3c/filter%3e%3c/defs%3e%3cg%20id='puzzle'%20transform='translate(256%20256)'%3e%3cg%20id='puzzle-glow'%20filter='url(%23glow)'%20clip-path='url(%23plate-clip)'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='pieces'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='edge-shade'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3c/g%3e%3c/g%3e%3cg%20id='edge-light'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3cpath%20id='wordmark'%20fill='%231D1D1F'%20transform='translate(662.00%20421)%20scale(0.46348)'%20d='M1241%20-729%20C1135%20-729%201050%20-693%20984%20-623%20C918%20-552%20886%20-463%20886%20-356%20C886%20-246%20918%20-156%20983%20-87%20C1047%20-17%201134%2017%201243%2017%20C1348%2017%201432%20-18%201495%20-88%20C1558%20-158%201590%20-247%201590%20-355%20C1590%20-469%201558%20-559%201495%20-627%20C1431%20-695%201347%20-729%201241%20-729Z%20M1896.7%20-713%20C1827.7%20-713%201777.7%20-700%201746.7%20-674%20C1714.7%20-648%201699.7%20-603%201699.7%20-539%20V-516%20H1617.7%20V-404%20H1699.7%20V0%20H1869.7%20V-404%20H1923.6%20H1969.7%20H2005.6%20V0%20H2175.6%20V-404%20H2275.6%20V-516%20H2173.6%20V-547%20C2173.6%20-565%202177.6%20-577%202185.6%20-583%20C2193.6%20-589%202210.6%20-592%202235.6%20-592%20C2251.6%20-592%202267.6%20-591%202281.6%20-590%20L2282.6%20-711%20C2246.6%20-712%202219.6%20-713%202202.6%20-713%20C2133.6%20-713%202083.6%20-700%202052.6%20-674%20C2020.6%20-648%202005.6%20-603%202005.6%20-539%20V-516%20H1969.7%20H1923.6%20H1867.7%20V-547%20C1867.7%20-565%201871.7%20-577%201879.7%20-583%20C1887.7%20-589%201904.7%20-592%201929.7%20-592%20C1945.7%20-592%201961.7%20-591%201975.7%20-590%20L1976.7%20-711%20C1940.7%20-712%201913.7%20-713%201896.7%20-713Z%20M0%20-712%20V0%20H187%20V-274%20H481%20V-420%20H187%20V-557%20H526%20V-712Z%20M2316.6%20-712%20V-584%20H2486.6%20V-712Z%20M1239%20-577%20C1289%20-577%201328%20-558%201357%20-519%20C1385%20-481%201400%20-428%201400%20-360%20C1400%20-289%201386%20-234%201358%20-195%20C1330%20-155%201290%20-136%201240%20-136%20C1188%20-136%201148%20-155%201119%20-195%20C1090%20-234%201076%20-288%201076%20-357%20C1076%20-425%201090%20-478%201120%20-518%20C1149%20-558%201189%20-577%201239%20-577Z%20M2795.6%20-530%20C2713.6%20-530%202647.6%20-504%202597.6%20-454%20C2547.6%20-403%202522.6%20-336%202522.6%20-253%20C2522.6%20-173%202547.6%20-109%202597.6%20-60%20C2647.6%20-11%202712.6%2014%202792.6%2014%20C2867.6%2014%202927.6%20-5%202972.6%20-42%20C3017.6%20-80%203044.6%20-133%203053.6%20-202%20L2891.6%20-203%20C2880.6%20-143%202849.6%20-113%202797.6%20-113%20C2763.6%20-113%202738.6%20-125%202720.6%20-150%20C2702.6%20-174%202693.6%20-209%202693.6%20-255%20C2693.6%20-303%202702.6%20-340%202720.6%20-367%20C2738.6%20-393%202764.6%20-407%202797.6%20-407%20C2821.6%20-407%202840.6%20-400%202856.6%20-386%20C2872.6%20-372%202881.6%20-353%202885.6%20-328%20H3049.6%20C3045.6%20-389%203019.6%20-438%202973.6%20-475%20C2927.6%20-511%202867.6%20-530%202795.6%20-530Z%20M3358.1%20-529%20C3276.1%20-529%203210.1%20-503%203159.1%20-451%20C3107.1%20-399%203082.1%20-333%203082.1%20-252%20C3082.1%20-170%203108.1%20-104%203161.1%20-56%20C3214.1%20-8%203282.1%2016%203364.1%2016%20C3429.1%2016%203484.1%201%203529.1%20-29%20C3574.1%20-59%203605.1%20-101%203622.1%20-157%20H3463.1%20C3441.1%20-117%203408.1%20-97%203366.1%20-97%20C3330.1%20-97%203301.1%20-107%203280.1%20-128%20C3259.1%20-149%203248.1%20-179%203248.1%20-217%20H3632.1%20V-232%20C3632.1%20-324%203607.1%20-396%203558.1%20-449%20C3509.1%20-502%203442.1%20-529%203358.1%20-529Z%20M2316.6%20-516%20V0%20H2486.6%20V-516Z%20M537%20-420%20V-274%20H848%20V-420Z%20M3359.1%20-415%20C3390.1%20-415%203415.1%20-405%203433.1%20-387%20C3451.1%20-369%203462.1%20-344%203465.1%20-314%20H3250.1%20C3260.1%20-381%203297.1%20-415%203359.1%20-415Z'/%3e%3c/svg%3e", Se = 5e7, Ce = 400, I = {
11
11
  kept: "Kept in this browser until you close it",
12
- "too-large": `Not kept across a reload: larger than ${String(xe / 1e6)} MB`,
12
+ "too-large": `Not kept across a reload: larger than ${String(Se / 1e6)} MB`,
13
13
  failed: "Not kept across a reload: the browser's storage is blocked or full"
14
14
  };
15
- function P(e) {
15
+ function we(e) {
16
16
  return new TextEncoder().encode(JSON.stringify(e)).slice().buffer;
17
17
  }
18
- function we(e) {
18
+ function Te(e) {
19
19
  return e === null ? null : JSON.parse(new TextDecoder().decode(e));
20
20
  }
21
- function F(e) {
22
- let t = we(e);
21
+ function L(e) {
22
+ let t = Te(e);
23
23
  return typeof t == "string" ? t : null;
24
24
  }
25
- function I(e) {
26
- let t = we(e);
27
- return t === null ? null : ee(t);
25
+ function Ee(e) {
26
+ let t = Te(e);
27
+ return t === null ? null : p(t);
28
28
  }
29
- var L = class {
29
+ var R = class {
30
30
  #e;
31
31
  #t;
32
32
  #n = Promise.resolve();
@@ -38,16 +38,16 @@ var L = class {
38
38
  }
39
39
  load() {
40
40
  return this.#s(null, async (e) => {
41
- let t = F(await e.read("name")), n = await e.read("bytes");
41
+ let t = L(await e.read("name")), n = await e.read("bytes");
42
42
  return t === null || n === null ? null : (this.#r = !0, {
43
43
  name: t,
44
44
  bytes: n,
45
- view: I(await e.read("view"))
45
+ view: Ee(await e.read("view"))
46
46
  });
47
47
  });
48
48
  }
49
49
  keep(e, t) {
50
- return this.#o(), this.#r = !1, t.byteLength > 5e7 ? this.forget().then(() => "too-large") : this.#s("failed", async (n) => (await n.remove("name"), await n.remove("view"), await n.write("bytes", t.slice(0)), await n.write("name", P(e)), this.#r = !0, "kept"));
50
+ return this.#o(), this.#r = !1, t.byteLength > 5e7 ? this.forget().then(() => "too-large") : this.#s("failed", async (n) => (await n.remove("name"), await n.remove("view"), await n.write("bytes", t.slice(0)), await n.write("name", we(e)), this.#r = !0, "kept"));
51
51
  }
52
52
  keepView(e) {
53
53
  this.#o(), this.#i = e, this.#a = setTimeout(() => void this.flush(), this.#t);
@@ -55,7 +55,7 @@ var L = class {
55
55
  flush() {
56
56
  let e = this.#i;
57
57
  return this.#o(), this.#s(void 0, async (t) => {
58
- e && this.#r && await t.write("view", P(e));
58
+ e && this.#r && await t.write("view", we(e));
59
59
  });
60
60
  }
61
61
  forget() {
@@ -78,17 +78,17 @@ var L = class {
78
78
  return this.#n = n, n;
79
79
  }
80
80
  };
81
- function R(e) {
81
+ function z(e) {
82
82
  return e instanceof DOMException && e.name === "NotFoundError";
83
83
  }
84
- function z(e) {
84
+ function B(e) {
85
85
  let t = (e) => `${e}.bin`;
86
86
  return {
87
87
  read: async (n) => {
88
88
  try {
89
89
  return await (await (await e.getFileHandle(t(n))).getFile()).arrayBuffer();
90
90
  } catch (e) {
91
- if (R(e)) return null;
91
+ if (z(e)) return null;
92
92
  throw e;
93
93
  }
94
94
  },
@@ -98,13 +98,13 @@ function z(e) {
98
98
  },
99
99
  remove: async (n) => {
100
100
  await e.removeEntry(t(n)).catch((e) => {
101
- if (!R(e)) throw e;
101
+ if (!z(e)) throw e;
102
102
  });
103
103
  }
104
104
  };
105
105
  }
106
- var B = "f-office-viewer", V = "kept";
107
- function Te(e) {
106
+ var De = "f-office-viewer", V = "kept";
107
+ function Oe(e) {
108
108
  let t = (t, n) => new Promise((r, i) => {
109
109
  let a = e.transaction(V, t), o = n(a.objectStore(V));
110
110
  a.oncomplete = () => {
@@ -126,9 +126,9 @@ function Te(e) {
126
126
  }
127
127
  };
128
128
  }
129
- function H(e) {
129
+ function ke(e) {
130
130
  return new Promise((t) => {
131
- let n = e.open(B, 1);
131
+ let n = e.open(De, 1);
132
132
  n.onupgradeneeded = () => {
133
133
  n.result.createObjectStore(V);
134
134
  }, n.onsuccess = () => {
@@ -138,91 +138,199 @@ function H(e) {
138
138
  };
139
139
  });
140
140
  }
141
- async function U() {
141
+ async function Ae() {
142
142
  try {
143
- if (typeof FileSystemFileHandle < "u" && "createWritable" in FileSystemFileHandle.prototype) return z(await (await navigator.storage.getDirectory()).getDirectoryHandle(B, { create: !0 }));
143
+ if (typeof FileSystemFileHandle < "u" && "createWritable" in FileSystemFileHandle.prototype) return B(await (await navigator.storage.getDirectory()).getDirectoryHandle(De, { create: !0 }));
144
144
  } catch {}
145
145
  try {
146
146
  if (typeof indexedDB < "u") {
147
- let e = await H(indexedDB);
148
- return e && Te(e);
147
+ let e = await ke(indexedDB);
148
+ return e && Oe(e);
149
149
  }
150
150
  } catch {
151
151
  return null;
152
152
  }
153
153
  return null;
154
154
  }
155
- // src/page-keys.ts
156
- function Ee(e, t) {
157
- let n = e.composedPath(), r = n[0];
158
- return {
159
- inViewer: t !== null && n.includes(t),
160
- inField: r instanceof HTMLInputElement || r instanceof HTMLSelectElement || r instanceof HTMLTextAreaElement,
161
- inDialog: n.some((e) => e instanceof Element && e.getAttribute("role") === "dialog")
162
- };
163
- }
164
- function De(e, t) {
165
- let n = e.target === document.body || e.target === document.documentElement, r = !(e.ctrlKey || e.metaKey || e.altKey);
166
- return !t || !n || !r || !t.scrollByKey(e.key, e.shiftKey) ? !1 : (t.focus(), !0);
167
- }
168
- function Oe(e, t) {
169
- let n = v((n) => {
170
- if (n.defaultPrevented) return;
171
- let r = t.current;
172
- if (De(n, r)) {
173
- n.preventDefault();
174
- return;
175
- }
176
- let i = f(n, Ee(n, r));
177
- i !== null && e.takes(i) && (n.preventDefault(), e.run(i));
178
- });
179
- _(() => (window.addEventListener("keydown", n), () => {
180
- window.removeEventListener("keydown", n);
181
- }), []);
182
- }
183
155
  // src/theme.ts
184
- var W = [
156
+ var H = [
185
157
  "system",
186
158
  "light",
187
159
  "dark"
188
- ], G = {
160
+ ], U = {
189
161
  system: "System",
190
162
  light: "Light",
191
163
  dark: "Dark"
192
- }, K = "f-office-viewer:theme", q = () => window.localStorage;
193
- function ke(e) {
194
- return W.includes(e);
164
+ }, W = "f-office-viewer:theme", je = () => window.localStorage;
165
+ function Me(e) {
166
+ return H.includes(e);
195
167
  }
196
- function Ae(e = q, t = K) {
168
+ function Ne(e = je, t = W) {
197
169
  try {
198
170
  let n = e().getItem(t);
199
- return ke(n) ? n : "system";
171
+ return Me(n) ? n : "system";
200
172
  } catch {
201
173
  return "system";
202
174
  }
203
175
  }
204
- function je(e, t = q, n = K) {
176
+ function Pe(e, t = je, n = W) {
205
177
  try {
206
178
  t().setItem(n, e);
207
179
  } catch {}
208
180
  }
209
- function Me(e, t = document.documentElement) {
181
+ function Fe(e, t = document.documentElement) {
210
182
  e === "system" ? delete t.dataset.theme : t.dataset.theme = e;
211
183
  }
212
- function Ne(e) {
213
- return W[(W.indexOf(e) + 1) % W.length] ?? "system";
184
+ function Ie(e) {
185
+ return H[(H.indexOf(e) + 1) % H.length] ?? "system";
214
186
  }
215
187
  // src/ui/utils.ts
216
- function J(...e) {
217
- return S(me(e));
188
+ function G(...e) {
189
+ return C(S(e));
190
+ }
191
+ // src/ui/portal-theme.ts
192
+ var Le = oe(void 0);
193
+ function K() {
194
+ return m(Le);
195
+ }
196
+ // src/page-keys.ts
197
+ function Re(e, t) {
198
+ let n = e.composedPath(), r = n[0];
199
+ return {
200
+ inViewer: t !== null && n.includes(t),
201
+ inField: r instanceof HTMLInputElement || r instanceof HTMLSelectElement || r instanceof HTMLTextAreaElement,
202
+ inDialog: n.some((e) => e instanceof Element && e.getAttribute("role") === "dialog")
203
+ };
204
+ }
205
+ function ze(e, t) {
206
+ let n = e.target === document.body || e.target === document.documentElement, r = !(e.ctrlKey || e.metaKey || e.altKey);
207
+ return !t || !n || !r || !t.scrollByKey(e.key, e.shiftKey) ? !1 : (t.focus(), !0);
208
+ }
209
+ function Be(e, t) {
210
+ let n = _((n) => {
211
+ if (n.defaultPrevented) return;
212
+ let r = t.current;
213
+ if (ze(n, r)) {
214
+ n.preventDefault();
215
+ return;
216
+ }
217
+ let i = f(n, Re(n, r));
218
+ i !== null && e.takes(i) && (n.preventDefault(), e.run(i));
219
+ });
220
+ g(() => (window.addEventListener("keydown", n), () => {
221
+ window.removeEventListener("keydown", n);
222
+ }), []);
223
+ }
224
+ // src/use-docs-commands.ts
225
+ function Ve({ elementRef: e, pickerRef: t, hasFile: n, hasSelection: r, exportDocument: a, closeFile: o, setDialog: s }) {
226
+ let c = h((n) => {
227
+ let r = e.current;
228
+ switch (n) {
229
+ case "open":
230
+ t.current?.click();
231
+ return;
232
+ case "print":
233
+ if (r) {
234
+ let e = ee();
235
+ r.pdf().then(e.print, e.cancel);
236
+ }
237
+ return;
238
+ case "download":
239
+ case "export-docx":
240
+ a("docx");
241
+ return;
242
+ case "export-pdf":
243
+ a("pdf");
244
+ return;
245
+ case "export-text":
246
+ a("text");
247
+ return;
248
+ case "export-markdown":
249
+ a("markdown");
250
+ return;
251
+ case "close":
252
+ o();
253
+ return;
254
+ case "copy":
255
+ r?.copyText(null);
256
+ return;
257
+ case "select-all":
258
+ r?.selectAll();
259
+ return;
260
+ case "find":
261
+ r?.find();
262
+ return;
263
+ case "zoom-in":
264
+ r?.zoomStep(!0);
265
+ return;
266
+ case "zoom-out":
267
+ r?.zoomStep(!1);
268
+ return;
269
+ case "actual-size":
270
+ r?.setZoom("fixed", 1);
271
+ return;
272
+ case "advanced":
273
+ s("advanced");
274
+ return;
275
+ case "shortcuts":
276
+ s("shortcuts");
277
+ return;
278
+ case "about":
279
+ s("about");
280
+ return;
281
+ default: return;
282
+ }
283
+ }, [
284
+ e,
285
+ t,
286
+ a,
287
+ o,
288
+ s
289
+ ]);
290
+ return Be({
291
+ takes: (e) => i(e, n, r),
292
+ run: c
293
+ }, e), c;
294
+ }
295
+ // src/use-docs-exports.ts
296
+ function He(e, t) {
297
+ let n = URL.createObjectURL(e), r = document.createElement("a");
298
+ r.href = n, r.download = t, r.click(), URL.revokeObjectURL(n);
299
+ }
300
+ function Ue(e, t) {
301
+ return `${e.replace(/\.docx$/i, "")}.${t}`;
302
+ }
303
+ function We({ elementRef: e, file: t, onError: n }) {
304
+ let r = y(/* @__PURE__ */ new Set());
305
+ return h((i) => {
306
+ if (!t) return;
307
+ if (i === "docx") {
308
+ He(new Blob([t.bytes]), t.name);
309
+ return;
310
+ }
311
+ let a = e.current;
312
+ if (!a || r.current.has(i)) return;
313
+ let o, s;
314
+ i === "pdf" ? (o = a.exportPdf(), s = "pdf") : i === "text" ? (o = a.exportText(), s = "txt") : (o = a.exportMarkdown(), s = "md"), r.current.add(i), o.then((e) => {
315
+ He(e, Ue(t.name, s));
316
+ }, (e) => {
317
+ n(e instanceof Error ? e.message : String(e));
318
+ }).finally(() => {
319
+ r.current.delete(i);
320
+ });
321
+ }, [
322
+ e,
323
+ t,
324
+ n
325
+ ]);
218
326
  }
219
327
  // src/url-file.ts
220
- var Pe = "file";
221
- function Fe(e, t) {
328
+ var q = "file";
329
+ function Ge(e, t) {
222
330
  return `The address names a file on ${e.origin}. F-Office Docs opens files only from ${t.origin}, the site of this page.`;
223
331
  }
224
- function Ie(e, t) {
225
- let n = new URLSearchParams(e).get(Pe);
332
+ function J(e, t) {
333
+ let n = new URLSearchParams(e).get(q);
226
334
  if (n === null || n === "") return null;
227
335
  let r = new URL(t), i;
228
336
  try {
@@ -238,7 +346,7 @@ function Ie(e, t) {
238
346
  address: i
239
347
  } : {
240
348
  kind: "refused",
241
- why: Fe(i, r)
349
+ why: Ge(i, r)
242
350
  };
243
351
  }
244
352
  function Y(e) {
@@ -248,415 +356,459 @@ function Y(e) {
248
356
  } catch {}
249
357
  return n || "document.docx";
250
358
  }
251
- async function X(e, t, n = fetch) {
359
+ async function Ke(e, t, n = fetch) {
252
360
  let r = await n(e.href, t ? { signal: t } : {}), i = r.url ? new URL(r.url) : e;
253
- if (i.origin !== e.origin) throw Error(Fe(i, e));
361
+ if (i.origin !== e.origin) throw Error(Ge(i, e));
254
362
  if (!r.ok) throw Error(`The file ${Y(e)} cannot be read: the server answered HTTP ${String(r.status)}.`);
255
363
  return {
256
364
  name: Y(e),
257
365
  bytes: await r.arrayBuffer()
258
366
  };
259
367
  }
260
- function Le() {
368
+ function qe() {
261
369
  let e = new URLSearchParams(window.location.search);
262
370
  if (!e.has("file")) return;
263
- e.delete(Pe);
371
+ e.delete(q);
264
372
  let t = e.toString();
265
373
  window.history.replaceState(null, "", t ? `?${t}` : window.location.pathname);
266
374
  }
267
- function Re(e) {
375
+ function Je(e) {
268
376
  return e instanceof Error ? e.message : String(e);
269
377
  }
270
- function ze(e, t, n) {
271
- let r = v(t), i = v(n);
272
- _(() => {
378
+ function Ye(e, t, n) {
379
+ let r = _(t), i = _(n);
380
+ g(() => {
273
381
  if (e?.kind === "refused" && i(e.why), e?.kind !== "address") return;
274
382
  let t = new AbortController();
275
- return X(e.address, t.signal).then((e) => {
383
+ return Ke(e.address, t.signal).then((e) => {
276
384
  r(e);
277
385
  }, (e) => {
278
- t.signal.aborted || i(Re(e));
386
+ t.signal.aborted || i(Je(e));
279
387
  }), () => {
280
388
  t.abort();
281
389
  };
282
390
  }, [e]);
283
391
  }
392
+ // src/use-docs-persistence.ts
393
+ function Xe({ keeper: e, readUrlParams: t, initialFile: n, initialUrl: r, onProblem: i }) {
394
+ let a = y(0), [o] = b(() => r ? J(`?${q}=${encodeURIComponent(r)}`, window.location.href) : t ? J(window.location.search, window.location.href) : null), [s, c] = b(null), [l, u] = b(null), [d, f] = b(0), p = h(({ name: t, bytes: n }) => {
395
+ c({
396
+ name: t,
397
+ bytes: n,
398
+ view: null
399
+ }), u(null), e && e.keep(t, n).then((e) => {
400
+ u(I[e]);
401
+ });
402
+ }, [e]);
403
+ return Ye(o, p, i), g(() => {
404
+ if (!n) return;
405
+ let e = !0;
406
+ return n.arrayBuffer().then((t) => {
407
+ e && p({
408
+ name: n.name,
409
+ bytes: t
410
+ });
411
+ }), () => {
412
+ e = !1;
413
+ };
414
+ }, [n, p]), g(() => {
415
+ if (!e) return;
416
+ e.load().then((e) => {
417
+ e && o?.kind !== "address" && !n && (c((t) => t ?? e), u((e) => e ?? I.kept));
418
+ });
419
+ let t = () => void e.flush();
420
+ return window.addEventListener("pagehide", t), () => {
421
+ window.removeEventListener("pagehide", t);
422
+ };
423
+ }, [
424
+ e,
425
+ o,
426
+ n
427
+ ]), {
428
+ file: s,
429
+ note: l,
430
+ setNote: u,
431
+ generation: d,
432
+ openFile: h((e) => {
433
+ if (!e) return;
434
+ let n = ++a.current;
435
+ e.arrayBuffer().then((r) => {
436
+ n === a.current && (t && qe(), p({
437
+ name: e.name,
438
+ bytes: r
439
+ }));
440
+ });
441
+ }, [t, p]),
442
+ closeFile: h(() => {
443
+ t && qe(), e?.forget(), c(null), u(null), f((e) => e + 1);
444
+ }, [e, t])
445
+ };
446
+ }
447
+ // src/use-docs-theme.ts
448
+ function Ze({ controlledTheme: e, onThemeChange: t, applyDocumentTheme: n = !0, themeStorageKey: r = W }) {
449
+ let [i, a] = b(() => Ne(void 0, r)), o = e ?? i, s = h((n) => {
450
+ e === void 0 && (Pe(n, void 0, r), a(n)), t?.(n);
451
+ }, [
452
+ e,
453
+ t,
454
+ r
455
+ ]);
456
+ return g(() => {
457
+ n && Fe(o);
458
+ }, [o, n]), [o, s];
459
+ }
284
460
  // src/docs-provider.tsx
285
- var Be = null;
286
- function Ve() {
287
- return Be ||= new L(U()), Be;
461
+ var Qe = null;
462
+ function $e() {
463
+ return Qe ||= new R(Ae()), Qe;
288
464
  }
289
- var He = {
465
+ var et = {
290
466
  selected: !1,
291
467
  outline: !1,
292
468
  zoom: "fixed:1",
293
469
  zoomSteps: [],
294
470
  page: 0,
295
- pageCount: 0
471
+ pageCount: 0,
472
+ layoutComplete: !0,
473
+ progress: null,
474
+ fidelity: null
296
475
  };
297
- function Ue(e) {
476
+ function tt(e) {
298
477
  return e.zoom === "fixed" ? c(e.factor) : e.zoom;
299
478
  }
300
- function We(e) {
479
+ function nt(e) {
301
480
  return `The installed fonts cannot be read (${e instanceof Error ? e.message : String(e)}), so the pages use the open fonts.`;
302
481
  }
303
- function Ge(e) {
304
- let t = URL.createObjectURL(new Blob([e.bytes])), n = document.createElement("a");
305
- n.href = t, n.download = e.name, n.click(), URL.revokeObjectURL(t);
306
- }
307
- var Ke = m(null);
308
- function qe() {
309
- let e = h(Ke);
482
+ var rt = oe(null);
483
+ function it() {
484
+ let e = m(rt);
310
485
  if (!e) throw Error("useDocs must be used inside a <DocsProvider>");
311
486
  return e;
312
487
  }
313
- function Z() {
314
- return qe().publicValue;
488
+ function X() {
489
+ return it().publicValue;
315
490
  }
316
- function Je() {
317
- return qe().internal;
491
+ function at() {
492
+ return it().internal;
318
493
  }
319
- function Ye({ children: e, keeper: n, fontCdnUrl: r = oe, fontFolderUrl: a, fontSource: o, moduleUrls: c, theme: l, onThemeChange: u, applyDocumentTheme: d = !0, themeStorageKey: f = K, syncDocumentTitle: ee = !1, readUrlParams: p = !0, initialFile: m, initialUrl: h, className: me }) {
494
+ function ot({ children: e, keeper: n, fontCdnUrl: r = x, fontFolderUrl: i, fontSource: a, moduleUrls: o, theme: c, onThemeChange: l, applyDocumentTheme: u = !0, themeStorageKey: d = W, syncDocumentTitle: f = !1, readUrlParams: p = !0, initialFile: ee, initialUrl: ie, className: oe }) {
320
495
  le();
321
- let S = n === void 0 ? Ve() : n, C = b(null), E = b(null), [D, he] = x(() => p ? ae(window.location.search) : "word-win"), [ge] = x(() => h ? Ie(`?${Pe}=${encodeURIComponent(h)}`, window.location.href) : p ? Ie(window.location.search, window.location.href) : null), [O, _e] = x(null), [ve, k] = x(null), [ye, A] = x(0), [j, M] = x(!1), [be, N] = x(null), [xe, Se] = x(() => Ae(void 0, f)), P = l ?? xe, we = g((e) => {
322
- l === void 0 && (je(e, void 0, f), Se(e)), u?.(e);
496
+ let m = n === void 0 ? $e() : n, S = y(null), C = y(null), [w, me] = b(() => p ? ae(window.location.search) : "word-win"), [he, D] = b(!1), [ge, _e] = b(null), [O, ve] = b(() => p ? pe(window.location.search) : "open"), [k, ye] = b(null), [A, j] = b(et), [M, N] = b(null), [P, F] = b(0), [be, xe] = b({
497
+ scope: "",
498
+ open: !1
499
+ }), [Se, Ce] = b(null), [I, we] = Ze({
500
+ controlledTheme: c,
501
+ onThemeChange: l,
502
+ applyDocumentTheme: u,
503
+ themeStorageKey: d
504
+ }), Te = h((e) => {
505
+ _e({ problem: e });
506
+ }, []), { file: L, note: Ee, setNote: R, generation: z, openFile: B, closeFile: De } = Xe({
507
+ keeper: m,
508
+ readUrlParams: p,
509
+ initialFile: ee,
510
+ initialUrl: ie,
511
+ onProblem: Te
512
+ }), V = v(() => {
513
+ if (a) return a;
514
+ let e = i ? ue(typeof i == "string" ? new URL(i, document.baseURI) : i, O === "installed" ? "installed" : "open") : ce(r);
515
+ return O === "installed" && k ? fe(k, e) : e;
323
516
  }, [
324
- l,
325
- u,
326
- f
327
- ]);
328
- _(() => {
329
- d && Me(P);
330
- }, [P, d]);
331
- let [F, I] = x(() => p ? pe(window.location.search) : "open"), [L, R] = x(null), [z, B] = x(He), [V, Te] = x(null), H = y(() => {
332
- if (o) return o;
333
- let e = a ? ue(typeof a == "string" ? new URL(a, document.baseURI) : a, F === "installed" ? "installed" : "open") : ce(r);
334
- return F === "installed" && L ? fe(L, e) : e;
335
- }, [
336
- o,
337
517
  a,
518
+ i,
338
519
  r,
339
- F,
340
- L
341
- ]), U = g(({ name: e, bytes: t }) => {
342
- _e({
343
- name: e,
344
- bytes: t,
345
- view: null
346
- }), k(null), S && S.keep(e, t).then((e) => {
347
- k(Ce[e]);
348
- });
349
- }, [S]);
350
- ze(ge, U, g((e) => {
351
- N({ problem: e });
352
- }, [])), _(() => {
353
- if (!m) return;
354
- let e = !0;
355
- return m.arrayBuffer().then((t) => {
356
- e && U({
357
- name: m.name,
358
- bytes: t
359
- });
360
- }), () => {
361
- e = !1;
362
- };
363
- }, [m, U]), _(() => {
364
- if (!S) return;
365
- S.load().then((e) => {
366
- e && ge?.kind !== "address" && !m && (_e((t) => t ?? e), k((e) => e ?? Ce.kept));
520
+ O,
521
+ k
522
+ ]);
523
+ g(() => {
524
+ O !== "installed" || k || de().then(ye, (e) => {
525
+ ve("open"), R(nt(e));
367
526
  });
368
- let e = () => void S.flush();
369
- return window.addEventListener("pagehide", e), () => {
370
- window.removeEventListener("pagehide", e);
371
- };
372
527
  }, [
373
- S,
374
- ge,
375
- m
376
- ]), _(() => {
377
- F !== "installed" || L || de().then(R, (e) => {
378
- I("open"), k(We(e));
379
- });
380
- }, [F, L]);
381
- let [Ee, De] = x(0), W = v((e) => {
528
+ O,
529
+ k,
530
+ R
531
+ ]);
532
+ let Oe = _((e) => {
382
533
  let t = e.detail;
383
- S?.keepView(t), B((e) => ({
534
+ m?.keepView(t), j((e) => ({
384
535
  ...e,
385
- zoom: Ue(t)
536
+ zoom: tt(t)
386
537
  }));
387
- }), G = v((e) => {
388
- let { pageCount: t, zoomSteps: n } = e.detail;
389
- B((e) => ({
538
+ }), ke = _((e) => {
539
+ let { pageCount: t, zoomSteps: n, complete: r } = e.detail, i = r ?? !0;
540
+ j((e) => ({
390
541
  ...e,
391
542
  pageCount: t,
392
543
  zoomSteps: n,
393
- page: 0
544
+ page: 0,
545
+ layoutComplete: i,
546
+ progress: i ? null : e.progress
547
+ }));
548
+ }), Ae = _((e) => {
549
+ let { pageCount: t, complete: n } = e.detail;
550
+ j((e) => ({
551
+ ...e,
552
+ pageCount: t,
553
+ layoutComplete: n,
554
+ progress: n ? null : e.progress
555
+ }));
556
+ }), H = _((e) => {
557
+ let t = e.detail;
558
+ j((e) => ({
559
+ ...e,
560
+ progress: t.complete ? null : t
394
561
  }));
395
- }), q = v((e) => {
562
+ }), U = _(() => {
563
+ j((e) => e.progress === null ? e : {
564
+ ...e,
565
+ progress: null
566
+ });
567
+ }), je = _((e) => {
396
568
  let { page: t } = e.detail;
397
- B((e) => ({
569
+ j((e) => ({
398
570
  ...e,
399
571
  page: t
400
572
  }));
401
- }), ke = v((e) => {
573
+ }), Me = _((e) => {
402
574
  let { open: t } = e.detail;
403
- B((e) => ({
575
+ j((e) => ({
404
576
  ...e,
405
577
  outline: t
406
578
  }));
407
- }), Ne = v((e) => {
579
+ }), Ne = _((e) => {
408
580
  let { selected: t } = e.detail;
409
- B((e) => ({
581
+ j((e) => ({
410
582
  ...e,
411
583
  selected: t
412
584
  }));
413
- }), Fe = v((e) => {
414
- e.preventDefault(), Te(e.detail);
415
- }), Y = g((e) => (E.current = e, De((e) => e + 1), () => {
416
- E.current = null, B(He);
585
+ }), Pe = _((e) => {
586
+ e.preventDefault(), N(e.detail);
587
+ }), Fe = _((e) => {
588
+ let t = e.detail;
589
+ j((e) => ({
590
+ ...e,
591
+ fidelity: t
592
+ }));
593
+ }), Ie = h((e) => (C.current = e, F((e) => e + 1), () => {
594
+ C.current = null, j(et);
417
595
  }), []);
418
- _(() => {
419
- let e = E.current;
420
- if (e) return e.addEventListener("viewchange", W), e.addEventListener("open", G), e.addEventListener("pagechange", q), e.addEventListener("outlinechange", ke), e.addEventListener("selectionchange", Ne), e.addEventListener("menu", Fe), () => {
421
- e.removeEventListener("viewchange", W), e.removeEventListener("open", G), e.removeEventListener("pagechange", q), e.removeEventListener("outlinechange", ke), e.removeEventListener("selectionchange", Ne), e.removeEventListener("menu", Fe);
596
+ g(() => {
597
+ let e = C.current;
598
+ if (e) return e.addEventListener("viewchange", Oe), e.addEventListener("open", ke), e.addEventListener("pageschange", Ae), e.addEventListener("progress", H), e.addEventListener("error", U), e.addEventListener("pagechange", je), e.addEventListener("outlinechange", Me), e.addEventListener("selectionchange", Ne), e.addEventListener("menu", Pe), e.addEventListener("fidelitychange", Fe), () => {
599
+ e.removeEventListener("viewchange", Oe), e.removeEventListener("open", ke), e.removeEventListener("pageschange", Ae), e.removeEventListener("progress", H), e.removeEventListener("error", U), e.removeEventListener("pagechange", je), e.removeEventListener("outlinechange", Me), e.removeEventListener("selectionchange", Ne), e.removeEventListener("menu", Pe), e.removeEventListener("fidelitychange", Fe);
600
+ };
601
+ }, [P]);
602
+ let K = `${String(z)}:${w}:${O}:${L?.name ?? ""}`, Re = L !== null && be.scope === K && be.open, ze = Se === K;
603
+ g(() => {
604
+ let e = C.current;
605
+ if (!e || O === "installed" && !k || (e.target = w, e.fontSource = V, !L)) return;
606
+ let n = !1, { view: r } = L;
607
+ return e.open(L.bytes, L.name).then(() => {
608
+ n || (r ? e.showView(r) : e.clientWidth < t && e.setZoom("fit-width"));
609
+ }, () => void 0), () => {
610
+ n = !0;
422
611
  };
423
- }, [Ee]), _(() => {
424
- let e = E.current;
425
- if (e && (F !== "installed" || L) && (e.target = D, e.fontSource = H, O)) {
426
- let { view: n } = O;
427
- e.open(O.bytes, O.name).then(() => {
428
- n ? e.showView(n) : e.clientWidth < t && e.setZoom("fit-width");
429
- }, () => void 0);
430
- }
431
612
  }, [
432
- Ee,
433
- D,
434
- O,
435
- ye,
436
- F,
613
+ P,
614
+ w,
437
615
  L,
438
- H
439
- ]), _(() => {
440
- ee && (document.title = O ? `${O.name} — F-Office Docs` : "F-Office Docs");
441
- }, [O, ee]);
442
- let X = g((e) => {
443
- e && e.arrayBuffer().then((t) => {
444
- p && Le(), U({
445
- name: e.name,
446
- bytes: t
447
- });
448
- });
449
- }, [p, U]), Re = g((e) => {
450
- let t = E.current;
451
- switch (e) {
452
- case "open":
453
- C.current?.click();
454
- return;
455
- case "print":
456
- if (t) {
457
- let e = te();
458
- t.pdf().then(e.print, e.cancel);
459
- }
460
- return;
461
- case "download":
462
- O && Ge(O);
463
- return;
464
- case "close":
465
- p && Le(), S?.forget(), _e(null), k(null), A((e) => e + 1);
466
- return;
467
- case "copy":
468
- t?.copyText(null);
469
- return;
470
- case "select-all":
471
- t?.selectAll();
472
- return;
473
- case "find":
474
- t?.find();
475
- return;
476
- case "zoom-in":
477
- t?.zoomStep(!0);
478
- return;
479
- case "zoom-out":
480
- t?.zoomStep(!1);
481
- return;
482
- case "actual-size":
483
- t?.setZoom("fixed", 1);
484
- return;
485
- case "advanced":
486
- N("advanced");
487
- return;
488
- case "shortcuts":
489
- N("shortcuts");
490
- return;
491
- case "about":
492
- N("about");
493
- return;
494
- default: return;
495
- }
496
- }, [
616
+ z,
497
617
  O,
498
- S,
499
- p
500
- ]);
501
- Oe({
502
- takes: (e) => i(e, O !== null, z.selected),
503
- run: Re
504
- }, E);
505
- let Be = g((e) => {
506
- he(e), p && re(e);
507
- }, [p]), qe = g(() => {
508
- N(null);
509
- }, []), Z = y(() => ({
510
- run: Re,
618
+ k,
619
+ V
620
+ ]), g(() => {
621
+ f && (document.title = L ? `${L.name} — F-Office Docs` : "F-Office Docs");
622
+ }, [L, f]);
623
+ let Be = We({
624
+ elementRef: C,
625
+ file: L,
626
+ onError: Te
627
+ }), He = Ve({
628
+ elementRef: C,
629
+ pickerRef: S,
630
+ hasFile: L !== null,
631
+ hasSelection: A.selected,
632
+ exportDocument: Be,
633
+ closeFile: De,
634
+ setDialog: _e
635
+ }), Ue = h((e) => {
636
+ me(e), p && ne(e);
637
+ }, [p]), q = h(() => {
638
+ _e(null);
639
+ }, []), Ge = h((e) => {
640
+ xe({
641
+ scope: K,
642
+ open: e
643
+ });
644
+ }, [K]), J = h(() => {
645
+ Ce(K);
646
+ }, [K]), Y = v(() => ({
647
+ run: He,
511
648
  setOutline: (e) => {
512
- E.current && (E.current.outlineOpen = e);
649
+ C.current && (C.current.outlineOpen = e);
513
650
  },
514
651
  setZoom: (e) => {
515
- let { zoom: t, factor: n } = ne(e);
516
- E.current?.setZoom(t, n);
652
+ let { zoom: t, factor: n } = te(e);
653
+ C.current?.setZoom(t, n);
517
654
  },
518
655
  setTheme: we,
519
656
  setFonts: (e) => {
520
- e === "open" ? (p && ie("fonts", e), I(e)) : de().then((t) => {
521
- p && ie("fonts", e), R(t), I(e);
657
+ e === "open" ? (p && re("fonts", e), ve(e)) : de().then((t) => {
658
+ p && re("fonts", e), ye(t), ve(e);
522
659
  }, (e) => {
523
- k(We(e));
660
+ R(nt(e));
524
661
  });
525
662
  },
526
663
  focusPages: () => {
527
- E.current?.focus();
664
+ C.current?.focus();
528
665
  }
529
666
  }), [
530
- Re,
667
+ He,
531
668
  we,
532
- p
533
- ]), Je = y(() => ({
534
- ...z,
535
- name: O?.name ?? null,
536
- note: ve,
537
- theme: P,
538
- fonts: F,
669
+ p,
670
+ R
671
+ ]), Ke = v(() => ({
672
+ ...A,
673
+ fidelity: L ? A.fidelity : null,
674
+ name: L?.name ?? null,
675
+ note: Ee,
676
+ theme: I,
677
+ fonts: O,
539
678
  installedFonts: se()
540
679
  }), [
541
- z,
542
- O,
543
- ve,
544
- P,
545
- F
546
- ]), Ye = y(() => ({
680
+ A,
681
+ L,
682
+ Ee,
683
+ I,
684
+ O
685
+ ]), qe = v(() => ({
547
686
  publicValue: {
548
- state: Je,
549
- calls: Z,
550
- openFile: X,
551
- elementRef: E,
552
- target: D,
553
- setTarget: Be,
554
- dialog: be,
555
- closeDialog: qe
687
+ state: Ke,
688
+ calls: Y,
689
+ openFile: B,
690
+ elementRef: C,
691
+ target: w,
692
+ setTarget: Ue,
693
+ dialog: ge,
694
+ closeDialog: q,
695
+ fidelityOpen: Re,
696
+ setFidelityOpen: Ge,
697
+ fidelityBannerDismissed: ze,
698
+ dismissFidelityBanner: J
556
699
  },
557
700
  internal: {
558
- file: O,
559
- dragging: j,
560
- generation: ye,
561
- menu: V,
562
- moduleUrls: c,
563
- attachElement: Y
701
+ file: L,
702
+ dragging: he,
703
+ generation: z,
704
+ menu: M,
705
+ moduleUrls: o,
706
+ attachElement: Ie
564
707
  }
565
708
  }), [
566
- Je,
567
- Z,
568
- X,
569
- D,
570
- Be,
571
- be,
572
- qe,
573
- O,
574
- j,
575
- ye,
576
- V,
577
- c,
578
- Y
709
+ Ke,
710
+ Y,
711
+ B,
712
+ w,
713
+ Ue,
714
+ ge,
715
+ q,
716
+ Re,
717
+ Ge,
718
+ ze,
719
+ J,
720
+ L,
721
+ he,
722
+ z,
723
+ M,
724
+ o,
725
+ Ie
579
726
  ]);
580
- return /* @__PURE__ */ w(Ke, {
581
- value: Ye,
582
- children: /* @__PURE__ */ T("div", {
583
- "data-f-office-theme": P,
584
- className: J("f-office-docs-root flex h-full min-h-0 flex-col bg-background text-foreground", me),
585
- onDragOver: (e) => {
586
- e.preventDefault(), M(!0);
587
- },
588
- onDragLeave: () => {
589
- M(!1);
590
- },
591
- onDrop: (e) => {
592
- e.preventDefault(), M(!1), X(s(e.dataTransfer.files));
593
- },
594
- children: [e, /* @__PURE__ */ w("input", {
595
- ref: C,
596
- className: "hidden",
597
- type: "file",
598
- accept: ".docx",
599
- "aria-label": "DOCX file",
600
- onChange: (e) => {
601
- X(s(e.target.files)), e.target.value = "";
602
- }
603
- })]
727
+ return /* @__PURE__ */ T(rt, {
728
+ value: qe,
729
+ children: /* @__PURE__ */ T(Le, {
730
+ value: I,
731
+ children: /* @__PURE__ */ E("div", {
732
+ "data-f-office-theme": I,
733
+ className: G("f-office-docs-root flex h-full min-h-0 flex-col bg-background text-foreground", oe),
734
+ onDragOver: (e) => {
735
+ e.preventDefault(), D(!0);
736
+ },
737
+ onDragLeave: () => {
738
+ D(!1);
739
+ },
740
+ onDrop: (e) => {
741
+ e.preventDefault(), D(!1), B(s(e.dataTransfer.files));
742
+ },
743
+ children: [e, /* @__PURE__ */ T("input", {
744
+ ref: S,
745
+ className: "hidden",
746
+ type: "file",
747
+ accept: ".docx",
748
+ "aria-label": "DOCX file",
749
+ onChange: (e) => {
750
+ B(s(e.target.files)), e.target.value = "";
751
+ }
752
+ })]
753
+ })
604
754
  })
605
755
  });
606
756
  }
607
757
  // src/ui/dialog.tsx
608
- var Xe = j.Root;
609
- function Ze({ className: e, children: t, ...n }) {
610
- return /* @__PURE__ */ T(j.Portal, { children: [/* @__PURE__ */ w(j.Overlay, { className: "fixed inset-0 z-50 bg-black/40" }), /* @__PURE__ */ T(j.Content, {
758
+ var st = N.Root;
759
+ function ct({ className: e, children: t, ...n }) {
760
+ let r = K();
761
+ return /* @__PURE__ */ E(N.Portal, { children: [/* @__PURE__ */ T(N.Overlay, { className: "fixed inset-0 z-50 bg-black/40" }), /* @__PURE__ */ E(N.Content, {
611
762
  "data-slot": "dialog-content",
612
- className: J("fixed top-1/2 left-1/2 z-50 grid w-[min(28rem,calc(100%-2rem))] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover p-6 text-popover-foreground shadow-xl", e),
763
+ "data-f-office-theme": r,
764
+ className: G("f-office-docs-portal fixed top-1/2 left-1/2 z-50 grid w-[min(28rem,calc(100%-2rem))] -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl border border-border bg-popover p-6 text-popover-foreground shadow-xl", e),
613
765
  ...n,
614
- children: [t, /* @__PURE__ */ w(j.Close, {
766
+ children: [t, /* @__PURE__ */ T(N.Close, {
615
767
  className: "absolute top-4 right-4 rounded-full p-1 text-muted-foreground hover:bg-accent",
616
768
  "aria-label": "Close",
617
- children: /* @__PURE__ */ w(ye, { className: "size-4" })
769
+ children: /* @__PURE__ */ T(j, { className: "size-4" })
618
770
  })]
619
771
  })] });
620
772
  }
621
- function Qe({ className: e, ...t }) {
622
- return /* @__PURE__ */ w(j.Title, {
773
+ function lt({ className: e, ...t }) {
774
+ return /* @__PURE__ */ T(N.Title, {
623
775
  "data-slot": "dialog-title",
624
- className: J("text-lg font-medium", e),
776
+ className: G("text-lg font-medium", e),
625
777
  ...t
626
778
  });
627
779
  }
628
- function $e({ className: e, ...t }) {
629
- return /* @__PURE__ */ w(j.Description, {
780
+ function ut({ className: e, ...t }) {
781
+ return /* @__PURE__ */ T(N.Description, {
630
782
  "data-slot": "dialog-description",
631
- className: J("text-sm text-muted-foreground", e),
783
+ className: G("text-sm text-muted-foreground", e),
632
784
  ...t
633
785
  });
634
786
  }
635
787
  // src/dialogs.tsx
636
- function et({ className: e }) {
637
- return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w("img", {
638
- src: N,
788
+ function dt({ className: e }) {
789
+ return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("img", {
790
+ src: xe,
639
791
  alt: "F-Office",
640
792
  className: `f-office-logo-light ${e}`
641
- }), /* @__PURE__ */ w("img", {
793
+ }), /* @__PURE__ */ T("img", {
642
794
  src: be,
643
795
  alt: "F-Office",
644
796
  className: `f-office-logo-dark ${e}`
645
797
  })] });
646
798
  }
647
- function tt() {
799
+ function ft() {
648
800
  let e = a(navigator.userAgent);
649
- return /* @__PURE__ */ T(C, { children: [
650
- /* @__PURE__ */ w(Qe, { children: "Keyboard shortcuts" }),
651
- /* @__PURE__ */ w($e, { children: "Click the pages first, so that the keys of the text reach the document." }),
652
- /* @__PURE__ */ w("table", {
801
+ return /* @__PURE__ */ E(w, { children: [
802
+ /* @__PURE__ */ T(lt, { children: "Keyboard shortcuts" }),
803
+ /* @__PURE__ */ T(ut, { children: "Click the pages first, so that the keys of the text reach the document." }),
804
+ /* @__PURE__ */ T("table", {
653
805
  className: "text-sm",
654
- children: /* @__PURE__ */ w("tbody", { children: p(e).map(([e, t]) => /* @__PURE__ */ T("tr", {
806
+ children: /* @__PURE__ */ T("tbody", { children: ie(e).map(([e, t]) => /* @__PURE__ */ E("tr", {
655
807
  className: "border-t border-border",
656
- children: [/* @__PURE__ */ w("td", {
808
+ children: [/* @__PURE__ */ T("td", {
657
809
  className: "py-1.5 pr-4 font-mono text-xs",
658
810
  children: e
659
- }), /* @__PURE__ */ w("td", {
811
+ }), /* @__PURE__ */ T("td", {
660
812
  className: "py-1.5",
661
813
  children: t
662
814
  })]
@@ -664,32 +816,32 @@ function tt() {
664
816
  })
665
817
  ] });
666
818
  }
667
- function nt() {
668
- return /* @__PURE__ */ T(C, { children: [
669
- /* @__PURE__ */ w(Qe, {
819
+ function pt() {
820
+ return /* @__PURE__ */ E(w, { children: [
821
+ /* @__PURE__ */ T(lt, {
670
822
  className: "sr-only",
671
823
  children: "About F-Office"
672
824
  }),
673
- /* @__PURE__ */ w(et, { className: "h-8 w-auto self-start" }),
674
- /* @__PURE__ */ w($e, { children: "F-Office draws the pages of DOCX files as Word lays them out, in your browser. The file that you open stays in this browser." })
825
+ /* @__PURE__ */ T(dt, { className: "h-8 w-auto self-start" }),
826
+ /* @__PURE__ */ T(ut, { children: "F-Office draws the pages of DOCX files as Word lays them out, in your browser. The file that you open stays in this browser." })
675
827
  ] });
676
828
  }
677
- function rt({ why: e }) {
678
- return /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(Qe, { children: "The file cannot be opened" }), /* @__PURE__ */ w($e, { children: e })] });
829
+ function mt({ why: e }) {
830
+ return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(lt, { children: "The file cannot be opened" }), /* @__PURE__ */ T(ut, { children: e })] });
679
831
  }
680
- function it({ target: e, setTarget: t }) {
681
- return /* @__PURE__ */ T(C, { children: [
682
- /* @__PURE__ */ w(Qe, { children: "Advanced settings" }),
683
- /* @__PURE__ */ w($e, { children: "Target: which Word the layout copies. Not ready yet: this setting exists only for testing." }),
684
- /* @__PURE__ */ T("label", {
832
+ function ht({ target: e, setTarget: t }) {
833
+ return /* @__PURE__ */ E(w, { children: [
834
+ /* @__PURE__ */ T(lt, { children: "Advanced settings" }),
835
+ /* @__PURE__ */ T(ut, { children: "Target: which Word the layout copies. Not ready yet: this setting exists only for testing." }),
836
+ /* @__PURE__ */ E("label", {
685
837
  className: "flex items-center gap-3 text-sm",
686
- children: ["Target", /* @__PURE__ */ w("select", {
838
+ children: ["Target", /* @__PURE__ */ T("select", {
687
839
  className: "h-9 rounded-md border border-border bg-transparent px-2",
688
840
  value: e,
689
841
  onChange: (e) => {
690
842
  t(e.target.value);
691
843
  },
692
- children: n.map((e) => /* @__PURE__ */ w("option", {
844
+ children: n.map((e) => /* @__PURE__ */ T("option", {
693
845
  value: e.id,
694
846
  children: e.label
695
847
  }, e.id))
@@ -697,63 +849,65 @@ function it({ target: e, setTarget: t }) {
697
849
  })
698
850
  ] });
699
851
  }
700
- function at() {
701
- let { dialog: e, closeDialog: t, calls: n, target: r, setTarget: i } = Z();
702
- return /* @__PURE__ */ w(Xe, {
852
+ function gt() {
853
+ let { dialog: e, closeDialog: t, calls: n, target: r, setTarget: i } = X();
854
+ return /* @__PURE__ */ T(st, {
703
855
  open: e !== null,
704
856
  onOpenChange: (e) => {
705
857
  e || t();
706
858
  },
707
- children: /* @__PURE__ */ T(Ze, {
859
+ children: /* @__PURE__ */ E(ct, {
708
860
  onCloseAutoFocus: (e) => {
709
861
  e.preventDefault(), n.focusPages();
710
862
  },
711
863
  children: [
712
- e === "shortcuts" && /* @__PURE__ */ w(tt, {}),
713
- e === "about" && /* @__PURE__ */ w(nt, {}),
714
- e === "advanced" && /* @__PURE__ */ w(it, {
864
+ e === "shortcuts" && /* @__PURE__ */ T(ft, {}),
865
+ e === "about" && /* @__PURE__ */ T(pt, {}),
866
+ e === "advanced" && /* @__PURE__ */ T(ht, {
715
867
  target: r,
716
868
  setTarget: i
717
869
  }),
718
- typeof e == "object" && !!e && /* @__PURE__ */ w(rt, { why: e.problem })
870
+ typeof e == "object" && !!e && /* @__PURE__ */ T(mt, { why: e.problem })
719
871
  ]
720
872
  })
721
873
  });
722
874
  }
723
875
  // src/ui/context-menu.tsx
724
- var ot = "relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", st = "z-50 min-w-48 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lg", ct = A.Root, lt = A.Trigger;
725
- function ut({ className: e, ...t }) {
726
- return /* @__PURE__ */ w(A.Portal, { children: /* @__PURE__ */ w(A.Content, {
876
+ var _t = "relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", vt = "f-office-docs-portal z-50 min-w-48 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lg", yt = M.Root, bt = M.Trigger;
877
+ function xt({ className: e, ...t }) {
878
+ let n = K();
879
+ return /* @__PURE__ */ T(M.Portal, { children: /* @__PURE__ */ T(M.Content, {
727
880
  "data-slot": "context-menu-content",
728
- className: J(st, e),
881
+ "data-f-office-theme": n,
882
+ className: G(vt, e),
729
883
  ...t
730
884
  }) });
731
885
  }
732
- function dt({ className: e, ...t }) {
733
- return /* @__PURE__ */ w(A.Item, {
886
+ function St({ className: e, ...t }) {
887
+ return /* @__PURE__ */ T(M.Item, {
734
888
  "data-slot": "context-menu-item",
735
- className: J(ot, e),
889
+ className: G(_t, e),
736
890
  ...t
737
891
  });
738
892
  }
739
- function ft({ className: e, ...t }) {
740
- return /* @__PURE__ */ w(A.Separator, {
893
+ function Ct({ className: e, ...t }) {
894
+ return /* @__PURE__ */ T(M.Separator, {
741
895
  "data-slot": "context-menu-separator",
742
- className: J("-mx-1 my-1 h-px bg-border", e),
896
+ className: G("-mx-1 my-1 h-px bg-border", e),
743
897
  ...t
744
898
  });
745
899
  }
746
900
  // src/ui/menu-shortcut.tsx
747
- function pt({ className: e, ...t }) {
748
- return /* @__PURE__ */ w("span", {
901
+ function wt({ className: e, ...t }) {
902
+ return /* @__PURE__ */ T("span", {
749
903
  "data-slot": "menu-shortcut",
750
904
  "aria-hidden": "true",
751
- className: J("ml-auto pl-6 text-xs tracking-widest text-muted-foreground", e),
905
+ className: G("ml-auto pl-6 text-xs tracking-widest text-muted-foreground", e),
752
906
  ...t
753
907
  });
754
908
  }
755
909
  // src/page-menu.tsx
756
- function mt(t, n, i) {
910
+ function Tt(t, n, i) {
757
911
  let o = a(navigator.userAgent), s = l(t, o)[0];
758
912
  return {
759
913
  name: e[t].name,
@@ -763,7 +917,7 @@ function mt(t, n, i) {
763
917
  run: i
764
918
  };
765
919
  }
766
- function ht(e) {
920
+ function Et(e) {
767
921
  let t = e?.link ?? null, n = t && o(t), r = [];
768
922
  return t && r.push({
769
923
  name: "Open link",
@@ -784,17 +938,17 @@ function ht(e) {
784
938
  }), [
785
939
  ...r,
786
940
  ...t ? [null] : [],
787
- mt("copy", !e?.selected, (e) => {
941
+ Tt("copy", !e?.selected, (e) => {
788
942
  e.copyText(null);
789
943
  }),
790
- mt("select-all", !1, (e) => {
944
+ Tt("select-all", !1, (e) => {
791
945
  e.selectAll();
792
946
  })
793
947
  ];
794
948
  }
795
- function gt({ request: e, elementRef: t }) {
796
- let n = b(null), r = b(null), i = b(null);
797
- return _(() => {
949
+ function Dt({ request: e, elementRef: t }) {
950
+ let n = y(null), r = y(null), i = y(null);
951
+ return g(() => {
798
952
  if (e) {
799
953
  let r = t.current?.shadowRoot?.activeElement ?? null;
800
954
  i.current = r instanceof HTMLElement && u(r) ? r : null, n.current?.dispatchEvent(new MouseEvent("contextmenu", {
@@ -804,10 +958,10 @@ function gt({ request: e, elementRef: t }) {
804
958
  clientY: e.y
805
959
  }));
806
960
  }
807
- }, [e, t]), /* @__PURE__ */ T(ct, { children: [/* @__PURE__ */ w(lt, {
961
+ }, [e, t]), /* @__PURE__ */ E(yt, { children: [/* @__PURE__ */ T(bt, {
808
962
  ref: n,
809
963
  className: "hidden"
810
- }), /* @__PURE__ */ w(ut, {
964
+ }), /* @__PURE__ */ T(xt, {
811
965
  "aria-label": "Page",
812
966
  onContextMenu: (e) => {
813
967
  e.preventDefault();
@@ -819,37 +973,37 @@ function gt({ request: e, elementRef: t }) {
819
973
  let o = i.current;
820
974
  i.current = null, o?.isConnected ? o.focus() : n?.focus(), n && a?.(n);
821
975
  },
822
- children: ht(e).map((e) => e === null ? /* @__PURE__ */ w(ft, {}, "separator") : /* @__PURE__ */ T(dt, {
976
+ children: Et(e).map((e) => e === null ? /* @__PURE__ */ T(Ct, {}, "separator") : /* @__PURE__ */ E(St, {
823
977
  disabled: e.disabled,
824
978
  "aria-keyshortcuts": e.aria,
825
979
  onSelect: () => {
826
980
  r.current = e.run;
827
981
  },
828
- children: [e.name, e.key !== void 0 && /* @__PURE__ */ w(pt, { children: e.key })]
982
+ children: [e.name, e.key !== void 0 && /* @__PURE__ */ T(wt, { children: e.key })]
829
983
  }, e.name))
830
984
  })] });
831
985
  }
832
986
  // src/start.tsx
833
- function _t() {
834
- let { calls: e } = Z();
835
- return /* @__PURE__ */ T("div", {
987
+ function Ot() {
988
+ let { calls: e } = X();
989
+ return /* @__PURE__ */ E("div", {
836
990
  className: "flex h-full flex-col items-center justify-center gap-10 overflow-auto p-6",
837
- children: [/* @__PURE__ */ w(et, { className: "h-10 w-auto sm:h-14" }), /* @__PURE__ */ T("button", {
991
+ children: [/* @__PURE__ */ T(dt, { className: "h-10 w-auto sm:h-14" }), /* @__PURE__ */ E("button", {
838
992
  type: "button",
839
- className: "flex w-full max-w-xl flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-border bg-[var(--drop)] px-6 py-14 text-center hover:border-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
993
+ className: "flex w-full max-w-xl flex-col items-center gap-3 rounded-2xl border-2 border-dashed border-border bg-[var(--f-office-drop)] px-6 py-14 text-center hover:border-primary focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring",
840
994
  onClick: () => {
841
995
  e.run("open");
842
996
  },
843
997
  children: [
844
- /* @__PURE__ */ w(ge, {
998
+ /* @__PURE__ */ T(O, {
845
999
  className: "size-10 text-primary",
846
1000
  "aria-hidden": "true"
847
1001
  }),
848
- /* @__PURE__ */ w("span", {
1002
+ /* @__PURE__ */ T("span", {
849
1003
  className: "text-lg font-medium",
850
1004
  children: "Open a DOCX file or drop it here"
851
1005
  }),
852
- /* @__PURE__ */ w("span", {
1006
+ /* @__PURE__ */ T("span", {
853
1007
  className: "text-sm text-muted-foreground",
854
1008
  children: "The file stays in this browser."
855
1009
  })
@@ -858,41 +1012,314 @@ function _t() {
858
1012
  });
859
1013
  }
860
1014
  // src/docs-canvas.tsx
861
- function vt({ emptyState: e, className: t }) {
862
- let { elementRef: n } = Z(), { file: r, dragging: i, generation: a, menu: o, moduleUrls: s, attachElement: c } = Je();
863
- return /* @__PURE__ */ T("main", {
864
- className: J("relative min-h-0 flex-1", t),
1015
+ function kt({ emptyState: e, className: t }) {
1016
+ let { state: n, elementRef: r } = X(), { file: i, dragging: a, generation: o, menu: s, moduleUrls: c, attachElement: l } = at(), u = n.progress, d = u?.fraction !== null && u?.fraction !== void 0 ? Math.max(4, Math.min(100, Math.round(u.fraction * 100))) : null;
1017
+ return /* @__PURE__ */ E("main", {
1018
+ className: G("relative min-h-0 flex-1", t),
865
1019
  children: [
866
- /* @__PURE__ */ w("div", {
867
- className: r === null ? "hidden" : "f-office-docs-holder h-full",
868
- children: /* @__PURE__ */ w("f-office-docs", {
869
- ref: c,
1020
+ i !== null && u !== null && !u.complete && /* @__PURE__ */ T("div", {
1021
+ role: "progressbar",
1022
+ "aria-label": "Document loading progress",
1023
+ "aria-valuemin": 0,
1024
+ "aria-valuemax": 100,
1025
+ "aria-valuenow": d ?? void 0,
1026
+ className: "pointer-events-none absolute inset-x-0 top-0 z-10 h-0.5 overflow-hidden bg-border",
1027
+ children: /* @__PURE__ */ T("div", {
1028
+ className: G("h-full bg-primary transition-[width] duration-150 ease-out", d === null && "w-1/3 animate-pulse"),
1029
+ style: d === null ? void 0 : { width: `${String(d)}%` }
1030
+ })
1031
+ }),
1032
+ /* @__PURE__ */ T("div", {
1033
+ className: i === null ? "hidden" : "f-office-docs-holder h-full",
1034
+ children: /* @__PURE__ */ T("f-office-docs", {
1035
+ ref: l,
870
1036
  chrome: "none",
1037
+ "outline-button": "true",
871
1038
  className: "h-full",
872
- ...s?.module ? { module: s.module } : {},
873
- ...s?.wasm ? { wasm: s.wasm } : {},
874
- ...s?.dictionaries ? { dictionaries: s.dictionaries } : {}
875
- }, a)
1039
+ ...c?.module ? { module: c.module } : {},
1040
+ ...c?.wasm ? { wasm: c.wasm } : {},
1041
+ ...c?.dictionaries ? { dictionaries: c.dictionaries } : {}
1042
+ }, o)
876
1043
  }),
877
- /* @__PURE__ */ w(gt, {
878
- request: o,
879
- elementRef: n
1044
+ /* @__PURE__ */ T(Dt, {
1045
+ request: s,
1046
+ elementRef: r
880
1047
  }),
881
- r === null && (e ?? /* @__PURE__ */ w(_t, {})),
882
- i && /* @__PURE__ */ w("div", {
1048
+ i === null && (e ?? /* @__PURE__ */ T(Ot, {})),
1049
+ a && /* @__PURE__ */ T("div", {
883
1050
  className: "pointer-events-none absolute inset-0 grid place-items-center bg-background/85 text-lg font-medium",
884
1051
  children: "Drop the file to open it"
885
1052
  })
886
1053
  ]
887
1054
  });
888
1055
  }
1056
+ // src/ui/popover.tsx
1057
+ var At = F.Root, jt = F.Trigger, Mt = F.Close;
1058
+ function Nt({ className: e, align: t = "start", sideOffset: n = 6, children: r, ...i }) {
1059
+ let a = K();
1060
+ return /* @__PURE__ */ T(F.Portal, { children: /* @__PURE__ */ T(F.Content, {
1061
+ "data-slot": "popover-content",
1062
+ "data-f-office-theme": a,
1063
+ align: t,
1064
+ sideOffset: n,
1065
+ className: G("f-office-docs-portal z-50 w-[min(28rem,calc(100vw-2rem))] rounded-xl border border-border bg-popover p-4 text-popover-foreground shadow-xl outline-none", e),
1066
+ ...i,
1067
+ children: r
1068
+ }) });
1069
+ }
1070
+ // src/fidelity.tsx
1071
+ var Pt = {
1072
+ native: "Native",
1073
+ "exact-stand-in": "Exact layout",
1074
+ "other-version": "Other version",
1075
+ widths: "Width-matched",
1076
+ fallback: "Fallback",
1077
+ missing: "Missing"
1078
+ }, Ft = {
1079
+ native: "text-fidelity-exact-fg bg-fidelity-exact-bg",
1080
+ "exact-stand-in": "text-fidelity-exact-fg bg-fidelity-exact-bg",
1081
+ "other-version": "text-fidelity-approx-fg bg-fidelity-approx-bg",
1082
+ widths: "text-fidelity-approx-fg bg-fidelity-approx-bg",
1083
+ fallback: "text-fidelity-approx-fg bg-fidelity-approx-bg",
1084
+ missing: "text-fidelity-degraded-fg bg-fidelity-degraded-bg"
1085
+ }, It = {
1086
+ approximate: "border-fidelity-approx-border bg-fidelity-approx-bg text-fidelity-approx-fg",
1087
+ degraded: "border-fidelity-degraded-border bg-fidelity-degraded-bg text-fidelity-degraded-fg"
1088
+ }, Lt = {
1089
+ approximate: "border-fidelity-approx-border bg-fidelity-approx-bg text-fidelity-approx-fg",
1090
+ degraded: "border-fidelity-degraded-border bg-fidelity-degraded-bg text-fidelity-degraded-fg"
1091
+ };
1092
+ function Rt(e) {
1093
+ return e.matchKind === "fallback" || e.matchKind === "widths" || e.matchKind === "other-version";
1094
+ }
1095
+ function zt(e, t, n) {
1096
+ return `${String(e)} ${e === 1 ? t : n}`;
1097
+ }
1098
+ function Bt(e) {
1099
+ if (e.level === "exact") return "All fonts matched";
1100
+ if (e.level === "approximate") {
1101
+ let t = e.fonts.filter((e) => e.matchKind === "fallback");
1102
+ if (t.length > 0) return zt(t.length, "fallback font", "fallback fonts");
1103
+ let n = e.fonts.filter(Rt);
1104
+ return n.length > 0 ? zt(n.length, "substituted font", "substituted fonts") : "Approximate layout";
1105
+ }
1106
+ let t = e.fonts.filter((e) => e.matchKind === "missing").length, n = e.omissions.filter((e) => e.degraded).length;
1107
+ if (t === 0 && n === 0 && e.missingGlyphs.length > 0) return "Missing glyphs";
1108
+ let r = t + e.missingGlyphs.length + e.omissions.filter((e) => e.degraded).reduce((e, t) => e + t.count, 0);
1109
+ return zt(Math.max(1, r), "render issue", "render issues");
1110
+ }
1111
+ function Vt(e) {
1112
+ if (e.level === "approximate") {
1113
+ let t = e.fonts.filter(Rt);
1114
+ if (t.length === 1) {
1115
+ let e = t[0];
1116
+ if (e) return `${e.asked ?? "Document font"} rendered with ${e.used ?? "a fallback font"} — line breaks may differ.`;
1117
+ }
1118
+ if (t.length > 1) {
1119
+ let e = t.slice(0, 2).map((e) => e.asked ?? "Document font").join(", "), n = t.length - 2;
1120
+ return `${n > 0 ? `${e} and ${String(n)} more` : e} rendered with fallback fonts — line breaks may differ.`;
1121
+ }
1122
+ return "Some document styles were approximated — layout may differ slightly.";
1123
+ }
1124
+ let t = [], n = e.fonts.filter((e) => e.matchKind === "missing");
1125
+ if (n.length > 0) {
1126
+ let e = n[0]?.asked ?? "default font";
1127
+ t.push(n.length === 1 ? `missing font (${e})` : `${String(n.length)} missing fonts`);
1128
+ }
1129
+ let r = e.missingGlyphs.reduce((e, t) => e + t.count, 0);
1130
+ r > 0 && t.push(`${zt(r, "character", "characters")} could not be drawn`);
1131
+ let i = e.omissions.find((e) => e.degraded);
1132
+ return i && t.push(`${i.label.toLowerCase()} (${String(i.count)})`), t.length > 0 ? `Document rendered with issues: ${t.join(", ")}.` : "Some document content could not be rendered faithfully.";
1133
+ }
1134
+ function Ht({ level: e, className: t }) {
1135
+ return T(e === "approximate" ? he : me, {
1136
+ className: t,
1137
+ "aria-hidden": "true"
1138
+ });
1139
+ }
1140
+ function Ut({ className: e }) {
1141
+ let { state: t, fidelityOpen: n, setFidelityOpen: r } = X(), i = t.fidelity;
1142
+ if (t.name === null || i === null) return null;
1143
+ let a = Bt(i);
1144
+ return /* @__PURE__ */ E(At, {
1145
+ open: n,
1146
+ onOpenChange: r,
1147
+ children: [/* @__PURE__ */ T(jt, {
1148
+ asChild: !0,
1149
+ children: i.level === "exact" ? /* @__PURE__ */ T("button", {
1150
+ type: "button",
1151
+ "data-fidelity-level": "exact",
1152
+ className: G("inline-flex size-6 shrink-0 items-center justify-center rounded-full text-muted-foreground transition-colors hover:bg-accent hover:text-foreground focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", e),
1153
+ "aria-label": `Document fidelity: ${a}`,
1154
+ title: "All fonts matched — click for details",
1155
+ children: /* @__PURE__ */ T(D, {
1156
+ className: "size-4",
1157
+ "aria-hidden": "true"
1158
+ })
1159
+ }) : /* @__PURE__ */ E("button", {
1160
+ type: "button",
1161
+ "data-fidelity-level": i.level,
1162
+ className: G("inline-flex h-6 shrink-0 items-center gap-1.5 rounded-full border px-2.5 text-xs font-medium transition-opacity hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring", It[i.level], e),
1163
+ "aria-label": `Document fidelity: ${a}`,
1164
+ children: [/* @__PURE__ */ T(Ht, {
1165
+ level: i.level,
1166
+ className: "size-3.5 shrink-0"
1167
+ }), /* @__PURE__ */ T("span", { children: a })]
1168
+ })
1169
+ }), /* @__PURE__ */ E(Nt, {
1170
+ "aria-label": "Document Fidelity",
1171
+ children: [/* @__PURE__ */ E("div", {
1172
+ className: "mb-3 flex items-start justify-between gap-2",
1173
+ children: [/* @__PURE__ */ E("div", { children: [/* @__PURE__ */ T("h2", {
1174
+ className: "text-sm font-semibold",
1175
+ children: "Document Fidelity"
1176
+ }), /* @__PURE__ */ T("p", {
1177
+ className: "mt-0.5 text-xs text-muted-foreground",
1178
+ children: i.level === "exact" ? "All document fonts matched natively or with exact metric stand-ins." : Vt(i)
1179
+ })] }), /* @__PURE__ */ T(Mt, {
1180
+ className: "rounded-full p-1 text-muted-foreground hover:bg-accent",
1181
+ "aria-label": "Close document fidelity",
1182
+ children: /* @__PURE__ */ T(j, { className: "size-4" })
1183
+ })]
1184
+ }), /* @__PURE__ */ E("div", {
1185
+ className: "space-y-4",
1186
+ children: [
1187
+ /* @__PURE__ */ E("section", {
1188
+ "aria-label": "Fonts",
1189
+ children: [/* @__PURE__ */ T("h3", {
1190
+ className: "mb-1.5 text-xs font-medium tracking-wide text-muted-foreground uppercase",
1191
+ children: "Fonts"
1192
+ }), i.fonts.length === 0 ? /* @__PURE__ */ T("p", {
1193
+ className: "text-xs text-muted-foreground",
1194
+ children: "No font requests recorded."
1195
+ }) : /* @__PURE__ */ T("div", {
1196
+ className: "max-h-56 overflow-auto rounded-lg border border-border",
1197
+ children: /* @__PURE__ */ E("table", {
1198
+ className: "w-full border-collapse text-left text-xs",
1199
+ children: [/* @__PURE__ */ T("thead", {
1200
+ className: "bg-muted/60 text-muted-foreground",
1201
+ children: /* @__PURE__ */ E("tr", { children: [
1202
+ /* @__PURE__ */ T("th", {
1203
+ className: "px-2.5 py-1.5 font-medium",
1204
+ children: "Document font"
1205
+ }),
1206
+ /* @__PURE__ */ T("th", {
1207
+ className: "px-2.5 py-1.5 font-medium",
1208
+ children: "Rendered with"
1209
+ }),
1210
+ /* @__PURE__ */ T("th", {
1211
+ className: "px-2.5 py-1.5 font-medium",
1212
+ children: "Match"
1213
+ })
1214
+ ] })
1215
+ }), /* @__PURE__ */ T("tbody", { children: i.fonts.map((e, t) => /* @__PURE__ */ E("tr", {
1216
+ className: "border-t border-border",
1217
+ children: [
1218
+ /* @__PURE__ */ T("td", {
1219
+ className: "px-2.5 py-1.5 font-medium",
1220
+ children: e.asked ?? "Default font"
1221
+ }),
1222
+ /* @__PURE__ */ T("td", {
1223
+ className: "px-2.5 py-1.5 text-muted-foreground",
1224
+ children: e.used ?? "—"
1225
+ }),
1226
+ /* @__PURE__ */ T("td", {
1227
+ className: "px-2.5 py-1.5",
1228
+ children: /* @__PURE__ */ T("span", {
1229
+ className: G("inline-block rounded-full px-2 py-0.5 text-[11px] font-medium whitespace-nowrap", Ft[e.matchKind]),
1230
+ children: Pt[e.matchKind]
1231
+ })
1232
+ })
1233
+ ]
1234
+ }, `${e.asked ?? "default"}-${e.used ?? "none"}-${e.matchKind}-${String(t)}`)) })]
1235
+ })
1236
+ })]
1237
+ }),
1238
+ i.missingGlyphs.length > 0 && /* @__PURE__ */ E("section", {
1239
+ "aria-label": "Missing characters",
1240
+ children: [/* @__PURE__ */ T("h3", {
1241
+ className: "mb-1.5 text-xs font-medium tracking-wide text-muted-foreground uppercase",
1242
+ children: "Missing characters"
1243
+ }), /* @__PURE__ */ T("ul", {
1244
+ className: "space-y-1 text-xs",
1245
+ children: i.missingGlyphs.map((e) => /* @__PURE__ */ E("li", {
1246
+ className: "flex items-center justify-between gap-2 rounded-md border border-border px-2.5 py-1.5",
1247
+ children: [/* @__PURE__ */ E("span", { children: [/* @__PURE__ */ T("span", {
1248
+ className: "font-medium",
1249
+ children: e.font ?? "Unknown font"
1250
+ }), /* @__PURE__ */ E("span", {
1251
+ className: "text-muted-foreground",
1252
+ children: [" · ", e.blockLabel]
1253
+ })] }), /* @__PURE__ */ E("span", {
1254
+ className: "shrink-0 font-medium text-fidelity-degraded-fg",
1255
+ children: [e.count, " missing"]
1256
+ })]
1257
+ }, `${e.font ?? "unknown"}-${e.block}`))
1258
+ })]
1259
+ }),
1260
+ i.omissions.length > 0 && /* @__PURE__ */ E("section", {
1261
+ "aria-label": "Other render notes",
1262
+ children: [/* @__PURE__ */ T("h3", {
1263
+ className: "mb-1.5 text-xs font-medium tracking-wide text-muted-foreground uppercase",
1264
+ children: "Other render notes"
1265
+ }), /* @__PURE__ */ T("ul", {
1266
+ className: "space-y-1 text-xs",
1267
+ children: i.omissions.map((e) => /* @__PURE__ */ E("li", {
1268
+ className: "flex items-center justify-between gap-2 rounded-md border border-border px-2.5 py-1.5",
1269
+ children: [/* @__PURE__ */ T("span", { children: e.label }), /* @__PURE__ */ T("span", {
1270
+ className: "shrink-0 font-medium text-muted-foreground",
1271
+ children: e.count
1272
+ })]
1273
+ }, e.kind))
1274
+ })]
1275
+ })
1276
+ ]
1277
+ })]
1278
+ })]
1279
+ });
1280
+ }
1281
+ function Wt({ className: e }) {
1282
+ let { state: t, fidelityBannerDismissed: n, dismissFidelityBanner: r, setFidelityOpen: i } = X(), a = t.fidelity;
1283
+ if (t.name === null || a === null || a.level === "exact" || n) return null;
1284
+ let o = a.level === "approximate" ? "View fonts" : "Details";
1285
+ return /* @__PURE__ */ E("div", {
1286
+ role: "status",
1287
+ "data-fidelity-banner": a.level,
1288
+ className: G("flex shrink-0 items-center justify-between gap-3 border-y px-3 py-1.5 text-xs sm:px-4", Lt[a.level], e),
1289
+ children: [/* @__PURE__ */ E("div", {
1290
+ className: "flex min-w-0 items-center gap-2",
1291
+ children: [/* @__PURE__ */ T(Ht, {
1292
+ level: a.level,
1293
+ className: "size-3.5 shrink-0"
1294
+ }), /* @__PURE__ */ T("p", {
1295
+ className: "truncate",
1296
+ children: Vt(a)
1297
+ })]
1298
+ }), /* @__PURE__ */ E("div", {
1299
+ className: "flex shrink-0 items-center gap-2",
1300
+ children: [/* @__PURE__ */ T("button", {
1301
+ type: "button",
1302
+ className: "rounded-md px-2 py-0.5 font-medium underline underline-offset-2 hover:opacity-80 focus-visible:outline-2 focus-visible:outline-ring",
1303
+ onClick: () => {
1304
+ i(!0);
1305
+ },
1306
+ children: o
1307
+ }), /* @__PURE__ */ T("button", {
1308
+ type: "button",
1309
+ className: "rounded-md px-2 py-0.5 font-medium hover:opacity-80 focus-visible:outline-2 focus-visible:outline-ring",
1310
+ onClick: r,
1311
+ children: "Dismiss"
1312
+ })]
1313
+ })]
1314
+ });
1315
+ }
889
1316
  // src/assets/mark.svg
890
- var yt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='-256%20-256%20512%20512'%20width='512'%20height='512'%3e%3ctitle%3eF-Office%20mark%3c/title%3e%3cdefs%3e%3c!--%20One%20puzzle%20piece%20(the%20top-left%20one),%20origin%20at%20the%20puzzle%20center.%20The%20other%20three%20pieces%20are%20this%20outline%20rotated%20by%2090,%20180,%20270.%20--%3e%3cpath%20id='piece'%20d='M-134%20-256%20H-3%20A2.5%202.5%200%200%201%20-0.5%20-253.5%20V-185.97%20A17.5%2017.5%200%200%200%2022.45%20-169.34%20A43.5%2043.5%200%201%201%2022.45%20-86.66%20A17.5%2017.5%200%200%200%20-0.5%20-70.03%20V-0.5%20H-70.03%20A16.5%2016.5%200%200%201%20-85.71%20-22.14%20A44.5%2044.5%200%201%200%20-170.29%20-22.14%20A16.5%2016.5%200%200%201%20-185.97%20-0.5%20H-253.5%20A2.5%202.5%200%200%201%20-256%20-3%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20The%20whole%20puzzle%20square:%20drawn%20in%20the%20seam%20color%20under%20the%20pieces,%20and%20used%20to%20keep%20the%20edge%20shading%20inside%20the%20puzzle.%20--%3e%3cpath%20id='plate'%20d='M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3cclipPath%20id='plate-clip'%3e%3cuse%20xlink:href='%23plate'/%3e%3c/clipPath%3e%3cpath%20id='outside'%20fill-rule='evenodd'%20d='M-320%20-320%20H320%20V320%20H-320%20Z%20M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20Piece%20fills:%20light%20at%20the%20top%20left%20of%20every%20piece,%20so%20each%20gradient%20is%20turned%20back%20by%20the%20rotation%20of%20its%20piece.%20--%3e%3clinearGradient%20id='fill-purple'%20x1='-170.31'%20y1='-254.74'%20x2='-1.36'%20y2='5.42'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23D697FF'/%3e%3cstop%20offset='0.5'%20stop-color='%237E5AF4'/%3e%3cstop%20offset='1'%20stop-color='%234137C8'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-pink'%20x1='40.82'%20y1='-222.24'%20x2='219.77'%20y2='53.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-90)'%3e%3cstop%20offset='0'%20stop-color='%23FFB0D8'/%3e%3cstop%20offset='0.5'%20stop-color='%23FB5D99'/%3e%3cstop%20offset='1'%20stop-color='%23C71878'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-cyan'%20x1='5.69'%20y1='1.26'%20x2='174.64'%20y2='261.42'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-180)'%3e%3cstop%20offset='0'%20stop-color='%238EF1FC'/%3e%3cstop%20offset='0.5'%20stop-color='%2300CEE7'/%3e%3cstop%20offset='1'%20stop-color='%23009DB7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-orange'%20x1='-215.18'%20y1='-46.24'%20x2='-36.23'%20y2='229.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-270)'%3e%3cstop%20offset='0'%20stop-color='%23FCDD64'/%3e%3cstop%20offset='0.5'%20stop-color='%23FF9525'/%3e%3cstop%20offset='1'%20stop-color='%23F57B20'/%3e%3c/linearGradient%3e%3c!--%20Edge%20shading%20of%20the%20pieces.%20'shade':%20a%20crisp%20dark%20rim%20inside%20the%20edges%20that%20face%20down%20and%20right,%20a%20soft%20band%20behind%20it,%20and%20a%20tight%20shadow%20cast%20onto%20the%20neighbors.%20'light':%20a%20crisp%20light%20rim%20inside%20the%20edges%20that%20face%20up%20and%20left,%20and%20a%20soft%20band%20behind%20it;%20the%20outside%20of%20the%20puzzle%20counts%20as%20filled%20there,%20so%20only%20the%20seams%20get%20it.%20--%3e%3cfilter%20id='shade'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='-1'%20dy='-1'%20result='up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='up'%20operator='out'%20result='dark-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='2'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='-5'%20dy='-5'%20result='soft-up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-up'%20operator='out'%20result='dark-band'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='0.7'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dx='0.8'%20dy='1.2'%20result='tight-off'/%3e%3cfeComposite%20in='tight-off'%20in2='SourceAlpha'%20operator='out'%20result='cast'/%3e%3cfeFlood%20flood-color='%23120C3A'%20flood-opacity='0.15'/%3e%3cfeComposite%20in2='cast'%20operator='in'%20result='cast-shadow'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.1'/%3e%3cfeComposite%20in2='dark-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.4'/%3e%3cfeComposite%20in2='dark-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='cast-shadow'/%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3cfilter%20id='light'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='1'%20dy='1'%20result='down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='down'%20operator='out'%20result='light-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='1.5'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='4'%20dy='4'%20result='soft-down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-down'%20operator='out'%20result='light-band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.38'/%3e%3cfeComposite%20in2='light-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.45'/%3e%3cfeComposite%20in2='light-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3c!--%20Colored%20glow%20and%20contact%20shadow%20under%20the%20pieces%20--%3e%3cfilter%20id='glow'%20x='-40%25'%20y='-40%25'%20width='180%25'%20height='180%25'%20color-interpolation-filters='sRGB'%3e%3cfeGaussianBlur%20in='SourceGraphic'%20stdDeviation='34'%20result='wide'/%3e%3cfeOffset%20in='wide'%20dy='16'%20result='wide-off'/%3e%3cfeComponentTransfer%20in='wide-off'%20result='color-glow'%3e%3cfeFuncA%20type='linear'%20slope='0.5'/%3e%3c/feComponentTransfer%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='9'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dy='10'%20result='tight-off'/%3e%3cfeFlood%20flood-color='%23202848'%20flood-opacity='0.07'/%3e%3cfeComposite%20in2='tight-off'%20operator='in'%20result='contact'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='color-glow'/%3e%3cfeMergeNode%20in='contact'/%3e%3c/feMerge%3e%3c/filter%3e%3c/defs%3e%3cg%20id='puzzle'%3e%3cg%20id='puzzle-glow'%20filter='url(%23glow)'%20clip-path='url(%23plate-clip)'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='pieces'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='edge-shade'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3c/g%3e%3c/g%3e%3cg%20id='edge-light'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
1317
+ var Gt = "data:image/svg+xml,%3csvg%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%20viewBox='-256%20-256%20512%20512'%20width='512'%20height='512'%3e%3ctitle%3eF-Office%20mark%3c/title%3e%3cdefs%3e%3c!--%20One%20puzzle%20piece%20(the%20top-left%20one),%20origin%20at%20the%20puzzle%20center.%20The%20other%20three%20pieces%20are%20this%20outline%20rotated%20by%2090,%20180,%20270.%20--%3e%3cpath%20id='piece'%20d='M-134%20-256%20H-3%20A2.5%202.5%200%200%201%20-0.5%20-253.5%20V-185.97%20A17.5%2017.5%200%200%200%2022.45%20-169.34%20A43.5%2043.5%200%201%201%2022.45%20-86.66%20A17.5%2017.5%200%200%200%20-0.5%20-70.03%20V-0.5%20H-70.03%20A16.5%2016.5%200%200%201%20-85.71%20-22.14%20A44.5%2044.5%200%201%200%20-170.29%20-22.14%20A16.5%2016.5%200%200%201%20-185.97%20-0.5%20H-253.5%20A2.5%202.5%200%200%201%20-256%20-3%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20The%20whole%20puzzle%20square:%20drawn%20in%20the%20seam%20color%20under%20the%20pieces,%20and%20used%20to%20keep%20the%20edge%20shading%20inside%20the%20puzzle.%20--%3e%3cpath%20id='plate'%20d='M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3cclipPath%20id='plate-clip'%3e%3cuse%20xlink:href='%23plate'/%3e%3c/clipPath%3e%3cpath%20id='outside'%20fill-rule='evenodd'%20d='M-320%20-320%20H320%20V320%20H-320%20Z%20M-134%20-256%20H134%20C158%20-256%20194%20-256%20225%20-225%20C256%20-194%20256%20-158%20256%20-134%20V134%20C256%20158%20256%20194%20225%20225%20C194%20256%20158%20256%20134%20256%20H-134%20C-158%20256%20-194%20256%20-225%20225%20C-256%20194%20-256%20158%20-256%20134%20V-134%20C-256%20-158%20-256%20-194%20-225%20-225%20C-194%20-256%20-158%20-256%20-134%20-256%20Z'/%3e%3c!--%20Piece%20fills:%20light%20at%20the%20top%20left%20of%20every%20piece,%20so%20each%20gradient%20is%20turned%20back%20by%20the%20rotation%20of%20its%20piece.%20--%3e%3clinearGradient%20id='fill-purple'%20x1='-170.31'%20y1='-254.74'%20x2='-1.36'%20y2='5.42'%20gradientUnits='userSpaceOnUse'%3e%3cstop%20offset='0'%20stop-color='%23D697FF'/%3e%3cstop%20offset='0.5'%20stop-color='%237E5AF4'/%3e%3cstop%20offset='1'%20stop-color='%234137C8'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-pink'%20x1='40.82'%20y1='-222.24'%20x2='219.77'%20y2='53.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-90)'%3e%3cstop%20offset='0'%20stop-color='%23FFB0D8'/%3e%3cstop%20offset='0.5'%20stop-color='%23FB5D99'/%3e%3cstop%20offset='1'%20stop-color='%23C71878'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-cyan'%20x1='5.69'%20y1='1.26'%20x2='174.64'%20y2='261.42'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-180)'%3e%3cstop%20offset='0'%20stop-color='%238EF1FC'/%3e%3cstop%20offset='0.5'%20stop-color='%2300CEE7'/%3e%3cstop%20offset='1'%20stop-color='%23009DB7'/%3e%3c/linearGradient%3e%3clinearGradient%20id='fill-orange'%20x1='-215.18'%20y1='-46.24'%20x2='-36.23'%20y2='229.31'%20gradientUnits='userSpaceOnUse'%20gradientTransform='rotate(-270)'%3e%3cstop%20offset='0'%20stop-color='%23FCDD64'/%3e%3cstop%20offset='0.5'%20stop-color='%23FF9525'/%3e%3cstop%20offset='1'%20stop-color='%23F57B20'/%3e%3c/linearGradient%3e%3c!--%20Edge%20shading%20of%20the%20pieces.%20'shade':%20a%20crisp%20dark%20rim%20inside%20the%20edges%20that%20face%20down%20and%20right,%20a%20soft%20band%20behind%20it,%20and%20a%20tight%20shadow%20cast%20onto%20the%20neighbors.%20'light':%20a%20crisp%20light%20rim%20inside%20the%20edges%20that%20face%20up%20and%20left,%20and%20a%20soft%20band%20behind%20it;%20the%20outside%20of%20the%20puzzle%20counts%20as%20filled%20there,%20so%20only%20the%20seams%20get%20it.%20--%3e%3cfilter%20id='shade'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='-1'%20dy='-1'%20result='up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='up'%20operator='out'%20result='dark-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='2'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='-5'%20dy='-5'%20result='soft-up'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-up'%20operator='out'%20result='dark-band'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='0.7'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dx='0.8'%20dy='1.2'%20result='tight-off'/%3e%3cfeComposite%20in='tight-off'%20in2='SourceAlpha'%20operator='out'%20result='cast'/%3e%3cfeFlood%20flood-color='%23120C3A'%20flood-opacity='0.15'/%3e%3cfeComposite%20in2='cast'%20operator='in'%20result='cast-shadow'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.1'/%3e%3cfeComposite%20in2='dark-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23140A50'%20flood-opacity='0.4'/%3e%3cfeComposite%20in2='dark-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='cast-shadow'/%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3cfilter%20id='light'%20x='-5%25'%20y='-5%25'%20width='110%25'%20height='110%25'%20color-interpolation-filters='sRGB'%3e%3cfeOffset%20in='SourceAlpha'%20dx='1'%20dy='1'%20result='down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='down'%20operator='out'%20result='light-line'/%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='1.5'%20result='soft'/%3e%3cfeOffset%20in='soft'%20dx='4'%20dy='4'%20result='soft-down'/%3e%3cfeComposite%20in='SourceAlpha'%20in2='soft-down'%20operator='out'%20result='light-band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.38'/%3e%3cfeComposite%20in2='light-band'%20operator='in'%20result='band'/%3e%3cfeFlood%20flood-color='%23FFFFFF'%20flood-opacity='0.45'/%3e%3cfeComposite%20in2='light-line'%20operator='in'%20result='line'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='band'/%3e%3cfeMergeNode%20in='line'/%3e%3c/feMerge%3e%3c/filter%3e%3c!--%20Colored%20glow%20and%20contact%20shadow%20under%20the%20pieces%20--%3e%3cfilter%20id='glow'%20x='-40%25'%20y='-40%25'%20width='180%25'%20height='180%25'%20color-interpolation-filters='sRGB'%3e%3cfeGaussianBlur%20in='SourceGraphic'%20stdDeviation='34'%20result='wide'/%3e%3cfeOffset%20in='wide'%20dy='16'%20result='wide-off'/%3e%3cfeComponentTransfer%20in='wide-off'%20result='color-glow'%3e%3cfeFuncA%20type='linear'%20slope='0.5'/%3e%3c/feComponentTransfer%3e%3cfeGaussianBlur%20in='SourceAlpha'%20stdDeviation='9'%20result='tight'/%3e%3cfeOffset%20in='tight'%20dy='10'%20result='tight-off'/%3e%3cfeFlood%20flood-color='%23202848'%20flood-opacity='0.07'/%3e%3cfeComposite%20in2='tight-off'%20operator='in'%20result='contact'/%3e%3cfeMerge%3e%3cfeMergeNode%20in='color-glow'/%3e%3cfeMergeNode%20in='contact'/%3e%3c/feMerge%3e%3c/filter%3e%3c/defs%3e%3cg%20id='puzzle'%3e%3cg%20id='puzzle-glow'%20filter='url(%23glow)'%20clip-path='url(%23plate-clip)'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='pieces'%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-purple)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-pink)'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-cyan)'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23piece'%20fill='url(%23fill-orange)'%20transform='rotate(270)'/%3e%3c/g%3e%3cg%20id='edge-shade'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3c/g%3e%3cg%20filter='url(%23shade)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3c/g%3e%3c/g%3e%3cg%20id='edge-light'%20clip-path='url(%23plate-clip)'%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(90)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(180)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3cg%20filter='url(%23light)'%3e%3cuse%20xlink:href='%23piece'%20transform='rotate(270)'/%3e%3cuse%20xlink:href='%23outside'/%3e%3c/g%3e%3c/g%3e%3c/g%3e%3c/svg%3e";
891
1318
  // src/chrome.ts
892
- function bt(e) {
1319
+ function Kt(e) {
893
1320
  return `${String(Math.round(e * 100))}%`;
894
1321
  }
895
- function xt(e, t) {
1322
+ function qt(e, t) {
896
1323
  let n = [
897
1324
  {
898
1325
  value: "fit-width",
@@ -904,110 +1331,114 @@ function xt(e, t) {
904
1331
  },
905
1332
  ...e.map((e) => ({
906
1333
  value: c(e),
907
- label: bt(e)
1334
+ label: Kt(e)
908
1335
  }))
909
1336
  ];
910
1337
  return t.startsWith("fixed:") && !n.some((e) => e.value === t) && n.push({
911
1338
  value: t,
912
- label: bt(Number(t.slice(6)))
1339
+ label: Kt(Number(t.slice(6)))
913
1340
  }), n;
914
1341
  }
915
1342
  // src/ui/menubar.tsx
916
- var St = "relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", Ct = "z-50 min-w-48 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lg";
917
- function wt(e) {
918
- return /* @__PURE__ */ w(M.Menu, { ...e });
1343
+ var Jt = "relative flex cursor-default select-none items-center gap-2 rounded-md px-2 py-1.5 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50", Yt = "f-office-docs-portal z-50 min-w-48 overflow-hidden rounded-lg border border-border bg-popover p-1 text-popover-foreground shadow-lg";
1344
+ function Xt(e) {
1345
+ return /* @__PURE__ */ T(P.Menu, { ...e });
919
1346
  }
920
- function Tt(e) {
921
- return /* @__PURE__ */ w(M.Sub, { ...e });
1347
+ function Zt(e) {
1348
+ return /* @__PURE__ */ T(P.Sub, { ...e });
922
1349
  }
923
- function Et(e) {
924
- return /* @__PURE__ */ w(M.RadioGroup, { ...e });
1350
+ function Qt(e) {
1351
+ return /* @__PURE__ */ T(P.RadioGroup, { ...e });
925
1352
  }
926
- function Dt({ className: e, ...t }) {
927
- return /* @__PURE__ */ w(M.Root, {
1353
+ function $t({ className: e, ...t }) {
1354
+ return /* @__PURE__ */ T(P.Root, {
928
1355
  "data-slot": "menubar",
929
- className: J("flex items-center gap-0.5", e),
1356
+ className: G("flex items-center gap-0.5", e),
930
1357
  ...t
931
1358
  });
932
1359
  }
933
- function Ot({ className: e, ...t }) {
934
- return /* @__PURE__ */ w(M.Trigger, {
1360
+ function en({ className: e, ...t }) {
1361
+ return /* @__PURE__ */ T(P.Trigger, {
935
1362
  "data-slot": "menubar-trigger",
936
- className: J("rounded px-1.5 py-0.5 text-sm outline-none hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring data-[highlighted]:bg-accent data-[state=open]:bg-accent", e),
1363
+ className: G("rounded px-1.5 py-0.5 text-sm outline-none hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring data-[highlighted]:bg-accent data-[state=open]:bg-accent", e),
937
1364
  ...t
938
1365
  });
939
1366
  }
940
- function kt({ className: e, align: t = "start", sideOffset: n = 4, ...r }) {
941
- return /* @__PURE__ */ w(M.Portal, { children: /* @__PURE__ */ w(M.Content, {
1367
+ function tn({ className: e, align: t = "start", sideOffset: n = 4, ...r }) {
1368
+ let i = K();
1369
+ return /* @__PURE__ */ T(P.Portal, { children: /* @__PURE__ */ T(P.Content, {
942
1370
  "data-slot": "menubar-content",
1371
+ "data-f-office-theme": i,
943
1372
  align: t,
944
1373
  sideOffset: n,
945
- className: J(Ct, e),
1374
+ className: G(Yt, e),
946
1375
  ...r
947
1376
  }) });
948
1377
  }
949
- function At({ className: e, ...t }) {
950
- return /* @__PURE__ */ w(M.Item, {
1378
+ function nn({ className: e, ...t }) {
1379
+ return /* @__PURE__ */ T(P.Item, {
951
1380
  "data-slot": "menubar-item",
952
- className: J(St, e),
1381
+ className: G(Jt, e),
953
1382
  ...t
954
1383
  });
955
1384
  }
956
- function jt({ className: e, children: t, ...n }) {
957
- return /* @__PURE__ */ T(M.CheckboxItem, {
1385
+ function rn({ className: e, children: t, ...n }) {
1386
+ return /* @__PURE__ */ E(P.CheckboxItem, {
958
1387
  "data-slot": "menubar-checkbox-item",
959
- className: J(St, "pl-8", e),
1388
+ className: G(Jt, "pl-8", e),
960
1389
  ...n,
961
- children: [/* @__PURE__ */ w("span", {
1390
+ children: [/* @__PURE__ */ T("span", {
962
1391
  className: "absolute left-2 flex size-4 items-center justify-center",
963
- children: /* @__PURE__ */ w(M.ItemIndicator, { children: /* @__PURE__ */ w(E, { className: "size-4" }) })
1392
+ children: /* @__PURE__ */ T(P.ItemIndicator, { children: /* @__PURE__ */ T(D, { className: "size-4" }) })
964
1393
  }), t]
965
1394
  });
966
1395
  }
967
- function Mt({ className: e, children: t, ...n }) {
968
- return /* @__PURE__ */ T(M.RadioItem, {
1396
+ function an({ className: e, children: t, ...n }) {
1397
+ return /* @__PURE__ */ E(P.RadioItem, {
969
1398
  "data-slot": "menubar-radio-item",
970
- className: J(St, "pl-8", e),
1399
+ className: G(Jt, "pl-8", e),
971
1400
  ...n,
972
- children: [/* @__PURE__ */ w("span", {
1401
+ children: [/* @__PURE__ */ T("span", {
973
1402
  className: "absolute left-2 flex size-4 items-center justify-center",
974
- children: /* @__PURE__ */ w(M.ItemIndicator, { children: /* @__PURE__ */ w(he, { className: "size-2 fill-current" }) })
1403
+ children: /* @__PURE__ */ T(P.ItemIndicator, { children: /* @__PURE__ */ T(_e, { className: "size-2 fill-current" }) })
975
1404
  }), t]
976
1405
  });
977
1406
  }
978
- function Nt({ className: e, children: t, ...n }) {
979
- return /* @__PURE__ */ T(M.SubTrigger, {
1407
+ function on({ className: e, children: t, ...n }) {
1408
+ return /* @__PURE__ */ E(P.SubTrigger, {
980
1409
  "data-slot": "menubar-sub-trigger",
981
- className: J(St, "data-[state=open]:bg-accent", e),
1410
+ className: G(Jt, "data-[state=open]:bg-accent", e),
982
1411
  ...n,
983
- children: [t, /* @__PURE__ */ w(D, { className: "ml-auto size-4" })]
1412
+ children: [t, /* @__PURE__ */ T(ge, { className: "ml-auto size-4" })]
984
1413
  });
985
1414
  }
986
- function Pt({ className: e, ...t }) {
987
- return /* @__PURE__ */ w(M.Portal, { children: /* @__PURE__ */ w(M.SubContent, {
1415
+ function sn({ className: e, ...t }) {
1416
+ let n = K();
1417
+ return /* @__PURE__ */ T(P.Portal, { children: /* @__PURE__ */ T(P.SubContent, {
988
1418
  "data-slot": "menubar-sub-content",
989
- className: J(Ct, "min-w-36", e),
1419
+ "data-f-office-theme": n,
1420
+ className: G(Yt, "min-w-36", e),
990
1421
  ...t
991
1422
  }) });
992
1423
  }
993
- function Ft({ className: e, ...t }) {
994
- return /* @__PURE__ */ w(M.Separator, {
1424
+ function Z({ className: e, ...t }) {
1425
+ return /* @__PURE__ */ T(P.Separator, {
995
1426
  "data-slot": "menubar-separator",
996
- className: J("-mx-1 my-1 h-px bg-border", e),
1427
+ className: G("-mx-1 my-1 h-px bg-border", e),
997
1428
  ...t
998
1429
  });
999
1430
  }
1000
- function It({ className: e, ...t }) {
1001
- return /* @__PURE__ */ w(M.Label, {
1431
+ function cn({ className: e, ...t }) {
1432
+ return /* @__PURE__ */ T(P.Label, {
1002
1433
  "data-slot": "menubar-label",
1003
- className: J("px-2 py-1.5 text-xs text-muted-foreground", e),
1434
+ className: G("px-2 py-1.5 text-xs text-muted-foreground", e),
1004
1435
  ...t
1005
1436
  });
1006
1437
  }
1007
1438
  // src/menus.tsx
1008
1439
  function Q({ id: t, state: n, calls: o, choice: s }) {
1009
1440
  let c = a(navigator.userAgent), u = l(t, c)[0], d = !i(t, n.name !== null, n.selected);
1010
- return /* @__PURE__ */ T(At, {
1441
+ return /* @__PURE__ */ E(nn, {
1011
1442
  disabled: d,
1012
1443
  "aria-keyshortcuts": r(t, c),
1013
1444
  onSelect: () => {
@@ -1015,11 +1446,11 @@ function Q({ id: t, state: n, calls: o, choice: s }) {
1015
1446
  o.run(t);
1016
1447
  });
1017
1448
  },
1018
- children: [e[t].name, u !== void 0 && /* @__PURE__ */ w(pt, { children: u })]
1449
+ children: [e[t].name, u !== void 0 && /* @__PURE__ */ T(wt, { children: u })]
1019
1450
  });
1020
1451
  }
1021
1452
  function $({ title: e, calls: t, choice: n, children: r }) {
1022
- return /* @__PURE__ */ T(wt, { children: [/* @__PURE__ */ w(Ot, { children: e }), /* @__PURE__ */ w(kt, {
1453
+ return /* @__PURE__ */ E(Xt, { children: [/* @__PURE__ */ T(en, { children: e }), /* @__PURE__ */ T(tn, {
1023
1454
  onCloseAutoFocus: (e) => {
1024
1455
  let r = n.take();
1025
1456
  r && (e.preventDefault(), t.focusPages(), r());
@@ -1027,124 +1458,155 @@ function $({ title: e, calls: t, choice: n, children: r }) {
1027
1458
  children: r
1028
1459
  })] });
1029
1460
  }
1030
- function Lt(e) {
1461
+ function ln(e) {
1462
+ return /* @__PURE__ */ E(Zt, { children: [/* @__PURE__ */ T(on, {
1463
+ disabled: e.state.name === null,
1464
+ children: "Export"
1465
+ }), /* @__PURE__ */ E(sn, { children: [
1466
+ /* @__PURE__ */ T(Q, {
1467
+ id: "export-pdf",
1468
+ ...e
1469
+ }),
1470
+ /* @__PURE__ */ T(Q, {
1471
+ id: "export-docx",
1472
+ ...e
1473
+ }),
1474
+ /* @__PURE__ */ T(Q, {
1475
+ id: "export-text",
1476
+ ...e
1477
+ }),
1478
+ /* @__PURE__ */ T(Q, {
1479
+ id: "export-markdown",
1480
+ ...e
1481
+ })
1482
+ ] })] });
1483
+ }
1484
+ function un(e) {
1031
1485
  let { state: t } = e;
1032
- return /* @__PURE__ */ T($, {
1486
+ return /* @__PURE__ */ E($, {
1033
1487
  title: "File",
1034
1488
  calls: e.calls,
1035
1489
  choice: e.choice,
1036
1490
  children: [
1037
- /* @__PURE__ */ w(Q, {
1491
+ /* @__PURE__ */ T(Q, {
1038
1492
  id: "open",
1039
1493
  ...e
1040
1494
  }),
1041
- /* @__PURE__ */ w(Q, {
1042
- id: "download",
1043
- ...e
1044
- }),
1045
- /* @__PURE__ */ w(Q, {
1495
+ /* @__PURE__ */ T(ln, { ...e }),
1496
+ /* @__PURE__ */ T(Q, {
1046
1497
  id: "print",
1047
1498
  ...e
1048
1499
  }),
1049
- /* @__PURE__ */ w(Q, {
1500
+ /* @__PURE__ */ T(Q, {
1050
1501
  id: "close",
1051
1502
  ...e
1052
1503
  }),
1053
- t.note && /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(Ft, {}), /* @__PURE__ */ w(It, {
1504
+ t.note && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(Z, {}), /* @__PURE__ */ T(cn, {
1054
1505
  className: "max-w-64",
1055
1506
  children: t.note
1056
1507
  })] })
1057
1508
  ]
1058
1509
  });
1059
1510
  }
1060
- function Rt(e) {
1061
- return /* @__PURE__ */ T($, {
1511
+ function dn(e) {
1512
+ return /* @__PURE__ */ E($, {
1062
1513
  title: "Edit",
1063
1514
  calls: e.calls,
1064
1515
  choice: e.choice,
1065
1516
  children: [
1066
- /* @__PURE__ */ w(Q, {
1517
+ /* @__PURE__ */ T(Q, {
1067
1518
  id: "copy",
1068
1519
  ...e
1069
1520
  }),
1070
- /* @__PURE__ */ w(Q, {
1521
+ /* @__PURE__ */ T(Q, {
1071
1522
  id: "select-all",
1072
1523
  ...e
1073
1524
  }),
1074
- /* @__PURE__ */ w(Ft, {}),
1075
- /* @__PURE__ */ w(Q, {
1525
+ /* @__PURE__ */ T(Z, {}),
1526
+ /* @__PURE__ */ T(Q, {
1076
1527
  id: "find",
1077
1528
  ...e
1078
1529
  })
1079
1530
  ]
1080
1531
  });
1081
1532
  }
1082
- function zt(e) {
1533
+ function fn(e) {
1083
1534
  let { state: t, calls: n } = e;
1084
- return /* @__PURE__ */ T(Tt, { children: [/* @__PURE__ */ w(Nt, {
1535
+ return /* @__PURE__ */ E(Zt, { children: [/* @__PURE__ */ T(on, {
1085
1536
  disabled: t.name === null,
1086
1537
  children: "Zoom"
1087
- }), /* @__PURE__ */ T(Pt, { children: [
1088
- /* @__PURE__ */ w(Q, {
1538
+ }), /* @__PURE__ */ E(sn, { children: [
1539
+ /* @__PURE__ */ T(Q, {
1089
1540
  id: "zoom-in",
1090
1541
  ...e
1091
1542
  }),
1092
- /* @__PURE__ */ w(Q, {
1543
+ /* @__PURE__ */ T(Q, {
1093
1544
  id: "zoom-out",
1094
1545
  ...e
1095
1546
  }),
1096
- /* @__PURE__ */ w(Q, {
1547
+ /* @__PURE__ */ T(Q, {
1097
1548
  id: "actual-size",
1098
1549
  ...e
1099
1550
  }),
1100
- /* @__PURE__ */ w(Ft, {}),
1101
- /* @__PURE__ */ w(Et, {
1551
+ /* @__PURE__ */ T(Z, {}),
1552
+ /* @__PURE__ */ T(Qt, {
1102
1553
  value: t.zoom,
1103
1554
  onValueChange: (t) => {
1104
1555
  e.choice.choose(() => {
1105
1556
  n.setZoom(t);
1106
1557
  });
1107
1558
  },
1108
- children: xt(t.zoomSteps, t.zoom).map((e) => /* @__PURE__ */ w(Mt, {
1559
+ children: qt(t.zoomSteps, t.zoom).map((e) => /* @__PURE__ */ T(an, {
1109
1560
  value: e.value,
1110
1561
  children: e.label
1111
1562
  }, e.value))
1112
1563
  })
1113
1564
  ] })] });
1114
1565
  }
1115
- var Bt = {
1566
+ var pn = {
1116
1567
  open: "Open fonts",
1117
1568
  installed: "Installed fonts"
1118
1569
  };
1119
- function Vt({ state: e, calls: t, choice: n }) {
1120
- return /* @__PURE__ */ T(Tt, { children: [/* @__PURE__ */ w(Nt, { children: "Fonts" }), /* @__PURE__ */ T(Pt, { children: [/* @__PURE__ */ T(Et, {
1121
- value: e.fonts,
1122
- onValueChange: (e) => {
1123
- n.choose(() => {
1124
- t.setFonts(e);
1125
- });
1126
- },
1127
- children: [/* @__PURE__ */ w(Mt, {
1128
- value: "open",
1129
- children: Bt.open
1130
- }), /* @__PURE__ */ w(Mt, {
1131
- value: "installed",
1132
- disabled: !e.installedFonts,
1133
- children: Bt.installed
1134
- })]
1135
- }), !e.installedFonts && /* @__PURE__ */ T(C, { children: [/* @__PURE__ */ w(Ft, {}), /* @__PURE__ */ w(It, {
1136
- className: "max-w-64 font-normal text-muted-foreground",
1137
- children: d()
1138
- })] })] })] });
1570
+ function mn({ state: e, calls: t, choice: n, onShowFidelity: r }) {
1571
+ return /* @__PURE__ */ E(Zt, { children: [/* @__PURE__ */ T(on, { children: "Fonts" }), /* @__PURE__ */ E(sn, { children: [
1572
+ /* @__PURE__ */ E(Qt, {
1573
+ value: e.fonts,
1574
+ onValueChange: (e) => {
1575
+ n.choose(() => {
1576
+ t.setFonts(e);
1577
+ });
1578
+ },
1579
+ children: [/* @__PURE__ */ T(an, {
1580
+ value: "open",
1581
+ children: pn.open
1582
+ }), /* @__PURE__ */ T(an, {
1583
+ value: "installed",
1584
+ disabled: !e.installedFonts,
1585
+ children: pn.installed
1586
+ })]
1587
+ }),
1588
+ /* @__PURE__ */ T(Z, {}),
1589
+ /* @__PURE__ */ T(nn, {
1590
+ disabled: e.fidelity === null,
1591
+ onSelect: () => {
1592
+ n.choose(r);
1593
+ },
1594
+ children: "Document fonts…"
1595
+ }),
1596
+ !e.installedFonts && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(Z, {}), /* @__PURE__ */ T(cn, {
1597
+ className: "max-w-64 font-normal text-muted-foreground",
1598
+ children: d()
1599
+ })] })
1600
+ ] })] });
1139
1601
  }
1140
- function Ht(e) {
1602
+ function hn(e) {
1141
1603
  let { state: t, calls: n } = e;
1142
- return /* @__PURE__ */ T($, {
1604
+ return /* @__PURE__ */ E($, {
1143
1605
  title: "View",
1144
1606
  calls: n,
1145
1607
  choice: e.choice,
1146
1608
  children: [
1147
- /* @__PURE__ */ w(jt, {
1609
+ /* @__PURE__ */ T(rn, {
1148
1610
  disabled: t.name === null,
1149
1611
  checked: t.outline,
1150
1612
  onCheckedChange: (t) => {
@@ -1154,253 +1616,280 @@ function Ht(e) {
1154
1616
  },
1155
1617
  children: "Outline"
1156
1618
  }),
1157
- /* @__PURE__ */ w(zt, { ...e }),
1158
- /* @__PURE__ */ w(Vt, { ...e }),
1159
- /* @__PURE__ */ T(Tt, { children: [/* @__PURE__ */ w(Nt, { children: "Theme" }), /* @__PURE__ */ w(Pt, { children: /* @__PURE__ */ w(Et, {
1619
+ /* @__PURE__ */ T(fn, { ...e }),
1620
+ /* @__PURE__ */ T(mn, { ...e }),
1621
+ /* @__PURE__ */ E(Zt, { children: [/* @__PURE__ */ T(on, { children: "Theme" }), /* @__PURE__ */ T(sn, { children: /* @__PURE__ */ T(Qt, {
1160
1622
  value: t.theme,
1161
1623
  onValueChange: (t) => {
1162
1624
  e.choice.choose(() => {
1163
1625
  n.setTheme(t);
1164
1626
  });
1165
1627
  },
1166
- children: W.map((e) => /* @__PURE__ */ w(Mt, {
1628
+ children: H.map((e) => /* @__PURE__ */ T(an, {
1167
1629
  value: e,
1168
- children: G[e]
1630
+ children: U[e]
1169
1631
  }, e))
1170
1632
  }) })] })
1171
1633
  ]
1172
1634
  });
1173
1635
  }
1174
- function Ut({ className: e }) {
1175
- let { state: t, calls: n } = Z(), r = b(null), i = {
1636
+ function gn({ className: e }) {
1637
+ let { state: t, calls: n, setFidelityOpen: r } = X(), i = y(null), a = {
1176
1638
  choose: (e) => {
1177
- r.current = e;
1639
+ i.current = e;
1178
1640
  },
1179
1641
  take: () => {
1180
- let e = r.current;
1181
- return r.current = null, e;
1642
+ let e = i.current;
1643
+ return i.current = null, e;
1182
1644
  }
1183
- }, a = {
1645
+ }, o = {
1184
1646
  state: t,
1185
1647
  calls: n,
1186
- choice: i
1648
+ choice: a
1187
1649
  };
1188
- return /* @__PURE__ */ T(Dt, {
1650
+ return /* @__PURE__ */ E($t, {
1189
1651
  "aria-label": "Menus",
1190
1652
  className: e ?? "-ml-1.5",
1191
1653
  children: [
1192
- /* @__PURE__ */ w(Lt, { ...a }),
1193
- /* @__PURE__ */ w(Rt, { ...a }),
1194
- /* @__PURE__ */ w(Ht, { ...a }),
1195
- /* @__PURE__ */ w($, {
1654
+ /* @__PURE__ */ T(un, { ...o }),
1655
+ /* @__PURE__ */ T(dn, { ...o }),
1656
+ /* @__PURE__ */ T(hn, {
1657
+ ...o,
1658
+ onShowFidelity: () => {
1659
+ r(!0);
1660
+ }
1661
+ }),
1662
+ /* @__PURE__ */ T($, {
1196
1663
  title: "Tools",
1197
1664
  calls: n,
1198
- choice: i,
1199
- children: /* @__PURE__ */ w(Q, {
1665
+ choice: a,
1666
+ children: /* @__PURE__ */ T(Q, {
1200
1667
  id: "advanced",
1201
- ...a
1668
+ ...o
1202
1669
  })
1203
1670
  }),
1204
- /* @__PURE__ */ T($, {
1671
+ /* @__PURE__ */ E($, {
1205
1672
  title: "Help",
1206
1673
  calls: n,
1207
- choice: i,
1208
- children: [/* @__PURE__ */ w(Q, {
1674
+ choice: a,
1675
+ children: [/* @__PURE__ */ T(Q, {
1209
1676
  id: "shortcuts",
1210
- ...a
1211
- }), /* @__PURE__ */ w(Q, {
1677
+ ...o
1678
+ }), /* @__PURE__ */ T(Q, {
1212
1679
  id: "about",
1213
- ...a
1680
+ ...o
1214
1681
  })]
1215
1682
  })
1216
1683
  ]
1217
1684
  });
1218
1685
  }
1219
1686
  // src/header.tsx
1220
- var Wt = {
1221
- system: _e,
1222
- light: k,
1223
- dark: ve
1687
+ var _n = {
1688
+ system: k,
1689
+ light: A,
1690
+ dark: ye
1224
1691
  };
1225
- function Gt({ className: e, alt: t = "" }) {
1226
- return /* @__PURE__ */ w("img", {
1227
- src: yt,
1692
+ function vn({ className: e, alt: t = "" }) {
1693
+ return /* @__PURE__ */ T("img", {
1694
+ src: Gt,
1228
1695
  alt: t,
1229
- className: J("size-10 p-1", e)
1696
+ className: G("size-10 p-1", e)
1230
1697
  });
1231
1698
  }
1232
- function Kt({ className: e }) {
1233
- let { state: t, calls: n } = Z();
1234
- return t.name === null || t.outline ? null : /* @__PURE__ */ w("button", {
1699
+ function yn({ className: e }) {
1700
+ let { state: t, calls: n } = X();
1701
+ return t.name === null || t.outline ? null : /* @__PURE__ */ T("button", {
1235
1702
  type: "button",
1236
- className: J("grid size-10 shrink-0 place-items-center rounded-full text-muted-foreground hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring sm:hidden", e),
1703
+ className: G("grid size-10 shrink-0 place-items-center rounded-full text-muted-foreground hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring sm:hidden", e),
1237
1704
  "aria-label": "Show outline",
1238
1705
  title: "Show outline",
1239
1706
  onClick: () => {
1240
1707
  n.setOutline(!0);
1241
1708
  },
1242
- children: /* @__PURE__ */ w(O, { className: "size-5" })
1709
+ children: /* @__PURE__ */ T(ve, { className: "size-5" })
1243
1710
  });
1244
1711
  }
1245
- function qt({ fallback: e = "F-Office Docs", className: t }) {
1246
- let { state: n } = Z();
1247
- return /* @__PURE__ */ T("div", {
1248
- className: J("min-w-0 flex-1", t),
1249
- children: [/* @__PURE__ */ w("h1", {
1250
- className: "truncate text-lg leading-6",
1251
- children: n.name ?? e
1252
- }), /* @__PURE__ */ w(Ut, {})]
1712
+ function bn({ fallback: e = "F-Office Docs", className: t }) {
1713
+ let { state: n } = X();
1714
+ return /* @__PURE__ */ E("div", {
1715
+ className: G("min-w-0 flex-1", t),
1716
+ children: [/* @__PURE__ */ E("div", {
1717
+ className: "flex min-w-0 items-center gap-2",
1718
+ children: [/* @__PURE__ */ T("h1", {
1719
+ className: "truncate text-lg leading-6",
1720
+ children: n.name ?? e
1721
+ }), /* @__PURE__ */ T(Ut, {})]
1722
+ }), /* @__PURE__ */ T(gn, {})]
1253
1723
  });
1254
1724
  }
1255
- function Jt({ className: e }) {
1256
- let { state: t, calls: n } = Z();
1257
- return t.name === null ? null : /* @__PURE__ */ T("div", {
1258
- className: J("hidden shrink-0 items-center gap-3 text-sm text-muted-foreground md:flex", e),
1259
- children: [/* @__PURE__ */ T("span", { children: [
1725
+ function xn({ className: e }) {
1726
+ let { state: t, calls: n } = X();
1727
+ return t.name === null ? null : /* @__PURE__ */ E("div", {
1728
+ className: G("hidden shrink-0 items-center gap-3 text-sm text-muted-foreground md:flex", e),
1729
+ children: [/* @__PURE__ */ E("span", { children: [
1260
1730
  "Page ",
1261
1731
  t.page + 1,
1262
1732
  " of ",
1263
- t.pageCount
1264
- ] }), /* @__PURE__ */ w("select", {
1733
+ t.pageCount,
1734
+ t.layoutComplete ? "" : "…"
1735
+ ] }), /* @__PURE__ */ T("select", {
1265
1736
  "aria-label": "Zoom",
1266
1737
  className: "h-8 rounded-md border border-border bg-transparent px-2 text-foreground",
1267
1738
  value: t.zoom,
1268
1739
  onChange: (e) => {
1269
1740
  n.setZoom(e.target.value);
1270
1741
  },
1271
- children: xt(t.zoomSteps, t.zoom).map((e) => /* @__PURE__ */ w("option", {
1742
+ children: qt(t.zoomSteps, t.zoom).map((e) => /* @__PURE__ */ T("option", {
1272
1743
  value: e.value,
1273
1744
  children: e.label
1274
1745
  }, e.value))
1275
1746
  })]
1276
1747
  });
1277
1748
  }
1278
- function Yt({ className: e }) {
1279
- let { state: t, calls: n } = Z(), r = Wt[t.theme], i = `Theme: ${G[t.theme]}`;
1280
- return /* @__PURE__ */ w("button", {
1749
+ function Sn({ className: e }) {
1750
+ let { state: t, calls: n } = X(), r = _n[t.theme], i = `Theme: ${U[t.theme]}`;
1751
+ return /* @__PURE__ */ T("button", {
1281
1752
  type: "button",
1282
- className: J("grid size-10 shrink-0 place-items-center rounded-full text-muted-foreground hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring", e),
1753
+ className: G("grid size-10 shrink-0 place-items-center rounded-full text-muted-foreground hover:bg-accent focus-visible:outline-2 focus-visible:outline-ring", e),
1283
1754
  "aria-label": i,
1284
1755
  title: i,
1285
1756
  onClick: () => {
1286
- n.setTheme(Ne(t.theme));
1757
+ n.setTheme(Ie(t.theme));
1287
1758
  },
1288
- children: /* @__PURE__ */ w(r, { className: "size-5" })
1759
+ children: /* @__PURE__ */ T(r, { className: "size-5" })
1289
1760
  });
1290
1761
  }
1291
- function Xt({ className: e }) {
1292
- let { calls: t } = Z();
1293
- return /* @__PURE__ */ T("button", {
1762
+ function Cn({ className: e }) {
1763
+ let { calls: t } = X();
1764
+ return /* @__PURE__ */ E("button", {
1294
1765
  type: "button",
1295
- className: J("h-10 shrink-0 rounded-full bg-primary px-4 text-sm font-medium text-primary-foreground hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring sm:px-5", e),
1766
+ className: G("h-10 shrink-0 rounded-full bg-primary px-4 text-sm font-medium text-primary-foreground hover:opacity-90 focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-ring sm:px-5", e),
1296
1767
  "aria-label": "Open a DOCX file",
1297
1768
  onClick: () => {
1298
1769
  t.run("open");
1299
1770
  },
1300
- children: [/* @__PURE__ */ w("span", {
1771
+ children: [/* @__PURE__ */ T("span", {
1301
1772
  className: "hidden sm:inline",
1302
1773
  children: "Open a DOCX file"
1303
- }), /* @__PURE__ */ w("span", {
1774
+ }), /* @__PURE__ */ T("span", {
1304
1775
  className: "sm:hidden",
1305
1776
  children: "Open"
1306
1777
  })]
1307
1778
  });
1308
1779
  }
1309
- function Zt({ className: e }) {
1310
- return /* @__PURE__ */ T("header", {
1311
- className: J("flex h-16 shrink-0 items-center gap-2 px-3 sm:gap-3 sm:px-4", e),
1780
+ function wn({ className: e }) {
1781
+ return /* @__PURE__ */ E("header", {
1782
+ className: G("flex h-16 shrink-0 items-center gap-2 px-3 sm:gap-3 sm:px-4", e),
1312
1783
  children: [
1313
- /* @__PURE__ */ w(Gt, { className: "shrink-0" }),
1314
- /* @__PURE__ */ w(Kt, {}),
1315
- /* @__PURE__ */ w(qt, {}),
1316
- /* @__PURE__ */ w(Jt, {}),
1317
- /* @__PURE__ */ w(Yt, {}),
1318
- /* @__PURE__ */ w(Xt, {})
1784
+ /* @__PURE__ */ T(vn, { className: "shrink-0" }),
1785
+ /* @__PURE__ */ T(yn, {}),
1786
+ /* @__PURE__ */ T(bn, {}),
1787
+ /* @__PURE__ */ T(xn, {}),
1788
+ /* @__PURE__ */ T(Sn, {}),
1789
+ /* @__PURE__ */ T(Cn, {})
1319
1790
  ]
1320
1791
  });
1321
1792
  }
1322
1793
  // src/docs-app.tsx
1323
- function Qt(e) {
1324
- return /* @__PURE__ */ T(Ye, {
1794
+ function Tn(e) {
1795
+ return /* @__PURE__ */ E(ot, {
1325
1796
  ...e,
1326
1797
  children: [
1327
- /* @__PURE__ */ w(Zt, {}),
1328
- /* @__PURE__ */ w(vt, {}),
1329
- /* @__PURE__ */ w(at, {})
1798
+ /* @__PURE__ */ T(wn, {}),
1799
+ /* @__PURE__ */ T(Wt, {}),
1800
+ /* @__PURE__ */ T(kt, {}),
1801
+ /* @__PURE__ */ T(gt, {})
1330
1802
  ]
1331
1803
  });
1332
1804
  }
1333
1805
  // src/f-office-docs.tsx
1334
- function $t(e, t) {
1806
+ function En(e, t) {
1335
1807
  if (e) {
1336
1808
  if (typeof e == "function") return e(t) ?? void 0;
1337
1809
  e.current = t;
1338
1810
  }
1339
1811
  }
1340
- function en({ ref: e, source: t, name: n, zoom: r, target: i, chrome: a = "none", readOnly: o = !0, outlineOpen: s, fontSource: c, highlights: l, moduleUrls: u, className: d, style: f, onOpen: ee, onViewChange: te, onPageChange: ne, onOutlineChange: re, onSelectionChange: ie, onMenu: p, onError: ae }) {
1812
+ function Dn({ ref: e, source: t, name: n, zoom: r, target: i, chrome: a = "none", outlineButton: o, readOnly: s = !0, outlineOpen: c, fontSource: l, highlights: u, moduleUrls: d, className: f, style: p, onOpen: ee, onPagesChange: te, onProgress: ne, onFidelityChange: re, onViewChange: ie, onPageChange: ae, onOutlineChange: oe, onSelectionChange: m, onMenu: v, onError: b }) {
1341
1813
  le();
1342
- let m = b(null), h = v((e) => {
1814
+ let x = y(null), se = _((e) => {
1343
1815
  ee?.(e.detail);
1344
- }), y = v((e) => {
1816
+ }), ce = _((e) => {
1345
1817
  te?.(e.detail);
1346
- }), x = v((e) => {
1818
+ }), ue = _((e) => {
1347
1819
  ne?.(e.detail);
1348
- }), oe = v((e) => {
1820
+ }), de = _((e) => {
1349
1821
  re?.(e.detail);
1350
- }), se = v((e) => {
1822
+ }), fe = _((e) => {
1351
1823
  ie?.(e.detail);
1352
- }), ce = v((e) => {
1353
- p && (e.preventDefault(), p(e.detail));
1354
- }), ue = v((e) => {
1824
+ }), pe = _((e) => {
1355
1825
  ae?.(e.detail);
1356
- }), de = g((t) => {
1357
- m.current = t;
1358
- let n = $t(e, t);
1826
+ }), S = _((e) => {
1827
+ oe?.(e.detail);
1828
+ }), C = _((e) => {
1829
+ m?.(e.detail);
1830
+ }), w = _((e) => {
1831
+ v && (e.preventDefault(), v(e.detail));
1832
+ }), E = _((e) => {
1833
+ b?.(e.detail);
1834
+ }), me = _((e) => {
1835
+ c !== void 0 && (e.outlineOpen = c), u !== void 0 && e.setDocsHighlights(u);
1836
+ }), he = h((t) => {
1837
+ x.current = t;
1838
+ let n = En(e, t);
1359
1839
  return () => {
1360
- m.current = null, typeof n == "function" ? n() : $t(e, null);
1840
+ x.current = null, typeof n == "function" ? n() : En(e, null);
1361
1841
  };
1362
1842
  }, [e]);
1363
- return _(() => {
1364
- let e = m.current;
1365
- if (e) return e.addEventListener("open", h), e.addEventListener("viewchange", y), e.addEventListener("pagechange", x), e.addEventListener("outlinechange", oe), e.addEventListener("selectionchange", se), e.addEventListener("menu", ce), e.addEventListener("error", ue), () => {
1366
- e.removeEventListener("open", h), e.removeEventListener("viewchange", y), e.removeEventListener("pagechange", x), e.removeEventListener("outlinechange", oe), e.removeEventListener("selectionchange", se), e.removeEventListener("menu", ce), e.removeEventListener("error", ue);
1843
+ return g(() => {
1844
+ let e = x.current;
1845
+ if (e) return e.addEventListener("open", se), e.addEventListener("pageschange", ce), e.addEventListener("progress", ue), e.addEventListener("fidelitychange", de), e.addEventListener("viewchange", fe), e.addEventListener("pagechange", pe), e.addEventListener("outlinechange", S), e.addEventListener("selectionchange", C), e.addEventListener("menu", w), e.addEventListener("error", E), () => {
1846
+ e.removeEventListener("open", se), e.removeEventListener("pageschange", ce), e.removeEventListener("progress", ue), e.removeEventListener("fidelitychange", de), e.removeEventListener("viewchange", fe), e.removeEventListener("pagechange", pe), e.removeEventListener("outlinechange", S), e.removeEventListener("selectionchange", C), e.removeEventListener("menu", w), e.removeEventListener("error", E);
1367
1847
  };
1368
- }, []), _(() => {
1369
- let e = m.current;
1370
- e && (e.readOnly = o);
1371
- }, [o]), _(() => {
1372
- let e = m.current;
1373
- e && c !== void 0 && (e.fontSource = c);
1374
- }, [c]), _(() => {
1375
- let e = m.current;
1376
- e && s !== void 0 && (e.outlineOpen = s);
1377
- }, [s]), _(() => {
1378
- let e = m.current;
1848
+ }, []), g(() => {
1849
+ let e = x.current;
1850
+ e && (e.readOnly = s);
1851
+ }, [s]), g(() => {
1852
+ let e = x.current;
1853
+ e && l !== void 0 && (e.fontSource = l);
1854
+ }, [l]), g(() => {
1855
+ let e = x.current;
1856
+ e && c !== void 0 && (e.outlineOpen = c);
1857
+ }, [c]), g(() => {
1858
+ let e = x.current;
1379
1859
  e && i !== void 0 && (e.target = i);
1380
- }, [i]), _(() => {
1381
- let e = m.current;
1382
- e && r !== void 0 && e.applyZoomSetting(r);
1383
- }, [r]), _(() => {
1384
- let e = m.current;
1385
- e && l !== void 0 && e.setDocsHighlights(l);
1386
- }, [l]), _(() => {
1387
- let e = m.current;
1388
- e && t && e.openSource(t, n).catch(() => void 0);
1389
- }, [t, n]), /* @__PURE__ */ w("f-office-docs", {
1390
- ref: de,
1860
+ }, [i]), g(() => {
1861
+ let e = x.current;
1862
+ e && u !== void 0 && e.setDocsHighlights(u);
1863
+ }, [u]), g(() => {
1864
+ let e = x.current;
1865
+ if (!e) return;
1866
+ if (!t) {
1867
+ e.close().catch(() => void 0);
1868
+ return;
1869
+ }
1870
+ let r = !1;
1871
+ return e.openSource(t, n).then(() => {
1872
+ r || me(e);
1873
+ }).catch(() => void 0), () => {
1874
+ r = !0;
1875
+ };
1876
+ }, [t, n]), /* @__PURE__ */ T("f-office-docs", {
1877
+ ref: he,
1391
1878
  chrome: a,
1392
- "read-only": o ? "true" : "false",
1879
+ "read-only": s ? "true" : "false",
1880
+ ...r === void 0 ? {} : { zoom: String(r) },
1881
+ ...o === void 0 ? {} : { "outline-button": o ? "true" : "false" },
1393
1882
  ...i ? { target: i } : {},
1394
- ...u?.module ? { module: u.module } : {},
1395
- ...u?.wasm ? { wasm: u.wasm } : {},
1396
- ...u?.dictionaries ? { dictionaries: u.dictionaries } : {},
1397
- className: d,
1883
+ ...d?.module ? { module: d.module } : {},
1884
+ ...d?.wasm ? { wasm: d.wasm } : {},
1885
+ ...d?.dictionaries ? { dictionaries: d.dictionaries } : {},
1886
+ className: f,
1398
1887
  style: {
1399
1888
  display: "block",
1400
1889
  width: "100%",
1401
1890
  height: "100%",
1402
- ...f
1891
+ ...p
1403
1892
  }
1404
1893
  });
1405
1894
  }
1406
- export { K as DEFAULT_THEME_STORAGE_KEY, Qt as DocsApp, vt as DocsCanvas, at as DocsDialogs, Zt as DocsHeader, Gt as DocsMark, Ut as DocsMenuBar, Xt as DocsOpenButton, Kt as DocsOutlineButton, Jt as DocsPageControls, Ye as DocsProvider, _t as DocsStart, Yt as DocsThemeButton, qt as DocsTitle, et as DocsWordmark, Pe as FILE_PARAMETER, en as FOfficeDocs, xe as KEEP_LIMIT, Ce as KEEP_NOTES, L as Keeper, W as THEMES, G as THEME_NAMES, Se as VIEW_DELAY, Me as applyTheme, Ie as askedFile, U as browserSlots, Te as databaseSlots, Le as dropFileParameter, X as fetchAskedFile, Y as fileName, z as folderSlots, Ae as loadTheme, Ne as nextTheme, H as openDatabase, je as saveTheme, Z as useDocs, xt as zoomOptions };
1895
+ export { W as DEFAULT_THEME_STORAGE_KEY, Tn as DocsApp, kt as DocsCanvas, gt as DocsDialogs, Wt as DocsFidelityBanner, Ut as DocsFidelityPill, wn as DocsHeader, vn as DocsMark, gn as DocsMenuBar, Cn as DocsOpenButton, yn as DocsOutlineButton, xn as DocsPageControls, ot as DocsProvider, Ot as DocsStart, Sn as DocsThemeButton, bn as DocsTitle, dt as DocsWordmark, q as FILE_PARAMETER, Dn as FOfficeDocs, Se as KEEP_LIMIT, I as KEEP_NOTES, R as Keeper, H as THEMES, U as THEME_NAMES, Ce as VIEW_DELAY, Fe as applyTheme, J as askedFile, Ae as browserSlots, Oe as databaseSlots, qe as dropFileParameter, Ke as fetchAskedFile, Y as fileName, B as folderSlots, Ne as loadTheme, Ie as nextTheme, ke as openDatabase, Pe as saveTheme, X as useDocs, qt as zoomOptions };