@eigenpal/docx-js-editor 0.0.32 → 0.0.33
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 +10 -2
- package/dist/FindReplaceDialog-KNJETYJX.js +1 -0
- package/dist/{FindReplaceDialog-N4J5OB7O.mjs → FindReplaceDialog-YW3R4FHM.mjs} +1 -1
- package/dist/FootnotePropertiesDialog-7QX54WQT.js +1 -0
- package/dist/FootnotePropertiesDialog-LNFJXQUG.mjs +1 -0
- package/dist/HyperlinkDialog-GBAYMTUE.js +1 -0
- package/dist/{HyperlinkDialog-YQSQFHOP.mjs → HyperlinkDialog-HNYTXDCB.mjs} +1 -1
- package/dist/ImagePositionDialog-B4RLP2W5.mjs +1 -0
- package/dist/ImagePositionDialog-M65BYQQE.js +1 -0
- package/dist/ImagePropertiesDialog-JOGW3WDU.mjs +1 -0
- package/dist/ImagePropertiesDialog-O4WQSF5M.js +1 -0
- package/dist/PageSetupDialog-2GIBTKMJ.js +1 -0
- package/dist/PageSetupDialog-Q7SHEZIJ.mjs +1 -0
- package/dist/TablePropertiesDialog-LMXWX3FI.mjs +1 -0
- package/dist/TablePropertiesDialog-WOZ4ES3H.js +1 -0
- package/dist/chunk-377ZVTSE.js +2 -0
- package/dist/chunk-3OKYQQQ5.js +111 -0
- package/dist/chunk-AU5NVRHP.js +2 -0
- package/dist/chunk-DC65PJYE.js +4 -0
- package/dist/chunk-FW5LYOOZ.mjs +111 -0
- package/dist/chunk-GZOCOWWB.mjs +2 -0
- package/dist/chunk-N6RUBUT2.js +261 -0
- package/dist/chunk-QSUPYUOP.js +2 -0
- package/dist/chunk-SZHPMPSO.mjs +261 -0
- package/dist/chunk-X5A54T6S.mjs +4 -0
- package/dist/chunk-YKBSKEBS.mjs +2 -0
- package/dist/chunk-Z26WOH6R.mjs +2 -0
- package/dist/clipboard-Cu80iVDh.d.ts +1181 -0
- package/dist/clipboard-dFROLI95.d.mts +1181 -0
- package/dist/index.css +1 -1
- package/dist/index.d.mts +15 -5
- package/dist/index.d.ts +15 -5
- package/dist/index.js +9 -9
- package/dist/index.mjs +9 -9
- package/dist/{react-CAc4htNH.d.ts → react-1nBq3zH9.d.ts} +3 -1
- package/dist/{react-B2h6vE3D.d.mts → react-Dr8Nm-0u.d.mts} +3 -1
- package/dist/react.css +1 -1
- package/dist/react.d.mts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +1 -1
- package/dist/react.mjs +1 -1
- package/dist/ui.d.mts +22 -20
- package/dist/ui.d.ts +22 -20
- package/dist/ui.js +1 -1
- package/dist/ui.mjs +1 -1
- package/i18n/de.json +745 -0
- package/i18n/en.json +745 -0
- package/i18n/pl.json +745 -0
- package/package.json +5 -3
- package/dist/FindReplaceDialog-AQFR4OCT.js +0 -1
- package/dist/FootnotePropertiesDialog-UFUIHLDW.mjs +0 -1
- package/dist/FootnotePropertiesDialog-YYIZU5U6.js +0 -1
- package/dist/HyperlinkDialog-HGZ2S37Z.js +0 -1
- package/dist/ImagePositionDialog-DQ4JWS4F.js +0 -1
- package/dist/ImagePositionDialog-HT6J2SHV.mjs +0 -1
- package/dist/ImagePropertiesDialog-3VK2S2AF.mjs +0 -1
- package/dist/ImagePropertiesDialog-GJMGLM6G.js +0 -1
- package/dist/PageSetupDialog-2SKHDRTF.js +0 -1
- package/dist/PageSetupDialog-SMQJXEBL.mjs +0 -1
- package/dist/TablePropertiesDialog-FI5E3RCB.mjs +0 -1
- package/dist/TablePropertiesDialog-STZOGHJB.js +0 -1
- package/dist/chunk-6AJI5NPH.mjs +0 -111
- package/dist/chunk-AZRYS2WF.mjs +0 -2
- package/dist/chunk-CTYOM6BE.js +0 -2
- package/dist/chunk-EEV6TUOX.mjs +0 -261
- package/dist/chunk-EF3LLEN7.js +0 -4
- package/dist/chunk-HWWZOJMR.mjs +0 -4
- package/dist/chunk-PJVI53AH.js +0 -2
- package/dist/chunk-UMDJQ3Q4.js +0 -111
- package/dist/chunk-WH2EK2HU.js +0 -261
- package/dist/chunk-XWBCP563.mjs +0 -2
- package/dist/clipboard-B7N7Kx2X.d.ts +0 -386
- package/dist/clipboard-BkM7Zvgs.d.mts +0 -386
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import {b}from'./chunk-GZOCOWWB.mjs';import {p,a,b as b$2}from'./chunk-QAZ4233N.mjs';import {a as a$1,b as b$1,k}from'./chunk-LYBG4YI7.mjs';import*as ee from'react';import ee__default,{createContext,useRef,useState,useEffect,useCallback,useMemo,useContext}from'react';import*as q from'@radix-ui/react-select';import {clsx}from'clsx';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function L(...e){return clsx(e)}var Ie=q.Root,Fe=q.Group,at=q.Value;function Me({className:e,children:t,onMouseDown:o,...n}){return jsxs(q.Trigger,{className:L("flex h-8 items-center justify-between gap-1 rounded px-2 py-1","text-sm text-slate-700 bg-transparent","hover:bg-slate-100/80 focus:outline-none focus:bg-slate-100/80","disabled:cursor-not-allowed disabled:opacity-50","transition-colors duration-150","[&>span]:truncate",e),onMouseDown:r=>{r.preventDefault(),o?.(r);},...n,children:[t,jsx(q.Icon,{asChild:true,children:jsx(vn,{className:"h-4 w-4 text-slate-400 shrink-0"})})]})}function Pe({className:e,children:t,position:o="popper",onCloseAutoFocus:n,...r}){return jsx(q.Portal,{children:jsx("div",{className:"ep-root",children:jsx(q.Content,{className:L("relative z-50 max-h-72 min-w-[8rem] overflow-hidden","rounded-lg border border-slate-200 bg-white shadow-lg","data-[state=open]:animate-in data-[state=closed]:animate-out","data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0","data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95","data-[side=bottom]:slide-in-from-top-2 data-[side=top]:slide-in-from-bottom-2",o==="popper"&&"data-[side=bottom]:translate-y-1 data-[side=top]:-translate-y-1",e),position:o,onCloseAutoFocus:l=>{l.preventDefault(),n?.(l);},...r,children:jsx(q.Viewport,{className:L("p-1",o==="popper"&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),onMouseDown:l=>l.preventDefault(),children:t})})})})}function Be({className:e,...t}){return jsx(q.Label,{className:L("px-2 py-1.5 text-xs font-medium text-slate-500",e),...t})}function me({className:e,children:t,onMouseDown:o,...n}){return jsxs(q.Item,{className:L("relative flex w-full cursor-pointer select-none items-center","rounded px-2 py-1.5 text-sm text-slate-700 outline-none","hover:bg-slate-100 focus:bg-slate-100","data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),onMouseDown:r=>{r.preventDefault(),o?.(r);},...n,children:[jsx(q.ItemText,{children:t}),jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:jsx(q.ItemIndicator,{children:jsx(xn,{className:"h-4 w-4"})})})]})}function Xe({className:e,...t}){return jsx(q.Separator,{className:L("-mx-1 my-1 h-px bg-slate-100",e),...t})}function vn({className:e}){return jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:jsx("path",{fillRule:"evenodd",d:"M5.23 7.21a.75.75 0 011.06.02L10 11.168l3.71-3.938a.75.75 0 111.08 1.04l-4.25 4.5a.75.75 0 01-1.08 0l-4.25-4.5a.75.75 0 01.02-1.06z",clipRule:"evenodd"})})}function xn({className:e}){return jsx("svg",{className:e,xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor",children:jsx("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 01.143 1.052l-8 10.5a.75.75 0 01-1.127.075l-4.5-4.5a.75.75 0 011.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 011.05-.143z",clipRule:"evenodd"})})}var yn=[{name:"Arial",fontFamily:"Arial, Helvetica, sans-serif",category:"sans-serif"},{name:"Calibri",fontFamily:'"Calibri", Arial, sans-serif',category:"sans-serif"},{name:"Helvetica",fontFamily:"Helvetica, Arial, sans-serif",category:"sans-serif"},{name:"Verdana",fontFamily:"Verdana, Geneva, sans-serif",category:"sans-serif"},{name:"Open Sans",fontFamily:'"Open Sans", sans-serif',category:"sans-serif"},{name:"Roboto",fontFamily:"Roboto, sans-serif",category:"sans-serif"},{name:"Times New Roman",fontFamily:'"Times New Roman", Times, serif',category:"serif"},{name:"Georgia",fontFamily:"Georgia, serif",category:"serif"},{name:"Cambria",fontFamily:"Cambria, Georgia, serif",category:"serif"},{name:"Garamond",fontFamily:"Garamond, serif",category:"serif"},{name:"Courier New",fontFamily:'"Courier New", Courier, monospace',category:"monospace"},{name:"Consolas",fontFamily:"Consolas, monospace",category:"monospace"}];function ro({value:e,onChange:t,fonts:o=yn,disabled:n=false,className:r,placeholder:l="Arial",width:s=120,showPreview:p=true}){let{t:m}=b(),a=ee.useMemo(()=>e?o.find(h=>h.fontFamily===e||h.name.toLowerCase()===e.toLowerCase())?.name||e:l,[e,o,l]),c=ee.useCallback(d=>{let h=o.find(b=>b.name===d);h&&t?.(h.fontFamily);},[t,o]),u=ee.useMemo(()=>{let d={"sans-serif":[],serif:[],monospace:[],other:[]};return o.forEach(h=>{let b=h.category||"other";d[b].push(h);}),d},[o]);return jsxs(Ie,{value:a,onValueChange:c,disabled:n,children:[jsx(Me,{className:L("h-8 text-sm",r),style:{minWidth:typeof s=="number"?`${s}px`:s},"aria-label":m("font.selectAriaLabel"),children:jsx(at,{placeholder:l,children:a})}),jsxs(Pe,{className:"max-h-[300px]",children:[u["sans-serif"].length>0&&jsxs(Fe,{children:[jsx(Be,{children:m("font.sansSerif")}),u["sans-serif"].map(d=>jsx(me,{value:d.name,style:p?{fontFamily:d.fontFamily}:void 0,children:d.name},d.name))]}),u.serif.length>0&&jsxs(Fragment,{children:[jsx(Xe,{}),jsxs(Fe,{children:[jsx(Be,{children:m("font.serif")}),u.serif.map(d=>jsx(me,{value:d.name,style:p?{fontFamily:d.fontFamily}:void 0,children:d.name},d.name))]})]}),u.monospace.length>0&&jsxs(Fragment,{children:[jsx(Xe,{}),jsxs(Fe,{children:[jsx(Be,{children:m("font.monospace")}),u.monospace.map(d=>jsx(me,{value:d.name,style:p?{fontFamily:d.fontFamily}:void 0,children:d.name},d.name))]})]})]})]})}var ao=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,io=clsx,lo=(e,t)=>o=>{var n;if(t?.variants==null)return io(e,o?.class,o?.className);let{variants:r,defaultVariants:l}=t,s=Object.keys(r).map(a=>{let c=o?.[a],u=l?.[a];if(c===null)return null;let d=ao(c)||ao(u);return r[a][d]}),p=o&&Object.entries(o).reduce((a,c)=>{let[u,d]=c;return d===void 0||(a[u]=d),a},{}),m=t==null||(n=t.compoundVariants)===null||n===void 0?void 0:n.reduce((a,c)=>{let{class:u,className:d,...h}=c;return Object.entries(h).every(b=>{let[f,x]=b;return Array.isArray(x)?x.includes({...l,...p}[f]):{...l,...p}[f]===x})?[...a,u,d]:a},[]);return io(e,s,m,o?.class,o?.className)};var Cn=lo("inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50",{variants:{variant:{default:"bg-primary text-primary-foreground hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-background hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-9 w-9","icon-sm":"h-7 w-7"}},defaultVariants:{variant:"default",size:"default"}}),G=ee.forwardRef(({className:e,variant:t,size:o,...n},r)=>jsx("button",{className:L(Cn({variant:t,size:o,className:e})),ref:r,...n}));G.displayName="Button";function g({size:e=20,className:t="",style:o,children:n}){return jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:e,height:e,viewBox:"0 -960 960 960",fill:"currentColor",className:t,style:{display:"inline-flex",flexShrink:0,...o},"aria-hidden":"true",children:n})}function wn(e){return jsx(g,{...e,children:jsx("path",{d:"M280-200v-80h284q63 0 109.5-40T720-420q0-60-46.5-100T564-560H312l104 104-56 56-200-200 200-200 56 56-104 104h252q97 0 166.5 63T800-420q0 94-69.5 157T564-200H280Z"})})}function In(e){return jsx(g,{...e,children:jsx("path",{d:"M396-200q-97 0-166.5-63T160-420q0-94 69.5-157T396-640h252L544-744l56-56 200 200-200 200-56-56 104-104H396q-63 0-109.5 40T240-420q0 60 46.5 100T396-280h284v80H396Z"})})}function Mn(e){return jsx(g,{...e,children:jsx("path",{d:"M640-640v-120H320v120h-80v-200h480v200h-80Zm-480 80h640-640Zm560 100q17 0 28.5-11.5T760-500q0-17-11.5-28.5T720-540q-17 0-28.5 11.5T680-500q0 17 11.5 28.5T720-460Zm-80 260v-160H320v160h320Zm80 80H240v-160H80v-240q0-51 35-85.5t85-34.5h560q51 0 85.5 34.5T880-520v240H720v160Zm80-240v-160q0-17-11.5-28.5T760-560H200q-17 0-28.5 11.5T160-520v160h80v-80h480v80h80Z"})})}function Pn(e){return jsx(g,{...e,children:jsx("path",{d:"M272-200v-560h221q65 0 120 40t55 111q0 51-23 78.5T602-491q25 11 55.5 41t30.5 90q0 89-65 124.5T501-200H272Zm121-112h104q48 0 58.5-24.5T566-372q0-11-10.5-35.5T494-432H393v120Zm0-228h93q33 0 48-17t15-38q0-24-17-39t-44-15h-95v109Z"})})}function kn(e){return jsx(g,{...e,children:jsx("path",{d:"M200-200v-100h160l120-360H320v-100h400v100H580L460-300h140v100H200Z"})})}function Rn(e){return jsx(g,{...e,children:jsx("path",{d:"M200-120v-80h560v80H200Zm123-223q-56-63-56-167v-330h103v336q0 56 28 91t82 35q54 0 82-35t28-91v-336h103v330q0 104-56 167t-157 63q-101 0-157-63Z"})})}function Zn(e){return jsx(g,{...e,children:jsx("path",{d:"M486-160q-76 0-135-45t-85-123l88-38q14 48 48.5 79t85.5 31q42 0 76-20t34-64q0-18-7-33t-19-27h112q5 14 7.5 28.5T694-340q0 86-61.5 133T486-160ZM80-480v-80h800v80H80Zm402-326q66 0 115.5 32.5T674-674l-88 39q-9-29-33.5-52T484-710q-41 0-68 18.5T386-640h-96q2-69 54.5-117.5T482-806Z"})})}function Ln(e){return jsx(g,{...e,children:jsx("path",{d:"M760-600v-80q0-17 11.5-28.5T800-720h80v-40H760v-40h120q17 0 28.5 11.5T920-760v40q0 17-11.5 28.5T880-680h-80v40h120v40H760ZM235-160l185-291-172-269h106l124 200h4l123-200h107L539-451l186 291H618L482-377h-4L342-160H235Z"})})}function Hn(e){return jsx(g,{...e,children:jsx("path",{d:"M760-160v-80q0-17 11.5-28.5T800-280h80v-40H760v-40h120q17 0 28.5 11.5T920-320v40q0 17-11.5 28.5T880-240h-80v40h120v40H760Zm-525-80 185-291-172-269h106l124 200h4l123-200h107L539-531l186 291H618L482-457h-4L342-240H235Z"})})}function An(e){return jsx(g,{...e,children:jsx("path",{d:"M440-280H280q-83 0-141.5-58.5T80-480q0-83 58.5-141.5T280-680h160v80H280q-50 0-85 35t-35 85q0 50 35 85t85 35h160v80ZM320-440v-80h320v80H320Zm200 160v-80h160q50 0 85-35t35-85q0-50-35-85t-85-35H520v-80h160q83 0 141.5 58.5T880-480q0 83-58.5 141.5T680-280H520Z"})})}function En(e){return jsx(g,{...e,children:jsx("path",{d:"m528-546-93-93-121-121h486v120H568l-40 94ZM792-56 460-388l-80 188H249l119-280L56-792l56-56 736 736-56 56Z"})})}function qn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Zm0-160v-80h480v80H120Zm0-160v-80h720v80H120Z"})})}function _n(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm160-160v-80h400v80H280ZM120-440v-80h720v80H120Zm160-160v-80h400v80H280ZM120-760v-80h720v80H120Z"})})}function Dn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-760v-80h720v80H120Zm240 160v-80h480v80H360ZM120-440v-80h720v80H120Zm240 160v-80h480v80H360ZM120-120v-80h720v80H120Z"})})}function Nn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Zm0-160v-80h720v80H120Z"})})}function Ht(e){return jsx(g,{...e,children:jsx("path",{d:"M240-160 80-320l56-56 64 62v-332l-64 62-56-56 160-160 160 160-56 56-64-62v332l64-62 56 56-160 160Zm240-40v-80h400v80H480Zm0-240v-80h400v80H480Zm0-240v-80h400v80H480Z"})})}function Fn(e){return jsx(g,{...e,children:jsx("path",{d:"M360-200v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360ZM200-160q-33 0-56.5-23.5T120-240q0-33 23.5-56.5T200-320q33 0 56.5 23.5T280-240q0 33-23.5 56.5T200-160Zm0-240q-33 0-56.5-23.5T120-480q0-33 23.5-56.5T200-560q33 0 56.5 23.5T280-480q0 33-23.5 56.5T200-400Zm-56.5-263.5Q120-687 120-720t23.5-56.5Q167-800 200-800t56.5 23.5Q280-753 280-720t-23.5 56.5Q233-640 200-640t-56.5-23.5Z"})})}function Bn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-80v-60h100v-30h-60v-60h60v-30H120v-60h120q17 0 28.5 11.5T280-280v40q0 17-11.5 28.5T240-200q17 0 28.5 11.5T280-160v40q0 17-11.5 28.5T240-80H120Zm0-280v-110q0-17 11.5-28.5T160-510h60v-30H120v-60h120q17 0 28.5 11.5T280-560v70q0 17-11.5 28.5T240-450h-60v30h100v60H120Zm60-280v-180h-60v-60h120v240h-60Zm180 440v-80h480v80H360Zm0-240v-80h480v80H360Zm0-240v-80h480v80H360Z"})})}function On(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm0 440v-320l160 160-160 160Z"})})}function zn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm320-160v-80h400v80H440Zm0-160v-80h400v80H440Zm0-160v-80h400v80H440ZM120-760v-80h720v80H120Zm160 440L120-480l160-160v320Z"})})}function Kn(e){return jsx(g,{...e,children:jsx("path",{d:"M80 0v-160h800V0H80Zm140-280 210-560h100l210 560h-96l-50-144H368l-52 144h-96Zm176-224h168l-82-232h-4l-82 232Z"})})}function Wn(e){return jsx(g,{...e,children:jsx("path",{d:"M544-400 440-504 240-304l104 104 200-200Zm-47-161 104 104 199-199-104-104-199 199Zm-84-28 216 216-229 229q-24 24-56 24t-56-24l-2-2-26 26H60l126-126-2-2q-24-24-24-56t24-56l229-229Zm0 0 227-227q24-24 56-24t56 24l104 104q24 24 24 56t-24 56L629-373 413-589Z"})})}function Vn(e){return jsx(g,{...e,children:jsx("path",{d:"M800-436q0 36-8 69t-22 63l-62-60q6-17 9-34.5t3-37.5q0-47-17.5-89T650-600L480-768l-88 86-56-56 144-142 226 222q44 42 69 99.5T800-436Zm-8 380L668-180q-41 29-88 44.5T480-120q-133 0-226.5-92.5T160-436q0-51 16-98t48-90L56-792l56-56 736 736-56 56ZM480-200q36 0 68.5-10t61.5-28L280-566q-21 32-30.5 64t-9.5 66q0 98 70 167t170 69Zm-37-204Zm110-116Z"})})}function $n(e){return jsx(g,{...e,children:jsx("path",{d:"M480-360 280-560h400L480-360Z"})})}function Gn(e){return jsx(g,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm240-240H200v160h240v-160Zm80 0v160h240v-160H520Zm-80-80v-160H200v160h240Zm80 0h240v-160H520v160ZM200-680h560v-80H200v80Z"})})}function Un(e){return jsx(g,{...e,children:jsx("path",{d:"M760-120H200q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120ZM200-640h560v-120H200v120Zm100 80H200v360h100v-360Zm360 0v360h100v-360H660Zm-80 0H380v360h200v-360Z"})})}function Yn(e){return jsx(g,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133ZM200-413h133v-134H200v134Zm213 0h134v-134H413v134Zm214 0h133v-134H627v134ZM200-627h133v-133H200v133Zm213 0h134v-133H413v133Zm214 0h133v-133H627v133Z"})})}function jn(e){return jsx(g,{...e,children:jsx("path",{d:"M760-200v-120H200v120h560Zm0-200v-160H200v160h560Zm0-240v-120H200v120h560ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Z"})})}function Xn(e){return jsx(g,{...e,children:jsx("path",{d:"M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z"})})}function Jn(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-720h720v720H120Zm640-80v-240H520v240h240Zm0-560H520v240h240v-240Zm-560 0v240h240v-240H200Zm0 560h240v-240H200v240Z"})})}function Qn(e){return jsx(g,{...e,children:jsx("path",{d:"M200-200h560v-560H200v560Zm-80 80v-720h720v720H120Zm160-320v-80h80v80h-80Zm160 160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 160v-80h80v80h-80Z"})})}function er(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-640v-80h80v80h-80Zm320 640v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm-160 0v-80h80v80h-80ZM440-120v-320H120v-80h320v-320h80v320h320v80H520v320h-80Z"})})}function tr(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function or(e){return jsx(g,{...e,children:jsx("path",{d:"M440-440H200v-80h240v-240h80v240h240v80H520v240h-80v-240Z"})})}function nr(e){return jsx(g,{...e,children:jsx("path",{d:"M200-440v-80h560v80H200Z"})})}function rr(e){return jsx(g,{...e,children:jsx("path",{d:"M280-120q-33 0-56.5-23.5T200-200v-520h-40v-80h200v-40h240v40h200v80h-40v520q0 33-23.5 56.5T680-120H280Zm400-600H280v520h400v-520ZM360-280h80v-360h-80v360Zm160 0h80v-360h-80v360ZM280-720v520-520Z"})})}function ar(e){return jsx(g,{...e,children:jsx("path",{d:"M600-240v-80h160v80H600Zm0-320v-80h280v80H600Zm0 160v-80h240v80H600ZM120-640H80v-80h160v-60h160v60h160v80h-40v360q0 33-23.5 56.5T440-200H200q-33 0-56.5-23.5T120-280v-360Zm80 0v360h240v-360H200Zm0 0v360-360Z"})})}function ir(e){return jsx(g,{...e,children:jsx("path",{d:"m296-160-56-56 200-200v-269L337-582l-57-57 200-200 201 201-57 57-104-104v301L296-160Zm368 1L536-286l57-57 127 128-56 56Z"})})}function lr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-160v-304L240-664v104h-80v-240h240v80H296l224 224v336h-80Zm154-376-58-58 128-126H560v-80h240v240h-80v-104L594-536Z"})})}function sr(e){return jsx(g,{...e,children:jsx("path",{d:"M360-160q-33 0-56.5-23.5T280-240q0-33 23.5-56.5T360-320q33 0 56.5 23.5T440-240q0 33-23.5 56.5T360-160Zm240 0q-33 0-56.5-23.5T520-240q0-33 23.5-56.5T600-320q33 0 56.5 23.5T680-240q0 33-23.5 56.5T600-160ZM360-400q-33 0-56.5-23.5T280-480q0-33 23.5-56.5T360-560q33 0 56.5 23.5T440-480q0 33-23.5 56.5T360-400Zm240 0q-33 0-56.5-23.5T520-480q0-33 23.5-56.5T600-560q33 0 56.5 23.5T680-480q0 33-23.5 56.5T600-400ZM360-640q-33 0-56.5-23.5T280-720q0-33 23.5-56.5T360-800q33 0 56.5 23.5T440-720q0 33-23.5 56.5T360-640Zm240 0q-33 0-56.5-23.5T520-720q0-33 23.5-56.5T600-800q33 0 56.5 23.5T680-720q0 33-23.5 56.5T600-640Z"})})}function cr(e){return jsx(g,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm40-80h480L570-480 450-320l-90-120-120 160Zm-40 80v-560 560Z"})})}function ur(e){return jsx(g,{...e,children:jsx("path",{d:"M120-280v-400h400v400H120Zm80-80h240v-240H200v240Zm-80-400v-80h720v80H120Zm480 160v-80h240v80H600Zm0 160v-80h240v80H600Zm0 160v-80h240v80H600ZM120-120v-80h720v80H120Z"})})}function dr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-280v-400h400v400H440Zm80-80h240v-240H520v240ZM120-120v-80h720v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h240v80H120Zm0-160v-80h720v80H120Z"})})}function pr(e){return jsx(g,{...e,children:jsx("path",{d:"M160-440v-80h640v80H160Z"})})}function mr(e){return jsx(g,{...e,children:jsx("path",{d:"M200-120q-33 0-56.5-23.5T120-200v-480h80v480h480v80H200Zm160-240v80q-33 0-56.5-23.5T280-360h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm80-160h-80q0-33 23.5-56.5T360-840v80Zm80 480v-80h80v80h-80Zm0-480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm0 480v-80h80v80h-80Zm160-480v-80q33 0 56.5 23.5T840-760h-80Zm0 400h80q0 33-23.5 56.5T760-280v-80Zm0-80v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function hr(e){return jsx(g,{...e,children:jsx("path",{d:"M360-280q-33 0-56.5-23.5T280-360v-400q0-33 23.5-56.5T360-840h400q33 0 56.5 23.5T840-760v400q0 33-23.5 56.5T760-280H360Zm0-80h400v-400H360v400ZM200-200v80q-33 0-56.5-23.5T120-200h80Zm-80-80v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"})})}function fr(e){return jsx(g,{...e,children:jsx("path",{d:"M480-80 310-250l57-57 73 73v-166h80v165l72-73 58 58L480-80ZM250-310 80-480l169-169 57 57-72 72h166v80H235l73 72-58 58Zm460 0-57-57 73-73H560v-80h165l-73-72 58-58 170 170-170 170ZM440-560v-166l-73 73-57-57 170-170 170 170-57 57-73-73v166h-80Z"})})}function gr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-120v-240h80v80h320v80H520v80h-80Zm-320-80v-80h240v80H120Zm160-160v-80H120v-80h160v-80h80v240h-80Zm160-80v-80h400v80H440Zm160-160v-240h80v80h160v80H680v80h-80Zm-480-80v-80h400v80H120Z"})})}function br(e){return jsx(g,{...e,children:jsx("path",{d:"M522-80v-82q34-5 66.5-18t61.5-34l56 58q-42 32-88 51.5T522-80Zm-80 0Q304-98 213-199.5T122-438q0-75 28.5-140.5t77-114q48.5-48.5 114-77T482-798h6l-62-62 56-58 160 160-160 160-56-56 64-64h-8q-117 0-198.5 81.5T202-438q0 104 68 182.5T442-162v82Zm322-134-58-56q21-29 34-61.5t18-66.5h82q-5 50-24.5 96T764-214Zm76-264h-82q-5-34-18-66.5T706-606l58-56q32 39 51 86t25 98Z"})})}function vr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-80q-50-5-96-24.5T256-156l56-58q29 21 61.5 34t66.5 18v82Zm80 0v-82q104-15 172-93.5T760-438q0-117-81.5-198.5T480-718h-8l64 64-56 56-160-160 160-160 56 58-62 62h6q75 0 140.5 28.5t114 77q48.5 48.5 77 114T840-438q0 137-91 238.5T520-80ZM198-214q-32-42-51.5-88T122-398h82q5 34 18 66.5t34 61.5l-58 56Zm-76-264q6-51 25-98t51-86l58 56q-21 29-34 61.5T204-478h-82Z"})})}function xr(e){return jsx(g,{...e,children:jsx("path",{d:"M280-160 80-360l200-200 56 57-103 103h287v80H233l103 103-56 57Zm400-240-56-57 103-103H440v-80h287L624-743l56-57 200 200-200 200Z"})})}function yr(e){return jsx(g,{...e,children:jsx("path",{d:"M320-440v-287L217-624l-57-56 200-200 200 200-57 56-103-103v287h-80ZM600-80 400-280l57-56 103 103v-287h80v287l103-103 57 56L600-80Z"})})}function Tr(e){return jsx(g,{...e,children:jsx("path",{d:"M600-360ZM320-242q10 1 19.5 1.5t20.5.5q11 0 20.5-.5T400-242v82h400v-400h-82q1-10 1.5-19.5t.5-20.5q0-11-.5-20.5T718-640h82q33 0 56.5 23.5T880-560v400q0 33-23.5 56.5T800-80H400q-33 0-56.5-23.5T320-160v-82Zm40-78q-117 0-198.5-81.5T80-600q0-117 81.5-198.5T360-880q117 0 198.5 81.5T640-600q0 117-81.5 198.5T360-320Zm0-80q83 0 141.5-58.5T560-600q0-83-58.5-141.5T360-800q-83 0-141.5 58.5T160-600q0 83 58.5 141.5T360-400Zm0-200Z"})})}function Cr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-80q-33 0-56.5-23.5T360-160v-160H240q-33 0-56.5-23.5T160-400v-280q0-66 47-113t113-47h480v440q0 33-23.5 56.5T720-320H600v160q0 33-23.5 56.5T520-80h-80ZM240-560h480v-200h-40v160h-80v-160h-40v80h-80v-80H320q-33 0-56.5 23.5T240-680v120Zm0 160h480v-80H240v80Zm0 0v-80 80Z"})})}function Sr(e){return jsx(g,{...e,children:jsx("path",{d:"M480-345 240-585l56-56 184 184 184-184 56 56-240 240Z"})})}function wr(e){return jsx(g,{...e,children:jsx("path",{d:"m296-345-56-56 240-240 240 240-56 56-184-184-184 184Z"})})}function Ir(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h720v80H120Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function Mr(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h720v80H120Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 480v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function Pr(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-720h80v720h-80Zm160 0v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Z"})})}function kr(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm0-160v-80h80v80h-80Zm160 640v-80h80v80h-80Zm0-320v-80h80v80h-80Zm0-320v-80h80v80h-80Zm160 640v-720h80v720h-80Z"})})}function Rr(e){return jsx(g,{...e,children:jsx("path",{d:"M320-600q17 0 28.5-11.5T360-640q0-17-11.5-28.5T320-680q-17 0-28.5 11.5T280-640q0 17 11.5 28.5T320-600Zm160 0q17 0 28.5-11.5T520-640q0-17-11.5-28.5T480-680q-17 0-28.5 11.5T440-640q0 17 11.5 28.5T480-600Zm160 0q17 0 28.5-11.5T680-640q0-17-11.5-28.5T640-680q-17 0-28.5 11.5T600-640q0 17 11.5 28.5T640-600ZM200-120q-33 0-56.5-23.5T120-200v-560q0-33 23.5-56.5T200-840h560q33 0 56.5 23.5T840-760v560q0 33-23.5 56.5T760-120H200Zm0-80h560v-560H200v560Zm0-560v560-560Z"})})}function Zr(e){return jsx(g,{...e,children:jsx("path",{d:"M160-200v-80h528l-42-42 56-56 138 138-138 138-56-56 42-42H160Zm116-200 164-440h80l164 440h-76l-38-112H392l-40 112h-76Zm138-176h132l-64-182h-4l-64 182Z"})})}function Lr(e){return jsx(g,{...e,children:jsx("path",{d:"M588-132 440-280l148-148 56 58-50 50h96q29 0 49.5-20.5T760-390q0-29-20.5-49.5T690-460H160v-80h530q63 0 106.5 43.5T840-390q0 63-43.5 106.5T690-240h-96l50 50-56 58ZM160-240v-80h200v80H160Zm0-440v-80h640v80H160Z"})})}function Hr(e){return jsx(g,{...e,children:jsx("path",{d:"M480-120 320-280l56-56 64 63v-414l-64 63-56-56 160-160 160 160-56 57-64-64v414l64-63 56 56-160 160Z"})})}function Ar(e){return jsx(g,{...e,children:jsx("path",{d:"M120-120v-720h80v720h-80Zm640 0v-720h80v720h-80ZM280-440v-80h80v80h-80Zm160 0v-80h80v80h-80Zm160 0v-80h80v80h-80Z"})})}function Er(e){return jsx(g,{...e,children:jsx("path",{d:"m370-80-16-128q-13-5-24.5-12T307-235l-119 50L78-375l103-78q-1-7-1-13.5v-27q0-6.5 1-13.5L78-585l110-190 119 50q11-8 23-15t24-12l16-128h220l16 128q13 5 24.5 12t22.5 15l119-50 110 190-103 78q1 7 1 13.5v27q0 6.5-2 13.5l103 78-110 190-118-50q-11 8-23 15t-24 12L590-80H370Zm70-80h79l14-106q31-8 57.5-23.5T639-327l99 41 39-68-86-65q5-14 7-29.5t2-31.5q0-16-2-31.5t-7-29.5l86-65-39-68-99 42q-22-23-48.5-38.5T533-694l-13-106h-79l-14 106q-31 8-57.5 23.5T321-633l-99-41-39 68 86 64q-5 15-7 30t-2 32q0 16 2 31t7 30l-86 65 39 68 99-42q22 23 48.5 38.5T427-266l13 106Zm42-180q58 0 99-41t41-99q0-58-41-99t-99-41q-59 0-99.5 41T342-480q0 58 40.5 99t99.5 41Zm-2-140Z"})})}function qr(e){return jsx(g,{...e,children:jsx("path",{d:"M80 0v-160h800V0H80Zm160-320h56l312-311-29-29-28-28-311 312v56Zm-80 80v-170l448-447q11-11 25.5-17t30.5-6q16 0 31 6t27 18l55 56q12 11 17.5 26t5.5 31q0 15-5.5 29.5T777-687L330-240H160Zm560-504-56-56 56 56ZM608-631l-29-29-28-28 57 57Z"})})}function _r(e){return jsx(g,{...e,children:jsx("path",{d:"m247-904 57-56 343 343q23 23 23 57t-23 57L457-313q-23 23-57 23t-57-23L153-503q-23-23-23-57t23-57l190-191-96-96Zm153 153L209-560h382L400-751Zm360 471q-33 0-56.5-23.5T680-360q0-21 12.5-45t27.5-45q9-12 19-25t21-25q11 12 21 25t19 25q15 21 27.5 45t12.5 45q0 33-23.5 56.5T760-280ZM80 0v-160h800V0H80Z"})})}function Dr(e){return jsx(g,{...e,children:jsx("path",{d:"M160-760v-80h640v80H160Zm280 640v-408L336-424l-56-56 200-200 200 200-56 56-104-104v408h-80Z"})})}function Nr(e){return jsx(g,{...e,children:jsx("path",{d:"M440-80v-168l-64 64-56-56 160-160 160 160-56 56-64-64v168h-80ZM160-440v-80h640v80H160Zm320-120L320-720l56-56 64 64v-168h80v168l64-64 56 56-160 160Z"})})}function Fr(e){return jsx(g,{...e,children:jsx("path",{d:"M160-120v-80h640v80H160Zm320-160L280-480l56-56 104 104v-408h80v408l104-104 56 56-200 200Z"})})}function Br(e){return jsx(g,{...e,children:jsx("path",{d:"M120-160v-40h720v40H120Zm0-120v-80h720v80H120Zm0-160v-120h720v120H120Zm0-200v-160h720v160H120Z"})})}function Or(e){return jsx(g,{...e,children:jsx("path",{d:"M480-528 296-344l-56-56 240-240 240 240-56 56-184-184Z"})})}function zr(e){return jsx(g,{...e,children:jsx("path",{d:"M480-344 240-584l56-56 184 184 184-184 56 56-240 240Z"})})}function Kr(e){return jsx(g,{...e,children:jsx("path",{d:"M560-240 320-480l240-240 56 56-184 184 184 184-56 56Z"})})}function Wr(e){return jsx(g,{...e,children:jsx("path",{d:"M504-480 320-664l56-56 240 240-240 240-56-56 184-184Z"})})}function Vr(e){return jsx(g,{...e,children:jsx("path",{d:"M480-160q-33 0-56.5-23.5T400-240q0-33 23.5-56.5T480-320q33 0 56.5 23.5T560-240q0 33-23.5 56.5T480-160Zm0-240q-33 0-56.5-23.5T400-480q0-33 23.5-56.5T480-560q33 0 56.5 23.5T560-480q0 33-23.5 56.5T480-400Zm0-240q-33 0-56.5-23.5T400-720q0-33 23.5-56.5T480-800q33 0 56.5 23.5T560-720q0 33-23.5 56.5T480-640Z"})})}function $r(e){return jsx(g,{...e,children:jsx("path",{d:"M120-440v-80h160v80H120Zm200 0v-80h160v80H320Zm200 0v-80h160v80H520Zm200 0v-80h120v80H720ZM240-120q-33 0-56.5-23.5T160-200v-120h80v120h480v-120h80v120q0 33-23.5 56.5T720-120H240Zm-80-520v-120q0-33 23.5-56.5T240-840h480q33 0 56.5 23.5T800-760v120h-80v-120H240v120h-80Z"})})}function Gr(e){return jsx(g,{...e,children:jsx("path",{d:"M313-440l224 224-57 56-320-320 320-320 57 56-224 224h487v80H313Z"})})}function Ur(e){return jsx(g,{...e,children:jsx("path",{d:"M268-240 42-466l57-56 170 170 56 56-57 56Zm226 0L268-466l56-57 170 170 368-368 57 57-425 424Zm0-226-57-56 198-198 57 56-198 198Z"})})}function Yr(e){return jsx(g,{...e,children:jsx("path",{d:"m424-296 282-282-56-56-226 226-114-114-56 56 170 170Zm56 216q-83 0-156-31.5T197-197q-54-54-85.5-127T80-480q0-83 31.5-156T197-763q54-54 127-85.5T480-880q83 0 156 31.5T763-763q54 54 85.5 127T880-480q0 83-31.5 156T763-197q-54 54-127 85.5T480-80Z"})})}function jr(e){return jsx(g,{...e,children:jsx("path",{d:"M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function Xr(e){return jsxs(g,{...e,children:[jsx("path",{d:"M80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"}),jsx("path",{fill:"#188038",d:"m421-380 227-227-45-45-182 182-92-91-45 45 137 136Z"})]})}function Jr(e){return jsx(g,{...e,children:jsx("path",{d:"M382-240 154-468l57-57 171 171 367-367 57 57-424 424Z"})})}function Qr(e){return jsx(g,{...e,children:jsx("path",{d:"m256-200-56-56 224-224-224-224 56-56 224 224 224-224 56 56-224 224 224 224-56 56-224-224-224 224Z"})})}function ea(e){return jsx(g,{...e,children:jsx("path",{d:"M440-400h80v-120h120v-80H520v-120h-80v120H320v80h120v120ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function ta(e){return jsx(g,{...e,children:jsx("path",{d:"M240-400h480v-80H240v80Zm0-120h480v-80H240v80Zm0-120h480v-80H240v80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function oa(e){return jsx(g,{...e,children:jsx("path",{d:"M160-400h280v-80H160v80Zm0-160h440v-80H160v80Zm0-160h440v-80H160v80Zm360 360v-123l221-220q9-9 20-13t22-4q12 0 23 4.5t20 13.5l37 37q8 9 12.5 20t4.5 22q0 11-4 22.5T863-380L643-160H520Zm300-263-37-37 37 37ZM580-220h38l121-122-18-19-19-18-122 121v38Zm141-141-19-18 37 37-18-19Z"})})}function na(e){return jsx(g,{...e,children:jsx("path",{d:"M240-400h122l200-200q9-9 13.5-20.5T580-643q0-11-5-21.5T562-684l-36-38q-9-9-20-13.5t-23-4.5q-11 0-22.5 4.5T440-722L240-522v122Zm280-243-37-37 37 37ZM300-460v-38l101-101 20 18 18 20-101 101h-38Zm121-121 18 20-38-38 20 18Zm26 181h273v-80H527l-80 80ZM80-80v-720q0-33 23.5-56.5T160-880h640q33 0 56.5 23.5T880-800v480q0 33-23.5 56.5T800-240H240L80-80Zm126-240h594v-480H160v525l46-45Zm-46 0v-480 480Z"})})}function ra(e){return jsx(g,{...e,children:jsx("path",{d:"M480-320q75 0 127.5-52.5T660-500q0-75-52.5-127.5T480-680q-75 0-127.5 52.5T300-500q0 75 52.5 127.5T480-320Zm0-72q-45 0-76.5-31.5T372-500q0-45 31.5-76.5T480-608q45 0 76.5 31.5T588-500q0 45-31.5 76.5T480-392Zm0 192q-146 0-266-81.5T40-500q54-137 174-218.5T480-800q146 0 266 81.5T920-500q-54 137-174 218.5T480-200Zm0-300Zm0 220q113 0 207.5-59.5T832-500q-50-101-144.5-160.5T480-720q-113 0-207.5 59.5T128-500q50 101 144.5 160.5T480-280Z"})})}function aa(e){return jsx(g,{...e,children:jsx("path",{d:"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm0-280v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80ZM680-80l-56-56 64-64H120v-80h568l-64-64 56-56 160 160L680-80Z"})})}function ia(e){return jsx(g,{...e,children:jsx("path",{d:"M360-360v-200q-66 0-113-47t-47-113q0-66 47-113t113-47h320v80h-80v440h-80v-440h-80v440h-80Zm-88 160 64 64-56 56-160-160 160-160 56 56-64 64h568v80H272Zm88-440v-160q-33 0-56.5 23.5T280-720q0 33 23.5 56.5T360-640Zm0-80Z"})})}var la={undo:wn,redo:In,print:Mn,format_bold:Pn,format_italic:kn,format_underlined:Rn,strikethrough_s:Zn,superscript:Ln,subscript:Hn,link:An,format_clear:En,format_align_left:qn,format_align_center:_n,format_align_right:Dn,format_align_justify:Nn,format_line_spacing:Ht,format_list_bulleted:Fn,format_list_numbered:Bn,format_indent_increase:On,format_indent_decrease:zn,format_color_text:Kn,ink_highlighter:Wn,format_color_reset:Vn,arrow_drop_down:$n,table:Gn,table_chart:Un,grid_on:Yn,table_rows:jn,view_column:Xn,border_all:Jn,border_outer:Qn,border_inner:er,border_clear:tr,add:or,remove:nr,delete:rr,delete_sweep:ar,call_merge:ir,call_split:lr,drag_indicator:sr,image:cr,format_image_left:ur,format_image_right:dr,horizontal_rule:pr,flip_to_back:mr,flip_to_front:hr,open_with:fr,tune:gr,rotate_right:br,rotate_left:vr,swap_horiz:xr,swap_vert:yr,shapes:Tr,format_paint:Cr,expand_more:Sr,expand_less:wr,border_top:Ir,border_bottom:Mr,border_left:Pr,border_right:kr,padding:Rr,text_rotation_none:Zr,wrap_text:Lr,height:Hr,fit_width:Ar,settings:Er,border_color:qr,format_color_fill:_r,vertical_align_top:Dr,vertical_align_center:Nr,vertical_align_bottom:Fr,line_weight:Br,keyboard_arrow_up:Or,keyboard_arrow_down:zr,keyboard_arrow_left:Kr,keyboard_arrow_right:Wr,more_vert:Vr,page_break:$r,arrow_back:Gr,done_all:Ur,check_circle:Yr,chat_bubble_outline:jr,chat_bubble_check:Xr,check:Jr,close:Qr,add_comment:ea,comment:ta,edit_note:oa,rate_review:na,visibility:ra,format_textdirection_l_to_r:aa,format_textdirection_r_to_l:ia};function T({name:e,size:t=20,className:o="",style:n}){let r=la[e];return r?jsx(r,{size:t,className:o,style:n}):(console.warn(`Icon not found: ${e}`),jsx("span",{className:o,style:{fontSize:t,width:t,height:t,...n},children:e}))}function Y({isOpen:e,onClose:t,align:o="left"}){let n=useRef(null),r=useRef(null),[l,s]=useState({top:0,left:0});useEffect(()=>{if(!e||!n.current)return;let a=n.current.getBoundingClientRect();o==="right"?requestAnimationFrame(()=>{if(r.current){let c=r.current.getBoundingClientRect();s({top:a.bottom+4,left:a.right-c.width});}else s({top:a.bottom+4,left:a.left});}):s({top:a.bottom+4,left:a.left});},[e,o]),useEffect(()=>{if(!e)return;let a=d=>{let h=d.target;n.current&&!n.current.contains(h)&&r.current&&!r.current.contains(h)&&t();},c=d=>{d.key==="Escape"&&t();},u=()=>t();return document.addEventListener("mousedown",a),document.addEventListener("keydown",c),window.addEventListener("scroll",u,true),()=>{document.removeEventListener("mousedown",a),document.removeEventListener("keydown",c),window.removeEventListener("scroll",u,true);}},[e,t]);let p=useCallback(a=>{a.preventDefault(),a.stopPropagation();},[]),m={position:"fixed",top:l.top,left:l.left,zIndex:1e4};return {containerRef:n,dropdownRef:r,dropdownStyle:m,handleMouseDown:p}}var pa=[8,9,10,11,12,14,16,18,20,24,28,36,48,72],ma=1,ha=400;function ho(e){return e/2}function ds(e){return e*2}function po(e,t,o){for(let n of t)if(n>e)return n;return Math.min(e+1,o)}function mo(e,t,o){for(let n=t.length-1;n>=0;n--)if(t[n]<e)return t[n];return Math.max(e-1,o)}function fo({value:e,onChange:t,sizes:o=pa,disabled:n=false,className:r,placeholder:l="11",minSize:s=ma,maxSize:p=ha}){let{t:m}=b(),[a,c]=useState(false),[u,d]=useState(""),[h,b$1]=useState(false),f=useRef(null),x=useCallback(()=>{b$1(false),c(false);},[]),{containerRef:v,dropdownRef:y,dropdownStyle:S}=Y({isOpen:h,onClose:x}),w=e??(parseInt(l,10)||11),I=e!==void 0?e.toString():l,P=useCallback(M=>{if(M.preventDefault(),n)return;let F=mo(w,o,s);t?.(F);},[w,o,s,n,t]),W=useCallback(M=>{if(M.preventDefault(),n)return;let F=po(w,o,p);t?.(F);},[w,o,p,n,t]),O=useCallback(M=>{M.preventDefault(),!n&&(c(true),d(I),b$1(true),requestAnimationFrame(()=>{f.current?.focus(),f.current?.select();}));},[n,I]),we=useCallback(M=>{d(M.target.value);},[]),ce=useCallback(()=>{c(false);let M=parseFloat(u);if(!isNaN(M)&&M>=s&&M<=p){let F=Math.round(M*2)/2;t?.(F);}},[u,s,p,t]),be=useCallback(M=>{if(M.key==="Enter")M.preventDefault(),ce(),b$1(false);else if(M.key==="Escape")c(false),b$1(false);else if(M.key==="ArrowUp"){M.preventDefault();let F=po(w,o,p);d(F.toString()),t?.(F);}else if(M.key==="ArrowDown"){M.preventDefault();let F=mo(w,o,s);d(F.toString()),t?.(F);}},[ce,w,o,p,s,t]),H=useCallback(M=>{t?.(M),b$1(false),c(false);},[t]),X=useCallback(M=>{M.target.tagName!=="INPUT"&&M.preventDefault();},[]);return jsxs("div",{ref:v,className:L("flex items-center",r),onMouseDown:X,children:[jsx(G,{variant:"ghost",size:"icon-sm",className:L("h-7 w-7 text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 rounded-r-none",n&&"opacity-30 cursor-not-allowed"),onMouseDown:P,disabled:n||w<=s,"aria-label":m("fontSize.decrease"),"data-testid":"font-size-decrease",children:jsx(T,{name:"remove",size:18})}),jsx("div",{className:"relative",children:a?jsx("input",{ref:f,type:"text",value:u,onChange:we,onBlur:ce,onKeyDown:be,className:L("h-7 w-10 text-center text-sm border border-slate-300 bg-white","focus:outline-none focus:ring-1 focus:ring-slate-400","rounded-none"),"aria-label":m("fontSize.label"),"data-testid":"font-size-input"}):jsx("button",{type:"button",onClick:O,className:L("h-7 w-10 text-center text-sm border border-slate-200 bg-white","hover:border-slate-300 hover:bg-slate-50","focus:outline-none focus:ring-1 focus:ring-slate-400","rounded-none",n&&"opacity-50 cursor-not-allowed"),disabled:n,"aria-label":m("fontSize.label"),"aria-haspopup":"listbox","aria-expanded":h,"data-testid":"font-size-display",children:I})}),h&&jsx("div",{ref:y,style:{...S,backgroundColor:"white",border:"1px solid #e2e8f0",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",maxHeight:240,overflowY:"auto",minWidth:60},role:"listbox","aria-label":m("fontSize.listLabel"),children:o.map(M=>jsx("button",{type:"button",onClick:()=>H(M),className:L("w-full px-3 py-1.5 text-sm text-left","hover:bg-slate-100",M===w&&"bg-slate-100 font-medium"),role:"option","aria-selected":M===w,children:M},M))}),jsx(G,{variant:"ghost",size:"icon-sm",className:L("h-7 w-7 text-slate-500 hover:text-slate-900 hover:bg-slate-100/80 rounded-l-none",n&&"opacity-30 cursor-not-allowed"),onMouseDown:W,disabled:n||w>=p,"aria-label":m("fontSize.increase"),"data-testid":"font-size-increase",children:jsx(T,{name:"add",size:18})})]})}var ba=[{name:"Dark Red",nameKey:"colorPicker.colors.darkRed",hex:"C00000"},{name:"Red",nameKey:"colorPicker.colors.red",hex:"FF0000"},{name:"Orange",nameKey:"colorPicker.colors.orange",hex:"FFC000"},{name:"Yellow",nameKey:"colorPicker.colors.yellow",hex:"FFFF00"},{name:"Light Green",nameKey:"colorPicker.colors.lightGreen",hex:"92D050"},{name:"Green",nameKey:"colorPicker.colors.green",hex:"00B050"},{name:"Light Blue",nameKey:"colorPicker.colors.lightBlue",hex:"00B0F0"},{name:"Blue",nameKey:"colorPicker.colors.blue",hex:"0070C0"},{name:"Dark Blue",nameKey:"colorPicker.colors.darkBlue",hex:"002060"},{name:"Purple",nameKey:"colorPicker.colors.purple",hex:"7030A0"}],it=18,va=2,xa={position:"relative",display:"inline-block"},ya={display:"flex",alignItems:"center",justifyContent:"center",width:"40px",height:"32px",padding:"2px 6px",border:"none",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.1s",color:"var(--doc-text-muted)"},Ta={padding:"10px",backgroundColor:"#fff",border:"1px solid #d0d0d0",borderRadius:"6px",boxShadow:"0 4px 16px rgba(0, 0, 0, 0.15)",width:"auto"},Et={fontSize:"11px",color:"#666",marginBottom:"4px",fontWeight:500},qt={height:"1px",backgroundColor:"#e0e0e0",margin:"8px 0"},vo={display:"grid",gap:`${va}px`},lt={width:`${it}px`,height:`${it}px`,border:"1px solid #c0c0c0",borderRadius:"2px",cursor:"pointer",padding:0,transition:"transform 0.1s, border-color 0.1s"},xo={...lt,transform:"scale(1.15)",borderColor:"#333",zIndex:1},yo={...lt,borderWidth:"2px",borderColor:"#0066cc",boxShadow:"0 0 0 1px #0066cc"},Ca={display:"flex",alignItems:"center",gap:"8px",width:"100%",padding:"5px 8px",border:"1px solid #d0d0d0",borderRadius:"4px",backgroundColor:"#fff",cursor:"pointer",fontSize:"12px",color:"#333"},Sa={display:"flex",alignItems:"center",gap:"6px"},wa={width:"70px",height:"24px",padding:"2px 6px",border:"1px solid #ccc",borderRadius:"3px",fontSize:"12px"},Ia={height:"24px",padding:"0 10px",border:"1px solid #ccc",borderRadius:"3px",backgroundColor:"#f5f5f5",fontSize:"12px",cursor:"pointer"},Ma={width:"16px",height:"4px",borderRadius:"1px",marginTop:"-2px"};function bo(e,t,o){if(!e)return t==="text"||t==="border"?"#000000":"transparent";if(typeof e=="string"){if(t==="highlight"){let n=b$2(e);return n||(e==="none"?"transparent":e.startsWith("#")?e:`#${e}`)}return e.startsWith("#")?e:`#${e}`}return a(e,o)}function Pa(e){let t=e.replace(/^#/,"");if(t.length!==6)return false;let o=parseInt(t.slice(0,2),16),n=parseInt(t.slice(2,4),16),r=parseInt(t.slice(4,6),16);return (o*299+n*587+r*114)/1e3>230}function To(e,t,o){return e?(typeof e=="string"?e.replace(/^#/,"").toUpperCase():a(e,o).replace(/^#/,"").toUpperCase())===t.toUpperCase():false}function ka({matrix:e,selectedColor:t,theme:o,onSelect:n}){let[r,l]=useState(null);return jsx("div",{style:{...vo,gridTemplateColumns:`repeat(10, ${it}px)`},children:e.flatMap((s,p)=>s.map((m,a)=>{let c=`${p}-${a}`,u=r===c,d=To(t,m.hex,o);return jsx("button",{type:"button",style:{...d?yo:u?xo:lt,backgroundColor:`#${m.hex}`},title:m.label,"aria-label":m.label,"aria-selected":d,onClick:()=>n(m),onMouseDown:h=>h.preventDefault(),onMouseEnter:()=>l(c),onMouseLeave:()=>l(null)},c)}))})}function Ra({selectedColor:e,theme:t,onSelect:o}){let[n,r]=useState(null),{t:l}=b();return jsx("div",{style:{...vo,gridTemplateColumns:`repeat(10, ${it}px)`},children:ba.map((s,p)=>{let m=n===p,a=To(e,s.hex,t),c=l(s.nameKey);return jsx("button",{type:"button",style:{...a?yo:m?xo:lt,backgroundColor:`#${s.hex}`},title:c,"aria-label":c,"aria-selected":a,onClick:()=>o(s.hex),onMouseDown:u=>u.preventDefault(),onMouseEnter:()=>r(p),onMouseLeave:()=>r(null)},s.hex)})})}function qe({mode:e,value:t,onChange:o,theme:n,disabled:r=false,className:l,style:s,title:p$1,icon:m,autoLabel:a}){let[c,u]=useState(false),[d,h]=useState(false),[b$1,f]=useState(""),{t:x}=b();useEffect(()=>{let Z=bo(t,e,n).replace(/^#/,"");/^[0-9A-Fa-f]{6}$/.test(Z)&&f(Z.toUpperCase());},[t,e,n]);let v=useCallback(()=>u(false),[]),{containerRef:y,dropdownRef:S,dropdownStyle:w}=Y({isOpen:c,onClose:v}),I=n?.colorScheme??null,P=useMemo(()=>p(I),[I]),W=useMemo(()=>bo(t,e,n),[t,e,n]),O=useCallback(()=>{r||u(Z=>!Z);},[r]),we=useCallback(Z=>{if(e==="highlight")o?.(Z.hex);else {let J={themeColor:Z.themeSlot,rgb:Z.hex};Z.tint&&(J.themeTint=Z.tint),Z.shade&&(J.themeShade=Z.shade),o?.(J);}u(false);},[e,o]),ce=useCallback(Z=>{o?.(e==="highlight"?Z:{rgb:Z}),u(false);},[e,o]),be=useCallback(()=>{o?.(e==="highlight"?"none":{auto:true}),u(false);},[e,o]),H=useCallback(()=>{let Z=b$1.replace(/^#/,"").toUpperCase();/^[0-9A-F]{6}$/i.test(Z)&&(o?.(e==="highlight"?Z:{rgb:Z}),u(false),f(""));},[e,b$1,o]),X={...ya,...r?{cursor:"default",opacity:.38}:c?{backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"}:d?{backgroundColor:"var(--doc-bg-hover)"}:{}},M=x(e==="text"?"formattingBar.fontColor":e==="highlight"?"formattingBar.highlightColor":"table.borderColor"),F=m??(e==="text"?"format_color_text":e==="highlight"?"ink_highlighter":"border_color");return jsxs("div",{ref:y,className:`docx-advanced-color-picker ${l||""}`,style:{...xa,...s},children:[jsxs("button",{type:"button",className:"docx-advanced-color-picker-button",style:X,onClick:O,onMouseDown:Z=>Z.preventDefault(),onMouseEnter:()=>h(true),onMouseLeave:()=>h(false),disabled:r,title:p$1||M,"aria-label":p$1||M,"aria-haspopup":"true","aria-expanded":c,children:[jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",gap:0},children:[jsx(T,{name:F,size:18}),jsx("div",{style:{...Ma,backgroundColor:W==="transparent"?"#fff":W,outline:W==="transparent"||Pa(W)?"1px solid #bbb":"none"}})]}),jsx(T,{name:"arrow_drop_down",size:14})]}),c&&jsx("div",{ref:S,className:"docx-advanced-color-picker-dropdown",style:{...w,...Ta},role:"dialog","aria-label":`${M} picker`,onMouseDown:Z=>{Z.target.tagName!=="INPUT"&&Z.preventDefault();},children:jsxs(Fragment,{children:[jsxs("button",{type:"button",style:Ca,onClick:be,onMouseDown:Z=>Z.preventDefault(),children:[e==="highlight"?jsx("span",{style:{display:"inline-block",width:"16px",height:"16px",border:"1px solid #ccc",borderRadius:"2px",position:"relative",backgroundColor:"#fff"},children:jsx("span",{style:{position:"absolute",top:"50%",left:"-1px",right:"-1px",height:"2px",backgroundColor:"#ff0000",transform:"rotate(-45deg)"}})}):jsx("span",{style:{display:"inline-block",width:"16px",height:"16px",backgroundColor:"#000",borderRadius:"2px"}}),a??x(e==="highlight"?"colorPicker.noColor":"colorPicker.automatic")]}),jsx("div",{style:qt}),jsx("div",{style:Et,children:x("colorPicker.themeColors")}),jsx(ka,{matrix:P,selectedColor:t,theme:n,onSelect:we}),jsx("div",{style:qt}),jsx("div",{style:Et,children:x("colorPicker.standardColors")}),jsx(Ra,{selectedColor:t,theme:n,onSelect:ce}),jsx("div",{style:qt}),jsx("div",{style:Et,children:x("colorPicker.customColor")}),jsxs("div",{style:Sa,children:[jsx("span",{style:{fontSize:"12px",color:"#666"},children:"#"}),jsx("input",{type:"text",style:wa,value:b$1,onChange:Z=>f(Z.target.value.replace(/[^0-9A-Fa-f]/g,"").slice(0,6)),onKeyDown:Z=>{Z.key==="Enter"&&H();},onMouseDown:Z=>{Z.stopPropagation();},placeholder:"FF0000",maxLength:6,"aria-label":"Custom hex color"}),jsx("button",{type:"button",style:{...Ia,opacity:/^[0-9A-Fa-f]{6}$/.test(b$1)?1:.4,cursor:/^[0-9A-Fa-f]{6}$/.test(b$1)?"pointer":"default"},onClick:H,onMouseDown:Z=>Z.preventDefault(),disabled:!/^[0-9A-Fa-f]{6}$/.test(b$1),children:x("common.apply")})]})]})})]})}function oe({content:e,children:t,side:o="bottom",delayMs:n=400}){let[r,l]=ee.useState(false),[s,p]=ee.useState({x:0,y:0}),m=ee.useRef(null),a=ee.useRef(null),c=ee.useCallback(()=>{a.current=setTimeout(()=>{if(m.current){let b=m.current.getBoundingClientRect(),f=b.left+b.width/2,x=o==="top"?b.top-8:b.bottom+8;p({x:f,y:x});}l(true);},n);},[n,o]),u=ee.useCallback(()=>{a.current&&(clearTimeout(a.current),a.current=null),l(false);},[]);ee.useEffect(()=>()=>{a.current&&clearTimeout(a.current);},[]);let d=t.props,h=ee.cloneElement(t,{ref:m,onMouseEnter:b=>{c(),d.onMouseEnter?.(b);},onMouseLeave:b=>{u(),d.onMouseLeave?.(b);}});return jsxs(Fragment,{children:[h,r&&jsx("div",{className:"fixed z-50 px-2 py-1 text-xs font-medium text-white bg-slate-900 rounded-md shadow-lg",style:{left:s.x,top:s.y,transform:o==="top"?"translate(-50%, -100%)":o==="bottom"?"translate(-50%, 0)":void 0},children:e})]})}var et=20,_t=[{value:"left",label:"Align Left",labelKey:"alignment.alignLeft",shortcutKey:"alignment.alignLeftShortcut",icon:jsx(T,{name:"format_align_left",size:et}),iconName:"format_align_left",shortcut:"Ctrl+L"},{value:"center",label:"Center",labelKey:"alignment.center",shortcutKey:"alignment.centerShortcut",icon:jsx(T,{name:"format_align_center",size:et}),iconName:"format_align_center",shortcut:"Ctrl+E"},{value:"right",label:"Align Right",labelKey:"alignment.alignRight",shortcutKey:"alignment.alignRightShortcut",icon:jsx(T,{name:"format_align_right",size:et}),iconName:"format_align_right",shortcut:"Ctrl+R"},{value:"both",label:"Justify",labelKey:"alignment.justify",shortcutKey:"alignment.justifyShortcut",icon:jsx(T,{name:"format_align_justify",size:et}),iconName:"format_align_justify",shortcut:"Ctrl+J"}];function wo({value:e="left",onChange:t,disabled:o=false}){let{t:n}=b(),[r,l]=useState(false),s=useCallback(()=>l(false),[]),{containerRef:p,dropdownRef:m,dropdownStyle:a,handleMouseDown:c}=Y({isOpen:r,onClose:s}),u=useCallback(v=>{o||t?.(v),l(false);},[o,t]),d=_t.find(v=>v.value===e)||_t[0],h=n(d.labelKey),b$1=d.shortcutKey?n(d.shortcutKey):void 0,f=`${h}${b$1?` (${b$1})`:""}`,x=jsxs(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",r&&"bg-slate-100",o&&"opacity-30 cursor-not-allowed"),onMouseDown:c,onClick:()=>!o&&l(v=>!v),disabled:o,"aria-label":f,"aria-expanded":r,"aria-haspopup":"true","data-testid":"toolbar-alignment",children:[jsx(T,{name:d.iconName,size:et}),jsx(T,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:p,style:{position:"relative",display:"inline-block"},children:[r?x:jsx(oe,{content:f,children:x}),r&&!o&&jsx("div",{ref:m,style:{...a,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:v=>v.stopPropagation(),children:jsx("div",{style:{display:"flex",gap:2},children:_t.map(v=>{let y=e===v.value,S=n(v.labelKey),w=v.shortcutKey?n(v.shortcutKey):void 0;return jsx("button",{type:"button",title:`${S}${w?` (${w})`:""}`,"data-testid":`alignment-${v.value}`,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:y?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:y?"var(--doc-primary)":"var(--doc-text)"},onMouseDown:I=>I.preventDefault(),onMouseEnter:I=>{y||(I.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:I=>{I.currentTarget.style.backgroundColor=y?"var(--doc-primary-light)":"transparent";},onClick:()=>u(v.value),children:jsx(T,{name:v.iconName,size:18})},v.value)})})})]})}var Da={display:"inline-flex",alignItems:"center",gap:"4px"},Io={display:"inline-flex",alignItems:"center",gap:"4px"},dt={display:"flex",alignItems:"center",justifyContent:"center",width:"32px",height:"32px",padding:"4px",border:"none",borderRadius:"4px",backgroundColor:"transparent",cursor:"pointer",transition:"background-color 0.1s",color:"var(--doc-text-muted)"},Na={...dt,backgroundColor:"var(--doc-bg-hover)"},Fa={...dt,backgroundColor:"var(--doc-primary-light)",color:"var(--doc-primary)"},Ba={...dt,cursor:"default",opacity:.38},Oa={width:"28px",height:"28px",padding:"2px"},za={width:"1px",height:"20px",backgroundColor:"var(--doc-border)",margin:"0 6px"},st=20;function ct({active:e=false,disabled:t=false,title:o,onClick:n,children:r,className:l,style:s}){let[p,m]=useState(false),a={...t?Ba:e?Fa:p?Na:dt,...s},c=u=>{u.preventDefault();};return jsx("button",{type:"button",className:`docx-list-button ${e?"docx-list-button-active":""} ${t?"docx-list-button-disabled":""} ${l||""}`,style:a,onMouseDown:c,onClick:t?void 0:n,onMouseEnter:()=>m(true),onMouseLeave:()=>m(false),disabled:t,title:o,"aria-label":o,"aria-pressed":e,role:"button",children:r})}function Mo({listState:e,onBulletList:t,onNumberedList:o,onIndent:n,onOutdent:r,disabled:l=false,className:s,style:p,showIndentButtons:m=true,compact:a=false,hasIndent:c=false}){let{t:u}=b(),d=useCallback(()=>a?{...Oa}:{},[a]),h=e?.type==="bullet",b$1=e?.type==="numbered",x=(e?.isInList||h||b$1)&&(e?.level??0)>0||c;return jsxs("div",{className:`docx-list-buttons ${s||""}`,style:{...Da,...p},role:"group","aria-label":u("lists.ariaLabel"),children:[jsxs("div",{style:Io,role:"group","aria-label":u("lists.typeAriaLabel"),children:[jsx(ct,{active:h,disabled:l,title:u("lists.bulletList"),onClick:t,style:d(),children:jsx(T,{name:"format_list_bulleted",size:st})}),jsx(ct,{active:b$1,disabled:l,title:u("lists.numberedList"),onClick:o,style:d(),children:jsx(T,{name:"format_list_numbered",size:st})})]}),m&&jsxs(Fragment,{children:[jsx("div",{style:za,role:"separator"}),jsxs("div",{style:Io,role:"group","aria-label":u("lists.indentationAriaLabel"),children:[jsx(ct,{active:false,disabled:l||!x,title:u("lists.decreaseIndent"),onClick:r,style:d(),children:jsx(T,{name:"format_indent_decrease",size:st})}),jsx(ct,{active:false,disabled:l,title:u("lists.increaseIndent"),onClick:n,style:d(),children:jsx(T,{name:"format_indent_increase",size:st})})]})]})]})}function Po(){return {type:"none",level:0,isInList:false}}var Wa=[{label:"Single",labelKey:"lineSpacing.single",value:1,twipsValue:240},{label:"1.15",value:1.15,twipsValue:276},{label:"1.5",value:1.5,twipsValue:360},{label:"Double",labelKey:"lineSpacing.double",value:2,twipsValue:480}];function Ro({value:e,onChange:t,options:o=Wa,disabled:n=false,className:r}){let{t:l}=b(),s=ee.useMemo(()=>e===void 0?o[0]:o.find(a=>a.twipsValue===e)||o[0],[e,o]),p=ee.useCallback(a=>{let c=parseInt(a,10);isNaN(c)||t?.(c);},[t]),m=a=>a.labelKey?l(a.labelKey):a.label;return jsxs(Ie,{value:s.twipsValue.toString(),onValueChange:p,disabled:n,children:[jsx(Me,{className:L("h-8 text-sm gap-0.5 px-2",r),style:{width:"auto"},title:l("lineSpacing.lineSpacingTitle",{label:m(s)}),children:jsx(Ht,{className:"h-5 w-5 shrink-0"})}),jsxs(Pe,{children:[o.map(a=>jsx(me,{value:a.twipsValue.toString(),children:m(a)},a.twipsValue)),jsx(Xe,{}),jsx(Fe,{children:jsx(Be,{children:l("lineSpacing.paragraphSpacing")})})]})]})}var Zo=[{styleId:"Normal",name:"Normal text",nameKey:"styles.normalText",type:"paragraph",isDefault:true,priority:0,qFormat:true,fontSize:22},{styleId:"Title",name:"Title",nameKey:"styles.title",type:"paragraph",priority:1,qFormat:true,fontSize:52,bold:true},{styleId:"Subtitle",name:"Subtitle",nameKey:"styles.subtitle",type:"paragraph",priority:2,qFormat:true,fontSize:30,color:"666666"},{styleId:"Heading1",name:"Heading 1",nameKey:"styles.heading1",type:"paragraph",priority:3,qFormat:true,fontSize:40,bold:true},{styleId:"Heading2",name:"Heading 2",nameKey:"styles.heading2",type:"paragraph",priority:4,qFormat:true,fontSize:32,bold:true},{styleId:"Heading3",name:"Heading 3",nameKey:"styles.heading3",type:"paragraph",priority:5,qFormat:true,fontSize:28,bold:true}],Va="#4a6c8c",$a={Title:26,Subtitle:18,Heading1:24,Heading2:18,Heading3:16,Heading4:14,Heading5:13,Heading6:13,Normal:14};function Ga(e){let t={},o=$a[e.styleId];if(o)t.fontSize=`${o}px`;else {let n=e.fontSize?e.fontSize/2:11,r=Math.min(Math.max(n,11),20);t.fontSize=`${r}px`;}return t.lineHeight="1.3",e.bold&&(t.fontWeight="bold"),e.italic&&(t.fontStyle="italic"),e.color?t.color=`#${e.color}`:e.styleId.startsWith("Heading")&&(t.color=Va),t}function Lo({value:e,onChange:t,styles:o,disabled:n=false,className:r,width:l=120}){let{t:s}=b(),p=ee.useMemo(()=>!o||o.length===0?Zo:o.filter(b=>b.type==="paragraph").filter(b=>b.qFormat?true:!(b.hidden||b.semiHidden)).map(b=>{let f=Zo.find(x=>x.styleId===b.styleId);return {styleId:b.styleId,name:b.name||b.styleId,nameKey:f?.nameKey,type:b.type,isDefault:b.default,qFormat:b.qFormat,priority:b.uiPriority??99,fontSize:b.rPr?.fontSize??f?.fontSize,bold:b.rPr?.bold??f?.bold,italic:b.rPr?.italic??f?.italic,color:b.rPr?.color?.rgb??f?.color}}).sort((b,f)=>(b.priority??99)-(f.priority??99)),[o]),m=ee.useCallback(h=>{t?.(h);},[t]),a=h=>h.nameKey?s(h.nameKey):h.name,c=e||"Normal",u=p.find(h=>h.styleId===c),d=u?a(u):c;return jsxs(Ie,{value:c,onValueChange:m,disabled:n,children:[jsx(Me,{className:L("h-8 text-sm",r),style:{width:typeof l=="number"?`${l}px`:l},"aria-label":s("styles.selectAriaLabel"),children:jsx("span",{className:"truncate",children:d})}),jsx(Pe,{className:"min-w-[260px] max-h-[400px]",children:p.map(h=>jsx(me,{value:h.styleId,className:"py-2.5 px-3",children:jsx("span",{style:Ga(h),children:a(h)})},h.styleId))})]})}var Ya=[{value:.5,label:"50%"},{value:.75,label:"75%"},{value:1,label:"100%"},{value:1.25,label:"125%"},{value:1.5,label:"150%"},{value:2,label:"200%"}];function Ho({value:e=1,onChange:t,levels:o=Ya,disabled:n=false,className:r,compact:l=false}){let{t:s}=b(),p=ee.useMemo(()=>{let a=o.find(c=>Math.abs(c.value-e)<.001);return a?a.label:`${Math.round(e*100)}%`},[o,e]),m=ee.useCallback(a=>{let c=parseFloat(a);isNaN(c)||t?.(c);},[t]);return jsxs(Ie,{value:e.toString(),onValueChange:m,disabled:n,children:[jsx(Me,{className:L(l?"h-7 min-w-[55px] text-xs":"h-8 min-w-[70px] text-sm",r),"aria-label":s("zoom.ariaLabel",{label:p}),children:jsx(at,{placeholder:"100%",children:p})}),jsx(Pe,{children:o.map(a=>jsx(me,{value:a.value.toString(),children:a.label},a.value))})]})}var Ja=[{action:"borderAll",icon:"border_all",labelKey:"table.borders.all"},{action:"borderOutside",icon:"border_outer",labelKey:"table.borders.outside"},{action:"borderInside",icon:"border_inner",labelKey:"table.borders.inside"},{action:"borderTop",icon:"border_top",labelKey:"table.borders.top"},{action:"borderBottom",icon:"border_bottom",labelKey:"table.borders.bottom"},{action:"borderLeft",icon:"border_left",labelKey:"table.borders.left"},{action:"borderRight",icon:"border_right",labelKey:"table.borders.right"},{action:"borderNone",icon:"border_clear",labelKey:"table.borders.none"}];function qo({onAction:e,disabled:t=false}){let{t:o}=b(),[n,r]=useState(false),l=useCallback(()=>r(false),[]),{containerRef:s,dropdownRef:p,dropdownStyle:m,handleMouseDown:a}=Y({isOpen:n,onClose:l}),c=useCallback(d=>{e(d),r(false);},[e]),u=jsxs(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",n&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:a,onClick:()=>!t&&r(d=>!d),disabled:t,"aria-label":o("table.borders.styleAriaLabel"),"aria-expanded":n,"aria-haspopup":"true","data-testid":"toolbar-table-borders",children:[jsx(T,{name:"border_all",size:20}),jsx(T,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:s,style:{position:"relative",display:"inline-block"},children:[n?u:jsx(oe,{content:o("table.borders.tooltip"),children:u}),n&&!t&&jsx("div",{ref:p,style:{...m,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:d=>d.stopPropagation(),children:jsx("div",{style:{display:"grid",gridTemplateColumns:"repeat(4, 1fr)",gap:2},children:Ja.map(({action:d,icon:h,labelKey:b})=>jsx("button",{type:"button",title:o(b),style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:"transparent",cursor:"pointer",color:"var(--doc-text)"},onMouseDown:f=>f.preventDefault(),onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(d),children:jsx(T,{name:h,size:18})},typeof d=="string"?d:d.type))})})]})}function _o({onAction:e,disabled:t=false,theme:o,value:n}){let{t:r}=b(),l=useCallback(s=>{typeof s=="string"?e({type:"borderColor",color:s.replace(/^#/,"")}):s.rgb?e({type:"borderColor",color:s.rgb.replace(/^#/,"")}):s.auto&&e({type:"borderColor",color:"000000"});},[e]);return jsx(qe,{mode:"border",value:n,onChange:l,theme:o,disabled:t,title:r("table.borderColor")})}var oi=[{size:4,label:"0.5 pt",thickness:.5},{size:8,label:"1 pt",thickness:1},{size:12,label:"1.5 pt",thickness:1.5},{size:16,label:"2 pt",thickness:2},{size:24,label:"3 pt",thickness:3}];function No({onAction:e,disabled:t=false}){let[o,n]=useState(false),{t:r}=b(),l=useCallback(()=>n(false),[]),{containerRef:s,dropdownRef:p,dropdownStyle:m,handleMouseDown:a}=Y({isOpen:o,onClose:l}),c=useCallback(d=>{e({type:"borderWidth",size:d}),n(false);},[e]),u=jsxs(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",o&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:a,onClick:()=>!t&&n(d=>!d),disabled:t,"aria-label":r("table.borderWidth"),"aria-expanded":o,"aria-haspopup":"true","data-testid":"toolbar-table-border-width",children:[jsx(T,{name:"line_weight",size:20}),jsx(T,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:s,style:{position:"relative",display:"inline-block"},children:[o?u:jsx(oe,{content:r("table.borderWidth"),children:u}),o&&!t&&jsx("div",{ref:p,style:{...m,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:"4px 0",minWidth:120},onMouseDown:d=>d.stopPropagation(),children:oi.map(({size:d,label:h,thickness:b})=>jsxs("button",{type:"button",style:{display:"flex",alignItems:"center",gap:10,padding:"6px 12px",width:"100%",border:"none",backgroundColor:"transparent",cursor:"pointer",fontSize:12,color:"var(--doc-text)"},onMouseDown:f=>f.preventDefault(),onMouseEnter:f=>{f.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:f=>{f.currentTarget.style.backgroundColor="transparent";},onClick:()=>c(d),children:[jsx("div",{style:{width:50,height:Math.max(b,1),backgroundColor:"#000",borderRadius:b>2?1:0}}),jsx("span",{children:h})]},d))})]})}function Fo({onAction:e,disabled:t=false,theme:o,value:n}){let{t:r}=b(),l=useCallback(s=>{typeof s=="string"&&e(s==="none"?{type:"cellFillColor",color:null}:{type:"cellFillColor",color:s.replace(/^#/,"")});},[e]);return jsx(qe,{mode:"highlight",value:n,onChange:l,theme:o,disabled:t,title:r("table.cellFillColor"),icon:"format_color_fill",autoLabel:r("colorPicker.noColor")})}var ai={display:"flex",alignItems:"center",gap:10,padding:"7px 14px",fontSize:13,color:"var(--doc-text)",cursor:"pointer",border:"none",backgroundColor:"transparent",width:"100%",textAlign:"left"},Ve={height:1,backgroundColor:"var(--doc-border)",margin:"4px 0"},zo={padding:"6px 14px 2px",fontSize:11,color:"var(--doc-text-muted)",fontWeight:500};function Ko({onAction:e,disabled:t=false,tableContext:o}){let{t:n}=b(),[r,l]=useState(false),[s,p]=useState(null),m=useCallback(()=>l(false),[]),{containerRef:a,dropdownRef:c,dropdownStyle:u,handleMouseDown:d}=Y({isOpen:r,onClose:m,align:"right"}),h=o?.table?.attrs?.justification??"left",b$1=useCallback(v=>{e(v),l(false);},[e]),f=(v,y,S,w,I)=>{let P=t||I?.itemDisabled;return jsxs("button",{type:"button",role:"menuitem",style:{...ai,backgroundColor:s===v&&!P?"var(--doc-bg-hover)":"transparent",color:P?"var(--doc-text-muted)":I?.danger?"var(--doc-error)":"var(--doc-text)",cursor:P?"not-allowed":"pointer"},onClick:()=>!P&&b$1(w),onMouseEnter:()=>p(v),onMouseLeave:()=>p(null),disabled:P,children:[jsx(T,{name:y,size:16,className:I?.danger&&!P?"text-red-600":""}),jsx("span",{style:{flex:1},children:S})]},v)},x=jsx(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",r&&"bg-slate-100",t&&"opacity-30 cursor-not-allowed"),onMouseDown:d,onClick:()=>!t&&l(v=>!v),disabled:t,"aria-label":n("table.moreOptions"),"aria-expanded":r,"aria-haspopup":"menu","data-testid":"toolbar-table-more",children:jsx(T,{name:"more_vert",size:20})});return jsxs("div",{ref:a,style:{position:"relative",display:"inline-block"},children:[r?x:jsx(oe,{content:n("table.moreOptions"),children:x}),r&&!t&&jsxs("div",{ref:c,style:{...u,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:"4px 0",minWidth:200,maxHeight:"70vh",overflowY:"auto"},role:"menu",onMouseDown:v=>v.stopPropagation(),children:[f("addRowAbove","add",n("table.insertRowAbove"),"addRowAbove"),f("addRowBelow","add",n("table.insertRowBelow"),"addRowBelow"),f("addColumnLeft","add",n("table.insertColumnLeft"),"addColumnLeft"),f("addColumnRight","add",n("table.insertColumnRight"),"addColumnRight"),jsx("div",{style:Ve,role:"separator"}),f("mergeCells","call_merge",n("table.mergeCells"),"mergeCells",{itemDisabled:!o?.hasMultiCellSelection}),f("splitCell","call_split",n("table.splitCell"),"splitCell",{itemDisabled:!o?.canSplitCell}),jsx("div",{style:Ve,role:"separator"}),f("deleteRow","delete",n("table.deleteRow"),"deleteRow",{danger:true,itemDisabled:(o?.rowCount??0)<=1}),f("deleteColumn","delete",n("table.deleteColumn"),"deleteColumn",{danger:true,itemDisabled:(o?.columnCount??0)<=1}),f("deleteTable","delete",n("table.deleteTable"),"deleteTable",{danger:true}),jsx("div",{style:Ve,role:"separator"}),jsx("div",{style:zo,children:n("tableAdvanced.verticalAlignment")}),jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["top","center","bottom"].map(v=>{let y={top:"vertical_align_top",center:"vertical_align_center",bottom:"vertical_align_bottom"};return jsx("button",{type:"button",title:n({top:"tableAdvanced.top",center:"tableAdvanced.middle",bottom:"tableAdvanced.bottom"}[v]),style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:"transparent",cursor:"pointer"},onMouseDown:w=>w.preventDefault(),onMouseEnter:w=>{w.currentTarget.style.backgroundColor="var(--doc-bg-hover)";},onMouseLeave:w=>{w.currentTarget.style.backgroundColor="transparent";},onClick:()=>b$1({type:"cellVerticalAlign",align:v}),children:jsx(T,{name:y[v],size:16})},v)})}),jsx("div",{style:Ve,role:"separator"}),jsx("div",{style:zo,children:n("tableAdvanced.tableAlignment")}),jsx("div",{style:{display:"flex",gap:4,padding:"4px 14px"},children:["left","center","right"].map(v=>{let y={left:"format_align_left",center:"format_align_center",right:"format_align_right"},S=h===v;return jsx("button",{type:"button",title:n({left:"tableAdvanced.alignTableLeft",center:"tableAdvanced.alignTableCenter",right:"tableAdvanced.alignTableRight"}[v]),style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:28,border:"1px solid var(--doc-border)",borderRadius:4,backgroundColor:S?"var(--doc-primary-light)":"transparent",borderColor:S?"var(--doc-primary)":"var(--doc-border)",color:S?"var(--doc-primary)":"var(--doc-text)",cursor:"pointer"},onMouseDown:w=>w.preventDefault(),onClick:()=>b$1({type:"tableProperties",props:{justification:v}}),children:jsx(T,{name:y[v],size:16})},v)})}),jsx("div",{style:Ve,role:"separator"}),f("headerRow","table_rows",n("tableAdvanced.toggleHeaderRow"),{type:"toggleHeaderRow"}),f("distribute","view_column",n("tableAdvanced.distributeColumns"),{type:"distributeColumns"}),f("autoFit","fit_width",n("tableAdvanced.autoFit"),{type:"autoFitContents"}),f("noWrap","wrap_text",n("tableAdvanced.toggleNoWrap"),{type:"toggleNoWrap"}),jsx("div",{style:Ve,role:"separator"}),f("properties","settings",n("tableAdvanced.tableProperties"),{type:"openTableProperties"})]})]})}var li=20;function gt({options:e,activeValue:t,triggerIcon:o,tooltipContent:n,onSelect:r,disabled:l=false,ariaLabel:s,testId:p}){let[m,a]=useState(false),c=useCallback(()=>a(false),[]),{containerRef:u,dropdownRef:d,dropdownStyle:h,handleMouseDown:b}=Y({isOpen:m,onClose:c}),f=useCallback(v=>{l||r(v),a(false);},[l,r]),x=jsxs(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",m&&"bg-slate-100",l&&"opacity-30 cursor-not-allowed"),onMouseDown:b,onClick:()=>!l&&a(v=>!v),disabled:l,"aria-label":s??n,"aria-expanded":m,"aria-haspopup":"true","data-testid":p,children:[jsx(T,{name:o,size:li}),jsx(T,{name:"arrow_drop_down",size:14,className:"-ml-1"})]});return jsxs("div",{ref:u,style:{position:"relative",display:"inline-block"},children:[m?x:jsx(oe,{content:n,children:x}),m&&!l&&jsx("div",{ref:d,style:{...h,backgroundColor:"white",border:"1px solid var(--doc-border)",borderRadius:8,boxShadow:"0 4px 16px rgba(0, 0, 0, 0.12)",padding:6},onMouseDown:v=>v.stopPropagation(),children:jsx("div",{style:{display:"flex",gap:2},children:e.map(v=>{let y=t===v.value;return jsx("button",{type:"button",title:v.label,"data-testid":p?`${p}-${v.value}`:void 0,style:{display:"flex",alignItems:"center",justifyContent:"center",width:32,height:32,border:"1px solid transparent",borderRadius:4,backgroundColor:y?"var(--doc-primary-light)":"transparent",cursor:"pointer",color:y?"var(--doc-primary)":"var(--doc-text)"},onMouseDown:S=>S.preventDefault(),onMouseEnter:S=>{y||(S.currentTarget.style.backgroundColor="var(--doc-bg-hover)");},onMouseLeave:S=>{S.currentTarget.style.backgroundColor=y?"var(--doc-primary-light)":"transparent";},onClick:()=>f(v.value),children:jsx(T,{name:v.iconName,size:18})},v.value)})})})]})}var si=[{value:"inline",labelKey:"imageWrap.inline",iconName:"format_image_left"},{value:"wrapRight",labelKey:"imageWrap.floatLeft",iconName:"format_image_right"},{value:"wrapLeft",labelKey:"imageWrap.floatRight",iconName:"format_image_left"},{value:"topAndBottom",labelKey:"imageWrap.topAndBottom",iconName:"horizontal_rule"},{value:"behind",labelKey:"imageWrap.behindText",iconName:"flip_to_back"},{value:"inFront",labelKey:"imageWrap.inFrontOfText",iconName:"flip_to_front"}];function ci(e){return e.displayMode==="float"&&e.cssFloat==="left"?"wrapRight":e.displayMode==="float"&&e.cssFloat==="right"?"wrapLeft":e.wrapType}function $o({imageContext:e,onChange:t,disabled:o=false}){let{t:n}=b(),r=si.map(p=>({...p,label:n(p.labelKey)})),l=ci(e),s=r.find(p=>p.value===l)||r[0];return jsx(gt,{options:r,activeValue:l,triggerIcon:s.iconName,tooltipContent:`Wrap: ${s.label}`,onSelect:t,disabled:o,testId:"toolbar-image-wrap"})}var di=[{value:"rotateCW",labelKey:"imageTransform.rotateClockwise",iconName:"rotate_right"},{value:"rotateCCW",labelKey:"imageTransform.rotateCounterClockwise",iconName:"rotate_left"},{value:"flipH",labelKey:"imageTransform.flipHorizontal",iconName:"swap_horiz"},{value:"flipV",labelKey:"imageTransform.flipVertical",iconName:"swap_vert"}];function Go({onTransform:e,disabled:t=false}){let{t:o}=b(),n=di.map(r=>({...r,label:o(r.labelKey)}));return jsx(gt,{options:n,triggerIcon:"rotate_right",tooltipContent:o("imageTransform.tooltip"),onSelect:e,disabled:t,testId:"toolbar-image-transform"})}function hi(e){return "type"in e&&e.type==="separator"}var jo={display:"flex",alignItems:"center",gap:2,padding:"2px 8px",border:"none",background:"transparent",borderRadius:4,cursor:"pointer",fontSize:13,fontWeight:400,color:"var(--doc-text, #374151)",whiteSpace:"nowrap",height:28,lineHeight:"28px"},fi={...jo,background:"var(--doc-hover, #f3f4f6)"},Xo={display:"flex",alignItems:"center",gap:8,padding:"6px 12px",border:"none",background:"transparent",cursor:"pointer",fontSize:13,color:"var(--doc-text, #374151)",width:"100%",textAlign:"left",whiteSpace:"nowrap"},gi={...Xo,opacity:.4,cursor:"default"},bi={height:1,backgroundColor:"var(--doc-border, #e5e7eb)",margin:"4px 0"},vi={marginLeft:"auto",fontSize:12,color:"var(--doc-text-muted, #9ca3af)"},xi={position:"absolute",left:"100%",top:-4,marginLeft:2,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",padding:8,zIndex:1001};function vt({label:e,items:t,disabled:o}){let[n,r]=useState(false),[l,s]=useState(null),p=useRef(null),m=useRef(null),[a,c]=useState({top:0,left:0}),u=useCallback(()=>{r(false),s(null);},[]);useEffect(()=>{if(!n||!p.current)return;let h=p.current.getBoundingClientRect();c({top:h.bottom+2,left:h.left});},[n]),useEffect(()=>{if(!n)return;function h(x){let v=x.target;p.current&&!p.current.contains(v)&&m.current&&!m.current.contains(v)&&u();}function b(x){x.key==="Escape"&&u();}function f(){u();}return document.addEventListener("mousedown",h),document.addEventListener("keydown",b),window.addEventListener("scroll",f,true),()=>{document.removeEventListener("mousedown",h),document.removeEventListener("keydown",b),window.removeEventListener("scroll",f,true);}},[n,u]);let d=h=>{h.disabled||h.submenuContent||h.onClick&&(h.onClick(),u());};return jsxs("div",{style:{position:"relative"},children:[jsxs("button",{ref:p,type:"button",onClick:()=>!o&&r(!n),onMouseDown:h=>h.preventDefault(),disabled:o,style:n?fi:jo,children:[e,jsx(T,{name:"arrow_drop_down",size:16})]}),n&&jsx("div",{ref:m,style:{position:"fixed",top:a.top,left:a.left,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:6,boxShadow:"0 4px 12px rgba(0, 0, 0, 0.12)",padding:"4px 0",zIndex:1e4,minWidth:200},onMouseDown:h=>h.preventDefault(),children:t.map((h,b)=>{if(hi(h))return jsx("div",{style:bi},`sep-${b}`);let f=h;if(f.customContent)return jsx("div",{onMouseDown:y=>y.preventDefault(),children:f.customContent},f.label);let x=!!f.submenuContent,v=l===f.label;return jsxs("div",{style:{position:"relative"},onMouseEnter:()=>x&&s(f.label),onMouseLeave:()=>x&&s(null),children:[jsxs("button",{type:"button",style:f.disabled?gi:Xo,onClick:()=>d(f),onMouseDown:y=>y.preventDefault(),onMouseOver:y=>{f.disabled||(y.currentTarget.style.backgroundColor="var(--doc-hover, #f3f4f6)");},onMouseOut:y=>{y.currentTarget.style.backgroundColor="transparent";},disabled:f.disabled,children:[f.icon&&jsx(T,{name:f.icon,size:18}),jsx("span",{children:f.label}),f.shortcut&&jsx("span",{style:vi,children:f.shortcut}),x&&jsx("span",{style:{marginLeft:"auto"},children:jsx(T,{name:"keyboard_arrow_right",size:16})})]}),x&&v&&jsx("div",{style:xi,onMouseDown:y=>y.preventDefault(),children:f.submenuContent(u)})]},f.label)})})]})}var Ot=18,Ti=2,Qo={width:Ot,height:Ot,backgroundColor:"white",border:"1px solid var(--doc-border, #d1d5db)",borderRadius:2,transition:"background-color 0.1s, border-color 0.1s",cursor:"pointer"},Ci={...Qo,backgroundColor:"var(--doc-primary, #3b82f6)",border:"1px solid var(--doc-primary, #3b82f6)"},Si={marginTop:6,fontSize:11,fontWeight:500,color:"var(--doc-text, #374151)",textAlign:"center"};function en({onInsert:e,gridRows:t=6,gridColumns:o=6}){let[n,r]=useState(0),[l,s]=useState(0),p=useCallback(()=>{n>0&&l>0&&e(n,l);},[n,l,e]),m=[];for(let c=1;c<=t;c++)for(let u=1;u<=o;u++){let d=c<=n&&u<=l;m.push(jsx("div",{style:d?Ci:Qo,onMouseEnter:()=>{r(c),s(u);},onClick:p,role:"gridcell","aria-selected":d},`${c}-${u}`));}let a=n>0&&l>0?`${l} \xD7 ${n}`:"Select size";return jsxs("div",{children:[jsx("div",{style:{display:"grid",gap:Ti,gridTemplateColumns:`repeat(${o}, ${Ot}px)`},onMouseLeave:()=>{r(0),s(0);},role:"grid","aria-label":"Table size selector",children:m}),jsx("div",{style:Si,children:a})]})}var Ii={FFFF00:"yellow","00FF00":"green","00FFFF":"cyan",FF00FF:"magenta","0000FF":"blue",FF0000:"red","00008B":"darkBlue","008080":"darkCyan","008000":"darkGreen",800080:"darkMagenta","8B0000":"darkRed",808e3:"darkYellow",808080:"darkGray",C0C0C0:"lightGray","000000":"black",FFFFFF:"white"};function lc(e){let t=e.replace(/^#/,"").toUpperCase();return Ii[t]||null}function ne({active:e=false,disabled:t=false,title:o,onClick:n,children:r,className:l,ariaLabel:s}){let p=s?.toLowerCase().replace(/\s+/g,"-")||o?.toLowerCase().replace(/\s+/g,"-").replace(/\([^)]*\)/g,"").trim(),m=c=>{c.preventDefault();},a=jsx(G,{variant:"ghost",size:"icon-sm",className:L("text-slate-500 hover:text-slate-900 hover:bg-slate-100/80",e&&"bg-slate-900 text-white hover:bg-slate-800 hover:text-white",t&&"opacity-30 cursor-not-allowed",l),onMouseDown:m,onClick:t?void 0:n,disabled:t,"aria-pressed":e,"aria-label":s||o,"data-testid":p?`toolbar-${p}`:void 0,children:r});return o?jsx(oe,{content:o,children:a}):a}function ie({label:e,children:t,className:o}){return jsx("div",{className:L("flex items-center gap-px px-1.5 border-r border-slate-200/50 last:border-r-0 first:pl-0",o),role:"group","aria-label":e,children:t})}function vc(){return jsx("div",{className:"w-px h-6 bg-slate-200 mx-1.5",role:"separator"})}function xc({children:e,className:t,style:o,disabled:n=false,onFormat:r,onPrint:l,showPrintButton:s=true,onPageSetup:p,onInsertImage:m,onInsertTable:a,showTableInsert:c=true,onInsertPageBreak:u,onInsertTOC:d,onRefocusEditor:h,...b$1}){let{t:f}=b(),x=useRef(null),v=useCallback(I=>{!n&&r&&r(I);},[n,r]),y=useCallback((I,P)=>{!n&&a&&(a(I,P),requestAnimationFrame(()=>h?.()));},[n,a,h]),S=useCallback(I=>{let P=I.target;P.tagName==="INPUT"||P.tagName==="TEXTAREA"||P.tagName==="SELECT"||P.tagName==="OPTION"||I.preventDefault();},[]),w=useCallback(I=>{let P=I.target,W=document.activeElement;P.tagName==="SELECT"||P.tagName==="OPTION"||W?.tagName==="SELECT"||requestAnimationFrame(()=>{h?.();});},[h]);return jsxs("div",{ref:x,className:L("flex items-center px-1 py-1 bg-white border-b border-slate-100 min-h-[36px] overflow-x-auto",t),style:o,role:"toolbar","aria-label":f("toolbar.ariaLabel"),"data-testid":"toolbar",onMouseDown:S,onMouseUp:w,children:[s&&l||p?jsx(vt,{label:f("toolbar.file"),disabled:n,items:[...s&&l?[{icon:"print",label:f("toolbar.print"),shortcut:f("toolbar.printShortcut"),onClick:l}]:[],...p?[{icon:"settings",label:f("toolbar.pageSetup"),onClick:p}]:[]]}):null,jsx(vt,{label:f("toolbar.format"),disabled:n,items:[{icon:"format_textdirection_l_to_r",label:f("toolbar.leftToRight"),onClick:()=>v("setLtr")},{icon:"format_textdirection_r_to_l",label:f("toolbar.rightToLeft"),onClick:()=>v("setRtl")}]}),jsx(vt,{label:f("toolbar.insert"),disabled:n,items:[...m?[{icon:"image",label:f("toolbar.image"),onClick:m}]:[],...c&&a?[{icon:"grid_on",label:f("toolbar.table"),submenuContent:I=>jsx(en,{onInsert:(P,W)=>{y(P,W),I();}})}]:[],...m||c&&a?[{type:"separator"}]:[],{icon:"page_break",label:f("toolbar.pageBreak"),onClick:u,disabled:!u},{icon:"format_list_numbered",label:f("toolbar.tableOfContents"),onClick:d,disabled:!d}]}),jsx(tn,{...b$1,disabled:n,onFormat:r,onRefocusEditor:h,onInsertTable:a,showTableInsert:c,onInsertImage:m,onInsertPageBreak:u,onInsertTOC:d,onPrint:l,showPrintButton:s,onPageSetup:p,inline:true,children:e})]})}var zt=createContext(null);function Sc(){let e=useContext(zt);if(!e)throw new Error("useEditorToolbar must be used within an <EditorToolbar> component");return e}var le=18;function Ai(e){let t=ee__default.useContext(zt);return t?{...t,...Ei(e)}:e}function Ei(e){let t={};for(let o of Object.keys(e))e[o]!==void 0&&(t[o]=e[o]);return t}function tn(e){let{t}=b(),o=Ai(e),{currentFormatting:n={},onFormat:r,onUndo:l,onRedo:s,canUndo:p=false,canRedo:m=false,disabled:a$1=false,className:c,style:u,enableShortcuts:d=true,editorRef:h,children:b$1,showFontPicker:f=true,showFontSizePicker:x=true,showTextColorPicker:v=true,showHighlightColorPicker:y=true,showAlignmentButtons:S=true,showListButtons:w=true,showLineSpacingPicker:I=true,showStylePicker:P=true,documentStyles:W,theme:O,showZoomControl:we=true,zoom:ce,onZoomChange:be,onRefocusEditor:H,imageContext:X,onImageWrapType:M,onImageTransform:F,onOpenImageProperties:Z,tableContext:J,onTableAction:Re,inline:ue=false}=o,ot=useRef(null),z=useCallback(E=>{!a$1&&r&&r(E);},[a$1,r]),Pt=useCallback(()=>{!a$1&&p&&l&&l();},[a$1,p,l]),kt=useCallback(()=>{!a$1&&m&&s&&s();},[a$1,m,s]),Rt=useCallback(E=>{!a$1&&r&&(r({type:"fontFamily",value:E}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),Zt=useCallback(E=>{!a$1&&r&&(r({type:"fontSize",value:E}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),Ze=useCallback(E=>{!a$1&&r&&(r({type:"textColor",value:E}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),Ue=useCallback(E=>{!a$1&&r&&(r({type:"highlightColor",value:typeof E=="string"?E:""}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),de=useCallback(E=>{!a$1&&r&&r({type:"alignment",value:E});},[a$1,r]),Lt=useCallback(()=>{!a$1&&r&&r("bulletList");},[a$1,r]),D=useCallback(()=>{!a$1&&r&&r("numberedList");},[a$1,r]),Le=useCallback(()=>{!a$1&&r&&r("indent");},[a$1,r]),nt=useCallback(()=>{!a$1&&r&&r("outdent");},[a$1,r]),He=useCallback(E=>{!a$1&&r&&(r({type:"lineSpacing",value:E}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),pe=useCallback(E=>{!a$1&&r&&(r({type:"applyStyle",value:E}),requestAnimationFrame(()=>H?.()));},[a$1,r,H]),V=useCallback(E=>{!a$1&&Re&&(Re(E),requestAnimationFrame(()=>H?.()));},[a$1,Re,H]);useEffect(()=>{if(!d)return;let E=_=>{let Ye=_.target,Qt=h?.current,hn=ot.current,fn=Qt?.contains(Ye),gn=hn?.contains(Ye);if(!fn&&!gn)return;if((_.ctrlKey||_.metaKey)&&!_.altKey)switch(_.key.toLowerCase()){case "b":_.preventDefault(),z("bold");break;case "i":_.preventDefault(),z("italic");break;case "u":_.preventDefault(),z("underline");break;case "=":_.shiftKey?(_.preventDefault(),z("superscript")):(_.preventDefault(),z("subscript"));break;case "l":_.preventDefault(),de("left");break;case "e":_.preventDefault(),de("center");break;case "r":_.preventDefault(),de("right");break;case "j":_.preventDefault(),de("both");break;case "k":_.preventDefault(),z("insertLink");break}};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E);}},[d,z,de,h]);let re=useCallback(E=>{let _=E.target;_.tagName==="INPUT"||_.tagName==="TEXTAREA"||_.tagName==="SELECT"||_.tagName==="OPTION"||E.preventDefault();},[]),Ae=useCallback(E=>{let _=E.target,Ye=document.activeElement;_.tagName==="SELECT"||_.tagName==="OPTION"||Ye?.tagName==="SELECT"||requestAnimationFrame(()=>{H?.();});},[H]);return jsxs("div",{ref:ot,className:L(!ue&&"flex items-center px-2 py-1 bg-[#f1f5f9] rounded-full min-h-[36px] overflow-x-auto mx-2 mb-1",c),style:ue?{display:"contents",...u}:u,role:ue?void 0:"toolbar","aria-label":ue?void 0:t("toolbar.ariaLabel"),"data-testid":ue?void 0:"formatting-bar",onMouseDown:ue?void 0:re,onMouseUp:ue?void 0:Ae,children:[jsxs(ie,{label:t("formattingBar.groups.history"),children:[jsx(ne,{onClick:Pt,disabled:a$1||!p,title:t("formattingBar.undoShortcut"),ariaLabel:t("formattingBar.undo"),children:jsx(T,{name:"undo",size:le})}),jsx(ne,{onClick:kt,disabled:a$1||!m,title:t("formattingBar.redoShortcut"),ariaLabel:t("formattingBar.redo"),children:jsx(T,{name:"redo",size:le})})]}),we&&jsx(ie,{label:t("formattingBar.groups.zoom"),children:jsx(Ho,{value:ce,onChange:be,minZoom:.5,maxZoom:2,disabled:a$1,compact:true,showButtons:false})}),P&&jsx(ie,{label:t("formattingBar.groups.styles"),children:jsx(Lo,{value:n.styleId||"Normal",onChange:pe,styles:W,theme:O,disabled:a$1,width:120})}),(f||x)&&jsxs(ie,{label:t("formattingBar.groups.font"),children:[f&&jsx(ro,{value:n.fontFamily||"Arial",onChange:Rt,disabled:a$1,width:60,placeholder:"Arial"}),x&&jsx(fo,{value:n.fontSize!==void 0?ho(n.fontSize):11,onChange:Zt,disabled:a$1,width:42,placeholder:"11"})]}),jsxs(ie,{label:t("formattingBar.groups.textFormatting"),children:[jsx(ne,{onClick:()=>z("bold"),active:n.bold,disabled:a$1,title:t("formattingBar.boldShortcut"),ariaLabel:t("formattingBar.bold"),children:jsx(T,{name:"format_bold",size:le})}),jsx(ne,{onClick:()=>z("italic"),active:n.italic,disabled:a$1,title:t("formattingBar.italicShortcut"),ariaLabel:t("formattingBar.italic"),children:jsx(T,{name:"format_italic",size:le})}),jsx(ne,{onClick:()=>z("underline"),active:n.underline,disabled:a$1,title:t("formattingBar.underlineShortcut"),ariaLabel:t("formattingBar.underline"),children:jsx(T,{name:"format_underlined",size:le})}),jsx(ne,{onClick:()=>z("strikethrough"),active:n.strike,disabled:a$1,title:t("formattingBar.strikethrough"),ariaLabel:t("formattingBar.strikethrough"),children:jsx(T,{name:"strikethrough_s",size:le})}),v&&jsx(qe,{mode:"text",value:n.color?.replace(/^#/,""),onChange:Ze,theme:O,disabled:a$1,title:t("formattingBar.fontColor")}),y&&jsx(qe,{mode:"highlight",value:n.highlight,onChange:Ue,theme:O,disabled:a$1,title:t("formattingBar.highlightColor")}),jsx(ne,{onClick:()=>z("insertLink"),disabled:a$1,title:t("formattingBar.insertLinkShortcut"),ariaLabel:t("formattingBar.insertLink"),children:jsx(T,{name:"link",size:le})})]}),jsxs(ie,{label:t("formattingBar.groups.script"),children:[jsx(ne,{onClick:()=>z("superscript"),active:n.superscript,disabled:a$1,title:t("formattingBar.superscriptShortcut"),ariaLabel:t("formattingBar.superscript"),children:jsx(T,{name:"superscript",size:le})}),jsx(ne,{onClick:()=>z("subscript"),active:n.subscript,disabled:a$1,title:t("formattingBar.subscriptShortcut"),ariaLabel:t("formattingBar.subscript"),children:jsx(T,{name:"subscript",size:le})})]}),S&&jsx(ie,{label:t("formattingBar.groups.alignment"),children:jsx(wo,{value:n.alignment||"left",onChange:de,disabled:a$1})}),(w||I)&&jsxs(ie,{label:t("formattingBar.groups.listFormatting"),children:[w&&jsx(Mo,{listState:n.listState||Po(),onBulletList:Lt,onNumberedList:D,onIndent:Le,onOutdent:nt,disabled:a$1,showIndentButtons:true,compact:true,hasIndent:(n.indentLeft??0)>0}),I&&jsx(Ro,{value:n.lineSpacing,onChange:He,disabled:a$1})]}),X&&M&&jsxs(ie,{label:t("formattingBar.groups.image"),children:[jsx($o,{imageContext:X,onChange:M,disabled:a$1}),F&&jsx(Go,{onTransform:F,disabled:a$1}),Z&&jsx(ne,{onClick:Z,disabled:a$1,title:t("formattingBar.imagePropertiesShortcut"),ariaLabel:t("formattingBar.imageProperties"),children:jsx(T,{name:"tune",size:le})})]}),J?.isInTable&&Re&&jsxs(ie,{label:t("formattingBar.groups.table"),children:[jsx(qo,{onAction:V,disabled:a$1}),jsx(_o,{onAction:V,disabled:a$1,theme:O,value:J?.cellBorderColor?a(J.cellBorderColor,O).replace(/^#/,""):void 0}),jsx(No,{onAction:V,disabled:a$1}),jsx(Fo,{onAction:V,disabled:a$1,theme:O,value:J?.cellBackgroundColor}),jsx(Ko,{onAction:V,disabled:a$1,tableContext:J})]}),jsx(ne,{onClick:()=>z("clearFormatting"),disabled:a$1,title:t("formattingBar.clearFormatting"),ariaLabel:t("formattingBar.clearFormatting"),children:jsx(T,{name:"format_clear",size:le})}),b$1]})}var nn=12240,Tt=1440,Ct=1440,St=567,Wt=22,Di="var(--doc-text-muted)",Ni="var(--doc-text-subtle)",on="rgba(0, 0, 0, 0.02)",Fi="#4285f4",Bi="#3367d6",Oi="#2a56c6",Ne=5;function zi(e,t){return t==="inch"?(e/Ct).toFixed(2)+'"':(e/St).toFixed(1)+" cm"}function Qc({sectionProps:e,zoom:t=1,editable:o=false,onLeftMarginChange:n,onRightMarginChange:r,onFirstLineIndentChange:l,showFirstLineIndent:s=false,firstLineIndent:p=0,hangingIndent:m=false,indentLeft:a=0,indentRight:c=0,onIndentLeftChange:u,onIndentRightChange:d,unit:h="inch",className:b$2="",style:f,tabStops:x,onTabStopRemove:v}){let{t:y}=b(),[S,w]=useState(null),[I,P]=useState(null),[W,O]=useState(null),[we,ce]=useState(null),be=useRef(null),H=e?.pageWidth??nn,X=e?.marginLeft??Tt,M=e?.marginRight??Tt,F=H-X-M,Z=a$1(H)*t,J=a$1(X)*t,Re=a$1(M)*t,ue=a$1(a)*t,ot=a$1(c)*t,z=m?-p:p,Pt=a$1(z)*t,kt=J+ue,Rt=Z-Re-ot,Zt=J+ue+Pt,Ze=useCallback((D,Le)=>{o&&(D.preventDefault(),D.stopPropagation(),w(Le));},[o]),Ue=useCallback(D=>{if(!S||!be.current)return;let Le=be.current.getBoundingClientRect(),nt=D.clientX-Le.left;ce(nt);let He=b$1(nt/t);if(S==="leftMargin"){let pe=H-M-720,V=Math.round(Math.max(0,Math.min(He,pe)));O(V),n?.(V);}else if(S==="rightMargin"){let pe=H-He,V=H-X-720,re=Math.round(Math.max(0,Math.min(pe,V)));O(re),r?.(re);}else if(S==="firstLineIndent"){let pe=X+a,V=He-pe,re=F-a-c-720,Ae=Math.round(Math.max(-a,Math.min(V,re)));O(Ae),l?.(Ae);}else if(S==="leftIndent"){let pe=He-X,V=F-c-720,re=Math.round(Math.max(0,Math.min(pe,V)));O(re),u?.(re);}else if(S==="rightIndent"){let V=H-M-He,re=F-a-720,Ae=Math.round(Math.max(0,Math.min(V,re)));O(Ae),d?.(Ae);}},[S,t,H,X,M,F,a,c,n,r,l,u,d]),de=useCallback(()=>{w(null),O(null),ce(null);},[]);useEffect(()=>{if(S)return document.addEventListener("mousemove",Ue),document.addEventListener("mouseup",de),()=>{document.removeEventListener("mousemove",Ue),document.removeEventListener("mouseup",de);}},[S,Ue,de]);let Lt=Gi(H,t,h);return jsxs("div",{ref:be,className:`docx-horizontal-ruler ${b$2}`,style:{position:"relative",width:k(Z),height:Wt,backgroundColor:"transparent",overflow:"visible",userSelect:"none",cursor:S?"ew-resize":"default",...f},role:"slider","aria-label":y("ruler.horizontal"),"aria-valuemin":0,"aria-valuemax":H,children:[jsx("div",{style:{position:"absolute",top:0,left:0,width:k(J),height:Wt,backgroundColor:on,borderRight:"1px solid rgba(0,0,0,0.06)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&n?D=>Ze(D,"leftMargin"):void 0}),jsx("div",{style:{position:"absolute",top:0,right:0,width:k(Re),height:Wt,backgroundColor:on,borderLeft:"1px solid rgba(0,0,0,0.06)",cursor:o?"ew-resize":"default",zIndex:1},onMouseDown:o&&r?D=>Ze(D,"rightMargin"):void 0}),jsx("div",{style:{position:"absolute",inset:0,pointerEvents:"none"},children:Lt.map((D,Le)=>jsx(Ki,{tick:D},Le))}),s&&jsx(Vt,{direction:"down",positionPx:Zt,editable:o,isDragging:S==="firstLineIndent",isHovered:I==="firstLineIndent",onMouseEnter:()=>P("firstLineIndent"),onMouseLeave:()=>P(null),onMouseDown:D=>Ze(D,"firstLineIndent"),label:y("ruler.firstLineIndent")}),o&&u&&jsx(Vt,{direction:"up",positionPx:kt,editable:o,isDragging:S==="leftIndent",isHovered:I==="leftIndent",onMouseEnter:()=>P("leftIndent"),onMouseLeave:()=>P(null),onMouseDown:D=>Ze(D,"leftIndent"),label:y("ruler.leftIndent")}),o&&d&&jsx(Vt,{direction:"down",positionPx:Rt,editable:o,isDragging:S==="rightIndent",isHovered:I==="rightIndent",onMouseEnter:()=>P("rightIndent"),onMouseLeave:()=>P(null),onMouseDown:D=>Ze(D,"rightIndent"),label:y("ruler.rightIndent")}),x?.map(D=>jsx($i,{tabStop:D,positionPx:a$1(D.position)*t,onDoubleClick:()=>v?.(D.position)},D.position)),S&&W!==null&&we!==null&&jsx(Wi,{value:zi(W,h),positionPx:we})]})}function Ki({tick:e}){return jsxs(Fragment,{children:[jsx("div",{style:{position:"absolute",left:k(e.position),bottom:0,width:1,height:e.height,backgroundColor:Ni}}),e.label&&jsx("div",{style:{position:"absolute",left:k(e.position),top:3,transform:"translateX(-50%)",fontSize:"9px",color:Di,fontFamily:"sans-serif",whiteSpace:"nowrap"},children:e.label})]})}function Vt({direction:e,positionPx:t,editable:o,isDragging:n,isHovered:r,onMouseEnter:l,onMouseLeave:s,onMouseDown:p,label:m}){let a=n?Oi:r?Bi:Fi,c=Math.round(Ne*1.6),u={position:"absolute",left:k(t-Ne),width:Ne*2,height:c+2,cursor:o?"ew-resize":"default",zIndex:n?10:4,...e==="down"?{top:0}:{bottom:0}},d=e==="down"?{position:"absolute",top:1,left:0,width:0,height:0,borderLeft:`${Ne}px solid transparent`,borderRight:`${Ne}px solid transparent`,borderTop:`${c}px solid ${a}`,transition:"border-top-color 0.1s"}:{position:"absolute",bottom:1,left:0,width:0,height:0,borderLeft:`${Ne}px solid transparent`,borderRight:`${Ne}px solid transparent`,borderBottom:`${c}px solid ${a}`,transition:"border-bottom-color 0.1s"};return jsx("div",{className:"docx-ruler-indent",style:u,onMouseEnter:l,onMouseLeave:s,onMouseDown:p,role:"slider","aria-label":m,"aria-orientation":"horizontal",tabIndex:o?0:-1,children:jsx("div",{style:d})})}function Wi({value:e,positionPx:t}){return jsx("div",{style:{position:"absolute",left:k(t),top:-22,transform:"translateX(-50%)",backgroundColor:"#333",color:"#fff",fontSize:"10px",fontFamily:"sans-serif",padding:"2px 6px",borderRadius:3,whiteSpace:"nowrap",pointerEvents:"none",zIndex:20},children:e})}var Vi={left:"L",center:"C",right:"R",decimal:"D",bar:"|"};function $i({tabStop:e,positionPx:t,onDoubleClick:o}){return jsx("div",{style:{position:"absolute",left:k(t-5),bottom:0,width:10,height:12,display:"flex",alignItems:"center",justifyContent:"center",fontSize:8,fontWeight:700,color:"#555",cursor:"pointer",userSelect:"none"},onDoubleClick:n=>{n.stopPropagation(),o();},title:`${e.alignment} tab at ${(e.position/1440).toFixed(2)}"`,children:Vi[e.alignment]||"L"})}function Gi(e,t,o){let n=[];if(o==="inch"){let r=Ct/8,l=Math.ceil(e/r);for(let s=0;s<=l;s++){let p=s*r;if(p>e)break;let m=a$1(p)*t;s%8===0?n.push({position:m,height:10,label:s/8>0?String(s/8):void 0}):s%4===0?n.push({position:m,height:6}):s%2===0?n.push({position:m,height:4}):n.push({position:m,height:2});}}else {let r=St/10,l=Math.ceil(e/r);for(let s=0;s<=l;s++){let p=s*r;if(p>e)break;let m=a$1(p)*t;s%10===0?n.push({position:m,height:10,label:s/10>0?String(s/10):void 0}):s%5===0?n.push({position:m,height:6}):n.push({position:m,height:3});}}return n}function eu(e,t,o,n){let r=b$1(e/n);return t==="left"?Math.max(0,r):Math.max(0,b$1(o/n)-r)}function tu(e,t=1){let o=e?.pageWidth??nn,n=e?.marginLeft??Tt,r=e?.marginRight??Tt,l=a$1(o)*t,s=a$1(n)*t,p=a$1(r)*t;return {width:l,leftMargin:s,rightMargin:p,contentWidth:l-s-p}}function ou(e,t){return t==="inch"?(e/Ct).toFixed(2)+'"':(e/St).toFixed(1)+" cm"}function nu(e,t){let o=parseFloat(e.replace(/[^\d.]/g,""));return isNaN(o)?null:Math.round(o*(t==="inch"?Ct:St))}var iu="application/x-docx-editor",j={HTML:"text/html",PLAIN:"text/plain"};function lu(e){if(!e)return [];let t=()=>{if(!e.items||e.items.length===0)return [];let a=[];for(let c of Array.from(e.items)){if(c.kind!=="file"||!c.type.startsWith("image/"))continue;let u=c.getAsFile();u&&a.push(u);}return a},o=()=>!e.files||e.files.length===0?[]:Array.from(e.files).filter(a=>a.type.startsWith("image/")),n=t(),r=n.length?n:o();if(r.length<=1)return r;let l=["image/png","image/jpeg","image/webp","image/gif","image/svg+xml","image/bmp","image/tiff"],s=a=>{let c=a[0],u=l.indexOf(c.type);u<0&&(u=Number.MAX_SAFE_INTEGER);for(let d of a.slice(1)){let h=l.indexOf(d.type);if(h<0&&(h=Number.MAX_SAFE_INTEGER),h<u){c=d,u=h;continue}h===u&&d.size>c.size&&(c=d);}return c},p=new Map;for(let a of r){let c=a.name?.trim()??"",d=(c?c.replace(/\.[^/.]+$/,"").toLowerCase():"")||`size:${a.size}`,h=p.get(d);h?h.push(a):p.set(d,[a]);}let m=[];for(let a of p.values())m.push(s(a));return m}async function an(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let r=$t(e,o);return await wt(r)}catch(r){return n?.(r),false}}async function su(e,t={}){let{includeFormatting:o=true,onError:n}=t;try{let r=Yi(e,o);return await wt(r)}catch(r){return n?.(r),false}}function $t(e,t=true){let o=e.map(Yt).join(""),n=t?dn(e):jt(o),r=JSON.stringify(e);return {plainText:o,html:n,internal:r}}function Yi(e,t=true){let o=e.map(nl).join(`
|
|
2
|
+
`),n=t?rl(e):jt(o),r=JSON.stringify(e);return {plainText:o,html:n,internal:r}}async function wt(e){try{if(navigator.clipboard&&navigator.clipboard.write){let t=[new ClipboardItem({[j.PLAIN]:new Blob([e.plainText],{type:j.PLAIN}),[j.HTML]:new Blob([e.html],{type:j.HTML})})];return await navigator.clipboard.write(t),!0}return ln(e)}catch{return ln(e)}}function ln(e){let t=document.createElement("div");t.innerHTML=e.html,t.style.position="fixed",t.style.left="-9999px",document.body.appendChild(t);try{let o=window.getSelection();if(!o)return !1;let n=document.createRange();n.selectNodeContents(t),o.removeAllRanges(),o.addRange(n);let r=document.execCommand("copy");return o.removeAllRanges(),r}finally{document.body.removeChild(t);}}async function cu(e={}){let{cleanWordFormatting:t=true,onError:o}=e;try{if(navigator.clipboard&&navigator.clipboard.read){let n=await navigator.clipboard.read();return await ji(n,t)}return null}catch(n){return o?.(n),null}}async function ji(e,t){let o="",n="";for(let r of e)r.types.includes(j.HTML)&&(o=await(await r.getType(j.HTML)).text()),r.types.includes(j.PLAIN)&&(n=await(await r.getType(j.PLAIN)).text());return un(o,n,t)}function Xi(e,t={}){let{cleanWordFormatting:o=true}=t,n=e.clipboardData;if(!n)return null;let r=n.getData(j.HTML),l=n.getData(j.PLAIN);return un(r,l,o)}function un(e,t,o=true){let n=Ji(e),r=Qi(e);if(r){let p=e.match(/data-docx-editor-content="([^"]+)"/);if(p)try{return {runs:JSON.parse(decodeURIComponent(p[1])),fromWord:!1,fromEditor:!0,plainText:t}}catch{}}let l=e;return n&&o&&(l=el(e)),{runs:tl(l,t),fromWord:n,fromEditor:r,plainText:t}}function Ji(e){return e.includes("urn:schemas-microsoft-com:office")||e.includes("mso-")||e.includes("MsoNormal")||e.includes('class="Mso')||e.includes("<!--[if gte mso")}function Qi(e){return e.includes("data-docx-editor")||e.includes("docx-run")||e.includes("docx-paragraph")}function el(e){let t=e;return t=t.replace(/<!--\[if[\s\S]*?<!\[endif\]-->/gi,""),t=t.replace(/<!--[\s\S]*?-->/g,""),t=t.replace(/<\?xml[^>]*>/gi,""),t=t.replace(/<o:[^>]*>[\s\S]*?<\/o:[^>]*>/gi,""),t=t.replace(/<o:[^>]*\/>/gi,""),t=t.replace(/<w:[^>]*>[\s\S]*?<\/w:[^>]*>/gi,""),t=t.replace(/<w:[^>]*\/>/gi,""),t=t.replace(/\s*mso-[^:;]+:[^;]+;?/gi,""),t=t.replace(/\s*style="\s*"/gi,""),t=t.replace(/\s*class="[^"]*Mso[^"]*"/gi,""),t=t.replace(/<span[^>]*>\s*<\/span>/gi,""),t=t.replace(/<\/?font[^>]*>/gi,""),t=t.replace(/\s+/g," ").trim(),t}function tl(e,t){if(!e||e.trim()==="")return t?[Ut(t)]:[];let o=document.createElement("div");o.innerHTML=e;let n=[];return Gt(o,n,{}),n.length===0&&t?[Ut(t)]:n}function Gt(e,t,o){if(e.nodeType===Node.TEXT_NODE){let s=e.textContent||"";(s.trim()||s.includes(" "))&&t.push(Ut(s,o));return}if(e.nodeType!==Node.ELEMENT_NODE)return;let n=e,r=n.tagName.toLowerCase(),l={...o,...ol(n)};switch(r){case "br":t.push(cn(l));return;case "p":case "div":for(let s of n.childNodes)Gt(s,t,l);n.nextSibling&&t.push(cn(l));return;case "b":case "strong":l.bold=true;break;case "i":case "em":l.italic=true;break;case "u":l.underline={style:"single"};break;case "s":case "strike":case "del":l.strike=true;break;case "sup":l.vertAlign="superscript";break;case "sub":l.vertAlign="subscript";break;case "code":case "pre":l.fontFamily={ascii:"Courier New"};break}for(let s of n.childNodes)Gt(s,t,l);}function ol(e){let t={},o=e.style;(o.fontWeight==="bold"||parseInt(o.fontWeight)>=700)&&(t.bold=true),o.fontStyle==="italic"&&(t.italic=true);let n=o.textDecoration||o.textDecorationLine;if(n&&(n.includes("underline")&&(t.underline={style:"single"}),n.includes("line-through")&&(t.strike=true)),o.fontSize){let r=parseFloat(o.fontSize);isNaN(r)||(t.fontSize=Math.round(r/1.333*2));}if(o.fontFamily){let r=o.fontFamily.replace(/["']/g,"").split(",")[0].trim();r&&(t.fontFamily={ascii:r});}if(o.color){let r=sn(o.color);r&&(t.color={rgb:r});}if(o.backgroundColor&&o.backgroundColor!=="transparent"){let r=sn(o.backgroundColor);r&&(t.shading={fill:{rgb:r}});}return t}function sn(e){if(!e||e==="transparent"||e==="inherit")return null;if(e.startsWith("#"))return e.slice(1).toUpperCase();let t=e.match(/rgba?\((\d+),\s*(\d+),\s*(\d+)/);if(t){let o=parseInt(t[1]).toString(16).padStart(2,"0"),n=parseInt(t[2]).toString(16).padStart(2,"0"),r=parseInt(t[3]).toString(16).padStart(2,"0");return (o+n+r).toUpperCase()}return null}function Yt(e){return e.content.map(t=>t.type==="text"?t.text:t.type==="tab"?" ":t.type==="break"&&t.breakType==="textWrapping"?`
|
|
3
|
+
`:"").join("")}function nl(e){return (e.content||[]).map(t=>t.type==="run"?Yt(t):"").join("")}function dn(e){return e.map(al).join("")}function rl(e){return e.map(t=>`<p>${dn(t.content?.filter(o=>o.type==="run")||[])}</p>`).join("")}function al(e){let t=Yt(e);if(!t)return "";let o=jt(t),n=e.formatting;if(!n)return o;n.bold&&(o=`<strong>${o}</strong>`),n.italic&&(o=`<em>${o}</em>`),n.underline&&(o=`<u>${o}</u>`),n.strike&&(o=`<s>${o}</s>`),n.vertAlign==="superscript"&&(o=`<sup>${o}</sup>`),n.vertAlign==="subscript"&&(o=`<sub>${o}</sub>`);let r=[];if(n.fontSize){let l=n.fontSize/2;r.push(`font-size: ${l}pt`);}return n.fontFamily?.ascii&&r.push(`font-family: "${n.fontFamily.ascii}"`),n.color?.rgb&&r.push(`color: #${n.color.rgb}`),n.shading?.fill?.rgb&&r.push(`background-color: #${n.shading.fill.rgb}`),r.length>0&&(o=`<span style="${r.join("; ")}">${o}</span>`),o}function jt(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Ut(e,t){return {type:"run",formatting:t,content:[{type:"text",text:e}]}}function cn(e){return {type:"run",formatting:e,content:[{type:"break",breakType:"textWrapping"}]}}function uu(e){let{onCopy:t,onCut:o,onPaste:n,clipboardOptions:r={}}=e;return {handleCopy:async a=>{if(!t)return;let c=t();if(!c)return;a.preventDefault();let u=$t(c.runs);a.clipboardData?(a.clipboardData.setData(j.PLAIN,u.plainText),a.clipboardData.setData(j.HTML,u.html)):await wt(u);},handleCut:async a=>{if(!o)return;let c=o();if(!c)return;a.preventDefault();let u=$t(c.runs);a.clipboardData?(a.clipboardData.setData(j.PLAIN,u.plainText),a.clipboardData.setData(j.HTML,u.html)):await wt(u);},handlePaste:a=>{if(!n)return;a.preventDefault();let c=Xi(a,r);c&&n(c);},handleKeyDown:async a=>{let c=a.ctrlKey||a.metaKey;if(c&&a.key==="c"&&!a.shiftKey&&t){let u=t();u&&await an(u.runs,r);}if(c&&a.key==="x"&&!a.shiftKey&&o){let u=o();u&&await an(u.runs,r);}}}}var pn=[{action:"cut",labelKey:"contextMenu.cut",shortcutKey:"contextMenu.cutShortcut"},{action:"copy",labelKey:"contextMenu.copy",shortcutKey:"contextMenu.copyShortcut"},{action:"paste",labelKey:"contextMenu.paste",shortcutKey:"contextMenu.pasteShortcut"},{action:"pasteAsPlainText",labelKey:"contextMenu.pastePlainText",shortcutKey:"contextMenu.pastePlainTextShortcut",dividerAfter:true},{action:"delete",labelKey:"contextMenu.delete",shortcutKey:"contextMenu.deleteShortcut",dividerAfter:true},{action:"selectAll",labelKey:"contextMenu.selectAll",shortcutKey:"contextMenu.selectAllShortcut"}],sl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("circle",{cx:"4",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsx("circle",{cx:"12",cy:"12",r:"2",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M5.5 10.5L10.5 3M10.5 10.5L5.5 3",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),cl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"5",y:"5",width:"8",height:"9",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M11 5V3a1 1 0 00-1-1H4a1 1 0 00-1 1v8a1 1 0 001 1h2",stroke:"currentColor",strokeWidth:"1.5"})]}),ul=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"3",y:"3",width:"10",height:"11",rx:"1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M6 3V2a1 1 0 011-1h2a1 1 0 011 1v1",stroke:"currentColor",strokeWidth:"1.5"}),jsx("path",{d:"M6 8h4M6 11h4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),dl=()=>jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsx("path",{d:"M4 4l8 8M12 4l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})}),pl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"12",rx:"1",stroke:"currentColor",strokeWidth:"1.5",strokeDasharray:"2 2"}),jsx("rect",{x:"4",y:"4",width:"8",height:"8",fill:"currentColor",opacity:"0.3"})]}),ml=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"10",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 1v3M6.5 2.5h3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),hl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 12v3M6.5 13.5h3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),fl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"2",y:"6",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2",opacity:"0.3"}),jsx("rect",{x:"2",y:"10",width:"12",height:"4",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M5 8h6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),gl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"10",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M3 8H0.5M1.75 6.5v3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),bl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M13 8h2.5M14.25 6.5v3",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]}),vl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("rect",{x:"2",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("rect",{x:"6",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2",opacity:"0.3"}),jsx("rect",{x:"10",y:"2",width:"4",height:"12",rx:"0.5",stroke:"currentColor",strokeWidth:"1.2"}),jsx("path",{d:"M8 5v6",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),xl=()=>jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsx("path",{d:"M3 3h10a1 1 0 011 1v6a1 1 0 01-1 1H6l-3 2.5V11H3a1 1 0 01-1-1V4a1 1 0 011-1z",stroke:"currentColor",strokeWidth:"1.3"}),jsx("path",{d:"M5 6h6M5 8.5h4",stroke:"currentColor",strokeWidth:"1.2",strokeLinecap:"round"})]});function yl(e){switch(e){case "cut":return jsx(sl,{});case "copy":return jsx(cl,{});case "paste":case "pasteAsPlainText":return jsx(ul,{});case "delete":return jsx(dl,{});case "selectAll":return jsx(pl,{});case "addRowAbove":return jsx(ml,{});case "addRowBelow":return jsx(hl,{});case "deleteRow":return jsx(fl,{});case "addColumnLeft":return jsx(gl,{});case "addColumnRight":return jsx(bl,{});case "deleteColumn":return jsx(vl,{});case "addComment":return jsx(xl,{});default:return null}}var Tl=({item:e,onClick:t,isHighlighted:o,onMouseEnter:n})=>e.action==="separator"?jsx("div",{className:"docx-text-context-menu-separator",style:{height:"1px",backgroundColor:"var(--doc-border)",margin:"4px 12px"}}):jsxs(Fragment,{children:[jsxs("button",{type:"button",className:`docx-text-context-menu-item ${o?"docx-text-context-menu-item-highlighted":""} ${e.disabled?"docx-text-context-menu-item-disabled":""}`,onClick:t,onMouseEnter:n,disabled:e.disabled,role:"menuitem","aria-disabled":e.disabled,style:{display:"flex",alignItems:"center",gap:"10px",width:"100%",padding:"8px 12px",border:"none",background:o&&!e.disabled?"var(--doc-primary-light)":"transparent",cursor:e.disabled?"not-allowed":"pointer",fontSize:"13px",color:e.disabled?"var(--doc-text-subtle)":"var(--doc-text)",textAlign:"left",opacity:e.disabled?.6:1},children:[jsx("span",{style:{display:"flex",color:e.disabled?"var(--doc-border)":"var(--doc-text-muted)"},children:yl(e.action)}),jsx("span",{style:{flex:1},children:e.label}),e.shortcut&&jsx("span",{style:{fontSize:"11px",color:"var(--doc-text-subtle)",fontFamily:"monospace"},children:e.shortcut})]}),e.dividerAfter&&jsx("div",{className:"docx-text-context-menu-separator",style:{height:"1px",backgroundColor:"var(--doc-border)",margin:"4px 12px"}})]}),fu=({isOpen:e,position:t,hasSelection:o,isEditable:n,hasClipboardContent:r=true,onAction:l,onClose:s,items:p,className:m=""})=>{let a=useRef(null),[c,u]=useState(0),{t:d}=b(),h=useMemo(()=>pn.map(y=>({action:y.action,label:d(y.labelKey),shortcut:y.shortcutKey?d(y.shortcutKey):void 0,dividerAfter:y.dividerAfter})),[d]),b$1=(p||h).map(y=>{let S=(()=>{if(y.disabled!==void 0)return y.disabled;switch(y.action){case "cut":case "copy":case "delete":return !o;case "paste":case "pasteAsPlainText":return !n||!r;default:return false}})();return {...y,disabled:S}}),f=b$1.filter(y=>y.action!=="separator");useEffect(()=>{if(!e)return;let y=w=>{a.current&&!a.current.contains(w.target)&&s();},S=setTimeout(()=>{document.addEventListener("mousedown",y);},0);return ()=>{clearTimeout(S),document.removeEventListener("mousedown",y);}},[e,s]),useEffect(()=>{if(!e)return;let y=S=>{switch(S.key){case "Escape":S.preventDefault(),s();break;case "ArrowDown":S.preventDefault(),u(I=>{let P=(I+1)%f.length;for(;f[P]?.disabled&&P!==I;)P=(P+1)%f.length;return P});break;case "ArrowUp":S.preventDefault(),u(I=>{let P=(I-1+f.length)%f.length;for(;f[P]?.disabled&&P!==I;)P=(P-1+f.length)%f.length;return P});break;case "Enter":S.preventDefault();let w=f[c];w&&!w.disabled&&(l(w.action),s());break}};return document.addEventListener("keydown",y),()=>document.removeEventListener("keydown",y)},[e,c,f,l,s]),useEffect(()=>{e&&u(0);},[e]);let x=useCallback(()=>{let S=b$1.length*36+16,w=t.x,I=t.y;return typeof window<"u"&&(w+220>window.innerWidth&&(w=window.innerWidth-220-10),I+S>window.innerHeight&&(I=window.innerHeight-S-10),w<10&&(w=10),I<10&&(I=10)),{position:"fixed",top:I,left:w,minWidth:220,background:"white",border:"1px solid var(--doc-border-light)",borderRadius:"8px",boxShadow:"0 2px 10px rgba(0, 0, 0, 0.15)",zIndex:1e4,padding:"4px 0",overflow:"hidden"}},[t,b$1.length]),v=y=>{y.disabled||(l(y.action),s());};return e?jsx("div",{ref:a,className:`docx-text-context-menu ${m}`,style:x(),role:"menu","aria-label":d("contextMenu.textMenuAriaLabel"),children:b$1.map((y,S)=>{let w=f.findIndex(I=>I===y);return jsx(Tl,{item:y,onClick:()=>v(y),isHighlighted:w===c,onMouseEnter:()=>{w>=0&&!y.disabled&&u(w);}},`${y.action}-${S}`)})}):null};function gu(e={}){let{enabled:t=true,isEditable:o=true,containerRef:n,onAction:r}=e,[l,s]=useState(false),[p,m]=useState({x:0,y:0}),[a,c]=useState(false),u=useCallback(()=>{let x=window.getSelection(),v=x&&!x.isCollapsed&&x.toString().length>0;return c(!!v),!!v},[]),d=useCallback(x=>{t&&(x.preventDefault(),x.stopPropagation(),u(),m({x:x.clientX,y:x.clientY}),s(true));},[t,u]),h=useCallback(()=>{s(false);},[]),b=useCallback(x=>{switch(h(),x){case "cut":document.execCommand("cut");break;case "copy":document.execCommand("copy");break;case "paste":document.execCommand("paste");break;case "pasteAsPlainText":navigator.clipboard.readText?.().then(v=>{document.execCommand("insertText",false,v);}).catch(()=>{document.execCommand("paste");});break;case "delete":document.execCommand("delete");break;case "selectAll":document.execCommand("selectAll");break}r?.(x);},[h,r]),f=useCallback(x=>{d(x);},[d]);return useEffect(()=>{if(!l)return;let x=v=>{v.key==="Escape"&&h();};return document.addEventListener("keydown",x),()=>document.removeEventListener("keydown",x)},[l,h]),{isOpen:l,position:p,hasSelection:a,openMenu:d,closeMenu:h,handleAction:b,onContextMenu:f}}function bu(e){return {cut:"Cut",copy:"Copy",paste:"Paste",pasteAsPlainText:"Paste as Plain Text",selectAll:"Select All",delete:"Delete",separator:"",addRowAbove:"Insert row above",addRowBelow:"Insert row below",deleteRow:"Delete row",addColumnLeft:"Insert column left",addColumnRight:"Insert column right",deleteColumn:"Delete column",addComment:"Comment"}[e]}function vu(e){return {cut:"Ctrl+X",copy:"Ctrl+C",paste:"Ctrl+V",pasteAsPlainText:"Ctrl+Shift+V",selectAll:"Ctrl+A",delete:"Del",separator:"",addRowAbove:"",addRowBelow:"",deleteRow:"",addColumnLeft:"",addColumnRight:"",deleteColumn:"",addComment:""}[e]}function xu(){return pn.map(e=>({action:e.action,label:e.labelKey,shortcut:e.shortcutKey,dividerAfter:e.dividerAfter}))}function yu(e,t,o){switch(e){case "cut":case "copy":case "delete":return t;case "paste":case "pasteAsPlainText":return o;case "addComment":return t;case "selectAll":return true;default:return true}}var Se=16;function wl(){return jsx(T,{name:"table_rows",size:Se,style:{transform:"scaleY(-1)"}})}function Il(){return jsx(T,{name:"table_rows",size:Se})}function Ml(){return jsx(T,{name:"view_column",size:Se,style:{transform:"scaleX(-1)"}})}function Pl(){return jsx(T,{name:"view_column",size:Se})}function kl(){return jsx(T,{name:"delete_sweep",size:Se})}function Rl(){return jsx(T,{name:"delete_sweep",size:Se,style:{transform:"rotate(90deg)"}})}function Zl(){return jsx(T,{name:"call_merge",size:Se})}function Ll(){return jsx(T,{name:"call_split",size:Se})}function Hl(){return jsx(T,{name:"delete",size:Se,className:"text-red-600"})}var se={container:{display:"flex",alignItems:"center",gap:"4px",padding:"4px 8px",backgroundColor:"var(--doc-bg-subtle)",borderRadius:"4px",border:"1px solid var(--doc-border)",fontSize:"12px"},containerCompact:{padding:"2px 4px",gap:"2px"},containerFloating:{position:"absolute",zIndex:1e3,boxShadow:"0 2px 8px rgba(0, 0, 0, 0.15)"},group:{display:"flex",alignItems:"center",gap:"2px"},separator:{width:"1px",height:"20px",backgroundColor:"var(--doc-border-dark)",margin:"0 4px"},button:{display:"flex",alignItems:"center",justifyContent:"center",gap:"4px",padding:"4px 8px",border:"none",borderRadius:"3px",backgroundColor:"transparent",color:"var(--doc-text)",cursor:"pointer",fontSize:"12px",lineHeight:"1",transition:"background-color 0.15s, color 0.15s"},buttonCompact:{padding:"3px 5px"},buttonHover:{backgroundColor:"var(--doc-border)"},buttonDisabled:{color:"var(--doc-text-subtle)",cursor:"not-allowed"},buttonDelete:{color:"var(--doc-error)"},label:{fontSize:"11px",fontWeight:500,color:"var(--doc-text-muted)",marginRight:"8px",whiteSpace:"nowrap"}};function Ce({action:e,label:t,icon:o,disabled:n=false,onClick:r,showLabel:l=false,compact:s=false,shortcut:p}){let[m,a]=ee__default.useState(false),c=typeof e=="string"&&e.startsWith("delete"),u={...se.button,...s?se.buttonCompact:{},...m&&!n?se.buttonHover:{},...n?se.buttonDisabled:{},...c&&!n?se.buttonDelete:{}},d=p?`${t} (${p})`:t;return jsxs("button",{type:"button",className:`docx-table-toolbar-button docx-table-toolbar-${typeof e=="string"?e:e.type}`,style:u,disabled:n,onClick:r,onMouseEnter:()=>a(true),onMouseLeave:()=>a(false),title:d,"aria-label":t,children:[o,l&&jsx("span",{children:t})]})}function Xt({children:e,showSeparator:t=true}){return jsxs(Fragment,{children:[jsx("div",{style:se.group,children:e}),t&&jsx("div",{style:se.separator})]})}function Mu({context:e,onAction:t,disabled:o=false,className:n,style:r,showLabels:l=false,compact:s=false,position:p="top",children:m}){let{t:a}=b();if(!e)return null;let c=v=>{!o&&t&&e&&t(v,e);},u=e.rowCount>1,d=e.columnCount>1,h=e.hasMultiCellSelection,b$1=e.canSplitCell,f={...se.container,...s?se.containerCompact:{},...p==="floating"?se.containerFloating:{},...r},x=["docx-table-toolbar"];return n&&x.push(n),s&&x.push("docx-table-toolbar-compact"),p==="floating"&&x.push("docx-table-toolbar-floating"),jsxs("div",{className:x.join(" "),style:f,role:"toolbar","aria-label":a("table.editingTools"),children:[jsx("span",{style:se.label,children:a("table.label")}),jsxs(Xt,{children:[jsx(Ce,{action:"addRowAbove",label:a("table.insertRowAbove"),icon:jsx(wl,{}),disabled:o,onClick:()=>c("addRowAbove"),showLabel:l,compact:s}),jsx(Ce,{action:"addRowBelow",label:a("table.insertRowBelow"),icon:jsx(Il,{}),disabled:o,onClick:()=>c("addRowBelow"),showLabel:l,compact:s}),jsx(Ce,{action:"deleteRow",label:a("table.deleteRow"),icon:jsx(kl,{}),disabled:o||!u,onClick:()=>c("deleteRow"),showLabel:l,compact:s})]}),jsxs(Xt,{children:[jsx(Ce,{action:"addColumnLeft",label:a("table.insertColumnLeft"),icon:jsx(Ml,{}),disabled:o,onClick:()=>c("addColumnLeft"),showLabel:l,compact:s}),jsx(Ce,{action:"addColumnRight",label:a("table.insertColumnRight"),icon:jsx(Pl,{}),disabled:o,onClick:()=>c("addColumnRight"),showLabel:l,compact:s}),jsx(Ce,{action:"deleteColumn",label:a("table.deleteColumn"),icon:jsx(Rl,{}),disabled:o||!d,onClick:()=>c("deleteColumn"),showLabel:l,compact:s})]}),jsxs(Xt,{showSeparator:false,children:[jsx(Ce,{action:"mergeCells",label:a("table.mergeCells"),icon:jsx(Zl,{}),disabled:o||!h,onClick:()=>c("mergeCells"),showLabel:l,compact:s}),jsx(Ce,{action:"splitCell",label:a("table.splitCell"),icon:jsx(Ll,{}),disabled:o||!b$1,onClick:()=>c("splitCell"),showLabel:l,compact:s}),jsx(Ce,{action:"deleteTable",label:a("table.deleteTable"),icon:jsx(Hl,{}),disabled:o,onClick:()=>c("deleteTable"),showLabel:l,compact:s})]}),m]})}function Pu(e,t){let o=e.rows.length,n=Jt(e),r=!!(t.selectedCells&&(t.selectedCells.startRow!==t.selectedCells.endRow||t.selectedCells.startCol!==t.selectedCells.endCol)),l=mn(e,t.rowIndex,t.columnIndex),s=!!(l&&((l.formatting?.gridSpan??1)>1||l.formatting?.vMerge==="restart"));return {table:e,selection:t,hasMultiCellSelection:r,canSplitCell:s,rowCount:o,columnCount:n}}function Jt(e){if(!e.rows.length)return 0;let t=0;for(let o of e.rows){let n=0;for(let r of o.cells)n+=r.formatting?.gridSpan??1;t=Math.max(t,n);}return t}function mn(e,t,o){let n=e.rows[t];if(!n)return null;let r=0;for(let l of n.cells){let s=l.formatting?.gridSpan??1;if(o>=r&&o<r+s)return l;r+=s;}return null}function Al(e,t){let o=[],n=0;for(let r of e.cells){let l=r.formatting?.gridSpan??1;o.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...r.formatting,vMerge:void 0}}),n+=l;}for(;n<t;)o.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{}}),n++;return {type:"tableRow",cells:o,formatting:{...e.formatting,header:false}}}function El(){return {type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{}}}function ku(e,t,o="after"){let n=[...e.rows],r=o==="before"?t:t+1,l=e.rows[t]||e.rows[0],s=Jt(e),p=Al(l,s);return n.splice(r,0,p),{...e,rows:n}}function Ru(e,t){if(e.rows.length<=1)return e;let o=e.rows.filter((n,r)=>r!==t);return {...e,rows:o}}function Zu(e,t,o="after"){let n=o==="before"?t:t+1,r=e.rows.map(s=>{let p=[...s.cells],m=0,a=0;for(let c=0;c<s.cells.length;c++){let d=s.cells[c].formatting?.gridSpan??1;if(n<=m+d){a=o==="before"?c:c+1;break}m+=d,a=c+1;}return p.splice(a,0,El()),{...s,cells:p}}),l=e.columnWidths;if(e.columnWidths&&e.columnWidths.length>0){l=[...e.columnWidths];let s=e.columnWidths[t]||e.columnWidths[0]||1440;l.splice(n,0,s);}return {...e,rows:r,columnWidths:l}}function Lu(e,t){if(Jt(e)<=1)return e;let n=e.rows.map(l=>{let s=0,p=[];for(let m of l.cells){let a=m.formatting?.gridSpan??1;t>=s&&t<s+a?a>1&&p.push({...m,formatting:{...m.formatting,gridSpan:a-1}}):p.push(m),s+=a;}return {...l,cells:p}}),r=e.columnWidths;return e.columnWidths&&e.columnWidths.length>t&&(r=e.columnWidths.filter((l,s)=>s!==t)),{...e,rows:n,columnWidths:r}}function Hu(e,t){if(!t.selectedCells)return e;let{startRow:o,startCol:n,endRow:r,endCol:l}=t.selectedCells,s=r-o+1,p=l-n+1,m=e.rows.map((a,c)=>{if(c<o||c>r)return a;let u=[],d=0;for(let h of a.cells){let b=h.formatting?.gridSpan??1,f=d+b-1;d<=l&&f>=n?c===o&&d===n?u.push({...h,formatting:{...h.formatting,gridSpan:p,vMerge:s>1?"restart":void 0}}):c>o&&d===n&&u.push({...h,formatting:{...h.formatting,gridSpan:p,vMerge:"continue"}}):u.push(h),d+=b;}return {...a,cells:u}});return {...e,rows:m}}function Au(e,t,o){let n=mn(e,t,o);if(!n)return e;let r=n.formatting?.gridSpan??1,l=n.formatting?.vMerge==="restart";if(r<=1&&!l)return e;let s=e.rows.map((p,m)=>{if(m!==t&&!l)return p;let a=[],c=0;for(let u of p.cells){let d=u.formatting?.gridSpan??1;if(c===o||c<=o&&o<c+d)if(r>1)for(let h=0;h<r;h++)a.push({type:"tableCell",content:h===0?u.content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...u.formatting,gridSpan:void 0,vMerge:void 0}});else l&&m===t?a.push({...u,formatting:{...u.formatting,vMerge:void 0}}):u.formatting?.vMerge==="continue"?a.push({type:"tableCell",content:[{type:"paragraph",content:[],formatting:{}}],formatting:{...u.formatting,vMerge:void 0}}):a.push(u);else a.push(u);c+=d;}return {...p,cells:a}});return {...e,rows:s}}
|
|
4
|
+
export{bu as $,ne as A,ie as B,vc as C,xc as D,Qc as E,eu as F,tu as G,ou as H,nu as I,iu as J,j as K,lu as L,an as M,su as N,$t as O,Yi as P,wt as Q,cu as R,Xi as S,un as T,Ji as U,Qi as V,el as W,tl as X,uu as Y,fu as Z,gu as _,L as a,vu as aa,G as b,xu as ba,oe as c,yu as ca,T as d,Mu as da,vt as e,Pu as ea,en as f,Jt as fa,ro as g,mn as ga,Y as h,ku as ha,ds as i,Ru as ia,fo as j,Zu as ja,qe as k,Lu as ka,wo as l,Hu as la,Mo as m,Au as ma,Po as n,Ro as o,Lo as p,Ho as q,qo as r,_o as s,No as t,Fo as u,Ko as v,zt as w,Sc as x,tn as y,lc as z};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b}from'./chunk-GZOCOWWB.mjs';import {useState,useRef,useEffect,useCallback}from'react';import {jsx,jsxs}from'react/jsx-runtime';var J={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",alignItems:"center",justifyContent:"center",zIndex:1e4},Q={backgroundColor:"white",borderRadius:"8px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.15)",minWidth:"400px",maxWidth:"500px",width:"100%",margin:"20px"},Z={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"16px 20px",borderBottom:"1px solid var(--doc-border)"},ee={margin:0,fontSize:"18px",fontWeight:600,color:"var(--doc-text)"},te={background:"none",border:"none",fontSize:"20px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"4px 8px",lineHeight:1},re={padding:"20px"},v={marginBottom:"16px"},E={display:"block",marginBottom:"6px",fontSize:"14px",fontWeight:500,color:"var(--doc-text)"},x={width:"100%",padding:"10px 12px",border:"1px solid var(--doc-border-input)",borderRadius:"4px",fontSize:"14px",boxSizing:"border-box",outline:"none"},oe={...x,borderColor:"var(--doc-error)"},ie={...x,cursor:"pointer"},le={color:"var(--doc-error)",fontSize:"12px",marginTop:"4px"},z={color:"var(--doc-text-muted)",fontSize:"12px",marginTop:"4px"},ne={display:"flex",borderBottom:"1px solid var(--doc-border)",marginBottom:"16px"},H={padding:"10px 16px",border:"none",background:"none",cursor:"pointer",fontSize:"14px",color:"var(--doc-text-muted)",borderBottom:"2px solid transparent",marginBottom:"-1px"},F={...H,color:"var(--doc-link)",borderBottomColor:"var(--doc-link)",fontWeight:500},ae={display:"flex",justifyContent:"flex-end",gap:"12px",padding:"16px 20px",borderTop:"1px solid var(--doc-border)"},C={padding:"10px 20px",borderRadius:"4px",fontSize:"14px",fontWeight:500,cursor:"pointer",border:"none"},se={...C,backgroundColor:"var(--doc-link)",color:"white"},pe={...C,backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text)",border:"1px solid var(--doc-border-input)"},de={...C,backgroundColor:"var(--doc-error)",color:"white"},ce={...C,backgroundColor:"var(--doc-border-input)",color:"var(--doc-text-muted)",cursor:"not-allowed"};function G(t){if(!t||t.trim()==="")return false;let e=t.trim();if(e.startsWith("mailto:")||e.startsWith("tel:"))return e.length>7;if(e.startsWith("ftp://"))return e.length>6;try{let d=e.match(/^https?:\/\//)?e:`https://${e}`,k=new URL(d);return k.protocol==="http:"||k.protocol==="https:"}catch{return false}}function M(t){if(!t)return "";let e=t.trim();return e.startsWith("mailto:")||e.startsWith("tel:")||e.startsWith("ftp://")||e.match(/^https?:\/\//)?e:`https://${e}`}function ge(t){if(!t)return "unknown";let e=t.trim().toLowerCase();return e.startsWith("mailto:")?"email":e.startsWith("tel:")?"phone":e.startsWith("ftp://")?"ftp":e.startsWith("http://")||e.startsWith("https://")?"web":e.includes("@")&&!e.includes(" ")?"email":"web"}function ue({isOpen:t,onClose:e,onSubmit:d,onRemove:k,initialData:s,selectedText:h="",isEditing:n=false,bookmarks:R=[],className:$,style:K}){let{t:r}=b(),[l,g]=useState("url"),[p,L]=useState(""),[D,_]=useState(""),[b$1,N]=useState(""),[O,P]=useState(""),[y,m]=useState(""),[B,f]=useState(false),Y=useRef(null),U=useRef(null);useEffect(()=>{t&&(s?(s.bookmark?(g("bookmark"),N(s.bookmark)):(g("url"),L(s.url||"")),_(s.displayText||""),P(s.tooltip||"")):(g("url"),L(""),_(h),N(""),P("")),m(""),f(false));},[t,s,h]),useEffect(()=>{t&&setTimeout(()=>{l==="url"?Y.current?.focus():U.current?.focus();},100);},[t,l]);let V=useCallback(()=>{l==="url"&&p.trim()?G(p)?m(""):m(r("dialogs.hyperlink.invalidUrl")):m("");},[l,p,r]),S=useCallback(o=>{if(o?.preventDefault(),l==="url"){if(!p.trim()){m(r("dialogs.hyperlink.urlRequired")),f(true);return}if(!G(p)){m(r("dialogs.hyperlink.invalidUrl")),f(true);return}}else if(l==="bookmark"&&!b$1)return;let T={displayText:D.trim()||void 0,tooltip:O.trim()||void 0};l==="url"?T.url=M(p):T.bookmark=b$1,d(T);},[l,p,b$1,D,O,d]),X=useCallback(o=>{o.key==="Escape"?e():o.key==="Enter"&&!o.shiftKey&&o.target.tagName!=="TEXTAREA"&&(o.preventDefault(),S());},[e,S]),j=useCallback(o=>{o.target===o.currentTarget&&e();},[e]);if(!t)return null;let q=R.length>0,A=l==="url"&&p.trim()&&!y||l==="bookmark"&&b$1;return jsx("div",{className:`docx-hyperlink-dialog-overlay ${$||""}`,style:{...J,...K},onClick:j,onKeyDown:X,role:"dialog","aria-modal":"true","aria-labelledby":"hyperlink-dialog-title",children:jsxs("div",{className:"docx-hyperlink-dialog",style:Q,children:[jsxs("div",{className:"docx-hyperlink-dialog-header",style:Z,children:[jsx("h2",{id:"hyperlink-dialog-title",style:ee,children:r(n?"dialogs.hyperlink.titleEdit":"dialogs.hyperlink.titleInsert")}),jsx("button",{type:"button",className:"docx-hyperlink-dialog-close",style:te,onClick:e,"aria-label":r("common.closeDialog"),children:"\xD7"})]}),jsxs("form",{className:"docx-hyperlink-dialog-body",style:re,onSubmit:S,children:[q&&jsxs("div",{className:"docx-hyperlink-dialog-tabs",style:ne,children:[jsx("button",{type:"button",className:`docx-hyperlink-dialog-tab ${l==="url"?"active":""}`,style:l==="url"?F:H,onClick:()=>g("url"),"aria-selected":l==="url",children:r("dialogs.hyperlink.tabWebAddress")}),jsx("button",{type:"button",className:`docx-hyperlink-dialog-tab ${l==="bookmark"?"active":""}`,style:l==="bookmark"?F:H,onClick:()=>g("bookmark"),"aria-selected":l==="bookmark",children:r("dialogs.hyperlink.tabBookmark")})]}),l==="url"&&jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsx("label",{htmlFor:"hyperlink-url",style:E,children:r("dialogs.hyperlink.urlLabel")}),jsx("input",{ref:Y,id:"hyperlink-url",type:"text",className:"docx-hyperlink-dialog-input",style:y&&B?oe:x,value:p,onChange:o=>{L(o.target.value),B&&m("");},onBlur:()=>{f(true),V();},placeholder:r("dialogs.hyperlink.urlPlaceholder"),"aria-invalid":!!y,"aria-describedby":y?"url-error":"url-hint"}),y&&B&&jsx("div",{id:"url-error",style:le,children:y}),!y&&jsx("div",{id:"url-hint",style:z,children:r("dialogs.hyperlink.urlHint")})]}),l==="bookmark"&&jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsx("label",{htmlFor:"hyperlink-bookmark",style:E,children:r("dialogs.hyperlink.bookmarkLabel")}),jsxs("select",{ref:U,id:"hyperlink-bookmark",className:"docx-hyperlink-dialog-select",style:ie,value:b$1,onChange:o=>N(o.target.value),children:[jsx("option",{value:"",children:r("dialogs.hyperlink.bookmarkPlaceholder")}),R.map(o=>jsx("option",{value:o.name,children:o.label||o.name},o.name))]})]}),jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsx("label",{htmlFor:"hyperlink-display-text",style:E,children:r("dialogs.hyperlink.displayTextLabel")}),jsx("input",{id:"hyperlink-display-text",type:"text",className:"docx-hyperlink-dialog-input",style:x,value:D,onChange:o=>_(o.target.value),placeholder:r("dialogs.hyperlink.displayTextPlaceholder")}),jsx("div",{style:z,children:r("dialogs.hyperlink.displayTextHint")})]}),jsxs("div",{className:"docx-hyperlink-dialog-field",style:v,children:[jsx("label",{htmlFor:"hyperlink-tooltip",style:E,children:r("dialogs.hyperlink.tooltipLabel")}),jsx("input",{id:"hyperlink-tooltip",type:"text",className:"docx-hyperlink-dialog-input",style:x,value:O,onChange:o=>P(o.target.value),placeholder:r("dialogs.hyperlink.tooltipPlaceholder")})]})]}),jsxs("div",{className:"docx-hyperlink-dialog-footer",style:ae,children:[n&&k&&jsx("button",{type:"button",className:"docx-hyperlink-dialog-remove",style:de,onClick:k,children:r("dialogs.hyperlink.removeLink")}),jsx("div",{style:{flex:1}}),jsx("button",{type:"button",className:"docx-hyperlink-dialog-cancel",style:pe,onClick:e,children:r("common.cancel")}),jsx("button",{type:"submit",className:"docx-hyperlink-dialog-submit",style:A?se:ce,onClick:S,disabled:!A,children:r(n?"common.update":"common.insert")})]})]})})}function be(t,e){return {url:M(t),displayText:e}}function xe(t,e){return {bookmark:t,displayText:e}}function he(t){return !!t.url&&!t.bookmark}function fe(t){return !!t.bookmark}function Se(t){return t.displayText?t.displayText:t.url?t.url.replace(/^https?:\/\//,""):t.bookmark?t.bookmark:""}function Te(t){return t.startsWith("mailto:")?t:`mailto:${t}`}function ve(t){return t.startsWith("tel:")?t:`tel:${t.replace(/[\s\-\(\)\.]/g,"")}`}function Ee(t){return t.filter(e=>!e.name.startsWith("_")).map(e=>({name:e.name,label:e.name})).sort((e,d)=>e.name.localeCompare(d.name))}function Ce(){let[t,e]=useState({isOpen:false,isEditing:false}),d=useCallback(n=>{e({isOpen:true,selectedText:n,initialData:void 0,isEditing:false});},[]),k=useCallback(n=>{e({isOpen:true,initialData:n,selectedText:n.displayText,isEditing:true});},[]),s=useCallback(()=>{e(n=>({...n,isOpen:false}));},[]),h=useCallback(()=>{e(n=>({...n,isOpen:!n.isOpen}));},[]);return {state:t,openInsert:d,openEdit:k,close:s,toggle:h}}var Le=ue;
|
|
2
|
+
export{G as a,M as b,ge as c,ue as d,be as e,xe as f,he as g,fe as h,Se as i,Te as j,ve as k,Ee as l,Ce as m,Le as n};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import {b}from'./chunk-GZOCOWWB.mjs';import {useState,useCallback,useRef,useEffect}from'react';import {jsx,jsxs,Fragment}from'react/jsx-runtime';function _(){return {matchCase:false,matchWholeWord:false,useRegex:false}}function q(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function J(e,n){if(!e)return null;try{let t;n.useRegex?t=e:t=q(e),n.matchWholeWord&&(t=`\\b${t}\\b`);let i=n.matchCase?"g":"gi";return new RegExp(t,i)}catch{return null}}function D(e,n,t){if(!e||!n)return [];let i=[],c=n;t.matchCase||(c=n.toLowerCase());let x=E=>E.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),d;t.matchWholeWord?d=`\\b${x(c)}\\b`:d=x(c);let l=t.matchCase?"g":"gi",u=new RegExp(d,l),g;for(;(g=u.exec(e))!==null;)i.push({start:g.index,end:g.index+g[0].length}),g[0].length===0&&u.lastIndex++;return i}function Se(e,n,t,i){let c=J(n,i);return c?e.replace(c,t):e}function ye(e,n,t,i,c=0){let x=D(e,n,i),d=x.find(u=>u.start>=c)||x[0];return d?{content:e.substring(0,d.start)+t+e.substring(d.end),replaced:true,matchStart:d.start,matchEnd:d.start+t.length}:{content:e,replaced:false,matchStart:-1,matchEnd:-1}}function Ce(e){return e?e.totalCount===0?"No results":e.totalCount===1?"1 match":`${e.currentIndex+1} of ${e.totalCount} matches`:""}function Re(e){return !e||e.trim()===""}function Te(){return {currentMatchColor:"#FFFF00",otherMatchColor:"#FFFFAA"}}function k(e){if(!e||!e.content)return "";let n="";for(let t of e.content)t.type==="text"?n+=t.text||"":t.type==="tab"?n+=" ":t.type==="break"&&t.breakType==="textWrapping"&&(n+=`
|
|
2
|
+
`);return n}function Fe(e){if(!e||!e.content)return "";let n="";for(let t of e.content)if(t.type==="run")n+=k(t);else if(t.type==="hyperlink")for(let i of t.children||[])i.type==="run"&&(n+=k(i));return n}function Ie(e,n,t){if(!e||!n)return [];let i=[],c=e.package?.document||e.package?.document;if(!c||!c.content)return i;let x=0;for(let d of c.content)if(d.type==="paragraph"){let l=Q(d,n,t,x);i.push(...l),x++;}else if(d.type==="table")for(let l of d.rows||[])for(let u of l.cells||[])for(let g of u.content||[])g.type;return i}function Q(e,n,t,i){let c=[],x=Fe(e);if(!x)return c;let d=D(x,n,t);for(let l of d){let u=ve(e,l.start);c.push({paragraphIndex:i,contentIndex:u.contentIndex,startOffset:u.offsetInContent,endOffset:u.offsetInContent+(l.end-l.start),text:x.substring(l.start,l.end)});}return c}function ve(e,n){if(!e||!e.content)return {contentIndex:0,runIndex:0,offsetInContent:n};let t=0,i=0;for(let c of e.content){let x="";if(c.type==="run")x=k(c);else if(c.type==="hyperlink")for(let l of c.children||[])l.type==="run"&&(x+=k(l));let d=x.length;if(t+d>n)return {contentIndex:i,runIndex:i,offsetInContent:n-t};t+=d,i++;}return {contentIndex:Math.max(0,e.content.length-1),runIndex:Math.max(0,e.content.length-1),offsetInContent:0}}function Ee(e,n){if(!e||!n)return;let t=e.querySelector(`[data-paragraph-index="${n.paragraphIndex}"]`);t&&t.scrollIntoView({behavior:"smooth",block:"center"});}function Oe(e){let[n,t]=useState({isOpen:false,searchText:"",replaceText:"",options:_(),matches:[],currentIndex:0,replaceMode:e?.initialReplaceMode??false}),i=useCallback(r=>{t(o=>({...o,isOpen:true,replaceMode:false,searchText:r||o.searchText,matches:[],currentIndex:0}));},[]),c=useCallback(r=>{t(o=>({...o,isOpen:true,replaceMode:true,searchText:r||o.searchText,matches:[],currentIndex:0}));},[]),x=useCallback(()=>{t(r=>({...r,isOpen:false}));},[]),d=useCallback(()=>{t(r=>({...r,isOpen:!r.isOpen}));},[]),l=useCallback(r=>{t(o=>({...o,searchText:r}));},[]),u=useCallback(r=>{t(o=>({...o,replaceText:r}));},[]),g=useCallback(r=>{t(o=>({...o,options:{...o.options,...r}}));},[]),E=useCallback((r,o=0)=>{let M=Math.max(0,Math.min(o,r.length-1));t(L=>({...L,matches:r,currentIndex:r.length>0?M:0})),e?.onMatchesChange?.(r),r.length>0?e?.onCurrentMatchChange?.(r[M],M):e?.onCurrentMatchChange?.(null,-1);},[e]),O=useCallback(()=>{let r=0;return t(o=>o.matches.length===0?o:(r=(o.currentIndex+1)%o.matches.length,{...o,currentIndex:r})),r},[]),P=useCallback(()=>{let r=0;return t(o=>o.matches.length===0?o:(r=o.currentIndex===0?o.matches.length-1:o.currentIndex-1,{...o,currentIndex:r})),r},[]),N=useCallback(r=>{t(o=>o.matches.length===0||r<0||r>=o.matches.length?o:{...o,currentIndex:r});},[]),p=useCallback(()=>n.matches.length===0?null:n.matches[n.currentIndex]||null,[n.matches,n.currentIndex]),h=useCallback(()=>n.matches.length>0,[n.matches.length]);return {state:n,openFind:i,openReplace:c,close:x,toggle:d,setSearchText:l,setReplaceText:u,setOptions:g,setMatches:E,goToNextMatch:O,goToPreviousMatch:P,goToMatch:N,getCurrentMatch:p,hasMatches:h}}var Le={position:"fixed",top:0,left:0,right:0,bottom:0,backgroundColor:"transparent",display:"flex",alignItems:"flex-start",justifyContent:"flex-end",zIndex:1e4,pointerEvents:"none"},ke={backgroundColor:"white",borderRadius:"4px",boxShadow:"0 4px 20px rgba(0, 0, 0, 0.2)",minWidth:"360px",maxWidth:"440px",width:"100%",margin:"60px 20px 20px 20px",pointerEvents:"auto"},Pe={display:"flex",justifyContent:"space-between",alignItems:"center",padding:"12px 16px",borderBottom:"1px solid var(--doc-border)",backgroundColor:"var(--doc-bg-subtle)",borderTopLeftRadius:"4px",borderTopRightRadius:"4px"},Ne={margin:0,fontSize:"14px",fontWeight:600,color:"var(--doc-text)"},we={background:"none",border:"none",fontSize:"18px",cursor:"pointer",color:"var(--doc-text-muted)",padding:"2px 6px",lineHeight:1},_e={padding:"16px"},ee={display:"flex",alignItems:"center",gap:"8px",marginBottom:"12px"},te={width:"60px",fontSize:"13px",color:"var(--doc-text)",flexShrink:0},W={flex:1,padding:"8px 10px",border:"1px solid var(--doc-border-input)",borderRadius:"3px",fontSize:"13px",boxSizing:"border-box",outline:"none"},ne={...W,borderColor:"var(--doc-link)",boxShadow:"0 0 0 2px rgba(5, 99, 193, 0.1)"},De={display:"flex",flexDirection:"column",gap:"6px",marginLeft:"8px"},Y={padding:"6px 12px",borderRadius:"3px",fontSize:"12px",fontWeight:500,cursor:"pointer",border:"1px solid var(--doc-border-input)",backgroundColor:"var(--doc-bg-input)",color:"var(--doc-text)",minWidth:"80px",textAlign:"center"},oe={...Y,backgroundColor:"var(--doc-bg-hover)",color:"var(--doc-text-placeholder)",cursor:"not-allowed"},U={padding:"6px 10px",borderRadius:"3px",fontSize:"14px",cursor:"pointer",border:"1px solid var(--doc-border-input)",backgroundColor:"var(--doc-bg-input)",color:"var(--doc-text)"},re={...U,color:"var(--doc-border-input)",cursor:"not-allowed"},Ae={display:"flex",gap:"16px",marginTop:"4px",marginLeft:"68px"},B={display:"flex",alignItems:"center",gap:"6px",fontSize:"12px",color:"var(--doc-text-muted)",cursor:"pointer"},ae={width:"14px",height:"14px",cursor:"pointer"},ie={marginLeft:"68px",fontSize:"12px",color:"var(--doc-text-muted)",marginBottom:"8px"},Be={...ie,color:"var(--doc-error)"},We=({style:e})=>jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:e,children:jsx("polyline",{points:"18 15 12 9 6 15"})}),Ye=({style:e})=>jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",style:e,children:jsx("polyline",{points:"6 9 12 15 18 9"})});function Ue({isOpen:e,onClose:n,onFind:t,onFindNext:i,onFindPrevious:c,onReplace:x,onReplaceAll:d,onHighlightMatches:l,onClearHighlights:u,initialSearchText:g="",replaceMode:E=false,currentResult:O,className:P,style:N}){let{t:p}=b(),[h,r]=useState(""),[o,M]=useState(""),[L,K]=useState(E),[R,ce]=useState(false),[T,le]=useState(false),[s,F]=useState(null),[se,z]=useState(false),[de,$]=useState(false),w=useRef(null),G=useRef(null);useEffect(()=>{O!==void 0&&F(O);},[O]),useEffect(()=>{if(e){if(r(g),M(""),K(E),F(null),setTimeout(()=>{w.current?.focus(),w.current?.select();},100),g){let a=t(g,{matchCase:R,matchWholeWord:T});F(a),a?.matches&&l&&l(a.matches);}}else u&&u();},[e,g,E]);let S=useCallback(()=>{if(!h.trim()){F(null),u&&u();return}let a=t(h,{matchCase:R,matchWholeWord:T});F(a),a?.matches&&l?l(a.matches):u&&u();},[h,R,T,t,l,u]);useEffect(()=>{e&&h.trim()&&S();},[R,T]);let pe=useCallback(a=>{r(a.target.value);},[]),ue=useCallback(a=>{a.key==="Enter"?(a.preventDefault(),a.shiftKey?j():s?V():S()):a.key==="Escape"&&n();},[s,S,n]),fe=useCallback(a=>{a.key==="Enter"?(a.preventDefault(),H()):a.key==="Escape"&&n();},[n]),V=useCallback(()=>{if(!h.trim()){S();return}if(!s){S();return}if(i()&&s){let y=(s.currentIndex+1)%s.totalCount;F({...s,currentIndex:y});}},[h,s,S,i]),j=useCallback(()=>{if(!h.trim()){S();return}if(!s){S();return}if(c()&&s){let y=s.currentIndex===0?s.totalCount-1:s.currentIndex-1;F({...s,currentIndex:y});}},[h,s,S,c]),H=useCallback(()=>{if(!s||s.totalCount===0)return;if(x(o)){let y=t(h,{matchCase:R,matchWholeWord:T});F(y),y?.matches&&l&&l(y.matches);}},[s,o,h,R,T,x,t,l]),xe=useCallback(()=>{if(!h.trim())return;d(h,o,{matchCase:R,matchWholeWord:T})>0&&(F({matches:[],totalCount:0,currentIndex:-1}),u&&u());},[h,o,R,T,d,u]),he=useCallback(()=>{K(a=>{let y=!a;return y&&setTimeout(()=>G.current?.focus(),100),y});},[]),ge=useCallback(a=>{a.target,a.currentTarget;},[]),me=useCallback(a=>{a.key==="Escape"&&n();},[n]);if(!e)return null;let I=s&&s.totalCount>0,be=s&&s.totalCount===0&&h.trim();return jsx("div",{className:`docx-find-replace-dialog-overlay ${P||""}`,style:{...Le,...N},onClick:ge,onKeyDown:me,children:jsxs("div",{className:"docx-find-replace-dialog","data-testid":"find-replace-dialog",style:ke,role:"dialog","aria-modal":"false","aria-labelledby":"find-replace-dialog-title",children:[jsxs("div",{className:"docx-find-replace-dialog-header",style:Pe,children:[jsx("h2",{id:"find-replace-dialog-title",style:Ne,children:p(L?"dialogs.findReplace.titleFindReplace":"dialogs.findReplace.titleFind")}),jsx("button",{type:"button",className:"docx-find-replace-dialog-close",style:we,onClick:n,"aria-label":p("common.closeDialog"),children:"\xD7"})]}),jsxs("div",{className:"docx-find-replace-dialog-body",style:_e,children:[jsxs("div",{className:"docx-find-replace-dialog-row",style:ee,children:[jsx("label",{htmlFor:"find-text",style:te,children:p("dialogs.findReplace.findLabel")}),jsx("input",{ref:w,id:"find-text",type:"text",className:"docx-find-replace-dialog-input",style:se?ne:W,value:h,onChange:pe,onKeyDown:ue,onFocus:()=>z(true),onBlur:()=>{z(false),h.trim()&&!s&&S();},placeholder:p("dialogs.findReplace.findPlaceholder"),"aria-label":p("dialogs.findReplace.findAriaLabel")}),jsxs("div",{style:{display:"flex",gap:"4px"},children:[jsx("button",{type:"button",className:"docx-find-replace-dialog-nav",style:I?U:re,onClick:j,disabled:!I,"aria-label":p("dialogs.findReplace.findPrevious"),title:p("dialogs.findReplace.findPreviousTitle"),children:jsx(We,{})}),jsx("button",{type:"button",className:"docx-find-replace-dialog-nav",style:I?U:re,onClick:V,disabled:!I,"aria-label":p("dialogs.findReplace.findNext"),title:p("dialogs.findReplace.findNextTitle"),children:jsx(Ye,{})})]})]}),I&&jsx("div",{className:"docx-find-replace-dialog-status",style:ie,children:p("dialogs.findReplace.matchCount",{current:s.currentIndex+1,total:s.totalCount})}),be&&jsx("div",{className:"docx-find-replace-dialog-status",style:Be,children:p("dialogs.findReplace.noResults")}),L&&jsx(Fragment,{children:jsxs("div",{className:"docx-find-replace-dialog-row",style:ee,children:[jsx("label",{htmlFor:"replace-text",style:te,children:p("dialogs.findReplace.replaceLabel")}),jsx("input",{ref:G,id:"replace-text",type:"text",className:"docx-find-replace-dialog-input",style:de?ne:W,value:o,onChange:a=>M(a.target.value),onKeyDown:fe,onFocus:()=>$(true),onBlur:()=>$(false),placeholder:p("dialogs.findReplace.replacePlaceholder"),"aria-label":p("dialogs.findReplace.replaceAriaLabel")}),jsxs("div",{style:De,children:[jsx("button",{type:"button",className:"docx-find-replace-dialog-button",style:I?Y:oe,onClick:H,disabled:!I,title:p("dialogs.findReplace.replaceCurrentTitle"),children:p("dialogs.findReplace.replaceButton")}),jsx("button",{type:"button",className:"docx-find-replace-dialog-button",style:I?Y:oe,onClick:xe,disabled:!I,title:p("dialogs.findReplace.replaceAllTitle"),children:p("dialogs.findReplace.replaceAllButton")})]})]})}),jsxs("div",{className:"docx-find-replace-dialog-options",style:Ae,children:[jsxs("label",{className:"docx-find-replace-dialog-option",style:B,children:[jsx("input",{type:"checkbox",style:ae,checked:R,onChange:a=>ce(a.target.checked)}),p("dialogs.findReplace.matchCase")]}),jsxs("label",{className:"docx-find-replace-dialog-option",style:B,children:[jsx("input",{type:"checkbox",style:ae,checked:T,onChange:a=>le(a.target.checked)}),p("dialogs.findReplace.wholeWords")]}),!L&&jsx("button",{type:"button",style:{...B,background:"none",border:"none",cursor:"pointer",color:"var(--doc-link)",padding:0},onClick:he,children:p("dialogs.findReplace.toggleReplace")})]})]})]})})}var qe=Ue;export{_ as a,q as b,J as c,D as d,Se as e,ye as f,Ce as g,Re as h,Te as i,Ie as j,Q as k,Ee as l,Oe as m,Ue as n,qe as o};
|