hxy-editor 0.4.1 → 0.4.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/pd-editor.js +13 -3
- package/dist/pd-editor.umd.cjs +2 -2
- package/package.json +1 -1
package/dist/pd-editor.umd.cjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`@keyframes univer-spin{to{transform:rotate(360deg)}}@media (width>=640px){.sm\\:\\!univer-flex-row{flex-direction:row!important}.sm\\:\\!univer-justify-end{justify-content:flex-end!important}.sm\\:\\!univer-space-x-2>:not([hidden])~:not([hidden]){--univer-tw-space-x-reverse:0!important;margin-right:0!important;margin-right:calc(.5rem * var(--univer-tw-space-x-reverse))!important;margin-left:calc(.5rem * (1 - var(--univer-tw-space-x-reverse)))!important;margin-left:.5rem!important;margin-left:calc(.5rem * calc(1 - var(--univer-tw-space-x-reverse)))!important}.sm\\:\\!univer-rounded-lg{border-radius:.5rem!important}.sm\\:\\!univer-text-left{text-align:left!important}}@media (width>=768px){.md\\:univer-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@keyframes popup-slide-up-in{0%{transform-origin:0 0;opacity:0;transform:scaleY(0)}to{transform-origin:0 0;opacity:1;transform:scaleY(1)}}@keyframes popup-slide-up-out{0%{transform-origin:0 0;opacity:1;transform:scaleY(1)}to{transform-origin:0 0;opacity:0;transform:scaleY(0)}}@keyframes enter{0%{opacity:1;opacity:var(--univer-tw-enter-opacity,1);transform:translateZ(0)scaleZ(1)rotate(0);transform:translate3d(var(--univer-tw-enter-translate-x,0),var(--univer-tw-enter-translate-y,0),0) scale3d(var(--univer-tw-enter-scale,1),var(--univer-tw-enter-scale,1),var(--univer-tw-enter-scale,1)) rotate(var(--univer-tw-enter-rotate,0))}}@keyframes exit{to{opacity:1;opacity:var(--univer-tw-exit-opacity,1);transform:translateZ(0)scaleZ(1)rotate(0);transform:translate3d(var(--univer-tw-exit-translate-x,0),var(--univer-tw-exit-translate-y,0),0) scale3d(var(--univer-tw-exit-scale,1),var(--univer-tw-exit-scale,1),var(--univer-tw-exit-scale,1)) rotate(var(--univer-tw-exit-rotate,0))}}.focus\\:univer-ring-2:focus,.focus-visible\\:univer-ring-2:focus-visible{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}@media (width>=640px){.sm\\:\\!univer-block{display:block!important}}.univer-w-\\[328px\\]{width:328px}.univer-flex-\\[0_0_auto\\]{flex:none}.doc-shell[data-v-0118edc0]{letter-spacing:normal;flex-direction:column;height:760px;font-size:14px;line-height:normal;display:flex}.doc-layout[data-v-0118edc0]{flex:1;min-height:0;display:flex}.doc-canvas[data-v-0118edc0]{background:#f7f8fa;flex:1;min-width:0;position:relative}.readonly-badge[data-v-0118edc0]{z-index:30;color:#8c8c8c;pointer-events:none;background:#ffffffeb;border:1px solid #e0e0e0;border-radius:999px;padding:3px 10px;font-size:12px;position:absolute;top:10px;right:14px;box-shadow:0 1px 4px #0000000f}.doc-editor[data-v-0118edc0]{contain:layout style;letter-spacing:normal;font-size:14px;line-height:normal;position:absolute;inset:0;overflow:hidden}.link-dialog-mask[data-v-0118edc0]{z-index:30;background:#00000047;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.link-dialog[data-v-0118edc0]{background:#fff;border-radius:12px;width:400px;max-width:calc(100% - 48px);padding:22px 24px 18px;box-shadow:0 12px 40px #00000029}.link-dialog-title[data-v-0118edc0]{color:#1a1a1a;margin-bottom:18px;font-size:16px;font-weight:600}.link-dialog-field[data-v-0118edc0]{margin-bottom:14px}.field-label[data-v-0118edc0]{color:#595959;margin-bottom:6px;font-size:13px;font-weight:500;display:block}.field-input[data-v-0118edc0]{color:#333;background:#fafafa;border:1px solid #e0e0e0;border-radius:6px;outline:none;width:100%;height:34px;padding:0 10px;font-size:13px;transition:border-color .15s,box-shadow .15s}.field-input[data-v-0118edc0]:focus{background:#fff;border-color:#25b864;box-shadow:0 0 0 2px #25b8641f}.field-input.error[data-v-0118edc0]{border-color:#e5484d}.field-error[data-v-0118edc0]{color:#e5484d;margin-top:4px;font-size:12px}.link-dialog-tip[data-v-0118edc0]{color:#bfbfbf;margin-bottom:16px;font-size:12px}.link-dialog-actions[data-v-0118edc0]{justify-content:flex-end;gap:10px;display:flex}.dialog-btn[data-v-0118edc0]{cursor:pointer;border:none;border-radius:6px;height:32px;padding:0 18px;font-size:13px;transition:all .15s}.dialog-btn.cancel[data-v-0118edc0]{color:#595959;background:#f5f5f5}.dialog-btn.cancel[data-v-0118edc0]:hover{background:#ececec}.dialog-btn.confirm[data-v-0118edc0]{color:#fff;background:#25b864;font-weight:500}.dialog-btn.confirm[data-v-0118edc0]:hover:not(:disabled){background:#1fa257}.dialog-btn.confirm[data-v-0118edc0]:disabled{cursor:not-allowed;background:#bfe6d2}.doc-statusbar[data-v-0118edc0]{color:#8c8c8c;background:#fafbfc;border-top:1px solid #f0f0f0;align-items:center;gap:8px;padding:8px 20px;font-size:12px;display:flex}.status-count[data-v-0118edc0]{color:#595959;font-weight:500}.status-flex[data-v-0118edc0]{flex:1}.status-tip[data-v-0118edc0]{color:#bfbfbf}.link-hover-bar[data-v-0118edc0]{z-index:1080;white-space:nowrap;-webkit-user-select:none;user-select:none;background:#fff;border:1px solid #e8e8e8;border-radius:6px;align-items:center;gap:2px;padding:4px 8px;display:flex;position:fixed;transform:translate(-50%)translateY(-100%);box-shadow:0 4px 16px #0000001f}.hover-label[data-v-0118edc0]{color:#3370ff;cursor:pointer;padding:0 6px;font-size:13px;font-weight:500}.hover-label[data-v-0118edc0]:hover{text-decoration:underline}.hover-icon-btn[data-v-0118edc0]{color:#595959;cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;width:28px;height:28px;padding:0;transition:background .12s,color .12s;display:inline-flex;position:relative}.hover-icon-btn[data-v-0118edc0]:hover{color:#1d2129;background:#f2f3f5}.hover-icon-tip[data-v-0118edc0]{color:#3370ff;white-space:nowrap;pointer-events:none;font-size:10px;position:absolute;bottom:-18px;left:50%;transform:translate(-50%)}.hover-unlink-btn[data-v-0118edc0]:hover{color:#e5484d;background:#e5484d14}.hover-sep[data-v-0118edc0]{background:#ececec;flex-shrink:0;width:1px;height:16px;margin:0 4px}.hover-bar-arrow[data-v-0118edc0]{background:#fff;border-bottom:1px solid #e8e8e8;border-right:1px solid #e8e8e8;width:8px;height:8px;position:absolute;bottom:-5px;left:50%;transform:translate(-50%)rotate(45deg)}.hover-style[data-v-0118edc0]{position:relative}.hover-style-menu[data-v-0118edc0]{text-align:left;background:#fff;border:1px solid #e8e8e8;border-radius:6px;min-width:140px;padding:4px;position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);box-shadow:0 4px 16px #0000001f}.hover-style-item[data-v-0118edc0]{cursor:pointer;color:#595959;border-radius:4px;align-items:center;gap:6px;padding:6px 10px;font-size:13px;display:flex}.hover-style-item[data-v-0118edc0]:hover{background:#f7f8fa}.hover-style-item.active[data-v-0118edc0]{color:#3370ff}.style-check[data-v-0118edc0]{color:#3370ff;text-align:center;flex-shrink:0;width:16px;font-size:12px}.style-name[data-v-0118edc0]{font-size:13px}[data-u-comp=rect-popup]:has(.univer-max-w-80){visibility:hidden;pointer-events:none}*,:before,:after,::backdrop{--univer-tw-border-spacing-x:0;--univer-tw-border-spacing-y:0;--univer-tw-translate-x:0;--univer-tw-translate-y:0;--univer-tw-rotate:0;--univer-tw-skew-x:0;--univer-tw-skew-y:0;--univer-tw-scale-x:1;--univer-tw-scale-y:1;--univer-tw-pan-x: ;--univer-tw-pan-y: ;--univer-tw-pinch-zoom: ;--univer-tw-scroll-snap-strictness:proximity;--univer-tw-gradient-from-position: ;--univer-tw-gradient-via-position: ;--univer-tw-gradient-to-position: ;--univer-tw-ordinal: ;--univer-tw-slashed-zero: ;--univer-tw-numeric-figure: ;--univer-tw-numeric-spacing: ;--univer-tw-numeric-fraction: ;--univer-tw-ring-inset: ;--univer-tw-ring-offset-width:0px;--univer-tw-ring-offset-color:#fff;--univer-tw-ring-color:#93c5fd80;--univer-tw-ring-offset-shadow:0 0 #0000;--univer-tw-ring-shadow:0 0 #0000;--univer-tw-shadow:0 0 #0000;--univer-tw-shadow-colored:0 0 #0000;--univer-tw-blur: ;--univer-tw-brightness: ;--univer-tw-contrast: ;--univer-tw-grayscale: ;--univer-tw-hue-rotate: ;--univer-tw-invert: ;--univer-tw-saturate: ;--univer-tw-sepia: ;--univer-tw-drop-shadow: ;--univer-tw-backdrop-blur: ;--univer-tw-backdrop-brightness: ;--univer-tw-backdrop-contrast: ;--univer-tw-backdrop-grayscale: ;--univer-tw-backdrop-hue-rotate: ;--univer-tw-backdrop-invert: ;--univer-tw-backdrop-opacity: ;--univer-tw-backdrop-saturate: ;--univer-tw-backdrop-sepia: ;--univer-tw-contain-size: ;--univer-tw-contain-layout: ;--univer-tw-contain-paint: ;--univer-tw-contain-style: }*{scrollbar-color:initial;scrollbar-width:initial}.univer-sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.univer-inset-x-0{left:0;right:0}.univer-bottom-0\\.5{bottom:.125rem}.univer-bottom-6{bottom:1.5rem}.univer-left-0\\.5{left:.125rem}.univer-left-2{left:.5rem}.univer-left-\\[-16px\\]{left:-16px}.univer-right-4{right:1rem}.univer-right-px{right:1px}.univer-top-px{top:1px}.univer-z-0{z-index:0}.univer-z-\\[1081\\]{z-index:1081}.-univer-mx-1{margin-left:-.25rem;margin-right:-.25rem}.univer-my-0{margin-top:0;margin-bottom:0}.univer-ml-auto{margin-left:auto}.\\!univer-hidden{display:none!important}.univer-size-2{width:.5rem;height:.5rem}.univer-size-2\\.5{width:.625rem;height:.625rem}.univer-h-1\\/2{height:50%}.univer-h-12{height:3rem}.univer-h-2{height:.5rem}.univer-h-32{height:8rem}.univer-h-48{height:12rem}.univer-h-\\[150px\\]{height:150px}.univer-h-\\[calc\\(100\\%-2px\\)\\]{height:calc(100% - 2px)}.univer-max-h-0{max-height:0}.univer-max-h-80{max-height:20rem}.univer-max-h-\\[--radix-popper-available-height\\]{max-height:var(--radix-popper-available-height)}.univer-max-h-\\[1000px\\]{max-height:1000px}.univer-max-h-\\[40vh\\]{max-height:40vh}.univer-max-h-full{max-height:100%}.univer-max-h-screen{max-height:100vh}.univer-min-h-3\\.5{min-height:.875rem}.univer-min-h-\\[520px\\]{min-height:520px}.\\!univer-w-fit{width:fit-content!important}.univer-w-64{width:16rem}.univer-w-72{width:18rem}.univer-w-80{width:20rem}.univer-w-\\[--radix-popper-anchor-width\\]{width:var(--radix-popper-anchor-width)}.univer-w-\\[calc\\(100\\%-16px\\)\\]{width:calc(100% - 16px)}.univer-min-w-36{min-width:9rem}.univer-min-w-\\[320px\\]{min-width:320px}.univer-max-w-2xl{max-width:42rem}.univer-max-w-\\[520px\\]{max-width:520px}.univer-max-w-\\[60vw\\]{max-width:60vw}.univer-max-w-sm{max-width:24rem}.univer-max-w-xs{max-width:20rem}.univer-shrink{flex-shrink:1}.univer-shrink-0{flex-shrink:0}.univer-origin-\\[--radix-hover-card-content-transform-origin\\]{transform-origin:var(--radix-hover-card-content-transform-origin)}.-univer-translate-y-1\\/2,.univer--translate-y-1\\/2{--univer-tw-translate-y:-50%;transform:translate(var(--univer-tw-translate-x),-50%) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-translate-x-3{--univer-tw-translate-x:.75rem;transform:translate(.75rem,var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.-univer-rotate-90{--univer-tw-rotate:-90deg;transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(-90deg) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-rotate-0{--univer-tw-rotate:0deg;transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(0) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-rotate-45{--univer-tw-rotate:45deg;transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(45deg) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-rotate-\\[-90deg\\]{--univer-tw-rotate:-90deg;transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(-90deg) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.\\!univer-animate-none{animation:none!important}.univer-cursor-crosshair{cursor:crosshair}.univer-cursor-grabbing{cursor:grabbing}.univer-resize{resize:both}.univer-grid-flow-row{grid-auto-flow:row}.univer-grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.univer-flex-col-reverse{flex-direction:column-reverse}.univer-content-center{align-content:center}.univer-gap-5{gap:1.25rem}.univer-space-y-1\\.5>:not([hidden])~:not([hidden]){--univer-tw-space-y-reverse:0;margin-top:calc(.375rem * (1 - var(--univer-tw-space-y-reverse)));margin-top:.375rem;margin-top:calc(.375rem * calc(1 - var(--univer-tw-space-y-reverse)));margin-bottom:0;margin-bottom:calc(.375rem * var(--univer-tw-space-y-reverse))}.univer-divide-x>:not([hidden])~:not([hidden]){--univer-tw-divide-x-reverse:0;border-right-width:0;border-right-width:calc(1px * var(--univer-tw-divide-x-reverse));border-left-width:calc(1px * (1 - var(--univer-tw-divide-x-reverse)));border-left-width:1px;border-left-width:calc(1px * calc(1 - var(--univer-tw-divide-x-reverse)))}.univer-divide-y-0>:not([hidden])~:not([hidden]){--univer-tw-divide-y-reverse:0;border-top-width:calc(0px * (1 - var(--univer-tw-divide-y-reverse)));border-top-width:0;border-top-width:calc(0px * calc(1 - var(--univer-tw-divide-y-reverse)));border-bottom-width:0;border-bottom-width:calc(0px * var(--univer-tw-divide-y-reverse))}.univer-text-ellipsis{text-overflow:ellipsis}.univer-text-balance{text-wrap:balance}.\\!univer-rounded-b-none{border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}.\\!univer-rounded-l-none{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.\\!univer-rounded-r-none{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.\\!univer-rounded-t-none{border-top-left-radius:0!important;border-top-right-radius:0!important}.univer-rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.\\!univer-border-l-0{border-left-width:0!important}.\\!univer-border-t-0{border-top-width:0!important}.univer-border-b-0{border-bottom-width:0}.univer-border-l{border-left-width:1px}.univer-border-l-0{border-left-width:0}.univer-border-r{border-right-width:1px}.univer-border-t-0{border-top-width:0}.univer-border-dashed{border-style:dashed}.\\!univer-border-gray-200{border-color:var(--univer-gray-200)!important}.univer-border-gray-300{border-color:var(--univer-gray-300)}.univer-border-primary-200{border-color:var(--univer-primary-200)}.univer-border-primary-300{border-color:var(--univer-primary-300)}.univer-border-red-300{border-color:var(--univer-red-300)}.univer-border-red-500{border-color:var(--univer-red-500)}.univer-border-white{border-color:var(--univer-white)}.\\!univer-bg-primary-600{background-color:var(--univer-primary-600)!important}.univer-bg-\\[rgba\\(0\\,0\\,0\\,0\\.8\\)\\]{background-color:#000c}.univer-bg-gray-800{background-color:var(--univer-gray-800)}.univer-bg-gray-900{background-color:var(--univer-gray-900)}.univer-bg-primary-500{background-color:var(--univer-primary-500)}.univer-bg-red-500{background-color:var(--univer-red-500)}.univer-bg-sky-100\\/70{background-color:#e0f2feb3}.univer-bg-slate-100\\/80{background-color:#f1f5f9cc}.univer-bg-slate-900\\/90{background-color:#0f172ae6}.univer-bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--univer-tw-gradient-stops))}.univer-from-slate-100{--univer-tw-gradient-from:#f1f5f9 var(--univer-tw-gradient-from-position);--univer-tw-gradient-to:#f1f5f900 var(--univer-tw-gradient-to-position);--univer-tw-gradient-stops:var(--univer-tw-gradient-from), var(--univer-tw-gradient-to)}.univer-via-cyan-50{--univer-tw-gradient-to:#ecfeff00 var(--univer-tw-gradient-to-position);--univer-tw-gradient-stops:var(--univer-tw-gradient-from), #ecfeff var(--univer-tw-gradient-via-position), var(--univer-tw-gradient-to)}.univer-to-blue-100{--univer-tw-gradient-to:var(--univer-blue-100) var(--univer-tw-gradient-to-position)}.univer-fill-current{fill:currentColor}.\\!univer-p-2\\.5{padding:.625rem!important}.univer-p-6{padding:1.5rem}.\\!univer-pl-4{padding-left:1rem!important}.univer-pb-2\\.5{padding-bottom:.625rem}.univer-pl-8{padding-left:2rem}.univer-pr-32{padding-right:8rem}.univer-pr-8{padding-right:2rem}.univer-pt-4{padding-top:1rem}.univer-align-middle{vertical-align:middle}.univer-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.univer-text-\\[13px\\]{font-size:13px}.univer-text-\\[8px\\]{font-size:8px}.univer-text-sm\\/8{font-size:.875rem;line-height:2rem}.univer-text-xs\\/6{font-size:.75rem;line-height:1.5rem}.univer-leading-9{line-height:2.25rem}.univer-leading-normal{line-height:1.5}.univer-tracking-wide{letter-spacing:.025em}.univer-tracking-widest{letter-spacing:.1em}.\\!univer-text-primary-500{color:var(--univer-primary-500)!important}.univer-text-amber-500{--univer-tw-text-opacity:1;color:rgba(245,158,11,var(--univer-tw-text-opacity,1))}.univer-text-cyan-700{--univer-tw-text-opacity:1;color:rgba(14,116,144,var(--univer-tw-text-opacity,1))}.univer-text-sky-500{--univer-tw-text-opacity:1;color:rgba(14,165,233,var(--univer-tw-text-opacity,1))}.univer-text-sky-700{--univer-tw-text-opacity:1;color:rgba(3,105,161,var(--univer-tw-text-opacity,1))}.univer-text-sky-900{--univer-tw-text-opacity:1;color:rgba(12,74,110,var(--univer-tw-text-opacity,1))}.univer-text-slate-500{--univer-tw-text-opacity:1;color:rgba(100,116,139,var(--univer-tw-text-opacity,1))}.univer-text-slate-600{--univer-tw-text-opacity:1;color:rgba(71,85,105,var(--univer-tw-text-opacity,1))}.univer-text-slate-700{--univer-tw-text-opacity:1;color:rgba(51,65,85,var(--univer-tw-text-opacity,1))}.univer-text-slate-800{--univer-tw-text-opacity:1;color:rgba(30,41,59,var(--univer-tw-text-opacity,1))}.univer-text-violet-500{--univer-tw-text-opacity:1;color:rgba(139,92,246,var(--univer-tw-text-opacity,1))}.univer-underline-offset-4{text-underline-offset:4px}.univer-opacity-100{opacity:1}.univer-opacity-50{opacity:.5}.univer-opacity-80{opacity:.8}.univer-shadow-\\[0_30px_60px_-35px_rgba\\(15\\,23\\,42\\,0\\.55\\)\\]{--univer-tw-shadow:0 30px 60px -35px #0f172a8c;--univer-tw-shadow-colored:0 30px 60px -35px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 30px 60px -35px #0f172a8c;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-shadow-inner{--univer-tw-shadow:inset 0 2px 4px 0 #0000000d;--univer-tw-shadow-colored:inset 0 2px 4px 0 var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,inset 0 2px 4px #0000000d;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-ring-2{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.\\!univer-ring-primary-900{--univer-tw-ring-color:var(--univer-primary-900)!important}.univer-ring-primary-50{--univer-tw-ring-color:var(--univer-primary-50)}.univer-ring-white{--univer-tw-ring-color:var(--univer-white)}.univer-ring-offset-2{--univer-tw-ring-offset-width:2px}.\\!univer-ring-offset-gray-600{--univer-tw-ring-offset-color:var(--univer-gray-600)!important}.univer-ring-offset-white{--univer-tw-ring-offset-color:var(--univer-white)}.univer-drop-shadow-sm{--univer-tw-drop-shadow:drop-shadow(0 1px 1px #0000000d);filter:var(--univer-tw-blur) var(--univer-tw-brightness) var(--univer-tw-contrast) var(--univer-tw-grayscale) var(--univer-tw-hue-rotate) var(--univer-tw-invert) var(--univer-tw-saturate) var(--univer-tw-sepia) var(--univer-tw-drop-shadow)}.univer-transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-\\[max-height\\,opacity\\]{transition-property:max-height,opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-opacity{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-duration-150{transition-duration:.15s}.univer-duration-500{transition-duration:.5s}.univer-duration-75{transition-duration:75ms}.univer-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.univer-will-change-transform{will-change:transform}.univer-scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.univer-scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover,var(--scrollbar-track))}.univer-scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active,var(--scrollbar-track-hover,var(--scrollbar-track)))}.univer-scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.univer-scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover,var(--scrollbar-thumb))}.univer-scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active,var(--scrollbar-thumb-hover,var(--scrollbar-thumb)))}.univer-scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.univer-scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover,var(--scrollbar-corner))}.univer-scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active,var(--scrollbar-corner-hover,var(--scrollbar-corner)))}.univer-scrollbar-thin{scrollbar-width:thin;scrollbar-color:initial initial;scrollbar-color:var(--scrollbar-thumb,initial) var(--scrollbar-track,initial)}.univer-scrollbar-thin::-webkit-scrollbar{width:8px;height:8px;display:block}.univer-scrollbar-track-gray-50{--scrollbar-track:var(--univer-gray-50)!important}.univer-scrollbar-thumb-gray-300{--scrollbar-thumb:var(--univer-gray-300)!important}.univer-animate-out{--univer-tw-exit-opacity:initial;--univer-tw-exit-scale:initial;--univer-tw-exit-rotate:initial;--univer-tw-exit-translate-x:initial;--univer-tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.univer-fade-in,.univer-fade-in-0{--univer-tw-enter-opacity:0}.univer-fade-out{--univer-tw-exit-opacity:0}.univer-zoom-in-95{--univer-tw-enter-scale:.95}.univer-duration-150{animation-duration:.15s}.univer-duration-200{animation-duration:.2s}.univer-duration-300{animation-duration:.3s}.univer-duration-500{animation-duration:.5s}.univer-duration-75{animation-duration:75ms}.univer-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.univer-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.placeholder\\:univer-text-gray-200::placeholder{color:var(--univer-gray-200)}.placeholder\\:univer-text-gray-400::placeholder{color:var(--univer-gray-400)}.before\\:univer-absolute:before{content:var(--univer-tw-content);position:absolute}.before\\:univer-top-1\\/2:before{content:var(--univer-tw-content);top:50%}.before\\:univer-block:before{content:var(--univer-tw-content);display:block}.before\\:univer-h-px:before{content:var(--univer-tw-content);height:1px}.before\\:univer-w-full:before{content:var(--univer-tw-content);width:100%}.before\\:-univer-translate-y-1\\/2:before{content:var(--univer-tw-content);--univer-tw-translate-y:-50%;transform:translate(var(--univer-tw-translate-x),-50%) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.before\\:univer-bg-gray-200:before{content:var(--univer-tw-content);background-color:var(--univer-gray-200)}.before\\:univer-content-\\[\\"\\"\\]:before{--univer-tw-content:"";content:"";content:var(--univer-tw-content)}.data-\\[disabled\\]\\:univer-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[orientation\\=horizontal\\]\\:univer-h-px[data-orientation=horizontal]{height:1px}.data-\\[orientation\\=vertical\\]\\:univer-h-full[data-orientation=vertical]{height:100%}.data-\\[orientation\\=horizontal\\]\\:univer-w-full[data-orientation=horizontal]{width:100%}.data-\\[orientation\\=vertical\\]\\:univer-w-px[data-orientation=vertical]{width:1px}.data-\\[state\\=open\\]\\:univer-bg-gray-100[data-state=open]{background-color:var(--univer-gray-100)}.data-\\[disabled\\]\\:univer-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=open\\]\\:univer-animate-in[data-state=open]{--univer-tw-enter-opacity:initial;--univer-tw-enter-scale:initial;--univer-tw-enter-rotate:initial;--univer-tw-enter-translate-x:initial;--univer-tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.data-\\[state\\=closed\\]\\:univer-animate-out[data-state=closed]{--univer-tw-exit-opacity:initial;--univer-tw-exit-scale:initial;--univer-tw-exit-rotate:initial;--univer-tw-exit-translate-x:initial;--univer-tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.data-\\[state\\=closed\\]\\:univer-fade-out-0[data-state=closed]{--univer-tw-exit-opacity:0}.data-\\[state\\=open\\]\\:univer-fade-in-0[data-state=open]{--univer-tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:univer-zoom-out-95[data-state=closed]{--univer-tw-exit-scale:.95}.data-\\[state\\=open\\]\\:univer-zoom-in-95[data-state=open]{--univer-tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:univer-slide-in-from-top-2[data-side=bottom]{--univer-tw-enter-translate-y:-.5rem}.data-\\[side\\=left\\]\\:univer-slide-in-from-right-2[data-side=left]{--univer-tw-enter-translate-x:.5rem}.data-\\[side\\=right\\]\\:univer-slide-in-from-left-2[data-side=right]{--univer-tw-enter-translate-x:-.5rem}.data-\\[side\\=top\\]\\:univer-slide-in-from-bottom-2[data-side=top]{--univer-tw-enter-translate-y:.5rem}.data-\\[state\\=closed\\]\\:univer-slide-out-to-left-1\\/2[data-state=closed]{--univer-tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:univer-slide-out-to-top-\\[48\\%\\][data-state=closed]{--univer-tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:univer-slide-in-from-left-1\\/2[data-state=open]{--univer-tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:univer-slide-in-from-top-\\[48\\%\\][data-state=open]{--univer-tw-enter-translate-y:-48%}.hover\\:univer-border-red-400:hover{border-color:var(--univer-red-400)}.hover\\:univer-border-transparent:hover{border-color:#0000}.hover\\:univer-bg-primary-500:hover{background-color:var(--univer-primary-500)}.hover\\:univer-bg-red-400:hover{background-color:var(--univer-red-400)}.hover\\:univer-text-gray-500:hover{color:var(--univer-gray-500)}.hover\\:univer-text-primary-500:hover{color:var(--univer-primary-500)}.hover\\:univer-text-white:hover{color:var(--univer-white)}.hover\\:univer-underline:hover{text-decoration-line:underline}.hover\\:univer-opacity-100:hover{opacity:1}.hover\\:univer-opacity-70:hover{opacity:.7}.hover\\:univer-opacity-80:hover{opacity:.8}.focus\\:univer-border-primary-600:focus{border-color:var(--univer-primary-600)}.focus\\:univer-bg-gray-100:focus{background-color:var(--univer-gray-100)}.focus\\:univer-ring-primary-50:focus{--univer-tw-ring-color:var(--univer-primary-50)}.active\\:univer-border-red-600:active{border-color:var(--univer-red-600)}.active\\:univer-bg-primary-700:active{background-color:var(--univer-primary-700)}.active\\:univer-bg-red-600:active{background-color:var(--univer-red-600)}.active\\:univer-text-primary-700:active{color:var(--univer-primary-700)}.disabled\\:univer-pointer-events-none:disabled{pointer-events:none}.disabled\\:univer-opacity-50:disabled{opacity:.5}@media (width>=640px){.sm\\:\\!univer-flex-row{flex-direction:row!important}.sm\\:\\!univer-justify-end{justify-content:flex-end!important}.sm\\:\\!univer-space-x-2>:not([hidden])~:not([hidden]){--univer-tw-space-x-reverse:0!important;margin-right:0!important;margin-right:calc(.5rem * var(--univer-tw-space-x-reverse))!important;margin-left:calc(.5rem * (1 - var(--univer-tw-space-x-reverse)))!important;margin-left:.5rem!important;margin-left:calc(.5rem * calc(1 - var(--univer-tw-space-x-reverse)))!important}.sm\\:\\!univer-rounded-lg{border-radius:.5rem!important}.sm\\:\\!univer-text-left{text-align:left!important}}@media (width>=768px){.md\\:univer-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.rtl\\:univer-left-px:where([dir=rtl],[dir=rtl] *){left:1px}.rtl\\:univer-right-auto:where([dir=rtl],[dir=rtl] *){right:auto}.rtl\\:univer-rounded-l-md:where([dir=rtl],[dir=rtl] *){border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rtl\\:univer-rounded-r-none:where([dir=rtl],[dir=rtl] *){border-top-right-radius:0;border-bottom-right-radius:0}.rtl\\:univer-border-l-0:where([dir=rtl],[dir=rtl] *){border-left-width:0}.rtl\\:univer-border-r:where([dir=rtl],[dir=rtl] *){border-right-width:1px}.dark\\:\\!univer-border-gray-500:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-500)!important}.dark\\:\\!univer-border-primary-700:where(.univer-dark,.univer-dark *){border-color:var(--univer-primary-700)!important}.dark\\:\\!univer-bg-gray-100:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-100)!important}.dark\\:\\!univer-bg-primary-600:where(.univer-dark,.univer-dark *){background-color:var(--univer-primary-600)!important}.dark\\:\\!univer-text-gray-900:where(.univer-dark,.univer-dark *){color:var(--univer-gray-900)!important}.dark\\:\\!univer-text-primary-500:where(.univer-dark,.univer-dark *){color:var(--univer-primary-500)!important}.dark\\:\\!univer-text-sky-400:where(.univer-dark,.univer-dark *){--univer-tw-text-opacity:1!important;color:rgba(56,189,248,var(--univer-tw-text-opacity,1))!important}.dark\\:\\!univer-ring-primary-600:where(.univer-dark,.univer-dark *){--univer-tw-ring-color:var(--univer-primary-600)!important}.dark\\:\\!univer-ring-primary-900:where(.univer-dark,.univer-dark *){--univer-tw-ring-color:var(--univer-primary-900)!important}.dark\\:\\!univer-ring-offset-gray-600:where(.univer-dark,.univer-dark *){--univer-tw-ring-offset-color:var(--univer-gray-600)!important}.dark\\:\\!univer-scrollbar-track-gray-900:where(.univer-dark,.univer-dark *){--scrollbar-track:var(--univer-gray-900)!important}.dark\\:\\!univer-scrollbar-thumb-gray-700:where(.univer-dark,.univer-dark *){--scrollbar-thumb:var(--univer-gray-700)!important}.dark\\:before\\:\\!univer-bg-gray-600:where(.univer-dark,.univer-dark *):before{content:var(--univer-tw-content);background-color:var(--univer-gray-600)!important}.dark\\:data-\\[state\\=open\\]\\:\\!univer-bg-gray-600[data-state=open]:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.dark\\:hover\\:\\!univer-text-white:hover:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.dark\\:focus\\:\\!univer-border-primary-500:focus:where(.univer-dark,.univer-dark *){border-color:var(--univer-primary-500)!important}.dark\\:focus\\:\\!univer-bg-gray-600:focus:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.dark\\:focus\\:\\!univer-ring-primary-900:focus:where(.univer-dark,.univer-dark *){--univer-tw-ring-color:var(--univer-primary-900)!important}.dark\\:focus-visible\\:\\!univer-border-gray-600:focus-visible:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)!important}.dark\\:active\\:\\!univer-bg-gray-700:active:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.\\[\\&\\:\\:-webkit-calendar-picker-indicator\\]\\:univer-hidden::-webkit-calendar-picker-indicator{display:none}.\\[\\&\\:\\:-webkit-calendar-picker-indicator\\]\\:univer-appearance-none::-webkit-calendar-picker-indicator{appearance:none}.\\[\\&\\>input\\]\\:univer-w-11>input{width:2.75rem}.\\[\\&\\>input\\]\\:univer-border-gray-200>input{border-color:var(--univer-gray-200)}.\\[\\&\\>input\\]\\:focus\\:univer-border-primary-500:focus>input{border-color:var(--univer-primary-500)}.dark\\:\\[\\&\\>input\\]\\:\\!univer-border-gray-600>input:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)!important}.dark\\:\\[\\&\\>input\\]\\:\\!univer-text-white>input:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.\\[\\&\\>svg\\]\\:univer-block>svg{display:block}.\\[\\&\\>svg\\]\\:univer-size-4>svg{width:1rem;height:1rem}.\\[\\&\\>ul\\:not\\(\\:last-child\\)\\]\\:univer-border-0>ul:not(:last-child){border-width:0}.\\[\\&\\>ul\\:not\\(\\:last-child\\)\\]\\:univer-border-r>ul:not(:last-child){border-right-width:1px}.\\[\\&\\>ul\\:not\\(\\:last-child\\)\\]\\:univer-border-solid>ul:not(:last-child){border-style:solid}.\\[\\&\\>ul\\:not\\(\\:last-child\\)\\]\\:univer-border-r-gray-200>ul:not(:last-child){border-right-color:var(--univer-gray-200)}.\\[\\&_\\[data-description\\]\\]\\:univer-text-sm [data-description]{font-size:.875rem;line-height:1.25rem}.\\[\\&_\\[data-description\\]\\]\\:univer-text-gray-200 [data-description]{color:var(--univer-gray-200)}.\\[\\&_\\[data-description\\]\\]\\:univer-text-gray-600 [data-description]{color:var(--univer-gray-600)}.\\[\\&_\\[data-icon\\]\\>svg\\]\\:univer-relative [data-icon]>svg{position:relative}.\\[\\&_\\[data-icon\\]\\>svg\\]\\:univer-top-1 [data-icon]>svg{top:.25rem}.\\[\\&_\\[data-icon\\]\\]\\:univer-self-baseline [data-icon]{align-self:baseline}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-amber-500 [data-icon]{--univer-tw-text-opacity:1;color:rgba(245,158,11,var(--univer-tw-text-opacity,1))}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-green-500 [data-icon]{color:var(--univer-green-500)}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-primary-600 [data-icon]{color:var(--univer-primary-600)}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-red-500 [data-icon]{color:var(--univer-red-500)}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-sky-500 [data-icon]{--univer-tw-text-opacity:1;color:rgba(14,165,233,var(--univer-tw-text-opacity,1))}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-violet-500 [data-icon]{--univer-tw-text-opacity:1;color:rgba(139,92,246,var(--univer-tw-text-opacity,1))}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-yellow-500 [data-icon]{color:var(--univer-yellow-500)}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-rounded-2xl [data-sonner-toast]{border-radius:1rem}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-border [data-sonner-toast]{border-width:1px}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-border-solid [data-sonner-toast]{border-style:solid}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-border-gray-200 [data-sonner-toast]{border-color:var(--univer-gray-200)}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-shadow-\\[0_16px_40px_-20px_rgba\\(15\\,23\\,42\\,0\\.55\\)\\] [data-sonner-toast]{--univer-tw-shadow:0 16px 40px -20px #0f172a8c;--univer-tw-shadow-colored:0 16px 40px -20px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 16px 40px -20px #0f172a8c;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-shadow-md [data-sonner-toast]{--univer-tw-shadow:0px 1px 6px -2px #1e284d14, 0px 2px 6px -1px #1e284d1a;--univer-tw-shadow-colored:0px 1px 6px -2px var(--univer-tw-shadow-color), 0px 2px 6px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 6px -2px #1e284d14,0 2px 6px -1px #1e284d1a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-backdrop-blur-sm [data-sonner-toast]{--univer-tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia);backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia)}.dark\\:\\[\\&_\\[data-sonner-toast\\]\\]\\:\\!univer-border-gray-600 [data-sonner-toast]:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)!important}.\\[\\&_\\[data-title\\]\\]\\:univer-text-sm [data-title]{font-size:.875rem;line-height:1.25rem}.\\[\\&_\\[data-title\\]\\]\\:univer-text-gray-900 [data-title]{color:var(--univer-gray-900)}.\\[\\&_\\[data-u-comp\\=form-layout\\]\\]\\:univer-max-w-\\[calc\\(50\\%-8px\\)\\] [data-u-comp=form-layout]{max-width:calc(50% - 8px)}.\\[\\&_\\[data-u-comp\\=form-layout\\]\\]\\:univer-shrink [data-u-comp=form-layout]{flex-shrink:1}.\\[\\&_\\[data-u-comp\\=form-layout\\]\\]\\:univer-grow [data-u-comp=form-layout]{flex-grow:1}.\\[\\&_\\[data-u-comp\\=input\\]\\]\\:univer-w-full [data-u-comp=input]{width:100%}.\\[\\&_\\[data-u-comp\\=input\\]\\]\\:univer-border-red-500 [data-u-comp=input]{border-color:var(--univer-red-500)}.\\[\\&_\\[data-u-comp\\=pager-left-arrow\\]\\:hover\\]\\:\\!univer-bg-gray-600 [data-u-comp=pager-left-arrow]:hover,.\\[\\&_\\[data-u-comp\\=pager-right-arrow\\]\\:hover\\]\\:\\!univer-bg-gray-600 [data-u-comp=pager-right-arrow]:hover{background-color:var(--univer-gray-600)!important}.\\[\\&_\\[data-u-comp\\=select\\]\\]\\:univer-w-full [data-u-comp=select]{width:100%}.\\[\\&_\\[data-u-comp\\=select\\]\\]\\:univer-border-red-500 [data-u-comp=select]{border-color:var(--univer-red-500)}.\\[\\&_input\\]\\:univer-box-border input{box-sizing:border-box}.\\[\\&_input\\]\\:univer-flex input{display:flex}.\\[\\&_input\\]\\:univer-h-7 input{height:1.75rem}.\\[\\&_input\\]\\:univer-items-center input{align-items:center}.\\[\\&_input\\]\\:univer-rounded input{border-radius:.25rem}.\\[\\&_input\\]\\:univer-border input{border-width:1px}.\\[\\&_input\\]\\:univer-border-solid input{border-style:solid}.\\[\\&_input\\]\\:univer-border-gray-200 input{border-color:var(--univer-gray-200)}.\\[\\&_input\\]\\:univer-border-gray-600 input{border-color:var(--univer-gray-600)}.\\[\\&_input\\]\\:univer-bg-transparent input{background-color:#0000}.\\[\\&_input\\]\\:univer-px-1\\.5 input{padding-left:.375rem;padding-right:.375rem}.\\[\\&_input\\]\\:univer-text-gray-700 input{color:var(--univer-gray-700)}.\\[\\&_input\\]\\:univer-text-white input{color:var(--univer-white)}.\\[\\&_input\\]\\:univer-outline-none input{outline-offset:2px;outline:2px solid #0000}.\\[\\&_svg\\]\\:univer-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:univer-size-4 svg{width:1rem;height:1rem}.\\[\\&_svg\\]\\:univer-shrink-0 svg{flex-shrink:0}.univer-popup{z-index:1070;--univer-tw-shadow:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--univer-tw-shadow-colored:0 1px 3px 0 var(--univer-tw-shadow-color), 0 1px 2px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow);border-radius:6px;position:fixed;top:-9999px;left:-9999px;overflow:hidden}.univer-popup-enter{transform-origin:0 0;opacity:0;animation-duration:.15s;animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-play-state:paused;animation-fill-mode:both}.univer-popup-enter-active{animation-name:popup-slide-up-in;animation-play-state:running}.univer-popup-exit{transform-origin:0 0;opacity:1;animation-name:popup-slide-up-out;animation-duration:.15s;animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-play-state:running;animation-fill-mode:both}.univer-popup-exit-active{display:none}.univer-popup-mask{z-index:1060;position:fixed;inset:0}.univer-pointer-events-auto{pointer-events:auto}.univer-invisible{visibility:hidden}.univer-sticky{position:sticky}.-univer-left-\\[99999\\]{left:-99999px}.-univer-top-\\[99999\\]{top:-99999px}.univer-left-1\\/2{left:50%}.univer-left-\\[-9999px\\]{left:-9999px}.univer-right-2{right:.5rem}.univer-top-\\[-9999px\\]{top:-9999px}.univer-top-\\[calc\\(50\\%-6px\\)\\]{top:calc(50% - 6px)}.univer-z-20{z-index:20}.univer-z-\\[-1\\]{z-index:-1}.univer-z-\\[1020\\]{z-index:1020}.univer-z-\\[1080\\]{z-index:1080}.univer-z-\\[1\\]{z-index:1}.univer-mx-2{margin-left:.5rem;margin-right:.5rem}.univer-mx-auto{margin-left:auto;margin-right:auto}.univer-line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\\!univer-size-3\\.5{width:.875rem!important;height:.875rem!important}.univer-size-12{width:3rem;height:3rem}.univer-size-3\\.5{width:.875rem;height:.875rem}.univer-size-7{width:1.75rem;height:1.75rem}.univer-size-9{width:2.25rem;height:2.25rem}.univer-h-0{height:0}.univer-h-1\\.5{height:.375rem}.univer-max-h-\\[80vh\\]{max-height:80vh}.univer-max-h-\\[min\\(72vh\\,560px\\)\\]{max-height:min(72vh,560px)}.univer-min-h-\\[560px\\]{min-height:560px}.univer-min-h-\\[56px\\]{min-height:56px}.univer-min-h-full{min-height:100%}.univer-w-0{width:0}.univer-w-1{width:.25rem}.univer-w-10{width:2.5rem}.univer-w-40{width:10rem}.univer-w-7{width:1.75rem}.univer-w-8{width:2rem}.univer-w-96{width:24rem}.univer-w-max{width:max-content}.univer-w-screen{width:100vw}.univer-min-w-52{min-width:13rem}.univer-min-w-6{min-width:1.5rem}.univer-min-w-min{min-width:min-content}.univer-max-w-3xl{max-width:48rem}.univer-max-w-5xl{max-width:64rem}.univer-max-w-96{max-width:24rem}.univer-max-w-\\[--radix-popper-available-width\\]{max-width:var(--radix-popper-available-width)}.univer-max-w-\\[32\\%\\]{max-width:32%}.univer-max-w-\\[560px\\]{max-width:560px}.univer-max-w-\\[calc\\(100vw-16px\\)\\]{max-width:calc(100vw - 16px)}.univer-max-w-full{max-width:100%}.univer-origin-center{transform-origin:50%}.-univer-translate-x-1\\/2{--univer-tw-translate-x:-50%;transform:translate(-50%,var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-translate-x-0{--univer-tw-translate-x:0px;transform:translateY(var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-translate-x-full{--univer-tw-translate-x:100%;transform:translate(100%,var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-cursor-col-resize{cursor:col-resize}.univer-grid-cols-\\[1fr\\]{grid-template-columns:1fr}.univer-grid-cols-\\[22px_minmax\\(0\\,1fr\\)_22px\\]{grid-template-columns:22px minmax(0,1fr) 22px}.univer-grid-cols-\\[28px_minmax\\(0\\,1fr\\)_auto\\]{grid-template-columns:28px minmax(0,1fr) auto}.univer-grid-cols-\\[32px_minmax\\(0\\,1fr\\)_32px\\]{grid-template-columns:32px minmax(0,1fr) 32px}.univer-grid-cols-\\[auto\\,1fr\\]{grid-template-columns:auto 1fr}.univer-grid-cols-\\[auto_1fr_auto\\]{grid-template-columns:auto 1fr auto}.univer-grid-rows-\\[100\\%\\]{grid-template-rows:100%}.univer-grid-rows-\\[auto_1fr\\]{grid-template-rows:auto 1fr}.univer-grid-rows-\\[auto_1fr_auto\\]{grid-template-rows:auto 1fr auto}.univer-flex-wrap{flex-wrap:wrap}.univer-items-end{align-items:flex-end}.univer-gap-0\\.5{gap:.125rem}.univer-overscroll-contain{overscroll-behavior:contain}.univer-scroll-smooth{scroll-behavior:smooth}.\\!univer-rounded-full{border-radius:9999px!important}.\\!univer-rounded-xl{border-radius:.75rem!important}.univer-rounded-2xl{border-radius:1rem}.univer-rounded-3xl{border-radius:1.5rem}.univer-rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.univer-rounded-t-\\[28px\\]{border-top-left-radius:28px;border-top-right-radius:28px}.univer-border-0{border-width:0}.\\!univer-bg-gray-200{background-color:var(--univer-gray-200)!important}.\\!univer-bg-gray-500{background-color:var(--univer-gray-500)!important}.univer-bg-\\[rgba\\(15\\,23\\,42\\,0\\.32\\)\\]{background-color:#0f172a52}.univer-bg-gray-50{background-color:var(--univer-gray-50)}.univer-bg-gray-700{background-color:var(--univer-gray-700)}.univer-bg-gradient-to-tr{background-image:linear-gradient(to top right,var(--univer-tw-gradient-stops))}.univer-from-slate-950{--univer-tw-gradient-from:#020617 var(--univer-tw-gradient-from-position);--univer-tw-gradient-to:#02061700 var(--univer-tw-gradient-to-position);--univer-tw-gradient-stops:var(--univer-tw-gradient-from), var(--univer-tw-gradient-to)}.univer-via-blue-950{--univer-tw-gradient-to:#17255400 var(--univer-tw-gradient-to-position);--univer-tw-gradient-stops:var(--univer-tw-gradient-from), #172554 var(--univer-tw-gradient-via-position), var(--univer-tw-gradient-to)}.univer-to-cyan-900{--univer-tw-gradient-to:#164e63 var(--univer-tw-gradient-to-position)}.univer-p-8{padding:2rem}.univer-px-0{padding-left:0;padding-right:0}.univer-px-0\\.5{padding-left:.125rem;padding-right:.125rem}.univer-px-3{padding-left:.75rem;padding-right:.75rem}.univer-pb-2{padding-bottom:.5rem}.univer-pl-2{padding-left:.5rem}.univer-pl-4{padding-left:1rem}.univer-pr-1\\.5{padding-right:.375rem}.univer-text-right{text-align:right}.univer-font-sans{font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.univer-text-2xl{font-size:1.5rem;line-height:2rem}.univer-uppercase{text-transform:uppercase}.univer-leading-4{line-height:1rem}.univer-leading-none{line-height:1}.univer-tracking-\\[0\\.08em\\]{letter-spacing:.08em}.univer-tracking-tight{letter-spacing:-.025em}.\\!univer-text-gray-600{color:var(--univer-gray-600)!important}.univer-text-current{color:currentColor}.univer-text-slate-200{--univer-tw-text-opacity:1;color:rgba(226,232,240,var(--univer-tw-text-opacity,1))}.univer-underline{text-decoration-line:underline}.univer-opacity-0{opacity:0}.univer-opacity-30{opacity:.3}.univer-opacity-40{opacity:.4}.univer-opacity-60{opacity:.6}.univer-shadow-\\[0_-16px_48px_rgba\\(15\\,23\\,42\\,0\\.18\\)\\]{--univer-tw-shadow:0 -16px 48px #0f172a2e;--univer-tw-shadow-colored:0 -16px 48px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 -16px 48px #0f172a2e;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-ring-0{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(0px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.univer-ring-primary-600{--univer-tw-ring-color:var(--univer-primary-600)}.univer-backdrop-blur-\\[2px\\]{--univer-tw-backdrop-blur:blur(2px);-webkit-backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia);backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia)}.univer-backdrop-blur-xl{--univer-tw-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia);backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia)}.univer-transition-\\[width\\]{transition-property:width;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-animate-in{--univer-tw-enter-opacity:initial;--univer-tw-enter-scale:initial;--univer-tw-enter-rotate:initial;--univer-tw-enter-translate-x:initial;--univer-tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.univer-fade-in{--univer-tw-enter-opacity:0}.univer-fade-in-70{--univer-tw-enter-opacity:.7}.last\\:univer-border-b-0:last-child{border-bottom-width:0}.empty\\:univer-hidden:empty{display:none}.hover\\:univer-opacity-50:hover{opacity:.5}.focus\\:univer-bg-white:focus{background-color:var(--univer-white)}.focus\\:univer-ring-2:focus{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.focus-visible\\:univer-ring-primary-600:focus-visible{--univer-tw-ring-color:var(--univer-primary-600)}.focus-visible\\:univer-ring-offset-0:focus-visible{--univer-tw-ring-offset-width:0px}.active\\:univer-bg-gray-200:active{background-color:var(--univer-gray-200)}.enabled\\:hover\\:univer-bg-gray-50:hover:enabled{background-color:var(--univer-gray-50)}.enabled\\:active\\:univer-bg-gray-100:active:enabled{background-color:var(--univer-gray-100)}.disabled\\:univer-text-gray-300:disabled{color:var(--univer-gray-300)}.disabled\\:hover\\:univer-bg-transparent:hover:disabled{background-color:#0000}@media (width>=640px){.sm\\:\\!univer-block{display:block!important}}.rtl\\:univer-pl-1\\.5:where([dir=rtl],[dir=rtl] *){padding-left:.375rem}.rtl\\:univer-pr-0:where([dir=rtl],[dir=rtl] *){padding-right:0}.rtl\\:univer-pr-2:where([dir=rtl],[dir=rtl] *){padding-right:.5rem}.dark\\:\\!univer-bg-gray-200:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-200)!important}.dark\\:\\!univer-bg-primary-400:where(.univer-dark,.univer-dark *){background-color:var(--univer-primary-400)!important}.dark\\:\\!univer-text-gray-600:where(.univer-dark,.univer-dark *){color:var(--univer-gray-600)!important}.dark\\:\\!univer-text-gray-800:where(.univer-dark,.univer-dark *){color:var(--univer-gray-800)!important}.dark\\:\\!univer-text-primary-100:where(.univer-dark,.univer-dark *){color:var(--univer-primary-100)!important}.dark\\:\\!univer-text-primary-400:where(.univer-dark,.univer-dark *){color:var(--univer-primary-400)!important}.dark\\:hover\\:\\!univer-bg-transparent:hover:where(.univer-dark,.univer-dark *){background-color:#0000!important}.dark\\:active\\:\\!univer-bg-gray-600:active:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.dark\\:disabled\\:\\!univer-text-gray-600:disabled:where(.univer-dark,.univer-dark *){color:var(--univer-gray-600)!important}.\\[\\&\\:\\:-webkit-scrollbar\\]\\:univer-hidden::-webkit-scrollbar{display:none}.\\[\\&\\>\\*\\]\\:univer-m-0>*{margin:0}.\\[\\&\\>\\*\\]\\:univer-inline-flex>*{display:inline-flex}.\\[\\&\\>\\*\\]\\:univer-h-6>*{height:1.5rem}.\\[\\&\\>\\*\\]\\:univer-min-h-7>*{min-height:1.75rem}.\\[\\&\\>\\*\\]\\:univer-min-w-7>*{min-width:1.75rem}.\\[\\&\\>\\*\\]\\:univer-appearance-none>*{appearance:none}.\\[\\&\\>\\*\\]\\:univer-items-center>*{align-items:center}.\\[\\&\\>\\*\\]\\:univer-justify-center>*{justify-content:center}.\\[\\&\\>\\*\\]\\:univer-rounded>*{border-radius:.25rem}.\\[\\&\\>\\*\\]\\:univer-rounded-md>*{border-radius:.375rem}.\\[\\&\\>\\*\\]\\:univer-border-0>*{border-width:0}.\\[\\&\\>\\*\\]\\:univer-px-1>*{padding-left:.25rem;padding-right:.25rem}.\\[\\&\\>\\*\\]\\:univer-px-1\\.5>*{padding-left:.375rem;padding-right:.375rem}.\\[\\&\\>\\*\\]\\:univer-leading-none>*{line-height:1}.\\[\\&\\>\\*\\]\\:univer-outline-none>*{outline-offset:2px;outline:2px solid #0000}.\\[\\&\\>\\*\\]\\:univer-transition-colors>*{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:\\[\\&\\>\\*\\]\\:univer-bg-gray-100>:hover{background-color:var(--univer-gray-100)}.\\[\\&\\>span\\]\\:univer-truncate>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\\[\\&\\>span\\]\\:univer-text-sm>span{font-size:.875rem;line-height:1.25rem}.\\[\\&\\>span\\]\\:univer-font-medium>span{font-weight:500}.\\[\\&\\>svg\\]\\:univer-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:univer-text-lg>svg{font-size:1.125rem;line-height:1.75rem}.\\[\\&\\>svg\\]\\:univer-text-gray-700>svg{color:var(--univer-gray-700)}.\\[\\&_\\*\\]\\:univer-box-border *{box-sizing:border-box}.\\[\\&_\\.univer-custom-label\\]\\:univer-text-sm .univer-custom-label{font-size:.875rem;line-height:1.25rem}.\\[\\&_\\.univer-custom-label\\]\\:univer-leading-none .univer-custom-label{line-height:1}.\\[\\&_\\.univer-toolbar-button-selector-main\\]\\:\\!univer-h-8 .univer-toolbar-button-selector-main{height:2rem!important}.\\[\\&_\\.univer-toolbar-button-selector-main\\]\\:\\!univer-rounded-none .univer-toolbar-button-selector-main{border-radius:0!important}.\\[\\&_\\.univer-toolbar-button-selector-main\\]\\:\\!univer-rounded-l-md .univer-toolbar-button-selector-main{border-top-left-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.\\[\\&_\\.univer-toolbar-button-selector-main\\]\\:\\!univer-px-1\\.5 .univer-toolbar-button-selector-main{padding-left:.375rem!important;padding-right:.375rem!important}.\\[\\&_\\.univer-toolbar-button-selector-root\\]\\:\\!univer-h-8 .univer-toolbar-button-selector-root{height:2rem!important}.\\[\\&_\\.univer-toolbar-button-selector-root\\]\\:univer-overflow-hidden .univer-toolbar-button-selector-root{overflow:hidden}.\\[\\&_\\.univer-toolbar-button-selector-root\\]\\:\\!univer-rounded-md .univer-toolbar-button-selector-root{border-radius:.375rem!important}.\\[\\&_\\.univer-toolbar-button-selector-root\\]\\:\\!univer-pr-0 .univer-toolbar-button-selector-root{padding-right:0!important}.\\[\\&_\\.univer-toolbar-button-selector-trigger\\]\\:\\!univer-static .univer-toolbar-button-selector-trigger{position:static!important}.\\[\\&_\\.univer-toolbar-button-selector-trigger\\]\\:\\!univer-h-8 .univer-toolbar-button-selector-trigger{height:2rem!important}.\\[\\&_\\.univer-toolbar-button-selector-trigger\\]\\:\\!univer-w-6 .univer-toolbar-button-selector-trigger{width:1.5rem!important}.\\[\\&_\\.univer-toolbar-button-selector-trigger\\]\\:\\!univer-rounded-none .univer-toolbar-button-selector-trigger{border-radius:0!important}.\\[\\&_\\.univer-toolbar-button-selector-trigger\\]\\:\\!univer-rounded-r-md .univer-toolbar-button-selector-trigger{border-top-right-radius:.375rem!important;border-bottom-right-radius:.375rem!important}.\\[\\&_\\.univer-toolbar-selector-root\\]\\:\\!univer-h-8 .univer-toolbar-selector-root{height:2rem!important}.\\[\\&_\\.univer-toolbar-selector-root\\]\\:\\!univer-gap-1 .univer-toolbar-selector-root{gap:.25rem!important}.\\[\\&_\\.univer-toolbar-selector-root\\]\\:\\!univer-rounded-md .univer-toolbar-selector-root{border-radius:.375rem!important}.\\[\\&_\\.univer-toolbar-selector-root\\]\\:\\!univer-px-1\\.5 .univer-toolbar-selector-root{padding-left:.375rem!important;padding-right:.375rem!important}.\\[\\&_\\.univer-toolbar-selector-trigger\\]\\:\\!univer-pl-0\\.5 .univer-toolbar-selector-trigger{padding-left:.125rem!important}.\\[\\&_\\.univer-tooltip\\]\\:univer-inline-flex .univer-tooltip{display:inline-flex}.\\[\\&_\\.univer-tooltip\\]\\:univer-h-full .univer-tooltip{height:100%}.\\[\\&_\\.univer-tooltip\\]\\:univer-items-center .univer-tooltip{align-items:center}.\\[\\&_\\[data-u-command\\]\\]\\:\\!univer-h-8 [data-u-command]{height:2rem!important}.\\[\\&_\\[data-u-command\\]\\]\\:\\!univer-min-h-8 [data-u-command]{min-height:2rem!important}.\\[\\&_\\[data-u-command\\]\\]\\:\\!univer-rounded-md [data-u-command]{border-radius:.375rem!important}.\\[\\&_\\[data-u-command\\]\\]\\:\\!univer-px-1\\.5 [data-u-command]{padding-left:.375rem!important;padding-right:.375rem!important}.\\[\\&_button\\]\\:\\!univer-m-0 button{margin:0!important}.\\[\\&_button\\]\\:\\!univer-h-8 button{height:2rem!important}.\\[\\&_button\\]\\:\\!univer-min-w-8 button{min-width:2rem!important}.\\[\\&_button\\]\\:\\!univer-appearance-none button{appearance:none!important}.\\[\\&_button\\]\\:\\!univer-rounded-md button{border-radius:.375rem!important}.\\[\\&_button\\]\\:\\!univer-border-0 button{border-width:0!important}.\\[\\&_button\\]\\:\\!univer-bg-transparent button{background-color:#0000!important}.\\[\\&_button\\]\\:\\!univer-p-0 button{padding:0!important}.\\[\\&_button\\]\\:\\!univer-px-1\\.5 button{padding-left:.375rem!important;padding-right:.375rem!important}.\\[\\&_button\\]\\:\\!univer-leading-none button{line-height:1!important}.\\[\\&_button\\]\\:\\!univer-outline-none button{outline-offset:2px!important;outline:2px solid #0000!important}.\\[\\&_input\\:focus\\]\\:\\!univer-ring-0 input:focus{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color)!important;--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(0px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color)!important;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000!important;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)!important}.\\[\\&_input\\]\\:\\!univer-m-0 input{margin:0!important}.\\[\\&_input\\]\\:univer-h-6 input{height:1.5rem}.\\[\\&_input\\]\\:univer-w-7 input{width:1.75rem}.\\[\\&_input\\]\\:\\!univer-appearance-none input{appearance:none!important}.\\[\\&_input\\]\\:\\!univer-border-0 input{border-width:0!important}.\\[\\&_input\\]\\:univer-border-none input{border-style:none}.\\[\\&_input\\]\\:\\!univer-bg-transparent input{background-color:#0000!important}.\\[\\&_input\\]\\:\\!univer-p-0 input{padding:0!important}.\\[\\&_input\\]\\:univer-p-0 input{padding:0}.\\[\\&_input\\]\\:univer-text-sm input{font-size:.875rem;line-height:1.25rem}.\\[\\&_input\\]\\:\\!univer-leading-none input{line-height:1!important}.\\[\\&_input\\]\\:\\!univer-outline-none input{outline-offset:2px!important;outline:2px solid #0000!important}.univer-fixed{position:fixed}.univer-bottom-0{bottom:0}.univer-left-5{left:1.25rem}.univer-left-\\[5px\\]{left:5px}.univer-top-4{top:1rem}.univer-top-\\[5px\\]{top:5px}.univer-z-\\[10000\\]{z-index:10000}.univer-mr-1{margin-right:.25rem}.univer-mt-1\\.5{margin-top:.375rem}.univer-mt-12{margin-top:3rem}.univer-mt-5{margin-top:1.25rem}.univer-size-0\\.5{width:.125rem;height:.125rem}.univer-size-8{width:2rem;height:2rem}.univer-h-16{height:4rem}.univer-h-3\\.5{height:.875rem}.univer-h-\\[24px\\]{height:24px}.univer-min-h-8{min-height:2rem}.univer-w-2{width:.5rem}.univer-w-2\\.5{width:.625rem}.univer-w-28{width:7rem}.univer-w-4\\/5{width:80%}.univer-w-\\[0px\\]{width:0}.univer-w-\\[212px\\]{width:212px}.univer-w-\\[72px\\]{width:72px}.univer-min-w-\\[180px\\]{min-width:180px}.univer-cursor-grab{cursor:grab}.univer-grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.univer-place-items-center{place-items:center}.univer-items-stretch{align-items:stretch}.univer-gap-2\\.5{gap:.625rem}.univer-gap-3{gap:.75rem}.univer-gap-x-0\\.5{-moz-column-gap:.125rem;column-gap:.125rem}.univer-gap-y-px{row-gap:1px}.univer-overflow-x-hidden{overflow-x:hidden}.univer-rounded-r-2xl{border-top-right-radius:1rem;border-bottom-right-radius:1rem}.\\!univer-border-primary-500{border-color:var(--univer-primary-500)!important}.univer-border-primary-500{border-color:var(--univer-primary-500)}.\\!univer-bg-primary-50{background-color:var(--univer-primary-50)!important}.\\!univer-bg-primary-900{background-color:var(--univer-primary-900)!important}.univer-bg-gray-400{background-color:var(--univer-gray-400)}.univer-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.univer-pb-0\\.5{padding-bottom:.125rem}.univer-pb-4{padding-bottom:1rem}.univer-pr-1{padding-right:.25rem}.univer-pt-1\\.5{padding-top:.375rem}.univer-pt-14{padding-top:3.5rem}.univer-text-lg{font-size:1.125rem;line-height:1.75rem}.univer-font-\\[500\\],.univer-font-medium{font-weight:500}.univer-font-normal{font-weight:400}.univer-leading-\\[24px\\]{line-height:24px}.\\!univer-text-gray-200{color:var(--univer-gray-200)!important}.\\!univer-text-gray-400{color:var(--univer-gray-400)!important}.\\!univer-text-primary-600{color:var(--univer-primary-600)!important}.univer-text-gray-800{color:var(--univer-gray-800)}.univer-backdrop-blur-\\[10px\\]{--univer-tw-backdrop-blur:blur(10px);-webkit-backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia);backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia)}.univer-duration-300{transition-duration:.3s}.univer-group:hover .group-hover\\:univer-bg-gray-500{background-color:var(--univer-gray-500)}.hover\\:univer-border-primary-500:hover{border-color:var(--univer-primary-500)}.hover\\:univer-bg-white:hover{background-color:var(--univer-white)}.hover\\:univer-text-gray-900:hover{color:var(--univer-gray-900)}.hover\\:univer-text-primary-600:hover{color:var(--univer-primary-600)}.hover\\:univer-shadow-md:hover{--univer-tw-shadow:0px 1px 6px -2px #1e284d14, 0px 2px 6px -1px #1e284d1a;--univer-tw-shadow-colored:0px 1px 6px -2px var(--univer-tw-shadow-color), 0px 2px 6px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 6px -2px #1e284d14,0 2px 6px -1px #1e284d1a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.active\\:univer-cursor-grabbing:active{cursor:grabbing}.dark\\:\\!univer-bg-gray-500:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-500)!important}.dark\\:\\!univer-bg-primary-900:where(.univer-dark,.univer-dark *){background-color:var(--univer-primary-900)!important}.univer-group:hover .dark\\:group-hover\\:\\!univer-bg-gray-300:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-300)!important}.univer-pointer-events-none{pointer-events:none}.univer-inset-0{inset:0}.-univer-left-0\\.5{left:-.125rem}.-univer-top-0\\.5{top:-.125rem}.univer-left-0{left:0}.univer-left-1{left:.25rem}.univer-left-3{left:.75rem}.univer-right-0{right:0}.univer-right-5{right:1.25rem}.univer-top-0{top:0}.univer-top-0\\.5{top:.125rem}.univer-z-10{z-index:10}.univer-z-\\[1001\\]{z-index:1001}.univer-z-\\[100\\]{z-index:100}.univer-mx-1\\.5{margin-left:.375rem;margin-right:.375rem}.univer-mb-1\\.5{margin-bottom:.375rem}.univer-mb-3{margin-bottom:.75rem}.univer-mb-4{margin-bottom:1rem}.univer-ml-1\\.5{margin-left:.375rem}.univer-ml-3{margin-left:.75rem}.univer-ml-6{margin-left:1.5rem}.univer-ml-px{margin-left:1px}.univer-mr-1\\.5{margin-right:.375rem}.univer-mr-5{margin-right:1.25rem}.univer-mt-auto{margin-top:auto}.univer-size-0{width:0;height:0}.univer-size-10{width:2.5rem;height:2.5rem}.univer-h-0\\.5{height:.125rem}.univer-h-1{height:.25rem}.univer-h-10{height:2.5rem}.univer-h-20{height:5rem}.univer-h-60{height:15rem}.univer-h-9{height:2.25rem}.univer-h-\\[270px\\]{height:270px}.univer-h-\\[30px\\]{height:30px}.univer-h-\\[calc\\(100\\%-16px\\)\\]{height:calc(100% - 16px)}.univer-h-\\[calc\\(100\\%-8px\\)\\]{height:calc(100% - 8px)}.univer-h-px{height:1px}.univer-max-h-52{max-height:13rem}.univer-max-h-\\[100px\\]{max-height:100px}.univer-max-h-\\[360px\\]{max-height:360px}.univer-min-h-0{min-height:0}.univer-min-h-\\[30px\\]{min-height:30px}.\\!univer-w-\\[90px\\]{width:90px!important}.univer-w-16{width:4rem}.univer-w-20{width:5rem}.univer-w-24{width:6rem}.univer-w-5{width:1.25rem}.univer-w-60{width:15rem}.univer-w-\\[100px\\]{width:100px}.univer-w-\\[130px\\]{width:130px}.univer-w-\\[156px\\]{width:156px}.univer-w-\\[300px\\]{width:300px}.univer-w-\\[50\\%\\]{width:50%}.univer-w-fit{width:fit-content}.univer-min-w-0{min-width:0}.univer-min-w-72{min-width:18rem}.univer-max-w-32{max-width:8rem}.univer-max-w-36{max-width:9rem}.univer-max-w-64{max-width:16rem}.univer-max-w-\\[190px\\]{max-width:190px}.univer-max-w-\\[200px\\]{max-width:200px}.univer-max-w-\\[calc\\(100\\%-112px\\)\\]{max-width:calc(100% - 112px)}.univer-max-w-fit{max-width:fit-content}.univer-max-w-lg{max-width:32rem}.univer-flex-shrink-0,.univer-shrink-0{flex-shrink:0}.univer-rotate-180{--univer-tw-rotate:180deg;transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(180deg) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-animate-spin{animation:1s linear infinite univer-spin}.univer-cursor-not-allowed{cursor:not-allowed}.univer-appearance-none{appearance:none}.univer-grid-flow-col{grid-auto-flow:column}.univer-grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.univer-grid-cols-\\[1fr\\,auto\\,auto\\,auto\\]{grid-template-columns:1fr auto auto auto}.univer-flex-row-reverse{flex-direction:row-reverse}.univer-gap-7{gap:1.75rem}.univer-gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.univer-space-y-2>:not([hidden])~:not([hidden]){--univer-tw-space-y-reverse:0;margin-top:calc(.5rem * (1 - var(--univer-tw-space-y-reverse)));margin-top:.5rem;margin-top:calc(.5rem * calc(1 - var(--univer-tw-space-y-reverse)));margin-bottom:0;margin-bottom:calc(.5rem * var(--univer-tw-space-y-reverse))}.univer-divide-x-0>:not([hidden])~:not([hidden]){--univer-tw-divide-x-reverse:0;border-right-width:0;border-right-width:calc(0px * var(--univer-tw-divide-x-reverse));border-left-width:calc(0px * (1 - var(--univer-tw-divide-x-reverse)));border-left-width:0;border-left-width:calc(0px * calc(1 - var(--univer-tw-divide-x-reverse)))}.univer-divide-y>:not([hidden])~:not([hidden]){--univer-tw-divide-y-reverse:0;border-top-width:calc(1px * (1 - var(--univer-tw-divide-y-reverse)));border-top-width:1px;border-top-width:calc(1px * calc(1 - var(--univer-tw-divide-y-reverse)));border-bottom-width:0;border-bottom-width:calc(1px * var(--univer-tw-divide-y-reverse))}.univer-divide-solid>:not([hidden])~:not([hidden]){border-style:solid}.univer-divide-gray-200>:not([hidden])~:not([hidden]){border-color:var(--univer-gray-200)}.univer-justify-self-center{justify-self:center}.univer-overflow-x-auto{overflow-x:auto}.univer-overflow-y-hidden{overflow-y:hidden}.univer-rounded-sm{border-radius:.125rem}.univer-border-2{border-width:2px}.univer-border-4{border-width:4px}.univer-border-b{border-bottom-width:1px}.univer-border-\\[rgba\\(13\\,13\\,13\\,0\\.12\\)\\]{border-color:#0d0d0d1f}.univer-border-gray-100{border-color:var(--univer-gray-100)}.univer-border-r-gray-200{border-right-color:var(--univer-gray-200)}.univer-border-t-primary-500{border-top-color:var(--univer-primary-500)}.\\!univer-bg-gray-700{background-color:var(--univer-gray-700)!important}.univer-bg-blue-500{background-color:var(--univer-blue-500)}.univer-bg-blue-600{background-color:var(--univer-blue-600)}.univer-bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--univer-tw-gradient-stops))}.univer-from-gray-50{--univer-tw-gradient-from:var(--univer-gray-50) var(--univer-tw-gradient-from-position);--univer-tw-gradient-to:#fff0 var(--univer-tw-gradient-to-position);--univer-tw-gradient-stops:var(--univer-tw-gradient-from), var(--univer-tw-gradient-to)}.univer-to-gray-100{--univer-tw-gradient-to:var(--univer-gray-100) var(--univer-tw-gradient-to-position)}.univer-fill-gray-900{fill:var(--univer-gray-900)}.univer-px-3\\.5{padding-left:.875rem;padding-right:.875rem}.univer-px-5{padding-left:1.25rem;padding-right:1.25rem}.univer-py-5{padding-top:1.25rem;padding-bottom:1.25rem}.univer-pb-1{padding-bottom:.25rem}.univer-pl-1\\.5{padding-left:.375rem}.univer-pl-3{padding-left:.75rem}.univer-pl-6{padding-left:1.5rem}.univer-pr-5{padding-right:1.25rem}.univer-pt-1{padding-top:.25rem}.univer-font-semibold{font-weight:600}.univer-leading-6{line-height:1.5rem}.univer-leading-7{line-height:1.75rem}.\\!univer-text-blue-400{color:var(--univer-blue-400)!important}.\\!univer-text-gray-700{color:var(--univer-gray-700)!important}.\\!univer-text-white{color:var(--univer-white)!important}.univer-text-blue-500{color:var(--univer-blue-500)}.univer-text-blue-600{color:var(--univer-blue-600)}.univer-text-gray-200{color:var(--univer-gray-200)}.univer-text-gray-300{color:var(--univer-gray-300)}.univer-text-green-600{color:var(--univer-green-600)}.univer-text-primary-700{color:var(--univer-primary-700)}.univer-text-red-600{color:var(--univer-red-600)}.univer-text-rose-600{--univer-tw-text-opacity:1;color:rgba(225,29,72,var(--univer-tw-text-opacity,1))}.univer-text-yellow-500{color:var(--univer-yellow-500)}.univer-shadow{--univer-tw-shadow:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--univer-tw-shadow-colored:0 1px 3px 0 var(--univer-tw-shadow-color), 0 1px 2px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-blur-sm{--univer-tw-blur:blur(4px);filter:var(--univer-tw-blur) var(--univer-tw-brightness) var(--univer-tw-contrast) var(--univer-tw-grayscale) var(--univer-tw-hue-rotate) var(--univer-tw-invert) var(--univer-tw-saturate) var(--univer-tw-sepia) var(--univer-tw-drop-shadow)}.univer-backdrop-blur{--univer-tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia);backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia)}.univer-transition-\\[colors\\,box-shadow\\]{transition-property:colors,box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-\\[height\\]{transition-property:height;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-duration-200{transition-duration:.2s}.univer-ease-linear{transition-timing-function:linear}.after\\:univer-absolute:after{content:var(--univer-tw-content);position:absolute}.after\\:univer-right-0:after{content:var(--univer-tw-content);right:0}.after\\:univer-top-1\\/2:after{content:var(--univer-tw-content);top:50%}.after\\:univer-block:after{content:var(--univer-tw-content);display:block}.after\\:univer-h-4:after{content:var(--univer-tw-content);height:1rem}.after\\:univer-w-px:after{content:var(--univer-tw-content);width:1px}.after\\:-univer-translate-y-1\\/2:after{content:var(--univer-tw-content);--univer-tw-translate-y:-50%;transform:translate(var(--univer-tw-translate-x),-50%) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.after\\:univer-bg-gray-200:after{content:var(--univer-tw-content);background-color:var(--univer-gray-200)}.after\\:univer-content-\\[\\"\\"\\]:after{--univer-tw-content:"";content:"";content:var(--univer-tw-content)}.last\\:univer-mb-0:last-child{margin-bottom:0}.univer-group:hover .group-hover\\:univer-flex{display:flex}.hover\\:univer-border-primary-600:hover{border-color:var(--univer-primary-600)}.hover\\:univer-bg-transparent:hover{background-color:#0000}.focus\\:univer-border-primary-500:focus{border-color:var(--univer-primary-500)}.focus\\:univer-outline-none:focus{outline-offset:2px;outline:2px solid #0000}.focus-visible\\:univer-ring-2:focus-visible{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.focus-visible\\:univer-ring-primary-500:focus-visible{--univer-tw-ring-color:var(--univer-primary-500)}.active\\:univer-bg-gray-100:active{background-color:var(--univer-gray-100)}.dark\\:\\!univer-divide-gray-600:where(.univer-dark,.univer-dark *)>:not([hidden])~:not([hidden]){border-color:var(--univer-gray-600)!important}.dark\\:\\!univer-border-r-gray-700:where(.univer-dark,.univer-dark *){border-right-color:var(--univer-gray-700)!important}.dark\\:\\!univer-bg-black:where(.univer-dark,.univer-dark *){background-color:var(--univer-black)!important}.dark\\:\\!univer-bg-blue-400:where(.univer-dark,.univer-dark *){background-color:var(--univer-blue-400)!important}.dark\\:\\!univer-from-gray-800:where(.univer-dark,.univer-dark *){--univer-tw-gradient-from:var(--univer-gray-800) var(--univer-tw-gradient-from-position)!important;--univer-tw-gradient-to:#fff0 var(--univer-tw-gradient-to-position)!important;--univer-tw-gradient-stops:var(--univer-tw-gradient-from), var(--univer-tw-gradient-to)!important}.dark\\:\\!univer-to-gray-900:where(.univer-dark,.univer-dark *){--univer-tw-gradient-to:var(--univer-gray-900) var(--univer-tw-gradient-to-position)!important}.dark\\:\\!univer-fill-white:where(.univer-dark,.univer-dark *){fill:var(--univer-white)!important}.dark\\:\\!univer-text-blue-400:where(.univer-dark,.univer-dark *){color:var(--univer-blue-400)!important}.dark\\:\\!univer-text-gray-700:where(.univer-dark,.univer-dark *){color:var(--univer-gray-700)!important}.dark\\:\\!univer-text-green-400:where(.univer-dark,.univer-dark *){color:var(--univer-green-400)!important}.dark\\:\\!univer-text-red-400:where(.univer-dark,.univer-dark *){color:var(--univer-red-400)!important}.\\[\\&\\>div\\:first-child\\]\\:univer-px-2\\.5>div:first-child{padding-left:.625rem;padding-right:.625rem}.\\[\\&\\>div\\]\\:univer-h-5>div{height:1.25rem}.\\[\\&\\>div\\]\\:univer-ring-transparent>div{--univer-tw-ring-color:transparent}.\\[\\&_canvas\\]\\:univer-absolute canvas,.univer-absolute{position:absolute}.univer-left-1\\.5{left:.375rem}.univer-top-1\\/2{top:50%}.univer-z-\\[15\\]{z-index:15}.univer-m-0{margin:0}.-univer-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.univer-mx-0{margin-left:0;margin-right:0}.univer-my-1{margin-top:.25rem;margin-bottom:.25rem}.univer-my-2{margin-top:.5rem;margin-bottom:.5rem}.univer-mb-0{margin-bottom:0}.univer-ml-4{margin-left:1rem}.univer-mr-0{margin-right:0}.univer-mt-0{margin-top:0}.univer-mt-1{margin-top:.25rem}.univer-h-\\[18px\\]{height:18px}.univer-h-\\[364px\\]{height:364px}.univer-max-h-60{max-height:15rem}.univer-max-h-72{max-height:18rem}.univer-max-h-\\[350px\\]{max-height:350px}.univer-w-\\[250px\\]{width:250px}.-univer-translate-y-1\\/2{--univer-tw-translate-y:-50%;transform:translate(var(--univer-tw-translate-x),-50%) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-select-none{-webkit-user-select:none;user-select:none}.univer-list-none{list-style-type:none}.univer-justify-around{justify-content:space-around}.univer-overflow-visible{overflow:visible}.univer-whitespace-pre-wrap{white-space:pre-wrap}.univer-break-words{word-wrap:break-word}.univer-break-all{word-break:break-all}.univer-rounded-none{border-radius:0}.univer-rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.univer-border-r-0{border-right-width:0}.univer-border-gray-600{border-color:var(--univer-gray-600)}.univer-border-primary-600{border-color:var(--univer-primary-600)}.\\!univer-bg-gray-600{background-color:var(--univer-gray-600)!important}.univer-bg-primary-600{background-color:var(--univer-primary-600)}.univer-px-4{padding-left:1rem;padding-right:1rem}.univer-px-6{padding-left:1.5rem;padding-right:1.5rem}.univer-px-7{padding-left:1.75rem;padding-right:1.75rem}.univer-py-3{padding-top:.75rem;padding-bottom:.75rem}.univer-pb-3{padding-bottom:.75rem}.univer-pt-0{padding-top:0}.univer-font-medium{font-weight:500}.univer-leading-\\[13px\\]{line-height:13px}.univer-text-white{color:var(--univer-white)}.univer-outline-none{outline-offset:2px;outline:2px solid #0000}.univer-ring-1{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(1px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.univer-ring-primary-500{--univer-tw-ring-color:var(--univer-primary-500)}.univer-ring-red-500{--univer-tw-ring-color:var(--univer-red-500)}.hover\\:univer-bg-gray-200:hover{background-color:var(--univer-gray-200)}.hover\\:univer-bg-gray-300:hover{background-color:var(--univer-gray-300)}.dark\\:\\!univer-bg-gray-600:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.dark\\:\\!univer-text-gray-300:where(.univer-dark,.univer-dark *){color:var(--univer-gray-300)!important}.dark\\:hover\\:\\!univer-bg-gray-600:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.univer-mb-5{margin-bottom:1.25rem}.univer-mr-3{margin-right:.75rem}.univer-mt-3{margin-top:.75rem}.univer-mt-3\\.5{margin-top:.875rem}.univer-max-h-\\[400px\\]{max-height:400px}.univer-w-32{width:8rem}.univer-w-36{width:9rem}.univer-w-4{width:1rem}.univer-w-\\[340px\\]{width:340px}.univer-cursor-default{cursor:default}.univer-gap-1\\.5{gap:.375rem}.univer-gap-6{gap:1.5rem}.univer-overflow-y-auto{overflow-y:auto}.univer-p-1\\.5{padding:.375rem}.univer-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.univer-pb-5{padding-bottom:1.25rem}.univer-text-sm,.univer-text-sm\\/5{font-size:.875rem;line-height:1.25rem}.dark\\:\\!univer-text-gray-400:where(.univer-dark,.univer-dark *){color:var(--univer-gray-400)!important}.univer-absolute{position:absolute}.-univer-bottom-0\\.5{bottom:-.125rem}.-univer-right-0\\.5{right:-.125rem}.univer-mx-1{margin-left:.25rem;margin-right:.25rem}.univer-mb-2{margin-bottom:.5rem}.univer-ml-1{margin-left:.25rem}.univer-mt-2{margin-top:.5rem}.univer-block{display:block}.univer-inline-block{display:inline-block}.univer-size-3{width:.75rem;height:.75rem}.univer-size-full{width:100%;height:100%}.univer-h-4{height:1rem}.univer-h-\\[300px\\]{height:300px}.univer-max-h-\\[500px\\]{max-height:500px}.univer-min-h-\\[300px\\]{min-height:300px}.univer-w-\\[400px\\]{width:400px}.univer-flex-shrink{flex-shrink:1}.univer-flex-shrink-0{flex-shrink:0}.univer-flex-grow{flex-grow:1}.univer-flex-grow-0{flex-grow:0}.univer-grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.univer-flex-nowrap{flex-wrap:nowrap}.univer-justify-start{justify-content:flex-start}.univer-gap-4{gap:1rem}.univer-overflow-auto{overflow:auto}.univer-whitespace-nowrap{white-space:nowrap}.univer-rounded-full{border-radius:9999px}.univer-border-\\[rgba\\(13\\,13\\,13\\,0\\.06\\)\\]{border-color:#0d0d0d0f}.univer-border-transparent{border-color:#0000}.univer-bg-gray-300{background-color:var(--univer-gray-300)}.univer-p-0\\.5{padding:.125rem}.univer-p-2{padding:.5rem}.univer-py-0{padding-top:0;padding-bottom:0}.univer-py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.univer-py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.univer-pl-5{padding-left:1.25rem}.univer-pr-0\\.5{padding-right:.125rem}.univer-pr-2{padding-right:.5rem}.univer-pt-2{padding-top:.5rem}.univer-font-bold{font-weight:700}.univer-text-\\[\\#418F1F\\]{--univer-tw-text-opacity:1;color:rgba(65,143,31,var(--univer-tw-text-opacity,1))}.univer-text-gray-500{color:var(--univer-gray-500)}.univer-transition-shadow{transition-property:box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:univer-bg-gray-50:hover{background-color:var(--univer-gray-50)}.hover\\:univer-ring-2:hover{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.hover\\:univer-ring-offset-2:hover{--univer-tw-ring-offset-width:2px}.hover\\:univer-ring-offset-white:hover{--univer-tw-ring-offset-color:var(--univer-white)}.dark\\:\\!univer-border-\\[rgba\\(255\\,255\\,255\\,0\\.06\\)\\]:where(.univer-dark,.univer-dark *){border-color:#ffffff0f!important}.dark\\:\\!univer-border-gray-600:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)!important}.dark\\:\\!univer-text-gray-500:where(.univer-dark,.univer-dark *){color:var(--univer-gray-500)!important}.dark\\:hover\\:\\!univer-bg-gray-900:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)!important}.\\[\\&\\:hover_a\\]\\:univer-inline-block:hover a{display:inline-block}.univer-mt-4{margin-top:1rem}.univer-mt-6{margin-top:1.5rem}.univer-inline-flex{display:inline-flex}.univer-text-primary-500{color:var(--univer-primary-500)}.univer-relative{position:relative}.univer-mt-2\\.5{margin-top:.625rem}.univer-size-4{width:1rem;height:1rem}.univer-h-5{height:1.25rem}.univer-h-7{height:1.75rem}.univer-h-8{height:2rem}.univer-h-full{height:100%}.univer-w-6{width:1.5rem}.univer-w-px{width:1px}.univer-min-w-32{min-width:8rem}.univer-min-w-9{min-width:2.25rem}.univer-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.univer-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.univer-gap-1{gap:.25rem}.univer-rounded-md{border-radius:.375rem}.univer-border{border-width:1px}.univer-border-solid{border-style:solid}.univer-border-none{border-style:none}.\\!univer-bg-gray-800{background-color:var(--univer-gray-800)!important}.\\!univer-bg-gray-900{background-color:var(--univer-gray-900)!important}.univer-bg-gray-100{background-color:var(--univer-gray-100)}.univer-bg-gray-200{background-color:var(--univer-gray-200)}.univer-bg-primary-50{background-color:var(--univer-primary-50)}.univer-bg-transparent{background-color:#0000}.univer-fill-primary-600{fill:var(--univer-primary-600)}.univer-p-0{padding:0}.univer-p-1{padding:.25rem}.univer-px-1{padding-left:.25rem;padding-right:.25rem}.univer-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.univer-px-2{padding-left:.5rem;padding-right:.5rem}.univer-py-1{padding-top:.25rem;padding-bottom:.25rem}.univer-text-left{text-align:left}.univer-text-center{text-align:center}.\\!univer-text-primary-300{color:var(--univer-primary-300)!important}.univer-text-gray-700{color:var(--univer-gray-700)}.univer-shadow-lg{--univer-tw-shadow:0px 4px 6px 0px #1e284d0d, 0px 10px 15px -3px #1e284d1a;--univer-tw-shadow-colored:0px 4px 6px 0px var(--univer-tw-shadow-color), 0px 10px 15px -3px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-shadow-sm{--univer-tw-shadow:0px 1px 2px 0px #1e284d14;--univer-tw-shadow-colored:0px 1px 2px 0px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 2px #1e284d14;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.disabled\\:univer-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:univer-opacity-40:disabled{opacity:.4}.dark\\:\\!univer-border-gray-700:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-700)!important}.dark\\:\\!univer-bg-gray-700:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.dark\\:\\!univer-bg-gray-800:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-800)!important}.dark\\:\\!univer-text-gray-100:where(.univer-dark,.univer-dark *){color:var(--univer-gray-100)!important}.dark\\:\\!univer-text-primary-300:where(.univer-dark,.univer-dark *){color:var(--univer-primary-300)!important}.dark\\:hover\\:\\!univer-bg-gray-800:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-800)!important}.\\[\\&\\>div\\]\\:univer-grid>div{display:grid}.\\[\\&\\>div\\]\\:univer-gap-2>div{gap:.5rem}.univer-grid{display:grid}.univer-hidden{display:none}.univer-flex-col{flex-direction:column}.univer-border-t{border-top-width:1px}.univer-border-gray-200{border-color:var(--univer-gray-200)}.univer-py-2{padding-top:.5rem;padding-bottom:.5rem}.univer-pt-3{padding-top:.75rem}.univer-text-xs{font-size:.75rem;line-height:1rem}.univer-text-gray-400{color:var(--univer-gray-400)}.univer-text-gray-600{color:var(--univer-gray-600)}.dark\\:\\!univer-text-gray-200:where(.univer-dark,.univer-dark *){color:var(--univer-gray-200)!important}.univer-mb-1{margin-bottom:.25rem}.univer-ml-2{margin-left:.5rem}.univer-mr-2{margin-right:.5rem}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-size-5{width:1.25rem;height:1.25rem}.univer-size-6{width:1.5rem;height:1.5rem}.univer-h-6{height:1.5rem}.univer-w-\\[296px\\]{width:296px}.univer-w-full{width:100%}.univer-max-w-80{max-width:20rem}.univer-flex-1{flex:1}.univer-flex-none{flex:none}.univer-cursor-pointer{cursor:pointer}.univer-flex-row{flex-direction:row}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-2{gap:.5rem}.univer-overflow-hidden{overflow:hidden}.univer-truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.univer-rounded{border-radius:.25rem}.univer-rounded-lg{border-radius:.5rem}.univer-rounded-xl{border-radius:.75rem}.univer-bg-white{background-color:var(--univer-white)}.univer-p-3{padding:.75rem}.univer-p-4{padding:1rem}.univer-text-base{font-size:1rem;line-height:1.5rem}.univer-text-sm{font-size:.875rem;line-height:1.25rem}.univer-leading-5{line-height:1.25rem}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-green-500{color:var(--univer-green-500)}.univer-text-primary-600{color:var(--univer-primary-600)}.univer-text-red-500{color:var(--univer-red-500)}.univer-shadow-md{--univer-tw-shadow:0px 1px 6px -2px #1e284d14, 0px 2px 6px -1px #1e284d1a;--univer-tw-shadow-colored:0px 1px 6px -2px var(--univer-tw-shadow-color), 0px 2px 6px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 6px -2px #1e284d14,0 2px 6px -1px #1e284d1a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000), var(--univer-tw-ring-shadow,0 0 #0000), var(--univer-tw-shadow)}.hover\\:univer-bg-gray-100:hover{background-color:var(--univer-gray-100)}.dark\\:\\!univer-bg-gray-900:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)!important}.dark\\:\\!univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.dark\\:hover\\:\\!univer-bg-gray-700:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.sheet-shell[data-v-a2ad8bc8]{letter-spacing:normal;flex-direction:column;height:760px;font-size:14px;line-height:normal;display:flex}.sheet-canvas[data-v-a2ad8bc8]{flex:1;min-height:0;position:relative}.sheet-editor[data-v-a2ad8bc8]{contain:layout style;letter-spacing:normal;width:100%;height:100%;font-size:14px;line-height:normal;position:absolute;inset:0;overflow:hidden}.sheet-statusbar[data-v-a2ad8bc8]{color:#8c8c8c;white-space:nowrap;background:#fafbfc;border-top:1px solid #f0f0f0;align-items:center;gap:8px;padding:8px 16px;font-size:12px;display:flex;overflow:hidden}.status-cell[data-v-a2ad8bc8]{color:#25b864;font-family:ui-monospace,Consolas,monospace;font-weight:600}.status-sep[data-v-a2ad8bc8]{color:#d9d9d9}.sheet-statusbar b[data-v-a2ad8bc8]{color:#595959;font-weight:600}.status-flex[data-v-a2ad8bc8]{flex:1}.status-hint[data-v-a2ad8bc8]{color:#bfbfbf}.status-readonly[data-v-a2ad8bc8]{color:#faad14}.status-tip[data-v-a2ad8bc8]{color:#bfbfbf}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
1
|
+
(function(){try{if(typeof document<`u`){var e=document.createElement(`style`);e.appendChild(document.createTextNode(`@keyframes univer-spin{to{transform:rotate(360deg)}}@media (width>=640px){.sm\\:\\!univer-flex-row{flex-direction:row!important}.sm\\:\\!univer-justify-end{justify-content:flex-end!important}.sm\\:\\!univer-space-x-2>:not([hidden])~:not([hidden]){--univer-tw-space-x-reverse:0!important;margin-right:0!important;margin-right:calc(.5rem * var(--univer-tw-space-x-reverse))!important;margin-left:calc(.5rem * (1 - var(--univer-tw-space-x-reverse)))!important;margin-left:.5rem!important;margin-left:calc(.5rem * calc(1 - var(--univer-tw-space-x-reverse)))!important}.sm\\:\\!univer-rounded-lg{border-radius:.5rem!important}.sm\\:\\!univer-text-left{text-align:left!important}}@media (width>=768px){.md\\:univer-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}@keyframes popup-slide-up-in{0%{transform-origin:0 0;opacity:0;transform:scaleY(0)}to{transform-origin:0 0;opacity:1;transform:scaleY(1)}}@keyframes popup-slide-up-out{0%{transform-origin:0 0;opacity:1;transform:scaleY(1)}to{transform-origin:0 0;opacity:0;transform:scaleY(0)}}@keyframes enter{0%{opacity:1;opacity:var(--univer-tw-enter-opacity,1);transform:translateZ(0)scaleZ(1)rotate(0);transform:translate3d(var(--univer-tw-enter-translate-x,0),var(--univer-tw-enter-translate-y,0),0) scale3d(var(--univer-tw-enter-scale,1),var(--univer-tw-enter-scale,1),var(--univer-tw-enter-scale,1)) rotate(var(--univer-tw-enter-rotate,0))}}@keyframes exit{to{opacity:1;opacity:var(--univer-tw-exit-opacity,1);transform:translateZ(0)scaleZ(1)rotate(0);transform:translate3d(var(--univer-tw-exit-translate-x,0),var(--univer-tw-exit-translate-y,0),0) scale3d(var(--univer-tw-exit-scale,1),var(--univer-tw-exit-scale,1),var(--univer-tw-exit-scale,1)) rotate(var(--univer-tw-exit-rotate,0))}}.focus\\:univer-ring-2:focus,.focus-visible\\:univer-ring-2:focus-visible{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}@media (width>=640px){.sm\\:\\!univer-block{display:block!important}}.univer-w-\\[328px\\]{width:328px}.univer-flex-\\[0_0_auto\\]{flex:none}.doc-shell[data-v-6346950a]{letter-spacing:normal;flex-direction:column;height:760px;font-size:14px;line-height:normal;display:flex}.doc-layout[data-v-6346950a]{flex:1;min-height:0;display:flex}.doc-canvas[data-v-6346950a]{background:#f7f8fa;flex:1;min-width:0;position:relative}.readonly-badge[data-v-6346950a]{z-index:30;color:#8c8c8c;pointer-events:none;background:#ffffffeb;border:1px solid #e0e0e0;border-radius:999px;padding:3px 10px;font-size:12px;position:absolute;top:10px;right:14px;box-shadow:0 1px 4px #0000000f}.doc-editor[data-v-6346950a]{contain:layout style;letter-spacing:normal;font-size:14px;line-height:normal;position:absolute;inset:0;overflow:hidden}.link-dialog-mask[data-v-6346950a]{z-index:30;background:#00000047;justify-content:center;align-items:center;display:flex;position:absolute;inset:0}.link-dialog[data-v-6346950a]{background:#fff;border-radius:12px;width:400px;max-width:calc(100% - 48px);padding:22px 24px 18px;box-shadow:0 12px 40px #00000029}.link-dialog-title[data-v-6346950a]{color:#1a1a1a;margin-bottom:18px;font-size:16px;font-weight:600}.link-dialog-field[data-v-6346950a]{margin-bottom:14px}.field-label[data-v-6346950a]{color:#595959;margin-bottom:6px;font-size:13px;font-weight:500;display:block}.field-input[data-v-6346950a]{color:#333;background:#fafafa;border:1px solid #e0e0e0;border-radius:6px;outline:none;width:100%;height:34px;padding:0 10px;font-size:13px;transition:border-color .15s,box-shadow .15s}.field-input[data-v-6346950a]:focus{background:#fff;border-color:#25b864;box-shadow:0 0 0 2px #25b8641f}.field-input.error[data-v-6346950a]{border-color:#e5484d}.field-error[data-v-6346950a]{color:#e5484d;margin-top:4px;font-size:12px}.link-dialog-tip[data-v-6346950a]{color:#bfbfbf;margin-bottom:16px;font-size:12px}.link-dialog-actions[data-v-6346950a]{justify-content:flex-end;gap:10px;display:flex}.dialog-btn[data-v-6346950a]{cursor:pointer;border:none;border-radius:6px;height:32px;padding:0 18px;font-size:13px;transition:all .15s}.dialog-btn.cancel[data-v-6346950a]{color:#595959;background:#f5f5f5}.dialog-btn.cancel[data-v-6346950a]:hover{background:#ececec}.dialog-btn.confirm[data-v-6346950a]{color:#fff;background:#25b864;font-weight:500}.dialog-btn.confirm[data-v-6346950a]:hover:not(:disabled){background:#1fa257}.dialog-btn.confirm[data-v-6346950a]:disabled{cursor:not-allowed;background:#bfe6d2}.doc-statusbar[data-v-6346950a]{color:#8c8c8c;background:#fafbfc;border-top:1px solid #f0f0f0;align-items:center;gap:8px;padding:8px 20px;font-size:12px;display:flex}.status-count[data-v-6346950a]{color:#595959;font-weight:500}.status-flex[data-v-6346950a]{flex:1}.status-tip[data-v-6346950a]{color:#bfbfbf}.link-hover-bar[data-v-6346950a]{z-index:1080;white-space:nowrap;-webkit-user-select:none;user-select:none;background:#fff;border:1px solid #e8e8e8;border-radius:6px;align-items:center;gap:2px;padding:4px 8px;display:flex;position:fixed;transform:translate(-50%)translateY(-100%);box-shadow:0 4px 16px #0000001f}.hover-label[data-v-6346950a]{color:#3370ff;cursor:pointer;padding:0 6px;font-size:13px;font-weight:500}.hover-label[data-v-6346950a]:hover{text-decoration:underline}.hover-icon-btn[data-v-6346950a]{color:#595959;cursor:pointer;background:0 0;border:none;border-radius:4px;justify-content:center;align-items:center;width:28px;height:28px;padding:0;transition:background .12s,color .12s;display:inline-flex;position:relative}.hover-icon-btn[data-v-6346950a]:hover{color:#1d2129;background:#f2f3f5}.hover-icon-tip[data-v-6346950a]{color:#3370ff;white-space:nowrap;pointer-events:none;font-size:10px;position:absolute;bottom:-18px;left:50%;transform:translate(-50%)}.hover-unlink-btn[data-v-6346950a]:hover{color:#e5484d;background:#e5484d14}.hover-sep[data-v-6346950a]{background:#ececec;flex-shrink:0;width:1px;height:16px;margin:0 4px}.hover-bar-arrow[data-v-6346950a]{background:#fff;border-bottom:1px solid #e8e8e8;border-right:1px solid #e8e8e8;width:8px;height:8px;position:absolute;bottom:-5px;left:50%;transform:translate(-50%)rotate(45deg)}.hover-style[data-v-6346950a]{position:relative}.hover-style-menu[data-v-6346950a]{text-align:left;background:#fff;border:1px solid #e8e8e8;border-radius:6px;min-width:140px;padding:4px;position:absolute;top:calc(100% + 8px);left:50%;transform:translate(-50%);box-shadow:0 4px 16px #0000001f}.hover-style-item[data-v-6346950a]{cursor:pointer;color:#595959;border-radius:4px;align-items:center;gap:6px;padding:6px 10px;font-size:13px;display:flex}.hover-style-item[data-v-6346950a]:hover{background:#f7f8fa}.hover-style-item.active[data-v-6346950a]{color:#3370ff}.style-check[data-v-6346950a]{color:#3370ff;text-align:center;flex-shrink:0;width:16px;font-size:12px}.style-name[data-v-6346950a]{font-size:13px}[data-u-comp=rect-popup]:has(.univer-max-w-80){visibility:hidden;pointer-events:none}*,:before,:after,::backdrop{--univer-tw-border-spacing-x:0;--univer-tw-border-spacing-y:0;--univer-tw-translate-x:0;--univer-tw-translate-y:0;--univer-tw-rotate:0;--univer-tw-skew-x:0;--univer-tw-skew-y:0;--univer-tw-scale-x:1;--univer-tw-scale-y:1;--univer-tw-pan-x: ;--univer-tw-pan-y: ;--univer-tw-pinch-zoom: ;--univer-tw-scroll-snap-strictness:proximity;--univer-tw-gradient-from-position: ;--univer-tw-gradient-via-position: ;--univer-tw-gradient-to-position: ;--univer-tw-ordinal: ;--univer-tw-slashed-zero: ;--univer-tw-numeric-figure: ;--univer-tw-numeric-spacing: ;--univer-tw-numeric-fraction: ;--univer-tw-ring-inset: ;--univer-tw-ring-offset-width:0px;--univer-tw-ring-offset-color:#fff;--univer-tw-ring-color:#93c5fd80;--univer-tw-ring-offset-shadow:0 0 #0000;--univer-tw-ring-shadow:0 0 #0000;--univer-tw-shadow:0 0 #0000;--univer-tw-shadow-colored:0 0 #0000;--univer-tw-blur: ;--univer-tw-brightness: ;--univer-tw-contrast: ;--univer-tw-grayscale: ;--univer-tw-hue-rotate: ;--univer-tw-invert: ;--univer-tw-saturate: ;--univer-tw-sepia: ;--univer-tw-drop-shadow: ;--univer-tw-backdrop-blur: ;--univer-tw-backdrop-brightness: ;--univer-tw-backdrop-contrast: ;--univer-tw-backdrop-grayscale: ;--univer-tw-backdrop-hue-rotate: ;--univer-tw-backdrop-invert: ;--univer-tw-backdrop-opacity: ;--univer-tw-backdrop-saturate: ;--univer-tw-backdrop-sepia: ;--univer-tw-contain-size: ;--univer-tw-contain-layout: ;--univer-tw-contain-paint: ;--univer-tw-contain-style: }*{scrollbar-color:initial;scrollbar-width:initial}.univer-sr-only{clip:rect(0,0,0,0);white-space:nowrap;border-width:0;width:1px;height:1px;margin:-1px;padding:0;position:absolute;overflow:hidden}.univer-inset-x-0{left:0;right:0}.univer-bottom-0\\.5{bottom:.125rem}.univer-bottom-6{bottom:1.5rem}.univer-left-0\\.5{left:.125rem}.univer-left-2{left:.5rem}.univer-left-\\[-16px\\]{left:-16px}.univer-right-4{right:1rem}.univer-right-px{right:1px}.univer-top-px{top:1px}.univer-z-0{z-index:0}.univer-z-\\[1081\\]{z-index:1081}.-univer-mx-1{margin-left:-.25rem;margin-right:-.25rem}.univer-my-0{margin-top:0;margin-bottom:0}.univer-ml-auto{margin-left:auto}.\\!univer-hidden{display:none!important}.univer-size-2{width:.5rem;height:.5rem}.univer-size-2\\.5{width:.625rem;height:.625rem}.univer-h-1\\/2{height:50%}.univer-h-12{height:3rem}.univer-h-2{height:.5rem}.univer-h-32{height:8rem}.univer-h-48{height:12rem}.univer-h-\\[150px\\]{height:150px}.univer-h-\\[calc\\(100\\%-2px\\)\\]{height:calc(100% - 2px)}.univer-max-h-0{max-height:0}.univer-max-h-80{max-height:20rem}.univer-max-h-\\[--radix-popper-available-height\\]{max-height:var(--radix-popper-available-height)}.univer-max-h-\\[1000px\\]{max-height:1000px}.univer-max-h-\\[40vh\\]{max-height:40vh}.univer-max-h-full{max-height:100%}.univer-max-h-screen{max-height:100vh}.univer-min-h-3\\.5{min-height:.875rem}.univer-min-h-\\[520px\\]{min-height:520px}.\\!univer-w-fit{width:fit-content!important}.univer-w-64{width:16rem}.univer-w-72{width:18rem}.univer-w-80{width:20rem}.univer-w-\\[--radix-popper-anchor-width\\]{width:var(--radix-popper-anchor-width)}.univer-w-\\[calc\\(100\\%-16px\\)\\]{width:calc(100% - 16px)}.univer-min-w-36{min-width:9rem}.univer-min-w-\\[320px\\]{min-width:320px}.univer-max-w-2xl{max-width:42rem}.univer-max-w-\\[520px\\]{max-width:520px}.univer-max-w-\\[60vw\\]{max-width:60vw}.univer-max-w-sm{max-width:24rem}.univer-max-w-xs{max-width:20rem}.univer-shrink{flex-shrink:1}.univer-shrink-0{flex-shrink:0}.univer-origin-\\[--radix-hover-card-content-transform-origin\\]{transform-origin:var(--radix-hover-card-content-transform-origin)}.-univer-translate-y-1\\/2,.univer--translate-y-1\\/2{--univer-tw-translate-y:-50%;transform:translate(var(--univer-tw-translate-x),-50%) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-translate-x-3{--univer-tw-translate-x:.75rem;transform:translate(.75rem,var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.-univer-rotate-90{--univer-tw-rotate:-90deg;transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(-90deg) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-rotate-0{--univer-tw-rotate:0deg;transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(0) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-rotate-45{--univer-tw-rotate:45deg;transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(45deg) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-rotate-\\[-90deg\\]{--univer-tw-rotate:-90deg;transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(-90deg) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.\\!univer-animate-none{animation:none!important}.univer-cursor-crosshair{cursor:crosshair}.univer-cursor-grabbing{cursor:grabbing}.univer-resize{resize:both}.univer-grid-flow-row{grid-auto-flow:row}.univer-grid-cols-7{grid-template-columns:repeat(7,minmax(0,1fr))}.univer-flex-col-reverse{flex-direction:column-reverse}.univer-content-center{align-content:center}.univer-gap-5{gap:1.25rem}.univer-space-y-1\\.5>:not([hidden])~:not([hidden]){--univer-tw-space-y-reverse:0;margin-top:calc(.375rem * (1 - var(--univer-tw-space-y-reverse)));margin-top:.375rem;margin-top:calc(.375rem * calc(1 - var(--univer-tw-space-y-reverse)));margin-bottom:0;margin-bottom:calc(.375rem * var(--univer-tw-space-y-reverse))}.univer-divide-x>:not([hidden])~:not([hidden]){--univer-tw-divide-x-reverse:0;border-right-width:0;border-right-width:calc(1px * var(--univer-tw-divide-x-reverse));border-left-width:calc(1px * (1 - var(--univer-tw-divide-x-reverse)));border-left-width:1px;border-left-width:calc(1px * calc(1 - var(--univer-tw-divide-x-reverse)))}.univer-divide-y-0>:not([hidden])~:not([hidden]){--univer-tw-divide-y-reverse:0;border-top-width:calc(0px * (1 - var(--univer-tw-divide-y-reverse)));border-top-width:0;border-top-width:calc(0px * calc(1 - var(--univer-tw-divide-y-reverse)));border-bottom-width:0;border-bottom-width:calc(0px * var(--univer-tw-divide-y-reverse))}.univer-text-ellipsis{text-overflow:ellipsis}.univer-text-balance{text-wrap:balance}.\\!univer-rounded-b-none{border-bottom-right-radius:0!important;border-bottom-left-radius:0!important}.\\!univer-rounded-l-none{border-top-left-radius:0!important;border-bottom-left-radius:0!important}.\\!univer-rounded-r-none{border-top-right-radius:0!important;border-bottom-right-radius:0!important}.\\!univer-rounded-t-none{border-top-left-radius:0!important;border-top-right-radius:0!important}.univer-rounded-r-md{border-top-right-radius:.375rem;border-bottom-right-radius:.375rem}.\\!univer-border-l-0{border-left-width:0!important}.\\!univer-border-t-0{border-top-width:0!important}.univer-border-b-0{border-bottom-width:0}.univer-border-l{border-left-width:1px}.univer-border-l-0{border-left-width:0}.univer-border-r{border-right-width:1px}.univer-border-t-0{border-top-width:0}.univer-border-dashed{border-style:dashed}.\\!univer-border-gray-200{border-color:var(--univer-gray-200)!important}.univer-border-gray-300{border-color:var(--univer-gray-300)}.univer-border-primary-200{border-color:var(--univer-primary-200)}.univer-border-primary-300{border-color:var(--univer-primary-300)}.univer-border-red-300{border-color:var(--univer-red-300)}.univer-border-red-500{border-color:var(--univer-red-500)}.univer-border-white{border-color:var(--univer-white)}.\\!univer-bg-primary-600{background-color:var(--univer-primary-600)!important}.univer-bg-\\[rgba\\(0\\,0\\,0\\,0\\.8\\)\\]{background-color:#000c}.univer-bg-gray-800{background-color:var(--univer-gray-800)}.univer-bg-gray-900{background-color:var(--univer-gray-900)}.univer-bg-primary-500{background-color:var(--univer-primary-500)}.univer-bg-red-500{background-color:var(--univer-red-500)}.univer-bg-sky-100\\/70{background-color:#e0f2feb3}.univer-bg-slate-100\\/80{background-color:#f1f5f9cc}.univer-bg-slate-900\\/90{background-color:#0f172ae6}.univer-bg-gradient-to-br{background-image:linear-gradient(to bottom right,var(--univer-tw-gradient-stops))}.univer-from-slate-100{--univer-tw-gradient-from:#f1f5f9 var(--univer-tw-gradient-from-position);--univer-tw-gradient-to:#f1f5f900 var(--univer-tw-gradient-to-position);--univer-tw-gradient-stops:var(--univer-tw-gradient-from), var(--univer-tw-gradient-to)}.univer-via-cyan-50{--univer-tw-gradient-to:#ecfeff00 var(--univer-tw-gradient-to-position);--univer-tw-gradient-stops:var(--univer-tw-gradient-from), #ecfeff var(--univer-tw-gradient-via-position), var(--univer-tw-gradient-to)}.univer-to-blue-100{--univer-tw-gradient-to:var(--univer-blue-100) var(--univer-tw-gradient-to-position)}.univer-fill-current{fill:currentColor}.\\!univer-p-2\\.5{padding:.625rem!important}.univer-p-6{padding:1.5rem}.\\!univer-pl-4{padding-left:1rem!important}.univer-pb-2\\.5{padding-bottom:.625rem}.univer-pl-8{padding-left:2rem}.univer-pr-32{padding-right:8rem}.univer-pr-8{padding-right:2rem}.univer-pt-4{padding-top:1rem}.univer-align-middle{vertical-align:middle}.univer-font-mono{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace}.univer-text-\\[13px\\]{font-size:13px}.univer-text-\\[8px\\]{font-size:8px}.univer-text-sm\\/8{font-size:.875rem;line-height:2rem}.univer-text-xs\\/6{font-size:.75rem;line-height:1.5rem}.univer-leading-9{line-height:2.25rem}.univer-leading-normal{line-height:1.5}.univer-tracking-wide{letter-spacing:.025em}.univer-tracking-widest{letter-spacing:.1em}.\\!univer-text-primary-500{color:var(--univer-primary-500)!important}.univer-text-amber-500{--univer-tw-text-opacity:1;color:rgba(245,158,11,var(--univer-tw-text-opacity,1))}.univer-text-cyan-700{--univer-tw-text-opacity:1;color:rgba(14,116,144,var(--univer-tw-text-opacity,1))}.univer-text-sky-500{--univer-tw-text-opacity:1;color:rgba(14,165,233,var(--univer-tw-text-opacity,1))}.univer-text-sky-700{--univer-tw-text-opacity:1;color:rgba(3,105,161,var(--univer-tw-text-opacity,1))}.univer-text-sky-900{--univer-tw-text-opacity:1;color:rgba(12,74,110,var(--univer-tw-text-opacity,1))}.univer-text-slate-500{--univer-tw-text-opacity:1;color:rgba(100,116,139,var(--univer-tw-text-opacity,1))}.univer-text-slate-600{--univer-tw-text-opacity:1;color:rgba(71,85,105,var(--univer-tw-text-opacity,1))}.univer-text-slate-700{--univer-tw-text-opacity:1;color:rgba(51,65,85,var(--univer-tw-text-opacity,1))}.univer-text-slate-800{--univer-tw-text-opacity:1;color:rgba(30,41,59,var(--univer-tw-text-opacity,1))}.univer-text-violet-500{--univer-tw-text-opacity:1;color:rgba(139,92,246,var(--univer-tw-text-opacity,1))}.univer-underline-offset-4{text-underline-offset:4px}.univer-opacity-100{opacity:1}.univer-opacity-50{opacity:.5}.univer-opacity-80{opacity:.8}.univer-shadow-\\[0_30px_60px_-35px_rgba\\(15\\,23\\,42\\,0\\.55\\)\\]{--univer-tw-shadow:0 30px 60px -35px #0f172a8c;--univer-tw-shadow-colored:0 30px 60px -35px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 30px 60px -35px #0f172a8c;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-shadow-inner{--univer-tw-shadow:inset 0 2px 4px 0 #0000000d;--univer-tw-shadow-colored:inset 0 2px 4px 0 var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,inset 0 2px 4px #0000000d;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-ring-2{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.\\!univer-ring-primary-900{--univer-tw-ring-color:var(--univer-primary-900)!important}.univer-ring-primary-50{--univer-tw-ring-color:var(--univer-primary-50)}.univer-ring-white{--univer-tw-ring-color:var(--univer-white)}.univer-ring-offset-2{--univer-tw-ring-offset-width:2px}.\\!univer-ring-offset-gray-600{--univer-tw-ring-offset-color:var(--univer-gray-600)!important}.univer-ring-offset-white{--univer-tw-ring-offset-color:var(--univer-white)}.univer-drop-shadow-sm{--univer-tw-drop-shadow:drop-shadow(0 1px 1px #0000000d);filter:var(--univer-tw-blur) var(--univer-tw-brightness) var(--univer-tw-contrast) var(--univer-tw-grayscale) var(--univer-tw-hue-rotate) var(--univer-tw-invert) var(--univer-tw-saturate) var(--univer-tw-sepia) var(--univer-tw-drop-shadow)}.univer-transition-\\[color\\,box-shadow\\]{transition-property:color,box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-\\[max-height\\,opacity\\]{transition-property:max-height,opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-opacity{transition-property:opacity;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-transform{transition-property:transform;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-duration-150{transition-duration:.15s}.univer-duration-500{transition-duration:.5s}.univer-duration-75{transition-duration:75ms}.univer-ease-in-out{transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-ease-out{transition-timing-function:cubic-bezier(0,0,.2,1)}.univer-will-change-transform{will-change:transform}.univer-scrollbar-thin::-webkit-scrollbar-track{background-color:var(--scrollbar-track);border-radius:var(--scrollbar-track-radius)}.univer-scrollbar-thin::-webkit-scrollbar-track:hover{background-color:var(--scrollbar-track-hover,var(--scrollbar-track))}.univer-scrollbar-thin::-webkit-scrollbar-track:active{background-color:var(--scrollbar-track-active,var(--scrollbar-track-hover,var(--scrollbar-track)))}.univer-scrollbar-thin::-webkit-scrollbar-thumb{background-color:var(--scrollbar-thumb);border-radius:var(--scrollbar-thumb-radius)}.univer-scrollbar-thin::-webkit-scrollbar-thumb:hover{background-color:var(--scrollbar-thumb-hover,var(--scrollbar-thumb))}.univer-scrollbar-thin::-webkit-scrollbar-thumb:active{background-color:var(--scrollbar-thumb-active,var(--scrollbar-thumb-hover,var(--scrollbar-thumb)))}.univer-scrollbar-thin::-webkit-scrollbar-corner{background-color:var(--scrollbar-corner);border-radius:var(--scrollbar-corner-radius)}.univer-scrollbar-thin::-webkit-scrollbar-corner:hover{background-color:var(--scrollbar-corner-hover,var(--scrollbar-corner))}.univer-scrollbar-thin::-webkit-scrollbar-corner:active{background-color:var(--scrollbar-corner-active,var(--scrollbar-corner-hover,var(--scrollbar-corner)))}.univer-scrollbar-thin{scrollbar-width:thin;scrollbar-color:initial initial;scrollbar-color:var(--scrollbar-thumb,initial) var(--scrollbar-track,initial)}.univer-scrollbar-thin::-webkit-scrollbar{width:8px;height:8px;display:block}.univer-scrollbar-track-gray-50{--scrollbar-track:var(--univer-gray-50)!important}.univer-scrollbar-thumb-gray-300{--scrollbar-thumb:var(--univer-gray-300)!important}.univer-animate-out{--univer-tw-exit-opacity:initial;--univer-tw-exit-scale:initial;--univer-tw-exit-rotate:initial;--univer-tw-exit-translate-x:initial;--univer-tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.univer-fade-in,.univer-fade-in-0{--univer-tw-enter-opacity:0}.univer-fade-out{--univer-tw-exit-opacity:0}.univer-zoom-in-95{--univer-tw-enter-scale:.95}.univer-duration-150{animation-duration:.15s}.univer-duration-200{animation-duration:.2s}.univer-duration-300{animation-duration:.3s}.univer-duration-500{animation-duration:.5s}.univer-duration-75{animation-duration:75ms}.univer-ease-in-out{animation-timing-function:cubic-bezier(.4,0,.2,1)}.univer-ease-out{animation-timing-function:cubic-bezier(0,0,.2,1)}.placeholder\\:univer-text-gray-200::placeholder{color:var(--univer-gray-200)}.placeholder\\:univer-text-gray-400::placeholder{color:var(--univer-gray-400)}.before\\:univer-absolute:before{content:var(--univer-tw-content);position:absolute}.before\\:univer-top-1\\/2:before{content:var(--univer-tw-content);top:50%}.before\\:univer-block:before{content:var(--univer-tw-content);display:block}.before\\:univer-h-px:before{content:var(--univer-tw-content);height:1px}.before\\:univer-w-full:before{content:var(--univer-tw-content);width:100%}.before\\:-univer-translate-y-1\\/2:before{content:var(--univer-tw-content);--univer-tw-translate-y:-50%;transform:translate(var(--univer-tw-translate-x),-50%) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.before\\:univer-bg-gray-200:before{content:var(--univer-tw-content);background-color:var(--univer-gray-200)}.before\\:univer-content-\\[\\"\\"\\]:before{--univer-tw-content:"";content:"";content:var(--univer-tw-content)}.data-\\[disabled\\]\\:univer-pointer-events-none[data-disabled]{pointer-events:none}.data-\\[orientation\\=horizontal\\]\\:univer-h-px[data-orientation=horizontal]{height:1px}.data-\\[orientation\\=vertical\\]\\:univer-h-full[data-orientation=vertical]{height:100%}.data-\\[orientation\\=horizontal\\]\\:univer-w-full[data-orientation=horizontal]{width:100%}.data-\\[orientation\\=vertical\\]\\:univer-w-px[data-orientation=vertical]{width:1px}.data-\\[state\\=open\\]\\:univer-bg-gray-100[data-state=open]{background-color:var(--univer-gray-100)}.data-\\[disabled\\]\\:univer-opacity-50[data-disabled]{opacity:.5}.data-\\[state\\=open\\]\\:univer-animate-in[data-state=open]{--univer-tw-enter-opacity:initial;--univer-tw-enter-scale:initial;--univer-tw-enter-rotate:initial;--univer-tw-enter-translate-x:initial;--univer-tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.data-\\[state\\=closed\\]\\:univer-animate-out[data-state=closed]{--univer-tw-exit-opacity:initial;--univer-tw-exit-scale:initial;--univer-tw-exit-rotate:initial;--univer-tw-exit-translate-x:initial;--univer-tw-exit-translate-y:initial;animation-name:exit;animation-duration:.15s}.data-\\[state\\=closed\\]\\:univer-fade-out-0[data-state=closed]{--univer-tw-exit-opacity:0}.data-\\[state\\=open\\]\\:univer-fade-in-0[data-state=open]{--univer-tw-enter-opacity:0}.data-\\[state\\=closed\\]\\:univer-zoom-out-95[data-state=closed]{--univer-tw-exit-scale:.95}.data-\\[state\\=open\\]\\:univer-zoom-in-95[data-state=open]{--univer-tw-enter-scale:.95}.data-\\[side\\=bottom\\]\\:univer-slide-in-from-top-2[data-side=bottom]{--univer-tw-enter-translate-y:-.5rem}.data-\\[side\\=left\\]\\:univer-slide-in-from-right-2[data-side=left]{--univer-tw-enter-translate-x:.5rem}.data-\\[side\\=right\\]\\:univer-slide-in-from-left-2[data-side=right]{--univer-tw-enter-translate-x:-.5rem}.data-\\[side\\=top\\]\\:univer-slide-in-from-bottom-2[data-side=top]{--univer-tw-enter-translate-y:.5rem}.data-\\[state\\=closed\\]\\:univer-slide-out-to-left-1\\/2[data-state=closed]{--univer-tw-exit-translate-x:-50%}.data-\\[state\\=closed\\]\\:univer-slide-out-to-top-\\[48\\%\\][data-state=closed]{--univer-tw-exit-translate-y:-48%}.data-\\[state\\=open\\]\\:univer-slide-in-from-left-1\\/2[data-state=open]{--univer-tw-enter-translate-x:-50%}.data-\\[state\\=open\\]\\:univer-slide-in-from-top-\\[48\\%\\][data-state=open]{--univer-tw-enter-translate-y:-48%}.hover\\:univer-border-red-400:hover{border-color:var(--univer-red-400)}.hover\\:univer-border-transparent:hover{border-color:#0000}.hover\\:univer-bg-primary-500:hover{background-color:var(--univer-primary-500)}.hover\\:univer-bg-red-400:hover{background-color:var(--univer-red-400)}.hover\\:univer-text-gray-500:hover{color:var(--univer-gray-500)}.hover\\:univer-text-primary-500:hover{color:var(--univer-primary-500)}.hover\\:univer-text-white:hover{color:var(--univer-white)}.hover\\:univer-underline:hover{text-decoration-line:underline}.hover\\:univer-opacity-100:hover{opacity:1}.hover\\:univer-opacity-70:hover{opacity:.7}.hover\\:univer-opacity-80:hover{opacity:.8}.focus\\:univer-border-primary-600:focus{border-color:var(--univer-primary-600)}.focus\\:univer-bg-gray-100:focus{background-color:var(--univer-gray-100)}.focus\\:univer-ring-primary-50:focus{--univer-tw-ring-color:var(--univer-primary-50)}.active\\:univer-border-red-600:active{border-color:var(--univer-red-600)}.active\\:univer-bg-primary-700:active{background-color:var(--univer-primary-700)}.active\\:univer-bg-red-600:active{background-color:var(--univer-red-600)}.active\\:univer-text-primary-700:active{color:var(--univer-primary-700)}.disabled\\:univer-pointer-events-none:disabled{pointer-events:none}.disabled\\:univer-opacity-50:disabled{opacity:.5}@media (width>=640px){.sm\\:\\!univer-flex-row{flex-direction:row!important}.sm\\:\\!univer-justify-end{justify-content:flex-end!important}.sm\\:\\!univer-space-x-2>:not([hidden])~:not([hidden]){--univer-tw-space-x-reverse:0!important;margin-right:0!important;margin-right:calc(.5rem * var(--univer-tw-space-x-reverse))!important;margin-left:calc(.5rem * (1 - var(--univer-tw-space-x-reverse)))!important;margin-left:.5rem!important;margin-left:calc(.5rem * calc(1 - var(--univer-tw-space-x-reverse)))!important}.sm\\:\\!univer-rounded-lg{border-radius:.5rem!important}.sm\\:\\!univer-text-left{text-align:left!important}}@media (width>=768px){.md\\:univer-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}}.rtl\\:univer-left-px:where([dir=rtl],[dir=rtl] *){left:1px}.rtl\\:univer-right-auto:where([dir=rtl],[dir=rtl] *){right:auto}.rtl\\:univer-rounded-l-md:where([dir=rtl],[dir=rtl] *){border-top-left-radius:.375rem;border-bottom-left-radius:.375rem}.rtl\\:univer-rounded-r-none:where([dir=rtl],[dir=rtl] *){border-top-right-radius:0;border-bottom-right-radius:0}.rtl\\:univer-border-l-0:where([dir=rtl],[dir=rtl] *){border-left-width:0}.rtl\\:univer-border-r:where([dir=rtl],[dir=rtl] *){border-right-width:1px}.dark\\:\\!univer-border-gray-500:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-500)!important}.dark\\:\\!univer-border-primary-700:where(.univer-dark,.univer-dark *){border-color:var(--univer-primary-700)!important}.dark\\:\\!univer-bg-gray-100:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-100)!important}.dark\\:\\!univer-bg-primary-600:where(.univer-dark,.univer-dark *){background-color:var(--univer-primary-600)!important}.dark\\:\\!univer-text-gray-900:where(.univer-dark,.univer-dark *){color:var(--univer-gray-900)!important}.dark\\:\\!univer-text-primary-500:where(.univer-dark,.univer-dark *){color:var(--univer-primary-500)!important}.dark\\:\\!univer-text-sky-400:where(.univer-dark,.univer-dark *){--univer-tw-text-opacity:1!important;color:rgba(56,189,248,var(--univer-tw-text-opacity,1))!important}.dark\\:\\!univer-ring-primary-600:where(.univer-dark,.univer-dark *){--univer-tw-ring-color:var(--univer-primary-600)!important}.dark\\:\\!univer-ring-primary-900:where(.univer-dark,.univer-dark *){--univer-tw-ring-color:var(--univer-primary-900)!important}.dark\\:\\!univer-ring-offset-gray-600:where(.univer-dark,.univer-dark *){--univer-tw-ring-offset-color:var(--univer-gray-600)!important}.dark\\:\\!univer-scrollbar-track-gray-900:where(.univer-dark,.univer-dark *){--scrollbar-track:var(--univer-gray-900)!important}.dark\\:\\!univer-scrollbar-thumb-gray-700:where(.univer-dark,.univer-dark *){--scrollbar-thumb:var(--univer-gray-700)!important}.dark\\:before\\:\\!univer-bg-gray-600:where(.univer-dark,.univer-dark *):before{content:var(--univer-tw-content);background-color:var(--univer-gray-600)!important}.dark\\:data-\\[state\\=open\\]\\:\\!univer-bg-gray-600[data-state=open]:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.dark\\:hover\\:\\!univer-text-white:hover:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.dark\\:focus\\:\\!univer-border-primary-500:focus:where(.univer-dark,.univer-dark *){border-color:var(--univer-primary-500)!important}.dark\\:focus\\:\\!univer-bg-gray-600:focus:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.dark\\:focus\\:\\!univer-ring-primary-900:focus:where(.univer-dark,.univer-dark *){--univer-tw-ring-color:var(--univer-primary-900)!important}.dark\\:focus-visible\\:\\!univer-border-gray-600:focus-visible:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)!important}.dark\\:active\\:\\!univer-bg-gray-700:active:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.\\[\\&\\:\\:-webkit-calendar-picker-indicator\\]\\:univer-hidden::-webkit-calendar-picker-indicator{display:none}.\\[\\&\\:\\:-webkit-calendar-picker-indicator\\]\\:univer-appearance-none::-webkit-calendar-picker-indicator{appearance:none}.\\[\\&\\>input\\]\\:univer-w-11>input{width:2.75rem}.\\[\\&\\>input\\]\\:univer-border-gray-200>input{border-color:var(--univer-gray-200)}.\\[\\&\\>input\\]\\:focus\\:univer-border-primary-500:focus>input{border-color:var(--univer-primary-500)}.dark\\:\\[\\&\\>input\\]\\:\\!univer-border-gray-600>input:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)!important}.dark\\:\\[\\&\\>input\\]\\:\\!univer-text-white>input:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.\\[\\&\\>svg\\]\\:univer-block>svg{display:block}.\\[\\&\\>svg\\]\\:univer-size-4>svg{width:1rem;height:1rem}.\\[\\&\\>ul\\:not\\(\\:last-child\\)\\]\\:univer-border-0>ul:not(:last-child){border-width:0}.\\[\\&\\>ul\\:not\\(\\:last-child\\)\\]\\:univer-border-r>ul:not(:last-child){border-right-width:1px}.\\[\\&\\>ul\\:not\\(\\:last-child\\)\\]\\:univer-border-solid>ul:not(:last-child){border-style:solid}.\\[\\&\\>ul\\:not\\(\\:last-child\\)\\]\\:univer-border-r-gray-200>ul:not(:last-child){border-right-color:var(--univer-gray-200)}.\\[\\&_\\[data-description\\]\\]\\:univer-text-sm [data-description]{font-size:.875rem;line-height:1.25rem}.\\[\\&_\\[data-description\\]\\]\\:univer-text-gray-200 [data-description]{color:var(--univer-gray-200)}.\\[\\&_\\[data-description\\]\\]\\:univer-text-gray-600 [data-description]{color:var(--univer-gray-600)}.\\[\\&_\\[data-icon\\]\\>svg\\]\\:univer-relative [data-icon]>svg{position:relative}.\\[\\&_\\[data-icon\\]\\>svg\\]\\:univer-top-1 [data-icon]>svg{top:.25rem}.\\[\\&_\\[data-icon\\]\\]\\:univer-self-baseline [data-icon]{align-self:baseline}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-amber-500 [data-icon]{--univer-tw-text-opacity:1;color:rgba(245,158,11,var(--univer-tw-text-opacity,1))}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-green-500 [data-icon]{color:var(--univer-green-500)}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-primary-600 [data-icon]{color:var(--univer-primary-600)}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-red-500 [data-icon]{color:var(--univer-red-500)}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-sky-500 [data-icon]{--univer-tw-text-opacity:1;color:rgba(14,165,233,var(--univer-tw-text-opacity,1))}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-violet-500 [data-icon]{--univer-tw-text-opacity:1;color:rgba(139,92,246,var(--univer-tw-text-opacity,1))}.\\[\\&_\\[data-icon\\]\\]\\:univer-text-yellow-500 [data-icon]{color:var(--univer-yellow-500)}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-rounded-2xl [data-sonner-toast]{border-radius:1rem}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-border [data-sonner-toast]{border-width:1px}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-border-solid [data-sonner-toast]{border-style:solid}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-border-gray-200 [data-sonner-toast]{border-color:var(--univer-gray-200)}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-shadow-\\[0_16px_40px_-20px_rgba\\(15\\,23\\,42\\,0\\.55\\)\\] [data-sonner-toast]{--univer-tw-shadow:0 16px 40px -20px #0f172a8c;--univer-tw-shadow-colored:0 16px 40px -20px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 16px 40px -20px #0f172a8c;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-shadow-md [data-sonner-toast]{--univer-tw-shadow:0px 1px 6px -2px #1e284d14, 0px 2px 6px -1px #1e284d1a;--univer-tw-shadow-colored:0px 1px 6px -2px var(--univer-tw-shadow-color), 0px 2px 6px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 6px -2px #1e284d14,0 2px 6px -1px #1e284d1a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.\\[\\&_\\[data-sonner-toast\\]\\]\\:univer-backdrop-blur-sm [data-sonner-toast]{--univer-tw-backdrop-blur:blur(4px);-webkit-backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia);backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia)}.dark\\:\\[\\&_\\[data-sonner-toast\\]\\]\\:\\!univer-border-gray-600 [data-sonner-toast]:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)!important}.\\[\\&_\\[data-title\\]\\]\\:univer-text-sm [data-title]{font-size:.875rem;line-height:1.25rem}.\\[\\&_\\[data-title\\]\\]\\:univer-text-gray-900 [data-title]{color:var(--univer-gray-900)}.\\[\\&_\\[data-u-comp\\=form-layout\\]\\]\\:univer-max-w-\\[calc\\(50\\%-8px\\)\\] [data-u-comp=form-layout]{max-width:calc(50% - 8px)}.\\[\\&_\\[data-u-comp\\=form-layout\\]\\]\\:univer-shrink [data-u-comp=form-layout]{flex-shrink:1}.\\[\\&_\\[data-u-comp\\=form-layout\\]\\]\\:univer-grow [data-u-comp=form-layout]{flex-grow:1}.\\[\\&_\\[data-u-comp\\=input\\]\\]\\:univer-w-full [data-u-comp=input]{width:100%}.\\[\\&_\\[data-u-comp\\=input\\]\\]\\:univer-border-red-500 [data-u-comp=input]{border-color:var(--univer-red-500)}.\\[\\&_\\[data-u-comp\\=pager-left-arrow\\]\\:hover\\]\\:\\!univer-bg-gray-600 [data-u-comp=pager-left-arrow]:hover,.\\[\\&_\\[data-u-comp\\=pager-right-arrow\\]\\:hover\\]\\:\\!univer-bg-gray-600 [data-u-comp=pager-right-arrow]:hover{background-color:var(--univer-gray-600)!important}.\\[\\&_\\[data-u-comp\\=select\\]\\]\\:univer-w-full [data-u-comp=select]{width:100%}.\\[\\&_\\[data-u-comp\\=select\\]\\]\\:univer-border-red-500 [data-u-comp=select]{border-color:var(--univer-red-500)}.\\[\\&_input\\]\\:univer-box-border input{box-sizing:border-box}.\\[\\&_input\\]\\:univer-flex input{display:flex}.\\[\\&_input\\]\\:univer-h-7 input{height:1.75rem}.\\[\\&_input\\]\\:univer-items-center input{align-items:center}.\\[\\&_input\\]\\:univer-rounded input{border-radius:.25rem}.\\[\\&_input\\]\\:univer-border input{border-width:1px}.\\[\\&_input\\]\\:univer-border-solid input{border-style:solid}.\\[\\&_input\\]\\:univer-border-gray-200 input{border-color:var(--univer-gray-200)}.\\[\\&_input\\]\\:univer-border-gray-600 input{border-color:var(--univer-gray-600)}.\\[\\&_input\\]\\:univer-bg-transparent input{background-color:#0000}.\\[\\&_input\\]\\:univer-px-1\\.5 input{padding-left:.375rem;padding-right:.375rem}.\\[\\&_input\\]\\:univer-text-gray-700 input{color:var(--univer-gray-700)}.\\[\\&_input\\]\\:univer-text-white input{color:var(--univer-white)}.\\[\\&_input\\]\\:univer-outline-none input{outline-offset:2px;outline:2px solid #0000}.\\[\\&_svg\\]\\:univer-pointer-events-none svg{pointer-events:none}.\\[\\&_svg\\]\\:univer-size-4 svg{width:1rem;height:1rem}.\\[\\&_svg\\]\\:univer-shrink-0 svg{flex-shrink:0}.univer-popup{z-index:1070;--univer-tw-shadow:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--univer-tw-shadow-colored:0 1px 3px 0 var(--univer-tw-shadow-color), 0 1px 2px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow);border-radius:6px;position:fixed;top:-9999px;left:-9999px;overflow:hidden}.univer-popup-enter{transform-origin:0 0;opacity:0;animation-duration:.15s;animation-timing-function:cubic-bezier(.08,.82,.17,1);animation-play-state:paused;animation-fill-mode:both}.univer-popup-enter-active{animation-name:popup-slide-up-in;animation-play-state:running}.univer-popup-exit{transform-origin:0 0;opacity:1;animation-name:popup-slide-up-out;animation-duration:.15s;animation-timing-function:cubic-bezier(.6,.04,.98,.34);animation-play-state:running;animation-fill-mode:both}.univer-popup-exit-active{display:none}.univer-popup-mask{z-index:1060;position:fixed;inset:0}.univer-pointer-events-auto{pointer-events:auto}.univer-invisible{visibility:hidden}.univer-sticky{position:sticky}.-univer-left-\\[99999\\]{left:-99999px}.-univer-top-\\[99999\\]{top:-99999px}.univer-left-1\\/2{left:50%}.univer-left-\\[-9999px\\]{left:-9999px}.univer-right-2{right:.5rem}.univer-top-\\[-9999px\\]{top:-9999px}.univer-top-\\[calc\\(50\\%-6px\\)\\]{top:calc(50% - 6px)}.univer-z-20{z-index:20}.univer-z-\\[-1\\]{z-index:-1}.univer-z-\\[1020\\]{z-index:1020}.univer-z-\\[1080\\]{z-index:1080}.univer-z-\\[1\\]{z-index:1}.univer-mx-2{margin-left:.5rem;margin-right:.5rem}.univer-mx-auto{margin-left:auto;margin-right:auto}.univer-line-clamp-2{-webkit-line-clamp:2;-webkit-box-orient:vertical;display:-webkit-box;overflow:hidden}.\\!univer-size-3\\.5{width:.875rem!important;height:.875rem!important}.univer-size-12{width:3rem;height:3rem}.univer-size-3\\.5{width:.875rem;height:.875rem}.univer-size-7{width:1.75rem;height:1.75rem}.univer-size-9{width:2.25rem;height:2.25rem}.univer-h-0{height:0}.univer-h-1\\.5{height:.375rem}.univer-max-h-\\[80vh\\]{max-height:80vh}.univer-max-h-\\[min\\(72vh\\,560px\\)\\]{max-height:min(72vh,560px)}.univer-min-h-\\[560px\\]{min-height:560px}.univer-min-h-\\[56px\\]{min-height:56px}.univer-min-h-full{min-height:100%}.univer-w-0{width:0}.univer-w-1{width:.25rem}.univer-w-10{width:2.5rem}.univer-w-40{width:10rem}.univer-w-7{width:1.75rem}.univer-w-8{width:2rem}.univer-w-96{width:24rem}.univer-w-max{width:max-content}.univer-w-screen{width:100vw}.univer-min-w-52{min-width:13rem}.univer-min-w-6{min-width:1.5rem}.univer-min-w-min{min-width:min-content}.univer-max-w-3xl{max-width:48rem}.univer-max-w-5xl{max-width:64rem}.univer-max-w-96{max-width:24rem}.univer-max-w-\\[--radix-popper-available-width\\]{max-width:var(--radix-popper-available-width)}.univer-max-w-\\[32\\%\\]{max-width:32%}.univer-max-w-\\[560px\\]{max-width:560px}.univer-max-w-\\[calc\\(100vw-16px\\)\\]{max-width:calc(100vw - 16px)}.univer-max-w-full{max-width:100%}.univer-origin-center{transform-origin:50%}.-univer-translate-x-1\\/2{--univer-tw-translate-x:-50%;transform:translate(-50%,var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-translate-x-0{--univer-tw-translate-x:0px;transform:translateY(var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-translate-x-full{--univer-tw-translate-x:100%;transform:translate(100%,var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-cursor-col-resize{cursor:col-resize}.univer-grid-cols-\\[1fr\\]{grid-template-columns:1fr}.univer-grid-cols-\\[22px_minmax\\(0\\,1fr\\)_22px\\]{grid-template-columns:22px minmax(0,1fr) 22px}.univer-grid-cols-\\[28px_minmax\\(0\\,1fr\\)_auto\\]{grid-template-columns:28px minmax(0,1fr) auto}.univer-grid-cols-\\[32px_minmax\\(0\\,1fr\\)_32px\\]{grid-template-columns:32px minmax(0,1fr) 32px}.univer-grid-cols-\\[auto\\,1fr\\]{grid-template-columns:auto 1fr}.univer-grid-cols-\\[auto_1fr_auto\\]{grid-template-columns:auto 1fr auto}.univer-grid-rows-\\[100\\%\\]{grid-template-rows:100%}.univer-grid-rows-\\[auto_1fr\\]{grid-template-rows:auto 1fr}.univer-grid-rows-\\[auto_1fr_auto\\]{grid-template-rows:auto 1fr auto}.univer-flex-wrap{flex-wrap:wrap}.univer-items-end{align-items:flex-end}.univer-gap-0\\.5{gap:.125rem}.univer-overscroll-contain{overscroll-behavior:contain}.univer-scroll-smooth{scroll-behavior:smooth}.\\!univer-rounded-full{border-radius:9999px!important}.\\!univer-rounded-xl{border-radius:.75rem!important}.univer-rounded-2xl{border-radius:1rem}.univer-rounded-3xl{border-radius:1.5rem}.univer-rounded-r{border-top-right-radius:.25rem;border-bottom-right-radius:.25rem}.univer-rounded-t-\\[28px\\]{border-top-left-radius:28px;border-top-right-radius:28px}.univer-border-0{border-width:0}.\\!univer-bg-gray-200{background-color:var(--univer-gray-200)!important}.\\!univer-bg-gray-500{background-color:var(--univer-gray-500)!important}.univer-bg-\\[rgba\\(15\\,23\\,42\\,0\\.32\\)\\]{background-color:#0f172a52}.univer-bg-gray-50{background-color:var(--univer-gray-50)}.univer-bg-gray-700{background-color:var(--univer-gray-700)}.univer-bg-gradient-to-tr{background-image:linear-gradient(to top right,var(--univer-tw-gradient-stops))}.univer-from-slate-950{--univer-tw-gradient-from:#020617 var(--univer-tw-gradient-from-position);--univer-tw-gradient-to:#02061700 var(--univer-tw-gradient-to-position);--univer-tw-gradient-stops:var(--univer-tw-gradient-from), var(--univer-tw-gradient-to)}.univer-via-blue-950{--univer-tw-gradient-to:#17255400 var(--univer-tw-gradient-to-position);--univer-tw-gradient-stops:var(--univer-tw-gradient-from), #172554 var(--univer-tw-gradient-via-position), var(--univer-tw-gradient-to)}.univer-to-cyan-900{--univer-tw-gradient-to:#164e63 var(--univer-tw-gradient-to-position)}.univer-p-8{padding:2rem}.univer-px-0{padding-left:0;padding-right:0}.univer-px-0\\.5{padding-left:.125rem;padding-right:.125rem}.univer-px-3{padding-left:.75rem;padding-right:.75rem}.univer-pb-2{padding-bottom:.5rem}.univer-pl-2{padding-left:.5rem}.univer-pl-4{padding-left:1rem}.univer-pr-1\\.5{padding-right:.375rem}.univer-text-right{text-align:right}.univer-font-sans{font-family:ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Ubuntu,Cantarell,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji}.univer-text-2xl{font-size:1.5rem;line-height:2rem}.univer-uppercase{text-transform:uppercase}.univer-leading-4{line-height:1rem}.univer-leading-none{line-height:1}.univer-tracking-\\[0\\.08em\\]{letter-spacing:.08em}.univer-tracking-tight{letter-spacing:-.025em}.\\!univer-text-gray-600{color:var(--univer-gray-600)!important}.univer-text-current{color:currentColor}.univer-text-slate-200{--univer-tw-text-opacity:1;color:rgba(226,232,240,var(--univer-tw-text-opacity,1))}.univer-underline{text-decoration-line:underline}.univer-opacity-0{opacity:0}.univer-opacity-30{opacity:.3}.univer-opacity-40{opacity:.4}.univer-opacity-60{opacity:.6}.univer-shadow-\\[0_-16px_48px_rgba\\(15\\,23\\,42\\,0\\.18\\)\\]{--univer-tw-shadow:0 -16px 48px #0f172a2e;--univer-tw-shadow-colored:0 -16px 48px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 -16px 48px #0f172a2e;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-ring-0{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(0px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.univer-ring-primary-600{--univer-tw-ring-color:var(--univer-primary-600)}.univer-backdrop-blur-\\[2px\\]{--univer-tw-backdrop-blur:blur(2px);-webkit-backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia);backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia)}.univer-backdrop-blur-xl{--univer-tw-backdrop-blur:blur(24px);-webkit-backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia);backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia)}.univer-transition-\\[width\\]{transition-property:width;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-animate-in{--univer-tw-enter-opacity:initial;--univer-tw-enter-scale:initial;--univer-tw-enter-rotate:initial;--univer-tw-enter-translate-x:initial;--univer-tw-enter-translate-y:initial;animation-name:enter;animation-duration:.15s}.univer-fade-in{--univer-tw-enter-opacity:0}.univer-fade-in-70{--univer-tw-enter-opacity:.7}.last\\:univer-border-b-0:last-child{border-bottom-width:0}.empty\\:univer-hidden:empty{display:none}.hover\\:univer-opacity-50:hover{opacity:.5}.focus\\:univer-bg-white:focus{background-color:var(--univer-white)}.focus\\:univer-ring-2:focus{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.focus-visible\\:univer-ring-primary-600:focus-visible{--univer-tw-ring-color:var(--univer-primary-600)}.focus-visible\\:univer-ring-offset-0:focus-visible{--univer-tw-ring-offset-width:0px}.active\\:univer-bg-gray-200:active{background-color:var(--univer-gray-200)}.enabled\\:hover\\:univer-bg-gray-50:hover:enabled{background-color:var(--univer-gray-50)}.enabled\\:active\\:univer-bg-gray-100:active:enabled{background-color:var(--univer-gray-100)}.disabled\\:univer-text-gray-300:disabled{color:var(--univer-gray-300)}.disabled\\:hover\\:univer-bg-transparent:hover:disabled{background-color:#0000}@media (width>=640px){.sm\\:\\!univer-block{display:block!important}}.rtl\\:univer-pl-1\\.5:where([dir=rtl],[dir=rtl] *){padding-left:.375rem}.rtl\\:univer-pr-0:where([dir=rtl],[dir=rtl] *){padding-right:0}.rtl\\:univer-pr-2:where([dir=rtl],[dir=rtl] *){padding-right:.5rem}.dark\\:\\!univer-bg-gray-200:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-200)!important}.dark\\:\\!univer-bg-primary-400:where(.univer-dark,.univer-dark *){background-color:var(--univer-primary-400)!important}.dark\\:\\!univer-text-gray-600:where(.univer-dark,.univer-dark *){color:var(--univer-gray-600)!important}.dark\\:\\!univer-text-gray-800:where(.univer-dark,.univer-dark *){color:var(--univer-gray-800)!important}.dark\\:\\!univer-text-primary-100:where(.univer-dark,.univer-dark *){color:var(--univer-primary-100)!important}.dark\\:\\!univer-text-primary-400:where(.univer-dark,.univer-dark *){color:var(--univer-primary-400)!important}.dark\\:hover\\:\\!univer-bg-transparent:hover:where(.univer-dark,.univer-dark *){background-color:#0000!important}.dark\\:active\\:\\!univer-bg-gray-600:active:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.dark\\:disabled\\:\\!univer-text-gray-600:disabled:where(.univer-dark,.univer-dark *){color:var(--univer-gray-600)!important}.\\[\\&\\:\\:-webkit-scrollbar\\]\\:univer-hidden::-webkit-scrollbar{display:none}.\\[\\&\\>\\*\\]\\:univer-m-0>*{margin:0}.\\[\\&\\>\\*\\]\\:univer-inline-flex>*{display:inline-flex}.\\[\\&\\>\\*\\]\\:univer-h-6>*{height:1.5rem}.\\[\\&\\>\\*\\]\\:univer-min-h-7>*{min-height:1.75rem}.\\[\\&\\>\\*\\]\\:univer-min-w-7>*{min-width:1.75rem}.\\[\\&\\>\\*\\]\\:univer-appearance-none>*{appearance:none}.\\[\\&\\>\\*\\]\\:univer-items-center>*{align-items:center}.\\[\\&\\>\\*\\]\\:univer-justify-center>*{justify-content:center}.\\[\\&\\>\\*\\]\\:univer-rounded>*{border-radius:.25rem}.\\[\\&\\>\\*\\]\\:univer-rounded-md>*{border-radius:.375rem}.\\[\\&\\>\\*\\]\\:univer-border-0>*{border-width:0}.\\[\\&\\>\\*\\]\\:univer-px-1>*{padding-left:.25rem;padding-right:.25rem}.\\[\\&\\>\\*\\]\\:univer-px-1\\.5>*{padding-left:.375rem;padding-right:.375rem}.\\[\\&\\>\\*\\]\\:univer-leading-none>*{line-height:1}.\\[\\&\\>\\*\\]\\:univer-outline-none>*{outline-offset:2px;outline:2px solid #0000}.\\[\\&\\>\\*\\]\\:univer-transition-colors>*{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:\\[\\&\\>\\*\\]\\:univer-bg-gray-100>:hover{background-color:var(--univer-gray-100)}.\\[\\&\\>span\\]\\:univer-truncate>span{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.\\[\\&\\>span\\]\\:univer-text-sm>span{font-size:.875rem;line-height:1.25rem}.\\[\\&\\>span\\]\\:univer-font-medium>span{font-weight:500}.\\[\\&\\>svg\\]\\:univer-shrink-0>svg{flex-shrink:0}.\\[\\&\\>svg\\]\\:univer-text-lg>svg{font-size:1.125rem;line-height:1.75rem}.\\[\\&\\>svg\\]\\:univer-text-gray-700>svg{color:var(--univer-gray-700)}.\\[\\&_\\*\\]\\:univer-box-border *{box-sizing:border-box}.\\[\\&_\\.univer-custom-label\\]\\:univer-text-sm .univer-custom-label{font-size:.875rem;line-height:1.25rem}.\\[\\&_\\.univer-custom-label\\]\\:univer-leading-none .univer-custom-label{line-height:1}.\\[\\&_\\.univer-toolbar-button-selector-main\\]\\:\\!univer-h-8 .univer-toolbar-button-selector-main{height:2rem!important}.\\[\\&_\\.univer-toolbar-button-selector-main\\]\\:\\!univer-rounded-none .univer-toolbar-button-selector-main{border-radius:0!important}.\\[\\&_\\.univer-toolbar-button-selector-main\\]\\:\\!univer-rounded-l-md .univer-toolbar-button-selector-main{border-top-left-radius:.375rem!important;border-bottom-left-radius:.375rem!important}.\\[\\&_\\.univer-toolbar-button-selector-main\\]\\:\\!univer-px-1\\.5 .univer-toolbar-button-selector-main{padding-left:.375rem!important;padding-right:.375rem!important}.\\[\\&_\\.univer-toolbar-button-selector-root\\]\\:\\!univer-h-8 .univer-toolbar-button-selector-root{height:2rem!important}.\\[\\&_\\.univer-toolbar-button-selector-root\\]\\:univer-overflow-hidden .univer-toolbar-button-selector-root{overflow:hidden}.\\[\\&_\\.univer-toolbar-button-selector-root\\]\\:\\!univer-rounded-md .univer-toolbar-button-selector-root{border-radius:.375rem!important}.\\[\\&_\\.univer-toolbar-button-selector-root\\]\\:\\!univer-pr-0 .univer-toolbar-button-selector-root{padding-right:0!important}.\\[\\&_\\.univer-toolbar-button-selector-trigger\\]\\:\\!univer-static .univer-toolbar-button-selector-trigger{position:static!important}.\\[\\&_\\.univer-toolbar-button-selector-trigger\\]\\:\\!univer-h-8 .univer-toolbar-button-selector-trigger{height:2rem!important}.\\[\\&_\\.univer-toolbar-button-selector-trigger\\]\\:\\!univer-w-6 .univer-toolbar-button-selector-trigger{width:1.5rem!important}.\\[\\&_\\.univer-toolbar-button-selector-trigger\\]\\:\\!univer-rounded-none .univer-toolbar-button-selector-trigger{border-radius:0!important}.\\[\\&_\\.univer-toolbar-button-selector-trigger\\]\\:\\!univer-rounded-r-md .univer-toolbar-button-selector-trigger{border-top-right-radius:.375rem!important;border-bottom-right-radius:.375rem!important}.\\[\\&_\\.univer-toolbar-selector-root\\]\\:\\!univer-h-8 .univer-toolbar-selector-root{height:2rem!important}.\\[\\&_\\.univer-toolbar-selector-root\\]\\:\\!univer-gap-1 .univer-toolbar-selector-root{gap:.25rem!important}.\\[\\&_\\.univer-toolbar-selector-root\\]\\:\\!univer-rounded-md .univer-toolbar-selector-root{border-radius:.375rem!important}.\\[\\&_\\.univer-toolbar-selector-root\\]\\:\\!univer-px-1\\.5 .univer-toolbar-selector-root{padding-left:.375rem!important;padding-right:.375rem!important}.\\[\\&_\\.univer-toolbar-selector-trigger\\]\\:\\!univer-pl-0\\.5 .univer-toolbar-selector-trigger{padding-left:.125rem!important}.\\[\\&_\\.univer-tooltip\\]\\:univer-inline-flex .univer-tooltip{display:inline-flex}.\\[\\&_\\.univer-tooltip\\]\\:univer-h-full .univer-tooltip{height:100%}.\\[\\&_\\.univer-tooltip\\]\\:univer-items-center .univer-tooltip{align-items:center}.\\[\\&_\\[data-u-command\\]\\]\\:\\!univer-h-8 [data-u-command]{height:2rem!important}.\\[\\&_\\[data-u-command\\]\\]\\:\\!univer-min-h-8 [data-u-command]{min-height:2rem!important}.\\[\\&_\\[data-u-command\\]\\]\\:\\!univer-rounded-md [data-u-command]{border-radius:.375rem!important}.\\[\\&_\\[data-u-command\\]\\]\\:\\!univer-px-1\\.5 [data-u-command]{padding-left:.375rem!important;padding-right:.375rem!important}.\\[\\&_button\\]\\:\\!univer-m-0 button{margin:0!important}.\\[\\&_button\\]\\:\\!univer-h-8 button{height:2rem!important}.\\[\\&_button\\]\\:\\!univer-min-w-8 button{min-width:2rem!important}.\\[\\&_button\\]\\:\\!univer-appearance-none button{appearance:none!important}.\\[\\&_button\\]\\:\\!univer-rounded-md button{border-radius:.375rem!important}.\\[\\&_button\\]\\:\\!univer-border-0 button{border-width:0!important}.\\[\\&_button\\]\\:\\!univer-bg-transparent button{background-color:#0000!important}.\\[\\&_button\\]\\:\\!univer-p-0 button{padding:0!important}.\\[\\&_button\\]\\:\\!univer-px-1\\.5 button{padding-left:.375rem!important;padding-right:.375rem!important}.\\[\\&_button\\]\\:\\!univer-leading-none button{line-height:1!important}.\\[\\&_button\\]\\:\\!univer-outline-none button{outline-offset:2px!important;outline:2px solid #0000!important}.\\[\\&_input\\:focus\\]\\:\\!univer-ring-0 input:focus{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color)!important;--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(0px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color)!important;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000!important;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)!important}.\\[\\&_input\\]\\:\\!univer-m-0 input{margin:0!important}.\\[\\&_input\\]\\:univer-h-6 input{height:1.5rem}.\\[\\&_input\\]\\:univer-w-7 input{width:1.75rem}.\\[\\&_input\\]\\:\\!univer-appearance-none input{appearance:none!important}.\\[\\&_input\\]\\:\\!univer-border-0 input{border-width:0!important}.\\[\\&_input\\]\\:univer-border-none input{border-style:none}.\\[\\&_input\\]\\:\\!univer-bg-transparent input{background-color:#0000!important}.\\[\\&_input\\]\\:\\!univer-p-0 input{padding:0!important}.\\[\\&_input\\]\\:univer-p-0 input{padding:0}.\\[\\&_input\\]\\:univer-text-sm input{font-size:.875rem;line-height:1.25rem}.\\[\\&_input\\]\\:\\!univer-leading-none input{line-height:1!important}.\\[\\&_input\\]\\:\\!univer-outline-none input{outline-offset:2px!important;outline:2px solid #0000!important}.univer-fixed{position:fixed}.univer-bottom-0{bottom:0}.univer-left-5{left:1.25rem}.univer-left-\\[5px\\]{left:5px}.univer-top-4{top:1rem}.univer-top-\\[5px\\]{top:5px}.univer-z-\\[10000\\]{z-index:10000}.univer-mr-1{margin-right:.25rem}.univer-mt-1\\.5{margin-top:.375rem}.univer-mt-12{margin-top:3rem}.univer-mt-5{margin-top:1.25rem}.univer-size-0\\.5{width:.125rem;height:.125rem}.univer-size-8{width:2rem;height:2rem}.univer-h-16{height:4rem}.univer-h-3\\.5{height:.875rem}.univer-h-\\[24px\\]{height:24px}.univer-min-h-8{min-height:2rem}.univer-w-2{width:.5rem}.univer-w-2\\.5{width:.625rem}.univer-w-28{width:7rem}.univer-w-4\\/5{width:80%}.univer-w-\\[0px\\]{width:0}.univer-w-\\[212px\\]{width:212px}.univer-w-\\[72px\\]{width:72px}.univer-min-w-\\[180px\\]{min-width:180px}.univer-cursor-grab{cursor:grab}.univer-grid-cols-4{grid-template-columns:repeat(4,minmax(0,1fr))}.univer-place-items-center{place-items:center}.univer-items-stretch{align-items:stretch}.univer-gap-2\\.5{gap:.625rem}.univer-gap-3{gap:.75rem}.univer-gap-x-0\\.5{-moz-column-gap:.125rem;column-gap:.125rem}.univer-gap-y-px{row-gap:1px}.univer-overflow-x-hidden{overflow-x:hidden}.univer-rounded-r-2xl{border-top-right-radius:1rem;border-bottom-right-radius:1rem}.\\!univer-border-primary-500{border-color:var(--univer-primary-500)!important}.univer-border-primary-500{border-color:var(--univer-primary-500)}.\\!univer-bg-primary-50{background-color:var(--univer-primary-50)!important}.\\!univer-bg-primary-900{background-color:var(--univer-primary-900)!important}.univer-bg-gray-400{background-color:var(--univer-gray-400)}.univer-px-2\\.5{padding-left:.625rem;padding-right:.625rem}.univer-pb-0\\.5{padding-bottom:.125rem}.univer-pb-4{padding-bottom:1rem}.univer-pr-1{padding-right:.25rem}.univer-pt-1\\.5{padding-top:.375rem}.univer-pt-14{padding-top:3.5rem}.univer-text-lg{font-size:1.125rem;line-height:1.75rem}.univer-font-\\[500\\],.univer-font-medium{font-weight:500}.univer-font-normal{font-weight:400}.univer-leading-\\[24px\\]{line-height:24px}.\\!univer-text-gray-200{color:var(--univer-gray-200)!important}.\\!univer-text-gray-400{color:var(--univer-gray-400)!important}.\\!univer-text-primary-600{color:var(--univer-primary-600)!important}.univer-text-gray-800{color:var(--univer-gray-800)}.univer-backdrop-blur-\\[10px\\]{--univer-tw-backdrop-blur:blur(10px);-webkit-backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia);backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia)}.univer-duration-300{transition-duration:.3s}.univer-group:hover .group-hover\\:univer-bg-gray-500{background-color:var(--univer-gray-500)}.hover\\:univer-border-primary-500:hover{border-color:var(--univer-primary-500)}.hover\\:univer-bg-white:hover{background-color:var(--univer-white)}.hover\\:univer-text-gray-900:hover{color:var(--univer-gray-900)}.hover\\:univer-text-primary-600:hover{color:var(--univer-primary-600)}.hover\\:univer-shadow-md:hover{--univer-tw-shadow:0px 1px 6px -2px #1e284d14, 0px 2px 6px -1px #1e284d1a;--univer-tw-shadow-colored:0px 1px 6px -2px var(--univer-tw-shadow-color), 0px 2px 6px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 6px -2px #1e284d14,0 2px 6px -1px #1e284d1a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.active\\:univer-cursor-grabbing:active{cursor:grabbing}.dark\\:\\!univer-bg-gray-500:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-500)!important}.dark\\:\\!univer-bg-primary-900:where(.univer-dark,.univer-dark *){background-color:var(--univer-primary-900)!important}.univer-group:hover .dark\\:group-hover\\:\\!univer-bg-gray-300:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-300)!important}.univer-pointer-events-none{pointer-events:none}.univer-inset-0{inset:0}.-univer-left-0\\.5{left:-.125rem}.-univer-top-0\\.5{top:-.125rem}.univer-left-0{left:0}.univer-left-1{left:.25rem}.univer-left-3{left:.75rem}.univer-right-0{right:0}.univer-right-5{right:1.25rem}.univer-top-0{top:0}.univer-top-0\\.5{top:.125rem}.univer-z-10{z-index:10}.univer-z-\\[1001\\]{z-index:1001}.univer-z-\\[100\\]{z-index:100}.univer-mx-1\\.5{margin-left:.375rem;margin-right:.375rem}.univer-mb-1\\.5{margin-bottom:.375rem}.univer-mb-3{margin-bottom:.75rem}.univer-mb-4{margin-bottom:1rem}.univer-ml-1\\.5{margin-left:.375rem}.univer-ml-3{margin-left:.75rem}.univer-ml-6{margin-left:1.5rem}.univer-ml-px{margin-left:1px}.univer-mr-1\\.5{margin-right:.375rem}.univer-mr-5{margin-right:1.25rem}.univer-mt-auto{margin-top:auto}.univer-size-0{width:0;height:0}.univer-size-10{width:2.5rem;height:2.5rem}.univer-h-0\\.5{height:.125rem}.univer-h-1{height:.25rem}.univer-h-10{height:2.5rem}.univer-h-20{height:5rem}.univer-h-60{height:15rem}.univer-h-9{height:2.25rem}.univer-h-\\[270px\\]{height:270px}.univer-h-\\[30px\\]{height:30px}.univer-h-\\[calc\\(100\\%-16px\\)\\]{height:calc(100% - 16px)}.univer-h-\\[calc\\(100\\%-8px\\)\\]{height:calc(100% - 8px)}.univer-h-px{height:1px}.univer-max-h-52{max-height:13rem}.univer-max-h-\\[100px\\]{max-height:100px}.univer-max-h-\\[360px\\]{max-height:360px}.univer-min-h-0{min-height:0}.univer-min-h-\\[30px\\]{min-height:30px}.\\!univer-w-\\[90px\\]{width:90px!important}.univer-w-16{width:4rem}.univer-w-20{width:5rem}.univer-w-24{width:6rem}.univer-w-5{width:1.25rem}.univer-w-60{width:15rem}.univer-w-\\[100px\\]{width:100px}.univer-w-\\[130px\\]{width:130px}.univer-w-\\[156px\\]{width:156px}.univer-w-\\[300px\\]{width:300px}.univer-w-\\[50\\%\\]{width:50%}.univer-w-fit{width:fit-content}.univer-min-w-0{min-width:0}.univer-min-w-72{min-width:18rem}.univer-max-w-32{max-width:8rem}.univer-max-w-36{max-width:9rem}.univer-max-w-64{max-width:16rem}.univer-max-w-\\[190px\\]{max-width:190px}.univer-max-w-\\[200px\\]{max-width:200px}.univer-max-w-\\[calc\\(100\\%-112px\\)\\]{max-width:calc(100% - 112px)}.univer-max-w-fit{max-width:fit-content}.univer-max-w-lg{max-width:32rem}.univer-flex-shrink-0,.univer-shrink-0{flex-shrink:0}.univer-rotate-180{--univer-tw-rotate:180deg;transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(180deg) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-animate-spin{animation:1s linear infinite univer-spin}.univer-cursor-not-allowed{cursor:not-allowed}.univer-appearance-none{appearance:none}.univer-grid-flow-col{grid-auto-flow:column}.univer-grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.univer-grid-cols-\\[1fr\\,auto\\,auto\\,auto\\]{grid-template-columns:1fr auto auto auto}.univer-flex-row-reverse{flex-direction:row-reverse}.univer-gap-7{gap:1.75rem}.univer-gap-x-2{-moz-column-gap:.5rem;column-gap:.5rem}.univer-space-y-2>:not([hidden])~:not([hidden]){--univer-tw-space-y-reverse:0;margin-top:calc(.5rem * (1 - var(--univer-tw-space-y-reverse)));margin-top:.5rem;margin-top:calc(.5rem * calc(1 - var(--univer-tw-space-y-reverse)));margin-bottom:0;margin-bottom:calc(.5rem * var(--univer-tw-space-y-reverse))}.univer-divide-x-0>:not([hidden])~:not([hidden]){--univer-tw-divide-x-reverse:0;border-right-width:0;border-right-width:calc(0px * var(--univer-tw-divide-x-reverse));border-left-width:calc(0px * (1 - var(--univer-tw-divide-x-reverse)));border-left-width:0;border-left-width:calc(0px * calc(1 - var(--univer-tw-divide-x-reverse)))}.univer-divide-y>:not([hidden])~:not([hidden]){--univer-tw-divide-y-reverse:0;border-top-width:calc(1px * (1 - var(--univer-tw-divide-y-reverse)));border-top-width:1px;border-top-width:calc(1px * calc(1 - var(--univer-tw-divide-y-reverse)));border-bottom-width:0;border-bottom-width:calc(1px * var(--univer-tw-divide-y-reverse))}.univer-divide-solid>:not([hidden])~:not([hidden]){border-style:solid}.univer-divide-gray-200>:not([hidden])~:not([hidden]){border-color:var(--univer-gray-200)}.univer-justify-self-center{justify-self:center}.univer-overflow-x-auto{overflow-x:auto}.univer-overflow-y-hidden{overflow-y:hidden}.univer-rounded-sm{border-radius:.125rem}.univer-border-2{border-width:2px}.univer-border-4{border-width:4px}.univer-border-b{border-bottom-width:1px}.univer-border-\\[rgba\\(13\\,13\\,13\\,0\\.12\\)\\]{border-color:#0d0d0d1f}.univer-border-gray-100{border-color:var(--univer-gray-100)}.univer-border-r-gray-200{border-right-color:var(--univer-gray-200)}.univer-border-t-primary-500{border-top-color:var(--univer-primary-500)}.\\!univer-bg-gray-700{background-color:var(--univer-gray-700)!important}.univer-bg-blue-500{background-color:var(--univer-blue-500)}.univer-bg-blue-600{background-color:var(--univer-blue-600)}.univer-bg-gradient-to-b{background-image:linear-gradient(to bottom,var(--univer-tw-gradient-stops))}.univer-from-gray-50{--univer-tw-gradient-from:var(--univer-gray-50) var(--univer-tw-gradient-from-position);--univer-tw-gradient-to:#fff0 var(--univer-tw-gradient-to-position);--univer-tw-gradient-stops:var(--univer-tw-gradient-from), var(--univer-tw-gradient-to)}.univer-to-gray-100{--univer-tw-gradient-to:var(--univer-gray-100) var(--univer-tw-gradient-to-position)}.univer-fill-gray-900{fill:var(--univer-gray-900)}.univer-px-3\\.5{padding-left:.875rem;padding-right:.875rem}.univer-px-5{padding-left:1.25rem;padding-right:1.25rem}.univer-py-5{padding-top:1.25rem;padding-bottom:1.25rem}.univer-pb-1{padding-bottom:.25rem}.univer-pl-1\\.5{padding-left:.375rem}.univer-pl-3{padding-left:.75rem}.univer-pl-6{padding-left:1.5rem}.univer-pr-5{padding-right:1.25rem}.univer-pt-1{padding-top:.25rem}.univer-font-semibold{font-weight:600}.univer-leading-6{line-height:1.5rem}.univer-leading-7{line-height:1.75rem}.\\!univer-text-blue-400{color:var(--univer-blue-400)!important}.\\!univer-text-gray-700{color:var(--univer-gray-700)!important}.\\!univer-text-white{color:var(--univer-white)!important}.univer-text-blue-500{color:var(--univer-blue-500)}.univer-text-blue-600{color:var(--univer-blue-600)}.univer-text-gray-200{color:var(--univer-gray-200)}.univer-text-gray-300{color:var(--univer-gray-300)}.univer-text-green-600{color:var(--univer-green-600)}.univer-text-primary-700{color:var(--univer-primary-700)}.univer-text-red-600{color:var(--univer-red-600)}.univer-text-rose-600{--univer-tw-text-opacity:1;color:rgba(225,29,72,var(--univer-tw-text-opacity,1))}.univer-text-yellow-500{color:var(--univer-yellow-500)}.univer-shadow{--univer-tw-shadow:0 1px 3px 0 #0000001a, 0 1px 2px -1px #0000001a;--univer-tw-shadow-colored:0 1px 3px 0 var(--univer-tw-shadow-color), 0 1px 2px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 3px #0000001a,0 1px 2px -1px #0000001a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-blur-sm{--univer-tw-blur:blur(4px);filter:var(--univer-tw-blur) var(--univer-tw-brightness) var(--univer-tw-contrast) var(--univer-tw-grayscale) var(--univer-tw-hue-rotate) var(--univer-tw-invert) var(--univer-tw-saturate) var(--univer-tw-sepia) var(--univer-tw-drop-shadow)}.univer-backdrop-blur{--univer-tw-backdrop-blur:blur(8px);-webkit-backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia);backdrop-filter:var(--univer-tw-backdrop-blur) var(--univer-tw-backdrop-brightness) var(--univer-tw-backdrop-contrast) var(--univer-tw-backdrop-grayscale) var(--univer-tw-backdrop-hue-rotate) var(--univer-tw-backdrop-invert) var(--univer-tw-backdrop-opacity) var(--univer-tw-backdrop-saturate) var(--univer-tw-backdrop-sepia)}.univer-transition-\\[colors\\,box-shadow\\]{transition-property:colors,box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-\\[height\\]{transition-property:height;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-transition-all{transition-property:all;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.univer-duration-200{transition-duration:.2s}.univer-ease-linear{transition-timing-function:linear}.after\\:univer-absolute:after{content:var(--univer-tw-content);position:absolute}.after\\:univer-right-0:after{content:var(--univer-tw-content);right:0}.after\\:univer-top-1\\/2:after{content:var(--univer-tw-content);top:50%}.after\\:univer-block:after{content:var(--univer-tw-content);display:block}.after\\:univer-h-4:after{content:var(--univer-tw-content);height:1rem}.after\\:univer-w-px:after{content:var(--univer-tw-content);width:1px}.after\\:-univer-translate-y-1\\/2:after{content:var(--univer-tw-content);--univer-tw-translate-y:-50%;transform:translate(var(--univer-tw-translate-x),-50%) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.after\\:univer-bg-gray-200:after{content:var(--univer-tw-content);background-color:var(--univer-gray-200)}.after\\:univer-content-\\[\\"\\"\\]:after{--univer-tw-content:"";content:"";content:var(--univer-tw-content)}.last\\:univer-mb-0:last-child{margin-bottom:0}.univer-group:hover .group-hover\\:univer-flex{display:flex}.hover\\:univer-border-primary-600:hover{border-color:var(--univer-primary-600)}.hover\\:univer-bg-transparent:hover{background-color:#0000}.focus\\:univer-border-primary-500:focus{border-color:var(--univer-primary-500)}.focus\\:univer-outline-none:focus{outline-offset:2px;outline:2px solid #0000}.focus-visible\\:univer-ring-2:focus-visible{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.focus-visible\\:univer-ring-primary-500:focus-visible{--univer-tw-ring-color:var(--univer-primary-500)}.active\\:univer-bg-gray-100:active{background-color:var(--univer-gray-100)}.dark\\:\\!univer-divide-gray-600:where(.univer-dark,.univer-dark *)>:not([hidden])~:not([hidden]){border-color:var(--univer-gray-600)!important}.dark\\:\\!univer-border-r-gray-700:where(.univer-dark,.univer-dark *){border-right-color:var(--univer-gray-700)!important}.dark\\:\\!univer-bg-black:where(.univer-dark,.univer-dark *){background-color:var(--univer-black)!important}.dark\\:\\!univer-bg-blue-400:where(.univer-dark,.univer-dark *){background-color:var(--univer-blue-400)!important}.dark\\:\\!univer-from-gray-800:where(.univer-dark,.univer-dark *){--univer-tw-gradient-from:var(--univer-gray-800) var(--univer-tw-gradient-from-position)!important;--univer-tw-gradient-to:#fff0 var(--univer-tw-gradient-to-position)!important;--univer-tw-gradient-stops:var(--univer-tw-gradient-from), var(--univer-tw-gradient-to)!important}.dark\\:\\!univer-to-gray-900:where(.univer-dark,.univer-dark *){--univer-tw-gradient-to:var(--univer-gray-900) var(--univer-tw-gradient-to-position)!important}.dark\\:\\!univer-fill-white:where(.univer-dark,.univer-dark *){fill:var(--univer-white)!important}.dark\\:\\!univer-text-blue-400:where(.univer-dark,.univer-dark *){color:var(--univer-blue-400)!important}.dark\\:\\!univer-text-gray-700:where(.univer-dark,.univer-dark *){color:var(--univer-gray-700)!important}.dark\\:\\!univer-text-green-400:where(.univer-dark,.univer-dark *){color:var(--univer-green-400)!important}.dark\\:\\!univer-text-red-400:where(.univer-dark,.univer-dark *){color:var(--univer-red-400)!important}.\\[\\&\\>div\\:first-child\\]\\:univer-px-2\\.5>div:first-child{padding-left:.625rem;padding-right:.625rem}.\\[\\&\\>div\\]\\:univer-h-5>div{height:1.25rem}.\\[\\&\\>div\\]\\:univer-ring-transparent>div{--univer-tw-ring-color:transparent}.\\[\\&_canvas\\]\\:univer-absolute canvas,.univer-absolute{position:absolute}.univer-left-1\\.5{left:.375rem}.univer-top-1\\/2{top:50%}.univer-z-\\[15\\]{z-index:15}.univer-m-0{margin:0}.-univer-mx-6{margin-left:-1.5rem;margin-right:-1.5rem}.univer-mx-0{margin-left:0;margin-right:0}.univer-my-1{margin-top:.25rem;margin-bottom:.25rem}.univer-my-2{margin-top:.5rem;margin-bottom:.5rem}.univer-mb-0{margin-bottom:0}.univer-ml-4{margin-left:1rem}.univer-mr-0{margin-right:0}.univer-mt-0{margin-top:0}.univer-mt-1{margin-top:.25rem}.univer-h-\\[18px\\]{height:18px}.univer-h-\\[364px\\]{height:364px}.univer-max-h-60{max-height:15rem}.univer-max-h-72{max-height:18rem}.univer-max-h-\\[350px\\]{max-height:350px}.univer-w-\\[250px\\]{width:250px}.-univer-translate-y-1\\/2{--univer-tw-translate-y:-50%;transform:translate(var(--univer-tw-translate-x),-50%) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y));transform:translate(var(--univer-tw-translate-x),var(--univer-tw-translate-y)) rotate(var(--univer-tw-rotate)) skew(var(--univer-tw-skew-x)) skewY(var(--univer-tw-skew-y)) scaleX(var(--univer-tw-scale-x)) scaleY(var(--univer-tw-scale-y))}.univer-select-none{-webkit-user-select:none;user-select:none}.univer-list-none{list-style-type:none}.univer-justify-around{justify-content:space-around}.univer-overflow-visible{overflow:visible}.univer-whitespace-pre-wrap{white-space:pre-wrap}.univer-break-words{word-wrap:break-word}.univer-break-all{word-break:break-all}.univer-rounded-none{border-radius:0}.univer-rounded-l{border-top-left-radius:.25rem;border-bottom-left-radius:.25rem}.univer-border-r-0{border-right-width:0}.univer-border-gray-600{border-color:var(--univer-gray-600)}.univer-border-primary-600{border-color:var(--univer-primary-600)}.\\!univer-bg-gray-600{background-color:var(--univer-gray-600)!important}.univer-bg-primary-600{background-color:var(--univer-primary-600)}.univer-px-4{padding-left:1rem;padding-right:1rem}.univer-px-6{padding-left:1.5rem;padding-right:1.5rem}.univer-px-7{padding-left:1.75rem;padding-right:1.75rem}.univer-py-3{padding-top:.75rem;padding-bottom:.75rem}.univer-pb-3{padding-bottom:.75rem}.univer-pt-0{padding-top:0}.univer-font-medium{font-weight:500}.univer-leading-\\[13px\\]{line-height:13px}.univer-text-white{color:var(--univer-white)}.univer-outline-none{outline-offset:2px;outline:2px solid #0000}.univer-ring-1{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(1px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.univer-ring-primary-500{--univer-tw-ring-color:var(--univer-primary-500)}.univer-ring-red-500{--univer-tw-ring-color:var(--univer-red-500)}.hover\\:univer-bg-gray-200:hover{background-color:var(--univer-gray-200)}.hover\\:univer-bg-gray-300:hover{background-color:var(--univer-gray-300)}.dark\\:\\!univer-bg-gray-600:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.dark\\:\\!univer-text-gray-300:where(.univer-dark,.univer-dark *){color:var(--univer-gray-300)!important}.dark\\:hover\\:\\!univer-bg-gray-600:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-600)!important}.univer-mb-5{margin-bottom:1.25rem}.univer-mr-3{margin-right:.75rem}.univer-mt-3{margin-top:.75rem}.univer-mt-3\\.5{margin-top:.875rem}.univer-max-h-\\[400px\\]{max-height:400px}.univer-w-32{width:8rem}.univer-w-36{width:9rem}.univer-w-4{width:1rem}.univer-w-\\[340px\\]{width:340px}.univer-cursor-default{cursor:default}.univer-gap-1\\.5{gap:.375rem}.univer-gap-6{gap:1.5rem}.univer-overflow-y-auto{overflow-y:auto}.univer-p-1\\.5{padding:.375rem}.univer-py-1\\.5{padding-top:.375rem;padding-bottom:.375rem}.univer-pb-5{padding-bottom:1.25rem}.univer-text-sm,.univer-text-sm\\/5{font-size:.875rem;line-height:1.25rem}.dark\\:\\!univer-text-gray-400:where(.univer-dark,.univer-dark *){color:var(--univer-gray-400)!important}.univer-absolute{position:absolute}.-univer-bottom-0\\.5{bottom:-.125rem}.-univer-right-0\\.5{right:-.125rem}.univer-mx-1{margin-left:.25rem;margin-right:.25rem}.univer-mb-2{margin-bottom:.5rem}.univer-ml-1{margin-left:.25rem}.univer-mt-2{margin-top:.5rem}.univer-block{display:block}.univer-inline-block{display:inline-block}.univer-size-3{width:.75rem;height:.75rem}.univer-size-full{width:100%;height:100%}.univer-h-4{height:1rem}.univer-h-\\[300px\\]{height:300px}.univer-max-h-\\[500px\\]{max-height:500px}.univer-min-h-\\[300px\\]{min-height:300px}.univer-w-\\[400px\\]{width:400px}.univer-flex-shrink{flex-shrink:1}.univer-flex-shrink-0{flex-shrink:0}.univer-flex-grow{flex-grow:1}.univer-flex-grow-0{flex-grow:0}.univer-grid-cols-8{grid-template-columns:repeat(8,minmax(0,1fr))}.univer-flex-nowrap{flex-wrap:nowrap}.univer-justify-start{justify-content:flex-start}.univer-gap-4{gap:1rem}.univer-overflow-auto{overflow:auto}.univer-whitespace-nowrap{white-space:nowrap}.univer-rounded-full{border-radius:9999px}.univer-border-\\[rgba\\(13\\,13\\,13\\,0\\.06\\)\\]{border-color:#0d0d0d0f}.univer-border-transparent{border-color:#0000}.univer-bg-gray-300{background-color:var(--univer-gray-300)}.univer-p-0\\.5{padding:.125rem}.univer-p-2{padding:.5rem}.univer-py-0{padding-top:0;padding-bottom:0}.univer-py-0\\.5{padding-top:.125rem;padding-bottom:.125rem}.univer-py-2\\.5{padding-top:.625rem;padding-bottom:.625rem}.univer-pl-5{padding-left:1.25rem}.univer-pr-0\\.5{padding-right:.125rem}.univer-pr-2{padding-right:.5rem}.univer-pt-2{padding-top:.5rem}.univer-font-bold{font-weight:700}.univer-text-\\[\\#418F1F\\]{--univer-tw-text-opacity:1;color:rgba(65,143,31,var(--univer-tw-text-opacity,1))}.univer-text-gray-500{color:var(--univer-gray-500)}.univer-transition-shadow{transition-property:box-shadow;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.hover\\:univer-bg-gray-50:hover{background-color:var(--univer-gray-50)}.hover\\:univer-ring-2:hover{--univer-tw-ring-offset-shadow:var(--univer-tw-ring-inset) 0 0 0 var(--univer-tw-ring-offset-width) var(--univer-tw-ring-offset-color);--univer-tw-ring-shadow:var(--univer-tw-ring-inset) 0 0 0 calc(2px + var(--univer-tw-ring-offset-width)) var(--univer-tw-ring-color);box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),0 0 #0000;box-shadow:var(--univer-tw-ring-offset-shadow),var(--univer-tw-ring-shadow),var(--univer-tw-shadow,0 0 #0000)}.hover\\:univer-ring-offset-2:hover{--univer-tw-ring-offset-width:2px}.hover\\:univer-ring-offset-white:hover{--univer-tw-ring-offset-color:var(--univer-white)}.dark\\:\\!univer-border-\\[rgba\\(255\\,255\\,255\\,0\\.06\\)\\]:where(.univer-dark,.univer-dark *){border-color:#ffffff0f!important}.dark\\:\\!univer-border-gray-600:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-600)!important}.dark\\:\\!univer-text-gray-500:where(.univer-dark,.univer-dark *){color:var(--univer-gray-500)!important}.dark\\:hover\\:\\!univer-bg-gray-900:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)!important}.\\[\\&\\:hover_a\\]\\:univer-inline-block:hover a{display:inline-block}.univer-mt-4{margin-top:1rem}.univer-mt-6{margin-top:1.5rem}.univer-inline-flex{display:inline-flex}.univer-text-primary-500{color:var(--univer-primary-500)}.univer-relative{position:relative}.univer-mt-2\\.5{margin-top:.625rem}.univer-size-4{width:1rem;height:1rem}.univer-h-5{height:1.25rem}.univer-h-7{height:1.75rem}.univer-h-8{height:2rem}.univer-h-full{height:100%}.univer-w-6{width:1.5rem}.univer-w-px{width:1px}.univer-min-w-32{min-width:8rem}.univer-min-w-9{min-width:2.25rem}.univer-grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.univer-grid-cols-3{grid-template-columns:repeat(3,minmax(0,1fr))}.univer-gap-1{gap:.25rem}.univer-rounded-md{border-radius:.375rem}.univer-border{border-width:1px}.univer-border-solid{border-style:solid}.univer-border-none{border-style:none}.\\!univer-bg-gray-800{background-color:var(--univer-gray-800)!important}.\\!univer-bg-gray-900{background-color:var(--univer-gray-900)!important}.univer-bg-gray-100{background-color:var(--univer-gray-100)}.univer-bg-gray-200{background-color:var(--univer-gray-200)}.univer-bg-primary-50{background-color:var(--univer-primary-50)}.univer-bg-transparent{background-color:#0000}.univer-fill-primary-600{fill:var(--univer-primary-600)}.univer-p-0{padding:0}.univer-p-1{padding:.25rem}.univer-px-1{padding-left:.25rem;padding-right:.25rem}.univer-px-1\\.5{padding-left:.375rem;padding-right:.375rem}.univer-px-2{padding-left:.5rem;padding-right:.5rem}.univer-py-1{padding-top:.25rem;padding-bottom:.25rem}.univer-text-left{text-align:left}.univer-text-center{text-align:center}.\\!univer-text-primary-300{color:var(--univer-primary-300)!important}.univer-text-gray-700{color:var(--univer-gray-700)}.univer-shadow-lg{--univer-tw-shadow:0px 4px 6px 0px #1e284d0d, 0px 10px 15px -3px #1e284d1a;--univer-tw-shadow-colored:0px 4px 6px 0px var(--univer-tw-shadow-color), 0px 10px 15px -3px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 4px 6px #1e284d0d,0 10px 15px -3px #1e284d1a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-shadow-sm{--univer-tw-shadow:0px 1px 2px 0px #1e284d14;--univer-tw-shadow-colored:0px 1px 2px 0px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 2px #1e284d14;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000),var(--univer-tw-ring-shadow,0 0 #0000),var(--univer-tw-shadow)}.univer-transition-colors{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;transition-duration:.15s;transition-timing-function:cubic-bezier(.4,0,.2,1)}.disabled\\:univer-cursor-not-allowed:disabled{cursor:not-allowed}.disabled\\:univer-opacity-40:disabled{opacity:.4}.dark\\:\\!univer-border-gray-700:where(.univer-dark,.univer-dark *){border-color:var(--univer-gray-700)!important}.dark\\:\\!univer-bg-gray-700:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.dark\\:\\!univer-bg-gray-800:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-800)!important}.dark\\:\\!univer-text-gray-100:where(.univer-dark,.univer-dark *){color:var(--univer-gray-100)!important}.dark\\:\\!univer-text-primary-300:where(.univer-dark,.univer-dark *){color:var(--univer-primary-300)!important}.dark\\:hover\\:\\!univer-bg-gray-800:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-800)!important}.\\[\\&\\>div\\]\\:univer-grid>div{display:grid}.\\[\\&\\>div\\]\\:univer-gap-2>div{gap:.5rem}.univer-grid{display:grid}.univer-hidden{display:none}.univer-flex-col{flex-direction:column}.univer-border-t{border-top-width:1px}.univer-border-gray-200{border-color:var(--univer-gray-200)}.univer-py-2{padding-top:.5rem;padding-bottom:.5rem}.univer-pt-3{padding-top:.75rem}.univer-text-xs{font-size:.75rem;line-height:1rem}.univer-text-gray-400{color:var(--univer-gray-400)}.univer-text-gray-600{color:var(--univer-gray-600)}.dark\\:\\!univer-text-gray-200:where(.univer-dark,.univer-dark *){color:var(--univer-gray-200)!important}.univer-mb-1{margin-bottom:.25rem}.univer-ml-2{margin-left:.5rem}.univer-mr-2{margin-right:.5rem}.univer-box-border{box-sizing:border-box}.univer-flex{display:flex}.univer-size-5{width:1.25rem;height:1.25rem}.univer-size-6{width:1.5rem;height:1.5rem}.univer-h-6{height:1.5rem}.univer-w-\\[296px\\]{width:296px}.univer-w-full{width:100%}.univer-max-w-80{max-width:20rem}.univer-flex-1{flex:1}.univer-flex-none{flex:none}.univer-cursor-pointer{cursor:pointer}.univer-flex-row{flex-direction:row}.univer-items-center{align-items:center}.univer-justify-end{justify-content:flex-end}.univer-justify-center{justify-content:center}.univer-justify-between{justify-content:space-between}.univer-gap-2{gap:.5rem}.univer-overflow-hidden{overflow:hidden}.univer-truncate{text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.univer-rounded{border-radius:.25rem}.univer-rounded-lg{border-radius:.5rem}.univer-rounded-xl{border-radius:.75rem}.univer-bg-white{background-color:var(--univer-white)}.univer-p-3{padding:.75rem}.univer-p-4{padding:1rem}.univer-text-base{font-size:1rem;line-height:1.5rem}.univer-text-sm{font-size:.875rem;line-height:1.25rem}.univer-leading-5{line-height:1.25rem}.univer-text-gray-900{color:var(--univer-gray-900)}.univer-text-green-500{color:var(--univer-green-500)}.univer-text-primary-600{color:var(--univer-primary-600)}.univer-text-red-500{color:var(--univer-red-500)}.univer-shadow-md{--univer-tw-shadow:0px 1px 6px -2px #1e284d14, 0px 2px 6px -1px #1e284d1a;--univer-tw-shadow-colored:0px 1px 6px -2px var(--univer-tw-shadow-color), 0px 2px 6px -1px var(--univer-tw-shadow-color);box-shadow:0 0 #0000,0 0 #0000,0 1px 6px -2px #1e284d14,0 2px 6px -1px #1e284d1a;box-shadow:var(--univer-tw-ring-offset-shadow,0 0 #0000), var(--univer-tw-ring-shadow,0 0 #0000), var(--univer-tw-shadow)}.hover\\:univer-bg-gray-100:hover{background-color:var(--univer-gray-100)}.dark\\:\\!univer-bg-gray-900:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-900)!important}.dark\\:\\!univer-text-white:where(.univer-dark,.univer-dark *){color:var(--univer-white)!important}.dark\\:hover\\:\\!univer-bg-gray-700:hover:where(.univer-dark,.univer-dark *){background-color:var(--univer-gray-700)!important}.sheet-shell[data-v-a2ad8bc8]{letter-spacing:normal;flex-direction:column;height:760px;font-size:14px;line-height:normal;display:flex}.sheet-canvas[data-v-a2ad8bc8]{flex:1;min-height:0;position:relative}.sheet-editor[data-v-a2ad8bc8]{contain:layout style;letter-spacing:normal;width:100%;height:100%;font-size:14px;line-height:normal;position:absolute;inset:0;overflow:hidden}.sheet-statusbar[data-v-a2ad8bc8]{color:#8c8c8c;white-space:nowrap;background:#fafbfc;border-top:1px solid #f0f0f0;align-items:center;gap:8px;padding:8px 16px;font-size:12px;display:flex;overflow:hidden}.status-cell[data-v-a2ad8bc8]{color:#25b864;font-family:ui-monospace,Consolas,monospace;font-weight:600}.status-sep[data-v-a2ad8bc8]{color:#d9d9d9}.sheet-statusbar b[data-v-a2ad8bc8]{color:#595959;font-weight:600}.status-flex[data-v-a2ad8bc8]{flex:1}.status-hint[data-v-a2ad8bc8]{color:#bfbfbf}.status-readonly[data-v-a2ad8bc8]{color:#faad14}.status-tip[data-v-a2ad8bc8]{color:#bfbfbf}/*$vite$:1*/`)),document.head.appendChild(e)}}catch(e){console.error(`vite-plugin-css-injected-by-js`,e)}})();
|
|
2
2
|
(function(e,t){typeof exports==`object`&&typeof module<`u`?t(exports,require("vue")):typeof define==`function`&&define.amd?define([`exports`,`vue`],t):(e=typeof globalThis<`u`?globalThis:e||self,t(e.PdEditor={},e.Vue))})(this,function(e,t){Object.defineProperties(e,{__esModule:{value:!0},[Symbol.toStringTag]:{value:`Module`}});var n=Object.create,r=Object.defineProperty,i=Object.getOwnPropertyDescriptor,a=Object.getOwnPropertyNames,o=Object.getPrototypeOf,s=Object.prototype.hasOwnProperty,c=(e,t,n)=>()=>{if(n)throw n[0];try{return e&&(t=e(e=0)),t}catch(e){throw n=[e],e}},l=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),u=(e,t)=>{let n={};for(var i in e)r(n,i,{get:e[i],enumerable:!0});return t||r(n,Symbol.toStringTag,{value:`Module`}),n},d=(e,t,n,o)=>{if(t&&typeof t==`object`||typeof t==`function`)for(var c=a(t),l=0,u=c.length,d;l<u;l++)d=c[l],!s.call(e,d)&&d!==n&&r(e,d,{get:(e=>t[e]).bind(null,d),enumerable:!(o=i(t,d))||o.enumerable});return e},f=(e,t,i)=>(i=e==null?{}:n(o(e)),d(t||!e||!e.__esModule||!s.call(e,`default`)?r(i,`default`,{value:e,enumerable:!0}):i,e)),p=l(((e,t)=>{var n=function(e){if(e||={},this.Promise=e.Promise||Promise,this.queues=Object.create(null),this.domainReentrant=e.domainReentrant||!1,this.domainReentrant){if(typeof process>`u`||process.domain===void 0)throw Error("Domain-reentrant locks require `process.domain` to exist. Please flip `opts.domainReentrant = false`, use a NodeJS version that still implements Domain, or install a browser polyfill.");this.domains=Object.create(null)}this.timeout=e.timeout||n.DEFAULT_TIMEOUT,this.maxOccupationTime=e.maxOccupationTime||n.DEFAULT_MAX_OCCUPATION_TIME,this.maxExecutionTime=e.maxExecutionTime||n.DEFAULT_MAX_EXECUTION_TIME,this.maxPending=e.maxPending===1/0||Number.isInteger(e.maxPending)&&e.maxPending>=0?e.maxPending:n.DEFAULT_MAX_PENDING};n.DEFAULT_TIMEOUT=0,n.DEFAULT_MAX_OCCUPATION_TIME=0,n.DEFAULT_MAX_EXECUTION_TIME=0,n.DEFAULT_MAX_PENDING=1e3,n.prototype.acquire=function(e,t,n,r){if(Array.isArray(e))return this._acquireBatch(e,t,n,r);if(typeof t!=`function`)throw Error(`You must pass a function to execute`);var i=null,a=null,o=null;typeof n!=`function`&&(r=n,n=null,o=new this.Promise(function(e,t){i=e,a=t})),r||={};var s=!1,c=null,l=null,u=null,d=this,f=function(t,r,c){l&&=(clearTimeout(l),null),u&&=(clearTimeout(u),null),t&&(d.queues[e]&&d.queues[e].length===0&&delete d.queues[e],d.domainReentrant&&delete d.domains[e]),s||=(o?r?a(r):i(c):typeof n==`function`&&n(r,c),!0),t&&d.queues[e]&&d.queues[e].length>0&&d.queues[e].shift()()},p=function(n){if(s)return f(n);c&&=(clearTimeout(c),null),d.domainReentrant&&n&&(d.domains[e]=process.domain);var i=r.maxExecutionTime||d.maxExecutionTime;if(i&&(u=setTimeout(function(){d.queues[e]&&f(n,Error(`Maximum execution time is exceeded `+e))},i)),t.length===1){var a=!1;try{t(function(e,t){a||(a=!0,f(n,e,t))})}catch(e){a||(a=!0,f(n,e))}}else d._promiseTry(function(){return t()}).then(function(e){f(n,void 0,e)},function(e){f(n,e)})};d.domainReentrant&&process.domain&&(p=process.domain.bind(p));var m=r.maxPending||d.maxPending;if(!d.queues[e])d.queues[e]=[],p(!0);else if(d.domainReentrant&&process.domain&&process.domain===d.domains[e])p(!1);else if(d.queues[e].length>=m)f(!1,Error(`Too many pending tasks in queue `+e));else{var h=function(){p(!0)};r.skipQueue?d.queues[e].unshift(h):d.queues[e].push(h);var g=r.timeout||d.timeout;g&&(c=setTimeout(function(){c=null,f(!1,Error(`async-lock timed out in queue `+e))},g))}var _=r.maxOccupationTime||d.maxOccupationTime;if(_&&(l=setTimeout(function(){d.queues[e]&&f(!1,Error(`Maximum occupation time is exceeded in queue `+e))},_)),o)return o},n.prototype._acquireBatch=function(e,t,n,r){typeof n!=`function`&&(r=n,n=null);var i=this,a=function(e,t){return function(n){i.acquire(e,t,n,r)}},o=e.reduceRight(function(e,t){return a(t,e)},t);if(typeof n==`function`)o(n);else return new this.Promise(function(e,t){o.length===1?o(function(n,r){n?t(n):e(r)}):e(o())})},n.prototype.isBusy=function(e){return e?!!this.queues[e]:Object.keys(this.queues).length>0},n.prototype._promiseTry=function(e){try{return this.Promise.resolve(e())}catch(e){return this.Promise.reject(e)}},t.exports=n})),m=f(l(((e,t)=>{t.exports=p()}))()),h=Symbol(`$$IDENTIFIER_DECORATOR`);function g(e){return e&&e[h]===!0}function _(e){return typeof e==`function`}function v(e){return!!(e&&e.useClass!==void 0)}function y(e){return!!(e&&e.useFactory!==void 0)}function b(e){return!!(e&&e.useValue!==void 0)}function x(e){return!!(e&&e.useExisting!==void 0)}function S(e){return!!(e&&e.useAsync!==void 0)}var C=Symbol(`AsyncHook`);function w(e){return!!(e&&e.__symbol===C)}function T(e){return _(e)&&!e[h]?e.name:e.toString()}var E=class extends Error{constructor(e){super(`[redi]: ${e}`)}},D=function(e){return e.MANY=`many`,e.OPTIONAL=`optional`,e.REQUIRED=`required`,e}({}),O=function(e){return e.SELF=`self`,e.SKIP_SELF=`skipSelf`,e}({}),k=Symbol(`$$TARGET`),A=Symbol(`$$DEPENDENCIES`),ee=class extends E{constructor(e,t){let n=`Could not find dependency registered on the ${e} (indexed) parameter of the constructor of "${T(t)}".`;super(n)}},te=class extends E{constructor(e,t){let n=`It seems that you forgot to provide a parameter to @Required() on the ${t}th parameter of "${T(e)}"`;super(n)}},ne=class extends E{constructor(e,t){let n=`It seems that you register "undefined" as dependency on the ${t}th parameter of "${T(e)}". Please make sure that there is not cyclic dependency among your TypeScript files, or consider using "forwardRef". For more info please visit our website https://redi.wendell.fun/docs/faq#could-not-find-dependency-registered-on`;super(n)}};function re(e){return e[A]||[]}function ie(e,t){let n=re(e).find(e=>e.paramIndex===t);if(!n)throw new ee(t,e);return n}function ae(e,t,n,r=D.REQUIRED,i){let a={paramIndex:n,identifier:t,quantity:r,lookUp:i,withNew:!1};if(t===void 0)throw new ne(e,n);let o=e;o[k]===o?o[A].push(a):(o[A]=[a],o[k]=o)}var oe=new Set,se=new Map;function ce(e){if(oe.has(e))return console.error(`Identifier "${e}" already exists. Returning the cached identifier decorator.`),se.get(e);let t=function(e,n,r){ae(e,t,r)};return t.decoratorName=e,t.toString=()=>t.decoratorName,t[h]=!0,oe.add(e),se.set(e,t),t}function le(e,t,n){let r=ie(e,t);r.lookUp=n}function ue(e){return function t(){return this instanceof t?this:function(t,n,r){le(t,r,e)}}}var de=ue(O.SKIP_SELF),fe=ue(O.SELF);function pe(e){return e===D.OPTIONAL?`0 or 1`:`1`}var me=class extends E{constructor(e,t,n){let r=`Expect ${pe(t)} dependency item(s) for id "${T(e)}" but get ${n}.`;n===0&&(r+=` Did you forget to register it?`),n>1&&(r+=` You register it more than once.`),super(r),this.quantity=t,this.actual=n}};function he(e,t,n){if(t===D.OPTIONAL&&n>1||t===D.REQUIRED&&n!==1)throw new me(e,t,n)}function ge(e,t){return e===D.MANY?t:t[0]}function _e(e,t,n){let r=ie(e,t);r.quantity=n}function ve(e){return function t(n){return this instanceof t?this:function(t,r,i){if(n)ae(t,n,i,e);else{if(e===D.REQUIRED)throw new te(t,i);_e(t,i,e)}}}}var ye=ve(D.MANY),be=ve(D.OPTIONAL),j=ve(D.REQUIRED);function xe(e,t=0){return e?e.map((e,n)=>{if(n+=t,!Array.isArray(e))return{paramIndex:n,identifier:e,quantity:D.REQUIRED,withNew:!1};let r=e.slice(0,e.length-1),i=e[e.length-1],a,o=D.REQUIRED,s=!1;return r.forEach(e=>{e instanceof fe?a=O.SELF:e instanceof de?a=O.SKIP_SELF:e instanceof be?o=D.OPTIONAL:e instanceof ye?o=D.MANY:s=!0}),{paramIndex:n,identifier:i,quantity:o,lookUp:a,withNew:s}}):[]}function Se(e){return!!e&&typeof e.unwrap==`function`}function Ce(e){return Se(e)?e.unwrap():e}function we(e){return!!e&&typeof e.dispose==`function`}function Te(e){return e.length===1}var Ee=[];function De(e){Ee.push(e)}function Oe(){Ee.pop()}function ke(){Ee.length=0}var Ae=class extends E{constructor(e,t,n){let r=`Cannot find "${T(t)}" registered by any injector. It is the ${n}th param of "${g(e)?T(e):e.name}".`;super(r)}},je=class extends E{constructor(e){let t=`Cannot find "${T(e)}" registered by any injector. The stack of dependencies is: "${Ee.map(e=>T(e)).join(` -> `)}".`;super(t),ke()}},Me=class{dependencyMap=new Map;constructor(e){this.normalizeDependencies(e).map(e=>this.add(e[0],e[1]))}add(e,t){t===void 0&&(t={useClass:e,lazy:!1});let n=this.dependencyMap.get(e);n===void 0&&(n=[],this.dependencyMap.set(e,n)),n.push(t)}delete(e){this.dependencyMap.delete(e)}get(e,t){let n=this.dependencyMap.get(e);return he(e,t,n.length),ge(t,n)}has(e){return this.dependencyMap.has(e)}dispose(){this.dependencyMap.clear()}normalizeDependencies(e){return e.map(e=>{let t=e[0],n;return n=Te(e)?{useClass:e[0],lazy:!1}:e[1],[t,n]})}},Ne=class{resolvedDependencies=new Map;add(e,t){let n=this.resolvedDependencies.get(e);n===void 0&&(n=[],this.resolvedDependencies.set(e,n)),n.push(t)}has(e){return this.resolvedDependencies.has(e)}get(e,t){let n=this.resolvedDependencies.get(e);if(!n)throw new je(e);return he(e,t,n.length),t===D.MANY?n:n[0]}dispose(){Array.from(this.resolvedDependencies.values()).forEach(e=>{e.forEach(e=>we(e)?e.dispose():void 0)}),this.resolvedDependencies.clear()}},Pe;(function(){if(typeof requestIdleCallback<`u`&&typeof cancelIdleCallback<`u`)Pe=(e,t)=>{let n=requestIdleCallback(e,typeof t==`number`?{timeout:t}:void 0),r=!1;return()=>{r||(r=!0,cancelIdleCallback(n))}};else{let e=Object.freeze({didTimeout:!0,timeRemaining(){return 15}});Pe=t=>{let n=setTimeout(()=>t(e)),r=!1;return()=>{r||(r=!0,clearTimeout(n))}}}})();var Fe=class{executor;disposeIdleCallback;didRun=!1;value;error;constructor(e){this.executor=()=>{try{this.value=e()}catch(e){this.error=e}finally{this.didRun=!0}},this.disposeIdleCallback=Pe(()=>this.executor())}hasRun(){return this.didRun}dispose(){this.disposeIdleCallback()}getValue(){if(this.didRun||(this.disposeIdleCallback(),this.executor()),this.error)throw this.error;return this.value}},Ie=300,Le=Symbol(`$$NOT_INSTANTIATED_SYMBOL`),Re=class extends E{constructor(e){super(`Detecting cyclic dependency. The last identifier is "${T(e)}".`)}},ze=class extends E{constructor(){super(`Injector cannot be accessed after it was disposed.`)}},Be=class extends E{constructor(e){super(`Async item "${T(e)}" returns another async item.`)}},Ve=class extends E{constructor(e){super(`Cannot get async item "${T(e)}" from sync api.`)}},He=class extends E{constructor(e){super(`Cannot add dependency "${T(e)}" after it is already resolved.`)}},Ue=class extends E{constructor(e){super(`Cannot delete dependency "${T(e)}" when it is already resolved.`)}},We=class e{dependencyCollection;resolvedDependencyCollection;children=[];resolutionOngoing=0;disposingCallbacks=new Set;disposed=!1;constructor(e,t=null){this.parent=t,this.dependencyCollection=new Me(e||[]),this.resolvedDependencyCollection=new Ne,t&&t.children.push(this)}onDispose(e){return this.disposingCallbacks.add(e),{dispose:()=>this.disposingCallbacks.delete(e)}}createChild(t){return this._ensureInjectorNotDisposed(),new e(t,this)}dispose(){this.children.forEach(e=>e.dispose()),this.children.length=0,this.dependencyCollection.dispose(),this.resolvedDependencyCollection.dispose(),this.deleteSelfFromParent(),this.disposed=!0,this.disposingCallbacks.forEach(e=>e()),this.disposingCallbacks.clear()}deleteSelfFromParent(){if(this.parent){let e=this.parent.children.indexOf(this);this.parent.children.splice(e,1)}}add(e){this._ensureInjectorNotDisposed();let t=e[0],n=e[1];if(this.resolvedDependencyCollection.has(t))throw new He(t);n===void 0?this.dependencyCollection.add(t):S(n)||v(n)||b(n)||y(n)?this.dependencyCollection.add(t,n):this.resolvedDependencyCollection.add(t,n)}replace(e){this._ensureInjectorNotDisposed();let t=e[0];if(this.resolvedDependencyCollection.has(t))throw new He(t);this.dependencyCollection.delete(t),this.dependencyCollection.add(t,e[1])}delete(e){if(this._ensureInjectorNotDisposed(),this.resolvedDependencyCollection.has(e))throw new Ue(e);this.dependencyCollection.delete(e)}invoke(e,...t){return this._ensureInjectorNotDisposed(),e({get:(e,t,n)=>this._get(e,t,n),has:e=>this.has(e)},...t)}has(e){return this.dependencyCollection.has(e)||this.parent?.has(e)||!1}get(e,t,n){this._ensureInjectorNotDisposed();let r=this._get(e,t,n);if(Array.isArray(r)&&r.some(e=>w(e))||w(r))throw new Ve(e);return r}_get(e,t,n,r){let i=D.REQUIRED;if(t===D.REQUIRED||t===D.OPTIONAL||t===D.MANY?i=t:n=t,!r){let t=this.getValue(e,i,n);if(t!==Le)return t}let a=!r;return this.createDependency(e,i,n,a)}getAsync(e){this._ensureInjectorNotDisposed();let t=this.getValue(e,D.REQUIRED);if(t!==Le)return Promise.resolve(t);let n=this.createDependency(e,D.REQUIRED);return w(n)?n.whenReady():Promise.resolve(n)}createInstance(e,...t){return this._ensureInjectorNotDisposed(),this._resolveClassImpl({useClass:e},...t)}_resolveDependency(e,t,n=!0){let r;De(e);try{r=b(t)?this._resolveValueDependency(e,t):y(t)?this._resolveFactory(e,t,n):v(t)?this._resolveClass(e,t,n):x(t)?this._resolveExisting(e,t):this._resolveAsync(e,t),Oe()}catch(e){throw Oe(),e}return r}_resolveExisting(e,t){let n=this.get(t.useExisting);return this.resolvedDependencyCollection.add(e,n),n}_resolveValueDependency(e,t){let n=t.useValue;return this.resolvedDependencyCollection.add(e,n),n}_resolveClass(e,t,n){let r;if(t.lazy){let e=new Fe(()=>(this._ensureInjectorNotDisposed(),this._resolveClassImpl(t)));r=new Proxy(Object.create(null),{get(t,n){if(n in t)return t[n];let r=e.getValue(),i=r[n];return typeof i==`function`?(i=i.bind(r),t[n]=i,i):i},set(t,n,r){return e.getValue()[n]=r,!0}})}else r=this._resolveClassImpl(t);return e&&n&&this.resolvedDependencyCollection.add(e,r),r}_resolveClassImpl(e,...t){let n=e.useClass;this.markNewResolution(n);let r=re(n).sort((e,t)=>e.paramIndex-t.paramIndex).map(e=>({...e,identifier:Ce(e.identifier)})),i=[];for(let e of r)try{let t=this._get(e.identifier,e.quantity,e.lookUp,e.withNew);i.push(t)}catch(t){throw t instanceof je||t instanceof me&&t.actual===0?new Ae(n,e.identifier,e.paramIndex):t}let a=[...t],o=r.length>0?r[0].paramIndex:a.length;if(a.length!==o){console.warn(`[redi]: Expect ${o} custom parameter(s) of ${T(n)} but get ${a.length}.`);let e=o-a.length;a=e>0?[...a,...Array.from({length:e}).fill(void 0)]:a.slice(0,o)}let s=new n(...a,...i);return e?.onInstantiation?.(s),this.markResolutionCompleted(),s}_resolveFactory(e,t,n){this.markNewResolution(e);let r=xe(t.deps),i=[];for(let t of r)try{let e=this._get(t.identifier,t.quantity,t.lookUp,t.withNew);i.push(e)}catch(n){throw n instanceof je||n instanceof me&&n.actual===0?new Ae(e,t.identifier,t.paramIndex):n}let a=t.useFactory.apply(null,i);return n&&this.resolvedDependencyCollection.add(e,a),this.markResolutionCompleted(),t?.onInstantiation?.(a),a}_resolveAsync(e,t){return{__symbol:C,whenReady:()=>this._resolveAsyncImpl(e,t)}}_resolveAsyncImpl(e,t){return t.useAsync().then(n=>{let r=this.getValue(e);if(r!==Le)return r;let i;if(Array.isArray(n)){let t=n[1];if(S(t))throw new Be(e);i=this._resolveDependency(e,t)}else i=_(n)?this._resolveClassImpl({useClass:n,onInstantiation:t.onInstantiation}):n;return this.resolvedDependencyCollection.add(e,i),i})}getValue(t,n=D.REQUIRED,r){let i=()=>this.dependencyCollection.has(t)&&!this.resolvedDependencyCollection.has(t)?Le:this.resolvedDependencyCollection.get(t,n),a=()=>{if(this.parent)return this.parent.getValue(t,n);if(n===D.OPTIONAL)return null;if(n===D.MANY)return[];throw new me(t,D.REQUIRED,0)};return r===O.SKIP_SELF?a():t===e?this:r===O.SELF||this.resolvedDependencyCollection.has(t)||this.dependencyCollection.has(t)?i():a()}createDependency(e,t,n,r=!0){let i=()=>{let n=this.dependencyCollection.get(e,t),i=null;return i=Array.isArray(n)?n.map(t=>this._resolveDependency(e,t,r)):this._resolveDependency(e,n,r),i},a=()=>{if(this.parent)return this.parent.createDependency(e,t,void 0,r);if(t===D.OPTIONAL)return null;if(t===D.MANY)return[];throw De(e),new je(e)};return n===O.SKIP_SELF?a():this.dependencyCollection.has(e)?i():a()}markNewResolution(e){if(this.resolutionOngoing+=1,this.resolutionOngoing>=Ie)throw new Re(e)}markResolutionCompleted(){--this.resolutionOngoing}_ensureInjectorNotDisposed(){if(this.disposed)throw new ze}},Ge=typeof globalThis<`u`&&globalThis||typeof window<`u`&&window||typeof global<`u`&&global,Ke=`REDI_GLOBAL_LOCK`,qe=typeof process<`u`&&process.versions!=null&&process.versions.node!=null;Ge[Ke]?qe||console.error(`[redi]: You are loading scripts of redi more than once! This may cause undesired behavior in your application.
|
|
3
3
|
Maybe your dependencies added redi as its dependency and bundled redi to its dist files. Or you import different versions of redi.
|
|
4
4
|
For more info please visit our website: https://redi.wendell.fun/en-US/docs/faq#import-scripts-of-redi-more-than-once`):Ge[Ke]=!0;var Je=typeof global==`object`&&global&&global.Object===Object&&global,Ye=typeof self==`object`&&self&&self.Object===Object&&self,Xe=Je||Ye||Function(`return this`)(),Ze=Xe.Symbol,Qe=Object.prototype,$e=Qe.hasOwnProperty,et=Qe.toString,tt=Ze?Ze.toStringTag:void 0;function nt(e){var t=$e.call(e,tt),n=e[tt];try{e[tt]=void 0;var r=!0}catch{}var i=et.call(e);return r&&(t?e[tt]=n:delete e[tt]),i}var rt=Object.prototype.toString;function it(e){return rt.call(e)}var at=`[object Null]`,ot=`[object Undefined]`,st=Ze?Ze.toStringTag:void 0;function ct(e){return e==null?e===void 0?ot:at:st&&st in Object(e)?nt(e):it(e)}function lt(e){return typeof e==`object`&&!!e}var ut=`[object Symbol]`;function dt(e){return typeof e==`symbol`||lt(e)&&ct(e)==ut}function ft(e,t){for(var n=-1,r=e==null?0:e.length,i=Array(r);++n<r;)i[n]=t(e[n],n,e);return i}var pt=Array.isArray,mt=1/0,ht=Ze?Ze.prototype:void 0,gt=ht?ht.toString:void 0;function _t(e){if(typeof e==`string`)return e;if(pt(e))return ft(e,_t)+``;if(dt(e))return gt?gt.call(e):``;var t=e+``;return t==`0`&&1/e==-mt?`-0`:t}var vt=/\s/;function yt(e){for(var t=e.length;t--&&vt.test(e.charAt(t)););return t}var bt=/^\s+/;function xt(e){return e&&e.slice(0,yt(e)+1).replace(bt,``)}function St(e){var t=typeof e;return e!=null&&(t==`object`||t==`function`)}var Ct=NaN,wt=/^[-+]0x[0-9a-f]+$/i,Tt=/^0b[01]+$/i,Et=/^0o[0-7]+$/i,Dt=parseInt;function Ot(e){if(typeof e==`number`)return e;if(dt(e))return Ct;if(St(e)){var t=typeof e.valueOf==`function`?e.valueOf():e;e=St(t)?t+``:t}if(typeof e!=`string`)return e===0?e:+e;e=xt(e);var n=Tt.test(e);return n||Et.test(e)?Dt(e.slice(2),n?2:8):wt.test(e)?Ct:+e}function kt(e){return e}var At=`[object AsyncFunction]`,jt=`[object Function]`,Mt=`[object GeneratorFunction]`,Nt=`[object Proxy]`;function Pt(e){if(!St(e))return!1;var t=ct(e);return t==jt||t==Mt||t==At||t==Nt}var Ft=Xe[`__core-js_shared__`],It=function(){var e=/[^.]+$/.exec(Ft&&Ft.keys&&Ft.keys.IE_PROTO||``);return e?`Symbol(src)_1.`+e:``}();function Lt(e){return!!It&&It in e}var Rt=Function.prototype.toString;function zt(e){if(e!=null){try{return Rt.call(e)}catch{}try{return e+``}catch{}}return``}var Bt=/[\\^$.*+?()[\]{}|]/g,Vt=/^\[object .+?Constructor\]$/,Ht=Function.prototype,Ut=Object.prototype,Wt=Ht.toString,Gt=Ut.hasOwnProperty,Kt=RegExp(`^`+Wt.call(Gt).replace(Bt,`\\$&`).replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,`$1.*?`)+`$`);function qt(e){return!St(e)||Lt(e)?!1:(Pt(e)?Kt:Vt).test(zt(e))}function Jt(e,t){return e?.[t]}function Yt(e,t){var n=Jt(e,t);return qt(n)?n:void 0}var Xt=Object.create,Zt=function(){function e(){}return function(t){if(!St(t))return{};if(Xt)return Xt(t);e.prototype=t;var n=new e;return e.prototype=void 0,n}}();function Qt(e,t,n){switch(n.length){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function $t(e,t){var n=-1,r=e.length;for(t||=Array(r);++n<r;)t[n]=e[n];return t}var en=800,tn=16,nn=Date.now;function rn(e){var t=0,n=0;return function(){var r=nn(),i=tn-(r-n);if(n=r,i>0){if(++t>=en)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}function an(e){return function(){return e}}var on=function(){try{var e=Yt(Object,`defineProperty`);return e({},``,{}),e}catch{}}(),sn=rn(on?function(e,t){return on(e,`toString`,{configurable:!0,enumerable:!1,value:an(t),writable:!0})}:kt),cn=9007199254740991,ln=/^(?:0|[1-9]\d*)$/;function un(e,t){var n=typeof e;return t??=cn,!!t&&(n==`number`||n!=`symbol`&&ln.test(e))&&e>-1&&e%1==0&&e<t}function dn(e,t,n){t==`__proto__`&&on?on(e,t,{configurable:!0,enumerable:!0,value:n,writable:!0}):e[t]=n}function fn(e,t){return e===t||e!==e&&t!==t}var pn=Object.prototype.hasOwnProperty;function mn(e,t,n){var r=e[t];(!(pn.call(e,t)&&fn(r,n))||n===void 0&&!(t in e))&&dn(e,t,n)}function hn(e,t,n,r){var i=!n;n||={};for(var a=-1,o=t.length;++a<o;){var s=t[a],c=r?r(n[s],e[s],s,n,e):void 0;c===void 0&&(c=e[s]),i?dn(n,s,c):mn(n,s,c)}return n}var gn=Math.max;function _n(e,t,n){return t=gn(t===void 0?e.length-1:t,0),function(){for(var r=arguments,i=-1,a=gn(r.length-t,0),o=Array(a);++i<a;)o[i]=r[t+i];i=-1;for(var s=Array(t+1);++i<t;)s[i]=r[i];return s[t]=n(o),Qt(e,this,s)}}function vn(e,t){return sn(_n(e,t,kt),e+``)}var yn=9007199254740991;function bn(e){return typeof e==`number`&&e>-1&&e%1==0&&e<=yn}function xn(e){return e!=null&&bn(e.length)&&!Pt(e)}function Sn(e,t,n){if(!St(n))return!1;var r=typeof t;return(r==`number`?xn(n)&&un(t,n.length):r==`string`&&t in n)?fn(n[t],e):!1}function Cn(e){return vn(function(t,n){var r=-1,i=n.length,a=i>1?n[i-1]:void 0,o=i>2?n[2]:void 0;for(a=e.length>3&&typeof a==`function`?(i--,a):void 0,o&&Sn(n[0],n[1],o)&&(a=i<3?void 0:a,i=1),t=Object(t);++r<i;){var s=n[r];s&&e(t,s,r,a)}return t})}var wn=Object.prototype;function Tn(e){var t=e&&e.constructor;return e===(typeof t==`function`&&t.prototype||wn)}function En(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r}var Dn=`[object Arguments]`;function On(e){return lt(e)&&ct(e)==Dn}var kn=Object.prototype,An=kn.hasOwnProperty,jn=kn.propertyIsEnumerable,Mn=On(function(){return arguments}())?On:function(e){return lt(e)&&An.call(e,`callee`)&&!jn.call(e,`callee`)};function Nn(){return!1}var Pn=typeof e==`object`&&e&&!e.nodeType&&e,Fn=Pn&&typeof module==`object`&&module&&!module.nodeType&&module,In=Fn&&Fn.exports===Pn?Xe.Buffer:void 0,Ln=(In?In.isBuffer:void 0)||Nn,Rn=`[object Arguments]`,zn=`[object Array]`,Bn=`[object Boolean]`,Vn=`[object Date]`,Hn=`[object Error]`,Un=`[object Function]`,Wn=`[object Map]`,Gn=`[object Number]`,Kn=`[object Object]`,qn=`[object RegExp]`,Jn=`[object Set]`,Yn=`[object String]`,Xn=`[object WeakMap]`,Zn=`[object ArrayBuffer]`,Qn=`[object DataView]`,$n=`[object Float32Array]`,er=`[object Float64Array]`,tr=`[object Int8Array]`,nr=`[object Int16Array]`,rr=`[object Int32Array]`,ir=`[object Uint8Array]`,ar=`[object Uint8ClampedArray]`,or=`[object Uint16Array]`,sr=`[object Uint32Array]`,cr={};cr[$n]=cr[er]=cr[tr]=cr[nr]=cr[rr]=cr[ir]=cr[ar]=cr[or]=cr[sr]=!0,cr[Rn]=cr[zn]=cr[Zn]=cr[Bn]=cr[Qn]=cr[Vn]=cr[Hn]=cr[Un]=cr[Wn]=cr[Gn]=cr[Kn]=cr[qn]=cr[Jn]=cr[Yn]=cr[Xn]=!1;function lr(e){return lt(e)&&bn(e.length)&&!!cr[ct(e)]}function ur(e){return function(t){return e(t)}}var dr=typeof e==`object`&&e&&!e.nodeType&&e,fr=dr&&typeof module==`object`&&module&&!module.nodeType&&module,pr=fr&&fr.exports===dr&&Je.process,mr=function(){try{return fr&&fr.require&&fr.require(`util`).types||pr&&pr.binding&&pr.binding(`util`)}catch{}}(),hr=mr&&mr.isTypedArray,gr=hr?ur(hr):lr,_r=Object.prototype.hasOwnProperty;function vr(e,t){var n=pt(e),r=!n&&Mn(e),i=!n&&!r&&Ln(e),a=!n&&!r&&!i&&gr(e),o=n||r||i||a,s=o?En(e.length,String):[],c=s.length;for(var l in e)(t||_r.call(e,l))&&!(o&&(l==`length`||i&&(l==`offset`||l==`parent`)||a&&(l==`buffer`||l==`byteLength`||l==`byteOffset`)||un(l,c)))&&s.push(l);return s}function yr(e,t){return function(n){return e(t(n))}}function br(e){var t=[];if(e!=null)for(var n in Object(e))t.push(n);return t}var xr=Object.prototype.hasOwnProperty;function Sr(e){if(!St(e))return br(e);var t=Tn(e),n=[];for(var r in e)(r!=`constructor`||!t&&xr.call(e,r))&&n.push(r);return n}function Cr(e){return xn(e)?vr(e,!0):Sr(e)}var wr=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Tr=/^\w*$/;function Er(e,t){if(pt(e))return!1;var n=typeof e;return n==`number`||n==`symbol`||n==`boolean`||e==null||dt(e)?!0:Tr.test(e)||!wr.test(e)||t!=null&&e in Object(t)}var Dr=Yt(Object,`create`);function Or(){this.__data__=Dr?Dr(null):{},this.size=0}function kr(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=+!!t,t}var Ar=`__lodash_hash_undefined__`,jr=Object.prototype.hasOwnProperty;function Mr(e){var t=this.__data__;if(Dr){var n=t[e];return n===Ar?void 0:n}return jr.call(t,e)?t[e]:void 0}var Nr=Object.prototype.hasOwnProperty;function Pr(e){var t=this.__data__;return Dr?t[e]!==void 0:Nr.call(t,e)}var Fr=`__lodash_hash_undefined__`;function Ir(e,t){var n=this.__data__;return this.size+=+!this.has(e),n[e]=Dr&&t===void 0?Fr:t,this}function Lr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Lr.prototype.clear=Or,Lr.prototype.delete=kr,Lr.prototype.get=Mr,Lr.prototype.has=Pr,Lr.prototype.set=Ir;function Rr(){this.__data__=[],this.size=0}function zr(e,t){for(var n=e.length;n--;)if(fn(e[n][0],t))return n;return-1}var Br=Array.prototype.splice;function Vr(e){var t=this.__data__,n=zr(t,e);return n<0?!1:(n==t.length-1?t.pop():Br.call(t,n,1),--this.size,!0)}function Hr(e){var t=this.__data__,n=zr(t,e);return n<0?void 0:t[n][1]}function Ur(e){return zr(this.__data__,e)>-1}function Wr(e,t){var n=this.__data__,r=zr(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this}function Gr(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}Gr.prototype.clear=Rr,Gr.prototype.delete=Vr,Gr.prototype.get=Hr,Gr.prototype.has=Ur,Gr.prototype.set=Wr;var Kr=Yt(Xe,`Map`);function qr(){this.size=0,this.__data__={hash:new Lr,map:new(Kr||Gr),string:new Lr}}function Jr(e){var t=typeof e;return t==`string`||t==`number`||t==`symbol`||t==`boolean`?e!==`__proto__`:e===null}function Yr(e,t){var n=e.__data__;return Jr(t)?n[typeof t==`string`?`string`:`hash`]:n.map}function Xr(e){var t=Yr(this,e).delete(e);return this.size-=+!!t,t}function Zr(e){return Yr(this,e).get(e)}function Qr(e){return Yr(this,e).has(e)}function $r(e,t){var n=Yr(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this}function ei(e){var t=-1,n=e==null?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}ei.prototype.clear=qr,ei.prototype.delete=Xr,ei.prototype.get=Zr,ei.prototype.has=Qr,ei.prototype.set=$r;var ti=`Expected a function`;function ni(e,t){if(typeof e!=`function`||t!=null&&typeof t!=`function`)throw TypeError(ti);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],a=n.cache;if(a.has(i))return a.get(i);var o=e.apply(this,r);return n.cache=a.set(i,o)||a,o};return n.cache=new(ni.Cache||ei),n}ni.Cache=ei;var ri=500;function ii(e){var t=ni(e,function(e){return n.size===ri&&n.clear(),e}),n=t.cache;return t}var ai=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,oi=/\\(\\)?/g,si=ii(function(e){var t=[];return e.charCodeAt(0)===46&&t.push(``),e.replace(ai,function(e,n,r,i){t.push(r?i.replace(oi,`$1`):n||e)}),t});function ci(e){return e==null?``:_t(e)}function li(e,t){return pt(e)?e:Er(e,t)?[e]:si(ci(e))}var ui=1/0;function di(e){if(typeof e==`string`||dt(e))return e;var t=e+``;return t==`0`&&1/e==-ui?`-0`:t}function fi(e,t){t=li(t,e);for(var n=0,r=t.length;e!=null&&n<r;)e=e[di(t[n++])];return n&&n==r?e:void 0}function pi(e,t,n){var r=e==null?void 0:fi(e,t);return r===void 0?n:r}var mi=yr(Object.getPrototypeOf,Object),hi=`[object Object]`,gi=Function.prototype,_i=Object.prototype,vi=gi.toString,yi=_i.hasOwnProperty,bi=vi.call(Object);function xi(e){if(!lt(e)||ct(e)!=hi)return!1;var t=mi(e);if(t===null)return!0;var n=yi.call(t,`constructor`)&&t.constructor;return typeof n==`function`&&n instanceof n&&vi.call(n)==bi}function Si(){this.__data__=new Gr,this.size=0}function Ci(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n}function wi(e){return this.__data__.get(e)}function Ti(e){return this.__data__.has(e)}var Ei=200;function Di(e,t){var n=this.__data__;if(n instanceof Gr){var r=n.__data__;if(!Kr||r.length<Ei-1)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new ei(r)}return n.set(e,t),this.size=n.size,this}function Oi(e){var t=this.__data__=new Gr(e);this.size=t.size}Oi.prototype.clear=Si,Oi.prototype.delete=Ci,Oi.prototype.get=wi,Oi.prototype.has=Ti,Oi.prototype.set=Di;var ki=typeof e==`object`&&e&&!e.nodeType&&e,Ai=ki&&typeof module==`object`&&module&&!module.nodeType&&module,ji=Ai&&Ai.exports===ki?Xe.Buffer:void 0,Mi=ji?ji.allocUnsafe:void 0;function Ni(e,t){if(t)return e.slice();var n=e.length,r=Mi?Mi(n):new e.constructor(n);return e.copy(r),r}var Pi=Xe.Uint8Array;function Fi(e){var t=new e.constructor(e.byteLength);return new Pi(t).set(new Pi(e)),t}function Ii(e,t){var n=t?Fi(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Li(e){return typeof e.constructor==`function`&&!Tn(e)?Zt(mi(e)):{}}function Ri(e){return function(t,n,r){for(var i=-1,a=Object(t),o=r(t),s=o.length;s--;){var c=o[e?s:++i];if(n(a[c],c,a)===!1)break}return t}}var zi=Ri(),Bi=function(){return Xe.Date.now()},Vi=`Expected a function`,Hi=Math.max,Ui=Math.min;function Wi(e,t,n){var r,i,a,o,s,c,l=0,u=!1,d=!1,f=!0;if(typeof e!=`function`)throw TypeError(Vi);t=Ot(t)||0,St(n)&&(u=!!n.leading,d=`maxWait`in n,a=d?Hi(Ot(n.maxWait)||0,t):a,f=`trailing`in n?!!n.trailing:f);function p(t){var n=r,a=i;return r=i=void 0,l=t,o=e.apply(a,n),o}function m(e){return l=e,s=setTimeout(_,t),u?p(e):o}function h(e){var n=e-c,r=e-l,i=t-n;return d?Ui(i,a-r):i}function g(e){var n=e-c,r=e-l;return c===void 0||n>=t||n<0||d&&r>=a}function _(){var e=Bi();if(g(e))return v(e);s=setTimeout(_,h(e))}function v(e){return s=void 0,f&&r?p(e):(r=i=void 0,o)}function y(){s!==void 0&&clearTimeout(s),l=0,r=c=i=s=void 0}function b(){return s===void 0?o:v(Bi())}function x(){var e=Bi(),n=g(e);if(r=arguments,i=this,c=e,n){if(s===void 0)return m(c);if(d)return clearTimeout(s),s=setTimeout(_,t),p(c)}return s===void 0&&(s=setTimeout(_,t)),o}return x.cancel=y,x.flush=b,x}function Gi(e,t,n){(n!==void 0&&!fn(e[t],n)||n===void 0&&!(t in e))&&dn(e,t,n)}function Ki(e){return lt(e)&&xn(e)}function qi(e,t){if((t!==`constructor`||typeof e[t]!=`function`)&&t!=`__proto__`)return e[t]}function Ji(e){return hn(e,Cr(e))}function Yi(e,t,n,r,i,a,o){var s=qi(e,n),c=qi(t,n),l=o.get(c);if(l){Gi(e,n,l);return}var u=a?a(s,c,n+``,e,t,o):void 0,d=u===void 0;if(d){var f=pt(c),p=!f&&Ln(c),m=!f&&!p&&gr(c);u=c,f||p||m?pt(s)?u=s:Ki(s)?u=$t(s):p?(d=!1,u=Ni(c,!0)):m?(d=!1,u=Ii(c,!0)):u=[]:xi(c)||Mn(c)?(u=s,Mn(s)?u=Ji(s):(!St(s)||Pt(s))&&(u=Li(c))):d=!1}d&&(o.set(c,u),i(u,c,r,a,o),o.delete(c)),Gi(e,n,u)}function Xi(e,t,n,r,i){e!==t&&zi(t,function(a,o){if(i||=new Oi,St(a))Yi(e,t,o,n,Xi,r,i);else{var s=r?r(qi(e,o),a,o+``,e,t,i):void 0;s===void 0&&(s=a),Gi(e,o,s)}},Cr)}var Zi=Cn(function(e,t,n,r){Xi(e,t,n,r)}),Qi=Cn(function(e,t,n){Xi(e,t,n)});function $i(e,t,n,r){if(!St(e))return e;t=li(t,e);for(var i=-1,a=t.length,o=a-1,s=e;s!=null&&++i<a;){var c=di(t[i]),l=n;if(c===`__proto__`||c===`constructor`||c===`prototype`)return e;if(i!=o){var u=s[c];l=r?r(u,c,s):void 0,l===void 0&&(l=St(u)?u:un(t[i+1])?[]:{})}mn(s,c,l),s=s[c]}return e}function ea(e,t,n){return e==null?e:$i(e,t,n)}var M=function(e){return e[e.UNIVER_UNKNOWN=0]=`UNIVER_UNKNOWN`,e[e.UNIVER_DOC=1]=`UNIVER_DOC`,e[e.UNIVER_SHEET=2]=`UNIVER_SHEET`,e[e.UNIVER_SLIDE=3]=`UNIVER_SLIDE`,e[e.UNIVER_PROJECT=4]=`UNIVER_PROJECT`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({}),ta=function(e){return e[e.View=0]=`View`,e[e.Edit=1]=`Edit`,e[e.ManageCollaborator=2]=`ManageCollaborator`,e[e.Print=3]=`Print`,e[e.Duplicate=4]=`Duplicate`,e[e.Comment=5]=`Comment`,e[e.Copy=6]=`Copy`,e[e.Share=7]=`Share`,e[e.Export=8]=`Export`,e[e.MoveWorksheet=9]=`MoveWorksheet`,e[e.DeleteWorksheet=10]=`DeleteWorksheet`,e[e.HideWorksheet=11]=`HideWorksheet`,e[e.RenameWorksheet=12]=`RenameWorksheet`,e[e.CreateWorksheet=13]=`CreateWorksheet`,e[e.SetWorksheetStyle=14]=`SetWorksheetStyle`,e[e.EditWorksheetCell=15]=`EditWorksheetCell`,e[e.InsertHyperlink=16]=`InsertHyperlink`,e[e.Sort=17]=`Sort`,e[e.Filter=18]=`Filter`,e[e.PivotTable=19]=`PivotTable`,e[e.FloatImg=20]=`FloatImg`,e[e.IHistory=21]=`IHistory`,e[e.RwHgtClWdt=22]=`RwHgtClWdt`,e[e.ViemRwHgtClWdt=23]=`ViemRwHgtClWdt`,e[e.ViewFilter=24]=`ViewFilter`,e[e.MoveSheet=25]=`MoveSheet`,e[e.DeleteSheet=26]=`DeleteSheet`,e[e.HideSheet=27]=`HideSheet`,e[e.CopySheet=28]=`CopySheet`,e[e.RenameSheet=29]=`RenameSheet`,e[e.CreateSheet=30]=`CreateSheet`,e[e.SelectProtectedCells=31]=`SelectProtectedCells`,e[e.SelectUnProtectedCells=32]=`SelectUnProtectedCells`,e[e.SetCellStyle=33]=`SetCellStyle`,e[e.SetCellValue=34]=`SetCellValue`,e[e.SetRowStyle=35]=`SetRowStyle`,e[e.SetColumnStyle=36]=`SetColumnStyle`,e[e.InsertRow=37]=`InsertRow`,e[e.InsertColumn=38]=`InsertColumn`,e[e.DeleteRow=39]=`DeleteRow`,e[e.DeleteColumn=40]=`DeleteColumn`,e[e.EditExtraObject=41]=`EditExtraObject`,e[e.Delete=42]=`Delete`,e[e.RecoverHistory=43]=`RecoverHistory`,e[e.ViewHistory=44]=`ViewHistory`,e[e.CreatePermissionObject=45]=`CreatePermissionObject`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({}),na=function(e){return e[e.Reader=0]=`Reader`,e[e.Editor=1]=`Editor`,e[e.Owner=2]=`Owner`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({}),ra=function(e){return e[e.Unkonwn=0]=`Unkonwn`,e[e.Workbook=1]=`Workbook`,e[e.Worksheet=2]=`Worksheet`,e[e.SelectRange=3]=`SelectRange`,e[e.Document=4]=`Document`,e[e.Slide=5]=`Slide`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({}),ia=function(e){return e[e.SomeCollaborator=0]=`SomeCollaborator`,e[e.AllCollaborator=1]=`AllCollaborator`,e[e.OneSelf=2]=`OneSelf`,e[e.UNRECOGNIZED=-1]=`UNRECOGNIZED`,e}({}),aa=function(e,t){return aa=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])},aa(e,t)};function oa(e,t){if(typeof t!=`function`&&t!==null)throw TypeError(`Class extends value `+String(t)+` is not a constructor or null`);aa(e,t);function n(){this.constructor=e}e.prototype=t===null?Object.create(t):(n.prototype=t.prototype,new n)}var sa=function(){return sa=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var i in t=arguments[n],t)Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},sa.apply(this,arguments)};function ca(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols==`function`)for(var i=0,r=Object.getOwnPropertySymbols(e);i<r.length;i++)t.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(e,r[i])&&(n[r[i]]=e[r[i]]);return n}function la(e,t,n,r){function i(e){return e instanceof n?e:new n(function(t){t(e)})}return new(n||=Promise)(function(n,a){function o(e){try{c(r.next(e))}catch(e){a(e)}}function s(e){try{c(r.throw(e))}catch(e){a(e)}}function c(e){e.done?n(e.value):i(e.value).then(o,s)}c((r=r.apply(e,t||[])).next())})}function ua(e,t){var n={label:0,sent:function(){if(a[0]&1)throw a[1];return a[1]},trys:[],ops:[]},r,i,a,o=Object.create((typeof Iterator==`function`?Iterator:Object).prototype);return o.next=s(0),o.throw=s(1),o.return=s(2),typeof Symbol==`function`&&(o[Symbol.iterator]=function(){return this}),o;function s(e){return function(t){return c([e,t])}}function c(s){if(r)throw TypeError(`Generator is already executing.`);for(;o&&(o=0,s[0]&&(n=0)),n;)try{if(r=1,i&&(a=s[0]&2?i.return:s[0]?i.throw||((a=i.return)&&a.call(i),0):i.next)&&!(a=a.call(i,s[1])).done)return a;switch(i=0,a&&(s=[s[0]&2,a.value]),s[0]){case 0:case 1:a=s;break;case 4:return n.label++,{value:s[1],done:!1};case 5:n.label++,i=s[1],s=[0];continue;case 7:s=n.ops.pop(),n.trys.pop();continue;default:if(a=n.trys,!(a=a.length>0&&a[a.length-1])&&(s[0]===6||s[0]===2)){n=0;continue}if(s[0]===3&&(!a||s[1]>a[0]&&s[1]<a[3])){n.label=s[1];break}if(s[0]===6&&n.label<a[1]){n.label=a[1],a=s;break}if(a&&n.label<a[2]){n.label=a[2],n.ops.push(s);break}a[2]&&n.ops.pop(),n.trys.pop();continue}s=t.call(e,n)}catch(e){s=[6,e],i=0}finally{r=a=0}if(s[0]&5)throw s[1];return{value:s[0]?s[1]:void 0,done:!0}}}function da(e){var t=typeof Symbol==`function`&&Symbol.iterator,n=t&&e[t],r=0;if(n)return n.call(e);if(e&&typeof e.length==`number`)return{next:function(){return e&&r>=e.length&&(e=void 0),{value:e&&e[r++],done:!e}}};throw TypeError(t?`Object is not iterable.`:`Symbol.iterator is not defined.`)}function fa(e,t){var n=typeof Symbol==`function`&&e[Symbol.iterator];if(!n)return e;var r=n.call(e),i,a=[],o;try{for(;(t===void 0||t-->0)&&!(i=r.next()).done;)a.push(i.value)}catch(e){o={error:e}}finally{try{i&&!i.done&&(n=r.return)&&n.call(r)}finally{if(o)throw o.error}}return a}function pa(e,t,n){if(n||arguments.length===2)for(var r=0,i=t.length,a;r<i;r++)(a||!(r in t))&&(a||=Array.prototype.slice.call(t,0,r),a[r]=t[r]);return e.concat(a||Array.prototype.slice.call(t))}function ma(e){return this instanceof ma?(this.v=e,this):new ma(e)}function ha(e,t,n){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var r=n.apply(e,t||[]),i,a=[];return i=Object.create((typeof AsyncIterator==`function`?AsyncIterator:Object).prototype),s(`next`),s(`throw`),s(`return`,o),i[Symbol.asyncIterator]=function(){return this},i;function o(e){return function(t){return Promise.resolve(t).then(e,d)}}function s(e,t){r[e]&&(i[e]=function(t){return new Promise(function(n,r){a.push([e,t,n,r])>1||c(e,t)})},t&&(i[e]=t(i[e])))}function c(e,t){try{l(r[e](t))}catch(e){f(a[0][3],e)}}function l(e){e.value instanceof ma?Promise.resolve(e.value.v).then(u,d):f(a[0][2],e)}function u(e){c(`next`,e)}function d(e){c(`throw`,e)}function f(e,t){e(t),a.shift(),a.length&&c(a[0][0],a[0][1])}}function ga(e){if(!Symbol.asyncIterator)throw TypeError(`Symbol.asyncIterator is not defined.`);var t=e[Symbol.asyncIterator],n;return t?t.call(e):(e=typeof da==`function`?da(e):e[Symbol.iterator](),n={},r(`next`),r(`throw`),r(`return`),n[Symbol.asyncIterator]=function(){return this},n);function r(t){n[t]=e[t]&&function(n){return new Promise(function(r,a){n=e[t](n),i(r,a,n.done,n.value)})}}function i(e,t,n,r){Promise.resolve(r).then(function(t){e({value:t,done:n})},t)}}function _a(e){return typeof e==`function`}function va(e){var t=e(function(e){Error.call(e),e.stack=Error().stack});return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}var ya=va(function(e){return function(t){e(this),this.message=t?t.length+` errors occurred during unsubscription:
|
|
@@ -583,7 +583,7 @@ td.UniverTableCell, th.UniverTableCell{mso-padding-alt:0cm 5.4pt 0cm 5.4pt;}
|
|
|
583
583
|
univer-h-5 univer-w-px univer-bg-gray-200
|
|
584
584
|
dark:!univer-bg-gray-700
|
|
585
585
|
`})}function FW(e){return(0,U.jsx)(`div`,{className:`univer-flex univer-h-7 univer-items-center univer-gap-1 univer-px-1`,children:e.children})}function IW(e){return(0,U.jsx)(Dj,{title:e.title,placement:`bottom`,children:(0,U.jsx)(`button`,{type:`button`,disabled:e.disabled,onClick:e.onClick,className:tj(`univer-flex univer-h-6 univer-w-6 univer-items-center univer-justify-center univer-rounded-md univer-border-none univer-bg-transparent univer-p-0 univer-text-sm univer-text-gray-700 univer-transition-colors hover:univer-bg-gray-100 disabled:univer-cursor-not-allowed disabled:univer-opacity-40 dark:!univer-text-gray-100 dark:hover:!univer-bg-gray-700`,{"univer-bg-gray-100 univer-text-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-primary-300":e.active}),children:e.children})})}function LW(){return(0,U.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`1em`,height:`1em`,fill:`none`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M2.5 4.5H8.2`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`}),(0,U.jsx)(`path`,{d:`M11.8 4.5H17.5`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`}),(0,U.jsx)(`path`,{d:`M2.5 10H5.7`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`}),(0,U.jsx)(`path`,{d:`M14.3 10H17.5`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`}),(0,U.jsx)(`path`,{d:`M2.5 15.5H8.2`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`}),(0,U.jsx)(`path`,{d:`M11.8 15.5H17.5`,stroke:`currentColor`,strokeWidth:`1.4`,strokeLinecap:`round`}),(0,U.jsx)(`rect`,{x:`6.8`,y:`7`,width:`6.4`,height:`6`,rx:`1`,stroke:`currentColor`,strokeWidth:`1.4`})]})}function oat(){return(0,U.jsxs)(`svg`,{viewBox:`0 0 20 20`,width:`1em`,height:`1em`,fill:`none`,"aria-hidden":`true`,children:[(0,U.jsx)(`path`,{d:`M5 2.8V12.5C5 13.9 6.1 15 7.5 15H17.2`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,U.jsx)(`path`,{d:`M2.8 5H12.5C13.9 5 15 6.1 15 7.5V17.2`,stroke:`currentColor`,strokeWidth:`1.5`,strokeLinecap:`round`}),(0,U.jsx)(`path`,{d:`M8.3 8.3H11.7V11.7H8.3V8.3Z`,stroke:`currentColor`,strokeWidth:`1.2`})]})}function sat(e){let[t,n]=(0,H.useState)(!1),r=e.options.find(t=>t.value===e.value)??e.options[0];return(0,U.jsx)(xj,{open:t,onOpenChange:n,overlay:(0,U.jsx)(`div`,{className:`univer-min-w-32 univer-rounded-lg univer-border univer-border-solid univer-border-gray-200 univer-bg-white univer-p-1 univer-shadow-lg dark:!univer-border-gray-700 dark:!univer-bg-gray-900`,children:e.options.map(t=>(0,U.jsxs)(`button`,{type:`button`,onClick:()=>{e.onChange(t.value),n(!1)},className:tj(`univer-flex univer-h-8 univer-w-full univer-items-center univer-gap-2 univer-rounded-md univer-border-none univer-bg-transparent univer-px-2 univer-text-left univer-text-sm univer-text-gray-700 univer-transition-colors hover:univer-bg-gray-100 dark:!univer-text-gray-100 dark:hover:!univer-bg-gray-800`,{"univer-bg-primary-50 univer-text-primary-600 dark:!univer-bg-gray-800 dark:!univer-text-primary-300":t.value===e.value}),children:[(0,U.jsx)(`span`,{className:`univer-flex univer-size-4 univer-items-center univer-justify-center`,children:t.icon}),(0,U.jsx)(`span`,{className:`univer-flex-1`,children:t.label})]},t.value))}),children:(0,U.jsx)(`span`,{children:(0,U.jsx)(Dj,{title:e.title,placement:`bottom`,children:(0,U.jsxs)(`button`,{type:`button`,className:tj(`univer-flex univer-h-6 univer-min-w-9 univer-items-center univer-justify-center univer-gap-1 univer-rounded-md univer-border-none univer-bg-transparent univer-px-1.5 univer-text-sm univer-text-gray-700 univer-transition-colors hover:univer-bg-gray-100 dark:!univer-text-gray-100 dark:hover:!univer-bg-gray-700`,{"univer-bg-gray-100 univer-text-primary-600 dark:!univer-bg-gray-700 dark:!univer-text-primary-300":t}),children:[r.icon,(0,U.jsx)(zD,{className:`univer-text-xs`})]})})})})}function cat(e){let t=W(R),n=W(nx),r=W(B).getUnit(e.unitId,M.UNIVER_DOC)??void 0,[i,a]=(0,H.useState)(()=>iat(r,e.drawingId)),[o,s]=(0,H.useState)(!1),c=t=>e.menuItems.find(e=>e.label===t),l=c(`drawing-ui.image-popup.edit`),u=c(`drawing-ui.image-popup.crop`),d=c(`drawing-ui.image-popup.delete`),f=[{label:n.t(`drawing-ui.image-text-wrap.inline`),value:`inline`,icon:(0,U.jsx)(LW,{})},{label:n.t(`drawing-ui.image-text-wrap.square`),value:`wrapSquare`,icon:(0,U.jsx)(LW,{})},{label:n.t(`drawing-ui.image-text-wrap.topAndBottom`),value:`wrapTopAndBottom`,icon:(0,U.jsx)(LW,{})},{label:n.t(`drawing-ui.image-text-wrap.behindText`),value:`behindText`,icon:(0,U.jsx)(LW,{})},{label:n.t(`drawing-ui.image-text-wrap.inFrontText`),value:`inFrontOfText`,icon:(0,U.jsx)(LW,{})}],p=e=>{e&&!e.disable&&t.executeCommand(e.commandId,e.commandParams)};return o?null:(0,U.jsxs)(`div`,{"data-u-comp":`doc-image-floating-toolbar`,onMouseDown:e=>{e.stopPropagation(),e.preventDefault()},className:tj(`univer-box-border univer-flex univer-items-center univer-rounded univer-bg-white univer-px-1 univer-py-1 univer-shadow-sm dark:!univer-border-gray-700 dark:!univer-bg-gray-900`,cj),children:[(0,U.jsx)(FW,{children:(0,U.jsx)(sat,{title:f.find(e=>e.value===i)?.label??n.t(`drawing-ui.image-text-wrap.inline`),value:i,options:f,onChange:n=>{a(n),t.executeCommand(rat,{unitId:e.unitId,subUnitId:e.subUnitId,drawings:[{unitId:e.unitId,subUnitId:e.subUnitId,drawingId:e.drawingId}],wrappingStyle:n})}})}),(0,U.jsx)(aat,{}),(0,U.jsxs)(FW,{children:[(0,U.jsx)(IW,{title:l?n.t(l.label):n.t(`drawing-ui.image-popup.edit`),disabled:!l||l.disable,onClick:()=>{s(!0),p(l)},children:(0,U.jsx)(wD,{})}),(0,U.jsx)(IW,{title:u?n.t(u.label):n.t(`drawing-ui.image-popup.crop`),disabled:!u||u.disable,onClick:()=>p(u),children:(0,U.jsx)(oat,{})})]}),(0,U.jsx)(aat,{}),(0,U.jsx)(FW,{children:(0,U.jsx)(IW,{title:d?n.t(d.label):n.t(`drawing-ui.image-popup.delete`),disabled:!d||d.disable,onClick:()=>p(d),children:(0,U.jsx)(CD,{})})})]})}function RW(e,t){return function(n,r){t(n,r,e)}}function zW(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var BW=class extends P{constructor(e,t,n){super(),this._componentManager=e,this._commandService=t,this._menuManagerService=n,this._init()}_init(){this._initMenus(),this._initCommands(),this._initComponents()}_initMenus(){this._menuManagerService.mergeMenu(tat)}_initCommands(){[OW,kW,jW,dW,fW,pW,mW,hW,gW,_W,vW,yW,AW,EW,DW,bW,xW,SW,CW,wW].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e)))}_initComponents(){[[PW,nat],[`BottomIcon`,LAe],[`GroupIcon`,Yje],[`MoveDownIcon`,VMe],[`MoveUpIcon`,UMe],[`TopmostIcon`,BNe],[`UngroupIcon`,JNe]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}};BW=zW([RW(0,j(Yj)),RW(1,R),RW(2,NM)],BW);function VW(e,t){let n=[];return e.forEach(e=>{let{oKey:r,left:i,top:a,height:o,width:s,angle:c}=e,l=t.getDrawingOKey(r);if(l==null)return n.push(null),!0;let{unitId:u,subUnitId:d,drawingId:f,drawingType:p}=l,m={unitId:u,subUnitId:d,drawingId:f,drawingType:p,transform:{left:i,top:a,height:o,width:s,angle:c}};p===um.DRAWING_IMAGE&&(m.srcRect=e.srcRect),n.push(m)}),n}function HW(e){"@babel/helpers - typeof";return HW=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},HW(e)}function lat(e,t){if(HW(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(HW(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function uat(e){var t=lat(e,`string`);return HW(t)==`symbol`?t:t+``}function UW(e,t,n){return(t=uat(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var WW=class extends P{constructor(e,t,n,r){super(),this._currentUniverService=e,this._commandService=t,this._renderManagerService=n,this._drawingManagerService=r,UW(this,`_sceneListenerOnDrawingMap`,new WeakSet),this._initialize()}dispose(){super.dispose()}_initialize(){this._recoveryImages(),this._drawingAddListener(),this._drawingRemoveListener(),this._drawingUpdateListener(),this._commandExecutedListener(),this._drawingArrangeListener(),this._drawingGroupListener(),this._drawingRefreshListener(),this._drawingVisibleListener()}_recoveryImages(){let e=this._drawingManagerService.drawingManagerData,t=kit(this._currentUniverService);if(t==null)return;let{unitId:n,subUnitId:r}=t;Object.keys(e).forEach(t=>{Object.keys(e[t]).forEach(i=>{let a=e[t][i].data;a!=null&&t===n&&i===r&&Object.keys(a).forEach(e=>{a[e]&&this._insertDrawing([{unitId:t,subUnitId:i,drawingId:e}])})})})}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===dW.id){let t=e.params;if(t==null)return;this._drawingAlign(t)}}))}_drawingGroupListener(){this.disposeWithMe(this._drawingManagerService.group$.subscribe(e=>{this._groupDrawings(e)})),this.disposeWithMe(this._drawingManagerService.ungroup$.subscribe(e=>{this._ungroupDrawings(e)}))}_getSceneAndTransformerByDrawingSearch(e){if(e==null)return;let t=this._renderManagerService.getRenderById(e)?.scene;return t==null?null:{scene:t,transformer:t.getTransformerByCreate()}}_groupDrawings(e){e.forEach(e=>{this._groupDrawing(e)})}_groupDrawing(e){let{parent:t,children:n}=e,{unitId:r,subUnitId:i,drawingId:a}=t,o=this._getSceneAndTransformerByDrawingSearch(t.unitId);if(o==null)return;let{scene:s,transformer:c}=o;this._commandService.syncExecuteCommand(kW.id);let l=[];if(n.forEach(e=>{let t=WN(e),n=s.getObjectIncludeInGroup(t);if(n==null||l.includes(n))return;l.push(n);let{transform:r}=e;r!=null&&(n.classType===yw.GROUP?n.transformByState({left:r.left,top:r.top}):n.transformByState(r))}),l.length===0)return;let u=new xke(WN({unitId:r,subUnitId:i,drawingId:a}));s.addObject(u,4).attachTransformerTo(u),u.addObjects(...l),t.groupBaseBound&&u.setBaseBound(t.groupBaseBound),t.groupId&&(u.isInGroup=!0,MW({drawingId:t.groupId,unitId:r,subUnitId:i},u,s,this._drawingManagerService)),t.transform&&u.transformByState({left:t.transform.left,top:t.transform.top,width:t.transform.width,height:t.transform.height,angle:t.transform.angle}),c.clearSelectedObjects(),c.setSelectedControl(u)}_ungroupDrawings(e){e.forEach(e=>{this._ungroupDrawing(e)})}_ungroupDrawing(e){let{parent:t,children:n}=e,r=this._getSceneAndTransformerByDrawingSearch(t.unitId);if(r==null)return;let{scene:i,transformer:a}=r;n.forEach(e=>{let t=WN(e),n=i.getObjectIncludeInGroup(t);if(n==null)return!0;if(n==null)return;let{transform:r}=e;r!=null&&(n.classType===yw.GROUP?n.transformByState({left:r.left,top:r.top}):n.transformByState(r))});let o=WN(t),s=i.getObject(o),{width:c,height:l}=s;s.getObjects().forEach(e=>{s.removeSelfObjectAndTransform(e.oKey,c,l)}),s.dispose(),a.clearSelectedObjects()}_drawingAlign(e){let{alignType:t}=e,n=e.drawings||this._drawingManagerService.getFocusDrawings();if(t===`0`)return;let r=[],i=1/0,a=1/0,o=-1/0,s=-1/0,c=0;n.forEach(e=>{let{unitId:t,subUnitId:n,drawingId:l,drawingType:u}=e,d=this._drawingManagerService.getDrawingByParam({unitId:t,subUnitId:n,drawingId:l});if(d==null||d.transform==null)return;r.push({unitId:t,subUnitId:n,drawingId:l,drawingType:u,transform:d.transform});let{left:f=0,top:p=0,width:m=0,height:h=0}=d.transform;i=Math.min(i,f),a=Math.min(a,p),o=Math.max(o,f+m),s=Math.max(s,p+h),c++}),c!==0&&(this._sortDrawingTransform(r,t),this._applyAlignType(r,t,i,a,o,s,c))}_applyAlignType(e,t,n,r,i,a,o){let s=Math.round((i-n)/o*10)/10,c=Math.round((a-r)/o*10)/10,l=[],u=this._getSceneAndTransformerByDrawingSearch(e[0].unitId);if(u==null)return;let{scene:d,transformer:f}=u;e.forEach((e,o)=>{let{unitId:u,subUnitId:d,drawingId:f,transform:p,drawingType:m}=e,{left:h=0,top:g=0,width:_=0,height:v=0}=p,y=h,b=g;switch(t){case`1`:y=n;break;case`2`:y=n+(i-n)/2-_/2;break;case`3`:y=i-_;break;case`4`:b=r;break;case`5`:b=r+(a-r)/2-v/2;break;case`6`:b=a-v;break;case`7`:y=n+s*o;break;case`8`:b=r+c*o}(y!==h||b!==g)&&l.push({unitId:u,subUnitId:d,drawingId:f,drawingType:m,transform:{left:y,top:b}})}),this._drawingManagerService.featurePluginUpdateNotification(l),f.refreshControls().changeNotification()}_sortDrawingTransform(e,t){e.sort((e,n)=>{let r=e.transform,i=n.transform,{left:a=0,top:o=0,width:s=0,height:c=0}=r,{left:l=0,top:u=0,width:d=0,height:f=0}=i;switch(t){case`1`:return a-l;case`2`:return a+s/2-(l+d/2);case`3`:return a+s-(l+d);case`4`:return o-u;case`5`:return o+c/2-(u+f/2);case`6`:return o+c-(u+f);case`7`:return a+s/2-(l+d/2);case`8`:return o+c/2-(u+f/2);default:return 0}})}_drawingArrangeListener(){this.disposeWithMe(this._drawingManagerService.order$.subscribe(e=>{this._drawingArrange(e)}))}_drawingArrange(e){let{unitId:t,subUnitId:n,drawingIds:r}=e,i=this._getSceneAndTransformerByDrawingSearch(t);if(i==null)return;let{scene:a}=i;r.forEach(e=>{let r=WN({unitId:t,subUnitId:n,drawingId:e}),i=a.fuzzyMathObjects(r,!0);if(i==null||i.length===0)return;let o=this._drawingManagerService.getDrawingOrder(t,n).indexOf(e);for(let e of i)e.setProps({zIndex:o}),e.makeDirty()})}_drawingAddListener(){this.disposeWithMe(this._drawingManagerService.add$.subscribe(e=>{this._insertDrawing(e)}))}_insertDrawing(e){let t=[];e.forEach(e=>{let{unitId:n}=e;if(this._drawingManagerService.getDrawingByParam(e)==null)return;let r=this._getSceneAndTransformerByDrawingSearch(n);if(r==null)return;let{scene:i}=r;t.includes(i)||t.push(i)}),t.forEach(e=>{this._sceneListenerOnDrawingMap.has(e)||(this._addListenerOnDrawing(e),this._sceneListenerOnDrawingMap.add(e))})}_drawingRemoveListener(){this.disposeWithMe(this._drawingManagerService.remove$.subscribe(e=>{e.forEach(e=>{let{unitId:t,subUnitId:n,drawingId:r}=e,i=this._getSceneAndTransformerByDrawingSearch(t);if(i==null)return;let{scene:a}=i,o=WN({unitId:t,subUnitId:n,drawingId:r}),s=a.fuzzyMathObjects(o,!0);if(s.length>0){var c;for(let e of s)e.dispose();(c=a.getTransformer())==null||c.clearSelectedObjects()}})}))}_drawingUpdateListener(){this.disposeWithMe(this._drawingManagerService.update$.subscribe(e=>{e.forEach(e=>{var t;let{unitId:n,subUnitId:r,drawingId:i}=e,a=this._drawingManagerService.getDrawingByParam(e);if(a==null)return;let{transform:o,drawingType:s}=a,c=this._getSceneAndTransformerByDrawingSearch(n);if(c==null)return;let{scene:l,transformer:u}=c;if(o==null)return!0;let{left:d=0,top:f=0,width:p=0,height:m=0,angle:h=0,flipX:g=!1,flipY:_=!1,skewX:v=0,skewY:y=0}=o,b=WN({unitId:n,subUnitId:r,drawingId:i}),x=l.getObject(b);if(x==null)return!0;x.transformByState({left:d,top:f,width:p,height:m,angle:h,flipX:g,flipY:_,skewX:v,skewY:y}),(t=l.getTransformer())==null||t.debounceRefreshControls()})}))}_drawingRefreshListener(){this.disposeWithMe(this._drawingManagerService.refreshTransform$.subscribe(e=>{e.forEach(e=>{let{unitId:t,subUnitId:n,drawingId:r}=e,i=this._getSceneAndTransformerByDrawingSearch(t);if(i==null)return;let a=this._drawingManagerService.getDrawingByParam(e);if(a==null)return;let{transform:o}=a,{scene:s}=i,c=WN({unitId:t,subUnitId:n,drawingId:r}),l=s.getObject(c);if(l==null||o==null)return!0;let{left:u=0,top:d=0,width:f=0,height:p=0,angle:m=0,flipX:h=!1,flipY:g=!1,skewX:_=0,skewY:v=0}=o;l.transformByState({left:u,top:d,width:f,height:p,angle:m,flipX:h,flipY:g,skewX:_,skewY:v})})}))}_drawingVisibleListener(){this.disposeWithMe(this._drawingManagerService.visible$.subscribe(e=>{e.forEach(e=>{let{unitId:t,subUnitId:n,drawingId:r,visible:i}=e,a=this._getSceneAndTransformerByDrawingSearch(t);if(a==null)return;let{scene:o}=a,s=WN({unitId:t,subUnitId:n,drawingId:r}),c=o.getObject(s);if(c==null)return!0;i?c.show():c.hide()})}))}_filterUpdateParams(e,t){return e.filter((e,n)=>{if(e==null)return!1;let{transform:r}=e;return th(r,t?.[n])})}_addListenerOnDrawing(e){let t=e.getTransformerByCreate(),n=null;this.disposeWithMe(Wf(t.changeStart$.subscribe(e=>{let{objects:t}=e,r=Array.from(t.values()),i=[];n=r.map(e=>{let{left:t,top:n,height:r,width:a,angle:o,oKey:s,isInGroup:c}=e,l=this._drawingManagerService.getDrawingOKey(s);if(c||e instanceof VE){let t=e.ancestorGroup;if(t==null&&e instanceof VE&&(t=e),t==null)return null;let n=this._drawingManagerService.getDrawingOKey(t.oKey);if(n){let{unitId:e,subUnitId:r,drawingId:a}=n;i.push({unitId:e,subUnitId:r,drawingId:a});let{left:o,top:s,height:c,width:l,angle:u}=t;return{left:o,top:s,height:c,width:l,angle:u}}}else if(l!=null){let{unitId:e,subUnitId:s,drawingId:c}=l;return i.push({unitId:e,subUnitId:s,drawingId:c}),{left:t,top:n,height:r,width:a,angle:o}}return null}).filter(e=>e!=null),i.length>0?this._commandService.syncExecuteCommand(RN.id,i):this._commandService.syncExecuteCommand(RN.id,[])}))),this.disposeWithMe(Wf(t.changeEnd$.subscribe(e=>{let{objects:t}=e,r=this._filterUpdateParams(VW(t,this._drawingManagerService),n);r.length>0&&this._drawingManagerService.featurePluginUpdateNotification(r)})))}};WW=zW([RW(0,B),RW(1,R),RW(2,ZE),RW(3,LN)],WW);var GW=class extends DT{constructor(e,t){t??={},t.transformerConfig={keepRatio:!1,isCropper:!0,anchorFill:`rgb(0, 0, 0)`,anchorStroke:`rgb(255, 255, 255)`,anchorSize:24},super(e,t),UW(this,`_srcRect`,void 0),UW(this,`_prstGeom`,void 0),UW(this,`_applyTransform`,void 0),UW(this,`_dragPadding`,8),UW(this,`_cacheCanvas`,void 0),t?.srcRect&&(this._srcRect=t.srcRect),t?.prstGeom&&(this._prstGeom=t.prstGeom),t?.applyTransform&&(this._applyTransform=t.applyTransform),t?.dragPadding&&(this._dragPadding=t.dragPadding),this._applyProps()}refreshSrcRect(e,t){this._srcRect=e,this._applyTransform=t,this._applyProps()}get srcRect(){return this._srcRect}dispose(){var e;super.dispose(),(e=this._cacheCanvas)==null||e.dispose(),this._srcRect=null}isHit(e){let t=this.getInverseCoord(e);return t.x>=-this.strokeWidth/2&&t.x<=this.width+this.strokeWidth/2&&t.y>=-this.strokeWidth/2&&t.y<=this.height+this.strokeWidth/2&&!this._inSurround(t)}_inSurround(e){let t=this._dragPadding;return e.x>=t-this.strokeWidth/2&&e.x<=this.width+this.strokeWidth/2-t&&e.y>=t-this.strokeWidth/2&&e.y<=this.height+this.strokeWidth/2-t}render(e,t){return this.visible?(e.save(),this._draw(e),e.restore(),this.makeDirty(!1),this):(this.makeDirty(!1),this)}_draw(e){var t;let{width:n,height:r}=this.getScene().getEngine();this._initialCacheCanvas(),(t=this._cacheCanvas)==null||t.clear();let i=this._cacheCanvas?.getContext();i!=null&&(i.save(),NE.drawWith(i,{left:0,top:0,width:n,height:r,fill:`rgba(0, 0, 0, 0.5)`}),i.setTransform(e.getTransform()),this._clipForApplyObject(i),this._applyCache(e),i.restore())}_clipForApplyObject(e){let t=0;if(this._prstGeom!=null&&(t=1),e.globalCompositeOperation=`destination-out`,e.beginPath(),t===0){let t=this.transform.getMatrix();e.transform(t[0],t[1],t[2],t[3],t[4],t[5]),e.rect(0,0,this.width,this.height),e.fill()}}_applyProps(){if(this._applyTransform==null)return;let e=0,t=0,n=0,r=0,{left:i=0,top:a=0,width:o=0,height:s=0,angle:c}=this._applyTransform;if(this._srcRect!=null){let{left:i=0,top:a=0,right:o=0,bottom:s=0}=this._srcRect;e=i,t=a,n=o,r=s}let l=i+e,u=a+t;this.transformByState({left:l,top:u,width:i+o-n-l,height:a+s-r-u,angle:c})}_applyCache(e){if(!e||this._cacheCanvas==null)return;let t=this._cacheCanvas.getContext();t.save(),e.save(),e.setTransform(1,0,0,1,0,0),t.setTransform(1,0,0,1,0,0),e.drawImage(this._cacheCanvas.getCanvasEle(),0,0),e.restore(),t.restore()}_initialCacheCanvas(){if(this._cacheCanvas!=null)return;let e=this.getScene();if(e==null)return;this._cacheCanvas=new oT;let t=e.getEngine();this._cacheCanvas.setSize(t.width,t.height),t.onTransformChange$.subscribeEvent(()=>{var e;(e=this._cacheCanvas)==null||e.setSize(t.width,t.height),this.makeDirty(!0)})}},KW=class extends P{constructor(e,t,n,r,i,a){super(),this._commandService=e,this._drawingManagerService=t,this._renderManagerService=n,this._univerInstanceService=r,this._messageService=i,this._localeService=a,UW(this,`_sceneListenerOnImageMap`,new WeakSet),this._init()}_init(){this._initOpenCrop(),this._initCloseCrop(),this._initAutoCrop()}_initAutoCrop(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id!==AW.id)return;let t=e.params;if(t==null)return;let{cropType:n}=t,r=this._drawingManagerService.getFocusDrawings();if(r.length!==1)return;let{unitId:i,subUnitId:a,drawingId:o}=r[0],s=this._renderManagerService.getRenderById(i)?.scene;if(s==null)return!0;this._searchCropObject(s)!=null&&this._commandService.syncExecuteCommand(kW.id,{isAuto:!0});let c=WN({unitId:i,subUnitId:a,drawingId:o}),l=s.getObject(c);if(!(l instanceof PE)){this._messageService.show({type:Oj.Error,content:this._localeService.t(`drawing-ui.image-cropper.error`)});return}l!=null&&(this._updateCropperObject(n,l),this._commandService.executeCommand(OW.id,{unitId:i,subUnitId:a,drawingId:o}))}))}_calculateSrcRectByRatio(e,t,n,r,i,a){let o=n/r,s=i/a,c=n,l=r;o>s?c=r*s:l=n/s;let u=(n-c)/2,d=(r-l)/2;return{left:Tw(u,1),top:Tw(d,1),right:Tw(n-(u+c),1),bottom:Tw(r-(d+l),1)}}_updateCropperObject(e,t){let{left:n,top:r,width:i,height:a}=t.calculateTransformWithSrcRect(),o;switch(e){case`1`:o=this._calculateSrcRectByRatio(n,r,i,a,1,1);break;case`2`:o=this._calculateSrcRectByRatio(n,r,i,a,16,9);break;case`3`:o=this._calculateSrcRectByRatio(n,r,i,a,9,16);break;case`4`:o=this._calculateSrcRectByRatio(n,r,i,a,5,4);break;case`5`:o=this._calculateSrcRectByRatio(n,r,i,a,4,5);break;case`6`:o=this._calculateSrcRectByRatio(n,r,i,a,4,3);break;case`7`:o=this._calculateSrcRectByRatio(n,r,i,a,3,4);break;case`8`:o=this._calculateSrcRectByRatio(n,r,i,a,3,2);break;case`9`:o=this._calculateSrcRectByRatio(n,r,i,a,2,3)}if(o==null)return;t.setSrcRect(o);let{left:s=0,top:c=0,bottom:l=0,right:u=0}=o;t.transformByStateCloseCropper({left:n+s,top:r+c,width:i-u-s,height:a-l-c})}_initOpenCrop(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id!==OW.id)return;let t=e.params;if(t==null)return;let{unitId:n,subUnitId:r,drawingId:i}=t,a=this._renderManagerService.getRenderById(n)?.scene;if(a==null)return!0;if(this._sceneListenerOnImageMap.has(a)||(this._addListenerOnImage(a),this._sceneListenerOnImageMap.add(a)),this._drawingManagerService.getDrawingByParam({unitId:n,subUnitId:r,drawingId:i})==null)return;let o=WN({unitId:n,subUnitId:r,drawingId:i}),s=a.getObject(o);if(s==null)return;if(!(s instanceof PE)){this._messageService.show({type:Oj.Error,content:this._localeService.t(`drawing-ui.image-cropper.error`)});return}let c=a.getTransformer();c?.clearControls();let l=new GW(`${o}-crop`,{srcRect:s.srcRect,prstGeom:s.prstGeom,applyTransform:s.calculateTransformWithSrcRect()});a.addObject(l,s.getLayerIndex()+1).attachTransformerTo(l),c?.createControlForCopper(l),this._addHoverForImageCopper(l),s.openRenderByCropper(),c?.refreshControls(),l.makeDirty(!0),this._commandService.syncExecuteCommand(RN.id,[{unitId:n,subUnitId:r,drawingId:i}])}))}_searchCropObject(e){let t=e.getAllObjectsByOrder();for(let e of t)if(e instanceof GW)return e}_initCloseCrop(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id!==kW.id)return;let t=this._univerInstanceService.getFocusedUnit();if(t==null)return;let n=t.getUnitId(),r=this._renderManagerService.getRenderById(n)?.scene;if(r==null)return!0;let i=this._searchCropObject(r);if(i==null)return;let a=this._getApplyObjectByCropObject(i);if(a==null)return;let o=r.getTransformerByCreate();o.detachFrom(i),o.clearCopperControl();let s=this._getSrcRectByTransformState(a,i),c=this._drawingManagerService.getDrawingOKey(a.oKey);if(c!=null){let{left:e,top:t,height:n,width:r}=i;this._drawingManagerService.featurePluginUpdateNotification([{...c,transform:{...c.transform,left:e,top:t,height:n,width:r},srcRect:s.srcRectAngle}])}a.setSrcRect({...s.srcRectAngle}),a.closeRenderByCropper(),a.makeDirty(!0),i?.dispose()}));let e=this._univerInstanceService.getCurrentTypeOfUnit$(M.UNIVER_SHEET).pipe(sc(e=>e?e.activeSheet$:ts(null)));this.disposeWithMe(e.subscribe(()=>{this._commandService.syncExecuteCommand(kW.id)}))}_getApplyObjectByCropObject(e){let t=e.oKey,n=t.slice(0,t.length-5),r=e.getScene();return r?r.getObject(n)??null:null}_addListenerOnImage(e){let t=e.getTransformerByCreate(),n=null;this.disposeWithMe(t.changeStart$.subscribe(e=>{let{objects:r}=e,i=r.values().next().value;if(i==null||!(i instanceof GW))return;let{left:a,top:o,height:s,width:c,angle:l}=i;n={left:a,top:o,height:s,width:c,angle:l},t.clearCopperControl()})),this.disposeWithMe(t.changeEnd$.subscribe(e=>{let{objects:r}=e,i=r.values().next().value;if(i==null||!(i instanceof GW))return;let{left:a,top:o,height:s,width:c,angle:l}=i;if(!th({left:a,top:o,height:s,width:c,angle:l},n))return;let u=this._getApplyObjectByCropObject(i);if(u==null)return;let d=this._getSrcRectByTransformState(u,i);i.refreshSrcRect(d.srcRect,u.getState()),t.createControlForCopper(i)})),this._endCropListener(e)}_addHoverForImageCopper(e){this.disposeWithMe(e.onPointerEnter$.subscribeEvent(()=>{e.cursor=_w.MOVE})),this.disposeWithMe(e.onPointerLeave$.subscribeEvent(()=>{e.cursor=_w.DEFAULT}))}_endCropListener(e){let t=e.getTransformerByCreate();this.disposeWithMe(t.clearControl$.subscribe(e=>{e===!0&&this._commandService.syncExecuteCommand(kW.id)}))}_getSrcRectByTransformState(e,t){let{left:n,top:r,height:i,width:a,strokeWidth:o,angle:s}=t,{left:c,top:l,width:u,height:d,angle:f,strokeWidth:p}=e,m=n-c,h=r-l,g={left:m,top:h,right:u-m-a,bottom:d-h-i},_={...g};if(f!==0){let e=new Hw(n+a/2,r+i/2),t=new Hw(u/2+c,d/2+l),o=new Hw(c,l);o.rotateByPoint(ww(f),t);let s=o.clone();s.rotateByPoint(ww(-f),e);let p=n-s.x,m=r-s.y;_.left=p,_.top=m,_.right=u-p-a,_.bottom=d-m-i}return{srcRect:g,srcRectAngle:_}}};KW=zW([RW(0,R),RW(1,LN),RW(2,ZE),RW(3,B),RW(4,gM),RW(5,j(nx))],KW);var qW=class extends P{constructor(){super(),UW(this,`_clipDelegate`,null),UW(this,`_canUseShapeClip$`,new so(!1)),UW(this,`canUseShapeClip$`,this._canUseShapeClip$.asObservable())}setCanUseShapeClip(e){this._canUseShapeClip$.next(e)}registerClipDelegate(e){return this._clipDelegate=e,Wf(()=>{this._clipDelegate===e&&(this._clipDelegate=null)})}applyShapeClip(e,t,n,r,i){return this._clipDelegate?this._clipDelegate(e,t,n,r,i):!1}dispose(){this._clipDelegate=null,this._canUseShapeClip$.complete(),super.dispose()}},JW=class{constructor(e,t,n,r,i,a){this._drawingManagerService=e,this._imageIoService=t,this._galleryService=n,this._urlImageService=r,this._univerInstanceService=i,this._drawingImageClipService=a}async renderImages(e,t){let{transform:n,drawingType:r,source:i,imageSourceType:a,srcRect:o,prstGeom:s,groupId:c,unitId:l,subUnitId:u,drawingId:d,isMultiTransform:f,transforms:p,adjustValues:m,hidden:h}=e;if(r!==um.DRAWING_IMAGE||!this._drawingManagerService.getDrawingVisible()||this._univerInstanceService.getUnitType(l)===M.UNIVER_SHEET&&u!==this._getActiveSheetId()||n==null)return;let g=f&&p?p:[n],_=[];for(let e of g){let{left:n,top:r,width:p,height:v,angle:y,flipX:b,flipY:x,skewX:S,skewY:C}=e,w=g.indexOf(e),T=WN({unitId:l,subUnitId:u,drawingId:d},f?w:void 0),E=t.getObject(T);if(E!=null){E.transformByState({left:n,top:r,width:p,height:v,angle:y,flipX:b,flipY:x,skewX:S,skewY:C});continue}let D=this._drawingManagerService.getDrawingOrder(l,u),O=D.indexOf(d),k={...e,zIndex:O===-1?D.length-1:O},A=this._imageIoService.getImageSourceCache(i,a),ee=!1;if(A!=null)k.image=A;else if(a===cb.UUID)try{k.url=await this._imageIoService.getImage(i)}catch(e){console.error(e);continue}else if(a===cb.URL){try{k.url=await this._urlImageService.getImage(i)}catch(e){console.error(e),k.url=i}ee=!0}else k.url=i,ee=!0;if(h&&(k.visible=!1),t.getObject(T))continue;k.printable=!0;let te=new PE(T,k);te.setClipService(this._drawingImageClipService),ee&&this._imageIoService.addImageSourceCache(i,a,te.getNative()),t.addObject(te,4),this._drawingManagerService.getDrawingEditable()&&t.attachTransformerTo(te),c&&MW({drawingId:c,unitId:l,subUnitId:u},te,t,this._drawingManagerService),s!=null&&te.setPrstGeom(s),m!=null&&te.setPrstGeomAdjValues(m),o!=null&&te.setSrcRect(o),_.push(te)}return _}_getActiveSheetId(){var e;return(e=this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET))==null||(e=e.getActiveSheet())==null?void 0:e.getSheetId()}renderFloatDom(e,t){let{transform:n,drawingType:r,groupId:i,unitId:a,subUnitId:o,drawingId:s,isMultiTransform:c,transforms:l}=e;if(r!==um.DRAWING_DOM||!this._drawingManagerService.getDrawingVisible()||n==null)return;let u=c&&l?l:[n],d=[];for(let n of u){let{left:r,top:l,width:f,height:p,angle:m,flipX:h,flipY:g,skewX:_,skewY:v}=n,y=u.indexOf(n),b=WN({unitId:a,subUnitId:o,drawingId:s},c?y:void 0),x=t.getObject(b);if(x!=null){x.transformByState({left:r,top:l,width:f,height:p,angle:m,flipX:h,flipY:g,skewX:_,skewY:v});continue}let S=this._drawingManagerService.getDrawingOrder(a,o),C=S.indexOf(s),w={...n,zIndex:C===-1?S.length-1:C};if(t.getObject(b))continue;w.printable=!1;let T=new NE(b,w);this._drawingManagerService.getDrawingVisible()&&(t.addObject(T,4),this._drawingManagerService.getDrawingEditable()&&e.allowTransform!==!1&&t.attachTransformerTo(T),i&&MW({drawingId:i,unitId:a,subUnitId:o},T,t,this._drawingManagerService),d.push(T))}return d}renderDrawing(e,t){let n=this._drawingManagerService.getDrawingByParam(e);if(n!=null)switch(n.drawingType){case um.DRAWING_IMAGE:return this.renderImages(n,t)}}previewImage(e,t,n,r){this._galleryService.open({images:[t],onOpenChange:e=>{e||this._galleryService.close()}})}_adjustImageSize(e,t,n,r){if(e<=n&&t<=r)return{width:e,height:t};let i=n/e,a=r/t,o=Math.min(i,a);return{width:Math.floor(e*o),height:Math.floor(t*o)}}};JW=zW([RW(0,LN),RW(1,ub),RW(2,TN),RW(3,db),RW(4,B),RW(5,j(qW))],JW);var YW=class extends P{constructor(e,t,n,r,i,a,o){super(),this._commandService=e,this._renderManagerService=t,this._drawingManagerService=n,this._dialogService=r,this._imageIoService=i,this._currentUniverService=a,this._drawingRenderService=o,this._initialize()}dispose(){super.dispose()}_initialize(){this._drawingAddListener(),this._commandExecutedListener(),this._imageUpdateListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===jW.id){let t=e.params;if(t==null)return;this._resetImageSize(t)}}))}_getSceneAndTransformerByDrawingSearch(e){if(e==null)return;let t=this._renderManagerService.getRenderById(e)?.scene;return t==null?null:{scene:t,transformer:t.getTransformerByCreate()}}_resetImageSize(e){let t=[],n=[];e.forEach(e=>{let{unitId:r,subUnitId:i,drawingId:a}=e,o=this._getSceneAndTransformerByDrawingSearch(r);if(o==null)return;let{scene:s}=o,c=WN({unitId:r,subUnitId:i,drawingId:a}),l=s.getObject(c);if(l==null)return!0;let u=this._drawingManagerService.getDrawingByParam(e);if(u==null)return!0;if(u.drawingType!==um.DRAWING_IMAGE)return;l.resetSize();let{width:d,height:f}=l.getNativeSize();n.includes(s)===!1&&n.push(s),t.push({...u,transform:{...u.transform,height:f,width:d,angle:0},srcRect:null,prstGeom:null})}),this._drawingManagerService.featurePluginUpdateNotification(t),n.forEach(e=>{e.getTransformerByCreate().refreshControls().changeNotification()}),this._commandService.syncExecuteCommand(RN.id,e)}_drawingAddListener(){this.disposeWithMe(this._drawingManagerService.add$.pipe(Bs(33),Ls(e=>e.length>0),os(e=>e.flat()),os(e=>{let t=new Map;for(let n of e)t.set(`${n.unitId}|${n.subUnitId}|${n.drawingId}`,n);return[...t.values()]}),Ls(e=>e.length>0)).subscribe(e=>{this._insertImages(e)}))}_insertImages(e){e.forEach(async e=>{let{unitId:t,subUnitId:n}=e,r=this._getSceneAndTransformerByDrawingSearch(t),i=kit(this._currentUniverService,t)?.subUnitId;if(r==null||i!==n)return;let a=this._drawingManagerService.getDrawingByParam(e);if(a==null)return;let o=await this._drawingRenderService.renderImages(a,r.scene);if(this._drawingManagerService.refreshTransform([a]),o!=null&&o.length!==0)for(let e of o)this._addHoverForImage(e),this._addDialogForImage(e)})}_imageUpdateListener(){this.disposeWithMe(this._drawingManagerService.update$.subscribe(e=>{e.forEach(e=>{let{unitId:t,subUnitId:n,drawingId:r}=e,i=this._drawingManagerService.getDrawingByParam(e);if(i==null)return;let{transform:a,drawingType:o,srcRect:s,prstGeom:c,source:l,imageSourceType:u}=i;if(o!==um.DRAWING_IMAGE)return;let d=this._getSceneAndTransformerByDrawingSearch(t);if(d==null)return;let{scene:f,transformer:p}=d;if(a==null)return!0;let m=WN({unitId:t,subUnitId:n,drawingId:r}),h=f.getObject(m);if(h==null)return!0;h.setSrcRect(s),h.setPrstGeom(c),l!=null&&l.length>0&&(u===cb.BASE64||u===cb.URL)&&h.changeSource(l)})}))}_addHoverForImage(e){this.disposeWithMe(Wf(e.onPointerEnter$.subscribeEvent(()=>{e.cursor=_w.GRAB}))),this.disposeWithMe(Wf(e.onPointerLeave$.subscribeEvent(()=>{e.cursor=_w.DEFAULT})))}_addDialogForImage(e){this.disposeWithMe(Wf(e.onDblclick$.subscribeEvent(()=>{let t=`${e.oKey}-viewer-dialog`;this._drawingRenderService.previewImage(t,e.getNative().src,e.getNativeSize().width,e.getNativeSize().height)})))}};YW=zW([RW(0,R),RW(1,ZE),RW(2,LN),RW(3,CN),RW(4,ub),RW(5,B),RW(6,j(JW))],YW);var XW=class extends dx{constructor(e=Nit,t,n){super(),this._config=e,this._injector=t,this._configService=n;let{menu:r,...i}=Qi({},Nit,this._config);r&&this._configService.setConfig(`menu`,r,{merge:!0}),this._configService.setConfig(Mit,i)}onStarting(){this._initDependencies()}onRendered(){this._injector.get(WW),this._injector.get(BW),this._injector.get(KW),this._injector.get(YW)}_initDependencies(){[[qW],[JW],[WW],[BW],[KW],[YW]].forEach(e=>this._injector.add(e))}};UW(XW,`pluginName`,`UNIVER_DRAWING_UI_PLUGIN`),UW(XW,`packageName`,Ait),UW(XW,`version`,jit),XW=zW([RW(1,j(We)),RW(2,Nm)],XW);var dat=e=>{let t=W(R),n=W(nx),{drawings:r,alignShow:i}=e,[a,o]=(0,H.useState)(`0`),s=[{label:n.t(`drawing-ui.image-panel.align.default`),value:`0`},{options:[{label:n.t(`drawing-ui.image-panel.align.left`),value:`1`},{label:n.t(`drawing-ui.image-panel.align.center`),value:`2`},{label:n.t(`drawing-ui.image-panel.align.right`),value:`3`}]},{options:[{label:n.t(`drawing-ui.image-panel.align.top`),value:`4`},{label:n.t(`drawing-ui.image-panel.align.middle`),value:`5`},{label:n.t(`drawing-ui.image-panel.align.bottom`),value:`6`}]},{options:[{label:n.t(`drawing-ui.image-panel.align.horizon`),value:`7`},{label:n.t(`drawing-ui.image-panel.align.vertical`),value:`8`}]}];function c(e){o(e),t.executeCommand(dW.id,{alignType:e,drawings:r})}return(0,U.jsxs)(`div`,{className:tj(`univer-relative univer-w-full`,{"univer-hidden":!i}),children:[(0,U.jsx)(`header`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:n.t(`drawing-ui.image-panel.align.title`)})}),(0,U.jsx)(`div`,{className:`univer-relative univer-mt-2.5 univer-flex univer-h-full`,children:(0,U.jsx)(`div`,{className:`univer-w-full univer-text-gray-900 dark:!univer-text-white`,children:(0,U.jsx)(Ij,{value:a,options:s,onChange:c})})})]})},fat=e=>{let{arrangeShow:t,drawings:n}=e,r=W(nx),i=W(LN),a=W(R),o=W(Yj),s=o.get(`MoveUpIcon`),c=o.get(`MoveDownIcon`),l=o.get(`TopmostIcon`),u=o.get(`BottomIcon`),[d,f]=(0,H.useState)(n);(0,H.useEffect)(()=>{let e=i.focus$.subscribe(e=>{f(e)});return()=>{e.unsubscribe()}},[]);let p=e=>{a.syncExecuteCommand(bW.id,{arrangeType:e,drawings:d})};return(0,U.jsxs)(`div`,{className:tj(`univer-grid univer-gap-2 univer-py-2 univer-text-gray-400`,{"univer-hidden":!t}),children:[(0,U.jsx)(`header`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:r.t(`drawing-ui.image-panel.arrange.title`)})}),(0,U.jsxs)(`div`,{className:`univer-grid univer-grid-cols-2 univer-gap-2`,children:[(0,U.jsxs)(rj,{onClick:()=>{p(lm.forward)},children:[(0,U.jsx)(s,{}),r.t(`drawing-ui.image-panel.arrange.forward`)]}),(0,U.jsxs)(rj,{onClick:()=>{p(lm.backward)},children:[(0,U.jsx)(c,{}),r.t(`drawing-ui.image-panel.arrange.backward`)]}),(0,U.jsxs)(rj,{onClick:()=>{p(lm.front)},children:[(0,U.jsx)(l,{}),r.t(`drawing-ui.image-panel.arrange.front`)]}),(0,U.jsxs)(rj,{onClick:()=>{p(lm.back)},children:[(0,U.jsx)(u,{}),r.t(`drawing-ui.image-panel.arrange.back`)]})]})]})},pat=e=>{let t=W(nx),n=W(ZE),r=W(LN),i=W(R),a=W(Yj),{hasGroup:o,drawings:s}=e,c=a.get(`GroupIcon`),l=a.get(`UngroupIcon`),[u,d]=(0,H.useState)(!1),[f,p]=(0,H.useState)(!0),[m,h]=(0,H.useState)(!0);return(0,H.useEffect)(()=>{let e=s[0];if(e==null)return;let{unitId:t}=e,i=n.getRenderById(t)?.scene;if(i==null)return;let a=i.getTransformerByCreate(),o=a.clearControl$.subscribe(e=>{e===!0&&d(!1)}),c=a.changeStart$.subscribe(e=>{let{objects:t}=e,n=VW(t,r),i=n.filter(e=>e?.drawingType===um.DRAWING_GROUP),a=!1,o=!1;n.length>1&&(a=!0),i.length>0&&(o=!0),d(a||o),p(a),h(o)});return()=>{c.unsubscribe(),o.unsubscribe()}},[]),(0,U.jsxs)(`div`,{className:tj(`univer-grid univer-gap-2 univer-py-2 univer-text-gray-400`,{"univer-hidden":o===!0&&u===!1||o===!1}),children:[(0,U.jsx)(`header`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:t.t(`drawing-ui.image-panel.group.title`)})}),(0,U.jsxs)(`div`,{className:`univer-flex univer-items-center univer-justify-center univer-gap-2`,children:[(0,U.jsxs)(rj,{className:tj({"univer-hidden":!f}),onClick:()=>{i.syncExecuteCommand(EW.id,{drawings:s})},children:[(0,U.jsx)(c,{}),t.t(`drawing-ui.image-panel.group.group`)]}),(0,U.jsxs)(rj,{className:tj({"univer-hidden":!m}),onClick:()=>{i.syncExecuteCommand(DW.id,{drawings:s})},children:[(0,U.jsx)(l,{}),t.t(`drawing-ui.image-panel.group.unGroup`)]})]})]})},mat=[-360,360],ZW=300,hat=e=>{let t=W(nx),n=W(LN),r=W(ZE),{drawings:i,transformShow:a}=e,o=i[0];if(o==null)return;let s=o.transform;if(s==null)return;let{unitId:c,subUnitId:l,drawingId:u,drawingType:d}=o,f=r.getRenderById(c)?.scene;if(f==null)return;let p=f.getEngine()?.activeScene;if(p==null)return;let m=f.getTransformerByCreate(),{width:h=0,height:g=0,left:_=0,top:v=0,angle:y=0}=s,[b,x]=(0,H.useState)(h),[S,C]=(0,H.useState)(g),[w,T]=(0,H.useState)(_),[E,D]=(0,H.useState)(v),[O,k]=(0,H.useState)(y),[A,ee]=(0,H.useState)(m.keepRatio),te=(e,t,n,r)=>{let{width:i,height:a}=p,{ancestorLeft:o,ancestorTop:s}=f,c=e,l=t,u=n,d=r;return e+o<0&&(c=-o),t+s<0&&(l=-s),u=i-c-o,u<20&&(u=20),d=a-l-s,d<20&&(d=20),e+u+o>i&&(c=i-n-o),t+d+s>a&&(l=a-r-s),{limitLeft:c,limitTop:l,limitWidth:u,limitHeight:d}},ne=e=>{let{objects:t}=e,r=VW(t,n);if(r.length!==1)return;let i=r[0];if(i==null)return;let{transform:a}=i;if(a==null)return;let{width:o,height:s,left:c,top:l,angle:u}=a;o!=null&&x(o),s!=null&&C(s),c!=null&&T(c),l!=null&&D(l),u!=null&&k(u)};(0,H.useEffect)(()=>{let e=[m.changeStart$.subscribe(e=>{ne(e)}),m.changing$.subscribe(e=>{ne(e)}),m.changeEnd$.subscribe(e=>{ne(e)}),n.focus$.subscribe(e=>{if(e.length!==1)return;let t=n.getDrawingByParam(e[0]);if(t==null)return;let r=t.transform;if(r==null)return;let{width:i,height:a,left:o,top:s,angle:c}=r;i!=null&&x(i),a!=null&&C(a),o!=null&&T(o),s!=null&&D(s),c!=null&&k(c)})];return()=>{e.forEach(e=>e.unsubscribe())}},[]);let re=Wi(e=>{if(e==null)return;let{limitWidth:t,limitHeight:r}=te(w,E,e,S);e=Math.min(e,t);let i={unitId:c,subUnitId:l,drawingId:u,drawingType:d,transform:{width:e}};if(A){let t=e/b*S;if(t=Math.max(t,20),t>r)return;C(t),i.transform.height=t}x(e),n.featurePluginUpdateNotification([i]),m.refreshControls().changeNotification()},ZW),ie=Wi(e=>{if(e==null)return;let{limitHeight:t,limitWidth:r}=te(w,E,b,e);e=Math.min(e,t);let i={unitId:c,subUnitId:l,drawingId:u,drawingType:d,transform:{height:e}};if(A){let t=e/S*b;if(t=Math.max(t,20),t>r)return;x(t),i.transform.width=t}C(e),n.featurePluginUpdateNotification([i]),m.refreshControls().changeNotification()},ZW),ae=Wi(e=>{if(e==null)return;let{limitLeft:t}=te(e,E,b,S);e=t;let r={unitId:c,subUnitId:l,drawingId:u,drawingType:d,transform:{left:e}};T(e),n.featurePluginUpdateNotification([r]),m.refreshControls().changeNotification()},ZW),oe=Wi(e=>{if(e==null)return;let{limitTop:t}=te(w,e,b,S);e=t;let r={unitId:c,subUnitId:l,drawingId:u,drawingType:d,transform:{top:e}};D(e),n.featurePluginUpdateNotification([r]),m.refreshControls().changeNotification()},ZW);return(0,U.jsxs)(`div`,{className:tj(`univer-grid univer-gap-2 univer-py-2 univer-text-gray-400`,{"univer-hidden":!a}),children:[(0,U.jsx)(`header`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:t.t(`drawing-ui.image-panel.transform.title`)})}),(0,U.jsxs)(`div`,{className:`univer-grid univer-grid-cols-3 univer-gap-2 [&>div]:univer-grid [&>div]:univer-gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:t.t(`drawing-ui.image-panel.transform.width`)}),(0,U.jsx)(Ej,{precision:1,value:b,min:20,onChange:e=>{re(e)}})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:t.t(`drawing-ui.image-panel.transform.height`)}),(0,U.jsx)(Ej,{precision:1,value:S,min:20,onChange:e=>{ie(e)}})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:t.t(`drawing-ui.image-panel.transform.lock`)}),(0,U.jsx)(`div`,{className:`univer-text-center`,children:(0,U.jsx)(mj,{checked:A,onChange:e=>{ee(e),m.keepRatio=e}})})]})]}),(0,U.jsxs)(`div`,{className:`univer-grid univer-grid-cols-3 univer-gap-2 [&>div]:univer-grid [&>div]:univer-gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:t.t(`drawing-ui.image-panel.transform.x`)}),(0,U.jsx)(Ej,{precision:1,value:w,onChange:e=>{ae(e)}})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:t.t(`drawing-ui.image-panel.transform.y`)}),(0,U.jsx)(Ej,{precision:1,value:E,onChange:e=>{oe(e)}})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:t.t(`drawing-ui.image-panel.transform.rotate`)}),(0,U.jsx)(Ej,{precision:1,value:O,min:mat[0],max:mat[1],onChange:e=>{if(e==null)return;let t={unitId:c,subUnitId:l,drawingId:u,drawingType:d,transform:{angle:e}};k(e),n.featurePluginUpdateNotification([t]),m.refreshControls().changeNotification()}})]})]})]})},gat=e=>{let t=W(R),n=W(nx),r=W(qW),i=W(Yj),a=nO(r.canUseShapeClip$,!1),{drawings:o,cropperShow:s}=e;if(o[0]==null)return;let[c,l]=(0,H.useState)(`0`),u=(0,H.useRef)(!1),d=[{label:n.t(`drawing-ui.image-panel.crop.mode`),value:`0`},{label:`1:1`,value:`1`},{label:`16:9`,value:`2`},{label:`9:16`,value:`3`},{label:`5:4`,value:`4`},{label:`4:5`,value:`5`},{label:`4:3`,value:`6`},{label:`3:4`,value:`7`},{label:`3:2`,value:`8`},{label:`2:3`,value:`9`}];(0,H.useEffect)(()=>{let e=t.onCommandExecuted(e=>{e.id===kW.id&&(e.params?.isAuto||(u.current=!1))});return()=>{e?.dispose()}},[]);function f(e){l(e),u.current&&t.executeCommand(AW.id,{cropType:e})}let p=e=>{t.executeCommand(AW.id,{cropType:e}),u.current=!0};return(0,U.jsxs)(`div`,{className:tj(`univer-grid univer-gap-2 univer-py-2 univer-text-gray-400`,{"univer-hidden":!s}),children:[(0,U.jsx)(`header`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:n.t(`drawing-ui.image-panel.crop.title`)})}),(0,U.jsxs)(`div`,{className:`univer-flex univer-items-center univer-justify-center univer-gap-2`,children:[(0,U.jsxs)(rj,{onClick:()=>{p(c)},children:[(0,U.jsx)(ije,{}),n.t(`drawing-ui.image-panel.crop.start`)]}),(0,U.jsx)(Ij,{value:c,options:d,onChange:f})]}),a&&(()=>{let e=i.get(`sheet.image-clip.shape.picker.component`);return e?(0,U.jsx)(e,{}):null})()]})},_at=e=>{let t=W(LN),n=W(ZE),r=W(nx),{drawings:i,hasArrange:a=!0,hasTransform:o=!0,hasAlign:s=!0,hasCropper:c=!0,hasGroup:l=!0}=e,u=i[0];if(u==null)return;let{unitId:d}=u,f=n.getRenderById(d)?.scene;if(f==null)return;let p=f.getTransformerByCreate(),[m,h]=(0,H.useState)(!0),[g,_]=(0,H.useState)(!0),[v,y]=(0,H.useState)(!1),[b,x]=(0,H.useState)(!0),[S,C]=(0,H.useState)(!1);return(0,H.useEffect)(()=>{let e=p.clearControl$.subscribe(e=>{e===!0&&(h(!1),_(!1),y(!1),x(!1),C(!0))}),n=p.changeStart$.subscribe(e=>{let{objects:n}=e,r=VW(n,t);r.length===0?(h(!1),_(!1),y(!1),x(!1),C(!0)):r.length===1?(h(!0),_(!0),y(!1),x(!0),C(!1)):(h(!0),_(!1),y(!0),x(!1),C(!1))}),r=t.focus$.subscribe(e=>{e.length===0?(h(!1),_(!1),y(!1),x(!1),C(!0)):e.length===1?(h(!0),_(!0),y(!1),x(!0),C(!1)):(h(!0),_(!1),y(!0),x(!1),C(!1))});return()=>{n.unsubscribe(),e.unsubscribe(),r.unsubscribe()}},[]),(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(`div`,{className:tj(`univer-h-full`,{"univer-hidden":!S}),children:(0,U.jsx)(`div`,{className:`univer-flex univer-h-full univer-items-center univer-justify-center`,children:(0,U.jsx)(`span`,{children:r.t(`drawing-ui.image-panel.null`)})})}),(0,U.jsx)(fat,{arrangeShow:a===!0&&m,drawings:i}),(0,U.jsx)(hat,{transformShow:o===!0&&g,drawings:i}),(0,U.jsx)(dat,{alignShow:s===!0&&v,drawings:i}),(0,U.jsx)(gat,{cropperShow:c===!0&&b,drawings:i}),(0,U.jsx)(pat,{hasGroup:l,drawings:i})]})},QW={id:`doc.command.remove-doc-image`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(R),r=e.get(B),i=e.get(ZE),a=r.getCurrentUniverDocInstance();if(t==null||a==null)return!1;let o=i.getRenderById(t.unitId).with(vI),{drawings:s}=t,c=o.getSegment()??``,l=new Bv,u=Vv.getInstance(),d=a.getSelfOrHeaderFooterModel(c).getBody()?.customBlocks??[],f=s.map(e=>d.find(t=>t.blockId===e.drawingId)).filter(e=>!!e).sort((e,t)=>e.startIndex>t.startIndex?1:-1),p=s[0].unitId,m=new Pf;m.reset();let h=f[0].startIndex,g=[{startOffset:h,endOffset:h}],_={id:uD.id,params:{unitId:p,actions:[],textRanges:g}},v=[];for(let e of f){let{startIndex:t}=e;t>m.cursor&&l.push({t:Mm.RETAIN,len:t-m.cursor}),l.push({t:Mm.DELETE,len:1}),m.moveCursorTo(t+1)}let y=lP(a,c);v.push(u.editOp(l.serialize(),y));for(let e of f){let{blockId:t}=e,n=(a.getDrawings()??{})[t],r=a.getDrawingsOrder().indexOf(t),i=u.removeOp([`drawings`,t],n),o=u.removeOp([`drawingsOrder`,r],t);v.push(i),v.push(o)}return _.params.actions=v.reduce((e,t)=>Vv.compose(e,t),null),!!n.syncExecuteCommand(_.id,_.params)}},vat={id:`doc.command.delete-drawing`,type:L.COMMAND,handler:e=>{let t=e.get(R),n=e.get(aW).getFocusDrawings();if(n.length===0)return!1;let{unitId:r}=n[0],i=n.map(e=>{let{unitId:t,subUnitId:n,drawingId:r,drawingType:i}=e;return{unitId:t,subUnitId:n,drawingId:r,drawingType:i}});return t.executeCommand(QW.id,{unitId:r,drawings:i})}},yat={id:`doc.command.group-doc-image`,type:L.COMMAND,handler:(e,t)=>!1},$W={id:`doc.command.insert-doc-image`,type:L.COMMAND,handler:(e,t)=>{if(t==null)return!1;let n=e.get(R),r=e.get(sD),i=e.get(B),a=r.getActiveTextRange(),o=i.getCurrentUniverDocInstance();if(o==null)return!1;let s=o.getUnitId(),c=bat(e,s),l=c?{...a,startOffset:c.startOffset,endOffset:c.endOffset,collapsed:c.startOffset===c.endOffset,segmentId:c.segmentId??a?.segmentId??``}:a;if(l==null)return!1;let{drawings:u}=t,{collapsed:d,startOffset:f,segmentId:p=``}=l,m=o.getSelfOrHeaderFooterModel(p).getBody();if(m==null)return!1;let h=new Bv,g=Vv.getInstance(),_=[],v=o.getSnapshot().drawingsOrder?.length??0,y=0;if(d)f>0&&h.push({t:Mm.RETAIN,len:f});else{let e=Ey.selection.delete([l],m,0,null,!1);h.push(...e);let t=aYe(m,[l]),n=o.getDrawings()??{},r=o.getDrawingsOrder()??[],i=t.sort((e,t)=>r.indexOf(e)>r.indexOf(t)?-1:+(r.indexOf(e)<r.indexOf(t)));if(i.length>0)for(let e of i){let t=n[e],i=r.indexOf(e);if(t==null||i<0)continue;let a=g.removeOp([`drawings`,e],t),o=g.removeOp([`drawingsOrder`,i],e);_.push(a),_.push(o),y++}}h.push({t:Mm.INSERT,body:{dataStream:`\b`.repeat(u.length),customBlocks:u.map((e,t)=>({startIndex:t,blockId:e.drawingId}))},len:u.length});let b=lP(o,p),x=g.editOp(h.serialize(),b);_.push(x);for(let e of u){let{drawingId:t}=e,n=g.insertOp([`drawings`,t],e),r=g.insertOp([`drawingsOrder`,v-y],t);_.push(n),_.push(r)}let S={id:uD.id,params:{unitId:s,actions:[],textRanges:[]}};return S.params.actions=_.reduce((e,t)=>Vv.compose(e,t),null),!!n.syncExecuteCommand(S.id,S.params)}};function bat(e,t){try{let n=e.get(sF).consumeInsertRange(t);return n==null?null:{startOffset:n.startOffset,endOffset:n.endOffset,collapsed:n.startOffset===n.endOffset,segmentId:n.segmentId}}catch{return null}}var xat={id:`doc.command.set-drawing-arrange`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(R),r=e.get(aW);if(t==null)return!1;let{unitId:i,subUnitId:a,drawingIds:o,arrangeType:s}=t,c={unitId:i,subUnitId:a,drawingIds:o},l;if(s===lm.forward?l=r.getForwardDrawingsOp(c):s===lm.backward?l=r.getBackwardDrawingOp(c):s===lm.front?l=r.getFrontDrawingsOp(c):s===lm.back&&(l=r.getBackDrawingsOp(c)),l==null)return!1;let{redo:u}=l;if(u==null)return!1;let d=[],f=F.deepClone(u);f=f.slice(3),f.unshift(`drawingsOrder`),d.push(f);let p={id:uD.id,params:{unitId:i,actions:[],textRanges:null}};return p.params.actions=d.reduce((e,t)=>Vv.compose(e,t),null),!!n.syncExecuteCommand(p.id,p.params)}},Sat={id:`doc.command.ungroup-doc-image`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(aW);if(!t)return!1;let r=[];t.forEach(({parent:e,children:t})=>{r.push(e.unitId),t.forEach(e=>{r.push(e.unitId)})});let{unitId:i,subUnitId:a,undo:o,redo:s,objects:c}=n.getUngroupDrawingOp(t);return!1}};function eG(e){"@babel/helpers - typeof";return eG=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},eG(e)}function Cat(e,t){if(eG(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(eG(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function wat(e){var t=Cat(e,`string`);return eG(t)==`symbol`?t:t+``}function tG(e,t,n){return(t=wat(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var nG=class{constructor(){tG(this,`_refreshDrawings$`,new so(null)),tG(this,`refreshDrawings$`,this._refreshDrawings$.asObservable())}refreshDrawings(e){this._refreshDrawings$.next(e)}};function rG(e,t){return function(n,r){t(n,r,e)}}function iG(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var aG=class extends P{constructor(e,t,n,r,i,a,o,s,c,l,u,d,f){super(),this._context=e,this._commandService=t,this._docSelectionManagerService=n,this._renderManagerSrv=r,this._imageIoService=i,this._docDrawingService=a,this._drawingManagerService=o,this._contextService=s,this._messageService=c,this._localeService=l,this._docSelectionRenderService=u,this._docRefreshDrawingsService=d,this._fileOpenerService=f,this._updateOrderListener(),this._groupDrawingListener(),this._focusDrawingListener(),this._transformDrawingListener(),this._editAreaChangeListener()}dispose(){super.dispose(),delete this._context}async insertDocImage(){let e=this._getCurrentImageInsertPosition(),t=await this._fileOpenerService.openFile({multiple:!0,accept:IN.map(e=>`.${e.replace(`image/`,``)}`).join(`,`)}),n=t.length;return n>10?(this._messageService.show({type:Oj.Error,content:this._localeService.t(`docs-drawing-ui.update-status.exceedMaxCount`,`10`)}),!1):n!==0&&(await this._insertFloatImages(t,e),!0)}async _insertFloatImages(e,t){let n=[];try{n=await Promise.all(e.map(e=>this._imageIoService.saveImage(e)))}catch(e){let t=e.message,n=``;switch(t){case lb.ERROR_EXCEED_SIZE:n=this._localeService.t(`docs-drawing-ui.update-status.exceedMaxSize`,String(FN()/1048576));break;case lb.ERROR_IMAGE_TYPE:n=this._localeService.t(`docs-drawing-ui.update-status.invalidImageType`);break;case lb.ERROR_IMAGE:n=this._localeService.t(`docs-drawing-ui.update-status.invalidImage`)}this._messageService.show({type:Oj.Error,content:n})}if(n.length===0)return;let{unitId:r}=this._context,i=[];for(let e of n){if(e==null)continue;let{imageId:n,imageSourceType:a,source:o,base64Cache:s}=e,{width:c,height:l,image:u}=await GN(s||``);this._imageIoService.addImageSourceCache(n,a,u);let d=1;if(c>500||l>500){let e=500/c,t=500/l;d=Math.min(e,t)}let f=t??this._getCurrentImageInsertPosition(),p=this._getImagePosition(c*d,l*d,f);if(p==null)return;let m=ZN(p);m!=null&&f!=null&&(m.top=f.top);let h={unitId:r,subUnitId:r,drawingId:n,drawingType:um.DRAWING_IMAGE,imageSourceType:a,source:o,transform:m,docTransform:p,behindDoc:Np.FALSE,title:``,description:``,layoutType:Kp.INLINE,wrapText:Gp.BOTH_SIDES,distB:0,distL:0,distR:0,distT:0};this._isInsertInHeaderFooter()&&(h.isMultiTransform=Np.TRUE,h.transforms=h.transform?[h.transform]:null),i.push(h)}this._commandService.executeCommand($W.id,{unitId:r,drawings:i})}_isInsertInHeaderFooter(){let{unitId:e}=this._context,t=(this._renderManagerSrv.getRenderById(e)?.with(cD).getViewModel())?.getEditArea();return t===jT.HEADER||t===jT.FOOTER}_getImagePosition(e,t,n){let r=n??this._getCurrentImageInsertPosition()??{left:0,top:0};return{size:{width:e,height:t},positionH:{relativeFrom:nm.PAGE,posOffset:r.left},positionV:{relativeFrom:rm.PARAGRAPH,posOffset:0},angle:0}}_getCurrentImageInsertPosition(){let e=this._docSelectionRenderService.getActiveTextRange()?.getAbsolutePosition();return e==null?null:{left:e.left,top:e.top}}_updateOrderListener(){this.disposeWithMe(this._drawingManagerService.featurePluginOrderUpdate$.subscribe(e=>{let{unitId:t,subUnitId:n,drawingIds:r,arrangeType:i}=e;this._commandService.executeCommand(xat.id,{unitId:t,subUnitId:n,drawingIds:r,arrangeType:i})}))}_groupDrawingListener(){this.disposeWithMe(this._drawingManagerService.featurePluginGroupUpdate$.subscribe(e=>{this._commandService.executeCommand(yat.id,e)})),this.disposeWithMe(this._drawingManagerService.featurePluginUngroupUpdate$.subscribe(e=>{this._commandService.executeCommand(Sat.id,e)}))}_getCurrentSceneAndTransformer(){let{scene:e,mainComponent:t}=this._context;if(e==null||t==null)return;let n=e.getTransformerByCreate(),{docsLeft:r,docsTop:i}=t.getOffsetConfig();return{scene:e,transformer:n,docsLeft:r,docsTop:i}}_transformDrawingListener(){let e=this._getCurrentSceneAndTransformer();if(e&&e.transformer)this.disposeWithMe(e.transformer.changeEnd$.pipe(Ks(30)).subscribe(e=>{this._docSelectionManagerService.refreshSelection()}));else throw Error(`transformer is not init`)}_focusDrawingListener(){this.disposeWithMe(this._drawingManagerService.focus$.subscribe(e=>{let{transformer:t,docsLeft:n,docsTop:r}=this._getCurrentSceneAndTransformer()??{};if(e==null||e.length===0)this._contextService.setContextValue(ab,!1),this._docDrawingService.focusDrawing([]),t&&t.resetProps({zeroTop:0,zeroLeft:0});else{this._contextService.setContextValue(ab,!0),this._docDrawingService.focusDrawing(e),this._setDrawingSelections(e);let i=this._docSelectionRenderService.getSegment(),a=this._findSegmentIdByDrawingId(e[0].drawingId);i!==a&&this._docSelectionRenderService.setSegment(a),t&&t.resetProps({zeroTop:r,zeroLeft:n})}}))}_findSegmentIdByDrawingId(e){let{unit:t}=this._context,{body:n,headers:r={},footers:i={}}=t.getSnapshot();if((n?.customBlocks??[]).some(t=>t.blockId===e))return``;for(let t of Object.keys(r))if(r[t].body.customBlocks?.some(t=>t.blockId===e))return t;for(let t of Object.keys(i))if(i[t].body.customBlocks?.some(t=>t.blockId===e))return t;return``}_updateDrawingsEditStatus(){if(!this._context)return;let{unit:e,scene:t,unitId:n}=this._context,r=this._renderManagerSrv.getRenderById(n)?.with(cD).getViewModel();if(r==null||e==null)return;let{drawings:i={}}=e.getSnapshot(),a=r.getEditArea()===jT.BODY;for(let e of Object.keys(i)){let r=i[e],o=WN({unitId:n,drawingId:r.drawingId,subUnitId:n}),s=t.fuzzyMathObjects(o,!0);if(s.length)for(let e of s){t.detachTransformerFrom(e);try{e.setOpacity(.5)}catch{}if(a&&r.isMultiTransform!==Np.TRUE||!a&&r.isMultiTransform===Np.TRUE){r.allowTransform!==!1&&t.attachTransformerTo(e);try{e.setOpacity(1)}catch{}}}}}_editAreaChangeListener(){let{unitId:e}=this._context,t=this._renderManagerSrv.getRenderById(e)?.with(cD).getViewModel();t!=null&&(this._updateDrawingsEditStatus(),this.disposeWithMe(t.editAreaChange$.subscribe(()=>{this._updateDrawingsEditStatus()})),this.disposeWithMe(this._docRefreshDrawingsService.refreshDrawings$.subscribe(e=>{e!=null&&queueMicrotask(()=>{this._updateDrawingsEditStatus()})})),this.disposeWithMe(this._commandService.onCommandExecuted(async e=>{e.id===uD.id&&queueMicrotask(()=>{this._updateDrawingsEditStatus()})})))}_setDrawingSelections(e){let{unit:t}=this._context,n=t.getSnapshot().body?.customBlocks??[],r=e.map(e=>{let t=e.drawingId,r=n.find(e=>e.blockId===t);return r?r.startIndex:null}).filter(e=>e!==null).map(e=>({startOffset:e,endOffset:e+1}));this._docSelectionManagerService.replaceDocRanges(r)}};aG=iG([rG(1,R),rG(2,j(sD)),rG(3,ZE),rG(4,ub),rG(5,aW),rG(6,LN),rG(7,Fm),rG(8,gM),rG(9,j(nx)),rG(10,j(vI)),rG(11,j(nG)),rG(12,DN)],aG);var Tat={id:`doc.command.insert-float-image`,type:L.COMMAND,handler:e=>{let t=e.get(B),n=e.get(ZE);return QE(M.UNIVER_DOC,t,n)?.with(aG).insertDocImage()??!1}},Eat={inline:Kp.INLINE,wrapSquare:Kp.WRAP_SQUARE,wrapTopAndBottom:Kp.WRAP_TOP_AND_BOTTOM,inFrontOfText:Kp.WRAP_NONE,behindText:Kp.WRAP_NONE};function oG(e,t,n,r){let i=e.skeDrawings.get(t);if(i)return{skeDrawing:i,pageMarginTop:n,pageMarginLeft:r};for(let n of e.skeTables.values())for(let e of n.rows)for(let n of e.cells){let e=oG(n,t,n.marginTop,n.marginLeft);if(e)return e}return null}function Dat(e,t,n,r,i,a,o){var s;let c=new Bv,l=Vv.getInstance(),u=[],d=a.getSelfOrHeaderFooterModel(t).getBody(),f=a.getSelfOrHeaderFooterModel(e).getBody();if(d==null||f==null)return;let p=(s=d.customBlocks)==null||(s=s.find(e=>e.blockId===i))==null?void 0:s.startIndex;if(p!=null){if(r=Math.min(f.dataStream.length-2,r),e===t){if(r<p?(r>0&&c.push({t:Mm.RETAIN,len:r}),c.push({t:Mm.INSERT,body:{dataStream:`\b`,customBlocks:[{startIndex:0,blockId:i}]},len:1}),c.push({t:Mm.RETAIN,len:p-r}),c.push({t:Mm.DELETE,len:1})):(p>0&&c.push({t:Mm.RETAIN,len:p}),c.push({t:Mm.DELETE,len:1}),r-p-1>0&&c.push({t:Mm.RETAIN,len:r-p-1}),c.push({t:Mm.INSERT,body:{dataStream:`\b`,customBlocks:[{startIndex:0,blockId:i}]},len:1})),r!==p){let e=lP(a,t),n=l.editOp(c.serialize(),e);u.push(n)}}else{p>0&&c.push({t:Mm.RETAIN,len:p}),c.push({t:Mm.DELETE,len:1});let s=lP(a,t),d=l.editOp(c.serialize(),s);u.push(d),c.empty(),r>0&&c.push({t:Mm.RETAIN,len:r}),c.push({t:Mm.INSERT,body:{dataStream:`\b`,customBlocks:[{startIndex:0,blockId:i}]},len:1}),s=lP(a,e),d=l.editOp(c.serialize(),s),u.push(d),o.setSegment(e),o.setSegmentPage(n)}return u}}var Oat={id:`doc.command.update-doc-drawing-wrapping-style`,type:L.COMMAND,handler:(e,t)=>{if(t==null)return!1;let{drawings:n,wrappingStyle:r,unitId:i}=t,a=e.get(R),o=e.get(B),s=e.get(ZE).getRenderById(i),c=s?.with(cD).getSkeleton().getSkeletonData(),l=s?.with(cD).getViewModel(),u=s?.scene,d=o.getCurrentUniverDocInstance();if(d==null||c==null||u==null||l==null)return!1;let f=l.getEditArea(),p=u.getTransformerByCreate(),{pages:m,skeHeaders:h,skeFooters:g}=c,_=Vv.getInstance(),v=[],{drawings:y={}}=d.getSnapshot();for(let e of n){let{drawingId:t}=e,n=y[t].layoutType,i=Eat[r];if(n!==i){let e=_.replaceOp([`drawings`,t,`layoutType`],n,i);v.push(e)}if(r===`behindText`||r===`inFrontOfText`){let e=y[t].behindDoc,n=r===`behindText`?Np.TRUE:Np.FALSE;if(e!==n){let r=_.replaceOp([`drawings`,t,`behindDoc`],e,n);v.push(r)}}if(r===`inline`)continue;let a=null;for(let e of m){let{headerId:n,footerId:r,marginTop:i,marginLeft:o,marginBottom:s,pageWidth:c,pageHeight:l}=e;switch(f){case jT.HEADER:{let e=h.get(n)?.get(c);e!=null&&(a=oG(e,t,e.marginTop,o));break}case jT.FOOTER:{let e=g.get(r)?.get(c);e!=null&&(a=oG(e,t,l-s+e.marginTop,o));break}case jT.BODY:a=oG(e,t,i,o)}if(a!=null)break}if(a!=null){let{skeDrawing:e,pageMarginTop:n,pageMarginLeft:r}=a,{aTop:i,aLeft:o}=e,s=y[t].docTransform.positionH,c=o;s.relativeFrom===nm.MARGIN?c-=r:s.relativeFrom===nm.COLUMN&&(c-=e.columnLeft);let l={relativeFrom:s.relativeFrom,posOffset:c};if(s.posOffset!==l.posOffset){let e=_.replaceOp([`drawings`,t,`docTransform`,`positionH`],s,l);v.push(e)}let u=y[t].docTransform.positionV,d=i;u.relativeFrom===rm.PAGE?d+=n:u.relativeFrom===rm.LINE?d-=e.lineTop:u.relativeFrom===rm.PARAGRAPH&&(d-=e.blockAnchorTop);let f={relativeFrom:u.relativeFrom,posOffset:d};if(u.posOffset!==f.posOffset){let e=_.replaceOp([`drawings`,t,`docTransform`,`positionV`],u,f);v.push(e)}}}let b={id:uD.id,params:{unitId:i,actions:[],textRanges:null}};b.params.actions=v.reduce((e,t)=>Vv.compose(e,t),null);let x=a.syncExecuteCommand(b.id,b.params);return p.refreshControls(),!!x}},kat={id:`doc.command.update-doc-drawing-distance`,type:L.COMMAND,handler:(e,t)=>{if(t==null)return!1;let n=e.get(R),r=e.get(B).getCurrentUniverDocInstance();if(r==null)return!1;let{drawings:i,dist:a,unitId:o}=t,s=Vv.getInstance(),c=[],{drawings:l={}}=r.getSnapshot();for(let e of i){let{drawingId:t}=e;for(let[e,n]of Object.entries(a)){let r=l[t][e];if(r!==n){let i=s.replaceOp([`drawings`,t,e],r,n);c.push(i)}}}let u={id:uD.id,params:{unitId:o,actions:[],textRanges:null}};return u.params.actions=c.reduce((e,t)=>Vv.compose(e,t),null),!!n.syncExecuteCommand(u.id,u.params)}},Aat={id:`doc.command.update-doc-drawing-wrap-text`,type:L.COMMAND,handler:(e,t)=>{if(t==null)return!1;let n=e.get(R),r=e.get(B).getCurrentUniverDocInstance();if(r==null)return!1;let{drawings:i,wrapText:a,unitId:o}=t,s=Vv.getInstance(),c=[],{drawings:l={}}=r.getSnapshot();for(let e of i){let{drawingId:t}=e,n=l[t].wrapText;if(n!==a){let e=s.replaceOp([`drawings`,t,`wrapText`],n,a);c.push(e)}}let u={id:uD.id,params:{unitId:o,actions:[],textRanges:null}};return u.params.actions=c.reduce((e,t)=>Vv.compose(e,t),null),!!n.syncExecuteCommand(u.id,u.params)}},sG={id:`doc.command.update-drawing-doc-transform`,type:L.COMMAND,handler:(e,t)=>{if(t==null)return!1;let n=e.get(R),r=e.get(B),i=e.get(ZE).getRenderById(t.unitId)?.scene;if(i==null)return!1;let a=i.getTransformerByCreate(),o=r.getCurrentUniverDocInstance();if(o==null)return!1;let{drawings:s,unitId:c}=t,l=Vv.getInstance(),u=[],{drawings:d={}}=o.getSnapshot();for(let e of s){let{drawingId:t,key:n,value:r}=e,i=d[t].docTransform[n];if(!F.diffValue(i,r)){let e=l.replaceOp([`drawings`,t,`docTransform`,n],i,r);u.push(e)}}let f={id:uD.id,params:{unitId:c,actions:[],textRanges:null,debounce:!0}};f.params.actions=u.reduce((e,t)=>Vv.compose(e,t),null);let p=n.syncExecuteCommand(f.id,f.params);return a.refreshControls(),!!p}},jat={id:`doc.command.move-inline-drawing`,type:L.COMMAND,handler:(e,t)=>{if(t==null)return!1;let n=e.get(ZE),r=n.getRenderById(t.unitId)?.with(vI),i=e.get(nG),a=n.getRenderById(t.unitId),o=a?.scene,s=a?.with(cD).getSkeleton();if(o==null||r==null)return!1;let c=o.getTransformerByCreate(),l=e.get(R),u=e.get(B).getCurrentUniverDocInstance();if(u==null)return!1;let{drawing:d,unitId:f,offset:p,segmentId:m,segmentPage:h,needRefreshDrawings:g}=t;if(g)return i.refreshDrawings(s),c.refreshControls(),!0;let _=[],{drawingId:v}=d,y=Dat(m,r.getSegment()??``,h,p,v,u,r);if(y==null||y.length===0)return i.refreshDrawings(s),c.refreshControls(),!1;_.push(...y);let b={id:uD.id,params:{unitId:f,actions:[],textRanges:null}};b.params.actions=_.reduce((e,t)=>Vv.compose(e,t),null);let x=l.syncExecuteCommand(b.id,b.params);return c.refreshControls(),!!x}},Mat={id:`doc.command.transform-non-inline-drawing`,type:L.COMMAND,handler:(e,t)=>{if(t==null)return!1;let n=e.get(ZE),r=n.getRenderById(t.unitId)?.with(vI),i=n.getRenderById(t.unitId)?.scene;if(i==null||r==null)return!1;let a=i.getTransformerByCreate(),o=e.get(R),s=e.get(B).getCurrentUniverDocInstance();if(s==null)return!1;let{drawing:c,unitId:l,offset:u,docTransform:d,segmentId:f,segmentPage:p}=t,m=[],{drawingId:h}=c,g=Dat(f,r.getSegment()??``,p,u,h,s,r);if(g==null)return!1;g.length>0&&m.push(...g);let _=Vv.getInstance(),{drawings:v={}}=s.getSnapshot(),{positionH:y,positionV:b,size:x,angle:S}=v[h].docTransform;if(!F.diffValue(y,d.positionH)){let e=_.replaceOp([`drawings`,h,`docTransform`,`positionH`],y,d.positionH);m.push(e)}if(!F.diffValue(b,d.positionV)){let e=_.replaceOp([`drawings`,h,`docTransform`,`positionV`],b,d.positionV);m.push(e)}if(!F.diffValue(x,d.size)){let e=_.replaceOp([`drawings`,h,`docTransform`,`size`],x,d.size);m.push(e)}if(!F.diffValue(S,d.angle)){let e=_.replaceOp([`drawings`,h,`docTransform`,`angle`],S,d.angle);m.push(e)}let C={id:uD.id,params:{unitId:l,actions:[],textRanges:null,debounce:!0}};C.params.actions=m.reduce((e,t)=>Vv.compose(e,t),null);let w=o.syncExecuteCommand(C.id,C.params);return a.refreshControls(),!!w}},cG={id:`doc.command.move-drawing`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(R),r=e.get(aW),i=e.get(B),a=e.get(ZE),{direction:o}=t,s=r.getFocusDrawings();if(s.length===0)return!1;let c=s[0].unitId,l=a.getRenderById(c)?.scene;if(l==null)return!1;let u=l.getTransformerByCreate(),d=i.getUniverDocInstance(c),f=s.map(e=>{var t;let{drawingId:n}=e,r=d==null||(t=d.getSnapshot().drawings)==null?void 0:t[n];if(r==null||r.layoutType===Kp.INLINE)return null;let{positionH:i,positionV:a}=r.docTransform,s={...i},c={...a};return o===I.UP?c.posOffset=(c.posOffset??0)-2:o===I.DOWN?c.posOffset=(c.posOffset??0)+2:o===I.LEFT?s.posOffset=(s.posOffset??0)-2:o===I.RIGHT&&(s.posOffset=(s.posOffset??0)+2),{drawingId:n,key:o===I.UP||o===I.DOWN?`positionV`:`positionH`,value:o===I.UP||o===I.DOWN?c:s}}).filter(e=>e!=null);if(f.length===0)return!1;let p=n.syncExecuteCommand(sG.id,{unitId:c,subUnitId:c,drawings:f});return u.refreshControls(),!!p}},Nat={id:`doc.operation.clear-drawing-transformer`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(ZE);return t.forEach(e=>{var t;(t=n.getRenderById(e))==null||(t=t.scene.getTransformer())==null||t.debounceRefreshControls()}),!0}},Pat=`COMPONENT_DOC_DRAWING_PANEL`,lG={id:`sidebar.operation.doc-image`,type:L.COMMAND,handler:async(e,t)=>{let n=e.get(Kj),r=e.get(nx),i=e.get(LN);switch(t.value){case`open`:n.open({header:{title:r.t(`docs-drawing-ui.panel.title`)},children:{label:Pat},onClose:()=>{i.focusDrawing(null)},width:360});break;default:n.close()}return!0}},uG={id:`doc.operation.edit-doc-image`,type:L.OPERATION,handler:(e,t)=>{let n=e.get(LN),r=e.get(R);return t!=null&&(n.focusDrawing([t]),r.executeCommand(lG.id,{value:`open`}),!0)}};function Fat(e,t,n=1,r=0){let{top:i,left:a,bottom:o,right:s}=e,c=s-a,l=o-i,{viewportScrollX:u,viewportScrollY:d}=t.getViewport(KN.VIEW_MAIN),{scaleX:f,scaleY:p}=t.getAncestorScale();return{startX:(a-u)*f,startY:(i-d)*p,endX:(a+c-u)*f,endY:(i+l-d)*p,width:c*f,height:l*p,rotate:r,absolute:{left:!1,top:!1},opacity:n??1}}function dG(e,t){let{top:n,left:r,width:i,height:a,angle:o,opacity:s}=e;return Fat({top:n,left:r,bottom:n+a,right:r+i},t.scene,s,o)}var fG=class extends P{constructor(e,t,n,r,i,a){super(),this._renderManagerService=e,this._drawingManagerService=t,this._drawingRenderService=n,this._canvasFloatDomService=r,this._univerInstanceService=i,this._commandService=a,tG(this,`_domLayerInfoMap`,new Map),this._initialize()}dispose(){super.dispose()}_initialize(){this._drawingAddRemoveListener(),this._initScrollAndZoomEvent()}_getSceneAndTransformerByDrawingSearch(e){if(e==null)return;let t=this._renderManagerService.getRenderById(e);if(t==null)return null;let n=t.scene;return{scene:n,transformer:n.getTransformerByCreate(),renderUnit:t,canvas:t.engine.getCanvasElement()}}_drawingAddRemoveListener(){this.disposeWithMe(this._drawingManagerService.add$.subscribe(e=>{this._insertRects(e)})),this.disposeWithMe(this._drawingManagerService.remove$.subscribe(e=>{e.forEach(e=>{this._removeDom(e.drawingId)})}))}_insertRects(e){e.forEach(async e=>{let{unitId:t}=e;if(!this._univerInstanceService.getUnit(t,M.UNIVER_DOC))return;let n=this._getSceneAndTransformerByDrawingSearch(t);if(n==null)return;let r=this._drawingManagerService.getDrawingByParam(e);if(r==null)return;let i=await this._drawingRenderService.renderFloatDom(r,n.scene);if(i!=null&&i.length!==0)for(let e of i){this._addHoverForRect(e);let i=new Gf,a=new so(dG(e,n.renderUnit)),o=n.canvas,s=r.data,c={dispose:i,rect:e,position$:a,unitId:t};this._canvasFloatDomService.addFloatDom({position$:a,id:r.drawingId,componentKey:r.componentKey,onPointerDown:e=>{o.dispatchEvent(new PointerEvent(e.type,e))},onPointerMove:e=>{o.dispatchEvent(new PointerEvent(e.type,e))},onPointerUp:e=>{o.dispatchEvent(new PointerEvent(e.type,e))},onWheel:e=>{o.dispatchEvent(new WheelEvent(e.type,e))},data:s,unitId:t});let l=e.onTransformChange$.subscribeEvent(()=>{let t=dG(e,n.renderUnit);a.next(t)});i.add(()=>{this._canvasFloatDomService.removeFloatDom(r.drawingId)}),l&&i.add(l),this._domLayerInfoMap.set(r.drawingId,c)}})}_addHoverForRect(e){this.disposeWithMe(Wf(e.onPointerEnter$.subscribeEvent(()=>{e.cursor=_w.GRAB}))),this.disposeWithMe(Wf(e.onPointerLeave$.subscribeEvent(()=>{e.cursor=_w.DEFAULT})))}_removeDom(e){let t=this._domLayerInfoMap.get(e);if(!t)return;let{unitId:n}=t;this._domLayerInfoMap.delete(e),t.dispose.dispose();let r=this._getSceneAndTransformerByDrawingSearch(n);r&&r.scene.removeObject(t.rect)}_initScrollAndZoomEvent(){let e=e=>{let t=this._getSceneAndTransformerByDrawingSearch(e);t&&this._domLayerInfoMap.forEach(n=>{if(n.unitId!==e)return;let r=dG(n.rect,t.renderUnit);n.position$.next(r)})};this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(M.UNIVER_DOC).pipe(os(e=>{if(!e)return null;let t=e.getUnitId(),n=this._renderManagerService.getRenderById(t);return n?{render:n,unitId:t}:null}),sc(e=>e?zy(e.render.scene.getViewport(KN.VIEW_MAIN).onScrollAfter$).pipe(os(()=>({unitId:e.unitId}))):ts(null))).subscribe(t=>{if(!t)return;let{unitId:n}=t;e(n)})),this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(t.id===WF.id){let{unitId:n}=t.params;e(n)}}))}insertFloatDom(e,t){let n=this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_DOC);if(!n)return!1;let r=this._getSceneAndTransformerByDrawingSearch(n.getUnitId());if(!r)return!1;let i=r.renderUnit.with(cD).getSkeleton().getSkeletonData()?.pages[0];if(!i)return!1;let{pageWidth:a,marginLeft:o,marginRight:s}=i,c=a-o-s,l={size:{width:t.width??c,height:t.height},positionH:{relativeFrom:nm.PAGE,posOffset:0},positionV:{relativeFrom:rm.PAGE,posOffset:0},angle:0},u=t.drawingId??ip(),d={unitId:n.getUnitId(),drawings:[{drawingId:u,drawingType:um.DRAWING_DOM,subUnitId:n.getUnitId(),unitId:n.getUnitId(),...e,title:``,description:``,docTransform:l,layoutType:Kp.INLINE,transform:ZN(l)}]};return this._commandService.syncExecuteCommand($W.id,d),u}};fG=iG([rG(0,ZE),rG(1,LN),rG(2,j(JW)),rG(3,j(zM)),rG(4,B),rG(5,R)],fG);var Iat=`doc.menu.image`,pG=Tat.id,Lat=e=>{let t=e.get(sD),n=e.get(B);return new Ya(e=>{let r=t.textSelection$.subscribe(()=>{let r=t.getActiveTextRange();if(r){var i;let{segmentId:t,startOffset:a,endOffset:o}=r,s=n.getCurrentUniverDocInstance(),c=s==null||(i=s.getSelfOrHeaderFooterModel(t).getBody())==null?void 0:i.tables;if(c&&c.length&&c.some(e=>{let{startIndex:t,endIndex:n}=e;return a>=t&&a<n||o>=t&&o<n})){e.next(!0);return}}else{e.next(!0);return}e.next(!1)});return()=>r.unsubscribe()})};function Rat(e){return{id:Iat,type:IM.SUBITEMS,icon:`AddImageIcon`,tooltip:`docs-drawing-ui.title`,disabled$:Lat(e),hidden$:Xj(e,M.UNIVER_DOC,void 0,rf)}}function mG(e){return{id:pG,title:`docs-drawing-ui.upload.float`,type:IM.BUTTON,icon:`AddImageIcon`,hidden$:Xj(e,M.UNIVER_DOC,void 0,rf)}}var zat=`@univerjs/docs-drawing-ui`,Bat=`0.25.1`,Vat=`docs-drawing-ui.config`,Hat={};function Uat(e){if(Vv.isNoop(e)||!Array.isArray(e))return null;let t=e.find(e=>Array.isArray(e)&&e?.[0]===`drawings`);if(t==null||!Array.isArray(t)||t.length<3||typeof t[1]==`string`&&typeof t[2]!=`object`||Array.isArray(t[1])&&typeof t[1][1]!=`object`)return null;let n=[];if(Array.isArray(t?.[1])){for(let e of t)if(Array.isArray(e)){var r,i;n.push({type:e!=null&&(r=e[1])!=null&&r.i?`add`:`remove`,drawingId:e?.[0],drawing:e==null||(i=e[1])==null?void 0:i.i})}}else n.push({type:t[2]?.i?`add`:`remove`,drawingId:t[1],drawing:t[2]?.i});return n}function Wat(e){if(!Array.isArray(e)||e.length<3||e[0]!==`drawingsOrder`)return[];let t=[];for(let n=1;n<e.length;n++){let r=e[n];if(Array.isArray(r)&&typeof r[0]==`number`&&typeof r[1]==`object`)t.push(r[0]);else{t.length=0;break}}return t}var hG=class extends P{constructor(e,t,n,r,i){super(),this._univerInstanceService=e,this._commandService=t,this._drawingManagerService=n,this._docDrawingService=r,this._renderManagerService=i,this._initialize()}_initialize(){this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{if(e.id!==uD.id)return;let{unitId:t,actions:n,isSync:r,syncer:i}=e.params,a=Uat(n);if(a!=null)for(let{type:e,drawingId:n,drawing:o}of a)r&&o?.unitId===i||(e===`add`?this._addDrawings(t,[o]):this._removeDrawings(t,[n]))})),this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id!==uD.id)return;let{unitId:t,actions:n}=e.params;Wat(n).length>0&&this._updateDrawingsOrder(t)})),this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id!==Cx.id&&e.id!==wx.id)return;let t=this._univerInstanceService.getCurrentUniverDocInstance()?.getUnitId(),n=this._drawingManagerService.getFocusDrawings();if(t==null||n.length===0)return;let r=this._renderManagerService.getRenderById(t)?.scene;if(r==null)return!1;r.getTransformerByCreate().refreshControls()}))}_addDrawings(e,t){let n=this._drawingManagerService,r=this._docDrawingService,{subUnitId:i,redo:a,objects:o}=this._docDrawingService.getBatchAddOp(t);n.applyJson1(e,i,a),r.applyJson1(e,i,a),n.addNotification(o),r.addNotification(o)}_removeDrawings(e,t){let n=this._drawingManagerService,r=this._docDrawingService,{subUnitId:i,redo:a,objects:o}=this._docDrawingService.getBatchRemoveOp(t.map(t=>({unitId:e,subUnitId:e,drawingId:t})));n.applyJson1(e,i,a),r.applyJson1(e,i,a),n.removeNotification(o),r.removeNotification(o)}_updateDrawingsOrder(e){let t=this._univerInstanceService.getUniverDocInstance(e);if(t==null)return;let n=t.getSnapshot().drawingsOrder;if(n==null)return;let r=this._drawingManagerService,i=this._docDrawingService;r.setDrawingOrder(e,e,n),i.setDrawingOrder(e,e,n);let a={unitId:e,subUnitId:e,drawingIds:n};r.orderNotification(a),i.orderNotification(a)}};hG=iG([rG(0,B),rG(1,R),rG(2,LN),rG(3,aW),rG(4,ZE)],hG);var Gat=e=>{let{floatDomInfos:t,scene:n,offset:r,bound:i}=e,a=i.right-i.left,o=i.bottom-i.top;return(0,U.jsx)(`div`,{className:`univer-absolute univer-left-0 univer-top-0`,children:(0,H.useMemo)(()=>t.map(e=>{let{width:t=0,height:r=0,left:i=0,top:a=0}=e.transform,o=Fat({left:i,right:i+t,top:a,bottom:a+r},n),s={position$:new so(o),position:o,id:e.drawingId,componentKey:e.componentKey,onPointerMove:()=>{},onPointerDown:()=>{},onPointerUp:()=>{},onWheel:()=>{},unitId:e.unitId,data:e.data};return[e.drawingId,s]}).filter(([e,t])=>!(t.position.endX<0||t.position.endY<0||t.position.startX>a||t.position.startY>o)),[t,n,r,a,o]).map(([e,t])=>(0,U.jsx)(OJe,{layer:t,id:e,position:t.position},e))})},gG=class extends P{constructor(e,t,n,r,i){super(),this._docPrintInterceptorService=e,this._drawingRenderService=t,this._drawingManagerService=n,this._componetManager=r,this._injector=i,this._initPrinting(),this._initPrintingDom()}_initPrinting(){this.disposeWithMe(this._docPrintInterceptorService.interceptor.intercept(this._docPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_COMPONENT_COLLECT,{handler:(e,t,n)=>{let{unitId:r,scene:i}=t,a=this._drawingManagerService.getDrawingDataForUnit(r)?.[r];return a&&a.order.forEach(e=>{let t=a.data[e];t.drawingType!==um.DRAWING_CHART&&t.drawingType!==um.DRAWING_DOM&&this._drawingRenderService.renderDrawing(t,i)}),n()}}))}_initPrintingDom(){this.disposeWithMe(this._docPrintInterceptorService.interceptor.intercept(this._docPrintInterceptorService.interceptor.getInterceptPoints().PRINTING_DOM_COLLECT,{handler:(e,t,n)=>{let{unitId:r}=t,i=this._drawingManagerService.getDrawingDataForUnit(r)?.[r];if(i){let a=i.order.map(e=>{let t=i.data[e];if(t.drawingType===um.DRAWING_CHART)return{...t,componentKey:this._componetManager.get(Tm)};if(t.drawingType===um.DRAWING_DOM){let e=this._docPrintInterceptorService.getPrintComponent(t.componentKey);return{...t,componentKey:this._componetManager.get(e||t.componentKey)}}return null}).filter(Boolean);return Rj((0,U.jsx)(tO(Gat,this._injector),{unitId:r,floatDomInfos:a,scene:t.scene,skeleton:t.skeleton,offset:t.offset,bound:t.bound}),t.root),e?.add(()=>{zj(t.root)}),n(e)}}}))}};gG=iG([rG(0,j(p2e)),rG(1,j(JW)),rG(2,LN),rG(3,j(Yj)),rG(4,j(We))],gG);function Kat(e,t,n,r){let i=XT(t.tableId).tableId,a=kT(e,i),o=a&&a.contentWidth>a.viewportWidth?a.scrollLeft:0;return{left:t.left+r.left-o+r.marginLeft,top:t.top+n.top+r.marginTop}}var _G=class extends P{constructor(e,t,n,r,i,a,o,s){super(),this._context=e,this._docSkeletonManagerService=t,this._commandService=n,this._editorService=r,this._drawingManagerService=i,this._docRefreshDrawingsService=a,this._univerInstanceService=o,this._lifecycleService=s,tG(this,`_liquid`,new OT),this._initialize(),this._commandExecutedListener()}_initialize(){this._initialRenderRefresh(),this._drawingInitializeListener(),this._initResize()}_initialRenderRefresh(){this.disposeWithMe(this._docSkeletonManagerService.currentSkeleton$.subscribe(e=>{e!=null&&this._refreshDrawing(e)})),this.disposeWithMe(this._docRefreshDrawingsService.refreshDrawings$.subscribe(e=>{e!=null&&this._refreshDrawing(e)}))}_commandExecutedListener(){let e=[uD.id,WF.id];this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(e.includes(t.id)){let{unitId:e}=t.params,{unitId:n,mainComponent:r}=this._context;if(e!==n)return;let i=this._docSkeletonManagerService.getSkeleton();if(i==null)return;if(this._editorService.isEditor(n)&&n!==rf){r?.makeDirty();return}this._refreshDrawing(i)}}))}_initResize(){this.disposeWithMe(zy(this._context.engine.onTransformChange$).pipe(Ls(e=>e.type===Xw.resize),Ks(16)).subscribe(()=>{var e;let t=this._docSkeletonManagerService.getSkeleton(),{scene:n}=this._context;(e=n.getTransformer())==null||e.refreshControls(),this._refreshDrawing(t)}))}_refreshDrawing(e){let t=e?.getSkeletonData(),{mainComponent:n,unitId:r}=this._context,i=n;if(!t)return;let{left:a,top:o,pageLayoutType:s,pageMarginLeft:c,pageMarginTop:l}=i,{pages:u,skeHeaders:d,skeFooters:f}=t,p={};this._liquid.reset();for(let e=0,t=u.length;e<t;e++){let t=u[e],{headerId:n,footerId:i,pageWidth:m}=t;if(n){let e=d.get(n)?.get(m);e&&(this._calculateDrawingPosition(r,e,a,o,p,e.marginTop,t.marginLeft),this._calculateTableCellDrawingPositions(r,e,a,o,p,e.marginTop,t.marginLeft))}if(i){let e=f.get(i)?.get(m);if(e){let n=t.pageHeight-t.marginBottom+e.marginTop;this._calculateDrawingPosition(r,e,a,o,p,n,t.marginLeft),this._calculateTableCellDrawingPositions(r,e,a,o,p,n,t.marginLeft)}}this._calculateDrawingPosition(r,t,a,o,p,t.marginTop,t.marginLeft),this._calculateTableCellDrawingPositions(r,t,a,o,p,t.marginTop,t.marginLeft),this._liquid.translatePage(t,s,c,l)}let m=Object.values(p),h=m.filter(e=>!e.isMultiTransform),g=m.filter(e=>e.isMultiTransform);h.length>0&&this._drawingManagerService.refreshTransform(h),this._handleMultiDrawingsTransform(g)}_handleMultiDrawingsTransform(e){let{scene:t,unitId:n}=this._context,r=t.getTransformerByCreate();e.forEach(e=>{let t=this._drawingManagerService.getDrawingByParam(e);t!=null&&(t.transform=e.transform,t.transforms=e.transforms,t.isMultiTransform=e.isMultiTransform)});let i=[...r.getSelectedObjectMap().keys()],a=Object.values(this._drawingManagerService.getDrawingData(n,n)).filter(e=>e.isMultiTransform===Np.TRUE);this._drawingManagerService.removeNotification(a),e.length>0&&this._drawingManagerService.addNotification(e);for(let e of i){let n=t.getObject(e);n&&r.setSelectedControl(n)}}_calculateDrawingPosition(e,t,n,r,i,a,o){let{skeDrawings:s}=t;this._liquid.translatePagePadding({marginTop:a,marginLeft:o}),s.forEach(t=>{let{aLeft:a,aTop:o,height:s,width:c,angle:l,drawingId:u,drawingOrigin:d}=t,f=d.layoutType===Kp.WRAP_NONE&&d.behindDoc===Np.TRUE,{isMultiTransform:p=Np.FALSE}=d,m={left:a+n+this._liquid.x,top:o+r+this._liquid.y,width:c,height:s,angle:l};i[u]==null?i[u]={unitId:e,subUnitId:e,drawingId:u,behindText:f,transform:m,transforms:[m],isMultiTransform:p}:p===Np.TRUE&&i[u].transforms.push(m)}),this._liquid.restorePagePadding({marginTop:a,marginLeft:o})}_calculateTableCellDrawingPositions(e,t,n,r,i,a,o){var s;(s=t.skeTables)==null||s.forEach(t=>{t.rows.forEach(s=>{s.cells.forEach(c=>{let l=Kat(e,t,s,c),u=a+l.top,d=o+l.left;this._calculateDrawingPosition(e,c,n,r,i,u,d),this._calculateTableCellDrawingPositions(e,c,n,r,i,u,d)})})})}_drawingInitializeListener(){let e=()=>{let e=this._docSkeletonManagerService.getSkeleton();e!=null&&(this._refreshDrawing(e),this._drawingManagerService.initializeNotification(this._context.unitId))};this._lifecycleService.stage>=Xb.Rendered?this._docSkeletonManagerService.getSkeleton()?e():setTimeout(e,500):this.disposeWithMe(this._lifecycleService.lifecycle$.pipe(Ls(e=>e===Xb.Rendered)).subscribe(e))}};_G=iG([rG(1,j(cD)),rG(2,R),rG(3,FI),rG(4,LN),rG(5,j(nG)),rG(6,B),rG(7,j($b))],_G);var qat=`__InlineDrawingAnchor__`;function Jat(e,t){let n=t.parent,r=n?.parent,i=r?.parent;return!n||!r||!i||!n.cells?.includes(t)?null:{cell:t,hostPage:i,offset:Kat(e,r,n,t),row:n,table:r}}var vG=class extends P{constructor(e,t,n,r){super(),this._commandService=e,this._univerInstanceService=t,this._drawingManagerService=n,this._renderManagerService=r,tG(this,`_liquid`,new OT),tG(this,`_listenerOnImageMap`,new Set),tG(this,`_transformerCache`,new Map),tG(this,`_anchorShape`,void 0),this._init()}_init(){this._listenDrawingFocus()}_listenDrawingFocus(){this.disposeWithMe(this._drawingManagerService.add$.subscribe(e=>{if(e.length!==0)for(let t of e){let{unitId:e}=t;this._listenerOnImageMap.has(e)||(this._listenTransformerChange(e),this._listenerOnImageMap.add(e))}}))}_listenTransformerChange(e){let t=this._getSceneAndTransformerByDrawingSearch(e)?.transformer;if(t==null)return;this.disposeWithMe(Wf(t.changeStart$.subscribe(e=>{this._transformerCache.clear();let{objects:t}=e;for(let e of t.values()){var n;let{oKey:t,width:r,height:i,left:a,top:o,angle:s}=e,c=this._drawingManagerService.getDrawingOKey(t);if(c==null)continue;let l=this._univerInstanceService.getUniverDocInstance(c.unitId),u=l==null||(n=l.getSnapshot().drawings)==null?void 0:n[c.drawingId];if(u?.layoutType===Kp.INLINE)try{e.setOpacity(.2)}catch{}u!=null&&this._transformerCache.set(c.drawingId,{drawing:u,top:o,left:a,width:r,height:i,angle:s})}})));let n=_f(this._updateMultipleDrawingDocTransform.bind(this),50);this._nonInlineDrawingTransform.bind(this),this.disposeWithMe(Wf(t.changing$.subscribe(e=>{let{objects:t,offsetX:r,offsetY:i}=e;if(t.size>1)n(t);else if(t.size===1){let e=this._transformerCache.values().next().value,{width:n,height:a,top:o,left:s,angle:c}=t.values().next().value;if(e&&n===e.width&&a===e.height&&o===e.top&&s===e.left&&c===e.angle)return;e&&(e.drawing.layoutType,Kp.INLINE),e&&e.drawing.layoutType===Kp.INLINE&&r!=null&&i!=null&&this._updateInlineDrawingAnchor(e.drawing,r,i)}}))),this.disposeWithMe(Wf(t.changeEnd$.subscribe(e=>{let{objects:t,offsetX:n,offsetY:r}=e;for(let e of t.values()){let t=this._drawingManagerService.getDrawingOKey(e.oKey);if(t!=null&&this._transformerCache.get(t?.drawingId)?.drawing.layoutType===Kp.INLINE)try{e.setOpacity(1)}catch{}}if(this._anchorShape&&this._anchorShape.hide(),t.size>1)this._updateMultipleDrawingDocTransform(t);else if(t.size===1){let e=this._transformerCache.values().next().value,i=t.values().next().value,{width:a,height:o,top:s,left:c,angle:l}=i;if(e&&a===e.width&&o===e.height&&s===e.top&&c===e.left&&l===e.angle)return;e&&e.drawing.layoutType===Kp.INLINE?a!==e.width||o!==e.height||l!==e.angle?this._updateDrawingSize(e,i):n!=null&&r!=null&&this._moveInlineDrawing(e.drawing,n,r):e&&this._nonInlineDrawingTransform(e.drawing,i)}this._transformerCache.clear()})))}_updateMultipleDrawingDocTransform(e){if(e.size<1)return;let t=[],n,r;for(let i of e.values()){let{oKey:e,left:a,top:o,angle:s}=i,{width:c,height:l}=i,u=this._drawingManagerService.getDrawingOKey(e);if(u==null)continue;n??=u.unitId,r??=u.subUnitId;let d=this._transformerCache.get(u.drawingId);if(d==null)continue;let{drawing:f,top:p,left:m,width:h,height:g,angle:_}=d,{width:v,height:y}=this._getPageContentSize(f);if(c=Math.min(c,v),l=Math.min(l,y),(h!==c||g!==l)&&t.push({drawingId:u.drawingId,key:`size`,value:{width:c,height:l}}),_!==s&&t.push({drawingId:u.drawingId,key:`angle`,value:s}),p!==o||m!==a){let e=o-p,n=a-m;e!==0&&t.push({drawingId:u.drawingId,key:`positionV`,value:{relativeFrom:f.docTransform.positionV.relativeFrom,posOffset:f.docTransform.positionV.posOffset+e}}),n!==0&&t.push({drawingId:u.drawingId,key:`positionH`,value:{relativeFrom:f.docTransform.positionH.relativeFrom,posOffset:f.docTransform.positionH.posOffset+n}})}}t.length>0&&n&&r&&this._commandService.executeCommand(sG.id,{unitId:n,subUnitId:r,drawings:t})}_updateDrawingAnchor(e){if(this._transformerCache.size!==1)return;let t=this._transformerCache.values().next().value,n=e.values().next().value;this._getDrawingAnchor(t.drawing,n)}_updateInlineDrawingAnchor(e,t,n){if(this._transformerCache.size!==1)return;let{contentBoxPointGroup:r}=this._getInlineDrawingAnchor(e,t,n)??{};r!=null&&this._createOrUpdateInlineAnchor(e.unitId,r)}_getInlineDrawingAnchor(e,t,n){let r=this._renderManagerService.getRenderById(e.unitId),i=r?.with(cD).getSkeleton();if(r==null)return;let{mainComponent:a,scene:o}=r,s=a,c=o.getViewports()[0],{pageLayoutType:l=Vw.VERTICAL,pageMarginLeft:u,pageMarginTop:d}=s.getOffsetConfig(),f=null,p=!1,m=-1,h=``,g=this._getTransformCoordForDocumentOffset(s,c,t,n);if(g==null)return;let _=this._renderManagerService.getRenderById(e.unitId)?.with(vI);if(_==null)return;let v=i?.findNodeByCoord(g,l,u,d,{strict:!1,segmentId:_.getSegment(),segmentPage:_.getSegmentPage()});if(v){let{node:e,ratioX:t,segmentPage:n,segmentId:r}=v;p=t<.5,f=e,m=n,h=r}if(f==null)return;let y=i?.findPositionByGlyph(f,m),b=this._getDocObject();if(y==null||i==null||b==null)return;let x={...y,isBack:p},{cursorList:S,contentBoxPointGroup:C}=new cI(b.document.getOffsetConfig(),i).getRangePointData(x,x),{startOffset:w}=oI(S)??{};if(w!=null)return{offset:w,contentBoxPointGroup:C,segmentId:h,segmentPage:m}}_getDrawingAnchor(e,t){var n;let r=this._renderManagerService.getRenderById(e.unitId),i=r?.with(cD).getSkeleton(),a=i?.getSkeletonData();if(a==null||r==null)return;let{pages:o,skeHeaders:s,skeFooters:c}=a,{mainComponent:l,scene:u}=r,d=l,f=u.getViewports()[0],{pageLayoutType:p=Vw.VERTICAL,pageMarginLeft:m,pageMarginTop:h,docsLeft:g,docsTop:_}=d.getOffsetConfig(),{left:v,top:y,angle:b}=t,{width:x,height:S}=t,{positionV:C,positionH:w}=e.docTransform,{width:T,height:E}=this._getPageContentSize(e);x=Math.min(x,T),S=Math.min(S,E);let D=null,O=``,k=-1,A={...e.docTransform,size:{width:x,height:S},angle:b},{x:ee,y:te}=u.getViewportScrollXY(f),ne=this._getTransformCoordForDocumentOffset(d,f,v-ee,y-te);if(ne==null)return;let re=this._renderManagerService.getRenderById(e.unitId)?.with(vI);if(re==null)return;let ie=i?.findNodeByCoord(ne,p,m,h,{strict:!1,segmentId:re.getSegment(),segmentPage:re.getSegmentPage()});if(ie){let{node:e,segmentPage:t,segmentId:n}=ie;D=e,k=t,O=n}if(D==null)return;let ae=D.parent?.parent,oe=ae?.parent,se=oe?.lines.find(e=>e.paragraphIndex===ae?.paragraphIndex&&e.paragraphStart)??oe?.lines[0],ce=oe==null||(n=oe.parent)==null?void 0:n.parent;if(ae==null||oe==null||se==null||ce==null)return;this._liquid.reset();let le=ce.type===zw.CELL?Jat(e.unitId,ce):null,ue=le?.hostPage??ce,de=ue.type;for(let e of o){let{headerId:t,footerId:n,pageHeight:r,pageWidth:i,marginLeft:a,marginBottom:l}=e,u=o.indexOf(e);if(k>-1&&u===k){switch(de){case zw.HEADER:{let e=s.get(t)?.get(i);if(e)this._liquid.translatePagePadding({marginTop:e.marginTop,marginLeft:a});else throw Error(`header skeleton not found`);break}case zw.FOOTER:{let e=c.get(n)?.get(i);if(e)this._liquid.translatePagePadding({marginTop:r-l+e.marginTop,marginLeft:a});else throw Error(`footer skeleton not found`);break}default:this._liquid.translatePagePadding(e)}break}if(this._liquid.translatePagePadding(e),e===ue)break;this._liquid.restorePagePadding(e),this._liquid.translatePage(e,p,m,h)}if(le&&this._liquid.translate(le.offset.left,le.offset.top),C.relativeFrom===rm.LINE)D=ae.divides[0].glyphGroup[0];else{var fe;D=((fe=se.divides)==null||(fe=fe[0])==null||(fe=fe.glyphGroup)==null?void 0:fe[0])??D}switch(A.positionH={relativeFrom:w.relativeFrom,posOffset:v-this._liquid.x-g},w.relativeFrom){case nm.MARGIN:A.positionH.posOffset=v-this._liquid.x-g-ce.marginLeft;break;case nm.COLUMN:A.positionH.posOffset=v-this._liquid.x-g-oe.left}switch(A.positionV={relativeFrom:C.relativeFrom,posOffset:y-this._liquid.y-_},C.relativeFrom){case rm.PAGE:A.positionV.posOffset=y-this._liquid.y-_-ce.marginTop;break;case rm.LINE:A.positionV.posOffset=y-this._liquid.y-_-ae.top;break;case rm.PARAGRAPH:A.positionV.posOffset=y-this._liquid.y-_-se.top}if(D==null)return;let pe=i?.findPositionByGlyph(D,k),me=this._getDocObject();if(pe==null||i==null||me==null)return;let he={...pe,isBack:!1},{cursorList:ge}=new cI(me.document.getOffsetConfig(),i).getRangePointData(he,he),{startOffset:_e}=oI(ge)??{};if(_e!=null)return{offset:_e,docTransform:A,segmentId:O,segmentPage:k}}_updateDrawingSize(e,t){let n=[],{drawing:r,width:i,height:a,angle:o}=e,{unitId:s,subUnitId:c}=r,{width:l,height:u,angle:d}=t,{width:f,height:p}=this._getPageContentSize(r);l=Math.min(f,l),u=Math.min(p,u),(l!==i||u!==a)&&n.push({drawingId:r.drawingId,key:`size`,value:{width:l,height:u}}),d!==o&&n.push({drawingId:r.drawingId,key:`angle`,value:d}),n.length>0&&s&&c&&this._commandService.executeCommand(sG.id,{unitId:s,subUnitId:c,drawings:n})}_moveInlineDrawing(e,t,n){let{offset:r,segmentId:i,segmentPage:a}=this._getInlineDrawingAnchor(e,t,n)??{};return this._commandService.executeCommand(jat.id,{unitId:e.unitId,subUnitId:e.unitId,drawing:e,offset:r,segmentId:i,segmentPage:a,needRefreshDrawings:r==null})}_limitDrawingInPage(e,t){let n=this._renderManagerService.getRenderById(e.unitId),{left:r,top:i,width:a,height:o,angle:s}=t,c=(n?.with(cD).getSkeleton())?.getSkeletonData(),{pages:l}=c??{};if(c==null||n==null||l==null)return{left:r,top:i,width:a,height:o,angle:s};let{mainComponent:u}=n,{top:d,pageLayoutType:f,pageMarginLeft:p,pageMarginTop:m}=u,h=i;this._liquid.reset();for(let e of l){let{marginBottom:t,pageHeight:n}=e,r=l[l.indexOf(e)+1];r!=null&&(F.hasIntersectionBetweenTwoRanges(i,i+o,this._liquid.y+d+n-t,this._liquid.y+d+n+m+r.marginTop)&&(h=i+o/2<this._liquid.y+d+n+m/2?Math.min(i,this._liquid.y+d+n-t-o):Math.max(i,this._liquid.y+d+n+m+r.marginTop)),this._liquid.translatePage(e,f,p,m))}return{left:r,top:h,width:a,height:o,angle:s}}_nonInlineDrawingTransform(e,t,n=!1){let r=e.isMultiTransform===Np.TRUE?t:this._limitDrawingInPage(e,t);if(n&&r.top!==t.top)return;let{offset:i,docTransform:a,segmentId:o,segmentPage:s}=this._getDrawingAnchor(e,r)??{};return i==null||a==null?this._updateMultipleDrawingDocTransform(new Map([[e.drawingId,t]])):this._commandService.executeCommand(Mat.id,{unitId:e.unitId,subUnitId:e.unitId,drawing:e,offset:i,docTransform:a,segmentId:o,segmentPage:s})}_getSceneAndTransformerByDrawingSearch(e){if(e==null)return;let t=this._renderManagerService.getRenderById(e)?.scene;if(t!=null)return{scene:t,transformer:t.getTransformerByCreate()}}_getTransformCoordForDocumentOffset(e,t,n,r){let{documentTransform:i}=e.getOffsetConfig(),a=t.transformVector2SceneCoord(Hw.FromArray([n,r]));if(a)return i.clone().invert().applyPoint(a)}_createOrUpdateInlineAnchor(e,t){let n=this._renderManagerService.getRenderById(e);if(n==null)return;let{mainComponent:r,scene:i}=n,{docsLeft:a,docsTop:o}=r.getOffsetConfig(),{left:s,top:c,height:l}=dI(t),u=s+a,d=c+o;if(this._anchorShape){this._anchorShape.transformByState({left:u,top:d,height:l}),this._anchorShape.show();return}let f=new NE(qat+ip(6),{left:u,top:d,height:l,strokeWidth:2,stroke:xw(nh.darkgray,1),evented:!1});this._anchorShape=f,i.addObject(f,3)}_getDocObject(){return HJe(this._univerInstanceService,this._renderManagerService)}_getPageContentSize(e){let t=this._renderManagerService.getRenderById(e.unitId),n=(t?.with(cD).getSkeleton())?.getSkeletonData();if(n==null||t==null)return{width:500,height:500};let{pages:r}=n,i=null;for(let t of r){let{skeDrawings:n}=t;if(n.has(e.drawingId)){i=t;break}}if(i){let{pageWidth:e,pageHeight:t,marginLeft:n,marginBottom:r,marginRight:a,marginTop:o}=i;return{width:Math.max(500,e-n-a),height:Math.max(500,t-o-r)}}return{width:500,height:500}}};vG=iG([rG(0,R),rG(1,B),rG(2,LN),rG(3,ZE)],vG);var Yat={[kM.MEDIA]:{[Iat]:{order:0,menuItemFactory:Rat,[pG]:{order:0,menuItemFactory:mG}}},[jM.PARAGRAPH]:{[MM.LAYOUT]:{[pL]:{[pG]:{order:5,menuItemFactory:mG}}},[cL]:{[MM.LAYOUT]:{[pG]:{order:5,menuItemFactory:mG}}},[Z$e]:{[MM.LAYOUT]:{[pG]:{order:5,menuItemFactory:mG}}}}},Xat=-1e3,Zat=1e3,Qat=e=>{let t=W(R),n=W(nx),r=W(LN),i=W(ZE),a=W(B),{drawings:o}=e,s=o[0];if(s==null)return;let{unitId:c}=s,l=a.getUniverDocInstance(c),u=l?.getSnapshot().documentStyle.documentFlavor,d=i.getRenderById(c)?.scene;if(d==null)return;let f=d.getTransformerByCreate(),p=[{label:n.t(`docs-drawing-ui.image-position.column`),value:String(nm.COLUMN)},{label:n.t(`docs-drawing-ui.image-position.page`),value:String(nm.PAGE)},{label:n.t(`docs-drawing-ui.image-position.margin`),value:String(nm.MARGIN)}],m=[{label:n.t(`docs-drawing-ui.image-position.line`),value:String(rm.LINE),disabled:u===Vp.MODERN},{label:n.t(`docs-drawing-ui.image-position.page`),value:String(rm.PAGE),disabled:u===Vp.MODERN},{label:n.t(`docs-drawing-ui.image-position.margin`),value:String(rm.MARGIN),disabled:u===Vp.MODERN},{label:n.t(`docs-drawing-ui.image-position.paragraph`),value:String(rm.PARAGRAPH)}],[h,g]=(0,H.useState)(!0),[_,v]=(0,H.useState)({relativeFrom:nm.PAGE,posOffset:0}),[y,b]=(0,H.useState)({relativeFrom:rm.PAGE,posOffset:0}),[x,S]=(0,H.useState)(!0),[C,w]=(0,H.useState)(!0);function T(e,n){e===`positionH`?v(n):b(n);let a=r.getFocusDrawings();if(a.length===0)return;let o=a.map(e=>({unitId:e.unitId,subUnitId:e.subUnitId,drawingId:e.drawingId}));t.executeCommand(sG.id,{unitId:a[0].unitId,subUnitId:a[0].unitId,drawings:o.map(t=>({drawingId:t.drawingId,key:e,value:n}))});let s=i.getRenderById(c)?.with(vI);s&&s.blur(),f.refreshControls()}function E(e){let t=_.relativeFrom,n=_.posOffset,a=Number(e);if(t===a)return;let o=r.getFocusDrawings();if(o.length===0)return;let s=o[0].drawingId,c=o[0].unitId,l=null,u=0,d=(i.getRenderById(c)?.with(cD).getSkeleton())?.getSkeletonData();if(d==null)return;let{pages:f,skeHeaders:p,skeFooters:m}=d;for(let e of f){let{marginLeft:t,skeDrawings:n,headerId:r,footerId:i,pageWidth:a}=e;if(n.has(s)){l=n.get(s),u=t;break}let o=p.get(r)?.get(a);if(o?.skeDrawings.has(s)){l=o?.skeDrawings.get(s),u=t;break}let c=m.get(i)?.get(a);if(c?.skeDrawings.has(s)){l=c?.skeDrawings.get(s),u=t;break}}if(l==null)return;let h=0;t===nm.COLUMN?h-=l.columnLeft:t===nm.MARGIN&&(h-=u),a===nm.COLUMN?h+=l.columnLeft:a===nm.MARGIN?h+=u:nm.PAGE,T(`positionH`,{relativeFrom:a,posOffset:(n??0)-h})}function D(e){var t,n,o;let s=y.relativeFrom,c=y.posOffset,l=Number(e);if(s===l)return;let u=r.getFocusDrawings();if(u.length===0)return;let{drawingId:d,unitId:f}=u[0],p=a.getUniverDocInstance(f),m=i.getRenderById(f)?.with(cD).getSkeleton(),h=i.getRenderById(f)?.with(vI),g=h?.getSegment(),_=h?.getSegmentPage(),v=p==null||(t=p.getSelfOrHeaderFooterModel(g).getBody())==null||(t=t.customBlocks)==null?void 0:t.find(e=>e.blockId===d);if(v==null||m==null||h==null)return;let{startIndex:b}=v,x=m.findNodeByCharIndex(b,g,_),S=x==null||(n=x.parent)==null?void 0:n.parent,C=S?.parent,w=C?.lines.find(e=>e.paragraphIndex===S?.paragraphIndex&&e.paragraphStart),E=C==null||(o=C.parent)==null?void 0:o.parent;if(x==null||S==null||w==null||C==null||E==null)return;let D=0;s===rm.PARAGRAPH?D-=w.top:s===rm.LINE?D-=S.top:s===rm.PAGE&&(D+=E.marginTop),l===rm.PARAGRAPH?D+=w.top:l===rm.LINE?D+=S.top:l===rm.PAGE&&(D-=E.marginTop),T(`positionV`,{relativeFrom:l,posOffset:(c??0)-D})}function O(e){var t;let n=l?.getSnapshot(),r=n==null||(t=n.drawings)==null?void 0:t[e.drawingId];if(r==null)return;let{layoutType:i}=r,{positionH:a,positionV:o}=r.docTransform;v(a),b(o),g(i===Kp.INLINE),S(o.relativeFrom===rm.PARAGRAPH||o.relativeFrom===rm.LINE)}function k(){let e=r.getFocusDrawings();e.length!==0&&O(e[0])}function A(e){S(e),D(String(e?rm.PARAGRAPH:rm.PAGE))}return(0,H.useEffect)(()=>{k();let e=r.focus$.subscribe(e=>{if(e.length===0){w(!1);return}w(!0),O(e[0])}),n=t.onCommandExecuted(async e=>{e.id===uD.id&&k()});return()=>{e.unsubscribe(),n.dispose()}},[]),(0,U.jsxs)(`div`,{className:tj(`univer-grid univer-gap-2 univer-py-2 univer-text-gray-400`,{"univer-hidden":!C}),children:[(0,U.jsx)(`header`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:n.t(`docs-drawing-ui.image-position.title`)})}),(0,U.jsx)(`div`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:n.t(`docs-drawing-ui.image-position.horizontal`)})}),(0,U.jsxs)(`div`,{className:`univer-grid univer-grid-cols-2 univer-gap-2 [&>div]:univer-grid [&>div]:univer-gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:n.t(`docs-drawing-ui.image-position.absolutePosition`)}),(0,U.jsx)(Ej,{min:Xat,max:Zat,precision:1,disabled:h,value:_.posOffset,onChange:e=>{T(`positionH`,{relativeFrom:_.relativeFrom,posOffset:e})}})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:n.t(`docs-drawing-ui.image-position.toTheRightOf`)}),(0,U.jsx)(Ij,{value:String(_.relativeFrom),disabled:h,options:p,onChange:E})]})]}),(0,U.jsx)(`div`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:n.t(`docs-drawing-ui.image-position.vertical`)})}),(0,U.jsxs)(`div`,{className:`univer-grid univer-grid-cols-2 univer-gap-2 [&>div]:univer-grid [&>div]:univer-gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:n.t(`docs-drawing-ui.image-position.absolutePosition`)}),(0,U.jsx)(Ej,{min:Xat,max:Zat,precision:1,disabled:h,value:y.posOffset,onChange:e=>{T(`positionV`,{relativeFrom:y.relativeFrom,posOffset:e})}})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:n.t(`docs-drawing-ui.image-position.bellow`)}),(0,U.jsx)(Ij,{disabled:h,value:String(y.relativeFrom),options:m,onChange:D})]})]}),(0,U.jsx)(`div`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:n.t(`docs-drawing-ui.image-position.options`)})}),(0,U.jsx)(`div`,{children:(0,U.jsx)(mj,{disabled:h,checked:x,onChange:A,children:n.t(`docs-drawing-ui.image-position.moveObjectWithText`)})})]})},yG=0,bG=100,$at=e=>{let t=W(R),n=W(nx),r=W(LN),i=W(ZE),a=W(B),{drawings:o}=e,s=o[0];if(s==null)return null;let{unitId:c}=s,l=a.getUniverDocInstance(c);if(i.getRenderById(c)?.scene==null)return null;let[u,d]=(0,H.useState)(!0),[f,p]=(0,H.useState)(!0),[m,h]=(0,H.useState)(!0),[g,_]=(0,H.useState)(`inline`),[v,y]=(0,H.useState)(``),[b,x]=(0,H.useState)({distT:0,distL:0,distB:0,distR:0}),[S,C]=(0,H.useState)(!0);function w(e){_(e);let n=r.getFocusDrawings();if(n.length===0)return;let{unitId:i,subUnitId:a}=n[0],o=n.map(({unitId:e,subUnitId:t,drawingId:n})=>({unitId:e,subUnitId:t,drawingId:n}));t.executeCommand(Oat.id,{unitId:i,subUnitId:a,drawings:o,wrappingStyle:e})}function T(e){y(e);let n=r.getFocusDrawings();if(n.length===0)return;let i=n.map(e=>({unitId:e.unitId,subUnitId:e.subUnitId,drawingId:e.drawingId}));t.executeCommand(Aat.id,{unitId:n[0].unitId,subUnitId:n[0].unitId,drawings:i,wrapText:e})}function E(e,n){if(e==null)return;x({...b,[n]:e});let i=r.getFocusDrawings();if(i.length===0)return;let a=i.map(e=>({unitId:e.unitId,subUnitId:e.subUnitId,drawingId:e.drawingId}));t.executeCommand(kat.id,{unitId:i[0].unitId,subUnitId:i[0].unitId,drawings:a,dist:{[n]:e}})}function D(){let e=r.getFocusDrawings();e.length!==0&&O(e[0])}function O(e){var t;let n=l==null||(t=l.getSnapshot())==null||(t=t.drawings)==null?void 0:t[e.drawingId];if(n==null)return;let{distT:r=0,distL:i=0,distB:a=0,distR:o=0,layoutType:s=Kp.INLINE,behindDoc:c=Np.FALSE,wrapText:u=Gp.BOTH_SIDES}=n;if(x({distT:r,distL:i,distB:a,distR:o}),y(u),d(s!==Kp.WRAP_SQUARE),s===Kp.WRAP_NONE||s===Kp.INLINE?p(!0):p(!1),s===Kp.WRAP_NONE||s===Kp.INLINE||s===Kp.WRAP_TOP_AND_BOTTOM?h(!0):h(!1),s===Kp.WRAP_NONE)c===Np.TRUE?_(`behindText`):_(`inFrontOfText`);else switch(s){case Kp.INLINE:_(`inline`);break;case Kp.WRAP_SQUARE:_(`wrapSquare`);break;case Kp.WRAP_TOP_AND_BOTTOM:_(`wrapTopAndBottom`);break;default:throw Error(`Unsupported layout type: ${s}`)}}return(0,H.useEffect)(()=>{D();let e=r.focus$.subscribe(e=>{if(e.length===0){C(!1);return}C(!0),O(e[0])}),n=t.onCommandExecuted(async e=>{e.id===uD.id&&D()});return()=>{e.unsubscribe(),n.dispose()}},[]),(0,U.jsxs)(`div`,{className:tj(`univer-grid univer-gap-2 univer-py-2 univer-text-gray-400`,{"univer-hidden":!S}),children:[(0,U.jsx)(`header`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:n.t(`docs-drawing-ui.image-text-wrap.title`)})}),(0,U.jsx)(`div`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:n.t(`docs-drawing-ui.image-text-wrap.wrappingStyle`)})}),(0,U.jsx)(`div`,{children:(0,U.jsxs)(Nj,{value:g,onChange:w,direction:`vertical`,children:[(0,U.jsx)(Pj,{value:`inline`,children:n.t(`docs-drawing-ui.image-text-wrap.inline`)}),(0,U.jsx)(Pj,{value:`wrapSquare`,children:n.t(`docs-drawing-ui.image-text-wrap.square`)}),(0,U.jsx)(Pj,{value:`wrapTopAndBottom`,children:n.t(`docs-drawing-ui.image-text-wrap.topAndBottom`)}),(0,U.jsx)(Pj,{value:`behindText`,children:n.t(`docs-drawing-ui.image-text-wrap.behindText`)}),(0,U.jsx)(Pj,{value:`inFrontOfText`,children:n.t(`docs-drawing-ui.image-text-wrap.inFrontText`)})]})}),(0,U.jsx)(`div`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:n.t(`docs-drawing-ui.image-text-wrap.wrapText`)})}),(0,U.jsx)(`div`,{children:(0,U.jsxs)(Nj,{disabled:u,value:v,onChange:T,direction:`horizontal`,children:[(0,U.jsx)(Pj,{value:Gp.BOTH_SIDES,children:n.t(`docs-drawing-ui.image-text-wrap.bothSide`)}),(0,U.jsx)(Pj,{value:Gp.LEFT,children:n.t(`docs-drawing-ui.image-text-wrap.leftOnly`)}),(0,U.jsx)(Pj,{value:Gp.RIGHT,children:n.t(`docs-drawing-ui.image-text-wrap.rightOnly`)})]})}),(0,U.jsx)(`div`,{className:`univer-text-gray-600 dark:!univer-text-gray-200`,children:(0,U.jsx)(`div`,{children:n.t(`docs-drawing-ui.image-text-wrap.distanceFromText`)})}),(0,U.jsxs)(`div`,{className:`univer-grid univer-grid-cols-2 univer-gap-2 [&>div]:univer-grid [&>div]:univer-gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:n.t(`docs-drawing-ui.image-text-wrap.top`)}),(0,U.jsx)(Ej,{min:yG,max:bG,disabled:f,precision:1,value:b.distT,onChange:e=>{E(e,`distT`)}})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:n.t(`docs-drawing-ui.image-text-wrap.left`)}),(0,U.jsx)(Ej,{min:yG,max:bG,disabled:m,precision:1,value:b.distL,onChange:e=>{E(e,`distL`)}})]})]}),(0,U.jsxs)(`div`,{className:`univer-grid univer-grid-cols-2 univer-gap-2 [&>div]:univer-grid [&>div]:univer-gap-2`,children:[(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:n.t(`docs-drawing-ui.image-text-wrap.bottom`)}),(0,U.jsx)(Ej,{min:yG,max:bG,disabled:f,precision:1,value:b.distB,onChange:e=>{E(e,`distB`)}})]}),(0,U.jsxs)(`div`,{children:[(0,U.jsx)(`span`,{children:n.t(`docs-drawing-ui.image-text-wrap.right`)}),(0,U.jsx)(Ej,{min:yG,max:bG,disabled:m,precision:1,value:b.distR,onChange:e=>{E(e,`distR`)}})]})]})]})},eot=()=>{let e=W(LN),[t,n]=(0,H.useState)(e.getFocusDrawings());return(0,H.useEffect)(()=>{let t=e.focus$.subscribe(e=>{n(e)});return()=>{t.unsubscribe()}},[]),!!t?.length&&(0,U.jsxs)(`div`,{className:`univer-text-sm`,children:[(0,U.jsx)(_at,{drawings:t,hasAlign:!1,hasCropper:!0,hasGroup:!1,hasTransform:!1}),(0,U.jsx)($at,{drawings:t}),(0,U.jsx)(Qat,{drawings:t})]})};function xG(e){return e.getContextValue(`FOCUSING_DOC`)&&e.getContextValue(`FOCUSING_UNIVER_EDITOR`)&&e.getContextValue(`FOCUSING_COMMON_DRAWINGS`)}var tot={id:cG.id,description:`docs-drawing-ui.shortcut.drawing-move-down`,group:`4_drawing-view`,groupTitle:`docs-drawing-ui.shortcut.drawing-view`,binding:xM.ARROW_DOWN,priority:100,preconditions:xG,staticParameters:{direction:I.DOWN}},not={id:cG.id,description:`docs-drawing-ui.shortcut.drawing-move-up`,group:`4_drawing-view`,groupTitle:`docs-drawing-ui.shortcut.drawing-view`,binding:xM.ARROW_UP,priority:100,preconditions:xG,staticParameters:{direction:I.UP}},rot={id:cG.id,description:`docs-drawing-ui.shortcut.drawing-move-left`,group:`4_drawing-view`,groupTitle:`docs-drawing-ui.shortcut.drawing-view`,binding:xM.ARROW_LEFT,priority:100,preconditions:xG,staticParameters:{direction:I.LEFT}},iot={id:cG.id,description:`docs-drawing-ui.shortcut.drawing-move-right`,group:`4_drawing-view`,groupTitle:`docs-drawing-ui.shortcut.drawing-view`,binding:xM.ARROW_RIGHT,priority:100,preconditions:xG,staticParameters:{direction:I.RIGHT}},aot={id:vat.id,description:`docs-drawing-ui.shortcut.drawing-delete`,group:`4_drawing-view`,groupTitle:`docs-drawing-ui.shortcut.drawing-view`,preconditions:xG,binding:xM.DELETE,mac:xM.BACKSPACE},SG=class extends P{constructor(e,t,n,r){super(),this._componentManager=e,this._menuManagerService=t,this._commandService=n,this._shortcutService=r,this._init()}_initCustomComponents(){let e=this._componentManager;this.disposeWithMe(e.register(Pat,eot))}_initMenus(){this._menuManagerService.mergeMenu(Yat)}_initCommands(){[Tat,$W,Oat,kat,Aat,sG,jat,Mat,QW,lG,Nat,uG,yat,Sat,cG,vat,xat].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e)))}_initShortcuts(){[tot,not,rot,iot,aot].forEach(e=>{this.disposeWithMe(this._shortcutService.registerShortcut(e))})}_init(){this._initCommands(),this._initCustomComponents(),this._initMenus(),this._initShortcuts()}};SG=iG([rG(0,j(Yj)),rG(1,NM),rG(2,R),rG(3,wM)],SG);var CG=class extends Kf{constructor(e,t,n,r,i,a){super(),this._drawingManagerService=e,this._canvasPopManagerService=t,this._renderManagerService=n,this._univerInstanceService=r,this._contextService=i,this._commandService=a,tG(this,`_initImagePopupMenu`,new Set),tG(this,`_disposePopups`,[]),tG(this,`_isDrawingPanelOpen`,!1),this._init()}_init(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===uG.id&&(this._isDrawingPanelOpen=!0,this._clearPopups()),e.id===lG.id){let t=e.params;this._isDrawingPanelOpen=t?.value===`open`,this._isDrawingPanelOpen&&this._clearPopups()}})),this.disposeWithMe(this._drawingManagerService.focus$.subscribe(e=>{e.length===0&&(this._isDrawingPanelOpen=!1)})),this.disposeWithMe(this._univerInstanceService.getCurrentTypeOfUnit$(M.UNIVER_DOC).pipe(cc(this.dispose$)).subscribe(e=>this._create(e))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(M.UNIVER_DOC).pipe(cc(this.dispose$)).subscribe(e=>this._dispose(e))),this._univerInstanceService.getAllUnitsForType(M.UNIVER_DOC).forEach(e=>this._create(e))}_dispose(e){let t=e.getUnitId();this._clearPopups(),this._renderManagerService.removeRender(t)}_clearPopups(){this._disposePopups.forEach(e=>e.dispose()),this._disposePopups.length=0}_create(e){if(!e)return;let t=e.getUnitId();lf(t)||this._renderManagerService.has(t)&&!this._initImagePopupMenu.has(t)&&(this._popupMenuListener(t),this._initImagePopupMenu.add(t))}_hasCropObject(e){let t=e.getAllObjects();for(let e of t)if(e instanceof GW)return!0;return!1}_popupMenuListener(e){let t=this._renderManagerService.getRenderById(e)?.scene;if(!t)return;let n=t.getTransformerByCreate();if(!n)return;let r=this._disposePopups;this.disposeWithMe(n.createControl$.subscribe(()=>{if(this._hasCropObject(t))return;let e=n.getSelectedObjectMap();if(r.forEach(e=>e.dispose()),r.length=0,this._isDrawingPanelOpen||e.size>1)return;let i=e.values().next().value;if(!i)return;let a=i.oKey,o=this._drawingManagerService.getDrawingOKey(a);if(!o||o.drawingType===um.DRAWING_DOM||o.drawingType===um.DRAWING_SHAPE)return;let{unitId:s,subUnitId:c,drawingId:l,drawingType:u}=o,d=u===um.DRAWING_IMAGE,f=this._canvasPopManagerService.attachPopupToObject(i,{componentKey:PW,direction:d?`top-center`:`horizontal`,offset:d?[0,8]:[2,0],extraProps:{menuItems:this._getImageMenuItems(s,c,l,u),variant:d?`doc-floating-toolbar`:void 0,unitId:s,subUnitId:c,drawingId:l}},s);r.push(this.disposeWithMe(f)),!this._drawingManagerService.getFocusDrawings().find(e=>e.unitId===s&&e.subUnitId===c&&e.drawingId===l)&&this._drawingManagerService.focusDrawing([{unitId:s,subUnitId:c,drawingId:l}])})),this.disposeWithMe(n.clearControl$.subscribe(()=>{r.forEach(e=>e.dispose()),r.length=0,this._contextService.setContextValue(ab,!1),this._drawingManagerService.focusDrawing(null)})),this.disposeWithMe(n.changing$.subscribe(()=>{r.forEach(e=>e.dispose()),r.length=0})),this.disposeWithMe(n.changeStart$.subscribe(()=>{r.forEach(e=>e.dispose()),r.length=0}))}_getImageMenuItems(e,t,n,r){return[{label:`docs-drawing-ui.image-popup.edit`,index:0,commandId:uG.id,commandParams:{unitId:e,subUnitId:t,drawingId:n},disable:r===um.DRAWING_DOM},{label:`docs-drawing-ui.image-popup.delete`,index:1,commandId:QW.id,commandParams:{unitId:e,drawings:[{unitId:e,subUnitId:t,drawingId:n}]},disable:!1},{label:`docs-drawing-ui.image-popup.crop`,index:2,commandId:OW.id,commandParams:{unitId:e,subUnitId:t,drawingId:n},disable:r===um.DRAWING_DOM},{label:`docs-drawing-ui.image-popup.reset`,index:3,commandId:jW.id,commandParams:[{unitId:e,subUnitId:t,drawingId:n}],disable:!0}]}};CG=iG([rG(0,LN),rG(1,j(_L)),rG(2,ZE),rG(3,B),rG(4,Fm),rG(5,R)],CG);var wG=class extends dx{constructor(e=Hat,t,n,r){super(),this._config=e,this._injector=t,this._renderManagerSrv=n,this._configService=r;let{...i}=Qi({},Hat,this._config);this._configService.setConfig(Vat,i)}onStarting(){[[SG],[CG],[vG],[hG],[nG],[fG],[gG]].forEach(e=>this._injector.add(e))}onReady(){[[aG],[_G]].forEach(e=>this._renderManagerSrv.registerRenderModule(M.UNIVER_DOC,e)),this._injector.get(hG),this._injector.get(SG),this._injector.get(vG),this._injector.get(gG)}onRendered(){this._injector.get(CG),this._injector.get(fG)}};tG(wG,`type`,M.UNIVER_DOC),tG(wG,`pluginName`,`DOC_DRAWING_UI_PLUGIN`),tG(wG,`packageName`,zat),tG(wG,`version`,Bat),wG=iG([px(XW,UN,uW,NN),rG(1,j(We)),rG(2,ZE),rG(3,Nm)],wG);function oot(e={}){let{collaboration:t=!1}=e;return{plugins:[[UN,{override:t?[[ub,null]]:[]}],XW,uW,wG].filter(e=>!!e)}}var sot={"docs-drawing-ui":{title:`图片`,upload:{float:`插入图片`},panel:{title:`编辑图片`},"image-popup":{replace:`替换`,delete:`删除`,edit:`编辑`,crop:`裁剪`,reset:`重置大小`},"image-text-wrap":{title:`文字环绕`,wrappingStyle:`环绕方式`,square:`四周型`,topAndBottom:`上下型`,inline:`嵌入型`,behindText:`衬于文字下方`,inFrontText:`浮于文字上方`,wrapText:`自动换行`,bothSide:`两侧`,leftOnly:`左侧`,rightOnly:`右侧`,distanceFromText:`距正文`,top:`上(px)`,left:`左(px)`,bottom:`下(px)`,right:`右(px)`},"image-position":{title:`位置`,horizontal:`水平`,vertical:`垂直`,absolutePosition:`绝对位置(px)`,relativePosition:`相对位置`,toTheRightOf:`右侧`,relativeTo:`相对于`,bellow:`下方`,options:`选项`,moveObjectWithText:`对象随文字移动`,column:`栏`,margin:`页边距`,page:`页面`,line:`行`,paragraph:`段落`},"update-status":{exceedMaxSize:`图片大小超过限制, 限制为{0}M`,invalidImageType:`图片类型错误`,exceedMaxCount:`图片只能一次上传{0}张`,invalidImage:`无效图片`},shortcut:{"drawing-view":`绘图视图`,"drawing-move-down":`下移绘图`,"drawing-move-up":`上移绘图`,"drawing-move-left":`左移绘图`,"drawing-move-right":`右移绘图`,"drawing-delete":`删除绘图`}}},cot={"drawing-ui":{"image-cropper":{error:`无法裁剪非图片元素`},"image-panel":{arrange:{title:`排列`,forward:`上移一层`,backward:`下移一层`,front:`置于顶层`,back:`置于底层`},transform:{title:`变换`,rotate:`旋转 (°)`,x:`X (px)`,y:`Y (px)`,width:`宽度 (px)`,height:`高度 (px)`,lock:`锁定比例 (%)`},crop:{title:`裁剪`,start:`开始裁剪`,mode:`自由比例裁剪`},group:{title:`组合`,group:`组合`,unGroup:`取消组合`},align:{title:`对齐方式`,default:`选择对齐方式`,left:`左对齐`,center:`水平居中`,right:`右对齐`,top:`顶部对齐`,middle:`垂直居中`,bottom:`底部对齐`,horizon:`水平分布`,vertical:`垂直分布`},null:`未选中任何对象`},"image-text-wrap":{title:`文字环绕`,wrappingStyle:`环绕方式`,square:`四周型`,topAndBottom:`上下型`,inline:`嵌入型`,behindText:`衬于文字下方`,inFrontText:`浮于文字上方`,wrapText:`自动换行`,bothSide:`两侧`,leftOnly:`左侧`,rightOnly:`右侧`,distanceFromText:`距正文`,top:`上(px)`,left:`左(px)`,bottom:`下(px)`,right:`右(px)`},"image-popup":{replace:`替换`,delete:`删除`,edit:`编辑`,crop:`裁剪`,reset:`重置大小`}}},lot=Rg(sot,cot),uot=`@univerjs/docs-hyper-link`,dot=`0.25.1`,fot={id:`docs.mutation.add-hyper-link`,type:L.MUTATION,handler:()=>!0},pot={id:`docs.mutation.update-hyper-link`,type:L.MUTATION,handler:()=>!0},mot={id:`docs.mutation.delete-hyper-link`,type:L.MUTATION,handler:()=>!0},hot=`docs-hyper-link.config`,got={};function TG(e,t){return function(n,r){t(n,r,e)}}function _ot(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var vot=`DOC_HYPER_LINK_PLUGIN`,EG=class extends P{constructor(e,t){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._init()}_init(){this._resourceManagerService.registerPluginResource({pluginName:vot,businesses:[M.UNIVER_DOC],onLoad:(e,t)=>{let n=this._univerInstanceService.getUnit(e,M.UNIVER_DOC);if(!n)return;let r=new Map,i=e=>{var t;return(t=e.getBody())==null||(t=t.customRanges)==null||t.forEach(e=>{e.rangeType===Rp.HYPERLINK&&r.set(e.rangeId,e)}),r};n.headerModelMap.forEach(e=>{i(e)}),n.footerModelMap.forEach(e=>{i(e)}),i(n),t.links.forEach(e=>{let t=r.get(e.id);t&&(t.properties={...t.properties,url:e.payload})})},onUnLoad:e=>{},toJson:e=>{let t=this._univerInstanceService.getUnit(e,M.UNIVER_DOC),n=[];if(t){let e=e=>{var t;(t=e.getBody())==null||(t=t.customRanges)==null||t.forEach(e=>{e.rangeType===Rp.HYPERLINK&&n.push({id:e.rangeId,payload:e.properties?.url||``})})};t.headerModelMap.forEach(t=>{e(t)}),t.footerModelMap.forEach(t=>{e(t)}),e(t)}return JSON.stringify({links:n})},parseJson(e){return JSON.parse(e)}})}};EG=_ot([TG(0,j(By)),TG(1,B)],EG);function DG(e){"@babel/helpers - typeof";return DG=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},DG(e)}function yot(e,t){if(DG(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(DG(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function bot(e){var t=yot(e,`string`);return DG(t)==`symbol`?t:t+``}function OG(e,t,n){return(t=bot(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var kG=class extends dx{constructor(e=got,t,n,r){super(),this._config=e,this._injector=t,this._configService=n,this._commandService=r;let{...i}=Qi({},got,this._config);this._configService.setConfig(hot,i)}onStarting(){[[EG]].forEach(e=>this._injector.add(e)),[fot,mot,pot].forEach(e=>{this.disposeWithMe(this._commandService.registerCommand(e))}),this._injector.get(EG)}};OG(kG,`pluginName`,vot),OG(kG,`packageName`,uot),OG(kG,`version`,dot),OG(kG,`type`,M.UNIVER_DOC),kG=_ot([TG(1,j(We)),TG(2,Nm),TG(3,R)],kG);var xot=`@univerjs/docs-hyper-link-ui`,Sot=`0.25.1`,Cot=`docs-hyper-link-ui.config`,wot={},Tot={type:L.COMMAND,id:`docs.command.add-hyper-link`,async handler(e,t){if(!t)return!1;let{payload:n,unitId:r,selections:i}=t,a=e.get(R),o=iAe(e,{rangeId:ip(),rangeType:Rp.HYPERLINK,properties:{url:n},unitId:r,selections:i});return o?a.syncExecuteCommand(o.id,o.params):!1}},Eot={id:`docs.command.update-hyper-link`,type:L.COMMAND,handler(e,t){if(!t)return!1;let{unitId:n,payload:r,segmentId:i,linkId:a}=t,o=e.get(R),s=e.get(B),c=e.get(sD).getActiveTextRange(),l=s.getUnit(n,M.UNIVER_DOC);if(!c||!l)return!1;let u=yv(l.getSelfOrHeaderFooterModel(i).getBody(),c.startOffset,c.endOffset).textRuns?.[0];u&&(u.ed=t.label.length+1);let d=hD(e,{unitId:n,body:{dataStream:`${t.label}`,customRanges:[{rangeId:a,rangeType:Rp.HYPERLINK,startIndex:0,endIndex:t.label.length+1,properties:{url:r}}],textRuns:u?[u]:void 0},selection:{startOffset:c.startOffset,endOffset:c.endOffset,collapsed:!1,segmentId:i}});return d?o.syncExecuteCommand(d.id,d.params):!1}};function AG(e){return e.trim().length===0}function Dot(e){return/^[a-zA-Z]+:\/\//.test(e)}function Oot(e){return/^[\w-\.]+@([\w-]+\.)+[\w-]{2,4}$/.test(e)}function kot(e){return Dot(e)?e:Oot(e)?`mailto://${e}`:`https://${e}`}var jG=()=>{let e=W(zG),t=W(nx),n=nO(e.editingLink$),r=W(R),i=W(B),a=W(sD),[o,s]=(0,H.useState)(``),[c,l]=(0,H.useState)(``),[u,d]=(0,H.useState)(!1),f=F.isLegalUrl(o),p=n?i.getUnit(n.unitId,M.UNIVER_DOC):i.getCurrentUnitOfType(M.UNIVER_DOC);(0,H.useEffect)(()=>{var e;let t=a.getActiveTextRange();if(!t)return;if(n){var r,i;let e=p==null||(r=p.getSelfOrHeaderFooterModel(n.segmentId))==null?void 0:r.getBody(),t=e==null||(i=e.customRanges)==null?void 0:i.find(e=>n?.linkId===e.rangeId&&e.startIndex===n.startIndex&&e.endIndex===n.endIndex);p&&t&&(s(t.properties?.url??``),l(Ey.transform.getPlainText(yv(e,t.startIndex,t.endIndex+1).dataStream)));return}let o=p==null||(e=p.getSelfOrHeaderFooterModel(t.segmentId))==null?void 0:e.getBody(),c=o?t:null,u=c&&Ey.customRange.getCustomRangesInterestsWithSelection(c,o?.customRanges??[])?.[0];if(p&&u){var d;s((u==null||(d=u.properties)==null?void 0:d.url)??``)}},[p,n,a,i]);let m=()=>{e.hideEditPopup()},h=()=>{if(d(!0),!f||!p)return;let t=kot(o);if(!n)r.executeCommand(Tot.id,{unitId:p.getUnitId(),payload:t});else{if(AG(c))return;r.executeCommand(Eot.id,{unitId:p.getUnitId(),payload:t,linkId:n.linkId,label:c,segmentId:n.segmentId})}e.hideEditPopup()};if(p)return(0,U.jsxs)(`div`,{className:tj(`univer-box-border univer-w-[328px] univer-rounded-xl univer-bg-white univer-px-6 univer-py-5 univer-shadow dark:!univer-bg-gray-900`,cj),children:[(0,U.jsxs)(`div`,{children:[n?(0,U.jsx)(Cj,{label:t.t(`docs-hyper-link-ui.edit.label`),error:u&&AG(c)?t.t(`docs-hyper-link-ui.edit.labelError`):``,children:(0,U.jsx)(Tj,{value:c,onChange:l,autoFocus:!0,onKeyDown:e=>{e.keyCode===xM.ENTER&&h()}})}):null,(0,U.jsx)(Cj,{label:t.t(`docs-hyper-link-ui.edit.address`),error:u&&!f?t.t(`docs-hyper-link-ui.edit.addressError`):``,children:(0,U.jsx)(Tj,{value:o,onChange:s,autoFocus:!0,onKeyDown:e=>{e.keyCode===xM.ENTER&&h()}})})]}),(0,U.jsxs)(`div`,{className:`univer-flex univer-justify-end univer-gap-3`,children:[(0,U.jsx)(rj,{onClick:m,children:t.t(`docs-hyper-link-ui.edit.cancel`)}),(0,U.jsx)(rj,{variant:`primary`,disabled:AG(o),onClick:h,children:t.t(`docs-hyper-link-ui.edit.confirm`)})]})]})};jG.componentKey=`docs-hyper-link-edit`;var Aot={type:L.COMMAND,id:`docs.command.delete-hyper-link`,async handler(e,t){if(!t)return!1;let{unitId:n,linkId:r,segmentId:i}=t,a=e.get(R),o=aAe(e,{unitId:n,rangeId:r,segmentId:i});return o?await a.syncExecuteCommand(o.id,o.params):!1}},jot=e=>{let t=e.get(sD),n=e.get(B),r=t.getTextRanges();if(!r?.length)return!0;let i=r[0];return!(n.getCurrentUnitOfType(M.UNIVER_DOC)&&i&&!i.collapsed)},MG={type:L.OPERATION,id:`doc.operation.show-hyper-link-edit-popup`,handler(e,t){let n=t?.link,r=e.get(B);if(jot(e)&&!n)return!1;let i=e.get(zG),a=n?.unitId||r.getCurrentUnitOfType(M.UNIVER_DOC)?.getUnitId();return a?(i.showEditPopup(a,n),!0):!1}},NG={type:L.OPERATION,id:`doc.operation.toggle-hyper-link-info-popup`,handler(e,t){let n=e.get(zG);return t?(n.showInfoPopup(t),!0):(n.hideInfoPopup(),!0)}},Mot={type:L.OPERATION,id:`doc.operation.click-hyper-link`,handler(e,t){var n;if(!t)return!1;let{unitId:r,linkId:i,segmentId:a}=t,o=e.get(B).getUnit(r,M.UNIVER_DOC)?.getSelfOrHeaderFooterModel(a).getBody(),s=o==null||(n=o.customRanges)==null||(n=n.find(e=>e.rangeId===i&&e.rangeType===Rp.HYPERLINK))==null||(n=n.properties)==null?void 0:n.url;return ep(s)?(window.open(s,`_blank`,`noopener noreferrer`),!0):!1}},PG=()=>{var e;let t=W(zG),n=W(R),r=W(gM),i=W(nx),a=nO(t.showingLink$),o=W(B);if(!a)return null;let{unitId:s,linkId:c,segmentId:l,startIndex:u,endIndex:d}=a,f=o.getUnit(s,M.UNIVER_DOC)?.getSelfOrHeaderFooterModel(l).getBody(),p=f==null||(e=f.customRanges)==null?void 0:e.find(e=>e.rangeId===c&&e.rangeType===Rp.HYPERLINK&&e.startIndex===u&&e.endIndex===d);if(!p)return null;let m=p.properties?.url;return(0,U.jsxs)(`div`,{className:tj(`univer-box-border univer-flex univer-max-w-80 univer-items-center univer-justify-between univer-overflow-hidden univer-rounded-lg univer-bg-white univer-p-3 univer-shadow dark:!univer-bg-gray-900`,cj),onClick:()=>{t.hideInfoPopup()},children:[(0,U.jsxs)(`div`,{className:`univer-flex univer-h-6 univer-flex-1 univer-cursor-pointer univer-items-center univer-truncate univer-text-sm univer-leading-5 univer-text-primary-500`,onClick:()=>window.open(m,void 0,`noopener noreferrer`),children:[(0,U.jsx)(`div`,{className:`univer-mr-2 univer-flex univer-size-5 univer-flex-[0_0_auto] univer-items-center univer-justify-center univer-text-base univer-text-gray-900 dark:!univer-text-white`,children:(0,U.jsx)(LD,{})}),(0,U.jsx)(Dj,{showIfEllipsis:!0,title:m,children:(0,U.jsx)(`span`,{className:`univer-flex-1 univer-truncate`,children:m})})]}),(0,U.jsxs)(`div`,{className:`univer-flex univer-h-6 univer-flex-[0_0_auto] univer-items-center univer-justify-center`,children:[(0,U.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base`,onClick:()=>{navigator.clipboard.writeText(m),r.show({content:i.t(`docs-hyper-link-ui.info.coped`),type:Oj.Info})},children:(0,U.jsx)(Dj,{placement:`bottom`,title:i.t(`docs-hyper-link-ui.info.copy`),children:(0,U.jsx)(SD,{})})}),(0,U.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base`,onClick:()=>{n.executeCommand(MG.id,{link:a})},children:(0,U.jsx)(Dj,{placement:`bottom`,title:i.t(`docs-hyper-link-ui.info.edit`),children:(0,U.jsx)(YD,{})})}),(0,U.jsx)(`div`,{className:`univer-ml-2 univer-flex univer-size-6 univer-cursor-pointer univer-items-center univer-justify-center univer-rounded univer-text-base`,onClick:()=>{n.executeCommand(Aot.id,{unitId:s,linkId:p.rangeId,segmentId:l})},children:(0,U.jsx)(Dj,{placement:`bottom`,title:i.t(`docs-hyper-link-ui.info.cancel`),children:(0,U.jsx)(qD,{})})})]})]})};PG.componentKey=`univer.doc.link-info-popup`;function FG(e){"@babel/helpers - typeof";return FG=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},FG(e)}function Not(e,t){if(FG(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(FG(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Pot(e){var t=Not(e,`string`);return FG(t)==`symbol`?t:t+``}function IG(e,t,n){return(t=Pot(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function LG(e,t){return function(n,r){t(n,r,e)}}function RG(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var zG=class extends P{constructor(e,t,n){super(),this._docCanvasPopupManagerService=e,this._textSelectionManagerService=t,this._univerInstanceService=n,IG(this,`_editingLink$`,new so(null)),IG(this,`_showingLink$`,new so(null)),IG(this,`editingLink$`,this._editingLink$.asObservable()),IG(this,`showingLink$`,this._showingLink$.asObservable()),IG(this,`_editPopup`,null),IG(this,`_infoPopup`,null),this.disposeWithMe(()=>{this._editingLink$.complete(),this._showingLink$.complete()})}get editing(){return this._editingLink$.value}get showing(){return this._showingLink$.value}showEditPopup(e,t){this._editPopup&&this._editPopup.dispose(),this._editingLink$.next(t);let n=this._textSelectionManagerService.getTextRanges({unitId:e,subUnitId:e}),r=n?.[n.length-1];if(t){let{segmentId:e,segmentPage:n,startIndex:i,endIndex:a}=t;r={collapsed:!1,startOffset:i,endOffset:a+1,segmentId:e,segmentPage:n},this._textSelectionManagerService.replaceDocRanges([{startOffset:i,endOffset:a+1}])}return r?(this._editPopup=this._docCanvasPopupManagerService.attachPopupToRange(r,{componentKey:jG.componentKey,direction:`bottom`},e),this._editPopup):null}hideEditPopup(){var e;this._editingLink$.next(null),(e=this._editPopup)==null||e.dispose()}showInfoPopup(e){let{linkId:t,unitId:n,segmentId:r,segmentPage:i,startIndex:a,endIndex:o}=e;if((this.showing?.linkId!==t||this.showing?.unitId!==n||this.showing?.segmentId!==r||this.showing?.segmentPage!==i||this.showing?.startIndex!==a||this.showing?.endIndex!==o)&&(this._infoPopup&&this._infoPopup.dispose(),this._univerInstanceService.getUnit(n,M.UNIVER_DOC)))return this._showingLink$.next({unitId:n,linkId:t,segmentId:r,segmentPage:i,startIndex:a,endIndex:o}),this._infoPopup=this._docCanvasPopupManagerService.attachPopupToRange({collapsed:!1,startOffset:a,endOffset:o+1,segmentId:r,segmentPage:i},{componentKey:PG.componentKey,direction:`top-center`,multipleDirection:`top`,onClickOutside:()=>{this.hideInfoPopup()}},n),this._infoPopup}hideInfoPopup(){var e;this._showingLink$.next(null),(e=this._infoPopup)==null||e.dispose()}};zG=RG([LG(0,j(_L)),LG(1,j(sD)),LG(2,B)],zG);var BG=class extends P{constructor(e,t,n){super(),this._commandService=e,this._univerInstanceService=t,this._docHyperLinkService=n,this._initSelectionChange()}_initSelectionChange(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===nD.id){let{unitId:n,ranges:r,segmentId:i}=e.params,a=this._univerInstanceService.getUnit(n,M.UNIVER_DOC),o=r[0];if(o&&a){var t;let{startOffset:e,endOffset:r,collapsed:s,segmentPage:c}=o,l=(t=a.getSelfOrHeaderFooterModel(i))==null||(t=t.getBody())==null?void 0:t.customRanges;if(s){let t=l?.findIndex(t=>t.startIndex<e&&t.endIndex>r-1)??-1;if(t>-1){let e=l[t];this._docHyperLinkService.showInfoPopup({unitId:n,linkId:e.rangeId,segmentId:i,segmentPage:c,startIndex:e.startIndex,endIndex:e.endIndex});return}}else if(l?.find(t=>t.startIndex<=e&&t.endIndex>=r-1))return}this._docHyperLinkService.hideInfoPopup(),this._docHyperLinkService.hideEditPopup()}}))}};BG=RG([LG(0,R),LG(1,B),LG(2,j(zG))],BG);var VG=class extends P{get _skeleton(){return this._docSkeletonManagerService.getSkeleton()}constructor(e,t,n,r,i,a){super(),this._context=e,this._docEventManagerService=t,this._commandService=n,this._hyperLinkPopupService=r,this._docSkeletonManagerService=i,this._docSelectionManagerService=a,this._context.unitId!==rf&&this._context.unitId!==tf&&(this._initHover(),this._initClick())}_hideInfoPopup(){this._hyperLinkPopupService.showing&&this._commandService.executeCommand(NG.id)}_initHover(){this.disposeWithMe(this._docEventManagerService.hoverCustomRanges$.subscribe(e=>{var t;let n=e.find(e=>e.range.rangeType===Rp.HYPERLINK),r=this._docSelectionManagerService.getTextRanges(),i=r==null||(t=r[0])==null?void 0:t.segmentId;if((n?.segmentId??``)!==i){this._hideInfoPopup();return}n?this._commandService.executeCommand(NG.id,{unitId:this._context.unitId,linkId:n.range.rangeId,segmentId:n.segmentId,segmentPage:n.segmentPageIndex,rangeId:n.range.rangeId,startIndex:n.range.startIndex,endIndex:n.range.endIndex}):this._hideInfoPopup()}))}_initClick(){this.disposeWithMe(this._docEventManagerService.clickCustomRanges$.subscribe(e=>{let t=e.range;t&&this._commandService.executeCommand(Mot.id,{unitId:this._context.unitId,linkId:t.rangeId,segmentId:e.segmentId})}))}};VG=RG([LG(1,j(yL)),LG(2,R),LG(3,j(zG)),LG(4,j(cD)),LG(5,j(sD))],VG);var HG=class extends P{constructor(e,t,n,r){super(),this._context=e,this._docInterceptorService=t,this._hyperLinkService=n,this._docRenderController=r,this._init(),this._initReRender()}_init(){this._docInterceptorService.intercept(pD.CUSTOM_RANGE,{handler:(e,t,n)=>{if(!e)return n(e);let{unitId:r,index:i}=t,a=this._hyperLinkService.showing;if(!a)return n({...e,active:!1});let{linkId:o,unitId:s,startIndex:c,endIndex:l}=a,u=s===r&&e.rangeId===o&&i>=c&&i<=l;return n({...e,active:u})}})}_initReRender(){this.disposeWithMe(this._hyperLinkService.showingLink$.pipe(Ys((e,t)=>e?.linkId===t?.linkId&&e?.unitId===t?.unitId&&e?.startIndex===t?.startIndex),ec()).subscribe(([e,t])=>{t?t.unitId===this._context.unitId&&this._docRenderController.reRender(t.unitId):e&&e.unitId===this._context.unitId&&this._docRenderController.reRender(e.unitId)}))}};HG=RG([LG(1,j(mD)),LG(2,j(zG)),LG(3,j(ML))],HG);var Fot=`doc-hyper-link-icon`;function UG(e){return{id:MG.id,type:IM.BUTTON,icon:Fot,title:`docs-hyper-link-ui.menu.tooltip`,tooltip:`docs-hyper-link-ui.menu.tooltip`,hidden$:Xj(e,M.UNIVER_DOC),disabled$:new Ya(function(t){let n=e.get(sD).textSelection$.pipe(Ks(16)).subscribe(()=>{t.next(jot(e))});return()=>{n.unsubscribe()}})}}var Iot={id:MG.id,binding:SM.CTRL_COMMAND|xM.K,description:`docs-hyper-link-ui.menu.tooltip`,preconditions:EL},Lot={[kM.MEDIA]:{[MG.id]:{order:1,menuItemFactory:UG}},[jM.MAIN_AREA]:{[MM.DATA]:{[MG.id]:{order:0,menuItemFactory:UG}}},[jM.PARAGRAPH]:{[MM.LAYOUT]:{[pL]:{[MG.id]:{order:6,menuItemFactory:UG}}},[cL]:{[MM.LAYOUT]:{[MG.id]:{order:6,menuItemFactory:UG}}}}},WG=class extends P{constructor(e,t,n,r){super(),this._componentManager=e,this._commandService=t,this._menuManagerService=n,this._shortcutService=r,this._initComponents(),this._initCommands(),this._initMenus(),this._initShortcut()}_initComponents(){[[jG.componentKey,jG],[PG.componentKey,PG],[Fot,LD]].forEach(([e,t])=>{this.disposeWithMe(this._componentManager.register(e,t))})}_initCommands(){[Tot,Eot,Aot,MG,NG,Mot].forEach(e=>{this._commandService.registerCommand(e)})}_initShortcut(){[Iot].forEach(e=>{this._shortcutService.registerShortcut(e)})}_initMenus(){this._menuManagerService.mergeMenu(Lot)}};WG=RG([LG(0,j(Yj)),LG(1,R),LG(2,NM),LG(3,wM)],WG);var Rot=`DOC_HYPER_LINK_UI_PLUGIN`,GG=class extends dx{constructor(e=wot,t,n,r){super(),this._config=e,this._injector=t,this._renderManagerSrv=n,this._configService=r;let{menu:i,...a}=Qi({},wot,this._config);i&&this._configService.setConfig(`menu`,i,{merge:!0}),this._configService.setConfig(Cot,a)}onStarting(){[[zG],[WG],[BG]].forEach(e=>{this._injector.add(e)}),this._injector.get(WG)}onReady(){this._injector.get(BG)}onRendered(){this._initRenderModule()}_initRenderModule(){[[HG],[VG]].forEach(e=>{this._renderManagerSrv.registerRenderModule(M.UNIVER_DOC,e)})}};IG(GG,`pluginName`,Rot),IG(GG,`packageName`,xot),IG(GG,`version`,Sot),IG(GG,`type`,M.UNIVER_DOC),GG=RG([px(kG),LG(1,j(We)),LG(2,ZE),LG(3,Nm)],GG);function zot(){return{plugins:[kG,GG].filter(e=>!!e)}}var Bot=Rg({"docs-hyper-link-ui":{edit:{confirm:`确认`,cancel:`取消`,title:`链接`,address:`链接`,label:`文本`,labelError:`请输入链接文本`,placeholder:`请输入合法的链接`,addressError:`请输入合法的链接`},info:{copy:`复制`,edit:`编辑`,cancel:`取消链接`,coped:`链接已被复制到剪贴板`},menu:{tooltip:`添加链接`}}}),Vot=12e4,Hot=65536,Uot=8192,Wot=1500,Got=4e3,Kot=16384,qot=100,Jot=512e3,Yot=class{docKey;docType;snapshotInterval;mutationFlushSize;cloudSync;incrementalMode;editorRef=null;revision=0;lastSnapshotRevision=0;lastPersistedRevision=0;pendingMutations=[];pendingBytes=0;snapshotTimer=null;disposed=!1;saving=!1;debounceTimer=null;lastFlushTime=0;mutationsSinceSnapshot=0;bytesSinceSnapshot=0;lastSnapshotTime=0;commandEventDisposable=null;pagehideHandler=null;constructor(e){this.docKey=e.docKey,this.docType=e.docType,this.snapshotInterval=e.snapshotInterval??Vot,this.mutationFlushSize=e.mutationFlushSize??Hot,this.cloudSync=e.cloudSync,this.incrementalMode=e.enableIncremental??!0}async attach(e){this.editorRef=e;let t=Date.now()+3e3;for(;Date.now()<t&&!(typeof e.ready==`function`?e.ready():e.getData()!=null);)await new Promise(e=>setTimeout(e,100));this.revision=e.getVersion(),this.incrementalMode&&typeof e.onMutation==`function`&&(this.commandEventDisposable=e.onMutation(e=>{this.handleCommandEvent(e)}),console.log(`[EditorPersistence] 已接入 onMutation 增量事件`)),await this.tryRestore(),this.lastSnapshotTime=Date.now(),this.snapshotTimer=setInterval(()=>{this.takeSnapshotIfNeeded()},Math.min(this.snapshotInterval,3e4)),this.pagehideHandler=()=>{this.takeSnapshotSync()},window.addEventListener(`pagehide`,this.pagehideHandler)}dispose(){this.disposed||(this.disposed=!0,this.snapshotTimer&&=(clearInterval(this.snapshotTimer),null),this.debounceTimer&&=(clearTimeout(this.debounceTimer),null),this.commandEventDisposable?.(),this.commandEventDisposable=null,this.pagehideHandler&&=(window.removeEventListener(`pagehide`,this.pagehideHandler),null),this.editorRef=null)}handleCommandEvent(e){if(!e||!e.id)return;let t={commandId:e.id,params:e.params??{},timestamp:e.timestamp??Date.now()};this.revision++,this.pendingMutations.push(t);let n=256;try{n=JSON.stringify(t.params).length*2}catch{}if(this.pendingBytes+=n,this.mutationsSinceSnapshot++,this.bytesSinceSnapshot+=n,n>=Kot){this.flushMutations();return}if(this.pendingBytes>=this.mutationFlushSize){this.flushMutations();return}this.resetDebounceTimer()}resetDebounceTimer(){this.debounceTimer&&clearTimeout(this.debounceTimer);let e=Date.now()-this.lastFlushTime;if(e>=Got){this.flushMutations();return}let t=Math.min(Wot,Got-e);this.debounceTimer=setTimeout(()=>{this.debounceTimer=null,this.flushMutations()},t)}async flushMutations(){if(!this.pendingMutations.length||this.saving)return;if(!this.cloudSync){this.pendingMutations.length=0,this.pendingBytes=0;return}let e=this.pendingMutations.splice(0);this.pendingBytes=0,this.saving=!0,this.lastFlushTime=Date.now();let t=this.compactMutations(e);try{await this.cloudSync.saveMutations({docKey:this.docKey,mutations:t.map(e=>({revision:e._rev??this.revision,commandId:e.commandId,params:e.params,timestamp:e.timestamp}))}),this.lastPersistedRevision=this.revision}catch(t){this.pendingMutations.unshift(...e);try{this.pendingBytes+=JSON.stringify(e).length*2}catch{this.pendingBytes+=e.length*256}console.warn(`[EditorPersistence] 增量云端同步失败,将在下次重试`,t)}finally{this.saving=!1}}compactMutations(e){if(e.length<=1)return e;let t=[],n=this.revision-e.length;for(let r=0;r<e.length;r++){let i=e[r],a=n+r+1,o=this.extractMutationTargetKey(i);if(o&&t.length>0){let e=t[t.length-1];if(o===this.extractMutationTargetKey(e)&&i.commandId===e.commandId){t[t.length-1]={...i,_rev:a};continue}}t.push({...i,_rev:a})}return t}extractMutationTargetKey(e){let t=e.params;if(!t||typeof t!=`object`)return null;let n=typeof t.subUnitId==`string`?t.subUnitId:``,r=t.range;if(!r||typeof r!=`object`)return null;let i=r.startRow??r.sr,a=r.startColumn??r.sc,o=r.endRow??r.er,s=r.endColumn??r.ec;return i==null||a==null||o==null||s==null?null:`${n}:${i}:${a}:${o}:${s}`}async takeSnapshotIfNeeded(){if(!this.editorRef||this.saving||!this.editorRef.isDirty()&&this.revision===this.lastSnapshotRevision)return;let e=Date.now()-this.lastSnapshotTime,t=this.mutationsSinceSnapshot>=qot,n=this.bytesSinceSnapshot>=Jot,r=e>=this.snapshotInterval;(t||n||r)&&(await this.takeSnapshot(),this.mutationsSinceSnapshot=0,this.bytesSinceSnapshot=0,this.lastSnapshotTime=Date.now())}async takeSnapshot(){if(!this.editorRef||this.saving)return;this.incrementalMode&&this.pendingMutations.length&&await this.flushMutations();let e=this.editorRef.getData();if(e){this.revision=this.editorRef.getVersion(),this.saving=!0;try{if(this.cloudSync){let t=JSON.stringify(e),n=e,r=!1;if(t.length>Uot&&typeof CompressionStream<`u`)try{n=Zot(await Xot(t)),r=!0}catch{n=e}await this.cloudSync.saveSnapshot({docKey:this.docKey,docType:this.docType,revision:this.revision,data:n,compressed:r}),this.lastPersistedRevision=this.revision,this.lastSnapshotRevision=this.revision}}catch(e){console.warn(`[EditorPersistence] 快照持久化失败`,e)}finally{this.saving=!1}}}takeSnapshotSync(){if(!this.editorRef)return;let e=this.editorRef.getData();if(!e)return;let t=this.editorRef.getVersion();if(this.cloudSync){let n=this.cloudSync.getBeaconUrl?.();if(n)try{let r=JSON.stringify({docKey:this.docKey,docType:this.docType,revision:t,data:e,timestamp:Date.now()});navigator.sendBeacon(n,r)}catch{}}}async tryRestore(){if(this.editorRef)try{if(!this.cloudSync)return;let e=await this.cloudSync.restore(this.docKey,this.docType);e?.snapshot?.data&&this.editorRef.setData(e.snapshot.data)&&(this.lastSnapshotRevision=e.snapshot.revision,this.revision=e.snapshot.revision,this.lastPersistedRevision=e.snapshot.revision,console.log(`[EditorPersistence] 已从云端快照恢复(revision=${e.snapshot.revision})`))}catch(e){console.warn(`[EditorPersistence] 恢复失败,将以空白文档开始`,e)}}getRevision(){return this.revision}getDocKey(){return this.docKey}hasUnsavedChanges(){return this.revision>this.lastPersistedRevision}getLastPersistedRevision(){return this.lastPersistedRevision}async clearLocalPersistence(){this.lastSnapshotRevision=0}async flush(){this.incrementalMode&&await this.flushMutations(),await this.takeSnapshot()}};async function Xot(e){let t=new TextEncoder().encode(e),n=new CompressionStream(`gzip`),r=n.writable.getWriter(),i=n.readable.getReader();r.write(t),r.close();let a=[],o=0;for(;;){let{done:e,value:t}=await i.read();if(e)break;a.push(t),o+=t.byteLength}let s=new Uint8Array(o),c=0;for(let e of a)s.set(e,c),c+=e.byteLength;return s.buffer}function Zot(e){let t=new Uint8Array(e),n=``;for(let e=0;e<t.byteLength;e++)n+=String.fromCharCode(t[e]);return btoa(n)}function KG(e){let{editorRef:n,docKey:r,docType:i,cloudSync:a,snapshotInterval:o,mutationFlushSize:s,enableIncremental:c=!0}=e,l=(0,t.ref)(`idle`),u=(0,t.ref)(null),d=(0,t.ref)(0),f=(0,t.shallowRef)(null),p=new Yot({docKey:r,docType:i,cloudSync:a,snapshotInterval:o,mutationFlushSize:s,enableIncremental:c});f.value=p;let m=e.ready??n,h=null;(0,t.watch)(m,async e=>{if(e&&n.value)try{l.value=`saving`,await p.attach(n.value),d.value=p.getRevision(),l.value=`idle`,h=setInterval(()=>{p.hasUnsavedChanges()?l.value=`saving`:l.value===`saving`&&(l.value=`saved`,u.value=Date.now(),d.value=p.getRevision(),setTimeout(()=>{l.value===`saved`&&(l.value=`idle`)},2e3))},3e3)}catch(e){console.warn(`[useEditorPersistence] 初始化失败`,e),l.value=`error`}},{immediate:!0}),(0,t.onBeforeUnmount)(()=>{h&&clearInterval(h),p.dispose(),f.value=null});async function g(){l.value=`saving`;try{await p.takeSnapshot(),d.value=p.getRevision(),u.value=Date.now(),l.value=`saved`,setTimeout(()=>{l.value===`saved`&&(l.value=`idle`)},2e3)}catch{l.value=`error`}}async function _(){l.value=`saving`;try{await p.flush(),d.value=p.getRevision(),u.value=Date.now(),l.value=`saved`,setTimeout(()=>{l.value===`saved`&&(l.value=`idle`)},2e3)}catch{l.value=`error`}}async function v(){await p.clearLocalPersistence()}return{saveStatus:l,lastSavedAt:u,revision:d,manager:f,takeSnapshot:g,flush:_,clearPersistence:v}}async function Qot(e,t,n){if(!e)return e;try{let r=await n(t),i=typeof r==`string`?r:r?.url;return i?{...e,imageId:typeof r==`object`&&r?.imageId||e.imageId,imageSourceType:cb.URL,source:i}:e}catch{return e}}function $ot(e){return class extends RJe{async saveImage(t){return Qot(await super.saveImage(t),t,e)}}}function est(e,t){if(!e||typeof e.saveImage!=`function`||e.__hxyUploadPatched)return!1;let n=e.saveImage.bind(e);return e.saveImage=async e=>Qot(await n(e),e,t),e.__hxyUploadPatched=!0,!0}var tst=25,nst=200;function qG(e){let t=e?.server;if(!t||!t.imageUpload&&!t.resolveImage)return null;let n=e?.univer?.__getInjector?.();if(!n)return null;let r=null,i=0,a=!t.imageUpload,o=!t.resolveImage,s=null,c=()=>{r&&=(clearTimeout(r),null)},l=e=>typeof n.has!=`function`||n.has(e),u=()=>{if(a&&o)return c();if(i+=1,!a)try{l(ub)&&(n.replace([ub,{useClass:$ot(t.imageUpload)}]),a=!0)}catch{try{est(n.get(ub),t.imageUpload)&&(a=!0)}catch{}}if(!o)try{if(l(db)){let e=n.get(db);typeof e?.registerURLImageDownloader==`function`&&(s=e.registerURLImageDownloader(async e=>{try{return await t.resolveImage(e)||e}catch{return e}}),o=!0)}}catch{}if(a&&o)return c();if(i>=nst){c();return}r=setTimeout(u,tst)};return u(),{dispose(){c(),s?.dispose?.(),s=null}}}var rst=(e,t)=>{let n=e.__vccOpts||e;for(let[e,r]of t)n[e]=r;return n},ist={class:`doc-shell`},ast={class:`doc-layout`},ost={class:`doc-canvas`},sst={key:0,class:`readonly-badge`},cst={class:`link-dialog`},lst={class:`link-dialog-field`},ust={class:`link-dialog-field`},dst={key:0,class:`field-error`},fst={class:`link-dialog-tip`},pst={class:`link-dialog-actions`},mst=[`disabled`],hst={key:0,class:`hover-icon-tip`},gst={class:`hover-style`},_st={key:0,class:`hover-style-menu`},vst=[`onClick`],yst={class:`style-check`},bst={class:`style-name`},JG=`demo-doc-01`,xst=`univer-sheet://`,YG=`🔗 `,Sst=`#e4f9fbff`,Cst=2,wst=rst({__name:`DocEditor`,props:{visible:{type:Boolean,default:!0},type:{type:String,default:`edit`,validator:e=>[`view`,`edit`].includes(e)},server:{type:Object,default:null}},emits:[`open-workbook`],setup(e,{expose:n,emit:r}){let i=e,a=r,o=(0,t.computed)(()=>i.type===`view`);try{let e=yL.prototype,t=e._buildCustomRangeBoundsBySegment;if(typeof t==`function`&&!t.__hoverSegmentFixed){let n=function(e,n=-1){return t.call(this,e??``,n)};n.__hoverSegmentFixed=!0,e._buildCustomRangeBoundsBySegment=n,console.log(`[hover-patch] prototype._buildCustomRangeBoundsBySegment patched ✓`)}else typeof t!=`function`&&console.warn(`[hover-patch] _buildCustomRangeBoundsBySegment not found on prototype — engine API changed?`);let n=vI.prototype,r=n._addTextRange;if(typeof r==`function`&&!r.__singleCaretFixed){let e=function(e){r.call(this,e);let t=0;for(let e of this._rangeList)e.collapsed&&t++;t<=1||(this._rangeList=this._rangeList.filter(t=>t===e||!t.collapsed||(t.dispose(),!1)))};e.__singleCaretFixed=!0,n._addTextRange=e}}catch{}let s=(0,t.ref)(null),c=(0,t.shallowRef)(null),l=(0,t.ref)(null),u=null,d=(0,t.shallowRef)(null),f=i.server?.cloudSync?KG({editorRef:d,docKey:i.server.docKey||`doc:default`,docType:`doc`,cloudSync:i.server.cloudSync,snapshotInterval:i.server.snapshotInterval,mutationFlushSize:i.server.mutationFlushSize,enableIncremental:i.server.enableIncremental}):null,p=(0,t.ref)([]);(0,t.ref)(``);let m=(0,t.reactive)({words:0,paragraphs:0}),h=(0,t.reactive)({visible:!1,text:``,url:``,urlError:``,style:`text`,startOffset:0,endOffset:0,segmentId:``,replace:!1}),g=null,_=[{value:`text`,label:`文字链`},{value:`icon`,label:`图标+文字链`},{value:`card`,label:`卡片`}],v=(0,t.reactive)({visible:!1,url:``,text:``,style:`text`,linkId:``,segmentId:``,startIndex:0,endIndex:0,styleMenuOpen:!1,copied:!1,x:null,y:null}),y=null,b=null,x=null,S=!1,C=null,w=[],T=null,E=!1,D=!1,O=null,k=null,A=null,ee=null,te=0,ne=-1,re=[];function ie(e){return re.push(e),()=>{let t=re.indexOf(e);t>=0&&re.splice(t,1)}}function ae(e){let t=e.trim();return t?/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)?t:/^[w.-]+@([w-]+.)+[w-]{2,4}$/.test(t)?`mailto:${t}`:`https://${t}`:``}function oe(e){try{let t=new URL(ae(e));return[`http:`,`https:`,`mailto:`,`univer-sheet:`].includes(t.protocol)}catch{return!1}}function se(){if(o.value)return;let e=g,n=``;e&&!e.collapsed&&(n=(c.value?.getUniverDoc?.(JG)?.getSnapshot()?.body?.dataStream||``).slice(e.startOffset,e.endOffset).replace(/[\r\n]+$/,``)),h.text=n,h.url=``,h.urlError=``,h.style=`text`,h.replace=!(!e||e.collapsed);let r=c.value?.getUniverDoc?.(JG)?.getSnapshot()?.body?.dataStream?.length??0;h.startOffset=e?e.startOffset:Math.max(0,r-2),h.endOffset=e?e.endOffset:h.startOffset,h.segmentId=e?.segmentId||``,h.visible=!0,(0,t.nextTick)(()=>{h.text||l.value?.focus()})}function ce(){h.visible=!1}function le(e,t){return t===`text`?e:`${YG}${e}`}function ue(e,t,n,r){if(t===`card`){let i=`──查看`,a=` 📄${e}${i} `,o=a.indexOf(`📄`),s=o+2,c=a.indexOf(i),l={bg:{rgb:`#e4f9fbff`},fs:18};return{dataStream:a,customRanges:[{startIndex:0,endIndex:a.length-1,rangeId:n,rangeType:3,wholeEntity:!0,properties:{url:r,text:e,style:t}}],textRuns:[{st:0,ed:1,ts:{...l}},{st:1,ed:2,ts:{...l,cl:{rgb:`#bfbfbf`}}},{st:2,ed:o+2,ts:{...l}},{st:s,ed:c,ts:{...l,cl:{rgb:`#3370ff`},bl:!0}},{st:c,ed:a.length-1,ts:{...l,cl:{rgb:`#6150fcff`},bl:!0}},{st:a.length-1,ed:a.length,ts:{...l}}]}}let i=le(e,t),a={startIndex:0,endIndex:i.length-1,rangeId:n,rangeType:0,properties:{url:r,text:e,style:t}},o={dataStream:i,customRanges:[a]};return t===`icon`&&(a.show=!1,o.textRuns=[{st:0,ed:i.length,ts:{cl:{rgb:`#3370ff`}}}]),o}async function de({text:e,url:t,style:n,startOffset:r,endOffset:i,segmentId:a,replace:o}){let s=`link-${Date.now()}-${Math.floor(Math.random()*1e4)}`,l=ue(e,n,s,t);return await c.value?.executeCommand?.(`doc.command.insert-text`,{unitId:JG,range:{startOffset:r,endOffset:i,collapsed:!o,segmentId:a},segmentId:a,body:l,cursorOffset:l.dataStream.length})?{rangeId:s,startIndex:r,endIndex:r+l.dataStream.length-1}:null}async function fe(){if(!h.url.trim()){h.urlError=`请输入链接地址`;return}if(!oe(h.url)){h.urlError=`链接格式不正确`;return}await de({text:(h.text.trim()||h.url.trim()).replace(/[\r\n]+/g,` `),url:ae(h.url),style:h.style,startOffset:h.startOffset,endOffset:h.endOffset,segmentId:h.segmentId,replace:h.replace})?(ce(),ke()):h.urlError=`插入失败,请重试`}function pe(e){return(c.value?.getUniverDoc?.(JG)?.getSnapshot()?.body)?.customRanges?.find(t=>t.rangeId===e&&(t.rangeType===0||t.rangeType===3))||null}function me(e){if(!e?.linkId){ge();return}if(_e(),v.visible&&e.linkId===v.linkId&&e.startIndex===v.startIndex)return;let t=pe(e.linkId);if(!t){he();return}let n=(c.value?.getUniverDoc?.(JG)?.getSnapshot()?.body?.dataStream||``).slice(t.startIndex,t.endIndex+1),r=t.properties||{};v.url=r.url||``,v.text=(r.text||n.replace(YG,``)).replace(/[\s\u00A0\u2000-\u200B\u3000]+$/g,``),v.style=r.style||`text`,v.linkId=e.linkId,v.segmentId=e.segmentId||``,v.startIndex=t.startIndex,v.endIndex=t.endIndex,v.styleMenuOpen=!1,v.copied=!1,v.x=null,v.y=null,v.visible=!0,y=e,j()}function he(){clearTimeout(b),clearTimeout(x),x=null,S=!1,v.visible=!1,v.styleMenuOpen=!1,v.copied=!1}function ge(e=320){S||(clearTimeout(x),x=setTimeout(()=>{x=null,he()},e))}function _e(){clearTimeout(x),x=null}function ve(){S=!0,_e()}function ye(){S=!1,ge(160)}function be(){he(),c.value?.executeCommand?.(`doc.operation.toggle-hyper-link-info-popup`)}function j(e=12){if(clearTimeout(b),!v.visible)return;let t=Array.from(document.querySelectorAll(`[data-u-comp="rect-popup"]`)).find(e=>e.querySelector(`.univer-max-w-80`))?.getBoundingClientRect();if(!t||t.left<-9e3||!t.width&&!t.height){e>0?b=setTimeout(()=>j(e-1),50):he();return}v.x=t.left+t.width/2,v.y=Math.max(t.top,8)}function xe(){let e=v.url;e.startsWith(xst)?a(`open-workbook`,e.slice(15)):e&&window.open(e,`_blank`,`noopener noreferrer`),be()}async function Se(){let e=v.url;try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else throw Error(`clipboard unavailable`)}catch{let t=document.createElement(`textarea`);t.value=e,t.style.cssText=`position:fixed;opacity:0`,document.body.appendChild(t),t.select();try{document.execCommand(`copy`)}catch{}t.remove()}v.copied=!0,clearTimeout(C),C=setTimeout(()=>{v.copied=!1},1200)}function Ce(){o.value||(he(),be(),h.text=v.text,h.url=v.url,h.urlError=``,h.style=v.style,h.replace=!0,h.startOffset=v.startIndex,h.endOffset=v.endIndex+1,h.segmentId=v.segmentId,h.visible=!0)}async function we(e){if(o.value||(v.styleMenuOpen=!1,e===v.style))return;let{text:t,url:n,segmentId:r,startIndex:i,endIndex:a}=v,s=await de({text:t,url:n,style:e,startOffset:i,endOffset:a+1,segmentId:r,replace:!0});s&&(ke(),c.value?.executeCommand?.(`doc.operation.toggle-hyper-link-info-popup`,{...y||{},unitId:JG,linkId:s.rangeId,rangeId:s.rangeId,startIndex:s.startIndex,endIndex:s.endIndex}))}async function Te(){if(o.value)return;let{text:e,segmentId:t,startIndex:n,endIndex:r}=v;await c.value?.executeCommand?.(`doc.command.insert-text`,{unitId:JG,range:{startOffset:n,endOffset:r+1,collapsed:!1,segmentId:t},segmentId:t,body:{dataStream:e},cursorOffset:e.length})&&(be(),ke())}function Ee(){v.styleMenuOpen&&=!1,v.visible&&he()}function De(){v.visible&&he(),clearTimeout(De._t),De._t=setTimeout(()=>{if(T)try{let e=c.value?.getUniverDoc?.(JG)?.getSnapshot()?.body;if(!e?.customRanges)return;w=[];for(let t of e.customRanges){if(t.rangeType!==0&&t.rangeType!==3)continue;let e=gL({startOffset:t.startIndex,endOffset:t.endIndex+1,collapsed:!1},T);e?.length&&w.push({rangeId:t.rangeId,startIndex:t.startIndex,endIndex:t.endIndex,rects:e,style:t.properties?.style||`text`,text:t.properties?.text||``,url:t.properties?.url||``})}}catch{}},200)}let Oe=null;function ke(){clearTimeout(Oe),Oe=setTimeout(Ae,300)}function Ae(){let e=c.value?.getUniverDoc?.(JG);if(!e)return;let t=e.getSnapshot()?.body;if(!t)return;let n=t.dataStream||``,r=t.paragraphs||[],i=[];for(let e=0;e<r.length;e++){let t=r[e],a=t.paragraphStyle?.headingLevel;if(!a)continue;let o=t.startIndex,s=r[e+1]?.startIndex??n.length,c=n.slice(o,s).replace(/[\u0000-\u001f]/g,``);c.trim()&&i.push({id:`h-${o}`,level:a,text:c,startIndex:o})}p.value=i,m.paragraphs=r.length;let a=n.replace(/[\r\n]/g,``),o=(a.match(/[\u4e00-\u9fff]/g)||[]).length,s=(a.replace(/[\u4e00-\u9fff]/g,` `).match(/[A-Za-z0-9]+/g)||[]).length;m.words=o+s}function je(e){if(e.id!==`doc.operation.click-hyper-link`)return;let{linkId:t}=e.params||{};if(!t)return;let n=(c.value?.getUniverDoc?.(JG)?.getSnapshot()?.body)?.customRanges?.find(e=>e.rangeId===t);if(!n)return;let r=n.properties?.url||``;if(r){if(r.startsWith(xst)){a(`open-workbook`,r.slice(15)),e.cancel=!0;return}n.rangeType===3&&oe(r)&&(window.open(ae(r),`_blank`,`noopener,noreferrer`),e.cancel=!0)}}function Me(){let e=c.value?.getUniverDoc?.(JG),t=e?.getSnapshot()?.body?.dataStream||``;if(!e||!t)return!1;let n=Math.max(0,t.length-2);return e.setSelection(n,n),g={startOffset:n,endOffset:n,segmentId:``,collapsed:!0},!0}function Ne(e){je(e),!o.value&&e.id===`doc.operation.show-hyper-link-edit-popup`&&!e.params?.link&&(e.cancel=!0,se()),[`doc.operation.create-table`,`doc.command.create-table`,`doc.command.insert-float-image`].includes(e.id)&&!g&&Me()&&(e.cancel=!0,c.value?.executeCommand?.(e.id,{...e.params||{}}))}function Pe(e){if(e.id!==`doc.operation.set-selections`&&e.id!==`doc.operation.toggle-hyper-link-info-popup`&&te++,e.type===Cst)for(let t of re)try{t({id:e.id,params:e.params,type:e.type,timestamp:Date.now()})}catch{}if(e.id===`doc.operation.set-selections`){let t=e.params?.ranges?.[0];t&&(g={startOffset:t.startOffset,endOffset:t.endOffset,segmentId:t.segmentId||e.params?.segmentId||``,collapsed:t.collapsed??t.startOffset===t.endOffset})}e.id===`doc.operation.toggle-hyper-link-info-popup`&&me(e.params),ke()}function Fe(){if(!s.value||c.value)return;let{univer:e,univerAPI:t}=mS({locale:bp.ZH_CN,locales:{[bp.ZH_CN]:Rg([yit,lot,Bot])},presets:[hit({container:s.value,ribbonType:`simple`}),oot(),zot()]});try{e.__getInjector().get(Nm).setConfig(`menu`,{"doc.operation.show-hyper-link-edit-popup":{disabled:!1}},{merge:!0})}catch{}t.createUniverDoc({id:JG,title:``,documentStyle:{pageSize:{width:794,height:1123},marginTop:72,marginBottom:72,marginLeft:80,marginRight:80},tableSource:{},drawings:{},drawingsOrder:[],body:{dataStream:`\r
|
|
586
|
-
`,textRuns:[],tables:[],sectionBreaks:[]}});try{e.__getInjector().get(B).focusUnit(JG)}catch{}O=e,c.value=t,Be(),Ve(),u||=qG({univer:e,server:i.server}),f&&!d.value&&(d.value={getData:Ie,setData:ze,getVersion:Le,isDirty:Re,ready:()=>!!c.value,getUniverInstance:()=>O,getUniverAPI:()=>c.value,onMutation:ie}),t.addEvent(t.Event.CommandExecuted,Pe),t.addEvent(t.Event.BeforeCommandExecute,Ne),window.addEventListener(`pointerdown`,Ee),window.addEventListener(`scroll`,De,!0),window.addEventListener(`resize`,De),Ae(),He(1e3)}function Ie(){let e=c.value?.getUniverDoc?.(JG)?.getSnapshot?.();return e?.body?.dataStream?(ne=te,{type:`univer-doc`,unitId:JG,version:te,savedAt:Date.now(),data:JSON.parse(JSON.stringify(e))}):null}function Le(){return te}function Re(){return te!==ne}function ze(e){let t=e?.type===`univer-doc`?e.data:e;if(!t?.body?.dataStream)return!1;let n=c.value;if(!n)return!1;try{he()}catch{}try{n.executeCommand?.(`doc.operation.toggle-hyper-link-info-popup`)}catch{}k?.abort(),k=null,A?.dispose?.(),A=null;try{n.disposeUnit?.(JG)}catch{}n.createUniverDoc({...JSON.parse(JSON.stringify(t)),id:t.id||JG}),Be(),te++,g=null,w=[];try{O?.__getInjector?.()?.get(B)?.focusUnit(JG)}catch{}return He(300),Ve(),ke(),!0}function Be(){try{let e=(O?.__getInjector?.()?.get(B)?.getUniverDocInstance?.(JG))?.getSnapshot?.(),t=e?.body;if(!t)return;t.textRuns??=[],t.tables??=[],t.sectionBreaks??=[],e.tableSource??={}}catch{}}function Ve(){try{(O?.__getInjector?.()?.get(B)?.getUniverDocInstance?.(JG))?.setDisabled?.(o.value)}catch{}}function He(e=1e3){setTimeout(()=>{if(!O)return;let t=O.__getInjector(),n=t.get(ZE).getRenderById(JG),r=s.value?.querySelector(`canvas`);if(!n||!r){if(e<2e3){He(e+400);return}console.warn(`[canvas-features] render/canvas not ready`);return}if(T=n,!E)try{let e=n.with(cD)?.getSkeleton();if(e){let t=e,n=null;for(;t;){let e=Object.getPrototypeOf(t);if(!e)break;if(e.draw&&e.isSkipByDiffBounds){n=e;break}t=e}if(n){let e=n.draw;if(!e.__cardBgPatch){let t=function(t,n){let r=null;try{let e=this.getSkeleton?.(),t=e?.getSkeletonData?.();if(t?.pages?.length){let n=((e.getViewModel?.())?.getDataModel?.())?.getBody?.();if(n?.customRanges){r=new Set;for(let e of n.customRanges)if(e.rangeType===3)for(let t=e.startIndex;t<=e.endIndex;t++)r.add(t);if(r.size>0){let e=0;for(let n of t.pages)for(let t of n.sections)for(let n of t.columns)for(let t of n.lines)for(let n of t.divides)for(let t of n.glyphGroup)t.content&&r.has(e)&&(t.ts&&!t.ts.bg&&(t.ts.bg={rgb:Sst}),t._isCardGlyph=!0),e+=t.count||1}}}if(r?.size>0){let e=this.getExtensionByKey?.(`DefaultDocsBackgroundExtension`);if(e&&!e.__cardPaddingPatched){let t=e.draw.bind(e);e.draw=function(e,n,r){if(r._isCardGlyph){let t=r.parent?.parent;if(t&&r.ts?.bg){let{contentHeight:n=0}=t,i=Hh(r.ts.bg),a=this.extensionOffset?.spanStartPoint;if(i&&a&&r.content!==`\r`){e.fillStyle=i,e.fillRect(a.x-1,a.y-6,r.width+2,n+11);return}}}return t(e,n,r)},e.__cardPaddingPatched=!0}}}catch{}return e.call(this,t,n)};t.__cardBgPatch=!0,n.draw=t,E=!0,console.log(`[card-bg-patch] Documents.draw patched ✓`)}}}}catch(e){console.warn(`[card-bg-patch] failed to apply:`,e)}if(!D)try{let e=pI.prototype.refresh;if(!e.__cardSelectionPatch){let t=function(){e.call(this);try{if(!this._rangeShape)return;let e=(this._docSkeleton?.getViewModel?.())?.getDataModel?.()?.getBody?.();if(!e?.customRanges)return;let t=this.startOffset,n=this.endOffset;if(t==null||n==null)return;for(let r of e.customRanges)if(r.rangeType===3&&t<=r.endIndex&&n>=r.startIndex){this._rangeShape.hide();return}}catch{}};t.__cardSelectionPatch=!0,pI.prototype.refresh=t,D=!0,console.log(`[card-selection-patch] TextRange.refresh patched ✓`)}}catch(e){console.warn(`[card-selection-patch] failed to apply:`,e)}k?.abort(),A?.dispose?.();let i=new AbortController;k=i;let a={signal:i.signal};try{let e=n.with(yL);if(e){let t=e._buildCustomRangeBoundsBySegment;typeof t==`function`&&!t.__instHoverFixed&&(e._buildCustomRangeBoundsBySegment=function(e,n=-1){return t.call(this,e??``,n)},e._buildCustomRangeBoundsBySegment.__instHoverFixed=!0)}function l(){w=[];try{let e=c.value?.getUniverDoc?.(JG)?.getSnapshot()?.body;if(!e?.customRanges)return;for(let t of e.customRanges){if(t.rangeType!==0&&t.rangeType!==3)continue;let e=gL({startOffset:t.startIndex,endOffset:t.endIndex+1,collapsed:!1},n);e?.length&&w.push({rangeId:t.rangeId,startIndex:t.startIndex,endIndex:t.endIndex,rects:e,style:t.properties?.style||`text`,text:t.properties?.text||``,url:t.properties?.url||``})}console.log(`[hover-patch] link rects computed: ${w.length} links found`)}catch(e){console.warn(`[hover-patch] recomputeLinkRects failed:`,e)}}l(),A=c.value?.addEvent?.(c.value?.Event?.CommandExecuted,()=>{clearTimeout(ee),ee=setTimeout(l,150)}),r&&(r.addEventListener(`mousemove`,e=>{if(!w.length)return;r.getBoundingClientRect();let t=e.clientX,n=e.clientY,i=null;for(let e of w){for(let r of e.rects)if(t>=r.left&&t<=r.right&&n>=r.top&&n<=r.bottom){i=e;break}if(i)break}if(i){if(_e(),v.visible&&i.rangeId===v.linkId)return;let e=pe(i.rangeId);if(!e)return;let t=(c.value?.getUniverDoc?.(JG)?.getSnapshot()?.body?.dataStream||``).slice(e.startIndex,e.endIndex+1),n=e.properties||{};v.url=n.url||``,v.text=(n.text||t.replace(YG,``)).replace(/[\s\u00A0\u2000-\u200B\u3000]+$/g,``),v.style=n.style||`text`,v.linkId=i.rangeId,v.segmentId=``,v.startIndex=i.startIndex,v.endIndex=i.endIndex,v.styleMenuOpen=!1,v.copied=!1;let r=i.rects.reduce((e,t)=>e.top<t.top?e:t),a=i.rects[Math.floor(i.rects.length/2)];v.x=(a.left+a.right)/2,v.y=Math.max(r.top-4,40),v.visible=!0,y={unitId:JG,linkId:i.rangeId,segmentId:``,segmentPage:-1,rangeId:i.rangeId,startIndex:i.startIndex,endIndex:i.endIndex},c.value?.executeCommand?.(`doc.operation.toggle-hyper-link-info-popup`,y)}else v.visible&&ge()},a),console.log(`[hover-patch] DOM mousemove hover detection active ✓`))}catch(e){console.warn(`[hover-patch] self-implemented hover detection failed:`,e)}try{let e=null;function u(){let e=n.with(cD).getSkeleton()?.getSkeletonData();if(!e)return[];let t=[],{scene:r,engine:i}=n,{scaleX:a}=r.getAncestorScale(),o=r.getViewport(`viewMain`)?.viewportScrollX||0,s=i.getCanvasElement().getBoundingClientRect(),l=parseFloat(i.getCanvasElement().style.width)||s.width,u=s.width/l,{docsLeft:d}=n.mainComponent.getOffsetConfig(),f=e.pages[0]?.marginLeft||0,p=e=>(e-o+d*a)*u+s.left;for(let r of e.pages)for(let e of r.skeTables.values()){let r=f+e.left,i=r,o=[],l=(c.value?.getUniverDoc?.(JG)?.getSnapshot())?.tableSource?.[e.tableId]?.tableColumns||[];if(l.length>0)for(let t=0;t<l.length;t++)i+=l[t].size.width.v,o.push({x:i,colIndex:t,tableId:e.tableId,colWidth:l[t].size.width.v});else for(let t of e.rows){let n=r;for(let r=0;r<t.cells.length;r++)n+=t.cells[r].pageWidth,o.push({x:n,colIndex:r,tableId:e.tableId,colWidth:t.cells[r].pageWidth});break}let d=1/0,m=-1/0;try{let t=gL({startOffset:e.st,endOffset:e.ed,collapsed:!1},n);if(t&&t.length>0)for(let e of t)d=Math.min(d,e.top),m=Math.max(m,e.bottom)}catch{}d===1/0&&(d=s.top,m=s.bottom);for(let e of o)t.push({screenX:p(e.x),screenTop:d,screenBottom:m,colIndex:e.colIndex,tableId:e.tableId,colWidth:e.colWidth,tableDocLeft:r,scaleCombined:a*u})}return t}function d(e,r,i){let a=t.get(B).getUniverDocInstance(JG);if(!a){console.warn(`[table-resize] docDataModel not found`);return}let o=a.getSnapshot()?.tableSource?.[e]?.tableColumns?.[r];if(!o){console.warn(`[table-resize] column not found`,e,r);return}o.size.width.v=i;let s=n.with(cD),c=s.getSkeleton(),l=s.getViewModel();l&&c&&(l.reset(a),c.makeDirty(!0),c.calculate(),n.scene?.makeDirty()),console.log(`[table-resize] applied:`,e,`col`,r,`→`,i.toFixed(1))}r.addEventListener(`pointermove`,t=>{if(o.value||e)return;let n=u(),i=null;for(let e of n)if(t.clientY>=e.screenTop-6&&t.clientY<=e.screenBottom+6&&Math.abs(t.clientX-e.screenX)<=6){i=e;break}r.style.cursor=i?`col-resize`:``},a),r.addEventListener(`pointerdown`,t=>{if(o.value)return;let n=u(),i=null;for(let e of n)if(t.clientY>=e.screenTop-6&&t.clientY<=e.screenBottom+6&&Math.abs(t.clientX-e.screenX)<=6){i=e;break}i&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),r.style.cursor=`col-resize`,r.style.touchAction=`none`,e={tableId:i.tableId,colIndex:i.colIndex,startX:t.clientX,startWidth:i.colWidth,scaleCombined:i.scaleCombined})},{...a,capture:!0}),window.addEventListener(`pointermove`,t=>{e&&t.preventDefault()},a),window.addEventListener(`pointerup`,t=>{if(!e)return;let n=(t.clientX-e.startX)/e.scaleCombined,i=Math.max(40,Math.round(e.startWidth+n));try{d(e.tableId,e.colIndex,i),clearTimeout(ee),ee=setTimeout(l,300)}catch(e){console.warn(`[table-resize] apply failed:`,e)}e=null,r.style.cursor=``,r.style.touchAction=``},a),console.log(`[table-resize] column drag-resize active ✓`)}catch(e){console.warn(`[table-resize] init failed:`,e)}},e)}return(0,t.watch)(()=>i.visible,e=>{e?setTimeout(Fe,100):be()},{immediate:!0}),(0,t.watch)(()=>i.type,()=>{c.value&&Ve()}),(0,t.onUnmounted)(()=>{clearTimeout(Oe),clearTimeout(b),clearTimeout(x),clearTimeout(C),clearTimeout(ee),k?.abort(),A?.dispose?.(),window.removeEventListener(`pointerdown`,Ee),window.removeEventListener(`scroll`,De,!0),window.removeEventListener(`resize`,De),u?.dispose?.(),u=null,c.value?.dispose?.()}),n({getData:Ie,setData:ze,getVersion:Le,isDirty:Re,ready:()=>!!c.value,getUniverInstance:()=>O,getUniverAPI:()=>c.value,onMutation:ie,persistence:f}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ist,[(0,t.createElementVNode)(`div`,ast,[(0,t.createElementVNode)(`div`,ost,[(0,t.createElementVNode)(`div`,{ref_key:`containerRef`,ref:s,class:`doc-editor`},null,512),o.value&&c.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,sst,`🔒 只读模式`)):(0,t.createCommentVNode)(``,!0),h.visible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`link-dialog-mask`,onClick:(0,t.withModifiers)(ce,[`self`])},[(0,t.createElementVNode)(`div`,cst,[n[7]||=(0,t.createElementVNode)(`div`,{class:`link-dialog-title`},`插入链接`,-1),(0,t.createElementVNode)(`div`,lst,[n[5]||=(0,t.createElementVNode)(`label`,{class:`field-label`},`文字`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":n[0]||=e=>h.text=e,class:`field-input`,type:`text`,placeholder:`链接显示的文字(留空则显示链接地址)`,onKeydown:(0,t.withKeys)(fe,[`enter`])},null,544),[[t.vModelText,h.text]])]),(0,t.createElementVNode)(`div`,ust,[n[6]||=(0,t.createElementVNode)(`label`,{class:`field-label`},`链接地址`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{ref_key:`linkUrlInputRef`,ref:l,"onUpdate:modelValue":n[1]||=e=>h.url=e,class:(0,t.normalizeClass)([`field-input`,{error:h.urlError}]),type:`text`,placeholder:`https:// 或 univer-sheet://wb-progress`,onInput:n[2]||=e=>h.urlError=``,onKeydown:(0,t.withKeys)(fe,[`enter`])},null,34),[[t.vModelText,h.url]]),h.urlError?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dst,(0,t.toDisplayString)(h.urlError),1)):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,fst,(0,t.toDisplayString)(h.replace?`将替换选中的文字或原链接`:`将在光标处插入`)+` · 支持 univer-sheet:// 内链跳转表格 · 插入后悬停可改样式 `,1),(0,t.createElementVNode)(`div`,pst,[(0,t.createElementVNode)(`button`,{class:`dialog-btn cancel`,onClick:ce},`取 消`),(0,t.createElementVNode)(`button`,{class:`dialog-btn confirm`,disabled:!h.url.trim(),onClick:fe},`确 定`,8,mst)])])])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[v.visible&&v.x!==null?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`link-hover-bar`,style:(0,t.normalizeStyle)({left:v.x+`px`,top:v.y+`px`}),onPointerdown:n[4]||=(0,t.withModifiers)(()=>{},[`stop`]),onMouseenter:ve,onMouseleave:ye},[(0,t.createElementVNode)(`span`,{class:`hover-label`,onClick:xe},`打开链接`),n[12]||=(0,t.createElementVNode)(`i`,{class:`hover-sep`},null,-1),(0,t.createElementVNode)(`button`,{class:`hover-icon-btn`,title:`复制`,onClick:Se},[n[8]||=(0,t.createElementVNode)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),(0,t.createElementVNode)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})],-1),v.copied?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,hst,`已复制`)):(0,t.createCommentVNode)(``,!0)]),o.value?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`button`,{class:`hover-icon-btn`,title:`编辑`,onClick:Ce},[...n[9]||=[(0,t.createElementVNode)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z`})],-1)]]),(0,t.createElementVNode)(`div`,gst,[(0,t.createElementVNode)(`button`,{class:`hover-icon-btn`,title:`切换样式`,onClick:n[3]||=e=>v.styleMenuOpen=!v.styleMenuOpen},[...n[10]||=[(0,t.createElementVNode)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`m6 9 6 6 6-6`})],-1)]]),v.styleMenuOpen?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_st,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(_,e=>(0,t.createElementVNode)(`div`,{key:e.value,class:(0,t.normalizeClass)([`hover-style-item`,{active:e.value===v.style}]),onClick:t=>we(e.value)},[(0,t.createElementVNode)(`span`,yst,(0,t.toDisplayString)(e.value===v.style?`✓`:``),1),(0,t.createElementVNode)(`span`,bst,(0,t.toDisplayString)(e.label),1)],10,vst)),64))])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`button`,{class:`hover-icon-btn hover-unlink-btn`,title:`取消链接`,onClick:Te},[...n[11]||=[(0,t.createElementVNode)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M15 7h3a5 5 0 0 1 0 10h-3m-6 0H6a5 5 0 0 1 0-10h3`}),(0,t.createElementVNode)(`line`,{x1:`2`,y1:`2`,x2:`22`,y2:`22`})],-1)]])],64)),n[13]||=(0,t.createElementVNode)(`div`,{class:`hover-bar-arrow`},null,-1)],36)):(0,t.createCommentVNode)(``,!0)]))])])]))}},[[`__scopeId`,`data-v-0118edc0`]]);function Tst(e,t,n){var r;if(t.t)return t.t;if(t.v===null)return null;let i=e.getStyleByCell(t),a=e.getStyleByCell(n);if(n.t===Pp.FORCE_STRING){var o;if(!Sh(a==null||(o=a.n)==null?void 0:o.pattern)&&t.v!==void 0){if(Pg(t.v))return Pp.NUMBER;if($d(`${t.v}`))return Pp.BOOLEAN}return Pp.FORCE_STRING}if(Dst(i)){var s;return Sh(i==null||(s=i.n)==null?void 0:s.pattern)?Pp.STRING:Est(t,n)}return Sh(a==null||(r=a.n)==null?void 0:r.pattern)?Pp.STRING:Est(t,n)}function Est(e,t){return e.v===void 0?XG(t.v,t.t):XG(e.v,e.t)}function Dst(e){var t;return!!(e!=null&&(t=e.n)!=null&&t.pattern)}function XG(e,t){return e===null?null:typeof e==`string`?Pg(e)?(+e==0||+e==1)&&t===Pp.BOOLEAN?Pp.BOOLEAN:t!==Pp.STRING&&t!==Pp.FORCE_STRING&&Lf(e)?Pp.FORCE_STRING:Pp.NUMBER:$d(e)?Pp.BOOLEAN:Pp.STRING:typeof e==`number`?(e===0||e===1)&&t===Pp.BOOLEAN?Pp.BOOLEAN:Pp.NUMBER:typeof e==`boolean`?Pp.BOOLEAN:Pp.FORCE_STRING}function Ost(e,t){let{unitId:n}=t,r=n?e.getUnit(n,M.UNIVER_SHEET):e.getCurrentUnitOfType(M.UNIVER_SHEET);return r?{workbook:r,unitId:r.getUnitId()}:null}function ZG(e,t={}){let{unitId:n,subUnitId:r}=t,i=n?e.getUnit(n,M.UNIVER_SHEET):e.getCurrentUnitOfType(M.UNIVER_SHEET);if(!i)return null;let a=r?i.getSheetBySheetId(r):i.getActiveSheet(!0);return a?{worksheet:a,workbook:i,unitId:i.getUnitId(),subUnitId:a.getSheetId()}:null}function QG(e,t){let{unitId:n,subUnitId:r}=t,i=e.getUnit(n,M.UNIVER_SHEET);if(!i)return null;let a=i.getSheetBySheetId(r);return a?{worksheet:a,workbook:i}:null}var $G=(e,t)=>{if(!QG(e.get(B),t))throw Error(`Workbook or worksheet is null error!`);return{unitId:t.unitId,subUnitId:t.subUnitId,ranges:F.deepClone(t.ranges)}},eK={id:`sheet.mutation.add-worksheet-merge`,type:L.MUTATION,handler:(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`Workbook or worksheet is null error!`);let{worksheet:r}=n,i=r.getConfig().mergeData,a=t.ranges;for(let e=0;e<a.length;e++)i.push(a[e]);return r.getSpanModel().rebuild(i),!0}},tK={CELL_CONTENT:Cf(`CELL_CONTENT`),ROW_FILTERED:Cf(`ROW_FILTERED`)},nK=function(e){return e[e.DATA_VALIDATION=9]=`DATA_VALIDATION`,e[e.NUMFMT=10]=`NUMFMT`,e[e.CELL_IMAGE=11]=`CELL_IMAGE`,e}({}),kst=`sheet.interceptor.range-theme-id`,Ast=`sheet.interceptor.ignore-range-theme`;function rK(e){"@babel/helpers - typeof";return rK=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},rK(e)}function jst(e,t){if(rK(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(rK(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Mst(e){var t=jst(e,`string`);return rK(t)==`symbol`?t:t+``}function Z(e,t,n){return(t=Mst(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iK(e,t){return function(n,r){t(n,r,e)}}function aK(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var oK=Cf(`BEFORE_CELL_EDIT`),sK=Cf(`AFTER_CELL_EDIT`),cK=Cf(`VALIDATE_CELL`),lK=class extends P{constructor(e){super(),this._univerInstanceService=e,Z(this,`_interceptorsByName`,new Map),Z(this,`_commandInterceptors`,[]),Z(this,`_rangeInterceptors`,[]),Z(this,`_autoHeightInterceptors`,[]),Z(this,`_beforeCommandInterceptor`,[]),Z(this,`_afterCommandInterceptors`,[]),Z(this,`_workbookDisposables`,new Map),Z(this,`_worksheetDisposables`,new Map),Z(this,`_composedInterceptorByKey`,new Map),Z(this,`_composedInterceptorVersion`,0),Z(this,`writeCellInterceptor`,new Tf({BEFORE_CELL_EDIT:oK,AFTER_CELL_EDIT:sK,VALIDATE_CELL:cK})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(M.UNIVER_SHEET).subscribe(e=>{this._interceptWorkbook(e.unit)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(M.UNIVER_SHEET).subscribe(e=>this._disposeWorkbookInterceptor(e))),this.intercept(tK.CELL_CONTENT,{priority:-1,effect:Sf.Style|Sf.Value,handler:e=>e}),this.disposeWithMe(this.writeCellInterceptor.intercept(sK,{priority:-1,handler:e=>e})),this.disposeWithMe(this.writeCellInterceptor.intercept(oK,{priority:-1,handler:e=>e})),this.disposeWithMe(this.writeCellInterceptor.intercept(cK,{priority:-1,handler:e=>e}))}dispose(){super.dispose(),this._workbookDisposables.forEach(e=>e.dispose()),this._workbookDisposables.clear(),this._worksheetDisposables.forEach(e=>e.dispose()),this._worksheetDisposables.clear(),this._interceptorsByName.clear(),this._composedInterceptorByKey.clear()}interceptCommand(e){if(this._commandInterceptors.includes(e))throw Error(`[SheetInterceptorService]: Interceptor already exists!`);return this._commandInterceptors.push(e),this._commandInterceptors.sort((e,t)=>(t.priority??0)-(e.priority??0)),this.disposeWithMe(Wf(()=>qd(this._commandInterceptors,e)))}onCommandExecute(e){let t=this._commandInterceptors.map(t=>t.getMutations(e));return{preUndos:t.map(e=>e.preUndos??[]).flat(),undos:t.map(e=>e.undos).flat(),preRedos:t.map(e=>e.preRedos??[]).flat(),redos:t.map(e=>e.redos).flat()}}interceptAfterCommand(e){if(this._afterCommandInterceptors.includes(e))throw Error(`[SheetInterceptorService]: Interceptor already exists!`);return this._afterCommandInterceptors.push(e),this._afterCommandInterceptors.sort((e,t)=>(t.priority??0)-(e.priority??0)),this.disposeWithMe(Wf(()=>qd(this._afterCommandInterceptors,e)))}afterCommandExecute(e){let t=this._afterCommandInterceptors.map(t=>t.getMutations(e));return{undos:t.map(e=>e.undos).flat(),redos:t.map(e=>e.redos).flat()}}interceptAutoHeight(e){if(this._autoHeightInterceptors.includes(e))throw Error(`[SheetInterceptorService]: Interceptor already exists!`);return this._autoHeightInterceptors.push(e),this._autoHeightInterceptors.sort((e,t)=>(t.priority??0)-(e.priority??0)),this.disposeWithMe(Wf(()=>qd(this._autoHeightInterceptors,e)))}generateMutationsOfAutoHeight(e){let t=this._autoHeightInterceptors.map(t=>t.getMutations(e));return{preUndos:t.map(e=>e.preUndos??[]).flat(),undos:t.map(e=>e.undos).flat(),preRedos:t.map(e=>e.preRedos??[]).flat(),redos:t.map(e=>e.redos).flat()}}interceptBeforeCommand(e){if(this._beforeCommandInterceptor.includes(e))throw Error(`[SheetInterceptorService]: Interceptor already exists!`);return this._beforeCommandInterceptor.push(e),this._beforeCommandInterceptor.sort((e,t)=>(t.priority??0)-(e.priority??0)),this.disposeWithMe(Wf(()=>qd(this._beforeCommandInterceptor,e)))}async beforeCommandExecute(e){return(await Promise.all(this._beforeCommandInterceptor.map(t=>t.performCheck(e)))).every(e=>e)}interceptRanges(e){if(this._rangeInterceptors.includes(e))throw Error(`[SheetInterceptorService]: Interceptor already exists!`);return this._rangeInterceptors.push(e),this._rangeInterceptors.sort((e,t)=>(t.priority??0)-(e.priority??0)),this.disposeWithMe(Wf(()=>qd(this._rangeInterceptors,e)))}generateMutationsByRanges(e){let t=this._rangeInterceptors.map(t=>t.getMutations(e));return{preUndos:t.map(e=>e.preUndos??[]).flat(),undos:t.map(e=>e.undos).flat(),preRedos:t.map(e=>e.preRedos??[]).flat(),redos:t.map(e=>e.redos).flat()}}onWriteCell(e,t,n,r,i){let a={subUnitId:t.getSheetId(),unitId:e.getUnitId(),workbook:e,worksheet:t,row:n,col:r,origin:F.deepClone(i)};return this.writeCellInterceptor.fetchThroughInterceptors(sK)(i,a)}onValidateCell(e,t,n,r){let i={subUnitId:t.getSheetId(),unitId:e.getUnitId(),workbook:e,worksheet:t,row:n,col:r};return this.writeCellInterceptor.fetchThroughInterceptors(cK)(Promise.resolve(!0),i)}intercept(e,t){let n=e;this._interceptorsByName.has(n)||this._interceptorsByName.set(n,[]);let r=this._interceptorsByName.get(n);r.push(t);let i=r.sort((e,t)=>(t.priority??0)-(e.priority??0));if(this._invalidateComposedInterceptors(),n===tK.CELL_CONTENT){let e=Sf.Style|Sf.Value;this._interceptorsByName.set(`${n}-${e}`,i);let r=Sf.Style|Sf.Value;return this._interceptorsByName.set(`${n}-${Sf.Style}`,i.filter(e=>((e.effect||r)&Sf.Style)>0)),this._interceptorsByName.set(`${n}-${Sf.Value}`,i.filter(e=>((e.effect||r)&Sf.Value)>0)),this.disposeWithMe(Wf(()=>{qd(this._interceptorsByName.get(n),t),qd(this._interceptorsByName.get(`${n}-${e}`),t),qd(this._interceptorsByName.get(`${n}-${Sf.Style}`),t),qd(this._interceptorsByName.get(`${n}-${Sf.Value}`),t),this._invalidateComposedInterceptors()}))}return this._interceptorsByName.set(n,i),this.disposeWithMe(Wf(()=>{qd(this._interceptorsByName.get(n),t),this._invalidateComposedInterceptors()}))}fetchThroughInterceptors(e,t,n,r){let i=t===void 0?e:`${e}-${t}`,a=n??i,o=this._composedInterceptorByKey.get(a);if(!o){let e=this._interceptorsByName.get(i);e&&r&&(e=e.filter(r)),o=wf(e||[]),this._composedInterceptorByKey.set(a,o)}return o}_invalidateComposedInterceptors(){this._composedInterceptorVersion+=1,this._composedInterceptorByKey.clear()}_getCommonCellContentInterceptor(e,t){let n=t.get(e);return n||(n=this.fetchThroughInterceptors(tK.CELL_CONTENT,e),t.set(e,n)),n}_getCommonRowFilteredInterceptor(e){return e.interceptor||=this.fetchThroughInterceptors(tK.ROW_FILTERED),e.interceptor}_interceptWorkbook(e){let t=new Gf,n=e.getUnitId(),r=this,i=t=>{let i=t.getSheetId();t.__interceptViewModel(a=>{let o=new Gf,s=new Map,c={interceptor:null},l=-1,u=-1;r._worksheetDisposables.set(Nst(n,t),o),o.add(a.registerCellContentInterceptor({getCell(a,o,c,u,d){let f=t.getCellRaw(a,o),p={unitId:n,subUnitId:i,row:a,col:o,worksheet:t,workbook:e,rawData:f};return u===void 0&&d===void 0?(l!==r._composedInterceptorVersion&&(s.clear(),l=r._composedInterceptorVersion),r._getCommonCellContentInterceptor(c,s)(f,p)):r.fetchThroughInterceptors(tK.CELL_CONTENT,c,u,d)(f,p)}})),o.add(a.registerRowFilteredInterceptor({getRowFiltered(a){return u!==r._composedInterceptorVersion&&(c.interceptor=null,u=r._composedInterceptorVersion),!!r._getCommonRowFilteredInterceptor(c)(!1,{unitId:n,subUnitId:i,row:a,workbook:e,worksheet:t})}}))})};e.getSheets().forEach(e=>i(e)),t.add(e.sheetCreated$.subscribe(e=>i(e))),t.add(Wf(()=>e.getSheets().forEach(e=>this._disposeSheetInterceptor(n,e)))),t.add(e.sheetDisposed$.subscribe(e=>this._disposeSheetInterceptor(n,e))),this._workbookDisposables.set(n,t)}_disposeWorkbookInterceptor(e){let t=e.getUnitId(),n=this._workbookDisposables.get(t);n&&(n.dispose(),this._workbookDisposables.delete(t))}_disposeSheetInterceptor(e,t){let n=Nst(e,t),r=this._worksheetDisposables.get(n);r&&(r.dispose(),this._worksheetDisposables.delete(n))}};lK=aK([iK(0,B)],lK);function Nst(e,t){return`${e}|${t.getSheetId()}`}var uK=e=>{let t={};return e.bg&&(t.bg={...e.bg}),e.ol&&(t.ol={...e.ol}),e.bd&&(t.bd={...e.bd}),e.cl&&(t.cl={...e.cl}),e.ht&&(t.ht=e.ht),e.vt&&(t.vt=e.vt),e.bl!==void 0&&(t.bl=e.bl),t};function Pst(e){let t={};if(e.length===1)return e[0];for(let n of e)n.bg&&(t.bg=n.bg),n.ol&&(t.ol=n.ol),n.bd&&(t.bd={...t.bd,...n.bd}),n.cl&&(t.cl=n.cl),n.ht&&(t.ht=n.ht),n.vt&&(t.vt=n.vt),n.bl!==void 0&&(t.bl=n.bl);return t}var dK={wholeStyle:1,headerRowStyle:2,headerColumnStyle:4,firstRowStyle:8,secondRowStyle:16,lastRowStyle:32,firstColumnStyle:128,secondColumnStyle:256,lastColumnStyle:512},fK=class{constructor(e,t){Z(this,`_name`,void 0),Z(this,`wholeStyle`,null),Z(this,`headerRowStyle`,null),Z(this,`headerColumnStyle`,null),Z(this,`firstRowStyle`,null),Z(this,`secondRowStyle`,null),Z(this,`lastRowStyle`,null),Z(this,`firstColumnStyle`,null),Z(this,`secondColumnStyle`,null),Z(this,`lastColumnStyle`,null),Z(this,`_mergeCacheMap`,new Map),t&&this.fromJson({...t,name:e}),this._name=e}getName(){return this._name}getWholeStyle(){return this.wholeStyle}setWholeStyle(e){this.wholeStyle=e,this._resetStyleCache()}getFirstRowStyle(){return this.firstRowStyle}setFirstRowStyle(e){this.firstRowStyle=e,this._resetStyleCache()}getSecondRowStyle(){return this.secondRowStyle}setSecondRowStyle(e){this.secondRowStyle=e,this._resetStyleCache()}getLastRowStyle(){return this.lastRowStyle}setLastRowStyle(e){this.lastRowStyle=e,this._resetStyleCache()}getFirstColumnStyle(){return this.firstColumnStyle}setFirstColumnStyle(e){this.firstColumnStyle=e,this._resetStyleCache()}getSecondColumnStyle(){return this.secondColumnStyle}setSecondColumnStyle(e){this.secondColumnStyle=e,this._resetStyleCache()}getLastColumnStyle(){return this.lastColumnStyle}setLastColumnStyle(e){this.lastColumnStyle=e,this._resetStyleCache()}getHeaderRowStyle(){return this.headerRowStyle}setHeaderRowStyle(e){this.headerRowStyle=e,this._resetStyleCache()}getHeaderColumnStyle(){return this.headerColumnStyle}setHeaderColumnStyle(e){this.headerColumnStyle=e,this._resetStyleCache()}getStyle(e,t,n,r,i){let a=0;return n&&(a|=dK.lastRowStyle),r&&(a|=dK.lastColumnStyle),e>=0&&t>=0&&(a|=dK.wholeStyle),e%2==1&&(a|=i?dK.secondRowStyle:dK.firstRowStyle),e%2==0&&(a|=i?dK.firstRowStyle:dK.secondRowStyle),e===0&&(a|=dK.headerRowStyle),t===0&&(a|=dK.headerColumnStyle),t%2==1&&(a|=dK.firstColumnStyle),t%2==0&&(a|=dK.secondColumnStyle),a===0?null:this._getMergeStyle(a)}_getMergeStyle(e){let t=this._mergeCacheMap.get(e);return t||(t=this._mergeStyle(e),this._mergeCacheMap.set(e,t)),t}_mergeStyle(e){let t=[];return this.wholeStyle&&e&dK.wholeStyle&&t.push(this.wholeStyle),this.firstColumnStyle&&e&dK.firstColumnStyle&&t.push(this.firstColumnStyle),this.secondColumnStyle&&e&dK.secondColumnStyle&&t.push(this.secondColumnStyle),this.firstRowStyle&&e&dK.firstRowStyle&&t.push(this.firstRowStyle),this.secondRowStyle&&e&dK.secondRowStyle&&t.push(this.secondRowStyle),this.headerColumnStyle&&e&dK.headerColumnStyle&&t.push(this.headerColumnStyle),this.lastColumnStyle&&e&dK.lastColumnStyle&&t.push(this.lastColumnStyle),this.headerRowStyle&&e&dK.headerRowStyle&&t.push(this.headerRowStyle),this.lastRowStyle&&e&dK.lastRowStyle&&t.push(this.lastRowStyle),Pst(t)}_resetStyleCache(){this._mergeCacheMap.clear()}toJson(){let e={name:this._name};return this.wholeStyle&&(e.wholeStyle=uK(this.wholeStyle)),this.headerRowStyle&&(e.headerRowStyle=uK(this.headerRowStyle)),this.headerColumnStyle&&(e.headerColumnStyle=uK(this.headerColumnStyle)),this.firstRowStyle&&(e.firstRowStyle=uK(this.firstRowStyle)),this.secondRowStyle&&(e.secondRowStyle=uK(this.secondRowStyle)),this.lastRowStyle&&(e.lastRowStyle=uK(this.lastRowStyle)),this.firstColumnStyle&&(e.firstColumnStyle=uK(this.firstColumnStyle)),this.secondColumnStyle&&(e.secondColumnStyle=uK(this.secondColumnStyle)),this.lastColumnStyle&&(e.lastColumnStyle=uK(this.lastColumnStyle)),e}fromJson(e){this._name=e.name,e.wholeStyle&&(this.wholeStyle=uK(e.wholeStyle)),e.headerRowStyle&&(this.headerRowStyle=uK(e.headerRowStyle)),e.headerColumnStyle&&(this.headerColumnStyle=uK(e.headerColumnStyle)),e.firstRowStyle&&(this.firstRowStyle=uK(e.firstRowStyle)),e.secondRowStyle&&(this.secondRowStyle=uK(e.secondRowStyle)),e.lastRowStyle&&(this.lastRowStyle=uK(e.lastRowStyle)),e.firstColumnStyle&&(this.firstColumnStyle=uK(e.firstColumnStyle)),e.secondColumnStyle&&(this.secondColumnStyle=uK(e.secondColumnStyle)),e.lastColumnStyle&&(this.lastColumnStyle=uK(e.lastColumnStyle))}dispose(){this._mergeCacheMap.clear()}},Fst=(e,t,n)=>new fK(`light-${e}`,{headerRowStyle:{bg:{rgb:t}},firstColumnStyle:{bg:{rgb:`rgb(255, 255, 255)`}},secondColumnStyle:{bg:{rgb:n}},lastRowStyle:{bg:{rgb:t}}}),Ist=(e,t,n)=>new fK(`middle-${e}`,{headerRowStyle:{bg:{rgb:t}},headerColumnStyle:{bg:{rgb:n}},secondRowStyle:{bg:{rgb:n}},lastRowStyle:{bg:{rgb:t}},lastColumnStyle:{bg:{rgb:n}}}),Lst=(e,t,n,r)=>new fK(`dark-${e}`,{headerRowStyle:{bg:{rgb:t},cl:{rgb:`rgb(255, 255, 255)`},ht:Dp.CENTER,bl:Np.TRUE},firstRowStyle:{bg:{rgb:n}},secondRowStyle:{bg:{rgb:r}},lastRowStyle:{bg:{rgb:t}}}),Rst=[{baseName:`blue`,header:`rgb(164, 202, 254)`,color:`rgb(225, 239, 254)`},{baseName:`grey`,header:`rgb(205, 208, 216)`,color:`rgb(238, 239, 241)`},{baseName:`red`,header:`rgb(248, 180, 180)`,color:`rgb(253, 232, 232)`},{baseName:`orange`,header:`rgb(253, 186, 140)`,color:`rgb(254, 236, 220)`},{baseName:`yellow`,header:`rgb(250, 200, 21)`,color:`rgb(255, 244, 185)`},{baseName:`green`,header:`rgb(132, 225, 188)`,color:`rgb(222, 247, 236)`},{baseName:`azure`,header:`rgb(126, 220, 226)`,color:`rgb(213, 245, 246)`},{baseName:`indigo`,header:`rgb(186, 198, 248)`,color:`rgb(233, 237, 255)`},{baseName:`purple`,header:`rgb(202, 191, 253)`,color:`rgb(237, 235, 254)`},{baseName:`magenta`,header:`rgb(248, 180, 217)`,color:`rgb(252, 232, 243)`}],zst=[{baseName:`blue`,rowHeader:`rgb(63, 131, 248)`,colHeader:`rgb(195, 221, 253)`},{baseName:`grey`,rowHeader:`rgb(95, 101, 116)`,colHeader:`rgb(227, 229, 234)`},{baseName:`red`,rowHeader:`rgb(240, 82, 82)`,colHeader:`rgb(251, 213, 213)`},{baseName:`orange`,rowHeader:`rgb(255, 90, 31)`,colHeader:`rgb(252, 217, 189)`},{baseName:`yellow`,rowHeader:`rgb(212, 157, 15)`,colHeader:`rgb(252, 220, 106)`},{baseName:`green`,rowHeader:`rgb(13, 164, 113)`,colHeader:`rgb(188, 240, 218)`},{baseName:`azure`,rowHeader:`rgb(6, 148, 162)`,colHeader:`rgb(175, 236, 239)`},{baseName:`indigo`,rowHeader:`rgb(70, 106, 247)`,colHeader:`rgb(210, 218, 250)`},{baseName:`purple`,rowHeader:`rgb(144, 97, 249)`,colHeader:`rgb(220, 215, 254)`},{baseName:`magenta`,rowHeader:`rgb(231, 70, 148)`,colHeader:`rgb(250, 209, 232)`}],Bst=[{baseName:`blue`,rowHeader:`rgb(30, 66, 159)`,firstRow:`rgb(195, 221, 253)`,secondRow:`rgb(118, 169, 250)`},{baseName:`grey`,rowHeader:`rgb(44, 48, 64)`,firstRow:`rgb(227, 229, 234)`,secondRow:`rgb(151, 157, 172)`},{baseName:`red`,rowHeader:`rgb(155, 28, 28)`,firstRow:`rgb(251, 213, 213)`,secondRow:`rgb(249, 128, 128)`},{baseName:`orange`,rowHeader:`rgb(180, 52, 3)`,firstRow:`rgb(252, 217, 189)`,secondRow:`rgb(255, 138, 76)`},{baseName:`yellow`,rowHeader:`rgb(154, 109, 21)`,firstRow:`rgb(252, 220, 106)`,secondRow:`rgb(212, 157, 15)`},{baseName:`green`,rowHeader:`rgb(4, 108, 78)`,firstRow:`rgb(188, 240, 218)`,secondRow:`rgb(49, 196, 141)`},{baseName:`azure`,rowHeader:`rgb(3, 102, 114)`,firstRow:`rgb(175, 236, 239)`,secondRow:`rgb(22, 189, 202)`},{baseName:`indigo`,rowHeader:`rgb(16, 51, 191)`,firstRow:`rgb(210, 218, 250)`,secondRow:`rgb(98, 128, 249)`},{baseName:`purple`,rowHeader:`rgb(74, 29, 150)`,firstRow:`rgb(220, 215, 254)`,secondRow:`rgb(172, 148, 250)`},{baseName:`magenta`,rowHeader:`rgb(153, 21, 75)`,firstRow:`rgb(250, 209, 232)`,secondRow:`rgb(241, 126, 184)`}],Vst=Rst.map(({baseName:e,header:t,color:n})=>Fst(e,t,n)),Hst=zst.map(({baseName:e,rowHeader:t,colHeader:n})=>Ist(e,t,n)),Ust=Bst.map(({baseName:e,rowHeader:t,firstRow:n,secondRow:r})=>Lst(e,t,n,r)),Wst=[...Vst,...Hst,...Ust],Gst={headerRowStyle:{bg:{rgb:`rgb(68,114,196)`},cl:{rgb:`rgb(255,255,255)`},ht:Dp.CENTER,bl:Np.TRUE},firstRowStyle:{bg:{rgb:`rgb(217,225,242)`}}},Kst=new fK(`default`,Gst),qst=new fK(`default-last-row`,{...Gst,lastRowStyle:{bd:{t:{s:up.THIN,cl:{rgb:`rgb(68,114,196)`}}},ht:Dp.CENTER,bl:Np.TRUE}}),Jst=class{constructor(){Z(this,`_toggleRanges`,[])}refresh(e,t){let{startRow:n,endRow:r}=e,i=[],a=0,o=!1,s=-1;for(let e=n;e<=r;e++){if(!t(e)){a++,a%2==1?o=!0:(o=!1,s!==-1&&(i.push([s,e-1]),s=-1));continue}a%2==1?o?s===-1&&(s=e):(o=!0,s=e):o&&(i.push([s,e-2]),o=!1,s=-1),e===r&&o&&i.push([s,e])}this._toggleRanges=i}getToggleRanges(){return this._toggleRanges.concat()}getIsToggled(e){let t=0,n=this._toggleRanges.length-1;for(;t<=n;){let r=Math.floor((t+n)/2),[i,a]=this._toggleRanges[r];if(e<i)n=r-1;else if(e>a)t=r+1;else return!0}return!1}},Yst=`SHEET_RANGE_THEME_MODEL_PLUGIN`,pK=class extends P{constructor(e,t,n){super(),this._sheetInterceptorService=e,this._resourceManagerService=t,this._univerInstanceService=n,Z(this,`_rangeThemeStyleMap`,new Map),Z(this,`_rangeThemeStyleRuleMap`,new Map),Z(this,`_rTreeCollection`,new Map),Z(this,`_defaultRangeThemeMap`,new Map),Z(this,`_zebraCrossingCacheMap`,new Map),Z(this,`_rowVisibleFuncSet`,new Map),Z(this,`_rangeThemeMapChanged$`,new ao),Z(this,`rangeThemeMapChange$`,this._rangeThemeMapChanged$.asObservable()),this._registerIntercept(),this._initSnapshot(),this._initDefaultTheme()}_initDefaultTheme(){this.registerDefaultRangeTheme(Kst),this.registerDefaultRangeTheme(qst);for(let e of Wst)this.registerDefaultRangeTheme(e)}_ensureRangeThemeStyleMap(e){return this._rangeThemeStyleMap.has(e)||this._rangeThemeStyleMap.set(e,new Map),this._rangeThemeStyleMap.get(e)}_ensureRangeThemeStyleRuleMap(e){return this._rangeThemeStyleRuleMap.has(e)||this._rangeThemeStyleRuleMap.set(e,new Map),this._rangeThemeStyleRuleMap.get(e)}_ensureRTreeCollection(e){return this._rTreeCollection.has(e)||this._rTreeCollection.set(e,new Ox),this._rTreeCollection.get(e)}getDefaultRangeThemeStyle(e){return this._defaultRangeThemeMap.get(e)}getCustomRangeThemeStyle(e,t){return this._ensureRangeThemeStyleMap(e).get(t)}_getSheetRowVisibleFuncSet(e,t){this._rowVisibleFuncSet.has(e)||this._rowVisibleFuncSet.set(e,new Map);let n=this._rowVisibleFuncSet.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}_getSheetRowVisibleHasInit(e,t){return!!(this._rowVisibleFuncSet.has(e)&&this._rowVisibleFuncSet.get(e)?.has(t))}refreshSheetRowVisibleFuncSet(e,t){let n=this._getSheetRowVisibleFuncSet(e,t);n.clear();let r=this._univerInstanceService.getUnit(e);if(r){let e=r.getSheetBySheetId(t);if(e){let t=e.getRowCount(),r=e.getRowManager();for(let i=1;i<=t;i++)e.getRowVisible(i)?r.getRowHeight(i)===0&&n.add(i):n.add(i)}}}_ensureZebraCrossingCache(e,t,n){this._zebraCrossingCacheMap.has(e)||this._zebraCrossingCacheMap.set(e,new Map);let r=this._zebraCrossingCacheMap.get(e);r.has(t)||r.set(t,new Map);let i=r.get(t);return i.has(n)||i.set(n,new Jst),i.get(n)}registerRangeThemeRule(e,t){let{unitId:n,subUnitId:r,range:i}=t,a=ip(),o=this._ensureRangeThemeStyleRuleMap(n),s=this._ensureRTreeCollection(n);o.set(a,{rangeInfo:t,themeName:e}),s.insert({unitId:n,sheetId:r,range:i,id:a}),this._getSheetRowVisibleHasInit(n,r)||this.refreshSheetRowVisibleFuncSet(n,r);let c=this._ensureZebraCrossingCache(n,r,a),l=this._getSheetRowVisibleFuncSet(n,r);c.refresh(i,e=>!l.has(e))}getRegisteredRangeThemeStyle(e){let{unitId:t,subUnitId:n,range:r}=e,i=this._ensureRTreeCollection(t),a=Array.from(i.bulkSearch([{unitId:t,sheetId:n,range:r}]));if(a[0]){let e=this._ensureRangeThemeStyleRuleMap(t).get(a[0]);if(e)return e.themeName}}refreshZebraCrossingCacheBySheet(e,t){this._zebraCrossingCacheMap.has(e)||this._zebraCrossingCacheMap.set(e,new Map);let n=this._zebraCrossingCacheMap.get(e);n.has(t)||n.set(t,new Map);let r=n.get(t);r&&r.forEach((n,i)=>{let a=this._ensureRangeThemeStyleRuleMap(e).get(i);a?n.refresh(a.rangeInfo.range,n=>!this._getSheetRowVisibleFuncSet(e,t).has(n)):r.delete(i)})}removeRangeThemeRule(e,t){let{unitId:n,subUnitId:r,range:i}=t,a=this._ensureRTreeCollection(n),o=Array.from(a.bulkSearch([{unitId:n,sheetId:r,range:i}])),s=this._ensureRangeThemeStyleRuleMap(n);for(let t=0;t<o.length;t++){let c=s.get(o[t]);if(c&&c.themeName===e){s.delete(o[t]),a.remove({unitId:n,sheetId:r,range:i,id:o[t]});let e=this._zebraCrossingCacheMap.get(n);if(e){let n=e.get(r);n&&n.delete(o[t])}break}}}registerDefaultRangeTheme(e){this._defaultRangeThemeMap.set(e.getName(),e),this._rangeThemeMapChanged$.next({type:`add`,styleName:e.getName()})}unRegisterDefaultRangeTheme(e){this._defaultRangeThemeMap.delete(e),this._rangeThemeMapChanged$.next({type:`remove`,styleName:e})}getRegisteredRangeThemes(){return Array.from(this._defaultRangeThemeMap.keys())}registerRangeThemeStyle(e,t){this._ensureRangeThemeStyleMap(e).set(t.getName(),t),this._rangeThemeMapChanged$.next({type:`add`,styleName:t.getName()})}unregisterRangeThemeStyle(e,t){this._ensureRangeThemeStyleMap(e).delete(t),this._rangeThemeMapChanged$.next({type:`remove`,styleName:t})}getALLRegisteredTheme(e){return Array.from(this._ensureRangeThemeStyleMap(e).keys())}getRangeThemeStyle(e,t){return this._defaultRangeThemeMap.has(t)?this._defaultRangeThemeMap.get(t):this._ensureRangeThemeStyleMap(e).get(t)}getCellStyle(e,t,n,r){let i={startRow:n,startColumn:r,endRow:n,endColumn:r},a=this._ensureRTreeCollection(e),o=Array.from(a.bulkSearch([{unitId:e,sheetId:t,range:i}]));if(o[0]){let i=this._ensureRangeThemeStyleRuleMap(e).get(o[0]);if(i){let{rangeInfo:a,themeName:s}=i,c=n-a.range.startRow,l=r-a.range.startColumn,u=this.getRangeThemeStyle(e,s),d=this._ensureZebraCrossingCache(e,t,o[0]).getIsToggled(n);if(u)return u.getStyle(c,l,n===a.range.endRow,r===a.range.endColumn,d)}}}_registerIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(tK.CELL_CONTENT,{id:kst,effect:Sf.Style,handler:(e,t,n)=>{let{row:r,col:i,unitId:a,subUnitId:o}=t,s=this.getCellStyle(a,o,r,i);if(s){let r=!e||e===t.rawData?{...t.rawData}:e;return r.themeStyle=s,n(r)}return n(e)}}))}toJson(e){let t=this._ensureRangeThemeStyleRuleMap(e),n=this._ensureRangeThemeStyleMap(e);if(n.size===0&&t.size===0)return`{}`;let r={};t.forEach((e,t)=>{r[t]=e});let i={};return n.forEach((e,t)=>{i[t]=e.toJson()}),JSON.stringify({rangeThemeStyleRuleMap:r,rangeThemeStyleMapJson:i})}fromJSON(e,t){let{rangeThemeStyleRuleMap:n,rangeThemeStyleMapJson:r}=t;n&&Object.keys(n).forEach(e=>{let{themeName:t,rangeInfo:r}=n[e];t.startsWith(`table`)||(this.registerRangeThemeRule(t,r),this._ensureRTreeCollection(r.unitId).insert({unitId:e,sheetId:r.subUnitId,range:r.range,id:e}))}),r&&Object.keys(r).forEach(t=>{let n=r[t],i=new fK(n.name);i.fromJson(n),this._ensureRangeThemeStyleMap(e).set(i.getName(),i)})}deleteUnitId(e){this._rangeThemeStyleMap.delete(e),this._rangeThemeStyleRuleMap.delete(e),this._rTreeCollection.delete(e)}_initSnapshot(){this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e=>this.toJson(e),parseJson:e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}},businesses:[M.UNIVER_SHEET],pluginName:Yst,onLoad:(e,t)=>{this.fromJSON(e,t)},onUnLoad:e=>{this.deleteUnitId(e)}}))}dispose(){super.dispose(),this._rangeThemeStyleMap.clear(),this._rangeThemeStyleRuleMap.clear(),this._defaultRangeThemeMap.clear(),this._rTreeCollection.clear(),this._zebraCrossingCacheMap.clear(),this._rowVisibleFuncSet.clear()}};pK=aK([iK(0,j(lK)),iK(1,j(By)),iK(2,j(B))],pK);var mK={id:`sheet.mutation.set-worksheet-range-theme-style`,type:L.MUTATION,handler:(e,t)=>{if(!ZG(e.get(B),t))return!1;let n=e.get(pK),{unitId:r,subUnitId:i,range:a,themeName:o}=t;return n.registerRangeThemeRule(o,{range:a,unitId:r,subUnitId:i}),!0}},Xst=(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`[SetWorksheetRangeThemeStyleMutation]: worksheet is null error!`);let{worksheet:r}=n;return{unitId:t.unitId,subUnitId:r.getSheetId(),range:t.range,themeName:t.themeName}},hK={id:`sheet.mutation.remove-worksheet-range-theme-style`,type:L.MUTATION,handler:(e,t)=>{if(!ZG(e.get(B),t))return!1;let n=e.get(pK),{unitId:r,subUnitId:i,range:a,themeName:o}=t;return n.removeRangeThemeRule(o,{range:a,unitId:r,subUnitId:i}),!0}},Zst=(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`[DeleteWorksheetRangeThemeStyleMutationFactory]: worksheet is null error!`);let{worksheet:r}=n;return{unitId:t.unitId,subUnitId:r.getSheetId(),range:t.range,themeName:t.themeName}},gK=(e,t)=>{if(!QG(e.get(B),t))throw Error(`Workbook or Worksheet not found at InsertRowMutationUndoFactory`);return{unitId:t.unitId,subUnitId:t.subUnitId,range:t.range}},_K={id:`sheet.mutation.insert-row`,type:L.MUTATION,handler:(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`Workbook or Worksheet not found at InsertRowMutation`);let{worksheet:r}=n,i=r.getRowManager(),{range:a,rowInfo:o}=t,{startRow:s,endRow:c}=a;i.insertRowsWithData(s,c,o);let l=c-s+1;return r.setRowCount(r.getRowCount()+l),r.getCellMatrix().insertRows(s,l),!0}},vK=(e,t)=>{if(!QG(e.get(B),t))throw Error(`Workbook or Worksheet not found at InsertColMutationUndoFactory`);return{unitId:t.unitId,subUnitId:t.subUnitId,range:t.range}},yK={id:`sheet.mutation.insert-col`,type:L.MUTATION,handler:(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`Workbook or Worksheet not found at InsertColMutation`);let{worksheet:r}=n,i=r.getColumnManager(),{range:a,colInfo:o}=t,{startColumn:s,endColumn:c}=a;i.insertColumnsWithData(s,c,o);let l=c-s+1;return r.setColumnCount(r.getColumnCount()+l),r.getCellMatrix().insertColumns(a.startColumn,l),!0}},bK={id:`sheet.mutation.move-range`,type:L.MUTATION,handler:(e,t)=>{let{from:n,to:r}=t;if(!n||!r)return!1;let i=e.get(B).getCurrentUnitOfType(M.UNIVER_SHEET);if(!i)return!1;let a=i.getSheetBySheetId(t.from.subUnitId),o=i.getSheetBySheetId(t.to.subUnitId);if(!a||!o)return!1;let s=a.getCellMatrix(),c=o.getCellMatrix();return new Rh(n.value).forValue((e,t,n)=>{n==null?s.realDeleteValue(e,t):s.setValue(e,t,n)}),new Rh(r.value).forValue((e,t,n)=>{n==null?c.realDeleteValue(e,t):c.setValue(e,t,n)}),!0}};function Qst(e,t){let{unitId:n,subUnitId:r,sourceRange:i,targetRange:a}=t,o=i.startRow>a.startRow,s=i.endRow-i.startRow+1;return o?{unitId:n,subUnitId:r,sourceRange:d_.clone(a),targetRange:{...i,endRow:i.endRow+s,startRow:i.startRow+s}}:{unitId:n,subUnitId:r,targetRange:d_.clone(i),sourceRange:{...a,endRow:a.endRow-s,startRow:a.startRow-s}}}var xK={id:`sheet.mutation.move-rows`,type:L.MUTATION,handler:(e,t)=>{let{unitId:n,subUnitId:r,sourceRange:i,targetRange:a}=t,o=e.get(B).getUniverSheetInstance(n);if(!o)throw Error(`[MoveRowMutation] univerSheet is null!`);let s=o.getSheetBySheetId(r);if(!s)throw Error(`[MoveRowMutation] worksheet is null!`);let c=i.startRow,l=i.endRow-i.startRow+1,u=a.startRow;return Fh(c,l,u,s.getRowManager().getRowData()),s.getCellMatrix().moveRows(c,l,u),!0}};function $st(e,t){let{unitId:n,subUnitId:r,sourceRange:i,targetRange:a}=t,o=i.startColumn>a.startColumn,s=i.endColumn-i.startColumn+1;return o?{unitId:n,subUnitId:r,sourceRange:d_.clone(a),targetRange:{...i,endColumn:i.endColumn+s,startColumn:i.startColumn+s}}:{unitId:n,subUnitId:r,targetRange:d_.clone(i),sourceRange:{...a,startColumn:a.startColumn-s,endColumn:a.endColumn-s}}}var SK={id:`sheet.mutation.move-columns`,type:L.MUTATION,handler:(e,t)=>{let{unitId:n,subUnitId:r,sourceRange:i,targetRange:a}=t,o=e.get(B).getUniverSheetInstance(n);if(!o)throw Error(`[MoveColumnMutation] univerSheet is null!`);let s=o.getSheetBySheetId(r);if(!s)throw Error(`[MoveColumnMutation] worksheet is null!`);let c=i.startColumn,l=i.endColumn-i.startColumn+1,u=a.startColumn;return Fh(c,l,u,s.getColumnManager().getColumnData()),s.getCellMatrix().moveColumns(c,l,u),!0}},ect=(e,t)=>{let n=t.getRowManager().getRowData(),r={},i=e.range,a=Nh(r,Ph(i.startRow,i.endRow,n));return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,rowInfo:a}},CK={id:`sheet.mutation.remove-rows`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)throw Error(`universheet is null error!`);let r=n.getSheetBySheetId(t.subUnitId);if(!r)return!1;let i=t.range,a=r.getRowManager().getRowData(),o=[];for(let e=i.startRow;e<=i.endRow;e++)r.getRowFiltered(e)&&o.push(e);let s=i.endRow-i.startRow+1;return Mh(i.startRow,s,a),r.getCellMatrix().removeRows(i.startRow,s),r.setRowCount(r.getRowCount()-s),!0}},tct=(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)throw Error(`universheet is null error!`);let r=n.getSheetBySheetId(t.subUnitId);if(r==null)throw Error(`worksheet is null error!`);let i=r.getColumnManager().getColumnData(),a={},o=t.range,s=Nh(a,Ph(o.startColumn,o.endColumn,i));return{unitId:t.unitId,subUnitId:t.subUnitId,range:t.range,colInfo:s}},wK={id:`sheet.mutation.remove-col`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)throw Error(`universheet is null error!`);let r=n.getSheetBySheetId(t.subUnitId);if(!r)return!1;let i=t.range,a=r.getColumnManager().getColumnData(),o=i.endColumn-i.startColumn+1;return Mh(i.startColumn,o,a),r.setColumnCount(r.getColumnCount()-o),r.getCellMatrix().removeColumns(i.startColumn,o),!0}},TK=(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`Workbook or worksheet is null error!`);let{worksheet:r}=n,i=r.getConfig().mergeData,a=t.ranges,o=[];for(let e=0;e<a.length;e++)for(let t=i.length-1;t>=0;t--){let n=i[t],r=a[e];d_.intersects(n,r)&&o.push(i[t])}return{unitId:t.unitId,subUnitId:t.subUnitId,ranges:o}},EK={id:`sheet.mutation.remove-worksheet-merge`,type:L.MUTATION,handler:(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`Workbook or worksheet is null error!`);let{worksheet:r}=n,i=r.getConfig().mergeData,a=t.ranges;for(let e=0;e<a.length;e++)for(let t=i.length-1;t>=0;t--){let n=i[t],r=a[e];d_.intersects(n,r)&&i.splice(t,1)}return r.getSpanModel().rebuild(i),!0}},nct=e=>{let{order:t}=e,n={};return Object.keys(t).forEach(e=>{n[t[Number(e)]]=Number(e)}),{...e,order:n}},DK={id:`sheet.mutation.reorder-range`,type:L.MUTATION,handler:(e,t)=>{let{subUnitId:n,unitId:r,range:i,order:a}=t,o=e.get(B).getUnit(r).getSheetBySheetId(n);if(!o)return!1;let s=new Rh;t_.foreach(i,(e,t)=>{if(a.hasOwnProperty(e)){let n=a[e],r=F.deepClone(o.getCellRaw(n,t));s.setValue(e,t,r)}});let c=o.getCellMatrix();return s.forValue((e,t,n)=>{c.setValue(e,t,n)}),!0}};function rct(e,t){if(e==null)return e;let n=F.deepClone(e);if(t==null)return n;let r={};return`h`in t&&(r.h=n.h),`ia`in t&&(r.ia=n.ia),`ah`in t&&(r.ah=n.ah),`hd`in t&&(r.hd=n.hd),`s`in t&&(r.s=n.s),`custom`in t&&(r.custom=n.custom),r}function ict(e,t){if(e==null)return e;let n=F.deepClone(e);if(t==null)return n;let r={};return`w`in t&&(r.w=n.w),`hd`in t&&(r.hd=n.hd),`s`in t&&(r.s=n.s),`custom`in t&&(r.custom=n.custom),r}var act=(e,t)=>{let{unitId:n,subUnitId:r,columnData:i}=e,a={},o=t.getColumnManager();for(let e in i){let t=i[e];a[e]=ict(o.getColumn(Number(e)),t)}return{unitId:n,subUnitId:r,columnData:a}},OK={id:`sheet.mutation.set-col-data`,type:L.MUTATION,handler:(e,t)=>{let{columnData:n}=t,r=ZG(e.get(B),t);if(!r)return!1;let{worksheet:i}=r,a=i.getColumnManager();for(let e in n){let t=n[e];if(t==null){a.removeColumn(Number(e));continue}let r=a.getColumnOrCreate(Number(e));Object.assign(r,t)}return!0}},oct=(e,t)=>{if(e.get(B).getUniverSheetInstance(t.unitId)==null)throw Error(`universheet is null error!`);return{unitId:t.unitId,subUnitId:t.subUnitId,ranges:t.ranges}},kK={id:`sheet.mutation.set-col-hidden`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(!n)return!1;let r=n.getSheetBySheetId(t.subUnitId).getColumnManager();for(let e=0;e<t.ranges.length;e++){let n=t.ranges[e];for(let e=n.startColumn;e<n.endColumn+1;e++){let t=r.getColumnOrCreate(e);t!=null&&(t.hd=Np.TRUE)}}return!0}},sct=(e,t)=>{if(e.get(B).getUniverSheetInstance(t.unitId)==null)throw Error(`universheet is null error!`);return{unitId:t.unitId,subUnitId:t.subUnitId,ranges:t.ranges}},AK={id:`sheet.mutation.set-col-visible`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(!n)return!1;let r=n.getSheetBySheetId(t.subUnitId).getColumnManager();for(let e=0;e<t.ranges.length;e++){let n=t.ranges[e];for(let e=n.startColumn;e<n.endColumn+1;e++){let t=r.getColumnOrCreate(e);t!=null&&(t.hd=Np.FALSE)}}return!0}},jK={id:`sheet.mutation.set-gridlines-color`,type:L.MUTATION,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let{worksheet:r}=n,i=r.getConfig();return i.gridlinesColor=t.color,!0}};function MK(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function NK(e,t,n){for(let r of t)Object.prototype.hasOwnProperty.call(e,r)&&n(r,e[r])}function PK(e,t,n){if(e==null)return e;if(!MK(e))return;let r={},i=!1;if(NK(e,t,(e,t)=>{r[e]=t,i=!0}),n)for(let t in n){let a=n[t];if(!a||!Object.prototype.hasOwnProperty.call(e,t))continue;let o=a(e[t]);o!==void 0&&(r[t]=o,i=!0)}return i?r:void 0}function cct(e,t,n){if(e==null)return e;if(!MK(e))return;let r={},i=!1;return NK(e,t,(e,t)=>{let a=n(t);a!==void 0&&(r[e]=a,i=!0)}),i?r:void 0}function lct(e){switch(e){case`bd`:case`tr`:case`td`:case`ht`:case`vt`:case`tb`:case`pd`:case`bg`:return!0;default:return!1}}function uct(e){return e==null||[`string`,`number`,`boolean`].includes(typeof e)}function FK(e){return PK(e,pm)}function dct(e){return PK(e,fm,{cl:FK})}function fct(e){return PK(e,mm,{cl:FK})}function pct(e){return cct(e,hm,fct)}function mct(e){return PK(e,gm)}function hct(e){return PK(e,_m)}function gct(e){if(e==null)return e;if(MK(e)&&Object.prototype.hasOwnProperty.call(e,`pattern`)&&typeof e.pattern==`string`)return{pattern:e.pattern}}function _ct(e,t){switch(e){case`ul`:case`bbl`:case`st`:case`ol`:return dct(t);case`bg`:case`cl`:return FK(t);case`bd`:return pct(t);case`tr`:return mct(t);case`pd`:return hct(t);case`n`:return gct(t);default:return uct(t)?t:void 0}}function vct(e,t){if(t===null)return null;if(t===void 0)return e;let n=t,r=F.isObject(e)?{...e}:{};return NK(n,hm,(e,t)=>{let n=fct(t);n!==void 0&&(r[e]=n)}),r}function yct(e,t,n){let r=e.getStyleByCell(t);r??delete t.s,typeof n.s==`string`&&(n.s=e.get(n.s));let i=IK(r,n.s?n.s:null);i&&(F.removeNull(i),Object.entries(i).forEach(([e,t])=>{typeof t==`object`&&t&&Object.keys(t).length===0&&delete i[e]})),F.isEmptyObject(i)?delete t.s:t.s=e.setValue(i);let a=n.v?`${n.v}\r\n`:``;!n.p&&t.p&&(a&&a!==t.p.body?.dataStream?delete t.p:Cct(t.p,n.s?n.s:null))}function bct(e,t){if(!t||!Object.keys(t).length)return e;let n=F.deepClone(e??{})||{},r=t;for(let e of vm){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=_ct(e,r[e]);t!==void 0&&(e===`bd`?n[e]=xct(n[e]||{},t):e in n||(n[e]=null))}return n}function xct(e,t){if(!t||!Object.keys(t).length)return e;let n=e;for(let r of hm)Object.prototype.hasOwnProperty.call(t,r)&&(r in e||(n[r]=null));return e}function IK(e,t,n=!1){if(t===null)return t;if(t===void 0)return e;let r=F.deepClone(e)||{},i=t;for(let e of vm){if(!Object.prototype.hasOwnProperty.call(i,e)||n&&lct(e))continue;let t=_ct(e,i[e]);t!==void 0&&(r[e]=e===`bd`?vct(r[e],t):t)}if(`cl`in r){let e=r,t=e.cl;`ul`in e&&e.ul&&(e.ul.cl=t),`ol`in e&&e.ol&&(e.ol.cl=t),`st`in e&&e.st&&(e.st.cl=t)}return r}function Sct(e,t){return e.some(e=>e.startIndex===t)?Sct(e,t+1):t}function Cct(e,t){if(e.body==null)return;Array.isArray(e.body.textRuns)||(e.body.textRuns=[]);let n=0,r=[],i=e.body?.paragraphs||[];for(let a of e.body.textRuns){let{st:e,ed:o,ts:s={}}=a;if(n<e){let i={st:n,ed:e},a=IK({},t,!0);a&&F.removeNull(a),F.isEmptyObject(a)||(i.ts=a),r.push(i)}let c=IK(s,t,!0);c&&F.removeNull(c),F.isEmptyObject(c)?delete a.ts:a.ts=c,r.push(a),n=Sct(i,o)}let a=e.body.dataStream.endsWith(`\r
|
|
586
|
+
`,textRuns:[],tables:[],sectionBreaks:[],paragraphs:[{startIndex:0}]}});try{e.__getInjector().get(B).focusUnit(JG)}catch{}O=e,c.value=t,Be(),Ve(),u||=qG({univer:e,server:i.server}),f&&!d.value&&(d.value={getData:Ie,setData:ze,getVersion:Le,isDirty:Re,ready:()=>!!c.value,getUniverInstance:()=>O,getUniverAPI:()=>c.value,onMutation:ie}),t.addEvent(t.Event.CommandExecuted,Pe),t.addEvent(t.Event.BeforeCommandExecute,Ne),window.addEventListener(`pointerdown`,Ee),window.addEventListener(`scroll`,De,!0),window.addEventListener(`resize`,De),Ae(),He(1e3)}function Ie(){let e=c.value?.getUniverDoc?.(JG)?.getSnapshot?.();return e?.body?.dataStream?(ne=te,{type:`univer-doc`,unitId:JG,version:te,savedAt:Date.now(),data:JSON.parse(JSON.stringify(e))}):null}function Le(){return te}function Re(){return te!==ne}function ze(e){let t=e?.type===`univer-doc`?e.data:e;if(!t?.body?.dataStream)return!1;let n=c.value;if(!n)return!1;try{he()}catch{}try{n.executeCommand?.(`doc.operation.toggle-hyper-link-info-popup`)}catch{}k?.abort(),k=null,A?.dispose?.(),A=null;try{n.disposeUnit?.(JG)}catch{}n.createUniverDoc({...JSON.parse(JSON.stringify(t)),id:t.id||JG}),Be(),te++,g=null,w=[];try{O?.__getInjector?.()?.get(B)?.focusUnit(JG)}catch{}return He(300),Ve(),ke(),!0}function Be(){try{let e=(O?.__getInjector?.()?.get(B)?.getUniverDocInstance?.(JG))?.getSnapshot?.(),t=e?.body;if(!t)return;t.textRuns??=[],t.tables??=[],t.sectionBreaks??=[],e.tableSource??={};let n=t.dataStream;if(typeof n==`string`&&n.length){t.paragraphs??=[];let e=t.paragraphs,r=new Set;for(let t of e)r.add(t?.startIndex);let i=!1;for(let t=0;t<n.length;t++)n.charCodeAt(t)===13&&!r.has(t)&&(e.push({startIndex:t}),i=!0);i&&e.sort((e,t)=>e.startIndex-t.startIndex)}}catch{}}function Ve(){try{(O?.__getInjector?.()?.get(B)?.getUniverDocInstance?.(JG))?.setDisabled?.(o.value)}catch{}}function He(e=1e3){setTimeout(()=>{if(!O)return;let t=O.__getInjector(),n=t.get(ZE).getRenderById(JG),r=s.value?.querySelector(`canvas`);if(!n||!r){if(e<2e3){He(e+400);return}console.warn(`[canvas-features] render/canvas not ready`);return}if(T=n,!E)try{let e=n.with(cD)?.getSkeleton();if(e){let t=e,n=null;for(;t;){let e=Object.getPrototypeOf(t);if(!e)break;if(e.draw&&e.isSkipByDiffBounds){n=e;break}t=e}if(n){let e=n.draw;if(!e.__cardBgPatch){let t=function(t,n){let r=null;try{let e=this.getSkeleton?.(),t=e?.getSkeletonData?.();if(t?.pages?.length){let n=((e.getViewModel?.())?.getDataModel?.())?.getBody?.();if(n?.customRanges){r=new Set;for(let e of n.customRanges)if(e.rangeType===3)for(let t=e.startIndex;t<=e.endIndex;t++)r.add(t);if(r.size>0){let e=0;for(let n of t.pages)for(let t of n.sections)for(let n of t.columns)for(let t of n.lines)for(let n of t.divides)for(let t of n.glyphGroup)t.content&&r.has(e)&&(t.ts&&!t.ts.bg&&(t.ts.bg={rgb:Sst}),t._isCardGlyph=!0),e+=t.count||1}}}if(r?.size>0){let e=this.getExtensionByKey?.(`DefaultDocsBackgroundExtension`);if(e&&!e.__cardPaddingPatched){let t=e.draw.bind(e);e.draw=function(e,n,r){if(r._isCardGlyph){let t=r.parent?.parent;if(t&&r.ts?.bg){let{contentHeight:n=0}=t,i=Hh(r.ts.bg),a=this.extensionOffset?.spanStartPoint;if(i&&a&&r.content!==`\r`){e.fillStyle=i,e.fillRect(a.x-1,a.y-6,r.width+2,n+11);return}}}return t(e,n,r)},e.__cardPaddingPatched=!0}}}catch{}return e.call(this,t,n)};t.__cardBgPatch=!0,n.draw=t,E=!0,console.log(`[card-bg-patch] Documents.draw patched ✓`)}}}}catch(e){console.warn(`[card-bg-patch] failed to apply:`,e)}if(!D)try{let e=pI.prototype.refresh;if(!e.__cardSelectionPatch){let t=function(){e.call(this);try{if(!this._rangeShape)return;let e=(this._docSkeleton?.getViewModel?.())?.getDataModel?.()?.getBody?.();if(!e?.customRanges)return;let t=this.startOffset,n=this.endOffset;if(t==null||n==null)return;for(let r of e.customRanges)if(r.rangeType===3&&t<=r.endIndex&&n>=r.startIndex){this._rangeShape.hide();return}}catch{}};t.__cardSelectionPatch=!0,pI.prototype.refresh=t,D=!0,console.log(`[card-selection-patch] TextRange.refresh patched ✓`)}}catch(e){console.warn(`[card-selection-patch] failed to apply:`,e)}k?.abort(),A?.dispose?.();let i=new AbortController;k=i;let a={signal:i.signal};try{let e=n.with(yL);if(e){let t=e._buildCustomRangeBoundsBySegment;typeof t==`function`&&!t.__instHoverFixed&&(e._buildCustomRangeBoundsBySegment=function(e,n=-1){return t.call(this,e??``,n)},e._buildCustomRangeBoundsBySegment.__instHoverFixed=!0)}function l(){w=[];try{let e=c.value?.getUniverDoc?.(JG)?.getSnapshot()?.body;if(!e?.customRanges)return;for(let t of e.customRanges){if(t.rangeType!==0&&t.rangeType!==3)continue;let e=gL({startOffset:t.startIndex,endOffset:t.endIndex+1,collapsed:!1},n);e?.length&&w.push({rangeId:t.rangeId,startIndex:t.startIndex,endIndex:t.endIndex,rects:e,style:t.properties?.style||`text`,text:t.properties?.text||``,url:t.properties?.url||``})}console.log(`[hover-patch] link rects computed: ${w.length} links found`)}catch(e){console.warn(`[hover-patch] recomputeLinkRects failed:`,e)}}l(),A=c.value?.addEvent?.(c.value?.Event?.CommandExecuted,()=>{clearTimeout(ee),ee=setTimeout(l,150)}),r&&(r.addEventListener(`mousemove`,e=>{if(!w.length)return;r.getBoundingClientRect();let t=e.clientX,n=e.clientY,i=null;for(let e of w){for(let r of e.rects)if(t>=r.left&&t<=r.right&&n>=r.top&&n<=r.bottom){i=e;break}if(i)break}if(i){if(_e(),v.visible&&i.rangeId===v.linkId)return;let e=pe(i.rangeId);if(!e)return;let t=(c.value?.getUniverDoc?.(JG)?.getSnapshot()?.body?.dataStream||``).slice(e.startIndex,e.endIndex+1),n=e.properties||{};v.url=n.url||``,v.text=(n.text||t.replace(YG,``)).replace(/[\s\u00A0\u2000-\u200B\u3000]+$/g,``),v.style=n.style||`text`,v.linkId=i.rangeId,v.segmentId=``,v.startIndex=i.startIndex,v.endIndex=i.endIndex,v.styleMenuOpen=!1,v.copied=!1;let r=i.rects.reduce((e,t)=>e.top<t.top?e:t),a=i.rects[Math.floor(i.rects.length/2)];v.x=(a.left+a.right)/2,v.y=Math.max(r.top-4,40),v.visible=!0,y={unitId:JG,linkId:i.rangeId,segmentId:``,segmentPage:-1,rangeId:i.rangeId,startIndex:i.startIndex,endIndex:i.endIndex},c.value?.executeCommand?.(`doc.operation.toggle-hyper-link-info-popup`,y)}else v.visible&&ge()},a),console.log(`[hover-patch] DOM mousemove hover detection active ✓`))}catch(e){console.warn(`[hover-patch] self-implemented hover detection failed:`,e)}try{let e=null;function u(){let e=n.with(cD).getSkeleton()?.getSkeletonData();if(!e)return[];let t=[],{scene:r,engine:i}=n,{scaleX:a}=r.getAncestorScale(),o=r.getViewport(`viewMain`)?.viewportScrollX||0,s=i.getCanvasElement().getBoundingClientRect(),l=parseFloat(i.getCanvasElement().style.width)||s.width,u=s.width/l,{docsLeft:d}=n.mainComponent.getOffsetConfig(),f=e.pages[0]?.marginLeft||0,p=e=>(e-o+d*a)*u+s.left;for(let r of e.pages)for(let e of r.skeTables.values()){let r=f+e.left,i=r,o=[],l=(c.value?.getUniverDoc?.(JG)?.getSnapshot())?.tableSource?.[e.tableId]?.tableColumns||[];if(l.length>0)for(let t=0;t<l.length;t++)i+=l[t].size.width.v,o.push({x:i,colIndex:t,tableId:e.tableId,colWidth:l[t].size.width.v});else for(let t of e.rows){let n=r;for(let r=0;r<t.cells.length;r++)n+=t.cells[r].pageWidth,o.push({x:n,colIndex:r,tableId:e.tableId,colWidth:t.cells[r].pageWidth});break}let d=1/0,m=-1/0;try{let t=gL({startOffset:e.st,endOffset:e.ed,collapsed:!1},n);if(t&&t.length>0)for(let e of t)d=Math.min(d,e.top),m=Math.max(m,e.bottom)}catch{}d===1/0&&(d=s.top,m=s.bottom);for(let e of o)t.push({screenX:p(e.x),screenTop:d,screenBottom:m,colIndex:e.colIndex,tableId:e.tableId,colWidth:e.colWidth,tableDocLeft:r,scaleCombined:a*u})}return t}function d(e,r,i){let a=t.get(B).getUniverDocInstance(JG);if(!a){console.warn(`[table-resize] docDataModel not found`);return}let o=a.getSnapshot()?.tableSource?.[e]?.tableColumns?.[r];if(!o){console.warn(`[table-resize] column not found`,e,r);return}o.size.width.v=i;let s=n.with(cD),c=s.getSkeleton(),l=s.getViewModel();l&&c&&(l.reset(a),c.makeDirty(!0),c.calculate(),n.scene?.makeDirty()),console.log(`[table-resize] applied:`,e,`col`,r,`→`,i.toFixed(1))}r.addEventListener(`pointermove`,t=>{if(o.value||e)return;let n=u(),i=null;for(let e of n)if(t.clientY>=e.screenTop-6&&t.clientY<=e.screenBottom+6&&Math.abs(t.clientX-e.screenX)<=6){i=e;break}r.style.cursor=i?`col-resize`:``},a),r.addEventListener(`pointerdown`,t=>{if(o.value)return;let n=u(),i=null;for(let e of n)if(t.clientY>=e.screenTop-6&&t.clientY<=e.screenBottom+6&&Math.abs(t.clientX-e.screenX)<=6){i=e;break}i&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation(),r.style.cursor=`col-resize`,r.style.touchAction=`none`,e={tableId:i.tableId,colIndex:i.colIndex,startX:t.clientX,startWidth:i.colWidth,scaleCombined:i.scaleCombined})},{...a,capture:!0}),window.addEventListener(`pointermove`,t=>{e&&t.preventDefault()},a),window.addEventListener(`pointerup`,t=>{if(!e)return;let n=(t.clientX-e.startX)/e.scaleCombined,i=Math.max(40,Math.round(e.startWidth+n));try{d(e.tableId,e.colIndex,i),clearTimeout(ee),ee=setTimeout(l,300)}catch(e){console.warn(`[table-resize] apply failed:`,e)}e=null,r.style.cursor=``,r.style.touchAction=``},a),console.log(`[table-resize] column drag-resize active ✓`)}catch(e){console.warn(`[table-resize] init failed:`,e)}},e)}return(0,t.watch)(()=>i.visible,e=>{e?setTimeout(Fe,100):be()},{immediate:!0}),(0,t.watch)(()=>i.type,()=>{c.value&&Ve()}),(0,t.onUnmounted)(()=>{clearTimeout(Oe),clearTimeout(b),clearTimeout(x),clearTimeout(C),clearTimeout(ee),k?.abort(),A?.dispose?.(),window.removeEventListener(`pointerdown`,Ee),window.removeEventListener(`scroll`,De,!0),window.removeEventListener(`resize`,De),u?.dispose?.(),u=null,c.value?.dispose?.()}),n({getData:Ie,setData:ze,getVersion:Le,isDirty:Re,ready:()=>!!c.value,getUniverInstance:()=>O,getUniverAPI:()=>c.value,onMutation:ie,persistence:f}),(e,n)=>((0,t.openBlock)(),(0,t.createElementBlock)(`div`,ist,[(0,t.createElementVNode)(`div`,ast,[(0,t.createElementVNode)(`div`,ost,[(0,t.createElementVNode)(`div`,{ref_key:`containerRef`,ref:s,class:`doc-editor`},null,512),o.value&&c.value?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,sst,`🔒 只读模式`)):(0,t.createCommentVNode)(``,!0),h.visible?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:1,class:`link-dialog-mask`,onClick:(0,t.withModifiers)(ce,[`self`])},[(0,t.createElementVNode)(`div`,cst,[n[7]||=(0,t.createElementVNode)(`div`,{class:`link-dialog-title`},`插入链接`,-1),(0,t.createElementVNode)(`div`,lst,[n[5]||=(0,t.createElementVNode)(`label`,{class:`field-label`},`文字`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{"onUpdate:modelValue":n[0]||=e=>h.text=e,class:`field-input`,type:`text`,placeholder:`链接显示的文字(留空则显示链接地址)`,onKeydown:(0,t.withKeys)(fe,[`enter`])},null,544),[[t.vModelText,h.text]])]),(0,t.createElementVNode)(`div`,ust,[n[6]||=(0,t.createElementVNode)(`label`,{class:`field-label`},`链接地址`,-1),(0,t.withDirectives)((0,t.createElementVNode)(`input`,{ref_key:`linkUrlInputRef`,ref:l,"onUpdate:modelValue":n[1]||=e=>h.url=e,class:(0,t.normalizeClass)([`field-input`,{error:h.urlError}]),type:`text`,placeholder:`https:// 或 univer-sheet://wb-progress`,onInput:n[2]||=e=>h.urlError=``,onKeydown:(0,t.withKeys)(fe,[`enter`])},null,34),[[t.vModelText,h.url]]),h.urlError?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,dst,(0,t.toDisplayString)(h.urlError),1)):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`div`,fst,(0,t.toDisplayString)(h.replace?`将替换选中的文字或原链接`:`将在光标处插入`)+` · 支持 univer-sheet:// 内链跳转表格 · 插入后悬停可改样式 `,1),(0,t.createElementVNode)(`div`,pst,[(0,t.createElementVNode)(`button`,{class:`dialog-btn cancel`,onClick:ce},`取 消`),(0,t.createElementVNode)(`button`,{class:`dialog-btn confirm`,disabled:!h.url.trim(),onClick:fe},`确 定`,8,mst)])])])):(0,t.createCommentVNode)(``,!0),((0,t.openBlock)(),(0,t.createBlock)(t.Teleport,{to:`body`},[v.visible&&v.x!==null?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,{key:0,class:`link-hover-bar`,style:(0,t.normalizeStyle)({left:v.x+`px`,top:v.y+`px`}),onPointerdown:n[4]||=(0,t.withModifiers)(()=>{},[`stop`]),onMouseenter:ve,onMouseleave:ye},[(0,t.createElementVNode)(`span`,{class:`hover-label`,onClick:xe},`打开链接`),n[12]||=(0,t.createElementVNode)(`i`,{class:`hover-sep`},null,-1),(0,t.createElementVNode)(`button`,{class:`hover-icon-btn`,title:`复制`,onClick:Se},[n[8]||=(0,t.createElementVNode)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`rect`,{x:`9`,y:`9`,width:`13`,height:`13`,rx:`2`}),(0,t.createElementVNode)(`path`,{d:`M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1`})],-1),v.copied?((0,t.openBlock)(),(0,t.createElementBlock)(`span`,hst,`已复制`)):(0,t.createCommentVNode)(``,!0)]),o.value?(0,t.createCommentVNode)(``,!0):((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,{key:0},[(0,t.createElementVNode)(`button`,{class:`hover-icon-btn`,title:`编辑`,onClick:Ce},[...n[9]||=[(0,t.createElementVNode)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M17 3a2.83 2.83 0 1 1 4 4L7.5 20.5 2 22l1.5-5.5Z`})],-1)]]),(0,t.createElementVNode)(`div`,gst,[(0,t.createElementVNode)(`button`,{class:`hover-icon-btn`,title:`切换样式`,onClick:n[3]||=e=>v.styleMenuOpen=!v.styleMenuOpen},[...n[10]||=[(0,t.createElementVNode)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`m6 9 6 6 6-6`})],-1)]]),v.styleMenuOpen?((0,t.openBlock)(),(0,t.createElementBlock)(`div`,_st,[((0,t.openBlock)(),(0,t.createElementBlock)(t.Fragment,null,(0,t.renderList)(_,e=>(0,t.createElementVNode)(`div`,{key:e.value,class:(0,t.normalizeClass)([`hover-style-item`,{active:e.value===v.style}]),onClick:t=>we(e.value)},[(0,t.createElementVNode)(`span`,yst,(0,t.toDisplayString)(e.value===v.style?`✓`:``),1),(0,t.createElementVNode)(`span`,bst,(0,t.toDisplayString)(e.label),1)],10,vst)),64))])):(0,t.createCommentVNode)(``,!0)]),(0,t.createElementVNode)(`button`,{class:`hover-icon-btn hover-unlink-btn`,title:`取消链接`,onClick:Te},[...n[11]||=[(0,t.createElementVNode)(`svg`,{width:`14`,height:`14`,viewBox:`0 0 24 24`,fill:`none`,stroke:`currentColor`,"stroke-width":`2`,"stroke-linecap":`round`,"stroke-linejoin":`round`},[(0,t.createElementVNode)(`path`,{d:`M15 7h3a5 5 0 0 1 0 10h-3m-6 0H6a5 5 0 0 1 0-10h3`}),(0,t.createElementVNode)(`line`,{x1:`2`,y1:`2`,x2:`22`,y2:`22`})],-1)]])],64)),n[13]||=(0,t.createElementVNode)(`div`,{class:`hover-bar-arrow`},null,-1)],36)):(0,t.createCommentVNode)(``,!0)]))])])]))}},[[`__scopeId`,`data-v-6346950a`]]);function Tst(e,t,n){var r;if(t.t)return t.t;if(t.v===null)return null;let i=e.getStyleByCell(t),a=e.getStyleByCell(n);if(n.t===Pp.FORCE_STRING){var o;if(!Sh(a==null||(o=a.n)==null?void 0:o.pattern)&&t.v!==void 0){if(Pg(t.v))return Pp.NUMBER;if($d(`${t.v}`))return Pp.BOOLEAN}return Pp.FORCE_STRING}if(Dst(i)){var s;return Sh(i==null||(s=i.n)==null?void 0:s.pattern)?Pp.STRING:Est(t,n)}return Sh(a==null||(r=a.n)==null?void 0:r.pattern)?Pp.STRING:Est(t,n)}function Est(e,t){return e.v===void 0?XG(t.v,t.t):XG(e.v,e.t)}function Dst(e){var t;return!!(e!=null&&(t=e.n)!=null&&t.pattern)}function XG(e,t){return e===null?null:typeof e==`string`?Pg(e)?(+e==0||+e==1)&&t===Pp.BOOLEAN?Pp.BOOLEAN:t!==Pp.STRING&&t!==Pp.FORCE_STRING&&Lf(e)?Pp.FORCE_STRING:Pp.NUMBER:$d(e)?Pp.BOOLEAN:Pp.STRING:typeof e==`number`?(e===0||e===1)&&t===Pp.BOOLEAN?Pp.BOOLEAN:Pp.NUMBER:typeof e==`boolean`?Pp.BOOLEAN:Pp.FORCE_STRING}function Ost(e,t){let{unitId:n}=t,r=n?e.getUnit(n,M.UNIVER_SHEET):e.getCurrentUnitOfType(M.UNIVER_SHEET);return r?{workbook:r,unitId:r.getUnitId()}:null}function ZG(e,t={}){let{unitId:n,subUnitId:r}=t,i=n?e.getUnit(n,M.UNIVER_SHEET):e.getCurrentUnitOfType(M.UNIVER_SHEET);if(!i)return null;let a=r?i.getSheetBySheetId(r):i.getActiveSheet(!0);return a?{worksheet:a,workbook:i,unitId:i.getUnitId(),subUnitId:a.getSheetId()}:null}function QG(e,t){let{unitId:n,subUnitId:r}=t,i=e.getUnit(n,M.UNIVER_SHEET);if(!i)return null;let a=i.getSheetBySheetId(r);return a?{worksheet:a,workbook:i}:null}var $G=(e,t)=>{if(!QG(e.get(B),t))throw Error(`Workbook or worksheet is null error!`);return{unitId:t.unitId,subUnitId:t.subUnitId,ranges:F.deepClone(t.ranges)}},eK={id:`sheet.mutation.add-worksheet-merge`,type:L.MUTATION,handler:(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`Workbook or worksheet is null error!`);let{worksheet:r}=n,i=r.getConfig().mergeData,a=t.ranges;for(let e=0;e<a.length;e++)i.push(a[e]);return r.getSpanModel().rebuild(i),!0}},tK={CELL_CONTENT:Cf(`CELL_CONTENT`),ROW_FILTERED:Cf(`ROW_FILTERED`)},nK=function(e){return e[e.DATA_VALIDATION=9]=`DATA_VALIDATION`,e[e.NUMFMT=10]=`NUMFMT`,e[e.CELL_IMAGE=11]=`CELL_IMAGE`,e}({}),kst=`sheet.interceptor.range-theme-id`,Ast=`sheet.interceptor.ignore-range-theme`;function rK(e){"@babel/helpers - typeof";return rK=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},rK(e)}function jst(e,t){if(rK(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(rK(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Mst(e){var t=jst(e,`string`);return rK(t)==`symbol`?t:t+``}function Z(e,t,n){return(t=Mst(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function iK(e,t){return function(n,r){t(n,r,e)}}function aK(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var oK=Cf(`BEFORE_CELL_EDIT`),sK=Cf(`AFTER_CELL_EDIT`),cK=Cf(`VALIDATE_CELL`),lK=class extends P{constructor(e){super(),this._univerInstanceService=e,Z(this,`_interceptorsByName`,new Map),Z(this,`_commandInterceptors`,[]),Z(this,`_rangeInterceptors`,[]),Z(this,`_autoHeightInterceptors`,[]),Z(this,`_beforeCommandInterceptor`,[]),Z(this,`_afterCommandInterceptors`,[]),Z(this,`_workbookDisposables`,new Map),Z(this,`_worksheetDisposables`,new Map),Z(this,`_composedInterceptorByKey`,new Map),Z(this,`_composedInterceptorVersion`,0),Z(this,`writeCellInterceptor`,new Tf({BEFORE_CELL_EDIT:oK,AFTER_CELL_EDIT:sK,VALIDATE_CELL:cK})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(M.UNIVER_SHEET).subscribe(e=>{this._interceptWorkbook(e.unit)})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(M.UNIVER_SHEET).subscribe(e=>this._disposeWorkbookInterceptor(e))),this.intercept(tK.CELL_CONTENT,{priority:-1,effect:Sf.Style|Sf.Value,handler:e=>e}),this.disposeWithMe(this.writeCellInterceptor.intercept(sK,{priority:-1,handler:e=>e})),this.disposeWithMe(this.writeCellInterceptor.intercept(oK,{priority:-1,handler:e=>e})),this.disposeWithMe(this.writeCellInterceptor.intercept(cK,{priority:-1,handler:e=>e}))}dispose(){super.dispose(),this._workbookDisposables.forEach(e=>e.dispose()),this._workbookDisposables.clear(),this._worksheetDisposables.forEach(e=>e.dispose()),this._worksheetDisposables.clear(),this._interceptorsByName.clear(),this._composedInterceptorByKey.clear()}interceptCommand(e){if(this._commandInterceptors.includes(e))throw Error(`[SheetInterceptorService]: Interceptor already exists!`);return this._commandInterceptors.push(e),this._commandInterceptors.sort((e,t)=>(t.priority??0)-(e.priority??0)),this.disposeWithMe(Wf(()=>qd(this._commandInterceptors,e)))}onCommandExecute(e){let t=this._commandInterceptors.map(t=>t.getMutations(e));return{preUndos:t.map(e=>e.preUndos??[]).flat(),undos:t.map(e=>e.undos).flat(),preRedos:t.map(e=>e.preRedos??[]).flat(),redos:t.map(e=>e.redos).flat()}}interceptAfterCommand(e){if(this._afterCommandInterceptors.includes(e))throw Error(`[SheetInterceptorService]: Interceptor already exists!`);return this._afterCommandInterceptors.push(e),this._afterCommandInterceptors.sort((e,t)=>(t.priority??0)-(e.priority??0)),this.disposeWithMe(Wf(()=>qd(this._afterCommandInterceptors,e)))}afterCommandExecute(e){let t=this._afterCommandInterceptors.map(t=>t.getMutations(e));return{undos:t.map(e=>e.undos).flat(),redos:t.map(e=>e.redos).flat()}}interceptAutoHeight(e){if(this._autoHeightInterceptors.includes(e))throw Error(`[SheetInterceptorService]: Interceptor already exists!`);return this._autoHeightInterceptors.push(e),this._autoHeightInterceptors.sort((e,t)=>(t.priority??0)-(e.priority??0)),this.disposeWithMe(Wf(()=>qd(this._autoHeightInterceptors,e)))}generateMutationsOfAutoHeight(e){let t=this._autoHeightInterceptors.map(t=>t.getMutations(e));return{preUndos:t.map(e=>e.preUndos??[]).flat(),undos:t.map(e=>e.undos).flat(),preRedos:t.map(e=>e.preRedos??[]).flat(),redos:t.map(e=>e.redos).flat()}}interceptBeforeCommand(e){if(this._beforeCommandInterceptor.includes(e))throw Error(`[SheetInterceptorService]: Interceptor already exists!`);return this._beforeCommandInterceptor.push(e),this._beforeCommandInterceptor.sort((e,t)=>(t.priority??0)-(e.priority??0)),this.disposeWithMe(Wf(()=>qd(this._beforeCommandInterceptor,e)))}async beforeCommandExecute(e){return(await Promise.all(this._beforeCommandInterceptor.map(t=>t.performCheck(e)))).every(e=>e)}interceptRanges(e){if(this._rangeInterceptors.includes(e))throw Error(`[SheetInterceptorService]: Interceptor already exists!`);return this._rangeInterceptors.push(e),this._rangeInterceptors.sort((e,t)=>(t.priority??0)-(e.priority??0)),this.disposeWithMe(Wf(()=>qd(this._rangeInterceptors,e)))}generateMutationsByRanges(e){let t=this._rangeInterceptors.map(t=>t.getMutations(e));return{preUndos:t.map(e=>e.preUndos??[]).flat(),undos:t.map(e=>e.undos).flat(),preRedos:t.map(e=>e.preRedos??[]).flat(),redos:t.map(e=>e.redos).flat()}}onWriteCell(e,t,n,r,i){let a={subUnitId:t.getSheetId(),unitId:e.getUnitId(),workbook:e,worksheet:t,row:n,col:r,origin:F.deepClone(i)};return this.writeCellInterceptor.fetchThroughInterceptors(sK)(i,a)}onValidateCell(e,t,n,r){let i={subUnitId:t.getSheetId(),unitId:e.getUnitId(),workbook:e,worksheet:t,row:n,col:r};return this.writeCellInterceptor.fetchThroughInterceptors(cK)(Promise.resolve(!0),i)}intercept(e,t){let n=e;this._interceptorsByName.has(n)||this._interceptorsByName.set(n,[]);let r=this._interceptorsByName.get(n);r.push(t);let i=r.sort((e,t)=>(t.priority??0)-(e.priority??0));if(this._invalidateComposedInterceptors(),n===tK.CELL_CONTENT){let e=Sf.Style|Sf.Value;this._interceptorsByName.set(`${n}-${e}`,i);let r=Sf.Style|Sf.Value;return this._interceptorsByName.set(`${n}-${Sf.Style}`,i.filter(e=>((e.effect||r)&Sf.Style)>0)),this._interceptorsByName.set(`${n}-${Sf.Value}`,i.filter(e=>((e.effect||r)&Sf.Value)>0)),this.disposeWithMe(Wf(()=>{qd(this._interceptorsByName.get(n),t),qd(this._interceptorsByName.get(`${n}-${e}`),t),qd(this._interceptorsByName.get(`${n}-${Sf.Style}`),t),qd(this._interceptorsByName.get(`${n}-${Sf.Value}`),t),this._invalidateComposedInterceptors()}))}return this._interceptorsByName.set(n,i),this.disposeWithMe(Wf(()=>{qd(this._interceptorsByName.get(n),t),this._invalidateComposedInterceptors()}))}fetchThroughInterceptors(e,t,n,r){let i=t===void 0?e:`${e}-${t}`,a=n??i,o=this._composedInterceptorByKey.get(a);if(!o){let e=this._interceptorsByName.get(i);e&&r&&(e=e.filter(r)),o=wf(e||[]),this._composedInterceptorByKey.set(a,o)}return o}_invalidateComposedInterceptors(){this._composedInterceptorVersion+=1,this._composedInterceptorByKey.clear()}_getCommonCellContentInterceptor(e,t){let n=t.get(e);return n||(n=this.fetchThroughInterceptors(tK.CELL_CONTENT,e),t.set(e,n)),n}_getCommonRowFilteredInterceptor(e){return e.interceptor||=this.fetchThroughInterceptors(tK.ROW_FILTERED),e.interceptor}_interceptWorkbook(e){let t=new Gf,n=e.getUnitId(),r=this,i=t=>{let i=t.getSheetId();t.__interceptViewModel(a=>{let o=new Gf,s=new Map,c={interceptor:null},l=-1,u=-1;r._worksheetDisposables.set(Nst(n,t),o),o.add(a.registerCellContentInterceptor({getCell(a,o,c,u,d){let f=t.getCellRaw(a,o),p={unitId:n,subUnitId:i,row:a,col:o,worksheet:t,workbook:e,rawData:f};return u===void 0&&d===void 0?(l!==r._composedInterceptorVersion&&(s.clear(),l=r._composedInterceptorVersion),r._getCommonCellContentInterceptor(c,s)(f,p)):r.fetchThroughInterceptors(tK.CELL_CONTENT,c,u,d)(f,p)}})),o.add(a.registerRowFilteredInterceptor({getRowFiltered(a){return u!==r._composedInterceptorVersion&&(c.interceptor=null,u=r._composedInterceptorVersion),!!r._getCommonRowFilteredInterceptor(c)(!1,{unitId:n,subUnitId:i,row:a,workbook:e,worksheet:t})}}))})};e.getSheets().forEach(e=>i(e)),t.add(e.sheetCreated$.subscribe(e=>i(e))),t.add(Wf(()=>e.getSheets().forEach(e=>this._disposeSheetInterceptor(n,e)))),t.add(e.sheetDisposed$.subscribe(e=>this._disposeSheetInterceptor(n,e))),this._workbookDisposables.set(n,t)}_disposeWorkbookInterceptor(e){let t=e.getUnitId(),n=this._workbookDisposables.get(t);n&&(n.dispose(),this._workbookDisposables.delete(t))}_disposeSheetInterceptor(e,t){let n=Nst(e,t),r=this._worksheetDisposables.get(n);r&&(r.dispose(),this._worksheetDisposables.delete(n))}};lK=aK([iK(0,B)],lK);function Nst(e,t){return`${e}|${t.getSheetId()}`}var uK=e=>{let t={};return e.bg&&(t.bg={...e.bg}),e.ol&&(t.ol={...e.ol}),e.bd&&(t.bd={...e.bd}),e.cl&&(t.cl={...e.cl}),e.ht&&(t.ht=e.ht),e.vt&&(t.vt=e.vt),e.bl!==void 0&&(t.bl=e.bl),t};function Pst(e){let t={};if(e.length===1)return e[0];for(let n of e)n.bg&&(t.bg=n.bg),n.ol&&(t.ol=n.ol),n.bd&&(t.bd={...t.bd,...n.bd}),n.cl&&(t.cl=n.cl),n.ht&&(t.ht=n.ht),n.vt&&(t.vt=n.vt),n.bl!==void 0&&(t.bl=n.bl);return t}var dK={wholeStyle:1,headerRowStyle:2,headerColumnStyle:4,firstRowStyle:8,secondRowStyle:16,lastRowStyle:32,firstColumnStyle:128,secondColumnStyle:256,lastColumnStyle:512},fK=class{constructor(e,t){Z(this,`_name`,void 0),Z(this,`wholeStyle`,null),Z(this,`headerRowStyle`,null),Z(this,`headerColumnStyle`,null),Z(this,`firstRowStyle`,null),Z(this,`secondRowStyle`,null),Z(this,`lastRowStyle`,null),Z(this,`firstColumnStyle`,null),Z(this,`secondColumnStyle`,null),Z(this,`lastColumnStyle`,null),Z(this,`_mergeCacheMap`,new Map),t&&this.fromJson({...t,name:e}),this._name=e}getName(){return this._name}getWholeStyle(){return this.wholeStyle}setWholeStyle(e){this.wholeStyle=e,this._resetStyleCache()}getFirstRowStyle(){return this.firstRowStyle}setFirstRowStyle(e){this.firstRowStyle=e,this._resetStyleCache()}getSecondRowStyle(){return this.secondRowStyle}setSecondRowStyle(e){this.secondRowStyle=e,this._resetStyleCache()}getLastRowStyle(){return this.lastRowStyle}setLastRowStyle(e){this.lastRowStyle=e,this._resetStyleCache()}getFirstColumnStyle(){return this.firstColumnStyle}setFirstColumnStyle(e){this.firstColumnStyle=e,this._resetStyleCache()}getSecondColumnStyle(){return this.secondColumnStyle}setSecondColumnStyle(e){this.secondColumnStyle=e,this._resetStyleCache()}getLastColumnStyle(){return this.lastColumnStyle}setLastColumnStyle(e){this.lastColumnStyle=e,this._resetStyleCache()}getHeaderRowStyle(){return this.headerRowStyle}setHeaderRowStyle(e){this.headerRowStyle=e,this._resetStyleCache()}getHeaderColumnStyle(){return this.headerColumnStyle}setHeaderColumnStyle(e){this.headerColumnStyle=e,this._resetStyleCache()}getStyle(e,t,n,r,i){let a=0;return n&&(a|=dK.lastRowStyle),r&&(a|=dK.lastColumnStyle),e>=0&&t>=0&&(a|=dK.wholeStyle),e%2==1&&(a|=i?dK.secondRowStyle:dK.firstRowStyle),e%2==0&&(a|=i?dK.firstRowStyle:dK.secondRowStyle),e===0&&(a|=dK.headerRowStyle),t===0&&(a|=dK.headerColumnStyle),t%2==1&&(a|=dK.firstColumnStyle),t%2==0&&(a|=dK.secondColumnStyle),a===0?null:this._getMergeStyle(a)}_getMergeStyle(e){let t=this._mergeCacheMap.get(e);return t||(t=this._mergeStyle(e),this._mergeCacheMap.set(e,t)),t}_mergeStyle(e){let t=[];return this.wholeStyle&&e&dK.wholeStyle&&t.push(this.wholeStyle),this.firstColumnStyle&&e&dK.firstColumnStyle&&t.push(this.firstColumnStyle),this.secondColumnStyle&&e&dK.secondColumnStyle&&t.push(this.secondColumnStyle),this.firstRowStyle&&e&dK.firstRowStyle&&t.push(this.firstRowStyle),this.secondRowStyle&&e&dK.secondRowStyle&&t.push(this.secondRowStyle),this.headerColumnStyle&&e&dK.headerColumnStyle&&t.push(this.headerColumnStyle),this.lastColumnStyle&&e&dK.lastColumnStyle&&t.push(this.lastColumnStyle),this.headerRowStyle&&e&dK.headerRowStyle&&t.push(this.headerRowStyle),this.lastRowStyle&&e&dK.lastRowStyle&&t.push(this.lastRowStyle),Pst(t)}_resetStyleCache(){this._mergeCacheMap.clear()}toJson(){let e={name:this._name};return this.wholeStyle&&(e.wholeStyle=uK(this.wholeStyle)),this.headerRowStyle&&(e.headerRowStyle=uK(this.headerRowStyle)),this.headerColumnStyle&&(e.headerColumnStyle=uK(this.headerColumnStyle)),this.firstRowStyle&&(e.firstRowStyle=uK(this.firstRowStyle)),this.secondRowStyle&&(e.secondRowStyle=uK(this.secondRowStyle)),this.lastRowStyle&&(e.lastRowStyle=uK(this.lastRowStyle)),this.firstColumnStyle&&(e.firstColumnStyle=uK(this.firstColumnStyle)),this.secondColumnStyle&&(e.secondColumnStyle=uK(this.secondColumnStyle)),this.lastColumnStyle&&(e.lastColumnStyle=uK(this.lastColumnStyle)),e}fromJson(e){this._name=e.name,e.wholeStyle&&(this.wholeStyle=uK(e.wholeStyle)),e.headerRowStyle&&(this.headerRowStyle=uK(e.headerRowStyle)),e.headerColumnStyle&&(this.headerColumnStyle=uK(e.headerColumnStyle)),e.firstRowStyle&&(this.firstRowStyle=uK(e.firstRowStyle)),e.secondRowStyle&&(this.secondRowStyle=uK(e.secondRowStyle)),e.lastRowStyle&&(this.lastRowStyle=uK(e.lastRowStyle)),e.firstColumnStyle&&(this.firstColumnStyle=uK(e.firstColumnStyle)),e.secondColumnStyle&&(this.secondColumnStyle=uK(e.secondColumnStyle)),e.lastColumnStyle&&(this.lastColumnStyle=uK(e.lastColumnStyle))}dispose(){this._mergeCacheMap.clear()}},Fst=(e,t,n)=>new fK(`light-${e}`,{headerRowStyle:{bg:{rgb:t}},firstColumnStyle:{bg:{rgb:`rgb(255, 255, 255)`}},secondColumnStyle:{bg:{rgb:n}},lastRowStyle:{bg:{rgb:t}}}),Ist=(e,t,n)=>new fK(`middle-${e}`,{headerRowStyle:{bg:{rgb:t}},headerColumnStyle:{bg:{rgb:n}},secondRowStyle:{bg:{rgb:n}},lastRowStyle:{bg:{rgb:t}},lastColumnStyle:{bg:{rgb:n}}}),Lst=(e,t,n,r)=>new fK(`dark-${e}`,{headerRowStyle:{bg:{rgb:t},cl:{rgb:`rgb(255, 255, 255)`},ht:Dp.CENTER,bl:Np.TRUE},firstRowStyle:{bg:{rgb:n}},secondRowStyle:{bg:{rgb:r}},lastRowStyle:{bg:{rgb:t}}}),Rst=[{baseName:`blue`,header:`rgb(164, 202, 254)`,color:`rgb(225, 239, 254)`},{baseName:`grey`,header:`rgb(205, 208, 216)`,color:`rgb(238, 239, 241)`},{baseName:`red`,header:`rgb(248, 180, 180)`,color:`rgb(253, 232, 232)`},{baseName:`orange`,header:`rgb(253, 186, 140)`,color:`rgb(254, 236, 220)`},{baseName:`yellow`,header:`rgb(250, 200, 21)`,color:`rgb(255, 244, 185)`},{baseName:`green`,header:`rgb(132, 225, 188)`,color:`rgb(222, 247, 236)`},{baseName:`azure`,header:`rgb(126, 220, 226)`,color:`rgb(213, 245, 246)`},{baseName:`indigo`,header:`rgb(186, 198, 248)`,color:`rgb(233, 237, 255)`},{baseName:`purple`,header:`rgb(202, 191, 253)`,color:`rgb(237, 235, 254)`},{baseName:`magenta`,header:`rgb(248, 180, 217)`,color:`rgb(252, 232, 243)`}],zst=[{baseName:`blue`,rowHeader:`rgb(63, 131, 248)`,colHeader:`rgb(195, 221, 253)`},{baseName:`grey`,rowHeader:`rgb(95, 101, 116)`,colHeader:`rgb(227, 229, 234)`},{baseName:`red`,rowHeader:`rgb(240, 82, 82)`,colHeader:`rgb(251, 213, 213)`},{baseName:`orange`,rowHeader:`rgb(255, 90, 31)`,colHeader:`rgb(252, 217, 189)`},{baseName:`yellow`,rowHeader:`rgb(212, 157, 15)`,colHeader:`rgb(252, 220, 106)`},{baseName:`green`,rowHeader:`rgb(13, 164, 113)`,colHeader:`rgb(188, 240, 218)`},{baseName:`azure`,rowHeader:`rgb(6, 148, 162)`,colHeader:`rgb(175, 236, 239)`},{baseName:`indigo`,rowHeader:`rgb(70, 106, 247)`,colHeader:`rgb(210, 218, 250)`},{baseName:`purple`,rowHeader:`rgb(144, 97, 249)`,colHeader:`rgb(220, 215, 254)`},{baseName:`magenta`,rowHeader:`rgb(231, 70, 148)`,colHeader:`rgb(250, 209, 232)`}],Bst=[{baseName:`blue`,rowHeader:`rgb(30, 66, 159)`,firstRow:`rgb(195, 221, 253)`,secondRow:`rgb(118, 169, 250)`},{baseName:`grey`,rowHeader:`rgb(44, 48, 64)`,firstRow:`rgb(227, 229, 234)`,secondRow:`rgb(151, 157, 172)`},{baseName:`red`,rowHeader:`rgb(155, 28, 28)`,firstRow:`rgb(251, 213, 213)`,secondRow:`rgb(249, 128, 128)`},{baseName:`orange`,rowHeader:`rgb(180, 52, 3)`,firstRow:`rgb(252, 217, 189)`,secondRow:`rgb(255, 138, 76)`},{baseName:`yellow`,rowHeader:`rgb(154, 109, 21)`,firstRow:`rgb(252, 220, 106)`,secondRow:`rgb(212, 157, 15)`},{baseName:`green`,rowHeader:`rgb(4, 108, 78)`,firstRow:`rgb(188, 240, 218)`,secondRow:`rgb(49, 196, 141)`},{baseName:`azure`,rowHeader:`rgb(3, 102, 114)`,firstRow:`rgb(175, 236, 239)`,secondRow:`rgb(22, 189, 202)`},{baseName:`indigo`,rowHeader:`rgb(16, 51, 191)`,firstRow:`rgb(210, 218, 250)`,secondRow:`rgb(98, 128, 249)`},{baseName:`purple`,rowHeader:`rgb(74, 29, 150)`,firstRow:`rgb(220, 215, 254)`,secondRow:`rgb(172, 148, 250)`},{baseName:`magenta`,rowHeader:`rgb(153, 21, 75)`,firstRow:`rgb(250, 209, 232)`,secondRow:`rgb(241, 126, 184)`}],Vst=Rst.map(({baseName:e,header:t,color:n})=>Fst(e,t,n)),Hst=zst.map(({baseName:e,rowHeader:t,colHeader:n})=>Ist(e,t,n)),Ust=Bst.map(({baseName:e,rowHeader:t,firstRow:n,secondRow:r})=>Lst(e,t,n,r)),Wst=[...Vst,...Hst,...Ust],Gst={headerRowStyle:{bg:{rgb:`rgb(68,114,196)`},cl:{rgb:`rgb(255,255,255)`},ht:Dp.CENTER,bl:Np.TRUE},firstRowStyle:{bg:{rgb:`rgb(217,225,242)`}}},Kst=new fK(`default`,Gst),qst=new fK(`default-last-row`,{...Gst,lastRowStyle:{bd:{t:{s:up.THIN,cl:{rgb:`rgb(68,114,196)`}}},ht:Dp.CENTER,bl:Np.TRUE}}),Jst=class{constructor(){Z(this,`_toggleRanges`,[])}refresh(e,t){let{startRow:n,endRow:r}=e,i=[],a=0,o=!1,s=-1;for(let e=n;e<=r;e++){if(!t(e)){a++,a%2==1?o=!0:(o=!1,s!==-1&&(i.push([s,e-1]),s=-1));continue}a%2==1?o?s===-1&&(s=e):(o=!0,s=e):o&&(i.push([s,e-2]),o=!1,s=-1),e===r&&o&&i.push([s,e])}this._toggleRanges=i}getToggleRanges(){return this._toggleRanges.concat()}getIsToggled(e){let t=0,n=this._toggleRanges.length-1;for(;t<=n;){let r=Math.floor((t+n)/2),[i,a]=this._toggleRanges[r];if(e<i)n=r-1;else if(e>a)t=r+1;else return!0}return!1}},Yst=`SHEET_RANGE_THEME_MODEL_PLUGIN`,pK=class extends P{constructor(e,t,n){super(),this._sheetInterceptorService=e,this._resourceManagerService=t,this._univerInstanceService=n,Z(this,`_rangeThemeStyleMap`,new Map),Z(this,`_rangeThemeStyleRuleMap`,new Map),Z(this,`_rTreeCollection`,new Map),Z(this,`_defaultRangeThemeMap`,new Map),Z(this,`_zebraCrossingCacheMap`,new Map),Z(this,`_rowVisibleFuncSet`,new Map),Z(this,`_rangeThemeMapChanged$`,new ao),Z(this,`rangeThemeMapChange$`,this._rangeThemeMapChanged$.asObservable()),this._registerIntercept(),this._initSnapshot(),this._initDefaultTheme()}_initDefaultTheme(){this.registerDefaultRangeTheme(Kst),this.registerDefaultRangeTheme(qst);for(let e of Wst)this.registerDefaultRangeTheme(e)}_ensureRangeThemeStyleMap(e){return this._rangeThemeStyleMap.has(e)||this._rangeThemeStyleMap.set(e,new Map),this._rangeThemeStyleMap.get(e)}_ensureRangeThemeStyleRuleMap(e){return this._rangeThemeStyleRuleMap.has(e)||this._rangeThemeStyleRuleMap.set(e,new Map),this._rangeThemeStyleRuleMap.get(e)}_ensureRTreeCollection(e){return this._rTreeCollection.has(e)||this._rTreeCollection.set(e,new Ox),this._rTreeCollection.get(e)}getDefaultRangeThemeStyle(e){return this._defaultRangeThemeMap.get(e)}getCustomRangeThemeStyle(e,t){return this._ensureRangeThemeStyleMap(e).get(t)}_getSheetRowVisibleFuncSet(e,t){this._rowVisibleFuncSet.has(e)||this._rowVisibleFuncSet.set(e,new Map);let n=this._rowVisibleFuncSet.get(e);return n.has(t)||n.set(t,new Set),n.get(t)}_getSheetRowVisibleHasInit(e,t){return!!(this._rowVisibleFuncSet.has(e)&&this._rowVisibleFuncSet.get(e)?.has(t))}refreshSheetRowVisibleFuncSet(e,t){let n=this._getSheetRowVisibleFuncSet(e,t);n.clear();let r=this._univerInstanceService.getUnit(e);if(r){let e=r.getSheetBySheetId(t);if(e){let t=e.getRowCount(),r=e.getRowManager();for(let i=1;i<=t;i++)e.getRowVisible(i)?r.getRowHeight(i)===0&&n.add(i):n.add(i)}}}_ensureZebraCrossingCache(e,t,n){this._zebraCrossingCacheMap.has(e)||this._zebraCrossingCacheMap.set(e,new Map);let r=this._zebraCrossingCacheMap.get(e);r.has(t)||r.set(t,new Map);let i=r.get(t);return i.has(n)||i.set(n,new Jst),i.get(n)}registerRangeThemeRule(e,t){let{unitId:n,subUnitId:r,range:i}=t,a=ip(),o=this._ensureRangeThemeStyleRuleMap(n),s=this._ensureRTreeCollection(n);o.set(a,{rangeInfo:t,themeName:e}),s.insert({unitId:n,sheetId:r,range:i,id:a}),this._getSheetRowVisibleHasInit(n,r)||this.refreshSheetRowVisibleFuncSet(n,r);let c=this._ensureZebraCrossingCache(n,r,a),l=this._getSheetRowVisibleFuncSet(n,r);c.refresh(i,e=>!l.has(e))}getRegisteredRangeThemeStyle(e){let{unitId:t,subUnitId:n,range:r}=e,i=this._ensureRTreeCollection(t),a=Array.from(i.bulkSearch([{unitId:t,sheetId:n,range:r}]));if(a[0]){let e=this._ensureRangeThemeStyleRuleMap(t).get(a[0]);if(e)return e.themeName}}refreshZebraCrossingCacheBySheet(e,t){this._zebraCrossingCacheMap.has(e)||this._zebraCrossingCacheMap.set(e,new Map);let n=this._zebraCrossingCacheMap.get(e);n.has(t)||n.set(t,new Map);let r=n.get(t);r&&r.forEach((n,i)=>{let a=this._ensureRangeThemeStyleRuleMap(e).get(i);a?n.refresh(a.rangeInfo.range,n=>!this._getSheetRowVisibleFuncSet(e,t).has(n)):r.delete(i)})}removeRangeThemeRule(e,t){let{unitId:n,subUnitId:r,range:i}=t,a=this._ensureRTreeCollection(n),o=Array.from(a.bulkSearch([{unitId:n,sheetId:r,range:i}])),s=this._ensureRangeThemeStyleRuleMap(n);for(let t=0;t<o.length;t++){let c=s.get(o[t]);if(c&&c.themeName===e){s.delete(o[t]),a.remove({unitId:n,sheetId:r,range:i,id:o[t]});let e=this._zebraCrossingCacheMap.get(n);if(e){let n=e.get(r);n&&n.delete(o[t])}break}}}registerDefaultRangeTheme(e){this._defaultRangeThemeMap.set(e.getName(),e),this._rangeThemeMapChanged$.next({type:`add`,styleName:e.getName()})}unRegisterDefaultRangeTheme(e){this._defaultRangeThemeMap.delete(e),this._rangeThemeMapChanged$.next({type:`remove`,styleName:e})}getRegisteredRangeThemes(){return Array.from(this._defaultRangeThemeMap.keys())}registerRangeThemeStyle(e,t){this._ensureRangeThemeStyleMap(e).set(t.getName(),t),this._rangeThemeMapChanged$.next({type:`add`,styleName:t.getName()})}unregisterRangeThemeStyle(e,t){this._ensureRangeThemeStyleMap(e).delete(t),this._rangeThemeMapChanged$.next({type:`remove`,styleName:t})}getALLRegisteredTheme(e){return Array.from(this._ensureRangeThemeStyleMap(e).keys())}getRangeThemeStyle(e,t){return this._defaultRangeThemeMap.has(t)?this._defaultRangeThemeMap.get(t):this._ensureRangeThemeStyleMap(e).get(t)}getCellStyle(e,t,n,r){let i={startRow:n,startColumn:r,endRow:n,endColumn:r},a=this._ensureRTreeCollection(e),o=Array.from(a.bulkSearch([{unitId:e,sheetId:t,range:i}]));if(o[0]){let i=this._ensureRangeThemeStyleRuleMap(e).get(o[0]);if(i){let{rangeInfo:a,themeName:s}=i,c=n-a.range.startRow,l=r-a.range.startColumn,u=this.getRangeThemeStyle(e,s),d=this._ensureZebraCrossingCache(e,t,o[0]).getIsToggled(n);if(u)return u.getStyle(c,l,n===a.range.endRow,r===a.range.endColumn,d)}}}_registerIntercept(){this.disposeWithMe(this._sheetInterceptorService.intercept(tK.CELL_CONTENT,{id:kst,effect:Sf.Style,handler:(e,t,n)=>{let{row:r,col:i,unitId:a,subUnitId:o}=t,s=this.getCellStyle(a,o,r,i);if(s){let r=!e||e===t.rawData?{...t.rawData}:e;return r.themeStyle=s,n(r)}return n(e)}}))}toJson(e){let t=this._ensureRangeThemeStyleRuleMap(e),n=this._ensureRangeThemeStyleMap(e);if(n.size===0&&t.size===0)return`{}`;let r={};t.forEach((e,t)=>{r[t]=e});let i={};return n.forEach((e,t)=>{i[t]=e.toJson()}),JSON.stringify({rangeThemeStyleRuleMap:r,rangeThemeStyleMapJson:i})}fromJSON(e,t){let{rangeThemeStyleRuleMap:n,rangeThemeStyleMapJson:r}=t;n&&Object.keys(n).forEach(e=>{let{themeName:t,rangeInfo:r}=n[e];t.startsWith(`table`)||(this.registerRangeThemeRule(t,r),this._ensureRTreeCollection(r.unitId).insert({unitId:e,sheetId:r.subUnitId,range:r.range,id:e}))}),r&&Object.keys(r).forEach(t=>{let n=r[t],i=new fK(n.name);i.fromJson(n),this._ensureRangeThemeStyleMap(e).set(i.getName(),i)})}deleteUnitId(e){this._rangeThemeStyleMap.delete(e),this._rangeThemeStyleRuleMap.delete(e),this._rTreeCollection.delete(e)}_initSnapshot(){this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e=>this.toJson(e),parseJson:e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}},businesses:[M.UNIVER_SHEET],pluginName:Yst,onLoad:(e,t)=>{this.fromJSON(e,t)},onUnLoad:e=>{this.deleteUnitId(e)}}))}dispose(){super.dispose(),this._rangeThemeStyleMap.clear(),this._rangeThemeStyleRuleMap.clear(),this._defaultRangeThemeMap.clear(),this._rTreeCollection.clear(),this._zebraCrossingCacheMap.clear(),this._rowVisibleFuncSet.clear()}};pK=aK([iK(0,j(lK)),iK(1,j(By)),iK(2,j(B))],pK);var mK={id:`sheet.mutation.set-worksheet-range-theme-style`,type:L.MUTATION,handler:(e,t)=>{if(!ZG(e.get(B),t))return!1;let n=e.get(pK),{unitId:r,subUnitId:i,range:a,themeName:o}=t;return n.registerRangeThemeRule(o,{range:a,unitId:r,subUnitId:i}),!0}},Xst=(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`[SetWorksheetRangeThemeStyleMutation]: worksheet is null error!`);let{worksheet:r}=n;return{unitId:t.unitId,subUnitId:r.getSheetId(),range:t.range,themeName:t.themeName}},hK={id:`sheet.mutation.remove-worksheet-range-theme-style`,type:L.MUTATION,handler:(e,t)=>{if(!ZG(e.get(B),t))return!1;let n=e.get(pK),{unitId:r,subUnitId:i,range:a,themeName:o}=t;return n.removeRangeThemeRule(o,{range:a,unitId:r,subUnitId:i}),!0}},Zst=(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`[DeleteWorksheetRangeThemeStyleMutationFactory]: worksheet is null error!`);let{worksheet:r}=n;return{unitId:t.unitId,subUnitId:r.getSheetId(),range:t.range,themeName:t.themeName}},gK=(e,t)=>{if(!QG(e.get(B),t))throw Error(`Workbook or Worksheet not found at InsertRowMutationUndoFactory`);return{unitId:t.unitId,subUnitId:t.subUnitId,range:t.range}},_K={id:`sheet.mutation.insert-row`,type:L.MUTATION,handler:(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`Workbook or Worksheet not found at InsertRowMutation`);let{worksheet:r}=n,i=r.getRowManager(),{range:a,rowInfo:o}=t,{startRow:s,endRow:c}=a;i.insertRowsWithData(s,c,o);let l=c-s+1;return r.setRowCount(r.getRowCount()+l),r.getCellMatrix().insertRows(s,l),!0}},vK=(e,t)=>{if(!QG(e.get(B),t))throw Error(`Workbook or Worksheet not found at InsertColMutationUndoFactory`);return{unitId:t.unitId,subUnitId:t.subUnitId,range:t.range}},yK={id:`sheet.mutation.insert-col`,type:L.MUTATION,handler:(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`Workbook or Worksheet not found at InsertColMutation`);let{worksheet:r}=n,i=r.getColumnManager(),{range:a,colInfo:o}=t,{startColumn:s,endColumn:c}=a;i.insertColumnsWithData(s,c,o);let l=c-s+1;return r.setColumnCount(r.getColumnCount()+l),r.getCellMatrix().insertColumns(a.startColumn,l),!0}},bK={id:`sheet.mutation.move-range`,type:L.MUTATION,handler:(e,t)=>{let{from:n,to:r}=t;if(!n||!r)return!1;let i=e.get(B).getCurrentUnitOfType(M.UNIVER_SHEET);if(!i)return!1;let a=i.getSheetBySheetId(t.from.subUnitId),o=i.getSheetBySheetId(t.to.subUnitId);if(!a||!o)return!1;let s=a.getCellMatrix(),c=o.getCellMatrix();return new Rh(n.value).forValue((e,t,n)=>{n==null?s.realDeleteValue(e,t):s.setValue(e,t,n)}),new Rh(r.value).forValue((e,t,n)=>{n==null?c.realDeleteValue(e,t):c.setValue(e,t,n)}),!0}};function Qst(e,t){let{unitId:n,subUnitId:r,sourceRange:i,targetRange:a}=t,o=i.startRow>a.startRow,s=i.endRow-i.startRow+1;return o?{unitId:n,subUnitId:r,sourceRange:d_.clone(a),targetRange:{...i,endRow:i.endRow+s,startRow:i.startRow+s}}:{unitId:n,subUnitId:r,targetRange:d_.clone(i),sourceRange:{...a,endRow:a.endRow-s,startRow:a.startRow-s}}}var xK={id:`sheet.mutation.move-rows`,type:L.MUTATION,handler:(e,t)=>{let{unitId:n,subUnitId:r,sourceRange:i,targetRange:a}=t,o=e.get(B).getUniverSheetInstance(n);if(!o)throw Error(`[MoveRowMutation] univerSheet is null!`);let s=o.getSheetBySheetId(r);if(!s)throw Error(`[MoveRowMutation] worksheet is null!`);let c=i.startRow,l=i.endRow-i.startRow+1,u=a.startRow;return Fh(c,l,u,s.getRowManager().getRowData()),s.getCellMatrix().moveRows(c,l,u),!0}};function $st(e,t){let{unitId:n,subUnitId:r,sourceRange:i,targetRange:a}=t,o=i.startColumn>a.startColumn,s=i.endColumn-i.startColumn+1;return o?{unitId:n,subUnitId:r,sourceRange:d_.clone(a),targetRange:{...i,endColumn:i.endColumn+s,startColumn:i.startColumn+s}}:{unitId:n,subUnitId:r,targetRange:d_.clone(i),sourceRange:{...a,startColumn:a.startColumn-s,endColumn:a.endColumn-s}}}var SK={id:`sheet.mutation.move-columns`,type:L.MUTATION,handler:(e,t)=>{let{unitId:n,subUnitId:r,sourceRange:i,targetRange:a}=t,o=e.get(B).getUniverSheetInstance(n);if(!o)throw Error(`[MoveColumnMutation] univerSheet is null!`);let s=o.getSheetBySheetId(r);if(!s)throw Error(`[MoveColumnMutation] worksheet is null!`);let c=i.startColumn,l=i.endColumn-i.startColumn+1,u=a.startColumn;return Fh(c,l,u,s.getColumnManager().getColumnData()),s.getCellMatrix().moveColumns(c,l,u),!0}},ect=(e,t)=>{let n=t.getRowManager().getRowData(),r={},i=e.range,a=Nh(r,Ph(i.startRow,i.endRow,n));return{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range,rowInfo:a}},CK={id:`sheet.mutation.remove-rows`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)throw Error(`universheet is null error!`);let r=n.getSheetBySheetId(t.subUnitId);if(!r)return!1;let i=t.range,a=r.getRowManager().getRowData(),o=[];for(let e=i.startRow;e<=i.endRow;e++)r.getRowFiltered(e)&&o.push(e);let s=i.endRow-i.startRow+1;return Mh(i.startRow,s,a),r.getCellMatrix().removeRows(i.startRow,s),r.setRowCount(r.getRowCount()-s),!0}},tct=(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)throw Error(`universheet is null error!`);let r=n.getSheetBySheetId(t.subUnitId);if(r==null)throw Error(`worksheet is null error!`);let i=r.getColumnManager().getColumnData(),a={},o=t.range,s=Nh(a,Ph(o.startColumn,o.endColumn,i));return{unitId:t.unitId,subUnitId:t.subUnitId,range:t.range,colInfo:s}},wK={id:`sheet.mutation.remove-col`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)throw Error(`universheet is null error!`);let r=n.getSheetBySheetId(t.subUnitId);if(!r)return!1;let i=t.range,a=r.getColumnManager().getColumnData(),o=i.endColumn-i.startColumn+1;return Mh(i.startColumn,o,a),r.setColumnCount(r.getColumnCount()-o),r.getCellMatrix().removeColumns(i.startColumn,o),!0}},TK=(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`Workbook or worksheet is null error!`);let{worksheet:r}=n,i=r.getConfig().mergeData,a=t.ranges,o=[];for(let e=0;e<a.length;e++)for(let t=i.length-1;t>=0;t--){let n=i[t],r=a[e];d_.intersects(n,r)&&o.push(i[t])}return{unitId:t.unitId,subUnitId:t.subUnitId,ranges:o}},EK={id:`sheet.mutation.remove-worksheet-merge`,type:L.MUTATION,handler:(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`Workbook or worksheet is null error!`);let{worksheet:r}=n,i=r.getConfig().mergeData,a=t.ranges;for(let e=0;e<a.length;e++)for(let t=i.length-1;t>=0;t--){let n=i[t],r=a[e];d_.intersects(n,r)&&i.splice(t,1)}return r.getSpanModel().rebuild(i),!0}},nct=e=>{let{order:t}=e,n={};return Object.keys(t).forEach(e=>{n[t[Number(e)]]=Number(e)}),{...e,order:n}},DK={id:`sheet.mutation.reorder-range`,type:L.MUTATION,handler:(e,t)=>{let{subUnitId:n,unitId:r,range:i,order:a}=t,o=e.get(B).getUnit(r).getSheetBySheetId(n);if(!o)return!1;let s=new Rh;t_.foreach(i,(e,t)=>{if(a.hasOwnProperty(e)){let n=a[e],r=F.deepClone(o.getCellRaw(n,t));s.setValue(e,t,r)}});let c=o.getCellMatrix();return s.forValue((e,t,n)=>{c.setValue(e,t,n)}),!0}};function rct(e,t){if(e==null)return e;let n=F.deepClone(e);if(t==null)return n;let r={};return`h`in t&&(r.h=n.h),`ia`in t&&(r.ia=n.ia),`ah`in t&&(r.ah=n.ah),`hd`in t&&(r.hd=n.hd),`s`in t&&(r.s=n.s),`custom`in t&&(r.custom=n.custom),r}function ict(e,t){if(e==null)return e;let n=F.deepClone(e);if(t==null)return n;let r={};return`w`in t&&(r.w=n.w),`hd`in t&&(r.hd=n.hd),`s`in t&&(r.s=n.s),`custom`in t&&(r.custom=n.custom),r}var act=(e,t)=>{let{unitId:n,subUnitId:r,columnData:i}=e,a={},o=t.getColumnManager();for(let e in i){let t=i[e];a[e]=ict(o.getColumn(Number(e)),t)}return{unitId:n,subUnitId:r,columnData:a}},OK={id:`sheet.mutation.set-col-data`,type:L.MUTATION,handler:(e,t)=>{let{columnData:n}=t,r=ZG(e.get(B),t);if(!r)return!1;let{worksheet:i}=r,a=i.getColumnManager();for(let e in n){let t=n[e];if(t==null){a.removeColumn(Number(e));continue}let r=a.getColumnOrCreate(Number(e));Object.assign(r,t)}return!0}},oct=(e,t)=>{if(e.get(B).getUniverSheetInstance(t.unitId)==null)throw Error(`universheet is null error!`);return{unitId:t.unitId,subUnitId:t.subUnitId,ranges:t.ranges}},kK={id:`sheet.mutation.set-col-hidden`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(!n)return!1;let r=n.getSheetBySheetId(t.subUnitId).getColumnManager();for(let e=0;e<t.ranges.length;e++){let n=t.ranges[e];for(let e=n.startColumn;e<n.endColumn+1;e++){let t=r.getColumnOrCreate(e);t!=null&&(t.hd=Np.TRUE)}}return!0}},sct=(e,t)=>{if(e.get(B).getUniverSheetInstance(t.unitId)==null)throw Error(`universheet is null error!`);return{unitId:t.unitId,subUnitId:t.subUnitId,ranges:t.ranges}},AK={id:`sheet.mutation.set-col-visible`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(!n)return!1;let r=n.getSheetBySheetId(t.subUnitId).getColumnManager();for(let e=0;e<t.ranges.length;e++){let n=t.ranges[e];for(let e=n.startColumn;e<n.endColumn+1;e++){let t=r.getColumnOrCreate(e);t!=null&&(t.hd=Np.FALSE)}}return!0}},jK={id:`sheet.mutation.set-gridlines-color`,type:L.MUTATION,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let{worksheet:r}=n,i=r.getConfig();return i.gridlinesColor=t.color,!0}};function MK(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function NK(e,t,n){for(let r of t)Object.prototype.hasOwnProperty.call(e,r)&&n(r,e[r])}function PK(e,t,n){if(e==null)return e;if(!MK(e))return;let r={},i=!1;if(NK(e,t,(e,t)=>{r[e]=t,i=!0}),n)for(let t in n){let a=n[t];if(!a||!Object.prototype.hasOwnProperty.call(e,t))continue;let o=a(e[t]);o!==void 0&&(r[t]=o,i=!0)}return i?r:void 0}function cct(e,t,n){if(e==null)return e;if(!MK(e))return;let r={},i=!1;return NK(e,t,(e,t)=>{let a=n(t);a!==void 0&&(r[e]=a,i=!0)}),i?r:void 0}function lct(e){switch(e){case`bd`:case`tr`:case`td`:case`ht`:case`vt`:case`tb`:case`pd`:case`bg`:return!0;default:return!1}}function uct(e){return e==null||[`string`,`number`,`boolean`].includes(typeof e)}function FK(e){return PK(e,pm)}function dct(e){return PK(e,fm,{cl:FK})}function fct(e){return PK(e,mm,{cl:FK})}function pct(e){return cct(e,hm,fct)}function mct(e){return PK(e,gm)}function hct(e){return PK(e,_m)}function gct(e){if(e==null)return e;if(MK(e)&&Object.prototype.hasOwnProperty.call(e,`pattern`)&&typeof e.pattern==`string`)return{pattern:e.pattern}}function _ct(e,t){switch(e){case`ul`:case`bbl`:case`st`:case`ol`:return dct(t);case`bg`:case`cl`:return FK(t);case`bd`:return pct(t);case`tr`:return mct(t);case`pd`:return hct(t);case`n`:return gct(t);default:return uct(t)?t:void 0}}function vct(e,t){if(t===null)return null;if(t===void 0)return e;let n=t,r=F.isObject(e)?{...e}:{};return NK(n,hm,(e,t)=>{let n=fct(t);n!==void 0&&(r[e]=n)}),r}function yct(e,t,n){let r=e.getStyleByCell(t);r??delete t.s,typeof n.s==`string`&&(n.s=e.get(n.s));let i=IK(r,n.s?n.s:null);i&&(F.removeNull(i),Object.entries(i).forEach(([e,t])=>{typeof t==`object`&&t&&Object.keys(t).length===0&&delete i[e]})),F.isEmptyObject(i)?delete t.s:t.s=e.setValue(i);let a=n.v?`${n.v}\r\n`:``;!n.p&&t.p&&(a&&a!==t.p.body?.dataStream?delete t.p:Cct(t.p,n.s?n.s:null))}function bct(e,t){if(!t||!Object.keys(t).length)return e;let n=F.deepClone(e??{})||{},r=t;for(let e of vm){if(!Object.prototype.hasOwnProperty.call(r,e))continue;let t=_ct(e,r[e]);t!==void 0&&(e===`bd`?n[e]=xct(n[e]||{},t):e in n||(n[e]=null))}return n}function xct(e,t){if(!t||!Object.keys(t).length)return e;let n=e;for(let r of hm)Object.prototype.hasOwnProperty.call(t,r)&&(r in e||(n[r]=null));return e}function IK(e,t,n=!1){if(t===null)return t;if(t===void 0)return e;let r=F.deepClone(e)||{},i=t;for(let e of vm){if(!Object.prototype.hasOwnProperty.call(i,e)||n&&lct(e))continue;let t=_ct(e,i[e]);t!==void 0&&(r[e]=e===`bd`?vct(r[e],t):t)}if(`cl`in r){let e=r,t=e.cl;`ul`in e&&e.ul&&(e.ul.cl=t),`ol`in e&&e.ol&&(e.ol.cl=t),`st`in e&&e.st&&(e.st.cl=t)}return r}function Sct(e,t){return e.some(e=>e.startIndex===t)?Sct(e,t+1):t}function Cct(e,t){if(e.body==null)return;Array.isArray(e.body.textRuns)||(e.body.textRuns=[]);let n=0,r=[],i=e.body?.paragraphs||[];for(let a of e.body.textRuns){let{st:e,ed:o,ts:s={}}=a;if(n<e){let i={st:n,ed:e},a=IK({},t,!0);a&&F.removeNull(a),F.isEmptyObject(a)||(i.ts=a),r.push(i)}let c=IK(s,t,!0);c&&F.removeNull(c),F.isEmptyObject(c)?delete a.ts:a.ts=c,r.push(a),n=Sct(i,o)}let a=e.body.dataStream.endsWith(`\r
|
|
587
587
|
`)?e.body.dataStream.length-2:e.body.dataStream.length;if(n<a){let e={st:n,ed:a},i=IK({},t,!0);i&&F.removeNull(i),F.isEmptyObject(i)||(e.ts=i),r.push(e)}e.body.textRuns=T_(r)}function wct(e,t){return t.v===void 0||t.v===null?t.v:e===Pp.NUMBER?Number(t.v):e===Pp.BOOLEAN?+!!Tct(t.v):e===Pp.STRING||e===Pp.FORCE_STRING?`${t.v}`:t.v}function Tct(e){if(typeof e==`string`){if(e.toUpperCase()===`TRUE`)return!0;if(e.toUpperCase()===`FALSE`)return!1;if(If(e)){if(Number(e)===0)return!1;if(Number(e)===1)return!0}}if(typeof e==`number`){if(e===0)return!1;if(e===1)return!0}return typeof e==`boolean`?e:null}function Ect(e){return e==null?null:(e.f===void 0&&(e.f=null),e.si===void 0&&(e.si=null),e.p===void 0&&(e.p=null),e.v===void 0&&(e.v=null),e.t===void 0&&(e.t=null),e.s===void 0&&(e.s=null),e.custom===void 0&&(e.custom=null),e)}var LK=(e,t)=>{let{unitId:n,subUnitId:r,cellValue:i}=t,a=e.get(B).getUniverSheetInstance(n);if(a==null)throw Error(`workbook is null error!`);let o=a.getSheetBySheetId(r);if(o==null)throw Error(`worksheet is null error!`);let s=o.getCellMatrix(),c=a.getStyles(),l=new Rh;return new Rh(i).forValue((e,t,n)=>{let r=F.deepClone(s?.getValue(e,t))||{};r.s=bct(c.getStyleByCell(r),c.getStyleByCell(n)),l.setValue(e,t,Ect(r))}),{...t,options:{},cellValue:l.getMatrix()}},RK={id:`sheet.mutation.set-range-values`,type:L.MUTATION,handler:(e,t)=>{let{cellValue:n,subUnitId:r,unitId:i}=t,a=e.get(B).getUnit(i);if(!a)return!1;let o=a.getSheetBySheetId(r);if(!o)return!1;let s=o.getCellMatrix(),c=a.getStyles();return new Rh(n).forValue((e,t,n)=>{if(!n)s.realDeleteValue(e,t);else{let r=s.getValue(e,t)||{};r=Oct(n,r,c),F.isEmptyObject(r)?s.realDeleteValue(e,t):s.setValue(e,t,r)}}),!0}},Dct=new Set([`f`,`p`,`si`,`custom`,`ref`,`xf`]);function Oct(e,t,n){let r=Tst(n,e,t);return Object.keys(e).forEach(i=>{let a=i;if(Dct.has(a)){let n=e[a];kct(t,a,n)}else a===`v`?e.v!==void 0&&(t.v=wct(r,e)):a===`s`&&yct(n,t,e)}),t.v!==void 0&&(t.t=r,t.v=wct(r,t)),t.v===null&&(delete t.t,delete t.v),t}function kct(e,t,n){n===void 0||(n===null?delete e[t]:e[t]=n)}var Act=(e,t)=>{let{unitId:n,subUnitId:r,rowData:i}=e,a={},o=t.getRowManager();for(let e in i){let t=i[e];a[e]=rct(o.getRow(Number(e)),t)}return{unitId:n,subUnitId:r,rowData:a}},zK={id:`sheet.mutation.set-row-data`,type:L.MUTATION,handler:(e,t)=>{let{rowData:n}=t,r=ZG(e.get(B),t);if(!r)return!1;let{worksheet:i}=r,a=i.getRowManager();for(let e in n){let t=n[e];if(t==null){a.removeRow(Number(e));continue}let r=a.getRowOrCreate(Number(e));Object.assign(r,t)}return!0}},jct=(e,t)=>{if(e.get(B).getUniverSheetInstance(t.unitId)==null)throw Error(`universheet is null error!`);return{unitId:t.unitId,subUnitId:t.subUnitId,ranges:t.ranges}},BK={id:`sheet.mutation.set-row-visible`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)throw Error(`universheet is null error!`);let r=n.getSheetBySheetId(t.subUnitId).getRowManager();for(let e=0;e<t.ranges.length;e++){let n=t.ranges[e];for(let e=n.startRow;e<n.endRow+1;e++){let t=r.getRowOrCreate(e);t!=null&&(t.hd=0)}}return!0}},Mct=(e,t)=>{if(e.get(B).getUniverSheetInstance(t.unitId)==null)throw Error(`universheet is null error!`);return{unitId:t.unitId,subUnitId:t.subUnitId,ranges:t.ranges}},VK={id:`sheet.mutation.set-row-hidden`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)throw Error(`universheet is null error!`);let r=n.getSheetBySheetId(t.subUnitId).getRowManager();for(let e=0;e<t.ranges.length;e++){let n=t.ranges[e];for(let e=n.startRow;e<n.endRow+1;e++){let t=r.getRowOrCreate(e);t!=null&&(t.hd=1)}}return!0}},HK=(e,t)=>{let{unitId:n,subUnitId:r,ranges:i}=e,a={},o=t.getColumnManager();for(let e=0;e<i.length;e++){let t=i[e];for(let e=t.startColumn;e<t.endColumn+1;e++)a[e]=o.getColumnWidth(e)}return{unitId:n,subUnitId:r,ranges:i,colWidth:a}},UK={id:`sheet.mutation.set-worksheet-col-width`,type:L.MUTATION,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let{worksheet:r}=n,i=r.getColumnManager(),a=t.ranges;for(let e=0;e<a.length;e++){let n=a[e];for(let e=n.startColumn;e<n.endColumn+1;e++)r.getColVisible(e)&&(typeof t.colWidth==`number`?i.setColumnWidth(e,t.colWidth):F.isDefine(t.colWidth[e])&&i.setColumnWidth(e,t.colWidth[e]))}return!0}},Nct=(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`[SetWorksheetColumnCountUndoMutationFactory]: worksheet is null error!`);return{unitId:t.unitId,subUnitId:t.subUnitId,columnCount:n.worksheet.getColumnCount()}},WK={id:`sheet.mutation.set-worksheet-column-count`,type:L.MUTATION,handler:(e,t)=>{let n=QG(e.get(B),t);return n?(n.worksheet.setColumnCount(t.columnCount),!0):!1}},GK={id:`sheet.mutation.set-worksheet-default-style`,type:L.MUTATION,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let{worksheet:r}=n,{defaultStyle:i}=t;return r.setDefaultCellStyle(i),!0}},Pct=(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`[SetWorksheetDefaultStyleMutationFactory]: worksheet is null error!`);let{worksheet:r}=n;return{unitId:t.unitId,subUnitId:r.getSheetId(),defaultStyle:r.getDefaultCellStyle()}},Fct=(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`[SetWorksheetRowCountUndoMutationFactory]: worksheet is null error!`);return{unitId:t.unitId,subUnitId:t.subUnitId,rowCount:n.worksheet.getRowCount()}},KK={id:`sheet.mutation.set-worksheet-row-count`,type:L.MUTATION,handler:(e,t)=>{let n=QG(e.get(B),t);return n?(n.worksheet.setRowCount(t.rowCount),!0):!1}},Ict=(e,t)=>{let{unitId:n,subUnitId:r,ranges:i}=e,a={},o=t.getRowManager();for(let{startRow:e,endRow:n}of i)for(let r=e;r<n+1;r++)a[r]=o.getRow(r)?.h??t.getConfig().defaultRowHeight;return{unitId:n,subUnitId:r,ranges:i,rowHeight:a}},qK=(e,t)=>{let{unitId:n,subUnitId:r,ranges:i}=e,a={},o=t.getRowManager();for(let{startRow:e,endRow:t}of i)for(let n=e;n<=t;n++)a[n]=o.getRow(n)?.ia;return{unitId:n,subUnitId:r,ranges:i,autoHeightInfo:a}},JK=(e,t)=>{let{unitId:n,subUnitId:r,rowsAutoHeightInfo:i}=e,a=[],o=t.getRowManager();for(let e of i){let{row:n}=e;a.push({row:n,autoHeight:o.getRow(n)?.ah??t.getConfig().defaultRowHeight})}return{unitId:n,subUnitId:r,rowsAutoHeightInfo:a}},YK={id:`sheet.mutation.set-worksheet-row-height`,type:L.MUTATION,handler:(e,t)=>{let{ranges:n,rowHeight:r}=t,i=ZG(e.get(B),t);if(!i)return!1;let{worksheet:a}=i,o=a.getRowManager();for(let{startRow:e,endRow:t}of n)for(let n=e;n<=t;n++)typeof r==`number`?o.setRowHeight(n,r):F.isDefine(r[n])&&o.setRowHeight(n,r[n]);return!0}},XK={id:`sheet.mutation.set-worksheet-row-is-auto-height`,type:L.MUTATION,handler:(e,t)=>{let{ranges:n,autoHeightInfo:r}=t,i=ZG(e.get(B),t);if(!i)return!1;let a=i.worksheet.getRowManager();for(let{startRow:e,endRow:t}of n)for(let n=e;n<=t;n++){let e=a.getRowOrCreate(n);e.ia=typeof r==`number`?r:r[n]??void 0}return!0}},ZK={id:`sheet.mutation.set-worksheet-row-auto-height`,type:L.MUTATION,handler:(e,t)=>{let{rowsAutoHeightInfo:n}=t,r=ZG(e.get(B),t);if(!r)return!1;let i=r.worksheet.getRowManager();for(let{row:e,autoHeight:t}of n){let n=i.getRowOrCreate(e);n.ah=t}return!0}},QK={id:`sheet.mutation.toggle-gridlines`,type:L.MUTATION,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let{worksheet:r}=n,i=r.getConfig();return i.showGridlines=t.showGridlines,!0}},$K={id:`sheet.operation.set-worksheet-active`,type:L.OPERATION,handler:(e,t)=>{let n=e.get(B).getUnit(t.unitId,M.UNIVER_SHEET);if(!n)return!1;let r=n.getWorksheets();for(let[,e]of r)if(e.getSheetId()===t.subUnitId)return n.setActiveSheet(e),!0;return!1}},Lct=function(e){return e.SET_WORKSHEET_ROW_HEIGHT=`sheet.mutation.set-worksheet-row-height`,e.SET_WORKSHEET_ROW_IS_AUTO_HEIGHT=`sheet.mutation.set-worksheet-row-is-auto-height`,e.SET_WORKSHEET_ROW_AUTO_HEIGHT=`sheet.mutation.set-worksheet-row-auto-height`,e.SET_WORKSHEET_COL_WIDTH=`sheet.mutation.set-worksheet-col-width`,e.SET_WORKSHEET_ACTIVE=`sheet.operation.set-worksheet-active`,e.MOVE_ROWS=`sheet.mutation.move-rows`,e.MOVE_COLUMNS=`sheet.mutation.move-columns`,e.SET_COL_HIDDEN=`sheet.mutation.set-col-hidden`,e.SET_COL_VISIBLE=`sheet.mutation.set-col-visible`,e.SET_ROW_HIDDEN=`sheet.mutation.set-row-hidden`,e.SET_ROW_VISIBLE=`sheet.mutation.set-row-visible`,e.INSERT_COL=`sheet.mutation.insert-col`,e.INSERT_ROW=`sheet.mutation.insert-row`,e.REMOVE_COL=`sheet.mutation.remove-col`,e.REMOVE_ROW=`sheet.mutation.remove-rows`,e.TOGGLE_GRIDLINES=`sheet.mutation.toggle-gridlines`,e.SET_GRIDLINES_COLOR=`sheet.mutation.set-gridlines-color`,e}({}),Rct=function(e){return e.SET_RANGE_VALUES=`sheet.mutation.set-range-values`,e.MOVE_RANGE=`sheet.mutation.move-range`,e.REMOVE_WORKSHEET_MERGE=`sheet.mutation.remove-worksheet-merge`,e.ADD_WORKSHEET_MERGE=`sheet.mutation.add-worksheet-merge`,e.REORDER_RANGE=`sheet.mutation.reorder-range`,e.SET_WORKSHEET_DEFAULT_STYLE=`sheet.mutation.set-worksheet-default-style`,e.SET_ROW_DATA=`sheet.mutation.set-row-data`,e.SET_COL_DATA=`sheet.mutation.set-col-data`,e.SET_WORKSHEET_RANGE_THEME_STYLE=`sheet.mutation.set-worksheet-range-theme-style`,e.DELETE_WORKSHEET_RANGE_THEME_STYLE=`sheet.mutation.delete-worksheet-range-theme-style`,e}({}),eq=[YK.id,XK.id,ZK.id,UK.id,$K.id,xK.id,SK.id,kK.id,AK.id,VK.id,BK.id,yK.id,_K.id,wK.id,CK.id,QK.id,jK.id,KK.id,WK.id],zct=[RK.id,bK.id,EK.id,eK.id,DK.id,GK.id,zK.id,OK.id,mK.id,hK.id];function Bct(e,t){switch(t.id){case`sheet.mutation.set-range-values`:{let e=t.params,n=new Rh(e.cellValue).getDataRange();return n.endRow===-1?[]:e.cellValue?[{unitId:e.unitId,subUnitId:e.subUnitId,range:n}]:[]}case`sheet.mutation.move-range`:{let e=t.params;return[{unitId:e.unitId,subUnitId:e.from.subUnitId,range:new Rh(e.from.value).getRange()},{unitId:e.unitId,subUnitId:e.to.subUnitId,range:new Rh(e.to.value).getRange()}]}case`sheet.mutation.remove-worksheet-merge`:{let e=t.params;return e.ranges.map(t=>({unitId:e.unitId,subUnitId:e.subUnitId,range:t}))}case`sheet.mutation.add-worksheet-merge`:{let e=t.params;return e.ranges.map(t=>({unitId:e.unitId,subUnitId:e.subUnitId,range:t}))}case`sheet.mutation.reorder-range`:{let e=t.params;return[{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}]}case`sheet.mutation.set-worksheet-default-style`:{let n=ZG(e,t.params);if(!n)return[];let{worksheet:r,unitId:i,subUnitId:a}=n;return[{unitId:i,subUnitId:a,range:{startRow:0,endRow:r.getRowCount()-1,startColumn:0,endColumn:r.getColumnCount()-1}}]}case`sheet.mutation.set-row-data`:{let n=ZG(e,t.params);if(!n)return[];let{worksheet:r,unitId:i,subUnitId:a}=n,{rowData:o}=t.params,s=Object.keys(o).map(Number);return s.length===0?[]:[{unitId:i,subUnitId:a,range:{startRow:Math.min(...s),endRow:Math.max(...s),startColumn:0,endColumn:r.getColumnCount()-1}}]}case`sheet.mutation.set-col-data`:{let n=ZG(e,t.params);if(!n)return[];let{worksheet:r,unitId:i,subUnitId:a}=n,{columnData:o}=t.params,s=Object.keys(o).map(Number);return s.length===0?[]:[{unitId:i,subUnitId:a,range:{startRow:0,endRow:r.getRowCount()-1,startColumn:Math.min(...s),endColumn:Math.max(...s)}}]}case`sheet.mutation.set-worksheet-range-theme-style`:case`sheet.mutation.delete-worksheet-range-theme-style`:{let e=t.params;return[{unitId:e.unitId,subUnitId:e.subUnitId,range:e.range}]}default:return[]}}function Vct(e,t){switch(e.id){case`sheet.mutation.set-worksheet-row-height`:case`sheet.mutation.set-worksheet-row-is-auto-height`:{let t=e.params;return t.ranges.map(e=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...e,rangeType:z.ROW}}))}case`sheet.mutation.set-worksheet-row-auto-height`:{let n=e.params;return n.rowsAutoHeightInfo.map(e=>({unitId:n.unitId,subUnitId:n.subUnitId,range:{startRow:e.row,endRow:e.row,startColumn:0,endColumn:t-1,rangeType:z.ROW}}))}case`sheet.mutation.set-worksheet-col-width`:{let t=e.params;return t.ranges.map(e=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...e,rangeType:z.COLUMN}}))}case`sheet.mutation.move-rows`:case`sheet.mutation.move-columns`:{let t=e.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:t.targetRange},{unitId:t.unitId,subUnitId:t.subUnitId,range:t.sourceRange}]}case`sheet.mutation.set-col-hidden`:case`sheet.mutation.set-col-visible`:{let t=e.params;return t.ranges.map(e=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...e,rangeType:z.COLUMN}}))}case`sheet.mutation.set-row-hidden`:case`sheet.mutation.set-row-visible`:{let t=e.params;return t.ranges.map(e=>({unitId:t.unitId,subUnitId:t.subUnitId,range:{...e,rangeType:z.ROW}}))}case`sheet.mutation.insert-col`:{let t=e.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:z.COLUMN}}]}case`sheet.mutation.insert-row`:{let t=e.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:z.ROW}}]}case`sheet.mutation.remove-col`:{let t=e.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:z.COLUMN}}]}case`sheet.mutation.remove-rows`:{let t=e.params;return[{unitId:t.unitId,subUnitId:t.subUnitId,range:{...t.range,rangeType:z.ROW}}]}case`sheet.mutation.toggle-gridlines`:case`sheet.mutation.set-gridlines-color`:return[];default:return[]}}function tq(e,t){if(e.length===0)return`sheets.definedName.nameEmpty`;let{unitId:n,formulaOrRefString:r,univerInstanceService:i,definedNamesService:a,superTableService:o,functionService:s,id:c}=t,l=a.getValueByName(n,e);if(l&&(c==null||c.length===0||l.id!==c)||o.hasTable(n,e))return`sheets.definedName.nameDuplicate`;if(!F.isValidParameter(e)||Yz(e)||!F.isStartValidPosition(e)&&!Ow(e.substring(0,1)))return`sheets.definedName.nameInvalid`;let u=i.getUnit(n,M.UNIVER_SHEET);if(!u)throw Error(`Workbook not found for unitId: ${n}`);return u.getSheets().some(t=>t.getName()===e)?`sheets.definedName.nameSheetConflict`:r.length===0?`sheets.definedName.formulaOrRefStringEmpty`:!s.hasExecutor(e.toUpperCase())||`sheets.definedName.nameConflict`}function Hct(e){return e==null?!1:e.v!==void 0&&e.v!==null&&e.v!==``||e.p!==void 0}function nq(e,t){return e&&e.spanAnchor?Hct(t.getValue(e.spanAnchor.startRow,e.spanAnchor.startColumn)):Hct(e)}function Uct(e,t,n,r,i){let a=e.getCellMatrix(),o=e.getSpanModel().getMergedCellRange(t,n,r,i),s=new Rh;return a.forValue((e,t)=>{let n=a.getValue(e,t);n&&s.setValue(e,t,n)}),o.forEach(e=>{let{startColumn:t,startRow:n,endColumn:r,endRow:i}=e;g_(n,i,t,r).forEach((e,o)=>{e===n&&o===t&&s.setValue(e,o,{...a.getValue(e,o),spanAnchor:{startRow:n,endRow:i,startColumn:t,endColumn:r}}),(e!==n||o!==t)&&(s.realDeleteValue(e,o),s.setValue(e,o,{spanAnchor:{startRow:n,endRow:i,startColumn:t,endColumn:r}}))})}),s}function Wct(e,t,n,r){let{startRow:i,startColumn:a,endRow:o}=e,s=null,c=!1;for(let e=i;e<=o;e++){let i=t.getValue(e,a-n);if(c||=nq(i,t),!r&&c)break;i&&i.spanAnchor&&(s=s?{startRow:Math.min(i.spanAnchor.startRow,s.startRow),startColumn:Math.min(i.spanAnchor.startColumn,s.startColumn),endRow:Math.max(i.spanAnchor.endRow,s.endRow),endColumn:Math.max(i.spanAnchor.endColumn,s.endColumn)}:{startRow:i.spanAnchor.startRow,startColumn:i.spanAnchor.startColumn,endRow:i.spanAnchor.endRow,endColumn:i.spanAnchor.endColumn})}return c?(e.startColumn-=n,{spanAnchor:s,hasValue:!0,range:e}):s?{spanAnchor:d_.simpleRangesIntersect(e,s)?s:null,hasValue:!1,range:e}:{spanAnchor:null,hasValue:!1,range:e}}function Gct(e,t,n,r){let{startRow:i,endColumn:a,endRow:o}=e,s=null,c=!1;for(let e=i;e<=o;e++){let i=t.getValue(e,a+n);if(c||=nq(i,t),!r&&c)break;i&&i.spanAnchor&&(s=s?{startRow:Math.min(i.spanAnchor.startRow,s.startRow),startColumn:Math.min(i.spanAnchor.startColumn,s.startColumn),endRow:Math.max(i.spanAnchor.endRow,s.endRow),endColumn:Math.max(i.spanAnchor.endColumn,s.endColumn)}:{startRow:i.spanAnchor.startRow,startColumn:i.spanAnchor.startColumn,endRow:i.spanAnchor.endRow,endColumn:i.spanAnchor.endColumn})}return c?(e.endColumn+=n,{spanAnchor:s,hasValue:!0,range:e}):s?{spanAnchor:d_.simpleRangesIntersect(e,s)?s:null,hasValue:!1,range:e}:{spanAnchor:null,hasValue:!1,range:e}}function Kct(e,t,n,r){let{startRow:i,startColumn:a,endColumn:o}=e,s=null,c=!1;for(let e=a;e<=o;e++){let a=t.getValue(i-n,e);if(c||=nq(a,t),!r&&c)break;a&&a.spanAnchor&&(s=s?{startRow:Math.min(a.spanAnchor.startRow,s.startRow),startColumn:Math.min(a.spanAnchor.startColumn,s.startColumn),endRow:Math.max(a.spanAnchor.endRow,s.endRow),endColumn:Math.max(a.spanAnchor.endColumn,s.endColumn)}:{startRow:a.spanAnchor.startRow,startColumn:a.spanAnchor.startColumn,endRow:a.spanAnchor.endRow,endColumn:a.spanAnchor.endColumn})}return c?(e.startRow-=n,{spanAnchor:s,hasValue:!0,range:e}):s?{spanAnchor:d_.simpleRangesIntersect(e,s)?s:null,hasValue:!1,range:e}:{spanAnchor:null,hasValue:!1,range:e}}function qct(e,t,n,r){let{startColumn:i,endColumn:a,endRow:o}=e,s=null,c=!1;for(let e=i;e<=a;e++){let i=t.getValue(o+n,e);if(c||=nq(i,t),!r&&c)break;i&&i.spanAnchor&&(s=s?{startRow:Math.min(i.spanAnchor.startRow,s.startRow),startColumn:Math.min(i.spanAnchor.startColumn,s.startColumn),endRow:Math.max(i.spanAnchor.endRow,s.endRow),endColumn:Math.max(i.spanAnchor.endColumn,s.endColumn)}:{startRow:i.spanAnchor.startRow,startColumn:i.spanAnchor.startColumn,endRow:i.spanAnchor.endRow,endColumn:i.spanAnchor.endColumn})}return c?(e.endRow+=n,{spanAnchor:s,hasValue:!0,range:e}):s?{spanAnchor:d_.simpleRangesIntersect(e,s)?s:null,hasValue:!1,range:e}:{spanAnchor:null,hasValue:!1,range:e}}function Jct({range:e,allMatrixWithSpan:t,directions:n,isWorksheetHasSpan:r,maxRow:i,maxColumn:a}){let{left:o,right:s,up:c,down:l}=n,{startRow:u,startColumn:d,endRow:f,endColumn:p}=e,m=!1;if(o&&c&&u>0&&d>0){let n=t.getValue(u-1,d-1);nq(n,t)&&(r&&n.spanAnchor?(e.startRow=n.spanAnchor.startRow,e.startColumn=n.spanAnchor.startColumn):(e.startRow=u-1,e.startColumn=d-1),m=!0)}if(s&&c&&u>0&&p<a-1){let n=t.getValue(u-1,p+1);nq(n,t)&&(r&&n.spanAnchor?(e.startRow=n.spanAnchor.startRow,e.endColumn=n.spanAnchor.endColumn):(e.startRow=u-1,e.endColumn=p+1),m=!0)}if(o&&l&&f<i-1&&d>0){let n=t.getValue(f+1,d-1);nq(n,t)&&(r&&n.spanAnchor?(e.endRow=n.spanAnchor.endRow,e.startColumn=n.spanAnchor.startColumn):(e.endRow=f+1,e.startColumn=d-1),m=!0)}if(s&&l&&f<i-1&&p<a-1){let n=t.getValue(f+1,p+1);nq(n,t)&&(r&&n.spanAnchor?(e.endRow=n.spanAnchor.endRow,e.endColumn=n.spanAnchor.endColumn):(e.endRow=f+1,e.endColumn=p+1),m=!0)}return{hasValue:m,range:e}}function rq(e,t,n){let r=n.getMaxRows(),i=n.getMaxColumns(),a=Uct(n,0,0,r-1,i-1),o=n.getSnapshot().mergeData.length>0,{left:s,right:c,up:l,down:u}=t,d=!0,f={...e},p=[];for(;d;){d=!1;let e=Jct({range:f,allMatrixWithSpan:a,directions:t,isWorksheetHasSpan:o,maxRow:r,maxColumn:i});if(e.hasValue){f=e.range,d=!0;continue}if(l&&f.startRow!==0){let{hasValue:e,range:t,spanAnchor:n}=Kct(f,a,1,o);if(n&&p.push(n),e){f=t,d=!0;continue}}if(u&&f.endRow!==r-1){let{hasValue:e,range:t,spanAnchor:n}=qct(f,a,1,o);if(n&&p.push(n),e){f=t,d=!0;continue}}if(s&&f.startColumn!==0){let{hasValue:e,range:t,spanAnchor:n}=Wct(f,a,1,o);if(n&&p.push(n),e){f=t,d=!0;continue}}if(c&&f.endColumn!==i-1){let{hasValue:e,range:t,spanAnchor:n}=Gct(f,a,1,o);if(n&&p.push(n),e){f=t,d=!0;continue}}}return p.length>0&&(f=d_.union(f,...p)),f}var Yct=e=>{let t=new Rh;return e.forEach(e=>{t_.foreach(e,(e,n)=>{t.setValue(e,n,1)})}),t.forValue((e,n)=>{let r=t.getValue(e-1,n);r&&t.setValue(e,n,r+1)}),t},Xct=e=>{let t={area:0},n=(e,n)=>t.area<e&&(t.area=e,t.range=n,!0);return e.forValue((t,r,i)=>{let a=1,o=i;n(a*o,{startRow:t-o+1,endRow:t,startColumn:r,endColumn:r});let s={startRow:t-o+1,endRow:t,startColumn:0,endColumn:r};for(let i=r-1;i>=0&&e.getValue(t,i);i--){o=Math.min(e.getValue(t,i)||0,o),a++;let r=o*a;s.startColumn=i,s.startRow=t-o+1,n(r,s)}}),t},Zct=(e,t)=>{t_.foreach(t,(t,n)=>{e.realDeleteValue(t,n)});for(let n=t.startColumn;n<=t.endColumn;n++){let r=t.endRow+1;if(e.getValue(r,n)>0){e.setValue(r,n,1);let t=r+1;for(;e.getValue(t,n)>0;)e.setValue(t,n,e.getValue(t-1,n)+1),t++}}return e},Qct=e=>{let t=[],n=Xct(e);for(;n.area>0;)n.range&&(t.push(n.range),Zct(e,n.range)),n=Xct(e);return t},iq=e=>Qct(Yct(e)),aq=1.5,oq=`rgba(255, 255, 255, 0.01)`;function sq(e){let{rangeWithCoord:t,primaryWithCoord:n,style:r}=e,i={range:{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn,rangeType:t.rangeType,unitId:t.unitId,sheetId:t.sheetId},primary:null,style:r};return n!=null&&(i.primary=cq(n)),i}function cq(e){let{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:i}=e,{startRow:a,startColumn:o,endRow:s,endColumn:c}=e.mergeInfo;return{actualRow:t,actualColumn:n,isMerged:r,isMergedMainCell:i,startRow:a,startColumn:o,endRow:s,endColumn:c}}var $ct=function(e){return e[e.Tab=1]=`Tab`,e[e.Comma=2]=`Comma`,e[e.Semicolon=4]=`Semicolon`,e[e.Space=8]=`Space`,e[e.Custom=16]=`Custom`,e}({}),elt=class{constructor(){Z(this,`_tabCount`,0),Z(this,`_commaCount`,0),Z(this,`_semicolonCount`,0),Z(this,`_spaceCount`,0)}add(e){switch(e){case` `:this._tabCount++;break;case`,`:this._commaCount++;break;case`;`:this._semicolonCount++;break;case` `:this._spaceCount++}}update(e){e&&typeof e==`string`&&(e.includes(` `)&&this._tabCount++,e.includes(`,`)&&this._commaCount++,e.includes(`;`)&&this._semicolonCount++,e.trim().includes(` `)&&this._spaceCount++)}getDelimiter(){let e=Math.max(this._tabCount,this._commaCount,this._semicolonCount,this._spaceCount);return e===0||e===this._tabCount?1:e===this._commaCount?2:e===this._semicolonCount?4:e===this._spaceCount?8:1}};function tlt(e,t,n){let r=[];n!==void 0&&(e&16)>0&&r.push(n),(e&1)>0&&r.push(` `),(e&2)>0&&r.push(`,`),(e&4)>0&&r.push(`;`),(e&8)>0&&r.push(` `);let i=``;for(let e of r)i+=cp(e);let a=`[${i}]`;return t&&(a+=`+`),new RegExp(a)}var nlt=e=>e.body?.dataStream.replace(/\r\n$/,``)||``;function rlt(e){if(e!=null){if(e.p)return nlt(e.p);if(e.v&&typeof e.v==`string`)return e.v;if(e.t&&(e.t===Pp.FORCE_STRING||e.t===Pp.STRING))return String(e.v)}}function ilt(e,t,n,r,i=!1){let{startColumn:a,startRow:o,endColumn:s,endRow:c}=t_.transformRange(t,e);if(a!==s)throw Error(`The range must be in the same column.`);if(n&&(n&16)>0&&(r===void 0||r.length!==1))throw Error(`The custom delimiter must a character.`);let l=n===void 0,u=l?new elt:null,d=[];for(let t=o;t<=c;t++){let n=rlt(e.getCell(t,a));d.push(n),u&&u.update(n)}let f=tlt(l?u.getDelimiter():n,i,r),p=-1,m=0,h=0,g=[];for(let e of d){if(e!==void 0){let t=String(e).split(f);p=p<0?t.length:Math.max(p,t.length),g.push(t),m=h}else g.push(void 0);h++}return{rs:g,maxLength:p===-1?0:p,lastRow:m}}var alt=(e,t,n=``)=>e.reduce((e,r)=>{let i=r&&r[t];return typeof i==`string`?(i?(e[i]||(e[i]=[]),e[i].push(r)):e[n].push(r),e):(console.warn(r,`${t} is not string`),e)},{}),olt=(e=0)=>{let t=e;return function(){return t++}};function slt(e){return e==null?!1:e.v!==void 0&&e.v!==null&&e.v!==``||e.p!==void 0}function clt(e,t){for(let n=e.startRow;n<=e.endRow;n++)for(let r=e.startColumn;r<=e.endColumn;r++)if(slt(t.getCell(n,r)))return{startRow:n,startColumn:r,endRow:n,endColumn:r};return null}function llt(e){let t=new Rh;return e.forEach(e=>{let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e;for(let e=n;e<=i;e++)for(let n=r;n<=a;n++)t.setValue(e,n,null)}),t.clone()}function ult(e){let t=new Rh;return e.forEach(e=>{let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e;for(let e=n;e<=i;e++)for(let n=r;n<=a;n++)t.setValue(e,n,{v:null,p:null,f:null,si:null,custom:null})}),t.clone()}function dlt(e){let t=new Rh;return e.forEach(e=>{let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e;for(let e=n;e<=i;e++)for(let n=r;n<=a;n++)t.setValue(e,n,{s:null})}),t.clone()}function lq(e){let{rows:t,cols:n}=e;return{startRow:t[0],endRow:t[t.length-1],startColumn:n[0],endColumn:n[n.length-1]}}function uq(e,t,n,r){let i=t.get(B),a=n?i.getUnit(n,M.UNIVER_SHEET):i.getCurrentUnitOfType(M.UNIVER_SHEET),o=r?a?.getSheetBySheetId(r):a?.getActiveSheet();if(!o)return null;let{startRow:s,endRow:c,startColumn:l,endColumn:u}=e,d=[],f=[];for(let e=s;e<=c;e++)o.getRowFiltered(e)||d.push(e);for(let e=l;e<=u;e++)f.push(e);return{rows:d,cols:f}}function dq(e,t,n,r){let i=ZG(t.get(B),{unitId:n,subUnitId:r});if(!i)return e;let{worksheet:a}=i,o=[];for(let t of e){let{startRow:e,endRow:n,startColumn:r,endColumn:i}=t,s=[],c=e;for(let t=e;t<=n;t++)a.getRowFiltered(t)?(c<t&&s.push([c,t-1]),c=t+1):t===n&&s.push([c,n]);let l=o.findIndex(e=>e.startColumn===r&&e.endColumn===i);l>-1?o[l].rowIntervals=o[l].rowIntervals.concat(s):o.push({startColumn:r,endColumn:i,rowIntervals:s})}let s=[];for(let e of o){let{startColumn:t,endColumn:n,rowIntervals:r}=e,i=Lg(r);for(let[e,r]of i)s.push({startRow:e,endRow:r,startColumn:t,endColumn:n})}return s}function flt(e){return JSON.stringify(e.filter(Boolean))}function fq(e){try{let t=JSON.parse(e);if(Array.isArray(t)&&t.every(e=>typeof e==`string`))return t.filter(Boolean)}catch{}return e.split(`,`).filter(Boolean)}var pq=function(e){return e.OthersCanView=`othersCanView`,e.NoOneElseCanView=`noOneElseCanView`,e}({}),mq=function(e){return e.DesignedUserCanEdit=`designedUserCanEdit`,e.OnlyMe=`onlyMe`,e}({}),hq=class{constructor(){Z(this,`_model`,new Map),Z(this,`_ruleChange$`,new ao),Z(this,`ruleChange$`,this._ruleChange$.asObservable()),Z(this,`_ruleRefresh$`,new ao),Z(this,`ruleRefresh$`,this._ruleRefresh$.asObservable()),Z(this,`_rangeRuleInitStateChange`,new so(!1)),Z(this,`rangeRuleInitStateChange$`,this._rangeRuleInitStateChange.asObservable())}dispose(){this._ruleChange$.complete(),this._ruleRefresh$.complete()}ruleRefresh(e){this._ruleRefresh$.next(e)}getRangeRuleInitState(){return this._rangeRuleInitStateChange.value}changeRuleInitState(e){this._rangeRuleInitStateChange.next(e)}addRule(e,t,n){this._ensureRuleMap(e,t).set(n.id,n),this._ruleChange$.next({unitId:e,subUnitId:t,rule:n,type:`add`})}deleteRule(e,t,n){var r;let i=(r=this._model.get(e))==null||(r=r.get(t))==null?void 0:r.get(n);if(i){var a;(a=this._model.get(e))==null||(a=a.get(t))==null||a.delete(n),this._ruleChange$.next({unitId:e,subUnitId:t,rule:i,type:`delete`})}}setRule(e,t,n,r){let i=this.getRule(e,t,n);if(i){var a;(a=this._model.get(e))==null||(a=a.get(t))==null||a.set(n,r),this._ruleChange$.next({unitId:e,subUnitId:t,oldRule:i,rule:r,type:`set`})}}getRule(e,t,n){var r;return(r=this._model.get(e))==null||(r=r.get(t))==null?void 0:r.get(n)}getSubunitRuleList(e,t){return[...(this._model.get(e)?.get(t)||new Map).values()]}getSubunitRuleListLength(e,t){let n=this._model.get(e)?.get(t);return n?n.size:0}_ensureRuleMap(e,t){let n=this._model.get(e);n||(n=new Map,this._model.set(e,n));let r=n.get(t);return r||(r=new Map,n.set(t,r)),r}toObject(){let e={};return[...this._model.keys()].forEach(t=>{let n=this._model.get(t),r=[...n.keys()];e[t]={},r.forEach(r=>{let i=n.get(r);e[t][r]=[...i.values()]})}),e}fromObject(e){let t=new Map;Object.keys(e).forEach(n=>{let r=e[n],i=new Map;Object.keys(r).forEach(e=>{let t=r[e].reduce((e,t)=>(e.set(t.id,t),e),new Map);i.set(e,t)}),t.set(n,i)}),this._model=t}deleteUnitModel(e){this._model.delete(e)}createRuleId(e,t){let n=ip(4),r=this._ensureRuleMap(e,t);for(;r.has(n);)n=ip(4);return n}getTargetByPermissionId(e,t){let n=this._model.get(e);if(!n)return null;for(let[r,i]of n)for(let n of i.values())if(n.permissionId===t)return[e,r];return null}},gq={id:`sheet.mutation.delete-range-protection`,type:L.MUTATION,handler:(e,t)=>{let{unitId:n,subUnitId:r,ruleIds:i}=t,a=e.get(hq);return i.forEach(e=>{a.deleteRule(n,r,e)}),!0}},_q={id:`sheet.mutation.add-range-protection`,type:L.MUTATION,handler:(e,t)=>{let{unitId:n,subUnitId:r,rules:i}=t,a=e.get(hq);return i.forEach(e=>{a.addRule(n,r,e)}),!0}},plt={type:L.COMMAND,id:`sheet.command.add-range-protection`,async handler(e,t){if(!t)return!1;let n=e.get(R),r=e.get(vx),i=e.get(hq),{rule:a,permissionId:o}=t,{unitId:s,subUnitId:c,ranges:l,description:u,viewState:d,editState:f}=a,p=[{ranges:l,permissionId:o,id:i.createRuleId(s,c),description:u,unitType:a.unitType,unitId:s,subUnitId:c,viewState:d,editState:f}];if(await n.executeCommand(_q.id,{unitId:s,subUnitId:c,rules:p})){let e=[{id:_q.id,params:{unitId:s,subUnitId:c,rules:p}}],t=[{id:gq.id,params:{unitId:s,subUnitId:c,ruleIds:p.map(e=>e.id)}}];r.pushUndoRedo({unitID:s,redoMutations:e,undoMutations:t})}return!0}},vq=function(e){return e[e.MOVE_START=0]=`MOVE_START`,e[e.MOVING=1]=`MOVING`,e[e.MOVE_END=2]=`MOVE_END`,e[e.ONLY_SET=3]=`ONLY_SET`,e}({}),mlt=class extends P{constructor(e){super(),this._workbook=e,Z(this,`_worksheetSelections`,new Map),Z(this,`_worksheetLastSelectionPrimaryCell`,new Map),Z(this,`_selectionMoveStart$`,new ao),Z(this,`selectionMoveStart$`,this._selectionMoveStart$.asObservable()),Z(this,`_selectionMoving$`,new ao),Z(this,`selectionMoving$`,this._selectionMoving$.asObservable()),Z(this,`_selectionMoveEnd$`,new so([])),Z(this,`selectionMoveEnd$`,this._selectionMoveEnd$.asObservable()),Z(this,`_selectionSet$`,new so([])),Z(this,`selectionSet$`,this._selectionSet$.asObservable()),Z(this,`selectionChanged$`,void 0),Z(this,`_beforeSelectionMoveEnd$`,new so([])),Z(this,`beforeSelectionMoveEnd$`,this._beforeSelectionMoveEnd$.asObservable()),this.selectionChanged$=Ps(this._selectionMoveEnd$,this._selectionSet$)}dispose(){super.dispose(),this._beforeSelectionMoveEnd$.complete(),this._selectionMoveEnd$.complete(),this._selectionMoving$.complete(),this._selectionMoveStart$.complete(),this._selectionSet$.complete(),this._workbook=null,this.clear()}addSelections(e,t){let n=this.getSelectionsOfWorksheet(e);n.push(...t),this._selectionSet$.next(n)}setSelections(e,t=[],n){switch(this.setSelectionsOfWorksheet(e,t),n){case 0:this._selectionMoveStart$.next(t);break;case 1:this._selectionMoving$.next(t);break;case 2:this._beforeSelectionMoveEnd$.next(t),this._selectionMoveEnd$.next(t);break;case 3:this._selectionSet$.next(t);break;default:this._selectionSet$.next(t)}}getCurrentSelections(){return this._getCurrentSelections()}getSelectionOfWorksheet(e){return this.getSelectionsOfWorksheet(e)}getSelectionsOfWorksheet(e){return this._worksheetSelections.has(e)||this._worksheetSelections.set(e,[]),this._worksheetSelections.get(e)}getLastSelectionPrimaryCellOfWorksheet(e){return this._worksheetLastSelectionPrimaryCell.get(e)??null}setSelectionsOfWorksheet(e,t){this._worksheetSelections.set(e,[...t]),t.length>0&&t[t.length-1].primary&&this._worksheetLastSelectionPrimaryCell.set(e,t[t.length-1].primary)}deleteSheetSelection(e){this._worksheetSelections.set(e,[]),this._worksheetLastSelectionPrimaryCell.delete(e)}clear(){this._worksheetSelections.clear(),this._worksheetLastSelectionPrimaryCell.clear(),this._selectionSet$.next([])}_getCurrentSelections(){return this.getSelectionsOfWorksheet(this._workbook.getActiveSheet().getSheetId())}getCurrentLastSelection(){let e=this._getCurrentSelections();return e[e.length-1]}},yq=class extends Kf{get _currentSelectionPos(){let e=this._instanceSrv.getCurrentUnitOfType(M.UNIVER_SHEET);if(!e)return null;let t=e.getActiveSheet();return{unitId:e.getUnitId(),sheetId:t.getSheetId()}}get currentSelectionParam(){return this._currentSelectionPos}constructor(e){super(),this._instanceSrv=e,Z(this,`_cellStylesCache`,new Map),Z(this,`selectionMoveStart$`,void 0),Z(this,`selectionMoving$`,void 0),Z(this,`selectionMoveEnd$`,void 0),Z(this,`selectionSet$`,void 0),Z(this,`selectionChanged$`,void 0),Z(this,`_workbookSelections`,new Map),this._init()}_init(){let e=this._instanceSrv.getCurrentTypeOfUnit$(M.UNIVER_SHEET).pipe(ic({bufferSize:1,refCount:!0}),cc(this.dispose$));this.selectionMoveStart$=e.pipe(sc(e=>e?this._ensureWorkbookSelection(e.getUnitId()).selectionMoveStart$:ts()),cc(this.dispose$)),this.selectionMoving$=e.pipe(sc(e=>e?this._ensureWorkbookSelection(e.getUnitId()).selectionMoving$:ts()),cc(this.dispose$)),this.selectionMoveEnd$=e.pipe(sc(e=>e?this._ensureWorkbookSelection(e.getUnitId()).selectionMoveEnd$:ts([])),cc(this.dispose$)),this.selectionSet$=e.pipe(sc(e=>e?this._ensureWorkbookSelection(e.getUnitId()).selectionSet$:ts([])),cc(this.dispose$)),this.selectionChanged$=e.pipe(sc(e=>e?this._ensureWorkbookSelection(e.getUnitId()).selectionChanged$:ts([])),Ys((e,t)=>e.length===t.length?e.length===0&&t.length===0||e.every((e,n)=>JSON.stringify(e)===JSON.stringify(t[n])):!1),ac(1),cc(this.dispose$),nc()),this.disposeWithMe(this._instanceSrv.getTypeOfUnitDisposed$(M.UNIVER_SHEET).pipe(cc(this.dispose$)).subscribe(e=>{this._removeWorkbookSelection(e.getUnitId())})),this.disposeWithMe(this.selectionChanged$.pipe(cc(this.dispose$)).subscribe(()=>{this._cellStylesCache.clear()}))}dispose(){super.dispose(),this._cellStylesCache.clear(),this._workbookSelections.forEach(e=>e.dispose()),this._workbookSelections.clear(),this.selectionMoveStart$=ts(null),this.selectionMoving$=ts(null),this.selectionMoveEnd$=ts([]),this.selectionSet$=ts(null),this.selectionChanged$=ts(null)}clear(){this._workbookSelections.forEach(e=>e.clear())}getCurrentSelections(){return this._getCurrentSelections()}getCurrentLastSelection(){let e=this._getCurrentSelections();return e?.[e.length-1]}getCurrentLastSelectionPrimaryCell(){let e=this._currentSelectionPos;if(!e)return null;let{unitId:t,sheetId:n}=e;return this._ensureWorkbookSelection(t).getLastSelectionPrimaryCellOfWorksheet(n)}addSelections(e,t,n){if(typeof e==`string`){this._ensureWorkbookSelection(e).addSelections(t,n);return}let r=this._currentSelectionPos;if(!r)throw Error(`[SheetsSelectionsService]: cannot find current selection position!`);let{unitId:i,sheetId:a}=r;this._ensureWorkbookSelection(i).addSelections(a,e)}setSelections(e,t,n,r){if(typeof e==`string`&&typeof t==`string`){let i=e;this._ensureWorkbookSelection(i).setSelections(t,n||[],r??3);return}let i=this._currentSelectionPos;if(!i)throw Error(`[SheetsSelectionsService]: cannot find current selection position!`);let{unitId:a,sheetId:o}=i;if(typeof e==`object`){let r=e??n,i=t??3;this._ensureWorkbookSelection(a).setSelections(o,r,i)}}clearCurrentSelections(){this._getCurrentSelections().splice(0)}isOverlapping(){let e=this.getCurrentSelections();return e!=null&&e.some(({range:t},n)=>e.some(({range:e},r)=>n!==r&&t.startRow<=e.endRow&&t.endRow>=e.startRow&&t.startColumn<=e.endColumn&&t.endColumn>=e.startColumn))}_getCurrentSelections(){let e=this._currentSelectionPos;if(!e)return[];let{unitId:t,sheetId:n}=e;return this._ensureWorkbookSelection(t).getSelectionsOfWorksheet(n)}getWorkbookSelections(e){return this._ensureWorkbookSelection(e)}_ensureWorkbookSelection(e){let t=this._workbookSelections.get(e);if(!t){let n=this._instanceSrv.getUnit(e);if(!n)throw Error(`[SheetsSelectionsService]: cannot resolve unit with id "${e}"!`);t=new mlt(n),this._workbookSelections.set(e,t)}return t}_removeWorkbookSelection(e){this._workbookSelections.delete(e)}getCellStylesProperty(e){let t=this._instanceSrv.getCurrentUnitOfType(M.UNIVER_SHEET)?.getActiveSheet(),n=this.getCurrentSelections();if(!t||n.length===0)return{isAllValuesSame:!1,value:null};let r=null;for(let i=0;i<n.length;i++){let{startRow:a,endRow:o,startColumn:s,endColumn:c}=n[i].range;for(let n=a;n<=o;n++)for(let i=s;i<=c;i++){let a=`${n}_${i}`,o;this._cellStylesCache.has(a)?o=this._cellStylesCache.get(a):(o=t.getComposedCellStyle(n,i),this._cellStylesCache.set(a,o));let s=o[e];if(r!=null&&!F.diffValue(r,s))return{isAllValuesSame:!1,value:null};r=s}}return{isAllValuesSame:!0,value:r}}};yq=aK([iK(0,B)],yq);var bq=`SELECTIONS_ENABLED`,xq=`REF_SELECTIONS_ENABLED`,Sq=class extends P{constructor(e,t){super(),this._injector=e,this._univerInstanceService=t,Z(this,`_sceneMap`,new Map),Z(this,`_sheetSkeletonParamStore`,new Map),Z(this,`_buildSkeleton$`,new ao),Z(this,`buildSkeleton$`,this._buildSkeleton$.asObservable()),this._init()}dispose(){super.dispose(),this._sheetSkeletonParamStore.forEach(e=>e.forEach(e=>e.skeleton.dispose())),this._sheetSkeletonParamStore.clear()}_disposeByUnitId(e){let t=this._sheetSkeletonParamStore.get(e);t&&(t.forEach(e=>e.skeleton.dispose()),this._sheetSkeletonParamStore.delete(e))}_init(){this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(M.UNIVER_SHEET).subscribe(e=>this._initWorkbookSkeleton(e.unit))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(M.UNIVER_SHEET).subscribe(e=>this._disposeByUnitId(e.getUnitId())))}_initWorkbookSkeleton(e){let t=e.getUnitId();this._initSheetsSkeleton(e),this.disposeWithMe(e.sheetCreated$.subscribe(n=>{let r=this._sheetSkeletonParamStore.get(t);if(!r)return;let i=n.getSheetId(),a=this._buildSkeleton(n,e.getStyles());r.set(i,{unitId:t,sheetId:i,skeleton:a,dirty:!1})})),this.disposeWithMe(e.sheetDisposed$.subscribe(e=>{let n=this._sheetSkeletonParamStore.get(t);if(!n)return;let r=e.getSheetId(),i=n.get(r);i&&i.skeleton.dispose(),n.delete(r)}))}_initSheetsSkeleton(e){let t=e.getUnitId(),n=new Map;e.getWorksheets().forEach(r=>{let i=r.getSheetId(),a=this._buildSkeleton(r,e.getStyles());n.set(i,{unitId:t,sheetId:i,skeleton:a,dirty:!1})}),this._sheetSkeletonParamStore.set(t,n)}_buildSkeleton(e,t){let n=this._injector.createInstance(OE,e,t),r=e.getUnitId(),i=this._sceneMap.get(r);return i&&n.setScene(i),this._buildSkeleton$.next(n),n}setScene(e,t){this._sceneMap.set(e,t);let n=this._sheetSkeletonParamStore.get(e);n&&n.forEach(e=>e.skeleton.setScene(t))}getSkeletonsByUnitId(e){let t=this._sheetSkeletonParamStore.get(e);return t?Array.from(t.values()).map(e=>e.skeleton):[]}getSkeleton(e,t){return this.getSkeletonParam(e,t)?.skeleton}getSkeletonParam(e,t){let n=this._sheetSkeletonParamStore.get(e);if(n)return n.get(t)}newSkeleton(e,t,n,r){return this.newSkeletonParam(e,t,n,r).skeleton}newSkeletonParam(e,t,n,r){let i=this._buildSkeleton(n,r),a=this._sheetSkeletonParamStore.get(e);a||(a=new Map,this._sheetSkeletonParamStore.set(e,a));let o={unitId:e,sheetId:t,skeleton:i,dirty:!1};return a.set(t,o),o}ensureSkeleton(e,t){let n=this.getSkeleton(e,t);if(n)return n;let r=this._univerInstanceService.getUnit(e);if(!r)return;let i=r.getSheetBySheetId(t);if(i)return this.newSkeleton(e,t,i,r.getStyles())}};Sq=aK([iK(0,j(We)),iK(1,j(B))],Sq);function Cq(e,t){let n=new Rh;return e.map(e=>t_.transformRange(e,t)).forEach(e=>{t_.foreach(e,(e,r)=>{let i=t.getCellHeight(e,r);i&&n.setValue(e,r,i)})}),n}var hlt=1e4;function wq(e,t){if(!t)return{suitableRanges:e,remainingRanges:[]};let n=t.worksheet.getColumnCount(),r=Math.ceil(hlt/n),i=[],a=[],o=t.getOffsetRelativeToRowCol(0,t.scrollY).row,s=e.map(e=>{let t;return t=o>=e.startRow&&o<=e.endRow?0:o<e.startRow?e.startRow-o:o-e.endRow,{range:e,distance:t,rowCount:e.endRow-e.startRow+1}});s.sort((e,t)=>e.distance===t.distance?e.rowCount-t.rowCount:e.distance-t.distance);let c=0;for(let e of s)if(c+e.rowCount<=r)i.push(e.range),c+=e.rowCount;else{let t=r-c;if(t>0){let n={...e.range,endRow:e.range.startRow+t-1},o={...e.range,startRow:e.range.startRow+t};i.push(n),a.push(o),c=r}else a.push(e.range)}return{suitableRanges:i,remainingRanges:a}}function glt(e){let t=0;return e.forEach(()=>{t++}),t}var Tq={id:`sheet.command.clear-selection-all`,type:L.COMMAND,handler:(e,t)=>{let n=ZG(e.get(B),{unitId:t?.unitId,subUnitId:t?.subUnitId});if(!n)return!1;let r=e.get(yq),{unitId:i,subUnitId:a}=n,o=t?.ranges||r.getCurrentSelections()?.map(e=>e.range);if(!o?.length)return!1;let s=e.get(Sq).getSkeleton(i,a);if(!s)return!1;let c=e.get(R),l=e.get(vx),u=e.get(lK),d=[],f=[],p={subUnitId:a,unitId:i,cellValue:llt(dq(o,e,i,a))},m=LK(e,p);d.push({id:RK.id,params:p}),f.push({id:RK.id,params:m});let h=u.onCommandExecute({id:Tq.id,params:t});d.push(...h.redos),f.unshift(...h.undos);let g=Km(d,c),{suitableRanges:_,remainingRanges:v}=wq(o,s),{undos:y,redos:b}=u.generateMutationsOfAutoHeight({unitId:i,subUnitId:a,ranges:_,autoHeightRanges:_,lazyAutoHeightRanges:v}),x=Km(b,c);return g.result&&x.result?(d.push(...b),f.push(...y),l.pushUndoRedo({unitID:i,undoMutations:f,redoMutations:d}),!0):!1}},Eq={id:`sheet.command.clear-selection-format`,type:L.COMMAND,handler:(e,t)=>{let n=ZG(e.get(B),{unitId:t?.unitId,subUnitId:t?.subUnitId});if(!n)return!1;let r=e.get(yq),{unitId:i,subUnitId:a}=n,o=t?.ranges||r.getCurrentSelections()?.map(e=>e.range);if(!o?.length)return!1;let s=e.get(Sq).getSkeleton(i,a);if(!s)return!1;let c=e.get(R),l=e.get(vx),u=e.get(lK),d=[],f=[],p={subUnitId:a,unitId:i,cellValue:dlt(dq(o,e,i,a))},m=LK(e,p);d.push({id:RK.id,params:p}),f.push({id:RK.id,params:m});let h=u.onCommandExecute({id:Eq.id,params:t});d.push(...h.redos),f.unshift(...h.undos);let g=Km(d,c),{suitableRanges:_,remainingRanges:v}=wq(o,s),{undos:y,redos:b}=u.generateMutationsOfAutoHeight({unitId:i,subUnitId:a,ranges:_,autoHeightRanges:_,lazyAutoHeightRanges:v}),x=Km(b,c);return g.result&&x.result?(d.push(...b),f.push(...y),l.pushUndoRedo({unitID:i,undoMutations:f,redoMutations:d}),!0):!1}};function Dq(e,t,n=!0){let r=t.getMatrixWithMergedCells(...lee(e)),i=[];if(r.forValue((t,n,r)=>{if(r.colSpan!==void 0&&r.rowSpan!==void 0){let a={startRow:t,startColumn:n,endRow:t+r.rowSpan-1,endColumn:n+r.colSpan-1};d_.contains(e,a)||i.push(a)}}),i.length===0)return e;let a=d_.union(e,...i);return n?Dq(a,t,n):a}function Oq(e,t,n){let r=null;return n.getMatrixWithMergedCells(e,t,e,t).forValue((e,t,n)=>(r={actualRow:e,actualColumn:t,startRow:e,startColumn:t,isMerged:n.rowSpan!==void 0||n.colSpan!==void 0,isMergedMainCell:n.rowSpan!==void 0&&n.colSpan!==void 0,endRow:e+(n.rowSpan===void 0?0:n.rowSpan-1),endColumn:t+(n.colSpan===void 0?0:n.colSpan-1),rangeType:z.NORMAL},!1)),r||{actualColumn:t,actualRow:e,startRow:e,startColumn:t,endRow:e,endColumn:t,isMerged:!1,isMergedMainCell:!1,rangeType:z.NORMAL}}function _lt(e,t,n){let{startRow:r,startColumn:i,endRow:a,endColumn:o}=e;return Number.isNaN(r)&&(e.startRow=0),Number.isNaN(a)&&(e.endRow=t-1),Number.isNaN(i)&&(e.startColumn=0),Number.isNaN(o)&&(e.endColumn=n-1),e}function kq(e,t){let n=Number.isNaN(e.startRow)?0:e.startRow,r=Number.isNaN(e.startColumn)?0:e.startColumn,i=t.getMergedCell(n,r);return i?{...i,actualRow:n,actualColumn:r,rangeType:z.NORMAL,isMerged:!0,isMergedMainCell:!0}:{startRow:n,startColumn:r,endRow:e.startRow,endColumn:e.startColumn,actualRow:n,actualColumn:r,rangeType:z.NORMAL,isMerged:!1,isMergedMainCell:!1}}var Aq=(e,t,n)=>({id:Fq.id,params:{unitId:t.getUnitId(),subUnitId:n.getSheetId(),reveal:!0,selections:[{range:e,primary:kq(e,n)}]}});function vlt(e){if(!e)return!1;let{range:t,primary:n}=e;return d_.equals(t,n)}function ylt(e){function t(t,n){function r(t){for(let r=t.startRow;r<=t.endRow;r++)if(!e.getRowFiltered(r))for(let e=t.startColumn;e<=t.endColumn;e++)n(r,e,t)}r(t)}return{forOperableEach:t}}var blt=e=>e.id!==kst;function jq(e,t,n,r,i,a,o){let s={};for(let c=t;c<=n;c++)for(let t=r;t<=i;t++){let n=a?e.getCellWithFilteredInterceptors(o,t,Ast,blt):e.getCellWithFilteredInterceptors(c,o,Ast,blt);n&&n.s&&(s[c]||(s[c]={}),s[c][t]={s:n.s})}for(let e in s){for(let t in s[e]){let n=s[e][t];n.s&&typeof n.s==`object`&&F.isEmptyObject(n.s)&&delete n.s,F.isEmptyObject(n)&&delete s[e][t]}F.isEmptyObject(s[e])&&delete s[e]}return s}var Mq=ce(`sheets-formula.ref-selections.service`),Nq=class extends yq{constructor(e){super(e)}_init(){let e=this._getAliveWorkbooks$().pipe(cc(this.dispose$));this.selectionMoveStart$=e.pipe(sc(e=>Ps(...e.map(e=>e.selectionMoveStart$)))),this.selectionMoving$=e.pipe(sc(e=>Ps(...e.map(e=>e.selectionMoving$)))),this.selectionMoveEnd$=e.pipe(sc(e=>Ps(...e.map(e=>e.selectionMoveEnd$)))),this.selectionSet$=e.pipe(sc(e=>Ps(...e.map(e=>e.selectionSet$))))}dispose(){super.dispose(),this.selectionMoveStart$=ts(null),this.selectionMoving$=ts(null),this.selectionMoveEnd$=ts(null),this.selectionSet$=ts(null),delete this._instanceSrv,this._workbookSelections.clear()}_getAliveWorkbooks$(){let e=this._instanceSrv.getAllUnitsForType(M.UNIVER_SHEET);e.forEach(e=>this._ensureWorkbookSelection(e.getUnitId()));let t=new so(e);return this.disposeWithMe(this._instanceSrv.getTypeOfUnitAdded$(M.UNIVER_SHEET).subscribe(e=>{let{unit:n}=e;this._ensureWorkbookSelection(n.getUnitId()),t.next([...t.getValue(),n])})),this.disposeWithMe(this._instanceSrv.getTypeOfUnitDisposed$(M.UNIVER_SHEET).subscribe(e=>{this._removeWorkbookSelection(e.getUnitId()),t.next(t.getValue().filter(t=>t!==e))})),t.pipe(os(e=>e.map(e=>this._ensureWorkbookSelection(e.getUnitId()))))}};Nq=aK([iK(0,B)],Nq);function Pq(e,t){let n=e.get(Fm).getContextValue(xq);return e.get(n&&!t?Mq:yq)}var Fq={id:`sheet.operation.set-selections`,type:L.OPERATION,handler:(e,t)=>{if(!t)return!1;let{selections:n,type:r,unitId:i,subUnitId:a}=t;return Pq(e).setSelections(i,a,[...n],r),!0}},xlt={id:`sheet.command.select-range`,type:L.COMMAND,handler:(e,t)=>{if(!t)return!1;let{unitId:n,subUnit:r,range:i}=t,a=e.get(R),o=ZG(e.get(B),t);if(!o)return!1;let s=[{range:i,primary:kq(i,o.worksheet),style:null}];return a.syncExecuteCommand(Fq.id,{unitId:n,subUnitId:r,selections:s})}},Slt=`sheet.command.move-range`,Iq={type:L.COMMAND,id:Slt,handler:async(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(sb),a=e.get(nx);if(!await e.get(lK).beforeCommandExecute({id:Iq.id,params:t}))return!1;let o=wlt(e,t);return o?Km(o.redos,n).result?(r.pushUndoRedo({unitID:o.unitId,undoMutations:o.undos,redoMutations:o.redos}),!0):!1:(i.emit(a.t(`sheets.info.acrossMergedCell`)),!1)}};function Clt(e,t){let n=e.get(B),r=ZG(n),i=t.toUnitId??t.fromUnitId??r?.unitId,a=t.fromSubUnitId??r?.subUnitId,o=t.toSubUnitId??t.fromSubUnitId??r?.subUnitId;if(!i||!a||!o||t.fromUnitId&&t.toUnitId&&t.fromUnitId!==t.toUnitId)return null;let s=n.getUniverSheetInstance(i),c=s?.getSheetBySheetId(a),l=s?.getSheetBySheetId(o);return!c||!l?null:{unitId:i,fromSubUnitId:a,toSubUnitId:o,fromWorksheet:c,toWorksheet:l}}function wlt(e,t,n={}){let{includeSelection:r=!0,includeAfterCommand:i=!0,includeAutoHeight:a=!0}=n,o=Clt(e,t);if(!o)return null;let s=e.get(lK),{unitId:c,fromSubUnitId:l,toSubUnitId:u,fromWorksheet:d,toWorksheet:f}=o,p=Lq(e,{unitId:c,subUnitId:l,range:t.fromRange},{unitId:c,subUnitId:u,range:t.toRange});if(p===null)return null;let m={id:Iq.id,params:t},h=s.onCommandExecute(m),g=[...h.preRedos??[],...p.redos,...h.redos],_=[...h.preUndos??[],...p.undos,...h.undos];if(r&&(g.push({id:Fq.id,params:{unitId:c,subUnitId:u,selections:[{range:t.toRange,primary:Tlt(t.fromRange,t.toRange,d,f)}],type:2}}),_.push({id:Fq.id,params:{unitId:c,subUnitId:l,selections:[{range:t.fromRange,primary:kq(t.fromRange,d)}],type:2}})),i){let e=s.afterCommandExecute(m);g.push(...e.redos),_.push(...e.undos)}if(a){let{undos:e,redos:n}=s.generateMutationsOfAutoHeight({unitId:c,subUnitId:u,ranges:l===u?[t.fromRange,t.toRange]:[t.toRange]});g.push(...n),_.push(...e)}return{unitId:c,redos:g,undos:_}}function Lq(e,t,n,r=!1){let i=t.unitId,a=e.get(B).getUnit(i,M.UNIVER_SHEET);if(!a)return null;let{subUnitId:o,range:s}=t,{subUnitId:c,range:l}=n,u=a.getSheetBySheetId(o),d=a.getSheetBySheetId(c);if(!u||!d)return null;let f=Dq(l,d,!1);if(!d_.equals(l,f)&&!r)return null;let p=u.getCellMatrix(),m=d.getCellMatrix(),h=new Rh,g=new Rh,_=new Rh,v=new Rh;t_.foreach(s,(e,t)=>{let n=F.deepClone(p.getValue(e,t))??null;n?.s&&(n.s=a.getStyles().get(n.s)),h.setValue(e,t,null),g.setValue(e,t,n);let r=Yh(e,t),i=d_.getRelativeRange(r,s),o=d_.getPositionRange(i,l);_.setValue(o.startRow,o.startColumn,F.deepClone(n))}),t_.foreach(l,(e,t)=>{let n=F.deepClone(m.getValue(e,t))??null;v.setValue(e,t,n)});let y={fromRange:t.range,toRange:n.range,from:{value:h.getMatrix(),subUnitId:o},to:{value:_.getMatrix(),subUnitId:c},unitId:i},b={fromRange:n.range,toRange:t.range,from:{value:v.getMatrix(),subUnitId:c},to:{value:g.getMatrix(),subUnitId:o},unitId:i};return{redos:[{id:bK.id,params:y}],undos:[{id:bK.id,params:b}]}}function Tlt(e,t,n,r=n){let i=e.startRow,a=e.startColumn,o=n.getMergedCell(i,a),s=kq(t,r);if(o){let e=o.endRow-o.startRow+1,t=o.endColumn-o.startColumn+1;s.endRow=s.startRow+e-1,s.endColumn=s.startColumn+t-1,s.actualRow=s.startRow,s.actualColumn=s.startColumn,s.isMerged=!1,s.isMergedMainCell=!0}return s}var Rq={id:`sheet.command.set-range-values`,type:L.COMMAND,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let r=e.get(yq).getCurrentSelections()?.map(e=>e.range),{value:i,range:a,redoUndoId:o}=t,s=a?[a]:r;if(!s||!s.length)return!1;let c=e.get(R),l=e.get(vx),u=e.get(lK),{subUnitId:d,unitId:f,workbook:p,worksheet:m}=n,h=new Rh,g;if(F.isArray(i))for(let e=0;e<s.length;e++){let{startRow:t,startColumn:n,endRow:r,endColumn:a}=s[e];for(let e=t;e<=r;e++)for(let r=n;r<=a;r++)h.setValue(e,r,i[e-t][r-n])}else if(gh(i))for(let e=0;e<s.length;e++){let{startRow:t,startColumn:n,endRow:r,endColumn:a}=s[e];for(let e=t;e<=r;e++)for(let t=n;t<=a;t++)h.setValue(e,t,i)}else g=i,s=g?[new Rh(g).getStartEndScope()]:[];let _={unitId:f,subUnitId:d,cellValue:g??h.getMatrix()},v=LK(e,_),y=Ah(_.cellValue,(e,t)=>m.getCellHeight(e,t)||void 0);if(!c.syncExecuteCommand(RK.id,_))return!1;let{undos:b,redos:x}=u.onCommandExecute({id:Rq.id,params:_}),{undos:S,redos:C}=u.generateMutationsOfAutoHeight({unitId:f,subUnitId:d,ranges:s,cellHeights:new Rh(y)});if(Km([...x,...C],c).result){let e=[{id:RK.id,params:_},...x,...C,Aq(s[s.length-1],p,m)],t=[{id:RK.id,params:v},...b,...S];return r&&r.length&&t.push(Aq(r[r.length-1],p,m)),l.pushUndoRedo({unitID:f,undoMutations:t,redoMutations:e,id:o}),!0}return!1}};function Elt(e,t){let n=[],r=[],{unitId:i,subUnitId:a,range:o,shiftDimension:s,cellValue:c={}}=t,l=e.get(B),u=e.get(lK),d=l.getUniverSheetInstance(i)?.getSheetBySheetId(a);if(d){let t=d.getCellMatrix(),l=t.getDataRange();if(o.startColumn<=l.endColumn||o.startRow<=l.endRow){let c,u;if(s===_p.COLUMNS){let e=Math.min(o.endRow,l.endRow),n=0;for(let r=o.startRow;r<=e;r++){let e=t.getRow(r),i=e?jh(e)-1:0;n=Math.max(n,i)}c={startRow:o.startRow,startColumn:o.startColumn,endRow:e,endColumn:n};let r=o.endColumn-o.startColumn+1;u={startRow:o.startRow,startColumn:c.startColumn+r,endRow:e,endColumn:c.endColumn+r}}else{let e=Math.min(o.endColumn,l.endColumn),t=l.endRow;c={startRow:o.startRow,startColumn:o.startColumn,endRow:t,endColumn:e};let n=o.endRow-o.startRow+1;u={startRow:c.startRow+n,startColumn:o.startColumn,endRow:c.endRow+n,endColumn:e}}let d=Lq(e,{unitId:i,subUnitId:a,range:c},{unitId:i,subUnitId:a,range:u},!0);d&&(n.push(...d.redos),r.push(...d.undos))}if(Object.entries(c).length===0)for(let e=o.startRow;e<=o.endRow;e++){c[e]||(c[e]={});for(let t=o.startColumn;t<=o.endColumn;t++)c[e][t]=null}let f={subUnitId:a,unitId:i,cellValue:c},p=LK(e,f),{undos:m,redos:h}=u.onCommandExecute({id:Rq.id,params:{...f,range:o}});n.push({id:RK.id,params:f},...h),r.push({id:RK.id,params:p},...m)}return{redo:n,undo:r}}function Dlt(e,t){let n=[],r=[],{unitId:i,subUnitId:a,range:o,shiftDimension:s}=t,c=e.get(B),l=e.get(lK),u=c.getUniverSheetInstance(i)?.getSheetBySheetId(a);if(u){let t=u.getCellMatrix(),c=t.getDataRange(),d={subUnitId:a,unitId:i,cellValue:llt([o])},f=LK(e,d),p=l.onCommandExecute({id:Rq.id,params:d});if(n.push({id:RK.id,params:d},...p.redos),r.push(...p.undos,{id:RK.id,params:f}),o.startColumn<=c.endColumn||o.startRow<=c.endRow){let l=null,u=null;if(s===_p.COLUMNS&&o.endColumn<c.endColumn){let e=Math.min(o.endRow,c.endRow),n=0;for(let r=o.startRow;r<=e;r++){let e=t.getRow(r),i=e?jh(e)-1:0;n=Math.max(n,i)}l={startRow:o.startRow,startColumn:o.endColumn+1,endRow:e,endColumn:n};let r=o.endColumn-o.startColumn+1;u={startRow:o.startRow,startColumn:l.startColumn-r,endRow:e,endColumn:l.endColumn-r}}if(s===_p.ROWS&&o.endRow<c.endRow){let e=Math.min(o.endColumn,c.endColumn),t=c.endRow;l={startRow:o.endRow+1,startColumn:o.startColumn,endRow:t,endColumn:e};let n=o.endRow-o.startRow+1;u={startRow:l.startRow-n,startColumn:o.startColumn,endRow:l.endRow-n,endColumn:e}}if(l&&u){let t=Lq(e,{unitId:i,subUnitId:a,range:l},{unitId:i,subUnitId:a,range:u},!0);t&&(n.push(...t.redos),r.push(...t.undos))}}}return{redo:n,undo:r}}var Olt=`sheet.command.delete-range-move-left`,zq={type:L.COMMAND,id:Olt,handler:async(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(B),a=e.get(yq),o=e.get(lK),s=ZG(i);if(!s)return!1;let{worksheet:c,workbook:l,subUnitId:u,unitId:d}=s,f=t?.range;if(f||=a.getCurrentLastSelection()?.range,!f)return!1;let p={range:f,subUnitId:u,unitId:d,shiftDimension:_p.COLUMNS},m=o.onCommandExecute({id:zq.id,params:{range:f}}),{redo:h,undo:g}=Dlt(e,p),_=[...m.preRedos??[],...h],v=[...m.undos,...g];if(_.push(...m.redos),_.push(Aq(f,l,c)),v.push(...m.preUndos??[]),Km(_,n).result){let e=o.afterCommandExecute({id:zq.id,params:{range:f}});return Km(e.redos,n),v.push(...e.undos),_.push(...e.redos),r.pushUndoRedo({unitID:d,undoMutations:v.reverse(),redoMutations:_}),!0}return!1}},klt=`sheet.command.delete-range-move-up`,Bq={type:L.COMMAND,id:klt,handler:async(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(B),a=e.get(yq),o=e.get(lK),s=ZG(i);if(!s)return!1;let{unitId:c,subUnitId:l,workbook:u,worksheet:d}=s,f=t?.range;if(f||=a.getCurrentLastSelection()?.range,!f)return!1;let p={range:f,subUnitId:l,unitId:c,shiftDimension:_p.ROWS},m=o.onCommandExecute({id:Bq.id,params:{range:f}}),{redo:h,undo:g}=Dlt(e,p),_=[...m.preRedos??[],...h],v=[...m.undos,...g];if(_.push(...m.redos),_.push(Aq(f,u,d)),v.push(...m.preUndos??[]),Km(_,n).result){let e=o.afterCommandExecute({id:Bq.id,params:{range:f}});return Km(e.redos,n),v.push(...e.undos),_.push(...e.redos),r.pushUndoRedo({unitID:c,undoMutations:v.reverse(),redoMutations:_}),!0}return!1}},Alt=`sheet.command.insert-range-move-down`,Vq={type:L.COMMAND,id:Alt,handler:async(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(B),a=e.get(yq),o=e.get(lK),s=e.get(sb),c=e.get(nx);if(a.isOverlapping())return s.emit(c.t(`sheets.info.overlappingSelections`)),!1;let l=ZG(i);if(!l)return!1;let{unitId:u,subUnitId:d,worksheet:f,workbook:p}=l,m=t?.range;if(m||=a.getCurrentLastSelection()?.range,!m)return!1;let h=[],g=[],_=f.getCellMatrix(),v=_.getDataRange(),y=_.getSlice(v.startRow,v.endRow,m.startColumn,m.endColumn).getDataRange().endRow,b=Math.max(y+(m.endRow-m.startRow+1)-v.endRow,0);if(b>0){let t=m.startRow-1,n=f.getRowHeight(t),r={unitId:u,subUnitId:d,range:{startRow:v.endRow+1,endRow:v.endRow+b,startColumn:v.startColumn,endColumn:v.endColumn},rowInfo:Array(b).fill(void 0).map(()=>({h:n,hd:Np.FALSE}))};h.push({id:_K.id,params:r});let i=gK(e,r);g.push({id:CK.id,params:i})}let x={};t_.foreach(m,(e,t)=>{let n=f.getCell(e,t);n&&(x[e]||(x[e]={}),x[e][t]={s:n.s})});let{redo:S,undo:C}=Elt(e,{range:m,subUnitId:d,unitId:u,shiftDimension:_p.ROWS,cellValue:x});h.push(...S),g.push(...C);let w=o.onCommandExecute({id:Vq.id,params:{range:m}});if(h.push(...w.redos),h.push(Aq(m,p,f)),g.push(...w.preUndos??[]),h.unshift(...w.preRedos??[]),g.unshift(...w.undos),Km(h,n).result){let e=o.afterCommandExecute({id:Vq.id,params:{range:m}});return Km(e.redos,n),g.push(...e.undos),h.push(...e.redos),r.pushUndoRedo({unitID:u,undoMutations:g.reverse(),redoMutations:h}),!0}return!1}},jlt=`sheet.command.insert-range-move-right`,Hq={type:L.COMMAND,id:jlt,handler:async(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(B),a=e.get(yq),o=e.get(lK),s=e.get(sb),c=e.get(nx);if(a.isOverlapping())return s.emit(c.t(`sheets.info.overlappingSelections`)),!1;let l=ZG(i);if(!l)return!1;let{workbook:u,worksheet:d,unitId:f,subUnitId:p}=l,m=t?.range;if(m||=a.getCurrentLastSelection()?.range,!m)return!1;let h=[],g=[],_=d.getCellMatrix(),v=_.getDataRange(),y=_.getSlice(m.startRow,m.endRow,v.startColumn,v.endColumn).getDataRange().endColumn,b=Math.max(y+(m.endColumn-m.startColumn+1)-v.endColumn,0);if(b>0){let t=m.startColumn-1,n=d.getColumnWidth(t),r={unitId:f,subUnitId:p,range:{startRow:v.startRow+1,endRow:v.endRow,startColumn:v.endColumn+1,endColumn:v.endColumn+b},colInfo:Array(b).fill(void 0).map(()=>({w:n,hd:Np.FALSE}))};h.push({id:yK.id,params:r});let i=vK(e,r);g.push({id:wK.id,params:i})}let x={};t_.foreach(m,(e,t)=>{let n=d.getCell(e,t);n&&n.s&&(x[e]||(x[e]={}),x[e][t]={s:n.s})});let{redo:S,undo:C}=Elt(e,{range:m,subUnitId:p,unitId:f,shiftDimension:_p.COLUMNS,cellValue:x});h.push(...S),g.push(...C);let w=o.onCommandExecute({id:Hq.id,params:{range:m}});if(h.push(...w.redos),h.push(Aq(m,u,d)),g.push(...w.preUndos??[]),h.unshift(...w.preRedos??[]),g.unshift(...w.undos),Km(h,n).result){let e=o.afterCommandExecute({id:Hq.id,params:{range:m}});return Km(e.redos,n),g.push(...e.undos),h.push(...e.redos),r.pushUndoRedo({unitID:f,undoMutations:g.reverse(),redoMutations:h}),!0}return!1}},Mlt=`sheet.command.insert-row`,Uq={type:L.COMMAND,id:Mlt,handler:async(e,t)=>{let n=e.get(R),r=e.get(lK),{range:i,direction:a,unitId:o,subUnitId:s,cellValue:c}=t;return await r.beforeCommandExecute({id:Uq.id,params:t})?n.syncExecuteCommand(Wq.id,{range:i,direction:a,unitId:o,subUnitId:s,cellValue:c}):!1}},Wq={type:L.COMMAND,id:`sheet.command.insert-row-by-range`,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)throw Error(`Workbook or Worksheet not found at InsertRowByRangeCommand`);let{workbook:r,worksheet:i,unitId:a,subUnitId:o}=n,{range:s,direction:c,cellValue:l}=t,{startRow:u,endRow:d}=s;s.rangeType=z.ROW;let f=c===I.UP?u:u-1;if(f<0||f>i.getRowCount()-1)throw Error(`Anchor row is out of bounds in InsertRowByRangeCommand`);let p=e.get(R),m=e.get(vx),h=e.get(lK),g={unitId:a,subUnitId:o,range:s},_=i.getRowHeight(f);_!==i.getConfig().defaultRowHeight&&(g.rowInfo=Array(d-u+1).fill(void 0).map(()=>({h:_,hd:Np.FALSE})));let v=gK(e,g),y=[{id:_K.id,params:g}],b=[{id:CK.id,params:v}];l&&Object.keys(l).length>0&&y.push({id:RK.id,params:{unitId:a,subUnitId:o,cellValue:l}});let x=h.onCommandExecute({id:Uq.id,params:t});if(y.unshift(...x.preRedos??[]),y.push(...x.redos??[]),y.push(Aq(s,r,i)),b.unshift(...x.preUndos??[]),b.push(...x.undos??[]),Km(y,p).result){let e=h.afterCommandExecute({id:Uq.id,params:t});return Km(e.redos,p),y.push(...e.redos),b.push(...e.undos),m.pushUndoRedo({unitID:t.unitId,undoMutations:b,redoMutations:y}),!0}return!1}},Gq={type:L.COMMAND,id:`sheet.command.insert-row-before`,handler:async(e,t)=>{let n=e.get(yq).getCurrentSelections()?.map(e=>e.range),r;if(n?.length===1)r=n[0];else return!1;let i=ZG(e.get(B));if(!i)return!1;let{worksheet:a,subUnitId:o,unitId:s}=i,c=t.value||0,l=r.startRow,u=r.startRow+c-1,d=a.getColumnCount()-1,f={unitId:s,subUnitId:o,direction:I.UP,range:{startRow:l,endRow:u,startColumn:0,endColumn:d},cellValue:jq(a,l,u,0,d,!0,l-1)};return e.get(R).executeCommand(Uq.id,f)}},Nlt={type:L.COMMAND,id:`sheet.command.insert-row-after`,handler:async e=>{let t=e.get(yq).getCurrentSelections()?.map(e=>e.range),n;if(t?.length===1)n=t[0];else return!1;let r=ZG(e.get(B));if(!r)return!1;let{worksheet:i,unitId:a,subUnitId:o}=r,s=n.endRow-n.startRow+1,c=n.endRow+1,l=n.endRow+s,u=i.getColumnCount()-1,d={unitId:a,subUnitId:o,direction:I.DOWN,range:{startRow:c,endRow:l,startColumn:0,endColumn:u,rangeType:z.ROW},cellValue:jq(i,c,l,0,u,!0,n.endRow)};return e.get(R).executeCommand(Uq.id,d)}},Kq={type:L.COMMAND,id:`sheet.command.insert-multi-rows-above`,handler:async(e,t)=>{let n=e.get(yq).getCurrentSelections()?.map(e=>e.range),r;if(n?.length===1)r=n[0];else return!1;let i=ZG(e.get(B));if(!i)return!1;let{worksheet:a,unitId:o,subUnitId:s}=i,c=t.value||0,l=r.startRow,u=r.startRow+c-1,d=a.getColumnCount()-1,f=jq(a,l,u,0,d,!0,l-1),p={unitId:o,subUnitId:s,direction:I.UP,range:{startRow:l,endRow:u,startColumn:0,endColumn:d,rangeType:z.ROW},cellValue:f};return e.get(R).executeCommand(Uq.id,p)}},qq={type:L.COMMAND,id:`sheet.command.insert-multi-rows-after`,handler:async(e,t)=>{let n=e.get(yq).getCurrentSelections()?.map(e=>e.range),r;if(n?.length===1)r=n[0];else return!1;let i=ZG(e.get(B));if(!i)return!1;let{worksheet:a,unitId:o,subUnitId:s}=i,c=t.value||0,l=r.endRow+1,u=r.endRow+c,d=a.getColumnCount()-1,f={unitId:o,subUnitId:s,direction:I.DOWN,range:{startRow:l,endRow:u,startColumn:0,endColumn:d,rangeType:z.ROW},cellValue:jq(a,l,u,0,d,!0,r.endRow)};return e.get(R).executeCommand(Uq.id,f)}},Plt=`sheet.command.insert-col`,Jq={type:L.COMMAND,id:Plt,handler:async(e,t)=>{let n=e.get(R),r=e.get(lK),{range:i,direction:a,subUnitId:o,unitId:s,cellValue:c}=t;return await r.beforeCommandExecute({id:Jq.id,params:t})?n.syncExecuteCommand(Yq.id,{range:i,direction:a,unitId:s,subUnitId:o,cellValue:c}):!1}},Yq={type:L.COMMAND,id:`sheet.command.insert-col-by-range`,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)throw Error(`Workbook or Worksheet not found at InsertColByRangeCommand`);let{workbook:r,worksheet:i,unitId:a,subUnitId:o}=n,{range:s,direction:c,cellValue:l}=t,{startColumn:u,endColumn:d}=s;s.rangeType=z.COLUMN;let f=c===I.LEFT?u:u-1;if(f<0||f>i.getColumnCount()-1)throw Error(`Anchor column is out of bounds in InsertColByRangeCommand`);let p=e.get(R),m=e.get(vx),h=e.get(lK),g={unitId:a,subUnitId:o,range:s},_=i.getColumnWidth(f);_!==i.getConfig().defaultColumnWidth&&(g.colInfo=Array(d-u+1).fill(void 0).map(()=>({w:_,hd:Np.FALSE})));let v=vK(e,g),y=[{id:yK.id,params:g}],b=[{id:wK.id,params:v}];l&&Object.keys(l).length>0&&y.push({id:RK.id,params:{unitId:a,subUnitId:o,cellValue:l}});let x=h.onCommandExecute({id:Jq.id,params:t});if(y.unshift(...x.preRedos??[]),y.push(...x.redos??[]),y.push(Aq(s,r,i)),b.unshift(...x.preUndos??[]),b.push(...x.undos??[]),Km(y,p).result){let e=h.afterCommandExecute({id:Jq.id,params:t});return Km(e.redos,p),y.push(...e.redos),b.push(...e.undos),m.pushUndoRedo({unitID:t.unitId,undoMutations:b.filter(Boolean),redoMutations:y.filter(Boolean)}),!0}return!1}},Xq={type:L.COMMAND,id:`sheet.command.insert-col-before`,handler:async(e,t)=>{let n=e.get(yq).getCurrentSelections(),r;if(n?.length===1)r=n[0].range;else return!1;let i=ZG(e.get(B));if(!i)return!1;let{worksheet:a,unitId:o,subUnitId:s}=i,c=t.value||0,l=r.startColumn,u=r.startColumn+c-1,d=a.getRowCount()-1,f={unitId:o,subUnitId:s,direction:I.LEFT,range:{startColumn:l,endColumn:u,startRow:0,endRow:d,rangeType:z.COLUMN},cellValue:jq(a,0,d,l,u,!1,l-1)};return e.get(R).executeCommand(Jq.id,f)}},Flt={type:L.COMMAND,id:`sheet.command.insert-col-after`,handler:async e=>{let t=e.get(yq).getCurrentSelections(),n;if(t?.length===1)n=t[0].range;else return!1;let r=ZG(e.get(B));if(!r)return!1;let{worksheet:i,unitId:a,subUnitId:o}=r,s=n.endColumn-n.startColumn+1,c=n.endColumn+1,l=n.endColumn+s,u=i.getRowCount()-1,d={unitId:a,subUnitId:o,direction:I.RIGHT,range:{startColumn:c,endColumn:l,startRow:0,endRow:u},cellValue:jq(i,0,u,c,l,!1,n.endColumn)};return e.get(R).executeCommand(Jq.id,d)}},Zq={type:L.COMMAND,id:`sheet.command.insert-multi-cols-before`,handler:async(e,t)=>{let n=e.get(yq).getCurrentSelections(),r;if(n?.length===1)r=n[0].range;else return!1;let i=ZG(e.get(B));if(!i)return!1;let{worksheet:a,unitId:o,subUnitId:s}=i,c=t.value||0,l=r.startColumn,u=r.startColumn+c-1,d=a.getRowCount()-1,f={unitId:o,subUnitId:s,direction:I.LEFT,range:{startColumn:l,endColumn:u,startRow:0,endRow:d,rangeType:z.COLUMN},cellValue:jq(a,0,d,l,u,!1,l-1)};return e.get(R).executeCommand(Jq.id,f)}},Qq={type:L.COMMAND,id:`sheet.command.insert-multi-cols-right`,handler:async(e,t)=>{let n=e.get(yq).getCurrentSelections(),r;if(n?.length===1)r=n[0].range;else return!1;let i=ZG(e.get(B));if(!i)return!1;let{worksheet:a,unitId:o,subUnitId:s}=i,c=t.value||0,l=r.endColumn+1,u=r.endColumn+c,d=a.getRowCount()-1,f={unitId:o,subUnitId:s,direction:I.RIGHT,range:{startColumn:l,endColumn:u,startRow:0,endRow:d},cellValue:jq(a,0,d,l,u,!1,r.endColumn)};return e.get(R).executeCommand(Jq.id,f)}},Ilt=_f((e,t,n,r)=>{if(!r.disposed){let i=Aq(e,t,n);r.executeCommand(i.id,i.params)}},300),$q=`sheet.command.remove-row`,eJ={type:L.COMMAND,id:`sheet.command.remove-row-by-range`,handler:(e,t)=>{if(!t)return!1;let n=ZG(e.get(B),t);if(!n)return!1;let{workbook:r,worksheet:i}=n,a=e.get(lK),{range:o,unitId:s,subUnitId:c}=t,l=dq([o],e,s,c).reverse(),u=[],d=[];l.forEach(e=>{let t=[],n=[],r={unitId:s,subUnitId:c,range:e},a=ect(r,i),o={unitId:s,subUnitId:c,cellValue:i.getCellMatrix().getSlice(e.startRow,e.endRow,0,i.getColumnCount()-1).getMatrix()};n.push({id:CK.id,params:r}),t.push({id:_K.id,params:a}),t.push({id:RK.id,params:o}),d.push(...n),u.unshift(...t)});let f=a.onCommandExecute({id:$q,params:{range:o}}),p=e.get(R);if(Km([...f.preRedos??[],...d,...f.redos],p).result){Ilt(o,r,i,p);let t=a.afterCommandExecute({id:$q,params:{range:o}});return Km(t.redos,p),e.get(vx).pushUndoRedo({unitID:s,undoMutations:[...f.preUndos??[],...u,...f.undos,...t.undos],redoMutations:[...f.preRedos??[],...d,...f.redos,...t.redos]}),!0}return!1}},tJ={type:L.COMMAND,id:$q,handler:async(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let r=e.get(yq),i=t?.range||r.getCurrentLastSelection()?.range;if(!i)return!1;let a=e.get(lK),o=e.get(R),{worksheet:s,unitId:c,subUnitId:l}=n;return i={...i,startColumn:0,endColumn:Math.max(s.getMaxColumns()-1,0)},await a.beforeCommandExecute({id:tJ.id,params:{range:i}})?o.syncExecuteCommand(eJ.id,{range:i,unitId:c,subUnitId:l}):!1}},nJ=`sheet.command.remove-col`,rJ={type:L.COMMAND,id:`sheet.command.remove-col-by-range`,handler:(e,t)=>{if(!t)return!1;let n=ZG(e.get(B),t);if(!n)return!1;let{workbook:r,worksheet:i}=n,a=e.get(lK),{range:o,unitId:s,subUnitId:c}=t,l={unitId:s,subUnitId:c,range:o},u=tct(e,l),d={unitId:s,subUnitId:c,cellValue:i.getCellMatrix().getSlice(0,i.getRowCount()-1,o.startColumn,o.endColumn).getMatrix()},f=a.onCommandExecute({id:nJ,params:{range:o}}),p=e.get(R);if(Km([...f.preRedos??[],{id:wK.id,params:l},...f.redos],p).result){Ilt(o,r,i,p);let t=a.afterCommandExecute({id:nJ,params:{range:o}});return Km(t.redos,p),e.get(vx).pushUndoRedo({unitID:s,undoMutations:[...f.preUndos??[],{id:yK.id,params:u},{id:RK.id,params:d},...f.undos,...t.undos],redoMutations:[...f.preRedos??[],{id:wK.id,params:l},...f.redos,...t.redos]}),!0}return!1}},iJ={type:L.COMMAND,id:nJ,handler:async(e,t)=>{let n=e.get(yq),r=e.get(lK),i=e.get(R),a=t?.range;if(a||=n.getCurrentLastSelection()?.range,!a)return!1;let o=ZG(e.get(B));if(!o)return!1;let{worksheet:s,subUnitId:c,unitId:l}=o;return a={...a,startRow:0,endRow:Math.max(s.getMaxRows()-1,0)},await r.beforeCommandExecute({id:iJ.id,params:{range:a}})?i.syncExecuteCommand(rJ.id,{range:a,unitId:l,subUnitId:c}):!1}},Llt=(e,t)=>{let n=e.get(B),{subUnitId:r,unitId:i}=t,a=QG(n,t);if(!a)throw Error(`[RemoveSheetUndoMutationFactory]: Worksheet is null error!`);let{workbook:o,worksheet:s}=a,c=s.getConfig();return{index:o.getConfig().sheetOrder.findIndex(e=>e===r),sheet:c,unitId:i}},aJ={id:`sheet.mutation.remove-sheet`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B),{subUnitId:r,unitId:i}=t,a=n.getUniverSheetInstance(i);return a?a.removeSheet(r):!1}};function Rlt(e,t){return t.getMergeData().some(t=>t.startRow<e&&e<=t.endRow)}function zlt(e,t){return t.getMergeData().some(t=>t.startColumn<e&&e<=t.endColumn)}var Blt=`sheet.command.move-rows`,oJ={id:Blt,type:L.COMMAND,handler:(e,t)=>{let n=e.get(yq),{fromRange:{startRow:r},toRange:{startRow:i},range:a}=t,o=(a?[Hlt(a)]:n.getCurrentSelections())?.filter(e=>e.range.rangeType===z.ROW&&e.range.startRow<=r&&r<=e.range.endRow);if(o?.length!==1)return!1;let s=e.get(lK),c=ZG(e.get(B),t);if(!c)return!1;let{workbook:l,worksheet:u}=c,d=l.getUnitId(),f=u.getSheetId(),p=e.get(sb),m=e.get(nx),h=o[0].range,g=o[0].primary,_=Dq(h,u,!1);if(!d_.equals(h,_))return p.emit(m.t(`sheets.info.partOfCell`)),!1;if(Rlt(i,u))return p.emit(m.t(`sheets.info.acrossMergedCell`)),!1;let v={...h,startRow:i,endRow:i+h.endRow-h.startRow},y={unitId:d,subUnitId:f,sourceRange:h,targetRange:v},b=Qst(e,y),x=e.get(R),S=s.onCommandExecute({id:oJ.id,params:t}),C=[...S.preRedos??[],{id:xK.id,params:y}],w=[...S.preUndos??[],{id:xK.id,params:b}];if(g){let e=i-r<0,t=h.endRow-h.startRow+1,n=e?v:{...v,startRow:v.startRow-t,endRow:v.endRow-t},a={unitId:d,subUnitId:f,type:2,selections:[{range:n,primary:kq(n,u),style:null}]},o={unitId:d,subUnitId:f,type:2,selections:[{range:h,primary:g,style:null}]};C.push({id:Fq.id,params:a}),w.push({id:Fq.id,params:o})}if(C.push(...S.redos),w.push(...S.undos),Km(C,x).result){let n=s.afterCommandExecute({id:oJ.id,params:t});return Km(n.redos,x),C.push(...n.redos),w.push(...n.undos),e.get(vx).pushUndoRedo({unitID:d,undoMutations:w,redoMutations:C}),!0}return!1}},Vlt=`sheet.command.move-cols`,sJ={id:Vlt,type:L.COMMAND,handler:(e,t)=>{let n=e.get(yq),{fromRange:{startColumn:r},toRange:{startColumn:i},range:a}=t,o=(a?[Hlt(a)]:n.getCurrentSelections())?.filter(e=>e.range.rangeType===z.COLUMN&&e.range.startColumn<=r&&r<=e.range.endColumn);if(o?.length!==1)return!1;let s=e.get(lK),c=ZG(e.get(B),t);if(!c)return!1;let{workbook:l,worksheet:u}=c,d=l.getUnitId(),f=u.getSheetId(),p=e.get(sb),m=e.get(nx),h=o[0].range,g=o[0].primary,_=Dq(h,u,!1);if(!d_.equals(h,_))return p.emit(m.t(`sheets.info.partOfCell`)),!1;if(zlt(i,u))return p.emit(m.t(`sheets.info.acrossMergedCell`)),!1;let v={...h,startColumn:i,endColumn:i+h.endColumn-h.startColumn},y={unitId:d,subUnitId:f,sourceRange:h,targetRange:v},b=$st(e,y),x=e.get(R),S=s.onCommandExecute({id:sJ.id,params:t}),C=[...S.preRedos??[],{id:SK.id,params:y}],w=[...S.preUndos??[],{id:SK.id,params:b}];if(g){let e=h.endColumn-h.startColumn+1,t=i-r<0?v:{...v,startColumn:v.startColumn-e,endColumn:v.endColumn-e},n={unitId:d,subUnitId:f,type:2,selections:[{range:t,primary:kq(t,u),style:null}]},a={unitId:d,subUnitId:f,type:2,selections:[{range:h,primary:g,style:null}]};C.push({id:Fq.id,params:n}),w.push({id:Fq.id,params:a})}if(C.push(...S.redos),w.push(...S.undos),Km(C,x).result){let n=s.afterCommandExecute({id:sJ.id,params:t});return Km(n.redos,x),C.push(...n.redos),w.push(...n.undos),e.get(vx).pushUndoRedo({unitID:d,undoMutations:w,redoMutations:C}),!0}return!1}};function Hlt(e){return{range:e,primary:null,style:null}}var Ult=`sheet.command.reorder-range`,cJ={id:Ult,type:L.COMMAND,handler:(e,t)=>{let{subUnitId:n,unitId:r,range:i,order:a}=t,o=e.get(R),s={id:DK.id,params:{unitId:r,subUnitId:n,order:a,range:i}},c={id:DK.id,params:nct(s.params)},l=e.get(lK),u=l.onCommandExecute({id:cJ.id,params:t}),d=[...u.preRedos??[],s,...u.redos],f=[...u.preUndos??[],c,...u.undos],p=Km(d,o),{suitableRanges:m,remainingRanges:h}=wq([i],e.get(Sq).getSkeleton(r,n)),{undos:g,redos:_}=l.generateMutationsOfAutoHeight({unitId:r,subUnitId:n,ranges:[i],autoHeightRanges:m,lazyAutoHeightRanges:h}),v=l.afterCommandExecute({id:cJ.id,params:t});return p.result?(Km([...v.redos,..._],o),e.get(vx).pushUndoRedo({unitID:r,undoMutations:[...f,...v.undos,...g],redoMutations:[...d,...v.redos,..._]}),!0):!1}},lJ={MoveRangeCommandId:Slt,InsertRowCommandId:Mlt,InsertColCommandId:Plt,RemoveColCommandId:nJ,RemoveRowCommandId:$q,DeleteRangeMoveLeftCommandId:Olt,DeleteRangeMoveUpCommandId:klt,InsertRangeMoveDownCommandId:Alt,InsertRangeMoveRightCommandId:jlt,MoveColsCommandId:Vlt,MoveRowsCommandId:Blt,ReorderRangeCommandId:Ult},uJ=e=>{let t={...e},n=Number.isNaN(t.startRow)&&Number.isNaN(t.endRow)&&!Number.isNaN(t.startColumn)&&!Number.isNaN(t.endColumn),r=Number.isNaN(t.startColumn)&&Number.isNaN(t.endColumn)&&!Number.isNaN(t.startRow)&&!Number.isNaN(t.endRow);return(t.rangeType===z.COLUMN||n)&&(t.startRow=0,t.endRow=Qg-1),(t.rangeType===z.ROW||r)&&(t.startColumn=0,t.endColumn=$g-1),t.rangeType===z.ALL&&(t.startColumn=0,t.endColumn=$g-1,t.startRow=0,t.endRow=Qg-1),t},dJ=e=>{let t=e.rangeType;return e.rangeType===z.COLUMN?t=z.ROW:e.rangeType===z.ROW&&(t=z.COLUMN),{startRow:e.startColumn,endRow:e.endColumn,startColumn:e.startRow,endColumn:e.endRow,rangeType:t}},fJ=(e,t,n)=>{let r={...n},i={...t},a=(e,t)=>{let n=Math.max(e.start,t.start),r=Math.min(e.end,t.end);return r<n?null:{start:n,end:r}},o=e=>e.end-e.start+1,s=(e,t)=>({start:e.start-t.start,end:e.start-t.start+e.end-e.start}),c=(e,t)=>({start:t.start+e.start,end:t.start+e.start+e.end-e.start}),l=t.start>e.start;if(l){let n=Math.min(e.end,t.start)-e.start+1;i.start-=n,i.end-=n}let u=o(e),d=u,f=a(e,r),p=f&&o(f)>=o(r);if(e.end<r.start)r.start-=u,r.end-=u;else if(f){let t=o(f);if(p){let t=c(s(r,e),i);r.start=t.start,r.end=t.end}else f.start>e.start?l?(r.end-=t+u,r.start-=u):r.end-=t:l?r.end-=t:r.start>e.start&&r.end>e.end?(r.start-=u,r.end-=u+t):r.end-=t}let m=a(i,r);return p||(i.start<=r.start?(r.start+=d,r.end+=d):m&&(l?i.end<=r.start||i.start<=r.start&&i.end>=r.start?(r.start+=d,r.end+=d):i.start>=r.start&&i.start<=r.end&&(r.end+=d):r.start<i.start&&r.end>i.start?r.end+=d:(r.start>=i.end||r.start>=i.start&&r.start<=i.end)&&(r.end+=d,r.start+=d))),{step:r.start-n.start,length:o(r)-o(n)}},pJ=(e,t)=>{let{fromRange:n,toRange:r}=e.params||{};if(!r||!n)return[];let i=uJ(n),a=uJ(r),o=uJ(t),s=fJ({start:i.startRow,end:i.endRow},{start:a.startRow,end:a.endRow},{start:o.startRow,end:o.endRow});return s===null?[{type:1}]:[{type:3,step:s.step||0,length:s.length||0}]},Wlt=(e,t)=>{let{fromRange:n,toRange:r}=e.params||{};if(!n||!r)return[t];let i=n.startRow,a=n.endRow-n.startRow+1,o=r.startRow,s=new Rh;return t_.foreach(t,(e,t)=>{s.setValue(e,t,1)}),s.moveRows(i,a,o),h_(s,e=>e===1)},Glt=(e,t)=>{let{range:n,order:r}=e.params||{};if(!n||!r)return[t];let i=new Rh;t_.foreach(t,(e,t)=>{i.setValue(e,t,1)});let a=new Rh;return t_.foreach(n,(e,t)=>{if(Object.prototype.hasOwnProperty.call(r,e)){let n=r[e],o=i.getValue(n,t)??0;a.setValue(e,t,o)}}),a.forValue((e,t,n)=>{i.setValue(e,t,n)}),h_(i,e=>e===1)},mJ=(e,t)=>{let{fromRange:n,toRange:r}=e.params||{};if(!r||!n)return[];let i=uJ(n),a=uJ(r),o=uJ(t),s=fJ({start:i.startColumn,end:i.endColumn},{start:a.startColumn,end:a.endColumn},{start:o.startColumn,end:o.endColumn});return s===null?[{type:1}]:[{type:2,step:s.step||0,length:s.length||0}]},Klt=(e,t)=>{let{fromRange:n,toRange:r}=e.params||{};if(!n||!r)return[t];let i=n.startColumn,a=n.endColumn-n.startColumn+1,o=r.startColumn,s=new Rh;return t_.foreach(t,(e,t)=>{s.setValue(e,t,1)}),s.moveColumns(i,a,o),h_(s,e=>e===1)},hJ=(e,t)=>{let n=e.params?.toRange,r=e.params?.fromRange;if(!n||!r)return[];let i=[];if(d_.contains(n,t)&&i.push({type:1}),d_.contains(r,t)){i.push({type:1});let e=d_.getRelativeRange(t,r);return[{type:0,range:d_.getPositionRange(e,n)}]}return i},qlt=(e,t)=>{let n=e.params?.toRange,r=e.params?.fromRange;if(!n||!r||!d_.intersects(r,t)&&!d_.intersects(n,t))return[t];if(d_.contains(r,t)){let e=d_.getRelativeRange(t,r);return[d_.getPositionRange(e,n)]}let i=new Rh;t_.foreach(t,(e,t)=>{i.setValue(e,t,1)});let a=new Rh,o=d_.getIntersects(r,t);o&&t_.foreach(o,(e,t)=>{i.getValue(e,t)&&(i.setValue(e,t,void 0),a.setValue(e,t,1))});let s=n.startColumn-r.startColumn,c=n.startRow-r.startRow,l={startColumn:n.startColumn-s,endColumn:n.endColumn-s,startRow:n.startRow-c,endRow:n.endRow-c};return l&&t_.foreach(l,(e,t)=>{let n=e+c,r=t+s;i.setValue(n,r,a.getValue(e,t)??0)}),h_(i,e=>e===1)},gJ=(e,t)=>{let n=uJ(e),r=uJ(t),i=e=>e.endColumn-e.startColumn+1,a=e=>e.endRow-e.startRow+1;if(n.startRow<=r.startRow&&n.endRow>=r.endRow){if(r.startColumn<n.startColumn&&r.endColumn>=n.startColumn&&r.endColumn<=n.endColumn||r.startColumn<n.startColumn&&r.endColumn>=n.endColumn){let e=d_.getIntersects(r,n);if(e)return{step:0,length:-i(e)}}if(r.startColumn>=n.startColumn&&r.endColumn<=n.endColumn&&a(n)>=a(r))return null;if(r.startColumn>=n.startColumn&&r.startColumn<=n.endColumn&&r.endColumn>n.endColumn){let e=d_.getIntersects(r,n);if(e){let t=-i(e);return{step:-(i(n)-i(e)),length:t}}}if(r.startColumn>n.endColumn)return{step:-i(n),length:0}}return{step:0,length:0}},_J=(e,t)=>{let n=e.params?.range;if(!n)return[];let r=[],i=gJ(n,t);if(!i)r.push({type:1});else{let{step:e,length:t}=i;r.push({type:2,step:e,length:t})}return r},vJ=(e,t,n)=>{let r=e.params?.range;if(!r)return[];let i=[];if(n&&n.length>0){let e=r.startRow;for(let t=r.startRow;t<=r.endRow;t++){if(n.includes(t)){if(t===e){e=t+1;continue}a({...r,startRow:e,endRow:t-1}),e=t+1;continue}t===r.endRow&&a({...r,startRow:e,endRow:r.endRow})}}else a(r);function a(e){let n=gJ(dJ(e),dJ(t));if(!n)i.push({type:1});else{let{step:e,length:t}=n;i.push({type:3,step:e,length:t})}}return i},Jlt=(e,t)=>{let{range:n,order:r}=e.params||{};if(!n||!r)return[];if(d_.contains(n,t)&&t.endRow===t.startRow){let e=[],n=t.startRow;for(let t in r)if(r[t]===n){let r=Number(t);return e.push({type:3,step:r-n,length:0}),e}return[]}return[]},yJ=(e,t)=>{let n=uJ(e),r=uJ(t),i=e=>e.endColumn-e.startColumn+1;return n.startRow<=r.startRow&&n.endRow>=r.endRow?r.startColumn<n.startColumn&&r.endColumn>=n.startColumn&&r.endColumn<=n.endColumn||r.startColumn<n.startColumn&&r.endColumn>=n.endColumn?{step:0,length:i(n)}:r.startColumn>=n.startColumn&&r.endColumn<=n.endColumn||r.startColumn>=n.startColumn&&r.startColumn<=n.endColumn&&r.endColumn>n.endColumn||r.startColumn>=n.endColumn?{step:i(n),length:0}:{step:0,length:0}:{step:0,length:0}};function Ylt(e,t,n){let r=[];if(d_.contains(t,n)&&r.push({type:1}),d_.contains(e,n)){r.push({type:1});let i=d_.getRelativeRange(n,e);return[{type:0,range:d_.getPositionRange(i,t)}]}return r}var bJ=(e,t)=>{let n=e.params?.range;if(!n)return[];let r=[],{step:i,length:a}=yJ(dJ(n),dJ(t));return r.push({type:3,step:i,length:a}),r},xJ=(e,t)=>{let n=e.params?.range;if(!n)return[];let r=[],{step:i,length:a}=yJ(n,t);return r.push({type:2,step:i,length:a}),r},SJ=(e,t)=>{let n=e.params?.range;if(!n)return[];let r=[],{step:i,length:a}=yJ(dJ(n),dJ(t));return r.push({type:3,step:i,length:a}),r},Xlt=(e,t)=>{let n=e.params?.range;if(!n)return[t];let r=n.endRow-n.startRow+1,i={...n,startRow:n.startRow,endRow:1/0},a=d_.subtract(t,i),o=d_.getIntersects(i,t);if(!o)return[t];let s=new Rh;return a.forEach(e=>{t_.foreach(e,(e,t)=>{s.setValue(e,t,1)})}),o&&t_.foreach(o,(e,t)=>{s.setValue(e+r,t,1)}),h_(s,e=>e===1)},CJ=(e,t)=>{let n=e.params?.range;if(!n)return[];let r=[],{step:i,length:a}=yJ(n,t);return r.push({type:2,step:i,length:a}),r},Zlt=(e,t)=>{let n=e.params?.range;if(!n)return[t];let r=n.endColumn-n.startColumn+1,i={...n,startColumn:n.startColumn,endColumn:1/0},a=d_.subtract(t,i),o=d_.getIntersects(i,t);if(!o)return[t];let s=new Rh;return a.forEach(e=>{t_.foreach(e,(e,t)=>{s.setValue(e,t,1)})}),o&&t_.foreach(o,(e,t)=>{s.setValue(e,t+r,1)}),h_(s,e=>e===1)},wJ=(e,t)=>{let n=e.params?.range;if(!n)return[];let r=[],i=gJ(n,t);if(!i)r.push({type:1});else{let{step:e,length:t}=i;r.push({type:2,step:e,length:t})}return r},Qlt=(e,t)=>{let n=e.params?.range;if(!n)return[t];let r={startRow:n.startRow,endRow:n.endRow,startColumn:n.startColumn,endColumn:1/0},i=n.endColumn-n.startColumn+1,a=d_.getIntersects(n,t),o=d_.subtract(t,r),s=d_.getIntersects(r,t);if(!a&&!s)return[t];let c=new Rh;return s&&t_.foreach(s,(e,t)=>{c.setValue(e,t-i,1)}),a&&t_.foreach(a,(e,t)=>{c.setValue(e,t-i,0)}),o.forEach(e=>{t_.foreach(e,(e,t)=>{c.setValue(e,t,1)})}),h_(c,e=>e===1)},TJ=(e,t)=>{let n=e.params?.range;if(!n)return[];let r=[],i=gJ(dJ(n),dJ(t));if(!i)r.push({type:1});else{let{step:e,length:t}=i;r.push({type:3,step:e,length:t})}return r},$lt=(e,t)=>{let n=e.params?.range;if(!n)return[t];let r={...n,startRow:n.startRow,endRow:1/0},i=n.endRow-n.startRow+1,a=d_.getIntersects(n,t),o=d_.subtract(t,r),s=d_.getIntersects(r,t);if(!a&&!s)return[t];let c=new Rh;return s&&t_.foreach(s,(e,t)=>{c.setValue(e-i,t,1)}),a&&t_.foreach(a,(e,t)=>{c.setValue(e-i,t,0)}),o.forEach(e=>{t_.foreach(e,(e,t)=>{c.setValue(e,t,1)})}),h_(c,e=>e===1)},eut=(e,t)=>{let n=Lg((e.ranges??[e.range]).map(e=>[e.startRow,e.endRow])),r=t.startRow,i=t.endRow;for(let e=n.length-1;e>=0;e--){let[a,o]=n[e];if(a<=t.startRow&&o>=t.endRow)return[];if(o<r){let e=o-a+1;r-=e,i-=e}else if(!(a>i)){let e=Math.max(a,r),t=Math.min(o,i)-e+1;if(i-=t,a<=r){let t=e-r;r-=t}}}return[{...t,startRow:r,endRow:i}]},tut=(e,t)=>{let n=e.params,r=n.range.startRow,i=n.range.endRow-n.range.startRow+1;if(n.direction===I.UP){if(r<t.startRow)return[{...t,startRow:t.startRow+i,endRow:t.endRow+i}];if(r<=t.endRow)return[{...t,endRow:t.endRow+i}]}else if(r<=t.startRow)return[{...t,startRow:t.startRow+i,endRow:t.endRow+i}];else if(r<=t.endRow+1)return[{...t,endRow:t.endRow+i}];return[t]},nut=(e,t)=>{let n=e.params,r=n.range.startColumn,i=n.range.endColumn-n.range.startColumn+1;if(n.direction===I.LEFT){if(r<t.startColumn)return[{...t,startColumn:t.startColumn+i,endColumn:t.endColumn+i}];if(r<=t.endColumn)return[{...t,endColumn:t.endColumn+i}]}else if(r<=t.startColumn)return[{...t,startColumn:t.startColumn+i,endColumn:t.endColumn+i}];else if(r<=t.endColumn+1)return[{...t,endColumn:t.endColumn+i}];return[t]},EJ=(e,t)=>{let n={...t};return e.forEach(e=>{switch(e.type){case 1:n=null;break;case 2:if(!n)return;n.startColumn+=e.step,n.endColumn+=e.step+(e.length||0);break;case 3:if(!n)return;n.startRow+=e.step,n.endRow+=e.step+(e.length||0);break;case 0:n=e.range}}),n&&(n.endColumn<n.startColumn||n.endRow<n.startRow)?null:n},DJ=(e,t)=>{let n=[];switch(t.id){case lJ.DeleteRangeMoveLeftCommandId:n=wJ(t,e);break;case lJ.DeleteRangeMoveUpCommandId:n=TJ(t,e);break;case lJ.InsertColCommandId:n=xJ(t,e);break;case lJ.InsertRangeMoveDownCommandId:n=SJ(t,e);break;case lJ.InsertRangeMoveRightCommandId:n=CJ(t,e);break;case lJ.InsertRowCommandId:n=bJ(t,e);break;case lJ.MoveColsCommandId:n=mJ(t,e);break;case lJ.MoveRangeCommandId:n=hJ(t,e);break;case lJ.MoveRowsCommandId:n=pJ(t,e);break;case lJ.RemoveColCommandId:n=_J(t,e);break;case lJ.RemoveRowCommandId:n=vJ(t,e);break;case lJ.ReorderRangeCommandId:n=Jlt(t,e)}return EJ(n,e)},rut=(e,t,n)=>[zq.id,Bq.id].includes(t.id)||out(t,n).some(t=>d_.intersects(t,e))?DJ(e,t):e,OJ=(e,t)=>{let n=[];switch(t.id){case lJ.DeleteRangeMoveLeftCommandId:return Qlt(t,e);case lJ.DeleteRangeMoveUpCommandId:return $lt(t,e);case lJ.InsertRangeMoveDownCommandId:return Xlt(t,e);case lJ.InsertRangeMoveRightCommandId:return Zlt(t,e);case lJ.InsertColCommandId:return nut(t,e);case lJ.InsertRowCommandId:return tut(t,e);case lJ.MoveColsCommandId:return Klt(t,e);case lJ.MoveRangeCommandId:return qlt(t,e);case lJ.MoveRowsCommandId:return Wlt(t,e);case lJ.ReorderRangeCommandId:return Glt(t,e);case lJ.RemoveColCommandId:n=_J(t,e);break;case lJ.RemoveRowCommandId:return eut(t.params,e)}let r=EJ(n,e);return r?[r]:[]},iut=(e,t,n)=>[zq.id,Bq.id,Vq.id,`sheet.command.insert-range-move-right`].includes(t.id)||out(t,n).some(t=>d_.intersects(t,e))?OJ(e,t):e;function aut(e,t){let{id:n,params:r}=t,i={length:0,step:0,type:4};switch(n){case aJ.id:i.type=1;break;case xK.id:i=fJ({start:r.sourceRange.startRow,end:r.sourceRange.endRow},{start:r.targetRange.startRow,end:r.targetRange.endRow},{start:e.startRow,end:e.endRow}),i.type=3;break;case SK.id:i=fJ({start:r.sourceRange.startColumn,end:r.sourceRange.endColumn},{start:r.targetRange.startColumn,end:r.targetRange.endColumn},{start:e.startColumn,end:e.endColumn}),i.type=2;break;case wK.id:i=gJ(r.range,e),i?i.type=2:i={step:0,length:0,type:1};break;case CK.id:i=gJ(dJ(r.range),dJ(e)),i?i.type=3:i={step:0,length:0,type:1};break;case _K.id:i=yJ(dJ(r.range),dJ(e)),i.type=3;break;case yK.id:i=yJ(r.range,e),i.type=2;break;case bK.id:i=Ylt(r.fromRange||new Rh(r.from).getRange(),r.toRange||new Rh(r.to).getRange(),e)}return i?EJ(Array.isArray(i)?i:[i],e):e}function out(e,t){let{selectionManagerService:n}=t;switch(e.id){case lJ.MoveColsCommandId:{let t=e.params;return[t.fromRange,{...t.toRange,startColumn:t.toRange.startColumn-.5,endColumn:t.toRange.endColumn-.5}]}case lJ.MoveRowsCommandId:{let t=e.params;return[t.fromRange,{...t.toRange,startRow:t.toRange.startRow-.5,endRow:t.toRange.startRow-.5}]}case lJ.MoveRangeCommandId:{let t=e;return[t.params.fromRange,t.params.toRange]}case lJ.InsertRowCommandId:{let t=e.params.range;return[{...t,startRow:t.startRow-.5,endRow:t.endRow-.5}]}case lJ.InsertColCommandId:{let t=e.params.range;return[{...t,startColumn:t.startColumn-.5,endColumn:t.endColumn-.5}]}case lJ.RemoveRowCommandId:return[e.params.range];case lJ.RemoveColCommandId:return[e.params.range];case lJ.DeleteRangeMoveUpCommandId:case lJ.InsertRangeMoveDownCommandId:{var r;let t=e.params?.range||((r=n.getCurrentSelections())==null||(r=r.map(e=>e.range))==null?void 0:r[0]);return t?[t]:[]}case lJ.DeleteRangeMoveLeftCommandId:case lJ.InsertRangeMoveRightCommandId:{var i;let t=e.params?.range||((i=n.getCurrentSelections())==null||(i=i.map(e=>e.range))==null?void 0:i[0]);return t?[t]:[]}case lJ.ReorderRangeCommandId:{let{range:t,order:n}=e.params,r=[];for(let e=t.startRow;e<=t.endRow;e++)e in n&&r.push({startRow:e,endRow:e,startColumn:t.startColumn,endColumn:t.endColumn});return r}}}function sut(e){switch(e.id){case SK.id:{let t=e.params;return[t.sourceRange,{...t.targetRange,startColumn:t.targetRange.startColumn-.5,endColumn:t.targetRange.startColumn-.5}]}case xK.id:{let t=e.params;return[t.sourceRange,{...t.targetRange,startRow:t.targetRange.startRow-.5,endRow:t.targetRange.startRow-.5}]}case bK.id:{let t=e.params;return[new Rh(t.from.value).getRange(),new Rh(t.to.value).getRange()]}case yK.id:{let t=e.params.range;return[{...t,startColumn:t.startColumn-.5,endColumn:t.startColumn-.5}]}case _K.id:{let t=e.params.range;return[{...t,startRow:t.startRow-.5,endRow:t.startRow-.5}]}case wK.id:return[e.params.range];case CK.id:return[e.params.range]}}function cut(e,t){let n=e.get(B);switch(t.id){case lJ.MoveColsCommandId:{let e=t.params,r=ZG(n,e);if(!r)return;let{unitId:i,subUnitId:a}=r,{fromRange:o,toRange:s}=e;return{unitId:i,subUnitId:a,ranges:[o,{...s,startColumn:o.startColumn<s.startColumn?o.endColumn+1:s.startColumn,endColumn:o.startColumn<s.startColumn?s.endColumn-1:o.startColumn-1}]}}case lJ.MoveRowsCommandId:{let e=t.params,r=ZG(n,e);if(!r)return;let{unitId:i,subUnitId:a}=r,{fromRange:o,toRange:s}=e;return{unitId:i,subUnitId:a,ranges:[o,{...s,startRow:o.startRow<s.startRow?o.endRow+1:s.startRow,endRow:o.startRow<s.startRow?s.endRow-1:o.startRow-1}]}}case lJ.MoveRangeCommandId:{let e=t.params,r=ZG(n);if(!r)return;let{unitId:i,subUnitId:a}=r,{fromRange:o,toRange:s}=e;return{unitId:i,subUnitId:a,ranges:[o,s]}}case lJ.InsertRowCommandId:{let e=t.params,r=ZG(n,e);if(!r)return;let{worksheet:i,unitId:a,subUnitId:o}=r,{range:s}=e;return{unitId:a,subUnitId:o,ranges:[...s.startRow>0?[{...s,startRow:s.startRow-1,endRow:s.endRow-1}]:[],{...s,startRow:s.startRow,endRow:i.getRowCount()-1}]}}case lJ.InsertColCommandId:{let e=t.params,r=ZG(n,e);if(!r)return;let{worksheet:i,unitId:a,subUnitId:o}=r,{range:s}=e;return{unitId:a,subUnitId:o,ranges:[...s.startColumn>0?[{...s,startColumn:s.startColumn-1,endColumn:s.endColumn-1}]:[],{...s,startColumn:s.startColumn,endColumn:i.getColumnCount()-1}]}}case lJ.RemoveRowCommandId:{let e=t.params,r=ZG(n);if(!r)return;let{worksheet:i,unitId:a,subUnitId:o}=r,{range:s}=e;return{unitId:a,subUnitId:o,ranges:[s,{...s,startRow:s.endRow+1,endRow:i.getRowCount()-1}]}}case lJ.RemoveColCommandId:{let e=t.params,r=ZG(n);if(!r)return;let{worksheet:i,unitId:a,subUnitId:o}=r,{range:s}=e;return{unitId:a,subUnitId:o,ranges:[s,{...s,startColumn:s.endColumn+1,endColumn:i.getColumnCount()-1}]}}case lJ.DeleteRangeMoveUpCommandId:case lJ.InsertRangeMoveDownCommandId:{let e=t.params,r=ZG(n);if(!r)return;let{worksheet:i,unitId:a,subUnitId:o}=r,{range:s}=e;return{unitId:a,subUnitId:o,ranges:[s,{...s,startRow:s.endRow+1,endRow:i.getRowCount()-1}]}}case lJ.DeleteRangeMoveLeftCommandId:case lJ.InsertRangeMoveRightCommandId:{let e=t.params,r=ZG(n);if(!r)return;let{worksheet:i,unitId:a,subUnitId:o}=r,{range:s}=e;return{unitId:a,subUnitId:o,ranges:[s,{...s,startColumn:s.endColumn+1,endColumn:i.getColumnCount()-1}]}}case lJ.ReorderRangeCommandId:{let e=t.params,r=ZG(n);if(!r)return;let{unitId:i,subUnitId:a}=r,{range:o,order:s}=e,c=[];for(let e=o.startRow;e<=o.endRow;e++)e in s&&c.push({startRow:e,endRow:e,startColumn:o.startColumn,endColumn:o.endColumn});return{unitId:i,subUnitId:a,ranges:c}}}}var lut=Cf(`MERGE_REDO`),uut=Cf(`MERGE_UNDO`),dut=class extends P{constructor(e,t,n,r,i=!1){super(),this._unitId=e,this._subUnitId=t,this._range=n,this._callback=r,this._skipIntersects=i}onMutation(e){if(e.params?.unitId!==this._unitId)return;if(e.id===bK.id){let t=e.params;if(t.from.subUnitId!==this._subUnitId||t.to.subUnitId!==this._subUnitId)return}else if(e.params?.subUnitId!==this._subUnitId)return;if(!this._range||this._skipIntersects&&(e.id===aJ.id||sut(e)?.some(e=>d_.intersects(e,this._range))))return;let t=aut(this._range,e);if(t&&d_.equals(t,this._range))return!1;let n=this._range;this._range=t,this._callback(n,t)}},kJ=class extends P{constructor(e,t,n,r){super(),this._commandService=e,this._sheetInterceptorService=t,this._univerInstanceService=n,this._selectionManagerService=r,Z(this,`interceptor`,new Tf({MERGE_REDO:lut,MERGE_UNDO:uut})),Z(this,`_watchRanges`,new Set),Z(this,`_refRangeManagerMap`,new Map),Z(this,`_serializer`,hut()),Z(this,`_onRefRangeChange`,()=>{this._sheetInterceptorService.interceptCommand({getMutations:e=>{let t=(()=>{switch(e.id){case lJ.MoveColsCommandId:{let t=e.params,n=ZG(this._univerInstanceService,t);if(!n)return[];let{worksheet:r,unitId:i,subUnitId:a}=n,o=Math.min(t.fromRange.startColumn,t.toRange.startColumn);return this._checkRange([{...t.fromRange,startColumn:o,endColumn:r.getColumnCount()-1}],i,a)}case lJ.MoveRowsCommandId:{let t=e.params,n=ZG(this._univerInstanceService,t);if(!n)return[];let{worksheet:r,unitId:i,subUnitId:a}=n,o=Math.min(t.fromRange.startRow,t.toRange.startRow);return this._checkRange([{...t.fromRange,startRow:o,endRow:r.getRowCount()-1}],i,a)}case lJ.MoveRangeCommandId:{let t=e.params,n=ZG(this._univerInstanceService,{unitId:t.fromUnitId,subUnitId:t.fromSubUnitId}),r=ZG(this._univerInstanceService,{unitId:t.toUnitId??t.fromUnitId,subUnitId:t.toSubUnitId??t.fromSubUnitId});if(!n&&!r)return[];if(n&&r&&n.unitId===r.unitId&&n.subUnitId===r.subUnitId)return this._checkRange([t.fromRange,t.toRange],n.unitId,n.subUnitId);let i=[];return n&&i.push(...this._checkRange([t.fromRange],n.unitId,n.subUnitId)),r&&i.push(...this._checkRange([t.toRange],r.unitId,r.subUnitId)),i}case lJ.InsertRowCommandId:{let t=e.params,n=ZG(this._univerInstanceService,t);if(!n)return[];let{worksheet:r,unitId:i,subUnitId:a}=n,o={startRow:Math.max(0,t.range.startRow-1),endRow:r.getRowCount()-1,startColumn:0,endColumn:r.getColumnCount()-1,rangeType:z.ROW};return this._checkRange([o],i,a)}case lJ.InsertColCommandId:{let t=e.params,n=ZG(this._univerInstanceService,t);if(!n)return[];let{worksheet:r,unitId:i,subUnitId:a}=n,o={startRow:0,endRow:r.getRowCount()-1,startColumn:Math.max(0,t.range.startColumn-1),endColumn:r.getColumnCount()-1,rangeType:z.COLUMN};return this._checkRange([o],i,a)}case lJ.RemoveRowCommandId:{let t=e.params,n=ZG(this._univerInstanceService);if(!n)return[];let{worksheet:r,unitId:i,subUnitId:a}=n,o={startRow:t.range.startRow,endRow:r.getRowCount()-1,startColumn:0,endColumn:r.getColumnCount()-1,rangeType:z.ROW};return this._checkRange([o],i,a)}case lJ.RemoveColCommandId:{let t=e.params,n=ZG(this._univerInstanceService);if(!n)return[];let{worksheet:r,unitId:i,subUnitId:a}=n,o={startRow:0,endRow:r.getRowCount()-1,startColumn:t.range.startColumn,endColumn:r.getColumnCount()-1,rangeType:z.COLUMN};return this._checkRange([o],i,a)}case lJ.DeleteRangeMoveUpCommandId:case lJ.InsertRangeMoveDownCommandId:{let t=e.params,n=ZG(this._univerInstanceService);if(!n)return[];let{worksheet:r,unitId:i,subUnitId:a}=n,o={...t.range,endRow:r.getRowCount()-1};return this._checkRange([o],i,a)}case lJ.DeleteRangeMoveLeftCommandId:case lJ.InsertRangeMoveRightCommandId:{let t=e.params,n=ZG(this._univerInstanceService);if(!n)return[];let{worksheet:r,unitId:i,subUnitId:a}=n,o={...t.range,endColumn:r.getColumnCount()-1};return this._checkRange([o],i,a)}case lJ.ReorderRangeCommandId:{let t=e.params,n=ZG(this._univerInstanceService);if(!n)return[];let{unitId:r,subUnitId:i}=n,{range:a,order:o}=t,s=[];for(let e=a.startRow;e<=a.endRow;e++)e in o&&s.push({startRow:e,endRow:e,startColumn:a.startColumn,endColumn:a.endColumn});return this._checkRange(s,r,i)}}})();if(!t||t.length===0)return{redos:[],undos:[],preRedos:[],preUndos:[]};let n=t.reduce((t,n)=>{let r=n(e);return t.push(r),t},[]).reduce((e,t)=>(e.redos.push(...t.redos),e.undos.push(...t.undos),e.preRedos.push(...t.preRedos??[]),e.preUndos.push(...t.preUndos??[]),e),{redos:[],undos:[],preUndos:[],preRedos:[]}),r=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_REDO)(n.preRedos,null)||[],i=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_REDO)(n.redos,null)||[],a=this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_UNDO)(n.preUndos,null)||[];return{redos:i,undos:this.interceptor.fetchThroughInterceptors(this.interceptor.getInterceptPoints().MERGE_UNDO)(n.undos,null)||[],preRedos:r,preUndos:a}}})}),Z(this,`_checkRange`,(e,t,n)=>{let r=mut(t,n),i=this._refRangeManagerMap.get(r);if(i){let t=new Set;return[...i.keys()].forEach(n=>{let r=i.get(n),a=this._serializer.deserialize(n),o={...a,startRow:+a.startRow,endRow:+a.endRow,startColumn:+a.startColumn,endColumn:+a.endColumn,rangeType:a.rangeType&&+a.rangeType};e.some(e=>d_.intersects(e,o))&&r&&r.forEach(e=>{t.add(e)})}),[...t]}return[]}),Z(this,`registerRefRange`,(e,t,n,r)=>{let i=n||fut(this._univerInstanceService),a=r||put(this._univerInstanceService);if(!i||!a)return Wf(()=>{});let o=mut(i,a),s=this._serializer.serialize(e),c=this._refRangeManagerMap.get(o);c||(c=new Map,this._refRangeManagerMap.set(o,c));let l=c.get(s);return l?l.add(t):c.set(s,new Set([t])),Wf(()=>{let e=c.get(s);e&&(e.delete(t),e.size||(c.delete(s),c.size||this._refRangeManagerMap.delete(o)))})}),this._onRefRangeChange(),this.interceptor.intercept(this.interceptor.getInterceptPoints().MERGE_REDO,{priority:-1,handler:e=>e}),this.interceptor.intercept(this.interceptor.getInterceptPoints().MERGE_UNDO,{priority:-1,handler:e=>e})}watchRange(e,t,n,r,i){let a;this._watchRanges.size===0&&(a=this._commandService.onCommandExecuted(e=>{if(e.type!==L.MUTATION)return!1;for(let t of this._watchRanges)t.onMutation(e)}));let o=new dut(e,t,n,r,i);this._watchRanges.add(o);let s=Wf(()=>{this._watchRanges.delete(o),this._watchRanges.size===0&&(a?.dispose(),a=null)}),c=this.disposeWithMe(s);return Wf(()=>{c.dispose(),s.dispose()})}};kJ=aK([iK(0,R),iK(1,j(lK)),iK(2,j(B)),iK(3,j(yq))],kJ);function fut(e){return e.getCurrentUnitOfType(M.UNIVER_SHEET)?.getUnitId()}function put(e){var t;return(t=e.getCurrentUnitOfType(M.UNIVER_SHEET))==null||(t=t.getActiveSheet())==null?void 0:t.getSheetId()}function mut(e,t){return`${e}_${t}`}function hut(){let e=[`startRow`,`startColumn`,`endRow`,`endColumn`,`rangeType`];return{deserialize:t=>{let n=e.reduce((e,t,n)=>(e[String(n)]=t,e),{});return t.split(`_`).reduce((e,t,r)=>{let i=String(r);return t&&n[i]&&(e[n[i]]=t),e},{})},serialize:t=>e.reduce((e,n,r)=>{let i=t[n];return i===void 0?`${e}`:`${e}${r>0?`_`:``}${i}`},``)}}var gut=[yK.id,_K.id,wK.id,CK.id],_ut=[xK.id,SK.id];function AJ(e,t){let n=e;if(t!==void 0){let e=[];for(let r=0;r<n.length;r++){let{startRow:i,endRow:a,startColumn:o,endColumn:s}=n[r];if(t===_p.ROWS)for(let t=i;t<=a;t++){let n={startRow:t,endRow:t,startColumn:o,endColumn:s};e.push(n)}else if(t===_p.COLUMNS)for(let t=o;t<=s;t++){let n={startRow:i,endRow:a,startColumn:t,endColumn:t};e.push(n)}}n=e}return n}var vut=Cf(`mergeCellPermissionCheck`),jJ=class extends P{constructor(e,t,n,r,i,a){super(),this._commandService=e,this._refRangeService=t,this._univerInstanceService=n,this._injector=r,this._sheetInterceptorService=i,this._selectionManagerService=a,Z(this,`disposableCollection`,new Gf),Z(this,`interceptor`,new Tf({MERGE_CELL_INTERCEPTOR_CHECK:vut})),this._onRefRangeChange(),this._initCommandInterceptor(),this._commandExecutedListener()}_initCommandInterceptor(){let e=this;this._sheetInterceptorService.interceptCommand({getMutations(t){switch(t.id){case Tq.id:case Eq.id:{let t=e._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET),n=t.getUnitId(),r=t?.getActiveSheet();if(!r)return{redos:[],undos:[]};let i=r.getSheetId(),a=r.getConfig().mergeData,o=e._selectionManagerService.getCurrentSelections()?.map(e=>e.range);if(o&&o.length>0&&o.some(e=>a.some(t=>d_.intersects(t,e)))){let t={unitId:n,subUnitId:i,ranges:o},r=TK(e._injector,t);return{redos:[{id:EK.id,params:t}],undos:[{id:eK.id,params:r}]}}}}return{redos:[],undos:[]}}}),this._sheetInterceptorService.interceptRanges({getMutations:({unitId:e,subUnitId:t,ranges:n})=>{let r=[],i=[],a={redos:r,undos:i};if(!n||!n.length)return a;let o=ZG(this._univerInstanceService,{unitId:e,subUnitId:t});if(!o)return a;let{worksheet:s}=o,c=s.getMergeData().filter(e=>n.some(t=>d_.intersects(e,t)));return c.length?(r.push({id:EK.id,params:{unitId:e,subUnitId:t,ranges:c}}),i.push({id:eK.id,params:{unitId:e,subUnitId:t,ranges:c}}),{undos:i,redos:r}):a}})}refRangeHandle(e,t,n){switch(e.id){case lJ.MoveColsCommandId:{let r=e.params;return this._handleMoveColsCommand(r,t,n)}case lJ.MoveRowsCommandId:{let r=e.params;return this._handleMoveRowsCommand(r,t,n)}case Uq.id:{let r=e.params,i=r.unitId||t,a=r.subUnitId||n;return this._handleInsertRowCommand(r,i,a)}case Jq.id:{let r=e.params,i=r.unitId||t,a=r.subUnitId||n;return this._handleInsertColCommand(r,i,a)}case iJ.id:{let r=e.params;return this._handleRemoveColCommand(r,t,n)}case tJ.id:{let r=e.params;return this._handleRemoveRowCommand(r,t,n)}case Iq.id:{let r=e.params;return this._handleMoveRangeCommand(r,t,n)}case Hq.id:{let r=e.params;return this._handleInsertRangeMoveRightCommand(r,t,n)}case Vq.id:{let r=e.params;return this._handleInsertRangeMoveDownCommand(r,t,n)}case Bq.id:{let r=e.params;return this._handleDeleteRangeMoveUpCommand(r,t,n)}case zq.id:{let r=e.params;return this._handleDeleteRangeMoveLeftCommand(r,t,n)}}return{redos:[],undos:[]}}_onRefRangeChange(){let e=(e,t)=>{let n=this._univerInstanceService.getUniverSheetInstance(e);if(!n)return;let r=n?.getSheetBySheetId(t);if(!r)return;this.disposableCollection.dispose();let i=r.getMergeData(),a=n=>this.refRangeHandle(n,e,t);i.forEach(n=>{this.disposableCollection.add(this._refRangeService.registerRefRange(n,a,e,t))})};this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(t.id===$K.id){let n=t.params,r=n.subUnitId,i=n.unitId;if(!r||!i)return;e(i,r)}if(t.id===eK.id){let n=t.params,r=n.subUnitId,i=n.unitId;if(!r||!i)return;e(n.unitId,n.subUnitId)}})),this._univerInstanceService.getCurrentTypeOfUnit$(M.UNIVER_SHEET).pipe($s(e=>!!e)).subscribe(t=>{let n=t.getActiveSheet();n&&e(t.getUnitId(),n.getSheetId())})}_handleMoveRowsCommand(e,t,n){let r=MJ(this._univerInstanceService,t);if(!r)return this._handleNull();let i=NJ(r,n);if(!i)return this._handleNull();let a=[...i.getMergeData()],o={unitId:t,subUnitId:n,ranges:[]},s={unitId:t,subUnitId:n,ranges:[]},{fromRange:c}=e,{startRow:l,endRow:u}=c;if(a.forEach(t=>{if(l<=t.startRow&&u>=t.endRow){o.ranges.push(t);let n=EJ(pJ({id:lJ.MoveRowsCommandId,params:e},t),t);n&&s.ranges.push(n)}}),o.ranges.length===0)return this._handleNull();let d=TK(this._injector,o),f=$G(this._injector,s);return{preRedos:[{id:EK.id,params:o}],redos:[{id:eK.id,params:s}],preUndos:[{id:EK.id,params:f}],undos:[{id:eK.id,params:d}]}}_handleMoveColsCommand(e,t,n){let r=MJ(this._univerInstanceService,t);if(!r)return this._handleNull();let i=NJ(r,n);if(!i)return this._handleNull();let a=[...i.getMergeData()],o={unitId:t,subUnitId:n,ranges:[]},s={unitId:t,subUnitId:n,ranges:[]},{fromRange:c}=e,{startColumn:l,endColumn:u}=c;if(a.forEach(t=>{if(l<=t.startColumn&&u>=t.endColumn){o.ranges.push(t);let n=EJ(mJ({id:lJ.MoveColsCommandId,params:e},t),t);n&&s.ranges.push(n)}}),o.ranges.length===0)return this._handleNull();let d=TK(this._injector,o),f=$G(this._injector,s);return{preRedos:[{id:EK.id,params:o}],redos:[{id:eK.id,params:s}],preUndos:[{id:EK.id,params:f}],undos:[{id:eK.id,params:d}]}}_handleMoveRangeCommand(e,t,n){let r=MJ(this._univerInstanceService,t);if(!r)return this._handleNull();let i=e.fromSubUnitId??n,a=e.toSubUnitId??i,o=NJ(r,i),s=NJ(r,a);if(!o||!s)return this._handleNull();let c=o.getMergeData().filter(t=>d_.intersects(t,e.fromRange)),l=s.getMergeData().filter(t=>d_.intersects(t,e.toRange)),u=AJ(c.map(t=>d_.getRelativeRange(t,e.fromRange)).map(t=>d_.getPositionRange(t,e.toRange))).filter(e=>!s.getMergeData().some(t=>d_.equals(e,t))),d=[],f=[];return n===i&&c.length>0&&(d.push({id:EK.id,params:{unitId:t,subUnitId:i,ranges:c}}),f.push({id:eK.id,params:{unitId:t,subUnitId:i,ranges:c}})),n===a&&l.length>0&&(d.push({id:EK.id,params:{unitId:t,subUnitId:a,ranges:l}}),f.push({id:eK.id,params:{unitId:t,subUnitId:a,ranges:l}})),n===a&&u.length>0&&(d.push({id:eK.id,params:{unitId:t,subUnitId:a,ranges:u}}),f.unshift({id:EK.id,params:{unitId:t,subUnitId:a,ranges:u}})),d.length===0?this._handleNull():{redos:d,undos:f}}_handleInsertRowCommand(e,t,n){let r=MJ(this._univerInstanceService,t);if(!r)return this._handleNull();let i=NJ(r,n);if(!i)return this._handleNull();let{range:a}=e,{startRow:o,endRow:s}=a,c=F.deepClone(i.getMergeData()).reduce((e,t)=>(o>t.startRow&&o<=t.endRow&&e.push(t),e),[]);if(c.length===0)return this._handleNull();let l=F.deepClone(i.getMergeData()).reduce((e,t)=>{if(o>t.startRow&&o<=t.endRow){let n=s-o+1;t.endRow+=n,this._checkIsMergeCell(t)&&e.push(t)}return e},[]),u={unitId:t,subUnitId:n,ranges:c},d=TK(this._injector,u),f={unitId:t,subUnitId:n,ranges:l},p=$G(this._injector,f);return{redos:[{id:EK.id,params:u},{id:eK.id,params:f}],undos:[{id:EK.id,params:p},{id:eK.id,params:d}]}}_handleInsertColCommand(e,t,n){let{range:r}=e,i=MJ(this._univerInstanceService,t);if(!i)return this._handleNull();let a=NJ(i,n);if(!a)return this._handleNull();let{startColumn:o,endColumn:s}=r,c=F.deepClone(a.getMergeData()).reduce((e,t)=>(o>t.startColumn&&o<=t.endColumn&&e.push(t),e),[]);if(c.length===0)return this._handleNull();let l=F.deepClone(a.getMergeData()).reduce((e,t)=>{if(o>t.startColumn&&o<=t.endColumn){let n=s-o+1;t.endColumn+=n,this._checkIsMergeCell(t)&&e.push(t)}return e},[]),u={unitId:t,subUnitId:n,ranges:c},d=TK(this._injector,u),f={unitId:t,subUnitId:n,ranges:l},p=$G(this._injector,f);return{redos:[{id:EK.id,params:u},{id:eK.id,params:f}],undos:[{id:EK.id,params:p},{id:eK.id,params:d}]}}_handleRemoveColCommand(e,t,n){let r=MJ(this._univerInstanceService,t);if(!r)return this._handleNull();let i=NJ(r,n);if(!i)return this._handleNull();let{range:a}=e,{startColumn:o,endColumn:s}=a,c=F.deepClone(i.getMergeData()).reduce((e,t)=>(d_.intersects(a,t)&&e.push(t),e),[]);if(c.length===0)return this._handleNull();let l=F.deepClone(i.getMergeData()).reduce((e,t)=>{if(d_.intersects(a,t)){if(o<=t.startColumn&&s>=t.endColumn)return e;o>=t.startColumn&&s<=t.endColumn?t.endColumn-=s-o+1:o<t.startColumn?(t.startColumn=o,t.endColumn-=s-o+1):s>t.endColumn&&(t.endColumn=o-1),this._checkIsMergeCell(t)&&e.push(t)}return e},[]),u={unitId:t,subUnitId:n,ranges:c},d=TK(this._injector,u),f={unitId:t,subUnitId:n,ranges:l},p=$G(this._injector,f),m=[{id:EK.id,params:u}],h=[{id:eK.id,params:f}];return{preUndos:[{id:EK.id,params:p}],undos:[{id:eK.id,params:d}],preRedos:m,redos:h}}_handleRemoveRowCommand(e,t,n){let{range:r}=e,i=MJ(this._univerInstanceService,t);if(!i)return this._handleNull();let a=NJ(i,n);if(!a)return this._handleNull();let{startRow:o,endRow:s}=r,c=F.deepClone(a.getMergeData()).reduce((e,t)=>(d_.intersects(r,t)&&e.push(t),e),[]);if(c.length===0)return this._handleNull();let l=F.deepClone(a.getMergeData()).reduce((e,t)=>{if(d_.intersects(r,t)){if(o<=t.startRow&&s>=t.endRow)return e;o>=t.startRow&&s<=t.endRow?t.endRow-=s-o+1:o<t.startRow?(t.startRow=o,t.endRow-=s-o+1):s>t.endRow&&(t.endRow=o-1),this._checkIsMergeCell(t)&&e.push(t)}return e},[]),u={unitId:t,subUnitId:n,ranges:c},d=TK(this._injector,u),f={unitId:t,subUnitId:n,ranges:l},p=$G(this._injector,f),m=[{id:EK.id,params:u}],h=[{id:eK.id,params:f}];return{preUndos:[{id:EK.id,params:p}],undos:[{id:eK.id,params:d}],preRedos:m,redos:h}}_handleInsertRangeMoveRightCommand(e,t,n){let r=MJ(this._univerInstanceService,t);if(!r)return this._handleNull();let i=NJ(r,n);if(!i)return this._handleNull();let a=e.range,o=i.getMaxColumns()-1,s=i.getMergeData(),c=[],l=[];s.forEach(e=>{let{startRow:t,endRow:n,startColumn:r,endColumn:i}=a;if(d_.intersects({startRow:t,startColumn:r,endRow:n,endColumn:o},e)&&(c.push(e),d_.contains({startRow:t,startColumn:r,endRow:n,endColumn:o},e))){let t=i-r+1;l.push({startRow:e.startRow,startColumn:e.startColumn+t,endRow:e.endRow,endColumn:e.endColumn+t})}});let u={unitId:t,subUnitId:n,ranges:c},d=TK(this._injector,u),f={unitId:t,subUnitId:n,ranges:l},p=$G(this._injector,f);return{preRedos:[{id:EK.id,params:u}],redos:[{id:eK.id,params:f}],preUndos:[{id:EK.id,params:p}],undos:[{id:eK.id,params:d}]}}_handleInsertRangeMoveDownCommand(e,t,n){let r=MJ(this._univerInstanceService,t);if(!r)return this._handleNull();let i=NJ(r,n);if(!i)return this._handleNull();let a=e.range,o=i.getMaxRows()-1,s=i.getMergeData(),c=[],l=[];s.forEach(e=>{let{startRow:t,startColumn:n,endColumn:r,endRow:i}=a;if(d_.intersects({startRow:t,startColumn:n,endRow:o,endColumn:r},e)&&(c.push(e),d_.contains({startRow:t,startColumn:n,endRow:o,endColumn:r},e))){let n=i-t+1;l.push({startRow:e.startRow+n,startColumn:e.startColumn,endRow:e.endRow+n,endColumn:e.endColumn})}});let u={unitId:t,subUnitId:n,ranges:c},d=TK(this._injector,u),f={unitId:t,subUnitId:n,ranges:l},p=$G(this._injector,f),m=[{id:EK.id,params:u}],h=[{id:eK.id,params:f}],g=[{id:EK.id,params:p}];return{redos:h,undos:[{id:eK.id,params:d}],preRedos:m,preUndos:g}}_handleDeleteRangeMoveUpCommand(e,t,n){let r=MJ(this._univerInstanceService,t);if(!r)return this._handleNull();let i=NJ(r,n);if(!i)return this._handleNull();let a=e.range,o=i.getMaxRows()-1,s=i.getMergeData(),c=[],l=[];s.forEach(e=>{let{startRow:t,startColumn:n,endColumn:r,endRow:i}=a;if(d_.intersects({startRow:t,startColumn:n,endRow:o,endColumn:r},e)&&(c.push(e),d_.contains({startRow:t,startColumn:n,endRow:o,endColumn:r},e))){let n=i-t+1,r=d_.moveVertical(e,-n);l.push(r)}});let u={unitId:t,subUnitId:n,ranges:c},d=TK(this._injector,u),f={unitId:t,subUnitId:n,ranges:l},p=$G(this._injector,f),m=[{id:EK.id,params:u}],h=[{id:eK.id,params:f}],g=[{id:EK.id,params:p}];return{redos:h,undos:[{id:eK.id,params:d}],preRedos:m,preUndos:g}}_handleDeleteRangeMoveLeftCommand(e,t,n){let r=MJ(this._univerInstanceService,t);if(!r)return this._handleNull();let i=NJ(r,n);if(!i)return this._handleNull();let a=e.range,o=i.getMaxColumns()-1,s=i.getMergeData(),c=[],l=[];s.forEach(e=>{let{startRow:t,endRow:n,startColumn:r,endColumn:i}=a;if(d_.intersects({startRow:t,startColumn:r,endRow:n,endColumn:o},e)&&(c.push(e),d_.contains({startRow:t,startColumn:r,endRow:n,endColumn:o},e))){let t=i-r+1;l.push({startRow:e.startRow,startColumn:e.startColumn-t,endRow:e.endRow,endColumn:e.endColumn-t})}});let u={unitId:t,subUnitId:n,ranges:c},d=TK(this._injector,u),f={unitId:t,subUnitId:n,ranges:l},p=$G(this._injector,f);return{preRedos:[{id:EK.id,params:u}],redos:[{id:eK.id,params:f}],undos:[{id:eK.id,params:d}],preUndos:[{id:EK.id,params:p}]}}_checkIsMergeCell(e){return e.startRow!==e.endRow||e.startColumn!==e.endColumn}_handleNull(){return{redos:[],undos:[]}}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(_ut.includes(e.id)){if(!e.params)return;let t=this._univerInstanceService.getUniverSheetInstance(e.params.unitId);if(!t)return;let n=t.getSheetBySheetId(e.params.subUnitId);if(!n)return;let{sourceRange:r,targetRange:i}=e.params,a=r.startColumn===i.startColumn&&r.endColumn===i.endColumn,o=a?r.endRow-r.startRow+1:r.endColumn-r.startColumn+1,s=a?r.startRow:r.startColumn,c=a?i.startRow:i.startColumn,l=n.getConfig().mergeData,u=[];l.forEach(e=>{let{startRow:t,endRow:n,startColumn:i,endColumn:l,rangeType:d}=e;d_.intersects(e,r)||(a?s<t&&c>n?(t-=o,n-=o):s>n&&c<=t&&(t+=o,n+=o):s<i&&c>l?(i-=o,l-=o):s>l&&c<=i&&(i+=o,l+=o)),(e.startRow!==e.endRow||e.startColumn!==e.endColumn)&&u.push({startRow:t,endRow:n,startColumn:i,endColumn:l,rangeType:d})}),n.setMergeData(u),this.disposableCollection.dispose();let{unitId:d,subUnitId:f}=e.params,p=e=>this.refRangeHandle(e,d,f);u.forEach(e=>{this.disposableCollection.add(this._refRangeService.registerRefRange(e,p,d,f))})}if(gut.includes(e.id)){let t=this._univerInstanceService.getUniverSheetInstance(e.params.unitId);if(!t)return;let n=t.getSheetBySheetId(e.params.subUnitId);if(!n)return;let r=n.getConfig().mergeData,i=e.params;if(!i)return;let{range:a}=i,o=e.id.includes(`row`),s=e.id.includes(`insert`),c=o?a.startRow:a.startColumn,l=o?a.endRow:a.endColumn,u=l-c+1,d=[];r.forEach(e=>{let{startRow:t,endRow:n,startColumn:r,endColumn:i,rangeType:a}=e;s?o?c<=t&&(t+=u,n+=u):c<=r&&(r+=u,i+=u):o?l<t&&(t-=u,n-=u):l<r&&(r-=u,i-=u),(e.startRow!==e.endRow||e.startColumn!==e.endColumn)&&d.push({startRow:t,endRow:n,startColumn:r,endColumn:i,rangeType:a})}),n.setMergeData(d),this.disposableCollection.dispose();let{unitId:f,subUnitId:p}=e.params,m=e=>this.refRangeHandle(e,f,p);d.forEach(e=>{this.disposableCollection.add(this._refRangeService.registerRefRange(e,m,f,p))})}}))}};jJ=aK([iK(0,j(R)),iK(1,j(kJ)),iK(2,j(B)),iK(3,j(We)),iK(4,j(lK)),iK(5,j(yq))],jJ);function MJ(e,t){return t?e.getUniverSheetInstance(t):e.getCurrentUnitOfType(M.UNIVER_SHEET)}function NJ(e,t){return t?e.getSheetBySheetId(t):e.getActiveSheet()}var yut=(e,t,n)=>{let r=e.get(yq).getCurrentSelections(),{value:i,selections:a,unitId:o,subUnitId:s}=t;if(r&&r.length>0){let e=r[r?.length-1].primary;if(e){let{actualColumn:t,actualRow:c}=e,{startRow:l,startColumn:u,endRow:d,endColumn:f}=a[a.length-1];if(i===_p.COLUMNS){let e=n.find(e=>e.startColumn===t&&e.endColumn===t&&c===e.startRow);e&&(f=e.endColumn,l=e.startRow,d=e.endRow)}else if(i===_p.ROWS){let e=n.find(e=>e.startRow===c&&e.endRow===c&&t===e.startColumn);e&&(d=e.endRow,u=e.startColumn,f=e.endColumn)}let p={startRow:l,startColumn:u,endRow:d,endColumn:f,actualRow:c,actualColumn:t,isMerged:!0,isMergedMainCell:l===c&&u===t},m={unitId:o,subUnitId:s,type:3,selections:r.map((e,t,n)=>({range:e.range,style:null,primary:t===n.length-1?p:null}))};return{id:Fq.id,params:m}}return null}return null},but=(e,t)=>{let n=e.get(yq).getCurrentSelections(),{unitId:r,subUnitId:i}=t;if(n&&n.length>0&&n[n?.length-1].primary){let e={unitId:r,subUnitId:i,type:3,selections:[...n]};return{id:Fq.id,params:e}}return null},PJ={type:L.COMMAND,id:`sheet.command.remove-worksheet-merge`,handler:(e,t)=>{let n=e.get(yq),r=e.get(R),i=e.get(vx),a=t?.ranges||n.getCurrentSelections()?.map(e=>e.range);if(!a?.length)return!1;let o=ZG(e.get(B),t);if(!o)return!1;let{subUnitId:s,unitId:c,worksheet:l}=o,u={unitId:c,subUnitId:s,ranges:a},d=l.getConfig().mergeData.filter(e=>a.some(t=>d_.intersects(t,e)));if(!d.length)return!1;let f=TK(e,u),p=n.getCurrentSelections(),m=F.deepClone(p),h=F.deepClone(p);if(p.length){let e=h[h.length-1],{startRow:t,startColumn:n}=e.range;e.primary={startRow:t,startColumn:n,endRow:t,endColumn:n,actualRow:t,actualColumn:n,isMerged:!1,isMergedMainCell:!1}}let g={unitId:c,subUnitId:s,cellValue:xut(l,d).getMatrix()},_=LK(e,g),v=[{id:EK.id,params:f},{id:RK.id,params:g},{id:Fq.id,params:{unitId:c,subUnitId:s,selections:h,type:3}}],y=[{id:eK.id,params:f},{id:RK.id,params:_},{id:Fq.id,params:{unitId:c,subUnitId:s,selections:m,type:3}}];return Km(v,r).result?(i.pushUndoRedo({unitID:c,undoMutations:y,redoMutations:v}),!0):!1}};function xut(e,t){let n=new Rh;return t.forEach(t=>{let{startRow:r,startColumn:i,endColumn:a,endRow:o}=t,s=e.getCellMatrix().getValue(r,i);if(s?.s)for(let e=r;e<=o;e++)for(let t=i;t<=a;t++)(e!==r||t!==i)&&n.setValue(e,t,{s:s.s})}),n}function Sut(e,t){return t.some(t=>Cut(e,t))}function Cut(e,t){let{startRow:n,startColumn:r,endColumn:i,endRow:a}=t,o=e.getMatrixWithMergedCells(n,r,a,i),s=!1;return o.forValue((t,i,a)=>{if(a&&(t!==n||i!==r)&&e.cellHasValue(a))return s=!0,!1}),s}function wut(e,t,n,r){let i=[],a=[],o=n.getSheetId();return r.forEach(r=>{let s={unitId:t,subUnitId:o,cellValue:Tut(n,r).getData()},c=LK(e,s);i.push({id:RK.id,params:c}),a.push({id:RK.id,params:s})}),{undos:i,redos:a}}function Tut(e,t){let{startRow:n,startColumn:r,endColumn:i,endRow:a}=t,o=e.getMatrixWithMergedCells(n,r,a,i,xh.Raw),s=new Rh,c=null;return o.forValue((t,i,a)=>{if(a&&t>=n&&i>=r){var o;!c&&e.cellHasValue(a)&&(a.v!==``||(((o=a.p)==null||(o=o.body)==null||(o=o.dataStream)==null?void 0:o.length)??0)>2)&&(c=a),s.setValue(t,i,a.s?{v:null,t:null,f:null,si:null,p:null,s:a.s}:null)}}),s.setValue(n,r,c),s}var FJ={type:L.COMMAND,id:`sheet.command.add-worksheet-merge`,handler:async(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let{worksheet:r}=n,{unitId:i,subUnitId:a,selections:o}=t,s=e.get(R),c=e.get(vx),l=AJ(o,t.value),u=Sut(r,l);if(u&&!t.defaultMerge){let t=e.get(qy),n=e.get(nx);if(!await t.confirm({id:`merge.confirm.add-worksheet-merge`,title:{title:`sheets.merge.confirm.warning`},children:{title:`sheets.merge.confirm.title`},cancelText:n.t(`sheets.merge.confirm.cancel`),confirmText:n.t(`sheets.merge.confirm.confirm`)}))return!1}let d=[],f=[],p={unitId:i,subUnitId:a,ranges:F.deepClone(l)},m={unitId:i,subUnitId:a,ranges:F.deepClone(l)},h=TK(e,p),g=$G(e,m);if(h.ranges.length>0&&d.push({id:EK.id,params:h}),d.push({id:eK.id,params:m}),f.push({id:EK.id,params:g}),h.ranges.length>0&&f.push({id:eK.id,params:h}),u){let t=wut(e,i,r,l);d.unshift(...t.redos),f.push(...t.undos)}let _=yut(e,t,l);_&&d.push(_);let v=but(e,t);v&&f.push(v);let y=e.get(lK).onCommandExecute({id:FJ.id,params:{unitId:i,subUnitId:a,ranges:l}});return d.push(...y.redos),f.push(...y.undos),Km(d,s).result?(c.pushUndoRedo({unitID:i,undoMutations:f,redoMutations:d}),!0):!1}},IJ={type:L.COMMAND,id:`sheet.command.add-worksheet-merge-all`,handler:async e=>{let t=BJ(`mergeAll`,e.get(yq).getCurrentSelections()?.map(e=>e.range));if(!t?.length)return!1;let n=ZG(e.get(B));if(!n)return!1;let{worksheet:r}=n,i=r.getUnitId(),a=r.getSheetId();return e.get(R).executeCommand(FJ.id,{selections:t,unitId:i,subUnitId:a})}},LJ={type:L.COMMAND,id:`sheet.command.add-worksheet-merge-vertical`,handler:async e=>{let t=BJ(`mergeVertical`,e.get(yq).getCurrentSelections()?.map(e=>e.range));if(!t?.length)return!1;let n=ZG(e.get(B));if(!n)return!1;let{worksheet:r}=n,i=r.getUnitId(),a=r.getSheetId();return e.get(R).executeCommand(FJ.id,{value:_p.COLUMNS,selections:t,unitId:i,subUnitId:a})}},RJ={type:L.COMMAND,id:`sheet.command.add-worksheet-merge-horizontal`,handler:async e=>{let t=BJ(`mergeHorizontal`,e.get(yq).getCurrentSelections()?.map(e=>e.range));if(!t?.length)return!1;let n=ZG(e.get(B));if(!n)return!1;let{workbook:r,worksheet:i}=n,a=r.getUnitId(),o=i.getSheetId();return e.get(R).executeCommand(FJ.id,{value:_p.ROWS,selections:t,unitId:a,subUnitId:o})}};function zJ(e,t,n,r,i={}){let a=ZG(e.get(B),{unitId:t,subUnitId:n});if(!a)return;let o=e.get(R),{defaultMerge:s=!0,isForceMerge:c=!1}=i,{worksheet:l}=a;if(l.getMergeData().some(e=>r.some(t=>d_.intersects(t,e)))){if(!c)throw Error(`The ranges to be merged overlap with the existing merged cells`);o.syncExecuteCommand(PJ.id,{unitId:t,subUnitId:n,ranges:r})}o.executeCommand(FJ.id,{unitId:t,subUnitId:n,selections:r,defaultMerge:s})}function BJ(e,t){return t?e===`mergeAll`?t.filter(e=>e.startRow!==e.endRow||e.startColumn!==e.endColumn):e===`mergeVertical`?t.filter(e=>e.startRow!==e.endRow):e===`mergeHorizontal`?t.filter(e=>e.startColumn!==e.endColumn):t:null}var VJ=class{constructor(){Z(this,`_model`,new Map),Z(this,`_ruleChange`,new ao),Z(this,`_ruleRefresh`,new ao),Z(this,`_resetOrder`,new ao),Z(this,`ruleChange$`,this._ruleChange.asObservable()),Z(this,`ruleRefresh$`,this._ruleRefresh.asObservable()),Z(this,`resetOrder$`,this._resetOrder.asObservable()),Z(this,`_worksheetRuleInitStateChange`,new so(!1)),Z(this,`worksheetRuleInitStateChange$`,this._worksheetRuleInitStateChange.asObservable())}changeRuleInitState(e){this._worksheetRuleInitStateChange.next(e)}getSheetRuleInitState(){return this._worksheetRuleInitStateChange.value}addRule(e,t){this._ensureSubUnitMap(e).set(t.subUnitId,t),this._ruleChange.next({unitId:e,rule:t,type:`add`,subUnitId:t.subUnitId})}deleteRule(e,t){var n;let r=(n=this._model)==null||(n=n.get(e))==null?void 0:n.get(t);if(r){var i;(i=this._model.get(e))==null||i.delete(t),this._ruleChange.next({unitId:e,rule:r,type:`delete`,subUnitId:t})}}setRule(e,t,n){let r=this.getRule(e,t);if(r){var i;(i=this._model)==null||(i=i.get(e))==null||i.set(t,n),this._ruleChange.next({unitId:e,oldRule:r,rule:n,type:`set`,subUnitId:t})}}getRule(e,t){var n;return(n=this._model)==null||(n=n.get(e))==null?void 0:n.get(t)}toObject(){let e={};return[...this._model.keys()].forEach(t=>{let n=this._model.get(t);n?.size&&(e[t]=[],[...n.keys()].forEach(r=>{let i=n.get(r);i&&e[t].push(i)}))}),e}fromObject(e){let t=new Map;Object.keys(e).forEach(n=>{let r=e[n];if(r?.length){let e=new Map;r.forEach(t=>{e.set(t.subUnitId,t)}),t.set(n,e)}}),this._model=t}deleteUnitModel(e){this._model.delete(e)}_ensureSubUnitMap(e){let t=this._model.get(e);return t||(t=new Map,this._model.set(e,t)),t}ruleRefresh(e){this._ruleRefresh.next(e)}resetOrder(){this._resetOrder.next(Math.random())}getTargetByPermissionId(e,t){let n=this._model.get(e);if(!n)return null;for(let[r,i]of n)if(i.permissionId===t)return[e,r]}},HJ={id:`sheet.mutation.add-worksheet-protection`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(VJ),{unitId:r,rule:i}=t;return n.addRule(r,i),!0}},UJ={id:`sheet.mutation.delete-worksheet-protection`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(VJ),{unitId:r,subUnitId:i}=t;return n.deleteRule(r,i),!0}},WJ={type:L.COMMAND,id:`sheet.command.add-worksheet-protection`,async handler(e,t){if(!t)return!1;let n=e.get(R),r=e.get(vx),{rule:i,unitId:a}=t,o=i.subUnitId;if(await n.executeCommand(HJ.id,{unitId:a,rule:i,subUnitId:i.subUnitId})){let e=[{id:HJ.id,params:{unitId:a,rule:i,subUnitId:i.subUnitId}}],t=[{id:UJ.id,params:{unitId:a,subUnitId:o}}];r.pushUndoRedo({unitID:a,redoMutations:e,undoMutations:t})}return!0}},Eut={type:L.COMMAND,id:`sheet.command.set-worksheet-range-theme-style`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),{unitId:i}=t,a=Xst(e,t);return n.syncExecuteCommand(mK.id,t)?(r.pushUndoRedo({unitID:i,undoMutations:[{id:hK.id,params:a}],redoMutations:[{id:mK.id,params:t}]}),!0):!1}},Dut={type:L.COMMAND,id:`sheet.command.append-row`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),{unitId:i,subUnitId:a,cellValue:o,insertRowNums:s,insertColumnNums:c,maxRows:l,maxColumns:u}=t,d={unitId:i,subUnitId:a,cellValue:o},f=LK(e,d),p=[{id:RK.id,params:d}],m=[{id:RK.id,params:f}];if(s){let t={unitId:i,subUnitId:a,range:{startRow:l,endRow:l,startColumn:0,endColumn:u-1}},n=gK(e,t);p.unshift({id:_K.id,params:t}),m.push({id:CK.id,params:n})}if(c){let t={unitId:i,subUnitId:a,range:{startRow:0,endRow:l-1,startColumn:u,endColumn:u-1+c}},n=vK(e,t);p.unshift({id:yK.id,params:t}),m.push({id:wK.id,params:n})}return Km(p,n).result?(r.pushUndoRedo({unitID:i,undoMutations:m,redoMutations:p}),!0):!1}},Out=[`ff`,`fs`,`tr`,`tb`],GJ={type:L.COMMAND,id:`sheet.command.set-style`,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let{unitId:r,subUnitId:i,worksheet:a}=n,{range:o,style:s}=t,c=e.get(R),l=e.get(vx),u=e.get(yq),d=o?[o]:u.getCurrentSelections()?.map(e=>e.range);if(!d?.length)return!1;let f=new Rh,p=ylt(a);if(F.isArray(s.value))for(let e=0;e<d.length;e++)p.forOperableEach(d[e],(e,t,n)=>{f.setValue(e,t,{s:{[s.type]:s.value[e-n.startRow][t-n.startColumn]}})});else for(let e=0;e<d.length;e++){let t={s:{[s.type]:s.value}};p.forOperableEach(d[e],(e,n)=>f.setValue(e,n,t))}let m={subUnitId:i,unitId:r,cellValue:f.getMatrix()},h=e.get(Sq).getSkeleton(r,i),g=LK(e,m),_=null;if(Out.includes(t?.style.type)){let{suitableRanges:e,remainingRanges:t}=wq(d,h);_={suitableRanges:e,remainingRanges:t,cellHeights:Cq(e,a)}}let v=c.syncExecuteCommand(RK.id,m),y=e.get(lK),b=[],x=[];if(_){let{suitableRanges:e,remainingRanges:t,cellHeights:n}=_,{undos:a,redos:o}=y.generateMutationsOfAutoHeight({unitId:r,subUnitId:i,ranges:e,autoHeightRanges:e,lazyAutoHeightRanges:t,cellHeights:n});b=a,x=o}let{undos:S,redos:C}=y.onCommandExecute({id:GJ.id,params:t}),w=Km([...C,...x],c);return v&&w.result?(l.pushUndoRedo({unitID:m.unitId,undoMutations:[{id:RK.id,params:g},...S,...b],redoMutations:[{id:RK.id,params:m},...C,...x]}),!0):!1}},KJ={type:L.COMMAND,id:`sheet.command.set-bold`,handler:e=>{let t=e.get(yq).getCurrentLastSelection();if(!t)return!1;let n=ZG(e.get(B));if(!n)return!1;let{worksheet:r}=n,{actualRow:i,actualColumn:a}=t.primary,o={style:{type:`bl`,value:r.getRange(i,a).getFontWeight()===jp.BOLD?Np.FALSE:Np.TRUE}};return e.get(R).syncExecuteCommand(GJ.id,o)}},qJ={type:L.COMMAND,id:`sheet.command.set-italic`,handler:e=>{let t=e.get(yq).getCurrentLastSelection();if(!t)return!1;let n=ZG(e.get(B));if(!n)return!1;let{worksheet:r}=n,i=!0;if(t.primary){let{startRow:e,startColumn:n}=t.primary;i=r.getRange(e,n).getFontStyle()===Ap.ITALIC}let a={style:{type:`it`,value:i?Np.FALSE:Np.TRUE}};return e.get(R).syncExecuteCommand(GJ.id,a)}},JJ={type:L.COMMAND,id:`sheet.command.set-underline`,handler:e=>{let t=e.get(yq).getCurrentLastSelection();if(!t)return!1;let n=ZG(e.get(B));if(!n)return!1;let{worksheet:r}=n,i=!0;t.primary&&(i=!!r.getRange(t.primary.startRow,t.primary.startColumn).getUnderline().s);let a={style:{type:`ul`,value:{s:i?Np.FALSE:Np.TRUE}}};return e.get(R).syncExecuteCommand(GJ.id,a)}},YJ={type:L.COMMAND,id:`sheet.command.set-stroke`,handler:e=>{let t=e.get(yq).getCurrentLastSelection();if(!t)return!1;let n=ZG(e.get(B));if(!n)return!1;let{worksheet:r}=n,i=!0;t.primary&&(i=!!r.getRange(t.primary.actualRow,t.primary.actualColumn).getStrikeThrough().s);let a={style:{type:`st`,value:{s:i?Np.FALSE:Np.TRUE}}};return e.get(R).syncExecuteCommand(GJ.id,a)}};L.COMMAND;var XJ={type:L.COMMAND,id:`sheet.command.set-font-family`,handler:(e,t)=>{if(!t)return!1;let n=e.get(R),r={style:{type:`ff`,value:t.value}};return n.syncExecuteCommand(GJ.id,r)}},ZJ={type:L.COMMAND,id:`sheet.command.set-font-size`,handler:(e,t)=>{if(!t)return!1;let n=e.get(R),r={style:{type:`fs`,value:t.value}};return n.syncExecuteCommand(GJ.id,r)}},QJ={type:L.COMMAND,id:`sheet.command.set-text-color`,handler:(e,t)=>{if(!t)return!1;let n=e.get(R),r={style:{type:`cl`,value:{rgb:t.value}}};return n.syncExecuteCommand(GJ.id,r)}},kut={type:L.COMMAND,id:`sheet.command.reset-text-color`,handler:e=>e.get(R).syncExecuteCommand(GJ.id,{style:{type:`cl`,value:{rgb:null}}})},$J={type:L.COMMAND,id:`sheet.command.set-background-color`,handler:(e,t)=>{if(!t||!t.value)return!1;let n=e.get(R),r={style:{type:`bg`,value:{rgb:t.value}}};return n.syncExecuteCommand(GJ.id,r)}},eY={type:L.COMMAND,id:`sheet.command.reset-background-color`,handler:e=>e.get(R).syncExecuteCommand(GJ.id,{style:{type:`bg`,value:{rgb:null}}})},tY={type:L.COMMAND,id:`sheet.command.set-vertical-text-align`,handler:(e,t)=>{if(!t)return!1;let n=e.get(R),r={unitId:t.unitId,subUnitId:t.subUnitId,range:t.range,style:{type:`vt`,value:t.value}};return n.syncExecuteCommand(GJ.id,r)}},nY={type:L.COMMAND,id:`sheet.command.set-horizontal-text-align`,handler:(e,t)=>{if(!t)return!1;let n=e.get(R),r={unitId:t.unitId,subUnitId:t.subUnitId,range:t.range,style:{type:`ht`,value:t.value}};return n.syncExecuteCommand(GJ.id,r)}},rY={type:L.COMMAND,id:`sheet.command.set-text-wrap`,handler:(e,t)=>{if(!t)return!1;let n=e.get(R),r={unitId:t.unitId,subUnitId:t.subUnitId,range:t.range,style:{type:`tb`,value:t.value}};return n.syncExecuteCommand(GJ.id,r)}},iY={type:L.COMMAND,id:`sheet.command.set-text-rotation`,handler:(e,t)=>{if(!t)return!1;let n=typeof t.value==`number`?{a:t.value}:{a:0,v:Np.TRUE},r=e.get(R),i={unitId:t.unitId,subUnitId:t.subUnitId,range:t.range,style:{type:`tr`,value:n}};return r.syncExecuteCommand(GJ.id,i)}},aY={零:0,一:1,二:2,三:3,四:4,五:5,六:6,七:7,八:8,九:9},oY=[`零`,`一`,`二`,`三`,`四`,`五`,`六`,`七`,`八`,`九`],sY=[``,`万`,`亿`,`万亿`,`亿亿`],Aut=[``,`十`,`百`,`千`],cY={十:{value:10,secUnit:!1},百:{value:100,secUnit:!1},千:{value:1e3,secUnit:!1},万:{value:1e4,secUnit:!0},亿:{value:1e8,secUnit:!0}};function lY(e){if(!e)return 0;let t=0,n=0,r=0,i=!1,a=e.split(``);for(let e=0;e<a.length;e++){let o=aY[a[e]];if(o!==void 0)r=o,e===a.length-1&&(n+=r);else{let o=cY[a[e]],s=o.value;i=o.secUnit,i?(n=(n+r)*s,t+=n,n=0):n+=r*s,r=0}}return t+n}function jut(e){let t=``,n=``,r=0,i=!0;for(;e>0;){let a=e%10;a===0?i||(i=!0,n=oY[a]+n):(i=!1,t=oY[a],t+=Aut[r],n=t+n),r++,e=Math.floor(e/10)}return n}function Mut(e){let t=0,n=``,r=``,i=!1;if(e===0)return oY[0];for(;e>0;){let a=e%1e4;i&&(r=oY[0]+r),n=jut(a),n+=a===0?sY[0]:sY[t],r=n+r,i=a<1e3&&a>0,e=Math.floor(e/1e4),t++}return r}function Nut(e){if(!e)return!1;let t=!0;if(e){if(e.length===1)t=e===`日`||e in aY;else{let n=e.split(``);for(let e=0;e<n.length;e++)if(!(n[e]in aY||n[e]in cY)){t=!1;break}}}return t}function Put(e){if(!e)return{isExtendNumber:!1};let t=[...e.matchAll(/\d+/g)];if(!t.length)return{isExtendNumber:!1};let n=t[t.length-1],r=n[0],i=n.index,a=e.substring(0,i),o=e.substring(i+r.length);return{isExtendNumber:!0,rawMatchTxt:r,matchNumber:Number(r),beforeTxt:a,afterTxt:o}}function Fut(e){let t;return t=e.length===1?e===`日`||lY(e)<7:!1,t}function Iut(e){let t;return t=e.length===2?e===`周一`||e===`周二`||e===`周三`||e===`周四`||e===`周五`||e===`周六`||e===`周日`:!1,t}function Lut(e){let t;return t=e.length===3?e===`星期一`||e===`星期二`||e===`星期三`||e===`星期四`||e===`星期五`||e===`星期六`||e===`星期日`:!1,t}function Rut(e,t){let n=0;for(let r=0;r<e.length&&e[r]<t;r++)n++;return n}function zut(e){if(e.length<3)return!0;let t=e[1]-e[0],n=!1;for(let r=2;r<e.length;r++){let i=e[r]-e[r-1];if(i!==t){if(n||i!==-t)return!1;t=i,n=!0}}return!0}function But(e,t,n){let r=[],i=Math.floor(t/e),a=t%e,o=0;if(i>0){for(let t=0;t<i;t++)for(let i=0;i<n.length;i++)r[n[i]+t*e]=o,o++;for(let t=0;t<n.length&&n[t]<a;t++)r[n[t]+e*i]=o,o++}else for(let e=0;e<n.length&&n[e]<a;e++)r[n[e]]=o,o++;return r}function Vut(e,t){let n=[];for(let r=1;r<=t;r++){let t=(r-1)%e.length,i=F.deepClone(e[t]);fY(i),n.push({v:null,s:null,p:null,f:null,si:null,t:null,...i})}return n}function Hut(e,t){let n=[];for(let r=1;r<=t;r++){let t={s:e[(r-1)%e.length]?.s};n.push(t)}return n}function Uut(e){let t=!0,n=e[1]/e[0];for(let r=1;r<e.length;r++)if(e[r]/e[r-1]!==n){t=!1;break}return t}function Wut(e){let t=[];for(let n=1;n<=e;n++)t.push(n);return t}function Gut(e,t,n){let r=[],i=[];for(let t=0;t<e.length;t++)i.push(Number(e[t]?.v));if(e.length>2&&Uut(i))for(let n=1;n<=t;n++){let t=(n-1)%e.length,i=F.deepClone(e[t]);fY(i);let a=Number(e[e.length-1]?.v)*(Number(e[1]?.v)/Number(e[0]?.v))**n;i&&(dY(i)&&(i.v=a),r.push(i))}else{let a=Wut(e.length);for(let o=1;o<=t;o++){let t=(o-1)%e.length,s=F.deepClone(e[t]);fY(s);let c=n===I.DOWN||n===I.RIGHT,l=Kut(e.length+o,i,a,c);s&&(dY(s)&&(s.v=l),r.push(s))}}return r}function Kut(e,t,n,r=!0){function i(e){let t=0;for(let n=0;n<e.length;n++)t+=e[n];return t/e.length}let a=i(n),o=i(t),s=0,c=0;for(let e=0;e<n.length;e++)s+=(n[e]-a)*(t[e]-o),c+=(n[e]-a)*(n[e]-a);let l;l=c===0?r?1:-1:s/c;let u=o-l*a;return Math.round((u+l*e)*1e5)/1e5}function qut(e,t,n){let r=[],i=e[e.length-1],a=Put(`${i?.v}`);if(!a.isExtendNumber)return Vut(e,t);let{matchNumber:o,rawMatchTxt:s,beforeTxt:c,afterTxt:l}=a,u=s.length;for(let i=1;i<=t;i++){let t=(i-1)%e.length,a=F.deepClone(e[t]);if(fY(a),!a||!a.v)continue;let s=Math.abs(o+n*i).toString();s.length<u&&(s=s.padStart(u,`0`));let d=`${c}${s}${l}`;a&&(a.v=d,r.push(a))}return r}function Jut(e,t){let n=[];for(let r=1;r<=t;r++){let t=(r-1)%e.length,i=F.deepClone(e[t]);fY(i),i&&(delete i.v,n.push(i))}return n}function Yut(e,t,n,r=0){let i=[[`日`,`一`,`二`,`三`,`四`,`五`,`六`],[`周日`,`周一`,`周二`,`周三`,`周四`,`周五`,`周六`],[`星期日`,`星期一`,`星期二`,`星期三`,`星期四`,`星期五`,`星期六`]];if(r>=i.length)return[];let a=i[r],o=[];for(let r=1;r<=t;r++){let t=(r-1)%e.length,i=F.deepClone(e[t]);fY(i);let s=0;if(e[e.length-1]?.v===a[0])s=7+n*r;else{let t=`${e[e.length-1]?.v}`;t&&(s=lY(t.substr(t.length-1,1))+n*r)}s<0&&(s=Math.ceil(Math.abs(s)/7)*7+s);let c=s%7;i&&(i.v=a[c],o.push(i))}return o}function Xut(e,t,n){let r=[];for(let i=1;i<=t;i++){let t=(i-1)%e.length,a=F.deepClone(e[t]);fY(a);let o=lY(`${e[e.length-1]?.v}`)+n*i,s;s=o<=0?`零`:Mut(o),a&&(a.v=s,r.push(a))}return r}var uY={enWeek1:[`Sun`,`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`],enWeek2:[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`],enMonth1:[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],enMonth2:[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],chnMonth1:[`一月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`十二月`],chnMonth2:[`正月`,`二月`,`三月`,`四月`,`五月`,`六月`,`七月`,`八月`,`九月`,`十月`,`十一月`,`腊月`],chHour1:[`子`,`丑`,`寅`,`卯`,`辰`,`巳`,`午`,`未`,`申`,`酉`,`戌`,`亥`],chHour2:[`子时`,`丑时`,`寅时`,`卯时`,`辰时`,`巳时`,`午时`,`未时`,`申时`,`酉时`,`戌时`,`亥时`],chYear1:[`甲`,`乙`,`丙`,`丁`,`戊`,`己`,`庚`,`辛`,`壬`,`癸`],chSeason1:[`春`,`夏`,`秋`,`冬`],chSeason2:[`春季`,`夏季`,`秋季`,`冬季`]};function Zut(e){let t=!1;return Object.keys(uY).forEach(n=>{uY[n].includes(e)&&(t=!0)}),t}function Qut(e){let t=``,n=[];return Object.keys(uY).forEach(r=>{uY[r].includes(e)&&(t=r,n.push(...uY[r]))}),{name:t,series:n}}function $ut(e,t,n,r){let i=r.length,a=[];for(let o=1;o<=t;o++){let t=(o-1)%e.length,s=F.deepClone(e[t]);fY(s);let c=`${e[e.length-1]?.v}`,l=r.indexOf(c)+n*o;l<0&&(l+=Math.abs(n)*i);let u=l%i;s&&(s.v=r[u],a.push(s))}return a}function edt(e,t){let n=[],r;if(t.startRow<e.startRow)r=I.UP;else if(t.endRow>e.endRow)r=I.DOWN;else if(t.startColumn<e.startColumn)r=I.LEFT;else if(t.endColumn>e.endColumn)r=I.RIGHT;else return[];if(r===I.DOWN||r===I.UP){let i=e.endRow-e.startRow+1,a=t.endRow-t.startRow+1,o=Math.floor(a/i),s=a%i,c={startRow:0,startColumn:0,endRow:e.endRow-e.startRow,endColumn:e.endColumn-e.startColumn};if(r===I.DOWN){for(let t=0;t<o;t++)n.push({repeatStartCell:{row:e.startRow+(t+1)*i,col:e.startColumn},relativeRange:c});s>0&&n.push({repeatStartCell:{row:e.startRow+(o+1)*i,col:e.startColumn},relativeRange:{startRow:0,startColumn:0,endRow:s-1,endColumn:e.endColumn-e.startColumn}})}else{for(let t=0;t<o;t++)n.push({repeatStartCell:{row:e.startRow-(t+1)*i,col:e.startColumn},relativeRange:c});s>0&&n.push({repeatStartCell:{row:e.startRow-(o+1)*i,col:e.startColumn},relativeRange:{startRow:i-s,endRow:i-1,startColumn:0,endColumn:e.endColumn-e.startColumn}})}}if(r===I.RIGHT||r===I.LEFT){let i=e.endColumn-e.startColumn+1,a=t.endColumn-t.startColumn+1,o=Math.floor(a/i),s=a%i,c={startRow:0,startColumn:0,endRow:e.endRow-e.startRow,endColumn:e.endColumn-e.startColumn};if(r===I.RIGHT){for(let t=0;t<o;t++)n.push({repeatStartCell:{row:e.startRow,col:e.startColumn+(t+1)*i},relativeRange:c});s>0&&n.push({repeatStartCell:{row:e.startRow,col:e.startColumn+(o+1)*i},relativeRange:{startRow:0,startColumn:0,endRow:e.endRow-e.startRow,endColumn:s-1}})}else{for(let t=0;t<o;t++)n.push({repeatStartCell:{row:e.startRow,col:e.startColumn-(t+1)*i},relativeRange:c});s>0&&n.push({repeatStartCell:{row:e.startRow,col:e.startColumn-(o+1)*i},relativeRange:{startRow:0,startColumn:i-s,endRow:e.endRow-e.startRow,endColumn:i-1}})}}return n}function dY(e){return!(Uh(e.f)||Wh(e.si)||e.t===Pp.BOOLEAN)}function fY(e){e&&`custom`in e&&delete e.custom}function tdt(e,t){return t?e.reverse():e}function ndt(e){let t=new Rh;return e.forEach(e=>{let{rows:n,cols:r}=e;n.forEach(e=>{r.forEach(n=>{t.setValue(e,n,{v:null,s:null,p:null,f:null,si:null,custom:null})})})}),t.clone()}var pY={chnNumChar:aY,chnNumChar2:oY,chnUnitSection:sY,chnUnitChar:Aut,chnNameValue:cY,chineseToNumber:lY,sectionToChinese:jut,numberToChinese:Mut,isChnNumber:Nut,matchExtendNumber:Put,isChnWeek1:Fut,isChnWeek2:Iut,isChnWeek3:Lut,getLenS:Rut,isEqualDiff:zut,getDataIndex:But,fillCopy:Vut,fillCopyStyles:Hut,isEqualRatio:Uut,getXArr:Wut,fillSeries:Gut,forecast:Kut,fillExtendNumber:qut,fillOnlyFormat:Jut,fillChnWeek:Yut,fillChnNumber:Xut,isLoopSeries:Zut,getLoopSeriesInfo:Qut,fillLoopSeries:$ut,getAutoFillRepeatRange:edt,needsUpdateCellValue:dY,removeCellCustom:fY,reverseIfNeed:tdt,generateNullCellValueRowCol:ndt},mY=function(e){return e.COPY=`COPY`,e.SERIES=`SERIES`,e.ONLY_FORMAT=`ONLY_FORMAT`,e.NO_FORMAT=`NO_FORMAT`,e}({}),rdt=function(e){return e.NUMBER=`number`,e.DATE=`date`,e.EXTEND_NUMBER=`extendNumber`,e.CHN_NUMBER=`chnNumber`,e.CHN_WEEK2=`chnWeek2`,e.CHN_WEEK3=`chnWeek3`,e.LOOP_SERIES=`loopSeries`,e.FORMULA=`formula`,e.OTHER=`other`,e}({}),idt=function(e){return e.APPEND=`APPEND`,e.DEFAULT=`DEFAULT`,e.ONLY=`ONLY`,e}({}),{chineseToNumber:hY,fillChnNumber:adt,fillChnWeek:gY,fillCopy:_Y,fillExtendNumber:odt,fillLoopSeries:sdt,fillSeries:vY,getLoopSeriesInfo:yY,isChnNumber:cdt,isChnWeek2:ldt,isChnWeek3:udt,isEqualDiff:bY,isLoopSeries:ddt,matchExtendNumber:xY,reverseIfNeed:SY}=pY,fdt={dateRule:{type:`date`,priority:1100,match:(e,t)=>{if(e?.f||e?.si)return!1;if((typeof e?.v==`number`||e?.t===Pp.NUMBER)&&e.s){if(typeof e.s==`string`){var n;let r=t.get(B).getCurrentUnitOfType(M.UNIVER_SHEET);if(!r)return!1;let i=r.getStyles().get(e.s),a=i==null||(n=i.n)==null?void 0:n.pattern;if(a)return ld(a).isDate}else if(e.s.n&&ld(e.s.n.pattern).isDate)return!0}return!1},isContinue:(e,t)=>e.type===`date`,applyFunctions:{SERIES:(e,t,n)=>{let{data:r}=e;return n===I.LEFT||n===I.UP?(r.reverse(),vY(r,t,n).reverse()):vY(r,t,n)}}},numberRule:{type:`number`,priority:1e3,match:e=>typeof e?.v==`number`||e?.t===Pp.NUMBER,isContinue:(e,t)=>e.type===`number`,applyFunctions:{SERIES:(e,t,n)=>{let{data:r}=e;return n===I.LEFT||n===I.UP?(r.reverse(),vY(r,t,n).reverse()):vY(r,t,n)}}},extendNumberRule:{type:`extendNumber`,priority:900,match:e=>xY(`${e?.v}`||``).isExtendNumber,isContinue:(e,t)=>{if(e.type===`extendNumber`){let n=xY(`${e.cellData?.v}`||``),r=xY(`${t?.v}`||``);if(n.isExtendNumber&&r.isExtendNumber){let{beforeTxt:e,afterTxt:t}=n,{beforeTxt:i,afterTxt:a}=r;if(e===i&&t===a)return!0}}return!1},applyFunctions:{SERIES:(e,t,n)=>{let{data:r}=e,i=n===I.UP||n===I.LEFT,a;if(r.length===1)return a=i?-1:1,SY(odt(r,t,a),i);let o=[];for(let e=0;e<r.length;e++){let t=xY(`${r[e]?.v}`);t.isExtendNumber&&o.push(t.matchNumber)}if(i&&(r.reverse(),o.reverse()),bY(o)){let e=r.length;return a=o[e-1]-o[e-2],SY(odt(r,t,a),i)}return _Y(r,t)}}},chnNumberRule:{type:`chnNumber`,priority:830,match:e=>!!cdt(`${e?.v}`||``),isContinue:(e,t)=>e.type===`chnNumber`,applyFunctions:{SERIES:(e,t,n)=>{let{data:r}=e,i=n===I.LEFT||n===I.UP;if(r.length===1){let e=`${r[0]?.v}`,n;return n=i?-1:1,e&&(e===`日`||hY(e)<7)?SY(gY(r,t,n),i):SY(adt(r,t,n),i)}let a=!1;for(let e=0;e<r.length;e++)if(r[e]?.v===`日`){a=!0;break}let o=[],s=0;for(let e=0;e<r.length;e++){let t=`${r[e]?.v}`;t===`日`?e===0?o.push(0):(s++,o.push(s*7)):a&&hY(t)>0&&hY(t)<7?o.push(hY(t)+s*7):o.push(hY(t))}if(i&&(r.reverse(),o.reverse()),bY(o)){if(a||o[o.length-1]<6&&o[0]>0||o[0]<6&&o[o.length-1]>0){let e=r.length;return SY(gY(r,t,o[e-1]-o[e-2]),i)}return SY(adt(r,t,o[1]-o[0]),i)}return _Y(r,t)}}},chnWeek2Rule:{type:`chnWeek2`,priority:820,match:e=>!!ldt(`${e?.v}`||``),isContinue:(e,t)=>e.type===`chnWeek2`,applyFunctions:{SERIES:(e,t,n)=>{let{data:r}=e,i=n===I.LEFT||n===I.UP;if(r.length===1){let e;return e=i?-1:1,SY(gY(r,t,e,1),i)}let a=[],o=0;for(let e=0;e<r.length;e++){let t=`${r[e]?.v}`,n=t?.substr(t.length-1,1);t===`周日`?e===0?a.push(0):(o++,a.push(o*7)):a.push(hY(n)+o*7)}if(i&&(r.reverse(),a.reverse()),bY(a)){let e=r.length;return SY(gY(r,t,a[e-1]-a[e-2],1),i)}return _Y(r,t)}}},chnWeek3Rule:{type:`chnWeek3`,priority:810,match:e=>udt(`${e?.v}`||``),isContinue:(e,t)=>e.type===`chnWeek3`,applyFunctions:{SERIES:(e,t,n)=>{let{data:r}=e,i=n===I.LEFT||n===I.UP;if(r.length===1){let e;return e=i?-1:1,SY(gY(r,t,e,2),i)}let a=[],o=0;for(let e=0;e<r.length;e++){let t=`${r[e]?.v}`;if(t){let n=t.substr(t.length-1,1);t===`星期日`?e===0?a.push(0):(o++,a.push(o*7)):a.push(hY(n)+o*7)}}if(i&&(r.reverse(),a.reverse()),bY(a)){let e=r.length;return SY(gY(r,t,a[e-1]-a[e-2],2),i)}return _Y(r,t)}}},loopSeriesRule:{type:`loopSeries`,priority:800,match:e=>ddt(`${e?.v}`||``),isContinue:(e,t)=>e.type===`loopSeries`&&yY(`${e.cellData?.v}`||``).name===yY(`${t?.v}`||``).name,applyFunctions:{SERIES:(e,t,n)=>{let{data:r}=e,i=n===I.LEFT||n===I.UP,{series:a}=yY(`${r[0]?.v}`||``);if(r.length===1){let e;return e=i?-1:1,SY(sdt(r,t,e,a),i)}let o=[],s=0;for(let e=0;e<r.length;e++){let t=`${r[e]?.v}`;t&&(t===a[0]?e===0?o.push(0):(s++,o.push(s*a.length)):o.push(a.indexOf(t)+s*7))}if(i&&(r.reverse(),o.reverse()),bY(o)){let e=r.length;return SY(sdt(r,t,o[e-1]-o[e-2],a),i)}return _Y(r,t)}}},otherRule:{type:`other`,priority:0,match:()=>!0,isContinue:(e,t)=>e.type===`other`}},{chnNumberRule:pdt,chnWeek2Rule:mdt,chnWeek3Rule:hdt,dateRule:gdt,extendNumberRule:_dt,loopSeriesRule:vdt,numberRule:ydt,otherRule:bdt}=fdt,CY=class extends P{constructor(e,t,n,r){super(),this._commandService=e,this._undoRedoService=t,this._univerInstanceService=n,this._injector=r,Z(this,`_rules`,[]),Z(this,`_hooks`,[]),Z(this,`_applyType$`,new so(`SERIES`)),Z(this,`_isFillingStyle`,!0),Z(this,`_prevUndos`,[]),Z(this,`_autoFillLocation$`,new so(null)),Z(this,`autoFillLocation$`,this._autoFillLocation$.asObservable()),Z(this,`_showMenu$`,new so(!1)),Z(this,`showMenu$`,this._showMenu$.asObservable()),Z(this,`_direction`,I.DOWN),Z(this,`applyType$`,this._applyType$.asObservable()),Z(this,`_menu$`,new so([{label:`sheets.autoFill.copy`,value:`COPY`,disable:!1},{label:`sheets.autoFill.series`,value:`SERIES`,disable:!1},{label:`sheets.autoFill.formatOnly`,value:`ONLY_FORMAT`,disable:!1},{label:`sheets.autoFill.noFormat`,value:`NO_FORMAT`,disable:!1}])),Z(this,`menu$`,this._menu$.asObservable()),this._init()}_init(){this._rules=[gdt,ydt,_dt,pdt,mdt,hdt,vdt,bdt].sort((e,t)=>t.priority-e.priority),this._isFillingStyle=!0}_getOneByPriority(e){return e.length<=0?[]:[e.reduce((e,t)=>(t.priority||0)>(e.priority||0)?t:e,e[0])]}_initPrevUndo(){this._prevUndos=[]}async triggerAutoFill(e,t,n,r,i){if(n.startColumn===r.startColumn&&n.startRow===r.startRow&&n.endColumn===r.endColumn&&n.endRow===r.endRow)return!1;if(r.endColumn<n.endColumn&&r.endColumn>n.startColumn)return this._commandService.executeCommand(EY.id,{clearRange:{startRow:r.startRow,endRow:r.endRow,startColumn:r.endColumn+1,endColumn:n.endColumn},selectionRange:r});if(r.endRow<n.endRow&&r.endRow>n.startRow)return this._commandService.executeCommand(EY.id,{clearRange:{startRow:r.endRow+1,endRow:n.endRow,startColumn:r.startColumn,endColumn:r.endColumn},selectionRange:r});let a={startRow:r.startRow,endRow:r.endRow,startColumn:r.startColumn,endColumn:r.endColumn},o=null;if(r.startRow<n.startRow)o=I.UP,a.endRow=n.startRow-1;else if(r.endRow>n.endRow)o=I.DOWN,a.startRow=n.endRow+1;else if(r.startColumn<n.startColumn)o=I.LEFT,a.endColumn=n.startColumn-1;else if(r.endColumn>n.endColumn)o=I.RIGHT,a.startColumn=n.endColumn+1;else return!1;this.direction=o;let s=this._injector.invoke(e=>uq(n,e)),c=this._injector.invoke(e=>uq(a,e));if(!s||!c)return!1;this.autoFillLocation={source:s,target:c,unitId:e,subUnitId:t};let l=[];if(this.getActiveHooks().forEach(n=>{var r;let i=n==null||(r=n.onBeforeFillData)==null?void 0:r.call(n,{source:s,target:c,unitId:e,subUnitId:t},o);i&&l.unshift(i)}),this._initPrevUndo(),i)return this.fillData(i);for(let e=0;e<l.length;e++){let t=this.menu.find(t=>t.value===l[e]);if(t&&!t.disable)return this.fillData(l[e])}let u=this.menu.find(e=>e.disable===!1)?.value;return u?this.fillData(u):!1}addHook(e){if(this._hooks.find(t=>t.id===e.id))throw Error(`Add hook failed, hook id '${e.id}' already exist!`);return e.priority===void 0&&(e.priority=0),e.type===void 0&&(e.type=`APPEND`),this._hooks.push(e),Wf(()=>{let t=this._hooks.findIndex(t=>t===e);t>-1&&this._hooks.splice(t,1)})}registerRule(e){if(this._rules.find(t=>t.type===e.type))throw Error(`Registry rule failed, type '${e.type}' already exist!`);let t=this._rules.findIndex(t=>t.priority<e.priority);this._rules.splice(t===-1?this._rules.length:t,0,e)}getRules(){return this._rules}getAllHooks(){return this._hooks}getActiveHooks(){let{source:e,target:t,unitId:n,subUnitId:r}=this.autoFillLocation||{};if(!e||!t||!n||!r)return[];let i=this._hooks.filter(i=>!i.disable?.call(i,{source:e,target:t,unitId:n,subUnitId:r},this._direction,this.applyType)),a=i.filter(e=>e.type===`ONLY`);if(a.length>0)return this._getOneByPriority(a);let o=this._getOneByPriority(i.filter(e=>e.type===`DEFAULT`)),s=i.filter(e=>e.type===`APPEND`)||[];return[...o,...s]}get applyType(){return this._applyType$.getValue()}set applyType(e){this._applyType$.next(e)}get menu(){return this._menu$.getValue()}get direction(){return this._direction}set direction(e){this._direction=e}isFillingStyle(){return this._isFillingStyle}setFillingStyle(e){this._isFillingStyle=e}get autoFillLocation(){return this._autoFillLocation$.getValue()}set autoFillLocation(e){this._autoFillLocation$.next(e)}setDisableApplyType(e,t){this._menu$.next(this._menu$.getValue().map(n=>n.value===e?{...n,disable:t}:n))}setShowMenu(e){this._showMenu$.next(e)}fillData(e){var t;this.applyType=e;let n=this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET),r=n?.getUnitId(),i=n==null||(t=n.getActiveSheet())==null?void 0:t.getSheetId(),{source:a,target:o,unitId:s=r,subUnitId:c=i}=this.autoFillLocation||{};if(!a||!o||!s||!c)return!1;let l=this._univerInstanceService.getUnit(s,M.UNIVER_SHEET);if(!l)return!1;let u=l.getSheetBySheetId(c);if(!u)return!1;let d=this.direction;this._prevUndos.length>0&&this._prevUndos.forEach(e=>{this._commandService.syncExecuteCommand(e.id,e.params)}),this._prevUndos=[];let f=d_.union(lq(a),lq(o)),p=this.getActiveHooks();s===r&&c===i&&this._commandService.syncExecuteCommand(Fq.id,{selections:[{primary:kq({startRow:a.rows[0],endRow:a.rows[a.rows.length-1],startColumn:a.cols[0],endColumn:a.cols[a.cols.length-1]},u),range:{...f,rangeType:z.NORMAL}}],unitId:s,subUnitId:c});let m=[],h=[];p.forEach(t=>{let{undos:n,redos:r}=t.onFillData?.call(t,{source:a,target:o,unitId:s,subUnitId:c},d,e)||{};n&&m.push(...n),r&&h.push(...r)});let g=h.every(e=>this._commandService.syncExecuteCommand(e.id,e.params)),{redos:_,undos:v}=this._getAutoHeightUndoRedos(h,l,u);return h.push(..._),m.push(...v),g&&(this._prevUndos=m,this._undoRedoService.pushUndoRedo({unitID:s,undoMutations:m,redoMutations:h})),p.forEach(t=>{var n;(n=t.onAfterFillData)==null||n.call(t,{source:a,target:o,unitId:s,subUnitId:c},d,e)}),this.setShowMenu(!0),!0}_getAutoHeightUndoRedos(e,t,n){if(this.applyType===`NO_FORMAT`)return{undos:[],redos:[]};let r=[],i=n.getConfig().defaultRowHeight,a=n.getRowManager();if(e.forEach(e=>{if(e.id===RK.id){let{cellValue:o}=e.params;new Rh(o).forValue((e,o,s)=>{let c=Object.keys(t.getStyles().get(s?.s)||{});if(s?.p||c.length&&Out.some(e=>c.includes(e))){let t=n.getCellHeight(e,o),s=a.getRow(e);(!s&&t!==i||s&&t!==a.getRowHeight(e))&&r.push({row:e,autoHeight:t})}})}}),r.length===0)return{undos:[],redos:[]};let o={unitId:t.getUnitId(),subUnitId:n.getSheetId(),rowsAutoHeightInfo:r},s=JK(o,n),c={id:ZK.id,params:o};return this._commandService.syncExecuteCommand(c.id,c.params)?{redos:[c],undos:[{id:ZK.id,params:s}]}:{undos:[],redos:[]}}};CY=aK([iK(0,R),iK(1,vx),iK(2,j(B)),iK(3,j(We))],CY);var wY=ce(`univer.auto-fill-service`),TY={type:L.COMMAND,id:`sheet.command.auto-fill`,handler:async(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let{unitId:r,subUnitId:i}=n,{sourceRange:a,targetRange:o,applyType:s}=t;return e.get(wY).triggerAutoFill(r,i,a,o,s)}};function xdt(e,t){let n=e.get(yq).getCurrentLastSelection();if(!n)return null;let r=ZG(e.get(B));if(!r)return null;let{unitId:i,subUnitId:a}=r,{startRow:o,endRow:s,startColumn:c,endColumn:l}=n.range;return t===`down`?o===s?o===0?null:{sourceRange:{startRow:o-1,endRow:o-1,startColumn:c,endColumn:l},targetRange:{startRow:o-1,endRow:s,startColumn:c,endColumn:l},unitId:i,subUnitId:a,applyType:`COPY`}:{sourceRange:{startRow:o,endRow:o,startColumn:c,endColumn:l},targetRange:{startRow:o,endRow:s,startColumn:c,endColumn:l},unitId:i,subUnitId:a,applyType:`COPY`}:c===l?c===0?null:{sourceRange:{startRow:o,endRow:s,startColumn:c-1,endColumn:c-1},targetRange:{startRow:o,endRow:s,startColumn:c-1,endColumn:l},unitId:i,subUnitId:a,applyType:`COPY`}:{sourceRange:{startRow:o,endRow:s,startColumn:c,endColumn:c},targetRange:{startRow:o,endRow:s,startColumn:c,endColumn:l},unitId:i,subUnitId:a,applyType:`COPY`}}async function Sdt(e,t){let n=xdt(e,t);if(!n)return!1;let r=await e.get(R).executeCommand(TY.id,n);return r&&e.get(wY).setShowMenu(!1),r}var Cdt={type:L.COMMAND,id:`sheet.command.copy-down`,handler:async e=>Sdt(e,`down`)},wdt={type:L.COMMAND,id:`sheet.command.copy-right`,handler:async e=>Sdt(e,`right`)},EY={id:`sheet.command.auto-clear-content`,type:L.COMMAND,handler:async(e,t)=>{let n=ZG(e.get(B));if(!n)return!1;let r=e.get(R),i=e.get(vx),a=e.get(lK),o=e.get(yq),{unitId:s,subUnitId:c}=n,{clearRange:l,selectionRange:u}=t,{startColumn:d,startRow:f}=u,p={subUnitId:c,unitId:s,cellValue:ult([l])},m=LK(e,p),h=[{id:RK.id,params:p},{id:Fq.id,params:{selections:[{primary:{startColumn:d,startRow:f,endColumn:d,endRow:f,actualRow:f,actualColumn:d,isMerged:!1,isMergedMainCell:!1},range:{...u}}],unitId:s,subUnitId:c}}],g=[{id:RK.id,params:m},{id:Fq.id,params:{selections:[o.getCurrentLastSelection()],unitId:s,subUnitId:c}}];if(Km(h,r).result){let e=a.afterCommandExecute({id:RK.id,params:p});return Km(e.redos,r),i.pushUndoRedo({unitID:s,undoMutations:[...g,...e.undos],redoMutations:[...h,...e.redos]}),!0}return!1}},DY={id:`sheet.command.clear-selection-content`,type:L.COMMAND,handler:(e,t)=>{let n=ZG(e.get(B),{unitId:t?.unitId,subUnitId:t?.subUnitId});if(!n)return!1;let r=e.get(yq),{unitId:i,subUnitId:a}=n,o=t?.ranges||r.getCurrentSelections()?.map(e=>e.range);if(!o?.length)return!1;let s=e.get(Sq).getSkeleton(i,a);if(!s)return!1;let c=e.get(R),l=e.get(vx),u=e.get(lK),d=[],f=[],p={subUnitId:a,unitId:i,cellValue:ult(dq(o,e,i,a))},m=LK(e,p);d.push({id:RK.id,params:p}),f.push({id:RK.id,params:m});let h=u.onCommandExecute({id:DY.id,params:t});d.push(...h.redos),f.unshift(...h.undos);let g=Km(d,c),{suitableRanges:_,remainingRanges:v}=wq(o,s),{undos:y,redos:b}=u.generateMutationsOfAutoHeight({unitId:i,subUnitId:a,ranges:_,autoHeightRanges:_,lazyAutoHeightRanges:v}),x=Km(b,c);return g.result&&x.result?(d.push(...b),f.push(...y),l.pushUndoRedo({unitID:i,undoMutations:f,redoMutations:d}),!0):!1}},OY=`sheets.config`,kY={largeSheetCellCountThreshold:6e3,batchSize:3e3},Tdt={},AY=class extends P{constructor(e,t){super(),this._commandService=e,this._univerInstanceService=t,Z(this,`_tasks`,new Map),Z(this,`_idleCallbackId`,null),Z(this,`_beforeUnloadHandler`,null),this._setupBeforeUnloadListener(),this.disposeWithMe(()=>{this._cancelAllTasks(),this._removeBeforeUnloadListener()})}hasPendingTasks(){return this._tasks.size>0}getPendingMutationsCount(){let e=0;for(let t of this._tasks.values())e+=t.mutations.length-t.currentIndex;return e}scheduleMutations(e,t,n){if(n.length===0)return;let r=`${e}_${t}`;this._cancelTask(r),this._tasks.set(r,{unitId:e,subUnitId:t,mutations:n,currentIndex:0}),this._scheduleNextIdle()}cancelScheduledMutations(e,t){let n=`${e}_${t}`;this._cancelTask(n)}_cancelTask(e){this._tasks.delete(e),this._tasks.size===0&&this._idleCallbackId!==null&&(typeof cancelIdleCallback<`u`&&cancelIdleCallback(this._idleCallbackId),this._idleCallbackId=null)}_cancelAllTasks(){this._tasks.clear(),this._idleCallbackId!==null&&(typeof cancelIdleCallback<`u`&&cancelIdleCallback(this._idleCallbackId),this._idleCallbackId=null)}_scheduleNextIdle(){this._idleCallbackId===null&&(this._idleCallbackId=typeof requestIdleCallback<`u`?requestIdleCallback(e=>this._processIdleTasks(e),{timeout:6e4}):setTimeout(()=>{this._processIdleTasks({didTimeout:!1,timeRemaining:()=>16})},16))}_processIdleTasks(e){this._idleCallbackId=null;for(let[t,n]of this._tasks){if(!this._isSheetExist(n.unitId,n.subUnitId)){this._tasks.delete(t);continue}for(n.currentIndex;n.currentIndex<n.mutations.length;){if(e.timeRemaining()<=0&&!e.didTimeout){this._scheduleNextIdle();return}let t=n.mutations[n.currentIndex];this._commandService.syncExecuteCommand(t.id,t.params,{onlyLocal:!0}),n.currentIndex++}this._tasks.delete(t)}this._tasks.size>0&&this._scheduleNextIdle()}_isSheetExist(e,t){let n=this._univerInstanceService.getUnit(e,M.UNIVER_SHEET);return n?n.getSheetBySheetId(t)!==null:!1}_setupBeforeUnloadListener(){typeof window>`u`||(this._beforeUnloadHandler=e=>{if(this.hasPendingTasks())return e.preventDefault(),e.returnValue=``,``},window.addEventListener(`beforeunload`,this._beforeUnloadHandler))}_removeBeforeUnloadListener(){typeof window>`u`||!this._beforeUnloadHandler||(window.removeEventListener(`beforeunload`,this._beforeUnloadHandler),this._beforeUnloadHandler=null)}};AY=aK([iK(0,R),iK(1,B)],AY);var Edt={id:`sheet.mutation.copy-worksheet-end`,type:L.MUTATION,handler:()=>!0},Ddt=(e,t)=>({subUnitId:t.sheet.id,unitId:t.unitId,subUnitName:t.sheet.name}),jY={id:`sheet.mutation.insert-sheet`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B),{sheet:r,index:i,unitId:a,styles:o}=t,s=n.getUniverSheetInstance(a);return s?(o&&s.addStyles(o),s.addWorksheet(r.id,i,Fb(r))):!1}};function Odt(e){let t=0;for(let n of Object.keys(e)){let r=e[Number(n)];r&&(t+=Object.keys(r).length)}return t}function kdt(e,t,n,r){let i=[],a={},o=0;for(let e in n){let t=Number(e),s=n[t];if(!s)continue;let c=Object.keys(s).length;o>0&&o+c>r&&(i.push(a),a={},o=0),a[t]=s,o+=c,o>=r&&(i.push(a),a={},o=0)}return o>0&&i.push(a),{firstChunkCellData:i.length>0?i[0]:{},remainingMutations:i.slice(1).map(n=>({id:RK.id,params:{unitId:e,subUnitId:t,cellValue:n,__splitChunk__:!0}}))}}var Adt=`sheet.command.copy-sheet`;function jdt(e,t,n,r,i,a,o){let s=e.get(Nm).getConfig(OY),c={...kY,...s?.largeSheetOperation},l=Fb(n.getConfig());l.name=Mdt(t,a,l.name);let u=ip();l.id=u;let d=t.getSheetIndex(n),{cellData:f}=l,p=Odt(f)>=c.largeSheetCellCountThreshold,m,h=[];if(p){let{firstChunkCellData:e,remainingMutations:t}=kdt(r,u,f,c.batchSize),n={...l,cellData:e};m={index:d+1,sheet:n,unitId:r},h=t}else m={index:d+1,sheet:l,unitId:r};let g=Ddt(e,m),_=o.onCommandExecute({id:Adt,params:{unitId:r,subUnitId:i,targetSubUnitId:l.id}});return{redos:[..._.preRedos??[],{id:jY.id,params:m},..._.redos],undos:[..._.preUndos??[],{id:aJ.id,params:g},..._.undos],unitId:r,newSheetId:u,isSplit:p,scheduledMutations:h}}var MY={type:L.COMMAND,id:Adt,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(B),a=e.get(lK),o=e.get(nx),s=e.get(AY),c=ZG(i,t);if(!c)return!1;let{workbook:l,worksheet:u,unitId:d,subUnitId:f}=c,{redos:p,undos:m,newSheetId:h,isSplit:g,scheduledMutations:_}=jdt(e,l,u,d,f,o,a);if(Km(p,n).result){if(g){if(r.pushUndoRedo({unitID:d,undoMutations:m,redoMutations:[]}),_.length>0){for(let e of _)n.syncExecuteCommand(e.id,e.params,{syncOnly:!0});n.syncExecuteCommand(Edt.id,{unitId:d,subUnitId:h},{syncOnly:!0}),s.scheduleMutations(d,h,_)}}else r.pushUndoRedo({unitID:d,undoMutations:m,redoMutations:p});return!0}return!1}};function Mdt(e,t,n){let r=`${n} ${t.t(`sheets.tabs.sheetCopy`,``)}`,i=2;for(;e.checkSheetName(r);)r=`${n} ${t.t(`sheets.tabs.sheetCopy`,`${i}`)}`,i++;return r}var Ndt={type:L.COMMAND,id:`sheet.command.delete-range-protection`,async handler(e,t){if(!t)return!1;let n=e.get(R),r=e.get(vx),{unitId:i,subUnitId:a,rule:o}=t,s={unitId:i,subUnitId:a,ruleIds:[o.id]};return await n.executeCommand(gq.id,s)&&r.pushUndoRedo({unitID:i,redoMutations:[{id:gq.id,params:s}],undoMutations:[{id:_q.id,params:{unitId:i,subUnitId:a,rules:[o]}}]}),!0}},NY={type:L.COMMAND,id:`sheet.command.delete-worksheet-protection`,handler(e,t){if(!t)return!1;let n=e.get(R),r=e.get(vx),{rule:i,unitId:a,subUnitId:o}=t;n.executeCommand(UJ.id,{unitId:a,subUnitId:o});let s=[{id:UJ.id,params:{unitId:a,subUnitId:o}}],c=[{id:HJ.id,params:{unitId:a,rule:i,subUnitId:o}}];return r.pushUndoRedo({unitID:a,redoMutations:s,undoMutations:c}),!0}},Pdt={type:L.COMMAND,id:`sheet.command.remove-worksheet-range-theme-style`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),{unitId:i}=t,a=Zst(e,t);return n.syncExecuteCommand(hK.id,t)?(r.pushUndoRedo({unitID:i,undoMutations:[{id:mK.id,params:a}],redoMutations:[{id:hK.id,params:t}]}),!0):!1}},PY={id:`sheet.command.insert-defined-name`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(R),r=e.get(vx);if(!t)return!1;let i={...t};return n.syncExecuteCommand(iB.id,i)?(r.pushUndoRedo({unitID:t.unitId,undoMutations:[{id:aB.id,params:i}],redoMutations:[{id:iB.id,params:i}]}),!0):!1}},FY={id:`sheet.command.insert-sheet`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(B),a=e.get(nx),o=Ost(i,{unitId:t?.unitId});if(!o)return!1;let{unitId:s,workbook:c}=o,l=c.getSheets().length,u=t?.sheet,d=u?.id,f=u?.name,p=Bb(u||{});t?(l=t.index??l,p.id=d||ip(),p.name=f?c.uniqueSheetName(f):c.generateNewSheetName(`${a.t(`sheets.tabs.sheet`)}`)):(p.id=ip(),p.name=c.generateNewSheetName(`${a.t(`sheets.tabs.sheet`)}`));let m={index:l,sheet:p,unitId:s},h=Ddt(e,m);return n.syncExecuteCommand(jY.id,m)?(r.pushUndoRedo({unitID:s,undoMutations:[{id:aJ.id,params:h}],redoMutations:[{id:jY.id,params:m}]}),!0):!1}},IY={id:`sheet.command.refill`,type:L.COMMAND,handler:async(e,t)=>e.get(wY).fillData(t.type)},LY={id:`sheet.mutation.register-worksheet-range-theme-style`,type:L.MUTATION,handler:(e,t)=>{if(!ZG(e.get(B),t))return!1;let n=e.get(pK),{unitId:r,rangeThemeStyleJson:i,themeName:a}=t,o=new fK(a,i);return n.registerRangeThemeStyle(r,o),!0}},RY={id:`sheet.mutation.unregister-worksheet-range-theme-style`,type:L.MUTATION,handler:(e,t)=>{if(!ZG(e.get(B),t))return!1;let n=e.get(pK),{unitId:r,themeName:i}=t;return n.unregisterRangeThemeStyle(r,i),!0}},Fdt={id:`sheet.command.register-worksheet-range-theme-style`,type:L.COMMAND,handler:(e,t)=>{if(!t)return!1;let{unitId:n,rangeThemeStyle:r}=t,i=e.get(B),a=e.get(R),o=e.get(vx);if(!ZG(i,t))return!1;let s={unitId:n,themeName:r.getName(),rangeThemeStyleJson:r.toJson()},c={unitId:n,themeName:r.getName()};return a.syncExecuteCommand(LY.id,s)&&o.pushUndoRedo({unitID:n,undoMutations:[{id:RY.id,params:c}],redoMutations:[{id:LY.id,params:s}]}),!0}},zY={id:`sheet.command.remove-defined-name`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(lK);if(!t)return!1;let a={...t},o=i.onCommandExecute({id:zY.id,params:t}),s=[...o.preRedos??[],{id:aB.id,params:a},...o.redos],c=[...o.preUndos??[],{id:iB.id,params:a},...o.undos];return Km(s,n).result?(r.pushUndoRedo({unitID:t.unitId,undoMutations:c.filter(Boolean),redoMutations:s.filter(Boolean)}),!0):!1}},BY={id:`sheet.command.remove-sheet`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(B),a=e.get(lK),o=e.get(Nm),s=ZG(i,t);if(!s)return!1;let{unitId:c,subUnitId:l,workbook:u,worksheet:d}=s;if(u.getSheets().length<=1)return!1;let f=o.getConfig(OY),p={...kY,...f?.largeSheetOperation},m=glt(d.getCellMatrix())>=p.largeSheetCellCountThreshold,h={subUnitId:l,unitId:c,subUnitName:d.getName()},g=m?null:Llt(e,h),_=a.onCommandExecute({id:BY.id,params:{unitId:c,subUnitId:l}}),v=[..._.preRedos??[],{id:aJ.id,params:h},..._.redos],y=m?[]:[..._.preUndos??[],{id:jY.id,params:g},..._.undos];return Km(v,n).result?(m?r.clearUndoRedo(c):r.pushUndoRedo({unitID:c,undoMutations:y,redoMutations:v}),!0):!1}},VY=class{constructor(){Z(this,`_borderInfo`,{type:dp.ALL,color:`#000000`,style:up.THIN,activeBorderType:!1}),Z(this,`_borderInfo$`,new so(this._borderInfo)),Z(this,`borderInfo$`,this._borderInfo$.asObservable())}dispose(){this._borderInfo$.complete()}setType(e){this._borderInfo.type=e,this.setActiveBorderType(!0),this._refresh()}setColor(e){this._borderInfo.color=e,this._refresh()}setStyle(e){this._borderInfo.style=e,this._refresh()}setActiveBorderType(e){this._borderInfo.activeBorderType=e}getBorderInfo(){return this._borderInfo}_refresh(){this._borderInfo$.next(this._borderInfo)}};function HY(e,t){let{startRow:n,startColumn:r,endRow:i,endColumn:a}=e;for(let e=n;e<=i;e++)for(let n=r;n<=a;n++)t(e,n)}var UY=(e,t,n,r)=>{let{mr:i,worksheet:a}=e;t.startRow<0||t.startColumn<0||HY(t,(e,t)=>{let o=a.getMergedCell(e,t),s=n;if(o&&(n.bc_tr||n.ml_tr||n.bl_tr||n.tl_mr||n.tl_bc||n.tl_br)){if(r){let e=F.deepClone(i.getValue(o.startRow,o.startColumn)?.s);s=e?.bd?Object.assign(e.bd,n):n}i.setValue(o.startRow,o.startColumn,{s:{bd:s}})}else{if(r){let r=F.deepClone(i.getValue(e,t)?.s);s=r?.bd?Object.assign(r.bd,n):n}i.setValue(e,t,{s:{bd:s}})}})},Idt=e=>({topRangeOut:{startRow:e.startRow-1,startColumn:e.startColumn,endRow:e.startRow-1,endColumn:e.endColumn},leftRangeOut:{startRow:e.startRow,startColumn:e.startColumn-1,endRow:e.endRow,endColumn:e.startColumn-1},bottomRangeOut:{startRow:e.endRow+1,startColumn:e.startColumn,endRow:e.endRow+1,endColumn:e.endColumn},rightRangeOut:{startRow:e.startRow,startColumn:e.endColumn+1,endRow:e.endRow,endColumn:e.endColumn+1},topRange:{startRow:e.startRow,startColumn:e.startColumn,endRow:e.startRow,endColumn:e.endColumn},leftRange:{startRow:e.startRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.startColumn},bottomRange:{startRow:e.endRow,startColumn:e.startColumn,endRow:e.endRow,endColumn:e.endColumn},rightRange:{startRow:e.startRow,startColumn:e.endColumn,endRow:e.endRow,endColumn:e.endColumn}});function Ldt(e,t,n){let{style:r,color:i,type:a}=e.getBorderInfo(),o=a===dp.TOP||a===dp.ALL||a===dp.OUTSIDE,s=a===dp.LEFT||a===dp.ALL||a===dp.OUTSIDE,c=a===dp.BOTTOM||a===dp.ALL||a===dp.OUTSIDE,l=a===dp.RIGHT||a===dp.ALL||a===dp.OUTSIDE,u=a===dp.VERTICAL||a===dp.ALL||a===dp.INSIDE,d=a===dp.HORIZONTAL||a===dp.ALL||a===dp.INSIDE,f=a.indexOf(`tlbr`)>-1,p=a.indexOf(`tlbc`)>-1,m=a.indexOf(`tlmr`)>-1,h=a.indexOf(`bltr`)>-1,g=a.indexOf(`mltr`)>-1,_=a.indexOf(`bctr`)>-1,v=n[0],{topRangeOut:y,leftRangeOut:b,bottomRangeOut:x,rightRangeOut:S,topRange:C,leftRange:w,bottomRange:T,rightRange:E}=Idt(v),D=new Rh,{worksheet:O,unitId:k,subUnitId:A}=t;return{worksheet:O,unitId:k,subUnitId:A,style:r,color:i,type:a,top:o,left:s,right:l,bottom:c,vertical:u,horizontal:d,tl_br:f,tl_bc:p,tl_mr:m,bl_tr:h,ml_tr:g,bc_tr:_,topRangeOut:y,leftRangeOut:b,bottomRangeOut:x,rightRangeOut:S,topRange:C,leftRange:w,bottomRange:T,rightRange:E,range:v,mr:D,borderStyle:{s:r,cl:{rgb:i}}}}var Rdt=e=>{let{range:t,mr:n,borderStyle:r,vertical:i,horizontal:a,worksheet:o}=e;i&&HY(t,(e,i)=>{let a=o.getMergedCell(e,i);if(a){let o=n.getValue(a.startRow,a.startColumn)?.s;a.startColumn!==t.startColumn&&n.setValue(e,i,{s:{bd:o?.bd?Object.assign(o.bd,{l:F.deepClone(r)}):{l:F.deepClone(r)}}})}else{if(i!==t.endColumn){let t=n.getValue(e,i)?.s;n.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{r:F.deepClone(r)}):{r:F.deepClone(r)}}})}if(i!==t.startColumn){let t=n.getValue(e,i)?.s;n.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{l:F.deepClone(r)}):{l:F.deepClone(r)}}})}}}),a&&HY(t,(e,i)=>{let a=o.getMergedCell(e,i);if(a){let o=n.getValue(a.startRow,a.startColumn)?.s;a.startRow!==t.startRow&&n.setValue(e,i,{s:{bd:o?.bd?Object.assign(o.bd,{t:F.deepClone(r)}):{t:F.deepClone(r)}}})}else{if(e!==t.endRow){let t=n.getValue(e,i)?.s;n.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{b:F.deepClone(r)}):{b:F.deepClone(r)}}})}if(e!==t.startRow){let t=n.getValue(e,i)?.s;n.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{t:F.deepClone(r)}):{t:F.deepClone(r)}}})}}})};function zdt(e){let{borderStyle:t,tl_br:n,tl_bc:r,tl_mr:i,bl_tr:a,ml_tr:o,bc_tr:s}=e,c=(t,n,r)=>{UY(e,t,n,r)};n&&c(e.range,{tl_br:F.deepClone(t)},!0),r&&c(e.range,{tl_bc:F.deepClone(t)},!0),i&&c(e.range,{tl_mr:F.deepClone(t)},!0),a&&c(e.range,{bl_tr:F.deepClone(t)},!0),o&&c(e.range,{ml_tr:F.deepClone(t)},!0),s&&c(e.range,{bc_tr:F.deepClone(t)},!0)}var Bdt=e=>{let{top:t,left:n,right:r,bottom:i,borderStyle:a,bottomRange:o,topRange:s,leftRange:c,rightRange:l,bottomRangeOut:u,topRangeOut:d,leftRangeOut:f,rightRangeOut:p}=e,m=(t,n,r)=>{UY(e,t,n,r)};t&&(m(d,{b:null}),m(s,{t:F.deepClone(a)},!0)),i&&(m(u,{t:null}),m(o,{b:F.deepClone(a)},!0)),n&&(m(f,{r:null}),m(c,{l:F.deepClone(a)},!0)),r&&(m(p,{l:null}),m(l,{r:F.deepClone(a)},!0))},Vdt=e=>{let{range:t,worksheet:n,mr:r,top:i,bottom:a,left:o,right:s,vertical:c,horizontal:l,tl_br:u,tl_bc:d,tl_mr:f,bl_tr:p,ml_tr:m,bc_tr:h,topRange:g,bottomRange:_,leftRange:v,rightRange:y,topRangeOut:b,bottomRangeOut:x,leftRangeOut:S,rightRangeOut:C}=e,w=(t,n,r)=>{UY(e,t,n,r)};!i&&!a&&!o&&!s&&!c&&!l&&!u&&!d&&!f&&!p&&!m&&!h&&(HY(t,(e,i)=>{let a=n.getMergedCell(e,i);if(a){if(a.endColumn!==t.endColumn){let t=r.getValue(a.startRow,a.startColumn)?.s;r.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{r:null}):{r:null}}})}if(a.startColumn!==t.startColumn){let t=r.getValue(a.startRow,a.startColumn)?.s;r.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{l:null}):{l:null}}})}if(a.endRow!==t.endRow){let t=r.getValue(a.startRow,a.startColumn)?.s;r.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{b:null}):{b:null}}})}if(a.startRow!==t.startRow){let t=r.getValue(a.startRow,a.startColumn)?.s;r.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{t:null}):{t:null}}})}}else{if(i!==t.endColumn){let t=r.getValue(e,i)?.s;r.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{r:null}):{r:null}}})}if(i!==t.startColumn){let t=r.getValue(e,i)?.s;r.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{l:null}):{l:null}}})}if(e!==t.endRow){let t=r.getValue(e,i)?.s;r.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{b:null}):{b:null}}})}if(e!==t.startRow){let t=r.getValue(e,i)?.s;r.setValue(e,i,{s:{bd:t?.bd?Object.assign(t.bd,{t:null}):{t:null}}})}}}),w(b,{b:null}),w(g,{t:null},!0),w(x,{t:null}),w(_,{b:null},!0),w(S,{r:null}),w(v,{l:null},!0),w(C,{l:null}),w(y,{r:null},!0),w(t,{tl_br:null},!0),w(t,{tl_bc:null},!0),w(t,{tl_mr:null},!0),w(t,{bl_tr:null},!0),w(t,{ml_tr:null},!0),w(t,{bc_tr:null},!0))},WY={id:`sheet.command.set-border`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(B),a=e.get(yq),o=e.get(VY),s=ZG(i,t);if(!s)return!1;let c=t?.ranges||a.getCurrentSelections()?.map(e=>e.range);if(!c?.length)return!1;let{activeBorderType:l}=o.getBorderInfo();if(!l)return!1;let u=Ldt(o,s,c);Rdt(u),Bdt(u),zdt(u),Vdt(u);let{unitId:d,subUnitId:f,mr:p}=u,m={unitId:d,subUnitId:f,cellValue:p.getData()},h=LK(e,m);return n.syncExecuteCommand(RK.id,m)?(r.pushUndoRedo({unitID:d,undoMutations:[{id:RK.id,params:h}],redoMutations:[{id:RK.id,params:m}]}),!0):!1}},Hdt={id:`sheet.command.set-border-position`,type:L.COMMAND,handler:(e,t)=>{if(!t.value)return!1;let n=e.get(R);return e.get(VY).setType(t.value),n.syncExecuteCommand(WY.id)}},Udt={id:`sheet.command.set-border-style`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(R);return e.get(VY).setStyle(t.value),n.syncExecuteCommand(WY.id)}},Wdt={id:`sheet.command.set-border-color`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(R);return e.get(VY).setColor(t.value),n.syncExecuteCommand(WY.id)}},GY={id:`sheet.command.set-border-basic`,type:L.COMMAND,handler:(e,t)=>{let{unitId:n,subUnitId:r,value:i,ranges:a}=t,{type:o,color:s,style:c}=i,l=e.get(R),u=e.get(VY);return u.setType(o),s&&u.setColor(s),u.setStyle(c),l.syncExecuteCommand(WY.id,{unitId:n,subUnitId:r,ranges:a})}},KY={type:L.COMMAND,id:`sheet.command.set-col-data`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=ZG(e.get(B),t);if(!i)return!1;let{columnData:a}=t,{unitId:o,subUnitId:s,worksheet:c}=i,l={subUnitId:s,unitId:o,columnData:a},u=act(l,c);return n.syncExecuteCommand(OK.id,l)?(r.pushUndoRedo({unitID:o,undoMutations:[{id:OK.id,params:u}],redoMutations:[{id:OK.id,params:l}]}),!0):!1}},qY={type:L.COMMAND,id:`sheet.command.set-col-visible-on-cols`,handler:(e,t)=>{let{unitId:n,subUnitId:r,ranges:i}=t,a=e.get(lK),o=e.get(R),s=ZG(e.get(B),{unitId:n,subUnitId:r});if(!s)return!1;let{worksheet:c}=s,l={unitId:n,subUnitId:r,ranges:i},u={unitId:n,subUnitId:r,reveal:!0,selections:i.map(e=>({range:e,primary:kq(e,c),style:null}))},d=sct(e,l),f={unitId:n,subUnitId:r,selections:Kdt(i).map(e=>({range:e,primary:kq(e,c),style:null}))},p=Km([{id:AK.id,params:l},{id:Fq.id,params:u}],o),m=a.onCommandExecute({id:qY.id,params:t}),h=Km([...m.redos],o);if(p.result&&h.result){let r=a.afterCommandExecute({id:qY.id,params:t});return Km(r.redos,o),e.get(vx).pushUndoRedo({unitID:n,undoMutations:[{id:kK.id,params:d},{id:Fq.id,params:f},...m.undos??[],...r.undos],redoMutations:[...m.preRedos??[],{id:AK.id,params:l},{id:Fq.id,params:u},...m.redos,...r.redos]}),!0}return!0}},JY={type:L.COMMAND,id:`sheet.command.set-selected-cols-visible`,handler:e=>{let t=e.get(yq),n=e.get(R),r=t.getCurrentSelections()?.map(e=>e.range).filter(e=>e.rangeType===z.COLUMN);if(!r?.length)return!1;let i=ZG(e.get(B));if(!i)return!1;let{worksheet:a,unitId:o,subUnitId:s}=i,c=r.map(e=>a.getHiddenCols(e.startColumn,e.endColumn)).flat();return n.executeCommand(qY.id,{unitId:o,subUnitId:s,ranges:c})}},YY={type:L.COMMAND,id:`sheet.command.set-col-hidden`,handler:(e,t)=>{var n;let r=e.get(yq),i=e.get(lK),a=e.get(B),o=e.get(R),s=t!=null&&(n=t.ranges)!=null&&n.length?t.ranges:r.getCurrentSelections()?.map(e=>e.range).filter(e=>e.rangeType===z.COLUMN);if(!s?.length)return!1;let c=ZG(a,t);if(!c)return!1;let{worksheet:l,unitId:u,subUnitId:d}=c;s=Gdt(c.worksheet,s);let f={unitId:u,subUnitId:d,ranges:s},p={unitId:u,subUnitId:d,selections:Kdt(s).map(e=>({range:e,primary:kq(e,l),style:null}))},m=oct(e,f),h={unitId:u,subUnitId:d,reveal:!0,selections:s.map(e=>({range:e,primary:kq(e,l),style:null}))},g=Km([{id:kK.id,params:f},{id:Fq.id,params:p}],o),_=i.onCommandExecute({id:YY.id,params:f}),v=Km([..._.redos],o);if(g.result&&v.result){let t=i.afterCommandExecute({id:YY.id,params:f});return Km(t.redos,o),e.get(vx).pushUndoRedo({unitID:u,undoMutations:[{id:AK.id,params:m},{id:Fq.id,params:h},..._.undos??[],...t.undos],redoMutations:[..._.preRedos??[],{id:kK.id,params:f},{id:Fq.id,params:p},..._.redos,...t.redos]}),!0}return!1}};function Gdt(e,t){let n=e.getRowCount()-1,r=e.getHiddenCols(),i=[];return t.forEach(e=>{let t=r.filter(t=>t.startColumn>=e.startColumn&&t.endColumn<=e.endColumn);if(t.length){let r=e.startColumn;t.forEach(e=>{e.startColumn>r&&(i.push({startColumn:r,endColumn:e.startColumn-1,startRow:0,endRow:n}),r=e.endColumn+1)}),r<=e.endColumn&&i.push({startColumn:r,endColumn:e.endColumn,startRow:0,endRow:n})}else i.push(e)}),i}function Kdt(e){return qdt(e).map(e=>{let t=e.startColumn===0?e.endColumn+1:e.startColumn-1;return{...e,startColumn:t,endColumn:t}})}function qdt(e){let t=[],n;return e.sort((e,t)=>e.startColumn-t.startColumn).forEach(e=>{if(!n){n=e;return}n.endColumn===e.startColumn-1?n.endColumn=e.endColumn:(t.push(n),n=e)}),t.push(n),t}var XY={id:`sheet.command.set-defined-name`,type:L.COMMAND,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(lK);if(!t)return!1;let a={...t},o=j6e(e,t),s=i.onCommandExecute({id:XY.id,params:t}),c=[...s.preRedos??[],...o?[{id:aB.id,params:o}]:[],{id:iB.id,params:a},...s.redos],l=[...s.preUndos??[],{id:aB.id,params:a},...o?[{id:iB.id,params:o}]:[],...s.undos];return Km(c,n).result?(r.pushUndoRedo({unitID:t.unitId,undoMutations:l.filter(Boolean),redoMutations:c.filter(Boolean)}),!0):!1}},ZY=(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)throw Error(`universheet is null error!`);let r=n.getSheetBySheetId(t.subUnitId);if(r==null)throw Error(`worksheet is null error!`);let i=r.getConfig().freeze;return{unitId:t.unitId,subUnitId:t.subUnitId,...i}},QY={id:`sheet.mutation.set-frozen`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)throw Error(`universheet is null error!`);let r=n.getSheetBySheetId(t.subUnitId);if(!r)return!1;let i=r.getConfig(),{startRow:a,startColumn:o,ySplit:s,xSplit:c}=t;return i.freeze={startRow:a,startColumn:o,ySplit:s,xSplit:c},!0}},$Y={type:L.COMMAND,id:`sheet.command.set-frozen`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=ZG(e.get(B),{unitId:t.unitId,subUnitId:t.subUnitId});if(!i)return!1;let{unitId:a,subUnitId:o,worksheet:s}=i,{startColumn:c,startRow:l,xSplit:u,ySplit:d}=t;if(l>=s.getRowCount()||c>=s.getColumnCount()||u>=s.getColumnCount()||d>=s.getRowCount())return!1;let f={unitId:a,subUnitId:o,...t},p=ZY(e,f);return n.syncExecuteCommand(QY.id,f)?(r.pushUndoRedo({unitID:a,undoMutations:[{id:QY.id,params:p}],redoMutations:[{id:QY.id,params:f}]}),!0):!1}},eX={type:L.COMMAND,id:`sheet.command.cancel-frozen`,handler:(e,t)=>{let n=e.get(R),r=e.get(B),i=e.get(vx),a=ZG(r,{unitId:t?.unitId,subUnitId:t?.subUnitId});if(!a)return!1;let{unitId:o,subUnitId:s}=a,c={unitId:o,subUnitId:s,startRow:-1,startColumn:-1,xSplit:0,ySplit:0},l=ZY(e,c);return n.syncExecuteCommand(QY.id,c)&&i.pushUndoRedo({unitID:o,undoMutations:[{id:QY.id,params:l}],redoMutations:[{id:QY.id,params:c}]}),!0}},tX={type:L.COMMAND,id:`sheet.command.set-gridlines-color`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=ZG(e.get(B),t);if(!i)return!1;let{worksheet:a}=i,o=a.getConfig().gridlinesColor;if(o===t?.color)return!1;let{unitId:s,subUnitId:c}=i,l={color:t?.color,unitId:s,subUnitId:c},u={color:o,unitId:s,subUnitId:c};return n.syncExecuteCommand(jK.id,l)?(r.pushUndoRedo({unitID:s,undoMutations:[{id:jK.id,params:u}],redoMutations:[{id:jK.id,params:l}]}),!0):!1}},nX={id:`sheet.mutation.set-range-protection`,type:L.MUTATION,handler:(e,t)=>{let{unitId:n,subUnitId:r,rule:i,ruleId:a}=t;return e.get(hq).setRule(n,r,a,i),!0}},rX={id:`sheet.mutation.set-worksheet-protection`,type:L.MUTATION,handler:(e,t)=>{let{unitId:n,subUnitId:r,rule:i}=t;return e.get(VJ).setRule(n,r,i),!0}},Jdt={type:L.COMMAND,id:`sheet.command.set-protection`,async handler(e,t){if(!t)return!1;let n=e.get(R),r=e.get(vx),i=e.get(hq),{rule:a,oldRule:o}=t,{unitId:s,subUnitId:c}=a,l=[],u=[];return o?.unitType===a.unitType?a.unitType===ra.Worksheet?(l.push({id:rX.id,params:{unitId:s,subUnitId:c,rule:a}}),u.push({id:rX.id,params:{unitId:s,subUnitId:c,rule:o}})):(l.push({id:nX.id,params:{unitId:s,subUnitId:c,rule:a,ruleId:a.id}}),u.push({id:nX.id,params:{unitId:s,subUnitId:c,ruleId:o.id,rule:o}})):(o&&(o.unitType===ra.Worksheet?(l.push({id:UJ.id,params:{unitId:s,subUnitId:c}}),u.push({id:HJ.id,params:{unitId:s,rule:o,subUnitId:o.subUnitId}})):o.unitType===ra.SelectRange&&(l.push({id:gq.id,params:{unitId:s,subUnitId:c,ruleIds:[o.id]}}),u.push({id:_q.id,params:{unitId:s,subUnitId:c,rules:[o]}}))),a.unitType===ra.Worksheet?(l.push({id:HJ.id,params:{unitId:s,rule:a,subUnitId:a.subUnitId}}),u.unshift({id:UJ.id,params:{unitId:s,subUnitId:c}})):a.unitType===ra.SelectRange&&(a.id=i.createRuleId(s,c),l.push({id:_q.id,params:{unitId:s,subUnitId:c,rules:[a]}}),u.unshift({id:gq.id,params:{unitId:s,subUnitId:c,ruleIds:[a.id]}}))),Km(l,n).result&&r.pushUndoRedo({unitID:s,undoMutations:u,redoMutations:l}),!0}},iX={id:`sheet.command.set-range-custom-metadata`,type:L.COMMAND,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let r=e.get(R),{unitId:i,subUnitId:a}=n,{range:o,customMetadata:s}=t,{startRow:c,startColumn:l,endRow:u,endColumn:d}=o,f=F.isArray(s),p=new Rh;for(let e=c;e<=u;e++)for(let t=l;t<=d;t++){let n=f?s[e-c][t-l]:s;p.setValue(e,t,n)}return r.syncExecuteCommand(RK.id,{unitId:i,subUnitId:a,cellValue:p.getMatrix()})}},aX={type:L.COMMAND,id:`sheet.command.set-row-data`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=ZG(e.get(B),t);if(!i)return!1;let{rowData:a}=t,{unitId:o,subUnitId:s,worksheet:c}=i,l={subUnitId:s,unitId:o,rowData:a},u=Act(l,c);return n.syncExecuteCommand(zK.id,l)?(r.pushUndoRedo({unitID:o,undoMutations:[{id:zK.id,params:u}],redoMutations:[{id:zK.id,params:l}]}),!0):!1}},oX={type:L.COMMAND,id:`sheet.command.set-specific-rows-visible`,handler:(e,t)=>{let{unitId:n,subUnitId:r,ranges:i}=t,a=e.get(R),o=e.get(vx),s=e.get(lK),c=ZG(e.get(B),{unitId:n,subUnitId:r});if(!c)return!1;let{worksheet:l}=c,u={unitId:n,subUnitId:r,ranges:i},d={unitId:n,subUnitId:r,reveal:!0,selections:i.map(e=>({range:e,primary:kq(e,l),style:null}))},f=jct(e,u),p={unitId:n,subUnitId:r,selections:Xdt(i).map(e=>({range:e,primary:kq(e,l),style:null}))},m=Km([{id:BK.id,params:u},{id:Fq.id,params:d}],a),h=s.onCommandExecute({id:oX.id,params:t}),g=Km([...h.redos],a);if(m.result&&g.result){let e=s.afterCommandExecute({id:oX.id,params:t});return Km(e.redos,a),o.pushUndoRedo({unitID:n,undoMutations:[...h.preUndos??[],{id:VK.id,params:f},{id:Fq.id,params:p},...h.undos??[],...e.undos],redoMutations:[...h.preRedos??[],{id:BK.id,params:u},{id:Fq.id,params:d},...h.redos,...e.redos]}),!0}return!0}},sX={type:L.COMMAND,id:`sheet.command.set-selected-rows-visible`,handler:async e=>{let t=e.get(yq),n=e.get(B),r=e.get(R),i=t.getCurrentSelections()?.map(e=>e.range).filter(e=>e.rangeType===z.ROW);if(!i?.length)return!1;let a=ZG(n);if(!a)return!1;let{worksheet:o,unitId:s,subUnitId:c}=a,l=i.map(e=>o.getHiddenRows(e.startRow,e.endRow)).flat();return r.executeCommand(oX.id,{unitId:s,subUnitId:c,ranges:l})}},cX={type:L.COMMAND,id:`sheet.command.set-rows-hidden`,handler:(e,t)=>{var n;let r=e.get(yq),i=e.get(R),a=e.get(vx),o=e.get(B),s=e.get(lK),c=t!=null&&(n=t.ranges)!=null&&n.length?t.ranges:r.getCurrentSelections()?.map(e=>e.range).filter(e=>e.rangeType===z.ROW);if(!c?.length)return!1;let l=ZG(o,t);if(!l)return!1;c=Ydt(l.worksheet,c);let{unitId:u,subUnitId:d,worksheet:f}=l,p={unitId:u,subUnitId:d,ranges:c},m={unitId:u,subUnitId:d,selections:Xdt(c).map(e=>({range:e,primary:kq(e,f),style:null}))},h=Mct(e,p),g={unitId:u,subUnitId:d,reveal:!0,selections:c.map(e=>({range:e,primary:kq(e,f),style:null}))},_=s.onCommandExecute({id:cX.id,params:p});if(Km([..._.preRedos??[],{id:VK.id,params:p},{id:Fq.id,params:m},..._.redos],i).result){let e=s.afterCommandExecute({id:cX.id,params:p});return Km(e.redos,i),a.pushUndoRedo({unitID:u,undoMutations:[..._.preUndos??[],{id:BK.id,params:h},{id:Fq.id,params:g},..._.undos??[],...e.undos],redoMutations:[..._.preRedos??[],{id:VK.id,params:p},{id:Fq.id,params:m},..._.redos,...e.redos]}),!0}return!0}};function Ydt(e,t){let n=e.getMaxColumns()-1,r=e.getHiddenRows(),i=[];return t.forEach(e=>{let t=r.filter(t=>t.startRow>=e.startRow&&t.endRow<=e.endRow);if(t.length){let r=e.startRow;t.forEach(e=>{e.startRow>r&&(i.push({startRow:r,endRow:e.startRow-1,startColumn:0,endColumn:n}),r=e.endRow+1)}),r<=e.endRow&&i.push({startRow:r,endRow:e.endRow,startColumn:0,endColumn:n})}else i.push(e)}),i}function Xdt(e){return Zdt(e).map(e=>{let t=e.startRow===0?e.endRow+1:e.startRow-1;return{...e,startRow:t,endRow:t}})}function Zdt(e){let t=[],n;return e.sort((e,t)=>e.startRow-t.startRow).forEach(e=>{if(!n){n=e;return}e.startRow===n.endRow+1?n.endRow=e.endRow:(t.push(n),n=e)}),t.push(n),t}var Qdt=(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId).getSheetBySheetId(t.subUnitId).getConfig().tabColor;return{...F.deepClone(t),color:n}},lX={id:`sheet.mutation.set-tab-color`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(!n)return!1;let r=n.getSheetBySheetId(t.subUnitId);return r?(r.getConfig().tabColor=t.color,!0):!1}},uX={type:L.COMMAND,id:`sheet.command.set-tab-color`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=ZG(e.get(B),t);if(!i)return!1;let{unitId:a,subUnitId:o}=i,s={color:t.value,unitId:a,subUnitId:o},c=Qdt(e,s);return n.syncExecuteCommand(lX.id,s)?(r.pushUndoRedo({unitID:a,undoMutations:[{id:lX.id,params:c}],redoMutations:[{id:lX.id,params:s}]}),!0):!1}},$dt={id:`sheet.mutation.set-workbook-name`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUnit(t.unitId,M.UNIVER_SHEET);return n?(n.setName(t.name),!0):!1}},dX={type:L.COMMAND,id:`sheet.command.set-workbook-name`,handler:(e,t)=>{let n=e.get(R),r=e.get(lK);if(!Ost(e.get(B),t))return!1;let i=r.onCommandExecute({id:dX.id,params:t}),a={name:t.name,unitId:t.unitId};return Km([...i.preRedos??[],{id:$dt.id,params:a},...i.redos],n).result}},eft=4,fX={type:L.COMMAND,id:`sheet.command.set-worksheet-activate`,handler:(e,t,n)=>{let r=e.get(R),i=ZG(e.get(B),t);if(!i)return!1;let{unitId:a,subUnitId:o}=i;return new Promise(e=>{setTimeout(()=>{e(r.syncExecuteCommand($K.id,{unitId:a,subUnitId:o},n))},eft)})}},pX={type:L.COMMAND,id:`sheet.command.delta-column-width`,handler:async(e,t)=>{let n=e.get(yq).getCurrentSelections();if(!n?.length)return!1;let r=e.get(R),i=e.get(vx),a=ZG(e.get(B));if(!a)return!1;let{worksheet:o,unitId:s,subUnitId:c}=a,{anchorCol:l,deltaX:u}=t,d=o.getColumnWidth(l)+u,f=n.length===1&&n[0].range.rangeType===z.ALL,p=n.filter(e=>e.range.rangeType===z.COLUMN),m=f?z.ALL:p.some(({range:e})=>{let{startColumn:t,endColumn:n}=e;return t<=l&&l<=n})?z.COLUMN:z.NORMAL,h;if(m===z.ALL){let e=o.getRowCount();h={subUnitId:c,unitId:s,colWidth:d,ranges:Array(o.getColumnCount()).fill(void 0).map((t,n)=>({startRow:0,endRow:e-1,startColumn:n,endColumn:n}))}}else h=m===z.COLUMN?{subUnitId:c,unitId:s,ranges:p.map(e=>d_.clone(e.range)),colWidth:d}:{subUnitId:c,unitId:s,colWidth:d,ranges:[{startRow:0,endRow:o.getMaxRows()-1,startColumn:l,endColumn:l}]};let g=e.get(Sq).getSkeleton(s,c),{suitableRanges:_,remainingRanges:v}=wq(h.ranges,g);Cq(_,o);let y=e.get(lK),{undos:b,redos:x}=y.onCommandExecute({id:pX.id,params:h}),S=HK(h,o),C=r.syncExecuteCommand(UK.id,h),{undos:w,redos:T}=y.generateMutationsOfAutoHeight({unitId:s,subUnitId:c,ranges:_,autoHeightRanges:_,lazyAutoHeightRanges:v}),{undos:E,redos:D}=e.get(lK).afterCommandExecute({id:pX.id,params:h}),O=Km([...x,...D,...T],r);return C&&O.result&&i.pushUndoRedo({unitID:s,undoMutations:[{id:UK.id,params:S},...b,...E,...w],redoMutations:[{id:UK.id,params:h},...x,...D,...T]}),!0}},mX={type:L.COMMAND,id:`sheet.command.set-worksheet-col-width`,handler:(e,t)=>{var n;let r=e.get(yq),i=e.get(R),a=e.get(vx),o=e.get(lK),s=t!=null&&(n=t.ranges)!=null&&n.length?t.ranges:r.getCurrentSelections()?.map(e=>e.range);if(!s?.length)return!1;let c=ZG(e.get(B),t);if(!c)return!1;let{subUnitId:l,unitId:u,worksheet:d}=c,f=e.get(Sq).getSkeleton(u,l),p={subUnitId:l,unitId:u,ranges:s,colWidth:t.value},{suitableRanges:m,remainingRanges:h}=wq(p.ranges,f);Cq(m,d);let g=HK(p,d),_=i.syncExecuteCommand(UK.id,p),{undos:v,redos:y}=o.generateMutationsOfAutoHeight({unitId:u,subUnitId:l,ranges:m,autoHeightRanges:m,lazyAutoHeightRanges:h}),b=o.onCommandExecute({id:mX.id,params:p}),x=Km([...b.redos,...y],i);if(_&&x.result){let e=o.afterCommandExecute({id:mX.id,params:p});return Km(e.redos,i),a.pushUndoRedo({unitID:u,undoMutations:[...b.preUndos??[],{id:UK.id,params:g},...b.undos,...e.undos,...v],redoMutations:[...b.preRedos??[],{id:UK.id,params:p},...b.redos,...e.redos,...y]}),!0}return!1}},tft={type:L.COMMAND,id:`sheet.command.set-col-is-auto-width`,handler:async(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(yq),a=ZG(e.get(B),t);if(!a)return!1;let{unitId:o,subUnitId:s}=a,c=[];if(t?.ranges)c=[...t.ranges];else{let e=i.getCurrentSelections();for(let t=0;t<e.length;t++)c.push(e[t].range)}if(!c?.length)return!1;let l={unitId:o,subUnitId:s,ranges:c},{undos:u,redos:d}=e.get(lK).onCommandExecute({id:tft.id,params:l});return Km([...d],n).result?(r.pushUndoRedo({unitID:o,undoMutations:[...u],redoMutations:[...d]}),!0):!1}},nft={type:L.COMMAND,id:`sheet.command.set-worksheet-column-count`,handler:(e,t)=>{let{unitId:n,subUnitId:r,columnCount:i}=t,a=e.get(R),o=e.get(vx);if(!ZG(e.get(B),t))return!1;let s={unitId:n,subUnitId:r,columnCount:i},c=Nct(e,s);return a.syncExecuteCommand(WK.id,s)?(o.pushUndoRedo({unitID:n,undoMutations:[{id:WK.id,params:c}],redoMutations:[{id:WK.id,params:s}]}),!0):!1}},rft={type:L.COMMAND,id:`sheet.command.set-worksheet-default-style`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),{unitId:i}=t,a=Pct(e,t);return n.syncExecuteCommand(GK.id,t)?(r.pushUndoRedo({unitID:i,undoMutations:[{id:GK.id,params:a}],redoMutations:[{id:GK.id,params:t}]}),!0):!1}},ift=(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`[SetWorksheetHideMutationFactory]: worksheet is null error!`);let{worksheet:r}=n;return{hidden:r.isSheetHidden(),unitId:t.unitId,subUnitId:r.getSheetId()}},hX={id:`sheet.mutation.set-worksheet-hidden`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)return!1;let r=n.getSheetBySheetId(t.subUnitId);return r?(r.getConfig().hidden=t.hidden,!0):!1}},gX={type:L.COMMAND,id:`sheet.command.set-worksheet-hidden`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(sb),a=e.get(nx),o=ZG(e.get(B),t);if(!o)return!1;let{workbook:s,worksheet:c,unitId:l,subUnitId:u}=o;if(c.getConfig().hidden===Np.TRUE)return!1;let d={unitId:l,subUnitId:u,hidden:Np.TRUE},f=ift(e,d);return s.getSheets().filter(e=>e.getConfig().hidden===Np.FALSE).length===1?(i.emit(a.t(`sheets.info.hideSheet`)),!1):n.syncExecuteCommand(hX.id,d)?(r.pushUndoRedo({unitID:l,undoMutations:[{id:hX.id,params:f}],redoMutations:[{id:hX.id,params:d}]}),!0):!1}},aft=(e,t)=>{let n=QG(e.get(B),t);if(!n)throw Error(`[SetWorksheetNameMutationFactory]: worksheet is null error!`);let{worksheet:r}=n;return{unitId:t.unitId,name:r.getName(),subUnitId:r.getSheetId()}},_X={id:`sheet.mutation.set-worksheet-name`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(n==null)return!1;let r=n.getSheetBySheetId(t.subUnitId);return r?(r.getConfig().name=t.name,!0):!1}},vX={type:L.COMMAND,id:`sheet.command.set-worksheet-name`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=e.get(lK),a=ZG(e.get(B),t);if(!a)return!1;let{unitId:o,subUnitId:s}=a,c={subUnitId:s,name:t.name,unitId:o},l=aft(e,c),u=i.onCommandExecute({id:vX.id,params:t}),d=[...u.preRedos??[],{id:_X.id,params:c},...u.redos],f=[...u.preUndos??[],{id:_X.id,params:l},...u.undos];return Km(d,n).result?(r.pushUndoRedo({unitID:o,undoMutations:f,redoMutations:d}),!0):!1}},oft=(e,t)=>({...F.deepClone(t),toOrder:t.fromOrder,fromOrder:t.toOrder}),yX={id:`sheet.mutation.set-worksheet-order`,type:L.MUTATION,handler:(e,t)=>{let n=e.get(B).getUniverSheetInstance(t.unitId);if(!n)return!1;let r=n.getConfig();return r.sheetOrder.splice(t.fromOrder,1),r.sheetOrder.splice(t.toOrder,0,t.subUnitId),n.ensureSheetOrderUnique(),!0}},bX={type:L.COMMAND,id:`sheet.command.set-worksheet-order`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=ZG(e.get(B),t);if(!i)return!1;let{workbook:a,unitId:o,subUnitId:s}=i,c={fromOrder:a.getConfig().sheetOrder.indexOf(s),toOrder:t.order,unitId:o,subUnitId:s},l=oft(e,c);return n.syncExecuteCommand(yX.id,c)?(r.pushUndoRedo({unitID:o,undoMutations:[{id:yX.id,params:l}],redoMutations:[{id:yX.id,params:c}]}),!0):!1}},xX=class{constructor(){Z(this,`_model`,new Map),Z(this,`_pointChange`,new ao),Z(this,`pointChange$`,this._pointChange.asObservable())}addRule(e){this._ensureSubUnitMap(e.unitId).set(e.subUnitId,e),this._pointChange.next(e)}deleteRule(e,t){let n=this._model.get(e)?.get(t);if(n){var r;(r=this._model)==null||(r=r.get(e))==null||r.delete(t),this._pointChange.next(n)}}getRule(e,t){var n;return(n=this._model)==null||(n=n.get(e))==null?void 0:n.get(t)}toObject(){let e={};return[...this._model.keys()].forEach(t=>{let n=this._model.get(t);n?.size&&(e[t]=[],[...n.keys()].forEach(r=>{let i=n.get(r);i&&e[t].push(i)}))}),e}fromObject(e){let t=new Map;Object.keys(e).forEach(n=>{let r=e[n];if(r?.length){let e=new Map;r.forEach(t=>{e.set(t.subUnitId,t)}),t.set(n,e)}}),this._model=t}deleteUnitModel(e){this._model.delete(e)}_ensureSubUnitMap(e){let t=this._model.get(e);return t||(t=new Map,this._model.set(e,t)),t}getTargetByPermissionId(e,t){let n=this._model.get(e);if(!n)return null;for(let[r,i]of n)if(i.permissionId===t)return[e,r]}},SX=class{constructor(e,t,n){Z(this,`type`,ra.SelectRange),Z(this,`subType`,ta.Delete),Z(this,`status`,ax.INIT),Z(this,`value`,!0),Z(this,`id`,void 0),Z(this,`unitId`,void 0),Z(this,`subUnitId`,void 0),Z(this,`permissionId`,void 0),this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${ra.SelectRange}.${ta.Delete}.${n}`}},CX=class{constructor(e,t,n){Z(this,`type`,ra.SelectRange),Z(this,`subType`,ta.Edit),Z(this,`status`,ax.INIT),Z(this,`value`,!0),Z(this,`id`,void 0),Z(this,`unitId`,void 0),Z(this,`subUnitId`,void 0),Z(this,`permissionId`,void 0),this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${ra.SelectRange}.${ta.Edit}.${n}`}},wX=class{constructor(e,t,n){Z(this,`type`,ra.SelectRange),Z(this,`subType`,ta.ManageCollaborator),Z(this,`status`,ax.INIT),Z(this,`value`,!0),Z(this,`id`,void 0),Z(this,`unitId`,void 0),Z(this,`subUnitId`,void 0),Z(this,`permissionId`,void 0),this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${ra.SelectRange}.${ta.ManageCollaborator}.${n}`}},TX=class{constructor(e,t,n){Z(this,`type`,ra.SelectRange),Z(this,`subType`,ta.View),Z(this,`status`,ax.INIT),Z(this,`value`,!1),Z(this,`id`,void 0),Z(this,`unitId`,void 0),Z(this,`subUnitId`,void 0),Z(this,`permissionId`,void 0),this.unitId=e,this.subUnitId=t,this.permissionId=n,this.id=`${ra.SelectRange}.${ta.View}.${n}`}},EX=()=>[TX,CX,wX,SX],DX=[ta.Edit,ta.View,ta.ManageCollaborator,ta.Delete],sft=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.Comment),this.unitId=e,this.id=`${this.type}.${ta.Comment}_${e}`}},OX=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.Copy),this.unitId=e,this.id=`${this.type}.${ta.Copy}_${e}`}},cft=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`subType`,ta.CopySheet),Z(this,`status`,ax.INIT),this.unitId=e,this.id=`${this.type}.${ta.CopySheet}_${e}`}},kX=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.CreatePermissionObject),this.unitId=e,this.id=`${this.type}.${ta.CreatePermissionObject}_${e}`}},AX=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.CreateSheet),this.unitId=e,this.id=`${this.type}.${ta.CreateSheet}_${e}`}},jX=class{constructor(e){this.unitId=e,Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.DeleteColumn),this.id=`${this.type}.${ta.DeleteColumn}_${e}`}},MX=class{constructor(e){this.unitId=e,Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.DeleteRow),this.id=`${this.type}.${ta.DeleteRow}_${e}`}},NX=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.DeleteSheet),this.unitId=e,this.id=`${this.type}.${ta.DeleteSheet}_${e}`}},lft=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.Duplicate),this.unitId=e,this.id=`${this.type}.${ta.Duplicate}_${e}`}},PX=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.Edit),this.unitId=e,this.id=`${this.type}.${ta.Edit}_${e}`}},uft=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.Export),this.unitId=e,this.id=`${this.type}.${ta.Export}_${e}`}},FX=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.HideSheet),this.unitId=e,this.id=`${this.type}.${ta.HideSheet}_${e}`}},IX=class{constructor(e){this.unitId=e,Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.InsertColumn),this.id=`${this.type}.${ta.InsertColumn}_${e}`}},LX=class{constructor(e){this.unitId=e,Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.InsertRow),this.id=`${this.type}.${ta.InsertRow}_${e}`}},RX=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.ManageCollaborator),this.unitId=e,this.id=`${this.type}.${ta.ManageCollaborator}_${e}`}},zX=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.MoveSheet),this.unitId=e,this.id=`${this.type}.${ta.MoveSheet}_${e}`}},dft=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.Print),this.unitId=e,this.id=`${this.type}.${ta.Print}_${e}`}},fft=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.RecoverHistory),this.unitId=e,this.id=`${this.type}.${ta.RecoverHistory}_${e}`}},BX=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.RenameSheet),this.unitId=e,this.id=`${this.type}.${ta.RenameSheet}_${e}`}},pft=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.Share),this.unitId=e,this.id=`${this.type}.${ta.Share}_${e}`}},VX=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.View),this.unitId=e,this.id=`${this.type}.${ta.View}_${e}`}},mft=class{constructor(e){this.unitId=e,Z(this,`id`,void 0),Z(this,`value`,!0),Z(this,`type`,ra.Workbook),Z(this,`status`,ax.INIT),Z(this,`subType`,ta.ViewHistory),this.unitId=e,this.id=`${this.type}.${ta.ViewHistory}_${e}`}},HX=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.Copy),this.id=`${this.type}.${ta.Copy}_${e}_${t}`}},UX=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.DeleteColumn),this.id=`${this.type}.${ta.DeleteColumn}_${e}_${t}`}},WX=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.Delete),this.id=`${this.type}.${ta.Delete}_${e}_${t}`}},GX=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.DeleteRow),this.id=`${this.type}.${ta.DeleteRow}_${e}_${t}`}},KX=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.Edit),this.id=`${this.type}.${ta.Edit}_${e}_${t}`}},hft=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.EditExtraObject),this.id=`${this.type}.${ta.EditExtraObject}_${e}_${t}`}},qX=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.Filter),this.id=`${this.type}.${ta.Filter}_${e}_${t}`}},JX=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.InsertColumn),this.id=`${this.type}.${ta.InsertColumn}_${e}_${t}`}},YX=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.InsertHyperlink),this.id=`${this.type}.${ta.InsertHyperlink}_${e}_${t}`}},XX=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.InsertRow),this.id=`${this.type}.${ta.InsertRow}_${e}_${t}`}},ZX=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.ManageCollaborator),this.id=`${this.type}.${ta.ManageCollaborator}_${e}_${t}`}},gft=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.PivotTable),this.id=`${this.type}.${ta.PivotTable}_${e}_${t}`}},_ft=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.SelectProtectedCells),this.id=`${this.type}.${ta.SelectProtectedCells}_${e}_${t}`}},vft=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.SelectUnProtectedCells),this.id=`${this.type}.${ta.SelectUnProtectedCells}_${e}_${t}`}},QX=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.SetCellStyle),this.id=`${this.type}.${ta.SetCellStyle}_${e}_${t}`}},$X=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.SetCellValue),this.id=`${this.type}.${ta.SetCellValue}_${e}_${t}`}},eZ=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.SetColumnStyle),this.id=`${this.type}.${ta.SetColumnStyle}_${e}_${t}`}},tZ=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.SetRowStyle),this.id=`${this.type}.${ta.SetRowStyle}_${e}_${t}`}},yft=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.Sort),this.id=`${this.type}.${ta.Sort}_${e}_${t}`}},nZ=class{constructor(e,t){this.unitId=e,this.subUnitId=t,Z(this,`value`,!0),Z(this,`type`,ra.Worksheet),Z(this,`status`,ax.INIT),Z(this,`id`,void 0),Z(this,`subType`,ta.View),this.id=`${this.type}.${ta.View}_${e}_${t}`}},rZ=()=>[PX,dft,sft,VX,OX,uft,RX,AX,NX,BX,FX,lft,pft,zX,cft,mft,fft,kX,LX,IX,MX,jX],bft=[ta.Edit,ta.Print,ta.Comment,ta.View,ta.Copy,ta.Export,ta.ManageCollaborator,ta.CreateSheet,ta.DeleteSheet,ta.RenameSheet,ta.HideSheet,ta.Duplicate,ta.Share,ta.MoveSheet,ta.CopySheet,ta.RecoverHistory,ta.ViewHistory,ta.CreatePermissionObject,ta.InsertRow,ta.InsertColumn,ta.DeleteRow,ta.DeleteColumn],iZ=()=>[KX,nZ,ZX,WX],aZ=()=>[HX,UX,GX,hft,qX,JX,XX,YX,gft,QX,$X,eZ,tZ,yft],oZ=[ta.Copy,ta.DeleteColumn,ta.DeleteRow,ta.EditExtraObject,ta.Filter,ta.InsertColumn,ta.InsertRow,ta.InsertHyperlink,ta.PivotTable,ta.SetCellStyle,ta.SetCellValue,ta.SetColumnStyle,ta.SetRowStyle,ta.Sort],xft=`SHEET_WORKSHEET_PROTECTION_PLUGIN`,Sft=`SHEET_WORKSHEET_PROTECTION_POINT_PLUGIN`,sZ=class extends Kf{constructor(e,t,n,r,i,a,o,s){super(),this._permissionService=e,this._univerInstanceService=t,this._injector=n,this._worksheetProtectionRuleModel=r,this._worksheetProtectionPointRuleModel=i,this._resourceManagerService=a,this._rangeProtectionRuleModel=o,this._logService=s,this._init(),this._initRuleChange(),this._initRuleSnapshot(),this._initPointSnapshot()}_init(){let e=e=>{let t=e.getUnitId(),n=e=>{let n=e.getSheetId();[...iZ(),...aZ()].forEach(e=>{let r=new e(t,n);this._permissionService.addPermissionPoint(r)}),this._logService.debug(`[WorksheetPermissionService]`,`Initialization completed`,t,n)};e.getSheets().forEach(e=>{n(e)}),e.sheetCreated$.subscribe(e=>{n(e)}),e.sheetDisposed$.subscribe(e=>{let n=e.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(t,n).forEach(e=>{[...EX()].forEach(r=>{let i=new r(t,n,e.permissionId);this._permissionService.deletePermissionPoint(i.id)})}),[...iZ(),...aZ()].forEach(e=>{let r=new e(t,n);this._permissionService.deletePermissionPoint(r.id)})})};this._univerInstanceService.getAllUnitsForType(M.UNIVER_SHEET).forEach(t=>e(t)),this._univerInstanceService.getTypeOfUnitAdded$(M.UNIVER_SHEET).pipe(cc(this.dispose$)).subscribe(t=>e(t.unit)),this._univerInstanceService.getTypeOfUnitDisposed$(M.UNIVER_SHEET).pipe(cc(this.dispose$)).subscribe(e=>{e.getSheets().forEach(t=>{let n=e.getUnitId(),r=t.getSheetId();iZ().forEach(e=>{let t=new e(n,r);this._permissionService.deletePermissionPoint(t.id)})})})}_initRuleChange(){this.disposeWithMe(this._worksheetProtectionRuleModel.ruleChange$.subscribe(e=>{switch(e.type){case`add`:break;case`delete`:iZ().forEach(t=>{let n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,!0)});break;case`set`:iZ().forEach(t=>{let n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,e.rule)})}}))}_initRuleSnapshot(){this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:()=>{let e=this._worksheetProtectionRuleModel.toObject();return JSON.stringify(e)},parseJson:e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}},pluginName:xft,businesses:[M.UNIVER_SHEET],onLoad:(e,t)=>{this._worksheetProtectionRuleModel.fromObject(t),Object.keys(t).forEach(t=>{iZ().forEach(n=>{let r=new n(e,t);r.value=!1,this._permissionService.addPermissionPoint(r)})}),this._worksheetProtectionRuleModel.changeRuleInitState(!0)},onUnLoad:e=>{let t=this._univerInstanceService.getUnit(e);t&&(t.getSheets().forEach(t=>{let n=t.getSheetId();[...iZ(),...aZ()].forEach(t=>{let r=new t(e,n);this._permissionService.deletePermissionPoint(r.id)})}),rZ().forEach(t=>{let n=new t(e);this._permissionService.deletePermissionPoint(n.id)})),this._worksheetProtectionRuleModel.deleteUnitModel(e)}}))}_initPointSnapshot(){this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:()=>{let e=this._worksheetProtectionPointRuleModel.toObject();return JSON.stringify(e)},parseJson:e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}},pluginName:Sft,businesses:[M.UNIVER_SHEET],onLoad:(e,t)=>{this._worksheetProtectionPointRuleModel.fromObject(t),Object.keys(t).forEach(t=>{aZ().forEach(n=>{let r=new n(e,t);this._permissionService.addPermissionPoint(r)})})},onUnLoad:e=>{this._worksheetProtectionPointRuleModel.deleteUnitModel(e)}}))}};sZ=aK([iK(0,j(ox)),iK(1,j(B)),iK(2,j(We)),iK(3,j(VJ)),iK(4,j(xX)),iK(5,j(By)),iK(6,j(hq)),iK(7,j(Rm))],sZ);var cZ={id:`sheet.mutation.set-worksheet-permission-points`,type:L.MUTATION,handler:(e,t)=>{let{rule:n}=t;return e.get(xX).addRule(n),!0}},Cft={type:L.COMMAND,id:`sheet.command.set-worksheet-permission-points`,async handler(e,t){if(!t)return!1;let n=e.get(R),{rule:r}=t;return n.executeCommand(cZ.id,{rule:r,unitId:r.unitId,subUnitId:r.subUnitId}),!0}},wft={type:L.COMMAND,id:`sheet.command.set-worksheet-protection`,async handler(e,t){if(!t)return!1;let n=e.get(R),r=e.get(vx),{rule:i,permissionId:a,oldRule:o}=t,{unitId:s,subUnitId:c}=i,l={...i,permissionId:a};if(await n.executeCommand(rX.id,{unitId:s,subUnitId:c,newRule:l})){let e=[{id:rX.id,params:{unitId:s,subUnitId:c,newRule:l}}],t=[{id:rX.id,params:{unitId:s,subUnitId:c,rule:o}}];r.pushUndoRedo({unitID:s,redoMutations:e,undoMutations:t})}return!0}};L.MUTATION,L.COMMAND;var Tft={type:L.COMMAND,id:`sheet.command.set-worksheet-row-count`,handler:(e,t)=>{let{unitId:n,subUnitId:r,rowCount:i}=t,a=e.get(R),o=e.get(vx);if(!ZG(e.get(B),t))return!1;let s={unitId:n,subUnitId:r,rowCount:i},c=Fct(e,s);return a.syncExecuteCommand(KK.id,s)?(o.pushUndoRedo({unitID:n,undoMutations:[{id:KK.id,params:c}],redoMutations:[{id:KK.id,params:s}]}),!0):!1}},lZ={type:L.COMMAND,id:`sheet.command.delta-row-height`,handler:async(e,t)=>{let n=e.get(yq).getCurrentSelections(),r=e.get(lK);if(!n?.length)return!1;let i=ZG(e.get(B));if(!i)return!1;let{worksheet:a,subUnitId:o,unitId:s}=i,{anchorRow:c,deltaY:l}=t,u=a.getRowHeight(c)+l,d=n.length===1&&n[0].range.rangeType===z.ALL,f=n.filter(e=>e.range.rangeType===z.ROW),p=d?z.ALL:f.some(({range:e})=>{let{startRow:t,endRow:n}=e;return t<=c&&c<=n})?z.ROW:z.NORMAL,m;if(p===z.ALL){let e=a.getColumnCount();m={subUnitId:o,unitId:s,rowHeight:u,ranges:Array(a.getRowCount()).fill(void 0).map((t,n)=>({startRow:n,endRow:n,startColumn:0,endColumn:e-1}))}}else m=p===z.ROW?{subUnitId:o,unitId:s,ranges:f.map(e=>d_.clone(e.range)),rowHeight:u}:{subUnitId:o,unitId:s,rowHeight:u,ranges:[{startRow:c,endRow:c,startColumn:0,endColumn:a.getMaxColumns()-1}]};let h=Ict(m,a),g={unitId:s,subUnitId:o,ranges:m.ranges,autoHeightInfo:Np.FALSE},_=qK(g,a),v=e.get(R),y=e.get(vx),b=r.onCommandExecute({id:lZ.id,params:m}),x=Km([{id:YK.id,params:m},{id:XK.id,params:g}],v),S=Km([...b.redos],v);if(x.result&&S.result){let e=r.afterCommandExecute({id:lZ.id,params:m});return Km(e.redos,v),y.pushUndoRedo({unitID:s,undoMutations:[...b.preUndos??[],{id:YK.id,params:h},{id:XK.id,params:_},...b.undos,...e.undos],redoMutations:[...b.preRedos??[],{id:YK.id,params:m},{id:XK.id,params:g},...b.redos,...e.redos]}),!0}return!1}},uZ={type:L.COMMAND,id:`sheet.command.set-row-height`,handler:(e,t)=>{var n;let r=e.get(yq),i=e.get(R),a=e.get(vx),o=e.get(B),s=e.get(lK),c=t!=null&&(n=t.ranges)!=null&&n.length?t.ranges:r.getCurrentSelections()?.map(e=>e.range);if(!c?.length)return!1;let l=ZG(o,t);if(!l)return!1;let{unitId:u,subUnitId:d,worksheet:f}=l,p={subUnitId:d,unitId:u,ranges:c,rowHeight:t.value},m=Ict(p,f),h={unitId:u,subUnitId:d,ranges:p.ranges,autoHeightInfo:Np.FALSE},g=qK(h,f),_=Km([{id:YK.id,params:p},{id:XK.id,params:h}],i),v=s.onCommandExecute({id:uZ.id,params:p}),y=Km([...v.redos],i);if(_.result&&y.result){let e=s.afterCommandExecute({id:uZ.id,params:p});return Km(e.redos,i),a.pushUndoRedo({unitID:u,undoMutations:[...v.preRedos??[],{id:YK.id,params:m},{id:XK.id,params:g},...v.undos,...e.undos],redoMutations:[...v.preRedos??[],{id:YK.id,params:p},{id:XK.id,params:h},...v.redos,...e.redos]}),!0}return!1}},dZ={type:L.COMMAND,id:`sheet.command.set-row-is-auto-height`,handler:(e,t)=>{var n;let r=e.get(R),i=e.get(vx),a=e.get(yq),o=ZG(e.get(B),t);if(!o)return!1;let{unitId:s,subUnitId:c,worksheet:l}=o,u=t!=null&&(n=t.ranges)!=null&&n.length?t.ranges:a.getCurrentSelections()?.map(e=>e.range);if(!u?.length)return!1;let d={unitId:s,subUnitId:c,ranges:u,autoHeightInfo:Np.TRUE},f=qK(d,l),p=r.syncExecuteCommand(XK.id,d),m=e.get(Sq).getSkeleton(s,c),{suitableRanges:h,remainingRanges:g}=wq(d.ranges,m),_=e.get(lK),{undos:v,redos:y}=_.generateMutationsOfAutoHeight({unitId:s,subUnitId:c,ranges:h,autoHeightRanges:h,lazyAutoHeightRanges:g}),{undos:b,redos:x}=_.onCommandExecute({id:dZ.id,params:d}),S=Km([...x,...y],r);return p&&S.result?(i.pushUndoRedo({unitID:s,undoMutations:[{id:XK.id,params:f},...b,...v],redoMutations:[{id:XK.id,params:d},...x,...y]}),!0):!1}},fZ={type:L.COMMAND,id:`sheet.command.set-worksheet-show`,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let{unitId:r,subUnitId:i,worksheet:a}=n;if(a.getConfig().hidden===Np.FALSE)return!1;let o=e.get(R),s=e.get(vx),c={unitId:r,subUnitId:i,hidden:Np.FALSE},l=ift(e,c),u=o.syncExecuteCommand(hX.id,c),d={unitId:r,subUnitId:i},f=o.syncExecuteCommand($K.id,d);return u&&f?(s.pushUndoRedo({unitID:r,undoMutations:[{id:hX.id,params:l}],redoMutations:[{id:hX.id,params:c}]}),!0):!1}},Eft={type:L.COMMAND,id:`sheet.command.split-text-to-columns`,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let{unitId:r,subUnitId:i,worksheet:a}=n,{range:o,delimiter:s,customDelimiter:c,treatMultipleDelimitersAsOne:l}=t,{lastRow:u,rs:d,maxLength:f}=ilt(a,o,s,c,l),p=a.getColumnCount(),{startColumn:m}=t_.transformRange(o,a);if(o.startColumn!==o.endColumn)return!1;let h=e.get(R),g=e.get(vx),_=[],v=[],y=m+f+1-p;if(y>0){let t={unitId:r,subUnitId:i,range:{startRow:0,endRow:a.getRowCount()-1,startColumn:p-1,endColumn:p-1+y}};_.push({id:yK.id,params:t});let n=vK(e,t);v.push({id:wK.id,params:n})}let b={startRow:o.startRow,endRow:u,startColumn:m,endColumn:m+f},x=new Rh;for(let e=b.startRow;e<=b.endRow;e++)for(let t=b.startColumn;t<=b.endColumn;t++){let n=d[e-b.startRow];t===0&&n?.length===1?x.setValue(e,t,a.getCell(e,t)):x.setValue(e,t,{v:n?.[t-b.startColumn]||null,p:null,f:null,si:null,custom:null})}let S={unitId:r,subUnitId:i,cellValue:x.clone()},C=LK(e,S);return _.push({id:RK.id,params:S}),v.unshift({id:RK.id,params:C}),Km(_,h).result?(g.pushUndoRedo({unitID:r,undoMutations:v,redoMutations:_}),!0):!1}},pZ=ce(`INumfmtService`),Dft=(e,t)=>{let n=e.get(pZ),{values:r,unitId:i,subUnitId:a}=t,o=[],s=[];Object.keys(r).forEach(e=>{r[e].ranges.forEach(e=>{t_.foreach(e,(e,t)=>{let r=n.getValue(i,a,e,t);r?o.push({pattern:r.pattern,row:e,col:t}):s.push({startColumn:t,endColumn:t,startRow:e,endRow:e})})})});let c=[];if(o.length){let e=_Z(i,a,o);Object.keys(e.values).forEach(t=>{let n=e.values[t];n.ranges=iq(n.ranges)}),c.push({id:mZ.id,params:_Z(i,a,o)})}return s.length&&c.push({id:hZ.id,params:{unitId:i,subUnitId:a,ranges:s}}),c},mZ={id:`sheet.mutation.set.numfmt`,type:L.MUTATION,handler:(e,t)=>{if(!t)return!1;let{values:n,refMap:r}=t,i=e.get(pZ),a=t.unitId,o=t.subUnitId,s=Object.keys(n).reduce((e,t)=>{let i=r[t],a=n[t].ranges;return i&&e.push({...i,ranges:a}),e},[]);return i.setValues(a,o,s),!0}},hZ={id:`sheet.mutation.remove.numfmt`,type:L.MUTATION,handler:(e,t)=>{if(!t)return!1;let{unitId:n,subUnitId:r,ranges:i}=t;return e.get(pZ).deleteValues(n,r,i),!0}},gZ=(e,t)=>{let n=e.get(pZ),{ranges:r,unitId:i,subUnitId:a}=t,o=[];if(r.forEach(e=>{t_.foreach(e,(e,t)=>{let r=n.getValue(i,a,e,t);r&&o.push({pattern:r.pattern,row:e,col:t})})}),!o.length)return[];let s=_Z(i,a,o);return Object.keys(s.values).forEach(e=>{let t=s.values[e];t.ranges=iq(t.ranges)}),[{id:mZ.id,params:s}]},_Z=(e,t,n)=>{let r=alt(n,`pattern`),i={},a={},o=olt();return Object.keys(r).forEach(e=>{let t=r[e],n=o();i[n]={pattern:e},t.forEach(e=>{a[n]||(a[n]={ranges:[]}),a[n].ranges.push(Yh(e.row,e.col))})}),{unitId:e,subUnitId:t,refMap:i,values:a}},vZ={id:`sheet.command.text-to-number`,type:L.COMMAND,handler:(e,t)=>{let n=ZG(e.get(B),t);if(!n)return!1;let r=t?.ranges||e.get(yq).getCurrentSelections()?.map(e=>e.range);if(!r?.length)return!1;let i=e.get(R),a=e.get(vx),{worksheet:o,unitId:s,subUnitId:c}=n,l=new Rh,u=[];for(let e=0;e<r.length;e++)for(let t=r[e].startRow;t<=r[e].endRow;t++)for(let n=r[e].startColumn;n<=r[e].endColumn;n++){var d,f;if(l.getValue(t,n))continue;let e=o.getCellRaw(t,n),r=typeof e?.s==`string`?(d=o.getStyleDataByHash(e.s))==null||(d=d.n)==null?void 0:d.pattern:e==null||(f=e.s)==null||(f=f.n)==null?void 0:f.pattern;e&&e.v&&(e.t!==Pp.NUMBER||Sh(r))&&Pg(e.v)&&(l.setValue(t,n,{v:Number(e.v),t:Pp.NUMBER}),Sh(r)&&u.push({startRow:t,endRow:t,startColumn:n,endColumn:n}))}let p={subUnitId:c,unitId:s,cellValue:l.getMatrix()},m=[{id:RK.id,params:p}],h=[{id:RK.id,params:LK(e,p)}];if(u.length){let t={unitId:s,subUnitId:c,ranges:u};m.push({id:hZ.id,params:t}),h.push(...gZ(e,t))}return Km(m,i).result?(a.pushUndoRedo({unitID:s,undoMutations:h,redoMutations:m}),!0):!1}},Oft={id:`sheet.command.toggle-cell-checkbox`,type:L.COMMAND,handler:(e,t)=>{if(!t)return!1;let{unitId:n,subUnitId:r,row:i,col:a,paragraphIndex:o}=t,s=e.get(B).getUnit(n,M.UNIVER_SHEET)?.getSheetBySheetId(r),c=e.get(vx),l=e.get(R);if(!s)return!1;let u=s.getCell(i,a);if(!u?.p)return!1;let d=F.deepClone(u.p),f=new Xv(d),p=Ey.paragraph.bullet.toggleChecklist({document:f,paragraphIndex:o});if(!p)return!1;Bv.apply(f.getBody(),p.serialize());let m={unitId:n,subUnitId:r,cellValue:{[i]:{[a]:{p:d,t:Pp.STRING}}}},h={id:RK.id,params:m},g=LK(e,m),_={id:RK.id,params:g},v=[h],y=[_];return c.pushUndoRedo({redoMutations:v,undoMutations:y,unitID:n}),l.syncExecuteCommand(h.id,h.params)}},yZ={type:L.COMMAND,id:`sheet.command.toggle-gridlines`,handler:(e,t)=>{let n=e.get(R),r=e.get(vx),i=ZG(e.get(B),t);if(!i)return!1;let{worksheet:a}=i,o=a.getConfig().showGridlines;if(o===t?.showGridlines)return!1;let{unitId:s,subUnitId:c}=i,l={showGridlines:o===Np.TRUE?Np.FALSE:Np.TRUE,unitId:s,subUnitId:c},u={showGridlines:o,unitId:s,subUnitId:c};return n.syncExecuteCommand(QK.id,l)?(r.pushUndoRedo({unitID:s,undoMutations:[{id:QK.id,params:u}],redoMutations:[{id:QK.id,params:l}]}),!0):!1}},kft={id:`sheet.command.unregister-worksheet-range-theme-style`,type:L.COMMAND,handler:(e,t)=>{if(!t||!ZG(e.get(B),t))return!1;let n=e.get(R),r=e.get(vx),i=e.get(pK),{unitId:a,themeName:o}=t,s={unitId:a,themeName:o},c={unitId:a,themeName:o,rangeThemeStyleJson:i.getRangeThemeStyle(a,o)?.toJson()};return n.syncExecuteCommand(LY.id,t)?(r.pushUndoRedo({unitID:a,undoMutations:[{id:LY.id,params:c}],redoMutations:[{id:RY.id,params:s}]}),!0):!1}},Aft={id:`sheet.mutation.add-range-theme`,type:L.MUTATION,handler:(e,t)=>{if(!t)return!1;let{styleJSON:n,unitId:r}=t,i=e.get(pK),a=new fK(n.name);return a.fromJson(n),i.registerRangeThemeStyle(r,a),!0}},jft={id:`sheet.mutation.empty`,type:L.MUTATION,handler:()=>!0},bZ={id:`sheet.mutation.mark-dirty-filter-change`,type:L.MUTATION,handler:()=>!0},Mft={id:`sheet.mutation.remove-range-theme`,type:L.MUTATION,handler:(e,t)=>{if(!t)return!1;let{styleName:n,unitId:r}=t;return e.get(pK).unregisterRangeThemeStyle(r,n),!0}},Nft={id:`sheet.mutation.set-range-theme`,type:L.MUTATION,handler:(e,t)=>{if(!t)return!1;let{unitId:n,styleName:r,style:i}=t,a=e.get(pK).getRangeThemeStyle(n,r);return a&&(i.headerRowStyle&&a.setHeaderRowStyle(i.headerRowStyle),i.firstRowStyle&&a.setFirstRowStyle(i.firstRowStyle),i.secondRowStyle&&a.setSecondRowStyle(i.secondRowStyle),i.lastRowStyle&&a.setLastRowStyle(i.lastRowStyle)),!0}},xZ={id:`sheet.operation.mark-dirty-row-auto-height`,type:L.OPERATION,handler:()=>!0},SZ={id:`sheet.operation.cancel-mark-dirty-row-auto-height`,type:L.OPERATION,handler:()=>!0},CZ={id:`sheet.operation.scroll-to-cell`,type:L.OPERATION,handler:()=>!0},{getLenS:Pft,getDataIndex:Fft,fillCopy:Ift,fillCopyStyles:Lft,generateNullCellValueRowCol:Rft}=pY,{otherRule:zft}=fdt,wZ=class extends P{constructor(e,t,n){super(),this._univerInstanceService=e,this._autoFillService=t,this._injector=n,Z(this,`_beforeApplyData`,[]),Z(this,`_copyData`,[]),this._init()}_init(){this._initDefaultHook()}quit(){this._beforeApplyData=[],this._copyData=[]}_initDefaultHook(){this.disposeWithMe(this._autoFillService.addHook({id:`default`,type:`DEFAULT`,priority:0,onBeforeFillData:(e,t)=>this._presetAndCacheData(e,t),onFillData:(e,t,n)=>this._fillData(e,t,n)}))}_presetAndCacheData(e,t){let{unitId:n,subUnitId:r,target:i}=e,a=this._univerInstanceService.getUnit(n)?.getSheetBySheetId(r);if(!a)throw Error(`Worksheet not found for unitId: ${n}, subUnitId: ${r}`);let o=a.getCellMatrix(),s=[];return i.rows.forEach(e=>{let t=[];i.cols.forEach(n=>{t.push(F.deepClone(o.getValue(e,n)))}),s.push(t)}),this._beforeApplyData=s,this._copyData=this._getCopyData(e,t),this._shouldDisableSeries(this._copyData)?(this._autoFillService.setDisableApplyType(`SERIES`,!0),`COPY`):(this._autoFillService.setDisableApplyType(`SERIES`,!1),this._getPreferredApplyType(this._copyData))}_getApplyData(e,t,n,r,i,a=!0,o){let s=[],c=Math.floor(n/t),l=n%t,u=this._autoFillService.getRules();if(!a&&i===`ONLY_FORMAT`)return console.error(`ERROR: only format can not be applied when hasStyle is false`),[];let d={};u.forEach(e=>{d[e.type]=[]}),u.forEach(a=>{let{type:s,applyFunctions:u={}}=a,f=e[s];f&&f.forEach(a=>{let f=Pft(a.index,l),p=a.index.length*c+f,m=this._applyFunctions(a,p,r,i,u,e,o),h=Fft(t,n,a.index);d[s].push({data:m,index:h})})});for(let e=0;e<n;e++)u.forEach(t=>{let{type:n}=t,r=d[n];for(let t=0;t<r.length;t++)e in r[t].index&&s.push(r[t].data[r[t].index[e]])});return s}_applyFunctions(e,t,n,r,i,a,o){let{data:s}=e,c=n===I.UP||n===I.LEFT;if(r===`COPY`){let r=i?.COPY;return r?r(e,t,n,a,o):(c&&s.reverse(),Ift(s,t))}if(r===`SERIES`){let r=i?.SERIES;return r?r(e,t,n,a):(c&&s.reverse(),i?.COPY?i.COPY(e,t,n,a,o):Ift(s,t))}if(r===`ONLY_FORMAT`){let r=i?.ONLY_FORMAT;return r?r(e,t,n,a):Lft(s,t)}}_getCopyData(e,t){let{unitId:n,subUnitId:r,source:i}=e,a=this._univerInstanceService.getUnit(n)?.getSheetBySheetId(r);if(!a)throw Error(`No worksheet found`);let o=a.getCellMatrix(),s=this._autoFillService.getRules(),c=[],l=t===I.DOWN||t===I.UP,u,d;return l?(u=i.cols,d=i.rows):(u=i.rows,d=i.cols),u.forEach(e=>{let t=this._getEmptyCopyDataPiece(),n={type:void 0,cellData:void 0};d.forEach(r=>{let i;i=l?o.getValue(r,e):o.getValue(e,r);let{type:a,isContinue:c}=s.find(e=>e.match(i,this._injector))||zft;if(c(n,i)){let e=t[a],n=e[e.length-1];n.data.push(i),n.index.push(r-d[0])}else{let e=t[a];e?e.push({data:[i],index:[r-d[0]]}):t[a]=[{data:[i],index:[r-d[0]]}]}n.type=a,n.cellData=i}),c.push(t)}),c}_getEmptyCopyDataPiece(){let e={};return this._autoFillService.getRules().forEach(t=>{e[t.type]=[]}),e}_getMergeApplyData(e,t,n,r,i){let{unitId:a,subUnitId:o}=i,s=this._univerInstanceService.getUnit(a)?.getSheetBySheetId(o);if(!s)throw Error(`No active sheet found`);let c=[];for(let i=e.startRow;i<=e.endRow;i++)for(let a=e.startColumn;a<=e.endColumn;a++){let{isMergedMainCell:e,startRow:o,startColumn:l,endRow:u,endColumn:d}=s.getCellInfoInMergeData(i,a);if(e){if(n===I.DOWN){let e=o+r,n=u+r;for(;n<=t.endRow;)c.push({startRow:e,startColumn:l,endRow:n,endColumn:d}),e+=r,n+=r}else if(n===I.UP){let e=o-r,n=u-r;for(;e>=t.startRow;)c.push({startRow:e,startColumn:l,endRow:n,endColumn:d}),e-=r,n-=r}else if(n===I.RIGHT){let e=l+r,n=d+r;for(;n<=t.endColumn;)c.push({startRow:o,startColumn:e,endRow:u,endColumn:n}),e+=r,n+=r}else if(n===I.LEFT){let e=l-r,n=d-r;for(;e>=t.startColumn;)c.push({startRow:o,startColumn:e,endRow:u,endColumn:n}),e-=r,n-=r}}}return c}_fillData(e,t,n){let r=[],i=[],a=!0;n===`NO_FORMAT`&&(a=!1,n=`SERIES`);let{source:o,target:s,unitId:c,subUnitId:l}=e;if(!o||!s||t==null)return{undos:r,redos:i};let u=lq(o),d=lq(s),{cols:f,rows:p}=s,{cols:m,rows:h}=o,g=this._copyData,_;_=t===I.DOWN||t===I.UP?h.length:m.length;let v=[];if(t===I.DOWN||t===I.UP){let r=p.length,i=[];f.forEach((o,s)=>{let c=g[s],l=this._getApplyData(c,_,r,t,n,a,e);i.push(l)});for(let e=0;e<i[0].length;e++){let t=[];for(let n=0;n<i.length;n++)t.push({s:null,...i[n][e]});v.push(t)}}else{let r=f.length;p.forEach((i,o)=>{let s=g[o],c=this._getApplyData(s,_,r,t,n,a,e),l=[];for(let e=0;e<c.length;e++)l.push({s:null,...c[e]});v.push(l)})}let y=[],b=this._univerInstanceService.getUnit(c)?.getStyles();if(a?(y=this._getMergeApplyData(u,d,t,_,e),v.forEach(e=>{e.forEach(e=>{e&&b&&b&&(e.s=b.getStyleByCell(e))})})):v.forEach((e,t)=>{e.forEach((e,n)=>{e&&b&&(e.s=b.getStyleByCell(this._beforeApplyData[t][n])||null)})}),n===`ONLY_FORMAT`&&v.forEach((e,t)=>{e.forEach((e,n)=>{if(e){let r=this._beforeApplyData[t][n]||{};e.f=r.f,e.si=r.si,e.t=r.t,e.v=r.v}})}),a){var x;let e=[],t=(x=this._univerInstanceService.getUniverSheetInstance(c))==null||(x=x.getSheetBySheetId(l))==null?void 0:x.getMergeData();if(t&&t.forEach(t=>{d_.intersects(t,d)&&e.push(t)}),e.length){let t={unitId:c,subUnitId:l,ranges:e},n=this._injector.invoke(TK,t);i.push({id:EK.id,params:t}),r.unshift({id:eK.id,params:n})}}let S={subUnitId:l,unitId:c,cellValue:Rft([s])},C=this._injector.invoke(LK,S);i.push({id:RK.id,params:S}),r.unshift({id:RK.id,params:C});let w=new Rh;p.forEach((e,t)=>{f.forEach((n,r)=>{v[t][r]&&w.setValue(e,n,v[t][r])})});let T=w.getMatrix(),E={subUnitId:l,unitId:c,cellValue:T},D=this._injector.invoke(LK,E);if(this._autoFillService.getActiveHooks().forEach(r=>{var i;(i=r.onBeforeSubmit)==null||i.call(r,e,t,n,T)}),r.unshift({id:RK.id,params:D}),i.push({id:RK.id,params:E}),y?.length){let e={unitId:c,subUnitId:l,ranges:AJ(y)},t=this._injector.invoke($G,e);r.unshift({id:EK.id,params:t}),i.push({id:eK.id,params:e})}return{undos:r,redos:i}}_shouldDisableSeries(e){return e.every(e=>Object.keys(e).every(t=>e[t]?.length===0||[`other`,`formula`].includes(t)))}_getPreferredApplyType(e){return e.every(e=>Object.keys(e).every(t=>e[t]?.length===0||e[t]?.length===1&&e[t][0].data.length===1&&t===`number`))?`COPY`:`SERIES`}};wZ=aK([iK(0,B),iK(1,wY),iK(2,j(We))],wZ);var Bft=`maxCellsPerSheet`,Vft=3e6,Hft=`SHEET_DEFINED_NAME_PLUGIN`,TZ=`AllDefaultWorkbook`,EZ=class extends P{constructor(e,t){super(),this._definedNamesService=e,this._resourceManagerService=t,this._initialize()}_initialize(){this._initSnapshot()}_initSnapshot(){let e=e=>{let t=this._definedNamesService.getDefinedNameMap(e);return t?JSON.stringify(t):``},t=e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}};this.disposeWithMe(this._resourceManagerService.registerPluginResource({pluginName:Hft,businesses:[M.UNIVER_SHEET],toJson:t=>e(t),parseJson:e=>t(e),onUnLoad:e=>{this._definedNamesService.removeUnitDefinedName(e)},onLoad:(e,t)=>{this._definedNamesService.registerDefinedNames(e,t)}}))}};EZ=aK([iK(0,rB),iK(1,By)],EZ);var Uft=[QY.id],Wft=[_K.id,yK.id,CK.id,wK.id,xK.id,SK.id],DZ=class extends P{constructor(e,t,n){super(),this._univerInstanceService=e,this._commandService=t,this._configService=n,Z(this,`_d`,new Gf),Z(this,`_enabled`,!0);let r=this._configService.getConfig(`sheets.config`)?.freezeSync??!0;this.setEnabled(r)}getEnabled(){return this._enabled}setEnabled(e){e?this._d.dispose():this._initOnlyLocalListener(),this._enabled=e}_initOnlyLocalListener(){this._d.add(this._commandService.beforeCommandExecuted((e,t)=>{Uft.includes(e.id)&&(t||={},t.onlyLocal=!0)})),this._d.add(this._commandService.onCommandExecuted((e,t)=>{if(Wft.includes(e.id)&&t?.fromCollab){let{id:n,params:r}=e;n===_K.id?this._handleInsertRowMutation(r,t):n===yK.id?this._handleInsertColMutation(r,t):n===CK.id?this._handleRemoveRowMutation(r,t):n===wK.id?this._handleRemoveColMutation(r,t):n===xK.id?this._handleMoveRowsMutation(r,t):n===SK.id&&this._handleMoveColsMutation(r,t)}}))}_handleInsertRowMutation(e,t){let{range:n,unitId:r,subUnitId:i}=e,a=this._getFreeze(r,i);if(a&&n.startRow<a.startRow){let e=n.endRow-n.startRow+1,o={...a,startRow:Math.max(1,a.startRow+e),ySplit:Math.max(1,a.ySplit+e)};this._sequenceExecute(r,i,o,t)}}_handleInsertColMutation(e,t){let{range:n,unitId:r,subUnitId:i}=e,a=this._getFreeze(r,i);if(a&&n.startColumn<a.startColumn){let e=n.endColumn-n.startColumn+1,o={...a,startColumn:Math.max(1,a.startColumn+e),xSplit:Math.max(1,a.xSplit+e)};this._sequenceExecute(r,i,o,t)}}_handleRemoveRowMutation(e,t){let{range:n,unitId:r,subUnitId:i}=e,a=this._getFreeze(r,i);if(a&&n.startRow<a.startRow){let e=Math.min(a.startRow,n.endRow+1)-n.startRow,o={...a,startRow:Math.max(1,a.startRow-e),ySplit:Math.max(1,a.ySplit-e)};this._sequenceExecute(r,i,o,t)}}_handleRemoveColMutation(e,t){let{range:n,unitId:r,subUnitId:i}=e,a=this._getFreeze(r,i);if(a&&n.startColumn<a.startColumn){let e=Math.min(a.startColumn,n.endColumn+1)-n.startColumn,o={...a,startColumn:Math.max(1,a.startColumn-e),xSplit:Math.max(1,a.xSplit-e)};this._sequenceExecute(r,i,o,t)}}_handleMoveRowsMutation(e,t){let{sourceRange:n,targetRange:r,unitId:i,subUnitId:a}=e,o=this._getFreeze(i,a);if(!o||o.startRow<=0||n.startRow>=o.startRow&&r.startRow>=o.startRow||n.endRow<o.startRow&&r.endRow<o.startRow)return;let s=n.endRow-n.startRow+1,c=Math.max(Math.min(o.startRow,n.endRow+1)-n.startRow,0),l={...o};r.startRow>=o.startRow?(l.startRow=Math.max(1,o.startRow-c),l.ySplit=Math.max(1,o.ySplit-c)):(l.startRow=o.startRow+s-c,l.ySplit=o.ySplit+s-c),this._sequenceExecute(i,a,l,t)}_handleMoveColsMutation(e,t){let{sourceRange:n,targetRange:r,unitId:i,subUnitId:a}=e,o=this._getFreeze(i,a);if(!o||o.startColumn<=0||n.startColumn>=o.startColumn&&r.startColumn>=o.startColumn||n.endColumn<o.startColumn&&r.endColumn<o.startColumn)return;let s=n.endColumn-n.startColumn+1,c=Math.max(Math.min(o.startColumn,n.endColumn+1)-n.startColumn,0),l={...o};r.startColumn>=o.startColumn?(l.startColumn=Math.max(1,o.startColumn-c),l.xSplit=Math.max(1,o.xSplit-c)):(l.startColumn=o.startColumn+s-c,l.xSplit=o.xSplit+s-c),this._sequenceExecute(i,a,l,t)}_getFreeze(e,t){let n=this._univerInstanceService.getUnit(e,M.UNIVER_SHEET);if(!n)return null;let r=n.getSheetBySheetId(t);return r?r.getFreeze():null}_sequenceExecute(e,t,n,r){Km([{id:QY.id,params:{...n,unitId:e,subUnitId:t,resetScroll:!1}}],this._commandService,r)}};DZ=aK([iK(0,j(B)),iK(1,R),iK(2,Nm)],DZ);var OZ=class extends P{constructor(e,t,n,r,i,a,o,s,c){super(),this._commandService=e,this._univerInstanceService=t,this._permissionService=n,this._selectionManagerService=r,this._rangeProtectionRuleModel=i,this._worksheetProtectionRuleModel=a,this._localeService=o,this._lexerTreeBuilder=s,this._definedNamesService=c,Z(this,`disposableCollection`,new Gf),Z(this,`_triggerPermissionUIEvent$`,new ao),Z(this,`triggerPermissionUIEvent$`,this._triggerPermissionUIEvent$.asObservable()),this._initialize()}_initialize(){this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{this._getPermissionCheck(e)})),this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id===_X.id){let t=ZG(this._univerInstanceService,e.params);if(!t)return;let{unitId:n,subUnitId:r}=t,i=this._worksheetProtectionRuleModel.getRule(n,r);i&&this._worksheetProtectionRuleModel.ruleRefresh(i.permissionId),this._rangeProtectionRuleModel.getSubunitRuleList(n,r).length&&this._rangeProtectionRuleModel.ruleRefresh(r)}}))}blockExecuteWithoutPermission(e){throw this._triggerPermissionUIEvent$.next(e),new mf(`have no permission`)}_getPermissionCheck(e){let{id:t}=e,n=!0,r=``,i;switch(t){case Rq.id:i=e.params,gh(i.value)&&i.value.f?(n=this._permissionCheckWithFormula(i),r=this._localeService.t(`sheets.permission.dialog.formulaErr`)):(n=this._permissionCheckBySetRangeValue({workbookTypes:[PX],worksheetTypes:[$X,KX],rangeTypes:[CX]},i),r=this._localeService.t(`sheets.permission.dialog.editErr`));break;case GJ.id:i=e.params,n=this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[QX,KX],rangeTypes:[CX]},i.range?[i.range]:void 0,i.unitId,i.subUnitId),r=this._localeService.t(`sheets.permission.dialog.setStyleErr`);break;case WY.id:i=e.params,n=this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[QX,KX],rangeTypes:[CX]},i?.ranges,i?.unitId,i?.subUnitId),r=this._localeService.t(`sheets.permission.dialog.setStyleErr`);break;case Tq.id:i=e.params,n=this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[$X,QX,KX],rangeTypes:[CX]},i?.ranges,i?.unitId,i?.subUnitId),r=this._localeService.t(`sheets.permission.dialog.editErr`);break;case DY.id:i=e.params,n=this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[$X,KX],rangeTypes:[CX]},i?.ranges,i?.unitId,i?.subUnitId),r=this._localeService.t(`sheets.permission.dialog.editErr`);break;case Eq.id:i=e.params,n=this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[QX,KX],rangeTypes:[CX]},i?.ranges,i?.unitId,i?.subUnitId),r=this._localeService.t(`sheets.permission.dialog.setStyleErr`);break;case pX.id:n=this.permissionCheckWithoutRange({worksheetTypes:[eZ]}),r=this._localeService.t(`sheets.permission.dialog.setRowColStyleErr`);break;case mX.id:i=e.params,n=this.permissionCheckWithoutRange({worksheetTypes:[eZ]},i.unitId,i.subUnitId),r=this._localeService.t(`sheets.permission.dialog.setRowColStyleErr`);break;case lZ.id:n=this.permissionCheckWithoutRange({worksheetTypes:[tZ]}),r=this._localeService.t(`sheets.permission.dialog.setRowColStyleErr`);break;case uZ.id:case dZ.id:i=e.params,n=this.permissionCheckWithoutRange({worksheetTypes:[tZ]},i.unitId,i.subUnitId),r=this._localeService.t(`sheets.permission.dialog.setRowColStyleErr`);break;case oJ.id:case sJ.id:i=e.params,n=this._permissionCheckByMoveRowsColsCommand(i),r=this._localeService.t(`sheets.permission.dialog.moveRowColErr`);break;case Iq.id:i=e.params,n=this._permissionCheckByMoveRangeCommand(i),r=this._localeService.t(`sheets.permission.dialog.moveRangeErr`);break;case Wq.id:case Yq.id:i=e.params,n=this._permissionCheckByInsertRowColCommand(i),r=this._localeService.t(`sheets.permission.dialog.insertRowColErr`);break;case eJ.id:i=e.params,n=this.permissionCheckWithRanges({workbookTypes:[PX,MX],worksheetTypes:[KX,GX],rangeTypes:[CX]},[i.range],i.unitId,i.subUnitId),r=this._localeService.t(`sheets.permission.dialog.removeRowColErr`);break;case rJ.id:i=e.params,n=this.permissionCheckWithRanges({workbookTypes:[PX,jX],worksheetTypes:[KX,UX],rangeTypes:[CX]},[i.range],i.unitId,i.subUnitId),r=this._localeService.t(`sheets.permission.dialog.removeRowColErr`);break;case bX.id:i=e.params,n=this._permissionCheckByWorksheetCommand([PX,zX],i),r=this._localeService.t(`sheets.permission.dialog.operatorSheetErr`);break;case vX.id:i=e.params,n=this._permissionCheckByWorksheetCommand([PX,BX],i),r=this._localeService.t(`sheets.permission.dialog.operatorSheetErr`);break;case fZ.id:i=e.params,n=this._permissionCheckByWorksheetCommand([PX,FX],i),r=this._localeService.t(`sheets.permission.dialog.operatorSheetErr`);break;case qY.id:i=e.params,n=this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[KX,eZ],rangeTypes:[CX]},i.ranges,i.unitId,i.subUnitId),r=this._localeService.t(`sheets.permission.dialog.setRowColStyleErr`);break;case oX.id:i=e.params,n=this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[KX,tZ],rangeTypes:[CX]},i.ranges,i.unitId,i.subUnitId),r=this._localeService.t(`sheets.permission.dialog.setRowColStyleErr`);break;case JY.id:n=this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[KX,eZ],rangeTypes:[CX]}),r=this._localeService.t(`sheets.permission.dialog.setRowColStyleErr`);break;case sX.id:n=this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[KX,tZ],rangeTypes:[CX]}),r=this._localeService.t(`sheets.permission.dialog.setRowColStyleErr`);break;case Hq.id:i=e.params,n=this._permissionCheckWithInsertOrDeleteMoveRange(`right`,i),r=this._localeService.t(`sheets.permission.dialog.insertOrDeleteMoveRangeErr`);break;case Vq.id:i=e.params,n=this._permissionCheckWithInsertOrDeleteMoveRange(`down`,i),r=this._localeService.t(`sheets.permission.dialog.insertOrDeleteMoveRangeErr`);break;case zq.id:i=e.params,n=this._permissionCheckWithInsertOrDeleteMoveRange(`left`,i),r=this._localeService.t(`sheets.permission.dialog.insertOrDeleteMoveRangeErr`);break;case Bq.id:i=e.params,n=this._permissionCheckWithInsertOrDeleteMoveRange(`up`,i),r=this._localeService.t(`sheets.permission.dialog.insertOrDeleteMoveRangeErr`);break;case TY.id:i=e.params,n=this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[$X,KX],rangeTypes:[CX]},[i.targetRange],i.unitId,i.subUnitId),r=this._localeService.t(`sheets.permission.dialog.autoFillErr`);break;case PY.id:case XY.id:case zY.id:i=e.params,n=!i.localSheetId||i.localSheetId===`AllDefaultWorkbook`?this.permissionCheckWithoutRange({workbookTypes:[PX]},i.unitId):this.permissionCheckWithoutRange({workbookTypes:[PX],worksheetTypes:[KX]},i.unitId,i.localSheetId),r=this._localeService.t(`sheets.permission.dialog.editErr`)}n||this.blockExecuteWithoutPermission(r)}permissionCheckWithRanges(e,t,n,r){let i=ZG(this._univerInstanceService,{unitId:n,subUnitId:r});if(!i)return!1;let{unitId:a,subUnitId:o}=i,{workbookTypes:s,worksheetTypes:c,rangeTypes:l}=e;if(s&&s.some(e=>{let t=new e(a);return this._permissionService.getPermissionPoint(t.id)?.value===!1})||c&&c.some(e=>{let t=new e(a,o);return this._permissionService.getPermissionPoint(t.id)?.value===!1}))return!1;if(l&&l.length>0){let e=t??this._selectionManagerService.getCurrentSelections()?.map(e=>e.range);if(!e)return!1;let n=this._rangeProtectionRuleModel.getSubunitRuleList(a,o);if(n.length===0)return!0;for(let t=0;t<n.length;t++){let r=n[t];if(e.some(e=>r.ranges.some(t=>d_.intersects(t,e)))){let e=r.permissionId;if(l.some(t=>{let n=new t(a,o,e);return this._permissionService.getPermissionPoint(n.id)?.value===!1}))return!1}}}return!0}permissionCheckWithoutRange(e,t,n){let r=ZG(this._univerInstanceService,{unitId:t,subUnitId:n});if(!r)return!1;let{worksheet:i,unitId:a,subUnitId:o}=r,{workbookTypes:s,worksheetTypes:c,rangeTypes:l}=e;if(s&&s.some(e=>{let t=new e(a);return this._permissionService.getPermissionPoint(t.id)?.value===!1})||c&&c.some(e=>{let t=new e(a,o);return this._permissionService.getPermissionPoint(t.id)?.value===!1}))return!1;if(l&&l.length>0){var u;let e=this._selectionManagerService.getCurrentLastSelection()?.primary;if(!e)return!1;let{actualRow:t,actualColumn:n}=e,r=i.getCell(t,n),s=r==null||(u=r.selectionProtection)==null?void 0:u[0];if(!s?.ruleId)return!0;let c=this._rangeProtectionRuleModel.getRule(a,o,s.ruleId)?.permissionId;if(!c)return!0;if(l.some(e=>{let t=new e(a,o,c);return this._permissionService.getPermissionPoint(t.id)?.value===!1}))return!1}return!0}_permissionCheckWithFormula(e){let t=ZG(this._univerInstanceService,e);if(!t)return!1;let{workbook:n,unitId:r,subUnitId:i}=t,a=e.value.f;if(a){let e=a.substring(1),t=this._definedNamesService.getValueByName(r,e);if(t){let e=t.formulaOrRefString;e.startsWith(QR.EQUALS)&&(e=e.slice(1));let r=e.split(`,`);for(let e=0;e<r.length;e++){let t=r[e],{sheetName:i,range:a}=Jz(t);if(i){let e=n.getSheetBySheetName(i);if(!e)return!0;let{startRow:t,endRow:r,startColumn:s,endColumn:c}=a;for(let n=t;n<=r;n++)for(let t=s;t<=c;t++){var o;let r=e.getCell(n,t);if((r==null||(o=r.selectionProtection)==null?void 0:o[0])?.[ta.View]===!1)return!1}}}return!0}{let e=this._lexerTreeBuilder.sequenceNodesBuilder(a);if(!e)return!0;for(let t=0;t<e.length;t++){let i=e[t];if(typeof i==`string`||i.nodeType!==HB.REFERENCE)continue;let{token:a}=i,{unitId:o,sheetName:c,range:l}=VB(a),u=n;if(o&&o!==r){let e=this._univerInstanceService.getUnit(o,M.UNIVER_SHEET);if(!e)return!0;u=e}let d=c?u.getSheetBySheetName(c):u.getActiveSheet();if(!d)return!0;if(c){let e=this._permissionService.getPermissionPoint(new nZ(u.getUnitId(),d.getSheetId()).id);if(!e||e.value===!1)return!1}let{startRow:f,endRow:p,startColumn:m,endColumn:h}=l;for(let e=f;e<=p;e++)for(let t=m;t<=h;t++){var s;let n=d.getCell(e,t);if((n==null||(s=n.selectionProtection)==null?void 0:s[0])?.[ta.View]===!1)return!1}}return!0}}let{range:c}=e;if(c){let e=this._rangeProtectionRuleModel.getSubunitRuleList(r,i);if(e.length===0)return!0;let t=e.filter(e=>e.ranges.some(e=>d_.intersects(e,c))).map(e=>new CX(r,i,e.permissionId).id);return this._permissionService.composePermission(t).every(e=>e.value)}return!0}_permissionCheckBySetRangeValue(e,t){let{unitId:n,subUnitId:r,value:i,range:a}=t,o=[];return o=(F.isArray(i)||gh(i))&&a?[a]:[new Rh(i).getStartEndScope()],this.permissionCheckWithRanges(e,o,n,r)}_permissionCheckByMoveRowsColsCommand(e){let t=ZG(this._univerInstanceService,e);if(!t)return!1;let{worksheet:n,unitId:r,subUnitId:i}=t,{fromRange:a,toRange:o}=e;if(!this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[$X,KX],rangeTypes:[CX]},[a],r,i))return!1;let s={...o};return s.endRow===n.getRowCount()-1?s.endColumn=s.startColumn:s.endRow=s.startRow,this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[$X,KX],rangeTypes:[CX]},[s],r,i)}_permissionCheckByMoveRangeCommand(e){let{fromUnitId:t,fromSubUnitId:n,fromRange:r,toUnitId:i,toSubUnitId:a,toRange:o}=e,s=ZG(this._univerInstanceService,{unitId:t,subUnitId:n});if(!s)return!1;let c=ZG(this._univerInstanceService,{unitId:i,subUnitId:a});return!c||!this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[$X,KX],rangeTypes:[CX]},[r],s.unitId,s.subUnitId)?!1:this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[$X,KX],rangeTypes:[CX]},[o],c.unitId,c.subUnitId)}_permissionCheckByInsertRowColCommand(e){let t=ZG(this._univerInstanceService,e);if(!t)return!1;let{worksheet:n,unitId:r,subUnitId:i}=t,{range:a,direction:o}=e,s={...a},c={workbookTypes:[PX],worksheetTypes:[KX],rangeTypes:[CX]};if(o===I.UP||o===I.DOWN){let e=o===I.UP?a.startRow:a.startRow-1;if(e<0||e>n.getRowCount()-1)return!1;s.startRow=e,s.endRow=e,c.workbookTypes.push(LX),c.worksheetTypes.push(XX)}else if(o===I.LEFT||o===I.RIGHT){let e=o===I.LEFT?a.startColumn:a.startColumn-1;if(e<0||e>n.getColumnCount()-1)return!1;s.startColumn=e,s.endColumn=e,c.workbookTypes.push(IX),c.worksheetTypes.push(JX)}return this.permissionCheckWithRanges(c,[s],r,i)}_permissionCheckByWorksheetCommand(e,t){let n=ZG(this._univerInstanceService,t);if(!n)return this._worksheetProtectionRuleModel.resetOrder(),!1;let{unitId:r}=n;return!e.some(e=>{let t=new e(r);return this._permissionService.getPermissionPoint(t.id)?.value===!1})||(this._worksheetProtectionRuleModel.resetOrder(),!1)}_permissionCheckWithInsertOrDeleteMoveRange(e,t){let n=ZG(this._univerInstanceService);if(!n)return!1;let{worksheet:r,unitId:i,subUnitId:a}=n,o=t?.range??this._selectionManagerService.getCurrentLastSelection()?.range;if(!o||!this.permissionCheckWithRanges({workbookTypes:[PX],worksheetTypes:[KX],rangeTypes:[CX]},[o],i,a))return!1;let s=this._rangeProtectionRuleModel.getSubunitRuleList(i,a);if(s.length===0)return!0;let c={...o};return e===`right`||e===`left`?c.endColumn=r.getColumnCount()-1:(e===`down`||e===`up`)&&(c.endRow=r.getRowCount()-1),!s.some(e=>e.ranges.some(e=>d_.intersects(e,c)))}};OZ=aK([iK(0,R),iK(1,B),iK(2,ox),iK(3,j(yq)),iK(4,j(hq)),iK(5,j(VJ)),iK(6,j(nx)),iK(7,j(qB)),iK(8,rB)],OZ);var kZ=class extends P{constructor(e,t,n,r,i){super(),this._permissionService=e,this._univerInstanceService=t,this._rangeProtectionRuleModel=n,this._worksheetProtectionRuleModel=r,this._worksheetProtectionPointModel=i,Z(this,`_unitPermissionInitStateChange`,new so(!1)),Z(this,`unitPermissionInitStateChange$`,this._unitPermissionInitStateChange.asObservable()),this._init()}_init(){let e=e=>{let t=e.getUnitId();rZ().forEach(e=>{let n=new e(t);this._permissionService.addPermissionPoint(n)})};this._univerInstanceService.getAllUnitsForType(M.UNIVER_SHEET).forEach(t=>e(t)),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(M.UNIVER_SHEET).subscribe(t=>e(t.unit))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(M.UNIVER_SHEET).subscribe(e=>{let t=e.getUnitId();e.getSheets().forEach(e=>{let n=e.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(t,n).forEach(e=>{[...EX()].forEach(r=>{let i=new r(t,n,e.permissionId);this._permissionService.deletePermissionPoint(i.id)})}),[...iZ(),...aZ()].forEach(e=>{let r=new e(t,n);this._permissionService.deletePermissionPoint(r.id)})}),rZ().forEach(e=>{let n=new e(t);this._permissionService.deletePermissionPoint(n.id)}),this._rangeProtectionRuleModel.deleteUnitModel(t),this._worksheetProtectionPointModel.deleteUnitModel(t),this._worksheetProtectionRuleModel.deleteUnitModel(t)}))}changeUnitInitState(e){this._unitPermissionInitStateChange.next(e)}};kZ=aK([iK(0,j(ox)),iK(1,j(B)),iK(2,j(hq)),iK(3,j(VJ)),iK(4,j(xX))],kZ);var AZ=class extends P{constructor(e,t,n,r,i,a,o,s,c,l){super(),this._univerInstanceService=e,this._permissionService=t,this._authzIoService=n,this._rangeProtectionRuleModel=r,this._worksheetProtectionRuleModel=i,this._userManagerService=a,this._worksheetProtectionPointRuleModel=o,this._workbookPermissionService=s,this._undoRedoService=c,this._commandService=l}initPermission(){this._initRangePermissionFromSnapshot(),this._initRangePermissionChange(),this._initWorksheetPermissionFromSnapshot(),this._initWorksheetPermissionChange(),this._initWorksheetPermissionPointsChange(),this._initWorkbookPermissionFromSnapshot(),this._initUserChange(),this._refreshPermissionByCollaCreate()}refreshRangeProtectPermission(){this._initRangePermissionFromSnapshot()}async _initRangePermissionFromSnapshot(){let e=async e=>{let t=[],n=e.getUnitId(),r=e.getSheets(),i=new Map;if(r.forEach(e=>{let r=e.getSheetId();this._rangeProtectionRuleModel.getSubunitRuleList(n,r).forEach(e=>{i.set(e.permissionId,e),t.push({objectID:e.permissionId,unitID:n,objectType:ra.SelectRange,actions:DX})})}),!t.length){this._rangeProtectionRuleModel.changeRuleInitState(!0);return}this._authzIoService.batchAllowed(t).then(e=>{e.forEach(e=>{let t=i.get(e.objectID);if(t){if(!this._rangeProtectionRuleModel.getRule(n,t.subUnitId,t.id))return;EX().forEach(r=>{let i=new r(n,t.subUnitId,e.objectID),a=i.subType,o=e.actions.find(e=>e.action===a);o?.allowed!==void 0&&this._permissionService.updatePermissionPoint(i.id,o.allowed)})}}),this._rangeProtectionRuleModel.changeRuleInitState(!0)})};await Promise.all(this._univerInstanceService.getAllUnitsForType(M.UNIVER_SHEET).map(t=>e(t))),this._rangeProtectionRuleModel.changeRuleInitState(!0)}_initRangePermissionChange(){this.disposeWithMe(this._rangeProtectionRuleModel.ruleChange$.subscribe(e=>{e.type===`delete`?this._rangeProtectionRuleModel.getSubunitRuleList(e.unitId,e.subUnitId).length===0&&(this._worksheetProtectionPointRuleModel.deleteRule(e.unitId,e.subUnitId),[...aZ()].forEach(t=>{let n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,n.value)})):this._authzIoService.allowed({objectID:e.rule.permissionId,unitID:e.unitId,objectType:ra.SelectRange,actions:DX}).then(t=>{this._rangeProtectionRuleModel.getRule(e.unitId,e.subUnitId,e.rule.id)&&(EX().forEach(n=>{if(e.type===`set`){let{rule:t,oldRule:n}=e;if(t.permissionId===n?.permissionId)return}let r=e.rule,i=new n(r.unitId,r.subUnitId,r.permissionId),a=i.subType,o=t.find(e=>e.action===a);o&&this._permissionService.updatePermissionPoint(i.id,o.allowed)}),this._rangeProtectionRuleModel.ruleRefresh(e.rule.permissionId))})}))}async initWorkbookPermissionChange(e){let t=e||this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET)?.getUnitId();if(t)return this._authzIoService.allowed({objectID:t,objectType:ra.Workbook,unitID:t,actions:bft}).then(e=>{rZ().forEach(n=>{let r=new n(t),i=r.subType,a=e.find(e=>e.action===i);a&&this._permissionService.updatePermissionPoint(r.id,a.allowed)})})}async _initWorkbookPermissionFromSnapshot(){await Promise.all(this._univerInstanceService.getAllUnitsForType(M.UNIVER_SHEET).map(e=>this.initWorkbookPermissionChange(e.getUnitId()))),this._workbookPermissionService.changeUnitInitState(!0)}_initWorksheetPermissionChange(){this.disposeWithMe(this._worksheetProtectionRuleModel.ruleChange$.subscribe(e=>{e.type===`delete`?([...iZ(),...aZ()].forEach(t=>{let n=new t(e.unitId,e.subUnitId);this._permissionService.updatePermissionPoint(n.id,!0)}),this._worksheetProtectionPointRuleModel.deleteRule(e.unitId,e.subUnitId)):this._authzIoService.allowed({objectID:e.rule.permissionId,unitID:e.unitId,objectType:ra.Worksheet,actions:DX}).then(t=>{let n=this._worksheetProtectionRuleModel.getRule(e.unitId,e.subUnitId);n&&n.permissionId===e.rule.permissionId&&(iZ().forEach(n=>{let r=new n(e.unitId,e.subUnitId),i=r.subType,a=t.find(e=>e.action===i);a&&this._permissionService.updatePermissionPoint(r.id,a.allowed)}),this._worksheetProtectionRuleModel.ruleRefresh(e.rule.permissionId))})}))}_initWorksheetPermissionPointsChange(){this.disposeWithMe(this._worksheetProtectionPointRuleModel.pointChange$.subscribe(e=>{this._authzIoService.allowed({objectID:e.permissionId,unitID:e.unitId,objectType:ra.Worksheet,actions:oZ}).then(t=>{let n=this._worksheetProtectionPointRuleModel.getRule(e.unitId,e.subUnitId);n&&n.permissionId===e.permissionId&&aZ().forEach(n=>{let r=new n(e.unitId,e.subUnitId),i=r.subType,a=t.find(e=>e.action===i);a&&this._permissionService.updatePermissionPoint(r.id,a.allowed)})})}))}async _initWorksheetPermissionFromSnapshot(){let e=async e=>{let t=[],n=e.getUnitId(),r=e.getSheets(),i=new Map;if(r.forEach(e=>{let r=e.getSheetId(),a=this._worksheetProtectionRuleModel.getRule(n,r);a&&(i.set(a.permissionId,a),t.push({objectID:a.permissionId,unitID:n,objectType:ra.Worksheet,actions:DX}));let o=this._worksheetProtectionPointRuleModel.getRule(n,r);o&&(i.set(o.permissionId,o),t.push({objectID:o.permissionId,unitID:n,objectType:ra.Worksheet,actions:oZ}))}),!t.length){this._worksheetProtectionRuleModel.changeRuleInitState(!0);return}this._authzIoService.batchAllowed(t).then(e=>{e.forEach(e=>{let t=i.get(e.objectID);if(t){let r=this._worksheetProtectionRuleModel.getRule(n,t.subUnitId)||this._worksheetProtectionPointRuleModel.getRule(n,t.subUnitId);if(!r||r.permissionId!==e.objectID)return;[...iZ(),...aZ()].forEach(r=>{let i=new r(n,t.subUnitId),a=i.subType,o=e.actions.find(e=>e.action===a);o?.allowed!==void 0&&this._permissionService.updatePermissionPoint(i.id,o.allowed)})}}),this._worksheetProtectionRuleModel.changeRuleInitState(!0)})};await Promise.all(this._univerInstanceService.getAllUnitsForType(M.UNIVER_SHEET).map(t=>e(t))),this._worksheetProtectionRuleModel.changeRuleInitState(!0)}_initUserChange(){this.disposeWithMe(this._userManagerService.currentUser$.pipe(ac(1)).subscribe(()=>{let e=this._permissionService.getAllPermissionPoint();this._permissionService.clearPermissionMap(),this._worksheetProtectionRuleModel.changeRuleInitState(!1),this._univerInstanceService.getAllUnitsForType(M.UNIVER_SHEET).forEach(t=>{let n=t.getUnitId();rZ().forEach(t=>{let r=new t(n);e.has(r.id)&&(r=e.get(r.id)),this._permissionService.addPermissionPoint(r)}),t.getSheets().forEach(t=>{let r=t.getSheetId();[...iZ(),...aZ()].forEach(t=>{let i=new t(n,r);e.has(i.id)&&(i=e.get(i.id)),this._permissionService.addPermissionPoint(i)}),this._rangeProtectionRuleModel.getSubunitRuleList(n,r).forEach(t=>{EX().forEach(i=>{let a=new i(n,r,t.permissionId);e.has(a.id)&&(a=e.get(a.id)),this._permissionService.addPermissionPoint(a)})})}),this._initWorkbookPermissionFromSnapshot(),this._initWorksheetPermissionFromSnapshot(),this._initRangePermissionFromSnapshot()})}))}refreshPermission(e,t){let n=this._worksheetProtectionRuleModel.getTargetByPermissionId(e,t),r=!1;if(n){let[i,a]=n;this._authzIoService.allowed({objectID:t,unitID:e,objectType:ra.Worksheet,actions:DX}).then(n=>{if(!this._worksheetProtectionRuleModel.getTargetByPermissionId(e,t))return;let i=``;iZ().forEach(t=>{let o=new t(e,a),s=o.subType,c=n.find(e=>e.action===s);c&&(this._permissionService.getPermissionPoint(o.id)?.value!==c.allowed&&(r=!0),this._permissionService.updatePermissionPoint(o.id,c.allowed),i+=`${c.action}_${c.allowed}`)}),this._worksheetProtectionRuleModel.ruleRefresh(`${t}_${i}`),r&&this._undoRedoService.clearUndoRedo(e)})}let i=this._worksheetProtectionPointRuleModel.getTargetByPermissionId(e,t);if(i){let[n,a]=i;this._authzIoService.allowed({objectID:t,unitID:e,objectType:ra.Worksheet,actions:oZ}).then(n=>{this._worksheetProtectionPointRuleModel.getTargetByPermissionId(e,t)&&(aZ().forEach(t=>{let i=new t(e,a),o=i.subType,s=n.find(e=>e.action===o);s&&(this._permissionService.getPermissionPoint(i.id)?.value!==s.allowed&&(r=!0),this._permissionService.updatePermissionPoint(i.id,s.allowed))}),r&&this._undoRedoService.clearUndoRedo(e))})}let a=this._rangeProtectionRuleModel.getTargetByPermissionId(e,t);if(a){let[n,i]=a;this._authzIoService.allowed({objectID:t,unitID:e,objectType:ra.SelectRange,actions:DX}).then(n=>{if(!this._rangeProtectionRuleModel.getTargetByPermissionId(e,t))return;let a=``;EX().forEach(o=>{let s=new o(e,i,t),c=s.subType,l=n.find(e=>e.action===c);l&&(this._permissionService.getPermissionPoint(s.id)?.value!==l.allowed&&(r=!0),this._permissionService.updatePermissionPoint(s.id,l.allowed),a+=`${l.action}_${l.allowed}`)}),this._rangeProtectionRuleModel.ruleRefresh(`${t}_${a}`),r&&this._undoRedoService.clearUndoRedo(e)})}}_refreshPermissionByCollaCreate(){this.disposeWithMe(this._commandService.onCommandExecuted((e,t)=>{if(t?.fromCollab&&(e.id===_q.id||e.id===HJ.id||e.id===cZ.id)){let t=e.params;this._undoRedoService.clearUndoRedo(t.unitId)}}))}};AZ=aK([iK(0,B),iK(1,ox),iK(2,Ky),iK(3,j(hq)),iK(4,j(VJ)),iK(5,j(Wy)),iK(6,j(xX)),iK(7,j(kZ)),iK(8,j(vx)),iK(9,j(R))],AZ);var jZ=class extends P{constructor(e,t,n){super(),this._commandService=e,this._sheetRangeThemeModel=t,this._univerInstanceService=n,Z(this,`_zebraCacheUpdateSubject`,new ao),this._init()}_init(){this._initializeCommandListener(),this._initTriggerCacheUpdateListener()}updateZebraCrossingCache(e,t){this._zebraCacheUpdateSubject.next({unitId:e,subUnitId:t})}_initializeCommandListener(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{let{id:t}=e,n,r;switch(t){case _K.id:{let t=e.params;n=t.unitId,r=t.subUnitId}break;case BK.id:{let t=e.params;n=t.unitId,r=t.subUnitId}break;case VK.id:{let t=e.params;n=t.unitId,r=t.subUnitId}break;case CK.id:{let t=e.params;n=t.unitId,r=t.subUnitId}break;case YK.id:{let t=e.params;n=t.unitId,r=t.subUnitId}}n&&r&&(this._sheetRangeThemeModel.refreshSheetRowVisibleFuncSet(n,r),this._sheetRangeThemeModel.refreshZebraCrossingCacheBySheet(n,r))}))}_initTriggerCacheUpdateListener(){this.disposeWithMe(this._zebraCacheUpdateSubject.subscribe(({unitId:e,subUnitId:t})=>{this._sheetRangeThemeModel.refreshSheetRowVisibleFuncSet(e,t),this._sheetRangeThemeModel.refreshZebraCrossingCacheBySheet(e,t)}))}};jZ=aK([iK(0,j(R)),iK(1,j(pK)),iK(2,j(B))],jZ);var MZ=class{constructor(e,t){this._selectionProtectionRuleModel=e,this._permissionService=t,Z(this,`_cache`,new Yg(1e4)),this._init()}_init(){this._permissionService.permissionPointUpdate$.pipe(Ls(e=>e.type===ra.SelectRange),Ls(e=>EX().some(t=>e instanceof t)),os(e=>e)).subscribe(e=>{let t=this._selectionProtectionRuleModel.getSubunitRuleList(e.unitId,e.subUnitId);for(let n of t)n.permissionId===e.permissionId&&n.ranges.forEach(t=>{t_.foreach(t,(t,n)=>{let r=this._createKey(e.unitId,e.subUnitId,t,n);this._cache.delete(r)})})}),this._selectionProtectionRuleModel.ruleChange$.subscribe(e=>{if(e.rule.ranges.forEach(t=>{t_.foreach(t,(t,n)=>{let r=this._createKey(e.unitId,e.subUnitId,t,n);this._cache.delete(r)})}),e.type===`set`){var t;(t=e.oldRule)==null||t.ranges.forEach(t=>{t_.foreach(t,(t,n)=>{let r=this._createKey(e.unitId,e.subUnitId,t,n);this._cache.delete(r)})})}})}_createKey(e,t,n,r){return`${e}_${t}_${n}_${r}`}getCellInfo(e,t,n,r){let i=this._selectionProtectionRuleModel.getSubunitRuleList(e,t),a=[];if(!i||!i.length)return a;let o=this._createKey(e,t,n,r),s=this._cache.get(o);if(s)return s;let c=[];for(let a of i)if(a.ranges.some(e=>e.startRow<=n&&e.endRow>=n&&e.startColumn<=r&&e.endColumn>=r)){let n=EX().reduce((n,r)=>{let i=new r(e,t,a.permissionId),o=this._permissionService.getPermissionPoint(i.id);return n[i.subType]=o?.value??i.value,n},{});c.push({...n,ruleId:a.id,ranges:a.ranges})}return this._cache.set(o,c),c}clear(){this._cache.clear()}};MZ=aK([iK(0,j(hq)),iK(1,j(ox))],MZ);var NZ=class extends P{constructor(e,t,n){super(),this._ruleModel=e,this._permissionService=t,this._univerInstanceService=n,Z(this,`_cellRuleCache`,new Map),Z(this,`_permissionIdCache`,new Map),Z(this,`_cellInfoCache`,new Map),Z(this,`_rowInfoCache`,new Map),Z(this,`_colInfoCache`,new Map),this._initUpdateCellRuleCache(),this._initUpdateCellInfoCache(),this._initUpdateRowColInfoCache(),this._initCache()}_initCache(){this._univerInstanceService.getAllUnitsForType(M.UNIVER_SHEET).forEach(e=>{e.getSheets().forEach(t=>{let n=e.getUnitId(),r=t.getSheetId();this.reBuildCache(n,r)})})}_initUpdateCellInfoCache(){this.disposeWithMe(this._permissionService.permissionPointUpdate$.pipe(Ls(e=>e.type===ra.SelectRange),os(e=>e)).subscribe(e=>{let{subUnitId:t,unitId:n,permissionId:r}=e,i=this._permissionIdCache.get(r);if(!i)return;let a=this._ruleModel.getRule(n,t,i);if(!a)return;let o=this._ensureCellInfoMap(n,t);a.ranges.forEach(e=>{let{startRow:t,endRow:n,startColumn:r,endColumn:i}=e;for(let e=t;e<=n;e++)for(let t=r;t<=i;t++)o.delete(`${e}-${t}`)})})),this.disposeWithMe(this._ruleModel.ruleChange$.subscribe(e=>{let{unitId:t,subUnitId:n}=e,r=this._ensureCellInfoMap(t,n);if(e.rule.ranges.forEach(e=>{t_.foreach(e,(e,t)=>{r.delete(`${e}-${t}`)})}),e.type===`set`){var i;(i=e.oldRule)==null||i.ranges.forEach(e=>{t_.foreach(e,(e,t)=>{this._cellInfoCache.delete(`${e}-${t}`)})})}}))}_initUpdateCellRuleCache(){this.disposeWithMe(this._ruleModel.ruleChange$.subscribe(e=>{let{type:t}=e;t===`add`?this._addCellRuleCache(e):t===`delete`?this._deleteCellRuleCache(e):(this._deleteCellRuleCache({...e,rule:e.oldRule}),this._addCellRuleCache(e))}))}_ensureRuleMap(e,t){let n=this._cellRuleCache.get(e);n||(n=new Map,this._cellRuleCache.set(e,n));let r=n.get(t);return r||(r=new Map,n.set(t,r)),r}_ensureCellInfoMap(e,t){let n=this._cellInfoCache.get(e);n||(n=new Map,this._cellInfoCache.set(e,n));let r=n.get(t);return r||(r=new Map,n.set(t,r)),r}_ensureRowColInfoMap(e,t,n){let r=n===`row`?this._rowInfoCache.get(e):this._colInfoCache.get(e);r||(r=new Map,n===`row`?this._rowInfoCache.set(e,r):this._colInfoCache.set(e,r));let i=r.get(t);return i||(i=new Map,r.set(t,i)),i}_addCellRuleCache(e){let{subUnitId:t,unitId:n,rule:r}=e,i=this._ensureRuleMap(n,t);r.ranges.forEach(e=>{let{startRow:t,endRow:n,startColumn:a,endColumn:o}=e;for(let e=t;e<=n;e++)for(let t=a;t<=o;t++)i.set(`${e}-${t}`,r.id)}),this._permissionIdCache.set(r.permissionId,r.id)}_deleteCellRuleCache(e){let{subUnitId:t,unitId:n,rule:r}=e,i=this._ensureRuleMap(n,t),a=this._ensureCellInfoMap(n,t);r.ranges.forEach(e=>{let{startRow:t,endRow:n,startColumn:r,endColumn:o}=e;for(let e=t;e<=n;e++)for(let t=r;t<=o;t++)i.delete(`${e}-${t}`),a.delete(`${e}-${t}`)}),this._permissionIdCache.delete(r.permissionId)}_getSelectionActions(e,t,n){let r=this._permissionService.getPermissionPoint(new CX(e,t,n.permissionId)?.id)?.value??!1,i=this._permissionService.getPermissionPoint(new TX(e,t,n.permissionId)?.id)?.value??!1,a=this._permissionService.getPermissionPoint(new wX(e,t,n.permissionId)?.id)?.value??!1,o=this._permissionService.getPermissionPoint(new SX(e,t,n.permissionId)?.id)?.value??!1;return{[ta.Edit]:r,[ta.View]:i,[ta.ManageCollaborator]:a,[ta.Delete]:o}}reBuildCache(e,t){let n=this._ensureRuleMap(e,t),r=this._ensureCellInfoMap(e,t);n.clear(),r.clear();let i=this._ensureRowColInfoMap(e,t,`row`),a=this._ensureRowColInfoMap(e,t,`col`);i.clear(),a.clear(),this._ruleModel.getSubunitRuleList(e,t).forEach(o=>{let s=this._getSelectionActions(e,t,o),c={...s,ruleId:o.id,ranges:o.ranges};o.ranges.forEach(e=>{let{startRow:t,endRow:l,startColumn:u,endColumn:d}=e;for(let e=t;e<=l;e++){let t=i.get(`${e}`);t?t.set(o.id,s):i.set(`${e}`,new Map([[o.id,s]]));for(let t=u;t<=d;t++){n.set(`${e}-${t}`,o.id),r.set(`${e}-${t}`,c);let i=a.get(`${t}`);i?i.set(o.id,s):a.set(`${t}`,new Map([[o.id,s]]))}}}),this._permissionIdCache.set(o.permissionId,o.id)})}getRowPermissionInfo(e,t,n,r){let i=this._rowInfoCache.get(e)?.get(t);if(!i)return!0;let a=i.get(`${n}`);return!a||r.every(e=>{for(let t of a.values())if(t[e]===!1)return!1;return!0})}getColPermissionInfo(e,t,n,r){let i=this._colInfoCache.get(e)?.get(t);if(!i)return!0;let a=i.get(`${n}`);return!a||r.every(e=>{for(let t of a.values())if(t[e]===!1)return!1;return!0})}_initUpdateRowColInfoCache(){this.disposeWithMe(this._permissionService.permissionPointUpdate$.pipe(Ls(e=>e.type===ra.SelectRange),os(e=>e)).subscribe({next:e=>{let{subUnitId:t,unitId:n,permissionId:r}=e,i=this._permissionIdCache.get(r);if(!i)return;let a=this._ruleModel.getRule(n,t,i);if(!a)return;let o=this._ensureRowColInfoMap(n,t,`row`),s=this._ensureRowColInfoMap(n,t,`col`),c=this._getSelectionActions(n,t,a);a.ranges.forEach(e=>{let{startRow:t,endRow:n,startColumn:r,endColumn:a}=e;for(let e=t;e<=n;e++){let t=o.get(`${e}`);t?t.set(i,c):o.set(`${e}`,new Map([[i,c]]));for(let e=r;e<=a;e++){let t=s.get(`${e}`);t?t.set(i,c):s.set(`${e}`,new Map([[i,c]]))}}})}})),this.disposeWithMe(this._ruleModel.ruleChange$.subscribe(e=>{if(e.type===`delete`){let{unitId:t,subUnitId:n,rule:r}=e,i=this._ensureRowColInfoMap(t,n,`row`),a=this._ensureRowColInfoMap(t,n,`col`);r.ranges.forEach(e=>{let{startRow:t,endRow:n,startColumn:o,endColumn:s}=e;for(let e=t;e<=n;e++){i.get(`${e}`)?.delete(r.id);for(let e=o;e<=s;e++)a.get(`${e}`)?.delete(r.id)}})}}))}getCellInfo(e,t,n,r){var i;let a=this._ensureCellInfoMap(e,t),o=a.get(`${n}-${r}`);if(o)return o;let s=(i=this._cellRuleCache.get(e))==null||(i=i.get(t))==null?void 0:i.get(`${n}-${r}`);if(!s)return;let c=this._ruleModel.getRule(e,t,s);if(c){let i={...this._getSelectionActions(e,t,c),ruleId:s,ranges:c.ranges};return a.set(`${n}-${r}`,i),i}}deleteUnit(e){this._cellRuleCache.delete(e),this._cellInfoCache.delete(e),this._rowInfoCache.delete(e),this._colInfoCache.delete(e),this._univerInstanceService.getUnit(e)?.getSheets().forEach(t=>{let n=t.getSheetId();this._ruleModel.getSubunitRuleList(e,n).forEach(e=>{this._permissionIdCache.delete(e.permissionId)})})}};NZ=aK([iK(0,j(hq)),iK(1,j(ox)),iK(2,j(B))],NZ);var Gft=`@univerjs/sheets`,Kft=`0.25.1`,PZ=class extends P{constructor(e,t){super(),this._commandService=e,this._univerInstanceService=t,Z(this,`_previousSheetIndex`,-1),this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{if(e.id===aJ.id)return this._beforeAdjustActiveSheetOnRemoveSheet(e)})),this.disposeWithMe(this._commandService.onCommandExecuted((e,t)=>{if(e.id===aJ.id)return this._adjustActiveSheetOnRemoveSheet(e);if(e.id===hX.id&&e.params.hidden)return this._adjustActiveSheetOnHideSheet(e);if(t?.fromCollab)return!1;if(e.id===jY.id)return this._adjustActiveSheetOnInsertSheet(e);if(e.id===hX.id&&!e.params.hidden)return this._adjustActiveSheetOnShowSheet(e);if(e.id===Fq.id)return this._adjustActiveSheetOnSelection(e)}))}_adjustActiveSheetOnHideSheet(e){let{unitId:t,subUnitId:n}=e.params,r=this._univerInstanceService.getUniverSheetInstance(t);if(!r||r.getActiveSheet()?.getSheetId()!==n)return;let i=qft(r,r.getActiveSheetIndex());this._switchToNextSheet(t,i)}_beforeAdjustActiveSheetOnRemoveSheet(e){let{unitId:t,subUnitId:n}=e.params,r=this._univerInstanceService.getUniverSheetInstance(t);if(!r)return;let i=r.getSheetBySheetId(n);i&&(this._previousSheetIndex=r.getSheetIndex(i))}_adjustActiveSheetOnRemoveSheet(e){if(this._previousSheetIndex===-1)return;let{unitId:t}=e.params,n=this._univerInstanceService.getUniverSheetInstance(t);if(n&&n.getActiveSheet().getSheetId()===e.params.subUnitId){let e=this._previousSheetIndex,r=qft(n,e>=1?e-1:0);this._switchToNextSheet(t,r)}}_adjustActiveSheetOnInsertSheet(e){let{unitId:t,sheet:n}=e.params;this._switchToNextSheet(t,n.id)}_adjustActiveSheetOnShowSheet(e){let{unitId:t,subUnitId:n}=e.params;this._switchToNextSheet(t,n)}_adjustActiveSheetOnSelection(e){let{unitId:t,subUnitId:n}=e.params;n!==this._univerInstanceService.getUnit(t)?.getActiveSheet().getSheetId()&&this._switchToNextSheet(t,n)}_switchToNextSheet(e,t){this._commandService.executeCommand($K.id,{unitId:e,subUnitId:t})}};PZ=aK([iK(0,R),iK(1,B)],PZ);function qft(e,t){let n=e.getSheetSize();for(let n=t;n>-1;n--){let t=e.getSheetByIndex(n);if(!t.getConfig().hidden)return t.getSheetId()}for(let r=t;r<n;r++){let t=e.getSheetByIndex(r);if(!t.getConfig().hidden)return t.getSheetId()}throw Error(`[ActiveWorksheetController]: could not find the next unhidden sheet! Collaboration error perhaps.`)}var Jft=`ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY`,FZ=class extends P{constructor(e,t,n){super(),this._commandService=e,this._configService=t,this._dataSyncPrimaryController=n,[RK,yK,_K,jY,bK,xK,SK,wK,CK,aJ,EK,hZ,eK,$dt,_X,mZ,DK,jft,VK,BK,xZ,SZ,Edt,KK,WK,bZ].forEach(e=>{var t;this._commandService.registerCommand(e),(t=this._dataSyncPrimaryController)==null||t.registerSyncingMutations(e)}),(this._configService.getConfig(`ONLY_REGISTER_FORMULA_RELATED_MUTATIONS_KEY`)??!1)||[FJ,IJ,LJ,RJ,Dut,Tq,DY,Eq,MY,zq,Bq,pX,lZ,Flt,Xq,Zq,Qq,Yq,Jq,Vq,Hq,Nlt,Gq,qq,Kq,Wq,Uq,FY,sJ,Iq,oJ,eJ,iJ,rJ,tJ,BY,cJ,PJ,eY,kut,$J,GY,Wdt,WY,Hdt,Udt,YY,kK,AK,mX,KY,OK,$Y,QY,eX,nY,iX,Rq,uZ,cX,aX,zK,JY,sX,qY,oX,GJ,uX,lX,QJ,iY,rY,tY,dX,fX,$K,gX,hX,vX,bX,yX,ZK,YK,dZ,XK,UK,Tft,nft,xlt,Fq,CZ,PY,zY,XY,fZ,yZ,QK,tX,jK,vZ,Cft,HJ,rX,UJ,cZ,plt,Jdt,Ndt,WJ,NY,wft,_q,gq,nX,Oft,GK,rft,Eft,hK,mK,RY,LY,kft,Fdt,Eut,Pdt,Aft,Nft,Mft,TY,Cdt,wdt,EY,IY].forEach(e=>this.disposeWithMe(this._commandService.registerCommand(e))),this._configService.setConfig(Bft,Vft)}};FZ=aK([iK(0,R),iK(1,Nm),iK(2,be(UR))],FZ);var IZ=class extends P{constructor(e,t){super(),this._univerInstanceService=e,this._commandService=t,this._initialize()}_initialize(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.id!==mB.id)return;let{unitData:t}=e.params,n=Object.keys(t),r=[];for(let e=0;e<n.length;e++){let i=n[e],a=t[i];if(a==null)continue;let o=Object.keys(a);for(let e=0;e<o.length;e++){let t=o[e],n=a[t];if(n==null)continue;let s={subUnitId:t,unitId:i,cellValue:this._getMergedCellData(i,t,n)};r.push({id:RK.id,params:s})}}return Km(r,this._commandService,{onlyLocal:!0,fromFormula:!0,applyFormulaCalculationResult:!0})}))}_getMergedCellData(e,t,n){let r=this._univerInstanceService.getUniverSheetInstance(e),i=r?.getStyles(),a=(r?.getSheetBySheetId(t))?.getCellMatrix(),o=new Rh(n);return o.forValue((e,t,n)=>{let r=X6e(a?.getValue(e,t),n,i);o.setValue(e,t,r)}),o.getMatrix()}};IZ=aK([iK(0,j(B)),iK(1,R)],IZ);var LZ=class extends P{constructor(e){super(),this._sheetInterceptorService=e,this._initialize()}_initialize(){this._initInterceptorCellContent()}_initInterceptorCellContent(){this.disposeWithMe(this._sheetInterceptorService.intercept(tK.CELL_CONTENT,{priority:11,effect:Sf.Value|Sf.Style,handler:(e,t,n)=>{var r;if(!e)return n(e);let i=t.workbook.getStyles().getStyleByCell(e);return Ch(i==null||(r=i.n)==null?void 0:r.pattern)&&e?.t===Pp.NUMBER&&e.v!==void 0&&e.v!==null&&Pg(e.v)?((!e||e===t.rawData)&&(e={...t.rawData}),e.v=pV(Number(e.v)),n(e)):n(e)}}))}};LZ=aK([iK(0,j(lK))],LZ);var RZ=class extends P{constructor(e,t,n,r){super(),this._permissionService=e,this._worksheetProtectionRuleModel=t,this._sheetInterceptorService=n,this._rangeProtectionCache=r,this._initViewModelByRangeInterceptor(),this._initViewModelBySheetInterceptor()}_initViewModelByRangeInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(tK.CELL_CONTENT,{priority:999,effect:Sf.Value|Sf.Style,handler:(e,t,n)=>{let{unitId:r,subUnitId:i,row:a,col:o}=t,s=this._rangeProtectionCache.getCellInfo(r,i,a,o);if(s){let r=s[ta.View]===!1,i=!e||e===t.rawData?{...t.rawData}:e;return i.selectionProtection=[s],r?(delete i.s,delete i.v,delete i.p,i):n(i)}return n(e)}}))}_initViewModelBySheetInterceptor(){this.disposeWithMe(this._sheetInterceptorService.intercept(tK.CELL_CONTENT,{priority:999,effect:Sf.Value|Sf.Style,handler:(e,t,n)=>{let{unitId:r,subUnitId:i}=t;if(this._worksheetProtectionRuleModel.getRule(r,i)?.permissionId){let a=[{[ta.View]:this._permissionService.getPermissionPoint(new nZ(r,i).id)?.value??!1,[ta.Edit]:this._permissionService.getPermissionPoint(new KX(r,i).id)?.value??!1}],o=!a[0]?.[ta.View],s=!e||e===t.rawData?{...e}:e;return s.hasWorksheetRule=!0,s.selectionProtection=a,o?(delete s.s,delete s.v,delete s.p,s):n(s)}return n(e)}}))}};RZ=aK([iK(0,ox),iK(1,j(VJ)),iK(2,j(lK)),iK(3,j(NZ))],RZ);var zZ=ce(`univer.exclusive-range.service`),Yft=class extends P{constructor(...e){super(...e),Z(this,`_exclusiveRanges`,new Map),Z(this,`_exclusiveRangesChange$`,new ao),Z(this,`exclusiveRangesChange$`,this._exclusiveRangesChange$.asObservable())}_ensureUnitMap(e){return this._exclusiveRanges.has(e)||this._exclusiveRanges.set(e,new Map),this._exclusiveRanges.get(e)}_ensureSubunitMap(e,t){let n=this._ensureUnitMap(e);return n.has(t)||n.set(t,new Map),n.get(t)}_ensureFeature(e,t,n){let r=this._ensureSubunitMap(e,t);return r.has(n)||r.set(n,[]),r.get(n)}addExclusiveRange(e,t,n,r){let i=this._ensureFeature(e,t,n);i.push(...r),this._exclusiveRangesChange$.next({unitId:e,subUnitId:t,ranges:i.map(e=>e.range)})}getExclusiveRanges(e,t,n){var r;return(r=this._exclusiveRanges.get(e))==null||(r=r.get(t))==null?void 0:r.get(n)}clearExclusiveRanges(e,t,n){let r=this.getExclusiveRanges(e,t,n);this._exclusiveRangesChange$.next({unitId:e,subUnitId:t,ranges:r?.map(e=>e.range)||[]}),this._ensureFeature(e,t,n),this._exclusiveRanges.get(e).get(t).set(n,[])}clearExclusiveRangesByGroupId(e,t,n,r){let i=this.getExclusiveRanges(e,t,n);this._exclusiveRangesChange$.next({unitId:e,subUnitId:t,ranges:i?.map(e=>e.range)||[]});let a=this.getExclusiveRanges(e,t,n);if(a){let i=a.filter(e=>e.groupId!==r);this._exclusiveRanges.get(e).get(t).set(n,i)}}getInterestGroupId(e){let t=[];return e.forEach(e=>{let n=e.range,{unitId:r,sheetId:i}=n;if(!r||!i)return;let a=this._exclusiveRanges.get(r)?.get(i);if(a)for(let e of a.keys()){let r=a.get(e);if(r){for(let i of r)if(d_.intersects(n,i.range)){t.push(e);break}}}}),t}},BZ=class extends P{constructor(e,t,n){super(),this._resourceManagerService=e,this._univerInstanceService=t,this._logService=n}getValue(e,t,n,r){let i=this._univerInstanceService.getUniverSheetInstance(e);if(!i)return;let a=i?.getSheetBySheetId(t);if(!a)return;let o=i.getStyles(),s=a.getCellRaw(n,r);if(s?.s){let e=o.get(s.s);if(e?.n)return e.n}return null}deleteValues(e,t,n){let r=this._univerInstanceService.getUniverSheetInstance(e);if(!r)return;let i=r?.getSheetBySheetId(t);if(!i)return;let a=r.getStyles();n.forEach(e=>{t_.foreach(e,(e,t)=>{let n=i.getCellRaw(e,t);if(!n)return;let r=n?.s,o={...r&&a.get(r)||{}};delete o.n,n.s=a.setValue(o)})})}setValues(e,t,n){let r=this._univerInstanceService.getUniverSheetInstance(e);if(!r)return;let i=r?.getSheetBySheetId(t);if(!i)return;let a=r.getStyles(),o=i.getCellMatrix();n.forEach(e=>{e.ranges.forEach(t=>{t_.foreach(t,(t,n)=>{let r=i.getCellRaw(t,n);if(r){let t={...a.getStyleByCell(r)||{},n:{pattern:e.pattern}};r.s=a.setValue(t)}else{let r={n:{pattern:e.pattern}},i=a.setValue(r);i&&o.setValue(t,n,{s:i})}})})})}};BZ=aK([iK(0,By),iK(1,B),iK(2,Rm)],BZ);var Xft=[yK.id,_K.id,wK.id,CK.id],Zft=[xK.id,SK.id],VZ=class extends P{constructor(e,t,n,r,i,a,o,s){super(),this._selectionProtectionRuleModel=e,this._univerInstanceService=t,this._commandService=n,this._refRangeService=r,this._selectionProtectionRenderModel=i,this._rangeProtectionCache=a,this._sheetInterceptorService=o,this._rangeProtectionRuleModel=s,Z(this,`disposableCollection`,new Gf),this._onRefRangeChange(),this._correctPermissionRange(),this._initReBuildCache(),this._initRemoveSheet()}_onRefRangeChange(){let e=(e,t)=>{let n=this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET);if(!n||!n?.getSheetBySheetId(t))return;this.disposableCollection.dispose();let r=n=>this.refRangeHandle(n,e,t);this._selectionProtectionRuleModel.getSubunitRuleList(e,t).reduce((e,t)=>[...e,...t.ranges],[]).forEach(n=>{this.disposableCollection.add(this._refRangeService.registerRefRange(n,r,e,t))})};this.disposeWithMe(this._commandService.onCommandExecuted(t=>{if(t.id===fX.id){let n=t.params,r=n.subUnitId,i=n.unitId;if(!r||!i)return;e(i,r)}if(t.id===nX.id||t.id===_q.id){let n=t.params,r=n.subUnitId,i=n.unitId;if(!r||!i)return;e(i,r)}}));let t=this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET);if(t){let n=t.getActiveSheet();if(!n)return;e(t.getUnitId(),n.getSheetId())}}refRangeHandle(e,t,n){switch(e.id){case oJ.id:return this._getRefRangeMutationsByMoveRows(e.params,t,n);case sJ.id:return this._getRefRangeMutationsByMoveCols(e.params,t,n);case Uq.id:return this._getRefRangeMutationsByInsertRows(e.params,t,n);case Jq.id:return this._getRefRangeMutationsByInsertCols(e.params,t,n);case iJ.id:return this._getRefRangeMutationsByDeleteCols(e.params,t,n);case tJ.id:return this._getRefRangeMutationsByDeleteRows(e.params,t,n)}return{redos:[],undos:[]}}_getRefRangeMutationsByDeleteCols(e,t,n){let r=this._selectionProtectionRuleModel.getSubunitRuleList(t,n).filter(t=>t.ranges.some(t=>d_.intersects(t,e.range))),i=e.range;if(r.length){let e=[],a=[];return r.forEach(r=>{let o=F.deepClone(r);o.ranges=o.ranges.reduce((e,t)=>{if(d_.intersects(t,i)){let n=F.deepClone(t),{startColumn:r,endColumn:a}=i;if(r<=n.startColumn&&a>=n.endColumn)return e;r>=n.startColumn&&a<=n.endColumn?n.endColumn-=a-r+1:r<n.startColumn?(n.startColumn=r,n.endColumn-=a-r+1):a>n.endColumn&&(n.endColumn=r-1),this._checkIsRightRange(n)&&e.push(n)}return e},[]),o.ranges.length?(e.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:o,ruleId:r.id}}),a.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:r,ruleId:r.id}})):(e.push({id:gq.id,params:{unitId:t,subUnitId:n,ruleIds:[r.id]}}),a.push({id:_q.id,params:{unitId:t,subUnitId:n,name:``,rules:[r]}}))}),{redos:e,undos:a}}return{undos:[],redos:[]}}_getRefRangeMutationsByDeleteRows(e,t,n){let r=this._selectionProtectionRuleModel.getSubunitRuleList(t,n).filter(t=>t.ranges.some(t=>d_.intersects(t,e.range))),i=e.range;if(r.length){let e=[],a=[];return r.forEach(r=>{let o=F.deepClone(r);o.ranges=o.ranges.reduce((e,t)=>{if(d_.intersects(t,i)){let n=F.deepClone(t),{startRow:r,endRow:a}=i;if(r<=n.startRow&&a>=n.endRow)return e;r>=n.startRow&&a<=n.endRow?n.endRow-=a-r+1:r<n.startRow?(n.startRow=r,n.endRow-=a-r+1):a>n.endRow&&(n.endRow=r-1),this._checkIsRightRange(n)&&e.push(n)}return e},[]),e.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:o,ruleId:r.id}}),a.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:r,ruleId:r.id}})}),{redos:e,undos:a}}return{undos:[],redos:[]}}_getRefRangeMutationsByInsertCols(e,t,n){let r=e.range.startColumn,i=e.range.endColumn-e.range.startColumn+1,a=this._selectionProtectionRuleModel.getSubunitRuleList(t,n).filter(e=>e.ranges.some(e=>r>e.startColumn&&r<=e.endColumn));if(a.length){let e=[],o=[];return a.forEach(a=>{let s=F.deepClone(a),c=!1;s.ranges.forEach(e=>{r>e.startColumn&&r<=e.endColumn&&(e.endColumn+=i,c=!0)}),c&&(e.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:s,ruleId:a.id}}),o.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:a,ruleId:a.id}}))}),{redos:e,undos:o}}return{undos:[],redos:[]}}_getRefRangeMutationsByInsertRows(e,t,n){let r=e.range.startRow,i=e.range.endRow-e.range.startRow+1,a=this._selectionProtectionRuleModel.getSubunitRuleList(t,n).filter(e=>e.ranges.some(e=>r>e.startRow&&r<=e.endRow));if(a.length){let e=[],o=[];return a.forEach(a=>{let s=F.deepClone(a),c=!1;s.ranges.forEach(e=>{r>e.startRow&&r<=e.endRow&&(e.endRow+=i,c=!0)}),c&&(e.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:s,ruleId:a.id}}),o.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:a,ruleId:a.id}}))}),{redos:e,undos:o}}return{undos:[],redos:[]}}_getRefRangeMutationsByMoveRows(e,t,n){let r=e.toRange,i=r.startRow,a=r.endRow-r.startRow+1,o=this._selectionProtectionRuleModel.getSubunitRuleList(t,n).filter(e=>e.ranges.some(e=>i>e.startRow&&i<=e.endRow));if(o.length){let r=[],s=[];return o.forEach(o=>{let c=F.deepClone(o),l=e.fromRange.startRow,u=!1;c.ranges.forEach(e=>{i>e.startRow&&i<=e.endRow&&(l<e.startRow&&(e.startRow-=a,e.endRow-=a),e.endRow+=a,u=!0)}),u&&(r.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:c,ruleId:o.id}}),s.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:o,ruleId:o.id}}))}),{redos:r,undos:s}}return{undos:[],redos:[]}}_getRefRangeMutationsByMoveCols(e,t,n){let r=e.toRange,i=r.startColumn,a=r.endColumn-r.startColumn+1,o=this._selectionProtectionRuleModel.getSubunitRuleList(t,n).filter(e=>e.ranges.some(e=>i>e.startColumn&&i<=e.endColumn));if(o.length){let r=[],s=[];return o.forEach(o=>{let c=F.deepClone(o),l=e.fromRange.startColumn,u=!1;c.ranges.forEach(e=>{i>e.startColumn&&i<=e.endColumn&&(l<e.startColumn&&(e.startColumn-=a,e.endColumn-=a),e.endColumn+=a,u=!0)}),u&&(r.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:c,ruleId:o.id}}),s.push({id:nX.id,params:{unitId:t,subUnitId:n,rule:o,ruleId:o.id}}))}),{redos:r,undos:s}}return{undos:[],redos:[]}}_correctPermissionRange(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(Zft.includes(e.id)){if(!e.params)return;let t=this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET);if(!t)return;let n=t.getSheetBySheetId(e.params.subUnitId);if(!n)return;let{sourceRange:r,targetRange:i}=e.params,a=r.startColumn===i.startColumn&&r.endColumn===i.endColumn,o=a?r.endRow-r.startRow+1:r.endColumn-r.startColumn+1,s=a?r.startRow:r.startColumn,c=a?i.startRow:i.startColumn;this._selectionProtectionRuleModel.getSubunitRuleList(t.getUnitId(),n.getSheetId()).forEach(e=>{e.ranges.forEach(e=>{let{startRow:t,endRow:n,startColumn:i,endColumn:l}=e;d_.intersects(e,r)||(a?s<t&&c>n?(t-=o,n-=o):s>n&&c<=t&&(t+=o,n+=o):s<i&&c>l?(i-=o,l-=o):s>l&&c<=i&&(i+=o,l+=o)),this._checkIsRightRange({startRow:t,endRow:n,startColumn:i,endColumn:l})&&(e.startColumn=i,e.endColumn=l,e.startRow=t,e.endRow=n)})}),this.disposableCollection.dispose();let{unitId:l,subUnitId:u}=e.params,d=e=>this.refRangeHandle(e,l,u);this._selectionProtectionRuleModel.getSubunitRuleList(l,u).reduce((e,t)=>[...e,...t.ranges],[]).forEach(e=>{this.disposableCollection.add(this._refRangeService.registerRefRange(e,d,l,u))}),this._selectionProtectionRenderModel.clear()}if(Xft.includes(e.id)){let t=this._univerInstanceService.getUniverSheetInstance(e.params.unitId);if(!t)return;let n=t.getSheetBySheetId(e.params.subUnitId);if(!n)return;let r=e.params;if(!r)return;let{range:i}=r,a=e.id.includes(`row`),o=e.id.includes(`insert`),s=a?i.startRow:i.startColumn,c=a?i.endRow:i.endColumn,l=c-s+1;this._selectionProtectionRuleModel.getSubunitRuleList(t.getUnitId(),n.getSheetId()).forEach(e=>{e.ranges.forEach(e=>{let{startRow:t,endRow:n,startColumn:r,endColumn:i}=e;o?a?s<=t&&(t+=l,n+=l):s<=r&&(r+=l,i+=l):a?c<t&&(t-=l,n-=l):c<r&&(r-=l,i-=l),this._checkIsRightRange({startRow:t,endRow:n,startColumn:r,endColumn:i})&&(e.startColumn=r,e.endColumn=i,e.startRow=t,e.endRow=n)})}),this.disposableCollection.dispose();let{unitId:u,subUnitId:d}=e.params,f=e=>this.refRangeHandle(e,u,d);this._selectionProtectionRuleModel.getSubunitRuleList(u,d).reduce((e,t)=>[...e,...t.ranges],[]).forEach(e=>{this.disposableCollection.add(this._refRangeService.registerRefRange(e,f,u,d))}),this._selectionProtectionRenderModel.clear()}}))}_checkIsRightRange(e){return e.startRow<=e.endRow&&e.startColumn<=e.endColumn}_initReBuildCache(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(Xft.includes(e.id)||Zft.includes(e.id)){let{unitId:t,subUnitId:n}=e.params;this._rangeProtectionCache.reBuildCache(t,n)}}))}_initRemoveSheet(){this._sheetInterceptorService.interceptCommand({getMutations:e=>{let t=[],n=[],r=[],i=[];if(e.id===BY.id){let n=e.params,i=[],a=[];this._rangeProtectionRuleModel.getSubunitRuleList(n.unitId,n.subUnitId).forEach(e=>{i.push(e.id),a.push(e)}),i.length&&a.length&&(r.push({id:gq.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,ruleIds:i}}),t.push({id:_q.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,name:``,rules:a}}))}return{redos:n,undos:t,preRedos:r,preUndos:i}}})}};VZ=aK([iK(0,j(hq)),iK(1,j(B)),iK(2,R),iK(3,j(kJ)),iK(4,j(MZ)),iK(5,j(NZ)),iK(6,j(lK)),iK(7,j(hq))],VZ);var Qft=`SHEET_RANGE_PROTECTION_PLUGIN`,HZ=class extends P{constructor(e,t,n,r,i){super(),this._selectionProtectionRuleModel=e,this._permissionService=t,this._resourceManagerService=n,this._selectionProtectionCache=r,this._univerInstanceService=i,this._initSnapshot(),this._initRuleChange()}_initRuleChange(){this.disposeWithMe(this._selectionProtectionRuleModel.ruleChange$.subscribe(e=>{switch(e.type){case`add`:EX().forEach(t=>{let n=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.addPermissionPoint(n)});break;case`delete`:EX().forEach(t=>{let n=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.deletePermissionPoint(n.id)});break;case`set`:e.oldRule.permissionId!==e.rule.permissionId&&EX().forEach(t=>{let n=new t(e.unitId,e.subUnitId,e.oldRule.permissionId);this._permissionService.deletePermissionPoint(n.id);let r=new t(e.unitId,e.subUnitId,e.rule.permissionId);this._permissionService.addPermissionPoint(r)})}}))}_initSnapshot(){this.disposeWithMe(this._resourceManagerService.registerPluginResource({toJson:e=>{let t=this._selectionProtectionRuleModel.toObject()[e];return t?JSON.stringify(t):``},parseJson:e=>{if(!e)return{};try{return JSON.parse(e)}catch{return{}}},pluginName:Qft,businesses:[M.UNIVER_SHEET],onLoad:(e,t)=>{let n=this._selectionProtectionRuleModel.toObject();n[e]=t,this._selectionProtectionRuleModel.fromObject(n);let r=[];Object.keys(t).forEach(n=>{let i=t[n];this._selectionProtectionRuleModel.getSubunitRuleList(e,n).forEach(t=>{r.push({objectID:t.permissionId,unitID:e,objectType:ra.SelectRange,actions:DX})}),i.forEach(t=>{EX().forEach(r=>{let i=new r(e,n,t.permissionId);i.value=!1,this._permissionService.addPermissionPoint(i)})}),this._selectionProtectionCache.reBuildCache(e,n)})},onUnLoad:e=>{this._selectionProtectionCache.deleteUnit(e)}}))}};HZ=aK([iK(0,j(hq)),iK(1,j(ox)),iK(2,j(By)),iK(3,j(NZ)),iK(4,j(B))],HZ);var UZ=class extends P{constructor(e){super(),this._sheetRangeThemeModel=e}registerRangeTheme(e,t){this._sheetRangeThemeModel.registerRangeThemeStyle(e,t)}removeRangeThemeRule(e,t){this._sheetRangeThemeModel.removeRangeThemeRule(e,t)}getALLRegisterThemes(e){return this._sheetRangeThemeModel.getALLRegisteredTheme(e)}registerRangeThemeStyle(e,t){this._sheetRangeThemeModel.registerRangeThemeRule(e,t)}getAppliedRangeThemeStyle(e){return this._sheetRangeThemeModel.getRegisteredRangeThemeStyle(e)}getRegisteredRangeThemes(){return this._sheetRangeThemeModel.getRegisteredRangeThemes()}};UZ=aK([iK(0,j(pK))],UZ);var WZ=class extends dx{constructor(e=Tdt,t,n){super(),this._config=e,this._injector=t,this._configService=n;let{...r}=Qi({},Tdt,this._config);this._configService.setConfig(OY,r),this._initConfig(),this._initDependencies()}_initConfig(){this._config?.onlyRegisterFormulaRelatedMutations&&this._configService.setConfig(Jft,!0),this._config?.isRowStylePrecedeColumnStyle&&this._configService.setConfig(of,!0),this._config?.autoHeightForMergedCells&&this._configService.setConfig(sf,!0)}_initDependencies(){let e=[[VY],[AY],[yq],[kJ],[kZ],[pZ,{useClass:BZ}],[lK],[UZ],[Sq],[FZ],[jJ],[LZ],[EZ],[jZ],[DZ],[sZ],[VJ],[xX],[RZ],[AZ],[OZ],[pK],[MZ],[hq],[NZ],[VZ],[HZ],[zZ,{useClass:Yft,deps:[yq]}],[wY,{useClass:CY}],[wZ]];this._config?.notExecuteFormula||e.push([IZ]),df(this._injector,cx(e,this._config.override)),ff(this._injector,[[lK],[HZ],[zZ],[AZ],[DZ]])}onStarting(){ff(this._injector,[[FZ],[jJ],[kZ],[sZ],[RZ],[Sq],[wZ]]),this._config?.onlyRegisterFormulaRelatedMutations||this._injector.add([PZ])}onRendered(){ff(this._injector,[[pZ]])}onReady(){ff(this._injector,[[PZ],[IZ],[EZ],[jZ],[pK],[LZ],[MZ],[VZ],[kJ],[OZ]])}};Z(WZ,`pluginName`,`SHEET_PLUGIN`),Z(WZ,`packageName`,Gft),Z(WZ,`version`,Kft),Z(WZ,`type`,M.UNIVER_SHEET),WZ=aK([px(UU),iK(1,j(We)),iK(2,Nm)],WZ);var $ft=(e,t,n,r=1,i=!0,a=!0)=>{let{startRow:o,endRow:s}=t_.transformRange(e,t),c=n.startRow-r,l=t.getMergedCell(c,n.startColumn),u=!l||l.startRow===c&&l.startColumn===n.startColumn;for(;!t.getRowVisible(c)||!u;)c--,l=t.getMergedCell(c,n.startColumn),u=!l||l.startRow===c&&l.startColumn===n.startColumn;if(c>=o)return{...n,startRow:c,endRow:c};if(a)return tpt(e,t,{...n,startRow:s,endRow:s},r,i,!1)},ept=(e,t,n,r=1,i=!0,a=!0)=>{let{startRow:o,endRow:s}=t_.transformRange(e,t),c=n.endRow+r,l=t.getMergedCell(c,n.startColumn),u=!l||l.startRow===c&&l.startColumn===n.startColumn;for(;!t.getRowVisible(c)||!u;)c++,l=t.getMergedCell(c,n.startColumn),u=!l||l.startRow===c&&l.startColumn===n.startColumn;if(c<=s)return{...n,startRow:c,endRow:c};if(a)return npt(e,t,{...n,startRow:o,endRow:o},r,i,!1)},tpt=(e,t,n,r=1,i=!0,a=!0)=>{let{startColumn:o,endColumn:s}=t_.transformRange(e,t),c=n.startColumn-r,l=t.getMergedCell(n.startRow,c),u=!l||l.startRow===n.startRow&&l.startColumn===c;for(;!t.getColVisible(c)||!u;)c--,l=t.getMergedCell(n.startRow,c),u=!l||l.startRow===n.startRow&&l.startColumn===c;if(c>=o)return{...n,startColumn:c,endColumn:c};if(a)return $ft(e,t,{...n,startColumn:s,endColumn:s},r,i,!1)},npt=(e,t,n,r=1,i=!0,a=!0)=>{let{startColumn:o,endColumn:s}=t_.transformRange(e,t),c=n.endColumn+r,l=t.getMergedCell(n.startRow,c),u=!l||l.startRow===n.startRow&&l.startColumn===c;for(;!t.getColVisible(c)||!u;)c++,l=t.getMergedCell(n.startRow,c),u=!l||l.startRow===n.startRow&&l.startColumn===c;if(c<=s)return{...n,endColumn:c,startColumn:c};if(a)return ept(e,t,{...n,startColumn:o,endColumn:o},r,i,!1)};function GZ(e,t,n){let r=null;return n.getMatrixWithMergedCells(e,t,e,t).forValue((e,t,n)=>(r={actualRow:e,actualColumn:t,startRow:e,startColumn:t,isMerged:n.rowSpan!==void 0||n.colSpan!==void 0,isMergedMainCell:n.rowSpan!==void 0&&n.colSpan!==void 0,endRow:e+(n.rowSpan===void 0?0:n.rowSpan-1),endColumn:t+(n.colSpan===void 0?0:n.colSpan-1),rangeType:z.NORMAL},!1)),r||{actualColumn:t,actualRow:e,startRow:e,startColumn:t,endRow:e,endColumn:t,isMerged:!1,isMergedMainCell:!1,rangeType:z.NORMAL}}var rpt=(e,t,n,r,i=1)=>{switch(r){case I.UP:return $ft(e,t,n,i);case I.DOWN:return ept(e,t,n,i);case I.LEFT:return tpt(e,t,n,i);case I.RIGHT:return npt(e,t,n,i)}},ipt=(e,t,n)=>{let r,i=-1,a;for(let t=0;t<e.length;t++)if(e[t].primary){r=e[t],i=t,a=r.primary;break}if(i===-1)return null;let o=t===I.LEFT||t===I.UP,s=e[o?i-1>=0?i-1:e.length-1:i+1<e.length?i+1:0];if(!r||!a)return null;let c={...a},{startRow:l,startColumn:u,endRow:d,endColumn:f}=r.range,p=o?c.startRow===l&&c.startColumn===u:c.endRow===d&&c.endColumn===f,m=p&&o;if(!d_.equals(r.range,c)){let e=p?s.range:rpt(r.range,n,c,t);if(!e)return null;let i=m?GZ(e.endRow,e.endColumn,n):GZ(e.startRow,e.startColumn,n);return{startRow:i.startRow,startColumn:i.startColumn,endRow:i.endRow,endColumn:i.endColumn}}let h=m?GZ(s.range.endRow,s.range.endColumn,n):GZ(s.range.startRow,s.range.startColumn,n);return{startRow:h.startRow,startColumn:h.startColumn,endRow:h.endRow,endColumn:h.endColumn}};function KZ(e,t){let{startRow:n,startColumn:r,endRow:i,endColumn:a,rangeType:o}=t,s=i<n?i:n,c=i<n?n:i,l=a<r?a:r,u=a<r?r:a,d=e.getNoMergeCellWithCoordByIndex(s,l),f=e.getNoMergeCellWithCoordByIndex(c,u);return{startRow:n,startColumn:r,endRow:i,endColumn:a,rangeType:o,startY:d?.startY||0,endY:f?.endY||0,startX:d?.startX||0,endX:f?.endX||0}}function qZ(e,t){let{range:n,primary:r,style:i}=e;return{rangeWithCoord:KZ(t,n),primaryWithCoord:r&&JZ(t,r),style:i}}function JZ(e,t){let{actualRow:n,actualColumn:r,isMerged:i,isMergedMainCell:a,startRow:o,startColumn:s,endRow:c,endColumn:l}=t,u=e.getNoMergeCellWithCoordByIndex(n,r),d=e.getNoMergeCellWithCoordByIndex(o,s),f=e.getNoMergeCellWithCoordByIndex(c,l);return{actualRow:n,actualColumn:r,isMerged:i,isMergedMainCell:a,startX:u.startX,startY:u.startY,endX:u.endX,endY:u.endY,mergeInfo:{startRow:o,startColumn:s,endRow:c,endColumn:l,startY:d?.startY||0,endY:f?.endY||0,startX:d?.startX||0,endX:f?.endX||0}}}function apt(e,t,n,r){let{from:i,to:a}=n,{column:o,columnOffset:s,row:c,rowOffset:l}=i,{column:u,columnOffset:d,row:f,rowOffset:p}=a,m=KZ(r,{startColumn:o,endColumn:o,startRow:c,endRow:c}),h=KZ(r,{startColumn:u,endColumn:u,startRow:f,endRow:f}),{startX:g,startY:_}=m,{startX:v,startY:y}=h,b=Tw(g+s,1),x=Tw(_+l,1),S=Tw(v+d-b,1),C=Tw(y+p-x,1);return m.startX===h.endX&&(S=0),m.startY===h.endY&&(C=0),{unitId:e,subUnitId:t,left:b,top:x,width:S,height:C}}function opt(e,t,n,r,i,a){let{column:o,columnOffset:s,row:c,rowOffset:l}=n,{startX:u,startY:d}=KZ(a,{startColumn:o,endColumn:o,startRow:c,endRow:c}),f=Tw(u+s,1),p=Tw(d+l,1),m=a.getCellIndexAndOffsetByPosition(f+r,p+i);return{unitId:e,subUnitId:t,sheetTransform:{from:{column:o,columnOffset:s,row:c,rowOffset:l},to:m},transform:{left:f,top:p,width:r,height:i}}}var spt={id:`formula.command.insert-function`,type:L.COMMAND,handler:async(e,t)=>{let{list:n,listOfRangeHasNumber:r}=t,i=e.get(R),a=new Rh;n.forEach(e=>{let{range:t,primary:n,formula:r}=e,{row:i,column:o}=n,s=ip(6);a.setValue(i,o,{f:r,si:s});let{startRow:c,startColumn:l,endRow:u,endColumn:d}=t;for(let e=c;e<=u;e++)for(let t=l;t<=d;t++)(e!==i||t!==o)&&a.setValue(e,t,{si:s})}),r&&r.length>0&&r.forEach(e=>{let{primary:t,formula:n}=e;a.setValue(t.row,t.column,{f:n})});let o={value:a.getData()};return i.executeCommand(Rq.id,o)}},cpt={id:`sheets-formula.command.quick-sum`,type:L.COMMAND,handler:async e=>{let t=e.get(yq).getCurrentLastSelection();if(!t)return!1;let n=ZG(e.get(B));if(!n)return!1;let r=t.range,{worksheet:i}=n,a=clt(r,i);if(!a)return!1;a=Dq(a,i);let o=rq({startRow:a.startRow,startColumn:a.startColumn,endRow:r.endRow,endColumn:r.endColumn},{left:!0,right:!0,up:!0,down:!0},i),s=new Rh,c=Dq({startRow:o.endRow,endRow:o.endRow,startColumn:o.startColumn,endColumn:o.endColumn},i);if(!d_.equals(c,o))for(let e of i.iterateByColumn(c))(!e.value||!i.cellHasValue(e.value))&&s.setValue(e.row,e.col,{f:`=SUM(${Hz({startColumn:e.col,endColumn:e.col,startRow:o.startRow,endRow:e.row-1})})`});let l=Dq({startRow:o.startRow,startColumn:o.endColumn,endRow:o.endRow,endColumn:o.endColumn},i);if(!d_.equals(l,o))for(let e of i.iterateByRow(l))(!e.value||!i.cellHasValue(e.value))&&s.setValue(e.row,e.col,{f:`=SUM(${Hz({startColumn:o.startColumn,endColumn:e.col-1,startRow:e.row,endRow:e.row})})`});let u=e.get(R);return(await qm([{id:Rq.id,params:{range:o,value:s.getMatrix()}},{id:Fq.id,params:{unitId:n.unitId,subUnitId:n.subUnitId,selections:[{range:o,primary:d_.contains(o,t.primary)?t.primary:{...a,actualRow:a.startRow,actualColumn:a.startColumn},style:null}]}}],u)).result}},YZ=`sheets-formula.base.config`,lpt=function(e){return e[e.FORCED=0]=`FORCED`,e[e.WHEN_EMPTY=1]=`WHEN_EMPTY`,e[e.NO_CALCULATION=2]=`NO_CALCULATION`,e}({}),upt={},dpt=`sheets-formula.remote.config`,fpt={};function XZ(e,t){return function(n,r){t(n,r,e)}}function ZZ(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var QZ=class extends P{constructor(e,t){super(),this._autoFillService=e,this._lexerTreeBuilder=t,this._registerAutoFill()}_registerAutoFill(){let e={type:rdt.FORMULA,priority:1001,match:e=>Uh(e?.f)||Wh(e?.si),isContinue:(e,t)=>e.type===rdt.FORMULA,applyFunctions:{[mY.COPY]:(e,t,n,r,i)=>{let{data:a,index:o}=e;return this._fillCopyFormula(a,t,n,o,r,i)}}};this._autoFillService.registerRule(e)}_fillCopyFormula(e,t,n,r,i,a){let o=mpt(i),s=[],c=new Map;for(let i=1;i<=t;i++){let l=(i-1)%e.length,u=r[l],d=F.deepClone(e[l]);if(d){let r=e[l]?.f||``,i=e[l]?.si||``,f=Uh(r);if(Wh(i))d.si=i,d.f=null,d.v=null,d.p=null,d.t=null,s.push(d);else if(f){let e=c.get(l);if(e)d.si=e,d.f=null,d.v=null,d.p=null,d.t=null;else{e=ip(6),c.set(l,e);let{offsetX:i,offsetY:s}=ppt(o,t,n,a,u),f=this._lexerTreeBuilder.moveFormulaRefOffset(r,i,s);d.si=e,d.f=f,d.v=null,d.p=null,d.t=null}s.push(d)}}}return s}};QZ=ZZ([XZ(0,wY),XZ(1,j(qB))],QZ);function ppt(e,t,n,r,i){let{source:a,target:o}=r,{rows:s}=o,{rows:c}=a,l=0,u=0;switch(n){case I.UP:u=s[i]-c[i];break;case I.RIGHT:l=e;break;case I.DOWN:u=s[i]-c[i];break;case I.LEFT:l=-e*t}return{offsetX:l,offsetY:u}}function mpt(e){let t=0;for(let n in e)e[n].forEach(e=>{t+=e.data.length});return t}function $Z(e){"@babel/helpers - typeof";return $Z=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},$Z(e)}function hpt(e,t){if($Z(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if($Z(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function gpt(e){var t=hpt(e,`string`);return $Z(t)==`symbol`?t:t+``}function eQ(e,t,n){return(t=gpt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var _pt={id:0,initialized:!1,started:!1,progress:null,stopped:!1,completed:!1,resultEmitted:!1,resultApplied:!0},tQ=class extends P{constructor(...e){super(...e),eQ(this,`_state$`,new so(_pt)),eQ(this,`_resultApplied$`,new ao),eQ(this,`_currentResult`,null),eQ(this,`_hasEmittedCurrentResultApplied`,!1),eQ(this,`state$`,this._state$.asObservable()),eQ(this,`resultApplied$`,this._resultApplied$.asObservable())}get state(){return this._state$.getValue()}dispose(){super.dispose(),this._state$.complete(),this._resultApplied$.complete()}initialize(){this._emit({...this.state,initialized:!0})}start(){this._emit({id:this.state.id+1,initialized:this.state.initialized,started:!0,progress:null,stopped:!1,completed:!1,resultEmitted:!1,resultApplied:!1}),this._currentResult=null,this._hasEmittedCurrentResultApplied=!1}updateProgress(e){this.state.started||this.start();let t=(e.stage===IV.START_CALCULATION||e.stage===IV.START_CALCULATION_ARRAY_FORMULA)&&e.totalFormulasToCalculate+e.totalArrayFormulasToCalculate===0;this._emit({...this.state,progress:e,completed:this.state.completed||e.stage===IV.CALCULATION_COMPLETED||t,resultApplied:this.state.resultApplied||t})}markStopped(){this._emit({...this.state,stopped:!0,completed:!0,resultApplied:!0})}markCompleted(e){let t=e===LV.NOT_EXECUTED||e===LV.INITIAL;this._emit({...this.state,stopped:e===LV.STOP_EXECUTION,completed:e!==LV.INITIAL,resultApplied:this.state.resultApplied||t||e===LV.STOP_EXECUTION})}markResultEmitted(e,t){this._currentResult!==e&&(this._hasEmittedCurrentResultApplied=!1),this._currentResult=e;let n=this.state.resultApplied||!t;this._emit({...this.state,resultEmitted:!0,resultApplied:n}),n&&this._emitResultApplied()}markResultApplied(){this._emit({...this.state,resultApplied:!0}),this._emitResultApplied()}waitForLatestApplied(e,t=500){let n=this.state,r=n.id,i=!n.initialized,a=n.started&&!this._isAppliedTerminalState(n);return new Promise((n,o)=>{let s=!1,c=null,l=null,u=null,d=()=>{u!=null&&(clearTimeout(u),u=null),g(),l!=null&&(clearTimeout(l),l=null),v.unsubscribe()},f=()=>{s||(s=!0,d(),n())},p=e=>{s||(s=!0,d(),o(e))},m=e=>{if(!this._isAppliedTerminalState(e))return;let t=e.id;c=t;let n=()=>{!s&&c===t&&this.state.id===t&&this._isAppliedTerminalState(this.state)&&f()};if(e.stopped&&!e.resultEmitted){l!=null&&clearTimeout(l),l=setTimeout(n,0);return}Promise.resolve().then(n)};e!=null&&(u=setTimeout(()=>{p(Error(`Calculation end timeout`))},e));let h=null,g=()=>{h!=null&&(clearTimeout(h),h=null)},_=()=>{g(),h=setTimeout(()=>{this.state.id===r&&!a&&f()},t)};!a&&!i&&_();let v=this.state$.subscribe(e=>{if((e.id!==r||a)&&g(),i&&e.initialized&&e.id===r&&!e.started){_();return}(e.id!==r||a)&&(c!==e.id&&(c=null),l!=null&&c!==e.id&&(clearTimeout(l),l=null),m(e))});a&&m(this.state)})}_emit(e){this._state$.next(e)}_emitResultApplied(){this._currentResult==null||this._hasEmittedCurrentResultApplied||(this._hasEmittedCurrentResultApplied=!0,this._resultApplied$.next(this._currentResult))}_isAppliedTerminalState(e){return!e.started||!e.resultApplied?!1:e.stopped||e.completed||e.resultEmitted}},nQ=class extends P{constructor(e,t){super(),this._commandService=e,this._sessionService=t,this._sessionService.initialize(),this._initialize()}_initialize(){this.disposeWithMe(this._commandService.onCommandExecuted((e,t)=>{if(e.id===cB.id){this._sessionService.start();return}if(e.id===pB.id){let t=e.params;t.stageInfo!=null&&this._sessionService.updateProgress(t.stageInfo),t.functionsExecutedState!==void 0&&this._sessionService.markCompleted(t.functionsExecutedState);return}if(e.id===mB.id){let t=e.params;this._sessionService.markResultEmitted(t,this._hasFormulaResultToApply(t));return}e.id===RK.id&&t?.applyFormulaCalculationResult&&this._sessionService.markResultApplied()}))}_hasFormulaResultToApply(e){let{unitData:t}=e;return Object.values(t??{}).some(e=>e!=null&&Object.values(e).some(e=>e!=null))}};nQ=ZZ([XZ(0,R),XZ(1,j(tQ))],nQ);var rQ=class extends P{constructor(e,t,n){super(),this._commandService=e,this._sheetInterceptorService=t,this._formulaDataModel=n,eQ(this,`_errorValueCell`,{v:YR.VALUE,t:Pp.STRING}),eQ(this,`_refreshRender`,void 0),this._initialize()}_initialize(){this._commandExecutedListener(),this._initInterceptorCellContent()}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(async e=>{if(e.id===wB.id){let t=e.params;if(!t)return;let{imageFormulaData:n}=t;if(!n||n.length===0)return;let r=await Promise.all(n.map(e=>this._getImageNatureSize(e))),i={};r.forEach(e=>{let{unitId:t,sheetId:n,row:r,column:a,...o}=e;i[t]||(i[t]={}),i[t][n]||(i[t][n]=new Rh),i[t][n].setValue(r,a,o)}),this._formulaDataModel.mergeUnitImageFormulaData(i),this._refreshRender()}}))}_initInterceptorCellContent(){this.disposeWithMe(this._sheetInterceptorService.intercept(tK.CELL_CONTENT,{priority:nK.CELL_IMAGE,effect:Sf.Value|Sf.Style,handler:(e,t,n)=>{var r;let{unitId:i,subUnitId:a,row:o,col:s}=t,c=this._formulaDataModel.getUnitImageFormulaData(),l=c==null||(r=c[i])==null||(r=r[a])==null?void 0:r.getValue(o,s);if(!l)return n(e);let{source:u,height:d,width:f,isErrorImage:p,imageNaturalWidth:m,imageNaturalHeight:h}=l;if(p)return n(this._errorValueCell);let g=f||m,_=d||h,v=yb(``,{}),y={unitId:i,subUnitId:a,drawingId:ip(),drawingType:um.DRAWING_IMAGE,imageSourceType:cb.URL,source:u,transform:{left:0,top:0,width:g,height:_},docTransform:{size:{width:g,height:_},positionH:{relativeFrom:nm.PAGE,posOffset:0},positionV:{relativeFrom:rm.PARAGRAPH,posOffset:0},angle:0},behindDoc:Np.FALSE,title:``,description:``,layoutType:Kp.INLINE,wrapText:Gp.BOTH_SIDES,distB:0,distL:0,distR:0,distT:0},b=Ey.drawing.add({documentDataModel:v,drawings:[y],selection:{collapsed:!0,startOffset:0,endOffset:0}});return b?(v.apply(b),n({...e,p:v.getSnapshot()})):n(this._errorValueCell)}}))}async _getImageNatureSize(e){let t=await this._getImageSize(e.source);return t.image?{...e,isErrorImage:!1,imageNaturalHeight:t.height,imageNaturalWidth:t.width}:{...e,isErrorImage:!0}}async _getImageSize(e){return new Promise(t=>{let n=new Image;n.src=e,n.onload=()=>{t({width:n.width,height:n.height,image:n})},n.onerror=()=>{t({width:0,height:0,image:null})}})}registerRefreshRenderFunction(e){this._refreshRender=e}};rQ=ZZ([XZ(0,R),XZ(1,j(lK)),XZ(2,j(JB))],rQ);var vpt={done:0,count:0},iQ={onlyLocal:!0},aQ=class extends P{_emitProgress(e){this._progress$.next({done:this._doneCalculationTaskCount,count:this._totalCalculationTaskCount,label:e})}_startProgress(){this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=1;let e=this._localeService.t(`sheets-formula.progress.analyzing`);this._emitProgress(e)}_calculateProgress(e){if(this._executionInProgressParams){let{totalFormulasToCalculate:t,completedFormulasCount:n,totalArrayFormulasToCalculate:r,completedArrayFormulasCount:i}=this._executionInProgressParams;if(this._doneCalculationTaskCount=n+i,this._totalCalculationTaskCount=t+r,this._totalCalculationTaskCount===0)return;this._emitProgress(e)}}_completeProgress(){this._doneCalculationTaskCount=this._totalCalculationTaskCount=1;let e=this._localeService.t(`sheets-formula.progress.done`);this._emitProgress(e)}clearProgress(){this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=0,this._emitProgress()}constructor(e,t,n,r,i,a,o,s){super(),this._commandService=e,this._univerInstanceService=t,this._activeDirtyManagerService=n,this._logService=r,this._configService=i,this._formulaDataModel=a,this._localeService=o,this._registerOtherFormulaService=s,eQ(this,`_waitingCommandQueue`,[]),eQ(this,`_executingDirtyData`,{forceCalculation:!1,dirtyRanges:[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtySuperTableMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{}}),eQ(this,`_setTimeoutKey`,-1),eQ(this,`_startExecutionTime`,0),eQ(this,`_totalCalculationTaskCount`,0),eQ(this,`_doneCalculationTaskCount`,0),eQ(this,`_executionInProgressParams`,null),eQ(this,`_restartCalculation`,!1),eQ(this,`_progress$`,new so(vpt)),eQ(this,`progress$`,this._progress$.asObservable()),this._commandExecutedListener(),this._initialExecuteFormulaProcessListener(),this._initialExecuteFormula(),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(M.UNIVER_SHEET).subscribe(()=>{this._initialExecuteFormula()}))}dispose(){super.dispose(),this._progress$.next(vpt),this._progress$.complete(),clearTimeout(this._setTimeoutKey)}_getCalculationMode(){return this._configService.getConfig(YZ)?.initialFormulaComputing??1}_commandExecutedListener(){this.disposeWithMe(this._commandService.beforeCommandExecuted(e=>{if(e.id===cB.id||e.id===uB.id){let t=e.params;e.id===cB.id&&(t.isCalculateTreeModel=this._configService.getConfig(`RETURN_DEPENDENCY_TREE`)||!1),t.maxIteration=this._configService.getConfig(F6e),t.rowData=this._formulaDataModel.getHiddenRowsFiltered()}})),this.disposeWithMe(this._commandService.onCommandExecuted((e,t)=>{if(this._activeDirtyManagerService.get(e.id)){if(e.id===RK.id){let n=e.params;if(t&&t.onlyLocal===!0||n.trigger===GJ.id||n.trigger===WY.id||n.trigger===Eq.id)return}this._waitingCommandQueue.push(e),clearTimeout(this._setTimeoutKey),this._setTimeoutKey=setTimeout(()=>{let e=this._generateDirty(this._waitingCommandQueue);this._executingDirtyData=this._mergeDirty(this._executingDirtyData,e),this._executionInProgressParams==null?this._commandService.executeCommand(cB.id,{...this._executingDirtyData},iQ):(this._restartCalculation=!0,this._commandService.executeCommand(fB.id,{})),this._waitingCommandQueue=[]},100)}}))}_generateDirty(e){let t=[],n={},r={},i={},a={},o={},s={},c=!1;for(let l of e){let e=this._activeDirtyManagerService.get(l.id);if(e==null)continue;let{dirtyRanges:u,dirtyNameMap:d,dirtyDefinedNameMap:f,dirtySuperTableMap:p,dirtyUnitFeatureMap:m,dirtyUnitOtherFormulaMap:h,clearDependencyTreeCache:g,forceCalculation:_=!1}=e.getDirtyData(l);u!=null&&this._mergeDirtyRanges(t,u),d!=null&&this._mergeDirtyUnitStringMap(n,d),f!=null&&this._mergeDirtyUnitStringMap(r,f),p!=null&&this._mergeDirtyUnitStringMap(i,p),m!=null&&this._mergeDirtyUnitFeatureOrOtherFormulaMap(a,m),h!=null&&this._mergeDirtyUnitFeatureOrOtherFormulaMap(o,h),g!=null&&this._mergeDirtyUnitStringMap(s,g),c||=_}return{dirtyRanges:t,dirtyNameMap:n,dirtyDefinedNameMap:r,dirtySuperTableMap:i,dirtyUnitFeatureMap:a,dirtyUnitOtherFormulaMap:o,forceCalculation:c,clearDependencyTreeCache:s}}_mergeDirty(e,t){let n=[...e.dirtyRanges,...t.dirtyRanges],r={...e.dirtyNameMap},i={...e.dirtyDefinedNameMap},a={...e.dirtySuperTableMap},o={...e.dirtyUnitFeatureMap},s={...e.dirtyUnitOtherFormulaMap},c={...e.clearDependencyTreeCache};return this._mergeDirtyUnitStringMap(r,t.dirtyNameMap),this._mergeDirtyUnitStringMap(i,t.dirtyDefinedNameMap),this._mergeDirtyUnitStringMap(a,t.dirtySuperTableMap||{}),this._mergeDirtyUnitFeatureOrOtherFormulaMap(o,t.dirtyUnitFeatureMap),this._mergeDirtyUnitFeatureOrOtherFormulaMap(s,t.dirtyUnitOtherFormulaMap),this._mergeDirtyUnitStringMap(c,t.clearDependencyTreeCache),{dirtyRanges:n,dirtyNameMap:r,dirtyDefinedNameMap:i,dirtySuperTableMap:a,dirtyUnitFeatureMap:o,dirtyUnitOtherFormulaMap:s,forceCalculation:e.forceCalculation||t.forceCalculation,clearDependencyTreeCache:c}}_mergeDirtyRanges(e,t){for(let n of t){let t=!1;for(let r of e)if(n.unitId===r.unitId&&n.sheetId===r.sheetId){let{startRow:e,startColumn:i,endRow:a,endColumn:o}=n.range,{startRow:s,startColumn:c,endRow:l,endColumn:u}=r.range;if(e===s&&i===c&&a===l&&o===u){t=!0;break}}t||e.push(n)}}_mergeDirtyUnitStringMap(e,t){Object.keys(t).forEach(n=>{e[n]??(e[n]={}),Object.keys(t[n]).forEach(r=>{t[n]?.[r]&&(e[n][r]=t[n][r])})})}_mergeDirtyUnitFeatureOrOtherFormulaMap(e,t){Object.keys(t).forEach(n=>{e[n]??(e[n]={}),Object.keys(t[n]).forEach(r=>{e[n][r]??(e[n][r]={}),Object.keys(t[n][r]).forEach(i=>{e[n][r][i]=t[n][r][i]||!1})})})}_initialExecuteFormulaProcessListener(){let e=null,t=0;this.disposeWithMe(this._commandService.onCommandExecuted(n=>{if(n.id===fB.id&&this.clearProgress(),n.id!==pB.id)return;let r=n.params;if(r.stageInfo!=null){let{stage:n}=r.stageInfo;if(n===IV.START)t===0&&(this._startExecutionTime=performance.now()),t++,e!==null&&(clearTimeout(e),e=null),e=setTimeout(()=>{e=null,this._startProgress()},1e3);else if(n===IV.CURRENTLY_CALCULATING){if(this._executionInProgressParams=r.stageInfo,e===null){let e=this._localeService.t(`sheets-formula.progress.calculating`);this._calculateProgress(e)}}else if(n===IV.START_DEPENDENCY_ARRAY_FORMULA){if(this._executionInProgressParams=r.stageInfo,e===null){let e=this._localeService.t(`sheets-formula.progress.array-analysis`);this._calculateProgress(e)}}else if(n===IV.CURRENTLY_CALCULATING_ARRAY_FORMULA&&(this._executionInProgressParams=r.stageInfo,e===null)){let e=this._localeService.t(`sheets-formula.progress.array-calculation`);this._calculateProgress(e)}}else{let n=r.functionsExecutedState,i=``;switch(t--,n){case LV.NOT_EXECUTED:i=`No tasks are being executed anymore`,this._resetExecutingDirtyData();break;case LV.STOP_EXECUTION:i=`The execution of the formula has been stopped`,t=0;break;case LV.SUCCESS:i=`Formula calculation succeeded`,(t===0||t===-1)&&(i+=`. Total time consumed: ${performance.now()-this._startExecutionTime} ms`),this._resetExecutingDirtyData();break;case LV.INITIAL:i=`Waiting for calculation`,this._resetExecutingDirtyData()}(t===0||t===-1)&&(e?(clearTimeout(e),e=null,this.clearProgress()):this._completeProgress(),t=0,this._doneCalculationTaskCount=0,this._totalCalculationTaskCount=0),n===LV.STOP_EXECUTION&&this._restartCalculation?(this._restartCalculation=!1,this._commandService.executeCommand(cB.id,{...this._executingDirtyData},iQ)):this._executionInProgressParams=null,this._logService.debug(`[TriggerCalculationController]`,i)}}))}_resetExecutingDirtyData(){this._executingDirtyData={dirtyRanges:[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtySuperTableMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},forceCalculation:!1,clearDependencyTreeCache:{}}}_initialExecuteFormula(){let e=this._getCalculationMode(),t=this._getDirtyDataByCalculationMode(e);this._commandService.executeCommand(lB.id,t,iQ),this._registerOtherFormulaService.calculateStarted$.next(!0)}_getDirtyDataByCalculationMode(e){return{forceCalculation:e===0,dirtyRanges:e===1?this._formulaDataModel.getFormulaDirtyRanges():[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtySuperTableMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{}}}};aQ=ZZ([XZ(0,R),XZ(1,B),XZ(2,VU),XZ(3,Rm),XZ(4,Nm),XZ(5,j(JB)),XZ(6,j(nx)),XZ(7,j(HU))],aQ);function ypt(e,t,n){return e==null||e[t]==null||e[t]?.[n]==null}function oQ(e,t,n){if(n){if(e&&e[t]&&e[t]?.[n])return delete e[t][n],{[t]:{[n]:null}}}else if(e&&e[t])return delete e[t],{[t]:null}}var bpt=[11,12,13,14,15,16];function xpt(e,t,n){let{type:r}=n;return bpt.includes(r)||r===17&&n.range==null?Spt(e,t):Cpt(e,t,n)}function Spt(e,t){let n=[],r=[];return Object.keys(t).forEach(i=>{let a=t[i],o=e[i];if(a==null||o==null)return!0;Object.keys(a).forEach(e=>{let t=new Rh(a[e]||{}),s=new Rh(o[e]||{}),c=new Rh,l=new Rh;if(t.forValue((e,t,n)=>{if(n==null)return!0;let r=sQ(n);r!==null&&(c.setValue(e,t,r),l.setValue(e,t,s.getValue(e,t)))}),c.getSizeOf()===0)return;let u={subUnitId:e,unitId:i,cellValue:c.getMatrix()},d={id:RK.id,params:u};r.push(d);let f={subUnitId:e,unitId:i,cellValue:l.getMatrix()},p={id:RK.id,params:f};n.push(p)})}),{undos:n,redos:r}}function Cpt(e,t,n){let{redoFormulaData:r,undoFormulaData:i}=wpt(e,t,n),a=[],o=[];return Object.keys(r).forEach(e=>{Object.keys(r[e]).forEach(t=>{if(Object.keys(r[e][t]).length!==0){let n={subUnitId:t,unitId:e,cellValue:r[e][t]},i={id:RK.id,params:n};a.push(i)}})}),Object.keys(i).forEach(e=>{Object.keys(i[e]).forEach(t=>{if(Object.keys(i[e][t]).length!==0){let n={subUnitId:t,unitId:e,cellValue:i[e][t]},r={id:RK.id,params:n};o.push(r)}})}),{undos:o,redos:a}}function wpt(e,t,n){let r={},i={},{unitId:a,sheetId:o}=n,s=n.targetUnitId??a,c=n.targetSheetId??o,l=a!==s||o!==c;return new Set([...Object.keys(e),...Object.keys(t)]).forEach(s=>{ypt(e,s,o)||new Set([...Object.keys(e[s]||{}),...Object.keys(t[s]||{})]).forEach(c=>{let u=e[s]?.[c],d=t[s]?.[c],f=new Rh(u||{}),p=new Rh(d||{}),m=[];m=l||s!==a||c!==o?Ept(p):Tpt(f,p,n);let h=Bpt(m,f,p),g=Vpt(m,f);r[s]||(r[s]={}),i[s]||(i[s]={}),r[s][c]={...r[s][c],...h},i[s][c]={...i[s][c],...g}})}),{redoFormulaData:r,undoFormulaData:i}}function Tpt(e,t,n){let{type:r,from:i,to:a,range:o}=n,s=[];return e.forValue((e,c,l)=>{if(l==null||!Upt(l))return!0;let u=Yh(e,c),d=null,f=!1;if([0,1,2].includes(r))d=Dpt(r,i,a,u);else if(o!=null){let e=Opt(u,n);d=e.newCell,f=e.isReverse}if(F.diffValue(u,d)&&!t.getValue(e,c))return!0;f?s.unshift({oldCell:u,newCell:d}):s.push({oldCell:u,newCell:d})}),s}function Ept(e){let t=[];return e.forValue((e,n,r)=>{if(r==null||!Upt(r))return!0;let i=Yh(e,n);t.push({oldCell:i,newCell:i})}),t}function Dpt(e,t,n,r){if(t==null||n==null)return null;switch(e){case 0:return kpt(t,n,r);case 1:return Apt(t,n,r);case 2:return jpt(t,n,r);default:return null}}function Opt(e,t){let{type:n,rangeFilteredRows:r}=t,i=t.range,a=null,o=!1;switch(n){case 3:a=Mpt(i,e),o=!0;break;case 4:a=Npt(i,e),o=!0;break;case 5:a=Ppt(i,e,r);break;case 6:case 17:a=Fpt(i,e);break;case 7:a=Ipt(i,e);break;case 8:a=Lpt(i,e);break;case 9:a=Rpt(i,e),o=!0;break;case 10:a=zpt(i,e),o=!0}return{newCell:a,isReverse:o}}function kpt(e,t,n){return EJ(hJ({id:lJ.MoveRangeCommandId,params:{toRange:t,fromRange:e}},n),n)}function Apt(e,t,n){return EJ(pJ({id:lJ.MoveRowsCommandId,params:{toRange:t,fromRange:e}},n),n)}function jpt(e,t,n){return EJ(mJ({id:lJ.MoveColsCommandId,params:{toRange:t,fromRange:e}},n),n)}function Mpt(e,t){return EJ(bJ({id:lJ.InsertRowCommandId,params:{range:e,unitId:``,subUnitId:``,direction:I.DOWN}},t),t)}function Npt(e,t){return EJ(xJ({id:lJ.InsertColCommandId,params:{range:e,unitId:``,subUnitId:``,direction:I.RIGHT}},t),t)}function Ppt(e,t,n){return EJ(vJ({id:lJ.RemoveRowCommandId,params:{range:e}},t,n),t)}function Fpt(e,t){return EJ(_J({id:lJ.RemoveColCommandId,params:{range:e}},t),t)}function Ipt(e,t){return EJ(wJ({id:lJ.DeleteRangeMoveLeftCommandId,params:{range:e}},t),t)}function Lpt(e,t){return EJ(TJ({id:lJ.DeleteRangeMoveUpCommandId,params:{range:e}},t),t)}function Rpt(e,t){return EJ(SJ({id:lJ.InsertRangeMoveDownCommandId,params:{range:e}},t),t)}function zpt(e,t){return EJ(CJ({id:lJ.InsertRangeMoveRightCommandId,params:{range:e}},t),t)}function Bpt(e,t,n){let r=new Rh({});for(let i=0;i<e.length;i++){let{oldCell:a,newCell:o}=e[i];if(r.getValue(a.startRow,a.startColumn)?.f||r.getValue(a.startRow,a.startColumn)?.si||r.setValue(a.startRow,a.startColumn,{f:null,si:null}),o){let e=sQ(n.getValue(a.startRow,a.startColumn)??t.getValue(a.startRow,a.startColumn));r.setValue(o.startRow,o.startColumn,e)}}return r.getMatrix()}function Vpt(e,t){let n=new Rh({});for(let r=e.length-1;r>=0;r--){let{oldCell:i,newCell:a}=e[r],o=sQ(t.getValue(i.startRow,i.startColumn));if(n.setValue(i.startRow,i.startColumn,o),a){let e=sQ(t.getValue(a.startRow,a.startColumn));n.setValue(a.startRow,a.startColumn,e??{f:null,si:null})}}return n.getMatrix()}function sQ(e){if(e===void 0)return;if(e===null)return{f:null,si:null};let{f:t,si:n,x:r=0,y:i=0}=e,a=Uh(t),o=Wh(n);if(!a&&!o)return{f:null,si:null};let s={};return o&&(s.si=n),a&&r===0&&i===0&&(s.f=t),s.f===void 0&&(s.f=null),s.si===void 0&&(s.si=null),s}function Hpt(e,t){let n=new Rh({});return new Rh(e).forValue((e,r,i)=>{let a=sQ(i);a!==void 0&&(t&&t[e]?.[r]&&(a?.f||a?.si)&&(a.v=null,a.t=null),n.setValue(e,r,a))}),n.getMatrix()}function Upt(e){let t=e?.f||``,n=e?.si||``,r=Uh(t),i=Wh(n);return!!(r||i)}function Wpt(e,t,n,r,i,a){if((i==null||i.length===0)&&(a==null||a.length===0)){if(e===n&&t===r)return!0}else if((e===i||i==null||i.length===0)&&t===a)return!0;return!1}function cQ(e,t,n=0,r=0){let i=[];for(let a=0,o=e.length;a<o;a++){let o=e[a];if(typeof o==`string`||o.nodeType!==HB.REFERENCE||t.includes(a)){i.push(o);continue}let{token:s}=o,{range:c,sheetName:l,unitId:u}=VB(s),d=d_.moveOffset(c,n,r);i.push({...o,token:Gz({range:d,unitId:u,sheetName:l})})}return i}function Gpt(e,t,n,r,i={}){let{type:a,unitId:o,sheetId:s,targetUnitId:c,targetSheetId:l,targetSheetName:u,range:d,from:f,to:p,rangeFilteredRows:m}=t,{range:h,sheetId:g,unitId:_,sheetName:v,refOffsetX:y,refOffsetY:b}=e,{preserveSheetQualifier:x=!1,inCrossSheetCutRange:S=!1}=i;if(!Wpt(o,s,n,r,_,g))return;let C=d_.moveOffset(h,y,b),w=null;if(a===0){if(f==null||p==null)return;let e=uQ(C,f),t=s_(C,f);if(t==null||e!==4)return;let n=EJ(hJ({id:lJ.MoveRangeCommandId,params:{toRange:p,fromRange:f}},t),t);if(n==null)return YR.REF;w=lQ(e,n,f,p,C,t)}else if(a===1){if(f==null||p==null)return;let e=uQ(C,f),t=s_(C,f);if(t==null&&(f.endRow<C.startRow&&p.endRow<=C.startRow||f.startRow>C.endRow&&p.startRow>C.endRow))return;t??={startRow:C.startRow,endRow:C.endRow,startColumn:C.startColumn,endColumn:C.endColumn,rangeType:z.NORMAL};let n=EJ(pJ({id:lJ.MoveRowsCommandId,params:{toRange:p,fromRange:f}},t),t);if(n==null)return YR.REF;w=lQ(e,n,f,p,C,t)}else if(a===2){if(f==null||p==null)return;let e=uQ(C,f),t=s_(C,f);if(t==null&&(f.endColumn<C.startColumn&&p.endColumn<=C.startColumn||f.startColumn>C.endColumn&&p.startColumn>C.endColumn))return;t??={startRow:C.startRow,endRow:C.endRow,startColumn:C.startColumn,endColumn:C.endColumn,rangeType:z.NORMAL};let n=EJ(mJ({id:lJ.MoveColsCommandId,params:{toRange:p,fromRange:f}},t),t);if(n==null)return YR.REF;w=lQ(e,n,f,p,C,t)}if(d!=null){if(a===3){let e=EJ(bJ({id:lJ.InsertRowCommandId,params:{range:d,unitId:``,subUnitId:``,direction:I.DOWN}},C),C);if(e==null)return;w={...C,...e}}else if(a===4){let e=EJ(xJ({id:lJ.InsertColCommandId,params:{range:d,unitId:``,subUnitId:``,direction:I.RIGHT}},C),C);if(e==null)return;w={...C,...e}}else if(a===5){let e=EJ(vJ({id:lJ.RemoveRowCommandId,params:{range:d}},C,m),C);if(e==null)return YR.REF;w={...C,...e}}else if(a===6){let e=EJ(_J({id:lJ.RemoveColCommandId,params:{range:d}},C),C);if(e==null)return YR.REF;w={...C,...e}}else if(a===7){let e=EJ(wJ({id:lJ.DeleteRangeMoveLeftCommandId,params:{range:d}},C),C);if(e==null)return YR.REF;w={...C,...e}}else if(a===8){let e=EJ(TJ({id:lJ.DeleteRangeMoveUpCommandId,params:{range:d}},C),C);if(e==null)return YR.REF;w={...C,...e}}else if(a===9){let e=EJ(SJ({id:lJ.InsertRangeMoveDownCommandId,params:{range:d}},C),C);if(e==null)return;w={...C,...e}}else if(a===10){let e=EJ(CJ({id:lJ.InsertRangeMoveRightCommandId,params:{range:d}},C),C);if(e==null)return;w={...C,...e}}}if(w==null)return;let T=a===0&&!!l&&l!==s&&!S,E=T?l:g,D=T&&u||v,O=T&&c||_,k=O==null||O.length===0||O===n;return Gz({range:w,sheetName:x||!(k&&E===r)?D:``,unitId:k?``:O})}function lQ(e,t,n,r,i,a){let{startRow:o,endRow:s,startColumn:c,endColumn:l,rangeType:u}=pQ(t),{startRow:d,startColumn:f,endRow:p,endColumn:m,rangeType:h=z.NORMAL}=pQ(n),{startRow:g,startColumn:_,endRow:v,endColumn:y}=pQ(r),{startRow:b,endRow:x,startColumn:S,endColumn:C}=pQ(a),{startRow:w,endRow:T,startColumn:E,endColumn:D,rangeType:O=z.NORMAL}=pQ(i),k={...i};function A(){return u===z.COLUMN&&O===z.COLUMN||c>=E&&l<=D}function ee(){return u===z.ROW&&O===z.ROW||o>=w&&s<=T}if(e===0){if(A()){if(o<w)k.startRow=o;else if(o>=T)k.endRow-=p+1-w;else return}else return}else if(e===1){if(A()){if(s>T)k.endRow=s;else if(s<=w)k.startRow+=T-d+1;else return}else return}else if(e===2){if(ee()){if(c<E)k.startColumn=c;else if(c>=D)k.endColumn-=m+1-E;else return}else return}else if(e===3){if(ee()){if(l>D)k.endColumn=l;else if(l<=E)k.startColumn+=D-f+1;else return}else return}else e===4?(k.startRow=o,k.startColumn=c,k.endRow=s,k.endColumn=l):f<=E&&m>=D||h===z.ROW&&O===z.ROW?n.endRow<w?(g>=w&&(k.startRow-=p-d+1),g>=T&&(k.endRow-=p-d+1)):n.startRow>T?(v<=T&&(k.endRow+=p-d+1),v<=w&&(k.startRow+=p-d+1)):n.startRow>=w&&n.endRow<=T&&(g<=w?k.startRow+=p-d+1:g>=T&&(k.endRow-=p-d+1)):d<=w&&p>=T||h===z.COLUMN&&O===z.COLUMN?n.endColumn<E?(_>=E&&(k.startColumn-=m-f+1),_>=D&&(k.endColumn-=m-f+1)):n.startColumn>D?(y<=D&&(k.endColumn+=m-f+1),y<=E&&(k.startColumn+=m-f+1)):n.startColumn>=E&&n.endColumn<=D&&(_<=E?k.startColumn+=m-f+1:_>=D&&(k.endColumn-=m-f+1)):((_<=C+1&&y>=D||_<=E&&y>=S-1)&&g<=w&&v>=T||g<=x+1&&v>=T||g<=w&&b-1,k.startRow=o,k.startColumn=c,k.endRow=s,k.endColumn=l);return k}function uQ(e,t){let n=dQ(e.startRow),r=fQ(e.endRow),i=dQ(e.startColumn),a=fQ(e.endColumn),o=dQ(t.startRow),s=fQ(t.endRow),c=dQ(t.startColumn),l=fQ(t.endColumn);function u(){return e.rangeType===z.COLUMN&&t.rangeType===z.COLUMN||n>=o&&r<=s}function d(){return e.rangeType===z.ROW&&t.rangeType===z.ROW||i>=c&&a<=l}function f(){return e.rangeType===z.ALL&&t.rangeType===z.ALL}return u()&&d()||f()?4:d()&&n>=o&&n<=s&&r>s?0:d()&&r>=o&&r<=s&&n<o?1:u()&&i>=c&&i<=l&&a>l?2:u()&&a>=c&&a<=l&&i<c?3:null}function dQ(e){return isNaN(e)?-1/0:e}function fQ(e){return isNaN(e)?1/0:e}function pQ(e){let{startRow:t,endRow:n,startColumn:r,endColumn:i}=e;return{...e,startRow:dQ(t),endRow:fQ(n),startColumn:dQ(r),endColumn:fQ(i)}}var Kpt=`sheet.command.set-table-config`,qpt=`sheet.command.delete-table`,Jpt=`sheet.command.table-remove-column-at`,Ypt=`sheet.command.table-remove-col`;function Xpt(e,t){let{id:n}=t,r=null;switch(n){case Iq.id:r=Zpt(t,e);break;case oJ.id:r=Qpt(t,e);break;case sJ.id:r=$pt(t,e);break;case Uq.id:r=emt(t);break;case Jq.id:r=tmt(t);break;case Hq.id:r=nmt(t,e);break;case Vq.id:r=rmt(t,e);break;case tJ.id:r=imt(t,e);break;case iJ.id:r=amt(t,e);break;case Bq.id:r=omt(t,e);break;case zq.id:r=smt(t,e);break;case vX.id:r=cmt(t,e);break;case BY.id:r=lmt(t,e);break;case XY.id:r=umt(t,e);break;case zY.id:r=dmt(t,e);break;case Kpt:r=fmt(t,e);break;case qpt:r=pmt(t,e);break;case Jpt:case Ypt:r=mmt(t,e)}return r}function mQ(e){return{unitId:e.getUnitId(),sheetId:e.getActiveSheet()?.getSheetId()||``}}function Zpt(e,t){let{params:n}=e;if(!n)return null;let{fromRange:r,toRange:i,fromUnitId:a,fromSubUnitId:o,toUnitId:s,toSubUnitId:c}=n;if(!r||!i)return null;let{unitId:l,sheetId:u}=mQ(t),d=a||s||l,f=o||u,p=t.getSheetBySheetId(f)?.getName(),m=c||o||u;return{type:0,from:r,to:i,unitId:d,sheetId:f,sheetName:p,targetUnitId:s||a||l,targetSheetId:m,targetSheetName:t.getSheetBySheetId(m)?.getName()}}function Qpt(e,t){let{params:n}=e;if(!n)return null;let{fromRange:{startRow:r,endRow:i},toRange:{startRow:a,endRow:o}}=n,s=t.getUnitId(),c=t.getActiveSheet();if(!c)return null;let l=c.getSheetId();return{type:1,from:{startRow:r,startColumn:0,endRow:i,endColumn:c.getColumnCount()-1,rangeType:z.ROW},to:{startRow:a,startColumn:0,endRow:o,endColumn:c.getColumnCount()-1,rangeType:z.ROW},unitId:s,sheetId:l}}function $pt(e,t){let{params:n}=e;if(!n)return null;let{fromRange:{startColumn:r,endColumn:i},toRange:{startColumn:a,endColumn:o}}=n,s=t.getUnitId(),c=t.getActiveSheet();if(!c)return null;let l=c.getSheetId();return{type:2,from:{startRow:0,startColumn:r,endRow:c.getRowCount()-1,endColumn:i,rangeType:z.COLUMN},to:{startRow:0,startColumn:a,endRow:c.getRowCount()-1,endColumn:o,rangeType:z.COLUMN},unitId:s,sheetId:l}}function emt(e){let{params:t}=e;if(!t)return null;let{range:n,unitId:r,subUnitId:i}=t;return{type:3,range:n,unitId:r,sheetId:i}}function tmt(e){let{params:t}=e;if(!t)return null;let{range:n,unitId:r,subUnitId:i}=t;return{type:4,range:n,unitId:r,sheetId:i}}function nmt(e,t){let{params:n}=e;if(!n)return null;let{range:r}=n,{unitId:i,sheetId:a}=mQ(t);return{type:10,range:r,unitId:i,sheetId:a}}function rmt(e,t){let{params:n}=e;if(!n)return null;let{range:r}=n,{unitId:i,sheetId:a}=mQ(t);return{type:9,range:r,unitId:i,sheetId:a}}function imt(e,t){let{params:n}=e;if(!n)return null;let{range:r}=n,{unitId:i,sheetId:a}=mQ(t);return{type:5,range:r,unitId:i,sheetId:a,rangeFilteredRows:t.getSheetBySheetId(a)?.getRangeFilterRows(r)??[]}}function amt(e,t){let{params:n}=e;if(!n)return null;let{range:r}=n,{unitId:i,sheetId:a}=mQ(t);return{type:6,range:r,unitId:i,sheetId:a}}function omt(e,t){let{params:n}=e;if(!n)return null;let{range:r}=n,{unitId:i,sheetId:a}=mQ(t);return{type:8,range:r,unitId:i,sheetId:a}}function smt(e,t){let{params:n}=e;if(!n)return null;let{range:r}=n,{unitId:i,sheetId:a}=mQ(t);return{type:7,range:r,unitId:i,sheetId:a}}function cmt(e,t){let{params:n}=e;if(!n)return null;let{unitId:r,subUnitId:i,name:a}=n,{unitId:o,sheetId:s}=mQ(t);return{type:11,unitId:r||o,sheetId:i||s,sheetName:a}}function lmt(e,t){let{params:n}=e;if(!n)return null;let{unitId:r,subUnitId:i}=n,{unitId:a,sheetId:o}=mQ(t);return{type:12,unitId:r||a,sheetId:i||o}}function umt(e,t){let{params:n}=e;if(!n)return null;let{unitId:r,name:i,id:a}=n,{sheetId:o}=mQ(t);return{type:13,unitId:r,sheetId:o,definedName:i,definedNameId:a}}function dmt(e,t){let{params:n}=e;if(!n)return null;let{unitId:r,name:i,id:a}=n,{sheetId:o}=mQ(t);return{type:14,unitId:r,sheetId:o,definedName:i,definedNameId:a}}function fmt(e,t){let{params:n}=e;if(!n||!n.name||!n.oldTableName||n.oldTableName===n.name)return null;let{unitId:r,name:i,oldTableName:a}=n,{sheetId:o}=mQ(t);return{type:15,unitId:r,sheetId:o,tableName:i,oldTableName:a}}function pmt(e,t){let{params:n}=e;if(!n||!n.tableName)return null;let{unitId:r,tableName:i}=n,{sheetId:a}=mQ(t);return{type:16,unitId:r,sheetId:a,oldTableName:i}}function mmt(e,t){let{params:n}=e;if(!n||!n.tableName||!n.removedColumnNames?.length)return null;let{unitId:r,subUnitId:i,range:a,tableName:o,removedColumnNames:s}=n,{sheetId:c}=mQ(t);return{type:17,unitId:r,sheetId:i||c,range:a,oldTableName:o,tableColumnNames:s}}var hQ=class extends P{constructor(e,t,n,r){super(),this._definedNamesService=e,this._univerInstanceService=t,this._sheetInterceptorService=n,this._lexerTreeBuilder=r,this._initialize()}_initialize(){this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>{if(e.id===XY.id||e.id===zY.id)return{redos:[],undos:[]};let t=this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET);if(t==null)return{redos:[],undos:[]};let n=Xpt(t,e);return n?this._getUpdateDefinedNameMutations(t,n):{redos:[],undos:[]}}}))}_getUpdateDefinedNameMutations(e,t){let{type:n,unitId:r,sheetId:i}=t,a=this._definedNamesService.getDefinedNameMap(r);if(!a)return{redos:[],undos:[]};let o=[],s=[];return Object.values(a).forEach(a=>{let{formulaOrRefString:c}=a,l=this._lexerTreeBuilder.sequenceNodesBuilder(c);if(l==null)return!0;let u=!1,d=[];for(let o=0,s=l.length;o<s;o++){let s=l[o];if(typeof s==`string`||s.nodeType!==HB.REFERENCE)continue;let{token:c}=s,{range:f,sheetName:p,unitId:m}=VB(c),h=e.getSheetBySheetName(p)?.getSheetId()||``,g={range:f,sheetId:h,unitId:m,sheetName:p,refOffsetX:0,refOffsetY:0},_=null;if(n===12)_=this._removeSheet(a,r,i);else if(n===11){let{sheetId:e,sheetName:n}=t;if(n==null||h==null||h.length===0||e!==h)continue;_=Gz({range:f,sheetName:n,unitId:m})}else _=Gpt(g,t,r,i,{preserveSheetQualifier:!0});_!=null&&(l[o]={...s,token:_},u=!0,d.push(o))}if(!u)return!0;let f=UB(cQ(l,d)),p={id:iB.id,params:{unitId:r,...a,formulaOrRefString:f}};o.push(p);let m={id:iB.id,params:{unitId:r,...a}};s.push(m)}),{redos:o,undos:s}}_removeSheet(e,t,n){let{formulaOrRefString:r}=e;return this._definedNamesService.getWorksheetByRef(t,r)?.getSheetId()===n?YR.REF:null}};hQ=ZZ([XZ(0,rB),XZ(1,B),XZ(2,j(lK)),XZ(3,j(qB))],hQ);var gQ=class extends P{constructor(e,t,n,r,i,a,o,s){super(),this._univerInstanceService=e,this._commandService=t,this._lexerTreeBuilder=n,this._formulaDataModel=r,this._sheetInterceptorService=i,this._definedNamesService=a,this._configService=o,this._injector=s,this._commandExecutedListener()}_commandExecutedListener(){this.disposeWithMe(this._sheetInterceptorService.interceptCommand({getMutations:e=>this._getUpdateFormula(e)})),this.disposeWithMe(this._commandService.onCommandExecuted(e=>{if(e.params){if(e.id===aJ.id){let{subUnitId:t,unitId:n}=e.params;this._handleWorkbookDisposed(n,t)}else e.id===jY.id&&this._handleInsertSheetMutation(e.params)}})),this.disposeWithMe(this._commandService.beforeCommandExecuted((e,t)=>{if(e.id===RK.id){let n=e.params;if(t&&t.onlyLocal===!0||t&&t.syncOnly===!0||t&&t.fromChangeset===!0||n.trigger===GJ.id||n.trigger===WY.id||n.trigger===Eq.id||n.trigger===iX.id)return;this._handleSetRangeValuesMutation(n)}})),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitAdded$(M.UNIVER_SHEET).subscribe(e=>this._handleWorkbookAdded(e.unit))),this.disposeWithMe(this._univerInstanceService.getTypeOfUnitDisposed$(M.UNIVER_SHEET).pipe(os(e=>e.getUnitId())).subscribe(e=>this._handleWorkbookDisposed(e)))}_handleSetRangeValuesMutation(e){let{subUnitId:t,unitId:n,cellValue:r}=e;if(r==null)return;let i=this._formulaDataModel.updateFormulaData(n,t,r),a=this._formulaDataModel.updateArrayFormulaCellData(n,t,r),o=this._formulaDataModel.updateArrayFormulaRange(n,t,r);if(Object.keys(i).length===0){(a||o)&&this._commandService.executeCommand(Bz.id,{arrayFormulaRange:this._formulaDataModel.getArrayFormulaRange(),arrayFormulaCellData:this._formulaDataModel.getArrayFormulaCellData()},{onlyLocal:!0,remove:!0});return}let s={[n]:{[t]:i}};this._commandService.executeCommand(RK.id,{unitId:n,subUnitId:t,cellValue:Hpt(i,r)},{onlyLocal:!0,fromFormula:!0}),this._formulaDataModel.updateImageFormulaData(n,t,r),this._commandService.executeCommand(CB.id,{formulaData:s},{onlyLocal:!0}),this._commandService.executeCommand(Bz.id,{arrayFormulaRange:this._formulaDataModel.getArrayFormulaRange(),arrayFormulaCellData:this._formulaDataModel.getArrayFormulaCellData()},{onlyLocal:!0,remove:!0})}_handleWorkbookDisposed(e,t){let n=oQ(this._formulaDataModel.getFormulaData(),e,t),r=this._formulaDataModel.getArrayFormulaRange(),i=oQ(r,e,t),a=this._formulaDataModel.getArrayFormulaCellData(),o=oQ(a,e,t);n&&this._commandService.executeCommand(CB.id,{formulaData:n},{onlyLocal:!0}),i&&o&&this._commandService.executeCommand(Bz.id,{arrayFormulaRange:r,arrayFormulaCellData:a},{onlyLocal:!0})}_handleInsertSheetMutation(e){let{sheet:t,unitId:n}=e,r=this._formulaDataModel.getFormulaData(),{id:i,cellData:a}=t,o=YB(r,n,i,new Rh(a));this._commandService.executeCommand(CB.id,{formulaData:o},{onlyLocal:!0})}_handleWorkbookAdded(e){let t={},n=e.getUnitId(),r={[n]:{}};e.getSheets().forEach(e=>{let i=e.getCellMatrix(),a=e.getSheetId(),o=YB(t,n,a,i);r[n][a]=o[n]?.[a]}),this._commandService.executeCommand(CB.id,{formulaData:r},{onlyLocal:!0});let i=this._configService.getConfig(YZ)?.initialFormulaComputing??1,a=this._getDirtyDataByCalculationMode(i);this._commandService.executeCommand(lB.id,a,{onlyLocal:!0})}_getDirtyDataByCalculationMode(e){return{forceCalculation:e===0,dirtyRanges:e===1?this._formulaDataModel.getFormulaDirtyRanges():[],dirtyNameMap:{},dirtyDefinedNameMap:{},dirtyUnitFeatureMap:{},dirtyUnitOtherFormulaMap:{},clearDependencyTreeCache:{}}}_getUpdateFormula(e){let t=this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET);if(!t)return{undos:[],redos:[]};let n=Xpt(t,e);if(n){let{unitSheetNameMap:e}=this._formulaDataModel.getCalculateData(),t=this._formulaDataModel.getFormulaData(),{newFormulaData:r}=this._getFormulaReferenceMoveInfo(t,e,n),{undos:i,redos:a}=xpt(t,r,n);return{undos:i,redos:a}}return{undos:[],redos:[]}}_getFormulaReferenceMoveInfo(e,t,n){if(!F.isDefine(e))return{newFormulaData:{}};let r=Object.keys(e);if(r.length===0)return{newFormulaData:{}};let i={},{unitId:a,sheetId:o,sheetName:s,targetUnitId:c,targetSheetId:l,type:u,from:d,to:f}=n,p=[];for(let f of r){let r=e[f];if(r==null)continue;let m=Object.keys(r);F.isDefine(i[f])||(i[f]={});for(let e of m){let m=new Rh(r[e]||{}),h=new Rh,g=[];m.forValue((r,i,m)=>{if(!m)return!0;let{f:_,x:v,y,si:b}=m,x=this._lexerTreeBuilder.sequenceNodesBuilder(_);if(x==null)return!0;let S=!1,C=[],w=u===0&&(c!==a||l!==o)&&f===a&&e===o&&d&&d.startRow<=r&&r<=d.endRow&&d.startColumn<=i&&i<=d.endColumn,T=[...x];for(let r=0,i=x.length;r<i;r++){var E;let i=x[r];if(typeof i==`string`)continue;let{token:l,nodeType:d}=i;if((u===13||u===14)&&(d===HB.DEFINED_NAME||d===HB.FUNCTION)){let{definedNameId:e,definedName:t}=n;if(e===void 0||t===void 0)continue;let a=this._definedNamesService.getValueById(f,e);if(a==null||a.name!==l)continue;x[r]={...i,token:u===13?t:YR.REF},S=!0,C.push(r);continue}if((u===15||u===16||u===17)&&(d===HB.TABLE||d===HB.FUNCTION)){let{oldTableName:e,tableName:t,tableColumnNames:a}=n;if(e===void 0||u===15&&t===void 0)continue;let{tableName:o,columnStruct:s=``}=$z(l);if(o!==e||u===17&&!hmt(s,a))continue;x[r]={...i,token:u===15?`${t}${s}`:YR.REF};let c=x[r+1];(u===16||u===17)&&typeof c==`string`&&c.startsWith(`]`)&&(x[r+1]=c.slice(1)),S=!0,C.push(r);continue}if(d!==HB.REFERENCE)continue;let{range:p,sheetName:m,unitId:h}=VB(l),_=h==null||h.length===0?f:h,D=(t==null||(E=t[_])==null?void 0:E[m])||``;if(!Wpt(n.unitId,n.sheetId,f,e,h,D))continue;let O={range:p,sheetId:D,unitId:h,sheetName:m,refOffsetX:v||0,refOffsetY:y||0},k=null;if(u===11){let{unitId:e,sheetId:t,sheetName:r}=n;if(r==null||D==null||D.length===0||t!==D)continue;k=Gz({range:p,sheetName:r,unitId:h})}else if(u===12){let{unitId:e,sheetId:t,sheetName:r}=n;if(D==null||D.length===0||t!==D)continue;k=YR.REF}else u!==13&&(k=Gpt(O,n,f,e,{inCrossSheetCutRange:w}));if(k!=null&&(x[r]={...i,token:k},S=!0,C.push(r),b&&(v??0)===0&&(y??0)===0&&g.push(b)),w){if(k!=null)T[r]={...i,token:k};else if((!h||h===a)&&(!D||D===o)){let e=d_.moveOffset(p,v||0,y||0);T[r]={...i,token:Gz({range:e,sheetName:s||m,unitId:c===a?``:a})},S=!0}}}if(!S){if(b&&[1,2,0].includes(u)){if(d&&d.startRow<=r&&r<=d.endRow&&d.startColumn<=i&&i<=d.endColumn)(v??0)===0&&(y??0)===0&&g.push(b);else if(!g.includes(b))return!0}else return!0}if(w){let e=cQ(T,C,v,y);return p.push({fromRow:r,fromColumn:i,formulaString:`=${UB(e)}`}),!0}let D=cQ(x,C,v,y);h.setValue(r,i,{f:`=${UB(D)}`})}),i[f]&&(i[f][e]=h.getData())}}if(p.length>0&&c&&l){i[c]||(i[c]={}),i[c][l]||(i[c][l]={});for(let e of p){let{fromRow:t,fromColumn:n,formulaString:r}=e,a=t+((f?.startRow??0)-(d?.startRow??0)),o=n+((f?.startColumn??0)-(d?.startColumn??0));i[c][l][a]||(i[c][l][a]={}),i[c][l][a][o]={f:r}}}return{newFormulaData:i}}};gQ=ZZ([XZ(0,B),XZ(1,R),XZ(2,j(qB)),XZ(3,j(JB)),XZ(4,j(lK)),XZ(5,rB),XZ(6,Nm),XZ(7,j(We))],gQ);function hmt(e,t){if(!t?.length||e.length===0)return!1;let n=new Set(t),r=(e.endsWith(`]`)?e:`${e}]`).matchAll(/\[([^\]]+)\]/g);for(let e of r){let t=e[1].replace(/^\[/,``).trim();if(!t.startsWith(`#`)&&n.has(t))return!0}return!1}var gmt=`@univerjs/sheets-formula`,_mt=`0.25.1`,vmt=`SHEETS_FORMULA_PLUGIN`,_Q=class extends P{constructor(e,t,n){super(),this._activeDirtyManagerService=e,this._univerInstanceService=t,this._formulaDataModel=n,this._initialize()}_initialize(){this._initialConversion()}_initialConversion(){this._activeDirtyManagerService.register(RK.id,{commandId:RK.id,getDirtyData:e=>{let t=e.params;return t.trigger===GJ.id?{}:{dirtyRanges:this._getSetRangeValuesMutationDirtyRange(t)}}}),this._initialMove(),this._initialRowAndColumn(),this._initialHideRow(),this._initialSheet(),this._initialDefinedName(),this._initialSuperTable()}_initialMove(){this._activeDirtyManagerService.register(bK.id,{commandId:bK.id,getDirtyData:e=>{let t=e.params;return{dirtyRanges:this._getMoveRangeMutationDirtyRange(t),clearDependencyTreeCache:{[t.unitId]:{[t.to.subUnitId]:`1`,[t.from.subUnitId]:`1`}}}}}),this._activeDirtyManagerService.register(xK.id,{commandId:xK.id,getDirtyData:e=>{let t=e.params;return{dirtyRanges:this._getMoveRowsMutationDirtyRange(t),clearDependencyTreeCache:{[t.unitId]:{[t.subUnitId]:`1`}}}}}),this._activeDirtyManagerService.register(SK.id,{commandId:SK.id,getDirtyData:e=>{let t=e.params;return{dirtyRanges:this._getMoveRowsMutationDirtyRange(t),clearDependencyTreeCache:{[t.unitId]:{[t.subUnitId]:`1`}}}}}),this._activeDirtyManagerService.register(DK.id,{commandId:DK.id,getDirtyData:e=>{let t=e.params;return{dirtyRanges:this._getReorderRangeMutationDirtyRange(t),clearDependencyTreeCache:{[t.unitId]:{[t.subUnitId]:`1`}}}}})}_initialRowAndColumn(){this._activeDirtyManagerService.register(CK.id,{commandId:CK.id,getDirtyData:e=>{let t=e.params;return{dirtyRanges:this._getRemoveRowOrColumnMutation(t,!0),clearDependencyTreeCache:{[t.unitId]:{[t.subUnitId]:`1`}}}}}),this._activeDirtyManagerService.register(wK.id,{commandId:wK.id,getDirtyData:e=>{let t=e.params;return{dirtyRanges:this._getRemoveRowOrColumnMutation(t,!1),clearDependencyTreeCache:{[t.unitId]:{[t.subUnitId]:`1`}}}}}),this._activeDirtyManagerService.register(yK.id,{commandId:yK.id,getDirtyData:e=>{let t=e.params;return{clearDependencyTreeCache:{[t.unitId]:{[t.subUnitId]:`1`}}}}}),this._activeDirtyManagerService.register(_K.id,{commandId:_K.id,getDirtyData:e=>{let t=e.params;return{clearDependencyTreeCache:{[t.unitId]:{[t.subUnitId]:`1`}}}}})}_initialHideRow(){this._activeDirtyManagerService.register(VK.id,{commandId:VK.id,getDirtyData:e=>{let t=e.params;return{dirtyRanges:this._getHideRowMutation(t),clearDependencyTreeCache:{[t.unitId]:{[t.subUnitId]:`1`}}}}}),this._activeDirtyManagerService.register(BK.id,{commandId:BK.id,getDirtyData:e=>{let t=e.params;return{dirtyRanges:this._getHideRowMutation(t),clearDependencyTreeCache:{[t.unitId]:{[t.subUnitId]:`1`}}}}})}_initialSheet(){this._activeDirtyManagerService.register(lB.id,{commandId:lB.id,getDirtyData:e=>({...e.params})}),this._activeDirtyManagerService.register(aJ.id,{commandId:aJ.id,getDirtyData:e=>{let t=e.params;return{dirtyNameMap:this._getRemoveSheetMutation(t),clearDependencyTreeCache:{[t.unitId]:{[t.subUnitId]:`1`}}}}}),this._activeDirtyManagerService.register(jY.id,{commandId:jY.id,getDirtyData:e=>{let t=e.params;return{dirtyNameMap:this._getInsertSheetMutation(t)}}})}_initialDefinedName(){this._activeDirtyManagerService.register(iB.id,{commandId:iB.id,getDirtyData:e=>{let t=e.params;return{dirtyDefinedNameMap:this._getDefinedNameMutation(t)}}}),this._activeDirtyManagerService.register(aB.id,{commandId:aB.id,getDirtyData:e=>{let t=e.params;return{dirtyDefinedNameMap:this._getDefinedNameMutation(t)}}})}_initialSuperTable(){this._activeDirtyManagerService.register(OB.id,{commandId:OB.id,getDirtyData:e=>{let t=e.params,{unitId:n,reference:r}=t,{sheetId:i,range:a}=r;return{dirtyRanges:[{unitId:n,sheetId:i,range:a}],dirtySuperTableMap:{[n]:{[t.tableName]:`1`}},clearDependencyTreeCache:{[n]:{[i]:`1`}}}}})}_getDefinedNameMutation(e){if(e==null)return{};let{unitId:t,name:n,formulaOrRefString:r}=e;return{[t]:{[n]:r}}}_getSetRangeValuesMutationDirtyRange(e){let{subUnitId:t,unitId:n,cellValue:r}=e,i=[];return r==null?i:(i.push(...this._getDirtyRangesByCellValue(n,t,r)),i.push(...this._getDirtyRangesForArrayFormula(n,t,r)),i)}_getMoveRangeMutationDirtyRange(e){let{unitId:t,from:n,to:r}=e,i=[];return i.push(...this._getDirtyRangesByCellValue(t,n.subUnitId,n.value)),i.push(...this._getDirtyRangesByCellValue(t,r.subUnitId,r.value)),i.push(...this._getDirtyRangesForArrayFormula(t,r.subUnitId,r.value)),i}_getMoveRowsMutationDirtyRange(e){let{subUnitId:t,unitId:n,sourceRange:r,targetRange:i}=e,a=[],o=this._rangeToMatrix(r).getData(),s=this._rangeToMatrix(i).getData();return a.push(...this._getDirtyRangesByCellValue(n,t,o)),a.push(...this._getDirtyRangesByCellValue(n,t,s)),a.push(...this._getDirtyRangesForArrayFormula(n,t,s)),a}_getReorderRangeMutationDirtyRange(e){let{unitId:t,subUnitId:n,range:r}=e,i=this._rangeToMatrix(r).getData(),a=[];return a.push(...this._getDirtyRangesByCellValue(t,n,i)),a.push(...this._getDirtyRangesForArrayFormula(t,n,i)),a}_getRemoveRowOrColumnMutation(e,t=!0){let{subUnitId:n,unitId:r,range:i}=e,a=[],o=this._univerInstanceService.getUniverSheetInstance(r)?.getSheetBySheetId(n),s=o?.getRowCount()||0,c=o?.getColumnCount()||0,l=null,{startRow:u,endRow:d,startColumn:f,endColumn:p}=i;l=t===!0?this._rangeToMatrix({startRow:u,startColumn:0,endRow:d,endColumn:c-1}):this._rangeToMatrix({startRow:0,startColumn:f,endRow:s,endColumn:p});let m=l.getData();return a.push(...this._getDirtyRangesByCellValue(r,n,m)),a.push(...this._getDirtyRangesForArrayFormula(r,n,m)),a}_getHideRowMutation(e){let{subUnitId:t,unitId:n,ranges:r}=e,i=[];return r.forEach(e=>{let r=this._rangeToMatrix(e).getMatrix();i.push(...this._getDirtyRangesByCellValue(n,t,r))}),i}_getRemoveSheetMutation(e){let t={},{subUnitId:n,unitId:r,subUnitName:i}=e;return t[r]??(t[r]={}),t[r][n]=i,t}_getInsertSheetMutation(e){let t={},{sheet:n,unitId:r}=e;return t[r]??(t[r]={}),t[r][n.id]=n.name,t}_rangeToMatrix(e){let t=new Rh,{startRow:n,startColumn:r,endRow:i,endColumn:a}=e;for(let e=n;e<=i;e++)for(let n=r;n<=a;n++)t.setValue(e,n,{});return t}_getDirtyRangesByCellValue(e,t,n){let r=[];return n==null||new Rh(n).getDiscreteRanges().forEach(n=>{r.push({unitId:e,sheetId:t,range:n})}),r}_getDirtyRangesForArrayFormula(e,t,n){var r;let i=[];if(n==null)return i;let a=new Rh(n),o=this._formulaDataModel.getArrayFormulaRange();if(o!=null&&(r=o[e])!=null&&r[t]){var s;let n=new Rh(o==null||(s=o[e])==null?void 0:s[t]);a.forValue((r,a)=>{n.forValue((n,o,s)=>{if(s==null)return!0;let{startRow:c,startColumn:l,endRow:u,endColumn:d}=s;r>=c&&r<=u&&a>=l&&a<=d&&i.push({unitId:e,sheetId:t,range:{startRow:c,startColumn:l,endRow:c,endColumn:l}})})})}return i}};_Q=ZZ([XZ(0,VU),XZ(1,B),XZ(2,j(JB))],_Q);var vQ=class extends P{constructor(e,t,n,r,i,a,o){super(),this._commandService=e,this._configService=t,this._sheetInterceptorService=n,this._formulaDataModel=r,this._lexerTreeBuilder=i,this._functionService=a,this._definedNamesService=o,this._initialize()}_initialize(){this._commandExecutedListener(),this._initInterceptorCellContent()}_commandExecutedListener(){this.disposeWithMe(this._commandService.onCommandExecuted(e=>{let t=this._configService.getConfig(`sheets-formula.base.config`)?.writeArrayFormulaToSnapshot;if(e.id===Bz.id){let n=e.params;if(n==null)return;let{arrayFormulaRange:r,arrayFormulaCellData:i,arrayFormulaEmbedded:a}=n;this._formulaDataModel.setArrayFormulaRange(r),this._formulaDataModel.setArrayFormulaCellData(i),t&&this._writeArrayFormulaToSnapshot(r,i,a)}else e.id===mB.id&&t&&(this._addPrefixToFunctionSnapshot(),this._addPrefixToDefinedNamesFunctionSnapshot())}))}_addPrefixToDefinedNamesFunctionSnapshot(){let e=this._definedNamesService.getAllDefinedNames();Object.entries(e).forEach(([e,t])=>{t&&Array.from(Object.entries(t)).forEach(([t,n])=>{let{formulaOrRefString:r}=n;if(r.substring(0,1)===`=`){let t=this._lexerTreeBuilder.getNewFormulaWithPrefix(r,this._functionService.hasExecutor.bind(this._functionService));t&&this._commandService.executeCommand(iB.id,{...n,unitId:e,formulaOrRefStringWithPrefix:t},{onlyLocal:!0,fromFormula:!0})}})})}_addPrefixToFunctionSnapshot(){let e=this._formulaDataModel.getFormulaData(),t=new Map;Object.entries(e).forEach(([e,n])=>{n&&Array.from(Object.entries(n)).forEach(([n,r])=>{if(!r)return;let i=new Rh;new Rh(r).forValue((e,n,r)=>{let a=r?.f;if(r?.x!=null||!a||a.length===0)return;if(t.has(a)){let r=t.get(a);i.setValue(e,n,{xf:r});return}let o=this._lexerTreeBuilder.getNewFormulaWithPrefix(a,this._functionService.hasExecutor.bind(this._functionService));o&&(i.setValue(e,n,{xf:o}),t.set(a,o))}),this._commandService.executeCommand(RK.id,{unitId:e,subUnitId:n,cellValue:i.getMatrix()},{onlyLocal:!0,fromFormula:!0})})}),t.clear()}_writeArrayFormulaToSnapshot(e,t,n){e&&Object.entries(e).forEach(([e,t])=>{t&&Array.from(Object.entries(t)).forEach(([t,n])=>{let r=new Rh;new Rh(n).forValue((e,t,n)=>{r.setValue(e,t,{ref:Hz(n)})}),this._commandService.executeCommand(RK.id,{unitId:e,subUnitId:t,cellValue:r.getMatrix()},{onlyLocal:!0,fromFormula:!0})})}),n&&Object.entries(n).forEach(([t,n])=>{n&&Array.from(Object.entries(n)).forEach(([n,r])=>{let i=new Rh;new Rh(r).forValue((r,a)=>{var o;e!=null&&(o=e[t])!=null&&(o=o[n])!=null&&(o=o[r])!=null&&o[a]||i.setValue(r,a,{ref:Hz({startRow:r,endRow:r,startColumn:a,endColumn:a})})}),this._commandService.executeCommand(RK.id,{unitId:t,subUnitId:n,cellValue:i.getMatrix()},{onlyLocal:!0,fromFormula:!0})})}),t&&Object.entries(t).forEach(([e,t])=>{t&&Array.from(Object.entries(t)).forEach(([t,n])=>{this._commandService.executeCommand(RK.id,{unitId:e,subUnitId:t,cellValue:n},{onlyLocal:!0,fromFormula:!0})})})}_initInterceptorCellContent(){this.disposeWithMe(this._sheetInterceptorService.intercept(tK.CELL_CONTENT,{priority:100,effect:Sf.Value,handler:(e,t,n)=>{var r;let i=e,{unitId:a,subUnitId:o,row:s,col:c}=t,l=this._formulaDataModel.getArrayFormulaCellData(),u=l==null||(r=l[a])==null||(r=r[o])==null||(r=r[s])==null?void 0:r[c];return u==null?n(i):((!i||i===t.rawData)&&(i={...t.rawData}),u.v==null&&u.t==null?(i.v=0,i.t=Pp.NUMBER,n(i)):i?.t===Pp.NUMBER&&i.v!==void 0&&i.v!==null&&Pg(i.v)?(i.v=pV(Number(i.v)),n(i)):(i.v=u.v,i.t=u.t,n(i)))}}))}};vQ=ZZ([XZ(0,R),XZ(1,Nm),XZ(2,j(lK)),XZ(3,j(JB)),XZ(4,j(qB)),XZ(5,qV),XZ(6,rB)],vQ);var ymt=[{functionName:D5e.ARRAY_CONSTRAIN,functionType:q.Array,description:`sheets-formula.functionList.ARRAY_CONSTRAIN.description`,abstract:`sheets-formula.functionList.ARRAY_CONSTRAIN.abstract`,functionParameter:[{name:`sheets-formula.functionList.ARRAY_CONSTRAIN.functionParameter.inputRange.name`,detail:`sheets-formula.functionList.ARRAY_CONSTRAIN.functionParameter.inputRange.detail`,example:`A1:C3`,require:1,repeat:0},{name:`sheets-formula.functionList.ARRAY_CONSTRAIN.functionParameter.numRows.name`,detail:`sheets-formula.functionList.ARRAY_CONSTRAIN.functionParameter.numRows.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.ARRAY_CONSTRAIN.functionParameter.numCols.name`,detail:`sheets-formula.functionList.ARRAY_CONSTRAIN.functionParameter.numCols.detail`,example:`2`,require:1,repeat:0}]},{functionName:D5e.FLATTEN,functionType:q.Array,description:`sheets-formula.functionList.FLATTEN.description`,abstract:`sheets-formula.functionList.FLATTEN.abstract`,functionParameter:[{name:`sheets-formula.functionList.FLATTEN.functionParameter.range1.name`,detail:`sheets-formula.functionList.FLATTEN.functionParameter.range1.detail`,example:`A1:C3`,require:1,repeat:0},{name:`sheets-formula.functionList.FLATTEN.functionParameter.range2.name`,detail:`sheets-formula.functionList.FLATTEN.functionParameter.range2.detail`,example:`D1:F3`,require:0,repeat:1}]}],bmt=[{functionName:sU.BETADIST,functionType:q.Compatibility,description:`sheets-formula.functionList.BETADIST.description`,abstract:`sheets-formula.functionList.BETADIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.BETADIST.functionParameter.x.name`,detail:`sheets-formula.functionList.BETADIST.functionParameter.x.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.BETADIST.functionParameter.alpha.name`,detail:`sheets-formula.functionList.BETADIST.functionParameter.alpha.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.BETADIST.functionParameter.beta.name`,detail:`sheets-formula.functionList.BETADIST.functionParameter.beta.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.BETADIST.functionParameter.A.name`,detail:`sheets-formula.functionList.BETADIST.functionParameter.A.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.BETADIST.functionParameter.B.name`,detail:`sheets-formula.functionList.BETADIST.functionParameter.B.detail`,example:`3`,require:0,repeat:0}]},{functionName:sU.BETAINV,functionType:q.Compatibility,description:`sheets-formula.functionList.BETAINV.description`,abstract:`sheets-formula.functionList.BETAINV.abstract`,functionParameter:[{name:`sheets-formula.functionList.BETAINV.functionParameter.probability.name`,detail:`sheets-formula.functionList.BETAINV.functionParameter.probability.detail`,example:`0.685470581`,require:1,repeat:0},{name:`sheets-formula.functionList.BETAINV.functionParameter.alpha.name`,detail:`sheets-formula.functionList.BETAINV.functionParameter.alpha.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.BETAINV.functionParameter.beta.name`,detail:`sheets-formula.functionList.BETAINV.functionParameter.beta.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.BETAINV.functionParameter.A.name`,detail:`sheets-formula.functionList.BETAINV.functionParameter.A.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.BETAINV.functionParameter.B.name`,detail:`sheets-formula.functionList.BETAINV.functionParameter.B.detail`,example:`3`,require:0,repeat:0}]},{functionName:sU.BINOMDIST,functionType:q.Compatibility,description:`sheets-formula.functionList.BINOMDIST.description`,abstract:`sheets-formula.functionList.BINOMDIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.BINOMDIST.functionParameter.numberS.name`,detail:`sheets-formula.functionList.BINOMDIST.functionParameter.numberS.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.BINOMDIST.functionParameter.trials.name`,detail:`sheets-formula.functionList.BINOMDIST.functionParameter.trials.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.BINOMDIST.functionParameter.probabilityS.name`,detail:`sheets-formula.functionList.BINOMDIST.functionParameter.probabilityS.detail`,example:`0.5`,require:1,repeat:0},{name:`sheets-formula.functionList.BINOMDIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.BINOMDIST.functionParameter.cumulative.detail`,example:`false`,require:1,repeat:0}]},{functionName:sU.CHIDIST,functionType:q.Compatibility,description:`sheets-formula.functionList.CHIDIST.description`,abstract:`sheets-formula.functionList.CHIDIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHIDIST.functionParameter.x.name`,detail:`sheets-formula.functionList.CHIDIST.functionParameter.x.detail`,example:`0.5`,require:1,repeat:0},{name:`sheets-formula.functionList.CHIDIST.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.CHIDIST.functionParameter.degFreedom.detail`,example:`1`,require:1,repeat:0}]},{functionName:sU.CHIINV,functionType:q.Compatibility,description:`sheets-formula.functionList.CHIINV.description`,abstract:`sheets-formula.functionList.CHIINV.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHIINV.functionParameter.probability.name`,detail:`sheets-formula.functionList.CHIINV.functionParameter.probability.detail`,example:`0.93`,require:1,repeat:0},{name:`sheets-formula.functionList.CHIINV.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.CHIINV.functionParameter.degFreedom.detail`,example:`1`,require:1,repeat:0}]},{functionName:sU.CHITEST,functionType:q.Compatibility,description:`sheets-formula.functionList.CHITEST.description`,abstract:`sheets-formula.functionList.CHITEST.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHITEST.functionParameter.actualRange.name`,detail:`sheets-formula.functionList.CHITEST.functionParameter.actualRange.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.CHITEST.functionParameter.expectedRange.name`,detail:`sheets-formula.functionList.CHITEST.functionParameter.expectedRange.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:sU.CONFIDENCE,functionType:q.Compatibility,description:`sheets-formula.functionList.CONFIDENCE.description`,abstract:`sheets-formula.functionList.CONFIDENCE.abstract`,functionParameter:[{name:`sheets-formula.functionList.CONFIDENCE.functionParameter.alpha.name`,detail:`sheets-formula.functionList.CONFIDENCE.functionParameter.alpha.detail`,example:`0.05`,require:1,repeat:0},{name:`sheets-formula.functionList.CONFIDENCE.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.CONFIDENCE.functionParameter.standardDev.detail`,example:`2.5`,require:1,repeat:0},{name:`sheets-formula.functionList.CONFIDENCE.functionParameter.size.name`,detail:`sheets-formula.functionList.CONFIDENCE.functionParameter.size.detail`,example:`50`,require:1,repeat:0}]},{functionName:sU.COVAR,functionType:q.Compatibility,description:`sheets-formula.functionList.COVAR.description`,abstract:`sheets-formula.functionList.COVAR.abstract`,functionParameter:[{name:`sheets-formula.functionList.COVAR.functionParameter.array1.name`,detail:`sheets-formula.functionList.COVAR.functionParameter.array1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.COVAR.functionParameter.array2.name`,detail:`sheets-formula.functionList.COVAR.functionParameter.array2.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:sU.CRITBINOM,functionType:q.Compatibility,description:`sheets-formula.functionList.CRITBINOM.description`,abstract:`sheets-formula.functionList.CRITBINOM.abstract`,functionParameter:[{name:`sheets-formula.functionList.CRITBINOM.functionParameter.trials.name`,detail:`sheets-formula.functionList.CRITBINOM.functionParameter.trials.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.CRITBINOM.functionParameter.probabilityS.name`,detail:`sheets-formula.functionList.CRITBINOM.functionParameter.probabilityS.detail`,example:`0.5`,require:1,repeat:0},{name:`sheets-formula.functionList.CRITBINOM.functionParameter.alpha.name`,detail:`sheets-formula.functionList.CRITBINOM.functionParameter.alpha.detail`,example:`0.75`,require:1,repeat:0}]},{functionName:sU.EXPONDIST,functionType:q.Compatibility,description:`sheets-formula.functionList.EXPONDIST.description`,abstract:`sheets-formula.functionList.EXPONDIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.EXPONDIST.functionParameter.x.name`,detail:`sheets-formula.functionList.EXPONDIST.functionParameter.x.detail`,example:`0.2`,require:1,repeat:0},{name:`sheets-formula.functionList.EXPONDIST.functionParameter.lambda.name`,detail:`sheets-formula.functionList.EXPONDIST.functionParameter.lambda.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.EXPONDIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.EXPONDIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:sU.FDIST,functionType:q.Compatibility,description:`sheets-formula.functionList.FDIST.description`,abstract:`sheets-formula.functionList.FDIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.FDIST.functionParameter.x.name`,detail:`sheets-formula.functionList.FDIST.functionParameter.x.detail`,example:`15.2069`,require:1,repeat:0},{name:`sheets-formula.functionList.FDIST.functionParameter.degFreedom1.name`,detail:`sheets-formula.functionList.FDIST.functionParameter.degFreedom1.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.FDIST.functionParameter.degFreedom2.name`,detail:`sheets-formula.functionList.FDIST.functionParameter.degFreedom2.detail`,example:`4`,require:1,repeat:0}]},{functionName:sU.FINV,functionType:q.Compatibility,description:`sheets-formula.functionList.FINV.description`,abstract:`sheets-formula.functionList.FINV.abstract`,functionParameter:[{name:`sheets-formula.functionList.FINV.functionParameter.probability.name`,detail:`sheets-formula.functionList.FINV.functionParameter.probability.detail`,example:`0.01`,require:1,repeat:0},{name:`sheets-formula.functionList.FINV.functionParameter.degFreedom1.name`,detail:`sheets-formula.functionList.FINV.functionParameter.degFreedom1.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.FINV.functionParameter.degFreedom2.name`,detail:`sheets-formula.functionList.FINV.functionParameter.degFreedom2.detail`,example:`4`,require:1,repeat:0}]},{functionName:sU.FTEST,functionType:q.Compatibility,description:`sheets-formula.functionList.FTEST.description`,abstract:`sheets-formula.functionList.FTEST.abstract`,functionParameter:[{name:`sheets-formula.functionList.FTEST.functionParameter.array1.name`,detail:`sheets-formula.functionList.FTEST.functionParameter.array1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.FTEST.functionParameter.array2.name`,detail:`sheets-formula.functionList.FTEST.functionParameter.array2.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:sU.GAMMADIST,functionType:q.Compatibility,description:`sheets-formula.functionList.GAMMADIST.description`,abstract:`sheets-formula.functionList.GAMMADIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.GAMMADIST.functionParameter.x.name`,detail:`sheets-formula.functionList.GAMMADIST.functionParameter.x.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.GAMMADIST.functionParameter.alpha.name`,detail:`sheets-formula.functionList.GAMMADIST.functionParameter.alpha.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.GAMMADIST.functionParameter.beta.name`,detail:`sheets-formula.functionList.GAMMADIST.functionParameter.beta.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.GAMMADIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.GAMMADIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:sU.GAMMAINV,functionType:q.Compatibility,description:`sheets-formula.functionList.GAMMAINV.description`,abstract:`sheets-formula.functionList.GAMMAINV.abstract`,functionParameter:[{name:`sheets-formula.functionList.GAMMAINV.functionParameter.probability.name`,detail:`sheets-formula.functionList.GAMMAINV.functionParameter.probability.detail`,example:`0.068094`,require:1,repeat:0},{name:`sheets-formula.functionList.GAMMAINV.functionParameter.alpha.name`,detail:`sheets-formula.functionList.GAMMAINV.functionParameter.alpha.detail`,example:`9`,require:1,repeat:0},{name:`sheets-formula.functionList.GAMMAINV.functionParameter.beta.name`,detail:`sheets-formula.functionList.GAMMAINV.functionParameter.beta.detail`,example:`2`,require:1,repeat:0}]},{functionName:sU.HYPGEOMDIST,functionType:q.Compatibility,description:`sheets-formula.functionList.HYPGEOMDIST.description`,abstract:`sheets-formula.functionList.HYPGEOMDIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.HYPGEOMDIST.functionParameter.sampleS.name`,detail:`sheets-formula.functionList.HYPGEOMDIST.functionParameter.sampleS.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.HYPGEOMDIST.functionParameter.numberSample.name`,detail:`sheets-formula.functionList.HYPGEOMDIST.functionParameter.numberSample.detail`,example:`4`,require:1,repeat:0},{name:`sheets-formula.functionList.HYPGEOMDIST.functionParameter.populationS.name`,detail:`sheets-formula.functionList.HYPGEOMDIST.functionParameter.populationS.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.HYPGEOMDIST.functionParameter.numberPop.name`,detail:`sheets-formula.functionList.HYPGEOMDIST.functionParameter.numberPop.detail`,example:`20`,require:1,repeat:0}]},{functionName:sU.LOGINV,functionType:q.Compatibility,description:`sheets-formula.functionList.LOGINV.description`,abstract:`sheets-formula.functionList.LOGINV.abstract`,functionParameter:[{name:`sheets-formula.functionList.LOGINV.functionParameter.probability.name`,detail:`sheets-formula.functionList.LOGINV.functionParameter.probability.detail`,example:`0.908789`,require:1,repeat:0},{name:`sheets-formula.functionList.LOGINV.functionParameter.mean.name`,detail:`sheets-formula.functionList.LOGINV.functionParameter.mean.detail`,example:`40`,require:1,repeat:0},{name:`sheets-formula.functionList.LOGINV.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.LOGINV.functionParameter.standardDev.detail`,example:`1.5`,require:1,repeat:0}]},{functionName:sU.LOGNORMDIST,functionType:q.Compatibility,description:`sheets-formula.functionList.LOGNORMDIST.description`,abstract:`sheets-formula.functionList.LOGNORMDIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.LOGNORMDIST.functionParameter.x.name`,detail:`sheets-formula.functionList.LOGNORMDIST.functionParameter.x.detail`,example:`42`,require:1,repeat:0},{name:`sheets-formula.functionList.LOGNORMDIST.functionParameter.mean.name`,detail:`sheets-formula.functionList.LOGNORMDIST.functionParameter.mean.detail`,example:`40`,require:1,repeat:0},{name:`sheets-formula.functionList.LOGNORMDIST.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.LOGNORMDIST.functionParameter.standardDev.detail`,example:`1.5`,require:1,repeat:0}]},{functionName:sU.MODE,functionType:q.Compatibility,description:`sheets-formula.functionList.MODE.description`,abstract:`sheets-formula.functionList.MODE.abstract`,functionParameter:[{name:`sheets-formula.functionList.MODE.functionParameter.number1.name`,detail:`sheets-formula.functionList.MODE.functionParameter.number1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.MODE.functionParameter.number2.name`,detail:`sheets-formula.functionList.MODE.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:sU.NEGBINOMDIST,functionType:q.Compatibility,description:`sheets-formula.functionList.NEGBINOMDIST.description`,abstract:`sheets-formula.functionList.NEGBINOMDIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.NEGBINOMDIST.functionParameter.numberF.name`,detail:`sheets-formula.functionList.NEGBINOMDIST.functionParameter.numberF.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.NEGBINOMDIST.functionParameter.numberS.name`,detail:`sheets-formula.functionList.NEGBINOMDIST.functionParameter.numberS.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.NEGBINOMDIST.functionParameter.probabilityS.name`,detail:`sheets-formula.functionList.NEGBINOMDIST.functionParameter.probabilityS.detail`,example:`0.25`,require:1,repeat:0}]},{functionName:sU.NORMDIST,functionType:q.Compatibility,description:`sheets-formula.functionList.NORMDIST.description`,abstract:`sheets-formula.functionList.NORMDIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.NORMDIST.functionParameter.x.name`,detail:`sheets-formula.functionList.NORMDIST.functionParameter.x.detail`,example:`42`,require:1,repeat:0},{name:`sheets-formula.functionList.NORMDIST.functionParameter.mean.name`,detail:`sheets-formula.functionList.NORMDIST.functionParameter.mean.detail`,example:`40`,require:1,repeat:0},{name:`sheets-formula.functionList.NORMDIST.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.NORMDIST.functionParameter.standardDev.detail`,example:`1.5`,require:1,repeat:0},{name:`sheets-formula.functionList.NORMDIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.NORMDIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:sU.NORMINV,functionType:q.Compatibility,description:`sheets-formula.functionList.NORMINV.description`,abstract:`sheets-formula.functionList.NORMINV.abstract`,functionParameter:[{name:`sheets-formula.functionList.NORMINV.functionParameter.probability.name`,detail:`sheets-formula.functionList.NORMINV.functionParameter.probability.detail`,example:`0.908789`,require:1,repeat:0},{name:`sheets-formula.functionList.NORMINV.functionParameter.mean.name`,detail:`sheets-formula.functionList.NORMINV.functionParameter.mean.detail`,example:`40`,require:1,repeat:0},{name:`sheets-formula.functionList.NORMINV.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.NORMINV.functionParameter.standardDev.detail`,example:`1.5`,require:1,repeat:0}]},{functionName:sU.NORMSDIST,functionType:q.Compatibility,description:`sheets-formula.functionList.NORMSDIST.description`,abstract:`sheets-formula.functionList.NORMSDIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.NORMSDIST.functionParameter.z.name`,detail:`sheets-formula.functionList.NORMSDIST.functionParameter.z.detail`,example:`1.333333`,require:1,repeat:0}]},{functionName:sU.NORMSINV,functionType:q.Compatibility,description:`sheets-formula.functionList.NORMSINV.description`,abstract:`sheets-formula.functionList.NORMSINV.abstract`,functionParameter:[{name:`sheets-formula.functionList.NORMSINV.functionParameter.probability.name`,detail:`sheets-formula.functionList.NORMSINV.functionParameter.probability.detail`,example:`0.908789`,require:1,repeat:0}]},{functionName:sU.PERCENTILE,functionType:q.Compatibility,description:`sheets-formula.functionList.PERCENTILE.description`,abstract:`sheets-formula.functionList.PERCENTILE.abstract`,functionParameter:[{name:`sheets-formula.functionList.PERCENTILE.functionParameter.array.name`,detail:`sheets-formula.functionList.PERCENTILE.functionParameter.array.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.PERCENTILE.functionParameter.k.name`,detail:`sheets-formula.functionList.PERCENTILE.functionParameter.k.detail`,example:`0.3`,require:1,repeat:0}]},{functionName:sU.PERCENTRANK,functionType:q.Compatibility,description:`sheets-formula.functionList.PERCENTRANK.description`,abstract:`sheets-formula.functionList.PERCENTRANK.abstract`,functionParameter:[{name:`sheets-formula.functionList.PERCENTRANK.functionParameter.array.name`,detail:`sheets-formula.functionList.PERCENTRANK.functionParameter.array.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.PERCENTRANK.functionParameter.x.name`,detail:`sheets-formula.functionList.PERCENTRANK.functionParameter.x.detail`,example:`1.5`,require:1,repeat:0},{name:`sheets-formula.functionList.PERCENTRANK.functionParameter.significance.name`,detail:`sheets-formula.functionList.PERCENTRANK.functionParameter.significance.detail`,example:`3`,require:0,repeat:0}]},{functionName:sU.POISSON,functionType:q.Compatibility,description:`sheets-formula.functionList.POISSON.description`,abstract:`sheets-formula.functionList.POISSON.abstract`,functionParameter:[{name:`sheets-formula.functionList.POISSON.functionParameter.x.name`,detail:`sheets-formula.functionList.POISSON.functionParameter.x.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.POISSON.functionParameter.mean.name`,detail:`sheets-formula.functionList.POISSON.functionParameter.mean.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.POISSON.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.POISSON.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:sU.QUARTILE,functionType:q.Compatibility,description:`sheets-formula.functionList.QUARTILE.description`,abstract:`sheets-formula.functionList.QUARTILE.abstract`,functionParameter:[{name:`sheets-formula.functionList.QUARTILE.functionParameter.array.name`,detail:`sheets-formula.functionList.QUARTILE.functionParameter.array.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.QUARTILE.functionParameter.quart.name`,detail:`sheets-formula.functionList.QUARTILE.functionParameter.quart.detail`,example:`1`,require:1,repeat:0}]},{functionName:sU.RANK,functionType:q.Compatibility,description:`sheets-formula.functionList.RANK.description`,abstract:`sheets-formula.functionList.RANK.abstract`,functionParameter:[{name:`sheets-formula.functionList.RANK.functionParameter.number.name`,detail:`sheets-formula.functionList.RANK.functionParameter.number.detail`,example:`A3`,require:1,repeat:0},{name:`sheets-formula.functionList.RANK.functionParameter.ref.name`,detail:`sheets-formula.functionList.RANK.functionParameter.ref.detail`,example:`A2:A6`,require:1,repeat:0},{name:`sheets-formula.functionList.RANK.functionParameter.order.name`,detail:`sheets-formula.functionList.RANK.functionParameter.order.detail`,example:`1`,require:0,repeat:0}]},{functionName:sU.STDEV,functionType:q.Compatibility,description:`sheets-formula.functionList.STDEV.description`,abstract:`sheets-formula.functionList.STDEV.abstract`,functionParameter:[{name:`sheets-formula.functionList.STDEV.functionParameter.number1.name`,detail:`sheets-formula.functionList.STDEV.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.STDEV.functionParameter.number2.name`,detail:`sheets-formula.functionList.STDEV.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:sU.STDEVP,functionType:q.Compatibility,description:`sheets-formula.functionList.STDEVP.description`,abstract:`sheets-formula.functionList.STDEVP.abstract`,functionParameter:[{name:`sheets-formula.functionList.STDEVP.functionParameter.number1.name`,detail:`sheets-formula.functionList.STDEVP.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.STDEVP.functionParameter.number2.name`,detail:`sheets-formula.functionList.STDEVP.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:sU.TDIST,functionType:q.Compatibility,description:`sheets-formula.functionList.TDIST.description`,abstract:`sheets-formula.functionList.TDIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.TDIST.functionParameter.x.name`,detail:`sheets-formula.functionList.TDIST.functionParameter.x.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.TDIST.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.TDIST.functionParameter.degFreedom.detail`,example:`3`,require:1,repeat:0},{name:`sheets-formula.functionList.TDIST.functionParameter.tails.name`,detail:`sheets-formula.functionList.TDIST.functionParameter.tails.detail`,example:`1`,require:1,repeat:0}]},{functionName:sU.TINV,functionType:q.Compatibility,description:`sheets-formula.functionList.TINV.description`,abstract:`sheets-formula.functionList.TINV.abstract`,functionParameter:[{name:`sheets-formula.functionList.TINV.functionParameter.probability.name`,detail:`sheets-formula.functionList.TINV.functionParameter.probability.detail`,example:`0.75`,require:1,repeat:0},{name:`sheets-formula.functionList.TINV.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.TINV.functionParameter.degFreedom.detail`,example:`2`,require:1,repeat:0}]},{functionName:sU.TTEST,functionType:q.Compatibility,description:`sheets-formula.functionList.TTEST.description`,abstract:`sheets-formula.functionList.TTEST.abstract`,functionParameter:[{name:`sheets-formula.functionList.TTEST.functionParameter.array1.name`,detail:`sheets-formula.functionList.TTEST.functionParameter.array1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.TTEST.functionParameter.array2.name`,detail:`sheets-formula.functionList.TTEST.functionParameter.array2.detail`,example:`B1:B4`,require:1,repeat:0},{name:`sheets-formula.functionList.TTEST.functionParameter.tails.name`,detail:`sheets-formula.functionList.TTEST.functionParameter.tails.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.TTEST.functionParameter.type.name`,detail:`sheets-formula.functionList.TTEST.functionParameter.type.detail`,example:`1`,require:1,repeat:0}]},{functionName:sU.VAR,functionType:q.Compatibility,description:`sheets-formula.functionList.VAR.description`,abstract:`sheets-formula.functionList.VAR.abstract`,functionParameter:[{name:`sheets-formula.functionList.VAR.functionParameter.number1.name`,detail:`sheets-formula.functionList.VAR.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.VAR.functionParameter.number2.name`,detail:`sheets-formula.functionList.VAR.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:sU.VARP,functionType:q.Compatibility,description:`sheets-formula.functionList.VARP.description`,abstract:`sheets-formula.functionList.VARP.abstract`,functionParameter:[{name:`sheets-formula.functionList.VARP.functionParameter.number1.name`,detail:`sheets-formula.functionList.VARP.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.VARP.functionParameter.number2.name`,detail:`sheets-formula.functionList.VARP.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:sU.WEIBULL,functionType:q.Compatibility,description:`sheets-formula.functionList.WEIBULL.description`,abstract:`sheets-formula.functionList.WEIBULL.abstract`,functionParameter:[{name:`sheets-formula.functionList.WEIBULL.functionParameter.x.name`,detail:`sheets-formula.functionList.WEIBULL.functionParameter.x.detail`,example:`105`,require:1,repeat:0},{name:`sheets-formula.functionList.WEIBULL.functionParameter.alpha.name`,detail:`sheets-formula.functionList.WEIBULL.functionParameter.alpha.detail`,example:`20`,require:1,repeat:0},{name:`sheets-formula.functionList.WEIBULL.functionParameter.beta.name`,detail:`sheets-formula.functionList.WEIBULL.functionParameter.beta.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.WEIBULL.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.WEIBULL.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:sU.ZTEST,functionType:q.Compatibility,description:`sheets-formula.functionList.ZTEST.description`,abstract:`sheets-formula.functionList.ZTEST.abstract`,functionParameter:[{name:`sheets-formula.functionList.ZTEST.functionParameter.array.name`,detail:`sheets-formula.functionList.ZTEST.functionParameter.array.detail`,example:`A2:A11`,require:1,repeat:0},{name:`sheets-formula.functionList.ZTEST.functionParameter.x.name`,detail:`sheets-formula.functionList.ZTEST.functionParameter.x.detail`,example:`4`,require:1,repeat:0},{name:`sheets-formula.functionList.ZTEST.functionParameter.sigma.name`,detail:`sheets-formula.functionList.ZTEST.functionParameter.sigma.detail`,example:`10`,require:0,repeat:0}]}],xmt=[{functionName:cU.CUBEKPIMEMBER,functionType:q.Cube,description:`sheets-formula.functionList.CUBEKPIMEMBER.description`,abstract:`sheets-formula.functionList.CUBEKPIMEMBER.abstract`,functionParameter:[{name:`sheets-formula.functionList.CUBEKPIMEMBER.functionParameter.number1.name`,detail:`sheets-formula.functionList.CUBEKPIMEMBER.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.CUBEKPIMEMBER.functionParameter.number2.name`,detail:`sheets-formula.functionList.CUBEKPIMEMBER.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:cU.CUBEMEMBER,functionType:q.Cube,description:`sheets-formula.functionList.CUBEMEMBER.description`,abstract:`sheets-formula.functionList.CUBEMEMBER.abstract`,functionParameter:[{name:`sheets-formula.functionList.CUBEMEMBER.functionParameter.number1.name`,detail:`sheets-formula.functionList.CUBEMEMBER.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.CUBEMEMBER.functionParameter.number2.name`,detail:`sheets-formula.functionList.CUBEMEMBER.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:cU.CUBEMEMBERPROPERTY,functionType:q.Cube,description:`sheets-formula.functionList.CUBEMEMBERPROPERTY.description`,abstract:`sheets-formula.functionList.CUBEMEMBERPROPERTY.abstract`,functionParameter:[{name:`sheets-formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number1.name`,detail:`sheets-formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number2.name`,detail:`sheets-formula.functionList.CUBEMEMBERPROPERTY.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:cU.CUBERANKEDMEMBER,functionType:q.Cube,description:`sheets-formula.functionList.CUBERANKEDMEMBER.description`,abstract:`sheets-formula.functionList.CUBERANKEDMEMBER.abstract`,functionParameter:[{name:`sheets-formula.functionList.CUBERANKEDMEMBER.functionParameter.number1.name`,detail:`sheets-formula.functionList.CUBERANKEDMEMBER.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.CUBERANKEDMEMBER.functionParameter.number2.name`,detail:`sheets-formula.functionList.CUBERANKEDMEMBER.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:cU.CUBESET,functionType:q.Cube,description:`sheets-formula.functionList.CUBESET.description`,abstract:`sheets-formula.functionList.CUBESET.abstract`,functionParameter:[{name:`sheets-formula.functionList.CUBESET.functionParameter.number1.name`,detail:`sheets-formula.functionList.CUBESET.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.CUBESET.functionParameter.number2.name`,detail:`sheets-formula.functionList.CUBESET.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:cU.CUBESETCOUNT,functionType:q.Cube,description:`sheets-formula.functionList.CUBESETCOUNT.description`,abstract:`sheets-formula.functionList.CUBESETCOUNT.abstract`,functionParameter:[{name:`sheets-formula.functionList.CUBESETCOUNT.functionParameter.number1.name`,detail:`sheets-formula.functionList.CUBESETCOUNT.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.CUBESETCOUNT.functionParameter.number2.name`,detail:`sheets-formula.functionList.CUBESETCOUNT.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:cU.CUBEVALUE,functionType:q.Cube,description:`sheets-formula.functionList.CUBEVALUE.description`,abstract:`sheets-formula.functionList.CUBEVALUE.abstract`,functionParameter:[{name:`sheets-formula.functionList.CUBEVALUE.functionParameter.number1.name`,detail:`sheets-formula.functionList.CUBEVALUE.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.CUBEVALUE.functionParameter.number2.name`,detail:`sheets-formula.functionList.CUBEVALUE.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]}],Smt=[{functionName:mU.DAVERAGE,functionType:q.Database,description:`sheets-formula.functionList.DAVERAGE.description`,abstract:`sheets-formula.functionList.DAVERAGE.abstract`,functionParameter:[{name:`sheets-formula.functionList.DAVERAGE.functionParameter.database.name`,detail:`sheets-formula.functionList.DAVERAGE.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DAVERAGE.functionParameter.field.name`,detail:`sheets-formula.functionList.DAVERAGE.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DAVERAGE.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DAVERAGE.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]},{functionName:mU.DCOUNT,functionType:q.Database,description:`sheets-formula.functionList.DCOUNT.description`,abstract:`sheets-formula.functionList.DCOUNT.abstract`,functionParameter:[{name:`sheets-formula.functionList.DCOUNT.functionParameter.database.name`,detail:`sheets-formula.functionList.DCOUNT.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DCOUNT.functionParameter.field.name`,detail:`sheets-formula.functionList.DCOUNT.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DCOUNT.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DCOUNT.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]},{functionName:mU.DCOUNTA,functionType:q.Database,description:`sheets-formula.functionList.DCOUNTA.description`,abstract:`sheets-formula.functionList.DCOUNTA.abstract`,functionParameter:[{name:`sheets-formula.functionList.DCOUNTA.functionParameter.database.name`,detail:`sheets-formula.functionList.DCOUNTA.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DCOUNTA.functionParameter.field.name`,detail:`sheets-formula.functionList.DCOUNTA.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DCOUNTA.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DCOUNTA.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]},{functionName:mU.DGET,functionType:q.Database,description:`sheets-formula.functionList.DGET.description`,abstract:`sheets-formula.functionList.DGET.abstract`,functionParameter:[{name:`sheets-formula.functionList.DGET.functionParameter.database.name`,detail:`sheets-formula.functionList.DGET.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DGET.functionParameter.field.name`,detail:`sheets-formula.functionList.DGET.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DGET.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DGET.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]},{functionName:mU.DMAX,functionType:q.Database,description:`sheets-formula.functionList.DMAX.description`,abstract:`sheets-formula.functionList.DMAX.abstract`,functionParameter:[{name:`sheets-formula.functionList.DMAX.functionParameter.database.name`,detail:`sheets-formula.functionList.DMAX.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DMAX.functionParameter.field.name`,detail:`sheets-formula.functionList.DMAX.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DMAX.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DMAX.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]},{functionName:mU.DMIN,functionType:q.Database,description:`sheets-formula.functionList.DMIN.description`,abstract:`sheets-formula.functionList.DMIN.abstract`,functionParameter:[{name:`sheets-formula.functionList.DMIN.functionParameter.database.name`,detail:`sheets-formula.functionList.DMIN.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DMIN.functionParameter.field.name`,detail:`sheets-formula.functionList.DMIN.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DMIN.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DMIN.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]},{functionName:mU.DPRODUCT,functionType:q.Database,description:`sheets-formula.functionList.DPRODUCT.description`,abstract:`sheets-formula.functionList.DPRODUCT.abstract`,functionParameter:[{name:`sheets-formula.functionList.DPRODUCT.functionParameter.database.name`,detail:`sheets-formula.functionList.DPRODUCT.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DPRODUCT.functionParameter.field.name`,detail:`sheets-formula.functionList.DPRODUCT.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DPRODUCT.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DPRODUCT.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]},{functionName:mU.DSTDEV,functionType:q.Database,description:`sheets-formula.functionList.DSTDEV.description`,abstract:`sheets-formula.functionList.DSTDEV.abstract`,functionParameter:[{name:`sheets-formula.functionList.DSTDEV.functionParameter.database.name`,detail:`sheets-formula.functionList.DSTDEV.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DSTDEV.functionParameter.field.name`,detail:`sheets-formula.functionList.DSTDEV.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DSTDEV.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DSTDEV.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]},{functionName:mU.DSTDEVP,functionType:q.Database,description:`sheets-formula.functionList.DSTDEVP.description`,abstract:`sheets-formula.functionList.DSTDEVP.abstract`,functionParameter:[{name:`sheets-formula.functionList.DSTDEVP.functionParameter.database.name`,detail:`sheets-formula.functionList.DSTDEVP.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DSTDEVP.functionParameter.field.name`,detail:`sheets-formula.functionList.DSTDEVP.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DSTDEVP.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DSTDEVP.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]},{functionName:mU.DSUM,functionType:q.Database,description:`sheets-formula.functionList.DSUM.description`,abstract:`sheets-formula.functionList.DSUM.abstract`,functionParameter:[{name:`sheets-formula.functionList.DSUM.functionParameter.database.name`,detail:`sheets-formula.functionList.DSUM.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DSUM.functionParameter.field.name`,detail:`sheets-formula.functionList.DSUM.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DSUM.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DSUM.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]},{functionName:mU.DVAR,functionType:q.Database,description:`sheets-formula.functionList.DVAR.description`,abstract:`sheets-formula.functionList.DVAR.abstract`,functionParameter:[{name:`sheets-formula.functionList.DVAR.functionParameter.database.name`,detail:`sheets-formula.functionList.DVAR.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DVAR.functionParameter.field.name`,detail:`sheets-formula.functionList.DVAR.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DVAR.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DVAR.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]},{functionName:mU.DVARP,functionType:q.Database,description:`sheets-formula.functionList.DVARP.description`,abstract:`sheets-formula.functionList.DVARP.abstract`,functionParameter:[{name:`sheets-formula.functionList.DVARP.functionParameter.database.name`,detail:`sheets-formula.functionList.DVARP.functionParameter.database.detail`,example:`A4:E10`,require:1,repeat:0},{name:`sheets-formula.functionList.DVARP.functionParameter.field.name`,detail:`sheets-formula.functionList.DVARP.functionParameter.field.detail`,example:`D4`,require:1,repeat:0},{name:`sheets-formula.functionList.DVARP.functionParameter.criteria.name`,detail:`sheets-formula.functionList.DVARP.functionParameter.criteria.detail`,example:`A1:B2`,require:1,repeat:0}]}],Cmt=[{functionName:AB.DATE,functionType:q.Date,description:`sheets-formula.functionList.DATE.description`,abstract:`sheets-formula.functionList.DATE.abstract`,functionParameter:[{name:`sheets-formula.functionList.DATE.functionParameter.year.name`,detail:`sheets-formula.functionList.DATE.functionParameter.year.detail`,example:`2024`,require:1,repeat:0},{name:`sheets-formula.functionList.DATE.functionParameter.month.name`,detail:`sheets-formula.functionList.DATE.functionParameter.month.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.DATE.functionParameter.day.name`,detail:`sheets-formula.functionList.DATE.functionParameter.day.detail`,example:`1`,require:1,repeat:0}]},{functionName:AB.DATEDIF,functionType:q.Date,description:`sheets-formula.functionList.DATEDIF.description`,abstract:`sheets-formula.functionList.DATEDIF.abstract`,functionParameter:[{name:`sheets-formula.functionList.DATEDIF.functionParameter.startDate.name`,detail:`sheets-formula.functionList.DATEDIF.functionParameter.startDate.detail`,example:`"2001-6-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.DATEDIF.functionParameter.endDate.name`,detail:`sheets-formula.functionList.DATEDIF.functionParameter.endDate.detail`,example:`"2002-8-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.DATEDIF.functionParameter.method.name`,detail:`sheets-formula.functionList.DATEDIF.functionParameter.method.detail`,example:`"D"`,require:1,repeat:0}]},{functionName:AB.DATEVALUE,functionType:q.Date,description:`sheets-formula.functionList.DATEVALUE.description`,abstract:`sheets-formula.functionList.DATEVALUE.abstract`,functionParameter:[{name:`sheets-formula.functionList.DATEVALUE.functionParameter.dateText.name`,detail:`sheets-formula.functionList.DATEVALUE.functionParameter.dateText.detail`,example:`"2024-8-8"`,require:1,repeat:0}]},{functionName:AB.DAY,functionType:q.Date,description:`sheets-formula.functionList.DAY.description`,abstract:`sheets-formula.functionList.DAY.abstract`,functionParameter:[{name:`sheets-formula.functionList.DAY.functionParameter.serialNumber.name`,detail:`sheets-formula.functionList.DAY.functionParameter.serialNumber.detail`,example:`"1969-7-20"`,require:1,repeat:0}]},{functionName:AB.DAYS,functionType:q.Date,description:`sheets-formula.functionList.DAYS.description`,abstract:`sheets-formula.functionList.DAYS.abstract`,functionParameter:[{name:`sheets-formula.functionList.DAYS.functionParameter.endDate.name`,detail:`sheets-formula.functionList.DAYS.functionParameter.endDate.detail`,example:`"2021-12-31"`,require:1,repeat:0},{name:`sheets-formula.functionList.DAYS.functionParameter.startDate.name`,detail:`sheets-formula.functionList.DAYS.functionParameter.startDate.detail`,example:`"2021-1-1"`,require:1,repeat:0}]},{functionName:AB.DAYS360,functionType:q.Date,description:`sheets-formula.functionList.DAYS360.description`,abstract:`sheets-formula.functionList.DAYS360.abstract`,functionParameter:[{name:`sheets-formula.functionList.DAYS360.functionParameter.startDate.name`,detail:`sheets-formula.functionList.DAYS360.functionParameter.startDate.detail`,example:`"2021-1-29"`,require:1,repeat:0},{name:`sheets-formula.functionList.DAYS360.functionParameter.endDate.name`,detail:`sheets-formula.functionList.DAYS360.functionParameter.endDate.detail`,example:`"2021-3-31"`,require:1,repeat:0},{name:`sheets-formula.functionList.DAYS360.functionParameter.method.name`,detail:`sheets-formula.functionList.DAYS360.functionParameter.method.detail`,example:`1`,require:0,repeat:0}]},{functionName:AB.EDATE,functionType:q.Date,description:`sheets-formula.functionList.EDATE.description`,abstract:`sheets-formula.functionList.EDATE.abstract`,functionParameter:[{name:`sheets-formula.functionList.EDATE.functionParameter.startDate.name`,detail:`sheets-formula.functionList.EDATE.functionParameter.startDate.detail`,example:`A1`,require:1,repeat:0},{name:`sheets-formula.functionList.EDATE.functionParameter.months.name`,detail:`sheets-formula.functionList.EDATE.functionParameter.months.detail`,example:`1`,require:1,repeat:0}]},{functionName:AB.EOMONTH,functionType:q.Date,description:`sheets-formula.functionList.EOMONTH.description`,abstract:`sheets-formula.functionList.EOMONTH.abstract`,functionParameter:[{name:`sheets-formula.functionList.EOMONTH.functionParameter.startDate.name`,detail:`sheets-formula.functionList.EOMONTH.functionParameter.startDate.detail`,example:`"2011-1-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.EOMONTH.functionParameter.months.name`,detail:`sheets-formula.functionList.EOMONTH.functionParameter.months.detail`,example:`1`,require:1,repeat:0}]},{functionName:AB.EPOCHTODATE,functionType:q.Date,description:`sheets-formula.functionList.EPOCHTODATE.description`,abstract:`sheets-formula.functionList.EPOCHTODATE.abstract`,functionParameter:[{name:`sheets-formula.functionList.EPOCHTODATE.functionParameter.timestamp.name`,detail:`sheets-formula.functionList.EPOCHTODATE.functionParameter.timestamp.detail`,example:`1655906710`,require:1,repeat:0},{name:`sheets-formula.functionList.EPOCHTODATE.functionParameter.unit.name`,detail:`sheets-formula.functionList.EPOCHTODATE.functionParameter.unit.detail`,example:`1`,require:0,repeat:0}]},{functionName:AB.HOUR,functionType:q.Date,description:`sheets-formula.functionList.HOUR.description`,abstract:`sheets-formula.functionList.HOUR.abstract`,functionParameter:[{name:`sheets-formula.functionList.HOUR.functionParameter.serialNumber.name`,detail:`sheets-formula.functionList.HOUR.functionParameter.serialNumber.detail`,example:`"2011-7-18 7:45"`,require:1,repeat:0}]},{functionName:AB.ISOWEEKNUM,functionType:q.Date,description:`sheets-formula.functionList.ISOWEEKNUM.description`,abstract:`sheets-formula.functionList.ISOWEEKNUM.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISOWEEKNUM.functionParameter.date.name`,detail:`sheets-formula.functionList.ISOWEEKNUM.functionParameter.date.detail`,example:`"2012-3-9"`,require:1,repeat:0}]},{functionName:AB.MINUTE,functionType:q.Date,description:`sheets-formula.functionList.MINUTE.description`,abstract:`sheets-formula.functionList.MINUTE.abstract`,functionParameter:[{name:`sheets-formula.functionList.MINUTE.functionParameter.serialNumber.name`,detail:`sheets-formula.functionList.MINUTE.functionParameter.serialNumber.detail`,example:`"12:45"`,require:1,repeat:0}]},{functionName:AB.MONTH,functionType:q.Date,description:`sheets-formula.functionList.MONTH.description`,abstract:`sheets-formula.functionList.MONTH.abstract`,functionParameter:[{name:`sheets-formula.functionList.MONTH.functionParameter.serialNumber.name`,detail:`sheets-formula.functionList.MONTH.functionParameter.serialNumber.detail`,example:`"1969-7-20"`,require:1,repeat:0}]},{functionName:AB.NETWORKDAYS,functionType:q.Date,description:`sheets-formula.functionList.NETWORKDAYS.description`,abstract:`sheets-formula.functionList.NETWORKDAYS.abstract`,functionParameter:[{name:`sheets-formula.functionList.NETWORKDAYS.functionParameter.startDate.name`,detail:`sheets-formula.functionList.NETWORKDAYS.functionParameter.startDate.detail`,example:`"2012-10-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.NETWORKDAYS.functionParameter.endDate.name`,detail:`sheets-formula.functionList.NETWORKDAYS.functionParameter.endDate.detail`,example:`"2013-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.NETWORKDAYS.functionParameter.holidays.name`,detail:`sheets-formula.functionList.NETWORKDAYS.functionParameter.holidays.detail`,example:`"2012-11-22"`,require:0,repeat:0}]},{functionName:AB.NETWORKDAYS_INTL,functionType:q.Date,description:`sheets-formula.functionList.NETWORKDAYS_INTL.description`,abstract:`sheets-formula.functionList.NETWORKDAYS_INTL.abstract`,functionParameter:[{name:`sheets-formula.functionList.NETWORKDAYS_INTL.functionParameter.startDate.name`,detail:`sheets-formula.functionList.NETWORKDAYS_INTL.functionParameter.startDate.detail`,example:`"2012-10-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.NETWORKDAYS_INTL.functionParameter.endDate.name`,detail:`sheets-formula.functionList.NETWORKDAYS_INTL.functionParameter.endDate.detail`,example:`"2013-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.NETWORKDAYS_INTL.functionParameter.weekend.name`,detail:`sheets-formula.functionList.NETWORKDAYS_INTL.functionParameter.weekend.detail`,example:`6`,require:0,repeat:0},{name:`sheets-formula.functionList.NETWORKDAYS_INTL.functionParameter.holidays.name`,detail:`sheets-formula.functionList.NETWORKDAYS_INTL.functionParameter.holidays.detail`,example:`"2012-11-22"`,require:0,repeat:0}]},{functionName:AB.NOW,functionType:q.Date,description:`sheets-formula.functionList.NOW.description`,abstract:`sheets-formula.functionList.NOW.abstract`,functionParameter:[]},{functionName:AB.SECOND,functionType:q.Date,description:`sheets-formula.functionList.SECOND.description`,abstract:`sheets-formula.functionList.SECOND.abstract`,functionParameter:[{name:`sheets-formula.functionList.SECOND.functionParameter.serialNumber.name`,detail:`sheets-formula.functionList.SECOND.functionParameter.serialNumber.detail`,example:`"4:48:18"`,require:1,repeat:0}]},{functionName:AB.TIME,functionType:q.Date,description:`sheets-formula.functionList.TIME.description`,abstract:`sheets-formula.functionList.TIME.abstract`,functionParameter:[{name:`sheets-formula.functionList.TIME.functionParameter.hour.name`,detail:`sheets-formula.functionList.TIME.functionParameter.hour.detail`,example:`15`,require:1,repeat:0},{name:`sheets-formula.functionList.TIME.functionParameter.minute.name`,detail:`sheets-formula.functionList.TIME.functionParameter.minute.detail`,example:`20`,require:1,repeat:0},{name:`sheets-formula.functionList.TIME.functionParameter.second.name`,detail:`sheets-formula.functionList.TIME.functionParameter.second.detail`,example:`59`,require:1,repeat:0}]},{functionName:AB.TIMEVALUE,functionType:q.Date,description:`sheets-formula.functionList.TIMEVALUE.description`,abstract:`sheets-formula.functionList.TIMEVALUE.abstract`,functionParameter:[{name:`sheets-formula.functionList.TIMEVALUE.functionParameter.timeText.name`,detail:`sheets-formula.functionList.TIMEVALUE.functionParameter.timeText.detail`,example:`"15:20:59"`,require:1,repeat:0}]},{functionName:AB.TO_DATE,functionType:q.Date,description:`sheets-formula.functionList.TO_DATE.description`,abstract:`sheets-formula.functionList.TO_DATE.abstract`,functionParameter:[{name:`sheets-formula.functionList.TO_DATE.functionParameter.value.name`,detail:`sheets-formula.functionList.TO_DATE.functionParameter.value.detail`,example:`40826.4375`,require:1,repeat:0}]},{functionName:AB.TODAY,functionType:q.Date,description:`sheets-formula.functionList.TODAY.description`,abstract:`sheets-formula.functionList.TODAY.abstract`,functionParameter:[]},{functionName:AB.WEEKDAY,functionType:q.Date,description:`sheets-formula.functionList.WEEKDAY.description`,abstract:`sheets-formula.functionList.WEEKDAY.abstract`,functionParameter:[{name:`sheets-formula.functionList.WEEKDAY.functionParameter.serialNumber.name`,detail:`sheets-formula.functionList.WEEKDAY.functionParameter.serialNumber.detail`,example:`"2008-2-14"`,require:1,repeat:0},{name:`sheets-formula.functionList.WEEKDAY.functionParameter.returnType.name`,detail:`sheets-formula.functionList.WEEKDAY.functionParameter.returnType.detail`,example:`2`,require:0,repeat:0}]},{functionName:AB.WEEKNUM,functionType:q.Date,description:`sheets-formula.functionList.WEEKNUM.description`,abstract:`sheets-formula.functionList.WEEKNUM.abstract`,functionParameter:[{name:`sheets-formula.functionList.WEEKNUM.functionParameter.serialNumber.name`,detail:`sheets-formula.functionList.WEEKNUM.functionParameter.serialNumber.detail`,example:`"2012-3-9"`,require:1,repeat:0},{name:`sheets-formula.functionList.WEEKNUM.functionParameter.returnType.name`,detail:`sheets-formula.functionList.WEEKNUM.functionParameter.returnType.detail`,example:`2`,require:0,repeat:0}]},{functionName:AB.WORKDAY,functionType:q.Date,description:`sheets-formula.functionList.WORKDAY.description`,abstract:`sheets-formula.functionList.WORKDAY.abstract`,functionParameter:[{name:`sheets-formula.functionList.WORKDAY.functionParameter.startDate.name`,detail:`sheets-formula.functionList.WORKDAY.functionParameter.startDate.detail`,example:`"2008-10-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.WORKDAY.functionParameter.days.name`,detail:`sheets-formula.functionList.WORKDAY.functionParameter.days.detail`,example:`151`,require:1,repeat:0},{name:`sheets-formula.functionList.WORKDAY.functionParameter.holidays.name`,detail:`sheets-formula.functionList.WORKDAY.functionParameter.holidays.detail`,example:`"2008-11-26"`,require:0,repeat:0}]},{functionName:AB.WORKDAY_INTL,functionType:q.Date,description:`sheets-formula.functionList.WORKDAY_INTL.description`,abstract:`sheets-formula.functionList.WORKDAY_INTL.abstract`,functionParameter:[{name:`sheets-formula.functionList.WORKDAY_INTL.functionParameter.startDate.name`,detail:`sheets-formula.functionList.WORKDAY_INTL.functionParameter.startDate.detail`,example:`"2008-10-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.WORKDAY_INTL.functionParameter.days.name`,detail:`sheets-formula.functionList.WORKDAY_INTL.functionParameter.days.detail`,example:`151`,require:1,repeat:0},{name:`sheets-formula.functionList.WORKDAY_INTL.functionParameter.weekend.name`,detail:`sheets-formula.functionList.WORKDAY_INTL.functionParameter.weekend.detail`,example:`6`,require:0,repeat:0},{name:`sheets-formula.functionList.WORKDAY_INTL.functionParameter.holidays.name`,detail:`sheets-formula.functionList.WORKDAY_INTL.functionParameter.holidays.detail`,example:`"2008-11-26"`,require:0,repeat:0}]},{functionName:AB.YEAR,functionType:q.Date,description:`sheets-formula.functionList.YEAR.description`,abstract:`sheets-formula.functionList.YEAR.abstract`,functionParameter:[{name:`sheets-formula.functionList.YEAR.functionParameter.serialNumber.name`,detail:`sheets-formula.functionList.YEAR.functionParameter.serialNumber.detail`,example:`"1969-7-20"`,require:1,repeat:0}]},{functionName:AB.YEARFRAC,functionType:q.Date,description:`sheets-formula.functionList.YEARFRAC.description`,abstract:`sheets-formula.functionList.YEARFRAC.abstract`,functionParameter:[{name:`sheets-formula.functionList.YEARFRAC.functionParameter.startDate.name`,detail:`sheets-formula.functionList.YEARFRAC.functionParameter.startDate.detail`,example:`"2012-1-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.YEARFRAC.functionParameter.endDate.name`,detail:`sheets-formula.functionList.YEARFRAC.functionParameter.endDate.detail`,example:`"2012-7-30"`,require:1,repeat:0},{name:`sheets-formula.functionList.YEARFRAC.functionParameter.basis.name`,detail:`sheets-formula.functionList.YEARFRAC.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]}],wmt=[{functionName:jB.BESSELI,functionType:q.Engineering,description:`sheets-formula.functionList.BESSELI.description`,abstract:`sheets-formula.functionList.BESSELI.abstract`,functionParameter:[{name:`sheets-formula.functionList.BESSELI.functionParameter.x.name`,detail:`sheets-formula.functionList.BESSELI.functionParameter.x.detail`,example:`1.5`,require:1,repeat:0},{name:`sheets-formula.functionList.BESSELI.functionParameter.n.name`,detail:`sheets-formula.functionList.BESSELI.functionParameter.n.detail`,example:`1`,require:1,repeat:0}]},{functionName:jB.BESSELJ,functionType:q.Engineering,description:`sheets-formula.functionList.BESSELJ.description`,abstract:`sheets-formula.functionList.BESSELJ.abstract`,functionParameter:[{name:`sheets-formula.functionList.BESSELJ.functionParameter.x.name`,detail:`sheets-formula.functionList.BESSELJ.functionParameter.x.detail`,example:`1.5`,require:1,repeat:0},{name:`sheets-formula.functionList.BESSELJ.functionParameter.n.name`,detail:`sheets-formula.functionList.BESSELJ.functionParameter.n.detail`,example:`1`,require:1,repeat:0}]},{functionName:jB.BESSELK,functionType:q.Engineering,description:`sheets-formula.functionList.BESSELK.description`,abstract:`sheets-formula.functionList.BESSELK.abstract`,functionParameter:[{name:`sheets-formula.functionList.BESSELK.functionParameter.x.name`,detail:`sheets-formula.functionList.BESSELK.functionParameter.x.detail`,example:`1.5`,require:1,repeat:0},{name:`sheets-formula.functionList.BESSELK.functionParameter.n.name`,detail:`sheets-formula.functionList.BESSELK.functionParameter.n.detail`,example:`1`,require:1,repeat:0}]},{functionName:jB.BESSELY,functionType:q.Engineering,description:`sheets-formula.functionList.BESSELY.description`,abstract:`sheets-formula.functionList.BESSELY.abstract`,functionParameter:[{name:`sheets-formula.functionList.BESSELY.functionParameter.x.name`,detail:`sheets-formula.functionList.BESSELY.functionParameter.x.detail`,example:`1.5`,require:1,repeat:0},{name:`sheets-formula.functionList.BESSELY.functionParameter.n.name`,detail:`sheets-formula.functionList.BESSELY.functionParameter.n.detail`,example:`1`,require:1,repeat:0}]},{functionName:jB.BIN2DEC,functionType:q.Engineering,description:`sheets-formula.functionList.BIN2DEC.description`,abstract:`sheets-formula.functionList.BIN2DEC.abstract`,functionParameter:[{name:`sheets-formula.functionList.BIN2DEC.functionParameter.number.name`,detail:`sheets-formula.functionList.BIN2DEC.functionParameter.number.detail`,example:`1100100`,require:1,repeat:0}]},{functionName:jB.BIN2HEX,functionType:q.Engineering,description:`sheets-formula.functionList.BIN2HEX.description`,abstract:`sheets-formula.functionList.BIN2HEX.abstract`,functionParameter:[{name:`sheets-formula.functionList.BIN2HEX.functionParameter.number.name`,detail:`sheets-formula.functionList.BIN2HEX.functionParameter.number.detail`,example:`11111011`,require:1,repeat:0},{name:`sheets-formula.functionList.BIN2HEX.functionParameter.places.name`,detail:`sheets-formula.functionList.BIN2HEX.functionParameter.places.detail`,example:`4`,require:0,repeat:0}]},{functionName:jB.BIN2OCT,functionType:q.Engineering,description:`sheets-formula.functionList.BIN2OCT.description`,abstract:`sheets-formula.functionList.BIN2OCT.abstract`,functionParameter:[{name:`sheets-formula.functionList.BIN2OCT.functionParameter.number.name`,detail:`sheets-formula.functionList.BIN2OCT.functionParameter.number.detail`,example:`1001`,require:1,repeat:0},{name:`sheets-formula.functionList.BIN2OCT.functionParameter.places.name`,detail:`sheets-formula.functionList.BIN2OCT.functionParameter.places.detail`,example:`3`,require:0,repeat:0}]},{functionName:jB.BITAND,functionType:q.Engineering,description:`sheets-formula.functionList.BITAND.description`,abstract:`sheets-formula.functionList.BITAND.abstract`,functionParameter:[{name:`sheets-formula.functionList.BITAND.functionParameter.number1.name`,detail:`sheets-formula.functionList.BITAND.functionParameter.number1.detail`,example:`13`,require:1,repeat:0},{name:`sheets-formula.functionList.BITAND.functionParameter.number2.name`,detail:`sheets-formula.functionList.BITAND.functionParameter.number2.detail`,example:`25`,require:1,repeat:0}]},{functionName:jB.BITLSHIFT,functionType:q.Engineering,description:`sheets-formula.functionList.BITLSHIFT.description`,abstract:`sheets-formula.functionList.BITLSHIFT.abstract`,functionParameter:[{name:`sheets-formula.functionList.BITLSHIFT.functionParameter.number.name`,detail:`sheets-formula.functionList.BITLSHIFT.functionParameter.number.detail`,example:`4`,require:1,repeat:0},{name:`sheets-formula.functionList.BITLSHIFT.functionParameter.shiftAmount.name`,detail:`sheets-formula.functionList.BITLSHIFT.functionParameter.shiftAmount.detail`,example:`2`,require:1,repeat:0}]},{functionName:jB.BITOR,functionType:q.Engineering,description:`sheets-formula.functionList.BITOR.description`,abstract:`sheets-formula.functionList.BITOR.abstract`,functionParameter:[{name:`sheets-formula.functionList.BITOR.functionParameter.number1.name`,detail:`sheets-formula.functionList.BITOR.functionParameter.number1.detail`,example:`23`,require:1,repeat:0},{name:`sheets-formula.functionList.BITOR.functionParameter.number2.name`,detail:`sheets-formula.functionList.BITOR.functionParameter.number2.detail`,example:`10`,require:1,repeat:0}]},{functionName:jB.BITRSHIFT,functionType:q.Engineering,description:`sheets-formula.functionList.BITRSHIFT.description`,abstract:`sheets-formula.functionList.BITRSHIFT.abstract`,functionParameter:[{name:`sheets-formula.functionList.BITRSHIFT.functionParameter.number.name`,detail:`sheets-formula.functionList.BITRSHIFT.functionParameter.number.detail`,example:`13`,require:1,repeat:0},{name:`sheets-formula.functionList.BITRSHIFT.functionParameter.shiftAmount.name`,detail:`sheets-formula.functionList.BITRSHIFT.functionParameter.shiftAmount.detail`,example:`2`,require:1,repeat:0}]},{functionName:jB.BITXOR,functionType:q.Engineering,description:`sheets-formula.functionList.BITXOR.description`,abstract:`sheets-formula.functionList.BITXOR.abstract`,functionParameter:[{name:`sheets-formula.functionList.BITXOR.functionParameter.number1.name`,detail:`sheets-formula.functionList.BITXOR.functionParameter.number1.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.BITXOR.functionParameter.number2.name`,detail:`sheets-formula.functionList.BITXOR.functionParameter.number2.detail`,example:`3`,require:1,repeat:0}]},{functionName:jB.COMPLEX,functionType:q.Engineering,description:`sheets-formula.functionList.COMPLEX.description`,abstract:`sheets-formula.functionList.COMPLEX.abstract`,functionParameter:[{name:`sheets-formula.functionList.COMPLEX.functionParameter.realNum.name`,detail:`sheets-formula.functionList.COMPLEX.functionParameter.realNum.detail`,example:`3`,require:1,repeat:0},{name:`sheets-formula.functionList.COMPLEX.functionParameter.iNum.name`,detail:`sheets-formula.functionList.COMPLEX.functionParameter.iNum.detail`,example:`4`,require:1,repeat:0},{name:`sheets-formula.functionList.COMPLEX.functionParameter.suffix.name`,detail:`sheets-formula.functionList.COMPLEX.functionParameter.suffix.detail`,example:`"i"`,require:0,repeat:0}]},{functionName:jB.CONVERT,functionType:q.Engineering,description:`sheets-formula.functionList.CONVERT.description`,abstract:`sheets-formula.functionList.CONVERT.abstract`,functionParameter:[{name:`sheets-formula.functionList.CONVERT.functionParameter.number.name`,detail:`sheets-formula.functionList.CONVERT.functionParameter.number.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.CONVERT.functionParameter.fromUnit.name`,detail:`sheets-formula.functionList.CONVERT.functionParameter.fromUnit.detail`,example:`"lbm"`,require:1,repeat:0},{name:`sheets-formula.functionList.CONVERT.functionParameter.toUnit.name`,detail:`sheets-formula.functionList.CONVERT.functionParameter.toUnit.detail`,example:`"kg"`,require:1,repeat:0}]},{functionName:jB.DEC2BIN,functionType:q.Engineering,description:`sheets-formula.functionList.DEC2BIN.description`,abstract:`sheets-formula.functionList.DEC2BIN.abstract`,functionParameter:[{name:`sheets-formula.functionList.DEC2BIN.functionParameter.number.name`,detail:`sheets-formula.functionList.DEC2BIN.functionParameter.number.detail`,example:`9`,require:1,repeat:0},{name:`sheets-formula.functionList.DEC2BIN.functionParameter.places.name`,detail:`sheets-formula.functionList.DEC2BIN.functionParameter.places.detail`,example:`4`,require:0,repeat:0}]},{functionName:jB.DEC2HEX,functionType:q.Engineering,description:`sheets-formula.functionList.DEC2HEX.description`,abstract:`sheets-formula.functionList.DEC2HEX.abstract`,functionParameter:[{name:`sheets-formula.functionList.DEC2HEX.functionParameter.number.name`,detail:`sheets-formula.functionList.DEC2HEX.functionParameter.number.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.DEC2HEX.functionParameter.places.name`,detail:`sheets-formula.functionList.DEC2HEX.functionParameter.places.detail`,example:`4`,require:0,repeat:0}]},{functionName:jB.DEC2OCT,functionType:q.Engineering,description:`sheets-formula.functionList.DEC2OCT.description`,abstract:`sheets-formula.functionList.DEC2OCT.abstract`,functionParameter:[{name:`sheets-formula.functionList.DEC2OCT.functionParameter.number.name`,detail:`sheets-formula.functionList.DEC2OCT.functionParameter.number.detail`,example:`58`,require:1,repeat:0},{name:`sheets-formula.functionList.DEC2OCT.functionParameter.places.name`,detail:`sheets-formula.functionList.DEC2OCT.functionParameter.places.detail`,example:`3`,require:0,repeat:0}]},{functionName:jB.DELTA,functionType:q.Engineering,description:`sheets-formula.functionList.DELTA.description`,abstract:`sheets-formula.functionList.DELTA.abstract`,functionParameter:[{name:`sheets-formula.functionList.DELTA.functionParameter.number1.name`,detail:`sheets-formula.functionList.DELTA.functionParameter.number1.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.DELTA.functionParameter.number2.name`,detail:`sheets-formula.functionList.DELTA.functionParameter.number2.detail`,example:`4`,require:0,repeat:0}]},{functionName:jB.ERF,functionType:q.Engineering,description:`sheets-formula.functionList.ERF.description`,abstract:`sheets-formula.functionList.ERF.abstract`,functionParameter:[{name:`sheets-formula.functionList.ERF.functionParameter.lowerLimit.name`,detail:`sheets-formula.functionList.ERF.functionParameter.lowerLimit.detail`,example:`0.745`,require:1,repeat:0},{name:`sheets-formula.functionList.ERF.functionParameter.upperLimit.name`,detail:`sheets-formula.functionList.ERF.functionParameter.upperLimit.detail`,example:`2`,require:0,repeat:0}]},{functionName:jB.ERF_PRECISE,functionType:q.Engineering,description:`sheets-formula.functionList.ERF_PRECISE.description`,abstract:`sheets-formula.functionList.ERF_PRECISE.abstract`,functionParameter:[{name:`sheets-formula.functionList.ERF_PRECISE.functionParameter.x.name`,detail:`sheets-formula.functionList.ERF_PRECISE.functionParameter.x.detail`,example:`1`,require:1,repeat:0}]},{functionName:jB.ERFC,functionType:q.Engineering,description:`sheets-formula.functionList.ERFC.description`,abstract:`sheets-formula.functionList.ERFC.abstract`,functionParameter:[{name:`sheets-formula.functionList.ERFC.functionParameter.x.name`,detail:`sheets-formula.functionList.ERFC.functionParameter.x.detail`,example:`1`,require:1,repeat:0}]},{functionName:jB.ERFC_PRECISE,functionType:q.Engineering,description:`sheets-formula.functionList.ERFC_PRECISE.description`,abstract:`sheets-formula.functionList.ERFC_PRECISE.abstract`,functionParameter:[{name:`sheets-formula.functionList.ERFC_PRECISE.functionParameter.x.name`,detail:`sheets-formula.functionList.ERFC_PRECISE.functionParameter.x.detail`,example:`1`,require:1,repeat:0}]},{functionName:jB.GESTEP,functionType:q.Engineering,description:`sheets-formula.functionList.GESTEP.description`,abstract:`sheets-formula.functionList.GESTEP.abstract`,functionParameter:[{name:`sheets-formula.functionList.GESTEP.functionParameter.number.name`,detail:`sheets-formula.functionList.GESTEP.functionParameter.number.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.GESTEP.functionParameter.step.name`,detail:`sheets-formula.functionList.GESTEP.functionParameter.step.detail`,example:`4`,require:0,repeat:0}]},{functionName:jB.HEX2BIN,functionType:q.Engineering,description:`sheets-formula.functionList.HEX2BIN.description`,abstract:`sheets-formula.functionList.HEX2BIN.abstract`,functionParameter:[{name:`sheets-formula.functionList.HEX2BIN.functionParameter.number.name`,detail:`sheets-formula.functionList.HEX2BIN.functionParameter.number.detail`,example:`"F"`,require:1,repeat:0},{name:`sheets-formula.functionList.HEX2BIN.functionParameter.places.name`,detail:`sheets-formula.functionList.HEX2BIN.functionParameter.places.detail`,example:`8`,require:0,repeat:0}]},{functionName:jB.HEX2DEC,functionType:q.Engineering,description:`sheets-formula.functionList.HEX2DEC.description`,abstract:`sheets-formula.functionList.HEX2DEC.abstract`,functionParameter:[{name:`sheets-formula.functionList.HEX2DEC.functionParameter.number.name`,detail:`sheets-formula.functionList.HEX2DEC.functionParameter.number.detail`,example:`"A5"`,require:1,repeat:0}]},{functionName:jB.HEX2OCT,functionType:q.Engineering,description:`sheets-formula.functionList.HEX2OCT.description`,abstract:`sheets-formula.functionList.HEX2OCT.abstract`,functionParameter:[{name:`sheets-formula.functionList.HEX2OCT.functionParameter.number.name`,detail:`sheets-formula.functionList.HEX2OCT.functionParameter.number.detail`,example:`"F"`,require:1,repeat:0},{name:`sheets-formula.functionList.HEX2OCT.functionParameter.places.name`,detail:`sheets-formula.functionList.HEX2OCT.functionParameter.places.detail`,example:`3`,require:0,repeat:0}]},{functionName:jB.IMABS,functionType:q.Engineering,description:`sheets-formula.functionList.IMABS.description`,abstract:`sheets-formula.functionList.IMABS.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMABS.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMABS.functionParameter.inumber.detail`,example:`"5+12i"`,require:1,repeat:0}]},{functionName:jB.IMAGINARY,functionType:q.Engineering,description:`sheets-formula.functionList.IMAGINARY.description`,abstract:`sheets-formula.functionList.IMAGINARY.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMAGINARY.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMAGINARY.functionParameter.inumber.detail`,example:`"3+4i"`,require:1,repeat:0}]},{functionName:jB.IMARGUMENT,functionType:q.Engineering,description:`sheets-formula.functionList.IMARGUMENT.description`,abstract:`sheets-formula.functionList.IMARGUMENT.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMARGUMENT.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMARGUMENT.functionParameter.inumber.detail`,example:`"3+4i"`,require:1,repeat:0}]},{functionName:jB.IMCONJUGATE,functionType:q.Engineering,description:`sheets-formula.functionList.IMCONJUGATE.description`,abstract:`sheets-formula.functionList.IMCONJUGATE.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMCONJUGATE.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMCONJUGATE.functionParameter.inumber.detail`,example:`"3+4i"`,require:1,repeat:0}]},{functionName:jB.IMCOS,functionType:q.Engineering,description:`sheets-formula.functionList.IMCOS.description`,abstract:`sheets-formula.functionList.IMCOS.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMCOS.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMCOS.functionParameter.inumber.detail`,example:`"1+i"`,require:1,repeat:0}]},{functionName:jB.IMCOSH,functionType:q.Engineering,description:`sheets-formula.functionList.IMCOSH.description`,abstract:`sheets-formula.functionList.IMCOSH.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMCOSH.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMCOSH.functionParameter.inumber.detail`,example:`"4+3i"`,require:1,repeat:0}]},{functionName:jB.IMCOT,functionType:q.Engineering,description:`sheets-formula.functionList.IMCOT.description`,abstract:`sheets-formula.functionList.IMCOT.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMCOT.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMCOT.functionParameter.inumber.detail`,example:`"4+3i"`,require:1,repeat:0}]},{functionName:jB.IMCOTH,functionType:q.Engineering,description:`sheets-formula.functionList.IMCOTH.description`,abstract:`sheets-formula.functionList.IMCOTH.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMCOTH.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMCOTH.functionParameter.inumber.detail`,example:`"4+3i"`,require:1,repeat:0}]},{functionName:jB.IMCSC,functionType:q.Engineering,description:`sheets-formula.functionList.IMCSC.description`,abstract:`sheets-formula.functionList.IMCSC.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMCSC.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMCSC.functionParameter.inumber.detail`,example:`"4+3i"`,require:1,repeat:0}]},{functionName:jB.IMCSCH,functionType:q.Engineering,description:`sheets-formula.functionList.IMCSCH.description`,abstract:`sheets-formula.functionList.IMCSCH.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMCSCH.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMCSCH.functionParameter.inumber.detail`,example:`"4+3i"`,require:1,repeat:0}]},{functionName:jB.IMDIV,functionType:q.Engineering,description:`sheets-formula.functionList.IMDIV.description`,abstract:`sheets-formula.functionList.IMDIV.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMDIV.functionParameter.inumber1.name`,detail:`sheets-formula.functionList.IMDIV.functionParameter.inumber1.detail`,example:`"-238+240i"`,require:1,repeat:0},{name:`sheets-formula.functionList.IMDIV.functionParameter.inumber2.name`,detail:`sheets-formula.functionList.IMDIV.functionParameter.inumber2.detail`,example:`"10+24i"`,require:1,repeat:0}]},{functionName:jB.IMEXP,functionType:q.Engineering,description:`sheets-formula.functionList.IMEXP.description`,abstract:`sheets-formula.functionList.IMEXP.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMEXP.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMEXP.functionParameter.inumber.detail`,example:`"1+i"`,require:1,repeat:0}]},{functionName:jB.IMLN,functionType:q.Engineering,description:`sheets-formula.functionList.IMLN.description`,abstract:`sheets-formula.functionList.IMLN.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMLN.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMLN.functionParameter.inumber.detail`,example:`"3+4i"`,require:1,repeat:0}]},{functionName:jB.IMLOG,functionType:q.Engineering,description:`sheets-formula.functionList.IMLOG.description`,abstract:`sheets-formula.functionList.IMLOG.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMLOG.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMLOG.functionParameter.inumber.detail`,example:`"3+4i"`,require:1,repeat:0},{name:`sheets-formula.functionList.IMLOG.functionParameter.base.name`,detail:`sheets-formula.functionList.IMLOG.functionParameter.base.detail`,example:`10`,require:0,repeat:0}]},{functionName:jB.IMLOG10,functionType:q.Engineering,description:`sheets-formula.functionList.IMLOG10.description`,abstract:`sheets-formula.functionList.IMLOG10.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMLOG10.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMLOG10.functionParameter.inumber.detail`,example:`"3+4i"`,require:1,repeat:0}]},{functionName:jB.IMLOG2,functionType:q.Engineering,description:`sheets-formula.functionList.IMLOG2.description`,abstract:`sheets-formula.functionList.IMLOG2.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMLOG2.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMLOG2.functionParameter.inumber.detail`,example:`"3+4i"`,require:1,repeat:0}]},{functionName:jB.IMPOWER,functionType:q.Engineering,description:`sheets-formula.functionList.IMPOWER.description`,abstract:`sheets-formula.functionList.IMPOWER.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMPOWER.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMPOWER.functionParameter.inumber.detail`,example:`"2+3i"`,require:1,repeat:0},{name:`sheets-formula.functionList.IMPOWER.functionParameter.number.name`,detail:`sheets-formula.functionList.IMPOWER.functionParameter.number.detail`,example:`3`,require:1,repeat:0}]},{functionName:jB.IMPRODUCT,functionType:q.Engineering,description:`sheets-formula.functionList.IMPRODUCT.description`,abstract:`sheets-formula.functionList.IMPRODUCT.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMPRODUCT.functionParameter.inumber1.name`,detail:`sheets-formula.functionList.IMPRODUCT.functionParameter.inumber1.detail`,example:`"3+4i"`,require:1,repeat:0},{name:`sheets-formula.functionList.IMPRODUCT.functionParameter.inumber2.name`,detail:`sheets-formula.functionList.IMPRODUCT.functionParameter.inumber2.detail`,example:`"5-3i"`,require:0,repeat:1}]},{functionName:jB.IMREAL,functionType:q.Engineering,description:`sheets-formula.functionList.IMREAL.description`,abstract:`sheets-formula.functionList.IMREAL.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMREAL.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMREAL.functionParameter.inumber.detail`,example:`"6-9i"`,require:1,repeat:0}]},{functionName:jB.IMSEC,functionType:q.Engineering,description:`sheets-formula.functionList.IMSEC.description`,abstract:`sheets-formula.functionList.IMSEC.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMSEC.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMSEC.functionParameter.inumber.detail`,example:`"4+3i"`,require:1,repeat:0}]},{functionName:jB.IMSECH,functionType:q.Engineering,description:`sheets-formula.functionList.IMSECH.description`,abstract:`sheets-formula.functionList.IMSECH.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMSECH.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMSECH.functionParameter.inumber.detail`,example:`"4+3i"`,require:1,repeat:0}]},{functionName:jB.IMSIN,functionType:q.Engineering,description:`sheets-formula.functionList.IMSIN.description`,abstract:`sheets-formula.functionList.IMSIN.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMSIN.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMSIN.functionParameter.inumber.detail`,example:`"4+3i"`,require:1,repeat:0}]},{functionName:jB.IMSINH,functionType:q.Engineering,description:`sheets-formula.functionList.IMSINH.description`,abstract:`sheets-formula.functionList.IMSINH.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMSINH.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMSINH.functionParameter.inumber.detail`,example:`"4+3i"`,require:1,repeat:0}]},{functionName:jB.IMSQRT,functionType:q.Engineering,description:`sheets-formula.functionList.IMSQRT.description`,abstract:`sheets-formula.functionList.IMSQRT.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMSQRT.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMSQRT.functionParameter.inumber.detail`,example:`"1+i"`,require:1,repeat:0}]},{functionName:jB.IMSUB,functionType:q.Engineering,description:`sheets-formula.functionList.IMSUB.description`,abstract:`sheets-formula.functionList.IMSUB.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMSUB.functionParameter.inumber1.name`,detail:`sheets-formula.functionList.IMSUB.functionParameter.inumber1.detail`,example:`"13+4i"`,require:1,repeat:0},{name:`sheets-formula.functionList.IMSUB.functionParameter.inumber2.name`,detail:`sheets-formula.functionList.IMSUB.functionParameter.inumber2.detail`,example:`"5+3i"`,require:1,repeat:0}]},{functionName:jB.IMSUM,functionType:q.Engineering,description:`sheets-formula.functionList.IMSUM.description`,abstract:`sheets-formula.functionList.IMSUM.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMSUM.functionParameter.inumber1.name`,detail:`sheets-formula.functionList.IMSUM.functionParameter.inumber1.detail`,example:`"3+4i"`,require:1,repeat:0},{name:`sheets-formula.functionList.IMSUM.functionParameter.inumber2.name`,detail:`sheets-formula.functionList.IMSUM.functionParameter.inumber2.detail`,example:`"5-3i"`,require:0,repeat:1}]},{functionName:jB.IMTAN,functionType:q.Engineering,description:`sheets-formula.functionList.IMTAN.description`,abstract:`sheets-formula.functionList.IMTAN.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMTAN.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMTAN.functionParameter.inumber.detail`,example:`"4+3i"`,require:1,repeat:0}]},{functionName:jB.IMTANH,functionType:q.Engineering,description:`sheets-formula.functionList.IMTANH.description`,abstract:`sheets-formula.functionList.IMTANH.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMTANH.functionParameter.inumber.name`,detail:`sheets-formula.functionList.IMTANH.functionParameter.inumber.detail`,example:`"4+3i"`,require:1,repeat:0}]},{functionName:jB.OCT2BIN,functionType:q.Engineering,description:`sheets-formula.functionList.OCT2BIN.description`,abstract:`sheets-formula.functionList.OCT2BIN.abstract`,functionParameter:[{name:`sheets-formula.functionList.OCT2BIN.functionParameter.number.name`,detail:`sheets-formula.functionList.OCT2BIN.functionParameter.number.detail`,example:`3`,require:1,repeat:0},{name:`sheets-formula.functionList.OCT2BIN.functionParameter.places.name`,detail:`sheets-formula.functionList.OCT2BIN.functionParameter.places.detail`,example:`3`,require:0,repeat:0}]},{functionName:jB.OCT2DEC,functionType:q.Engineering,description:`sheets-formula.functionList.OCT2DEC.description`,abstract:`sheets-formula.functionList.OCT2DEC.abstract`,functionParameter:[{name:`sheets-formula.functionList.OCT2DEC.functionParameter.number.name`,detail:`sheets-formula.functionList.OCT2DEC.functionParameter.number.detail`,example:`54`,require:1,repeat:0}]},{functionName:jB.OCT2HEX,functionType:q.Engineering,description:`sheets-formula.functionList.OCT2HEX.description`,abstract:`sheets-formula.functionList.OCT2HEX.abstract`,functionParameter:[{name:`sheets-formula.functionList.OCT2HEX.functionParameter.number.name`,detail:`sheets-formula.functionList.OCT2HEX.functionParameter.number.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.OCT2HEX.functionParameter.places.name`,detail:`sheets-formula.functionList.OCT2HEX.functionParameter.places.detail`,example:`4`,require:0,repeat:0}]}],Tmt=[{functionName:MB.ACCRINT,functionType:q.Financial,description:`sheets-formula.functionList.ACCRINT.description`,abstract:`sheets-formula.functionList.ACCRINT.abstract`,functionParameter:[{name:`sheets-formula.functionList.ACCRINT.functionParameter.issue.name`,detail:`sheets-formula.functionList.ACCRINT.functionParameter.issue.detail`,example:`"2008-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.ACCRINT.functionParameter.firstInterest.name`,detail:`sheets-formula.functionList.ACCRINT.functionParameter.firstInterest.detail`,example:`"2008-8-31"`,require:1,repeat:0},{name:`sheets-formula.functionList.ACCRINT.functionParameter.settlement.name`,detail:`sheets-formula.functionList.ACCRINT.functionParameter.settlement.detail`,example:`"2008-5-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.ACCRINT.functionParameter.rate.name`,detail:`sheets-formula.functionList.ACCRINT.functionParameter.rate.detail`,example:`10%`,require:1,repeat:0},{name:`sheets-formula.functionList.ACCRINT.functionParameter.par.name`,detail:`sheets-formula.functionList.ACCRINT.functionParameter.par.detail`,example:`1000`,require:1,repeat:0},{name:`sheets-formula.functionList.ACCRINT.functionParameter.frequency.name`,detail:`sheets-formula.functionList.ACCRINT.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.ACCRINT.functionParameter.basis.name`,detail:`sheets-formula.functionList.ACCRINT.functionParameter.basis.detail`,example:`0`,require:0,repeat:0},{name:`sheets-formula.functionList.ACCRINT.functionParameter.calcMethod.name`,detail:`sheets-formula.functionList.ACCRINT.functionParameter.calcMethod.detail`,example:`true`,require:0,repeat:0}]},{functionName:MB.ACCRINTM,functionType:q.Financial,description:`sheets-formula.functionList.ACCRINTM.description`,abstract:`sheets-formula.functionList.ACCRINTM.abstract`,functionParameter:[{name:`sheets-formula.functionList.ACCRINTM.functionParameter.issue.name`,detail:`sheets-formula.functionList.ACCRINTM.functionParameter.issue.detail`,example:`"2008-4-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.ACCRINTM.functionParameter.settlement.name`,detail:`sheets-formula.functionList.ACCRINTM.functionParameter.settlement.detail`,example:`"2008-6-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.ACCRINTM.functionParameter.rate.name`,detail:`sheets-formula.functionList.ACCRINTM.functionParameter.rate.detail`,example:`10%`,require:1,repeat:0},{name:`sheets-formula.functionList.ACCRINTM.functionParameter.par.name`,detail:`sheets-formula.functionList.ACCRINTM.functionParameter.par.detail`,example:`1000`,require:1,repeat:0},{name:`sheets-formula.functionList.ACCRINTM.functionParameter.basis.name`,detail:`sheets-formula.functionList.ACCRINTM.functionParameter.basis.detail`,example:`3`,require:0,repeat:0}]},{functionName:MB.AMORDEGRC,functionType:q.Financial,description:`sheets-formula.functionList.AMORDEGRC.description`,abstract:`sheets-formula.functionList.AMORDEGRC.abstract`,functionParameter:[{name:`sheets-formula.functionList.AMORDEGRC.functionParameter.number1.name`,detail:`sheets-formula.functionList.AMORDEGRC.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.AMORDEGRC.functionParameter.number2.name`,detail:`sheets-formula.functionList.AMORDEGRC.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:MB.AMORLINC,functionType:q.Financial,description:`sheets-formula.functionList.AMORLINC.description`,abstract:`sheets-formula.functionList.AMORLINC.abstract`,functionParameter:[{name:`sheets-formula.functionList.AMORLINC.functionParameter.cost.name`,detail:`sheets-formula.functionList.AMORLINC.functionParameter.cost.detail`,example:`2400`,require:1,repeat:0},{name:`sheets-formula.functionList.AMORLINC.functionParameter.datePurchased.name`,detail:`sheets-formula.functionList.AMORLINC.functionParameter.datePurchased.detail`,example:`"2008-8-19"`,require:1,repeat:0},{name:`sheets-formula.functionList.AMORLINC.functionParameter.firstPeriod.name`,detail:`sheets-formula.functionList.AMORLINC.functionParameter.firstPeriod.detail`,example:`"2008-12-31"`,require:1,repeat:0},{name:`sheets-formula.functionList.AMORLINC.functionParameter.salvage.name`,detail:`sheets-formula.functionList.AMORLINC.functionParameter.salvage.detail`,example:`300`,require:1,repeat:0},{name:`sheets-formula.functionList.AMORLINC.functionParameter.period.name`,detail:`sheets-formula.functionList.AMORLINC.functionParameter.period.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.AMORLINC.functionParameter.rate.name`,detail:`sheets-formula.functionList.AMORLINC.functionParameter.rate.detail`,example:`15%`,require:1,repeat:0},{name:`sheets-formula.functionList.AMORLINC.functionParameter.basis.name`,detail:`sheets-formula.functionList.AMORLINC.functionParameter.basis.detail`,example:`0`,require:0,repeat:0}]},{functionName:MB.COUPDAYBS,functionType:q.Financial,description:`sheets-formula.functionList.COUPDAYBS.description`,abstract:`sheets-formula.functionList.COUPDAYBS.abstract`,functionParameter:[{name:`sheets-formula.functionList.COUPDAYBS.functionParameter.settlement.name`,detail:`sheets-formula.functionList.COUPDAYBS.functionParameter.settlement.detail`,example:`"2011-1-25"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPDAYBS.functionParameter.maturity.name`,detail:`sheets-formula.functionList.COUPDAYBS.functionParameter.maturity.detail`,example:`"2011-11-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPDAYBS.functionParameter.frequency.name`,detail:`sheets-formula.functionList.COUPDAYBS.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPDAYBS.functionParameter.basis.name`,detail:`sheets-formula.functionList.COUPDAYBS.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.COUPDAYS,functionType:q.Financial,description:`sheets-formula.functionList.COUPDAYS.description`,abstract:`sheets-formula.functionList.COUPDAYS.abstract`,functionParameter:[{name:`sheets-formula.functionList.COUPDAYS.functionParameter.settlement.name`,detail:`sheets-formula.functionList.COUPDAYS.functionParameter.settlement.detail`,example:`"2011-1-25"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPDAYS.functionParameter.maturity.name`,detail:`sheets-formula.functionList.COUPDAYS.functionParameter.maturity.detail`,example:`"2011-11-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPDAYS.functionParameter.frequency.name`,detail:`sheets-formula.functionList.COUPDAYS.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPDAYS.functionParameter.basis.name`,detail:`sheets-formula.functionList.COUPDAYS.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.COUPDAYSNC,functionType:q.Financial,description:`sheets-formula.functionList.COUPDAYSNC.description`,abstract:`sheets-formula.functionList.COUPDAYSNC.abstract`,functionParameter:[{name:`sheets-formula.functionList.COUPDAYSNC.functionParameter.settlement.name`,detail:`sheets-formula.functionList.COUPDAYSNC.functionParameter.settlement.detail`,example:`"2011-1-25"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPDAYSNC.functionParameter.maturity.name`,detail:`sheets-formula.functionList.COUPDAYSNC.functionParameter.maturity.detail`,example:`"2011-11-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPDAYSNC.functionParameter.frequency.name`,detail:`sheets-formula.functionList.COUPDAYSNC.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPDAYSNC.functionParameter.basis.name`,detail:`sheets-formula.functionList.COUPDAYSNC.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.COUPNCD,functionType:q.Financial,description:`sheets-formula.functionList.COUPNCD.description`,abstract:`sheets-formula.functionList.COUPNCD.abstract`,functionParameter:[{name:`sheets-formula.functionList.COUPNCD.functionParameter.settlement.name`,detail:`sheets-formula.functionList.COUPNCD.functionParameter.settlement.detail`,example:`"2011-1-25"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPNCD.functionParameter.maturity.name`,detail:`sheets-formula.functionList.COUPNCD.functionParameter.maturity.detail`,example:`"2011-11-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPNCD.functionParameter.frequency.name`,detail:`sheets-formula.functionList.COUPNCD.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPNCD.functionParameter.basis.name`,detail:`sheets-formula.functionList.COUPNCD.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.COUPNUM,functionType:q.Financial,description:`sheets-formula.functionList.COUPNUM.description`,abstract:`sheets-formula.functionList.COUPNUM.abstract`,functionParameter:[{name:`sheets-formula.functionList.COUPNUM.functionParameter.settlement.name`,detail:`sheets-formula.functionList.COUPNUM.functionParameter.settlement.detail`,example:`"2011-1-25"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPNUM.functionParameter.maturity.name`,detail:`sheets-formula.functionList.COUPNUM.functionParameter.maturity.detail`,example:`"2011-11-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPNUM.functionParameter.frequency.name`,detail:`sheets-formula.functionList.COUPNUM.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPNUM.functionParameter.basis.name`,detail:`sheets-formula.functionList.COUPNUM.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.COUPPCD,functionType:q.Financial,description:`sheets-formula.functionList.COUPPCD.description`,abstract:`sheets-formula.functionList.COUPPCD.abstract`,functionParameter:[{name:`sheets-formula.functionList.COUPPCD.functionParameter.settlement.name`,detail:`sheets-formula.functionList.COUPPCD.functionParameter.settlement.detail`,example:`"2011-1-25"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPPCD.functionParameter.maturity.name`,detail:`sheets-formula.functionList.COUPPCD.functionParameter.maturity.detail`,example:`"2011-11-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPPCD.functionParameter.frequency.name`,detail:`sheets-formula.functionList.COUPPCD.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.COUPPCD.functionParameter.basis.name`,detail:`sheets-formula.functionList.COUPPCD.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.CUMIPMT,functionType:q.Financial,description:`sheets-formula.functionList.CUMIPMT.description`,abstract:`sheets-formula.functionList.CUMIPMT.abstract`,functionParameter:[{name:`sheets-formula.functionList.CUMIPMT.functionParameter.rate.name`,detail:`sheets-formula.functionList.CUMIPMT.functionParameter.rate.detail`,example:`9%/12`,require:1,repeat:0},{name:`sheets-formula.functionList.CUMIPMT.functionParameter.nper.name`,detail:`sheets-formula.functionList.CUMIPMT.functionParameter.nper.detail`,example:`30*12`,require:1,repeat:0},{name:`sheets-formula.functionList.CUMIPMT.functionParameter.pv.name`,detail:`sheets-formula.functionList.CUMIPMT.functionParameter.pv.detail`,example:`125000`,require:1,repeat:0},{name:`sheets-formula.functionList.CUMIPMT.functionParameter.startPeriod.name`,detail:`sheets-formula.functionList.CUMIPMT.functionParameter.startPeriod.detail`,example:`13`,require:1,repeat:0},{name:`sheets-formula.functionList.CUMIPMT.functionParameter.endPeriod.name`,detail:`sheets-formula.functionList.CUMIPMT.functionParameter.endPeriod.detail`,example:`24`,require:1,repeat:0},{name:`sheets-formula.functionList.CUMIPMT.functionParameter.type.name`,detail:`sheets-formula.functionList.CUMIPMT.functionParameter.type.detail`,example:`0`,require:1,repeat:0}]},{functionName:MB.CUMPRINC,functionType:q.Financial,description:`sheets-formula.functionList.CUMPRINC.description`,abstract:`sheets-formula.functionList.CUMPRINC.abstract`,functionParameter:[{name:`sheets-formula.functionList.CUMPRINC.functionParameter.rate.name`,detail:`sheets-formula.functionList.CUMPRINC.functionParameter.rate.detail`,example:`9%/12`,require:1,repeat:0},{name:`sheets-formula.functionList.CUMPRINC.functionParameter.nper.name`,detail:`sheets-formula.functionList.CUMPRINC.functionParameter.nper.detail`,example:`30*12`,require:1,repeat:0},{name:`sheets-formula.functionList.CUMPRINC.functionParameter.pv.name`,detail:`sheets-formula.functionList.CUMPRINC.functionParameter.pv.detail`,example:`125000`,require:1,repeat:0},{name:`sheets-formula.functionList.CUMPRINC.functionParameter.startPeriod.name`,detail:`sheets-formula.functionList.CUMPRINC.functionParameter.startPeriod.detail`,example:`13`,require:1,repeat:0},{name:`sheets-formula.functionList.CUMPRINC.functionParameter.endPeriod.name`,detail:`sheets-formula.functionList.CUMPRINC.functionParameter.endPeriod.detail`,example:`24`,require:1,repeat:0},{name:`sheets-formula.functionList.CUMPRINC.functionParameter.type.name`,detail:`sheets-formula.functionList.CUMPRINC.functionParameter.type.detail`,example:`0`,require:1,repeat:0}]},{functionName:MB.DB,functionType:q.Financial,description:`sheets-formula.functionList.DB.description`,abstract:`sheets-formula.functionList.DB.abstract`,functionParameter:[{name:`sheets-formula.functionList.DB.functionParameter.cost.name`,detail:`sheets-formula.functionList.DB.functionParameter.cost.detail`,example:`10000000`,require:1,repeat:0},{name:`sheets-formula.functionList.DB.functionParameter.salvage.name`,detail:`sheets-formula.functionList.DB.functionParameter.salvage.detail`,example:`1000000`,require:1,repeat:0},{name:`sheets-formula.functionList.DB.functionParameter.life.name`,detail:`sheets-formula.functionList.DB.functionParameter.life.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.DB.functionParameter.period.name`,detail:`sheets-formula.functionList.DB.functionParameter.period.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.DB.functionParameter.month.name`,detail:`sheets-formula.functionList.DB.functionParameter.month.detail`,example:`7`,require:0,repeat:0}]},{functionName:MB.DDB,functionType:q.Financial,description:`sheets-formula.functionList.DDB.description`,abstract:`sheets-formula.functionList.DDB.abstract`,functionParameter:[{name:`sheets-formula.functionList.DDB.functionParameter.cost.name`,detail:`sheets-formula.functionList.DDB.functionParameter.cost.detail`,example:`24000`,require:1,repeat:0},{name:`sheets-formula.functionList.DDB.functionParameter.salvage.name`,detail:`sheets-formula.functionList.DDB.functionParameter.salvage.detail`,example:`3000`,require:1,repeat:0},{name:`sheets-formula.functionList.DDB.functionParameter.life.name`,detail:`sheets-formula.functionList.DDB.functionParameter.life.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.DDB.functionParameter.period.name`,detail:`sheets-formula.functionList.DDB.functionParameter.period.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.DDB.functionParameter.factor.name`,detail:`sheets-formula.functionList.DDB.functionParameter.factor.detail`,example:`2`,require:0,repeat:0}]},{functionName:MB.DISC,functionType:q.Financial,description:`sheets-formula.functionList.DISC.description`,abstract:`sheets-formula.functionList.DISC.abstract`,functionParameter:[{name:`sheets-formula.functionList.DISC.functionParameter.settlement.name`,detail:`sheets-formula.functionList.DISC.functionParameter.settlement.detail`,example:`"2018-7-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.DISC.functionParameter.maturity.name`,detail:`sheets-formula.functionList.DISC.functionParameter.maturity.detail`,example:`"2048-1-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.DISC.functionParameter.pr.name`,detail:`sheets-formula.functionList.DISC.functionParameter.pr.detail`,example:`97.975`,require:1,repeat:0},{name:`sheets-formula.functionList.DISC.functionParameter.redemption.name`,detail:`sheets-formula.functionList.DISC.functionParameter.redemption.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.DISC.functionParameter.basis.name`,detail:`sheets-formula.functionList.DISC.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.DOLLARDE,functionType:q.Financial,description:`sheets-formula.functionList.DOLLARDE.description`,abstract:`sheets-formula.functionList.DOLLARDE.abstract`,functionParameter:[{name:`sheets-formula.functionList.DOLLARDE.functionParameter.fractionalDollar.name`,detail:`sheets-formula.functionList.DOLLARDE.functionParameter.fractionalDollar.detail`,example:`1.02`,require:1,repeat:0},{name:`sheets-formula.functionList.DOLLARDE.functionParameter.fraction.name`,detail:`sheets-formula.functionList.DOLLARDE.functionParameter.fraction.detail`,example:`16`,require:1,repeat:0}]},{functionName:MB.DOLLARFR,functionType:q.Financial,description:`sheets-formula.functionList.DOLLARFR.description`,abstract:`sheets-formula.functionList.DOLLARFR.abstract`,functionParameter:[{name:`sheets-formula.functionList.DOLLARFR.functionParameter.decimalDollar.name`,detail:`sheets-formula.functionList.DOLLARFR.functionParameter.decimalDollar.detail`,example:`1.125`,require:1,repeat:0},{name:`sheets-formula.functionList.DOLLARFR.functionParameter.fraction.name`,detail:`sheets-formula.functionList.DOLLARFR.functionParameter.fraction.detail`,example:`16`,require:1,repeat:0}]},{functionName:MB.DURATION,functionType:q.Financial,description:`sheets-formula.functionList.DURATION.description`,abstract:`sheets-formula.functionList.DURATION.abstract`,functionParameter:[{name:`sheets-formula.functionList.DURATION.functionParameter.settlement.name`,detail:`sheets-formula.functionList.DURATION.functionParameter.settlement.detail`,example:`"2018-7-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.DURATION.functionParameter.maturity.name`,detail:`sheets-formula.functionList.DURATION.functionParameter.maturity.detail`,example:`"2048-1-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.DURATION.functionParameter.coupon.name`,detail:`sheets-formula.functionList.DURATION.functionParameter.coupon.detail`,example:`8%`,require:1,repeat:0},{name:`sheets-formula.functionList.DURATION.functionParameter.yld.name`,detail:`sheets-formula.functionList.DURATION.functionParameter.yld.detail`,example:`9%`,require:1,repeat:0},{name:`sheets-formula.functionList.DURATION.functionParameter.frequency.name`,detail:`sheets-formula.functionList.DURATION.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.DURATION.functionParameter.basis.name`,detail:`sheets-formula.functionList.DURATION.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.EFFECT,functionType:q.Financial,description:`sheets-formula.functionList.EFFECT.description`,abstract:`sheets-formula.functionList.EFFECT.abstract`,functionParameter:[{name:`sheets-formula.functionList.EFFECT.functionParameter.nominalRate.name`,detail:`sheets-formula.functionList.EFFECT.functionParameter.nominalRate.detail`,example:`5.25%`,require:1,repeat:0},{name:`sheets-formula.functionList.EFFECT.functionParameter.npery.name`,detail:`sheets-formula.functionList.EFFECT.functionParameter.npery.detail`,example:`4`,require:1,repeat:0}]},{functionName:MB.FV,functionType:q.Financial,description:`sheets-formula.functionList.FV.description`,abstract:`sheets-formula.functionList.FV.abstract`,functionParameter:[{name:`sheets-formula.functionList.FV.functionParameter.rate.name`,detail:`sheets-formula.functionList.FV.functionParameter.rate.detail`,example:`6%/12`,require:1,repeat:0},{name:`sheets-formula.functionList.FV.functionParameter.nper.name`,detail:`sheets-formula.functionList.FV.functionParameter.nper.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.FV.functionParameter.pmt.name`,detail:`sheets-formula.functionList.FV.functionParameter.pmt.detail`,example:`-200`,require:1,repeat:0},{name:`sheets-formula.functionList.FV.functionParameter.pv.name`,detail:`sheets-formula.functionList.FV.functionParameter.pv.detail`,example:`-500`,require:0,repeat:0},{name:`sheets-formula.functionList.FV.functionParameter.type.name`,detail:`sheets-formula.functionList.FV.functionParameter.type.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.FVSCHEDULE,functionType:q.Financial,description:`sheets-formula.functionList.FVSCHEDULE.description`,abstract:`sheets-formula.functionList.FVSCHEDULE.abstract`,functionParameter:[{name:`sheets-formula.functionList.FVSCHEDULE.functionParameter.principal.name`,detail:`sheets-formula.functionList.FVSCHEDULE.functionParameter.principal.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.FVSCHEDULE.functionParameter.schedule.name`,detail:`sheets-formula.functionList.FVSCHEDULE.functionParameter.schedule.detail`,example:`A1:A4`,require:1,repeat:0}]},{functionName:MB.INTRATE,functionType:q.Financial,description:`sheets-formula.functionList.INTRATE.description`,abstract:`sheets-formula.functionList.INTRATE.abstract`,functionParameter:[{name:`sheets-formula.functionList.INTRATE.functionParameter.settlement.name`,detail:`sheets-formula.functionList.INTRATE.functionParameter.settlement.detail`,example:`"2008-2-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.INTRATE.functionParameter.maturity.name`,detail:`sheets-formula.functionList.INTRATE.functionParameter.maturity.detail`,example:`"2008-5-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.INTRATE.functionParameter.investment.name`,detail:`sheets-formula.functionList.INTRATE.functionParameter.investment.detail`,example:`10000000`,require:1,repeat:0},{name:`sheets-formula.functionList.INTRATE.functionParameter.redemption.name`,detail:`sheets-formula.functionList.INTRATE.functionParameter.redemption.detail`,example:`10144200`,require:1,repeat:0},{name:`sheets-formula.functionList.INTRATE.functionParameter.basis.name`,detail:`sheets-formula.functionList.INTRATE.functionParameter.basis.detail`,example:`2`,require:0,repeat:0}]},{functionName:MB.IPMT,functionType:q.Financial,description:`sheets-formula.functionList.IPMT.description`,abstract:`sheets-formula.functionList.IPMT.abstract`,functionParameter:[{name:`sheets-formula.functionList.IPMT.functionParameter.rate.name`,detail:`sheets-formula.functionList.IPMT.functionParameter.rate.detail`,example:`10%/12`,require:1,repeat:0},{name:`sheets-formula.functionList.IPMT.functionParameter.per.name`,detail:`sheets-formula.functionList.IPMT.functionParameter.per.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.IPMT.functionParameter.nper.name`,detail:`sheets-formula.functionList.IPMT.functionParameter.nper.detail`,example:`3*12`,require:1,repeat:0},{name:`sheets-formula.functionList.IPMT.functionParameter.pv.name`,detail:`sheets-formula.functionList.IPMT.functionParameter.pv.detail`,example:`80000`,require:1,repeat:0},{name:`sheets-formula.functionList.IPMT.functionParameter.fv.name`,detail:`sheets-formula.functionList.IPMT.functionParameter.fv.detail`,example:`0`,require:0,repeat:0},{name:`sheets-formula.functionList.IPMT.functionParameter.type.name`,detail:`sheets-formula.functionList.IPMT.functionParameter.type.detail`,example:`0`,require:0,repeat:0}]},{functionName:MB.IRR,functionType:q.Financial,description:`sheets-formula.functionList.IRR.description`,abstract:`sheets-formula.functionList.IRR.abstract`,functionParameter:[{name:`sheets-formula.functionList.IRR.functionParameter.values.name`,detail:`sheets-formula.functionList.IRR.functionParameter.values.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.IRR.functionParameter.guess.name`,detail:`sheets-formula.functionList.IRR.functionParameter.guess.detail`,example:`0.1`,require:0,repeat:0}]},{functionName:MB.ISPMT,functionType:q.Financial,description:`sheets-formula.functionList.ISPMT.description`,abstract:`sheets-formula.functionList.ISPMT.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISPMT.functionParameter.rate.name`,detail:`sheets-formula.functionList.ISPMT.functionParameter.rate.detail`,example:`10%`,require:1,repeat:0},{name:`sheets-formula.functionList.ISPMT.functionParameter.per.name`,detail:`sheets-formula.functionList.ISPMT.functionParameter.per.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.ISPMT.functionParameter.nper.name`,detail:`sheets-formula.functionList.ISPMT.functionParameter.nper.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.ISPMT.functionParameter.pv.name`,detail:`sheets-formula.functionList.ISPMT.functionParameter.pv.detail`,example:`1000`,require:1,repeat:0}]},{functionName:MB.MDURATION,functionType:q.Financial,description:`sheets-formula.functionList.MDURATION.description`,abstract:`sheets-formula.functionList.MDURATION.abstract`,functionParameter:[{name:`sheets-formula.functionList.MDURATION.functionParameter.settlement.name`,detail:`sheets-formula.functionList.MDURATION.functionParameter.settlement.detail`,example:`"2018-7-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.MDURATION.functionParameter.maturity.name`,detail:`sheets-formula.functionList.MDURATION.functionParameter.maturity.detail`,example:`"2048-1-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.MDURATION.functionParameter.coupon.name`,detail:`sheets-formula.functionList.MDURATION.functionParameter.coupon.detail`,example:`8%`,require:1,repeat:0},{name:`sheets-formula.functionList.MDURATION.functionParameter.yld.name`,detail:`sheets-formula.functionList.MDURATION.functionParameter.yld.detail`,example:`9%`,require:1,repeat:0},{name:`sheets-formula.functionList.MDURATION.functionParameter.frequency.name`,detail:`sheets-formula.functionList.MDURATION.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.MDURATION.functionParameter.basis.name`,detail:`sheets-formula.functionList.MDURATION.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.MIRR,functionType:q.Financial,description:`sheets-formula.functionList.MIRR.description`,abstract:`sheets-formula.functionList.MIRR.abstract`,functionParameter:[{name:`sheets-formula.functionList.MIRR.functionParameter.values.name`,detail:`sheets-formula.functionList.MIRR.functionParameter.values.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.MIRR.functionParameter.financeRate.name`,detail:`sheets-formula.functionList.MIRR.functionParameter.financeRate.detail`,example:`10%`,require:1,repeat:0},{name:`sheets-formula.functionList.MIRR.functionParameter.reinvestRate.name`,detail:`sheets-formula.functionList.MIRR.functionParameter.reinvestRate.detail`,example:`12%`,require:1,repeat:0}]},{functionName:MB.NOMINAL,functionType:q.Financial,description:`sheets-formula.functionList.NOMINAL.description`,abstract:`sheets-formula.functionList.NOMINAL.abstract`,functionParameter:[{name:`sheets-formula.functionList.NOMINAL.functionParameter.effectRate.name`,detail:`sheets-formula.functionList.NOMINAL.functionParameter.effectRate.detail`,example:`5.3543%`,require:1,repeat:0},{name:`sheets-formula.functionList.NOMINAL.functionParameter.npery.name`,detail:`sheets-formula.functionList.NOMINAL.functionParameter.npery.detail`,example:`4`,require:1,repeat:0}]},{functionName:MB.NPER,functionType:q.Financial,description:`sheets-formula.functionList.NPER.description`,abstract:`sheets-formula.functionList.NPER.abstract`,functionParameter:[{name:`sheets-formula.functionList.NPER.functionParameter.rate.name`,detail:`sheets-formula.functionList.NPER.functionParameter.rate.detail`,example:`12%/12`,require:1,repeat:0},{name:`sheets-formula.functionList.NPER.functionParameter.pmt.name`,detail:`sheets-formula.functionList.NPER.functionParameter.pmt.detail`,example:`-100`,require:1,repeat:0},{name:`sheets-formula.functionList.NPER.functionParameter.pv.name`,detail:`sheets-formula.functionList.NPER.functionParameter.pv.detail`,example:`-1000`,require:1,repeat:0},{name:`sheets-formula.functionList.NPER.functionParameter.fv.name`,detail:`sheets-formula.functionList.NPER.functionParameter.fv.detail`,example:`10000`,require:0,repeat:0},{name:`sheets-formula.functionList.NPER.functionParameter.type.name`,detail:`sheets-formula.functionList.NPER.functionParameter.type.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.NPV,functionType:q.Financial,description:`sheets-formula.functionList.NPV.description`,abstract:`sheets-formula.functionList.NPV.abstract`,functionParameter:[{name:`sheets-formula.functionList.NPV.functionParameter.rate.name`,detail:`sheets-formula.functionList.NPV.functionParameter.rate.detail`,example:`10%`,require:1,repeat:0},{name:`sheets-formula.functionList.NPV.functionParameter.value1.name`,detail:`sheets-formula.functionList.NPV.functionParameter.value1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.NPV.functionParameter.value2.name`,detail:`sheets-formula.functionList.NPV.functionParameter.value2.detail`,example:`-9000`,require:0,repeat:1}]},{functionName:MB.ODDFPRICE,functionType:q.Financial,description:`sheets-formula.functionList.ODDFPRICE.description`,abstract:`sheets-formula.functionList.ODDFPRICE.abstract`,functionParameter:[{name:`sheets-formula.functionList.ODDFPRICE.functionParameter.settlement.name`,detail:`sheets-formula.functionList.ODDFPRICE.functionParameter.settlement.detail`,example:`"2008-11-11"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFPRICE.functionParameter.maturity.name`,detail:`sheets-formula.functionList.ODDFPRICE.functionParameter.maturity.detail`,example:`"2021-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFPRICE.functionParameter.issue.name`,detail:`sheets-formula.functionList.ODDFPRICE.functionParameter.issue.detail`,example:`"2008-10-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFPRICE.functionParameter.firstCoupon.name`,detail:`sheets-formula.functionList.ODDFPRICE.functionParameter.firstCoupon.detail`,example:`"2009-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFPRICE.functionParameter.rate.name`,detail:`sheets-formula.functionList.ODDFPRICE.functionParameter.rate.detail`,example:`7.85%`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFPRICE.functionParameter.yld.name`,detail:`sheets-formula.functionList.ODDFPRICE.functionParameter.yld.detail`,example:`6.25%`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFPRICE.functionParameter.redemption.name`,detail:`sheets-formula.functionList.ODDFPRICE.functionParameter.redemption.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFPRICE.functionParameter.frequency.name`,detail:`sheets-formula.functionList.ODDFPRICE.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFPRICE.functionParameter.basis.name`,detail:`sheets-formula.functionList.ODDFPRICE.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.ODDFYIELD,functionType:q.Financial,description:`sheets-formula.functionList.ODDFYIELD.description`,abstract:`sheets-formula.functionList.ODDFYIELD.abstract`,functionParameter:[{name:`sheets-formula.functionList.ODDFYIELD.functionParameter.settlement.name`,detail:`sheets-formula.functionList.ODDFYIELD.functionParameter.settlement.detail`,example:`"2008-11-11"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFYIELD.functionParameter.maturity.name`,detail:`sheets-formula.functionList.ODDFYIELD.functionParameter.maturity.detail`,example:`"2021-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFYIELD.functionParameter.issue.name`,detail:`sheets-formula.functionList.ODDFYIELD.functionParameter.issue.detail`,example:`"2008-10-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFYIELD.functionParameter.firstCoupon.name`,detail:`sheets-formula.functionList.ODDFYIELD.functionParameter.firstCoupon.detail`,example:`"2009-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFYIELD.functionParameter.rate.name`,detail:`sheets-formula.functionList.ODDFYIELD.functionParameter.rate.detail`,example:`5.75%`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFYIELD.functionParameter.pr.name`,detail:`sheets-formula.functionList.ODDFYIELD.functionParameter.pr.detail`,example:`84.5`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFYIELD.functionParameter.redemption.name`,detail:`sheets-formula.functionList.ODDFYIELD.functionParameter.redemption.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFYIELD.functionParameter.frequency.name`,detail:`sheets-formula.functionList.ODDFYIELD.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDFYIELD.functionParameter.basis.name`,detail:`sheets-formula.functionList.ODDFYIELD.functionParameter.basis.detail`,example:`0`,require:0,repeat:0}]},{functionName:MB.ODDLPRICE,functionType:q.Financial,description:`sheets-formula.functionList.ODDLPRICE.description`,abstract:`sheets-formula.functionList.ODDLPRICE.abstract`,functionParameter:[{name:`sheets-formula.functionList.ODDLPRICE.functionParameter.settlement.name`,detail:`sheets-formula.functionList.ODDLPRICE.functionParameter.settlement.detail`,example:`"2008-2-7"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLPRICE.functionParameter.maturity.name`,detail:`sheets-formula.functionList.ODDLPRICE.functionParameter.maturity.detail`,example:`"2008-6-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLPRICE.functionParameter.lastInterest.name`,detail:`sheets-formula.functionList.ODDLPRICE.functionParameter.lastInterest.detail`,example:`"2007-10-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLPRICE.functionParameter.rate.name`,detail:`sheets-formula.functionList.ODDLPRICE.functionParameter.rate.detail`,example:`3.75%`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLPRICE.functionParameter.yld.name`,detail:`sheets-formula.functionList.ODDLPRICE.functionParameter.yld.detail`,example:`4.05%`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLPRICE.functionParameter.redemption.name`,detail:`sheets-formula.functionList.ODDLPRICE.functionParameter.redemption.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLPRICE.functionParameter.frequency.name`,detail:`sheets-formula.functionList.ODDLPRICE.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLPRICE.functionParameter.basis.name`,detail:`sheets-formula.functionList.ODDLPRICE.functionParameter.basis.detail`,example:`0`,require:0,repeat:0}]},{functionName:MB.ODDLYIELD,functionType:q.Financial,description:`sheets-formula.functionList.ODDLYIELD.description`,abstract:`sheets-formula.functionList.ODDLYIELD.abstract`,functionParameter:[{name:`sheets-formula.functionList.ODDLYIELD.functionParameter.settlement.name`,detail:`sheets-formula.functionList.ODDLYIELD.functionParameter.settlement.detail`,example:`"2008-4-20"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLYIELD.functionParameter.maturity.name`,detail:`sheets-formula.functionList.ODDLYIELD.functionParameter.maturity.detail`,example:`"2008-6-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLYIELD.functionParameter.lastInterest.name`,detail:`sheets-formula.functionList.ODDLYIELD.functionParameter.lastInterest.detail`,example:`"2007-12-24"`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLYIELD.functionParameter.rate.name`,detail:`sheets-formula.functionList.ODDLYIELD.functionParameter.rate.detail`,example:`3.75%`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLYIELD.functionParameter.pr.name`,detail:`sheets-formula.functionList.ODDLYIELD.functionParameter.pr.detail`,example:`99.875`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLYIELD.functionParameter.redemption.name`,detail:`sheets-formula.functionList.ODDLYIELD.functionParameter.redemption.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLYIELD.functionParameter.frequency.name`,detail:`sheets-formula.functionList.ODDLYIELD.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.ODDLYIELD.functionParameter.basis.name`,detail:`sheets-formula.functionList.ODDLYIELD.functionParameter.basis.detail`,example:`0`,require:0,repeat:0}]},{functionName:MB.PDURATION,functionType:q.Financial,description:`sheets-formula.functionList.PDURATION.description`,abstract:`sheets-formula.functionList.PDURATION.abstract`,functionParameter:[{name:`sheets-formula.functionList.PDURATION.functionParameter.rate.name`,detail:`sheets-formula.functionList.PDURATION.functionParameter.rate.detail`,example:`2.5%`,require:1,repeat:0},{name:`sheets-formula.functionList.PDURATION.functionParameter.pv.name`,detail:`sheets-formula.functionList.PDURATION.functionParameter.pv.detail`,example:`2000`,require:1,repeat:0},{name:`sheets-formula.functionList.PDURATION.functionParameter.fv.name`,detail:`sheets-formula.functionList.PDURATION.functionParameter.fv.detail`,example:`2200`,require:1,repeat:0}]},{functionName:MB.PMT,functionType:q.Financial,description:`sheets-formula.functionList.PMT.description`,abstract:`sheets-formula.functionList.PMT.abstract`,functionParameter:[{name:`sheets-formula.functionList.PMT.functionParameter.rate.name`,detail:`sheets-formula.functionList.PMT.functionParameter.rate.detail`,example:`8%/12`,require:1,repeat:0},{name:`sheets-formula.functionList.PMT.functionParameter.nper.name`,detail:`sheets-formula.functionList.PMT.functionParameter.nper.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.PMT.functionParameter.pv.name`,detail:`sheets-formula.functionList.PMT.functionParameter.pv.detail`,example:`10000`,require:1,repeat:0},{name:`sheets-formula.functionList.PMT.functionParameter.fv.name`,detail:`sheets-formula.functionList.PMT.functionParameter.fv.detail`,example:`0`,require:0,repeat:0},{name:`sheets-formula.functionList.PMT.functionParameter.type.name`,detail:`sheets-formula.functionList.PMT.functionParameter.type.detail`,example:`0`,require:0,repeat:0}]},{functionName:MB.PPMT,functionType:q.Financial,description:`sheets-formula.functionList.PPMT.description`,abstract:`sheets-formula.functionList.PPMT.abstract`,functionParameter:[{name:`sheets-formula.functionList.PPMT.functionParameter.rate.name`,detail:`sheets-formula.functionList.PPMT.functionParameter.rate.detail`,example:`10%/12`,require:1,repeat:0},{name:`sheets-formula.functionList.PPMT.functionParameter.per.name`,detail:`sheets-formula.functionList.PPMT.functionParameter.per.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.PPMT.functionParameter.nper.name`,detail:`sheets-formula.functionList.PPMT.functionParameter.nper.detail`,example:`3*12`,require:1,repeat:0},{name:`sheets-formula.functionList.PPMT.functionParameter.pv.name`,detail:`sheets-formula.functionList.PPMT.functionParameter.pv.detail`,example:`80000`,require:1,repeat:0},{name:`sheets-formula.functionList.PPMT.functionParameter.fv.name`,detail:`sheets-formula.functionList.PPMT.functionParameter.fv.detail`,example:`0`,require:0,repeat:0},{name:`sheets-formula.functionList.PPMT.functionParameter.type.name`,detail:`sheets-formula.functionList.PPMT.functionParameter.type.detail`,example:`0`,require:0,repeat:0}]},{functionName:MB.PRICE,functionType:q.Financial,description:`sheets-formula.functionList.PRICE.description`,abstract:`sheets-formula.functionList.PRICE.abstract`,functionParameter:[{name:`sheets-formula.functionList.PRICE.functionParameter.settlement.name`,detail:`sheets-formula.functionList.PRICE.functionParameter.settlement.detail`,example:`"2008-11-11"`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICE.functionParameter.maturity.name`,detail:`sheets-formula.functionList.PRICE.functionParameter.maturity.detail`,example:`"2021-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICE.functionParameter.rate.name`,detail:`sheets-formula.functionList.PRICE.functionParameter.rate.detail`,example:`7.85%`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICE.functionParameter.yld.name`,detail:`sheets-formula.functionList.PRICE.functionParameter.yld.detail`,example:`6.25%`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICE.functionParameter.redemption.name`,detail:`sheets-formula.functionList.PRICE.functionParameter.redemption.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICE.functionParameter.frequency.name`,detail:`sheets-formula.functionList.PRICE.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICE.functionParameter.basis.name`,detail:`sheets-formula.functionList.PRICE.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.PRICEDISC,functionType:q.Financial,description:`sheets-formula.functionList.PRICEDISC.description`,abstract:`sheets-formula.functionList.PRICEDISC.abstract`,functionParameter:[{name:`sheets-formula.functionList.PRICEDISC.functionParameter.settlement.name`,detail:`sheets-formula.functionList.PRICEDISC.functionParameter.settlement.detail`,example:`"2008-11-11"`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICEDISC.functionParameter.maturity.name`,detail:`sheets-formula.functionList.PRICEDISC.functionParameter.maturity.detail`,example:`"2021-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICEDISC.functionParameter.discount.name`,detail:`sheets-formula.functionList.PRICEDISC.functionParameter.discount.detail`,example:`6.25%`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICEDISC.functionParameter.redemption.name`,detail:`sheets-formula.functionList.PRICEDISC.functionParameter.redemption.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICEDISC.functionParameter.basis.name`,detail:`sheets-formula.functionList.PRICEDISC.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.PRICEMAT,functionType:q.Financial,description:`sheets-formula.functionList.PRICEMAT.description`,abstract:`sheets-formula.functionList.PRICEMAT.abstract`,functionParameter:[{name:`sheets-formula.functionList.PRICEMAT.functionParameter.settlement.name`,detail:`sheets-formula.functionList.PRICEMAT.functionParameter.settlement.detail`,example:`"2008-11-11"`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICEMAT.functionParameter.maturity.name`,detail:`sheets-formula.functionList.PRICEMAT.functionParameter.maturity.detail`,example:`"2021-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICEMAT.functionParameter.issue.name`,detail:`sheets-formula.functionList.PRICEMAT.functionParameter.issue.detail`,example:`"2008-10-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICEMAT.functionParameter.rate.name`,detail:`sheets-formula.functionList.PRICEMAT.functionParameter.rate.detail`,example:`7.85%`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICEMAT.functionParameter.yld.name`,detail:`sheets-formula.functionList.PRICEMAT.functionParameter.yld.detail`,example:`6.25%`,require:1,repeat:0},{name:`sheets-formula.functionList.PRICEMAT.functionParameter.basis.name`,detail:`sheets-formula.functionList.PRICEMAT.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.PV,functionType:q.Financial,description:`sheets-formula.functionList.PV.description`,abstract:`sheets-formula.functionList.PV.abstract`,functionParameter:[{name:`sheets-formula.functionList.PV.functionParameter.rate.name`,detail:`sheets-formula.functionList.PV.functionParameter.rate.detail`,example:`2%`,require:1,repeat:0},{name:`sheets-formula.functionList.PV.functionParameter.nper.name`,detail:`sheets-formula.functionList.PV.functionParameter.nper.detail`,example:`12`,require:1,repeat:0},{name:`sheets-formula.functionList.PV.functionParameter.pmt.name`,detail:`sheets-formula.functionList.PV.functionParameter.pmt.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.PV.functionParameter.fv.name`,detail:`sheets-formula.functionList.PV.functionParameter.fv.detail`,example:`0`,require:0,repeat:0},{name:`sheets-formula.functionList.PV.functionParameter.type.name`,detail:`sheets-formula.functionList.PV.functionParameter.type.detail`,example:`0`,require:0,repeat:0}]},{functionName:MB.RATE,functionType:q.Financial,description:`sheets-formula.functionList.RATE.description`,abstract:`sheets-formula.functionList.RATE.abstract`,functionParameter:[{name:`sheets-formula.functionList.RATE.functionParameter.nper.name`,detail:`sheets-formula.functionList.RATE.functionParameter.nper.detail`,example:`4*12`,require:1,repeat:0},{name:`sheets-formula.functionList.RATE.functionParameter.pmt.name`,detail:`sheets-formula.functionList.RATE.functionParameter.pmt.detail`,example:`-200`,require:1,repeat:0},{name:`sheets-formula.functionList.RATE.functionParameter.pv.name`,detail:`sheets-formula.functionList.RATE.functionParameter.pv.detail`,example:`8000`,require:1,repeat:0},{name:`sheets-formula.functionList.RATE.functionParameter.fv.name`,detail:`sheets-formula.functionList.RATE.functionParameter.fv.detail`,example:`0`,require:0,repeat:0},{name:`sheets-formula.functionList.RATE.functionParameter.type.name`,detail:`sheets-formula.functionList.RATE.functionParameter.type.detail`,example:`0`,require:0,repeat:0},{name:`sheets-formula.functionList.RATE.functionParameter.guess.name`,detail:`sheets-formula.functionList.RATE.functionParameter.guess.detail`,example:`0.1`,require:0,repeat:0}]},{functionName:MB.RECEIVED,functionType:q.Financial,description:`sheets-formula.functionList.RECEIVED.description`,abstract:`sheets-formula.functionList.RECEIVED.abstract`,functionParameter:[{name:`sheets-formula.functionList.RECEIVED.functionParameter.settlement.name`,detail:`sheets-formula.functionList.RECEIVED.functionParameter.settlement.detail`,example:`"2008-2-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.RECEIVED.functionParameter.maturity.name`,detail:`sheets-formula.functionList.RECEIVED.functionParameter.maturity.detail`,example:`"2008-3-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.RECEIVED.functionParameter.investment.name`,detail:`sheets-formula.functionList.RECEIVED.functionParameter.investment.detail`,example:`10000000`,require:1,repeat:0},{name:`sheets-formula.functionList.RECEIVED.functionParameter.discount.name`,detail:`sheets-formula.functionList.RECEIVED.functionParameter.discount.detail`,example:`5.75%`,require:1,repeat:0},{name:`sheets-formula.functionList.RECEIVED.functionParameter.basis.name`,detail:`sheets-formula.functionList.RECEIVED.functionParameter.basis.detail`,example:`2`,require:0,repeat:0}]},{functionName:MB.RRI,functionType:q.Financial,description:`sheets-formula.functionList.RRI.description`,abstract:`sheets-formula.functionList.RRI.abstract`,functionParameter:[{name:`sheets-formula.functionList.RRI.functionParameter.nper.name`,detail:`sheets-formula.functionList.RRI.functionParameter.nper.detail`,example:`96`,require:1,repeat:0},{name:`sheets-formula.functionList.RRI.functionParameter.pv.name`,detail:`sheets-formula.functionList.RRI.functionParameter.pv.detail`,example:`10000`,require:1,repeat:0},{name:`sheets-formula.functionList.RRI.functionParameter.fv.name`,detail:`sheets-formula.functionList.RRI.functionParameter.fv.detail`,example:`11000`,require:1,repeat:0}]},{functionName:MB.SLN,functionType:q.Financial,description:`sheets-formula.functionList.SLN.description`,abstract:`sheets-formula.functionList.SLN.abstract`,functionParameter:[{name:`sheets-formula.functionList.SLN.functionParameter.cost.name`,detail:`sheets-formula.functionList.SLN.functionParameter.cost.detail`,example:`300000`,require:1,repeat:0},{name:`sheets-formula.functionList.SLN.functionParameter.salvage.name`,detail:`sheets-formula.functionList.SLN.functionParameter.salvage.detail`,example:`75000`,require:1,repeat:0},{name:`sheets-formula.functionList.SLN.functionParameter.life.name`,detail:`sheets-formula.functionList.SLN.functionParameter.life.detail`,example:`10`,require:1,repeat:0}]},{functionName:MB.SYD,functionType:q.Financial,description:`sheets-formula.functionList.SYD.description`,abstract:`sheets-formula.functionList.SYD.abstract`,functionParameter:[{name:`sheets-formula.functionList.SYD.functionParameter.cost.name`,detail:`sheets-formula.functionList.SYD.functionParameter.cost.detail`,example:`300000`,require:1,repeat:0},{name:`sheets-formula.functionList.SYD.functionParameter.salvage.name`,detail:`sheets-formula.functionList.SYD.functionParameter.salvage.detail`,example:`75000`,require:1,repeat:0},{name:`sheets-formula.functionList.SYD.functionParameter.life.name`,detail:`sheets-formula.functionList.SYD.functionParameter.life.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.SYD.functionParameter.per.name`,detail:`sheets-formula.functionList.SYD.functionParameter.per.detail`,example:`10`,require:1,repeat:0}]},{functionName:MB.TBILLEQ,functionType:q.Financial,description:`sheets-formula.functionList.TBILLEQ.description`,abstract:`sheets-formula.functionList.TBILLEQ.abstract`,functionParameter:[{name:`sheets-formula.functionList.TBILLEQ.functionParameter.settlement.name`,detail:`sheets-formula.functionList.TBILLEQ.functionParameter.settlement.detail`,example:`"2008-3-31"`,require:1,repeat:0},{name:`sheets-formula.functionList.TBILLEQ.functionParameter.maturity.name`,detail:`sheets-formula.functionList.TBILLEQ.functionParameter.maturity.detail`,example:`"2008-6-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.TBILLEQ.functionParameter.discount.name`,detail:`sheets-formula.functionList.TBILLEQ.functionParameter.discount.detail`,example:`9.14%`,require:1,repeat:0}]},{functionName:MB.TBILLPRICE,functionType:q.Financial,description:`sheets-formula.functionList.TBILLPRICE.description`,abstract:`sheets-formula.functionList.TBILLPRICE.abstract`,functionParameter:[{name:`sheets-formula.functionList.TBILLPRICE.functionParameter.settlement.name`,detail:`sheets-formula.functionList.TBILLPRICE.functionParameter.settlement.detail`,example:`"2008-3-31"`,require:1,repeat:0},{name:`sheets-formula.functionList.TBILLPRICE.functionParameter.maturity.name`,detail:`sheets-formula.functionList.TBILLPRICE.functionParameter.maturity.detail`,example:`"2008-6-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.TBILLPRICE.functionParameter.discount.name`,detail:`sheets-formula.functionList.TBILLPRICE.functionParameter.discount.detail`,example:`9.14%`,require:1,repeat:0}]},{functionName:MB.TBILLYIELD,functionType:q.Financial,description:`sheets-formula.functionList.TBILLYIELD.description`,abstract:`sheets-formula.functionList.TBILLYIELD.abstract`,functionParameter:[{name:`sheets-formula.functionList.TBILLYIELD.functionParameter.settlement.name`,detail:`sheets-formula.functionList.TBILLYIELD.functionParameter.settlement.detail`,example:`"2008-3-31"`,require:1,repeat:0},{name:`sheets-formula.functionList.TBILLYIELD.functionParameter.maturity.name`,detail:`sheets-formula.functionList.TBILLYIELD.functionParameter.maturity.detail`,example:`"2008-6-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.TBILLYIELD.functionParameter.pr.name`,detail:`sheets-formula.functionList.TBILLYIELD.functionParameter.pr.detail`,example:`98.45`,require:1,repeat:0}]},{functionName:MB.VDB,functionType:q.Financial,description:`sheets-formula.functionList.VDB.description`,abstract:`sheets-formula.functionList.VDB.abstract`,functionParameter:[{name:`sheets-formula.functionList.VDB.functionParameter.cost.name`,detail:`sheets-formula.functionList.VDB.functionParameter.cost.detail`,example:`2400`,require:1,repeat:0},{name:`sheets-formula.functionList.VDB.functionParameter.salvage.name`,detail:`sheets-formula.functionList.VDB.functionParameter.salvage.detail`,example:`300`,require:1,repeat:0},{name:`sheets-formula.functionList.VDB.functionParameter.life.name`,detail:`sheets-formula.functionList.VDB.functionParameter.life.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.VDB.functionParameter.startPeriod.name`,detail:`sheets-formula.functionList.VDB.functionParameter.startPeriod.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.VDB.functionParameter.endPeriod.name`,detail:`sheets-formula.functionList.VDB.functionParameter.endPeriod.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.VDB.functionParameter.factor.name`,detail:`sheets-formula.functionList.VDB.functionParameter.factor.detail`,example:`2`,require:0,repeat:0},{name:`sheets-formula.functionList.VDB.functionParameter.noSwitch.name`,detail:`sheets-formula.functionList.VDB.functionParameter.noSwitch.detail`,example:`false`,require:0,repeat:0}]},{functionName:MB.XIRR,functionType:q.Financial,description:`sheets-formula.functionList.XIRR.description`,abstract:`sheets-formula.functionList.XIRR.abstract`,functionParameter:[{name:`sheets-formula.functionList.XIRR.functionParameter.values.name`,detail:`sheets-formula.functionList.XIRR.functionParameter.values.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.XIRR.functionParameter.dates.name`,detail:`sheets-formula.functionList.XIRR.functionParameter.dates.detail`,example:`B1:B4`,require:1,repeat:0},{name:`sheets-formula.functionList.XIRR.functionParameter.guess.name`,detail:`sheets-formula.functionList.XIRR.functionParameter.guess.detail`,example:`0.1`,require:0,repeat:0}]},{functionName:MB.XNPV,functionType:q.Financial,description:`sheets-formula.functionList.XNPV.description`,abstract:`sheets-formula.functionList.XNPV.abstract`,functionParameter:[{name:`sheets-formula.functionList.XNPV.functionParameter.rate.name`,detail:`sheets-formula.functionList.XNPV.functionParameter.rate.detail`,example:`10%`,require:1,repeat:0},{name:`sheets-formula.functionList.XNPV.functionParameter.values.name`,detail:`sheets-formula.functionList.XNPV.functionParameter.values.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.XNPV.functionParameter.dates.name`,detail:`sheets-formula.functionList.XNPV.functionParameter.dates.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:MB.YIELD,functionType:q.Financial,description:`sheets-formula.functionList.YIELD.description`,abstract:`sheets-formula.functionList.YIELD.abstract`,functionParameter:[{name:`sheets-formula.functionList.YIELD.functionParameter.settlement.name`,detail:`sheets-formula.functionList.YIELD.functionParameter.settlement.detail`,example:`"2008-11-11"`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELD.functionParameter.maturity.name`,detail:`sheets-formula.functionList.YIELD.functionParameter.maturity.detail`,example:`"2021-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELD.functionParameter.rate.name`,detail:`sheets-formula.functionList.YIELD.functionParameter.rate.detail`,example:`7.85%`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELD.functionParameter.pr.name`,detail:`sheets-formula.functionList.YIELD.functionParameter.pr.detail`,example:`98.45`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELD.functionParameter.redemption.name`,detail:`sheets-formula.functionList.YIELD.functionParameter.redemption.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELD.functionParameter.frequency.name`,detail:`sheets-formula.functionList.YIELD.functionParameter.frequency.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELD.functionParameter.basis.name`,detail:`sheets-formula.functionList.YIELD.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.YIELDDISC,functionType:q.Financial,description:`sheets-formula.functionList.YIELDDISC.description`,abstract:`sheets-formula.functionList.YIELDDISC.abstract`,functionParameter:[{name:`sheets-formula.functionList.YIELDDISC.functionParameter.settlement.name`,detail:`sheets-formula.functionList.YIELDDISC.functionParameter.settlement.detail`,example:`"2008-11-11"`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELDDISC.functionParameter.maturity.name`,detail:`sheets-formula.functionList.YIELDDISC.functionParameter.maturity.detail`,example:`"2021-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELDDISC.functionParameter.pr.name`,detail:`sheets-formula.functionList.YIELDDISC.functionParameter.pr.detail`,example:`98.45`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELDDISC.functionParameter.redemption.name`,detail:`sheets-formula.functionList.YIELDDISC.functionParameter.redemption.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELDDISC.functionParameter.basis.name`,detail:`sheets-formula.functionList.YIELDDISC.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]},{functionName:MB.YIELDMAT,functionType:q.Financial,description:`sheets-formula.functionList.YIELDMAT.description`,abstract:`sheets-formula.functionList.YIELDMAT.abstract`,functionParameter:[{name:`sheets-formula.functionList.YIELDMAT.functionParameter.settlement.name`,detail:`sheets-formula.functionList.YIELDMAT.functionParameter.settlement.detail`,example:`"2008-11-11"`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELDMAT.functionParameter.maturity.name`,detail:`sheets-formula.functionList.YIELDMAT.functionParameter.maturity.detail`,example:`"2021-3-1"`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELDMAT.functionParameter.issue.name`,detail:`sheets-formula.functionList.YIELDMAT.functionParameter.issue.detail`,example:`"2008-10-15"`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELDMAT.functionParameter.rate.name`,detail:`sheets-formula.functionList.YIELDMAT.functionParameter.rate.detail`,example:`7.85%`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELDMAT.functionParameter.pr.name`,detail:`sheets-formula.functionList.YIELDMAT.functionParameter.pr.detail`,example:`98.45`,require:1,repeat:0},{name:`sheets-formula.functionList.YIELDMAT.functionParameter.basis.name`,detail:`sheets-formula.functionList.YIELDMAT.functionParameter.basis.detail`,example:`1`,require:0,repeat:0}]}],Emt=[{functionName:NB.CELL,functionType:q.Information,description:`sheets-formula.functionList.CELL.description`,abstract:`sheets-formula.functionList.CELL.abstract`,functionParameter:[{name:`sheets-formula.functionList.CELL.functionParameter.infoType.name`,detail:`sheets-formula.functionList.CELL.functionParameter.infoType.detail`,example:`"type"`,require:1,repeat:0},{name:`sheets-formula.functionList.CELL.functionParameter.reference.name`,detail:`sheets-formula.functionList.CELL.functionParameter.reference.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ERROR_TYPE,functionType:q.Information,description:`sheets-formula.functionList.ERROR_TYPE.description`,abstract:`sheets-formula.functionList.ERROR_TYPE.abstract`,functionParameter:[{name:`sheets-formula.functionList.ERROR_TYPE.functionParameter.errorVal.name`,detail:`sheets-formula.functionList.ERROR_TYPE.functionParameter.errorVal.detail`,example:`"#NULL!"`,require:1,repeat:0}]},{functionName:NB.INFO,functionType:q.Information,description:`sheets-formula.functionList.INFO.description`,abstract:`sheets-formula.functionList.INFO.abstract`,functionParameter:[{name:`sheets-formula.functionList.INFO.functionParameter.number1.name`,detail:`sheets-formula.functionList.INFO.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.INFO.functionParameter.number2.name`,detail:`sheets-formula.functionList.INFO.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:NB.ISBETWEEN,functionType:q.Information,description:`sheets-formula.functionList.ISBETWEEN.description`,abstract:`sheets-formula.functionList.ISBETWEEN.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISBETWEEN.functionParameter.valueToCompare.name`,detail:`sheets-formula.functionList.ISBETWEEN.functionParameter.valueToCompare.detail`,example:`7.9`,require:1,repeat:0},{name:`sheets-formula.functionList.ISBETWEEN.functionParameter.lowerValue.name`,detail:`sheets-formula.functionList.ISBETWEEN.functionParameter.lowerValue.detail`,example:`1.2`,require:1,repeat:0},{name:`sheets-formula.functionList.ISBETWEEN.functionParameter.upperValue.name`,detail:`sheets-formula.functionList.ISBETWEEN.functionParameter.upperValue.detail`,example:`12.45`,require:1,repeat:0},{name:`sheets-formula.functionList.ISBETWEEN.functionParameter.lowerValueIsInclusive.name`,detail:`sheets-formula.functionList.ISBETWEEN.functionParameter.lowerValueIsInclusive.detail`,example:`true`,require:0,repeat:0},{name:`sheets-formula.functionList.ISBETWEEN.functionParameter.upperValueIsInclusive.name`,detail:`sheets-formula.functionList.ISBETWEEN.functionParameter.upperValueIsInclusive.detail`,example:`true`,require:0,repeat:0}]},{functionName:NB.ISBLANK,functionType:q.Information,description:`sheets-formula.functionList.ISBLANK.description`,abstract:`sheets-formula.functionList.ISBLANK.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISBLANK.functionParameter.value.name`,detail:`sheets-formula.functionList.ISBLANK.functionParameter.value.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ISDATE,functionType:q.Information,description:`sheets-formula.functionList.ISDATE.description`,abstract:`sheets-formula.functionList.ISDATE.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISDATE.functionParameter.value.name`,detail:`sheets-formula.functionList.ISDATE.functionParameter.value.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ISEMAIL,functionType:q.Information,description:`sheets-formula.functionList.ISEMAIL.description`,abstract:`sheets-formula.functionList.ISEMAIL.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISEMAIL.functionParameter.value.name`,detail:`sheets-formula.functionList.ISEMAIL.functionParameter.value.detail`,example:`"developer@univer.ai"`,require:1,repeat:0}]},{functionName:NB.ISERR,functionType:q.Information,description:`sheets-formula.functionList.ISERR.description`,abstract:`sheets-formula.functionList.ISERR.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISERR.functionParameter.value.name`,detail:`sheets-formula.functionList.ISERR.functionParameter.value.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ISERROR,functionType:q.Information,description:`sheets-formula.functionList.ISERROR.description`,abstract:`sheets-formula.functionList.ISERROR.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISERROR.functionParameter.value.name`,detail:`sheets-formula.functionList.ISERROR.functionParameter.value.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ISEVEN,functionType:q.Information,description:`sheets-formula.functionList.ISEVEN.description`,abstract:`sheets-formula.functionList.ISEVEN.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISEVEN.functionParameter.value.name`,detail:`sheets-formula.functionList.ISEVEN.functionParameter.value.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:NB.ISFORMULA,functionType:q.Information,description:`sheets-formula.functionList.ISFORMULA.description`,abstract:`sheets-formula.functionList.ISFORMULA.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISFORMULA.functionParameter.reference.name`,detail:`sheets-formula.functionList.ISFORMULA.functionParameter.reference.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ISLOGICAL,functionType:q.Information,description:`sheets-formula.functionList.ISLOGICAL.description`,abstract:`sheets-formula.functionList.ISLOGICAL.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISLOGICAL.functionParameter.value.name`,detail:`sheets-formula.functionList.ISLOGICAL.functionParameter.value.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ISNA,functionType:q.Information,description:`sheets-formula.functionList.ISNA.description`,abstract:`sheets-formula.functionList.ISNA.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISNA.functionParameter.value.name`,detail:`sheets-formula.functionList.ISNA.functionParameter.value.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ISNONTEXT,functionType:q.Information,description:`sheets-formula.functionList.ISNONTEXT.description`,abstract:`sheets-formula.functionList.ISNONTEXT.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISNONTEXT.functionParameter.value.name`,detail:`sheets-formula.functionList.ISNONTEXT.functionParameter.value.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ISNUMBER,functionType:q.Information,description:`sheets-formula.functionList.ISNUMBER.description`,abstract:`sheets-formula.functionList.ISNUMBER.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISNUMBER.functionParameter.value.name`,detail:`sheets-formula.functionList.ISNUMBER.functionParameter.value.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ISODD,functionType:q.Information,description:`sheets-formula.functionList.ISODD.description`,abstract:`sheets-formula.functionList.ISODD.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISODD.functionParameter.value.name`,detail:`sheets-formula.functionList.ISODD.functionParameter.value.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:NB.ISOMITTED,functionType:q.Information,description:`sheets-formula.functionList.ISOMITTED.description`,abstract:`sheets-formula.functionList.ISOMITTED.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISOMITTED.functionParameter.number1.name`,detail:`sheets-formula.functionList.ISOMITTED.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.ISOMITTED.functionParameter.number2.name`,detail:`sheets-formula.functionList.ISOMITTED.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:NB.ISREF,functionType:q.Information,description:`sheets-formula.functionList.ISREF.description`,abstract:`sheets-formula.functionList.ISREF.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISREF.functionParameter.value.name`,detail:`sheets-formula.functionList.ISREF.functionParameter.value.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ISTEXT,functionType:q.Information,description:`sheets-formula.functionList.ISTEXT.description`,abstract:`sheets-formula.functionList.ISTEXT.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISTEXT.functionParameter.value.name`,detail:`sheets-formula.functionList.ISTEXT.functionParameter.value.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.ISURL,functionType:q.Information,description:`sheets-formula.functionList.ISURL.description`,abstract:`sheets-formula.functionList.ISURL.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISURL.functionParameter.value.name`,detail:`sheets-formula.functionList.ISURL.functionParameter.value.detail`,example:`"univer.ai"`,require:1,repeat:0}]},{functionName:NB.N,functionType:q.Information,description:`sheets-formula.functionList.N.description`,abstract:`sheets-formula.functionList.N.abstract`,functionParameter:[{name:`sheets-formula.functionList.N.functionParameter.value.name`,detail:`sheets-formula.functionList.N.functionParameter.value.detail`,example:`7`,require:1,repeat:0}]},{functionName:NB.NA,functionType:q.Information,description:`sheets-formula.functionList.NA.description`,abstract:`sheets-formula.functionList.NA.abstract`,functionParameter:[]},{functionName:NB.SHEET,functionType:q.Information,description:`sheets-formula.functionList.SHEET.description`,abstract:`sheets-formula.functionList.SHEET.abstract`,functionParameter:[{name:`sheets-formula.functionList.SHEET.functionParameter.value.name`,detail:`sheets-formula.functionList.SHEET.functionParameter.value.detail`,example:`A1`,require:1,repeat:0}]},{functionName:NB.SHEETS,functionType:q.Information,description:`sheets-formula.functionList.SHEETS.description`,abstract:`sheets-formula.functionList.SHEETS.abstract`,functionParameter:[]},{functionName:NB.TYPE,functionType:q.Information,description:`sheets-formula.functionList.TYPE.description`,abstract:`sheets-formula.functionList.TYPE.abstract`,functionParameter:[{name:`sheets-formula.functionList.TYPE.functionParameter.value.name`,detail:`sheets-formula.functionList.TYPE.functionParameter.value.detail`,example:`A2`,require:1,repeat:0}]}],Dmt=[{functionName:PB.AND,functionType:q.Logical,description:`sheets-formula.functionList.AND.description`,abstract:`sheets-formula.functionList.AND.abstract`,functionParameter:[{name:`sheets-formula.functionList.AND.functionParameter.logical1.name`,detail:`sheets-formula.functionList.AND.functionParameter.logical1.detail`,example:`A1=1`,require:1,repeat:0},{name:`sheets-formula.functionList.AND.functionParameter.logical2.name`,detail:`sheets-formula.functionList.AND.functionParameter.logical2.detail`,example:`A2=2`,require:0,repeat:1}]},{functionName:PB.BYCOL,functionType:q.Logical,description:`sheets-formula.functionList.BYCOL.description`,abstract:`sheets-formula.functionList.BYCOL.abstract`,functionParameter:[{name:`sheets-formula.functionList.BYCOL.functionParameter.array.name`,detail:`sheets-formula.functionList.BYCOL.functionParameter.array.detail`,example:`A1:C2`,require:1,repeat:0},{name:`sheets-formula.functionList.BYCOL.functionParameter.lambda.name`,detail:`sheets-formula.functionList.BYCOL.functionParameter.lambda.detail`,example:`LAMBDA(array, MAX(array))`,require:1,repeat:0}]},{functionName:PB.BYROW,functionType:q.Logical,description:`sheets-formula.functionList.BYROW.description`,abstract:`sheets-formula.functionList.BYROW.abstract`,functionParameter:[{name:`sheets-formula.functionList.BYROW.functionParameter.array.name`,detail:`sheets-formula.functionList.BYROW.functionParameter.array.detail`,example:`A1:C2`,require:1,repeat:0},{name:`sheets-formula.functionList.BYROW.functionParameter.lambda.name`,detail:`sheets-formula.functionList.BYROW.functionParameter.lambda.detail`,example:`LAMBDA(array, MAX(array))`,require:1,repeat:0}]},{functionName:PB.FALSE,functionType:q.Logical,description:`sheets-formula.functionList.FALSE.description`,abstract:`sheets-formula.functionList.FALSE.abstract`,functionParameter:[]},{functionName:PB.IF,functionType:q.Logical,description:`sheets-formula.functionList.IF.description`,abstract:`sheets-formula.functionList.IF.abstract`,functionParameter:[{name:`sheets-formula.functionList.IF.functionParameter.logicalTest.name`,detail:`sheets-formula.functionList.IF.functionParameter.logicalTest.detail`,example:`A2 = "foo"`,require:1,repeat:0},{name:`sheets-formula.functionList.IF.functionParameter.valueIfTrue.name`,detail:`sheets-formula.functionList.IF.functionParameter.valueIfTrue.detail`,example:`"A2 is foo"`,require:1,repeat:0},{name:`sheets-formula.functionList.IF.functionParameter.valueIfFalse.name`,detail:`sheets-formula.functionList.IF.functionParameter.valueIfFalse.detail`,example:`"A2 is not foo"`,require:0,repeat:0}]},{functionName:PB.IFERROR,functionType:q.Logical,description:`sheets-formula.functionList.IFERROR.description`,abstract:`sheets-formula.functionList.IFERROR.abstract`,functionParameter:[{name:`sheets-formula.functionList.IFERROR.functionParameter.value.name`,detail:`sheets-formula.functionList.IFERROR.functionParameter.value.detail`,example:`A2/B2`,require:1,repeat:0},{name:`sheets-formula.functionList.IFERROR.functionParameter.valueIfError.name`,detail:`sheets-formula.functionList.IFERROR.functionParameter.valueIfError.detail`,example:`"Error in calculation"`,require:1,repeat:0}]},{functionName:PB.IFNA,functionType:q.Logical,description:`sheets-formula.functionList.IFNA.description`,abstract:`sheets-formula.functionList.IFNA.abstract`,functionParameter:[{name:`sheets-formula.functionList.IFNA.functionParameter.value.name`,detail:`sheets-formula.functionList.IFNA.functionParameter.value.detail`,example:`VLOOKUP(C3,C6:D11,2,FALSE)`,require:1,repeat:0},{name:`sheets-formula.functionList.IFNA.functionParameter.valueIfNa.name`,detail:`sheets-formula.functionList.IFNA.functionParameter.valueIfNa.detail`,example:`"Not Found"`,require:1,repeat:0}]},{functionName:PB.IFS,functionType:q.Logical,description:`sheets-formula.functionList.IFS.description`,abstract:`sheets-formula.functionList.IFS.abstract`,functionParameter:[{name:`sheets-formula.functionList.IFS.functionParameter.logicalTest1.name`,detail:`sheets-formula.functionList.IFS.functionParameter.logicalTest1.detail`,example:`A2 = "foo"`,require:1,repeat:0},{name:`sheets-formula.functionList.IFS.functionParameter.valueIfTrue1.name`,detail:`sheets-formula.functionList.IFS.functionParameter.valueIfTrue1.detail`,example:`"A2 is foo"`,require:1,repeat:0},{name:`sheets-formula.functionList.IFS.functionParameter.logicalTest2.name`,detail:`sheets-formula.functionList.IFS.functionParameter.logicalTest2.detail`,example:`F2=1`,require:0,repeat:1},{name:`sheets-formula.functionList.IFS.functionParameter.valueIfTrue2.name`,detail:`sheets-formula.functionList.IFS.functionParameter.valueIfTrue2.detail`,example:`D2`,require:0,repeat:1}]},{functionName:PB.LAMBDA,functionType:q.Logical,description:`sheets-formula.functionList.LAMBDA.description`,abstract:`sheets-formula.functionList.LAMBDA.abstract`,functionParameter:[{name:`sheets-formula.functionList.LAMBDA.functionParameter.parameter.name`,detail:`sheets-formula.functionList.LAMBDA.functionParameter.parameter.detail`,example:`[x, y, …,]`,require:0,repeat:1},{name:`sheets-formula.functionList.LAMBDA.functionParameter.calculation.name`,detail:`sheets-formula.functionList.LAMBDA.functionParameter.calculation.detail`,example:`x+y`,require:1,repeat:0}]},{functionName:PB.LET,functionType:q.Logical,description:`sheets-formula.functionList.LET.description`,abstract:`sheets-formula.functionList.LET.abstract`,functionParameter:[{name:`sheets-formula.functionList.LET.functionParameter.name1.name`,detail:`sheets-formula.functionList.LET.functionParameter.name1.detail`,example:`x`,require:1,repeat:0},{name:`sheets-formula.functionList.LET.functionParameter.nameValue1.name`,detail:`sheets-formula.functionList.LET.functionParameter.nameValue1.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.LET.functionParameter.calculationOrName2.name`,detail:`sheets-formula.functionList.LET.functionParameter.calculationOrName2.detail`,example:`y`,require:1,repeat:0},{name:`sheets-formula.functionList.LET.functionParameter.nameValue2.name`,detail:`sheets-formula.functionList.LET.functionParameter.nameValue2.detail`,example:`6`,require:0,repeat:1},{name:`sheets-formula.functionList.LET.functionParameter.calculationOrName3.name`,detail:`sheets-formula.functionList.LET.functionParameter.calculationOrName3.detail`,example:`SUM(x,y)`,require:0,repeat:1}]},{functionName:PB.MAKEARRAY,aliasFunctionName:`sheets-formula.functionList.MAKEARRAY.aliasFunctionName`,functionType:q.Logical,description:`sheets-formula.functionList.MAKEARRAY.description`,abstract:`sheets-formula.functionList.MAKEARRAY.abstract`,functionParameter:[{name:`sheets-formula.functionList.MAKEARRAY.functionParameter.number1.name`,detail:`sheets-formula.functionList.MAKEARRAY.functionParameter.number1.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.MAKEARRAY.functionParameter.number2.name`,detail:`sheets-formula.functionList.MAKEARRAY.functionParameter.number2.detail`,example:`7`,require:1,repeat:0},{name:`sheets-formula.functionList.MAKEARRAY.functionParameter.value3.name`,detail:`sheets-formula.functionList.MAKEARRAY.functionParameter.value3.detail`,example:`LAMBDA(r,c, r*c)`,require:1,repeat:0}]},{functionName:PB.MAP,functionType:q.Logical,description:`sheets-formula.functionList.MAP.description`,abstract:`sheets-formula.functionList.MAP.abstract`,functionParameter:[{name:`sheets-formula.functionList.MAP.functionParameter.array1.name`,detail:`sheets-formula.functionList.MAP.functionParameter.array1.detail`,example:`D2:D11`,require:1,repeat:0},{name:`sheets-formula.functionList.MAP.functionParameter.array2.name`,detail:`sheets-formula.functionList.MAP.functionParameter.array2.detail`,example:`E2:E11`,require:0,repeat:1},{name:`sheets-formula.functionList.MAP.functionParameter.lambda.name`,detail:`sheets-formula.functionList.MAP.functionParameter.lambda.detail`,example:`LAMBDA(s,c,AND(s="Large",c="Red"))`,require:1,repeat:0}]},{functionName:PB.NOT,functionType:q.Logical,description:`sheets-formula.functionList.NOT.description`,abstract:`sheets-formula.functionList.NOT.abstract`,functionParameter:[{name:`sheets-formula.functionList.NOT.functionParameter.logical.name`,detail:`sheets-formula.functionList.NOT.functionParameter.logical.detail`,example:`A2>100`,require:1,repeat:0}]},{functionName:PB.OR,functionType:q.Logical,description:`sheets-formula.functionList.OR.description`,abstract:`sheets-formula.functionList.OR.abstract`,functionParameter:[{name:`sheets-formula.functionList.OR.functionParameter.logical1.name`,detail:`sheets-formula.functionList.OR.functionParameter.logical1.detail`,example:`A1=1`,require:1,repeat:0},{name:`sheets-formula.functionList.OR.functionParameter.logical2.name`,detail:`sheets-formula.functionList.OR.functionParameter.logical2.detail`,example:`A2=2`,require:0,repeat:1}]},{functionName:PB.REDUCE,functionType:q.Logical,description:`sheets-formula.functionList.REDUCE.description`,abstract:`sheets-formula.functionList.REDUCE.abstract`,functionParameter:[{name:`sheets-formula.functionList.REDUCE.functionParameter.initialValue.name`,detail:`sheets-formula.functionList.REDUCE.functionParameter.initialValue.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.REDUCE.functionParameter.array.name`,detail:`sheets-formula.functionList.REDUCE.functionParameter.array.detail`,example:`A1:C2`,require:1,repeat:0},{name:`sheets-formula.functionList.REDUCE.functionParameter.lambda.name`,detail:`sheets-formula.functionList.REDUCE.functionParameter.lambda.detail`,example:`LAMBDA(a,b,a+b^2)`,require:1,repeat:0}]},{functionName:PB.SCAN,functionType:q.Logical,description:`sheets-formula.functionList.SCAN.description`,abstract:`sheets-formula.functionList.SCAN.abstract`,functionParameter:[{name:`sheets-formula.functionList.SCAN.functionParameter.initialValue.name`,detail:`sheets-formula.functionList.SCAN.functionParameter.initialValue.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.SCAN.functionParameter.array.name`,detail:`sheets-formula.functionList.SCAN.functionParameter.array.detail`,example:`A1:C2`,require:1,repeat:0},{name:`sheets-formula.functionList.SCAN.functionParameter.lambda.name`,detail:`sheets-formula.functionList.SCAN.functionParameter.lambda.detail`,example:`LAMBDA(a,b,a+b^2)`,require:1,repeat:0}]},{functionName:PB.SWITCH,functionType:q.Logical,description:`sheets-formula.functionList.SWITCH.description`,abstract:`sheets-formula.functionList.SWITCH.abstract`,functionParameter:[{name:`sheets-formula.functionList.SWITCH.functionParameter.expression.name`,detail:`sheets-formula.functionList.SWITCH.functionParameter.expression.detail`,example:`WEEKDAY(A2)`,require:1,repeat:0},{name:`sheets-formula.functionList.SWITCH.functionParameter.value1.name`,detail:`sheets-formula.functionList.SWITCH.functionParameter.value1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.SWITCH.functionParameter.result1.name`,detail:`sheets-formula.functionList.SWITCH.functionParameter.result1.detail`,example:`"Sunday"`,require:1,repeat:0},{name:`sheets-formula.functionList.SWITCH.functionParameter.defaultOrValue2.name`,detail:`sheets-formula.functionList.SWITCH.functionParameter.defaultOrValue2.detail`,example:`2`,require:0,repeat:1},{name:`sheets-formula.functionList.SWITCH.functionParameter.result2.name`,detail:`sheets-formula.functionList.SWITCH.functionParameter.result2.detail`,example:`"Monday"`,require:0,repeat:1}]},{functionName:PB.TRUE,functionType:q.Logical,description:`sheets-formula.functionList.TRUE.description`,abstract:`sheets-formula.functionList.TRUE.abstract`,functionParameter:[]},{functionName:PB.XOR,functionType:q.Logical,description:`sheets-formula.functionList.XOR.description`,abstract:`sheets-formula.functionList.XOR.abstract`,functionParameter:[{name:`sheets-formula.functionList.XOR.functionParameter.logical1.name`,detail:`sheets-formula.functionList.XOR.functionParameter.logical1.detail`,example:`3>0`,require:1,repeat:0},{name:`sheets-formula.functionList.XOR.functionParameter.logical2.name`,detail:`sheets-formula.functionList.XOR.functionParameter.logical2.detail`,example:`2<9`,require:0,repeat:1}]}],Omt=[{functionName:FB.ADDRESS,functionType:q.Lookup,description:`sheets-formula.functionList.ADDRESS.description`,abstract:`sheets-formula.functionList.ADDRESS.abstract`,functionParameter:[{name:`sheets-formula.functionList.ADDRESS.functionParameter.row_num.name`,detail:`sheets-formula.functionList.ADDRESS.functionParameter.row_num.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.ADDRESS.functionParameter.column_num.name`,detail:`sheets-formula.functionList.ADDRESS.functionParameter.column_num.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.ADDRESS.functionParameter.abs_num.name`,detail:`sheets-formula.functionList.ADDRESS.functionParameter.abs_num.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.ADDRESS.functionParameter.a1.name`,detail:`sheets-formula.functionList.ADDRESS.functionParameter.a1.detail`,example:`TRUE`,require:0,repeat:0},{name:`sheets-formula.functionList.ADDRESS.functionParameter.sheet_text.name`,detail:`sheets-formula.functionList.ADDRESS.functionParameter.sheet_text.detail`,example:`"Sheet2"`,require:0,repeat:0}]},{functionName:FB.AREAS,functionType:q.Lookup,description:`sheets-formula.functionList.AREAS.description`,abstract:`sheets-formula.functionList.AREAS.abstract`,functionParameter:[{name:`sheets-formula.functionList.AREAS.functionParameter.reference.name`,detail:`sheets-formula.functionList.AREAS.functionParameter.reference.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:FB.CHOOSE,functionType:q.Lookup,description:`sheets-formula.functionList.CHOOSE.description`,abstract:`sheets-formula.functionList.CHOOSE.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHOOSE.functionParameter.indexNum.name`,detail:`sheets-formula.functionList.CHOOSE.functionParameter.indexNum.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.CHOOSE.functionParameter.value1.name`,detail:`sheets-formula.functionList.CHOOSE.functionParameter.value1.detail`,example:`"Hello"`,require:1,repeat:0},{name:`sheets-formula.functionList.CHOOSE.functionParameter.value2.name`,detail:`sheets-formula.functionList.CHOOSE.functionParameter.value2.detail`,example:`"Univer"`,require:0,repeat:1}]},{functionName:FB.CHOOSECOLS,functionType:q.Lookup,description:`sheets-formula.functionList.CHOOSECOLS.description`,abstract:`sheets-formula.functionList.CHOOSECOLS.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHOOSECOLS.functionParameter.array.name`,detail:`sheets-formula.functionList.CHOOSECOLS.functionParameter.array.detail`,example:`A1:C2`,require:1,repeat:0},{name:`sheets-formula.functionList.CHOOSECOLS.functionParameter.colNum1.name`,detail:`sheets-formula.functionList.CHOOSECOLS.functionParameter.colNum1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.CHOOSECOLS.functionParameter.colNum2.name`,detail:`sheets-formula.functionList.CHOOSECOLS.functionParameter.colNum2.detail`,example:`2`,require:0,repeat:1}]},{functionName:FB.CHOOSEROWS,functionType:q.Lookup,description:`sheets-formula.functionList.CHOOSEROWS.description`,abstract:`sheets-formula.functionList.CHOOSEROWS.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHOOSEROWS.functionParameter.array.name`,detail:`sheets-formula.functionList.CHOOSEROWS.functionParameter.array.detail`,example:`A1:C2`,require:1,repeat:0},{name:`sheets-formula.functionList.CHOOSEROWS.functionParameter.rowNum1.name`,detail:`sheets-formula.functionList.CHOOSEROWS.functionParameter.rowNum1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.CHOOSEROWS.functionParameter.rowNum2.name`,detail:`sheets-formula.functionList.CHOOSEROWS.functionParameter.rowNum2.detail`,example:`2`,require:0,repeat:1}]},{functionName:FB.COLUMN,functionType:q.Lookup,description:`sheets-formula.functionList.COLUMN.description`,abstract:`sheets-formula.functionList.COLUMN.abstract`,functionParameter:[{name:`sheets-formula.functionList.COLUMN.functionParameter.reference.name`,detail:`sheets-formula.functionList.COLUMN.functionParameter.reference.detail`,example:`A1:A20`,require:0,repeat:0}]},{functionName:FB.COLUMNS,functionType:q.Lookup,description:`sheets-formula.functionList.COLUMNS.description`,abstract:`sheets-formula.functionList.COLUMNS.abstract`,functionParameter:[{name:`sheets-formula.functionList.COLUMNS.functionParameter.array.name`,detail:`sheets-formula.functionList.COLUMNS.functionParameter.array.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:FB.DROP,functionType:q.Lookup,description:`sheets-formula.functionList.DROP.description`,abstract:`sheets-formula.functionList.DROP.abstract`,functionParameter:[{name:`sheets-formula.functionList.DROP.functionParameter.array.name`,detail:`sheets-formula.functionList.DROP.functionParameter.array.detail`,example:`A2:C4`,require:1,repeat:0},{name:`sheets-formula.functionList.DROP.functionParameter.rows.name`,detail:`sheets-formula.functionList.DROP.functionParameter.rows.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.DROP.functionParameter.columns.name`,detail:`sheets-formula.functionList.DROP.functionParameter.columns.detail`,example:`2`,require:0,repeat:0}]},{functionName:FB.EXPAND,functionType:q.Lookup,description:`sheets-formula.functionList.EXPAND.description`,abstract:`sheets-formula.functionList.EXPAND.abstract`,functionParameter:[{name:`sheets-formula.functionList.EXPAND.functionParameter.array.name`,detail:`sheets-formula.functionList.EXPAND.functionParameter.array.detail`,example:`A2`,require:1,repeat:0},{name:`sheets-formula.functionList.EXPAND.functionParameter.rows.name`,detail:`sheets-formula.functionList.EXPAND.functionParameter.rows.detail`,example:`3`,require:1,repeat:0},{name:`sheets-formula.functionList.EXPAND.functionParameter.columns.name`,detail:`sheets-formula.functionList.EXPAND.functionParameter.columns.detail`,example:`3`,require:0,repeat:0},{name:`sheets-formula.functionList.EXPAND.functionParameter.padWith.name`,detail:`sheets-formula.functionList.EXPAND.functionParameter.padWith.detail`,example:`"-"`,require:0,repeat:0}]},{functionName:FB.FILTER,functionType:q.Lookup,description:`sheets-formula.functionList.FILTER.description`,abstract:`sheets-formula.functionList.FILTER.abstract`,functionParameter:[{name:`sheets-formula.functionList.FILTER.functionParameter.array.name`,detail:`sheets-formula.functionList.FILTER.functionParameter.array.detail`,example:`A5:D20`,require:1,repeat:0},{name:`sheets-formula.functionList.FILTER.functionParameter.include.name`,detail:`sheets-formula.functionList.FILTER.functionParameter.include.detail`,example:`(C5:C20="Apple")*(A5:A20="East")`,require:1,repeat:0},{name:`sheets-formula.functionList.FILTER.functionParameter.ifEmpty.name`,detail:`sheets-formula.functionList.FILTER.functionParameter.ifEmpty.detail`,example:`""`,require:0,repeat:0}]},{functionName:FB.FORMULATEXT,functionType:q.Lookup,description:`sheets-formula.functionList.FORMULATEXT.description`,abstract:`sheets-formula.functionList.FORMULATEXT.abstract`,functionParameter:[{name:`sheets-formula.functionList.FORMULATEXT.functionParameter.reference.name`,detail:`sheets-formula.functionList.FORMULATEXT.functionParameter.reference.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:FB.GETPIVOTDATA,functionType:q.Lookup,description:`sheets-formula.functionList.GETPIVOTDATA.description`,abstract:`sheets-formula.functionList.GETPIVOTDATA.abstract`,functionParameter:[{name:`sheets-formula.functionList.GETPIVOTDATA.functionParameter.number1.name`,detail:`sheets-formula.functionList.GETPIVOTDATA.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.GETPIVOTDATA.functionParameter.number2.name`,detail:`sheets-formula.functionList.GETPIVOTDATA.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:FB.HLOOKUP,functionType:q.Lookup,description:`sheets-formula.functionList.HLOOKUP.description`,abstract:`sheets-formula.functionList.HLOOKUP.abstract`,functionParameter:[{name:`sheets-formula.functionList.HLOOKUP.functionParameter.lookupValue.name`,detail:`sheets-formula.functionList.HLOOKUP.functionParameter.lookupValue.detail`,example:`A1`,require:1,repeat:0},{name:`sheets-formula.functionList.HLOOKUP.functionParameter.tableArray.name`,detail:`sheets-formula.functionList.HLOOKUP.functionParameter.tableArray.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.HLOOKUP.functionParameter.rowIndexNum.name`,detail:`sheets-formula.functionList.HLOOKUP.functionParameter.rowIndexNum.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.HLOOKUP.functionParameter.rangeLookup.name`,detail:`sheets-formula.functionList.HLOOKUP.functionParameter.rangeLookup.detail`,example:`false`,require:0,repeat:0}]},{functionName:FB.HSTACK,functionType:q.Lookup,description:`sheets-formula.functionList.HSTACK.description`,abstract:`sheets-formula.functionList.HSTACK.abstract`,functionParameter:[{name:`sheets-formula.functionList.HSTACK.functionParameter.array1.name`,detail:`sheets-formula.functionList.HSTACK.functionParameter.array1.detail`,example:`A2:C3`,require:1,repeat:0},{name:`sheets-formula.functionList.HSTACK.functionParameter.array2.name`,detail:`sheets-formula.functionList.HSTACK.functionParameter.array2.detail`,example:`E2:G3`,require:0,repeat:1}]},{functionName:FB.HYPERLINK,functionType:q.Lookup,description:`sheets-formula.functionList.HYPERLINK.description`,abstract:`sheets-formula.functionList.HYPERLINK.abstract`,functionParameter:[{name:`sheets-formula.functionList.HYPERLINK.functionParameter.url.name`,detail:`sheets-formula.functionList.HYPERLINK.functionParameter.url.detail`,example:`"https://univer.ai/"`,require:1,repeat:0},{name:`sheets-formula.functionList.HYPERLINK.functionParameter.linkLabel.name`,detail:`sheets-formula.functionList.HYPERLINK.functionParameter.linkLabel.detail`,example:`"Univer"`,require:0,repeat:0}]},{functionName:FB.IMAGE,functionType:q.Lookup,description:`sheets-formula.functionList.IMAGE.description`,abstract:`sheets-formula.functionList.IMAGE.abstract`,functionParameter:[{name:`sheets-formula.functionList.IMAGE.functionParameter.source.name`,detail:`sheets-formula.functionList.IMAGE.functionParameter.source.detail`,example:`"https://github.com/dream-num.png"`,require:1,repeat:0},{name:`sheets-formula.functionList.IMAGE.functionParameter.altText.name`,detail:`sheets-formula.functionList.IMAGE.functionParameter.altText.detail`,example:`"Univer Logo"`,require:0,repeat:0},{name:`sheets-formula.functionList.IMAGE.functionParameter.sizing.name`,detail:`sheets-formula.functionList.IMAGE.functionParameter.sizing.detail`,example:`3`,require:0,repeat:0},{name:`sheets-formula.functionList.IMAGE.functionParameter.height.name`,detail:`sheets-formula.functionList.IMAGE.functionParameter.height.detail`,example:`100`,require:0,repeat:0},{name:`sheets-formula.functionList.IMAGE.functionParameter.width.name`,detail:`sheets-formula.functionList.IMAGE.functionParameter.width.detail`,example:`100`,require:0,repeat:0}]},{functionName:FB.INDEX,functionType:q.Lookup,description:`sheets-formula.functionList.INDEX.description`,abstract:`sheets-formula.functionList.INDEX.abstract`,functionParameter:[{name:`sheets-formula.functionList.INDEX.functionParameter.reference.name`,detail:`sheets-formula.functionList.INDEX.functionParameter.reference.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.INDEX.functionParameter.rowNum.name`,detail:`sheets-formula.functionList.INDEX.functionParameter.rowNum.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.INDEX.functionParameter.columnNum.name`,detail:`sheets-formula.functionList.INDEX.functionParameter.columnNum.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.INDEX.functionParameter.areaNum.name`,detail:`sheets-formula.functionList.INDEX.functionParameter.areaNum.detail`,example:`2`,require:0,repeat:0}]},{functionName:FB.INDIRECT,functionType:q.Lookup,description:`sheets-formula.functionList.INDIRECT.description`,abstract:`sheets-formula.functionList.INDIRECT.abstract`,functionParameter:[{name:`sheets-formula.functionList.INDIRECT.functionParameter.refText.name`,detail:`sheets-formula.functionList.INDIRECT.functionParameter.refText.detail`,example:`"A1"`,require:1,repeat:0},{name:`sheets-formula.functionList.INDIRECT.functionParameter.a1.name`,detail:`sheets-formula.functionList.INDIRECT.functionParameter.a1.detail`,example:`TRUE`,require:0,repeat:0}]},{functionName:FB.LOOKUP,functionType:q.Lookup,description:`sheets-formula.functionList.LOOKUP.description`,abstract:`sheets-formula.functionList.LOOKUP.abstract`,functionParameter:[{name:`sheets-formula.functionList.LOOKUP.functionParameter.lookupValue.name`,detail:`sheets-formula.functionList.LOOKUP.functionParameter.lookupValue.detail`,example:`A1`,require:1,repeat:0},{name:`sheets-formula.functionList.LOOKUP.functionParameter.lookupVectorOrArray.name`,detail:`sheets-formula.functionList.LOOKUP.functionParameter.lookupVectorOrArray.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.LOOKUP.functionParameter.resultVector.name`,detail:`sheets-formula.functionList.LOOKUP.functionParameter.resultVector.detail`,example:`A1:A20`,require:0,repeat:0}]},{functionName:FB.MATCH,functionType:q.Lookup,description:`sheets-formula.functionList.MATCH.description`,abstract:`sheets-formula.functionList.MATCH.abstract`,functionParameter:[{name:`sheets-formula.functionList.MATCH.functionParameter.lookupValue.name`,detail:`sheets-formula.functionList.MATCH.functionParameter.lookupValue.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.MATCH.functionParameter.lookupArray.name`,detail:`sheets-formula.functionList.MATCH.functionParameter.lookupArray.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.MATCH.functionParameter.matchType.name`,detail:`sheets-formula.functionList.MATCH.functionParameter.matchType.detail`,example:`1`,require:0,repeat:0}]},{functionName:FB.OFFSET,functionType:q.Lookup,description:`sheets-formula.functionList.OFFSET.description`,abstract:`sheets-formula.functionList.OFFSET.abstract`,functionParameter:[{name:`sheets-formula.functionList.OFFSET.functionParameter.reference.name`,detail:`sheets-formula.functionList.OFFSET.functionParameter.reference.detail`,example:`A1`,require:1,repeat:0},{name:`sheets-formula.functionList.OFFSET.functionParameter.rows.name`,detail:`sheets-formula.functionList.OFFSET.functionParameter.rows.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.OFFSET.functionParameter.cols.name`,detail:`sheets-formula.functionList.OFFSET.functionParameter.cols.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.OFFSET.functionParameter.height.name`,detail:`sheets-formula.functionList.OFFSET.functionParameter.height.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.OFFSET.functionParameter.width.name`,detail:`sheets-formula.functionList.OFFSET.functionParameter.width.detail`,example:`1`,require:0,repeat:0}]},{functionName:FB.ROW,functionType:q.Lookup,description:`sheets-formula.functionList.ROW.description`,abstract:`sheets-formula.functionList.ROW.abstract`,functionParameter:[{name:`sheets-formula.functionList.ROW.functionParameter.reference.name`,detail:`sheets-formula.functionList.ROW.functionParameter.reference.detail`,example:`A1`,require:0,repeat:0}]},{functionName:FB.ROWS,functionType:q.Lookup,description:`sheets-formula.functionList.ROWS.description`,abstract:`sheets-formula.functionList.ROWS.abstract`,functionParameter:[{name:`sheets-formula.functionList.ROWS.functionParameter.array.name`,detail:`sheets-formula.functionList.ROWS.functionParameter.array.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:FB.RTD,functionType:q.Lookup,description:`sheets-formula.functionList.RTD.description`,abstract:`sheets-formula.functionList.RTD.abstract`,functionParameter:[{name:`sheets-formula.functionList.RTD.functionParameter.number1.name`,detail:`sheets-formula.functionList.RTD.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.RTD.functionParameter.number2.name`,detail:`sheets-formula.functionList.RTD.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:FB.SORT,functionType:q.Lookup,description:`sheets-formula.functionList.SORT.description`,abstract:`sheets-formula.functionList.SORT.abstract`,functionParameter:[{name:`sheets-formula.functionList.SORT.functionParameter.array.name`,detail:`sheets-formula.functionList.SORT.functionParameter.array.detail`,example:`A2:A17`,require:1,repeat:0},{name:`sheets-formula.functionList.SORT.functionParameter.sortIndex.name`,detail:`sheets-formula.functionList.SORT.functionParameter.sortIndex.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.SORT.functionParameter.sortOrder.name`,detail:`sheets-formula.functionList.SORT.functionParameter.sortOrder.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.SORT.functionParameter.byCol.name`,detail:`sheets-formula.functionList.SORT.functionParameter.byCol.detail`,example:`false`,require:0,repeat:0}]},{functionName:FB.SORTBY,functionType:q.Lookup,description:`sheets-formula.functionList.SORTBY.description`,abstract:`sheets-formula.functionList.SORTBY.abstract`,functionParameter:[{name:`sheets-formula.functionList.SORTBY.functionParameter.array.name`,detail:`sheets-formula.functionList.SORTBY.functionParameter.array.detail`,example:`D2:D9`,require:1,repeat:0},{name:`sheets-formula.functionList.SORTBY.functionParameter.byArray1.name`,detail:`sheets-formula.functionList.SORTBY.functionParameter.byArray1.detail`,example:`E2:E9`,require:1,repeat:0},{name:`sheets-formula.functionList.SORTBY.functionParameter.sortOrder1.name`,detail:`sheets-formula.functionList.SORTBY.functionParameter.sortOrder1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.SORTBY.functionParameter.byArray2.name`,detail:`sheets-formula.functionList.SORTBY.functionParameter.byArray2.detail`,example:`E2:E9`,require:0,repeat:1},{name:`sheets-formula.functionList.SORTBY.functionParameter.sortOrder2.name`,detail:`sheets-formula.functionList.SORTBY.functionParameter.sortOrder2.detail`,example:`1`,require:0,repeat:1}]},{functionName:FB.TAKE,functionType:q.Lookup,description:`sheets-formula.functionList.TAKE.description`,abstract:`sheets-formula.functionList.TAKE.abstract`,functionParameter:[{name:`sheets-formula.functionList.TAKE.functionParameter.array.name`,detail:`sheets-formula.functionList.TAKE.functionParameter.array.detail`,example:`A2:C4`,require:1,repeat:0},{name:`sheets-formula.functionList.TAKE.functionParameter.rows.name`,detail:`sheets-formula.functionList.TAKE.functionParameter.rows.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.TAKE.functionParameter.columns.name`,detail:`sheets-formula.functionList.TAKE.functionParameter.columns.detail`,example:`2`,require:0,repeat:0}]},{functionName:FB.TOCOL,functionType:q.Lookup,description:`sheets-formula.functionList.TOCOL.description`,abstract:`sheets-formula.functionList.TOCOL.abstract`,functionParameter:[{name:`sheets-formula.functionList.TOCOL.functionParameter.array.name`,detail:`sheets-formula.functionList.TOCOL.functionParameter.array.detail`,example:`A2:D4`,require:1,repeat:0},{name:`sheets-formula.functionList.TOCOL.functionParameter.ignore.name`,detail:`sheets-formula.functionList.TOCOL.functionParameter.ignore.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.TOCOL.functionParameter.scanByColumn.name`,detail:`sheets-formula.functionList.TOCOL.functionParameter.scanByColumn.detail`,example:`TRUE`,require:0,repeat:0}]},{functionName:FB.TOROW,functionType:q.Lookup,description:`sheets-formula.functionList.TOROW.description`,abstract:`sheets-formula.functionList.TOROW.abstract`,functionParameter:[{name:`sheets-formula.functionList.TOROW.functionParameter.array.name`,detail:`sheets-formula.functionList.TOROW.functionParameter.array.detail`,example:`A2:D4`,require:1,repeat:0},{name:`sheets-formula.functionList.TOROW.functionParameter.ignore.name`,detail:`sheets-formula.functionList.TOROW.functionParameter.ignore.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.TOROW.functionParameter.scanByColumn.name`,detail:`sheets-formula.functionList.TOROW.functionParameter.scanByColumn.detail`,example:`TRUE`,require:0,repeat:0}]},{functionName:FB.TRANSPOSE,functionType:q.Lookup,description:`sheets-formula.functionList.TRANSPOSE.description`,abstract:`sheets-formula.functionList.TRANSPOSE.abstract`,functionParameter:[{name:`sheets-formula.functionList.TRANSPOSE.functionParameter.array.name`,detail:`sheets-formula.functionList.TRANSPOSE.functionParameter.array.detail`,example:`A2:F9`,require:1,repeat:0}]},{functionName:FB.UNIQUE,functionType:q.Lookup,description:`sheets-formula.functionList.UNIQUE.description`,abstract:`sheets-formula.functionList.UNIQUE.abstract`,functionParameter:[{name:`sheets-formula.functionList.UNIQUE.functionParameter.array.name`,detail:`sheets-formula.functionList.UNIQUE.functionParameter.array.detail`,example:`A2:A12`,require:1,repeat:0},{name:`sheets-formula.functionList.UNIQUE.functionParameter.byCol.name`,detail:`sheets-formula.functionList.UNIQUE.functionParameter.byCol.detail`,example:`false`,require:0,repeat:0},{name:`sheets-formula.functionList.UNIQUE.functionParameter.exactlyOnce.name`,detail:`sheets-formula.functionList.UNIQUE.functionParameter.exactlyOnce.detail`,example:`false`,require:0,repeat:0}]},{functionName:FB.VLOOKUP,functionType:q.Lookup,description:`sheets-formula.functionList.VLOOKUP.description`,abstract:`sheets-formula.functionList.VLOOKUP.abstract`,functionParameter:[{name:`sheets-formula.functionList.VLOOKUP.functionParameter.lookupValue.name`,detail:`sheets-formula.functionList.VLOOKUP.functionParameter.lookupValue.detail`,example:`B2`,require:1,repeat:0},{name:`sheets-formula.functionList.VLOOKUP.functionParameter.tableArray.name`,detail:`sheets-formula.functionList.VLOOKUP.functionParameter.tableArray.detail`,example:`C2:E7`,require:1,repeat:0},{name:`sheets-formula.functionList.VLOOKUP.functionParameter.colIndexNum.name`,detail:`sheets-formula.functionList.VLOOKUP.functionParameter.colIndexNum.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.VLOOKUP.functionParameter.rangeLookup.name`,detail:`sheets-formula.functionList.VLOOKUP.functionParameter.rangeLookup.detail`,example:`TRUE`,require:0,repeat:0}]},{functionName:FB.VSTACK,functionType:q.Lookup,description:`sheets-formula.functionList.VSTACK.description`,abstract:`sheets-formula.functionList.VSTACK.abstract`,functionParameter:[{name:`sheets-formula.functionList.VSTACK.functionParameter.array1.name`,detail:`sheets-formula.functionList.VSTACK.functionParameter.array1.detail`,example:`A2:C3`,require:1,repeat:0},{name:`sheets-formula.functionList.VSTACK.functionParameter.array2.name`,detail:`sheets-formula.functionList.VSTACK.functionParameter.array2.detail`,example:`E2:G3`,require:0,repeat:1}]},{functionName:FB.WRAPCOLS,functionType:q.Lookup,description:`sheets-formula.functionList.WRAPCOLS.description`,abstract:`sheets-formula.functionList.WRAPCOLS.abstract`,functionParameter:[{name:`sheets-formula.functionList.WRAPCOLS.functionParameter.vector.name`,detail:`sheets-formula.functionList.WRAPCOLS.functionParameter.vector.detail`,example:`A2:G2`,require:1,repeat:0},{name:`sheets-formula.functionList.WRAPCOLS.functionParameter.wrapCount.name`,detail:`sheets-formula.functionList.WRAPCOLS.functionParameter.wrapCount.detail`,example:`3`,require:1,repeat:0},{name:`sheets-formula.functionList.WRAPCOLS.functionParameter.padWith.name`,detail:`sheets-formula.functionList.WRAPCOLS.functionParameter.padWith.detail`,example:`"x"`,require:0,repeat:0}]},{functionName:FB.WRAPROWS,functionType:q.Lookup,description:`sheets-formula.functionList.WRAPROWS.description`,abstract:`sheets-formula.functionList.WRAPROWS.abstract`,functionParameter:[{name:`sheets-formula.functionList.WRAPROWS.functionParameter.vector.name`,detail:`sheets-formula.functionList.WRAPROWS.functionParameter.vector.detail`,example:`A2:G2`,require:1,repeat:0},{name:`sheets-formula.functionList.WRAPROWS.functionParameter.wrapCount.name`,detail:`sheets-formula.functionList.WRAPROWS.functionParameter.wrapCount.detail`,example:`3`,require:1,repeat:0},{name:`sheets-formula.functionList.WRAPROWS.functionParameter.padWith.name`,detail:`sheets-formula.functionList.WRAPROWS.functionParameter.padWith.detail`,example:`"x"`,require:0,repeat:0}]},{functionName:FB.XLOOKUP,functionType:q.Lookup,description:`sheets-formula.functionList.XLOOKUP.description`,abstract:`sheets-formula.functionList.XLOOKUP.abstract`,functionParameter:[{name:`sheets-formula.functionList.XLOOKUP.functionParameter.lookupValue.name`,detail:`sheets-formula.functionList.XLOOKUP.functionParameter.lookupValue.detail`,example:`A1`,require:1,repeat:0},{name:`sheets-formula.functionList.XLOOKUP.functionParameter.lookupArray.name`,detail:`sheets-formula.functionList.XLOOKUP.functionParameter.lookupArray.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.XLOOKUP.functionParameter.returnArray.name`,detail:`sheets-formula.functionList.XLOOKUP.functionParameter.returnArray.detail`,example:`B1:B20`,require:1,repeat:0},{name:`sheets-formula.functionList.XLOOKUP.functionParameter.ifNotFound.name`,detail:`sheets-formula.functionList.XLOOKUP.functionParameter.ifNotFound.detail`,example:`default`,require:0,repeat:0},{name:`sheets-formula.functionList.XLOOKUP.functionParameter.matchMode.name`,detail:`sheets-formula.functionList.XLOOKUP.functionParameter.matchMode.detail`,example:`0`,require:0,repeat:0},{name:`sheets-formula.functionList.XLOOKUP.functionParameter.searchMode.name`,detail:`sheets-formula.functionList.XLOOKUP.functionParameter.searchMode.detail`,example:`1`,require:0,repeat:0}]},{functionName:FB.XMATCH,functionType:q.Lookup,description:`sheets-formula.functionList.XMATCH.description`,abstract:`sheets-formula.functionList.XMATCH.abstract`,functionParameter:[{name:`sheets-formula.functionList.XMATCH.functionParameter.lookupValue.name`,detail:`sheets-formula.functionList.XMATCH.functionParameter.lookupValue.detail`,example:`B1`,require:1,repeat:0},{name:`sheets-formula.functionList.XMATCH.functionParameter.lookupArray.name`,detail:`sheets-formula.functionList.XMATCH.functionParameter.lookupArray.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.XMATCH.functionParameter.matchMode.name`,detail:`sheets-formula.functionList.XMATCH.functionParameter.matchMode.detail`,example:`0`,require:0,repeat:0},{name:`sheets-formula.functionList.XMATCH.functionParameter.searchMode.name`,detail:`sheets-formula.functionList.XMATCH.functionParameter.searchMode.detail`,example:`1`,require:0,repeat:0}]}],kmt=[{functionName:IB.ABS,functionType:q.Math,description:`sheets-formula.functionList.ABS.description`,abstract:`sheets-formula.functionList.ABS.abstract`,functionParameter:[{name:`sheets-formula.functionList.ABS.functionParameter.number.name`,detail:`sheets-formula.functionList.ABS.functionParameter.number.detail`,example:`-2`,require:1,repeat:0}]},{functionName:IB.ACOS,functionType:q.Math,description:`sheets-formula.functionList.ACOS.description`,abstract:`sheets-formula.functionList.ACOS.abstract`,functionParameter:[{name:`sheets-formula.functionList.ACOS.functionParameter.number.name`,detail:`sheets-formula.functionList.ACOS.functionParameter.number.detail`,example:`0`,require:1,repeat:0}]},{functionName:IB.ACOSH,functionType:q.Math,description:`sheets-formula.functionList.ACOSH.description`,abstract:`sheets-formula.functionList.ACOSH.abstract`,functionParameter:[{name:`sheets-formula.functionList.ACOSH.functionParameter.number.name`,detail:`sheets-formula.functionList.ACOSH.functionParameter.number.detail`,example:`2`,require:1,repeat:0}]},{functionName:IB.ACOT,functionType:q.Math,description:`sheets-formula.functionList.ACOT.description`,abstract:`sheets-formula.functionList.ACOT.abstract`,functionParameter:[{name:`sheets-formula.functionList.ACOT.functionParameter.number.name`,detail:`sheets-formula.functionList.ACOT.functionParameter.number.detail`,example:`0`,require:1,repeat:0}]},{functionName:IB.ACOTH,functionType:q.Math,description:`sheets-formula.functionList.ACOTH.description`,abstract:`sheets-formula.functionList.ACOTH.abstract`,functionParameter:[{name:`sheets-formula.functionList.ACOTH.functionParameter.number.name`,detail:`sheets-formula.functionList.ACOTH.functionParameter.number.detail`,example:`6`,require:1,repeat:0}]},{functionName:IB.AGGREGATE,functionType:q.Math,description:`sheets-formula.functionList.AGGREGATE.description`,abstract:`sheets-formula.functionList.AGGREGATE.abstract`,functionParameter:[{name:`sheets-formula.functionList.AGGREGATE.functionParameter.functionNum.name`,detail:`sheets-formula.functionList.AGGREGATE.functionParameter.functionNum.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.AGGREGATE.functionParameter.options.name`,detail:`sheets-formula.functionList.AGGREGATE.functionParameter.options.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.AGGREGATE.functionParameter.ref1.name`,detail:`sheets-formula.functionList.AGGREGATE.functionParameter.ref1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.AGGREGATE.functionParameter.ref2.name`,detail:`sheets-formula.functionList.AGGREGATE.functionParameter.ref2.detail`,example:`B1:B20`,require:0,repeat:1}]},{functionName:IB.ARABIC,functionType:q.Math,description:`sheets-formula.functionList.ARABIC.description`,abstract:`sheets-formula.functionList.ARABIC.abstract`,functionParameter:[{name:`sheets-formula.functionList.ARABIC.functionParameter.text.name`,detail:`sheets-formula.functionList.ARABIC.functionParameter.text.detail`,example:`"LVII"`,require:1,repeat:0}]},{functionName:IB.ASIN,functionType:q.Math,description:`sheets-formula.functionList.ASIN.description`,abstract:`sheets-formula.functionList.ASIN.abstract`,functionParameter:[{name:`sheets-formula.functionList.ASIN.functionParameter.number.name`,detail:`sheets-formula.functionList.ASIN.functionParameter.number.detail`,example:`0`,require:1,repeat:0}]},{functionName:IB.ASINH,functionType:q.Math,description:`sheets-formula.functionList.ASINH.description`,abstract:`sheets-formula.functionList.ASINH.abstract`,functionParameter:[{name:`sheets-formula.functionList.ASINH.functionParameter.number.name`,detail:`sheets-formula.functionList.ASINH.functionParameter.number.detail`,example:`10`,require:1,repeat:0}]},{functionName:IB.ATAN,functionType:q.Math,description:`sheets-formula.functionList.ATAN.description`,abstract:`sheets-formula.functionList.ATAN.abstract`,functionParameter:[{name:`sheets-formula.functionList.ATAN.functionParameter.number.name`,detail:`sheets-formula.functionList.ATAN.functionParameter.number.detail`,example:`1`,require:1,repeat:0}]},{functionName:IB.ATAN2,functionType:q.Math,description:`sheets-formula.functionList.ATAN2.description`,abstract:`sheets-formula.functionList.ATAN2.abstract`,functionParameter:[{name:`sheets-formula.functionList.ATAN2.functionParameter.xNum.name`,detail:`sheets-formula.functionList.ATAN2.functionParameter.xNum.detail`,example:`4`,require:1,repeat:0},{name:`sheets-formula.functionList.ATAN2.functionParameter.yNum.name`,detail:`sheets-formula.functionList.ATAN2.functionParameter.yNum.detail`,example:`3`,require:1,repeat:0}]},{functionName:IB.ATANH,functionType:q.Math,description:`sheets-formula.functionList.ATANH.description`,abstract:`sheets-formula.functionList.ATANH.abstract`,functionParameter:[{name:`sheets-formula.functionList.ATANH.functionParameter.number.name`,detail:`sheets-formula.functionList.ATANH.functionParameter.number.detail`,example:`0.1`,require:1,repeat:0}]},{functionName:IB.BASE,functionType:q.Math,description:`sheets-formula.functionList.BASE.description`,abstract:`sheets-formula.functionList.BASE.abstract`,functionParameter:[{name:`sheets-formula.functionList.BASE.functionParameter.number.name`,detail:`sheets-formula.functionList.BASE.functionParameter.number.detail`,example:`15`,require:1,repeat:0},{name:`sheets-formula.functionList.BASE.functionParameter.radix.name`,detail:`sheets-formula.functionList.BASE.functionParameter.radix.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.BASE.functionParameter.minLength.name`,detail:`sheets-formula.functionList.BASE.functionParameter.minLength.detail`,example:`10`,require:0,repeat:0}]},{functionName:IB.CEILING,functionType:q.Math,description:`sheets-formula.functionList.CEILING.description`,abstract:`sheets-formula.functionList.CEILING.abstract`,functionParameter:[{name:`sheets-formula.functionList.CEILING.functionParameter.number.name`,detail:`sheets-formula.functionList.CEILING.functionParameter.number.detail`,example:`2.5`,require:1,repeat:0},{name:`sheets-formula.functionList.CEILING.functionParameter.significance.name`,detail:`sheets-formula.functionList.CEILING.functionParameter.significance.detail`,example:`1`,require:1,repeat:0}]},{functionName:IB.CEILING_MATH,functionType:q.Math,description:`sheets-formula.functionList.CEILING_MATH.description`,abstract:`sheets-formula.functionList.CEILING_MATH.abstract`,functionParameter:[{name:`sheets-formula.functionList.CEILING_MATH.functionParameter.number.name`,detail:`sheets-formula.functionList.CEILING_MATH.functionParameter.number.detail`,example:`-5.5`,require:1,repeat:0},{name:`sheets-formula.functionList.CEILING_MATH.functionParameter.significance.name`,detail:`sheets-formula.functionList.CEILING_MATH.functionParameter.significance.detail`,example:`2`,require:0,repeat:0},{name:`sheets-formula.functionList.CEILING_MATH.functionParameter.mode.name`,detail:`sheets-formula.functionList.CEILING_MATH.functionParameter.mode.detail`,example:`-1`,require:0,repeat:0}]},{functionName:IB.CEILING_PRECISE,functionType:q.Math,description:`sheets-formula.functionList.CEILING_PRECISE.description`,abstract:`sheets-formula.functionList.CEILING_PRECISE.abstract`,functionParameter:[{name:`sheets-formula.functionList.CEILING_PRECISE.functionParameter.number.name`,detail:`sheets-formula.functionList.CEILING_PRECISE.functionParameter.number.detail`,example:`4.3`,require:1,repeat:0},{name:`sheets-formula.functionList.CEILING_PRECISE.functionParameter.significance.name`,detail:`sheets-formula.functionList.CEILING_PRECISE.functionParameter.significance.detail`,example:`2`,require:0,repeat:0}]},{functionName:IB.COMBIN,functionType:q.Math,description:`sheets-formula.functionList.COMBIN.description`,abstract:`sheets-formula.functionList.COMBIN.abstract`,functionParameter:[{name:`sheets-formula.functionList.COMBIN.functionParameter.number.name`,detail:`sheets-formula.functionList.COMBIN.functionParameter.number.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.COMBIN.functionParameter.numberChosen.name`,detail:`sheets-formula.functionList.COMBIN.functionParameter.numberChosen.detail`,example:`2`,require:1,repeat:0}]},{functionName:IB.COMBINA,functionType:q.Math,description:`sheets-formula.functionList.COMBINA.description`,abstract:`sheets-formula.functionList.COMBINA.abstract`,functionParameter:[{name:`sheets-formula.functionList.COMBINA.functionParameter.number.name`,detail:`sheets-formula.functionList.COMBINA.functionParameter.number.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.COMBINA.functionParameter.numberChosen.name`,detail:`sheets-formula.functionList.COMBINA.functionParameter.numberChosen.detail`,example:`2`,require:1,repeat:0}]},{functionName:IB.COS,functionType:q.Math,description:`sheets-formula.functionList.COS.description`,abstract:`sheets-formula.functionList.COS.abstract`,functionParameter:[{name:`sheets-formula.functionList.COS.functionParameter.number.name`,detail:`sheets-formula.functionList.COS.functionParameter.number.detail`,example:`1`,require:1,repeat:0}]},{functionName:IB.COSH,functionType:q.Math,description:`sheets-formula.functionList.COSH.description`,abstract:`sheets-formula.functionList.COSH.abstract`,functionParameter:[{name:`sheets-formula.functionList.COSH.functionParameter.number.name`,detail:`sheets-formula.functionList.COSH.functionParameter.number.detail`,example:`4`,require:1,repeat:0}]},{functionName:IB.COT,functionType:q.Math,description:`sheets-formula.functionList.COT.description`,abstract:`sheets-formula.functionList.COT.abstract`,functionParameter:[{name:`sheets-formula.functionList.COT.functionParameter.number.name`,detail:`sheets-formula.functionList.COT.functionParameter.number.detail`,example:`30`,require:1,repeat:0}]},{functionName:IB.COTH,functionType:q.Math,description:`sheets-formula.functionList.COTH.description`,abstract:`sheets-formula.functionList.COTH.abstract`,functionParameter:[{name:`sheets-formula.functionList.COTH.functionParameter.number.name`,detail:`sheets-formula.functionList.COTH.functionParameter.number.detail`,example:`2`,require:1,repeat:0}]},{functionName:IB.CSC,functionType:q.Math,description:`sheets-formula.functionList.CSC.description`,abstract:`sheets-formula.functionList.CSC.abstract`,functionParameter:[{name:`sheets-formula.functionList.CSC.functionParameter.number.name`,detail:`sheets-formula.functionList.CSC.functionParameter.number.detail`,example:`15`,require:1,repeat:0}]},{functionName:IB.CSCH,functionType:q.Math,description:`sheets-formula.functionList.CSCH.description`,abstract:`sheets-formula.functionList.CSCH.abstract`,functionParameter:[{name:`sheets-formula.functionList.CSCH.functionParameter.number.name`,detail:`sheets-formula.functionList.CSCH.functionParameter.number.detail`,example:`1.5`,require:1,repeat:0}]},{functionName:IB.DECIMAL,functionType:q.Math,description:`sheets-formula.functionList.DECIMAL.description`,abstract:`sheets-formula.functionList.DECIMAL.abstract`,functionParameter:[{name:`sheets-formula.functionList.DECIMAL.functionParameter.text.name`,detail:`sheets-formula.functionList.DECIMAL.functionParameter.text.detail`,example:`"FF"`,require:1,repeat:0},{name:`sheets-formula.functionList.DECIMAL.functionParameter.radix.name`,detail:`sheets-formula.functionList.DECIMAL.functionParameter.radix.detail`,example:`16`,require:1,repeat:0}]},{functionName:IB.DEGREES,functionType:q.Math,description:`sheets-formula.functionList.DEGREES.description`,abstract:`sheets-formula.functionList.DEGREES.abstract`,functionParameter:[{name:`sheets-formula.functionList.DEGREES.functionParameter.angle.name`,detail:`sheets-formula.functionList.DEGREES.functionParameter.angle.detail`,example:`PI()`,require:1,repeat:0}]},{functionName:IB.EVEN,functionType:q.Math,description:`sheets-formula.functionList.EVEN.description`,abstract:`sheets-formula.functionList.EVEN.abstract`,functionParameter:[{name:`sheets-formula.functionList.EVEN.functionParameter.number.name`,detail:`sheets-formula.functionList.EVEN.functionParameter.number.detail`,example:`1.5`,require:1,repeat:0}]},{functionName:IB.EXP,functionType:q.Math,description:`sheets-formula.functionList.EXP.description`,abstract:`sheets-formula.functionList.EXP.abstract`,functionParameter:[{name:`sheets-formula.functionList.EXP.functionParameter.number.name`,detail:`sheets-formula.functionList.EXP.functionParameter.number.detail`,example:`2`,require:1,repeat:0}]},{functionName:IB.FACT,functionType:q.Math,description:`sheets-formula.functionList.FACT.description`,abstract:`sheets-formula.functionList.FACT.abstract`,functionParameter:[{name:`sheets-formula.functionList.FACT.functionParameter.number.name`,detail:`sheets-formula.functionList.FACT.functionParameter.number.detail`,example:`5`,require:1,repeat:0}]},{functionName:IB.FACTDOUBLE,functionType:q.Math,description:`sheets-formula.functionList.FACTDOUBLE.description`,abstract:`sheets-formula.functionList.FACTDOUBLE.abstract`,functionParameter:[{name:`sheets-formula.functionList.FACTDOUBLE.functionParameter.number.name`,detail:`sheets-formula.functionList.FACTDOUBLE.functionParameter.number.detail`,example:`6`,require:1,repeat:0}]},{functionName:IB.FLOOR,functionType:q.Math,description:`sheets-formula.functionList.FLOOR.description`,abstract:`sheets-formula.functionList.FLOOR.abstract`,functionParameter:[{name:`sheets-formula.functionList.FLOOR.functionParameter.number.name`,detail:`sheets-formula.functionList.FLOOR.functionParameter.number.detail`,example:`3.7`,require:1,repeat:0},{name:`sheets-formula.functionList.FLOOR.functionParameter.significance.name`,detail:`sheets-formula.functionList.FLOOR.functionParameter.significance.detail`,example:`2`,require:1,repeat:0}]},{functionName:IB.FLOOR_MATH,functionType:q.Math,description:`sheets-formula.functionList.FLOOR_MATH.description`,abstract:`sheets-formula.functionList.FLOOR_MATH.abstract`,functionParameter:[{name:`sheets-formula.functionList.FLOOR_MATH.functionParameter.number.name`,detail:`sheets-formula.functionList.FLOOR_MATH.functionParameter.number.detail`,example:`-5.5`,require:1,repeat:0},{name:`sheets-formula.functionList.FLOOR_MATH.functionParameter.significance.name`,detail:`sheets-formula.functionList.FLOOR_MATH.functionParameter.significance.detail`,example:`2`,require:0,repeat:0},{name:`sheets-formula.functionList.FLOOR_MATH.functionParameter.mode.name`,detail:`sheets-formula.functionList.FLOOR_MATH.functionParameter.mode.detail`,example:`-1`,require:0,repeat:0}]},{functionName:IB.FLOOR_PRECISE,functionType:q.Math,description:`sheets-formula.functionList.FLOOR_PRECISE.description`,abstract:`sheets-formula.functionList.FLOOR_PRECISE.abstract`,functionParameter:[{name:`sheets-formula.functionList.FLOOR_PRECISE.functionParameter.number.name`,detail:`sheets-formula.functionList.FLOOR_PRECISE.functionParameter.number.detail`,example:`-3.2`,require:1,repeat:0},{name:`sheets-formula.functionList.FLOOR_PRECISE.functionParameter.significance.name`,detail:`sheets-formula.functionList.FLOOR_PRECISE.functionParameter.significance.detail`,example:`-1`,require:0,repeat:0}]},{functionName:IB.GCD,functionType:q.Math,description:`sheets-formula.functionList.GCD.description`,abstract:`sheets-formula.functionList.GCD.abstract`,functionParameter:[{name:`sheets-formula.functionList.GCD.functionParameter.number1.name`,detail:`sheets-formula.functionList.GCD.functionParameter.number1.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.GCD.functionParameter.number2.name`,detail:`sheets-formula.functionList.GCD.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:IB.INT,functionType:q.Math,description:`sheets-formula.functionList.INT.description`,abstract:`sheets-formula.functionList.INT.abstract`,functionParameter:[{name:`sheets-formula.functionList.INT.functionParameter.number.name`,detail:`sheets-formula.functionList.INT.functionParameter.number.detail`,example:`8.9`,require:1,repeat:0}]},{functionName:IB.ISO_CEILING,functionType:q.Math,description:`sheets-formula.functionList.ISO_CEILING.description`,abstract:`sheets-formula.functionList.ISO_CEILING.abstract`,functionParameter:[{name:`sheets-formula.functionList.ISO_CEILING.functionParameter.number1.name`,detail:`sheets-formula.functionList.ISO_CEILING.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.ISO_CEILING.functionParameter.number2.name`,detail:`sheets-formula.functionList.ISO_CEILING.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:IB.LCM,functionType:q.Math,description:`sheets-formula.functionList.LCM.description`,abstract:`sheets-formula.functionList.LCM.abstract`,functionParameter:[{name:`sheets-formula.functionList.LCM.functionParameter.number1.name`,detail:`sheets-formula.functionList.LCM.functionParameter.number1.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.LCM.functionParameter.number2.name`,detail:`sheets-formula.functionList.LCM.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:IB.LET,functionType:q.Math,description:`sheets-formula.functionList.LET.description`,abstract:`sheets-formula.functionList.LET.abstract`,functionParameter:[{name:`sheets-formula.functionList.LET.functionParameter.number1.name`,detail:`sheets-formula.functionList.LET.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.LET.functionParameter.number2.name`,detail:`sheets-formula.functionList.LET.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:IB.LN,functionType:q.Math,description:`sheets-formula.functionList.LN.description`,abstract:`sheets-formula.functionList.LN.abstract`,functionParameter:[{name:`sheets-formula.functionList.LN.functionParameter.number.name`,detail:`sheets-formula.functionList.LN.functionParameter.number.detail`,example:`EXP(3)`,require:1,repeat:0}]},{functionName:IB.LOG,functionType:q.Math,description:`sheets-formula.functionList.LOG.description`,abstract:`sheets-formula.functionList.LOG.abstract`,functionParameter:[{name:`sheets-formula.functionList.LOG.functionParameter.number.name`,detail:`sheets-formula.functionList.LOG.functionParameter.number.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.LOG.functionParameter.base.name`,detail:`sheets-formula.functionList.LOG.functionParameter.base.detail`,example:`2`,require:0,repeat:0}]},{functionName:IB.LOG10,functionType:q.Math,description:`sheets-formula.functionList.LOG10.description`,abstract:`sheets-formula.functionList.LOG10.abstract`,functionParameter:[{name:`sheets-formula.functionList.LOG10.functionParameter.number.name`,detail:`sheets-formula.functionList.LOG10.functionParameter.number.detail`,example:`100000`,require:1,repeat:0}]},{functionName:IB.MDETERM,functionType:q.Math,description:`sheets-formula.functionList.MDETERM.description`,abstract:`sheets-formula.functionList.MDETERM.abstract`,functionParameter:[{name:`sheets-formula.functionList.MDETERM.functionParameter.array.name`,detail:`sheets-formula.functionList.MDETERM.functionParameter.array.detail`,example:`A1:C3`,require:1,repeat:0}]},{functionName:IB.MINVERSE,functionType:q.Math,description:`sheets-formula.functionList.MINVERSE.description`,abstract:`sheets-formula.functionList.MINVERSE.abstract`,functionParameter:[{name:`sheets-formula.functionList.MINVERSE.functionParameter.array.name`,detail:`sheets-formula.functionList.MINVERSE.functionParameter.array.detail`,example:`A1:C3`,require:1,repeat:0}]},{functionName:IB.MMULT,functionType:q.Math,description:`sheets-formula.functionList.MMULT.description`,abstract:`sheets-formula.functionList.MMULT.abstract`,functionParameter:[{name:`sheets-formula.functionList.MMULT.functionParameter.array1.name`,detail:`sheets-formula.functionList.MMULT.functionParameter.array1.detail`,example:`A2:B3`,require:1,repeat:0},{name:`sheets-formula.functionList.MMULT.functionParameter.array2.name`,detail:`sheets-formula.functionList.MMULT.functionParameter.array2.detail`,example:`A5:B6`,require:1,repeat:0}]},{functionName:IB.MOD,functionType:q.Math,description:`sheets-formula.functionList.MOD.description`,abstract:`sheets-formula.functionList.MOD.abstract`,functionParameter:[{name:`sheets-formula.functionList.MOD.functionParameter.number.name`,detail:`sheets-formula.functionList.MOD.functionParameter.number.detail`,example:`3`,require:1,repeat:0},{name:`sheets-formula.functionList.MOD.functionParameter.divisor.name`,detail:`sheets-formula.functionList.MOD.functionParameter.divisor.detail`,example:`2`,require:1,repeat:0}]},{functionName:IB.MROUND,functionType:q.Math,description:`sheets-formula.functionList.MROUND.description`,abstract:`sheets-formula.functionList.MROUND.abstract`,functionParameter:[{name:`sheets-formula.functionList.MROUND.functionParameter.number.name`,detail:`sheets-formula.functionList.MROUND.functionParameter.number.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.MROUND.functionParameter.multiple.name`,detail:`sheets-formula.functionList.MROUND.functionParameter.multiple.detail`,example:`3`,require:1,repeat:0}]},{functionName:IB.MULTINOMIAL,functionType:q.Math,description:`sheets-formula.functionList.MULTINOMIAL.description`,abstract:`sheets-formula.functionList.MULTINOMIAL.abstract`,functionParameter:[{name:`sheets-formula.functionList.MULTINOMIAL.functionParameter.number1.name`,detail:`sheets-formula.functionList.MULTINOMIAL.functionParameter.number1.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.MULTINOMIAL.functionParameter.number2.name`,detail:`sheets-formula.functionList.MULTINOMIAL.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:IB.MUNIT,functionType:q.Math,description:`sheets-formula.functionList.MUNIT.description`,abstract:`sheets-formula.functionList.MUNIT.abstract`,functionParameter:[{name:`sheets-formula.functionList.MUNIT.functionParameter.dimension.name`,detail:`sheets-formula.functionList.MUNIT.functionParameter.dimension.detail`,example:`3`,require:1,repeat:0}]},{functionName:IB.ODD,functionType:q.Math,description:`sheets-formula.functionList.ODD.description`,abstract:`sheets-formula.functionList.ODD.abstract`,functionParameter:[{name:`sheets-formula.functionList.ODD.functionParameter.number.name`,detail:`sheets-formula.functionList.ODD.functionParameter.number.detail`,example:`1.5`,require:1,repeat:0}]},{functionName:IB.PI,functionType:q.Math,description:`sheets-formula.functionList.PI.description`,abstract:`sheets-formula.functionList.PI.abstract`,functionParameter:[]},{functionName:IB.POWER,functionType:q.Math,description:`sheets-formula.functionList.POWER.description`,abstract:`sheets-formula.functionList.POWER.abstract`,functionParameter:[{name:`sheets-formula.functionList.POWER.functionParameter.number.name`,detail:`sheets-formula.functionList.POWER.functionParameter.number.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.POWER.functionParameter.power.name`,detail:`sheets-formula.functionList.POWER.functionParameter.power.detail`,example:`2`,require:1,repeat:0}]},{functionName:IB.PRODUCT,functionType:q.Math,description:`sheets-formula.functionList.PRODUCT.description`,abstract:`sheets-formula.functionList.PRODUCT.abstract`,functionParameter:[{name:`sheets-formula.functionList.PRODUCT.functionParameter.number1.name`,detail:`sheets-formula.functionList.PRODUCT.functionParameter.number1.detail`,example:`A1`,require:1,repeat:0},{name:`sheets-formula.functionList.PRODUCT.functionParameter.number2.name`,detail:`sheets-formula.functionList.PRODUCT.functionParameter.number2.detail`,example:`A2`,require:0,repeat:1}]},{functionName:IB.QUOTIENT,functionType:q.Math,description:`sheets-formula.functionList.QUOTIENT.description`,abstract:`sheets-formula.functionList.QUOTIENT.abstract`,functionParameter:[{name:`sheets-formula.functionList.QUOTIENT.functionParameter.numerator.name`,detail:`sheets-formula.functionList.QUOTIENT.functionParameter.numerator.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.QUOTIENT.functionParameter.denominator.name`,detail:`sheets-formula.functionList.QUOTIENT.functionParameter.denominator.detail`,example:`2`,require:1,repeat:0}]},{functionName:IB.RADIANS,functionType:q.Math,description:`sheets-formula.functionList.RADIANS.description`,abstract:`sheets-formula.functionList.RADIANS.abstract`,functionParameter:[{name:`sheets-formula.functionList.RADIANS.functionParameter.angle.name`,detail:`sheets-formula.functionList.RADIANS.functionParameter.angle.detail`,example:`270`,require:1,repeat:0}]},{functionName:IB.RAND,functionType:q.Math,description:`sheets-formula.functionList.RAND.description`,abstract:`sheets-formula.functionList.RAND.abstract`,functionParameter:[]},{functionName:IB.RANDARRAY,functionType:q.Math,description:`sheets-formula.functionList.RANDARRAY.description`,abstract:`sheets-formula.functionList.RANDARRAY.abstract`,functionParameter:[{name:`sheets-formula.functionList.RANDARRAY.functionParameter.rows.name`,detail:`sheets-formula.functionList.RANDARRAY.functionParameter.rows.detail`,example:`5`,require:0,repeat:0},{name:`sheets-formula.functionList.RANDARRAY.functionParameter.columns.name`,detail:`sheets-formula.functionList.RANDARRAY.functionParameter.columns.detail`,example:`3`,require:0,repeat:0},{name:`sheets-formula.functionList.RANDARRAY.functionParameter.min.name`,detail:`sheets-formula.functionList.RANDARRAY.functionParameter.min.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.RANDARRAY.functionParameter.max.name`,detail:`sheets-formula.functionList.RANDARRAY.functionParameter.max.detail`,example:`100`,require:0,repeat:0},{name:`sheets-formula.functionList.RANDARRAY.functionParameter.wholeNumber.name`,detail:`sheets-formula.functionList.RANDARRAY.functionParameter.wholeNumber.detail`,example:`TRUE`,require:0,repeat:0}]},{functionName:IB.RANDBETWEEN,functionType:q.Math,description:`sheets-formula.functionList.RANDBETWEEN.description`,abstract:`sheets-formula.functionList.RANDBETWEEN.abstract`,functionParameter:[{name:`sheets-formula.functionList.RANDBETWEEN.functionParameter.bottom.name`,detail:`sheets-formula.functionList.RANDBETWEEN.functionParameter.bottom.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.RANDBETWEEN.functionParameter.top.name`,detail:`sheets-formula.functionList.RANDBETWEEN.functionParameter.top.detail`,example:`100`,require:1,repeat:0}]},{functionName:IB.ROMAN,functionType:q.Math,description:`sheets-formula.functionList.ROMAN.description`,abstract:`sheets-formula.functionList.ROMAN.abstract`,functionParameter:[{name:`sheets-formula.functionList.ROMAN.functionParameter.number.name`,detail:`sheets-formula.functionList.ROMAN.functionParameter.number.detail`,example:`499`,require:1,repeat:0},{name:`sheets-formula.functionList.ROMAN.functionParameter.form.name`,detail:`sheets-formula.functionList.ROMAN.functionParameter.form.detail`,example:`0`,require:0,repeat:0}]},{functionName:IB.ROUND,functionType:q.Math,description:`sheets-formula.functionList.ROUND.description`,abstract:`sheets-formula.functionList.ROUND.abstract`,functionParameter:[{name:`sheets-formula.functionList.ROUND.functionParameter.number.name`,detail:`sheets-formula.functionList.ROUND.functionParameter.number.detail`,example:`2.15`,require:1,repeat:0},{name:`sheets-formula.functionList.ROUND.functionParameter.numDigits.name`,detail:`sheets-formula.functionList.ROUND.functionParameter.numDigits.detail`,example:`1`,require:1,repeat:0}]},{functionName:IB.ROUNDBANK,functionType:q.Math,description:`sheets-formula.functionList.ROUNDBANK.description`,abstract:`sheets-formula.functionList.ROUNDBANK.abstract`,functionParameter:[{name:`sheets-formula.functionList.ROUNDBANK.functionParameter.number.name`,detail:`sheets-formula.functionList.ROUNDBANK.functionParameter.number.detail`,example:`2.345`,require:1,repeat:0},{name:`sheets-formula.functionList.ROUNDBANK.functionParameter.numDigits.name`,detail:`sheets-formula.functionList.ROUNDBANK.functionParameter.numDigits.detail`,example:`2`,require:1,repeat:0}]},{functionName:IB.ROUNDDOWN,functionType:q.Math,description:`sheets-formula.functionList.ROUNDDOWN.description`,abstract:`sheets-formula.functionList.ROUNDDOWN.abstract`,functionParameter:[{name:`sheets-formula.functionList.ROUNDDOWN.functionParameter.number.name`,detail:`sheets-formula.functionList.ROUNDDOWN.functionParameter.number.detail`,example:`3.2`,require:1,repeat:0},{name:`sheets-formula.functionList.ROUNDDOWN.functionParameter.numDigits.name`,detail:`sheets-formula.functionList.ROUNDDOWN.functionParameter.numDigits.detail`,example:`0`,require:1,repeat:0}]},{functionName:IB.ROUNDUP,functionType:q.Math,description:`sheets-formula.functionList.ROUNDUP.description`,abstract:`sheets-formula.functionList.ROUNDUP.abstract`,functionParameter:[{name:`sheets-formula.functionList.ROUNDUP.functionParameter.number.name`,detail:`sheets-formula.functionList.ROUNDUP.functionParameter.number.detail`,example:`3.2`,require:1,repeat:0},{name:`sheets-formula.functionList.ROUNDUP.functionParameter.numDigits.name`,detail:`sheets-formula.functionList.ROUNDUP.functionParameter.numDigits.detail`,example:`0`,require:1,repeat:0}]},{functionName:IB.SEC,functionType:q.Math,description:`sheets-formula.functionList.SEC.description`,abstract:`sheets-formula.functionList.SEC.abstract`,functionParameter:[{name:`sheets-formula.functionList.SEC.functionParameter.number.name`,detail:`sheets-formula.functionList.SEC.functionParameter.number.detail`,example:`30`,require:1,repeat:0}]},{functionName:IB.SECH,functionType:q.Math,description:`sheets-formula.functionList.SECH.description`,abstract:`sheets-formula.functionList.SECH.abstract`,functionParameter:[{name:`sheets-formula.functionList.SECH.functionParameter.number.name`,detail:`sheets-formula.functionList.SECH.functionParameter.number.detail`,example:`30`,require:1,repeat:0}]},{functionName:IB.SERIESSUM,functionType:q.Math,description:`sheets-formula.functionList.SERIESSUM.description`,abstract:`sheets-formula.functionList.SERIESSUM.abstract`,functionParameter:[{name:`sheets-formula.functionList.SERIESSUM.functionParameter.x.name`,detail:`sheets-formula.functionList.SERIESSUM.functionParameter.x.detail`,example:`0.785398163`,require:1,repeat:0},{name:`sheets-formula.functionList.SERIESSUM.functionParameter.n.name`,detail:`sheets-formula.functionList.SERIESSUM.functionParameter.n.detail`,example:`0`,require:1,repeat:0},{name:`sheets-formula.functionList.SERIESSUM.functionParameter.m.name`,detail:`sheets-formula.functionList.SERIESSUM.functionParameter.m.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.SERIESSUM.functionParameter.coefficients.name`,detail:`sheets-formula.functionList.SERIESSUM.functionParameter.coefficients.detail`,example:`A1:A4`,require:1,repeat:0}]},{functionName:IB.SEQUENCE,functionType:q.Math,description:`sheets-formula.functionList.SEQUENCE.description`,abstract:`sheets-formula.functionList.SEQUENCE.abstract`,functionParameter:[{name:`sheets-formula.functionList.SEQUENCE.functionParameter.rows.name`,detail:`sheets-formula.functionList.SEQUENCE.functionParameter.rows.detail`,example:`4`,require:1,repeat:0},{name:`sheets-formula.functionList.SEQUENCE.functionParameter.columns.name`,detail:`sheets-formula.functionList.SEQUENCE.functionParameter.columns.detail`,example:`5`,require:0,repeat:0},{name:`sheets-formula.functionList.SEQUENCE.functionParameter.start.name`,detail:`sheets-formula.functionList.SEQUENCE.functionParameter.start.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.SEQUENCE.functionParameter.step.name`,detail:`sheets-formula.functionList.SEQUENCE.functionParameter.step.detail`,example:`1`,require:0,repeat:0}]},{functionName:IB.SIGN,functionType:q.Math,description:`sheets-formula.functionList.SIGN.description`,abstract:`sheets-formula.functionList.SIGN.abstract`,functionParameter:[{name:`sheets-formula.functionList.SIGN.functionParameter.number.name`,detail:`sheets-formula.functionList.SIGN.functionParameter.number.detail`,example:`10`,require:1,repeat:0}]},{functionName:IB.SIN,functionType:q.Math,description:`sheets-formula.functionList.SIN.description`,abstract:`sheets-formula.functionList.SIN.abstract`,functionParameter:[{name:`sheets-formula.functionList.SIN.functionParameter.number.name`,detail:`sheets-formula.functionList.SIN.functionParameter.number.detail`,example:`30*PI()/180`,require:1,repeat:0}]},{functionName:IB.SINH,functionType:q.Math,description:`sheets-formula.functionList.SINH.description`,abstract:`sheets-formula.functionList.SINH.abstract`,functionParameter:[{name:`sheets-formula.functionList.SINH.functionParameter.number.name`,detail:`sheets-formula.functionList.SINH.functionParameter.number.detail`,example:`0.0342*1.03`,require:1,repeat:0}]},{functionName:IB.SQRT,functionType:q.Math,description:`sheets-formula.functionList.SQRT.description`,abstract:`sheets-formula.functionList.SQRT.abstract`,functionParameter:[{name:`sheets-formula.functionList.SQRT.functionParameter.number.name`,detail:`sheets-formula.functionList.SQRT.functionParameter.number.detail`,example:`16`,require:1,repeat:0}]},{functionName:IB.SQRTPI,functionType:q.Math,description:`sheets-formula.functionList.SQRTPI.description`,abstract:`sheets-formula.functionList.SQRTPI.abstract`,functionParameter:[{name:`sheets-formula.functionList.SQRTPI.functionParameter.number.name`,detail:`sheets-formula.functionList.SQRTPI.functionParameter.number.detail`,example:`1`,require:1,repeat:0}]},{functionName:IB.SUBTOTAL,functionType:q.Math,description:`sheets-formula.functionList.SUBTOTAL.description`,abstract:`sheets-formula.functionList.SUBTOTAL.abstract`,functionParameter:[{name:`sheets-formula.functionList.SUBTOTAL.functionParameter.functionNum.name`,detail:`sheets-formula.functionList.SUBTOTAL.functionParameter.functionNum.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.SUBTOTAL.functionParameter.ref1.name`,detail:`sheets-formula.functionList.SUBTOTAL.functionParameter.ref1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.SUBTOTAL.functionParameter.ref2.name`,detail:`sheets-formula.functionList.SUBTOTAL.functionParameter.ref2.detail`,example:`B1:B20`,require:0,repeat:1}]},{functionName:IB.SUM,aliasFunctionName:`sheets-formula.functionList.SUM.aliasFunctionName`,functionType:q.Math,description:`sheets-formula.functionList.SUM.description`,abstract:`sheets-formula.functionList.SUM.abstract`,functionParameter:[{name:`sheets-formula.functionList.SUM.functionParameter.number1.name`,detail:`sheets-formula.functionList.SUM.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.SUM.functionParameter.number2.name`,detail:`sheets-formula.functionList.SUM.functionParameter.number2.detail`,example:`B2:B10`,require:0,repeat:1}]},{functionName:IB.SUMIF,aliasFunctionName:`sheets-formula.functionList.SUMIF.aliasFunctionName`,functionType:q.Math,description:`sheets-formula.functionList.SUMIF.description`,abstract:`sheets-formula.functionList.SUMIF.abstract`,functionParameter:[{name:`sheets-formula.functionList.SUMIF.functionParameter.range.name`,detail:`sheets-formula.functionList.SUMIF.functionParameter.range.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.SUMIF.functionParameter.criteria.name`,detail:`sheets-formula.functionList.SUMIF.functionParameter.criteria.detail`,example:`">5"`,require:1,repeat:0},{name:`sheets-formula.functionList.SUMIF.functionParameter.sumRange.name`,detail:`sheets-formula.functionList.SUMIF.functionParameter.sumRange.detail`,example:`B1:B20`,require:0,repeat:0}]},{functionName:IB.SUMIFS,functionType:q.Math,description:`sheets-formula.functionList.SUMIFS.description`,abstract:`sheets-formula.functionList.SUMIFS.abstract`,functionParameter:[{name:`sheets-formula.functionList.SUMIFS.functionParameter.sumRange.name`,detail:`sheets-formula.functionList.SUMIFS.functionParameter.sumRange.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.SUMIFS.functionParameter.criteriaRange1.name`,detail:`sheets-formula.functionList.SUMIFS.functionParameter.criteriaRange1.detail`,example:`B1:B20`,require:1,repeat:0},{name:`sheets-formula.functionList.SUMIFS.functionParameter.criteria1.name`,detail:`sheets-formula.functionList.SUMIFS.functionParameter.criteria1.detail`,example:`">10"`,require:1,repeat:0},{name:`sheets-formula.functionList.SUMIFS.functionParameter.criteriaRange2.name`,detail:`sheets-formula.functionList.SUMIFS.functionParameter.criteriaRange2.detail`,example:`C1:C20`,require:0,repeat:1},{name:`sheets-formula.functionList.SUMIFS.functionParameter.criteria2.name`,detail:`sheets-formula.functionList.SUMIFS.functionParameter.criteria2.detail`,example:`"<20"`,require:0,repeat:1}]},{functionName:IB.SUMPRODUCT,functionType:q.Math,description:`sheets-formula.functionList.SUMPRODUCT.description`,abstract:`sheets-formula.functionList.SUMPRODUCT.abstract`,functionParameter:[{name:`sheets-formula.functionList.SUMPRODUCT.functionParameter.array1.name`,detail:`sheets-formula.functionList.SUMPRODUCT.functionParameter.array1.detail`,example:`C2:C5`,require:1,repeat:0},{name:`sheets-formula.functionList.SUMPRODUCT.functionParameter.array2.name`,detail:`sheets-formula.functionList.SUMPRODUCT.functionParameter.array2.detail`,example:`D2:D5`,require:0,repeat:1}]},{functionName:IB.SUMSQ,functionType:q.Math,description:`sheets-formula.functionList.SUMSQ.description`,abstract:`sheets-formula.functionList.SUMSQ.abstract`,functionParameter:[{name:`sheets-formula.functionList.SUMSQ.functionParameter.number1.name`,detail:`sheets-formula.functionList.SUMSQ.functionParameter.number1.detail`,example:`3`,require:1,repeat:0},{name:`sheets-formula.functionList.SUMSQ.functionParameter.number2.name`,detail:`sheets-formula.functionList.SUMSQ.functionParameter.number2.detail`,example:`4`,require:0,repeat:1}]},{functionName:IB.SUMX2MY2,functionType:q.Math,description:`sheets-formula.functionList.SUMX2MY2.description`,abstract:`sheets-formula.functionList.SUMX2MY2.abstract`,functionParameter:[{name:`sheets-formula.functionList.SUMX2MY2.functionParameter.arrayX.name`,detail:`sheets-formula.functionList.SUMX2MY2.functionParameter.arrayX.detail`,example:`A2:A8`,require:1,repeat:0},{name:`sheets-formula.functionList.SUMX2MY2.functionParameter.arrayY.name`,detail:`sheets-formula.functionList.SUMX2MY2.functionParameter.arrayY.detail`,example:`B2:B8`,require:1,repeat:0}]},{functionName:IB.SUMX2PY2,functionType:q.Math,description:`sheets-formula.functionList.SUMX2PY2.description`,abstract:`sheets-formula.functionList.SUMX2PY2.abstract`,functionParameter:[{name:`sheets-formula.functionList.SUMX2PY2.functionParameter.arrayX.name`,detail:`sheets-formula.functionList.SUMX2PY2.functionParameter.arrayX.detail`,example:`A2:A8`,require:1,repeat:0},{name:`sheets-formula.functionList.SUMX2PY2.functionParameter.arrayY.name`,detail:`sheets-formula.functionList.SUMX2PY2.functionParameter.arrayY.detail`,example:`B2:B8`,require:1,repeat:0}]},{functionName:IB.SUMXMY2,functionType:q.Math,description:`sheets-formula.functionList.SUMXMY2.description`,abstract:`sheets-formula.functionList.SUMXMY2.abstract`,functionParameter:[{name:`sheets-formula.functionList.SUMXMY2.functionParameter.arrayX.name`,detail:`sheets-formula.functionList.SUMXMY2.functionParameter.arrayX.detail`,example:`A2:A8`,require:1,repeat:0},{name:`sheets-formula.functionList.SUMXMY2.functionParameter.arrayY.name`,detail:`sheets-formula.functionList.SUMXMY2.functionParameter.arrayY.detail`,example:`B2:B8`,require:1,repeat:0}]},{functionName:IB.TAN,functionType:q.Math,description:`sheets-formula.functionList.TAN.description`,abstract:`sheets-formula.functionList.TAN.abstract`,functionParameter:[{name:`sheets-formula.functionList.TAN.functionParameter.number.name`,detail:`sheets-formula.functionList.TAN.functionParameter.number.detail`,example:`1`,require:1,repeat:0}]},{functionName:IB.TANH,functionType:q.Math,description:`sheets-formula.functionList.TANH.description`,abstract:`sheets-formula.functionList.TANH.abstract`,functionParameter:[{name:`sheets-formula.functionList.TANH.functionParameter.number.name`,detail:`sheets-formula.functionList.TANH.functionParameter.number.detail`,example:`1`,require:1,repeat:0}]},{functionName:IB.TRUNC,functionType:q.Math,description:`sheets-formula.functionList.TRUNC.description`,abstract:`sheets-formula.functionList.TRUNC.abstract`,functionParameter:[{name:`sheets-formula.functionList.TRUNC.functionParameter.number.name`,detail:`sheets-formula.functionList.TRUNC.functionParameter.number.detail`,example:`0.45`,require:1,repeat:0},{name:`sheets-formula.functionList.TRUNC.functionParameter.numDigits.name`,detail:`sheets-formula.functionList.TRUNC.functionParameter.numDigits.detail`,example:`1`,require:0,repeat:0}]}],Amt=[{functionName:LB.AVEDEV,functionType:q.Statistical,description:`sheets-formula.functionList.AVEDEV.description`,abstract:`sheets-formula.functionList.AVEDEV.abstract`,functionParameter:[{name:`sheets-formula.functionList.AVEDEV.functionParameter.number1.name`,detail:`sheets-formula.functionList.AVEDEV.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.AVEDEV.functionParameter.number2.name`,detail:`sheets-formula.functionList.AVEDEV.functionParameter.number2.detail`,example:`B1:B20`,require:0,repeat:1}]},{functionName:LB.AVERAGE,aliasFunctionName:`sheets-formula.functionList.AVERAGE.aliasFunctionName`,functionType:q.Statistical,description:`sheets-formula.functionList.AVERAGE.description`,abstract:`sheets-formula.functionList.AVERAGE.abstract`,functionParameter:[{name:`sheets-formula.functionList.AVERAGE.functionParameter.number1.name`,detail:`sheets-formula.functionList.AVERAGE.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.AVERAGE.functionParameter.number2.name`,detail:`sheets-formula.functionList.AVERAGE.functionParameter.number2.detail`,example:`B1:B20`,require:0,repeat:1}]},{functionName:LB.AVERAGE_WEIGHTED,aliasFunctionName:`sheets-formula.functionList.AVERAGE_WEIGHTED.aliasFunctionName`,functionType:q.Statistical,description:`sheets-formula.functionList.AVERAGE_WEIGHTED.description`,abstract:`sheets-formula.functionList.AVERAGE_WEIGHTED.abstract`,functionParameter:[{name:`sheets-formula.functionList.AVERAGE_WEIGHTED.functionParameter.values.name`,detail:`sheets-formula.functionList.AVERAGE_WEIGHTED.functionParameter.values.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.AVERAGE_WEIGHTED.functionParameter.weights.name`,detail:`sheets-formula.functionList.AVERAGE_WEIGHTED.functionParameter.weights.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalValues.name`,detail:`sheets-formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalValues.detail`,example:`20`,require:0,repeat:1},{name:`sheets-formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalWeights.name`,detail:`sheets-formula.functionList.AVERAGE_WEIGHTED.functionParameter.additionalWeights.detail`,example:`3`,require:0,repeat:1}]},{functionName:LB.AVERAGEA,functionType:q.Statistical,description:`sheets-formula.functionList.AVERAGEA.description`,abstract:`sheets-formula.functionList.AVERAGEA.abstract`,functionParameter:[{name:`sheets-formula.functionList.AVERAGEA.functionParameter.value1.name`,detail:`sheets-formula.functionList.AVERAGEA.functionParameter.value1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.AVERAGEA.functionParameter.value2.name`,detail:`sheets-formula.functionList.AVERAGEA.functionParameter.value2.detail`,example:`B1:B20`,require:0,repeat:1}]},{functionName:LB.AVERAGEIF,functionType:q.Statistical,description:`sheets-formula.functionList.AVERAGEIF.description`,abstract:`sheets-formula.functionList.AVERAGEIF.abstract`,functionParameter:[{name:`sheets-formula.functionList.AVERAGEIF.functionParameter.range.name`,detail:`sheets-formula.functionList.AVERAGEIF.functionParameter.range.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.AVERAGEIF.functionParameter.criteria.name`,detail:`sheets-formula.functionList.AVERAGEIF.functionParameter.criteria.detail`,example:`">5"`,require:1,repeat:0},{name:`sheets-formula.functionList.AVERAGEIF.functionParameter.averageRange.name`,detail:`sheets-formula.functionList.AVERAGEIF.functionParameter.averageRange.detail`,example:`B1:B20`,require:0,repeat:0}]},{functionName:LB.AVERAGEIFS,functionType:q.Statistical,description:`sheets-formula.functionList.AVERAGEIFS.description`,abstract:`sheets-formula.functionList.AVERAGEIFS.abstract`,functionParameter:[{name:`sheets-formula.functionList.AVERAGEIFS.functionParameter.averageRange.name`,detail:`sheets-formula.functionList.AVERAGEIFS.functionParameter.averageRange.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.name`,detail:`sheets-formula.functionList.AVERAGEIFS.functionParameter.criteriaRange1.detail`,example:`B1:B20`,require:1,repeat:0},{name:`sheets-formula.functionList.AVERAGEIFS.functionParameter.criteria1.name`,detail:`sheets-formula.functionList.AVERAGEIFS.functionParameter.criteria1.detail`,example:`">10"`,require:1,repeat:0},{name:`sheets-formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.name`,detail:`sheets-formula.functionList.AVERAGEIFS.functionParameter.criteriaRange2.detail`,example:`C1:C20`,require:0,repeat:1},{name:`sheets-formula.functionList.AVERAGEIFS.functionParameter.criteria2.name`,detail:`sheets-formula.functionList.AVERAGEIFS.functionParameter.criteria2.detail`,example:`"<20"`,require:0,repeat:1}]},{functionName:LB.BETA_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.BETA_DIST.description`,abstract:`sheets-formula.functionList.BETA_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.BETA_DIST.functionParameter.x.name`,detail:`sheets-formula.functionList.BETA_DIST.functionParameter.x.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.BETA_DIST.functionParameter.alpha.name`,detail:`sheets-formula.functionList.BETA_DIST.functionParameter.alpha.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.BETA_DIST.functionParameter.beta.name`,detail:`sheets-formula.functionList.BETA_DIST.functionParameter.beta.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.BETA_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.BETA_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0},{name:`sheets-formula.functionList.BETA_DIST.functionParameter.A.name`,detail:`sheets-formula.functionList.BETA_DIST.functionParameter.A.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.BETA_DIST.functionParameter.B.name`,detail:`sheets-formula.functionList.BETA_DIST.functionParameter.B.detail`,example:`3`,require:0,repeat:0}]},{functionName:LB.BETA_INV,functionType:q.Statistical,description:`sheets-formula.functionList.BETA_INV.description`,abstract:`sheets-formula.functionList.BETA_INV.abstract`,functionParameter:[{name:`sheets-formula.functionList.BETA_INV.functionParameter.probability.name`,detail:`sheets-formula.functionList.BETA_INV.functionParameter.probability.detail`,example:`0.685470581`,require:1,repeat:0},{name:`sheets-formula.functionList.BETA_INV.functionParameter.alpha.name`,detail:`sheets-formula.functionList.BETA_INV.functionParameter.alpha.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.BETA_INV.functionParameter.beta.name`,detail:`sheets-formula.functionList.BETA_INV.functionParameter.beta.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.BETA_INV.functionParameter.A.name`,detail:`sheets-formula.functionList.BETA_INV.functionParameter.A.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.BETA_INV.functionParameter.B.name`,detail:`sheets-formula.functionList.BETA_INV.functionParameter.B.detail`,example:`3`,require:0,repeat:0}]},{functionName:LB.BINOM_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.BINOM_DIST.description`,abstract:`sheets-formula.functionList.BINOM_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.BINOM_DIST.functionParameter.numberS.name`,detail:`sheets-formula.functionList.BINOM_DIST.functionParameter.numberS.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.BINOM_DIST.functionParameter.trials.name`,detail:`sheets-formula.functionList.BINOM_DIST.functionParameter.trials.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.BINOM_DIST.functionParameter.probabilityS.name`,detail:`sheets-formula.functionList.BINOM_DIST.functionParameter.probabilityS.detail`,example:`0.5`,require:1,repeat:0},{name:`sheets-formula.functionList.BINOM_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.BINOM_DIST.functionParameter.cumulative.detail`,example:`false`,require:1,repeat:0}]},{functionName:LB.BINOM_DIST_RANGE,functionType:q.Statistical,description:`sheets-formula.functionList.BINOM_DIST_RANGE.description`,abstract:`sheets-formula.functionList.BINOM_DIST_RANGE.abstract`,functionParameter:[{name:`sheets-formula.functionList.BINOM_DIST_RANGE.functionParameter.trials.name`,detail:`sheets-formula.functionList.BINOM_DIST_RANGE.functionParameter.trials.detail`,example:`60`,require:1,repeat:0},{name:`sheets-formula.functionList.BINOM_DIST_RANGE.functionParameter.probabilityS.name`,detail:`sheets-formula.functionList.BINOM_DIST_RANGE.functionParameter.probabilityS.detail`,example:`0.75`,require:1,repeat:0},{name:`sheets-formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS.name`,detail:`sheets-formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS.detail`,example:`45`,require:1,repeat:0},{name:`sheets-formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS2.name`,detail:`sheets-formula.functionList.BINOM_DIST_RANGE.functionParameter.numberS2.detail`,example:`50`,require:0,repeat:0}]},{functionName:LB.BINOM_INV,functionType:q.Statistical,description:`sheets-formula.functionList.BINOM_INV.description`,abstract:`sheets-formula.functionList.BINOM_INV.abstract`,functionParameter:[{name:`sheets-formula.functionList.BINOM_INV.functionParameter.trials.name`,detail:`sheets-formula.functionList.BINOM_INV.functionParameter.trials.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.BINOM_INV.functionParameter.probabilityS.name`,detail:`sheets-formula.functionList.BINOM_INV.functionParameter.probabilityS.detail`,example:`0.5`,require:1,repeat:0},{name:`sheets-formula.functionList.BINOM_INV.functionParameter.alpha.name`,detail:`sheets-formula.functionList.BINOM_INV.functionParameter.alpha.detail`,example:`0.75`,require:1,repeat:0}]},{functionName:LB.CHISQ_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.CHISQ_DIST.description`,abstract:`sheets-formula.functionList.CHISQ_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHISQ_DIST.functionParameter.x.name`,detail:`sheets-formula.functionList.CHISQ_DIST.functionParameter.x.detail`,example:`0.5`,require:1,repeat:0},{name:`sheets-formula.functionList.CHISQ_DIST.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.CHISQ_DIST.functionParameter.degFreedom.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.CHISQ_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.CHISQ_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.CHISQ_DIST_RT,functionType:q.Statistical,description:`sheets-formula.functionList.CHISQ_DIST_RT.description`,abstract:`sheets-formula.functionList.CHISQ_DIST_RT.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHISQ_DIST_RT.functionParameter.x.name`,detail:`sheets-formula.functionList.CHISQ_DIST_RT.functionParameter.x.detail`,example:`0.5`,require:1,repeat:0},{name:`sheets-formula.functionList.CHISQ_DIST_RT.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.CHISQ_DIST_RT.functionParameter.degFreedom.detail`,example:`1`,require:1,repeat:0}]},{functionName:LB.CHISQ_INV,functionType:q.Statistical,description:`sheets-formula.functionList.CHISQ_INV.description`,abstract:`sheets-formula.functionList.CHISQ_INV.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHISQ_INV.functionParameter.probability.name`,detail:`sheets-formula.functionList.CHISQ_INV.functionParameter.probability.detail`,example:`0.93`,require:1,repeat:0},{name:`sheets-formula.functionList.CHISQ_INV.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.CHISQ_INV.functionParameter.degFreedom.detail`,example:`1`,require:1,repeat:0}]},{functionName:LB.CHISQ_INV_RT,functionType:q.Statistical,description:`sheets-formula.functionList.CHISQ_INV_RT.description`,abstract:`sheets-formula.functionList.CHISQ_INV_RT.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHISQ_INV_RT.functionParameter.probability.name`,detail:`sheets-formula.functionList.CHISQ_INV_RT.functionParameter.probability.detail`,example:`0.93`,require:1,repeat:0},{name:`sheets-formula.functionList.CHISQ_INV_RT.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.CHISQ_INV_RT.functionParameter.degFreedom.detail`,example:`1`,require:1,repeat:0}]},{functionName:LB.CHISQ_TEST,functionType:q.Statistical,description:`sheets-formula.functionList.CHISQ_TEST.description`,abstract:`sheets-formula.functionList.CHISQ_TEST.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHISQ_TEST.functionParameter.actualRange.name`,detail:`sheets-formula.functionList.CHISQ_TEST.functionParameter.actualRange.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.CHISQ_TEST.functionParameter.expectedRange.name`,detail:`sheets-formula.functionList.CHISQ_TEST.functionParameter.expectedRange.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.CONFIDENCE_NORM,functionType:q.Statistical,description:`sheets-formula.functionList.CONFIDENCE_NORM.description`,abstract:`sheets-formula.functionList.CONFIDENCE_NORM.abstract`,functionParameter:[{name:`sheets-formula.functionList.CONFIDENCE_NORM.functionParameter.alpha.name`,detail:`sheets-formula.functionList.CONFIDENCE_NORM.functionParameter.alpha.detail`,example:`0.05`,require:1,repeat:0},{name:`sheets-formula.functionList.CONFIDENCE_NORM.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.CONFIDENCE_NORM.functionParameter.standardDev.detail`,example:`2.5`,require:1,repeat:0},{name:`sheets-formula.functionList.CONFIDENCE_NORM.functionParameter.size.name`,detail:`sheets-formula.functionList.CONFIDENCE_NORM.functionParameter.size.detail`,example:`50`,require:1,repeat:0}]},{functionName:LB.CONFIDENCE_T,functionType:q.Statistical,description:`sheets-formula.functionList.CONFIDENCE_T.description`,abstract:`sheets-formula.functionList.CONFIDENCE_T.abstract`,functionParameter:[{name:`sheets-formula.functionList.CONFIDENCE_T.functionParameter.alpha.name`,detail:`sheets-formula.functionList.CONFIDENCE_T.functionParameter.alpha.detail`,example:`0.05`,require:1,repeat:0},{name:`sheets-formula.functionList.CONFIDENCE_T.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.CONFIDENCE_T.functionParameter.standardDev.detail`,example:`2.5`,require:1,repeat:0},{name:`sheets-formula.functionList.CONFIDENCE_T.functionParameter.size.name`,detail:`sheets-formula.functionList.CONFIDENCE_T.functionParameter.size.detail`,example:`50`,require:1,repeat:0}]},{functionName:LB.CORREL,functionType:q.Statistical,description:`sheets-formula.functionList.CORREL.description`,abstract:`sheets-formula.functionList.CORREL.abstract`,functionParameter:[{name:`sheets-formula.functionList.CORREL.functionParameter.array1.name`,detail:`sheets-formula.functionList.CORREL.functionParameter.array1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.CORREL.functionParameter.array2.name`,detail:`sheets-formula.functionList.CORREL.functionParameter.array2.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.COUNT,aliasFunctionName:`sheets-formula.functionList.COUNT.aliasFunctionName`,functionType:q.Statistical,description:`sheets-formula.functionList.COUNT.description`,abstract:`sheets-formula.functionList.COUNT.abstract`,functionParameter:[{name:`sheets-formula.functionList.COUNT.functionParameter.value1.name`,detail:`sheets-formula.functionList.COUNT.functionParameter.value1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.COUNT.functionParameter.value2.name`,detail:`sheets-formula.functionList.COUNT.functionParameter.value2.detail`,example:`B2:B10`,require:0,repeat:1}]},{functionName:LB.COUNTA,aliasFunctionName:`sheets-formula.functionList.COUNTA.aliasFunctionName`,functionType:q.Statistical,description:`sheets-formula.functionList.COUNTA.description`,abstract:`sheets-formula.functionList.COUNTA.abstract`,functionParameter:[{name:`sheets-formula.functionList.COUNTA.functionParameter.number1.name`,detail:`sheets-formula.functionList.COUNTA.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.COUNTA.functionParameter.number2.name`,detail:`sheets-formula.functionList.COUNTA.functionParameter.number2.detail`,example:`B2:B10`,require:0,repeat:1}]},{functionName:LB.COUNTBLANK,functionType:q.Statistical,description:`sheets-formula.functionList.COUNTBLANK.description`,abstract:`sheets-formula.functionList.COUNTBLANK.abstract`,functionParameter:[{name:`sheets-formula.functionList.COUNTBLANK.functionParameter.range.name`,detail:`sheets-formula.functionList.COUNTBLANK.functionParameter.range.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:LB.COUNTIF,functionType:q.Statistical,description:`sheets-formula.functionList.COUNTIF.description`,abstract:`sheets-formula.functionList.COUNTIF.abstract`,functionParameter:[{name:`sheets-formula.functionList.COUNTIF.functionParameter.range.name`,detail:`sheets-formula.functionList.COUNTIF.functionParameter.range.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.COUNTIF.functionParameter.criteria.name`,detail:`sheets-formula.functionList.COUNTIF.functionParameter.criteria.detail`,example:`">5"`,require:1,repeat:0}]},{functionName:LB.COUNTIFS,functionType:q.Statistical,description:`sheets-formula.functionList.COUNTIFS.description`,abstract:`sheets-formula.functionList.COUNTIFS.abstract`,functionParameter:[{name:`sheets-formula.functionList.COUNTIFS.functionParameter.criteriaRange1.name`,detail:`sheets-formula.functionList.COUNTIFS.functionParameter.criteriaRange1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.COUNTIFS.functionParameter.criteria1.name`,detail:`sheets-formula.functionList.COUNTIFS.functionParameter.criteria1.detail`,example:`">10"`,require:1,repeat:0},{name:`sheets-formula.functionList.COUNTIFS.functionParameter.criteriaRange2.name`,detail:`sheets-formula.functionList.COUNTIFS.functionParameter.criteriaRange2.detail`,example:`B1:B20`,require:0,repeat:1},{name:`sheets-formula.functionList.COUNTIFS.functionParameter.criteria2.name`,detail:`sheets-formula.functionList.COUNTIFS.functionParameter.criteria2.detail`,example:`"<20"`,require:0,repeat:1}]},{functionName:LB.COVARIANCE_P,functionType:q.Statistical,description:`sheets-formula.functionList.COVARIANCE_P.description`,abstract:`sheets-formula.functionList.COVARIANCE_P.abstract`,functionParameter:[{name:`sheets-formula.functionList.COVARIANCE_P.functionParameter.array1.name`,detail:`sheets-formula.functionList.COVARIANCE_P.functionParameter.array1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.COVARIANCE_P.functionParameter.array2.name`,detail:`sheets-formula.functionList.COVARIANCE_P.functionParameter.array2.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.COVARIANCE_S,functionType:q.Statistical,description:`sheets-formula.functionList.COVARIANCE_S.description`,abstract:`sheets-formula.functionList.COVARIANCE_S.abstract`,functionParameter:[{name:`sheets-formula.functionList.COVARIANCE_S.functionParameter.array1.name`,detail:`sheets-formula.functionList.COVARIANCE_S.functionParameter.array1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.COVARIANCE_S.functionParameter.array2.name`,detail:`sheets-formula.functionList.COVARIANCE_S.functionParameter.array2.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.DEVSQ,functionType:q.Statistical,description:`sheets-formula.functionList.DEVSQ.description`,abstract:`sheets-formula.functionList.DEVSQ.abstract`,functionParameter:[{name:`sheets-formula.functionList.DEVSQ.functionParameter.number1.name`,detail:`sheets-formula.functionList.DEVSQ.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.DEVSQ.functionParameter.number2.name`,detail:`sheets-formula.functionList.DEVSQ.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.EXPON_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.EXPON_DIST.description`,abstract:`sheets-formula.functionList.EXPON_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.EXPON_DIST.functionParameter.x.name`,detail:`sheets-formula.functionList.EXPON_DIST.functionParameter.x.detail`,example:`0.2`,require:1,repeat:0},{name:`sheets-formula.functionList.EXPON_DIST.functionParameter.lambda.name`,detail:`sheets-formula.functionList.EXPON_DIST.functionParameter.lambda.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.EXPON_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.EXPON_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.F_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.F_DIST.description`,abstract:`sheets-formula.functionList.F_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.F_DIST.functionParameter.x.name`,detail:`sheets-formula.functionList.F_DIST.functionParameter.x.detail`,example:`15.2069`,require:1,repeat:0},{name:`sheets-formula.functionList.F_DIST.functionParameter.degFreedom1.name`,detail:`sheets-formula.functionList.F_DIST.functionParameter.degFreedom1.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.F_DIST.functionParameter.degFreedom2.name`,detail:`sheets-formula.functionList.F_DIST.functionParameter.degFreedom2.detail`,example:`4`,require:1,repeat:0},{name:`sheets-formula.functionList.F_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.F_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.F_DIST_RT,functionType:q.Statistical,description:`sheets-formula.functionList.F_DIST_RT.description`,abstract:`sheets-formula.functionList.F_DIST_RT.abstract`,functionParameter:[{name:`sheets-formula.functionList.F_DIST_RT.functionParameter.x.name`,detail:`sheets-formula.functionList.F_DIST_RT.functionParameter.x.detail`,example:`15.2069`,require:1,repeat:0},{name:`sheets-formula.functionList.F_DIST_RT.functionParameter.degFreedom1.name`,detail:`sheets-formula.functionList.F_DIST_RT.functionParameter.degFreedom1.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.F_DIST_RT.functionParameter.degFreedom2.name`,detail:`sheets-formula.functionList.F_DIST_RT.functionParameter.degFreedom2.detail`,example:`4`,require:1,repeat:0}]},{functionName:LB.F_INV,functionType:q.Statistical,description:`sheets-formula.functionList.F_INV.description`,abstract:`sheets-formula.functionList.F_INV.abstract`,functionParameter:[{name:`sheets-formula.functionList.F_INV.functionParameter.probability.name`,detail:`sheets-formula.functionList.F_INV.functionParameter.probability.detail`,example:`0.01`,require:1,repeat:0},{name:`sheets-formula.functionList.F_INV.functionParameter.degFreedom1.name`,detail:`sheets-formula.functionList.F_INV.functionParameter.degFreedom1.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.F_INV.functionParameter.degFreedom2.name`,detail:`sheets-formula.functionList.F_INV.functionParameter.degFreedom2.detail`,example:`4`,require:1,repeat:0}]},{functionName:LB.F_INV_RT,functionType:q.Statistical,description:`sheets-formula.functionList.F_INV_RT.description`,abstract:`sheets-formula.functionList.F_INV_RT.abstract`,functionParameter:[{name:`sheets-formula.functionList.F_INV_RT.functionParameter.probability.name`,detail:`sheets-formula.functionList.F_INV_RT.functionParameter.probability.detail`,example:`0.01`,require:1,repeat:0},{name:`sheets-formula.functionList.F_INV_RT.functionParameter.degFreedom1.name`,detail:`sheets-formula.functionList.F_INV_RT.functionParameter.degFreedom1.detail`,example:`6`,require:1,repeat:0},{name:`sheets-formula.functionList.F_INV_RT.functionParameter.degFreedom2.name`,detail:`sheets-formula.functionList.F_INV_RT.functionParameter.degFreedom2.detail`,example:`4`,require:1,repeat:0}]},{functionName:LB.F_TEST,functionType:q.Statistical,description:`sheets-formula.functionList.F_TEST.description`,abstract:`sheets-formula.functionList.F_TEST.abstract`,functionParameter:[{name:`sheets-formula.functionList.F_TEST.functionParameter.array1.name`,detail:`sheets-formula.functionList.F_TEST.functionParameter.array1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.F_TEST.functionParameter.array2.name`,detail:`sheets-formula.functionList.F_TEST.functionParameter.array2.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.FISHER,functionType:q.Statistical,description:`sheets-formula.functionList.FISHER.description`,abstract:`sheets-formula.functionList.FISHER.abstract`,functionParameter:[{name:`sheets-formula.functionList.FISHER.functionParameter.x.name`,detail:`sheets-formula.functionList.FISHER.functionParameter.x.detail`,example:`0.75`,require:1,repeat:0}]},{functionName:LB.FISHERINV,functionType:q.Statistical,description:`sheets-formula.functionList.FISHERINV.description`,abstract:`sheets-formula.functionList.FISHERINV.abstract`,functionParameter:[{name:`sheets-formula.functionList.FISHERINV.functionParameter.y.name`,detail:`sheets-formula.functionList.FISHERINV.functionParameter.y.detail`,example:`0.75`,require:1,repeat:0}]},{functionName:LB.FORECAST,functionType:q.Statistical,description:`sheets-formula.functionList.FORECAST.description`,abstract:`sheets-formula.functionList.FORECAST.abstract`,functionParameter:[{name:`sheets-formula.functionList.FORECAST.functionParameter.x.name`,detail:`sheets-formula.functionList.FORECAST.functionParameter.x.detail`,example:`30`,require:1,repeat:0},{name:`sheets-formula.functionList.FORECAST.functionParameter.knownYs.name`,detail:`sheets-formula.functionList.FORECAST.functionParameter.knownYs.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.FORECAST.functionParameter.knownXs.name`,detail:`sheets-formula.functionList.FORECAST.functionParameter.knownXs.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.FORECAST_ETS,functionType:q.Statistical,description:`sheets-formula.functionList.FORECAST_ETS.description`,abstract:`sheets-formula.functionList.FORECAST_ETS.abstract`,functionParameter:[{name:`sheets-formula.functionList.FORECAST_ETS.functionParameter.number1.name`,detail:`sheets-formula.functionList.FORECAST_ETS.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.FORECAST_ETS.functionParameter.number2.name`,detail:`sheets-formula.functionList.FORECAST_ETS.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:LB.FORECAST_ETS_CONFINT,functionType:q.Statistical,description:`sheets-formula.functionList.FORECAST_ETS_CONFINT.description`,abstract:`sheets-formula.functionList.FORECAST_ETS_CONFINT.abstract`,functionParameter:[{name:`sheets-formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number1.name`,detail:`sheets-formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number2.name`,detail:`sheets-formula.functionList.FORECAST_ETS_CONFINT.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:LB.FORECAST_ETS_SEASONALITY,functionType:q.Statistical,description:`sheets-formula.functionList.FORECAST_ETS_SEASONALITY.description`,abstract:`sheets-formula.functionList.FORECAST_ETS_SEASONALITY.abstract`,functionParameter:[{name:`sheets-formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number1.name`,detail:`sheets-formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number2.name`,detail:`sheets-formula.functionList.FORECAST_ETS_SEASONALITY.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:LB.FORECAST_ETS_STAT,functionType:q.Statistical,description:`sheets-formula.functionList.FORECAST_ETS_STAT.description`,abstract:`sheets-formula.functionList.FORECAST_ETS_STAT.abstract`,functionParameter:[{name:`sheets-formula.functionList.FORECAST_ETS_STAT.functionParameter.number1.name`,detail:`sheets-formula.functionList.FORECAST_ETS_STAT.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.FORECAST_ETS_STAT.functionParameter.number2.name`,detail:`sheets-formula.functionList.FORECAST_ETS_STAT.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:LB.FORECAST_LINEAR,functionType:q.Statistical,description:`sheets-formula.functionList.FORECAST_LINEAR.description`,abstract:`sheets-formula.functionList.FORECAST_LINEAR.abstract`,functionParameter:[{name:`sheets-formula.functionList.FORECAST_LINEAR.functionParameter.x.name`,detail:`sheets-formula.functionList.FORECAST_LINEAR.functionParameter.x.detail`,example:`30`,require:1,repeat:0},{name:`sheets-formula.functionList.FORECAST_LINEAR.functionParameter.knownYs.name`,detail:`sheets-formula.functionList.FORECAST_LINEAR.functionParameter.knownYs.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.FORECAST_LINEAR.functionParameter.knownXs.name`,detail:`sheets-formula.functionList.FORECAST_LINEAR.functionParameter.knownXs.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.FREQUENCY,functionType:q.Statistical,description:`sheets-formula.functionList.FREQUENCY.description`,abstract:`sheets-formula.functionList.FREQUENCY.abstract`,functionParameter:[{name:`sheets-formula.functionList.FREQUENCY.functionParameter.dataArray.name`,detail:`sheets-formula.functionList.FREQUENCY.functionParameter.dataArray.detail`,example:`A2:A10`,require:1,repeat:0},{name:`sheets-formula.functionList.FREQUENCY.functionParameter.binsArray.name`,detail:`sheets-formula.functionList.FREQUENCY.functionParameter.binsArray.detail`,example:`B2:B4`,require:1,repeat:0}]},{functionName:LB.GAMMA,functionType:q.Statistical,description:`sheets-formula.functionList.GAMMA.description`,abstract:`sheets-formula.functionList.GAMMA.abstract`,functionParameter:[{name:`sheets-formula.functionList.GAMMA.functionParameter.number.name`,detail:`sheets-formula.functionList.GAMMA.functionParameter.number.detail`,example:`2.5`,require:1,repeat:0}]},{functionName:LB.GAMMA_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.GAMMA_DIST.description`,abstract:`sheets-formula.functionList.GAMMA_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.GAMMA_DIST.functionParameter.x.name`,detail:`sheets-formula.functionList.GAMMA_DIST.functionParameter.x.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.GAMMA_DIST.functionParameter.alpha.name`,detail:`sheets-formula.functionList.GAMMA_DIST.functionParameter.alpha.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.GAMMA_DIST.functionParameter.beta.name`,detail:`sheets-formula.functionList.GAMMA_DIST.functionParameter.beta.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.GAMMA_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.GAMMA_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.GAMMA_INV,functionType:q.Statistical,description:`sheets-formula.functionList.GAMMA_INV.description`,abstract:`sheets-formula.functionList.GAMMA_INV.abstract`,functionParameter:[{name:`sheets-formula.functionList.GAMMA_INV.functionParameter.probability.name`,detail:`sheets-formula.functionList.GAMMA_INV.functionParameter.probability.detail`,example:`0.068094`,require:1,repeat:0},{name:`sheets-formula.functionList.GAMMA_INV.functionParameter.alpha.name`,detail:`sheets-formula.functionList.GAMMA_INV.functionParameter.alpha.detail`,example:`9`,require:1,repeat:0},{name:`sheets-formula.functionList.GAMMA_INV.functionParameter.beta.name`,detail:`sheets-formula.functionList.GAMMA_INV.functionParameter.beta.detail`,example:`2`,require:1,repeat:0}]},{functionName:LB.GAMMALN,functionType:q.Statistical,description:`sheets-formula.functionList.GAMMALN.description`,abstract:`sheets-formula.functionList.GAMMALN.abstract`,functionParameter:[{name:`sheets-formula.functionList.GAMMALN.functionParameter.x.name`,detail:`sheets-formula.functionList.GAMMALN.functionParameter.x.detail`,example:`4`,require:1,repeat:0}]},{functionName:LB.GAMMALN_PRECISE,functionType:q.Statistical,description:`sheets-formula.functionList.GAMMALN_PRECISE.description`,abstract:`sheets-formula.functionList.GAMMALN_PRECISE.abstract`,functionParameter:[{name:`sheets-formula.functionList.GAMMALN_PRECISE.functionParameter.x.name`,detail:`sheets-formula.functionList.GAMMALN_PRECISE.functionParameter.x.detail`,example:`4`,require:1,repeat:0}]},{functionName:LB.GAUSS,functionType:q.Statistical,description:`sheets-formula.functionList.GAUSS.description`,abstract:`sheets-formula.functionList.GAUSS.abstract`,functionParameter:[{name:`sheets-formula.functionList.GAUSS.functionParameter.z.name`,detail:`sheets-formula.functionList.GAUSS.functionParameter.z.detail`,example:`2`,require:1,repeat:0}]},{functionName:LB.GEOMEAN,functionType:q.Statistical,description:`sheets-formula.functionList.GEOMEAN.description`,abstract:`sheets-formula.functionList.GEOMEAN.abstract`,functionParameter:[{name:`sheets-formula.functionList.GEOMEAN.functionParameter.number1.name`,detail:`sheets-formula.functionList.GEOMEAN.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.GEOMEAN.functionParameter.number2.name`,detail:`sheets-formula.functionList.GEOMEAN.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.GROWTH,functionType:q.Statistical,description:`sheets-formula.functionList.GROWTH.description`,abstract:`sheets-formula.functionList.GROWTH.abstract`,functionParameter:[{name:`sheets-formula.functionList.GROWTH.functionParameter.knownYs.name`,detail:`sheets-formula.functionList.GROWTH.functionParameter.knownYs.detail`,example:`B2:B7`,require:1,repeat:0},{name:`sheets-formula.functionList.GROWTH.functionParameter.knownXs.name`,detail:`sheets-formula.functionList.GROWTH.functionParameter.knownXs.detail`,example:`A2:A7`,require:0,repeat:0},{name:`sheets-formula.functionList.GROWTH.functionParameter.newXs.name`,detail:`sheets-formula.functionList.GROWTH.functionParameter.newXs.detail`,example:`A9:A10`,require:0,repeat:0},{name:`sheets-formula.functionList.GROWTH.functionParameter.constb.name`,detail:`sheets-formula.functionList.GROWTH.functionParameter.constb.detail`,example:`true`,require:0,repeat:0}]},{functionName:LB.HARMEAN,functionType:q.Statistical,description:`sheets-formula.functionList.HARMEAN.description`,abstract:`sheets-formula.functionList.HARMEAN.abstract`,functionParameter:[{name:`sheets-formula.functionList.HARMEAN.functionParameter.number1.name`,detail:`sheets-formula.functionList.HARMEAN.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.HARMEAN.functionParameter.number2.name`,detail:`sheets-formula.functionList.HARMEAN.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.HYPGEOM_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.HYPGEOM_DIST.description`,abstract:`sheets-formula.functionList.HYPGEOM_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.HYPGEOM_DIST.functionParameter.sampleS.name`,detail:`sheets-formula.functionList.HYPGEOM_DIST.functionParameter.sampleS.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.HYPGEOM_DIST.functionParameter.numberSample.name`,detail:`sheets-formula.functionList.HYPGEOM_DIST.functionParameter.numberSample.detail`,example:`4`,require:1,repeat:0},{name:`sheets-formula.functionList.HYPGEOM_DIST.functionParameter.populationS.name`,detail:`sheets-formula.functionList.HYPGEOM_DIST.functionParameter.populationS.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.HYPGEOM_DIST.functionParameter.numberPop.name`,detail:`sheets-formula.functionList.HYPGEOM_DIST.functionParameter.numberPop.detail`,example:`20`,require:1,repeat:0},{name:`sheets-formula.functionList.HYPGEOM_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.HYPGEOM_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.INTERCEPT,functionType:q.Statistical,description:`sheets-formula.functionList.INTERCEPT.description`,abstract:`sheets-formula.functionList.INTERCEPT.abstract`,functionParameter:[{name:`sheets-formula.functionList.INTERCEPT.functionParameter.knownYs.name`,detail:`sheets-formula.functionList.INTERCEPT.functionParameter.knownYs.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.INTERCEPT.functionParameter.knownXs.name`,detail:`sheets-formula.functionList.INTERCEPT.functionParameter.knownXs.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.KURT,functionType:q.Statistical,description:`sheets-formula.functionList.KURT.description`,abstract:`sheets-formula.functionList.KURT.abstract`,functionParameter:[{name:`sheets-formula.functionList.KURT.functionParameter.number1.name`,detail:`sheets-formula.functionList.KURT.functionParameter.number1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.KURT.functionParameter.number2.name`,detail:`sheets-formula.functionList.KURT.functionParameter.number2.detail`,example:`4`,require:0,repeat:1}]},{functionName:LB.LARGE,functionType:q.Statistical,description:`sheets-formula.functionList.LARGE.description`,abstract:`sheets-formula.functionList.LARGE.abstract`,functionParameter:[{name:`sheets-formula.functionList.LARGE.functionParameter.array.name`,detail:`sheets-formula.functionList.LARGE.functionParameter.array.detail`,example:`A2:B6`,require:1,repeat:0},{name:`sheets-formula.functionList.LARGE.functionParameter.k.name`,detail:`sheets-formula.functionList.LARGE.functionParameter.k.detail`,example:`3`,require:1,repeat:0}]},{functionName:LB.LINEST,functionType:q.Statistical,description:`sheets-formula.functionList.LINEST.description`,abstract:`sheets-formula.functionList.LINEST.abstract`,functionParameter:[{name:`sheets-formula.functionList.LINEST.functionParameter.knownYs.name`,detail:`sheets-formula.functionList.LINEST.functionParameter.knownYs.detail`,example:`B2:B7`,require:1,repeat:0},{name:`sheets-formula.functionList.LINEST.functionParameter.knownXs.name`,detail:`sheets-formula.functionList.LINEST.functionParameter.knownXs.detail`,example:`A2:A7`,require:0,repeat:0},{name:`sheets-formula.functionList.LINEST.functionParameter.constb.name`,detail:`sheets-formula.functionList.LINEST.functionParameter.constb.detail`,example:`true`,require:0,repeat:0},{name:`sheets-formula.functionList.LINEST.functionParameter.stats.name`,detail:`sheets-formula.functionList.LINEST.functionParameter.stats.detail`,example:`true`,require:0,repeat:0}]},{functionName:LB.LOGEST,functionType:q.Statistical,description:`sheets-formula.functionList.LOGEST.description`,abstract:`sheets-formula.functionList.LOGEST.abstract`,functionParameter:[{name:`sheets-formula.functionList.LOGEST.functionParameter.knownYs.name`,detail:`sheets-formula.functionList.LOGEST.functionParameter.knownYs.detail`,example:`B2:B7`,require:1,repeat:0},{name:`sheets-formula.functionList.LOGEST.functionParameter.knownXs.name`,detail:`sheets-formula.functionList.LOGEST.functionParameter.knownXs.detail`,example:`A2:A7`,require:0,repeat:0},{name:`sheets-formula.functionList.LOGEST.functionParameter.constb.name`,detail:`sheets-formula.functionList.LOGEST.functionParameter.constb.detail`,example:`true`,require:0,repeat:0},{name:`sheets-formula.functionList.LOGEST.functionParameter.stats.name`,detail:`sheets-formula.functionList.LOGEST.functionParameter.stats.detail`,example:`true`,require:0,repeat:0}]},{functionName:LB.LOGNORM_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.LOGNORM_DIST.description`,abstract:`sheets-formula.functionList.LOGNORM_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.LOGNORM_DIST.functionParameter.x.name`,detail:`sheets-formula.functionList.LOGNORM_DIST.functionParameter.x.detail`,example:`42`,require:1,repeat:0},{name:`sheets-formula.functionList.LOGNORM_DIST.functionParameter.mean.name`,detail:`sheets-formula.functionList.LOGNORM_DIST.functionParameter.mean.detail`,example:`40`,require:1,repeat:0},{name:`sheets-formula.functionList.LOGNORM_DIST.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.LOGNORM_DIST.functionParameter.standardDev.detail`,example:`1.5`,require:1,repeat:0},{name:`sheets-formula.functionList.LOGNORM_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.LOGNORM_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.LOGNORM_INV,functionType:q.Statistical,description:`sheets-formula.functionList.LOGNORM_INV.description`,abstract:`sheets-formula.functionList.LOGNORM_INV.abstract`,functionParameter:[{name:`sheets-formula.functionList.LOGNORM_INV.functionParameter.probability.name`,detail:`sheets-formula.functionList.LOGNORM_INV.functionParameter.probability.detail`,example:`0.908789`,require:1,repeat:0},{name:`sheets-formula.functionList.LOGNORM_INV.functionParameter.mean.name`,detail:`sheets-formula.functionList.LOGNORM_INV.functionParameter.mean.detail`,example:`40`,require:1,repeat:0},{name:`sheets-formula.functionList.LOGNORM_INV.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.LOGNORM_INV.functionParameter.standardDev.detail`,example:`1.5`,require:1,repeat:0}]},{functionName:LB.MARGINOFERROR,aliasFunctionName:`sheets-formula.functionList.MARGINOFERROR.aliasFunctionName`,functionType:q.Statistical,description:`sheets-formula.functionList.MARGINOFERROR.description`,abstract:`sheets-formula.functionList.MARGINOFERROR.abstract`,functionParameter:[{name:`sheets-formula.functionList.MARGINOFERROR.functionParameter.range.name`,detail:`sheets-formula.functionList.MARGINOFERROR.functionParameter.range.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.MARGINOFERROR.functionParameter.confidence.name`,detail:`sheets-formula.functionList.MARGINOFERROR.functionParameter.confidence.detail`,example:`0.95`,require:1,repeat:0}]},{functionName:LB.MAX,aliasFunctionName:`sheets-formula.functionList.MAX.aliasFunctionName`,functionType:q.Statistical,description:`sheets-formula.functionList.MAX.description`,abstract:`sheets-formula.functionList.MAX.abstract`,functionParameter:[{name:`sheets-formula.functionList.MAX.functionParameter.number1.name`,detail:`sheets-formula.functionList.MAX.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.MAX.functionParameter.number2.name`,detail:`sheets-formula.functionList.MAX.functionParameter.number2.detail`,example:`B2:B10`,require:0,repeat:1}]},{functionName:LB.MAXA,functionType:q.Statistical,description:`sheets-formula.functionList.MAXA.description`,abstract:`sheets-formula.functionList.MAXA.abstract`,functionParameter:[{name:`sheets-formula.functionList.MAXA.functionParameter.value1.name`,detail:`sheets-formula.functionList.MAXA.functionParameter.value1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.MAXA.functionParameter.value2.name`,detail:`sheets-formula.functionList.MAXA.functionParameter.value2.detail`,example:`B1:B20`,require:0,repeat:1}]},{functionName:LB.MAXIFS,functionType:q.Statistical,description:`sheets-formula.functionList.MAXIFS.description`,abstract:`sheets-formula.functionList.MAXIFS.abstract`,functionParameter:[{name:`sheets-formula.functionList.MAXIFS.functionParameter.maxRange.name`,detail:`sheets-formula.functionList.MAXIFS.functionParameter.maxRange.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.MAXIFS.functionParameter.criteriaRange1.name`,detail:`sheets-formula.functionList.MAXIFS.functionParameter.criteriaRange1.detail`,example:`B1:B20`,require:1,repeat:0},{name:`sheets-formula.functionList.MAXIFS.functionParameter.criteria1.name`,detail:`sheets-formula.functionList.MAXIFS.functionParameter.criteria1.detail`,example:`">10"`,require:1,repeat:0},{name:`sheets-formula.functionList.MAXIFS.functionParameter.criteriaRange2.name`,detail:`sheets-formula.functionList.MAXIFS.functionParameter.criteriaRange2.detail`,example:`C1:C20`,require:0,repeat:1},{name:`sheets-formula.functionList.MAXIFS.functionParameter.criteria2.name`,detail:`sheets-formula.functionList.MAXIFS.functionParameter.criteria2.detail`,example:`"<20"`,require:0,repeat:1}]},{functionName:LB.MEDIAN,functionType:q.Statistical,description:`sheets-formula.functionList.MEDIAN.description`,abstract:`sheets-formula.functionList.MEDIAN.abstract`,functionParameter:[{name:`sheets-formula.functionList.MEDIAN.functionParameter.number1.name`,detail:`sheets-formula.functionList.MEDIAN.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.MEDIAN.functionParameter.number2.name`,detail:`sheets-formula.functionList.MEDIAN.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.MIN,aliasFunctionName:`sheets-formula.functionList.MIN.aliasFunctionName`,functionType:q.Statistical,description:`sheets-formula.functionList.MIN.description`,abstract:`sheets-formula.functionList.MIN.abstract`,functionParameter:[{name:`sheets-formula.functionList.MIN.functionParameter.number1.name`,detail:`sheets-formula.functionList.MIN.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.MIN.functionParameter.number2.name`,detail:`sheets-formula.functionList.MIN.functionParameter.number2.detail`,example:`B2:B10`,require:0,repeat:1}]},{functionName:LB.MINA,functionType:q.Statistical,description:`sheets-formula.functionList.MINA.description`,abstract:`sheets-formula.functionList.MINA.abstract`,functionParameter:[{name:`sheets-formula.functionList.MINA.functionParameter.value1.name`,detail:`sheets-formula.functionList.MINA.functionParameter.value1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.MINA.functionParameter.value2.name`,detail:`sheets-formula.functionList.MINA.functionParameter.value2.detail`,example:`B1:B20`,require:0,repeat:1}]},{functionName:LB.MINIFS,functionType:q.Statistical,description:`sheets-formula.functionList.MINIFS.description`,abstract:`sheets-formula.functionList.MINIFS.abstract`,functionParameter:[{name:`sheets-formula.functionList.MINIFS.functionParameter.minRange.name`,detail:`sheets-formula.functionList.MINIFS.functionParameter.minRange.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.MINIFS.functionParameter.criteriaRange1.name`,detail:`sheets-formula.functionList.MINIFS.functionParameter.criteriaRange1.detail`,example:`B1:B20`,require:1,repeat:0},{name:`sheets-formula.functionList.MINIFS.functionParameter.criteria1.name`,detail:`sheets-formula.functionList.MINIFS.functionParameter.criteria1.detail`,example:`">10"`,require:1,repeat:0},{name:`sheets-formula.functionList.MINIFS.functionParameter.criteriaRange2.name`,detail:`sheets-formula.functionList.MINIFS.functionParameter.criteriaRange2.detail`,example:`C1:C20`,require:0,repeat:1},{name:`sheets-formula.functionList.MINIFS.functionParameter.criteria2.name`,detail:`sheets-formula.functionList.MINIFS.functionParameter.criteria2.detail`,example:`"<20"`,require:0,repeat:1}]},{functionName:LB.MODE_MULT,functionType:q.Statistical,description:`sheets-formula.functionList.MODE_MULT.description`,abstract:`sheets-formula.functionList.MODE_MULT.abstract`,functionParameter:[{name:`sheets-formula.functionList.MODE_MULT.functionParameter.number1.name`,detail:`sheets-formula.functionList.MODE_MULT.functionParameter.number1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.MODE_MULT.functionParameter.number2.name`,detail:`sheets-formula.functionList.MODE_MULT.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.MODE_SNGL,functionType:q.Statistical,description:`sheets-formula.functionList.MODE_SNGL.description`,abstract:`sheets-formula.functionList.MODE_SNGL.abstract`,functionParameter:[{name:`sheets-formula.functionList.MODE_SNGL.functionParameter.number1.name`,detail:`sheets-formula.functionList.MODE_SNGL.functionParameter.number1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.MODE_SNGL.functionParameter.number2.name`,detail:`sheets-formula.functionList.MODE_SNGL.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.NEGBINOM_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.NEGBINOM_DIST.description`,abstract:`sheets-formula.functionList.NEGBINOM_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.NEGBINOM_DIST.functionParameter.numberF.name`,detail:`sheets-formula.functionList.NEGBINOM_DIST.functionParameter.numberF.detail`,example:`10`,require:1,repeat:0},{name:`sheets-formula.functionList.NEGBINOM_DIST.functionParameter.numberS.name`,detail:`sheets-formula.functionList.NEGBINOM_DIST.functionParameter.numberS.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.NEGBINOM_DIST.functionParameter.probabilityS.name`,detail:`sheets-formula.functionList.NEGBINOM_DIST.functionParameter.probabilityS.detail`,example:`0.25`,require:1,repeat:0},{name:`sheets-formula.functionList.NEGBINOM_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.NEGBINOM_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.NORM_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.NORM_DIST.description`,abstract:`sheets-formula.functionList.NORM_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.NORM_DIST.functionParameter.x.name`,detail:`sheets-formula.functionList.NORM_DIST.functionParameter.x.detail`,example:`42`,require:1,repeat:0},{name:`sheets-formula.functionList.NORM_DIST.functionParameter.mean.name`,detail:`sheets-formula.functionList.NORM_DIST.functionParameter.mean.detail`,example:`40`,require:1,repeat:0},{name:`sheets-formula.functionList.NORM_DIST.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.NORM_DIST.functionParameter.standardDev.detail`,example:`1.5`,require:1,repeat:0},{name:`sheets-formula.functionList.NORM_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.NORM_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.NORM_INV,functionType:q.Statistical,description:`sheets-formula.functionList.NORM_INV.description`,abstract:`sheets-formula.functionList.NORM_INV.abstract`,functionParameter:[{name:`sheets-formula.functionList.NORM_INV.functionParameter.probability.name`,detail:`sheets-formula.functionList.NORM_INV.functionParameter.probability.detail`,example:`0.908789`,require:1,repeat:0},{name:`sheets-formula.functionList.NORM_INV.functionParameter.mean.name`,detail:`sheets-formula.functionList.NORM_INV.functionParameter.mean.detail`,example:`40`,require:1,repeat:0},{name:`sheets-formula.functionList.NORM_INV.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.NORM_INV.functionParameter.standardDev.detail`,example:`1.5`,require:1,repeat:0}]},{functionName:LB.NORM_S_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.NORM_S_DIST.description`,abstract:`sheets-formula.functionList.NORM_S_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.NORM_S_DIST.functionParameter.z.name`,detail:`sheets-formula.functionList.NORM_S_DIST.functionParameter.z.detail`,example:`1.333333`,require:1,repeat:0},{name:`sheets-formula.functionList.NORM_S_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.NORM_S_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.NORM_S_INV,functionType:q.Statistical,description:`sheets-formula.functionList.NORM_S_INV.description`,abstract:`sheets-formula.functionList.NORM_S_INV.abstract`,functionParameter:[{name:`sheets-formula.functionList.NORM_S_INV.functionParameter.probability.name`,detail:`sheets-formula.functionList.NORM_S_INV.functionParameter.probability.detail`,example:`0.908789`,require:1,repeat:0}]},{functionName:LB.PEARSON,functionType:q.Statistical,description:`sheets-formula.functionList.PEARSON.description`,abstract:`sheets-formula.functionList.PEARSON.abstract`,functionParameter:[{name:`sheets-formula.functionList.PEARSON.functionParameter.array1.name`,detail:`sheets-formula.functionList.PEARSON.functionParameter.array1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.PEARSON.functionParameter.array2.name`,detail:`sheets-formula.functionList.PEARSON.functionParameter.array2.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.PERCENTILE_EXC,functionType:q.Statistical,description:`sheets-formula.functionList.PERCENTILE_EXC.description`,abstract:`sheets-formula.functionList.PERCENTILE_EXC.abstract`,functionParameter:[{name:`sheets-formula.functionList.PERCENTILE_EXC.functionParameter.array.name`,detail:`sheets-formula.functionList.PERCENTILE_EXC.functionParameter.array.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.PERCENTILE_EXC.functionParameter.k.name`,detail:`sheets-formula.functionList.PERCENTILE_EXC.functionParameter.k.detail`,example:`0.3`,require:1,repeat:0}]},{functionName:LB.PERCENTILE_INC,functionType:q.Statistical,description:`sheets-formula.functionList.PERCENTILE_INC.description`,abstract:`sheets-formula.functionList.PERCENTILE_INC.abstract`,functionParameter:[{name:`sheets-formula.functionList.PERCENTILE_INC.functionParameter.array.name`,detail:`sheets-formula.functionList.PERCENTILE_INC.functionParameter.array.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.PERCENTILE_INC.functionParameter.k.name`,detail:`sheets-formula.functionList.PERCENTILE_INC.functionParameter.k.detail`,example:`0.3`,require:1,repeat:0}]},{functionName:LB.PERCENTRANK_EXC,functionType:q.Statistical,description:`sheets-formula.functionList.PERCENTRANK_EXC.description`,abstract:`sheets-formula.functionList.PERCENTRANK_EXC.abstract`,functionParameter:[{name:`sheets-formula.functionList.PERCENTRANK_EXC.functionParameter.array.name`,detail:`sheets-formula.functionList.PERCENTRANK_EXC.functionParameter.array.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.PERCENTRANK_EXC.functionParameter.x.name`,detail:`sheets-formula.functionList.PERCENTRANK_EXC.functionParameter.x.detail`,example:`1.5`,require:1,repeat:0},{name:`sheets-formula.functionList.PERCENTRANK_EXC.functionParameter.significance.name`,detail:`sheets-formula.functionList.PERCENTRANK_EXC.functionParameter.significance.detail`,example:`3`,require:0,repeat:0}]},{functionName:LB.PERCENTRANK_INC,functionType:q.Statistical,description:`sheets-formula.functionList.PERCENTRANK_INC.description`,abstract:`sheets-formula.functionList.PERCENTRANK_INC.abstract`,functionParameter:[{name:`sheets-formula.functionList.PERCENTRANK_INC.functionParameter.array.name`,detail:`sheets-formula.functionList.PERCENTRANK_INC.functionParameter.array.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.PERCENTRANK_INC.functionParameter.x.name`,detail:`sheets-formula.functionList.PERCENTRANK_INC.functionParameter.x.detail`,example:`1.5`,require:1,repeat:0},{name:`sheets-formula.functionList.PERCENTRANK_INC.functionParameter.significance.name`,detail:`sheets-formula.functionList.PERCENTRANK_INC.functionParameter.significance.detail`,example:`3`,require:0,repeat:0}]},{functionName:LB.PERMUT,functionType:q.Statistical,description:`sheets-formula.functionList.PERMUT.description`,abstract:`sheets-formula.functionList.PERMUT.abstract`,functionParameter:[{name:`sheets-formula.functionList.PERMUT.functionParameter.number.name`,detail:`sheets-formula.functionList.PERMUT.functionParameter.number.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.PERMUT.functionParameter.numberChosen.name`,detail:`sheets-formula.functionList.PERMUT.functionParameter.numberChosen.detail`,example:`2`,require:1,repeat:0}]},{functionName:LB.PERMUTATIONA,functionType:q.Statistical,description:`sheets-formula.functionList.PERMUTATIONA.description`,abstract:`sheets-formula.functionList.PERMUTATIONA.abstract`,functionParameter:[{name:`sheets-formula.functionList.PERMUT.functionParameter.number.name`,detail:`sheets-formula.functionList.PERMUT.functionParameter.number.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.PERMUT.functionParameter.numberChosen.name`,detail:`sheets-formula.functionList.PERMUT.functionParameter.numberChosen.detail`,example:`2`,require:1,repeat:0}]},{functionName:LB.PHI,functionType:q.Statistical,description:`sheets-formula.functionList.PHI.description`,abstract:`sheets-formula.functionList.PHI.abstract`,functionParameter:[{name:`sheets-formula.functionList.PHI.functionParameter.x.name`,detail:`sheets-formula.functionList.PHI.functionParameter.x.detail`,example:`0.75`,require:1,repeat:0}]},{functionName:LB.POISSON_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.POISSON_DIST.description`,abstract:`sheets-formula.functionList.POISSON_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.POISSON_DIST.functionParameter.x.name`,detail:`sheets-formula.functionList.POISSON_DIST.functionParameter.x.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.POISSON_DIST.functionParameter.mean.name`,detail:`sheets-formula.functionList.POISSON_DIST.functionParameter.mean.detail`,example:`5`,require:1,repeat:0},{name:`sheets-formula.functionList.POISSON_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.POISSON_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.PROB,functionType:q.Statistical,description:`sheets-formula.functionList.PROB.description`,abstract:`sheets-formula.functionList.PROB.abstract`,functionParameter:[{name:`sheets-formula.functionList.PROB.functionParameter.xRange.name`,detail:`sheets-formula.functionList.PROB.functionParameter.xRange.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.PROB.functionParameter.probRange.name`,detail:`sheets-formula.functionList.PROB.functionParameter.probRange.detail`,example:`B1:B4`,require:1,repeat:0},{name:`sheets-formula.functionList.PROB.functionParameter.lowerLimit.name`,detail:`sheets-formula.functionList.PROB.functionParameter.lowerLimit.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.PROB.functionParameter.upperLimit.name`,detail:`sheets-formula.functionList.PROB.functionParameter.upperLimit.detail`,example:`3`,require:0,repeat:0}]},{functionName:LB.QUARTILE_EXC,functionType:q.Statistical,description:`sheets-formula.functionList.QUARTILE_EXC.description`,abstract:`sheets-formula.functionList.QUARTILE_EXC.abstract`,functionParameter:[{name:`sheets-formula.functionList.QUARTILE_EXC.functionParameter.array.name`,detail:`sheets-formula.functionList.QUARTILE_EXC.functionParameter.array.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.QUARTILE_EXC.functionParameter.quart.name`,detail:`sheets-formula.functionList.QUARTILE_EXC.functionParameter.quart.detail`,example:`1`,require:1,repeat:0}]},{functionName:LB.QUARTILE_INC,functionType:q.Statistical,description:`sheets-formula.functionList.QUARTILE_INC.description`,abstract:`sheets-formula.functionList.QUARTILE_INC.abstract`,functionParameter:[{name:`sheets-formula.functionList.QUARTILE_INC.functionParameter.array.name`,detail:`sheets-formula.functionList.QUARTILE_INC.functionParameter.array.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.QUARTILE_INC.functionParameter.quart.name`,detail:`sheets-formula.functionList.QUARTILE_INC.functionParameter.quart.detail`,example:`1`,require:1,repeat:0}]},{functionName:LB.RANK_AVG,functionType:q.Statistical,description:`sheets-formula.functionList.RANK_AVG.description`,abstract:`sheets-formula.functionList.RANK_AVG.abstract`,functionParameter:[{name:`sheets-formula.functionList.RANK_AVG.functionParameter.number.name`,detail:`sheets-formula.functionList.RANK_AVG.functionParameter.number.detail`,example:`A3`,require:1,repeat:0},{name:`sheets-formula.functionList.RANK_AVG.functionParameter.ref.name`,detail:`sheets-formula.functionList.RANK_AVG.functionParameter.ref.detail`,example:`A2:A6`,require:1,repeat:0},{name:`sheets-formula.functionList.RANK_AVG.functionParameter.order.name`,detail:`sheets-formula.functionList.RANK_AVG.functionParameter.order.detail`,example:`1`,require:0,repeat:0}]},{functionName:LB.RANK_EQ,functionType:q.Statistical,description:`sheets-formula.functionList.RANK_EQ.description`,abstract:`sheets-formula.functionList.RANK_EQ.abstract`,functionParameter:[{name:`sheets-formula.functionList.RANK_EQ.functionParameter.number.name`,detail:`sheets-formula.functionList.RANK_EQ.functionParameter.number.detail`,example:`A3`,require:1,repeat:0},{name:`sheets-formula.functionList.RANK_EQ.functionParameter.ref.name`,detail:`sheets-formula.functionList.RANK_EQ.functionParameter.ref.detail`,example:`A2:A6`,require:1,repeat:0},{name:`sheets-formula.functionList.RANK_EQ.functionParameter.order.name`,detail:`sheets-formula.functionList.RANK_EQ.functionParameter.order.detail`,example:`1`,require:0,repeat:0}]},{functionName:LB.RSQ,functionType:q.Statistical,description:`sheets-formula.functionList.RSQ.description`,abstract:`sheets-formula.functionList.RSQ.abstract`,functionParameter:[{name:`sheets-formula.functionList.RSQ.functionParameter.array1.name`,detail:`sheets-formula.functionList.RSQ.functionParameter.array1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.RSQ.functionParameter.array2.name`,detail:`sheets-formula.functionList.RSQ.functionParameter.array2.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.SKEW,functionType:q.Statistical,description:`sheets-formula.functionList.SKEW.description`,abstract:`sheets-formula.functionList.SKEW.abstract`,functionParameter:[{name:`sheets-formula.functionList.SKEW.functionParameter.number1.name`,detail:`sheets-formula.functionList.SKEW.functionParameter.number1.detail`,example:`A1:C3`,require:1,repeat:0},{name:`sheets-formula.functionList.SKEW.functionParameter.number2.name`,detail:`sheets-formula.functionList.SKEW.functionParameter.number2.detail`,example:`4`,require:0,repeat:1}]},{functionName:LB.SKEW_P,functionType:q.Statistical,description:`sheets-formula.functionList.SKEW_P.description`,abstract:`sheets-formula.functionList.SKEW_P.abstract`,functionParameter:[{name:`sheets-formula.functionList.SKEW_P.functionParameter.number1.name`,detail:`sheets-formula.functionList.SKEW_P.functionParameter.number1.detail`,example:`A1:C3`,require:1,repeat:0},{name:`sheets-formula.functionList.SKEW_P.functionParameter.number2.name`,detail:`sheets-formula.functionList.SKEW_P.functionParameter.number2.detail`,example:`4`,require:0,repeat:1}]},{functionName:LB.SLOPE,functionType:q.Statistical,description:`sheets-formula.functionList.SLOPE.description`,abstract:`sheets-formula.functionList.SLOPE.abstract`,functionParameter:[{name:`sheets-formula.functionList.SLOPE.functionParameter.knownYs.name`,detail:`sheets-formula.functionList.SLOPE.functionParameter.knownYs.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.SLOPE.functionParameter.knownXs.name`,detail:`sheets-formula.functionList.SLOPE.functionParameter.knownXs.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.SMALL,functionType:q.Statistical,description:`sheets-formula.functionList.SMALL.description`,abstract:`sheets-formula.functionList.SMALL.abstract`,functionParameter:[{name:`sheets-formula.functionList.SMALL.functionParameter.array.name`,detail:`sheets-formula.functionList.SMALL.functionParameter.array.detail`,example:`A2:B6`,require:1,repeat:0},{name:`sheets-formula.functionList.SMALL.functionParameter.k.name`,detail:`sheets-formula.functionList.SMALL.functionParameter.k.detail`,example:`3`,require:1,repeat:0}]},{functionName:LB.STANDARDIZE,functionType:q.Statistical,description:`sheets-formula.functionList.STANDARDIZE.description`,abstract:`sheets-formula.functionList.STANDARDIZE.abstract`,functionParameter:[{name:`sheets-formula.functionList.STANDARDIZE.functionParameter.x.name`,detail:`sheets-formula.functionList.STANDARDIZE.functionParameter.x.detail`,example:`42`,require:1,repeat:0},{name:`sheets-formula.functionList.STANDARDIZE.functionParameter.mean.name`,detail:`sheets-formula.functionList.STANDARDIZE.functionParameter.mean.detail`,example:`40`,require:1,repeat:0},{name:`sheets-formula.functionList.STANDARDIZE.functionParameter.standardDev.name`,detail:`sheets-formula.functionList.STANDARDIZE.functionParameter.standardDev.detail`,example:`1.5`,require:1,repeat:0}]},{functionName:LB.STDEV_P,functionType:q.Statistical,description:`sheets-formula.functionList.STDEV_P.description`,abstract:`sheets-formula.functionList.STDEV_P.abstract`,functionParameter:[{name:`sheets-formula.functionList.STDEV_P.functionParameter.number1.name`,detail:`sheets-formula.functionList.STDEV_P.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.STDEV_P.functionParameter.number2.name`,detail:`sheets-formula.functionList.STDEV_P.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.STDEV_S,functionType:q.Statistical,description:`sheets-formula.functionList.STDEV_S.description`,abstract:`sheets-formula.functionList.STDEV_S.abstract`,functionParameter:[{name:`sheets-formula.functionList.STDEV_S.functionParameter.number1.name`,detail:`sheets-formula.functionList.STDEV_S.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.STDEV_S.functionParameter.number2.name`,detail:`sheets-formula.functionList.STDEV_S.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.STDEVA,functionType:q.Statistical,description:`sheets-formula.functionList.STDEVA.description`,abstract:`sheets-formula.functionList.STDEVA.abstract`,functionParameter:[{name:`sheets-formula.functionList.STDEVA.functionParameter.value1.name`,detail:`sheets-formula.functionList.STDEVA.functionParameter.value1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.STDEVA.functionParameter.value2.name`,detail:`sheets-formula.functionList.STDEVA.functionParameter.value2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.STDEVPA,functionType:q.Statistical,description:`sheets-formula.functionList.STDEVPA.description`,abstract:`sheets-formula.functionList.STDEVPA.abstract`,functionParameter:[{name:`sheets-formula.functionList.STDEVPA.functionParameter.value1.name`,detail:`sheets-formula.functionList.STDEVPA.functionParameter.value1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.STDEVPA.functionParameter.value2.name`,detail:`sheets-formula.functionList.STDEVPA.functionParameter.value2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.STEYX,functionType:q.Statistical,description:`sheets-formula.functionList.STEYX.description`,abstract:`sheets-formula.functionList.STEYX.abstract`,functionParameter:[{name:`sheets-formula.functionList.STEYX.functionParameter.knownYs.name`,detail:`sheets-formula.functionList.STEYX.functionParameter.knownYs.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.STEYX.functionParameter.knownXs.name`,detail:`sheets-formula.functionList.STEYX.functionParameter.knownXs.detail`,example:`B1:B4`,require:1,repeat:0}]},{functionName:LB.T_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.T_DIST.description`,abstract:`sheets-formula.functionList.T_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.T_DIST.functionParameter.x.name`,detail:`sheets-formula.functionList.T_DIST.functionParameter.x.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.T_DIST.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.T_DIST.functionParameter.degFreedom.detail`,example:`3`,require:1,repeat:0},{name:`sheets-formula.functionList.T_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.T_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.T_DIST_2T,functionType:q.Statistical,description:`sheets-formula.functionList.T_DIST_2T.description`,abstract:`sheets-formula.functionList.T_DIST_2T.abstract`,functionParameter:[{name:`sheets-formula.functionList.T_DIST_2T.functionParameter.x.name`,detail:`sheets-formula.functionList.T_DIST_2T.functionParameter.x.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.T_DIST_2T.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.T_DIST_2T.functionParameter.degFreedom.detail`,example:`3`,require:1,repeat:0}]},{functionName:LB.T_DIST_RT,functionType:q.Statistical,description:`sheets-formula.functionList.T_DIST_RT.description`,abstract:`sheets-formula.functionList.T_DIST_RT.abstract`,functionParameter:[{name:`sheets-formula.functionList.T_DIST_RT.functionParameter.x.name`,detail:`sheets-formula.functionList.T_DIST_RT.functionParameter.x.detail`,example:`8`,require:1,repeat:0},{name:`sheets-formula.functionList.T_DIST_RT.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.T_DIST_RT.functionParameter.degFreedom.detail`,example:`3`,require:1,repeat:0}]},{functionName:LB.T_INV,functionType:q.Statistical,description:`sheets-formula.functionList.T_INV.description`,abstract:`sheets-formula.functionList.T_INV.abstract`,functionParameter:[{name:`sheets-formula.functionList.T_INV.functionParameter.probability.name`,detail:`sheets-formula.functionList.T_INV.functionParameter.probability.detail`,example:`0.75`,require:1,repeat:0},{name:`sheets-formula.functionList.T_INV.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.T_INV.functionParameter.degFreedom.detail`,example:`2`,require:1,repeat:0}]},{functionName:LB.T_INV_2T,functionType:q.Statistical,description:`sheets-formula.functionList.T_INV_2T.description`,abstract:`sheets-formula.functionList.T_INV_2T.abstract`,functionParameter:[{name:`sheets-formula.functionList.T_INV_2T.functionParameter.probability.name`,detail:`sheets-formula.functionList.T_INV_2T.functionParameter.probability.detail`,example:`0.75`,require:1,repeat:0},{name:`sheets-formula.functionList.T_INV_2T.functionParameter.degFreedom.name`,detail:`sheets-formula.functionList.T_INV_2T.functionParameter.degFreedom.detail`,example:`2`,require:1,repeat:0}]},{functionName:LB.T_TEST,functionType:q.Statistical,description:`sheets-formula.functionList.T_TEST.description`,abstract:`sheets-formula.functionList.T_TEST.abstract`,functionParameter:[{name:`sheets-formula.functionList.T_TEST.functionParameter.array1.name`,detail:`sheets-formula.functionList.T_TEST.functionParameter.array1.detail`,example:`A1:A4`,require:1,repeat:0},{name:`sheets-formula.functionList.T_TEST.functionParameter.array2.name`,detail:`sheets-formula.functionList.T_TEST.functionParameter.array2.detail`,example:`B1:B4`,require:1,repeat:0},{name:`sheets-formula.functionList.T_TEST.functionParameter.tails.name`,detail:`sheets-formula.functionList.T_TEST.functionParameter.tails.detail`,example:`2`,require:1,repeat:0},{name:`sheets-formula.functionList.T_TEST.functionParameter.type.name`,detail:`sheets-formula.functionList.T_TEST.functionParameter.type.detail`,example:`1`,require:1,repeat:0}]},{functionName:LB.TREND,functionType:q.Statistical,description:`sheets-formula.functionList.TREND.description`,abstract:`sheets-formula.functionList.TREND.abstract`,functionParameter:[{name:`sheets-formula.functionList.TREND.functionParameter.knownYs.name`,detail:`sheets-formula.functionList.TREND.functionParameter.knownYs.detail`,example:`B2:B7`,require:1,repeat:0},{name:`sheets-formula.functionList.TREND.functionParameter.knownXs.name`,detail:`sheets-formula.functionList.TREND.functionParameter.knownXs.detail`,example:`A2:A7`,require:0,repeat:0},{name:`sheets-formula.functionList.TREND.functionParameter.newXs.name`,detail:`sheets-formula.functionList.TREND.functionParameter.newXs.detail`,example:`A9:A10`,require:0,repeat:0},{name:`sheets-formula.functionList.TREND.functionParameter.constb.name`,detail:`sheets-formula.functionList.TREND.functionParameter.constb.detail`,example:`true`,require:0,repeat:0}]},{functionName:LB.TRIMMEAN,functionType:q.Statistical,description:`sheets-formula.functionList.TRIMMEAN.description`,abstract:`sheets-formula.functionList.TRIMMEAN.abstract`,functionParameter:[{name:`sheets-formula.functionList.TRIMMEAN.functionParameter.array.name`,detail:`sheets-formula.functionList.TRIMMEAN.functionParameter.array.detail`,example:`A2:A12`,require:1,repeat:0},{name:`sheets-formula.functionList.TRIMMEAN.functionParameter.percent.name`,detail:`sheets-formula.functionList.TRIMMEAN.functionParameter.percent.detail`,example:`0.2`,require:1,repeat:0}]},{functionName:LB.VAR_P,functionType:q.Statistical,description:`sheets-formula.functionList.VAR_P.description`,abstract:`sheets-formula.functionList.VAR_P.abstract`,functionParameter:[{name:`sheets-formula.functionList.VAR_P.functionParameter.number1.name`,detail:`sheets-formula.functionList.VAR_P.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.VAR_P.functionParameter.number2.name`,detail:`sheets-formula.functionList.VAR_P.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.VAR_S,functionType:q.Statistical,description:`sheets-formula.functionList.VAR_S.description`,abstract:`sheets-formula.functionList.VAR_S.abstract`,functionParameter:[{name:`sheets-formula.functionList.VAR_S.functionParameter.number1.name`,detail:`sheets-formula.functionList.VAR_S.functionParameter.number1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.VAR_S.functionParameter.number2.name`,detail:`sheets-formula.functionList.VAR_S.functionParameter.number2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.VARA,functionType:q.Statistical,description:`sheets-formula.functionList.VARA.description`,abstract:`sheets-formula.functionList.VARA.abstract`,functionParameter:[{name:`sheets-formula.functionList.VARA.functionParameter.value1.name`,detail:`sheets-formula.functionList.VARA.functionParameter.value1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.VARA.functionParameter.value2.name`,detail:`sheets-formula.functionList.VARA.functionParameter.value2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.VARPA,functionType:q.Statistical,description:`sheets-formula.functionList.VARPA.description`,abstract:`sheets-formula.functionList.VARPA.abstract`,functionParameter:[{name:`sheets-formula.functionList.VARPA.functionParameter.value1.name`,detail:`sheets-formula.functionList.VARPA.functionParameter.value1.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.VARPA.functionParameter.value2.name`,detail:`sheets-formula.functionList.VARPA.functionParameter.value2.detail`,example:`2`,require:0,repeat:1}]},{functionName:LB.WEIBULL_DIST,functionType:q.Statistical,description:`sheets-formula.functionList.WEIBULL_DIST.description`,abstract:`sheets-formula.functionList.WEIBULL_DIST.abstract`,functionParameter:[{name:`sheets-formula.functionList.WEIBULL_DIST.functionParameter.x.name`,detail:`sheets-formula.functionList.WEIBULL_DIST.functionParameter.x.detail`,example:`105`,require:1,repeat:0},{name:`sheets-formula.functionList.WEIBULL_DIST.functionParameter.alpha.name`,detail:`sheets-formula.functionList.WEIBULL_DIST.functionParameter.alpha.detail`,example:`20`,require:1,repeat:0},{name:`sheets-formula.functionList.WEIBULL_DIST.functionParameter.beta.name`,detail:`sheets-formula.functionList.WEIBULL_DIST.functionParameter.beta.detail`,example:`100`,require:1,repeat:0},{name:`sheets-formula.functionList.WEIBULL_DIST.functionParameter.cumulative.name`,detail:`sheets-formula.functionList.WEIBULL_DIST.functionParameter.cumulative.detail`,example:`true`,require:1,repeat:0}]},{functionName:LB.Z_TEST,functionType:q.Statistical,description:`sheets-formula.functionList.Z_TEST.description`,abstract:`sheets-formula.functionList.Z_TEST.abstract`,functionParameter:[{name:`sheets-formula.functionList.Z_TEST.functionParameter.array.name`,detail:`sheets-formula.functionList.Z_TEST.functionParameter.array.detail`,example:`A2:A11`,require:1,repeat:0},{name:`sheets-formula.functionList.Z_TEST.functionParameter.x.name`,detail:`sheets-formula.functionList.Z_TEST.functionParameter.x.detail`,example:`4`,require:1,repeat:0},{name:`sheets-formula.functionList.Z_TEST.functionParameter.sigma.name`,detail:`sheets-formula.functionList.Z_TEST.functionParameter.sigma.detail`,example:`10`,require:0,repeat:0}]}],jmt=[{functionName:RB.ASC,functionType:q.Text,description:`sheets-formula.functionList.ASC.description`,abstract:`sheets-formula.functionList.ASC.abstract`,functionParameter:[{name:`sheets-formula.functionList.ASC.functionParameter.text.name`,detail:`sheets-formula.functionList.ASC.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0}]},{functionName:RB.ARRAYTOTEXT,functionType:q.Text,description:`sheets-formula.functionList.ARRAYTOTEXT.description`,abstract:`sheets-formula.functionList.ARRAYTOTEXT.abstract`,functionParameter:[{name:`sheets-formula.functionList.ARRAYTOTEXT.functionParameter.array.name`,detail:`sheets-formula.functionList.ARRAYTOTEXT.functionParameter.array.detail`,example:`A2:B4`,require:1,repeat:0},{name:`sheets-formula.functionList.ARRAYTOTEXT.functionParameter.format.name`,detail:`sheets-formula.functionList.ARRAYTOTEXT.functionParameter.format.detail`,example:`0`,require:0,repeat:0}]},{functionName:RB.BAHTTEXT,functionType:q.Text,description:`sheets-formula.functionList.BAHTTEXT.description`,abstract:`sheets-formula.functionList.BAHTTEXT.abstract`,functionParameter:[{name:`sheets-formula.functionList.BAHTTEXT.functionParameter.number.name`,detail:`sheets-formula.functionList.BAHTTEXT.functionParameter.number.detail`,example:`1234`,require:1,repeat:0}]},{functionName:RB.CHAR,functionType:q.Text,description:`sheets-formula.functionList.CHAR.description`,abstract:`sheets-formula.functionList.CHAR.abstract`,functionParameter:[{name:`sheets-formula.functionList.CHAR.functionParameter.number.name`,detail:`sheets-formula.functionList.CHAR.functionParameter.number.detail`,example:`65`,require:1,repeat:0}]},{functionName:RB.CLEAN,functionType:q.Text,description:`sheets-formula.functionList.CLEAN.description`,abstract:`sheets-formula.functionList.CLEAN.abstract`,functionParameter:[{name:`sheets-formula.functionList.CLEAN.functionParameter.text.name`,detail:`sheets-formula.functionList.CLEAN.functionParameter.text.detail`,example:`CHAR(1)&"Univer"`,require:1,repeat:0}]},{functionName:RB.CODE,functionType:q.Text,description:`sheets-formula.functionList.CODE.description`,abstract:`sheets-formula.functionList.CODE.abstract`,functionParameter:[{name:`sheets-formula.functionList.CODE.functionParameter.text.name`,detail:`sheets-formula.functionList.CODE.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0}]},{functionName:RB.CONCAT,functionType:q.Text,description:`sheets-formula.functionList.CONCAT.description`,abstract:`sheets-formula.functionList.CONCAT.abstract`,functionParameter:[{name:`sheets-formula.functionList.CONCAT.functionParameter.text1.name`,detail:`sheets-formula.functionList.CONCAT.functionParameter.text1.detail`,example:`"Hello"`,require:1,repeat:0},{name:`sheets-formula.functionList.CONCAT.functionParameter.text2.name`,detail:`sheets-formula.functionList.CONCAT.functionParameter.text2.detail`,example:`"Univer"`,require:0,repeat:1}]},{functionName:RB.CONCATENATE,functionType:q.Text,description:`sheets-formula.functionList.CONCATENATE.description`,abstract:`sheets-formula.functionList.CONCATENATE.abstract`,functionParameter:[{name:`sheets-formula.functionList.CONCATENATE.functionParameter.text1.name`,detail:`sheets-formula.functionList.CONCATENATE.functionParameter.text1.detail`,example:`A1`,require:1,repeat:0},{name:`sheets-formula.functionList.CONCATENATE.functionParameter.text2.name`,detail:`sheets-formula.functionList.CONCATENATE.functionParameter.text2.detail`,example:`A2`,require:0,repeat:1}]},{functionName:RB.DBCS,functionType:q.Text,description:`sheets-formula.functionList.DBCS.description`,abstract:`sheets-formula.functionList.DBCS.abstract`,functionParameter:[{name:`sheets-formula.functionList.DBCS.functionParameter.text.name`,detail:`sheets-formula.functionList.DBCS.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0}]},{functionName:RB.DOLLAR,functionType:q.Text,description:`sheets-formula.functionList.DOLLAR.description`,abstract:`sheets-formula.functionList.DOLLAR.abstract`,functionParameter:[{name:`sheets-formula.functionList.DOLLAR.functionParameter.number.name`,detail:`sheets-formula.functionList.DOLLAR.functionParameter.number.detail`,example:`1234.567`,require:1,repeat:0},{name:`sheets-formula.functionList.DOLLAR.functionParameter.decimals.name`,detail:`sheets-formula.functionList.DOLLAR.functionParameter.decimals.detail`,example:`2`,require:0,repeat:0}]},{functionName:RB.EXACT,functionType:q.Text,description:`sheets-formula.functionList.EXACT.description`,abstract:`sheets-formula.functionList.EXACT.abstract`,functionParameter:[{name:`sheets-formula.functionList.EXACT.functionParameter.text1.name`,detail:`sheets-formula.functionList.EXACT.functionParameter.text1.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.EXACT.functionParameter.text2.name`,detail:`sheets-formula.functionList.EXACT.functionParameter.text2.detail`,example:`"univer"`,require:1,repeat:0}]},{functionName:RB.FIND,functionType:q.Text,description:`sheets-formula.functionList.FIND.description`,abstract:`sheets-formula.functionList.FIND.abstract`,functionParameter:[{name:`sheets-formula.functionList.FIND.functionParameter.findText.name`,detail:`sheets-formula.functionList.FIND.functionParameter.findText.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.FIND.functionParameter.withinText.name`,detail:`sheets-formula.functionList.FIND.functionParameter.withinText.detail`,example:`"Hello Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.FIND.functionParameter.startNum.name`,detail:`sheets-formula.functionList.FIND.functionParameter.startNum.detail`,example:`1`,require:0,repeat:0}]},{functionName:RB.FINDB,functionType:q.Text,description:`sheets-formula.functionList.FINDB.description`,abstract:`sheets-formula.functionList.FINDB.abstract`,functionParameter:[{name:`sheets-formula.functionList.FINDB.functionParameter.findText.name`,detail:`sheets-formula.functionList.FINDB.functionParameter.findText.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.FINDB.functionParameter.withinText.name`,detail:`sheets-formula.functionList.FINDB.functionParameter.withinText.detail`,example:`"Hello Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.FINDB.functionParameter.startNum.name`,detail:`sheets-formula.functionList.FINDB.functionParameter.startNum.detail`,example:`1`,require:0,repeat:0}]},{functionName:RB.FIXED,functionType:q.Text,description:`sheets-formula.functionList.FIXED.description`,abstract:`sheets-formula.functionList.FIXED.abstract`,functionParameter:[{name:`sheets-formula.functionList.FIXED.functionParameter.number.name`,detail:`sheets-formula.functionList.FIXED.functionParameter.number.detail`,example:`1234.567`,require:1,repeat:0},{name:`sheets-formula.functionList.FIXED.functionParameter.decimals.name`,detail:`sheets-formula.functionList.FIXED.functionParameter.decimals.detail`,example:`2`,require:0,repeat:0},{name:`sheets-formula.functionList.FIXED.functionParameter.noCommas.name`,detail:`sheets-formula.functionList.FIXED.functionParameter.noCommas.detail`,example:`0`,require:0,repeat:0}]},{functionName:RB.LEFT,functionType:q.Text,description:`sheets-formula.functionList.LEFT.description`,abstract:`sheets-formula.functionList.LEFT.abstract`,functionParameter:[{name:`sheets-formula.functionList.LEFT.functionParameter.text.name`,detail:`sheets-formula.functionList.LEFT.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.LEFT.functionParameter.numChars.name`,detail:`sheets-formula.functionList.LEFT.functionParameter.numChars.detail`,example:`3`,require:0,repeat:0}]},{functionName:RB.LEFTB,functionType:q.Text,description:`sheets-formula.functionList.LEFTB.description`,abstract:`sheets-formula.functionList.LEFTB.abstract`,functionParameter:[{name:`sheets-formula.functionList.LEFTB.functionParameter.text.name`,detail:`sheets-formula.functionList.LEFTB.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.LEFTB.functionParameter.numBytes.name`,detail:`sheets-formula.functionList.LEFTB.functionParameter.numBytes.detail`,example:`3`,require:0,repeat:0}]},{functionName:RB.LEN,functionType:q.Text,description:`sheets-formula.functionList.LEN.description`,abstract:`sheets-formula.functionList.LEN.abstract`,functionParameter:[{name:`sheets-formula.functionList.LEN.functionParameter.text.name`,detail:`sheets-formula.functionList.LEN.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0}]},{functionName:RB.LENB,functionType:q.Text,description:`sheets-formula.functionList.LENB.description`,abstract:`sheets-formula.functionList.LENB.abstract`,functionParameter:[{name:`sheets-formula.functionList.LENB.functionParameter.text.name`,detail:`sheets-formula.functionList.LENB.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0}]},{functionName:RB.LOWER,functionType:q.Text,description:`sheets-formula.functionList.LOWER.description`,abstract:`sheets-formula.functionList.LOWER.abstract`,functionParameter:[{name:`sheets-formula.functionList.LOWER.functionParameter.text.name`,detail:`sheets-formula.functionList.LOWER.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0}]},{functionName:RB.MID,functionType:q.Text,description:`sheets-formula.functionList.MID.description`,abstract:`sheets-formula.functionList.MID.abstract`,functionParameter:[{name:`sheets-formula.functionList.MID.functionParameter.text.name`,detail:`sheets-formula.functionList.MID.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.MID.functionParameter.startNum.name`,detail:`sheets-formula.functionList.MID.functionParameter.startNum.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.MID.functionParameter.numChars.name`,detail:`sheets-formula.functionList.MID.functionParameter.numChars.detail`,example:`3`,require:1,repeat:0}]},{functionName:RB.MIDB,functionType:q.Text,description:`sheets-formula.functionList.MIDB.description`,abstract:`sheets-formula.functionList.MIDB.abstract`,functionParameter:[{name:`sheets-formula.functionList.MIDB.functionParameter.text.name`,detail:`sheets-formula.functionList.MIDB.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.MIDB.functionParameter.startNum.name`,detail:`sheets-formula.functionList.MIDB.functionParameter.startNum.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.MIDB.functionParameter.numBytes.name`,detail:`sheets-formula.functionList.MIDB.functionParameter.numBytes.detail`,example:`3`,require:1,repeat:0}]},{functionName:RB.NUMBERSTRING,functionType:q.Text,description:`sheets-formula.functionList.NUMBERSTRING.description`,abstract:`sheets-formula.functionList.NUMBERSTRING.abstract`,functionParameter:[{name:`sheets-formula.functionList.NUMBERSTRING.functionParameter.number.name`,detail:`sheets-formula.functionList.NUMBERSTRING.functionParameter.number.detail`,example:`123`,require:1,repeat:0},{name:`sheets-formula.functionList.NUMBERSTRING.functionParameter.type.name`,detail:`sheets-formula.functionList.NUMBERSTRING.functionParameter.type.detail`,example:`1`,require:1,repeat:0}]},{functionName:RB.NUMBERVALUE,functionType:q.Text,description:`sheets-formula.functionList.NUMBERVALUE.description`,abstract:`sheets-formula.functionList.NUMBERVALUE.abstract`,functionParameter:[{name:`sheets-formula.functionList.NUMBERVALUE.functionParameter.text.name`,detail:`sheets-formula.functionList.NUMBERVALUE.functionParameter.text.detail`,example:`"2.500,27"`,require:1,repeat:0},{name:`sheets-formula.functionList.NUMBERVALUE.functionParameter.decimalSeparator.name`,detail:`sheets-formula.functionList.NUMBERVALUE.functionParameter.decimalSeparator.detail`,example:`","`,require:0,repeat:0},{name:`sheets-formula.functionList.NUMBERVALUE.functionParameter.groupSeparator.name`,detail:`sheets-formula.functionList.NUMBERVALUE.functionParameter.groupSeparator.detail`,example:`"."`,require:0,repeat:0}]},{functionName:RB.PHONETIC,functionType:q.Text,description:`sheets-formula.functionList.PHONETIC.description`,abstract:`sheets-formula.functionList.PHONETIC.abstract`,functionParameter:[{name:`sheets-formula.functionList.PHONETIC.functionParameter.number1.name`,detail:`sheets-formula.functionList.PHONETIC.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.PHONETIC.functionParameter.number2.name`,detail:`sheets-formula.functionList.PHONETIC.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:RB.PROPER,functionType:q.Text,description:`sheets-formula.functionList.PROPER.description`,abstract:`sheets-formula.functionList.PROPER.abstract`,functionParameter:[{name:`sheets-formula.functionList.PROPER.functionParameter.text.name`,detail:`sheets-formula.functionList.PROPER.functionParameter.text.detail`,example:`"hello univer"`,require:1,repeat:0}]},{functionName:RB.REGEXEXTRACT,functionType:q.Text,description:`sheets-formula.functionList.REGEXEXTRACT.description`,abstract:`sheets-formula.functionList.REGEXEXTRACT.abstract`,functionParameter:[{name:`sheets-formula.functionList.REGEXEXTRACT.functionParameter.text.name`,detail:`sheets-formula.functionList.REGEXEXTRACT.functionParameter.text.detail`,example:`"abcdefg"`,require:1,repeat:0},{name:`sheets-formula.functionList.REGEXEXTRACT.functionParameter.regularExpression.name`,detail:`sheets-formula.functionList.REGEXEXTRACT.functionParameter.regularExpression.detail`,example:`"c.*f"`,require:1,repeat:0}]},{functionName:RB.REGEXMATCH,functionType:q.Text,description:`sheets-formula.functionList.REGEXMATCH.description`,abstract:`sheets-formula.functionList.REGEXMATCH.abstract`,functionParameter:[{name:`sheets-formula.functionList.REGEXMATCH.functionParameter.text.name`,detail:`sheets-formula.functionList.REGEXMATCH.functionParameter.text.detail`,example:`"Spreadsheets"`,require:1,repeat:0},{name:`sheets-formula.functionList.REGEXMATCH.functionParameter.regularExpression.name`,detail:`sheets-formula.functionList.REGEXMATCH.functionParameter.regularExpression.detail`,example:`"S.r"`,require:1,repeat:0}]},{functionName:RB.REGEXREPLACE,functionType:q.Text,description:`sheets-formula.functionList.REGEXREPLACE.description`,abstract:`sheets-formula.functionList.REGEXREPLACE.abstract`,functionParameter:[{name:`sheets-formula.functionList.REGEXREPLACE.functionParameter.text.name`,detail:`sheets-formula.functionList.REGEXREPLACE.functionParameter.text.detail`,example:`"abcedfg"`,require:1,repeat:0},{name:`sheets-formula.functionList.REGEXREPLACE.functionParameter.regularExpression.name`,detail:`sheets-formula.functionList.REGEXREPLACE.functionParameter.regularExpression.detail`,example:`"a.*d"`,require:1,repeat:0},{name:`sheets-formula.functionList.REGEXREPLACE.functionParameter.replacement.name`,detail:`sheets-formula.functionList.REGEXREPLACE.functionParameter.replacement.detail`,example:`"xyz"`,require:1,repeat:0}]},{functionName:RB.REPLACE,functionType:q.Text,description:`sheets-formula.functionList.REPLACE.description`,abstract:`sheets-formula.functionList.REPLACE.abstract`,functionParameter:[{name:`sheets-formula.functionList.REPLACE.functionParameter.oldText.name`,detail:`sheets-formula.functionList.REPLACE.functionParameter.oldText.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.REPLACE.functionParameter.startNum.name`,detail:`sheets-formula.functionList.REPLACE.functionParameter.startNum.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.REPLACE.functionParameter.numChars.name`,detail:`sheets-formula.functionList.REPLACE.functionParameter.numChars.detail`,example:`0`,require:1,repeat:0},{name:`sheets-formula.functionList.REPLACE.functionParameter.newText.name`,detail:`sheets-formula.functionList.REPLACE.functionParameter.newText.detail`,example:`"Hello "`,require:1,repeat:0}]},{functionName:RB.REPLACEB,functionType:q.Text,description:`sheets-formula.functionList.REPLACEB.description`,abstract:`sheets-formula.functionList.REPLACEB.abstract`,functionParameter:[{name:`sheets-formula.functionList.REPLACEB.functionParameter.oldText.name`,detail:`sheets-formula.functionList.REPLACEB.functionParameter.oldText.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.REPLACEB.functionParameter.startNum.name`,detail:`sheets-formula.functionList.REPLACEB.functionParameter.startNum.detail`,example:`1`,require:1,repeat:0},{name:`sheets-formula.functionList.REPLACEB.functionParameter.numBytes.name`,detail:`sheets-formula.functionList.REPLACEB.functionParameter.numBytes.detail`,example:`0`,require:1,repeat:0},{name:`sheets-formula.functionList.REPLACEB.functionParameter.newText.name`,detail:`sheets-formula.functionList.REPLACEB.functionParameter.newText.detail`,example:`"Hello "`,require:1,repeat:0}]},{functionName:RB.REPT,functionType:q.Text,description:`sheets-formula.functionList.REPT.description`,abstract:`sheets-formula.functionList.REPT.abstract`,functionParameter:[{name:`sheets-formula.functionList.REPT.functionParameter.text.name`,detail:`sheets-formula.functionList.REPT.functionParameter.text.detail`,example:`"*-"`,require:1,repeat:0},{name:`sheets-formula.functionList.REPT.functionParameter.numberTimes.name`,detail:`sheets-formula.functionList.REPT.functionParameter.numberTimes.detail`,example:`3`,require:1,repeat:0}]},{functionName:RB.RIGHT,functionType:q.Text,description:`sheets-formula.functionList.RIGHT.description`,abstract:`sheets-formula.functionList.RIGHT.abstract`,functionParameter:[{name:`sheets-formula.functionList.RIGHT.functionParameter.text.name`,detail:`sheets-formula.functionList.RIGHT.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.RIGHT.functionParameter.numChars.name`,detail:`sheets-formula.functionList.RIGHT.functionParameter.numChars.detail`,example:`3`,require:0,repeat:0}]},{functionName:RB.RIGHTB,functionType:q.Text,description:`sheets-formula.functionList.RIGHTB.description`,abstract:`sheets-formula.functionList.RIGHTB.abstract`,functionParameter:[{name:`sheets-formula.functionList.RIGHTB.functionParameter.text.name`,detail:`sheets-formula.functionList.RIGHTB.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.RIGHTB.functionParameter.numBytes.name`,detail:`sheets-formula.functionList.RIGHTB.functionParameter.numBytes.detail`,example:`3`,require:0,repeat:0}]},{functionName:RB.SEARCH,functionType:q.Text,description:`sheets-formula.functionList.SEARCH.description`,abstract:`sheets-formula.functionList.SEARCH.abstract`,functionParameter:[{name:`sheets-formula.functionList.SEARCH.functionParameter.findText.name`,detail:`sheets-formula.functionList.SEARCH.functionParameter.findText.detail`,example:`"univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.SEARCH.functionParameter.withinText.name`,detail:`sheets-formula.functionList.SEARCH.functionParameter.withinText.detail`,example:`"Hello Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.SEARCH.functionParameter.startNum.name`,detail:`sheets-formula.functionList.SEARCH.functionParameter.startNum.detail`,example:`1`,require:0,repeat:0}]},{functionName:RB.SEARCHB,functionType:q.Text,description:`sheets-formula.functionList.SEARCHB.description`,abstract:`sheets-formula.functionList.SEARCHB.abstract`,functionParameter:[{name:`sheets-formula.functionList.SEARCHB.functionParameter.findText.name`,detail:`sheets-formula.functionList.SEARCHB.functionParameter.findText.detail`,example:`"univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.SEARCHB.functionParameter.withinText.name`,detail:`sheets-formula.functionList.SEARCHB.functionParameter.withinText.detail`,example:`"Hello Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.SEARCHB.functionParameter.startNum.name`,detail:`sheets-formula.functionList.SEARCHB.functionParameter.startNum.detail`,example:`1`,require:0,repeat:0}]},{functionName:RB.SUBSTITUTE,functionType:q.Text,description:`sheets-formula.functionList.SUBSTITUTE.description`,abstract:`sheets-formula.functionList.SUBSTITUTE.abstract`,functionParameter:[{name:`sheets-formula.functionList.SUBSTITUTE.functionParameter.text.name`,detail:`sheets-formula.functionList.SUBSTITUTE.functionParameter.text.detail`,example:`"Hello Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.SUBSTITUTE.functionParameter.oldText.name`,detail:`sheets-formula.functionList.SUBSTITUTE.functionParameter.oldText.detail`,example:`"Hello"`,require:1,repeat:0},{name:`sheets-formula.functionList.SUBSTITUTE.functionParameter.newText.name`,detail:`sheets-formula.functionList.SUBSTITUTE.functionParameter.newText.detail`,example:`"Hi"`,require:1,repeat:0},{name:`sheets-formula.functionList.SUBSTITUTE.functionParameter.instanceNum.name`,detail:`sheets-formula.functionList.SUBSTITUTE.functionParameter.instanceNum.detail`,example:`1`,require:0,repeat:0}]},{functionName:RB.T,functionType:q.Text,description:`sheets-formula.functionList.T.description`,abstract:`sheets-formula.functionList.T.abstract`,functionParameter:[{name:`sheets-formula.functionList.T.functionParameter.value.name`,detail:`sheets-formula.functionList.T.functionParameter.value.detail`,example:`"Univer"`,require:1,repeat:0}]},{functionName:RB.TEXT,functionType:q.Text,description:`sheets-formula.functionList.TEXT.description`,abstract:`sheets-formula.functionList.TEXT.abstract`,functionParameter:[{name:`sheets-formula.functionList.TEXT.functionParameter.value.name`,detail:`sheets-formula.functionList.TEXT.functionParameter.value.detail`,example:`1.23`,require:1,repeat:0},{name:`sheets-formula.functionList.TEXT.functionParameter.formatText.name`,detail:`sheets-formula.functionList.TEXT.functionParameter.formatText.detail`,example:`"$0.00"`,require:1,repeat:0}]},{functionName:RB.TEXTAFTER,functionType:q.Text,description:`sheets-formula.functionList.TEXTAFTER.description`,abstract:`sheets-formula.functionList.TEXTAFTER.abstract`,functionParameter:[{name:`sheets-formula.functionList.TEXTAFTER.functionParameter.text.name`,detail:`sheets-formula.functionList.TEXTAFTER.functionParameter.text.detail`,example:`"Red riding hood’s, red hood"`,require:1,repeat:0},{name:`sheets-formula.functionList.TEXTAFTER.functionParameter.delimiter.name`,detail:`sheets-formula.functionList.TEXTAFTER.functionParameter.delimiter.detail`,example:`"hood"`,require:1,repeat:0},{name:`sheets-formula.functionList.TEXTAFTER.functionParameter.instanceNum.name`,detail:`sheets-formula.functionList.TEXTAFTER.functionParameter.instanceNum.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.TEXTAFTER.functionParameter.matchMode.name`,detail:`sheets-formula.functionList.TEXTAFTER.functionParameter.matchMode.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.TEXTAFTER.functionParameter.matchEnd.name`,detail:`sheets-formula.functionList.TEXTAFTER.functionParameter.matchEnd.detail`,example:`0`,require:0,repeat:0},{name:`sheets-formula.functionList.TEXTAFTER.functionParameter.ifNotFound.name`,detail:`sheets-formula.functionList.TEXTAFTER.functionParameter.ifNotFound.detail`,example:`"not found"`,require:0,repeat:0}]},{functionName:RB.TEXTBEFORE,functionType:q.Text,description:`sheets-formula.functionList.TEXTBEFORE.description`,abstract:`sheets-formula.functionList.TEXTBEFORE.abstract`,functionParameter:[{name:`sheets-formula.functionList.TEXTBEFORE.functionParameter.text.name`,detail:`sheets-formula.functionList.TEXTBEFORE.functionParameter.text.detail`,example:`"Red riding hood’s, red hood"`,require:1,repeat:0},{name:`sheets-formula.functionList.TEXTBEFORE.functionParameter.delimiter.name`,detail:`sheets-formula.functionList.TEXTBEFORE.functionParameter.delimiter.detail`,example:`"hood"`,require:1,repeat:0},{name:`sheets-formula.functionList.TEXTBEFORE.functionParameter.instanceNum.name`,detail:`sheets-formula.functionList.TEXTBEFORE.functionParameter.instanceNum.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.TEXTBEFORE.functionParameter.matchMode.name`,detail:`sheets-formula.functionList.TEXTBEFORE.functionParameter.matchMode.detail`,example:`1`,require:0,repeat:0},{name:`sheets-formula.functionList.TEXTBEFORE.functionParameter.matchEnd.name`,detail:`sheets-formula.functionList.TEXTBEFORE.functionParameter.matchEnd.detail`,example:`0`,require:0,repeat:0},{name:`sheets-formula.functionList.TEXTBEFORE.functionParameter.ifNotFound.name`,detail:`sheets-formula.functionList.TEXTBEFORE.functionParameter.ifNotFound.detail`,example:`"not found"`,require:0,repeat:0}]},{functionName:RB.TEXTJOIN,functionType:q.Text,description:`sheets-formula.functionList.TEXTJOIN.description`,abstract:`sheets-formula.functionList.TEXTJOIN.abstract`,functionParameter:[{name:`sheets-formula.functionList.TEXTJOIN.functionParameter.delimiter.name`,detail:`sheets-formula.functionList.TEXTJOIN.functionParameter.delimiter.detail`,example:`", "`,require:1,repeat:0},{name:`sheets-formula.functionList.TEXTJOIN.functionParameter.ignoreEmpty.name`,detail:`sheets-formula.functionList.TEXTJOIN.functionParameter.ignoreEmpty.detail`,example:`true`,require:1,repeat:0},{name:`sheets-formula.functionList.TEXTJOIN.functionParameter.text1.name`,detail:`sheets-formula.functionList.TEXTJOIN.functionParameter.text1.detail`,example:`"Hi"`,require:1,repeat:0},{name:`sheets-formula.functionList.TEXTJOIN.functionParameter.text2.name`,detail:`sheets-formula.functionList.TEXTJOIN.functionParameter.text2.detail`,example:`"Univer"`,require:0,repeat:1}]},{functionName:RB.TEXTSPLIT,functionType:q.Text,description:`sheets-formula.functionList.TEXTSPLIT.description`,abstract:`sheets-formula.functionList.TEXTSPLIT.abstract`,functionParameter:[{name:`sheets-formula.functionList.TEXTSPLIT.functionParameter.text.name`,detail:`sheets-formula.functionList.TEXTSPLIT.functionParameter.text.detail`,example:`A1:C2`,require:1,repeat:0},{name:`sheets-formula.functionList.TEXTSPLIT.functionParameter.colDelimiter.name`,detail:`sheets-formula.functionList.TEXTSPLIT.functionParameter.colDelimiter.detail`,example:`","`,require:1,repeat:0},{name:`sheets-formula.functionList.TEXTSPLIT.functionParameter.rowDelimiter.name`,detail:`sheets-formula.functionList.TEXTSPLIT.functionParameter.rowDelimiter.detail`,example:`";"`,require:0,repeat:0},{name:`sheets-formula.functionList.TEXTSPLIT.functionParameter.ignoreEmpty.name`,detail:`sheets-formula.functionList.TEXTSPLIT.functionParameter.ignoreEmpty.detail`,example:``,require:0,repeat:0},{name:`sheets-formula.functionList.TEXTSPLIT.functionParameter.matchMode.name`,detail:`sheets-formula.functionList.TEXTSPLIT.functionParameter.matchMode.detail`,example:``,require:0,repeat:0},{name:`sheets-formula.functionList.TEXTSPLIT.functionParameter.padWith.name`,detail:`sheets-formula.functionList.TEXTSPLIT.functionParameter.padWith.detail`,example:``,require:0,repeat:0}]},{functionName:RB.TRIM,functionType:q.Text,description:`sheets-formula.functionList.TRIM.description`,abstract:`sheets-formula.functionList.TRIM.abstract`,functionParameter:[{name:`sheets-formula.functionList.TRIM.functionParameter.text.name`,detail:`sheets-formula.functionList.TRIM.functionParameter.text.detail`,example:`" Hello Univer "`,require:1,repeat:0}]},{functionName:RB.UNICHAR,functionType:q.Text,description:`sheets-formula.functionList.UNICHAR.description`,abstract:`sheets-formula.functionList.UNICHAR.abstract`,functionParameter:[{name:`sheets-formula.functionList.UNICHAR.functionParameter.number.name`,detail:`sheets-formula.functionList.UNICHAR.functionParameter.number.detail`,example:`65`,require:1,repeat:0}]},{functionName:RB.UNICODE,functionType:q.Text,description:`sheets-formula.functionList.UNICODE.description`,abstract:`sheets-formula.functionList.UNICODE.abstract`,functionParameter:[{name:`sheets-formula.functionList.UNICODE.functionParameter.text.name`,detail:`sheets-formula.functionList.UNICODE.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0}]},{functionName:RB.UPPER,functionType:q.Text,description:`sheets-formula.functionList.UPPER.description`,abstract:`sheets-formula.functionList.UPPER.abstract`,functionParameter:[{name:`sheets-formula.functionList.UPPER.functionParameter.text.name`,detail:`sheets-formula.functionList.UPPER.functionParameter.text.detail`,example:`"Univer"`,require:1,repeat:0}]},{functionName:RB.VALUE,functionType:q.Text,description:`sheets-formula.functionList.VALUE.description`,abstract:`sheets-formula.functionList.VALUE.abstract`,functionParameter:[{name:`sheets-formula.functionList.VALUE.functionParameter.text.name`,detail:`sheets-formula.functionList.VALUE.functionParameter.text.detail`,example:`"123"`,require:1,repeat:0}]},{functionName:RB.VALUETOTEXT,functionType:q.Text,description:`sheets-formula.functionList.VALUETOTEXT.description`,abstract:`sheets-formula.functionList.VALUETOTEXT.abstract`,functionParameter:[{name:`sheets-formula.functionList.VALUETOTEXT.functionParameter.value.name`,detail:`sheets-formula.functionList.VALUETOTEXT.functionParameter.value.detail`,example:`"Univer"`,require:1,repeat:0},{name:`sheets-formula.functionList.VALUETOTEXT.functionParameter.format.name`,detail:`sheets-formula.functionList.VALUETOTEXT.functionParameter.format.detail`,example:`1`,require:0,repeat:0}]},{functionName:RB.CALL,functionType:q.Text,description:`sheets-formula.functionList.CALL.description`,abstract:`sheets-formula.functionList.CALL.abstract`,functionParameter:[{name:`sheets-formula.functionList.CALL.functionParameter.number1.name`,detail:`sheets-formula.functionList.CALL.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.CALL.functionParameter.number2.name`,detail:`sheets-formula.functionList.CALL.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:RB.EUROCONVERT,functionType:q.Text,description:`sheets-formula.functionList.EUROCONVERT.description`,abstract:`sheets-formula.functionList.EUROCONVERT.abstract`,functionParameter:[{name:`sheets-formula.functionList.EUROCONVERT.functionParameter.number1.name`,detail:`sheets-formula.functionList.EUROCONVERT.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.EUROCONVERT.functionParameter.number2.name`,detail:`sheets-formula.functionList.EUROCONVERT.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:RB.REGISTER_ID,functionType:q.Text,description:`sheets-formula.functionList.REGISTER_ID.description`,abstract:`sheets-formula.functionList.REGISTER_ID.abstract`,functionParameter:[{name:`sheets-formula.functionList.REGISTER_ID.functionParameter.number1.name`,detail:`sheets-formula.functionList.REGISTER_ID.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.REGISTER_ID.functionParameter.number2.name`,detail:`sheets-formula.functionList.REGISTER_ID.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]}],Mmt=[],Nmt=[{functionName:zB.ENCODEURL,functionType:q.Web,description:`sheets-formula.functionList.ENCODEURL.description`,abstract:`sheets-formula.functionList.ENCODEURL.abstract`,functionParameter:[{name:`sheets-formula.functionList.ENCODEURL.functionParameter.text.name`,detail:`sheets-formula.functionList.ENCODEURL.functionParameter.text.detail`,example:`"https://univer.ai/"`,require:1,repeat:0}]},{functionName:zB.FILTERXML,functionType:q.Web,description:`sheets-formula.functionList.FILTERXML.description`,abstract:`sheets-formula.functionList.FILTERXML.abstract`,functionParameter:[{name:`sheets-formula.functionList.FILTERXML.functionParameter.number1.name`,detail:`sheets-formula.functionList.FILTERXML.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.FILTERXML.functionParameter.number2.name`,detail:`sheets-formula.functionList.FILTERXML.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]},{functionName:zB.WEBSERVICE,functionType:q.Web,description:`sheets-formula.functionList.WEBSERVICE.description`,abstract:`sheets-formula.functionList.WEBSERVICE.abstract`,functionParameter:[{name:`sheets-formula.functionList.WEBSERVICE.functionParameter.number1.name`,detail:`sheets-formula.functionList.WEBSERVICE.functionParameter.number1.detail`,example:`A1:A20`,require:1,repeat:0},{name:`sheets-formula.functionList.WEBSERVICE.functionParameter.number2.name`,detail:`sheets-formula.functionList.WEBSERVICE.functionParameter.number2.detail`,example:`A1:A20`,require:1,repeat:0}]}],Pmt=[...Tmt,...Cmt,...kmt,...Amt,...Omt,...Smt,...jmt,...Dmt,...Emt,...wmt,...xmt,...bmt,...Nmt,...ymt,...Mmt];function yQ(e,t){let n=``;return e.aliasFunctionName?(n=t.t(e.aliasFunctionName),n===e.aliasFunctionName&&(n=e.functionName)):n=e.functionName,n}var bQ=ce(`formula.description-service`),xQ=class extends P{constructor(e,t,n){super(),this._functionService=e,this._localeService=t,this._configService=n,eQ(this,`_descriptions`,new Map),this._initialize()}_initialize(){this.disposeWithMe(Wf(this._localeService.localeChanged$.subscribe(()=>{this._functionService.clearDescriptions();let e=new Map;this._descriptions.forEach(t=>{let n=yQ(t,this._localeService).toUpperCase();e.set(n,t)}),this._descriptions=e,this._initRegisterDescriptions()}))),this._initDescriptions(),this._initRegisterDescriptions()}_initDescriptions(){var e;let t=this._localeService;Pmt.forEach(e=>{if(Irt.has(e.functionName)){let n=yQ(e,t).toUpperCase();this._descriptions.set(n,e)}});let n=this._configService.getConfig(YZ);n==null||(e=n.description)==null||e.forEach(e=>{let n=yQ(e,t).toUpperCase();this._descriptions.set(n,e)})}_initRegisterDescriptions(){let e=this._localeService,t=Array.from(this._descriptions.values()).map(t=>({functionName:yQ(t,e),functionType:t.functionType,description:e.t(t.description),abstract:e.t(t.abstract),functionParameter:t.functionParameter.map(t=>({name:e.t(t.name),detail:e.t(t.detail),example:t.example,require:t.require,repeat:t.repeat}))}));this._functionService.registerDescriptions(...t)}_registerDescriptions(e){let t=this._localeService,n=e.map(e=>({functionName:yQ(e,t),functionType:e.functionType,description:t.t(e.description),abstract:t.t(e.abstract),functionParameter:e.functionParameter.map(e=>({name:t.t(e.name),detail:t.t(e.detail),example:e.example,require:e.require,repeat:e.repeat}))}));this._functionService.registerDescriptions(...n)}dispose(){super.dispose(),this._descriptions.clear()}getDescriptions(){return this._functionService.getDescriptions()}hasFunction(e){return this._descriptions.has(e.toUpperCase())}getFunctionInfo(e){let t=this._descriptions.get(e.toUpperCase());if(t)return this._functionService.getDescription(yQ(t,this._localeService))}getSearchListByName(e){let t=this._functionService.getDescriptions(),n=e.toUpperCase().trim(),r=[];return t.forEach(e=>{let{functionName:t,abstract:i,functionType:a}=e;t.toUpperCase().indexOf(n)>-1&&a!==q.DefinedName&&r.push({name:t,desc:i})}),r}getSearchListByNameFirstLetter(e){let t=this._functionService.getDescriptions(),n=e.toUpperCase().trim(),r=[];return t.forEach(e=>{let{functionName:t,abstract:i,functionType:a}=e;t.toUpperCase().indexOf(n)===0&&r.push({name:t,desc:i,functionType:a})}),r}getSearchListByType(e){let t=this._functionService.getDescriptions(),n=[];return t.forEach(t=>{let{functionName:r,functionType:i,abstract:a}=t;(i===e||e===-1)&&i!==q.DefinedName&&n.push({name:r,desc:a})}),n}registerDescriptions(e){let t=this._localeService,n=[];return e.forEach(e=>{let r=yQ(e,t).toUpperCase();n.push(r),this._descriptions.set(r,e)}),this._registerDescriptions(e),Wf(()=>{this.unregisterDescriptions(n)})}unregisterDescriptions(e){let t=[];e.forEach(e=>{let n=e.toUpperCase(),r=this._descriptions.get(n);r&&(t.push(yQ(r,this._localeService)),this._descriptions.delete(n))}),this._functionService.unregisterDescriptions(...t)}hasDescription(e){return this._descriptions.has(e.toUpperCase())}hasDefinedNameDescription(e){let t=this._descriptions.get(e.toUpperCase());return t?t.functionType===q.DefinedName:!1}isFormulaDefinedName(e){let t=this._descriptions.get(e.toUpperCase());return!t||t.functionType!==q.DefinedName?!1:!Xz(t.description)}};xQ=ZZ([XZ(0,qV),XZ(1,j(nx)),XZ(2,Nm)],xQ);var SQ=class extends P{constructor(e,t,n,r){super(),this._descriptionService=e,this._definedNamesService=t,this._univerInstanceService=n,this._commandService=r,eQ(this,`_preUnitId`,null),this._initialize()}_initialize(){this._descriptionListener(),this._changeUnitListener(),this._changeSheetListener()}_descriptionListener(){this.disposeWithMe(Wf(this._definedNamesService.update$.subscribe(e=>{this._updateDescriptions(e)})))}_changeUnitListener(){this.disposeWithMe(Wf(this._univerInstanceService.getCurrentTypeOfUnit$(M.UNIVER_SHEET).subscribe(e=>{this._unRegisterDescriptions(),e&&this._initRegisterDescriptions(e.getUnitId())})))}_changeSheetListener(){this.disposeWithMe(this._commandService.onCommandExecuted((e,t)=>{if(!t?.fromCollab){if(e.id===$K.id){let t=e.params;this._unregisterDescriptionsForNotInSheetId(t.unitId,t.subUnitId),this._initRegisterDescriptions(t.unitId,t.subUnitId)}else if(e.id===iB.id){let t=e.params;this._registerDescription(t)}else if(e.id===aB.id){let t=e.params;this._unregisterDescription(t)}}}))}_updateDescriptions(e){let t=ZG(this._univerInstanceService);if(!t)return;let{unitId:n,subUnitId:r}=t,{type:i,unitId:a,definedNames:o}=e;if(a===n){if(i===`update`){let e=[];o.forEach(t=>{let{name:n,comment:i,formulaOrRefString:a,localSheetId:o}=t;(o==null||o===`AllDefaultWorkbook`||o===r)&&e.push({functionName:n,description:a+(i||``),abstract:a,functionType:q.DefinedName,functionParameter:[]})}),this._descriptionService.registerDescriptions(e)}else if(i===`remove`){let e=[];o.forEach(t=>{e.push(t.name)}),this._descriptionService.unregisterDescriptions(e)}}}_registerDescription(e){let t=ZG(this._univerInstanceService,e);if(!t)return;let{subUnitId:n}=t,{name:r,comment:i,formulaOrRefString:a,localSheetId:o}=e;this._descriptionService.hasDescription(r)||(o==null||o===`AllDefaultWorkbook`||o===n)&&this._descriptionService.registerDescriptions([{functionName:r,description:a+(i||``),abstract:a,functionType:q.DefinedName,functionParameter:[]}])}_unregisterDescription(e){let{name:t}=e;this._descriptionService.unregisterDescriptions([t])}_unRegisterDescriptions(){if(this._preUnitId===null)return;let e=this._definedNamesService.getDefinedNameMap(this._preUnitId);if(!e)return;let t=[];Array.from(Object.values(e)).forEach(e=>{let{name:n}=e;t.push(n)}),this._descriptionService.unregisterDescriptions(t),this._preUnitId=null}_initRegisterDescriptions(e,t){let n=ZG(this._univerInstanceService,{unitId:e,subUnitId:t});if(!n)return;let{unitId:r,subUnitId:i}=n,a=this._definedNamesService.getDefinedNameMap(r);if(!a)return;let o=[];this._preUnitId=r,Array.from(Object.values(a)).forEach(e=>{let{name:t,comment:n,formulaOrRefString:r,localSheetId:a}=e;this._descriptionService.hasDescription(t)||(a==null||a===`AllDefaultWorkbook`||a===i)&&o.push({functionName:t,description:r+(n||``),abstract:r,functionType:q.DefinedName,functionParameter:[]})}),this._descriptionService.registerDescriptions(o)}_unregisterDescriptionsForNotInSheetId(e,t){let n=this._definedNamesService.getDefinedNameMap(e);if(!n)return;let r=[];Array.from(Object.values(n)).forEach(e=>{let{name:n,localSheetId:i}=e;i!==`AllDefaultWorkbook`&&i!==t&&r.push(n)}),this._descriptionService.unregisterDescriptions(r)}};SQ=ZZ([XZ(0,bQ),XZ(1,rB),XZ(2,B),XZ(3,R)],SQ);var CQ=class extends P{constructor(e){super(),this._commandService=e,[spt,cpt,zz].forEach(e=>this._commandService.registerCommand(e))}};CQ=ZZ([XZ(0,R)],CQ);var wQ=class extends P{constructor(e,t,n,r){super(),this._descriptionService=e,this._univerInstanceService=t,this._commandService=n,this._superTableService=r,eQ(this,`_preUnitId`,null),this._initialize()}_initialize(){this._descriptionListener(),this._changeUnitListener(),this._changeSheetListener()}_descriptionListener(){Wf(this._superTableService.update$.subscribe(()=>{this._registerDescriptions()}))}_changeUnitListener(){Wf(this._univerInstanceService.getCurrentTypeOfUnit$(M.UNIVER_SHEET).subscribe(e=>{this._unRegisterDescriptions(),e&&this._registerDescriptions()}))}_changeSheetListener(){this.disposeWithMe(this._commandService.onCommandExecuted((e,t)=>{if(!t?.fromCollab){if(e.id===$K.id)this._unregisterDescriptionsForNotInSheetId(),this._registerDescriptions();else if(e.id===OB.id){let t=e.params;this._registerDescription(t)}else if(e.id===N6e.id){let t=e.params;this._unregisterDescription(t)}}}))}_registerDescription(e){let t=this._getUnitIdAndSheetId(e);if(!t)return;let{unitId:n}=t,{tableName:r,reference:i}=e;if(!this._descriptionService.hasDescription(r)){var a;let e=Uz(((a=this._univerInstanceService.getUnit(n))==null||(a=a.getSheetBySheetId(i.sheetId))==null?void 0:a.getName())||``,i.range);this._descriptionService.registerDescriptions([{functionName:r,description:e,abstract:e,functionType:q.Table,functionParameter:[]}])}}_unregisterDescription(e){let{tableName:t}=e;this._descriptionService.unregisterDescriptions([t])}_unRegisterDescriptions(){if(this._preUnitId==null)return;let e=this._superTableService.getTableMap(this._preUnitId);if(e==null)return;let t=[];e.forEach((e,n)=>{t.push(n)}),this._descriptionService.unregisterDescriptions(t),this._preUnitId=null}_getUnitIdAndSheetId(e={}){let{unitId:t,subUnitId:n}=e,r=t?this._univerInstanceService.getUnit(t,M.UNIVER_SHEET):this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET);if(!r)return null;let i=n?r.getSheetBySheetId(n):r.getActiveSheet(!0);return i?{unitId:r.getUnitId(),sheetId:i.getSheetId()}:null}_registerDescriptions(){let e=this._getUnitIdAndSheetId();if(!e)return;let{unitId:t}=e,n=this._superTableService.getTableMap(t);if(!n)return;let r=[];this._preUnitId=t,n.forEach((e,n)=>{var i;let a=Uz(((i=this._univerInstanceService.getUnit(t))==null||(i=i.getSheetBySheetId(e.sheetId))==null?void 0:i.getName())||``,e.range);this._descriptionService.hasDescription(n)||r.push({functionName:n,description:a,abstract:a,functionType:q.Table,functionParameter:[]})}),this._descriptionService.registerDescriptions(r)}_unregisterDescriptionsForNotInSheetId(){let e=this._getUnitIdAndSheetId();if(!e)return;let{unitId:t}=e,n=this._superTableService.getTableMap(t);if(!n)return;let r=[];n.forEach((e,t)=>{r.push(t)}),this._descriptionService.unregisterDescriptions(r)}};wQ=ZZ([XZ(0,bQ),XZ(1,B),XZ(2,R),XZ(3,DB)],wQ);function Fmt(e,t,n,r){let i=e.sequenceNodesBuilder(t);if(i==null)return t;let a=[];for(let e=0,t=i.length;e<t;e++){let t=i[e];if(typeof t==`string`||t.nodeType!==HB.REFERENCE)continue;let{token:o}=t,s=VB(o),{sheetName:c,unitId:l}=s,u=s.range;(u.startAbsoluteRefType!==vh.ALL||u.endAbsoluteRefType!==vh.ALL)&&(u=n_(u,n,r),a.push({unitId:l,sheetName:c,range:u}))}return a.map(e=>`${e.unitId}!${e.sheetName}!${e.range.startRow}!${e.range.endRow}!${e.range.startColumn}!${e.range.endColumn}`).join(`|`)}var TQ=class extends P{constructor(e,t,n,r){super(),this._refRangeService=e,this._lexerTreeBuilder=t,this._univerInstanceService=n,this._injector=r}transformFormulaByEffectCommand(e,t,n,r){let i=this._lexerTreeBuilder.sequenceNodesBuilder(n),a=this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET),o=a.getActiveSheet(),s=a.getUnitId(),c=o.getSheetId(),l=i?.map(n=>{if(typeof n==`object`&&n.nodeType===HB.REFERENCE){let{range:i,unitId:a,sheetName:o}=VB(n.token),l=this._univerInstanceService.getUnit(a||e),u=o?l?.getSheetBySheetName(o):l?.getSheetBySheetId(t);if(!u)throw Error(`Sheet not found`);let d=l.getUnitId(),f=u.getSheetId();if(d!==s||f!==c)return n;let p=DJ(i,r),m=``;if(p){let e=n_(i,p.startColumn-i.startColumn,p.startRow-i.startRow);m=a&&o?Wz(a,o,e):o?Uz(o,e):Hz(e)}else m=YR.REF;return{...n,token:m}}return n});return l?`=${UB(l)}`:``}registerFormula(e,t,n,r){let i=new Map,a=this._lexerTreeBuilder.sequenceNodesBuilder(n),o=new Gf,s=e=>{let t=this._univerInstanceService.getCurrentUnitOfType(M.UNIVER_SHEET),n=t.getActiveSheet(),o=t.getUnitId(),s=n.getSheetId(),c=a?.map(t=>{if(typeof t==`object`&&t.nodeType===HB.REFERENCE){let n=i.get(t.token);if(n.unitId!==o||n.subUnitId!==s)return t;let r=DJ(n.range,e),a=``;if(r){let e=r.startColumn-n.range.startColumn,t=r.startRow-n.range.startRow,i=n_(n.range,e,t);a=n.unitId&&n.sheetName?Wz(n.unitId,n.sheetName,i):n.sheetName?Uz(n.sheetName,i):Hz(i)}else a=YR.REF;return{...t,token:a}}return t});return r(`=${c&&UB(c)}`)};return a?.forEach(n=>{if(typeof n==`object`&&n.nodeType===HB.REFERENCE){let{range:r,unitId:a,sheetName:c}=VB(n.token),l=this._univerInstanceService.getUnit(a||e),u=c?l?.getSheetBySheetName(c):l?.getSheetBySheetId(t);if(!u)return;let d=l.getUnitId(),f=u.getSheetId(),p={unitId:d,subUnitId:f,range:r,sheetName:c};i.set(n.token,p),o.add(this._refRangeService.registerRefRange(r,s,d,f))}}),o}_getFormulaDependcy(e,t,n,r){let i=Uh(n)?this._lexerTreeBuilder.sequenceNodesBuilder(n):null,a=[];return i?.forEach(n=>{if(typeof n==`object`&&n.nodeType===HB.REFERENCE){let{range:i,unitId:o,sheetName:s}=VB(n.token);if(i.startAbsoluteRefType===vh.ALL&&i.endAbsoluteRefType===vh.ALL)return;let c=this._univerInstanceService.getUnit(o||e),l=s?c?.getSheetBySheetName(s):c?.getSheetBySheetId(t);if(!l)return;let u=c.getUnitId(),d=l.getSheetId(),f=r[0].startRow,p=r[0].startColumn,m=i.startRow,h=i.startColumn,g=r.map(e=>({startRow:e.startRow-f+m,endRow:e.endRow-f+m,startColumn:e.startColumn-p+h,endColumn:e.endColumn-p+h}));a.push({unitId:u,subUnitId:d,ranges:g})}}),a}registerRangeFormula(e,t,n,r,i){let a=new Gf,o=r.map(r=>this._getFormulaDependcy(e,t,r,n)),s=a=>{let s=cut(this._injector,a);if(!s)return{undos:[],redos:[]};let c=n[0].startRow,l=n[0].startColumn,u=[{unitId:e,subUnitId:t,ranges:n},...o.flat()],d=[];for(let{unitId:e,subUnitId:t,ranges:n}of u)if(e===s.unitId&&t===s.subUnitId){let e=[],t=n[0].startRow,r=n[0].startColumn,i=t-c,a=r-l;for(let t of s.ranges){let r=[];for(let e of n){let n=s_(t,e);n&&r.push(n)}r.length>0&&e.push(...r)}e.length>0&&d.push(e.map(e=>({startRow:e.startRow-i,endRow:e.endRow-i,startColumn:e.startColumn-a,endColumn:e.endColumn-a})))}if(d.length>0){let o=d_.splitIntoGrid([...d.flat()]),s=d_.subtractMulti(n,o);s.sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn);let u=new Map;for(let n=0;n<o.length;n++){let i=o[n],s=i.startRow,d=i.startColumn,f=s-c,p=d-l,m=OJ(i,a).sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn);if(!m.length)continue;let h=m[0].startRow,g=m[0].startColumn,_=h-c,v=g-l,y=[];for(let n=0;n<r.length;n++){let i=r[n],o=Uh(i),s=o?this._lexerTreeBuilder.moveFormulaRefOffset(i,p,f):i,c=o?this.transformFormulaByEffectCommand(e,t,s,a):s,l=Fmt(this._lexerTreeBuilder,c,-v,-_);y.push({newFormula:c,orginFormula:l})}let b={formulas:y,ranges:m,key:y.map(e=>e.orginFormula).join(`_`)};u.has(b.key)?u.get(b.key).push(b):u.set(b.key,[b])}let f=r.map(e=>Fmt(this._lexerTreeBuilder,e,0,0)).join(`_`);if(s.length>0){let e=s[0].startRow,t=s[0].startColumn,n=[];for(let i=0;i<r.length;i++){let a=r[i];n.push({newFormula:Uh(a)?this._lexerTreeBuilder.moveFormulaRefOffset(a,t-l,e-c):a,orginFormula:a})}let i={formulas:n,ranges:s,key:f};u.has(i.key)?u.get(i.key).push(i):u.set(i.key,[i])}let p=[],m=Array.from(u.keys());for(let e=m.length-1;e>=0;e--){let t=m[e],n=u.get(t).sort((e,t)=>e.ranges[0].startRow-t.ranges[0].startRow||e.ranges[0].startColumn-t.ranges[0].startColumn),r=[];for(let e=0;e<n[0].formulas.length;e++)r.push(n[0].formulas[e].newFormula);let i=d_.mergeRanges(n.map(e=>e.ranges).flat());i.sort((e,t)=>e.startRow-t.startRow||e.startColumn-t.startColumn),p.push({formulas:r,ranges:i})}return i(p)}return{undos:[],redos:[]}};return n.forEach(n=>{let r=this._refRangeService.registerRefRange(n,s,e,t);a.add(r)}),[...o.flat()].forEach(({unitId:e,subUnitId:t,ranges:n})=>{n.forEach(n=>{let r=this._refRangeService.registerRefRange(n,s,e,t);a.add(r)})}),a}};TQ=ZZ([XZ(0,j(kJ)),XZ(1,j(qB)),XZ(2,B),XZ(3,j(We))],TQ);var EQ=`sheets-formula.remote-register-function.service`,Imt=ce(EQ),DQ=class{constructor(e){this._functionService=e}async registerFunctions(e){let t=e.map(([e,t])=>Lmt(e,t));this._functionService.registerExecutors(...t)}async registerAsyncFunctions(e){let t=e.map(([e,t])=>Rmt(e,t));this._functionService.registerExecutors(...t)}async unregisterFunctions(e){this._functionService.unregisterExecutors(...e),this._functionService.unregisterDescriptions(...e),this._functionService.deleteFormulaAstCacheKey(...e)}};DQ=ZZ([XZ(0,qV)],DQ);function Lmt(e,t){let n=new lU(t);return n.calculateCustom=Function(`return ${e}`)(),n}function Rmt(e,t){let n=new c9e(t);return n.calculateCustom=Function(`return ${e}`)(),n}var OQ=ce(`sheets-formula.register-function-service`),kQ=class extends P{constructor(e,t,n,r){super(),this._localeService=e,this._descriptionService=t,this._functionService=n,this._remoteRegisterFunctionService=r}registerFunction(e){return this._registerSingleFunction(e)}registerAsyncFunction(e){return this._registerSingleFunction({...e,async:!0})}registerFunctions(e){let{locales:t,description:n,calculate:r}=e;t&&this._localeService.load(t);let i=new Gf,a=n??r.map(([e,t,n])=>({functionName:t,functionType:q.User,description:``,abstract:n||``,functionParameter:[]}));return i.add(this._descriptionService.registerDescriptions(a)),i.add(this._registerLocalExecutors(r)),this._remoteRegisterFunctionService&&i.add(this._registerRemoteExecutors(r)),i}_registerSingleFunction(e){let{name:t,func:n,description:r,locales:i,async:a=!1}=e,o=new Gf;if(i&&this._localeService.load(i),typeof r==`string`){let e={functionName:t,functionType:q.User,description:r,abstract:r||``,functionParameter:[]};o.add(this._descriptionService.registerDescriptions([e]))}else o.add(this._descriptionService.registerDescriptions([r]));let s=a?new c9e(t):new lU(t);return s.calculateCustom=n,this._functionService.registerExecutors(s),o.add(Wf(()=>this._functionService.unregisterExecutors(t))),o.add(Wf(()=>this._functionService.unregisterDescriptions(t))),o.add(Wf(()=>this._functionService.deleteFormulaAstCacheKey(t))),this._remoteRegisterFunctionService&&(this._remoteRegisterFunctionService.registerAsyncFunctions([[n.toString(),t]]),o.add(Wf(()=>this._remoteRegisterFunctionService.unregisterFunctions([t])))),o}_registerLocalExecutors(e){let t=e.map(([e,t])=>t),n=e.map(([e,t])=>{let n=new lU(t);return n.calculateCustom=e,n});return this._functionService.registerExecutors(...n),Wf(()=>this._functionService.unregisterExecutors(...t))}_registerRemoteExecutors(e){let t=[],n=e.map(([e,n])=>(t.push(n),[e.toString(),n]));return this._remoteRegisterFunctionService.registerFunctions(n),Wf(()=>this._remoteRegisterFunctionService.unregisterFunctions(t))}};kQ=ZZ([XZ(0,j(nx)),XZ(1,j(bQ)),XZ(2,qV),XZ(3,be(Imt))],kQ);var AQ=class extends dx{constructor(e=fpt,t,n){super(),this._config=e,this._injector=t,this._configService=n;let{...r}=Qi({},fpt,this._config);this._configService.setConfig(dpt,r)}onStarting(){this._injector.add([DQ]),this._injector.get(HR).registerChannel(EQ,BR(this._injector.get(DQ)))}};eQ(AQ,`pluginName`,`SHEET_FORMULA_REMOTE_PLUGIN`),eQ(AQ,`packageName`,gmt),eQ(AQ,`version`,_mt),eQ(AQ,`type`,M.UNIVER_SHEET),AQ=ZZ([px(UU),XZ(1,j(We)),XZ(2,Nm)],AQ);var jQ=class extends dx{constructor(e=upt,t,n){super(),this._config=e,this._injector=t,this._configService=n;let{...r}=Qi({},upt,this._config);this._configService.setConfig(YZ,r,{merge:!0})}onStarting(){let e=this._injector,t=[[OQ,{useClass:kQ}],[bQ,{useClass:xQ}],[tQ],[nQ],[CQ],[TQ],[vQ],[rQ],[aQ],[gQ],[_Q],[SQ],[hQ],[wQ],[QZ]];if(this._config.notExecuteFormula){let n=e.get(HR);t.push([Imt,{useFactory:()=>VR(n.requestChannel(EQ))}])}t.forEach(t=>e.add(t))}onReady(){ff(this._injector,[[CQ],[_Q],[vQ],[rQ],[gQ],[hQ],[QZ]]),op()&&ff(this._injector,[[aQ],[nQ]])}onRendered(){ff(this._injector,[[SQ],[wQ]]),op()||ff(this._injector,[[aQ],[nQ]])}};eQ(jQ,`pluginName`,vmt),eQ(jQ,`packageName`,gmt),eQ(jQ,`version`,_mt),eQ(jQ,`type`,M.UNIVER_SHEET),jQ=ZZ([px(WZ),XZ(1,j(We)),XZ(2,Nm)],jQ);var zmt=ce(`telemetry.service`);function MQ(e,t){if(e==null)return;let n=t.getRenderById(e);if(n==null)return;let{mainComponent:r,scene:i,engine:a,components:o}=n;return{document:r,docBackground:o.get(VJe.BACKGROUND),scene:i,engine:a}}function NQ(e){return e.getContextValue(Yy)}function PQ(e){return e.getContextValue(`FOCUSING_SHEET`)&&e.getContextValue(`FOCUSING_UNIVER_EDITOR`)&&!e.getContextValue(`EDITOR_ACTIVATED`)&&!e.getContextValue(`FOCUSING_COMMON_DRAWINGS`)}function FQ(e){return e.getContextValue(`FOCUSING_SHEET`)&&e.getContextValue(`FOCUSING_UNIVER_EDITOR`)&&!e.getContextValue(`FOCUSING_COMMON_DRAWINGS`)}function Bmt(e){return e.getContextValue(`FOCUSING_SHEET`)&&e.getContextValue(`FOCUSING_UNIVER_EDITOR`)&&!e.getContextValue(`EDITOR_ACTIVATED`)&&!e.getContextValue(`FOCUSING_FX_BAR_EDITOR`)&&!e.getContextValue(`FOCUSING_COMMON_DRAWINGS`)}function Vmt(e){return e.getContextValue(`FOCUSING_SHEET`)&&e.getContextValue(`FOCUSING_UNIVER_EDITOR`)&&e.getContextValue(`EDITOR_ACTIVATED`)}function IQ(e){return e.getContextValue(`FOCUSING_UNIVER_EDITOR`)&&e.getContextValue(`EDITOR_ACTIVATED`)}function LQ(e){return e.getContextValue(`FOCUSING_FX_BAR_EDITOR`)&&e.getContextValue(`FOCUSING_UNIVER_EDITOR`)}function RQ(e){return e.getContextValue(`FOCUSING_SHEET`)&&e.getContextValue(`FOCUSING_UNIVER_EDITOR`)&&e.getContextValue(`EDITOR_ACTIVATED`)&&!e.getContextValue(`FOCUSING_EDITOR_INPUT_FORMULA`)&&!e.getContextValue(`FOCUSING_EDITOR_INPUT_FORMULA`)}function zQ(e){let t=[],n=[],r=[];return e.forEach(e=>{t=t.concat(e.rows),n=n.concat(e.cols)}),t=Array.from(new Set(t)).sort((e,t)=>e-t),n=Array.from(new Set(n)).sort((e,t)=>e-t),e.forEach(e=>{r.push({startRow:t.findIndex(t=>t===e.rows[0]),endRow:t.findIndex(t=>t===e.rows[e.rows.length-1]),startColumn:n.findIndex(t=>t===e.cols[0]),endColumn:n.findIndex(t=>t===e.cols[e.cols.length-1])})}),{ranges:r,mapFunc:(e,r)=>({row:t[e],col:n[r]})}}var BQ=Cf(`rangeMovePermissionCheck`),VQ=Cf(`rangeFillPermissionCheck`),Hmt=function(e){return e[e.FORMULA_EDITOR_SHOW=100]=`FORMULA_EDITOR_SHOW`,e[e.MARK_SELECTION=1e4]=`MARK_SELECTION`,e}({});function HQ(e){let t=e.getColorFromTheme(`primary.600`),n=e.getColorFromTheme(`white`),r=new rh(t).setAlpha(.07).toRgbString();return{strokeWidth:1,stroke:t,fill:r,widgets:{},widgetSize:6,widgetStrokeWidth:1,widgetStroke:n,autofillSize:6,autofillStrokeWidth:1,autofillStroke:n,rowHeaderFill:r,rowHeaderStroke:t,rowHeaderStrokeWidth:1,columnHeaderFill:r,columnHeaderStroke:t,columnHeaderStrokeWidth:1,expandCornerSize:40}}var UQ=[10,400],WQ=`RANGE_SELECTOR_COMPONENT_KEY`,GQ=`EMBEDDING_FORMULA_EDITOR_COMPONENT_KEY`,KQ=function(e){return e.MAIN=`__SpreadsheetRender__`,e.ROW=`__SpreadsheetRowHeader__`,e.COLUMN=`__SpreadsheetColumnHeader__`,e.LEFT_TOP=`__SpreadsheetLeftTopPlaceholder__`,e}({});function qQ(e){"@babel/helpers - typeof";return qQ=typeof Symbol==`function`&&typeof Symbol.iterator==`symbol`?function(e){return typeof e}:function(e){return e&&typeof Symbol==`function`&&e.constructor===Symbol&&e!==Symbol.prototype?`symbol`:typeof e},qQ(e)}function Umt(e,t){if(qQ(e)!=`object`||!e)return e;var n=e[Symbol.toPrimitive];if(n!==void 0){var r=n.call(e,t||`default`);if(qQ(r)!=`object`)return r;throw TypeError(`@@toPrimitive must return a primitive value.`)}return(t===`string`?String:Number)(e)}function Wmt(e){var t=Umt(e,`string`);return qQ(t)==`symbol`?t:t+``}function Q(e,t,n){return(t=Wmt(t))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var Gmt=class{constructor(){Q(this,`_startColumn`,-1),Q(this,`_startRow`,-1),Q(this,`_endColumn`,-1),Q(this,`_endRow`,-1),Q(this,`_startX`,0),Q(this,`_startY`,0),Q(this,`_endX`,0),Q(this,`_endY`,0),Q(this,`_primary`,void 0),Q(this,`_rangeType`,z.NORMAL)}get startColumn(){return this._startColumn}get startRow(){return this._startRow}get endColumn(){return this._endColumn}get endRow(){return this._endRow}get startX(){return this._startX}get startY(){return this._startY}get endX(){return this._endX}get endY(){return this._endY}get currentCell(){return this._primary}get rangeType(){return this._rangeType}isEqual(e){let{startColumn:t,startRow:n,endColumn:r,endRow:i}=this,{startColumn:a,startRow:o,endColumn:s,endRow:c}=e;return t===a&&n===o&&r===s&&i===c}highlightToSelection(){if(this._primary)return zh(this._primary)}getRange(){return{startColumn:this._startColumn,startRow:this._startRow,endColumn:this._endColumn,endRow:this._endRow,startX:this._startX,startY:this._startY,endX:this._endX,endY:this._endY,rangeType:this.rangeType}}getCell(){return this._primary}getRangeType(){return this._rangeType}setRangeType(e){this._rangeType=e}getValue(){return{rangeWithCoord:this.getRange(),primaryWithCoord:this._primary}}setValue(e,t){let{startColumn:n,startRow:r,endColumn:i,endRow:a,startX:o,startY:s,endX:c,endY:l,rangeType:u}=e;this._startColumn=n,this._startRow=r,this._endColumn=i,this._endRow=a,this._startX=o,this._startY=s,this._endX=c,this._endY=l,u!==void 0&&(this._rangeType=u),t!==void 0&&this.setCurrentCell(t)}setCurrentCell(e){this._primary=e}clearCurrentCell(){this._primary=null}},JQ={id:`sheet.command.set-row-header-width`,type:L.COMMAND,handler:async(e,t)=>{if(!t)return!1;let n=e.get(ZE);if(!n)return!1;let{unitId:r,subUnitId:i,size:a}=t,o=n.getRenderById(r);if(o){n.getRenderById(r).with(t$).setRowHeaderSize(o,i,a);let{components:e}=o,t=e.get(`__SpreadsheetRowHeader__`);t&&t.setCustomHeader({headerStyle:{size:a}},i)}return!0}},YQ={id:`sheet.command.set-col-header-height`,type:L.COMMAND,handler:async(e,t)=>{if(!t)return!1;let n=e.get(ZE);if(!n)return!1;let{unitId:r,subUnitId:i,size:a}=t,o=n.getRenderById(r);if(o){n.getRenderById(r).with(t$).setColumnHeaderSize(o,i,a);let{components:e}=o,t=e.get(`__SpreadsheetColumnHeader__`);t&&t.setCustomHeader({headerStyle:{size:a}},i)}return!0}},Kmt=class extends BE{render(e,t=!1){let n=F.now();return super.render(e,t),this._afterRender(n),this}_afterRender(e){this.scene.getEngine().renderFrameTimeMetric$.next([`selectionLayer`,F.now()-e])}},XQ=ce(`univer.sheet.selection-render-service`),ZQ=class extends P{get selectionMoving(){return this._selectionMoving}constructor(e,t,n,r,i){super(),this._injector=e,this._themeService=t,this._shortcutService=n,this._sheetSkeletonManagerService=r,this.contextService=i,Q(this,`_downObserver`,void 0),Q(this,`_scenePointerMoveSub`,void 0),Q(this,`_scenePointerUpSub`,void 0),Q(this,`_controlFillConfig$`,new so(null)),Q(this,`controlFillConfig$`,this._controlFillConfig$.asObservable()),Q(this,`_selectionControls`,[]),Q(this,`_startRangeWhenPointerDown`,{startY:0,endY:0,startX:0,endX:0,startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}),Q(this,`_activeControlIndex`,-1),Q(this,`_startViewportPosX`,0),Q(this,`_startViewportPosY`,0),Q(this,`_scrollTimer`,void 0),Q(this,`_cancelDownSubscription`,void 0),Q(this,`_cancelUpSubscription`,void 0),Q(this,`_skeleton`,void 0),Q(this,`_scene`,void 0),Q(this,`_highlightHeader`,!0),Q(this,`_rangeType`,z.NORMAL),Q(this,`_selectionStyle`,void 0),Q(this,`_remainLastEnabled`,!1),Q(this,`_skipLastEnabled`,!1),Q(this,`_singleSelectionEnabled`,!1),Q(this,`_selectionMoveEnd$`,new so([])),Q(this,`selectionMoveEnd$`,this._selectionMoveEnd$.asObservable()),Q(this,`_selectionMoving$`,new ao),Q(this,`selectionMoving$`,this._selectionMoving$.asObservable()),Q(this,`_selectionMoveStart$`,new ao),Q(this,`selectionMoveStart$`,this._selectionMoveStart$.asObservable()),Q(this,`_selectionMoving`,!1),Q(this,`_selectionTheme`,void 0),Q(this,`_activeViewport`,void 0),Q(this,`interceptor`,new Tf({RANGE_MOVE_PERMISSION_CHECK:BQ,RANGE_FILL_PERMISSION_CHECK:VQ})),Q(this,`_escapeShortcutDisposable`,null),this._initSelectionThemeFromThemeService(),this._initMoving()}get _shouldDetectMergedCells(){return this._rangeType===z.NORMAL}_initMoving(){this.disposeWithMe(this._selectionMoving$.subscribe(()=>{this._selectionMoving=!0})),this.disposeWithMe(this._selectionMoveEnd$.subscribe(()=>{this._selectionMoving=!1}))}_setSelectionStyle(e){this._selectionStyle=e}getViewPort(){return this._activeViewport}setSingleSelectionEnabled(e=!1){this._singleSelectionEnabled=e}newSelectionControl(e,t,n){let r=this.getSelectionControls().length,{rowHeaderWidth:i,rowHeaderWidthAndMarginLeft:a,columnHeaderHeight:o,columnHeaderHeightAndMarginTop:s}=t,c=new n$(e,r,this._selectionTheme,{highlightHeader:this._highlightHeader,rowHeaderWidth:i,columnHeaderHeight:o,rowHeaderOffsetX:Math.max(0,a-i),columnHeaderOffsetY:Math.max(0,s-o)});this._selectionControls.push(c);let l=qZ(n,t);return c.updateRangeBySelectionWithCoord(l,t),c.setControlExtension({skeleton:t,scene:e,themeService:this._selectionTheme,injector:this._injector,selectionHooks:{selectionMoveEnd:()=>{this._selectionMoveEnd$.next(this.getSelectionDataWithStyle())}}}),c}resetSelectionsByModelData(e){let t=this.getSelectionControls(),n=this._skeleton;if(t&&n){for(let r=0,i=e.length;r<i;r++){let i=e[r],a=qZ(i,this._skeleton),o=t[r];o?o.updateRangeBySelectionWithCoord(a,n):this.isSelectionEnabled()&&this.newSelectionControl(this._scene,n,i)}e.length<t.length&&t.splice(e.length).forEach(e=>e.dispose())}}refreshSelectionMoveStart(){this._selectionMoveStart$.next(this.getSelectionDataWithStyle())}refreshSelectionMoveEnd(){this._selectionMoveEnd$.next(this.getSelectionDataWithStyle())}_initSelectionThemeFromThemeService(){let e=this._themeService.getCurrentTheme();this._selectionTheme=new _x,this._selectionTheme.setTheme(e)}setSelectionTheme(e){this._selectionTheme.setTheme(e)}_changeRuntime(e,t,n){this._skeleton=e,this._scene=t,this._activeViewport=n||t?.getViewports()[0],t.findLayerByZIndex(1)||t.addLayer(new Kmt(t,[],1))}getSkeleton(){return this._skeleton}getSelectionDataWithStyle(){let e=this._selectionControls;if(this._skeleton.worksheet){let[t,n]=this._skeleton.getLocation();return e.map(e=>{let r=e.getValue();return r.rangeWithCoord.sheetId=n,r.rangeWithCoord.unitId=t,r})}return[]}getSelectionControls(){return this._selectionControls}_addSelectionControlByModelData(e){let t=this._skeleton,n=e.style??HQ(this._selectionTheme),r=this._scene;return e.style=n,this.newSelectionControl(r,t,e)}_clearAllSelectionControls(){let e=this._selectionControls;for(let t of e)t.dispose();this._selectionControls.length=0}_getFreeze(){return this._sheetSkeletonManagerService.getCurrentParam()?.skeleton.getWorksheetConfig().freeze}_getViewportByCell(e,t){if(e===void 0||t===void 0)return null;let n=this._getFreeze();if(!n||n.startRow<=0&&n.startColumn<=0||e>n.startRow&&t>n.startColumn)return this._scene.getViewport(lT.VIEW_MAIN);if(e<=n.startRow&&t<=n.startColumn)return this._scene.getViewport(lT.VIEW_MAIN_LEFT_TOP);if(e<=n.startRow&&t>n.startColumn)return this._scene.getViewport(lT.VIEW_MAIN_TOP);if(e>n.startRow&&t<=n.startColumn)return this._scene.getViewport(lT.VIEW_MAIN_LEFT)}getActiveRange(){let e=this.getSelectionControls(),t=e&&e[e.length-1].model;return t&&{startRow:t.startRow,startColumn:t.startColumn,endRow:t.endRow,endColumn:t.endColumn}}setActiveSelectionIndex(e){this._activeControlIndex=e}resetActiveSelectionIndex(){this._activeControlIndex=-1}getActiveSelectionControl(){let e=this.getSelectionControls();if(e)return this._activeControlIndex<0?e[e.length-1]:e[this._activeControlIndex]}endSelection(){var e;this._clearUpdatingListeners(),this._selectionMoveEnd$.next(this.getSelectionDataWithStyle()),(e=this._escapeShortcutDisposable)==null||e.dispose(),this._escapeShortcutDisposable=null}_reset(){var e;this._clearAllSelectionControls(),(e=this._downObserver)==null||e.unsubscribe(),this._downObserver=null}_setupPointerMoveListener(e,t,n,r=GE.ALL,i,a){let o=0,s=0,c=i,l=a;this._scrollTimer=KE.create(this._scene,r),this._scrollTimer.startScroll(e?.left??0,e?.top??0,e);let u=this._scene,d=u.getActiveViewportByCoord(Hw.FromArray([i,a]));this._scenePointerMoveSub=u.onPointerMove$.subscribeEvent(r=>{let{offsetX:i,offsetY:a}=r,{x:f,y:p}=u.getCoordRelativeToViewport(Hw.FromArray([i,a]));this._movingHandler(f,p,t,n);let m=f,h=p,g=this.getActiveSelectionControl(),_=this._getFreeze(),v=g?.model,y=u.getActiveViewportByCoord(Hw.FromArray([i,a]))??this._getViewportByCell(v?.endRow,v?.endColumn);if((()=>{if(!d||!y||!e)return!1;let t=[lT.VIEW_MAIN,lT.VIEW_MAIN_LEFT_TOP,lT.VIEW_MAIN_TOP,lT.VIEW_MAIN_LEFT];return t.includes(d.viewportKey)&&t.includes(y.viewportKey)})()){if(!d||!y||!e)return!1;let t=c<e.left&&f>e.left||c>e.left&&f<e.left,n=l<e.top&&p>e.top||l>e.top&&p<e.top;t&&(o+=1),n&&(s+=1);let r=d.viewportKey,u=y.viewportKey;if(r===lT.VIEW_ROW_TOP)a<e.top&&(v?.endRow??0)<(_?.startRow??0)?h=e.top:n&&s%2==1&&e.scrollToViewportPos({viewportScrollY:0});else if(r===lT.VIEW_COLUMN_LEFT)i<e.left&&(v?.endColumn??0)<(_?.startColumn??0)?m=e.left:t&&o%2==1&&e.scrollToViewportPos({viewportScrollX:0});else if(r===u){let t=!1,n=!1;r===lT.VIEW_MAIN_LEFT_TOP?(t=!0,n=!0):r===lT.VIEW_MAIN_TOP?n=!0:r===lT.VIEW_MAIN_LEFT&&(t=!0),(v?.endRow??0)>(_?.startRow??0)&&(n=!1),(v?.endColumn??0)>(_?.startColumn??0)&&(t=!1),t&&(m=e.left),n&&(h=e.top)}else{let i={x:d.scrollX,y:d.scrollY},a={x:y.scrollX,y:y.scrollY},c=i.x!==a.x&&t&&o%2==1,l=i.y!==a.y&&n&&s%2==1;(c||l)&&(e.scrollToBarPos({x:c?i.x:void 0,y:l?i.y:void 0}),c||(m=e.left),l||(h=e.top)),(r===lT.VIEW_MAIN_LEFT_TOP&&u===lT.VIEW_MAIN_LEFT||u===lT.VIEW_MAIN_LEFT_TOP&&r===lT.VIEW_MAIN_LEFT)&&(m=e.left),(r===lT.VIEW_MAIN_LEFT_TOP&&u===lT.VIEW_MAIN_TOP||u===lT.VIEW_MAIN_LEFT_TOP&&r===lT.VIEW_MAIN_TOP)&&(h=e.top)}c=f,l=p}this._scrollTimer.scrolling(m,h,()=>{this._movingHandler(f,p,t,n)})})}getSelectionCellByPosition(e,t){return this.getCellWithCoordByOffset(e,t)}getCellWithCoordByOffset(e,t,n){let r=this._scene,i=n??this._skeleton,a=r.getViewportScrollXY(r.getViewport(lT.VIEW_MAIN)),{scaleX:o,scaleY:s}=r.getAncestorScale();return i.getCellWithCoordByOffset(e-a.x,t-a.y,o,s,a)}_movingHandler(e,t,n,r){let i=this._skeleton,a=this._scene,[o,s]=i.getLocation(),c={startRow:n?.model.startRow??-1,endRow:n?.model.endRow??-1,startColumn:n?.model.startColumn??-1,endColumn:n?.model.endColumn??-1,unitId:o,sheetId:s},l=a.getViewport(lT.VIEW_MAIN),u=this._getViewportByCell(c.endRow,c.endColumn)??l,d=a.getScrollXYInfoByViewport(Hw.FromArray([this._startViewportPosX,this._startViewportPosY]),u),{scaleX:f,scaleY:p}=a.getAncestorScale();r===z.ROW?e=1/0:r===z.COLUMN&&(t=1/0);let m=this._skeleton.getCellByOffset(e,t,f,p,d);if(!m)return;let h={startRow:Math.min(m.startRow,this._startRangeWhenPointerDown.startRow),startColumn:Math.min(m.startColumn,this._startRangeWhenPointerDown.startColumn),endRow:Math.max(m.endRow,this._startRangeWhenPointerDown.endRow),endColumn:Math.max(m.endColumn,this._startRangeWhenPointerDown.endColumn)};this._shouldDetectMergedCells&&(h=i.expandRangeByMerge(h,this.inRefSelectionMode()));let g=qZ({range:h,primary:void 0,style:null},i);g.rangeWithCoord.unitId=o,g.rangeWithCoord.sheetId=s,g.rangeWithCoord.rangeType=r;let _=c.startRow!==h.startRow||c.startColumn!==h.startColumn||c.endRow!==h.endRow||c.endColumn!==h.endColumn;n!=null&&_&&(n.updateRangeBySelectionWithCoord(g),this._selectionMoving$.next(this.getSelectionDataWithStyle()))}_clearUpdatingListeners(){var e,t,n,r,i;this._scene.enableObjectsEvent(),(e=this._scenePointerMoveSub)==null||e.unsubscribe(),this._scenePointerMoveSub=null,(t=this._scenePointerUpSub)==null||t.unsubscribe(),this._scenePointerUpSub=null,(n=this._cancelDownSubscription)==null||n.unsubscribe(),this._cancelDownSubscription=null,(r=this._cancelUpSubscription)==null||r.unsubscribe(),this._cancelUpSubscription=null,(i=this._scrollTimer)==null||i.dispose()}_addEndingListeners(){var e,t;let n=this._scene,r=n.getEngine()?.activeScene;r&&r!==n&&((e=this._cancelDownSubscription)==null||e.unsubscribe(),this._cancelDownSubscription=null,(t=this._cancelUpSubscription)==null||t.unsubscribe(),this._cancelUpSubscription=null,this._cancelDownSubscription=r.onPointerDown$.subscribeEvent(()=>this._clearUpdatingListeners()),this._cancelUpSubscription=r.onPointerUp$.subscribeEvent(()=>this._clearUpdatingListeners()))}_getSelectionWithCoordByOffset(e,t,n,r,i){let a=this._skeleton;if(a==null)return null;if(this._shouldDetectMergedCells){let o=a?.getCellWithCoordByOffset(e,t,n,r,i,{firstMatch:!0});return o?{primaryWithCoord:o,rangeWithCoord:zh(o)}:void 0}let{row:o,column:s}=a.getCellIndexByOffset(e,t,n,r,i),{startX:c,startY:l,endX:u,endY:d}=a.getNoMergeCellWithCoordByIndex(o,s),f={startY:l,endY:d,startX:c,endX:u,startRow:o,endRow:o,startColumn:s,endColumn:s};return{primaryWithCoord:{mergeInfo:f,actualRow:o,actualColumn:s,isMerged:!1,isMergedMainCell:!1,startY:l,endY:d,startX:c,endX:u},rangeWithCoord:f}}_checkClearPreviousControls(e){this.getSelectionControls().length!==0&&(!e.ctrlKey&&!e.shiftKey&&!this._remainLastEnabled||this._singleSelectionEnabled&&!e.shiftKey)&&this._clearAllSelectionControls()}_makeSelectionByTwoCells(e,t,n,r,i){let{actualRow:a,actualColumn:o,mergeInfo:s}=e;this._startRangeWhenPointerDown={...e.mergeInfo};let c=Math.min(a,t.startRow,s.startRow),l=Math.max(a,t.endRow,s.endRow),u=Math.min(o,t.startColumn,s.startColumn),d=Math.max(o,t.endColumn,s.endColumn),f=qZ({range:n.expandRangeByMerge({startRow:c,startColumn:u,endRow:l,endColumn:d}),primary:cq(e),style:null},n);i.updateRangeBySelectionWithCoord(f)}isSelectionEnabled(){return this.contextService.getContextValue(bq)}isSelectionDisabled(){return this.contextService.getContextValue(bq)===!1}inRefSelectionMode(){return this.contextService.getContextValue(xq)}};function QQ(e){return{range:{startRow:0,startColumn:0,endRow:e.getRowCount()-1,endColumn:e.getColumnCount()-1,rangeType:z.ALL},primary:$Q(e).primary,style:null}}function $Q(e){return qmt(e,{startRow:0,startColumn:0,endRow:0,endColumn:0})}function qmt(e,t){let n=e.worksheet.getCellInfoInMergeData(t.startRow,t.startColumn),r=e.worksheet.getCellInfoInMergeData(t.endRow,t.endColumn);return{range:{startRow:n.startRow,startColumn:n.startColumn,endRow:r.endRow,endColumn:r.endColumn,rangeType:z.NORMAL},primary:{actualRow:n.startRow,actualColumn:n.startColumn,startRow:n.startRow,startColumn:n.startColumn,endRow:n.endRow,endColumn:n.endColumn,isMerged:n.isMerged,isMergedMainCell:n.isMergedMainCell},style:null}}function $(e,t){return function(n,r){t(n,r,e)}}function e$(e,t,n,r){var i=arguments.length,a=i<3?t:r===null?r=Object.getOwnPropertyDescriptor(t,n):r,o;if(typeof Reflect==`object`&&typeof Reflect.decorate==`function`)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a}var t$=class extends P{constructor(e,t){super(),this._context=e,this._sheetSkeletonService=t,Q(this,`_sheetId`,``),Q(this,`_currentSkeleton$`,new so(null)),Q(this,`currentSkeleton$`,this._currentSkeleton$.asObservable()),Q(this,`_currentSkeletonBefore$`,new so(null)),Q(this,`currentSkeletonBefore$`,this._currentSkeletonBefore$.asObservable());let{unitId:n,scene:r}=this._context;this._sheetSkeletonService.setScene(n,r),this._initSkeletonsRegisterGetCellHeight(n)}_initSkeletonsRegisterGetCellHeight(e){this._sheetSkeletonService.getSkeletonsByUnitId(e).forEach(e=>e.registerGetCellHeight()),this.disposeWithMe(this._sheetSkeletonService.buildSkeleton$.subscribe(e=>e.registerGetCellHeight()))}dispose(){super.dispose(),this._currentSkeletonBefore$.complete(),this._currentSkeleton$.complete()}getCurrentSkeleton(){return this.getCurrentParam()?.skeleton}getCurrentParam(){return this._getSkeletonParam(this._sheetId)}getSkeleton(e){return this._getSkeleton(e)}getSkeletonParam(e){return this._getSkeletonParam(e)}setCurrent(e){this._setCurrent(e.sheetId)}_setCurrent(e){this._sheetId=e;let t=this._getSkeletonParam(e);if(t)this.reCalculate(t);else{let n=this._context.unit,r=n.getSheetBySheetId(e),i=this._context.unitId;if(!r)return;t=this._sheetSkeletonService.newSkeletonParam(i,e,r,n.getStyles())}this._currentSkeletonBefore$.next(t),this._currentSkeleton$.next(t)}reCalculate(e){let t=e||this.getCurrentParam();t&&(t.dirty&&=(t.skeleton.makeDirty(!0),!1),t.skeleton.calculate())}makeDirty(e,t=!0){let n=this._getSkeletonParam(e.sheetId);n!=null&&(n.dirty=t)}ensureSkeleton(e){return this._sheetSkeletonService.ensureSkeleton(this._context.unitId,e)}_getSkeletonParam(e){return this._sheetSkeletonService.getSkeletonParam(this._context.unitId,e)}_getSkeleton(e){return this._sheetSkeletonService.getSkeleton(this._context.unitId,e)}setColumnHeaderSize(e,t,n){if(!e)return;let r=this.getSkeleton(t);if(!r)return;r.columnHeaderHeight=n,e.scene.getViewports()[0].top=n,e.scene.getViewport(lT.VIEW_COLUMN_RIGHT).setViewportSize({height:n}),e.scene.getViewport(lT.VIEW_COLUMN_LEFT).setViewportSize({height:n}),e.scene.getViewport(lT.VIEW_ROW_BOTTOM).setViewportSize({top:n}),e.scene.getViewport(lT.VIEW_ROW_TOP).setViewportSize({top:n}),e.scene.getViewport(lT.VIEW_LEFT_TOP).setViewportSize({height:n});let i=e?.with(yq),a=e?.with(XQ),o=i.getCurrentSelections();a.resetSelectionsByModelData(o);let s=this._sheetSkeletonService.getSkeletonParam(e.unitId,t);s&&(s.commandId=YQ.id,this._currentSkeleton$.next(s))}setRowHeaderSize(e,t,n){if(!e)return;let r=this.getSkeleton(t);if(!r)return;r.rowHeaderWidth=n;let i=n-(e.scene.getViewport(lT.VIEW_LEFT_TOP).width||46),a=e.scene.getViewports()[0].left;e.scene.getViewports()[0].left=a+i,e.scene.getViewport(lT.VIEW_ROW_BOTTOM).setViewportSize({width:n}),e.scene.getViewport(lT.VIEW_ROW_TOP).setViewportSize({width:n}),e.scene.getViewport(lT.VIEW_COLUMN_LEFT).setViewportSize({left:n});let o=e.scene.getViewport(lT.VIEW_COLUMN_RIGHT).left||0;e.scene.getViewport(lT.VIEW_COLUMN_RIGHT).setViewportSize({left:o+i}),e.scene.getViewport(lT.VIEW_LEFT_TOP).setViewportSize({width:n});let s=e?.with(yq),c=e?.with(XQ),l=s.getCurrentSelections();c.resetSelectionsByModelData(l);let u=this._sheetSkeletonService.getSkeletonParam(e.unitId,t);u&&(u.commandId=JQ.id,this._currentSkeleton$.next(u))}};t$=e$([$(1,j(Sq))],t$);var Jmt=`__SpreadsheetHelperSelectionTempRect`,Ymt=35,Xmt=class{constructor(e,t){this._control=e,Q(this,`_startOffsetX`,0),Q(this,`_startOffsetY`,0),Q(this,`_relativeSelectionPositionRow`,0),Q(this,`_relativeSelectionPositionColumn`,0),Q(this,`_relativeSelectionRowLength`,0),Q(this,`_relativeSelectionColumnLength`,0),Q(this,`_scenePointerMoveSub`,void 0),Q(this,`_scenePointerUpSub`,void 0),Q(this,`_disabled`,!1),Q(this,`_helperSelection`,void 0),Q(this,`_scrollTimer`,void 0),Q(this,`_activeViewport`,void 0),Q(this,`_targetSelection`,{startY:0,endY:0,startX:0,endX:0,startRow:-1,endRow:-1,startColumn:-1,endColumn:-1}),Q(this,`_isInMergeState`,!1),Q(this,`_fillControlColors`,[]),Q(this,`_skeleton`,void 0),Q(this,`_scene`,void 0),Q(this,`_themeService`,void 0),Q(this,`_injector`,void 0),Q(this,`_selectionHooks`,void 0),this._skeleton=t.skeleton,this._scene=t.scene,this._themeService=t.themeService,this._injector=t.injector,this._selectionHooks=t.selectionHooks,this._initialControl(),this._initialWidget(),this._initialAutoFill(),this._control.dispose$.subscribe(()=>{this.dispose()})}get isHelperSelection(){return this._control.isHelperSelection}dispose(){var e,t;(e=this._scrollTimer)==null||e.dispose(),this._fillControlColors=[],this._clearObserverEvent(),(t=this._helperSelection)==null||t.dispose()}setDisabled(e){this._disabled=e}_getFreeze(){var e;return(e=$E(M.UNIVER_SHEET,t$,this._injector.get(B),this._injector.get(ZE)))==null||(e=e.getCurrentParam())==null?void 0:e.skeleton.getWorksheetConfig().freeze}_isSelectionInViewport(e,t){let n=this._getFreeze()||{startRow:-1,startColumn:-1,xSplit:0,ySplit:0};switch(t.viewportKey){case lT.VIEW_MAIN:return e.endRow>=n.startRow&&e.endColumn>=n.startColumn;case lT.VIEW_MAIN_TOP:case lT.VIEW_COLUMN_RIGHT:return e.endColumn>=n.startColumn&&e.startRow<n.startRow;case lT.VIEW_MAIN_LEFT:case lT.VIEW_ROW_BOTTOM:return e.endRow>=n.startRow&&e.startColumn<n.startColumn;case lT.VIEW_MAIN_LEFT_TOP:case lT.VIEW_COLUMN_LEFT:case lT.VIEW_ROW_TOP:case lT.VIEW_LEFT_TOP:return e.startRow<n.startRow&&e.startColumn<n.startColumn}}_clearObserverEvent(){var e,t;(e=this._scenePointerMoveSub)==null||e.unsubscribe(),(t=this._scenePointerUpSub)==null||t.unsubscribe(),this._scenePointerMoveSub=null,this._scenePointerUpSub=null}_initialControl(){let{leftControl:e,rightControl:t,topControl:n,bottomControl:r}=this._control;[e,t,n,r].forEach(e=>{e.onPointerEnter$.subscribeEvent(()=>{this._injector.get(XQ,D.OPTIONAL)?.interceptor.fetchThroughInterceptors(BQ)(!1,null)!==!1&&e.setCursor(_w.MOVE)}),e.onPointerLeave$.subscribeEvent(()=>{e.resetCursor()}),e.onPointerDown$.subscribeEvent(this._controlPointerDownHandler.bind(this))})}_controlMoving(e,t){var n;let r=this._scene,i=r.getScrollXYInfoByViewport(Hw.FromArray([e,t])),{scaleX:a,scaleY:o}=r.getAncestorScale(),{row:s,column:c}=this._skeleton.getCellIndexByOffset(e,t,a,o,i),l=this._skeleton.getRowCount()-1,u=this._skeleton.getColumnCount()-1,d=Math.max(0,s+this._relativeSelectionPositionRow),f=d+this._relativeSelectionRowLength;f>l&&(f=l,f-d<this._relativeSelectionRowLength&&(d=f-this._relativeSelectionRowLength));let p=Math.max(0,c+this._relativeSelectionPositionColumn),m=p+this._relativeSelectionColumnLength;m>u&&(m=u,m-p<this._relativeSelectionColumnLength&&(p=m-this._relativeSelectionColumnLength));let h=this._skeleton.worksheet.getCellInfoInMergeData(d,p),g=qZ({range:{startRow:d,endRow:f,startColumn:p,endColumn:m},primary:h,style:null},this._skeleton),_=this._skeleton.getNoMergeCellWithCoordByIndex(d,p),v=this._skeleton.getNoMergeCellWithCoordByIndex(f,m),y=_?.startY||0,b=v?.endY||0,x=_?.startX||0,S=v?.endX||0;(n=this._helperSelection)==null||n.transformByState({left:x,top:y,width:S-x,height:b-y}),this._targetSelection={...g.rangeWithCoord},this._control.selectionMoving$.next(g.rangeWithCoord)}_controlPointerDownHandler(e){let{offsetX:t,offsetY:n}=e,r=this._scene,i=r.getCoordRelativeToViewport(Hw.FromArray([t,n])),{x:a,y:o}=i,s=r.getScrollXYInfoByViewport(i),{scaleX:c,scaleY:l}=r.getAncestorScale(),u=this._skeleton.getCellIndexByOffset(a,o,c,l,s);this._startOffsetX=a,this._startOffsetY=o;let{row:d,column:f}=u,{startRow:p,startColumn:m,endRow:h,endColumn:g}=this._control.model,_=0,v=0;d<p?--_:d>h&&(_+=1),f<m?--v:f>g&&(v+=1),this._relativeSelectionPositionRow=p-d+_,this._relativeSelectionPositionColumn=m-f+v,this._relativeSelectionRowLength=h-p,this._relativeSelectionColumnLength=g-m;let y=this._control.currentStyle,b=this._getScale();this.isHelperSelection&&(this._helperSelection=new NE(Jmt,{stroke:y.stroke,strokeWidth:y.strokeWidth/b}),r.addObject(this._helperSelection));let x=r.getViewport(lT.VIEW_MAIN),S=KE.create(r);this._scrollTimer=S,S.startScroll(a,o,x),r.disableObjectsEvent(),this._scenePointerMoveSub=r.onPointerMove$.subscribeEvent(e=>{if(this._disabled)return;let{offsetX:t,offsetY:n}=e;if(this._injector.get(XQ,D.OPTIONAL)?.interceptor.fetchThroughInterceptors(BQ)(!1,null)===!1)return;let{x:i,y:a}=r.getCoordRelativeToViewport(Hw.FromArray([t,n]));this._controlMoving(i,a),r.setCursor(_w.MOVE),S.scrolling(i,a,()=>{this._controlMoving(i,a)})}),this._scenePointerUpSub=r.onPointerUp$.subscribeEvent(()=>{var e,t,n,r;(e=this._helperSelection)==null||e.dispose();let i=this._scene;i.resetCursor(),this._clearObserverEvent(),i.enableObjectsEvent(),(t=this._scrollTimer)==null||t.dispose(),this._control.selectionMoveEnd$.next(this._targetSelection),(n=(r=this._selectionHooks).selectionMoveEnd)==null||n.call(r)})}_initialWidget(){let{topLeftWidget:e,topCenterWidget:t,topRightWidget:n,middleLeftWidget:r,middleRightWidget:i,bottomLeftWidget:a,bottomCenterWidget:o,bottomRightWidget:s}=this._control,c=[_w.NORTH_WEST_RESIZE,_w.NORTH_RESIZE,_w.NORTH_EAST_RESIZE,_w.WEST_RESIZE,_w.EAST_RESIZE,_w.SOUTH_WEST_RESIZE,_w.SOUTH_RESIZE,_w.SOUTH_EAST_RESIZE];[e,t,n,r,i,a,o,s].forEach((e,t)=>{e.onPointerEnter$.subscribeEvent(()=>{e.setCursor(c[t])}),e.onPointerLeave$.subscribeEvent(()=>{e.resetCursor()}),e.onPointerDown$.subscribeEvent(e=>{this._widgetPointerDownEvent(e,c[t])})})}_widgetPointerDownEvent(e,t){let n=this._scene,{offsetX:r,offsetY:i}=e,{x:a,y:o}=n.getCoordRelativeToViewport(Hw.FromArray([r,i]));this._startOffsetX=r,this._startOffsetY=i;let{startRow:s,startColumn:c,endRow:l,endColumn:u}=this._control.model,d=Math.min(s,l),f=Math.min(c,u),p=Math.max(s,l),m=Math.max(c,u);this._relativeSelectionPositionRow=d,this._relativeSelectionPositionColumn=f,this._relativeSelectionRowLength=p-d,this._relativeSelectionColumnLength=m-f,t===_w.NORTH_WEST_RESIZE?(this._relativeSelectionPositionRow=p,this._relativeSelectionPositionColumn=m):t===_w.NORTH_RESIZE||t===_w.NORTH_EAST_RESIZE?this._relativeSelectionPositionRow=p:t===_w.WEST_RESIZE||t===_w.SOUTH_WEST_RESIZE?this._relativeSelectionPositionColumn=m:t===_w.SOUTH_RESIZE&&(this._relativeSelectionPositionRow=d);let h=KE.create(n),g=n.getViewport(lT.VIEW_MAIN);h.startScroll(a,o,g),this._scrollTimer=h,n.disableObjectsEvent(),this._scenePointerMoveSub=n.onPointerMove$.subscribeEvent(e=>{let{offsetX:r,offsetY:i}=e,{x:a,y:o}=n.getCoordRelativeToViewport(Hw.FromArray([r,i]));this._widgetMoving(a,o,t),n.setCursor(t),h.scrolling(a,o,()=>{this._widgetMoving(a,o,t)})}),this._scenePointerUpSub=n.onPointerUp$.subscribeEvent(()=>{var e,t,n;let r=this._scene;r.resetCursor(),this._clearObserverEvent(),r.enableObjectsEvent(),(e=this._scrollTimer)==null||e.dispose(),this._control.selectionScaled$.next(this._targetSelection),(t=(n=this._selectionHooks).selectionMoveEnd)==null||t.call(n)})}_widgetMoving(e,t,n){let r=this._scene,i=r.getScrollXYInfoByViewport(Hw.FromArray([this._startOffsetX,this._startOffsetY])),{scaleX:a,scaleY:o}=r.getAncestorScale(),{row:s,column:c}=this._skeleton.getCellIndexByOffset(e,t,a,o,i),l=this._relativeSelectionPositionRow,u=this._relativeSelectionPositionColumn,d=s,f=c;n===_w.NORTH_WEST_RESIZE?(l=s,u=c,d=this._relativeSelectionPositionRow,f=this._relativeSelectionPositionColumn):n===_w.NORTH_RESIZE?(l=s,u=this._relativeSelectionPositionColumn,d=this._relativeSelectionPositionRow,f=this._relativeSelectionPositionColumn+this._relativeSelectionColumnLength):n===_w.NORTH_EAST_RESIZE?(l=s,u=this._relativeSelectionPositionColumn,d=this._relativeSelectionPositionRow,f=c):n===_w.WEST_RESIZE?(l=this._relativeSelectionPositionRow,u=c,d=this._relativeSelectionPositionRow+this._relativeSelectionRowLength,f=this._relativeSelectionPositionColumn):n===_w.EAST_RESIZE?d=this._relativeSelectionPositionRow+this._relativeSelectionRowLength:n===_w.SOUTH_WEST_RESIZE?(l=this._relativeSelectionPositionRow,u=c,d=s,f=this._relativeSelectionPositionColumn):n===_w.SOUTH_RESIZE&&(l=this._relativeSelectionPositionRow,u=this._relativeSelectionPositionColumn,d=s,f=this._relativeSelectionPositionColumn+this._relativeSelectionColumnLength);let p=qZ({range:this._swapPositions(l,u,d,f),primary:this._skeleton.getCellWithMergeInfoByIndex(l,u),style:null},this._skeleton);this._targetSelection={...p.rangeWithCoord},this._control.updateRangeBySelectionWithCoord(p),this._control.selectionScaling$.next(this._targetSelection)}_initialAutoFill(){let{fillControl:e}=this._control;e.onPointerEnter$.subscribeEvent(t=>{this._injector.get(XQ).interceptor.fetchThroughInterceptors(VQ)(!1,{x:t.offsetX,y:t.offsetY,skeleton:this._skeleton,scene:this._scene})&&e.setCursor(_w.CROSSHAIR)}),e.onPointerLeave$.subscribeEvent(()=>{e.resetCursor()}),e.onPointerDown$.subscribeEvent(this._autoFillForPointerdown.bind(this))}_autoFillMoving(e,t){let n=this._scene,r=n.getViewportScrollXY(this._activeViewport),{scaleX:i,scaleY:a}=n.getAncestorScale(),{row:o,column:s}=this._skeleton.getCellIndexByOffset(e,t,i,a,r),c=n.getCoordRelativeToViewport(Hw.FromArray([e,t])),l=this._skeleton.getRowCount()-1,u=this._skeleton.getColumnCount()-1,d=this._relativeSelectionPositionRow,f=this._relativeSelectionPositionColumn,p=this._relativeSelectionPositionRow+this._relativeSelectionRowLength,m=this._relativeSelectionPositionColumn+this._relativeSelectionColumnLength,h=!1,g=!0;if((s<f||s>m)&&o>=d&&o<=p){let e=this._fillRuler(s,f,m,this._relativeSelectionColumnLength,u);f=e.startRowOrColumn,m=e.endRowOrColumn,h=e.isLighten,g=!1}else if((o<d||o>p)&&s>=f&&s<=m){let e=this._fillRuler(o,d,p,this._relativeSelectionRowLength,l);d=e.startRowOrColumn,p=e.endRowOrColumn,h=e.isLighten}else if(Math.abs(this._startOffsetX-c.x-r.x)/2>Math.abs(this._startOffsetY-c.y-r.y)){let e=this._fillRuler(s,f,m,this._relativeSelectionColumnLength,u);f=e.startRowOrColumn,m=e.endRowOrColumn,h=e.isLighten,g=!1}else{let e=this._fillRuler(o,d,p,this._relativeSelectionRowLength,l);d=e.startRowOrColumn,p=e.endRowOrColumn,h=e.isLighten}let _=this._skeleton.getNoMergeCellWithCoordByIndex(d,f),v=this._skeleton.getNoMergeCellWithCoordByIndex(p,m),y=_?.startY||0,b=v?.endY||0,x=_?.startX||0,S=v?.endX||0;h?this._controlHandler((e,t)=>{let n=new rh(this._fillControlColors[t]).lighten(Ymt).toRgbString();e.setProps({fill:n})}):this._controlHandler((e,t)=>{e.setProps({fill:this._fillControlColors[t]})});let C=aq/this._getScale();if(d===p&&g===!0||f===m&&g===!1){var w;(w=this._helperSelection)==null||w.hide()}else{var T,E;(T=this._helperSelection)==null||T.transformByState({left:x-C/2,top:y-C/2,width:S-x,height:b-y}),(E=this._helperSelection)==null||E.show()}this._targetSelection={startY:y,endY:b,startX:x,endX:S,startRow:d,endRow:p,startColumn:f,endColumn:m},this._control.selectionFilling$.next(this._targetSelection)}_autoFillForPointerdown(e){let{offsetX:t,offsetY:n}=e,r=this._scene,{x:i,y:a}=r.getCoordRelativeToViewport(Hw.FromArray([t,n]));this._startOffsetX=i,this._startOffsetY=a;let{startRow:o,startColumn:s,endRow:c,endColumn:l}=this._control.model;this._isInMergeState=this._hasMergeInRange(o,s,c,l),this._relativeSelectionPositionRow=o,this._relativeSelectionPositionColumn=s,this._relativeSelectionRowLength=c-o,this._relativeSelectionColumnLength=l-s;let u=this._control.currentStyle,d=u?.stroke,f=u?.strokeWidth,p=HQ(this._themeService);d??=p.stroke,f??=p.strokeWidth;let m=this._getScale();f/=m;let h=aq/m,g=new rh(d).darken(2).toRgbString();this.isHelperSelection&&(this._helperSelection=new NE(Jmt,{stroke:g,strokeWidth:f+h/2}),r.addObject(this._helperSelection)),this._activeViewport=r.getActiveViewportByCoord(Hw.FromArray([t,n]));let _=r.getViewport(lT.VIEW_MAIN),v=KE.create(r,this._activeViewport.viewportKey===lT.VIEW_MAIN?GE.ALL:GE.NONE);v.startScroll(i,a,_),this._scrollTimer=v,r.disableObjectsEvent(),this._controlHandler(e=>{this._fillControlColors.push(e.fill)}),this._scenePointerMoveSub=r.onPointerMove$.subscribeEvent(t=>{let{offsetX:n,offsetY:i}=t,a=r.getActiveViewportByCoord(Hw.FromArray([n,i]));if(!this._injector.get(XQ).interceptor.fetchThroughInterceptors(VQ)(!1,{x:e.offsetX,y:e.offsetY,skeleton:this._skeleton,scene:this._scene}))return;let{x:l,y:u}=r.getCoordRelativeToViewport(Hw.FromArray([n,i]));this._autoFillMoving(l,u),r.setCursor(_w.CROSSHAIR);let d=this._targetSelection;if(_&&a&&this._activeViewport?.viewportKey!==a?.viewportKey){let e;d.startRow===o?d.endRow===c?d.startColumn===s?(v.scrollTimerType=GE.X,e={...d,startColumn:d.endColumn}):(v.scrollTimerType=GE.X,e={...d,endColumn:d.startColumn}):(v.scrollTimerType=GE.Y,e={...d,startRow:d.endRow}):(v.scrollTimerType=GE.Y,e={...d,endRow:d.startRow}),this._isSelectionInViewport(e,a)&&(this._viewportMainScrollBarNeedResetPosition(v.scrollTimerType,this._activeViewport.viewportKey,a.viewportKey)&&_.scrollToBarPos({x:v.scrollTimerType===GE.X?0:void 0,y:v.scrollTimerType===GE.Y?0:void 0}),this._activeViewport=a)}v.scrolling(l,u,()=>{this._autoFillMoving(l,u)})}),this._scenePointerUpSub=r.onPointerUp$.subscribeEvent(()=>{var e,t;(e=this._helperSelection)==null||e.dispose();let n=this._scene;n.resetCursor(),this._clearObserverEvent(),n.enableObjectsEvent(),(t=this._scrollTimer)==null||t.dispose(),this._control.refreshSelectionFilled(this._targetSelection),this._isInMergeState=!1,this._controlHandler((e,t)=>{e.setProps({fill:this._fillControlColors[t]})}),this._fillControlColors=[]})}_viewportMainScrollBarNeedResetPosition(e,t,n){return!((e!==GE.X||t!==lT.VIEW_MAIN_LEFT&&t!==lT.VIEW_MAIN_LEFT_TOP||n!==lT.VIEW_MAIN&&n!==lT.VIEW_MAIN_TOP)&&(e!==GE.Y||t!==lT.VIEW_MAIN_TOP&&t!==lT.VIEW_MAIN_LEFT_TOP||n!==lT.VIEW_MAIN&&n!==lT.VIEW_MAIN_LEFT))}_hasMergeInRange(e,t,n,r){return this._skeleton.worksheet.getMergedCellRange(e,t,n,r).length>0}_swapPositions(e,t,n,r){return{startRow:Math.min(e,n),startColumn:Math.min(t,r),endRow:Math.max(e,n),endColumn:Math.max(t,r)}}_controlHandler(e){let{leftControl:t,rightControl:n,topControl:r,bottomControl:i,backgroundControlTop:a,backgroundControlMiddleLeft:o,backgroundControlMiddleRight:s,backgroundControlBottom:c,fillControl:l}=this._control,u=[t,n,r,i,a,o,s,c,l];for(let t=0,n=u.length;t<n;t++){let n=u[t];e(n,t)}}_fillRuler(e,t,n,r,i){let a=!1;if(e<t){if(this._isInMergeState&&e<t){let n=t-e,i=r+1,a=Math.ceil(n/i),o=t-a*i;o<0&&(o=t-(a-1)*i),t=o}else t=e}else if(e>=t&&e<=n)a=!0,this._isInMergeState||(n=e);else if(this._isInMergeState&&e>n){let t=e-n,a=r+1,o=Math.ceil(t/a),s=n+o*a;s>i&&(s=n+(o-1)*a),n=s}else n=e;return{rowOrColumn:e,startRowOrColumn:t,endRowOrColumn:n,isLighten:a}}_getScale(){let{scaleX:e,scaleY:t}=this._scene.getAncestorScale();return Math.max(e,t)}},Zmt=.3,n$=class extends P{constructor(e,t,n,r){super(),this._scene=e,this._zIndex=t,this._themeService=n,Q(this,`_isHelperSelection`,!0),Q(this,`_enableAutoFill`,!0),Q(this,`_showAutoFill`,!1),Q(this,`_highlightHeader`,!0),Q(this,`_selectionRenderModel`,void 0),Q(this,`_leftBorder`,void 0),Q(this,`_rightBorder`,void 0),Q(this,`_topBorder`,void 0),Q(this,`_bottomBorder`,void 0),Q(this,`_backgroundControlTop`,void 0),Q(this,`_backgroundControlBottom`,void 0),Q(this,`_backgroundControlMiddleLeft`,void 0),Q(this,`_backgroundControlMiddleRight`,void 0),Q(this,`_autoFillControl`,void 0),Q(this,`_selectionShapeGroup`,void 0),Q(this,`_rowHeaderBackground`,void 0),Q(this,`_rowHeaderBorder`,void 0),Q(this,`_rowHeaderGroup`,void 0),Q(this,`_columnHeaderBackground`,void 0),Q(this,`_columnHeaderBorder`,void 0),Q(this,`_columnHeaderGroup`,void 0),Q(this,`_dashedRect`,void 0),Q(this,`_topLeftWidget`,void 0),Q(this,`_topCenterWidget`,void 0),Q(this,`_topRightWidget`,void 0),Q(this,`_middleLeftWidget`,void 0),Q(this,`_middleRightWidget`,void 0),Q(this,`_bottomLeftWidget`,void 0),Q(this,`_bottomCenterWidget`,void 0),Q(this,`_bottomRightWidget`,void 0),Q(this,`_defaultStyle`,void 0),Q(this,`_currentStyle`,void 0),Q(this,`_rowHeaderWidth`,0),Q(this,`_columnHeaderHeight`,0),Q(this,`_rowHeaderOffsetX`,0),Q(this,`_columnHeaderOffsetY`,0),Q(this,`_widgetRects`,[]),Q(this,`_controlExtension`,void 0),Q(this,`_dispose$`,new so(this)),Q(this,`dispose$`,this._dispose$.asObservable()),Q(this,`selectionMoving$`,new ao),Q(this,`selectionMoveEnd$`,new ao),Q(this,`selectionScaling$`,new ao),Q(this,`selectionScaled$`,new ao),Q(this,`selectionFilling$`,new ao),Q(this,`_selectionFilled$`,new ao),Q(this,`selectionFilled$`,this._selectionFilled$.asObservable()),Q(this,`_antLineOffset`,0),Q(this,`_antRequestNewFrame`,-1),this._enableAutoFill=r?.enableAutoFill??!0,this._highlightHeader=r?.highlightHeader??!0,this._rowHeaderWidth=r?.rowHeaderWidth??0,this._columnHeaderHeight=r?.columnHeaderHeight??0,this._rowHeaderOffsetX=r?.rowHeaderOffsetX??0,this._columnHeaderOffsetY=r?.columnHeaderOffsetY??0,this._initializeSheetBody(),this._initialHeader()}_initializeSheetBody(){this._defaultStyle=HQ(this._themeService),this._currentStyle=HQ(this._themeService),this._selectionRenderModel=new Gmt;let e=this._zIndex;this._leftBorder=new NE(`__SpreadsheetSelectionShapeLeftControl__`+e,{zIndex:e}),this._rightBorder=new NE(`__SpreadsheetSelectionShapeRightControl__`+e,{zIndex:e}),this._topBorder=new NE(`__SpreadsheetSelectionTopControl__`+e,{zIndex:e}),this._bottomBorder=new NE(`__SpreadsheetSelectionBottomControl__`+e,{zIndex:e}),this._backgroundControlTop=new NE(`__SpreadsheetSelectionBackgroundControlTop__`+e,{zIndex:e-1,evented:!1}),this._backgroundControlBottom=new NE(`__SpreadsheetSelectionBackgroundControlBottom__`+e,{zIndex:e-1,evented:!1}),this._backgroundControlMiddleLeft=new NE(`__SpreadsheetSelectionBackgroundControlMiddleLeft__`+e,{zIndex:e-1,evented:!1}),this._backgroundControlMiddleRight=new NE(`__SpreadsheetSelectionBackgroundControlMiddleRight__`+e,{zIndex:e-1,evented:!1}),this._autoFillControl=new NE(`__SpreadsheetSelectionFillControl__`+e,{zIndex:e+1}),this._autoFillControl.hide(),this._dashedRect=new $Oe(`__SpreadsheetDragDashControl__`+e,{zIndex:e+2,evented:!1,stroke:`#fff`});let t=[this._autoFillControl,this._leftBorder,this._rightBorder,this._topBorder,this._bottomBorder,this._backgroundControlTop,this._backgroundControlMiddleLeft,this._backgroundControlMiddleRight,this._backgroundControlBottom,this._dashedRect];this._widgetRects=this._initialWidget(),this._selectionShapeGroup=new VE(`__SpreadsheetSelectionShape__`+e,...t,...this._widgetRects),this._selectionShapeGroup.hide(),this._selectionShapeGroup.evented=!1,this._selectionShapeGroup.zIndex=e;let n=this.getScene();n.addObject(this._selectionShapeGroup,1),this.disposeWithMe(Wf(n.onTransformChange$.subscribeEvent(e=>{e.type===Xw.scale&&(this._updateLayoutOfSelectionControl(this._currentStyle),this._updateControlCoord())})))}_initialHeader(){let e=this._zIndex;this._rowHeaderBackground=new NE(`__SpreadSheetSelectionRowHeaderBackground__`+e,{zIndex:e-1,evented:!1}),this._rowHeaderBorder=new NE(`__SpreadSheetSelectionRowHeaderBorder__`+e,{zIndex:e-1,evented:!1}),this._rowHeaderGroup=new VE(`__SpreadSheetSelectionRowHeaderGroup__`+e,this._rowHeaderBackground,this._rowHeaderBorder),this._rowHeaderGroup.hide(),this._rowHeaderGroup.evented=!1,this._rowHeaderGroup.zIndex=e,this._columnHeaderBackground=new NE(`__SpreadSheetSelectionColumnHeaderBackground__`+e,{zIndex:e-1,evented:!1}),this._columnHeaderBorder=new NE(`__SpreadSheetSelectionColumnHeaderBorder__`+e,{zIndex:e-1,evented:!1}),this._columnHeaderGroup=new VE(`__SpreadSheetSelectionColumnHeaderGroup__`+e,this._columnHeaderBackground,this._columnHeaderBorder),this._columnHeaderGroup.hide(),this._columnHeaderGroup.evented=!1,this._columnHeaderGroup.zIndex=e,this.getScene().addObjects([this._rowHeaderGroup,this._columnHeaderGroup],11)}_initialWidget(){let e=this._zIndex;return this._topLeftWidget=new NE(`__SpreadSheetSelectionTopLeftWidget__`+e,{zIndex:e+1}),this._topCenterWidget=new NE(`__SpreadSheetSelectionTopCenterWidget__`+e,{zIndex:e+1}),this._topRightWidget=new NE(`__SpreadSheetSelectionTopRightWidget__`+e,{zIndex:e+1}),this._middleLeftWidget=new NE(`__SpreadSheetSelectionMiddleLeftWidget__`+e,{zIndex:e+1}),this._middleRightWidget=new NE(`__SpreadSheetSelectionMiddleRightWidget__`+e,{zIndex:e+1}),this._bottomLeftWidget=new NE(`__SpreadSheetSelectionBottomLeftWidget__`+e,{zIndex:e+1}),this._bottomCenterWidget=new NE(`__SpreadSheetSelectionBottomCenterWidget__`+e,{zIndex:e+1}),this._bottomRightWidget=new NE(`__SpreadSheetSelectionBottomRightWidget__`+e,{zIndex:e+1}),[this._topLeftWidget,this._topCenterWidget,this._topRightWidget,this._middleLeftWidget,this._middleRightWidget,this._bottomLeftWidget,this._bottomCenterWidget,this._bottomRightWidget]}get zIndex(){return this._zIndex}get leftControl(){return this._leftBorder}get rightControl(){return this._rightBorder}get topControl(){return this._topBorder}get bottomControl(){return this._bottomBorder}get fillControl(){return this._autoFillControl}get backgroundControlTop(){return this._backgroundControlTop}get backgroundControlBottom(){return this._backgroundControlBottom}get backgroundControlMiddleLeft(){return this._backgroundControlMiddleLeft}get backgroundControlMiddleRight(){return this._backgroundControlMiddleRight}get selectionShape(){return this._selectionShapeGroup}get columnHeaderGroup(){return this._columnHeaderGroup}get rowHeaderGroup(){return this._rowHeaderGroup}get selectionShapeGroup(){return this._selectionShapeGroup}get model(){return this._selectionRenderModel}get topLeftWidget(){return this._topLeftWidget}get topCenterWidget(){return this._topCenterWidget}get topRightWidget(){return this._topRightWidget}get middleLeftWidget(){return this._middleLeftWidget}get middleRightWidget(){return this._middleRightWidget}get bottomLeftWidget(){return this._bottomLeftWidget}get bottomCenterWidget(){return this._bottomCenterWidget}get bottomRightWidget(){return this._bottomRightWidget}get themeService(){return this._themeService}get selectionModel(){return this._selectionRenderModel}set selectionModel(e){this._selectionRenderModel=e}get currentStyle(){return this._currentStyle}set currentStyle(e){this._currentStyle=e}get dashedRect(){return this._dashedRect}get isHelperSelection(){return this._isHelperSelection}get rowHeaderWidth(){return this._rowHeaderWidth}set rowHeaderWidth(e){this._rowHeaderWidth=e}get columnHeaderHeight(){return this._columnHeaderHeight}set columnHeaderHeight(e){this._columnHeaderHeight=e}setControlExtension(e){this._controlExtension=new Xmt(this,e)}setControlExtensionDisable(e){this._controlExtension&&this._controlExtension.setDisabled(e)}setEvent(e){this.leftControl.evented=e,this.rightControl.evented=e,this.topControl.evented=e,this.bottomControl.evented=e}refreshSelectionFilled(e){this._selectionFilled$.next(e)}_updateLayoutOfSelectionControl(e){e&&(this.currentStyle=Object.assign({},this._defaultStyle,e));let t=this.currentStyle,{stroke:n,widgets:r,autofillStroke:i,strokeDash:a,isAnimationDash:o}=t,s=t.autofillSize,c=t.strokeWidth,l=t.autofillStrokeWidth,u=this._getScale(),d=(c+aq)/2/u;c/=u,s/=u,l/=u<1?1:u;let f=aq/u,p=bw/u,{startX:m,startY:h,endX:g,endY:_}=this._selectionRenderModel;if(this.leftControl.transformByState({height:_-h,left:-d+p,width:c,strokeWidth:f,top:-f/2+p}),this.leftControl.setProps({fill:n,stroke:oq}),this.rightControl.transformByState({height:_-h,left:g-m-d+p,width:c,strokeWidth:f,top:-f/2+p}),this.rightControl.setProps({fill:n,stroke:oq}),this.topControl.transformByState({width:g-m+c,top:-d+p,left:-d+p,height:c,strokeWidth:f}),this.topControl.setProps({fill:n,stroke:oq}),this.bottomControl.transformByState({width:g-m+c,top:_-h-d+p,height:c,left:-d+p,strokeWidth:f}),this.bottomControl.setProps({fill:n,stroke:oq}),a==null)this.dashedRect.hide(),this._stopAntLineAnimation();else{let e=t.strokeWidth*2/u;this.dashedRect.transformByState({height:_-h,width:g-m,strokeWidth:e,left:-e/2+p,top:-e/2+p}),this.dashedRect.setProps({strokeDashArray:[0,a/u]}),this._stopAntLineAnimation(),o!==!1&&this._startAntLineAnimation(),this.dashedRect.show()}if(this._showAutoFill=this._showAutoFill&&this._enableAutoFill,this._showAutoFill&&!this._hasWidgets(r)){let e={fill:n,stroke:i,strokeScaleEnabled:!1},t={width:s-l,height:s-l,left:g-m-s/2+l/2-p,top:_-h-s/2+l/2-p,strokeWidth:l};this._autoFillControl.setProps(e),this._autoFillControl.transformByState(t),this._autoFillControl.show()}else this._autoFillControl.hide();this._updateBackgroundControl(t),this._updateHeaderBackground(t),this._updateWidgets(t)}_updateControlCoord(){let{startX:e,startY:t}=this._selectionRenderModel;this.selectionShapeGroup.show(),this.selectionShapeGroup.translate(e,t),this.selectionShapeGroup.makeDirtyNoDebounce(!0)}updateStyle(e){this._updateLayoutOfSelectionControl(e),this._updateControlCoord()}updateRange(e,t){this._selectionRenderModel.setValue(e,t),this._showAutoFill=t!==null,this._updateLayoutOfSelectionControl(),this._updateControlCoord()}updateRangeBySelectionWithCoord(e,t){t&&(this._rowHeaderWidth=t.rowHeaderWidth,this._columnHeaderHeight=t.columnHeaderHeight,this._rowHeaderOffsetX=Math.max(0,t.rowHeaderWidthAndMarginLeft-t.rowHeaderWidth),this._columnHeaderOffsetY=Math.max(0,t.columnHeaderHeightAndMarginTop-t.columnHeaderHeight)),this._selectionRenderModel.setValue(e.rangeWithCoord,e.primaryWithCoord),this._showAutoFill=e.primaryWithCoord!==null,this._updateLayoutOfSelectionControl(e.style),this._updateControlCoord()}update(e,t=0,n=0,r,i){this._rowHeaderWidth=t,this._columnHeaderHeight=n,this._rowHeaderOffsetX=0,this._columnHeaderOffsetY=0,this.updateRangeBySelectionWithCoord({rangeWithCoord:e,primaryWithCoord:i,style:r}),r&&this.updateStyle(r)}updateCurrCell(e){this._showAutoFill=e!==null,this._selectionRenderModel.setCurrentCell(e)}clearHighlight(){this._showAutoFill=!1,this._selectionRenderModel.clearCurrentCell(),this._updateLayoutOfSelectionControl(this._currentStyle)}getScene(){return this._scene}dispose(){var e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_,v,y,b,x,S,C,w;(e=this._leftBorder)==null||e.dispose(),(t=this._rightBorder)==null||t.dispose(),(n=this._topBorder)==null||n.dispose(),(r=this._bottomBorder)==null||r.dispose(),(i=this._backgroundControlTop)==null||i.dispose(),(a=this._backgroundControlMiddleLeft)==null||a.dispose(),(o=this._backgroundControlMiddleRight)==null||o.dispose(),(s=this._backgroundControlBottom)==null||s.dispose(),this._autoFillControl.dispose(),(c=this._selectionShapeGroup)==null||c.dispose(),(l=this._rowHeaderBackground)==null||l.dispose(),(u=this._rowHeaderBorder)==null||u.dispose(),(d=this._rowHeaderGroup)==null||d.dispose(),(f=this._rowHeaderBackground)==null||f.dispose(),(p=this._columnHeaderBackground)==null||p.dispose(),(m=this._columnHeaderBorder)==null||m.dispose(),(h=this._columnHeaderGroup)==null||h.dispose(),(g=this._topLeftWidget)==null||g.dispose(),(_=this._topCenterWidget)==null||_.dispose(),(v=this._topRightWidget)==null||v.dispose(),(y=this._middleLeftWidget)==null||y.dispose(),(b=this._middleRightWidget)==null||b.dispose(),(x=this._bottomLeftWidget)==null||x.dispose(),(S=this._bottomCenterWidget)==null||S.dispose(),(C=this._bottomRightWidget)==null||C.dispose(),(w=this._controlExtension)==null||w.dispose(),super.dispose(),this._dispose$.next(this),this._dispose$.complete()}getCurrentCellInfo(){let e=this.model.currentCell;if(e){let t;if(e.isMerged){let n=e.mergeInfo;t={startRow:n.startRow,endRow:n.endRow,startColumn:n.startColumn,endColumn:n.endColumn,startX:n.startX,endX:n.endX,startY:n.startY,endY:n.endY}}else{let{actualRow:n,actualColumn:r,startX:i,endX:a,startY:o,endY:s}=e;t={startRow:n,endRow:n,startColumn:r,endColumn:r,startX:i,endX:a,startY:o,endY:s}}return t}}getValue(){return{...this._selectionRenderModel.getValue(),style:this._currentStyle}}getRange(){return this._selectionRenderModel.getValue().rangeWithCoord}enableHelperSelection(){this._isHelperSelection=!0}disableHelperSelection(){this._isHelperSelection=!1}_updateHeaderBackground(e){let{startX:t,startY:n,endX:r,endY:i,rangeType:a}=this._selectionRenderModel,o=this._currentStyle,s=this._getScale(),{stroke:c,rowHeaderFill:l=o.rowHeaderFill,rowHeaderStroke:u=o.rowHeaderStroke,columnHeaderFill:d=o.columnHeaderFill,columnHeaderStroke:f=o.columnHeaderStroke}=e,{rowHeaderStrokeWidth:p=o.rowHeaderStrokeWidth,columnHeaderStrokeWidth:m=o.columnHeaderStrokeWidth}=e;p/=s,m/=s;let h=this._rowHeaderWidth,g=this._columnHeaderHeight,_=this._rowHeaderOffsetX,v=this._columnHeaderOffsetY;if(this._highlightHeader&&g>0){let e=d;a===z.COLUMN&&(e=new rh(c).setAlpha(Zmt).toString()),this._columnHeaderBackground.setProps({fill:e}),this._columnHeaderBackground.resize(r-t,g),this._columnHeaderBorder.setProps({fill:f}),this._columnHeaderBorder.transformByState({width:r-t,height:m,top:g-m+1/s}),this._columnHeaderGroup.show(),this._columnHeaderGroup.translate(t,v)}else this._columnHeaderGroup.hide();if(this._columnHeaderGroup.makeDirty(!0),this._highlightHeader&&h>0){let e=l;a===z.ROW&&(e=new rh(c).setAlpha(Zmt).toString()),this._rowHeaderBackground.setProps({fill:e}),this._rowHeaderBackground.resize(h,i-n),this._rowHeaderBorder.setProps({fill:u}),this._rowHeaderBorder.transformByState({width:p,height:i-n,left:h-p+1/s}),this._rowHeaderGroup.show(),this._rowHeaderGroup.translate(_,n)}else this._rowHeaderGroup.hide();this._rowHeaderGroup.makeDirty(!0)}_updateBackgroundControl(e){let{startX:t,startY:n,endX:r,endY:i}=this._selectionRenderModel,a=this._getScale(),{fill:o=e.fill}=e,{strokeWidth:s}=e;s/=a;let c=this._selectionRenderModel.highlightToSelection();if(!c){this._backgroundControlTop.resize(r-t,i-n),this._backgroundControlTop.setProps({fill:o}),this._backgroundControlBottom.resize(0,0),this._backgroundControlMiddleLeft.resize(0,0),this._backgroundControlMiddleRight.resize(0,0);return}let{startX:l,startY:u,endX:d,endY:f}=c,p=s/2,m={left:-p,top:-p,width:r-t+p*2,height:u-n+p};m.height<0&&(m.width=0,m.height=0),this._backgroundControlTop.transformByState(m);let h={left:-p,top:u-n,width:l-t+p,height:f-u};h.width<0&&(h.width=0,h.height=0),this._backgroundControlMiddleLeft.transformByState(h);let g={left:d-t-p,top:u-n,width:r-d+p*2,height:f-u};g.width<0&&(g.width=0,g.height=0),this._backgroundControlMiddleRight.transformByState(g);let _={left:-p,top:f-n,width:r-t+p*2,height:i-f+p};_.height<0&&(_.width=0,_.height=0),this._backgroundControlBottom.transformByState(_),this._backgroundControlTop.setProps({fill:o}),this._backgroundControlMiddleLeft.setProps({fill:o}),this._backgroundControlMiddleRight.setProps({fill:o}),this._backgroundControlBottom.setProps({fill:o})}_updateWidgets(e){let{startX:t,startY:n,endX:r,endY:i}=this._selectionRenderModel,{stroke:a=e.stroke,widgets:o=e.widgets,widgetStroke:s=e.widgetStroke}=e,c=this._getScale(),{widgetSize:l,widgetStrokeWidth:u}=e;l/=c,u/=c;let d={left:-l/2+u/2,center:(r-t)/2-l/2+u/2,right:r-t-l/2+u/2,top:-l/2,middle:(i-n)/2-l/2,bottom:i-n-l/2+u/2},f=l-u;this._widgetRects.forEach(e=>{e.setProps({fill:a,stroke:s})}),o.tl===!0?(this._topLeftWidget.transformByState({height:f,width:f,left:d.left,top:d.top,strokeWidth:u}),this._topLeftWidget.show()):this._topLeftWidget.hide(),o.tc===!0?(this._topCenterWidget.transformByState({height:f,width:f,left:d.center,top:d.top,strokeWidth:u}),this._topCenterWidget.show()):this._topCenterWidget.hide(),o.tr===!0?(this._topRightWidget.transformByState({height:f,width:f,left:d.right,top:d.top,strokeWidth:u}),this._topRightWidget.show()):this._topRightWidget.hide(),o.ml===!0?(this._middleLeftWidget.transformByState({height:f,width:f,left:d.left,top:d.middle,strokeWidth:u}),this._middleLeftWidget.show()):this._middleLeftWidget.hide(),o.mr===!0?(this._middleRightWidget.transformByState({height:f,width:f,left:d.right,top:d.middle,strokeWidth:u}),this._middleRightWidget.show()):this._middleRightWidget.hide(),o.bl===!0?(this._bottomLeftWidget.transformByState({height:f,width:f,left:d.left,top:d.bottom,strokeWidth:u}),this._bottomLeftWidget.show()):this._bottomLeftWidget.hide(),o.bc===!0?(this._bottomCenterWidget.transformByState({height:f,width:f,left:d.center,top:d.bottom,strokeWidth:u}),this._bottomCenterWidget.show()):this._bottomCenterWidget.hide(),o.br===!0?(this._bottomRightWidget.transformByState({height:f,width:f,left:d.right,top:d.bottom,strokeWidth:u}),this._bottomRightWidget.show()):this._bottomRightWidget.hide()}_hasWidgets(e){if(e==null)return!1;let t=Object.keys(e);if(t.length===0)return!1;for(let n of t)if(e[n]===!0)return!0;return!1}_getScale(){let{scaleX:e,scaleY:t}=this._scene.getAncestorScale();return Math.max(e,t)}_stopAntLineAnimation(){this._antLineOffset=0,JSe(this._antRequestNewFrame)}_startAntLineAnimation(){let e=this._getScale();this._antLineOffset+=.6/e,this._antLineOffset>160/e&&(this._antLineOffset=0),this.dashedRect.setProps({strokeDashOffset:-this._antLineOffset}),this._antRequestNewFrame=Cw(()=>{this._startAntLineAnimation()})}},Qmt=1e4,r$=ce(`univer.mark-selection-service`),i$=class extends P{constructor(e,t,n,r){super(),this._currentService=e,this._sheetSkeletonService=t,this._renderManagerService=n,this._themeService=r,Q(this,`_shapeMap`,new Map)}addShape(e,t=[],n=Qmt){let r=this._currentService.getCurrentUnitOfType(M.UNIVER_SHEET),i=r.getActiveSheet()?.getSheetId();if(!i)return null;let a=ip(),o={selection:e,subUnitId:i,unitId:r.getUnitId(),zIndex:n,control:null,exits:t};return this._shapeMap.set(a,o),this.refreshShapes(),a}addShapeWithNoFresh(e,t=[],n=Qmt){let r=this._currentService.getCurrentUnitOfType(M.UNIVER_SHEET),i=r.getActiveSheet()?.getSheetId();if(!i)return null;let a=ip();return this._shapeMap.set(a,{selection:e,subUnitId:i,unitId:r.getUnitId(),zIndex:n,control:null,exits:t}),a}refreshShapes(){let e=this._currentService.getCurrentUnitOfType(M.UNIVER_SHEET);if(!e)return;let t=e.getUnitId(),n=e.getActiveSheet()?.getSheetId();this._shapeMap.forEach(e=>{let{unitId:r,subUnitId:i,selection:a,control:o,zIndex:s}=e;if(o?.dispose(),r!==t||i!==n)return;let c=this._renderManagerService.getRenderById(r);if(!c)return;let l=this._sheetSkeletonService.getSkeleton(r,i);if(!l)return;let{scene:u}=c,{rowHeaderWidth:d,columnHeaderHeight:f}=l,p=new n$(u,s,this._themeService,{enableAutoFill:!1,highlightHeader:!1,rowHeaderWidth:d,columnHeaderHeight:f}),m=qZ(a,l);p.updateRangeBySelectionWithCoord(m),e.control=p})}getShapeMap(){return this._shapeMap}removeShape(e){let t=this._shapeMap.get(e);if(!t)return;let{control:n}=t;n?.dispose(),this._shapeMap.delete(e)}removeAllShapes(){for(let e of this._shapeMap.values()){let{control:t}=e;t?.dispose()}this._shapeMap.clear()}};i$=e$([$(0,B),$(1,j(Sq)),$(2,ZE),$(3,j(_x))],i$);function $mt(e){return{strokeWidth:1.5,stroke:e.getColorFromTheme(`primary.600`),fill:`rgba(178, 178, 178, 0.10)`,widgets:{},strokeDash:8}}function eht(e){if(e==null)return e;let t={};return e.p!==void 0&&(t.p=e.p===null?null:kb(e.p)),e.s!==void 0&&(t.s=e.s===null||typeof e.s==`string`?e.s:kb(e.s)),e.v!==void 0&&(t.v=e.v),e.t!==void 0&&(t.t=e.t),e.f!==void 0&&(t.f=e.f),e.ref!==void 0&&(t.ref=e.ref),e.xf!==void 0&&(t.xf=e.xf),e.si!==void 0&&(t.si=e.si),e.custom!==void 0&&(t.custom=e.custom===null?null:kb(e.custom)),e.rowSpan!==void 0&&(t.rowSpan=e.rowSpan),e.colSpan!==void 0&&(t.colSpan=e.colSpan),e.plain!==void 0&&(t.plain=e.plain),t}var tht=10;function nht(e){let t=e.match(/data-copy-id="([^\s]+)"/);return t&&t[1]?t[1]:null}var rht=class{constructor(){Q(this,`_cache`,new Yg(tht)),Q(this,`_lastCopyId$`,new so(null)),Q(this,`lastCopyId$`,this._lastCopyId$.asObservable())}set(e,t){this._cache.set(e,t),this._lastCopyId$.next(e)}get(e){return this._cache.get(e)}del(e){this._cache.delete(e),this._lastCopyId$.getValue()===e&&this._lastCopyId$.next(null)}clear(){this._cache.clear(),this._lastCopyId$.next(null)}clearWithUnitId(e){this._cache.forEach((t,n)=>{t.unitId===e&&this._cache.delete(n)})}getLastCopyId(){return this._lastCopyId$.getValue()}};new rht;function a$(e,t){let n=t??e.style,r={},i=e.tagName.toLowerCase();switch(i){case`b`:case`em`:case`strong`:r.bl=Np.TRUE;break;case`s`:r.st={s:Np.TRUE};break;case`u`:r.ul={s:Np.TRUE};break;case`i`:r.it=Np.TRUE;break;case`sub`:case`sup`:r.va=i===`sup`?Mp.SUPERSCRIPT:Mp.SUBSCRIPT}return iht(n,r),r}function iht(e,t){if(e instanceof CSSStyleDeclaration)for(let n=0;n<e.length;n++){let r=e[n];aht(r,e.getPropertyValue(r),t)}else for(let n in e){let r=e[n];aht(n,r,t)}}function aht(e,t,n){switch(e){case`font-family`:n.ff=t;break;case`font-size`:{let e=Number.parseInt(t);Number.isNaN(e)||(t.endsWith(`pt`)?n.fs=e:t.endsWith(`px`)&&(n.fs=e*.75));break}case`font-style`:t===`italic`&&(n.it=Np.TRUE);break;case`font-weight`:(Number(t)>400||t===`bold`)&&(n.bl=Np.TRUE);break;case`text-decoration`:/underline/.test(t)?n.ul={s:Np.TRUE}:/overline/.test(t)?n.ol={s:Np.TRUE}:/line-through/.test(t)&&(n.st={s:Np.TRUE});break;case`color`:try{let e=new rh(t);e.isValid&&(n.cl={rgb:e.toRgbString()})}catch{}break;case`background-color`:{let e=new rh(t);e.isValid&&(n.bg={rgb:e.toRgbString()});break}}}function oht(e){if(e.nodeType===Node.TEXT_NODE){e.textContent=(e.textContent||``).replace(/\r?\n[\t ]*/g,` `);return}e.childNodes.forEach(oht)}function sht(e){let t=document.implementation.createHTMLDocument(``),n=t.createRange();n.selectNodeContents(t.body);let r=n.createContextualFragment(e);return Jqe(r,{strippedSelector:`script, iframe, object, embed`}),oht(r),t.body.append(r),t.body}function cht(e){let t=e.style,n={};for(let e=0;e<t.length;e++){let r=t[e],i=t.getPropertyValue(r);switch(r){case`margin-top`:{let e=Number.parseInt(i);n.spaceAbove={v:/pt/.test(i)?Iw(e):e};break}case`margin-bottom`:{let e=Number.parseInt(i);n.spaceBelow={v:/pt/.test(i)?Iw(e):e};break}case`line-height`:n.lineSpacing=Number.parseFloat(i)}}return Object.getOwnPropertyNames(n).length?n:null}function o$(e,t){let n=[];for(let t=0,r=e.length;t<r;t++)e[t]===Uv.PARAGRAPH&&n.push({startIndex:t});if(t)for(let e of n)t.bullet&&(e.bullet=F.deepClone(t.bullet)),t.paragraphStyle&&(e.paragraphStyle=F.deepClone(t.paragraphStyle));return n}function lht(e,t,n){let r=t.length,i=(n?.length??0)===1&&n[0].st===0&&n[0].ed===r;if(e.p){var a;return i&&(a=e.p.body)!=null&&(a=a.textRuns)!=null&&a.length?(e.p.body.textRuns=[],{...e,s:n[0].ts}):e}return i?{...e,s:n[0].ts}:e}var uht=[`color`,`background`,`font-size`,`text-align`,`vertical-align`,`font-weight`,`font-style`,`font-family`,`text-decoration`,`white-space`,`word-wrap`,`border-left`,`border-right`,`border-top`,`border-bottom`,`--data-rotate`];function dht(e,t){let n=e.tagName.toLowerCase();return typeof t==`string`?n===t:Array.isArray(t)?t.some(e=>e===n):t(e)}var s$=class e{static use(e){if(this._pluginList.includes(e))throw Error(`Univer paste plugin ${e.name} already added`);this._pluginList.push(e)}constructor(e){Q(this,`_styleMap`,new Map),Q(this,`_styleCache`,new Map),Q(this,`_styleRules`,[]),Q(this,`_afterProcessRules`,[]),Q(this,`_dom`,null),Q(this,`_msoNumfmtMap`,new Map),Q(this,`_getCurrentSkeleton`,void 0),this._getCurrentSkeleton=e.getCurrentSkeleton}convert(t){let n=e._pluginList.find(e=>e.checkPasteType(t));n&&(this._styleRules=[...n.stylesRules],this._afterProcessRules=[...n.afterProcessRules]);let r=new Rh;this._dom=sht(t);let i=this._dom.querySelector(`style`);if(i){this._parseMsoNumfmtFromCssText(i.textContent??``);let e=document.createElement(`div`),t=e.attachShadow({mode:`open`});document.body.appendChild(e),t.appendChild(i);for(let e of i.sheet.cssRules){let t=e,n=t.selectorText,r=t.style;this._styleMap.set(n,r)}i.remove(),e.remove()}let a={dataStream:``,textRuns:[]},o=[],s=[],c=t.match(/<table\b[^>]*>([\s\S]*?)<\/table>/gi);this.process(null,this._dom.childNodes,a,[]);let{paragraphs:l,dataStream:u,textRuns:d,payloads:f,customRanges:p}=a;if(l){let e=l.map(e=>e.startIndex+1);e.unshift(0);for(let t=0;t<e.length;t++){let n;if(t===e.length-1){if(n=`${u.substring(e[t])}\r\n`,n===`\r
|
|
588
588
|
`)continue}else n=`${u.substring(e[t],e[t+1]-1)}\r\n`;let i=[];d?.forEach(n=>{n.st>=e[t]&&n.ed<=e[t+1]&&i.push({st:n.st-e[t],ed:n.ed-e[t],ts:n.ts})});let a=[];p?.forEach(n=>{n.startIndex>=e[t]&&n.endIndex<=e[t+1]&&a.push({...n,startIndex:n.startIndex-e[t],endIndex:n.endIndex-e[t]})});let s=this._generateDocumentDataModelSnapshot({body:{dataStream:n,textRuns:i,paragraphs:o$(n),customRanges:a}}),c=Object.keys(r.getMatrix()).length===0;r.setValue(c?0:r.getLength(),0,{v:n,p:s}),o.push({})}}else if(u){let e=`${u}\r\n`,t={dataStream:e,textRuns:d,paragraphs:o$(e),payloads:f,customRanges:p};if(!p?.length)r.setValue(0,0,lht({v:u},u,d));else{let e=this._generateDocumentDataModelSnapshot({body:t});r.setValue(0,0,lht({v:u,p:e},u,d))}o.push({})}return c&&c.forEach((e,t)=>{let n=r.getDataRange().endRow+1,{cellMatrix:i,rowProperties:a,colProperties:c}=this._parseTable(e,t);i&&i.forValue((e,t,i)=>{r.setValue(n+e,t,i)}),c&&s.push(...c),o.push(...a)}),this.dispose(),{rowProperties:o,colProperties:s,cellMatrix:r}}_parseMsoNumfmtFromCssText(e){let t=/([^{]+)\{([^}]*)\}/g,n;for(;(n=t.exec(e))!==null;){let e=n[1].trim(),t=n[2].match(/mso-number-format\s*:\s*("(?:[^"\\]|\\.)*"|[^;]+)/i);if(!t)continue;let r=t[1].trim();r.startsWith(`"`)&&r.endsWith(`"`)&&(r=r.slice(1,-1));let i=yht(r);e.split(`,`).forEach(e=>{this._msoNumfmtMap.set(e.trim(),i)})}}_getMsoNumfmtForNode(e){for(let t of e.classList){let e=this._msoNumfmtMap.get(`.${t}`);if(e)return e}if(e.id){let t=this._msoNumfmtMap.get(`#${e.id}`);if(t)return t}return this._msoNumfmtMap.get(e.nodeName.toLowerCase())}_getStyleBySelectorText(e,t){return this._styleMap.get(e)?.getPropertyValue(t)||``}_getStyle(e,t){let n=pht(t),r=e.style,i=``;for(let t=0;t<uht.length;t++){let a=uht[t];if(a===`background`){let t=``;e.classList.forEach(e=>{t=this._getStyleBySelectorText(`.${e}`,`background-color`)||this._getStyleBySelectorText(`.${e}`,a)});let o=r.getPropertyValue(`background-color`)||t||this._getStyleBySelectorText(`#${e.id}`,`background-color`)||this._getStyleBySelectorText(`#${e.id}`,a)||this._getStyleBySelectorText(e.nodeName.toLowerCase(),a)||this._getStyleBySelectorText(e.nodeName,`background-color`)||n[`background-color`]||``;o&&(i+=`background:${o};`);continue}if(a===`text-decoration`){let t=``;e.classList.forEach(e=>{t=this._getStyleBySelectorText(`.${e}`,`text-decoration-line`)||this._getStyleBySelectorText(`.${e}`,a)});let o=r.getPropertyValue(`text-decoration-line`)||r.getPropertyValue(`text-decoration`)||t||this._getStyleBySelectorText(`#${e.id}`,`text-decoration-line`)||this._getStyleBySelectorText(`#${e.id}`,a)||this._getStyleBySelectorText(e.nodeName.toLowerCase(),a)||this._getStyleBySelectorText(e.nodeName,`text-decoration-line`)||n[`text-decoration-line`]||``;o&&(i+=`text-decoration:${o};`);continue}let o=``;e.classList.forEach(e=>{o=this._getStyleBySelectorText(`.${e}`,a)}),o=r.getPropertyValue(a)||this._getStyleBySelectorText(`#${e.id}`,a)||o||this._getStyleBySelectorText(e.nodeName.toLowerCase(),a)||n[a]||``,o&&(i+=`${a}:${o};`)}return i}_parseTable(e,t){let n=new Rh,r=hht(e)??[],{rowProperties:i=[]}=fht(e),a=this._parseTableByHtml(this._dom,t,this._getCurrentSkeleton()?.skeleton);return a&&a.forValue((e,t,r)=>{var i,a;let o=wJe(void 0,r.style);if(r!=null&&(i=r.richTextParma)!=null&&(i=i.p)!=null&&(i=i.body)!=null&&(i=i.textRuns)!=null&&i.length){var s,c,l;let e=r==null||(s=r.richTextParma)==null||(s=s.v)==null?void 0:s.length;for(let t=0;t<(r==null||(c=r.richTextParma)==null||(c=c.p)==null||(c=c.body)==null||(c=c.textRuns)==null?void 0:c.length);t++){var u;let n=r==null||(u=r.richTextParma)==null||(u=u.p)==null||(u=u.body)==null?void 0:u.textRuns[t];if(n.st===0&&n.ed===e){var d;o={...n.ts,...o},r==null||(d=r.richTextParma)==null||(d=d.p)==null||(d=d.body)==null||d.textRuns.splice(t,1),t--}}if((r==null||(l=r.richTextParma)==null||(l=l.p)==null||(l=l.body)==null||(l=l.textRuns)==null?void 0:l.length)===0){var f;r.content=r==null||(f=r.richTextParma)==null?void 0:f.v,delete r.richTextParma}}let p=r!=null&&(a=r.richTextParma)!=null&&(a=a.p)!=null&&(a=a.body)!=null&&a.textRuns?{v:r.richTextParma.v,p:r.richTextParma.p,s:o,rowSpan:r.rowSpan,colSpan:r.colSpan}:{v:r.content,s:o,rowSpan:r.rowSpan,colSpan:r.colSpan};r.numfmtPattern&&(p.s={...p.s,n:{pattern:r.numfmtPattern}},p.v=Number(p.v)),n.setValue(e,t,p)}),{rowProperties:i,colProperties:r,cellMatrix:n}}_parseTableByHtml(e,t,n){let r=new Rh,i=e.querySelectorAll(`table`)[t];if(!i)return r;let a=this._getStyle(i,``),o=i?.querySelectorAll(`tr`);for(let e=0;e<o.length;e++){let t=o[e],i=this._getStyle(t,a),l=t.querySelectorAll(`td, th`),u=0;for(let t=0;t<l.length;){let a=l[t],o=``,d=Number(a.getAttribute(`rowSpan`))||1,f=Number(a.getAttribute(`colSpan`))||1;if(o=this._getStyle(a,i),e>0){var s;let t=r.getValue(e-1,u);if(t!=null&&(s=t.style)!=null&&s.includes(`border-bottom`)&&o.includes(`border-top`)){let e=_ht(t.style,`border-bottom`);e&&PN(e.substr(e.indexOf(`:`)+1))!==`none`&&(o=o.replace(/border-top:[^;]+;/,``))}}if(t>0){var c;let t=r.getValue(e,u-1);if(t!=null&&(c=t.style)!=null&&c.includes(`border-right`)&&o.includes(`border-left`)){let e=_ht(t.style,`border-right`);e&&PN(e.substr(e.indexOf(`:`)+1))!==`none`&&(o=o.replace(/border-left:[^;]+;/,``))}}let p=``,m,h,g=this._getMsoNumfmtForNode(a);if(g){p=a.innerHTML,p.includes(`mso-spacerun:yes`)&&(p=bht(p));let e=kh(p);if(typeof e?.v==`number`&&(e.z===g||rd(g,e.v)===p))p=e.v.toString(),h=g;else if(e&&e.z)p=e.v.toString(),h=e.z;else if(!e){let e=xht(p);e!==null&&!Number.isNaN(e)&&rd(g,e)===p&&(p=e.toString(),h=g)}}if(!h){let e=this._getCellTextAndRichText(a,o,n);p=e.cellText,m=e.cellRichStyle}let _={rowSpan:d,colSpan:f,content:p,style:o,richTextParma:{p:m,v:p},numfmtPattern:h};if(r.getValue(e,u)){u+=1;continue}d>1||f>1?vht(r,o,_,{colSpan:f,rowSpan:d,rowIndex:e,colIndex:t,colSetValueIndex:u}):r.setValue(e,u,_),u+=f,t++}}return r}_parseCellHtml(e,t,n,r=new Map,i){for(let a of t)if(a.nodeType===Node.TEXT_NODE){let t=a.nodeValue?.replace(/[\r\n]/g,``),i;e&&r.has(e)&&(i=r.get(e)),n.dataStream+=t,i&&Object.getOwnPropertyNames(i).length&&n.textRuns.push({st:n.dataStream.length-t.length,ed:n.dataStream.length,ts:i})}else if(a.nodeType===Node.COMMENT_NODE||a.nodeName===`STYLE`)continue;else if(a.nodeName.toLowerCase()===`br`)n.paragraphs||=[],n.paragraphs.push({startIndex:n.dataStream.length}),n.dataStream+=`\r`;else if(a.nodeType===Node.ELEMENT_NODE){let t=this._getStyle(a,i),o=e?r.get(e):{},s=a$(a,pht(t));r.set(a,{...o,...s});let{childNodes:c}=a;this._parseCellHtml(a,c,n,r,t)}}_getCellTextAndRichText(e,t,n){if(e.innerHTML.includes(`mso-spacerun:yes`)){let t=bht(e.innerHTML),n=kh(t);if(n&&n.z&&typeof n.v==`number`)return{cellText:t,cellRichStyle:void 0}}let r=``,i;if(/<[^>]+>/.test(e.innerHTML)&&n){let a={dataStream:``,textRuns:[]};this._parseCellHtml(null,e.childNodes,a,void 0,t);let o=n.getBlankCellDocumentModel()?.documentModel,s=o?.getSnapshot(),c=`${a.dataStream}\r\n`,l={...s,body:{dataStream:c,textRuns:a.textRuns,paragraphs:o$(c)}};o?.reset(l),i=o?.getSnapshot(),r=a.dataStream}else r=ght(e.innerHTML.replace(/[\r\n]/g,``));return{cellText:r,cellRichStyle:i}}_generateDocumentDataModelSnapshot(e){let t=this._getCurrentSkeleton();if(t==null)return null;let{skeleton:n}=t,r=n.getBlankCellDocumentModel()?.documentModel,i={...r?.getSnapshot(),...e};return r?.reset(i),r?.getSnapshot()}process(e,t,n,r){for(let a of t)if(a.nodeName.toLowerCase()===`table`){var i;r.push({index:(n==null||(i=n.paragraphs)==null?void 0:i.length)||0})}else if(a.nodeType===Node.TEXT_NODE){if(a.nodeValue?.trim()===``)continue;let t=a.nodeValue?.replace(/[\r\n]/g,``),r;e&&this._styleCache.has(e)&&(r=this._styleCache.get(e));let i={dataStream:``,textRuns:[]};n.dataStream+=t,i.dataStream+=t,r&&Object.getOwnPropertyNames(r).length&&(n.textRuns.push({st:n.dataStream.length-t.length,ed:n.dataStream.length,ts:r}),i.textRuns.push({st:n.dataStream.length-t.length,ed:n.dataStream.length,ts:r}))}else if(Ix.includes(a.nodeName.toLowerCase()))continue;else if(a.nodeName.toLowerCase()===`br`)n.paragraphs||=[],n.paragraphs.push({startIndex:n.dataStream.length}),n.dataStream+=`\r`;else if(a.nodeType===Node.ELEMENT_NODE){if(a.nodeName===`STYLE`)continue;let t=a,i=this._processBeforeLink(t,{body:n}),o=e?this._styleCache.get(e):{},s=this._styleRules.find(({filter:e})=>dht(a,e)),c=s?s.getStyle(a):a$(a);this._styleCache.set(a,{...o,...c});let{childNodes:l}=a;this.process(a,l,n,r);let u=this._afterProcessRules.find(({filter:e})=>dht(a,e));u&&u.handler(n,a),this._processAfterLink(t,{body:n},i)}}_processBeforeLink(e,t){return t.body.dataStream.length}_processAfterLink(e,t,n){let r=t.body,i=e;if(i.tagName.toUpperCase()===`A`){let e=i.href;if(!ep(e))return;r.customRanges=r.customRanges??[],r.customRanges.push({startIndex:n,endIndex:r.dataStream.length-1,rangeId:i.dataset.rangeid??ip(),rangeType:Rp.HYPERLINK,properties:{url:e}})}}dispose(){this._dom=null,this._styleCache.clear(),this._styleMap.clear(),this._msoNumfmtMap.clear()}};Q(s$,`_pluginList`,[]);function fht(e){let t=e.matchAll(/<tr([\s\S]*?)>([\s\S]*?)<\/tr>/gi);if(!t)return{rowProperties:[],rowCount:0};let n=Array.from(t).map(e=>mht(e[1])).map(e=>{if(!e.height){let t=e.style,n=t&&t.match(/height\s*:\s*(\d+(\.\d+)?)px/);e.height=`${n?Number.parseInt(n[1],10):24}`}return e});return{rowProperties:n,rowCount:n.length}}function pht(e){let t={};return e.split(`;`).forEach(e=>{let[n,r]=e.split(`:`);t[n]=r}),t}function mht(e){if(!e)return{};let t={},n=/([\w-]+)\s*=\s*(?:(['"])([^'"]*)\2|(\S+))/g,r;for(;(r=n.exec(e))!==null;){let[,e,,n,i]=r;t[e]=n===void 0?i:n}return t}function hht(e){let t=e.match(/<colgroup([\s\S]*?)>(.*?)<\/colgroup>/),n=/<col([\s\S]*?)>/g,r;if(r=t?.[2]?t[2].matchAll(n):e.matchAll(n),!r)return null;let i=Array.from(r).map(e=>mht(e[1])),a=[];return i.forEach(e=>{let t=Number(e.span);if(t)for(let n=0;n<t;n++){let t={...e};delete t.span,a.push(t)}else a.push(e)}),a}function ght(e){let t={"<":`<`,">":`>`,"&":`&`,""":`"`,"'":`'`," ":` `};return e.replace(/<|>|&|"|'| |<br>/g,e=>t[e])}function _ht(e,t){if(!e||!t)return null;let n=RegExp(`(${t}\\s*:\\s*[^;]+);`,`i`),r=e.match(n);return r?r[1]:null}function vht(e,t,n,r){let{rowSpan:i,colSpan:a,rowIndex:o,colSetValueIndex:s}=r;for(let r=o;r<o+i;r++)for(let i=s;i<s+a;i++)r===o&&i===s?e.setValue(r,i,{...n,style:t}):e.setValue(r,i,{style:t})}function yht(e){let t=e.replace(/\\([0-9a-fA-F]{4})/g,(e,t)=>String.fromCharCode(Number.parseInt(t,16)));return t=t.replace(/\\\\/g,`\0BACKSLASH\0`),t=t.replace(/\\([^\\])/g,`$1`),t=t.replace(/\x00BACKSLASH\x00/g,`\\`),t}function bht(e){return e.replace(/<span[^>]*mso-spacerun:yes[^>]*>/gi,``).replace(/<\/span>/gi,``).replace(/\u00A0| /gi,``)}function xht(e){let t=e.match(/\(?-?\d[\d,]*(\.\d+)?%?\)?/);if(!t)return null;let n=t[0],r=n.includes(`%`);n=n.replace(/[,%]/g,``),/^\(.*\)$/.test(n)&&(n=`-${n.slice(1,-1)}`);let i=Number(n);return r&&(i/=100),i}var Sht={name:`univer-sheet-paste-plugin-lark`,checkPasteType(e){return/lark-record-clipboard/i.test(e)},stylesRules:[{filter:[`s`],getStyle(e){let t=a$(e);return{st:{s:Np.TRUE},...t}}}],afterProcessRules:[{filter(e){return e.tagName===`DIV`&&/ace-line/i.test(e.className)},handler(e){e.paragraphs??=[],e.paragraphs.push({startIndex:e.dataStream.length}),e.dataStream+=`\r`}}]},Cht={name:`univer-sheet-paste-plugin-univer`,checkPasteType(e){return/UniverNormal/i.test(e)},stylesRules:[],afterProcessRules:[{filter(e){return e.tagName===`P`&&/UniverNormal/i.test(e.className)},handler(e,t){e.paragraphs??=[];let n={startIndex:e.dataStream.length},r=cht(t);r&&(n.paragraphStyle=r),e.paragraphs.push(n),e.dataStream+=`\r`}}]},wht={name:`univer-sheet-paste-plugin-word`,checkPasteType(e){return/word|mso/i.test(e)},stylesRules:[{filter:[`b`],getStyle(e){let t=a$(e);return{bl:Np.TRUE,...t}}}],afterProcessRules:[{filter(e){return e.tagName===`P`&&/mso/i.test(e.className)},handler(e,t){e.paragraphs??=[];let n={startIndex:e.dataStream.length},r=cht(t);r&&(n.paragraphStyle=r),e.paragraphs.push(n),e.dataStream+=`\r`}}]},c$=function(e){return e.COPY=`COPY`,e.CUT=`CUT`,e}({});function Tht(e,t,n,r,i){return`<tr${u$(l$(n.map(t=>t.onCopyRow?.call(t,e)).filter(e=>!!e)))}>${t.map(t=>{if(!i.has(`${e}-${t}`)){let a=r.getValue(e,t);if(a?.rowSpan&&a?.colSpan)for(let n=e;n<e+a.rowSpan;n++)for(let e=t;e<t+a.colSpan;e++)i.add(`${n}-${e}`);return Eht(e,t,n,r)}return null}).filter(e=>!!e).join(``)}</tr>`}function Eht(e,t,n,r){let i=r.getValue(e,t);return`<td${u$(l$(n.map(n=>n.onCopyCellStyle?.call(n,e,t,i?.rowSpan,i?.colSpan)).filter(e=>!!e)))}>${n.reduce((n,r)=>n||r.onCopyCellContent?.call(r,e,t)||``,``)}</td>`}function Dht(e,t){return`<colgroup>${e.map(e=>`<col ${u$(l$(t.map(t=>t.onCopyColumn?.call(t,e)).filter(e=>!!e)))} />`).join(``)}</colgroup>`}function l$(e){return e.reduce((e,t)=>(Object.keys(t).forEach(n=>{e[n]?e[n]+=`;${t[n]}`:e[n]=t[n]}),e),{})}function u$(e){return Object.keys(e).reduce((t,n)=>`${t} ${n}="${e[n]}"`,``)}var Oht=class{convert(e,t,n,r){let{cols:i,rows:a}=t;if(!i.length)return``;let o=Dht(i,n),s=[],c=new Set;return a.forEach(t=>{s.push(Tht(t,i,n,e,c))}),`<google-sheets-html-origin><table data-copy-id="${r}" xmlns="http://www.w3.org/1999/xhtml" cellspacing="0" cellpadding="0" dir="ltr" style="table-layout:fixed;font-size:10pt;font-family:Arial;width:0px;border-collapse:collapse;border:none">${o}
|
|
589
589
|
<tbody>${s.join(``)}</tbody></table>`}},kht=(e,t,n=!1)=>{let r=e=>e.endRow-e.startRow+1,i=e=>e.endColumn-e.startColumn+1,a=r(t)%r(e),o=i(t)%i(e),s={startRow:0,endRow:r(e)-1,startColumn:0,endColumn:i(e)-1},c=Math.floor(r(t)/r(e)),l=Math.floor(i(t)/i(e)),u=[];if(!a&&!o)for(let n=1;n<=c;n++)for(let a=1;a<=l;a++){let o=r(e)*(n-1),c=i(e)*(a-1),l={startRow:o+t.startRow,endRow:o+t.startRow,startColumn:c+t.startColumn,endColumn:c+t.startColumn};u.push({repeatRelativeRange:s,startRange:l})}else if(!a&&o&&!n)for(let n=1;n<=c;n++){let i=r(e)*(n-1),a={startRow:i+t.startRow,endRow:i+t.startRow,startColumn:0+t.startColumn,endColumn:0+t.startColumn};u.push({repeatRelativeRange:s,startRange:a})}else if(a&&!o&&!n)for(let n=1;n<=l;n++){let r=i(e)*(n-1),a={startRow:0+t.startRow,endRow:0+t.startRow,startColumn:r+t.startColumn,endColumn:r+t.startColumn};u.push({repeatRelativeRange:s,startRange:a})}else{let e={startRow:t.startRow,endRow:t.startRow,startColumn:t.startColumn,endColumn:t.startColumn};u.push({startRange:e,repeatRelativeRange:s})}return u};function Aht(e){return e?[/<td[^>]*class=".*?xl.*?"[^>]*>/i,/xmlns:x="urn:schemas-microsoft-com:office:excel"/i,/ProgId="Excel.Sheet"/i,/xmlns:o="urn:schemas-microsoft-com:office:office"/i,/@mso-|mso-excel/i,/<x:ExcelWorkbook>/i].some(t=>t.test(e)):!1}function jht(e){return e?(e.match(/<img[^>]*src\s*=\s*["']data:image\/[^;]+;base64,[^"']*["'][^>]*>/i)||[]).length>0:!1}function Mht(...e){if(e.length===1)return e[0];let t=new Rh;return e.forEach(e=>{e&&new Rh(e).forValue((e,n,r)=>{t.setValue(e,n,{...t.getValue(e,n),...r})})}),t.getMatrix()}function Nht(e,t){return e.id===t.id&&e.params.unitId===t.params.unitId&&e.params.subUnitId===t.params.subUnitId}function Pht(e){let t=[];for(let n=0;n<e.length;){let r=1;if(e[n].id===RK.id){let i=e[n],a=[i];for(;n+r<e.length&&Nht(i,e[n+r]);)a.push(e[n+r]),r+=1;let o=Mht(...a.map(e=>e.params.cellValue||{}));t.push({...i,params:{...i.params,cellValue:o}})}else t.push(e[n]);n+=r}return t}function Fht(e,t={}){let{maxCellsPerChunk:n=2500,threshold:r=6e3,maxChunks:i=10}=t;if(e.id!==RK.id)return[e];let{cellValue:a}=e.params;if(!a)return[e];let o=new Rh(a),s=0,c=1/0,l=-1/0,u=1/0,d=-1/0;if(o.forValue((e,t)=>{s++,c=Math.min(c,e),l=Math.max(l,e),u=Math.min(u,t),d=Math.max(d,t)}),c===1/0||s<=r)return[e];let f=[],p=d-u+1,m=Math.max(1,Math.floor(n/p)),h=l-c+1;Math.ceil(h/m)>i&&(m=Math.ceil(h/i));for(let t=c;t<=l;t+=m){let n=Math.min(t+m-1,l),r=new Rh,i=!1;for(let e=t;e<=n;e++)for(let t=u;t<=d;t++){let n=o.getValue(e,t);n!==void 0&&(r.setValue(e,t,n),i=!0)}i&&f.push({...e,params:{...e.params,cellValue:r.getMatrix(),__splitChunk__:!0}})}return f.length>0?f:[e]}function d$(e,t){let{startRow:n,endRow:r,startColumn:i,endColumn:a}=e;for(let e=n;e<=r;e++)for(let n=i;n<=a;n++)if(t.rows.includes(e)&&t.cols.includes(n))return!0}function Iht(e,t){let{startRow:n,endRow:r,startColumn:i,endColumn:a}=t;for(let t=n;t<=r;t++)if(!e.rows.includes(t))return!1;for(let t=i;t<=a;t++)if(!e.cols.includes(t))return!1;return!0}function Lht(e){let t=e.trim().split(`
|