@f-office/docs-react 0.2.3 → 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/README.md +5 -2
- package/dist/chrome.d.ts +3 -1
- package/dist/docs-provider.d.ts +4 -0
- package/dist/f-office-docs.d.ts +3 -2
- package/dist/fidelity.d.ts +15 -0
- package/dist/header.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1053 -635
- package/dist/styles.css +1 -1
- package/dist/ui/popover.d.ts +7 -0
- package/dist/use-docs-commands.d.ts +16 -0
- package/dist/use-docs-exports.d.ts +11 -0
- package/dist/use-docs-persistence.d.ts +18 -0
- package/dist/use-docs-theme.d.ts +9 -0
- package/package.json +2 -2
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
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { DEFAULT_COMPATIFONT_CDN as
|
|
4
|
-
import { clsx as
|
|
5
|
-
import { twMerge as
|
|
6
|
-
import { Fragment as
|
|
7
|
-
import { CheckIcon as
|
|
8
|
-
import { ContextMenu as
|
|
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 ye = "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", 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='%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", P = 5e7, xe = 400, Se = {
|
|
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(
|
|
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
|
|
15
|
+
function we(e) {
|
|
16
16
|
return new TextEncoder().encode(JSON.stringify(e)).slice().buffer;
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Te(e) {
|
|
19
19
|
return e === null ? null : JSON.parse(new TextDecoder().decode(e));
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
let t =
|
|
21
|
+
function L(e) {
|
|
22
|
+
let t = Te(e);
|
|
23
23
|
return typeof t == "string" ? t : null;
|
|
24
24
|
}
|
|
25
|
-
function
|
|
26
|
-
let t =
|
|
27
|
-
return t === null ? null :
|
|
25
|
+
function Ee(e) {
|
|
26
|
+
let t = Te(e);
|
|
27
|
+
return t === null ? null : p(t);
|
|
28
28
|
}
|
|
29
|
-
var
|
|
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 =
|
|
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:
|
|
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",
|
|
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",
|
|
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
|
|
81
|
+
function z(e) {
|
|
82
82
|
return e instanceof DOMException && e.name === "NotFoundError";
|
|
83
83
|
}
|
|
84
|
-
function
|
|
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 (
|
|
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 (!
|
|
101
|
+
if (!z(e)) throw e;
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
};
|
|
105
105
|
}
|
|
106
|
-
var
|
|
107
|
-
function
|
|
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 H(e) {
|
|
|
126
126
|
}
|
|
127
127
|
};
|
|
128
128
|
}
|
|
129
|
-
function
|
|
129
|
+
function ke(e) {
|
|
130
130
|
return new Promise((t) => {
|
|
131
|
-
let n = e.open(
|
|
131
|
+
let n = e.open(De, 1);
|
|
132
132
|
n.onupgradeneeded = () => {
|
|
133
133
|
n.result.createObjectStore(V);
|
|
134
134
|
}, n.onsuccess = () => {
|
|
@@ -138,96 +138,199 @@ function Te(e) {
|
|
|
138
138
|
};
|
|
139
139
|
});
|
|
140
140
|
}
|
|
141
|
-
async function
|
|
141
|
+
async function Ae() {
|
|
142
142
|
try {
|
|
143
|
-
if (typeof FileSystemFileHandle < "u" && "createWritable" in FileSystemFileHandle.prototype) return
|
|
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
|
|
148
|
-
return 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 U(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, U(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
|
|
156
|
+
var H = [
|
|
185
157
|
"system",
|
|
186
158
|
"light",
|
|
187
159
|
"dark"
|
|
188
|
-
],
|
|
160
|
+
], U = {
|
|
189
161
|
system: "System",
|
|
190
162
|
light: "Light",
|
|
191
163
|
dark: "Dark"
|
|
192
|
-
},
|
|
193
|
-
function
|
|
194
|
-
return
|
|
164
|
+
}, W = "f-office-viewer:theme", je = () => window.localStorage;
|
|
165
|
+
function Me(e) {
|
|
166
|
+
return H.includes(e);
|
|
195
167
|
}
|
|
196
|
-
function
|
|
168
|
+
function Ne(e = je, t = W) {
|
|
197
169
|
try {
|
|
198
170
|
let n = e().getItem(t);
|
|
199
|
-
return
|
|
171
|
+
return Me(n) ? n : "system";
|
|
200
172
|
} catch {
|
|
201
173
|
return "system";
|
|
202
174
|
}
|
|
203
175
|
}
|
|
204
|
-
function
|
|
176
|
+
function Pe(e, t = je, n = W) {
|
|
205
177
|
try {
|
|
206
178
|
t().setItem(n, e);
|
|
207
179
|
} catch {}
|
|
208
180
|
}
|
|
209
|
-
function
|
|
181
|
+
function Fe(e, t = document.documentElement) {
|
|
210
182
|
e === "system" ? delete t.dataset.theme : t.dataset.theme = e;
|
|
211
183
|
}
|
|
212
|
-
function
|
|
213
|
-
return
|
|
184
|
+
function Ie(e) {
|
|
185
|
+
return H[(H.indexOf(e) + 1) % H.length] ?? "system";
|
|
214
186
|
}
|
|
215
187
|
// src/ui/utils.ts
|
|
216
|
-
function
|
|
217
|
-
return S(
|
|
188
|
+
function G(...e) {
|
|
189
|
+
return C(S(e));
|
|
218
190
|
}
|
|
219
191
|
// src/ui/portal-theme.ts
|
|
220
|
-
var
|
|
221
|
-
function
|
|
222
|
-
return
|
|
192
|
+
var Le = oe(void 0);
|
|
193
|
+
function K() {
|
|
194
|
+
return m(Le);
|
|
223
195
|
}
|
|
224
|
-
// src/
|
|
225
|
-
var Le = "file";
|
|
196
|
+
// src/page-keys.ts
|
|
226
197
|
function Re(e, t) {
|
|
227
|
-
|
|
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
|
+
};
|
|
228
204
|
}
|
|
229
205
|
function ze(e, t) {
|
|
230
|
-
let n =
|
|
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
|
+
]);
|
|
326
|
+
}
|
|
327
|
+
// src/url-file.ts
|
|
328
|
+
var q = "file";
|
|
329
|
+
function Ge(e, t) {
|
|
330
|
+
return `The address names a file on ${e.origin}. F-Office Docs opens files only from ${t.origin}, the site of this page.`;
|
|
331
|
+
}
|
|
332
|
+
function J(e, t) {
|
|
333
|
+
let n = new URLSearchParams(e).get(q);
|
|
231
334
|
if (n === null || n === "") return null;
|
|
232
335
|
let r = new URL(t), i;
|
|
233
336
|
try {
|
|
@@ -243,55 +346,123 @@ function ze(e, t) {
|
|
|
243
346
|
address: i
|
|
244
347
|
} : {
|
|
245
348
|
kind: "refused",
|
|
246
|
-
why:
|
|
349
|
+
why: Ge(i, r)
|
|
247
350
|
};
|
|
248
351
|
}
|
|
249
|
-
function
|
|
352
|
+
function Y(e) {
|
|
250
353
|
let t = e.pathname.split("/").pop() ?? "", n = t;
|
|
251
354
|
try {
|
|
252
355
|
n = decodeURIComponent(t);
|
|
253
356
|
} catch {}
|
|
254
357
|
return n || "document.docx";
|
|
255
358
|
}
|
|
256
|
-
async function
|
|
359
|
+
async function Ke(e, t, n = fetch) {
|
|
257
360
|
let r = await n(e.href, t ? { signal: t } : {}), i = r.url ? new URL(r.url) : e;
|
|
258
|
-
if (i.origin !== e.origin) throw Error(
|
|
259
|
-
if (!r.ok) throw Error(`The file ${
|
|
361
|
+
if (i.origin !== e.origin) throw Error(Ge(i, e));
|
|
362
|
+
if (!r.ok) throw Error(`The file ${Y(e)} cannot be read: the server answered HTTP ${String(r.status)}.`);
|
|
260
363
|
return {
|
|
261
|
-
name:
|
|
364
|
+
name: Y(e),
|
|
262
365
|
bytes: await r.arrayBuffer()
|
|
263
366
|
};
|
|
264
367
|
}
|
|
265
|
-
function
|
|
368
|
+
function qe() {
|
|
266
369
|
let e = new URLSearchParams(window.location.search);
|
|
267
370
|
if (!e.has("file")) return;
|
|
268
|
-
e.delete(
|
|
371
|
+
e.delete(q);
|
|
269
372
|
let t = e.toString();
|
|
270
373
|
window.history.replaceState(null, "", t ? `?${t}` : window.location.pathname);
|
|
271
374
|
}
|
|
272
|
-
function
|
|
375
|
+
function Je(e) {
|
|
273
376
|
return e instanceof Error ? e.message : String(e);
|
|
274
377
|
}
|
|
275
|
-
function
|
|
276
|
-
let r =
|
|
277
|
-
|
|
378
|
+
function Ye(e, t, n) {
|
|
379
|
+
let r = _(t), i = _(n);
|
|
380
|
+
g(() => {
|
|
278
381
|
if (e?.kind === "refused" && i(e.why), e?.kind !== "address") return;
|
|
279
382
|
let t = new AbortController();
|
|
280
|
-
return
|
|
383
|
+
return Ke(e.address, t.signal).then((e) => {
|
|
281
384
|
r(e);
|
|
282
385
|
}, (e) => {
|
|
283
|
-
t.signal.aborted || i(
|
|
386
|
+
t.signal.aborted || i(Je(e));
|
|
284
387
|
}), () => {
|
|
285
388
|
t.abort();
|
|
286
389
|
};
|
|
287
390
|
}, [e]);
|
|
288
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
|
+
}
|
|
289
460
|
// src/docs-provider.tsx
|
|
290
|
-
var
|
|
291
|
-
function
|
|
292
|
-
return
|
|
461
|
+
var Qe = null;
|
|
462
|
+
function $e() {
|
|
463
|
+
return Qe ||= new R(Ae()), Qe;
|
|
293
464
|
}
|
|
294
|
-
var
|
|
465
|
+
var et = {
|
|
295
466
|
selected: !1,
|
|
296
467
|
outline: !1,
|
|
297
468
|
zoom: "fixed:1",
|
|
@@ -299,101 +470,74 @@ var Ke = {
|
|
|
299
470
|
page: 0,
|
|
300
471
|
pageCount: 0,
|
|
301
472
|
layoutComplete: !0,
|
|
302
|
-
progress: null
|
|
473
|
+
progress: null,
|
|
474
|
+
fidelity: null
|
|
303
475
|
};
|
|
304
|
-
function
|
|
476
|
+
function tt(e) {
|
|
305
477
|
return e.zoom === "fixed" ? c(e.factor) : e.zoom;
|
|
306
478
|
}
|
|
307
|
-
function
|
|
479
|
+
function nt(e) {
|
|
308
480
|
return `The installed fonts cannot be read (${e instanceof Error ? e.message : String(e)}), so the pages use the open fonts.`;
|
|
309
481
|
}
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
}
|
|
314
|
-
var Xe = m(null);
|
|
315
|
-
function Y() {
|
|
316
|
-
let e = h(Xe);
|
|
482
|
+
var rt = oe(null);
|
|
483
|
+
function it() {
|
|
484
|
+
let e = m(rt);
|
|
317
485
|
if (!e) throw Error("useDocs must be used inside a <DocsProvider>");
|
|
318
486
|
return e;
|
|
319
487
|
}
|
|
320
488
|
function X() {
|
|
321
|
-
return
|
|
489
|
+
return it().publicValue;
|
|
322
490
|
}
|
|
323
|
-
function
|
|
324
|
-
return
|
|
491
|
+
function at() {
|
|
492
|
+
return it().internal;
|
|
325
493
|
}
|
|
326
|
-
function
|
|
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 }) {
|
|
327
495
|
le();
|
|
328
|
-
let
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
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;
|
|
342
516
|
}, [
|
|
343
|
-
o,
|
|
344
517
|
a,
|
|
518
|
+
i,
|
|
345
519
|
r,
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
])
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
view: null
|
|
353
|
-
}), A(null), S && S.keep(e, t).then((e) => {
|
|
354
|
-
A(Se[e]);
|
|
355
|
-
});
|
|
356
|
-
}, [S]);
|
|
357
|
-
Ue(O, U, g((e) => {
|
|
358
|
-
P({ problem: e });
|
|
359
|
-
}, [])), _(() => {
|
|
360
|
-
if (!m) return;
|
|
361
|
-
let e = !0;
|
|
362
|
-
return m.arrayBuffer().then((t) => {
|
|
363
|
-
e && U({
|
|
364
|
-
name: m.name,
|
|
365
|
-
bytes: t
|
|
366
|
-
});
|
|
367
|
-
}), () => {
|
|
368
|
-
e = !1;
|
|
369
|
-
};
|
|
370
|
-
}, [m, U]), _(() => {
|
|
371
|
-
if (!S) return;
|
|
372
|
-
S.load().then((e) => {
|
|
373
|
-
e && O?.kind !== "address" && !m && (_e((t) => t ?? e), A((e) => e ?? Se.kept));
|
|
520
|
+
O,
|
|
521
|
+
k
|
|
522
|
+
]);
|
|
523
|
+
g(() => {
|
|
524
|
+
O !== "installed" || k || de().then(ye, (e) => {
|
|
525
|
+
ve("open"), R(nt(e));
|
|
374
526
|
});
|
|
375
|
-
let e = () => void S.flush();
|
|
376
|
-
return window.addEventListener("pagehide", e), () => {
|
|
377
|
-
window.removeEventListener("pagehide", e);
|
|
378
|
-
};
|
|
379
527
|
}, [
|
|
380
|
-
S,
|
|
381
528
|
O,
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
});
|
|
387
|
-
}, [I, R]);
|
|
388
|
-
let [De, W] = x(0), G = v((e) => {
|
|
529
|
+
k,
|
|
530
|
+
R
|
|
531
|
+
]);
|
|
532
|
+
let Oe = _((e) => {
|
|
389
533
|
let t = e.detail;
|
|
390
|
-
|
|
534
|
+
m?.keepView(t), j((e) => ({
|
|
391
535
|
...e,
|
|
392
|
-
zoom:
|
|
536
|
+
zoom: tt(t)
|
|
393
537
|
}));
|
|
394
|
-
}),
|
|
538
|
+
}), ke = _((e) => {
|
|
395
539
|
let { pageCount: t, zoomSteps: n, complete: r } = e.detail, i = r ?? !0;
|
|
396
|
-
|
|
540
|
+
j((e) => ({
|
|
397
541
|
...e,
|
|
398
542
|
pageCount: t,
|
|
399
543
|
zoomSteps: n,
|
|
@@ -401,237 +545,209 @@ function Qe({ children: e, keeper: n, fontCdnUrl: r = oe, fontFolderUrl: a, font
|
|
|
401
545
|
layoutComplete: i,
|
|
402
546
|
progress: i ? null : e.progress
|
|
403
547
|
}));
|
|
404
|
-
}),
|
|
548
|
+
}), Ae = _((e) => {
|
|
405
549
|
let { pageCount: t, complete: n } = e.detail;
|
|
406
|
-
|
|
550
|
+
j((e) => ({
|
|
407
551
|
...e,
|
|
408
552
|
pageCount: t,
|
|
409
553
|
layoutComplete: n,
|
|
410
554
|
progress: n ? null : e.progress
|
|
411
555
|
}));
|
|
412
|
-
}),
|
|
556
|
+
}), H = _((e) => {
|
|
413
557
|
let t = e.detail;
|
|
414
|
-
|
|
558
|
+
j((e) => ({
|
|
415
559
|
...e,
|
|
416
560
|
progress: t.complete ? null : t
|
|
417
561
|
}));
|
|
418
|
-
}),
|
|
419
|
-
|
|
562
|
+
}), U = _(() => {
|
|
563
|
+
j((e) => e.progress === null ? e : {
|
|
420
564
|
...e,
|
|
421
565
|
progress: null
|
|
422
566
|
});
|
|
423
|
-
}),
|
|
567
|
+
}), je = _((e) => {
|
|
424
568
|
let { page: t } = e.detail;
|
|
425
|
-
|
|
569
|
+
j((e) => ({
|
|
426
570
|
...e,
|
|
427
571
|
page: t
|
|
428
572
|
}));
|
|
429
|
-
}),
|
|
573
|
+
}), Me = _((e) => {
|
|
430
574
|
let { open: t } = e.detail;
|
|
431
|
-
|
|
575
|
+
j((e) => ({
|
|
432
576
|
...e,
|
|
433
577
|
outline: t
|
|
434
578
|
}));
|
|
435
|
-
}),
|
|
579
|
+
}), Ne = _((e) => {
|
|
436
580
|
let { selected: t } = e.detail;
|
|
437
|
-
|
|
581
|
+
j((e) => ({
|
|
438
582
|
...e,
|
|
439
583
|
selected: t
|
|
440
584
|
}));
|
|
441
|
-
}),
|
|
442
|
-
e.preventDefault(),
|
|
443
|
-
}),
|
|
444
|
-
|
|
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);
|
|
445
595
|
}), []);
|
|
446
|
-
|
|
447
|
-
let e =
|
|
448
|
-
if (e) return e.addEventListener("viewchange",
|
|
449
|
-
e.removeEventListener("viewchange",
|
|
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);
|
|
450
600
|
};
|
|
451
|
-
}, [
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
let
|
|
455
|
-
|
|
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(() => {
|
|
456
608
|
n || (r ? e.showView(r) : e.clientWidth < t && e.setZoom("fit-width"));
|
|
457
609
|
}, () => void 0), () => {
|
|
458
610
|
n = !0;
|
|
459
611
|
};
|
|
460
612
|
}, [
|
|
461
|
-
|
|
462
|
-
|
|
613
|
+
P,
|
|
614
|
+
w,
|
|
615
|
+
L,
|
|
616
|
+
z,
|
|
617
|
+
O,
|
|
463
618
|
k,
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
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
|
|
479
643
|
});
|
|
480
|
-
}, [
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
C.current?.click();
|
|
485
|
-
return;
|
|
486
|
-
case "print":
|
|
487
|
-
if (t) {
|
|
488
|
-
let e = te();
|
|
489
|
-
t.pdf().then(e.print, e.cancel);
|
|
490
|
-
}
|
|
491
|
-
return;
|
|
492
|
-
case "download":
|
|
493
|
-
k && Ye(k);
|
|
494
|
-
return;
|
|
495
|
-
case "close":
|
|
496
|
-
p && Ve(), S?.forget(), _e(null), A(null), M((e) => e + 1);
|
|
497
|
-
return;
|
|
498
|
-
case "copy":
|
|
499
|
-
t?.copyText(null);
|
|
500
|
-
return;
|
|
501
|
-
case "select-all":
|
|
502
|
-
t?.selectAll();
|
|
503
|
-
return;
|
|
504
|
-
case "find":
|
|
505
|
-
t?.find();
|
|
506
|
-
return;
|
|
507
|
-
case "zoom-in":
|
|
508
|
-
t?.zoomStep(!0);
|
|
509
|
-
return;
|
|
510
|
-
case "zoom-out":
|
|
511
|
-
t?.zoomStep(!1);
|
|
512
|
-
return;
|
|
513
|
-
case "actual-size":
|
|
514
|
-
t?.setZoom("fixed", 1);
|
|
515
|
-
return;
|
|
516
|
-
case "advanced":
|
|
517
|
-
P("advanced");
|
|
518
|
-
return;
|
|
519
|
-
case "shortcuts":
|
|
520
|
-
P("shortcuts");
|
|
521
|
-
return;
|
|
522
|
-
case "about":
|
|
523
|
-
P("about");
|
|
524
|
-
return;
|
|
525
|
-
default: return;
|
|
526
|
-
}
|
|
527
|
-
}, [
|
|
528
|
-
k,
|
|
529
|
-
S,
|
|
530
|
-
p
|
|
531
|
-
]);
|
|
532
|
-
Oe({
|
|
533
|
-
takes: (e) => i(e, k !== null, B.selected),
|
|
534
|
-
run: X
|
|
535
|
-
}, E);
|
|
536
|
-
let Ze = g((e) => {
|
|
537
|
-
ge(e), p && re(e);
|
|
538
|
-
}, [p]), Qe = g(() => {
|
|
539
|
-
P(null);
|
|
540
|
-
}, []), $e = y(() => ({
|
|
541
|
-
run: X,
|
|
644
|
+
}, [K]), J = h(() => {
|
|
645
|
+
Ce(K);
|
|
646
|
+
}, [K]), Y = v(() => ({
|
|
647
|
+
run: He,
|
|
542
648
|
setOutline: (e) => {
|
|
543
|
-
|
|
649
|
+
C.current && (C.current.outlineOpen = e);
|
|
544
650
|
},
|
|
545
651
|
setZoom: (e) => {
|
|
546
|
-
let { zoom: t, factor: n } =
|
|
547
|
-
|
|
652
|
+
let { zoom: t, factor: n } = te(e);
|
|
653
|
+
C.current?.setZoom(t, n);
|
|
548
654
|
},
|
|
549
655
|
setTheme: we,
|
|
550
656
|
setFonts: (e) => {
|
|
551
|
-
e === "open" ? (p &&
|
|
552
|
-
p &&
|
|
657
|
+
e === "open" ? (p && re("fonts", e), ve(e)) : de().then((t) => {
|
|
658
|
+
p && re("fonts", e), ye(t), ve(e);
|
|
553
659
|
}, (e) => {
|
|
554
|
-
|
|
660
|
+
R(nt(e));
|
|
555
661
|
});
|
|
556
662
|
},
|
|
557
663
|
focusPages: () => {
|
|
558
|
-
|
|
664
|
+
C.current?.focus();
|
|
559
665
|
}
|
|
560
666
|
}), [
|
|
561
|
-
|
|
667
|
+
He,
|
|
562
668
|
we,
|
|
563
|
-
p
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
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,
|
|
570
678
|
installedFonts: se()
|
|
571
679
|
}), [
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
]),
|
|
680
|
+
A,
|
|
681
|
+
L,
|
|
682
|
+
Ee,
|
|
683
|
+
I,
|
|
684
|
+
O
|
|
685
|
+
]), qe = v(() => ({
|
|
578
686
|
publicValue: {
|
|
579
|
-
state:
|
|
580
|
-
calls:
|
|
581
|
-
openFile:
|
|
582
|
-
elementRef:
|
|
583
|
-
target:
|
|
584
|
-
setTarget:
|
|
585
|
-
dialog:
|
|
586
|
-
closeDialog:
|
|
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
|
|
587
699
|
},
|
|
588
700
|
internal: {
|
|
589
|
-
file:
|
|
590
|
-
dragging:
|
|
591
|
-
generation:
|
|
592
|
-
menu:
|
|
593
|
-
moduleUrls:
|
|
594
|
-
attachElement:
|
|
701
|
+
file: L,
|
|
702
|
+
dragging: he,
|
|
703
|
+
generation: z,
|
|
704
|
+
menu: M,
|
|
705
|
+
moduleUrls: o,
|
|
706
|
+
attachElement: Ie
|
|
595
707
|
}
|
|
596
708
|
}), [
|
|
597
|
-
|
|
598
|
-
$e,
|
|
709
|
+
Ke,
|
|
599
710
|
Y,
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
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
|
|
610
726
|
]);
|
|
611
|
-
return /* @__PURE__ */
|
|
612
|
-
value:
|
|
613
|
-
children: /* @__PURE__ */
|
|
614
|
-
value:
|
|
615
|
-
children: /* @__PURE__ */
|
|
616
|
-
"data-f-office-theme":
|
|
617
|
-
className:
|
|
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),
|
|
618
734
|
onDragOver: (e) => {
|
|
619
|
-
e.preventDefault(),
|
|
735
|
+
e.preventDefault(), D(!0);
|
|
620
736
|
},
|
|
621
737
|
onDragLeave: () => {
|
|
622
|
-
|
|
738
|
+
D(!1);
|
|
623
739
|
},
|
|
624
740
|
onDrop: (e) => {
|
|
625
|
-
e.preventDefault(),
|
|
741
|
+
e.preventDefault(), D(!1), B(s(e.dataTransfer.files));
|
|
626
742
|
},
|
|
627
|
-
children: [e, /* @__PURE__ */
|
|
628
|
-
ref:
|
|
743
|
+
children: [e, /* @__PURE__ */ T("input", {
|
|
744
|
+
ref: S,
|
|
629
745
|
className: "hidden",
|
|
630
746
|
type: "file",
|
|
631
747
|
accept: ".docx",
|
|
632
748
|
"aria-label": "DOCX file",
|
|
633
749
|
onChange: (e) => {
|
|
634
|
-
|
|
750
|
+
B(s(e.target.files)), e.target.value = "";
|
|
635
751
|
}
|
|
636
752
|
})]
|
|
637
753
|
})
|
|
@@ -639,60 +755,60 @@ function Qe({ children: e, keeper: n, fontCdnUrl: r = oe, fontFolderUrl: a, font
|
|
|
639
755
|
});
|
|
640
756
|
}
|
|
641
757
|
// src/ui/dialog.tsx
|
|
642
|
-
var
|
|
643
|
-
function
|
|
644
|
-
let r =
|
|
645
|
-
return /* @__PURE__ */
|
|
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, {
|
|
646
762
|
"data-slot": "dialog-content",
|
|
647
763
|
"data-f-office-theme": r,
|
|
648
|
-
className:
|
|
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),
|
|
649
765
|
...n,
|
|
650
|
-
children: [t, /* @__PURE__ */
|
|
766
|
+
children: [t, /* @__PURE__ */ T(N.Close, {
|
|
651
767
|
className: "absolute top-4 right-4 rounded-full p-1 text-muted-foreground hover:bg-accent",
|
|
652
768
|
"aria-label": "Close",
|
|
653
|
-
children: /* @__PURE__ */
|
|
769
|
+
children: /* @__PURE__ */ T(j, { className: "size-4" })
|
|
654
770
|
})]
|
|
655
771
|
})] });
|
|
656
772
|
}
|
|
657
|
-
function
|
|
658
|
-
return /* @__PURE__ */
|
|
773
|
+
function lt({ className: e, ...t }) {
|
|
774
|
+
return /* @__PURE__ */ T(N.Title, {
|
|
659
775
|
"data-slot": "dialog-title",
|
|
660
|
-
className:
|
|
776
|
+
className: G("text-lg font-medium", e),
|
|
661
777
|
...t
|
|
662
778
|
});
|
|
663
779
|
}
|
|
664
|
-
function
|
|
665
|
-
return /* @__PURE__ */
|
|
780
|
+
function ut({ className: e, ...t }) {
|
|
781
|
+
return /* @__PURE__ */ T(N.Description, {
|
|
666
782
|
"data-slot": "dialog-description",
|
|
667
|
-
className:
|
|
783
|
+
className: G("text-sm text-muted-foreground", e),
|
|
668
784
|
...t
|
|
669
785
|
});
|
|
670
786
|
}
|
|
671
787
|
// src/dialogs.tsx
|
|
672
|
-
function
|
|
673
|
-
return /* @__PURE__ */
|
|
674
|
-
src:
|
|
788
|
+
function dt({ className: e }) {
|
|
789
|
+
return /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T("img", {
|
|
790
|
+
src: xe,
|
|
675
791
|
alt: "F-Office",
|
|
676
792
|
className: `f-office-logo-light ${e}`
|
|
677
|
-
}), /* @__PURE__ */
|
|
678
|
-
src:
|
|
793
|
+
}), /* @__PURE__ */ T("img", {
|
|
794
|
+
src: be,
|
|
679
795
|
alt: "F-Office",
|
|
680
796
|
className: `f-office-logo-dark ${e}`
|
|
681
797
|
})] });
|
|
682
798
|
}
|
|
683
|
-
function
|
|
799
|
+
function ft() {
|
|
684
800
|
let e = a(navigator.userAgent);
|
|
685
|
-
return /* @__PURE__ */
|
|
686
|
-
/* @__PURE__ */
|
|
687
|
-
/* @__PURE__ */
|
|
688
|
-
/* @__PURE__ */
|
|
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", {
|
|
689
805
|
className: "text-sm",
|
|
690
|
-
children: /* @__PURE__ */
|
|
806
|
+
children: /* @__PURE__ */ T("tbody", { children: ie(e).map(([e, t]) => /* @__PURE__ */ E("tr", {
|
|
691
807
|
className: "border-t border-border",
|
|
692
|
-
children: [/* @__PURE__ */
|
|
808
|
+
children: [/* @__PURE__ */ T("td", {
|
|
693
809
|
className: "py-1.5 pr-4 font-mono text-xs",
|
|
694
810
|
children: e
|
|
695
|
-
}), /* @__PURE__ */
|
|
811
|
+
}), /* @__PURE__ */ T("td", {
|
|
696
812
|
className: "py-1.5",
|
|
697
813
|
children: t
|
|
698
814
|
})]
|
|
@@ -700,32 +816,32 @@ function rt() {
|
|
|
700
816
|
})
|
|
701
817
|
] });
|
|
702
818
|
}
|
|
703
|
-
function
|
|
704
|
-
return /* @__PURE__ */
|
|
705
|
-
/* @__PURE__ */
|
|
819
|
+
function pt() {
|
|
820
|
+
return /* @__PURE__ */ E(w, { children: [
|
|
821
|
+
/* @__PURE__ */ T(lt, {
|
|
706
822
|
className: "sr-only",
|
|
707
823
|
children: "About F-Office"
|
|
708
824
|
}),
|
|
709
|
-
/* @__PURE__ */
|
|
710
|
-
/* @__PURE__ */
|
|
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." })
|
|
711
827
|
] });
|
|
712
828
|
}
|
|
713
|
-
function
|
|
714
|
-
return /* @__PURE__ */
|
|
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 })] });
|
|
715
831
|
}
|
|
716
|
-
function
|
|
717
|
-
return /* @__PURE__ */
|
|
718
|
-
/* @__PURE__ */
|
|
719
|
-
/* @__PURE__ */
|
|
720
|
-
/* @__PURE__ */
|
|
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", {
|
|
721
837
|
className: "flex items-center gap-3 text-sm",
|
|
722
|
-
children: ["Target", /* @__PURE__ */
|
|
838
|
+
children: ["Target", /* @__PURE__ */ T("select", {
|
|
723
839
|
className: "h-9 rounded-md border border-border bg-transparent px-2",
|
|
724
840
|
value: e,
|
|
725
841
|
onChange: (e) => {
|
|
726
842
|
t(e.target.value);
|
|
727
843
|
},
|
|
728
|
-
children: n.map((e) => /* @__PURE__ */
|
|
844
|
+
children: n.map((e) => /* @__PURE__ */ T("option", {
|
|
729
845
|
value: e.id,
|
|
730
846
|
children: e.label
|
|
731
847
|
}, e.id))
|
|
@@ -733,65 +849,65 @@ function ot({ target: e, setTarget: t }) {
|
|
|
733
849
|
})
|
|
734
850
|
] });
|
|
735
851
|
}
|
|
736
|
-
function
|
|
852
|
+
function gt() {
|
|
737
853
|
let { dialog: e, closeDialog: t, calls: n, target: r, setTarget: i } = X();
|
|
738
|
-
return /* @__PURE__ */
|
|
854
|
+
return /* @__PURE__ */ T(st, {
|
|
739
855
|
open: e !== null,
|
|
740
856
|
onOpenChange: (e) => {
|
|
741
857
|
e || t();
|
|
742
858
|
},
|
|
743
|
-
children: /* @__PURE__ */
|
|
859
|
+
children: /* @__PURE__ */ E(ct, {
|
|
744
860
|
onCloseAutoFocus: (e) => {
|
|
745
861
|
e.preventDefault(), n.focusPages();
|
|
746
862
|
},
|
|
747
863
|
children: [
|
|
748
|
-
e === "shortcuts" && /* @__PURE__ */
|
|
749
|
-
e === "about" && /* @__PURE__ */
|
|
750
|
-
e === "advanced" && /* @__PURE__ */
|
|
864
|
+
e === "shortcuts" && /* @__PURE__ */ T(ft, {}),
|
|
865
|
+
e === "about" && /* @__PURE__ */ T(pt, {}),
|
|
866
|
+
e === "advanced" && /* @__PURE__ */ T(ht, {
|
|
751
867
|
target: r,
|
|
752
868
|
setTarget: i
|
|
753
869
|
}),
|
|
754
|
-
typeof e == "object" && !!e && /* @__PURE__ */
|
|
870
|
+
typeof e == "object" && !!e && /* @__PURE__ */ T(mt, { why: e.problem })
|
|
755
871
|
]
|
|
756
872
|
})
|
|
757
873
|
});
|
|
758
874
|
}
|
|
759
875
|
// src/ui/context-menu.tsx
|
|
760
|
-
var
|
|
761
|
-
function
|
|
762
|
-
let n =
|
|
763
|
-
return /* @__PURE__ */
|
|
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, {
|
|
764
880
|
"data-slot": "context-menu-content",
|
|
765
881
|
"data-f-office-theme": n,
|
|
766
|
-
className:
|
|
882
|
+
className: G(vt, e),
|
|
767
883
|
...t
|
|
768
884
|
}) });
|
|
769
885
|
}
|
|
770
|
-
function
|
|
771
|
-
return /* @__PURE__ */
|
|
886
|
+
function St({ className: e, ...t }) {
|
|
887
|
+
return /* @__PURE__ */ T(M.Item, {
|
|
772
888
|
"data-slot": "context-menu-item",
|
|
773
|
-
className:
|
|
889
|
+
className: G(_t, e),
|
|
774
890
|
...t
|
|
775
891
|
});
|
|
776
892
|
}
|
|
777
|
-
function
|
|
778
|
-
return /* @__PURE__ */
|
|
893
|
+
function Ct({ className: e, ...t }) {
|
|
894
|
+
return /* @__PURE__ */ T(M.Separator, {
|
|
779
895
|
"data-slot": "context-menu-separator",
|
|
780
|
-
className:
|
|
896
|
+
className: G("-mx-1 my-1 h-px bg-border", e),
|
|
781
897
|
...t
|
|
782
898
|
});
|
|
783
899
|
}
|
|
784
900
|
// src/ui/menu-shortcut.tsx
|
|
785
|
-
function
|
|
786
|
-
return /* @__PURE__ */
|
|
901
|
+
function wt({ className: e, ...t }) {
|
|
902
|
+
return /* @__PURE__ */ T("span", {
|
|
787
903
|
"data-slot": "menu-shortcut",
|
|
788
904
|
"aria-hidden": "true",
|
|
789
|
-
className:
|
|
905
|
+
className: G("ml-auto pl-6 text-xs tracking-widest text-muted-foreground", e),
|
|
790
906
|
...t
|
|
791
907
|
});
|
|
792
908
|
}
|
|
793
909
|
// src/page-menu.tsx
|
|
794
|
-
function
|
|
910
|
+
function Tt(t, n, i) {
|
|
795
911
|
let o = a(navigator.userAgent), s = l(t, o)[0];
|
|
796
912
|
return {
|
|
797
913
|
name: e[t].name,
|
|
@@ -801,7 +917,7 @@ function gt(t, n, i) {
|
|
|
801
917
|
run: i
|
|
802
918
|
};
|
|
803
919
|
}
|
|
804
|
-
function
|
|
920
|
+
function Et(e) {
|
|
805
921
|
let t = e?.link ?? null, n = t && o(t), r = [];
|
|
806
922
|
return t && r.push({
|
|
807
923
|
name: "Open link",
|
|
@@ -822,17 +938,17 @@ function _t(e) {
|
|
|
822
938
|
}), [
|
|
823
939
|
...r,
|
|
824
940
|
...t ? [null] : [],
|
|
825
|
-
|
|
941
|
+
Tt("copy", !e?.selected, (e) => {
|
|
826
942
|
e.copyText(null);
|
|
827
943
|
}),
|
|
828
|
-
|
|
944
|
+
Tt("select-all", !1, (e) => {
|
|
829
945
|
e.selectAll();
|
|
830
946
|
})
|
|
831
947
|
];
|
|
832
948
|
}
|
|
833
|
-
function
|
|
834
|
-
let n =
|
|
835
|
-
return
|
|
949
|
+
function Dt({ request: e, elementRef: t }) {
|
|
950
|
+
let n = y(null), r = y(null), i = y(null);
|
|
951
|
+
return g(() => {
|
|
836
952
|
if (e) {
|
|
837
953
|
let r = t.current?.shadowRoot?.activeElement ?? null;
|
|
838
954
|
i.current = r instanceof HTMLElement && u(r) ? r : null, n.current?.dispatchEvent(new MouseEvent("contextmenu", {
|
|
@@ -842,10 +958,10 @@ function vt({ request: e, elementRef: t }) {
|
|
|
842
958
|
clientY: e.y
|
|
843
959
|
}));
|
|
844
960
|
}
|
|
845
|
-
}, [e, t]), /* @__PURE__ */
|
|
961
|
+
}, [e, t]), /* @__PURE__ */ E(yt, { children: [/* @__PURE__ */ T(bt, {
|
|
846
962
|
ref: n,
|
|
847
963
|
className: "hidden"
|
|
848
|
-
}), /* @__PURE__ */
|
|
964
|
+
}), /* @__PURE__ */ T(xt, {
|
|
849
965
|
"aria-label": "Page",
|
|
850
966
|
onContextMenu: (e) => {
|
|
851
967
|
e.preventDefault();
|
|
@@ -857,37 +973,37 @@ function vt({ request: e, elementRef: t }) {
|
|
|
857
973
|
let o = i.current;
|
|
858
974
|
i.current = null, o?.isConnected ? o.focus() : n?.focus(), n && a?.(n);
|
|
859
975
|
},
|
|
860
|
-
children:
|
|
976
|
+
children: Et(e).map((e) => e === null ? /* @__PURE__ */ T(Ct, {}, "separator") : /* @__PURE__ */ E(St, {
|
|
861
977
|
disabled: e.disabled,
|
|
862
978
|
"aria-keyshortcuts": e.aria,
|
|
863
979
|
onSelect: () => {
|
|
864
980
|
r.current = e.run;
|
|
865
981
|
},
|
|
866
|
-
children: [e.name, e.key !== void 0 && /* @__PURE__ */
|
|
982
|
+
children: [e.name, e.key !== void 0 && /* @__PURE__ */ T(wt, { children: e.key })]
|
|
867
983
|
}, e.name))
|
|
868
984
|
})] });
|
|
869
985
|
}
|
|
870
986
|
// src/start.tsx
|
|
871
|
-
function
|
|
987
|
+
function Ot() {
|
|
872
988
|
let { calls: e } = X();
|
|
873
|
-
return /* @__PURE__ */
|
|
989
|
+
return /* @__PURE__ */ E("div", {
|
|
874
990
|
className: "flex h-full flex-col items-center justify-center gap-10 overflow-auto p-6",
|
|
875
|
-
children: [/* @__PURE__ */
|
|
991
|
+
children: [/* @__PURE__ */ T(dt, { className: "h-10 w-auto sm:h-14" }), /* @__PURE__ */ E("button", {
|
|
876
992
|
type: "button",
|
|
877
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",
|
|
878
994
|
onClick: () => {
|
|
879
995
|
e.run("open");
|
|
880
996
|
},
|
|
881
997
|
children: [
|
|
882
|
-
/* @__PURE__ */
|
|
998
|
+
/* @__PURE__ */ T(O, {
|
|
883
999
|
className: "size-10 text-primary",
|
|
884
1000
|
"aria-hidden": "true"
|
|
885
1001
|
}),
|
|
886
|
-
/* @__PURE__ */
|
|
1002
|
+
/* @__PURE__ */ T("span", {
|
|
887
1003
|
className: "text-lg font-medium",
|
|
888
1004
|
children: "Open a DOCX file or drop it here"
|
|
889
1005
|
}),
|
|
890
|
-
/* @__PURE__ */
|
|
1006
|
+
/* @__PURE__ */ T("span", {
|
|
891
1007
|
className: "text-sm text-muted-foreground",
|
|
892
1008
|
children: "The file stays in this browser."
|
|
893
1009
|
})
|
|
@@ -896,26 +1012,26 @@ function yt() {
|
|
|
896
1012
|
});
|
|
897
1013
|
}
|
|
898
1014
|
// src/docs-canvas.tsx
|
|
899
|
-
function
|
|
900
|
-
let { state: n, elementRef: r } = X(), { file: i, dragging: a, generation: o, menu: s, moduleUrls: c, attachElement: l } =
|
|
901
|
-
return /* @__PURE__ */
|
|
902
|
-
className:
|
|
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),
|
|
903
1019
|
children: [
|
|
904
|
-
i !== null && u !== null && !u.complete && /* @__PURE__ */
|
|
1020
|
+
i !== null && u !== null && !u.complete && /* @__PURE__ */ T("div", {
|
|
905
1021
|
role: "progressbar",
|
|
906
1022
|
"aria-label": "Document loading progress",
|
|
907
1023
|
"aria-valuemin": 0,
|
|
908
1024
|
"aria-valuemax": 100,
|
|
909
1025
|
"aria-valuenow": d ?? void 0,
|
|
910
1026
|
className: "pointer-events-none absolute inset-x-0 top-0 z-10 h-0.5 overflow-hidden bg-border",
|
|
911
|
-
children: /* @__PURE__ */
|
|
912
|
-
className:
|
|
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"),
|
|
913
1029
|
style: d === null ? void 0 : { width: `${String(d)}%` }
|
|
914
1030
|
})
|
|
915
1031
|
}),
|
|
916
|
-
/* @__PURE__ */
|
|
1032
|
+
/* @__PURE__ */ T("div", {
|
|
917
1033
|
className: i === null ? "hidden" : "f-office-docs-holder h-full",
|
|
918
|
-
children: /* @__PURE__ */
|
|
1034
|
+
children: /* @__PURE__ */ T("f-office-docs", {
|
|
919
1035
|
ref: l,
|
|
920
1036
|
chrome: "none",
|
|
921
1037
|
"outline-button": "true",
|
|
@@ -925,25 +1041,285 @@ function bt({ emptyState: e, className: t }) {
|
|
|
925
1041
|
...c?.dictionaries ? { dictionaries: c.dictionaries } : {}
|
|
926
1042
|
}, o)
|
|
927
1043
|
}),
|
|
928
|
-
/* @__PURE__ */
|
|
1044
|
+
/* @__PURE__ */ T(Dt, {
|
|
929
1045
|
request: s,
|
|
930
1046
|
elementRef: r
|
|
931
1047
|
}),
|
|
932
|
-
i === null && (e ?? /* @__PURE__ */
|
|
933
|
-
a && /* @__PURE__ */
|
|
1048
|
+
i === null && (e ?? /* @__PURE__ */ T(Ot, {})),
|
|
1049
|
+
a && /* @__PURE__ */ T("div", {
|
|
934
1050
|
className: "pointer-events-none absolute inset-0 grid place-items-center bg-background/85 text-lg font-medium",
|
|
935
1051
|
children: "Drop the file to open it"
|
|
936
1052
|
})
|
|
937
1053
|
]
|
|
938
1054
|
});
|
|
939
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
|
+
}
|
|
940
1316
|
// src/assets/mark.svg
|
|
941
|
-
var
|
|
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";
|
|
942
1318
|
// src/chrome.ts
|
|
943
|
-
function
|
|
1319
|
+
function Kt(e) {
|
|
944
1320
|
return `${String(Math.round(e * 100))}%`;
|
|
945
1321
|
}
|
|
946
|
-
function
|
|
1322
|
+
function qt(e, t) {
|
|
947
1323
|
let n = [
|
|
948
1324
|
{
|
|
949
1325
|
value: "fit-width",
|
|
@@ -955,114 +1331,114 @@ function Ct(e, t) {
|
|
|
955
1331
|
},
|
|
956
1332
|
...e.map((e) => ({
|
|
957
1333
|
value: c(e),
|
|
958
|
-
label:
|
|
1334
|
+
label: Kt(e)
|
|
959
1335
|
}))
|
|
960
1336
|
];
|
|
961
1337
|
return t.startsWith("fixed:") && !n.some((e) => e.value === t) && n.push({
|
|
962
1338
|
value: t,
|
|
963
|
-
label:
|
|
1339
|
+
label: Kt(Number(t.slice(6)))
|
|
964
1340
|
}), n;
|
|
965
1341
|
}
|
|
966
1342
|
// src/ui/menubar.tsx
|
|
967
|
-
var
|
|
968
|
-
function
|
|
969
|
-
return /* @__PURE__ */
|
|
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 });
|
|
970
1346
|
}
|
|
971
|
-
function
|
|
972
|
-
return /* @__PURE__ */
|
|
1347
|
+
function Zt(e) {
|
|
1348
|
+
return /* @__PURE__ */ T(P.Sub, { ...e });
|
|
973
1349
|
}
|
|
974
|
-
function
|
|
975
|
-
return /* @__PURE__ */
|
|
1350
|
+
function Qt(e) {
|
|
1351
|
+
return /* @__PURE__ */ T(P.RadioGroup, { ...e });
|
|
976
1352
|
}
|
|
977
|
-
function
|
|
978
|
-
return /* @__PURE__ */
|
|
1353
|
+
function $t({ className: e, ...t }) {
|
|
1354
|
+
return /* @__PURE__ */ T(P.Root, {
|
|
979
1355
|
"data-slot": "menubar",
|
|
980
|
-
className:
|
|
1356
|
+
className: G("flex items-center gap-0.5", e),
|
|
981
1357
|
...t
|
|
982
1358
|
});
|
|
983
1359
|
}
|
|
984
|
-
function
|
|
985
|
-
return /* @__PURE__ */
|
|
1360
|
+
function en({ className: e, ...t }) {
|
|
1361
|
+
return /* @__PURE__ */ T(P.Trigger, {
|
|
986
1362
|
"data-slot": "menubar-trigger",
|
|
987
|
-
className:
|
|
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),
|
|
988
1364
|
...t
|
|
989
1365
|
});
|
|
990
1366
|
}
|
|
991
|
-
function
|
|
992
|
-
let i =
|
|
993
|
-
return /* @__PURE__ */
|
|
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, {
|
|
994
1370
|
"data-slot": "menubar-content",
|
|
995
1371
|
"data-f-office-theme": i,
|
|
996
1372
|
align: t,
|
|
997
1373
|
sideOffset: n,
|
|
998
|
-
className:
|
|
1374
|
+
className: G(Yt, e),
|
|
999
1375
|
...r
|
|
1000
1376
|
}) });
|
|
1001
1377
|
}
|
|
1002
|
-
function
|
|
1003
|
-
return /* @__PURE__ */
|
|
1378
|
+
function nn({ className: e, ...t }) {
|
|
1379
|
+
return /* @__PURE__ */ T(P.Item, {
|
|
1004
1380
|
"data-slot": "menubar-item",
|
|
1005
|
-
className:
|
|
1381
|
+
className: G(Jt, e),
|
|
1006
1382
|
...t
|
|
1007
1383
|
});
|
|
1008
1384
|
}
|
|
1009
|
-
function
|
|
1010
|
-
return /* @__PURE__ */
|
|
1385
|
+
function rn({ className: e, children: t, ...n }) {
|
|
1386
|
+
return /* @__PURE__ */ E(P.CheckboxItem, {
|
|
1011
1387
|
"data-slot": "menubar-checkbox-item",
|
|
1012
|
-
className:
|
|
1388
|
+
className: G(Jt, "pl-8", e),
|
|
1013
1389
|
...n,
|
|
1014
|
-
children: [/* @__PURE__ */
|
|
1390
|
+
children: [/* @__PURE__ */ T("span", {
|
|
1015
1391
|
className: "absolute left-2 flex size-4 items-center justify-center",
|
|
1016
|
-
children: /* @__PURE__ */
|
|
1392
|
+
children: /* @__PURE__ */ T(P.ItemIndicator, { children: /* @__PURE__ */ T(D, { className: "size-4" }) })
|
|
1017
1393
|
}), t]
|
|
1018
1394
|
});
|
|
1019
1395
|
}
|
|
1020
|
-
function
|
|
1021
|
-
return /* @__PURE__ */
|
|
1396
|
+
function an({ className: e, children: t, ...n }) {
|
|
1397
|
+
return /* @__PURE__ */ E(P.RadioItem, {
|
|
1022
1398
|
"data-slot": "menubar-radio-item",
|
|
1023
|
-
className:
|
|
1399
|
+
className: G(Jt, "pl-8", e),
|
|
1024
1400
|
...n,
|
|
1025
|
-
children: [/* @__PURE__ */
|
|
1401
|
+
children: [/* @__PURE__ */ T("span", {
|
|
1026
1402
|
className: "absolute left-2 flex size-4 items-center justify-center",
|
|
1027
|
-
children: /* @__PURE__ */
|
|
1403
|
+
children: /* @__PURE__ */ T(P.ItemIndicator, { children: /* @__PURE__ */ T(_e, { className: "size-2 fill-current" }) })
|
|
1028
1404
|
}), t]
|
|
1029
1405
|
});
|
|
1030
1406
|
}
|
|
1031
|
-
function
|
|
1032
|
-
return /* @__PURE__ */
|
|
1407
|
+
function on({ className: e, children: t, ...n }) {
|
|
1408
|
+
return /* @__PURE__ */ E(P.SubTrigger, {
|
|
1033
1409
|
"data-slot": "menubar-sub-trigger",
|
|
1034
|
-
className:
|
|
1410
|
+
className: G(Jt, "data-[state=open]:bg-accent", e),
|
|
1035
1411
|
...n,
|
|
1036
|
-
children: [t, /* @__PURE__ */
|
|
1412
|
+
children: [t, /* @__PURE__ */ T(ge, { className: "ml-auto size-4" })]
|
|
1037
1413
|
});
|
|
1038
1414
|
}
|
|
1039
|
-
function
|
|
1040
|
-
let n =
|
|
1041
|
-
return /* @__PURE__ */
|
|
1415
|
+
function sn({ className: e, ...t }) {
|
|
1416
|
+
let n = K();
|
|
1417
|
+
return /* @__PURE__ */ T(P.Portal, { children: /* @__PURE__ */ T(P.SubContent, {
|
|
1042
1418
|
"data-slot": "menubar-sub-content",
|
|
1043
1419
|
"data-f-office-theme": n,
|
|
1044
|
-
className:
|
|
1420
|
+
className: G(Yt, "min-w-36", e),
|
|
1045
1421
|
...t
|
|
1046
1422
|
}) });
|
|
1047
1423
|
}
|
|
1048
|
-
function
|
|
1049
|
-
return /* @__PURE__ */
|
|
1424
|
+
function Z({ className: e, ...t }) {
|
|
1425
|
+
return /* @__PURE__ */ T(P.Separator, {
|
|
1050
1426
|
"data-slot": "menubar-separator",
|
|
1051
|
-
className:
|
|
1427
|
+
className: G("-mx-1 my-1 h-px bg-border", e),
|
|
1052
1428
|
...t
|
|
1053
1429
|
});
|
|
1054
1430
|
}
|
|
1055
|
-
function
|
|
1056
|
-
return /* @__PURE__ */
|
|
1431
|
+
function cn({ className: e, ...t }) {
|
|
1432
|
+
return /* @__PURE__ */ T(P.Label, {
|
|
1057
1433
|
"data-slot": "menubar-label",
|
|
1058
|
-
className:
|
|
1434
|
+
className: G("px-2 py-1.5 text-xs text-muted-foreground", e),
|
|
1059
1435
|
...t
|
|
1060
1436
|
});
|
|
1061
1437
|
}
|
|
1062
1438
|
// src/menus.tsx
|
|
1063
1439
|
function Q({ id: t, state: n, calls: o, choice: s }) {
|
|
1064
1440
|
let c = a(navigator.userAgent), u = l(t, c)[0], d = !i(t, n.name !== null, n.selected);
|
|
1065
|
-
return /* @__PURE__ */
|
|
1441
|
+
return /* @__PURE__ */ E(nn, {
|
|
1066
1442
|
disabled: d,
|
|
1067
1443
|
"aria-keyshortcuts": r(t, c),
|
|
1068
1444
|
onSelect: () => {
|
|
@@ -1070,11 +1446,11 @@ function Q({ id: t, state: n, calls: o, choice: s }) {
|
|
|
1070
1446
|
o.run(t);
|
|
1071
1447
|
});
|
|
1072
1448
|
},
|
|
1073
|
-
children: [e[t].name, u !== void 0 && /* @__PURE__ */
|
|
1449
|
+
children: [e[t].name, u !== void 0 && /* @__PURE__ */ T(wt, { children: u })]
|
|
1074
1450
|
});
|
|
1075
1451
|
}
|
|
1076
1452
|
function $({ title: e, calls: t, choice: n, children: r }) {
|
|
1077
|
-
return /* @__PURE__ */
|
|
1453
|
+
return /* @__PURE__ */ E(Xt, { children: [/* @__PURE__ */ T(en, { children: e }), /* @__PURE__ */ T(tn, {
|
|
1078
1454
|
onCloseAutoFocus: (e) => {
|
|
1079
1455
|
let r = n.take();
|
|
1080
1456
|
r && (e.preventDefault(), t.focusPages(), r());
|
|
@@ -1082,124 +1458,155 @@ function $({ title: e, calls: t, choice: n, children: r }) {
|
|
|
1082
1458
|
children: r
|
|
1083
1459
|
})] });
|
|
1084
1460
|
}
|
|
1085
|
-
function
|
|
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) {
|
|
1086
1485
|
let { state: t } = e;
|
|
1087
|
-
return /* @__PURE__ */
|
|
1486
|
+
return /* @__PURE__ */ E($, {
|
|
1088
1487
|
title: "File",
|
|
1089
1488
|
calls: e.calls,
|
|
1090
1489
|
choice: e.choice,
|
|
1091
1490
|
children: [
|
|
1092
|
-
/* @__PURE__ */
|
|
1491
|
+
/* @__PURE__ */ T(Q, {
|
|
1093
1492
|
id: "open",
|
|
1094
1493
|
...e
|
|
1095
1494
|
}),
|
|
1096
|
-
/* @__PURE__ */
|
|
1097
|
-
|
|
1098
|
-
...e
|
|
1099
|
-
}),
|
|
1100
|
-
/* @__PURE__ */ w(Q, {
|
|
1495
|
+
/* @__PURE__ */ T(ln, { ...e }),
|
|
1496
|
+
/* @__PURE__ */ T(Q, {
|
|
1101
1497
|
id: "print",
|
|
1102
1498
|
...e
|
|
1103
1499
|
}),
|
|
1104
|
-
/* @__PURE__ */
|
|
1500
|
+
/* @__PURE__ */ T(Q, {
|
|
1105
1501
|
id: "close",
|
|
1106
1502
|
...e
|
|
1107
1503
|
}),
|
|
1108
|
-
t.note && /* @__PURE__ */
|
|
1504
|
+
t.note && /* @__PURE__ */ E(w, { children: [/* @__PURE__ */ T(Z, {}), /* @__PURE__ */ T(cn, {
|
|
1109
1505
|
className: "max-w-64",
|
|
1110
1506
|
children: t.note
|
|
1111
1507
|
})] })
|
|
1112
1508
|
]
|
|
1113
1509
|
});
|
|
1114
1510
|
}
|
|
1115
|
-
function
|
|
1116
|
-
return /* @__PURE__ */
|
|
1511
|
+
function dn(e) {
|
|
1512
|
+
return /* @__PURE__ */ E($, {
|
|
1117
1513
|
title: "Edit",
|
|
1118
1514
|
calls: e.calls,
|
|
1119
1515
|
choice: e.choice,
|
|
1120
1516
|
children: [
|
|
1121
|
-
/* @__PURE__ */
|
|
1517
|
+
/* @__PURE__ */ T(Q, {
|
|
1122
1518
|
id: "copy",
|
|
1123
1519
|
...e
|
|
1124
1520
|
}),
|
|
1125
|
-
/* @__PURE__ */
|
|
1521
|
+
/* @__PURE__ */ T(Q, {
|
|
1126
1522
|
id: "select-all",
|
|
1127
1523
|
...e
|
|
1128
1524
|
}),
|
|
1129
|
-
/* @__PURE__ */
|
|
1130
|
-
/* @__PURE__ */
|
|
1525
|
+
/* @__PURE__ */ T(Z, {}),
|
|
1526
|
+
/* @__PURE__ */ T(Q, {
|
|
1131
1527
|
id: "find",
|
|
1132
1528
|
...e
|
|
1133
1529
|
})
|
|
1134
1530
|
]
|
|
1135
1531
|
});
|
|
1136
1532
|
}
|
|
1137
|
-
function
|
|
1533
|
+
function fn(e) {
|
|
1138
1534
|
let { state: t, calls: n } = e;
|
|
1139
|
-
return /* @__PURE__ */
|
|
1535
|
+
return /* @__PURE__ */ E(Zt, { children: [/* @__PURE__ */ T(on, {
|
|
1140
1536
|
disabled: t.name === null,
|
|
1141
1537
|
children: "Zoom"
|
|
1142
|
-
}), /* @__PURE__ */
|
|
1143
|
-
/* @__PURE__ */
|
|
1538
|
+
}), /* @__PURE__ */ E(sn, { children: [
|
|
1539
|
+
/* @__PURE__ */ T(Q, {
|
|
1144
1540
|
id: "zoom-in",
|
|
1145
1541
|
...e
|
|
1146
1542
|
}),
|
|
1147
|
-
/* @__PURE__ */
|
|
1543
|
+
/* @__PURE__ */ T(Q, {
|
|
1148
1544
|
id: "zoom-out",
|
|
1149
1545
|
...e
|
|
1150
1546
|
}),
|
|
1151
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ T(Q, {
|
|
1152
1548
|
id: "actual-size",
|
|
1153
1549
|
...e
|
|
1154
1550
|
}),
|
|
1155
|
-
/* @__PURE__ */
|
|
1156
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ T(Z, {}),
|
|
1552
|
+
/* @__PURE__ */ T(Qt, {
|
|
1157
1553
|
value: t.zoom,
|
|
1158
1554
|
onValueChange: (t) => {
|
|
1159
1555
|
e.choice.choose(() => {
|
|
1160
1556
|
n.setZoom(t);
|
|
1161
1557
|
});
|
|
1162
1558
|
},
|
|
1163
|
-
children:
|
|
1559
|
+
children: qt(t.zoomSteps, t.zoom).map((e) => /* @__PURE__ */ T(an, {
|
|
1164
1560
|
value: e.value,
|
|
1165
1561
|
children: e.label
|
|
1166
1562
|
}, e.value))
|
|
1167
1563
|
})
|
|
1168
1564
|
] })] });
|
|
1169
1565
|
}
|
|
1170
|
-
var
|
|
1566
|
+
var pn = {
|
|
1171
1567
|
open: "Open fonts",
|
|
1172
1568
|
installed: "Installed fonts"
|
|
1173
1569
|
};
|
|
1174
|
-
function
|
|
1175
|
-
return /* @__PURE__ */
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
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
|
+
] })] });
|
|
1194
1601
|
}
|
|
1195
|
-
function
|
|
1602
|
+
function hn(e) {
|
|
1196
1603
|
let { state: t, calls: n } = e;
|
|
1197
|
-
return /* @__PURE__ */
|
|
1604
|
+
return /* @__PURE__ */ E($, {
|
|
1198
1605
|
title: "View",
|
|
1199
1606
|
calls: n,
|
|
1200
1607
|
choice: e.choice,
|
|
1201
1608
|
children: [
|
|
1202
|
-
/* @__PURE__ */
|
|
1609
|
+
/* @__PURE__ */ T(rn, {
|
|
1203
1610
|
disabled: t.name === null,
|
|
1204
1611
|
checked: t.outline,
|
|
1205
1612
|
onCheckedChange: (t) => {
|
|
@@ -1209,240 +1616,251 @@ function Wt(e) {
|
|
|
1209
1616
|
},
|
|
1210
1617
|
children: "Outline"
|
|
1211
1618
|
}),
|
|
1212
|
-
/* @__PURE__ */
|
|
1213
|
-
/* @__PURE__ */
|
|
1214
|
-
/* @__PURE__ */
|
|
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, {
|
|
1215
1622
|
value: t.theme,
|
|
1216
1623
|
onValueChange: (t) => {
|
|
1217
1624
|
e.choice.choose(() => {
|
|
1218
1625
|
n.setTheme(t);
|
|
1219
1626
|
});
|
|
1220
1627
|
},
|
|
1221
|
-
children:
|
|
1628
|
+
children: H.map((e) => /* @__PURE__ */ T(an, {
|
|
1222
1629
|
value: e,
|
|
1223
|
-
children:
|
|
1630
|
+
children: U[e]
|
|
1224
1631
|
}, e))
|
|
1225
1632
|
}) })] })
|
|
1226
1633
|
]
|
|
1227
1634
|
});
|
|
1228
1635
|
}
|
|
1229
|
-
function
|
|
1230
|
-
let { state: t, calls: n } = X(),
|
|
1636
|
+
function gn({ className: e }) {
|
|
1637
|
+
let { state: t, calls: n, setFidelityOpen: r } = X(), i = y(null), a = {
|
|
1231
1638
|
choose: (e) => {
|
|
1232
|
-
|
|
1639
|
+
i.current = e;
|
|
1233
1640
|
},
|
|
1234
1641
|
take: () => {
|
|
1235
|
-
let e =
|
|
1236
|
-
return
|
|
1642
|
+
let e = i.current;
|
|
1643
|
+
return i.current = null, e;
|
|
1237
1644
|
}
|
|
1238
|
-
},
|
|
1645
|
+
}, o = {
|
|
1239
1646
|
state: t,
|
|
1240
1647
|
calls: n,
|
|
1241
|
-
choice:
|
|
1648
|
+
choice: a
|
|
1242
1649
|
};
|
|
1243
|
-
return /* @__PURE__ */
|
|
1650
|
+
return /* @__PURE__ */ E($t, {
|
|
1244
1651
|
"aria-label": "Menus",
|
|
1245
1652
|
className: e ?? "-ml-1.5",
|
|
1246
1653
|
children: [
|
|
1247
|
-
/* @__PURE__ */
|
|
1248
|
-
/* @__PURE__ */
|
|
1249
|
-
/* @__PURE__ */
|
|
1250
|
-
|
|
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($, {
|
|
1251
1663
|
title: "Tools",
|
|
1252
1664
|
calls: n,
|
|
1253
|
-
choice:
|
|
1254
|
-
children: /* @__PURE__ */
|
|
1665
|
+
choice: a,
|
|
1666
|
+
children: /* @__PURE__ */ T(Q, {
|
|
1255
1667
|
id: "advanced",
|
|
1256
|
-
...
|
|
1668
|
+
...o
|
|
1257
1669
|
})
|
|
1258
1670
|
}),
|
|
1259
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ E($, {
|
|
1260
1672
|
title: "Help",
|
|
1261
1673
|
calls: n,
|
|
1262
|
-
choice:
|
|
1263
|
-
children: [/* @__PURE__ */
|
|
1674
|
+
choice: a,
|
|
1675
|
+
children: [/* @__PURE__ */ T(Q, {
|
|
1264
1676
|
id: "shortcuts",
|
|
1265
|
-
...
|
|
1266
|
-
}), /* @__PURE__ */
|
|
1677
|
+
...o
|
|
1678
|
+
}), /* @__PURE__ */ T(Q, {
|
|
1267
1679
|
id: "about",
|
|
1268
|
-
...
|
|
1680
|
+
...o
|
|
1269
1681
|
})]
|
|
1270
1682
|
})
|
|
1271
1683
|
]
|
|
1272
1684
|
});
|
|
1273
1685
|
}
|
|
1274
1686
|
// src/header.tsx
|
|
1275
|
-
var
|
|
1687
|
+
var _n = {
|
|
1276
1688
|
system: k,
|
|
1277
|
-
light:
|
|
1278
|
-
dark:
|
|
1689
|
+
light: A,
|
|
1690
|
+
dark: ye
|
|
1279
1691
|
};
|
|
1280
|
-
function
|
|
1281
|
-
return /* @__PURE__ */
|
|
1282
|
-
src:
|
|
1692
|
+
function vn({ className: e, alt: t = "" }) {
|
|
1693
|
+
return /* @__PURE__ */ T("img", {
|
|
1694
|
+
src: Gt,
|
|
1283
1695
|
alt: t,
|
|
1284
|
-
className:
|
|
1696
|
+
className: G("size-10 p-1", e)
|
|
1285
1697
|
});
|
|
1286
1698
|
}
|
|
1287
|
-
function
|
|
1699
|
+
function yn({ className: e }) {
|
|
1288
1700
|
let { state: t, calls: n } = X();
|
|
1289
|
-
return t.name === null || t.outline ? null : /* @__PURE__ */
|
|
1701
|
+
return t.name === null || t.outline ? null : /* @__PURE__ */ T("button", {
|
|
1290
1702
|
type: "button",
|
|
1291
|
-
className:
|
|
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),
|
|
1292
1704
|
"aria-label": "Show outline",
|
|
1293
1705
|
title: "Show outline",
|
|
1294
1706
|
onClick: () => {
|
|
1295
1707
|
n.setOutline(!0);
|
|
1296
1708
|
},
|
|
1297
|
-
children: /* @__PURE__ */
|
|
1709
|
+
children: /* @__PURE__ */ T(ve, { className: "size-5" })
|
|
1298
1710
|
});
|
|
1299
1711
|
}
|
|
1300
|
-
function
|
|
1712
|
+
function bn({ fallback: e = "F-Office Docs", className: t }) {
|
|
1301
1713
|
let { state: n } = X();
|
|
1302
|
-
return /* @__PURE__ */
|
|
1303
|
-
className:
|
|
1304
|
-
children: [/* @__PURE__ */
|
|
1305
|
-
className: "
|
|
1306
|
-
children:
|
|
1307
|
-
|
|
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, {})]
|
|
1308
1723
|
});
|
|
1309
1724
|
}
|
|
1310
|
-
function
|
|
1725
|
+
function xn({ className: e }) {
|
|
1311
1726
|
let { state: t, calls: n } = X();
|
|
1312
|
-
return t.name === null ? null : /* @__PURE__ */
|
|
1313
|
-
className:
|
|
1314
|
-
children: [/* @__PURE__ */
|
|
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: [
|
|
1315
1730
|
"Page ",
|
|
1316
1731
|
t.page + 1,
|
|
1317
1732
|
" of ",
|
|
1318
1733
|
t.pageCount,
|
|
1319
1734
|
t.layoutComplete ? "" : "…"
|
|
1320
|
-
] }), /* @__PURE__ */
|
|
1735
|
+
] }), /* @__PURE__ */ T("select", {
|
|
1321
1736
|
"aria-label": "Zoom",
|
|
1322
1737
|
className: "h-8 rounded-md border border-border bg-transparent px-2 text-foreground",
|
|
1323
1738
|
value: t.zoom,
|
|
1324
1739
|
onChange: (e) => {
|
|
1325
1740
|
n.setZoom(e.target.value);
|
|
1326
1741
|
},
|
|
1327
|
-
children:
|
|
1742
|
+
children: qt(t.zoomSteps, t.zoom).map((e) => /* @__PURE__ */ T("option", {
|
|
1328
1743
|
value: e.value,
|
|
1329
1744
|
children: e.label
|
|
1330
1745
|
}, e.value))
|
|
1331
1746
|
})]
|
|
1332
1747
|
});
|
|
1333
1748
|
}
|
|
1334
|
-
function
|
|
1335
|
-
let { state: t, calls: n } = X(), r =
|
|
1336
|
-
return /* @__PURE__ */
|
|
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", {
|
|
1337
1752
|
type: "button",
|
|
1338
|
-
className:
|
|
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),
|
|
1339
1754
|
"aria-label": i,
|
|
1340
1755
|
title: i,
|
|
1341
1756
|
onClick: () => {
|
|
1342
|
-
n.setTheme(
|
|
1757
|
+
n.setTheme(Ie(t.theme));
|
|
1343
1758
|
},
|
|
1344
|
-
children: /* @__PURE__ */
|
|
1759
|
+
children: /* @__PURE__ */ T(r, { className: "size-5" })
|
|
1345
1760
|
});
|
|
1346
1761
|
}
|
|
1347
|
-
function
|
|
1762
|
+
function Cn({ className: e }) {
|
|
1348
1763
|
let { calls: t } = X();
|
|
1349
|
-
return /* @__PURE__ */
|
|
1764
|
+
return /* @__PURE__ */ E("button", {
|
|
1350
1765
|
type: "button",
|
|
1351
|
-
className:
|
|
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),
|
|
1352
1767
|
"aria-label": "Open a DOCX file",
|
|
1353
1768
|
onClick: () => {
|
|
1354
1769
|
t.run("open");
|
|
1355
1770
|
},
|
|
1356
|
-
children: [/* @__PURE__ */
|
|
1771
|
+
children: [/* @__PURE__ */ T("span", {
|
|
1357
1772
|
className: "hidden sm:inline",
|
|
1358
1773
|
children: "Open a DOCX file"
|
|
1359
|
-
}), /* @__PURE__ */
|
|
1774
|
+
}), /* @__PURE__ */ T("span", {
|
|
1360
1775
|
className: "sm:hidden",
|
|
1361
1776
|
children: "Open"
|
|
1362
1777
|
})]
|
|
1363
1778
|
});
|
|
1364
1779
|
}
|
|
1365
|
-
function
|
|
1366
|
-
return /* @__PURE__ */
|
|
1367
|
-
className:
|
|
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),
|
|
1368
1783
|
children: [
|
|
1369
|
-
/* @__PURE__ */
|
|
1370
|
-
/* @__PURE__ */
|
|
1371
|
-
/* @__PURE__ */
|
|
1372
|
-
/* @__PURE__ */
|
|
1373
|
-
/* @__PURE__ */
|
|
1374
|
-
/* @__PURE__ */
|
|
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, {})
|
|
1375
1790
|
]
|
|
1376
1791
|
});
|
|
1377
1792
|
}
|
|
1378
1793
|
// src/docs-app.tsx
|
|
1379
|
-
function
|
|
1380
|
-
return /* @__PURE__ */
|
|
1794
|
+
function Tn(e) {
|
|
1795
|
+
return /* @__PURE__ */ E(ot, {
|
|
1381
1796
|
...e,
|
|
1382
1797
|
children: [
|
|
1383
|
-
/* @__PURE__ */
|
|
1384
|
-
/* @__PURE__ */
|
|
1385
|
-
/* @__PURE__ */
|
|
1798
|
+
/* @__PURE__ */ T(wn, {}),
|
|
1799
|
+
/* @__PURE__ */ T(Wt, {}),
|
|
1800
|
+
/* @__PURE__ */ T(kt, {}),
|
|
1801
|
+
/* @__PURE__ */ T(gt, {})
|
|
1386
1802
|
]
|
|
1387
1803
|
});
|
|
1388
1804
|
}
|
|
1389
1805
|
// src/f-office-docs.tsx
|
|
1390
|
-
function
|
|
1806
|
+
function En(e, t) {
|
|
1391
1807
|
if (e) {
|
|
1392
1808
|
if (typeof e == "function") return e(t) ?? void 0;
|
|
1393
1809
|
e.current = t;
|
|
1394
1810
|
}
|
|
1395
1811
|
}
|
|
1396
|
-
function
|
|
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 }) {
|
|
1397
1813
|
le();
|
|
1398
|
-
let x =
|
|
1814
|
+
let x = y(null), se = _((e) => {
|
|
1815
|
+
ee?.(e.detail);
|
|
1816
|
+
}), ce = _((e) => {
|
|
1399
1817
|
te?.(e.detail);
|
|
1400
|
-
}),
|
|
1818
|
+
}), ue = _((e) => {
|
|
1401
1819
|
ne?.(e.detail);
|
|
1402
|
-
}),
|
|
1820
|
+
}), de = _((e) => {
|
|
1403
1821
|
re?.(e.detail);
|
|
1404
|
-
}),
|
|
1822
|
+
}), fe = _((e) => {
|
|
1405
1823
|
ie?.(e.detail);
|
|
1406
|
-
}),
|
|
1407
|
-
p?.(e.detail);
|
|
1408
|
-
}), fe = v((e) => {
|
|
1824
|
+
}), pe = _((e) => {
|
|
1409
1825
|
ae?.(e.detail);
|
|
1410
|
-
}),
|
|
1826
|
+
}), S = _((e) => {
|
|
1827
|
+
oe?.(e.detail);
|
|
1828
|
+
}), C = _((e) => {
|
|
1411
1829
|
m?.(e.detail);
|
|
1412
|
-
}),
|
|
1413
|
-
|
|
1414
|
-
}),
|
|
1415
|
-
|
|
1416
|
-
}),
|
|
1830
|
+
}), w = _((e) => {
|
|
1831
|
+
v && (e.preventDefault(), v(e.detail));
|
|
1832
|
+
}), E = _((e) => {
|
|
1833
|
+
b?.(e.detail);
|
|
1834
|
+
}), me = _((e) => {
|
|
1417
1835
|
c !== void 0 && (e.outlineOpen = c), u !== void 0 && e.setDocsHighlights(u);
|
|
1418
|
-
}),
|
|
1836
|
+
}), he = h((t) => {
|
|
1419
1837
|
x.current = t;
|
|
1420
|
-
let n =
|
|
1838
|
+
let n = En(e, t);
|
|
1421
1839
|
return () => {
|
|
1422
|
-
x.current = null, typeof n == "function" ? n() :
|
|
1840
|
+
x.current = null, typeof n == "function" ? n() : En(e, null);
|
|
1423
1841
|
};
|
|
1424
1842
|
}, [e]);
|
|
1425
|
-
return
|
|
1843
|
+
return g(() => {
|
|
1426
1844
|
let e = x.current;
|
|
1427
|
-
if (e) return e.addEventListener("open",
|
|
1428
|
-
e.removeEventListener("open",
|
|
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);
|
|
1429
1847
|
};
|
|
1430
|
-
}, []),
|
|
1848
|
+
}, []), g(() => {
|
|
1431
1849
|
let e = x.current;
|
|
1432
1850
|
e && (e.readOnly = s);
|
|
1433
|
-
}, [s]),
|
|
1851
|
+
}, [s]), g(() => {
|
|
1434
1852
|
let e = x.current;
|
|
1435
1853
|
e && l !== void 0 && (e.fontSource = l);
|
|
1436
|
-
}, [l]),
|
|
1854
|
+
}, [l]), g(() => {
|
|
1437
1855
|
let e = x.current;
|
|
1438
1856
|
e && c !== void 0 && (e.outlineOpen = c);
|
|
1439
|
-
}, [c]),
|
|
1857
|
+
}, [c]), g(() => {
|
|
1440
1858
|
let e = x.current;
|
|
1441
1859
|
e && i !== void 0 && (e.target = i);
|
|
1442
|
-
}, [i]),
|
|
1860
|
+
}, [i]), g(() => {
|
|
1443
1861
|
let e = x.current;
|
|
1444
1862
|
e && u !== void 0 && e.setDocsHighlights(u);
|
|
1445
|
-
}, [u]),
|
|
1863
|
+
}, [u]), g(() => {
|
|
1446
1864
|
let e = x.current;
|
|
1447
1865
|
if (!e) return;
|
|
1448
1866
|
if (!t) {
|
|
@@ -1451,12 +1869,12 @@ function nn({ ref: e, source: t, name: n, zoom: r, target: i, chrome: a = "none"
|
|
|
1451
1869
|
}
|
|
1452
1870
|
let r = !1;
|
|
1453
1871
|
return e.openSource(t, n).then(() => {
|
|
1454
|
-
r ||
|
|
1872
|
+
r || me(e);
|
|
1455
1873
|
}).catch(() => void 0), () => {
|
|
1456
1874
|
r = !0;
|
|
1457
1875
|
};
|
|
1458
|
-
}, [t, n]), /* @__PURE__ */
|
|
1459
|
-
ref:
|
|
1876
|
+
}, [t, n]), /* @__PURE__ */ T("f-office-docs", {
|
|
1877
|
+
ref: he,
|
|
1460
1878
|
chrome: a,
|
|
1461
1879
|
"read-only": s ? "true" : "false",
|
|
1462
1880
|
...r === void 0 ? {} : { zoom: String(r) },
|
|
@@ -1470,8 +1888,8 @@ function nn({ ref: e, source: t, name: n, zoom: r, target: i, chrome: a = "none"
|
|
|
1470
1888
|
display: "block",
|
|
1471
1889
|
width: "100%",
|
|
1472
1890
|
height: "100%",
|
|
1473
|
-
...
|
|
1891
|
+
...p
|
|
1474
1892
|
}
|
|
1475
1893
|
});
|
|
1476
1894
|
}
|
|
1477
|
-
export {
|
|
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 };
|