From 925ffca31072569d812e4faeb56445b765b58e22 Mon Sep 17 00:00:00 2001 From: pipipi-pikachu Date: Mon, 11 Jul 2022 13:25:13 +0000 Subject: [PATCH] deploy to github pages f35cbcc0d6aa8f6392620bfc1408f39325f36323 --- css/{app.01845596.css => app.f24d1357.css} | 2 +- index.html | 2 +- js/app.4b1981c0.js | 2 -- js/app.4b1981c0.js.map | 1 - js/app.95b5a2d2.js | 2 ++ js/app.95b5a2d2.js.map | 1 + 6 files changed, 5 insertions(+), 5 deletions(-) rename css/{app.01845596.css => app.f24d1357.css} (99%) delete mode 100644 js/app.4b1981c0.js delete mode 100644 js/app.4b1981c0.js.map create mode 100644 js/app.95b5a2d2.js create mode 100644 js/app.95b5a2d2.js.map diff --git a/css/app.01845596.css b/css/app.f24d1357.css similarity index 99% rename from css/app.01845596.css rename to css/app.f24d1357.css index 9851548c..1fa161e8 100644 --- a/css/app.01845596.css +++ b/css/app.f24d1357.css @@ -1 +1 @@ -.hotkey-doc[data-v-4b1afc5f]{height:100%;overflow:auto;font-size:12px;margin:0 -24px;padding:0 24px}.title[data-v-4b1afc5f]{font-size:14px;font-weight:700;border-bottom:1px solid #e5e5e5;padding:24px 0 5px 0}.title[data-v-4b1afc5f]:first-child{padding-top:0}.hotkey-item[data-v-4b1afc5f]{border-bottom:1px solid #e5e5e5;padding:15px 0 5px 0;display:flex;align-items:center}.label[data-v-4b1afc5f]{width:140px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.editor-header[data-v-6c34fc9c]{background-color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-bottom:1px solid #eee;display:flex;justify-content:space-between;padding:0 10px}.left[data-v-6c34fc9c],.menu-item[data-v-6c34fc9c],.right[data-v-6c34fc9c]{display:flex;justify-content:center;align-items:center}.menu-item[data-v-6c34fc9c]{height:100%;font-size:14px;padding:0 10px;transition:background-color .2s;cursor:pointer}.menu-item .text[data-v-6c34fc9c]{margin-left:4px}.left .menu-item[data-v-6c34fc9c]:hover{background-color:#f9f9f9}svg[data-v-71b17928],svg[data-v-41071294],svg[data-v-b5bace06]{overflow:visible;position:absolute;z-index:2;top:0;left:0}.image-clip-handler[data-v-3e0199ec]{width:100%;height:100%;position:relative}.image-clip-handler .bottom-img[data-v-3e0199ec]{top:0;left:0;width:100%;height:100%;opacity:.5}.image-clip-handler img[data-v-3e0199ec]{width:100%;height:100%}.image-clip-handler .top-image-content[data-v-3e0199ec]{position:absolute;overflow:hidden}.image-clip-handler .top-image-content img[data-v-3e0199ec]{position:absolute}.operate[data-v-3e0199ec]{position:absolute;width:100%;height:100%;top:0;left:0;cursor:move}.clip-point[data-v-3e0199ec]{position:absolute;width:16px;height:16px}.clip-point svg[data-v-3e0199ec]{overflow:visible}.clip-point.left-top[data-v-3e0199ec]{left:0;top:0}.clip-point.right-top[data-v-3e0199ec]{left:100%;top:0;transform:rotate(90deg);transform-origin:0 0}.clip-point.left-bottom[data-v-3e0199ec]{left:0;top:100%;transform:rotate(-90deg);transform-origin:0 0}.clip-point.right-bottom[data-v-3e0199ec]{left:100%;top:100%;transform:rotate(180deg);transform-origin:0 0}.clip-point.top[data-v-3e0199ec]{left:50%;top:0;margin-left:-8px}.clip-point.bottom[data-v-3e0199ec]{left:50%;bottom:0;margin-left:-8px;transform:rotate(180deg)}.clip-point.left[data-v-3e0199ec]{left:0;top:50%;margin-top:-8px;transform:rotate(-90deg)}.clip-point.right[data-v-3e0199ec]{right:0;top:50%;margin-top:-8px;transform:rotate(90deg)}.clip-point.bottom.rotate-135[data-v-3e0199ec],.clip-point.left-bottom.rotate-90[data-v-3e0199ec],.clip-point.left-top.rotate-0[data-v-3e0199ec],.clip-point.left.rotate-45[data-v-3e0199ec],.clip-point.right-bottom.rotate-0[data-v-3e0199ec],.clip-point.right-top.rotate-90[data-v-3e0199ec],.clip-point.right.rotate-45[data-v-3e0199ec],.clip-point.top.rotate-135[data-v-3e0199ec]{cursor:nwse-resize}.clip-point.bottom.rotate-0[data-v-3e0199ec],.clip-point.left-bottom.rotate-135[data-v-3e0199ec],.clip-point.left-top.rotate-45[data-v-3e0199ec],.clip-point.left.rotate-90[data-v-3e0199ec],.clip-point.right-bottom.rotate-45[data-v-3e0199ec],.clip-point.right-top.rotate-135[data-v-3e0199ec],.clip-point.right.rotate-90[data-v-3e0199ec],.clip-point.top.rotate-0[data-v-3e0199ec]{cursor:ns-resize}.clip-point.bottom.rotate-45[data-v-3e0199ec],.clip-point.left-bottom.rotate-0[data-v-3e0199ec],.clip-point.left-top.rotate-90[data-v-3e0199ec],.clip-point.left.rotate-135[data-v-3e0199ec],.clip-point.right-bottom.rotate-90[data-v-3e0199ec],.clip-point.right-top.rotate-0[data-v-3e0199ec],.clip-point.right.rotate-135[data-v-3e0199ec],.clip-point.top.rotate-45[data-v-3e0199ec]{cursor:nesw-resize}.clip-point.bottom.rotate-90[data-v-3e0199ec],.clip-point.left-bottom.rotate-45[data-v-3e0199ec],.clip-point.left-top.rotate-135[data-v-3e0199ec],.clip-point.left.rotate-0[data-v-3e0199ec],.clip-point.right-bottom.rotate-135[data-v-3e0199ec],.clip-point.right-top.rotate-45[data-v-3e0199ec],.clip-point.right.rotate-0[data-v-3e0199ec],.clip-point.top.rotate-90[data-v-3e0199ec]{cursor:ew-resize}.editable-element-image[data-v-30dc7050]{position:absolute}.editable-element-image.lock .element-content[data-v-30dc7050]{cursor:default}.rotate-wrapper[data-v-30dc7050]{width:100%;height:100%}.element-content[data-v-30dc7050]{width:100%;height:100%;position:relative;cursor:move}.element-content .image-content[data-v-30dc7050]{width:100%;height:100%;overflow:hidden;position:relative}.element-content img[data-v-30dc7050]{position:absolute}svg[data-v-61b7d06a]{overflow:visible;position:absolute;top:0;left:0}.prosemirror-editor[data-v-1debd6ff]{cursor:text}.editable-element-text[data-v-7135a611]{position:absolute}.editable-element-text.lock .element-content[data-v-7135a611]{cursor:default}.rotate-wrapper[data-v-7135a611]{width:100%;height:100%}.element-content[data-v-7135a611]{position:relative;padding:10px;line-height:1.5;word-break:break-word;cursor:move}.element-content .text[data-v-7135a611]{position:relative}.element-content[data-v-7135a611] a{cursor:text}.drag-handler[data-v-7135a611]{height:10px;position:absolute;left:0;right:0}.drag-handler.top[data-v-7135a611]{top:0}.drag-handler.bottom[data-v-7135a611]{bottom:0}.editable-element-shape[data-v-d4c718fa]{position:absolute;pointer-events:none}.editable-element-shape.lock .element-content[data-v-d4c718fa]{cursor:default}.rotate-wrapper[data-v-d4c718fa]{width:100%;height:100%}.element-content[data-v-d4c718fa]{width:100%;height:100%;position:relative;cursor:move}.element-content svg[data-v-d4c718fa]{transform-origin:0 0;overflow:visible}.element-content .shape-path[data-v-d4c718fa]{pointer-events:all}.shape-text[data-v-d4c718fa]{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;padding:10px;line-height:1.2;word-break:break-word;pointer-events:none}.shape-text.editable[data-v-d4c718fa]{pointer-events:all}.shape-text.top[data-v-d4c718fa]{justify-content:flex-start}.shape-text.middle[data-v-d4c718fa]{justify-content:center}.shape-text.bottom[data-v-d4c718fa]{justify-content:flex-end}.editable-element-shape[data-v-6550e504]{position:absolute;pointer-events:none}.editable-element-shape.lock .line-path[data-v-6550e504],.editable-element-shape.lock .line-point[data-v-6550e504]{cursor:default}.element-content[data-v-6550e504]{width:100%;height:100%;position:relative}.element-content svg[data-v-6550e504]{transform-origin:0 0;overflow:visible}.line-path[data-v-6550e504],.line-point[data-v-6550e504]{pointer-events:all;cursor:move}.chart[data-v-1aa2357d]{display:flex}.chart-content[data-v-1aa2357d]{transform-origin:0 0}.chart-content{--theme-color-1:#666;--theme-color-2:#666;--theme-color-3:#666;--theme-color-4:#666;--theme-color-5:#666;--theme-color-6:#666;--theme-color-7:#666;--theme-color-8:#666;--theme-color-9:#666;--theme-color-10:#666;--grid-color:rgba(0,0,0,0.4)}.chart-content .ct-series-a .ct-line,.chart-content .ct-series-a .ct-point{stroke:var(--theme-color-1)}.chart-content .ct-series-a .ct-area{fill:var(--theme-color-1)}.chart-content .ct-series-a .ct-bar{stroke:var(--theme-color-1)}.chart-content .ct-series-a .ct-slice-pie{fill:var(--theme-color-1)}.chart-content .ct-series-a .ct-slice-donut{stroke:var(--theme-color-1)}.chart-content .ct-series-b .ct-line,.chart-content .ct-series-b .ct-point{stroke:var(--theme-color-2)}.chart-content .ct-series-b .ct-area{fill:var(--theme-color-2)}.chart-content .ct-series-b .ct-bar{stroke:var(--theme-color-2)}.chart-content .ct-series-b .ct-slice-pie{fill:var(--theme-color-2)}.chart-content .ct-series-b .ct-slice-donut{stroke:var(--theme-color-2)}.chart-content .ct-series-c .ct-line,.chart-content .ct-series-c .ct-point{stroke:var(--theme-color-3)}.chart-content .ct-series-c .ct-area{fill:var(--theme-color-3)}.chart-content .ct-series-c .ct-bar{stroke:var(--theme-color-3)}.chart-content .ct-series-c .ct-slice-pie{fill:var(--theme-color-3)}.chart-content .ct-series-c .ct-slice-donut{stroke:var(--theme-color-3)}.chart-content .ct-series-d .ct-line,.chart-content .ct-series-d .ct-point{stroke:var(--theme-color-4)}.chart-content .ct-series-d .ct-area{fill:var(--theme-color-4)}.chart-content .ct-series-d .ct-bar{stroke:var(--theme-color-4)}.chart-content .ct-series-d .ct-slice-pie{fill:var(--theme-color-4)}.chart-content .ct-series-d .ct-slice-donut{stroke:var(--theme-color-4)}.chart-content .ct-series-e .ct-line,.chart-content .ct-series-e .ct-point{stroke:var(--theme-color-5)}.chart-content .ct-series-e .ct-area{fill:var(--theme-color-5)}.chart-content .ct-series-e .ct-bar{stroke:var(--theme-color-5)}.chart-content .ct-series-e .ct-slice-pie{fill:var(--theme-color-5)}.chart-content .ct-series-e .ct-slice-donut{stroke:var(--theme-color-5)}.chart-content .ct-series-f .ct-line,.chart-content .ct-series-f .ct-point{stroke:var(--theme-color-6)}.chart-content .ct-series-f .ct-area{fill:var(--theme-color-6)}.chart-content .ct-series-f .ct-bar{stroke:var(--theme-color-6)}.chart-content .ct-series-f .ct-slice-pie{fill:var(--theme-color-6)}.chart-content .ct-series-f .ct-slice-donut{stroke:var(--theme-color-6)}.chart-content .ct-series-g .ct-line,.chart-content .ct-series-g .ct-point{stroke:var(--theme-color-7)}.chart-content .ct-series-g .ct-area{fill:var(--theme-color-7)}.chart-content .ct-series-g .ct-bar{stroke:var(--theme-color-7)}.chart-content .ct-series-g .ct-slice-pie{fill:var(--theme-color-7)}.chart-content .ct-series-g .ct-slice-donut{stroke:var(--theme-color-7)}.chart-content .ct-series-h .ct-line,.chart-content .ct-series-h .ct-point{stroke:var(--theme-color-8)}.chart-content .ct-series-h .ct-area{fill:var(--theme-color-8)}.chart-content .ct-series-h .ct-bar{stroke:var(--theme-color-8)}.chart-content .ct-series-h .ct-slice-pie{fill:var(--theme-color-8)}.chart-content .ct-series-h .ct-slice-donut{stroke:var(--theme-color-8)}.chart-content .ct-series-i .ct-line,.chart-content .ct-series-i .ct-point{stroke:var(--theme-color-9)}.chart-content .ct-series-i .ct-area{fill:var(--theme-color-9)}.chart-content .ct-series-i .ct-bar{stroke:var(--theme-color-9)}.chart-content .ct-series-i .ct-slice-pie{fill:var(--theme-color-9)}.chart-content .ct-series-i .ct-slice-donut{stroke:var(--theme-color-9)}.chart-content .ct-grid{stroke:var(--grid-color)}.chart-content .ct-label{fill:var(--grid-color);color:var(--grid-color)}.legends{height:20px;justify-content:center;font-size:14px}.legend,.legends{display:flex;align-items:center}.legend+.legend{margin-left:10px}.legend .block{width:10px;height:10px;margin-right:5px}.editable-element-chart[data-v-f3c03862]{position:absolute}.editable-element-chart.lock .element-content[data-v-f3c03862]{cursor:default}.rotate-wrapper[data-v-f3c03862]{width:100%;height:100%}.element-content[data-v-f3c03862]{width:100%;height:100%;overflow:hidden;cursor:move}.custom-textarea[data-v-cdb58a1e]{border:0;outline:0;-webkit-user-modify:read-write-plaintext-only;-moz-user-modify:read-write-plaintext-only}.editable-table[data-v-bae8c794],table[data-v-bae8c794]{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}table[data-v-bae8c794]{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0;border:0;word-wrap:break-word;--themeColor:$themeColor;--subThemeColor1:$themeColor;--subThemeColor2:$themeColor}table.theme[data-v-bae8c794]{background-color:#fff}table.theme tr:nth-child(2n) .cell[data-v-bae8c794]{background-color:var(--subThemeColor1)}table.theme tr:nth-child(odd) .cell[data-v-bae8c794]{background-color:var(--subThemeColor2)}table.theme.col-footer tr .cell[data-v-bae8c794]:last-child,table.theme.col-header tr .cell[data-v-bae8c794]:first-child,table.theme.row-footer tr:last-child .cell[data-v-bae8c794],table.theme.row-header tr:first-child .cell[data-v-bae8c794]{background-color:var(--themeColor)}table tr[data-v-bae8c794]{height:36px}table .cell[data-v-bae8c794]{position:relative;white-space:normal;word-wrap:break-word;vertical-align:middle;font-size:14px;cursor:default}table .cell.selected[data-v-bae8c794]:after{content:"";width:100%;height:100%;position:absolute;top:0;left:0;background-color:hsla(0,0%,40%,.4)}table .cell-text[data-v-bae8c794]{min-height:32px;padding:5px;line-height:1.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:text}table .cell-text.active[data-v-bae8c794]{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.drag-line[data-v-bae8c794]{position:absolute;top:0;bottom:0;width:3px;background-color:#d14424;margin-left:-1px;opacity:0;z-index:2;cursor:col-resize}.editable-element-table[data-v-6391c486]{position:absolute}.editable-element-table.lock .element-content[data-v-6391c486]{cursor:default}.rotate-wrapper[data-v-6391c486]{width:100%;height:100%}.element-content[data-v-6391c486]{width:100%;height:100%;position:relative;cursor:move}.table-mask[data-v-6391c486]{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .2s}.table-mask .mask-tip[data-v-6391c486]{position:absolute;top:5px;left:5px;background-color:rgba(0,0,0,.5);color:#fff;padding:6px 12px;font-size:12px;transform-origin:0 0}.table-mask[data-v-6391c486]:hover:not(.lock){opacity:.9}.editable-element-latex[data-v-31390388]{position:absolute}.editable-element-latex.lock .element-content[data-v-31390388]{cursor:default}.rotate-wrapper[data-v-31390388]{width:100%;height:100%}.element-content[data-v-31390388]{width:100%;height:100%;position:relative;cursor:move}.element-content svg[data-v-31390388]{transform-origin:0 0;overflow:visible}.video-player[data-v-2fc4c202]{position:relative;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:1;transform-origin:0 0}@media(min-width:900px){.video-player.playing .controller-mask[data-v-2fc4c202],.video-player.playing .controller[data-v-2fc4c202]{opacity:0}.video-player.playing:hover .controller-mask[data-v-2fc4c202],.video-player.playing:hover .controller[data-v-2fc4c202]{opacity:1}}.video-player.loading .bezel .diplayer-loading-icon[data-v-2fc4c202]{display:block}.video-player.hide-controller[data-v-2fc4c202]{cursor:none}.video-player.hide-controller .controller-mask[data-v-2fc4c202],.video-player.hide-controller .controller[data-v-2fc4c202]{opacity:0;transform:translateY(100%)}.video-wrap[data-v-2fc4c202]{position:relative;background:#000;font-size:0;width:100%;height:100%}.video-wrap .video[data-v-2fc4c202]{width:100%;height:100%}.controller-mask[data-v-2fc4c202]{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom;height:98px;width:100%;position:absolute;bottom:0;transition:all .3s ease}.controller[data-v-2fc4c202]{position:absolute;bottom:0;left:0;right:0;height:41px;padding:0 20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:all .3s ease}.controller .bar-wrap[data-v-2fc4c202]{padding:5px 0;cursor:pointer;position:absolute;bottom:33px;width:calc(100% - 40px);height:3px}.controller .bar-wrap:hover .bar .played .thumb[data-v-2fc4c202]{transform:scale(1)}.controller .bar-wrap .bar-time[data-v-2fc4c202]{position:absolute;left:0;top:-20px;border-radius:4px;padding:5px 7px;background-color:rgba(0,0,0,.62);color:#fff;font-size:12px;text-align:center;opacity:1;transition:opacity .1s ease-in-out;word-wrap:normal;word-break:normal;z-index:2;pointer-events:none}.controller .bar-wrap .bar-time.hidden[data-v-2fc4c202]{opacity:0}.controller .bar-wrap .bar[data-v-2fc4c202]{position:relative;height:3px;width:100%;background:hsla(0,0%,100%,.2);cursor:pointer}.controller .bar-wrap .bar .loaded[data-v-2fc4c202]{position:absolute;left:0;top:0;bottom:0;background:hsla(0,0%,100%,.4);height:3px;transition:all .5s ease;will-change:width}.controller .bar-wrap .bar .played[data-v-2fc4c202]{position:absolute;left:0;top:0;bottom:0;height:3px;will-change:width;background-color:#fff}.controller .bar-wrap .bar .played .thumb[data-v-2fc4c202]{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer;transition:all .3s ease-in-out;transform:scale(0);background-color:#fff}.controller .icons[data-v-2fc4c202]{height:38px;position:absolute;bottom:0;display:flex;align-items:center}.controller .icons.icons-right[data-v-2fc4c202]{right:8px}.controller .icons .time[data-v-2fc4c202]{line-height:38px;color:#eee;text-shadow:0 0 2px rgba(0,0,0,.5);vertical-align:middle;font-size:13px;cursor:default}.controller .icons .icon[data-v-2fc4c202]{width:40px;height:100%;position:relative;cursor:pointer;display:flex;align-items:center;font-size:20px}.controller .icons .icon.play-icon[data-v-2fc4c202]{font-size:26px}.controller .icons .icon .icon-content[data-v-2fc4c202]{transition:all .2s ease-in-out;opacity:.8;color:#fff}.controller .icons .icon.loop-icon[data-v-2fc4c202]{font-size:12px}.controller .icons .icon.loop-icon .icon-content[data-v-2fc4c202]{opacity:.5}.controller .icons .icon.speed-icon[data-v-2fc4c202]{font-size:12px;position:relative}.controller .icons .icon .speed-menu[data-v-2fc4c202]{width:70px;position:absolute;bottom:30px;left:-23px;background-color:#22211b;padding:5px 0;color:#ddd}.controller .icons .icon .speed-menu .speed-menu-item[data-v-2fc4c202]{padding:8px 0;text-align:center}.controller .icons .icon .speed-menu .speed-menu-item[data-v-2fc4c202]:hover{background-color:#393833;color:#fff}.controller .icons .icon .speed-menu .speed-menu-item.active[data-v-2fc4c202]{font-weight:700;color:#fff}.controller .icons .icon.active .icon-content[data-v-2fc4c202],.controller .icons .icon:hover .icon-content[data-v-2fc4c202]{opacity:1}.controller .icons .volume[data-v-2fc4c202]{height:100%;position:relative;cursor:pointer;display:flex;align-items:center}.controller .icons .volume:hover .volume-bar-wrap .volume-bar[data-v-2fc4c202]{width:45px}.controller .icons .volume:hover .volume-bar-wrap .volume-bar .volume-bar-inner .thumb[data-v-2fc4c202]{transform:scale(1)}.controller .icons .volume.volume-active .volume-bar-wrap .volume-bar[data-v-2fc4c202]{width:45px}.controller .icons .volume.volume-active .volume-bar-wrap .volume-bar .volume-bar-inner .thumb[data-v-2fc4c202]{transform:scale(1)}.controller .icons .volume-bar-wrap[data-v-2fc4c202]{display:inline-block;margin:0 15px 0 -5px;vertical-align:middle;height:100%}.controller .icons .volume-bar[data-v-2fc4c202]{position:relative;top:17px;width:0;height:3px;background:#aaa;transition:all .3s ease-in-out}.controller .icons .volume-bar .volume-bar-inner[data-v-2fc4c202]{position:absolute;bottom:0;left:0;height:100%;transition:all .1s ease;will-change:width;background-color:#fff}.controller .icons .volume-bar .volume-bar-inner .thumb[data-v-2fc4c202]{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer;transition:all .3s ease-in-out;transform:scale(0);background-color:#fff}.controller .icons .loop[data-v-2fc4c202]{display:inline-block;height:100%}.bezel[data-v-2fc4c202]{position:absolute;left:0;right:0;top:0;bottom:0;font-size:22px;color:#fff;pointer-events:none}.bezel .bezel-icon[data-v-2fc4c202]{position:absolute;top:50%;left:50%;margin:-26px 0 0 -26px;height:52px;width:52px;padding:12px;display:flex;justify-content:center;align-items:center;background:rgba(0,0,0,.5);border-radius:50%;opacity:0;pointer-events:none;font-size:40px}.bezel .bezel-icon.bezel-transition[data-v-2fc4c202]{-webkit-animation:bezel-hide-2fc4c202 .5s linear;animation:bezel-hide-2fc4c202 .5s linear}@-webkit-keyframes bezel-hide-2fc4c202{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}@keyframes bezel-hide-2fc4c202{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}.bezel .loading-icon[data-v-2fc4c202]{display:none;position:absolute;top:50%;left:50%;margin:-18px 0 0 -18px;height:36px;width:36px;pointer-events:none}.bezel .loading-icon .loading-hide[data-v-2fc4c202]{display:none}.bezel .loading-icon .loading-dot[data-v-2fc4c202]{-webkit-animation:loading-dot-fade-2fc4c202 .8s ease infinite;animation:loading-dot-fade-2fc4c202 .8s ease infinite;opacity:0;transform-origin:4px 4px}.bezel .loading-icon .loading-dot.loading-dot-7[data-v-2fc4c202]{-webkit-animation-delay:.7s;animation-delay:.7s}.bezel .loading-icon .loading-dot.loading-dot-6[data-v-2fc4c202]{-webkit-animation-delay:.6s;animation-delay:.6s}.bezel .loading-icon .loading-dot.loading-dot-5[data-v-2fc4c202]{-webkit-animation-delay:.5s;animation-delay:.5s}.bezel .loading-icon .loading-dot.loading-dot-4[data-v-2fc4c202]{-webkit-animation-delay:.4s;animation-delay:.4s}.bezel .loading-icon .loading-dot.loading-dot-3[data-v-2fc4c202]{-webkit-animation-delay:.3s;animation-delay:.3s}.bezel .loading-icon .loading-dot.loading-dot-2[data-v-2fc4c202]{-webkit-animation-delay:.2s;animation-delay:.2s}.bezel .loading-icon .loading-dot.loading-dot-1[data-v-2fc4c202]{-webkit-animation-delay:.1s;animation-delay:.1s}@-webkit-keyframes loading-dot-fade-2fc4c202{0%{opacity:.7;transform:scale(1.2)}50%{opacity:.25;transform:scale(.9)}to{opacity:.25;transform:scale(.85)}}@keyframes loading-dot-fade-2fc4c202{0%{opacity:.7;transform:scale(1.2)}50%{opacity:.25;transform:scale(.9)}to{opacity:.25;transform:scale(.85)}}.editable-element-video[data-v-9d5469c6]{position:absolute}.editable-element-video.lock .handler-border[data-v-9d5469c6]{cursor:default}.rotate-wrapper[data-v-9d5469c6]{width:100%;height:100%}.element-content[data-v-9d5469c6]{width:100%;height:100%;position:relative}.handler-border[data-v-9d5469c6]{position:absolute;cursor:move}.handler-border.t[data-v-9d5469c6]{width:100%;height:20px;top:0;left:0}.handler-border.b[data-v-9d5469c6]{width:100%;height:5px;bottom:0;left:0}.handler-border.l[data-v-9d5469c6]{width:10px;height:100%;left:0;top:0}.handler-border.r[data-v-9d5469c6]{width:10px;height:100%;right:0;top:0}.audio-player[data-v-121f3d11]{width:280px;height:50px;position:relative;line-height:1;transform-origin:0 0;background:#000}.audio-player[data-v-121f3d11],.controller[data-v-121f3d11]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.controller[data-v-121f3d11]{position:absolute;bottom:0;left:0;right:0;height:41px;padding:0 20px;transition:all .3s ease}.controller .bar-wrap[data-v-121f3d11]{padding:5px 0;cursor:pointer;position:absolute;bottom:35px;width:calc(100% - 40px);height:3px}.controller .bar-wrap:hover .bar .played .thumb[data-v-121f3d11]{transform:scale(1)}.controller .bar-wrap .bar-time[data-v-121f3d11]{position:absolute;left:0;top:-20px;border-radius:4px;padding:5px 7px;background-color:rgba(0,0,0,.62);color:#fff;font-size:12px;text-align:center;opacity:1;transition:opacity .1s ease-in-out;word-wrap:normal;word-break:normal;z-index:2;pointer-events:none}.controller .bar-wrap .bar-time.hidden[data-v-121f3d11]{opacity:0}.controller .bar-wrap .bar[data-v-121f3d11]{position:relative;height:3px;width:100%;background:hsla(0,0%,100%,.2);cursor:pointer}.controller .bar-wrap .bar .loaded[data-v-121f3d11]{position:absolute;left:0;top:0;bottom:0;background:hsla(0,0%,100%,.4);height:3px;transition:all .5s ease;will-change:width}.controller .bar-wrap .bar .played[data-v-121f3d11]{position:absolute;left:0;top:0;bottom:0;height:3px;will-change:width;background-color:#fff}.controller .bar-wrap .bar .played .thumb[data-v-121f3d11]{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer;transition:all .3s ease-in-out;transform:scale(0);background-color:#fff}.controller .icons[data-v-121f3d11]{height:38px;position:absolute;bottom:0;left:14px;display:flex;align-items:center}.controller .icons .icon[data-v-121f3d11]{width:36px;height:100%;position:relative;cursor:pointer;display:flex;align-items:center;font-size:20px}.controller .icons .icon.play-icon[data-v-121f3d11]{font-size:26px}.controller .icons .icon .icon-content[data-v-121f3d11]{transition:all .2s ease-in-out;opacity:.8;color:#fff}.controller .icons .icon.active .icon-content[data-v-121f3d11],.controller .icons .icon:hover .icon-content[data-v-121f3d11]{opacity:1}.controller .icons .volume[data-v-121f3d11]{height:100%;position:relative;cursor:pointer;display:flex;align-items:center}.controller .icons .volume:hover .volume-bar-wrap .volume-bar[data-v-121f3d11]{width:45px}.controller .icons .volume:hover .volume-bar-wrap .volume-bar .volume-bar-inner .thumb[data-v-121f3d11]{transform:scale(1)}.controller .icons .volume.volume-active .volume-bar-wrap .volume-bar[data-v-121f3d11]{width:45px}.controller .icons .volume.volume-active .volume-bar-wrap .volume-bar .volume-bar-inner .thumb[data-v-121f3d11]{transform:scale(1)}.controller .icons .volume-bar-wrap[data-v-121f3d11]{display:inline-block;margin:0 15px 0 -5px;vertical-align:middle;height:100%}.controller .icons .volume-bar[data-v-121f3d11]{position:relative;top:17px;width:0;height:3px;background:#aaa;transition:all .3s ease-in-out}.controller .icons .volume-bar .volume-bar-inner[data-v-121f3d11]{position:absolute;bottom:0;left:0;height:100%;transition:all .1s ease;will-change:width;background-color:#fff}.controller .icons .volume-bar .volume-bar-inner .thumb[data-v-121f3d11]{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer;transition:all .3s ease-in-out;transform:scale(0);background-color:#fff}.controller .time[data-v-121f3d11]{height:38px;position:absolute;right:20px;bottom:0;display:flex;align-items:center;line-height:38px;color:#eee;text-shadow:0 0 2px rgba(0,0,0,.5);vertical-align:middle;font-size:13px;cursor:default}.controller .time .ptime[data-v-121f3d11]{margin-right:2px}.controller .time .dtime[data-v-121f3d11]{margin-left:2px}.editable-element-audio[data-v-001bfbc4]{position:absolute}.editable-element-audio.lock .audio-icon[data-v-001bfbc4]{cursor:default}.rotate-wrapper[data-v-001bfbc4]{width:100%;height:100%}.element-content[data-v-001bfbc4]{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.audio-icon[data-v-001bfbc4]{cursor:move}.audio-player[data-v-001bfbc4]{position:absolute}.mouse-selection[data-v-0d6c0f73]{position:absolute;background-color:rgba(209,68,36,.1);border:1px solid #d14424;z-index:200}.mouse-selection.quadrant-1[data-v-0d6c0f73]{transform-origin:0 0;transform:rotate(180deg)}.mouse-selection.quadrant-2[data-v-0d6c0f73]{transform-origin:50% 0;transform:rotate(180deg)}.mouse-selection.quadrant-3[data-v-0d6c0f73]{transform-origin:0 50%;transform:rotate(180deg)}.mouse-selection.quadrant-4[data-v-0d6c0f73]{transform-origin:0 0;transform:rotate(0deg)}.grid-lines[data-v-10cd6d44]{width:100%;height:100%;overflow:visible;z-index:999;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0}.viewport-background[data-v-6f1e1261]{width:100%;height:100%;background-position:50%;position:absolute}.alignment-line[data-v-37fa6068]{position:absolute;z-index:100}.alignment-line .line[data-v-37fa6068]{width:0;height:0;border:0 dashed #d14424}.alignment-line .line.vertical[data-v-37fa6068]{transform:translateY(-.5px);border-left-width:1px}.alignment-line .line.horizontal[data-v-37fa6068]{transform:translateX(-.5px);border-top-width:1px}.ruler[data-v-60e06332]{font-size:12px}.h[data-v-60e06332]{position:absolute;background-color:#fff;border:1px solid #eee;height:20px;top:5px;display:flex;justify-content:space-between;align-items:center}.h .ruler-marker-100[data-v-60e06332]{height:100%;line-height:20px;text-align:right;flex:1;padding-right:5px;position:relative}.h .ruler-marker-100.hide span[data-v-60e06332],.h .ruler-marker-100.omit[data-v-60e06332]:before{display:none}.h .ruler-marker-100[data-v-60e06332]:not(:last-child):after{content:"";width:.1px;height:12px;position:absolute;right:0;bottom:0;background-color:#999}.h .ruler-marker-100[data-v-60e06332]:before{content:"";width:.1px;height:8px;position:absolute;right:50%;bottom:0;background-color:#999}.v[data-v-60e06332]{position:absolute;background-color:#fff;border:1px solid #eee;width:20px;left:5px;overflow:hidden}.v .ruler-marker-100[data-v-60e06332]{width:100%;line-height:20px;text-align:right;padding-bottom:5px;position:relative;-ms-writing-mode:tb-rl;writing-mode:vertical-rl}.v .ruler-marker-100.hide span[data-v-60e06332],.v .ruler-marker-100.omit[data-v-60e06332]:before{display:none}.v .ruler-marker-100[data-v-60e06332]:not(:last-child):after{content:"";height:.1px;width:12px;position:absolute;bottom:0;right:0;background-color:#999}.v .ruler-marker-100[data-v-60e06332]:before{content:"";height:.1px;width:8px;position:absolute;bottom:50%;right:0;background-color:#999}.element-create-selection[data-v-5a941f07]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2;cursor:crosshair}.element-create-selection svg[data-v-5a941f07]{overflow:visible}.selection[data-v-5a941f07]{position:absolute;opacity:.8}.selection[data-v-5a941f07]:not(.line){border:1px solid #d14424}.resize-handler[data-v-881ee3f8]{position:absolute;width:10px;height:10px;left:0;top:0;margin:-5px 0 0 -5px;border:1px solid #d14424;background-color:#fff;border-radius:1px;cursor:pointer}.resize-handler.bottom.rotate-135[data-v-881ee3f8],.resize-handler.left-bottom.rotate-90[data-v-881ee3f8],.resize-handler.left-top.rotate-0[data-v-881ee3f8],.resize-handler.left.rotate-45[data-v-881ee3f8],.resize-handler.right-bottom.rotate-0[data-v-881ee3f8],.resize-handler.right-top.rotate-90[data-v-881ee3f8],.resize-handler.right.rotate-45[data-v-881ee3f8],.resize-handler.top.rotate-135[data-v-881ee3f8]{cursor:nwse-resize}.resize-handler.bottom.rotate-0[data-v-881ee3f8],.resize-handler.left-bottom.rotate-135[data-v-881ee3f8],.resize-handler.left-top.rotate-45[data-v-881ee3f8],.resize-handler.left.rotate-90[data-v-881ee3f8],.resize-handler.right-bottom.rotate-45[data-v-881ee3f8],.resize-handler.right-top.rotate-135[data-v-881ee3f8],.resize-handler.right.rotate-90[data-v-881ee3f8],.resize-handler.top.rotate-0[data-v-881ee3f8]{cursor:ns-resize}.resize-handler.bottom.rotate-45[data-v-881ee3f8],.resize-handler.left-bottom.rotate-0[data-v-881ee3f8],.resize-handler.left-top.rotate-90[data-v-881ee3f8],.resize-handler.left.rotate-135[data-v-881ee3f8],.resize-handler.right-bottom.rotate-90[data-v-881ee3f8],.resize-handler.right-top.rotate-0[data-v-881ee3f8],.resize-handler.right.rotate-135[data-v-881ee3f8],.resize-handler.top.rotate-45[data-v-881ee3f8]{cursor:nesw-resize}.resize-handler.bottom.rotate-90[data-v-881ee3f8],.resize-handler.left-bottom.rotate-45[data-v-881ee3f8],.resize-handler.left-top.rotate-135[data-v-881ee3f8],.resize-handler.left.rotate-0[data-v-881ee3f8],.resize-handler.right-bottom.rotate-135[data-v-881ee3f8],.resize-handler.right-top.rotate-45[data-v-881ee3f8],.resize-handler.right.rotate-0[data-v-881ee3f8],.resize-handler.top.rotate-90[data-v-881ee3f8]{cursor:ew-resize}.border-line[data-v-7170d1be]{position:absolute;width:0;height:0;left:0;top:0;border:0 dashed #d14424}.border-line.top[data-v-7170d1be]{border-top-width:1px}.border-line.bottom[data-v-7170d1be]{border-bottom-width:1px}.border-line.left[data-v-7170d1be]{border-left-width:1px}.border-line.right[data-v-7170d1be]{border-right-width:1px}.border-line.wide[data-v-7170d1be]:before{content:"";position:absolute;background:transparent;cursor:move}.border-line.wide.top[data-v-7170d1be]:before{top:-8px;left:-8px;width:calc(100% + 16px);height:16px}.border-line.wide.bottom[data-v-7170d1be]:before{bottom:-8px;left:-8px;width:calc(100% + 16px);height:16px}.border-line.wide.left[data-v-7170d1be]:before{top:-8px;left:-8px;width:16px;height:calc(100% + 16px)}.border-line.wide.right[data-v-7170d1be]:before{top:-8px;right:-8px;width:16px;height:calc(100% + 16px)}.multi-select-operate[data-v-defbd922]{position:absolute;top:0;left:0;z-index:101}.rotate-handler[data-v-b99d8dae]{position:absolute;width:10px;height:10px;top:-25px;margin-left:-5px;border:1px solid #d14424;background-color:#fff;border-radius:1px;cursor:-webkit-grab;cursor:grab}.rotate-handler[data-v-b99d8dae]:active{cursor:-webkit-grabbing;cursor:grabbing}.image-element-operate.cliping[data-v-46b250c2]{visibility:hidden}.operate-keypoint-handler[data-v-fd38df18]{position:absolute;width:10px;height:10px;left:0;top:0;margin:-5px 0 0 -5px;border:1px solid #d14424;background-color:#ffe873;border-radius:1px}svg[data-v-4659f395]{position:absolute;left:0;top:0;pointer-events:none;transform-origin:0 0}.anchor-line[data-v-4659f395]{stroke-width:1px;stroke-dasharray:5 5;opacity:.5}.link-handler[data-v-bb722fc0]{height:30px;position:absolute;left:0;font-size:12px;padding:0 10px;background-color:#fff;box-shadow:3px 3px 3px rgba(0,0,0,.15);display:flex;align-items:center;color:#d14424}.link[data-v-bb722fc0]{max-width:300px;margin-right:20px;word-break:keep-all;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.btns[data-v-bb722fc0]{display:flex;align-items:center}.btns .btn[data-v-bb722fc0]{word-break:keep-all;cursor:pointer}.operate[data-v-27793fbf]{position:absolute;z-index:100;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.operate.multi-select[data-v-27793fbf]{opacity:0}.animation-index[data-v-27793fbf]{position:absolute;top:0;left:-24px;font-size:12px}.animation-index .index-item[data-v-27793fbf]{width:18px;height:18px;background-color:#fff;color:#d14424;border:1px solid #d14424;display:flex;justify-content:center;align-items:center}.animation-index .index-item+.index-item[data-v-27793fbf]{margin-top:5px}.base-element-image[data-v-66f2009f]{position:absolute}.rotate-wrapper[data-v-66f2009f]{width:100%;height:100%}.element-content[data-v-66f2009f]{width:100%;height:100%;position:relative}.element-content .image-content[data-v-66f2009f]{width:100%;height:100%;overflow:hidden;position:relative}.base-element-text[data-v-659e869d],.element-content img[data-v-66f2009f]{position:absolute}.rotate-wrapper[data-v-659e869d]{width:100%;height:100%}.element-content[data-v-659e869d]{position:relative;padding:10px;line-height:1.5;word-break:break-word}.element-content .text[data-v-659e869d]{position:relative}.base-element-shape[data-v-073084bf]{position:absolute}.rotate-wrapper[data-v-073084bf]{width:100%;height:100%}.element-content[data-v-073084bf]{width:100%;height:100%;position:relative}.element-content svg[data-v-073084bf]{transform-origin:0 0;overflow:visible}.shape-text[data-v-073084bf]{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;padding:10px;line-height:1.2;word-break:break-word}.shape-text.top[data-v-073084bf]{justify-content:flex-start}.shape-text.middle[data-v-073084bf]{justify-content:center}.shape-text.bottom[data-v-073084bf]{justify-content:flex-end}.base-element-line[data-v-340cdee8]{position:absolute}.element-content[data-v-340cdee8]{width:100%;height:100%;position:relative}.element-content svg[data-v-340cdee8]{transform-origin:0 0;overflow:visible}.base-element-chart[data-v-7d2e5c4e]{position:absolute}.element-content[data-v-7d2e5c4e],.rotate-wrapper[data-v-7d2e5c4e]{width:100%;height:100%}.static-table[data-v-00712fa4],table[data-v-00712fa4]{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}table[data-v-00712fa4]{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0;border:0;word-wrap:break-word;--themeColor:$themeColor;--subThemeColor1:$themeColor;--subThemeColor2:$themeColor}table.theme[data-v-00712fa4]{background-color:#fff}table.theme tr:nth-child(2n) .cell[data-v-00712fa4]{background-color:var(--subThemeColor1)}table.theme tr:nth-child(odd) .cell[data-v-00712fa4]{background-color:var(--subThemeColor2)}table.theme.col-footer tr .cell[data-v-00712fa4]:last-child,table.theme.col-header tr .cell[data-v-00712fa4]:first-child,table.theme.row-footer tr:last-child .cell[data-v-00712fa4],table.theme.row-header tr:first-child .cell[data-v-00712fa4]{background-color:var(--themeColor)}table tr[data-v-00712fa4]{height:36px}table .cell[data-v-00712fa4]{position:relative;white-space:normal;word-wrap:break-word;vertical-align:middle}table .cell-text[data-v-00712fa4]{min-height:32px;padding:5px;line-height:1.5}.base-element-table[data-v-53e0f1ba]{position:absolute}.rotate-wrapper[data-v-53e0f1ba]{width:100%;height:100%}.element-content[data-v-53e0f1ba]{width:100%;height:100%;position:relative}.base-element-latex[data-v-9a47b5f4]{position:absolute}.rotate-wrapper[data-v-9a47b5f4]{width:100%;height:100%}.element-content[data-v-9a47b5f4]{width:100%;height:100%;position:relative}.element-content svg[data-v-9a47b5f4]{transform-origin:0 0;overflow:visible}.base-element-video[data-v-56b7f716]{position:absolute}.rotate-wrapper[data-v-56b7f716]{width:100%;height:100%}.element-content[data-v-56b7f716]{width:100%;height:100%;background-color:#000;background-position:50%;background-size:contain;background-repeat:no-repeat;display:flex;justify-content:center;align-items:center}.icon[data-v-56b7f716]{font-size:140px;color:#aaa}.base-element-audio[data-v-5258e03b]{position:absolute}.rotate-wrapper[data-v-5258e03b]{width:100%;height:100%}.element-content[data-v-5258e03b]{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.audio-icon[data-v-5258e03b]{cursor:move}.thumbnail-slide[data-v-f69fb5b2]{background-color:#fff;overflow:hidden}.elements[data-v-f69fb5b2]{transform-origin:0 0}.background[data-v-f69fb5b2]{width:100%;height:100%;background-position:50%;position:absolute}.placeholder[data-v-f69fb5b2]{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.tabs[data-v-dfb654e8]{display:flex;justify-content:flex-start;align-items:center;border-bottom:1px solid #eee;margin-bottom:20px}.tab[data-v-dfb654e8]{padding:0 10px 8px;border-bottom:2px solid transparent;cursor:pointer}.tab.active[data-v-dfb654e8]{border-bottom:2px solid #d14424}.input[data-v-dfb654e8]{width:100%;height:32px}.preview[data-v-dfb654e8]{margin-top:12px}.thumbnail[data-v-dfb654e8]{outline:1px solid rgba(209,68,36,.15);margin-top:5px}.btns[data-v-dfb654e8]{margin-top:20px;text-align:right}.canvas[data-v-1db12f3f]{height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;background-color:#f9f9f9;position:relative}.drag-mask[data-v-1db12f3f]{cursor:-webkit-grab;cursor:grab;position:absolute;top:0;right:0;bottom:0;left:0}.viewport-wrapper[data-v-1db12f3f]{position:absolute;box-shadow:0 0 15px 0 rgba(0,0,0,.1)}.viewport[data-v-1db12f3f]{position:absolute;top:0;left:0;transform-origin:0 0}.shape-pool[data-v-5788e0d2]{width:340px;max-height:520px;overflow:auto;margin-top:-12px;margin-bottom:-12px;margin-right:-12px;padding-right:12px;padding-top:12px}.category-name[data-v-5788e0d2]{width:100%;font-size:13px;margin-bottom:10px;border-left:4px solid #aaa;background-color:#eee;padding:2px 0 2px 10px}.shape-list[data-v-5788e0d2]{display:flex;flex-wrap:wrap;align-content:flex-start;margin-bottom:10px}.shape-item[data-v-5788e0d2]{width:8%;margin-bottom:2.22222%;height:0;padding-bottom:8%;flex-shrink:0;position:relative;cursor:pointer}.shape-item[data-v-5788e0d2]:not(:nth-child(10n)){margin-right:2.22222%}.shape-content[data-v-5788e0d2]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center}.shape-content:hover .shape-path[data-v-5788e0d2]:not(.outlined){stroke:#d14424}.shape-content:hover .shape-path.outlined[data-v-5788e0d2]{fill:#d14424}.shape-content svg[data-v-5788e0d2]:not(:root){overflow:visible}.line-pool[data-v-bca68faa]{width:220px;overflow:auto;margin-bottom:-12px;margin-right:-12px;padding-right:12px}.category-name[data-v-bca68faa]{width:100%;font-size:13px;margin-bottom:10px;border-left:4px solid #aaa;background-color:#eee;padding:2px 0 2px 10px}.line-list[data-v-bca68faa]{display:flex;flex-wrap:wrap;align-content:flex-start;margin-bottom:10px}.line-item[data-v-bca68faa]{width:19%;margin-bottom:1.25%;height:0;padding-bottom:19%;flex-shrink:0;position:relative;cursor:pointer}.line-item[data-v-bca68faa]:not(:nth-child(5n)){margin-right:1.25%}.line-content[data-v-bca68faa]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;color:#999}.line-content[data-v-bca68faa]:hover{color:#d14424}.line-content svg[data-v-bca68faa]:not(:root){overflow:visible}.chart-pool[data-v-3870b42e]{width:200px;margin-bottom:-5px;display:flex;flex-wrap:wrap;align-content:flex-start}.chart-item[data-v-3870b42e]{width:19%;margin-bottom:1.25%;height:0;padding-bottom:19%;flex-shrink:0;position:relative;cursor:pointer}.chart-item[data-v-3870b42e]:not(:nth-child(5n)){margin-right:1.25%}.chart-content[data-v-3870b42e]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;color:#999}.chart-content[data-v-3870b42e]:hover{color:#d14424}.table-generator[data-v-144fbd05]{width:100%;margin-top:-12px}.title[data-v-144fbd05]{height:28px;line-height:28px;background-color:#ededed;margin:0 -12px 12px -12px;padding:0 14px;font-size:12px;display:flex;justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.title .right[data-v-144fbd05]{cursor:pointer}.title .right[data-v-144fbd05]:hover{color:#d14424}table[data-v-144fbd05]{border-collapse:separate}td[data-v-144fbd05]{width:23px;height:23px;line-height:23px;border:2px solid #fff;background-color:#f7f7f7}.cell[data-v-144fbd05]{width:100%;height:100%;border:1px solid #dcdcdc}.cell.active[data-v-144fbd05]{background-color:rgba(209,68,36,.1);border-color:#d14424}.custom[data-v-144fbd05]{width:230px}.custom .row[data-v-144fbd05]{display:flex;align-items:center}.custom .row+.row[data-v-144fbd05]{margin-top:10px}.btns[data-v-144fbd05]{margin-top:10px;text-align:right}.btns .btn[data-v-144fbd05]{margin-left:10px}.media-input[data-v-b9437110]{width:480px}.tabs[data-v-b9437110]{display:flex;justify-content:flex-start;align-items:center;border-bottom:1px solid #eee;margin-bottom:20px}.tab[data-v-b9437110]{padding:0 10px 8px;border-bottom:2px solid transparent;cursor:pointer}.tab.active[data-v-b9437110]{border-bottom:2px solid #d14424}.btns[data-v-b9437110]{margin-top:10px;text-align:right}svg[data-v-1c41d9fe]{overflow:hidden}.latex-editor[data-v-2d73bf28]{height:560px}.container[data-v-2d73bf28]{height:calc(100% - 50px);display:flex;padding-top:25px}.left[data-v-2d73bf28]{width:540px;height:100%;display:flex;flex-direction:column}.input-area[data-v-2d73bf28]{flex:1}.input-area textarea[data-v-2d73bf28]{height:100%!important;border-color:#eee!important;padding:10px!important}.input-area textarea[data-v-2d73bf28]:focus{box-shadow:none!important}.preview[data-v-2d73bf28]{height:160px;display:flex;justify-content:center;align-items:center;text-align:center;margin-top:20px;border:1px solid #eee;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.placeholder[data-v-2d73bf28]{color:#888}.preview-content[data-v-2d73bf28]{width:100%;height:100%;padding:10px;display:flex;justify-content:center;align-items:center}.right[data-v-2d73bf28]{height:100%;margin-left:20px;flex:1;border:1px solid #eee;background-color:#fff;flex-direction:column}.right[data-v-2d73bf28],.tabs[data-v-2d73bf28]{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tabs[data-v-2d73bf28]{height:40px;font-size:12px;flex-shrink:0}.tab[data-v-2d73bf28]{flex:1;display:flex;justify-content:center;align-items:center;background-color:#f9f9f9;border-bottom:1px solid #eee;cursor:pointer}.tab.active[data-v-2d73bf28]{background-color:#fff;border-bottom-color:#fff}.tab+.tab[data-v-2d73bf28]{border-left:1px solid #eee}.content[data-v-2d73bf28]{height:calc(100% - 40px);font-size:13px}.formula[data-v-2d73bf28]{height:100%;padding:12px;overflow:auto;overflow:overlay}.formula-item+.formula-item[data-v-2d73bf28]{margin-top:10px}.formula-item .formula-title[data-v-2d73bf28]{margin-bottom:5px}.formula-item .formula-item-content[data-v-2d73bf28]{width:246px;height:60px;padding:5px;display:flex;align-items:center;background-color:#f9f9f9;cursor:pointer}.symbol-tabs[data-v-2d73bf28]{display:flex;justify-content:space-around;align-items:center;border-bottom:1px solid #eee;margin:12px 12px 5px}.symbol-tab[data-v-2d73bf28]{padding:6px 10px;border-bottom:2px solid transparent;cursor:pointer}.symbol-tab.active[data-v-2d73bf28]{border-bottom:2px solid #d14424}.symbol[data-v-2d73bf28]{height:100%;display:flex;flex-direction:column}.symbol-pool[data-v-2d73bf28]{display:flex;flex-wrap:wrap;flex:1;padding:12px;overflow:auto;overflow:overlay}.symbol-item[data-v-2d73bf28]{display:flex;justify-content:center;align-items:center}.symbol-item[data-v-2d73bf28]:hover{background-color:#f9f9f9;cursor:pointer}.footer[data-v-2d73bf28]{height:50px;display:flex;justify-content:flex-end;align-items:flex-end}.footer .btn[data-v-2d73bf28]{margin-left:10px}.canvas-tool[data-v-5d4eff54]{position:relative;border-bottom:1px solid #eee;background-color:#fff;display:flex;justify-content:space-between;padding:0 10px;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.left-handler[data-v-5d4eff54]{display:flex;align-items:center}.add-element-handler[data-v-5d4eff54]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex}.handler-item[data-v-5d4eff54]{margin:0 10px;font-size:14px;cursor:pointer}.handler-item.disable[data-v-5d4eff54]{opacity:.5}.handler-item.active[data-v-5d4eff54]{color:#d14424}.right-handler[data-v-5d4eff54]{display:flex;align-items:center}.right-handler .text[data-v-5d4eff54]{width:40px;text-align:center;cursor:pointer}.right-handler .viewport-size[data-v-5d4eff54]{font-size:13px}.preset-item[data-v-5d4eff54]{padding:8px 20px;text-align:center;cursor:pointer}.preset-item[data-v-5d4eff54]:hover{color:#d14424}.layout-pool[data-v-cc6b7dca]{width:394px;height:500px;padding:2px;margin-right:-12px;padding-right:12px;overflow:auto;display:flex;flex-wrap:wrap;align-content:flex-start}.layout-item[data-v-cc6b7dca]{width:48%;margin-bottom:4%}.layout-item[data-v-cc6b7dca]:not(:nth-child(2n)){margin-right:4%}.layout-item .thumbnail[data-v-cc6b7dca]{outline:1px solid #eee;cursor:pointer}.layout-item .thumbnail[data-v-cc6b7dca]:hover{outline-color:#d14424}.thumbnails[data-v-153c0b44]{border-right:1px solid #eee;background-color:#fff;display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.add-slide[data-v-153c0b44]{height:40px;font-size:12px;display:flex;flex-shrink:0;border-bottom:1px solid #eee;cursor:pointer}.add-slide .btn[data-v-153c0b44]{flex:1;display:flex;justify-content:center;align-items:center}.add-slide .btn[data-v-153c0b44]:hover{background-color:#f9f9f9}.add-slide .select-btn[data-v-153c0b44]{width:30px;display:flex;justify-content:center;align-items:center;border-left:1px solid #eee}.add-slide .select-btn[data-v-153c0b44]:hover{background-color:#f9f9f9}.add-slide .icon[data-v-153c0b44]{margin-right:3px;font-size:14px}.thumbnail-list[data-v-153c0b44]{padding:5px 0;flex:1;overflow:auto}.thumbnail-item[data-v-153c0b44]{display:flex;justify-content:center;align-items:center;padding:5px 0}.thumbnail-item .thumbnail[data-v-153c0b44]{outline:1px solid rgba(209,68,36,.15)}.thumbnail-item.active .label[data-v-153c0b44]{color:#d14424}.thumbnail-item.active .thumbnail[data-v-153c0b44],.thumbnail-item.selected .thumbnail[data-v-153c0b44]{outline-color:#d14424}.label[data-v-153c0b44]{font-size:12px;color:#999;width:20px;cursor:-webkit-grab;cursor:grab}.label.offset-left[data-v-153c0b44]{position:relative;left:-4px}.label[data-v-153c0b44]:active{cursor:-webkit-grabbing;cursor:grabbing}.row[data-v-22345a51]{width:100%;display:flex;align-items:center;margin-bottom:10px}.slider[data-v-22345a51]{flex:3}.color-btn[data-v-ed8f2044]{display:flex;align-items:center;justify-content:center;padding:0!important}.color-block[data-v-ed8f2044]{height:20px;margin-left:8px;flex:1;outline:1px dashed hsla(0,0%,40%,.12);background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAEBJREFUOE9jfPbs2X8GIoCkpCQRqhgYGEcNxBlOo2GIM2iGQLL5//8/UTnl+fPnxOWUUQNxhtNoGOLOKYM+2QAAh2Nq10DwkukAAAAASUVORK5CYII=)}.content[data-v-ed8f2044]{width:100%;height:100%}.color-btn-icon[data-v-ed8f2044]{width:30px;font-size:12px;margin-top:2px;color:#bfbfbf}.row[data-v-e91e3764]{width:100%;display:flex;align-items:center;margin-bottom:10px}.switch-wrapper[data-v-e91e3764]{text-align:right}.row[data-v-053ed706]{width:100%;display:flex;align-items:center;margin-bottom:10px}.switch-wrapper[data-v-053ed706]{text-align:right}.slider[data-v-053ed706]{flex:3}.text-style-panel[data-v-5830b9cf]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.row[data-v-5830b9cf]{width:100%;display:flex;align-items:center;margin-bottom:10px}.preset-style[data-v-5830b9cf]{display:flex;flex-wrap:wrap;margin-bottom:10px}.preset-style-item[data-v-5830b9cf]{width:50%;height:50px;border:1px solid #d6d6d6;box-sizing:border-box;display:flex;justify-content:center;align-items:center;position:relative;cursor:pointer;transition:all .2s}.preset-style-item[data-v-5830b9cf]:hover{border-color:#d14424;color:#d14424;z-index:1}.preset-style-item[data-v-5830b9cf]:nth-child(2n){margin-left:-1px}.preset-style-item[data-v-5830b9cf]:nth-child(n+3){margin-top:-1px}.text-color-btn[data-v-5830b9cf]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:0}.text-color-block[data-v-5830b9cf]{width:16px;height:3px;margin-top:1px}.font-size-btn[data-v-5830b9cf]{padding:0}.link-popover[data-v-5830b9cf]{width:240px}.link-popover .btns[data-v-5830b9cf]{margin-top:10px;text-align:right}.row[data-v-37fbdfde],.row[data-v-59a1646e]{width:100%;display:flex;align-items:center;margin-bottom:10px}.switch-wrapper[data-v-37fbdfde]{text-align:right}.filter[data-v-37fbdfde]{font-size:12px}.filter-item[data-v-37fbdfde]{padding:8px 0;display:flex;justify-content:center;align-items:center}.filter-item .name[data-v-37fbdfde]{width:60px}.filter-item .filter-slider[data-v-37fbdfde]{flex:1;margin:0 6px}.row[data-v-7da35bec]{width:100%;display:flex;align-items:center;margin-bottom:10px}.switch-wrapper[data-v-7da35bec]{text-align:right}.origin-image[data-v-7da35bec]{height:100px;background-size:contain;background-repeat:no-repeat;background-position:50%;background-color:#f9f9f9;margin-bottom:10px}.full-width-btn[data-v-7da35bec]{width:100%;margin-bottom:10px}.btn-icon[data-v-7da35bec]{margin-right:3px}.clip[data-v-7da35bec]{width:260px;font-size:12px}.clip .title[data-v-7da35bec]{margin-bottom:5px}.shape-clip[data-v-7da35bec]{margin-bottom:10px;display:flex;flex-wrap:wrap;align-content:flex-start}.shape-clip-item[data-v-7da35bec]{display:flex;justify-content:center;align-items:center;cursor:pointer;width:16%;margin-bottom:5%}.shape-clip-item[data-v-7da35bec]:not(:nth-child(5n)){margin-right:5%}.shape-clip-item:hover .shape[data-v-7da35bec]{background-color:#ccc}.shape-clip-item .shape[data-v-7da35bec]{width:40px;height:40px;background-color:#e1e1e1}.shape-style-panel[data-v-02998580]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.row[data-v-02998580]{width:100%;display:flex;align-items:center;margin-bottom:10px}.text-color-btn[data-v-02998580]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:0}.text-color-block[data-v-02998580]{width:16px;height:3px;margin-top:1px}.font-size-btn[data-v-02998580]{padding:0}.slider[data-v-02998580]{flex:3}.row[data-v-938968a2]{width:100%;display:flex;align-items:center;margin-bottom:10px}.line-btn[data-v-938968a2]{display:flex;align-items:center;justify-content:space-between;padding:0!important}.line-btn .line-wrapper[data-v-938968a2]{margin-left:8px}.line-wrapper[data-v-938968a2]{overflow:visible}.line-btn-icon[data-v-938968a2]{width:30px;font-size:12px;margin-top:2px;color:#bfbfbf}.preset-point-style[data-v-938968a2]{padding:0 10px}.preset-point-style+.preset-point-style[data-v-938968a2]{margin-top:10px}.chart-data-editor[data-v-53b32689]{width:600px;position:relative}.editor-content[data-v-53b32689]{width:100%;height:360px;position:relative;border-right:1px solid #ccc;border-bottom:1px solid #ccc;overflow:auto;overflow:overlay}.range-box[data-v-53b32689]{position:absolute;top:0;left:0;z-index:100;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.temp-range[data-v-53b32689]{width:0;height:0;position:absolute;top:0;left:0;background-color:hsla(0,0%,53.3%,.3)}.range-line[data-v-53b32689]{width:0;height:0;position:absolute;left:0;top:0;border:0 solid #d14424}.range-line.t[data-v-53b32689]{border-top-width:1px}.range-line.b[data-v-53b32689]{border-bottom-width:1px}.range-line.l[data-v-53b32689]{border-left-width:1px}.range-line.r[data-v-53b32689]{border-right-width:1px}.resizable[data-v-53b32689]{position:absolute;width:12px;height:12px;left:0;top:0;margin:-9px 0 0 -9px;cursor:nwse-resize}.resizable[data-v-53b32689]:after{content:"";position:absolute;width:4px;height:12px;right:0;top:0;background-color:#d14424}.resizable[data-v-53b32689]:before{content:"";position:absolute;width:12px;height:4px;right:0;bottom:0;background-color:#d14424}table[data-v-53b32689]{width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;table-layout:fixed}table td[data-v-53b32689]{text-align:center;border:1px solid #ccc;vertical-align:middle;width:100px;height:32px}table td.head[data-v-53b32689]{background-color:rgba(209,68,36,.1)}table .item[data-v-53b32689]{width:100%;height:100%;border:0;outline:0;font-size:13px;text-align:center;background-color:transparent}table .item.selected[data-v-53b32689]{background-color:rgba(209,68,36,.02)}.btns[data-v-53b32689]{margin-top:10px;display:flex;justify-content:space-between}.chart-style-panel[data-v-769d6876]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.row[data-v-769d6876]{width:100%;display:flex;align-items:center;margin-bottom:10px}.full-width-btn[data-v-769d6876]{width:100%}.btn-icon[data-v-769d6876]{margin-right:3px}.color-btn-wrap[data-v-769d6876]{position:relative}.delete-color-btn[data-v-769d6876]{position:absolute;width:30px;right:2px;top:2px;bottom:2px;display:flex;justify-content:center;align-items:center;background-color:#fff;cursor:pointer}.preset-themes[data-v-769d6876]{width:250px;margin-bottom:-10px;display:flex;flex-wrap:wrap;align-content:flex-start}.preset-theme[data-v-769d6876]{display:flex;cursor:pointer;width:48%;margin-bottom:4%}.preset-theme[data-v-769d6876]:not(:nth-child(2n)){margin-right:4%}.preset-theme-color[data-v-769d6876]{width:20px;height:20px}.preset-theme-color.select[data-v-769d6876]{transform:scale(1.2);transition:transform .1s}.row[data-v-7e28e1d8]{width:100%;display:flex;align-items:center;margin-bottom:10px}.theme-switch[data-v-7e28e1d8]{margin-bottom:18px}.switch-wrapper[data-v-7e28e1d8]{text-align:right}.text-color-btn[data-v-7e28e1d8]{display:flex;flex-direction:column;justify-content:center;align-items:center}.text-color-block[data-v-7e28e1d8]{width:16px;height:3px;margin-top:1px}.set-count[data-v-7e28e1d8]{display:flex;justify-content:center;align-items:center}.set-count .btn[data-v-7e28e1d8]{padding:4px 8px}.set-count .count-text[data-v-7e28e1d8]{flex:1;text-align:center;margin:0 8px}.row[data-v-546adf8c],.row[data-v-ff7125dc]{width:100%;display:flex;align-items:center;margin-bottom:10px}.background-image-wrapper[data-v-ff7125dc],.title[data-v-ff7125dc]{margin-bottom:10px}.background-image[data-v-ff7125dc]{height:0;padding-bottom:56.25%;border:1px dashed #eee;border-radius:2px;position:relative;transition:all .2s}.background-image[data-v-ff7125dc]:hover{border-color:#d14424;color:#d14424}.background-image .content[data-v-ff7125dc]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background-position:50%;background-size:contain;background-repeat:no-repeat;cursor:pointer}.row[data-v-5d723d50]{width:100%;display:flex;align-items:center;margin-bottom:10px}.switch-row[data-v-5d723d50]{height:32px}.switch-wrapper[data-v-5d723d50]{text-align:right}.row[data-v-71469855]{width:100%;display:flex;align-items:center;margin-bottom:10px}.text-color-btn[data-v-71469855]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:0}.text-color-block[data-v-71469855]{width:16px;height:3px;margin-top:1px}.font-size-btn[data-v-71469855]{padding:0}.row[data-v-43e5f476]{width:100%;display:flex;align-items:center;margin-bottom:10px}.title[data-v-43e5f476]{margin-bottom:10px}.label[data-v-43e5f476]{text-align:center}.btn-icon[data-v-43e5f476]{margin-right:3px}.icon-btn[data-v-43e5f476]{cursor:pointer}.element-animation-panel[data-v-2f69234f]{height:100%;display:flex;flex-direction:column}.tabs[data-v-2f69234f]{display:flex;justify-content:flex-start;align-items:center;border-bottom:1px solid #eee;margin-bottom:20px}.tab[data-v-2f69234f]{width:33.33%;padding-bottom:8px;border-bottom:2px solid transparent;text-align:center;cursor:pointer}.tab.active[data-v-2f69234f]{border-bottom:2px solid #d14424}.tab.in.active[data-v-2f69234f]{border-bottom-color:#68a490}.tab.out.active[data-v-2f69234f]{border-bottom-color:#d86344}.tab.attention.active[data-v-2f69234f]{border-bottom-color:#e8b76a}.element-animation[data-v-2f69234f]{height:32px;display:flex;align-items:center}.element-animation-btn[data-v-2f69234f]{width:100%}.config-item[data-v-2f69234f]{display:flex;align-items:center}.config-item+.config-item[data-v-2f69234f]{margin-top:5px}.tip[data-v-2f69234f]{height:32px;display:flex;justify-content:center;align-items:center;font-style:italic}.animation-pool[data-v-2f69234f]{width:400px;height:500px;overflow-y:auto;overflow-x:hidden;font-size:12px;margin-right:-12px;position:relative}.animation-pool .mask[data-v-2f69234f]{position:absolute;top:0;right:0;bottom:0;left:0}.animation-pool.in .type-title[data-v-2f69234f]{border-left-color:#68a490;background-color:rgba(104,164,144,.15)}.animation-pool.out .type-title[data-v-2f69234f]{border-left-color:#d86344;background-color:rgba(216,99,68,.15)}.animation-pool.attention .type-title[data-v-2f69234f]{border-left-color:#e8b76a;background-color:rgba(232,183,106,.15)}.type-title[data-v-2f69234f]{width:100%;font-size:13px;margin-bottom:10px;border-left:4px solid #aaa;background-color:#eee;padding:2px 0 2px 10px}.pool-item-wrapper[data-v-2f69234f]{display:flex;flex-wrap:wrap;align-content:flex-start}.pool-item[data-v-2f69234f]{width:24%;margin-bottom:1.33333%;margin-bottom:10px;height:40px;line-height:40px;text-align:center;cursor:pointer}.pool-item[data-v-2f69234f]:not(:nth-child(4n)){margin-right:1.33333%}.animation-box[data-v-2f69234f]{background-color:#f9f9f9}.animation-sequence[data-v-2f69234f]{flex:1;padding-right:12px;margin-right:-12px;overflow:auto;overflow:overlay}.sequence-item[data-v-2f69234f]{border:1px solid #eee;padding:10px 6px;border-radius:2px;margin-bottom:8px;transition:all .5s}.sequence-item.in.active[data-v-2f69234f]{border-color:#68a490}.sequence-item.out.active[data-v-2f69234f]{border-color:#d86344}.sequence-item.attention.active[data-v-2f69234f]{border-color:#e8b76a}.sequence-item.active[data-v-2f69234f]{height:auto}.sequence-item .sequence-content[data-v-2f69234f]{display:flex;align-items:center;cursor:-webkit-grab;cursor:grab}.sequence-item .sequence-content[data-v-2f69234f]:active{cursor:-webkit-grabbing;cursor:grabbing}.sequence-item .sequence-content .index[data-v-2f69234f]{flex:1}.sequence-item .sequence-content .text[data-v-2f69234f]{flex:6}.sequence-item .sequence-content .handler[data-v-2f69234f]{flex:2;font-size:15px;text-align:right}.sequence-item .sequence-content .handler-btn[data-v-2f69234f]{margin-left:8px;cursor:pointer}.slide-design-panel[data-v-e0bbbd9e]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.row[data-v-e0bbbd9e]{width:100%;display:flex;align-items:center;margin-bottom:10px}.title[data-v-e0bbbd9e]{margin-bottom:10px}.title.dropdown[data-v-e0bbbd9e]{display:flex;align-items:center;cursor:pointer}.title.dropdown .icon[data-v-e0bbbd9e]{margin-left:5px;transition:transform .1s}.title.dropdown:not(.active) .icon[data-v-e0bbbd9e]{transform:rotate(-90deg)}.background-image-wrapper[data-v-e0bbbd9e]{margin-bottom:10px}.background-image[data-v-e0bbbd9e]{height:0;padding-bottom:56.25%;border:1px dashed #eee;border-radius:2px;position:relative;transition:all .2s}.background-image[data-v-e0bbbd9e]:hover{border-color:#d14424;color:#d14424}.background-image .content[data-v-e0bbbd9e]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background-position:50%;background-size:contain;background-repeat:no-repeat;cursor:pointer}.theme-list[data-v-e0bbbd9e]{display:flex;flex-wrap:wrap;align-content:flex-start}.theme-item[data-v-e0bbbd9e]{width:22%;margin-bottom:4%;padding-bottom:22%;border-radius:2px;position:relative;cursor:pointer}.theme-item[data-v-e0bbbd9e]:not(:nth-child(4n)){margin-right:4%}.theme-item .theme-item-content[data-v-e0bbbd9e]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;justify-content:center;align-items:center;transition:box-shadow .2s}.theme-item .theme-item-content[data-v-e0bbbd9e]:hover{box-shadow:0 0 4px #888}.theme-item .text[data-v-e0bbbd9e]{font-size:16px}.theme-item .color-block[data-v-e0bbbd9e]{width:28px;height:10px;margin-top:5px}.slider[data-v-e0bbbd9e]{flex:3}.animation-pool[data-v-577ae912]{display:flex;flex-wrap:wrap;margin-bottom:10px}.animation-item[data-v-577ae912]{width:50%;height:115px;border:1px solid #d6d6d6;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:25px 0 15px 0;position:relative;cursor:pointer}.animation-item.active[data-v-577ae912]{border-color:#d14424;z-index:1}.animation-item[data-v-577ae912]:nth-child(2n){margin-left:-1px}.animation-item[data-v-577ae912]:nth-child(n+3){margin-top:-1px}.animation-block[data-v-577ae912]{width:64px;height:36px;background:#666;position:relative;overflow:hidden}.animation-block.fade[data-v-577ae912]:hover:after{content:"";width:100%;height:100%;position:absolute;left:0;top:0;background-color:#d9dadb;-webkit-animation:fade-577ae912 .3s linear;animation:fade-577ae912 .3s linear}.animation-block.slideX[data-v-577ae912]:hover:after{content:"";width:100%;height:100%;position:absolute;left:0;top:0;background-color:#d9dadb;-webkit-animation:slideX-577ae912 .3s linear;animation:slideX-577ae912 .3s linear}.animation-block.slideY[data-v-577ae912]:hover:after{content:"";width:100%;height:100%;position:absolute;left:0;top:0;background-color:#d9dadb;-webkit-animation:slideY-577ae912 .3s linear;animation:slideY-577ae912 .3s linear}.animation-text[data-v-577ae912]{font-size:12px;color:#333;text-align:center}@-webkit-keyframes fade-577ae912{0%{opacity:0}to{opacity:1}}@keyframes fade-577ae912{0%{opacity:0}to{opacity:1}}@-webkit-keyframes slideX-577ae912{0%{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideX-577ae912{0%{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideY-577ae912{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideY-577ae912{0%{transform:translateY(100%)}to{transform:translateY(0)}}.row[data-v-0d3881c5]{width:100%;display:flex;align-items:center;margin-bottom:10px}.symbol-panel[data-v-ba0c96fc]{height:100%;display:flex;flex-direction:column}.symbol-panel .tabs[data-v-ba0c96fc]{display:flex;justify-content:space-around;align-items:center;border-bottom:1px solid #eee;margin-bottom:8px}.symbol-panel .tab[data-v-ba0c96fc]{padding:6px 10px 8px;border-bottom:2px solid transparent;cursor:pointer}.symbol-panel .tab.active[data-v-ba0c96fc]{border-bottom:2px solid #d14424}.symbol-panel .pool[data-v-ba0c96fc]{padding:5px 12px;margin:0 -12px;flex:1;font-size:18px;overflow:auto;overflow:overlay;display:flex;flex-wrap:wrap;align-content:flex-start}.symbol-panel .symbol-item[data-v-ba0c96fc]{width:18%;margin-bottom:2.5%;height:0;padding-bottom:18%;position:relative;cursor:pointer;border:1px solid #eee}.symbol-panel .symbol-item[data-v-ba0c96fc]:not(:nth-child(5n)){margin-right:2.5%}.symbol-panel .symbol-item[data-v-ba0c96fc]:hover{color:#d14424}.symbol-panel .symbol-item .symbol[data-v-ba0c96fc]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background-color:#fff}.toolbar[data-v-5303bd17]{border-left:1px solid #eee;background-color:#fff;display:flex;flex-direction:column}.tabs[data-v-5303bd17]{height:40px;font-size:12px;flex-shrink:0;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tab[data-v-5303bd17]{flex:1;display:flex;justify-content:center;align-items:center;background-color:#f9f9f9;border-bottom:1px solid #eee;cursor:pointer}.tab.active[data-v-5303bd17]{background-color:#fff;border-bottom-color:#fff}.tab+.tab[data-v-5303bd17]{border-left:1px solid #eee}.content[data-v-5303bd17]{padding:12px;font-size:13px;overflow:auto;overflow:overlay}.remark[data-v-82b674f6]{position:relative;border-top:1px solid #eee;background-color:#f9f9f9;line-height:1.5}.remark textarea[data-v-82b674f6]{width:100%;height:100%;overflow-y:auto;resize:none;border:0;outline:0;padding:8px;font-size:12px;background-color:transparent;position:absolute;top:0;right:0;bottom:0;left:0}.resize-handler[data-v-82b674f6]{height:7px;position:absolute;top:-3px;left:0;right:0;cursor:n-resize;z-index:2}.export-img-dialog[data-v-60a953a0]{height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;position:relative;overflow:hidden}.thumbnails-view[data-v-60a953a0],.thumbnails-view[data-v-60a953a0]:after{position:absolute;top:0;right:0;bottom:0;left:0}.thumbnails-view[data-v-60a953a0]:after{content:"";background-color:#fff}.configs[data-v-60a953a0]{width:350px;height:calc(100% - 100px);display:flex;flex-direction:column;justify-content:center;z-index:1}.configs .row[data-v-60a953a0]{display:flex;justify-content:center;align-items:center;margin-bottom:25px}.configs .title[data-v-60a953a0]{width:100px;position:relative}.configs .title[data-v-60a953a0]:after{content:attr(data-range);position:absolute;top:20px;left:0}.configs .config-item[data-v-60a953a0]{flex:1}.btns[data-v-60a953a0]{width:300px;height:100px;display:flex;justify-content:center;align-items:center}.btns .export[data-v-60a953a0]{flex:1}.btns .close[data-v-60a953a0]{width:100px;margin-left:10px}.export-json-dialog[data-v-1bc24666]{height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;position:relative;overflow:hidden}.preview[data-v-1bc24666]{width:100%;height:calc(100% - 100px);display:flex;flex-direction:column;justify-content:center;background-color:#f9f9f9;color:#0451a5}.btns[data-v-1bc24666]{width:300px;height:100px;display:flex;justify-content:center;align-items:center}.btns .export[data-v-1bc24666]{flex:1}.btns .close[data-v-1bc24666]{width:100px;margin-left:10px}[data-v-1bc24666]::-webkit-scrollbar{width:10px;height:10px;background-color:#f9f9f9}[data-v-1bc24666]::-webkit-scrollbar-thumb{background-color:#c1c1c1}.export-pdf-dialog[data-v-15b57798]{height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;position:relative;overflow:hidden}.thumbnails-view[data-v-15b57798],.thumbnails-view[data-v-15b57798]:after{position:absolute;top:0;right:0;bottom:0;left:0}.thumbnails-view[data-v-15b57798]:after{content:"";background-color:#fff}.thumbnail.break-page[data-v-15b57798]{-moz-column-break-after:page;break-after:page}.configs[data-v-15b57798]{width:300px;height:calc(100% - 100px);display:flex;flex-direction:column;justify-content:center;z-index:1}.configs .row[data-v-15b57798]{display:flex;justify-content:center;align-items:center;margin-bottom:25px}.configs .title[data-v-15b57798]{width:100px}.configs .config-item[data-v-15b57798]{flex:1}.configs .tip[data-v-15b57798]{font-size:12px;color:#aaa;line-height:1.8;margin-top:25px}.btns[data-v-15b57798]{width:300px;height:100px;display:flex;justify-content:center;align-items:center}.btns .export[data-v-15b57798]{flex:1}.btns .close[data-v-15b57798]{width:100px;margin-left:10px}.export-pptx-dialog[data-v-3fef9be0]{height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;position:relative;overflow:hidden}.configs[data-v-3fef9be0]{width:350px;height:calc(100% - 100px);display:flex;flex-direction:column;justify-content:center}.configs .row[data-v-3fef9be0]{display:flex;justify-content:center;align-items:center;margin-bottom:25px}.configs .title[data-v-3fef9be0]{width:100px;position:relative}.configs .title[data-v-3fef9be0]:after{content:attr(data-range);position:absolute;top:20px;left:0}.configs .config-item[data-v-3fef9be0]{flex:1}.btns[data-v-3fef9be0]{width:300px;height:100px;display:flex;justify-content:center;align-items:center}.btns .export[data-v-3fef9be0]{flex:1}.btns .close[data-v-3fef9be0]{width:100px;margin-left:10px}.export-pptist-dialog[data-v-e2b465d2]{height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;position:relative;overflow:hidden}.configs[data-v-e2b465d2]{width:350px;height:calc(100% - 100px);display:flex;flex-direction:column;justify-content:center}.configs .row[data-v-e2b465d2]{display:flex;justify-content:center;align-items:center;margin-bottom:25px}.configs .title[data-v-e2b465d2]{width:100px;position:relative}.configs .title[data-v-e2b465d2]:after{content:attr(data-range);position:absolute;top:20px;left:0}.configs .config-item[data-v-e2b465d2]{flex:1}.configs .tip[data-v-e2b465d2]{font-size:12px;color:#aaa;line-height:1.8;margin-top:25px}.btns[data-v-e2b465d2]{width:300px;height:100px;display:flex;justify-content:center;align-items:center}.btns .export[data-v-e2b465d2]{flex:1}.btns .close[data-v-e2b465d2]{width:100px;margin-left:10px}.export-dialog[data-v-1f8f1a8b]{margin:-24px}.tabs[data-v-1f8f1a8b]{height:50px;font-size:12px;flex-shrink:0;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-top-left-radius:2px;border-top-right-radius:2px;overflow:hidden}.tab[data-v-1f8f1a8b]{flex:1;display:flex;justify-content:center;align-items:center;background-color:#f9f9f9;border-bottom:1px solid #eee;cursor:pointer}.tab.active[data-v-1f8f1a8b]{background-color:#fff;border-bottom-color:#fff}.tab+.tab[data-v-1f8f1a8b]{border-left:1px solid #eee}.content[data-v-1f8f1a8b]{height:460px;padding:12px;font-size:13px;overflow:auto;overflow:overlay}.pptist-editor[data-v-328e1a4e]{height:100%}.layout-header[data-v-328e1a4e]{height:40px}.layout-content[data-v-328e1a4e]{height:calc(100% - 40px);display:flex}.layout-content-left[data-v-328e1a4e]{width:160px;height:100%;flex-shrink:0}.layout-content-center[data-v-328e1a4e]{width:calc(100% - 420px)}.layout-content-center .center-top[data-v-328e1a4e]{height:40px}.layout-content-right[data-v-328e1a4e]{width:260px;height:100%}.screen-element-video[data-v-76457308]{position:absolute}.element-content[data-v-76457308],.rotate-wrapper[data-v-76457308]{width:100%;height:100%}.screen-element-audio[data-v-1172b8ee]{position:absolute}.rotate-wrapper[data-v-1172b8ee]{width:100%;height:100%}.element-content[data-v-1172b8ee]{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.element-content:hover .audio-player[data-v-1172b8ee]{display:block}.audio-icon[data-v-1172b8ee]{cursor:pointer}.audio-player[data-v-1172b8ee]{position:absolute;display:none}.link[data-v-a15cc1d8]{cursor:pointer}.screen-slide[data-v-7cf7f9e7]{position:absolute;top:0;left:0;transform-origin:0 0;overflow:hidden}.background[data-v-7cf7f9e7]{width:100%;height:100%;background-position:50%;position:absolute}.screen-slide-list[data-v-77a3e620]{background:#1d1d1d;position:relative;width:100%;height:100%}.slide-item[data-v-77a3e620]{position:absolute;top:0;left:0;width:100%;height:100%}.slide-item.current[data-v-77a3e620]{z-index:2}.slide-item.hide[data-v-77a3e620]{opacity:0}.slide-item.turning-mode-no.before[data-v-77a3e620]{transform:translateY(-100%)}.slide-item.turning-mode-no.after[data-v-77a3e620]{transform:translateY(100%)}.slide-item.turning-mode-fade[data-v-77a3e620]{transition:opacity .75s}.slide-item.turning-mode-fade.after[data-v-77a3e620],.slide-item.turning-mode-fade.before[data-v-77a3e620]{pointer-events:none;opacity:0}.slide-item.turning-mode-slideX[data-v-77a3e620]{transition:transform .35s}.slide-item.turning-mode-slideX.before[data-v-77a3e620]{transform:translateX(-100%)}.slide-item.turning-mode-slideX.after[data-v-77a3e620]{transform:translateX(100%)}.slide-item.turning-mode-slideY[data-v-77a3e620]{transition:transform .35s}.slide-item.turning-mode-slideY.before[data-v-77a3e620]{transform:translateY(-100%)}.slide-item.turning-mode-slideY.after[data-v-77a3e620]{transform:translateY(100%)}.slide-content[data-v-77a3e620]{background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;justify-content:center;align-items:center}.slide-thumbnails[data-v-b7c6c0cc]{width:100%;height:100%;position:fixed;top:0;left:0;background-color:#1a1a1a;z-index:99}.return-button[data-v-b7c6c0cc]{height:60px;padding:20px 30px 0}.return-button .icon[data-v-b7c6c0cc]{color:#fff;font-size:36px;cursor:pointer}.return-button .icon[data-v-b7c6c0cc]:hover{color:#d14424}.slide-thumbnails-content[data-v-b7c6c0cc]{height:calc(100% - 100px);padding:20px 30px 30px 30px;display:flex;flex-wrap:wrap;align-content:flex-start;overflow:auto;overflow:overlay}.slide-thumbnails-content .thumbnail[data-v-b7c6c0cc]{width:150px;outline:2px solid #aaa;margin-right:12px;margin-bottom:12px}.slide-thumbnails-content .thumbnail[data-v-b7c6c0cc]:hover{outline-color:#d14424}.slide-thumbnails-content .thumbnail.active[data-v-b7c6c0cc]{outline-width:3px;outline-color:#d14424}.writing-board[data-v-1d4eb7f0]{z-index:8;cursor:none;position:absolute;top:0;right:0;bottom:0;left:0}.blackboard[data-v-1d4eb7f0]{width:100%;height:100%;background-color:#0f392b}.canvas[data-v-1d4eb7f0]{position:absolute;top:0;left:0}.eraser[data-v-1d4eb7f0],.pen[data-v-1d4eb7f0]{pointer-events:none;position:absolute;z-index:9}.eraser .icon[data-v-1d4eb7f0],.pen .icon[data-v-1d4eb7f0]{filter:drop-shadow(2px 2px 2px #555)}.eraser[data-v-1d4eb7f0]{display:flex;justify-content:center;align-items:center;border-radius:50%;border:4px solid rgba(85,85,85,.15);color:rgba(85,85,85,.75)}.writing-board-tool[data-v-876081a6]{font-size:12px;z-index:10;position:absolute;top:0;right:0;bottom:0;left:0}.writing-board-tool .writing-board-wrap[data-v-876081a6]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.writing-board-tool .tools[data-v-876081a6]{height:50px;position:fixed;z-index:11;padding:12px;background-color:#eee;border-radius:2px;display:flex;align-items:center}.writing-board-tool .btn[data-v-876081a6]{padding:5px 10px;cursor:pointer}.writing-board-tool .btn[data-v-876081a6]:hover{color:#d14424}.writing-board-tool .btn.active[data-v-876081a6]{background-color:rgba(209,68,36,.5);color:#fff}.writing-board-tool .icon[data-v-876081a6]{font-size:20px}.writing-board-tool .colors[data-v-876081a6]{display:flex;padding:0 10px}.writing-board-tool .color[data-v-876081a6]{width:16px;height:16px;border-radius:2px;cursor:pointer}.writing-board-tool .color[data-v-876081a6]:hover{transform:scale(1.15)}.writing-board-tool .color.active[data-v-876081a6]{transform:scale(1.3)}.writing-board-tool .color+.color[data-v-876081a6]{margin-left:8px}.base-view[data-v-d72d6626]{width:100%;height:100%}.base-view.laser-pen[data-v-d72d6626]{cursor:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABHNCSVQICAgIfAhkiAAACCJJREFUWIXtmLuO3MYShv/qZl9IzqwXo2BkSAtsIK+z8wwOBcOJ9C56Cr2LlThQcgBnfofVBnswXlgTaLHaIdk3dtcJOKOzd8n2MeDABRDDgKz/m+pudv0N/BN/Luj/kYSZJQBxJR8DKESU/2zuPwTIzAKnpxqHhxUuLir0vYSUAkS0ewA5F7Rtxv7+iNPTEYeHkYjKXwrIzHK9XtultRohaKSkkFIVhqGCEAIxTvm0ZpRSTNOMUGqEUgnGxLX3cblc+t9T2S8GXK1W9dP53OLiwoLZhMtLQ4CiGBVKkchZIOcpn5QMKQuEyKx1YiCZvb0AooD9ff/rZuMPDg7cl+hWn3uAmQWABut1g/PzOnZdTd5bMY6aQtAIQQGQGEd5bYirKgPIZExiY2IKIbK1XpeinzaN2s7b4XPD/iAgM0ucn7fYbNrQ963Juaauq8k5i3E01PcG46iQs0TO1wGlzJAyo6oS2jagqgLGUQNQwTllvJeYzwUz9w8N+b2AzCxwft6i72fBuZkYhnbcbBqKsSbvazhnEIJBzqrEqGQpAlO1AaKShShC6wQpE4UQUNcBKenReyXm8yoIIYwQtNXq7qvkQxVssNm0wbmZuLiYUQgtnGtps2ngfQ3vLaVkEKOmGKcqMtMWkEnKTFonaB3Z+4AQPFmreD6vSAghxpECAFMKY7EoALovBlytVjXW6yb0fSuGoaUQWrq8nKHvW/R9S943xbmavJ+qmNIO8FMFIWXert7A1gYxjprHsSLmaTHt7UF0HYdSilmv82q1ynctnFuAzCzx8aPF+Xltcq7HzaaBcy36vsUwzKjrZhiGRgxDA+8tUjIUgkbOEqVMgEIUkjLDmAjvgwjBI6WKxlHybp5KyVRKMcaMGIb0dLFIzBxvzsdbgOv12i69t7HrpgURY02bTYO+b6nrZui6qZLONdz3jTg5ORDHx0f48OExQpgBAIzp8OjRez46Oi7Pnq1ot5BKETQVgYmosJRj6rrEQNJCxLX3EUB/LyAzC3z8qOGcIe8tOWdpmm81ed9gGJpdJdF1rXz79jucnX1za454P8fZ2ZzOzr6Rx8fvyvPnP38afiEKVVXmqhrJ+wSlIqoqYj73S2s1M7urC0ZcS3x6qhGCDpeXBuOoMY4Gzhl4b4tzNYahgXMNuq4Vb978cCfczTg7+0a8efMDuq6Fcw2GoSnO1fDewjmDcTQYx0kzBI3TU3319euAh4cVUlIEKApBU98bhGAoJSO8N/Dect834u3b73B+/vVn4XZxfv61ePv2O+77Bt5b4b2hlKbcfW8oBE2AQkoKh4fXRvU64MVFhZQqilEhBLX9CCvEqLer1YiTk4MvqtxdlTw5OcAWDDFq5DxphDBtmSlNzcddgMws0fcyDEOFUiQAiZxliVGVGFVJSXEImo6Pj3433Dbo+PiIQ9AlJbXLi5wnrVIm7b6X223wOiAAASkFhBDIWWAcJXKWshQhcpYiZ0k5S3z48PhO9ZcvgV9+ma6XL+8m/PDhMW1ziW1u5Cy3WpO2lOIq11VAAhEhRkLO0z0RgVmAefotRXz6lNyMV6+AxWK6Xr26GzCEGXZb4i7nTifnSXv6Tn7qssTdmf4+cRWQwczQmiHldM/MICogmn6FKDDmzj0Tr18D5+fT9fr13WrGdBCiXMu505Fy0mZmTJYBwPUPdUHOBaUUSFlQVRlS5rzbtqTMJGXGo0fvcXY2vyX+44/T9VA8evSepcy8zcdCFDG1ZBlSTto5FwC3P9RElNG22TTNCCEygAwps9A6Ca2TUCqRMZGPjo4fprg/+OjomIyJQqm0ywspJy0hJu22zVf34+tzcH9/hFIja51gTEJVJUiZoHWEMQFKhfLs2QpPnrz73XRPnrwrz56toFSAMQFaR0g5aRiTWOsEpUbs749XX7u51Y1QKjGQ2JjIbRtgTGClQrE2wFpPbTuU589/xmLx2xfDLRa/lefPf6a2HWCtL9YG3oJy2wY2JjKQoFTC6ekDgIeHEcZEs7cXUFURVTV1wtZ6UdcOTTOgrgfMZn158eKnL6rkkyfvyosXP2E261HXA5pmEHXtYK1HXU9WoKomTWMiDg/j1devbStEVN6/fx+XRIGt9RhHjZQ0Wat4HCsax//1fEQlf//9v8XJyTF9rt1q2+mPtW2PphnY2gHWOrbWcV17ttaDKKy9j4/398u9gACwXC49Pn7UuhQNQI3eT206s2DadptCFEiZqaoS/+tfvnz77X/oRsPKUmYyJpJSAdZ6NM2Aphl4Pu/QND3P5wO0dmo2c5jNHPb3/fKrr/xNnluARJRXq5V/2jQqOKfE1kPsPC8zM1VVLkqNwpiAEAxbq+hGy89SZtq2/MXaIOrasbUDmqZH2/Zo257bdghSOtM07tfNxh/s799yd3d6koODA8fM0ngvw9bgYG9vatOJClfVSFUVYe3UldxhmiBlxtY0kVLTlLHW8Xw+oG17NqYvs1lv6rrHcjkcEN1p5B9ydQPmc2GEoABAdB1TKYWlnDph5wJvbSdPpwvXbCcLUXhrO2FMQF0HttZBa8dtO5TZrDdt26FtewDDfRD3AhJRYeYemKxh2Bqc1HVTm17Xn4y7yFnyDeMurhh33hp3rmuvZjMXpHSmrqehXiz6h04XHjxZIKLMzB0Wi2LW64xhSAwkVFXEOGpo/dmjD2yPPlBVka31mM2caRqH5XLAnz362FUSQLdarfLTxSJpISLmcx8uLw217R8/PLpnzt3S/5KHdvG3Pn67Afr3PMB8APgvOwL+J/5s/BeEBm1u1Gu4+QAAAABJRU5ErkJggg==) 20 20,default!important}.tools-left[data-v-d72d6626]{position:fixed;bottom:8px;left:8px;font-size:25px;color:#666;z-index:10}.tools-left .tool-btn[data-v-d72d6626]{opacity:.35;cursor:pointer}.tools-left .tool-btn[data-v-d72d6626]:hover{opacity:.9}.tools-left .tool-btn+.tool-btn[data-v-d72d6626]{margin-left:8px}.tools-right[data-v-d72d6626]{height:66px;position:fixed;bottom:-66px;right:0;z-index:5;padding:8px;transition:bottom .2s}.tools-right.visible[data-v-d72d6626]{bottom:0}.tools-right[data-v-d72d6626]:after{content:"";width:100%;height:66px;position:absolute;left:0;top:-66px}.tools-right .content[data-v-d72d6626]{width:100%;height:100%;display:flex;justify-content:center;align-items:center;border-radius:2px;font-size:25px;background-color:#fff;color:#41464b;padding:8px 10px;box-shadow:0 2px 12px 0 rgba(56,56,56,.2);border:1px solid #e2e6ed}.tools-right .tool-btn[data-v-d72d6626]{cursor:pointer}.tools-right .tool-btn.active[data-v-d72d6626],.tools-right .tool-btn[data-v-d72d6626]:hover{color:#d14424}.tools-right .tool-btn+.tool-btn[data-v-d72d6626]{margin-left:15px}.tools-right .page-number[data-v-d72d6626]{font-size:13px;padding:8px 12px;cursor:pointer}.presenter-view[data-v-5fba3eec]{width:100%;height:100%;display:flex}.toolbar[data-v-5fba3eec]{width:70px;height:100%;background-color:#fff;border-right:1px solid #eee;font-size:12px;margin:20px 0}.toolbar .tool-btn[data-v-5fba3eec]{display:flex;flex-direction:column;justify-content:center;align-items:center;cursor:pointer}.toolbar .tool-btn+.tool-btn[data-v-5fba3eec]{margin-top:22px}.toolbar .tool-btn.active[data-v-5fba3eec],.toolbar .tool-btn[data-v-5fba3eec]:hover{color:#d14424}.toolbar .divider[data-v-5fba3eec]{width:70%;min-width:70%;margin:24px 15%}.toolbar .tool-icon[data-v-5fba3eec]{margin-bottom:8px;font-size:22px}.content[data-v-5fba3eec]{width:calc(100% - 430px);height:100%;background-color:#1d1d1d}.slide-list-wrap[data-v-5fba3eec]{height:calc(100% - 190px);margin:20px;overflow:hidden;position:relative}.slide-list-wrap.laser-pen[data-v-5fba3eec]{cursor:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABHNCSVQICAgIfAhkiAAACCJJREFUWIXtmLuO3MYShv/qZl9IzqwXo2BkSAtsIK+z8wwOBcOJ9C56Cr2LlThQcgBnfofVBnswXlgTaLHaIdk3dtcJOKOzd8n2MeDABRDDgKz/m+pudv0N/BN/Luj/kYSZJQBxJR8DKESU/2zuPwTIzAKnpxqHhxUuLir0vYSUAkS0ewA5F7Rtxv7+iNPTEYeHkYjKXwrIzHK9XtultRohaKSkkFIVhqGCEAIxTvm0ZpRSTNOMUGqEUgnGxLX3cblc+t9T2S8GXK1W9dP53OLiwoLZhMtLQ4CiGBVKkchZIOcpn5QMKQuEyKx1YiCZvb0AooD9ff/rZuMPDg7cl+hWn3uAmQWABut1g/PzOnZdTd5bMY6aQtAIQQGQGEd5bYirKgPIZExiY2IKIbK1XpeinzaN2s7b4XPD/iAgM0ucn7fYbNrQ963Juaauq8k5i3E01PcG46iQs0TO1wGlzJAyo6oS2jagqgLGUQNQwTllvJeYzwUz9w8N+b2AzCxwft6i72fBuZkYhnbcbBqKsSbvazhnEIJBzqrEqGQpAlO1AaKShShC6wQpE4UQUNcBKenReyXm8yoIIYwQtNXq7qvkQxVssNm0wbmZuLiYUQgtnGtps2ngfQ3vLaVkEKOmGKcqMtMWkEnKTFonaB3Z+4AQPFmreD6vSAghxpECAFMKY7EoALovBlytVjXW6yb0fSuGoaUQWrq8nKHvW/R9S943xbmavJ+qmNIO8FMFIWXert7A1gYxjprHsSLmaTHt7UF0HYdSilmv82q1ynctnFuAzCzx8aPF+Xltcq7HzaaBcy36vsUwzKjrZhiGRgxDA+8tUjIUgkbOEqVMgEIUkjLDmAjvgwjBI6WKxlHybp5KyVRKMcaMGIb0dLFIzBxvzsdbgOv12i69t7HrpgURY02bTYO+b6nrZui6qZLONdz3jTg5ORDHx0f48OExQpgBAIzp8OjRez46Oi7Pnq1ot5BKETQVgYmosJRj6rrEQNJCxLX3EUB/LyAzC3z8qOGcIe8tOWdpmm81ed9gGJpdJdF1rXz79jucnX1za454P8fZ2ZzOzr6Rx8fvyvPnP38afiEKVVXmqhrJ+wSlIqoqYj73S2s1M7urC0ZcS3x6qhGCDpeXBuOoMY4Gzhl4b4tzNYahgXMNuq4Vb978cCfczTg7+0a8efMDuq6Fcw2GoSnO1fDewjmDcTQYx0kzBI3TU3319euAh4cVUlIEKApBU98bhGAoJSO8N/Dect834u3b73B+/vVn4XZxfv61ePv2O+77Bt5b4b2hlKbcfW8oBE2AQkoKh4fXRvU64MVFhZQqilEhBLX9CCvEqLer1YiTk4MvqtxdlTw5OcAWDDFq5DxphDBtmSlNzcddgMws0fcyDEOFUiQAiZxliVGVGFVJSXEImo6Pj3433Dbo+PiIQ9AlJbXLi5wnrVIm7b6X223wOiAAASkFhBDIWWAcJXKWshQhcpYiZ0k5S3z48PhO9ZcvgV9+ma6XL+8m/PDhMW1ziW1u5Cy3WpO2lOIq11VAAhEhRkLO0z0RgVmAefotRXz6lNyMV6+AxWK6Xr26GzCEGXZb4i7nTifnSXv6Tn7qssTdmf4+cRWQwczQmiHldM/MICogmn6FKDDmzj0Tr18D5+fT9fr13WrGdBCiXMu505Fy0mZmTJYBwPUPdUHOBaUUSFlQVRlS5rzbtqTMJGXGo0fvcXY2vyX+44/T9VA8evSepcy8zcdCFDG1ZBlSTto5FwC3P9RElNG22TTNCCEygAwps9A6Ca2TUCqRMZGPjo4fprg/+OjomIyJQqm0ywspJy0hJu22zVf34+tzcH9/hFIja51gTEJVJUiZoHWEMQFKhfLs2QpPnrz73XRPnrwrz56toFSAMQFaR0g5aRiTWOsEpUbs749XX7u51Y1QKjGQ2JjIbRtgTGClQrE2wFpPbTuU589/xmLx2xfDLRa/lefPf6a2HWCtL9YG3oJy2wY2JjKQoFTC6ekDgIeHEcZEs7cXUFURVTV1wtZ6UdcOTTOgrgfMZn158eKnL6rkkyfvyosXP2E261HXA5pmEHXtYK1HXU9WoKomTWMiDg/j1devbStEVN6/fx+XRIGt9RhHjZQ0Wat4HCsax//1fEQlf//9v8XJyTF9rt1q2+mPtW2PphnY2gHWOrbWcV17ttaDKKy9j4/398u9gACwXC49Pn7UuhQNQI3eT206s2DadptCFEiZqaoS/+tfvnz77X/oRsPKUmYyJpJSAdZ6NM2Aphl4Pu/QND3P5wO0dmo2c5jNHPb3/fKrr/xNnluARJRXq5V/2jQqOKfE1kPsPC8zM1VVLkqNwpiAEAxbq+hGy89SZtq2/MXaIOrasbUDmqZH2/Zo257bdghSOtM07tfNxh/s799yd3d6koODA8fM0ngvw9bgYG9vatOJClfVSFUVYe3UldxhmiBlxtY0kVLTlLHW8Xw+oG17NqYvs1lv6rrHcjkcEN1p5B9ydQPmc2GEoABAdB1TKYWlnDph5wJvbSdPpwvXbCcLUXhrO2FMQF0HttZBa8dtO5TZrDdt26FtewDDfRD3AhJRYeYemKxh2Bqc1HVTm17Xn4y7yFnyDeMurhh33hp3rmuvZjMXpHSmrqehXiz6h04XHjxZIKLMzB0Wi2LW64xhSAwkVFXEOGpo/dmjD2yPPlBVka31mM2caRqH5XLAnz362FUSQLdarfLTxSJpISLmcx8uLw217R8/PLpnzt3S/5KHdvG3Pn67Afr3PMB8APgvOwL+J/5s/BeEBm1u1Gu4+QAAAABJRU5ErkJggg==) 20 20,default!important}.thumbnails[data-v-5fba3eec]{height:150px;padding:15px;white-space:nowrap;overflow-x:auto;overflow-y:hidden;border-top:1px solid #3a3a3a}.thumbnail[data-v-5fba3eec]{display:inline-block;outline:2px solid #aaa}.thumbnail+.thumbnail[data-v-5fba3eec]{margin-left:10px}.thumbnail[data-v-5fba3eec]:hover{outline-color:#d14424}.thumbnail.active[data-v-5fba3eec]{outline-width:3px;outline-color:#d14424}.remark[data-v-5fba3eec]{width:360px;height:100%;position:relative;background-color:#2a2a2a;border-left:1px solid #3a3a3a;color:#fff}.remark .header[data-v-5fba3eec]{height:60px;padding:0 20px;display:flex;justify-content:space-between;align-items:center;font-size:18px;border-bottom:1px solid #3a3a3a}.remark .remark-content[data-v-5fba3eec]{height:calc(100% - 60px);padding:20px;line-height:1.5;overflow:auto;overflow:overlay}.remark .remark-scale[data-v-5fba3eec]{position:absolute;right:5px;bottom:5px;font-size:22px;display:flex}.remark .scale-btn[data-v-5fba3eec]{width:40px;height:40px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.remark .scale-btn.disable[data-v-5fba3eec]{color:#666;cursor:no-drop}.remark .scale-btn[data-v-5fba3eec]:not(.disable):hover{background-color:#333}[data-v-5fba3eec]::-webkit-scrollbar{width:0;height:0}.pptist-screen[data-v-6bf3d190]{width:100%;height:100%}.mobile-operate[data-v-7fdc6c04]{position:absolute;z-index:100;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mobile-thumbnails[data-v-4a0c7aa7]{padding:10px;white-space:nowrap;overflow-x:auto;overflow-y:hidden}.thumbnail-item[data-v-4a0c7aa7]{position:relative;display:inline-block;outline:2px solid #aaa}.thumbnail-item+.thumbnail-item[data-v-4a0c7aa7]{margin-left:10px}.thumbnail-item.active[data-v-4a0c7aa7]{outline-color:#d14424}.thumbnail-item.active .label[data-v-4a0c7aa7]{background-color:#d14424}.thumbnail-item .label[data-v-4a0c7aa7]{min-width:20px;height:14px;line-height:14px;position:absolute;right:-1px;top:-1px;color:#fff;background-color:#aaa;z-index:1;font-size:12px;text-align:center;padding:0 5px}[data-v-4a0c7aa7]::-webkit-scrollbar{width:0;height:0}.slide-toolbar[data-v-5c24a24d]{height:230px;background-color:#fff;box-shadow:0 0 15px 0 rgba(0,0,0,.1);display:flex;flex-direction:column;position:relative;z-index:2}.remark[data-v-5c24a24d]{position:relative;flex:1;border-bottom:1px solid #eee;line-height:1.5}.remark textarea[data-v-5c24a24d]{width:100%;height:100%;overflow-y:auto;resize:none;border:0;outline:0;padding:8px 10px;font-size:12px;position:absolute;top:0;right:0;bottom:0;left:0}.toolbar[data-v-5c24a24d]{height:90px;border-bottom:1px solid #eee;padding:10px}.row[data-v-5c24a24d]{width:100%;display:flex;align-items:center;margin-bottom:5px}.row .icon[data-v-5c24a24d]{margin-right:3px}.element-toolbar[data-v-446388c6]{width:100%;height:240px;position:absolute;z-index:99;bottom:0;left:0;background-color:#fff;box-shadow:0 0 15px 0 rgba(0,0,0,.1);display:flex;flex-direction:column;-webkit-animation:slideInUp-446388c6 .15s;animation:slideInUp-446388c6 .15s}.tabs[data-v-446388c6]{display:flex;justify-content:flex-start;align-items:center;border-bottom:1px solid #eee;font-size:12px;font-weight:700;margin-bottom:10px}.tab[data-v-446388c6]{width:30%;padding:10px 10px 12px;margin:0 10%;border-bottom:2px solid transparent;text-align:center;cursor:pointer}.tab.active[data-v-446388c6]{border-bottom:2px solid #d14424}@-webkit-keyframes slideInUp-446388c6{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInUp-446388c6{0%{transform:translateY(100%)}to{transform:translateY(0)}}.content[data-v-446388c6]{padding:10px;flex:1;overflow:auto}.row[data-v-446388c6]{width:100%;display:flex;align-items:center;margin-bottom:10px}.row .icon[data-v-446388c6]{margin-right:3px}.row-block[data-v-446388c6]{margin-bottom:10px;background-color:#f9f9f9;border-radius:2px;padding:10px}.label[data-v-446388c6]{font-size:13px;margin-bottom:20px;margin-left:6px}.colors[data-v-446388c6]{display:flex;flex-wrap:wrap;align-content:flex-start}.color[data-v-446388c6]{width:12%;margin-bottom:.57143%;padding-bottom:5px;display:flex;justify-content:center;align-items:center}.color[data-v-446388c6]:not(:nth-child(8n)){margin-right:.57143%}.color .color-block[data-v-446388c6]{width:30px;height:30px;border-radius:50%}.mobile-editor-header[data-v-8639f30e]{height:50px;background-color:#fff;display:flex;justify-content:space-between;align-items:center;padding:0 18px;font-size:13px;box-shadow:0 0 15px 0 rgba(0,0,0,.1);position:relative;z-index:2}.history[data-v-8639f30e]{display:flex;justify-content:center;align-items:center}.history-item[data-v-8639f30e]{margin-right:20px}.history-item.disable[data-v-8639f30e]{opacity:.5}.mobile-editor[data-v-8cdcde82]{height:100%;position:relative;background-color:#f9f9f9}.content[data-v-8cdcde82]{height:calc(100% - 280px);display:flex;justify-content:center;align-items:center}.viewport[data-v-8cdcde82]{transform-origin:0 0}.viewport-wrapper[data-v-8cdcde82]{position:relative;box-shadow:0 0 15px 0 rgba(0,0,0,.1)}.background[data-v-8cdcde82]{width:100%;height:100%;background-position:50%;position:absolute}.mobile-player[data-v-5293de3b]{transform-origin:0 0;background-color:#1d1d1d;position:relative}.screen-slide-list[data-v-5293de3b]{position:relative;width:100%;height:100%}.slide-item[data-v-5293de3b]{position:absolute;top:0;left:0;width:100%;height:100%}.slide-item.current[data-v-5293de3b]{z-index:2}.slide-item.hide[data-v-5293de3b]{opacity:0}.slide-item.turning-mode-no.before[data-v-5293de3b]{transform:translateY(-100%)}.slide-item.turning-mode-no.after[data-v-5293de3b]{transform:translateY(100%)}.slide-item.turning-mode-fade[data-v-5293de3b]{transition:opacity .75s}.slide-item.turning-mode-fade.after[data-v-5293de3b],.slide-item.turning-mode-fade.before[data-v-5293de3b]{pointer-events:none;opacity:0}.slide-item.turning-mode-slideX[data-v-5293de3b]{transition:transform .35s}.slide-item.turning-mode-slideX.before[data-v-5293de3b]{transform:translateX(-100%)}.slide-item.turning-mode-slideX.after[data-v-5293de3b]{transform:translateX(100%)}.slide-item.turning-mode-slideY[data-v-5293de3b]{transition:transform .35s}.slide-item.turning-mode-slideY.before[data-v-5293de3b]{transform:translateY(-100%)}.slide-item.turning-mode-slideY.after[data-v-5293de3b]{transform:translateY(100%)}.slide-content[data-v-5293de3b]{background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;justify-content:center;align-items:center}.header[data-v-5293de3b]{width:100%;height:40px;line-height:40px;padding:0 15px;position:absolute;top:0;left:0;z-index:99;background-color:rgba(29,29,29,.7);text-align:right;font-size:13px;color:#fff;-webkit-animation:slideInDown-5293de3b .15s;animation:slideInDown-5293de3b .15s}.header .back[data-v-5293de3b]{height:100%}.thumbnails[data-v-5293de3b]{width:100%;position:absolute;bottom:0;left:0;z-index:99;background-color:rgba(29,29,29,.7);overflow:auto!important;-webkit-animation:slideInUp-5293de3b .15s;animation:slideInUp-5293de3b .15s}@-webkit-keyframes slideInUp-5293de3b{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInUp-5293de3b{0%{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideInDown-5293de3b{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slideInDown-5293de3b{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.mobile-preview[data-v-4f906636]{height:100%;background-color:#f9f9f9}.tip[data-v-4f906636]{position:fixed;top:0;left:0;right:0;z-index:99}.thumbnail-list[data-v-4f906636]{height:calc(100% - 50px);padding:10px;overflow:auto}.thumbnail-item[data-v-4f906636]{display:flex;justify-content:center;align-items:center;box-shadow:0 0 15px 0 rgba(0,0,0,.1)}.thumbnail-item+.thumbnail-item[data-v-4f906636]{margin-top:10px}.menu[data-v-4f906636]{height:50px;position:relative;box-shadow:0 -2px 4px 0 rgba(51,51,51,.05);background:#fff;display:flex;justify-content:center;align-items:center}.menu .menu-item[data-v-4f906636]{width:50%;height:100%;display:flex;justify-content:center;align-items:center;font-size:13px}.menu .menu-item .icon[data-v-4f906636]{margin-right:8px;font-size:18px}#app,.mobile[data-v-1fb24d48]{height:100%}.ProseMirror,.ProseMirror-static{outline:0;border:0;font-size:20px;word-break:break-word;white-space:normal}.ProseMirror-static:not(.ProseMirror-static),.ProseMirror:not(.ProseMirror-static){-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ProseMirror-static ::-moz-selection,.ProseMirror ::-moz-selection{background-color:rgba(209,68,36,.3);color:inherit}.ProseMirror-static ::selection,.ProseMirror ::selection{background-color:rgba(209,68,36,.3);color:inherit}.ProseMirror-static p,.ProseMirror p{text-indent:var(--textIndent)}.ProseMirror-static p+p,.ProseMirror p+p{margin-top:var(--paragraphSpace)}.ProseMirror-static ul,.ProseMirror ul{list-style-type:disc;-webkit-padding-start:20px;padding-inline-start:20px}.ProseMirror-static ul li,.ProseMirror ul li{list-style-type:disc}.ProseMirror-static ol,.ProseMirror ol{list-style-type:decimal;-webkit-padding-start:20px;padding-inline-start:20px}.ProseMirror-static ol li,.ProseMirror ol li{list-style-type:decimal}.ProseMirror-static code,.ProseMirror code{background-color:#eee;padding:1px 3px;margin:0 1px;border-radius:2px;font-family:inherit}.ProseMirror-static blockquote,.ProseMirror blockquote{overflow:hidden;padding-right:1.2em;padding-left:1.2em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ProseMirror-static [data-indent="1"],.ProseMirror [data-indent="1"]{padding-left:48px}.ProseMirror-static [data-indent="2"],.ProseMirror [data-indent="2"]{padding-left:96px}.ProseMirror-static [data-indent="3"],.ProseMirror [data-indent="3"]{padding-left:144px}.ProseMirror-static [data-indent="4"],.ProseMirror [data-indent="4"]{padding-left:192px}.ProseMirror-static [data-indent="5"],.ProseMirror [data-indent="5"]{padding-left:240px}.ProseMirror-static [data-indent="6"],.ProseMirror [data-indent="6"]{padding-left:288px}.ProseMirror-static [data-indent="7"],.ProseMirror [data-indent="7"]{padding-left:336px}.ProseMirror-selectednode{outline:none!important}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;vertical-align:baseline;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1;font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}body,html{height:100%;overflow:hidden;background-color:#fff;color:#41464b}li,ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:""}table{border-collapse:collapse;border-spacing:0}a{text-decoration:none}::-webkit-scrollbar{width:5px;height:5px;background-color:#fff}::-webkit-scrollbar-thumb{background-color:#c1c1c1}.ant-popover{padding-top:5px!important}.ant-popover-arrow{display:none}.ant-popover-inner{box-shadow:3px 3px 3px rgba(0,0,0,.15);border:1px solid #eee}.ant-popover-inner-content{padding:12px!important}.ant-dropdown{min-width:120px}.ant-dropdown-menu{box-shadow:3px 3px 3px rgba(0,0,0,.15)}.ant-dropdown-menu-item:hover{background-color:rgba(209,68,36,.2)}.ant-btn.no-padding{padding:0}.ant-radio-button-wrapper{text-align:center}.ant-slider-track{background-color:#d14424}.ant-slider-handle{border-color:#d14424}.ant-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-item-option-active:not(.ant-select-item-option-disabled){background-color:rgba(209,68,36,.2)}.ant-tooltip-inner{font-size:12px}@font-face{font-family:仓耳小丸子;src:url(../fonts/仓耳小丸子.676e187a.ttf)}@font-face{font-family:优设标题黑;src:url(../fonts/优设标题黑.1726685c.ttf)}@font-face{font-family:峰广明锐体;src:url(../fonts/峰广明锐体.8bdb14f7.ttf)}@font-face{font-family:摄图摩登小方体;src:url(../fonts/摄图摩登小方体.de722238.ttf)}@font-face{font-family:站酷快乐体;src:url(../fonts/站酷快乐体.0aceab97.ttf)}@font-face{font-family:字制区喜脉体;src:url(../fonts/字制区喜脉体.fc4a0c7d.ttf)}@font-face{font-family:素材集市康康体;src:url(../fonts/素材集市康康体.8db9d61f.ttf)}@font-face{font-family:素材集市酷方体;src:url(../fonts/素材集市酷方体.8d33b29e.ttf)}@font-face{font-family:途牛类圆体;src:url(../fonts/途牛类圆体.abaea3c4.ttf)}@font-face{font-family:锐字真言体;src:url(../fonts/锐字真言体.1583afec.ttf)}.input[data-v-4727b7ff]{display:none}.checkbox-button[data-v-699cf016]{outline:0;background-color:#fff;border:1px solid #d9d9d9;font-size:13px;padding:0 15px;height:32px;text-align:center;cursor:pointer}.checkbox-button[data-v-699cf016]:hover{color:#d14424}.checkbox-button.checked[data-v-699cf016]{color:#fff;background-color:#d14424;border-color:#d14424}.checkbox-button.checked[data-v-699cf016]:hover{background:rgba(209,68,36,.9);border-color:rgba(209,68,36,.9)}.checkbox-button-group[data-v-b8aa6eac]{display:flex;align-items:center}.checkbox-button-group[data-v-b8aa6eac] .checkbox-button{border-radius:0;border-left-width:0;border-right-width:0;display:inline-block}.checkbox-button-group[data-v-b8aa6eac] .checkbox-button+.checkbox-button{border-left-width:1px}.checkbox-button-group[data-v-b8aa6eac] .checkbox-button:first-child{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left-width:1px}.checkbox-button-group[data-v-b8aa6eac] .checkbox-button:last-child{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right-width:1px}.checkerboard[data-v-7494636c]{background-size:contain}.alpha-checkboard-wrap[data-v-246b525c],.alpha[data-v-246b525c],.checkerboard[data-v-7494636c]{position:absolute;top:0;right:0;bottom:0;left:0}.alpha-checkboard-wrap[data-v-246b525c]{overflow:hidden}.alpha-gradient[data-v-246b525c]{position:absolute;top:0;right:0;bottom:0;left:0}.alpha-container[data-v-246b525c]{cursor:pointer;position:relative;z-index:2;height:100%;margin:0 3px}.alpha-pointer[data-v-246b525c]{z-index:2;position:absolute}.alpha-picker[data-v-246b525c]{cursor:pointer;width:4px;height:8px;box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;margin-top:1px;transform:translateX(-2px)}.hue[data-v-60c3cca1]{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);position:absolute;top:0;right:0;bottom:0;left:0}.hue-container[data-v-60c3cca1]{cursor:pointer;margin:0 2px;position:relative;height:100%}.hue-pointer[data-v-60c3cca1]{z-index:2;position:absolute;top:0}.hue-picker[data-v-60c3cca1]{cursor:pointer;margin-top:1px;width:4px;height:8px;box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;transform:translateX(-2px)}.saturation-black[data-v-d230faf4],.saturation-white[data-v-d230faf4],.saturation[data-v-d230faf4]{position:absolute;top:0;right:0;bottom:0;left:0;cursor:pointer}.saturation-white[data-v-d230faf4]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-d230faf4]{background:linear-gradient(0deg,#000,transparent)}.saturation-pointer[data-v-d230faf4]{cursor:pointer;position:absolute}.saturation-circle[data-v-d230faf4]{width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;transform:translate(-2px,-2px)}.editable-input[data-v-2f428dde]{width:100%;position:relative;overflow:hidden;text-align:center;font-size:14px}.editable-input[data-v-2f428dde]:after{content:"#";position:absolute;left:0;top:50%;transform:translateY(-50%);color:#999}.input-content[data-v-2f428dde]{width:100%;padding:3px;border:0;border-bottom:1px solid #ddd;outline:none;text-align:center}.input-label[data-v-2f428dde]{text-transform:capitalize}.color-picker[data-v-c46eb110]{position:relative;width:240px;background:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-bottom:-10px}.picker-saturation-wrap[data-v-c46eb110]{width:100%;padding-bottom:50%;position:relative;overflow:hidden}.picker-controls[data-v-c46eb110]{display:flex}.picker-sliders[data-v-c46eb110]{padding:4px 0;flex:1}.picker-hue-wrap[data-v-c46eb110]{position:relative;height:10px}.picker-alpha-wrap[data-v-c46eb110]{position:relative;height:10px;margin-top:4px;overflow:hidden}.picker-color-wrap[data-v-c46eb110]{width:24px;height:24px;position:relative;margin-top:4px;margin-right:4px;outline:1px dashed hsla(0,0%,40%,.12)}.picker-color-wrap .checkerboard[data-v-c46eb110]{background-size:auto}.picker-current-color[data-v-c46eb110]{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2}.picker-field[data-v-c46eb110]{display:flex;margin-bottom:8px}.picker-field .straw[data-v-c46eb110]{width:24px;height:24px;margin-top:4px;margin-left:4px;display:flex;justify-content:flex-end;align-items:center;font-size:20px;cursor:pointer}.picker-field .input[data-v-c46eb110]{flex:1}.picker-presets[data-v-c46eb110]{display:flex;flex-wrap:wrap;align-content:flex-start}.picker-presets-color[data-v-c46eb110]{width:7%;margin-bottom:3.33333%;height:0;padding-bottom:7%;flex-shrink:0;position:relative;cursor:pointer}.picker-presets-color[data-v-c46eb110]:not(:nth-child(10n)){margin-right:3.33333%}.picker-presets-color.alpha[data-v-c46eb110]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADBJREFUOE9jfPbs2X8GPEBSUhKfNAPjqAHDIgz+//+PNx08f/4cfzoYNYCBceiHAQC5flV5JzgrxQAAAABJRU5ErkJggg==)}.picker-presets-color-content[data-v-c46eb110]{position:absolute;top:0;right:0;bottom:0;left:0}.picker-gradient-presets[data-v-c46eb110]{display:flex;flex-wrap:wrap;align-content:flex-start}.picker-gradient-col[data-v-c46eb110]{width:7%;margin-bottom:3.33333%;display:flex;flex-direction:column}.picker-gradient-col[data-v-c46eb110]:not(:nth-child(10n)){margin-right:3.33333%}.picker-gradient-color[data-v-c46eb110]{width:100%;height:16px;position:relative;cursor:pointer}.recent-colors-title[data-v-c46eb110]{font-size:12px;margin-bottom:4px}.fullscreen-spin[data-v-16ead44e]{position:fixed;top:0;bottom:0;left:0;right:0;z-index:100;display:flex;justify-content:center;align-items:center;background-color:hsla(0,0%,94.5%,.7)}.menu-content[data-v-e470e712]{width:170px;padding:5px 0;background:#fff;border:1px solid #eee;box-shadow:3px 3px 3px rgba(0,0,0,.15);border-radius:2px;list-style:none;margin:0}.menu-item[data-v-e470e712]{padding:0 20px;color:#555;font-size:12px;transition:all .1s;white-space:nowrap;height:30px;line-height:30px;background-color:#fff;cursor:pointer}.menu-item:not(.disable):hover>.menu-item-content>.sub-menu[data-v-e470e712]{display:block}.menu-item:not(.disable):hover>.has-children.has-handler[data-v-e470e712]:after{transform:scale(1)}.menu-item[data-v-e470e712]:hover:not(.disable){background-color:rgba(209,68,36,.2)}.menu-item.divider[data-v-e470e712]{height:1px;overflow:hidden;margin:5px;background-color:#e5e5e5;line-height:0;padding:0}.menu-item.disable[data-v-e470e712]{color:#b1b1b1;cursor:no-drop}.menu-item-content[data-v-e470e712]{display:flex;align-items:center;justify-content:space-between;position:relative}.menu-item-content.has-children[data-v-e470e712]:before{content:"";display:inline-block;width:8px;height:8px;border-width:1px;border-style:solid;border-color:#666 #666 transparent transparent;position:absolute;right:0;top:50%;transform:translateY(-50%) rotate(45deg)}.menu-item-content.has-children.has-handler[data-v-e470e712]:after{content:"";display:inline-block;width:1px;height:24px;background-color:#f1f1f1;position:absolute;right:18px;top:3px;transform:scale(0);transition:transform .2s}.menu-item-content .sub-text[data-v-e470e712]{opacity:.6}.menu-item-content .sub-menu[data-v-e470e712]{width:120px;position:absolute;display:none;left:112%;top:-6px}.mask{position:fixed;left:0;top:0;width:100vw;height:100vh;z-index:9998}.contextmenu{position:fixed;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} \ No newline at end of file +.hotkey-doc[data-v-4b1afc5f]{height:100%;overflow:auto;font-size:12px;margin:0 -24px;padding:0 24px}.title[data-v-4b1afc5f]{font-size:14px;font-weight:700;border-bottom:1px solid #e5e5e5;padding:24px 0 5px 0}.title[data-v-4b1afc5f]:first-child{padding-top:0}.hotkey-item[data-v-4b1afc5f]{border-bottom:1px solid #e5e5e5;padding:15px 0 5px 0;display:flex;align-items:center}.label[data-v-4b1afc5f]{width:140px;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.editor-header[data-v-6c34fc9c]{background-color:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-bottom:1px solid #eee;display:flex;justify-content:space-between;padding:0 10px}.left[data-v-6c34fc9c],.menu-item[data-v-6c34fc9c],.right[data-v-6c34fc9c]{display:flex;justify-content:center;align-items:center}.menu-item[data-v-6c34fc9c]{height:100%;font-size:14px;padding:0 10px;transition:background-color .2s;cursor:pointer}.menu-item .text[data-v-6c34fc9c]{margin-left:4px}.left .menu-item[data-v-6c34fc9c]:hover{background-color:#f9f9f9}svg[data-v-71b17928],svg[data-v-41071294],svg[data-v-b5bace06]{overflow:visible;position:absolute;z-index:2;top:0;left:0}.image-clip-handler[data-v-3e0199ec]{width:100%;height:100%;position:relative}.image-clip-handler .bottom-img[data-v-3e0199ec]{top:0;left:0;width:100%;height:100%;opacity:.5}.image-clip-handler img[data-v-3e0199ec]{width:100%;height:100%}.image-clip-handler .top-image-content[data-v-3e0199ec]{position:absolute;overflow:hidden}.image-clip-handler .top-image-content img[data-v-3e0199ec]{position:absolute}.operate[data-v-3e0199ec]{position:absolute;width:100%;height:100%;top:0;left:0;cursor:move}.clip-point[data-v-3e0199ec]{position:absolute;width:16px;height:16px}.clip-point svg[data-v-3e0199ec]{overflow:visible}.clip-point.left-top[data-v-3e0199ec]{left:0;top:0}.clip-point.right-top[data-v-3e0199ec]{left:100%;top:0;transform:rotate(90deg);transform-origin:0 0}.clip-point.left-bottom[data-v-3e0199ec]{left:0;top:100%;transform:rotate(-90deg);transform-origin:0 0}.clip-point.right-bottom[data-v-3e0199ec]{left:100%;top:100%;transform:rotate(180deg);transform-origin:0 0}.clip-point.top[data-v-3e0199ec]{left:50%;top:0;margin-left:-8px}.clip-point.bottom[data-v-3e0199ec]{left:50%;bottom:0;margin-left:-8px;transform:rotate(180deg)}.clip-point.left[data-v-3e0199ec]{left:0;top:50%;margin-top:-8px;transform:rotate(-90deg)}.clip-point.right[data-v-3e0199ec]{right:0;top:50%;margin-top:-8px;transform:rotate(90deg)}.clip-point.bottom.rotate-135[data-v-3e0199ec],.clip-point.left-bottom.rotate-90[data-v-3e0199ec],.clip-point.left-top.rotate-0[data-v-3e0199ec],.clip-point.left.rotate-45[data-v-3e0199ec],.clip-point.right-bottom.rotate-0[data-v-3e0199ec],.clip-point.right-top.rotate-90[data-v-3e0199ec],.clip-point.right.rotate-45[data-v-3e0199ec],.clip-point.top.rotate-135[data-v-3e0199ec]{cursor:nwse-resize}.clip-point.bottom.rotate-0[data-v-3e0199ec],.clip-point.left-bottom.rotate-135[data-v-3e0199ec],.clip-point.left-top.rotate-45[data-v-3e0199ec],.clip-point.left.rotate-90[data-v-3e0199ec],.clip-point.right-bottom.rotate-45[data-v-3e0199ec],.clip-point.right-top.rotate-135[data-v-3e0199ec],.clip-point.right.rotate-90[data-v-3e0199ec],.clip-point.top.rotate-0[data-v-3e0199ec]{cursor:ns-resize}.clip-point.bottom.rotate-45[data-v-3e0199ec],.clip-point.left-bottom.rotate-0[data-v-3e0199ec],.clip-point.left-top.rotate-90[data-v-3e0199ec],.clip-point.left.rotate-135[data-v-3e0199ec],.clip-point.right-bottom.rotate-90[data-v-3e0199ec],.clip-point.right-top.rotate-0[data-v-3e0199ec],.clip-point.right.rotate-135[data-v-3e0199ec],.clip-point.top.rotate-45[data-v-3e0199ec]{cursor:nesw-resize}.clip-point.bottom.rotate-90[data-v-3e0199ec],.clip-point.left-bottom.rotate-45[data-v-3e0199ec],.clip-point.left-top.rotate-135[data-v-3e0199ec],.clip-point.left.rotate-0[data-v-3e0199ec],.clip-point.right-bottom.rotate-135[data-v-3e0199ec],.clip-point.right-top.rotate-45[data-v-3e0199ec],.clip-point.right.rotate-0[data-v-3e0199ec],.clip-point.top.rotate-90[data-v-3e0199ec]{cursor:ew-resize}.editable-element-image[data-v-30dc7050]{position:absolute}.editable-element-image.lock .element-content[data-v-30dc7050]{cursor:default}.rotate-wrapper[data-v-30dc7050]{width:100%;height:100%}.element-content[data-v-30dc7050]{width:100%;height:100%;position:relative;cursor:move}.element-content .image-content[data-v-30dc7050]{width:100%;height:100%;overflow:hidden;position:relative}.element-content img[data-v-30dc7050]{position:absolute}svg[data-v-61b7d06a]{overflow:visible;position:absolute;top:0;left:0}.prosemirror-editor[data-v-1debd6ff]{cursor:text}.editable-element-text[data-v-7135a611]{position:absolute}.editable-element-text.lock .element-content[data-v-7135a611]{cursor:default}.rotate-wrapper[data-v-7135a611]{width:100%;height:100%}.element-content[data-v-7135a611]{position:relative;padding:10px;line-height:1.5;word-break:break-word;cursor:move}.element-content .text[data-v-7135a611]{position:relative}.element-content[data-v-7135a611] a{cursor:text}.drag-handler[data-v-7135a611]{height:10px;position:absolute;left:0;right:0}.drag-handler.top[data-v-7135a611]{top:0}.drag-handler.bottom[data-v-7135a611]{bottom:0}.editable-element-shape[data-v-d4c718fa]{position:absolute;pointer-events:none}.editable-element-shape.lock .element-content[data-v-d4c718fa]{cursor:default}.rotate-wrapper[data-v-d4c718fa]{width:100%;height:100%}.element-content[data-v-d4c718fa]{width:100%;height:100%;position:relative;cursor:move}.element-content svg[data-v-d4c718fa]{transform-origin:0 0;overflow:visible}.element-content .shape-path[data-v-d4c718fa]{pointer-events:all}.shape-text[data-v-d4c718fa]{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;padding:10px;line-height:1.2;word-break:break-word;pointer-events:none}.shape-text.editable[data-v-d4c718fa]{pointer-events:all}.shape-text.top[data-v-d4c718fa]{justify-content:flex-start}.shape-text.middle[data-v-d4c718fa]{justify-content:center}.shape-text.bottom[data-v-d4c718fa]{justify-content:flex-end}.editable-element-shape[data-v-6550e504]{position:absolute;pointer-events:none}.editable-element-shape.lock .line-path[data-v-6550e504],.editable-element-shape.lock .line-point[data-v-6550e504]{cursor:default}.element-content[data-v-6550e504]{width:100%;height:100%;position:relative}.element-content svg[data-v-6550e504]{transform-origin:0 0;overflow:visible}.line-path[data-v-6550e504],.line-point[data-v-6550e504]{pointer-events:all;cursor:move}.chart[data-v-1aa2357d]{display:flex}.chart-content[data-v-1aa2357d]{transform-origin:0 0}.chart-content{--theme-color-1:#666;--theme-color-2:#666;--theme-color-3:#666;--theme-color-4:#666;--theme-color-5:#666;--theme-color-6:#666;--theme-color-7:#666;--theme-color-8:#666;--theme-color-9:#666;--theme-color-10:#666;--grid-color:rgba(0,0,0,0.4)}.chart-content .ct-series-a .ct-line,.chart-content .ct-series-a .ct-point{stroke:var(--theme-color-1)}.chart-content .ct-series-a .ct-area{fill:var(--theme-color-1)}.chart-content .ct-series-a .ct-bar{stroke:var(--theme-color-1)}.chart-content .ct-series-a .ct-slice-pie{fill:var(--theme-color-1)}.chart-content .ct-series-a .ct-slice-donut{stroke:var(--theme-color-1)}.chart-content .ct-series-b .ct-line,.chart-content .ct-series-b .ct-point{stroke:var(--theme-color-2)}.chart-content .ct-series-b .ct-area{fill:var(--theme-color-2)}.chart-content .ct-series-b .ct-bar{stroke:var(--theme-color-2)}.chart-content .ct-series-b .ct-slice-pie{fill:var(--theme-color-2)}.chart-content .ct-series-b .ct-slice-donut{stroke:var(--theme-color-2)}.chart-content .ct-series-c .ct-line,.chart-content .ct-series-c .ct-point{stroke:var(--theme-color-3)}.chart-content .ct-series-c .ct-area{fill:var(--theme-color-3)}.chart-content .ct-series-c .ct-bar{stroke:var(--theme-color-3)}.chart-content .ct-series-c .ct-slice-pie{fill:var(--theme-color-3)}.chart-content .ct-series-c .ct-slice-donut{stroke:var(--theme-color-3)}.chart-content .ct-series-d .ct-line,.chart-content .ct-series-d .ct-point{stroke:var(--theme-color-4)}.chart-content .ct-series-d .ct-area{fill:var(--theme-color-4)}.chart-content .ct-series-d .ct-bar{stroke:var(--theme-color-4)}.chart-content .ct-series-d .ct-slice-pie{fill:var(--theme-color-4)}.chart-content .ct-series-d .ct-slice-donut{stroke:var(--theme-color-4)}.chart-content .ct-series-e .ct-line,.chart-content .ct-series-e .ct-point{stroke:var(--theme-color-5)}.chart-content .ct-series-e .ct-area{fill:var(--theme-color-5)}.chart-content .ct-series-e .ct-bar{stroke:var(--theme-color-5)}.chart-content .ct-series-e .ct-slice-pie{fill:var(--theme-color-5)}.chart-content .ct-series-e .ct-slice-donut{stroke:var(--theme-color-5)}.chart-content .ct-series-f .ct-line,.chart-content .ct-series-f .ct-point{stroke:var(--theme-color-6)}.chart-content .ct-series-f .ct-area{fill:var(--theme-color-6)}.chart-content .ct-series-f .ct-bar{stroke:var(--theme-color-6)}.chart-content .ct-series-f .ct-slice-pie{fill:var(--theme-color-6)}.chart-content .ct-series-f .ct-slice-donut{stroke:var(--theme-color-6)}.chart-content .ct-series-g .ct-line,.chart-content .ct-series-g .ct-point{stroke:var(--theme-color-7)}.chart-content .ct-series-g .ct-area{fill:var(--theme-color-7)}.chart-content .ct-series-g .ct-bar{stroke:var(--theme-color-7)}.chart-content .ct-series-g .ct-slice-pie{fill:var(--theme-color-7)}.chart-content .ct-series-g .ct-slice-donut{stroke:var(--theme-color-7)}.chart-content .ct-series-h .ct-line,.chart-content .ct-series-h .ct-point{stroke:var(--theme-color-8)}.chart-content .ct-series-h .ct-area{fill:var(--theme-color-8)}.chart-content .ct-series-h .ct-bar{stroke:var(--theme-color-8)}.chart-content .ct-series-h .ct-slice-pie{fill:var(--theme-color-8)}.chart-content .ct-series-h .ct-slice-donut{stroke:var(--theme-color-8)}.chart-content .ct-series-i .ct-line,.chart-content .ct-series-i .ct-point{stroke:var(--theme-color-9)}.chart-content .ct-series-i .ct-area{fill:var(--theme-color-9)}.chart-content .ct-series-i .ct-bar{stroke:var(--theme-color-9)}.chart-content .ct-series-i .ct-slice-pie{fill:var(--theme-color-9)}.chart-content .ct-series-i .ct-slice-donut{stroke:var(--theme-color-9)}.chart-content .ct-grid{stroke:var(--grid-color)}.chart-content .ct-label{fill:var(--grid-color);color:var(--grid-color)}.legends{height:20px;justify-content:center;font-size:14px}.legend,.legends{display:flex;align-items:center}.legend+.legend{margin-left:10px}.legend .block{width:10px;height:10px;margin-right:5px}.editable-element-chart[data-v-f3c03862]{position:absolute}.editable-element-chart.lock .element-content[data-v-f3c03862]{cursor:default}.rotate-wrapper[data-v-f3c03862]{width:100%;height:100%}.element-content[data-v-f3c03862]{width:100%;height:100%;overflow:hidden;cursor:move}.custom-textarea[data-v-cdb58a1e]{border:0;outline:0;-webkit-user-modify:read-write-plaintext-only;-moz-user-modify:read-write-plaintext-only}.editable-table[data-v-bae8c794],table[data-v-bae8c794]{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}table[data-v-bae8c794]{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0;border:0;word-wrap:break-word;--themeColor:$themeColor;--subThemeColor1:$themeColor;--subThemeColor2:$themeColor}table.theme[data-v-bae8c794]{background-color:#fff}table.theme tr:nth-child(2n) .cell[data-v-bae8c794]{background-color:var(--subThemeColor1)}table.theme tr:nth-child(odd) .cell[data-v-bae8c794]{background-color:var(--subThemeColor2)}table.theme.col-footer tr .cell[data-v-bae8c794]:last-child,table.theme.col-header tr .cell[data-v-bae8c794]:first-child,table.theme.row-footer tr:last-child .cell[data-v-bae8c794],table.theme.row-header tr:first-child .cell[data-v-bae8c794]{background-color:var(--themeColor)}table tr[data-v-bae8c794]{height:36px}table .cell[data-v-bae8c794]{position:relative;white-space:normal;word-wrap:break-word;vertical-align:middle;font-size:14px;cursor:default}table .cell.selected[data-v-bae8c794]:after{content:"";width:100%;height:100%;position:absolute;top:0;left:0;background-color:hsla(0,0%,40%,.4)}table .cell-text[data-v-bae8c794]{min-height:32px;padding:5px;line-height:1.5;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:text}table .cell-text.active[data-v-bae8c794]{-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.drag-line[data-v-bae8c794]{position:absolute;top:0;bottom:0;width:3px;background-color:#d14424;margin-left:-1px;opacity:0;z-index:2;cursor:col-resize}.editable-element-table[data-v-6391c486]{position:absolute}.editable-element-table.lock .element-content[data-v-6391c486]{cursor:default}.rotate-wrapper[data-v-6391c486]{width:100%;height:100%}.element-content[data-v-6391c486]{width:100%;height:100%;position:relative;cursor:move}.table-mask[data-v-6391c486]{position:absolute;top:0;right:0;bottom:0;left:0;opacity:0;transition:opacity .2s}.table-mask .mask-tip[data-v-6391c486]{position:absolute;top:5px;left:5px;background-color:rgba(0,0,0,.5);color:#fff;padding:6px 12px;font-size:12px;transform-origin:0 0}.table-mask[data-v-6391c486]:hover:not(.lock){opacity:.9}.editable-element-latex[data-v-31390388]{position:absolute}.editable-element-latex.lock .element-content[data-v-31390388]{cursor:default}.rotate-wrapper[data-v-31390388]{width:100%;height:100%}.element-content[data-v-31390388]{width:100%;height:100%;position:relative;cursor:move}.element-content svg[data-v-31390388]{transform-origin:0 0;overflow:visible}.video-player[data-v-2fc4c202]{position:relative;overflow:hidden;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;line-height:1;transform-origin:0 0}@media(min-width:900px){.video-player.playing .controller-mask[data-v-2fc4c202],.video-player.playing .controller[data-v-2fc4c202]{opacity:0}.video-player.playing:hover .controller-mask[data-v-2fc4c202],.video-player.playing:hover .controller[data-v-2fc4c202]{opacity:1}}.video-player.loading .bezel .diplayer-loading-icon[data-v-2fc4c202]{display:block}.video-player.hide-controller[data-v-2fc4c202]{cursor:none}.video-player.hide-controller .controller-mask[data-v-2fc4c202],.video-player.hide-controller .controller[data-v-2fc4c202]{opacity:0;transform:translateY(100%)}.video-wrap[data-v-2fc4c202]{position:relative;background:#000;font-size:0;width:100%;height:100%}.video-wrap .video[data-v-2fc4c202]{width:100%;height:100%}.controller-mask[data-v-2fc4c202]{background:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAADGCAYAAAAT+OqFAAAAdklEQVQoz42QQQ7AIAgEF/T/D+kbq/RWAlnQyyazA4aoAB4FsBSA/bFjuF1EOL7VbrIrBuusmrt4ZZORfb6ehbWdnRHEIiITaEUKa5EJqUakRSaEYBJSCY2dEstQY7AuxahwXFrvZmWl2rh4JZ07z9dLtesfNj5q0FU3A5ObbwAAAABJRU5ErkJggg==) repeat-x bottom;height:98px;width:100%;position:absolute;bottom:0;transition:all .3s ease}.controller[data-v-2fc4c202]{position:absolute;bottom:0;left:0;right:0;height:41px;padding:0 20px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;transition:all .3s ease}.controller .bar-wrap[data-v-2fc4c202]{padding:5px 0;cursor:pointer;position:absolute;bottom:33px;width:calc(100% - 40px);height:3px}.controller .bar-wrap:hover .bar .played .thumb[data-v-2fc4c202]{transform:scale(1)}.controller .bar-wrap .bar-time[data-v-2fc4c202]{position:absolute;left:0;top:-20px;border-radius:4px;padding:5px 7px;background-color:rgba(0,0,0,.62);color:#fff;font-size:12px;text-align:center;opacity:1;transition:opacity .1s ease-in-out;word-wrap:normal;word-break:normal;z-index:2;pointer-events:none}.controller .bar-wrap .bar-time.hidden[data-v-2fc4c202]{opacity:0}.controller .bar-wrap .bar[data-v-2fc4c202]{position:relative;height:3px;width:100%;background:hsla(0,0%,100%,.2);cursor:pointer}.controller .bar-wrap .bar .loaded[data-v-2fc4c202]{position:absolute;left:0;top:0;bottom:0;background:hsla(0,0%,100%,.4);height:3px;transition:all .5s ease;will-change:width}.controller .bar-wrap .bar .played[data-v-2fc4c202]{position:absolute;left:0;top:0;bottom:0;height:3px;will-change:width;background-color:#fff}.controller .bar-wrap .bar .played .thumb[data-v-2fc4c202]{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer;transition:all .3s ease-in-out;transform:scale(0);background-color:#fff}.controller .icons[data-v-2fc4c202]{height:38px;position:absolute;bottom:0;display:flex;align-items:center}.controller .icons.icons-right[data-v-2fc4c202]{right:8px}.controller .icons .time[data-v-2fc4c202]{line-height:38px;color:#eee;text-shadow:0 0 2px rgba(0,0,0,.5);vertical-align:middle;font-size:13px;cursor:default}.controller .icons .icon[data-v-2fc4c202]{width:40px;height:100%;position:relative;cursor:pointer;display:flex;align-items:center;font-size:20px}.controller .icons .icon.play-icon[data-v-2fc4c202]{font-size:26px}.controller .icons .icon .icon-content[data-v-2fc4c202]{transition:all .2s ease-in-out;opacity:.8;color:#fff}.controller .icons .icon.loop-icon[data-v-2fc4c202]{font-size:12px}.controller .icons .icon.loop-icon .icon-content[data-v-2fc4c202]{opacity:.5}.controller .icons .icon.speed-icon[data-v-2fc4c202]{font-size:12px;position:relative}.controller .icons .icon .speed-menu[data-v-2fc4c202]{width:70px;position:absolute;bottom:30px;left:-23px;background-color:#22211b;padding:5px 0;color:#ddd}.controller .icons .icon .speed-menu .speed-menu-item[data-v-2fc4c202]{padding:8px 0;text-align:center}.controller .icons .icon .speed-menu .speed-menu-item[data-v-2fc4c202]:hover{background-color:#393833;color:#fff}.controller .icons .icon .speed-menu .speed-menu-item.active[data-v-2fc4c202]{font-weight:700;color:#fff}.controller .icons .icon.active .icon-content[data-v-2fc4c202],.controller .icons .icon:hover .icon-content[data-v-2fc4c202]{opacity:1}.controller .icons .volume[data-v-2fc4c202]{height:100%;position:relative;cursor:pointer;display:flex;align-items:center}.controller .icons .volume:hover .volume-bar-wrap .volume-bar[data-v-2fc4c202]{width:45px}.controller .icons .volume:hover .volume-bar-wrap .volume-bar .volume-bar-inner .thumb[data-v-2fc4c202]{transform:scale(1)}.controller .icons .volume.volume-active .volume-bar-wrap .volume-bar[data-v-2fc4c202]{width:45px}.controller .icons .volume.volume-active .volume-bar-wrap .volume-bar .volume-bar-inner .thumb[data-v-2fc4c202]{transform:scale(1)}.controller .icons .volume-bar-wrap[data-v-2fc4c202]{display:inline-block;margin:0 15px 0 -5px;vertical-align:middle;height:100%}.controller .icons .volume-bar[data-v-2fc4c202]{position:relative;top:17px;width:0;height:3px;background:#aaa;transition:all .3s ease-in-out}.controller .icons .volume-bar .volume-bar-inner[data-v-2fc4c202]{position:absolute;bottom:0;left:0;height:100%;transition:all .1s ease;will-change:width;background-color:#fff}.controller .icons .volume-bar .volume-bar-inner .thumb[data-v-2fc4c202]{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer;transition:all .3s ease-in-out;transform:scale(0);background-color:#fff}.controller .icons .loop[data-v-2fc4c202]{display:inline-block;height:100%}.bezel[data-v-2fc4c202]{position:absolute;left:0;right:0;top:0;bottom:0;font-size:22px;color:#fff;pointer-events:none}.bezel .bezel-icon[data-v-2fc4c202]{position:absolute;top:50%;left:50%;margin:-26px 0 0 -26px;height:52px;width:52px;padding:12px;display:flex;justify-content:center;align-items:center;background:rgba(0,0,0,.5);border-radius:50%;opacity:0;pointer-events:none;font-size:40px}.bezel .bezel-icon.bezel-transition[data-v-2fc4c202]{-webkit-animation:bezel-hide-2fc4c202 .5s linear;animation:bezel-hide-2fc4c202 .5s linear}@-webkit-keyframes bezel-hide-2fc4c202{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}@keyframes bezel-hide-2fc4c202{0%{opacity:1;transform:scale(1)}to{opacity:0;transform:scale(2)}}.bezel .loading-icon[data-v-2fc4c202]{display:none;position:absolute;top:50%;left:50%;margin:-18px 0 0 -18px;height:36px;width:36px;pointer-events:none}.bezel .loading-icon .loading-hide[data-v-2fc4c202]{display:none}.bezel .loading-icon .loading-dot[data-v-2fc4c202]{-webkit-animation:loading-dot-fade-2fc4c202 .8s ease infinite;animation:loading-dot-fade-2fc4c202 .8s ease infinite;opacity:0;transform-origin:4px 4px}.bezel .loading-icon .loading-dot.loading-dot-7[data-v-2fc4c202]{-webkit-animation-delay:.7s;animation-delay:.7s}.bezel .loading-icon .loading-dot.loading-dot-6[data-v-2fc4c202]{-webkit-animation-delay:.6s;animation-delay:.6s}.bezel .loading-icon .loading-dot.loading-dot-5[data-v-2fc4c202]{-webkit-animation-delay:.5s;animation-delay:.5s}.bezel .loading-icon .loading-dot.loading-dot-4[data-v-2fc4c202]{-webkit-animation-delay:.4s;animation-delay:.4s}.bezel .loading-icon .loading-dot.loading-dot-3[data-v-2fc4c202]{-webkit-animation-delay:.3s;animation-delay:.3s}.bezel .loading-icon .loading-dot.loading-dot-2[data-v-2fc4c202]{-webkit-animation-delay:.2s;animation-delay:.2s}.bezel .loading-icon .loading-dot.loading-dot-1[data-v-2fc4c202]{-webkit-animation-delay:.1s;animation-delay:.1s}@-webkit-keyframes loading-dot-fade-2fc4c202{0%{opacity:.7;transform:scale(1.2)}50%{opacity:.25;transform:scale(.9)}to{opacity:.25;transform:scale(.85)}}@keyframes loading-dot-fade-2fc4c202{0%{opacity:.7;transform:scale(1.2)}50%{opacity:.25;transform:scale(.9)}to{opacity:.25;transform:scale(.85)}}.editable-element-video[data-v-9d5469c6]{position:absolute}.editable-element-video.lock .handler-border[data-v-9d5469c6]{cursor:default}.rotate-wrapper[data-v-9d5469c6]{width:100%;height:100%}.element-content[data-v-9d5469c6]{width:100%;height:100%;position:relative}.handler-border[data-v-9d5469c6]{position:absolute;cursor:move}.handler-border.t[data-v-9d5469c6]{width:100%;height:20px;top:0;left:0}.handler-border.b[data-v-9d5469c6]{width:100%;height:5px;bottom:0;left:0}.handler-border.l[data-v-9d5469c6]{width:10px;height:100%;left:0;top:0}.handler-border.r[data-v-9d5469c6]{width:10px;height:100%;right:0;top:0}.audio-player[data-v-121f3d11]{width:280px;height:50px;position:relative;line-height:1;transform-origin:0 0;background:#000}.audio-player[data-v-121f3d11],.controller[data-v-121f3d11]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.controller[data-v-121f3d11]{position:absolute;bottom:0;left:0;right:0;height:41px;padding:0 20px;transition:all .3s ease}.controller .bar-wrap[data-v-121f3d11]{padding:5px 0;cursor:pointer;position:absolute;bottom:35px;width:calc(100% - 40px);height:3px}.controller .bar-wrap:hover .bar .played .thumb[data-v-121f3d11]{transform:scale(1)}.controller .bar-wrap .bar-time[data-v-121f3d11]{position:absolute;left:0;top:-20px;border-radius:4px;padding:5px 7px;background-color:rgba(0,0,0,.62);color:#fff;font-size:12px;text-align:center;opacity:1;transition:opacity .1s ease-in-out;word-wrap:normal;word-break:normal;z-index:2;pointer-events:none}.controller .bar-wrap .bar-time.hidden[data-v-121f3d11]{opacity:0}.controller .bar-wrap .bar[data-v-121f3d11]{position:relative;height:3px;width:100%;background:hsla(0,0%,100%,.2);cursor:pointer}.controller .bar-wrap .bar .loaded[data-v-121f3d11]{position:absolute;left:0;top:0;bottom:0;background:hsla(0,0%,100%,.4);height:3px;transition:all .5s ease;will-change:width}.controller .bar-wrap .bar .played[data-v-121f3d11]{position:absolute;left:0;top:0;bottom:0;height:3px;will-change:width;background-color:#fff}.controller .bar-wrap .bar .played .thumb[data-v-121f3d11]{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer;transition:all .3s ease-in-out;transform:scale(0);background-color:#fff}.controller .icons[data-v-121f3d11]{height:38px;position:absolute;bottom:0;left:14px;display:flex;align-items:center}.controller .icons .icon[data-v-121f3d11]{width:36px;height:100%;position:relative;cursor:pointer;display:flex;align-items:center;font-size:20px}.controller .icons .icon.play-icon[data-v-121f3d11]{font-size:26px}.controller .icons .icon .icon-content[data-v-121f3d11]{transition:all .2s ease-in-out;opacity:.8;color:#fff}.controller .icons .icon.active .icon-content[data-v-121f3d11],.controller .icons .icon:hover .icon-content[data-v-121f3d11]{opacity:1}.controller .icons .volume[data-v-121f3d11]{height:100%;position:relative;cursor:pointer;display:flex;align-items:center}.controller .icons .volume:hover .volume-bar-wrap .volume-bar[data-v-121f3d11]{width:45px}.controller .icons .volume:hover .volume-bar-wrap .volume-bar .volume-bar-inner .thumb[data-v-121f3d11]{transform:scale(1)}.controller .icons .volume.volume-active .volume-bar-wrap .volume-bar[data-v-121f3d11]{width:45px}.controller .icons .volume.volume-active .volume-bar-wrap .volume-bar .volume-bar-inner .thumb[data-v-121f3d11]{transform:scale(1)}.controller .icons .volume-bar-wrap[data-v-121f3d11]{display:inline-block;margin:0 15px 0 -5px;vertical-align:middle;height:100%}.controller .icons .volume-bar[data-v-121f3d11]{position:relative;top:17px;width:0;height:3px;background:#aaa;transition:all .3s ease-in-out}.controller .icons .volume-bar .volume-bar-inner[data-v-121f3d11]{position:absolute;bottom:0;left:0;height:100%;transition:all .1s ease;will-change:width;background-color:#fff}.controller .icons .volume-bar .volume-bar-inner .thumb[data-v-121f3d11]{position:absolute;top:0;right:5px;margin-top:-4px;margin-right:-10px;height:11px;width:11px;border-radius:50%;cursor:pointer;transition:all .3s ease-in-out;transform:scale(0);background-color:#fff}.controller .time[data-v-121f3d11]{height:38px;position:absolute;right:20px;bottom:0;display:flex;align-items:center;line-height:38px;color:#eee;text-shadow:0 0 2px rgba(0,0,0,.5);vertical-align:middle;font-size:13px;cursor:default}.controller .time .ptime[data-v-121f3d11]{margin-right:2px}.controller .time .dtime[data-v-121f3d11]{margin-left:2px}.editable-element-audio[data-v-001bfbc4]{position:absolute}.editable-element-audio.lock .audio-icon[data-v-001bfbc4]{cursor:default}.rotate-wrapper[data-v-001bfbc4]{width:100%;height:100%}.element-content[data-v-001bfbc4]{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.audio-icon[data-v-001bfbc4]{cursor:move}.audio-player[data-v-001bfbc4]{position:absolute}.mouse-selection[data-v-0d6c0f73]{position:absolute;background-color:rgba(209,68,36,.1);border:1px solid #d14424;z-index:200}.mouse-selection.quadrant-1[data-v-0d6c0f73]{transform-origin:0 0;transform:rotate(180deg)}.mouse-selection.quadrant-2[data-v-0d6c0f73]{transform-origin:50% 0;transform:rotate(180deg)}.mouse-selection.quadrant-3[data-v-0d6c0f73]{transform-origin:0 50%;transform:rotate(180deg)}.mouse-selection.quadrant-4[data-v-0d6c0f73]{transform-origin:0 0;transform:rotate(0deg)}.grid-lines[data-v-10cd6d44]{width:100%;height:100%;overflow:visible;z-index:999;pointer-events:none;position:absolute;top:0;right:0;bottom:0;left:0}.viewport-background[data-v-6f1e1261]{width:100%;height:100%;background-position:50%;position:absolute}.alignment-line[data-v-37fa6068]{position:absolute;z-index:100}.alignment-line .line[data-v-37fa6068]{width:0;height:0;border:0 dashed #d14424}.alignment-line .line.vertical[data-v-37fa6068]{transform:translateY(-.5px);border-left-width:1px}.alignment-line .line.horizontal[data-v-37fa6068]{transform:translateX(-.5px);border-top-width:1px}.ruler[data-v-60e06332]{font-size:12px}.h[data-v-60e06332]{position:absolute;background-color:#fff;border:1px solid #eee;height:20px;top:5px;display:flex;justify-content:space-between;align-items:center}.h .ruler-marker-100[data-v-60e06332]{height:100%;line-height:20px;text-align:right;flex:1;padding-right:5px;position:relative}.h .ruler-marker-100.hide span[data-v-60e06332],.h .ruler-marker-100.omit[data-v-60e06332]:before{display:none}.h .ruler-marker-100[data-v-60e06332]:not(:last-child):after{content:"";width:.1px;height:12px;position:absolute;right:0;bottom:0;background-color:#999}.h .ruler-marker-100[data-v-60e06332]:before{content:"";width:.1px;height:8px;position:absolute;right:50%;bottom:0;background-color:#999}.v[data-v-60e06332]{position:absolute;background-color:#fff;border:1px solid #eee;width:20px;left:5px;overflow:hidden}.v .ruler-marker-100[data-v-60e06332]{width:100%;line-height:20px;text-align:right;padding-bottom:5px;position:relative;-ms-writing-mode:tb-rl;writing-mode:vertical-rl}.v .ruler-marker-100.hide span[data-v-60e06332],.v .ruler-marker-100.omit[data-v-60e06332]:before{display:none}.v .ruler-marker-100[data-v-60e06332]:not(:last-child):after{content:"";height:.1px;width:12px;position:absolute;bottom:0;right:0;background-color:#999}.v .ruler-marker-100[data-v-60e06332]:before{content:"";height:.1px;width:8px;position:absolute;bottom:50%;right:0;background-color:#999}.element-create-selection[data-v-5a941f07]{position:absolute;top:0;left:0;width:100%;height:100%;z-index:2;cursor:crosshair}.element-create-selection svg[data-v-5a941f07]{overflow:visible}.selection[data-v-5a941f07]{position:absolute;opacity:.8}.selection[data-v-5a941f07]:not(.line){border:1px solid #d14424}.resize-handler[data-v-881ee3f8]{position:absolute;width:10px;height:10px;left:0;top:0;margin:-5px 0 0 -5px;border:1px solid #d14424;background-color:#fff;border-radius:1px;cursor:pointer}.resize-handler.bottom.rotate-135[data-v-881ee3f8],.resize-handler.left-bottom.rotate-90[data-v-881ee3f8],.resize-handler.left-top.rotate-0[data-v-881ee3f8],.resize-handler.left.rotate-45[data-v-881ee3f8],.resize-handler.right-bottom.rotate-0[data-v-881ee3f8],.resize-handler.right-top.rotate-90[data-v-881ee3f8],.resize-handler.right.rotate-45[data-v-881ee3f8],.resize-handler.top.rotate-135[data-v-881ee3f8]{cursor:nwse-resize}.resize-handler.bottom.rotate-0[data-v-881ee3f8],.resize-handler.left-bottom.rotate-135[data-v-881ee3f8],.resize-handler.left-top.rotate-45[data-v-881ee3f8],.resize-handler.left.rotate-90[data-v-881ee3f8],.resize-handler.right-bottom.rotate-45[data-v-881ee3f8],.resize-handler.right-top.rotate-135[data-v-881ee3f8],.resize-handler.right.rotate-90[data-v-881ee3f8],.resize-handler.top.rotate-0[data-v-881ee3f8]{cursor:ns-resize}.resize-handler.bottom.rotate-45[data-v-881ee3f8],.resize-handler.left-bottom.rotate-0[data-v-881ee3f8],.resize-handler.left-top.rotate-90[data-v-881ee3f8],.resize-handler.left.rotate-135[data-v-881ee3f8],.resize-handler.right-bottom.rotate-90[data-v-881ee3f8],.resize-handler.right-top.rotate-0[data-v-881ee3f8],.resize-handler.right.rotate-135[data-v-881ee3f8],.resize-handler.top.rotate-45[data-v-881ee3f8]{cursor:nesw-resize}.resize-handler.bottom.rotate-90[data-v-881ee3f8],.resize-handler.left-bottom.rotate-45[data-v-881ee3f8],.resize-handler.left-top.rotate-135[data-v-881ee3f8],.resize-handler.left.rotate-0[data-v-881ee3f8],.resize-handler.right-bottom.rotate-135[data-v-881ee3f8],.resize-handler.right-top.rotate-45[data-v-881ee3f8],.resize-handler.right.rotate-0[data-v-881ee3f8],.resize-handler.top.rotate-90[data-v-881ee3f8]{cursor:ew-resize}.border-line[data-v-7170d1be]{position:absolute;width:0;height:0;left:0;top:0;border:0 dashed #d14424}.border-line.top[data-v-7170d1be]{border-top-width:1px}.border-line.bottom[data-v-7170d1be]{border-bottom-width:1px}.border-line.left[data-v-7170d1be]{border-left-width:1px}.border-line.right[data-v-7170d1be]{border-right-width:1px}.border-line.wide[data-v-7170d1be]:before{content:"";position:absolute;background:transparent;cursor:move}.border-line.wide.top[data-v-7170d1be]:before{top:-8px;left:-8px;width:calc(100% + 16px);height:16px}.border-line.wide.bottom[data-v-7170d1be]:before{bottom:-8px;left:-8px;width:calc(100% + 16px);height:16px}.border-line.wide.left[data-v-7170d1be]:before{top:-8px;left:-8px;width:16px;height:calc(100% + 16px)}.border-line.wide.right[data-v-7170d1be]:before{top:-8px;right:-8px;width:16px;height:calc(100% + 16px)}.multi-select-operate[data-v-defbd922]{position:absolute;top:0;left:0;z-index:101}.rotate-handler[data-v-b99d8dae]{position:absolute;width:10px;height:10px;top:-25px;margin-left:-5px;border:1px solid #d14424;background-color:#fff;border-radius:1px;cursor:-webkit-grab;cursor:grab}.rotate-handler[data-v-b99d8dae]:active{cursor:-webkit-grabbing;cursor:grabbing}.image-element-operate.cliping[data-v-46b250c2]{visibility:hidden}.operate-keypoint-handler[data-v-fd38df18]{position:absolute;width:10px;height:10px;left:0;top:0;margin:-5px 0 0 -5px;border:1px solid #d14424;background-color:#ffe873;border-radius:1px}svg[data-v-4659f395]{position:absolute;left:0;top:0;pointer-events:none;transform-origin:0 0}.anchor-line[data-v-4659f395]{stroke-width:1px;stroke-dasharray:5 5;opacity:.5}.link-handler[data-v-bb722fc0]{height:30px;position:absolute;left:0;font-size:12px;padding:0 10px;background-color:#fff;box-shadow:3px 3px 3px rgba(0,0,0,.15);display:flex;align-items:center;color:#d14424}.link[data-v-bb722fc0]{max-width:300px;margin-right:20px;word-break:keep-all;overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.btns[data-v-bb722fc0]{display:flex;align-items:center}.btns .btn[data-v-bb722fc0]{word-break:keep-all;cursor:pointer}.operate[data-v-27793fbf]{position:absolute;z-index:100;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.operate.multi-select[data-v-27793fbf]{opacity:0}.animation-index[data-v-27793fbf]{position:absolute;top:0;left:-24px;font-size:12px}.animation-index .index-item[data-v-27793fbf]{width:18px;height:18px;background-color:#fff;color:#d14424;border:1px solid #d14424;display:flex;justify-content:center;align-items:center}.animation-index .index-item+.index-item[data-v-27793fbf]{margin-top:5px}.base-element-image[data-v-66f2009f]{position:absolute}.rotate-wrapper[data-v-66f2009f]{width:100%;height:100%}.element-content[data-v-66f2009f]{width:100%;height:100%;position:relative}.element-content .image-content[data-v-66f2009f]{width:100%;height:100%;overflow:hidden;position:relative}.base-element-text[data-v-659e869d],.element-content img[data-v-66f2009f]{position:absolute}.rotate-wrapper[data-v-659e869d]{width:100%;height:100%}.element-content[data-v-659e869d]{position:relative;padding:10px;line-height:1.5;word-break:break-word}.element-content .text[data-v-659e869d]{position:relative}.base-element-shape[data-v-073084bf]{position:absolute}.rotate-wrapper[data-v-073084bf]{width:100%;height:100%}.element-content[data-v-073084bf]{width:100%;height:100%;position:relative}.element-content svg[data-v-073084bf]{transform-origin:0 0;overflow:visible}.shape-text[data-v-073084bf]{position:absolute;top:0;bottom:0;left:0;right:0;display:flex;flex-direction:column;padding:10px;line-height:1.2;word-break:break-word}.shape-text.top[data-v-073084bf]{justify-content:flex-start}.shape-text.middle[data-v-073084bf]{justify-content:center}.shape-text.bottom[data-v-073084bf]{justify-content:flex-end}.base-element-line[data-v-340cdee8]{position:absolute}.element-content[data-v-340cdee8]{width:100%;height:100%;position:relative}.element-content svg[data-v-340cdee8]{transform-origin:0 0;overflow:visible}.base-element-chart[data-v-7d2e5c4e]{position:absolute}.element-content[data-v-7d2e5c4e],.rotate-wrapper[data-v-7d2e5c4e]{width:100%;height:100%}.static-table[data-v-00712fa4],table[data-v-00712fa4]{position:relative;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}table[data-v-00712fa4]{width:100%;table-layout:fixed;border-collapse:collapse;border-spacing:0;border:0;word-wrap:break-word;--themeColor:$themeColor;--subThemeColor1:$themeColor;--subThemeColor2:$themeColor}table.theme[data-v-00712fa4]{background-color:#fff}table.theme tr:nth-child(2n) .cell[data-v-00712fa4]{background-color:var(--subThemeColor1)}table.theme tr:nth-child(odd) .cell[data-v-00712fa4]{background-color:var(--subThemeColor2)}table.theme.col-footer tr .cell[data-v-00712fa4]:last-child,table.theme.col-header tr .cell[data-v-00712fa4]:first-child,table.theme.row-footer tr:last-child .cell[data-v-00712fa4],table.theme.row-header tr:first-child .cell[data-v-00712fa4]{background-color:var(--themeColor)}table tr[data-v-00712fa4]{height:36px}table .cell[data-v-00712fa4]{position:relative;white-space:normal;word-wrap:break-word;vertical-align:middle}table .cell-text[data-v-00712fa4]{min-height:32px;padding:5px;line-height:1.5}.base-element-table[data-v-53e0f1ba]{position:absolute}.rotate-wrapper[data-v-53e0f1ba]{width:100%;height:100%}.element-content[data-v-53e0f1ba]{width:100%;height:100%;position:relative}.base-element-latex[data-v-9a47b5f4]{position:absolute}.rotate-wrapper[data-v-9a47b5f4]{width:100%;height:100%}.element-content[data-v-9a47b5f4]{width:100%;height:100%;position:relative}.element-content svg[data-v-9a47b5f4]{transform-origin:0 0;overflow:visible}.base-element-video[data-v-56b7f716]{position:absolute}.rotate-wrapper[data-v-56b7f716]{width:100%;height:100%}.element-content[data-v-56b7f716]{width:100%;height:100%;background-color:#000;background-position:50%;background-size:contain;background-repeat:no-repeat;display:flex;justify-content:center;align-items:center}.icon[data-v-56b7f716]{font-size:140px;color:#aaa}.base-element-audio[data-v-5258e03b]{position:absolute}.rotate-wrapper[data-v-5258e03b]{width:100%;height:100%}.element-content[data-v-5258e03b]{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.audio-icon[data-v-5258e03b]{cursor:move}.thumbnail-slide[data-v-f69fb5b2]{background-color:#fff;overflow:hidden}.elements[data-v-f69fb5b2]{transform-origin:0 0}.background[data-v-f69fb5b2]{width:100%;height:100%;background-position:50%;position:absolute}.placeholder[data-v-f69fb5b2]{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.tabs[data-v-dfb654e8]{display:flex;justify-content:flex-start;align-items:center;border-bottom:1px solid #eee;margin-bottom:20px}.tab[data-v-dfb654e8]{padding:0 10px 8px;border-bottom:2px solid transparent;cursor:pointer}.tab.active[data-v-dfb654e8]{border-bottom:2px solid #d14424}.input[data-v-dfb654e8]{width:100%;height:32px}.preview[data-v-dfb654e8]{margin-top:12px}.thumbnail[data-v-dfb654e8]{outline:1px solid rgba(209,68,36,.15);margin-top:5px}.btns[data-v-dfb654e8]{margin-top:20px;text-align:right}.canvas[data-v-1db12f3f]{height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;overflow:hidden;background-color:#f9f9f9;position:relative}.drag-mask[data-v-1db12f3f]{cursor:-webkit-grab;cursor:grab;position:absolute;top:0;right:0;bottom:0;left:0}.viewport-wrapper[data-v-1db12f3f]{position:absolute;box-shadow:0 0 15px 0 rgba(0,0,0,.1)}.viewport[data-v-1db12f3f]{position:absolute;top:0;left:0;transform-origin:0 0}.shape-pool[data-v-5788e0d2]{width:340px;max-height:520px;overflow:auto;margin-top:-12px;margin-bottom:-12px;margin-right:-12px;padding-right:12px;padding-top:12px}.category-name[data-v-5788e0d2]{width:100%;font-size:13px;margin-bottom:10px;border-left:4px solid #aaa;background-color:#eee;padding:2px 0 2px 10px}.shape-list[data-v-5788e0d2]{display:flex;flex-wrap:wrap;align-content:flex-start;margin-bottom:10px}.shape-item[data-v-5788e0d2]{width:8%;margin-bottom:2.22222%;height:0;padding-bottom:8%;flex-shrink:0;position:relative;cursor:pointer}.shape-item[data-v-5788e0d2]:not(:nth-child(10n)){margin-right:2.22222%}.shape-content[data-v-5788e0d2]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center}.shape-content:hover .shape-path[data-v-5788e0d2]:not(.outlined){stroke:#d14424}.shape-content:hover .shape-path.outlined[data-v-5788e0d2]{fill:#d14424}.shape-content svg[data-v-5788e0d2]:not(:root){overflow:visible}.line-pool[data-v-bca68faa]{width:220px;overflow:auto;margin-bottom:-12px;margin-right:-12px;padding-right:12px}.category-name[data-v-bca68faa]{width:100%;font-size:13px;margin-bottom:10px;border-left:4px solid #aaa;background-color:#eee;padding:2px 0 2px 10px}.line-list[data-v-bca68faa]{display:flex;flex-wrap:wrap;align-content:flex-start;margin-bottom:10px}.line-item[data-v-bca68faa]{width:19%;margin-bottom:1.25%;height:0;padding-bottom:19%;flex-shrink:0;position:relative;cursor:pointer}.line-item[data-v-bca68faa]:not(:nth-child(5n)){margin-right:1.25%}.line-content[data-v-bca68faa]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;color:#999}.line-content[data-v-bca68faa]:hover{color:#d14424}.line-content svg[data-v-bca68faa]:not(:root){overflow:visible}.chart-pool[data-v-3870b42e]{width:200px;margin-bottom:-5px;display:flex;flex-wrap:wrap;align-content:flex-start}.chart-item[data-v-3870b42e]{width:19%;margin-bottom:1.25%;height:0;padding-bottom:19%;flex-shrink:0;position:relative;cursor:pointer}.chart-item[data-v-3870b42e]:not(:nth-child(5n)){margin-right:1.25%}.chart-content[data-v-3870b42e]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;color:#999}.chart-content[data-v-3870b42e]:hover{color:#d14424}.table-generator[data-v-144fbd05]{width:100%;margin-top:-12px}.title[data-v-144fbd05]{height:28px;line-height:28px;background-color:#ededed;margin:0 -12px 12px -12px;padding:0 14px;font-size:12px;display:flex;justify-content:space-between;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.title .right[data-v-144fbd05]{cursor:pointer}.title .right[data-v-144fbd05]:hover{color:#d14424}table[data-v-144fbd05]{border-collapse:separate}td[data-v-144fbd05]{width:23px;height:23px;line-height:23px;border:2px solid #fff;background-color:#f7f7f7}.cell[data-v-144fbd05]{width:100%;height:100%;border:1px solid #dcdcdc}.cell.active[data-v-144fbd05]{background-color:rgba(209,68,36,.1);border-color:#d14424}.custom[data-v-144fbd05]{width:230px}.custom .row[data-v-144fbd05]{display:flex;align-items:center}.custom .row+.row[data-v-144fbd05]{margin-top:10px}.btns[data-v-144fbd05]{margin-top:10px;text-align:right}.btns .btn[data-v-144fbd05]{margin-left:10px}.media-input[data-v-b9437110]{width:480px}.tabs[data-v-b9437110]{display:flex;justify-content:flex-start;align-items:center;border-bottom:1px solid #eee;margin-bottom:20px}.tab[data-v-b9437110]{padding:0 10px 8px;border-bottom:2px solid transparent;cursor:pointer}.tab.active[data-v-b9437110]{border-bottom:2px solid #d14424}.btns[data-v-b9437110]{margin-top:10px;text-align:right}svg[data-v-1c41d9fe]{overflow:hidden}.latex-editor[data-v-2d73bf28]{height:560px}.container[data-v-2d73bf28]{height:calc(100% - 50px);display:flex;padding-top:25px}.left[data-v-2d73bf28]{width:540px;height:100%;display:flex;flex-direction:column}.input-area[data-v-2d73bf28]{flex:1}.input-area textarea[data-v-2d73bf28]{height:100%!important;border-color:#eee!important;padding:10px!important}.input-area textarea[data-v-2d73bf28]:focus{box-shadow:none!important}.preview[data-v-2d73bf28]{height:160px;display:flex;justify-content:center;align-items:center;text-align:center;margin-top:20px;border:1px solid #eee;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.placeholder[data-v-2d73bf28]{color:#888}.preview-content[data-v-2d73bf28]{width:100%;height:100%;padding:10px;display:flex;justify-content:center;align-items:center}.right[data-v-2d73bf28]{height:100%;margin-left:20px;flex:1;border:1px solid #eee;background-color:#fff;flex-direction:column}.right[data-v-2d73bf28],.tabs[data-v-2d73bf28]{display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tabs[data-v-2d73bf28]{height:40px;font-size:12px;flex-shrink:0}.tab[data-v-2d73bf28]{flex:1;display:flex;justify-content:center;align-items:center;background-color:#f9f9f9;border-bottom:1px solid #eee;cursor:pointer}.tab.active[data-v-2d73bf28]{background-color:#fff;border-bottom-color:#fff}.tab+.tab[data-v-2d73bf28]{border-left:1px solid #eee}.content[data-v-2d73bf28]{height:calc(100% - 40px);font-size:13px}.formula[data-v-2d73bf28]{height:100%;padding:12px;overflow:auto;overflow:overlay}.formula-item+.formula-item[data-v-2d73bf28]{margin-top:10px}.formula-item .formula-title[data-v-2d73bf28]{margin-bottom:5px}.formula-item .formula-item-content[data-v-2d73bf28]{width:246px;height:60px;padding:5px;display:flex;align-items:center;background-color:#f9f9f9;cursor:pointer}.symbol-tabs[data-v-2d73bf28]{display:flex;justify-content:space-around;align-items:center;border-bottom:1px solid #eee;margin:12px 12px 5px}.symbol-tab[data-v-2d73bf28]{padding:6px 10px;border-bottom:2px solid transparent;cursor:pointer}.symbol-tab.active[data-v-2d73bf28]{border-bottom:2px solid #d14424}.symbol[data-v-2d73bf28]{height:100%;display:flex;flex-direction:column}.symbol-pool[data-v-2d73bf28]{display:flex;flex-wrap:wrap;flex:1;padding:12px;overflow:auto;overflow:overlay}.symbol-item[data-v-2d73bf28]{display:flex;justify-content:center;align-items:center}.symbol-item[data-v-2d73bf28]:hover{background-color:#f9f9f9;cursor:pointer}.footer[data-v-2d73bf28]{height:50px;display:flex;justify-content:flex-end;align-items:flex-end}.footer .btn[data-v-2d73bf28]{margin-left:10px}.canvas-tool[data-v-5d4eff54]{position:relative;border-bottom:1px solid #eee;background-color:#fff;display:flex;justify-content:space-between;padding:0 10px;font-size:13px;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.left-handler[data-v-5d4eff54]{display:flex;align-items:center}.add-element-handler[data-v-5d4eff54]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex}.handler-item[data-v-5d4eff54]{margin:0 10px;font-size:14px;cursor:pointer}.handler-item.disable[data-v-5d4eff54]{opacity:.5}.handler-item.active[data-v-5d4eff54]{color:#d14424}.right-handler[data-v-5d4eff54]{display:flex;align-items:center}.right-handler .text[data-v-5d4eff54]{width:40px;text-align:center;cursor:pointer}.right-handler .viewport-size[data-v-5d4eff54]{font-size:13px}.preset-item[data-v-5d4eff54]{padding:8px 20px;text-align:center;cursor:pointer}.preset-item[data-v-5d4eff54]:hover{color:#d14424}.layout-pool[data-v-cc6b7dca]{width:394px;height:500px;padding:2px;margin-right:-12px;padding-right:12px;overflow:auto;display:flex;flex-wrap:wrap;align-content:flex-start}.layout-item[data-v-cc6b7dca]{width:48%;margin-bottom:4%}.layout-item[data-v-cc6b7dca]:not(:nth-child(2n)){margin-right:4%}.layout-item .thumbnail[data-v-cc6b7dca]{outline:1px solid #eee;cursor:pointer}.layout-item .thumbnail[data-v-cc6b7dca]:hover{outline-color:#d14424}.thumbnails[data-v-153c0b44]{border-right:1px solid #eee;background-color:#fff;display:flex;flex-direction:column;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.add-slide[data-v-153c0b44]{height:40px;font-size:12px;display:flex;flex-shrink:0;border-bottom:1px solid #eee;cursor:pointer}.add-slide .btn[data-v-153c0b44]{flex:1;display:flex;justify-content:center;align-items:center}.add-slide .btn[data-v-153c0b44]:hover{background-color:#f9f9f9}.add-slide .select-btn[data-v-153c0b44]{width:30px;display:flex;justify-content:center;align-items:center;border-left:1px solid #eee}.add-slide .select-btn[data-v-153c0b44]:hover{background-color:#f9f9f9}.add-slide .icon[data-v-153c0b44]{margin-right:3px;font-size:14px}.thumbnail-list[data-v-153c0b44]{padding:5px 0;flex:1;overflow:auto}.thumbnail-item[data-v-153c0b44]{display:flex;justify-content:center;align-items:center;padding:5px 0}.thumbnail-item .thumbnail[data-v-153c0b44]{outline:1px solid rgba(209,68,36,.15)}.thumbnail-item.active .label[data-v-153c0b44]{color:#d14424}.thumbnail-item.active .thumbnail[data-v-153c0b44],.thumbnail-item.selected .thumbnail[data-v-153c0b44]{outline-color:#d14424}.label[data-v-153c0b44]{font-size:12px;color:#999;width:20px;cursor:-webkit-grab;cursor:grab}.label.offset-left[data-v-153c0b44]{position:relative;left:-4px}.label[data-v-153c0b44]:active{cursor:-webkit-grabbing;cursor:grabbing}.row[data-v-22345a51]{width:100%;display:flex;align-items:center;margin-bottom:10px}.slider[data-v-22345a51]{flex:3}.color-btn[data-v-ed8f2044]{display:flex;align-items:center;justify-content:center;padding:0!important}.color-block[data-v-ed8f2044]{height:20px;margin-left:8px;flex:1;outline:1px dashed hsla(0,0%,40%,.12);background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABQAAAAUCAYAAACNiR0NAAAAAXNSR0IArs4c6QAAAEBJREFUOE9jfPbs2X8GIoCkpCQRqhgYGEcNxBlOo2GIM2iGQLL5//8/UTnl+fPnxOWUUQNxhtNoGOLOKYM+2QAAh2Nq10DwkukAAAAASUVORK5CYII=)}.content[data-v-ed8f2044]{width:100%;height:100%}.color-btn-icon[data-v-ed8f2044]{width:30px;font-size:12px;margin-top:2px;color:#bfbfbf}.row[data-v-e91e3764]{width:100%;display:flex;align-items:center;margin-bottom:10px}.switch-wrapper[data-v-e91e3764]{text-align:right}.row[data-v-053ed706]{width:100%;display:flex;align-items:center;margin-bottom:10px}.switch-wrapper[data-v-053ed706]{text-align:right}.slider[data-v-053ed706]{flex:3}.text-style-panel[data-v-5830b9cf]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.row[data-v-5830b9cf]{width:100%;display:flex;align-items:center;margin-bottom:10px}.preset-style[data-v-5830b9cf]{display:flex;flex-wrap:wrap;margin-bottom:10px}.preset-style-item[data-v-5830b9cf]{width:50%;height:50px;border:1px solid #d6d6d6;box-sizing:border-box;display:flex;justify-content:center;align-items:center;position:relative;cursor:pointer;transition:all .2s}.preset-style-item[data-v-5830b9cf]:hover{border-color:#d14424;color:#d14424;z-index:1}.preset-style-item[data-v-5830b9cf]:nth-child(2n){margin-left:-1px}.preset-style-item[data-v-5830b9cf]:nth-child(n+3){margin-top:-1px}.text-color-btn[data-v-5830b9cf]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:0}.text-color-block[data-v-5830b9cf]{width:16px;height:3px;margin-top:1px}.font-size-btn[data-v-5830b9cf]{padding:0}.link-popover[data-v-5830b9cf]{width:240px}.link-popover .btns[data-v-5830b9cf]{margin-top:10px;text-align:right}.row[data-v-37fbdfde],.row[data-v-59a1646e]{width:100%;display:flex;align-items:center;margin-bottom:10px}.switch-wrapper[data-v-37fbdfde]{text-align:right}.filter[data-v-37fbdfde]{font-size:12px}.filter-item[data-v-37fbdfde]{padding:8px 0;display:flex;justify-content:center;align-items:center}.filter-item .name[data-v-37fbdfde]{width:60px}.filter-item .filter-slider[data-v-37fbdfde]{flex:1;margin:0 6px}.row[data-v-7da35bec]{width:100%;display:flex;align-items:center;margin-bottom:10px}.switch-wrapper[data-v-7da35bec]{text-align:right}.origin-image[data-v-7da35bec]{height:100px;background-size:contain;background-repeat:no-repeat;background-position:50%;background-color:#f9f9f9;margin-bottom:10px}.full-width-btn[data-v-7da35bec]{width:100%;margin-bottom:10px}.btn-icon[data-v-7da35bec]{margin-right:3px}.clip[data-v-7da35bec]{width:260px;font-size:12px}.clip .title[data-v-7da35bec]{margin-bottom:5px}.shape-clip[data-v-7da35bec]{margin-bottom:10px;display:flex;flex-wrap:wrap;align-content:flex-start}.shape-clip-item[data-v-7da35bec]{display:flex;justify-content:center;align-items:center;cursor:pointer;width:16%;margin-bottom:5%}.shape-clip-item[data-v-7da35bec]:not(:nth-child(5n)){margin-right:5%}.shape-clip-item:hover .shape[data-v-7da35bec]{background-color:#ccc}.shape-clip-item .shape[data-v-7da35bec]{width:40px;height:40px;background-color:#e1e1e1}.shape-style-panel[data-v-02998580]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.row[data-v-02998580]{width:100%;display:flex;align-items:center;margin-bottom:10px}.text-color-btn[data-v-02998580]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:0}.text-color-block[data-v-02998580]{width:16px;height:3px;margin-top:1px}.font-size-btn[data-v-02998580]{padding:0}.slider[data-v-02998580]{flex:3}.row[data-v-938968a2]{width:100%;display:flex;align-items:center;margin-bottom:10px}.line-btn[data-v-938968a2]{display:flex;align-items:center;justify-content:space-between;padding:0!important}.line-btn .line-wrapper[data-v-938968a2]{margin-left:8px}.line-wrapper[data-v-938968a2]{overflow:visible}.line-btn-icon[data-v-938968a2]{width:30px;font-size:12px;margin-top:2px;color:#bfbfbf}.preset-point-style[data-v-938968a2]{padding:0 10px}.preset-point-style+.preset-point-style[data-v-938968a2]{margin-top:10px}.chart-data-editor[data-v-53b32689]{width:600px;position:relative}.editor-content[data-v-53b32689]{width:100%;height:360px;position:relative;border-right:1px solid #ccc;border-bottom:1px solid #ccc;overflow:auto;overflow:overlay}.range-box[data-v-53b32689]{position:absolute;top:0;left:0;z-index:100;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.temp-range[data-v-53b32689]{width:0;height:0;position:absolute;top:0;left:0;background-color:hsla(0,0%,53.3%,.3)}.range-line[data-v-53b32689]{width:0;height:0;position:absolute;left:0;top:0;border:0 solid #d14424}.range-line.t[data-v-53b32689]{border-top-width:1px}.range-line.b[data-v-53b32689]{border-bottom-width:1px}.range-line.l[data-v-53b32689]{border-left-width:1px}.range-line.r[data-v-53b32689]{border-right-width:1px}.resizable[data-v-53b32689]{position:absolute;width:12px;height:12px;left:0;top:0;margin:-9px 0 0 -9px;cursor:nwse-resize}.resizable[data-v-53b32689]:after{content:"";position:absolute;width:4px;height:12px;right:0;top:0;background-color:#d14424}.resizable[data-v-53b32689]:before{content:"";position:absolute;width:12px;height:4px;right:0;bottom:0;background-color:#d14424}table[data-v-53b32689]{width:100%;height:100%;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;table-layout:fixed}table td[data-v-53b32689]{text-align:center;border:1px solid #ccc;vertical-align:middle;width:100px;height:32px}table td.head[data-v-53b32689]{background-color:rgba(209,68,36,.1)}table .item[data-v-53b32689]{width:100%;height:100%;border:0;outline:0;font-size:13px;text-align:center;background-color:transparent}table .item.selected[data-v-53b32689]{background-color:rgba(209,68,36,.02)}.btns[data-v-53b32689]{margin-top:10px;display:flex;justify-content:space-between}.chart-style-panel[data-v-769d6876]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.row[data-v-769d6876]{width:100%;display:flex;align-items:center;margin-bottom:10px}.full-width-btn[data-v-769d6876]{width:100%}.btn-icon[data-v-769d6876]{margin-right:3px}.color-btn-wrap[data-v-769d6876]{position:relative}.delete-color-btn[data-v-769d6876]{position:absolute;width:30px;right:2px;top:2px;bottom:2px;display:flex;justify-content:center;align-items:center;background-color:#fff;cursor:pointer}.preset-themes[data-v-769d6876]{width:250px;margin-bottom:-10px;display:flex;flex-wrap:wrap;align-content:flex-start}.preset-theme[data-v-769d6876]{display:flex;cursor:pointer;width:48%;margin-bottom:4%}.preset-theme[data-v-769d6876]:not(:nth-child(2n)){margin-right:4%}.preset-theme-color[data-v-769d6876]{width:20px;height:20px}.preset-theme-color.select[data-v-769d6876]{transform:scale(1.2);transition:transform .1s}.row[data-v-7e28e1d8]{width:100%;display:flex;align-items:center;margin-bottom:10px}.theme-switch[data-v-7e28e1d8]{margin-bottom:18px}.switch-wrapper[data-v-7e28e1d8]{text-align:right}.text-color-btn[data-v-7e28e1d8]{display:flex;flex-direction:column;justify-content:center;align-items:center}.text-color-block[data-v-7e28e1d8]{width:16px;height:3px;margin-top:1px}.set-count[data-v-7e28e1d8]{display:flex;justify-content:center;align-items:center}.set-count .btn[data-v-7e28e1d8]{padding:4px 8px}.set-count .count-text[data-v-7e28e1d8]{flex:1;text-align:center;margin:0 8px}.row[data-v-546adf8c],.row[data-v-ff7125dc]{width:100%;display:flex;align-items:center;margin-bottom:10px}.background-image-wrapper[data-v-ff7125dc],.title[data-v-ff7125dc]{margin-bottom:10px}.background-image[data-v-ff7125dc]{height:0;padding-bottom:56.25%;border:1px dashed #eee;border-radius:2px;position:relative;transition:all .2s}.background-image[data-v-ff7125dc]:hover{border-color:#d14424;color:#d14424}.background-image .content[data-v-ff7125dc]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background-position:50%;background-size:contain;background-repeat:no-repeat;cursor:pointer}.row[data-v-5d723d50]{width:100%;display:flex;align-items:center;margin-bottom:10px}.switch-row[data-v-5d723d50]{height:32px}.switch-wrapper[data-v-5d723d50]{text-align:right}.row[data-v-71469855]{width:100%;display:flex;align-items:center;margin-bottom:10px}.text-color-btn[data-v-71469855]{display:flex;flex-direction:column;justify-content:center;align-items:center;padding:0}.text-color-block[data-v-71469855]{width:16px;height:3px;margin-top:1px}.font-size-btn[data-v-71469855]{padding:0}.row[data-v-43e5f476]{width:100%;display:flex;align-items:center;margin-bottom:10px}.title[data-v-43e5f476]{margin-bottom:10px}.label[data-v-43e5f476]{text-align:center}.btn-icon[data-v-43e5f476]{margin-right:3px}.icon-btn[data-v-43e5f476]{cursor:pointer}.element-animation-panel[data-v-2f69234f]{height:100%;display:flex;flex-direction:column}.tabs[data-v-2f69234f]{display:flex;justify-content:flex-start;align-items:center;border-bottom:1px solid #eee;margin-bottom:20px}.tab[data-v-2f69234f]{width:33.33%;padding-bottom:8px;border-bottom:2px solid transparent;text-align:center;cursor:pointer}.tab.active[data-v-2f69234f]{border-bottom:2px solid #d14424}.tab.in.active[data-v-2f69234f]{border-bottom-color:#68a490}.tab.out.active[data-v-2f69234f]{border-bottom-color:#d86344}.tab.attention.active[data-v-2f69234f]{border-bottom-color:#e8b76a}.element-animation[data-v-2f69234f]{height:32px;display:flex;align-items:center}.element-animation-btn[data-v-2f69234f]{width:100%}.config-item[data-v-2f69234f]{display:flex;align-items:center}.config-item+.config-item[data-v-2f69234f]{margin-top:5px}.tip[data-v-2f69234f]{height:32px;display:flex;justify-content:center;align-items:center;font-style:italic}.animation-pool[data-v-2f69234f]{width:400px;height:500px;overflow-y:auto;overflow-x:hidden;font-size:12px;margin-right:-12px;position:relative}.animation-pool .mask[data-v-2f69234f]{position:absolute;top:0;right:0;bottom:0;left:0}.animation-pool.in .type-title[data-v-2f69234f]{border-left-color:#68a490;background-color:rgba(104,164,144,.15)}.animation-pool.out .type-title[data-v-2f69234f]{border-left-color:#d86344;background-color:rgba(216,99,68,.15)}.animation-pool.attention .type-title[data-v-2f69234f]{border-left-color:#e8b76a;background-color:rgba(232,183,106,.15)}.type-title[data-v-2f69234f]{width:100%;font-size:13px;margin-bottom:10px;border-left:4px solid #aaa;background-color:#eee;padding:2px 0 2px 10px}.pool-item-wrapper[data-v-2f69234f]{display:flex;flex-wrap:wrap;align-content:flex-start}.pool-item[data-v-2f69234f]{width:24%;margin-bottom:1.33333%;margin-bottom:10px;height:40px;line-height:40px;text-align:center;cursor:pointer}.pool-item[data-v-2f69234f]:not(:nth-child(4n)){margin-right:1.33333%}.animation-box[data-v-2f69234f]{background-color:#f9f9f9}.animation-sequence[data-v-2f69234f]{flex:1;padding-right:12px;margin-right:-12px;overflow:auto;overflow:overlay}.sequence-item[data-v-2f69234f]{border:1px solid #eee;padding:10px 6px;border-radius:2px;margin-bottom:8px;transition:all .5s}.sequence-item.in.active[data-v-2f69234f]{border-color:#68a490}.sequence-item.out.active[data-v-2f69234f]{border-color:#d86344}.sequence-item.attention.active[data-v-2f69234f]{border-color:#e8b76a}.sequence-item.active[data-v-2f69234f]{height:auto}.sequence-item .sequence-content[data-v-2f69234f]{display:flex;align-items:center;cursor:-webkit-grab;cursor:grab}.sequence-item .sequence-content[data-v-2f69234f]:active{cursor:-webkit-grabbing;cursor:grabbing}.sequence-item .sequence-content .index[data-v-2f69234f]{flex:1}.sequence-item .sequence-content .text[data-v-2f69234f]{flex:6}.sequence-item .sequence-content .handler[data-v-2f69234f]{flex:2;font-size:15px;text-align:right}.sequence-item .sequence-content .handler-btn[data-v-2f69234f]{margin-left:8px;cursor:pointer}.slide-design-panel[data-v-e0bbbd9e]{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.row[data-v-e0bbbd9e]{width:100%;display:flex;align-items:center;margin-bottom:10px}.title[data-v-e0bbbd9e]{margin-bottom:10px}.title.dropdown[data-v-e0bbbd9e]{display:flex;align-items:center;cursor:pointer}.title.dropdown .icon[data-v-e0bbbd9e]{margin-left:5px;transition:transform .1s}.title.dropdown:not(.active) .icon[data-v-e0bbbd9e]{transform:rotate(-90deg)}.background-image-wrapper[data-v-e0bbbd9e]{margin-bottom:10px}.background-image[data-v-e0bbbd9e]{height:0;padding-bottom:56.25%;border:1px dashed #eee;border-radius:2px;position:relative;transition:all .2s}.background-image[data-v-e0bbbd9e]:hover{border-color:#d14424;color:#d14424}.background-image .content[data-v-e0bbbd9e]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background-position:50%;background-size:contain;background-repeat:no-repeat;cursor:pointer}.theme-list[data-v-e0bbbd9e]{display:flex;flex-wrap:wrap;align-content:flex-start}.theme-item[data-v-e0bbbd9e]{width:22%;margin-bottom:4%;padding-bottom:22%;border-radius:2px;position:relative;cursor:pointer}.theme-item[data-v-e0bbbd9e]:not(:nth-child(4n)){margin-right:4%}.theme-item .theme-item-content[data-v-e0bbbd9e]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;flex-direction:column;justify-content:center;align-items:center;transition:box-shadow .2s}.theme-item .theme-item-content[data-v-e0bbbd9e]:hover{box-shadow:0 0 4px #888}.theme-item .text[data-v-e0bbbd9e]{font-size:16px}.theme-item .color-block[data-v-e0bbbd9e]{width:28px;height:10px;margin-top:5px}.slider[data-v-e0bbbd9e]{flex:3}.animation-pool[data-v-577ae912]{display:flex;flex-wrap:wrap;margin-bottom:10px}.animation-item[data-v-577ae912]{width:50%;height:115px;border:1px solid #d6d6d6;box-sizing:border-box;display:flex;flex-direction:column;justify-content:space-between;align-items:center;padding:25px 0 15px 0;position:relative;cursor:pointer}.animation-item.active[data-v-577ae912]{border-color:#d14424;z-index:1}.animation-item[data-v-577ae912]:nth-child(2n){margin-left:-1px}.animation-item[data-v-577ae912]:nth-child(n+3){margin-top:-1px}.animation-block[data-v-577ae912]{width:64px;height:36px;background:#666;position:relative;overflow:hidden}.animation-block.fade[data-v-577ae912]:hover:after{content:"";width:100%;height:100%;position:absolute;left:0;top:0;background-color:#d9dadb;-webkit-animation:fade-577ae912 .3s linear;animation:fade-577ae912 .3s linear}.animation-block.slideX[data-v-577ae912]:hover:after{content:"";width:100%;height:100%;position:absolute;left:0;top:0;background-color:#d9dadb;-webkit-animation:slideX-577ae912 .3s linear;animation:slideX-577ae912 .3s linear}.animation-block.slideY[data-v-577ae912]:hover:after{content:"";width:100%;height:100%;position:absolute;left:0;top:0;background-color:#d9dadb;-webkit-animation:slideY-577ae912 .3s linear;animation:slideY-577ae912 .3s linear}.animation-text[data-v-577ae912]{font-size:12px;color:#333;text-align:center}@-webkit-keyframes fade-577ae912{0%{opacity:0}to{opacity:1}}@keyframes fade-577ae912{0%{opacity:0}to{opacity:1}}@-webkit-keyframes slideX-577ae912{0%{transform:translateX(100%)}to{transform:translateX(0)}}@keyframes slideX-577ae912{0%{transform:translateX(100%)}to{transform:translateX(0)}}@-webkit-keyframes slideY-577ae912{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideY-577ae912{0%{transform:translateY(100%)}to{transform:translateY(0)}}.row[data-v-0d3881c5]{width:100%;display:flex;align-items:center;margin-bottom:10px}.symbol-panel[data-v-ba0c96fc]{height:100%;display:flex;flex-direction:column}.symbol-panel .tabs[data-v-ba0c96fc]{display:flex;justify-content:space-around;align-items:center;border-bottom:1px solid #eee;margin-bottom:8px}.symbol-panel .tab[data-v-ba0c96fc]{padding:6px 10px 8px;border-bottom:2px solid transparent;cursor:pointer}.symbol-panel .tab.active[data-v-ba0c96fc]{border-bottom:2px solid #d14424}.symbol-panel .pool[data-v-ba0c96fc]{padding:5px 12px;margin:0 -12px;flex:1;font-size:18px;overflow:auto;overflow:overlay;display:flex;flex-wrap:wrap;align-content:flex-start}.symbol-panel .symbol-item[data-v-ba0c96fc]{width:18%;margin-bottom:2.5%;height:0;padding-bottom:18%;position:relative;cursor:pointer;border:1px solid #eee}.symbol-panel .symbol-item[data-v-ba0c96fc]:not(:nth-child(5n)){margin-right:2.5%}.symbol-panel .symbol-item[data-v-ba0c96fc]:hover{color:#d14424}.symbol-panel .symbol-item .symbol[data-v-ba0c96fc]{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;justify-content:center;align-items:center;background-color:#fff}.toolbar[data-v-5303bd17]{border-left:1px solid #eee;background-color:#fff;display:flex;flex-direction:column}.tabs[data-v-5303bd17]{height:40px;font-size:12px;flex-shrink:0;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.tab[data-v-5303bd17]{flex:1;display:flex;justify-content:center;align-items:center;background-color:#f9f9f9;border-bottom:1px solid #eee;cursor:pointer}.tab.active[data-v-5303bd17]{background-color:#fff;border-bottom-color:#fff}.tab+.tab[data-v-5303bd17]{border-left:1px solid #eee}.content[data-v-5303bd17]{padding:12px;font-size:13px;overflow:auto;overflow:overlay}.remark[data-v-82b674f6]{position:relative;border-top:1px solid #eee;background-color:#f9f9f9;line-height:1.5}.remark textarea[data-v-82b674f6]{width:100%;height:100%;overflow-y:auto;resize:none;border:0;outline:0;padding:8px;font-size:12px;background-color:transparent;position:absolute;top:0;right:0;bottom:0;left:0}.resize-handler[data-v-82b674f6]{height:7px;position:absolute;top:-3px;left:0;right:0;cursor:n-resize;z-index:2}.export-img-dialog[data-v-60a953a0]{height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;position:relative;overflow:hidden}.thumbnails-view[data-v-60a953a0],.thumbnails-view[data-v-60a953a0]:after{position:absolute;top:0;right:0;bottom:0;left:0}.thumbnails-view[data-v-60a953a0]:after{content:"";background-color:#fff}.configs[data-v-60a953a0]{width:350px;height:calc(100% - 100px);display:flex;flex-direction:column;justify-content:center;z-index:1}.configs .row[data-v-60a953a0]{display:flex;justify-content:center;align-items:center;margin-bottom:25px}.configs .title[data-v-60a953a0]{width:100px;position:relative}.configs .title[data-v-60a953a0]:after{content:attr(data-range);position:absolute;top:20px;left:0}.configs .config-item[data-v-60a953a0]{flex:1}.btns[data-v-60a953a0]{width:300px;height:100px;display:flex;justify-content:center;align-items:center}.btns .export[data-v-60a953a0]{flex:1}.btns .close[data-v-60a953a0]{width:100px;margin-left:10px}.export-json-dialog[data-v-1bc24666]{height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;position:relative;overflow:hidden}.preview[data-v-1bc24666]{width:100%;height:calc(100% - 100px);display:flex;flex-direction:column;justify-content:center;background-color:#f9f9f9;color:#0451a5}.btns[data-v-1bc24666]{width:300px;height:100px;display:flex;justify-content:center;align-items:center}.btns .export[data-v-1bc24666]{flex:1}.btns .close[data-v-1bc24666]{width:100px;margin-left:10px}[data-v-1bc24666]::-webkit-scrollbar{width:10px;height:10px;background-color:#f9f9f9}[data-v-1bc24666]::-webkit-scrollbar-thumb{background-color:#c1c1c1}.export-pdf-dialog[data-v-15b57798]{height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;position:relative;overflow:hidden}.thumbnails-view[data-v-15b57798],.thumbnails-view[data-v-15b57798]:after{position:absolute;top:0;right:0;bottom:0;left:0}.thumbnails-view[data-v-15b57798]:after{content:"";background-color:#fff}.thumbnail.break-page[data-v-15b57798]{-moz-column-break-after:page;break-after:page}.configs[data-v-15b57798]{width:300px;height:calc(100% - 100px);display:flex;flex-direction:column;justify-content:center;z-index:1}.configs .row[data-v-15b57798]{display:flex;justify-content:center;align-items:center;margin-bottom:25px}.configs .title[data-v-15b57798]{width:100px}.configs .config-item[data-v-15b57798]{flex:1}.configs .tip[data-v-15b57798]{font-size:12px;color:#aaa;line-height:1.8;margin-top:25px}.btns[data-v-15b57798]{width:300px;height:100px;display:flex;justify-content:center;align-items:center}.btns .export[data-v-15b57798]{flex:1}.btns .close[data-v-15b57798]{width:100px;margin-left:10px}.export-pptx-dialog[data-v-3fef9be0]{height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;position:relative;overflow:hidden}.configs[data-v-3fef9be0]{width:350px;height:calc(100% - 100px);display:flex;flex-direction:column;justify-content:center}.configs .row[data-v-3fef9be0]{display:flex;justify-content:center;align-items:center;margin-bottom:25px}.configs .title[data-v-3fef9be0]{width:100px;position:relative}.configs .title[data-v-3fef9be0]:after{content:attr(data-range);position:absolute;top:20px;left:0}.configs .config-item[data-v-3fef9be0]{flex:1}.btns[data-v-3fef9be0]{width:300px;height:100px;display:flex;justify-content:center;align-items:center}.btns .export[data-v-3fef9be0]{flex:1}.btns .close[data-v-3fef9be0]{width:100px;margin-left:10px}.export-pptist-dialog[data-v-e2b465d2]{height:100%;display:flex;justify-content:center;align-items:center;flex-direction:column;position:relative;overflow:hidden}.configs[data-v-e2b465d2]{width:350px;height:calc(100% - 100px);display:flex;flex-direction:column;justify-content:center}.configs .row[data-v-e2b465d2]{display:flex;justify-content:center;align-items:center;margin-bottom:25px}.configs .title[data-v-e2b465d2]{width:100px;position:relative}.configs .title[data-v-e2b465d2]:after{content:attr(data-range);position:absolute;top:20px;left:0}.configs .config-item[data-v-e2b465d2]{flex:1}.configs .tip[data-v-e2b465d2]{font-size:12px;color:#aaa;line-height:1.8;margin-top:25px}.btns[data-v-e2b465d2]{width:300px;height:100px;display:flex;justify-content:center;align-items:center}.btns .export[data-v-e2b465d2]{flex:1}.btns .close[data-v-e2b465d2]{width:100px;margin-left:10px}.export-dialog[data-v-1f8f1a8b]{margin:-24px}.tabs[data-v-1f8f1a8b]{height:50px;font-size:12px;flex-shrink:0;display:flex;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border-top-left-radius:2px;border-top-right-radius:2px;overflow:hidden}.tab[data-v-1f8f1a8b]{flex:1;display:flex;justify-content:center;align-items:center;background-color:#f9f9f9;border-bottom:1px solid #eee;cursor:pointer}.tab.active[data-v-1f8f1a8b]{background-color:#fff;border-bottom-color:#fff}.tab+.tab[data-v-1f8f1a8b]{border-left:1px solid #eee}.content[data-v-1f8f1a8b]{height:460px;padding:12px;font-size:13px;overflow:auto;overflow:overlay}.pptist-editor[data-v-328e1a4e]{height:100%}.layout-header[data-v-328e1a4e]{height:40px}.layout-content[data-v-328e1a4e]{height:calc(100% - 40px);display:flex}.layout-content-left[data-v-328e1a4e]{width:160px;height:100%;flex-shrink:0}.layout-content-center[data-v-328e1a4e]{width:calc(100% - 420px)}.layout-content-center .center-top[data-v-328e1a4e]{height:40px}.layout-content-right[data-v-328e1a4e]{width:260px;height:100%}.screen-element-video[data-v-76457308]{position:absolute}.element-content[data-v-76457308],.rotate-wrapper[data-v-76457308]{width:100%;height:100%}.screen-element-audio[data-v-1172b8ee]{position:absolute}.rotate-wrapper[data-v-1172b8ee]{width:100%;height:100%}.element-content[data-v-1172b8ee]{width:100%;height:100%;display:flex;justify-content:center;align-items:center}.element-content:hover .audio-player[data-v-1172b8ee]{display:block}.audio-icon[data-v-1172b8ee]{cursor:pointer}.audio-player[data-v-1172b8ee]{position:absolute;display:none}.link[data-v-a15cc1d8]{cursor:pointer}.screen-slide[data-v-7cf7f9e7]{position:absolute;top:0;left:0;transform-origin:0 0;overflow:hidden}.background[data-v-7cf7f9e7]{width:100%;height:100%;background-position:50%;position:absolute}.screen-slide-list[data-v-77a3e620]{background:#1d1d1d;position:relative;width:100%;height:100%}.slide-item[data-v-77a3e620]{position:absolute;top:0;left:0;width:100%;height:100%}.slide-item.current[data-v-77a3e620]{z-index:2}.slide-item.hide[data-v-77a3e620]{opacity:0}.slide-item.turning-mode-no.before[data-v-77a3e620]{transform:translateY(-100%)}.slide-item.turning-mode-no.after[data-v-77a3e620]{transform:translateY(100%)}.slide-item.turning-mode-fade[data-v-77a3e620]{transition:opacity .75s}.slide-item.turning-mode-fade.after[data-v-77a3e620],.slide-item.turning-mode-fade.before[data-v-77a3e620]{pointer-events:none;opacity:0}.slide-item.turning-mode-slideX[data-v-77a3e620]{transition:transform .35s}.slide-item.turning-mode-slideX.before[data-v-77a3e620]{transform:translateX(-100%)}.slide-item.turning-mode-slideX.after[data-v-77a3e620]{transform:translateX(100%)}.slide-item.turning-mode-slideY[data-v-77a3e620]{transition:transform .35s}.slide-item.turning-mode-slideY.before[data-v-77a3e620]{transform:translateY(-100%)}.slide-item.turning-mode-slideY.after[data-v-77a3e620]{transform:translateY(100%)}.slide-content[data-v-77a3e620]{background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;justify-content:center;align-items:center}.slide-thumbnails[data-v-b7c6c0cc]{width:100%;height:100%;position:fixed;top:0;left:0;background-color:#1a1a1a;z-index:99}.return-button[data-v-b7c6c0cc]{height:60px;padding:20px 30px 0}.return-button .icon[data-v-b7c6c0cc]{color:#fff;font-size:36px;cursor:pointer}.return-button .icon[data-v-b7c6c0cc]:hover{color:#d14424}.slide-thumbnails-content[data-v-b7c6c0cc]{height:calc(100% - 100px);padding:20px 30px 30px 30px;display:flex;flex-wrap:wrap;align-content:flex-start;overflow:auto;overflow:overlay}.slide-thumbnails-content .thumbnail[data-v-b7c6c0cc]{width:150px;outline:2px solid #aaa;margin-right:12px;margin-bottom:12px}.slide-thumbnails-content .thumbnail[data-v-b7c6c0cc]:hover{outline-color:#d14424}.slide-thumbnails-content .thumbnail.active[data-v-b7c6c0cc]{outline-width:3px;outline-color:#d14424}.writing-board[data-v-1d4eb7f0]{z-index:8;cursor:none;position:absolute;top:0;right:0;bottom:0;left:0}.blackboard[data-v-1d4eb7f0]{width:100%;height:100%;background-color:#0f392b}.canvas[data-v-1d4eb7f0]{position:absolute;top:0;left:0}.eraser[data-v-1d4eb7f0],.pen[data-v-1d4eb7f0]{pointer-events:none;position:absolute;z-index:9}.eraser .icon[data-v-1d4eb7f0],.pen .icon[data-v-1d4eb7f0]{filter:drop-shadow(2px 2px 2px #555)}.eraser[data-v-1d4eb7f0]{display:flex;justify-content:center;align-items:center;border-radius:50%;border:4px solid rgba(85,85,85,.15);color:rgba(85,85,85,.75)}.writing-board-tool[data-v-876081a6]{font-size:12px;z-index:10;position:absolute;top:0;right:0;bottom:0;left:0}.writing-board-tool .writing-board-wrap[data-v-876081a6]{position:absolute;top:50%;left:50%;transform:translate(-50%,-50%)}.writing-board-tool .tools[data-v-876081a6]{height:50px;position:fixed;z-index:11;padding:12px;background-color:#eee;border-radius:2px;display:flex;align-items:center}.writing-board-tool .btn[data-v-876081a6]{padding:5px 10px;cursor:pointer}.writing-board-tool .btn[data-v-876081a6]:hover{color:#d14424}.writing-board-tool .btn.active[data-v-876081a6]{background-color:rgba(209,68,36,.5);color:#fff}.writing-board-tool .icon[data-v-876081a6]{font-size:20px}.writing-board-tool .colors[data-v-876081a6]{display:flex;padding:0 10px}.writing-board-tool .color[data-v-876081a6]{width:16px;height:16px;border-radius:2px;cursor:pointer}.writing-board-tool .color[data-v-876081a6]:hover{transform:scale(1.15)}.writing-board-tool .color.active[data-v-876081a6]{transform:scale(1.3)}.writing-board-tool .color+.color[data-v-876081a6]{margin-left:8px}.base-view[data-v-d72d6626]{width:100%;height:100%}.base-view.laser-pen[data-v-d72d6626]{cursor:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABHNCSVQICAgIfAhkiAAACCJJREFUWIXtmLuO3MYShv/qZl9IzqwXo2BkSAtsIK+z8wwOBcOJ9C56Cr2LlThQcgBnfofVBnswXlgTaLHaIdk3dtcJOKOzd8n2MeDABRDDgKz/m+pudv0N/BN/Luj/kYSZJQBxJR8DKESU/2zuPwTIzAKnpxqHhxUuLir0vYSUAkS0ewA5F7Rtxv7+iNPTEYeHkYjKXwrIzHK9XtultRohaKSkkFIVhqGCEAIxTvm0ZpRSTNOMUGqEUgnGxLX3cblc+t9T2S8GXK1W9dP53OLiwoLZhMtLQ4CiGBVKkchZIOcpn5QMKQuEyKx1YiCZvb0AooD9ff/rZuMPDg7cl+hWn3uAmQWABut1g/PzOnZdTd5bMY6aQtAIQQGQGEd5bYirKgPIZExiY2IKIbK1XpeinzaN2s7b4XPD/iAgM0ucn7fYbNrQ963Juaauq8k5i3E01PcG46iQs0TO1wGlzJAyo6oS2jagqgLGUQNQwTllvJeYzwUz9w8N+b2AzCxwft6i72fBuZkYhnbcbBqKsSbvazhnEIJBzqrEqGQpAlO1AaKShShC6wQpE4UQUNcBKenReyXm8yoIIYwQtNXq7qvkQxVssNm0wbmZuLiYUQgtnGtps2ngfQ3vLaVkEKOmGKcqMtMWkEnKTFonaB3Z+4AQPFmreD6vSAghxpECAFMKY7EoALovBlytVjXW6yb0fSuGoaUQWrq8nKHvW/R9S943xbmavJ+qmNIO8FMFIWXert7A1gYxjprHsSLmaTHt7UF0HYdSilmv82q1ynctnFuAzCzx8aPF+Xltcq7HzaaBcy36vsUwzKjrZhiGRgxDA+8tUjIUgkbOEqVMgEIUkjLDmAjvgwjBI6WKxlHybp5KyVRKMcaMGIb0dLFIzBxvzsdbgOv12i69t7HrpgURY02bTYO+b6nrZui6qZLONdz3jTg5ORDHx0f48OExQpgBAIzp8OjRez46Oi7Pnq1ot5BKETQVgYmosJRj6rrEQNJCxLX3EUB/LyAzC3z8qOGcIe8tOWdpmm81ed9gGJpdJdF1rXz79jucnX1za454P8fZ2ZzOzr6Rx8fvyvPnP38afiEKVVXmqhrJ+wSlIqoqYj73S2s1M7urC0ZcS3x6qhGCDpeXBuOoMY4Gzhl4b4tzNYahgXMNuq4Vb978cCfczTg7+0a8efMDuq6Fcw2GoSnO1fDewjmDcTQYx0kzBI3TU3319euAh4cVUlIEKApBU98bhGAoJSO8N/Dect834u3b73B+/vVn4XZxfv61ePv2O+77Bt5b4b2hlKbcfW8oBE2AQkoKh4fXRvU64MVFhZQqilEhBLX9CCvEqLer1YiTk4MvqtxdlTw5OcAWDDFq5DxphDBtmSlNzcddgMws0fcyDEOFUiQAiZxliVGVGFVJSXEImo6Pj3433Dbo+PiIQ9AlJbXLi5wnrVIm7b6X223wOiAAASkFhBDIWWAcJXKWshQhcpYiZ0k5S3z48PhO9ZcvgV9+ma6XL+8m/PDhMW1ziW1u5Cy3WpO2lOIq11VAAhEhRkLO0z0RgVmAefotRXz6lNyMV6+AxWK6Xr26GzCEGXZb4i7nTifnSXv6Tn7qssTdmf4+cRWQwczQmiHldM/MICogmn6FKDDmzj0Tr18D5+fT9fr13WrGdBCiXMu505Fy0mZmTJYBwPUPdUHOBaUUSFlQVRlS5rzbtqTMJGXGo0fvcXY2vyX+44/T9VA8evSepcy8zcdCFDG1ZBlSTto5FwC3P9RElNG22TTNCCEygAwps9A6Ca2TUCqRMZGPjo4fprg/+OjomIyJQqm0ywspJy0hJu22zVf34+tzcH9/hFIja51gTEJVJUiZoHWEMQFKhfLs2QpPnrz73XRPnrwrz56toFSAMQFaR0g5aRiTWOsEpUbs749XX7u51Y1QKjGQ2JjIbRtgTGClQrE2wFpPbTuU589/xmLx2xfDLRa/lefPf6a2HWCtL9YG3oJy2wY2JjKQoFTC6ekDgIeHEcZEs7cXUFURVTV1wtZ6UdcOTTOgrgfMZn158eKnL6rkkyfvyosXP2E261HXA5pmEHXtYK1HXU9WoKomTWMiDg/j1devbStEVN6/fx+XRIGt9RhHjZQ0Wat4HCsax//1fEQlf//9v8XJyTF9rt1q2+mPtW2PphnY2gHWOrbWcV17ttaDKKy9j4/398u9gACwXC49Pn7UuhQNQI3eT206s2DadptCFEiZqaoS/+tfvnz77X/oRsPKUmYyJpJSAdZ6NM2Aphl4Pu/QND3P5wO0dmo2c5jNHPb3/fKrr/xNnluARJRXq5V/2jQqOKfE1kPsPC8zM1VVLkqNwpiAEAxbq+hGy89SZtq2/MXaIOrasbUDmqZH2/Zo257bdghSOtM07tfNxh/s799yd3d6koODA8fM0ngvw9bgYG9vatOJClfVSFUVYe3UldxhmiBlxtY0kVLTlLHW8Xw+oG17NqYvs1lv6rrHcjkcEN1p5B9ydQPmc2GEoABAdB1TKYWlnDph5wJvbSdPpwvXbCcLUXhrO2FMQF0HttZBa8dtO5TZrDdt26FtewDDfRD3AhJRYeYemKxh2Bqc1HVTm17Xn4y7yFnyDeMurhh33hp3rmuvZjMXpHSmrqehXiz6h04XHjxZIKLMzB0Wi2LW64xhSAwkVFXEOGpo/dmjD2yPPlBVka31mM2caRqH5XLAnz362FUSQLdarfLTxSJpISLmcx8uLw217R8/PLpnzt3S/5KHdvG3Pn67Afr3PMB8APgvOwL+J/5s/BeEBm1u1Gu4+QAAAABJRU5ErkJggg==) 20 20,default!important}.tools-left[data-v-d72d6626]{position:fixed;bottom:8px;left:8px;font-size:25px;color:#666;z-index:10}.tools-left .tool-btn[data-v-d72d6626]{opacity:.35;cursor:pointer}.tools-left .tool-btn[data-v-d72d6626]:hover{opacity:.9}.tools-left .tool-btn+.tool-btn[data-v-d72d6626]{margin-left:8px}.tools-right[data-v-d72d6626]{height:66px;position:fixed;bottom:-66px;right:0;z-index:5;padding:8px;transition:bottom .2s}.tools-right.visible[data-v-d72d6626]{bottom:0}.tools-right[data-v-d72d6626]:after{content:"";width:100%;height:66px;position:absolute;left:0;top:-66px}.tools-right .content[data-v-d72d6626]{width:100%;height:100%;display:flex;justify-content:center;align-items:center;border-radius:2px;font-size:25px;background-color:#fff;color:#41464b;padding:8px 10px;box-shadow:0 2px 12px 0 rgba(56,56,56,.2);border:1px solid #e2e6ed}.tools-right .tool-btn[data-v-d72d6626]{cursor:pointer}.tools-right .tool-btn.active[data-v-d72d6626],.tools-right .tool-btn[data-v-d72d6626]:hover{color:#d14424}.tools-right .tool-btn+.tool-btn[data-v-d72d6626]{margin-left:15px}.tools-right .page-number[data-v-d72d6626]{font-size:13px;padding:8px 12px;cursor:pointer}.presenter-view[data-v-5fba3eec]{width:100%;height:100%;display:flex}.toolbar[data-v-5fba3eec]{width:70px;height:100%;background-color:#fff;border-right:1px solid #eee;font-size:12px;margin:20px 0}.toolbar .tool-btn[data-v-5fba3eec]{display:flex;flex-direction:column;justify-content:center;align-items:center;cursor:pointer}.toolbar .tool-btn+.tool-btn[data-v-5fba3eec]{margin-top:22px}.toolbar .tool-btn.active[data-v-5fba3eec],.toolbar .tool-btn[data-v-5fba3eec]:hover{color:#d14424}.toolbar .divider[data-v-5fba3eec]{width:70%;min-width:70%;margin:24px 15%}.toolbar .tool-icon[data-v-5fba3eec]{margin-bottom:8px;font-size:22px}.content[data-v-5fba3eec]{width:calc(100% - 430px);height:100%;background-color:#1d1d1d}.slide-list-wrap[data-v-5fba3eec]{height:calc(100% - 190px);margin:20px;overflow:hidden;position:relative}.slide-list-wrap.laser-pen[data-v-5fba3eec]{cursor:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACgAAAAoCAYAAACM/rhtAAAABHNCSVQICAgIfAhkiAAACCJJREFUWIXtmLuO3MYShv/qZl9IzqwXo2BkSAtsIK+z8wwOBcOJ9C56Cr2LlThQcgBnfofVBnswXlgTaLHaIdk3dtcJOKOzd8n2MeDABRDDgKz/m+pudv0N/BN/Luj/kYSZJQBxJR8DKESU/2zuPwTIzAKnpxqHhxUuLir0vYSUAkS0ewA5F7Rtxv7+iNPTEYeHkYjKXwrIzHK9XtultRohaKSkkFIVhqGCEAIxTvm0ZpRSTNOMUGqEUgnGxLX3cblc+t9T2S8GXK1W9dP53OLiwoLZhMtLQ4CiGBVKkchZIOcpn5QMKQuEyKx1YiCZvb0AooD9ff/rZuMPDg7cl+hWn3uAmQWABut1g/PzOnZdTd5bMY6aQtAIQQGQGEd5bYirKgPIZExiY2IKIbK1XpeinzaN2s7b4XPD/iAgM0ucn7fYbNrQ963Juaauq8k5i3E01PcG46iQs0TO1wGlzJAyo6oS2jagqgLGUQNQwTllvJeYzwUz9w8N+b2AzCxwft6i72fBuZkYhnbcbBqKsSbvazhnEIJBzqrEqGQpAlO1AaKShShC6wQpE4UQUNcBKenReyXm8yoIIYwQtNXq7qvkQxVssNm0wbmZuLiYUQgtnGtps2ngfQ3vLaVkEKOmGKcqMtMWkEnKTFonaB3Z+4AQPFmreD6vSAghxpECAFMKY7EoALovBlytVjXW6yb0fSuGoaUQWrq8nKHvW/R9S943xbmavJ+qmNIO8FMFIWXert7A1gYxjprHsSLmaTHt7UF0HYdSilmv82q1ynctnFuAzCzx8aPF+Xltcq7HzaaBcy36vsUwzKjrZhiGRgxDA+8tUjIUgkbOEqVMgEIUkjLDmAjvgwjBI6WKxlHybp5KyVRKMcaMGIb0dLFIzBxvzsdbgOv12i69t7HrpgURY02bTYO+b6nrZui6qZLONdz3jTg5ORDHx0f48OExQpgBAIzp8OjRez46Oi7Pnq1ot5BKETQVgYmosJRj6rrEQNJCxLX3EUB/LyAzC3z8qOGcIe8tOWdpmm81ed9gGJpdJdF1rXz79jucnX1za454P8fZ2ZzOzr6Rx8fvyvPnP38afiEKVVXmqhrJ+wSlIqoqYj73S2s1M7urC0ZcS3x6qhGCDpeXBuOoMY4Gzhl4b4tzNYahgXMNuq4Vb978cCfczTg7+0a8efMDuq6Fcw2GoSnO1fDewjmDcTQYx0kzBI3TU3319euAh4cVUlIEKApBU98bhGAoJSO8N/Dect834u3b73B+/vVn4XZxfv61ePv2O+77Bt5b4b2hlKbcfW8oBE2AQkoKh4fXRvU64MVFhZQqilEhBLX9CCvEqLer1YiTk4MvqtxdlTw5OcAWDDFq5DxphDBtmSlNzcddgMws0fcyDEOFUiQAiZxliVGVGFVJSXEImo6Pj3433Dbo+PiIQ9AlJbXLi5wnrVIm7b6X223wOiAAASkFhBDIWWAcJXKWshQhcpYiZ0k5S3z48PhO9ZcvgV9+ma6XL+8m/PDhMW1ziW1u5Cy3WpO2lOIq11VAAhEhRkLO0z0RgVmAefotRXz6lNyMV6+AxWK6Xr26GzCEGXZb4i7nTifnSXv6Tn7qssTdmf4+cRWQwczQmiHldM/MICogmn6FKDDmzj0Tr18D5+fT9fr13WrGdBCiXMu505Fy0mZmTJYBwPUPdUHOBaUUSFlQVRlS5rzbtqTMJGXGo0fvcXY2vyX+44/T9VA8evSepcy8zcdCFDG1ZBlSTto5FwC3P9RElNG22TTNCCEygAwps9A6Ca2TUCqRMZGPjo4fprg/+OjomIyJQqm0ywspJy0hJu22zVf34+tzcH9/hFIja51gTEJVJUiZoHWEMQFKhfLs2QpPnrz73XRPnrwrz56toFSAMQFaR0g5aRiTWOsEpUbs749XX7u51Y1QKjGQ2JjIbRtgTGClQrE2wFpPbTuU589/xmLx2xfDLRa/lefPf6a2HWCtL9YG3oJy2wY2JjKQoFTC6ekDgIeHEcZEs7cXUFURVTV1wtZ6UdcOTTOgrgfMZn158eKnL6rkkyfvyosXP2E261HXA5pmEHXtYK1HXU9WoKomTWMiDg/j1devbStEVN6/fx+XRIGt9RhHjZQ0Wat4HCsax//1fEQlf//9v8XJyTF9rt1q2+mPtW2PphnY2gHWOrbWcV17ttaDKKy9j4/398u9gACwXC49Pn7UuhQNQI3eT206s2DadptCFEiZqaoS/+tfvnz77X/oRsPKUmYyJpJSAdZ6NM2Aphl4Pu/QND3P5wO0dmo2c5jNHPb3/fKrr/xNnluARJRXq5V/2jQqOKfE1kPsPC8zM1VVLkqNwpiAEAxbq+hGy89SZtq2/MXaIOrasbUDmqZH2/Zo257bdghSOtM07tfNxh/s799yd3d6koODA8fM0ngvw9bgYG9vatOJClfVSFUVYe3UldxhmiBlxtY0kVLTlLHW8Xw+oG17NqYvs1lv6rrHcjkcEN1p5B9ydQPmc2GEoABAdB1TKYWlnDph5wJvbSdPpwvXbCcLUXhrO2FMQF0HttZBa8dtO5TZrDdt26FtewDDfRD3AhJRYeYemKxh2Bqc1HVTm17Xn4y7yFnyDeMurhh33hp3rmuvZjMXpHSmrqehXiz6h04XHjxZIKLMzB0Wi2LW64xhSAwkVFXEOGpo/dmjD2yPPlBVka31mM2caRqH5XLAnz362FUSQLdarfLTxSJpISLmcx8uLw217R8/PLpnzt3S/5KHdvG3Pn67Afr3PMB8APgvOwL+J/5s/BeEBm1u1Gu4+QAAAABJRU5ErkJggg==) 20 20,default!important}.thumbnails[data-v-5fba3eec]{height:150px;padding:15px;white-space:nowrap;overflow-x:auto;overflow-y:hidden;border-top:1px solid #3a3a3a}.thumbnail[data-v-5fba3eec]{display:inline-block;outline:2px solid #aaa}.thumbnail+.thumbnail[data-v-5fba3eec]{margin-left:10px}.thumbnail[data-v-5fba3eec]:hover{outline-color:#d14424}.thumbnail.active[data-v-5fba3eec]{outline-width:3px;outline-color:#d14424}.remark[data-v-5fba3eec]{width:360px;height:100%;position:relative;background-color:#2a2a2a;border-left:1px solid #3a3a3a;color:#fff}.remark .header[data-v-5fba3eec]{height:60px;padding:0 20px;display:flex;justify-content:space-between;align-items:center;font-size:18px;border-bottom:1px solid #3a3a3a}.remark .remark-content[data-v-5fba3eec]{height:calc(100% - 60px);padding:20px;line-height:1.5;overflow:auto;overflow:overlay}.remark .remark-scale[data-v-5fba3eec]{position:absolute;right:5px;bottom:5px;font-size:22px;display:flex}.remark .scale-btn[data-v-5fba3eec]{width:40px;height:40px;display:flex;justify-content:center;align-items:center;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;cursor:pointer}.remark .scale-btn.disable[data-v-5fba3eec]{color:#666;cursor:no-drop}.remark .scale-btn[data-v-5fba3eec]:not(.disable):hover{background-color:#333}[data-v-5fba3eec]::-webkit-scrollbar{width:0;height:0}.pptist-screen[data-v-6bf3d190]{width:100%;height:100%}.mobile-operate[data-v-7fdc6c04]{position:absolute;z-index:100;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.mobile-thumbnails[data-v-4a0c7aa7]{padding:10px;white-space:nowrap;overflow-x:auto;overflow-y:hidden}.thumbnail-item[data-v-4a0c7aa7]{position:relative;display:inline-block;outline:2px solid #aaa}.thumbnail-item+.thumbnail-item[data-v-4a0c7aa7]{margin-left:10px}.thumbnail-item.active[data-v-4a0c7aa7]{outline-color:#d14424}.thumbnail-item.active .label[data-v-4a0c7aa7]{background-color:#d14424}.thumbnail-item .label[data-v-4a0c7aa7]{min-width:20px;height:14px;line-height:14px;position:absolute;right:-1px;top:-1px;color:#fff;background-color:#aaa;z-index:1;font-size:12px;text-align:center;padding:0 5px}[data-v-4a0c7aa7]::-webkit-scrollbar{width:0;height:0}.slide-toolbar[data-v-5c24a24d]{height:230px;background-color:#fff;box-shadow:0 0 15px 0 rgba(0,0,0,.1);display:flex;flex-direction:column;position:relative;z-index:2}.remark[data-v-5c24a24d]{position:relative;flex:1;border-bottom:1px solid #eee;line-height:1.5}.remark textarea[data-v-5c24a24d]{width:100%;height:100%;overflow-y:auto;resize:none;border:0;outline:0;padding:8px 10px;font-size:12px;position:absolute;top:0;right:0;bottom:0;left:0}.toolbar[data-v-5c24a24d]{height:90px;border-bottom:1px solid #eee;padding:10px}.row[data-v-5c24a24d]{width:100%;display:flex;align-items:center;margin-bottom:5px}.row .icon[data-v-5c24a24d]{margin-right:3px}.element-toolbar[data-v-446388c6]{width:100%;height:240px;position:absolute;z-index:99;bottom:0;left:0;background-color:#fff;box-shadow:0 0 15px 0 rgba(0,0,0,.1);display:flex;flex-direction:column;-webkit-animation:slideInUp-446388c6 .15s;animation:slideInUp-446388c6 .15s}.tabs[data-v-446388c6]{display:flex;justify-content:flex-start;align-items:center;border-bottom:1px solid #eee;font-size:12px;font-weight:700;margin-bottom:10px}.tab[data-v-446388c6]{width:30%;padding:10px 10px 12px;margin:0 10%;border-bottom:2px solid transparent;text-align:center;cursor:pointer}.tab.active[data-v-446388c6]{border-bottom:2px solid #d14424}@-webkit-keyframes slideInUp-446388c6{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInUp-446388c6{0%{transform:translateY(100%)}to{transform:translateY(0)}}.content[data-v-446388c6]{padding:10px;flex:1;overflow:auto}.row[data-v-446388c6]{width:100%;display:flex;align-items:center;margin-bottom:10px}.row .icon[data-v-446388c6]{margin-right:3px}.row-block[data-v-446388c6]{margin-bottom:10px;background-color:#f9f9f9;border-radius:2px;padding:10px}.label[data-v-446388c6]{font-size:13px;margin-bottom:20px;margin-left:6px}.colors[data-v-446388c6]{display:flex;flex-wrap:wrap;align-content:flex-start}.color[data-v-446388c6]{width:12%;margin-bottom:.57143%;padding-bottom:5px;display:flex;justify-content:center;align-items:center}.color[data-v-446388c6]:not(:nth-child(8n)){margin-right:.57143%}.color .color-block[data-v-446388c6]{width:30px;height:30px;border-radius:50%}.mobile-editor-header[data-v-8639f30e]{height:50px;background-color:#fff;display:flex;justify-content:space-between;align-items:center;padding:0 18px;font-size:13px;box-shadow:0 0 15px 0 rgba(0,0,0,.1);position:relative;z-index:2}.history[data-v-8639f30e]{display:flex;justify-content:center;align-items:center}.history-item[data-v-8639f30e]{margin-right:20px}.history-item.disable[data-v-8639f30e]{opacity:.5}.mobile-editor[data-v-8cdcde82]{height:100%;position:relative;background-color:#f9f9f9}.content[data-v-8cdcde82]{height:calc(100% - 280px);display:flex;justify-content:center;align-items:center}.viewport[data-v-8cdcde82]{transform-origin:0 0}.viewport-wrapper[data-v-8cdcde82]{position:relative;box-shadow:0 0 15px 0 rgba(0,0,0,.1)}.background[data-v-8cdcde82]{width:100%;height:100%;background-position:50%;position:absolute}.mobile-player[data-v-5293de3b]{transform-origin:0 0;background-color:#1d1d1d;position:relative}.screen-slide-list[data-v-5293de3b]{position:relative;width:100%;height:100%}.slide-item[data-v-5293de3b]{position:absolute;top:0;left:0;width:100%;height:100%}.slide-item.current[data-v-5293de3b]{z-index:2}.slide-item.hide[data-v-5293de3b]{opacity:0}.slide-item.turning-mode-no.before[data-v-5293de3b]{transform:translateY(-100%)}.slide-item.turning-mode-no.after[data-v-5293de3b]{transform:translateY(100%)}.slide-item.turning-mode-fade[data-v-5293de3b]{transition:opacity .75s}.slide-item.turning-mode-fade.after[data-v-5293de3b],.slide-item.turning-mode-fade.before[data-v-5293de3b]{pointer-events:none;opacity:0}.slide-item.turning-mode-slideX[data-v-5293de3b]{transition:transform .35s}.slide-item.turning-mode-slideX.before[data-v-5293de3b]{transform:translateX(-100%)}.slide-item.turning-mode-slideX.after[data-v-5293de3b]{transform:translateX(100%)}.slide-item.turning-mode-slideY[data-v-5293de3b]{transition:transform .35s}.slide-item.turning-mode-slideY.before[data-v-5293de3b]{transform:translateY(-100%)}.slide-item.turning-mode-slideY.after[data-v-5293de3b]{transform:translateY(100%)}.slide-content[data-v-5293de3b]{background-color:#fff;position:absolute;top:50%;left:50%;transform:translate(-50%,-50%);display:flex;justify-content:center;align-items:center}.header[data-v-5293de3b]{width:100%;height:40px;line-height:40px;padding:0 15px;position:absolute;top:0;left:0;z-index:99;background-color:rgba(29,29,29,.7);text-align:right;font-size:13px;color:#fff;-webkit-animation:slideInDown-5293de3b .15s;animation:slideInDown-5293de3b .15s}.header .back[data-v-5293de3b]{height:100%}.thumbnails[data-v-5293de3b]{width:100%;position:absolute;bottom:0;left:0;z-index:99;background-color:rgba(29,29,29,.7);overflow:auto!important;-webkit-animation:slideInUp-5293de3b .15s;animation:slideInUp-5293de3b .15s}@-webkit-keyframes slideInUp-5293de3b{0%{transform:translateY(100%)}to{transform:translateY(0)}}@keyframes slideInUp-5293de3b{0%{transform:translateY(100%)}to{transform:translateY(0)}}@-webkit-keyframes slideInDown-5293de3b{0%{transform:translateY(-100%)}to{transform:translateY(0)}}@keyframes slideInDown-5293de3b{0%{transform:translateY(-100%)}to{transform:translateY(0)}}.mobile-preview[data-v-836e1638]{height:100%;background-color:#f9f9f9}.tip[data-v-836e1638]{position:fixed;top:0;left:0;right:0;z-index:99}.thumbnail-list[data-v-836e1638]{height:calc(100% - 50px);padding:10px;overflow:auto}.thumbnail-item[data-v-836e1638]{display:flex;justify-content:center;align-items:center;box-shadow:0 0 15px 0 rgba(0,0,0,.1)}.thumbnail-item+.thumbnail-item[data-v-836e1638]{margin-top:10px}.menu[data-v-836e1638]{height:50px;position:relative;box-shadow:0 -2px 4px 0 rgba(51,51,51,.05);background:#fff;display:flex;justify-content:center;align-items:center}.menu .menu-item[data-v-836e1638]{width:50%;height:100%;display:flex;justify-content:center;align-items:center;font-size:13px}.menu .menu-item .icon[data-v-836e1638]{margin-right:8px;font-size:18px}#app,.mobile[data-v-1fb24d48]{height:100%}.ProseMirror,.ProseMirror-static{outline:0;border:0;font-size:20px;word-break:break-word;white-space:normal}.ProseMirror-static:not(.ProseMirror-static),.ProseMirror:not(.ProseMirror-static){-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}.ProseMirror-static ::-moz-selection,.ProseMirror ::-moz-selection{background-color:rgba(209,68,36,.3);color:inherit}.ProseMirror-static ::selection,.ProseMirror ::selection{background-color:rgba(209,68,36,.3);color:inherit}.ProseMirror-static p,.ProseMirror p{text-indent:var(--textIndent)}.ProseMirror-static p+p,.ProseMirror p+p{margin-top:var(--paragraphSpace)}.ProseMirror-static ul,.ProseMirror ul{list-style-type:disc;-webkit-padding-start:20px;padding-inline-start:20px}.ProseMirror-static ul li,.ProseMirror ul li{list-style-type:disc}.ProseMirror-static ol,.ProseMirror ol{list-style-type:decimal;-webkit-padding-start:20px;padding-inline-start:20px}.ProseMirror-static ol li,.ProseMirror ol li{list-style-type:decimal}.ProseMirror-static code,.ProseMirror code{background-color:#eee;padding:1px 3px;margin:0 1px;border-radius:2px;font-family:inherit}.ProseMirror-static blockquote,.ProseMirror blockquote{overflow:hidden;padding-right:1.2em;padding-left:1.2em;margin-left:0;margin-right:0;font-style:italic;border-left:5px solid #ccc}.ProseMirror-static [data-indent="1"],.ProseMirror [data-indent="1"]{padding-left:48px}.ProseMirror-static [data-indent="2"],.ProseMirror [data-indent="2"]{padding-left:96px}.ProseMirror-static [data-indent="3"],.ProseMirror [data-indent="3"]{padding-left:144px}.ProseMirror-static [data-indent="4"],.ProseMirror [data-indent="4"]{padding-left:192px}.ProseMirror-static [data-indent="5"],.ProseMirror [data-indent="5"]{padding-left:240px}.ProseMirror-static [data-indent="6"],.ProseMirror [data-indent="6"]{padding-left:288px}.ProseMirror-static [data-indent="7"],.ProseMirror [data-indent="7"]{padding-left:336px}.ProseMirror-selectednode{outline:none!important}a,abbr,acronym,address,applet,article,aside,audio,b,big,blockquote,body,canvas,caption,center,cite,code,dd,del,details,dfn,div,dl,dt,em,embed,fieldset,figcaption,figure,footer,form,h1,h2,h3,h4,h5,h6,header,hgroup,html,i,iframe,img,ins,kbd,label,legend,li,mark,menu,nav,object,ol,output,p,pre,q,ruby,s,samp,section,small,span,strike,strong,sub,summary,sup,table,tbody,td,tfoot,th,thead,time,tr,tt,u,ul,var,video{margin:0;padding:0;border:0;font-size:100%;vertical-align:baseline;box-sizing:border-box}article,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}body{line-height:1;font-family:-apple-system,BlinkMacSystemFont,PingFang SC,Hiragino Sans GB,Microsoft YaHei,Helvetica Neue,Helvetica,Arial,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol}body,html{height:100%;overflow:hidden;background-color:#fff;color:#41464b}li,ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:after,blockquote:before,q:after,q:before{content:""}table{border-collapse:collapse;border-spacing:0}a{text-decoration:none}::-webkit-scrollbar{width:5px;height:5px;background-color:#fff}::-webkit-scrollbar-thumb{background-color:#c1c1c1}.ant-popover{padding-top:5px!important}.ant-popover-arrow{display:none}.ant-popover-inner{box-shadow:3px 3px 3px rgba(0,0,0,.15);border:1px solid #eee}.ant-popover-inner-content{padding:12px!important}.ant-dropdown{min-width:120px}.ant-dropdown-menu{box-shadow:3px 3px 3px rgba(0,0,0,.15)}.ant-dropdown-menu-item:hover{background-color:rgba(209,68,36,.2)}.ant-btn.no-padding{padding:0}.ant-radio-button-wrapper{text-align:center}.ant-slider-track{background-color:#d14424}.ant-slider-handle{border-color:#d14424}.ant-select{-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}.ant-select-item-option-active:not(.ant-select-item-option-disabled){background-color:rgba(209,68,36,.2)}.ant-tooltip-inner{font-size:12px}@font-face{font-family:仓耳小丸子;src:url(../fonts/仓耳小丸子.676e187a.ttf)}@font-face{font-family:优设标题黑;src:url(../fonts/优设标题黑.1726685c.ttf)}@font-face{font-family:峰广明锐体;src:url(../fonts/峰广明锐体.8bdb14f7.ttf)}@font-face{font-family:摄图摩登小方体;src:url(../fonts/摄图摩登小方体.de722238.ttf)}@font-face{font-family:站酷快乐体;src:url(../fonts/站酷快乐体.0aceab97.ttf)}@font-face{font-family:字制区喜脉体;src:url(../fonts/字制区喜脉体.fc4a0c7d.ttf)}@font-face{font-family:素材集市康康体;src:url(../fonts/素材集市康康体.8db9d61f.ttf)}@font-face{font-family:素材集市酷方体;src:url(../fonts/素材集市酷方体.8d33b29e.ttf)}@font-face{font-family:途牛类圆体;src:url(../fonts/途牛类圆体.abaea3c4.ttf)}@font-face{font-family:锐字真言体;src:url(../fonts/锐字真言体.1583afec.ttf)}.input[data-v-4727b7ff]{display:none}.checkbox-button[data-v-699cf016]{outline:0;background-color:#fff;border:1px solid #d9d9d9;font-size:13px;padding:0 15px;height:32px;text-align:center;cursor:pointer}.checkbox-button[data-v-699cf016]:hover{color:#d14424}.checkbox-button.checked[data-v-699cf016]{color:#fff;background-color:#d14424;border-color:#d14424}.checkbox-button.checked[data-v-699cf016]:hover{background:rgba(209,68,36,.9);border-color:rgba(209,68,36,.9)}.checkbox-button-group[data-v-b8aa6eac]{display:flex;align-items:center}.checkbox-button-group[data-v-b8aa6eac] .checkbox-button{border-radius:0;border-left-width:0;border-right-width:0;display:inline-block}.checkbox-button-group[data-v-b8aa6eac] .checkbox-button+.checkbox-button{border-left-width:1px}.checkbox-button-group[data-v-b8aa6eac] .checkbox-button:first-child{border-top-left-radius:2px;border-bottom-left-radius:2px;border-left-width:1px}.checkbox-button-group[data-v-b8aa6eac] .checkbox-button:last-child{border-top-right-radius:2px;border-bottom-right-radius:2px;border-right-width:1px}.checkerboard[data-v-7494636c]{background-size:contain}.alpha-checkboard-wrap[data-v-246b525c],.alpha[data-v-246b525c],.checkerboard[data-v-7494636c]{position:absolute;top:0;right:0;bottom:0;left:0}.alpha-checkboard-wrap[data-v-246b525c]{overflow:hidden}.alpha-gradient[data-v-246b525c]{position:absolute;top:0;right:0;bottom:0;left:0}.alpha-container[data-v-246b525c]{cursor:pointer;position:relative;z-index:2;height:100%;margin:0 3px}.alpha-pointer[data-v-246b525c]{z-index:2;position:absolute}.alpha-picker[data-v-246b525c]{cursor:pointer;width:4px;height:8px;box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;margin-top:1px;transform:translateX(-2px)}.hue[data-v-60c3cca1]{background:linear-gradient(90deg,red 0,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red);position:absolute;top:0;right:0;bottom:0;left:0}.hue-container[data-v-60c3cca1]{cursor:pointer;margin:0 2px;position:relative;height:100%}.hue-pointer[data-v-60c3cca1]{z-index:2;position:absolute;top:0}.hue-picker[data-v-60c3cca1]{cursor:pointer;margin-top:1px;width:4px;height:8px;box-shadow:0 0 2px rgba(0,0,0,.6);background:#fff;transform:translateX(-2px)}.saturation-black[data-v-d230faf4],.saturation-white[data-v-d230faf4],.saturation[data-v-d230faf4]{position:absolute;top:0;right:0;bottom:0;left:0;cursor:pointer}.saturation-white[data-v-d230faf4]{background:linear-gradient(90deg,#fff,hsla(0,0%,100%,0))}.saturation-black[data-v-d230faf4]{background:linear-gradient(0deg,#000,transparent)}.saturation-pointer[data-v-d230faf4]{cursor:pointer;position:absolute}.saturation-circle[data-v-d230faf4]{width:4px;height:4px;box-shadow:0 0 0 1.5px #fff,inset 0 0 1px 1px rgba(0,0,0,.3),0 0 1px 2px rgba(0,0,0,.4);border-radius:50%;transform:translate(-2px,-2px)}.editable-input[data-v-2f428dde]{width:100%;position:relative;overflow:hidden;text-align:center;font-size:14px}.editable-input[data-v-2f428dde]:after{content:"#";position:absolute;left:0;top:50%;transform:translateY(-50%);color:#999}.input-content[data-v-2f428dde]{width:100%;padding:3px;border:0;border-bottom:1px solid #ddd;outline:none;text-align:center}.input-label[data-v-2f428dde]{text-transform:capitalize}.color-picker[data-v-c46eb110]{position:relative;width:240px;background:#fff;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;margin-bottom:-10px}.picker-saturation-wrap[data-v-c46eb110]{width:100%;padding-bottom:50%;position:relative;overflow:hidden}.picker-controls[data-v-c46eb110]{display:flex}.picker-sliders[data-v-c46eb110]{padding:4px 0;flex:1}.picker-hue-wrap[data-v-c46eb110]{position:relative;height:10px}.picker-alpha-wrap[data-v-c46eb110]{position:relative;height:10px;margin-top:4px;overflow:hidden}.picker-color-wrap[data-v-c46eb110]{width:24px;height:24px;position:relative;margin-top:4px;margin-right:4px;outline:1px dashed hsla(0,0%,40%,.12)}.picker-color-wrap .checkerboard[data-v-c46eb110]{background-size:auto}.picker-current-color[data-v-c46eb110]{position:absolute;top:0;right:0;bottom:0;left:0;z-index:2}.picker-field[data-v-c46eb110]{display:flex;margin-bottom:8px}.picker-field .straw[data-v-c46eb110]{width:24px;height:24px;margin-top:4px;margin-left:4px;display:flex;justify-content:flex-end;align-items:center;font-size:20px;cursor:pointer}.picker-field .input[data-v-c46eb110]{flex:1}.picker-presets[data-v-c46eb110]{display:flex;flex-wrap:wrap;align-content:flex-start}.picker-presets-color[data-v-c46eb110]{width:7%;margin-bottom:3.33333%;height:0;padding-bottom:7%;flex-shrink:0;position:relative;cursor:pointer}.picker-presets-color[data-v-c46eb110]:not(:nth-child(10n)){margin-right:3.33333%}.picker-presets-color.alpha[data-v-c46eb110]{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAAXNSR0IArs4c6QAAADBJREFUOE9jfPbs2X8GPEBSUhKfNAPjqAHDIgz+//+PNx08f/4cfzoYNYCBceiHAQC5flV5JzgrxQAAAABJRU5ErkJggg==)}.picker-presets-color-content[data-v-c46eb110]{position:absolute;top:0;right:0;bottom:0;left:0}.picker-gradient-presets[data-v-c46eb110]{display:flex;flex-wrap:wrap;align-content:flex-start}.picker-gradient-col[data-v-c46eb110]{width:7%;margin-bottom:3.33333%;display:flex;flex-direction:column}.picker-gradient-col[data-v-c46eb110]:not(:nth-child(10n)){margin-right:3.33333%}.picker-gradient-color[data-v-c46eb110]{width:100%;height:16px;position:relative;cursor:pointer}.recent-colors-title[data-v-c46eb110]{font-size:12px;margin-bottom:4px}.fullscreen-spin[data-v-16ead44e]{position:fixed;top:0;bottom:0;left:0;right:0;z-index:100;display:flex;justify-content:center;align-items:center;background-color:hsla(0,0%,94.5%,.7)}.menu-content[data-v-e470e712]{width:170px;padding:5px 0;background:#fff;border:1px solid #eee;box-shadow:3px 3px 3px rgba(0,0,0,.15);border-radius:2px;list-style:none;margin:0}.menu-item[data-v-e470e712]{padding:0 20px;color:#555;font-size:12px;transition:all .1s;white-space:nowrap;height:30px;line-height:30px;background-color:#fff;cursor:pointer}.menu-item:not(.disable):hover>.menu-item-content>.sub-menu[data-v-e470e712]{display:block}.menu-item:not(.disable):hover>.has-children.has-handler[data-v-e470e712]:after{transform:scale(1)}.menu-item[data-v-e470e712]:hover:not(.disable){background-color:rgba(209,68,36,.2)}.menu-item.divider[data-v-e470e712]{height:1px;overflow:hidden;margin:5px;background-color:#e5e5e5;line-height:0;padding:0}.menu-item.disable[data-v-e470e712]{color:#b1b1b1;cursor:no-drop}.menu-item-content[data-v-e470e712]{display:flex;align-items:center;justify-content:space-between;position:relative}.menu-item-content.has-children[data-v-e470e712]:before{content:"";display:inline-block;width:8px;height:8px;border-width:1px;border-style:solid;border-color:#666 #666 transparent transparent;position:absolute;right:0;top:50%;transform:translateY(-50%) rotate(45deg)}.menu-item-content.has-children.has-handler[data-v-e470e712]:after{content:"";display:inline-block;width:1px;height:24px;background-color:#f1f1f1;position:absolute;right:18px;top:3px;transform:scale(0);transition:transform .2s}.menu-item-content .sub-text[data-v-e470e712]{opacity:.6}.menu-item-content .sub-menu[data-v-e470e712]{width:120px;position:absolute;display:none;left:112%;top:-6px}.mask{position:fixed;left:0;top:0;width:100vw;height:100vh;z-index:9998}.contextmenu{position:fixed;z-index:9999;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none} \ No newline at end of file diff --git a/index.html b/index.html index edd48f10..46807e86 100644 --- a/index.html +++ b/index.html @@ -30,4 +30,4 @@ 100% { transform: rotate(360deg); } - }
正在加载中,请稍等 ...
\ No newline at end of file + }
正在加载中,请稍等 ...
\ No newline at end of file diff --git a/js/app.4b1981c0.js b/js/app.4b1981c0.js deleted file mode 100644 index c773b2a9..00000000 --- a/js/app.4b1981c0.js +++ /dev/null @@ -1,2 +0,0 @@ -(function(e){function t(t){for(var c,l,r=t[0],i=t[1],u=t[2],s=0,f=[];sb){var p=e.nodeAt(o),m=p&&p.marks.find(a);if(!m||m!==l)break;s=o,r=p,o--}o=n+1,b=e.nodeSize-2;while(o-1||t.type===e},F=function(e,t){for(var n=e.depth;n>0;n--){var c=e.node(n);if(t(c))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:c}}},A=function(e){return function(t){return F(t.$from,e)}},R=function(e){return function(t){return A((function(t){return z(e,t)}))(t)}},P=function(e,t){var n=t.schema.nodes[e];return!!R(n)(t.selection)},H=function(e){var t,n,c=e.state,o=c.selection,a=c.doc,l=o.from,r=a.nodeAt(l)||a.nodeAt(l-1);return null!==(t=r)&&void 0!==t&&t.lastChild&&(r=r.lastChild),(null===(n=r)||void 0===n?void 0:n.marks)||[]},q=function(e,t,n){var c,o=Object(L["a"])(e);try{for(o.s();!(c=o.n()).done;){var a=c.value;if(a.type.name===t&&a.attrs[n])return a.attrs[n]}}catch(l){o.e(l)}finally{o.f()}return null},U=function(e,t){var n,c=Object(L["a"])(e);try{for(c.s();!(n=c.n()).done;){var o=n.value;if(o.type.name===t)return!0}}catch(a){c.e(a)}finally{c.f()}return!1},G=function(e,t){var n=e.selection,c=n.from,o=n.$from,a=n.to,l=n.empty;return l?t.isInSet(e.storedMarks||o.marks()):e.doc.rangeHasMark(c,a,t)},X=function(e,t){var n=e.state,c=n.selection,o=n.doc,a=c.from,l=c.to,r=!0,i="";return o.nodesBetween(a,l,(function(e){return r&&e.attrs[t]&&(r=!1,i=e.attrs[t]),r})),i},Y={color:"#000",backcolor:"#000",fontsize:"20px",fontname:"微软雅黑",align:"left"},Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Object(S["a"])(Object(S["a"])({},Y),t);var n=H(e),c=U(n,"strong"),o=U(n,"em"),a=U(n,"underline"),l=U(n,"strikethrough"),r=U(n,"superscript"),i=U(n,"subscript"),u=U(n,"code"),d=q(n,"forecolor","color")||t.color,s=q(n,"backcolor","backcolor")||t.backcolor,f=q(n,"fontsize","fontsize")||t.fontsize,b=q(n,"fontname","fontname")||t.fontname,p=q(n,"link","href")||"",m=X(e,"align")||t.align,O=P("bullet_list",e.state),v=P("ordered_list",e.state),j=P("blockquote",e.state);return{bold:c,em:o,underline:a,strikethrough:l,superscript:r,subscript:i,code:u,color:d,backcolor:s,fontsize:f,fontname:b,link:p,align:m,bulletList:O,orderedList:v,blockquote:j}},W=function(e){var t=H(e),n=q(t,"fontsize","fontsize")||Y.fontsize;return parseInt(n)},J={bold:!1,em:!1,underline:!1,strikethrough:!1,superscript:!1,subscript:!1,code:!1,color:"#000",backcolor:"#000",fontsize:"20px",fontname:"微软雅黑",link:"",align:"left",bulletList:!1,orderedList:!1,blockquote:!1},K=(n("99af"),n("fb6a"),n("a15b"),function(e){if("string"!==typeof e)return!1;var t="Arial";if(e.toLowerCase()===t.toLowerCase())return!0;var n=100,c=100,o=100,a="a",l=document.createElement("canvas"),r=l.getContext("2d");if(!r)return!1;l.width=c,l.height=o,r.textAlign="center",r.fillStyle="black",r.textBaseline="middle";var i=function(e){r.clearRect(0,0,c,o),r.font="".concat(n,"px ").concat(e,", ").concat(t),r.fillText(a,c/2,o/2);var l=r.getImageData(0,0,c,o).data;return[].slice.call(l).filter((function(e){return 0!==e}))};return i(t).join("")!==i(e).join("")}),Q=n("2909"),$=(n("d81d"),n("ac1f"),n("5319"),n("5b81"),n("a434"),n("c740"),n("66cb")),ee=n.n($),te=n("2ef0"),ne=[{id:"test-slide-1",elements:[{type:"shape",id:"4cbRxp",left:0,top:200,width:546,height:362.5,viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z",fill:"#5b9bd5",fixedRatio:!1,opacity:.7,rotate:0},{type:"shape",id:"ookHrf",left:0,top:0,width:300,height:320,viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z",fill:"#5b9bd5",fixedRatio:!1,flipV:!0,rotate:0},{type:"text",id:"idn7Mx",left:355,top:65.25,width:585,height:188,lineHeight:1.2,content:"

PPTIST

",rotate:0,defaultFontName:"Microsoft Yahei",defaultColor:"#333"},{type:"text",id:"7stmVP",left:355,top:253.25,width:585,height:56,content:"

基于 Vue 3.x + TypeScript 的在线演示文稿应用

",rotate:0,defaultFontName:"Microsoft Yahei",defaultColor:"#333"},{type:"line",id:"FnpZs4",left:361,top:238,start:[0,0],end:[549,0],points:["",""],color:"#5b9bd5",style:"solid",width:2}],background:{type:"solid",color:"#ffffff"}},{id:"test-slide-2",elements:[{type:"text",id:"ptNnUJ",left:145,top:148,width:711,height:77,lineHeight:1.2,content:"

在此处添加标题

",rotate:0,defaultFontName:"Microsoft Yahei",defaultColor:"#333"},{type:"text",id:"mRHvQN",left:207.50000000000003,top:249.84259259259264,width:585,height:56,content:"

在此处添加副标题

",rotate:0,defaultFontName:"Microsoft Yahei",defaultColor:"#333"},{type:"line",id:"7CQDwc",left:323.09259259259267,top:238.33333333333334,start:[0,0],end:[354.8148148148148,0],points:["",""],color:"#5b9bd5",style:"solid",width:4},{type:"shape",id:"09wqWw",left:-27.648148148148138,top:432.73148148148147,width:1056.2962962962963,height:162.96296296296296,viewBox:[200,200],path:"M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z",fill:"#5b9bd5",fixedRatio:!1,rotate:0}],background:{type:"solid",color:"#fff"}},{id:"test-slide-3",elements:[{type:"shape",id:"vSheCJ",left:183.5185185185185,top:175.5092592592593,width:605.1851851851851,height:185.18518518518516,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:"#5b9bd5",fixedRatio:!1,rotate:0},{type:"shape",id:"Mpwv7x",left:211.29629629629628,top:201.80555555555557,width:605.1851851851851,height:185.18518518518516,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:"#5b9bd5",fixedRatio:!1,rotate:0,opacity:.7},{type:"text",id:"WQOTAp",left:304.9074074074074,top:198.10185185185182,width:417.9629629629629,height:140,content:"

感谢观看

",rotate:0,defaultFontName:"Microsoft Yahei",defaultColor:"#333",wordSpace:5}],background:{type:"solid",color:"#fff"}}],ce={themeColor:"#5b9bd5",fontColor:"#333",fontName:"Microsoft Yahei",backgroundColor:"#fff"},oe=[{id:"template",elements:[{type:"shape",id:"4cbRxp",left:0,top:200,width:546,height:362.5,viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z",fill:"{{themeColor}}",fixedRatio:!1,opacity:.7,rotate:0},{type:"shape",id:"ookHrf",left:0,top:0,width:300,height:320,viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z",fill:"{{themeColor}}",fixedRatio:!1,flipV:!0,rotate:0},{type:"text",id:"AkIh3E",left:355,top:95.11111111111111,width:585,height:116,lineHeight:1.2,content:"

输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",wordSpace:6},{type:"text",id:"7stmVP",left:355,top:253.25,width:585,height:56,content:"

请在此处输入副标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"line",id:"FnpZs4",left:361,top:238,start:[0,0],end:[549,0],points:["",""],color:"{{themeColor}}",style:"solid",width:2}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"text",id:"ptNnUJ",left:145,top:148,width:711,height:77,lineHeight:1.2,content:"

在此处添加标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"text",id:"mRHvQN",left:207.50000000000003,top:249.84259259259264,width:585,height:56,content:"

在此处添加副标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"line",id:"7CQDwc",left:323.09259259259267,top:238.33333333333334,start:[0,0],end:[354.8148148148148,0],points:["",""],color:"{{themeColor}}",style:"solid",width:4},{type:"shape",id:"09wqWw",left:-27.648148148148138,top:432.73148148148147,width:1056.2962962962963,height:162.96296296296296,viewBox:[200,200],path:"M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"shape",id:"vSheCJ",left:183.5185185185185,top:175.5092592592593,width:605.1851851851851,height:185.18518518518516,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0},{type:"shape",id:"Mpwv7x",left:211.29629629629628,top:201.80555555555557,width:605.1851851851851,height:185.18518518518516,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,opacity:.7},{type:"text",id:"WQOTAp",left:304.9074074074074,top:198.10185185185182,width:417.9629629629629,height:140,content:"

感谢观看

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",wordSpace:5}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"MZVO1kkj",elements:[{type:"shape",id:"cql0h8",left:0,top:0,width:352.59259259259255,height:562.5,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0},{type:"shape",id:"_RTaF4",left:171.4814814814814,top:100.13888888888887,width:362.22222222222223,height:362.22222222222223,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"rgba(255,255,255,0)",fixedRatio:!1,rotate:0,outline:{width:10,color:"{{backgroundColor}}",style:"solid"}},{type:"shape",id:"UZfo8N",left:216.66666666666663,top:145.32407407407408,width:271.85185185185185,height:271.85185185185185,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{backgroundColor}}",fixedRatio:!1,rotate:0,text:{content:"

01

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"ysqtBg",left:561.4814814814814,top:100.1388888888889,width:359.25925925925924,height:80,content:"

在此处输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"text",id:"lXsoHa",left:572.5925925925925,top:202.3611111111111,width:257.77777777777777,height:260,content:"
  1. 在此处输入内容

  2. 在此处输入内容

  3. 在此处输入内容

  4. 在此处输入内容

  5. 在此处输入内容

  6. 在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",lineHeight:2,fill:"{{subColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"shape",id:"EBBnTr",left:360.5996472663139,top:141.8496472663139,width:278.80070546737215,height:278.80070546737215,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!0,rotate:0,outline:{width:0,color:"{{backgroundColor}}",style:"solid"}},{type:"shape",id:"gDIWDH",left:456.4373897707231,top:98.287037037037,width:87.12522045855381,height:87.12522045855381,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!0,rotate:0,outline:{width:4,color:"{{backgroundColor}}",style:"solid"},text:{content:"

1

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"shape",id:"DUWT7E",left:317.037037037037,top:237.68738977072314,width:87.12522045855381,height:87.12522045855381,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!0,rotate:0,outline:{width:4,color:"{{backgroundColor}}",style:"solid"},text:{content:"

4

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"shape",id:"pbhn38",left:456.43738977072303,top:377.08774250440916,width:87.12522045855381,height:87.12522045855381,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!0,rotate:0,outline:{width:4,color:"{{backgroundColor}}",style:"solid"},text:{content:"

3

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"shape",id:"CvMKrO",left:595.8377425044091,top:237.6873897707231,width:87.12522045855381,height:87.12522045855381,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!0,rotate:0,outline:{width:4,color:"{{backgroundColor}}",style:"solid"},text:{content:"

2

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"adudHB",left:402.962962962963,top:39.39814814814815,width:194.07407407407408,height:50,content:"

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"text",id:"9UpDwg",left:402.962962962963,top:473.1018518518518,width:194.07407407407408,height:50,content:"

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"text",id:"GERdpB",left:111.48148148148151,top:256.25,width:194.07407407407408,height:50,content:"

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"text",id:"G5qoho",left:691.1111111111111,top:256.25,width:194.07407407407408,height:50,content:"

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"shape",id:"vdZcI6",left:415.18518518518516,top:196.4351851851852,width:169.62962962962962,height:169.62962962962962,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{backgroundColor}}",fixedRatio:!1,rotate:0}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"shape",id:"tYUmrx",left:156.66666666666683,top:149.02777777777771,width:264.4444444444445,height:264.4444444444445,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

01

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"shape",id:"0GVHf8",left:342.2222222222223,top:217.17592592592587,width:128.14814814814812,height:128.14814814814812,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{backgroundColor}}",fixedRatio:!1,rotate:0},{type:"text",id:"BO33Sv",left:378.8888888888889,top:235.24999999999994,width:464.4444444444444,height:92,content:"

在此处添加标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"text",id:"Hj7ttp",left:69.35185185185185,top:49.21759259259262,width:420,height:63,lineHeight:1.2,content:"

1.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"FmKMNB",left:69.35185185185185,top:129.28240740740745,width:420,height:384,content:"

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"rI7ZeO",left:510.64814814814815,top:49.21759259259262,width:420,height:63,lineHeight:1.2,content:"

2.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"KspwGc",left:510.64814814814815,top:129.28240740740745,width:420,height:384,content:"

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"text",id:"Rx63Jo",left:69.35185185185179,top:51.71759259259262,width:420,height:58,lineHeight:1.2,content:"

1.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"ulyuzE",left:69.35185185185179,top:131.78240740740745,width:420,height:129,content:"

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"kr35Ca",left:510.6481481481481,top:51.71759259259262,width:420,height:58,lineHeight:1.2,content:"

2.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"BNQSpC",left:510.6481481481481,top:131.78240740740745,width:420,height:129,content:"

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"Vr38Nu",left:69.35185185185185,top:301.71759259259255,width:420,height:58,lineHeight:1.2,content:"

3.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"IwKRSu",left:69.35185185185185,top:381.7824074074074,width:420,height:129,content:"

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"0Opr1v",left:510.64814814814815,top:301.71759259259255,width:420,height:58,lineHeight:1.2,content:"

4.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"4L9Uzz",left:510.64814814814815,top:381.7824074074074,width:420,height:129,content:"

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"text",id:"GdEGxg",left:134.53703703703704,top:127.25,width:152.77777777777777,height:308,lineHeight:1.8,content:"

请在此处输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",wordSpace:8,fill:"{{themeColor}}"},{type:"text",id:"y5sAfw",left:332.8703703703704,top:127.25,width:532.5925925925926,height:50,content:"

请在此处输入内容1

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"VeuocM",left:332.8703703703704,top:212.0648148148148,width:532.5925925925926,height:50,content:"

请在此处输入内容2

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"RyFWQe",left:332.8703703703704,top:296.8796296296296,width:532.5925925925926,height:50,content:"

请在此处输入内容3

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"Q56viI",left:332.8703703703704,top:381.69444444444446,width:532.5925925925926,height:50,content:"

请在此处输入内容4

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"shape",id:"SUWirT",left:73.8888888888889,top:64.21296296296302,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

1

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"YjzN1M",left:148.70370370370372,top:64.21296296296302,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"shape",id:"fS09I7",left:527.5925925925926,top:64.21296296296302,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

2

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"qCnfB1",left:602.4074074074074,top:64.21296296296302,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"shape",id:"difAAT",left:73.8888888888889,top:221.25000000000003,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

3

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"EUlvMo",left:148.70370370370372,top:221.25000000000003,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"shape",id:"US_9jB",left:527.5925925925926,top:221.25000000000003,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

4

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"243MnQ",left:602.4074074074074,top:221.25000000000003,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"shape",id:"Y_KUj0",left:73.8888888888889,top:378.287037037037,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

5

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"9GglMe",left:148.70370370370372,top:378.287037037037,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"shape",id:"eSInje",left:527.5925925925926,top:378.287037037037,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

6

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"0S3yUg",left:602.4074074074074,top:378.287037037037,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}}],ae=Object(g["b"])("slides",{state:function(){return{theme:ce,slides:ne,slideIndex:0,viewportRatio:.5625}},getters:{currentSlide:function(e){return e.slides[e.slideIndex]},currentSlideAnimations:function(e){var t=e.slides[e.slideIndex];if(null===t||void 0===t||!t.animations)return[];var n=t.elements,c=n.map((function(e){return e.id}));return t.animations.filter((function(e){return c.includes(e.elId)}))},formatedAnimations:function(e){var t=e.slides[e.slideIndex];if(null===t||void 0===t||!t.animations)return[];var n,c=t.elements,o=c.map((function(e){return e.id})),a=t.animations.filter((function(e){return o.includes(e.elId)})),l=[],r=Object(L["a"])(a);try{var i=function(){var e=n.value;if("click"!==e.trigger&&l.length){if("meantime"===e.trigger){var t=l[l.length-1];t.animations=t.animations.filter((function(t){return t.elId!==e.elId})),t.animations.push(e),l[l.length-1]=t}else if("auto"===e.trigger){var c=l[l.length-1];c.autoNext=!0,l[l.length-1]=c,l.push({animations:[e],autoNext:!1})}}else l.push({animations:[e],autoNext:!1})};for(r.s();!(n=r.n()).done;)i()}catch(u){r.e(u)}finally{r.f()}return l},layouts:function(e){var t=e.theme,n=t.themeColor,c=t.fontColor,o=t.fontName,a=t.backgroundColor,l=ee()(c).isDark()?"rgba(230, 230, 230, 0.5)":"rgba(180, 180, 180, 0.5)",r=JSON.stringify(oe).replaceAll("{{themeColor}}",n).replaceAll("{{fontColor}}",c).replaceAll("{{fontName}}",o).replaceAll("{{backgroundColor}}",a).replaceAll("{{subColor}}",l);return JSON.parse(r)}},actions:{setTheme:function(e){this.theme=Object(S["a"])(Object(S["a"])({},this.theme),e)},setViewportRatio:function(e){this.viewportRatio=e},setSlides:function(e){this.slides=e},addSlide:function(e){var t,n=Array.isArray(e)?e:[e],c=this.slideIndex+1;(t=this.slides).splice.apply(t,[c,0].concat(Object(Q["a"])(n))),this.slideIndex=c},updateSlide:function(e){var t=this.slideIndex;this.slides[t]=Object(S["a"])(Object(S["a"])({},this.slides[t]),e)},deleteSlide:function(e){for(var t=this,n=Array.isArray(e)?e:[e],c=[],o=function(e){var o=t.slides.findIndex((function(t){return t.id===n[e]}));c.push(o)},a=0;ar&&(l=r),this.slideIndex=l,this.slides=this.slides.filter((function(e){return!n.includes(e.id)}))},updateSlideIndex:function(e){this.slideIndex=e},addElement:function(e){var t=Array.isArray(e)?e:[e],n=this.slides[this.slideIndex].elements,c=[].concat(Object(Q["a"])(n),Object(Q["a"])(t));this.slides[this.slideIndex].elements=c},deleteElement:function(e){var t=Array.isArray(e)?e:[e],n=this.slides[this.slideIndex].elements,c=n.filter((function(e){return!t.includes(e.id)}));this.slides[this.slideIndex].elements=c},updateElement:function(e){var t=e.id,n=e.props,c="string"===typeof t?[t]:t,o=this.slideIndex,a=this.slides[o],l=a.elements.map((function(e){return c.includes(e.id)?Object(S["a"])(Object(S["a"])({},e),n):e}));this.slides[o].elements=l},removeElementProps:function(e){var t=e.id,n=e.propName,c="string"===typeof n?[n]:n,o=this.slideIndex,a=this.slides[o],l=a.elements.map((function(e){return e.id===t?Object(te["omit"])(e,c):e}));this.slides[o].elements=l}}}),le=Object(x["a"])("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"),re=le(10),ie=Object(g["b"])("main",{state:function(){return{activeElementIdList:[],handleElementId:"",activeGroupElementId:"",canvasPercentage:90,canvasScale:1,canvasDragged:!1,thumbnailsFocus:!1,editorAreaFocus:!1,disableHotkeys:!1,showGridLines:!1,showRuler:!1,creatingElement:null,availableFonts:I,toolbarState:c.SLIDE_DESIGN,clipingImageElementId:"",richTextAttrs:J,selectedTableCells:[],isScaling:!1,selectedSlidesIndex:[],dialogForExport:"",databaseId:re}},getters:{activeElementList:function(e){var t=ae(),n=t.currentSlide;return n&&n.elements?n.elements.filter((function(t){return e.activeElementIdList.includes(t.id)})):[]},handleElement:function(e){var t=ae(),n=t.currentSlide;return n&&n.elements&&n.elements.find((function(t){return e.handleElementId===t.id}))||null}},actions:{setActiveElementIdList:function(e){1===e.length?this.handleElementId=e[0]:this.handleElementId="",this.activeElementIdList=e},setHandleElementId:function(e){this.handleElementId=e},setActiveGroupElementId:function(e){this.activeGroupElementId=e},setCanvasPercentage:function(e){this.canvasPercentage=e},setCanvasScale:function(e){this.canvasScale=e},setCanvasDragged:function(e){this.canvasDragged=e},setThumbnailsFocus:function(e){this.thumbnailsFocus=e},setEditorareaFocus:function(e){this.editorAreaFocus=e},setDisableHotkeysState:function(e){this.disableHotkeys=e},setGridLinesState:function(e){this.showGridLines=e},setRulerState:function(e){this.showRuler=e},setCreatingElement:function(e){this.creatingElement=e},setAvailableFonts:function(){this.availableFonts=I.filter((function(e){return K(e.value)}))},setToolbarState:function(e){this.toolbarState=e},setClipingImageElementId:function(e){this.clipingImageElementId=e},setRichtextAttrs:function(e){this.richTextAttrs=e},setSelectedTableCells:function(e){this.selectedTableCells=e},setScalingState:function(e){this.isScaling=e},updateSelectedSlidesIndex:function(e){this.selectedSlidesIndex=e},setDialogForExport:function(e){this.dialogForExport=e}}}),ue=n("1da1"),de=(n("ddb0"),n("96cf"),n("d4ec")),se=n("257e"),fe=n("262e"),be=n("2caf"),pe=n("ade3"),me=n("3835"),Oe=(n("1276"),n("4dec")),ve="PPTIST_DISCARDED_DB",je="PPTist",he=function(){var e=Object(ue["a"])(regeneratorRuntime.mark((function e(){var t,n,c,o,a,l,r,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=(new Date).getTime(),n=localStorage.getItem(ve),c=n?JSON.parse(n):[],e.next=5,Oe["a"].getDatabaseNames();case 5:o=e.sent,a=o.filter((function(e){if(-1===e.indexOf(je))return!1;var n=e.split("_"),o=Object(me["a"])(n,3),a=o[0],l=o[1],r=o[2];return a!==je||!l||!r||(!!c.includes(l)||t-+r>=432e5)})),l=Object(L["a"])(a);try{for(l.s();!(r=l.n()).done;)i=r.value,Oe["a"].delete(i)}catch(u){l.e(u)}finally{l.f()}localStorage.removeItem(ve);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ye=function(e){Object(fe["a"])(n,e);var t=Object(be["a"])(n);function n(){var e;return Object(de["a"])(this,n),e=t.call(this,"".concat(je,"_").concat(re,"_").concat((new Date).getTime())),Object(pe["a"])(Object(se["a"])(e),"snapshots",void 0),e.version(1).stores({snapshots:"++id"}),e.snapshots=e.table("snapshots"),e}return n}(Oe["a"]),ge=new ye,xe=Object(g["b"])("snapshot",{state:function(){return{snapshotCursor:-1,snapshotLength:0}},getters:{canUndo:function(e){return e.snapshotCursor>0},canRedo:function(e){return e.snapshotCursor=0&&e.snapshotCursorr&&(o.push(c[0]),l--),l>=2&&ge.snapshots.update(c[l-2],{index:n.slideIndex}),t.next=15,ge.snapshots.bulkDelete(o);case 15:e.setSnapshotCursor(l-1),e.setSnapshotLength(l);case 17:case"end":return t.stop()}}),t)})))()},unDo:function(){var e=this;return Object(ue["a"])(regeneratorRuntime.mark((function t(){var n,c,o,a,l,r,i,u;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!(e.snapshotCursor<=0)){t.next=2;break}return t.abrupt("return");case 2:return n=ae(),c=ie(),o=e.snapshotCursor-1,t.next=7,ge.snapshots.orderBy("id").toArray();case 7:a=t.sent,l=a[o],r=l.index,i=l.slides,u=r>i.length-1?i.length-1:r,n.setSlides(i),n.updateSlideIndex(u),e.setSnapshotCursor(o),c.setActiveElementIdList([]);case 15:case"end":return t.stop()}}),t)})))()},reDo:function(){var e=this;return Object(ue["a"])(regeneratorRuntime.mark((function t(){var n,c,o,a,l,r,i,u;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!(e.snapshotCursor>=e.snapshotLength-1)){t.next=2;break}return t.abrupt("return");case 2:return n=ae(),c=ie(),o=e.snapshotCursor+1,t.next=7,ge.snapshots.orderBy("id").toArray();case 7:a=t.sent,l=a[o],r=l.index,i=l.slides,u=r>i.length-1?i.length-1:r,n.setSlides(i),n.updateSlideIndex(u),e.setSnapshotCursor(o),c.setActiveElementIdList([]);case 15:case"end":return t.stop()}}),t)})))()}}}),ke=Object(g["b"])("keyboard",{state:function(){return{ctrlKeyState:!1,shiftKeyState:!1,spaceKeyState:!1}},getters:{ctrlOrShiftKeyActive:function(e){return e.ctrlKeyState||e.shiftKeyState}},actions:{setCtrlKeyState:function(e){this.ctrlKeyState=e},setShiftKeyState:function(e){this.shiftKeyState=e},setSpaceKeyState:function(e){this.spaceKeyState=e}}}),Ce=Object(g["b"])("screen",{state:function(){return{screening:!1}},actions:{setScreening:function(e){this.screening=e}}}),Ne=(n("466d"),function(e,t){return Object(te["padStart"])(""+e,t,"0")}),Ee=function(){return!navigator.userAgent.match(/(iPhone|iPod|iPad|Android|Mobile|BlackBerry|Symbian|Windows Phone)/i)};(function(e){e["UP"]="up",e["DOWN"]="down",e["TOP"]="top",e["BOTTOM"]="bottom"})(k||(k={})),function(e){e["TOP"]="top",e["BOTTOM"]="bottom",e["LEFT"]="left",e["RIGHT"]="right",e["VERTICAL"]="vertical",e["HORIZONTAL"]="horizontal",e["CENTER"]="center"}(C||(C={})),function(e){e["T"]="top",e["B"]="bottom",e["L"]="left",e["R"]="right"}(N||(N={})),function(e){e["LEFT_TOP"]="left-top",e["TOP"]="top",e["RIGHT_TOP"]="right-top",e["LEFT"]="left",e["RIGHT"]="right",e["LEFT_BOTTOM"]="left-bottom",e["BOTTOM"]="bottom",e["RIGHT_BOTTOM"]="right-bottom"}(E||(E={})),function(e){e["START"]="start",e["END"]="end",e["C"]="ctrl",e["C1"]="ctrl1",e["C2"]="ctrl2"}(w||(w={})),function(e){e["C"]="C",e["X"]="X",e["Z"]="Z",e["Y"]="Y",e["A"]="A",e["G"]="G",e["L"]="L",e["F"]="F",e["D"]="D",e["B"]="B",e["P"]="P",e["MINUS"]="-",e["EQUAL"]="=",e["DIGIT_0"]="0",e["DELETE"]="DELETE",e["UP"]="ARROWUP",e["DOWN"]="ARROWDOWN",e["LEFT"]="ARROWLEFT",e["RIGHT"]="ARROWRIGHT",e["ENTER"]="ENTER",e["SPACE"]=" ",e["TAB"]="TAB",e["BACKSPACE"]="BACKSPACE",e["ESC"]="ESCAPE",e["PAGEUP"]="PAGEUP",e["PAGEDOWN"]="PAGEDOWN",e["F5"]="F5"}(V||(V={}));var we,Ve,Ie,Be=[{type:"通用",children:[{label:"剪切",value:"Ctrl + X"},{label:"复制",value:"Ctrl + C"},{label:"粘贴",value:"Ctrl + V"},{label:"快速复制粘贴",value:"Ctrl + D"},{label:"全选",value:"Ctrl + A"},{label:"撤销",value:"Ctrl + Z"},{label:"恢复",value:"Ctrl + Y"},{label:"删除",value:"Delete / Backspace"},{label:"多选",value:"按住 Ctrl 或 Shift"},{label:"打印",value:"Ctrl + P"},{label:"关闭弹窗",value:"ESC"}]},{type:"幻灯片放映",children:[{label:"从头开始放映幻灯片",value:"F5"},{label:"从当前开始放映幻灯片",value:"Shift + F5"},{label:"切换上一页",value:"↑ / ← / PgUp"},{label:"切换下一页",value:"↓ / → / PgDown"},{label:"切换下一页",value:"Enter / Space"},{label:"退出放映",value:"ESC"},{label:"调整画笔笔触大小",value:"鼠标滚轮"}]},{type:"幻灯片编辑",children:[{label:"新建幻灯片",value:"Enter"},{label:"移动画布",value:"Space + 鼠标拖拽"},{label:"缩放画布",value:"Ctrl + 鼠标滚轮"},{label:"放大画布",value:"Ctrl + ="},{label:"缩小画布",value:"Ctrl + -"},{label:"使画布适应当前屏幕",value:"Ctrl + 0"},{label:"上一页(未选中元素)",value:"↑ / ←"},{label:"下一页(未选中元素)",value:"↓ / →"},{label:"上一页",value:"鼠标上滚 / PgUp"},{label:"下一页",value:"鼠标下滚 / PgDown"}]},{type:"元素操作",children:[{label:"移动",value:"↑ / ← / ↓ / →"},{label:"锁定",value:"Ctrl + L"},{label:"组合",value:"Ctrl + G"},{label:"取消组合",value:"Ctrl + Shift + G"},{label:"置顶层",value:"Alt + F"},{label:"置底层",value:"Alt + B"},{label:"锁定宽高比例",value:"按住 Ctrl 或 Shift"},{label:"创建水平 / 垂直线条",value:"按住 Ctrl 或 Shift"},{label:"切换焦点元素",value:"Tab"},{label:"确认图片裁剪",value:"Enter"}]},{type:"表格编辑",children:[{label:"聚焦到下一个单元格",value:"Tab"},{label:"在上方插入一行",value:"Ctrl + ↑"},{label:"在下方插入一行",value:"Ctrl + ↓"},{label:"在左侧插入一列",value:"Ctrl + ←"},{label:"在右侧插入一列",value:"Ctrl + →"}]},{type:"图表数据编辑",children:[{label:"聚焦到下一行",value:"Enter"}]},{type:"文本编辑",children:[{label:"加粗",value:"Ctrl + B"},{label:"斜体",value:"Ctrl + I"},{label:"下划线",value:"Ctrl + U"},{label:"删除线",value:"Ctrl + D"}]}],Se=(n("3b18"),n("f64c")),Le=(n("a630"),n("3ca3"),n("b311")),_e=n.n(Le),Te=(n("25f0"),n("3452")),Me=n.n(Te),De="pptist",ze=function(e){return Me.a.AES.encrypt(e,De).toString()},Fe=function(e){var t=Me.a.AES.decrypt(e,De);return t.toString(Me.a.enc.Utf8)},Ae=function(e){return new Promise((function(t,n){var c=document.createElement("button"),o=new _e.a(c,{text:function(){return e},action:function(){return"copy"},container:document.body});o.on("success",(function(e){o.destroy(),t(e)})),o.on("error",(function(e){o.destroy(),n(e)})),document.body.appendChild(c),c.click(),document.body.removeChild(c)}))},Re=function(){return new Promise((function(e,t){var n;null!==(n=navigator.clipboard)&&void 0!==n&&n.readText?navigator.clipboard.readText().then((function(n){return n||t("剪贴板为空或者不包含文本"),e(n)})):t("浏览器不支持或禁止访问剪贴板,请使用快捷键 Ctrl + V")}))},Pe=function(e){var t;try{t=JSON.parse(Fe(e))}catch(n){t=e}return t},He=function(e){var t=e.split("\r\n");""===t[t.length-1]&&t.pop();var n=-1,c=[];for(var o in t){if(c[o]=t[o].split("\t"),1===c[o].length)return null;if(-1===n)n=c[o].length;else if(n!==c[o].length)return null}return c},qe=(n("159b"),function(e){var t=e.left,n=e.top,c=e.width,o=e.height,a=e.rotate,l=void 0===a?0:a,r=Math.sqrt(Math.pow(c,2)+Math.pow(o,2))/2,i=180*Math.atan(o/c)/Math.PI,u=(180-l-i)*Math.PI/180,d=(i-l)*Math.PI/180,s=t+c/2,f=n+o/2,b=[s+r*Math.cos(u),s+r*Math.cos(d),s-r*Math.cos(u),s-r*Math.cos(d)],p=[f-r*Math.sin(u),f-r*Math.sin(d),f+r*Math.sin(u),f+r*Math.sin(d)];return{xRange:[Math.min.apply(Math,b),Math.max.apply(Math,b)],yRange:[Math.min.apply(Math,p),Math.max.apply(Math,p)]}}),Ue=function(e){var t=qe({left:e.left,top:e.top,width:e.width,height:e.height,rotate:0}),n=t.xRange,c=t.yRange,o=qe({left:e.left,top:e.top,width:e.width,height:e.height,rotate:e.rotate}),a=o.xRange,l=o.yRange;return{offsetX:a[0]-n[0],offsetY:l[0]-c[0]}},Ge=function(e){var t,n,c,o;if("line"===e.type)t=e.left,n=e.left+Math.max(e.start[0],e.end[0]),c=e.top,o=e.top+Math.max(e.start[1],e.end[1]);else if("rotate"in e&&e.rotate){var a=e.left,l=e.top,r=e.width,i=e.height,u=e.rotate,d=qe({left:a,top:l,width:r,height:i,rotate:u}),s=d.xRange,f=d.yRange;t=s[0],n=s[1],c=f[0],o=f[1]}else t=e.left,n=e.left+e.width,c=e.top,o=e.top+e.height;return{minX:t,maxX:n,minY:c,maxY:o}},Xe=function(e){var t=[],n=[],c=[],o=[];e.forEach((function(e){var a=Ge(e),l=a.minX,r=a.maxX,i=a.minY,u=a.maxY;t.push(l),n.push(i),c.push(r),o.push(u)}));var a=Math.min.apply(Math,t),l=Math.max.apply(Math,c),r=Math.min.apply(Math,n),i=Math.max.apply(Math,o);return{minX:a,maxX:l,minY:r,maxY:i}},Ye=function(e){var t=[];return e.forEach((function(e){var n=t.findIndex((function(t){return t.value===e.value}));if(-1===n)t.push(e);else{var c=t[n],o=Math.min(c.range[0],e.range[0]),a=Math.max(c.range[1],e.range[1]),l=[o,a],r={value:e.value,range:l};t[n]=r}})),t},Ze=function(e){var t,n={},c={},o=Object(L["a"])(e);try{for(o.s();!(t=o.n()).done;){var a=t.value,l=a.groupId;l&&!n[l]&&(n[l]=Object(x["b"])(10)),c[a.id]=Object(x["b"])(10)}}catch(r){o.e(r)}finally{o.f()}return{groupIdMap:n,elIdMap:c}},We=function(e){var t=ee()(e);return[t.setAlpha(.3).toRgbString(),t.setAlpha(.1).toRgbString()]},Je=function(e){var t=e.start.join(","),n=e.end.join(",");if(e.broken){var c=e.broken.join(",");return"M".concat(t," L").concat(c," L").concat(n)}if(e.curve){var o=e.curve.join(",");return"M".concat(t," Q").concat(o," ").concat(n)}if(e.cubic){var a=Object(me["a"])(e.cubic,2),l=a[0],r=a[1],i=l.join(","),u=r.join(",");return"M".concat(t," C").concat(i," ").concat(u," ").concat(n)}return"M".concat(t," L").concat(n)},Ke=n("53ca"),Qe=function(e){var t,n=e.replace(/[\n\r]+/g,"
"),c=n.split("
"),o="",a=Object(L["a"])(c);try{for(a.s();!(t=a.n()).done;){var l=t.value;l&&(o+="
".concat(l,"
"))}}catch(r){a.e(r)}finally{a.f()}return o},$e=(n("cb29"),function(e){return new Promise((function(t){var n=document.createElement("img");n.src=e,n.style.opacity="0",document.body.appendChild(n),n.onload=function(){var e=n.clientWidth,c=n.clientHeight;n.onload=null,n.onerror=null,document.body.removeChild(n),t({width:e,height:c})},n.onerror=function(){n.onload=null,n.onerror=null}}))}),et=function(e){return new Promise((function(t){var n=new FileReader;n.addEventListener("load",(function(){t(n.result)})),n.readAsDataURL(e)}))},tt=1e3;(function(e){e["ROUND_RECT"]="roundRect",e["ROUND_RECT_DIAGONAL"]="roundRectDiagonal",e["ROUND_RECT_SINGLE"]="roundRectSingle",e["ROUND_RECT_SAMESIDE"]="roundRectSameSide",e["CUT_RECT_DIAGONAL"]="cutRectDiagonal",e["CUT_RECT_SINGLE"]="cutRectSingle",e["CUT_RECT_SAMESIDE"]="cutRectSameSide",e["MESSAGE"]="message",e["ROUND_MESSAGE"]="roundMessage",e["L"]="L",e["RING_RECT"]="ringRect",e["PLUS"]="plus",e["TRIANGLE"]="triangle",e["PARALLELOGRAM_LEFT"]="parallelogramLeft",e["PARALLELOGRAM_RIGHT"]="parallelogramRight",e["TRAPEZOID"]="trapezoid",e["BULLET"]="bullet",e["INDICATOR"]="indicator"})(we||(we={})),function(e){e["TEXT"]="text",e["IMAGE"]="image",e["SHAPE"]="shape",e["LINE"]="line",e["CHART"]="chart",e["TABLE"]="table",e["LATEX"]="latex",e["VIDEO"]="video",e["AUDIO"]="audio"}(Ve||(Ve={}));var nt=(Ie={},Object(pe["a"])(Ie,we.ROUND_RECT,{editable:!0,defaultValue:.125,range:[0,.5],relative:"left",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M ".concat(c," 0 L ").concat(e-c," 0 Q ").concat(e," 0 ").concat(e," ").concat(c," L ").concat(e," ").concat(t-c," Q ").concat(e," ").concat(t," ").concat(e-c," ").concat(t," L ").concat(c," ").concat(t," Q 0 ").concat(t," 0 ").concat(t-c," L 0 ").concat(c," Q 0 0 ").concat(c," 0 Z")}}),Object(pe["a"])(Ie,we.CUT_RECT_DIAGONAL,{editable:!0,defaultValue:.2,range:[0,.9],relative:"right",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 ".concat(t-c," L 0 0 L ").concat(e-c," 0 L ").concat(e," ").concat(c," L ").concat(e," ").concat(t," L ").concat(c," ").concat(t," Z")}}),Object(pe["a"])(Ie,we.CUT_RECT_SINGLE,{editable:!0,defaultValue:.2,range:[0,.9],relative:"right",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 ".concat(t," L 0 0 L ").concat(e-c," 0 L ").concat(e," ").concat(c," L ").concat(e," ").concat(t," Z")}}),Object(pe["a"])(Ie,we.CUT_RECT_SAMESIDE,{editable:!0,defaultValue:.2,range:[0,.5],relative:"left",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 ".concat(c," L ").concat(c," 0 L ").concat(e-c," 0 L ").concat(e," ").concat(c," L ").concat(e," ").concat(t," L 0 ").concat(t," Z")}}),Object(pe["a"])(Ie,we.ROUND_RECT_DIAGONAL,{editable:!0,defaultValue:.125,range:[0,1],relative:"right",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 0 L ".concat(e-c," 0 Q ").concat(e," 0 ").concat(e," ").concat(c," L ").concat(e," ").concat(t," L ").concat(c," ").concat(t," Q 0 ").concat(t," 0 ").concat(t-c," L 0 0 Z")}}),Object(pe["a"])(Ie,we.ROUND_RECT_SINGLE,{editable:!0,defaultValue:.125,range:[0,1],relative:"right",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 0 L ".concat(e-c," 0 Q ").concat(e," 0 ").concat(e," ").concat(c," L ").concat(e," ").concat(t," L 0 ").concat(t," L 0 0 Z")}}),Object(pe["a"])(Ie,we.ROUND_RECT_SAMESIDE,{editable:!0,defaultValue:.125,range:[0,.5],relative:"left",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 ".concat(c," Q 0 0 ").concat(c," 0 L ").concat(e-c," 0 Q ").concat(e," 0 ").concat(e," ").concat(c," L ").concat(e," ").concat(t," L 0 ").concat(t," Z")}}),Object(pe["a"])(Ie,we.MESSAGE,{formula:function(e,t){var n=.2*e,c=.2*t;return"M 0 0 L ".concat(e," 0 L ").concat(e," ").concat(t-c," L ").concat(e/2," ").concat(t-c," L ").concat(e/2-n," ").concat(t," L ").concat(e/2-n," ").concat(t-c," L 0 ").concat(t-c," Z")}}),Object(pe["a"])(Ie,we.ROUND_MESSAGE,{formula:function(e,t){var n=.125*Math.min(e,t),c=.2*e,o=.2*t;return"M 0 ".concat(n," Q 0 0 ").concat(n," 0 L ").concat(e-n," 0 Q ").concat(e," 0 ").concat(e," ").concat(n," L ").concat(e," ").concat(t-n-o," Q ").concat(e," ").concat(t-o," ").concat(e-n," ").concat(t-o," L ").concat(e/2," ").concat(t-o," L ").concat(e/2-c," ").concat(t," L ").concat(e/2-c," ").concat(t-o," L ").concat(n," ").concat(t-o," Q 0 ").concat(t-o," 0 ").concat(t-n-o," L 0 ").concat(n," Z")}}),Object(pe["a"])(Ie,we.L,{editable:!0,defaultValue:.25,range:[.1,.9],relative:"left",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 0 L 0 ".concat(t," L ").concat(e," ").concat(t," L ").concat(e," ").concat(t-c," L ").concat(c," ").concat(t-c," L ").concat(c," 0 Z")}}),Object(pe["a"])(Ie,we.RING_RECT,{editable:!0,defaultValue:.25,range:[.1,.45],relative:"left",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 0 ".concat(e," 0 ").concat(e," ").concat(t," L 0 ").concat(t," L 0 0 Z M ").concat(c," ").concat(c," L ").concat(c," ").concat(t-c," L ").concat(e-c," ").concat(t-c," L ").concat(e-c," ").concat(c," Z")}}),Object(pe["a"])(Ie,we.PLUS,{editable:!0,defaultValue:.25,range:[.1,.9],relative:"center",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M ".concat(e/2-c/2," 0 L ").concat(e/2-c/2," ").concat(t/2-c/2," L 0 ").concat(t/2-c/2," L 0 ").concat(t/2+c/2," L ").concat(e/2-c/2," ").concat(t/2+c/2," L ").concat(e/2-c/2," ").concat(t," L ").concat(e/2+c/2," ").concat(t," L ").concat(e/2+c/2," ").concat(t/2+c/2," L ").concat(e," ").concat(t/2+c/2," L ").concat(e," ").concat(t/2-c/2," L ").concat(e/2+c/2," ").concat(t/2-c/2," L ").concat(e/2+c/2," 0 Z")}}),Object(pe["a"])(Ie,we.TRIANGLE,{editable:!0,defaultValue:.5,range:[0,1],relative:"left",getBaseSize:function(e,t){return e},formula:function(e,t,n){var c=e*n;return"M ".concat(c," 0 L 0 ").concat(t," L ").concat(e," ").concat(t," Z")}}),Object(pe["a"])(Ie,we.PARALLELOGRAM_LEFT,{editable:!0,defaultValue:.25,range:[0,.9],relative:"left",getBaseSize:function(e,t){return e},formula:function(e,t,n){var c=e*n;return"M ".concat(c," 0 L ").concat(e," 0 L ").concat(e-c," ").concat(t," L 0 ").concat(t," Z")}}),Object(pe["a"])(Ie,we.PARALLELOGRAM_RIGHT,{editable:!0,defaultValue:.25,range:[0,.9],relative:"right",getBaseSize:function(e,t){return e},formula:function(e,t,n){var c=e*n;return"M 0 0 L ".concat(e-c," 0 L ").concat(e," ").concat(t," L ").concat(c," ").concat(t," Z")}}),Object(pe["a"])(Ie,we.TRAPEZOID,{editable:!0,defaultValue:.25,range:[0,.5],relative:"left",getBaseSize:function(e,t){return e},formula:function(e,t,n){var c=e*n;return"M ".concat(c," 0 L ").concat(e-c," 0 L ").concat(e," ").concat(t," L 0 ").concat(t," Z")}}),Object(pe["a"])(Ie,we.BULLET,{editable:!0,defaultValue:.2,range:[0,1],relative:"top",getBaseSize:function(e,t){return t},formula:function(e,t,n){var c=t*n;return"M ".concat(e/2," 0 L 0 ").concat(c," L 0 ").concat(t," L ").concat(e," ").concat(t," L ").concat(e," ").concat(c," Z")}}),Object(pe["a"])(Ie,we.INDICATOR,{editable:!0,defaultValue:.2,range:[0,.9],relative:"right",getBaseSize:function(e,t){return e},formula:function(e,t,n){var c=e*n;return"M ".concat(e," ").concat(t/2," L ").concat(e-c," 0 L 0 0 L ").concat(c," ").concat(t/2," L 0 ").concat(t," L ").concat(e-c," ").concat(t," Z")}}),Ie),ct=[{type:"矩形",children:[{viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z"},{viewBox:[200,200],path:"M 50 0 L 150 0 Q 200 0 200 50 L 200 150 Q 200 200 150 200 L 50 200 Q 0 200 0 150 L 0 50 Q 0 0 50 0 Z",pathFormula:we.ROUND_RECT},{viewBox:[200,200],path:"M 0 150 L 0 0 L 150 0 L 200 50 L 200 200 L 50 200 Z",pathFormula:we.CUT_RECT_DIAGONAL},{viewBox:[200,200],path:"M 0 200 L 0 0 L 150 0 L 200 50 L 200 200 Z",pathFormula:we.CUT_RECT_SINGLE},{viewBox:[200,200],path:"M 0 50 L 50 0 L 150 0 L 200 50 L 200 200 L 0 200 Z",pathFormula:we.CUT_RECT_SAMESIDE},{viewBox:[200,200],path:"M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 50 200 Q 0 200 0 150 L 0 0 Z",pathFormula:we.ROUND_RECT_DIAGONAL},{viewBox:[200,200],path:"M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 L 0 0 Z",pathFormula:we.ROUND_RECT_SINGLE},{viewBox:[200,200],path:"M 0 50 Q 0 0 50 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 Z",pathFormula:we.ROUND_RECT_SAMESIDE}]},{type:"常用形状",children:[{viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 200 L 200 200 L 100 0 Z",pathFormula:we.TRIANGLE},{viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z"},{viewBox:[200,200],path:"M 50 0 L 200 0 L 150 200 L 0 200 L 50 0 Z",pathFormula:we.PARALLELOGRAM_LEFT},{viewBox:[200,200],path:"M 0 0 L 150 0 L 200 200 L 50 200 L 0 0 Z",pathFormula:we.PARALLELOGRAM_RIGHT},{viewBox:[200,200],path:"M 50 0 L 150 0 L 200 200 L 0 200 L 50 0 Z",pathFormula:we.TRAPEZOID},{viewBox:[200,200],path:"M 100 0 L 0 100 L 100 200 L 200 100 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 50 L 0 200 L 200 200 L 200 50 L 100 0 Z",pathFormula:we.BULLET},{viewBox:[200,200],path:"M 200 100 L 150 0 L 0 0 L 50 100 L 0 200 L 150 200 L 200 100 Z",pathFormula:we.INDICATOR},{viewBox:[200,200],path:"M 0 200 A 50 100 0 1 1 200 200 L 0 200 Z"},{viewBox:[200,200],path:"M 40 20 A 100 100 0 1 0 200 100 L 100 100 L 40 20 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 100 100 L 100 0 Z"},{viewBox:[200,200],path:"M 160 20 A 100 100 0 1 0 200 100 L 100 100 L 160 20 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 200 0 L 100 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 0 Q 200 200 0 200 L 0 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 90 L 50 200 L 150 200 L 200 90 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 60 L 0 140 L 100 200 L 200 140 L 200 60 L 100 0 Z"},{viewBox:[200,200],path:"M 60 0 L 140 0 L 200 60 L 200 140 L 140 200 L 60 200 L 0 140 L 0 60 L 60 0 Z"},{viewBox:[200,200],path:"M 75 0 L 125 0 L 175 25 L 200 75 L 200 125 L 175 175 L 125 200 L 75 200 L 25 175 L 0 125 L 0 75 L 25 25 L 75 0 Z"},{viewBox:[200,200],path:"M 150 0 A 50 100 0 1 1 150 200 L 0 200 L 0 0 L 150 0 Z"},{viewBox:[200,200],path:"M 50 0 A 25 50 0 1 0 50 200 L 150 200 A 25 50 0 1 0 150 0 L 50 0 Z"},{viewBox:[200,200],path:"M 150 0 A 50 100 0 1 1 150 200 L 0 200 A 50 100 0 0 0 0 0 L 150 0 Z"},{viewBox:[200,200],path:"M 200 0 L 200 200 L 0 200 L 0 100 L 200 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 100 L 200 200 L 0 200 L 0 0 Z"},{viewBox:[200,200],path:"M 200 0 L 100 0 L 0 100 L 0 200 L 200 0 Z"},{viewBox:[200,200],path:"M 50 0 L 150 0 L 150 50 L 200 50 L 200 150 L 150 150 L 150 200 L 50 200 L 50 150 L 0 150 L 0 50 L 50 50 L 50 0 Z"},{viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 L 200 140 L 60 140 L 60 0 L 0 0 Z",pathFormula:we.L},{viewBox:[200,200],path:"M0 0 L200 0 L200 200 L0 200 L0 0 Z M50 50 L50 150 L150 150 L150 50 Z",pathFormula:we.RING_RECT},{viewBox:[200,200],path:"M0 100 A100 100 0 1 1 0 101 Z M150 100 A50 50 0 1 0 150 101 Z"},{viewBox:[200,200],path:"M 70 0 L 70 70 L 0 70 L 0 130 L 70 130 L 70 200 L 130 200 L 130 130 L 200 130 L 200 70 L 130 70 L 130 0 L 70 0 Z",pathFormula:we.PLUS},{viewBox:[200,200],path:"M 40 0 L 0 40 L 60 100 L 0 160 L 40 200 L 100 140 L 160 200 L 200 160 L 140 100 L 200 40 L 160 0 L 100 60 L 40 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 0 L 200 160 L 100 160 L 60 200 L 60 160 L 0 160 Z",pathFormula:we.MESSAGE},{viewBox:[200,200],path:"M 0 40 Q 0 0 40 0 L 160 0 Q 200 0 200 40 L 200 120 Q 200 160 160 160 L 100 160 L 60 200 L 60 160 L 40 160 Q 0 160 0 120 L 0 40 Z",pathFormula:we.ROUND_MESSAGE},{viewBox:[200,200],path:"M 180 160 A 100 100 0 1 0 100 200 L 200 200 L 200 160 L 180 160 Z"},{viewBox:[200,200],path:"M 200 0 L 0 0 L 200 200 L 0 200 L 200 0 Z"},{viewBox:[200,200],path:"M 0 20 C 60 60 140 -40 200 20 L 200 180 C 140 140 60 240 0 180 L 0 20 Z"},{viewBox:[200,200],path:"M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z"},{viewBox:[200,200],path:"M 100 0 Q 0 50 0 175 Q 100 225 200 175 Q 200 50 100 0 Z"},{viewBox:[200,200],path:"M 0 100 A 50 50 0 1 1 200 100 L 100 200 L 0 100 Z"},{viewBox:[200,200],path:"M 100 0 L 60 60 L 0 100 L 60 140 L 100 200 L 140 140 L 200 100 L 140 60 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 80 40 L 20 20 L 40 80 L 0 100 L 40 120 L 20 180 L 80 160 L 100 200 L 120 160 L 180 180 L 160 120 L 200 100 L 160 80 L 180 20 L 120 40 L 100 0 Z"}]},{type:"箭头",children:[{viewBox:[200,200],path:"M 100 0 L 0 100 L 50 100 L 50 200 L 150 200 L 150 100 L 200 100 L 100 0 Z"},{viewBox:[200,200],path:"M 100 200 L 200 100 L 150 100 L 150 0 L 50 0 L 50 100 L 0 100 L 100 200 Z"},{viewBox:[200,200],path:"M 0 100 L 100 0 L 100 50 L 200 50 L 200 150 L 100 150 L 100 200 L 0 100 Z"},{viewBox:[200,200],path:"M 200 100 L 100 0 L 100 50 L 0 50 L 0 150 L 100 150 L 100 200 L 200 100 Z"},{viewBox:[200,200],path:"M 100 0 L 0 60 L 60 60 L 60 140 L 0 140 L 100 200 L 200 140 L 140 140 L 140 60 L 200 60 L 100 0 Z"},{viewBox:[200,200],path:"M 0 100 L 60 0 L 60 60 L 140 60 L 140 0 L 200 100 L 140 200 L 140 140 L 60 140 L 60 200 L 0 100 Z"},{viewBox:[200,200],path:"M 100 0 L 60 40 L 80 40 L 80 80 L 40 80 L 40 60 L 0 100 L 40 140 L 40 120 L 80 120 L 80 160 L 60 160 L 100 200 L 140 160 L 120 160 L 120 120 L 160 120 L 160 140 L 200 100 L 160 60 L 160 80 L 120 80 L 120 40 L 140 40 L 100 0 Z"},{viewBox:[200,200],path:"M 0 100 L 100 0 L 100 50 L 200 50 L 150 100 L 200 150 L 100 150 L 100 200 L 0 100 Z"},{viewBox:[200,200],path:"M 200 100 L 100 0 L 100 50 L 0 50 L 50 100 L 0 150 L 100 150 L 100 200 L 200 100 Z"},{viewBox:[200,200],path:"M 0 100 L 80 20 L 80 80 L 120 80 L 120 0 L 200 0 L 200 200 L 120 200 L 120 120 L 80 120 L 80 180 L 0 100 Z"},{viewBox:[200,200],path:"M 200 100 L 120 20 L 120 80 L 80 80 L 80 0 L 0 0 L 0 200 L 80 200 L 80 120 L 120 120 L 120 180 L 200 100 Z"},{viewBox:[200,200],path:"M 0 0 L 120 0 L 200 100 L 120 200 L 0 200 L 80 100 L 0 0 Z"},{viewBox:[200,200],path:"M 80 0 L 200 0 L 120 100 L 200 200 L 80 200 L 0 100 L 80 0 Z"},{viewBox:[200,200],path:"M 0 0 L 140 0 L 200 100 L 140 200 L 0 200 L 0 100 L 0 0 Z"},{viewBox:[200,200],path:"M 60 0 L 200 0 L 200 100 L 200 200 L 60 200 L 0 100 L 60 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 100 L 0 200 L 60 100 L 0 0 Z"},{viewBox:[200,200],path:"M 200 0 L 0 100 L 200 200 L 140 100 L 200 0 Z"},{viewBox:[200,200],path:"M 0 0 L 80 0 L 200 100 L 80 200 L 0 200 L 120 100 L 0 0 Z"},{viewBox:[200,200],path:"M 200 0 L 120 0 L 0 100 L 120 200 L 200 200 L 80 100 L 200 0 Z"},{viewBox:[200,200],path:"M 0 200 L 180 200 L 180 40 L 200 40 L 160 0 L 120 40 L 140 40 L 140 160 L 0 160 L 0 200 Z"},{viewBox:[200,200],path:"M 0 200 L 0 20 L 160 20 L 160 0 L 200 40 L 160 80 L 160 60 L 40 60 L 40 200 L 0 200 Z"},{viewBox:[200,200],path:"M 40 180 L 180 180 L 180 40 L 200 40 L 160 0 L 120 40 L 140 40 L 140 140 L 40 140 L 40 120 L 0 160 L 40 200 L 40 180 Z"},{viewBox:[1024,1024],path:"M398.208 302.912V64L0 482.112l398.208 418.176V655.36c284.48 0 483.584 95.552 625.792 304.64-56.896-298.688-227.584-597.312-625.792-657.088z",special:!0},{viewBox:[1024,1024],path:"M625.792 302.912V64L1024 482.112l-398.208 418.176V655.36C341.312 655.36 142.208 750.912 0 960c56.896-298.688 227.584-597.312 625.792-657.088z",special:!0}]},{type:"其他形状",children:[{viewBox:[1024,1024],path:"M995.336 243.4016c-15.7584-36.5736-38.3376-69.26639999-66.91440001-97.37280001-28.5768-27.98879999-61.73999999-49.8624-98.78399999-65.26799998-38.22-15.876-78.6744-23.8728-120.4224-23.87280001-57.97680001 0-114.5424 15.876-163.69919999 45.864-11.76 7.17360001-22.932 15.05279999-33.51600001 23.63760001-10.584-8.5848-21.75600001-16.46400001-33.51600001-23.63760001-49.1568-29.98799999-105.7224-45.86399999-163.69919999-45.864-41.74799999 0-82.2024 7.9968-120.4224 23.87280001-36.9264 15.28799999-70.2072 37.27919999-98.78399999 65.26799998-28.6944 28.10640001-51.156 60.79919999-66.91440001 97.37280001-16.34639999 37.9848-24.696 78.3216-24.696 119.83439999 0 39.1608 7.9968 79.96800001 23.8728 121.48080001 13.28880001 34.692 32.34000001 70.67760001 56.6832 107.016 38.57279999 57.5064 91.61040001 117.4824 157.4664 178.28160001 109.1328 100.78319999 217.2072 170.4024 221.79359999 173.22479998l27.87120001 17.8752c12.348 7.8792 28.224 7.8792 40.572 0l27.87119999-17.8752c4.58639999-2.94 112.54319999-72.44159999 221.79360001-173.22479998 65.85599999-60.79919999 118.89359999-120.7752 157.4664-178.28160001 24.3432-36.33839999 43.512-72.324 56.68319999-107.016 15.876-41.5128 23.8728-82.32 23.87280001-121.48080001 0.1176-41.5128-8.232-81.8496-24.5784-119.83439999z",special:!0},{viewBox:[1024,1024],path:"M985.20746667 343.50079998l-303.32586667-44.08319999L546.28693333 24.5248c-3.70346666-7.5264-9.79626667-13.6192-17.32266665-17.32266668-18.87573334-9.3184-41.81333333-1.55306667-51.25120001 17.32266668L342.1184 299.41759999l-303.32586667 44.08319999c-8.36266667 1.19466667-16.00853333 5.13706667-21.8624 11.11040001-14.69440001 15.17226667-14.45546667 39.30453334 0.71679999 54.1184l219.46026668 213.9648-51.84853333 302.1312c-1.43359999 8.24320001-0.11946667 16.8448 3.82293333 24.25173333 9.79626667 18.6368 32.9728 25.92426667 51.6096 16.00853334L512 822.44266665l271.3088 142.64320001c7.40693333 3.9424 16.00853333 5.25653333 24.25173333 3.82293333 20.78719999-3.584 34.7648-23.296 31.1808-44.0832l-51.84853333-302.1312 219.46026668-213.9648c5.97333334-5.85386666 9.91573333-13.49973334 11.11039999-21.8624 3.2256-20.90666667-11.34933333-40.26026667-32.256-43.36640001z",special:!0},{viewBox:[1024,1024],path:"M852.65066667 405.84533333C800.54044445 268.40177778 667.76177778 170.66666667 512.22755555 170.66666667S223.91466667 268.288 171.80444445 405.73155555C74.29688889 431.33155555 2.27555555 520.07822222 2.27555555 625.77777778c0 125.72444445 101.83111111 227.55555555 227.44177778 227.55555555h564.56533334C919.89333333 853.33333333 1021.72444445 751.50222222 1021.72444445 625.77777778c0-105.472-71.79377778-194.21866667-169.07377778-219.93244445z",special:!0},{viewBox:[1024,1024],path:"M926.25224691 323.7371485H654.6457886L898.88200917 15.14388241c5.05486373-6.53433603 0.49315743-16.02761669-7.76722963-16.02761668H418.30008701c-3.45210206 0-6.78091476 1.84934039-8.50696579 4.93157436L90.35039154 555.76772251c-3.82197013 6.53433603 0.86302552 14.7947231 8.50696578 14.79472311h215.01664245l-110.22068713 440.88274851c-2.34249783 9.61657002 9.24670194 16.39748478 16.39748477 9.49328065L933.03316167 340.62779071c6.41104668-6.0411786 2.09591911-16.8906422-6.78091476-16.89064221z",special:!0},{viewBox:[1024,1024],path:"M878.47822222 463.30311111c-22.18666667-49.83466667-53.93066667-93.98044445-94.32177777-131.072l-33.10933334-30.37866666c-4.89244445-4.32355555-12.62933333-2.38933333-14.79111111 3.75466666l-14.79111111 42.43911111c-9.216 26.624-26.16888889 53.81688889-50.176 80.55466667-1.59288889 1.70666667-3.41333333 2.16177778-4.66488889 2.27555556-1.25155555 0.11377778-3.18577778-0.11377778-4.89244445-1.70666667-1.59288889-1.36533333-2.38933333-3.41333333-2.27555555-5.46133333 4.20977778-68.49422222-16.27022222-145.74933333-61.09866667-229.83111112C561.26577778 124.01777778 509.72444445 69.51822222 445.32622222 31.51644445l-46.99022222-27.648c-6.144-3.64088889-13.99466667 1.13777778-13.65333333 8.30577777l2.50311111 54.61333333c1.70666667 37.31911111-2.61688889 70.31466667-12.85688889 97.73511112-12.51555555 33.56444445-30.49244445 64.73955555-53.47555556 92.72888888-16.15644445 19.56977778-34.24711111 37.20533333-54.04444444 52.45155556-47.90044445 36.75022222-87.38133333 84.65066667-114.11911111 138.24C125.72444445 502.10133333 111.50222222 562.74488889 111.50222222 623.50222222c0 53.70311111 10.58133333 105.69955555 31.51644445 154.73777778 20.25244445 47.21777778 49.152 89.77066667 85.90222222 126.17955555 36.864 36.40888889 79.64444445 65.08088889 127.31733333 84.992C405.61777778 1010.11911111 457.95555555 1020.58666667 512 1020.58666667s106.38222222-10.46755555 155.76177778-31.06133334c47.67288889-19.91111111 90.56711111-48.46933333 127.31733333-84.992 36.864-36.40888889 65.76355555-78.96177778 85.90222222-126.17955555 20.93511111-49.03822222 31.51644445-101.03466667 31.51644445-154.73777778 0-55.52355555-11.37777778-109.45422222-34.01955556-160.31288889z",special:!0},{viewBox:[1024,1024],path:"M968.20337778 20.11591112H705.44042667c-22.17301333 0-41.92483556 15.16430222-47.14951111 37.33731555C642.36202666 124.73685332 582.08711111 173.03324444 512 173.03324444s-130.36202666-48.29639112-146.29091556-115.58001777c-5.22467555-22.17301333-24.84906667-37.33731556-47.14951111-37.33731555H55.79662222c-30.96576 0-56.06968889 25.10392889-56.06968888 56.06968888v321.12639999c0 30.96576 25.10392889 56.06968889 56.06968888 56.06968889h95.57333334v494.43271112c0 30.96576 25.10392889 56.06968889 56.06968889 56.06968888h609.1207111c30.96576 0 56.06968889-25.10392889 56.06968889-56.06968888V453.38168888h95.57333334c30.96576 0 56.06968889-25.10392889 56.06968888-56.06968889V76.1856c0-30.96576-25.10392889-56.06968889-56.06968888-56.06968888z",special:!0},{viewBox:[1024,1024],path:"M980.94648889 239.80714666H523.46880001L373.99210666 96.82944c-1.91146667-1.78403556-4.46008889-2.80348444-7.00871111-2.80348445H43.05351111c-22.55530667 0-40.77795555 18.22264888-40.77795555 40.77795557v754.39217776c0 22.55530667 18.22264888 40.77795555 40.77795555 40.77795557h937.89297778c22.55530667 0 40.77795555-18.22264888 40.77795555-40.77795557V280.58510222c0-22.55530667-18.22264888-40.77795555-40.77795555-40.77795556z",special:!0},{viewBox:[1024,1024],path:"M972.60904597 164.57058577L841.30587843 33.39070759c-18.86327195-18.86327195-44.1375906-29.34286748-70.64480282-29.3428675-26.75379095 0-51.90482023 10.47959553-70.76809219 29.3428675L558.60337778 174.68031322c-18.86327195 18.86327195-29.34286748 44.1375906-29.34286749 70.64480283 0 26.75379095 10.47959553 51.90482023 29.34286749 70.76809218l103.31648301 103.31648302c-24.28800376 53.50758189-57.69942011 101.59043198-99.24793416 143.13894603-41.42522469 41.67180341-89.63136414 75.08321976-143.13894603 99.61780223L316.21649759 558.84995649c-18.86327195-18.86327195-44.1375906-29.34286748-70.64480283-29.34286747-26.75379095 0-51.90482023 10.47959553-70.76809217 29.34286747L33.39070759 700.01627278c-18.86327195 18.86327195-29.34286748 44.1375906-29.3428675 70.76809217 0 26.75379095 10.47959553 51.90482023 29.3428675 70.76809219l131.05658883 131.05658883c30.08260365 30.205893 71.63111769 47.34311394 114.28923598 47.34311394 9.00012323 0 17.63037836-0.73973616 26.13734414-2.21920846 166.19405621-27.37023774 331.03192945-115.76870829 464.06114804-248.67463751C901.84095379 636.27567408 990.11613498 471.56109018 1017.85624079 304.87387654c8.38367642-50.91850535-8.50696579-103.31648302-45.24719482-140.30329077z",special:!0},{viewBox:[1024,1024],path:"M910.60451556 640.96028445c-20.38897778-65.49959112-43.83630221-120.54983112-79.89930667-210.64362666C836.31217778 193.67708444 737.93535999 2.27555556 511.36284444 2.27555556 282.24170667 2.27555556 186.03121778 197.50001778 192.14791111 430.31665779c-36.19043555 90.22122667-59.51032888 144.88917333-79.89930667 210.64362666-43.32657778 139.53706668-29.30915556 197.26336001-18.60494222 198.53767111 22.9376 2.80348444 89.32920888-105.00323556 89.32920889-105.00323556 0 62.44124445 32.11264001 143.86972444 101.69002667 202.61546667-33.64181333 10.32192-109.20846222 38.10190221-91.24067556 68.55793777 14.52714667 24.59420444 250.01984 15.67402668 317.94062222 8.02816 67.92078222 7.64586667 303.41347556 16.56604444 317.94062223-8.02816 17.96778667-30.32860444-57.72629333-58.23601779-91.24067555-68.55793777 69.57738667-58.87317334 101.69002667-140.30165333 101.69002667-202.61546667 0 0 66.39160889 107.80672 89.32920888 105.00323556 10.83164445-1.40174222 24.84906667-59.12803556-18.47751111-198.53767111z",special:!0},{viewBox:[1024,1024],path:"M1016.86992592 199.24764445c-37.13706667 16.01991111-77.55093333 27.54939259-119.17842962 32.03982222 42.96248889-25.60758518 75.60912592-66.02145185 91.02222222-114.08118519-39.68568889 23.66577778-84.58998518 41.02068148-131.31472593 50.00154074C819.53374815 126.79395555 765.76995555 101.79318518 706.18074075 101.79318518c-114.688 0-206.92385185 92.96402963-206.92385186 207.04521482 0 16.01991111 1.94180741 32.03982222 5.09724444 47.45291852-171.72859259-8.98085925-324.88865185-91.02222222-426.71217778-216.63288889-17.96171852 30.82619259-28.15620741 66.02145185-28.1562074 104.49351112 0 71.84687408 36.53025185 135.19834075 92.23585185 172.45677036-33.98162963-1.33499259-66.02145185-10.92266667-93.57084445-26.33576296v2.54862222c0 100.6098963 71.1186963 183.98625185 165.90317037 203.1616-17.3549037 4.49042963-35.92343703 7.03905185-54.49197037 7.03905185-13.47128889 0-26.2144-1.33499259-39.07887407-3.15543704C146.69748148 681.90814815 223.03478518 741.49736297 313.93564445 743.43917037c-71.1186963 55.7056-160.19911111 88.4736-256.9253926 88.4736-17.3549037 0-33.37481482-0.60681482-50.00154074-2.54862222C98.75911111 888.22518518 207.62168889 922.20681482 324.85831111 922.20681482 705.45256297 922.20681482 913.71140741 606.90583703 913.71140741 333.23235555c0-8.98085925 0-17.96171852-0.60681482-26.94257777 40.2925037-29.4912 75.60912592-66.02145185 103.76533333-107.04213333z",special:!0},{viewBox:[1024,1024],path:"M917.96720197 1.08889505H106.03279803C53.56084718 1.08889505 9.37393998 45.27580225 9.37393998 97.74775309v5.52336372c0 19.33177108 8.28504494 41.42522469 22.0934536 55.23363205l331.40179753 392.15879462v325.87843379c0 16.57008987 8.28504494 30.37849854 22.09345359 35.90186098l209.88780469 104.94390299 2.76168121 2.76168121c27.61681602 11.04672615 55.23363335-8.28504494 55.23363335-38.66354218V550.66354348l331.40179753-392.15879462c35.90186097-41.42522469 30.37849854-102.18222047-11.04672616-135.32240022-11.04672615-13.80840865-33.14017975-22.0934536-55.23363335-22.09345359z",special:!0},{viewBox:[1024,1024],path:"M491.70164031 97.48884502a25.89076502 25.89076502 0 0 1 40.59671938 0L745.66415762 367.01171317a25.89076502 25.89076502 0 0 0 30.49932208 7.72839349l208.00640948-89.14190458a25.89076502 25.89076502 0 0 1 35.56096592 29.06238339l-115.18801541 554.96855704A103.56306132 103.56306132 0 0 1 803.14165689 952.14301275H220.85834311a103.56306132 103.56306132 0 0 1-101.4011828-82.51387024l-115.18801541-554.96855704a25.89076502 25.89076502 0 0 1 35.54802012-29.06238339l208.01935528 89.14190458a25.89076502 25.89076502 0 0 0 30.49932208-7.72839349l213.36579793-269.52286815z",special:!0},{viewBox:[1024,1024],path:"M643.02466884 387.7801525c19.85376751-88.69205333 33.718272-152.84087467 41.61900049-192.57389433C704.52292267 95.17283515 652.90057916 2.27555515 550.58614084 2.27555515c-92.26012484 0-138.59407685 45.84971417-165.91530666 137.49816969l-0.70087152 2.67605334c-16.40038399 74.13942085-41.47882668 131.61085116-74.6746315 172.73287031a189.06953915 189.06953915 0 0 1-143.04142182 70.44391902l-26.17434983 0.5606965C77.66380049 387.52529067 27.76177817 438.90551468 27.76177817 501.84374084V881.55022182c0 77.4144 62.25009818 140.17422182 139.05282766 140.17422303h492.82707951c101.23127467 0 191.59267516-63.995904 225.93535999-159.98976l102.37815468-286.22301868c26.04691951-72.82688-11.39234134-153.15945284-83.63303784-179.42300483a138.04612267 138.04612267 0 0 0-47.17499733-8.30850884H643.02466884z",special:!0},{viewBox:[1024,1024],path:"M512 512c140.82958222 0 254.86222222-114.03264 254.86222222-254.86222222S652.82958222 2.27555555 512 2.27555555a254.78940445 254.78940445 0 0 0-254.86222222 254.86222223C257.13777778 397.96736 371.17041778 512 512 512z m0 72.81777778c-170.10232889 0-509.72444445 97.57582222-509.72444445 291.27111111v145.63555556h1019.4488889v-145.63555556c0-193.69528889-339.62211555-291.27111111-509.72444445-291.27111111z",special:!0},{viewBox:[1024,1024],path:"M1019.81297778 564.50161779l-138.89991111-472.51456c-8.66531556-25.99594668-29.43658667-43.45400889-57.21656889-43.45400891s-50.33528889 15.67402668-59.00060446 41.66997334l-92.00526221 274.48661334H351.69166222L259.6864 90.33045333c-8.66531556-25.99594668-31.22062222-41.66997333-59.00060444-41.66997332s-50.33528889 17.33063112-57.2165689 43.45400887L4.69674667 564.50161779c-5.22467555 17.33063112 1.78403556 36.44529778 15.67402667 46.89464887l491.11950221 368.27591113 492.77610666-368.27591113c13.76256-10.32192 20.77127111-29.43658667 15.54659557-46.89464887z",special:!0},{viewBox:[1024,1024],path:"M927.78951111 340.39277037c-12.01493333-47.81700741 12.01493333-124.03294815 89.08041481-150.97552592l-82.40545184-4.36906667s-31.19028148-109.22666667-174.27721483-118.9357037c-143.08693333-9.8304-236.65777778-3.64088889-236.65777777-3.6408889s106.07122963 67.47780741 63.5941926 187.74850371c-31.06891852 63.71555555-79.85682963 116.02299259-132.04290371 175.61220741-1.57771852 1.57771852-3.03407408 3.15543703-4.2477037 4.49042962C278.25493333 624.86755555 7.13007408 934.34311111 7.13007408 934.34311111c298.43152592 78.15774815 498.43768889-7.64586667 616.76657777-110.56165926 24.87940741-0.24272592 43.5693037-0.36408889 56.19105185-0.36408888 164.8109037 0 304.13558518-142.72284445 298.43152593-301.4656-3.88361482-109.1053037-38.71478518-133.74198518-50.72971852-181.5589926z",special:!0},{viewBox:[1024,1024],path:"M997.8886764 504.17210418L537.2729208 43.89182982c-13.97838539-13.97838539-36.56745619-13.97838539-50.5458416 0L26.1113236 504.17210418c-13.41924998 13.41924998-21.02349164 31.64706454-21.02349163 50.65766867 0 39.47496036 32.09437288 71.56933323 71.56933324 71.56933323h48.53295408V954.83524937c0 19.79339373 15.99127289 35.78466661 35.78466663 35.78466662H440.43066677V740.12724968h125.24633315v250.49266631h297.34821416c19.79339373 0 35.78466661-15.99127289 35.78466663-35.78466662V626.39910608h48.53295408c19.01060414 0 37.23841869-7.49241457 50.65766869-21.02349163 27.84494371-27.95677079 27.84494371-73.24673948-0.11182708-101.20351027z",special:!0},{viewBox:[1024,1024],path:"M1009.13013121 349.27572283L674.72427717 14.86986879c-8.82158299-8.82158299-20.35749924-13.16451618-31.89341544-13.16451618s-23.07183245 4.34293316-31.89341547 13.16451618L392.29790453 233.6451272c-16.5574327-1.90003326-33.25058207-2.71433322-49.94373146-2.71433324-99.34459624 0-198.68919249 32.70771543-280.25490606 98.12314628-20.90036589 16.69314938-22.52896582 48.04369819-3.66434987 67.04403081l246.59717401 246.59717401-292.33368895 292.06225564c-3.52863319 3.52863319-5.83581644 8.27871636-6.24296642 13.30023282l-4.61436649 50.48659809c-1.22144996 12.75736619 8.95729967 23.6146991 21.57894918 23.6146991 0.6785833 0 1.35716662 0 2.03574992-0.13571666l50.48659809-4.61436649c5.02151649-0.40714999 9.77159962-2.71433322 13.30023282-6.24296643l292.33368896-292.33368896 246.59717402 246.59717401c8.82158299 8.82158299 20.35749924 13.16451618 31.89341544 13.16451618 13.16451618 0 26.19331567-5.70009979 35.15061536-16.82886604 76.40848044-95.40881307 108.16617924-214.83947521 95.27309638-330.33435417l218.63954175-218.63954173c17.50744934-17.37173267 17.50744934-45.8722316 0-63.51539759z",special:!0},{viewBox:[1024,1024],path:"M976.62005979 160.47737905c-0.39452595-0.39452595-80.35178503 78.64217259-239.47725131 237.50462156l-111.6508437-111.65084369 237.89914752-237.89914752c-125.19623464-75.35445635-286.03131335-56.02268482-390.31767264 48.26367449-81.92988882 81.92988882-112.57140424 200.15616502-83.37648398 310.09739626l2.36715569 8.81107954-372.82702222 372.69551356c-8.15353628 8.15353628-8.15353628 21.56741857 0 29.72095487l185.95323084 185.95323084c8.15353628 8.15353628 21.56741857 8.15353628 29.72095485 0l372.56400493-372.56400493 8.81107953 2.3671557c110.07273989 29.32642892 228.29901608-1.18357785 310.36041356-83.24497533 104.41786795-104.2863593 123.74963948-265.12143802 49.97328693-390.05465535z",special:!0}]},{type:"线性",children:[{viewBox:[1024,1024],path:"M953.5488 832.61667556c-24.08448-57.08913778-58.74574221-108.31644445-102.70947556-152.28017777-43.96373333-43.96373333-95.19104-78.49756444-152.28017777-102.70947558-0.50972445-0.25486222-1.01944888-0.38229333-1.52917334-0.63715555C776.41955556 519.64586667 828.02915556 426.23886221 828.02915556 320.85333332c0-174.58062221-141.44853334-316.02915556-316.02915556-316.02915554S195.97084444 146.27271111 195.97084444 320.85333332c0 105.38552889 51.6096 198.79253333 130.99918223 256.26396447-0.50972445 0.25486222-1.01944888 0.38229333-1.52917334 0.63715555-57.08913778 24.08448-108.31644445 58.61831112-152.28017777 102.70947554-43.96373333 43.96373333-78.49756444 95.19104-102.70947556 152.28017779C46.74901333 888.55893332 34.13333334 947.8144 32.85902222 1008.72647111c-0.12743111 5.7344 4.46008889 10.44935111 10.19448889 10.44935111h76.45866667c5.60696888 0 10.06705778-4.46008889 10.19448889-9.93962666 2.54862221-98.37681778 42.05226667-190.50951112 111.88451555-260.34176001 72.25344-72.25344 168.20906666-112.01194667 270.40881778-112.01194667s198.15537778 39.75850667 270.40881778 112.01194667C852.24106667 818.72668444 891.74471111 910.85937779 894.29333333 1009.23619556c0.12743111 5.60696888 4.58752 9.93962667 10.19448889 9.93962666h76.45866667c5.7344 0 10.32192-4.71495112 10.19448889-10.44935111-1.27431111-60.91207112-13.88999112-120.16753779-37.59217778-176.10979555zM512 540.03484444c-58.49088 0-113.54112-22.81016889-154.95623111-64.22527999S292.81848888 379.34421333 292.81848888 320.85333332c0-58.49088 22.81016889-113.54112 64.22528001-154.9562311S453.50912 101.67182221 512 101.67182221s113.54112 22.81016889 154.95623111 64.22528001S731.18151112 262.36245333 731.18151112 320.85333332c0 58.49088-22.81016889 113.54112-64.22528001 154.95623113S570.49088 540.03484444 512 540.03484444z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M985.31555555 111.50222222H38.68444445c-20.13866667 0-36.40888889 16.27022222-36.4088889 36.40888889v728.17777778c0 20.13866667 16.27022222 36.40888889 36.4088889 36.40888889h946.6311111c20.13866667 0 36.40888889-16.27022222 36.4088889-36.40888889V147.91111111c0-20.13866667-16.27022222-36.40888889-36.4088889-36.40888889z m-45.5111111 126.06577778V830.57777778H84.19555555V237.568l-31.40266666-24.46222222 44.71466666-57.45777778 48.6968889 37.888h731.70488888l48.69688889-37.888 44.71466667 57.45777778-31.51644444 24.46222222z M877.90933333 193.42222222L512 477.86666667 146.09066667 193.42222222l-48.69688889-37.888-44.71466667 57.45777778 31.40266667 24.46222222 388.66488889 302.19377778c22.98311111 17.86311111 55.18222222 17.86311111 78.16533333 0L939.80444445 237.568l31.40266666-24.46222222-44.71466666-57.45777778-48.58311112 37.77422222z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M985.31555555 88.74666667H38.68444445c-20.13866667 0-36.40888889 16.27022222-36.4088889 36.40888888v564.33777778c0 20.13866667 16.27022222 36.40888889 36.4088889 36.40888889h432.35555555v127.43111111H275.34222222c-10.01244445 0-18.20444445 8.192-18.20444444 18.20444445v54.61333333c0 5.00622222 4.096 9.10222222 9.10222222 9.10222222h491.52c5.00622222 0 9.10222222-4.096 9.10222222-9.10222222v-54.61333333c0-10.01244445-8.192-18.20444445-18.20444444-18.20444445H552.96V725.90222222h432.35555555c20.13866667 0 36.40888889-16.27022222 36.4088889-36.40888889V125.15555555c0-20.13866667-16.27022222-36.40888889-36.4088889-36.40888888z m-45.5111111 555.23555555H84.19555555V170.66666667h855.6088889v473.31555555z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M512 2.27555555C230.51377778 2.27555555 2.27555555 230.51377778 2.27555555 512s228.23822222 509.72444445 509.72444445 509.72444445 509.72444445-228.23822222 509.72444445-509.72444445S793.48622222 2.27555555 512 2.27555555z m0 932.97777778c-233.69955555 0-423.25333333-189.55377778-423.25333333-423.25333333 0-101.26222222 35.61244445-194.33244445 95.00444444-267.15022222l595.39911111 595.39911111C706.33244445 899.64088889 613.26222222 935.25333333 512 935.25333333z m328.24888889-156.10311111L244.84977778 183.75111111C317.66755555 124.35911111 410.73777778 88.74666667 512 88.74666667c233.69955555 0 423.25333333 189.55377778 423.25333333 423.25333333 0 101.26222222-35.61244445 194.33244445-95.00444444 267.15022222z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M901.80266667 257.82044445L656.95288889 12.97066667c-6.82666667-6.82666667-16.04266667-10.69511111-25.71377778-10.69511112H147.91111111c-20.13866667 0-36.40888889 16.27022222-36.40888889 36.4088889v946.6311111c0 20.13866667 16.27022222 36.40888889 36.40888889 36.4088889h728.17777778c20.13866667 0 36.40888889-16.27022222 36.40888889-36.4088889V283.648c0-9.67111111-3.86844445-19.00088889-10.69511111-25.82755555zM828.52977778 300.37333333H614.4V86.24355555L828.52977778 300.37333333z m2.048 639.43111112H193.42222222V84.19555555h343.60888889v245.76c0 26.39644445 21.39022222 47.78666667 47.78666667 47.78666667h245.76v562.06222223z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M981.07392 55.79662222H42.92608c-31.22062222 0-50.71758221 34.02410666-35.04355556 61.16693334L304.28728889 620.82616888V927.42542221c0 22.55530667 18.09521779 40.77795555 40.52309333 40.77795557h334.37923556c22.42787556 0 40.52309333-18.22264888 40.52309333-40.77795557V620.82616888L1016.24490667 116.96355556c15.54659555-27.14282666-3.95036444-61.16693333-35.17098667-61.16693334zM628.47203556 876.45297779H395.52796444V677.66044445h233.07150222v198.79253334z m12.23338666-301.50200891l-12.10595556 21.15356445h-233.19893332l-12.10595556-21.15356445L130.59868445 147.54702221h762.8026311L640.70542222 574.95096888z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M980.62285431 4.54099753H654.39920987c-4.2719763 0-7.76722963 3.49525333-7.76722962 7.76722964v72.4941432c0 4.2719763 3.49525333 7.76722963 7.76722962 7.76722963h207.64393877L604.04167111 350.57107753c-64.72691358-49.83972347-143.69374815-76.7661195-226.67365136-76.7661195-99.54999309 0-193.27456395 38.83614815-263.5679921 109.25903012S4.54099753 547.08198717 4.54099753 646.63198025s38.83614815 193.27456395 109.25903012 263.5679921C184.09345581 980.62285431 277.81802667 1019.45900247 377.36801975 1019.45900247s193.27456395-38.83614815 263.5679921-109.25903012C711.35889383 839.90654419 750.19504197 746.18197333 750.19504197 646.63198025c0-82.9799032-26.92639605-161.68783013-76.63666567-226.41474372L931.4304 162.34521283V369.60079013c0 4.2719763 3.49525333 7.76722963 7.76722963 7.76722962h72.4941432c4.2719763 0 7.76722963-3.49525333 7.76722964-7.76722962V43.37714569c0-21.35988148-17.47626667-38.83614815-38.83614816-38.83614816zM377.36801975 921.07409383c-151.33152395 0-274.44211358-123.11058963-274.44211358-274.44211358s123.11058963-274.44211358 274.44211358-274.44211358 274.44211358 123.11058963 274.44211358 274.44211358-123.11058963 274.44211358-274.44211358 274.44211358z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M591.98717801 512l405.34042913-483.16579151c6.79427767-8.02960089 1.08090782-20.22841761-9.41933951-20.2284176h-123.22349044c-7.25752386 0-14.20621693 3.24272343-18.99309439 8.80167789L511.38233839 415.95362022 177.07299399 17.40746878c-4.63246205-5.55895447-11.58115512-8.80167789-18.99309439-8.80167789H34.85640916c-10.50024731 0-16.21361717 12.19881672-9.41933952 20.2284176L430.77749876 512 25.43706964 995.16579151c-6.79427767 8.02960089-1.08090782 20.22841761 9.41933952 20.2284176h123.22349044c7.25752386 0 14.20621693-3.24272343 18.99309439-8.80167789l334.3093444-398.54615144 334.30934441 398.54615144c4.63246205 5.55895447 11.58115512 8.80167789 18.99309439 8.80167789h123.22349044c10.50024731 0 16.21361717-12.19881672 9.41933951-20.2284176L591.98717801 512z",special:!0,outlined:!0}]}],ot={bar:"bar",horizontalBar:"bar",line:"line",area:"line",scatter:"line",pie:"pie",ring:"pie"},at=function(){var e=xe(),t=Object(te["debounce"])((function(){e.addSnapshot()}),300,{trailing:!0}),n=Object(te["throttle"])((function(){e.reDo()}),100,{leading:!0,trailing:!1}),c=Object(te["throttle"])((function(){e.unDo()}),100,{leading:!0,trailing:!1});return{addHistorySnapshot:t,redo:n,undo:c}},lt=function(){var e=ie(),t=ae(),n=Object(g["c"])(e),c=n.creatingElement,o=Object(g["c"])(t),a=o.theme,l=o.viewportRatio,r=at(),i=r.addHistorySnapshot,u=function(n,o){t.addElement(n),e.setActiveElementIdList([n.id]),c.value&&e.setCreatingElement(null),setTimeout((function(){e.setEditorareaFocus(!0)}),0),o&&o(),i()},d=function(e){$e(e).then((function(t){var n=t.width,c=t.height,o=c/n;ott?(n=tt,c=n*o):c>tt*l.value&&(c=tt*l.value,n=c/o),u({type:"image",id:Object(x["b"])(10),src:e,width:n,height:c,left:(tt-n)/2,top:(tt*l.value-c)/2,fixedRatio:!0,rotate:0})}))},s=function(e){var t={type:"chart",id:Object(x["b"])(10),chartType:ot[e],left:300,top:81.25,width:400,height:400,rotate:0,themeColor:[a.value.themeColor],gridColor:a.value.fontColor,data:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1"],series:[[12,19,5,2,18]]}},n={};"horizontalBar"===e?n={horizontalBars:!0}:"area"===e?n={showArea:!0}:"scatter"===e?n={showLine:!1}:"ring"===e&&(n={donut:!0}),u(Object(S["a"])(Object(S["a"])({},t),{},{options:n}))},f=function(e,t){for(var n={fontname:a.value.fontName,color:a.value.fontColor},c=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:"",n=e.left,c=e.top,o=e.width,l=e.height,r=Object(x["b"])(10);u({type:"text",id:r,left:n,top:c,width:o,height:l,content:t,rotate:0,defaultFontName:a.value.fontName,defaultColor:a.value.fontColor},(function(){setTimeout((function(){var e=document.querySelector("#editable-element-".concat(r," .ProseMirror"));e&&e.focus()}),0)}))},p=function(e,t){var n=e.left,c=e.top,o=e.width,l=e.height,r={type:"shape",id:Object(x["b"])(10),left:n,top:c,width:o,height:l,viewBox:t.viewBox,path:t.path,fill:a.value.themeColor,fixedRatio:!1,rotate:0};if(t.special&&(r.special=!0),t.pathFormula){r.pathFormula=t.pathFormula,r.viewBox=[o,l];var i=nt[t.pathFormula];"editable"in i?(r.path=i.formula(o,l,i.defaultValue),r.keypoint=i.defaultValue):r.path=i.formula(o,l)}u(r)},m=function(e,t){var n=e.left,c=e.top,o=e.start,l=e.end,r={type:"line",id:Object(x["b"])(10),left:n,top:c,start:o,end:l,points:t.points,color:a.value.themeColor,style:t.style,width:2};t.isBroken&&(r.broken=[(o[0]+l[0])/2,(o[1]+l[1])/2]),t.isCurve&&(r.curve=[(o[0]+l[0])/2,(o[1]+l[1])/2]),t.isCubic&&(r.cubic=[[(o[0]+l[0])/2,(o[1]+l[1])/2],[(o[0]+l[0])/2,(o[1]+l[1])/2]]),u(r)},O=function(e){u({type:"latex",id:Object(x["b"])(10),width:e.w,height:e.h,rotate:0,left:(tt-e.w)/2,top:(tt*l.value-e.h)/2,path:e.path,latex:e.latex,color:a.value.fontColor,strokeWidth:2,viewBox:[e.w,e.h],fixedRatio:!0})},v=function(e){u({type:"video",id:Object(x["b"])(10),width:500,height:300,rotate:0,left:(tt-500)/2,top:(tt*l.value-300)/2,src:e})},j=function(e){u({type:"audio",id:Object(x["b"])(10),width:50,height:50,rotate:0,left:(tt-50)/2,top:(tt*l.value-50)/2,loop:!1,autoplay:!1,fixedRatio:!0,color:a.value.themeColor,src:e})};return{createImageElement:d,createChartElement:s,createTableElement:f,createTextElement:b,createShapeElement:p,createLineElement:m,createLatexElement:O,createVideoElement:v,createAudioElement:j}},rt=(n("07ac"),function(){var e=ie(),t=ae(),n=Object(g["c"])(t),c=n.currentSlide,o=at(),a=o.addHistorySnapshot,l=function(n){var o,l=Ze(n),r=l.groupIdMap,i=l.elIdMap,u=c.value.elements.map((function(e){return e.id})),d=Object(L["a"])(n);try{for(d.s();!(o=d.n()).done;){var s=o.value,f=u.includes(s.id);s.id=i[s.id],f&&(s.left=s.left+10,s.top=s.top+10),s.groupId&&(s.groupId=r[s.groupId])}}catch(b){d.e(b)}finally{d.f()}t.addElement(n),e.setActiveElementIdList(Object.values(i)),a()},r=function(e){var n=e.map((function(e){var t,n=Ze(e.elements),c=n.groupIdMap,o=n.elIdMap,a=Object(L["a"])(e.elements);try{for(a.s();!(t=a.n()).done;){var l=t.value;l.id=o[l.id],l.groupId&&(l.groupId=c[l.groupId])}}catch(d){a.e(d)}finally{a.f()}if(e.animations){var r,i=Object(L["a"])(e.animations);try{for(i.s();!(r=i.n()).done;){var u=r.value;u.id=Object(x["b"])(10),u.elId=o[u.elId]}}catch(d){i.e(d)}finally{i.f()}}return Object(S["a"])(Object(S["a"])({},e),{},{id:Object(x["b"])(10)})}));t.addSlide(n),a()};return{addElementsFromData:l,addSlidesFromData:r}}),it=function(){var e=lt(),t=e.createTextElement,n=rt(),c=n.addElementsFromData,o=n.addSlidesFromData,a=function(e){t({left:0,top:0,width:600,height:50},e)},l=function(e,t){var n=(null===t||void 0===t?void 0:t.onlySlide)||!1,l=(null===t||void 0===t?void 0:t.onlyElements)||!1,r=Pe(e);if("object"===Object(Ke["a"])(r)){var i=r.type,u=r.data;"elements"!==i||n?"slides"!==i||l||o(u):c(u)}else if(!l&&!n){var d=Qe(r);a(d)}};return{pasteTextClipboardData:l}},ut=function(){var e=ie(),t=ae(),n=Object(g["c"])(e),c=n.selectedSlidesIndex,o=n.activeElementIdList,a=Object(g["c"])(t),l=a.currentSlide,r=a.slides,i=a.theme,u=a.slideIndex,d=Object(y["computed"])((function(){return[].concat(Object(Q["a"])(c.value),[u.value])})),s=Object(y["computed"])((function(){return r.value.filter((function(e,t){return d.value.includes(t)}))})),f=Object(y["computed"])((function(){return s.value.map((function(e){return e.id}))})),b=it(),p=b.pasteTextClipboardData,m=rt(),O=m.addSlidesFromData,v=at(),j=v.addHistorySnapshot,h=function(){var n={id:Object(x["b"])(10),elements:[],background:{type:"solid",color:i.value.backgroundColor}};t.updateSlideIndex(0),e.setActiveElementIdList([]),t.setSlides([n])},k=function(n){n===V.UP&&u.value>0?(o.value.length&&e.setActiveElementIdList([]),t.updateSlideIndex(u.value-1)):n===V.DOWN&&u.value0&&void 0!==arguments[0]?arguments[0]:f.value;r.value.length===n.length?h():t.deleteSlide(n),e.updateSelectedSlidesIndex([]),j()},_=function(){var e=Object(Q["a"])(f.value);C(),B(e)},T=function(){var t=Array.from(Array(r.value.length),(function(e,t){return t}));e.setActiveElementIdList([]),e.updateSelectedSlidesIndex(t)};return{resetSlides:h,updateSlideIndex:k,copySlide:C,pasteSlide:N,createSlide:E,createSlideByTemplate:w,copyAndPasteSlide:I,deleteSlide:B,cutSlide:_,selectAllSlide:T}},dt=function(){var e=ie(),t=ae(),n=Object(g["c"])(e),c=n.activeElementIdList,o=Object(g["c"])(t),a=o.currentSlide,l=at(),r=l.addHistorySnapshot,i=function(){var n,o=JSON.parse(JSON.stringify(a.value.elements)),l=Object(L["a"])(o);try{for(l.s();!(n=l.n()).done;){var i=n.value;c.value.includes(i.id)&&(i.lock=!0)}}catch(u){l.e(u)}finally{l.f()}t.updateSlide({elements:o}),e.setActiveElementIdList([]),r()},u=function(n){var c=JSON.parse(JSON.stringify(a.value.elements));if(n.groupId){var o,l=[],i=Object(L["a"])(c);try{for(i.s();!(o=i.n()).done;){var u=o.value;u.groupId===n.groupId&&(u.lock=!1,l.push(u.id))}}catch(b){i.e(b)}finally{i.f()}t.updateSlide({elements:c}),e.setActiveElementIdList(l)}else{var d,s=Object(L["a"])(c);try{for(s.s();!(d=s.n()).done;){var f=d.value;if(f.id===n.id){f.lock=!1;break}}}catch(b){s.e(b)}finally{s.f()}t.updateSlide({elements:c}),e.setActiveElementIdList([n.id])}r()};return{lockElement:i,unlockElement:u}},st=function(){var e=ie(),t=ae(),n=Object(g["c"])(e),c=n.activeElementIdList,o=n.activeGroupElementId,a=Object(g["c"])(t),l=a.currentSlide,r=at(),i=r.addHistorySnapshot,u=function(){if(c.value.length){var n=[];n=o.value?l.value.elements.filter((function(e){return e.id!==o.value})):l.value.elements.filter((function(e){return!c.value.includes(e.id)})),e.setActiveElementIdList([]),t.updateSlide({elements:n}),i()}},d=function(){l.value.elements.length&&(e.setActiveElementIdList([]),t.updateSlide({elements:[]}),i())};return{deleteElement:u,deleteAllElements:d}},ft=function(){var e=ie(),t=ae(),n=Object(g["c"])(e),c=n.activeElementIdList,o=n.activeElementList,a=n.handleElementId,l=Object(g["c"])(t),r=l.currentSlide,i=at(),u=i.addHistorySnapshot,d=Object(y["computed"])((function(){if(o.value.length<2)return!1;var e=o.value[0].groupId;if(!e)return!0;var t=o.value.every((function(t){return(t.groupId&&t.groupId)===e}));return!t})),s=function(){var e;if(o.value.length){var n,a=JSON.parse(JSON.stringify(r.value.elements)),l=Object(x["b"])(10),i=[],d=Object(L["a"])(a);try{for(d.s();!(n=d.n()).done;){var s=n.value;c.value.includes(s.id)&&(s.groupId=l,i.push(s))}}catch(m){d.e(m)}finally{d.f()}var f=a.findIndex((function(e){return e.id===i[i.length-1].id})),b=i.map((function(e){return e.id}));a=a.filter((function(e){return!b.includes(e.id)}));var p=f-i.length+1;(e=a).splice.apply(e,[p,0].concat(i)),t.updateSlide({elements:a}),u()}},f=function(){if(o.value.length){var n=o.value.some((function(e){return e.groupId}));if(n){var l,i=JSON.parse(JSON.stringify(r.value.elements)),d=Object(L["a"])(i);try{for(d.s();!(l=d.n()).done;){var s=l.value;c.value.includes(s.id)&&s.groupId&&delete s.groupId}}catch(b){d.e(b)}finally{d.f()}t.updateSlide({elements:i});var f=a.value?[a.value]:[];e.setActiveElementIdList(f),u()}}};return{canCombine:d,combineElements:s,uncombineElements:f}},bt=function(){var e=ie(),t=Object(g["c"])(e),n=t.activeElementIdList,c=t.activeElementList,o=it(),a=o.pasteTextClipboardData,l=st(),r=l.deleteElement,i=function(){if(n.value.length){var t=ze(JSON.stringify({type:"elements",data:c.value}));Ae(t).then((function(){e.setEditorareaFocus(!0)}))}},u=function(){i(),r()},d=function(){Re().then((function(e){a(e)})).catch((function(e){return Se["a"].warning(e)}))},s=function(){i(),d()};return{copyElement:i,cutElement:u,pasteElement:d,quickCopyElement:s}},pt=function(){var e=ie(),t=Object(g["c"])(ae()),n=t.currentSlide,c=function(){var t=n.value.elements.filter((function(e){return!e.lock})),c=t.map((function(e){return e.id}));e.setActiveElementIdList(c)};return{selectAllElement:c}},mt=function(){var e=ae(),t=Object(g["c"])(ie()),n=t.activeElementIdList,c=t.activeGroupElementId,o=Object(g["c"])(e),a=o.currentSlide,l=at(),r=l.addHistorySnapshot,i=function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,l=[],i=function(e){var n=e.left,c=e.top;switch(t){case V.LEFT:n-=o;break;case V.RIGHT:n+=o;break;case V.UP:c-=o;break;case V.DOWN:c+=o;break;default:break}return Object(S["a"])(Object(S["a"])({},e),{},{left:n,top:c})};l=c.value?a.value.elements.map((function(e){return c.value===e.id?i(e):e})):a.value.elements.map((function(e){return n.value.includes(e.id)?i(e):e})),e.updateSlide({elements:l}),r()};return{moveElement:i}},Ot=function(){var e=ae(),t=Object(g["c"])(e),n=t.currentSlide,c=at(),o=c.addHistorySnapshot,a=function(e,t){return{minLevel:e.findIndex((function(e){return e.id===t[0].id})),maxLevel:e.findIndex((function(e){return e.id===t[t.length-1].id}))}},l=function(e,t){var n=JSON.parse(JSON.stringify(e));if(t.groupId){var c=n.filter((function(e){return e.groupId===t.groupId})),o=a(e,c),l=o.minLevel,r=o.maxLevel;if(r===e.length-1)return;var i=n[r+1],u=n.splice(l,c.length);if(i.groupId){var d=n.filter((function(e){return e.groupId===i.groupId}));n.splice.apply(n,[l+d.length,0].concat(Object(Q["a"])(u)))}else n.splice.apply(n,[l+1,0].concat(Object(Q["a"])(u)))}else{var s=e.findIndex((function(e){return e.id===t.id}));if(s===e.length-1)return;var f=n[s+1],b=n.splice(s,1)[0];if(f.groupId){var p=n.filter((function(e){return e.groupId===f.groupId}));n.splice(s+p.length,0,b)}else n.splice(s+1,0,b)}return n},r=function(e,t){var n=JSON.parse(JSON.stringify(e));if(t.groupId){var c=n.filter((function(e){return e.groupId===t.groupId})),o=a(e,c),l=o.minLevel;if(0===l)return;var r=n[l-1],i=n.splice(l,c.length);if(r.groupId){var u=n.filter((function(e){return e.groupId===r.groupId}));n.splice.apply(n,[l-u.length,0].concat(Object(Q["a"])(i)))}else n.splice.apply(n,[l-1,0].concat(Object(Q["a"])(i)))}else{var d=e.findIndex((function(e){return e.id===t.id}));if(0===d)return;var s=n[d-1],f=n.splice(d,1)[0];if(s.groupId){var b=n.filter((function(e){return e.groupId===s.groupId}));n.splice(d-b.length,0,f)}else n.splice(d-1,0,f)}return n},i=function(e,t){var n=JSON.parse(JSON.stringify(e));if(t.groupId){var c=n.filter((function(e){return e.groupId===t.groupId})),o=a(e,c),l=o.minLevel,r=o.maxLevel;if(r===e.length-1)return null;var i=n.splice(l,c.length);n.push.apply(n,Object(Q["a"])(i))}else{var u=e.findIndex((function(e){return e.id===t.id}));if(u===e.length-1)return null;n.splice(u,1),n.push(t)}return n},u=function(e,t){var n=JSON.parse(JSON.stringify(e));if(t.groupId){var c=n.filter((function(e){return e.groupId===t.groupId})),o=a(e,c),l=o.minLevel;if(0===l)return;var r=n.splice(l,c.length);n.unshift.apply(n,Object(Q["a"])(r))}else{var i=e.findIndex((function(e){return e.id===t.id}));if(0===i)return;n.splice(i,1),n.unshift(t)}return n},d=function(t,c){var a;c===k.UP?a=l(n.value.elements,t):c===k.DOWN?a=r(n.value.elements,t):c===k.TOP?a=i(n.value.elements,t):c===k.BOTTOM&&(a=u(n.value.elements,t)),a&&(e.updateSlide({elements:a}),o())};return{orderElement:d}},vt=function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()},jt=function(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()},ht=function(){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement;return!!e},yt=function(){var e=Ce(),t=ae(),n=function(){vt(),e.setScreening(!0)},c=function(){t.updateSlideIndex(0),n()},o=function(){e.setScreening(!1),ht()&&jt()};return{enterScreening:n,enterScreeningFromStart:c,exitScreening:o}},gt=function(){var e=ie(),t=Object(g["c"])(e),n=t.canvasPercentage,c=t.canvasScale,o=t.canvasDragged,a=Object(y["computed"])((function(){return Math.round(100*c.value)+"%"})),l=function(t){var c=n.value,o=5,a=200,l=30;"+"===t&&c<=a&&(c+=o),"-"===t&&c>=l&&(c-=o),e.setCanvasPercentage(c)},r=function(t){var o=Math.round(t/c.value*n.value)/100;e.setCanvasPercentage(o)},i=function(){e.setCanvasPercentage(90),o&&e.setCanvasDragged(!1)};return{canvasScalePercentage:a,setCanvasScalePercentage:r,scaleCanvas:l,resetCanvas:i}},xt=function(){var e=ie(),t=ke(),n=Object(g["c"])(e),c=n.activeElementIdList,o=n.disableHotkeys,a=n.handleElement,l=n.handleElementId,r=n.editorAreaFocus,i=n.thumbnailsFocus,u=Object(g["c"])(ae()),d=u.currentSlide,s=Object(g["c"])(t),f=s.ctrlKeyState,b=s.shiftKeyState,p=s.spaceKeyState,m=ut(),O=m.updateSlideIndex,v=m.copySlide,j=m.createSlide,h=m.deleteSlide,x=m.cutSlide,C=m.copyAndPasteSlide,N=m.selectAllSlide,E=ft(),w=E.combineElements,I=E.uncombineElements,B=st(),S=B.deleteElement,L=dt(),_=L.lockElement,T=bt(),M=T.copyElement,D=T.cutElement,z=T.quickCopyElement,F=pt(),A=F.selectAllElement,R=mt(),P=R.moveElement,H=Ot(),q=H.orderElement,U=at(),G=U.redo,X=U.undo,Y=yt(),Z=Y.enterScreening,W=Y.enterScreeningFromStart,J=gt(),K=J.scaleCanvas,Q=J.resetCanvas,$=function(){c.value.length?M():i.value&&v()},ee=function(){c.value.length?D():i.value&&x()},te=function(){c.value.length?z():i.value&&C()},ne=function(){r.value&&A(),i.value&&N()},ce=function(){r.value&&_()},oe=function(){r.value&&w()},le=function(){r.value&&I()},re=function(){c.value.length?S():i.value&&h()},ue=function(e){c.value.length?P(e):e!==V.UP&&e!==V.DOWN||O(e)},de=function(e){e===V.PAGEUP?O(V.UP):e===V.PAGEDOWN&&O(V.DOWN)},se=function(e){a.value&&q(a.value,e)},fe=function(){i.value&&j()},be=function(){if(d.value.elements.length)if(l.value){var t=d.value.elements.findIndex((function(e){return e.id===l.value})),n=t>=d.value.elements.length-1?0:t+1,c=d.value.elements[n].id;e.setActiveElementIdList([c])}else{var o=d.value.elements[0];e.setActiveElementIdList([o.id])}},pe=function(n){var c=n.ctrlKey,a=n.shiftKey,l=n.altKey,u=n.metaKey,d=c||u,s=n.key.toUpperCase();if(d&&!f.value&&t.setCtrlKeyState(!0),a&&!b.value&&t.setShiftKeyState(!0),o.value||s!==V.SPACE||t.setSpaceKeyState(!0),d&&s===V.P)return n.preventDefault(),void e.setDialogForExport("pdf");if(a&&s===V.F5)return n.preventDefault(),Z(),void t.setShiftKeyState(!1);if(s===V.F5)return n.preventDefault(),void W();if(r.value||i.value){if(d&&s===V.C){if(o.value)return;n.preventDefault(),$()}if(d&&s===V.X){if(o.value)return;n.preventDefault(),ee()}if(d&&s===V.D){if(o.value)return;n.preventDefault(),te()}if(d&&s===V.Z){if(o.value)return;n.preventDefault(),X()}if(d&&s===V.Y){if(o.value)return;n.preventDefault(),G()}if(d&&s===V.A){if(o.value)return;n.preventDefault(),ne()}if(d&&s===V.L){if(o.value)return;n.preventDefault(),ce()}if(!a&&d&&s===V.G){if(o.value)return;n.preventDefault(),oe()}if(a&&d&&s===V.G){if(o.value)return;n.preventDefault(),le()}if(l&&s===V.F){if(o.value)return;n.preventDefault(),se(k.TOP)}if(l&&s===V.B){if(o.value)return;n.preventDefault(),se(k.BOTTOM)}if(s===V.DELETE||s===V.BACKSPACE){if(o.value)return;n.preventDefault(),re()}if(s===V.UP){if(o.value)return;n.preventDefault(),ue(V.UP)}if(s===V.DOWN){if(o.value)return;n.preventDefault(),ue(V.DOWN)}if(s===V.LEFT){if(o.value)return;n.preventDefault(),ue(V.LEFT)}if(s===V.RIGHT){if(o.value)return;n.preventDefault(),ue(V.RIGHT)}if(s===V.PAGEUP){if(o.value)return;n.preventDefault(),de(V.PAGEUP)}if(s===V.PAGEDOWN){if(o.value)return;n.preventDefault(),de(V.PAGEDOWN)}if(s===V.ENTER){if(o.value)return;n.preventDefault(),fe()}if(s===V.MINUS){if(o.value)return;n.preventDefault(),K("-")}if(s===V.EQUAL){if(o.value)return;n.preventDefault(),K("+")}if(s===V.DIGIT_0){if(o.value)return;n.preventDefault(),Q()}if(s===V.TAB){if(o.value)return;n.preventDefault(),be()}}},me=function(){f.value&&t.setCtrlKeyState(!1),b.value&&t.setShiftKeyState(!1),p.value&&t.setSpaceKeyState(!1)};Object(y["onMounted"])((function(){document.addEventListener("keydown",pe),document.addEventListener("keyup",me),window.addEventListener("blur",me)})),Object(y["onUnmounted"])((function(){document.removeEventListener("keydown",pe),document.removeEventListener("keyup",me),window.removeEventListener("blur",me)}))},kt=function(){var e=Object(g["c"])(ie()),t=e.editorAreaFocus,n=e.thumbnailsFocus,c=e.disableHotkeys,o=it(),a=o.pasteTextClipboardData,l=lt(),r=l.createImageElement,i=function(e){et(e).then((function(e){return r(e)}))},u=function(e){if((t.value||n.value)&&!c.value&&e.clipboardData){var o=e.clipboardData.items,l=o[0];if(l){var r,u=Object(L["a"])(o);try{for(u.s();!(r=u.n()).done;){var d=r.value;if("file"===d.kind&&-1!==d.type.indexOf("image")){var s=d.getAsFile();return void(s&&i(s))}}}catch(f){u.e(f)}finally{u.f()}"string"===l.kind&&"text/plain"===l.type&&l.getAsString((function(e){return a(e)}))}}};Object(y["onMounted"])((function(){document.addEventListener("paste",u)})),Object(y["onUnmounted"])((function(){document.removeEventListener("paste",u)}))},Ct=(n("9911"),n("cc71"),n("21a6")),Nt=n("8f74"),Et=n("e774"),wt=(n("00b4"),["style","script","template"]),Vt=["html","head","body","p","dt","dd","li","option","thead","th","tbody","tr","td","tfoot","colgroup"],It={li:["ul","ol","menu"],dt:["dl"],dd:["dl"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table"],td:["table"]},Bt=["!doctype","area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],St=function(e,t){var n=t-e.position;Lt(e,n)},Lt=function(e,t){e.position=e.position+t},_t=function(e,t){var n=!1;while(!n){var c=e.indexOf("<",t);if(-1===c)return c;var o=e.charAt(c+1);if("/"===o||"!"===o||/[A-Za-z0-9]/.test(o))return c;t=c+1}return-1},Tt=function(e){var t=e.str,n=_t(t,e.position);if(n!==e.position){-1===n&&(n=t.length);var c=t.slice(e.position,n);St(e,n),e.tokens.push({type:"text",content:c})}},Mt=function(e){var t=e.str;Lt(e,4);var n=t.indexOf("--\x3e",e.position),c=n+3;-1===n&&(n=c=t.length);var o=t.slice(e.position,n);St(e,c),e.tokens.push({type:"comment",content:o})},Dt=function(e){var t=e.str,n=t.length,c=e.position;while(c"===o);if(a)break;c++}var l=c+1;while(l"===r);if(!i)break;l++}St(e,l);var u=t.slice(c,l);return e.tokens.push({type:"tag",content:u}),u},zt=function(e){var t=e.str,n=e.tokens,c=e.position,o=null,a=c,l=[],r=t.length;while(c"===i;if(d){c!==a&&l.push(t.slice(a,c));break}var s=/\s/.test(i);if(s)c!==a&&l.push(t.slice(a,c)),a=c+1,c++;else{var f="'"===i||'"'===i;f?(o=i,c++):c++}}}St(e,c);for(var b="attribute",p=0;p1){var j=m+v;n.push({type:b,content:j}),p+=1;continue}var h=l[p+2];if(p+=1,h){var y=m+"="+h;n.push({type:b,content:y}),p+=1;continue}}}if(Object(te["endsWith"])(m,"=")){var g=l[p+1];if(g&&-1===g.indexOf("=")){var x=m+g;n.push({type:b,content:x}),p+=1;continue}var k=m.slice(0,-1);n.push({type:b,content:k})}else n.push({type:b,content:m})}},Ft=function(e,t){var n=t.str,c=t.tokens,o=e.toLowerCase(),a=n.length,l=t.position;while(l=0){var o=t[c].tagName;if(o===e)break;if(n.includes(o))return!0;c--}}return!1},Ut=function(e,t){e.splice(t)},Gt=function e(t){var n=t.stack,c=t.tokens,o=t.cursor,a=n[n.length-1].children,l=c.length;while(o-1)if(n[d].tagName===u){s=!0;break}while(o0){if(u===n[p].tagName){Ut(n,p);var m=p-1;a=n[m].children;break}p-=1}}var O=[],v=void 0;while(o127&&c<2048?(t+=String.fromCharCode(c>>6|192),t+=String.fromCharCode(63&c|128)):(t+=String.fromCharCode(c>>12|224),t+=String.fromCharCode(c>>6&63|128),t+=String.fromCharCode(63&c|128))}return t},on=function(e){var t,n,c,o,a,l,r,i="",u=0;e=cn(e);while(u>2,a=(3&t)<<4|n>>4,l=(15&n)<<2|c>>6,r=63&c,isNaN(n)?l=r=64:isNaN(c)&&(r=64),i=i+tn.charAt(o)+tn.charAt(a)+tn.charAt(l)+tn.charAt(r);return i},an=function(e){var t=new XMLSerializer,n=t.serializeToString(e);return nn+on(n)},ln=function(){var e=ae(),t=Object(g["c"])(e),n=t.slides,c=t.theme,o=t.viewportRatio,a=rt(),l=a.addSlidesFromData,r=Object(y["ref"])(!1),i=function(e,t,n){var c=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];r.value=!0;var o="png"===t?Et["c"]:Et["b"],a=e.querySelectorAll("foreignObject [xmlns]");a.forEach((function(e){return e.removeAttribute("xmlns")})),setTimeout((function(){var a={quality:n,width:1600};c&&(a.fontEmbedCSS=""),o(e,a).then((function(e){r.value=!1,Object(Ct["saveAs"])(e,"pptist_slides.".concat(t))})).catch((function(){r.value=!1,Se["a"].error("导出图片失败")}))}),200)},u=function(e){var t=new Blob([ze(JSON.stringify(e))],{type:""});Object(Ct["saveAs"])(t,"pptist_slides.pptist")},d=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=t[0],o=new FileReader;o.addEventListener("load",(function(){try{var t=JSON.parse(Fe(o.result));n?e.setSlides(t):l(t)}catch(c){Se["a"].error("无法正确读取 / 解析该文件")}})),o.readAsText(c)},s=function(){var e=new Blob([JSON.stringify(n.value)],{type:""});Object(Ct["saveAs"])(e,"pptist_slides.json")},f=function(e){var t=ee()(e),n=t.getAlpha(),c=0===n?"#ffffff":t.setAlpha(1).toHexString();return{alpha:n,color:c}},b=function(e){var t=Jt(e),n=!1,c=0,o=[],a=function e(t){var a,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(L["a"])(t);try{for(r.s();!(a=r.n()).done;){var i=a.value,u="tagName"in i&&["div","li","p"].includes(i.tagName);if(u&&o.length){var d=o[o.length-1];d.options||(d.options={}),d.options.breakLine=!0}var s=Object(S["a"])({},l),b="attributes"in i?i.attributes.find((function(e){return"style"===e.key})):null;if(b&&b.value){var p,m=b.value.split(";"),O=Object(L["a"])(m);try{for(O.s();!(p=O.n()).done;){var v=p.value,j=v.split(": "),h=Object(me["a"])(j,2),y=h[0],g=h[1],x=[Object(te["trim"])(y),Object(te["trim"])(g)],k=x[0],C=x[1];k&&C&&(s[k]=C)}}catch(I){O.e(I)}finally{O.f()}}if("tagName"in i){if("em"===i.tagName&&(s["font-style"]="italic"),"strong"===i.tagName&&(s["font-weight"]="bold"),"sup"===i.tagName&&(s["vertical-align"]="super"),"sub"===i.tagName&&(s["vertical-align"]="sub"),"a"===i.tagName){var N=i.attributes.find((function(e){return"href"===e.key}));s["href"]=(null===N||void 0===N?void 0:N.value)||""}if("ul"===i.tagName&&(s["list-type"]="ul"),"ol"===i.tagName&&(s["list-type"]="ol"),"li"===i.tagName&&(n=!0),"p"===i.tagName&&"attributes"in i){var E=i.attributes.find((function(e){return"data-indent"===e.key}));E&&E.value&&(c=+E.value)}}if("tagName"in i&&"br"===i.tagName)o.push({text:"",options:{breakLine:!0}});else if("content"in i){var w=i.content.replace(/ /g," ").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&").replace(/\n/g,""),V={};s["font-size"]&&(V.fontSize=.75*parseInt(s["font-size"])),s["color"]&&(V.color=f(s["color"]).color),s["background-color"]&&(V.highlight=f(s["background-color"]).color),s["text-decoration-line"]&&(-1!==s["text-decoration-line"].indexOf("underline")&&(V.underline={color:V.color||"#000000",style:"sng"}),-1!==s["text-decoration-line"].indexOf("line-through")&&(V.strike="sngStrike")),s["text-decoration"]&&(-1!==s["text-decoration"].indexOf("underline")&&(V.underline={color:V.color||"#000000",style:"sng"}),-1!==s["text-decoration"].indexOf("line-through")&&(V.strike="sngStrike")),s["vertical-align"]&&("super"===s["vertical-align"]&&(V.superscript=!0),"sub"===s["vertical-align"]&&(V.subscript=!0)),s["text-align"]&&(V.align=s["text-align"]),s["font-weight"]&&(V.bold="bold"===s["font-weight"]),s["font-style"]&&(V.italic="italic"===s["font-style"]),s["font-family"]&&(V.fontFace=s["font-family"]),s["href"]&&(V.hyperlink={url:s["href"]}),n&&"ol"===s["list-type"]&&(V.bullet={type:"number",indent:15},V.paraSpaceBefore=.1,n=!1),n&&"ul"===s["list-type"]&&(V.bullet={indent:15},V.paraSpaceBefore=.1,n=!1),c&&(V.indentLevel=c,c=0),o.push({text:w,options:V})}else"children"in i&&e(i.children,s)}}catch(I){r.e(I)}finally{r.f()}};return a(t),o},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:1,y:1};return e.map((function(e){if(void 0!==e.close)return{close:!0};if("M"===e.type)return{x:e.x/100*t.x,y:e.y/100*t.y,moveTo:!0};if(e.curve){if("cubic"===e.curve.type)return{x:e.x/100*t.x,y:e.y/100*t.y,curve:{type:"cubic",x1:e.curve.x1/100*t.x,y1:e.curve.y1/100*t.y,x2:e.curve.x2/100*t.x,y2:e.curve.y2/100*t.y}};if("quadratic"===e.curve.type)return{x:e.x/100*t.x,y:e.y/100*t.y,curve:{type:"quadratic",x1:e.curve.x1/100*t.x,y1:e.curve.y1/100*t.y}}}return{x:e.x/100*t.x,y:e.y/100*t.y}}))},m=function(e){var t=f(e.color),n=e.h,c=e.v,o=4,a=45;return 0===n&&0===c?(o=4,a=45):0===n?c>0?(o=c,a=90):(o=-c,a=270):0===c?n>0?(o=n,a=1):(o=-n,a=180):n>0&&c>0?(o=Math.max(n,c),a=45):n>0&&c<0?(o=Math.max(n,-c),a=315):n<0&&c>0?(o=Math.max(-n,c),a=135):n<0&&c<0&&(o=Math.max(-n,-c),a=225),{type:"outer",color:t.color.replace("#",""),opacity:t.alpha,blur:.75*e.blur,offset:o,angle:a}},O=function(e){var t=f((null===e||void 0===e?void 0:e.color)||"#000000");return{color:t.color,transparency:100*(1-t.alpha),width:.75*(e.width||1),dashType:"solid"===e.style?"solid":"dash"}},v=function(e){var t=e.type,c=e.target;if("web"===t)return{url:c};if("slide"===t){var o=n.value.findIndex((function(e){return e.id===c}));if(-1!==o)return{slide:o+1}}return null},j=function(e,t){r.value=!0;var n=new Nt["a"];if(.625===o.value?n.layout="LAYOUT_16x10":.75===o.value?n.layout="LAYOUT_4x3":n.layout="LAYOUT_16x9",t){var a=f(c.value.backgroundColor),l=a.color,i=a.alpha;n.defineSlideMaster({title:"PPTIST_MASTER",background:{color:l,transparency:100*(1-i)}})}var u,d=Object(L["a"])(e);try{for(d.s();!(u=d.n()).done;){var s=u.value,j=n.addSlide();if(s.background){var h=s.background;if("image"===h.type&&h.image)j.background={data:h.image};else if("solid"===h.type&&h.color){var y=f(h.color);j.background={color:y.color,transparency:100*(1-y.alpha)}}else if("gradient"===h.type&&h.gradientColor){var g=Object(me["a"])(h.gradientColor,2),x=g[0],k=g[1],C=ee.a.mix(x,k).toHexString(),N=f(C);j.background={color:N.color,transparency:100*(1-N.alpha)}}}if(s.remark&&j.addNotes(s.remark),s.elements){var E,w=Object(L["a"])(s.elements);try{var V=function(){var e=E.value;if("text"===e.type){var t,c=b(e.content),o={x:e.left/100,y:e.top/100,w:e.width/100,h:e.height/100,fontSize:15,fontFace:"微软雅黑",color:"#000000",valign:"top",margin:7.5,paraSpaceBefore:3.75,lineSpacingMultiple:1.2,autoFit:!0};if(e.rotate&&(o.rotate=e.rotate),e.wordSpace&&(o.charSpacing=.75*e.wordSpace),e.lineHeight&&(o.lineSpacingMultiple=e.lineHeight/1.25),e.fill){var a=f(e.fill),l=void 0===e.opacity?1:e.opacity;o.fill={color:a.color,transparency:100*(1-a.alpha*l)}}e.defaultColor&&(o.color=f(e.defaultColor).color),e.defaultFontName&&(o.fontFace=e.defaultFontName),e.shadow&&(o.shadow=m(e.shadow)),null!==(t=e.outline)&&void 0!==t&&t.width&&(o.line=O(e.outline)),void 0!==e.opacity&&(o.transparency=100*(1-e.opacity)),void 0!==e.paragraphSpace&&(o.paraSpaceBefore=.75*e.paragraphSpace),j.addText(c,o)}else if("image"===e.type){var r,i,u={path:e.src,x:e.left/100,y:e.top/100,w:e.width/100,h:e.height/100};if(e.flipH&&(u.flipH=e.flipH),e.flipV&&(u.flipV=e.flipV),e.rotate&&(u.rotate=e.rotate),e.link){var d=v(e.link);d&&(u.hyperlink=d)}if(null!==(r=e.filters)&&void 0!==r&&r.opacity&&(u.transparency=100-parseInt(null===(i=e.filters)||void 0===i?void 0:i.opacity)),e.clip){"ellipse"===e.clip.shape&&(u.rounding=!0);var s=Object(me["a"])(e.clip.range,2),h=s[0],y=s[1],g=Object(me["a"])(h,2),x=g[0],k=g[1],C=Object(me["a"])(y,2),N=C[0],w=C[1],V=e.width/((N-x)/100),I=e.height/((w-k)/100);u.w=V/100,u.h=I/100,u.sizing={type:"crop",x:x/100*V/100,y:k/100*I/100,w:(N-x)/100*V/100,h:(w-k)/100*I/100}}j.addImage(u)}else if("shape"===e.type){if(e.special){var B=document.querySelector(".thumbnail-list .base-element-".concat(e.id," svg")),S=an(B),L={data:S,x:e.left/100,y:e.top/100,w:e.width/100,h:e.height/100};if(e.rotate&&(L.rotate=e.rotate),e.link){var _=v(e.link);_&&(L.hyperlink=_)}j.addImage(L)}else{var T,M={x:e.width/e.viewBox[0],y:e.height/e.viewBox[1]},D=p(en(e.path),M),z=f(e.fill),F=void 0===e.opacity?1:e.opacity,A={x:e.left/100,y:e.top/100,w:e.width/100,h:e.height/100,fill:{color:z.color,transparency:100*(1-z.alpha*F)},points:D};if(e.flipH&&(A.flipH=e.flipH),e.flipV&&(A.flipV=e.flipV),e.shadow&&(A.shadow=m(e.shadow)),null!==(T=e.outline)&&void 0!==T&&T.width&&(A.line=O(e.outline)),e.link){var R=v(e.link);R&&(A.hyperlink=R)}j.addShape("custGeom",A)}if(e.text){var P=b(e.text.content),H={x:e.left/100,y:e.top/100,w:e.width/100,h:e.height/100,fontSize:15,fontFace:"微软雅黑",color:"#000000",paraSpaceBefore:3.75,valign:e.text.align};e.rotate&&(H.rotate=e.rotate),e.text.defaultColor&&(H.color=f(e.text.defaultColor).color),e.text.defaultFontName&&(H.fontFace=e.text.defaultFontName),j.addText(P,H)}}else if("line"===e.type){var q=Je(e),U=p(en(q)),G=Ge(e),X=G.minX,Y=G.maxX,Z=G.minY,W=G.maxY,J=f(e.color),K={x:e.left/100,y:e.top/100,w:(Y-X)/100,h:(W-Z)/100,line:{color:J.color,transparency:100*(1-J.alpha),width:.75*e.width,dashType:"solid"===e.style?"solid":"dash",beginArrowType:e.points[0]?"arrow":"none",endArrowType:e.points[1]?"arrow":"none"},points:U};e.shadow&&(K.shadow=m(e.shadow)),j.addShape("custGeom",K)}else if("chart"===e.type){for(var $=[],te=0;te1||je.rowspan>1)for(var he=pe;hei.value){var r=o*(a.value/100);c.setCanvasScale(r/tt),t.value=(o-r)/2,n.value=(l-r*i.value)/2}else{var u=l*(a.value/100);c.setCanvasScale(u/(tt*i.value)),t.value=(o-u/i.value)/2,n.value=(l-u)/2}}};Object(y["watch"])([a,i],u),Object(y["watch"])(l,(function(){l.value||u()}));var d=Object(y["computed"])((function(){return{width:tt,height:tt*i.value,left:t.value,top:n.value}})),s=new ResizeObserver(u);Object(y["onMounted"])((function(){e.value&&s.observe(e.value)})),Object(y["onUnmounted"])((function(){e.value&&s.unobserve(e.value)}));var f=function(e){var o=!0,a=e.pageX,l=e.pageY,r=t.value,i=n.value;document.onmousemove=function(e){if(o){var c=e.pageX,u=e.pageY;t.value=r+(c-a),n.value=i+(u-l)}},document.onmouseup=function(){o=!1,document.onmousemove=null,document.onmouseup=null,c.setCanvasDragged(!0)}};return{viewportStyles:d,dragViewport:f}},ac=function(e,t){var n=ie(),c=Object(g["c"])(n),o=c.canvasScale,a=Object(y["ref"])(!1),l=Object(y["ref"])(1),r=Object(y["ref"])({top:0,left:0,width:0,height:0}),i=function(c){if(t.value){var i=!0,u=t.value.getBoundingClientRect(),d=5,s=c.pageX,f=c.pageY,b=(s-u.x)/o.value,p=(f-u.y)/o.value;r.value={top:p,left:b,width:0,height:0},a.value=!1,l.value=4,document.onmousemove=function(e){if(i){var t=e.pageX,n=e.pageY,c=(t-s)/o.value,u=(n-f)/o.value,b=Math.abs(c),p=Math.abs(u);if(!(b0&&u>0?m=4:c<0&&u<0?m=1:c>0&&u<0?m=2:c<0&&u>0&&(m=3),r.value=Object(S["a"])(Object(S["a"])({},r.value),{},{width:b,height:p}),a.value=!0,l.value=m}}},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null,i=!1;for(var t=[],c=0;cu&&md&&vu-s&&md-f&&vu&&md-f&&vu-s&&md&&v0&&Math.abs(r-45)<=d?r-=r-45:r<0&&Math.abs(r+45)<=d?r-=r+45:r>0&&Math.abs(r-90)<=d?r-=r-90:r<0&&Math.abs(r+90)<=d?r-=r+90:r>0&&Math.abs(r-135)<=d?r-=r-135:r<0&&Math.abs(r+135)<=d?r-=r+135:r>0&&Math.abs(r-180)<=d?r-=r-180:r<0&&Math.abs(r+180)<=d&&(r-=r+180),e.value=e.value.map((function(e){return c.id===e.id?Object(S["a"])(Object(S["a"])({},e),{},{rotate:r}):e}))}},document.onmouseup=function(){a=!1,document.onmousemove=null,document.onmouseup=null,i!==r&&(n.updateSlide({elements:e.value}),l())}}};return{rotateElement:r}},uc={text:"文本",image:"图片",shape:"形状",line:"线条",chart:"图表",table:"表格",video:"视频",audio:"音频"},dc={text:20,image:20,shape:15,chart:200,table:20,video:250,audio:20},sc=function(e,t){var n=e.left,c=e.top,o=e.width,a=e.height,l=Math.sqrt(Math.pow(o,2)+Math.pow(a,2))/2,r=180*Math.atan(a/o)/Math.PI,i=(180-t-r)*Math.PI/180,u=(r-t)*Math.PI/180,d=(90-t)*Math.PI/180,s=t*Math.PI/180,f=o/2,b=a/2,p=n+f,m=c+b,O={left:p+l*Math.cos(i),top:m-l*Math.sin(i)},v={left:p+b*Math.cos(d),top:m-b*Math.sin(d)},j={left:p+l*Math.cos(u),top:m-l*Math.sin(u)},h={left:p+f*Math.cos(s),top:m+f*Math.sin(s)},y={left:p-l*Math.cos(i),top:m+l*Math.sin(i)},g={left:p-b*Math.sin(s),top:m+b*Math.cos(s)},x={left:p-l*Math.cos(u),top:m+l*Math.sin(u)},k={left:p-f*Math.cos(s),top:m-f*Math.sin(s)};return{leftTopPoint:O,topPoint:v,rightTopPoint:j,rightPoint:h,rightBottomPoint:y,bottomPoint:g,leftBottomPoint:x,leftPoint:k}},fc=function(e,t){var n,c=(n={},Object(pe["a"])(n,E.RIGHT_BOTTOM,t.leftTopPoint),Object(pe["a"])(n,E.LEFT_BOTTOM,t.rightTopPoint),Object(pe["a"])(n,E.LEFT_TOP,t.rightBottomPoint),Object(pe["a"])(n,E.RIGHT_TOP,t.leftBottomPoint),Object(pe["a"])(n,E.TOP,t.bottomPoint),Object(pe["a"])(n,E.BOTTOM,t.topPoint),Object(pe["a"])(n,E.LEFT,t.rightPoint),Object(pe["a"])(n,E.RIGHT,t.leftPoint),n);return c[e]},bc=function(e,t,n){var c=ie(),o=ae(),a=Object(g["c"])(c),l=a.activeElementIdList,r=a.activeGroupElementId,i=Object(g["c"])(o),u=i.viewportRatio,d=Object(g["c"])(ke()),s=d.ctrlOrShiftKeyActive,f=at(),b=f.addHistorySnapshot,p=function(a,i,d){var f=!(a instanceof MouseEvent);if(!f||a.changedTouches&&a.changedTouches[0]){var p=!0;c.setScalingState(!0);var m,O=i.left,v=i.top,j=i.width,h=i.height,y="rotate"in i&&i.rotate?i.rotate:0,g=Math.PI*y/180,x=s.value||"fixedRatio"in i&&i.fixedRatio,k=j/h,C=f?a.changedTouches[0].pageX:a.pageX,N=f?a.changedTouches[0].pageY:a.pageY,w=dc[i.type]||20,V=function(e){return e2&&void 0!==arguments[2])||arguments[2];if(r.value||n.setEditorareaFocus(!0),o.value.includes(i.id)){if(u.value){var s=[];if(i.groupId){var f=[];e.value.forEach((function(e){e.groupId===i.groupId&&f.push(e.id)})),s=o.value.filter((function(e){return!f.includes(e)}))}else s=o.value.filter((function(e){return e!==i.id}));s.length>0&&n.setActiveElementIdList(s)}else if(l.value!==i.id)n.setHandleElementId(i.id);else if(a.value!==i.id){var b=c instanceof MouseEvent?c.pageX:c.changedTouches[0].pageX,p=c instanceof MouseEvent?c.pageY:c.changedTouches[0].pageY;c.target.onmouseup=function(e){var t=e.pageX,c=e.pageY;b===t&&p===c&&(n.setActiveGroupElementId(i.id),e.target.onmouseup=null)}}}else{var m=[];if(m=u.value?[].concat(Object(Q["a"])(o.value),[i.id]):[i.id],i.groupId){var O=[];e.value.forEach((function(e){e.groupId===i.groupId&&O.push(e.id)})),m=[].concat(Object(Q["a"])(m),O)}n.setActiveElementIdList(Object(te["uniq"])(m)),n.setHandleElementId(i.id)}d&&t(c,i)},s=function(){var t=e.value.filter((function(e){return!e.lock})),c=t.map((function(e){return e.id}));n.setActiveElementIdList(c)};return{selectElement:d,selectAllElement:s}},mc=function(e,t,n){var c=ae(),o=Object(g["c"])(ie()),a=o.activeElementIdList,l=o.activeGroupElementId,r=Object(g["c"])(c),i=r.viewportRatio,u=at(),d=u.addHistorySnapshot,s=function(o,r){var u=!(o instanceof MouseEvent);if((!u||o.changedTouches&&o.changedTouches[0])&&a.value.includes(r.id)){var s,f=!0,b=tt,p=tt*i.value,m=5,O=JSON.parse(JSON.stringify(e.value)),v=O.filter((function(e){return a.value.includes(e.id)})),j=r.left,h=r.top,y=r.width,g="height"in r&&r.height?r.height:0,x="rotate"in r&&r.rotate?r.rotate:0,k=u?o.changedTouches[0].pageX:o.pageX,C=u?o.changedTouches[0].pageY:o.pageY,N=null,E=r.id===l.value,w=[],V=[],I=Object(L["a"])(e.value);try{for(I.s();!(s=I.n()).done;){var B=s.value;if("line"!==B.type&&((!E||B.id!==r.id)&&(E||!a.value.includes(B.id)))){var _=void 0,T=void 0,M=void 0,D=void 0;if("rotate"in B&&B.rotate){var z=qe({left:B.left,top:B.top,width:B.width,height:B.height,rotate:B.rotate}),F=z.xRange,A=z.yRange;_=F[0],T=A[0],M=F[1]-F[0],D=A[1]-A[0]}else _=B.left,T=B.top,M=B.width,D=B.height;var R=_+M,P=T+D,H=T+D/2,q=_+M/2,U={value:T,range:[_,R]},G={value:P,range:[_,R]},X={value:H,range:[_,R]},Y={value:_,range:[T,P]},Z={value:R,range:[T,P]},W={value:q,range:[T,P]};w.push(U,G,X),V.push(Y,Z,W)}}}catch(ae){I.e(ae)}finally{I.f()}var J={value:0,range:[0,b]},K={value:p,range:[0,b]},$={value:p/2,range:[0,b]},ee={value:0,range:[0,p]},te={value:b,range:[0,p]},ne={value:b/2,range:[0,p]};w.push(J,K,$),V.push(ee,te,ne),w=Ye(w),V=Ye(V);var ce=function(c){var o=c instanceof MouseEvent?c.pageX:c.changedTouches[0].pageX,l=c instanceof MouseEvent?c.pageY:c.changedTouches[0].pageY;if(!1!==N&&(N=Math.abs(k-o)O&&(X[0]=U-H,Y[0]=0),m>v&&(X[1]=G-q,Y[1]=0),e.value=e.value.map((function(e){if(e.id===o.id){var t=Object(S["a"])(Object(S["a"])({},e),{},{left:H,top:q,start:X,end:Y});return l===w.START||l===w.END?(o.broken&&(t.broken=[(X[0]+Y[0])/2,(X[1]+Y[1])/2]),o.curve&&(t.curve=[(X[0]+Y[0])/2,(X[1]+Y[1])/2]),o.cubic&&(t.cubic=[[(X[0]+Y[0])/2,(X[1]+Y[1])/2],[(X[0]+Y[0])/2,(X[1]+Y[1])/2]])):l===w.C?(o.broken&&(t.broken=[h-H,y-q]),o.curve&&(t.curve=[h-H,y-q])):o.cubic&&(t.cubic=[[N-H,E-q],[V-H,I-q]]),t}return e}))}},document.onmouseup=function(n){r=!1,document.onmousemove=null,document.onmouseup=null;var c=n.pageX,o=n.pageY;u===c&&d===o||(t.updateSlide({elements:e.value}),a())}};return{dragLineElement:l}},vc=function(e,t){var n=ae(),c=at(),o=c.addHistorySnapshot,a=function(c,a){var l=!(c instanceof MouseEvent);if(!l||c.changedTouches&&c.changedTouches[0]){var r=!0,i=l?c.changedTouches[0].pageX:c.pageX,u=l?c.changedTouches[0].pageY:c.pageY,d=nt[a.pathFormula],s=null;if("editable"in d){var f=d.getBaseSize(a.width,a.height),b=f*a.keypoint,p=Object(me["a"])(d.range,2),m=p[0],O=p[1],v=d.relative;s={baseSize:f,originPos:b,min:m,max:O,relative:v}}var j=function(n){if(r){var c=n instanceof MouseEvent?n.pageX:n.changedTouches[0].pageX,o=n instanceof MouseEvent?n.pageY:n.changedTouches[0].pageY,l=(c-i)/t.value,f=(o-u)/t.value;e.value=e.value.map((function(e){if(e.id===a.id&&s){var t=s,n=t.baseSize,c=t.originPos,o=t.min,r=t.max,i=t.relative,u=e,b=0;return"left"===i&&(b=(c+l)/n),"right"===i&&(b=(c-l)/n),"center"===i&&(b=(c-2*l)/n),"top"===i&&(b=(c+f)/n),"bottom"===i&&(b=(c-f)/n),br&&(b=r),Object(S["a"])(Object(S["a"])({},e),{},{keypoint:b,path:d.formula(u.width,u.height,b)})}return e}))}},h=function(t){r=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null;var c=t instanceof MouseEvent?t.pageX:t.changedTouches[0].pageX,a=t instanceof MouseEvent?t.pageY:t.changedTouches[0].pageY;i===c&&u===a||(n.updateSlide({elements:e.value}),o())};l?(document.ontouchmove=j,document.ontouchend=h):(document.onmousemove=j,document.onmouseup=h)}};return{moveShapeKeypoint:a}},jc=function(e){var t=ie(),n=Object(g["c"])(t),c=n.canvasScale,o=n.creatingElement,a=function(t){var n=t.start,o=t.end;if(e.value){var a=e.value.getBoundingClientRect(),l=Object(me["a"])(n,2),r=l[0],i=l[1],u=Object(me["a"])(o,2),d=u[0],s=u[1],f=Math.min(r,d),b=Math.max(r,d),p=Math.min(i,s),m=Math.max(i,s),O=(f-a.x)/c.value,v=(p-a.y)/c.value,j=(b-f)/c.value,h=(m-p)/c.value;return{left:O,top:v,width:j,height:h}}},l=function(t){var n=t.start,o=t.end;if(e.value){var a=e.value.getBoundingClientRect(),l=Object(me["a"])(n,2),r=l[0],i=l[1],u=Object(me["a"])(o,2),d=u[0],s=u[1],f=Math.min(r,d),b=Math.max(r,d),p=Math.min(i,s),m=Math.max(i,s),O=(f-a.x)/c.value,v=(p-a.y)/c.value,j=(b-f)/c.value,h=(m-p)/c.value,y=[r===f?0:j,i===p?0:h],g=[d===f?0:j,s===p?0:h];return{left:O,top:v,start:y,end:g}}},r=lt(),i=r.createTextElement,u=r.createShapeElement,d=r.createLineElement,s=function(e){if(o.value){var n=o.value.type;if("text"===n){var c=a(e);c&&i(c)}else if("shape"===n){var r=a(e);r&&u(r,o.value.data)}else if("line"===n){var s=l(e);s&&d(s,o.value.data)}t.setCreatingElement(null)}};return{insertElementFromCreateSelection:s}},hc=(n("a9e3"),function(){var e=ae(),t=Object(g["c"])(ie()),n=t.activeElementIdList,c=t.activeElementList,o=Object(g["c"])(e),a=o.currentSlide,l=o.viewportRatio,r=at(),i=r.addHistorySnapshot,u=function(t){var o,r=tt,u=tt*l.value,d=Xe(c.value),s=d.minX,f=d.maxX,b=d.minY,p=d.maxY,m=JSON.parse(JSON.stringify(a.value.elements)),O=Object(L["a"])(m);try{for(O.s();!(o=O.n()).done;){var v=o.value;if(n.value.includes(v.id)){if(t===C.CENTER){var j=b+(p-b)/2-u/2,h=s+(f-s)/2-r/2;v.top=v.top-j,v.left=v.left-h}if(t===C.TOP){var y=b-0;v.top=v.top-y}else if(t===C.VERTICAL){var g=b+(p-b)/2-u/2;v.top=v.top-g}else if(t===C.BOTTOM){var x=p-u;v.top=v.top-x}else if(t===C.LEFT){var k=s-0;v.left=v.left-k}else if(t===C.HORIZONTAL){var N=s+(f-s)/2-r/2;v.left=v.left-N}else if(t===C.RIGHT){var E=f-r;v.left=v.left-E}}}}catch(w){O.e(w)}finally{O.f()}e.updateSlide({elements:m}),i()};return{alignElementToCanvas:u}}),yc=function(e){var t=Object(y["computed"])((function(){if(e.value){var t=e.value,n=t.h,c=t.v,o=t.blur,a=t.color;return"".concat(n,"px ").concat(c,"px ").concat(o,"px ").concat(a)}return""}));return{shadowStyle:t}},gc=function(e,t){var n=Object(y["computed"])((function(){var n="";return e.value&&t.value?n="rotateX(180deg) rotateY(180deg)":t.value?n="rotateX(180deg)":e.value&&(n="rotateY(180deg)"),n}));return{flipStyle:n}};(function(e){e["RECT"]="rect",e["ELLIPSE"]="ellipse",e["POLYGON"]="polygon"})(Qn||(Qn={})),function(e){e["RECT"]="rect",e["ROUNDRECT"]="roundRect",e["ELLIPSE"]="ellipse",e["TRIANGLE"]="triangle",e["PENTAGON"]="pentagon",e["RHOMBUS"]="rhombus",e["STAR"]="star"}($n||($n={}));var xc={rect:{name:"矩形",type:Qn.RECT,radius:"0",style:""},rect2:{name:"矩形2",type:Qn.POLYGON,style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 0 100%)",createPath:function(e,t){return"M 0 0 L ".concat(.8*e," 0 L ").concat(e," ").concat(.2*t," L ").concat(e," ").concat(t," L 0 ").concat(t," Z")}},rect3:{name:"矩形3",type:Qn.POLYGON,style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 20% 100%, 0% 80%)",createPath:function(e,t){return"M 0 0 L ".concat(.8*e," 0 L ").concat(e," ").concat(.2*t," L ").concat(e," ").concat(t," L ").concat(.2*e," ").concat(t," L 0 ").concat(.8*t," Z")}},roundRect:{name:"圆角矩形",type:Qn.RECT,radius:"10%",style:"inset(0 0 0 0 round 10% 10% 10% 10%)"},ellipse:{name:"圆形",type:Qn.ELLIPSE,style:"ellipse(50% 50% at 50% 50%)"},triangle:{name:"三角形",type:Qn.POLYGON,style:"polygon(50% 0%, 0% 100%, 100% 100%)",createPath:function(e,t){return"M ".concat(.5*e," 0 L 0 ").concat(t," L ").concat(e," ").concat(t," Z")}},triangle2:{name:"三角形2",type:Qn.POLYGON,style:"polygon(50% 100%, 0% 0%, 100% 0%)",createPath:function(e,t){return"M ".concat(.5*e," ").concat(t," L 0 0 L ").concat(e," 0 Z")}},triangle3:{name:"三角形3",type:Qn.POLYGON,style:"polygon(0% 0%, 0% 100%, 100% 100%)",createPath:function(e,t){return"M 0 0 L 0 ".concat(t," L ").concat(e," ").concat(t," Z")}},rhombus:{name:"菱形",type:Qn.POLYGON,style:"polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)",createPath:function(e,t){return"M ".concat(.5*e," 0 L ").concat(e," ").concat(.5*t," L ").concat(.5*e," ").concat(t," L 0 ").concat(.5*t," Z")}},hexagon:{name:"六边形",type:Qn.POLYGON,style:"polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%)",createPath:function(e,t){return"M ".concat(.2*e," 0 L ").concat(.8*e," 0 L ").concat(e," ").concat(.5*t," L ").concat(.8*e," ").concat(t," L ").concat(.2*e," ").concat(t," L 0 ").concat(.5*t," Z")}},pentagon:{name:"五边形",type:Qn.POLYGON,style:"polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)",createPath:function(e,t){return"M ".concat(.5*e," 0 L ").concat(e," ").concat(.38*t," L ").concat(.82*e," ").concat(t," L ").concat(.18*e," ").concat(t," L 0 ").concat(.38*t," Z")}},parallelogram:{name:"平行四边形",type:Qn.POLYGON,style:"polygon(30% 0%, 100% 0%, 70% 100%, 0% 100%)",createPath:function(e,t){return"M ".concat(.3*e," 0 L ").concat(e," 0 L ").concat(.7*e," ").concat(t," L 0 ").concat(t," Z")}},parallelogram2:{name:"平行四边形2",type:Qn.POLYGON,style:"polygon(30% 100%, 100% 100%, 70% 0%, 0% 0%)",createPath:function(e,t){return"M ".concat(.3*e," ").concat(t," L ").concat(e," ").concat(t," L ").concat(.7*e," 0 L 0 0 Z")}},trapezoid:{name:"梯形",type:Qn.POLYGON,style:"polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)",createPath:function(e,t){return"M ".concat(.25*e," 0 L ").concat(.75*e," 0 L ").concat(e," ").concat(t," L 0 ").concat(t," Z")}},trapezoid2:{name:"梯形2",type:Qn.POLYGON,style:"polygon(0% 0%, 100% 0%, 75% 100%, 25% 100%)",createPath:function(e,t){return"M 0 0 L ".concat(e," 0 L ").concat(.75*e," ").concat(t," L ").concat(.25*e," ").concat(t," Z")}}},kc=function(e){var t=Object(y["computed"])((function(){if(!e.value)return xc.rect;var t=e.value.shape||Qn.RECT;return xc[t]})),n=Object(y["computed"])((function(){if(!e.value)return{top:"0",left:"0",width:"100%",height:"100%"};var t=Object(me["a"])(e.value.range,2),n=t[0],c=t[1],o=(c[0]-n[0])/100,a=(c[1]-n[1])/100,l=n[0]/o,r=n[1]/a;return{left:-l+"%",top:-r+"%",width:100/o+"%",height:100/a+"%"}}));return{clipShape:t,imgPosition:n}},Cc=(n("b64b"),function(e){var t=Object(y["computed"])((function(){if(!e.value)return"";for(var t="",n=0,c=Object.keys(e.value);n45&&c.rotate<135&&(d=(u-o)/a.value/c.width*100,s=-(i-n)/a.value/c.height*100),(c.rotate>=135&&c.rotate<=180||c.rotate>=-180&&c.rotate<=-135)&&(d=-d,s=-s),c.rotate>-135&&c.rotate<-45&&(d=-(u-o)/a.value/c.width*100,s=(i-n)/a.value/c.height*100);var f=r.left+d,b=r.top+s;f<0?f=0:f+r.width>l.width&&(f=l.width-r.width),b<0?b=0:b+r.height>l.height&&(b=l.height-r.height),p.value=Object(S["a"])(Object(S["a"])({},p.value),{},{left:f,top:b})}},document.onmouseup=function(){t=!1,document.onmousemove=null,document.onmouseup=null,x(),setTimeout((function(){u.value=!1}),0)}},C=function(e,t){u.value=!0;var n=!0,o=50/c.width*100,l=50/c.height*100,i=e.pageX,d=e.pageY,s=f.value,b=Object(S["a"])({},p.value),m=p.value.width/p.value.height;document.onmousemove=function(e){if(n){var u,f,O,v,j=e.pageX,h=e.pageY,y=(j-i)/a.value/c.width*100,g=(h-d)/a.value/c.height*100;c.rotate>45&&c.rotate<135&&(y=(h-d)/a.value/c.width*100,g=-(j-i)/a.value/c.height*100),(c.rotate>=135&&c.rotate<=180||c.rotate>=-180&&c.rotate<=-135)&&(y=-y,g=-g),c.rotate>-135&&c.rotate<-45&&(y=-(h-d)/a.value/c.width*100,g=(j-i)/a.value/c.height*100),r.value&&(t!==E.RIGHT_BOTTOM&&t!==E.LEFT_TOP||(g=y/m),t!==E.LEFT_BOTTOM&&t!==E.RIGHT_TOP||(g=-y/m)),t===E.LEFT_TOP?(b.left+y<0&&(y=-b.left),b.top+g<0&&(g=-b.top),b.width-ys.width&&(y=s.width-(b.left+b.width)),b.top+g<0&&(g=-b.top),b.width+ys.height&&(g=s.height-(b.top+b.height)),b.width-ys.width&&(y=s.width-(b.left+b.width)),b.top+b.height+g>s.height&&(g=s.height-(b.top+b.height)),b.width+ys.height&&(g=s.height-(b.top+b.height)),b.height+gs.width&&(y=s.width-(b.left+b.width)),b.width+y-22.5&&t<=22.5?e+0:t>22.5&&t<=67.5?e+45:t>67.5&&t<=112.5?e+90:t>112.5&&t<=157.5?e+135:t>157.5||t<=-157.5?e+0:t>-157.5&&t<=-112.5?e+45:t>-112.5&&t<=-67.5?e+90:t>-67.5&&t<=-22.5?e+135:e+0})),w=[E.LEFT_TOP,E.RIGHT_TOP,E.LEFT_BOTTOM,E.RIGHT_BOTTOM],I=[E.TOP,E.BOTTOM,E.LEFT,E.RIGHT];return function(t,n){var c=Object(y["resolveDirective"])("click-outside");return Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"image-clip-handler",style:Object(y["normalizeStyle"])(i.value)},[Object(y["createElementVNode"])("img",{class:"bottom-img",src:e.src,draggable:!1,alt:"",style:Object(y["normalizeStyle"])(Object(y["unref"])(b))},null,12,Xc),Object(y["createElementVNode"])("div",{class:"top-image-content",style:Object(y["normalizeStyle"])(Object(S["a"])(Object(S["a"])({},Object(y["unref"])(m)),{},{clipPath:e.clipPath}))},[Object(y["createElementVNode"])("img",{class:"top-img",src:e.src,draggable:!1,alt:"",style:Object(y["normalizeStyle"])(Object(y["unref"])(O))},null,12,Yc)],4),Object(y["createElementVNode"])("div",{class:"operate",style:Object(y["normalizeStyle"])(Object(y["unref"])(m)),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(e){return k(e)}),["stop"]))},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(w,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["clip-point",e,Object(y["unref"])(N)]),key:e,onMousedown:Object(y["withModifiers"])((function(t){return C(t,e)}),["stop"])},Jc,42,Zc)})),64)),(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(I,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["clip-point",e,Object(y["unref"])(N)]),key:e,onMousedown:Object(y["withModifiers"])((function(t){return C(t,e)}),["stop"])},$c,42,Kc)})),64))],36)],4)),[[c,j]])}}});n("5970");const to=pn()(eo,[["__scopeId","data-v-3e0199ec"]]);var no=to,co=["src"],oo=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=ie(),c=ae(),o=Object(g["c"])(n),a=o.clipingImageElementId,l=Object(y["computed"])((function(){return a.value===t.elementInfo.id})),r=at(),i=r.addHistorySnapshot,u=Object(y["computed"])((function(){return t.elementInfo.shadow})),d=yc(u),s=d.shadowStyle,f=Object(y["computed"])((function(){return t.elementInfo.flipH})),b=Object(y["computed"])((function(){return t.elementInfo.flipV})),p=gc(f,b),m=p.flipStyle,O=Object(y["computed"])((function(){return t.elementInfo.clip})),v=kc(O),j=v.clipShape,h=v.imgPosition,x=Object(y["computed"])((function(){return t.elementInfo.filters})),k=Cc(x),C=k.filter,N=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))},E=function(e){if(n.setClipingImageElementId(""),e){var o=e.range,a=e.position,l=t.elementInfo.clip||{shape:"rect",range:[[0,0],[100,100]]},r=t.elementInfo.left+a.left,u=t.elementInfo.top+a.top,d=t.elementInfo.width+a.width,s=t.elementInfo.height+a.height,f=0,b=0;if(t.elementInfo.rotate){var p=r+d/2-(t.elementInfo.left+t.elementInfo.width/2),m=-(u+s/2-(t.elementInfo.top+t.elementInfo.height/2)),O=-t.elementInfo.rotate*Math.PI/180,v=p*Math.cos(O)-m*Math.sin(O),j=p*Math.sin(O)+m*Math.cos(O);f=v-p,b=-(j-m)}var h={clip:Object(S["a"])(Object(S["a"])({},l),{},{range:o}),left:r+f,top:u+b,width:d,height:s};c.updateElement({id:t.elementInfo.id,props:h}),i()}};return function(t,n){var c=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-image",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["unref"])(l)?(Object(y["openBlock"])(),Object(y["createBlock"])(no,{key:0,src:e.elementInfo.src,clipData:e.elementInfo.clip,width:e.elementInfo.width,height:e.elementInfo.height,top:e.elementInfo.top,left:e.elementInfo.left,rotate:e.elementInfo.rotate,clipPath:Object(y["unref"])(j).style,onClip:n[0]||(n[0]=function(e){return E(e)})},null,8,["src","clipData","width","height","top","left","rotate","clipPath"])):Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:1,class:"element-content",style:Object(y["normalizeStyle"])({filter:Object(y["unref"])(s)?"drop-shadow(".concat(Object(y["unref"])(s),")"):"",transform:Object(y["unref"])(m)}),onMousedown:n[2]||(n[2]=function(e){return N(e)}),onTouchstart:n[3]||(n[3]=function(e){return N(e)})},[Object(y["createVNode"])(Uc,{elementInfo:e.elementInfo},null,8,["elementInfo"]),Object(y["createElementVNode"])("div",{class:"image-content",style:Object(y["normalizeStyle"])({clipPath:Object(y["unref"])(j).style})},[Object(y["createElementVNode"])("img",{src:e.elementInfo.src,draggable:!1,style:Object(y["normalizeStyle"])({top:Object(y["unref"])(h).top,left:Object(y["unref"])(h).left,width:Object(y["unref"])(h).width,height:Object(y["unref"])(h).height,filter:Object(y["unref"])(C)}),onDragstart:n[1]||(n[1]=Object(y["withModifiers"])((function(){}),["prevent"])),alt:""},null,44,co)],4)],36)),[[c,e.contextmenus]])],4)],6)}}});n("7394");const ao=pn()(oo,[["__scopeId","data-v-30dc7050"]]);var lo=ao,ro=["width","height"],io=["d","stroke","stroke-width","stroke-dasharray"],uo=Object(y["defineComponent"])({__name:"ElementOutline",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},outline:{type:Object}},setup:function(e){var t=e,n=Nc(Object(y["toRef"])(t,"outline")),c=n.outlineWidth,o=n.outlineStyle,a=n.outlineColor;return function(t,n){return e.outline?(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{key:0,class:"element-outline",overflow:"visible",width:e.width,height:e.height},[Object(y["createElementVNode"])("path",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",d:"M0,0 L".concat(e.width,",0 L").concat(e.width,",").concat(e.height," L0,").concat(e.height," Z"),stroke:Object(y["unref"])(a),"stroke-width":Object(y["unref"])(c),"stroke-dasharray":"dashed"===Object(y["unref"])(o)?"10 6":"0 0"},null,8,io)],8,ro)):Object(y["createCommentVNode"])("",!0)}}});n("4731");const so=pn()(uo,[["__scopeId","data-v-61b7d06a"]]);var fo,bo=so,po=n("5313"),mo=n("576a"),Oo=n("304a"),vo=n("7f06"),jo=n("8726"),ho=n("23f1"),yo=n("1a16"),go=n("665f"),xo=n("f95e"),ko=function(e){var t={},n=function(e,n){return t[e]=n};return n("Alt-ArrowUp",_["c"]),n("Alt-ArrowDown",_["b"]),n("Ctrl-z",jo["c"]),n("Ctrl-y",jo["b"]),n("Backspace",xo["f"]),n("Escape",_["e"]),n("Ctrl-b",Object(_["f"])(e.marks.strong)),n("Ctrl-i",Object(_["f"])(e.marks.em)),n("Ctrl-u",Object(_["f"])(e.marks.underline)),n("Ctrl-d",Object(_["f"])(e.marks.strikethrough)),n("Enter",Object(go["f"])(e.nodes.list_item)),n("Mod-[",Object(go["b"])(e.nodes.list_item)),n("Mod-]",Object(go["e"])(e.nodes.list_item)),t},Co=function(e){return Object(xo["g"])(/^\s*>\s$/,e)},No=function(e){return Object(xo["g"])(/^(\d+)\.\s$/,e,(function(e){return{order:+e[1]}}),(function(e,t){return t.childCount+t.attrs.order===+e[1]}))},Eo=function(e){return Object(xo["g"])(/^\s*([-+*])\s$/,e)},wo=function(e){return Object(xo["e"])(/^```$/,e)},Vo=function(e){var t=[].concat(Object(Q["a"])(xo["d"]),[xo["a"],xo["b"]]);return t.push(Co(e.nodes.blockquote)),t.push(No(e.nodes.ordered_list)),t.push(Eo(e.nodes.bullet_list)),t.push(wo(e.nodes.code_block)),Object(xo["c"])({rules:t})},Io=function(e){return[Vo(e),Object(vo["b"])(ko(e)),Object(vo["b"])(_["a"]),Object(ho["a"])(),Object(yo["a"])(),Object(jo["a"])()]},Bo=n("15fd"),So=n("2210"),Lo=Object(S["a"])(Object(S["a"])({},go["d"]),{},{content:"list_item+",group:"block"}),_o=Object(S["a"])(Object(S["a"])({},go["a"]),{},{content:"list_item+",group:"block"}),To=Object(S["a"])(Object(S["a"])({},go["c"]),{},{content:"paragraph block*",group:"block"}),Mo={attrs:{align:{default:""},indent:{default:0}},content:"inline*",group:"block",parseDOM:[{tag:"p",getAttrs:function(e){var t=e.style.textAlign,n=e.getAttribute("align")||t||"";n=/(left|right|center|justify)/.test(n)?n:"";var c=+(e.getAttribute("data-indent")||0);return{align:n,indent:c}}}],toDOM:function(e){var t=e.attrs,n=t.align,c=t.indent,o="";n&&"left"!==n&&(o+="text-align: ".concat(n,";"));var a={style:o};return c&&(a["data-indent"]=c),["p",a,0]}},Do=(So["b"].hard_break,Object(Bo["a"])(So["b"],["hard_break"])),zo=Object(S["a"])(Object(S["a"])({},Do),{},{ordered_list:Lo,bullet_list:_o,list_item:To,paragraph:Mo}),Fo={excludes:"subscript",parseDOM:[{tag:"sub"},{style:"vertical-align",getAttrs:function(e){return"sub"===e&&null}}],toDOM:function(){return["sub",0]}},Ao={excludes:"superscript",parseDOM:[{tag:"sup"},{style:"vertical-align",getAttrs:function(e){return"super"===e&&null}}],toDOM:function(){return["sup",0]}},Ro={parseDOM:[{tag:"strike"},{style:"text-decoration",getAttrs:function(e){return"line-through"===e&&null}},{style:"text-decoration-line",getAttrs:function(e){return"line-through"===e&&null}}],toDOM:function(){return["span",{style:"text-decoration-line: line-through"},0]}},Po={parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:function(e){return"underline"===e&&null}},{style:"text-decoration-line",getAttrs:function(e){return"underline"===e&&null}}],toDOM:function(){return["span",{style:"text-decoration: underline"},0]}},Ho={attrs:{color:{}},inline:!0,group:"inline",parseDOM:[{style:"color",getAttrs:function(e){return e?{color:e}:{}}}],toDOM:function(e){var t=e.attrs.color,n="";return t&&(n+="color: ".concat(t,";")),["span",{style:n},0]}},qo={attrs:{backcolor:{}},inline:!0,group:"inline",parseDOM:[{style:"background-color",getAttrs:function(e){return e?{backcolor:e}:{}}}],toDOM:function(e){var t=e.attrs.backcolor,n="";return t&&(n+="background-color: ".concat(t,";")),["span",{style:n},0]}},Uo={attrs:{fontsize:{}},inline:!0,group:"inline",parseDOM:[{style:"font-size",getAttrs:function(e){return e?{fontsize:e}:{}}}],toDOM:function(e){var t=e.attrs.fontsize,n="";return t&&(n+="font-size: ".concat(t)),["span",{style:n},0]}},Go={attrs:{fontname:{}},inline:!0,group:"inline",parseDOM:[{style:"font-family",getAttrs:function(e){return{fontname:e&&"string"===typeof e?e.replace(/[\"\']/g,""):""}}}],toDOM:function(e){var t=e.attrs.fontname,n="";return t&&(n+="font-family: ".concat(t)),["span",{style:n},0]}},Xo={attrs:{href:{},title:{default:null},target:{default:"_blank"}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function(e){var t=e.getAttribute("href"),n=e.getAttribute("title");return{href:t,title:n}}}],toDOM:function(e){return["a",e.attrs,0]}},Yo=Object(S["a"])(Object(S["a"])({},So["a"]),{},{subscript:Fo,superscript:Ao,strikethrough:Ro,underline:Po,forecolor:Ho,backcolor:qo,fontsize:Uo,fontname:Go,link:Xo}),Zo=zo,Wo=Yo,Jo=new Oo["i"]({nodes:Zo,marks:Wo}),Ko=function(e){var t="
".concat(e,"
"),n=new window.DOMParser,c=n.parseFromString(t,"text/html").body.firstElementChild;return Oo["a"].fromSchema(Jo).parse(c)},Qo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new mo["c"](e,Object(S["a"])({state:po["b"].create({doc:Ko(t),plugins:Io(Jo)})},n))},$o=n("1344");(function(e){e["RICH_TEXT_COMMAND"]="RICH_TEXT_COMMAND",e["OPEN_CHART_DATA_EDITOR"]="OPEN_CHART_DATA_EDITOR",e["OPEN_LATEX_EDITOR"]="OPEN_LATEX_EDITOR"})(fo||(fo={}));var ea=Object($o["a"])(),ta=ea,na=(n("6062"),function(e,t,n){var c=e,o=c.selection,a=c.doc;if(!o||!a)return e;var l=o.from,r=o.to,i=t.nodes,u=i.blockquote,d=i.list_item,s=i.paragraph,f=[];n=n||"";var b=new Set([u,d,s]);return a.nodesBetween(l,r,(function(e,t){var c=e.type,o=e.attrs.align||"";return o!==n&&b.has(c)&&f.push({node:e,pos:t,nodeType:c}),!0})),f.length?(f.forEach((function(t){var c=t.node,o=t.pos,a=t.nodeType,l=c.attrs;l=n?Object(S["a"])(Object(S["a"])({},l),{},{align:n}):Object(S["a"])(Object(S["a"])({},l),{},{align:null}),e=e.setNodeMarkup(o,a,l,c.marks)})),e):e}),ca=function(e,t){var n=e.state,c=n.schema,o=n.selection,a=na(n.tr.setSelection(o),c,t);e.dispatch(a)},oa=function(e,t){return e.type===t.nodes.bullet_list||e.type===t.nodes.ordered_list},aa=function(e,t){return function(n,c){var o=n.schema,a=n.selection,l=a.$from,r=a.$to,i=l.blockRange(r);if(!i)return!1;var u=A((function(e){return oa(e,o)}))(a);if(i.depth>=1&&u&&i.depth-u.depth<=1){if(u.node.type===e)return Object(go["b"])(t)(n,c);if(oa(u.node,o)&&e.validContent(u.node.content)){var d=n.tr;return d.setNodeMarkup(u.pos,e),c&&c(d),!1}}return Object(go["g"])(e)(n,c)}};function la(e,t,n){if(!e.doc)return e;var c=e.doc.nodeAt(t);if(!c)return e;var o=0,a=7,l=(c.attrs.indent||0)+n;if(la&&(l=a),l===c.attrs.indent)return e;var r=Object(S["a"])(Object(S["a"])({},c.attrs),{},{indent:l});return e.setNodeMarkup(t,c.type,r,c.marks)}var ra=function(e,t,n){var c=e,o=c.selection,a=c.doc;if(!o||!a)return e;if(!(o instanceof po["g"]||o instanceof po["a"]))return e;var l=o.from,r=o.to;return a.nodesBetween(l,r,(function(c,o){var a=c.type;return"paragraph"===a.name||"blockquote"===a.name?(e=la(e,o,n),!1):!oa(c,t)})),e},ia=function(e,t){var n=e.state,c=n.schema,o=n.selection,a=ra(n.tr.setSelection(o),c,t);return!!a.docChanged&&(e.dispatch(a),!0)},ua=Object(y["defineComponent"])({__name:"ProsemirrorEditor",props:{elementId:{type:String,required:!0},defaultColor:{type:String,required:!0},defaultFontName:{type:String,required:!0},editable:{type:Boolean,default:!1},value:{type:String,required:!0},autoFocus:{type:Boolean,default:!1}},emits:["update","focus","blur"],setup:function(e,t){var n,c=t.expose,o=t.emit,a=e,l=ie(),r=Object(g["c"])(l),i=r.handleElementId,u=Object(y["ref"])(),d=Object(te["debounce"])((function(){o("update",n.dom.innerHTML)}),300,{trailing:!0}),s=function(){l.setDisableHotkeysState(!0),o("focus")},f=function(){l.setDisableHotkeysState(!1),o("blur")},b=Object(te["debounce"])((function(){var e=Z(n,{color:a.defaultColor,fontname:a.defaultFontName});l.setRichtextAttrs(e)}),30,{trailing:!0}),p=function(){d(),b()},m=Object(y["computed"])((function(){return a.value}));Object(y["watch"])(m,(function(){if(n&&!n.hasFocus()){var e=n.state,t=e.doc,c=e.tr;n.dispatch(c.replaceRangeWith(0,t.content.size,Ko(m.value)))}})),Object(y["watch"])((function(){return a.editable}),(function(){n.setProps({editable:function(){return a.editable}})})),Object(y["onMounted"])((function(){n=Qo(u.value,m.value,{handleDOMEvents:{focus:s,blur:f,keydown:p,click:b},editable:function(){return a.editable}}),a.autoFocus&&n.focus()})),Object(y["onUnmounted"])((function(){n&&n.destroy()}));var O=function(){return n.focus()};c({focus:O});var v=function(e){var t=e.target,c=e.action;if((t||i.value===a.elementId)&&(!t||t===a.elementId)){var o,l="command"in c?[c]:c,r=Object(L["a"])(l);try{for(r.s();!(o=r.n()).done;){var u=o.value;if("fontname"===u.command&&u.value){var s=n.state.schema.marks.fontname.create({fontname:u.value});T(n),M(n,s)}else if("fontsize"===u.command&&u.value){var f=n.state.schema.marks.fontsize.create({fontsize:u.value});T(n),M(n,f)}else if("fontsize-add"===u.command){var p=u.value?+u.value:2;T(n);var m=W(n)+p+"px",O=n.state.schema.marks.fontsize.create({fontsize:m});M(n,O)}else if("fontsize-reduce"===u.command){var v=u.value?+u.value:2;T(n);var j=W(n)-v;j<12&&(j=12);var h=n.state.schema.marks.fontsize.create({fontsize:j+"px"});M(n,h)}else if("color"===u.command&&u.value){var y=n.state.schema.marks.forecolor.create({color:u.value});T(n),M(n,y)}else if("backcolor"===u.command&&u.value){var g=n.state.schema.marks.backcolor.create({backcolor:u.value});T(n),M(n,g)}else if("bold"===u.command)T(n),Object(_["f"])(n.state.schema.marks.strong)(n.state,n.dispatch);else if("em"===u.command)T(n),Object(_["f"])(n.state.schema.marks.em)(n.state,n.dispatch);else if("underline"===u.command)T(n),Object(_["f"])(n.state.schema.marks.underline)(n.state,n.dispatch);else if("strikethrough"===u.command)T(n),Object(_["f"])(n.state.schema.marks.strikethrough)(n.state,n.dispatch);else if("subscript"===u.command)Object(_["f"])(n.state.schema.marks.subscript)(n.state,n.dispatch);else if("superscript"===u.command)Object(_["f"])(n.state.schema.marks.superscript)(n.state,n.dispatch);else if("blockquote"===u.command)Object(_["g"])(n.state.schema.nodes.blockquote)(n.state,n.dispatch);else if("code"===u.command)Object(_["f"])(n.state.schema.marks.code)(n.state,n.dispatch);else if("align"===u.command&&u.value)ca(n,u.value);else if("indent"===u.command&&u.value)ia(n,+u.value);else if("bulletList"===u.command){var x=n.state.schema.nodes,k=x.bullet_list,C=x.list_item;aa(k,C)(n.state,n.dispatch)}else if("orderedList"===u.command){var N=n.state.schema.nodes,E=N.ordered_list,w=N.list_item;aa(E,w)(n.state,n.dispatch)}else if("clear"===u.command){T(n);var V=n.state.selection,I=V.$from,B=V.$to;n.dispatch(n.state.tr.removeMark(I.pos,B.pos))}else if("link"===u.command){var S=n.state.schema.marks.link,z=n.state.selection,F=z.from,A=z.to,R=D(n.state.doc,F,A,S);if(R)if(u.value){var P=n.state.schema.marks.link.create({href:u.value,title:u.value});M(n,P,{from:R.from.pos,to:R.to.pos+1})}else n.dispatch(n.state.tr.removeMark(R.from.pos,R.to.pos+1,S));else if(G(n.state,S))if(u.value){var H=n.state.schema.marks.link.create({href:u.value,title:u.value});M(n,H)}else Object(_["f"])(S)(n.state,n.dispatch);else u.value&&(T(n),Object(_["f"])(S,{href:u.value,title:u.value})(n.state,n.dispatch))}else"insert"===u.command&&u.value&&n.dispatch(n.state.tr.insertText(u.value))}}catch(q){r.e(q)}finally{r.f()}n.focus(),d(),b()}};return ta.on(fo.RICH_TEXT_COMMAND,v),Object(y["onUnmounted"])((function(){ta.off(fo.RICH_TEXT_COMMAND,v)})),function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"prosemirror-editor",ref_key:"editorViewRef",ref:u},null,512)}}});n("a511");const da=pn()(ua,[["__scopeId","data-v-1debd6ff"]]);var sa=da,fa=function(e){return Object(y["pushScopeId"])("data-v-7135a611"),e=e(),Object(y["popScopeId"])(),e},ba=fa((function(){return Object(y["createElementVNode"])("div",{class:"drag-handler top"},null,-1)})),pa=fa((function(){return Object(y["createElementVNode"])("div",{class:"drag-handler bottom"},null,-1)})),ma=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=ie(),c=ae(),o=Object(g["c"])(n),a=o.handleElementId,l=o.isScaling,r=at(),i=r.addHistorySnapshot,u=Object(y["ref"])(),d=Object(y["computed"])((function(){return t.elementInfo.shadow})),s=yc(d),f=s.shadowStyle,b=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo,n))},p=Object(y["ref"])(-1);Object(y["watch"])(l,(function(){a.value===t.elementInfo.id&&(l.value||-1===p.value||(c.updateElement({id:t.elementInfo.id,props:{height:p.value}}),p.value=-1))}));var m=function(e){var n=e[0].contentRect;if(u.value){var o=n.height;t.elementInfo.height!==o&&(l.value?p.value=o:c.updateElement({id:t.elementInfo.id,props:{height:o}}))}},O=new ResizeObserver(m);Object(y["onMounted"])((function(){u.value&&O.observe(u.value)})),Object(y["onUnmounted"])((function(){u.value&&O.unobserve(u.value)}));var v=function(e){c.updateElement({id:t.elementInfo.id,props:{content:e}}),i()},j=function(){var e=t.elementInfo.content.replaceAll(/<[^>]+>/g,"");e||c.deleteElement(t.elementInfo.id)},h=Object(y["computed"])((function(){return a.value===t.elementInfo.id}));return Object(y["watch"])(h,(function(){h.value||j()})),function(t,n){var c=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-text",{lock:e.elementInfo.lock}]),ref_key:"elementRef",ref:u,style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",style:Object(y["normalizeStyle"])({backgroundColor:e.elementInfo.fill,opacity:e.elementInfo.opacity,textShadow:Object(y["unref"])(f),lineHeight:e.elementInfo.lineHeight,letterSpacing:(e.elementInfo.wordSpace||0)+"px",color:e.elementInfo.defaultColor,fontFamily:e.elementInfo.defaultFontName}),onMousedown:n[3]||(n[3]=function(e){return b(e)}),onTouchstart:n[4]||(n[4]=function(e){return b(e)})},[Object(y["createVNode"])(bo,{width:e.elementInfo.width,height:e.elementInfo.height,outline:e.elementInfo.outline},null,8,["width","height","outline"]),Object(y["createVNode"])(sa,{class:"text",elementId:e.elementInfo.id,defaultColor:e.elementInfo.defaultColor,defaultFontName:e.elementInfo.defaultFontName,editable:!e.elementInfo.lock,value:e.elementInfo.content,style:Object(y["normalizeStyle"])({"--textIndent":"".concat(e.elementInfo.textIndent||0,"px"),"--paragraphSpace":"".concat(void 0===e.elementInfo.paragraphSpace?5:e.elementInfo.paragraphSpace,"px")}),onUpdate:n[0]||(n[0]=function(e){return v(e)}),onMousedown:n[1]||(n[1]=function(e){return b(e,!1)}),onTouchstart:n[2]||(n[2]=function(e){return b(e)})},null,8,["elementId","defaultColor","defaultFontName","editable","value","style"]),ba,pa],36)),[[c,e.contextmenus]])],4)],6)}}});n("59bb");const Oa=pn()(ma,[["__scopeId","data-v-7135a611"]]);var va=Oa,ja=["id","gradientTransform"],ha=["stop-color"],ya=["stop-color"],ga=["id"],xa=["stop-color"],ka=["stop-color"],Ca=Object(y["defineComponent"])({__name:"GradientDefs",props:{id:{type:String,required:!0},type:{type:String},color1:{type:String,required:!0},color2:{type:String,required:!0},rotate:{type:Number,default:0}},setup:function(e){return function(t,n){return"linear"===e.type?(Object(y["openBlock"])(),Object(y["createElementBlock"])("linearGradient",{key:0,id:e.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientTransform:"rotate(".concat(e.rotate,",0.5,0.5)")},[Object(y["createElementVNode"])("stop",{offset:"0%","stop-color":e.color1},null,8,ha),Object(y["createElementVNode"])("stop",{offset:"100%","stop-color":e.color2},null,8,ya)],8,ja)):(Object(y["openBlock"])(),Object(y["createElementBlock"])("radialGradient",{key:1,id:e.id},[Object(y["createElementVNode"])("stop",{offset:"0%","stop-color":e.color1},null,8,xa),Object(y["createElementVNode"])("stop",{offset:"100%","stop-color":e.color2},null,8,ka)],8,ga))}}});const Na=Ca;var Ea=Na,wa=["width","height"],Va={key:0},Ia=["transform"],Ba=["d","fill","stroke","stroke-width","stroke-dasharray"],Sa=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=ie(),c=ae(),o=Object(g["c"])(n),a=o.handleElementId,l=at(),r=l.addHistorySnapshot,i=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo,n))},u=Object(y["computed"])((function(){return t.elementInfo.outline})),d=Nc(u),s=d.outlineWidth,f=d.outlineStyle,b=d.outlineColor,p=Object(y["computed"])((function(){return t.elementInfo.shadow})),m=yc(p),O=m.shadowStyle,v=Object(y["computed"])((function(){return t.elementInfo.flipH})),j=Object(y["computed"])((function(){return t.elementInfo.flipV})),h=gc(v,j),x=h.flipStyle,k=Object(y["ref"])(!1);Object(y["watch"])(a,(function(){a.value!==t.elementInfo.id&&k.value&&(k.value=!1)}));var C=Object(y["computed"])((function(){var e={content:"",defaultFontName:"微软雅黑",defaultColor:"#000",align:"middle"};return t.elementInfo.text?t.elementInfo.text:e})),N=function(e){var n=Object(S["a"])(Object(S["a"])({},C.value),{},{content:e});c.updateElement({id:t.elementInfo.id,props:{text:n}}),r()},E=function(){if(t.elementInfo.text){var e=t.elementInfo.text.content.replaceAll(/<[^>]+>/g,"");e||(c.removeElementProps({id:t.elementInfo.id,propName:"text"}),r())}},w=Object(y["ref"])(),V=function(){k.value=!0,Object(y["nextTick"])((function(){return w.value&&w.value.focus()}))};return function(t,n){var c=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-shape",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",style:Object(y["normalizeStyle"])({opacity:e.elementInfo.opacity,filter:Object(y["unref"])(O)?"drop-shadow(".concat(Object(y["unref"])(O),")"):"",transform:Object(y["unref"])(x),color:Object(y["unref"])(C).defaultColor,fontFamily:Object(y["unref"])(C).defaultFontName}),onMousedown:n[4]||(n[4]=function(e){return i(e)}),onTouchstart:n[5]||(n[5]=function(e){return i(e)}),onDblclick:n[6]||(n[6]=function(e){return V()})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{overflow:"visible",width:e.elementInfo.width,height:e.elementInfo.height},[e.elementInfo.gradient?(Object(y["openBlock"])(),Object(y["createElementBlock"])("defs",Va,[Object(y["createVNode"])(Ea,{id:"editabel-gradient-".concat(e.elementInfo.id),type:e.elementInfo.gradient.type,color1:e.elementInfo.gradient.color[0],color2:e.elementInfo.gradient.color[1],rotate:e.elementInfo.gradient.rotate},null,8,["id","type","color1","color2","rotate"])])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("g",{transform:"scale(".concat(e.elementInfo.width/e.elementInfo.viewBox[0],", ").concat(e.elementInfo.height/e.elementInfo.viewBox[1],") translate(0,0) matrix(1,0,0,1,0,0)")},[Object(y["createElementVNode"])("path",{class:"shape-path","vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",d:e.elementInfo.path,fill:e.elementInfo.gradient?"url(#editabel-gradient-".concat(e.elementInfo.id,")"):e.elementInfo.fill,stroke:Object(y["unref"])(b),"stroke-width":Object(y["unref"])(s),"stroke-dasharray":"dashed"===Object(y["unref"])(f)?"10 6":"0 0"},null,8,Ba)],8,Ia)],8,wa)),Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["shape-text",[Object(y["unref"])(C).align,{editable:k.value||Object(y["unref"])(C).content}]])},[k.value||Object(y["unref"])(C).content?(Object(y["openBlock"])(),Object(y["createBlock"])(sa,{key:0,ref_key:"prosemirrorEditorRef",ref:w,elementId:e.elementInfo.id,defaultColor:Object(y["unref"])(C).defaultColor,defaultFontName:Object(y["unref"])(C).defaultFontName,editable:!e.elementInfo.lock,value:Object(y["unref"])(C).content,onUpdate:n[0]||(n[0]=function(e){return N(e)}),onBlur:n[1]||(n[1]=function(e){return E()}),onMousedown:n[2]||(n[2]=function(e){return i(e,!1)}),onTouchstart:n[3]||(n[3]=function(e){return i(e,!1)})},null,8,["elementId","defaultColor","defaultFontName","editable","value"])):Object(y["createCommentVNode"])("",!0)],2)],36)),[[c,e.contextmenus]])],4)],6)}}});n("990c");const La=pn()(Sa,[["__scopeId","data-v-d4c718fa"]]);var _a=La,Ta=["id","markerWidth","markerHeight","refX","refY"],Ma=["d","fill","transform"],Da=Object(y["defineComponent"])({__name:"LinePointMarker",props:{id:{type:String,required:!0},position:{type:String,required:!0},type:{type:String,required:!0},color:{type:String},baseSize:{type:Number,required:!0}},setup:function(e){var t=e,n={dot:"m0 5a5 5 0 1 0 10 0a5 5 0 1 0 -10 0z",arrow:"M0,0 L10,5 0,10 Z"},c={"arrow-start":180,"arrow-end":0},o=Object(y["computed"])((function(){return n[t.type]})),a=Object(y["computed"])((function(){return c["".concat(t.type,"-").concat(t.position)]||0})),l=Object(y["computed"])((function(){return t.baseSize<2?2:t.baseSize}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("marker",{id:"".concat(e.id,"-").concat(e.type,"-").concat(e.position),markerUnits:"userSpaceOnUse",orient:"auto",markerWidth:3*Object(y["unref"])(l),markerHeight:3*Object(y["unref"])(l),refX:1.5*Object(y["unref"])(l),refY:1.5*Object(y["unref"])(l)},[Object(y["createElementVNode"])("path",{d:Object(y["unref"])(o),fill:e.color,transform:"scale(".concat(.3*Object(y["unref"])(l),", ").concat(.3*Object(y["unref"])(l),") rotate(").concat(Object(y["unref"])(a),", 5, 5)")},null,8,Ma)],8,Ta)}}});const za=Da;var Fa=za,Aa=["width","height"],Ra=["d","stroke","stroke-width","stroke-dasharray","marker-start","marker-end"],Pa=["d"],Ha=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))},c=Object(y["computed"])((function(){return t.elementInfo.shadow})),o=yc(c),a=o.shadowStyle,l=Object(y["computed"])((function(){var e=Math.abs(t.elementInfo.start[0]-t.elementInfo.end[0]);return e<24?24:e})),r=Object(y["computed"])((function(){var e=Math.abs(t.elementInfo.start[1]-t.elementInfo.end[1]);return e<24?24:e})),i=Object(y["computed"])((function(){return"dashed"===t.elementInfo.style?"10 6":"0 0"})),u=Object(y["computed"])((function(){return Je(t.elementInfo)}));return function(t,c){var o=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-shape",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px"})},[Object(y["createElementVNode"])("div",{class:"element-content",style:Object(y["normalizeStyle"])({filter:Object(y["unref"])(a)?"drop-shadow(".concat(Object(y["unref"])(a),")"):""}),onMousedown:c[0]||(c[0]=function(e){return n(e)}),onTouchstart:c[1]||(c[1]=function(e){return n(e)})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{overflow:"visible",width:Object(y["unref"])(l),height:Object(y["unref"])(r)},[Object(y["createElementVNode"])("defs",null,[e.elementInfo.points[0]?(Object(y["openBlock"])(),Object(y["createBlock"])(Fa,{key:0,id:e.elementInfo.id,position:"start",type:e.elementInfo.points[0],color:e.elementInfo.color,baseSize:e.elementInfo.width},null,8,["id","type","color","baseSize"])):Object(y["createCommentVNode"])("",!0),e.elementInfo.points[1]?(Object(y["openBlock"])(),Object(y["createBlock"])(Fa,{key:1,id:e.elementInfo.id,position:"end",type:e.elementInfo.points[1],color:e.elementInfo.color,baseSize:e.elementInfo.width},null,8,["id","type","color","baseSize"])):Object(y["createCommentVNode"])("",!0)]),Object(y["createElementVNode"])("path",{class:"line-point",d:Object(y["unref"])(u),stroke:e.elementInfo.color,"stroke-width":e.elementInfo.width,"stroke-dasharray":Object(y["unref"])(i),fill:"none","marker-start":e.elementInfo.points[0]?"url(#".concat(e.elementInfo.id,"-").concat(e.elementInfo.points[0],"-start)"):"","marker-end":e.elementInfo.points[1]?"url(#".concat(e.elementInfo.id,"-").concat(e.elementInfo.points[1],"-end)"):""},null,8,Ra),Object(y["withDirectives"])(Object(y["createElementVNode"])("path",{class:"line-path",d:Object(y["unref"])(u),stroke:"transparent","stroke-width":"20",fill:"none"},null,8,Pa),[[o,e.contextmenus]])],8,Aa))],36)],6)}}});n("bde5");const qa=pn()(Ha,[["__scopeId","data-v-6550e504"]]);var Ua=qa,Ga=n("ba48"),Xa=n.n(Ga),Ya=(n("aa97"),Object(y["defineComponent"])({__name:"Chart",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},type:{type:String,required:!0},data:{type:Object,required:!0},options:{type:Object},themeColor:{type:Array,required:!0},legends:{type:Array,required:!0},gridColor:{type:String},legend:{type:String}},setup:function(e){var t,n=e,c=Object(y["ref"])(),o=Object(y["inject"])(tc)||Object(y["ref"])(1),a=Object(y["computed"])((function(){return n.legend?n.height-20:n.height})),l=function(){var e=n.options||{},t=Object(S["a"])(Object(S["a"])({},e),{},{width:n.width*o.value,height:a.value*o.value}),c="pie"===n.type?Object(S["a"])(Object(S["a"])({},n.data),{},{series:n.data.series[0]}):n.data;return{data:c,options:t}},r=function(){if(c.value){var e=Object(te["upperFirst"])(n.type),o=l(),a=o.data,r=o.options;t=new Xa.a[e](c.value,a,r)}},i=function(){if(t){var e=l(),n=e.data,c=e.options;t.update(n,c)}else r()};Object(y["watch"])([function(){return n.width},function(){return n.height},function(){return n.data},function(){return n.options},o],i),Object(y["onMounted"])(r);var u=Object(y["computed"])((function(){var e=[];if(n.themeColor.length>=10)e=n.themeColor;else if(1===n.themeColor.length)e=ee()(n.themeColor[0]).analogous(10).map((function(e){return e.toHexString()}));else{var t=n.themeColor.length,c=ee()(n.themeColor[t-1]).analogous(11-t).map((function(e){return e.toHexString()}));e=[].concat(Object(Q["a"])(n.themeColor.slice(0,t-1)),Object(Q["a"])(c))}return e})),d=function(){if(c.value)for(var e=0;e<10;e++)c.value.style.setProperty("--theme-color-".concat(e+1),u.value[e])};Object(y["watch"])(u,d),Object(y["onMounted"])(d);var s=function(){c.value&&n.gridColor&&c.value.style.setProperty("--grid-color",n.gridColor)};return Object(y["watch"])((function(){return n.gridColor}),s),Object(y["onMounted"])(s),function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"chart",style:Object(y["normalizeStyle"])({flexDirection:"top"===e.legend?"column-reverse":"column"})},[Object(y["createElementVNode"])("div",{class:"chart-content",ref_key:"chartRef",ref:c,style:Object(y["normalizeStyle"])({width:e.width+"px",height:Object(y["unref"])(a)+"px",transform:"scale(".concat(1/Object(y["unref"])(o),")")})},null,4),e.legend?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"legends",style:Object(y["normalizeStyle"])({transform:"scale(".concat(1/Object(y["unref"])(o),")")})},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e.legends,(function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"legend",key:n,style:Object(y["normalizeStyle"])({color:e.gridColor})},[Object(y["createElementVNode"])("div",{class:"block",style:Object(y["normalizeStyle"])({backgroundColor:Object(y["unref"])(u)[n]})},null,4),Object(y["createTextVNode"])(" "+Object(y["toDisplayString"])(t),1)],4)})),128))],4)):Object(y["createCommentVNode"])("",!0)],4)}}}));n("921b"),n("f630");const Za=pn()(Ya,[["__scopeId","data-v-1aa2357d"]]);var Wa=Za,Ja=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))},c=function(){ta.emit(fo.OPEN_CHART_DATA_EDITOR)};return function(t,o){var a=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-chart",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",style:Object(y["normalizeStyle"])({backgroundColor:e.elementInfo.fill}),onMousedown:o[0]||(o[0]=function(e){return n(e)}),onTouchstart:o[1]||(o[1]=function(e){return n(e)}),onDblclick:o[2]||(o[2]=function(e){return c()})},[Object(y["createVNode"])(bo,{width:e.elementInfo.width,height:e.elementInfo.height,outline:e.elementInfo.outline},null,8,["width","height","outline"]),Object(y["createVNode"])(Wa,{width:e.elementInfo.width,height:e.elementInfo.height,type:e.elementInfo.chartType,data:e.elementInfo.data,options:e.elementInfo.options,themeColor:e.elementInfo.themeColor,gridColor:e.elementInfo.gridColor,legends:e.elementInfo.data.legends,legend:e.elementInfo.legend||""},null,8,["width","height","type","data","options","themeColor","gridColor","legends","legend"])],36)),[[a,e.contextmenus]])],4)],6)}}});n("8216");const Ka=pn()(Ja,[["__scopeId","data-v-f3c03862"]]);var Qa=Ka,$a=function(e){if(!e)return{};var t=e.bold,n=e.em,c=e.underline,o=e.strikethrough,a=e.color,l=e.backcolor,r=e.fontsize,i=e.fontname,u=e.align,d="".concat(c?"underline":""," ").concat(o?"line-through":"");return" "===d&&(d="none"),{fontWeight:t?"bold":"normal",fontStyle:n?"italic":"normal",textDecoration:d,color:a||"#000",backgroundColor:l||"",fontSize:r||"14px",fontFamily:i||"微软雅黑",textAlign:u||"left"}},el=function(e){return e.replace(/\n/g,"
").replace(/ /g," ")},tl=function(e){var t=Object(y["computed"])((function(){for(var t=[],n=0;n1||a.rowspan>1)for(var l=n;l=d&&p<=f&&O>=s&&O<=b&&l.push("".concat(p,"_").concat(O));return l}));Object(y["watch"])(k,(function(e,t){Object(te["isEqual"])(e,t)||n("changeSelectedCells",k.value)}));var C=Object(y["computed"])((function(){return k.value.length>1?null:k.value[0]})),N=(Object(y["computed"])((function(){if(!r.value.length)return null;var e=Object(me["a"])(r.value,2),t=e[0],n=e[1];if(!i.value.length)return{row:[t,t],col:[n,n]};var c=Object(me["a"])(i.value,2),o=c[0],a=c[1];if(t===o&&n===a)return{row:[t,t],col:[n,n]};var l=Math.min(t,o),u=Math.min(n,a),d=Math.max(t,o),s=Math.max(n,a);return{row:[l,d],col:[u,s]}})),function(){return l.value=!1}),E=function(e,t,n){0===e.button&&(i.value=[],l.value=!0,r.value=[t,n])},w=function(e,t){l.value&&(i.value=[e,t])};Object(y["onMounted"])((function(){document.addEventListener("mouseup",N)})),Object(y["onUnmounted"])((function(){document.removeEventListener("mouseup",N)}));var I=function(e,t){return h.value.includes("".concat(e,"_").concat(t))},B=function(e){var t=u.value.length-1;r.value=[0,e],i.value=[t,e]},L=function(e){var t=u.value[e].length-1;r.value=[e,0],i.value=[e,t]},_=function(){var e=u.value.length-1,t=u.value[e].length-1;r.value=[0,0],i.value=[e,t]},T=function(e){for(var t=JSON.parse(JSON.stringify(u.value)),n=u.value[e],c=[],o=0;o=0;i--)if(!I(i,r)){t[i][r].rowspan=t[i][r].rowspan-1;break}t.splice(e,1),u.value=t},M=function(e){for(var t=JSON.parse(JSON.stringify(u.value)),c=[],o=0;o=0;i--)if(!I(r,i)){t[r][i].colspan=t[r][i].colspan-1;break}u.value=t.map((function(t){return t.splice(e,1),t})),b.value.splice(e,1),n("changeColWidths",b.value)},D=function(e){for(var t=JSON.parse(JSON.stringify(u.value)),n=[],c=0;cu.value.length&&(l=t+o-u.value.length),c+a>u.value[0].length&&(r=c+a-u.value[0].length),(l||r)&&F(l,r),Object(y["nextTick"])((function(){for(var l=0;l1,n=e[0].length>1;return{canDeleteRow:t,canDeleteCol:n}},W=function(e,t){var n=k.value.length>1,c=u.value[e][t],o=n,a=!n&&(c.rowspan>1||c.colspan>1);return{canMerge:o,canSplit:a}},J=function(e){var t=e.dataset.cellIndex,n=+t.split("_")[0],c=+t.split("_")[1];k.value.includes("".concat(n,"_").concat(c))||(r.value=[n,c],i.value=[]);var o=W(n,c),a=o.canMerge,l=o.canSplit,u=Z(),d=u.canDeleteRow,s=u.canDeleteCol;return[{text:"插入列",children:[{text:"到左侧",handler:function(){return z(c)}},{text:"到右侧",handler:function(){return z(c+1)}}]},{text:"插入行",children:[{text:"到上方",handler:function(){return D(n)}},{text:"到下方",handler:function(){return D(n+1)}}]},{text:"删除列",disable:!s,handler:function(){return M(c)}},{text:"删除行",disable:!d,handler:function(){return T(n)}},{divider:!0},{text:"合并单元格",disable:!a,handler:A},{text:"取消合并单元格",disable:!l,handler:function(){return R(n,c)}},{divider:!0},{text:"选中当前列",handler:function(){return B(c)}},{text:"选中当前行",handler:function(){return L(n)}},{text:"选中全部单元格",handler:_}]};return function(t,n){var c,o,a,l,r,i=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"editable-table",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(p)+"px"})},[e.editable?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",rl,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(O),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"drag-line",key:t,style:Object(y["normalizeStyle"])({left:e+"px"}),onMousedown:function(e){return P(e,t)}},null,44,il)})),128))])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("table",{class:Object(y["normalizeClass"])({theme:Object(y["unref"])(d),"row-header":null===(c=Object(y["unref"])(d))||void 0===c?void 0:c.rowHeader,"row-footer":null===(o=Object(y["unref"])(d))||void 0===o?void 0:o.rowFooter,"col-header":null===(a=Object(y["unref"])(d))||void 0===a?void 0:a.colHeader,"col-footer":null===(l=Object(y["unref"])(d))||void 0===l?void 0:l.colFooter}),style:Object(y["normalizeStyle"])("--themeColor: ".concat(null===(r=Object(y["unref"])(d))||void 0===r?void 0:r.color,"; --subThemeColor1: ").concat(Object(y["unref"])(f)[0],"; --subThemeColor2: ").concat(Object(y["unref"])(f)[1]))},[Object(y["createElementVNode"])("colgroup",null,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(b.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("col",{span:"1",key:t,width:e},null,8,ul)})),128))]),Object(y["createElementVNode"])("tbody",null,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(u),(function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("tr",{key:n},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(t,(function(t,c){return Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("td",{class:Object(y["normalizeClass"])(["cell",{selected:Object(y["unref"])(k).includes("".concat(n,"_").concat(c))&&Object(y["unref"])(k).length>1,active:Object(y["unref"])(C)==="".concat(n,"_").concat(c)}]),style:Object(y["normalizeStyle"])(Object(S["a"])({borderStyle:e.outline.style,borderColor:e.outline.color,borderWidth:e.outline.width+"px"},Object(y["unref"])($a)(t.style))),key:t.id,rowspan:t.rowspan,colspan:t.colspan,"data-cell-index":"".concat(n,"_").concat(c),onMousedown:function(e){return E(e,n,c)},onMouseenter:function(e){return w(n,c)}},[Object(y["unref"])(C)==="".concat(n,"_").concat(c)?(Object(y["openBlock"])(),Object(y["createBlock"])(ll,{key:0,class:Object(y["normalizeClass"])(["cell-text",{active:Object(y["unref"])(C)==="".concat(n,"_").concat(c)}]),value:t.text,onUpdateValue:function(e){return Object(y["unref"])(G)(e,n,c)},onInsertExcelData:function(e){return X(e,n,c)}},null,8,["class","value","onUpdateValue","onInsertExcelData"])):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:1,class:"cell-text",innerHTML:Object(y["unref"])(el)(t.text)},null,8,sl))],46,dl)),[[y["vShow"],!Object(y["unref"])(h).includes("".concat(n,"_").concat(c))],[i,function(e){return J(e)}]])})),128))])})),128))])],6)],4)}}});n("bc8c");const bl=pn()(fl,[["__scopeId","data-v-bae8c794"]]);var pl=bl,ml={class:"element-content"},Ol=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=ie(),c=ae(),o=Object(g["c"])(n),a=o.canvasScale,l=o.handleElementId,r=o.isScaling,i=Object(y["ref"])(),u=at(),d=u.addHistorySnapshot,s=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))},f=Object(y["ref"])(!1);Object(y["watch"])(l,(function(){l.value!==t.elementInfo.id&&(f.value=!1)})),Object(y["watch"])(f,(function(){n.setDisableHotkeysState(f.value)}));var b=function(){t.elementInfo.lock||(f.value=!0)},p=Object(y["ref"])(-1);Object(y["watch"])(r,(function(){l.value===t.elementInfo.id&&(r.value&&(f.value=!1),r.value||-1===p.value||(c.updateElement({id:t.elementInfo.id,props:{height:p.value}}),p.value=-1))}));var m=function(e){var n=e[0].contentRect;if(i.value){var o=n.height;t.elementInfo.height!==o&&(r.value?p.value=o:c.updateElement({id:t.elementInfo.id,props:{height:o}}))}},O=new ResizeObserver(m);Object(y["onMounted"])((function(){i.value&&O.observe(i.value)})),Object(y["onUnmounted"])((function(){i.value&&O.unobserve(i.value)}));var v=function(e){c.updateElement({id:t.elementInfo.id,props:{data:e}}),d()},j=function(e){var n=e.reduce((function(e,t){return e+t})),o=e.map((function(e){return e/n}));c.updateElement({id:t.elementInfo.id,props:{width:n,colWidths:o}}),d()},h=function(e){Object(y["nextTick"])((function(){return n.setSelectedTableCells(e)}))};return function(t,n){var c=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-table",{lock:e.elementInfo.lock}]),ref_key:"elementRef",ref:i,style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ml,[Object(y["createVNode"])(pl,{onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(){}),["stop"])),data:e.elementInfo.data,width:e.elementInfo.width,colWidths:e.elementInfo.colWidths,outline:e.elementInfo.outline,theme:e.elementInfo.theme,editable:f.value,onChange:n[1]||(n[1]=function(e){return v(e)}),onChangeColWidths:n[2]||(n[2]=function(e){return j(e)}),onChangeSelectedCells:n[3]||(n[3]=function(e){return h(e)})},null,8,["data","width","colWidths","outline","theme","editable"]),!f.value||e.elementInfo.lock?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:Object(y["normalizeClass"])(["table-mask",{lock:e.elementInfo.lock}]),onDblclick:n[4]||(n[4]=function(e){return b()}),onMousedown:n[5]||(n[5]=function(e){return s(e)}),onTouchstart:n[6]||(n[6]=function(e){return s(e)})},[Object(y["createElementVNode"])("div",{class:"mask-tip",style:Object(y["normalizeStyle"])({transform:"scale(".concat(1/Object(y["unref"])(a),")")})},"双击编辑",4)],34)):Object(y["createCommentVNode"])("",!0)])),[[c,e.contextmenus]])],4)],6)}}});n("76c1");const vl=pn()(Ol,[["__scopeId","data-v-6391c486"]]);var jl=vl,hl=["width","height","stroke","stroke-width"],yl=["transform"],gl=["d"],xl=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))},c=function(){ta.emit(fo.OPEN_LATEX_EDITOR)};return function(t,o){var a=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-latex",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",onMousedown:o[0]||(o[0]=function(e){return n(e)}),onTouchstart:o[1]||(o[1]=function(e){return n(e)}),onDblclick:o[2]||(o[2]=function(e){return c()})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{overflow:"visible",width:e.elementInfo.width,height:e.elementInfo.height,stroke:e.elementInfo.color,"stroke-width":e.elementInfo.strokeWidth,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[Object(y["createElementVNode"])("g",{transform:"scale(".concat(e.elementInfo.width/e.elementInfo.viewBox[0],", ").concat(e.elementInfo.height/e.elementInfo.viewBox[1],") translate(0,0) matrix(1,0,0,1,0,0)")},[Object(y["createElementVNode"])("path",{d:e.elementInfo.path},null,8,gl)],8,yl)],8,hl))],32)),[[a,e.contextmenus]])],4)],6)}}});n("0f64");const kl=pn()(xl,[["__scopeId","data-v-31390388"]]);var Cl=kl,Nl=function(e,t){Object(y["onMounted"])((function(){if(t.value){var n="normal";if(/m3u8(#|\?|$)/i.exec(e)?n="hls":/.flv(#|\?|$)/i.exec(e)&&(n="flv"),t.value&&"hls"===n&&(t.value.canPlayType("application/x-mpegURL")||t.value.canPlayType("application/vnd.apple.mpegURL"))&&(n="normal"),"hls"===n){var c=window.Hls;if(c&&c.isSupported()){var o=new c;o.loadSource(e),o.attachMedia(t.value)}}else if("flv"===n){var a=window.flvjs;if(a&&a.isSupported()){var l=a.createPlayer({type:"flv",url:e});l.attachMediaElement(t.value),l.load()}}}}))},El=function(e){return Object(y["pushScopeId"])("data-v-2fc4c202"),e=e(),Object(y["popScopeId"])(),e},wl=["src","poster"],Vl={class:"bezel"},Il=El((function(){return Object(y["createElementVNode"])("div",{class:"controller-mask"},null,-1)})),Bl={class:"controller"},Sl={class:"icons icons-left"},Ll={class:"icon-content"},_l={class:"volume"},Tl={class:"icon-content"},Ml=El((function(){return Object(y["createElementVNode"])("span",{class:"thumb"},null,-1)})),Dl=[Ml],zl={class:"time"},Fl={class:"ptime"},Al=Object(y["createTextVNode"])(" / "),Rl={class:"dtime"},Pl={class:"icons icons-right"},Hl={class:"speed"},ql={class:"icon speed-icon"},Ul=["onClick"],Gl=El((function(){return Object(y["createElementVNode"])("span",{class:"icon-content"},"循环",-1)})),Xl=[Gl],Yl={class:"bar"},Zl=El((function(){return Object(y["createElementVNode"])("span",{class:"thumb"},null,-1)})),Wl=[Zl],Jl=Object(y["defineComponent"])({__name:"index",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},src:{type:String,required:!0},poster:{type:String,default:""},scale:{type:Number,default:1}},setup:function(e){var t=e,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0===e||isNaN(e))return"00:00";var t=function(e){return e<10?"0"+e:""+e},n=Math.floor(e/3600),c=Math.floor((e-3600*n)/60),o=Math.floor(e-3600*n-60*c);return(n>0?[n,c,o]:[c,o]).map(t).join(":")},c=function(e){return e.getBoundingClientRect().left},o=Object(y["ref"])(),a=Object(y["ref"])(),l=Object(y["ref"])(),r=Object(y["ref"])(.5),i=Object(y["ref"])(!0),u=Object(y["ref"])(0),d=Object(y["ref"])(0),s=Object(y["ref"])(0),f=Object(y["ref"])(!1),b=Object(y["ref"])(!1),p=Object(y["ref"])(1),m=Object(y["ref"])(!1),O=Object(y["ref"])("00:00"),v=Object(y["ref"])("0"),j=Object(y["computed"])((function(){return n(u.value)})),h=Object(y["computed"])((function(){return n(d.value)})),g=Object(y["computed"])((function(){return u.value/d.value*100+"%"})),x=Object(y["computed"])((function(){return s.value/d.value*100+"%"})),k=Object(y["computed"])((function(){return 100*r.value+"%"})),C=Object(y["ref"])(!1),N=[{label:"2x",value:2},{label:"1.5x",value:1.5},{label:"1.25x",value:1.25},{label:"1x",value:1},{label:"0.75x",value:.75},{label:"0.5x",value:.5}],E=function(e){o.value&&(e=Math.max(e,0),e=Math.min(e,d.value),o.value.currentTime=e,u.value=e)},w=function(){o.value&&(i.value=!1,o.value.play(),b.value=!0)},V=function(){o.value&&(i.value=!0,o.value.pause(),b.value=!0)},I=function(){i.value?w():V()},B=function(e){o.value&&(e=Math.max(e,0),e=Math.min(e,1),o.value.volume=e,r.value=e,o.value.muted&&0!==e&&(o.value.muted=!1))},S=function(e){o.value&&(o.value.playbackRate=e),p.value=e},L=function(){var e;d.value=(null===(e=o.value)||void 0===e?void 0:e.duration)||0},_=function(){var e;u.value=(null===(e=o.value)||void 0===e?void 0:e.currentTime)||0},T=function(){f.value?(E(0),w()):V()},M=function(){var e;s.value=null!==(e=o.value)&&void 0!==e&&e.buffered.length?o.value.buffered.end(o.value.buffered.length-1):0},D=function(){return Se["a"].error("视频加载失败")},z=function(e){if(o.value&&a.value){var t="clientX"in e?e.clientX:e.changedTouches[0].clientX,n=(t-c(a.value))/a.value.clientWidth;n=Math.max(n,0),n=Math.min(n,1);var l=n*d.value;o.value.currentTime=l,u.value=l}},F=function e(t){if(o.value&&a.value){var n="clientX"in t?t.clientX:t.changedTouches[0].clientX,l=(n-c(a.value))/a.value.clientWidth;l=Math.max(l,0),l=Math.min(l,1);var r=l*d.value;o.value.currentTime=r,u.value=r,document.removeEventListener("mousemove",z),document.removeEventListener("touchmove",z),document.removeEventListener("mouseup",e),document.removeEventListener("touchend",e)}},A=function(){document.addEventListener("mousemove",z),document.addEventListener("touchmove",z),document.addEventListener("mouseup",F),document.addEventListener("touchend",F)},R=function(e){if(l.value){var t="clientX"in e?e.clientX:e.changedTouches[0].clientX,n=(t-c(l.value))/45;B(n)}},P=function e(){document.removeEventListener("mousemove",R),document.removeEventListener("touchmove",R),document.removeEventListener("mouseup",e),document.removeEventListener("touchend",e)},H=function(){document.addEventListener("mousemove",R),document.addEventListener("touchmove",R),document.addEventListener("mouseup",P),document.addEventListener("touchend",P)},q=function(e){if(l.value){var t=(e.clientX-c(l.value))/45;B(t)}},U=function(e){if(d.value&&a.value){var t=a.value.getBoundingClientRect().left,c=e.clientX-t;if(c<0||c>a.value.offsetWidth)return;var o=d.value*(c/a.value.offsetWidth);v.value="".concat(c-(o>=3600?25:20),"px"),O.value=n(o),m.value=!0}},G=function(){o.value&&(o.value.muted?(o.value.muted=!1,B(.5)):(o.value.muted=!0,B(0)))},X=function(){f.value=!f.value},Y=Object(y["ref"])(-1),Z=Object(y["ref"])(!1),W=function(){Z.value=!1,clearTimeout(Y.value),Y.value=setTimeout((function(){var e;null!==(e=o.value)&&void 0!==e&&e.played.length&&(Z.value=!0)}),3e3)};return Nl(t.src,o),function(t,n){var c=Object(y["resolveComponent"])("IconPause"),u=Object(y["resolveComponent"])("IconPlayOne"),d=Object(y["resolveComponent"])("IconVolumeMute"),s=Object(y["resolveComponent"])("IconVolumeNotice"),E=Object(y["resolveComponent"])("IconVolumeSmall");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["video-player",{"hide-controller":Z.value}]),style:Object(y["normalizeStyle"])({width:e.width*e.scale+"px",height:e.height*e.scale+"px",transform:"scale(".concat(1/e.scale,")")}),onMousemove:n[22]||(n[22]=function(e){return W()}),onClick:n[23]||(n[23]=function(e){return W()})},[Object(y["createElementVNode"])("div",{class:"video-wrap",onClick:n[8]||(n[8]=function(e){return I()})},[Object(y["createElementVNode"])("video",{class:"video",ref_key:"videoRef",ref:o,src:e.src,poster:e.poster,"webkit-playsinline":"",playsinline:"",onDurationchange:n[0]||(n[0]=function(e){return L()}),onTimeupdate:n[1]||(n[1]=function(e){return _()}),onEnded:n[2]||(n[2]=function(e){return T()}),onProgress:n[3]||(n[3]=function(e){return M()}),onPlay:n[4]||(n[4]=function(e){return W()}),onPause:n[5]||(n[5]=function(e){return W()}),onError:n[6]||(n[6]=function(e){return D()})},null,40,wl),Object(y["createElementVNode"])("div",Vl,[Object(y["createElementVNode"])("span",{class:Object(y["normalizeClass"])(["bezel-icon",{"bezel-transition":b.value}]),onAnimationend:n[7]||(n[7]=function(e){return b.value=!1})},[i.value?(Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:0})):(Object(y["openBlock"])(),Object(y["createBlock"])(u,{key:1}))],34)])]),Il,Object(y["createElementVNode"])("div",Bl,[Object(y["createElementVNode"])("div",Sl,[Object(y["createElementVNode"])("div",{class:"icon play-icon",onClick:n[9]||(n[9]=function(e){return I()})},[Object(y["createElementVNode"])("span",Ll,[i.value?(Object(y["openBlock"])(),Object(y["createBlock"])(u,{key:0})):(Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:1}))])]),Object(y["createElementVNode"])("div",_l,[Object(y["createElementVNode"])("div",{class:"icon volume-icon",onClick:n[10]||(n[10]=function(e){return G()})},[Object(y["createElementVNode"])("span",Tl,[0===r.value?(Object(y["openBlock"])(),Object(y["createBlock"])(d,{key:0})):1===r.value?(Object(y["openBlock"])(),Object(y["createBlock"])(s,{key:1})):(Object(y["openBlock"])(),Object(y["createBlock"])(E,{key:2}))])]),Object(y["createElementVNode"])("div",{class:"volume-bar-wrap",onMousedown:n[11]||(n[11]=function(e){return H()}),onTouchstart:n[12]||(n[12]=function(e){return H()}),onClick:n[13]||(n[13]=function(e){return q(e)})},[Object(y["createElementVNode"])("div",{class:"volume-bar",ref_key:"volumeBarRef",ref:l},[Object(y["createElementVNode"])("div",{class:"volume-bar-inner",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(k)})},Dl,4)],512)],32)]),Object(y["createElementVNode"])("span",zl,[Object(y["createElementVNode"])("span",Fl,Object(y["toDisplayString"])(Object(y["unref"])(j)),1),Al,Object(y["createElementVNode"])("span",Rl,Object(y["toDisplayString"])(Object(y["unref"])(h)),1)])]),Object(y["createElementVNode"])("div",Pl,[Object(y["createElementVNode"])("div",Hl,[Object(y["createElementVNode"])("div",ql,[Object(y["createElementVNode"])("span",{class:"icon-content",onClick:n[14]||(n[14]=function(e){return C.value=!C.value})},"倍速"),C.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"speed-menu",onMouseleave:n[15]||(n[15]=function(e){return C.value=!1})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(N,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["speed-menu-item",{active:e.value===p.value}]),key:e.label,onClick:function(t){return S(e.value)}},Object(y["toDisplayString"])(e.label),11,Ul)})),64))],32)):Object(y["createCommentVNode"])("",!0)])]),Object(y["createElementVNode"])("div",{class:"loop",onClick:n[16]||(n[16]=function(e){return X()})},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["icon loop-icon",{active:f.value}])},Xl,2)])]),Object(y["createElementVNode"])("div",{class:"bar-wrap",ref_key:"playBarWrap",ref:a,onMousedown:n[17]||(n[17]=function(e){return A()}),onTouchstart:n[18]||(n[18]=function(e){return A()}),onMousemove:n[19]||(n[19]=function(e){return U(e)}),onMouseenter:n[20]||(n[20]=function(e){return m.value=!0}),onMouseleave:n[21]||(n[21]=function(e){return m.value=!1})},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["bar-time",{hidden:!m.value}]),style:Object(y["normalizeStyle"])({left:v.value})},Object(y["toDisplayString"])(O.value),7),Object(y["createElementVNode"])("div",Yl,[Object(y["createElementVNode"])("div",{class:"loaded",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(x)})},null,4),Object(y["createElementVNode"])("div",{class:"played",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(g)})},Wl,4)])],544)])],38)}}});n("3696");const Kl=pn()(Jl,[["__scopeId","data-v-2fc4c202"]]);var Ql=Kl,$l=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo,n))};return function(t,n){var a=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-video",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",onMousedown:n[2]||(n[2]=function(e){return o(e,!1)}),onTouchstart:n[3]||(n[3]=function(e){return o(e,!1)})},[Object(y["createVNode"])(Ql,{width:e.elementInfo.width,height:e.elementInfo.height,src:e.elementInfo.src,poster:e.elementInfo.poster,scale:Object(y["unref"])(c)},null,8,["width","height","src","poster","scale"]),(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(["t","b","l","r"],(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["handler-border",e]),key:e,onMousedown:n[0]||(n[0]=function(e){return o(e)}),onTouchstart:n[1]||(n[1]=function(e){return o(e)})},null,34)})),64))],32)),[[a,e.contextmenus]])],4)],6)}}});n("679c");const er=pn()($l,[["__scopeId","data-v-9d5469c6"]]);var tr=er,nr=function(e){return Object(y["pushScopeId"])("data-v-121f3d11"),e=e(),Object(y["popScopeId"])(),e},cr=["src","autoplay"],or={class:"controller"},ar={class:"icons"},lr={class:"icon-content"},rr={class:"volume"},ir={class:"icon-content"},ur=nr((function(){return Object(y["createElementVNode"])("span",{class:"thumb"},null,-1)})),dr=[ur],sr={class:"time"},fr={class:"ptime"},br=Object(y["createTextVNode"])(" / "),pr={class:"dtime"},mr={class:"bar"},Or=nr((function(){return Object(y["createElementVNode"])("span",{class:"thumb"},null,-1)})),vr=[Or],jr=Object(y["defineComponent"])({__name:"AudioPlayer",props:{src:{type:String,required:!0},loop:{type:Boolean,required:!0},autoplay:{type:Boolean,default:!1},scale:{type:Number,default:1}},setup:function(e,t){var n=t.expose,c=e,o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0===e||isNaN(e))return"00:00";var t=function(e){return e<10?"0"+e:""+e},n=Math.floor(e/3600),c=Math.floor((e-3600*n)/60),o=Math.floor(e-3600*n-60*c);return(n>0?[n,c,o]:[c,o]).map(t).join(":")},a=function(e){return e.getBoundingClientRect().left},l=Object(y["ref"])(),r=Object(y["ref"])(),i=Object(y["ref"])(),u=Object(y["ref"])(.5),d=Object(y["ref"])(!0),s=Object(y["ref"])(0),f=Object(y["ref"])(0),b=Object(y["ref"])(0),p=Object(y["ref"])(!1),m=Object(y["ref"])("00:00"),O=Object(y["ref"])("0"),v=Object(y["computed"])((function(){return o(s.value)})),j=Object(y["computed"])((function(){return o(f.value)})),h=Object(y["computed"])((function(){return s.value/f.value*100+"%"})),g=Object(y["computed"])((function(){return b.value/f.value*100+"%"})),x=Object(y["computed"])((function(){return 100*u.value+"%"})),k=function(e){l.value&&(e=Math.max(e,0),e=Math.min(e,f.value),l.value.currentTime=e,s.value=e)},C=function(){l.value&&(d.value=!1,l.value.play())},N=function(){l.value&&(d.value=!0,l.value.pause())},E=function(){d.value?C():N()},w=function(e){l.value&&(e=Math.max(e,0),e=Math.min(e,1),l.value.volume=e,u.value=e,l.value.muted&&0!==e&&(l.value.muted=!1))},V=function(){var e;f.value=(null===(e=l.value)||void 0===e?void 0:e.duration)||0},I=function(){var e;s.value=(null===(e=l.value)||void 0===e?void 0:e.currentTime)||0},B=function(){d.value=!1},S=function(){c.loop?(k(0),C()):N()},L=function(){var e;b.value=null!==(e=l.value)&&void 0!==e&&e.buffered.length?l.value.buffered.end(l.value.buffered.length-1):0},_=function(){return Se["a"].error("视频加载失败")},T=function(e){if(l.value&&r.value){var t="clientX"in e?e.clientX:e.changedTouches[0].clientX,n=(t-a(r.value))/r.value.clientWidth;n=Math.max(n,0),n=Math.min(n,1);var c=n*f.value;l.value.currentTime=c,s.value=c}},M=function e(t){if(l.value&&r.value){var n="clientX"in t?t.clientX:t.changedTouches[0].clientX,c=(n-a(r.value))/r.value.clientWidth;c=Math.max(c,0),c=Math.min(c,1);var o=c*f.value;l.value.currentTime=o,s.value=o,document.removeEventListener("mousemove",T),document.removeEventListener("touchmove",T),document.removeEventListener("mouseup",e),document.removeEventListener("touchend",e)}},D=function(){document.addEventListener("mousemove",T),document.addEventListener("touchmove",T),document.addEventListener("mouseup",M),document.addEventListener("touchend",M)},z=function(e){if(i.value){var t="clientX"in e?e.clientX:e.changedTouches[0].clientX,n=(t-a(i.value))/45;w(n)}},F=function e(){document.removeEventListener("mousemove",z),document.removeEventListener("touchmove",z),document.removeEventListener("mouseup",e),document.removeEventListener("touchend",e)},A=function(){document.addEventListener("mousemove",z),document.addEventListener("touchmove",z),document.addEventListener("mouseup",F),document.addEventListener("touchend",F)},R=function(e){if(i.value){var t=(e.clientX-a(i.value))/45;w(t)}},P=function(e){if(f.value&&r.value){var t=r.value.getBoundingClientRect().left,n=e.clientX-t;if(n<0||n>r.value.offsetWidth)return;var c=f.value*(n/r.value.offsetWidth);O.value="".concat(n-(c>=3600?25:20),"px"),m.value=o(c),p.value=!0}},H=function(){l.value&&(l.value.muted?(l.value.muted=!1,w(.5)):(l.value.muted=!0,w(0)))};return n({toggle:E}),function(t,n){var c=Object(y["resolveComponent"])("IconPlayOne"),o=Object(y["resolveComponent"])("IconPause"),a=Object(y["resolveComponent"])("IconVolumeMute"),s=Object(y["resolveComponent"])("IconVolumeNotice"),f=Object(y["resolveComponent"])("IconVolumeSmall");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"audio-player",style:Object(y["normalizeStyle"])({transform:"scale(".concat(1/e.scale,")")})},[Object(y["createElementVNode"])("audio",{class:"audio",ref_key:"audioRef",ref:l,src:e.src,autoplay:e.autoplay,onDurationchange:n[0]||(n[0]=function(e){return V()}),onTimeupdate:n[1]||(n[1]=function(e){return I()}),onPlay:n[2]||(n[2]=function(e){return B()}),onEnded:n[3]||(n[3]=function(e){return S()}),onProgress:n[4]||(n[4]=function(e){return L()}),onError:n[5]||(n[5]=function(e){return _()})},null,40,cr),Object(y["createElementVNode"])("div",or,[Object(y["createElementVNode"])("div",ar,[Object(y["createElementVNode"])("div",{class:"icon play-icon",onClick:n[6]||(n[6]=function(e){return E()})},[Object(y["createElementVNode"])("span",lr,[d.value?(Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:0})):(Object(y["openBlock"])(),Object(y["createBlock"])(o,{key:1}))])]),Object(y["createElementVNode"])("div",rr,[Object(y["createElementVNode"])("div",{class:"icon volume-icon",onClick:n[7]||(n[7]=function(e){return H()})},[Object(y["createElementVNode"])("span",ir,[0===u.value?(Object(y["openBlock"])(),Object(y["createBlock"])(a,{key:0})):1===u.value?(Object(y["openBlock"])(),Object(y["createBlock"])(s,{key:1})):(Object(y["openBlock"])(),Object(y["createBlock"])(f,{key:2}))])]),Object(y["createElementVNode"])("div",{class:"volume-bar-wrap",onMousedown:n[8]||(n[8]=function(e){return A()}),onTouchstart:n[9]||(n[9]=function(e){return A()}),onClick:n[10]||(n[10]=function(e){return R(e)})},[Object(y["createElementVNode"])("div",{class:"volume-bar",ref_key:"volumeBarRef",ref:i},[Object(y["createElementVNode"])("div",{class:"volume-bar-inner",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(x)})},dr,4)],512)],32)])]),Object(y["createElementVNode"])("span",sr,[Object(y["createElementVNode"])("span",fr,Object(y["toDisplayString"])(Object(y["unref"])(v)),1),br,Object(y["createElementVNode"])("span",pr,Object(y["toDisplayString"])(Object(y["unref"])(j)),1)]),Object(y["createElementVNode"])("div",{class:"bar-wrap",ref_key:"playBarWrap",ref:r,onMousedown:n[11]||(n[11]=function(e){return D()}),onTouchstart:n[12]||(n[12]=function(e){return D()}),onMousemove:n[13]||(n[13]=function(e){return P(e)}),onMouseenter:n[14]||(n[14]=function(e){return p.value=!0}),onMouseleave:n[15]||(n[15]=function(e){return p.value=!1})},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["bar-time",{hidden:!p.value}]),style:Object(y["normalizeStyle"])({left:O.value})},Object(y["toDisplayString"])(m.value),7),Object(y["createElementVNode"])("div",mr,[Object(y["createElementVNode"])("div",{class:"loaded",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(g)})},null,4),Object(y["createElementVNode"])("div",{class:"played",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(h)})},vr,4)])],544)])],4)}}});n("3929");const hr=pn()(jr,[["__scopeId","data-v-121f3d11"]]);var yr=hr,gr=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=n.handleElementId,a=Object(g["c"])(ae()),l=a.viewportRatio,r=Object(y["computed"])((function(){return Math.min(t.elementInfo.width,t.elementInfo.height)+"px"})),i=Object(y["computed"])((function(){var e=tt,n=tt*l.value,o=280/c.value,a=50/c.value,r=t.elementInfo.width,i=t.elementInfo.height,u=t.elementInfo.left,d=t.elementInfo.top,s=0,f=i;return u+o>=e&&(s=r-o),d+i+a>=n&&(f=-a),{left:s+"px",top:f+"px"}})),u=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))};return function(t,n){var a=Object(y["resolveComponent"])("IconVolumeNotice"),l=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-audio",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",onMousedown:n[1]||(n[1]=function(e){return u(e)}),onTouchstart:n[2]||(n[2]=function(e){return u(e)})},[Object(y["createVNode"])(a,{class:"audio-icon",style:Object(y["normalizeStyle"])({fontSize:Object(y["unref"])(r),color:e.elementInfo.color})},null,8,["style"]),Object(y["unref"])(o)===e.elementInfo.id?(Object(y["openBlock"])(),Object(y["createBlock"])(yr,{key:0,class:"audio-player",style:Object(y["normalizeStyle"])(Object(S["a"])({},Object(y["unref"])(i))),src:e.elementInfo.src,loop:e.elementInfo.loop,scale:Object(y["unref"])(c),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(){}),["stop"]))},null,8,["style","src","loop","scale"])):Object(y["createCommentVNode"])("",!0)],32)),[[l,e.contextmenus]])],4)],6)}}});n("75e6");const xr=pn()(gr,[["__scopeId","data-v-001bfbc4"]]);var kr=xr,Cr=["id"],Nr=Object(y["defineComponent"])({__name:"EditableElement",props:{elementInfo:{type:Object,required:!0},elementIndex:{type:Number,required:!0},isMultiSelect:{type:Boolean,required:!0},selectElement:{type:Function,required:!0},openLinkDialog:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(y["computed"])((function(){var e,n=(e={},Object(pe["a"])(e,Ve.IMAGE,lo),Object(pe["a"])(e,Ve.TEXT,va),Object(pe["a"])(e,Ve.SHAPE,_a),Object(pe["a"])(e,Ve.LINE,Ua),Object(pe["a"])(e,Ve.CHART,Qa),Object(pe["a"])(e,Ve.TABLE,jl),Object(pe["a"])(e,Ve.LATEX,Cl),Object(pe["a"])(e,Ve.VIDEO,tr),Object(pe["a"])(e,Ve.AUDIO,kr),e);return n[t.elementInfo.type]||null})),c=Ot(),o=c.orderElement,a=hc(),l=a.alignElementToCanvas,r=ft(),i=r.combineElements,u=r.uncombineElements,d=st(),s=d.deleteElement,f=dt(),b=f.lockElement,p=f.unlockElement,m=bt(),O=m.copyElement,v=m.pasteElement,j=m.cutElement,h=pt(),g=h.selectAllElement,x=function(){return t.elementInfo.lock?[{text:"解锁",handler:function(){return p(t.elementInfo)}}]:[{text:"剪切",subText:"Ctrl + X",handler:j},{text:"复制",subText:"Ctrl + C",handler:O},{text:"粘贴",subText:"Ctrl + V",handler:v},{divider:!0},{text:"水平居中",handler:function(){return l(C.HORIZONTAL)},children:[{text:"水平垂直居中",handler:function(){return l(C.CENTER)}},{text:"水平居中",handler:function(){return l(C.HORIZONTAL)}},{text:"左对齐",handler:function(){return l(C.LEFT)}},{text:"右对齐",handler:function(){return l(C.RIGHT)}}]},{text:"垂直居中",handler:function(){return l(C.VERTICAL)},children:[{text:"水平垂直居中",handler:function(){return l(C.CENTER)}},{text:"垂直居中",handler:function(){return l(C.VERTICAL)}},{text:"顶部对齐",handler:function(){return l(C.TOP)}},{text:"底部对齐",handler:function(){return l(C.BOTTOM)}}]},{divider:!0},{text:"置于顶层",disable:t.isMultiSelect&&!t.elementInfo.groupId,handler:function(){return o(t.elementInfo,k.TOP)},children:[{text:"置于顶层",handler:function(){return o(t.elementInfo,k.TOP)}},{text:"上移一层",handler:function(){return o(t.elementInfo,k.UP)}}]},{text:"置于底层",disable:t.isMultiSelect&&!t.elementInfo.groupId,handler:function(){return o(t.elementInfo,k.BOTTOM)},children:[{text:"置于底层",handler:function(){return o(t.elementInfo,k.BOTTOM)}},{text:"下移一层",handler:function(){return o(t.elementInfo,k.DOWN)}}]},{divider:!0},{text:"设置链接",handler:t.openLinkDialog},{text:t.elementInfo.groupId?"取消组合":"组合",subText:"Ctrl + G",handler:t.elementInfo.groupId?u:i,hide:!t.isMultiSelect},{text:"全选",subText:"Ctrl + A",handler:g},{text:"锁定",subText:"Ctrl + L",handler:b},{text:"删除",subText:"Delete",handler:s}]};return function(t,c){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"editable-element",ref:"elementRef",id:"editable-element-".concat(e.elementInfo.id),style:Object(y["normalizeStyle"])({zIndex:e.elementIndex})},[(Object(y["openBlock"])(),Object(y["createBlock"])(Object(y["resolveDynamicComponent"])(Object(y["unref"])(n)),{elementInfo:e.elementInfo,selectElement:e.selectElement,contextmenus:x},null,8,["elementInfo","selectElement"]))],12,Cr)}}});const Er=Nr;var wr=Er,Vr=Object(y["defineComponent"])({__name:"MouseSelection",props:{top:{type:Number,required:!0},left:{type:Number,required:!0},width:{type:Number,required:!0},height:{type:Number,required:!0},quadrant:{type:Number,required:!0,validator:function(e){return[1,2,3,4].includes(e)}}},setup:function(e){return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])("mouse-selection quadrant-".concat(e.quadrant)),style:Object(y["normalizeStyle"])({top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"})},null,6)}}});n("4b9a");const Ir=pn()(Vr,[["__scopeId","data-v-0d6c0f73"]]);var Br=Ir,Sr={class:"grid-lines"},Lr=["d","stroke"],_r=Object(y["defineComponent"])({__name:"GridLines",setup:function(e){var t=Object(g["c"])(ie()),n=t.canvasScale,c=Object(g["c"])(ae()),o=c.currentSlide,a=c.viewportRatio,l=Object(y["computed"])((function(){var e;return null===(e=o.value)||void 0===e?void 0:e.background})),r=Object(y["computed"])((function(){var e,t=(null===(e=l.value)||void 0===e?void 0:e.color)||"#fff",n=["#000","#fff"];return ee.a.mostReadable(t,n,{includeFallbackColors:!0}).setAlpha(.5).toRgbString()})),i=50,u=function(){for(var e=tt,t=tt*a.value,n="",c=0;c<=Math.floor(t/i);c++)n+="M0 ".concat(c*i," L").concat(e," ").concat(c*i," ");for(var o=0;o<=Math.floor(e/i);o++)n+="M".concat(o*i," 0 L").concat(o*i," ").concat(t," ");return n},d=u();return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",Sr,[Object(y["createElementVNode"])("path",{style:Object(y["normalizeStyle"])({transform:"scale(".concat(Object(y["unref"])(n),")")}),d:Object(y["unref"])(d),fill:"none",stroke:Object(y["unref"])(r),"stroke-width":"0.3","stroke-dasharray":"5"},null,12,Lr)])}}});n("15d9");const Tr=pn()(_r,[["__scopeId","data-v-10cd6d44"]]);var Mr=Tr,Dr=function(e){var t=Object(y["computed"])((function(){if(!e.value)return{backgroundColor:"#fff"};var t=e.value,n=t.type,c=t.color,o=t.image,a=t.imageSize,l=t.gradientColor,r=t.gradientRotate,i=t.gradientType;if("solid"===n)return{backgroundColor:c};if("image"===n)return o?"repeat"===a?{backgroundImage:"url(".concat(o),backgroundRepeat:"repeat",backgroundSize:"contain"}:{backgroundImage:"url(".concat(o),backgroundRepeat:"no-repeat",backgroundSize:a||"cover"}:{backgroundColor:"#fff"};if("gradient"===n){var u=r||0,d=l?l[0]:"#fff",s=l?l[1]:"#fff";return"radial"===i?{backgroundImage:"radial-gradient(".concat(d,", ").concat(s)}:{backgroundImage:"linear-gradient(".concat(u,"deg, ").concat(d,", ").concat(s)}}return{backgroundColor:"#fff"}}));return{backgroundStyle:t}},zr=Object(y["defineComponent"])({__name:"ViewportBackground",setup:function(e){var t=Object(g["c"])(ie()),n=t.showGridLines,c=Object(g["c"])(ae()),o=c.currentSlide,a=Object(y["computed"])((function(){var e;return null===(e=o.value)||void 0===e?void 0:e.background})),l=Dr(a),r=l.backgroundStyle;return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"viewport-background",style:Object(y["normalizeStyle"])(Object(y["unref"])(r))},[Object(y["unref"])(n)?(Object(y["openBlock"])(),Object(y["createBlock"])(Mr,{key:0})):Object(y["createCommentVNode"])("",!0)],4)}}});n("258f");const Fr=pn()(zr,[["__scopeId","data-v-6f1e1261"]]);var Ar=Fr,Rr=Object(y["defineComponent"])({__name:"AlignmentLine",props:{type:{type:String,required:!0},axis:{type:Object,required:!0},length:{type:Number,required:!0},canvasScale:{type:Number,required:!0}},setup:function(e){var t=e,n=Object(y["computed"])((function(){return t.axis.x*t.canvasScale+"px"})),c=Object(y["computed"])((function(){return t.axis.y*t.canvasScale+"px"})),o=Object(y["computed"])((function(){return"vertical"===t.type?{height:t.length*t.canvasScale+"px"}:{width:t.length*t.canvasScale+"px"}}));return function(t,a){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"alignment-line",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(n),top:Object(y["unref"])(c)})},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["line",e.type]),style:Object(y["normalizeStyle"])(Object(y["unref"])(o))},null,6)],4)}}});n("5688");const Pr=pn()(Rr,[["__scopeId","data-v-37fa6068"]]);var Hr=Pr,qr={class:"ruler"},Ur=Object(y["defineComponent"])({__name:"Ruler",props:{viewportStyles:{type:Object,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return t.viewportStyles.width*c.value/10}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",qr,[Object(y["createElementVNode"])("div",{class:"h",style:Object(y["normalizeStyle"])({width:e.viewportStyles.width*Object(y["unref"])(c)+"px",left:e.viewportStyles.left+"px"})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(10,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["ruler-marker-100",{hide:Object(y["unref"])(o)<36,omit:Object(y["unref"])(o)<72}]),key:"marker-100-".concat(e)},[Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(100*e),1)],2)})),64))],4),Object(y["createElementVNode"])("div",{class:"v",style:Object(y["normalizeStyle"])({height:e.viewportStyles.height*Object(y["unref"])(c)+"px",top:e.viewportStyles.top+"px"})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(10,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["ruler-marker-100",{hide:Object(y["unref"])(o)<36,omit:Object(y["unref"])(o)<72}]),key:e,style:Object(y["normalizeStyle"])({height:Object(y["unref"])(o)+"px"})},[Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(100*e),1)],6)})),64))],4)])}}});n("9854");const Gr=pn()(Ur,[["__scopeId","data-v-60e06332"]]);var Xr=Gr,Yr=["width","height"],Zr=["d"],Wr=Object(y["defineComponent"])({__name:"ElementCreateSelection",emits:["created"],setup:function(e,t){var n=t.emit,c=ie(),o=Object(g["c"])(c),a=o.creatingElement,l=Object(g["c"])(ke()),r=l.ctrlOrShiftKeyActive,i=Object(y["ref"])(),u=Object(y["ref"])(),d=Object(y["ref"])(),s=Object(y["ref"])({x:0,y:0});Object(y["onMounted"])((function(){if(d.value){var e=d.value.getBoundingClientRect(),t=e.x,n=e.y;s.value={x:t,y:n}}}));var f=function(e){var t=!0,o=e.pageX,l=e.pageY;i.value=[o,l],document.onmousemove=function(e){if(a.value&&t){var n=e.pageX,c=e.pageY;if(r.value){var i=n-o,d=c-l,s=Math.abs(i),f=Math.abs(d);if("shape"===a.value.type){var b=d>0&&i<0||d<0&&i>0;s>f?c=b?l-i:l+i:n=b?o-d:o+d}else"line"===a.value.type&&(s>f?c=l:n=o)}u.value=[n,c]}},document.onmouseup=function(e){var r,d;if(document.onmousemove=null,document.onmouseup=null,2!==e.button){t=!1;var s=e.pageX,f=e.pageY,b=30;if("line"===(null===(r=a.value)||void 0===r?void 0:r.type)&&(Math.abs(s-o)>=b||Math.abs(f-l)>=b))n("created",{start:i.value,end:u.value});else if("line"!==(null===(d=a.value)||void 0===d?void 0:d.type)&&Math.abs(s-o)>=b&&Math.abs(f-l)>=b)n("created",{start:i.value,end:u.value});else{var p=200,m=Math.min(s,o),O=Math.min(f,l),v=Math.max(s,o),j=Math.max(f,l),h=v-m>=b?v-m:p,y=j-O>=b?j-O:p;n("created",{start:[m,O],end:[m+h,O+y]})}}else setTimeout((function(){return c.setCreatingElement(null)}),0)}},b=Object(y["computed"])((function(){if(!i.value||!u.value)return null;if(!a.value||"line"!==a.value.type)return null;var e=Object(me["a"])(i.value,2),t=e[0],n=e[1],c=Object(me["a"])(u.value,2),o=c[0],l=c[1],r=Math.min(t,o),d=Math.max(t,o),s=Math.min(n,l),f=Math.max(n,l),b=d-r>=24?d-r:24,p=f-s>=24?f-s:24,m=t===r?0:d-r,O=n===s?0:f-s,v=o===r?0:d-r,j=l===s?0:f-s,h="M".concat(m,", ").concat(O," L").concat(v,", ").concat(j);return{svgWidth:b,svgHeight:p,startX:m,startY:O,endX:v,endY:j,path:h}})),p=Object(y["computed"])((function(){if(!i.value||!u.value)return{};var e=Object(me["a"])(i.value,2),t=e[0],n=e[1],c=Object(me["a"])(u.value,2),o=c[0],a=c[1],l=Math.min(t,o),r=Math.max(t,o),d=Math.min(n,a),f=Math.max(n,a),b=r-l,p=f-d;return{left:l-s.value.x+"px",top:d-s.value.y+"px",width:b+"px",height:p+"px"}}));return function(e,t){var n,c;return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-create-selection",ref_key:"selectionRef",ref:d,onMousedown:t[0]||(t[0]=Object(y["withModifiers"])((function(e){return f(e)}),["stop"])),onContextmenu:t[1]||(t[1]=Object(y["withModifiers"])((function(){}),["stop","prevent"]))},[i.value&&u.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:Object(y["normalizeClass"])(["selection",null===(n=Object(y["unref"])(a))||void 0===n?void 0:n.type]),style:Object(y["normalizeStyle"])(Object(y["unref"])(p))},["line"===(null===(c=Object(y["unref"])(a))||void 0===c?void 0:c.type)&&Object(y["unref"])(b)?(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{key:0,overflow:"visible",width:Object(y["unref"])(b).svgWidth,height:Object(y["unref"])(b).svgHeight},[Object(y["createElementVNode"])("path",{d:Object(y["unref"])(b).path,stroke:"#d14424",fill:"none","stroke-width":"2"},null,8,Zr)],8,Yr)):Object(y["createCommentVNode"])("",!0)],6)):Object(y["createCommentVNode"])("",!0)],544)}}});n("7aed");const Jr=pn()(Wr,[["__scopeId","data-v-5a941f07"]]);var Kr=Jr,Qr=function(e,t){var n=Object(y["computed"])((function(){return[{direction:E.LEFT_TOP,style:{}},{direction:E.TOP,style:{left:e.value/2+"px"}},{direction:E.RIGHT_TOP,style:{left:e.value+"px"}},{direction:E.LEFT,style:{top:t.value/2+"px"}},{direction:E.RIGHT,style:{left:e.value+"px",top:t.value/2+"px"}},{direction:E.LEFT_BOTTOM,style:{top:t.value+"px"}},{direction:E.BOTTOM,style:{left:e.value/2+"px",top:t.value+"px"}},{direction:E.RIGHT_BOTTOM,style:{left:e.value+"px",top:t.value+"px"}}]})),c=Object(y["computed"])((function(){return[{direction:E.LEFT,style:{top:t.value/2+"px"}},{direction:E.RIGHT,style:{left:e.value+"px",top:t.value/2+"px"}}]})),o=Object(y["computed"])((function(){return[{type:N.T,style:{width:e.value+"px"}},{type:N.B,style:{top:t.value+"px",width:e.value+"px"}},{type:N.L,style:{height:t.value+"px"}},{type:N.R,style:{left:e.value+"px",height:t.value+"px"}}]}));return{resizeHandlers:n,textElementResizeHandlers:c,borderLines:o}},$r=Object(y["defineComponent"])({__name:"ResizeHandler",props:{type:{type:String,default:""},rotate:{type:Number,default:0}},setup:function(e){var t=e,n=Object(y["computed"])((function(){var e="rotate-",n=t.rotate;return n>-22.5&&n<=22.5?e+0:n>22.5&&n<=67.5?e+45:n>67.5&&n<=112.5?e+90:n>112.5&&n<=157.5?e+135:n>157.5||n<=-157.5?e+0:n>-157.5&&n<=-112.5?e+45:n>-112.5&&n<=-67.5?e+90:n>-67.5&&n<=-22.5?e+135:e+0}));return function(t,c){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["resize-handler",Object(y["unref"])(n),e.type])},null,2)}}});n("b510");const ei=pn()($r,[["__scopeId","data-v-881ee3f8"]]);var ti=ei,ni=Object(y["defineComponent"])({__name:"BorderLine",props:{type:{type:String,required:!0},isWide:{type:Boolean,default:!1}},setup:function(e){return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["border-line",e.type,{wide:e.isWide}])},null,2)}}});n("2460");const ci=pn()(ni,[["__scopeId","data-v-7170d1be"]]);var oi=ci,ai=Object(y["defineComponent"])({__name:"MultiSelectOperate",props:{elementList:{type:Array,required:!0},scaleMultiElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.activeElementIdList,o=n.canvasScale,a=Object(y["computed"])((function(){return t.elementList.filter((function(e){return c.value.includes(e.id)}))})),l=Object(y["ref"])({minX:0,maxX:0,minY:0,maxY:0}),r=Object(y["computed"])((function(){return(l.value.maxX-l.value.minX)*o.value})),i=Object(y["computed"])((function(){return(l.value.maxY-l.value.minY)*o.value})),u=Qr(r,i),d=u.resizeHandlers,s=u.borderLines,f=function(){var e=Xe(a.value),t=e.minX,n=e.maxX,c=e.minY,o=e.maxY;l.value={minX:t,maxX:n,minY:c,maxY:o}};Object(y["watchEffect"])(f);var b=Object(y["computed"])((function(){return a.value.some((function(e){return!!("image"!==e.type&&"shape"!==e.type||e.rotate)}))}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"multi-select-operate",style:Object(y["normalizeStyle"])({left:l.value.minX*Object(y["unref"])(o)+"px",top:l.value.minY*Object(y["unref"])(o)+"px"})},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(s),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),Object(y["unref"])(b)?Object(y["createCommentVNode"])("",!0):(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],{key:0},Object(y["renderList"])(Object(y["unref"])(d),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{key:t.direction,type:t.direction,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleMultiElement(n,l.value,t.direction)}),["stop"])},null,8,["type","style","onMousedown"])})),128))],4)}}});n("a669");const li=pn()(ai,[["__scopeId","data-v-defbd922"]]);var ri=li,ii={class:"rotate-handler"};function ui(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ii)}n("1ebd");const di={},si=pn()(di,[["render",ui],["__scopeId","data-v-b99d8dae"]]);var fi=si,bi={inheritAttrs:!1},pi=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},bi),{},{__name:"ImageElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=n.clipingImageElementId,a=Object(y["computed"])((function(){return o.value===t.elementInfo.id})),l=Object(y["computed"])((function(){return t.elementInfo.width*c.value})),r=Object(y["computed"])((function(){return t.elementInfo.height*c.value})),i=Qr(l,r),u=i.resizeHandlers,d=i.borderLines;return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["image-element-operate",{cliping:Object(y["unref"])(a)}])},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(d),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{class:"operate-border-line",key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(u),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.direction,type:t.direction,rotate:e.elementInfo.rotate,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleElement(n,e.elementInfo,t.direction)}),["stop"])},null,8,["type","rotate","style","onMousedown"])})),128)),Object(y["createVNode"])(fi,{class:"operate-rotate-handler",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(l)/2+"px"}),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(t){return e.rotateElement(e.elementInfo)}),["stop"]))},null,8,["style"])],64)):Object(y["createCommentVNode"])("",!0)],2)}}}));n("ae9f");const mi=pn()(pi,[["__scopeId","data-v-46b250c2"]]);var Oi=mi,vi={class:"text-element-operate"},ji={inheritAttrs:!1},hi=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},ji),{},{__name:"TextElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return t.elementInfo.width*c.value})),a=Object(y["computed"])((function(){return t.elementInfo.height*c.value})),l=Qr(o,a),r=l.textElementResizeHandlers,i=l.borderLines;return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",vi,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(i),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{class:"operate-border-line",key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(r),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.direction,type:t.direction,rotate:e.elementInfo.rotate,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleElement(n,e.elementInfo,t.direction)}),["stop"])},null,8,["type","rotate","style","onMousedown"])})),128)),Object(y["createVNode"])(fi,{class:"operate-rotate-handler",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(o)/2+"px"}),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(t){return e.rotateElement(e.elementInfo)}),["stop"]))},null,8,["style"])],64)):Object(y["createCommentVNode"])("",!0)])}}}));const yi=hi;var gi=yi,xi={class:"shape-element-operate"},ki={inheritAttrs:!1},Ci=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},ki),{},{__name:"ShapeElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0},moveShapeKeypoint:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return t.elementInfo.width*c.value})),a=Object(y["computed"])((function(){return t.elementInfo.height*c.value})),l=Qr(o,a),r=l.resizeHandlers,i=l.borderLines,u=Object(y["computed"])((function(){if(!t.elementInfo.pathFormula||!t.elementInfo.keypoint)return{};var e=nt[t.elementInfo.pathFormula];if("editable"in e){var n=e.getBaseSize(t.elementInfo.width,t.elementInfo.height)*t.elementInfo.keypoint;if("left"===e.relative)return{left:n*c.value+"px"};if("right"===e.relative)return{left:(t.elementInfo.width-n)*c.value+"px"};if("center"===e.relative)return{left:(t.elementInfo.width-n)/2*c.value+"px"};if("top"===e.relative)return{top:n*c.value+"px"};if("bottom"===e.relative)return{top:(t.elementInfo.height-n)*c.value+"px"}}return{}}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",xi,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(i),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{class:"operate-border-line",key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(r),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.direction,type:t.direction,rotate:e.elementInfo.rotate,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleElement(n,e.elementInfo,t.direction)}),["stop"])},null,8,["type","rotate","style","onMousedown"])})),128)),Object(y["createVNode"])(fi,{class:"operate-rotate-handler",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(o)/2+"px"}),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(t){return e.rotateElement(e.elementInfo)}),["stop"]))},null,8,["style"]),void 0!==e.elementInfo.keypoint?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"operate-keypoint-handler",style:Object(y["normalizeStyle"])(Object(y["unref"])(u)),onMousedown:n[1]||(n[1]=Object(y["withModifiers"])((function(t){return e.moveShapeKeypoint(t,e.elementInfo)}),["stop"]))},null,36)):Object(y["createCommentVNode"])("",!0)],64)):Object(y["createCommentVNode"])("",!0)])}}}));n("614e");const Ni=pn()(Ci,[["__scopeId","data-v-fd38df18"]]);var Ei=Ni,wi={class:"line-element-operate"},Vi=["width","height","stroke"],Ii={key:0},Bi=["x1","y1","x2","y2"],Si=["x1","y1","x2","y2"],Li=["x1","y1","x2","y2"],_i=["x1","y1","x2","y2"],Ti={inheritAttrs:!1},Mi=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},Ti),{},{__name:"LineElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},dragLineElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return Math.max(t.elementInfo.start[0],t.elementInfo.end[0])})),a=Object(y["computed"])((function(){return Math.max(t.elementInfo.start[1],t.elementInfo.end[1])})),l=Object(y["computed"])((function(){var e=[{handler:w.START,style:{left:t.elementInfo.start[0]*c.value+"px",top:t.elementInfo.start[1]*c.value+"px"}},{handler:w.END,style:{left:t.elementInfo.end[0]*c.value+"px",top:t.elementInfo.end[1]*c.value+"px"}}];if(t.elementInfo.curve||t.elementInfo.broken){var n=t.elementInfo.curve||t.elementInfo.broken;e.push({handler:w.C,style:{left:n[0]*c.value+"px",top:n[1]*c.value+"px"}})}else if(t.elementInfo.cubic){var o=Object(me["a"])(t.elementInfo.cubic,2),a=o[0],l=o[1];e.push({handler:w.C1,style:{left:a[0]*c.value+"px",top:a[1]*c.value+"px"}}),e.push({handler:w.C2,style:{left:l[0]*c.value+"px",top:l[1]*c.value+"px"}})}return e}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",wi,[e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(l),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.handler,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.dragLineElement(n,e.elementInfo,t.handler)}),["stop"])},null,8,["style","onMousedown"])})),128)),(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{width:Object(y["unref"])(o)||1,height:Object(y["unref"])(a)||1,stroke:e.elementInfo.color,overflow:"visible",style:Object(y["normalizeStyle"])({transform:"scale(".concat(Object(y["unref"])(c),")")})},[e.elementInfo.curve?(Object(y["openBlock"])(),Object(y["createElementBlock"])("g",Ii,[Object(y["createElementVNode"])("line",{class:"anchor-line",x1:e.elementInfo.start[0],y1:e.elementInfo.start[1],x2:e.elementInfo.curve[0],y2:e.elementInfo.curve[1]},null,8,Bi),Object(y["createElementVNode"])("line",{class:"anchor-line",x1:e.elementInfo.end[0],y1:e.elementInfo.end[1],x2:e.elementInfo.curve[0],y2:e.elementInfo.curve[1]},null,8,Si)])):Object(y["createCommentVNode"])("",!0),e.elementInfo.cubic?(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],{key:1},Object(y["renderList"])(e.elementInfo.cubic,(function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("g",{key:n},[0===n?(Object(y["openBlock"])(),Object(y["createElementBlock"])("line",{key:0,class:"anchor-line",x1:e.elementInfo.start[0],y1:e.elementInfo.start[1],x2:t[0],y2:t[1]},null,8,Li)):Object(y["createCommentVNode"])("",!0),1===n?(Object(y["openBlock"])(),Object(y["createElementBlock"])("line",{key:1,class:"anchor-line",x1:e.elementInfo.end[0],y1:e.elementInfo.end[1],x2:t[0],y2:t[1]},null,8,_i)):Object(y["createCommentVNode"])("",!0)])})),128)):Object(y["createCommentVNode"])("",!0)],12,Vi))],64)):Object(y["createCommentVNode"])("",!0)])}}}));n("fac9");const Di=pn()(Mi,[["__scopeId","data-v-4659f395"]]);var zi=Di,Fi={class:"table-element-operate"},Ai={inheritAttrs:!1},Ri=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},Ai),{},{__name:"TableElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return t.elementInfo.outline.width||1})),a=Object(y["computed"])((function(){return(t.elementInfo.width+o.value)*c.value})),l=Object(y["computed"])((function(){return t.elementInfo.height*c.value})),r=Qr(a,l),i=r.textElementResizeHandlers,u=r.borderLines;return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Fi,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(u),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{class:"operate-border-line",key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(i),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.direction,type:t.direction,rotate:e.elementInfo.rotate,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleElement(n,e.elementInfo,t.direction)}),["stop"])},null,8,["type","rotate","style","onMousedown"])})),128)),Object(y["createVNode"])(fi,{class:"operate-rotate-handler",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(a)/2+"px"}),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(t){return e.rotateElement(e.elementInfo)}),["stop"]))},null,8,["style"])],64)):Object(y["createCommentVNode"])("",!0)])}}}));const Pi=Ri;var Hi=Pi,qi={class:"common-element-operate"},Ui={inheritAttrs:!1},Gi=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},Ui),{},{__name:"CommonElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return t.elementInfo.width*c.value})),a=Object(y["computed"])((function(){return t.elementInfo.height*c.value})),l=Qr(o,a),r=l.resizeHandlers,i=l.borderLines,u=Object(y["computed"])((function(){return["video","audio"].includes(t.elementInfo.type)}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",qi,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(i),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{class:"operate-border-line",key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(r),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.direction,type:t.direction,rotate:e.elementInfo.rotate,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleElement(n,e.elementInfo,t.direction)}),["stop"])},null,8,["type","rotate","style","onMousedown"])})),128)),Object(y["unref"])(u)?Object(y["createCommentVNode"])("",!0):(Object(y["openBlock"])(),Object(y["createBlock"])(fi,{key:0,class:"operate-rotate-handler",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(o)/2+"px"}),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(t){return e.rotateElement(e.elementInfo)}),["stop"]))},null,8,["style"]))],64)):Object(y["createCommentVNode"])("",!0)])}}}));const Xi=Gi;var Yi=Xi,Zi=function(){var e=ae(),t=at(),n=t.addHistorySnapshot,c=function(t,c){var o=/^(https?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/;if("web"===c.type&&!o.test(c.target))return Se["a"].error("不是正确的网页链接地址"),!1;var a={link:c};return e.updateElement({id:t.id,props:a}),n(),!0},o=function(t){e.removeElementProps({id:t.id,propName:"link"}),n()};return{setLink:c,removeLink:o}},Wi=["href"],Ji={key:1,class:"link"},Ki={class:"btns"},Qi=Object(y["defineComponent"])({__name:"LinkHandler",props:{elementInfo:{type:Object,required:!0},link:{type:Object,required:!0},openLinkDialog:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Zi(),a=o.removeLink,l=Object(y["computed"])((function(){return"line"===t.elementInfo.type?0:t.elementInfo.height}));return function(t,n){var o=Object(y["resolveComponent"])("Divider");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"link-handler",style:Object(y["normalizeStyle"])({top:Object(y["unref"])(l)*Object(y["unref"])(c)+10+"px"})},["web"===e.link.type?(Object(y["openBlock"])(),Object(y["createElementBlock"])("a",{key:0,class:"link",href:e.link.target,target:"_blank"},Object(y["toDisplayString"])(e.link.target),9,Wi)):(Object(y["openBlock"])(),Object(y["createElementBlock"])("a",Ji,"幻灯片页面 "+Object(y["toDisplayString"])(e.link.target),1)),Object(y["createElementVNode"])("div",Ki,[Object(y["createElementVNode"])("div",{class:"btn",onClick:n[0]||(n[0]=function(t){return e.openLinkDialog()})},"更换"),Object(y["createVNode"])(o,{type:"vertical"}),Object(y["createElementVNode"])("div",{class:"btn",onClick:n[1]||(n[1]=function(t){return Object(y["unref"])(a)(e.elementInfo)})},"移除")])],4)}}});n("7851");const $i=pn()(Qi,[["__scopeId","data-v-bb722fc0"]]);var eu=$i,tu={key:1,class:"animation-index"},nu=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},isSelected:{type:Boolean,required:!0},isActive:{type:Boolean,required:!0},isActiveGroupElement:{type:Boolean,required:!0},isMultiSelect:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0},dragLineElement:{type:Function,required:!0},moveShapeKeypoint:{type:Function,required:!0},openLinkDialog:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=n.toolbarState,a=Object(g["c"])(ae()),l=a.formatedAnimations,r=Object(y["computed"])((function(){var e,n=(e={},Object(pe["a"])(e,Ve.IMAGE,Oi),Object(pe["a"])(e,Ve.TEXT,gi),Object(pe["a"])(e,Ve.SHAPE,Ei),Object(pe["a"])(e,Ve.LINE,zi),Object(pe["a"])(e,Ve.TABLE,Hi),Object(pe["a"])(e,Ve.CHART,Yi),Object(pe["a"])(e,Ve.LATEX,Yi),Object(pe["a"])(e,Ve.VIDEO,Yi),Object(pe["a"])(e,Ve.AUDIO,Yi),e);return n[t.elementInfo.type]||null})),i=Object(y["computed"])((function(){for(var e=[],n=0;n0?de("-"):e.deltaY<0&&de("+"):e.deltaY>0?se(V.DOWN):e.deltaY<0&&se(V.UP)},be=function(){t.setGridLinesState(!r.value)},pe=function(){t.setRulerState(!i.value)},me=jc(O),Oe=me.insertElementFromCreateSelection,ve=function(){return[{text:"粘贴",subText:"Ctrl + V",handler:Q},{text:"全选",subText:"Ctrl + A",handler:Z},{text:"网格线",subText:r.value?"√":"",handler:be},{text:"标尺",subText:i.value?"√":"",handler:pe},{text:"重置当前页",handler:J},{divider:!0},{text:"幻灯片放映",subText:"F5",handler:ee}]};return Object(y["provide"])(tc,d),function(e,t){var n=Object(y["resolveComponent"])("Modal"),l=Object(y["resolveDirective"])("contextmenu"),r=Object(y["resolveDirective"])("click-outside");return Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"canvas",ref_key:"canvasRef",ref:C,onWheel:t[3]||(t[3]=function(e){return fe(e)}),onMousedown:t[4]||(t[4]=function(e){return oe(e)})},[Object(y["unref"])(u)?(Object(y["openBlock"])(),Object(y["createBlock"])(Kr,{key:0,onCreated:t[0]||(t[0]=function(e){return Object(y["unref"])(Oe)(e)})})):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",{class:"viewport-wrapper",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(w).width*Object(y["unref"])(d)+"px",height:Object(y["unref"])(w).height*Object(y["unref"])(d)+"px",left:Object(y["unref"])(w).left+"px",top:Object(y["unref"])(w).top+"px"})},[Object(y["createElementVNode"])("div",jd,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(v.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createBlock"])(Hr,{key:t,type:e.type,axis:e.axis,length:e.length,canvasScale:Object(y["unref"])(d)},null,8,["type","axis","length","canvasScale"])})),128)),Object(y["unref"])(c).length>1?(Object(y["openBlock"])(),Object(y["createBlock"])(ri,{key:0,elementList:x.value,scaleMultiElement:Object(y["unref"])(H)},null,8,["elementList","scaleMultiElement"])):Object(y["createCommentVNode"])("",!0),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(x.value,(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(ou,{key:e.id,elementInfo:e,isSelected:Object(y["unref"])(c).includes(e.id),isActive:Object(y["unref"])(a)===e.id,isActiveGroupElement:Object(y["unref"])(o)===e.id,isMultiSelect:Object(y["unref"])(c).length>1,rotateElement:Object(y["unref"])(U),scaleElement:Object(y["unref"])(P),openLinkDialog:h,dragLineElement:Object(y["unref"])(z),moveShapeKeypoint:Object(y["unref"])(X)},null,8,["elementInfo","isSelected","isActive","isActiveGroupElement","isMultiSelect","rotateElement","scaleElement","dragLineElement","moveShapeKeypoint"])})),128)),Object(y["createVNode"])(Ar)]),Object(y["createElementVNode"])("div",{class:"viewport",ref_key:"viewportRef",ref:O,style:Object(y["normalizeStyle"])({transform:"scale(".concat(Object(y["unref"])(d),")")})},[Object(y["unref"])(S)?(Object(y["openBlock"])(),Object(y["createBlock"])(Br,{key:0,top:Object(y["unref"])(B).top,left:Object(y["unref"])(B).left,width:Object(y["unref"])(B).width,height:Object(y["unref"])(B).height,quadrant:Object(y["unref"])(L)},null,8,["top","left","width","height","quadrant"])):Object(y["createCommentVNode"])("",!0),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(x.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createBlock"])(wr,{key:e.id,elementInfo:e,elementIndex:t+1,isMultiSelect:Object(y["unref"])(c).length>1,selectElement:Object(y["unref"])(A),openLinkDialog:h},null,8,["elementInfo","elementIndex","isMultiSelect","selectElement"])})),128))],4)],4),Object(y["unref"])(m)?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",hd)):Object(y["createCommentVNode"])("",!0),Object(y["unref"])(i)?(Object(y["openBlock"])(),Object(y["createBlock"])(Xr,{key:2,viewportStyles:Object(y["unref"])(w)},null,8,["viewportStyles"])):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(n,{visible:j.value,"onUpdate:visible":t[2]||(t[2]=function(e){return j.value=e}),footer:null,centered:"",width:540,destroyOnClose:""},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(vd,{onClose:t[1]||(t[1]=function(e){return j.value=!1})})]})),_:1},8,["visible"])],32)),[[l,ve],[r,le]])}}});n("ead6");const gd=pn()(yd,[["__scopeId","data-v-1db12f3f"]]);var xd=gd,kd={class:"shape-pool"},Cd={class:"category-name"},Nd={class:"shape-list"},Ed=["onClick"],wd={overflow:"visible",width:"18",height:"18"},Vd=["transform"],Id=["fill","stroke","d"],Bd=Object(y["defineComponent"])({__name:"ShapePool",emits:["select"],setup:function(e,t){var n=t.emit,c=function(e){n("select",e)};return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",kd,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(ct),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"category",key:e.type},[Object(y["createElementVNode"])("div",Cd,Object(y["toDisplayString"])(e.type),1),Object(y["createElementVNode"])("div",Nd,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e.children,(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"shape-item",key:t},[Object(y["createElementVNode"])("div",{class:"shape-content",onClick:function(t){return c(e)}},[(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",wd,[Object(y["createElementVNode"])("g",{transform:"scale(".concat(18/e.viewBox[0],", ").concat(18/e.viewBox[1],") translate(0,0) matrix(1,0,0,1,0,0)")},[Object(y["createElementVNode"])("path",{class:Object(y["normalizeClass"])(["shape-path",{outlined:e.outlined}]),"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:e.outlined?"#999":"transparent",stroke:e.outlined?"transparent":"#999","stroke-width":"2",d:e.path},null,10,Id)],8,Vd)]))],8,Ed)])})),128))])])})),128))])}}});n("c24c9");const Sd=pn()(Bd,[["__scopeId","data-v-5788e0d2"]]);var Ld=Sd,_d=[{type:"直线",children:[{path:"M 0 0 L 20 20",style:"solid",points:["",""]},{path:"M 0 0 L 20 20",style:"dashed",points:["",""]},{path:"M 0 0 L 20 20",style:"solid",points:["","arrow"]},{path:"M 0 0 L 20 20",style:"dashed",points:["","arrow"]},{path:"M 0 0 L 20 20",style:"solid",points:["","dot"]}]},{type:"折线、曲线",children:[{path:"M 0 0 L 0 20 L 20 20",style:"solid",points:["","arrow"],isBroken:!0},{path:"M 0 0 Q 0 20 20 20",style:"solid",points:["","arrow"],isCurve:!0},{path:"M 0 0 C 20 0 0 20 20 20",style:"solid",points:["","arrow"],isCubic:!0}]}],Td={class:"line-pool"},Md={class:"category-name"},Dd={class:"line-list"},zd=["onClick"],Fd={overflow:"visible",width:"20",height:"20"},Ad=["d","stroke-dasharray","marker-start","marker-end"],Rd=Object(y["defineComponent"])({__name:"LinePool",emits:["select"],setup:function(e,t){var n=t.emit,c=function(e){n("select",e)};return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Td,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(_d),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"category",key:e.type},[Object(y["createElementVNode"])("div",Md,Object(y["toDisplayString"])(e.type),1),Object(y["createElementVNode"])("div",Dd,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e.children,(function(e,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"line-item",key:n},[Object(y["createElementVNode"])("div",{class:"line-content",onClick:function(t){return c(e)}},[(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",Fd,[Object(y["createElementVNode"])("defs",null,[e.points[0]?(Object(y["openBlock"])(),Object(y["createBlock"])(Fa,{key:0,class:"line-marker",id:"preset-line-".concat(t,"-").concat(n),position:"start",type:e.points[0],color:"currentColor",baseSize:2},null,8,["id","type"])):Object(y["createCommentVNode"])("",!0),e.points[1]?(Object(y["openBlock"])(),Object(y["createBlock"])(Fa,{key:1,class:"line-marker",id:"preset-line-".concat(t,"-").concat(n),position:"end",type:e.points[1],color:"currentColor",baseSize:2},null,8,["id","type"])):Object(y["createCommentVNode"])("",!0)]),Object(y["createElementVNode"])("path",{class:"line-path",d:e.path,stroke:"currentColor",fill:"none","stroke-width":"2","stroke-dasharray":"solid"===e.style?"0, 0":"4, 1","marker-start":e.points[0]?"url(#".concat("preset-line-".concat(t,"-").concat(n),"-",e.points[0],"-start)"):"","marker-end":e.points[1]?"url(#".concat("preset-line-".concat(t,"-").concat(n),"-",e.points[1],"-end)"):""},null,8,Ad)]))],8,zd)])})),128))])])})),128))])}}});n("3836");const Pd=pn()(Rd,[["__scopeId","data-v-bca68faa"]]);var Hd=Pd,qd={class:"chart-pool"},Ud=["onClick"],Gd=Object(y["defineComponent"])({__name:"ChartPool",emits:["select"],setup:function(e,t){var n=t.emit,c=["bar","horizontalBar","line","area","scatter","pie","ring"],o=function(e){n("select",e)};return function(e,t){var n=Object(y["resolveComponent"])("IconChartLine"),a=Object(y["resolveComponent"])("IconChartHistogram"),l=Object(y["resolveComponent"])("IconChartPie"),r=Object(y["resolveComponent"])("IconChartHistogramOne"),i=Object(y["resolveComponent"])("IconChartLineArea"),u=Object(y["resolveComponent"])("IconChartRing"),d=Object(y["resolveComponent"])("IconChartScatter");return Object(y["openBlock"])(),Object(y["createElementBlock"])("ul",qd,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(c,(function(e,t){return Object(y["createElementVNode"])("li",{class:"chart-item",key:t},[Object(y["createElementVNode"])("div",{class:"chart-content",onClick:function(t){return o(e)}},["line"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(n,{key:0,size:"24"})):"bar"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(a,{key:1,size:"24"})):"pie"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(l,{key:2,size:"24"})):"horizontalBar"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(r,{key:3,size:"24"})):"area"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(i,{key:4,size:"24"})):"ring"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(u,{key:5,size:"24"})):"scatter"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(d,{key:6,size:"24"})):Object(y["createCommentVNode"])("",!0)],8,Ud)])})),64))])}}});n("24bc");const Xd=pn()(Gd,[["__scopeId","data-v-3870b42e"]]);var Yd=Xd,Zd=function(e){return Object(y["pushScopeId"])("data-v-144fbd05"),e=e(),Object(y["popScopeId"])(),e},Wd={class:"table-generator"},Jd={class:"title"},Kd={class:"lef"},Qd=["onMouseenter"],$d={key:1,class:"custom"},es={class:"row"},ts=Zd((function(){return Object(y["createElementVNode"])("div",{class:"label",style:{flex:"1"}},"行数:",-1)})),ns={class:"row"},cs=Zd((function(){return Object(y["createElementVNode"])("div",{class:"label",style:{flex:"1"}},"列数:",-1)})),os={class:"btns"},as=Object(y["createTextVNode"])("取消"),ls=Object(y["createTextVNode"])("确认"),rs=Object(y["defineComponent"])({__name:"TableGenerator",emits:["insert","close"],setup:function(e,t){var n=t.emit,c=Object(y["ref"])([]),o=Object(y["ref"])(3),a=Object(y["ref"])(3),l=Object(y["ref"])(!1),r=function(){if(c.value.length){var e=Object(me["a"])(c.value,2),t=e[0],o=e[1];n("insert",{row:t,col:o})}},i=function(){return o.value<1||o.value>20||a.value<1||a.value>20?Se["a"].warning("行数/列数必须在0~20之间!"):(n("insert",{row:o.value,col:a.value}),void(l.value=!1))},u=function(){n("close"),l.value=!1};return function(e,t){var n=Object(y["resolveComponent"])("InputNumber"),d=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Wd,[Object(y["createElementVNode"])("div",Jd,[Object(y["createElementVNode"])("div",Kd,"表格 "+Object(y["toDisplayString"])(c.value.length?"".concat(c.value[0]," x ").concat(c.value[1]):""),1),Object(y["createElementVNode"])("div",{class:"right",onClick:t[0]||(t[0]=function(e){return l.value=!l.value})},Object(y["toDisplayString"])(l.value?"返回":"自定义"),1)]),l.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",$d,[Object(y["createElementVNode"])("div",es,[ts,Object(y["createVNode"])(n,{min:1,max:20,value:o.value,"onUpdate:value":t[3]||(t[3]=function(e){return o.value=e}),style:{flex:"3"}},null,8,["value"])]),Object(y["createElementVNode"])("div",ns,[cs,Object(y["createVNode"])(n,{min:1,max:20,value:a.value,"onUpdate:value":t[4]||(t[4]=function(e){return a.value=e}),style:{flex:"3"}},null,8,["value"])]),Object(y["createElementVNode"])("div",os,[Object(y["createVNode"])(d,{class:"btn",onClick:t[5]||(t[5]=function(e){return u()})},{default:Object(y["withCtx"])((function(){return[as]})),_:1}),Object(y["createVNode"])(d,{class:"btn",type:"primary",onClick:t[6]||(t[6]=function(e){return i()})},{default:Object(y["withCtx"])((function(){return[ls]})),_:1})])])):(Object(y["openBlock"])(),Object(y["createElementBlock"])("table",{key:0,onMouseleave:t[1]||(t[1]=function(e){return c.value=[]}),onClick:t[2]||(t[2]=function(e){return r()})},[Object(y["createElementVNode"])("tbody",null,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(10,(function(e){return Object(y["createElementVNode"])("tr",{key:e},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(10,(function(t){return Object(y["createElementVNode"])("td",{onMouseenter:function(n){return c.value=[e,t]},key:t},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["cell",{active:c.value.length&&e<=c.value[0]&&t<=c.value[1]}])},null,2)],40,Qd)})),64))])})),64))])],32))])}}});n("307a");const is=pn()(rs,[["__scopeId","data-v-144fbd05"]]);var us=is,ds={class:"media-input"},ss={class:"tabs"},fs=["onClick"],bs={class:"btns"},ps=Object(y["createTextVNode"])("取消"),ms=Object(y["createTextVNode"])("确认"),Os={class:"btns"},vs=Object(y["createTextVNode"])("取消"),js=Object(y["createTextVNode"])("确认"),hs=Object(y["defineComponent"])({__name:"MediaInput",emits:["insertVideo","insertAudio","close"],setup:function(e,t){var n=t.emit,c=Object(y["ref"])("video"),o=Object(y["ref"])("https://mazwai.com/videvo_files/video/free/2019-01/small_watermarked/181004_04_Dolphins-Whale_06_preview.webm"),a=Object(y["ref"])("https://freesound.org/data/previews/614/614107_11861866-lq.mp3"),l=[{key:"video",label:"视频"},{key:"audio",label:"音频"}],r=function(){if(!o.value)return Se["a"].error("请先输入正确的视频地址");n("insertVideo",o.value)},i=function(){if(!a.value)return Se["a"].error("请先输入正确的音频地址");n("insertAudio",a.value)};return function(e,t){var u=Object(y["resolveComponent"])("Input"),d=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ds,[Object(y["createElementVNode"])("div",ss,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(l,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tab",{active:c.value===e.key}]),key:e.key,onClick:function(t){return c.value=e.key}},Object(y["toDisplayString"])(e.label),11,fs)})),64))]),"video"===c.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createVNode"])(u,{value:o.value,"onUpdate:value":t[0]||(t[0]=function(e){return o.value=e}),placeholder:"请输入视频地址,e.g. https://xxx.mp4"},null,8,["value"]),Object(y["createElementVNode"])("div",bs,[Object(y["createVNode"])(d,{onClick:t[1]||(t[1]=function(e){return n("close")}),style:{"margin-right":"10px"}},{default:Object(y["withCtx"])((function(){return[ps]})),_:1}),Object(y["createVNode"])(d,{type:"primary",onClick:t[2]||(t[2]=function(e){return r()})},{default:Object(y["withCtx"])((function(){return[ms]})),_:1})])],64)):Object(y["createCommentVNode"])("",!0),"audio"===c.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:1},[Object(y["createVNode"])(u,{value:a.value,"onUpdate:value":t[3]||(t[3]=function(e){return a.value=e}),placeholder:"请输入音频地址,e.g. https://xxx.mp3"},null,8,["value"]),Object(y["createElementVNode"])("div",Os,[Object(y["createVNode"])(d,{onClick:t[4]||(t[4]=function(e){return n("close")}),style:{"margin-right":"10px"}},{default:Object(y["withCtx"])((function(){return[vs]})),_:1}),Object(y["createVNode"])(d,{type:"primary",onClick:t[5]||(t[5]=function(e){return i()})},{default:Object(y["withCtx"])((function(){return[js]})),_:1})])],64)):Object(y["createCommentVNode"])("",!0)])}}});n("4675");const ys=pn()(hs,[["__scopeId","data-v-b9437110"]]);var gs=ys,xs=n("e5ca");xs["a"].SUB_SUP_SCALE=.5;var ks=[{label:"高斯公式",latex:"\\int\\int\\int _ { \\Omega } \\left( \\frac { \\partial {P} } { \\partial {x} } + \\frac { \\partial {Q} } { \\partial {y} } + \\frac { \\partial {R} }{ \\partial {z} } \\right) \\mathrm { d } V = \\oint _ { \\partial \\Omega } ( P \\cos \\alpha + Q \\cos \\beta + R \\cos \\gamma ) \\mathrm{ d} S"},{label:"傅里叶级数",latex:"f(x) = \\frac {a_0} 2 + \\sum_{n = 1}^\\infty {({a_n}\\cos {nx} + {b_n}\\sin {nx})}"},{label:"泰勒展开式",latex:"e ^ { x } = 1 + \\frac { x } { 1 ! } + \\frac { x ^ { 2 } } { 2 ! } + \\frac { x ^ { 3 } } { 3 ! } + ... , \\quad - \\infty < x < \\infty"},{label:"定积分",latex:"\\lim_ { n \\rightarrow + \\infty } \\sum _ { i = 1 } ^ { n } f \\left[ a + \\frac { i } { n } ( b - a ) \\right] \\frac { b - a } { n } = \\int _ { a } ^ { b } f ( x ) dx"},{label:"三角恒等式1",latex:"\\sin \\alpha \\pm \\sin \\beta = 2 \\sin \\frac { 1 } { 2 } ( \\alpha \\pm \\beta ) \\cos \\frac { 1 } { 2 } ( \\alpha \\mp \\beta )"},{label:"三角恒等式2",latex:"\\cos \\alpha + \\cos \\beta = 2 \\cos \\frac { 1 } { 2 } ( \\alpha + \\beta ) \\cos \\frac { 1 } { 2 } ( \\alpha - \\beta )"},{label:"和的展开式",latex:"( 1 + x ) ^ { n } = 1 + \\frac { n x } { 1 ! } + \\frac { n ( n - 1 ) x ^ { 2 } } { 2 ! } + ..."},{label:"欧拉公式",latex:" e^{ix} = \\cos {x} + i\\sin {x}"},{label:"贝努利方程",latex:"\\frac {dy} {dx} + P(x)y = Q(x) y^n ({n} \\not= {0,1})"},{label:"全微分方程",latex:"du(x,y) = P(x,y)dx + Q(x,y)dy = 0"},{label:"非齐次方程",latex:"y = (\\int Q(x) e^{\\int {P(x)dx}}dx + C)e^{-\\int {P(x)dx}}"},{label:"柯西中值定理",latex:"\\frac{{f(b) - f(a)}}{{F(b) - F(a)}} = \\frac{{f'(\\xi )}}{{F'(\\xi )}}"},{label:"拉格朗日中值定理",latex:"f(b) - f(a) = f'(\\xi )(b - a)"},{label:"导数公式",latex:"(\\arcsin x)' = \\frac{1}{{\\sqrt {1 - x^2} }}"},{label:"三角函数积分",latex:"\\int {tgxdx = - \\ln \\left| {\\cos x} \\right| + C}"},{label:"二次曲面",latex:"\\frac{{{x^2}}}{{{a^2}}} + \\frac{{{y^2}}}{{{b^2}}} - \\frac{{{z^2}}}{{{c^2}}} = 1"},{label:"二阶微分",latex:"\\frac {{d^2}y} {dx^2} + P(x) \\frac {dy} {dx} + Q(x)y = f(x)"},{label:"方向导数",latex:"\\frac{{\\partial f}}{{\\partial l}} = \\frac{{\\partial f}}{{\\partial x}}\\cos \\phi + \\frac{{\\partial f}}{{\\partial y}}\\sin \\phi"}],Cs=[{type:"operators",label:"数学",children:[{latex:"\\cdot"},{latex:"\\pm"},{latex:"\\mp"},{latex:"+"},{latex:"-"},{latex:"\\times"},{latex:"\\div"},{latex:"<"},{latex:">"},{latex:"="},{latex:"\\neq\\ne"},{latex:"\\leqq"},{latex:"\\geqq"},{latex:"\\leq"},{latex:"\\geq"},{latex:"\\propto"},{latex:"\\sim"},{latex:"\\equiv"},{latex:"\\dagger"},{latex:"\\ddagger"},{latex:"\\ell"},{latex:"\\#"},{latex:"\\$"},{latex:"\\&"},{latex:"\\%"},{latex:"\\langle\\rangle"},{latex:"()"},{latex:"[]"},{latex:"\\{\\}"},{latex:"||"},{latex:"\\|"},{latex:"\\exists"},{latex:"\\in"},{latex:"\\subset"},{latex:"\\supset"},{latex:"\\cup"},{latex:"\\cap"},{latex:"\\infty"},{latex:"\\partial"},{latex:"\\nabla"},{latex:"\\aleph"},{latex:"\\wp"},{latex:"\\therefore"},{latex:"\\mid"},{latex:"\\sum"},{latex:"\\prod"},{latex:"\\bigoplus"},{latex:"\\bigodot"},{latex:"\\int"},{latex:"\\oint"},{latex:"\\oplus"},{latex:"\\odot"},{latex:"\\perp"},{latex:"\\angle"},{latex:"\\triangle"},{latex:"\\Box"},{latex:"\\rightarrow"},{latex:"\\to"},{latex:"\\leftarrow"},{latex:"\\gets"},{latex:"\\circ"},{latex:"\\bigcirc"},{latex:"\\bullet"},{latex:"\\star"},{latex:"\\diamond"},{latex:"\\ast"},{latex:","},{latex:"."},{latex:";"},{latex:"!"}]},{type:"group",label:"组合",children:[{latex:"\\frac{a}{b}"},{latex:"\\frac{dx}{dx}"},{latex:"\\frac{\\partial a}{\\partial b}"},{latex:"\\sqrt{x}"},{latex:"\\sqrt[n]{x}"},{latex:"x^{n}"},{latex:"x_{n}"},{latex:"x_a^b"},{latex:"\\int_{a}^{b}"},{latex:"\\oint_a^b"},{latex:"\\lim_{a \\rightarrow b}"},{latex:"\\prod_a^b"},{latex:"\\sum_a^b"},{latex:"\\left(\\begin{array}a \\\\ b\\end{array}\\right)"},{latex:"\\begin{bmatrix}a & b \\\\ c & d \\end{bmatrix}"},{latex:"\\begin{cases}a & x = 0 \\\\ b & x > 0\\end{cases}"},{latex:"\\hat{a}"},{latex:"\\breve{a}"},{latex:"\\acute{a}"},{latex:"\\grave{a}"},{latex:"\\tilde{a}"},{latex:"\\bar{a}"},{latex:"\\vec{a}"},{latex:"\\underline{a}"},{latex:"\\overline{a}"},{latex:"\\widehat{ab}"},{latex:"\\overleftarrow{ab}"},{latex:"\\overrightarrow{ab}"}]},{type:"verbatim",label:"函数",children:[{latex:"\\log"},{latex:"\\ln"},{latex:"\\exp"},{latex:"\\mod"},{latex:"\\lim"},{latex:"\\sin"},{latex:"\\cos"},{latex:"\\tan"},{latex:"\\csc"},{latex:"\\sec"},{latex:"\\cot"},{latex:"\\sinh"},{latex:"\\cosh"},{latex:"\\tanh"},{latex:"\\csch"},{latex:"\\sech"},{latex:"\\coth"},{latex:"\\arcsin"},{latex:"\\arccos"},{latex:"\\arctan"},{latex:"\\arccsc"},{latex:"\\arcsec"},{latex:"\\arccot"}]},{type:"greek",label:"希腊字母",children:[{latex:"\\alpha"},{latex:"\\beta"},{latex:"\\gamma"},{latex:"\\delta"},{latex:"\\varepsilon"},{latex:"\\zeta"},{latex:"\\eta"},{latex:"\\vartheta"},{latex:"\\iota"},{latex:"\\kappa"},{latex:"\\lambda"},{latex:"\\mu"},{latex:"\\nu"},{latex:"\\xi"},{latex:"\\omicron"},{latex:"\\pi"},{latex:"\\rho"},{latex:"\\sigma"},{latex:"\\tau"},{latex:"\\upsilon"},{latex:"\\varphi"},{latex:"\\chi"},{latex:"\\psi"},{latex:"\\omega"},{latex:"\\epsilon"},{latex:"\\theta"},{latex:"\\phi"},{latex:"\\varsigma"},{latex:"\\Alpha"},{latex:"\\Beta"},{latex:"\\Gamma"},{latex:"\\Delta"},{latex:"\\Epsilon"},{latex:"\\Zeta"},{latex:"\\Eta"},{latex:"\\Theta"},{latex:"\\Iota"},{latex:"\\Kappa"},{latex:"\\Lambda"},{latex:"\\Mu"},{latex:"\\Nu"},{latex:"\\Xi"},{latex:"\\Omicron"},{latex:"\\Pi"},{latex:"\\Rho"},{latex:"\\Sigma"},{latex:"\\Tau"},{latex:"\\Upsilon"},{latex:"\\Phi"},{latex:"\\Chi"},{latex:"\\Psi"},{latex:"\\Omega"}]}],Ns=["width","height"],Es=["transform"],ws=["d"],Vs=Object(y["defineComponent"])({__name:"FormulaContent",props:{latex:{type:String,required:!0},width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(e){var t=e,n=Object(y["ref"])({x:0,y:0,w:0,h:0}),c=Object(y["ref"])("");Object(y["watch"])((function(){return t.latex}),(function(){var e=new xs["b"](t.latex);c.value=e.pathd({}),n.value=e.box({})}),{immediate:!0});var o=Object(y["computed"])((function(){var e=n.value.w+32,c=n.value.h+32;return e>t.width||c>t.height?e/c>t.width/t.height?t.width/e:t.height/c:1}));return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{class:"formula-content",overflow:"visible",width:n.value.w+32,height:n.value.h+32,stroke:"#000","stroke-width":"1",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[Object(y["createElementVNode"])("g",{transform:"scale(".concat(Object(y["unref"])(o),", ").concat(Object(y["unref"])(o),") translate(0,0) matrix(1,0,0,1,0,0)"),"transform-origin":"0 50%"},[Object(y["createElementVNode"])("path",{d:c.value},null,8,ws)],8,Es)],8,Ns)}}});n("e9df");const Is=pn()(Vs,[["__scopeId","data-v-1c41d9fe"]]);var Bs=Is,Ss=["innerHTML"],Ls=Object(y["defineComponent"])({__name:"SymbolContent",props:{latex:{type:String,required:!0}},setup:function(e){var t=e,n=Object(y["computed"])((function(){var e=new xs["b"](t.latex);return e.svg({SCALE_X:10,SCALE_Y:10})}));return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"symbol-content",innerHTML:Object(y["unref"])(n)},null,8,Ss)}}});const _s=Ls;var Ts=_s,Ms={class:"latex-editor"},Ds={class:"container"},zs={class:"left"},Fs={class:"input-area"},As={class:"preview"},Rs={key:0,class:"placeholder"},Ps={key:1,class:"preview-content"},Hs={class:"right"},qs={class:"tabs"},Us=["onClick"],Gs={class:"content"},Xs={key:0,class:"symbol"},Ys={class:"symbol-tabs"},Zs=["onClick"],Ws={class:"symbol-pool"},Js=["onClick"],Ks={key:1,class:"formula"},Qs={class:"formula-title"},$s=["onClick"],ef={class:"footer"},tf=Object(y["createTextVNode"])("取消"),nf=Object(y["createTextVNode"])("确定"),cf=Object(y["defineComponent"])({__name:"index",props:{value:{type:String,default:""}},emits:["update","close"],setup:function(e,t){var n=t.emit,c=e,o=[{label:"常用符号",value:"symbol"},{label:"预置公式",value:"formula"}],a=ks,l=Cs,r=Object(y["ref"])(""),i=Object(y["ref"])("symbol"),u=Object(y["ref"])(),d=Object(y["ref"])(Cs[0].type),s=Object(y["computed"])((function(){var e=Cs.find((function(e){return e.type===d.value}));return(null===e||void 0===e?void 0:e.children)||[]}));Object(y["onMounted"])((function(){c.value&&(r.value=c.value)}));var f=function(){if(!r.value)return Se["a"].error("公式不能为空");var e=new xs["b"](r.value),t=e.pathd({}),c=e.box({});n("update",{latex:r.value,path:t,w:c.w+32,h:c.h+32})},b=function(e){u.value&&(u.value.focus(),document.execCommand("insertText",!1,e))};return function(e,t){var c=Object(y["resolveComponent"])("TextArea"),p=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Ms,[Object(y["createElementVNode"])("div",Ds,[Object(y["createElementVNode"])("div",zs,[Object(y["createElementVNode"])("div",Fs,[Object(y["createVNode"])(c,{value:r.value,"onUpdate:value":t[0]||(t[0]=function(e){return r.value=e}),placeholder:"输入 LaTeX 公式",ref_key:"textAreaRef",ref:u},null,8,["value"])]),Object(y["createElementVNode"])("div",As,[r.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Ps,[Object(y["createVNode"])(Bs,{width:518,height:138,latex:r.value},null,8,["latex"])])):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Rs,"公式预览"))])]),Object(y["createElementVNode"])("div",Hs,[Object(y["createElementVNode"])("div",qs,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(o,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tab",{active:e.value===i.value}]),key:e.value,onClick:function(t){return i.value=e.value}},Object(y["toDisplayString"])(e.label),11,Us)})),64))]),Object(y["createElementVNode"])("div",Gs,["symbol"===i.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Xs,[Object(y["createElementVNode"])("div",Ys,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(l),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["symbol-tab",{active:d.value===e.type}]),key:e.type,onClick:function(t){return d.value=e.type}},Object(y["toDisplayString"])(e.label),11,Zs)})),128))]),Object(y["createElementVNode"])("div",Ws,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(s),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"symbol-item",key:e.latex,onClick:function(t){return b(e.latex)}},[Object(y["createVNode"])(Ts,{latex:e.latex},null,8,["latex"])],8,Js)})),128))])])):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Ks,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(a),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"formula-item",key:e.label},[Object(y["createElementVNode"])("div",Qs,Object(y["toDisplayString"])(e.label),1),Object(y["createElementVNode"])("div",{class:"formula-item-content",onClick:function(t){return r.value=e.latex}},[Object(y["createVNode"])(Bs,{width:236,height:60,latex:e.latex},null,8,["latex"])],8,$s)])})),128))]))])])]),Object(y["createElementVNode"])("div",ef,[Object(y["createVNode"])(p,{class:"btn",onClick:t[1]||(t[1]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[tf]})),_:1}),Object(y["createVNode"])(p,{class:"btn",type:"primary",onClick:t[2]||(t[2]=function(e){return f()})},{default:Object(y["withCtx"])((function(){return[nf]})),_:1})])])}}});n("1933");const of=pn()(cf,[["__scopeId","data-v-2d73bf28"]]);var af=of,lf={class:"canvas-tool"},rf={class:"left-handler"},uf={class:"add-element-handler"},df={class:"right-handler"},sf={class:"viewport-size-preset"},ff=["onClick"],bf={class:"text"},pf=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=ie(),n=Object(g["c"])(t),c=n.creatingElement,o=Object(g["c"])(xe()),a=o.canUndo,l=o.canRedo,r=at(),i=r.redo,u=r.undo,d=gt(),s=d.scaleCanvas,f=d.setCanvasScalePercentage,b=d.resetCanvas,p=d.canvasScalePercentage,m=[200,150,100,80,50],O=Object(y["ref"])(!1),v=function(e){f(e),O.value=!1},j=lt(),h=j.createImageElement,x=j.createChartElement,k=j.createTableElement,C=j.createLatexElement,N=j.createVideoElement,E=j.createAudioElement,w=function(e){var t=e[0];t&&et(t).then((function(e){return h(e)}))},V=Object(y["ref"])(!1),I=Object(y["ref"])(!1),B=Object(y["ref"])(!1),S=Object(y["ref"])(!1),L=Object(y["ref"])(!1),_=Object(y["ref"])(!1),T=function(){t.setCreatingElement({type:"text"})},M=function(e){t.setCreatingElement({type:"shape",data:e}),V.value=!1},D=function(e){t.setCreatingElement({type:"line",data:e}),I.value=!1};return function(e,t){var n=Object(y["resolveComponent"])("IconBack"),o=Object(y["resolveComponent"])("Tooltip"),r=Object(y["resolveComponent"])("IconNext"),d=Object(y["resolveComponent"])("IconFontSize"),f=Object(y["resolveComponent"])("IconPicture"),j=Object(y["resolveComponent"])("FileInput"),h=Object(y["resolveComponent"])("IconGraphicDesign"),g=Object(y["resolveComponent"])("Popover"),z=Object(y["resolveComponent"])("IconConnection"),F=Object(y["resolveComponent"])("IconChartProportion"),A=Object(y["resolveComponent"])("IconInsertTable"),R=Object(y["resolveComponent"])("IconFormula"),P=Object(y["resolveComponent"])("IconVideoTwo"),H=Object(y["resolveComponent"])("IconMinus"),q=Object(y["resolveComponent"])("IconPlus"),U=Object(y["resolveComponent"])("IconFullScreen"),G=Object(y["resolveComponent"])("Modal");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",lf,[Object(y["createElementVNode"])("div",rf,[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"撤销"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{class:Object(y["normalizeClass"])(["handler-item",{disable:!Object(y["unref"])(a)}]),onClick:t[0]||(t[0]=function(e){return Object(y["unref"])(u)()})},null,8,["class"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"重做"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r,{class:Object(y["normalizeClass"])(["handler-item",{disable:!Object(y["unref"])(l)}]),onClick:t[1]||(t[1]=function(e){return Object(y["unref"])(i)()})},null,8,["class"])]})),_:1},8,["mouseEnterDelay"])]),Object(y["createElementVNode"])("div",uf,[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入文字"},{default:Object(y["withCtx"])((function(){var e;return[Object(y["createVNode"])(d,{class:Object(y["normalizeClass"])(["handler-item",{active:"text"===(null===(e=Object(y["unref"])(c))||void 0===e?void 0:e.type)}]),onClick:t[2]||(t[2]=function(e){return T()})},null,8,["class"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{onChange:t[3]||(t[3]=function(e){return w(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入图片"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{class:"handler-item"})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(g,{trigger:"click",visible:V.value,"onUpdate:visible":t[5]||(t[5]=function(e){return V.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Ld,{onSelect:t[4]||(t[4]=function(e){return M(e)})})]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入形状"},{default:Object(y["withCtx"])((function(){var e;return[Object(y["createVNode"])(h,{class:Object(y["normalizeClass"])(["handler-item",{active:"shape"===(null===(e=Object(y["unref"])(c))||void 0===e?void 0:e.type)}])},null,8,["class"])]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["visible"]),Object(y["createVNode"])(g,{trigger:"click",visible:I.value,"onUpdate:visible":t[7]||(t[7]=function(e){return I.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hd,{onSelect:t[6]||(t[6]=function(e){return D(e)})})]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入线条"},{default:Object(y["withCtx"])((function(){var e;return[Object(y["createVNode"])(z,{class:Object(y["normalizeClass"])(["handler-item",{active:"line"===(null===(e=Object(y["unref"])(c))||void 0===e?void 0:e.type)}])},null,8,["class"])]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["visible"]),Object(y["createVNode"])(g,{trigger:"click",visible:B.value,"onUpdate:visible":t[9]||(t[9]=function(e){return B.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Yd,{onSelect:t[8]||(t[8]=function(e){Object(y["unref"])(x)(e),B.value=!1})})]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入图表"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(F,{class:"handler-item"})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["visible"]),Object(y["createVNode"])(g,{trigger:"click",visible:S.value,"onUpdate:visible":t[12]||(t[12]=function(e){return S.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(us,{onClose:t[10]||(t[10]=function(e){return S.value=!1}),onInsert:t[11]||(t[11]=function(e){var t=e.row,n=e.col;Object(y["unref"])(k)(t,n),S.value=!1})})]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入表格"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(A,{class:"handler-item"})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["visible"]),Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入公式"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{class:"handler-item",onClick:t[13]||(t[13]=function(e){return _.value=!0})})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(g,{trigger:"click",visible:L.value,"onUpdate:visible":t[17]||(t[17]=function(e){return L.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(gs,{onClose:t[14]||(t[14]=function(e){return L.value=!1}),onInsertVideo:t[15]||(t[15]=function(e){Object(y["unref"])(N)(e),L.value=!1}),onInsertAudio:t[16]||(t[16]=function(e){Object(y["unref"])(E)(e),L.value=!1})})]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入音视频"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(P,{class:"handler-item"})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["visible"])]),Object(y["createElementVNode"])("div",df,[Object(y["createVNode"])(H,{class:"handler-item viewport-size",onClick:t[18]||(t[18]=function(e){return Object(y["unref"])(s)("-")})}),Object(y["createVNode"])(g,{trigger:"click",visible:O.value,"onUpdate:visible":t[19]||(t[19]=function(e){return O.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",sf,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(m,(function(e){return Object(y["createElementVNode"])("div",{class:"preset-item",key:e,onClick:function(t){return v(e)}},Object(y["toDisplayString"])(e)+"%",9,ff)})),64))])]})),default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",bf,Object(y["toDisplayString"])(Object(y["unref"])(p)),1)]})),_:1},8,["visible"]),Object(y["createVNode"])(q,{class:"handler-item viewport-size",onClick:t[20]||(t[20]=function(e){return Object(y["unref"])(s)("+")})}),Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"适应屏幕"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(U,{class:"handler-item viewport-size-adaptation",onClick:t[21]||(t[21]=function(e){return Object(y["unref"])(b)()})})]})),_:1},8,["mouseEnterDelay"])]),Object(y["createVNode"])(G,{visible:_.value,"onUpdate:visible":t[24]||(t[24]=function(e){return _.value=e}),footer:null,centered:"",width:880,destroyOnClose:""},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(af,{onClose:t[22]||(t[22]=function(e){return _.value=!1}),onUpdate:t[23]||(t[23]=function(e){Object(y["unref"])(C)(e),_.value=!1})})]})),_:1},8,["visible"])])}}});n("9ff2");const mf=pn()(pf,[["__scopeId","data-v-5d4eff54"]]);var Of=mf,vf=function(){var e=Object(g["c"])(ae()),t=e.slides,n=Object(y["ref"])(null),c=Object(y["ref"])(50),o=function e(){t.value.length>c.value?n.value=setTimeout((function(){c.value=c.value+20,e()}),600):c.value=9999};return Object(y["onMounted"])(o),Object(y["onUnmounted"])((function(){n.value&&clearTimeout(n.value)})),{slidesLoadLimit:c}},jf=n("b76a"),hf=n.n(jf),yf={class:"layout-pool"},gf=["onClick"],xf=Object(y["defineComponent"])({__name:"LayoutPool",emits:["select"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.layouts,a=function(e){n("select",e)};return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",yf,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(o),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"layout-item",key:e.id,onClick:function(t){return a(e)}},[Object(y["createVNode"])(ad,{class:"thumbnail",slide:e,size:180},null,8,["slide"])],8,gf)})),128))])}}});n("3328");const kf=pn()(xf,[["__scopeId","data-v-cc6b7dca"]]);var Cf=kf,Nf={class:"add-slide"},Ef=Object(y["createTextVNode"])("添加幻灯片"),wf={class:"select-btn"},Vf=["onMousedown"],If=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=ie(),n=ae(),c=ke(),o=Object(g["c"])(t),a=o.selectedSlidesIndex,l=o.thumbnailsFocus,r=Object(g["c"])(n),i=r.slides,u=r.slideIndex,d=Object(g["c"])(c),s=d.ctrlKeyState,f=d.shiftKeyState,b=vf(),p=b.slidesLoadLimit,m=Object(y["computed"])((function(){return[].concat(Object(Q["a"])(a.value),[u.value])})),O=Object(y["ref"])(!1),v=ut(),j=v.copySlide,h=v.pasteSlide,x=v.createSlide,k=v.createSlideByTemplate,C=v.copyAndPasteSlide,N=v.deleteSlide,E=v.cutSlide,w=v.selectAllSlide,V=function(e){t.setActiveElementIdList([]),u.value!==e&&n.updateSlideIndex(e)},I=function(e,n){var c=m.value.length>1;if(!c||!m.value.includes(n)||0===e.button)if(s.value)if(u.value===n){if(!c)return;var o=m.value.filter((function(e){return e!==n}));t.updateSelectedSlidesIndex(o),V(m.value[0])}else if(m.value.includes(n)){var a=m.value.filter((function(e){return e!==n}));t.updateSelectedSlidesIndex(a)}else{var l=[].concat(Object(Q["a"])(m.value),[n]);t.updateSelectedSlidesIndex(l),V(n)}else if(f.value){if(u.value===n&&!c)return;var r=Math.min.apply(Math,Object(Q["a"])(m.value)),i=n;n=99}])},Object(y["toDisplayString"])(Object(y["unref"])(Ne)(n+1,2)),3),Object(y["createVNode"])(ad,{class:"thumbnail",slide:t,size:120,visible:n1&&void 0!==arguments[1]?arguments[1]:0,n=l.value,c=m(),a=c.originClipRange,i=c.originWidth,u=c.originHeight,d=c.originLeft,s=c.originTop;if(t){var f,O=u/i,v=0,j=100;if(O>t){var h=(1-t/O)/2*100;f=[[v,h],[j,j-h]]}else{var y=(1-O/t)/2*100;f=[[y,v],[j-y,j]]}o.updateElement({id:r.value,props:{clip:Object(S["a"])(Object(S["a"])({},n.clip),{},{shape:e,range:f}),left:d+i*(f[0][0]/100),top:s+u*(f[0][1]/100),width:i*(f[1][0]-f[0][0])/100,height:u*(f[1][1]-f[0][1])/100}})}else o.updateElement({id:r.value,props:{clip:Object(S["a"])(Object(S["a"])({},n.clip),{},{shape:e,range:a})}});p(),b()},v=function(e){var t=e[0];t&&(et(t).then((function(e){var t={src:e};o.updateElement({id:r.value,props:t})})),b())},j=function(){var e=l.value;if(e.clip){var t=m(),n=t.originWidth,c=t.originHeight,a=t.originLeft,i=t.originTop;o.updateElement({id:r.value,props:{left:a,top:i,width:n,height:c}})}o.removeElementProps({id:r.value,propName:["clip","outline","flip","shadow","filters"]}),b()},h=function(){var e=l.value,t=Object(S["a"])(Object(S["a"])({},u.value.background),{},{type:"image",image:e.src,imageSize:"cover"});o.updateSlide({background:t}),b()};return function(e,c){var o=Object(y["resolveComponent"])("IconTailoring"),a=Object(y["resolveComponent"])("Button"),l=Object(y["resolveComponent"])("ButtonGroup"),r=Object(y["resolveComponent"])("IconDown"),i=Object(y["resolveComponent"])("Popover"),u=Object(y["resolveComponent"])("Divider"),f=Object(y["resolveComponent"])("IconTransform"),b=Object(y["resolveComponent"])("FileInput"),m=Object(y["resolveComponent"])("IconUndo"),g=Object(y["resolveComponent"])("IconTheme");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",rp,[Object(y["createElementVNode"])("div",{class:"origin-image",style:Object(y["normalizeStyle"])({backgroundImage:"url(".concat(Object(y["unref"])(d).src,")")})},null,4),Object(y["createVNode"])(Wb),Object(y["createVNode"])(l,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{style:{flex:"5"},onClick:c[0]||(c[0]=function(e){return p()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{class:"btn-icon"}),ip]})),_:1}),Object(y["createVNode"])(i,{trigger:"click",visible:s.value,"onUpdate:visible":c[1]||(c[1]=function(e){return s.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",up,[dp,Object(y["createElementVNode"])("div",sp,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(t),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"shape-clip-item",key:t,onClick:function(e){return O(t)}},[Object(y["createElementVNode"])("div",{class:"shape",style:Object(y["normalizeStyle"])({clipPath:e.style})},null,4)],8,fp)})),128))]),(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(n,(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:e.label},[e.label?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",bp,"按"+Object(y["toDisplayString"])(e.label)+":",1)):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(l,{class:"row"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e.children,(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(a,{style:{flex:"1"},key:e.key,onClick:function(t){return O("rect",e.ratio)}},{default:Object(y["withCtx"])((function(){return[Object(y["createTextVNode"])(Object(y["toDisplayString"])(e.key),1)]})),_:2},1032,["onClick"])})),128))]})),_:2},1024)],64)})),64))])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{class:"no-padding",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r)]})),_:1})]})),_:1},8,["visible"])]})),_:1}),Object(y["createVNode"])(u),Object(y["createVNode"])(ap),Object(y["createVNode"])(u),Object(y["createVNode"])(ob),Object(y["createVNode"])(u),Object(y["createVNode"])(yb),Object(y["createVNode"])(u),Object(y["createVNode"])(b,{onChange:c[2]||(c[2]=function(e){return v(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{class:"full-width-btn"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{class:"btn-icon"}),pp]})),_:1})]})),_:1}),Object(y["createVNode"])(a,{class:"full-width-btn",onClick:c[3]||(c[3]=function(e){return j()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(m,{class:"btn-icon"}),mp]})),_:1}),Object(y["createVNode"])(a,{class:"full-width-btn",onClick:c[4]||(c[4]=function(e){return h()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g,{class:"btn-icon"}),Op]})),_:1})])}}});n("911d");const jp=pn()(vp,[["__scopeId","data-v-7da35bec"]]);var hp=jp,yp=function(e){return Object(y["pushScopeId"])("data-v-02998580"),e=e(),Object(y["popScopeId"])(),e},gp={class:"shape-style-panel"},xp={class:"row"},kp=Object(y["createTextVNode"])("纯色填充"),Cp=Object(y["createTextVNode"])("渐变填充"),Np=yp((function(){return Object(y["createElementVNode"])("div",{style:{flex:"1"}},null,-1)})),Ep=Object(y["createTextVNode"])("线性渐变"),wp=Object(y["createTextVNode"])("径向渐变"),Vp={class:"row"},Ip=yp((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"起点颜色:",-1)})),Bp={class:"row"},Sp=yp((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"终点颜色:",-1)})),Lp={key:0,class:"row"},_p=yp((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"渐变角度:",-1)})),Tp=Object(y["createTextVNode"])("+"),Mp=Object(y["createTextVNode"])("-"),Dp=Object(y["defineComponent"])({__name:"ShapeStylePanel",setup:function(e){var t=ie(),n=ae(),c=Object(g["c"])(t),o=c.handleElement,a=c.handleElementId,l=c.richTextAttrs,r=c.availableFonts,i=o,u=Object(y["ref"])("#000"),d=Object(y["ref"])({type:"linear",rotate:0,color:["#fff","#fff"]}),s=Object(y["ref"])("fill"),f=Object(y["ref"])("middle");Object(y["watch"])(o,(function(){var e,t;o.value&&"shape"===o.value.type&&(u.value=o.value.fill||"#fff",d.value=o.value.gradient||{type:"linear",rotate:0,color:[u.value,"#fff"]},s.value=o.value.gradient?"gradient":"fill",f.value=(null===(e=o.value)||void 0===e||null===(t=e.text)||void 0===t?void 0:t.align)||"middle")}),{deep:!0,immediate:!0});var b=at(),p=b.addHistorySnapshot,m=function(e){n.updateElement({id:a.value,props:e}),p()},O=function(e){"fill"===e?(n.removeElementProps({id:a.value,propName:"gradient"}),p()):m({gradient:d.value})},v=function(e){if(d.value){var t=Object(S["a"])(Object(S["a"])({},d.value),e);m({gradient:t})}},j=function(e){m({fill:e})},h=function(e){var t=o.value,n={content:"",defaultFontName:"微软雅黑",defaultColor:"#000",align:"middle"},c=t.text||n;m({text:Object(S["a"])(Object(S["a"])({},c),{},{align:e})})},x=["12px","14px","16px","18px","20px","22px","24px","28px","32px","36px","40px","44px","48px","54px","60px","66px","72px","76px","80px","88px","96px","104px","112px","120px"],k=function(e,t){ta.emit(fo.RICH_TEXT_COMMAND,{action:{command:e,value:t}})};return function(e,t){var n,c=Object(y["resolveComponent"])("SelectOption"),o=Object(y["resolveComponent"])("Select"),a=Object(y["resolveComponent"])("ColorPicker"),b=Object(y["resolveComponent"])("Popover"),p=Object(y["resolveComponent"])("Slider"),m=Object(y["resolveComponent"])("Divider"),g=Object(y["resolveComponent"])("IconFontSize"),C=Object(y["resolveComponent"])("SelectOptGroup"),N=Object(y["resolveComponent"])("IconAddText"),E=Object(y["resolveComponent"])("InputGroup"),w=Object(y["resolveComponent"])("IconText"),V=Object(y["resolveComponent"])("Button"),I=Object(y["resolveComponent"])("Tooltip"),S=Object(y["resolveComponent"])("IconHighLight"),L=Object(y["resolveComponent"])("ButtonGroup"),_=Object(y["resolveComponent"])("IconTextBold"),T=Object(y["resolveComponent"])("CheckboxButton"),M=Object(y["resolveComponent"])("IconTextItalic"),D=Object(y["resolveComponent"])("IconTextUnderline"),z=Object(y["resolveComponent"])("IconFormat"),F=Object(y["resolveComponent"])("CheckboxButtonGroup"),A=Object(y["resolveComponent"])("IconAlignTextLeft"),R=Object(y["resolveComponent"])("RadioButton"),P=Object(y["resolveComponent"])("IconAlignTextCenter"),H=Object(y["resolveComponent"])("IconAlignTextRight"),q=Object(y["resolveComponent"])("RadioGroup"),U=Object(y["resolveComponent"])("IconAlignTextTopOne"),G=Object(y["resolveComponent"])("IconAlignTextMiddleOne"),X=Object(y["resolveComponent"])("IconAlignTextBottomOne");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",gp,[Object(y["createElementVNode"])("div",xp,[Object(y["createVNode"])(o,{style:{flex:"10"},value:s.value,onChange:t[0]||(t[0]=function(e){return O(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{value:"fill"},{default:Object(y["withCtx"])((function(){return[kp]})),_:1}),Object(y["createVNode"])(c,{value:"gradient"},{default:Object(y["withCtx"])((function(){return[Cp]})),_:1})]})),_:1},8,["value"]),Np,"fill"===s.value?(Object(y["openBlock"])(),Object(y["createBlock"])(b,{key:0,trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:u.value,"onUpdate:modelValue":t[1]||(t[1]=function(e){return j(e)})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:u.value,style:{flex:"10"}},null,8,["color"])]})),_:1})):(Object(y["openBlock"])(),Object(y["createBlock"])(o,{key:1,style:{flex:"10"},value:d.value.type,onChange:t[2]||(t[2]=function(e){return v({type:e})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{value:"linear"},{default:Object(y["withCtx"])((function(){return[Ep]})),_:1}),Object(y["createVNode"])(c,{value:"radial"},{default:Object(y["withCtx"])((function(){return[wp]})),_:1})]})),_:1},8,["value"]))]),"gradient"===s.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createElementVNode"])("div",Vp,[Ip,Object(y["createVNode"])(b,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:d.value.color[0],"onUpdate:modelValue":t[3]||(t[3]=function(e){return v({color:[e,d.value.color[1]]})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:d.value.color[0],style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",Bp,[Sp,Object(y["createVNode"])(b,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:d.value.color[1],"onUpdate:modelValue":t[4]||(t[4]=function(e){return v({color:[d.value.color[0],e]})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:d.value.color[1],style:{flex:"3"}},null,8,["color"])]})),_:1})]),"linear"===d.value.type?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Lp,[_p,Object(y["createVNode"])(p,{class:"slider",min:0,max:360,step:15,value:d.value.rotate,onChange:t[5]||(t[5]=function(e){return v({rotate:e})})},null,8,["value"])])):Object(y["createCommentVNode"])("",!0)],64)):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(Wb),Object(y["createVNode"])(m),null!==(n=Object(y["unref"])(i).text)&&void 0!==n&&n.content?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:1},[Object(y["createVNode"])(E,{compact:"",class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"3"},value:Object(y["unref"])(l).fontname,onChange:t[6]||(t[6]=function(e){return k("fontname",e)})},{suffixIcon:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g)]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(C,{label:"系统字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(r),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",{style:Object(y["normalizeStyle"])({fontFamily:e.value})},Object(y["toDisplayString"])(e.label),5)]})),_:2},1032,["value"])})),128))]})),_:1}),Object(y["createVNode"])(C,{label:"在线字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(B),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(e.label),1)]})),_:2},1032,["value"])})),128))]})),_:1})]})),_:1},8,["value"]),Object(y["createVNode"])(o,{style:{flex:"2"},value:Object(y["unref"])(l).fontsize,onChange:t[7]||(t[7]=function(e){return k("fontsize",e)})},{suffixIcon:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(N)]})),default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(x,(function(e){return Object(y["createVNode"])(c,{key:e,value:e},{default:Object(y["withCtx"])((function(){return[Object(y["createTextVNode"])(Object(y["toDisplayString"])(e),1)]})),_:2},1032,["value"])})),64))]})),_:1},8,["value"])]})),_:1}),Object(y["createVNode"])(L,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(b,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(l).color,"onUpdate:modelValue":t[8]||(t[8]=function(e){return k("color",e)})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"文字颜色"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(V,{class:"text-color-btn",style:{flex:"3"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(w),Object(y["createElementVNode"])("div",{class:"text-color-block",style:Object(y["normalizeStyle"])({backgroundColor:Object(y["unref"])(l).color})},null,4)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(b,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(l).backcolor,"onUpdate:modelValue":t[9]||(t[9]=function(e){return k("backcolor",e)})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"文字高亮"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(V,{class:"text-color-btn",style:{flex:"3"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(S),Object(y["createElementVNode"])("div",{class:"text-color-block",style:Object(y["normalizeStyle"])({backgroundColor:Object(y["unref"])(l).backcolor})},null,4)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"增大字号"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(V,{class:"font-size-btn",style:{flex:"2"},onClick:t[10]||(t[10]=function(e){return k("fontsize-add")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g),Tp]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"减小字号"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(V,{class:"font-size-btn",style:{flex:"2"},onClick:t[11]||(t[11]=function(e){return k("fontsize-reduce")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g),Mp]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(F,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"加粗"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(T,{style:{flex:"1"},checked:Object(y["unref"])(l).bold,onClick:t[12]||(t[12]=function(e){return k("bold")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(_)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"斜体"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(T,{style:{flex:"1"},checked:Object(y["unref"])(l).em,onClick:t[13]||(t[13]=function(e){return k("em")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(M)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"下划线"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(T,{style:{flex:"1"},checked:Object(y["unref"])(l).underline,onClick:t[14]||(t[14]=function(e){return k("underline")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(D)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"清除格式"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(T,{style:{flex:"1"},onClick:t[15]||(t[15]=function(e){return k("clear")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(z)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(q,{class:"row","button-style":"solid",value:Object(y["unref"])(l).align,onChange:t[16]||(t[16]=function(e){return k("align",e.target.value)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"左对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"left",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(A)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"居中"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"center",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(P)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"右对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"right",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(H)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["value"]),Object(y["createVNode"])(q,{class:"row","button-style":"solid",value:f.value,onChange:t[17]||(t[17]=function(e){return h(e.target.value)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"顶对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"top",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(U)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"居中"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"middle",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(G)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"底对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"bottom",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(X)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["value"]),Object(y["createVNode"])(m)],64)):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(ob),Object(y["createVNode"])(m),Object(y["createVNode"])(yb),Object(y["createVNode"])(m),Object(y["createVNode"])(Ff)])}}});n("de23");const zp=pn()(Dp,[["__scopeId","data-v-02998580"]]);var Fp=zp,Ap=function(e){return Object(y["pushScopeId"])("data-v-938968a2"),e=e(),Object(y["popScopeId"])(),e},Rp={class:"line-style-panel"},Pp={class:"row"},Hp=Ap((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"线条样式:",-1)})),qp=Object(y["createTextVNode"])("实线"),Up=Object(y["createTextVNode"])("虚线"),Gp={class:"row"},Xp=Ap((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"线条颜色:",-1)})),Yp={class:"row"},Zp=Ap((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"线条宽度:",-1)})),Wp={class:"row"},Jp=Ap((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"起点样式:",-1)})),Kp=Object(y["createTextVNode"])("无"),Qp=Object(y["createTextVNode"])("箭头"),$p=Object(y["createTextVNode"])("圆点"),em={class:"row"},tm=Ap((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"终点样式:",-1)})),nm=Object(y["createTextVNode"])("无"),cm=Object(y["createTextVNode"])("箭头"),om=Object(y["createTextVNode"])("圆点"),am=Object(y["defineComponent"])({__name:"LineStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=c,a=at(),l=a.addHistorySnapshot,r=function(e){c.value&&(t.updateElement({id:c.value.id,props:e}),l())};return function(e,t){var n=Object(y["resolveComponent"])("SelectOption"),c=Object(y["resolveComponent"])("Select"),a=Object(y["resolveComponent"])("ColorPicker"),l=Object(y["resolveComponent"])("Popover"),i=Object(y["resolveComponent"])("InputNumber"),u=Object(y["resolveComponent"])("Divider");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Rp,[Object(y["createElementVNode"])("div",Pp,[Hp,Object(y["createVNode"])(c,{style:{flex:"3"},value:Object(y["unref"])(o).style,onChange:t[0]||(t[0]=function(e){return r({style:e})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:"solid"},{default:Object(y["withCtx"])((function(){return[qp]})),_:1}),Object(y["createVNode"])(n,{value:"dashed"},{default:Object(y["withCtx"])((function(){return[Up]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",Gp,[Xp,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(o).color,"onUpdate:modelValue":t[1]||(t[1]=function(e){return r({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(o).color,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",Yp,[Zp,Object(y["createVNode"])(i,{value:Object(y["unref"])(o).width,onChange:t[2]||(t[2]=function(e){return r({width:e})}),style:{flex:"3"}},null,8,["value"])]),Object(y["createElementVNode"])("div",Wp,[Jp,Object(y["createVNode"])(c,{style:{flex:"3"},value:Object(y["unref"])(o).points[0],onChange:t[3]||(t[3]=function(e){return r({points:[e,Object(y["unref"])(o).points[1]]})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:""},{default:Object(y["withCtx"])((function(){return[Kp]})),_:1}),Object(y["createVNode"])(n,{value:"arrow"},{default:Object(y["withCtx"])((function(){return[Qp]})),_:1}),Object(y["createVNode"])(n,{value:"dot"},{default:Object(y["withCtx"])((function(){return[$p]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",em,[tm,Object(y["createVNode"])(c,{style:{flex:"3"},value:Object(y["unref"])(o).points[1],onChange:t[4]||(t[4]=function(e){return r({points:[Object(y["unref"])(o).points[0],e]})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:""},{default:Object(y["withCtx"])((function(){return[nm]})),_:1}),Object(y["createVNode"])(n,{value:"arrow"},{default:Object(y["withCtx"])((function(){return[cm]})),_:1}),Object(y["createVNode"])(n,{value:"dot"},{default:Object(y["withCtx"])((function(){return[om]})),_:1})]})),_:1},8,["value"])]),Object(y["createVNode"])(u),Object(y["createVNode"])(yb)])}}});n("d806");const lm=pn()(am,[["__scopeId","data-v-938968a2"]]);var rm=lm,im={class:"chart-data-editor"},um={class:"editor-content"},dm={class:"range-box"},sm=["id","onFocus","onPaste"],fm={class:"btns"},bm={class:"left"},pm=Object(y["createTextVNode"])("清空"),mm={class:"right"},Om=Object(y["createTextVNode"])("取消"),vm=Object(y["createTextVNode"])("确认"),jm=Object(y["defineComponent"])({__name:"ChartDataEditor",props:{data:{type:Object,required:!0}},emits:["save","close"],setup:function(e,t){var n=t.emit,c=e,o=100,a=32,l=Object(y["ref"])([0,0]),r=Object(y["ref"])({width:0,height:0}),i=Object(y["ref"])(null),u=Object(y["computed"])((function(){var e=l.value[0]*o,t=l.value[1]*a;return[{type:"t",style:{width:e+"px"}},{type:"b",style:{top:t+"px",width:e+"px"}},{type:"l",style:{height:t+"px"}},{type:"r",style:{left:e+"px",height:t+"px"}}]})),d=Object(y["computed"])((function(){var e=l.value[0]*o,t=l.value[1]*a;return{left:e+"px",top:t+"px"}})),s=function(){var e=[],t=c.data,n=t.labels,o=t.legends,a=t.series,r=n.length,i=a.length;e.push([""].concat(Object(Q["a"])(o)));for(var u=0;u.5*o&&(d+=o-d%o),s%a>.5*a&&(s+=a-s%a);var f=Math.round(s/a),b=Math.round(d/o);f<3&&(f=3),b<2&&(b=2),l.value=[b,f],r.value={width:0,height:0}}}};return function(e,t){var n=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",im,[Object(y["createElementVNode"])("div",um,[Object(y["createElementVNode"])("div",dm,[Object(y["createElementVNode"])("div",{class:"temp-range",style:Object(y["normalizeStyle"])({width:r.value.width+"px",height:r.value.height+"px"})},null,4),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(u),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["range-line",e.type]),key:e.type,style:Object(y["normalizeStyle"])(e.style)},null,6)})),128)),Object(y["createElementVNode"])("div",{class:"resizable",style:Object(y["normalizeStyle"])(Object(y["unref"])(d)),onMousedown:t[0]||(t[0]=Object(y["withModifiers"])((function(e){return j(e)}),["stop"]))},null,36)]),Object(y["createElementVNode"])("table",null,[Object(y["createElementVNode"])("tbody",null,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(31,(function(e){return Object(y["createElementVNode"])("tr",{key:e},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(7,(function(t){return Object(y["createElementVNode"])("td",{key:t,class:Object(y["normalizeClass"])({head:1===t&&e<=l.value[1]||1===e&&t<=l.value[0]})},[Object(y["createElementVNode"])("input",{class:Object(y["normalizeClass"])(["item",{selected:e<=l.value[1]&&t<=l.value[0]}]),id:"cell-".concat(e-1,"-").concat(t-1),autocomplete:"off",onFocus:function(n){return i.value=[e-1,t-1]},onPaste:function(n){return O(n,e-1,t-1)}},null,42,sm)],2)})),64))])})),64))])])]),Object(y["createElementVNode"])("div",fm,[Object(y["createElementVNode"])("div",bm,[Object(y["createVNode"])(n,{class:"btn",onClick:t[1]||(t[1]=function(e){return m()})},{default:Object(y["withCtx"])((function(){return[pm]})),_:1})]),Object(y["createElementVNode"])("div",mm,[Object(y["createVNode"])(n,{class:"btn",onClick:t[2]||(t[2]=function(e){return v()})},{default:Object(y["withCtx"])((function(){return[Om]})),_:1}),Object(y["createVNode"])(n,{type:"primary",class:"btn",onClick:t[3]||(t[3]=function(e){return p()}),style:{"margin-left":"10px"}},{default:Object(y["withCtx"])((function(){return[vm]})),_:1})])])])}}});n("ca17");const hm=pn()(jm,[["__scopeId","data-v-53b32689"]]);var ym=hm,gm=function(e){return Object(y["pushScopeId"])("data-v-769d6876"),e=e(),Object(y["popScopeId"])(),e},xm={class:"chart-style-panel"},km=Object(y["createTextVNode"])(" 编辑图表数据 "),Cm={class:"row"},Nm=Object(y["createTextVNode"])("面积图样式"),Em=Object(y["createTextVNode"])("散点图样式"),wm={class:"row"},Vm=Object(y["createTextVNode"])("使用平滑曲线"),Im={key:1,class:"row"},Bm=Object(y["createTextVNode"])("条形图样式"),Sm=Object(y["createTextVNode"])("堆叠样式"),Lm={key:2,class:"row"},_m=Object(y["createTextVNode"])("环形图样式"),Tm={class:"row"},Mm=gm((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"图例:",-1)})),Dm=Object(y["createTextVNode"])("不显示"),zm=Object(y["createTextVNode"])("显示在上方"),Fm=Object(y["createTextVNode"])("显示在下方"),Am={class:"row"},Rm=gm((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"背景填充:",-1)})),Pm={class:"row"},Hm=gm((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"网格颜色:",-1)})),qm={style:{flex:"2"}},Um={class:"color-btn-wrap",style:{flex:"3"}},Gm=["onClick"],Xm={class:"preset-themes"},Ym=["onClick","onMouseenter"],Zm=Object(y["createTextVNode"])("推荐主题"),Wm=Object(y["createTextVNode"])(" 添加主题色 "),Jm=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=[["#d87c7c","#919e8b","#d7ab82","#6e7074","#61a0a8","#efa18d"],["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78"],["#516b91","#59c4e6","#edafda","#93b7e3","#a5e7f0","#cbb0e3"],["#893448","#d95850","#eb8146","#ffb248","#f2d643","#ebdba4"],["#4ea397","#22c3aa","#7bd9a5","#d0648a","#f58db2","#f2b3c9"],["#3fb1e3","#6be6c1","#626c91","#a0a7e6","#c4ebad","#96dee8"],["#fc97af","#87f7cf","#f7f494","#72ccff","#f7c5a0","#d4a4eb"],["#c1232b","#27727b","#fcce10","#e87c25","#b5c334","#fe8463"],["#2ec7c9","#b6a2de","#5ab1ef","#ffb980","#d87a80","#8d98b3"],["#e01f54","#001852","#f5e8c8","#b8d2c7","#c6b38e","#a4d8c2"],["#c12e34","#e6b600","#0098d9","#2b821d","#005eaa","#339ca8"],["#8a7ca8","#e098c7","#8fd3e8","#71669e","#cc70af","#7cb4cc"]],n=ie(),c=ae(),o=Object(g["c"])(n),a=o.handleElement,l=o.handleElementId,r=Object(g["c"])(c),i=r.theme,u=a,d=Object(y["ref"])(!1),s=Object(y["ref"])(!1),f=Object(y["ref"])([-1,-1]),b=at(),p=b.addHistorySnapshot,m=Object(y["ref"])("#000"),O=Object(y["ref"])([]),v=Object(y["ref"])(""),j=Object(y["ref"])(""),h=Object(y["ref"])(!0),x=Object(y["ref"])(!0),k=Object(y["ref"])(!1),C=Object(y["ref"])(!1),N=Object(y["ref"])(!1),E=Object(y["ref"])(!1);Object(y["watch"])(a,(function(){if(a.value&&"chart"===a.value.type){if(m.value=a.value.fill||"#fff",a.value.options){var e=a.value.options,t=e.lineSmooth,n=e.showLine,c=e.showArea,o=e.horizontalBars,l=e.donut,r=e.stackBars;void 0!==t&&(h.value=t),void 0!==n&&(x.value=n),void 0!==c&&(k.value=c),void 0!==o&&(C.value=o),void 0!==l&&(N.value=l),void 0!==r&&(E.value=r)}O.value=a.value.themeColor,v.value=a.value.gridColor||"#333",j.value=a.value.legend||""}}),{deep:!0,immediate:!0});var w=function(e){c.updateElement({id:l.value,props:e}),p()},V=function(e){d.value=!1,w({data:e})},I=function(e){w({fill:e})},B=function(e){var t=a.value,n=Object(S["a"])(Object(S["a"])({},t.options),e);w({options:n})},L=function(e,t){var n={themeColor:O.value.map((function(n,c){return c===t?e:n}))};w(n)},_=function(){var e={themeColor:[].concat(Object(Q["a"])(O.value),[i.value.themeColor])};w(e)},T=function(e,t){var n=e.slice(0,t+1);w({themeColor:n}),s.value=!1},M=function(e){var t={themeColor:O.value.filter((function(t,n){return n!==e}))};w(t)},D=function(e){w({gridColor:e})},z=function(e){w({legend:e})},F=function(){return d.value=!0};return ta.on(fo.OPEN_CHART_DATA_EDITOR,F),Object(y["onUnmounted"])((function(){ta.off(fo.OPEN_CHART_DATA_EDITOR,F)})),function(e,n){var c=Object(y["resolveComponent"])("IconEdit"),o=Object(y["resolveComponent"])("Button"),a=Object(y["resolveComponent"])("Divider"),l=Object(y["resolveComponent"])("Checkbox"),r=Object(y["resolveComponent"])("SelectOption"),i=Object(y["resolveComponent"])("Select"),b=Object(y["resolveComponent"])("ColorPicker"),p=Object(y["resolveComponent"])("Popover"),g=Object(y["resolveComponent"])("IconCloseSmall"),w=Object(y["resolveComponent"])("Tooltip"),S=Object(y["resolveComponent"])("IconPlus"),F=Object(y["resolveComponent"])("ButtonGroup"),A=Object(y["resolveComponent"])("Modal");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",xm,[Object(y["createVNode"])(o,{class:"full-width-btn",onClick:n[0]||(n[0]=function(e){return d.value=!0})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{class:"btn-icon"}),km]})),_:1}),Object(y["createVNode"])(a),"line"===Object(y["unref"])(u).chartType?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createElementVNode"])("div",Cm,[Object(y["createVNode"])(l,{onChange:n[1]||(n[1]=function(e){return B({showArea:e.target.checked})}),checked:k.value,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Nm]})),_:1},8,["checked"]),Object(y["createVNode"])(l,{onChange:n[2]||(n[2]=function(e){return B({showLine:!e.target.checked})}),checked:!x.value,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Em]})),_:1},8,["checked"])]),Object(y["createElementVNode"])("div",wm,[Object(y["createVNode"])(l,{onChange:n[3]||(n[3]=function(e){return B({lineSmooth:e.target.checked})}),checked:h.value},{default:Object(y["withCtx"])((function(){return[Vm]})),_:1},8,["checked"])])],64)):Object(y["createCommentVNode"])("",!0),"bar"===Object(y["unref"])(u).chartType?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Im,[Object(y["createVNode"])(l,{onChange:n[4]||(n[4]=function(e){return B({horizontalBars:e.target.checked})}),checked:C.value},{default:Object(y["withCtx"])((function(){return[Bm]})),_:1},8,["checked"]),Object(y["createVNode"])(l,{onChange:n[5]||(n[5]=function(e){return B({stackBars:e.target.checked})}),checked:E.value},{default:Object(y["withCtx"])((function(){return[Sm]})),_:1},8,["checked"])])):Object(y["createCommentVNode"])("",!0),"pie"===Object(y["unref"])(u).chartType?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Lm,[Object(y["createVNode"])(l,{onChange:n[6]||(n[6]=function(e){return B({donut:e.target.checked})}),checked:N.value},{default:Object(y["withCtx"])((function(){return[_m]})),_:1},8,["checked"])])):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(a),Object(y["createElementVNode"])("div",Tm,[Mm,Object(y["createVNode"])(i,{style:{flex:"3"},value:j.value,onChange:n[7]||(n[7]=function(e){return z(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r,{value:""},{default:Object(y["withCtx"])((function(){return[Dm]})),_:1}),Object(y["createVNode"])(r,{value:"top"},{default:Object(y["withCtx"])((function(){return[zm]})),_:1}),Object(y["createVNode"])(r,{value:"bottom"},{default:Object(y["withCtx"])((function(){return[Fm]})),_:1})]})),_:1},8,["value"])]),Object(y["createVNode"])(a),Object(y["createElementVNode"])("div",Am,[Rm,Object(y["createVNode"])(p,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(b,{modelValue:m.value,"onUpdate:modelValue":n[8]||(n[8]=function(e){return I(e)})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:m.value,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",Pm,[Hm,Object(y["createVNode"])(p,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(b,{modelValue:v.value,"onUpdate:modelValue":n[9]||(n[9]=function(e){return D(e)})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:v.value,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createVNode"])(a),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(O.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"row",key:t},[Object(y["createElementVNode"])("div",qm,Object(y["toDisplayString"])(0===t?"主题配色:":""),1),Object(y["createVNode"])(p,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(b,{modelValue:e,"onUpdate:modelValue":function(e){return L(e,t)}},null,8,["modelValue","onUpdate:modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",Um,[Object(y["createVNode"])(Hf,{color:e,style:{width:"100%"}},null,8,["color"]),Object(y["createVNode"])(w,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"删除"},{default:Object(y["withCtx"])((function(){return[0!==t?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"delete-color-btn",onClick:Object(y["withModifiers"])((function(e){return M(t)}),["stop"])},[Object(y["createVNode"])(g)],8,Gm)):Object(y["createCommentVNode"])("",!0)]})),_:2},1032,["mouseEnterDelay"])])]})),_:2},1024)])})),128)),Object(y["createVNode"])(F,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(p,{trigger:"click",visible:s.value,"onUpdate:visible":n[11]||(n[11]=function(e){return s.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",Xm,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(t,(function(e,t){return Object(y["createElementVNode"])("div",{class:"preset-theme",key:t},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e,(function(c,o){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["preset-theme-color",{select:f.value[0]===t&&o<=f.value[1]}]),key:c,style:Object(y["normalizeStyle"])({backgroundColor:c}),onClick:function(t){return T(e,o)},onMouseenter:function(e){return f.value=[t,o]},onMouseleave:n[10]||(n[10]=function(e){return f.value=[-1,-1]})},null,46,Ym)})),128))])})),64))])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{class:"no-padding",style:{flex:"2"}},{default:Object(y["withCtx"])((function(){return[Zm]})),_:1})]})),_:1},8,["visible"]),Object(y["createVNode"])(o,{class:"no-padding",disabled:O.value.length>=10,style:{flex:"3"},onClick:n[12]||(n[12]=function(e){return _()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(S,{class:"btn-icon"}),Wm]})),_:1},8,["disabled"])]})),_:1}),Object(y["createVNode"])(a),Object(y["createVNode"])(ob),Object(y["createVNode"])(A,{visible:d.value,"onUpdate:visible":n[15]||(n[15]=function(e){return d.value=e}),footer:null,centered:"",closable:!1,width:648,destroyOnClose:""},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(ym,{data:Object(y["unref"])(u).data,onClose:n[13]||(n[13]=function(e){return d.value=!1}),onSave:n[14]||(n[14]=function(e){return V(e)})},null,8,["data"])]})),_:1},8,["visible"])])}}});n("d074");const Km=pn()(Jm,[["__scopeId","data-v-769d6876"]]);var Qm=Km,$m=function(e){return Object(y["pushScopeId"])("data-v-7e28e1d8"),e=e(),Object(y["popScopeId"])(),e},eO={class:"table-style-panel"},tO={class:"row"},nO=$m((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"行数:",-1)})),cO={class:"set-count",style:{flex:"3"}},oO={class:"count-text"},aO={class:"row"},lO=$m((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"列数:",-1)})),rO={class:"set-count",style:{flex:"3"}},iO={class:"count-text"},uO={class:"row theme-switch"},dO=$m((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"启用主题表格:",-1)})),sO={class:"switch-wrapper",style:{flex:"3"}},fO={class:"row"},bO=Object(y["createTextVNode"])("标题行"),pO=Object(y["createTextVNode"])("汇总行"),mO={class:"row"},OO=Object(y["createTextVNode"])("第一列"),vO=Object(y["createTextVNode"])("最后一列"),jO={class:"row"},hO=$m((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"主题颜色:",-1)})),yO=Object(y["defineComponent"])({__name:"TableStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=n.handleElementId,a=n.selectedTableCells,l=n.availableFonts,r=Object(y["computed"])((function(){return t.theme.themeColor})),i=["12px","14px","16px","18px","20px","22px","24px","28px","32px"],u=Object(y["ref"])({bold:!1,em:!1,underline:!1,strikethrough:!1,color:"#000",backcolor:"#000",fontsize:"12px",fontname:"微软雅黑",align:"left"}),d=Object(y["ref"])(),s=Object(y["ref"])(!1),f=Object(y["ref"])(0),b=Object(y["ref"])(0),p=Object(y["ref"])(0),m=Object(y["ref"])(0);Object(y["watch"])(c,(function(){c.value&&"table"===c.value.type&&(d.value=c.value.theme,s.value=!!d.value,f.value=c.value.data.length,b.value=c.value.data[0].length,p.value=c.value.data.length,m.value=c.value.data[0].length)}),{deep:!0,immediate:!0});var O=at(),v=O.addHistorySnapshot,j=function(){if(c.value&&"table"===c.value.type){var e=0,t=0;if(a.value.length){var n=a.value[0];e=+n.split("_")[0],t=+n.split("_")[1]}var o=c.value.data[e][t].style;u.value=o?{bold:!!o.bold,em:!!o.em,underline:!!o.underline,strikethrough:!!o.strikethrough,color:o.color||"#000",backcolor:o.backcolor||"#000",fontsize:o.fontsize||"12px",fontname:o.fontname||"微软雅黑",align:o.align||"left"}:{bold:!1,em:!1,underline:!1,strikethrough:!1,color:"#000",backcolor:"#000",fontsize:"12px",fontname:"微软雅黑",align:"left"}}};Object(y["onMounted"])((function(){a.value.length&&j()})),Object(y["watch"])(a,j);var h=function(e){t.updateElement({id:o.value,props:e}),v()},k=function(e){for(var t=c.value,n=JSON.parse(JSON.stringify(t.data)),o=0;on){var o=new Array(b.value).fill({id:Object(x["b"])(10),colspan:1,rowspan:1,text:""}),a=new Array(e-n).fill(o),l=JSON.parse(JSON.stringify(t.data));l.push.apply(l,Object(Q["a"])(a)),h({data:l})}else{var r=t.data.slice(0,e);h({data:r})}},w=function(e){var t=c.value,n=t.data[0].length,o=t.data,a=t.colWidths.map((function(e){return e*t.width}));if(e>n){var l;o=o.map((function(t){var c=new Array(e-n).fill({id:Object(x["b"])(10),colspan:1,rowspan:1,text:""});return t.push.apply(t,Object(Q["a"])(c)),t}));var r=new Array(e-n).fill(100);(l=a).push.apply(l,Object(Q["a"])(r))}else o=o.map((function(t){return t.slice(0,e)})),a=a.slice(0,e);var i=a.reduce((function(e,t){return e+t})),u=a.map((function(e){return e/i})),d={width:i,data:o,colWidths:u};h(d)};return function(e,t){var n=Object(y["resolveComponent"])("IconFontSize"),c=Object(y["resolveComponent"])("SelectOption"),o=Object(y["resolveComponent"])("SelectOptGroup"),a=Object(y["resolveComponent"])("Select"),r=Object(y["resolveComponent"])("IconAddText"),p=Object(y["resolveComponent"])("InputGroup"),m=Object(y["resolveComponent"])("ColorPicker"),O=Object(y["resolveComponent"])("IconText"),v=Object(y["resolveComponent"])("Button"),j=Object(y["resolveComponent"])("Tooltip"),h=Object(y["resolveComponent"])("Popover"),g=Object(y["resolveComponent"])("IconFill"),x=Object(y["resolveComponent"])("ButtonGroup"),V=Object(y["resolveComponent"])("IconTextBold"),I=Object(y["resolveComponent"])("CheckboxButton"),S=Object(y["resolveComponent"])("IconTextItalic"),L=Object(y["resolveComponent"])("IconTextUnderline"),_=Object(y["resolveComponent"])("IconStrikethrough"),T=Object(y["resolveComponent"])("CheckboxButtonGroup"),M=Object(y["resolveComponent"])("IconAlignTextLeft"),D=Object(y["resolveComponent"])("RadioButton"),z=Object(y["resolveComponent"])("IconAlignTextCenter"),F=Object(y["resolveComponent"])("IconAlignTextRight"),A=Object(y["resolveComponent"])("RadioGroup"),R=Object(y["resolveComponent"])("Divider"),P=Object(y["resolveComponent"])("IconMinus"),H=Object(y["resolveComponent"])("IconPlus"),q=Object(y["resolveComponent"])("Switch"),U=Object(y["resolveComponent"])("Checkbox");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",eO,[Object(y["createVNode"])(p,{compact:"",class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{style:{flex:"3"},value:u.value.fontname,onChange:t[0]||(t[0]=function(e){return k({fontname:e})})},{suffixIcon:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n)]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{label:"系统字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(l),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",{style:Object(y["normalizeStyle"])({fontFamily:e.value})},Object(y["toDisplayString"])(e.label),5)]})),_:2},1032,["value"])})),128))]})),_:1}),Object(y["createVNode"])(o,{label:"在线字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(B),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(e.label),1)]})),_:2},1032,["value"])})),128))]})),_:1})]})),_:1},8,["value"]),Object(y["createVNode"])(a,{style:{flex:"2"},value:u.value.fontsize,onChange:t[1]||(t[1]=function(e){return k({fontsize:e})})},{suffixIcon:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r)]})),default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(i,(function(e){return Object(y["createVNode"])(c,{key:e,value:e},{default:Object(y["withCtx"])((function(){return[Object(y["createTextVNode"])(Object(y["toDisplayString"])(e),1)]})),_:2},1032,["value"])})),64))]})),_:1},8,["value"])]})),_:1}),Object(y["createVNode"])(x,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(h,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(m,{modelValue:u.value.color,"onUpdate:modelValue":t[2]||(t[2]=function(e){return k({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"文字颜色"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(v,{class:"text-color-btn",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(O),Object(y["createElementVNode"])("div",{class:"text-color-block",style:Object(y["normalizeStyle"])({backgroundColor:u.value.color})},null,4)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(h,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(m,{modelValue:u.value.backcolor,"onUpdate:modelValue":t[3]||(t[3]=function(e){return k({backcolor:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"单元格填充"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(v,{class:"text-color-btn",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g),Object(y["createElementVNode"])("div",{class:"text-color-block",style:Object(y["normalizeStyle"])({backgroundColor:u.value.backcolor})},null,4)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1})]})),_:1}),Object(y["createVNode"])(T,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"加粗"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{style:{flex:"1"},checked:u.value.bold,onClick:t[4]||(t[4]=function(e){return k({bold:!u.value.bold})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(V)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"斜体"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{style:{flex:"1"},checked:u.value.em,onClick:t[5]||(t[5]=function(e){return k({em:!u.value.em})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(S)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"下划线"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{style:{flex:"1"},checked:u.value.underline,onClick:t[6]||(t[6]=function(e){return k({underline:!u.value.underline})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(L)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"删除线"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{style:{flex:"1"},checked:u.value.strikethrough,onClick:t[7]||(t[7]=function(e){return k({strikethrough:!u.value.strikethrough})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(_)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(A,{class:"row","button-style":"solid",value:u.value.align,onChange:t[8]||(t[8]=function(e){return k({align:e.target.value})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"左对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(D,{value:"left",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(M)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"居中"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(D,{value:"center",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(z)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"右对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(D,{value:"right",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(F)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["value"]),Object(y["createVNode"])(R),Object(y["createVNode"])(ob,{fixed:!0}),Object(y["createVNode"])(R),Object(y["createElementVNode"])("div",tO,[nO,Object(y["createElementVNode"])("div",cO,[Object(y["createVNode"])(v,{class:"btn",disabled:f.value<=1,onClick:t[9]||(t[9]=function(e){return E(f.value-1)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(P)]})),_:1},8,["disabled"]),Object(y["createElementVNode"])("div",oO,Object(y["toDisplayString"])(f.value),1),Object(y["createVNode"])(v,{class:"btn",disabled:f.value>=30,onClick:t[10]||(t[10]=function(e){return E(f.value+1)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(H)]})),_:1},8,["disabled"])])]),Object(y["createElementVNode"])("div",aO,[lO,Object(y["createElementVNode"])("div",rO,[Object(y["createVNode"])(v,{class:"btn",disabled:b.value<=1,onClick:t[11]||(t[11]=function(e){return w(b.value-1)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(P)]})),_:1},8,["disabled"]),Object(y["createElementVNode"])("div",iO,Object(y["toDisplayString"])(b.value),1),Object(y["createVNode"])(v,{class:"btn",disabled:b.value>=30,onClick:t[12]||(t[12]=function(e){return w(b.value+1)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(H)]})),_:1},8,["disabled"])])]),Object(y["createVNode"])(R),Object(y["createElementVNode"])("div",uO,[dO,Object(y["createElementVNode"])("div",sO,[Object(y["createVNode"])(q,{checked:s.value,onChange:t[13]||(t[13]=function(e){return N(e)})},null,8,["checked"])])]),d.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createElementVNode"])("div",fO,[Object(y["createVNode"])(U,{onChange:t[14]||(t[14]=function(e){return C({rowHeader:e.target.checked})}),checked:d.value.rowHeader,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[bO]})),_:1},8,["checked"]),Object(y["createVNode"])(U,{onChange:t[15]||(t[15]=function(e){return C({rowFooter:e.target.checked})}),checked:d.value.rowFooter,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[pO]})),_:1},8,["checked"])]),Object(y["createElementVNode"])("div",mO,[Object(y["createVNode"])(U,{onChange:t[16]||(t[16]=function(e){return C({colHeader:e.target.checked})}),checked:d.value.colHeader,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[OO]})),_:1},8,["checked"]),Object(y["createVNode"])(U,{onChange:t[17]||(t[17]=function(e){return C({colFooter:e.target.checked})}),checked:d.value.colFooter,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[vO]})),_:1},8,["checked"])]),Object(y["createElementVNode"])("div",jO,[hO,Object(y["createVNode"])(h,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(m,{modelValue:d.value.color,"onUpdate:modelValue":t[18]||(t[18]=function(e){return C({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:d.value.color,style:{flex:"3"}},null,8,["color"])]})),_:1})])],64)):Object(y["createCommentVNode"])("",!0)])}}});n("dcd4");const gO=pn()(yO,[["__scopeId","data-v-7e28e1d8"]]);var xO=gO,kO=function(e){return Object(y["pushScopeId"])("data-v-546adf8c"),e=e(),Object(y["popScopeId"])(),e},CO={class:"latex-style-panel"},NO={class:"row"},EO=Object(y["createTextVNode"])("编辑 LaTeX"),wO={class:"row"},VO=kO((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"颜色:",-1)})),IO={class:"row"},BO=kO((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"粗细:",-1)})),SO=Object(y["defineComponent"])({__name:"LatexStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=c,a=Object(y["ref"])(!1),l=at(),r=l.addHistorySnapshot,i=function(e){c.value&&(t.updateElement({id:c.value.id,props:e}),r())},u=function(e){i({path:e.path,latex:e.latex,width:e.w,height:e.h,viewBox:[e.w,e.h]})},d=function(){return a.value=!0};return ta.on(fo.OPEN_LATEX_EDITOR,d),Object(y["onUnmounted"])((function(){ta.off(fo.OPEN_LATEX_EDITOR,d)})),function(e,t){var n=Object(y["resolveComponent"])("Button"),c=Object(y["resolveComponent"])("Divider"),l=Object(y["resolveComponent"])("ColorPicker"),r=Object(y["resolveComponent"])("Popover"),d=Object(y["resolveComponent"])("InputNumber"),s=Object(y["resolveComponent"])("Modal");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",CO,[Object(y["createElementVNode"])("div",NO,[Object(y["createVNode"])(n,{style:{flex:"1"},onClick:t[0]||(t[0]=function(e){return a.value=!0})},{default:Object(y["withCtx"])((function(){return[EO]})),_:1})]),Object(y["createVNode"])(c),Object(y["createElementVNode"])("div",wO,[VO,Object(y["createVNode"])(r,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(l,{modelValue:Object(y["unref"])(o).color,"onUpdate:modelValue":t[1]||(t[1]=function(e){return i({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(o).color,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",IO,[BO,Object(y["createVNode"])(d,{min:1,max:3,value:Object(y["unref"])(o).strokeWidth,onChange:t[2]||(t[2]=function(e){return i({strokeWidth:e})}),style:{flex:"3"}},null,8,["value"])]),Object(y["createVNode"])(s,{visible:a.value,"onUpdate:visible":t[5]||(t[5]=function(e){return a.value=e}),footer:null,centered:"",width:880,destroyOnClose:""},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(af,{value:Object(y["unref"])(o).latex,onClose:t[3]||(t[3]=function(e){return a.value=!1}),onUpdate:t[4]||(t[4]=function(e){u(e),a.value=!1})},null,8,["value"])]})),_:1},8,["visible"])])}}});n("c041");const LO=pn()(SO,[["__scopeId","data-v-546adf8c"]]);var _O=LO,TO=function(e){return Object(y["pushScopeId"])("data-v-ff7125dc"),e=e(),Object(y["popScopeId"])(),e},MO={class:"video-style-panel"},DO=TO((function(){return Object(y["createElementVNode"])("div",{class:"title"},"视频预览封面",-1)})),zO={class:"background-image-wrapper"},FO={class:"background-image"},AO={class:"row"},RO=Object(y["createTextVNode"])("重置封面"),PO=Object(y["defineComponent"])({__name:"VideoStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=c,a=at(),l=a.addHistorySnapshot,r=function(e){c.value&&(t.updateElement({id:c.value.id,props:e}),l())},i=function(e){var t=e[0];t&&et(t).then((function(e){return r({poster:e})}))};return function(e,t){var n=Object(y["resolveComponent"])("IconPlus"),c=Object(y["resolveComponent"])("FileInput"),a=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",MO,[DO,Object(y["createElementVNode"])("div",zO,[Object(y["createVNode"])(c,{onChange:t[0]||(t[0]=function(e){return i(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",FO,[Object(y["createElementVNode"])("div",{class:"content",style:Object(y["normalizeStyle"])({backgroundImage:"url(".concat(Object(y["unref"])(o).poster,")")})},[Object(y["createVNode"])(n)],4)])]})),_:1})]),Object(y["createElementVNode"])("div",AO,[Object(y["createVNode"])(a,{style:{flex:"1"},onClick:t[1]||(t[1]=function(e){return r({poster:""})})},{default:Object(y["withCtx"])((function(){return[RO]})),_:1})])])}}});n("a81a");const HO=pn()(PO,[["__scopeId","data-v-ff7125dc"]]);var qO=HO,UO=function(e){return Object(y["pushScopeId"])("data-v-5d723d50"),e=e(),Object(y["popScopeId"])(),e},GO={class:"audio-style-panel"},XO={class:"row"},YO=UO((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"图标颜色:",-1)})),ZO={class:"row switch-row"},WO=UO((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"自动播放:",-1)})),JO={class:"switch-wrapper",style:{flex:"3"}},KO={class:"row switch-row"},QO=UO((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"循环播放:",-1)})),$O={class:"switch-wrapper",style:{flex:"3"}},ev=Object(y["defineComponent"])({__name:"AudioStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=c,a=at(),l=a.addHistorySnapshot,r=function(e){c.value&&(t.updateElement({id:c.value.id,props:e}),l())};return function(e,t){var n=Object(y["resolveComponent"])("ColorPicker"),c=Object(y["resolveComponent"])("Popover"),a=Object(y["resolveComponent"])("Switch");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",GO,[Object(y["createElementVNode"])("div",XO,[YO,Object(y["createVNode"])(c,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{modelValue:Object(y["unref"])(o).color,"onUpdate:modelValue":t[0]||(t[0]=function(e){return r({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(o).color,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",ZO,[WO,Object(y["createElementVNode"])("div",JO,[Object(y["createVNode"])(a,{checked:Object(y["unref"])(o).autoplay,onChange:t[1]||(t[1]=function(e){return r({autoplay:e})})},null,8,["checked"])])]),Object(y["createElementVNode"])("div",KO,[QO,Object(y["createElementVNode"])("div",$O,[Object(y["createVNode"])(a,{checked:Object(y["unref"])(o).loop,onChange:t[2]||(t[2]=function(e){return r({loop:e})})},null,8,["checked"])])])])}}});n("795e");const tv=pn()(ev,[["__scopeId","data-v-5d723d50"]]);var nv=tv,cv=function(e){return Object(y["pushScopeId"])("data-v-71469855"),e=e(),Object(y["popScopeId"])(),e},ov={class:"multi-style-panel"},av={class:"row"},lv=cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"填充颜色:",-1)})),rv={class:"row"},iv=cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"边框样式:",-1)})),uv=Object(y["createTextVNode"])("实线边框"),dv=Object(y["createTextVNode"])("虚线边框"),sv={class:"row"},fv=cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"边框颜色:",-1)})),bv={class:"row"},pv=cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"边框粗细:",-1)})),mv=Object(y["createTextVNode"])("+"),Ov=Object(y["createTextVNode"])("-"),vv=Object(y["defineComponent"])({__name:"MultiStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.richTextAttrs,o=n.availableFonts,a=n.activeElementList,l=at(),r=l.addHistorySnapshot,i=function(e,n){t.updateElement({id:e,props:n}),r()},u=["12px","14px","16px","18px","20px","22px","24px","28px","32px","36px","40px","44px","48px","54px","60px","66px","72px","76px","80px","88px","96px","104px","112px","120px"],d=Object(y["ref"])("#fff"),s=Object(y["ref"])({width:0,color:"#fff",style:"solid"}),f=function(e){var t,n=Object(L["a"])(a.value);try{for(n.s();!(t=n.n()).done;){var c=t.value;if("text"!==c.type&&"shape"!==c.type&&"chart"!==c.type||i(c.id,{fill:e}),"table"===c.type){for(var o=JSON.parse(JSON.stringify(c.data)),l=0;l1){if(!r.value)return hv;var e=a.value.find((function(e){return e.id===r.value}));return e&&n[e.type]||null}return l.value&&n[l.value.type]||null}));return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",yv,[(Object(y["openBlock"])(),Object(y["createBlock"])(Object(y["resolveDynamicComponent"])(Object(y["unref"])(i))))])}}});const xv=gv;var kv=xv,Cv=function(e){return Object(y["pushScopeId"])("data-v-43e5f476"),e=e(),Object(y["popScopeId"])(),e},Nv={class:"element-positopn-panel"},Ev=Cv((function(){return Object(y["createElementVNode"])("div",{class:"title"},"层级:",-1)})),wv=Object(y["createTextVNode"])(" 置于顶层"),Vv=Object(y["createTextVNode"])(" 置于底层"),Iv=Object(y["createTextVNode"])(" 上移一层"),Bv=Object(y["createTextVNode"])(" 下移一层"),Sv=Cv((function(){return Object(y["createElementVNode"])("div",{class:"title"},"对齐:",-1)})),Lv={class:"row"},_v=Cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"3"}},"位置:",-1)})),Tv=Cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"1"}},null,-1)})),Mv=Object(y["createStaticVNode"])('
X
Y
',1),Dv={class:"row"},zv=Cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"3"}},"大小:",-1)})),Fv={key:1,style:{flex:"1"}},Av=Object(y["createStaticVNode"])('
',1),Rv={class:"row"},Pv=Cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"3"}},"旋转:",-1)})),Hv=Cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"1"}},null,-1)})),qv=Object(y["defineComponent"])({__name:"ElementPositionPanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=n.handleElementId,a=Object(y["ref"])(0),l=Object(y["ref"])(0),r=Object(y["ref"])(0),i=Object(y["ref"])(0),u=Object(y["ref"])(0),d=Object(y["ref"])(!1),s=Object(y["computed"])((function(){return c.value&&dc[c.value.type]||20}));Object(y["watch"])(c,(function(){c.value&&(a.value=Object(te["round"])(c.value.left,1),l.value=Object(te["round"])(c.value.top,1),d.value="fixedRatio"in c.value&&!!c.value.fixedRatio,"line"!==c.value.type&&(r.value=Object(te["round"])(c.value.width,1),i.value=Object(te["round"])(c.value.height,1),u.value="rotate"in c.value&&void 0!==c.value.rotate?Object(te["round"])(c.value.rotate,1):0))}),{deep:!0,immediate:!0});var f=Ot(),b=f.orderElement,p=hc(),m=p.alignElementToCanvas,O=at(),v=O.addHistorySnapshot,j=function(e){var n={left:e};t.updateElement({id:o.value,props:n}),v()},h=function(e){var n={top:e};t.updateElement({id:o.value,props:n}),v()},x=function(e,t){if(c.value&&"shape"===c.value.type&&"pathFormula"in c.value&&c.value.pathFormula){var n=nt[c.value.pathFormula],o="";return o="editable"in n?n.formula(e,t,c.value.keypoint):n.formula(e,t),{viewBox:[e,t],path:o}}return null},N=function(e){var n={width:e},c=x(e,i.value);c&&(n=Object(S["a"])(Object(S["a"])({},n),c)),t.updateElement({id:o.value,props:n}),v()},E=function(e){var n={height:e},c=x(r.value,e);c&&(n=Object(S["a"])(Object(S["a"])({},n),c)),t.updateElement({id:o.value,props:n}),v()},w=function(e){var n={rotate:e};t.updateElement({id:o.value,props:n}),v()},V=function(e){var n={fixedRatio:e};t.updateElement({id:o.value,props:n}),v()},I=function(e){var n=45*Math.floor(u.value/45);"+"===e?n+=45:"-"===e&&(n-=45),n<-180&&(n=-180),n>180&&(n=180);var c={rotate:n};t.updateElement({id:o.value,props:c}),v()};return function(e,t){var n=Object(y["resolveComponent"])("IconSendToBack"),o=Object(y["resolveComponent"])("Button"),f=Object(y["resolveComponent"])("IconBringToFrontOne"),p=Object(y["resolveComponent"])("ButtonGroup"),O=Object(y["resolveComponent"])("IconBringToFront"),v=Object(y["resolveComponent"])("IconSentToBack"),g=Object(y["resolveComponent"])("Divider"),x=Object(y["resolveComponent"])("IconAlignLeft"),B=Object(y["resolveComponent"])("Tooltip"),S=Object(y["resolveComponent"])("IconAlignVertically"),L=Object(y["resolveComponent"])("IconAlignRight"),_=Object(y["resolveComponent"])("IconAlignTop"),T=Object(y["resolveComponent"])("IconAlignHorizontally"),M=Object(y["resolveComponent"])("IconAlignBottom"),D=Object(y["resolveComponent"])("InputNumber"),z=Object(y["resolveComponent"])("IconLock"),F=Object(y["resolveComponent"])("IconUnlock"),A=Object(y["resolveComponent"])("IconRotate");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Nv,[Ev,Object(y["createVNode"])(p,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[0]||(t[0]=function(e){return Object(y["unref"])(b)(Object(y["unref"])(c),Object(y["unref"])(k).TOP)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{class:"btn-icon"}),wv]})),_:1}),Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[1]||(t[1]=function(e){return Object(y["unref"])(b)(Object(y["unref"])(c),Object(y["unref"])(k).BOTTOM)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{class:"btn-icon"}),Vv]})),_:1})]})),_:1}),Object(y["createVNode"])(p,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[2]||(t[2]=function(e){return Object(y["unref"])(b)(Object(y["unref"])(c),Object(y["unref"])(k).UP)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(O,{class:"btn-icon"}),Iv]})),_:1}),Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[3]||(t[3]=function(e){return Object(y["unref"])(b)(Object(y["unref"])(c),Object(y["unref"])(k).DOWN)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(v,{class:"btn-icon"}),Bv]})),_:1})]})),_:1}),Object(y["createVNode"])(g),Sv,Object(y["createVNode"])(p,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"左对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[4]||(t[4]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).LEFT)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(x)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"水平居中"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[5]||(t[5]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).HORIZONTAL)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(S)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"右对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[6]||(t[6]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).RIGHT)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(L)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(p,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"上对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[7]||(t[7]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).TOP)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(_)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"垂直居中"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[8]||(t[8]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).VERTICAL)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(T)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"下对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[9]||(t[9]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).BOTTOM)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(M)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(g),Object(y["createElementVNode"])("div",Lv,[_v,Object(y["createVNode"])(D,{step:5,value:a.value,onChange:t[10]||(t[10]=function(e){return j(e)}),style:{flex:"4"}},null,8,["value"]),Tv,Object(y["createVNode"])(D,{step:5,value:l.value,onChange:t[11]||(t[11]=function(e){return h(e)}),style:{flex:"4"}},null,8,["value"])]),Mv,"line"!==Object(y["unref"])(c).type?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createElementVNode"])("div",Dv,[zv,Object(y["createVNode"])(D,{min:Object(y["unref"])(s),max:1500,step:5,value:r.value,onChange:t[12]||(t[12]=function(e){return N(e)}),style:{flex:"4"}},null,8,["min","value"]),["image","shape","audio"].includes(Object(y["unref"])(c).type)?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[d.value?(Object(y["openBlock"])(),Object(y["createBlock"])(B,{key:0,mouseLeaveDelay:0,mouseEnterDelay:.5,title:"解除宽高比锁定"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(z,{style:{flex:"1"},class:"icon-btn",onClick:t[13]||(t[13]=function(e){return V(!1)})})]})),_:1},8,["mouseEnterDelay"])):(Object(y["openBlock"])(),Object(y["createBlock"])(B,{key:1,mouseLeaveDelay:0,mouseEnterDelay:.5,title:"宽高比锁定"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(F,{style:{flex:"1"},class:"icon-btn",onClick:t[14]||(t[14]=function(e){return V(!0)})})]})),_:1},8,["mouseEnterDelay"]))],64)):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Fv)),Object(y["createVNode"])(D,{min:Object(y["unref"])(s),max:800,step:5,disabled:"text"===Object(y["unref"])(c).type,value:i.value,onChange:t[15]||(t[15]=function(e){return E(e)}),style:{flex:"4"}},null,8,["min","disabled","value"])]),Av],64)):Object(y["createCommentVNode"])("",!0),["line","video","audio"].includes(Object(y["unref"])(c).type)?Object(y["createCommentVNode"])("",!0):(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:1},[Object(y["createVNode"])(g),Object(y["createElementVNode"])("div",Rv,[Pv,Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"逆时针旋转"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(A,{class:"icon-btn",onClick:t[16]||(t[16]=function(e){return I("-")}),style:{flex:"2"}})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"顺时针旋转"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(A,{class:"icon-btn",onClick:t[17]||(t[17]=function(e){return I("+")}),style:Object(y["normalizeStyle"])({flex:2,transform:"rotateY(180deg)"})},null,8,["style"])]})),_:1},8,["mouseEnterDelay"]),Hv,Object(y["createVNode"])(D,{min:-180,max:180,step:5,value:u.value,onChange:t[18]||(t[18]=function(e){return w(e)}),style:{flex:"4"}},null,8,["value"])])],64))])}}});n("cb45");const Uv=pn()(qv,[["__scopeId","data-v-43e5f476"]]);var Gv=Uv,Xv=1e3,Yv="click",Zv="animate__",Wv=[{type:"bounce",name:"弹跳",children:[{name:"弹入",value:"bounceIn"},{name:"向右弹入",value:"bounceInLeft"},{name:"向左弹入",value:"bounceInRight"},{name:"向上弹入",value:"bounceInUp"},{name:"向下弹入",value:"bounceInDown"}]},{type:"fade",name:"浮现",children:[{name:"浮入",value:"fadeIn"},{name:"向下浮入",value:"fadeInDown"},{name:"向下长距浮入",value:"fadeInDownBig"},{name:"向右浮入",value:"fadeInLeft"},{name:"向右长距浮入",value:"fadeInLeftBig"},{name:"向左浮入",value:"fadeInRight"},{name:"向左长距浮入",value:"fadeInRightBig"},{name:"向上浮入",value:"fadeInUp"},{name:"向上长距浮入",value:"fadeInUpBig"},{name:"从左上浮入",value:"fadeInTopLeft"},{name:"从右上浮入",value:"fadeInTopRight"},{name:"从左下浮入",value:"fadeInBottomLeft"},{name:"从右下浮入",value:"fadeInBottomRight"}]},{type:"rotate",name:"旋转",children:[{name:"旋转进入",value:"rotateIn"},{name:"绕左下进入",value:"rotateInDownLeft"},{name:"绕右下进入",value:"rotateInDownRight"},{name:"绕左上进入",value:"rotateInUpLeft"},{name:"绕右上进入",value:"rotateInUpRight"}]},{type:"zoom",name:"缩放",children:[{name:"放大进入",value:"zoomIn"},{name:"向下放大进入",value:"zoomInDown"},{name:"从左放大进入",value:"zoomInLeft"},{name:"从右放大进入",value:"zoomInRight"},{name:"向上放大进入",value:"zoomInUp"}]},{type:"slide",name:"滑入",children:[{name:"向下滑入",value:"slideInDown"},{name:"从右滑入",value:"slideInLeft"},{name:"从左滑入",value:"slideInRight"},{name:"向上滑入",value:"slideInUp"}]},{type:"flip",name:"翻转",children:[{name:"X轴翻转进入",value:"flipInX"},{name:"Y轴翻转进入",value:"flipInY"}]},{type:"back",name:"放大滑入",children:[{name:"向下放大滑入",value:"backInDown"},{name:"从左放大滑入",value:"backInLeft"},{name:"从右放大滑入",value:"backInRight"},{name:"向上放大滑入",value:"backInUp"}]},{type:"lightSpeed",name:"飞入",children:[{name:"从右飞入",value:"lightSpeedInRight"},{name:"从左飞入",value:"lightSpeedInLeft"}]}],Jv=[{type:"bounce",name:"弹跳",children:[{name:"弹出",value:"bounceOut"},{name:"向左弹出",value:"bounceOutLeft"},{name:"向右弹出",value:"bounceOutRight"},{name:"向上弹出",value:"bounceOutUp"},{name:"向下弹出",value:"bounceOutDown"}]},{type:"fade",name:"浮现",children:[{name:"浮出",value:"fadeOut"},{name:"向下浮出",value:"fadeOutDown"},{name:"向下长距浮出",value:"fadeOutDownBig"},{name:"向左浮出",value:"fadeOutLeft"},{name:"向左长距浮出",value:"fadeOutLeftBig"},{name:"向右浮出",value:"fadeOutRight"},{name:"向右长距浮出",value:"fadeOutRightBig"},{name:"向上浮出",value:"fadeOutUp"},{name:"向上长距浮出",value:"fadeOutUpBig"},{name:"从左上浮出",value:"fadeOutTopLeft"},{name:"从右上浮出",value:"fadeOutTopRight"},{name:"从左下浮出",value:"fadeOutBottomLeft"},{name:"从右下浮出",value:"fadeOutBottomRight"}]},{type:"rotate",name:"旋转",children:[{name:"旋转退出",value:"rotateOut"},{name:"绕左下退出",value:"rotateOutDownLeft"},{name:"绕右下退出",value:"rotateOutDownRight"},{name:"绕左上退出",value:"rotateOutUpLeft"},{name:"绕右上退出",value:"rotateOutUpRight"}]},{type:"zoom",name:"缩放",children:[{name:"缩小退出",value:"zoomOut"},{name:"向下缩小退出",value:"zoomOutDown"},{name:"从左缩小退出",value:"zoomOutLeft"},{name:"从右缩小退出",value:"zoomOutRight"},{name:"向上缩小退出",value:"zoomOutUp"}]},{type:"slide",name:"滑出",children:[{name:"向下滑出",value:"slideOutDown"},{name:"从左滑出",value:"slideOutLeft"},{name:"从右滑出",value:"slideOutRight"},{name:"向上滑出",value:"slideOutUp"}]},{type:"flip",name:"翻转",children:[{name:"X轴翻转退出",value:"flipOutX"},{name:"Y轴翻转退出",value:"flipOutY"}]},{type:"back",name:"缩小滑出",children:[{name:"向下缩小滑出",value:"backOutDown"},{name:"从左缩小滑出",value:"backOutLeft"},{name:"从右缩小滑出",value:"backOutRight"},{name:"向上缩小滑出",value:"backOutUp"}]},{type:"lightSpeed",name:"飞出",children:[{name:"从右飞出",value:"lightSpeedOutRight"},{name:"从左飞出",value:"lightSpeedOutLeft"}]}],Kv=[{type:"shake",name:"晃动",children:[{name:"左右摇晃",value:"shakeX"},{name:"上下摇晃",value:"shakeY"},{name:"摇头",value:"headShake"},{name:"摆动",value:"swing"},{name:"晃动",value:"wobble"},{name:"惊恐",value:"tada"},{name:"果冻",value:"jello"}]},{type:"other",name:"其他",children:[{name:"弹跳",value:"bounce"},{name:"闪烁",value:"flash"},{name:"脉搏",value:"pulse"},{name:"橡皮筋",value:"rubberBand"},{name:"心跳(快)",value:"heartBeat"}]}],Qv=function(e){return Object(y["pushScopeId"])("data-v-2f69234f"),e=e(),Object(y["popScopeId"])(),e},$v={class:"element-animation-panel"},ej={key:0,class:"element-animation"},tj={class:"tabs"},nj=["onClick"],cj={class:"type-title"},oj={class:"pool-item-wrapper"},aj=["onMouseenter","onClick"],lj={key:0,class:"mask"},rj=Object(y["createTextVNode"])(" 添加动画 "),ij={key:1,class:"tip"},uj=Object(y["createTextVNode"])(" 选中画布中的元素添加动画"),dj={class:"sequence-content"},sj={class:"index"},fj={class:"text"},bj={class:"handler"},pj={key:0,class:"configs"},mj={class:"config-item"},Oj=Qv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"3"}},"持续时长:",-1)})),vj={class:"config-item"},jj=Qv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"3"}},"触发方式:",-1)})),hj=Object(y["createTextVNode"])("主动触发"),yj=Object(y["createTextVNode"])("与上一动画同时"),gj=Object(y["createTextVNode"])("上一动画之后"),xj={class:"config-item"},kj=Object(y["createTextVNode"])("更换动画"),Cj=Object(y["defineComponent"])({__name:"ElementAnimationPanel",setup:function(e){var t,n={},c=Object(L["a"])(Wv);try{for(c.s();!(t=c.n()).done;){var o,a=t.value,l=Object(L["a"])(a.children);try{for(l.s();!(o=l.n()).done;){var r=o.value;n[r.value]=r.name}}catch(ee){l.e(ee)}finally{l.f()}}}catch(ee){c.e(ee)}finally{c.f()}var i,u=Object(L["a"])(Jv);try{for(u.s();!(i=u.n()).done;){var d,s=i.value,f=Object(L["a"])(s.children);try{for(f.s();!(d=f.n()).done;){var b=d.value;n[b.value]=b.name}}catch(ee){f.e(ee)}finally{f.f()}}}catch(ee){u.e(ee)}finally{u.f()}var p,m=Object(L["a"])(Kv);try{for(m.s();!(p=m.n()).done;){var O,v=p.value,j=Object(L["a"])(v.children);try{for(j.s();!(O=j.n()).done;){var h=O.value;n[h.value]=h.name}}catch(ee){j.e(ee)}finally{j.f()}}}catch(ee){m.e(ee)}finally{m.f()}var k=["in","out","attention"],C=ae(),N=Object(g["c"])(ie()),E=N.handleElement,w=N.handleElementId,V=Object(g["c"])(C),I=V.currentSlide,B=V.formatedAnimations,_=V.currentSlideAnimations,T=[{key:"in",label:"入场"},{key:"out",label:"退场"},{key:"attention",label:"强调"}],M=Object(y["ref"])("in");Object(y["watch"])((function(){return w.value}),(function(){z.value=!1}));var D=Object(y["ref"])(""),z=Object(y["ref"])(!1),F=at(),A=F.addHistorySnapshot,R=Object(y["computed"])((function(){for(var e=[],t=0;t5e3)){var n=_.value.map((function(n){return n.id===e?Object(S["a"])(Object(S["a"])({},n),{},{duration:t}):n}));C.updateSlide({animations:n}),A()}},X=function(e,t){var n=_.value.map((function(n){return n.id===e?Object(S["a"])(Object(S["a"])({},n),{},{trigger:t}):n}));C.updateSlide({animations:n}),A()},Y=function(e,t){var n=_.value.map((function(n){return n.id===Z.value?Object(S["a"])(Object(S["a"])({},n),{},{type:e,effect:t}):n}));C.updateSlide({animations:n}),z.value=!1,A();var c=_.value.find((function(e){return e.elId===w.value})),o=(null===c||void 0===c?void 0:c.duration)||Xv;U(w.value,t,o)},Z=Object(y["ref"])(""),W=function(e,t){if(Z.value)Y(e,t);else{var n=JSON.parse(JSON.stringify(_.value));n.push({id:Object(x["b"])(10),elId:w.value,type:e,effect:t,duration:Xv,trigger:Yv}),C.updateSlide({animations:n}),z.value=!1,A(),U(w.value,t,Xv)}},J=Object(y["ref"])(!1),K=function(e){e?setTimeout((function(){return J.value=!0}),600):J.value=!1},Q=function(e){z.value=!0,Z.value=e,K(!0)},$={in:Wv,out:Jv,attention:Kv};return function(e,t){var n=Object(y["resolveComponent"])("IconEffects"),c=Object(y["resolveComponent"])("Button"),o=Object(y["resolveComponent"])("Popover"),a=Object(y["resolveComponent"])("IconClick"),l=Object(y["resolveComponent"])("Divider"),r=Object(y["resolveComponent"])("IconPlayOne"),i=Object(y["resolveComponent"])("Tooltip"),u=Object(y["resolveComponent"])("IconCloseSmall"),d=Object(y["resolveComponent"])("InputNumber"),s=Object(y["resolveComponent"])("SelectOption"),f=Object(y["resolveComponent"])("Select");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",$v,[Object(y["unref"])(E)?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ej,[Object(y["createVNode"])(o,{trigger:"click",visible:z.value,"onUpdate:visible":t[2]||(t[2]=function(e){return z.value=e}),onVisibleChange:t[3]||(t[3]=function(e){return K(e)})},{content:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",tj,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(T,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tab",e.key,{active:M.value===e.key}]),key:e.key,onClick:function(t){return M.value=e.key}},Object(y["toDisplayString"])(e.label),11,nj)})),64))]),(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(k,(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,[M.value===e?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["animation-pool",e]),key:e},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])($[e],(function(n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"pool-type",key:n.name},[Object(y["createElementVNode"])("div",cj,Object(y["toDisplayString"])(n.name)+":",1),Object(y["createElementVNode"])("div",oj,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(n.children,(function(n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"pool-item",key:n.name,onMouseenter:function(e){return D.value=n.value},onMouseleave:t[0]||(t[0]=function(e){return D.value=""}),onClick:function(t){return W(e,n.value)}},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["animation-box",["".concat(Object(y["unref"])(Zv),"animated"),"".concat(Object(y["unref"])(Zv),"fast"),D.value===n.value&&"".concat(Object(y["unref"])(Zv)).concat(n.value)]])},Object(y["toDisplayString"])(n.name),3)],40,aj)})),128))])])})),128)),J.value?Object(y["createCommentVNode"])("",!0):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",lj))],2)):Object(y["createCommentVNode"])("",!0)],64)})),64))]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{class:"element-animation-btn",onClick:t[1]||(t[1]=function(e){return Z.value=""})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{style:{"margin-right":"5px"}}),rj]})),_:1})]})),_:1},8,["visible"])])):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ij,[Object(y["createVNode"])(a,{style:{"margin-right":"5px"}}),uj])),Object(y["createVNode"])(l),Object(y["createVNode"])(Object(y["unref"])(hf.a),{class:"animation-sequence",modelValue:Object(y["unref"])(R),animation:300,scroll:!0,scrollSensitivity:50,handle:".sequence-content",onEnd:q,itemKey:"id"},{item:Object(y["withCtx"])((function(e){var t,n,o=e.element;return[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["sequence-item",[o.type,{active:(null===(t=Object(y["unref"])(E))||void 0===t?void 0:t.id)===o.elId}]])},[Object(y["createElementVNode"])("div",dj,[Object(y["createElementVNode"])("div",sj,Object(y["toDisplayString"])(o.index),1),Object(y["createElementVNode"])("div",fj,"【"+Object(y["toDisplayString"])(o.elType)+"】"+Object(y["toDisplayString"])(o.animationEffect),1),Object(y["createElementVNode"])("div",bj,[Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"预览"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r,{class:"handler-btn",onClick:function(e){return U(o.elId,o.effect,o.duration)}},null,8,["onClick"])]})),_:2},1032,["mouseEnterDelay"]),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"删除"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(u,{class:"handler-btn",onClick:function(e){return H(o.id)}},null,8,["onClick"])]})),_:2},1032,["mouseEnterDelay"])])]),(null===(n=Object(y["unref"])(P)[0])||void 0===n?void 0:n.elId)===o.elId?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",pj,[Object(y["createVNode"])(l,{style:{margin:"16px 0"}}),Object(y["createElementVNode"])("div",mj,[Oj,Object(y["createVNode"])(d,{min:500,max:3e3,step:500,value:o.duration,onChange:function(e){return G(o.id,e)},style:{flex:"5"}},null,8,["value","onChange"])]),Object(y["createElementVNode"])("div",vj,[jj,Object(y["createVNode"])(f,{value:o.trigger,onChange:function(e){return X(o.id,e)},style:{flex:"5"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(s,{value:"click"},{default:Object(y["withCtx"])((function(){return[hj]})),_:1}),Object(y["createVNode"])(s,{value:"meantime"},{default:Object(y["withCtx"])((function(){return[yj]})),_:1}),Object(y["createVNode"])(s,{value:"auto"},{default:Object(y["withCtx"])((function(){return[gj]})),_:1})]})),_:2},1032,["value","onChange"])]),Object(y["createElementVNode"])("div",xj,[Object(y["createVNode"])(c,{style:{flex:"1"},onClick:function(e){return Q(o.id)}},{default:Object(y["withCtx"])((function(){return[kj]})),_:2},1032,["onClick"])])])):Object(y["createCommentVNode"])("",!0)],2)]})),_:1},8,["modelValue"])])}}});n("cc39");const Nj=pn()(Cj,[["__scopeId","data-v-2f69234f"]]);var Ej=Nj,wj=[{color:"#d14424",background:"#ffffff",text:"#333"},{color:"#42464b",background:"#ffffff",text:"#333"},{color:"#5d82ba",background:"#ffffff",text:"#333"},{color:"#005a6f",background:"#ffffff",text:"#333"},{color:"#d0614c",background:"#dfb044",text:"#333"},{color:"#86a1ad",background:"#dfdbd4",text:"#333"},{color:"#697586",background:"#d5c4a4",text:"#333"},{color:"#333333",background:"#7acfa6",text:"#333"},{color:"#42464b",background:"#415065",text:"#fff"},{color:"#0c5999",background:"#35a2cd",text:"#fff"},{color:"#c49a41",background:"#8c4357",text:"#fff"},{color:"#dfaa00",background:"#2e4e7d",text:"#fff"},{color:"#d1ad88",background:"#f99070",text:"#fff"},{color:"#464d52",background:"#657984",text:"#fff"},{color:"#ffcfb6",background:"#1e4c6f",text:"#fff"},{color:"#c3a043",background:"#43292a",text:"#fff"},{color:"#464d52",background:"#60546f",text:"#fff"},{color:"#df9636",background:"#5b89a0",text:"#fff"},{color:"#b898a4",background:"#93716b",text:"#fff"},{color:"#c47a11",background:"#187db1",text:"#fff"},{color:"#333333",background:"#759564",text:"#fff"},{color:"#355b5e",background:"#424b50",text:"#fff"},{color:"#d29090",background:"#942a32",text:"#fff"},{color:"#00cfdf",background:"#3b434d",text:"#fff"},{color:"#424246",background:"#c70042",text:"#fff"},{color:"#2e4155",background:"#b35d44",text:"#fff"},{color:"#11bfce",background:"#8f98aa",text:"#fff"},{color:"#333333",background:"#549688",text:"#fff"}],Vj=function(e){return Object(y["pushScopeId"])("data-v-e0bbbd9e"),e=e(),Object(y["popScopeId"])(),e},Ij={class:"slide-design-panel"},Bj=Vj((function(){return Object(y["createElementVNode"])("div",{class:"title"},"背景填充",-1)})),Sj={class:"row"},Lj=Object(y["createTextVNode"])("纯色填充"),_j=Object(y["createTextVNode"])("图片填充"),Tj=Object(y["createTextVNode"])("渐变填充"),Mj=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"1"}},null,-1)})),Dj=Object(y["createTextVNode"])("缩放"),zj=Object(y["createTextVNode"])("拼贴"),Fj=Object(y["createTextVNode"])("缩放铺满"),Aj=Object(y["createTextVNode"])("线性渐变"),Rj=Object(y["createTextVNode"])("径向渐变"),Pj={key:0,class:"background-image-wrapper"},Hj={class:"background-image"},qj={key:1,class:"background-gradient-wrapper"},Uj={class:"row"},Gj=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"起点颜色:",-1)})),Xj={class:"row"},Yj=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"终点颜色:",-1)})),Zj={key:0,class:"row"},Wj=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"渐变角度:",-1)})),Jj={class:"row"},Kj=Object(y["createTextVNode"])("应用背景到全部"),Qj={class:"row"},$j=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"画布尺寸:",-1)})),eh=Object(y["createTextVNode"])("宽屏 16 : 9"),th=Object(y["createTextVNode"])("宽屏 16 :10"),nh=Object(y["createTextVNode"])("标准 4 :3"),ch=Vj((function(){return Object(y["createElementVNode"])("div",{class:"title"},"全局主题",-1)})),oh={class:"row"},ah=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"字体:",-1)})),lh={class:"row"},rh=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"字体颜色:",-1)})),ih={class:"row"},uh=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"背景颜色:",-1)})),dh={class:"row"},sh=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"主题色:",-1)})),fh=Object(y["createTextVNode"])(" 预置主题 "),bh={key:2,class:"theme-list"},ph=["onClick"],mh={class:"theme-item-content"},Oh={class:"row"},vh=Object(y["createTextVNode"])("应用主题到全部"),jh=Object(y["defineComponent"])({__name:"SlideDesignPanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.availableFonts,o=Object(g["c"])(t),a=o.slides,l=o.currentSlide,r=o.viewportRatio,i=o.theme,u=Object(y["computed"])((function(){return l.value.background?l.value.background:{type:"solid",value:"#fff"}})),d=at(),s=d.addHistorySnapshot,f=function(e){if("solid"===e){var n=Object(S["a"])(Object(S["a"])({},u.value),{},{type:"solid",color:u.value.color||"#fff"});t.updateSlide({background:n})}else if("image"===e){var c=Object(S["a"])(Object(S["a"])({},u.value),{},{type:"image",image:u.value.image||"",imageSize:u.value.imageSize||"cover"});t.updateSlide({background:c})}else{var o=Object(S["a"])(Object(S["a"])({},u.value),{},{type:"gradient",gradientType:u.value.gradientType||"linear",gradientColor:u.value.gradientColor||["#fff","#fff"],gradientRotate:u.value.gradientRotate||0});t.updateSlide({background:o})}s()},b=function(e){t.updateSlide({background:Object(S["a"])(Object(S["a"])({},u.value),e)}),s()},p=function(e){var t=e[0];t&&et(t).then((function(e){return b({image:e})}))},m=function(){var e=a.value.map((function(e){return Object(S["a"])(Object(S["a"])({},e),{},{background:l.value.background})}));t.setSlides(e),s()},O=function(e){t.setTheme(e)},v=function(){var e,n=JSON.parse(JSON.stringify(a.value)),c=i.value,o=c.themeColor,l=c.backgroundColor,r=c.fontColor,u=c.fontName,d=Object(L["a"])(n);try{for(d.s();!(e=d.n()).done;){var f=e.value;f.background&&"image"===f.background.type||(f.background=Object(S["a"])(Object(S["a"])({},f.background),{},{type:"solid",color:l}));var b,p=f.elements,m=Object(L["a"])(p);try{for(m.s();!(b=m.n()).done;){var O=b.value;if("shape"===O.type)O.fill=o;else if("line"===O.type)O.color=o;else if("text"===O.type)O.defaultColor=r,O.defaultFontName=u,O.fill&&(O.fill=o);else if("table"===O.type){O.theme&&(O.theme.color=o);var v,j=Object(L["a"])(O.data);try{for(j.s();!(v=j.n()).done;){var h,y=v.value,g=Object(L["a"])(y);try{for(g.s();!(h=g.n()).done;){var x=h.value;x.style&&(x.style.color=r,x.style.fontname=u)}}catch(k){g.e(k)}finally{g.f()}}}catch(k){j.e(k)}finally{j.f()}}else"chart"===O.type?(O.themeColor=[o],O.gridColor=r):"latex"===O.type?O.color=r:"audio"===O.type&&(O.color=o)}}catch(k){m.e(k)}finally{m.f()}}}catch(k){d.e(k)}finally{d.f()}t.setSlides(n),s()},j=Object(y["ref"])(!0),h=function(){j.value=!j.value},x=function(e){t.setViewportRatio(e)};return function(e,t){var n=Object(y["resolveComponent"])("SelectOption"),o=Object(y["resolveComponent"])("Select"),a=Object(y["resolveComponent"])("ColorPicker"),l=Object(y["resolveComponent"])("Popover"),d=Object(y["resolveComponent"])("IconPlus"),s=Object(y["resolveComponent"])("FileInput"),g=Object(y["resolveComponent"])("Slider"),k=Object(y["resolveComponent"])("Button"),C=Object(y["resolveComponent"])("Divider"),N=Object(y["resolveComponent"])("SelectOptGroup"),E=Object(y["resolveComponent"])("IconDown");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Ij,[Bj,Object(y["createElementVNode"])("div",Sj,[Object(y["createVNode"])(o,{style:{flex:"10"},value:Object(y["unref"])(u).type,onChange:t[0]||(t[0]=function(e){return f(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:"solid"},{default:Object(y["withCtx"])((function(){return[Lj]})),_:1}),Object(y["createVNode"])(n,{value:"image"},{default:Object(y["withCtx"])((function(){return[_j]})),_:1}),Object(y["createVNode"])(n,{value:"gradient"},{default:Object(y["withCtx"])((function(){return[Tj]})),_:1})]})),_:1},8,["value"]),Mj,"solid"===Object(y["unref"])(u).type?(Object(y["openBlock"])(),Object(y["createBlock"])(l,{key:0,trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(u).color,"onUpdate:modelValue":t[1]||(t[1]=function(e){return b({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(u).color||"#fff",style:{flex:"10"}},null,8,["color"])]})),_:1})):"image"===Object(y["unref"])(u).type?(Object(y["openBlock"])(),Object(y["createBlock"])(o,{key:1,style:{flex:"10"},value:Object(y["unref"])(u).imageSize||"cover",onChange:t[2]||(t[2]=function(e){return b({imageSize:e})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:"contain"},{default:Object(y["withCtx"])((function(){return[Dj]})),_:1}),Object(y["createVNode"])(n,{value:"repeat"},{default:Object(y["withCtx"])((function(){return[zj]})),_:1}),Object(y["createVNode"])(n,{value:"cover"},{default:Object(y["withCtx"])((function(){return[Fj]})),_:1})]})),_:1},8,["value"])):(Object(y["openBlock"])(),Object(y["createBlock"])(o,{key:2,style:{flex:"10"},value:Object(y["unref"])(u).gradientType,onChange:t[3]||(t[3]=function(e){return b({gradientType:e})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:"linear"},{default:Object(y["withCtx"])((function(){return[Aj]})),_:1}),Object(y["createVNode"])(n,{value:"radial"},{default:Object(y["withCtx"])((function(){return[Rj]})),_:1})]})),_:1},8,["value"]))]),"image"===Object(y["unref"])(u).type?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Pj,[Object(y["createVNode"])(s,{onChange:t[4]||(t[4]=function(e){return p(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",Hj,[Object(y["createElementVNode"])("div",{class:"content",style:Object(y["normalizeStyle"])({backgroundImage:"url(".concat(Object(y["unref"])(u).image,")")})},[Object(y["createVNode"])(d)],4)])]})),_:1})])):Object(y["createCommentVNode"])("",!0),"gradient"===Object(y["unref"])(u).type?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",qj,[Object(y["createElementVNode"])("div",Uj,[Gj,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(u).gradientColor[0],"onUpdate:modelValue":t[5]||(t[5]=function(e){return b({gradientColor:[e,Object(y["unref"])(u).gradientColor[1]]})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(u).gradientColor[0],style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",Xj,[Yj,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(u).gradientColor[1],"onUpdate:modelValue":t[6]||(t[6]=function(e){return b({gradientColor:[Object(y["unref"])(u).gradientColor[0],e]})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(u).gradientColor[1],style:{flex:"3"}},null,8,["color"])]})),_:1})]),"linear"===Object(y["unref"])(u).gradientType?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Zj,[Wj,Object(y["createVNode"])(g,{class:"slider",min:0,max:360,step:15,value:Object(y["unref"])(u).gradientRotate,onChange:t[7]||(t[7]=function(e){return b({gradientRotate:e})})},null,8,["value"])])):Object(y["createCommentVNode"])("",!0)])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",Jj,[Object(y["createVNode"])(k,{style:{flex:"1"},onClick:t[8]||(t[8]=function(e){return m()})},{default:Object(y["withCtx"])((function(){return[Kj]})),_:1})]),Object(y["createVNode"])(C),Object(y["createElementVNode"])("div",Qj,[$j,Object(y["createVNode"])(o,{style:{flex:"3"},value:Object(y["unref"])(r),onChange:t[9]||(t[9]=function(e){return x(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:.5625},{default:Object(y["withCtx"])((function(){return[eh]})),_:1},8,["value"]),Object(y["createVNode"])(n,{value:.625},{default:Object(y["withCtx"])((function(){return[th]})),_:1},8,["value"]),Object(y["createVNode"])(n,{value:.75},{default:Object(y["withCtx"])((function(){return[nh]})),_:1},8,["value"])]})),_:1},8,["value"])]),Object(y["createVNode"])(C),ch,Object(y["createElementVNode"])("div",oh,[ah,Object(y["createVNode"])(o,{style:{flex:"3"},value:Object(y["unref"])(i).fontName,onChange:t[10]||(t[10]=function(e){return O({fontName:e})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(N,{label:"系统字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(c),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(n,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",{style:Object(y["normalizeStyle"])({fontFamily:e.value})},Object(y["toDisplayString"])(e.label),5)]})),_:2},1032,["value"])})),128))]})),_:1}),Object(y["createVNode"])(N,{label:"在线字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(B),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(n,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(e.label),1)]})),_:2},1032,["value"])})),128))]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",lh,[rh,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(i).fontColor,"onUpdate:modelValue":t[11]||(t[11]=function(e){return O({fontColor:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(i).fontColor,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",ih,[uh,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(i).backgroundColor,"onUpdate:modelValue":t[12]||(t[12]=function(e){return O({backgroundColor:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(i).backgroundColor,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",dh,[sh,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(i).themeColor,"onUpdate:modelValue":t[13]||(t[13]=function(e){return O({themeColor:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(i).themeColor,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["title dropdown",{active:j.value}]),onClick:t[14]||(t[14]=function(e){return h()}),style:{"margin-top":"20px"}},[fh,Object(y["createVNode"])(E,{class:"icon"})],2),j.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",bh,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(wj),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"theme-item",key:t,style:Object(y["normalizeStyle"])({backgroundColor:e.background}),onClick:function(t){return O({fontColor:e.text,backgroundColor:e.background,themeColor:e.color})}},[Object(y["createElementVNode"])("div",mh,[Object(y["createElementVNode"])("div",{class:"text",style:Object(y["normalizeStyle"])({color:e.text})},"Aa",4),Object(y["createElementVNode"])("div",{class:"color-block",style:Object(y["normalizeStyle"])({backgroundColor:e.color})},null,4)])],12,ph)})),128))])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",Oh,[Object(y["createVNode"])(k,{style:{flex:"1"},onClick:t[15]||(t[15]=function(e){return v()})},{default:Object(y["withCtx"])((function(){return[vh]})),_:1})])])}}});n("60fd");const hh=pn()(jh,[["__scopeId","data-v-e0bbbd9e"]]);var yh=hh,gh={class:"slide-animation-panel"},xh={class:"animation-pool"},kh=["onClick"],Ch={class:"animation-text"},Nh=Object(y["createTextVNode"])("应用到全部"),Eh=Object(y["defineComponent"])({__name:"SlideAnimationPanel",setup:function(e){var t=ae(),n=Object(g["c"])(t),c=n.slides,o=n.currentSlide,a=Object(y["computed"])((function(){return o.value.turningMode||"slideY"})),l=[{label:"无",value:"no"},{label:"淡入淡出",value:"fade"},{label:"左右推移",value:"slideX"},{label:"上下推移",value:"slideY"}],r=at(),i=r.addHistorySnapshot,u=function(e){e!==a.value&&(t.updateSlide({turningMode:e}),i())},d=function(){var e=c.value.map((function(e){return Object(S["a"])(Object(S["a"])({},e),{},{turningMode:o.value.turningMode})}));t.setSlides(e),i()};return function(e,t){var n=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",gh,[Object(y["createElementVNode"])("div",xh,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(l,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["animation-item",{active:Object(y["unref"])(a)===e.value}]),key:e.label,onClick:function(t){return u(e.value)}},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["animation-block",e.value])},null,2),Object(y["createElementVNode"])("div",Ch,Object(y["toDisplayString"])(e.label),1)],10,kh)})),64))]),Object(y["createVNode"])(n,{style:{width:"100%"},onClick:t[0]||(t[0]=function(e){return d()})},{default:Object(y["withCtx"])((function(){return[Nh]})),_:1})])}}});n("cc76");const wh=pn()(Eh,[["__scopeId","data-v-577ae912"]]);var Vh=wh,Ih=function(){var e=ae(),t=Object(g["c"])(ie()),n=t.activeElementIdList,c=t.activeElementList,o=Object(g["c"])(e),a=o.currentSlide,l=at(),r=l.addHistorySnapshot,i=function(t){var o,l=Xe(c.value),i=l.minX,u=l.maxX,d=l.minY,s=l.maxY,f=JSON.parse(JSON.stringify(a.value.elements)),b={},p=Object(L["a"])(c.value);try{var m=function(){var e=o.value;if(e.groupId&&!b[e.groupId]){var t=c.value.filter((function(t){return t.groupId===e.groupId}));b[e.groupId]=Xe(t)}};for(p.s();!(o=p.n()).done;)m()}catch(j){p.e(j)}finally{p.f()}if(t===C.LEFT)f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=t.minX-i;e.left=e.left-c}else if("rotate"in e&&e.rotate){var o=Ue({left:e.left,top:e.top,width:e.width,height:e.height,rotate:e.rotate}),a=o.offsetX;e.left=i-a}else e.left=i}));else if(t===C.RIGHT)f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=t.maxX-u;e.left=e.left-c}else{var o="line"===e.type?Math.max(e.start[0],e.end[0]):e.width;if("rotate"in e&&e.rotate){var a=Ue({left:e.left,top:e.top,width:e.width,height:e.height,rotate:e.rotate}),l=a.offsetX;e.left=u-o+l}else e.left=u-o}}));else if(t===C.TOP)f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=t.minY-d;e.top=e.top-c}else if("rotate"in e&&e.rotate){var o=Ue({left:e.left,top:e.top,width:e.width,height:e.height,rotate:e.rotate}),a=o.offsetY;e.top=d-a}else e.top=d}));else if(t===C.BOTTOM)f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=t.maxY-s;e.top=e.top-c}else{var o="line"===e.type?Math.max(e.start[1],e.end[1]):e.height;if("rotate"in e&&e.rotate){var a=Ue({left:e.left,top:e.top,width:e.width,height:e.height,rotate:e.rotate}),l=a.offsetY;e.top=s-o+l}else e.top=s-o}}));else if(t===C.HORIZONTAL){var O=(i+u)/2;f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=(t.maxX+t.minX)/2,o=c-O;e.left=e.left-o}else{var a="line"===e.type?Math.max(e.start[0],e.end[0]):e.width;e.left=O-a/2}}))}else if(t===C.VERTICAL){var v=(d+s)/2;f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=(t.maxY+t.minY)/2,o=c-v;e.top=e.top-o}else{var a="line"===e.type?Math.max(e.start[1],e.end[1]):e.height;e.top=v-a/2}}))}e.updateSlide({elements:f}),r()};return{alignActiveElement:i}},Bh=(n("4e82"),function(){var e=ae(),t=Object(g["c"])(ie()),n=t.activeElementIdList,c=t.activeElementList,o=Object(g["c"])(e),a=o.currentSlide,l=at(),r=l.addHistorySnapshot,i=Object(y["computed"])((function(){var e,t=0,n=[],o=Object(L["a"])(c.value);try{for(o.s();!(e=o.n()).done;){var a=e.value;a.groupId?n.includes(a.groupId)||(n.push(a.groupId),t+=1):t+=1}}catch(l){o.e(l)}finally{o.f()}return t})),u=function(){var t,o=Xe(c.value),l=o.minX,i=o.maxX,u=JSON.parse(JSON.stringify(c.value)),d=JSON.parse(JSON.stringify(a.value.elements)),s=[],f=[],b=Object(L["a"])(u);try{var p=function(){var e=t.value;if(e.groupId){var n=f.find((function(t){return t.groupId===e.groupId}));n?f=f.map((function(t){return t.groupId===e.groupId?Object(S["a"])(Object(S["a"])({},t),{},{els:[].concat(Object(Q["a"])(t.els),[e])}):t})):f.push({groupId:e.groupId,els:[e]})}else{var c=Ge(e),o=c.minX,a=c.maxX;s.push({min:o,max:a,el:e})}};for(b.s();!(t=b.n()).done;)p()}catch(ae){b.e(ae)}finally{b.f()}var m,O=[],v=Object(L["a"])(f);try{for(v.s();!(m=v.n()).done;){var j=m.value,h=Xe(j.els),y=h.minX,g=h.maxX;O.push({min:y,max:g,els:j.els})}}catch(ae){v.e(ae)}finally{v.f()}var x=[].concat(s,O);x.sort((function(e,t){return e.min-t.min}));var k,C=0,N=Object(L["a"])(x);try{for(N.s();!(k=N.n()).done;){var E=k.value,w=E.max-E.min;C+=w}}catch(ae){N.e(ae)}finally{N.f()}var V=(i-l-C)/(x.length-1),I=[],B=x[0],_={min:B.min,max:B.max};if("el"in B)I.push({pos:B.min,el:B.el});else{var T,M=Object(L["a"])(B.els);try{for(M.s();!(T=M.n()).done;){var D=T.value,z=Ge(D),F=z.minX;I.push({pos:F,el:D})}}catch(ae){M.e(ae)}finally{M.f()}}for(var A=1;A2?(Object(y["openBlock"])(),Object(y["createBlock"])(p,{key:0,class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(l,{style:{flex:"1"},onClick:t[6]||(t[6]=function(e){return Object(y["unref"])(s)()})},{default:Object(y["withCtx"])((function(){return[Lh]})),_:1}),Object(y["createVNode"])(l,{style:{flex:"1"},onClick:t[7]||(t[7]=function(e){return Object(y["unref"])(f)()})},{default:Object(y["withCtx"])((function(){return[_h]})),_:1})]})),_:1})):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(j),Object(y["createVNode"])(p,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(l,{disabled:!Object(y["unref"])(n),onClick:t[8]||(t[8]=function(e){return Object(y["unref"])(c)()}),style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(h,{style:{"margin-right":"3px"}}),Th]})),_:1},8,["disabled"]),Object(y["createVNode"])(l,{disabled:Object(y["unref"])(n),onClick:t[9]||(t[9]=function(e){return Object(y["unref"])(o)()}),style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g,{style:{"margin-right":"3px"}}),Mh]})),_:1},8,["disabled"])]})),_:1})])}}});n("1855");const zh=pn()(Dh,[["__scopeId","data-v-0d3881c5"]]);var Fh=zh,Ah=[{key:"letter",label:"字母",children:["α","β","γ","δ","ϵ","ε","ζ","η","θ","ϑ","ι","κ","λ","μ","ν","ξ","π","ϖ","ρ","ϱ","σ","ς","τ","υ","ϕ","φ","χ","ψ","ω","Γ","Δ","Θ","Λ","Ξ","Π","Σ","Υ","Φ","Ψ","Ω","𝐀","𝐁","𝐂","𝐃","𝐄","𝐅","𝐆","𝐇","𝐈","𝐉","𝐊","𝐋","𝐌","𝐍","𝐎","𝐏","𝐐","𝐑","𝐒","𝐓","𝐔","𝐕","𝐖","𝐗","𝐘","𝐙","𝐚","𝐛","𝐜","𝐝","𝐞","𝐟","𝐠","𝐡","𝐢","𝐣","𝐤","𝐥","𝐦","𝐧","𝐨","𝐩","𝐪","𝐫","𝐬","𝐭","𝐮","𝐯","𝐰","𝐱","𝐲","𝐳","𝓐","𝓑","𝓒","𝓓","𝓔","𝓕","𝓖","𝓗","𝓘","𝓙","𝓚","𝓛","𝓜","𝓝","𝓞","𝓟","𝓠","𝓡","𝓢","𝓣","𝓤","𝓥","𝓦","𝓧","𝓨","𝓩","𝓪","𝓫","𝓬","𝓭","𝓮","𝓯","𝓰","𝓱","𝓲","𝓳","𝓴","𝓵","𝓶","𝓷","𝓸","𝓹","𝓺","𝓻","𝓼","𝓽","𝓾","𝓿","𝔀","𝔁","𝔂","𝔃"]},{key:"number",label:"序号",children:["①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","⒀","⒁","⒂","⒃","⒄","⒅","⒆","⒇","º","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹","₀","₁","₂","₃","₄","₅","₆","₇","₈","₉","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","Ⅼ","Ⅽ","Ⅾ","Ⅿ","ⅰ","ⅱ","ⅲ","ⅳ","ⅴ","ⅵ","ⅶ","ⅷ","ⅸ","ⅹ","ⅺ","ⅻ","ⅼ","ⅽ","ⅾ","ⅿ","ↀ","ↁ","ↂ","㊀","㊁","㊂","㊃","㊄","㊅","㊆","㊇","㊈","㊉","㈠","㈡","㈢","㈣","㈤","㈥","㈦","㈧","㈨","㈩","𝟘","𝟙","𝟚","𝟛","𝟜","𝟝","𝟞","𝟟","𝟠","𝟡"]},{key:"math",label:"数学",children:["+","-","×","÷","=","~","¬","±","%","°","ǃ","‰","‱","½","⅓","⅔","¼","¾","<",">","l","o","g","l","g","l","n","⨂","⨁","⨄","⨃","⨅","⨆","√","∛","∜","∝","∞","∟","∠","∡","∢","∧","∨","∩","∪","∫","∬","∭","∮","∯","∰","∱","∲","∳","∴","∵","∼","∽","∾","∿","≃","≄","≅","≆","≇","≈","≊","≋","≌","≍","≎","≏","≐","≑","≒","≓","≔","≕","≤","≥","≦","≧","≨","≩","≪","≫","≺","≻","≼","≽","≾","≿","⊀","⊁","⊂","⊃","⊄","⊅","⊆","⊇","⊈","⊉","⊊","⊋","⊏","⊐","⊑","⊒","⊓","⊔","⊢","⊣","⊤","⊥","⊦","⊧","⊨","⊩","⊪","⊫","⊬","⊭","⊮","⊯","⊲","⊳","⊴","⊵","⋀","⋁","⋂","⋃","⋉","⋊","⋋","⋌","⟨","⟩","⟪","⟫","⟮","⟯","⧼","⧽","⦰"]},{key:"arrow",label:"箭头",children:["←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]},{key:"graph",label:"图形",children:["▢","▣","▤","▥","▦","▧","▨","▩","▭","▮","▯","▰","▱","▲","▷","▼","◁","◈","◉","◍","◐","◑","◒","◓","◔","◕","◧","◨","◩","◪","◫","◬","◭","◮"]}],Rh={class:"symbol-panel"},Ph={class:"tabs"},Hh=["onClick"],qh={class:"pool"},Uh=["onClick"],Gh={class:"symbol"},Xh=Object(y["defineComponent"])({__name:"SymbolPanel",setup:function(e){var t=Object(y["ref"])(Ah[0].key),n=Object(y["computed"])((function(){var e=Ah.find((function(e){return e.key===t.value}));return(null===e||void 0===e?void 0:e.children)||[]})),c=function(e){ta.emit(fo.RICH_TEXT_COMMAND,{action:{command:"insert",value:e}})};return function(e,o){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Rh,[Object(y["createElementVNode"])("div",Ph,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(Ah),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["tab",{active:t.value===e.key}]),key:e.key,onClick:function(n){return t.value=e.key}},Object(y["toDisplayString"])(e.label),11,Hh)})),128))]),Object(y["createElementVNode"])("div",qh,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(n),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"symbol-item",key:t,onClick:function(t){return c(e)}},[Object(y["createElementVNode"])("div",Gh,Object(y["toDisplayString"])(e),1)],8,Uh)})),128))])])}}});n("1126");const Yh=pn()(Xh,[["__scopeId","data-v-ba0c96fc"]]);var Zh=Yh,Wh={class:"toolbar"},Jh={class:"tabs"},Kh=["onClick"],Qh={class:"content"},$h=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=ie(),n=Object(g["c"])(t),o=n.activeElementIdList,a=n.handleElement,l=n.toolbarState,r=Object(y["computed"])((function(){var e;return"text"===(null===(e=a.value)||void 0===e?void 0:e.type)?[{label:"样式",value:c.EL_STYLE},{label:"符号",value:c.SYMBOL},{label:"位置",value:c.EL_POSITION},{label:"动画",value:c.EL_ANIMATION}]:[{label:"样式",value:c.EL_STYLE},{label:"位置",value:c.EL_POSITION},{label:"动画",value:c.EL_ANIMATION}]})),i=[{label:"设计",value:c.SLIDE_DESIGN},{label:"切换",value:c.SLIDE_ANIMATION},{label:"动画",value:c.EL_ANIMATION}],u=[{label:"样式",value:c.EL_STYLE},{label:"位置",value:c.MULTI_POSITION}],d=function(e){t.setToolbarState(e)},s=Object(y["computed"])((function(){return o.value.length?o.value.length>1?u:r.value:i}));Object(y["watch"])(s,(function(){var e=s.value.map((function(e){return e.value}));e.includes(l.value)||t.setToolbarState(e[0])}));var f=Object(y["computed"])((function(){var e,t=(e={},Object(pe["a"])(e,c.EL_STYLE,kv),Object(pe["a"])(e,c.EL_POSITION,Gv),Object(pe["a"])(e,c.EL_ANIMATION,Ej),Object(pe["a"])(e,c.SLIDE_DESIGN,yh),Object(pe["a"])(e,c.SLIDE_ANIMATION,Vh),Object(pe["a"])(e,c.MULTI_POSITION,Fh),Object(pe["a"])(e,c.SYMBOL,Zh),e);return t[l.value]||null}));return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Wh,[Object(y["createElementVNode"])("div",Jh,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(s),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["tab",{active:e.value===Object(y["unref"])(l)}]),key:e.value,onClick:function(t){return d(e.value)}},Object(y["toDisplayString"])(e.label),11,Kh)})),128))]),Object(y["createElementVNode"])("div",Qh,[(Object(y["openBlock"])(),Object(y["createBlock"])(Object(y["resolveDynamicComponent"])(Object(y["unref"])(f))))])])}}});n("cd7e");const ey=pn()($h,[["__scopeId","data-v-5303bd17"]]);var ty=ey,ny={class:"remark"},cy=["value"],oy=Object(y["defineComponent"])({__name:"index",props:{height:{type:Number,required:!0}},emits:["update:height"],setup:function(e,t){var n=t.emit,c=e,o=ae(),a=Object(g["c"])(o),l=a.currentSlide,r=Object(y["computed"])((function(){var e;return(null===(e=l.value)||void 0===e?void 0:e.remark)||""})),i=function(e){var t=e.target.value;o.updateSlide({remark:t})},u=function(e){var t=!0,o=e.pageY,a=c.height;document.onmousemove=function(e){if(t){var c=e.pageY,l=c-o,r=-l+a;r<40&&(r=40),r>120&&(r=120),n("update:height",r)}},document.onmouseup=function(){t=!1,document.onmousemove=null,document.onmouseup=null}};return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ny,[Object(y["createElementVNode"])("div",{class:"resize-handler",onMousedown:t[0]||(t[0]=function(e){return u(e)})},null,32),Object(y["createElementVNode"])("textarea",{value:Object(y["unref"])(r),placeholder:"点击输入演讲者备注",onInput:t[1]||(t[1]=function(e){return i(e)})},null,40,cy)])}}});n("ec27");const ay=pn()(oy,[["__scopeId","data-v-82b674f6"]]);var ly=ay,ry=function(e){return Object(y["pushScopeId"])("data-v-60a953a0"),e=e(),Object(y["popScopeId"])(),e},iy={class:"export-img-dialog"},uy={class:"thumbnails-view"},dy={class:"configs"},sy={class:"row"},fy=ry((function(){return Object(y["createElementVNode"])("div",{class:"title"},"导出格式:",-1)})),by=Object(y["createTextVNode"])("JPEG"),py=Object(y["createTextVNode"])("PNG"),my={class:"row"},Oy=ry((function(){return Object(y["createElementVNode"])("div",{class:"title"},"导出范围:",-1)})),vy=Object(y["createTextVNode"])("全部"),jy=Object(y["createTextVNode"])("当前页"),hy=Object(y["createTextVNode"])("自定义"),yy={key:0,class:"row"},gy=["data-range"],xy={class:"row"},ky=ry((function(){return Object(y["createElementVNode"])("div",{class:"title"},"图片质量:",-1)})),Cy={class:"row"},Ny=ry((function(){return Object(y["createElementVNode"])("div",{class:"title"},"忽略在线字体:",-1)})),Ey={class:"config-item"},wy={class:"btns"},Vy=Object(y["createTextVNode"])("导出图片"),Iy=Object(y["createTextVNode"])("关闭"),By=Object(y["defineComponent"])({__name:"ExportImage",emits:["close"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.slides,a=c.currentSlide,l=Object(y["ref"])(),r=Object(y["ref"])("all"),i=Object(y["ref"])([1,o.value.length]),u=Object(y["ref"])("jpeg"),d=Object(y["ref"])(1),s=Object(y["ref"])(!0),f=Object(y["computed"])((function(){return"all"===r.value?o.value:"current"===r.value?[a.value]:o.value.filter((function(e,t){var n=Object(me["a"])(i.value,2),c=n[0],o=n[1];return t>=c-1&&t<=o-1}))})),b=ln(),p=b.exportImage,m=b.exporting,O=function(){l.value&&p(l.value,u.value,d.value,s.value)};return function(e,t){var c=Object(y["resolveComponent"])("RadioButton"),a=Object(y["resolveComponent"])("RadioGroup"),b=Object(y["resolveComponent"])("Slider"),p=Object(y["resolveComponent"])("Switch"),v=Object(y["resolveComponent"])("Tooltip"),j=Object(y["resolveComponent"])("Button"),h=Object(y["resolveComponent"])("FullscreenSpin");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",iy,[Object(y["createElementVNode"])("div",uy,[Object(y["createElementVNode"])("div",{class:"thumbnails",ref_key:"imageThumbnailsRef",ref:l},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(f),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(ad,{class:"thumbnail",key:e.id,slide:e,size:1600},null,8,["slide"])})),128))],512)]),Object(y["createElementVNode"])("div",dy,[Object(y["createElementVNode"])("div",sy,[fy,Object(y["createVNode"])(a,{class:"config-item",value:u.value,"onUpdate:value":t[0]||(t[0]=function(e){return u.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{width:"50%"},value:"jpeg"},{default:Object(y["withCtx"])((function(){return[by]})),_:1}),Object(y["createVNode"])(c,{style:{width:"50%"},value:"png"},{default:Object(y["withCtx"])((function(){return[py]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",my,[Oy,Object(y["createVNode"])(a,{class:"config-item",value:r.value,"onUpdate:value":t[1]||(t[1]=function(e){return r.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"all"},{default:Object(y["withCtx"])((function(){return[vy]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"current"},{default:Object(y["withCtx"])((function(){return[jy]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"custom"},{default:Object(y["withCtx"])((function(){return[hy]})),_:1})]})),_:1},8,["value"])]),"custom"===r.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",yy,[Object(y["createElementVNode"])("div",{class:"title","data-range":"(".concat(i.value[0]," ~ ").concat(i.value[1],")")},"自定义范围:",8,gy),Object(y["createVNode"])(b,{class:"config-item",range:"",min:1,max:Object(y["unref"])(o).length,step:1,value:i.value,"onUpdate:value":t[2]||(t[2]=function(e){return i.value=e})},null,8,["max","value"])])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",xy,[ky,Object(y["createVNode"])(b,{class:"config-item",min:0,max:1,step:.1,value:d.value,"onUpdate:value":t[3]||(t[3]=function(e){return d.value=e})},null,8,["step","value"])]),Object(y["createElementVNode"])("div",Cy,[Ny,Object(y["createElementVNode"])("div",Ey,[Object(y["createVNode"])(v,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"导出时默认忽略在线字体,若您在幻灯片中使用了在线字体,且希望导出后保留相关样式,可选择关闭【忽略在线字体】选项,但要注意这将会增加导出用时。"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(p,{checked:s.value,"onUpdate:checked":t[4]||(t[4]=function(e){return s.value=e})},null,8,["checked"])]})),_:1},8,["mouseEnterDelay"])])])]),Object(y["createElementVNode"])("div",wy,[Object(y["createVNode"])(j,{class:"btn export",type:"primary",onClick:t[5]||(t[5]=function(e){return O()})},{default:Object(y["withCtx"])((function(){return[Vy]})),_:1}),Object(y["createVNode"])(j,{class:"btn close",onClick:t[6]||(t[6]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[Iy]})),_:1})]),Object(y["createVNode"])(h,{loading:Object(y["unref"])(m),tip:"正在导出..."},null,8,["loading"])])}}});n("e303");const Sy=pn()(By,[["__scopeId","data-v-60a953a0"]]);var Ly=Sy,_y={class:"export-json-dialog"},Ty={class:"preview"},My={class:"btns"},Dy=Object(y["createTextVNode"])("导出 JSON"),zy=Object(y["createTextVNode"])("关闭"),Fy=Object(y["defineComponent"])({__name:"ExportJSON",emits:["close"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.slides,a=ln(),l=a.exportJSON;return function(e,t){var c=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",_y,[Object(y["createElementVNode"])("div",Ty,[Object(y["createElementVNode"])("pre",null,Object(y["toDisplayString"])(Object(y["unref"])(o)),1)]),Object(y["createElementVNode"])("div",My,[Object(y["createVNode"])(c,{class:"btn export",type:"primary",onClick:t[0]||(t[0]=function(e){return Object(y["unref"])(l)()})},{default:Object(y["withCtx"])((function(){return[Dy]})),_:1}),Object(y["createVNode"])(c,{class:"btn close",onClick:t[1]||(t[1]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[zy]})),_:1})])])}}});n("eba1");const Ay=pn()(Fy,[["__scopeId","data-v-1bc24666"]]);var Ry=Ay,Py=function(){var e=document.createElement("iframe");return e.style.width="0",e.style.height="0",e.style.position="absolute",e.style.right="0",e.style.top="0",e.style.border="0",document.body.appendChild(e),e},Hy=function(e,t,n){var c="",o="",a=document.styleSheets;if(a){var l,r=Object(L["a"])(a);try{for(r.s();!(l=r.n()).done;){var i=l.value;if(i.cssRules){var u,d=Object(L["a"])(i.cssRules);try{for(d.s();!(u=d.n()).done;){var s=u.value;o+=s.cssText}}catch(v){d.e(v)}finally{d.f()}}}}catch(v){r.e(v)}finally{r.f()}}var f=n.width,b=n.height,p=n.margin,m='\n \n \n \n "),O=""+t.innerHTML+"";e.open(),e.write("\n ".concat(c,"\n \n ").concat(m,"\n ").concat(O,"\n \n ")),e.close()},qy=function(e,t){var n=Py(),c=n.contentWindow;if(n.contentDocument&&c){Hy(n.contentDocument,e,t);var o=function(){c.focus(),c.print()},a=function e(){n.removeEventListener("load",o),c.removeEventListener("afterprint",e),document.body.removeChild(n)};n.addEventListener("load",o),c.addEventListener("afterprint",a)}},Uy=function(e){return Object(y["pushScopeId"])("data-v-15b57798"),e=e(),Object(y["popScopeId"])(),e},Gy={class:"export-pdf-dialog"},Xy={class:"thumbnails-view"},Yy={class:"configs"},Zy={class:"row"},Wy=Uy((function(){return Object(y["createElementVNode"])("div",{class:"title"},"导出范围:",-1)})),Jy=Object(y["createTextVNode"])("全部幻灯片"),Ky=Object(y["createTextVNode"])("当前幻灯片"),Qy={class:"row"},$y=Uy((function(){return Object(y["createElementVNode"])("div",{class:"title"},"每页数量:",-1)})),eg=Object(y["createTextVNode"])("1"),tg=Object(y["createTextVNode"])("2"),ng=Object(y["createTextVNode"])("3"),cg={class:"row"},og=Uy((function(){return Object(y["createElementVNode"])("div",{class:"title"},"边缘留白:",-1)})),ag={class:"config-item"},lg=Uy((function(){return Object(y["createElementVNode"])("div",{class:"tip"}," 注意:若打印预览与实际样式不一致,请在弹出的打印窗口中勾选【背景图形】选项。 ",-1)})),rg={class:"btns"},ig=Object(y["createTextVNode"])("打印 / 导出 PDF"),ug=Object(y["createTextVNode"])("关闭"),dg=Object(y["defineComponent"])({__name:"ExportPDF",emits:["close"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.slides,a=c.currentSlide,l=Object(y["ref"])(),r=Object(y["ref"])("all"),i=Object(y["ref"])(1),u=Object(y["ref"])(!0),d=function(){if(l.value){var e={width:1600,height:"all"===r.value?900*i.value:900,margin:u.value?50:0};qy(l.value,e)}};return function(e,t){var c=Object(y["resolveComponent"])("RadioButton"),s=Object(y["resolveComponent"])("RadioGroup"),f=Object(y["resolveComponent"])("SelectOption"),b=Object(y["resolveComponent"])("Select"),p=Object(y["resolveComponent"])("Switch"),m=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Gy,[Object(y["createElementVNode"])("div",Xy,[Object(y["createElementVNode"])("div",{class:"thumbnails",ref_key:"pdfThumbnailsRef",ref:l},["current"===r.value?(Object(y["openBlock"])(),Object(y["createBlock"])(ad,{key:0,class:"thumbnail",slide:Object(y["unref"])(a),size:1600},null,8,["slide"])):(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],{key:1},Object(y["renderList"])(Object(y["unref"])(o),(function(e,t){return Object(y["openBlock"])(),Object(y["createBlock"])(ad,{class:Object(y["normalizeClass"])(["thumbnail",{"break-page":(t+1)%i.value===0}]),key:e.id,slide:e,size:1600},null,8,["class","slide"])})),128))],512)]),Object(y["createElementVNode"])("div",Yy,[Object(y["createElementVNode"])("div",Zy,[Wy,Object(y["createVNode"])(s,{class:"config-item",value:r.value,"onUpdate:value":t[0]||(t[0]=function(e){return r.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{width:"50%"},value:"all"},{default:Object(y["withCtx"])((function(){return[Jy]})),_:1}),Object(y["createVNode"])(c,{style:{width:"50%"},value:"current"},{default:Object(y["withCtx"])((function(){return[Ky]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",Qy,[$y,Object(y["createVNode"])(b,{class:"config-item",value:i.value,"onUpdate:value":t[1]||(t[1]=function(e){return i.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{value:1},{default:Object(y["withCtx"])((function(){return[eg]})),_:1}),Object(y["createVNode"])(f,{value:2},{default:Object(y["withCtx"])((function(){return[tg]})),_:1}),Object(y["createVNode"])(f,{value:3},{default:Object(y["withCtx"])((function(){return[ng]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",cg,[og,Object(y["createElementVNode"])("div",ag,[Object(y["createVNode"])(p,{checked:u.value,"onUpdate:checked":t[2]||(t[2]=function(e){return u.value=e})},null,8,["checked"])])]),lg]),Object(y["createElementVNode"])("div",rg,[Object(y["createVNode"])(m,{class:"btn export",type:"primary",onClick:t[3]||(t[3]=function(e){return d()})},{default:Object(y["withCtx"])((function(){return[ig]})),_:1}),Object(y["createVNode"])(m,{class:"btn close",onClick:t[4]||(t[4]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[ug]})),_:1})])])}}});n("7239");const sg=pn()(dg,[["__scopeId","data-v-15b57798"]]);var fg=sg,bg=function(e){return Object(y["pushScopeId"])("data-v-3fef9be0"),e=e(),Object(y["popScopeId"])(),e},pg={class:"export-pptx-dialog"},mg={class:"configs"},Og={class:"row"},vg=bg((function(){return Object(y["createElementVNode"])("div",{class:"title"},"导出范围:",-1)})),jg=Object(y["createTextVNode"])("全部"),hg=Object(y["createTextVNode"])("当前页"),yg=Object(y["createTextVNode"])("自定义"),gg={key:0,class:"row"},xg=["data-range"],kg={class:"row"},Cg=bg((function(){return Object(y["createElementVNode"])("div",{class:"title"},"覆盖默认母版:",-1)})),Ng={class:"config-item"},Eg={class:"btns"},wg=Object(y["createTextVNode"])("导出 PPTX"),Vg=Object(y["createTextVNode"])("关闭"),Ig=Object(y["defineComponent"])({__name:"ExportPPTX",emits:["close"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.slides,a=c.currentSlide,l=ln(),r=l.exportPPTX,i=l.exporting,u=Object(y["ref"])("all"),d=Object(y["ref"])([1,o.value.length]),s=Object(y["ref"])(!0),f=Object(y["computed"])((function(){return"all"===u.value?o.value:"current"===u.value?[a.value]:o.value.filter((function(e,t){var n=Object(me["a"])(d.value,2),c=n[0],o=n[1];return t>=c-1&&t<=o-1}))}));return function(e,t){var c=Object(y["resolveComponent"])("RadioButton"),a=Object(y["resolveComponent"])("RadioGroup"),l=Object(y["resolveComponent"])("Slider"),b=Object(y["resolveComponent"])("Switch"),p=Object(y["resolveComponent"])("Button"),m=Object(y["resolveComponent"])("FullscreenSpin");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",pg,[Object(y["createElementVNode"])("div",mg,[Object(y["createElementVNode"])("div",Og,[vg,Object(y["createVNode"])(a,{class:"config-item",value:u.value,"onUpdate:value":t[0]||(t[0]=function(e){return u.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"all"},{default:Object(y["withCtx"])((function(){return[jg]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"current"},{default:Object(y["withCtx"])((function(){return[hg]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"custom"},{default:Object(y["withCtx"])((function(){return[yg]})),_:1})]})),_:1},8,["value"])]),"custom"===u.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",gg,[Object(y["createElementVNode"])("div",{class:"title","data-range":"(".concat(d.value[0]," ~ ").concat(d.value[1],")")},"自定义范围:",8,xg),Object(y["createVNode"])(l,{class:"config-item",range:"",min:1,max:Object(y["unref"])(o).length,step:1,value:d.value,"onUpdate:value":t[1]||(t[1]=function(e){return d.value=e})},null,8,["max","value"])])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",kg,[Cg,Object(y["createElementVNode"])("div",Ng,[Object(y["createVNode"])(b,{checked:s.value,"onUpdate:checked":t[2]||(t[2]=function(e){return s.value=e})},null,8,["checked"])])])]),Object(y["createElementVNode"])("div",Eg,[Object(y["createVNode"])(p,{class:"btn export",type:"primary",onClick:t[3]||(t[3]=function(e){return Object(y["unref"])(r)(Object(y["unref"])(f),s.value)})},{default:Object(y["withCtx"])((function(){return[wg]})),_:1}),Object(y["createVNode"])(p,{class:"btn close",onClick:t[4]||(t[4]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[Vg]})),_:1})]),Object(y["createVNode"])(m,{loading:Object(y["unref"])(i),tip:"正在导出..."},null,8,["loading"])])}}});n("fef8");const Bg=pn()(Ig,[["__scopeId","data-v-3fef9be0"]]);var Sg=Bg,Lg=function(e){return Object(y["pushScopeId"])("data-v-e2b465d2"),e=e(),Object(y["popScopeId"])(),e},_g={class:"export-pptist-dialog"},Tg={class:"configs"},Mg={class:"row"},Dg=Lg((function(){return Object(y["createElementVNode"])("div",{class:"title"},"导出范围:",-1)})),zg=Object(y["createTextVNode"])("全部"),Fg=Object(y["createTextVNode"])("当前页"),Ag=Object(y["createTextVNode"])("自定义"),Rg={key:0,class:"row"},Pg=["data-range"],Hg=Lg((function(){return Object(y["createElementVNode"])("div",{class:"tip"}," 提示:.pptist 是本应用的特有文件后缀,支持将该类型的文件导入回应用中。 ",-1)})),qg={class:"btns"},Ug=Object(y["createTextVNode"])("导出 .pptist 文件"),Gg=Object(y["createTextVNode"])("关闭"),Xg=Object(y["defineComponent"])({__name:"ExportSpecificFile",emits:["close"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.slides,a=c.currentSlide,l=ln(),r=l.exportSpecificFile,i=Object(y["ref"])("all"),u=Object(y["ref"])([1,o.value.length]),d=Object(y["computed"])((function(){return"all"===i.value?o.value:"current"===i.value?[a.value]:o.value.filter((function(e,t){var n=Object(me["a"])(u.value,2),c=n[0],o=n[1];return t>=c-1&&t<=o-1}))}));return function(e,t){var c=Object(y["resolveComponent"])("RadioButton"),a=Object(y["resolveComponent"])("RadioGroup"),l=Object(y["resolveComponent"])("Slider"),s=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",_g,[Object(y["createElementVNode"])("div",Tg,[Object(y["createElementVNode"])("div",Mg,[Dg,Object(y["createVNode"])(a,{class:"config-item",value:i.value,"onUpdate:value":t[0]||(t[0]=function(e){return i.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"all"},{default:Object(y["withCtx"])((function(){return[zg]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"current"},{default:Object(y["withCtx"])((function(){return[Fg]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"custom"},{default:Object(y["withCtx"])((function(){return[Ag]})),_:1})]})),_:1},8,["value"])]),"custom"===i.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Rg,[Object(y["createElementVNode"])("div",{class:"title","data-range":"(".concat(u.value[0]," ~ ").concat(u.value[1],")")},"自定义范围:",8,Pg),Object(y["createVNode"])(l,{class:"config-item",range:"",min:1,max:Object(y["unref"])(o).length,step:1,value:u.value,"onUpdate:value":t[1]||(t[1]=function(e){return u.value=e})},null,8,["max","value"])])):Object(y["createCommentVNode"])("",!0),Hg]),Object(y["createElementVNode"])("div",qg,[Object(y["createVNode"])(s,{class:"btn export",type:"primary",onClick:t[2]||(t[2]=function(e){return Object(y["unref"])(r)(Object(y["unref"])(d))})},{default:Object(y["withCtx"])((function(){return[Ug]})),_:1}),Object(y["createVNode"])(s,{class:"btn close",onClick:t[3]||(t[3]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[Gg]})),_:1})])])}}});n("bf43");const Yg=pn()(Xg,[["__scopeId","data-v-e2b465d2"]]);var Zg=Yg,Wg={class:"export-dialog"},Jg={class:"tabs"},Kg=["onClick"],Qg={class:"content"},$g=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=ie(),n=Object(g["c"])(t),c=n.dialogForExport,o=t.setDialogForExport,a=[{key:"pptist",label:"导出 pptist 文件"},{key:"pptx",label:"导出 PPTX"},{key:"image",label:"导出图片"},{key:"json",label:"导出 JSON"},{key:"pdf",label:"打印 / 导出 PDF"}],l=Object(y["computed"])((function(){var e={image:Ly,json:Ry,pdf:fg,pptx:Sg,pptist:Zg};return e[c.value]||null}));return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Wg,[Object(y["createElementVNode"])("div",Jg,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(a,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tab",{active:e.key===Object(y["unref"])(c)}]),key:e.key,onClick:function(t){return Object(y["unref"])(o)(e.key)}},Object(y["toDisplayString"])(e.label),11,Kg)})),64))]),Object(y["createElementVNode"])("div",Qg,[(Object(y["openBlock"])(),Object(y["createBlock"])(Object(y["resolveDynamicComponent"])(Object(y["unref"])(l)),{onClose:t[0]||(t[0]=function(e){return Object(y["unref"])(o)("")})},null,32))])])}}});n("d970");const ex=pn()($g,[["__scopeId","data-v-1f8f1a8b"]]);var tx=ex,nx={class:"pptist-editor"},cx={class:"layout-content"},ox={class:"layout-content-center"},ax=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=ie(),n=Object(g["c"])(t),c=n.dialogForExport,o=function(){return t.setDialogForExport("")},a=Object(y["ref"])(40);return xt(),kt(),function(e,t){var n=Object(y["resolveComponent"])("Modal");return Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,[Object(y["createElementVNode"])("div",nx,[Object(y["createVNode"])(ec,{class:"layout-header"}),Object(y["createElementVNode"])("div",cx,[Object(y["createVNode"])(Sf,{class:"layout-content-left"}),Object(y["createElementVNode"])("div",ox,[Object(y["createVNode"])(Of,{class:"center-top"}),Object(y["createVNode"])(xd,{class:"center-body",style:Object(y["normalizeStyle"])({height:"calc(100% - ".concat(a.value+40,"px)")})},null,8,["style"]),Object(y["createVNode"])(ly,{class:"center-bottom",height:a.value,"onUpdate:height":t[0]||(t[0]=function(e){return a.value=e}),style:Object(y["normalizeStyle"])({height:"".concat(a.value,"px")})},null,8,["height","style"])]),Object(y["createVNode"])(ty,{class:"layout-content-right"})])]),Object(y["createVNode"])(n,{visible:!!Object(y["unref"])(c),footer:null,centered:"",closable:!1,width:680,destroyOnClose:"",onCancel:t[1]||(t[1]=function(e){return o()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(tx)]})),_:1},8,["visible"])],64)}}});n("0be5");const lx=pn()(ax,[["__scopeId","data-v-328e1a4e"]]);var rx=lx,ix=function(){var e=ae(),t=Object(g["c"])(e),n=t.slides,c=t.slideIndex,o=t.formatedAnimations,a=Object(y["ref"])(0),l=Object(y["ref"])(!1),r=Object(y["ref"])(c.value),i=function e(){if(!l.value){var t=o.value[a.value],n=t.animations,c=t.autoNext;a.value+=1,l.value=!0;var r,i=0,u=Object(L["a"])(n);try{var d=function(){var t=r.value,o=document.querySelector("#screen-element-".concat(t.elId," [class^=base-element-]"));if(!o)return i+=1,"continue";var a="".concat(Zv).concat(t.effect);o.style.removeProperty("--animate-duration");var u,d=Object(L["a"])(o.classList);try{for(d.s();!(u=d.n()).done;){var s=u.value;-1!==s.indexOf(Zv)&&o.classList.remove(s,"".concat(Zv,"animated"))}}catch(b){d.e(b)}finally{d.f()}o.style.setProperty("--animate-duration","".concat(t.duration,"ms")),o.classList.add(a,"".concat(Zv,"animated"));var f=function(){"out"!==t.type&&(o.style.removeProperty("--animate-duration"),o.classList.remove(a,"".concat(Zv,"animated"))),i+=1,i===n.length&&(l.value=!1,c&&e())};o.addEventListener("animationend",f,{once:!0})};for(u.s();!(r=u.n()).done;)d()}catch(s){u.e(s)}finally{u.f()}}},u=function(){a.value-=1;var e,t=o.value[a.value].animations,n=Object(L["a"])(t);try{for(n.s();!(e=n.n()).done;){var c=e.value,l=document.querySelector("#screen-element-".concat(c.elId," [class^=base-element-]"));if(l){l.style.removeProperty("--animate-duration");var r,i=Object(L["a"])(l.classList);try{for(i.s();!(r=i.n()).done;){var u=r.value;-1!==u.indexOf(Zv)&&l.classList.remove(u,"".concat(Zv,"animated"))}}catch(d){i.e(d)}finally{i.f()}}}}catch(d){n.e(d)}finally{n.f()}t.every((function(e){return"attention"===e.type}))&&b()},d=Object(y["ref"])(0),s=function(){d.value&&(clearInterval(d.value),d.value=0)};Object(y["onUnmounted"])(s);var f=Object(te["throttle"])((function(e){Se["a"].success(e)}),1e3,{leading:!0,trailing:!1}),b=function(){o.value.length&&a.value>0?u():c.value>0?(e.updateSlideIndex(c.value-1),c.value0&&p()}),500,{leading:!0,trailing:!1}),v=Object(y["ref"])(null),j=function(e){v.value={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}},h=function(e){if(v.value){var t=Math.abs(v.value.x-e.changedTouches[0].pageX),n=e.changedTouches[0].pageY-v.value.y;Math.abs(n)>t&&Math.abs(n)>50&&(v.value=null,n>0?b():p())}},x=function(e){var t=e.key.toUpperCase();t===V.UP||t===V.LEFT||t===V.PAGEUP?b():t!==V.DOWN&&t!==V.RIGHT&&t!==V.SPACE&&t!==V.ENTER&&t!==V.PAGEDOWN||p()};Object(y["onMounted"])((function(){return document.addEventListener("keydown",x)})),Object(y["onUnmounted"])((function(){return document.removeEventListener("keydown",x)}));var k=function(){e.updateSlideIndex(c.value-1),a.value=0},C=function(){e.updateSlideIndex(c.value+1),a.value=0},N=function(t){e.updateSlideIndex(t),a.value=0},E=function(t){var c=n.value.findIndex((function(e){return e.id===t}));-1!==c&&(e.updateSlideIndex(c),a.value=0)};return{autoPlayTimer:d,autoPlay:m,closeAutoPlay:s,mousewheelListener:O,touchStartListener:j,touchEndListener:h,turnPrevSlide:k,turnNextSlide:C,turnSlideToIndex:N,turnSlideToId:E,execPrev:b,execNext:p,animationIndex:a}},ux=function(e){var t=ae(),n=Object(g["c"])(t),c=n.viewportRatio,o=Object(y["ref"])(0),a=Object(y["ref"])(0),l=function(){var t,n,l=(null===e||void 0===e?void 0:e.value)||document.body,r=l.clientWidth,i=l.clientHeight;i/r===c.value?(t=r,n=i):i/r>c.value?(t=r,n=r*c.value):(t=i/c.value,n=i),o.value=t,a.value=n};return Object(y["onMounted"])((function(){l(),window.addEventListener("resize",l)})),Object(y["onUnmounted"])((function(){window.removeEventListener("resize",l)})),{slideWidth:o,slideHeight:a}},dx=function(){var e=Object(y["ref"])(!0),t=Object(y["ref"])(!0),n=yt(),c=n.exitScreening,o=function(){e.value=ht(),!e.value&&t.value&&c(),t.value=!0};Object(y["onMounted"])((function(){e.value=ht(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o)})),Object(y["onUnmounted"])((function(){document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}));var a=function(){e.value&&(t.value=!1,jt())};return{fullscreenState:e,manualExitFullscreen:a}},sx=Object(y["defineComponent"])({__name:"ScreenChartElement",props:{elementInfo:{type:Object,required:!0}},setup:function(e){return function(t,n){return Object(y["openBlock"])(),Object(y["createBlock"])(Vu,{class:"screen-element-chart",elementInfo:e.elementInfo},null,8,["elementInfo"])}}});const fx=sx;var bx=fx,px={class:"element-content"},mx=Object(y["defineComponent"])({__name:"ScreenVideoElement",props:{elementInfo:{type:Object,required:!0}},setup:function(e){var t=Object(g["c"])(ae()),n=t.currentSlide,c=Object(y["inject"])(tc)||Object(y["ref"])(1),o=Object(y["inject"])(nc)||Object(y["ref"])(""),a=Object(y["computed"])((function(){return n.value.id===o.value}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"screen-element-video",style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["createElementVNode"])("div",px,[Object(y["unref"])(a)?(Object(y["openBlock"])(),Object(y["createBlock"])(Ql,{key:0,width:e.elementInfo.width,height:e.elementInfo.height,src:e.elementInfo.src,poster:e.elementInfo.poster,scale:Object(y["unref"])(c)},null,8,["width","height","src","poster","scale"])):Object(y["createCommentVNode"])("",!0)])],4)],4)}}});n("7a78");const Ox=pn()(mx,[["__scopeId","data-v-76457308"]]);var vx=Ox,jx={class:"element-content"},hx=Object(y["defineComponent"])({__name:"ScreenAudioElement",props:{elementInfo:{type:Object,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ae()),c=n.viewportRatio,o=n.currentSlide,a=Object(y["inject"])(tc)||Object(y["ref"])(1),l=Object(y["inject"])(nc)||Object(y["ref"])(""),r=Object(y["computed"])((function(){return o.value.id===l.value})),i=Object(y["computed"])((function(){return Math.min(t.elementInfo.width,t.elementInfo.height)+"px"})),u=Object(y["computed"])((function(){var e=tt,n=tt*c.value,o=280/a.value,l=50/a.value,r=t.elementInfo.width,i=t.elementInfo.height,u=t.elementInfo.left,d=t.elementInfo.top,s=0,f=i;return u+o>=e&&(s=r-o),d+i+l>=n&&(f=-l),{left:s+"px",top:f+"px"}})),d=Object(y["ref"])(),s=function(){d.value&&d.value.toggle()};return function(t,n){var c=Object(y["resolveComponent"])("IconVolumeNotice");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"screen-element-audio",style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["createElementVNode"])("div",jx,[Object(y["createVNode"])(c,{class:"audio-icon",style:Object(y["normalizeStyle"])({fontSize:Object(y["unref"])(i),color:e.elementInfo.color}),onClick:n[0]||(n[0]=function(e){return s()})},null,8,["style"]),Object(y["unref"])(r)?(Object(y["openBlock"])(),Object(y["createBlock"])(yr,{key:0,class:"audio-player",ref_key:"audioPlayerRef",ref:d,style:Object(y["normalizeStyle"])(Object(S["a"])({},Object(y["unref"])(u))),src:e.elementInfo.src,loop:e.elementInfo.loop,autoplay:e.elementInfo.autoplay,scale:Object(y["unref"])(a)},null,8,["style","src","loop","autoplay","scale"])):Object(y["createCommentVNode"])("",!0)])],4)],4)}}});n("3010");const yx=pn()(hx,[["__scopeId","data-v-1172b8ee"]]);var gx=yx,xx=["id","title"],kx=Object(y["defineComponent"])({__name:"ScreenElement",props:{elementInfo:{type:Object,required:!0},elementIndex:{type:Number,required:!0},animationIndex:{type:Number,required:!0},turnSlideToId:{type:Function,required:!0},manualExitFullscreen:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(y["computed"])((function(){var e,n=(e={},Object(pe["a"])(e,Ve.IMAGE,iu),Object(pe["a"])(e,Ve.TEXT,fu),Object(pe["a"])(e,Ve.SHAPE,yu),Object(pe["a"])(e,Ve.LINE,Nu),Object(pe["a"])(e,Ve.CHART,bx),Object(pe["a"])(e,Ve.TABLE,Fu),Object(pe["a"])(e,Ve.LATEX,Gu),Object(pe["a"])(e,Ve.VIDEO,vx),Object(pe["a"])(e,Ve.AUDIO,gx),e);return n[t.elementInfo.type]||null})),c=Object(g["c"])(ae()),o=c.formatedAnimations,a=c.theme,l=Object(y["computed"])((function(){var e=o.value.findIndex((function(e){var n=e.animations.map((function(e){return e.elId}));return n.includes(t.elementInfo.id)}));if(-1===e)return!1;if(eObject(y["unref"])(o),hide:(n===Object(y["unref"])(o)-1||n===Object(y["unref"])(o)+1)&&t.turningMode!==Object(y["unref"])(a).turningMode}]),key:t.id},[Math.abs(Object(y["unref"])(o)-n)<2||null!==(c=t.animations)&&void 0!==c&&c.length?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"slide-content",style:Object(y["normalizeStyle"])({width:e.slideWidth+"px",height:e.slideHeight+"px"})},[Object(y["createVNode"])(Vx,{slide:t,scale:Object(y["unref"])(l),animationIndex:e.animationIndex,turnSlideToId:e.turnSlideToId,manualExitFullscreen:e.manualExitFullscreen},null,8,["slide","scale","animationIndex","turnSlideToId","manualExitFullscreen"])],4)):Object(y["createCommentVNode"])("",!0)],2)})),128))])}}});n("9557");const Sx=pn()(Bx,[["__scopeId","data-v-77a3e620"]]);var Lx=Sx,_x={class:"slide-thumbnails"},Tx={class:"return-button"},Mx={class:"slide-thumbnails-content"},Dx=["onClick"],zx=Object(y["defineComponent"])({__name:"SlideThumbnails",props:{turnSlideToIndex:{type:Function,required:!0}},emits:["close"],setup:function(e,t){var n=t.emit,c=e,o=Object(g["c"])(ae()),a=o.slides,l=o.slideIndex,r=vf(),i=r.slidesLoadLimit,u=function(e){c.turnSlideToIndex(e),n("close")};return function(e,t){var c=Object(y["resolveComponent"])("IconArrowCircleLeft");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",_x,[Object(y["createElementVNode"])("div",Tx,[Object(y["createVNode"])(c,{class:"icon",onClick:t[0]||(t[0]=function(e){return n("close")})})]),Object(y["createElementVNode"])("div",Mx,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(a),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["thumbnail",{active:t===Object(y["unref"])(l)}]),key:e.id,onClick:function(e){return u(t)}},[Object(y["createVNode"])(ad,{slide:e,size:150,visible:t=c?l:a-i/c*a,-1===b?n:1*n/3+2*b/3},I=function(e,t){var n=(new Date).getTime();if("pen"===c.model){var o=w(e,t),a=n-f,l=V(o,a);N(e,t,l),b=l}else"mark"===c.model?N(e,t,u.value):E(e,t);d={x:e,y:t},f=(new Date).getTime()},B=function(e){if(!l.value)return[0,0];var t=e instanceof MouseEvent?e:e.changedTouches[0],n=l.value.getBoundingClientRect(),c=t.pageX-n.x,o=t.pageY-n.y;return[c,o]},S=function(e){var t=B(e),n=Object(me["a"])(t,2),c=n[0],o=n[1],a=c/j.value,l=o/h.value;s=!0,d={x:a,y:l},f=(new Date).getTime(),e instanceof MouseEvent||(p.value={x:c,y:o},m.value=!0)},L=function(e){var t=B(e),n=Object(me["a"])(t,2),c=n[0],o=n[1],a=c/j.value,l=o/h.value;p.value={x:c,y:o},s&&I(a,l)},_=function(){s&&(s=!1)},T=function(){o&&l.value&&o.clearRect(0,0,l.value.width,l.value.height)},M=function(){var e;return null===(e=l.value)||void 0===e?void 0:e.toDataURL()},D=function(e){var t=new Image;t.src=e,t.onload=function(){o&&o.drawImage(t,0,0)}},z=Object(te["throttle"])((function(e){"eraser"===c.model&&(e.deltaY<0&&i.value<200?i.value+=20:e.deltaY>0&&i.value>20&&(i.value-=20)),"pen"===c.model&&(e.deltaY<0&&r.value<10?r.value+=2:e.deltaY>0&&r.value>4&&(r.value-=2)),"mark"===c.model&&(e.deltaY<0&&u.value<40?u.value+=4:e.deltaY>0&&u.value>16&&(u.value-=4))}),300,{leading:!0,trailing:!1});return n({clearCanvas:T,getImageDataURL:M,setImageDataURL:D}),function(t,n){var c=Object(y["resolveComponent"])("IconWrite"),o=Object(y["resolveComponent"])("IconHighLight");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"writing-board",ref_key:"writingBoardRef",ref:a},[e.blackboard?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Rx)):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("canvas",{class:"canvas",ref_key:"canvasRef",ref:l,style:Object(y["normalizeStyle"])({width:O.value+"px",height:v.value+"px"}),onMousedown:n[0]||(n[0]=function(e){return S(e)}),onMousemove:n[1]||(n[1]=function(e){return L(e)}),onMouseup:n[2]||(n[2]=function(e){return _()}),onTouchstart:n[3]||(n[3]=function(e){return S(e)}),onTouchmove:n[4]||(n[4]=function(e){return L(e)}),onTouchend:n[5]||(n[5]=function(e){_(),m.value=!1}),onMouseleave:n[6]||(n[6]=function(e){_(),m.value=!1}),onMouseenter:n[7]||(n[7]=function(e){return m.value=!0}),onWheel:n[8]||(n[8]=function(e){return Object(y["unref"])(z)(e)})},null,36),m.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:1},["eraser"===e.model?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"eraser",style:Object(y["normalizeStyle"])({left:p.value.x-i.value/2+"px",top:p.value.y-i.value/2+"px",width:i.value+"px",height:i.value+"px"})},null,4)):Object(y["createCommentVNode"])("",!0),"pen"===e.model?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:1,class:"pen",style:Object(y["normalizeStyle"])({left:p.value.x-r.value/2+"px",top:p.value.y-6*r.value+r.value/2+"px",color:e.color})},["pen"===e.model?(Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:0,class:"icon",size:6*r.value},null,8,["size"])):Object(y["createCommentVNode"])("",!0)],4)):Object(y["createCommentVNode"])("",!0),"mark"===e.model?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:2,class:"pen",style:Object(y["normalizeStyle"])({left:p.value.x-u.value/2+"px",top:p.value.y+"px",color:e.color})},["mark"===e.model?(Object(y["openBlock"])(),Object(y["createBlock"])(o,{key:0,class:"icon",size:1.5*u.value},null,8,["size"])):Object(y["createCommentVNode"])("",!0)],4)):Object(y["createCommentVNode"])("",!0)],64)):Object(y["createCommentVNode"])("",!0)],512)}}});n("5fa4");const Hx=pn()(Px,[["__scopeId","data-v-1d4eb7f0"]]);var qx=Hx,Ux={class:"writing-board-tool"},Gx={class:"colors"},Xx=["onClick"],Yx=Object(y["defineComponent"])({__name:"WritingBoardTool",props:{slideWidth:{type:Number,required:!0},slideHeight:{type:Number,required:!0},position:{type:Object,default:function(){return{right:"5px",bottom:"5px"}}}},emits:["close"],setup:function(e,t){var n=t.emit,c=["#000000","#ffffff","#1e497b","#4e81bb","#e2534d","#9aba60","#8165a0","#47acc5","#f9974c","#ffff3a"],o=Object(y["ref"])(),a=Object(y["ref"])("#e2534d"),l=Object(y["ref"])("pen"),r=Object(y["ref"])(!1),i=function(e){l.value=e},u=function(){o.value.clearCanvas()},d=function(e){"eraser"===l.value&&(l.value="pen"),a.value=e},s=function(){n("close")};return function(t,n){var f=Object(y["resolveComponent"])("IconWrite"),b=Object(y["resolveComponent"])("Tooltip"),p=Object(y["resolveComponent"])("IconHighLight"),m=Object(y["resolveComponent"])("IconErase"),O=Object(y["resolveComponent"])("IconClear"),v=Object(y["resolveComponent"])("IconFill"),j=Object(y["resolveComponent"])("IconClose");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Ux,[Object(y["createElementVNode"])("div",{class:"writing-board-wrap",style:Object(y["normalizeStyle"])({width:e.slideWidth+"px",height:e.slideHeight+"px"})},[Object(y["createVNode"])(qx,{ref_key:"writingBoardRef",ref:o,color:a.value,blackboard:r.value,model:l.value},null,8,["color","blackboard","model"])],4),Object(y["createElementVNode"])("div",{class:"tools",style:Object(y["normalizeStyle"])(e.position)},[Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"画笔"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["btn",{active:"pen"===l.value}]),onClick:n[0]||(n[0]=function(e){return i("pen")})},[Object(y["createVNode"])(f,{class:"icon"})],2)]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"荧光笔"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["btn",{active:"mark"===l.value}]),onClick:n[1]||(n[1]=function(e){return i("mark")})},[Object(y["createVNode"])(p,{class:"icon"})],2)]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"橡皮擦"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["btn",{active:"eraser"===l.value}]),onClick:n[2]||(n[2]=function(e){return i("eraser")})},[Object(y["createVNode"])(m,{class:"icon"})],2)]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"清除墨迹"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:"btn",onClick:n[3]||(n[3]=function(e){return u()})},[Object(y["createVNode"])(O,{class:"icon"})])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"黑板"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["btn",{active:r.value}]),onClick:n[4]||(n[4]=function(e){return r.value=!r.value})},[Object(y["createVNode"])(v,{class:"icon"})],2)]})),_:1},8,["mouseEnterDelay"]),Object(y["createElementVNode"])("div",Gx,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(c,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["color",{active:e===a.value}]),key:e,style:Object(y["normalizeStyle"])({backgroundColor:e}),onClick:function(t){return d(e)}},null,14,Xx)})),64))]),Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"关闭画笔"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:"btn",onClick:n[5]||(n[5]=function(e){return s()})},[Object(y["createVNode"])(j,{class:"icon"})])]})),_:1},8,["mouseEnterDelay"])],4)])}}});n("4f60");const Zx=pn()(Yx,[["__scopeId","data-v-876081a6"]]);var Wx=Zx,Jx={class:"tools-left"},Kx={class:"content"},Qx=Object(y["defineComponent"])({__name:"BaseView",props:{changeViewMode:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ae()),c=n.slides,o=n.slideIndex,a=ix(),l=a.autoPlayTimer,r=a.autoPlay,i=a.closeAutoPlay,u=a.mousewheelListener,d=a.touchStartListener,s=a.touchEndListener,f=a.turnPrevSlide,b=a.turnNextSlide,p=a.turnSlideToIndex,m=a.turnSlideToId,O=a.execPrev,v=a.execNext,j=a.animationIndex,h=ux(),x=h.slideWidth,k=h.slideHeight,C=yt(),N=C.exitScreening,E=dx(),w=E.fullscreenState,V=E.manualExitFullscreen,I=Object(y["ref"])(!1),B=Object(y["ref"])(!1),S=Object(y["ref"])(!1),L=Object(y["ref"])(!1),_=function(){return[{text:"上一页",subText:"↑ ←",disable:o.value<=0,handler:function(){return f()}},{text:"下一页",subText:"↓ →",disable:o.value>=c.value.length-1,handler:function(){return b()}},{text:"第一页",disable:0===o.value,handler:function(){return p(0)}},{text:"最后一页",disable:o.value===c.value.length-1,handler:function(){return p(c.value.length-1)}},{divider:!0},{text:"显示工具栏",handler:function(){return I.value=!0}},{text:"查看所有幻灯片",handler:function(){return S.value=!0}},{text:"画笔工具",handler:function(){return B.value=!0}},{text:"演讲者视图",handler:function(){return t.changeViewMode("presenter")}},{divider:!0},{text:l.value?"取消自动放映":"自动放映",handler:l.value?i:r},{text:"结束放映",subText:"ESC",handler:N}]};return function(t,n){var a=Object(y["resolveComponent"])("IconLeftTwo"),l=Object(y["resolveComponent"])("IconRightTwo"),r=Object(y["resolveComponent"])("IconWrite"),i=Object(y["resolveComponent"])("Tooltip"),f=Object(y["resolveComponent"])("IconMagic"),b=Object(y["resolveComponent"])("IconListView"),h=Object(y["resolveComponent"])("IconOffScreenOne"),g=Object(y["resolveComponent"])("IconFullScreenOne"),C=Object(y["resolveComponent"])("IconPower"),E=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["base-view",{"laser-pen":L.value}])},[Object(y["withDirectives"])(Object(y["createVNode"])(Lx,{slideWidth:Object(y["unref"])(x),slideHeight:Object(y["unref"])(k),animationIndex:Object(y["unref"])(j),turnSlideToId:Object(y["unref"])(m),manualExitFullscreen:Object(y["unref"])(V),onWheel:n[0]||(n[0]=function(e){return Object(y["unref"])(u)(e)}),onTouchstart:n[1]||(n[1]=function(e){return Object(y["unref"])(d)(e)}),onTouchend:n[2]||(n[2]=function(e){return Object(y["unref"])(s)(e)})},null,8,["slideWidth","slideHeight","animationIndex","turnSlideToId","manualExitFullscreen"]),[[E,_]]),S.value?(Object(y["openBlock"])(),Object(y["createBlock"])(Ax,{key:0,turnSlideToIndex:Object(y["unref"])(p),onClose:n[3]||(n[3]=function(e){return S.value=!1})},null,8,["turnSlideToIndex"])):Object(y["createCommentVNode"])("",!0),B.value?(Object(y["openBlock"])(),Object(y["createBlock"])(Wx,{key:1,slideWidth:Object(y["unref"])(x),slideHeight:Object(y["unref"])(k),onClose:n[4]||(n[4]=function(e){return B.value=!1})},null,8,["slideWidth","slideHeight"])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",Jx,[Object(y["createVNode"])(a,{class:"tool-btn",theme:"two-tone",fill:["#111","#fff"],onClick:n[5]||(n[5]=function(e){return Object(y["unref"])(O)()})}),Object(y["createVNode"])(l,{class:"tool-btn",theme:"two-tone",fill:["#111","#fff"],onClick:n[6]||(n[6]=function(e){return Object(y["unref"])(v)()})})]),Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tools-right",{visible:I.value}]),onMouseleave:n[14]||(n[14]=function(e){return I.value=!1}),onMouseenter:n[15]||(n[15]=function(e){return I.value=!0})},[Object(y["createElementVNode"])("div",Kx,[Object(y["createElementVNode"])("div",{class:"tool-btn page-number",onClick:n[7]||(n[7]=function(e){return S.value=!0})},"幻灯片 "+Object(y["toDisplayString"])(Object(y["unref"])(o)+1)+" / "+Object(y["toDisplayString"])(Object(y["unref"])(c).length),1),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"画笔工具"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r,{class:"tool-btn",onClick:n[8]||(n[8]=function(e){return B.value=!0})})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"激光笔"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{class:Object(y["normalizeClass"])(["tool-btn",{active:L.value}]),onClick:n[9]||(n[9]=function(e){return L.value=!L.value})},null,8,["class"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"演讲者视图"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(b,{class:"tool-btn",onClick:n[10]||(n[10]=function(t){return e.changeViewMode("presenter")})})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:Object(y["unref"])(w)?"退出全屏":"进入全屏"},{default:Object(y["withCtx"])((function(){return[Object(y["unref"])(w)?(Object(y["openBlock"])(),Object(y["createBlock"])(h,{key:0,class:"tool-btn",onClick:n[11]||(n[11]=function(e){return Object(y["unref"])(V)()})})):(Object(y["openBlock"])(),Object(y["createBlock"])(g,{key:1,class:"tool-btn",onClick:n[12]||(n[12]=function(e){return Object(y["unref"])(vt)()})}))]})),_:1},8,["mouseEnterDelay","title"]),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"结束放映"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(C,{class:"tool-btn",onClick:n[13]||(n[13]=function(e){return Object(y["unref"])(N)()})})]})),_:1},8,["mouseEnterDelay"])])],34)],2)}}});n("4a2e");const $x=pn()(Qx,[["__scopeId","data-v-d72d6626"]]);var ek=$x,tk=function(e){return Object(y["pushScopeId"])("data-v-5fba3eec"),e=e(),Object(y["popScopeId"])(),e},nk={class:"presenter-view"},ck={class:"toolbar"},ok=tk((function(){return Object(y["createElementVNode"])("span",null,"普通视图",-1)})),ak=tk((function(){return Object(y["createElementVNode"])("span",null,"画笔",-1)})),lk=tk((function(){return Object(y["createElementVNode"])("span",null,"激光笔",-1)})),rk=tk((function(){return Object(y["createElementVNode"])("span",null,"结束放映",-1)})),ik={class:"content"},uk=["onClick"],dk={class:"remark"},sk={class:"header"},fk=tk((function(){return Object(y["createElementVNode"])("span",null,"演讲者备注",-1)})),bk=["innerHTML"],pk={class:"remark-scale"},mk=Object(y["defineComponent"])({__name:"PresenterView",props:{changeViewMode:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ae()),c=n.slides,o=n.slideIndex,a=n.viewportRatio,l=n.currentSlide,r=Object(y["ref"])(),i=Object(y["ref"])(),u=Object(y["ref"])(!1),d=Object(y["ref"])(!1),s=ix(),f=s.mousewheelListener,b=s.touchStartListener,p=s.touchEndListener,m=s.turnPrevSlide,O=s.turnNextSlide,v=s.turnSlideToIndex,j=s.turnSlideToId,h=s.animationIndex,x=ux(r),k=x.slideWidth,C=x.slideHeight,N=yt(),E=N.exitScreening,w=vf(),V=w.slidesLoadLimit,I=dx(),B=I.fullscreenState,S=I.manualExitFullscreen,L=Object(y["ref"])(16),_=Object(y["computed"])((function(){return Qe(l.value.remark||"无备注")})),T=function(e){i.value&&i.value.scrollBy(e.deltaY,0)},M=function(e){e<12||e>40||(L.value=e)};Object(y["watch"])(o,(function(){Object(y["nextTick"])((function(){if(i.value){var e=i.value.querySelector(".thumbnail.active");if(e){var t=i.value.offsetWidth,n=e.offsetLeft;i.value.scrollTo({left:n-t/2,behavior:"smooth"})}}}))}));var D=function(){return[{text:"上一页",subText:"↑ ←",disable:o.value<=0,handler:function(){return m()}},{text:"下一页",subText:"↓ →",disable:o.value>=c.value.length-1,handler:function(){return O()}},{text:"第一页",disable:0===o.value,handler:function(){return v(0)}},{text:"最后一页",disable:o.value===c.value.length-1,handler:function(){return v(c.value.length-1)}},{divider:!0},{text:"画笔工具",handler:function(){return u.value=!0}},{text:"普通视图",handler:function(){return t.changeViewMode("base")}},{divider:!0},{text:"结束放映",subText:"ESC",handler:E}]};return function(t,n){var l=Object(y["resolveComponent"])("IconListView"),s=Object(y["resolveComponent"])("IconWrite"),m=Object(y["resolveComponent"])("IconMagic"),O=Object(y["resolveComponent"])("IconOffScreenOne"),g=Object(y["resolveComponent"])("Divider"),x=Object(y["resolveComponent"])("IconPower"),N=Object(y["resolveComponent"])("IconMinus"),w=Object(y["resolveComponent"])("IconPlus"),I=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",nk,[Object(y["createElementVNode"])("div",ck,[Object(y["createElementVNode"])("div",{class:"tool-btn",onClick:n[0]||(n[0]=function(t){return e.changeViewMode("base")})},[Object(y["createVNode"])(l,{class:"tool-icon"}),ok]),Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tool-btn",{active:u.value}]),onClick:n[1]||(n[1]=function(e){return u.value=!u.value})},[Object(y["createVNode"])(s,{class:"tool-icon"}),ak],2),Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tool-btn",{active:d.value}]),onClick:n[2]||(n[2]=function(e){return d.value=!d.value})},[Object(y["createVNode"])(m,{class:"tool-icon"}),lk],2),Object(y["createElementVNode"])("div",{class:"tool-btn",onClick:n[3]||(n[3]=function(){return Object(y["unref"])(B)?Object(y["unref"])(S)():Object(y["unref"])(vt)()})},[Object(y["unref"])(B)?(Object(y["openBlock"])(),Object(y["createBlock"])(O,{key:0,class:"tool-icon"})):(Object(y["openBlock"])(),Object(y["createBlock"])(O,{key:1,class:"tool-icon"})),Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(Object(y["unref"])(B)?"退出全屏":"全屏"),1)]),Object(y["createVNode"])(g,{class:"divider"}),Object(y["createElementVNode"])("div",{class:"tool-btn",onClick:n[4]||(n[4]=function(e){return Object(y["unref"])(E)()})},[Object(y["createVNode"])(x,{class:"tool-icon"}),rk])]),Object(y["createElementVNode"])("div",ik,[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["slide-list-wrap",{"laser-pen":d.value}]),ref_key:"slideListWrapRef",ref:r},[Object(y["withDirectives"])(Object(y["createVNode"])(Lx,{slideWidth:Object(y["unref"])(k),slideHeight:Object(y["unref"])(C),animationIndex:Object(y["unref"])(h),turnSlideToId:Object(y["unref"])(j),manualExitFullscreen:Object(y["unref"])(S),onWheel:n[5]||(n[5]=function(e){return Object(y["unref"])(f)(e)}),onTouchstart:n[6]||(n[6]=function(e){return Object(y["unref"])(b)(e)}),onTouchend:n[7]||(n[7]=function(e){return Object(y["unref"])(p)(e)})},null,8,["slideWidth","slideHeight","animationIndex","turnSlideToId","manualExitFullscreen"]),[[I,D]]),u.value?(Object(y["openBlock"])(),Object(y["createBlock"])(Wx,{key:0,slideWidth:Object(y["unref"])(k),slideHeight:Object(y["unref"])(C),position:{left:"75px",top:"5px"},onClose:n[8]||(n[8]=function(e){return u.value=!1})},null,8,["slideWidth","slideHeight"])):Object(y["createCommentVNode"])("",!0)],2),Object(y["createElementVNode"])("div",{class:"thumbnails",ref_key:"thumbnailsRef",ref:i,onWheel:n[9]||(n[9]=Object(y["withModifiers"])((function(e){return T(e)}),["prevent"]))},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(c),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["thumbnail",{active:t===Object(y["unref"])(o)}]),key:e.id,onClick:function(e){return Object(y["unref"])(v)(t)}},[Object(y["createVNode"])(ad,{slide:e,size:120/Object(y["unref"])(a),visible:t新添加文本

")},p=function(e){e&&e[0]&&et(e[0]).then((function(e){return s(e)}))},m=function(e){var t={viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z"},n={viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z"},o={square:t,round:n},a=200;f({left:(tt-a)/2,top:(tt*c.value-a)/2,width:a,height:a},o[e])},O=Object(y["computed"])((function(){var e;return(null===(e=o.value)||void 0===e?void 0:e.remark)||""})),v=function(e){var n=e.target.value;t.updateSlide({remark:n})};return function(e,t){var n=Object(y["resolveComponent"])("IconPlus"),c=Object(y["resolveComponent"])("Button"),o=Object(y["resolveComponent"])("IconCopy"),a=Object(y["resolveComponent"])("IconDelete"),u=Object(y["resolveComponent"])("ButtonGroup"),d=Object(y["resolveComponent"])("IconFontSize"),s=Object(y["resolveComponent"])("IconPicture"),f=Object(y["resolveComponent"])("FileInput"),j=Object(y["resolveComponent"])("IconSquare"),h=Object(y["resolveComponent"])("IconRound");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Tk,[Object(y["createElementVNode"])("div",Mk,[Object(y["createElementVNode"])("textarea",{value:Object(y["unref"])(O),placeholder:"点击输入演讲者备注",onInput:t[0]||(t[0]=function(e){return v(e)})},null,40,Dk)]),Object(y["createElementVNode"])("div",zk,[Object(y["createVNode"])(u,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[1]||(t[1]=function(e){return Object(y["unref"])(l)()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{class:"icon"}),Fk]})),_:1}),Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[2]||(t[2]=function(e){return Object(y["unref"])(r)()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{class:"icon"}),Ak]})),_:1}),Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[3]||(t[3]=function(e){return Object(y["unref"])(i)()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{class:"icon"}),Rk]})),_:1})]})),_:1}),Object(y["createVNode"])(u,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[4]||(t[4]=function(e){return b()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(d,{class:"icon"}),Pk]})),_:1}),Object(y["createVNode"])(c,{style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{onChange:t[5]||(t[5]=function(e){return p(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(s,{class:"icon"}),Hk]})),_:1})]})),_:1}),Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[6]||(t[6]=function(e){return m("square")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(j,{class:"icon"}),qk]})),_:1}),Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[7]||(t[7]=function(e){return m("round")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(h,{class:"icon"}),Uk]})),_:1})]})),_:1})]),Object(y["createVNode"])(_k)])}}});n("e62b");const Xk=pn()(Gk,[["__scopeId","data-v-5c24a24d"]]);var Yk=Xk,Zk=function(e){return Object(y["pushScopeId"])("data-v-446388c6"),e=e(),Object(y["popScopeId"])(),e},Wk={class:"element-toolbar"},Jk={class:"tabs"},Kk=["onClick"],Qk={class:"content"},$k={key:0,class:"style"},eC=Object(y["createTextVNode"])("+"),tC=Object(y["createTextVNode"])("-"),nC={class:"row-block"},cC=Zk((function(){return Object(y["createElementVNode"])("div",{class:"label"},"文字颜色:",-1)})),oC={class:"colors"},aC=["onClick"],lC={class:"row-block"},rC=Zk((function(){return Object(y["createElementVNode"])("div",{class:"label"},"填充色:",-1)})),iC={class:"colors"},uC=["onClick"],dC={key:1,class:"common"},sC=Object(y["createTextVNode"])(" 复制"),fC=Object(y["createTextVNode"])(" 删除"),bC=Object(y["createTextVNode"])(" 置顶"),pC=Object(y["createTextVNode"])(" 置底"),mC=Object(y["createTextVNode"])(" 上移"),OC=Object(y["createTextVNode"])(" 下移"),vC=Object(y["createTextVNode"])(" 左对齐"),jC=Object(y["createTextVNode"])(" 水平居中"),hC=Object(y["createTextVNode"])(" 右对齐"),yC=Object(y["createTextVNode"])(" 上对齐"),gC=Object(y["createTextVNode"])(" 垂直居中"),xC=Object(y["createTextVNode"])(" 下对齐"),kC=Object(y["defineComponent"])({__name:"ElementToolbar",setup:function(e){var t=["#000000","#ffffff","#eeece1","#1e497b","#4e81bb","#e2534d","#9aba60","#8165a0","#47acc5","#f9974c","#c21401","#ff1e02","#ffc12a","#ffff3a","#90cf5b","#00af57"],n=ie(),c=ae(),o=Object(g["c"])(n),a=o.handleElement,l=o.handleElementId,r=o.richTextAttrs,i=at(),u=i.addHistorySnapshot,d=function(e,t){c.updateElement({id:e,props:t}),u()},s=[{key:"style",label:"样式"},{key:"common",label:"布局"}],f=Object(y["ref"])("common"),b=Ot(),p=b.orderElement,m=hc(),O=m.alignElementToCanvas,v=rt(),j=v.addElementsFromData,h=st(),x=h.deleteElement,N=function(){var e=JSON.parse(JSON.stringify(a.value));j([e])},E=function(e,t){ta.emit(fo.RICH_TEXT_COMMAND,{action:{command:e,value:t}})},w=function(e){var t;if(a.value){if(("text"===a.value.type||"shape"===a.value.type&&null!==(t=a.value.text)&&void 0!==t&&t.content)&&ta.emit(fo.RICH_TEXT_COMMAND,{action:{command:"color",value:e}}),"table"===a.value.type){for(var n=JSON.parse(JSON.stringify(a.value.data)),c=0;c=l.value?(e-20)/tt:(t-20)/l.value/tt}));Object(y["onMounted"])((function(){i.value.length&&n.setActiveElementIdList([]),0!==o.value&&t.updateSlideIndex(0)}));var O=Object(y["computed"])((function(){return{width:tt*m.value+"px",height:tt*l.value*m.value+"px"}})),v=Object(y["ref"])([]),j=function(){v.value=a.value?JSON.parse(JSON.stringify(a.value.elements)):[]};Object(y["watchEffect"])(j);var h=mc(v,s,m),x=h.dragElement,k=bc(v,s,m),C=k.scaleElement,N=function(e,t){var c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];i.value.includes(t.id)||(n.setActiveElementIdList([t.id]),n.setHandleElementId(t.id)),c&&x(e,t)},E=function(){n.setActiveElementIdList([])};return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",TC,[Object(y["createVNode"])(_C,{changeMode:e.changeMode},null,8,["changeMode"]),Object(y["createElementVNode"])("div",{class:"content",ref_key:"contentRef",ref:d,onTouchstart:n[0]||(n[0]=function(e){return E()})},[Object(y["createElementVNode"])("div",{class:"viewport-wrapper",style:Object(y["normalizeStyle"])(Object(y["unref"])(O))},[Object(y["createElementVNode"])("div",{class:"background",style:Object(y["normalizeStyle"])(Object(y["unref"])(p))},null,4),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(s.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createBlock"])(Hr,{key:t,type:e.type,axis:e.axis,length:e.length,canvasScale:Object(y["unref"])(m)},null,8,["type","axis","length","canvasScale"])})),128)),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(v.value,(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:e.id},["line"!==e.type?(Object(y["openBlock"])(),Object(y["createBlock"])(wk,{key:0,elementInfo:e,isSelected:Object(y["unref"])(i).includes(e.id),canvasScale:Object(y["unref"])(m),scaleElement:Object(y["unref"])(C)},null,8,["elementInfo","isSelected","canvasScale","scaleElement"])):Object(y["createCommentVNode"])("",!0)],64)})),128)),Object(y["createElementVNode"])("div",{class:"viewport",style:Object(y["normalizeStyle"])({transform:"scale(".concat(Object(y["unref"])(m),")")})},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(v.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createBlock"])(Ck,{key:e.id,elementInfo:e,elementIndex:t+1,selectElement:N},null,8,["elementInfo","elementIndex"])})),128))],4)],4)],544),Object(y["createVNode"])(Yk),Object(y["unref"])(u)?(Object(y["openBlock"])(),Object(y["createBlock"])(NC,{key:0})):Object(y["createCommentVNode"])("",!0)])}}});n("2d86");const DC=pn()(MC,[["__scopeId","data-v-8cdcde82"]]);var zC=DC,FC={class:"header"},AC=Object(y["createTextVNode"])(" 退出播放"),RC=Object(y["defineComponent"])({__name:"MobilePlayer",props:{changeMode:{type:Function,required:!0}},setup:function(e){var t=ae(),n=Object(g["c"])(t),c=n.slides,o=n.slideIndex,a=n.currentSlide,l=n.viewportRatio,r=Object(y["ref"])(!1),i=Object(y["ref"])({width:0,height:0});Object(y["onMounted"])((function(){0!==o.value&&t.updateSlideIndex(0),i.value={width:document.body.clientHeight,height:document.body.clientWidth}}));var u=Object(y["computed"])((function(){var e=i.value.height/i.value.width,t=0,n=0;return e>=l.value?(t=i.value.width,n=t*l.value):(n=i.value.height,t=n/l.value),{width:t,height:n}})),d=Object(y["ref"])(null),s=function(e){d.value={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}},f=function(e){if(d.value){var n=Math.abs(d.value.y-e.changedTouches[0].pageY),a=e.changedTouches[0].pageX-d.value.x;Math.abs(a)>n&&Math.abs(a)>50&&(d.value=null,a<0&&o.value>0&&t.updateSlideIndex(o.value-1),a>0&&o.valueObject(y["unref"])(o),hide:(t===Object(y["unref"])(o)-1||t===Object(y["unref"])(o)+1)&&e.turningMode!==Object(y["unref"])(a).turningMode}]),key:e.id},[Math.abs(Object(y["unref"])(o)-t)<2?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"slide-content",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(u).width+"px",height:Object(y["unref"])(u).height+"px"})},[Object(y["createVNode"])(ad,{slide:e,size:Object(y["unref"])(u).width},null,8,["slide","size"])],4)):Object(y["createCommentVNode"])("",!0)],2)})),128))],32),r.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createElementVNode"])("div",FC,[Object(y["createElementVNode"])("div",{class:"back",onClick:n[3]||(n[3]=function(t){return e.changeMode("preview")})},[Object(y["createVNode"])(l),AC])]),Object(y["createVNode"])(_k,{class:"thumbnails"})],64)):Object(y["createCommentVNode"])("",!0)],4)}}});n("4f8b");const PC=pn()(RC,[["__scopeId","data-v-5293de3b"]]);var HC=PC,qC={class:"thumbnail-list"},UC={class:"menu"},GC=Object(y["createTextVNode"])(" 编辑"),XC=Object(y["createTextVNode"])(" 播放"),YC=Object(y["defineComponent"])({__name:"MobilePreview",props:{changeMode:{type:Function,required:!0}},setup:function(e){var t=Object(g["c"])(ae()),n=t.slides,c=vf(),o=c.slidesLoadLimit,a=Object(y["ref"])(),l=Object(y["ref"])(0);return Object(y["onMounted"])((function(){a.value&&(l.value=a.value.clientWidth)})),function(t,c){var r=Object(y["resolveComponent"])("IconEdit"),i=Object(y["resolveComponent"])("Divider"),u=Object(y["resolveComponent"])("IconFullScreenPlay");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"mobile-preview",ref_key:"mobileRef",ref:a},[Object(y["createElementVNode"])("div",qC,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(n),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"thumbnail-item",key:e.id},[Object(y["createVNode"])(ad,{slide:e,size:l.value-10,visible:tc?1:Math.round(100*r/c)/100,o.value.a!==t&&n("colorChange",{r:o.value.r,g:o.value.g,b:o.value.b,a:t})}},i=function e(){window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",e)},u=function(e){r(e),window.addEventListener("mousemove",r),window.addEventListener("mouseup",i)};return Object(y["onUnmounted"])(i),function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",hw,[Object(y["createElementVNode"])("div",yw,[Object(y["createVNode"])(vw)]),Object(y["createElementVNode"])("div",{class:"alpha-gradient",style:Object(y["normalizeStyle"])({background:Object(y["unref"])(a)})},null,4),Object(y["createElementVNode"])("div",{class:"alpha-container",ref_key:"alphaRef",ref:l,onMousedown:t[0]||(t[0]=function(e){return u(e)})},[Object(y["createElementVNode"])("div",{class:"alpha-pointer",style:Object(y["normalizeStyle"])({left:100*Object(y["unref"])(o).a+"%"})},xw,4)],544)])}}});n("e83e");const Cw=pn()(kw,[["__scopeId","data-v-246b525c"]]);var Nw=Cw,Ew=function(e){return Object(y["pushScopeId"])("data-v-60c3cca1"),e=e(),Object(y["popScopeId"])(),e},ww={class:"hue"},Vw=Ew((function(){return Object(y["createElementVNode"])("div",{class:"hue-picker"},null,-1)})),Iw=[Vw],Bw=Object(y["defineComponent"])({__name:"Hue",props:{value:{type:Object,required:!0},hue:{type:Number,required:!0}},emits:["colorChange"],setup:function(e,t){var n=t.emit,c=e,o=Object(y["ref"])(0),a=Object(y["ref"])(""),l=Object(y["computed"])((function(){var e=ee()(c.value).toHsl();return-1!==c.hue&&(e.h=c.hue),e})),r=Object(y["computed"])((function(){return 0===l.value.h&&"right"===a.value?"100%":100*l.value.h/360+"%"}));Object(y["watch"])((function(){return c.value}),(function(){var e=ee()(c.value).toHsl(),t=0===e.s?c.hue:e.h;0!==t&&t-o.value>0&&(a.value="right"),0!==t&&t-o.value<0&&(a.value="left"),o.value=t}));var i=Object(y["ref"])(),u=function(e){if(e.preventDefault(),i.value){var t,o,a=i.value.clientWidth,r=i.value.getBoundingClientRect().left+window.pageXOffset,u=e.pageX-r;u<0?t=0:u>a?t=360:(o=100*u/a,t=360*o/100),-1!==c.hue&&l.value.h===t||n("colorChange",{h:t,l:l.value.l,s:l.value.s,a:l.value.a})}},d=function e(){window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",e)},s=function(e){u(e),window.addEventListener("mousemove",u),window.addEventListener("mouseup",d)};return Object(y["onUnmounted"])(d),function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ww,[Object(y["createElementVNode"])("div",{class:"hue-container",ref_key:"hueRef",ref:i,onMousedown:t[0]||(t[0]=function(e){return s(e)})},[Object(y["createElementVNode"])("div",{class:"hue-pointer",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(r)})},Iw,4)],544)])}}});n("179a");const Sw=pn()(Bw,[["__scopeId","data-v-60c3cca1"]]);var Lw=Sw,_w=function(e){return Object(y["pushScopeId"])("data-v-d230faf4"),e=e(),Object(y["popScopeId"])(),e},Tw=_w((function(){return Object(y["createElementVNode"])("div",{class:"saturation-white"},null,-1)})),Mw=_w((function(){return Object(y["createElementVNode"])("div",{class:"saturation-black"},null,-1)})),Dw=_w((function(){return Object(y["createElementVNode"])("div",{class:"saturation-circle"},null,-1)})),zw=[Dw],Fw=Object(y["defineComponent"])({__name:"Saturation",props:{value:{type:Object,required:!0},hue:{type:Number,required:!0}},emits:["colorChange"],setup:function(e,t){var n=t.emit,c=e,o=Object(y["computed"])((function(){var e=ee()(c.value).toHsv();return-1!==c.hue&&(e.h=c.hue),e})),a=Object(y["computed"])((function(){return"hsl(".concat(o.value.h,", 100%, 50%)")})),l=Object(y["computed"])((function(){return-100*o.value.v+1+100+"%"})),r=Object(y["computed"])((function(){return 100*o.value.s+"%"})),i=Object(te["throttle"])((function(e){n("colorChange",e)}),20,{leading:!0,trailing:!1}),u=Object(y["ref"])(),d=function(e){if(e.preventDefault(),u.value){var t=u.value.clientWidth,n=u.value.clientHeight,c=u.value.getBoundingClientRect().left+window.pageXOffset,a=u.value.getBoundingClientRect().top+window.pageYOffset,l=Object(te["clamp"])(e.pageX-c,0,t),r=Object(te["clamp"])(e.pageY-a,0,n),d=l/t,s=Object(te["clamp"])(-r/n+1,0,1);i({h:o.value.h,s:d,v:s,a:o.value.a})}},s=function e(){window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",e)},f=function(e){d(e),window.addEventListener("mousemove",d),window.addEventListener("mouseup",s)};return Object(y["onUnmounted"])(s),function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"saturation",ref_key:"saturationRef",ref:u,style:Object(y["normalizeStyle"])({background:Object(y["unref"])(a)}),onMousedown:t[0]||(t[0]=function(e){return f(e)})},[Tw,Mw,Object(y["createElementVNode"])("div",{class:"saturation-pointer",style:Object(y["normalizeStyle"])({top:Object(y["unref"])(l),left:Object(y["unref"])(r)})},zw,4)],36)}}});n("0516");const Aw=pn()(Fw,[["__scopeId","data-v-d230faf4"]]);var Rw=Aw,Pw={class:"editable-input"},Hw=["value"],qw=Object(y["defineComponent"])({__name:"EditableInput",props:{value:{type:Object,required:!0}},emits:["colorChange"],setup:function(e,t){var n=t.emit,c=e,o=Object(y["computed"])((function(){var e="";return e=c.value.a<1?ee()(c.value).toHex8String().toUpperCase():ee()(c.value).toHexString().toUpperCase(),e.replace("#","")})),a=function(e){var t=e.target.value;t.length>=6&&n("colorChange",ee()(t).toRgb())};return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Pw,[Object(y["createElementVNode"])("input",{class:"input-content",value:Object(y["unref"])(o),onInput:t[0]||(t[0]=function(e){return a(e)})},null,40,Hw)])}}});n("a9b0");const Uw=pn()(qw,[["__scopeId","data-v-2f428dde"]]);var Gw=Uw,Xw={class:"color-picker"},Yw={class:"picker-saturation-wrap"},Zw={class:"picker-controls"},Ww={class:"picker-color-wrap"},Jw={class:"picker-sliders"},Kw={class:"picker-hue-wrap"},Qw={class:"picker-alpha-wrap"},$w={class:"picker-field"},eV={class:"picker-presets"},tV=["onClick"],nV={class:"picker-gradient-presets"},cV=["onClick"],oV={class:"picker-presets"},aV=["onClick"],lV={key:0,class:"recent-colors-title"},rV={class:"picker-presets"},iV=["onClick"],uV=Object(y["defineComponent"])({__name:"index",props:{modelValue:{type:String,default:"#e86b99"}},emits:["update:modelValue"],setup:function(e,t){var n=t.emit,c=e,o="RECENT_COLORS",a=[["#7f7f7f","#f2f2f2"],["#0d0d0d","#808080"],["#1c1a10","#ddd8c3"],["#0e243d","#c6d9f0"],["#233f5e","#dae5f0"],["#632623","#f2dbdb"],["#4d602c","#eaf1de"],["#3f3150","#e6e0ec"],["#1e5867","#d9eef3"],["#99490f","#fee9da"]],l=function(e,t,n){for(var c=ee()(e).toRgb(),o=ee()(t).toRgb(),a=(o.r-c.r)/n,l=(o.g-c.g)/n,r=(o.b-c.b)/n,i=[],u=0;ut&&(s.value=s.value.slice(0,t))}}),300,{trailing:!0});Object(y["onMounted"])((function(){var e=localStorage.getItem(o);e&&(s.value=JSON.parse(e))})),Object(y["watch"])(s,(function(){var e=JSON.stringify(s.value);localStorage.setItem(o,e)}));var v=function(e){"h"in e?(d.value=e.h,f.value=ee()(e).toRgb()):(d.value=ee()(e).toHsl().h,f.value=e),O()},j=function(){var e="EyeDropper"in window;e?h():g()},h=function(){Se["a"].success("按 ESC 键关闭取色吸管");var e=new window.EyeDropper;e.open().then((function(e){var t=ee()(e.sRGBHex);d.value=t.toHsl().h,f.value=t.toRgb(),O()})).catch((function(){Se["a"].success("关闭取色吸管")}))},g=function(){var e=document.querySelector(".canvas");if(e){var t=document.createElement("div");t.style.cssText="position: fixed; top: 0; left: 0; bottom: 0; right: 0; z-index: 9999; cursor: wait;",document.body.appendChild(t);var n=document.createElement("div");n.style.cssText="position: absolute; top: -100px; left: -100px; width: 16px; height: 16px; border: 1px solid #000; z-index: 999",t.appendChild(n);var c=e.getBoundingClientRect(),o=c.left,a=c.top,l=c.width,r=c.height,i=function(e){return(!e.tagName||"FOREIGNOBJECT"!==e.tagName.toUpperCase())&&(!e.classList||!e.classList.contains("operate"))};Object(Et["a"])(e,{filter:i,fontEmbedCSS:"",width:l,height:r,canvasWidth:l,canvasHeight:r,pixelRatio:1}).then((function(e){e.style.cssText="position: absolute; top: ".concat(a,"px; left: ").concat(o,"px; cursor: crosshair;"),t.style.cursor="default",t.appendChild(e);var c=e.getContext("2d");if(c){var l="",r=function(e){var t=e.x,r=e.y,i=t-o,u=r-a,d=Object(me["a"])(c.getImageData(i,u,1,1).data,4),s=d[0],f=d[1],b=d[2],p=d[3];l="rgba(".concat(s,", ").concat(f,", ").concat(b,", ").concat((p/255).toFixed(2),")"),n.style.left=t+10+"px",n.style.top=r+10+"px",n.style.backgroundColor=l},i=function(){l="",n.style.left="-100px",n.style.top="-100px",n.style.backgroundColor=""},u=function n(c){if(l&&0===c.button){var o=ee()(l);d.value=o.toHsl().h,f.value=o.toRgb(),O()}document.body.removeChild(t),e.removeEventListener("mousemove",r),e.removeEventListener("mouseleave",i),window.removeEventListener("mousedown",n)};e.addEventListener("mousemove",r),e.addEventListener("mouseleave",i),window.addEventListener("mousedown",u)}})).catch((function(){Se["a"].error("取色吸管初始化失败"),document.body.removeChild(t)}))}};return function(e,t){var n=Object(y["resolveComponent"])("IconNeedle");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Xw,[Object(y["createElementVNode"])("div",Yw,[Object(y["createVNode"])(Rw,{value:Object(y["unref"])(f),hue:d.value,onColorChange:t[0]||(t[0]=function(e){return v(e)})},null,8,["value","hue"])]),Object(y["createElementVNode"])("div",Zw,[Object(y["createElementVNode"])("div",Ww,[Object(y["createElementVNode"])("div",{class:"picker-current-color",style:Object(y["normalizeStyle"])({background:Object(y["unref"])(p)})},null,4),Object(y["createVNode"])(vw)]),Object(y["createElementVNode"])("div",Jw,[Object(y["createElementVNode"])("div",Kw,[Object(y["createVNode"])(Lw,{value:Object(y["unref"])(f),hue:d.value,onColorChange:t[1]||(t[1]=function(e){return v(e)})},null,8,["value","hue"])]),Object(y["createElementVNode"])("div",Qw,[Object(y["createVNode"])(Nw,{value:Object(y["unref"])(f),onColorChange:t[2]||(t[2]=function(e){return v(e)})},null,8,["value"])])])]),Object(y["createElementVNode"])("div",$w,[Object(y["createVNode"])(Gw,{class:"input",value:Object(y["unref"])(f),onColorChange:t[3]||(t[3]=function(e){return v(e)})},null,8,["value"]),Object(y["createElementVNode"])("div",{class:"straw",onClick:t[4]||(t[4]=function(e){return j()})},[Object(y["createVNode"])(n)])]),Object(y["createElementVNode"])("div",eV,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(i,(function(e){return Object(y["createElementVNode"])("div",{class:"picker-presets-color",key:e,style:Object(y["normalizeStyle"])({background:e}),onClick:function(t){return m(e)}},null,12,tV)})),64))]),Object(y["createElementVNode"])("div",nV,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(b),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"picker-gradient-col",key:t},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e,(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"picker-gradient-color",key:e,style:Object(y["normalizeStyle"])({background:e}),onClick:function(t){return m(e)}},null,12,cV)})),128))])})),128))]),Object(y["createElementVNode"])("div",oV,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(u,(function(e){return Object(y["createElementVNode"])("div",{key:e,class:"picker-presets-color",style:Object(y["normalizeStyle"])({background:e}),onClick:function(t){return m(e)}},null,12,aV)})),64))]),s.value.length?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",lV,"最近使用:")):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",rV,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(s.value,(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:e,class:"picker-presets-color alpha",onClick:function(t){return m(e)}},[Object(y["createElementVNode"])("div",{class:"picker-presets-color-content",style:Object(y["normalizeStyle"])({background:e})},null,4)],8,iV)})),128))])])}}});n("ecf8");const dV=pn()(uV,[["__scopeId","data-v-c46eb110"]]);var sV=dV,fV={key:0,class:"fullscreen-spin"},bV=Object(y["defineComponent"])({__name:"FullscreenSpin",props:{loading:{type:Boolean,default:!1},tip:{type:String,default:""}},setup:function(e){return function(t,n){var c=Object(y["resolveComponent"])("Spin");return e.loading?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",fV,[Object(y["createVNode"])(c,{tip:e.tip,size:"large"},null,8,["tip"])])):Object(y["createCommentVNode"])("",!0)}}});n("5d4b");const pV=pn()(bV,[["__scopeId","data-v-16ead44e"]]);var mV=pV,OV={FileInput:lw,CheckboxButton:uw,CheckboxButtonGroup:pw,ColorPicker:sV,FullscreenSpin:mV},vV={install:function(e){for(var t=0,n=Object.keys(OV);t {\n const { empty } = view.state.selection\n if (empty) selectAll(view.state, view.dispatch)\n}\n\nexport const addMark = (editorView: EditorView, mark: Mark, selection?: { from: number; to: number; }) => {\n if (selection) {\n editorView.dispatch(editorView.state.tr.addMark(selection.from, selection.to, mark))\n }\n else {\n const { $from, $to } = editorView.state.selection\n editorView.dispatch(editorView.state.tr.addMark($from.pos, $to.pos, mark))\n }\n}\n\nexport const findNodesWithSameMark = (doc: Node, from: number, to: number, markType: MarkType) => {\n let ii = from\n const finder = (mark: Mark) => mark.type === markType\n let firstMark = null\n let fromNode = null\n let toNode = null\n\n while (ii <= to) {\n const node = doc.nodeAt(ii)\n if (!node || !node.marks) return null\n\n const mark = node.marks.find(finder)\n if (!mark) return null\n\n if (firstMark && mark !== firstMark) return null\n\n fromNode = fromNode || node\n firstMark = firstMark || mark\n toNode = node\n ii++\n }\n\n let fromPos = from\n let toPos = to\n\n let jj = 0\n ii = from - 1\n while (ii > jj) {\n const node = doc.nodeAt(ii)\n const mark = node && node.marks.find(finder)\n if (!mark || mark !== firstMark) break\n fromPos = ii\n fromNode = node\n ii--\n }\n\n ii = to + 1\n jj = doc.nodeSize - 2\n while (ii < jj) {\n const node = doc.nodeAt(ii)\n const mark = node && node.marks.find(finder)\n if (!mark || mark !== firstMark) break\n toPos = ii\n toNode = node\n ii++\n }\n\n return {\n mark: firstMark,\n from: {\n node: fromNode,\n pos: fromPos,\n },\n to: {\n node: toNode,\n pos: toPos,\n },\n }\n}\n\nconst equalNodeType = (nodeType: NodeType, node: Node) => {\n return Array.isArray(nodeType) && nodeType.indexOf(node.type) > -1 || node.type === nodeType\n}\n\nconst findParentNodeClosestToPos = ($pos: ResolvedPos, predicate: (node: Node) => boolean) => {\n for (let i = $pos.depth; i > 0; i--) {\n const node = $pos.node(i)\n if (predicate(node)) {\n return {\n pos: i > 0 ? $pos.before(i) : 0,\n start: $pos.start(i),\n depth: i,\n node,\n }\n }\n }\n}\n\nexport const findParentNode = (predicate: (node: Node) => boolean) => {\n return (_ref: Selection) => findParentNodeClosestToPos(_ref.$from, predicate)\n}\n\nexport const findParentNodeOfType = (nodeType: NodeType) => {\n return (selection: Selection) => {\n return findParentNode((node: Node) => {\n return equalNodeType(nodeType, node)\n })(selection)\n }\n}\n\nexport const isActiveOfParentNodeType = (nodeType: string, state: EditorState) => {\n const node = state.schema.nodes[nodeType]\n return !!findParentNodeOfType(node)(state.selection)\n}\n\nexport const getMarkAttrs = (view: EditorView) => {\n const { selection, doc } = view.state\n const { from } = selection\n\n let node = doc.nodeAt(from) || doc.nodeAt(from - 1)\n if (node?.lastChild) node = node.lastChild\n\n return node?.marks || []\n}\n\nexport const getAttrValue = (marks: Mark[], markType: string, attr: string) => {\n for (const mark of marks) {\n if (mark.type.name === markType && mark.attrs[attr]) return mark.attrs[attr]\n }\n return null\n}\n\nexport const isActiveMark = (marks: Mark[], markType: string) => {\n for (const mark of marks) {\n if (mark.type.name === markType) return true\n }\n return false\n}\n\nexport const markActive = (state: EditorState, type: MarkType) => {\n const { from, $from, to, empty } = state.selection\n if (empty) return type.isInSet(state.storedMarks || $from.marks())\n return state.doc.rangeHasMark(from, to, type)\n}\n\nexport const getAttrValueInSelection = (view: EditorView, attr: string) => {\n const { selection, doc } = view.state\n const { from, to } = selection\n\n let keepChecking = true\n let value = ''\n doc.nodesBetween(from, to, node => {\n if (keepChecking && node.attrs[attr]) {\n keepChecking = false\n value = node.attrs[attr]\n }\n return keepChecking\n })\n return value\n}\n\ninterface DefaultAttrs {\n color?: string\n backcolor?: string\n fontsize?: string\n fontname?: string\n align?: string\n}\nconst _defaultAttrs: DefaultAttrs = {\n color: '#000',\n backcolor: '#000',\n fontsize: '20px',\n fontname: '微软雅黑',\n align: 'left',\n}\nexport const getTextAttrs = (view: EditorView, defaultAttrs: DefaultAttrs = {}) => {\n defaultAttrs = { ..._defaultAttrs, ...defaultAttrs }\n\n const marks = getMarkAttrs(view)\n\n const isBold = isActiveMark(marks, 'strong')\n const isEm = isActiveMark(marks, 'em')\n const isUnderline = isActiveMark(marks, 'underline')\n const isStrikethrough = isActiveMark(marks, 'strikethrough')\n const isSuperscript = isActiveMark(marks, 'superscript')\n const isSubscript = isActiveMark(marks, 'subscript')\n const isCode = isActiveMark(marks, 'code')\n const color = getAttrValue(marks, 'forecolor', 'color') || defaultAttrs.color\n const backcolor = getAttrValue(marks, 'backcolor', 'backcolor') || defaultAttrs.backcolor\n const fontsize = getAttrValue(marks, 'fontsize', 'fontsize') || defaultAttrs.fontsize\n const fontname = getAttrValue(marks, 'fontname', 'fontname') || defaultAttrs.fontname\n const link = getAttrValue(marks, 'link', 'href') || ''\n const align = getAttrValueInSelection(view, 'align') || defaultAttrs.align\n const isBulletList = isActiveOfParentNodeType('bullet_list', view.state)\n const isOrderedList = isActiveOfParentNodeType('ordered_list', view.state)\n const isBlockquote = isActiveOfParentNodeType('blockquote', view.state)\n\n return {\n bold: isBold,\n em: isEm,\n underline: isUnderline,\n strikethrough: isStrikethrough,\n superscript: isSuperscript,\n subscript: isSubscript,\n code: isCode,\n color: color,\n backcolor: backcolor,\n fontsize: fontsize,\n fontname: fontname,\n link: link,\n align: align,\n bulletList: isBulletList,\n orderedList: isOrderedList,\n blockquote: isBlockquote,\n }\n}\n\nexport type TextAttrs = ReturnType\n\nexport const getFontsize = (view: EditorView) => {\n const marks = getMarkAttrs(view)\n const fontsize = getAttrValue(marks, 'fontsize', 'fontsize') || _defaultAttrs.fontsize\n return parseInt(fontsize)\n}\n\nexport const defaultRichTextAttrs: TextAttrs = {\n bold: false,\n em: false,\n underline: false,\n strikethrough: false,\n superscript: false,\n subscript: false,\n code: false,\n color: '#000',\n backcolor: '#000',\n fontsize: '20px',\n fontname: '微软雅黑',\n link: '',\n align: 'left',\n bulletList: false,\n orderedList: false,\n blockquote: false,\n}","/**\n * 判断操作系统是否存在某字体\n * @param fontName 字体名\n */\nexport const isSupportFont = (fontName: string) => {\n if (typeof fontName !== 'string') return false\n\n const arial = 'Arial'\n if (fontName.toLowerCase() === arial.toLowerCase()) return true\n\n const size = 100\n const width = 100\n const height = 100\n const str = 'a'\n\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n\n if (!ctx) return false\n\n canvas.width = width\n canvas.height = height\n ctx.textAlign = 'center'\n ctx.fillStyle = 'black'\n ctx.textBaseline = 'middle'\n\n const getDotArray = (_fontFamily: string) => {\n ctx.clearRect(0, 0, width, height)\n ctx.font = `${size}px ${_fontFamily}, ${arial}`\n ctx.fillText(str, width / 2, height / 2)\n const imageData = ctx.getImageData(0, 0, width, height).data\n return [].slice.call(imageData).filter(item => item !== 0)\n }\n\n return getDotArray(arial).join('') !== getDotArray(fontName).join('')\n}","import { Slide } from '@/types/slides'\n\nexport const slides: Slide[] = [\n {\n id: 'test-slide-1',\n elements: [\n {\n type: 'shape',\n id: '4cbRxp',\n left: 0,\n top: 200,\n width: 546,\n height: 362.5,\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 Z',\n fill: '#5b9bd5',\n fixedRatio: false,\n opacity: 0.7,\n rotate: 0\n },\n {\n type: 'shape',\n id: 'ookHrf',\n left: 0,\n top: 0,\n width: 300,\n height: 320,\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 Z',\n fill: '#5b9bd5',\n fixedRatio: false,\n flipV: true,\n rotate: 0\n },\n {\n type: 'text',\n id: 'idn7Mx',\n left: 355,\n top: 65.25,\n width: 585,\n height: 188,\n lineHeight: 1.2,\n content: '

PPTIST

',\n rotate: 0,\n defaultFontName: 'Microsoft Yahei',\n defaultColor: '#333'\n },\n {\n type: 'text',\n id: '7stmVP',\n left: 355,\n top: 253.25,\n width: 585,\n height: 56,\n content: '

基于 Vue 3.x + TypeScript 的在线演示文稿应用

',\n rotate: 0,\n defaultFontName: 'Microsoft Yahei',\n defaultColor: '#333'\n },\n {\n type: 'line',\n id: 'FnpZs4',\n left: 361,\n top: 238,\n start: [0, 0],\n end: [549, 0],\n points: ['', ''],\n color: '#5b9bd5',\n style: 'solid',\n width: 2,\n },\n ],\n background: {\n type: 'solid',\n color: '#ffffff',\n },\n },\n {\n id: 'test-slide-2',\n elements: [\n {\n type: 'text',\n id: 'ptNnUJ',\n left: 145,\n top: 148,\n width: 711,\n height: 77,\n lineHeight: 1.2,\n content: '

在此处添加标题

',\n rotate: 0,\n defaultFontName: 'Microsoft Yahei',\n defaultColor: '#333',\n }, \n {\n type: 'text',\n id: 'mRHvQN',\n left: 207.50000000000003,\n top: 249.84259259259264,\n width: 585,\n height: 56,\n content: '

在此处添加副标题

',\n rotate: 0,\n defaultFontName: 'Microsoft Yahei',\n defaultColor: '#333',\n }, \n {\n type: 'line',\n id: '7CQDwc',\n left: 323.09259259259267,\n top: 238.33333333333334,\n start: [0, 0],\n end: [354.8148148148148, 0],\n points: ['', ''],\n color: '#5b9bd5',\n style: 'solid',\n width: 4\n }, \n {\n type: 'shape',\n id: '09wqWw',\n left: -27.648148148148138,\n top: 432.73148148148147,\n width: 1056.2962962962963,\n height: 162.96296296296296,\n viewBox: [200, 200],\n path: 'M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z',\n fill: '#5b9bd5',\n fixedRatio: false,\n rotate: 0\n }\n ],\n background: {\n type: 'solid',\n color: '#fff',\n },\n },\n {\n id: 'test-slide-3',\n elements: [\n {\n type: 'shape',\n id: 'vSheCJ',\n left: 183.5185185185185,\n top: 175.5092592592593,\n width: 605.1851851851851,\n height: 185.18518518518516,\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n fill: '#5b9bd5',\n fixedRatio: false,\n rotate: 0\n }, \n {\n type: 'shape',\n id: 'Mpwv7x',\n left: 211.29629629629628,\n top: 201.80555555555557,\n width: 605.1851851851851,\n height: 185.18518518518516,\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n fill: '#5b9bd5',\n fixedRatio: false,\n rotate: 0,\n opacity: 0.7\n }, \n {\n type: 'text',\n id: 'WQOTAp',\n left: 304.9074074074074,\n top: 198.10185185185182,\n width: 417.9629629629629,\n height: 140,\n content: '

感谢观看

',\n rotate: 0,\n defaultFontName: 'Microsoft Yahei',\n defaultColor: '#333',\n wordSpace: 5\n }\n ],\n background: {\n type: 'solid',\n color: '#fff',\n },\n },\n]","import { SlideTheme } from '@/types/slides'\n\nexport const theme: SlideTheme = {\n themeColor: '#5b9bd5',\n fontColor: '#333',\n fontName: 'Microsoft Yahei',\n backgroundColor: '#fff',\n}","/* eslint-disable max-lines */\n\nimport { Slide } from '@/types/slides'\n\nexport const layouts: Slide[] = [\n {\n id: 'template',\n elements: [\n {\n type: 'shape',\n id: '4cbRxp',\n left: 0,\n top: 200,\n width: 546,\n height: 362.5,\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n opacity: 0.7,\n rotate: 0\n },\n {\n type: 'shape',\n id: 'ookHrf',\n left: 0,\n top: 0,\n width: 300,\n height: 320,\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n flipV: true,\n rotate: 0\n },\n {\n type: 'text',\n id: 'AkIh3E',\n left: 355,\n top: 95.11111111111111,\n width: 585,\n height: 116,\n lineHeight: 1.2,\n content: '

输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n wordSpace: 6\n },\n {\n type: 'text',\n id: '7stmVP',\n left: 355,\n top: 253.25,\n width: 585,\n height: 56,\n content: '

请在此处输入副标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n },\n {\n type: 'line',\n id: 'FnpZs4',\n left: 361,\n top: 238,\n start: [0, 0],\n end: [549, 0],\n points: ['', ''],\n color: '{{themeColor}}',\n style: 'solid',\n width: 2,\n },\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'text',\n id: 'ptNnUJ',\n left: 145,\n top: 148,\n width: 711,\n height: 77,\n lineHeight: 1.2,\n content: '

在此处添加标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'text',\n id: 'mRHvQN',\n left: 207.50000000000003,\n top: 249.84259259259264,\n width: 585,\n height: 56,\n content: '

在此处添加副标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'line',\n id: '7CQDwc',\n left: 323.09259259259267,\n top: 238.33333333333334,\n start: [0, 0],\n end: [354.8148148148148, 0],\n points: ['', ''],\n color: '{{themeColor}}',\n style: 'solid',\n width: 4\n }, \n {\n type: 'shape',\n id: '09wqWw',\n left: -27.648148148148138,\n top: 432.73148148148147,\n width: 1056.2962962962963,\n height: 162.96296296296296,\n viewBox: [200, 200],\n path: 'M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'shape',\n id: 'vSheCJ',\n left: 183.5185185185185,\n top: 175.5092592592593,\n width: 605.1851851851851,\n height: 185.18518518518516,\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0\n }, \n {\n type: 'shape',\n id: 'Mpwv7x',\n left: 211.29629629629628,\n top: 201.80555555555557,\n width: 605.1851851851851,\n height: 185.18518518518516,\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n opacity: 0.7\n }, \n {\n type: 'text',\n id: 'WQOTAp',\n left: 304.9074074074074,\n top: 198.10185185185182,\n width: 417.9629629629629,\n height: 140,\n content: '

感谢观看

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n wordSpace: 5\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'MZVO1kkj',\n elements: [\n {\n type: 'shape',\n id: 'cql0h8',\n left: 0,\n top: 0,\n width: 352.59259259259255,\n height: 562.5,\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0\n },\n {\n type: 'shape',\n id: '_RTaF4',\n left: 171.4814814814814,\n top: 100.13888888888887,\n width: 362.22222222222223,\n height: 362.22222222222223,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: 'rgba(255,255,255,0)',\n fixedRatio: false,\n rotate: 0,\n outline: {\n width: 10,\n color: '{{backgroundColor}}',\n style: 'solid'\n }\n },\n {\n type: 'shape',\n id: 'UZfo8N',\n left: 216.66666666666663,\n top: 145.32407407407408,\n width: 271.85185185185185,\n height: 271.85185185185185,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{backgroundColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

01

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n },\n {\n type: 'text',\n id: 'ysqtBg',\n left: 561.4814814814814,\n top: 100.1388888888889,\n width: 359.25925925925924,\n height: 80,\n content: '

在此处输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n },\n {\n type: 'text',\n id: 'lXsoHa',\n left: 572.5925925925925,\n top: 202.3611111111111,\n width: 257.77777777777777,\n height: 260,\n content: '
  1. 在此处输入内容

  2. 在此处输入内容

  3. 在此处输入内容

  4. 在此处输入内容

  5. 在此处输入内容

  6. 在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n lineHeight: 2,\n fill: '{{subColor}}'\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'shape',\n id: 'EBBnTr',\n left: 360.5996472663139,\n top: 141.8496472663139,\n width: 278.80070546737215,\n height: 278.80070546737215,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: true,\n rotate: 0,\n outline: {\n width: 0,\n color: '{{backgroundColor}}',\n style: 'solid'\n }\n }, \n {\n type: 'shape',\n id: 'gDIWDH',\n left: 456.4373897707231,\n top: 98.287037037037,\n width: 87.12522045855381,\n height: 87.12522045855381,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: true,\n rotate: 0,\n outline: {\n width: 4,\n color: '{{backgroundColor}}',\n style: 'solid'\n },\n text: {\n content: '

1

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'shape',\n id: 'DUWT7E',\n left: 317.037037037037,\n top: 237.68738977072314,\n width: 87.12522045855381,\n height: 87.12522045855381,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: true,\n rotate: 0,\n outline: {\n width: 4,\n color: '{{backgroundColor}}',\n style: 'solid'\n },\n text: {\n content: '

4

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'shape',\n id: 'pbhn38',\n left: 456.43738977072303,\n top: 377.08774250440916,\n width: 87.12522045855381,\n height: 87.12522045855381,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: true,\n rotate: 0,\n outline: {\n width: 4,\n color: '{{backgroundColor}}',\n style: 'solid'\n },\n text: {\n content: '

3

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'shape',\n id: 'CvMKrO',\n left: 595.8377425044091,\n top: 237.6873897707231,\n width: 87.12522045855381,\n height: 87.12522045855381,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: true,\n rotate: 0,\n outline: {\n width: 4,\n color: '{{backgroundColor}}',\n style: 'solid'\n },\n text: {\n content: '

2

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: 'adudHB',\n left: 402.962962962963,\n top: 39.39814814814815,\n width: 194.07407407407408,\n height: 50,\n content: '

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'text',\n id: '9UpDwg',\n left: 402.962962962963,\n top: 473.1018518518518,\n width: 194.07407407407408,\n height: 50,\n content: '

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'text',\n id: 'GERdpB',\n left: 111.48148148148151,\n top: 256.25,\n width: 194.07407407407408,\n height: 50,\n content: '

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'text',\n id: 'G5qoho',\n left: 691.1111111111111,\n top: 256.25,\n width: 194.07407407407408,\n height: 50,\n content: '

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'shape',\n id: 'vdZcI6',\n left: 415.18518518518516,\n top: 196.4351851851852,\n width: 169.62962962962962,\n height: 169.62962962962962,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{backgroundColor}}',\n fixedRatio: false,\n rotate: 0\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'shape',\n id: 'tYUmrx',\n left: 156.66666666666683,\n top: 149.02777777777771,\n width: 264.4444444444445,\n height: 264.4444444444445,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

01

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n },\n {\n type: 'shape',\n id: '0GVHf8',\n left: 342.2222222222223,\n top: 217.17592592592587,\n width: 128.14814814814812,\n height: 128.14814814814812,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{backgroundColor}}',\n fixedRatio: false,\n rotate: 0\n },\n {\n type: 'text',\n id: 'BO33Sv',\n left: 378.8888888888889,\n top: 235.24999999999994,\n width: 464.4444444444444,\n height: 92,\n content: '

在此处添加标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'text',\n id: 'Hj7ttp',\n left: 69.35185185185185,\n top: 49.21759259259262,\n width: 420,\n height: 63,\n lineHeight: 1.2,\n content: '

1.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'FmKMNB',\n left: 69.35185185185185,\n top: 129.28240740740745,\n width: 420,\n height: 384,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'rI7ZeO',\n left: 510.64814814814815,\n top: 49.21759259259262,\n width: 420,\n height: 63,\n lineHeight: 1.2,\n content: '

2.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'KspwGc',\n left: 510.64814814814815,\n top: 129.28240740740745,\n width: 420,\n height: 384,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'text',\n id: 'Rx63Jo',\n left: 69.35185185185179,\n top: 51.71759259259262,\n width: 420,\n height: 58,\n lineHeight: 1.2,\n content: '

1.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'ulyuzE',\n left: 69.35185185185179,\n top: 131.78240740740745,\n width: 420,\n height: 129,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'kr35Ca',\n left: 510.6481481481481,\n top: 51.71759259259262,\n width: 420,\n height: 58,\n lineHeight: 1.2,\n content: '

2.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'BNQSpC',\n left: 510.6481481481481,\n top: 131.78240740740745,\n width: 420,\n height: 129,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'Vr38Nu',\n left: 69.35185185185185,\n top: 301.71759259259255,\n width: 420,\n height: 58,\n lineHeight: 1.2,\n content: '

3.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'IwKRSu',\n left: 69.35185185185185,\n top: 381.7824074074074,\n width: 420,\n height: 129,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: '0Opr1v',\n left: 510.64814814814815,\n top: 301.71759259259255,\n width: 420,\n height: 58,\n lineHeight: 1.2,\n content: '

4.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: '4L9Uzz',\n left: 510.64814814814815,\n top: 381.7824074074074,\n width: 420,\n height: 129,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'text',\n id: 'GdEGxg',\n left: 134.53703703703704,\n top: 127.25,\n width: 152.77777777777777,\n height: 308,\n lineHeight: 1.8,\n content: '

请在此处输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n wordSpace: 8,\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'y5sAfw',\n left: 332.8703703703704,\n top: 127.25,\n width: 532.5925925925926,\n height: 50,\n content: '

请在此处输入内容1

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'VeuocM',\n left: 332.8703703703704,\n top: 212.0648148148148,\n width: 532.5925925925926,\n height: 50,\n content: '

请在此处输入内容2

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'RyFWQe',\n left: 332.8703703703704,\n top: 296.8796296296296,\n width: 532.5925925925926,\n height: 50,\n content: '

请在此处输入内容3

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'Q56viI',\n left: 332.8703703703704,\n top: 381.69444444444446,\n width: 532.5925925925926,\n height: 50,\n content: '

请在此处输入内容4

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'shape',\n id: 'SUWirT',\n left: 73.8888888888889,\n top: 64.21296296296302,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

1

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: 'YjzN1M',\n left: 148.70370370370372,\n top: 64.21296296296302,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n }, \n {\n type: 'shape',\n id: 'fS09I7',\n left: 527.5925925925926,\n top: 64.21296296296302,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

2

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: 'qCnfB1',\n left: 602.4074074074074,\n top: 64.21296296296302,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n },\n {\n type: 'shape',\n id: 'difAAT',\n left: 73.8888888888889,\n top: 221.25000000000003,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

3

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: 'EUlvMo',\n left: 148.70370370370372,\n top: 221.25000000000003,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n }, \n {\n type: 'shape',\n id: 'US_9jB',\n left: 527.5925925925926,\n top: 221.25000000000003,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

4

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: '243MnQ',\n left: 602.4074074074074,\n top: 221.25000000000003,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n }, \n {\n type: 'shape',\n id: 'Y_KUj0',\n left: 73.8888888888889,\n top: 378.287037037037,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

5

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: '9GglMe',\n left: 148.70370370370372,\n top: 378.287037037037,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n }, \n {\n type: 'shape',\n id: 'eSInje',\n left: 527.5925925925926,\n top: 378.287037037037,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

6

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: '0S3yUg',\n left: 602.4074074074074,\n top: 378.287037037037,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n]","import { defineStore } from 'pinia'\nimport tinycolor from 'tinycolor2'\nimport { omit } from 'lodash'\nimport { Slide, SlideTheme, PPTElement, PPTAnimation } from '@/types/slides'\nimport { slides } from '@/mocks/slides'\nimport { theme } from '@/mocks/theme'\nimport { layouts } from '@/mocks/layout'\n\ninterface RemoveElementPropData {\n id: string\n propName: string | string[]\n}\n\ninterface UpdateElementData {\n id: string | string[]\n props: Partial\n}\n\ninterface FormatedAnimation {\n animations: PPTAnimation[]\n autoNext: boolean\n}\n\nexport interface SlidesState {\n theme: SlideTheme\n slides: Slide[]\n slideIndex: number\n viewportRatio: number\n}\n\nexport const useSlidesStore = defineStore('slides', {\n state: (): SlidesState => ({\n theme: theme, // 主题样式\n slides: slides, // 幻灯片页面数据\n slideIndex: 0, // 当前页面索引\n viewportRatio: 0.5625, // 可是区域比例,默认16:9\n }),\n\n getters: {\n currentSlide(state) {\n return state.slides[state.slideIndex]\n },\n \n currentSlideAnimations(state) {\n const currentSlide = state.slides[state.slideIndex]\n if (!currentSlide?.animations) return []\n\n const els = currentSlide.elements\n const elIds = els.map(el => el.id)\n return currentSlide.animations.filter(animation => elIds.includes(animation.elId))\n },\n\n // 格式化的当前页动画\n // 将触发条件为“与上一动画同时”的项目向上合并到序列中的同一位置\n // 为触发条件为“上一动画之后”项目的上一项添加自动向下执行标记\n formatedAnimations(state) {\n const currentSlide = state.slides[state.slideIndex]\n if (!currentSlide?.animations) return []\n\n const els = currentSlide.elements\n const elIds = els.map(el => el.id)\n const animations = currentSlide.animations.filter(animation => elIds.includes(animation.elId))\n\n const formatedAnimations: FormatedAnimation[] = []\n for (const animation of animations) {\n if (animation.trigger === 'click' || !formatedAnimations.length) {\n formatedAnimations.push({ animations: [animation], autoNext: false })\n }\n else if (animation.trigger === 'meantime') {\n const last = formatedAnimations[formatedAnimations.length - 1]\n last.animations = last.animations.filter(item => item.elId !== animation.elId)\n last.animations.push(animation)\n formatedAnimations[formatedAnimations.length - 1] = last\n }\n else if (animation.trigger === 'auto') {\n const last = formatedAnimations[formatedAnimations.length - 1]\n last.autoNext = true\n formatedAnimations[formatedAnimations.length - 1] = last\n formatedAnimations.push({ animations: [animation], autoNext: false })\n }\n }\n return formatedAnimations\n },\n \n layouts(state) {\n const {\n themeColor,\n fontColor,\n fontName,\n backgroundColor,\n } = state.theme\n \n const subColor = tinycolor(fontColor).isDark() ? 'rgba(230, 230, 230, 0.5)' : 'rgba(180, 180, 180, 0.5)'\n \n const layoutsString = JSON.stringify(layouts)\n .replaceAll('{{themeColor}}', themeColor)\n .replaceAll('{{fontColor}}', fontColor)\n .replaceAll('{{fontName}}', fontName)\n .replaceAll('{{backgroundColor}}', backgroundColor)\n .replaceAll('{{subColor}}', subColor)\n \n return JSON.parse(layoutsString)\n },\n },\n\n actions: {\n setTheme(themeProps: Partial) {\n this.theme = { ...this.theme, ...themeProps }\n },\n \n setViewportRatio(viewportRatio: number) {\n this.viewportRatio = viewportRatio\n },\n \n setSlides(slides: Slide[]) {\n this.slides = slides\n },\n \n addSlide(slide: Slide | Slide[]) {\n const slides = Array.isArray(slide) ? slide : [slide]\n const addIndex = this.slideIndex + 1\n this.slides.splice(addIndex, 0, ...slides)\n this.slideIndex = addIndex\n },\n \n updateSlide(props: Partial) {\n const slideIndex = this.slideIndex\n this.slides[slideIndex] = { ...this.slides[slideIndex], ...props }\n },\n \n deleteSlide(slideId: string | string[]) {\n const slidesId = Array.isArray(slideId) ? slideId : [slideId]\n \n const deleteSlidesIndex = []\n for (let i = 0; i < slidesId.length; i++) {\n const index = this.slides.findIndex(item => item.id === slidesId[i])\n deleteSlidesIndex.push(index)\n }\n let newIndex = Math.min(...deleteSlidesIndex)\n \n const maxIndex = this.slides.length - slidesId.length - 1\n if (newIndex > maxIndex) newIndex = maxIndex\n \n this.slideIndex = newIndex\n this.slides = this.slides.filter(item => !slidesId.includes(item.id))\n },\n \n updateSlideIndex(index: number) {\n this.slideIndex = index\n },\n \n addElement(element: PPTElement | PPTElement[]) {\n const elements = Array.isArray(element) ? element : [element]\n const currentSlideEls = this.slides[this.slideIndex].elements\n const newEls = [...currentSlideEls, ...elements]\n this.slides[this.slideIndex].elements = newEls\n },\n\n deleteElement(elementId: string | string[]) {\n const elementIdList = Array.isArray(elementId) ? elementId : [elementId]\n const currentSlideEls = this.slides[this.slideIndex].elements\n const newEls = currentSlideEls.filter(item => !elementIdList.includes(item.id))\n this.slides[this.slideIndex].elements = newEls\n },\n \n updateElement(data: UpdateElementData) {\n const { id, props } = data\n const elIdList = typeof id === 'string' ? [id] : id\n \n const slideIndex = this.slideIndex\n const slide = this.slides[slideIndex]\n const elements = slide.elements.map(el => {\n return elIdList.includes(el.id) ? { ...el, ...props } : el\n })\n this.slides[slideIndex].elements = (elements as PPTElement[])\n },\n \n removeElementProps(data: RemoveElementPropData) {\n const { id, propName } = data\n const propsNames = typeof propName === 'string' ? [propName] : propName\n \n const slideIndex = this.slideIndex\n const slide = this.slides[slideIndex]\n const elements = slide.elements.map(el => {\n return el.id === id ? omit(el, propsNames) : el\n })\n this.slides[slideIndex].elements = (elements as PPTElement[])\n },\n },\n})","import { customAlphabet } from 'nanoid'\nimport { defineStore } from 'pinia'\nimport { CreatingElement } from '@/types/edit'\nimport { ToolbarStates } from '@/types/toolbar'\nimport { DialogForExportTypes } from '@/types/export'\nimport { SYS_FONTS } from '@/configs/font'\nimport { TextAttrs, defaultRichTextAttrs } from '@/utils/prosemirror/utils'\nimport { isSupportFont } from '@/utils/font'\n\nimport { useSlidesStore } from './slides'\n\nexport interface MainState {\n activeElementIdList: string[]\n handleElementId: string\n activeGroupElementId: string\n canvasPercentage: number\n canvasScale: number\n canvasDragged: boolean\n thumbnailsFocus: boolean\n editorAreaFocus: boolean\n disableHotkeys: boolean\n showGridLines: boolean\n showRuler: boolean\n creatingElement: CreatingElement | null\n availableFonts: typeof SYS_FONTS\n toolbarState: ToolbarStates\n clipingImageElementId: string\n isScaling: boolean\n richTextAttrs: TextAttrs\n selectedTableCells: string[]\n selectedSlidesIndex: number[]\n dialogForExport: DialogForExportTypes\n databaseId: string\n}\n\nconst nanoid = customAlphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')\nexport const databaseId = nanoid(10)\n\nexport const useMainStore = defineStore('main', {\n state: (): MainState => ({\n activeElementIdList: [], // 被选中的元素ID集合,包含 handleElementId\n handleElementId: '', // 正在操作的元素ID\n activeGroupElementId: '', // 组合元素成员中,被选中可独立操作的元素ID\n canvasPercentage: 90, // 画布可视区域百分比\n canvasScale: 1, // 画布缩放比例(基于宽度1000px)\n canvasDragged: false, // 画布被拖拽移动\n thumbnailsFocus: false, // 左侧导航缩略图区域聚焦\n editorAreaFocus: false, // 编辑区域聚焦\n disableHotkeys: false, // 禁用快捷键\n showGridLines: false, // 显示网格线\n showRuler: false, // 显示标尺\n creatingElement: null, // 正在插入的元素信息,需要通过绘制插入的元素(文字、形状、线条)\n availableFonts: SYS_FONTS, // 当前环境可用字体\n toolbarState: ToolbarStates.SLIDE_DESIGN, // 右侧工具栏状态\n clipingImageElementId: '', // 当前正在裁剪的图片ID \n richTextAttrs: defaultRichTextAttrs, // 富文本状态\n selectedTableCells: [], // 选中的表格单元格\n isScaling: false, // 正在进行元素缩放\n selectedSlidesIndex: [], // 当前被选中的页面索引集合\n dialogForExport: '', // 导出面板\n databaseId, // 标识当前应用的indexedDB数据库ID\n }),\n\n getters: {\n activeElementList(state) {\n const slidesStore = useSlidesStore()\n const currentSlide = slidesStore.currentSlide\n if (!currentSlide || !currentSlide.elements) return []\n return currentSlide.elements.filter(element => state.activeElementIdList.includes(element.id))\n },\n \n handleElement(state) {\n const slidesStore = useSlidesStore()\n const currentSlide = slidesStore.currentSlide\n if (!currentSlide || !currentSlide.elements) return null\n return currentSlide.elements.find(element => state.handleElementId === element.id) || null\n },\n },\n\n actions: {\n setActiveElementIdList(activeElementIdList: string[]) {\n if (activeElementIdList.length === 1) this.handleElementId = activeElementIdList[0]\n else this.handleElementId = ''\n \n this.activeElementIdList = activeElementIdList\n },\n \n setHandleElementId(handleElementId: string) {\n this.handleElementId = handleElementId\n },\n \n setActiveGroupElementId(activeGroupElementId: string) {\n this.activeGroupElementId = activeGroupElementId\n },\n \n setCanvasPercentage(percentage: number) {\n this.canvasPercentage = percentage\n },\n \n setCanvasScale(scale: number) {\n this.canvasScale = scale\n },\n \n setCanvasDragged(isDragged: boolean) {\n this.canvasDragged = isDragged\n },\n \n setThumbnailsFocus(isFocus: boolean) {\n this.thumbnailsFocus = isFocus\n },\n \n setEditorareaFocus(isFocus: boolean) {\n this.editorAreaFocus = isFocus\n },\n \n setDisableHotkeysState(disable: boolean) {\n this.disableHotkeys = disable\n },\n \n setGridLinesState(show: boolean) {\n this.showGridLines = show\n },\n \n setRulerState(show: boolean) {\n this.showRuler = show\n },\n \n setCreatingElement(element: CreatingElement | null) {\n this.creatingElement = element\n },\n \n setAvailableFonts() {\n this.availableFonts = SYS_FONTS.filter(font => isSupportFont(font.value))\n },\n \n setToolbarState(toolbarState: ToolbarStates) {\n this.toolbarState = toolbarState\n },\n \n setClipingImageElementId(elId: string) {\n this.clipingImageElementId = elId\n },\n \n setRichtextAttrs(attrs: TextAttrs) {\n this.richTextAttrs = attrs\n },\n \n setSelectedTableCells(cells: string[]) {\n this.selectedTableCells = cells\n },\n \n setScalingState(isScaling: boolean) {\n this.isScaling = isScaling\n },\n \n updateSelectedSlidesIndex(selectedSlidesIndex: number[]) {\n this.selectedSlidesIndex = selectedSlidesIndex\n },\n\n setDialogForExport(type: DialogForExportTypes) {\n this.dialogForExport = type\n },\n },\n})","export const LOCALSTORAGE_KEY_DISCARDED_DB = 'PPTIST_DISCARDED_DB'","import Dexie from 'dexie'\nimport { databaseId } from '@/store/main'\nimport { Slide } from '@/types/slides'\nimport { LOCALSTORAGE_KEY_DISCARDED_DB } from '@/configs/storage'\n\nexport interface Snapshot {\n index: number\n slides: Slide[]\n}\n\nconst databaseNamePrefix = 'PPTist'\n\n// 删除失效/过期的数据库\n// 应用关闭时(关闭或刷新浏览器),会将其数据库ID记录在 localStorage 中,表示该ID指向的数据库已失效\n// 当应用初始化时,检查当前所有数据库,将被记录失效的数据库删除\n// 另外,距离初始化时间超过12小时的数据库也将被删除(这是为了防止出现因以外未被正确删除的库)\nexport const deleteDiscardedDB = async () => {\n const now = new Date().getTime()\n\n const localStorageDiscardedDB = localStorage.getItem(LOCALSTORAGE_KEY_DISCARDED_DB)\n const localStorageDiscardedDBList: string[] = localStorageDiscardedDB ? JSON.parse(localStorageDiscardedDB) : []\n\n const databaseNames = await Dexie.getDatabaseNames()\n const discardedDBNames = databaseNames.filter(name => {\n if (name.indexOf(databaseNamePrefix) === -1) return false\n \n const [prefix, id, time] = name.split('_')\n if (prefix !== databaseNamePrefix || !id || !time) return true\n if (localStorageDiscardedDBList.includes(id)) return true\n if (now - (+time) >= 1000 * 60 * 60 * 12) return true\n\n return false\n })\n\n for (const name of discardedDBNames) Dexie.delete(name)\n localStorage.removeItem(LOCALSTORAGE_KEY_DISCARDED_DB)\n}\n\nclass PPTistDB extends Dexie {\n public snapshots: Dexie.Table\n\n public constructor() {\n super(`${databaseNamePrefix}_${databaseId}_${new Date().getTime()}`)\n this.version(1).stores({\n snapshots: '++id'\n })\n this.snapshots = this.table('snapshots')\n }\n}\n\nexport const db = new PPTistDB()","import { defineStore } from 'pinia'\nimport { IndexableTypeArray } from 'dexie'\nimport { db, deleteDiscardedDB, Snapshot } from '@/utils/database'\n\nimport { useSlidesStore } from './slides'\nimport { useMainStore } from './main'\n\nexport interface ScreenState {\n snapshotCursor: number\n snapshotLength: number\n}\n\nexport const useSnapshotStore = defineStore('snapshot', {\n state: (): ScreenState => ({\n snapshotCursor: -1, // 历史快照指针\n snapshotLength: 0, // 历史快照长度\n }),\n\n getters: {\n canUndo(state) {\n return state.snapshotCursor > 0\n },\n canRedo(state) {\n return state.snapshotCursor < state.snapshotLength - 1\n },\n },\n\n actions: {\n setSnapshotCursor(cursor: number) {\n this.snapshotCursor = cursor\n },\n setSnapshotLength(length: number) {\n this.snapshotLength = length\n },\n\n async initSnapshotDatabase() {\n const slidesStore = useSlidesStore()\n\n await deleteDiscardedDB()\n \n const newFirstSnapshot = {\n index: slidesStore.slideIndex,\n slides: slidesStore.slides,\n }\n await db.snapshots.add(newFirstSnapshot)\n this.setSnapshotCursor(0)\n this.setSnapshotLength(1)\n },\n \n async addSnapshot() {\n const slidesStore = useSlidesStore()\n\n // 获取当前indexeddb中全部快照的ID\n const allKeys = await db.snapshots.orderBy('id').keys()\n \n let needDeleteKeys: IndexableTypeArray = []\n \n // 记录需要删除的快照ID\n // 若当前快照指针不处在最后一位,那么再添加快照时,应该将当前指针位置后面的快照全部删除,对应的实际情况是:\n // 用户撤回多次后,再进行操作(添加快照),此时原先被撤销的快照都应该被删除\n if (this.snapshotCursor >= 0 && this.snapshotCursor < allKeys.length - 1) {\n needDeleteKeys = allKeys.slice(this.snapshotCursor + 1)\n }\n \n // 添加新快照\n const snapshot = {\n index: slidesStore.slideIndex,\n slides: slidesStore.slides,\n }\n await db.snapshots.add(snapshot)\n \n // 计算当前快照长度,用于设置快照指针的位置(此时指针应该处在最后一位,即:快照长度 - 1)\n let snapshotLength = allKeys.length - needDeleteKeys.length + 1\n \n // 快照数量超过长度限制时,应该将头部多余的快照删除\n const snapshotLengthLimit = 20\n if (snapshotLength > snapshotLengthLimit) {\n needDeleteKeys.push(allKeys[0])\n snapshotLength--\n }\n \n // 快照数大于1时,需要保证撤回操作后维持页面焦点不变:也就是将倒数第二个快照对应的索引设置为当前页的索引\n // https://github.com/pipipi-pikachu/PPTist/issues/27\n if (snapshotLength >= 2) {\n db.snapshots.update(allKeys[snapshotLength - 2] as number, { index: slidesStore.slideIndex })\n }\n \n await db.snapshots.bulkDelete(needDeleteKeys)\n \n this.setSnapshotCursor(snapshotLength - 1)\n this.setSnapshotLength(snapshotLength)\n },\n \n async unDo() {\n if (this.snapshotCursor <= 0) return\n\n const slidesStore = useSlidesStore()\n const mainStore = useMainStore()\n \n const snapshotCursor = this.snapshotCursor - 1\n const snapshots: Snapshot[] = await db.snapshots.orderBy('id').toArray()\n const snapshot = snapshots[snapshotCursor]\n const { index, slides } = snapshot\n \n const slideIndex = index > slides.length - 1 ? slides.length - 1 : index\n \n slidesStore.setSlides(slides)\n slidesStore.updateSlideIndex(slideIndex)\n this.setSnapshotCursor(snapshotCursor)\n mainStore.setActiveElementIdList([])\n },\n \n async reDo() {\n if (this.snapshotCursor >= this.snapshotLength - 1) return\n\n const slidesStore = useSlidesStore()\n const mainStore = useMainStore()\n \n const snapshotCursor = this.snapshotCursor + 1\n const snapshots: Snapshot[] = await db.snapshots.orderBy('id').toArray()\n const snapshot = snapshots[snapshotCursor]\n const { index, slides } = snapshot\n \n const slideIndex = index > slides.length - 1 ? slides.length - 1 : index\n \n slidesStore.setSlides(slides)\n slidesStore.updateSlideIndex(slideIndex)\n this.setSnapshotCursor(snapshotCursor)\n mainStore.setActiveElementIdList([])\n },\n },\n})","import { defineStore } from 'pinia'\n\nexport interface KeyboardState {\n ctrlKeyState: boolean\n shiftKeyState: boolean\n spaceKeyState: boolean\n}\n\nexport const useKeyboardStore = defineStore('keyboard', {\n state: (): KeyboardState => ({\n ctrlKeyState: false, // ctrl键按下状态\n shiftKeyState: false, // shift键按下状态\n spaceKeyState: false, // space键按下状态\n }),\n\n getters: {\n ctrlOrShiftKeyActive(state) {\n return state.ctrlKeyState || state.shiftKeyState\n },\n },\n\n actions: {\n setCtrlKeyState(active: boolean) {\n this.ctrlKeyState = active\n },\n setShiftKeyState(active: boolean) {\n this.shiftKeyState = active\n },\n setSpaceKeyState(active: boolean) {\n this.spaceKeyState = active\n },\n },\n})","import { defineStore } from 'pinia'\n\nexport interface ScreenState {\n screening: boolean\n}\n\nexport const useScreenStore = defineStore('screen', {\n state: (): ScreenState => ({\n screening: false, // 是否进入放映状态\n }),\n\n actions: {\n setScreening(screening: boolean) {\n this.screening = screening\n },\n },\n})","import { padStart } from 'lodash'\n\n/**\n * 补足数字位数\n * @param digit 数字\n * @param len 位数\n */\nexport const fillDigit = (digit: number, len: number) => {\n return padStart('' + digit, len, '0')\n}\n\n/**\n * 判断设备\n */\nexport const isPC = () => {\n return !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|Mobile|BlackBerry|Symbian|Windows Phone)/i)\n}","import { IBarChartOptions, ILineChartOptions, IPieChartOptions } from 'chartist'\n\nexport const enum ShapePathFormulasKeys {\n ROUND_RECT = 'roundRect',\n ROUND_RECT_DIAGONAL = 'roundRectDiagonal',\n ROUND_RECT_SINGLE = 'roundRectSingle',\n ROUND_RECT_SAMESIDE = 'roundRectSameSide',\n CUT_RECT_DIAGONAL = 'cutRectDiagonal',\n CUT_RECT_SINGLE = 'cutRectSingle',\n CUT_RECT_SAMESIDE = 'cutRectSameSide',\n MESSAGE = 'message',\n ROUND_MESSAGE = 'roundMessage',\n L = 'L',\n RING_RECT = 'ringRect',\n PLUS = 'plus',\n TRIANGLE = 'triangle',\n PARALLELOGRAM_LEFT = 'parallelogramLeft',\n PARALLELOGRAM_RIGHT = 'parallelogramRight',\n TRAPEZOID = 'trapezoid',\n BULLET = 'bullet',\n INDICATOR = 'indicator',\n}\n\nexport const enum ElementTypes {\n TEXT = 'text',\n IMAGE = 'image',\n SHAPE = 'shape',\n LINE = 'line',\n CHART = 'chart',\n TABLE = 'table',\n LATEX = 'latex',\n VIDEO = 'video',\n AUDIO = 'audio',\n}\n\n/**\n * 元素阴影\n * \n * h: 水平偏移量\n * \n * v: 垂直偏移量\n * \n * blur: 模糊程度\n * \n * color: 阴影颜色\n */\nexport interface PPTElementShadow {\n h: number\n v: number\n blur: number\n color: string\n}\n\n/**\n * 元素边框\n * \n * style?: 边框样式(实线或虚线)\n * \n * width?: 边框宽度\n * \n * color?: 边框颜色\n */\nexport interface PPTElementOutline {\n style?: 'dashed' | 'solid'\n width?: number\n color?: string\n}\n\n/**\n * 元素超链接\n * \n * type: 链接类型(网页、幻灯片页面)\n * \n * target: 目标地址(网页链接、幻灯片页面ID)\n */\nexport interface PPTElementLink {\n type: 'web' | 'slide'\n target: string\n}\n\n\n/**\n * 元素通用属性\n * \n * id: 元素ID\n * \n * left: 元素水平方向位置(距离画布左侧)\n * \n * top: 元素垂直方向位置(距离画布顶部)\n * \n * lock?: 锁定元素\n * \n * groupId?: 组合ID(拥有相同组合ID的元素即为同一组合元素成员)\n * \n * width: 元素宽度\n * \n * height: 元素高度\n * \n * rotate: 旋转角度\n * \n * link?: 超链接\n */\ninterface PPTBaseElement {\n id: string\n left: number\n top: number\n lock?: boolean\n groupId?: string\n width: number\n height: number\n rotate: number\n link?: PPTElementLink\n}\n\n\n/**\n * 文本元素\n * \n * type: 元素类型(text)\n * \n * content: 文本内容(HTML字符串)\n * \n * defaultFontName: 默认字体(会被文本内容中的HTML内联样式覆盖)\n * \n * defaultColor: 默认颜色(会被文本内容中的HTML内联样式覆盖)\n * \n * outline?: 边框\n * \n * fill?: 填充色\n * \n * lineHeight?: 行高(倍),默认1.5\n * \n * wordSpace?: 字间距,默认0\n * \n * opacity?: 不透明度,默认1\n * \n * shadow?: 阴影\n * \n * textIndent?: 段落首行缩进\n * \n * paragraphSpace?: 段间距,默认 5px\n */\nexport interface PPTTextElement extends PPTBaseElement {\n type: 'text'\n content: string\n defaultFontName: string\n defaultColor: string\n outline?: PPTElementOutline\n fill?: string\n lineHeight?: number\n wordSpace?: number\n opacity?: number\n shadow?: PPTElementShadow\n textIndent?: number\n paragraphSpace?: number\n}\n\n\n/**\n * 图片翻转、形状翻转\n * \n * flipH?: 水平翻转\n * \n * flipV?: 垂直翻转\n */\nexport interface ImageOrShapeFlip {\n flipH?: boolean\n flipV?: boolean\n}\n\n/**\n * 图片滤镜\n * \n * https://developer.mozilla.org/zh-CN/docs/Web/CSS/filter\n * \n * 'blur'?: 模糊,默认0(px)\n * \n * 'brightness'?: 亮度,默认100(%)\n * \n * 'contrast'?: 对比度,默认100(%)\n * \n * 'grayscale'?: 灰度,默认0(%)\n * \n * 'saturate'?: 饱和度,默认100(%)\n * \n * 'hue-rotate'?: 色相旋转,默认0(deg)\n * \n * 'opacity'?: 不透明度,默认100(%)\n */\nexport interface ImageElementFilters {\n 'blur'?: string\n 'brightness'?: string\n 'contrast'?: string\n 'grayscale'?: string\n 'saturate'?: string\n 'hue-rotate'?: string\n 'opacity'?: string\n}\n\nexport type ImageClipDataRange = [[number, number], [number, number]]\n\n/**\n * 图片裁剪\n * \n * range: 裁剪范围,例如:[[10, 10], [90, 90]] 表示裁取原图从左上角 10%, 10% 到 90%, 90% 的范围\n * \n * shape: 裁剪形状,见 configs/imageClip.ts CLIPPATHS \n */\nexport interface ImageElementClip {\n range: ImageClipDataRange\n shape: string\n}\n\n/**\n * 图片元素\n * \n * type: 元素类型(image)\n * \n * fixedRatio: 固定图片宽高比例\n * \n * src: 图片地址\n * \n * outline?: 边框\n * \n * filters?: 图片滤镜\n * \n * clip?: 裁剪信息\n * \n * flipH?: 水平翻转\n * \n * flipV?: 垂直翻转\n * \n * shadow?: 阴影\n */\nexport interface PPTImageElement extends PPTBaseElement {\n type: 'image'\n fixedRatio: boolean\n src: string\n outline?: PPTElementOutline\n filters?: ImageElementFilters\n clip?: ImageElementClip\n flipH?: boolean\n flipV?: boolean\n shadow?: PPTElementShadow\n}\n\n\n/**\n * 形状渐变\n * \n * type: 渐变类型(径向、线性)\n * \n * color: 渐变颜色\n * \n * rotate: 渐变角度(线性渐变)\n */\nexport interface ShapeGradient {\n type: 'linear' | 'radial'\n color: [string, string]\n rotate: number\n}\n\n/**\n * 形状内文本\n * \n * content: 文本内容(HTML字符串)\n * \n * defaultFontName: 默认字体(会被文本内容中的HTML内联样式覆盖)\n * \n * defaultColor: 默认颜色(会被文本内容中的HTML内联样式覆盖)\n * \n * align: 文本对齐方向(垂直方向)\n */\nexport interface ShapeText {\n content: string\n defaultFontName: string\n defaultColor: string\n align: 'top' | 'middle' | 'bottom'\n}\n\n/**\n * 形状元素\n * \n * type: 元素类型(shape)\n * \n * viewBox: SVG的viewBox属性,例如 [1000, 1000] 表示 '0 0 1000 1000'\n * \n * path: 形状路径,SVG path 的 d 属性\n * \n * fixedRatio: 固定形状宽高比例\n * \n * fill: 填充,不存在渐变时生效\n * \n * gradient?: 渐变,该属性存在时将优先作为填充\n * \n * outline?: 边框\n * \n * opacity?: 不透明度\n * \n * flipH?: 水平翻转\n * \n * flipV?: 垂直翻转\n * \n * shadow?: 阴影\n * \n * special?: 特殊形状(标记一些难以解析的形状,例如路径使用了 L Q C A 以外的类型,该类形状在导出后将变为图片的形式)\n * \n * text?: 形状内文本\n * \n * pathFormula?: 形状路径计算公式\n * 一般情况下,形状的大小变化时仅由宽高基于 viewBox 的缩放比例来调整形状,而 viewBox 本身和 path 不会变化,\n * 但也有一些形状希望能更精确的控制一些关键点的位置,此时就需要提供路径计算公式,通过在缩放时更新 viewBox 并重新计算 path 来重新绘制形状\n * \n * keypoint?: 关键点位置百分比\n */\nexport interface PPTShapeElement extends PPTBaseElement {\n type: 'shape'\n viewBox: [number, number]\n path: string\n fixedRatio: boolean\n fill: string\n gradient?: ShapeGradient\n outline?: PPTElementOutline\n opacity?: number\n flipH?: boolean\n flipV?: boolean\n shadow?: PPTElementShadow\n special?: boolean\n text?: ShapeText\n pathFormula?: ShapePathFormulasKeys\n keypoint?: number\n}\n\n\nexport type LinePoint = '' | 'arrow' | 'dot' \n\n/**\n * 线条元素\n * \n * type: 元素类型(line)\n * \n * start: 起点位置([x, y])\n * \n * end: 终点位置([x, y])\n * \n * style: 线条样式(实线、虚线)\n * \n * color: 线条颜色\n * \n * points: 端点样式([起点样式, 终点样式],可选:无、箭头、圆点)\n * \n * shadow?: 阴影\n * \n * broken?: 折线控制点位置([x, y])\n * \n * curve?: 二次曲线控制点位置([x, y])\n * \n * curve?: 三次曲线控制点位置([[x1, y1], [x2, y2]])\n */\nexport interface PPTLineElement extends Omit {\n type: 'line'\n start: [number, number]\n end: [number, number]\n style: 'solid' | 'dashed'\n color: string\n points: [LinePoint, LinePoint]\n shadow?: PPTElementShadow\n broken?: [number, number]\n curve?: [number, number]\n cubic?: [[number, number], [number, number]]\n}\n\n\nexport type PresetChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'scatter' | 'pie' | 'ring'\nexport type ChartType = 'bar' | 'line' | 'pie'\nexport type ChartOptions = ILineChartOptions & IBarChartOptions & IPieChartOptions\nexport interface ChartData {\n labels: string[]\n legends: string[]\n series: number[][]\n}\n\n/**\n * 图表元素\n * \n * type: 元素类型(chart)\n * \n * fill?: 填充色\n * \n * chartType: 图表基础类型(bar/line/pie),所有图表类型都是由这三种基本类型衍生而来\n * \n * data: 图表数据\n * \n * options?: 图表配置项\n * \n * outline?: 边框\n * \n * themeColor: 主题色\n * \n * gridColor?: 网格&坐标颜色\n * \n * legend?: 图例/位置\n */\nexport interface PPTChartElement extends PPTBaseElement {\n type: 'chart'\n fill?: string\n chartType: ChartType\n data: ChartData\n options?: ChartOptions\n outline?: PPTElementOutline\n themeColor: string[]\n gridColor?: string\n legend?: '' | 'top' | 'bottom'\n}\n\n\n/**\n * 表格单元格样式\n * \n * bold?: 加粗\n * \n * em?: 斜体\n * \n * underline?: 下划线\n * \n * strikethrough?: 删除线\n * \n * color?: 字体颜色\n * \n * backcolor?: 填充色\n * \n * fontsize?: 字体大小\n * \n * fontname?: 字体\n * \n * align?: 对齐方式\n */\nexport interface TableCellStyle {\n bold?: boolean\n em?: boolean\n underline?: boolean\n strikethrough?: boolean\n color?: string\n backcolor?: string\n fontsize?: string\n fontname?: string\n align?: 'left' | 'center' | 'right'\n}\n\n\n/**\n * 表格单元格\n * \n * id: 单元格ID\n * \n * colspan: 合并列数\n * \n * rowspan: 合并行数\n * \n * text: 文字内容\n * \n * style?: 单元格样式\n */\nexport interface TableCell {\n id: string\n colspan: number\n rowspan: number\n text: string\n style?: TableCellStyle\n}\n\n/**\n * 表格主题\n * \n * color: 主题色\n * \n * rowHeader: 标题行\n * \n * rowFooter: 汇总行\n * \n * colHeader: 第一列\n * \n * colFooter: 最后一列\n */\nexport interface TableTheme {\n color: string\n rowHeader: boolean\n rowFooter: boolean\n colHeader: boolean\n colFooter: boolean\n}\n\n/**\n * 表格元素\n * \n * type: 元素类型(table)\n * \n * outline: 边框\n * \n * theme?: 主题\n * \n * colWidths: 列宽数组,如[30, 50, 20]表示三列宽度分别为30%, 50%, 20%\n * \n * data: 表格数据\n */\nexport interface PPTTableElement extends PPTBaseElement {\n type: 'table'\n outline: PPTElementOutline\n theme?: TableTheme\n colWidths: number[]\n data: TableCell[][]\n}\n\n\n/**\n * LaTeX元素(公式)\n * \n * type: 元素类型(latex)\n * \n * latex: latex代码\n * \n * path: svg path\n * \n * color: 颜色\n * \n * strokeWidth: 路径宽度\n * \n * viewBox: SVG的viewBox属性\n * \n * fixedRatio: 固定形状宽高比例\n */\nexport interface PPTLatexElement extends PPTBaseElement {\n type: 'latex'\n latex: string\n path: string\n color: string\n strokeWidth: number\n viewBox: [number, number]\n fixedRatio: boolean\n}\n\n/**\n * 视频元素\n * \n * type: 元素类型(video)\n * \n * src: 视频地址\n * \n * poster: 预览封面\n */\nexport interface PPTVideoElement extends PPTBaseElement {\n type: 'video'\n src: string\n poster?: string\n}\n\n/**\n * 音频元素\n * \n * type: 元素类型(audio)\n * \n * fixedRatio: 固定图标宽高比例\n * \n * color: 图标颜色\n * \n * loop: 循环播放\n * \n * autoplay: 自动播放\n * \n * src: 音频地址\n */\nexport interface PPTAudioElement extends PPTBaseElement {\n type: 'audio'\n fixedRatio: boolean\n color: string,\n loop: boolean,\n autoplay: boolean,\n src: string\n}\n\n\nexport type PPTElement = PPTTextElement | PPTImageElement | PPTShapeElement | PPTLineElement | PPTChartElement | PPTTableElement | PPTLatexElement | PPTVideoElement | PPTAudioElement\n\n\n/**\n * 元素动画\n * \n * id: 动画id\n * \n * elId: 元素ID\n * \n * effect: 动画效果\n * \n * type: 动画类型(入场、退场、强调)\n * \n * duration: 动画持续时间\n * \n * trigger: 动画触发方式(click - 单击时、meantime - 与上一动画同时、auto - 上一动画之后)\n */\nexport interface PPTAnimation {\n id: string\n elId: string\n effect: string\n type: 'in' | 'out' | 'attention'\n duration: number\n trigger: 'click' | 'meantime' | 'auto'\n}\n\n/**\n * 幻灯片背景\n * \n * type: 背景类型(纯色、图片、渐变)\n * \n * color?: 背景颜色(纯色)\n * \n * image?: 图片地址(图片)\n * \n * imageSize?: 图片填充方式\n * \n * gradientType?: 渐变类型(线性、径向)\n * \n * gradientColor?: 渐变颜色\n * \n * gradientRotate?: 渐变角度(线性)\n */\nexport interface SlideBackground {\n type: 'solid' | 'image' | 'gradient'\n color?: string\n image?: string\n imageSize?: 'cover' | 'contain' | 'repeat'\n gradientType?: 'linear' | 'radial'\n gradientColor?: [string, string]\n gradientRotate?: number\n}\n\n\nexport type TurningMode = 'no' | 'fade' | 'slideX' | 'slideY'\n\n/**\n * 幻灯片页面\n * \n * id: 页面ID\n * \n * elements: 元素集合\n * \n * remark?: 备注\n * \n * background?: 页面背景\n * \n * animations?: 元素动画集合\n * \n * turningMode?: 翻页方式\n */\nexport interface Slide {\n id: string\n elements: PPTElement[]\n remark?: string\n background?: SlideBackground\n animations?: PPTAnimation[]\n turningMode?: TurningMode\n}\n\n/**\n * 幻灯片主题\n * \n * backgroundColor: 页面背景颜色\n * \n * themeColor: 主题色,用于默认创建的形状颜色等\n * \n * fontColor: 字体颜色\n * \n * fontName: 字体\n */\nexport interface SlideTheme {\n backgroundColor: string\n themeColor: string\n fontColor: string\n fontName: string\n}","import CryptoJS from 'crypto-js'\n\nconst CRYPTO_KEY = 'pptist'\n\n/**\n * 加密\n * @param msg 待加密字符串\n */\nexport const encrypt = (msg: string) => {\n return CryptoJS.AES.encrypt(msg, CRYPTO_KEY).toString()\n}\n\n/**\n * 解密\n * @param ciphertext 待解密字符串\n */\nexport const decrypt = (ciphertext: string) => {\n const bytes = CryptoJS.AES.decrypt(ciphertext, CRYPTO_KEY)\n return bytes.toString(CryptoJS.enc.Utf8)\n}","import Clipboard from 'clipboard'\nimport { decrypt } from '@/utils/crypto'\n\n/**\n * 复制文本到剪贴板\n * @param text 文本内容\n */\nexport const copyText = (text: string) => {\n return new Promise((resolve, reject) => {\n const fakeElement = document.createElement('button')\n const clipboard = new Clipboard(fakeElement, {\n text: () => text,\n action: () => 'copy',\n container: document.body,\n })\n clipboard.on('success', e => {\n clipboard.destroy()\n resolve(e)\n })\n clipboard.on('error', e => {\n clipboard.destroy()\n reject(e)\n })\n document.body.appendChild(fakeElement)\n fakeElement.click()\n document.body.removeChild(fakeElement)\n })\n}\n\n// 读取剪贴板\nexport const readClipboard = (): Promise => {\n return new Promise((resolve, reject) => {\n if (navigator.clipboard?.readText) {\n navigator.clipboard.readText().then(text => {\n if (!text) reject('剪贴板为空或者不包含文本')\n return resolve(text)\n })\n }\n else reject('浏览器不支持或禁止访问剪贴板,请使用快捷键 Ctrl + V')\n })\n}\n\n// 解析加密后的剪贴板内容\nexport const pasteCustomClipboardString = (text: string) => {\n let clipboardData\n try {\n clipboardData = JSON.parse(decrypt(text))\n }\n catch {\n clipboardData = text\n }\n\n return clipboardData\n}\n\n// 尝试解析剪贴板内容是否为Excel表格(或类似的)数据格式\nexport const pasteExcelClipboardString = (text: string): string[][] | null => {\n const lines: string[] = text.split('\\r\\n')\n\n if (lines[lines.length - 1] === '') lines.pop()\n\n let colCount = -1\n const data: string[][] = []\n for (const index in lines) {\n data[index] = lines[index].split('\\t')\n\n if (data[index].length === 1) return null\n if (colCount === -1) colCount = data[index].length\n else if (colCount !== data[index].length) return null\n }\n return data\n}","import tinycolor from 'tinycolor2'\r\nimport { nanoid } from 'nanoid'\r\nimport { PPTElement, PPTLineElement } from '@/types/slides'\r\n\r\ninterface RotatedElementData {\r\n left: number\r\n top: number\r\n width: number\r\n height: number\r\n rotate: number\r\n}\r\n\r\n/**\r\n * 计算元素在画布中的矩形范围旋转后的新位置范围\r\n * @param element 元素的位置大小和旋转角度信息\r\n */\r\nexport const getRectRotatedRange = (element: RotatedElementData) => {\r\n const { left, top, width, height, rotate = 0 } = element\r\n\r\n const radius = Math.sqrt( Math.pow(width, 2) + Math.pow(height, 2) ) / 2\r\n const auxiliaryAngle = Math.atan(height / width) * 180 / Math.PI\r\n\r\n const tlbraRadian = (180 - rotate - auxiliaryAngle) * Math.PI / 180\r\n const trblaRadian = (auxiliaryAngle - rotate) * Math.PI / 180\r\n\r\n const middleLeft = left + width / 2\r\n const middleTop = top + height / 2\r\n\r\n const xAxis = [\r\n middleLeft + radius * Math.cos(tlbraRadian),\r\n middleLeft + radius * Math.cos(trblaRadian),\r\n middleLeft - radius * Math.cos(tlbraRadian),\r\n middleLeft - radius * Math.cos(trblaRadian),\r\n ]\r\n const yAxis = [\r\n middleTop - radius * Math.sin(tlbraRadian),\r\n middleTop - radius * Math.sin(trblaRadian),\r\n middleTop + radius * Math.sin(tlbraRadian),\r\n middleTop + radius * Math.sin(trblaRadian),\r\n ]\r\n\r\n return {\r\n xRange: [Math.min(...xAxis), Math.max(...xAxis)],\r\n yRange: [Math.min(...yAxis), Math.max(...yAxis)],\r\n }\r\n}\r\n\r\n/**\r\n * 计算元素在画布中的矩形范围旋转后的新位置与旋转之前位置的偏离距离\r\n * @param element 元素的位置大小和旋转角度信息\r\n */\r\nexport const getRectRotatedOffset = (element: RotatedElementData) => {\r\n const { xRange: originXRange, yRange: originYRange } = getRectRotatedRange({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: 0,\r\n })\r\n const { xRange: rotatedXRange, yRange: rotatedYRange } = getRectRotatedRange({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n return {\r\n offsetX: rotatedXRange[0] - originXRange[0],\r\n offsetY: rotatedYRange[0] - originYRange[0],\r\n }\r\n}\r\n\r\n/**\r\n * 计算元素在画布中的位置范围\r\n * @param element 元素信息\r\n */\r\nexport const getElementRange = (element: PPTElement) => {\r\n let minX, maxX, minY, maxY\r\n\r\n if (element.type === 'line') {\r\n minX = element.left\r\n maxX = element.left + Math.max(element.start[0], element.end[0])\r\n minY = element.top\r\n maxY = element.top + Math.max(element.start[1], element.end[1])\r\n }\r\n else if ('rotate' in element && element.rotate) {\r\n const { left, top, width, height, rotate } = element\r\n const { xRange, yRange } = getRectRotatedRange({ left, top, width, height, rotate })\r\n minX = xRange[0]\r\n maxX = xRange[1]\r\n minY = yRange[0]\r\n maxY = yRange[1]\r\n }\r\n else {\r\n minX = element.left\r\n maxX = element.left + element.width\r\n minY = element.top\r\n maxY = element.top + element.height\r\n }\r\n return { minX, maxX, minY, maxY }\r\n}\r\n\r\n/**\r\n * 计算一组元素在画布中的位置范围\r\n * @param elementList 一组元素信息\r\n */\r\nexport const getElementListRange = (elementList: PPTElement[]) => {\r\n const leftValues: number[] = []\r\n const topValues: number[] = []\r\n const rightValues: number[] = []\r\n const bottomValues: number[] = []\r\n\r\n elementList.forEach(element => {\r\n const { minX, maxX, minY, maxY } = getElementRange(element)\r\n leftValues.push(minX)\r\n topValues.push(minY)\r\n rightValues.push(maxX)\r\n bottomValues.push(maxY)\r\n })\r\n\r\n const minX = Math.min(...leftValues)\r\n const maxX = Math.max(...rightValues)\r\n const minY = Math.min(...topValues)\r\n const maxY = Math.max(...bottomValues)\r\n\r\n return { minX, maxX, minY, maxY }\r\n}\r\n\r\nexport interface AlignLine {\r\n value: number\r\n range: [number, number]\r\n}\r\n\r\n/**\r\n * 将一组对齐吸附线进行去重:同位置的的多条对齐吸附线仅留下一条,取该位置所有对齐吸附线的最大值和最小值为新的范围\r\n * @param lines 一组对齐吸附线信息\r\n */\r\nexport const uniqAlignLines = (lines: AlignLine[]) => {\r\n const uniqLines: AlignLine[] = []\r\n lines.forEach(line => {\r\n const index = uniqLines.findIndex(_line => _line.value === line.value)\r\n if (index === -1) uniqLines.push(line)\r\n else {\r\n const uniqLine = uniqLines[index]\r\n const rangeMin = Math.min(uniqLine.range[0], line.range[0])\r\n const rangeMax = Math.max(uniqLine.range[1], line.range[1])\r\n const range: [number, number] = [rangeMin, rangeMax]\r\n const _line = { value: line.value, range }\r\n uniqLines[index] = _line\r\n }\r\n })\r\n return uniqLines\r\n}\r\n\r\n/**\r\n * 以元素列表为基础,为每一个元素生成新的ID,并关联到旧ID形成一个字典\r\n * 主要用于复制元素时,维持数据中各处元素ID原有的关系\r\n * 例如:原本两个组合的元素拥有相同的groupId,复制后依然会拥有另一个相同的groupId\r\n * @param elements 元素列表数据\r\n */\r\nexport const createElementIdMap = (elements: PPTElement[]) => {\r\n const groupIdMap = {}\r\n const elIdMap = {}\r\n for (const element of elements) {\r\n const groupId = element.groupId\r\n if (groupId && !groupIdMap[groupId]) {\r\n groupIdMap[groupId] = nanoid(10)\r\n }\r\n elIdMap[element.id] = nanoid(10)\r\n }\r\n return {\r\n groupIdMap,\r\n elIdMap,\r\n }\r\n}\r\n\r\n/**\r\n * 根据表格的主题色,获取对应用于配色的子颜色\r\n * @param themeColor 主题色\r\n */\r\nexport const getTableSubThemeColor = (themeColor: string) => {\r\n const rgba = tinycolor(themeColor)\r\n return [\r\n rgba.setAlpha(0.3).toRgbString(),\r\n rgba.setAlpha(0.1).toRgbString(),\r\n ]\r\n}\r\n\r\n/**\r\n * 获取线条元素路径字符串\r\n * @param element 线条元素\r\n */\r\nexport const getLineElementPath = (element: PPTLineElement) => {\r\n const start = element.start.join(',')\r\n const end = element.end.join(',')\r\n if (element.broken) {\r\n const mid = element.broken.join(',')\r\n return `M${start} L${mid} L${end}`\r\n }\r\n else if (element.curve) {\r\n const mid = element.curve.join(',')\r\n return `M${start} Q${mid} ${end}`\r\n }\r\n else if (element.cubic) {\r\n const [c1, c2] = element.cubic\r\n const p1 = c1.join(',')\r\n const p2 = c2.join(',')\r\n return `M${start} C${p1} ${p2} ${end}`\r\n }\r\n return `M${start} L${end}`\r\n}","/**\r\n * 将普通文本转为带段落信息的HTML字符串\r\n * @param text 文本\r\n */\r\nexport const parseText2Paragraphs = (text: string) => {\r\n const htmlText = text.replace(/[\\n\\r]+/g, '
')\r\n const paragraphs = htmlText.split('
')\r\n let string = ''\r\n for (const paragraph of paragraphs) {\r\n if (paragraph) string += `
${paragraph}
`\r\n }\r\n return string\r\n}","interface ImageSize {\n width: number\n height: number\n}\n\n/**\n * 获取图片的原始宽高\n * @param src 图片地址\n */\nexport const getImageSize = (src: string): Promise => {\n return new Promise(resolve => {\n const img = document.createElement('img')\n img.src = src\n img.style.opacity = '0'\n document.body.appendChild(img)\n\n img.onload = () => {\n const imgWidth = img.clientWidth\n const imgHeight = img.clientHeight\n \n img.onload = null\n img.onerror = null\n\n document.body.removeChild(img)\n\n resolve({ width: imgWidth, height: imgHeight })\n }\n\n img.onerror = () => {\n img.onload = null\n img.onerror = null\n }\n })\n}\n\n/**\n * 读取图片文件的dataURL\n * @param file 图片文件\n */\nexport const getImageDataURL = (file: File): Promise => {\n return new Promise(resolve => {\n const reader = new FileReader()\n reader.addEventListener('load', () => {\n resolve(reader.result as string)\n })\n reader.readAsDataURL(file)\n })\n}","export const VIEWPORT_SIZE = 1000","import { ShapePathFormulasKeys } from '@/types/slides'\n\nexport interface ShapePoolItem {\n viewBox: [number, number]\n path: string\n special?: boolean\n pathFormula?: ShapePathFormulasKeys\n outlined?: boolean\n}\n\ninterface ShapeListItem {\n type: string\n children: ShapePoolItem[]\n}\n\nexport const SHAPE_PATH_FORMULAS = {\n [ShapePathFormulasKeys.ROUND_RECT]: {\n editable: true,\n defaultValue: 0.125,\n range: [0, 0.5],\n relative: 'left',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M ${radius} 0 L ${width - radius} 0 Q ${width} 0 ${width} ${radius} L ${width} ${height - radius} Q ${width} ${height} ${width - radius} ${height} L ${radius} ${height} Q 0 ${height} 0 ${height - radius} L 0 ${radius} Q 0 0 ${radius} 0 Z`\n }\n },\n [ShapePathFormulasKeys.CUT_RECT_DIAGONAL]: {\n editable: true,\n defaultValue: 0.2,\n range: [0, 0.9],\n relative: 'right',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 ${height - radius} L 0 0 L ${width - radius} 0 L ${width} ${radius} L ${width} ${height} L ${radius} ${height} Z`\n }\n },\n [ShapePathFormulasKeys.CUT_RECT_SINGLE]: {\n editable: true,\n defaultValue: 0.2,\n range: [0, 0.9],\n relative: 'right',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 ${height} L 0 0 L ${width - radius} 0 L ${width} ${radius} L ${width} ${height} Z`\n }\n },\n [ShapePathFormulasKeys.CUT_RECT_SAMESIDE]: {\n editable: true,\n defaultValue: 0.2,\n range: [0, 0.5],\n relative: 'left',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 ${radius} L ${radius} 0 L ${width - radius} 0 L ${width} ${radius} L ${width} ${height} L 0 ${height} Z`\n }\n },\n [ShapePathFormulasKeys.ROUND_RECT_DIAGONAL]: {\n editable: true,\n defaultValue: 0.125,\n range: [0, 1],\n relative: 'right',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 0 L ${width - radius} 0 Q ${width} 0 ${width} ${radius} L ${width} ${height} L ${radius} ${height} Q 0 ${height} 0 ${height - radius} L 0 0 Z`\n }\n },\n [ShapePathFormulasKeys.ROUND_RECT_SINGLE]: {\n editable: true,\n defaultValue: 0.125,\n range: [0, 1],\n relative: 'right',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 0 L ${width - radius} 0 Q ${width} 0 ${width} ${radius} L ${width} ${height} L 0 ${height} L 0 0 Z`\n }\n },\n [ShapePathFormulasKeys.ROUND_RECT_SAMESIDE]: {\n editable: true,\n defaultValue: 0.125,\n range: [0, 0.5],\n relative: 'left',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 ${radius} Q 0 0 ${radius} 0 L ${width - radius} 0 Q ${width} 0 ${width} ${radius} L ${width} ${height} L 0 ${height} Z`\n }\n },\n [ShapePathFormulasKeys.MESSAGE]: {\n formula: (width: number, height: number) => {\n const arrowWidth = width * 0.2\n const arrowheight = height * 0.2\n return `M 0 0 L ${width} 0 L ${width} ${height - arrowheight} L ${width / 2} ${height - arrowheight} L ${width / 2 - arrowWidth} ${height} L ${width / 2 - arrowWidth} ${height - arrowheight} L 0 ${height - arrowheight} Z`\n }\n },\n [ShapePathFormulasKeys.ROUND_MESSAGE]: {\n formula: (width: number, height: number) => {\n const radius = Math.min(width, height) * 0.125\n const arrowWidth = width * 0.2\n const arrowheight = height * 0.2\n return `M 0 ${radius} Q 0 0 ${radius} 0 L ${width - radius} 0 Q ${width} 0 ${width} ${radius} L ${width} ${height - radius - arrowheight} Q ${width} ${height - arrowheight} ${width - radius} ${height - arrowheight} L ${width / 2} ${height - arrowheight} L ${width / 2 - arrowWidth} ${height} L ${width / 2 - arrowWidth} ${height - arrowheight} L ${radius} ${height - arrowheight} Q 0 ${height - arrowheight} 0 ${height - radius - arrowheight} L 0 ${radius} Z`\n }\n },\n [ShapePathFormulasKeys.L]: {\n editable: true,\n defaultValue: 0.25,\n range: [0.1, 0.9],\n relative: 'left',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const lineWidth = Math.min(width, height) * value\n return `M 0 0 L 0 ${height} L ${width} ${height} L ${width} ${height - lineWidth} L ${lineWidth} ${height - lineWidth} L ${lineWidth} 0 Z`\n }\n },\n [ShapePathFormulasKeys.RING_RECT]: {\n editable: true,\n defaultValue: 0.25,\n range: [0.1, 0.45],\n relative: 'left',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const lineWidth = Math.min(width, height) * value\n return `M 0 0 ${width} 0 ${width} ${height} L 0 ${height} L 0 0 Z M ${lineWidth} ${lineWidth} L ${lineWidth} ${height - lineWidth} L ${width - lineWidth} ${height - lineWidth} L ${width - lineWidth} ${lineWidth} Z`\n }\n },\n [ShapePathFormulasKeys.PLUS]: {\n editable: true,\n defaultValue: 0.25,\n range: [0.1, 0.9],\n relative: 'center',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const lineWidth = Math.min(width, height) * value\n return `M ${width / 2 - lineWidth / 2} 0 L ${width / 2 - lineWidth / 2} ${height / 2 - lineWidth / 2} L 0 ${height / 2 - lineWidth / 2} L 0 ${height / 2 + lineWidth / 2} L ${width / 2 - lineWidth / 2} ${height / 2 + lineWidth / 2} L ${width / 2 - lineWidth / 2} ${height} L ${width / 2 + lineWidth / 2} ${height} L ${width / 2 + lineWidth / 2} ${height / 2 + lineWidth / 2} L ${width} ${height / 2 + lineWidth / 2} L ${width} ${height / 2 - lineWidth / 2} L ${width / 2 + lineWidth / 2} ${height / 2 - lineWidth / 2} L ${width / 2 + lineWidth / 2} 0 Z`\n }\n },\n [ShapePathFormulasKeys.TRIANGLE]: {\n editable: true,\n defaultValue: 0.5,\n range: [0, 1],\n relative: 'left',\n getBaseSize: (width: number, height: number) => width,\n formula: (width: number, height: number, value: number) => {\n const vertex = width * value\n return `M ${vertex} 0 L 0 ${height} L ${width} ${height} Z`\n }\n },\n [ShapePathFormulasKeys.PARALLELOGRAM_LEFT]: {\n editable: true,\n defaultValue: 0.25,\n range: [0, 0.9],\n relative: 'left',\n getBaseSize: (width: number, height: number) => width,\n formula: (width: number, height: number, value: number) => {\n const point = width * value\n return `M ${point} 0 L ${width} 0 L ${width - point} ${height} L 0 ${height} Z`\n }\n },\n [ShapePathFormulasKeys.PARALLELOGRAM_RIGHT]: {\n editable: true,\n defaultValue: 0.25,\n range: [0, 0.9],\n relative: 'right',\n getBaseSize: (width: number, height: number) => width,\n formula: (width: number, height: number, value: number) => {\n const point = width * value\n return `M 0 0 L ${width - point} 0 L ${width} ${height} L ${point} ${height} Z`\n }\n },\n [ShapePathFormulasKeys.TRAPEZOID]: {\n editable: true,\n defaultValue: 0.25,\n range: [0, 0.5],\n relative: 'left',\n getBaseSize: (width: number, height: number) => width,\n formula: (width: number, height: number, value: number) => {\n const point = width * value\n return `M ${point} 0 L ${width - point} 0 L ${width} ${height} L 0 ${height} Z`\n }\n },\n [ShapePathFormulasKeys.BULLET]: {\n editable: true,\n defaultValue: 0.2,\n range: [0, 1],\n relative: 'top',\n getBaseSize: (width: number, height: number) => height,\n formula: (width: number, height: number, value: number) => {\n const point = height * value\n return `M ${width / 2} 0 L 0 ${point} L 0 ${height} L ${width} ${height} L ${width} ${point} Z`\n }\n },\n [ShapePathFormulasKeys.INDICATOR]: {\n editable: true,\n defaultValue: 0.2,\n range: [0, 0.9],\n relative: 'right',\n getBaseSize: (width: number, height: number) => width,\n formula: (width: number, height: number, value: number) => {\n const point = width * value\n return `M ${width} ${height / 2} L ${width - point} 0 L 0 0 L ${point} ${height / 2} L 0 ${height} L ${width - point} ${height} Z`\n }\n },\n}\n\nexport const SHAPE_LIST: ShapeListItem[] = [\n {\n type: '矩形',\n children: [\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 50 0 L 150 0 Q 200 0 200 50 L 200 150 Q 200 200 150 200 L 50 200 Q 0 200 0 150 L 0 50 Q 0 0 50 0 Z',\n pathFormula: ShapePathFormulasKeys.ROUND_RECT,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 150 L 0 0 L 150 0 L 200 50 L 200 200 L 50 200 Z',\n pathFormula: ShapePathFormulasKeys.CUT_RECT_DIAGONAL,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 200 L 0 0 L 150 0 L 200 50 L 200 200 Z',\n pathFormula: ShapePathFormulasKeys.CUT_RECT_SINGLE,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 50 L 50 0 L 150 0 L 200 50 L 200 200 L 0 200 Z',\n pathFormula: ShapePathFormulasKeys.CUT_RECT_SAMESIDE,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 50 200 Q 0 200 0 150 L 0 0 Z',\n pathFormula: ShapePathFormulasKeys.ROUND_RECT_DIAGONAL,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 L 0 0 Z',\n pathFormula: ShapePathFormulasKeys.ROUND_RECT_SINGLE,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 50 Q 0 0 50 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 Z',\n pathFormula: ShapePathFormulasKeys.ROUND_RECT_SAMESIDE,\n },\n ]\n },\n\n {\n type: '常用形状',\n children: [\n {\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 200 L 200 200 L 100 0 Z',\n pathFormula: ShapePathFormulasKeys.TRIANGLE,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 50 0 L 200 0 L 150 200 L 0 200 L 50 0 Z',\n pathFormula: ShapePathFormulasKeys.PARALLELOGRAM_LEFT,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 150 0 L 200 200 L 50 200 L 0 0 Z',\n pathFormula: ShapePathFormulasKeys.PARALLELOGRAM_RIGHT,\n },\n {\n viewBox: [200, 200],\n path: 'M 50 0 L 150 0 L 200 200 L 0 200 L 50 0 Z',\n pathFormula: ShapePathFormulasKeys.TRAPEZOID,\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 100 L 100 200 L 200 100 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 50 L 0 200 L 200 200 L 200 50 L 100 0 Z',\n pathFormula: ShapePathFormulasKeys.BULLET,\n },\n {\n viewBox: [200, 200],\n path: 'M 200 100 L 150 0 L 0 0 L 50 100 L 0 200 L 150 200 L 200 100 Z',\n pathFormula: ShapePathFormulasKeys.INDICATOR,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 200 A 50 100 0 1 1 200 200 L 0 200 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 40 20 A 100 100 0 1 0 200 100 L 100 100 L 40 20 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 A 100 100 102 1 0 200 100 L 100 100 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 160 20 A 100 100 0 1 0 200 100 L 100 100 L 160 20 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 A 100 100 102 1 0 200 100 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 A 100 100 102 1 0 200 100 L 200 0 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 Q 200 200 0 200 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 90 L 50 200 L 150 200 L 200 90 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 60 L 0 140 L 100 200 L 200 140 L 200 60 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 60 0 L 140 0 L 200 60 L 200 140 L 140 200 L 60 200 L 0 140 L 0 60 L 60 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 75 0 L 125 0 L 175 25 L 200 75 L 200 125 L 175 175 L 125 200 L 75 200 L 25 175 L 0 125 L 0 75 L 25 25 L 75 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 150 0 A 50 100 0 1 1 150 200 L 0 200 L 0 0 L 150 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 50 0 A 25 50 0 1 0 50 200 L 150 200 A 25 50 0 1 0 150 0 L 50 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 150 0 A 50 100 0 1 1 150 200 L 0 200 A 50 100 0 0 0 0 0 L 150 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 0 L 200 200 L 0 200 L 0 100 L 200 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 100 L 200 200 L 0 200 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 0 L 100 0 L 0 100 L 0 200 L 200 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 50 0 L 150 0 L 150 50 L 200 50 L 200 150 L 150 150 L 150 200 L 50 200 L 50 150 L 0 150 L 0 50 L 50 50 L 50 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 L 200 140 L 60 140 L 60 0 L 0 0 Z',\n pathFormula: ShapePathFormulasKeys.L\n },\n {\n viewBox: [200, 200],\n path: 'M0 0 L200 0 L200 200 L0 200 L0 0 Z M50 50 L50 150 L150 150 L150 50 Z',\n pathFormula: ShapePathFormulasKeys.RING_RECT,\n },\n {\n viewBox: [200, 200],\n path: 'M0 100 A100 100 0 1 1 0 101 Z M150 100 A50 50 0 1 0 150 101 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 70 0 L 70 70 L 0 70 L 0 130 L 70 130 L 70 200 L 130 200 L 130 130 L 200 130 L 200 70 L 130 70 L 130 0 L 70 0 Z',\n pathFormula: ShapePathFormulasKeys.PLUS,\n },\n {\n viewBox: [200, 200],\n path: 'M 40 0 L 0 40 L 60 100 L 0 160 L 40 200 L 100 140 L 160 200 L 200 160 L 140 100 L 200 40 L 160 0 L 100 60 L 40 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 160 L 100 160 L 60 200 L 60 160 L 0 160 Z',\n pathFormula: ShapePathFormulasKeys.MESSAGE,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 40 Q 0 0 40 0 L 160 0 Q 200 0 200 40 L 200 120 Q 200 160 160 160 L 100 160 L 60 200 L 60 160 L 40 160 Q 0 160 0 120 L 0 40 Z',\n pathFormula: ShapePathFormulasKeys.ROUND_MESSAGE,\n },\n {\n viewBox: [200, 200],\n path: 'M 180 160 A 100 100 0 1 0 100 200 L 200 200 L 200 160 L 180 160 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 0 L 0 0 L 200 200 L 0 200 L 200 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 20 C 60 60 140 -40 200 20 L 200 180 C 140 140 60 240 0 180 L 0 20 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 Q 0 50 0 175 Q 100 225 200 175 Q 200 50 100 0 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 0 100 A 50 50 0 1 1 200 100 L 100 200 L 0 100 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 60 60 L 0 100 L 60 140 L 100 200 L 140 140 L 200 100 L 140 60 L 100 0 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 80 40 L 20 20 L 40 80 L 0 100 L 40 120 L 20 180 L 80 160 L 100 200 L 120 160 L 180 180 L 160 120 L 200 100 L 160 80 L 180 20 L 120 40 L 100 0 Z',\n },\n ],\n },\n \n {\n type: '箭头',\n children: [\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 100 L 50 100 L 50 200 L 150 200 L 150 100 L 200 100 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 200 L 200 100 L 150 100 L 150 0 L 50 0 L 50 100 L 0 100 L 100 200 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 100 L 100 0 L 100 50 L 200 50 L 200 150 L 100 150 L 100 200 L 0 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 100 L 100 0 L 100 50 L 0 50 L 0 150 L 100 150 L 100 200 L 200 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 60 L 60 60 L 60 140 L 0 140 L 100 200 L 200 140 L 140 140 L 140 60 L 200 60 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 100 L 60 0 L 60 60 L 140 60 L 140 0 L 200 100 L 140 200 L 140 140 L 60 140 L 60 200 L 0 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 60 40 L 80 40 L 80 80 L 40 80 L 40 60 L 0 100 L 40 140 L 40 120 L 80 120 L 80 160 L 60 160 L 100 200 L 140 160 L 120 160 L 120 120 L 160 120 L 160 140 L 200 100 L 160 60 L 160 80 L 120 80 L 120 40 L 140 40 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 100 L 100 0 L 100 50 L 200 50 L 150 100 L 200 150 L 100 150 L 100 200 L 0 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 100 L 100 0 L 100 50 L 0 50 L 50 100 L 0 150 L 100 150 L 100 200 L 200 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 100 L 80 20 L 80 80 L 120 80 L 120 0 L 200 0 L 200 200 L 120 200 L 120 120 L 80 120 L 80 180 L 0 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 100 L 120 20 L 120 80 L 80 80 L 80 0 L 0 0 L 0 200 L 80 200 L 80 120 L 120 120 L 120 180 L 200 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 120 0 L 200 100 L 120 200 L 0 200 L 80 100 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 80 0 L 200 0 L 120 100 L 200 200 L 80 200 L 0 100 L 80 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 140 0 L 200 100 L 140 200 L 0 200 L 0 100 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 60 0 L 200 0 L 200 100 L 200 200 L 60 200 L 0 100 L 60 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 100 L 0 200 L 60 100 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 0 L 0 100 L 200 200 L 140 100 L 200 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 80 0 L 200 100 L 80 200 L 0 200 L 120 100 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 0 L 120 0 L 0 100 L 120 200 L 200 200 L 80 100 L 200 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 200 L 180 200 L 180 40 L 200 40 L 160 0 L 120 40 L 140 40 L 140 160 L 0 160 L 0 200 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 200 L 0 20 L 160 20 L 160 0 L 200 40 L 160 80 L 160 60 L 40 60 L 40 200 L 0 200 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 40 180 L 180 180 L 180 40 L 200 40 L 160 0 L 120 40 L 140 40 L 140 140 L 40 140 L 40 120 L 0 160 L 40 200 L 40 180 Z'\n },\n {\n viewBox: [1024, 1024],\n path: 'M398.208 302.912V64L0 482.112l398.208 418.176V655.36c284.48 0 483.584 95.552 625.792 304.64-56.896-298.688-227.584-597.312-625.792-657.088z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M625.792 302.912V64L1024 482.112l-398.208 418.176V655.36C341.312 655.36 142.208 750.912 0 960c56.896-298.688 227.584-597.312 625.792-657.088z',\n special: true,\n },\n ],\n },\n\n {\n type: '其他形状',\n children: [\n {\n viewBox: [1024, 1024],\n path: 'M995.336 243.4016c-15.7584-36.5736-38.3376-69.26639999-66.91440001-97.37280001-28.5768-27.98879999-61.73999999-49.8624-98.78399999-65.26799998-38.22-15.876-78.6744-23.8728-120.4224-23.87280001-57.97680001 0-114.5424 15.876-163.69919999 45.864-11.76 7.17360001-22.932 15.05279999-33.51600001 23.63760001-10.584-8.5848-21.75600001-16.46400001-33.51600001-23.63760001-49.1568-29.98799999-105.7224-45.86399999-163.69919999-45.864-41.74799999 0-82.2024 7.9968-120.4224 23.87280001-36.9264 15.28799999-70.2072 37.27919999-98.78399999 65.26799998-28.6944 28.10640001-51.156 60.79919999-66.91440001 97.37280001-16.34639999 37.9848-24.696 78.3216-24.696 119.83439999 0 39.1608 7.9968 79.96800001 23.8728 121.48080001 13.28880001 34.692 32.34000001 70.67760001 56.6832 107.016 38.57279999 57.5064 91.61040001 117.4824 157.4664 178.28160001 109.1328 100.78319999 217.2072 170.4024 221.79359999 173.22479998l27.87120001 17.8752c12.348 7.8792 28.224 7.8792 40.572 0l27.87119999-17.8752c4.58639999-2.94 112.54319999-72.44159999 221.79360001-173.22479998 65.85599999-60.79919999 118.89359999-120.7752 157.4664-178.28160001 24.3432-36.33839999 43.512-72.324 56.68319999-107.016 15.876-41.5128 23.8728-82.32 23.87280001-121.48080001 0.1176-41.5128-8.232-81.8496-24.5784-119.83439999z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M985.20746667 343.50079998l-303.32586667-44.08319999L546.28693333 24.5248c-3.70346666-7.5264-9.79626667-13.6192-17.32266665-17.32266668-18.87573334-9.3184-41.81333333-1.55306667-51.25120001 17.32266668L342.1184 299.41759999l-303.32586667 44.08319999c-8.36266667 1.19466667-16.00853333 5.13706667-21.8624 11.11040001-14.69440001 15.17226667-14.45546667 39.30453334 0.71679999 54.1184l219.46026668 213.9648-51.84853333 302.1312c-1.43359999 8.24320001-0.11946667 16.8448 3.82293333 24.25173333 9.79626667 18.6368 32.9728 25.92426667 51.6096 16.00853334L512 822.44266665l271.3088 142.64320001c7.40693333 3.9424 16.00853333 5.25653333 24.25173333 3.82293333 20.78719999-3.584 34.7648-23.296 31.1808-44.0832l-51.84853333-302.1312 219.46026668-213.9648c5.97333334-5.85386666 9.91573333-13.49973334 11.11039999-21.8624 3.2256-20.90666667-11.34933333-40.26026667-32.256-43.36640001z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M852.65066667 405.84533333C800.54044445 268.40177778 667.76177778 170.66666667 512.22755555 170.66666667S223.91466667 268.288 171.80444445 405.73155555C74.29688889 431.33155555 2.27555555 520.07822222 2.27555555 625.77777778c0 125.72444445 101.83111111 227.55555555 227.44177778 227.55555555h564.56533334C919.89333333 853.33333333 1021.72444445 751.50222222 1021.72444445 625.77777778c0-105.472-71.79377778-194.21866667-169.07377778-219.93244445z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M926.25224691 323.7371485H654.6457886L898.88200917 15.14388241c5.05486373-6.53433603 0.49315743-16.02761669-7.76722963-16.02761668H418.30008701c-3.45210206 0-6.78091476 1.84934039-8.50696579 4.93157436L90.35039154 555.76772251c-3.82197013 6.53433603 0.86302552 14.7947231 8.50696578 14.79472311h215.01664245l-110.22068713 440.88274851c-2.34249783 9.61657002 9.24670194 16.39748478 16.39748477 9.49328065L933.03316167 340.62779071c6.41104668-6.0411786 2.09591911-16.8906422-6.78091476-16.89064221z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M878.47822222 463.30311111c-22.18666667-49.83466667-53.93066667-93.98044445-94.32177777-131.072l-33.10933334-30.37866666c-4.89244445-4.32355555-12.62933333-2.38933333-14.79111111 3.75466666l-14.79111111 42.43911111c-9.216 26.624-26.16888889 53.81688889-50.176 80.55466667-1.59288889 1.70666667-3.41333333 2.16177778-4.66488889 2.27555556-1.25155555 0.11377778-3.18577778-0.11377778-4.89244445-1.70666667-1.59288889-1.36533333-2.38933333-3.41333333-2.27555555-5.46133333 4.20977778-68.49422222-16.27022222-145.74933333-61.09866667-229.83111112C561.26577778 124.01777778 509.72444445 69.51822222 445.32622222 31.51644445l-46.99022222-27.648c-6.144-3.64088889-13.99466667 1.13777778-13.65333333 8.30577777l2.50311111 54.61333333c1.70666667 37.31911111-2.61688889 70.31466667-12.85688889 97.73511112-12.51555555 33.56444445-30.49244445 64.73955555-53.47555556 92.72888888-16.15644445 19.56977778-34.24711111 37.20533333-54.04444444 52.45155556-47.90044445 36.75022222-87.38133333 84.65066667-114.11911111 138.24C125.72444445 502.10133333 111.50222222 562.74488889 111.50222222 623.50222222c0 53.70311111 10.58133333 105.69955555 31.51644445 154.73777778 20.25244445 47.21777778 49.152 89.77066667 85.90222222 126.17955555 36.864 36.40888889 79.64444445 65.08088889 127.31733333 84.992C405.61777778 1010.11911111 457.95555555 1020.58666667 512 1020.58666667s106.38222222-10.46755555 155.76177778-31.06133334c47.67288889-19.91111111 90.56711111-48.46933333 127.31733333-84.992 36.864-36.40888889 65.76355555-78.96177778 85.90222222-126.17955555 20.93511111-49.03822222 31.51644445-101.03466667 31.51644445-154.73777778 0-55.52355555-11.37777778-109.45422222-34.01955556-160.31288889z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M968.20337778 20.11591112H705.44042667c-22.17301333 0-41.92483556 15.16430222-47.14951111 37.33731555C642.36202666 124.73685332 582.08711111 173.03324444 512 173.03324444s-130.36202666-48.29639112-146.29091556-115.58001777c-5.22467555-22.17301333-24.84906667-37.33731556-47.14951111-37.33731555H55.79662222c-30.96576 0-56.06968889 25.10392889-56.06968888 56.06968888v321.12639999c0 30.96576 25.10392889 56.06968889 56.06968888 56.06968889h95.57333334v494.43271112c0 30.96576 25.10392889 56.06968889 56.06968889 56.06968888h609.1207111c30.96576 0 56.06968889-25.10392889 56.06968889-56.06968888V453.38168888h95.57333334c30.96576 0 56.06968889-25.10392889 56.06968888-56.06968889V76.1856c0-30.96576-25.10392889-56.06968889-56.06968888-56.06968888z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M980.94648889 239.80714666H523.46880001L373.99210666 96.82944c-1.91146667-1.78403556-4.46008889-2.80348444-7.00871111-2.80348445H43.05351111c-22.55530667 0-40.77795555 18.22264888-40.77795555 40.77795557v754.39217776c0 22.55530667 18.22264888 40.77795555 40.77795555 40.77795557h937.89297778c22.55530667 0 40.77795555-18.22264888 40.77795555-40.77795557V280.58510222c0-22.55530667-18.22264888-40.77795555-40.77795555-40.77795556z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M972.60904597 164.57058577L841.30587843 33.39070759c-18.86327195-18.86327195-44.1375906-29.34286748-70.64480282-29.3428675-26.75379095 0-51.90482023 10.47959553-70.76809219 29.3428675L558.60337778 174.68031322c-18.86327195 18.86327195-29.34286748 44.1375906-29.34286749 70.64480283 0 26.75379095 10.47959553 51.90482023 29.34286749 70.76809218l103.31648301 103.31648302c-24.28800376 53.50758189-57.69942011 101.59043198-99.24793416 143.13894603-41.42522469 41.67180341-89.63136414 75.08321976-143.13894603 99.61780223L316.21649759 558.84995649c-18.86327195-18.86327195-44.1375906-29.34286748-70.64480283-29.34286747-26.75379095 0-51.90482023 10.47959553-70.76809217 29.34286747L33.39070759 700.01627278c-18.86327195 18.86327195-29.34286748 44.1375906-29.3428675 70.76809217 0 26.75379095 10.47959553 51.90482023 29.3428675 70.76809219l131.05658883 131.05658883c30.08260365 30.205893 71.63111769 47.34311394 114.28923598 47.34311394 9.00012323 0 17.63037836-0.73973616 26.13734414-2.21920846 166.19405621-27.37023774 331.03192945-115.76870829 464.06114804-248.67463751C901.84095379 636.27567408 990.11613498 471.56109018 1017.85624079 304.87387654c8.38367642-50.91850535-8.50696579-103.31648302-45.24719482-140.30329077z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M910.60451556 640.96028445c-20.38897778-65.49959112-43.83630221-120.54983112-79.89930667-210.64362666C836.31217778 193.67708444 737.93535999 2.27555556 511.36284444 2.27555556 282.24170667 2.27555556 186.03121778 197.50001778 192.14791111 430.31665779c-36.19043555 90.22122667-59.51032888 144.88917333-79.89930667 210.64362666-43.32657778 139.53706668-29.30915556 197.26336001-18.60494222 198.53767111 22.9376 2.80348444 89.32920888-105.00323556 89.32920889-105.00323556 0 62.44124445 32.11264001 143.86972444 101.69002667 202.61546667-33.64181333 10.32192-109.20846222 38.10190221-91.24067556 68.55793777 14.52714667 24.59420444 250.01984 15.67402668 317.94062222 8.02816 67.92078222 7.64586667 303.41347556 16.56604444 317.94062223-8.02816 17.96778667-30.32860444-57.72629333-58.23601779-91.24067555-68.55793777 69.57738667-58.87317334 101.69002667-140.30165333 101.69002667-202.61546667 0 0 66.39160889 107.80672 89.32920888 105.00323556 10.83164445-1.40174222 24.84906667-59.12803556-18.47751111-198.53767111z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M1016.86992592 199.24764445c-37.13706667 16.01991111-77.55093333 27.54939259-119.17842962 32.03982222 42.96248889-25.60758518 75.60912592-66.02145185 91.02222222-114.08118519-39.68568889 23.66577778-84.58998518 41.02068148-131.31472593 50.00154074C819.53374815 126.79395555 765.76995555 101.79318518 706.18074075 101.79318518c-114.688 0-206.92385185 92.96402963-206.92385186 207.04521482 0 16.01991111 1.94180741 32.03982222 5.09724444 47.45291852-171.72859259-8.98085925-324.88865185-91.02222222-426.71217778-216.63288889-17.96171852 30.82619259-28.15620741 66.02145185-28.1562074 104.49351112 0 71.84687408 36.53025185 135.19834075 92.23585185 172.45677036-33.98162963-1.33499259-66.02145185-10.92266667-93.57084445-26.33576296v2.54862222c0 100.6098963 71.1186963 183.98625185 165.90317037 203.1616-17.3549037 4.49042963-35.92343703 7.03905185-54.49197037 7.03905185-13.47128889 0-26.2144-1.33499259-39.07887407-3.15543704C146.69748148 681.90814815 223.03478518 741.49736297 313.93564445 743.43917037c-71.1186963 55.7056-160.19911111 88.4736-256.9253926 88.4736-17.3549037 0-33.37481482-0.60681482-50.00154074-2.54862222C98.75911111 888.22518518 207.62168889 922.20681482 324.85831111 922.20681482 705.45256297 922.20681482 913.71140741 606.90583703 913.71140741 333.23235555c0-8.98085925 0-17.96171852-0.60681482-26.94257777 40.2925037-29.4912 75.60912592-66.02145185 103.76533333-107.04213333z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M917.96720197 1.08889505H106.03279803C53.56084718 1.08889505 9.37393998 45.27580225 9.37393998 97.74775309v5.52336372c0 19.33177108 8.28504494 41.42522469 22.0934536 55.23363205l331.40179753 392.15879462v325.87843379c0 16.57008987 8.28504494 30.37849854 22.09345359 35.90186098l209.88780469 104.94390299 2.76168121 2.76168121c27.61681602 11.04672615 55.23363335-8.28504494 55.23363335-38.66354218V550.66354348l331.40179753-392.15879462c35.90186097-41.42522469 30.37849854-102.18222047-11.04672616-135.32240022-11.04672615-13.80840865-33.14017975-22.0934536-55.23363335-22.09345359z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M491.70164031 97.48884502a25.89076502 25.89076502 0 0 1 40.59671938 0L745.66415762 367.01171317a25.89076502 25.89076502 0 0 0 30.49932208 7.72839349l208.00640948-89.14190458a25.89076502 25.89076502 0 0 1 35.56096592 29.06238339l-115.18801541 554.96855704A103.56306132 103.56306132 0 0 1 803.14165689 952.14301275H220.85834311a103.56306132 103.56306132 0 0 1-101.4011828-82.51387024l-115.18801541-554.96855704a25.89076502 25.89076502 0 0 1 35.54802012-29.06238339l208.01935528 89.14190458a25.89076502 25.89076502 0 0 0 30.49932208-7.72839349l213.36579793-269.52286815z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M643.02466884 387.7801525c19.85376751-88.69205333 33.718272-152.84087467 41.61900049-192.57389433C704.52292267 95.17283515 652.90057916 2.27555515 550.58614084 2.27555515c-92.26012484 0-138.59407685 45.84971417-165.91530666 137.49816969l-0.70087152 2.67605334c-16.40038399 74.13942085-41.47882668 131.61085116-74.6746315 172.73287031a189.06953915 189.06953915 0 0 1-143.04142182 70.44391902l-26.17434983 0.5606965C77.66380049 387.52529067 27.76177817 438.90551468 27.76177817 501.84374084V881.55022182c0 77.4144 62.25009818 140.17422182 139.05282766 140.17422303h492.82707951c101.23127467 0 191.59267516-63.995904 225.93535999-159.98976l102.37815468-286.22301868c26.04691951-72.82688-11.39234134-153.15945284-83.63303784-179.42300483a138.04612267 138.04612267 0 0 0-47.17499733-8.30850884H643.02466884z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M512 512c140.82958222 0 254.86222222-114.03264 254.86222222-254.86222222S652.82958222 2.27555555 512 2.27555555a254.78940445 254.78940445 0 0 0-254.86222222 254.86222223C257.13777778 397.96736 371.17041778 512 512 512z m0 72.81777778c-170.10232889 0-509.72444445 97.57582222-509.72444445 291.27111111v145.63555556h1019.4488889v-145.63555556c0-193.69528889-339.62211555-291.27111111-509.72444445-291.27111111z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M1019.81297778 564.50161779l-138.89991111-472.51456c-8.66531556-25.99594668-29.43658667-43.45400889-57.21656889-43.45400891s-50.33528889 15.67402668-59.00060446 41.66997334l-92.00526221 274.48661334H351.69166222L259.6864 90.33045333c-8.66531556-25.99594668-31.22062222-41.66997333-59.00060444-41.66997332s-50.33528889 17.33063112-57.2165689 43.45400887L4.69674667 564.50161779c-5.22467555 17.33063112 1.78403556 36.44529778 15.67402667 46.89464887l491.11950221 368.27591113 492.77610666-368.27591113c13.76256-10.32192 20.77127111-29.43658667 15.54659557-46.89464887z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M927.78951111 340.39277037c-12.01493333-47.81700741 12.01493333-124.03294815 89.08041481-150.97552592l-82.40545184-4.36906667s-31.19028148-109.22666667-174.27721483-118.9357037c-143.08693333-9.8304-236.65777778-3.64088889-236.65777777-3.6408889s106.07122963 67.47780741 63.5941926 187.74850371c-31.06891852 63.71555555-79.85682963 116.02299259-132.04290371 175.61220741-1.57771852 1.57771852-3.03407408 3.15543703-4.2477037 4.49042962C278.25493333 624.86755555 7.13007408 934.34311111 7.13007408 934.34311111c298.43152592 78.15774815 498.43768889-7.64586667 616.76657777-110.56165926 24.87940741-0.24272592 43.5693037-0.36408889 56.19105185-0.36408888 164.8109037 0 304.13558518-142.72284445 298.43152593-301.4656-3.88361482-109.1053037-38.71478518-133.74198518-50.72971852-181.5589926z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M997.8886764 504.17210418L537.2729208 43.89182982c-13.97838539-13.97838539-36.56745619-13.97838539-50.5458416 0L26.1113236 504.17210418c-13.41924998 13.41924998-21.02349164 31.64706454-21.02349163 50.65766867 0 39.47496036 32.09437288 71.56933323 71.56933324 71.56933323h48.53295408V954.83524937c0 19.79339373 15.99127289 35.78466661 35.78466663 35.78466662H440.43066677V740.12724968h125.24633315v250.49266631h297.34821416c19.79339373 0 35.78466661-15.99127289 35.78466663-35.78466662V626.39910608h48.53295408c19.01060414 0 37.23841869-7.49241457 50.65766869-21.02349163 27.84494371-27.95677079 27.84494371-73.24673948-0.11182708-101.20351027z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M1009.13013121 349.27572283L674.72427717 14.86986879c-8.82158299-8.82158299-20.35749924-13.16451618-31.89341544-13.16451618s-23.07183245 4.34293316-31.89341547 13.16451618L392.29790453 233.6451272c-16.5574327-1.90003326-33.25058207-2.71433322-49.94373146-2.71433324-99.34459624 0-198.68919249 32.70771543-280.25490606 98.12314628-20.90036589 16.69314938-22.52896582 48.04369819-3.66434987 67.04403081l246.59717401 246.59717401-292.33368895 292.06225564c-3.52863319 3.52863319-5.83581644 8.27871636-6.24296642 13.30023282l-4.61436649 50.48659809c-1.22144996 12.75736619 8.95729967 23.6146991 21.57894918 23.6146991 0.6785833 0 1.35716662 0 2.03574992-0.13571666l50.48659809-4.61436649c5.02151649-0.40714999 9.77159962-2.71433322 13.30023282-6.24296643l292.33368896-292.33368896 246.59717402 246.59717401c8.82158299 8.82158299 20.35749924 13.16451618 31.89341544 13.16451618 13.16451618 0 26.19331567-5.70009979 35.15061536-16.82886604 76.40848044-95.40881307 108.16617924-214.83947521 95.27309638-330.33435417l218.63954175-218.63954173c17.50744934-17.37173267 17.50744934-45.8722316 0-63.51539759z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M976.62005979 160.47737905c-0.39452595-0.39452595-80.35178503 78.64217259-239.47725131 237.50462156l-111.6508437-111.65084369 237.89914752-237.89914752c-125.19623464-75.35445635-286.03131335-56.02268482-390.31767264 48.26367449-81.92988882 81.92988882-112.57140424 200.15616502-83.37648398 310.09739626l2.36715569 8.81107954-372.82702222 372.69551356c-8.15353628 8.15353628-8.15353628 21.56741857 0 29.72095487l185.95323084 185.95323084c8.15353628 8.15353628 21.56741857 8.15353628 29.72095485 0l372.56400493-372.56400493 8.81107953 2.3671557c110.07273989 29.32642892 228.29901608-1.18357785 310.36041356-83.24497533 104.41786795-104.2863593 123.74963948-265.12143802 49.97328693-390.05465535z',\n special: true,\n },\n ],\n },\n\n {\n type: '线性',\n children: [\n {\n viewBox: [1024, 1024],\n path: 'M953.5488 832.61667556c-24.08448-57.08913778-58.74574221-108.31644445-102.70947556-152.28017777-43.96373333-43.96373333-95.19104-78.49756444-152.28017777-102.70947558-0.50972445-0.25486222-1.01944888-0.38229333-1.52917334-0.63715555C776.41955556 519.64586667 828.02915556 426.23886221 828.02915556 320.85333332c0-174.58062221-141.44853334-316.02915556-316.02915556-316.02915554S195.97084444 146.27271111 195.97084444 320.85333332c0 105.38552889 51.6096 198.79253333 130.99918223 256.26396447-0.50972445 0.25486222-1.01944888 0.38229333-1.52917334 0.63715555-57.08913778 24.08448-108.31644445 58.61831112-152.28017777 102.70947554-43.96373333 43.96373333-78.49756444 95.19104-102.70947556 152.28017779C46.74901333 888.55893332 34.13333334 947.8144 32.85902222 1008.72647111c-0.12743111 5.7344 4.46008889 10.44935111 10.19448889 10.44935111h76.45866667c5.60696888 0 10.06705778-4.46008889 10.19448889-9.93962666 2.54862221-98.37681778 42.05226667-190.50951112 111.88451555-260.34176001 72.25344-72.25344 168.20906666-112.01194667 270.40881778-112.01194667s198.15537778 39.75850667 270.40881778 112.01194667C852.24106667 818.72668444 891.74471111 910.85937779 894.29333333 1009.23619556c0.12743111 5.60696888 4.58752 9.93962667 10.19448889 9.93962666h76.45866667c5.7344 0 10.32192-4.71495112 10.19448889-10.44935111-1.27431111-60.91207112-13.88999112-120.16753779-37.59217778-176.10979555zM512 540.03484444c-58.49088 0-113.54112-22.81016889-154.95623111-64.22527999S292.81848888 379.34421333 292.81848888 320.85333332c0-58.49088 22.81016889-113.54112 64.22528001-154.9562311S453.50912 101.67182221 512 101.67182221s113.54112 22.81016889 154.95623111 64.22528001S731.18151112 262.36245333 731.18151112 320.85333332c0 58.49088-22.81016889 113.54112-64.22528001 154.95623113S570.49088 540.03484444 512 540.03484444z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M985.31555555 111.50222222H38.68444445c-20.13866667 0-36.40888889 16.27022222-36.4088889 36.40888889v728.17777778c0 20.13866667 16.27022222 36.40888889 36.4088889 36.40888889h946.6311111c20.13866667 0 36.40888889-16.27022222 36.4088889-36.40888889V147.91111111c0-20.13866667-16.27022222-36.40888889-36.4088889-36.40888889z m-45.5111111 126.06577778V830.57777778H84.19555555V237.568l-31.40266666-24.46222222 44.71466666-57.45777778 48.6968889 37.888h731.70488888l48.69688889-37.888 44.71466667 57.45777778-31.51644444 24.46222222z M877.90933333 193.42222222L512 477.86666667 146.09066667 193.42222222l-48.69688889-37.888-44.71466667 57.45777778 31.40266667 24.46222222 388.66488889 302.19377778c22.98311111 17.86311111 55.18222222 17.86311111 78.16533333 0L939.80444445 237.568l31.40266666-24.46222222-44.71466666-57.45777778-48.58311112 37.77422222z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M985.31555555 88.74666667H38.68444445c-20.13866667 0-36.40888889 16.27022222-36.4088889 36.40888888v564.33777778c0 20.13866667 16.27022222 36.40888889 36.4088889 36.40888889h432.35555555v127.43111111H275.34222222c-10.01244445 0-18.20444445 8.192-18.20444444 18.20444445v54.61333333c0 5.00622222 4.096 9.10222222 9.10222222 9.10222222h491.52c5.00622222 0 9.10222222-4.096 9.10222222-9.10222222v-54.61333333c0-10.01244445-8.192-18.20444445-18.20444444-18.20444445H552.96V725.90222222h432.35555555c20.13866667 0 36.40888889-16.27022222 36.4088889-36.40888889V125.15555555c0-20.13866667-16.27022222-36.40888889-36.4088889-36.40888888z m-45.5111111 555.23555555H84.19555555V170.66666667h855.6088889v473.31555555z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M512 2.27555555C230.51377778 2.27555555 2.27555555 230.51377778 2.27555555 512s228.23822222 509.72444445 509.72444445 509.72444445 509.72444445-228.23822222 509.72444445-509.72444445S793.48622222 2.27555555 512 2.27555555z m0 932.97777778c-233.69955555 0-423.25333333-189.55377778-423.25333333-423.25333333 0-101.26222222 35.61244445-194.33244445 95.00444444-267.15022222l595.39911111 595.39911111C706.33244445 899.64088889 613.26222222 935.25333333 512 935.25333333z m328.24888889-156.10311111L244.84977778 183.75111111C317.66755555 124.35911111 410.73777778 88.74666667 512 88.74666667c233.69955555 0 423.25333333 189.55377778 423.25333333 423.25333333 0 101.26222222-35.61244445 194.33244445-95.00444444 267.15022222z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M901.80266667 257.82044445L656.95288889 12.97066667c-6.82666667-6.82666667-16.04266667-10.69511111-25.71377778-10.69511112H147.91111111c-20.13866667 0-36.40888889 16.27022222-36.40888889 36.4088889v946.6311111c0 20.13866667 16.27022222 36.40888889 36.40888889 36.4088889h728.17777778c20.13866667 0 36.40888889-16.27022222 36.40888889-36.4088889V283.648c0-9.67111111-3.86844445-19.00088889-10.69511111-25.82755555zM828.52977778 300.37333333H614.4V86.24355555L828.52977778 300.37333333z m2.048 639.43111112H193.42222222V84.19555555h343.60888889v245.76c0 26.39644445 21.39022222 47.78666667 47.78666667 47.78666667h245.76v562.06222223z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M981.07392 55.79662222H42.92608c-31.22062222 0-50.71758221 34.02410666-35.04355556 61.16693334L304.28728889 620.82616888V927.42542221c0 22.55530667 18.09521779 40.77795555 40.52309333 40.77795557h334.37923556c22.42787556 0 40.52309333-18.22264888 40.52309333-40.77795557V620.82616888L1016.24490667 116.96355556c15.54659555-27.14282666-3.95036444-61.16693333-35.17098667-61.16693334zM628.47203556 876.45297779H395.52796444V677.66044445h233.07150222v198.79253334z m12.23338666-301.50200891l-12.10595556 21.15356445h-233.19893332l-12.10595556-21.15356445L130.59868445 147.54702221h762.8026311L640.70542222 574.95096888z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M980.62285431 4.54099753H654.39920987c-4.2719763 0-7.76722963 3.49525333-7.76722962 7.76722964v72.4941432c0 4.2719763 3.49525333 7.76722963 7.76722962 7.76722963h207.64393877L604.04167111 350.57107753c-64.72691358-49.83972347-143.69374815-76.7661195-226.67365136-76.7661195-99.54999309 0-193.27456395 38.83614815-263.5679921 109.25903012S4.54099753 547.08198717 4.54099753 646.63198025s38.83614815 193.27456395 109.25903012 263.5679921C184.09345581 980.62285431 277.81802667 1019.45900247 377.36801975 1019.45900247s193.27456395-38.83614815 263.5679921-109.25903012C711.35889383 839.90654419 750.19504197 746.18197333 750.19504197 646.63198025c0-82.9799032-26.92639605-161.68783013-76.63666567-226.41474372L931.4304 162.34521283V369.60079013c0 4.2719763 3.49525333 7.76722963 7.76722963 7.76722962h72.4941432c4.2719763 0 7.76722963-3.49525333 7.76722964-7.76722962V43.37714569c0-21.35988148-17.47626667-38.83614815-38.83614816-38.83614816zM377.36801975 921.07409383c-151.33152395 0-274.44211358-123.11058963-274.44211358-274.44211358s123.11058963-274.44211358 274.44211358-274.44211358 274.44211358 123.11058963 274.44211358 274.44211358-123.11058963 274.44211358-274.44211358 274.44211358z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M591.98717801 512l405.34042913-483.16579151c6.79427767-8.02960089 1.08090782-20.22841761-9.41933951-20.2284176h-123.22349044c-7.25752386 0-14.20621693 3.24272343-18.99309439 8.80167789L511.38233839 415.95362022 177.07299399 17.40746878c-4.63246205-5.55895447-11.58115512-8.80167789-18.99309439-8.80167789H34.85640916c-10.50024731 0-16.21361717 12.19881672-9.41933952 20.2284176L430.77749876 512 25.43706964 995.16579151c-6.79427767 8.02960089-1.08090782 20.22841761 9.41933952 20.2284176h123.22349044c7.25752386 0 14.20621693-3.24272343 18.99309439-8.80167789l334.3093444-398.54615144 334.30934441 398.54615144c4.63246205 5.55895447 11.58115512 8.80167789 18.99309439 8.80167789h123.22349044c10.50024731 0 16.21361717-12.19881672 9.41933951-20.2284176L591.98717801 512z',\n special: true,\n outlined: true,\n },\n ],\n }\n]","import { ChartType } from '@/types/slides'\n\ninterface ChartTypes {\n [propName: string]: ChartType\n}\n\nexport const CHART_TYPES: ChartTypes = {\n bar: 'bar',\n horizontalBar: 'bar',\n line: 'line',\n area: 'line',\n scatter: 'line',\n pie: 'pie',\n ring: 'pie',\n}","import { debounce, throttle} from 'lodash'\nimport { useSnapshotStore } from '@/store'\n\nexport default () => {\n const snapshotStore = useSnapshotStore()\n\n // 添加历史快照(历史记录)\n const addHistorySnapshot = debounce(function() {\n snapshotStore.addSnapshot()\n }, 300, { trailing: true })\n\n // 重做\n const redo = throttle(function() {\n snapshotStore.reDo()\n }, 100, { leading: true, trailing: false })\n\n // 撤销\n const undo = throttle(function() {\n snapshotStore.unDo()\n }, 100, { leading: true, trailing: false })\n\n return {\n addHistorySnapshot,\n redo,\n undo,\n }\n}","import { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { getImageSize } from '@/utils/image'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport { PPTLineElement, PPTElement, TableCell, TableCellStyle, PPTShapeElement, PPTChartElement, ChartOptions, PresetChartType } from '@/types/slides'\nimport { ShapePoolItem, SHAPE_PATH_FORMULAS } from '@/configs/shapes'\nimport { LinePoolItem } from '@/configs/lines'\nimport { CHART_TYPES } from '@/configs/chartTypes'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface CommonElementPosition {\n top: number\n left: number\n width: number\n height: number\n}\n\ninterface LineElementPosition {\n top: number\n left: number\n start: [number, number]\n end: [number, number]\n}\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { creatingElement } = storeToRefs(mainStore)\n const { theme, viewportRatio } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 创建(插入)一个元素并将其设置为被选中元素\n const createElement = (element: PPTElement, callback?: () => void) => {\n slidesStore.addElement(element)\n mainStore.setActiveElementIdList([element.id])\n\n if (creatingElement.value) mainStore.setCreatingElement(null)\n\n setTimeout(() => {\n mainStore.setEditorareaFocus(true)\n }, 0)\n\n if (callback) callback()\n\n addHistorySnapshot()\n }\n\n /**\n * 创建图片元素\n * @param src 图片地址\n */\n const createImageElement = (src: string) => {\n getImageSize(src).then(({ width, height }) => {\n const scale = height / width\n \n if (scale < viewportRatio.value && width > VIEWPORT_SIZE) {\n width = VIEWPORT_SIZE\n height = width * scale\n }\n else if (height > VIEWPORT_SIZE * viewportRatio.value) {\n height = VIEWPORT_SIZE * viewportRatio.value\n width = height / scale\n }\n\n createElement({\n type: 'image',\n id: nanoid(10),\n src,\n width,\n height,\n left: (VIEWPORT_SIZE - width) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - height) / 2,\n fixedRatio: true,\n rotate: 0,\n })\n })\n }\n \n /**\n * 创建图表元素\n * @param chartType 图表类型\n */\n const createChartElement = (type: PresetChartType) => {\n const newElement: PPTChartElement = {\n type: 'chart',\n id: nanoid(10),\n chartType: CHART_TYPES[type],\n left: 300,\n top: 81.25,\n width: 400,\n height: 400,\n rotate: 0,\n themeColor: [theme.value.themeColor],\n gridColor: theme.value.fontColor,\n data: {\n labels: ['类别1', '类别2', '类别3', '类别4', '类别5'],\n legends: ['系列1'],\n series: [\n [12, 19, 5, 2, 18],\n ],\n },\n }\n\n let options: ChartOptions = {}\n if (type === 'horizontalBar') options = { horizontalBars: true }\n else if (type === 'area') options = { showArea: true }\n else if (type === 'scatter') options = { showLine: false }\n else if (type === 'ring') options = { donut: true }\n\n createElement({\n ...newElement,\n options,\n })\n }\n \n /**\n * 创建表格元素\n * @param row 行数\n * @param col 列数\n */\n const createTableElement = (row: number, col: number) => {\n const style: TableCellStyle = {\n fontname: theme.value.fontName,\n color: theme.value.fontColor,\n }\n const data: TableCell[][] = []\n for (let i = 0; i < row; i++) {\n const rowCells: TableCell[] = []\n for (let j = 0; j < col; j++) {\n rowCells.push({ id: nanoid(10), colspan: 1, rowspan: 1, text: '', style })\n }\n data.push(rowCells)\n }\n\n const DEFAULT_CELL_WIDTH = 100\n const DEFAULT_CELL_HEIGHT = 36\n\n const colWidths: number[] = new Array(col).fill(1 / col)\n\n const width = col * DEFAULT_CELL_WIDTH\n const height = row * DEFAULT_CELL_HEIGHT\n\n createElement({\n type: 'table',\n id: nanoid(10),\n width,\n height,\n colWidths,\n rotate: 0,\n data,\n left: (VIEWPORT_SIZE - width) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - height) / 2,\n outline: {\n width: 2,\n style: 'solid',\n color: '#eeece1',\n },\n theme: {\n color: theme.value.themeColor,\n rowHeader: true,\n rowFooter: false,\n colHeader: false,\n colFooter: false,\n },\n })\n }\n \n /**\n * 创建文本元素\n * @param position 位置大小信息\n * @param content 文本内容\n */\n const createTextElement = (position: CommonElementPosition, content = '') => {\n const { left, top, width, height } = position\n const id = nanoid(10)\n createElement({\n type: 'text',\n id,\n left, \n top, \n width, \n height,\n content,\n rotate: 0,\n defaultFontName: theme.value.fontName,\n defaultColor: theme.value.fontColor,\n }, () => {\n setTimeout(() => {\n const editorRef: HTMLElement | null = document.querySelector(`#editable-element-${id} .ProseMirror`)\n if (editorRef) editorRef.focus()\n }, 0)\n })\n }\n \n /**\n * 创建形状元素\n * @param position 位置大小信息\n * @param data 形状路径信息\n */\n const createShapeElement = (position: CommonElementPosition, data: ShapePoolItem) => {\n const { left, top, width, height } = position\n const newElement: PPTShapeElement = {\n type: 'shape',\n id: nanoid(10),\n left, \n top, \n width, \n height,\n viewBox: data.viewBox,\n path: data.path,\n fill: theme.value.themeColor,\n fixedRatio: false,\n rotate: 0,\n }\n if (data.special) newElement.special = true\n if (data.pathFormula) {\n newElement.pathFormula = data.pathFormula\n newElement.viewBox = [width, height]\n\n const pathFormula = SHAPE_PATH_FORMULAS[data.pathFormula]\n if ('editable' in pathFormula) {\n newElement.path = pathFormula.formula(width, height, pathFormula.defaultValue)\n newElement.keypoint = pathFormula.defaultValue\n }\n else newElement.path = pathFormula.formula(width, height)\n }\n createElement(newElement)\n }\n \n /**\n * 创建线条元素\n * @param position 位置大小信息\n * @param data 线条的路径和样式\n */\n const createLineElement = (position: LineElementPosition, data: LinePoolItem) => {\n const { left, top, start, end } = position\n\n const newElement: PPTLineElement = {\n type: 'line',\n id: nanoid(10),\n left, \n top, \n start,\n end,\n points: data.points,\n color: theme.value.themeColor,\n style: data.style,\n width: 2,\n }\n if (data.isBroken) newElement.broken = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]\n if (data.isCurve) newElement.curve = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]\n if (data.isCubic) newElement.cubic = [[(start[0] + end[0]) / 2, (start[1] + end[1]) / 2], [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]]\n createElement(newElement)\n }\n \n /**\n * 创建LaTeX元素\n * @param svg SVG代码\n */\n const createLatexElement = (data: { path: string; latex: string; w: number; h: number; }) => {\n createElement({\n type: 'latex',\n id: nanoid(10),\n width: data.w,\n height: data.h,\n rotate: 0,\n left: (VIEWPORT_SIZE - data.w) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - data.h) / 2,\n path: data.path,\n latex: data.latex,\n color: theme.value.fontColor,\n strokeWidth: 2,\n viewBox: [data.w, data.h],\n fixedRatio: true,\n })\n }\n \n /**\n * 创建视频元素\n * @param src 视频地址\n */\n const createVideoElement = (src: string) => {\n createElement({\n type: 'video',\n id: nanoid(10),\n width: 500,\n height: 300,\n rotate: 0,\n left: (VIEWPORT_SIZE - 500) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - 300) / 2,\n src,\n })\n }\n \n /**\n * 创建音频元素\n * @param src 音频地址\n */\n const createAudioElement = (src: string) => {\n createElement({\n type: 'audio',\n id: nanoid(10),\n width: 50,\n height: 50,\n rotate: 0,\n left: (VIEWPORT_SIZE - 50) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - 50) / 2,\n loop: false,\n autoplay: false,\n fixedRatio: true,\n color: theme.value.themeColor,\n src,\n })\n }\n\n return {\n createImageElement,\n createChartElement,\n createTableElement,\n createTextElement,\n createShapeElement,\n createLineElement,\n createLatexElement,\n createVideoElement,\n createAudioElement,\n }\n}","import { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useSlidesStore, useMainStore } from '@/store'\nimport { PPTElement, Slide } from '@/types/slides'\nimport { createElementIdMap } from '@/utils/element'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { currentSlide } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n /**\n * 添加指定的元素数据(一组)\n * @param elements 元素列表数据\n */\n const addElementsFromData = (elements: PPTElement[]) => {\n const { groupIdMap, elIdMap } = createElementIdMap(elements)\n const currentSlideElementIdList = currentSlide.value.elements.map(el => el.id)\n \n for (const element of elements) {\n const inCurrentSlide = currentSlideElementIdList.includes(element.id)\n \n element.id = elIdMap[element.id]\n\n if (inCurrentSlide) {\n element.left = element.left + 10\n element.top = element.top + 10\n }\n\n if (element.groupId) element.groupId = groupIdMap[element.groupId]\n }\n slidesStore.addElement(elements)\n mainStore.setActiveElementIdList(Object.values(elIdMap))\n addHistorySnapshot()\n }\n\n /**\n * 添加指定的页面数据\n * @param slide 页面数据\n */\n const addSlidesFromData = (slides: Slide[]) => {\n const newSlides = slides.map(slide => {\n const { groupIdMap, elIdMap } = createElementIdMap(slide.elements)\n\n for (const element of slide.elements) {\n element.id = elIdMap[element.id]\n if (element.groupId) element.groupId = groupIdMap[element.groupId]\n }\n // 动画id替换\n if (slide.animations) {\n for (const animation of slide.animations) {\n animation.id = nanoid(10)\n animation.elId = elIdMap[animation.elId]\n }\n }\n return {\n ...slide,\n id: nanoid(10),\n }\n })\n slidesStore.addSlide(newSlides)\n addHistorySnapshot()\n }\n\n return {\n addElementsFromData,\n addSlidesFromData,\n }\n}","import { pasteCustomClipboardString } from '@/utils/clipboard'\nimport { parseText2Paragraphs } from '@/utils/textParser'\nimport useCreateElement from '@/hooks/useCreateElement'\nimport useAddSlidesOrElements from '@/hooks/useAddSlidesOrElements'\n\ninterface PasteTextClipboardDataOptions {\n onlySlide?: boolean\n onlyElements?: boolean\n}\n\nexport default () => {\n const { createTextElement } = useCreateElement()\n const { addElementsFromData, addSlidesFromData } = useAddSlidesOrElements()\n\n /**\n * 粘贴普通文本:创建为新的文本元素\n * @param text 文本\n */\n const createTextElementFromClipboard = (text: string) => {\n createTextElement({\n left: 0,\n top: 0,\n width: 600,\n height: 50,\n }, text)\n }\n\n /**\n * 解析剪贴板内容,根据解析结果选择合适的粘贴方式\n * @param text 剪贴板内容\n * @param options 配置项:onlySlide -- 仅处理页面粘贴;onlyElements -- 仅处理元素粘贴;\n */\n const pasteTextClipboardData = (text: string, options?: PasteTextClipboardDataOptions) => {\n const onlySlide = options?.onlySlide || false\n const onlyElements = options?.onlyElements || false\n\n const clipboardData = pasteCustomClipboardString(text)\n\n // 元素或页面\n if (typeof clipboardData === 'object') {\n const { type, data } = clipboardData\n\n if (type === 'elements' && !onlySlide) addElementsFromData(data)\n else if (type === 'slides' && !onlyElements) addSlidesFromData(data)\n }\n\n // 普通文本\n else if (!onlyElements && !onlySlide) {\n const string = parseText2Paragraphs(clipboardData)\n createTextElementFromClipboard(string)\n }\n }\n\n return {\n pasteTextClipboardData,\n }\n}","import { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { Slide } from '@/types/slides'\nimport { copyText, readClipboard } from '@/utils/clipboard'\nimport { encrypt } from '@/utils/crypto'\nimport { createElementIdMap } from '@/utils/element'\nimport { KEYS } from '@/configs/hotkey'\nimport { message } from 'ant-design-vue'\nimport usePasteTextClipboardData from '@/hooks/usePasteTextClipboardData'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport useAddSlidesOrElements from '@/hooks//useAddSlidesOrElements'\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { selectedSlidesIndex: _selectedSlidesIndex, activeElementIdList } = storeToRefs(mainStore)\n const { currentSlide, slides, theme, slideIndex } = storeToRefs(slidesStore)\n\n const selectedSlidesIndex = computed(() => [..._selectedSlidesIndex.value, slideIndex.value])\n const selectedSlides = computed(() => slides.value.filter((item, index) => selectedSlidesIndex.value.includes(index)))\n const selectedSlidesId = computed(() => selectedSlides.value.map(item => item.id))\n\n const { pasteTextClipboardData } = usePasteTextClipboardData()\n const { addSlidesFromData } = useAddSlidesOrElements()\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 重置幻灯片\n const resetSlides = () => {\n const emptySlide: Slide = {\n id: nanoid(10),\n elements: [],\n background: {\n type: 'solid',\n color: theme.value.backgroundColor,\n },\n }\n slidesStore.updateSlideIndex(0)\n mainStore.setActiveElementIdList([])\n slidesStore.setSlides([emptySlide])\n }\n\n /**\n * 移动页面焦点\n * @param command 移动页面焦点命令:上移、下移\n */\n const updateSlideIndex = (command: string) => {\n if (command === KEYS.UP && slideIndex.value > 0) {\n if (activeElementIdList.value.length) mainStore.setActiveElementIdList([])\n slidesStore.updateSlideIndex(slideIndex.value - 1)\n }\n else if (command === KEYS.DOWN && slideIndex.value < slides.value.length - 1) {\n if (activeElementIdList.value.length) mainStore.setActiveElementIdList([])\n slidesStore.updateSlideIndex(slideIndex.value + 1)\n }\n }\n\n // 将当前页面数据加密后复制到剪贴板\n const copySlide = () => {\n const text = encrypt(JSON.stringify({\n type: 'slides',\n data: selectedSlides.value,\n }))\n\n copyText(text).then(() => {\n mainStore.setThumbnailsFocus(true)\n })\n }\n\n // 尝试将剪贴板页面数据解密后添加到下一页(粘贴)\n const pasteSlide = () => {\n readClipboard().then(text => {\n pasteTextClipboardData(text, { onlySlide: true })\n }).catch(err => message.warning(err))\n }\n\n // 创建一页空白页并添加到下一页\n const createSlide = () => {\n const emptySlide: Slide = {\n id: nanoid(10),\n elements: [],\n background: {\n type: 'solid',\n color: theme.value.backgroundColor,\n },\n }\n mainStore.setActiveElementIdList([])\n slidesStore.addSlide(emptySlide)\n addHistorySnapshot()\n }\n\n // 根据模板创建新页面\n const createSlideByTemplate = (slide: Slide) => {\n const { groupIdMap, elIdMap } = createElementIdMap(slide.elements)\n\n for (const element of slide.elements) {\n element.id = elIdMap[element.id]\n if (element.groupId) element.groupId = groupIdMap[element.groupId]\n }\n const newSlide = {\n ...slide,\n id: nanoid(10),\n }\n mainStore.setActiveElementIdList([])\n slidesStore.addSlide(newSlide)\n addHistorySnapshot()\n }\n\n // 将当前页复制一份到下一页\n const copyAndPasteSlide = () => {\n const slide = JSON.parse(JSON.stringify(currentSlide.value))\n addSlidesFromData([slide])\n }\n\n // 删除当前页,若将删除全部页面,则执行重置幻灯片操作\n const deleteSlide = (targetSlidesId = selectedSlidesId.value) => {\n if (slides.value.length === targetSlidesId.length) resetSlides()\n else slidesStore.deleteSlide(targetSlidesId)\n\n mainStore.updateSelectedSlidesIndex([])\n\n addHistorySnapshot()\n }\n\n // 将当前页复制后删除(剪切)\n // 由于复制操作会导致多选状态消失,所以需要提前将需要删除的页面ID进行缓存\n const cutSlide = () => {\n const targetSlidesId = [...selectedSlidesId.value]\n copySlide()\n deleteSlide(targetSlidesId)\n }\n\n // 选中全部幻灯片\n const selectAllSlide = () => {\n const newSelectedSlidesIndex = Array.from(Array(slides.value.length), (item, index) => index)\n mainStore.setActiveElementIdList([])\n mainStore.updateSelectedSlidesIndex(newSelectedSlidesIndex)\n }\n\n return {\n resetSlides,\n updateSlideIndex,\n copySlide,\n pasteSlide,\n createSlide,\n createSlideByTemplate,\n copyAndPasteSlide,\n deleteSlide,\n cutSlide,\n selectAllSlide,\n }\n}","import { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { activeElementIdList } = storeToRefs(mainStore)\n const { currentSlide } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 锁定选中的元素,并清空选中元素状态\n const lockElement = () => {\n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\n \n for (const element of newElementList) {\n if (activeElementIdList.value.includes(element.id)) element.lock = true\n }\n slidesStore.updateSlide({ elements: newElementList })\n mainStore.setActiveElementIdList([])\n addHistorySnapshot()\n }\n\n /**\n * 解除元素的锁定状态,并将其设置为当前选择元素\n * @param handleElement 需要解锁的元素\n */\n const unlockElement = (handleElement: PPTElement) => {\n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\n\n if (handleElement.groupId) {\n const groupElementIdList = []\n for (const element of newElementList) {\n if (element.groupId === handleElement.groupId) {\n element.lock = false\n groupElementIdList.push(element.id)\n }\n }\n slidesStore.updateSlide({ elements: newElementList })\n mainStore.setActiveElementIdList(groupElementIdList)\n }\n else {\n for (const element of newElementList) {\n if (element.id === handleElement.id) {\n element.lock = false\n break\n }\n }\n slidesStore.updateSlide({ elements: newElementList })\n mainStore.setActiveElementIdList([handleElement.id])\n }\n addHistorySnapshot()\n }\n\n return {\n lockElement,\n unlockElement,\n }\n}","import { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { activeElementIdList, activeGroupElementId } = storeToRefs(mainStore)\n const { currentSlide } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 删除全部选中元素\n // 组合元素成员中,存在被选中可独立操作的元素时,优先删除该元素。否则默认删除所有被选中的元素\n const deleteElement = () => {\n if (!activeElementIdList.value.length) return\n\n let newElementList: PPTElement[] = []\n if (activeGroupElementId.value) {\n newElementList = currentSlide.value.elements.filter(el => el.id !== activeGroupElementId.value)\n }\n else {\n newElementList = currentSlide.value.elements.filter(el => !activeElementIdList.value.includes(el.id))\n }\n\n mainStore.setActiveElementIdList([])\n slidesStore.updateSlide({ elements: newElementList })\n addHistorySnapshot()\n }\n\n // 删除内面内全部元素(无论是否选中)\n const deleteAllElements = () => {\n if (!currentSlide.value.elements.length) return\n mainStore.setActiveElementIdList([])\n slidesStore.updateSlide({ elements: [] })\n addHistorySnapshot()\n }\n\n return {\n deleteElement,\n deleteAllElements,\n }\n}","import { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { activeElementIdList, activeElementList, handleElementId } = storeToRefs(mainStore)\n const { currentSlide } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n /**\n * 判断当前选中的元素是否可以组合\n */\n const canCombine = computed(() => {\n if (activeElementList.value.length < 2) return false\n\n const firstGroupId = activeElementList.value[0].groupId\n if (!firstGroupId) return true\n\n const inSameGroup = activeElementList.value.every(el => (el.groupId && el.groupId) === firstGroupId)\n return !inSameGroup\n })\n\n /**\n * 组合当前选中的元素:给当前选中的元素赋予一个相同的分组ID\n */\n const combineElements = () => {\n if (!activeElementList.value.length) return\n\n // 生成一个新元素列表进行后续操作\n let newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\n\n // 生成分组ID\n const groupId = nanoid(10)\n\n // 收集需要组合的元素列表,并赋上唯一分组ID\n const combineElementList: PPTElement[] = []\n for (const element of newElementList) {\n if (activeElementIdList.value.includes(element.id)) {\n element.groupId = groupId\n combineElementList.push(element)\n }\n }\n\n // 确保该组合内所有元素成员的层级是连续的,具体操作方法为:\n // 先获取到该组合内最上层元素的层级,将本次需要组合的元素从新元素列表中移除,\n // 再根据最上层元素的层级位置,将上面收集到的需要组合的元素列表一起插入到新元素列表中合适的位置\n const combineElementMaxLevel = newElementList.findIndex(_element => _element.id === combineElementList[combineElementList.length - 1].id)\n const combineElementIdList = combineElementList.map(_element => _element.id)\n newElementList = newElementList.filter(_element => !combineElementIdList.includes(_element.id))\n\n const insertLevel = combineElementMaxLevel - combineElementList.length + 1\n newElementList.splice(insertLevel, 0, ...combineElementList)\n\n slidesStore.updateSlide({ elements: newElementList })\n addHistorySnapshot()\n }\n\n /**\n * 取消组合元素:移除选中元素的分组ID\n */\n const uncombineElements = () => {\n if (!activeElementList.value.length) return\n const hasElementInGroup = activeElementList.value.some(item => item.groupId)\n if (!hasElementInGroup) return\n \n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\n for (const element of newElementList) {\n if (activeElementIdList.value.includes(element.id) && element.groupId) delete element.groupId\n }\n slidesStore.updateSlide({ elements: newElementList })\n\n // 取消组合后,需要重置激活元素状态\n // 默认重置为当前正在操作的元素,如果不存在则重置为空\n const handleElementIdList = handleElementId.value ? [handleElementId.value] : []\n mainStore.setActiveElementIdList(handleElementIdList)\n\n addHistorySnapshot()\n }\n\n return {\n canCombine,\n combineElements,\n uncombineElements,\n }\n}","import { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { copyText, readClipboard } from '@/utils/clipboard'\nimport { encrypt } from '@/utils/crypto'\nimport { message } from 'ant-design-vue'\nimport usePasteTextClipboardData from '@/hooks/usePasteTextClipboardData'\nimport useDeleteElement from './useDeleteElement'\n\nexport default () => {\n const mainStore = useMainStore()\n const { activeElementIdList, activeElementList } = storeToRefs(mainStore)\n\n const { pasteTextClipboardData } = usePasteTextClipboardData()\n const { deleteElement } = useDeleteElement()\n\n // 将选中元素数据加密后复制到剪贴板\n const copyElement = () => {\n if (!activeElementIdList.value.length) return\n\n const text = encrypt(JSON.stringify({\n type: 'elements',\n data: activeElementList.value,\n }))\n\n copyText(text).then(() => {\n mainStore.setEditorareaFocus(true)\n })\n }\n\n // 将选中元素复制后删除(剪切)\n const cutElement = () => {\n copyElement()\n deleteElement()\n }\n\n // 尝试将剪贴板元素数据解密后进行粘贴\n const pasteElement = () => {\n readClipboard().then(text => {\n pasteTextClipboardData(text)\n }).catch(err => message.warning(err))\n }\n\n // 将选中元素复制后立刻粘贴\n const quickCopyElement = () => {\n copyElement()\n pasteElement()\n }\n\n return {\n copyElement,\n cutElement,\n pasteElement,\n quickCopyElement,\n }\n}","import { storeToRefs } from 'pinia'\r\nimport { useMainStore, useSlidesStore } from '@/store'\r\n\r\nexport default () => {\r\n const mainStore = useMainStore()\r\n const { currentSlide } = storeToRefs(useSlidesStore())\r\n\r\n // 将当前页面全部元素设置为被选择状态\r\n const selectAllElement = () => {\r\n const unlockedElements = currentSlide.value.elements.filter(el => !el.lock)\r\n const newActiveElementIdList = unlockedElements.map(el => el.id)\r\n mainStore.setActiveElementIdList(newActiveElementIdList)\r\n }\r\n\r\n return {\r\n selectAllElement,\r\n }\r\n}","import { storeToRefs } from 'pinia'\r\nimport { useMainStore, useSlidesStore } from '@/store'\r\nimport { PPTElement } from '@/types/slides'\r\nimport { KEYS } from '@/configs/hotkey'\r\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\r\n\r\nexport default () => {\r\n const slidesStore = useSlidesStore()\r\n const { activeElementIdList, activeGroupElementId } = storeToRefs(useMainStore())\r\n const { currentSlide } = storeToRefs(slidesStore)\r\n\r\n const { addHistorySnapshot } = useHistorySnapshot()\r\n\r\n /**\r\n * 将元素向指定方向移动指定的距离\r\n * 组合元素成员中,存在被选中可独立操作的元素时,优先移动该元素。否则默认移动所有被选中的元素\r\n * @param command 移动方向\r\n * @param step 移动距离\r\n */\r\n const moveElement = (command: string, step = 1) => {\r\n let newElementList: PPTElement[] = []\r\n\r\n const move = (el: PPTElement) => {\r\n let { left, top } = el\r\n switch (command) {\r\n case KEYS.LEFT: \r\n left = left - step\r\n break\r\n case KEYS.RIGHT: \r\n left = left + step\r\n break\r\n case KEYS.UP: \r\n top = top - step\r\n break\r\n case KEYS.DOWN: \r\n top = top + step\r\n break\r\n default: break\r\n }\r\n return { ...el, left, top }\r\n }\r\n\r\n if (activeGroupElementId.value) {\r\n newElementList = currentSlide.value.elements.map(el => {\r\n return activeGroupElementId.value === el.id ? move(el) : el\r\n })\r\n }\r\n else {\r\n newElementList = currentSlide.value.elements.map(el => {\r\n return activeElementIdList.value.includes(el.id) ? move(el) : el\r\n })\r\n }\r\n\r\n slidesStore.updateSlide({ elements: newElementList })\r\n addHistorySnapshot()\r\n }\r\n\r\n return {\r\n moveElement,\r\n }\r\n}","import { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { ElementOrderCommands } from '@/types/edit'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default () => {\n const slidesStore = useSlidesStore()\n const { currentSlide } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n /**\n * 获取组合元素层级范围\n * @param elementList 本页所有元素列表\n * @param combineElementList 组合元素列表\n */\n const getCombineElementLevelRange = (elementList: PPTElement[], combineElementList: PPTElement[]) => {\n return {\n minLevel: elementList.findIndex(_element => _element.id === combineElementList[0].id),\n maxLevel: elementList.findIndex(_element => _element.id === combineElementList[combineElementList.length - 1].id),\n }\n }\n\n /**\n * 上移一层\n * @param elementList 本页所有元素列表\n * @param element 当前操作的元素\n */\n const moveUpElement = (elementList: PPTElement[], element: PPTElement) => {\n const copyOfElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList))\n\n // 如果被操作的元素是组合元素成员,需要将该组合全部成员一起进行移动\n if (element.groupId) {\n\n // 获取到该组合全部成员,以及所有成员的层级范围\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === element.groupId)\n const { minLevel, maxLevel } = getCombineElementLevelRange(elementList, combineElementList)\n\n // 已经处在顶层,无法继续移动\n if (maxLevel === elementList.length - 1) return\n\n // 通过组合成员范围的最大值,获取到该组合上一层的元素,然后将该组合元素从元素列表中移除(并缓存被移除的元素列表)\n // 若上层元素处在另一个组合中,则将上述被移除的组合元素插入到该上层组合上方\n // 若上层元素不处于任何分组中,则将上述被移除的组合元素插入到该上层元素上方\n const nextElement = copyOfElementList[maxLevel + 1]\n const movedElementList = copyOfElementList.splice(minLevel, combineElementList.length)\n\n if (nextElement.groupId) {\n const nextCombineElementList = copyOfElementList.filter(_element => _element.groupId === nextElement.groupId)\n copyOfElementList.splice(minLevel + nextCombineElementList.length, 0, ...movedElementList)\n }\n else copyOfElementList.splice(minLevel + 1, 0, ...movedElementList)\n }\n\n // 如果被操作的元素不是组合元素成员\n else {\n\n // 获取该元素在列表中的层级\n const level = elementList.findIndex(item => item.id === element.id)\n\n // 已经处在顶层,无法继续移动\n if (level === elementList.length - 1) return\n\n // 获取到该组合上一层的元素,然后将该组合元素从元素列表中移除(并缓存被移除的元素列表)\n const nextElement = copyOfElementList[level + 1]\n const movedElement = copyOfElementList.splice(level, 1)[0]\n\n // 通过组合成员范围的最大值,获取到该组合上一层的元素,然后将该组合元素从元素列表中移除(并缓存被移除的元素列表)\n // 若上层元素处在另一个组合中,则将上述被移除的组合元素插入到该上层组合上方\n // 若上层元素不处于任何分组中,则将上述被移除的组合元素插入到该上层元素上方\n if (nextElement.groupId) {\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === nextElement.groupId)\n copyOfElementList.splice(level + combineElementList.length, 0, movedElement)\n }\n else copyOfElementList.splice(level + 1, 0, movedElement)\n }\n\n return copyOfElementList\n }\n\n /**\n * 下移一层,操作方式同上移\n * @param elementList 本页所有元素列表\n * @param element 当前操作的元素\n */\n const moveDownElement = (elementList: PPTElement[], element: PPTElement) => {\n const copyOfElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList))\n\n if (element.groupId) {\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === element.groupId)\n const { minLevel } = getCombineElementLevelRange(elementList, combineElementList)\n if (minLevel === 0) return\n\n const prevElement = copyOfElementList[minLevel - 1]\n const movedElementList = copyOfElementList.splice(minLevel, combineElementList.length)\n\n if (prevElement.groupId) {\n const prevCombineElementList = copyOfElementList.filter(_element => _element.groupId === prevElement.groupId)\n copyOfElementList.splice(minLevel - prevCombineElementList.length, 0, ...movedElementList)\n }\n else copyOfElementList.splice(minLevel - 1, 0, ...movedElementList)\n }\n\n else {\n const level = elementList.findIndex(item => item.id === element.id)\n if (level === 0) return\n\n const prevElement = copyOfElementList[level - 1]\n const movedElement = copyOfElementList.splice(level, 1)[0]\n\n if (prevElement.groupId) {\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === prevElement.groupId)\n copyOfElementList.splice(level - combineElementList.length, 0, movedElement)\n }\n else copyOfElementList.splice(level - 1, 0, movedElement)\n }\n\n return copyOfElementList\n }\n\n /**\n * 置顶层\n * @param elementList 本页所有元素列表\n * @param element 当前操作的元素\n */\n const moveTopElement = (elementList: PPTElement[], element: PPTElement) => {\n const copyOfElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList))\n\n // 如果被操作的元素是组合元素成员,需要将该组合全部成员一起进行移动\n if (element.groupId) {\n\n // 获取到该组合全部成员,以及所有成员的层级范围\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === element.groupId)\n const { minLevel, maxLevel } = getCombineElementLevelRange(elementList, combineElementList)\n\n // 已经处在顶层,无法继续移动\n if (maxLevel === elementList.length - 1) return null\n\n // 将该组合元素从元素列表中移除,然后将被移除的元素添加到元素列表顶部\n const movedElementList = copyOfElementList.splice(minLevel, combineElementList.length)\n copyOfElementList.push(...movedElementList)\n }\n\n // 如果被操作的元素不是组合元素成员\n else {\n\n // 获取该元素在列表中的层级\n const level = elementList.findIndex(item => item.id === element.id)\n\n // 已经处在顶层,无法继续移动\n if (level === elementList.length - 1) return null\n\n // 将该组合元素从元素列表中移除,然后将被移除的元素添加到元素列表底部\n copyOfElementList.splice(level, 1)\n copyOfElementList.push(element)\n }\n\n return copyOfElementList\n }\n\n /**\n * 置底层,操作方式同置顶\n * @param elementList 本页所有元素列表\n * @param element 当前操作的元素\n */\n const moveBottomElement = (elementList: PPTElement[], element: PPTElement) => {\n const copyOfElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList))\n\n if (element.groupId) {\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === element.groupId)\n const { minLevel } = getCombineElementLevelRange(elementList, combineElementList)\n if (minLevel === 0) return\n\n const movedElementList = copyOfElementList.splice(minLevel, combineElementList.length)\n copyOfElementList.unshift(...movedElementList)\n }\n\n else {\n const level = elementList.findIndex(item => item.id === element.id)\n if (level === 0) return\n\n copyOfElementList.splice(level, 1)\n copyOfElementList.unshift(element)\n }\n\n return copyOfElementList\n }\n\n /**\n * 调整元素层级\n * @param element 需要调整层级的元素\n * @param command 调整命令:上移、下移、置顶、置底\n */\n const orderElement = (element: PPTElement, command: ElementOrderCommands) => {\n let newElementList\n \n if (command === ElementOrderCommands.UP) newElementList = moveUpElement(currentSlide.value.elements, element)\n else if (command === ElementOrderCommands.DOWN) newElementList = moveDownElement(currentSlide.value.elements, element)\n else if (command === ElementOrderCommands.TOP) newElementList = moveTopElement(currentSlide.value.elements, element)\n else if (command === ElementOrderCommands.BOTTOM) newElementList = moveBottomElement(currentSlide.value.elements, element)\n\n if (!newElementList) return\n\n slidesStore.updateSlide({ elements: newElementList })\n addHistorySnapshot()\n }\n\n return {\n orderElement,\n }\n}","// 进入全屏\nexport const enterFullscreen = () => {\n const docElm = document.documentElement\n if (docElm.requestFullscreen) docElm.requestFullscreen() \n else if (docElm.mozRequestFullScreen) docElm.mozRequestFullScreen() \n else if (docElm.webkitRequestFullScreen) docElm.webkitRequestFullScreen()\n else if (docElm.msRequestFullscreen) docElm.msRequestFullscreen()\n}\n\n// 退出全屏\nexport const exitFullscreen = () => {\n if (document.exitFullscreen) document.exitFullscreen()\n else if (document.mozCancelFullScreen) document.mozCancelFullScreen()\n else if (document.webkitExitFullscreen) document.webkitExitFullscreen()\n else if (document.msExitFullscreen) document.msExitFullscreen()\n}\n\n// 判断是否全屏\nexport const isFullscreen = () => {\n const fullscreenElement = \n document.fullscreenElement ||\n document.mozFullScreenElement ||\n document.webkitFullscreenElement ||\n document.msFullscreenElement ||\n document.webkitCurrentFullScreenElement\n return !!fullscreenElement\n}","import { useScreenStore, useSlidesStore } from '@/store'\nimport { enterFullscreen, exitFullscreen, isFullscreen } from '@/utils/fullscreen'\n\nexport default () => {\n const screenStore = useScreenStore()\n const slidesStore = useSlidesStore()\n\n // 进入放映状态(从当前页开始)\n const enterScreening = () => {\n enterFullscreen()\n screenStore.setScreening(true)\n }\n\n // 进入放映状态(从第一页开始)\n const enterScreeningFromStart = () => {\n slidesStore.updateSlideIndex(0)\n enterScreening()\n }\n\n // 退出放映状态\n const exitScreening = () => {\n screenStore.setScreening(false)\n if (isFullscreen()) exitFullscreen()\n }\n\n return {\n enterScreening,\n enterScreeningFromStart,\n exitScreening,\n }\n}","import { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\n\nexport default () => {\n const mainStore = useMainStore()\n const { canvasPercentage, canvasScale, canvasDragged } = storeToRefs(mainStore)\n\n const canvasScalePercentage = computed(() => Math.round(canvasScale.value * 100) + '%')\n\n /**\n * 缩放画布百分比\n * @param command 缩放命令:放大、缩小\n */\n const scaleCanvas = (command: '+' | '-') => {\n let percentage = canvasPercentage.value\n const step = 5\n const max = 200\n const min = 30\n if (command === '+' && percentage <= max) percentage += step\n if (command === '-' && percentage >= min) percentage -= step\n\n mainStore.setCanvasPercentage(percentage)\n }\n\n /**\n * 设置画布缩放比例\n * 但不是直接设置该值,而是通过设置画布可视区域百分比来动态计算\n * @param value 目标画布缩放比例\n */\n const setCanvasScalePercentage = (value: number) => {\n const percentage = Math.round(value / canvasScale.value * canvasPercentage.value) / 100\n mainStore.setCanvasPercentage(percentage)\n }\n\n /**\n * 重置画布尺寸和位置\n */\n const resetCanvas = () => {\n mainStore.setCanvasPercentage(90)\n if (canvasDragged) mainStore.setCanvasDragged(false)\n }\n\n return {\n canvasScalePercentage,\n setCanvasScalePercentage,\n scaleCanvas,\n resetCanvas,\n }\n}","import { onMounted, onUnmounted } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore, useKeyboardStore } from '@/store'\nimport { ElementOrderCommands } from '@/types/edit'\nimport { KEYS } from '@/configs/hotkey'\n\nimport useSlideHandler from './useSlideHandler'\nimport useLockElement from './useLockElement'\nimport useDeleteElement from './useDeleteElement'\nimport useCombineElement from './useCombineElement'\nimport useCopyAndPasteElement from './useCopyAndPasteElement'\nimport useSelectAllElement from './useSelectAllElement'\nimport useMoveElement from './useMoveElement'\nimport useOrderElement from './useOrderElement'\nimport useHistorySnapshot from './useHistorySnapshot'\nimport useScreening from './useScreening'\nimport useScaleCanvas from './useScaleCanvas'\n\nexport default () => {\n const mainStore = useMainStore()\n const keyboardStore = useKeyboardStore()\n const {\n activeElementIdList,\n disableHotkeys,\n handleElement,\n handleElementId,\n editorAreaFocus,\n thumbnailsFocus,\n } = storeToRefs(mainStore)\n const { currentSlide } = storeToRefs(useSlidesStore())\n const { ctrlKeyState, shiftKeyState, spaceKeyState } = storeToRefs(keyboardStore)\n\n const {\n updateSlideIndex,\n copySlide,\n createSlide,\n deleteSlide,\n cutSlide,\n copyAndPasteSlide,\n selectAllSlide,\n } = useSlideHandler()\n\n const { combineElements, uncombineElements } = useCombineElement()\n const { deleteElement } = useDeleteElement()\n const { lockElement } = useLockElement()\n const { copyElement, cutElement, quickCopyElement } = useCopyAndPasteElement()\n const { selectAllElement } = useSelectAllElement()\n const { moveElement } = useMoveElement()\n const { orderElement } = useOrderElement()\n const { redo, undo } = useHistorySnapshot()\n const { enterScreening, enterScreeningFromStart } = useScreening()\n const { scaleCanvas, resetCanvas } = useScaleCanvas()\n\n const copy = () => {\n if (activeElementIdList.value.length) copyElement()\n else if (thumbnailsFocus.value) copySlide()\n }\n\n const cut = () => {\n if (activeElementIdList.value.length) cutElement()\n else if (thumbnailsFocus.value) cutSlide()\n }\n\n const quickCopy = () => {\n if (activeElementIdList.value.length) quickCopyElement()\n else if (thumbnailsFocus.value) copyAndPasteSlide()\n }\n\n const selectAll = () => {\n if (editorAreaFocus.value) selectAllElement()\n if (thumbnailsFocus.value) selectAllSlide()\n }\n\n const lock = () => {\n if (!editorAreaFocus.value) return\n lockElement()\n }\n const combine = () => {\n if (!editorAreaFocus.value) return\n combineElements()\n }\n\n const uncombine = () => {\n if (!editorAreaFocus.value) return\n uncombineElements()\n }\n\n const remove = () => {\n if (activeElementIdList.value.length) deleteElement()\n else if (thumbnailsFocus.value) deleteSlide()\n }\n\n const move = (key: string) => {\n if (activeElementIdList.value.length) moveElement(key)\n else if (key === KEYS.UP || key === KEYS.DOWN) updateSlideIndex(key)\n }\n\n const moveSlide = (key: string) => {\n if (key === KEYS.PAGEUP) updateSlideIndex(KEYS.UP)\n else if (key === KEYS.PAGEDOWN) updateSlideIndex(KEYS.DOWN)\n }\n\n const order = (command: ElementOrderCommands) => {\n if (!handleElement.value) return\n orderElement(handleElement.value, command)\n }\n\n const create = () => {\n if (!thumbnailsFocus.value) return\n createSlide()\n }\n\n const tabActiveElement = () => {\n if (!currentSlide.value.elements.length) return\n if (!handleElementId.value) {\n const firstElement = currentSlide.value.elements[0]\n mainStore.setActiveElementIdList([firstElement.id])\n return\n }\n const currentIndex = currentSlide.value.elements.findIndex(el => el.id === handleElementId.value)\n const nextIndex = currentIndex >= currentSlide.value.elements.length - 1 ? 0 : currentIndex + 1\n const nextElementId = currentSlide.value.elements[nextIndex].id\n\n mainStore.setActiveElementIdList([nextElementId])\n }\n\n const keydownListener = (e: KeyboardEvent) => {\n const { ctrlKey, shiftKey, altKey, metaKey } = e\n const ctrlOrMetaKeyActive = ctrlKey || metaKey\n \n const key = e.key.toUpperCase()\n\n if (ctrlOrMetaKeyActive && !ctrlKeyState.value) keyboardStore.setCtrlKeyState(true)\n if (shiftKey && !shiftKeyState.value) keyboardStore.setShiftKeyState(true)\n if (!disableHotkeys.value && key === KEYS.SPACE) keyboardStore.setSpaceKeyState(true)\n\n \n if (ctrlOrMetaKeyActive && key === KEYS.P) {\n e.preventDefault()\n mainStore.setDialogForExport('pdf')\n return\n }\n if (shiftKey && key === KEYS.F5) {\n e.preventDefault()\n enterScreening()\n keyboardStore.setShiftKeyState(false)\n return\n }\n if (key === KEYS.F5) {\n e.preventDefault()\n enterScreeningFromStart()\n return\n }\n \n if (!editorAreaFocus.value && !thumbnailsFocus.value) return \n\n if (ctrlOrMetaKeyActive && key === KEYS.C) {\n if (disableHotkeys.value) return\n e.preventDefault()\n copy()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.X) {\n if (disableHotkeys.value) return\n e.preventDefault()\n cut()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.D) {\n if (disableHotkeys.value) return\n e.preventDefault()\n quickCopy()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.Z) {\n if (disableHotkeys.value) return\n e.preventDefault()\n undo()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.Y) {\n if (disableHotkeys.value) return\n e.preventDefault()\n redo()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.A) {\n if (disableHotkeys.value) return\n e.preventDefault()\n selectAll()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.L) {\n if (disableHotkeys.value) return\n e.preventDefault()\n lock()\n }\n if (!shiftKey && ctrlOrMetaKeyActive && key === KEYS.G) {\n if (disableHotkeys.value) return\n e.preventDefault()\n combine()\n }\n if (shiftKey && ctrlOrMetaKeyActive && key === KEYS.G) {\n if (disableHotkeys.value) return\n e.preventDefault()\n uncombine()\n }\n if (altKey && key === KEYS.F) {\n if (disableHotkeys.value) return\n e.preventDefault()\n order(ElementOrderCommands.TOP)\n }\n if (altKey && key === KEYS.B) {\n if (disableHotkeys.value) return\n e.preventDefault()\n order(ElementOrderCommands.BOTTOM)\n }\n if (key === KEYS.DELETE || key === KEYS.BACKSPACE) {\n if (disableHotkeys.value) return\n e.preventDefault()\n remove()\n }\n if (key === KEYS.UP) {\n if (disableHotkeys.value) return\n e.preventDefault()\n move(KEYS.UP)\n }\n if (key === KEYS.DOWN) {\n if (disableHotkeys.value) return\n e.preventDefault()\n move(KEYS.DOWN)\n }\n if (key === KEYS.LEFT) {\n if (disableHotkeys.value) return\n e.preventDefault()\n move(KEYS.LEFT)\n }\n if (key === KEYS.RIGHT) {\n if (disableHotkeys.value) return\n e.preventDefault()\n move(KEYS.RIGHT)\n }\n if (key === KEYS.PAGEUP) {\n if (disableHotkeys.value) return\n e.preventDefault()\n moveSlide(KEYS.PAGEUP)\n }\n if (key === KEYS.PAGEDOWN) {\n if (disableHotkeys.value) return\n e.preventDefault()\n moveSlide(KEYS.PAGEDOWN)\n }\n if (key === KEYS.ENTER) {\n if (disableHotkeys.value) return\n e.preventDefault()\n create()\n }\n if (key === KEYS.MINUS) {\n if (disableHotkeys.value) return\n e.preventDefault()\n scaleCanvas('-')\n }\n if (key === KEYS.EQUAL) {\n if (disableHotkeys.value) return\n e.preventDefault()\n scaleCanvas('+')\n }\n if (key === KEYS.DIGIT_0) {\n if (disableHotkeys.value) return\n e.preventDefault()\n resetCanvas()\n }\n if (key === KEYS.TAB) {\n if (disableHotkeys.value) return\n e.preventDefault()\n tabActiveElement()\n }\n }\n \n const keyupListener = () => {\n if (ctrlKeyState.value) keyboardStore.setCtrlKeyState(false)\n if (shiftKeyState.value) keyboardStore.setShiftKeyState(false)\n if (spaceKeyState.value) keyboardStore.setSpaceKeyState(false)\n }\n\n onMounted(() => {\n document.addEventListener('keydown', keydownListener)\n document.addEventListener('keyup', keyupListener)\n window.addEventListener('blur', keyupListener)\n })\n onUnmounted(() => {\n document.removeEventListener('keydown', keydownListener)\n document.removeEventListener('keyup', keyupListener)\n window.removeEventListener('blur', keyupListener)\n })\n}","import { onMounted, onUnmounted } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { getImageDataURL } from '@/utils/image'\nimport usePasteTextClipboardData from './usePasteTextClipboardData'\nimport useCreateElement from './useCreateElement'\n\nexport default () => {\n const { editorAreaFocus, thumbnailsFocus, disableHotkeys } = storeToRefs(useMainStore())\n\n const { pasteTextClipboardData } = usePasteTextClipboardData()\n const { createImageElement } = useCreateElement()\n\n // 粘贴图片到幻灯片元素\n const pasteImageFile = (imageFile: File) => {\n getImageDataURL(imageFile).then(dataURL => createImageElement(dataURL))\n }\n\n /**\n * 粘贴事件监听\n * @param e ClipboardEvent\n */\n const pasteListener = (e: ClipboardEvent) => {\n if (!editorAreaFocus.value && !thumbnailsFocus.value) return\n if (disableHotkeys.value) return\n\n if (!e.clipboardData) return\n\n const clipboardDataItems = e.clipboardData.items\n const clipboardDataFirstItem = clipboardDataItems[0]\n\n if (!clipboardDataFirstItem) return\n\n // 如果剪贴板内有图片,优先尝试读取图片\n for (const item of clipboardDataItems) {\n if (item.kind === 'file' && item.type.indexOf('image') !== -1) {\n const imageFile = item.getAsFile()\n if (imageFile) pasteImageFile(imageFile)\n return\n }\n }\n \n // 如果剪贴板内没有图片,但有文字内容,尝试解析文字内容\n if (clipboardDataFirstItem.kind === 'string' && clipboardDataFirstItem.type === 'text/plain') {\n clipboardDataFirstItem.getAsString(text => pasteTextClipboardData(text))\n }\n }\n\n onMounted(() => {\n document.addEventListener('paste', pasteListener)\n })\n onUnmounted(() => {\n document.removeEventListener('paste', pasteListener)\n })\n}","export const childlessTags = ['style', 'script', 'template']\n\nexport const closingTags = ['html', 'head', 'body', 'p', 'dt', 'dd', 'li', 'option', 'thead', 'th', 'tbody', 'tr', 'td', 'tfoot', 'colgroup']\n\nexport const closingTagAncestorBreakers = {\n li: ['ul', 'ol', 'menu'],\n dt: ['dl'],\n dd: ['dl'],\n tbody: ['table'],\n thead: ['table'],\n tfoot: ['table'],\n tr: ['table'],\n td: ['table'],\n}\n\nexport const voidTags = ['!doctype', 'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']","import { startsWith, endsWith } from 'lodash'\nimport { Token } from './types'\nimport { childlessTags } from './tags'\n\ninterface State {\n str: string\n position: number\n tokens: Token[]\n}\n\nconst jumpPosition = (state: State, end: number) => {\n const len = end - state.position\n movePositopn(state, len)\n}\n\nconst movePositopn = (state: State, len: number) => {\n state.position = state.position + len\n}\n\nconst findTextEnd = (str: string, index: number) => {\n const isEnd = false\n while (!isEnd) {\n const textEnd = str.indexOf('<', index)\n if (textEnd === -1) {\n return textEnd\n }\n const char = str.charAt(textEnd + 1)\n if (char === '/' || char === '!' || /[A-Za-z0-9]/.test(char)) {\n return textEnd\n }\n index = textEnd + 1\n }\n return -1\n}\n\nconst lexText = (state: State) => {\n const { str } = state\n let textEnd = findTextEnd(str, state.position)\n if (textEnd === state.position) return\n if (textEnd === -1) {\n textEnd = str.length\n }\n\n const content = str.slice(state.position, textEnd)\n jumpPosition(state, textEnd)\n\n state.tokens.push({\n type: 'text', \n content, \n })\n}\n\nconst lexComment = (state: State) => {\n const { str } = state\n\n movePositopn(state, 4)\n let contentEnd = str.indexOf('-->', state.position)\n let commentEnd = contentEnd + 3\n if (contentEnd === -1) {\n contentEnd = commentEnd = str.length\n }\n\n const content = str.slice(state.position, contentEnd)\n jumpPosition(state, commentEnd)\n\n state.tokens.push({\n type: 'comment',\n content,\n })\n}\n\nconst lexTagName = (state: State) => {\n const { str } = state\n const len = str.length\n let start = state.position\n\n while (start < len) {\n const char = str.charAt(start)\n const isTagChar = !(/\\s/.test(char) || char === '/' || char === '>')\n if (isTagChar) break\n start++\n }\n\n let end = start + 1\n while (end < len) {\n const char = str.charAt(end)\n const isTagChar = !(/\\s/.test(char) || char === '/' || char === '>')\n if (!isTagChar) break\n end++\n }\n\n jumpPosition(state, end)\n const tagName = str.slice(start, end)\n state.tokens.push({\n type: 'tag',\n content: tagName\n })\n return tagName\n}\n\nconst lexTagAttributes = (state: State) => {\n const { str, tokens } = state\n let cursor = state.position\n let quote = null\n let wordBegin = cursor\n const words = []\n const len = str.length\n while (cursor < len) {\n const char = str.charAt(cursor)\n if (quote) {\n const isQuoteEnd = char === quote\n if (isQuoteEnd) quote = null\n cursor++\n continue\n }\n\n const isTagEnd = char === '/' || char === '>'\n if (isTagEnd) {\n if (cursor !== wordBegin) words.push(str.slice(wordBegin, cursor))\n break\n }\n\n const isWordEnd = /\\s/.test(char)\n if (isWordEnd) {\n if (cursor !== wordBegin) words.push(str.slice(wordBegin, cursor))\n wordBegin = cursor + 1\n cursor++\n continue\n }\n\n const isQuoteStart = char === '\\'' || char === '\"'\n if (isQuoteStart) {\n quote = char\n cursor++\n continue\n }\n\n cursor++\n }\n jumpPosition(state, cursor)\n\n const type = 'attribute'\n for (let i = 0; i < words.length; i++) {\n const word = words[i]\n\n const isNotPair = word.indexOf('=') === -1\n if (isNotPair) {\n const secondWord = words[i + 1]\n if (secondWord && startsWith(secondWord, '=')) {\n if (secondWord.length > 1) {\n const newWord = word + secondWord\n tokens.push({ type, content: newWord })\n i += 1\n continue\n }\n const thirdWord = words[i + 2]\n i += 1\n if (thirdWord) {\n const newWord = word + '=' + thirdWord\n tokens.push({ type, content: newWord })\n i += 1\n continue\n }\n }\n }\n if (endsWith(word, '=')) {\n const secondWord = words[i + 1]\n if (secondWord && secondWord.indexOf('=') === -1) {\n const newWord = word + secondWord\n tokens.push({ type, content: newWord })\n i += 1\n continue\n }\n\n const newWord = word.slice(0, -1)\n tokens.push({ type, content: newWord })\n continue\n }\n\n tokens.push({ type, content: word })\n }\n}\n\nconst lexSkipTag = (tagName: string, state: State) => {\n const { str, tokens } = state\n const safeTagName = tagName.toLowerCase()\n const len = str.length\n let index = state.position\n \n while (index < len) {\n const nextTag = str.indexOf(' {\n const { str } = state\n const secondChar = str.charAt(state.position + 1)\n const tagStartClose = secondChar === '/'\n movePositopn(state, tagStartClose ? 2 : 1)\n state.tokens.push({\n type: 'tag-start',\n close: tagStartClose,\n })\n\n const tagName = lexTagName(state)\n lexTagAttributes(state)\n\n const firstChar = str.charAt(state.position)\n const tagEndClose = firstChar === '/'\n movePositopn(state, tagEndClose ? 2 : 1)\n state.tokens.push({\n type: 'tag-end',\n close: tagEndClose,\n })\n return tagName\n}\n\nconst lex = (state: State) => {\n const str = state.str\n const len = str.length\n\n while (state.position < len) {\n const start = state.position\n lexText(state)\n\n if (state.position === start) {\n const isComment = startsWith(str, '!--', start + 1)\n if (isComment) lexComment(state)\n else {\n const tagName = lexTag(state)\n const safeTag = tagName.toLowerCase()\n if (childlessTags.includes(safeTag)) lexSkipTag(tagName, state)\n }\n }\n }\n}\n\nexport const lexer = (str: string): Token[] => {\n const state = {\n str,\n position: 0,\n tokens: [],\n }\n lex(state)\n return state.tokens\n}","import { Token, HTMLNode, TagToken, NormalElement, TagEndToken, AttributeToken, TextToken } from './types'\nimport { closingTags, closingTagAncestorBreakers, voidTags } from './tags'\n\ninterface StackItem {\n tagName: string | null\n children: HTMLNode[]\n}\n\ninterface State {\n stack: StackItem[]\n cursor: number\n tokens: Token[]\n}\n\nexport const parser = (tokens: Token[]) => {\n const root: StackItem = { tagName: null, children: [] }\n const state: State = { tokens, cursor: 0, stack: [root] }\n parse(state)\n return root.children\n}\n\nexport const hasTerminalParent = (tagName: string, stack: StackItem[]) => {\n const tagParents = closingTagAncestorBreakers[tagName]\n if (tagParents) {\n let currentIndex = stack.length - 1\n while (currentIndex >= 0) {\n const parentTagName = stack[currentIndex].tagName\n if (parentTagName === tagName) break\n if (tagParents.includes(parentTagName)) return true\n currentIndex--\n }\n }\n return false\n}\n\nexport const rewindStack = (stack: StackItem[], newLength: number) => {\n stack.splice(newLength)\n}\n\nexport const parse = (state: State) => {\n const { stack, tokens } = state\n let { cursor } = state\n let nodes = stack[stack.length - 1].children\n const len = tokens.length\n \n while (cursor < len) {\n const token = tokens[cursor]\n if (token.type !== 'tag-start') {\n nodes.push(token as TextToken)\n cursor++\n continue\n }\n\n const tagToken = tokens[++cursor] as TagToken\n cursor++\n const tagName = tagToken.content.toLowerCase()\n if (token.close) {\n let index = stack.length\n let shouldRewind = false\n while (--index > -1) {\n if (stack[index].tagName === tagName) {\n shouldRewind = true\n break\n }\n }\n while (cursor < len) {\n if (tokens[cursor].type !== 'tag-end') break\n cursor++\n }\n if (shouldRewind) {\n rewindStack(stack, index)\n break\n } \n else continue\n }\n\n const isClosingTag = closingTags.includes(tagName)\n let shouldRewindToAutoClose = isClosingTag\n if (shouldRewindToAutoClose) {\n shouldRewindToAutoClose = !hasTerminalParent(tagName, stack)\n }\n\n if (shouldRewindToAutoClose) {\n let currentIndex = stack.length - 1\n while (currentIndex > 0) {\n if (tagName === stack[currentIndex].tagName) {\n rewindStack(stack, currentIndex)\n const previousIndex = currentIndex - 1\n nodes = stack[previousIndex].children\n break\n }\n currentIndex = currentIndex - 1\n }\n }\n\n const attributes = []\n let tagEndToken: TagEndToken | undefined\n while (cursor < len) {\n const _token = tokens[cursor]\n if (_token.type === 'tag-end') {\n tagEndToken = _token\n break\n }\n attributes.push((_token as AttributeToken).content)\n cursor++\n }\n\n if (!tagEndToken) break\n\n cursor++\n const children: HTMLNode[] = []\n const elementNode: NormalElement = {\n type: 'element',\n tagName: tagToken.content,\n attributes,\n children,\n }\n nodes.push(elementNode)\n\n const hasChildren = !(tagEndToken.close || voidTags.includes(tagName))\n if (hasChildren) {\n stack.push({tagName, children})\n const innerState = { tokens, cursor, stack }\n parse(innerState)\n cursor = innerState.cursor\n }\n }\n state.cursor = cursor\n}","import { HTMLNode, CommentOrTextAST, ElementAST, AST } from './types'\n\nexport const splitHead = (str: string, sep: string) => {\n const idx = str.indexOf(sep)\n if (idx === -1) return [str]\n return [str.slice(0, idx), str.slice(idx + sep.length)]\n}\n\nconst unquote = (str: string) => {\n const car = str.charAt(0)\n const end = str.length - 1\n const isQuoteStart = car === '\"' || car === \"'\"\n if (isQuoteStart && car === str.charAt(end)) {\n return str.slice(1, end)\n }\n return str\n}\n\nconst formatAttributes = (attributes: string[]) => {\n return attributes.map(attribute => {\n const parts = splitHead(attribute.trim(), '=')\n const key = parts[0]\n const value = typeof parts[1] === 'string' ? unquote(parts[1]) : null\n return { key, value }\n })\n}\n\nexport const format = (nodes: HTMLNode[]): AST[] => {\n return nodes.map(node => { \n if (node.type === 'element') {\n const children = format(node.children)\n const item: ElementAST = {\n type: 'element',\n tagName: node.tagName.toLowerCase(),\n attributes: formatAttributes(node.attributes),\n children,\n }\n return item\n }\n\n const item: CommentOrTextAST = {\n type: node.type,\n content: node.content,\n }\n return item\n })\n}","// 参考:https://github.com/andrejewski/himalaya 用TypeScript重写并简化部分功能\n\nimport { lexer } from './lexer'\nimport { parser } from './parser'\nimport { format } from './format'\nimport { toHTML } from './stringify'\nimport type { AST } from './types'\n\nexport const toAST = (str: string) => {\n const tokens = lexer(str)\n const nodes = parser(tokens)\n return format(nodes)\n}\n\nexport { toHTML, AST }","import { SVGPathData } from 'svg-pathdata'\nimport arcToBezier from 'svg-arc-to-cubic-bezier'\n\nconst typeMap = {\n 1: 'Z',\n 2: 'M',\n 4: 'H',\n 8: 'V',\n 16: 'L',\n 32: 'C',\n 64: 'S',\n 128: 'Q',\n 256: 'T',\n 512: 'A',\n}\n\n/**\n * 简单解析SVG路径\n * @param d SVG path d属性\n */\nexport const parseSvgPath = (d: string) => {\n const pathData = new SVGPathData(d)\n\n const ret = pathData.commands.map(item => {\n return { ...item, type: typeMap[item.type] }\n })\n return ret\n}\n\nexport type SvgPath = ReturnType\n\n/**\n * 解析SVG路径,并将圆弧(A)类型的路径转为三次贝塞尔(C)类型的路径\n * @param d SVG path d属性\n */\nexport const toPoints = (d: string) => {\n const pathData = new SVGPathData(d)\n \n const points = []\n for (const item of pathData.commands) {\n const type = typeMap[item.type]\n\n if (item.type === 2 || item.type === 16) {\n points.push({\n x: item.x,\n y: item.y,\n relative: item.relative,\n type,\n })\n }\n if (item.type === 32) {\n points.push({\n x: item.x, \n y: item.y,\n curve: {\n type: 'cubic',\n x1: item.x1,\n y1: item.y1,\n x2: item.x2,\n y2: item.y2,\n },\n relative: item.relative,\n type,\n })\n }\n else if (item.type === 128) {\n points.push({\n x: item.x, \n y: item.y,\n curve: {\n type: 'quadratic',\n x1: item.x1,\n y1: item.y1,\n },\n relative: item.relative,\n type,\n })\n }\n else if (item.type === 512) {\n const lastPoint = points[points.length - 1]\n if (!['M', 'L', 'Q', 'C'].includes(lastPoint.type)) continue\n\n const cubicBezierPoints = arcToBezier({\n px: lastPoint.x as number,\n py: lastPoint.y as number,\n cx: item.x,\n cy: item.y,\n rx: item.rX,\n ry: item.rY,\n xAxisRotation: item.xRot,\n largeArcFlag: item.lArcFlag,\n sweepFlag: item.sweepFlag,\n })\n for (const cbPoint of cubicBezierPoints) {\n points.push({\n x: cbPoint.x, \n y: cbPoint.y,\n curve: {\n type: 'cubic',\n x1: cbPoint.x1,\n y1: cbPoint.y1,\n x2: cbPoint.x2,\n y2: cbPoint.y2,\n },\n relative: false,\n type: 'C',\n })\n }\n }\n else if (item.type === 1) {\n points.push({ close: true, type })\n }\n else continue\n }\n return points\n}\n\nexport type SvgPoints = ReturnType","// svg转base64图片,参考:https://github.com/scriptex/svg64\n\nconst characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\nconst PREFIX = 'data:image/svg+xml;base64,'\n\nconst utf8Encode = (string: string) => {\n string = string.replace(/\\r\\n/g, '\\n')\n let utftext = ''\n\n for (let n = 0; n < string.length; n++) {\n const c = string.charCodeAt(n)\n\n if (c < 128) {\n utftext += String.fromCharCode(c)\n }\n else if (c > 127 && c < 2048) {\n utftext += String.fromCharCode((c >> 6) | 192)\n utftext += String.fromCharCode((c & 63) | 128)\n }\n else {\n utftext += String.fromCharCode((c >> 12) | 224)\n utftext += String.fromCharCode(((c >> 6) & 63) | 128)\n utftext += String.fromCharCode((c & 63) | 128)\n }\n }\n\n return utftext\n}\n\nconst encode = (input: string) => {\n let output = ''\n let chr1, chr2, chr3, enc1, enc2, enc3, enc4\n let i = 0\n input = utf8Encode(input)\n while (i < input.length) {\n chr1 = input.charCodeAt(i++)\n chr2 = input.charCodeAt(i++)\n chr3 = input.charCodeAt(i++)\n enc1 = chr1 >> 2\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n if (isNaN(chr2)) enc3 = enc4 = 64\n else if (isNaN(chr3)) enc4 = 64\n output = output + characters.charAt(enc1) + characters.charAt(enc2) + characters.charAt(enc3) + characters.charAt(enc4)\n }\n return output\n}\n\nexport const svg2Base64 = (element: Element) => {\n const XMLS = new XMLSerializer()\n const svg = XMLS.serializeToString(element)\n\n return PREFIX + encode(svg)\n}","import { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { trim } from 'lodash'\nimport { saveAs } from 'file-saver'\nimport pptxgen from 'pptxgenjs'\nimport tinycolor from 'tinycolor2'\nimport { toPng, toJpeg } from 'html-to-image'\nimport { useSlidesStore } from '@/store'\nimport { PPTElementOutline, PPTElementShadow, PPTElementLink, Slide } from '@/types/slides'\nimport { getElementRange, getLineElementPath, getTableSubThemeColor } from '@/utils/element'\nimport { AST, toAST } from '@/utils/htmlParser'\nimport { SvgPoints, toPoints } from '@/utils/svgPathParser'\nimport { decrypt, encrypt } from '@/utils/crypto'\nimport { svg2Base64 } from '@/utils/svg2Base64'\nimport { message } from 'ant-design-vue'\nimport useAddSlidesOrElements from '@/hooks/useAddSlidesOrElements'\n\ninterface ExportImageConfig {\n quality: number\n width: number\n fontEmbedCSS?: string\n}\n\nexport default () => {\n const slidesStore = useSlidesStore()\n const { slides, theme, viewportRatio } = storeToRefs(slidesStore)\n\n const { addSlidesFromData } = useAddSlidesOrElements()\n\n const exporting = ref(false)\n\n // 导出图片\n const exportImage = (domRef: HTMLElement, format: string, quality: number, ignoreWebfont = true) => {\n exporting.value = true\n const toImage = format === 'png' ? toPng : toJpeg\n\n const foreignObjectSpans = domRef.querySelectorAll('foreignObject [xmlns]')\n foreignObjectSpans.forEach(spanRef => spanRef.removeAttribute('xmlns'))\n\n setTimeout(() => {\n const config: ExportImageConfig = {\n quality,\n width: 1600,\n }\n\n if (ignoreWebfont) config.fontEmbedCSS = ''\n\n toImage(domRef, config).then(dataUrl => {\n exporting.value = false\n saveAs(dataUrl, `pptist_slides.${format}`)\n }).catch(() => {\n exporting.value = false\n message.error('导出图片失败')\n })\n }, 200)\n }\n \n // 导出pptist文件(特有 .pptist 后缀文件)\n const exportSpecificFile = (_slides: Slide[]) => {\n const blob = new Blob([encrypt(JSON.stringify(_slides))], { type: '' })\n saveAs(blob, 'pptist_slides.pptist')\n }\n \n // 导入pptist文件\n const importSpecificFile = (files: FileList, cover = false) => {\n const file = files[0]\n\n const reader = new FileReader()\n reader.addEventListener('load', () => {\n try {\n const slides = JSON.parse(decrypt(reader.result as string))\n if (cover) slidesStore.setSlides(slides)\n else addSlidesFromData(slides)\n }\n catch {\n message.error('无法正确读取 / 解析该文件')\n }\n })\n reader.readAsText(file)\n }\n \n // 导出JSON文件\n const exportJSON = () => {\n const blob = new Blob([JSON.stringify(slides.value)], { type: '' })\n saveAs(blob, 'pptist_slides.json')\n }\n\n // 格式化颜色值为 透明度 + HexString,供pptxgenjs使用\n const formatColor = (_color: string) => {\n const c = tinycolor(_color)\n const alpha = c.getAlpha()\n const color = alpha === 0 ? '#ffffff' : c.setAlpha(1).toHexString()\n return {\n alpha,\n color,\n }\n }\n\n type FormatColor = ReturnType\n\n // 将HTML字符串格式化为pptxgenjs所需的格式\n // 核心思路:将HTML字符串按样式分片平铺,每个片段需要继承祖先元素的样式信息,遇到块级元素需要换行\n const formatHTML = (html: string) => {\n const ast = toAST(html)\n let bulletFlag = false\n let indent = 0\n\n const slices: pptxgen.TextProps[] = []\n const parse = (obj: AST[], baseStyleObj = {}) => {\n\n for (const item of obj) {\n const isBlockTag = 'tagName' in item && ['div', 'li', 'p'].includes(item.tagName)\n\n if (isBlockTag && slices.length) {\n const lastSlice = slices[slices.length - 1]\n if (!lastSlice.options) lastSlice.options = {}\n lastSlice.options.breakLine = true\n }\n\n const styleObj = { ...baseStyleObj }\n const styleAttr = 'attributes' in item ? item.attributes.find(attr => attr.key === 'style') : null\n if (styleAttr && styleAttr.value) {\n const styleArr = styleAttr.value.split(';')\n for (const styleItem of styleArr) {\n const [_key, _value] = styleItem.split(': ')\n const [key, value] = [trim(_key), trim(_value)]\n if (key && value) styleObj[key] = value\n }\n }\n\n if ('tagName' in item) {\n if (item.tagName === 'em') {\n styleObj['font-style'] = 'italic'\n }\n if (item.tagName === 'strong') {\n styleObj['font-weight'] = 'bold'\n }\n if (item.tagName === 'sup') {\n styleObj['vertical-align'] = 'super'\n }\n if (item.tagName === 'sub') {\n styleObj['vertical-align'] = 'sub'\n }\n if (item.tagName === 'a') {\n const attr = item.attributes.find(attr => attr.key === 'href')\n styleObj['href'] = attr?.value || ''\n }\n if (item.tagName === 'ul') {\n styleObj['list-type'] = 'ul'\n }\n if (item.tagName === 'ol') {\n styleObj['list-type'] = 'ol'\n }\n if (item.tagName === 'li') {\n bulletFlag = true\n }\n if (item.tagName === 'p') {\n if ('attributes' in item) {\n const dataIndentAttr = item.attributes.find(attr => attr.key === 'data-indent')\n if (dataIndentAttr && dataIndentAttr.value) indent = +dataIndentAttr.value\n }\n }\n }\n\n if ('tagName' in item && item.tagName === 'br') {\n slices.push({ text: '', options: { breakLine: true } })\n }\n else if ('content' in item) {\n const text = item.content.replace(/ /g, ' ').replace(/>/g, '>').replace(/</g, '<').replace(/&/g, '&').replace(/\\n/g, '')\n const options: pptxgen.TextPropsOptions = {}\n\n if (styleObj['font-size']) {\n options.fontSize = parseInt(styleObj['font-size']) * 0.75\n }\n if (styleObj['color']) {\n options.color = formatColor(styleObj['color']).color\n }\n if (styleObj['background-color']) {\n options.highlight = formatColor(styleObj['background-color']).color\n }\n if (styleObj['text-decoration-line']) {\n if (styleObj['text-decoration-line'].indexOf('underline') !== -1) {\n options.underline = {\n color: options.color || '#000000',\n style: 'sng',\n }\n }\n if (styleObj['text-decoration-line'].indexOf('line-through') !== -1) {\n options.strike = 'sngStrike'\n }\n }\n if (styleObj['text-decoration']) {\n if (styleObj['text-decoration'].indexOf('underline') !== -1) {\n options.underline = {\n color: options.color || '#000000',\n style: 'sng',\n }\n }\n if (styleObj['text-decoration'].indexOf('line-through') !== -1) {\n options.strike = 'sngStrike'\n }\n }\n if (styleObj['vertical-align']) {\n if (styleObj['vertical-align'] === 'super') options.superscript = true\n if (styleObj['vertical-align'] === 'sub') options.subscript = true\n }\n if (styleObj['text-align']) options.align = styleObj['text-align']\n if (styleObj['font-weight']) options.bold = styleObj['font-weight'] === 'bold'\n if (styleObj['font-style']) options.italic = styleObj['font-style'] === 'italic'\n if (styleObj['font-family']) options.fontFace = styleObj['font-family']\n if (styleObj['href']) options.hyperlink = { url: styleObj['href'] }\n\n if (bulletFlag && styleObj['list-type'] === 'ol') {\n options.bullet = { type: 'number', indent: 20 * 0.75 }\n options.paraSpaceBefore = 0.1\n bulletFlag = false\n }\n if (bulletFlag && styleObj['list-type'] === 'ul') {\n options.bullet = { indent: 20 * 0.75 }\n options.paraSpaceBefore = 0.1\n bulletFlag = false\n }\n if (indent) {\n options.indentLevel = indent\n indent = 0\n }\n\n slices.push({ text, options })\n }\n else if ('children' in item) parse(item.children, styleObj)\n }\n }\n parse(ast)\n return slices\n }\n\n type Points = Array<\n | { x: number; y: number; moveTo?: boolean }\n | { x: number; y: number; curve: { type: 'arc'; hR: number; wR: number; stAng: number; swAng: number } }\n | { x: number; y: number; curve: { type: 'quadratic'; x1: number; y1: number } }\n | { x: number; y: number; curve: { type: 'cubic'; x1: number; y1: number; x2: number; y2: number } }\n | { close: true }\n >\n\n // 将SVG路径信息格式化为pptxgenjs所需要的格式\n const formatPoints = (points: SvgPoints, scale = { x: 1, y: 1 }): Points => {\n return points.map(point => {\n if (point.close !== undefined) {\n return { close: true }\n }\n else if (point.type === 'M') {\n return {\n x: point.x / 100 * scale.x,\n y: point.y / 100 * scale.y,\n moveTo: true,\n }\n }\n else if (point.curve) {\n if (point.curve.type === 'cubic') {\n return {\n x: point.x / 100 * scale.x,\n y: point.y / 100 * scale.y,\n curve: {\n type: 'cubic',\n x1: (point.curve.x1 as number) / 100 * scale.x,\n y1: (point.curve.y1 as number) / 100 * scale.y,\n x2: (point.curve.x2 as number) / 100 * scale.x,\n y2: (point.curve.y2 as number) / 100 * scale.y,\n },\n }\n }\n else if (point.curve.type === 'quadratic') {\n return {\n x: point.x / 100 * scale.x,\n y: point.y / 100 * scale.y,\n curve: {\n type: 'quadratic',\n x1: (point.curve.x1 as number) / 100 * scale.x,\n y1: (point.curve.y1 as number) / 100 * scale.y,\n },\n }\n }\n }\n return {\n x: point.x / 100 * scale.x,\n y: point.y / 100 * scale.y,\n }\n })\n }\n\n // 获取阴影配置\n const getShadowOption = (shadow: PPTElementShadow): pptxgen.ShadowProps => {\n const c = formatColor(shadow.color)\n const { h, v } = shadow\n\n let offset = 4\n let angle = 45\n\n if (h === 0 && v === 0) {\n offset = 4\n angle = 45\n }\n else if (h === 0) {\n if (v > 0) {\n offset = v\n angle = 90\n }\n else {\n offset = -v\n angle = 270\n }\n }\n else if (v === 0) {\n if (h > 0) {\n offset = h\n angle = 1\n }\n else {\n offset = -h\n angle = 180\n }\n }\n else if (h > 0 && v > 0) {\n offset = Math.max(h, v)\n angle = 45\n }\n else if (h > 0 && v < 0) {\n offset = Math.max(h, -v)\n angle = 315\n }\n else if (h < 0 && v > 0) {\n offset = Math.max(-h, v)\n angle = 135\n }\n else if (h < 0 && v < 0) {\n offset = Math.max(-h, -v)\n angle = 225\n }\n\n return {\n type: 'outer',\n color: c.color.replace('#', ''),\n opacity: c.alpha,\n blur: shadow.blur * 0.75,\n offset,\n angle,\n }\n }\n\n // 获取边框配置\n const getOutlineOption = (outline: PPTElementOutline): pptxgen.ShapeLineProps => {\n const c = formatColor(outline?.color || '#000000')\n return {\n color: c.color, \n transparency: (1 - c.alpha) * 100,\n width: (outline.width || 1) * 0.75, \n dashType: outline.style === 'solid' ? 'solid' : 'dash',\n }\n }\n\n // 获取超链接配置\n const getLinkOption = (link: PPTElementLink): pptxgen.HyperlinkProps | null => {\n const { type, target } = link\n if (type === 'web') return { url: target }\n if (type === 'slide') {\n const index = slides.value.findIndex(slide => slide.id === target)\n if (index !== -1) return { slide: index + 1 }\n }\n\n return null\n }\n\n // 导出PPTX文件\n const exportPPTX = (_slides: Slide[], masterOverwrite: boolean) => {\n exporting.value = true\n const pptx = new pptxgen()\n\n if (viewportRatio.value === 0.625) pptx.layout = 'LAYOUT_16x10'\n else if (viewportRatio.value === 0.75) pptx.layout = 'LAYOUT_4x3'\n else pptx.layout = 'LAYOUT_16x9'\n\n if (masterOverwrite) {\n const { color: bgColor, alpha: bgAlpha } = formatColor(theme.value.backgroundColor)\n pptx.defineSlideMaster({\n title: 'PPTIST_MASTER',\n background: { color: bgColor, transparency: (1 - bgAlpha) * 100 },\n })\n }\n\n for (const slide of _slides) {\n const pptxSlide = pptx.addSlide()\n\n if (slide.background) {\n const background = slide.background\n if (background.type === 'image' && background.image) {\n pptxSlide.background = { data: background.image }\n }\n else if (background.type === 'solid' && background.color) {\n const c = formatColor(background.color)\n pptxSlide.background = { color: c.color, transparency: (1 - c.alpha) * 100 }\n }\n else if (background.type === 'gradient' && background.gradientColor) {\n const [color1, color2] = background.gradientColor\n const color = tinycolor.mix(color1, color2).toHexString()\n const c = formatColor(color)\n pptxSlide.background = { color: c.color, transparency: (1 - c.alpha) * 100 }\n }\n }\n if (slide.remark) pptxSlide.addNotes(slide.remark)\n\n if (!slide.elements) continue\n\n for (const el of slide.elements) {\n if (el.type === 'text') {\n const textProps = formatHTML(el.content)\n\n const options: pptxgen.TextPropsOptions = {\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n fontSize: 20 * 0.75,\n fontFace: '微软雅黑',\n color: '#000000',\n valign: 'top',\n margin: 10 * 0.75,\n paraSpaceBefore: 5 * 0.75,\n lineSpacingMultiple: 1.5 / 1.25,\n autoFit: true,\n }\n if (el.rotate) options.rotate = el.rotate\n if (el.wordSpace) options.charSpacing = el.wordSpace * 0.75\n if (el.lineHeight) options.lineSpacingMultiple = el.lineHeight / 1.25\n if (el.fill) {\n const c = formatColor(el.fill)\n const opacity = el.opacity === undefined ? 1 : el.opacity\n options.fill = { color: c.color, transparency: (1 - c.alpha * opacity) * 100 }\n }\n if (el.defaultColor) options.color = formatColor(el.defaultColor).color\n if (el.defaultFontName) options.fontFace = el.defaultFontName\n if (el.shadow) options.shadow = getShadowOption(el.shadow)\n if (el.outline?.width) options.line = getOutlineOption(el.outline)\n if (el.opacity !== undefined) options.transparency = (1 - el.opacity) * 100\n if (el.paragraphSpace !== undefined) options.paraSpaceBefore = el.paragraphSpace * 0.75\n\n pptxSlide.addText(textProps, options)\n }\n\n else if (el.type === 'image') {\n const options: pptxgen.ImageProps = {\n path: el.src,\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n }\n if (el.flipH) options.flipH = el.flipH\n if (el.flipV) options.flipV = el.flipV\n if (el.rotate) options.rotate = el.rotate\n if (el.link) {\n const linkOption = getLinkOption(el.link)\n if (linkOption) options.hyperlink = linkOption\n }\n if (el.filters?.opacity) options.transparency = 100 - parseInt(el.filters?.opacity)\n if (el.clip) {\n if (el.clip.shape === 'ellipse') options.rounding = true\n\n const [start, end] = el.clip.range\n const [startX, startY] = start\n const [endX, endY] = end\n\n const originW = el.width / ((endX - startX) / 100)\n const originH = el.height / ((endY - startY) / 100)\n\n options.w = originW / 100\n options.h = originH / 100\n\n options.sizing = {\n type: 'crop',\n x: startX / 100 * originW / 100,\n y: startY / 100 * originH / 100,\n w: (endX - startX) / 100 * originW / 100,\n h: (endY - startY) / 100 * originH / 100,\n }\n }\n\n pptxSlide.addImage(options)\n }\n\n else if (el.type === 'shape') {\n if (el.special) {\n const svgRef = document.querySelector(`.thumbnail-list .base-element-${el.id} svg`) as HTMLElement\n const base64SVG = svg2Base64(svgRef)\n\n const options: pptxgen.ImageProps = {\n data: base64SVG,\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n }\n if (el.rotate) options.rotate = el.rotate\n if (el.link) {\n const linkOption = getLinkOption(el.link)\n if (linkOption) options.hyperlink = linkOption\n }\n\n pptxSlide.addImage(options)\n }\n else {\n const scale = {\n x: el.width / el.viewBox[0],\n y: el.height / el.viewBox[1],\n }\n const points = formatPoints(toPoints(el.path), scale)\n \n const fillColor = formatColor(el.fill)\n const opacity = el.opacity === undefined ? 1 : el.opacity\n \n const options: pptxgen.ShapeProps = {\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n fill: { color: fillColor.color, transparency: (1 - fillColor.alpha * opacity) * 100 },\n points,\n }\n if (el.flipH) options.flipH = el.flipH\n if (el.flipV) options.flipV = el.flipV\n if (el.shadow) options.shadow = getShadowOption(el.shadow)\n if (el.outline?.width) options.line = getOutlineOption(el.outline)\n if (el.link) {\n const linkOption = getLinkOption(el.link)\n if (linkOption) options.hyperlink = linkOption\n }\n\n pptxSlide.addShape('custGeom' as pptxgen.ShapeType, options)\n }\n if (el.text) {\n const textProps = formatHTML(el.text.content)\n\n const options: pptxgen.TextPropsOptions = {\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n fontSize: 20 * 0.75,\n fontFace: '微软雅黑',\n color: '#000000',\n paraSpaceBefore: 5 * 0.75,\n valign: el.text.align,\n }\n if (el.rotate) options.rotate = el.rotate\n if (el.text.defaultColor) options.color = formatColor(el.text.defaultColor).color\n if (el.text.defaultFontName) options.fontFace = el.text.defaultFontName\n\n pptxSlide.addText(textProps, options)\n }\n }\n\n else if (el.type === 'line') {\n const path = getLineElementPath(el)\n const points = formatPoints(toPoints(path))\n const { minX, maxX, minY, maxY } = getElementRange(el)\n const c = formatColor(el.color)\n\n const options: pptxgen.ShapeProps = {\n x: el.left / 100,\n y: el.top / 100,\n w: (maxX - minX) / 100,\n h: (maxY - minY) / 100,\n line: {\n color: c.color, \n transparency: (1 - c.alpha) * 100,\n width: el.width * 0.75, \n dashType: el.style === 'solid' ? 'solid' : 'dash',\n beginArrowType: el.points[0] ? 'arrow' : 'none',\n endArrowType: el.points[1] ? 'arrow' : 'none',\n },\n points,\n }\n if (el.shadow) options.shadow = getShadowOption(el.shadow)\n\n pptxSlide.addShape('custGeom' as pptxgen.ShapeType, options)\n }\n\n else if (el.type === 'chart') {\n const chartData = []\n for (let i = 0; i < el.data.series.length; i++) {\n const item = el.data.series[i]\n chartData.push({\n name: `系列${i + 1}`,\n labels: el.data.labels,\n values: item,\n })\n }\n\n let chartColors: string[] = []\n if (el.themeColor.length === 10) chartColors = el.themeColor.map(color => formatColor(color).color)\n else if (el.themeColor.length === 1) chartColors = tinycolor(el.themeColor[0]).analogous(10).map(color => formatColor(color.toHexString()).color)\n else {\n const len = el.themeColor.length\n const supplement = tinycolor(el.themeColor[len - 1]).analogous(10 + 1 - len).map(color => color.toHexString())\n chartColors = [...el.themeColor.slice(0, len - 1), ...supplement].map(color => formatColor(color).color)\n }\n \n const options: pptxgen.IChartOpts = {\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n chartColors: el.chartType === 'pie' ? chartColors : chartColors.slice(0, el.data.series.length),\n }\n\n if (el.fill) options.fill = formatColor(el.fill).color\n if (el.legend) {\n options.showLegend = true\n options.legendPos = el.legend === 'top' ? 't' : 'b'\n options.legendColor = formatColor(el.gridColor || '#000000').color\n options.legendFontSize = 14 * 0.75\n }\n\n let type = pptx.ChartType.bar\n if (el.chartType === 'bar') {\n type = pptx.ChartType.bar\n options.barDir = el.options?.horizontalBars ? 'bar' : 'col'\n }\n else if (el.chartType === 'line') {\n if (el.options?.showArea) type = pptx.ChartType.area\n else if (el.options?.showLine === false) {\n type = pptx.ChartType.scatter\n\n chartData.unshift({ name: 'X-Axis', values: Array(el.data.series[0].length).fill(0).map((v, i) => i) })\n options.lineSize = 0\n }\n else type = pptx.ChartType.line\n\n if (el.options?.lineSmooth) options.lineSmooth = true\n }\n else if (el.chartType === 'pie') {\n if (el.options?.donut) {\n type = pptx.ChartType.doughnut\n options.holeSize = 75\n }\n else type = pptx.ChartType.pie\n }\n \n pptxSlide.addChart(type, chartData, options)\n }\n\n else if (el.type === 'table') {\n const hiddenCells = []\n for (let i = 0; i < el.data.length; i++) {\n const rowData = el.data[i]\n\n for (let j = 0; j < rowData.length; j++) {\n const cell = rowData[j]\n if (cell.colspan > 1 || cell.rowspan > 1) {\n for (let row = i; row < i + cell.rowspan; row++) {\n for (let col = row === i ? j + 1 : j; col < j + cell.colspan; col++) hiddenCells.push(`${row}_${col}`)\n }\n }\n }\n }\n\n const tableData = []\n\n const theme = el.theme\n let themeColor: FormatColor | null = null\n let subThemeColors: FormatColor[] = []\n if (theme) {\n themeColor = formatColor(theme.color)\n subThemeColors = getTableSubThemeColor(theme.color).map(item => formatColor(item))\n }\n\n for (let i = 0; i < el.data.length; i++) {\n const row = el.data[i]\n const _row = []\n\n for (let j = 0; j < row.length; j++) {\n const cell = row[j]\n const cellOptions: pptxgen.TableCellProps = {\n colspan: cell.colspan,\n rowspan: cell.rowspan,\n bold: cell.style?.bold || false,\n italic: cell.style?.em || false,\n underline: { style: cell.style?.underline ? 'sng' : 'none' },\n align: cell.style?.align || 'left',\n valign: 'middle',\n fontFace: cell.style?.fontname || '微软雅黑',\n fontSize: (cell.style?.fontsize ? parseInt(cell.style?.fontsize) : 14) * 0.75,\n }\n if (theme && themeColor) {\n let c: FormatColor\n if (i % 2 === 0) c = subThemeColors[1]\n else c = subThemeColors[0]\n\n if (theme.rowHeader && i === 0) c = themeColor\n else if (theme.rowFooter && i === el.data.length - 1) c = themeColor\n else if (theme.colHeader && j === 0) c = themeColor\n else if (theme.colFooter && j === row.length - 1) c = themeColor\n\n cellOptions.fill = { color: c.color, transparency: (1 - c.alpha) * 100 }\n }\n if (cell.style?.backcolor) {\n const c = formatColor(cell.style.backcolor)\n cellOptions.fill = { color: c.color, transparency: (1 - c.alpha) * 100 }\n }\n if (cell.style?.color) cellOptions.color = formatColor(cell.style.color).color\n\n if (!hiddenCells.includes(`${i}_${j}`)) {\n _row.push({\n text: cell.text,\n options: cellOptions,\n })\n }\n }\n if (_row.length) tableData.push(_row)\n }\n\n const options: pptxgen.TableProps = {\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n colW: el.colWidths.map(item => el.width * item / 100),\n }\n if (el.theme) options.fill = { color: '#ffffff' }\n if (el.outline.width && el.outline.color) {\n options.border = {\n type: el.outline.style === 'solid' ? 'solid' : 'dash',\n pt: el.outline.width * 0.75,\n color: formatColor(el.outline.color).color,\n }\n }\n\n pptxSlide.addTable(tableData, options)\n }\n \n else if (el.type === 'latex') {\n const svgRef = document.querySelector(`.thumbnail-list .base-element-${el.id} svg`) as HTMLElement\n const base64SVG = svg2Base64(svgRef)\n\n const options: pptxgen.ImageProps = {\n data: base64SVG,\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n }\n if (el.link) {\n const linkOption = getLinkOption(el.link)\n if (linkOption) options.hyperlink = linkOption\n }\n\n pptxSlide.addImage(options)\n }\n }\n }\n pptx.writeFile({ fileName: `pptist.pptx` }).then(() => exporting.value = false).catch(() => {\n exporting.value = false\n message.error('导出失败')\n })\n }\n\n return {\n exporting,\n exportImage,\n exportJSON,\n importSpecificFile,\n exportSpecificFile,\n exportPPTX,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4b1afc5f\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"hotkey-doc\" }\nconst _hoisted_2 = { class: \"title\" }\nconst _hoisted_3 = { class: \"label\" }\nconst _hoisted_4 = { class: \"value\" }\n\nimport { HOTKEY_DOC } from '@/configs/hotkey' \n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'HotkeyDoc',\n setup(__props) {\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(HOTKEY_DOC), (item) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: item.type\n }, [\n _createElementVNode(\"div\", _hoisted_2, _toDisplayString(item.type), 1),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(item.children, (hotkey) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"hotkey-item\",\n key: hotkey.label\n }, [\n _createElementVNode(\"div\", _hoisted_3, _toDisplayString(hotkey.label), 1),\n _createElementVNode(\"div\", _hoisted_4, _toDisplayString(hotkey.value), 1)\n ]))\n }), 128))\n ], 64))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./HotkeyDoc.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./HotkeyDoc.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./HotkeyDoc.vue?vue&type=style&index=0&id=4b1afc5f&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-4b1afc5f\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, unref as _unref, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-6c34fc9c\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"editor-header\" }\nconst _hoisted_2 = { class: \"left\" }\nconst _hoisted_3 = { class: \"menu-item\" }\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode()\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"text\" }, \"文件\", -1))\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"导入 pptist 文件\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"导出 pptist 文件\")\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"导出 PPTX\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"导出图片\")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"导出 JSON\")\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\"打印 / 导出 PDF\")\nconst _hoisted_12 = { class: \"menu-item\" }\nconst _hoisted_13 = /*#__PURE__*/_createTextVNode()\nconst _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"text\" }, \"编辑\", -1))\nconst _hoisted_15 = /*#__PURE__*/_createTextVNode(\"撤销\")\nconst _hoisted_16 = /*#__PURE__*/_createTextVNode(\"重做\")\nconst _hoisted_17 = /*#__PURE__*/_createTextVNode(\"添加页面\")\nconst _hoisted_18 = /*#__PURE__*/_createTextVNode(\"删除页面\")\nconst _hoisted_19 = /*#__PURE__*/_createTextVNode(\"重置幻灯片\")\nconst _hoisted_20 = { class: \"menu-item\" }\nconst _hoisted_21 = /*#__PURE__*/_createTextVNode()\nconst _hoisted_22 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"text\" }, \"演示\", -1))\nconst _hoisted_23 = /*#__PURE__*/_createTextVNode(\"从头开始\")\nconst _hoisted_24 = /*#__PURE__*/_createTextVNode(\"从当前页开始\")\nconst _hoisted_25 = { class: \"menu-item\" }\nconst _hoisted_26 = /*#__PURE__*/_createTextVNode()\nconst _hoisted_27 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"text\" }, \"帮助\", -1))\nconst _hoisted_28 = /*#__PURE__*/_createTextVNode(\"意见反馈\")\nconst _hoisted_29 = /*#__PURE__*/_createTextVNode(\"快捷键\")\nconst _hoisted_30 = { class: \"right\" }\nconst _hoisted_31 = {\n href: \"https://github.com/pipipi-pikachu/PPTist\",\n target: \"_blank\"\n}\nconst _hoisted_32 = { class: \"menu-item\" }\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport useScreening from '@/hooks/useScreening'\nimport useSlideHandler from '@/hooks/useSlideHandler'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport useExport from '@/hooks/useExport'\n\nimport HotkeyDoc from './HotkeyDoc.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst { showGridLines, showRuler } = storeToRefs(mainStore)\n\nconst { enterScreening, enterScreeningFromStart } = useScreening()\nconst { createSlide, deleteSlide, resetSlides } = useSlideHandler()\nconst { redo, undo } = useHistorySnapshot()\nconst { importSpecificFile } = useExport()\n\nconst setDialogForExport = mainStore.setDialogForExport\n\nconst toggleGridLines = () => {\n mainStore.setGridLinesState(!showGridLines.value)\n}\n\nconst toggleRuler = () => {\n mainStore.setRulerState(!showRuler.value)\n}\n\nconst hotkeyDrawerVisible = ref(false)\n\nconst goIssues = () => {\n window.open('https://github.com/pipipi-pikachu/PPTist/issues')\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconFolderClose = _resolveComponent(\"IconFolderClose\")!\n const _component_MenuItem = _resolveComponent(\"MenuItem\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_Menu = _resolveComponent(\"Menu\")!\n const _component_Dropdown = _resolveComponent(\"Dropdown\")!\n const _component_IconEdit = _resolveComponent(\"IconEdit\")!\n const _component_IconPpt = _resolveComponent(\"IconPpt\")!\n const _component_IconHelpcenter = _resolveComponent(\"IconHelpcenter\")!\n const _component_IconShare = _resolveComponent(\"IconShare\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconGithub = _resolveComponent(\"IconGithub\")!\n const _component_Drawer = _resolveComponent(\"Drawer\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_Dropdown, { trigger: ['click'] }, {\n overlay: _withCtx(() => [\n _createVNode(_component_Menu, null, {\n default: _withCtx(() => [\n _createVNode(_component_FileInput, {\n accept: \".pptist\",\n onChange: _cache[0] || (_cache[0] = files => _unref(importSpecificFile)(files))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_MenuItem, null, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_unref(setDialogForExport)('pptist')))\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_unref(setDialogForExport)('pptx')))\n }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[3] || (_cache[3] = ($event: any) => (_unref(setDialogForExport)('image')))\n }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[4] || (_cache[4] = ($event: any) => (_unref(setDialogForExport)('json')))\n }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[5] || (_cache[5] = ($event: any) => (_unref(setDialogForExport)('pdf')))\n }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_IconFolderClose),\n _hoisted_4,\n _hoisted_5\n ])\n ]),\n _: 1\n }),\n _createVNode(_component_Dropdown, { trigger: ['click'] }, {\n overlay: _withCtx(() => [\n _createVNode(_component_Menu, null, {\n default: _withCtx(() => [\n _createVNode(_component_MenuItem, {\n onClick: _cache[6] || (_cache[6] = ($event: any) => (_unref(undo)()))\n }, {\n default: _withCtx(() => [\n _hoisted_15\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[7] || (_cache[7] = ($event: any) => (_unref(redo)()))\n }, {\n default: _withCtx(() => [\n _hoisted_16\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[8] || (_cache[8] = ($event: any) => (_unref(createSlide)()))\n }, {\n default: _withCtx(() => [\n _hoisted_17\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[9] || (_cache[9] = ($event: any) => (_unref(deleteSlide)()))\n }, {\n default: _withCtx(() => [\n _hoisted_18\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[10] || (_cache[10] = ($event: any) => (toggleGridLines()))\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(showGridLines) ? '关闭网格线' : '打开网格线'), 1)\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[11] || (_cache[11] = ($event: any) => (toggleRuler()))\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(showRuler) ? '关闭标尺' : '打开标尺'), 1)\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[12] || (_cache[12] = ($event: any) => (_unref(resetSlides)()))\n }, {\n default: _withCtx(() => [\n _hoisted_19\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_12, [\n _createVNode(_component_IconEdit),\n _hoisted_13,\n _hoisted_14\n ])\n ]),\n _: 1\n }),\n _createVNode(_component_Dropdown, { trigger: ['click'] }, {\n overlay: _withCtx(() => [\n _createVNode(_component_Menu, null, {\n default: _withCtx(() => [\n _createVNode(_component_MenuItem, {\n onClick: _cache[13] || (_cache[13] = ($event: any) => (_unref(enterScreeningFromStart)()))\n }, {\n default: _withCtx(() => [\n _hoisted_23\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[14] || (_cache[14] = ($event: any) => (_unref(enterScreening)()))\n }, {\n default: _withCtx(() => [\n _hoisted_24\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_20, [\n _createVNode(_component_IconPpt),\n _hoisted_21,\n _hoisted_22\n ])\n ]),\n _: 1\n }),\n _createVNode(_component_Dropdown, { trigger: ['click'] }, {\n overlay: _withCtx(() => [\n _createVNode(_component_Menu, null, {\n default: _withCtx(() => [\n _createVNode(_component_MenuItem, {\n onClick: _cache[15] || (_cache[15] = ($event: any) => (goIssues()))\n }, {\n default: _withCtx(() => [\n _hoisted_28\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[16] || (_cache[16] = ($event: any) => (hotkeyDrawerVisible.value = true))\n }, {\n default: _withCtx(() => [\n _hoisted_29\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_25, [\n _createVNode(_component_IconHelpcenter),\n _hoisted_26,\n _hoisted_27\n ])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_30, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n title: \"导出\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: \"menu-item\",\n onClick: _cache[17] || (_cache[17] = ($event: any) => (_unref(setDialogForExport)('pptx')))\n }, [\n _createVNode(_component_IconShare, {\n size: \"18\",\n fill: \"#666\"\n })\n ])\n ]),\n _: 1\n }),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n title: \"幻灯片放映\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: \"menu-item\",\n onClick: _cache[18] || (_cache[18] = ($event: any) => (_unref(enterScreening)()))\n }, [\n _createVNode(_component_IconPpt, {\n size: \"19\",\n fill: \"#666\",\n style: {\"margin-top\":\"1px\"}\n })\n ])\n ]),\n _: 1\n }),\n _createElementVNode(\"a\", _hoisted_31, [\n _createElementVNode(\"div\", _hoisted_32, [\n _createVNode(_component_IconGithub, {\n size: \"18\",\n fill: \"#666\"\n })\n ])\n ])\n ]),\n _createVNode(_component_Drawer, {\n width: \"320\",\n placement: \"right\",\n closable: false,\n visible: hotkeyDrawerVisible.value,\n onClose: _cache[19] || (_cache[19] = ($event: any) => (hotkeyDrawerVisible.value = false))\n }, {\n default: _withCtx(() => [\n _createVNode(HotkeyDoc)\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=6c34fc9c&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6c34fc9c\"]])\n\nexport default __exports__","export const enum ClipPathTypes {\n RECT = 'rect',\n ELLIPSE = 'ellipse',\n POLYGON = 'polygon',\n}\n\nexport const enum ClipPaths {\n RECT = 'rect',\n ROUNDRECT = 'roundRect',\n ELLIPSE = 'ellipse',\n TRIANGLE = 'triangle',\n PENTAGON = 'pentagon',\n RHOMBUS = 'rhombus',\n STAR = 'star',\n}\n\nexport const CLIPPATHS = {\n rect: {\n name: '矩形',\n type: ClipPathTypes.RECT,\n radius: '0',\n style: '',\n },\n rect2: {\n name: '矩形2',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 0 100%)',\n createPath: (width: number, height: number) => {\n return `M 0 0 L ${width * 0.8} 0 L ${width} ${height * 0.2} L ${width} ${height} L 0 ${height} Z`\n },\n },\n rect3: {\n name: '矩形3',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 20% 100%, 0% 80%)',\n createPath: (width: number, height: number) => {\n return `M 0 0 L ${width * 0.8} 0 L ${width} ${height * 0.2} L ${width} ${height} L ${width * 0.2} ${height} L 0 ${height * 0.8} Z`\n },\n },\n roundRect: {\n name: '圆角矩形',\n type: ClipPathTypes.RECT,\n radius: '10%',\n style: 'inset(0 0 0 0 round 10% 10% 10% 10%)',\n },\n ellipse: {\n name: '圆形',\n type: ClipPathTypes.ELLIPSE,\n style: 'ellipse(50% 50% at 50% 50%)',\n },\n triangle: {\n name: '三角形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(50% 0%, 0% 100%, 100% 100%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.5} 0 L 0 ${height} L ${width} ${height} Z`\n },\n },\n triangle2: {\n name: '三角形2',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(50% 100%, 0% 0%, 100% 0%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.5} ${height} L 0 0 L ${width} 0 Z`\n },\n },\n triangle3: {\n name: '三角形3',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(0% 0%, 0% 100%, 100% 100%)',\n createPath: (width: number, height: number) => {\n return `M 0 0 L 0 ${height} L ${width} ${height} Z`\n },\n },\n rhombus: {\n name: '菱形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.5} 0 L ${width} ${height * 0.5} L ${width * 0.5} ${height} L 0 ${height * 0.5} Z`\n },\n },\n hexagon: {\n name: '六边形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.2} 0 L ${width * 0.8} 0 L ${width} ${height * 0.5} L ${width * 0.8} ${height} L ${width * 0.2} ${height} L 0 ${height * 0.5} Z`\n },\n },\n pentagon: {\n name: '五边形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.5} 0 L ${width} ${0.38 * height} L ${0.82 * width} ${height} L ${0.18 * width} ${height} L 0 ${0.38 * height} Z`\n },\n },\n parallelogram: {\n name: '平行四边形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(30% 0%, 100% 0%, 70% 100%, 0% 100%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.3} 0 L ${width} 0 L ${width * 0.7} ${height} L 0 ${height} Z`\n },\n },\n parallelogram2: {\n name: '平行四边形2',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(30% 100%, 100% 100%, 70% 0%, 0% 0%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.3} ${height} L ${width} ${height} L ${width * 0.7} 0 L 0 0 Z`\n },\n },\n trapezoid: {\n name: '梯形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.25} 0 L ${width * 0.75} 0 L ${width} ${height} L 0 ${height} Z`\n },\n },\n trapezoid2: {\n name: '梯形2',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(0% 0%, 100% 0%, 75% 100%, 25% 100%)',\n createPath: (width: number, height: number) => {\n return `M 0 0 L ${width} 0 L ${width * 0.75} ${height} L ${width * 0.25} ${height} Z`\n },\n },\n}","import { InjectionKey, Ref } from 'vue'\n\nexport type SlideScale = Ref\nexport type SlideId = Ref\n\nexport const injectKeySlideScale: InjectionKey = Symbol()\nexport const injectKeySlideId: InjectionKey = Symbol()","// 清除文字选区\nexport const removeAllRanges = () => {\n const selection = window.getSelection()\n selection && selection.removeAllRanges()\n}","import { ref, computed, onMounted, onUnmounted, Ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\n\nexport default (canvasRef: Ref) => {\n const viewportLeft = ref(0)\n const viewportTop = ref(0)\n\n const mainStore = useMainStore()\n const { canvasPercentage, canvasDragged } = storeToRefs(mainStore)\n const { viewportRatio } = storeToRefs(useSlidesStore())\n\n // 计算画布可视区域的位置\n const setViewportPosition = () => {\n if (!canvasRef.value) return\n const canvasWidth = canvasRef.value.clientWidth\n const canvasHeight = canvasRef.value.clientHeight\n\n if (canvasHeight / canvasWidth > viewportRatio.value) {\n const viewportActualWidth = canvasWidth * (canvasPercentage.value / 100)\n mainStore.setCanvasScale(viewportActualWidth / VIEWPORT_SIZE)\n viewportLeft.value = (canvasWidth - viewportActualWidth) / 2\n viewportTop.value = (canvasHeight - viewportActualWidth * viewportRatio.value) / 2\n }\n else {\n const viewportActualHeight = canvasHeight * (canvasPercentage.value / 100)\n mainStore.setCanvasScale(viewportActualHeight / (VIEWPORT_SIZE * viewportRatio.value))\n viewportLeft.value = (canvasWidth - viewportActualHeight / viewportRatio.value) / 2\n viewportTop.value = (canvasHeight - viewportActualHeight) / 2\n }\n }\n\n // 可视区域缩放或比例变化时,更新可视区域的位置\n watch([canvasPercentage, viewportRatio], setViewportPosition)\n\n // 画布拖拽状态改变(复原)时,更新可视区域的位置\n watch(canvasDragged, () => {\n if (!canvasDragged.value) setViewportPosition()\n })\n\n // 画布可视区域位置和大小的样式\n const viewportStyles = computed(() => ({\n width: VIEWPORT_SIZE,\n height: VIEWPORT_SIZE * viewportRatio.value,\n left: viewportLeft.value,\n top: viewportTop.value,\n }))\n\n // 监听画布尺寸发生变化时,更新可视区域的位置\n const resizeObserver = new ResizeObserver(setViewportPosition)\n\n onMounted(() => {\n if (canvasRef.value) resizeObserver.observe(canvasRef.value)\n })\n onUnmounted(() => {\n if (canvasRef.value) resizeObserver.unobserve(canvasRef.value)\n })\n\n // 拖拽画布\n const dragViewport = (e: MouseEvent) => {\n let isMouseDown = true\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n\n const originLeft = viewportLeft.value\n const originTop = viewportTop.value\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n viewportLeft.value = originLeft + (currentPageX - startPageX)\n viewportTop.value = originTop + (currentPageY - startPageY)\n }\n\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n mainStore.setCanvasDragged(true)\n }\n }\n\n return {\n viewportStyles,\n dragViewport,\n }\n}","import { Ref, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { getElementRange } from '@/utils/element'\n\nexport default (elementList: Ref, viewportRef: Ref) => {\n const mainStore = useMainStore()\n const { canvasScale } = storeToRefs(mainStore)\n\n const mouseSelectionVisible = ref(false)\n const mouseSelectionQuadrant = ref(1)\n const mouseSelection = ref({\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n })\n\n // 更新鼠标框选范围\n const updateMouseSelection = (e: MouseEvent) => {\n if (!viewportRef.value) return\n\n let isMouseDown = true\n const viewportRect = viewportRef.value.getBoundingClientRect()\n\n const minSelectionRange = 5\n \n const startPageX = e.pageX\n const startPageY = e.pageY\n\n const left = (startPageX - viewportRect.x) / canvasScale.value\n const top = (startPageY - viewportRect.y) / canvasScale.value\n\n // 确定框选的起始位置和其他默认值初始化\n mouseSelection.value = {\n top: top,\n left: left,\n width: 0,\n height: 0,\n }\n mouseSelectionVisible.value = false\n mouseSelectionQuadrant.value = 4\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n const offsetWidth = (currentPageX - startPageX) / canvasScale.value\n const offsetHeight = (currentPageY - startPageY) / canvasScale.value\n\n const width = Math.abs(offsetWidth)\n const height = Math.abs(offsetHeight)\n\n if ( width < minSelectionRange || height < minSelectionRange ) return\n \n // 计算鼠标框选(移动)的方向\n // 按四个象限的位置区分,如右下角为第四象限\n let quadrant = 0\n if ( offsetWidth > 0 && offsetHeight > 0 ) quadrant = 4\n else if ( offsetWidth < 0 && offsetHeight < 0 ) quadrant = 1\n else if ( offsetWidth > 0 && offsetHeight < 0 ) quadrant = 2\n else if ( offsetWidth < 0 && offsetHeight > 0 ) quadrant = 3\n\n // 更新框选范围\n mouseSelection.value = {\n ...mouseSelection.value,\n width: width,\n height: height,\n }\n mouseSelectionVisible.value = true\n mouseSelectionQuadrant.value = quadrant\n }\n\n document.onmouseup = () => {\n document.onmousemove = null\n document.onmouseup = null\n isMouseDown = false\n\n // 计算画布中的元素是否处在鼠标选择范围中,处在范围中的元素设置为被选中状态\n let inRangeElementList: PPTElement[] = []\n for (let i = 0; i < elementList.value.length; i++) {\n const element = elementList.value[i]\n const mouseSelectionLeft = mouseSelection.value.left\n const mouseSelectionTop = mouseSelection.value.top\n const mouseSelectionWidth = mouseSelection.value.width\n const mouseSelectionHeight = mouseSelection.value.height\n\n const { minX, maxX, minY, maxY } = getElementRange(element)\n\n // 计算元素是否处在框选范围内时,四个框选方向的计算方式有差异\n let isInclude = false\n if (mouseSelectionQuadrant.value === 4) {\n isInclude = minX > mouseSelectionLeft && \n maxX < mouseSelectionLeft + mouseSelectionWidth && \n minY > mouseSelectionTop && \n maxY < mouseSelectionTop + mouseSelectionHeight\n }\n else if (mouseSelectionQuadrant.value === 1) {\n isInclude = minX > (mouseSelectionLeft - mouseSelectionWidth) && \n maxX < (mouseSelectionLeft - mouseSelectionWidth) + mouseSelectionWidth && \n minY > (mouseSelectionTop - mouseSelectionHeight) && \n maxY < (mouseSelectionTop - mouseSelectionHeight) + mouseSelectionHeight\n }\n else if (mouseSelectionQuadrant.value === 2) {\n isInclude = minX > mouseSelectionLeft && \n maxX < mouseSelectionLeft + mouseSelectionWidth && \n minY > (mouseSelectionTop - mouseSelectionHeight) && \n maxY < (mouseSelectionTop - mouseSelectionHeight) + mouseSelectionHeight\n }\n else if (mouseSelectionQuadrant.value === 3) {\n isInclude = minX > (mouseSelectionLeft - mouseSelectionWidth) && \n maxX < (mouseSelectionLeft - mouseSelectionWidth) + mouseSelectionWidth && \n minY > mouseSelectionTop && \n maxY < mouseSelectionTop + mouseSelectionHeight\n }\n\n // 被锁定的元素即使在范围内,也不需要设置为选中状态\n if (isInclude && !element.lock) inRangeElementList.push(element)\n }\n\n // 如果范围内有组合元素的成员,需要该组全部成员都处在范围内,才会被设置为选中状态\n inRangeElementList = inRangeElementList.filter(inRangeElement => {\n if (inRangeElement.groupId) {\n const inRangeElementIdList = inRangeElementList.map(inRangeElement => inRangeElement.id)\n const groupElementList = elementList.value.filter(element => element.groupId === inRangeElement.groupId)\n return groupElementList.every(groupElement => inRangeElementIdList.includes(groupElement.id))\n }\n return true\n })\n const inRangeElementIdList = inRangeElementList.map(inRangeElement => inRangeElement.id)\n mainStore.setActiveElementIdList(inRangeElementIdList)\n\n mouseSelectionVisible.value = false\n }\n }\n\n return {\n mouseSelection,\n mouseSelectionVisible,\n mouseSelectionQuadrant,\n updateMouseSelection,\n }\n}","import { onMounted, onUnmounted, Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { getImageDataURL } from '@/utils/image'\nimport { parseText2Paragraphs } from '@/utils/textParser'\nimport useCreateElement from '@/hooks/useCreateElement'\n\nexport default (elementRef: Ref) => {\n const { disableHotkeys } = storeToRefs(useMainStore())\n\n const { createImageElement, createTextElement } = useCreateElement()\n\n // 拖拽元素到画布中\n const handleDrop = (e: DragEvent) => {\n if (!e.dataTransfer || e.dataTransfer.items.length === 0) return\n const dataTransferItem = e.dataTransfer.items[0]\n\n // 检查事件对象中是否存在图片,存在则插入图片,否则继续检查是否存在文字,存在则插入文字\n if (dataTransferItem.kind === 'file' && dataTransferItem.type.indexOf('image') !== -1) {\n const imageFile = dataTransferItem.getAsFile()\n if (imageFile) {\n getImageDataURL(imageFile).then(dataURL => createImageElement(dataURL))\n }\n }\n else if (dataTransferItem.kind === 'string' && dataTransferItem.type === 'text/plain') {\n dataTransferItem.getAsString(text => {\n if (disableHotkeys.value) return\n const string = parseText2Paragraphs(text)\n createTextElement({\n left: 0,\n top: 0,\n width: 600,\n height: 50,\n }, string)\n })\n }\n }\n\n onMounted(() => {\n elementRef.value && elementRef.value.addEventListener('drop', handleDrop)\n\n document.ondragleave = e => e.preventDefault()\n document.ondrop = e => e.preventDefault()\n document.ondragenter = e => e.preventDefault()\n document.ondragover = e => e.preventDefault()\n })\n onUnmounted(() => {\n elementRef.value && elementRef.value.removeEventListener('drop', handleDrop)\n\n document.ondragleave = null\n document.ondrop = null\n document.ondragenter = null\n document.ondragover = null\n })\n}","import { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement, PPTLineElement, PPTVideoElement, PPTAudioElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n/**\n * 计算给定坐标到原点连线的弧度\n * @param x 坐标x\n * @param y 坐标y\n */\nconst getAngleFromCoordinate = (x: number, y: number) => {\n const radian = Math.atan2(x, y)\n const angle = 180 / Math.PI * radian\n return angle\n}\n\nexport default (elementList: Ref, viewportRef: Ref) => {\n const slidesStore = useSlidesStore()\n const { canvasScale } = storeToRefs(useMainStore())\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 旋转元素\n const rotateElement = (element: Exclude) => {\n let isMouseDown = true\n let angle = 0\n const elOriginRotate = element.rotate || 0\n\n const elLeft = element.left\n const elTop = element.top\n const elWidth = element.width\n const elHeight = element.height\n\n // 元素中心点(旋转中心点)\n const centerX = elLeft + elWidth / 2\n const centerY = elTop + elHeight / 2\n\n if (!viewportRef.value) return\n const viewportRect = viewportRef.value.getBoundingClientRect()\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n \n // 计算当前鼠标位置相对元素中心点连线的角度(弧度)\n const mouseX = (e.pageX - viewportRect.left) / canvasScale.value\n const mouseY = (e.pageY - viewportRect.top) / canvasScale.value\n const x = mouseX - centerX\n const y = centerY - mouseY\n\n angle = getAngleFromCoordinate(x, y)\n\n // 靠近45倍数的角度时有吸附效果\n const sorptionRange = 5\n if ( Math.abs(angle) <= sorptionRange ) angle = 0\n else if ( angle > 0 && Math.abs(angle - 45) <= sorptionRange ) angle -= (angle - 45)\n else if ( angle < 0 && Math.abs(angle + 45) <= sorptionRange ) angle -= (angle + 45)\n else if ( angle > 0 && Math.abs(angle - 90) <= sorptionRange ) angle -= (angle - 90)\n else if ( angle < 0 && Math.abs(angle + 90) <= sorptionRange ) angle -= (angle + 90)\n else if ( angle > 0 && Math.abs(angle - 135) <= sorptionRange ) angle -= (angle - 135)\n else if ( angle < 0 && Math.abs(angle + 135) <= sorptionRange ) angle -= (angle + 135)\n else if ( angle > 0 && Math.abs(angle - 180) <= sorptionRange ) angle -= (angle - 180)\n else if ( angle < 0 && Math.abs(angle + 180) <= sorptionRange ) angle -= (angle + 180)\n\n elementList.value = elementList.value.map(el => element.id === el.id ? { ...el, rotate: angle } : el)\n }\n\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n if (elOriginRotate === angle) return\n\n slidesStore.updateSlide({ elements: elementList.value })\n addHistorySnapshot()\n }\n }\n\n return {\n rotateElement,\n }\n}","export const ELEMENT_TYPE_ZH = {\n text: '文本',\n image: '图片',\n shape: '形状',\n line: '线条',\n chart: '图表',\n table: '表格',\n video: '视频',\n audio: '音频',\n}\n\nexport const MIN_SIZE = {\n text: 20,\n image: 20,\n shape: 15,\n chart: 200,\n table: 20,\n video: 250,\n audio: 20,\n}","import { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore, useKeyboardStore } from '@/store'\nimport { PPTElement, PPTImageElement, PPTLineElement, PPTShapeElement } from '@/types/slides'\nimport { OperateResizeHandlers, AlignmentLineProps, MultiSelectRange } from '@/types/edit'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport { MIN_SIZE } from '@/configs/element'\nimport { SHAPE_PATH_FORMULAS } from '@/configs/shapes'\nimport { AlignLine, uniqAlignLines } from '@/utils/element'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface RotateElementData {\n left: number\n top: number\n width: number\n height: number\n}\n\n/**\n * 计算旋转后的元素八个缩放点的位置\n * @param element 元素原始位置大小信息\n * @param angle 旋转角度\n */\nconst getRotateElementPoints = (element: RotateElementData, angle: number) => {\n const { left, top, width, height } = element\n\n const radius = Math.sqrt( Math.pow(width, 2) + Math.pow(height, 2) ) / 2\n const auxiliaryAngle = Math.atan(height / width) * 180 / Math.PI\n\n const tlbraRadian = (180 - angle - auxiliaryAngle) * Math.PI / 180\n const trblaRadian = (auxiliaryAngle - angle) * Math.PI / 180\n const taRadian = (90 - angle) * Math.PI / 180\n const raRadian = angle * Math.PI / 180\n\n const halfWidth = width / 2\n const halfHeight = height / 2\n\n const middleLeft = left + halfWidth\n const middleTop = top + halfHeight\n\n const leftTopPoint = {\n left: middleLeft + radius * Math.cos(tlbraRadian),\n top: middleTop - radius * Math.sin(tlbraRadian),\n }\n const topPoint = {\n left: middleLeft + halfHeight * Math.cos(taRadian),\n top: middleTop - halfHeight * Math.sin(taRadian),\n }\n const rightTopPoint = {\n left: middleLeft + radius * Math.cos(trblaRadian),\n top: middleTop - radius * Math.sin(trblaRadian),\n }\n const rightPoint = {\n left: middleLeft + halfWidth * Math.cos(raRadian),\n top: middleTop + halfWidth * Math.sin(raRadian),\n }\n const rightBottomPoint = {\n left: middleLeft - radius * Math.cos(tlbraRadian),\n top: middleTop + radius * Math.sin(tlbraRadian),\n }\n const bottomPoint = {\n left: middleLeft - halfHeight * Math.sin(raRadian),\n top: middleTop + halfHeight * Math.cos(raRadian),\n }\n const leftBottomPoint = {\n left: middleLeft - radius * Math.cos(trblaRadian),\n top: middleTop + radius * Math.sin(trblaRadian),\n }\n const leftPoint = {\n left: middleLeft - halfWidth * Math.cos(raRadian),\n top: middleTop - halfWidth * Math.sin(raRadian),\n }\n\n return { leftTopPoint, topPoint, rightTopPoint, rightPoint, rightBottomPoint, bottomPoint, leftBottomPoint, leftPoint }\n}\n\n/**\n * 获取元素某缩放点相对的另一个点的位置,如:【上】对应【下】、【左上】对应【右下】\n * @param direction 当前操作的缩放点\n * @param points 旋转后的元素八个缩放点的位置\n */\nconst getOppositePoint = (direction: string, points: ReturnType): { left: number; top: number } => {\n const oppositeMap = {\n [OperateResizeHandlers.RIGHT_BOTTOM]: points.leftTopPoint,\n [OperateResizeHandlers.LEFT_BOTTOM]: points.rightTopPoint,\n [OperateResizeHandlers.LEFT_TOP]: points.rightBottomPoint,\n [OperateResizeHandlers.RIGHT_TOP]: points.leftBottomPoint,\n [OperateResizeHandlers.TOP]: points.bottomPoint,\n [OperateResizeHandlers.BOTTOM]: points.topPoint,\n [OperateResizeHandlers.LEFT]: points.rightPoint,\n [OperateResizeHandlers.RIGHT]: points.leftPoint,\n }\n return oppositeMap[direction]\n}\n\nexport default (\n elementList: Ref,\n alignmentLines: Ref,\n canvasScale: Ref,\n) => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { activeElementIdList, activeGroupElementId } = storeToRefs(mainStore)\n const { viewportRatio } = storeToRefs(slidesStore)\n const { ctrlOrShiftKeyActive } = storeToRefs(useKeyboardStore())\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 缩放元素\n const scaleElement = (e: MouseEvent | TouchEvent, element: Exclude, command: OperateResizeHandlers) => {\n const isTouchEvent = !(e instanceof MouseEvent)\n if (isTouchEvent && (!e.changedTouches || !e.changedTouches[0])) return\n\n let isMouseDown = true\n mainStore.setScalingState(true)\n\n const elOriginLeft = element.left\n const elOriginTop = element.top\n const elOriginWidth = element.width\n const elOriginHeight = element.height\n \n const elRotate = ('rotate' in element && element.rotate) ? element.rotate : 0\n const rotateRadian = Math.PI * elRotate / 180\n\n const fixedRatio = ctrlOrShiftKeyActive.value || ('fixedRatio' in element && element.fixedRatio)\n const aspectRatio = elOriginWidth / elOriginHeight\n\n const startPageX = isTouchEvent ? e.changedTouches[0].pageX : e.pageX\n const startPageY = isTouchEvent ? e.changedTouches[0].pageY : e.pageY\n\n // 元素最小缩放限制\n const minSize = MIN_SIZE[element.type] || 20\n const getSizeWithinRange = (size: number) => size < minSize ? minSize : size\n\n let points: ReturnType\n let baseLeft = 0\n let baseTop = 0\n let horizontalLines: AlignLine[] = []\n let verticalLines: AlignLine[] = []\n\n // 旋转后的元素进行缩放时,引入基点的概念,以当前操作的缩放点相对的点为基点\n // 例如拖动右下角缩放时,左上角为基点,需要保持左上角不变然后修改其他的点的位置来达到所放的效果\n if ('rotate' in element && element.rotate) {\n const { left, top, width, height } = element\n points = getRotateElementPoints({ left, top, width, height }, elRotate)\n const oppositePoint = getOppositePoint(command, points)\n\n baseLeft = oppositePoint.left\n baseTop = oppositePoint.top\n }\n\n // 未旋转的元素具有缩放时的对齐吸附功能,在此处收集对齐对齐吸附线\n // 包括页面内除目标元素外的其他元素在画布中的各个可吸附对齐位置:上下左右四边\n // 其中线条和被旋转过的元素不参与吸附对齐\n else {\n const edgeWidth = VIEWPORT_SIZE\n const edgeHeight = VIEWPORT_SIZE * viewportRatio.value\n const isActiveGroupElement = element.id === activeGroupElementId.value\n \n for (const el of elementList.value) {\n if ('rotate' in el && el.rotate) continue\n if (el.type === 'line') continue\n if (isActiveGroupElement && el.id === element.id) continue\n if (!isActiveGroupElement && activeElementIdList.value.includes(el.id)) continue\n\n const left = el.left\n const top = el.top\n const width = el.width\n const height = el.height\n const right = left + width\n const bottom = top + height\n\n const topLine: AlignLine = { value: top, range: [left, right] }\n const bottomLine: AlignLine = { value: bottom, range: [left, right] }\n const leftLine: AlignLine = { value: left, range: [top, bottom] }\n const rightLine: AlignLine = { value: right, range: [top, bottom] }\n\n horizontalLines.push(topLine, bottomLine)\n verticalLines.push(leftLine, rightLine)\n }\n\n // 画布可视区域的四个边界、水平中心、垂直中心\n const edgeTopLine: AlignLine = { value: 0, range: [0, edgeWidth] }\n const edgeBottomLine: AlignLine = { value: edgeHeight, range: [0, edgeWidth] }\n const edgeHorizontalCenterLine: AlignLine = { value: edgeHeight / 2, range: [0, edgeWidth] }\n const edgeLeftLine: AlignLine = { value: 0, range: [0, edgeHeight] }\n const edgeRightLine: AlignLine = { value: edgeWidth, range: [0, edgeHeight] }\n const edgeVerticalCenterLine: AlignLine = { value: edgeWidth / 2, range: [0, edgeHeight] }\n\n horizontalLines.push(edgeTopLine, edgeBottomLine, edgeHorizontalCenterLine)\n verticalLines.push(edgeLeftLine, edgeRightLine, edgeVerticalCenterLine)\n \n horizontalLines = uniqAlignLines(horizontalLines)\n verticalLines = uniqAlignLines(verticalLines)\n }\n \n // 对齐吸附方法\n // 将收集到的对齐吸附线与计算的目标元素当前的位置大小相关数据做对比,差值小于设定的值时执行自动缩放校正\n // 水平和垂直两个方向需要分开计算\n const alignedAdsorption = (currentX: number | null, currentY: number | null) => {\n const sorptionRange = 5\n\n const _alignmentLines: AlignmentLineProps[] = []\n let isVerticalAdsorbed = false\n let isHorizontalAdsorbed = false\n const correctionVal = { offsetX: 0, offsetY: 0 }\n \n if (currentY || currentY === 0) {\n for (let i = 0; i < horizontalLines.length; i++) {\n const { value, range } = horizontalLines[i]\n const min = Math.min(...range, currentX || 0)\n const max = Math.max(...range, currentX || 0)\n \n if (Math.abs(currentY - value) < sorptionRange && !isHorizontalAdsorbed) {\n correctionVal.offsetY = currentY - value\n isHorizontalAdsorbed = true\n _alignmentLines.push({ type: 'horizontal', axis: {x: min - 50, y: value}, length: max - min + 100 })\n }\n }\n }\n if (currentX || currentX === 0) {\n for (let i = 0; i < verticalLines.length; i++) {\n const { value, range } = verticalLines[i]\n const min = Math.min(...range, (currentY || 0))\n const max = Math.max(...range, (currentY || 0))\n\n if (Math.abs(currentX - value) < sorptionRange && !isVerticalAdsorbed) {\n correctionVal.offsetX = currentX - value\n isVerticalAdsorbed = true\n _alignmentLines.push({ type: 'vertical', axis: {x: value, y: min - 50}, length: max - min + 100 })\n }\n }\n }\n alignmentLines.value = _alignmentLines\n return correctionVal\n }\n\n const handleMousemove = (e: MouseEvent | TouchEvent) => {\n if (!isMouseDown) return\n\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n\n const x = currentPageX - startPageX\n const y = currentPageY - startPageY\n\n let width = elOriginWidth\n let height = elOriginHeight\n let left = elOriginLeft\n let top = elOriginTop\n \n // 元素被旋转的情况下,需要根据元素旋转的角度,重新计算需要缩放的距离(鼠标按下后移动的距离)\n if (elRotate) {\n const revisedX = (Math.cos(rotateRadian) * x + Math.sin(rotateRadian) * y) / canvasScale.value\n let revisedY = (Math.cos(rotateRadian) * y - Math.sin(rotateRadian) * x) / canvasScale.value\n\n // 锁定宽高比例(仅四个角可能触发,四条边不会触发)\n // 以水平方向上缩放的距离为基础,计算垂直方向上的缩放距离,保持二者具有相同的缩放比例\n if (fixedRatio) {\n if (command === OperateResizeHandlers.RIGHT_BOTTOM || command === OperateResizeHandlers.LEFT_TOP) revisedY = revisedX / aspectRatio\n if (command === OperateResizeHandlers.LEFT_BOTTOM || command === OperateResizeHandlers.RIGHT_TOP) revisedY = -revisedX / aspectRatio\n }\n\n // 根据不同的操作点分别计算元素缩放后的大小和位置\n // 需要注意:\n // 此处计算的位置需要在后面重新进行校正,因为旋转后再缩放事实上会改变元素基点的位置(虽然视觉上基点保持不动,但这是【旋转】+【移动】共同作用的结果)\n // 但此处计算的大小不需要重新校正,因为前面已经重新计算需要缩放的距离,相当于大小已经经过了校正\n if (command === OperateResizeHandlers.RIGHT_BOTTOM) {\n width = getSizeWithinRange(elOriginWidth + revisedX)\n height = getSizeWithinRange(elOriginHeight + revisedY)\n }\n else if (command === OperateResizeHandlers.LEFT_BOTTOM) {\n width = getSizeWithinRange(elOriginWidth - revisedX)\n height = getSizeWithinRange(elOriginHeight + revisedY)\n left = elOriginLeft - (width - elOriginWidth)\n }\n else if (command === OperateResizeHandlers.LEFT_TOP) {\n width = getSizeWithinRange(elOriginWidth - revisedX)\n height = getSizeWithinRange(elOriginHeight - revisedY)\n left = elOriginLeft - (width - elOriginWidth)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.RIGHT_TOP) {\n width = getSizeWithinRange(elOriginWidth + revisedX)\n height = getSizeWithinRange(elOriginHeight - revisedY)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.TOP) {\n height = getSizeWithinRange(elOriginHeight - revisedY)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.BOTTOM) {\n height = getSizeWithinRange(elOriginHeight + revisedY)\n }\n else if (command === OperateResizeHandlers.LEFT) {\n width = getSizeWithinRange(elOriginWidth - revisedX)\n left = elOriginLeft - (width - elOriginWidth)\n }\n else if (command === OperateResizeHandlers.RIGHT) {\n width = getSizeWithinRange(elOriginWidth + revisedX)\n }\n\n // 获取当前元素的基点坐标,与初始状态时的基点坐标进行对比,并计算差值进行元素位置的校正\n const currentPoints = getRotateElementPoints({ width, height, left, top }, elRotate)\n const currentOppositePoint = getOppositePoint(command, currentPoints)\n const currentBaseLeft = currentOppositePoint.left\n const currentBaseTop = currentOppositePoint.top\n\n const offsetX = currentBaseLeft - baseLeft\n const offsetY = currentBaseTop - baseTop\n\n left = left - offsetX\n top = top - offsetY\n }\n\n // 元素未被旋转的情况下,正常计算新的位置大小即可,无需复杂的校正等工作\n // 额外需要处理对齐吸附相关的操作\n // 锁定宽高比例相关的操作同上,不再赘述\n else {\n let moveX = x / canvasScale.value\n let moveY = y / canvasScale.value\n\n if (fixedRatio) {\n if (command === OperateResizeHandlers.RIGHT_BOTTOM || command === OperateResizeHandlers.LEFT_TOP) moveY = moveX / aspectRatio\n if (command === OperateResizeHandlers.LEFT_BOTTOM || command === OperateResizeHandlers.RIGHT_TOP) moveY = -moveX / aspectRatio\n }\n\n if (command === OperateResizeHandlers.RIGHT_BOTTOM) {\n const { offsetX, offsetY } = alignedAdsorption(elOriginLeft + elOriginWidth + moveX, elOriginTop + elOriginHeight + moveY)\n moveX = moveX - offsetX\n moveY = moveY - offsetY\n if (fixedRatio) {\n if (offsetY) moveX = moveY * aspectRatio\n else moveY = moveX / aspectRatio\n }\n width = getSizeWithinRange(elOriginWidth + moveX)\n height = getSizeWithinRange(elOriginHeight + moveY)\n }\n else if (command === OperateResizeHandlers.LEFT_BOTTOM) {\n const { offsetX, offsetY } = alignedAdsorption(elOriginLeft + moveX, elOriginTop + elOriginHeight + moveY)\n moveX = moveX - offsetX\n moveY = moveY - offsetY\n if (fixedRatio) {\n if (offsetY) moveX = -moveY * aspectRatio\n else moveY = -moveX / aspectRatio\n }\n width = getSizeWithinRange(elOriginWidth - moveX)\n height = getSizeWithinRange(elOriginHeight + moveY)\n left = elOriginLeft - (width - elOriginWidth)\n }\n else if (command === OperateResizeHandlers.LEFT_TOP) {\n const { offsetX, offsetY } = alignedAdsorption(elOriginLeft + moveX, elOriginTop + moveY)\n moveX = moveX - offsetX\n moveY = moveY - offsetY\n if (fixedRatio) {\n if (offsetY) moveX = moveY * aspectRatio\n else moveY = moveX / aspectRatio\n }\n width = getSizeWithinRange(elOriginWidth - moveX)\n height = getSizeWithinRange(elOriginHeight - moveY)\n left = elOriginLeft - (width - elOriginWidth)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.RIGHT_TOP) {\n const { offsetX, offsetY } = alignedAdsorption(elOriginLeft + elOriginWidth + moveX, elOriginTop + moveY)\n moveX = moveX - offsetX\n moveY = moveY - offsetY\n if (fixedRatio) {\n if (offsetY) moveX = -moveY * aspectRatio\n else moveY = -moveX / aspectRatio\n }\n width = getSizeWithinRange(elOriginWidth + moveX)\n height = getSizeWithinRange(elOriginHeight - moveY)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.LEFT) {\n const { offsetX } = alignedAdsorption(elOriginLeft + moveX, null)\n moveX = moveX - offsetX\n width = getSizeWithinRange(elOriginWidth - moveX)\n left = elOriginLeft - (width - elOriginWidth)\n }\n else if (command === OperateResizeHandlers.RIGHT) {\n const { offsetX } = alignedAdsorption(elOriginLeft + elOriginWidth + moveX, null)\n moveX = moveX - offsetX\n width = getSizeWithinRange(elOriginWidth + moveX)\n }\n else if (command === OperateResizeHandlers.TOP) {\n const { offsetY } = alignedAdsorption(null, elOriginTop + moveY)\n moveY = moveY - offsetY\n height = getSizeWithinRange(elOriginHeight - moveY)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.BOTTOM) {\n const { offsetY } = alignedAdsorption(null, elOriginTop + elOriginHeight + moveY)\n moveY = moveY - offsetY\n height = getSizeWithinRange(elOriginHeight + moveY)\n }\n }\n \n elementList.value = elementList.value.map(el => {\n if (element.id !== el.id) return el\n if (el.type === 'shape' && 'pathFormula' in el && el.pathFormula) {\n const pathFormula = SHAPE_PATH_FORMULAS[el.pathFormula]\n\n let path = ''\n if ('editable' in pathFormula) path = pathFormula.formula(width, height, el.keypoint!)\n else path = pathFormula.formula(width, height)\n\n return {\n ...el, left, top, width, height,\n viewBox: [width, height],\n path,\n }\n }\n return { ...el, left, top, width, height }\n })\n }\n\n const handleMouseup = (e: MouseEvent | TouchEvent) => {\n isMouseDown = false\n \n document.ontouchmove = null\n document.ontouchend = null\n document.onmousemove = null\n document.onmouseup = null\n\n alignmentLines.value = []\n\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n \n if (startPageX === currentPageX && startPageY === currentPageY) return\n \n slidesStore.updateSlide({ elements: elementList.value })\n mainStore.setScalingState(false)\n \n addHistorySnapshot()\n }\n\n if (isTouchEvent) {\n document.ontouchmove = handleMousemove\n document.ontouchend = handleMouseup\n }\n else {\n document.onmousemove = handleMousemove\n document.onmouseup = handleMouseup\n }\n }\n\n // 多选元素缩放\n const scaleMultiElement = (e: MouseEvent, range: MultiSelectRange, command: OperateResizeHandlers) => {\n let isMouseDown = true\n \n const { minX, maxX, minY, maxY } = range\n const operateWidth = maxX - minX\n const operateHeight = maxY - minY\n const aspectRatio = operateWidth / operateHeight\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n\n const originElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList.value))\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n \n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n const x = (currentPageX - startPageX) / canvasScale.value\n let y = (currentPageY - startPageY) / canvasScale.value\n\n // 锁定宽高比例,逻辑同上\n if (ctrlOrShiftKeyActive.value) {\n if (command === OperateResizeHandlers.RIGHT_BOTTOM || command === OperateResizeHandlers.LEFT_TOP) y = x / aspectRatio\n if (command === OperateResizeHandlers.LEFT_BOTTOM || command === OperateResizeHandlers.RIGHT_TOP) y = -x / aspectRatio\n }\n\n // 所有选中元素的整体范围\n let currentMinX = minX\n let currentMaxX = maxX\n let currentMinY = minY\n let currentMaxY = maxY\n\n if (command === OperateResizeHandlers.RIGHT_BOTTOM) {\n currentMaxX = maxX + x\n currentMaxY = maxY + y\n }\n else if (command === OperateResizeHandlers.LEFT_BOTTOM) {\n currentMinX = minX + x\n currentMaxY = maxY + y\n }\n else if (command === OperateResizeHandlers.LEFT_TOP) {\n currentMinX = minX + x\n currentMinY = minY + y\n }\n else if (command === OperateResizeHandlers.RIGHT_TOP) {\n currentMaxX = maxX + x\n currentMinY = minY + y\n }\n else if (command === OperateResizeHandlers.TOP) {\n currentMinY = minY + y\n }\n else if (command === OperateResizeHandlers.BOTTOM) {\n currentMaxY = maxY + y\n }\n else if (command === OperateResizeHandlers.LEFT) {\n currentMinX = minX + x\n }\n else if (command === OperateResizeHandlers.RIGHT) {\n currentMaxX = maxX + x\n }\n\n // 所有选中元素的整体宽高\n const currentOppositeWidth = currentMaxX - currentMinX\n const currentOppositeHeight = currentMaxY - currentMinY\n\n // 当前正在操作元素宽高占所有选中元素的整体宽高的比例\n let widthScale = currentOppositeWidth / operateWidth\n let heightScale = currentOppositeHeight / operateHeight\n\n if (widthScale <= 0) widthScale = 0\n if (heightScale <= 0) heightScale = 0\n \n // 根据前面计算的比例,计算并修改所有选中元素的位置大小\n elementList.value = elementList.value.map(el => {\n if ((el.type === 'image' || el.type === 'shape') && activeElementIdList.value.includes(el.id)) {\n const originElement = originElementList.find(originEl => originEl.id === el.id) as PPTImageElement | PPTShapeElement\n return {\n ...el,\n width: originElement.width * widthScale,\n height: originElement.height * heightScale,\n left: currentMinX + (originElement.left - minX) * widthScale,\n top: currentMinY + (originElement.top - minY) * heightScale,\n }\n }\n return el\n })\n }\n\n document.onmouseup = e => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n if (startPageX === e.pageX && startPageY === e.pageY) return\n\n slidesStore.updateSlide({ elements: elementList.value })\n addHistorySnapshot()\n }\n }\n\n return {\n scaleElement,\n scaleMultiElement,\n }\n}","import { Ref } from 'vue'\nimport { uniq } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useKeyboardStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\n\nexport default (\n elementList: Ref,\n moveElement: (e: MouseEvent | TouchEvent, element: PPTElement) => void,\n) => {\n const mainStore = useMainStore()\n const { activeElementIdList, activeGroupElementId, handleElementId, editorAreaFocus } = storeToRefs(mainStore)\n const { ctrlOrShiftKeyActive } = storeToRefs(useKeyboardStore())\n\n // 选中元素\n // startMove 表示是否需要再选中操作后进入到开始移动的状态\n const selectElement = (e: MouseEvent | TouchEvent, element: PPTElement, startMove = true) => {\n if (!editorAreaFocus.value) mainStore.setEditorareaFocus(true)\n\n // 如果目标元素当前未被选中,则将他设为选中状态\n // 此时如果按下Ctrl键或Shift键,则进入多选状态,将当前已选中的元素和目标元素一起设置为选中状态,否则仅将目标元素设置为选中状态\n // 如果目标元素是分组成员,需要将该组合的其他元素一起设置为选中状态\n if (!activeElementIdList.value.includes(element.id)) {\n let newActiveIdList: string[] = []\n\n if (ctrlOrShiftKeyActive.value) {\n newActiveIdList = [...activeElementIdList.value, element.id]\n }\n else newActiveIdList = [element.id]\n \n if (element.groupId) {\n const groupMembersId: string[] = []\n elementList.value.forEach((el: PPTElement) => {\n if (el.groupId === element.groupId) groupMembersId.push(el.id)\n })\n newActiveIdList = [...newActiveIdList, ...groupMembersId]\n }\n\n mainStore.setActiveElementIdList(uniq(newActiveIdList))\n mainStore.setHandleElementId(element.id)\n }\n\n // 如果目标元素已被选中,且按下了Ctrl键或Shift键,则取消其被选中状态\n // 除非目标元素是最后的一个被选中元素,或者目标元素所在的组合是最后一组选中组合\n // 如果目标元素是分组成员,需要将该组合的其他元素一起取消选中状态\n else if (ctrlOrShiftKeyActive.value) {\n let newActiveIdList: string[] = []\n\n if (element.groupId) {\n const groupMembersId: string[] = []\n elementList.value.forEach((el: PPTElement) => {\n if (el.groupId === element.groupId) groupMembersId.push(el.id)\n })\n newActiveIdList = activeElementIdList.value.filter(id => !groupMembersId.includes(id))\n }\n else {\n newActiveIdList = activeElementIdList.value.filter(id => id !== element.id)\n }\n\n if (newActiveIdList.length > 0) {\n mainStore.setActiveElementIdList(newActiveIdList)\n }\n }\n\n // 如果目标元素已被选中,同时目标元素不是当前操作元素,则将其设置为当前操作元素\n else if (handleElementId.value !== element.id) {\n mainStore.setHandleElementId(element.id)\n }\n\n // 如果目标元素已被选中,同时也是当前操作元素,那么当目标元素在该状态下再次被点击时,将被设置为多选元素中的激活成员\n else if (activeGroupElementId.value !== element.id) {\n const startPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const startPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n\n ;(e.target as HTMLElement).onmouseup = (e: MouseEvent) => {\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n if (startPageX === currentPageX && startPageY === currentPageY) {\n mainStore.setActiveGroupElementId(element.id)\n ;(e.target as HTMLElement).onmouseup = null\n }\n }\n }\n\n if (startMove) moveElement(e, element)\n }\n\n // 选中页面内的全部元素\n const selectAllElement = () => {\n const unlockedElements = elementList.value.filter(el => !el.lock)\n const newActiveElementIdList = unlockedElements.map(el => el.id)\n mainStore.setActiveElementIdList(newActiveElementIdList)\n }\n\n return {\n selectElement,\n selectAllElement,\n }\n}\n","import { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { AlignmentLineProps } from '@/types/edit'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport { getRectRotatedRange, AlignLine, uniqAlignLines } from '@/utils/element'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default (\n elementList: Ref,\n alignmentLines: Ref,\n canvasScale: Ref,\n) => {\n const slidesStore = useSlidesStore()\n const { activeElementIdList, activeGroupElementId } = storeToRefs(useMainStore())\n const { viewportRatio } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n const dragElement = (e: MouseEvent | TouchEvent, element: PPTElement) => {\n const isTouchEvent = !(e instanceof MouseEvent)\n if (isTouchEvent && (!e.changedTouches || !e.changedTouches[0])) return\n\n if (!activeElementIdList.value.includes(element.id)) return\n let isMouseDown = true\n\n const edgeWidth = VIEWPORT_SIZE\n const edgeHeight = VIEWPORT_SIZE * viewportRatio.value\n \n const sorptionRange = 5\n\n const originElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList.value))\n const originActiveElementList = originElementList.filter(el => activeElementIdList.value.includes(el.id))\n \n const elOriginLeft = element.left\n const elOriginTop = element.top\n const elOriginWidth = element.width\n const elOriginHeight = ('height' in element && element.height) ? element.height : 0\n const elOriginRotate = ('rotate' in element && element.rotate) ? element.rotate : 0\n \n const startPageX = isTouchEvent ? e.changedTouches[0].pageX : e.pageX\n const startPageY = isTouchEvent ? e.changedTouches[0].pageY : e.pageY\n\n let isMisoperation: boolean | null = null\n\n const isActiveGroupElement = element.id === activeGroupElementId.value\n\n // 收集对齐对齐吸附线\n // 包括页面内除目标元素外的其他元素在画布中的各个可吸附对齐位置:上下左右四边,水平中心、垂直中心\n // 其中线条和被旋转过的元素需要重新计算他们在画布中的中心点位置的范围\n let horizontalLines: AlignLine[] = []\n let verticalLines: AlignLine[] = []\n\n for (const el of elementList.value) {\n if (el.type === 'line') continue\n if (isActiveGroupElement && el.id === element.id) continue\n if (!isActiveGroupElement && activeElementIdList.value.includes(el.id)) continue\n\n let left, top, width, height\n if ('rotate' in el && el.rotate) {\n const { xRange, yRange } = getRectRotatedRange({\n left: el.left,\n top: el.top,\n width: el.width,\n height: el.height,\n rotate: el.rotate,\n })\n left = xRange[0]\n top = yRange[0]\n width = xRange[1] - xRange[0]\n height = yRange[1] - yRange[0]\n }\n else {\n left = el.left\n top = el.top\n width = el.width\n height = el.height\n }\n \n const right = left + width\n const bottom = top + height\n const centerX = top + height / 2\n const centerY = left + width / 2\n\n const topLine: AlignLine = { value: top, range: [left, right] }\n const bottomLine: AlignLine = { value: bottom, range: [left, right] }\n const horizontalCenterLine: AlignLine = { value: centerX, range: [left, right] }\n const leftLine: AlignLine = { value: left, range: [top, bottom] }\n const rightLine: AlignLine = { value: right, range: [top, bottom] }\n const verticalCenterLine: AlignLine = { value: centerY, range: [top, bottom] }\n\n horizontalLines.push(topLine, bottomLine, horizontalCenterLine)\n verticalLines.push(leftLine, rightLine, verticalCenterLine)\n }\n\n // 画布可视区域的四个边界、水平中心、垂直中心\n const edgeTopLine: AlignLine = { value: 0, range: [0, edgeWidth] }\n const edgeBottomLine: AlignLine = { value: edgeHeight, range: [0, edgeWidth] }\n const edgeHorizontalCenterLine: AlignLine = { value: edgeHeight / 2, range: [0, edgeWidth] }\n const edgeLeftLine: AlignLine = { value: 0, range: [0, edgeHeight] }\n const edgeRightLine: AlignLine = { value: edgeWidth, range: [0, edgeHeight] }\n const edgeVerticalCenterLine: AlignLine = { value: edgeWidth / 2, range: [0, edgeHeight] }\n\n horizontalLines.push(edgeTopLine, edgeBottomLine, edgeHorizontalCenterLine)\n verticalLines.push(edgeLeftLine, edgeRightLine, edgeVerticalCenterLine)\n \n // 对齐吸附线去重\n horizontalLines = uniqAlignLines(horizontalLines)\n verticalLines = uniqAlignLines(verticalLines)\n\n const handleMousemove = (e: MouseEvent | TouchEvent) => {\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n\n // 如果鼠标滑动距离过小,则将操作判定为误操作:\n // 如果误操作标记为null,表示是第一次触发移动,需要计算当前是否是误操作\n // 如果误操作标记为true,表示当前还处在误操作范围内,但仍然需要继续计算检查后续操作是否还处于误操作\n // 如果误操作标记为false,表示已经脱离了误操作范围,不需要再次计算\n if (isMisoperation !== false) {\n isMisoperation = Math.abs(startPageX - currentPageX) < sorptionRange && \n Math.abs(startPageY - currentPageY) < sorptionRange\n }\n if (!isMouseDown || isMisoperation) return\n\n const moveX = (currentPageX - startPageX) / canvasScale.value\n const moveY = (currentPageY - startPageY) / canvasScale.value\n\n // 基础目标位置\n let targetLeft = elOriginLeft + moveX\n let targetTop = elOriginTop + moveY\n\n // 计算目标元素在画布中的位置范围,用于吸附对齐\n // 需要区分单选和多选两种情况,其中多选状态下需要计算多选元素的整体范围;单选状态下需要继续区分线条、普通元素、旋转后的普通元素三种情况\n let targetMinX: number, targetMaxX: number, targetMinY: number, targetMaxY: number\n\n if (activeElementIdList.value.length === 1 || isActiveGroupElement) {\n if (elOriginRotate) {\n const { xRange, yRange } = getRectRotatedRange({\n left: targetLeft,\n top: targetTop,\n width: elOriginWidth,\n height: elOriginHeight,\n rotate: elOriginRotate,\n })\n targetMinX = xRange[0]\n targetMaxX = xRange[1]\n targetMinY = yRange[0]\n targetMaxY = yRange[1]\n }\n else if (element.type === 'line') {\n targetMinX = targetLeft\n targetMaxX = targetLeft + Math.max(element.start[0], element.end[0])\n targetMinY = targetTop\n targetMaxY = targetTop + Math.max(element.start[1], element.end[1])\n }\n else {\n targetMinX = targetLeft\n targetMaxX = targetLeft + elOriginWidth\n targetMinY = targetTop\n targetMaxY = targetTop + elOriginHeight\n }\n }\n else {\n const leftValues = []\n const topValues = []\n const rightValues = []\n const bottomValues = []\n \n for (let i = 0; i < originActiveElementList.length; i++) {\n const element = originActiveElementList[i]\n const left = element.left + moveX\n const top = element.top + moveY\n const width = element.width\n const height = ('height' in element && element.height) ? element.height : 0\n const rotate = ('rotate' in element && element.rotate) ? element.rotate : 0\n\n if ('rotate' in element && element.rotate) {\n const { xRange, yRange } = getRectRotatedRange({ left, top, width, height, rotate })\n leftValues.push(xRange[0])\n topValues.push(yRange[0])\n rightValues.push(xRange[1])\n bottomValues.push(yRange[1])\n }\n else if (element.type === 'line') {\n leftValues.push(left)\n topValues.push(top)\n rightValues.push(left + Math.max(element.start[0], element.end[0]))\n bottomValues.push(top + Math.max(element.start[1], element.end[1]))\n }\n else {\n leftValues.push(left)\n topValues.push(top)\n rightValues.push(left + width)\n bottomValues.push(top + height)\n }\n }\n\n targetMinX = Math.min(...leftValues)\n targetMaxX = Math.max(...rightValues)\n targetMinY = Math.min(...topValues)\n targetMaxY = Math.max(...bottomValues)\n }\n \n const targetCenterX = targetMinX + (targetMaxX - targetMinX) / 2\n const targetCenterY = targetMinY + (targetMaxY - targetMinY) / 2\n\n // 将收集到的对齐吸附线与计算的目标元素位置范围做对比,二者的差小于设定的值时执行自动对齐校正\n // 水平和垂直两个方向需要分开计算\n const _alignmentLines: AlignmentLineProps[] = []\n let isVerticalAdsorbed = false\n let isHorizontalAdsorbed = false\n for (let i = 0; i < horizontalLines.length; i++) {\n const { value, range } = horizontalLines[i]\n const min = Math.min(...range, targetMinX, targetMaxX)\n const max = Math.max(...range, targetMinX, targetMaxX)\n \n if (Math.abs(targetMinY - value) < sorptionRange && !isHorizontalAdsorbed) {\n targetTop = targetTop - (targetMinY - value)\n isHorizontalAdsorbed = true\n _alignmentLines.push({type: 'horizontal', axis: {x: min - 50, y: value}, length: max - min + 100})\n }\n if (Math.abs(targetMaxY - value) < sorptionRange && !isHorizontalAdsorbed) {\n targetTop = targetTop - (targetMaxY - value)\n isHorizontalAdsorbed = true\n _alignmentLines.push({type: 'horizontal', axis: {x: min - 50, y: value}, length: max - min + 100})\n }\n if (Math.abs(targetCenterY - value) < sorptionRange && !isHorizontalAdsorbed) {\n targetTop = targetTop - (targetCenterY - value)\n isHorizontalAdsorbed = true\n _alignmentLines.push({type: 'horizontal', axis: {x: min - 50, y: value}, length: max - min + 100})\n }\n }\n for (let i = 0; i < verticalLines.length; i++) {\n const { value, range } = verticalLines[i]\n const min = Math.min(...range, targetMinY, targetMaxY)\n const max = Math.max(...range, targetMinY, targetMaxY)\n\n if (Math.abs(targetMinX - value) < sorptionRange && !isVerticalAdsorbed) {\n targetLeft = targetLeft - (targetMinX - value)\n isVerticalAdsorbed = true\n _alignmentLines.push({type: 'vertical', axis: {x: value, y: min - 50}, length: max - min + 100})\n }\n if (Math.abs(targetMaxX - value) < sorptionRange && !isVerticalAdsorbed) {\n targetLeft = targetLeft - (targetMaxX - value)\n isVerticalAdsorbed = true\n _alignmentLines.push({type: 'vertical', axis: {x: value, y: min - 50}, length: max - min + 100})\n }\n if (Math.abs(targetCenterX - value) < sorptionRange && !isVerticalAdsorbed) {\n targetLeft = targetLeft - (targetCenterX - value)\n isVerticalAdsorbed = true\n _alignmentLines.push({type: 'vertical', axis: {x: value, y: min - 50}, length: max - min + 100})\n }\n }\n alignmentLines.value = _alignmentLines\n \n // 单选状态下,或者当前选中的多个元素中存在正在操作的元素时,仅修改正在操作的元素的位置\n if (activeElementIdList.value.length === 1 || isActiveGroupElement) {\n elementList.value = elementList.value.map(el => {\n return el.id === element.id ? { ...el, left: targetLeft, top: targetTop } : el\n })\n }\n\n // 多选状态下,除了修改正在操作的元素的位置,其他被选中的元素也需要修改位置信息\n // 其他被选中的元素的位置信息通过正在操作的元素的移动偏移量来进行计算\n else {\n const handleElement = elementList.value.find(el => el.id === element.id)\n if (!handleElement) return\n\n elementList.value = elementList.value.map(el => {\n if (activeElementIdList.value.includes(el.id)) {\n if (el.id === element.id) {\n return {\n ...el,\n left: targetLeft,\n top: targetTop,\n }\n }\n return {\n ...el,\n left: el.left + (targetLeft - handleElement.left),\n top: el.top + (targetTop - handleElement.top),\n }\n }\n return el\n })\n }\n }\n\n const handleMouseup = (e: MouseEvent | TouchEvent) => {\n isMouseDown = false\n \n document.ontouchmove = null\n document.ontouchend = null\n document.onmousemove = null\n document.onmouseup = null\n\n alignmentLines.value = []\n\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n\n if (startPageX === currentPageX && startPageY === currentPageY) return\n\n slidesStore.updateSlide({ elements: elementList.value })\n addHistorySnapshot()\n }\n\n if (isTouchEvent) {\n document.ontouchmove = handleMousemove\n document.ontouchend = handleMouseup\n }\n else {\n document.onmousemove = handleMousemove\n document.onmouseup = handleMouseup\n }\n }\n\n return {\n dragElement,\n }\n}","import { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement, PPTLineElement } from '@/types/slides'\nimport { OperateLineHandlers } from '@/types/edit'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface AdsorptionPoint {\n x: number\n y: number\n}\n\nexport default (elementList: Ref) => {\n const slidesStore = useSlidesStore()\n const { canvasScale } = storeToRefs(useMainStore())\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 拖拽线条端点\n const dragLineElement = (e: MouseEvent, element: PPTLineElement, command: OperateLineHandlers) => {\n let isMouseDown = true\n\n const sorptionRange = 8\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n\n const adsorptionPoints: AdsorptionPoint[] = []\n\n // 获取所有线条以外的未旋转的元素的8个缩放点作为吸附位置\n for (let i = 0; i < elementList.value.length; i++) {\n const _element = elementList.value[i]\n if (_element.type === 'line' || _element.rotate) continue\n\n const left = _element.left\n const top = _element.top\n const width = _element.width\n const height = _element.height\n \n const right = left + width\n const bottom = top + height\n const centerX = top + height / 2\n const centerY = left + width / 2\n\n const topPoint = { x: centerY, y: top }\n const bottomPoint = { x: centerY, y: bottom }\n const leftPoint = { x: left, y: centerX }\n const rightPoint = { x: right, y: centerX }\n\n const leftTopPoint = { x: left, y: top }\n const rightTopPoint = { x: right, y: top }\n const leftBottomPoint = { x: left, y: bottom }\n const rightBottomPoint = { x: right, y: bottom }\n\n adsorptionPoints.push(\n topPoint,\n bottomPoint,\n leftPoint,\n rightPoint,\n leftTopPoint,\n rightTopPoint,\n leftBottomPoint,\n rightBottomPoint,\n )\n }\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n const moveX = (currentPageX - startPageX) / canvasScale.value\n const moveY = (currentPageY - startPageY) / canvasScale.value\n \n // 线条起点和终点在编辑区域中的位置\n let startX = element.left + element.start[0]\n let startY = element.top + element.start[1]\n let endX = element.left + element.end[0]\n let endY = element.top + element.end[1]\n\n const mid = element.broken || element.curve || [0, 0]\n let midX = element.left + mid[0]\n let midY = element.top + mid[1]\n\n const [c1, c2] = element.cubic || [[0, 0], [0, 0]]\n let c1X = element.left + c1[0]\n let c1Y = element.top + c1[1]\n let c2X = element.left + c2[0]\n let c2Y = element.top + c2[1]\n\n // 拖拽起点或终点的位置\n // 水平和垂直方向上有吸附\n if (command === OperateLineHandlers.START) {\n startX = startX + moveX\n startY = startY + moveY\n\n if (Math.abs(startX - endX) < sorptionRange) startX = endX\n if (Math.abs(startY - endY) < sorptionRange) startY = endY\n\n for (const adsorptionPoint of adsorptionPoints) {\n const { x, y } = adsorptionPoint\n if (Math.abs(x - startX) < sorptionRange && Math.abs(y - startY) < sorptionRange) {\n startX = x\n startY = y\n break\n }\n }\n }\n else if (command === OperateLineHandlers.END) {\n endX = endX + moveX\n endY = endY + moveY\n\n if (Math.abs(startX - endX) < sorptionRange) endX = startX\n if (Math.abs(startY - endY) < sorptionRange) endY = startY\n\n for (const adsorptionPoint of adsorptionPoints) {\n const { x, y } = adsorptionPoint\n if (Math.abs(x - endX) < sorptionRange && Math.abs(y - endY) < sorptionRange) {\n endX = x\n endY = y\n break\n }\n }\n }\n else if (command === OperateLineHandlers.C) {\n midX = midX + moveX\n midY = midY + moveY\n\n if (Math.abs(midX - startX) < sorptionRange) midX = startX\n if (Math.abs(midY - startY) < sorptionRange) midY = startY\n if (Math.abs(midX - endX) < sorptionRange) midX = endX\n if (Math.abs(midY - endY) < sorptionRange) midY = endY\n if (Math.abs(midX - (startX + endX) / 2) < sorptionRange && Math.abs(midY - (startY + endY) / 2) < sorptionRange) {\n midX = (startX + endX) / 2\n midY = (startY + endY) / 2\n }\n }\n else if (command === OperateLineHandlers.C1) {\n c1X = c1X + moveX\n c1Y = c1Y + moveY\n\n if (Math.abs(c1X - startX) < sorptionRange) c1X = startX\n if (Math.abs(c1Y - startY) < sorptionRange) c1Y = startY\n if (Math.abs(c1X - endX) < sorptionRange) c1X = endX\n if (Math.abs(c1Y - endY) < sorptionRange) c1Y = endY\n }\n else if (command === OperateLineHandlers.C2) {\n c2X = c2X + moveX\n c2Y = c2Y + moveY\n\n if (Math.abs(c2X - startX) < sorptionRange) c2X = startX\n if (Math.abs(c2Y - startY) < sorptionRange) c2Y = startY\n if (Math.abs(c2X - endX) < sorptionRange) c2X = endX\n if (Math.abs(c2Y - endY) < sorptionRange) c2Y = endY\n }\n\n // 计算更新起点和终点基于自身元素位置的坐标\n const minX = Math.min(startX, endX)\n const minY = Math.min(startY, endY)\n const maxX = Math.max(startX, endX)\n const maxY = Math.max(startY, endY)\n\n const start: [number, number] = [0, 0]\n const end: [number, number] = [maxX - minX, maxY - minY]\n if (startX > endX) {\n start[0] = maxX - minX\n end[0] = 0\n }\n if (startY > endY) {\n start[1] = maxY - minY\n end[1] = 0\n }\n\n elementList.value = elementList.value.map(el => {\n if (el.id === element.id) {\n const newEl: PPTLineElement = {\n ...(el as PPTLineElement),\n left: minX,\n top: minY,\n start: start,\n end: end,\n }\n if (command === OperateLineHandlers.START || command === OperateLineHandlers.END) {\n if (element.broken) newEl.broken = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]\n if (element.curve) newEl.curve = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]\n if (element.cubic) newEl.cubic = [[(start[0] + end[0]) / 2, (start[1] + end[1]) / 2], [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]]\n }\n else if (command === OperateLineHandlers.C) {\n if (element.broken) newEl.broken = [midX - minX, midY - minY]\n if (element.curve) newEl.curve = [midX - minX, midY - minY]\n }\n else {\n if (element.cubic) newEl.cubic = [[c1X - minX, c1Y - minY], [c2X - minX, c2Y - minY]]\n }\n return newEl\n }\n return el\n })\n }\n\n document.onmouseup = e => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n if (startPageX === currentPageX && startPageY === currentPageY) return\n\n slidesStore.updateSlide({ elements: elementList.value })\n addHistorySnapshot()\n }\n }\n\n return {\n dragLineElement,\n }\n}","import { Ref } from 'vue'\nimport { useSlidesStore } from '@/store'\nimport { PPTElement, PPTShapeElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport { SHAPE_PATH_FORMULAS } from '@/configs/shapes'\n\ninterface ShapePathData {\n baseSize: number,\n originPos: number,\n min: number,\n max: number,\n relative: string,\n}\n\nexport default (\n elementList: Ref,\n canvasScale: Ref,\n) => {\n const slidesStore = useSlidesStore()\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n const moveShapeKeypoint = (e: MouseEvent | TouchEvent, element: PPTShapeElement) => {\n const isTouchEvent = !(e instanceof MouseEvent)\n if (isTouchEvent && (!e.changedTouches || !e.changedTouches[0])) return\n\n let isMouseDown = true\n \n const startPageX = isTouchEvent ? e.changedTouches[0].pageX : e.pageX\n const startPageY = isTouchEvent ? e.changedTouches[0].pageY : e.pageY\n\n const pathFormula = SHAPE_PATH_FORMULAS[element.pathFormula!]\n let shapePathData: ShapePathData | null = null\n if ('editable' in pathFormula) {\n const baseSize = pathFormula.getBaseSize(element.width, element.height)\n const originPos = baseSize * element.keypoint!\n const [min, max] = pathFormula.range\n const relative = pathFormula.relative\n\n shapePathData = { baseSize, originPos, min, max, relative }\n }\n\n const handleMousemove = (e: MouseEvent | TouchEvent) => {\n if (!isMouseDown) return\n\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n const moveX = (currentPageX - startPageX) / canvasScale.value\n const moveY = (currentPageY - startPageY) / canvasScale.value\n\n elementList.value = elementList.value.map(el => {\n if (el.id === element.id && shapePathData) {\n const { baseSize, originPos, min, max, relative } = shapePathData\n const shapeElement = el as PPTShapeElement\n\n let keypoint = 0\n\n if (relative === 'left') keypoint = (originPos + moveX) / baseSize\n if (relative === 'right') keypoint = (originPos - moveX) / baseSize\n if (relative === 'center') keypoint = (originPos - moveX * 2) / baseSize\n if (relative === 'top') keypoint = (originPos + moveY) / baseSize\n if (relative === 'bottom') keypoint = (originPos - moveY) / baseSize\n\n if (keypoint < min) keypoint = min\n if (keypoint > max) keypoint = max\n\n return {\n ...el,\n keypoint,\n path: pathFormula.formula(shapeElement.width, shapeElement.height, keypoint),\n }\n }\n return el\n })\n }\n\n const handleMouseup = (e: MouseEvent | TouchEvent) => {\n isMouseDown = false\n \n document.ontouchmove = null\n document.ontouchend = null\n document.onmousemove = null\n document.onmouseup = null\n\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n\n if (startPageX === currentPageX && startPageY === currentPageY) return\n\n slidesStore.updateSlide({ elements: elementList.value })\n addHistorySnapshot()\n }\n\n if (isTouchEvent) {\n document.ontouchmove = handleMousemove\n document.ontouchend = handleMouseup\n }\n else {\n document.onmousemove = handleMousemove\n document.onmouseup = handleMouseup\n }\n }\n\n return {\n moveShapeKeypoint,\n }\n}","import { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { CreateElementSelectionData, CreatingLineElement, CreatingShapeElement } from '@/types/edit'\nimport useCreateElement from '@/hooks/useCreateElement'\n\nexport default (viewportRef: Ref) => {\n const mainStore = useMainStore()\n const { canvasScale, creatingElement } = storeToRefs(mainStore)\n\n // 通过鼠标框选时的起点和终点,计算选区的位置大小\n const formatCreateSelection = (selectionData: CreateElementSelectionData) => {\n const { start, end } = selectionData\n\n if (!viewportRef.value) return\n const viewportRect = viewportRef.value.getBoundingClientRect()\n\n const [startX, startY] = start\n const [endX, endY] = end\n const minX = Math.min(startX, endX)\n const maxX = Math.max(startX, endX)\n const minY = Math.min(startY, endY)\n const maxY = Math.max(startY, endY)\n\n const left = (minX - viewportRect.x) / canvasScale.value\n const top = (minY - viewportRect.y) / canvasScale.value\n const width = (maxX - minX) / canvasScale.value\n const height = (maxY - minY) / canvasScale.value\n\n return { left, top, width, height }\n }\n\n // 通过鼠标框选时的起点和终点,计算线条在画布中的位置和起点终点\n const formatCreateSelectionForLine = (selectionData: CreateElementSelectionData) => {\n const { start, end } = selectionData\n\n if (!viewportRef.value) return\n const viewportRect = viewportRef.value.getBoundingClientRect()\n\n const [startX, startY] = start\n const [endX, endY] = end\n const minX = Math.min(startX, endX)\n const maxX = Math.max(startX, endX)\n const minY = Math.min(startY, endY)\n const maxY = Math.max(startY, endY)\n\n const left = (minX - viewportRect.x) / canvasScale.value\n const top = (minY - viewportRect.y) / canvasScale.value\n const width = (maxX - minX) / canvasScale.value\n const height = (maxY - minY) / canvasScale.value\n\n const _start: [number, number] = [\n startX === minX ? 0 : width,\n startY === minY ? 0 : height,\n ]\n const _end: [number, number] = [\n endX === minX ? 0 : width,\n endY === minY ? 0 : height,\n ]\n\n return {\n left,\n top,\n start: _start,\n end: _end,\n }\n }\n\n const { createTextElement, createShapeElement, createLineElement } = useCreateElement()\n\n // 根据鼠标选区的位置大小插入元素\n const insertElementFromCreateSelection = (selectionData: CreateElementSelectionData) => {\n if (!creatingElement.value) return\n\n const type = creatingElement.value.type\n if (type === 'text') {\n const position = formatCreateSelection(selectionData)\n position && createTextElement(position)\n }\n else if (type === 'shape') {\n const position = formatCreateSelection(selectionData)\n position && createShapeElement(position, (creatingElement.value as CreatingShapeElement).data)\n }\n else if (type === 'line') {\n const position = formatCreateSelectionForLine(selectionData)\n position && createLineElement(position, (creatingElement.value as CreatingLineElement).data)\n }\n mainStore.setCreatingElement(null)\n }\n\n return {\n insertElementFromCreateSelection,\n }\n}","import { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { ElementAlignCommands } from '@/types/edit'\nimport { getElementListRange } from '@/utils/element'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport useHistorySnapshot from './useHistorySnapshot'\n\nexport default () => {\n const slidesStore = useSlidesStore()\n const { activeElementIdList, activeElementList } = storeToRefs(useMainStore())\n const { currentSlide, viewportRatio } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n /**\n * 将所有选中的元素对齐到画布\n * @param command 对齐方向\n */\n const alignElementToCanvas = (command: ElementAlignCommands) => {\n const viewportWidth = VIEWPORT_SIZE\n const viewportHeight = VIEWPORT_SIZE * viewportRatio.value\n const { minX, maxX, minY, maxY } = getElementListRange(activeElementList.value)\n \n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\n for (const element of newElementList) {\n if (!activeElementIdList.value.includes(element.id)) continue\n \n // 水平垂直居中\n if (command === ElementAlignCommands.CENTER) {\n const offsetY = minY + (maxY - minY) / 2 - viewportHeight / 2\n const offsetX = minX + (maxX - minX) / 2 - viewportWidth / 2\n element.top = element.top - offsetY \n element.left = element.left - offsetX \n }\n\n // 顶部对齐\n if (command === ElementAlignCommands.TOP) {\n const offsetY = minY - 0\n element.top = element.top - offsetY \n }\n\n // 垂直居中\n else if (command === ElementAlignCommands.VERTICAL) {\n const offsetY = minY + (maxY - minY) / 2 - viewportHeight / 2\n element.top = element.top - offsetY \n }\n\n // 底部对齐\n else if (command === ElementAlignCommands.BOTTOM) {\n const offsetY = maxY - viewportHeight\n element.top = element.top - offsetY \n }\n \n // 左侧对齐\n else if (command === ElementAlignCommands.LEFT) {\n const offsetX = minX - 0\n element.left = element.left - offsetX \n }\n\n // 水平居中\n else if (command === ElementAlignCommands.HORIZONTAL) {\n const offsetX = minX + (maxX - minX) / 2 - viewportWidth / 2\n element.left = element.left - offsetX \n }\n\n // 右侧对齐\n else if (command === ElementAlignCommands.RIGHT) {\n const offsetX = maxX - viewportWidth\n element.left = element.left - offsetX \n }\n }\n\n slidesStore.updateSlide({ elements: newElementList })\n addHistorySnapshot()\n }\n\n return {\n alignElementToCanvas,\n }\n}","import { computed, Ref } from 'vue'\nimport { PPTElementShadow } from '@/types/slides'\n\n// 计算元素的阴影样式\nexport default (shadow: Ref) => {\n const shadowStyle = computed(() => {\n if (shadow.value) {\n const { h, v, blur, color } = shadow.value\n return `${h}px ${v}px ${blur}px ${color}`\n }\n return ''\n })\n\n return {\n shadowStyle,\n }\n}","import { computed, Ref } from 'vue'\n\n// 计算元素的翻转样式\nexport default (flipH: Ref, flipV: Ref) => {\n const flipStyle = computed(() => {\n let style = ''\n \n if (flipH.value && flipV.value) style = 'rotateX(180deg) rotateY(180deg)'\n else if (flipV.value) style = 'rotateX(180deg)'\n else if (flipH.value) style = 'rotateY(180deg)'\n\n return style\n })\n\n return {\n flipStyle,\n }\n}","import { computed, Ref } from 'vue'\nimport { CLIPPATHS, ClipPathTypes } from '@/configs/imageClip'\nimport { ImageElementClip } from '@/types/slides'\n\nexport default (clip: Ref) => {\n const clipShape = computed(() => {\n if (!clip.value) return CLIPPATHS.rect\n const shape = clip.value.shape || ClipPathTypes.RECT\n\n return CLIPPATHS[shape]\n })\n\n const imgPosition = computed(() => {\n if (!clip.value) {\n return {\n top: '0',\n left: '0',\n width: '100%',\n height: '100%',\n }\n }\n\n const [start, end] = clip.value.range\n\n const widthScale = (end[0] - start[0]) / 100\n const heightScale = (end[1] - start[1]) / 100\n const left = start[0] / widthScale\n const top = start[1] / heightScale\n\n return {\n left: -left + '%',\n top: -top + '%',\n width: 100 / widthScale + '%',\n height: 100 / heightScale + '%',\n }\n })\n\n return {\n clipShape,\n imgPosition,\n }\n}","import { computed, Ref } from 'vue'\nimport { ImageElementFilters } from '@/types/slides'\n\nexport default (filters: Ref) => {\n const filter = computed(() => {\n if (!filters.value) return ''\n let filter = ''\n for (const key of Object.keys(filters.value)) {\n filter += `${key}(${filters.value[key]}) `\n }\n return filter\n })\n\n return {\n filter,\n }\n}","import { computed, Ref } from 'vue'\nimport { PPTElementOutline } from '@/types/slides'\n\n// 计算边框相关属性值,主要是对默认值的处理\nexport default (outline: Ref) => {\n const outlineWidth = computed(() => outline.value?.width ?? 0)\n const outlineStyle = computed(() => outline.value?.style || 'solid')\n const outlineColor = computed(() => outline.value?.color || '#d14424')\n\n return {\n outlineWidth,\n outlineStyle,\n outlineColor,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-b5bace06\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"rx\", \"ry\", \"width\", \"height\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\n\nimport { PropType, toRef } from 'vue'\nimport { PPTElementOutline } from '@/types/slides'\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ImageRectOutline',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n outline: {\n type: Object as PropType\n },\n radius: {\n type: String,\n default: '0',\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst {\n outlineWidth,\n outlineStyle,\n outlineColor,\n} = useElementOutline(toRef(props, 'outline'))\n\nreturn (_ctx: any,_cache: any) => {\n return (__props.outline)\n ? (_openBlock(), _createElementBlock(\"svg\", {\n key: 0,\n class: \"image-rect-outline\",\n overflow: \"visible\",\n width: __props.width,\n height: __props.height\n }, [\n _createElementVNode(\"rect\", {\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n fill: \"transparent\",\n rx: __props.radius,\n ry: __props.radius,\n width: __props.width,\n height: __props.height,\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 6' : '0 0'\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./ImageRectOutline.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImageRectOutline.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImageRectOutline.vue?vue&type=style&index=0&id=b5bace06&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-b5bace06\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-71b17928\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"cx\", \"cy\", \"rx\", \"ry\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\n\nimport { PropType, toRef } from 'vue'\nimport { PPTElementOutline } from '@/types/slides'\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ImageEllipseOutline',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n outline: {\n type: Object as PropType\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst {\n outlineWidth,\n outlineStyle,\n outlineColor,\n} = useElementOutline(toRef(props, 'outline'))\n\nreturn (_ctx: any,_cache: any) => {\n return (__props.outline)\n ? (_openBlock(), _createElementBlock(\"svg\", {\n key: 0,\n class: \"image-ellipse-outline\",\n overflow: \"visible\",\n width: __props.width,\n height: __props.height\n }, [\n _createElementVNode(\"ellipse\", {\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n fill: \"transparent\",\n cx: __props.width / 2,\n cy: __props.height / 2,\n rx: __props.width / 2,\n ry: __props.height / 2,\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 6' : '0 0'\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./ImageEllipseOutline.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImageEllipseOutline.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImageEllipseOutline.vue?vue&type=style&index=0&id=71b17928&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-71b17928\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-41071294\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"d\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\n\nimport { PropType, toRef } from 'vue'\nimport { PPTElementOutline } from '@/types/slides'\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ImagePolygonOutline',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n outline: {\n type: Object as PropType\n },\n createPath: {\n type: Function,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst {\n outlineWidth,\n outlineStyle,\n outlineColor,\n} = useElementOutline(toRef(props, 'outline'))\n\nreturn (_ctx: any,_cache: any) => {\n return (__props.outline)\n ? (_openBlock(), _createElementBlock(\"svg\", {\n key: 0,\n class: \"image-polygon-outline\",\n overflow: \"visible\",\n width: __props.width,\n height: __props.height\n }, [\n _createElementVNode(\"path\", {\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n fill: \"transparent\",\n d: __props.createPath(__props.width, __props.height),\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 6' : '0 0'\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./ImagePolygonOutline.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImagePolygonOutline.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImagePolygonOutline.vue?vue&type=style&index=0&id=41071294&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-41071294\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"image-outline\" }\n\nimport { computed, PropType } from 'vue'\nimport { PPTImageElement } from '@/types/slides'\nimport useClipImage from '../useClipImage'\n\nimport ImageRectOutline from './ImageRectOutline.vue'\nimport ImageEllipseOutline from './ImageEllipseOutline.vue'\nimport ImagePolygonOutline from './ImagePolygonOutline.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst clip = computed(() => props.elementInfo.clip)\nconst { clipShape } = useClipImage(clip)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_unref(clipShape).type === 'rect')\n ? (_openBlock(), _createBlock(ImageRectOutline, {\n key: 0,\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n radius: _unref(clipShape).radius,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"radius\", \"outline\"]))\n : (_unref(clipShape).type === 'ellipse')\n ? (_openBlock(), _createBlock(ImageEllipseOutline, {\n key: 1,\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"outline\"]))\n : (_unref(clipShape).type === 'polygon')\n ? (_openBlock(), _createBlock(ImagePolygonOutline, {\n key: 2,\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline,\n createPath: _unref(clipShape).createPath\n }, null, 8, [\"width\", \"height\", \"outline\", \"createPath\"]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, withModifiers as _withModifiers, normalizeClass as _normalizeClass, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3e0199ec\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"src\"]\nconst _hoisted_2 = [\"src\"]\nconst _hoisted_3 = [\"onMousedown\"]\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"svg\", {\n width: \"16\",\n height: \"16\",\n fill: \"#fff\",\n stroke: \"#333\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n \"stroke-width\": \"0.3\",\n \"shape-rendering\": \"crispEdges\",\n d: \"M 16 0 L 0 0 L 0 16 L 4 16 L 4 4 L 16 4 L 16 0 Z\"\n })\n], -1))\nconst _hoisted_5 = [\n _hoisted_4\n]\nconst _hoisted_6 = [\"onMousedown\"]\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"svg\", {\n width: \"16\",\n height: \"16\",\n fill: \"#fff\",\n stroke: \"#333\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n \"stroke-width\": \"0.3\",\n \"shape-rendering\": \"crispEdges\",\n d: \"M 16 0 L 0 0 L 0 4 L 16 4 Z\"\n })\n], -1))\nconst _hoisted_8 = [\n _hoisted_7\n]\n\nimport { computed, onMounted, onUnmounted, PropType, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useKeyboardStore } from '@/store'\nimport { KEYS } from '@/configs/hotkey'\nimport { ImageClipedEmitData, OperateResizeHandlers } from '@/types/edit'\nimport { ImageClipDataRange, ImageElementClip } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ImageClipHandler',\n props: {\n src: {\n type: String,\n required: true,\n },\n clipData: {\n type: Object as PropType,\n },\n clipPath: {\n type: String,\n required: true,\n },\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n top: {\n type: Number,\n required: true,\n },\n left: {\n type: Number,\n required: true,\n },\n rotate: {\n type: Number,\n required: true,\n },\n},\n emits: [\"clip\"],\n setup(__props, { emit }: { emit: ({\n (event: 'clip', payload: ImageClipedEmitData | null): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\nconst { ctrlOrShiftKeyActive } = storeToRefs(useKeyboardStore())\n\nconst clipWrapperPositionStyle = ref({\n top: '0',\n left: '0',\n})\nconst isSettingClipRange = ref(false)\nconst currentRange = ref(null)\n\n// 获取裁剪区域信息(裁剪区域占原图的宽高比例,处在原图中的位置)\nconst getClipDataTransformInfo = () => {\n const [start, end] = props.clipData ? props.clipData.range : [[0, 0], [100, 100]]\n\n const widthScale = (end[0] - start[0]) / 100\n const heightScale = (end[1] - start[1]) / 100\n const left = start[0] / widthScale\n const top = start[1] / heightScale\n\n return { widthScale, heightScale, left, top }\n}\n\n// 底层图片位置大小(遮罩区域图片)\nconst imgPosition = computed(() => {\n const { widthScale, heightScale, left, top } = getClipDataTransformInfo()\n return {\n left: -left,\n top: -top,\n width: 100 / widthScale,\n height: 100 / heightScale,\n }\n})\n\n// 底层图片位置大小样式(遮罩区域图片)\nconst bottomImgPositionStyle = computed(() => {\n return {\n top: imgPosition.value.top + '%',\n left: imgPosition.value.left + '%',\n width: imgPosition.value.width + '%',\n height: imgPosition.value.height + '%',\n }\n})\n\n// 顶层图片容器位置大小(裁剪高亮区域)\nconst topImgWrapperPosition = ref({\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n})\n\n// 顶层图片容器位置大小样式(裁剪高亮区域)\nconst topImgWrapperPositionStyle = computed(() => {\n const { top, left, width, height } = topImgWrapperPosition.value\n return {\n top: top + '%',\n left: left + '%',\n width: width + '%',\n height: height + '%',\n }\n})\n\n// 顶层图片位置大小样式(裁剪区域图片)\nconst topImgPositionStyle = computed(() => {\n const bottomWidth = imgPosition.value.width\n const bottomHeight = imgPosition.value.height\n \n const { top, left, width, height } = topImgWrapperPosition.value\n \n return {\n left: -left * (100 / width) + '%',\n top: -top * (100 / height) + '%',\n width: bottomWidth / width * 100 + '%',\n height: bottomHeight / height * 100 + '%',\n }\n})\n\n// 初始化裁剪位置信息\nconst initClipPosition = () => {\n const { left, top } = getClipDataTransformInfo()\n topImgWrapperPosition.value = {\n left: left,\n top: top,\n width: 100,\n height: 100,\n }\n \n clipWrapperPositionStyle.value = {\n top: -top + '%',\n left: -left + '%',\n }\n}\n\n// 执行裁剪:计算裁剪后的图片位置大小和裁剪信息,并将数据同步出去\nconst handleClip = () => {\n if (isSettingClipRange.value) return\n\n if (!currentRange.value) {\n emit('clip', null)\n return\n }\n\n const { left, top } = getClipDataTransformInfo()\n\n const position = {\n left: (topImgWrapperPosition.value.left - left) / 100 * props.width,\n top: (topImgWrapperPosition.value.top - top) / 100 * props.height,\n width: (topImgWrapperPosition.value.width - 100) / 100 * props.width,\n height: (topImgWrapperPosition.value.height - 100) / 100 * props.height,\n }\n\n const clipedEmitData: ImageClipedEmitData = {\n range: currentRange.value,\n position,\n }\n emit('clip', clipedEmitData)\n}\n\n// 快捷键监听:回车确认裁剪\nconst keyboardListener = (e: KeyboardEvent) => {\n const key = e.key.toUpperCase()\n if (key === KEYS.ENTER) handleClip()\n}\n\nonMounted(() => {\n initClipPosition()\n document.addEventListener('keydown', keyboardListener)\n})\nonUnmounted(() => {\n document.removeEventListener('keydown', keyboardListener)\n})\n\n// 计算并更新裁剪区域范围数据\nconst updateRange = () => {\n const retPosition = {\n left: parseInt(topImgPositionStyle.value.left),\n top: parseInt(topImgPositionStyle.value.top),\n width: parseInt(topImgPositionStyle.value.width),\n height: parseInt(topImgPositionStyle.value.height),\n }\n\n const widthScale = 100 / retPosition.width\n const heightScale = 100 / retPosition.height\n\n const start: [number, number] = [\n -retPosition.left * widthScale,\n -retPosition.top * heightScale,\n ]\n const end: [number, number] = [\n widthScale * 100 + start[0],\n heightScale * 100 + start[1],\n ]\n\n currentRange.value = [start, end]\n}\n\n// 移动裁剪区域\nconst moveClipRange = (e: MouseEvent) => {\n isSettingClipRange.value = true\n let isMouseDown = true\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n const bottomPosition = imgPosition.value\n const originPositopn = { ...topImgWrapperPosition.value }\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n let moveX = (currentPageX - startPageX) / canvasScale.value / props.width * 100\n let moveY = (currentPageY - startPageY) / canvasScale.value / props.height * 100\n\n if (props.rotate > 45 && props.rotate < 135) {\n moveX = (currentPageY - startPageY) / canvasScale.value / props.width * 100\n moveY = -(currentPageX - startPageX) / canvasScale.value / props.height * 100\n }\n if ((props.rotate >= 135 && props.rotate <= 180) || (props.rotate >= -180 && props.rotate <= -135)) {\n moveX = -moveX\n moveY = -moveY\n }\n if (props.rotate > -135 && props.rotate < -45) {\n moveX = -(currentPageY - startPageY) / canvasScale.value / props.width * 100\n moveY = (currentPageX - startPageX) / canvasScale.value / props.height * 100\n }\n\n let targetLeft = originPositopn.left + moveX\n let targetTop = originPositopn.top + moveY\n\n if (targetLeft < 0) targetLeft = 0\n else if (targetLeft + originPositopn.width > bottomPosition.width) {\n targetLeft = bottomPosition.width - originPositopn.width\n }\n if (targetTop < 0) targetTop = 0\n else if (targetTop + originPositopn.height > bottomPosition.height) {\n targetTop = bottomPosition.height - originPositopn.height\n }\n \n topImgWrapperPosition.value = {\n ...topImgWrapperPosition.value,\n left: targetLeft,\n top: targetTop,\n }\n }\n\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n updateRange()\n\n setTimeout(() => {\n isSettingClipRange.value = false\n }, 0)\n }\n}\n\n// 缩放裁剪区域\nconst scaleClipRange = (e: MouseEvent, type: OperateResizeHandlers) => {\n isSettingClipRange.value = true\n let isMouseDown = true\n\n const minWidth = 50 / props.width * 100\n const minHeight = 50 / props.height * 100\n \n const startPageX = e.pageX\n const startPageY = e.pageY\n const bottomPosition = imgPosition.value\n const originPositopn = { ...topImgWrapperPosition.value }\n\n const aspectRatio = topImgWrapperPosition.value.width / topImgWrapperPosition.value.height\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n let moveX = (currentPageX - startPageX) / canvasScale.value / props.width * 100\n let moveY = (currentPageY - startPageY) / canvasScale.value / props.height * 100\n\n if (props.rotate > 45 && props.rotate < 135) {\n moveX = (currentPageY - startPageY) / canvasScale.value / props.width * 100\n moveY = -(currentPageX - startPageX) / canvasScale.value / props.height * 100\n }\n if ((props.rotate >= 135 && props.rotate <= 180) || (props.rotate >= -180 && props.rotate <= -135)) {\n moveX = -moveX\n moveY = -moveY\n }\n if (props.rotate > -135 && props.rotate < -45) {\n moveX = -(currentPageY - startPageY) / canvasScale.value / props.width * 100\n moveY = (currentPageX - startPageX) / canvasScale.value / props.height * 100\n }\n\n if (ctrlOrShiftKeyActive.value) {\n if (type === OperateResizeHandlers.RIGHT_BOTTOM || type === OperateResizeHandlers.LEFT_TOP) moveY = moveX / aspectRatio\n if (type === OperateResizeHandlers.LEFT_BOTTOM || type === OperateResizeHandlers.RIGHT_TOP) moveY = -moveX / aspectRatio\n }\n\n let targetLeft, targetTop, targetWidth, targetHeight\n\n if (type === OperateResizeHandlers.LEFT_TOP) {\n if (originPositopn.left + moveX < 0) {\n moveX = -originPositopn.left\n }\n if (originPositopn.top + moveY < 0) {\n moveY = -originPositopn.top\n }\n if (originPositopn.width - moveX < minWidth) {\n moveX = originPositopn.width - minWidth\n }\n if (originPositopn.height - moveY < minHeight) {\n moveY = originPositopn.height - minHeight\n }\n targetWidth = originPositopn.width - moveX\n targetHeight = originPositopn.height - moveY\n targetLeft = originPositopn.left + moveX\n targetTop = originPositopn.top + moveY\n }\n else if (type === OperateResizeHandlers.RIGHT_TOP) {\n if (originPositopn.left + originPositopn.width + moveX > bottomPosition.width) {\n moveX = bottomPosition.width - (originPositopn.left + originPositopn.width)\n }\n if (originPositopn.top + moveY < 0) {\n moveY = -originPositopn.top\n }\n if (originPositopn.width + moveX < minWidth) {\n moveX = minWidth - originPositopn.width\n }\n if (originPositopn.height - moveY < minHeight) {\n moveY = originPositopn.height - minHeight\n }\n targetWidth = originPositopn.width + moveX\n targetHeight = originPositopn.height - moveY\n targetLeft = originPositopn.left\n targetTop = originPositopn.top + moveY\n }\n else if (type === OperateResizeHandlers.LEFT_BOTTOM) {\n if (originPositopn.left + moveX < 0) {\n moveX = -originPositopn.left\n }\n if (originPositopn.top + originPositopn.height + moveY > bottomPosition.height) {\n moveY = bottomPosition.height - (originPositopn.top + originPositopn.height)\n }\n if (originPositopn.width - moveX < minWidth) {\n moveX = originPositopn.width - minWidth\n }\n if (originPositopn.height + moveY < minHeight) {\n moveY = minHeight - originPositopn.height\n }\n targetWidth = originPositopn.width - moveX\n targetHeight = originPositopn.height + moveY\n targetLeft = originPositopn.left + moveX\n targetTop = originPositopn.top\n }\n else if (type === OperateResizeHandlers.RIGHT_BOTTOM) {\n if (originPositopn.left + originPositopn.width + moveX > bottomPosition.width) {\n moveX = bottomPosition.width - (originPositopn.left + originPositopn.width)\n }\n if (originPositopn.top + originPositopn.height + moveY > bottomPosition.height) {\n moveY = bottomPosition.height - (originPositopn.top + originPositopn.height)\n }\n if (originPositopn.width + moveX < minWidth) {\n moveX = minWidth - originPositopn.width\n }\n if (originPositopn.height + moveY < minHeight) {\n moveY = minHeight - originPositopn.height\n }\n targetWidth = originPositopn.width + moveX\n targetHeight = originPositopn.height + moveY\n targetLeft = originPositopn.left\n targetTop = originPositopn.top\n }\n else if (type === OperateResizeHandlers.TOP) {\n if (originPositopn.top + moveY < 0) {\n moveY = -originPositopn.top\n }\n if (originPositopn.height - moveY < minHeight) {\n moveY = originPositopn.height - minHeight\n }\n targetWidth = originPositopn.width\n targetHeight = originPositopn.height - moveY\n targetLeft = originPositopn.left\n targetTop = originPositopn.top + moveY\n }\n else if (type === OperateResizeHandlers.BOTTOM) {\n if (originPositopn.top + originPositopn.height + moveY > bottomPosition.height) {\n moveY = bottomPosition.height - (originPositopn.top + originPositopn.height)\n }\n if (originPositopn.height + moveY < minHeight) {\n moveY = minHeight - originPositopn.height\n }\n targetWidth = originPositopn.width\n targetHeight = originPositopn.height + moveY\n targetLeft = originPositopn.left\n targetTop = originPositopn.top\n }\n else if (type === OperateResizeHandlers.LEFT) {\n if (originPositopn.left + moveX < 0) {\n moveX = -originPositopn.left\n }\n if (originPositopn.width - moveX < minWidth) {\n moveX = originPositopn.width - minWidth\n }\n targetWidth = originPositopn.width - moveX\n targetHeight = originPositopn.height\n targetLeft = originPositopn.left + moveX\n targetTop = originPositopn.top\n }\n else {\n if (originPositopn.left + originPositopn.width + moveX > bottomPosition.width) {\n moveX = bottomPosition.width - (originPositopn.left + originPositopn.width)\n }\n if (originPositopn.width + moveX < minWidth) {\n moveX = minWidth - originPositopn.width\n }\n targetHeight = originPositopn.height\n targetWidth = originPositopn.width + moveX\n targetLeft = originPositopn.left\n targetTop = originPositopn.top\n }\n\n topImgWrapperPosition.value = {\n left: targetLeft,\n top: targetTop,\n width: targetWidth,\n height: targetHeight,\n }\n }\n\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n updateRange()\n\n setTimeout(() => isSettingClipRange.value = false, 0)\n }\n}\n\nconst rotateClassName = computed(() => {\n const prefix = 'rotate-'\n const rotate = props.rotate\n if (rotate > -22.5 && rotate <= 22.5) return prefix + 0\n else if (rotate > 22.5 && rotate <= 67.5) return prefix + 45\n else if (rotate > 67.5 && rotate <= 112.5) return prefix + 90\n else if (rotate > 112.5 && rotate <= 157.5) return prefix + 135\n else if (rotate > 157.5 || rotate <= -157.5) return prefix + 0\n else if (rotate > -157.5 && rotate <= -112.5) return prefix + 45\n else if (rotate > -112.5 && rotate <= -67.5) return prefix + 90\n else if (rotate > -67.5 && rotate <= -22.5) return prefix + 135\n return prefix + 0\n})\n\nconst cornerPoint = [\n OperateResizeHandlers.LEFT_TOP,\n OperateResizeHandlers.RIGHT_TOP,\n OperateResizeHandlers.LEFT_BOTTOM,\n OperateResizeHandlers.RIGHT_BOTTOM,\n]\nconst edgePoints = [\n OperateResizeHandlers.TOP,\n OperateResizeHandlers.BOTTOM,\n OperateResizeHandlers.LEFT,\n OperateResizeHandlers.RIGHT,\n]\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_click_outside = _resolveDirective(\"click-outside\")!\n\n return _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"image-clip-handler\",\n style: _normalizeStyle(clipWrapperPositionStyle.value)\n }, [\n _createElementVNode(\"img\", {\n class: \"bottom-img\",\n src: __props.src,\n draggable: false,\n alt: \"\",\n style: _normalizeStyle(_unref(bottomImgPositionStyle))\n }, null, 12, _hoisted_1),\n _createElementVNode(\"div\", {\n class: \"top-image-content\",\n style: _normalizeStyle({\n ..._unref(topImgWrapperPositionStyle),\n clipPath: __props.clipPath,\n })\n }, [\n _createElementVNode(\"img\", {\n class: \"top-img\",\n src: __props.src,\n draggable: false,\n alt: \"\",\n style: _normalizeStyle(_unref(topImgPositionStyle))\n }, null, 12, _hoisted_2)\n ], 4),\n _createElementVNode(\"div\", {\n class: \"operate\",\n style: _normalizeStyle(_unref(topImgWrapperPositionStyle)),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers($event => moveClipRange($event), [\"stop\"]))\n }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(cornerPoint, (point) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass(['clip-point', point, _unref(rotateClassName)]),\n key: point,\n onMousedown: _withModifiers($event => scaleClipRange($event, point), [\"stop\"])\n }, _hoisted_5, 42, _hoisted_3)\n }), 64)),\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(edgePoints, (point) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass(['clip-point', point, _unref(rotateClassName)]),\n key: point,\n onMousedown: _withModifiers($event => scaleClipRange($event, point), [\"stop\"])\n }, _hoisted_8, 42, _hoisted_6)\n }), 64))\n ], 36)\n ], 4)), [\n [_directive_click_outside, handleClip]\n ])\n}\n}\n\n})","import script from \"./ImageClipHandler.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImageClipHandler.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImageClipHandler.vue?vue&type=style&index=0&id=3e0199ec&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-3e0199ec\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, withModifiers as _withModifiers, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-30dc7050\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"src\"]\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { ImageElementClip, PPTImageElement } from '@/types/slides'\nimport { ImageClipedEmitData } from '@/types/edit'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\nimport useElementFlip from '@/views/components/element/hooks/useElementFlip'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport useClipImage from './useClipImage'\nimport useFilter from './useFilter'\n\nimport ImageOutline from './ImageOutline/index.vue'\nimport ImageClipHandler from './ImageClipHandler.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTImageElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { clipingImageElementId } = storeToRefs(mainStore)\n\nconst isCliping = computed(() => clipingImageElementId.value === props.elementInfo.id)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst flipH = computed(() => props.elementInfo.flipH)\nconst flipV = computed(() => props.elementInfo.flipV)\nconst { flipStyle } = useElementFlip(flipH, flipV)\n\nconst clip = computed(() => props.elementInfo.clip)\nconst { clipShape, imgPosition } = useClipImage(clip)\n\nconst filters = computed(() => props.elementInfo.filters)\nconst { filter } = useFilter(filters)\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n props.selectElement(e, props.elementInfo)\n}\n\nconst handleClip = (data: ImageClipedEmitData | null) => {\n mainStore.setClipingImageElementId('')\n \n if (!data) return\n\n const { range, position } = data\n const originClip: ImageElementClip = props.elementInfo.clip || { shape: 'rect', range: [[0, 0], [100, 100]] }\n\n const left = props.elementInfo.left + position.left\n const top = props.elementInfo.top + position.top\n const width = props.elementInfo.width + position.width\n const height = props.elementInfo.height + position.height\n\n let centerOffsetX = 0\n let centerOffsetY = 0\n\n if (props.elementInfo.rotate) {\n const centerX = (left + width / 2) - (props.elementInfo.left + props.elementInfo.width / 2)\n const centerY = -((top + height / 2) - (props.elementInfo.top + props.elementInfo.height / 2))\n\n const radian = -props.elementInfo.rotate * Math.PI / 180\n\n const rotatedCenterX = centerX * Math.cos(radian) - centerY * Math.sin(radian)\n const rotatedCenterY = centerX * Math.sin(radian) + centerY * Math.cos(radian)\n\n centerOffsetX = rotatedCenterX - centerX\n centerOffsetY = -(rotatedCenterY - centerY)\n }\n\n const _props = {\n clip: { ...originClip, range },\n left: left + centerOffsetX,\n top: top + centerOffsetY,\n width,\n height,\n }\n slidesStore.updateElement({ id: props.elementInfo.id, props: _props })\n \n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-image\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n (_unref(isCliping))\n ? (_openBlock(), _createBlock(ImageClipHandler, {\n key: 0,\n src: __props.elementInfo.src,\n clipData: __props.elementInfo.clip,\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n top: __props.elementInfo.top,\n left: __props.elementInfo.left,\n rotate: __props.elementInfo.rotate,\n clipPath: _unref(clipShape).style,\n onClip: _cache[0] || (_cache[0] = range => handleClip(range))\n }, null, 8, [\"src\", \"clipData\", \"width\", \"height\", \"top\", \"left\", \"rotate\", \"clipPath\"]))\n : _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: \"element-content\",\n style: _normalizeStyle({\n filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '',\n transform: _unref(flipStyle),\n }),\n onMousedown: _cache[2] || (_cache[2] = $event => handleSelectElement($event)),\n onTouchstart: _cache[3] || (_cache[3] = $event => handleSelectElement($event))\n }, [\n _createVNode(ImageOutline, { elementInfo: __props.elementInfo }, null, 8, [\"elementInfo\"]),\n _createElementVNode(\"div\", {\n class: \"image-content\",\n style: _normalizeStyle({ clipPath: _unref(clipShape).style })\n }, [\n _createElementVNode(\"img\", {\n src: __props.elementInfo.src,\n draggable: false,\n style: _normalizeStyle({\n top: _unref(imgPosition).top,\n left: _unref(imgPosition).left,\n width: _unref(imgPosition).width,\n height: _unref(imgPosition).height,\n filter: _unref(filter),\n }),\n onDragstart: _cache[1] || (_cache[1] = _withModifiers(() => {}, [\"prevent\"])),\n alt: \"\"\n }, null, 44, _hoisted_1)\n ], 4)\n ], 36)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=30dc7050&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-30dc7050\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-61b7d06a\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"d\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\n\nimport { PropType, toRef } from 'vue'\nimport { PPTElementOutline } from '@/types/slides'\n\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementOutline',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n outline: {\n type: Object as PropType\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst {\n outlineWidth,\n outlineStyle,\n outlineColor,\n} = useElementOutline(toRef(props, 'outline'))\n\nreturn (_ctx: any,_cache: any) => {\n return (__props.outline)\n ? (_openBlock(), _createElementBlock(\"svg\", {\n key: 0,\n class: \"element-outline\",\n overflow: \"visible\",\n width: __props.width,\n height: __props.height\n }, [\n _createElementVNode(\"path\", {\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n fill: \"transparent\",\n d: `M0,0 L${__props.width},0 L${__props.width},${__props.height} L0,${__props.height} Z`,\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 6' : '0 0'\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./ElementOutline.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementOutline.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementOutline.vue?vue&type=style&index=0&id=61b7d06a&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-61b7d06a\"]])\n\nexport default __exports__","import mitt, { Emitter } from 'mitt'\n\nexport const enum EmitterEvents {\n RICH_TEXT_COMMAND = 'RICH_TEXT_COMMAND',\n OPEN_CHART_DATA_EDITOR = 'OPEN_CHART_DATA_EDITOR',\n OPEN_LATEX_EDITOR = 'OPEN_LATEX_EDITOR',\n}\n\nexport interface RichTextAction {\n command: string\n value?: string\n}\n\nexport interface RichTextCommand {\n target?: string\n action: RichTextAction | RichTextAction[]\n}\n\ntype Events = {\n [EmitterEvents.RICH_TEXT_COMMAND]: RichTextCommand\n [EmitterEvents.OPEN_CHART_DATA_EDITOR]: void\n [EmitterEvents.OPEN_LATEX_EDITOR]: void\n} \n\nconst emitter: Emitter = mitt()\n\nexport default emitter","import { splitListItem, liftListItem, sinkListItem } from 'prosemirror-schema-list'\nimport { Schema } from 'prosemirror-model'\nimport { undo, redo } from 'prosemirror-history'\nimport { undoInputRule } from 'prosemirror-inputrules'\nimport {\n toggleMark,\n selectParentNode,\n joinUp,\n joinDown,\n Command,\n} from 'prosemirror-commands'\n\nexport const buildKeymap = (schema: Schema) => {\n const keys = {}\n const bind = (key: string, cmd: Command) => keys[key] = cmd\n\n bind('Alt-ArrowUp', joinUp)\n bind('Alt-ArrowDown', joinDown)\n bind('Ctrl-z', undo)\n bind('Ctrl-y', redo)\n bind('Backspace', undoInputRule)\n bind('Escape', selectParentNode)\n bind('Ctrl-b', toggleMark(schema.marks.strong))\n bind('Ctrl-i', toggleMark(schema.marks.em))\n bind('Ctrl-u', toggleMark(schema.marks.underline))\n bind('Ctrl-d', toggleMark(schema.marks.strikethrough))\n\n bind('Enter', splitListItem(schema.nodes.list_item))\n bind('Mod-[', liftListItem(schema.nodes.list_item))\n bind('Mod-]', sinkListItem(schema.nodes.list_item))\n\n return keys\n}","import { NodeType, Schema } from 'prosemirror-model'\nimport {\n inputRules,\n wrappingInputRule,\n textblockTypeInputRule,\n smartQuotes,\n emDash,\n ellipsis,\n} from 'prosemirror-inputrules'\n\nconst blockQuoteRule = (nodeType: NodeType) => wrappingInputRule(/^\\s*>\\s$/, nodeType)\n\nconst orderedListRule = (nodeType: NodeType) => (\n wrappingInputRule(\n /^(\\d+)\\.\\s$/, \n nodeType, \n match => ({order: +match[1]}),\n (match, node) => node.childCount + node.attrs.order === +match[1],\n )\n)\n\nconst bulletListRule = (nodeType: NodeType) => wrappingInputRule(/^\\s*([-+*])\\s$/, nodeType)\n\nconst codeBlockRule = (nodeType: NodeType) => textblockTypeInputRule(/^```$/, nodeType)\n\nexport const buildInputRules = (schema: Schema) => {\n const rules = [\n ...smartQuotes,\n ellipsis,\n emDash,\n ]\n rules.push(blockQuoteRule(schema.nodes.blockquote))\n rules.push(orderedListRule(schema.nodes.ordered_list))\n rules.push(bulletListRule(schema.nodes.bullet_list))\n rules.push(codeBlockRule(schema.nodes.code_block))\n\n return inputRules({ rules })\n}","import { keymap } from 'prosemirror-keymap'\nimport { Schema } from 'prosemirror-model'\nimport { history } from 'prosemirror-history'\nimport { baseKeymap } from 'prosemirror-commands'\nimport { dropCursor } from 'prosemirror-dropcursor'\nimport { gapCursor } from 'prosemirror-gapcursor'\n\nimport { buildKeymap } from './keymap'\nimport { buildInputRules } from './inputrules'\n\nexport const buildPlugins = (schema: Schema) => {\n return [\n buildInputRules(schema),\n keymap(buildKeymap(schema)),\n keymap(baseKeymap),\n dropCursor(),\n gapCursor(),\n history(),\n ]\n}","import { nodes } from 'prosemirror-schema-basic'\nimport { Node, NodeSpec } from 'prosemirror-model'\nimport { orderedList, bulletList, listItem } from 'prosemirror-schema-list'\n\nconst _orderedList: NodeSpec = {\n ...orderedList,\n content: 'list_item+',\n group: 'block',\n}\n\nconst _bulletList: NodeSpec = {\n ...bulletList,\n content: 'list_item+',\n group: 'block',\n}\n\nconst _listItem: NodeSpec = {\n ...listItem,\n content: 'paragraph block*',\n group: 'block',\n}\n\nconst paragraph: NodeSpec = {\n attrs: {\n align: {\n default: '',\n },\n indent: {\n default: 0,\n },\n },\n content: 'inline*',\n group: 'block',\n parseDOM: [\n {\n tag: 'p',\n getAttrs: dom => {\n const { textAlign } = (dom as HTMLElement).style\n\n let align = (dom as HTMLElement).getAttribute('align') || textAlign || ''\n align = /(left|right|center|justify)/.test(align) ? align : ''\n\n const indent = +((dom as HTMLElement).getAttribute('data-indent') || 0)\n \n return { align, indent }\n }\n }\n ],\n toDOM: (node: Node) => {\n const { align, indent } = node.attrs\n let style = ''\n if (align && align !== 'left') style += `text-align: ${align};`\n\n const attr = { style }\n if (indent) attr['data-indent'] = indent\n\n return ['p', attr, 0]\n },\n}\n\n// https://github.com/pipipi-pikachu/PPTist/issues/134\nconst { hard_break, ...otherNodes } = nodes\n\nexport default {\n ...otherNodes,\n 'ordered_list': _orderedList,\n 'bullet_list': _bulletList,\n 'list_item': _listItem,\n paragraph,\n}\n","import { marks } from 'prosemirror-schema-basic'\nimport { MarkSpec } from 'prosemirror-model'\n\nconst subscript: MarkSpec = {\n excludes: 'subscript',\n parseDOM: [\n { tag: 'sub' },\n {\n style: 'vertical-align',\n getAttrs: value => value === 'sub' && null\n },\n ],\n toDOM: () => ['sub', 0],\n}\n\nconst superscript: MarkSpec = {\n excludes: 'superscript',\n parseDOM: [\n { tag: 'sup' },\n {\n style: 'vertical-align',\n getAttrs: value => value === 'super' && null\n },\n ],\n toDOM: () => ['sup', 0],\n}\n\nconst strikethrough: MarkSpec = {\n parseDOM: [\n { tag: 'strike' },\n {\n style: 'text-decoration',\n getAttrs: value => value === 'line-through' && null\n },\n {\n style: 'text-decoration-line',\n getAttrs: value => value === 'line-through' && null\n },\n ],\n toDOM: () => ['span', { style: 'text-decoration-line: line-through' }, 0],\n}\n\nconst underline: MarkSpec = {\n parseDOM: [\n { tag: 'u' },\n {\n style: 'text-decoration',\n getAttrs: value => value === 'underline' && null\n },\n {\n style: 'text-decoration-line',\n getAttrs: value => value === 'underline' && null\n },\n ],\n toDOM: () => ['span', { style: 'text-decoration: underline' }, 0],\n}\n\nconst forecolor: MarkSpec = {\n attrs: {\n color: {},\n },\n inline: true,\n group: 'inline',\n parseDOM: [\n {\n style: 'color',\n getAttrs: color => color ? { color } : {}\n },\n ],\n toDOM: mark => {\n const { color } = mark.attrs\n let style = ''\n if (color) style += `color: ${color};`\n return ['span', { style }, 0]\n },\n}\n\nconst backcolor: MarkSpec = {\n attrs: {\n backcolor: {},\n },\n inline: true,\n group: 'inline',\n parseDOM: [\n {\n style: 'background-color',\n getAttrs: backcolor => backcolor ? { backcolor } : {}\n },\n ],\n toDOM: mark => {\n const { backcolor } = mark.attrs\n let style = ''\n if (backcolor) style += `background-color: ${backcolor};`\n return ['span', { style }, 0]\n },\n}\n\nconst fontsize: MarkSpec = {\n attrs: {\n fontsize: {},\n },\n inline: true,\n group: 'inline',\n parseDOM: [\n {\n style: 'font-size',\n getAttrs: fontsize => fontsize ? { fontsize } : {}\n },\n ],\n toDOM: mark => {\n const { fontsize } = mark.attrs\n let style = ''\n if (fontsize) style += `font-size: ${fontsize}`\n return ['span', { style }, 0]\n },\n}\n\nconst fontname: MarkSpec = {\n attrs: {\n fontname: {},\n },\n inline: true,\n group: 'inline',\n parseDOM: [\n {\n style: 'font-family',\n getAttrs: fontname => {\n return { fontname: fontname && typeof fontname === 'string' ? fontname.replace(/[\\\"\\']/g, '') : '' }\n }\n },\n ],\n toDOM: mark => {\n const { fontname } = mark.attrs\n let style = ''\n if (fontname) style += `font-family: ${fontname}`\n return ['span', { style }, 0]\n },\n}\n\nconst link: MarkSpec = {\n attrs: {\n href: {},\n title: { default: null },\n target: { default: '_blank' },\n },\n inclusive: false,\n parseDOM: [\n {\n tag: 'a[href]',\n getAttrs: dom => {\n const href = (dom as HTMLElement).getAttribute('href')\n const title = (dom as HTMLElement).getAttribute('title')\n return { href, title }\n }\n },\n ],\n toDOM: node => ['a', node.attrs, 0],\n}\n\nexport default {\n ...marks,\n subscript,\n superscript,\n strikethrough,\n underline,\n forecolor,\n backcolor,\n fontsize,\n fontname,\n link,\n}","import nodes from './nodes'\nimport marks from './marks'\n\nexport const schemaNodes = nodes\nexport const schemaMarks = marks\n","import { EditorState } from 'prosemirror-state'\nimport { EditorView } from 'prosemirror-view'\nimport { Schema, DOMParser } from 'prosemirror-model'\n\nimport { buildPlugins } from './plugins/index'\nimport { schemaNodes, schemaMarks } from './schema/index'\n\nconst schema = new Schema({\n nodes: schemaNodes,\n marks: schemaMarks,\n})\n\nexport const createDocument = (content: string) => {\n const htmlString = `
${content}
`\n const parser = new window.DOMParser()\n const element = parser.parseFromString(htmlString, 'text/html').body.firstElementChild\n return DOMParser.fromSchema(schema).parse(element as Element)\n}\n\nexport const initProsemirrorEditor = (dom: Element, content: string, props = {}) => {\n return new EditorView(dom, {\n state: EditorState.create({\n doc: createDocument(content),\n plugins: buildPlugins(schema),\n }),\n ...props,\n })\n}","import { Schema, Node, NodeType } from 'prosemirror-model'\nimport { Transaction } from 'prosemirror-state'\nimport { EditorView } from 'prosemirror-view'\n\nexport const setTextAlign = (tr: Transaction, schema: Schema, alignment: string) => {\n const { selection, doc } = tr\n if (!selection || !doc) return tr\n\n const { from, to } = selection\n const { nodes } = schema\n\n const blockquote = nodes.blockquote\n const listItem = nodes.list_item\n const paragraph = nodes.paragraph\n\n interface Task {\n node: Node\n pos: number\n nodeType: NodeType\n }\n\n const tasks: Task[] = []\n alignment = alignment || ''\n\n const allowedNodeTypes = new Set([blockquote, listItem, paragraph])\n\n doc.nodesBetween(from, to, (node, pos) => {\n const nodeType = node.type\n const align = node.attrs.align || ''\n if (align !== alignment && allowedNodeTypes.has(nodeType)) {\n tasks.push({\n node,\n pos,\n nodeType,\n })\n }\n return true\n })\n\n if (!tasks.length) return tr\n\n tasks.forEach(task => {\n const { node, pos, nodeType } = task\n let { attrs } = node\n if (alignment) attrs = { ...attrs, align: alignment }\n else attrs = { ...attrs, align: null }\n tr = tr.setNodeMarkup(pos, nodeType, attrs, node.marks)\n })\n\n return tr\n}\n\nexport const alignmentCommand = (view: EditorView, alignment: string) => {\n const { state } = view\n const { schema, selection } = state\n const tr = setTextAlign(\n state.tr.setSelection(selection),\n schema,\n alignment,\n )\n view.dispatch(tr)\n}","import { wrapInList, liftListItem } from 'prosemirror-schema-list'\nimport { Schema, Node, NodeType } from 'prosemirror-model'\nimport { Transaction, EditorState } from 'prosemirror-state'\nimport { findParentNode } from '../utils'\n\nexport const isList = (node: Node, schema: Schema) => {\n return (\n node.type === schema.nodes.bullet_list ||\n node.type === schema.nodes.ordered_list\n )\n}\n\nexport const toggleList = (listType: NodeType, itemType: NodeType) => {\n return (state: EditorState, dispatch: (tr: Transaction) => void) => {\n const { schema, selection } = state\n const { $from, $to } = selection\n const range = $from.blockRange($to)\n\n if (!range) return false\n\n const parentList = findParentNode((node: Node) => isList(node, schema))(selection)\n\n if (range.depth >= 1 && parentList && range.depth - parentList.depth <= 1) {\n if (parentList.node.type === listType) {\n return liftListItem(itemType)(state, dispatch)\n }\n\n if (isList(parentList.node, schema) && listType.validContent(parentList.node.content)) {\n const { tr } = state\n tr.setNodeMarkup(parentList.pos, listType)\n\n if (dispatch) dispatch(tr)\n\n return false\n }\n }\n\n return wrapInList(listType)(state, dispatch)\n }\n}\n","import { Schema } from 'prosemirror-model'\nimport { TextSelection, AllSelection, Transaction } from 'prosemirror-state'\nimport { EditorView } from 'prosemirror-view'\nimport { isList } from './toggleList'\n\nfunction setNodeIndentMarkup(tr: Transaction, pos: number, delta: number): Transaction {\n if (!tr.doc) return tr\n\n const node = tr.doc.nodeAt(pos)\n if (!node) return tr\n\n const minIndent = 0\n const maxIndent = 7\n\n let indent = (node.attrs.indent || 0) + delta\n if (indent < minIndent) indent = minIndent\n if (indent > maxIndent) indent = maxIndent\n\n if (indent === node.attrs.indent) return tr\n\n const nodeAttrs = {\n ...node.attrs,\n indent,\n }\n\n return tr.setNodeMarkup(pos, node.type, nodeAttrs, node.marks)\n}\n\nconst setTextIndent = (tr: Transaction, schema: Schema, delta: number): Transaction => {\n const { selection, doc } = tr\n if (!selection || !doc) return tr\n\n if (!(selection instanceof TextSelection || selection instanceof AllSelection)) return tr\n\n const { from, to } = selection\n\n doc.nodesBetween(from, to, (node, pos) => {\n const nodeType = node.type\n\n if (nodeType.name === 'paragraph' || nodeType.name === 'blockquote') {\n tr = setNodeIndentMarkup(tr, pos, delta)\n return false\n } \n else if (isList(node, schema)) return false\n return true\n })\n\n return tr\n}\n\nexport const indentCommand = (view: EditorView, delta: number) => {\n const { state } = view\n const { schema, selection } = state\n\n const tr = setTextIndent(\n state.tr.setSelection(selection),\n schema,\n delta,\n )\n if (tr.docChanged) {\n view.dispatch(tr)\n return true\n }\n\n return false\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport { debounce } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { EditorView } from 'prosemirror-view'\nimport { toggleMark, wrapIn } from 'prosemirror-commands'\nimport { initProsemirrorEditor, createDocument } from '@/utils/prosemirror'\nimport { findNodesWithSameMark, getTextAttrs, autoSelectAll, addMark, markActive, getFontsize } from '@/utils/prosemirror/utils'\nimport emitter, { EmitterEvents, RichTextCommand } from '@/utils/emitter'\nimport { alignmentCommand } from '@/utils/prosemirror/commands/setTextAlign'\nimport { indentCommand } from '@/utils/prosemirror/commands/setTextIndent'\nimport { toggleList } from '@/utils/prosemirror/commands/toggleList'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ProsemirrorEditor',\n props: {\n elementId: {\n type: String,\n required: true,\n },\n defaultColor: {\n type: String,\n required: true,\n },\n defaultFontName: {\n type: String,\n required: true,\n },\n editable: {\n type: Boolean,\n default: false,\n },\n value: {\n type: String,\n required: true,\n },\n autoFocus: {\n type: Boolean,\n default: false,\n },\n},\n emits: [\"update\", \"focus\", \"blur\"],\n setup(__props, { expose, emit }: { emit: ({\n (event: 'update', payload: string): void\n (event: 'focus'): void\n (event: 'blur'): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst mainStore = useMainStore()\nconst { handleElementId } = storeToRefs(mainStore)\n\nconst editorViewRef = ref()\nlet editorView: EditorView\n\n// 富文本的各种交互事件监听:\n// 聚焦时取消全局快捷键事件\n// 输入文字时同步数据到vuex\n// 点击鼠标和键盘时同步富文本状态到工具栏\nconst handleInput = debounce(function() {\n emit('update', editorView.dom.innerHTML)\n}, 300, { trailing: true })\n\nconst handleFocus = () => {\n mainStore.setDisableHotkeysState(true)\n emit('focus')\n}\n\nconst handleBlur = () => {\n mainStore.setDisableHotkeysState(false)\n emit('blur')\n}\n\nconst handleClick = debounce(function() {\n const attrs = getTextAttrs(editorView, {\n color: props.defaultColor,\n fontname: props.defaultFontName,\n })\n mainStore.setRichtextAttrs(attrs)\n}, 30, { trailing: true })\n\nconst handleKeydown = () => {\n handleInput()\n handleClick()\n}\n\n// 将富文本内容同步到DOM\nconst textContent = computed(() => props.value)\nwatch(textContent, () => {\n if (!editorView) return\n if (editorView.hasFocus()) return\n\n const { doc, tr } = editorView.state\n editorView.dispatch(tr.replaceRangeWith(0, doc.content.size, createDocument(textContent.value)))\n})\n\n// 打开/关闭编辑器的编辑模式\nwatch(() => props.editable, () => {\n editorView.setProps({ editable: () => props.editable })\n})\n\n// Prosemirror编辑器的初始化和卸载\nonMounted(() => {\n editorView = initProsemirrorEditor((editorViewRef.value as Element), textContent.value, {\n handleDOMEvents: {\n focus: handleFocus,\n blur: handleBlur,\n keydown: handleKeydown,\n click: handleClick,\n },\n editable: () => props.editable,\n })\n if (props.autoFocus) editorView.focus()\n})\nonUnmounted(() => {\n editorView && editorView.destroy()\n})\n\n// 暴露 focus 方法\nconst focus = () => editorView.focus()\nexpose({ focus })\n\n// 执行富文本命令(可以是一个或多个)\n// 部分命令在执行前先判断当前选区是否为空,如果选区为空先进行全选操作\nconst execCommand = ({ target, action }: RichTextCommand) => {\n if (!target && handleElementId.value !== props.elementId) return\n if (target && target !== props.elementId) return\n\n const actions = ('command' in action) ? [action] : action\n\n for (const item of actions) {\n if (item.command === 'fontname' && item.value) {\n const mark = editorView.state.schema.marks.fontname.create({ fontname: item.value })\n autoSelectAll(editorView)\n addMark(editorView, mark)\n }\n else if (item.command === 'fontsize' && item.value) {\n const mark = editorView.state.schema.marks.fontsize.create({ fontsize: item.value })\n autoSelectAll(editorView)\n addMark(editorView, mark)\n }\n else if (item.command === 'fontsize-add') {\n const step = item.value ? +item.value : 2\n autoSelectAll(editorView)\n const fontsize = getFontsize(editorView) + step + 'px'\n const mark = editorView.state.schema.marks.fontsize.create({ fontsize })\n addMark(editorView, mark)\n }\n else if (item.command === 'fontsize-reduce') {\n const step = item.value ? +item.value : 2\n autoSelectAll(editorView)\n let fontsize = getFontsize(editorView) - step\n if (fontsize < 12) fontsize = 12\n const mark = editorView.state.schema.marks.fontsize.create({ fontsize: fontsize + 'px' })\n addMark(editorView, mark)\n }\n else if (item.command === 'color' && item.value) {\n const mark = editorView.state.schema.marks.forecolor.create({ color: item.value })\n autoSelectAll(editorView)\n addMark(editorView, mark)\n }\n else if (item.command === 'backcolor' && item.value) {\n const mark = editorView.state.schema.marks.backcolor.create({ backcolor: item.value })\n autoSelectAll(editorView)\n addMark(editorView, mark)\n }\n else if (item.command === 'bold') {\n autoSelectAll(editorView)\n toggleMark(editorView.state.schema.marks.strong)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'em') {\n autoSelectAll(editorView)\n toggleMark(editorView.state.schema.marks.em)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'underline') {\n autoSelectAll(editorView)\n toggleMark(editorView.state.schema.marks.underline)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'strikethrough') {\n autoSelectAll(editorView)\n toggleMark(editorView.state.schema.marks.strikethrough)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'subscript') {\n toggleMark(editorView.state.schema.marks.subscript)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'superscript') {\n toggleMark(editorView.state.schema.marks.superscript)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'blockquote') {\n wrapIn(editorView.state.schema.nodes.blockquote)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'code') {\n toggleMark(editorView.state.schema.marks.code)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'align' && item.value) {\n alignmentCommand(editorView, item.value)\n }\n else if (item.command === 'indent' && item.value) {\n indentCommand(editorView, +item.value)\n }\n else if (item.command === 'bulletList') {\n const { bullet_list: bulletList, list_item: listItem } = editorView.state.schema.nodes\n toggleList(bulletList, listItem)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'orderedList') {\n const { ordered_list: orderedList, list_item: listItem } = editorView.state.schema.nodes\n toggleList(orderedList, listItem)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'clear') {\n autoSelectAll(editorView)\n const { $from, $to } = editorView.state.selection\n editorView.dispatch(editorView.state.tr.removeMark($from.pos, $to.pos))\n }\n else if (item.command === 'link') {\n const markType = editorView.state.schema.marks.link\n const { from, to } = editorView.state.selection\n const result = findNodesWithSameMark(editorView.state.doc, from, to, markType)\n if (result) {\n if (item.value) {\n const mark = editorView.state.schema.marks.link.create({ href: item.value, title: item.value })\n addMark(editorView, mark, { from: result.from.pos, to: result.to.pos + 1 })\n }\n else editorView.dispatch(editorView.state.tr.removeMark(result.from.pos, result.to.pos + 1, markType))\n }\n else if (markActive(editorView.state, markType)) {\n if (item.value) {\n const mark = editorView.state.schema.marks.link.create({ href: item.value, title: item.value })\n addMark(editorView, mark)\n }\n else toggleMark(markType)(editorView.state, editorView.dispatch)\n }\n else if (item.value) {\n autoSelectAll(editorView)\n toggleMark(markType, { href: item.value, title: item.value })(editorView.state, editorView.dispatch)\n }\n }\n else if (item.command === 'insert' && item.value) {\n editorView.dispatch(editorView.state.tr.insertText(item.value))\n }\n }\n\n editorView.focus()\n handleInput()\n handleClick()\n}\n\nemitter.on(EmitterEvents.RICH_TEXT_COMMAND, execCommand)\nonUnmounted(() => {\n emitter.off(EmitterEvents.RICH_TEXT_COMMAND, execCommand)\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"prosemirror-editor\",\n ref_key: \"editorViewRef\",\n ref: editorViewRef\n }, null, 512))\n}\n}\n\n})","import script from \"./ProsemirrorEditor.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ProsemirrorEditor.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ProsemirrorEditor.vue?vue&type=style&index=0&id=1debd6ff&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1debd6ff\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-7135a611\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"drag-handler top\" }, null, -1))\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"drag-handler bottom\" }, null, -1))\n\nimport { computed, onMounted, onUnmounted, PropType, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTTextElement } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementOutline from '@/views/components/element/ElementOutline.vue'\nimport ProsemirrorEditor from '@/views/components/element/ProsemirrorEditor.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTTextElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElementId, isScaling } = storeToRefs(mainStore)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst elementRef = ref()\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent, canMove = true) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo, canMove)\n}\n\n// 监听文本元素的尺寸变化,当高度变化时,更新高度到vuex\n// 如果高度变化时正处在缩放操作中,则等待缩放操作结束后再更新\nconst realHeightCache = ref(-1)\n\nwatch(isScaling, () => {\n if (handleElementId.value !== props.elementInfo.id) return\n\n if (!isScaling.value && realHeightCache.value !== -1) {\n slidesStore.updateElement({\n id: props.elementInfo.id,\n props: { height: realHeightCache.value },\n })\n realHeightCache.value = -1\n }\n})\n\nconst updateTextElementHeight = (entries: ResizeObserverEntry[]) => {\n const contentRect = entries[0].contentRect\n if (!elementRef.value) return\n\n const realHeight = contentRect.height\n\n if (props.elementInfo.height !== realHeight) {\n if (!isScaling.value) {\n slidesStore.updateElement({\n id: props.elementInfo.id,\n props: { height: realHeight },\n })\n }\n else realHeightCache.value = realHeight\n }\n}\nconst resizeObserver = new ResizeObserver(updateTextElementHeight)\n\nonMounted(() => {\n if (elementRef.value) resizeObserver.observe(elementRef.value)\n})\nonUnmounted(() => {\n if (elementRef.value) resizeObserver.unobserve(elementRef.value)\n})\n\nconst updateContent = (content: string) => {\n slidesStore.updateElement({\n id: props.elementInfo.id,\n props: { content },\n })\n \n addHistorySnapshot()\n}\n\nconst checkEmptyText = () => {\n const pureText = props.elementInfo.content.replaceAll(/<[^>]+>/g, '')\n if (!pureText) slidesStore.deleteElement(props.elementInfo.id)\n}\n\nconst isHandleElement = computed(() => handleElementId.value === props.elementInfo.id)\nwatch(isHandleElement, () => {\n if (!isHandleElement.value) checkEmptyText()\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-text\", { 'lock': __props.elementInfo.lock }]),\n ref_key: \"elementRef\",\n ref: elementRef,\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\n backgroundColor: __props.elementInfo.fill,\n opacity: __props.elementInfo.opacity,\n textShadow: _unref(shadowStyle),\n lineHeight: __props.elementInfo.lineHeight,\n letterSpacing: (__props.elementInfo.wordSpace || 0) + 'px',\n color: __props.elementInfo.defaultColor,\n fontFamily: __props.elementInfo.defaultFontName,\n }),\n onMousedown: _cache[3] || (_cache[3] = $event => handleSelectElement($event)),\n onTouchstart: _cache[4] || (_cache[4] = $event => handleSelectElement($event))\n }, [\n _createVNode(ElementOutline, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"outline\"]),\n _createVNode(ProsemirrorEditor, {\n class: \"text\",\n elementId: __props.elementInfo.id,\n defaultColor: __props.elementInfo.defaultColor,\n defaultFontName: __props.elementInfo.defaultFontName,\n editable: !__props.elementInfo.lock,\n value: __props.elementInfo.content,\n style: _normalizeStyle({\n '--textIndent': `${__props.elementInfo.textIndent || 0}px`,\n '--paragraphSpace': `${__props.elementInfo.paragraphSpace === undefined ? 5 : __props.elementInfo.paragraphSpace}px`,\n }),\n onUpdate: _cache[0] || (_cache[0] = value => updateContent(value)),\n onMousedown: _cache[1] || (_cache[1] = $event => handleSelectElement($event, false)),\n onTouchstart: _cache[2] || (_cache[2] = $event => handleSelectElement($event))\n }, null, 8, [\"elementId\", \"defaultColor\", \"defaultFontName\", \"editable\", \"value\", \"style\"]),\n _hoisted_1,\n _hoisted_2\n ], 36)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=7135a611&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7135a611\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = [\"id\", \"gradientTransform\"]\nconst _hoisted_2 = [\"stop-color\"]\nconst _hoisted_3 = [\"stop-color\"]\nconst _hoisted_4 = [\"id\"]\nconst _hoisted_5 = [\"stop-color\"]\nconst _hoisted_6 = [\"stop-color\"]\n\nimport { PropType } from 'vue'\r\n\r\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'GradientDefs',\n props: {\r\n id: {\r\n type: String,\r\n required: true,\r\n },\r\n type: {\r\n type: String as PropType<'linear' | 'radial'>,\r\n },\r\n color1: {\r\n type: String,\r\n required: true,\r\n },\r\n color2: {\r\n type: String,\r\n required: true,\r\n },\r\n rotate: {\r\n type: Number,\r\n default: 0,\r\n },\r\n},\n setup(__props) {\n\r\n\r\n\nreturn (_ctx: any,_cache: any) => {\n return (__props.type === 'linear')\n ? (_openBlock(), _createElementBlock(\"linearGradient\", {\n key: 0,\n id: __props.id,\n x1: \"0%\",\n y1: \"0%\",\n x2: \"100%\",\n y2: \"0%\",\n gradientTransform: `rotate(${__props.rotate},0.5,0.5)`\n }, [\n _createElementVNode(\"stop\", {\n offset: \"0%\",\n \"stop-color\": __props.color1\n }, null, 8, _hoisted_2),\n _createElementVNode(\"stop\", {\n offset: \"100%\",\n \"stop-color\": __props.color2\n }, null, 8, _hoisted_3)\n ], 8, _hoisted_1))\n : (_openBlock(), _createElementBlock(\"radialGradient\", {\n key: 1,\n id: __props.id\n }, [\n _createElementVNode(\"stop\", {\n offset: \"0%\",\n \"stop-color\": __props.color1\n }, null, 8, _hoisted_5),\n _createElementVNode(\"stop\", {\n offset: \"100%\",\n \"stop-color\": __props.color2\n }, null, 8, _hoisted_6)\n ], 8, _hoisted_4))\n}\n}\n\n})","import script from \"./GradientDefs.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./GradientDefs.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-d4c718fa\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = { key: 0 }\nconst _hoisted_3 = [\"transform\"]\nconst _hoisted_4 = [\"d\", \"fill\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\n\nimport { computed, nextTick, PropType, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTShapeElement, ShapeText } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\nimport useElementFlip from '@/views/components/element/hooks/useElementFlip'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport GradientDefs from './GradientDefs.vue'\nimport ProsemirrorEditor from '@/views/components/element/ProsemirrorEditor.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTShapeElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElementId } = storeToRefs(mainStore)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent, canMove = true) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo, canMove)\n}\n\nconst outline = computed(() => props.elementInfo.outline)\nconst { outlineWidth, outlineStyle, outlineColor } = useElementOutline(outline)\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst flipH = computed(() => props.elementInfo.flipH)\nconst flipV = computed(() => props.elementInfo.flipV)\nconst { flipStyle } = useElementFlip(flipH, flipV)\n\nconst editable = ref(false)\n\nwatch(handleElementId, () => {\n if (handleElementId.value !== props.elementInfo.id) {\n if (editable.value) editable.value = false\n }\n})\n\nconst text = computed(() => {\n const defaultText: ShapeText = {\n content: '',\n defaultFontName: '微软雅黑',\n defaultColor: '#000',\n align: 'middle',\n }\n if (!props.elementInfo.text) return defaultText\n\n return props.elementInfo.text\n})\n\nconst updateText = (content: string) => {\n const _text = { ...text.value, content }\n slidesStore.updateElement({\n id: props.elementInfo.id, \n props: { text: _text },\n })\n \n addHistorySnapshot()\n}\n\nconst checkEmptyText = () => {\n if (!props.elementInfo.text) return\n\n const pureText = props.elementInfo.text.content.replaceAll(/<[^>]+>/g, '')\n if (!pureText) {\n slidesStore.removeElementProps({ id: props.elementInfo.id, propName: 'text' })\n addHistorySnapshot()\n }\n}\n\nconst prosemirrorEditorRef = ref()\nconst startEdit = () => {\n editable.value = true\n nextTick(() => prosemirrorEditorRef.value && prosemirrorEditorRef.value.focus())\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-shape\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\n opacity: __props.elementInfo.opacity,\n filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '',\n transform: _unref(flipStyle),\n color: _unref(text).defaultColor,\n fontFamily: _unref(text).defaultFontName,\n }),\n onMousedown: _cache[4] || (_cache[4] = $event => handleSelectElement($event)),\n onTouchstart: _cache[5] || (_cache[5] = $event => handleSelectElement($event)),\n onDblclick: _cache[6] || (_cache[6] = ($event: any) => (startEdit()))\n }, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: __props.elementInfo.width,\n height: __props.elementInfo.height\n }, [\n (__props.elementInfo.gradient)\n ? (_openBlock(), _createElementBlock(\"defs\", _hoisted_2, [\n _createVNode(GradientDefs, {\n id: `editabel-gradient-${__props.elementInfo.id}`,\n type: __props.elementInfo.gradient.type,\n color1: __props.elementInfo.gradient.color[0],\n color2: __props.elementInfo.gradient.color[1],\n rotate: __props.elementInfo.gradient.rotate\n }, null, 8, [\"id\", \"type\", \"color1\", \"color2\", \"rotate\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"g\", {\n transform: `scale(${__props.elementInfo.width / __props.elementInfo.viewBox[0]}, ${__props.elementInfo.height / __props.elementInfo.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`\n }, [\n _createElementVNode(\"path\", {\n class: \"shape-path\",\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n d: __props.elementInfo.path,\n fill: __props.elementInfo.gradient ? `url(#editabel-gradient-${__props.elementInfo.id})` : __props.elementInfo.fill,\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 6' : '0 0'\n }, null, 8, _hoisted_4)\n ], 8, _hoisted_3)\n ], 8, _hoisted_1)),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"shape-text\", [_unref(text).align, { 'editable': editable.value || _unref(text).content }]])\n }, [\n (editable.value || _unref(text).content)\n ? (_openBlock(), _createBlock(ProsemirrorEditor, {\n key: 0,\n ref_key: \"prosemirrorEditorRef\",\n ref: prosemirrorEditorRef,\n elementId: __props.elementInfo.id,\n defaultColor: _unref(text).defaultColor,\n defaultFontName: _unref(text).defaultFontName,\n editable: !__props.elementInfo.lock,\n value: _unref(text).content,\n onUpdate: _cache[0] || (_cache[0] = value => updateText(value)),\n onBlur: _cache[1] || (_cache[1] = ($event: any) => (checkEmptyText())),\n onMousedown: _cache[2] || (_cache[2] = $event => handleSelectElement($event, false)),\n onTouchstart: _cache[3] || (_cache[3] = $event => handleSelectElement($event, false))\n }, null, 8, [\"elementId\", \"defaultColor\", \"defaultFontName\", \"editable\", \"value\"]))\n : _createCommentVNode(\"\", true)\n ], 2)\n ], 36)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=d4c718fa&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-d4c718fa\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"id\", \"markerWidth\", \"markerHeight\", \"refX\", \"refY\"]\nconst _hoisted_2 = [\"d\", \"fill\", \"transform\"]\n\nimport { computed, PropType } from 'vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LinePointMarker',\n props: {\n id: {\n type: String,\n required: true,\n },\n position: {\n type: String as PropType<'start' | 'end'>,\n required: true,\n },\n type: {\n type: String as PropType<'dot' | 'arrow'>,\n required: true,\n },\n color: {\n type: String,\n },\n baseSize: {\n type: Number,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst pathMap = {\n dot: 'm0 5a5 5 0 1 0 10 0a5 5 0 1 0 -10 0z',\n arrow: 'M0,0 L10,5 0,10 Z',\n}\nconst rotateMap = {\n 'arrow-start': 180,\n 'arrow-end': 0,\n}\n\nconst path = computed(() => pathMap[props.type])\nconst rotate = computed(() => rotateMap[`${props.type}-${props.position}`] || 0)\nconst size = computed(() => props.baseSize < 2 ? 2 : props.baseSize)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"marker\", {\n id: `${__props.id}-${__props.type}-${__props.position}`,\n markerUnits: \"userSpaceOnUse\",\n orient: \"auto\",\n markerWidth: _unref(size) * 3,\n markerHeight: _unref(size) * 3,\n refX: _unref(size) * 1.5,\n refY: _unref(size) * 1.5\n }, [\n _createElementVNode(\"path\", {\n d: _unref(path),\n fill: __props.color,\n transform: `scale(${_unref(size) * 0.3}, ${_unref(size) * 0.3}) rotate(${_unref(rotate)}, 5, 5)`\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n}\n}\n\n})","import script from \"./LinePointMarker.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LinePointMarker.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-6550e504\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"d\", \"stroke\", \"stroke-width\", \"stroke-dasharray\", \"marker-start\", \"marker-end\"]\nconst _hoisted_3 = [\"d\"]\n\nimport { computed, PropType } from 'vue'\nimport { PPTLineElement } from '@/types/slides'\nimport { getLineElementPath } from '@/utils/element'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\n\nimport LinePointMarker from './LinePointMarker.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTLineElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo)\n}\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst svgWidth = computed(() => {\n const width = Math.abs(props.elementInfo.start[0] - props.elementInfo.end[0])\n return width < 24 ? 24 : width\n})\nconst svgHeight = computed(() => {\n const height = Math.abs(props.elementInfo.start[1] - props.elementInfo.end[1])\n return height < 24 ? 24 : height\n})\n\nconst lineDashArray = computed(() => props.elementInfo.style === 'dashed' ? '10 6' : '0 0')\n\nconst path = computed(() => {\n return getLineElementPath(props.elementInfo)\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-shape\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({ filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '' }),\n onMousedown: _cache[0] || (_cache[0] = $event => handleSelectElement($event)),\n onTouchstart: _cache[1] || (_cache[1] = $event => handleSelectElement($event))\n }, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: _unref(svgWidth),\n height: _unref(svgHeight)\n }, [\n _createElementVNode(\"defs\", null, [\n (__props.elementInfo.points[0])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 0,\n id: __props.elementInfo.id,\n position: \"start\",\n type: __props.elementInfo.points[0],\n color: __props.elementInfo.color,\n baseSize: __props.elementInfo.width\n }, null, 8, [\"id\", \"type\", \"color\", \"baseSize\"]))\n : _createCommentVNode(\"\", true),\n (__props.elementInfo.points[1])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 1,\n id: __props.elementInfo.id,\n position: \"end\",\n type: __props.elementInfo.points[1],\n color: __props.elementInfo.color,\n baseSize: __props.elementInfo.width\n }, null, 8, [\"id\", \"type\", \"color\", \"baseSize\"]))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"path\", {\n class: \"line-point\",\n d: _unref(path),\n stroke: __props.elementInfo.color,\n \"stroke-width\": __props.elementInfo.width,\n \"stroke-dasharray\": _unref(lineDashArray),\n fill: \"none\",\n \"marker-start\": __props.elementInfo.points[0] ? `url(#${__props.elementInfo.id}-${__props.elementInfo.points[0]}-start)` : '',\n \"marker-end\": __props.elementInfo.points[1] ? `url(#${__props.elementInfo.id}-${__props.elementInfo.points[1]}-end)` : ''\n }, null, 8, _hoisted_2),\n _withDirectives(_createElementVNode(\"path\", {\n class: \"line-path\",\n d: _unref(path),\n stroke: \"transparent\",\n \"stroke-width\": \"20\",\n fill: \"none\"\n }, null, 8, _hoisted_3), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 8, _hoisted_1))\n ], 36)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=6550e504&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6550e504\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createCommentVNode as _createCommentVNode } from \"vue\"\n\nimport { computed, inject, onMounted, PropType, ref, watch } from 'vue'\nimport { upperFirst } from 'lodash'\nimport tinycolor from 'tinycolor2'\nimport Chartist, {\n IChartistLineChart,\n IChartistBarChart,\n IChartistPieChart,\n} from 'chartist'\nimport { ChartData, ChartOptions, ChartType } from '@/types/slides'\nimport { injectKeySlideScale } from '@/types/injectKey'\n\nimport 'chartist/dist/scss/chartist.scss'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Chart',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n type: {\n type: String as PropType,\n required: true,\n },\n data: {\n type: Object as PropType,\n required: true,\n },\n options: {\n type: Object as PropType,\n },\n themeColor: {\n type: Array as PropType,\n required: true,\n },\n legends: {\n type: Array as PropType,\n required: true,\n },\n gridColor: {\n type: String,\n },\n legend: {\n type: String as PropType<'' | 'top' | 'bottom'>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst chartRef = ref()\nconst slideScale = inject(injectKeySlideScale) || ref(1)\n\nlet chart: IChartistLineChart | IChartistBarChart | IChartistPieChart | undefined\n\nconst chartHeight = computed(() => {\n if (props.legend) return props.height - 20\n return props.height\n})\n\nconst getDataAndOptions = () => {\n const propsOptopns = props.options || {}\n const options = {\n ...propsOptopns,\n width: props.width * slideScale.value,\n height: chartHeight.value * slideScale.value,\n }\n const data = props.type === 'pie' ? { ...props.data, series: props.data.series[0] } : props.data\n return { data, options }\n}\n\nconst renderChart = () => {\n if (!chartRef.value) return\n\n const type = upperFirst(props.type)\n const { data, options } = getDataAndOptions()\n chart = new Chartist[type](chartRef.value, data, options)\n}\n\nconst updateChart = () => {\n if (!chart) {\n renderChart()\n return\n }\n const { data, options } = getDataAndOptions()\n chart.update(data, options)\n}\n\nwatch([\n () => props.width,\n () => props.height,\n () => props.data,\n () => props.options,\n slideScale,\n], updateChart)\n\nonMounted(renderChart)\n\nconst themeColors = computed(() => {\n let colors: string[] = []\n if (props.themeColor.length >= 10) colors = props.themeColor\n else if (props.themeColor.length === 1) colors = tinycolor(props.themeColor[0]).analogous(10).map(color => color.toHexString())\n else {\n const len = props.themeColor.length\n const supplement = tinycolor(props.themeColor[len - 1]).analogous(10 + 1 - len).map(color => color.toHexString())\n colors = [...props.themeColor.slice(0, len - 1), ...supplement]\n }\n return colors\n})\n\n// 更新主题配色:\n// 如果当前所设置的主题色数小于10,剩余部分获取最后一个主题色的相近颜色作为配色\nconst updateTheme = () => {\n if (!chartRef.value) return\n\n for (let i = 0; i < 10; i++) {\n chartRef.value.style.setProperty(`--theme-color-${i + 1}`, themeColors.value[i])\n }\n}\n\nwatch(themeColors, updateTheme)\nonMounted(updateTheme)\n\n// 更新网格颜色,包括坐标的文字部分\nconst updateGridColor = () => {\n if (!chartRef.value) return\n if (props.gridColor) chartRef.value.style.setProperty(`--grid-color`, props.gridColor)\n}\n\nwatch(() => props.gridColor, updateGridColor)\nonMounted(updateGridColor)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"chart\",\n style: _normalizeStyle({ flexDirection: __props.legend === 'top' ? 'column-reverse' : 'column' })\n }, [\n _createElementVNode(\"div\", {\n class: \"chart-content\",\n ref_key: \"chartRef\",\n ref: chartRef,\n style: _normalizeStyle({\n width: __props.width + 'px',\n height: _unref(chartHeight) + 'px',\n transform: `scale(${1 / _unref(slideScale)})`,\n })\n }, null, 4),\n (__props.legend)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"legends\",\n style: _normalizeStyle({ transform: `scale(${1 / _unref(slideScale)})` })\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.legends, (legend, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"legend\",\n key: index,\n style: _normalizeStyle({ color: __props.gridColor })\n }, [\n _createElementVNode(\"div\", {\n class: \"block\",\n style: _normalizeStyle({ backgroundColor: _unref(themeColors)[index] })\n }, null, 4),\n _createTextVNode(\" \" + _toDisplayString(legend), 1)\n ], 4))\n }), 128))\n ], 4))\n : _createCommentVNode(\"\", true)\n ], 4))\n}\n}\n\n})","import script from \"./Chart.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Chart.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Chart.vue?vue&type=style&index=0&id=1aa2357d&lang=scss&scoped=true\"\nimport \"./Chart.vue?vue&type=style&index=1&id=1aa2357d&lang=scss\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1aa2357d\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nimport { PropType } from 'vue'\r\nimport { PPTChartElement } from '@/types/slides'\r\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\r\nimport emitter, { EmitterEvents } from '@/utils/emitter'\r\n\r\nimport ElementOutline from '@/views/components/element/ElementOutline.vue'\r\nimport Chart from './Chart.vue'\r\n\r\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\r\n elementInfo: {\r\n type: Object as PropType,\r\n required: true,\r\n },\r\n selectElement: {\r\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTChartElement, canMove?: boolean) => void>,\r\n required: true,\r\n },\r\n contextmenus: {\r\n type: Function as PropType<() => ContextmenuItem[] | null>,\r\n },\r\n},\n setup(__props) {\n\nconst props = __props\n\r\n\r\n\r\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\r\n if (props.elementInfo.lock) return\r\n e.stopPropagation()\r\n\r\n props.selectElement(e, props.elementInfo)\r\n}\r\n\r\nconst openDataEditor = () => {\r\n emitter.emit(EmitterEvents.OPEN_CHART_DATA_EDITOR)\r\n}\r\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-chart\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\r\n top: __props.elementInfo.top + 'px',\r\n left: __props.elementInfo.left + 'px',\r\n width: __props.elementInfo.width + 'px',\r\n height: __props.elementInfo.height + 'px',\r\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\r\n backgroundColor: __props.elementInfo.fill,\r\n }),\n onMousedown: _cache[0] || (_cache[0] = $event => handleSelectElement($event)),\n onTouchstart: _cache[1] || (_cache[1] = $event => handleSelectElement($event)),\n onDblclick: _cache[2] || (_cache[2] = ($event: any) => (openDataEditor()))\n }, [\n _createVNode(ElementOutline, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"outline\"]),\n _createVNode(Chart, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n type: __props.elementInfo.chartType,\n data: __props.elementInfo.data,\n options: __props.elementInfo.options,\n themeColor: __props.elementInfo.themeColor,\n gridColor: __props.elementInfo.gridColor,\n legends: __props.elementInfo.data.legends,\n legend: __props.elementInfo.legend || ''\n }, null, 8, [\"width\", \"height\", \"type\", \"data\", \"options\", \"themeColor\", \"gridColor\", \"legends\", \"legend\"])\n ], 36)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=f3c03862&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-f3c03862\"]])\n\nexport default __exports__","import { CSSProperties } from 'vue'\nimport { TableCellStyle } from '@/types/slides'\n\n/**\n * 计算单元格文本样式\n * @param style 单元格文本样式原数据\n */\nexport const getTextStyle = (style?: TableCellStyle): CSSProperties => {\n if (!style) return {}\n const {\n bold,\n em,\n underline,\n strikethrough,\n color,\n backcolor,\n fontsize,\n fontname,\n align,\n } = style\n\n let textDecoration = `${underline ? 'underline' : ''} ${strikethrough ? 'line-through' : ''}`\n if (textDecoration === ' ') textDecoration = 'none'\n \n return {\n fontWeight: bold ? 'bold' : 'normal',\n fontStyle: em ? 'italic' : 'normal',\n textDecoration,\n color: color || '#000',\n backgroundColor: backcolor || '',\n fontSize: fontsize || '14px',\n fontFamily: fontname || '微软雅黑',\n textAlign: align || 'left',\n }\n}\n\nexport const formatText = (text: string) => {\n return text.replace(/\\n/g, '
').replace(/ /g, ' ')\n}","import { computed, Ref } from 'vue'\nimport { TableCell } from '@/types/slides'\n\n// 计算无效的单元格位置(被合并的单元格位置)集合\n\nexport default (cells: Ref) => {\n const hideCells = computed(() => {\n const hideCells = []\n \n for (let i = 0; i < cells.value.length; i++) {\n const rowCells = cells.value[i]\n\n for (let j = 0; j < rowCells.length; j++) {\n const cell = rowCells[j]\n \n if (cell.colspan > 1 || cell.rowspan > 1) {\n for (let row = i; row < i + cell.rowspan; row++) {\n for (let col = row === i ? j + 1 : j; col < j + cell.colspan; col++) {\n hideCells.push(`${row}_${col}`)\n }\n }\n }\n }\n }\n return hideCells\n })\n\n return {\n hideCells,\n }\n}","import { ref, Ref, watch } from 'vue'\nimport { TableTheme } from '@/types/slides'\nimport { getTableSubThemeColor } from '@/utils/element'\n\n// 通过表格的主题色计算辅助颜色\n\nexport default (theme: Ref) => {\n const subThemeColor = ref(['', ''])\n watch(() => theme.value, () => {\n if (theme.value) {\n subThemeColor.value = getTableSubThemeColor(theme.value.color)\n }\n }, { immediate: true })\n\n return {\n subThemeColor,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-cdb58a1e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"innerHTML\"]\n\nimport { onUnmounted, ref, watch } from 'vue'\nimport { pasteCustomClipboardString, pasteExcelClipboardString } from '@/utils/clipboard'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'CustomTextarea',\n props: {\n value: {\n type: String,\n default: '',\n },\n contenteditable: {\n type: [Boolean, String],\n default: false,\n },\n},\n emits: [\"updateValue\", \"insertExcelData\"],\n setup(__props, { emit }: { emit: ({\n (event: 'updateValue', payload: string): void\n (event: 'insertExcelData', payload: string[][]): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst textareaRef = ref()\nconst text = ref('')\nconst isFocus = ref(false)\n\n// 自定义v-modal,同步数据\n// 当文本框聚焦时,不执行数据同步\nwatch(() => props.value, () => {\n if (isFocus.value) return\n text.value = props.value\n if (textareaRef.value) textareaRef.value.innerHTML = props.value\n}, { immediate: true })\n\nconst handleInput = () => {\n if (!textareaRef.value) return\n const text = textareaRef.value.innerHTML\n emit('updateValue', text)\n}\n\n// 聚焦时更新焦点标记,并监听粘贴事件\nconst handleFocus = () => {\n isFocus.value = true\n\n if (!textareaRef.value) return\n textareaRef.value.onpaste = (e: ClipboardEvent) => {\n e.preventDefault()\n if (!e.clipboardData) return\n\n const clipboardDataFirstItem = e.clipboardData.items[0]\n\n if (clipboardDataFirstItem && clipboardDataFirstItem.kind === 'string' && clipboardDataFirstItem.type === 'text/plain') {\n clipboardDataFirstItem.getAsString(text => {\n const clipboardData = pasteCustomClipboardString(text)\n if (typeof clipboardData === 'object') return\n \n const excelData = pasteExcelClipboardString(text)\n if (excelData) {\n emit('insertExcelData', excelData)\n if (textareaRef.value) textareaRef.value.innerHTML = excelData[0][0]\n return\n }\n\n emit('updateValue', text)\n document.execCommand('insertText', false, text)\n })\n }\n }\n}\n\n// 失焦时更新焦点标记,清除粘贴事件监听\nconst handleBlur = () => {\n isFocus.value = false\n if (textareaRef.value) textareaRef.value.onpaste = null\n}\n\n// 清除粘贴事件监听\nonUnmounted(() => {\n if (textareaRef.value) textareaRef.value.onpaste = null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"custom-textarea\",\n ref_key: \"textareaRef\",\n ref: textareaRef,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onInput: _cache[0] || (_cache[0] = ($event: any) => (handleInput())),\n innerHTML: text.value\n }, null, 40, _hoisted_1))\n}\n}\n\n})","import script from \"./CustomTextarea.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./CustomTextarea.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./CustomTextarea.vue?vue&type=style&index=0&id=cdb58a1e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-cdb58a1e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, createBlock as _createBlock, vShow as _vShow, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-bae8c794\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 0,\n class: \"handler\"\n}\nconst _hoisted_2 = [\"onMousedown\"]\nconst _hoisted_3 = [\"width\"]\nconst _hoisted_4 = [\"rowspan\", \"colspan\", \"data-cell-index\", \"onMousedown\", \"onMouseenter\"]\nconst _hoisted_5 = [\"innerHTML\"]\n\nimport { computed, nextTick, onMounted, onUnmounted, PropType, ref, watch } from 'vue'\nimport { debounce, isEqual } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useMainStore } from '@/store'\nimport { PPTElementOutline, TableCell, TableTheme } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport { KEYS } from '@/configs/hotkey'\nimport { getTextStyle, formatText } from './utils'\nimport useHideCells from './useHideCells'\nimport useSubThemeColor from './useSubThemeColor'\n\nimport CustomTextarea from './CustomTextarea.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'EditableTable',\n props: {\n data: {\n type: Array as PropType,\n required: true,\n },\n width: {\n type: Number,\n required: true,\n },\n colWidths: {\n type: Array as PropType,\n required: true,\n },\n outline: {\n type: Object as PropType,\n required: true,\n },\n theme: {\n type: Object as PropType,\n },\n editable: {\n type: Boolean,\n default: true,\n },\n},\n emits: [\"change\", \"changeColWidths\", \"changeSelectedCells\"],\n setup(__props, { emit }: { emit: ({\n (event: 'change', payload: TableCell[][]): void\n (event: 'changeColWidths', payload: number[]): void\n (event: 'changeSelectedCells', payload: string[]): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n \nconst isStartSelect = ref(false)\nconst startCell = ref([])\nconst endCell = ref([])\n\nconst tableCells = computed({\n get() {\n return props.data\n },\n set(newData) {\n emit('change', newData)\n },\n})\n\n// 主题辅助色\nconst theme = computed(() => props.theme)\nconst { subThemeColor } = useSubThemeColor(theme)\n\n// 计算表格每一列的列宽和总宽度\nconst colSizeList = ref([])\nconst totalWidth = computed(() => colSizeList.value.reduce((a, b) => a + b))\nwatch([\n () => props.colWidths,\n () => props.width,\n], () => {\n colSizeList.value = props.colWidths.map(item => item * props.width)\n}, { immediate: true })\n\n// 清除全部单元格的选中状态\n// 表格处于不可编辑状态时也需要清除\nconst removeSelectedCells = () => {\n startCell.value = []\n endCell.value = []\n}\n\nwatch(() => props.editable, () => {\n if (!props.editable) removeSelectedCells()\n})\n\n// 用于拖拽列宽的操作节点位置\nconst dragLinePosition = computed(() => {\n const dragLinePosition: number[] = []\n for (let i = 1; i < colSizeList.value.length + 1; i++) {\n const pos = colSizeList.value.slice(0, i).reduce((a, b) => (a + b))\n dragLinePosition.push(pos)\n }\n return dragLinePosition\n})\n\n// 无效的单元格位置(被合并的单元格位置)集合\nconst cells = computed(() => props.data)\nconst { hideCells } = useHideCells(cells)\n\n// 当前选中的单元格集合\nconst selectedCells = computed(() => {\n if (!startCell.value.length) return []\n const [startX, startY] = startCell.value\n\n if (!endCell.value.length) return [`${startX}_${startY}`]\n const [endX, endY] = endCell.value\n\n if (startX === endX && startY === endY) return [`${startX}_${startY}`]\n\n const selectedCells = []\n\n const minX = Math.min(startX, endX)\n const minY = Math.min(startY, endY)\n const maxX = Math.max(startX, endX)\n const maxY = Math.max(startY, endY)\n\n for (let i = 0; i < tableCells.value.length; i++) {\n const rowCells = tableCells.value[i]\n for (let j = 0; j < rowCells.length; j++) {\n if (i >= minX && i <= maxX && j >= minY && j <= maxY) selectedCells.push(`${i}_${j}`)\n }\n }\n return selectedCells\n})\n\nwatch(selectedCells, (value, oldValue) => {\n if (isEqual(value, oldValue)) return\n emit('changeSelectedCells', selectedCells.value)\n})\n\n// 当前激活的单元格:当且仅当只有一个选中单元格时,该单元格为激活的单元格\nconst activedCell = computed(() => {\n if (selectedCells.value.length > 1) return null\n return selectedCells.value[0]\n})\n\n// 当前选中的单元格位置范围\nconst selectedRange = computed(() => {\n if (!startCell.value.length) return null\n const [startX, startY] = startCell.value\n\n if (!endCell.value.length) return { row: [startX, startX], col: [startY, startY] }\n const [endX, endY] = endCell.value\n\n if (startX === endX && startY === endY) return { row: [startX, startX], col: [startY, startY] }\n\n const minX = Math.min(startX, endX)\n const minY = Math.min(startY, endY)\n const maxX = Math.max(startX, endX)\n const maxY = Math.max(startY, endY)\n\n return {\n row: [minX, maxX],\n col: [minY, maxY],\n }\n})\n\n// 设置选中单元格状态(鼠标点击或拖选)\nconst handleMouseup = () => isStartSelect.value = false\n\nconst handleCellMousedown = (e: MouseEvent, rowIndex: number, colIndex: number) => {\n if (e.button === 0) {\n endCell.value = []\n isStartSelect.value = true\n startCell.value = [rowIndex, colIndex]\n }\n}\n\nconst handleCellMouseenter = (rowIndex: number, colIndex: number) => {\n if (!isStartSelect.value) return\n endCell.value = [rowIndex, colIndex]\n}\n\nonMounted(() => {\n document.addEventListener('mouseup', handleMouseup)\n})\nonUnmounted(() => {\n document.removeEventListener('mouseup', handleMouseup)\n})\n\n// 判断某位置是否为无效单元格(被合并掉的位置)\nconst isHideCell = (rowIndex: number, colIndex: number) => hideCells.value.includes(`${rowIndex}_${colIndex}`)\n\n// 选中指定的列\nconst selectCol = (index: number) => {\n const maxRow = tableCells.value.length - 1\n startCell.value = [0, index]\n endCell.value = [maxRow, index]\n}\n\n// 选中指定的行\nconst selectRow = (index: number) => {\n const maxCol = tableCells.value[index].length - 1\n startCell.value = [index, 0]\n endCell.value = [index, maxCol]\n}\n\n// 选中全部单元格\nconst selectAll = () => {\n const maxRow = tableCells.value.length - 1\n const maxCol = tableCells.value[maxRow].length - 1\n startCell.value = [0, 0]\n endCell.value = [maxRow, maxCol]\n}\n\n// 删除一行\nconst deleteRow = (rowIndex: number) => {\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n\n const targetCells = tableCells.value[rowIndex]\n const hideCellsPos = []\n for (let i = 0; i < targetCells.length; i++) {\n if (isHideCell(rowIndex, i)) hideCellsPos.push(i)\n }\n \n for (const pos of hideCellsPos) {\n for (let i = rowIndex; i >= 0; i--) {\n if (!isHideCell(i, pos)) {\n _tableCells[i][pos].rowspan = _tableCells[i][pos].rowspan - 1\n break\n }\n }\n }\n\n _tableCells.splice(rowIndex, 1)\n tableCells.value = _tableCells\n}\n\n// 删除一列\nconst deleteCol = (colIndex: number) => {\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n\n const hideCellsPos = []\n for (let i = 0; i < tableCells.value.length; i++) {\n if (isHideCell(i, colIndex)) hideCellsPos.push(i)\n }\n\n for (const pos of hideCellsPos) {\n for (let i = colIndex; i >= 0; i--) {\n if (!isHideCell(pos, i)) {\n _tableCells[pos][i].colspan = _tableCells[pos][i].colspan - 1\n break\n }\n }\n }\n\n tableCells.value = _tableCells.map(item => {\n item.splice(colIndex, 1)\n return item\n })\n colSizeList.value.splice(colIndex, 1)\n emit('changeColWidths', colSizeList.value)\n}\n\n// 插入一行\nconst insertRow = (rowIndex: number) => {\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n\n const rowCells: TableCell[] = []\n for (let i = 0; i < _tableCells[0].length; i++) {\n rowCells.push({\n colspan: 1,\n rowspan: 1,\n text: '',\n id: nanoid(10),\n })\n }\n\n _tableCells.splice(rowIndex, 0, rowCells)\n tableCells.value = _tableCells\n}\n\n// 插入一列\nconst insertCol = (colIndex: number) => {\n tableCells.value = tableCells.value.map(item => {\n const cell = {\n colspan: 1,\n rowspan: 1,\n text: '',\n id: nanoid(10),\n }\n item.splice(colIndex, 0, cell)\n return item\n })\n colSizeList.value.splice(colIndex, 0, 100)\n emit('changeColWidths', colSizeList.value)\n}\n\n// 填充指定的行/列数\nconst fillTable = (rowCount: number, colCount: number) => {\n let _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n const defaultCell = { colspan: 1, rowspan: 1, text: '' }\n \n if (rowCount) {\n const newRows = []\n for (let i = 0; i < rowCount; i++) {\n const rowCells: TableCell[] = []\n for (let j = 0; j < _tableCells[0].length; j++) {\n rowCells.push({\n ...defaultCell,\n id: nanoid(10),\n })\n }\n newRows.push(rowCells)\n }\n _tableCells = [..._tableCells, ...newRows]\n }\n if (colCount) {\n _tableCells = _tableCells.map(item => {\n const cells: TableCell[] = []\n for (let i = 0; i < colCount; i++) {\n const cell = {\n ...defaultCell,\n id: nanoid(10),\n }\n cells.push(cell)\n }\n return [...item, ...cells]\n })\n colSizeList.value = [...colSizeList.value, ...new Array(colCount).fill(100)]\n emit('changeColWidths', colSizeList.value)\n }\n\n tableCells.value = _tableCells\n}\n\n// 合并单元格\nconst mergeCells = () => {\n const [startX, startY] = startCell.value\n const [endX, endY] = endCell.value\n\n const minX = Math.min(startX, endX)\n const minY = Math.min(startY, endY)\n const maxX = Math.max(startX, endX)\n const maxY = Math.max(startY, endY)\n\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n \n _tableCells[minX][minY].rowspan = maxX - minX + 1\n _tableCells[minX][minY].colspan = maxY - minY + 1\n\n tableCells.value = _tableCells\n removeSelectedCells()\n}\n\n// 拆分单元格\nconst splitCells = (rowIndex: number, colIndex: number) => {\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n _tableCells[rowIndex][colIndex].rowspan = 1\n _tableCells[rowIndex][colIndex].colspan = 1\n\n tableCells.value = _tableCells\n removeSelectedCells()\n}\n\n// 鼠标拖拽调整列宽\nconst handleMousedownColHandler = (e: MouseEvent, colIndex: number) => {\n removeSelectedCells()\n let isMouseDown = true\n\n const originWidth = colSizeList.value[colIndex]\n const startPageX = e.pageX\n\n const minWidth = 50\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n \n const moveX = (e.pageX - startPageX) / canvasScale.value\n const width = originWidth + moveX < minWidth ? minWidth : Math.round(originWidth + moveX)\n\n colSizeList.value[colIndex] = width\n }\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n emit('changeColWidths', colSizeList.value)\n }\n}\n\n// 清空选中单元格内的文字\nconst clearSelectedCellText = () => {\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n\n for (let i = 0; i < _tableCells.length; i++) {\n for (let j = 0; j < _tableCells[i].length; j++) {\n if (selectedCells.value.includes(`${i}_${j}`)) {\n _tableCells[i][j].text = ''\n }\n }\n }\n tableCells.value = _tableCells\n}\n\n// 将焦点移动到下一个单元格\n// 当前行右边有单元格时,焦点右移\n// 当前行右边无单元格(已处在行末),且存在下一行时,焦点移动至下一行行首\n// 当前行右边无单元格(已处在行末),且不存在下一行(已处在最后一行)时,新建一行并将焦点移动至下一行行首\nconst tabActiveCell = () => {\n const getNextCell = (i: number, j: number): [number, number] | null => {\n if (!tableCells.value[i]) return null\n if (!tableCells.value[i][j]) return getNextCell(i + 1, 0)\n if (isHideCell(i, j)) return getNextCell(i, j + 1)\n return [i, j]\n }\n\n endCell.value = []\n\n const nextRow = startCell.value[0]\n const nextCol = startCell.value[1] + 1\n\n const nextCell = getNextCell(nextRow, nextCol)\n if (!nextCell) {\n insertRow(nextRow + 1)\n startCell.value = [nextRow + 1, 0]\n }\n else startCell.value = nextCell\n\n // 移动焦点后自动聚焦文本\n nextTick(() => {\n const textRef = document.querySelector('.cell-text.active') as HTMLInputElement\n if (textRef) textRef.focus()\n })\n}\n\n// 表格快捷键监听\nconst keydownListener = (e: KeyboardEvent) => {\n if (!props.editable || !selectedCells.value.length) return\n\n const key = e.key.toUpperCase()\n if (selectedCells.value.length < 2) {\n if (key === KEYS.TAB) {\n e.preventDefault()\n tabActiveCell()\n }\n if (e.ctrlKey && key === KEYS.UP) {\n e.preventDefault()\n const rowIndex = +selectedCells.value[0].split('_')[0]\n insertRow(rowIndex)\n }\n if (e.ctrlKey && key === KEYS.DOWN) {\n e.preventDefault()\n const rowIndex = +selectedCells.value[0].split('_')[0]\n insertRow(rowIndex + 1)\n }\n if (e.ctrlKey && key === KEYS.LEFT) {\n e.preventDefault()\n const colIndex = +selectedCells.value[0].split('_')[1]\n insertCol(colIndex)\n }\n if (e.ctrlKey && key === KEYS.RIGHT) {\n e.preventDefault()\n const colIndex = +selectedCells.value[0].split('_')[1]\n insertCol(colIndex + 1)\n }\n }\n else if (key === KEYS.DELETE) {\n clearSelectedCellText()\n }\n}\n\nonMounted(() => {\n document.addEventListener('keydown', keydownListener)\n})\nonUnmounted(() => {\n document.removeEventListener('keydown', keydownListener)\n})\n\n// 单元格文字输入时更新表格数据\nconst handleInput = debounce(function(value, rowIndex, colIndex) {\n tableCells.value[rowIndex][colIndex].text = value\n emit('change', tableCells.value)\n}, 300, { trailing: true })\n\n// 插入来自Excel的数据,表格的行/列数不够时自动补足\nconst insertExcelData = (data: string[][], rowIndex: number, colIndex: number) => {\n const maxRow = data.length\n const maxCol = data[0].length\n\n let fillRowCount = 0\n let fillColCount = 0\n if (rowIndex + maxRow > tableCells.value.length) fillRowCount = rowIndex + maxRow - tableCells.value.length\n if (colIndex + maxCol > tableCells.value[0].length) fillColCount = colIndex + maxCol - tableCells.value[0].length\n if (fillRowCount || fillColCount) fillTable(fillRowCount, fillColCount)\n\n nextTick(() => {\n for (let i = 0; i < maxRow; i++) {\n for (let j = 0; j < maxCol; j++) {\n if (tableCells.value[rowIndex + i][colIndex + j]) {\n tableCells.value[rowIndex + i][colIndex + j].text = data[i][j]\n }\n }\n }\n emit('change', tableCells.value)\n })\n}\n\n// 获取有效的单元格(排除掉被合并的单元格)\nconst getEffectiveTableCells = () => {\n const effectiveTableCells = []\n\n for (let i = 0; i < tableCells.value.length; i++) {\n const rowCells = tableCells.value[i]\n const _rowCells = []\n for (let j = 0; j < rowCells.length; j++) {\n if (!isHideCell(i, j)) _rowCells.push(rowCells[j])\n }\n if (_rowCells.length) effectiveTableCells.push(_rowCells)\n }\n\n return effectiveTableCells\n}\n\n// 检查是否可以删除行和列:有效的行/列数大于1\nconst checkCanDeleteRowOrCol = () => {\n const effectiveTableCells = getEffectiveTableCells()\n const canDeleteRow = effectiveTableCells.length > 1\n const canDeleteCol = effectiveTableCells[0].length > 1\n\n return { canDeleteRow, canDeleteCol }\n}\n\n// 检查是否可以合并或拆分\n// 必须多选才可以合并\n// 必须单选且所选单元格为合并单元格才可以拆分\nconst checkCanMergeOrSplit = (rowIndex: number, colIndex: number) => {\n const isMultiSelected = selectedCells.value.length > 1\n const targetCell = tableCells.value[rowIndex][colIndex]\n\n const canMerge = isMultiSelected\n const canSplit = !isMultiSelected && (targetCell.rowspan > 1 || targetCell.colspan > 1)\n\n return { canMerge, canSplit }\n}\n\nconst contextmenus = (el: HTMLElement): ContextmenuItem[] => {\n const cellIndex = el.dataset.cellIndex as string\n const rowIndex = +cellIndex.split('_')[0]\n const colIndex = +cellIndex.split('_')[1]\n\n if (!selectedCells.value.includes(`${rowIndex}_${colIndex}`)) {\n startCell.value = [rowIndex, colIndex]\n endCell.value = []\n }\n\n const { canMerge, canSplit } = checkCanMergeOrSplit(rowIndex, colIndex)\n const { canDeleteRow, canDeleteCol } = checkCanDeleteRowOrCol()\n\n return [\n {\n text: '插入列',\n children: [\n { text: '到左侧', handler: () => insertCol(colIndex) },\n { text: '到右侧', handler: () => insertCol(colIndex + 1) },\n ],\n },\n {\n text: '插入行',\n children: [\n { text: '到上方', handler: () => insertRow(rowIndex) },\n { text: '到下方', handler: () => insertRow(rowIndex + 1) },\n ],\n },\n {\n text: '删除列',\n disable: !canDeleteCol,\n handler: () => deleteCol(colIndex),\n },\n {\n text: '删除行',\n disable: !canDeleteRow,\n handler: () => deleteRow(rowIndex),\n },\n { divider: true },\n {\n text: '合并单元格',\n disable: !canMerge,\n handler: mergeCells,\n },\n {\n text: '取消合并单元格',\n disable: !canSplit,\n handler: () => splitCells(rowIndex, colIndex),\n },\n { divider: true },\n {\n text: '选中当前列',\n handler: () => selectCol(colIndex),\n },\n {\n text: '选中当前行',\n handler: () => selectRow(rowIndex),\n },\n {\n text: '选中全部单元格',\n handler: selectAll,\n },\n ]\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"editable-table\",\n style: _normalizeStyle({ width: _unref(totalWidth) + 'px' })\n }, [\n (__props.editable)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(dragLinePosition), (pos, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"drag-line\",\n key: index,\n style: _normalizeStyle({ left: pos + 'px' }),\n onMousedown: $event => handleMousedownColHandler($event, index)\n }, null, 44, _hoisted_2))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"table\", {\n class: _normalizeClass({\n 'theme': _unref(theme),\n 'row-header': _unref(theme)?.rowHeader,\n 'row-footer': _unref(theme)?.rowFooter,\n 'col-header': _unref(theme)?.colHeader,\n 'col-footer': _unref(theme)?.colFooter,\n }),\n style: _normalizeStyle(`--themeColor: ${_unref(theme)?.color}; --subThemeColor1: ${_unref(subThemeColor)[0]}; --subThemeColor2: ${_unref(subThemeColor)[1]}`)\n }, [\n _createElementVNode(\"colgroup\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(colSizeList.value, (width, index) => {\n return (_openBlock(), _createElementBlock(\"col\", {\n span: \"1\",\n key: index,\n width: width\n }, null, 8, _hoisted_3))\n }), 128))\n ]),\n _createElementVNode(\"tbody\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(tableCells), (rowCells, rowIndex) => {\n return (_openBlock(), _createElementBlock(\"tr\", { key: rowIndex }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(rowCells, (cell, colIndex) => {\n return _withDirectives((_openBlock(), _createElementBlock(\"td\", {\n class: _normalizeClass([\"cell\", {\n 'selected': _unref(selectedCells).includes(`${rowIndex}_${colIndex}`) && _unref(selectedCells).length > 1,\n 'active': _unref(activedCell) === `${rowIndex}_${colIndex}`,\n }]),\n style: _normalizeStyle({\n borderStyle: __props.outline.style,\n borderColor: __props.outline.color,\n borderWidth: __props.outline.width + 'px',\n ..._unref(getTextStyle)(cell.style),\n }),\n key: cell.id,\n rowspan: cell.rowspan,\n colspan: cell.colspan,\n \"data-cell-index\": `${rowIndex}_${colIndex}`,\n onMousedown: $event => handleCellMousedown($event, rowIndex, colIndex),\n onMouseenter: ($event: any) => (handleCellMouseenter(rowIndex, colIndex))\n }, [\n (_unref(activedCell) === `${rowIndex}_${colIndex}`)\n ? (_openBlock(), _createBlock(CustomTextarea, {\n key: 0,\n class: _normalizeClass([\"cell-text\", { 'active': _unref(activedCell) === `${rowIndex}_${colIndex}` }]),\n value: cell.text,\n onUpdateValue: value => _unref(handleInput)(value, rowIndex, colIndex),\n onInsertExcelData: value => insertExcelData(value, rowIndex, colIndex)\n }, null, 8, [\"class\", \"value\", \"onUpdateValue\", \"onInsertExcelData\"]))\n : (_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: \"cell-text\",\n innerHTML: _unref(formatText)(cell.text)\n }, null, 8, _hoisted_5))\n ], 46, _hoisted_4)), [\n [_vShow, !_unref(hideCells).includes(`${rowIndex}_${colIndex}`)],\n [_directive_contextmenu, (el) => contextmenus(el)]\n ])\n }), 128))\n ]))\n }), 128))\n ])\n ], 6)\n ], 4))\n}\n}\n\n})","import script from \"./EditableTable.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./EditableTable.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./EditableTable.vue?vue&type=style&index=0&id=bae8c794&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-bae8c794\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { withModifiers as _withModifiers, createVNode as _createVNode, unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-6391c486\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\n\nimport { nextTick, onMounted, onUnmounted, PropType, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTTableElement, TableCell } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport EditableTable from './EditableTable.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTTableElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { canvasScale, handleElementId, isScaling } = storeToRefs(mainStore)\n\nconst elementRef = ref()\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo)\n}\n\n// 更新表格的可编辑状态,表格处于编辑状态时需要禁用全局快捷键\nconst editable = ref(false)\n\nwatch(handleElementId, () => {\n if (handleElementId.value !== props.elementInfo.id) editable.value = false\n})\n\nwatch(editable, () => {\n mainStore.setDisableHotkeysState(editable.value)\n})\n\nconst startEdit = () => {\n if (!props.elementInfo.lock) editable.value = true\n}\n\n// 监听表格元素的尺寸变化,当高度变化时,更新高度到vuex\n// 如果高度变化时正处在缩放操作中,则等待缩放操作结束后再更新\nconst realHeightCache = ref(-1)\n\nwatch(isScaling, () => {\n if (handleElementId.value !== props.elementInfo.id) return\n\n if (isScaling.value) editable.value = false\n\n if (!isScaling.value && realHeightCache.value !== -1) {\n slidesStore.updateElement({\n id: props.elementInfo.id,\n props: { height: realHeightCache.value },\n })\n realHeightCache.value = -1\n }\n})\n\nconst updateTableElementHeight = (entries: ResizeObserverEntry[]) => {\n const contentRect = entries[0].contentRect\n if (!elementRef.value) return\n\n const realHeight = contentRect.height\n\n if (props.elementInfo.height !== realHeight) {\n if (!isScaling.value) {\n slidesStore.updateElement({\n id: props.elementInfo.id,\n props: { height: realHeight },\n })\n }\n else realHeightCache.value = realHeight\n }\n}\n\nconst resizeObserver = new ResizeObserver(updateTableElementHeight)\n\nonMounted(() => {\n if (elementRef.value) resizeObserver.observe(elementRef.value)\n})\nonUnmounted(() => {\n if (elementRef.value) resizeObserver.unobserve(elementRef.value)\n})\n\n// 更新表格内容数据\nconst updateTableCells = (data: TableCell[][]) => {\n slidesStore.updateElement({\n id: props.elementInfo.id, \n props: { data },\n })\n addHistorySnapshot()\n}\n\n// 更新表格的列宽数据\nconst updateColWidths = (widths: number[]) => {\n const width = widths.reduce((a, b) => a + b)\n const colWidths = widths.map(item => item / width)\n\n slidesStore.updateElement({\n id: props.elementInfo.id, \n props: { width, colWidths },\n })\n addHistorySnapshot()\n}\n\n// 更新表格当前选中的单元格\nconst updateSelectedCells = (cells: string[]) => {\n nextTick(() => mainStore.setSelectedTableCells(cells))\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-table\", { 'lock': __props.elementInfo.lock }]),\n ref_key: \"elementRef\",\n ref: elementRef,\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(EditableTable, {\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(() => {}, [\"stop\"])),\n data: __props.elementInfo.data,\n width: __props.elementInfo.width,\n colWidths: __props.elementInfo.colWidths,\n outline: __props.elementInfo.outline,\n theme: __props.elementInfo.theme,\n editable: editable.value,\n onChange: _cache[1] || (_cache[1] = data => updateTableCells(data)),\n onChangeColWidths: _cache[2] || (_cache[2] = widths => updateColWidths(widths)),\n onChangeSelectedCells: _cache[3] || (_cache[3] = cells => updateSelectedCells(cells))\n }, null, 8, [\"data\", \"width\", \"colWidths\", \"outline\", \"theme\", \"editable\"]),\n (!editable.value || __props.elementInfo.lock)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: _normalizeClass([\"table-mask\", { 'lock': __props.elementInfo.lock }]),\n onDblclick: _cache[4] || (_cache[4] = ($event: any) => (startEdit())),\n onMousedown: _cache[5] || (_cache[5] = $event => handleSelectElement($event)),\n onTouchstart: _cache[6] || (_cache[6] = $event => handleSelectElement($event))\n }, [\n _createElementVNode(\"div\", {\n class: \"mask-tip\",\n style: _normalizeStyle({ transform: `scale(${ 1 / _unref(canvasScale) })` })\n }, \"双击编辑\", 4)\n ], 34))\n : _createCommentVNode(\"\", true)\n ])), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=6391c486&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6391c486\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveDirective as _resolveDirective, withDirectives as _withDirectives, normalizeStyle as _normalizeStyle, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-31390388\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\", \"stroke\", \"stroke-width\"]\nconst _hoisted_2 = [\"transform\"]\nconst _hoisted_3 = [\"d\"]\n\nimport { PropType } from 'vue'\nimport { PPTLatexElement } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTLatexElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo)\n}\n\nconst openLatexEditor = () => {\n emitter.emit(EmitterEvents.OPEN_LATEX_EDITOR)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-latex\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n onMousedown: _cache[0] || (_cache[0] = $event => handleSelectElement($event)),\n onTouchstart: _cache[1] || (_cache[1] = $event => handleSelectElement($event)),\n onDblclick: _cache[2] || (_cache[2] = ($event: any) => (openLatexEditor()))\n }, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n stroke: __props.elementInfo.color,\n \"stroke-width\": __props.elementInfo.strokeWidth,\n fill: \"none\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }, [\n _createElementVNode(\"g\", {\n transform: `scale(${__props.elementInfo.width / __props.elementInfo.viewBox[0]}, ${__props.elementInfo.height / __props.elementInfo.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`\n }, [\n _createElementVNode(\"path\", {\n d: __props.elementInfo.path\n }, null, 8, _hoisted_3)\n ], 8, _hoisted_2)\n ], 8, _hoisted_1))\n ], 32)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=31390388&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-31390388\"]])\n\nexport default __exports__","/* eslint-disable */\n\nimport { onMounted, Ref } from 'vue'\n\nexport default (\n src: string,\n videoRef: Ref,\n) => {\n onMounted(() => {\n if (!videoRef.value) return\n\n let type = 'normal'\n if (/m3u8(#|\\?|$)/i.exec(src)) type = 'hls'\n else if (/.flv(#|\\?|$)/i.exec(src)) type = 'flv'\n\n if (videoRef.value && type === 'hls' && (videoRef.value.canPlayType('application/x-mpegURL') || videoRef.value.canPlayType('application/vnd.apple.mpegURL'))) {\n type = 'normal'\n }\n\n if (type === 'hls') {\n const Hls = (window as any).Hls\n \n if (Hls && Hls.isSupported()) {\n const hls = new Hls()\n hls.loadSource(src)\n hls.attachMedia(videoRef.value)\n }\n }\n else if (type === 'flv') {\n const flvjs = (window as any).flvjs\n if (flvjs && flvjs.isSupported()) {\n const flvPlayer = flvjs.createPlayer({\n type: 'flv',\n url: src,\n })\n flvPlayer.attachMediaElement(videoRef.value)\n flvPlayer.load()\n }\n }\n })\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, unref as _unref, normalizeStyle as _normalizeStyle, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-2fc4c202\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"src\", \"poster\"]\nconst _hoisted_2 = { class: \"bezel\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"controller-mask\" }, null, -1))\nconst _hoisted_4 = { class: \"controller\" }\nconst _hoisted_5 = { class: \"icons icons-left\" }\nconst _hoisted_6 = { class: \"icon-content\" }\nconst _hoisted_7 = { class: \"volume\" }\nconst _hoisted_8 = { class: \"icon-content\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"thumb\" }, null, -1))\nconst _hoisted_10 = [\n _hoisted_9\n]\nconst _hoisted_11 = { class: \"time\" }\nconst _hoisted_12 = { class: \"ptime\" }\nconst _hoisted_13 = /*#__PURE__*/_createTextVNode(\" / \")\nconst _hoisted_14 = { class: \"dtime\" }\nconst _hoisted_15 = { class: \"icons icons-right\" }\nconst _hoisted_16 = { class: \"speed\" }\nconst _hoisted_17 = { class: \"icon speed-icon\" }\nconst _hoisted_18 = [\"onClick\"]\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"icon-content\" }, \"循环\", -1))\nconst _hoisted_20 = [\n _hoisted_19\n]\nconst _hoisted_21 = { class: \"bar\" }\nconst _hoisted_22 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"thumb\" }, null, -1))\nconst _hoisted_23 = [\n _hoisted_22\n]\n\nimport { computed, ref } from 'vue'\nimport useMSE from './useMSE'\nimport { message } from 'ant-design-vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n src: {\n type: String,\n required: true,\n },\n poster: {\n type: String,\n default: '',\n },\n scale: {\n type: Number,\n default: 1,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst secondToTime = (second = 0) => {\n if (second === 0 || isNaN(second)) return '00:00'\n\n const add0 = (num: number) => (num < 10 ? '0' + num : '' + num)\n const hour = Math.floor(second / 3600)\n const min = Math.floor((second - hour * 3600) / 60)\n const sec = Math.floor(second - hour * 3600 - min * 60)\n return (hour > 0 ? [hour, min, sec] : [min, sec]).map(add0).join(':')\n}\n\nconst getBoundingClientRectViewLeft = (element: HTMLElement) => {\n return element.getBoundingClientRect().left\n}\n\nconst videoRef = ref()\nconst playBarWrap = ref()\nconst volumeBarRef = ref()\n\nconst volume = ref(0.5)\nconst paused = ref(true)\nconst currentTime = ref(0)\nconst duration = ref(0)\nconst loaded = ref(0)\nconst loop = ref(false)\nconst bezelTransition = ref(false)\nconst playbackRate = ref(1)\n\nconst playBarTimeVisible = ref(false)\nconst playBarTime = ref('00:00')\nconst playBarTimeLeft = ref('0')\n\nconst ptime = computed(() => secondToTime(currentTime.value))\nconst dtime = computed(() => secondToTime(duration.value))\nconst playedBarWidth = computed(() => currentTime.value / duration.value * 100 + '%')\nconst loadedBarWidth = computed(() => loaded.value / duration.value * 100 + '%')\nconst volumeBarWidth = computed(() => volume.value * 100 + '%')\n\nconst speedMenuVisible = ref(false)\nconst speedOptions = [\n { label: '2x', value: 2 },\n { label: '1.5x', value: 1.5 },\n { label: '1.25x', value: 1.25 },\n { label: '1x', value: 1 },\n { label: '0.75x', value: 0.75 },\n { label: '0.5x', value: 0.5 },\n]\n\nconst seek = (time: number) => {\n if (!videoRef.value) return\n\n time = Math.max(time, 0)\n time = Math.min(time, duration.value)\n\n videoRef.value.currentTime = time\n currentTime.value = time\n}\n\nconst play = () => {\n if (!videoRef.value) return\n\n paused.value = false\n videoRef.value.play()\n bezelTransition.value = true\n}\n\nconst pause = () => {\n if (!videoRef.value) return\n\n paused.value = true\n videoRef.value.pause()\n bezelTransition.value = true\n}\n\nconst toggle = () => {\n if (paused.value) play() \n else pause()\n}\n\nconst setVolume = (percentage: number) => {\n if (!videoRef.value) return\n\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n\n videoRef.value.volume = percentage\n volume.value = percentage\n if (videoRef.value.muted && percentage !== 0) videoRef.value.muted = false\n}\n\nconst speed = (rate: number) => {\n if (videoRef.value) videoRef.value.playbackRate = rate\n playbackRate.value = rate\n}\n\nconst handleDurationchange = () => {\n duration.value = videoRef.value?.duration || 0\n}\n\nconst handleTimeupdate = () => {\n currentTime.value = videoRef.value?.currentTime || 0\n}\n\nconst handleEnded = () => {\n if (!loop.value) pause()\n else {\n seek(0)\n play()\n }\n}\n\nconst handleProgress = () => {\n loaded.value = videoRef.value?.buffered.length ? videoRef.value.buffered.end(videoRef.value.buffered.length - 1) : 0\n}\n\nconst handleError = () => message.error('视频加载失败')\n\nconst thumbMove = (e: MouseEvent | TouchEvent) => {\n if (!videoRef.value || !playBarWrap.value) return\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n let percentage = (clientX - getBoundingClientRectViewLeft(playBarWrap.value)) / playBarWrap.value.clientWidth\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n const time = percentage * duration.value\n\n videoRef.value.currentTime = time\n currentTime.value = time\n}\n\nconst thumbUp = (e: MouseEvent | TouchEvent) => {\n if (!videoRef.value || !playBarWrap.value) return\n\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n let percentage = (clientX - getBoundingClientRectViewLeft(playBarWrap.value)) / playBarWrap.value.clientWidth\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n const time = percentage * duration.value\n\n videoRef.value.currentTime = time\n currentTime.value = time\n\n document.removeEventListener('mousemove', thumbMove)\n document.removeEventListener('touchmove', thumbMove)\n document.removeEventListener('mouseup', thumbUp)\n document.removeEventListener('touchend', thumbUp)\n}\n\nconst handleMousedownPlayBar = () => {\n document.addEventListener('mousemove', thumbMove)\n document.addEventListener('touchmove', thumbMove)\n document.addEventListener('mouseup', thumbUp)\n document.addEventListener('touchend', thumbUp)\n}\n\nconst volumeMove = (e: MouseEvent | TouchEvent) => {\n if (!volumeBarRef.value) return\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n const percentage = (clientX - getBoundingClientRectViewLeft(volumeBarRef.value)) / 45\n setVolume(percentage)\n}\n\nconst volumeUp = () => {\n document.removeEventListener('mousemove', volumeMove)\n document.removeEventListener('touchmove', volumeMove)\n document.removeEventListener('mouseup', volumeUp)\n document.removeEventListener('touchend', volumeUp)\n}\n\nconst handleMousedownVolumeBar = () => {\n document.addEventListener('mousemove', volumeMove)\n document.addEventListener('touchmove', volumeMove)\n document.addEventListener('mouseup', volumeUp)\n document.addEventListener('touchend', volumeUp)\n}\n\nconst handleClickVolumeBar = (e: MouseEvent) => {\n if (!volumeBarRef.value) return\n const percentage = (e.clientX - getBoundingClientRectViewLeft(volumeBarRef.value)) / 45\n setVolume(percentage)\n}\n\nconst handleMousemovePlayBar = (e: MouseEvent) => {\n if (duration.value && playBarWrap.value) {\n const px = playBarWrap.value.getBoundingClientRect().left\n const tx = e.clientX - px\n if (tx < 0 || tx > playBarWrap.value.offsetWidth) return\n\n const time = duration.value * (tx / playBarWrap.value.offsetWidth)\n playBarTimeLeft.value = `${tx - (time >= 3600 ? 25 : 20)}px`\n playBarTime.value = secondToTime(time)\n playBarTimeVisible.value = true\n }\n}\n\nconst toggleVolume = () => {\n if (!videoRef.value) return\n\n if (videoRef.value.muted) {\n videoRef.value.muted = false\n setVolume(0.5)\n }\n else {\n videoRef.value.muted = true\n setVolume(0)\n }\n}\n\nconst toggleLoop = () => {\n loop.value = !loop.value\n}\n\nconst autoHideControllerTimer = ref(-1)\nconst hideController = ref(false)\nconst autoHideController = () => {\n hideController.value = false\n clearTimeout(autoHideControllerTimer.value)\n autoHideControllerTimer.value = setTimeout(() => {\n if (videoRef.value?.played.length) hideController.value = true\n }, 3000)\n}\n\nuseMSE(props.src, videoRef)\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPause = _resolveComponent(\"IconPause\")!\n const _component_IconPlayOne = _resolveComponent(\"IconPlayOne\")!\n const _component_IconVolumeMute = _resolveComponent(\"IconVolumeMute\")!\n const _component_IconVolumeNotice = _resolveComponent(\"IconVolumeNotice\")!\n const _component_IconVolumeSmall = _resolveComponent(\"IconVolumeSmall\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"video-player\", { 'hide-controller': hideController.value }]),\n style: _normalizeStyle({\n width: __props.width * __props.scale + 'px',\n height: __props.height * __props.scale + 'px',\n transform: `scale(${1 / __props.scale})`,\n }),\n onMousemove: _cache[22] || (_cache[22] = ($event: any) => (autoHideController())),\n onClick: _cache[23] || (_cache[23] = ($event: any) => (autoHideController()))\n }, [\n _createElementVNode(\"div\", {\n class: \"video-wrap\",\n onClick: _cache[8] || (_cache[8] = ($event: any) => (toggle()))\n }, [\n _createElementVNode(\"video\", {\n class: \"video\",\n ref_key: \"videoRef\",\n ref: videoRef,\n src: __props.src,\n poster: __props.poster,\n \"webkit-playsinline\": \"\",\n playsinline: \"\",\n onDurationchange: _cache[0] || (_cache[0] = ($event: any) => (handleDurationchange())),\n onTimeupdate: _cache[1] || (_cache[1] = ($event: any) => (handleTimeupdate())),\n onEnded: _cache[2] || (_cache[2] = ($event: any) => (handleEnded())),\n onProgress: _cache[3] || (_cache[3] = ($event: any) => (handleProgress())),\n onPlay: _cache[4] || (_cache[4] = ($event: any) => (autoHideController())),\n onPause: _cache[5] || (_cache[5] = ($event: any) => (autoHideController())),\n onError: _cache[6] || (_cache[6] = ($event: any) => (handleError()))\n }, null, 40, _hoisted_1),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"span\", {\n class: _normalizeClass([\"bezel-icon\", { 'bezel-transition': bezelTransition.value }]),\n onAnimationend: _cache[7] || (_cache[7] = ($event: any) => (bezelTransition.value = false))\n }, [\n (paused.value)\n ? (_openBlock(), _createBlock(_component_IconPause, { key: 0 }))\n : (_openBlock(), _createBlock(_component_IconPlayOne, { key: 1 }))\n ], 34)\n ])\n ]),\n _hoisted_3,\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", {\n class: \"icon play-icon\",\n onClick: _cache[9] || (_cache[9] = ($event: any) => (toggle()))\n }, [\n _createElementVNode(\"span\", _hoisted_6, [\n (paused.value)\n ? (_openBlock(), _createBlock(_component_IconPlayOne, { key: 0 }))\n : (_openBlock(), _createBlock(_component_IconPause, { key: 1 }))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"div\", {\n class: \"icon volume-icon\",\n onClick: _cache[10] || (_cache[10] = ($event: any) => (toggleVolume()))\n }, [\n _createElementVNode(\"span\", _hoisted_8, [\n (volume.value === 0)\n ? (_openBlock(), _createBlock(_component_IconVolumeMute, { key: 0 }))\n : (volume.value === 1)\n ? (_openBlock(), _createBlock(_component_IconVolumeNotice, { key: 1 }))\n : (_openBlock(), _createBlock(_component_IconVolumeSmall, { key: 2 }))\n ])\n ]),\n _createElementVNode(\"div\", {\n class: \"volume-bar-wrap\",\n onMousedown: _cache[11] || (_cache[11] = ($event: any) => (handleMousedownVolumeBar())),\n onTouchstart: _cache[12] || (_cache[12] = ($event: any) => (handleMousedownVolumeBar())),\n onClick: _cache[13] || (_cache[13] = $event => handleClickVolumeBar($event))\n }, [\n _createElementVNode(\"div\", {\n class: \"volume-bar\",\n ref_key: \"volumeBarRef\",\n ref: volumeBarRef\n }, [\n _createElementVNode(\"div\", {\n class: \"volume-bar-inner\",\n style: _normalizeStyle({ width: _unref(volumeBarWidth) })\n }, _hoisted_10, 4)\n ], 512)\n ], 32)\n ]),\n _createElementVNode(\"span\", _hoisted_11, [\n _createElementVNode(\"span\", _hoisted_12, _toDisplayString(_unref(ptime)), 1),\n _hoisted_13,\n _createElementVNode(\"span\", _hoisted_14, _toDisplayString(_unref(dtime)), 1)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_15, [\n _createElementVNode(\"div\", _hoisted_16, [\n _createElementVNode(\"div\", _hoisted_17, [\n _createElementVNode(\"span\", {\n class: \"icon-content\",\n onClick: _cache[14] || (_cache[14] = ($event: any) => (speedMenuVisible.value = !speedMenuVisible.value))\n }, \"倍速\"),\n (speedMenuVisible.value)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"speed-menu\",\n onMouseleave: _cache[15] || (_cache[15] = ($event: any) => (speedMenuVisible.value = false))\n }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(speedOptions, (item) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"speed-menu-item\", { 'active': item.value === playbackRate.value }]),\n key: item.label,\n onClick: ($event: any) => (speed(item.value))\n }, _toDisplayString(item.label), 11, _hoisted_18)\n }), 64))\n ], 32))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createElementVNode(\"div\", {\n class: \"loop\",\n onClick: _cache[16] || (_cache[16] = ($event: any) => (toggleLoop()))\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"icon loop-icon\", { 'active': loop.value }])\n }, _hoisted_20, 2)\n ])\n ]),\n _createElementVNode(\"div\", {\n class: \"bar-wrap\",\n ref_key: \"playBarWrap\",\n ref: playBarWrap,\n onMousedown: _cache[17] || (_cache[17] = ($event: any) => (handleMousedownPlayBar())),\n onTouchstart: _cache[18] || (_cache[18] = ($event: any) => (handleMousedownPlayBar())),\n onMousemove: _cache[19] || (_cache[19] = $event => handleMousemovePlayBar($event)),\n onMouseenter: _cache[20] || (_cache[20] = ($event: any) => (playBarTimeVisible.value = true)),\n onMouseleave: _cache[21] || (_cache[21] = ($event: any) => (playBarTimeVisible.value = false))\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"bar-time\", { 'hidden': !playBarTimeVisible.value }]),\n style: _normalizeStyle({ left: playBarTimeLeft.value })\n }, _toDisplayString(playBarTime.value), 7),\n _createElementVNode(\"div\", _hoisted_21, [\n _createElementVNode(\"div\", {\n class: \"loaded\",\n style: _normalizeStyle({ width: _unref(loadedBarWidth) })\n }, null, 4),\n _createElementVNode(\"div\", {\n class: \"played\",\n style: _normalizeStyle({ width: _unref(playedBarWidth) })\n }, _hoisted_23, 4)\n ])\n ], 544)\n ])\n ], 38))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=2fc4c202&scoped=true&lang=scss\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-2fc4c202\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, normalizeStyle as _normalizeStyle } from \"vue\"\n\nimport { PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTVideoElement } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\n\nimport VideoPlayer from './VideoPlayer/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTVideoElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent, canMove = true) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo, canMove)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-video\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n onMousedown: _cache[2] || (_cache[2] = $event => handleSelectElement($event, false)),\n onTouchstart: _cache[3] || (_cache[3] = $event => handleSelectElement($event, false))\n }, [\n _createVNode(VideoPlayer, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n src: __props.elementInfo.src,\n poster: __props.elementInfo.poster,\n scale: _unref(canvasScale)\n }, null, 8, [\"width\", \"height\", \"src\", \"poster\", \"scale\"]),\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(['t', 'b', 'l', 'r'], (item) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass(['handler-border', item]),\n key: item,\n onMousedown: _cache[0] || (_cache[0] = $event => handleSelectElement($event)),\n onTouchstart: _cache[1] || (_cache[1] = $event => handleSelectElement($event))\n }, null, 34)\n }), 64))\n ], 32)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=9d5469c6&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-9d5469c6\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, unref as _unref, normalizeStyle as _normalizeStyle, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-121f3d11\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"src\", \"autoplay\"]\nconst _hoisted_2 = { class: \"controller\" }\nconst _hoisted_3 = { class: \"icons\" }\nconst _hoisted_4 = { class: \"icon-content\" }\nconst _hoisted_5 = { class: \"volume\" }\nconst _hoisted_6 = { class: \"icon-content\" }\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"thumb\" }, null, -1))\nconst _hoisted_8 = [\n _hoisted_7\n]\nconst _hoisted_9 = { class: \"time\" }\nconst _hoisted_10 = { class: \"ptime\" }\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\" / \")\nconst _hoisted_12 = { class: \"dtime\" }\nconst _hoisted_13 = { class: \"bar\" }\nconst _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"thumb\" }, null, -1))\nconst _hoisted_15 = [\n _hoisted_14\n]\n\nimport { computed, ref } from 'vue'\nimport { message } from 'ant-design-vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'AudioPlayer',\n props: {\n src: {\n type: String,\n required: true,\n },\n loop: {\n type: Boolean,\n required: true,\n },\n autoplay: {\n type: Boolean,\n default: false,\n },\n scale: {\n type: Number,\n default: 1,\n },\n},\n setup(__props, { expose }) {\n\nconst props = __props\n\n\n\nconst secondToTime = (second = 0) => {\n if (second === 0 || isNaN(second)) return '00:00'\n\n const add0 = (num: number) => (num < 10 ? '0' + num : '' + num)\n const hour = Math.floor(second / 3600)\n const min = Math.floor((second - hour * 3600) / 60)\n const sec = Math.floor(second - hour * 3600 - min * 60)\n return (hour > 0 ? [hour, min, sec] : [min, sec]).map(add0).join(':')\n}\n\nconst getBoundingClientRectViewLeft = (element: HTMLElement) => {\n return element.getBoundingClientRect().left\n}\n\nconst audioRef = ref()\nconst playBarWrap = ref()\nconst volumeBarRef = ref()\n\nconst volume = ref(0.5)\nconst paused = ref(true)\nconst currentTime = ref(0)\nconst duration = ref(0)\nconst loaded = ref(0)\n\nconst playBarTimeVisible = ref(false)\nconst playBarTime = ref('00:00')\nconst playBarTimeLeft = ref('0')\n\nconst ptime = computed(() => secondToTime(currentTime.value))\nconst dtime = computed(() => secondToTime(duration.value))\nconst playedBarWidth = computed(() => currentTime.value / duration.value * 100 + '%')\nconst loadedBarWidth = computed(() => loaded.value / duration.value * 100 + '%')\nconst volumeBarWidth = computed(() => volume.value * 100 + '%')\n\nconst seek = (time: number) => {\n if (!audioRef.value) return\n\n time = Math.max(time, 0)\n time = Math.min(time, duration.value)\n\n audioRef.value.currentTime = time\n currentTime.value = time\n}\n\nconst play = () => {\n if (!audioRef.value) return\n\n paused.value = false\n audioRef.value.play()\n}\n\nconst pause = () => {\n if (!audioRef.value) return\n\n paused.value = true\n audioRef.value.pause()\n}\n\nconst toggle = () => {\n if (paused.value) play() \n else pause()\n}\n\nconst setVolume = (percentage: number) => {\n if (!audioRef.value) return\n\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n\n audioRef.value.volume = percentage\n volume.value = percentage\n if (audioRef.value.muted && percentage !== 0) audioRef.value.muted = false\n}\n\nconst handleDurationchange = () => {\n duration.value = audioRef.value?.duration || 0\n}\n\nconst handleTimeupdate = () => {\n currentTime.value = audioRef.value?.currentTime || 0\n}\n\nconst handlePlayed = () => {\n paused.value = false\n}\n\nconst handleEnded = () => {\n if (!props.loop) pause()\n else {\n seek(0)\n play()\n }\n}\n\nconst handleProgress = () => {\n loaded.value = audioRef.value?.buffered.length ? audioRef.value.buffered.end(audioRef.value.buffered.length - 1) : 0\n}\n\nconst handleError = () => message.error('视频加载失败')\n\nconst thumbMove = (e: MouseEvent | TouchEvent) => {\n if (!audioRef.value || !playBarWrap.value) return\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n let percentage = (clientX - getBoundingClientRectViewLeft(playBarWrap.value)) / playBarWrap.value.clientWidth\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n const time = percentage * duration.value\n\n audioRef.value.currentTime = time\n currentTime.value = time\n}\n\nconst thumbUp = (e: MouseEvent | TouchEvent) => {\n if (!audioRef.value || !playBarWrap.value) return\n\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n let percentage = (clientX - getBoundingClientRectViewLeft(playBarWrap.value)) / playBarWrap.value.clientWidth\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n const time = percentage * duration.value\n\n audioRef.value.currentTime = time\n currentTime.value = time\n\n document.removeEventListener('mousemove', thumbMove)\n document.removeEventListener('touchmove', thumbMove)\n document.removeEventListener('mouseup', thumbUp)\n document.removeEventListener('touchend', thumbUp)\n}\n\nconst handleMousedownPlayBar = () => {\n document.addEventListener('mousemove', thumbMove)\n document.addEventListener('touchmove', thumbMove)\n document.addEventListener('mouseup', thumbUp)\n document.addEventListener('touchend', thumbUp)\n}\n\nconst volumeMove = (e: MouseEvent | TouchEvent) => {\n if (!volumeBarRef.value) return\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n const percentage = (clientX - getBoundingClientRectViewLeft(volumeBarRef.value)) / 45\n setVolume(percentage)\n}\n\nconst volumeUp = () => {\n document.removeEventListener('mousemove', volumeMove)\n document.removeEventListener('touchmove', volumeMove)\n document.removeEventListener('mouseup', volumeUp)\n document.removeEventListener('touchend', volumeUp)\n}\n\nconst handleMousedownVolumeBar = () => {\n document.addEventListener('mousemove', volumeMove)\n document.addEventListener('touchmove', volumeMove)\n document.addEventListener('mouseup', volumeUp)\n document.addEventListener('touchend', volumeUp)\n}\n\nconst handleClickVolumeBar = (e: MouseEvent) => {\n if (!volumeBarRef.value) return\n const percentage = (e.clientX - getBoundingClientRectViewLeft(volumeBarRef.value)) / 45\n setVolume(percentage)\n}\n\nconst handleMousemovePlayBar = (e: MouseEvent) => {\n if (duration.value && playBarWrap.value) {\n const px = playBarWrap.value.getBoundingClientRect().left\n const tx = e.clientX - px\n if (tx < 0 || tx > playBarWrap.value.offsetWidth) return\n\n const time = duration.value * (tx / playBarWrap.value.offsetWidth)\n playBarTimeLeft.value = `${tx - (time >= 3600 ? 25 : 20)}px`\n playBarTime.value = secondToTime(time)\n playBarTimeVisible.value = true\n }\n}\n\nconst toggleVolume = () => {\n if (!audioRef.value) return\n\n if (audioRef.value.muted) {\n audioRef.value.muted = false\n setVolume(0.5)\n }\n else {\n audioRef.value.muted = true\n setVolume(0)\n }\n}\n\nexpose({\n toggle,\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlayOne = _resolveComponent(\"IconPlayOne\")!\n const _component_IconPause = _resolveComponent(\"IconPause\")!\n const _component_IconVolumeMute = _resolveComponent(\"IconVolumeMute\")!\n const _component_IconVolumeNotice = _resolveComponent(\"IconVolumeNotice\")!\n const _component_IconVolumeSmall = _resolveComponent(\"IconVolumeSmall\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"audio-player\",\n style: _normalizeStyle({ transform: `scale(${1 / __props.scale})` })\n }, [\n _createElementVNode(\"audio\", {\n class: \"audio\",\n ref_key: \"audioRef\",\n ref: audioRef,\n src: __props.src,\n autoplay: __props.autoplay,\n onDurationchange: _cache[0] || (_cache[0] = ($event: any) => (handleDurationchange())),\n onTimeupdate: _cache[1] || (_cache[1] = ($event: any) => (handleTimeupdate())),\n onPlay: _cache[2] || (_cache[2] = ($event: any) => (handlePlayed())),\n onEnded: _cache[3] || (_cache[3] = ($event: any) => (handleEnded())),\n onProgress: _cache[4] || (_cache[4] = ($event: any) => (handleProgress())),\n onError: _cache[5] || (_cache[5] = ($event: any) => (handleError()))\n }, null, 40, _hoisted_1),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", {\n class: \"icon play-icon\",\n onClick: _cache[6] || (_cache[6] = ($event: any) => (toggle()))\n }, [\n _createElementVNode(\"span\", _hoisted_4, [\n (paused.value)\n ? (_openBlock(), _createBlock(_component_IconPlayOne, { key: 0 }))\n : (_openBlock(), _createBlock(_component_IconPause, { key: 1 }))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", {\n class: \"icon volume-icon\",\n onClick: _cache[7] || (_cache[7] = ($event: any) => (toggleVolume()))\n }, [\n _createElementVNode(\"span\", _hoisted_6, [\n (volume.value === 0)\n ? (_openBlock(), _createBlock(_component_IconVolumeMute, { key: 0 }))\n : (volume.value === 1)\n ? (_openBlock(), _createBlock(_component_IconVolumeNotice, { key: 1 }))\n : (_openBlock(), _createBlock(_component_IconVolumeSmall, { key: 2 }))\n ])\n ]),\n _createElementVNode(\"div\", {\n class: \"volume-bar-wrap\",\n onMousedown: _cache[8] || (_cache[8] = ($event: any) => (handleMousedownVolumeBar())),\n onTouchstart: _cache[9] || (_cache[9] = ($event: any) => (handleMousedownVolumeBar())),\n onClick: _cache[10] || (_cache[10] = $event => handleClickVolumeBar($event))\n }, [\n _createElementVNode(\"div\", {\n class: \"volume-bar\",\n ref_key: \"volumeBarRef\",\n ref: volumeBarRef\n }, [\n _createElementVNode(\"div\", {\n class: \"volume-bar-inner\",\n style: _normalizeStyle({ width: _unref(volumeBarWidth) })\n }, _hoisted_8, 4)\n ], 512)\n ], 32)\n ])\n ]),\n _createElementVNode(\"span\", _hoisted_9, [\n _createElementVNode(\"span\", _hoisted_10, _toDisplayString(_unref(ptime)), 1),\n _hoisted_11,\n _createElementVNode(\"span\", _hoisted_12, _toDisplayString(_unref(dtime)), 1)\n ]),\n _createElementVNode(\"div\", {\n class: \"bar-wrap\",\n ref_key: \"playBarWrap\",\n ref: playBarWrap,\n onMousedown: _cache[11] || (_cache[11] = ($event: any) => (handleMousedownPlayBar())),\n onTouchstart: _cache[12] || (_cache[12] = ($event: any) => (handleMousedownPlayBar())),\n onMousemove: _cache[13] || (_cache[13] = $event => handleMousemovePlayBar($event)),\n onMouseenter: _cache[14] || (_cache[14] = ($event: any) => (playBarTimeVisible.value = true)),\n onMouseleave: _cache[15] || (_cache[15] = ($event: any) => (playBarTimeVisible.value = false))\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"bar-time\", { 'hidden': !playBarTimeVisible.value }]),\n style: _normalizeStyle({ left: playBarTimeLeft.value })\n }, _toDisplayString(playBarTime.value), 7),\n _createElementVNode(\"div\", _hoisted_13, [\n _createElementVNode(\"div\", {\n class: \"loaded\",\n style: _normalizeStyle({ width: _unref(loadedBarWidth) })\n }, null, 4),\n _createElementVNode(\"div\", {\n class: \"played\",\n style: _normalizeStyle({ width: _unref(playedBarWidth) })\n }, _hoisted_15, 4)\n ])\n ], 544)\n ])\n ], 4))\n}\n}\n\n})","import script from \"./AudioPlayer.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./AudioPlayer.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./AudioPlayer.vue?vue&type=style&index=0&id=121f3d11&scoped=true&lang=scss\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-121f3d11\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, normalizeStyle as _normalizeStyle, createVNode as _createVNode, withModifiers as _withModifiers, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTAudioElement } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\n\nimport AudioPlayer from './AudioPlayer.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTAudioElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale, handleElementId } = storeToRefs(useMainStore())\nconst { viewportRatio } = storeToRefs(useSlidesStore())\n\nconst audioIconSize = computed(() => {\n return Math.min(props.elementInfo.width, props.elementInfo.height) + 'px'\n})\nconst audioPlayerPosition = computed(() => {\n const canvasWidth = VIEWPORT_SIZE\n const canvasHeight = VIEWPORT_SIZE * viewportRatio.value\n\n const audioWidth = 280 / canvasScale.value\n const audioHeight = 50 / canvasScale.value\n\n const elWidth = props.elementInfo.width\n const elHeight = props.elementInfo.height\n const elLeft = props.elementInfo.left\n const elTop = props.elementInfo.top\n\n let left = 0\n let top = elHeight\n \n if (elLeft + audioWidth >= canvasWidth) left = elWidth - audioWidth\n if (elTop + elHeight + audioHeight >= canvasHeight) top = -audioHeight\n\n return {\n left: left + 'px',\n top: top + 'px',\n }\n})\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconVolumeNotice = _resolveComponent(\"IconVolumeNotice\")!\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-audio\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n onMousedown: _cache[1] || (_cache[1] = $event => handleSelectElement($event)),\n onTouchstart: _cache[2] || (_cache[2] = $event => handleSelectElement($event))\n }, [\n _createVNode(_component_IconVolumeNotice, {\n class: \"audio-icon\",\n style: _normalizeStyle({\n fontSize: _unref(audioIconSize),\n color: __props.elementInfo.color,\n })\n }, null, 8, [\"style\"]),\n (_unref(handleElementId) === __props.elementInfo.id)\n ? (_openBlock(), _createBlock(AudioPlayer, {\n key: 0,\n class: \"audio-player\",\n style: _normalizeStyle({ ..._unref(audioPlayerPosition) }),\n src: __props.elementInfo.src,\n loop: __props.elementInfo.loop,\n scale: _unref(canvasScale),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(() => {}, [\"stop\"]))\n }, null, 8, [\"style\", \"src\", \"loop\", \"scale\"]))\n : _createCommentVNode(\"\", true)\n ], 32)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=001bfbc4&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-001bfbc4\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"id\"]\n\nimport { computed, PropType } from 'vue'\nimport { ElementTypes, PPTElement } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\n\nimport useLockElement from '@/hooks/useLockElement'\nimport useDeleteElement from '@/hooks/useDeleteElement'\nimport useCombineElement from '@/hooks/useCombineElement'\nimport useOrderElement from '@/hooks/useOrderElement'\nimport useAlignElementToCanvas from '@/hooks/useAlignElementToCanvas'\nimport useCopyAndPasteElement from '@/hooks/useCopyAndPasteElement'\nimport useSelectAllElement from '@/hooks/useSelectAllElement'\n\nimport { ElementOrderCommands, ElementAlignCommands } from '@/types/edit'\n\nimport ImageElement from '@/views/components/element/ImageElement/index.vue'\nimport TextElement from '@/views/components/element/TextElement/index.vue'\nimport ShapeElement from '@/views/components/element/ShapeElement/index.vue'\nimport LineElement from '@/views/components/element/LineElement/index.vue'\nimport ChartElement from '@/views/components/element/ChartElement/index.vue'\nimport TableElement from '@/views/components/element/TableElement/index.vue'\nimport LatexElement from '@/views/components/element/LatexElement/index.vue'\nimport VideoElement from '@/views/components/element/VideoElement/index.vue'\nimport AudioElement from '@/views/components/element/AudioElement/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'EditableElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n elementIndex: {\n type: Number,\n required: true,\n },\n isMultiSelect: {\n type: Boolean,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTElement, canMove?: boolean) => void>,\n required: true,\n },\n openLinkDialog: {\n type: Function as PropType<() => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst currentElementComponent = computed(() => {\n const elementTypeMap = {\n [ElementTypes.IMAGE]: ImageElement,\n [ElementTypes.TEXT]: TextElement,\n [ElementTypes.SHAPE]: ShapeElement,\n [ElementTypes.LINE]: LineElement,\n [ElementTypes.CHART]: ChartElement,\n [ElementTypes.TABLE]: TableElement,\n [ElementTypes.LATEX]: LatexElement,\n [ElementTypes.VIDEO]: VideoElement,\n [ElementTypes.AUDIO]: AudioElement,\n }\n return elementTypeMap[props.elementInfo.type] || null\n})\n\nconst { orderElement } = useOrderElement()\nconst { alignElementToCanvas } = useAlignElementToCanvas()\nconst { combineElements, uncombineElements } = useCombineElement()\nconst { deleteElement } = useDeleteElement()\nconst { lockElement, unlockElement } = useLockElement()\nconst { copyElement, pasteElement, cutElement } = useCopyAndPasteElement()\nconst { selectAllElement } = useSelectAllElement()\n\nconst contextmenus = (): ContextmenuItem[] => {\n if (props.elementInfo.lock) {\n return [{\n text: '解锁', \n handler: () => unlockElement(props.elementInfo),\n }]\n }\n\n return [\n {\n text: '剪切',\n subText: 'Ctrl + X',\n handler: cutElement,\n },\n {\n text: '复制',\n subText: 'Ctrl + C',\n handler: copyElement,\n },\n {\n text: '粘贴',\n subText: 'Ctrl + V',\n handler: pasteElement,\n },\n { divider: true },\n {\n text: '水平居中',\n handler: () => alignElementToCanvas(ElementAlignCommands.HORIZONTAL),\n children: [\n { text: '水平垂直居中', handler: () => alignElementToCanvas(ElementAlignCommands.CENTER), },\n { text: '水平居中', handler: () => alignElementToCanvas(ElementAlignCommands.HORIZONTAL) },\n { text: '左对齐', handler: () => alignElementToCanvas(ElementAlignCommands.LEFT) },\n { text: '右对齐', handler: () => alignElementToCanvas(ElementAlignCommands.RIGHT) },\n ],\n },\n {\n text: '垂直居中',\n handler: () => alignElementToCanvas(ElementAlignCommands.VERTICAL),\n children: [\n { text: '水平垂直居中', handler: () => alignElementToCanvas(ElementAlignCommands.CENTER) },\n { text: '垂直居中', handler: () => alignElementToCanvas(ElementAlignCommands.VERTICAL) },\n { text: '顶部对齐', handler: () => alignElementToCanvas(ElementAlignCommands.TOP) },\n { text: '底部对齐', handler: () => alignElementToCanvas(ElementAlignCommands.BOTTOM) },\n ],\n },\n { divider: true },\n {\n text: '置于顶层',\n disable: props.isMultiSelect && !props.elementInfo.groupId,\n handler: () => orderElement(props.elementInfo, ElementOrderCommands.TOP),\n children: [\n { text: '置于顶层', handler: () => orderElement(props.elementInfo, ElementOrderCommands.TOP) },\n { text: '上移一层', handler: () => orderElement(props.elementInfo, ElementOrderCommands.UP) },\n ],\n },\n {\n text: '置于底层',\n disable: props.isMultiSelect && !props.elementInfo.groupId,\n handler: () => orderElement(props.elementInfo, ElementOrderCommands.BOTTOM),\n children: [\n { text: '置于底层', handler: () => orderElement(props.elementInfo, ElementOrderCommands.BOTTOM) },\n { text: '下移一层', handler: () => orderElement(props.elementInfo, ElementOrderCommands.DOWN) },\n ],\n },\n { divider: true },\n {\n text: '设置链接',\n handler: props.openLinkDialog,\n },\n {\n text: props.elementInfo.groupId ? '取消组合' : '组合',\n subText: 'Ctrl + G',\n handler: props.elementInfo.groupId ? uncombineElements : combineElements,\n hide: !props.isMultiSelect,\n },\n {\n text: '全选',\n subText: 'Ctrl + A',\n handler: selectAllElement,\n },\n {\n text: '锁定',\n subText: 'Ctrl + L',\n handler: lockElement,\n },\n {\n text: '删除',\n subText: 'Delete',\n handler: deleteElement,\n },\n ]\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"editable-element\",\n ref: \"elementRef\",\n id: `editable-element-${__props.elementInfo.id}`,\n style: _normalizeStyle({\n zIndex: __props.elementIndex,\n })\n }, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentElementComponent)), {\n elementInfo: __props.elementInfo,\n selectElement: __props.selectElement,\n contextmenus: contextmenus\n }, null, 8, [\"elementInfo\", \"selectElement\"]))\n ], 12, _hoisted_1))\n}\n}\n\n})","import script from \"./EditableElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./EditableElement.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MouseSelection',\n props: {\n top: {\n type: Number,\n required: true,\n },\n left: {\n type: Number,\n required: true,\n },\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n quadrant: {\n type: Number,\n required: true,\n validator(value: number) {\n return [1, 2, 3, 4].includes(value)\n },\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass(`mouse-selection quadrant-${__props.quadrant}`),\n style: _normalizeStyle({\n top: __props.top + 'px',\n left: __props.left + 'px',\n width: __props.width + 'px',\n height: __props.height + 'px',\n })\n }, null, 6))\n}\n}\n\n})","import script from \"./MouseSelection.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MouseSelection.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MouseSelection.vue?vue&type=style&index=0&id=0d6c0f73&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-0d6c0f73\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-10cd6d44\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"grid-lines\" }\nconst _hoisted_2 = [\"d\", \"stroke\"]\n\nimport { computed } from 'vue'\nimport tinycolor from 'tinycolor2'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport { SlideBackground } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'GridLines',\n setup(__props) {\n\nconst { canvasScale } = storeToRefs(useMainStore())\nconst { currentSlide, viewportRatio } = storeToRefs(useSlidesStore())\n\nconst background = computed(() => currentSlide.value?.background)\n\n// 计算网格线的颜色,避免与背景的颜色太接近\nconst gridColor = computed(() => {\n const bgColor = background.value?.color || '#fff'\n const colorList = ['#000', '#fff']\n return tinycolor.mostReadable(bgColor, colorList, { includeFallbackColors: true }).setAlpha(.5).toRgbString()\n})\n\nconst gridSize = 50\n\n// 计算网格路径\nconst getPath = () => {\n const maxX = VIEWPORT_SIZE\n const maxY = VIEWPORT_SIZE * viewportRatio.value\n\n let path = ''\n for (let i = 0; i <= Math.floor(maxY / gridSize); i++) {\n path += `M0 ${i * gridSize} L${maxX} ${i * gridSize} `\n }\n for (let i = 0; i <= Math.floor(maxX / gridSize); i++) {\n path += `M${i * gridSize} 0 L${i * gridSize} ${maxY} `\n }\n return path\n}\n\nconst path = getPath()\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [\n _createElementVNode(\"path\", {\n style: _normalizeStyle({\n transform: `scale(${_unref(canvasScale)})`,\n }),\n d: _unref(path),\n fill: \"none\",\n stroke: _unref(gridColor),\n \"stroke-width\": \"0.3\",\n \"stroke-dasharray\": \"5\"\n }, null, 12, _hoisted_2)\n ]))\n}\n}\n\n})","import script from \"./GridLines.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./GridLines.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./GridLines.vue?vue&type=style&index=0&id=10cd6d44&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-10cd6d44\"]])\n\nexport default __exports__","import { Ref, computed } from 'vue'\nimport { SlideBackground } from '@/types/slides'\n\n// 将页面背景数据转换为css样式\nexport default (background: Ref) => {\n const backgroundStyle = computed(() => {\n if (!background.value) return { backgroundColor: '#fff' }\n\n const {\n type,\n color,\n image,\n imageSize,\n gradientColor,\n gradientRotate,\n gradientType,\n } = background.value\n\n // 纯色背景\n if (type === 'solid') return { backgroundColor: color }\n\n // 背景图模式\n // 包括:背景图、背景大小,是否重复\n else if (type === 'image') {\n if (!image) return { backgroundColor: '#fff' }\n if (imageSize === 'repeat') {\n return {\n backgroundImage: `url(${image}`,\n backgroundRepeat: 'repeat',\n backgroundSize: 'contain',\n }\n }\n return {\n backgroundImage: `url(${image}`,\n backgroundRepeat: 'no-repeat',\n backgroundSize: imageSize || 'cover',\n }\n }\n\n // 渐变色背景\n else if (type === 'gradient') {\n const rotate = gradientRotate || 0\n const color1 = gradientColor ? gradientColor[0] : '#fff'\n const color2 = gradientColor ? gradientColor[1] : '#fff'\n \n if (gradientType === 'radial') return { backgroundImage: `radial-gradient(${color1}, ${color2}` }\n return { backgroundImage: `linear-gradient(${rotate}deg, ${color1}, ${color2}` }\n }\n\n return { backgroundColor: '#fff' }\n })\n\n return {\n backgroundStyle,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { SlideBackground } from '@/types/slides'\nimport GridLines from './GridLines.vue'\nimport useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ViewportBackground',\n setup(__props) {\n\nconst { showGridLines } = storeToRefs(useMainStore())\nconst { currentSlide } = storeToRefs(useSlidesStore())\nconst background = computed(() => currentSlide.value?.background)\n\nconst { backgroundStyle } = useSlideBackgroundStyle(background)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"viewport-background\",\n style: _normalizeStyle(_unref(backgroundStyle))\n }, [\n (_unref(showGridLines))\n ? (_openBlock(), _createBlock(GridLines, { key: 0 }))\n : _createCommentVNode(\"\", true)\n ], 4))\n}\n}\n\n})","import script from \"./ViewportBackground.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ViewportBackground.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ViewportBackground.vue?vue&type=style&index=0&id=6f1e1261&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6f1e1261\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { AlignmentLineAxis } from '@/types/edit'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'AlignmentLine',\n props: {\n type: {\n type: String as PropType<'vertical' | 'horizontal'>,\n required: true,\n },\n axis: {\n type: Object as PropType,\n required: true,\n },\n length: {\n type: Number,\n required: true,\n },\n canvasScale: {\n type: Number,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\n// 吸附对齐线的位置\nconst left = computed(() => props.axis.x * props.canvasScale + 'px')\nconst top = computed(() => props.axis.y * props.canvasScale + 'px')\n\n// 吸附对齐线的长度\nconst sizeStyle = computed(() => {\n if (props.type === 'vertical') return { height: props.length * props.canvasScale + 'px' }\n return { width: props.length * props.canvasScale + 'px' }\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"alignment-line\",\n style: _normalizeStyle({ left: _unref(left), top: _unref(top) })\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass(['line', __props.type]),\n style: _normalizeStyle(_unref(sizeStyle))\n }, null, 6)\n ], 4))\n}\n}\n\n})","import script from \"./AlignmentLine.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./AlignmentLine.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./AlignmentLine.vue?vue&type=style&index=0&id=37fa6068&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-37fa6068\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-60e06332\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"ruler\" }\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\n\ninterface ViewportStyles {\n top: number\n left: number\n width: number\n height: number\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Ruler',\n props: {\n viewportStyles: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst markerSize = computed(() => {\n return props.viewportStyles.width * canvasScale.value / 10\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"h\",\n style: _normalizeStyle({\n width: __props.viewportStyles.width * _unref(canvasScale) + 'px',\n left: __props.viewportStyles.left + 'px',\n })\n }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(10, (marker) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"ruler-marker-100\", { 'hide': _unref(markerSize) < 36, 'omit': _unref(markerSize) < 72 }]),\n key: `marker-100-${marker}`\n }, [\n _createElementVNode(\"span\", null, _toDisplayString(marker * 100), 1)\n ], 2)\n }), 64))\n ], 4),\n _createElementVNode(\"div\", {\n class: \"v\",\n style: _normalizeStyle({\n height: __props.viewportStyles.height * _unref(canvasScale) + 'px',\n top: __props.viewportStyles.top + 'px',\n })\n }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(10, (marker) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"ruler-marker-100\", { 'hide': _unref(markerSize) < 36, 'omit': _unref(markerSize) < 72 }]),\n key: marker,\n style: _normalizeStyle({ height: _unref(markerSize) + 'px' })\n }, [\n _createElementVNode(\"span\", null, _toDisplayString(marker * 100), 1)\n ], 6)\n }), 64))\n ], 4)\n ]))\n}\n}\n\n})","import script from \"./Ruler.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Ruler.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Ruler.vue?vue&type=style&index=0&id=60e06332&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-60e06332\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, withModifiers as _withModifiers, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5a941f07\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"d\"]\n\nimport { computed, onMounted, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useKeyboardStore } from '@/store'\nimport { CreateElementSelectionData } from '@/types/edit'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementCreateSelection',\n emits: [\"created\"],\n setup(__props, { emit }: { emit: ({\n (event: 'created', payload: CreateElementSelectionData): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst mainStore = useMainStore()\nconst { creatingElement } = storeToRefs(mainStore)\nconst { ctrlOrShiftKeyActive } = storeToRefs(useKeyboardStore())\n\nconst start = ref<[number, number]>()\nconst end = ref<[number, number]>()\n\nconst selectionRef = ref()\nconst offset = ref({\n x: 0,\n y: 0,\n})\nonMounted(() => {\n if (!selectionRef.value) return\n const { x, y } = selectionRef.value.getBoundingClientRect()\n offset.value = { x, y }\n})\n\n// 鼠标拖动创建元素生成位置大小\n// 获取范围的起始位置和终点位置\nconst createSelection = (e: MouseEvent) => {\n let isMouseDown = true\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n start.value = [startPageX, startPageY]\n\n document.onmousemove = e => {\n if (!creatingElement.value || !isMouseDown) return\n\n let currentPageX = e.pageX\n let currentPageY = e.pageY\n\n // 按住Ctrl键或者Shift键时:\n // 对于非线条元素需要锁定宽高比例,对于线条元素需要锁定水平或垂直方向\n if (ctrlOrShiftKeyActive.value) {\n const moveX = currentPageX - startPageX\n const moveY = currentPageY - startPageY\n\n // 水平和垂直方向的拖动距离,后面以拖动距离较大的方向为基础计算另一方向的数据\n const absX = Math.abs(moveX)\n const absY = Math.abs(moveY)\n\n if (creatingElement.value.type === 'shape') {\n\n // 判断是否为反向拖动:从左上到右下为正向操作,此外所有情况都是反向操作\n const isOpposite = (moveY > 0 && moveX < 0) || (moveY < 0 && moveX > 0)\n\n if (absX > absY) {\n currentPageY = isOpposite ? startPageY - moveX : startPageY + moveX\n }\n else {\n currentPageX = isOpposite ? startPageX - moveY : startPageX + moveY\n }\n }\n\n else if (creatingElement.value.type === 'line') {\n if (absX > absY) currentPageY = startPageY\n else currentPageX = startPageX\n }\n }\n\n end.value = [currentPageX, currentPageY]\n }\n\n document.onmouseup = e => {\n document.onmousemove = null\n document.onmouseup = null\n\n if (e.button === 2) {\n setTimeout(() => mainStore.setCreatingElement(null), 0)\n return\n }\n\n isMouseDown = false\n\n const endPageX = e.pageX\n const endPageY = e.pageY\n\n const minSize = 30\n\n if (\n creatingElement.value?.type === 'line' &&\n (Math.abs(endPageX - startPageX) >= minSize || Math.abs(endPageY - startPageY) >= minSize)\n ) {\n emit('created', {\n start: start.value!,\n end: end.value!,\n })\n }\n else if (\n creatingElement.value?.type !== 'line' &&\n (Math.abs(endPageX - startPageX) >= minSize && Math.abs(endPageY - startPageY) >= minSize)\n ) {\n emit('created', {\n start: start.value!,\n end: end.value!,\n })\n }\n else {\n const defaultSize = 200\n const minX = Math.min(endPageX, startPageX)\n const minY = Math.min(endPageY, startPageY)\n const maxX = Math.max(endPageX, startPageX)\n const maxY = Math.max(endPageY, startPageY)\n const offsetX = maxX - minX >= minSize ? maxX - minX : defaultSize\n const offsetY = maxY - minY >= minSize ? maxY - minY : defaultSize\n emit('created', {\n start: [minX, minY],\n end: [minX + offsetX, minY + offsetY],\n })\n }\n }\n}\n\n// 绘制线条的路径相关数据(仅当绘制元素类型为线条时使用)\nconst lineData = computed(() => {\n if (!start.value || !end.value) return null\n if (!creatingElement.value || creatingElement.value.type !== 'line') return null\n\n const [_startX, _startY] = start.value\n const [_endX, _endY] = end.value\n const minX = Math.min(_startX, _endX)\n const maxX = Math.max(_startX, _endX)\n const minY = Math.min(_startY, _endY)\n const maxY = Math.max(_startY, _endY)\n\n const svgWidth = maxX - minX >= 24 ? maxX - minX : 24\n const svgHeight = maxY - minY >= 24 ? maxY - minY : 24\n\n const startX = _startX === minX ? 0 : maxX - minX\n const startY = _startY === minY ? 0 : maxY - minY\n const endX = _endX === minX ? 0 : maxX - minX\n const endY = _endY === minY ? 0 : maxY - minY\n\n const path = `M${startX}, ${startY} L${endX}, ${endY}`\n\n return {\n svgWidth,\n svgHeight,\n startX,\n startY,\n endX,\n endY,\n path,\n }\n})\n\n// 根据生成范围的起始位置和终点位置,计算元素创建时的位置和大小\nconst position = computed(() => {\n if (!start.value || !end.value) return {}\n\n const [startX, startY] = start.value\n const [endX, endY] = end.value\n const minX = Math.min(startX, endX)\n const maxX = Math.max(startX, endX)\n const minY = Math.min(startY, endY)\n const maxY = Math.max(startY, endY)\n\n const width = maxX - minX\n const height = maxY - minY\n\n return {\n left: minX - offset.value.x + 'px',\n top: minY - offset.value.y + 'px',\n width: width + 'px',\n height: height + 'px',\n }\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"element-create-selection\",\n ref_key: \"selectionRef\",\n ref: selectionRef,\n onMousedown: _cache[0] || (_cache[0] = _withModifiers($event => createSelection($event), [\"stop\"])),\n onContextmenu: _cache[1] || (_cache[1] = _withModifiers(() => {}, [\"stop\",\"prevent\"]))\n }, [\n (start.value && end.value)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: _normalizeClass(['selection', _unref(creatingElement)?.type]),\n style: _normalizeStyle(_unref(position))\n }, [\n (_unref(creatingElement)?.type === 'line' && _unref(lineData))\n ? (_openBlock(), _createElementBlock(\"svg\", {\n key: 0,\n overflow: \"visible\",\n width: _unref(lineData).svgWidth,\n height: _unref(lineData).svgHeight\n }, [\n _createElementVNode(\"path\", {\n d: _unref(lineData).path,\n stroke: \"#d14424\",\n fill: \"none\",\n \"stroke-width\": \"2\"\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n : _createCommentVNode(\"\", true)\n ], 6))\n : _createCommentVNode(\"\", true)\n ], 544))\n}\n}\n\n})","import script from \"./ElementCreateSelection.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementCreateSelection.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementCreateSelection.vue?vue&type=style&index=0&id=5a941f07&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5a941f07\"]])\n\nexport default __exports__","import { computed, Ref } from 'vue'\nimport { OperateResizeHandlers, OperateBorderLines } from '@/types/edit'\n\nexport default (width: Ref, height: Ref) => {\n // 元素缩放点\n const resizeHandlers = computed(() => {\n return [\n { direction: OperateResizeHandlers.LEFT_TOP, style: {} },\n { direction: OperateResizeHandlers.TOP, style: {left: width.value / 2 + 'px'} },\n { direction: OperateResizeHandlers.RIGHT_TOP, style: {left: width.value + 'px'} },\n { direction: OperateResizeHandlers.LEFT, style: {top: height.value / 2 + 'px'} },\n { direction: OperateResizeHandlers.RIGHT, style: {left: width.value + 'px', top: height.value / 2 + 'px'} },\n { direction: OperateResizeHandlers.LEFT_BOTTOM, style: {top: height.value + 'px'} },\n { direction: OperateResizeHandlers.BOTTOM, style: {left: width.value / 2 + 'px', top: height.value + 'px'} },\n { direction: OperateResizeHandlers.RIGHT_BOTTOM, style: {left: width.value + 'px', top: height.value + 'px'} },\n ]\n })\n\n // 文本元素缩放点\n const textElementResizeHandlers = computed(() => {\n return [\n { direction: OperateResizeHandlers.LEFT, style: {top: height.value / 2 + 'px'} },\n { direction: OperateResizeHandlers.RIGHT, style: {left: width.value + 'px', top: height.value / 2 + 'px'} },\n ]\n })\n\n // 元素选中边框线\n const borderLines = computed(() => {\n return [\n { type: OperateBorderLines.T, style: {width: width.value + 'px'} },\n { type: OperateBorderLines.B, style: {top: height.value + 'px', width: width.value + 'px'} },\n { type: OperateBorderLines.L, style: {height: height.value + 'px'} },\n { type: OperateBorderLines.R, style: {left: width.value + 'px', height: height.value + 'px'} },\n ]\n })\n\n return {\n resizeHandlers,\n textElementResizeHandlers,\n borderLines,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { OperateResizeHandlers } from '@/types/edit'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ResizeHandler',\n props: {\n type: {\n type: String as PropType,\n default: '',\n },\n rotate: {\n type: Number,\n default: 0,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst rotateClassName = computed(() => {\n const prefix = 'rotate-'\n const rotate = props.rotate\n if (rotate > -22.5 && rotate <= 22.5) return prefix + 0\n else if (rotate > 22.5 && rotate <= 67.5) return prefix + 45\n else if (rotate > 67.5 && rotate <= 112.5) return prefix + 90\n else if (rotate > 112.5 && rotate <= 157.5) return prefix + 135\n else if (rotate > 157.5 || rotate <= -157.5) return prefix + 0\n else if (rotate > -157.5 && rotate <= -112.5) return prefix + 45\n else if (rotate > -112.5 && rotate <= -67.5) return prefix + 90\n else if (rotate > -67.5 && rotate <= -22.5) return prefix + 135\n return prefix + 0\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass(['resize-handler', _unref(rotateClassName), __props.type])\n }, null, 2))\n}\n}\n\n})","import script from \"./ResizeHandler.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ResizeHandler.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ResizeHandler.vue?vue&type=style&index=0&id=881ee3f8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-881ee3f8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { PropType } from 'vue'\nimport { OperateBorderLines } from '@/types/edit'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BorderLine',\n props: {\n type: {\n type: String as PropType,\n required: true,\n },\n isWide: {\n type: Boolean,\n default: false,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass(['border-line', __props.type, { 'wide': __props.isWide }])\n }, null, 2))\n}\n}\n\n})","import script from \"./BorderLine.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BorderLine.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BorderLine.vue?vue&type=style&index=0&id=7170d1be&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7170d1be\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode } from \"vue\"\n\nimport { computed, ref, PropType, watchEffect } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { getElementListRange } from '@/utils/element'\nimport { OperateResizeHandlers, MultiSelectRange } from '@/types/edit'\nimport useCommonOperate from '../hooks/useCommonOperate'\n\nimport ResizeHandler from './ResizeHandler.vue'\nimport BorderLine from './BorderLine.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MultiSelectOperate',\n props: {\n elementList: {\n type: Array as PropType,\n required: true,\n },\n scaleMultiElement: {\n type: Function as PropType<(e: MouseEvent, range: MultiSelectRange, command: OperateResizeHandlers) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { activeElementIdList, canvasScale } = storeToRefs(useMainStore())\n\nconst localActiveElementList = computed(() => props.elementList.filter(el => activeElementIdList.value.includes(el.id)))\n\nconst range = ref({\n minX: 0,\n maxX: 0,\n minY: 0,\n maxY: 0,\n})\n\n// 根据多选元素整体在画布中的范围,计算边框线和缩放点的位置信息\nconst width = computed(() => (range.value.maxX - range.value.minX) * canvasScale.value)\nconst height = computed(() => (range.value.maxY - range.value.minY) * canvasScale.value)\nconst { resizeHandlers, borderLines } = useCommonOperate(width, height)\n\n// 计算多选元素整体在画布中的范围\nconst setRange = () => {\n const { minX, maxX, minY, maxY } = getElementListRange(localActiveElementList.value)\n range.value = { minX, maxX, minY, maxY }\n}\nwatchEffect(setRange)\n\n// 禁用多选状态下缩放:仅未旋转的图片和形状可以在多选状态下缩放\nconst disableResize = computed(() => {\n return localActiveElementList.value.some(item => {\n if (\n (item.type === 'image' || item.type === 'shape') && \n !item.rotate\n ) return false\n return true\n })\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"multi-select-operate\",\n style: _normalizeStyle({\n left: range.value.minX * _unref(canvasScale) + 'px',\n top: range.value.minY * _unref(canvasScale) + 'px',\n })\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (!_unref(disableResize))\n ? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n key: point.direction,\n type: point.direction,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers(($event: any) => (__props.scaleMultiElement($event, range.value, point.direction)), [\"stop\"])\n }, null, 8, [\"type\", \"style\", \"onMousedown\"]))\n }), 128))\n : _createCommentVNode(\"\", true)\n ], 4))\n}\n}\n\n})","import script from \"./MultiSelectOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MultiSelectOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MultiSelectOperate.vue?vue&type=style&index=0&id=defbd922&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-defbd922\"]])\n\nexport default __exports__","\n\n\n\n","import { render } from \"./RotateHandler.vue?vue&type=template&id=b99d8dae&scoped=true\"\nconst script = {}\n\nimport \"./RotateHandler.vue?vue&type=style&index=0&id=b99d8dae&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-b99d8dae\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createVNode as _createVNode, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nimport { computed, PropType } from 'vue'\r\nimport { storeToRefs } from 'pinia'\r\nimport { useMainStore } from '@/store'\r\nimport { PPTImageElement } from '@/types/slides'\r\nimport { OperateResizeHandlers } from '@/types/edit'\r\nimport useCommonOperate from '../hooks/useCommonOperate'\r\n\r\nimport RotateHandler from './RotateHandler.vue'\r\nimport ResizeHandler from './ResizeHandler.vue'\r\nimport BorderLine from './BorderLine.vue'\r\n\r\n\r\nconst __default__ = {\r\n inheritAttrs: false,\r\n}\r\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'ImageElementOperate',\n props: {\r\n elementInfo: {\r\n type: Object as PropType,\r\n required: true,\r\n },\r\n handlerVisible: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n rotateElement: {\r\n type: Function as PropType<(element: PPTImageElement) => void>,\r\n required: true,\r\n },\r\n scaleElement: {\r\n type: Function as PropType<(e: MouseEvent, element: PPTImageElement, command: OperateResizeHandlers) => void>,\r\n required: true,\r\n },\r\n},\n setup(__props) {\n\nconst props = __props\n\r\n\r\n\r\nconst { canvasScale, clipingImageElementId } = storeToRefs(useMainStore())\r\n\r\nconst isCliping = computed(() => clipingImageElementId.value === props.elementInfo.id)\r\n\r\nconst scaleWidth = computed(() => props.elementInfo.width * canvasScale.value)\r\nconst scaleHeight = computed(() => props.elementInfo.height * canvasScale.value)\r\nconst { resizeHandlers, borderLines } = useCommonOperate(scaleWidth, scaleHeight)\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"image-element-operate\", { 'cliping': _unref(isCliping) }])\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onMousedown\"]))\n }), 128)),\n _createVNode(RotateHandler, {\n class: \"operate-rotate-handler\",\n style: _normalizeStyle({ left: _unref(scaleWidth) / 2 + 'px' }),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.rotateElement(__props.elementInfo)), [\"stop\"]))\n }, null, 8, [\"style\"])\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 2))\n}\n}\n\n})","import script from \"./ImageElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImageElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImageElementOperate.vue?vue&type=style&index=0&id=46b250c2&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-46b250c2\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createVNode as _createVNode, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"text-element-operate\" }\n\nimport { computed, PropType } from 'vue'\r\nimport { storeToRefs } from 'pinia'\r\nimport { useMainStore } from '@/store'\r\nimport { PPTTextElement } from '@/types/slides'\r\nimport { OperateResizeHandlers } from '@/types/edit'\r\nimport useCommonOperate from '../hooks/useCommonOperate'\r\n\r\nimport RotateHandler from './RotateHandler.vue'\r\nimport ResizeHandler from './ResizeHandler.vue'\r\nimport BorderLine from './BorderLine.vue'\r\n\r\n\r\nconst __default__ = {\r\n inheritAttrs: false,\r\n}\r\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'TextElementOperate',\n props: {\r\n elementInfo: {\r\n type: Object as PropType,\r\n required: true,\r\n },\r\n handlerVisible: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n rotateElement: {\r\n type: Function as PropType<(element: PPTTextElement) => void>,\r\n required: true,\r\n },\r\n scaleElement: {\r\n type: Function as PropType<(e: MouseEvent, element: PPTTextElement, command: OperateResizeHandlers) => void>,\r\n required: true,\r\n },\r\n},\n setup(__props) {\n\nconst props = __props\n\r\n\r\n\r\nconst { canvasScale } = storeToRefs(useMainStore())\r\n\r\nconst scaleWidth = computed(() => props.elementInfo.width * canvasScale.value)\r\nconst scaleHeight = computed(() => props.elementInfo.height * canvasScale.value)\r\n\r\nconst { textElementResizeHandlers, borderLines } = useCommonOperate(scaleWidth, scaleHeight)\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(textElementResizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onMousedown\"]))\n }), 128)),\n _createVNode(RotateHandler, {\n class: \"operate-rotate-handler\",\n style: _normalizeStyle({ left: _unref(scaleWidth) / 2 + 'px' }),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.rotateElement(__props.elementInfo)), [\"stop\"]))\n }, null, 8, [\"style\"])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./TextElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./TextElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createVNode as _createVNode, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-fd38df18\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"shape-element-operate\" }\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTShapeElement } from '@/types/slides'\nimport { OperateResizeHandlers } from '@/types/edit'\nimport { SHAPE_PATH_FORMULAS } from '@/configs/shapes'\nimport useCommonOperate from '../hooks/useCommonOperate'\n\nimport RotateHandler from './RotateHandler.vue'\nimport ResizeHandler from './ResizeHandler.vue'\nimport BorderLine from './BorderLine.vue'\n\n\nconst __default__ = {\n inheritAttrs: false,\n}\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'ShapeElementOperate',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n handlerVisible: {\n type: Boolean,\n required: true,\n },\n rotateElement: {\n type: Function as PropType<(element: PPTShapeElement) => void>,\n required: true,\n },\n scaleElement: {\n type: Function as PropType<(e: MouseEvent, element: PPTShapeElement, command: OperateResizeHandlers) => void>,\n required: true,\n },\n moveShapeKeypoint: {\n type: Function as PropType<(e: MouseEvent, element: PPTShapeElement) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst scaleWidth = computed(() => props.elementInfo.width * canvasScale.value)\nconst scaleHeight = computed(() => props.elementInfo.height * canvasScale.value)\nconst { resizeHandlers, borderLines } = useCommonOperate(scaleWidth, scaleHeight)\n\nconst keypointStyle = computed(() => {\n if (!props.elementInfo.pathFormula || !props.elementInfo.keypoint) return {}\n\n const pathFormula = SHAPE_PATH_FORMULAS[props.elementInfo.pathFormula]\n if ('editable' in pathFormula) {\n const keypointPos = pathFormula.getBaseSize(props.elementInfo.width, props.elementInfo.height) * props.elementInfo.keypoint\n if (pathFormula.relative === 'left') return { left: keypointPos * canvasScale.value + 'px' }\n if (pathFormula.relative === 'right') return { left: (props.elementInfo.width - keypointPos) * canvasScale.value + 'px' }\n if (pathFormula.relative === 'center') return { left: (props.elementInfo.width - keypointPos) / 2 * canvasScale.value + 'px' }\n if (pathFormula.relative === 'top') return { top: keypointPos * canvasScale.value + 'px' }\n if (pathFormula.relative === 'bottom') return { top: (props.elementInfo.height - keypointPos) * canvasScale.value + 'px' }\n }\n return {}\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onMousedown\"]))\n }), 128)),\n _createVNode(RotateHandler, {\n class: \"operate-rotate-handler\",\n style: _normalizeStyle({ left: _unref(scaleWidth) / 2 + 'px' }),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.rotateElement(__props.elementInfo)), [\"stop\"]))\n }, null, 8, [\"style\"]),\n (__props.elementInfo.keypoint !== undefined)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"operate-keypoint-handler\",\n style: _normalizeStyle(_unref(keypointStyle)),\n onMousedown: _cache[1] || (_cache[1] = _withModifiers($event => __props.moveShapeKeypoint($event, __props.elementInfo), [\"stop\"]))\n }, null, 36))\n : _createCommentVNode(\"\", true)\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ShapeElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ShapeElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ShapeElementOperate.vue?vue&type=style&index=0&id=fd38df18&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-fd38df18\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, withModifiers as _withModifiers, normalizeStyle as _normalizeStyle, createBlock as _createBlock, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4659f395\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"line-element-operate\" }\nconst _hoisted_2 = [\"width\", \"height\", \"stroke\"]\nconst _hoisted_3 = { key: 0 }\nconst _hoisted_4 = [\"x1\", \"y1\", \"x2\", \"y2\"]\nconst _hoisted_5 = [\"x1\", \"y1\", \"x2\", \"y2\"]\nconst _hoisted_6 = [\"x1\", \"y1\", \"x2\", \"y2\"]\nconst _hoisted_7 = [\"x1\", \"y1\", \"x2\", \"y2\"]\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTLineElement } from '@/types/slides'\nimport { OperateLineHandlers } from '@/types/edit'\n\nimport ResizeHandler from './ResizeHandler.vue'\n\n\nconst __default__ = {\n inheritAttrs: false,\n}\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'LineElementOperate',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n handlerVisible: {\n type: Boolean,\n required: true,\n },\n dragLineElement: {\n type: Function as PropType<(e: MouseEvent, element: PPTLineElement, command: OperateLineHandlers) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst svgWidth = computed(() => Math.max(props.elementInfo.start[0], props.elementInfo.end[0]))\nconst svgHeight = computed(() => Math.max(props.elementInfo.start[1], props.elementInfo.end[1]))\n\nconst resizeHandlers = computed(() => {\n const handlers = [\n {\n handler: OperateLineHandlers.START,\n style: {\n left: props.elementInfo.start[0] * canvasScale.value + 'px',\n top: props.elementInfo.start[1] * canvasScale.value + 'px',\n }\n },\n {\n handler: OperateLineHandlers.END,\n style: {\n left: props.elementInfo.end[0] * canvasScale.value + 'px',\n top: props.elementInfo.end[1] * canvasScale.value + 'px',\n }\n },\n ]\n\n if (props.elementInfo.curve || props.elementInfo.broken) {\n const ctrlHandler = (props.elementInfo.curve || props.elementInfo.broken) as [number, number]\n\n handlers.push({\n handler: OperateLineHandlers.C,\n style: {\n left: ctrlHandler[0] * canvasScale.value + 'px',\n top: ctrlHandler[1] * canvasScale.value + 'px',\n }\n })\n }\n else if (props.elementInfo.cubic) {\n const [ctrlHandler1, ctrlHandler2] = props.elementInfo.cubic\n handlers.push({\n handler: OperateLineHandlers.C1,\n style: {\n left: ctrlHandler1[0] * canvasScale.value + 'px',\n top: ctrlHandler1[1] * canvasScale.value + 'px',\n }\n })\n handlers.push({\n handler: OperateLineHandlers.C2,\n style: {\n left: ctrlHandler2[0] * canvasScale.value + 'px',\n top: ctrlHandler2[1] * canvasScale.value + 'px',\n }\n })\n }\n\n return handlers\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.handler,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.dragLineElement($event, __props.elementInfo, point.handler), [\"stop\"])\n }, null, 8, [\"style\", \"onMousedown\"]))\n }), 128)),\n (_openBlock(), _createElementBlock(\"svg\", {\n width: _unref(svgWidth) || 1,\n height: _unref(svgHeight) || 1,\n stroke: __props.elementInfo.color,\n overflow: \"visible\",\n style: _normalizeStyle({ transform: `scale(${_unref(canvasScale)})` })\n }, [\n (__props.elementInfo.curve)\n ? (_openBlock(), _createElementBlock(\"g\", _hoisted_3, [\n _createElementVNode(\"line\", {\n class: \"anchor-line\",\n x1: __props.elementInfo.start[0],\n y1: __props.elementInfo.start[1],\n x2: __props.elementInfo.curve[0],\n y2: __props.elementInfo.curve[1]\n }, null, 8, _hoisted_4),\n _createElementVNode(\"line\", {\n class: \"anchor-line\",\n x1: __props.elementInfo.end[0],\n y1: __props.elementInfo.end[1],\n x2: __props.elementInfo.curve[0],\n y2: __props.elementInfo.curve[1]\n }, null, 8, _hoisted_5)\n ]))\n : _createCommentVNode(\"\", true),\n (__props.elementInfo.cubic)\n ? (_openBlock(true), _createElementBlock(_Fragment, { key: 1 }, _renderList(__props.elementInfo.cubic, (item, index) => {\n return (_openBlock(), _createElementBlock(\"g\", { key: index }, [\n (index === 0)\n ? (_openBlock(), _createElementBlock(\"line\", {\n key: 0,\n class: \"anchor-line\",\n x1: __props.elementInfo.start[0],\n y1: __props.elementInfo.start[1],\n x2: item[0],\n y2: item[1]\n }, null, 8, _hoisted_6))\n : _createCommentVNode(\"\", true),\n (index === 1)\n ? (_openBlock(), _createElementBlock(\"line\", {\n key: 1,\n class: \"anchor-line\",\n x1: __props.elementInfo.end[0],\n y1: __props.elementInfo.end[1],\n x2: item[0],\n y2: item[1]\n }, null, 8, _hoisted_7))\n : _createCommentVNode(\"\", true)\n ]))\n }), 128))\n : _createCommentVNode(\"\", true)\n ], 12, _hoisted_2))\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./LineElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LineElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LineElementOperate.vue?vue&type=style&index=0&id=4659f395&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-4659f395\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createVNode as _createVNode, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"table-element-operate\" }\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTTableElement } from '@/types/slides'\nimport { OperateResizeHandlers } from '@/types/edit'\nimport useCommonOperate from '../hooks/useCommonOperate'\n\nimport RotateHandler from './RotateHandler.vue'\nimport ResizeHandler from './ResizeHandler.vue'\nimport BorderLine from './BorderLine.vue'\n\n\nconst __default__ = {\n inheritAttrs: false,\n}\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'TableElementOperate',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n handlerVisible: {\n type: Boolean,\n required: true,\n },\n rotateElement: {\n type: Function as PropType<(element: PPTTableElement) => void>,\n required: true,\n },\n scaleElement: {\n type: Function as PropType<(e: MouseEvent, element: PPTTableElement, command: OperateResizeHandlers) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst outlineWidth = computed(() => props.elementInfo.outline.width || 1)\n\nconst scaleWidth = computed(() => (props.elementInfo.width + outlineWidth.value) * canvasScale.value)\nconst scaleHeight = computed(() => props.elementInfo.height * canvasScale.value)\n\nconst { textElementResizeHandlers, borderLines } = useCommonOperate(scaleWidth, scaleHeight)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(textElementResizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onMousedown\"]))\n }), 128)),\n _createVNode(RotateHandler, {\n class: \"operate-rotate-handler\",\n style: _normalizeStyle({ left: _unref(scaleWidth) / 2 + 'px' }),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.rotateElement(__props.elementInfo)), [\"stop\"]))\n }, null, 8, [\"style\"])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./TableElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./TableElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"common-element-operate\" }\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTShapeElement, PPTVideoElement, PPTLatexElement, PPTAudioElement } from '@/types/slides'\nimport { OperateResizeHandlers } from '@/types/edit'\nimport useCommonOperate from '../hooks/useCommonOperate'\n\nimport RotateHandler from './RotateHandler.vue'\nimport ResizeHandler from './ResizeHandler.vue'\nimport BorderLine from './BorderLine.vue'\n\ntype PPTElement = PPTShapeElement | PPTVideoElement | PPTLatexElement | PPTAudioElement\n\n\nconst __default__ = {\n inheritAttrs: false,\n}\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'CommonElementOperate',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n handlerVisible: {\n type: Boolean,\n required: true,\n },\n rotateElement: {\n type: Function as PropType<(element: PPTElement) => void>,\n required: true,\n },\n scaleElement: {\n type: Function as PropType<(e: MouseEvent, element: PPTElement, command: OperateResizeHandlers) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst scaleWidth = computed(() => props.elementInfo.width * canvasScale.value)\nconst scaleHeight = computed(() => props.elementInfo.height * canvasScale.value)\nconst { resizeHandlers, borderLines } = useCommonOperate(scaleWidth, scaleHeight)\n\nconst cannotRotate = computed(() => ['video', 'audio'].includes(props.elementInfo.type))\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onMousedown\"]))\n }), 128)),\n (!_unref(cannotRotate))\n ? (_openBlock(), _createBlock(RotateHandler, {\n key: 0,\n class: \"operate-rotate-handler\",\n style: _normalizeStyle({ left: _unref(scaleWidth) / 2 + 'px' }),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.rotateElement(__props.elementInfo)), [\"stop\"]))\n }, null, 8, [\"style\"]))\n : _createCommentVNode(\"\", true)\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./CommonElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./CommonElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { useSlidesStore } from '@/store'\nimport { PPTElement, PPTElementLink } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport { message } from 'ant-design-vue'\n\nexport default () => {\n const slidesStore = useSlidesStore()\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n const setLink = (handleElement: PPTElement, link: PPTElementLink) => {\n const linkRegExp = /^(https?):\\/\\/[\\w\\-]+(\\.[\\w\\-]+)+([\\w\\-.,@?^=%&:\\/~+#]*[\\w\\-@?^=%&\\/~+#])?$/\n if (link.type === 'web' && !linkRegExp.test(link.target)) {\n message.error('不是正确的网页链接地址')\n return false\n }\n const props = { link }\n slidesStore.updateElement({ id: handleElement.id, props })\n addHistorySnapshot()\n\n return true\n }\n\n const removeLink = (handleElement: PPTElement) => {\n slidesStore.removeElementProps({ id: handleElement.id, propName: 'link' })\n addHistorySnapshot()\n }\n\n return {\n setLink,\n removeLink,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-bb722fc0\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"href\"]\nconst _hoisted_2 = {\n key: 1,\n class: \"link\"\n}\nconst _hoisted_3 = { class: \"btns\" }\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTElement, PPTElementLink } from '@/types/slides'\nimport useLink from '@/hooks/useLink'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LinkHandler',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n link: {\n type: Object as PropType,\n required: true,\n },\n openLinkDialog: {\n type: Function as PropType<() => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\nconst { removeLink } = useLink()\nconst height = computed(() => props.elementInfo.type === 'line' ? 0 : props.elementInfo.height)\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Divider = _resolveComponent(\"Divider\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"link-handler\",\n style: _normalizeStyle({ top: _unref(height) * _unref(canvasScale) + 10 + 'px' })\n }, [\n (__props.link.type === 'web')\n ? (_openBlock(), _createElementBlock(\"a\", {\n key: 0,\n class: \"link\",\n href: __props.link.target,\n target: \"_blank\"\n }, _toDisplayString(__props.link.target), 9, _hoisted_1))\n : (_openBlock(), _createElementBlock(\"a\", _hoisted_2, \"幻灯片页面 \" + _toDisplayString(__props.link.target), 1)),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", {\n class: \"btn\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (__props.openLinkDialog()))\n }, \"更换\"),\n _createVNode(_component_Divider, { type: \"vertical\" }),\n _createElementVNode(\"div\", {\n class: \"btn\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_unref(removeLink)(__props.elementInfo)))\n }, \"移除\")\n ])\n ], 4))\n}\n}\n\n})","import script from \"./LinkHandler.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LinkHandler.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LinkHandler.vue?vue&type=style&index=0&id=bb722fc0&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-bb722fc0\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, withModifiers as _withModifiers, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-27793fbf\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 1,\n class: \"animation-index\"\n}\n\nimport { PropType, computed } from 'vue'\r\nimport { storeToRefs } from 'pinia'\r\nimport { useMainStore, useSlidesStore } from '@/store'\r\nimport { ElementTypes, PPTElement, PPTLineElement, PPTVideoElement, PPTAudioElement, PPTShapeElement } from '@/types/slides'\r\nimport { OperateLineHandlers, OperateResizeHandlers } from '@/types/edit'\r\n\r\nimport ImageElementOperate from './ImageElementOperate.vue'\r\nimport TextElementOperate from './TextElementOperate.vue'\r\nimport ShapeElementOperate from './ShapeElementOperate.vue'\r\nimport LineElementOperate from './LineElementOperate.vue'\r\nimport TableElementOperate from './TableElementOperate.vue'\r\nimport CommonElementOperate from './CommonElementOperate.vue'\r\nimport LinkHandler from './LinkHandler.vue'\r\n\r\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\r\n elementInfo: {\r\n type: Object as PropType,\r\n required: true,\r\n },\r\n isSelected: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n isActive: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n isActiveGroupElement: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n isMultiSelect: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n rotateElement: {\r\n type: Function as PropType<(element: Exclude) => void>,\r\n required: true,\r\n },\r\n scaleElement: {\r\n type: Function as PropType<(e: MouseEvent, element: Exclude, command: OperateResizeHandlers) => void>,\r\n required: true,\r\n },\r\n dragLineElement: {\r\n type: Function as PropType<(e: MouseEvent, element: PPTLineElement, command: OperateLineHandlers) => void>,\r\n required: true,\r\n },\r\n moveShapeKeypoint: {\r\n type: Function as PropType<(e: MouseEvent, element: PPTShapeElement) => void>,\r\n required: true,\r\n },\r\n openLinkDialog: {\r\n type: Function as PropType<() => void>,\r\n required: true,\r\n },\r\n},\n setup(__props) {\n\nconst props = __props\n\r\n\r\n\r\nconst { canvasScale, toolbarState } = storeToRefs(useMainStore())\r\nconst { formatedAnimations } = storeToRefs(useSlidesStore())\r\n\r\nconst currentOperateComponent = computed(() => {\r\n const elementTypeMap = {\r\n [ElementTypes.IMAGE]: ImageElementOperate,\r\n [ElementTypes.TEXT]: TextElementOperate,\r\n [ElementTypes.SHAPE]: ShapeElementOperate,\r\n [ElementTypes.LINE]: LineElementOperate,\r\n [ElementTypes.TABLE]: TableElementOperate,\r\n [ElementTypes.CHART]: CommonElementOperate,\r\n [ElementTypes.LATEX]: CommonElementOperate,\r\n [ElementTypes.VIDEO]: CommonElementOperate,\r\n [ElementTypes.AUDIO]: CommonElementOperate,\r\n }\r\n return elementTypeMap[props.elementInfo.type] || null\r\n})\r\n\r\nconst elementIndexListInAnimation = computed(() => {\r\n const indexList = []\r\n for (let i = 0; i < formatedAnimations.value.length; i++) {\r\n const elIds = formatedAnimations.value[i].animations.map(item => item.elId)\r\n if (elIds.includes(props.elementInfo.id)) indexList.push(i)\r\n }\r\n return indexList\r\n})\r\n\r\nconst rotate = computed(() => 'rotate' in props.elementInfo ? props.elementInfo.rotate : 0)\r\nconst height = computed(() => 'height' in props.elementInfo ? props.elementInfo.height : 0)\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"operate\", { 'multi-select': __props.isMultiSelect && !__props.isActive }]),\n style: _normalizeStyle({\r\n top: __props.elementInfo.top * _unref(canvasScale) + 'px',\r\n left: __props.elementInfo.left * _unref(canvasScale) + 'px',\r\n transform: `rotate(${_unref(rotate)}deg)`,\r\n transformOrigin: `${__props.elementInfo.width * _unref(canvasScale) / 2}px ${_unref(height) * _unref(canvasScale) / 2}px`,\r\n })\n }, [\n (__props.isSelected)\n ? (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentOperateComponent)), {\n key: 0,\n elementInfo: __props.elementInfo,\n handlerVisible: !__props.elementInfo.lock && (__props.isActiveGroupElement || !__props.isMultiSelect),\n rotateElement: __props.rotateElement,\n scaleElement: __props.scaleElement,\n dragLineElement: __props.dragLineElement,\n moveShapeKeypoint: __props.moveShapeKeypoint\n }, null, 8, [\"elementInfo\", \"handlerVisible\", \"rotateElement\", \"scaleElement\", \"dragLineElement\", \"moveShapeKeypoint\"]))\n : _createCommentVNode(\"\", true),\n (_unref(toolbarState) === 'elAnimation' && _unref(elementIndexListInAnimation).length)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(elementIndexListInAnimation), (index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"index-item\",\n key: index\n }, _toDisplayString(index + 1), 1))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true),\n (__props.isActive && __props.elementInfo.link)\n ? (_openBlock(), _createBlock(LinkHandler, {\n key: 2,\n elementInfo: __props.elementInfo,\n link: __props.elementInfo.link,\n openLinkDialog: __props.openLinkDialog,\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(() => {}, [\"stop\"]))\n }, null, 8, [\"elementInfo\", \"link\", \"openLinkDialog\"]))\n : _createCommentVNode(\"\", true)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=27793fbf&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-27793fbf\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-66f2009f\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"src\"]\n\nimport { computed, PropType } from 'vue'\nimport { PPTImageElement } from '@/types/slides'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\nimport useElementFlip from '@/views/components/element/hooks/useElementFlip'\nimport useClipImage from './useClipImage'\nimport useFilter from './useFilter'\n\nimport ImageOutline from './ImageOutline/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseImageElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst flipH = computed(() => props.elementInfo.flipH)\nconst flipV = computed(() => props.elementInfo.flipV)\nconst { flipStyle } = useElementFlip(flipH, flipV)\n\nconst clip = computed(() => props.elementInfo.clip)\nconst { clipShape, imgPosition } = useClipImage(clip)\n\nconst filters = computed(() => props.elementInfo.filters)\nconst { filter } = useFilter(filters)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-image\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\n filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '',\n transform: _unref(flipStyle),\n })\n }, [\n _createVNode(ImageOutline, { elementInfo: __props.elementInfo }, null, 8, [\"elementInfo\"]),\n _createElementVNode(\"div\", {\n class: \"image-content\",\n style: _normalizeStyle({ clipPath: _unref(clipShape).style })\n }, [\n _createElementVNode(\"img\", {\n src: __props.elementInfo.src,\n draggable: false,\n style: _normalizeStyle({\n top: _unref(imgPosition).top,\n left: _unref(imgPosition).left,\n width: _unref(imgPosition).width,\n height: _unref(imgPosition).height,\n filter: _unref(filter),\n }),\n alt: \"\"\n }, null, 12, _hoisted_1)\n ], 4)\n ], 4)\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseImageElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseImageElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseImageElement.vue?vue&type=style&index=0&id=66f2009f&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-66f2009f\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-659e869d\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"innerHTML\"]\n\nimport { PropType, computed, StyleValue } from 'vue'\nimport { PPTTextElement } from '@/types/slides'\nimport ElementOutline from '@/views/components/element/ElementOutline.vue'\n\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseTextElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst cssVar = computed(() => ({\n '--textIndent': `${props.elementInfo.textIndent || 0}px`,\n '--paragraphSpace': `${props.elementInfo.paragraphSpace === undefined ? 5 : props.elementInfo.paragraphSpace}px`,\n} as StyleValue))\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-text\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\n backgroundColor: __props.elementInfo.fill,\n opacity: __props.elementInfo.opacity,\n textShadow: _unref(shadowStyle),\n lineHeight: __props.elementInfo.lineHeight,\n letterSpacing: (__props.elementInfo.wordSpace || 0) + 'px',\n color: __props.elementInfo.defaultColor,\n fontFamily: __props.elementInfo.defaultFontName,\n })\n }, [\n _createVNode(ElementOutline, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"outline\"]),\n _createElementVNode(\"div\", {\n class: \"text ProseMirror-static\",\n style: _normalizeStyle(_unref(cssVar)),\n innerHTML: __props.elementInfo.content\n }, null, 12, _hoisted_1)\n ], 4)\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseTextElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseTextElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseTextElement.vue?vue&type=style&index=0&id=659e869d&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-659e869d\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-073084bf\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = { key: 0 }\nconst _hoisted_3 = [\"transform\"]\nconst _hoisted_4 = [\"d\", \"fill\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\nconst _hoisted_5 = [\"innerHTML\"]\n\nimport { computed, PropType } from 'vue'\nimport { PPTShapeElement, ShapeText } from '@/types/slides'\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\nimport useElementFlip from '@/views/components/element/hooks/useElementFlip'\n\nimport GradientDefs from './GradientDefs.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseShapeElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst outline = computed(() => props.elementInfo.outline)\nconst { outlineWidth, outlineStyle, outlineColor } = useElementOutline(outline)\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst flipH = computed(() => props.elementInfo.flipH)\nconst flipV = computed(() => props.elementInfo.flipV)\nconst { flipStyle } = useElementFlip(flipH, flipV)\n\nconst text = computed(() => {\n const defaultText: ShapeText = {\n content: '',\n defaultFontName: '微软雅黑',\n defaultColor: '#000',\n align: 'middle',\n }\n if (!props.elementInfo.text) return defaultText\n\n return props.elementInfo.text\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-shape\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\n opacity: __props.elementInfo.opacity,\n filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '',\n transform: _unref(flipStyle),\n color: _unref(text).defaultColor,\n fontFamily: _unref(text).defaultFontName,\n })\n }, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: __props.elementInfo.width,\n height: __props.elementInfo.height\n }, [\n (__props.elementInfo.gradient)\n ? (_openBlock(), _createElementBlock(\"defs\", _hoisted_2, [\n _createVNode(GradientDefs, {\n id: `base-gradient-${__props.elementInfo.id}`,\n type: __props.elementInfo.gradient.type,\n color1: __props.elementInfo.gradient.color[0],\n color2: __props.elementInfo.gradient.color[1],\n rotate: __props.elementInfo.gradient.rotate\n }, null, 8, [\"id\", \"type\", \"color1\", \"color2\", \"rotate\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"g\", {\n transform: `scale(${__props.elementInfo.width / __props.elementInfo.viewBox[0]}, ${__props.elementInfo.height / __props.elementInfo.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`\n }, [\n _createElementVNode(\"path\", {\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n d: __props.elementInfo.path,\n fill: __props.elementInfo.gradient ? `url(#base-gradient-${__props.elementInfo.id})` : __props.elementInfo.fill,\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 5' : '0 0'\n }, null, 8, _hoisted_4)\n ], 8, _hoisted_3)\n ], 8, _hoisted_1)),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"shape-text\", _unref(text).align])\n }, [\n _createElementVNode(\"div\", {\n class: \"ProseMirror-static\",\n innerHTML: _unref(text).content\n }, null, 8, _hoisted_5)\n ], 2)\n ], 4)\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseShapeElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseShapeElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseShapeElement.vue?vue&type=style&index=0&id=073084bf&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-073084bf\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-340cdee8\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"d\", \"stroke\", \"stroke-width\", \"stroke-dasharray\", \"marker-start\", \"marker-end\"]\n\nimport { computed, PropType } from 'vue'\nimport { PPTLineElement } from '@/types/slides'\nimport { getLineElementPath } from '@/utils/element'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\n\nimport LinePointMarker from './LinePointMarker.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseLineElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst svgWidth = computed(() => {\n const width = Math.abs(props.elementInfo.start[0] - props.elementInfo.end[0])\n return width < 24 ? 24 : width\n})\nconst svgHeight = computed(() => {\n const height = Math.abs(props.elementInfo.start[1] - props.elementInfo.end[1])\n return height < 24 ? 24 : height\n})\n\nconst lineDashArray = computed(() => props.elementInfo.style === 'dashed' ? '10, 5' : '0, 0')\n\nconst path = computed(() => {\n return getLineElementPath(props.elementInfo)\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-line\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({ filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '' })\n }, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: _unref(svgWidth),\n height: _unref(svgHeight)\n }, [\n _createElementVNode(\"defs\", null, [\n (__props.elementInfo.points[0])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 0,\n id: __props.elementInfo.id,\n position: \"start\",\n type: __props.elementInfo.points[0],\n color: __props.elementInfo.color,\n baseSize: __props.elementInfo.width\n }, null, 8, [\"id\", \"type\", \"color\", \"baseSize\"]))\n : _createCommentVNode(\"\", true),\n (__props.elementInfo.points[1])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 1,\n id: __props.elementInfo.id,\n position: \"end\",\n type: __props.elementInfo.points[1],\n color: __props.elementInfo.color,\n baseSize: __props.elementInfo.width\n }, null, 8, [\"id\", \"type\", \"color\", \"baseSize\"]))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"path\", {\n d: _unref(path),\n stroke: __props.elementInfo.color,\n \"stroke-width\": __props.elementInfo.width,\n \"stroke-dasharray\": _unref(lineDashArray),\n fill: \"none\",\n \"marker-start\": __props.elementInfo.points[0] ? `url(#${__props.elementInfo.id}-${__props.elementInfo.points[0]}-start)` : '',\n \"marker-end\": __props.elementInfo.points[1] ? `url(#${__props.elementInfo.id}-${__props.elementInfo.points[1]}-end)` : ''\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseLineElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseLineElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseLineElement.vue?vue&type=style&index=0&id=340cdee8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-340cdee8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, inject, PropType, ref } from 'vue'\r\nimport { PPTChartElement } from '@/types/slides'\r\nimport { injectKeySlideScale } from '@/types/injectKey'\r\n\r\nimport ElementOutline from '@/views/components/element/ElementOutline.vue'\r\nimport Chart from './Chart.vue'\r\n\r\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseChartElement',\n props: {\r\n elementInfo: {\r\n type: Object as PropType,\r\n required: true,\r\n },\r\n},\n setup(__props) {\n\r\n\r\n\r\nconst slideScale = inject(injectKeySlideScale) || ref(1)\r\n\r\nconst needScaleSize = computed(() => slideScale.value < 1)\r\nconst zoom = computed(() => needScaleSize.value ? 1 / slideScale.value : 1)\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-chart\",\n style: _normalizeStyle({\r\n top: __props.elementInfo.top + 'px',\r\n left: __props.elementInfo.left + 'px',\r\n width: __props.elementInfo.width + 'px',\r\n height: __props.elementInfo.height + 'px',\r\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\r\n backgroundColor: __props.elementInfo.fill,\r\n })\n }, [\n _createVNode(ElementOutline, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"outline\"]),\n _createVNode(Chart, {\n width: __props.elementInfo.width * _unref(zoom),\n height: __props.elementInfo.height * _unref(zoom),\n type: __props.elementInfo.chartType,\n data: __props.elementInfo.data,\n options: __props.elementInfo.options,\n themeColor: __props.elementInfo.themeColor,\n gridColor: __props.elementInfo.gridColor,\n legends: __props.elementInfo.data.legends,\n legend: __props.elementInfo.legend || '',\n style: _normalizeStyle({ zoom: 1 / _unref(zoom) })\n }, null, 8, [\"width\", \"height\", \"type\", \"data\", \"options\", \"themeColor\", \"gridColor\", \"legends\", \"legend\", \"style\"])\n ], 4)\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseChartElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseChartElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseChartElement.vue?vue&type=style&index=0&id=7d2e5c4e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7d2e5c4e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, vShow as _vShow, normalizeStyle as _normalizeStyle, withDirectives as _withDirectives, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-00712fa4\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\"]\nconst _hoisted_2 = [\"rowspan\", \"colspan\"]\nconst _hoisted_3 = [\"innerHTML\"]\n\nimport { computed, PropType, ref, watch } from 'vue'\nimport { PPTElementOutline, TableCell, TableTheme } from '@/types/slides'\nimport { getTextStyle, formatText } from './utils'\nimport useHideCells from './useHideCells'\nimport useSubThemeColor from './useSubThemeColor'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'StaticTable',\n props: {\n data: {\n type: Array as PropType,\n required: true,\n },\n width: {\n type: Number,\n required: true,\n },\n colWidths: {\n type: Array as PropType,\n required: true,\n },\n outline: {\n type: Object as PropType,\n required: true,\n },\n theme: {\n type: Object as PropType,\n },\n editable: {\n type: Boolean,\n default: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst colSizeList = ref([])\nconst totalWidth = computed(() => colSizeList.value.reduce((a, b) => a + b))\n\nwatch([\n () => props.colWidths,\n () => props.width,\n], () => {\n colSizeList.value = props.colWidths.map(item => item * props.width)\n}, { immediate: true })\n\nconst cells = computed(() => props.data)\nconst { hideCells } = useHideCells(cells)\n\nconst theme = computed(() => props.theme)\nconst { subThemeColor } = useSubThemeColor(theme)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"static-table\",\n style: _normalizeStyle({ width: _unref(totalWidth) + 'px' })\n }, [\n _createElementVNode(\"table\", {\n class: _normalizeClass({\n 'theme': _unref(theme),\n 'row-header': _unref(theme)?.rowHeader,\n 'row-footer': _unref(theme)?.rowFooter,\n 'col-header': _unref(theme)?.colHeader,\n 'col-footer': _unref(theme)?.colFooter,\n }),\n style: _normalizeStyle(`--themeColor: ${_unref(theme)?.color}; --subThemeColor1: ${_unref(subThemeColor)[0]}; --subThemeColor2: ${_unref(subThemeColor)[1]}`)\n }, [\n _createElementVNode(\"colgroup\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(colSizeList.value, (width, index) => {\n return (_openBlock(), _createElementBlock(\"col\", {\n span: \"1\",\n key: index,\n width: width\n }, null, 8, _hoisted_1))\n }), 128))\n ]),\n _createElementVNode(\"tbody\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.data, (rowCells, rowIndex) => {\n return (_openBlock(), _createElementBlock(\"tr\", { key: rowIndex }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(rowCells, (cell, colIndex) => {\n return _withDirectives((_openBlock(), _createElementBlock(\"td\", {\n class: \"cell\",\n style: _normalizeStyle({\n borderStyle: __props.outline.style,\n borderColor: __props.outline.color,\n borderWidth: __props.outline.width + 'px',\n ..._unref(getTextStyle)(cell.style),\n }),\n key: cell.id,\n rowspan: cell.rowspan,\n colspan: cell.colspan\n }, [\n _createElementVNode(\"div\", {\n class: \"cell-text\",\n innerHTML: _unref(formatText)(cell.text)\n }, null, 8, _hoisted_3)\n ], 12, _hoisted_2)), [\n [_vShow, !_unref(hideCells).includes(`${rowIndex}_${colIndex}`)]\n ])\n }), 128))\n ]))\n }), 128))\n ])\n ], 6)\n ], 4))\n}\n}\n\n})","import script from \"./StaticTable.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./StaticTable.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./StaticTable.vue?vue&type=style&index=0&id=00712fa4&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-00712fa4\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-53e0f1ba\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\n\nimport { PropType } from 'vue'\nimport { PPTTableElement } from '@/types/slides'\n\nimport StaticTable from './StaticTable.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseTableElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-table\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createVNode(StaticTable, {\n data: __props.elementInfo.data,\n width: __props.elementInfo.width,\n colWidths: __props.elementInfo.colWidths,\n outline: __props.elementInfo.outline,\n theme: __props.elementInfo.theme\n }, null, 8, [\"data\", \"width\", \"colWidths\", \"outline\", \"theme\"])\n ])\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseTableElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseTableElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseTableElement.vue?vue&type=style&index=0&id=53e0f1ba&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-53e0f1ba\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-9a47b5f4\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\nconst _hoisted_2 = [\"width\", \"height\", \"stroke\", \"stroke-width\"]\nconst _hoisted_3 = [\"transform\"]\nconst _hoisted_4 = [\"d\"]\n\nimport { PropType } from 'vue'\nimport { PPTLatexElement } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseLatexElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-latex\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n stroke: __props.elementInfo.color,\n \"stroke-width\": __props.elementInfo.strokeWidth,\n fill: \"none\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }, [\n _createElementVNode(\"g\", {\n transform: `scale(${__props.elementInfo.width / __props.elementInfo.viewBox[0]}, ${__props.elementInfo.height / __props.elementInfo.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`\n }, [\n _createElementVNode(\"path\", {\n d: __props.elementInfo.path\n }, null, 8, _hoisted_4)\n ], 8, _hoisted_3)\n ], 8, _hoisted_2))\n ])\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseLatexElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseLatexElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseLatexElement.vue?vue&type=style&index=0&id=9a47b5f4&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-9a47b5f4\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { PropType } from 'vue'\nimport { PPTVideoElement } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseVideoElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlayOne = _resolveComponent(\"IconPlayOne\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-video\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({ backgroundImage: `url(${__props.elementInfo.poster})` })\n }, [\n _createVNode(_component_IconPlayOne, { class: \"icon\" })\n ], 4)\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseVideoElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseVideoElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseVideoElement.vue?vue&type=style&index=0&id=56b7f716&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-56b7f716\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, normalizeStyle as _normalizeStyle, createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5258e03b\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\n\nimport { computed, PropType } from 'vue'\nimport { PPTAudioElement } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseAudioElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst audioIconSize = computed(() => {\n return Math.min(props.elementInfo.width, props.elementInfo.height) + 'px'\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconVolumeNotice = _resolveComponent(\"IconVolumeNotice\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-audio\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createVNode(_component_IconVolumeNotice, {\n class: \"audio-icon\",\n style: _normalizeStyle({\n fontSize: _unref(audioIconSize),\n color: __props.elementInfo.color,\n })\n }, null, 8, [\"style\"])\n ])\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseAudioElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseAudioElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseAudioElement.vue?vue&type=style&index=0&id=5258e03b&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5258e03b\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { ElementTypes, PPTElement } from '@/types/slides'\n\nimport BaseImageElement from '@/views/components/element/ImageElement/BaseImageElement.vue'\nimport BaseTextElement from '@/views/components/element/TextElement/BaseTextElement.vue'\nimport BaseShapeElement from '@/views/components/element/ShapeElement/BaseShapeElement.vue'\nimport BaseLineElement from '@/views/components/element/LineElement/BaseLineElement.vue'\nimport BaseChartElement from '@/views/components/element/ChartElement/BaseChartElement.vue'\nimport BaseTableElement from '@/views/components/element/TableElement/BaseTableElement.vue'\nimport BaseLatexElement from '@/views/components/element/LatexElement/BaseLatexElement.vue'\nimport BaseVideoElement from '@/views/components/element/VideoElement/BaseVideoElement.vue'\nimport BaseAudioElement from '@/views/components/element/AudioElement/BaseAudioElement.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ThumbnailElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n elementIndex: {\n type: Number,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst currentElementComponent = computed(() => {\n const elementTypeMap = {\n [ElementTypes.IMAGE]: BaseImageElement,\n [ElementTypes.TEXT]: BaseTextElement,\n [ElementTypes.SHAPE]: BaseShapeElement,\n [ElementTypes.LINE]: BaseLineElement,\n [ElementTypes.CHART]: BaseChartElement,\n [ElementTypes.TABLE]: BaseTableElement,\n [ElementTypes.LATEX]: BaseLatexElement,\n [ElementTypes.VIDEO]: BaseVideoElement,\n [ElementTypes.AUDIO]: BaseAudioElement,\n }\n return elementTypeMap[props.elementInfo.type] || null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"base-element\", `base-element-${__props.elementInfo.id}`]),\n style: _normalizeStyle({\n zIndex: __props.elementIndex,\n })\n }, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentElementComponent)), {\n elementInfo: __props.elementInfo,\n target: \"thumbnail\"\n }, null, 8, [\"elementInfo\"]))\n ], 6))\n}\n}\n\n})","import script from \"./ThumbnailElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ThumbnailElement.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-f69fb5b2\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 1,\n class: \"placeholder\"\n}\n\nimport { computed, PropType, provide } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { Slide } from '@/types/slides'\nimport { injectKeySlideScale } from '@/types/injectKey'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'\n\nimport ThumbnailElement from './ThumbnailElement.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n slide: {\n type: Object as PropType,\n required: true,\n },\n size: {\n type: Number,\n required: true,\n },\n visible: {\n type: Boolean,\n default: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { viewportRatio } = storeToRefs(useSlidesStore())\n\nconst background = computed(() => props.slide.background)\nconst { backgroundStyle } = useSlideBackgroundStyle(background)\n\nconst scale = computed(() => props.size / VIEWPORT_SIZE)\nprovide(injectKeySlideScale, scale)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"thumbnail-slide\",\n style: _normalizeStyle({\n width: __props.size + 'px',\n height: __props.size * _unref(viewportRatio) + 'px',\n })\n }, [\n (__props.visible)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"elements\",\n style: _normalizeStyle({\n width: _unref(VIEWPORT_SIZE) + 'px',\n height: _unref(VIEWPORT_SIZE) * _unref(viewportRatio) + 'px',\n transform: `scale(${_unref(scale)})`,\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"background\",\n style: _normalizeStyle(_unref(backgroundStyle))\n }, null, 4),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.slide.elements, (element, index) => {\n return (_openBlock(), _createBlock(ThumbnailElement, {\n key: element.id,\n elementInfo: element,\n elementIndex: index + 1\n }, null, 8, [\"elementInfo\", \"elementIndex\"]))\n }), 128))\n ], 4))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_1, \"加载中 ...\"))\n ], 4))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=f69fb5b2&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-f69fb5b2\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, createCommentVNode as _createCommentVNode, unref as _unref, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-dfb654e8\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"link-dialog\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = {\n key: 2,\n class: \"preview\"\n}\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", null, \"预览:\", -1))\nconst _hoisted_6 = { class: \"btns\" }\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"确认\")\n\nimport { computed, onMounted, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElementLink } from '@/types/slides'\nimport useLink from '@/hooks/useLink'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\ntype TypeKey = 'web' | 'slide'\ninterface TabItem {\n key: TypeKey\n label: string\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LinkDialog',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { handleElement } = storeToRefs(useMainStore())\nconst { slides } = storeToRefs(useSlidesStore())\n\nconst type = ref('web')\nconst address = ref('')\nconst slideId = ref('')\n\nslideId.value = slides.value[0].id\n\nconst selectedSlide = computed(() => {\n if (!slideId.value) return null\n\n return slides.value.find(item => item.id === slideId.value) || null\n})\n\nconst tabs: TabItem[] = [\n { key: 'web', label: '网页链接' },\n { key: 'slide', label: '幻灯片页面' },\n]\n\nconst { setLink } = useLink()\n\nonMounted(() => {\n if (handleElement.value?.link) {\n if (handleElement.value.link.type === 'web') address.value = handleElement.value.link.target\n else if (handleElement.value.link.type === 'slide') slideId.value = handleElement.value.link.target\n\n type.value = handleElement.value.link.type\n }\n})\n\nconst save = () => {\n const link: PPTElementLink = {\n type: type.value,\n target: type.value === 'web' ? address.value : slideId.value,\n }\n if (handleElement.value) {\n const success = setLink(handleElement.value, link)\n if (success) emit('close')\n else address.value = ''\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Input = _resolveComponent(\"Input\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (tab) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': type.value === tab.key }]),\n key: tab.key,\n onClick: ($event: any) => (type.value = tab.key)\n }, _toDisplayString(tab.label), 11, _hoisted_3)\n }), 64))\n ]),\n (type.value === 'web')\n ? (_openBlock(), _createBlock(_component_Input, {\n key: 0,\n class: \"input\",\n value: address.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((address).value = $event)),\n placeholder: \"请输入网页链接地址\"\n }, null, 8, [\"value\"]))\n : _createCommentVNode(\"\", true),\n (type.value === 'slide')\n ? (_openBlock(), _createBlock(_component_Select, {\n key: 1,\n class: \"input\",\n value: slideId.value,\n \"onUpdate:value\": _cache[1] || (_cache[1] = ($event: any) => ((slideId).value = $event))\n }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: slide.id,\n value: slide.id\n }, {\n default: _withCtx(() => [\n _createTextVNode(\"幻灯片 \" + _toDisplayString(index + 1), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }, 8, [\"value\"]))\n : _createCommentVNode(\"\", true),\n (type.value === 'slide' && _unref(selectedSlide))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_4, [\n _hoisted_5,\n _createVNode(ThumbnailSlide, {\n class: \"thumbnail\",\n slide: _unref(selectedSlide),\n size: 490\n }, null, 8, [\"slide\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(_component_Button, {\n onClick: _cache[2] || (_cache[2] = ($event: any) => (emit('close'))),\n style: {\"margin-right\":\"10px\"}\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n type: \"primary\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (save()))\n }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./LinkDialog.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LinkDialog.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LinkDialog.vue?vue&type=style&index=0&id=dfb654e8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-dfb654e8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, createVNode as _createVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, withCtx as _withCtx, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1db12f3f\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"operates\" }\nconst _hoisted_2 = {\n key: 1,\n class: \"drag-mask\"\n}\n\nimport { onMounted, provide, ref, watch, watchEffect } from 'vue'\nimport { throttle } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore, useKeyboardStore } from '@/store'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport { PPTElement } from '@/types/slides'\nimport { AlignmentLineProps } from '@/types/edit'\nimport { injectKeySlideScale } from '@/types/injectKey'\nimport { removeAllRanges } from '@/utils/selection'\nimport { KEYS } from '@/configs/hotkey'\n\nimport useViewportSize from './hooks/useViewportSize'\nimport useMouseSelection from './hooks/useMouseSelection'\nimport useDropImageOrText from './hooks/useDropImageOrText'\nimport useRotateElement from './hooks/useRotateElement'\nimport useScaleElement from './hooks/useScaleElement'\nimport useSelectElement from './hooks/useSelectElement'\nimport useDragElement from './hooks/useDragElement'\nimport useDragLineElement from './hooks/useDragLineElement'\nimport useMoveShapeKeypoint from './hooks/useMoveShapeKeypoint'\nimport useInsertFromCreateSelection from './hooks/useInsertFromCreateSelection'\n\nimport useDeleteElement from '@/hooks/useDeleteElement'\nimport useCopyAndPasteElement from '@/hooks/useCopyAndPasteElement'\nimport useSelectAllElement from '@/hooks/useSelectAllElement'\nimport useScaleCanvas from '@/hooks/useScaleCanvas'\nimport useScreening from '@/hooks/useScreening'\nimport useSlideHandler from '@/hooks/useSlideHandler'\n\nimport EditableElement from './EditableElement.vue'\nimport MouseSelection from './MouseSelection.vue'\nimport ViewportBackground from './ViewportBackground.vue'\nimport AlignmentLine from './AlignmentLine.vue'\nimport Ruler from './Ruler.vue'\nimport ElementCreateSelection from './ElementCreateSelection.vue'\nimport MultiSelectOperate from './Operate/MultiSelectOperate.vue'\nimport Operate from './Operate/index.vue'\nimport LinkDialog from './LinkDialog.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst {\n activeElementIdList,\n activeGroupElementId,\n handleElementId,\n editorAreaFocus,\n showGridLines,\n showRuler,\n creatingElement,\n canvasScale,\n} = storeToRefs(mainStore)\nconst { currentSlide } = storeToRefs(useSlidesStore())\nconst { ctrlKeyState, spaceKeyState } = storeToRefs(useKeyboardStore())\n\nconst viewportRef = ref()\nconst alignmentLines = ref([])\n\nconst linkDialogVisible = ref(false)\nconst openLinkDialog = () => linkDialogVisible.value = true\n\nwatch(handleElementId, () => {\n mainStore.setActiveGroupElementId('')\n})\n\nconst elementList = ref([])\nconst setLocalElementList = () => {\n elementList.value = currentSlide.value ? JSON.parse(JSON.stringify(currentSlide.value.elements)) : []\n}\nwatchEffect(setLocalElementList)\n\nconst canvasRef = ref()\nconst { dragViewport, viewportStyles } = useViewportSize(canvasRef)\n\nuseDropImageOrText(canvasRef)\n\nconst { mouseSelection, mouseSelectionVisible, mouseSelectionQuadrant, updateMouseSelection } = useMouseSelection(elementList, viewportRef)\n\nconst { dragElement } = useDragElement(elementList, alignmentLines, canvasScale)\nconst { dragLineElement } = useDragLineElement(elementList)\nconst { selectElement } = useSelectElement(elementList, dragElement)\nconst { scaleElement, scaleMultiElement } = useScaleElement(elementList, alignmentLines, canvasScale)\nconst { rotateElement } = useRotateElement(elementList, viewportRef)\nconst { moveShapeKeypoint } = useMoveShapeKeypoint(elementList, canvasScale)\n\nconst { selectAllElement } = useSelectAllElement()\nconst { deleteAllElements } = useDeleteElement()\nconst { pasteElement } = useCopyAndPasteElement()\nconst { enterScreeningFromStart } = useScreening()\nconst { updateSlideIndex } = useSlideHandler()\n\n// 组件渲染时,如果存在元素焦点,需要清除\n// 这种情况存在于:有焦点元素的情况下进入了放映模式,再退出时,需要清除原先的焦点(因为可能已经切换了页面)\nonMounted(() => {\n if (activeElementIdList.value.length) mainStore.setActiveElementIdList([])\n})\n\n// 点击画布的空白区域:清空焦点元素、设置画布焦点、清除文字选区\nconst handleClickBlankArea = (e: MouseEvent) => {\n mainStore.setActiveElementIdList([])\n\n if (!spaceKeyState.value) updateMouseSelection(e)\n else dragViewport(e)\n\n if (!editorAreaFocus.value) mainStore.setEditorareaFocus(true)\n removeAllRanges()\n}\n\n// 移除画布编辑区域焦点\nconst removeEditorAreaFocus = () => {\n if (editorAreaFocus.value) mainStore.setEditorareaFocus(false)\n}\n\n// 滚动鼠标\nconst { scaleCanvas } = useScaleCanvas()\nconst throttleScaleCanvas = throttle(scaleCanvas, 100, { leading: true, trailing: false })\nconst throttleUpdateSlideIndex = throttle(updateSlideIndex, 300, { leading: true, trailing: false })\n\nconst handleMousewheelCanvas = (e: WheelEvent) => {\n e.preventDefault()\n\n // 按住Ctrl键时:缩放画布\n if (ctrlKeyState.value) {\n if (e.deltaY > 0) throttleScaleCanvas('-')\n else if (e.deltaY < 0) throttleScaleCanvas('+')\n }\n // 上下翻页\n else {\n if (e.deltaY > 0) throttleUpdateSlideIndex(KEYS.DOWN)\n else if (e.deltaY < 0) throttleUpdateSlideIndex(KEYS.UP)\n }\n}\n\n// 开关网格线\nconst toggleGridLines = () => {\n mainStore.setGridLinesState(!showGridLines.value)\n}\n\n// 开关标尺\nconst toggleRuler = () => {\n mainStore.setRulerState(!showRuler.value)\n}\n\n// 在鼠标绘制的范围插入元素\nconst { insertElementFromCreateSelection } = useInsertFromCreateSelection(viewportRef)\n\nconst contextmenus = (): ContextmenuItem[] => {\n return [\n {\n text: '粘贴',\n subText: 'Ctrl + V',\n handler: pasteElement,\n },\n {\n text: '全选',\n subText: 'Ctrl + A',\n handler: selectAllElement,\n },\n {\n text: '网格线',\n subText: showGridLines.value ? '√' : '',\n handler: toggleGridLines,\n },\n {\n text: '标尺',\n subText: showRuler.value ? '√' : '',\n handler: toggleRuler,\n },\n {\n text: '重置当前页',\n handler: deleteAllElements,\n },\n { divider: true },\n {\n text: '幻灯片放映',\n subText: 'F5',\n handler: enterScreeningFromStart,\n },\n ]\n}\n\nprovide(injectKeySlideScale, canvasScale)\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Modal = _resolveComponent(\"Modal\")!\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n const _directive_click_outside = _resolveDirective(\"click-outside\")!\n\n return _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"canvas\",\n ref_key: \"canvasRef\",\n ref: canvasRef,\n onWheel: _cache[3] || (_cache[3] = $event => handleMousewheelCanvas($event)),\n onMousedown: _cache[4] || (_cache[4] = $event => handleClickBlankArea($event))\n }, [\n (_unref(creatingElement))\n ? (_openBlock(), _createBlock(ElementCreateSelection, {\n key: 0,\n onCreated: _cache[0] || (_cache[0] = data => _unref(insertElementFromCreateSelection)(data))\n }))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", {\n class: \"viewport-wrapper\",\n style: _normalizeStyle({\n width: _unref(viewportStyles).width * _unref(canvasScale) + 'px',\n height: _unref(viewportStyles).height * _unref(canvasScale) + 'px',\n left: _unref(viewportStyles).left + 'px',\n top: _unref(viewportStyles).top + 'px',\n })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(alignmentLines.value, (line, index) => {\n return (_openBlock(), _createBlock(AlignmentLine, {\n key: index,\n type: line.type,\n axis: line.axis,\n length: line.length,\n canvasScale: _unref(canvasScale)\n }, null, 8, [\"type\", \"axis\", \"length\", \"canvasScale\"]))\n }), 128)),\n (_unref(activeElementIdList).length > 1)\n ? (_openBlock(), _createBlock(MultiSelectOperate, {\n key: 0,\n elementList: elementList.value,\n scaleMultiElement: _unref(scaleMultiElement)\n }, null, 8, [\"elementList\", \"scaleMultiElement\"]))\n : _createCommentVNode(\"\", true),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(elementList.value, (element) => {\n return (_openBlock(), _createBlock(Operate, {\n key: element.id,\n elementInfo: element,\n isSelected: _unref(activeElementIdList).includes(element.id),\n isActive: _unref(handleElementId) === element.id,\n isActiveGroupElement: _unref(activeGroupElementId) === element.id,\n isMultiSelect: _unref(activeElementIdList).length > 1,\n rotateElement: _unref(rotateElement),\n scaleElement: _unref(scaleElement),\n openLinkDialog: openLinkDialog,\n dragLineElement: _unref(dragLineElement),\n moveShapeKeypoint: _unref(moveShapeKeypoint)\n }, null, 8, [\"elementInfo\", \"isSelected\", \"isActive\", \"isActiveGroupElement\", \"isMultiSelect\", \"rotateElement\", \"scaleElement\", \"dragLineElement\", \"moveShapeKeypoint\"]))\n }), 128)),\n _createVNode(ViewportBackground)\n ]),\n _createElementVNode(\"div\", {\n class: \"viewport\",\n ref_key: \"viewportRef\",\n ref: viewportRef,\n style: _normalizeStyle({ transform: `scale(${_unref(canvasScale)})` })\n }, [\n (_unref(mouseSelectionVisible))\n ? (_openBlock(), _createBlock(MouseSelection, {\n key: 0,\n top: _unref(mouseSelection).top,\n left: _unref(mouseSelection).left,\n width: _unref(mouseSelection).width,\n height: _unref(mouseSelection).height,\n quadrant: _unref(mouseSelectionQuadrant)\n }, null, 8, [\"top\", \"left\", \"width\", \"height\", \"quadrant\"]))\n : _createCommentVNode(\"\", true),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(elementList.value, (element, index) => {\n return (_openBlock(), _createBlock(EditableElement, {\n key: element.id,\n elementInfo: element,\n elementIndex: index + 1,\n isMultiSelect: _unref(activeElementIdList).length > 1,\n selectElement: _unref(selectElement),\n openLinkDialog: openLinkDialog\n }, null, 8, [\"elementInfo\", \"elementIndex\", \"isMultiSelect\", \"selectElement\"]))\n }), 128))\n ], 4)\n ], 4),\n (_unref(spaceKeyState))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2))\n : _createCommentVNode(\"\", true),\n (_unref(showRuler))\n ? (_openBlock(), _createBlock(Ruler, {\n key: 2,\n viewportStyles: _unref(viewportStyles)\n }, null, 8, [\"viewportStyles\"]))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_Modal, {\n visible: linkDialogVisible.value,\n \"onUpdate:visible\": _cache[2] || (_cache[2] = ($event: any) => ((linkDialogVisible).value = $event)),\n footer: null,\n centered: \"\",\n width: 540,\n destroyOnClose: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(LinkDialog, {\n onClose: _cache[1] || (_cache[1] = ($event: any) => (linkDialogVisible.value = false))\n })\n ]),\n _: 1\n }, 8, [\"visible\"])\n ], 32)), [\n [_directive_contextmenu, contextmenus],\n [_directive_click_outside, removeEditorAreaFocus]\n ])\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=1db12f3f&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1db12f3f\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5788e0d2\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"shape-pool\" }\nconst _hoisted_2 = { class: \"category-name\" }\nconst _hoisted_3 = { class: \"shape-list\" }\nconst _hoisted_4 = [\"onClick\"]\nconst _hoisted_5 = {\n overflow: \"visible\",\n width: \"18\",\n height: \"18\"\n}\nconst _hoisted_6 = [\"transform\"]\nconst _hoisted_7 = [\"fill\", \"stroke\", \"d\"]\n\nimport { SHAPE_LIST, ShapePoolItem } from '@/configs/shapes'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ShapePool',\n emits: [\"select\"],\n setup(__props, { emit }: { emit: ({\n (event: 'select', payload: ShapePoolItem): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst selectShape = (shape: ShapePoolItem) => {\n emit('select', shape)\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(SHAPE_LIST), (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"category\",\n key: item.type\n }, [\n _createElementVNode(\"div\", _hoisted_2, _toDisplayString(item.type), 1),\n _createElementVNode(\"div\", _hoisted_3, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(item.children, (shape, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"shape-item\",\n key: index\n }, [\n _createElementVNode(\"div\", {\n class: \"shape-content\",\n onClick: ($event: any) => (selectShape(shape))\n }, [\n (_openBlock(), _createElementBlock(\"svg\", _hoisted_5, [\n _createElementVNode(\"g\", {\n transform: `scale(${18 / shape.viewBox[0]}, ${18 / shape.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`\n }, [\n _createElementVNode(\"path\", {\n class: _normalizeClass([\"shape-path\", { 'outlined': shape.outlined }]),\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n fill: shape.outlined ? '#999' : 'transparent',\n stroke: shape.outlined ? 'transparent' : '#999',\n \"stroke-width\": \"2\",\n d: shape.path\n }, null, 10, _hoisted_7)\n ], 8, _hoisted_6)\n ]))\n ], 8, _hoisted_4)\n ]))\n }), 128))\n ])\n ]))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./ShapePool.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ShapePool.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ShapePool.vue?vue&type=style&index=0&id=5788e0d2&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5788e0d2\"]])\n\nexport default __exports__","import { LinePoint } from '@/types/slides'\n\n\nexport interface LinePoolItem {\n path: string\n style: 'solid' | 'dashed'\n points: [LinePoint, LinePoint]\n isBroken?: boolean\n isCurve?: boolean\n isCubic?: boolean\n}\n\ninterface PresetLine {\n type: string\n children: LinePoolItem[]\n}\n\nexport const LINE_LIST: PresetLine[] = [\n {\n type: '直线',\n children: [\n { path: 'M 0 0 L 20 20', style: 'solid', points: ['', ''] },\n { path: 'M 0 0 L 20 20', style: 'dashed', points: ['', ''] },\n { path: 'M 0 0 L 20 20', style: 'solid', points: ['', 'arrow'] },\n { path: 'M 0 0 L 20 20', style: 'dashed', points: ['', 'arrow'] },\n { path: 'M 0 0 L 20 20', style: 'solid', points: ['', 'dot'] },\n ],\n },\n {\n type: '折线、曲线',\n children: [\n { path: 'M 0 0 L 0 20 L 20 20', style: 'solid', points: ['', 'arrow'], isBroken: true },\n { path: 'M 0 0 Q 0 20 20 20', style: 'solid', points: ['', 'arrow'], isCurve: true },\n { path: 'M 0 0 C 20 0 0 20 20 20', style: 'solid', points: ['', 'arrow'], isCubic: true },\n ],\n },\n]","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createBlock as _createBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-bca68faa\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"line-pool\" }\nconst _hoisted_2 = { class: \"category-name\" }\nconst _hoisted_3 = { class: \"line-list\" }\nconst _hoisted_4 = [\"onClick\"]\nconst _hoisted_5 = {\n overflow: \"visible\",\n width: \"20\",\n height: \"20\"\n}\nconst _hoisted_6 = [\"d\", \"stroke-dasharray\", \"marker-start\", \"marker-end\"]\n\nimport { LINE_LIST, LinePoolItem } from '@/configs/lines'\n\nimport LinePointMarker from '@/views/components/element/LineElement/LinePointMarker.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LinePool',\n emits: [\"select\"],\n setup(__props, { emit }: { emit: ({\n (event: 'select', payload: LinePoolItem): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst selectLine = (line: LinePoolItem) => {\n emit('select', line)\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(LINE_LIST), (item, i) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"category\",\n key: item.type\n }, [\n _createElementVNode(\"div\", _hoisted_2, _toDisplayString(item.type), 1),\n _createElementVNode(\"div\", _hoisted_3, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(item.children, (line, j) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"line-item\",\n key: j\n }, [\n _createElementVNode(\"div\", {\n class: \"line-content\",\n onClick: ($event: any) => (selectLine(line))\n }, [\n (_openBlock(), _createElementBlock(\"svg\", _hoisted_5, [\n _createElementVNode(\"defs\", null, [\n (line.points[0])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 0,\n class: \"line-marker\",\n id: `preset-line-${i}-${j}`,\n position: \"start\",\n type: line.points[0],\n color: \"currentColor\",\n baseSize: 2\n }, null, 8, [\"id\", \"type\"]))\n : _createCommentVNode(\"\", true),\n (line.points[1])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 1,\n class: \"line-marker\",\n id: `preset-line-${i}-${j}`,\n position: \"end\",\n type: line.points[1],\n color: \"currentColor\",\n baseSize: 2\n }, null, 8, [\"id\", \"type\"]))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"path\", {\n class: \"line-path\",\n d: line.path,\n stroke: \"currentColor\",\n fill: \"none\",\n \"stroke-width\": \"2\",\n \"stroke-dasharray\": line.style === 'solid' ? '0, 0' : '4, 1',\n \"marker-start\": line.points[0] ? `url(#${`preset-line-${i}-${j}`}-${line.points[0]}-start)` : '',\n \"marker-end\": line.points[1] ? `url(#${`preset-line-${i}-${j}`}-${line.points[1]}-end)` : ''\n }, null, 8, _hoisted_6)\n ]))\n ], 8, _hoisted_4)\n ]))\n }), 128))\n ])\n ]))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./LinePool.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LinePool.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LinePool.vue?vue&type=style&index=0&id=bca68faa&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-bca68faa\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3870b42e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"chart-pool\" }\nconst _hoisted_2 = [\"onClick\"]\n\nimport { PresetChartType } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ChartPool',\n emits: [\"select\"],\n setup(__props, { emit }: { emit: ({\n (event: 'select', payload: PresetChartType): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst chartList: PresetChartType[] = ['bar', 'horizontalBar', 'line', 'area', 'scatter', 'pie', 'ring']\n\nconst selectChart = (chart: PresetChartType) => {\n emit('select', chart)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconChartLine = _resolveComponent(\"IconChartLine\")!\n const _component_IconChartHistogram = _resolveComponent(\"IconChartHistogram\")!\n const _component_IconChartPie = _resolveComponent(\"IconChartPie\")!\n const _component_IconChartHistogramOne = _resolveComponent(\"IconChartHistogramOne\")!\n const _component_IconChartLineArea = _resolveComponent(\"IconChartLineArea\")!\n const _component_IconChartRing = _resolveComponent(\"IconChartRing\")!\n const _component_IconChartScatter = _resolveComponent(\"IconChartScatter\")!\n\n return (_openBlock(), _createElementBlock(\"ul\", _hoisted_1, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(chartList, (chart, index) => {\n return _createElementVNode(\"li\", {\n class: \"chart-item\",\n key: index\n }, [\n _createElementVNode(\"div\", {\n class: \"chart-content\",\n onClick: ($event: any) => (selectChart(chart))\n }, [\n (chart === 'line')\n ? (_openBlock(), _createBlock(_component_IconChartLine, {\n key: 0,\n size: \"24\"\n }))\n : (chart === 'bar')\n ? (_openBlock(), _createBlock(_component_IconChartHistogram, {\n key: 1,\n size: \"24\"\n }))\n : (chart === 'pie')\n ? (_openBlock(), _createBlock(_component_IconChartPie, {\n key: 2,\n size: \"24\"\n }))\n : (chart === 'horizontalBar')\n ? (_openBlock(), _createBlock(_component_IconChartHistogramOne, {\n key: 3,\n size: \"24\"\n }))\n : (chart === 'area')\n ? (_openBlock(), _createBlock(_component_IconChartLineArea, {\n key: 4,\n size: \"24\"\n }))\n : (chart === 'ring')\n ? (_openBlock(), _createBlock(_component_IconChartRing, {\n key: 5,\n size: \"24\"\n }))\n : (chart === 'scatter')\n ? (_openBlock(), _createBlock(_component_IconChartScatter, {\n key: 6,\n size: \"24\"\n }))\n : _createCommentVNode(\"\", true)\n ], 8, _hoisted_2)\n ])\n }), 64))\n ]))\n}\n}\n\n})","import script from \"./ChartPool.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ChartPool.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ChartPool.vue?vue&type=style&index=0&id=3870b42e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-3870b42e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-144fbd05\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"table-generator\" }\nconst _hoisted_2 = { class: \"title\" }\nconst _hoisted_3 = { class: \"lef\" }\nconst _hoisted_4 = [\"onMouseenter\"]\nconst _hoisted_5 = {\n key: 1,\n class: \"custom\"\n}\nconst _hoisted_6 = { class: \"row\" }\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", {\n class: \"label\",\n style: {\"flex\":\"1\"}\n}, \"行数:\", -1))\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", {\n class: \"label\",\n style: {\"flex\":\"1\"}\n}, \"列数:\", -1))\nconst _hoisted_10 = { class: \"btns\" }\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"确认\")\n\nimport { ref } from 'vue'\nimport { message } from 'ant-design-vue'\n\ninterface InsertData {\n row: number\n col: number\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'TableGenerator',\n emits: [\"insert\", \"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'insert', payload: InsertData): void\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst endCell = ref([])\nconst customRow = ref(3)\nconst customCol = ref(3)\nconst isCustom = ref(false)\n\nconst handleClickTable = () => {\n if (!endCell.value.length) return\n const [row, col] = endCell.value\n emit('insert', { row, col })\n}\n\nconst insertCustomTable = () => {\n if (customRow.value < 1 || customRow.value > 20) return message.warning('行数/列数必须在0~20之间!')\n if (customCol.value < 1 || customCol.value > 20) return message.warning('行数/列数必须在0~20之间!')\n emit('insert', { row: customRow.value, col: customCol.value })\n isCustom.value = false\n}\n\nconst close = () => {\n emit('close')\n isCustom.value = false\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, \"表格 \" + _toDisplayString(endCell.value.length ? `${endCell.value[0]} x ${endCell.value[1]}` : ''), 1),\n _createElementVNode(\"div\", {\n class: \"right\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (isCustom.value = !isCustom.value))\n }, _toDisplayString(isCustom.value ? '返回' : '自定义'), 1)\n ]),\n (!isCustom.value)\n ? (_openBlock(), _createElementBlock(\"table\", {\n key: 0,\n onMouseleave: _cache[1] || (_cache[1] = ($event: any) => (endCell.value = [])),\n onClick: _cache[2] || (_cache[2] = ($event: any) => (handleClickTable()))\n }, [\n _createElementVNode(\"tbody\", null, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(10, (row) => {\n return _createElementVNode(\"tr\", { key: row }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(10, (col) => {\n return _createElementVNode(\"td\", {\n onMouseenter: ($event: any) => (endCell.value = [row, col]),\n key: col\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"cell\", { 'active': endCell.value.length && row <= endCell.value[0] && col <= endCell.value[1] }])\n }, null, 2)\n ], 40, _hoisted_4)\n }), 64))\n ])\n }), 64))\n ])\n ], 32))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", _hoisted_6, [\n _hoisted_7,\n _createVNode(_component_InputNumber, {\n min: 1,\n max: 20,\n value: customRow.value,\n \"onUpdate:value\": _cache[3] || (_cache[3] = ($event: any) => ((customRow).value = $event)),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_InputNumber, {\n min: 1,\n max: 20,\n value: customCol.value,\n \"onUpdate:value\": _cache[4] || (_cache[4] = ($event: any) => ((customCol).value = $event)),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _createVNode(_component_Button, {\n class: \"btn\",\n onClick: _cache[5] || (_cache[5] = ($event: any) => (close()))\n }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn\",\n type: \"primary\",\n onClick: _cache[6] || (_cache[6] = ($event: any) => (insertCustomTable()))\n }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n })\n ])\n ]))\n ]))\n}\n}\n\n})","import script from \"./TableGenerator.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./TableGenerator.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./TableGenerator.vue?vue&type=style&index=0&id=144fbd05&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-144fbd05\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-b9437110\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"media-input\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"btns\" }\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"确认\")\nconst _hoisted_7 = { class: \"btns\" }\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"确认\")\n\nimport { ref } from 'vue'\nimport { message } from 'ant-design-vue'\n\ntype TypeKey = 'video' | 'audio'\ninterface TabItem {\n key: TypeKey\n label: string\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MediaInput',\n emits: [\"insertVideo\", \"insertAudio\", \"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'insertVideo', payload: string): void\n (event: 'insertAudio', payload: string): void\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst type = ref('video')\n\nconst videoSrc = ref('https://mazwai.com/videvo_files/video/free/2019-01/small_watermarked/181004_04_Dolphins-Whale_06_preview.webm')\nconst audioSrc = ref('https://freesound.org/data/previews/614/614107_11861866-lq.mp3')\n\nconst tabs: TabItem[] = [\n { key: 'video', label: '视频' },\n { key: 'audio', label: '音频' },\n]\n\nconst insertVideo = () => {\n if (!videoSrc.value) return message.error('请先输入正确的视频地址')\n emit('insertVideo', videoSrc.value)\n}\n\nconst insertAudio = () => {\n if (!audioSrc.value) return message.error('请先输入正确的音频地址')\n emit('insertAudio', audioSrc.value)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Input = _resolveComponent(\"Input\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (tab) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': type.value === tab.key }]),\n key: tab.key,\n onClick: ($event: any) => (type.value = tab.key)\n }, _toDisplayString(tab.label), 11, _hoisted_3)\n }), 64))\n ]),\n (type.value === 'video')\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createVNode(_component_Input, {\n value: videoSrc.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((videoSrc).value = $event)),\n placeholder: \"请输入视频地址,e.g. https://xxx.mp4\"\n }, null, 8, [\"value\"]),\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_Button, {\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emit('close'))),\n style: {\"margin-right\":\"10px\"}\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n type: \"primary\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (insertVideo()))\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n })\n ])\n ], 64))\n : _createCommentVNode(\"\", true),\n (type.value === 'audio')\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n _createVNode(_component_Input, {\n value: audioSrc.value,\n \"onUpdate:value\": _cache[3] || (_cache[3] = ($event: any) => ((audioSrc).value = $event)),\n placeholder: \"请输入音频地址,e.g. https://xxx.mp3\"\n }, null, 8, [\"value\"]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createVNode(_component_Button, {\n onClick: _cache[4] || (_cache[4] = ($event: any) => (emit('close'))),\n style: {\"margin-right\":\"10px\"}\n }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n type: \"primary\",\n onClick: _cache[5] || (_cache[5] = ($event: any) => (insertAudio()))\n }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n })\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./MediaInput.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MediaInput.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MediaInput.vue?vue&type=style&index=0&id=b9437110&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-b9437110\"]])\n\nexport default __exports__","import { hfmath, CONFIG as hfmathConfig } from 'hfmath'\n\nhfmathConfig.SUB_SUP_SCALE = 0.5\n\nexport { hfmath }","export const FORMULA_LIST = [\n {\n label: '高斯公式',\n latex: `\\\\int\\\\int\\\\int _ { \\\\Omega } \\\\left( \\\\frac { \\\\partial {P} } { \\\\partial {x} } + \\\\frac { \\\\partial {Q} } { \\\\partial {y} } + \\\\frac { \\\\partial {R} }{ \\\\partial {z} } \\\\right) \\\\mathrm { d } V = \\\\oint _ { \\\\partial \\\\Omega } ( P \\\\cos \\\\alpha + Q \\\\cos \\\\beta + R \\\\cos \\\\gamma ) \\\\mathrm{ d} S`\n },\n {\n label: '傅里叶级数',\n latex: `f(x) = \\\\frac {a_0} 2 + \\\\sum_{n = 1}^\\\\infty {({a_n}\\\\cos {nx} + {b_n}\\\\sin {nx})}`,\n },\n {\n label: '泰勒展开式',\n latex: `e ^ { x } = 1 + \\\\frac { x } { 1 ! } + \\\\frac { x ^ { 2 } } { 2 ! } + \\\\frac { x ^ { 3 } } { 3 ! } + ... , \\\\quad - \\\\infty < x < \\\\infty`,\n },\n {\n label: '定积分',\n latex: `\\\\lim_ { n \\\\rightarrow + \\\\infty } \\\\sum _ { i = 1 } ^ { n } f \\\\left[ a + \\\\frac { i } { n } ( b - a ) \\\\right] \\\\frac { b - a } { n } = \\\\int _ { a } ^ { b } f ( x ) dx`,\n },\n {\n label: '三角恒等式1',\n latex: `\\\\sin \\\\alpha \\\\pm \\\\sin \\\\beta = 2 \\\\sin \\\\frac { 1 } { 2 } ( \\\\alpha \\\\pm \\\\beta ) \\\\cos \\\\frac { 1 } { 2 } ( \\\\alpha \\\\mp \\\\beta )`,\n },\n {\n label: '三角恒等式2',\n latex: `\\\\cos \\\\alpha + \\\\cos \\\\beta = 2 \\\\cos \\\\frac { 1 } { 2 } ( \\\\alpha + \\\\beta ) \\\\cos \\\\frac { 1 } { 2 } ( \\\\alpha - \\\\beta )`,\n },\n {\n label: '和的展开式',\n latex: `( 1 + x ) ^ { n } = 1 + \\\\frac { n x } { 1 ! } + \\\\frac { n ( n - 1 ) x ^ { 2 } } { 2 ! } + ...`,\n },\n {\n label: '欧拉公式',\n latex: ` e^{ix} = \\\\cos {x} + i\\\\sin {x}`,\n },\n {\n label: '贝努利方程',\n latex: `\\\\frac {dy} {dx} + P(x)y = Q(x) y^n ({n} \\\\not= {0,1})`,\n },\n {\n label: '全微分方程',\n latex: `du(x,y) = P(x,y)dx + Q(x,y)dy = 0`,\n },\n {\n label: '非齐次方程',\n latex: `y = (\\\\int Q(x) e^{\\\\int {P(x)dx}}dx + C)e^{-\\\\int {P(x)dx}}`,\n },\n {\n label: '柯西中值定理',\n latex: `\\\\frac{{f(b) - f(a)}}{{F(b) - F(a)}} = \\\\frac{{f'(\\\\xi )}}{{F'(\\\\xi )}}`,\n },\n {\n label: '拉格朗日中值定理',\n latex: `f(b) - f(a) = f'(\\\\xi )(b - a)`,\n },\n {\n label: '导数公式',\n latex: `(\\\\arcsin x)' = \\\\frac{1}{{\\\\sqrt {1 - x^2} }}`,\n },\n {\n label: '三角函数积分',\n latex: `\\\\int {tgxdx = - \\\\ln \\\\left| {\\\\cos x} \\\\right| + C}`,\n },\n {\n label: '二次曲面',\n latex: `\\\\frac{{{x^2}}}{{{a^2}}} + \\\\frac{{{y^2}}}{{{b^2}}} - \\\\frac{{{z^2}}}{{{c^2}}} = 1`,\n },\n {\n label: '二阶微分',\n latex: `\\\\frac {{d^2}y} {dx^2} + P(x) \\\\frac {dy} {dx} + Q(x)y = f(x)`,\n },\n {\n label: '方向导数',\n latex: `\\\\frac{{\\\\partial f}}{{\\\\partial l}} = \\\\frac{{\\\\partial f}}{{\\\\partial x}}\\\\cos \\\\phi + \\\\frac{{\\\\partial f}}{{\\\\partial y}}\\\\sin \\\\phi`,\n },\n]\n\nexport const SYMBOL_LIST = [\n {\n type: 'operators',\n label: '数学',\n children: [\n { latex: '\\\\cdot' },\n { latex: '\\\\pm' },\n { latex: '\\\\mp' },\n { latex: '+' },\n { latex: '-' },\n { latex: '\\\\times' },\n { latex: '\\\\div' },\n { latex: '<' },\n { latex: '>' },\n { latex: '=' },\n { latex: '\\\\neq\\\\ne' },\n { latex: '\\\\leqq' },\n { latex: '\\\\geqq' },\n { latex: '\\\\leq' },\n { latex: '\\\\geq' },\n { latex: '\\\\propto' },\n { latex: '\\\\sim' },\n { latex: '\\\\equiv' },\n { latex: '\\\\dagger' },\n { latex: '\\\\ddagger' },\n { latex: '\\\\ell' },\n { latex: '\\\\#' },\n { latex: '\\\\$' },\n { latex: '\\\\&' },\n { latex: '\\\\%' },\n { latex: '\\\\langle\\\\rangle' },\n { latex: '()' },\n { latex: '[]' },\n { latex: '\\\\{\\\\}' },\n { latex: '||' },\n { latex: '\\\\|' },\n { latex: '\\\\exists' },\n { latex: '\\\\in' },\n { latex: '\\\\subset' },\n { latex: '\\\\supset' },\n { latex: '\\\\cup' },\n { latex: '\\\\cap' },\n { latex: '\\\\infty' },\n { latex: '\\\\partial' },\n { latex: '\\\\nabla' },\n { latex: '\\\\aleph' },\n { latex: '\\\\wp' },\n { latex: '\\\\therefore' },\n { latex: '\\\\mid' },\n { latex: '\\\\sum' },\n { latex: '\\\\prod' },\n { latex: '\\\\bigoplus' },\n { latex: '\\\\bigodot' },\n { latex: '\\\\int' },\n { latex: '\\\\oint' },\n { latex: '\\\\oplus' },\n { latex: '\\\\odot' },\n { latex: '\\\\perp' },\n { latex: '\\\\angle' },\n { latex: '\\\\triangle' },\n { latex: '\\\\Box' },\n { latex: '\\\\rightarrow' },\n { latex: '\\\\to' },\n { latex: '\\\\leftarrow' },\n { latex: '\\\\gets' },\n { latex: '\\\\circ' },\n { latex: '\\\\bigcirc' },\n { latex: '\\\\bullet' },\n { latex: '\\\\star' },\n { latex: '\\\\diamond' },\n { latex: '\\\\ast' },\n { latex: ',' },\n { latex: '.' },\n { latex: ';' },\n { latex: '!' },\n ],\n },\n {\n type: 'group',\n label: '组合',\n children: [\n { latex: '\\\\frac{a}{b}' },\n { latex: '\\\\frac{dx}{dx}' },\n { latex: '\\\\frac{\\\\partial a}{\\\\partial b}' },\n { latex: '\\\\sqrt{x}' },\n { latex: '\\\\sqrt[n]{x}' },\n { latex: 'x^{n}' },\n { latex: 'x_{n}' },\n { latex: 'x_a^b' },\n { latex: '\\\\int_{a}^{b}' },\n { latex: '\\\\oint_a^b' },\n { latex: '\\\\lim_{a \\\\rightarrow b}' },\n { latex: '\\\\prod_a^b' },\n { latex: '\\\\sum_a^b' },\n { latex: '\\\\left(\\\\begin{array}a \\\\\\\\ b\\\\end{array}\\\\right)' },\n { latex: '\\\\begin{bmatrix}a & b \\\\\\\\ c & d \\\\end{bmatrix}' },\n { latex: '\\\\begin{cases}a & x = 0 \\\\\\\\ b & x > 0\\\\end{cases}' },\n { latex: '\\\\hat{a}' },\n { latex: '\\\\breve{a}' },\n { latex: '\\\\acute{a}' },\n { latex: '\\\\grave{a}' },\n { latex: '\\\\tilde{a}' },\n { latex: '\\\\bar{a}' },\n { latex: '\\\\vec{a}' },\n { latex: '\\\\underline{a}' },\n { latex: '\\\\overline{a}' },\n { latex: '\\\\widehat{ab}' },\n { latex: '\\\\overleftarrow{ab}' },\n { latex: '\\\\overrightarrow{ab}' },\n ],\n },\n {\n type: 'verbatim',\n label: '函数',\n children: [\n { latex: '\\\\log' },\n { latex: '\\\\ln' },\n { latex: '\\\\exp' },\n { latex: '\\\\mod' },\n { latex: '\\\\lim' },\n { latex: '\\\\sin' },\n { latex: '\\\\cos' },\n { latex: '\\\\tan' },\n { latex: '\\\\csc' },\n { latex: '\\\\sec' },\n { latex: '\\\\cot' },\n { latex: '\\\\sinh' },\n { latex: '\\\\cosh' },\n { latex: '\\\\tanh' },\n { latex: '\\\\csch' },\n { latex: '\\\\sech' },\n { latex: '\\\\coth' },\n { latex: '\\\\arcsin' },\n { latex: '\\\\arccos' },\n { latex: '\\\\arctan' },\n { latex: '\\\\arccsc' },\n { latex: '\\\\arcsec' },\n { latex: '\\\\arccot' },\n ],\n },\n {\n type: 'greek',\n label: '希腊字母',\n children: [\n { latex: '\\\\alpha' },\n { latex: '\\\\beta' },\n { latex: '\\\\gamma' },\n { latex: '\\\\delta' },\n { latex: '\\\\varepsilon' },\n { latex: '\\\\zeta' },\n { latex: '\\\\eta' },\n { latex: '\\\\vartheta' },\n { latex: '\\\\iota' },\n { latex: '\\\\kappa' },\n { latex: '\\\\lambda' },\n { latex: '\\\\mu' },\n { latex: '\\\\nu' },\n { latex: '\\\\xi' },\n { latex: '\\\\omicron' },\n { latex: '\\\\pi' },\n { latex: '\\\\rho' },\n { latex: '\\\\sigma' },\n { latex: '\\\\tau' },\n { latex: '\\\\upsilon' },\n { latex: '\\\\varphi' },\n { latex: '\\\\chi' },\n { latex: '\\\\psi' },\n { latex: '\\\\omega' },\n { latex: '\\\\epsilon' },\n { latex: '\\\\theta' },\n { latex: '\\\\phi' },\n { latex: '\\\\varsigma' },\n { latex: '\\\\Alpha' },\n { latex: '\\\\Beta' },\n { latex: '\\\\Gamma' },\n { latex: '\\\\Delta' },\n { latex: '\\\\Epsilon' },\n { latex: '\\\\Zeta' },\n { latex: '\\\\Eta' },\n { latex: '\\\\Theta' },\n { latex: '\\\\Iota' },\n { latex: '\\\\Kappa' },\n { latex: '\\\\Lambda' },\n { latex: '\\\\Mu' },\n { latex: '\\\\Nu' },\n { latex: '\\\\Xi' },\n { latex: '\\\\Omicron' },\n { latex: '\\\\Pi' },\n { latex: '\\\\Rho' },\n { latex: '\\\\Sigma' },\n { latex: '\\\\Tau' },\n { latex: '\\\\Upsilon' },\n { latex: '\\\\Phi' },\n { latex: '\\\\Chi' },\n { latex: '\\\\Psi' },\n { latex: '\\\\Omega' },\n ],\n },\n]","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1c41d9fe\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"transform\"]\nconst _hoisted_3 = [\"d\"]\n\nimport { computed, ref, watch } from 'vue'\nimport { hfmath } from './hfmath'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'FormulaContent',\n props: {\n latex: {\n type: String,\n required: true,\n },\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst box = ref({ x: 0, y: 0, w: 0, h: 0 })\nconst pathd = ref('')\n\nwatch(() => props.latex, () => {\n const eq = new hfmath(props.latex)\n pathd.value = eq.pathd({})\n box.value = eq.box({})\n}, { immediate: true })\n\nconst scale = computed(() => {\n const boxW = box.value.w + 32\n const boxH = box.value.h + 32\n\n if (boxW > props.width || boxH > props.height) {\n if (boxW / boxH > props.width / props.height) return props.width / boxW\n return props.height / boxH\n }\n return 1\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"svg\", {\n class: \"formula-content\",\n overflow: \"visible\",\n width: box.value.w + 32,\n height: box.value.h + 32,\n stroke: \"#000\",\n \"stroke-width\": \"1\",\n fill: \"none\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }, [\n _createElementVNode(\"g\", {\n transform: `scale(${_unref(scale)}, ${_unref(scale)}) translate(0,0) matrix(1,0,0,1,0,0)`,\n \"transform-origin\": \"0 50%\"\n }, [\n _createElementVNode(\"path\", { d: pathd.value }, null, 8, _hoisted_3)\n ], 8, _hoisted_2)\n ], 8, _hoisted_1))\n}\n}\n\n})","import script from \"./FormulaContent.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./FormulaContent.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./FormulaContent.vue?vue&type=style&index=0&id=1c41d9fe&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1c41d9fe\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"innerHTML\"]\n\nimport { computed } from 'vue'\nimport { hfmath } from './hfmath'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SymbolContent',\n props: {\n latex: {\n type: String,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst svg = computed(() => {\n const eq = new hfmath(props.latex)\n return eq.svg({\n SCALE_X: 10,\n SCALE_Y: 10,\n })\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"symbol-content\",\n innerHTML: _unref(svg)\n }, null, 8, _hoisted_1))\n}\n}\n\n})","import script from \"./SymbolContent.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SymbolContent.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, unref as _unref, createTextVNode as _createTextVNode, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-2d73bf28\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"latex-editor\" }\nconst _hoisted_2 = { class: \"container\" }\nconst _hoisted_3 = { class: \"left\" }\nconst _hoisted_4 = { class: \"input-area\" }\nconst _hoisted_5 = { class: \"preview\" }\nconst _hoisted_6 = {\n key: 0,\n class: \"placeholder\"\n}\nconst _hoisted_7 = {\n key: 1,\n class: \"preview-content\"\n}\nconst _hoisted_8 = { class: \"right\" }\nconst _hoisted_9 = { class: \"tabs\" }\nconst _hoisted_10 = [\"onClick\"]\nconst _hoisted_11 = { class: \"content\" }\nconst _hoisted_12 = {\n key: 0,\n class: \"symbol\"\n}\nconst _hoisted_13 = { class: \"symbol-tabs\" }\nconst _hoisted_14 = [\"onClick\"]\nconst _hoisted_15 = { class: \"symbol-pool\" }\nconst _hoisted_16 = [\"onClick\"]\nconst _hoisted_17 = {\n key: 1,\n class: \"formula\"\n}\nconst _hoisted_18 = { class: \"formula-title\" }\nconst _hoisted_19 = [\"onClick\"]\nconst _hoisted_20 = { class: \"footer\" }\nconst _hoisted_21 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_22 = /*#__PURE__*/_createTextVNode(\"确定\")\n\nimport { computed, onMounted, ref } from 'vue'\nimport { hfmath } from './hfmath'\nimport { FORMULA_LIST, SYMBOL_LIST } from '@/configs/latex'\n\nimport FormulaContent from './FormulaContent.vue'\nimport SymbolContent from './SymbolContent.vue'\n\nimport { message } from 'ant-design-vue'\n\ninterface Tab {\n label: string\n value: 'symbol' | 'formula'\n}\n\ninterface LatexResult {\n latex: string\n path: string\n w: number\n h: number\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n value: {\n type: String,\n default: '',\n },\n},\n emits: [\"update\", \"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'update', payload: LatexResult): void\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\nconst tabs: Tab[] = [\n { label: '常用符号', value: 'symbol' },\n { label: '预置公式', value: 'formula' },\n]\n\n\n\n\n\nconst formulaList = FORMULA_LIST\nconst symbolList = SYMBOL_LIST\n\nconst latex = ref('')\nconst toolbarState = ref<'symbol' | 'formula'>('symbol')\nconst textAreaRef = ref()\n\nconst selectedSymbolKey = ref(SYMBOL_LIST[0].type)\nconst symbolPool = computed(() => {\n const selectedSymbol = SYMBOL_LIST.find(item => item.type === selectedSymbolKey.value)\n return selectedSymbol?.children || []\n})\n\nonMounted(() => {\n if (props.value) latex.value = props.value\n})\n\nconst update = () => {\n if (!latex.value) return message.error('公式不能为空')\n\n const eq = new hfmath(latex.value)\n const pathd = eq.pathd({})\n const box = eq.box({})\n \n emit('update', {\n latex: latex.value,\n path: pathd,\n w: box.w + 32,\n h: box.h + 32,\n })\n}\n\nconst insertSymbol = (latex: string) => {\n if (!textAreaRef.value) return\n textAreaRef.value.focus()\n document.execCommand('insertText', false, latex)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_TextArea = _resolveComponent(\"TextArea\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_TextArea, {\n value: latex.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((latex).value = $event)),\n placeholder: \"输入 LaTeX 公式\",\n ref_key: \"textAreaRef\",\n ref: textAreaRef\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n (!latex.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_6, \"公式预览\"))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_7, [\n _createVNode(FormulaContent, {\n width: 518,\n height: 138,\n latex: latex.value\n }, null, 8, [\"latex\"])\n ]))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _createElementVNode(\"div\", _hoisted_9, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (tab) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': tab.value === toolbarState.value }]),\n key: tab.value,\n onClick: ($event: any) => (toolbarState.value = tab.value)\n }, _toDisplayString(tab.label), 11, _hoisted_10)\n }), 64))\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n (toolbarState.value === 'symbol')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_12, [\n _createElementVNode(\"div\", _hoisted_13, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(symbolList), (group) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"symbol-tab\", { 'active': selectedSymbolKey.value === group.type }]),\n key: group.type,\n onClick: ($event: any) => (selectedSymbolKey.value = group.type)\n }, _toDisplayString(group.label), 11, _hoisted_14))\n }), 128))\n ]),\n _createElementVNode(\"div\", _hoisted_15, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(symbolPool), (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"symbol-item\",\n key: item.latex,\n onClick: ($event: any) => (insertSymbol(item.latex))\n }, [\n _createVNode(SymbolContent, {\n latex: item.latex\n }, null, 8, [\"latex\"])\n ], 8, _hoisted_16))\n }), 128))\n ])\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_17, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(formulaList), (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"formula-item\",\n key: item.label\n }, [\n _createElementVNode(\"div\", _hoisted_18, _toDisplayString(item.label), 1),\n _createElementVNode(\"div\", {\n class: \"formula-item-content\",\n onClick: ($event: any) => (latex.value =item.latex)\n }, [\n _createVNode(FormulaContent, {\n width: 236,\n height: 60,\n latex: item.latex\n }, null, 8, [\"latex\"])\n ], 8, _hoisted_19)\n ]))\n }), 128))\n ]))\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_20, [\n _createVNode(_component_Button, {\n class: \"btn\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_21\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn\",\n type: \"primary\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (update()))\n }, {\n default: _withCtx(() => [\n _hoisted_22\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=2d73bf28&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-2d73bf28\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, createVNode as _createVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5d4eff54\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"canvas-tool\" }\nconst _hoisted_2 = { class: \"left-handler\" }\nconst _hoisted_3 = { class: \"add-element-handler\" }\nconst _hoisted_4 = { class: \"right-handler\" }\nconst _hoisted_5 = { class: \"viewport-size-preset\" }\nconst _hoisted_6 = [\"onClick\"]\nconst _hoisted_7 = { class: \"text\" }\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSnapshotStore } from '@/store'\nimport { getImageDataURL } from '@/utils/image'\nimport { ShapePoolItem } from '@/configs/shapes'\nimport { LinePoolItem } from '@/configs/lines'\nimport useScaleCanvas from '@/hooks/useScaleCanvas'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport useCreateElement from '@/hooks/useCreateElement'\n\nimport ShapePool from './ShapePool.vue'\nimport LinePool from './LinePool.vue'\nimport ChartPool from './ChartPool.vue'\nimport TableGenerator from './TableGenerator.vue'\nimport MediaInput from './MediaInput.vue'\nimport LaTeXEditor from '@/components/LaTeXEditor/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst { creatingElement } = storeToRefs(mainStore)\nconst { canUndo, canRedo } = storeToRefs(useSnapshotStore())\n\nconst { redo, undo } = useHistorySnapshot()\n\nconst {\n scaleCanvas,\n setCanvasScalePercentage,\n resetCanvas,\n canvasScalePercentage,\n} = useScaleCanvas()\n\nconst canvasScalePresetList = [200, 150, 100, 80, 50]\nconst canvasScaleVisible = ref(false)\n\nconst applyCanvasPresetScale = (value: number) => {\n setCanvasScalePercentage(value)\n canvasScaleVisible.value = false\n}\n\nconst {\n createImageElement,\n createChartElement,\n createTableElement,\n createLatexElement,\n createVideoElement,\n createAudioElement,\n} = useCreateElement()\n\nconst insertImageElement = (files: FileList) => {\n const imageFile = files[0]\n if (!imageFile) return\n getImageDataURL(imageFile).then(dataURL => createImageElement(dataURL))\n}\n\nconst shapePoolVisible = ref(false)\nconst linePoolVisible = ref(false)\nconst chartPoolVisible = ref(false)\nconst tableGeneratorVisible = ref(false)\nconst mediaInputVisible = ref(false)\nconst latexEditorVisible = ref(false)\n\n// 绘制文字范围\nconst drawText = () => {\n mainStore.setCreatingElement({\n type: 'text',\n })\n}\n\n// 绘制形状范围\nconst drawShape = (shape: ShapePoolItem) => {\n mainStore.setCreatingElement({\n type: 'shape',\n data: shape,\n })\n shapePoolVisible.value = false\n}\n\n// 绘制线条路径\nconst drawLine = (line: LinePoolItem) => {\n mainStore.setCreatingElement({\n type: 'line',\n data: line,\n })\n linePoolVisible.value = false\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconBack = _resolveComponent(\"IconBack\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconNext = _resolveComponent(\"IconNext\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_IconPicture = _resolveComponent(\"IconPicture\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_IconGraphicDesign = _resolveComponent(\"IconGraphicDesign\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconConnection = _resolveComponent(\"IconConnection\")!\n const _component_IconChartProportion = _resolveComponent(\"IconChartProportion\")!\n const _component_IconInsertTable = _resolveComponent(\"IconInsertTable\")!\n const _component_IconFormula = _resolveComponent(\"IconFormula\")!\n const _component_IconVideoTwo = _resolveComponent(\"IconVideoTwo\")!\n const _component_IconMinus = _resolveComponent(\"IconMinus\")!\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_IconFullScreen = _resolveComponent(\"IconFullScreen\")!\n const _component_Modal = _resolveComponent(\"Modal\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"撤销\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconBack, {\n class: _normalizeClass([\"handler-item\", { 'disable': !_unref(canUndo) }]),\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_unref(undo)()))\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"重做\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconNext, {\n class: _normalizeClass([\"handler-item\", { 'disable': !_unref(canRedo) }]),\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_unref(redo)()))\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入文字\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize, {\n class: _normalizeClass([\"handler-item\", { 'active': _unref(creatingElement)?.type === 'text' }]),\n onClick: _cache[2] || (_cache[2] = ($event: any) => (drawText()))\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_FileInput, {\n onChange: _cache[3] || (_cache[3] = files => insertImageElement(files))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入图片\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPicture, { class: \"handler-item\" })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: shapePoolVisible.value,\n \"onUpdate:visible\": _cache[5] || (_cache[5] = ($event: any) => ((shapePoolVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(ShapePool, {\n onSelect: _cache[4] || (_cache[4] = shape => drawShape(shape))\n })\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入形状\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconGraphicDesign, {\n class: _normalizeClass([\"handler-item\", { 'active': _unref(creatingElement)?.type === 'shape' }])\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: linePoolVisible.value,\n \"onUpdate:visible\": _cache[7] || (_cache[7] = ($event: any) => ((linePoolVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(LinePool, {\n onSelect: _cache[6] || (_cache[6] = line => drawLine(line))\n })\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入线条\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconConnection, {\n class: _normalizeClass([\"handler-item\", { 'active': _unref(creatingElement)?.type === 'line' }])\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: chartPoolVisible.value,\n \"onUpdate:visible\": _cache[9] || (_cache[9] = ($event: any) => ((chartPoolVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(ChartPool, {\n onSelect: _cache[8] || (_cache[8] = chart => { _unref(createChartElement)(chart); chartPoolVisible.value = false })\n })\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入图表\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconChartProportion, { class: \"handler-item\" })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: tableGeneratorVisible.value,\n \"onUpdate:visible\": _cache[12] || (_cache[12] = ($event: any) => ((tableGeneratorVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(TableGenerator, {\n onClose: _cache[10] || (_cache[10] = ($event: any) => (tableGeneratorVisible.value = false)),\n onInsert: _cache[11] || (_cache[11] = ({ row, col }) => { _unref(createTableElement)(row, col); tableGeneratorVisible.value = false })\n })\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入表格\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconInsertTable, { class: \"handler-item\" })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入公式\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFormula, {\n class: \"handler-item\",\n onClick: _cache[13] || (_cache[13] = ($event: any) => (latexEditorVisible.value = true))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: mediaInputVisible.value,\n \"onUpdate:visible\": _cache[17] || (_cache[17] = ($event: any) => ((mediaInputVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(MediaInput, {\n onClose: _cache[14] || (_cache[14] = ($event: any) => (mediaInputVisible.value = false)),\n onInsertVideo: _cache[15] || (_cache[15] = src => { _unref(createVideoElement)(src); mediaInputVisible.value = false }),\n onInsertAudio: _cache[16] || (_cache[16] = src => { _unref(createAudioElement)(src); mediaInputVisible.value = false })\n })\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入音视频\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconVideoTwo, { class: \"handler-item\" })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_IconMinus, {\n class: \"handler-item viewport-size\",\n onClick: _cache[18] || (_cache[18] = ($event: any) => (_unref(scaleCanvas)('-')))\n }),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: canvasScaleVisible.value,\n \"onUpdate:visible\": _cache[19] || (_cache[19] = ($event: any) => ((canvasScaleVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_5, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(canvasScalePresetList, (item) => {\n return _createElementVNode(\"div\", {\n class: \"preset-item\",\n key: item,\n onClick: ($event: any) => (applyCanvasPresetScale(item))\n }, _toDisplayString(item) + \"%\", 9, _hoisted_6)\n }), 64))\n ])\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"span\", _hoisted_7, _toDisplayString(_unref(canvasScalePercentage)), 1)\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_IconPlus, {\n class: \"handler-item viewport-size\",\n onClick: _cache[20] || (_cache[20] = ($event: any) => (_unref(scaleCanvas)('+')))\n }),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"适应屏幕\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFullScreen, {\n class: \"handler-item viewport-size-adaptation\",\n onClick: _cache[21] || (_cache[21] = ($event: any) => (_unref(resetCanvas)()))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _createVNode(_component_Modal, {\n visible: latexEditorVisible.value,\n \"onUpdate:visible\": _cache[24] || (_cache[24] = ($event: any) => ((latexEditorVisible).value = $event)),\n footer: null,\n centered: \"\",\n width: 880,\n destroyOnClose: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(LaTeXEditor, {\n onClose: _cache[22] || (_cache[22] = ($event: any) => (latexEditorVisible.value = false)),\n onUpdate: _cache[23] || (_cache[23] = data => { _unref(createLatexElement)(data); latexEditorVisible.value = false })\n })\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=5d4eff54&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5d4eff54\"]])\n\nexport default __exports__","import { ref, onMounted, onUnmounted } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\n\nexport default () => {\n const { slides } = storeToRefs(useSlidesStore())\n\n const timer = ref(null)\n const slidesLoadLimit = ref(50)\n\n const loadSlide = () => {\n if (slides.value.length > slidesLoadLimit.value) {\n timer.value = setTimeout(() => {\n slidesLoadLimit.value = slidesLoadLimit.value + 20\n loadSlide()\n }, 600)\n }\n else slidesLoadLimit.value = 9999\n }\n\n onMounted(loadSlide)\n\n onUnmounted(() => {\n if (timer.value) clearTimeout(timer.value)\n })\n\n return {\n slidesLoadLimit,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-cc6b7dca\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"layout-pool\" }\nconst _hoisted_2 = [\"onClick\"]\n\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { Slide } from '@/types/slides'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LayoutPool',\n emits: [\"select\"],\n setup(__props, { emit }: { emit: ({\n (event: 'select', payload: Slide): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { layouts } = storeToRefs(useSlidesStore())\n\nconst selectSlideTemplate = (slide: Slide) => {\n emit('select', slide)\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(layouts), (slide) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"layout-item\",\n key: slide.id,\n onClick: ($event: any) => (selectSlideTemplate(slide))\n }, [\n _createVNode(ThumbnailSlide, {\n class: \"thumbnail\",\n slide: slide,\n size: 180\n }, null, 8, [\"slide\"])\n ], 8, _hoisted_2))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./LayoutPool.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LayoutPool.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LayoutPool.vue?vue&type=style&index=0&id=cc6b7dca&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-cc6b7dca\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, unref as _unref, createElementVNode as _createElementVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-153c0b44\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"add-slide\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\"添加幻灯片\")\nconst _hoisted_3 = { class: \"select-btn\" }\nconst _hoisted_4 = [\"onMousedown\"]\n\nimport { computed, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore, useKeyboardStore } from '@/store'\nimport { fillDigit } from '@/utils/common'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useSlideHandler from '@/hooks/useSlideHandler'\nimport useScreening from '@/hooks/useScreening'\nimport useLoadSlides from '@/hooks/useLoadSlides'\n\nimport Draggable from 'vuedraggable'\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\nimport LayoutPool from './LayoutPool.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst keyboardStore = useKeyboardStore()\nconst { selectedSlidesIndex: _selectedSlidesIndex, thumbnailsFocus } = storeToRefs(mainStore)\nconst { slides, slideIndex } = storeToRefs(slidesStore)\nconst { ctrlKeyState, shiftKeyState } = storeToRefs(keyboardStore)\n\nconst { slidesLoadLimit } = useLoadSlides()\n\nconst selectedSlidesIndex = computed(() => [..._selectedSlidesIndex.value, slideIndex.value])\n\nconst presetLayoutPopoverVisible = ref(false)\n\nconst {\n copySlide,\n pasteSlide,\n createSlide,\n createSlideByTemplate,\n copyAndPasteSlide,\n deleteSlide,\n cutSlide,\n selectAllSlide,\n} = useSlideHandler()\n\n// 切换页面\nconst changSlideIndex = (index: number) => {\n mainStore.setActiveElementIdList([])\n\n if (slideIndex.value === index) return\n slidesStore.updateSlideIndex(index)\n}\n\n// 点击缩略图\nconst handleClickSlideThumbnail = (e: MouseEvent, index: number) => {\n const isMultiSelected = selectedSlidesIndex.value.length > 1\n\n if (isMultiSelected && selectedSlidesIndex.value.includes(index) && e.button !== 0) return\n\n // 按住Ctrl键,点选幻灯片,再次点击已选中的页面则取消选中\n if (ctrlKeyState.value) {\n if (slideIndex.value === index) {\n if (!isMultiSelected) return\n\n const newSelectedSlidesIndex = selectedSlidesIndex.value.filter(item => item !== index)\n mainStore.updateSelectedSlidesIndex(newSelectedSlidesIndex)\n changSlideIndex(selectedSlidesIndex.value[0])\n }\n else {\n if (selectedSlidesIndex.value.includes(index)) {\n const newSelectedSlidesIndex = selectedSlidesIndex.value.filter(item => item !== index)\n mainStore.updateSelectedSlidesIndex(newSelectedSlidesIndex)\n }\n else {\n const newSelectedSlidesIndex = [...selectedSlidesIndex.value, index]\n mainStore.updateSelectedSlidesIndex(newSelectedSlidesIndex)\n changSlideIndex(index)\n }\n }\n }\n // 按住Shift键,选择范围内的全部幻灯片\n else if (shiftKeyState.value) {\n if (slideIndex.value === index && !isMultiSelected) return\n\n let minIndex = Math.min(...selectedSlidesIndex.value)\n let maxIndex = index\n\n if (index < minIndex) {\n maxIndex = Math.max(...selectedSlidesIndex.value)\n minIndex = index\n }\n\n const newSelectedSlidesIndex = []\n for (let i = minIndex; i <= maxIndex; i++) newSelectedSlidesIndex.push(i)\n mainStore.updateSelectedSlidesIndex(newSelectedSlidesIndex)\n changSlideIndex(index)\n }\n // 正常切换页面\n else {\n mainStore.updateSelectedSlidesIndex([])\n changSlideIndex(index)\n }\n}\n\n// 设置缩略图工具栏聚焦状态(只有聚焦状态下,该部分的快捷键才能生效)\nconst setThumbnailsFocus = (focus: boolean) => {\n if (thumbnailsFocus.value === focus) return\n mainStore.setThumbnailsFocus(focus)\n\n if (!focus) mainStore.updateSelectedSlidesIndex([])\n}\n\n// 拖拽调整顺序后进行数据的同步\nconst handleDragEnd = (eventData: { newIndex: number; oldIndex: number }) => {\n const { newIndex, oldIndex } = eventData\n if (oldIndex === newIndex) return\n\n const _slides = JSON.parse(JSON.stringify(slides.value))\n const _slide = _slides[oldIndex]\n _slides.splice(oldIndex, 1)\n _slides.splice(newIndex, 0, _slide)\n slidesStore.setSlides(_slides)\n slidesStore.updateSlideIndex(newIndex)\n}\n\nconst { enterScreening, enterScreeningFromStart } = useScreening()\n\nconst contextmenusThumbnails = (): ContextmenuItem[] => {\n return [\n {\n text: '粘贴',\n subText: 'Ctrl + V',\n handler: pasteSlide,\n },\n {\n text: '全选',\n subText: 'Ctrl + A',\n handler: selectAllSlide,\n },\n {\n text: '新建页面',\n subText: 'Enter',\n handler: createSlide,\n },\n {\n text: '幻灯片放映',\n subText: 'F5',\n handler: enterScreeningFromStart,\n },\n ]\n}\n\nconst contextmenusThumbnailItem = (): ContextmenuItem[] => {\n return [\n {\n text: '剪切',\n subText: 'Ctrl + X',\n handler: cutSlide,\n },\n {\n text: '复制',\n subText: 'Ctrl + C',\n handler: copySlide,\n },\n {\n text: '粘贴',\n subText: 'Ctrl + V',\n handler: pasteSlide,\n },\n {\n text: '全选',\n subText: 'Ctrl + A',\n handler: selectAllSlide,\n },\n { divider: true },\n {\n text: '新建页面',\n subText: 'Enter',\n handler: createSlide,\n },\n {\n text: '复制页面',\n subText: 'Ctrl + D',\n handler: copyAndPasteSlide,\n },\n {\n text: '删除页面',\n subText: 'Delete',\n handler: () => deleteSlide(),\n },\n { divider: true },\n {\n text: '从当前放映',\n subText: 'Shift + F5',\n handler: enterScreening,\n },\n ]\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_IconDown = _resolveComponent(\"IconDown\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n const _directive_click_outside = _resolveDirective(\"click-outside\")!\n\n return _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"thumbnails\",\n onMousedown: _cache[3] || (_cache[3] = () => setThumbnailsFocus(true))\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"btn\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_unref(createSlide)()))\n }, [\n _createVNode(_component_IconPlus, { class: \"icon\" }),\n _hoisted_2\n ]),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n placement: \"bottomLeft\",\n visible: presetLayoutPopoverVisible.value,\n \"onUpdate:visible\": _cache[2] || (_cache[2] = ($event: any) => ((presetLayoutPopoverVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(LayoutPool, {\n onSelect: _cache[1] || (_cache[1] = slide => { _unref(createSlideByTemplate)(slide); presetLayoutPopoverVisible.value = false })\n })\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_IconDown)\n ])\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]),\n _createVNode(_unref(Draggable), {\n class: \"thumbnail-list\",\n modelValue: _unref(slides),\n animation: 300,\n scroll: true,\n scrollSensitivity: 50,\n setData: null,\n onEnd: handleDragEnd,\n itemKey: \"id\"\n }, {\n item: _withCtx(({ element, index }) => [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"thumbnail-item\", {\n 'active': _unref(slideIndex) === index,\n 'selected': _unref(selectedSlidesIndex).includes(index),\n }]),\n onMousedown: $event => handleClickSlideThumbnail($event, index)\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"label\", { 'offset-left': index >= 99 }])\n }, _toDisplayString(_unref(fillDigit)(index + 1, 2)), 3),\n _createVNode(ThumbnailSlide, {\n class: \"thumbnail\",\n slide: element,\n size: 120,\n visible: index < _unref(slidesLoadLimit)\n }, null, 8, [\"slide\", \"visible\"])\n ], 42, _hoisted_4)), [\n [_directive_contextmenu, contextmenusThumbnailItem]\n ])\n ]),\n _: 1\n }, 8, [\"modelValue\"])\n ], 32)), [\n [_directive_click_outside, () => setThumbnailsFocus(false)],\n [_directive_contextmenu, contextmenusThumbnails]\n ])\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=153c0b44&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-153c0b44\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-22345a51\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-opacity\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"不透明度:\", -1))\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementOpacity',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst opacity = ref(1)\n\nwatch(handleElement, () => {\n if (!handleElement.value) return\n opacity.value = 'opacity' in handleElement.value && handleElement.value.opacity !== undefined ? handleElement.value.opacity : 1\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateOpacity = (value: number) => {\n if (!handleElement.value) return\n const props = { opacity: value }\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Slider = _resolveComponent(\"Slider\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: 0,\n max: 1,\n step: 0.1,\n value: opacity.value,\n onChange: _cache[0] || (_cache[0] = value => updateOpacity(value as number))\n }, null, 8, [\"step\", \"value\"])\n ])\n ]))\n}\n}\n\n})","import script from \"./ElementOpacity.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementOpacity.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementOpacity.vue?vue&type=style&index=0&id=22345a51&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-22345a51\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-ed8f2044\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"color-block\" }\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ColorButton',\n props: {\n color: {\n type: String,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlatte = _resolveComponent(\"IconPlatte\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createBlock(_component_Button, { class: \"color-btn\" }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"content\",\n style: _normalizeStyle({ backgroundColor: __props.color })\n }, null, 4)\n ]),\n _createVNode(_component_IconPlatte, { class: \"color-btn-icon\" })\n ]),\n _: 1\n }))\n}\n}\n\n})","import script from \"./ColorButton.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ColorButton.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ColorButton.vue?vue&type=style&index=0&id=ed8f2044&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-ed8f2044\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-e91e3764\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-outline\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"启用边框:\", -1))\nconst _hoisted_4 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_5 = { class: \"row\" }\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框样式:\", -1))\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"实线边框\")\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"虚线边框\")\nconst _hoisted_9 = { class: \"row\" }\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框颜色:\", -1))\nconst _hoisted_11 = { class: \"row\" }\nconst _hoisted_12 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框粗细:\", -1))\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElementOutline } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from './ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementOutline',\n props: {\n fixed: {\n type: Boolean,\n default: false,\n },\n},\n setup(__props) {\n\n\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst outline = ref()\nconst hasOutline = ref(false)\n\nwatch(handleElement, () => {\n if (!handleElement.value) return\n outline.value = 'outline' in handleElement.value ? handleElement.value.outline : undefined\n hasOutline.value = !!outline.value\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateOutline = (outlineProps: Partial) => {\n if (!handleElement.value) return\n const props = { outline: { ...outline.value, ...outlineProps } }\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\nconst toggleOutline = (checked: boolean) => {\n if (!handleElement.value) return\n if (checked) {\n const _outline: PPTElementOutline = { width: 2, color: '#000', style: 'solid' }\n slidesStore.updateElement({ id: handleElement.value.id, props: { outline: _outline } })\n }\n else {\n slidesStore.removeElementProps({ id: handleElement.value.id, propName: 'outline' })\n }\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (!__props.fixed)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _hoisted_3,\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_Switch, {\n checked: hasOutline.value,\n onChange: _cache[0] || (_cache[0] = checked => toggleOutline(checked as boolean))\n }, null, 8, [\"checked\"])\n ])\n ]))\n : _createCommentVNode(\"\", true),\n (hasOutline.value && outline.value)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n _createElementVNode(\"div\", _hoisted_5, [\n _hoisted_6,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: outline.value.style,\n onChange: _cache[1] || (_cache[1] = value => updateOutline({ style: value as 'dashed' | 'solid' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"solid\" }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"dashed\" }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _hoisted_10,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: outline.value.color,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = value => updateOutline({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: outline.value.color || '#000',\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n _hoisted_12,\n _createVNode(_component_InputNumber, {\n value: outline.value.width,\n onChange: _cache[3] || (_cache[3] = value => updateOutline({ width: value as number })),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ElementOutline.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementOutline.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementOutline.vue?vue&type=style&index=0&id=e91e3764&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-e91e3764\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-053ed706\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-shadow\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"启用阴影:\", -1))\nconst _hoisted_4 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_5 = { class: \"row\" }\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"水平阴影:\", -1))\nconst _hoisted_7 = { class: \"row\" }\nconst _hoisted_8 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"垂直阴影:\", -1))\nconst _hoisted_9 = { class: \"row\" }\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"模糊距离:\", -1))\nconst _hoisted_11 = { class: \"row\" }\nconst _hoisted_12 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"阴影颜色:\", -1))\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElementShadow } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from './ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementShadow',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst shadow = ref()\nconst hasShadow = ref(false)\n\nwatch(handleElement, () => {\n if (!handleElement.value) return\n shadow.value = 'shadow' in handleElement.value ? handleElement.value.shadow : undefined\n hasShadow.value = !!shadow.value\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateShadow = (shadowProps: Partial) => {\n if (!handleElement.value || !shadow.value) return\n const _shadow = { ...shadow.value, ...shadowProps }\n slidesStore.updateElement({ id: handleElement.value.id, props: { shadow: _shadow } })\n addHistorySnapshot()\n}\n\nconst toggleShadow = (checked: boolean) => {\n if (!handleElement.value) return\n if (checked) {\n const _shadow: PPTElementShadow = { h: 1, v: 1, blur: 2, color: '#000' }\n slidesStore.updateElement({ id: handleElement.value.id, props: { shadow: _shadow } })\n }\n else {\n slidesStore.removeElementProps({ id: handleElement.value.id, propName: 'shadow' })\n }\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_Switch, {\n checked: hasShadow.value,\n onChange: _cache[0] || (_cache[0] = checked => toggleShadow(checked as boolean))\n }, null, 8, [\"checked\"])\n ])\n ]),\n (hasShadow.value && shadow.value)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_5, [\n _hoisted_6,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: -10,\n max: 10,\n step: 1,\n value: shadow.value.h,\n onChange: _cache[1] || (_cache[1] = value => updateShadow({ h: value as number }))\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _hoisted_8,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: -10,\n max: 10,\n step: 1,\n value: shadow.value.v,\n onChange: _cache[2] || (_cache[2] = value => updateShadow({ v: value as number }))\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _hoisted_10,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: 1,\n max: 20,\n step: 1,\n value: shadow.value.blur,\n onChange: _cache[3] || (_cache[3] = value => updateShadow({ blur: value as number }))\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n _hoisted_12,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: shadow.value.color,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = value => updateShadow({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: shadow.value.color,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ElementShadow.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementShadow.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementShadow.vue?vue&type=style&index=0&id=053ed706&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-053ed706\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, unref as _unref, withCtx as _withCtx, createBlock as _createBlock, createTextVNode as _createTextVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5830b9cf\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"text-style-panel\" }\nconst _hoisted_2 = { class: \"preset-style\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"+\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"-\")\nconst _hoisted_6 = { class: \"link-popover\" }\nconst _hoisted_7 = { class: \"btns\" }\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"移除\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"确认\")\nconst _hoisted_10 = { class: \"row\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"行间距:\", -1))\nconst _hoisted_12 = { class: \"row\" }\nconst _hoisted_13 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"段间距:\", -1))\nconst _hoisted_14 = { class: \"row\" }\nconst _hoisted_15 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"字间距:\", -1))\nconst _hoisted_16 = { class: \"row\" }\nconst _hoisted_17 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"首行缩进:\", -1))\nconst _hoisted_18 = { class: \"row\" }\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"文本框填充:\", -1))\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTTextElement } from '@/types/slides'\nimport emitter, { EmitterEvents, RichTextAction } from '@/utils/emitter'\nimport { WEB_FONTS } from '@/configs/font'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport { message } from 'ant-design-vue'\n\nimport ElementOpacity from '../common/ElementOpacity.vue'\nimport ElementOutline from '../common/ElementOutline.vue'\nimport ElementShadow from '../common/ElementShadow.vue'\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'TextStylePanel',\n setup(__props) {\n\nconst presetStyles = [\n {\n label: '大标题',\n style: {\n fontSize: '26px',\n fontWeight: 700,\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '48px' },\n { command: 'align', value: 'center' },\n { command: 'bold' },\n ],\n },\n {\n label: '小标题',\n style: {\n fontSize: '22px',\n fontWeight: 700,\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '36px' },\n { command: 'align', value: 'center' },\n { command: 'bold' },\n ],\n },\n {\n label: '正文',\n style: {\n fontSize: '20px',\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '20px' },\n ],\n },\n {\n label: '正文[小]',\n style: {\n fontSize: '18px',\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '18px' },\n ],\n },\n {\n label: '注释 1',\n style: {\n fontSize: '16px',\n fontStyle: 'italic',\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '16px' },\n { command: 'em' },\n ],\n },\n {\n label: '注释 2',\n style: {\n fontSize: '16px',\n textDecoration: 'underline',\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '16px' },\n { command: 'underline' },\n ],\n },\n]\n\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId, richTextAttrs, availableFonts } = storeToRefs(useMainStore())\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateElement = (props: Partial) => {\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\nconst fill = ref('#000')\nconst lineHeight = ref()\nconst wordSpace = ref()\nconst textIndent = ref()\nconst paragraphSpace = ref()\n\nwatch(handleElement, () => {\n if (!handleElement.value || handleElement.value.type !== 'text') return\n\n fill.value = handleElement.value.fill || '#fff'\n lineHeight.value = handleElement.value.lineHeight || 1.5\n wordSpace.value = handleElement.value.wordSpace || 0\n textIndent.value = handleElement.value.textIndent || 0\n paragraphSpace.value = handleElement.value.paragraphSpace === undefined ? 5 : handleElement.value.paragraphSpace\n}, { deep: true, immediate: true })\n\nconst fontSizeOptions = [\n '12px', '14px', '16px', '18px', '20px', '22px', '24px', '28px', '32px',\n '36px', '40px', '44px', '48px', '54px', '60px', '66px', '72px', '76px',\n '80px', '88px', '96px', '104px', '112px', '120px',\n]\nconst lineHeightOptions = [0.9, 1.0, 1.15, 1.2, 1.4, 1.5, 1.8, 2.0, 2.5, 3.0]\nconst wordSpaceOptions = [0, 1, 2, 3, 4, 5, 6, 8, 10]\nconst textIndentOptions = [0, 48, 96, 144, 192, 240, 288, 336]\nconst paragraphSpaceOptions = [0, 5, 10, 15, 20, 25, 30, 40, 50, 80]\n\n// 设置行高\nconst updateLineHeight = (value: number) => {\n updateElement({ lineHeight: value })\n}\n\n// 设置段间距\nconst updateParagraphSpace = (value: number) => {\n updateElement({ paragraphSpace: value })\n}\n\n// 设置字间距\nconst updateWordSpace = (value: number) => {\n updateElement({ wordSpace: value })\n}\n\n// 设置首行缩进\nconst updateTextIndent = (value: number) => {\n updateElement({ textIndent: value })\n}\n\n// 设置文本框填充\nconst updateFill = (value: string) => {\n updateElement({ fill: value })\n}\n\n// 发射富文本设置命令\nconst emitRichTextCommand = (command: string, value?: string) => {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command, value } })\n}\n\n// 发射富文本设置命令(批量)\nconst emitBatchRichTextCommand = (action: RichTextAction[]) => {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action })\n}\n\n// 设置富文本超链接\nconst link = ref('')\nconst linkPopoverVisible = ref(false)\n\nwatch(richTextAttrs, () => linkPopoverVisible.value = false)\n\nconst openLinkPopover = () => {\n link.value = richTextAttrs.value.link\n linkPopoverVisible.value = true\n}\nconst updateLink = (link?: string) => {\n if (link) {\n const linkRegExp = /^(https?):\\/\\/[\\w\\-]+(\\.[\\w\\-]+)+([\\w\\-.,@?^=%&:\\/~+#]*[\\w\\-@?^=%&\\/~+#])?$/\n if (!linkRegExp.test(link)) return message.error('不是正确的网页链接地址')\n }\n emitRichTextCommand('link', link)\n linkPopoverVisible.value = false\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_SelectOptGroup = _resolveComponent(\"SelectOptGroup\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_IconAddText = _resolveComponent(\"IconAddText\")!\n const _component_InputGroup = _resolveComponent(\"InputGroup\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_IconText = _resolveComponent(\"IconText\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconHighLight = _resolveComponent(\"IconHighLight\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconTextBold = _resolveComponent(\"IconTextBold\")!\n const _component_CheckboxButton = _resolveComponent(\"CheckboxButton\")!\n const _component_IconTextItalic = _resolveComponent(\"IconTextItalic\")!\n const _component_IconTextUnderline = _resolveComponent(\"IconTextUnderline\")!\n const _component_IconStrikethrough = _resolveComponent(\"IconStrikethrough\")!\n const _component_IconFormat = _resolveComponent(\"IconFormat\")!\n const _component_CheckboxButtonGroup = _resolveComponent(\"CheckboxButtonGroup\")!\n const _component_IconUpOne = _resolveComponent(\"IconUpOne\")!\n const _component_IconDownOne = _resolveComponent(\"IconDownOne\")!\n const _component_IconCode = _resolveComponent(\"IconCode\")!\n const _component_IconQuote = _resolveComponent(\"IconQuote\")!\n const _component_Input = _resolveComponent(\"Input\")!\n const _component_IconLinkOne = _resolveComponent(\"IconLinkOne\")!\n const _component_IconAlignTextLeft = _resolveComponent(\"IconAlignTextLeft\")!\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_IconAlignTextCenter = _resolveComponent(\"IconAlignTextCenter\")!\n const _component_IconAlignTextRight = _resolveComponent(\"IconAlignTextRight\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_IconList = _resolveComponent(\"IconList\")!\n const _component_IconOrderedList = _resolveComponent(\"IconOrderedList\")!\n const _component_IconIndentLeft = _resolveComponent(\"IconIndentLeft\")!\n const _component_IconIndentRight = _resolveComponent(\"IconIndentRight\")!\n const _component_IconRowHeight = _resolveComponent(\"IconRowHeight\")!\n const _component_IconVerticalSpacingBetweenItems = _resolveComponent(\"IconVerticalSpacingBetweenItems\")!\n const _component_IconFullwidth = _resolveComponent(\"IconFullwidth\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(presetStyles, (item) => {\n return _createElementVNode(\"div\", {\n class: \"preset-style-item\",\n key: item.label,\n style: _normalizeStyle(item.style),\n onClick: ($event: any) => (emitBatchRichTextCommand(item.cmd))\n }, _toDisplayString(item.label), 13, _hoisted_3)\n }), 64))\n ]),\n _createVNode(_component_Divider),\n _createVNode(_component_InputGroup, {\n compact: \"\",\n class: \"row\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(richTextAttrs).fontname,\n onChange: _cache[0] || (_cache[0] = value => emitRichTextCommand('fontname', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconFontSize)\n ]),\n default: _withCtx(() => [\n _createVNode(_component_SelectOptGroup, { label: \"系统字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(availableFonts), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", {\n style: _normalizeStyle({ fontFamily: font.value })\n }, _toDisplayString(font.label), 5)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOptGroup, { label: \"在线字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(WEB_FONTS), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", null, _toDisplayString(font.label), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Select, {\n style: {\"flex\":\"2\"},\n value: _unref(richTextAttrs).fontsize,\n onChange: _cache[1] || (_cache[1] = value => emitRichTextCommand('fontsize', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconAddText)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(fontSizeOptions, (fontsize) => {\n return _createVNode(_component_SelectOption, {\n key: fontsize,\n value: fontsize\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(fontsize), 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).color,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = value => emitRichTextCommand('color', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字颜色\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconText),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).color })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).backcolor,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = value => emitRichTextCommand('backcolor', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字高亮\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconHighLight),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).backcolor })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"增大字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[4] || (_cache[4] = ($event: any) => (emitRichTextCommand('fontsize-add')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_4\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"减小字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[5] || (_cache[5] = ($event: any) => (emitRichTextCommand('fontsize-reduce')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_5\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"加粗\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).bold,\n onClick: _cache[6] || (_cache[6] = ($event: any) => (emitRichTextCommand('bold')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextBold)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"斜体\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).em,\n onClick: _cache[7] || (_cache[7] = ($event: any) => (emitRichTextCommand('em')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextItalic)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下划线\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).underline,\n onClick: _cache[8] || (_cache[8] = ($event: any) => (emitRichTextCommand('underline')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextUnderline)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"删除线\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).strikethrough,\n onClick: _cache[9] || (_cache[9] = ($event: any) => (emitRichTextCommand('strikethrough')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconStrikethrough)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"清除格式\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n onClick: _cache[10] || (_cache[10] = ($event: any) => (emitRichTextCommand('clear')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFormat)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"上标\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).superscript,\n onClick: _cache[11] || (_cache[11] = ($event: any) => (emitRichTextCommand('superscript')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconUpOne)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下标\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).subscript,\n onClick: _cache[12] || (_cache[12] = ($event: any) => (emitRichTextCommand('subscript')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconDownOne)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"行内代码\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).code,\n onClick: _cache[13] || (_cache[13] = ($event: any) => (emitRichTextCommand('code')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconCode)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"引用\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).blockquote,\n onClick: _cache[14] || (_cache[14] = ($event: any) => (emitRichTextCommand('blockquote')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconQuote)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"超链接\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, {\n placement: \"bottomRight\",\n trigger: \"click\",\n visible: linkPopoverVisible.value,\n \"onUpdate:visible\": _cache[19] || (_cache[19] = ($event: any) => ((linkPopoverVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(_component_Input, {\n value: link.value,\n \"onUpdate:value\": _cache[15] || (_cache[15] = ($event: any) => ((link).value = $event)),\n placeholder: \"请输入超链接\"\n }, null, 8, [\"value\"]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createVNode(_component_Button, {\n size: \"small\",\n disabled: !_unref(richTextAttrs).link,\n onClick: _cache[16] || (_cache[16] = ($event: any) => (updateLink())),\n style: {\"margin-right\":\"5px\"}\n }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n }, 8, [\"disabled\"]),\n _createVNode(_component_Button, {\n size: \"small\",\n type: \"primary\",\n onClick: _cache[17] || (_cache[17] = ($event: any) => (updateLink(link.value)))\n }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n })\n ])\n ])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: !!_unref(richTextAttrs).link,\n onClick: _cache[18] || (_cache[18] = ($event: any) => (openLinkPopover()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconLinkOne)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: _unref(richTextAttrs).align,\n onChange: _cache[20] || (_cache[20] = e => emitRichTextCommand('align', e.target.value))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"left\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"center\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextCenter)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"right\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"项目符号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).bulletList,\n onClick: _cache[21] || (_cache[21] = ($event: any) => (emitRichTextCommand('bulletList')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconList)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"编号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).orderedList,\n onClick: _cache[22] || (_cache[22] = ($event: any) => (emitRichTextCommand('orderedList')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconOrderedList)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"减小缩进\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[23] || (_cache[23] = ($event: any) => (emitRichTextCommand('indent', '-1')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconIndentLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"增大缩进\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[24] || (_cache[24] = ($event: any) => (emitRichTextCommand('indent', '+1')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconIndentRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: lineHeight.value,\n onChange: _cache[25] || (_cache[25] = value => updateLineHeight(value as number))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconRowHeight)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(lineHeightOptions, (item) => {\n return _createVNode(_component_SelectOption, {\n key: item,\n value: item\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item) + \"倍\", 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_12, [\n _hoisted_13,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: paragraphSpace.value,\n onChange: _cache[26] || (_cache[26] = value => updateParagraphSpace(value as number))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconVerticalSpacingBetweenItems)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(paragraphSpaceOptions, (item) => {\n return _createVNode(_component_SelectOption, {\n key: item,\n value: item\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item) + \"px\", 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_14, [\n _hoisted_15,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: wordSpace.value,\n onChange: _cache[27] || (_cache[27] = value => updateWordSpace(value as number))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconFullwidth)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(wordSpaceOptions, (item) => {\n return _createVNode(_component_SelectOption, {\n key: item,\n value: item\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item) + \"px\", 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_16, [\n _hoisted_17,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: textIndent.value,\n onChange: _cache[28] || (_cache[28] = value => updateTextIndent(value as number))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconIndentRight)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(textIndentOptions, (item) => {\n return _createVNode(_component_SelectOption, {\n key: item,\n value: item\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item) + \"px\", 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_18, [\n _hoisted_19,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: fill.value,\n \"onUpdate:modelValue\": _cache[29] || (_cache[29] = value => updateFill(value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: fill.value,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_Divider),\n _createVNode(ElementOutline),\n _createVNode(_component_Divider),\n _createVNode(ElementShadow),\n _createVNode(_component_Divider),\n _createVNode(ElementOpacity)\n ]))\n}\n}\n\n})","import script from \"./TextStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./TextStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./TextStylePanel.vue?vue&type=style&index=0&id=5830b9cf&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5830b9cf\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-59a1646e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-flip\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\" 垂直翻转\")\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\" 水平翻转\")\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { ImageOrShapeFlip } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementFlip',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst flipH = ref(false)\nconst flipV = ref(false)\n\nwatch(handleElement, () => {\n if (handleElement.value && (handleElement.value.type === 'image' || handleElement.value.type === 'shape')) {\n flipH.value = !!handleElement.value.flipH\n flipV.value = !!handleElement.value.flipV\n }\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateFlip = (flipProps: ImageOrShapeFlip) => {\n if (!handleElement.value) return\n slidesStore.updateElement({ id: handleElement.value.id, props: flipProps })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconFlipVertically = _resolveComponent(\"IconFlipVertically\")!\n const _component_CheckboxButton = _resolveComponent(\"CheckboxButton\")!\n const _component_IconFlipHorizontally = _resolveComponent(\"IconFlipHorizontally\")!\n const _component_CheckboxButtonGroup = _resolveComponent(\"CheckboxButtonGroup\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: flipV.value,\n onClick: _cache[0] || (_cache[0] = ($event: any) => (updateFlip({ flipV: !flipV.value })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFlipVertically),\n _hoisted_2\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: flipH.value,\n onClick: _cache[1] || (_cache[1] = ($event: any) => (updateFlip({ flipH: !flipH.value })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFlipHorizontally),\n _hoisted_3\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./ElementFlip.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementFlip.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementFlip.vue?vue&type=style&index=0&id=59a1646e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-59a1646e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-37fbdfde\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-filter\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"启用滤镜:\", -1))\nconst _hoisted_4 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_5 = {\n key: 0,\n class: \"filter\"\n}\nconst _hoisted_6 = { class: \"name\" }\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTImageElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface FilterOption {\n label: string\n key: string\n default: number\n value: number\n unit: string\n max: number\n step: number\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementFilter',\n setup(__props) {\n\nconst defaultFilters: FilterOption[] = [\n { label: '模糊', key: 'blur', default: 0, value: 0, unit: 'px', max: 10, step: 1 },\n { label: '亮度', key: 'brightness', default: 100, value: 100, unit: '%', max: 200, step: 5 },\n { label: '对比度', key: 'contrast', default: 100, value: 100, unit: '%', max: 200, step: 5 },\n { label: '灰度', key: 'grayscale', default: 0, value: 0, unit: '%', max: 100, step: 5 },\n { label: '饱和度', key: 'saturate', default: 100, value: 100, unit: '%', max: 200, step: 5 },\n { label: '色相', key: 'hue-rotate', default: 0, value: 0, unit: 'deg', max: 360, step: 10 },\n { label: '不透明度', key: 'opacity', default: 100, value: 100, unit: '%', max: 100, step: 5 },\n]\n\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId } = storeToRefs(useMainStore())\n\nconst filterOptions = ref(JSON.parse(JSON.stringify(defaultFilters)))\nconst hasFilters = ref(false)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nwatch(handleElement, () => {\n if (!handleElement.value || handleElement.value.type !== 'image') return\n \n const filters = handleElement.value.filters\n if (filters) {\n filterOptions.value = defaultFilters.map(item => {\n if (filters[item.key] !== undefined) return { ...item, value: parseInt(filters[item.key]) }\n return item\n })\n hasFilters.value = true\n }\n else {\n filterOptions.value = JSON.parse(JSON.stringify(defaultFilters))\n hasFilters.value = false\n }\n}, { deep: true, immediate: true })\n\n// 设置滤镜\nconst updateFilter = (filter: FilterOption, value: number) => {\n const _handleElement = handleElement.value as PPTImageElement\n \n const originFilters = _handleElement.filters || {}\n const filters = { ...originFilters, [filter.key]: `${value}${filter.unit}` }\n slidesStore.updateElement({ id: handleElementId.value, props: { filters } })\n addHistorySnapshot()\n}\n\nconst toggleFilters = (checked: boolean) => {\n if (!handleElement.value) return\n if (checked) {\n slidesStore.updateElement({ id: handleElement.value.id, props: { filters: {} } })\n }\n else {\n slidesStore.removeElementProps({ id: handleElement.value.id, propName: 'filters' })\n }\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_Switch, {\n checked: hasFilters.value,\n onChange: _cache[0] || (_cache[0] = checked => toggleFilters(checked as boolean))\n }, null, 8, [\"checked\"])\n ])\n ]),\n (hasFilters.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_5, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(filterOptions.value, (filter) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"filter-item\",\n key: filter.key\n }, [\n _createElementVNode(\"div\", _hoisted_6, _toDisplayString(filter.label), 1),\n _createVNode(_component_Slider, {\n class: \"filter-slider\",\n max: filter.max,\n min: 0,\n step: filter.step,\n value: filter.value,\n onChange: value => updateFilter(filter, value as number)\n }, null, 8, [\"max\", \"step\", \"value\", \"onChange\"])\n ]))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ElementFilter.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementFilter.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementFilter.vue?vue&type=style&index=0&id=37fbdfde&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-37fbdfde\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, createVNode as _createVNode, resolveComponent as _resolveComponent, createTextVNode as _createTextVNode, withCtx as _withCtx, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-7da35bec\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"image-style-panel\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\" 裁剪图片\")\nconst _hoisted_3 = { class: \"clip\" }\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"按形状:\", -1))\nconst _hoisted_5 = { class: \"shape-clip\" }\nconst _hoisted_6 = [\"onClick\"]\nconst _hoisted_7 = {\n key: 0,\n class: \"title\"\n}\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\" 替换图片\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\" 重置样式\")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\" 设为背景\")\n\nimport { Ref, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTImageElement, SlideBackground } from '@/types/slides'\nimport { CLIPPATHS } from '@/configs/imageClip'\nimport { getImageDataURL } from '@/utils/image'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementOutline from '../common/ElementOutline.vue'\nimport ElementShadow from '../common/ElementShadow.vue'\nimport ElementFlip from '../common/ElementFlip.vue'\nimport ElementFilter from '../common/ElementFilter.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ImageStylePanel',\n setup(__props) {\n\nconst shapeClipPathOptions = CLIPPATHS\nconst ratioClipOptions = [\n {\n label: '纵横比(方形)',\n children: [\n { key: '1:1', ratio: 1 / 1 },\n ],\n },\n {\n label: '纵横比(纵向)',\n children: [\n { key: '2:3', ratio: 3 / 2 },\n { key: '3:4', ratio: 4 / 3 },\n { key: '3:5', ratio: 5 / 3 },\n { key: '4:5', ratio: 5 / 4 },\n ],\n },\n {\n label: '纵横比(横向)',\n children: [\n { key: '3:2', ratio: 2 / 3 },\n { key: '4:3', ratio: 3 / 4 },\n { key: '5:3', ratio: 3 / 5 },\n { key: '5:4', ratio: 4 / 5 },\n ],\n },\n {\n children: [\n { key: '16:9', ratio: 9 / 16 },\n { key: '16:10', ratio: 10 / 16 },\n ],\n },\n]\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId } = storeToRefs(mainStore)\nconst { currentSlide } = storeToRefs(slidesStore)\n\nconst handleImageElement = handleElement as Ref\n\nconst clipPanelVisible = ref(false)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 打开自由裁剪\nconst clipImage = () => {\n mainStore.setClipingImageElementId(handleElementId.value)\n clipPanelVisible.value = false\n}\n\n// 获取原始图片的位置大小\nconst getImageElementDataBeforeClip = () => {\n const _handleElement = handleElement.value as PPTImageElement\n\n // 图片当前的位置大小和裁剪范围\n const imgWidth = _handleElement.width\n const imgHeight = _handleElement.height\n const imgLeft = _handleElement.left\n const imgTop = _handleElement.top\n const originClipRange: [[number, number], [number, number]] = _handleElement.clip ? _handleElement.clip.range : [[0, 0], [100, 100]]\n\n const originWidth = imgWidth / ((originClipRange[1][0] - originClipRange[0][0]) / 100)\n const originHeight = imgHeight / ((originClipRange[1][1] - originClipRange[0][1]) / 100)\n const originLeft = imgLeft - originWidth * (originClipRange[0][0] / 100)\n const originTop = imgTop - originHeight * (originClipRange[0][1] / 100)\n\n return {\n originClipRange,\n originWidth,\n originHeight,\n originLeft,\n originTop,\n }\n}\n\n// 预设裁剪\nconst presetImageClip = (shape: string, ratio = 0) => {\n const _handleElement = handleElement.value as PPTImageElement\n\n const {\n originClipRange,\n originWidth,\n originHeight,\n originLeft,\n originTop,\n } = getImageElementDataBeforeClip()\n \n // 纵横比裁剪(形状固定为矩形)\n if (ratio) {\n const imageRatio = originHeight / originWidth\n\n const min = 0\n const max = 100\n let range: [[number, number], [number, number]]\n\n if (imageRatio > ratio) {\n const distance = ((1 - ratio / imageRatio) / 2) * 100\n range = [[min, distance], [max, max - distance]]\n }\n else {\n const distance = ((1 - imageRatio / ratio) / 2) * 100\n range = [[distance, min], [max - distance, max]]\n }\n slidesStore.updateElement({\n id: handleElementId.value,\n props: {\n clip: { ..._handleElement.clip, shape, range },\n left: originLeft + originWidth * (range[0][0] / 100),\n top: originTop + originHeight * (range[0][1] / 100),\n width: originWidth * (range[1][0] - range[0][0]) / 100,\n height: originHeight * (range[1][1] - range[0][1]) / 100,\n },\n })\n }\n // 形状裁剪(保持当前裁剪范围)\n else {\n slidesStore.updateElement({\n id: handleElementId.value,\n props: {\n clip: { ..._handleElement.clip, shape, range: originClipRange }\n },\n })\n }\n clipImage()\n addHistorySnapshot()\n}\n\n// 替换图片(保持当前的样式)\nconst replaceImage = (files: FileList) => {\n const imageFile = files[0]\n if (!imageFile) return\n getImageDataURL(imageFile).then(dataURL => {\n const props = { src: dataURL }\n slidesStore.updateElement({ id: handleElementId.value, props })\n })\n addHistorySnapshot()\n}\n\n// 重置图片:清除全部样式\nconst resetImage = () => {\n const _handleElement = handleElement.value as PPTImageElement\n\n if (_handleElement.clip) {\n const {\n originWidth,\n originHeight,\n originLeft,\n originTop,\n } = getImageElementDataBeforeClip()\n\n slidesStore.updateElement({\n id: handleElementId.value,\n props: {\n left: originLeft,\n top: originTop,\n width: originWidth,\n height: originHeight,\n },\n })\n }\n\n slidesStore.removeElementProps({\n id: handleElementId.value,\n propName: ['clip', 'outline', 'flip', 'shadow', 'filters'],\n })\n addHistorySnapshot()\n}\n\n// 将图片设置为背景\nconst setBackgroundImage = () => {\n const _handleElement = handleElement.value as PPTImageElement\n\n const background: SlideBackground = {\n ...currentSlide.value.background,\n type: 'image',\n image: _handleElement.src,\n imageSize: 'cover',\n }\n slidesStore.updateSlide({ background })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconTailoring = _resolveComponent(\"IconTailoring\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconDown = _resolveComponent(\"IconDown\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconTransform = _resolveComponent(\"IconTransform\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_IconUndo = _resolveComponent(\"IconUndo\")!\n const _component_IconTheme = _resolveComponent(\"IconTheme\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"origin-image\",\n style: _normalizeStyle({ backgroundImage: `url(${_unref(handleImageElement).src})` })\n }, null, 4),\n _createVNode(ElementFlip),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"5\"},\n onClick: _cache[0] || (_cache[0] = ($event: any) => (clipImage()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTailoring, { class: \"btn-icon\" }),\n _hoisted_2\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: clipPanelVisible.value,\n \"onUpdate:visible\": _cache[1] || (_cache[1] = ($event: any) => ((clipPanelVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_3, [\n _hoisted_4,\n _createElementVNode(\"div\", _hoisted_5, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(shapeClipPathOptions), (item, key) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"shape-clip-item\",\n key: key,\n onClick: ($event: any) => (presetImageClip(key))\n }, [\n _createElementVNode(\"div\", {\n class: \"shape\",\n style: _normalizeStyle({ clipPath: item.style })\n }, null, 4)\n ], 8, _hoisted_6))\n }), 128))\n ]),\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(ratioClipOptions, (type) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: type.label\n }, [\n (type.label)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_7, \"按\" + _toDisplayString(type.label) + \":\", 1))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(type.children, (item) => {\n return (_openBlock(), _createBlock(_component_Button, {\n style: {\"flex\":\"1\"},\n key: item.key,\n onClick: ($event: any) => (presetImageClip('rect', item.ratio))\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item.key), 1)\n ]),\n _: 2\n }, 1032, [\"onClick\"]))\n }), 128))\n ]),\n _: 2\n }, 1024)\n ], 64))\n }), 64))\n ])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"no-padding\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconDown)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _createVNode(ElementFilter),\n _createVNode(_component_Divider),\n _createVNode(ElementOutline),\n _createVNode(_component_Divider),\n _createVNode(ElementShadow),\n _createVNode(_component_Divider),\n _createVNode(_component_FileInput, {\n onChange: _cache[2] || (_cache[2] = files => replaceImage(files))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, { class: \"full-width-btn\" }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTransform, { class: \"btn-icon\" }),\n _hoisted_8\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"full-width-btn\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (resetImage()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconUndo, { class: \"btn-icon\" }),\n _hoisted_9\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"full-width-btn\",\n onClick: _cache[4] || (_cache[4] = ($event: any) => (setBackgroundImage()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTheme, { class: \"btn-icon\" }),\n _hoisted_10\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./ImageStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImageStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImageStylePanel.vue?vue&type=style&index=0&id=7da35bec&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7da35bec\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock, Fragment as _Fragment, unref as _unref, renderList as _renderList, toDisplayString as _toDisplayString, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-02998580\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"shape-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\"纯色填充\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"渐变填充\")\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"1\"} }, null, -1))\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"线性渐变\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"径向渐变\")\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"起点颜色:\", -1))\nconst _hoisted_10 = { class: \"row\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"终点颜色:\", -1))\nconst _hoisted_12 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_13 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"渐变角度:\", -1))\nconst _hoisted_14 = /*#__PURE__*/_createTextVNode(\"+\")\nconst _hoisted_15 = /*#__PURE__*/_createTextVNode(\"-\")\n\nimport { Ref, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTShapeElement, ShapeGradient, ShapeText } from '@/types/slides'\nimport { WEB_FONTS } from '@/configs/font'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementOpacity from '../common/ElementOpacity.vue'\nimport ElementOutline from '../common/ElementOutline.vue'\nimport ElementShadow from '../common/ElementShadow.vue'\nimport ElementFlip from '../common/ElementFlip.vue'\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ShapeStylePanel',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId, richTextAttrs, availableFonts } = storeToRefs(mainStore)\n\nconst handleShapeElement = handleElement as Ref\n\nconst fill = ref('#000')\nconst gradient = ref({\n type: 'linear', \n rotate: 0,\n color: ['#fff', '#fff'],\n})\nconst fillType = ref('fill')\nconst textAlign = ref('middle')\n\nwatch(handleElement, () => {\n if (!handleElement.value || handleElement.value.type !== 'shape') return\n\n fill.value = handleElement.value.fill || '#fff'\n gradient.value = handleElement.value.gradient || { type: 'linear', rotate: 0, color: [fill.value, '#fff'] }\n fillType.value = handleElement.value.gradient ? 'gradient' : 'fill'\n textAlign.value = handleElement.value?.text?.align || 'middle'\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateElement = (props: Partial) => {\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 设置填充类型:渐变、纯色\nconst updateFillType = (type: 'gradient' | 'fill') => {\n if (type === 'fill') {\n slidesStore.removeElementProps({ id: handleElementId.value, propName: 'gradient' })\n addHistorySnapshot()\n }\n else updateElement({ gradient: gradient.value })\n}\n\n// 设置渐变填充\nconst updateGradient = (gradientProps: Partial) => {\n if (!gradient.value) return\n const _gradient: ShapeGradient = { ...gradient.value, ...gradientProps }\n updateElement({ gradient: _gradient })\n}\n\n// 设置填充色\nconst updateFill = (value: string) => {\n updateElement({ fill: value })\n}\n\nconst updateTextAlign = (align: 'top' | 'middle' | 'bottom') => {\n const _handleElement = handleElement.value as PPTShapeElement\n \n const defaultText: ShapeText = {\n content: '',\n defaultFontName: '微软雅黑',\n defaultColor: '#000',\n align: 'middle',\n }\n const _text = _handleElement.text || defaultText\n updateElement({ text: { ..._text, align } })\n}\n\nconst fontSizeOptions = [\n '12px', '14px', '16px', '18px', '20px', '22px', '24px', '28px', '32px',\n '36px', '40px', '44px', '48px', '54px', '60px', '66px', '72px', '76px',\n '80px', '88px', '96px', '104px', '112px', '120px',\n]\n\nconst emitRichTextCommand = (command: string, value?: string) => {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command, value } })\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_SelectOptGroup = _resolveComponent(\"SelectOptGroup\")!\n const _component_IconAddText = _resolveComponent(\"IconAddText\")!\n const _component_InputGroup = _resolveComponent(\"InputGroup\")!\n const _component_IconText = _resolveComponent(\"IconText\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconHighLight = _resolveComponent(\"IconHighLight\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconTextBold = _resolveComponent(\"IconTextBold\")!\n const _component_CheckboxButton = _resolveComponent(\"CheckboxButton\")!\n const _component_IconTextItalic = _resolveComponent(\"IconTextItalic\")!\n const _component_IconTextUnderline = _resolveComponent(\"IconTextUnderline\")!\n const _component_IconFormat = _resolveComponent(\"IconFormat\")!\n const _component_CheckboxButtonGroup = _resolveComponent(\"CheckboxButtonGroup\")!\n const _component_IconAlignTextLeft = _resolveComponent(\"IconAlignTextLeft\")!\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_IconAlignTextCenter = _resolveComponent(\"IconAlignTextCenter\")!\n const _component_IconAlignTextRight = _resolveComponent(\"IconAlignTextRight\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_IconAlignTextTopOne = _resolveComponent(\"IconAlignTextTopOne\")!\n const _component_IconAlignTextMiddleOne = _resolveComponent(\"IconAlignTextMiddleOne\")!\n const _component_IconAlignTextBottomOne = _resolveComponent(\"IconAlignTextBottomOne\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_Select, {\n style: {\"flex\":\"10\"},\n value: fillType.value,\n onChange: _cache[0] || (_cache[0] = value => updateFillType(value as 'fill' | 'gradient'))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"fill\" }, {\n default: _withCtx(() => [\n _hoisted_3\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"gradient\" }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _hoisted_5,\n (fillType.value === 'fill')\n ? (_openBlock(), _createBlock(_component_Popover, {\n key: 0,\n trigger: \"click\"\n }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: fill.value,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = value => updateFill(value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: fill.value,\n style: {\"flex\":\"10\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n }))\n : (_openBlock(), _createBlock(_component_Select, {\n key: 1,\n style: {\"flex\":\"10\"},\n value: gradient.value.type,\n onChange: _cache[2] || (_cache[2] = value => updateGradient({ type: value as 'linear' | 'radial' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"linear\" }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"radial\" }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]))\n ]),\n (fillType.value === 'gradient')\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: gradient.value.color[0],\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = value => updateGradient({ color: [value, gradient.value.color[1]] }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: gradient.value.color[0],\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: gradient.value.color[1],\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = value => updateGradient({ color: [gradient.value.color[0], value] }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: gradient.value.color[1],\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n (gradient.value.type === 'linear')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_12, [\n _hoisted_13,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: 0,\n max: 360,\n step: 15,\n value: gradient.value.rotate,\n onChange: _cache[5] || (_cache[5] = value => updateGradient({ rotate: value as number }))\n }, null, 8, [\"value\"])\n ]))\n : _createCommentVNode(\"\", true)\n ], 64))\n : _createCommentVNode(\"\", true),\n _createVNode(ElementFlip),\n _createVNode(_component_Divider),\n (_unref(handleShapeElement).text?.content)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n _createVNode(_component_InputGroup, {\n compact: \"\",\n class: \"row\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(richTextAttrs).fontname,\n onChange: _cache[6] || (_cache[6] = value => emitRichTextCommand('fontname', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconFontSize)\n ]),\n default: _withCtx(() => [\n _createVNode(_component_SelectOptGroup, { label: \"系统字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(availableFonts), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", {\n style: _normalizeStyle({ fontFamily: font.value })\n }, _toDisplayString(font.label), 5)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOptGroup, { label: \"在线字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(WEB_FONTS), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", null, _toDisplayString(font.label), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Select, {\n style: {\"flex\":\"2\"},\n value: _unref(richTextAttrs).fontsize,\n onChange: _cache[7] || (_cache[7] = value => emitRichTextCommand('fontsize', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconAddText)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(fontSizeOptions, (fontsize) => {\n return _createVNode(_component_SelectOption, {\n key: fontsize,\n value: fontsize\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(fontsize), 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).color,\n \"onUpdate:modelValue\": _cache[8] || (_cache[8] = value => emitRichTextCommand('color', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字颜色\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconText),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).color })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).backcolor,\n \"onUpdate:modelValue\": _cache[9] || (_cache[9] = value => emitRichTextCommand('backcolor', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字高亮\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconHighLight),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).backcolor })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"增大字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[10] || (_cache[10] = ($event: any) => (emitRichTextCommand('fontsize-add')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_14\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"减小字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[11] || (_cache[11] = ($event: any) => (emitRichTextCommand('fontsize-reduce')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_15\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"加粗\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).bold,\n onClick: _cache[12] || (_cache[12] = ($event: any) => (emitRichTextCommand('bold')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextBold)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"斜体\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).em,\n onClick: _cache[13] || (_cache[13] = ($event: any) => (emitRichTextCommand('em')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextItalic)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下划线\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).underline,\n onClick: _cache[14] || (_cache[14] = ($event: any) => (emitRichTextCommand('underline')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextUnderline)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"清除格式\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n onClick: _cache[15] || (_cache[15] = ($event: any) => (emitRichTextCommand('clear')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFormat)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: _unref(richTextAttrs).align,\n onChange: _cache[16] || (_cache[16] = e => emitRichTextCommand('align', e.target.value))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"left\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"center\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextCenter)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"right\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: textAlign.value,\n onChange: _cache[17] || (_cache[17] = e => updateTextAlign(e.target.value))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"顶对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"top\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextTopOne)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"middle\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextMiddleOne)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"底对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"bottom\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextBottomOne)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Divider)\n ], 64))\n : _createCommentVNode(\"\", true),\n _createVNode(ElementOutline),\n _createVNode(_component_Divider),\n _createVNode(ElementShadow),\n _createVNode(_component_Divider),\n _createVNode(ElementOpacity)\n ]))\n}\n}\n\n})","import script from \"./ShapeStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ShapeStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ShapeStylePanel.vue?vue&type=style&index=0&id=02998580&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-02998580\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-938968a2\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"line-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"线条样式:\", -1))\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"实线\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"虚线\")\nconst _hoisted_6 = { class: \"row\" }\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"线条颜色:\", -1))\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"线条宽度:\", -1))\nconst _hoisted_10 = { class: \"row\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"起点样式:\", -1))\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"无\")\nconst _hoisted_13 = /*#__PURE__*/_createTextVNode(\"箭头\")\nconst _hoisted_14 = /*#__PURE__*/_createTextVNode(\"圆点\")\nconst _hoisted_15 = { class: \"row\" }\nconst _hoisted_16 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"终点样式:\", -1))\nconst _hoisted_17 = /*#__PURE__*/_createTextVNode(\"无\")\nconst _hoisted_18 = /*#__PURE__*/_createTextVNode(\"箭头\")\nconst _hoisted_19 = /*#__PURE__*/_createTextVNode(\"圆点\")\n\nimport { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTLineElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementShadow from '../common/ElementShadow.vue'\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LineStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst handleLineElement = handleElement as Ref\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateLine = (props: Partial) => {\n if (!handleElement.value) return\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(handleLineElement).style,\n onChange: _cache[0] || (_cache[0] = value => updateLine({ style: value as 'solid' | 'dashed' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"solid\" }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"dashed\" }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_6, [\n _hoisted_7,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(handleLineElement).color,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = value => updateLine({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(handleLineElement).color,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_InputNumber, {\n value: _unref(handleLineElement).width,\n onChange: _cache[2] || (_cache[2] = value => updateLine({ width: value as number })),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(handleLineElement).points[0],\n onChange: _cache[3] || (_cache[3] = value => updateLine({ points: [value as 'arrow' | 'dot', _unref(handleLineElement).points[1]] }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"\" }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"arrow\" }, {\n default: _withCtx(() => [\n _hoisted_13\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"dot\" }, {\n default: _withCtx(() => [\n _hoisted_14\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_15, [\n _hoisted_16,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(handleLineElement).points[1],\n onChange: _cache[4] || (_cache[4] = value => updateLine({ points: [_unref(handleLineElement).points[0], value as 'arrow' | 'dot'] }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"\" }, {\n default: _withCtx(() => [\n _hoisted_17\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"arrow\" }, {\n default: _withCtx(() => [\n _hoisted_18\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"dot\" }, {\n default: _withCtx(() => [\n _hoisted_19\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createVNode(_component_Divider),\n _createVNode(ElementShadow)\n ]))\n}\n}\n\n})","import script from \"./LineStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LineStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LineStylePanel.vue?vue&type=style&index=0&id=938968a2&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-938968a2\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, withModifiers as _withModifiers, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-53b32689\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"chart-data-editor\" }\nconst _hoisted_2 = { class: \"editor-content\" }\nconst _hoisted_3 = { class: \"range-box\" }\nconst _hoisted_4 = [\"id\", \"onFocus\", \"onPaste\"]\nconst _hoisted_5 = { class: \"btns\" }\nconst _hoisted_6 = { class: \"left\" }\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"清空\")\nconst _hoisted_8 = { class: \"right\" }\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"确认\")\n\nimport { computed, onMounted, onUnmounted, PropType, ref } from 'vue'\nimport { ChartData } from '@/types/slides'\nimport { KEYS } from '@/configs/hotkey'\nimport { pasteCustomClipboardString, pasteExcelClipboardString } from '@/utils/clipboard'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ChartDataEditor',\n props: {\n data: {\n type: Object as PropType,\n required: true,\n }\n},\n emits: [\"save\", \"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'save', payload: ChartData): void\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst CELL_WIDTH = 100\nconst CELL_HEIGHT = 32\n\nconst selectedRange = ref([0, 0])\nconst tempRangeSize = ref({ width: 0, height: 0 })\nconst focusCell = ref<[number, number] | null>(null)\n\n// 当前选区的边框线条位置\nconst rangeLines = computed(() => {\n const width = selectedRange.value[0] * CELL_WIDTH\n const height = selectedRange.value[1] * CELL_HEIGHT\n return [\n { type: 't', style: {width: width + 'px'} },\n { type: 'b', style: {top: height + 'px', width: width + 'px'} },\n { type: 'l', style: {height: height + 'px'} },\n { type: 'r', style: {left: width + 'px', height: height + 'px'} },\n ]\n})\n\n// 当前选区的缩放点位置\nconst resizablePointStyle = computed(() => {\n const width = selectedRange.value[0] * CELL_WIDTH\n const height = selectedRange.value[1] * CELL_HEIGHT\n return { left: width + 'px', top: height + 'px' }\n})\n\n// 初始化图表数据:将数据格式化并填充到DOM\nconst initData = () => {\n const _data: string[][] = []\n\n const { labels, legends, series } = props.data\n const rowCount = labels.length\n const colCount = series.length\n\n _data.push(['', ...legends])\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n const row = [labels[rowIndex]]\n for (let colIndex = 0; colIndex < colCount; colIndex++) {\n row.push(series[colIndex][rowIndex] + '')\n }\n _data.push(row)\n }\n\n for (let rowIndex = 0; rowIndex < rowCount + 1; rowIndex++) {\n for (let colIndex = 0; colIndex < colCount + 1; colIndex++) {\n const inputRef = document.querySelector(`#cell-${rowIndex}-${colIndex}`) as HTMLInputElement\n if (!inputRef) continue\n inputRef.value = _data[rowIndex][colIndex] + ''\n }\n }\n\n selectedRange.value = [colCount + 1, rowCount + 1]\n}\n\nonMounted(initData)\n\n// 快捷键监听:回车移动焦点到下一行\nconst moveNextRow = () => {\n if (!focusCell.value) return\n\n const [rowIndex, colIndex] = focusCell.value\n const inputRef = document.querySelector(`#cell-${rowIndex + 1}-${colIndex}`) as HTMLInputElement\n inputRef && inputRef.focus()\n}\n\nconst keyboardListener = (e: KeyboardEvent) => {\n const key = e.key.toUpperCase()\n if (key === KEYS.ENTER) moveNextRow()\n}\n\nonMounted(() => {\n document.addEventListener('keydown', keyboardListener)\n})\nonUnmounted(() => {\n document.removeEventListener('keydown', keyboardListener)\n})\n\n// 获取当前图表DOM中的数据,整理格式化后传递出去\nconst getTableData = () => {\n const [col, row] = selectedRange.value\n\n const labels: string[] = []\n const legends: string[] = []\n const series: number[][] = []\n\n // 第一行为系列名,第一列为项目名,实际数据从第二行第二列开始\n for (let rowIndex = 1; rowIndex < row; rowIndex++) {\n let labelsItem = `类别${rowIndex}`\n const labelInputRef = document.querySelector(`#cell-${rowIndex}-0`) as HTMLInputElement\n if (labelInputRef && labelInputRef.value) labelsItem = labelInputRef.value\n labels.push(labelsItem)\n }\n for (let colIndex = 1; colIndex < col; colIndex++) {\n let legendsItem = `系列${colIndex}`\n const labelInputRef = document.querySelector(`#cell-0-${colIndex}`) as HTMLInputElement\n if (labelInputRef && labelInputRef.value) legendsItem = labelInputRef.value\n legends.push(legendsItem)\n }\n\n for (let colIndex = 1; colIndex < col; colIndex++) {\n const seriesItem = []\n for (let rowIndex = 1; rowIndex < row; rowIndex++) {\n const valueInputRef = document.querySelector(`#cell-${rowIndex}-${colIndex}`) as HTMLInputElement\n let value = 0\n if (valueInputRef && valueInputRef.value && !!(+valueInputRef.value)) {\n value = +valueInputRef.value\n }\n seriesItem.push(value)\n }\n series.push(seriesItem)\n }\n\n emit('save', { labels, legends, series })\n}\n\n// 清空表格数据\nconst clear = () => {\n for (let rowIndex = 1; rowIndex < 31; rowIndex++) {\n for (let colIndex = 1; colIndex < 7; colIndex++) {\n const inputRef = document.querySelector(`#cell-${rowIndex}-${colIndex}`) as HTMLInputElement\n if (!inputRef) continue\n inputRef.value = ''\n }\n }\n}\n\n// 自定义粘贴事件(尝试读取剪贴板中的表格数据)\nconst handlePaste = (e: ClipboardEvent, rowIndex: number, colIndex: number) => {\n e.preventDefault()\n\n if (!e.clipboardData) return\n\n const clipboardDataFirstItem = e.clipboardData.items[0]\n\n if (clipboardDataFirstItem && clipboardDataFirstItem.kind === 'string' && clipboardDataFirstItem.type === 'text/plain') {\n clipboardDataFirstItem.getAsString(text => {\n const clipboardData = pasteCustomClipboardString(text)\n if (typeof clipboardData === 'object') return\n \n const excelData = pasteExcelClipboardString(text)\n if (excelData) {\n const maxRow = rowIndex + excelData.length\n const maxCol = colIndex + excelData[0].length\n for (let i = rowIndex; i < maxRow; i++) {\n for (let j = colIndex; j < maxCol; j++) {\n const inputRef = document.querySelector(`#cell-${i}-${j}`) as HTMLInputElement\n if (!inputRef) continue\n inputRef.value = excelData[i - rowIndex][j - colIndex]\n }\n }\n }\n })\n }\n}\n\n// 关闭图表数据编辑器\nconst closeEditor = () => emit('close')\n\n// 鼠标拖拽修改选中的数据范围\nconst changeSelectRange = (e: MouseEvent) => {\n let isMouseDown = true\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n\n const originWidth = selectedRange.value[0] * CELL_WIDTH\n const originHeight = selectedRange.value[1] * CELL_HEIGHT\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n const x = currentPageX - startPageX\n const y = currentPageY - startPageY\n\n const width = originWidth + x\n const height = originHeight + y\n\n tempRangeSize.value = { width, height }\n }\n\n document.onmouseup = e => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n const endPageX = e.pageX\n const endPageY = e.pageY\n\n if (startPageX === endPageX && startPageY === endPageY) return\n\n // 拖拽结束时,范围超过格子一半自动扩大到下一格(如拖动到一格半多的位置,会自动扩展到两格,横竖都同理)\n let width = tempRangeSize.value.width\n let height = tempRangeSize.value.height\n if (width % CELL_WIDTH > CELL_WIDTH * 0.5) width = width + (CELL_WIDTH - width % CELL_WIDTH)\n if (height % CELL_HEIGHT > CELL_HEIGHT * 0.5) height = height + (CELL_HEIGHT - height % CELL_HEIGHT)\n\n let row = Math.round(height / CELL_HEIGHT)\n let col = Math.round(width / CELL_WIDTH)\n\n if (row < 3) row = 3\n if (col < 2) col = 2\n\n selectedRange.value = [col, row]\n tempRangeSize.value = { width: 0, height: 0 }\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", {\n class: \"temp-range\",\n style: _normalizeStyle({\n width: tempRangeSize.value.width + 'px',\n height: tempRangeSize.value.height + 'px',\n })\n }, null, 4),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(rangeLines), (line) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass(['range-line', line.type]),\n key: line.type,\n style: _normalizeStyle(line.style)\n }, null, 6))\n }), 128)),\n _createElementVNode(\"div\", {\n class: \"resizable\",\n style: _normalizeStyle(_unref(resizablePointStyle)),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (changeSelectRange($event)), [\"stop\"]))\n }, null, 36)\n ]),\n _createElementVNode(\"table\", null, [\n _createElementVNode(\"tbody\", null, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(31, (rowIndex) => {\n return _createElementVNode(\"tr\", { key: rowIndex }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(7, (colIndex) => {\n return _createElementVNode(\"td\", {\n key: colIndex,\n class: _normalizeClass({ 'head': (colIndex === 1 && rowIndex <= selectedRange.value[1]) || (rowIndex === 1 && colIndex <= selectedRange.value[0]) })\n }, [\n _createElementVNode(\"input\", {\n class: _normalizeClass(['item', { 'selected': rowIndex <= selectedRange.value[1] && colIndex <= selectedRange.value[0] }]),\n id: `cell-${rowIndex - 1}-${colIndex - 1}`,\n autocomplete: \"off\",\n onFocus: ($event: any) => (focusCell.value = [rowIndex - 1, colIndex - 1]),\n onPaste: $event => handlePaste($event, rowIndex - 1, colIndex - 1)\n }, null, 42, _hoisted_4)\n ], 2)\n }), 64))\n ])\n }), 64))\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(_component_Button, {\n class: \"btn\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (clear()))\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _createVNode(_component_Button, {\n class: \"btn\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (closeEditor()))\n }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n type: \"primary\",\n class: \"btn\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (getTableData())),\n style: {\"margin-left\":\"10px\"}\n }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n })\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./ChartDataEditor.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ChartDataEditor.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ChartDataEditor.vue?vue&type=style&index=0&id=53b32689&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-53b32689\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, unref as _unref, createElementVNode as _createElementVNode, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, toDisplayString as _toDisplayString, withModifiers as _withModifiers, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-769d6876\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"chart-style-panel\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\" 编辑图表数据 \")\nconst _hoisted_3 = { class: \"row\" }\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"面积图样式\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"散点图样式\")\nconst _hoisted_6 = { class: \"row\" }\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"使用平滑曲线\")\nconst _hoisted_8 = {\n key: 1,\n class: \"row\"\n}\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"条形图样式\")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"堆叠样式\")\nconst _hoisted_11 = {\n key: 2,\n class: \"row\"\n}\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"环形图样式\")\nconst _hoisted_13 = { class: \"row\" }\nconst _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"图例:\", -1))\nconst _hoisted_15 = /*#__PURE__*/_createTextVNode(\"不显示\")\nconst _hoisted_16 = /*#__PURE__*/_createTextVNode(\"显示在上方\")\nconst _hoisted_17 = /*#__PURE__*/_createTextVNode(\"显示在下方\")\nconst _hoisted_18 = { class: \"row\" }\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"背景填充:\", -1))\nconst _hoisted_20 = { class: \"row\" }\nconst _hoisted_21 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"网格颜色:\", -1))\nconst _hoisted_22 = { style: {\"flex\":\"2\"} }\nconst _hoisted_23 = {\n class: \"color-btn-wrap\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_24 = [\"onClick\"]\nconst _hoisted_25 = { class: \"preset-themes\" }\nconst _hoisted_26 = [\"onClick\", \"onMouseenter\"]\nconst _hoisted_27 = /*#__PURE__*/_createTextVNode(\"推荐主题\")\nconst _hoisted_28 = /*#__PURE__*/_createTextVNode(\" 添加主题色 \")\n\nimport { onUnmounted, Ref, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { ChartData, ChartOptions, PPTChartElement } from '@/types/slides'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementOutline from '../../common/ElementOutline.vue'\nimport ColorButton from '../../common/ColorButton.vue'\nimport ChartDataEditor from './ChartDataEditor.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst presetChartThemes = [\n ['#d87c7c', '#919e8b', '#d7ab82', '#6e7074', '#61a0a8', '#efa18d'],\n ['#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53', '#eedd78'],\n ['#516b91', '#59c4e6', '#edafda', '#93b7e3', '#a5e7f0', '#cbb0e3'],\n ['#893448', '#d95850', '#eb8146', '#ffb248', '#f2d643', '#ebdba4'],\n ['#4ea397', '#22c3aa', '#7bd9a5', '#d0648a', '#f58db2', '#f2b3c9'],\n ['#3fb1e3', '#6be6c1', '#626c91', '#a0a7e6', '#c4ebad', '#96dee8'],\n ['#fc97af', '#87f7cf', '#f7f494', '#72ccff', '#f7c5a0', '#d4a4eb'],\n ['#c1232b', '#27727b', '#fcce10', '#e87c25', '#b5c334', '#fe8463'],\n ['#2ec7c9', '#b6a2de', '#5ab1ef', '#ffb980', '#d87a80', '#8d98b3'],\n ['#e01f54', '#001852', '#f5e8c8', '#b8d2c7', '#c6b38e', '#a4d8c2'],\n ['#c12e34', '#e6b600', '#0098d9', '#2b821d', '#005eaa', '#339ca8'],\n ['#8a7ca8', '#e098c7', '#8fd3e8', '#71669e', '#cc70af', '#7cb4cc'],\n]\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId } = storeToRefs(mainStore)\nconst { theme } = storeToRefs(slidesStore)\n\nconst handleChartElement = handleElement as Ref\n\nconst chartDataEditorVisible = ref(false)\nconst presetThemesVisible = ref(false)\nconst presetThemeColorHoverIndex = ref<[number, number]>([-1, -1])\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst fill = ref('#000')\n\nconst themeColor = ref([])\nconst gridColor = ref('')\nconst legend = ref('')\n\nconst lineSmooth = ref(true)\nconst showLine = ref(true)\nconst showArea = ref(false)\nconst horizontalBars = ref(false)\nconst donut = ref(false)\nconst stackBars = ref(false)\n\nwatch(handleElement, () => {\n if (!handleElement.value || handleElement.value.type !== 'chart') return\n fill.value = handleElement.value.fill || '#fff'\n\n if (handleElement.value.options) {\n const {\n lineSmooth: _lineSmooth,\n showLine: _showLine,\n showArea: _showArea,\n horizontalBars: _horizontalBars,\n donut: _donut,\n stackBars: _stackBars,\n } = handleElement.value.options\n\n if (_lineSmooth !== undefined) lineSmooth.value = _lineSmooth as boolean\n if (_showLine !== undefined) showLine.value = _showLine\n if (_showArea !== undefined) showArea.value = _showArea\n if (_horizontalBars !== undefined) horizontalBars.value = _horizontalBars\n if (_donut !== undefined) donut.value = _donut\n if (_stackBars !== undefined) stackBars.value = _stackBars\n }\n\n themeColor.value = handleElement.value.themeColor\n gridColor.value = handleElement.value.gridColor || '#333'\n legend.value = handleElement.value.legend || ''\n}, { deep: true, immediate: true })\n\nconst updateElement = (props: Partial) => {\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 设置图表数据\nconst updateData = (data: ChartData) => {\n chartDataEditorVisible.value = false\n updateElement({ data })\n}\n\n// 设置填充色\nconst updateFill = (value: string) => {\n updateElement({ fill: value })\n}\n\n// 设置其他选项:柱状图转条形图、折线图转面积图、折线图转散点图、饼图转环形图、折线图开关平滑曲线\nconst updateOptions = (optionProps: ChartOptions) => {\n const _handleElement = handleElement.value as PPTChartElement\n\n const newOptions = { ..._handleElement.options, ...optionProps }\n updateElement({ options: newOptions })\n}\n\n// 设置主题色\nconst updateTheme = (color: string, index: number) => {\n const props = {\n themeColor: themeColor.value.map((c, i) => i === index ? color : c),\n }\n updateElement(props)\n}\n\n// 添加主题色\nconst addThemeColor = () => {\n const props = {\n themeColor: [...themeColor.value, theme.value.themeColor],\n }\n updateElement(props)\n}\n\n// 使用预置主题配色\nconst applyPresetTheme = (colors: string[], index: number) => {\n const themeColor = colors.slice(0, index + 1)\n updateElement({ themeColor })\n presetThemesVisible.value = false\n}\n\n// 删除主题色\nconst deleteThemeColor = (index: number) => {\n const props = {\n themeColor: themeColor.value.filter((c, i) => i !== index),\n }\n updateElement(props)\n}\n\n// 设置网格颜色\nconst updateGridColor = (gridColor: string) => {\n updateElement({ gridColor })\n}\n\n// 设置图例位置/不显示\nconst updateLegend = (legend: '' | 'top' | 'bottom') => {\n updateElement({ legend })\n}\n\nconst openDataEditor = () => chartDataEditorVisible.value = true\n\nemitter.on(EmitterEvents.OPEN_CHART_DATA_EDITOR, openDataEditor)\nonUnmounted(() => {\n emitter.off(EmitterEvents.OPEN_CHART_DATA_EDITOR, openDataEditor)\n})\n\n// handleElement: handleElement as Ref,\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconEdit = _resolveComponent(\"IconEdit\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_Checkbox = _resolveComponent(\"Checkbox\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconCloseSmall = _resolveComponent(\"IconCloseSmall\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_Modal = _resolveComponent(\"Modal\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_Button, {\n class: \"full-width-btn\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (chartDataEditorVisible.value = true))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconEdit, { class: \"btn-icon\" }),\n _hoisted_2\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n (_unref(handleChartElement).chartType === 'line')\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[1] || (_cache[1] = e => updateOptions({ showArea: e.target.checked })),\n checked: showArea.value,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_Checkbox, {\n onChange: _cache[2] || (_cache[2] = e => updateOptions({ showLine: !e.target.checked })),\n checked: !showLine.value,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[3] || (_cache[3] = e => updateOptions({ lineSmooth: e.target.checked })),\n checked: lineSmooth.value\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n }, 8, [\"checked\"])\n ])\n ], 64))\n : _createCommentVNode(\"\", true),\n (_unref(handleChartElement).chartType === 'bar')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_8, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[4] || (_cache[4] = e => updateOptions({ horizontalBars: e.target.checked })),\n checked: horizontalBars.value\n }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_Checkbox, {\n onChange: _cache[5] || (_cache[5] = e => updateOptions({ stackBars: e.target.checked })),\n checked: stackBars.value\n }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]))\n : _createCommentVNode(\"\", true),\n (_unref(handleChartElement).chartType === 'pie')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_11, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[6] || (_cache[6] = e => updateOptions({ donut: e.target.checked })),\n checked: donut.value\n }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_13, [\n _hoisted_14,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: legend.value,\n onChange: _cache[7] || (_cache[7] = value => updateLegend(value as '' | 'top' | 'bottom'))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"\" }, {\n default: _withCtx(() => [\n _hoisted_15\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"top\" }, {\n default: _withCtx(() => [\n _hoisted_16\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"bottom\" }, {\n default: _withCtx(() => [\n _hoisted_17\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_18, [\n _hoisted_19,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: fill.value,\n \"onUpdate:modelValue\": _cache[8] || (_cache[8] = value => updateFill(value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: fill.value,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_20, [\n _hoisted_21,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: gridColor.value,\n \"onUpdate:modelValue\": _cache[9] || (_cache[9] = value => updateGridColor(value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: gridColor.value,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_Divider),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(themeColor.value, (color, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"row\",\n key: index\n }, [\n _createElementVNode(\"div\", _hoisted_22, _toDisplayString(index === 0 ? '主题配色:' : ''), 1),\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: color,\n \"onUpdate:modelValue\": value => updateTheme(value, index)\n }, null, 8, [\"modelValue\", \"onUpdate:modelValue\"])\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_23, [\n _createVNode(ColorButton, {\n color: color,\n style: {\"width\":\"100%\"}\n }, null, 8, [\"color\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"删除\"\n }, {\n default: _withCtx(() => [\n (index !== 0)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"delete-color-btn\",\n onClick: _withModifiers(($event: any) => (deleteThemeColor(index)), [\"stop\"])\n }, [\n _createVNode(_component_IconCloseSmall)\n ], 8, _hoisted_24))\n : _createCommentVNode(\"\", true)\n ]),\n _: 2\n }, 1032, [\"mouseEnterDelay\"])\n ])\n ]),\n _: 2\n }, 1024)\n ]))\n }), 128)),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: presetThemesVisible.value,\n \"onUpdate:visible\": _cache[11] || (_cache[11] = ($event: any) => ((presetThemesVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_25, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(presetChartThemes, (item, index) => {\n return _createElementVNode(\"div\", {\n class: \"preset-theme\",\n key: index\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(item, (color, itemIndex) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"preset-theme-color\", { 'select': presetThemeColorHoverIndex.value[0] === index && itemIndex <= presetThemeColorHoverIndex.value[1] }]),\n key: color,\n style: _normalizeStyle({ backgroundColor: color }),\n onClick: ($event: any) => (applyPresetTheme(item, itemIndex)),\n onMouseenter: ($event: any) => (presetThemeColorHoverIndex.value = [index, itemIndex]),\n onMouseleave: _cache[10] || (_cache[10] = ($event: any) => (presetThemeColorHoverIndex.value = [-1, -1]))\n }, null, 46, _hoisted_26))\n }), 128))\n ])\n }), 64))\n ])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"no-padding\",\n style: {\"flex\":\"2\"}\n }, {\n default: _withCtx(() => [\n _hoisted_27\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_Button, {\n class: \"no-padding\",\n disabled: themeColor.value.length >= 10,\n style: {\"flex\":\"3\"},\n onClick: _cache[12] || (_cache[12] = ($event: any) => (addThemeColor()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPlus, { class: \"btn-icon\" }),\n _hoisted_28\n ]),\n _: 1\n }, 8, [\"disabled\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _createVNode(ElementOutline),\n _createVNode(_component_Modal, {\n visible: chartDataEditorVisible.value,\n \"onUpdate:visible\": _cache[15] || (_cache[15] = ($event: any) => ((chartDataEditorVisible).value = $event)),\n footer: null,\n centered: \"\",\n closable: false,\n width: 648,\n destroyOnClose: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(ChartDataEditor, {\n data: _unref(handleChartElement).data,\n onClose: _cache[13] || (_cache[13] = ($event: any) => (chartDataEditorVisible.value = false)),\n onSave: _cache[14] || (_cache[14] = value => updateData(value))\n }, null, 8, [\"data\"])\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=769d6876&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-769d6876\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, withCtx as _withCtx, createBlock as _createBlock, createTextVNode as _createTextVNode, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-7e28e1d8\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"table-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"行数:\", -1))\nconst _hoisted_4 = {\n class: \"set-count\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_5 = { class: \"count-text\" }\nconst _hoisted_6 = { class: \"row\" }\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"列数:\", -1))\nconst _hoisted_8 = {\n class: \"set-count\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_9 = { class: \"count-text\" }\nconst _hoisted_10 = { class: \"row theme-switch\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"启用主题表格:\", -1))\nconst _hoisted_12 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_13 = { class: \"row\" }\nconst _hoisted_14 = /*#__PURE__*/_createTextVNode(\"标题行\")\nconst _hoisted_15 = /*#__PURE__*/_createTextVNode(\"汇总行\")\nconst _hoisted_16 = { class: \"row\" }\nconst _hoisted_17 = /*#__PURE__*/_createTextVNode(\"第一列\")\nconst _hoisted_18 = /*#__PURE__*/_createTextVNode(\"最后一列\")\nconst _hoisted_19 = { class: \"row\" }\nconst _hoisted_20 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"主题颜色:\", -1))\n\nimport { computed, onMounted, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTTableElement, TableCell, TableCellStyle, TableTheme } from '@/types/slides'\nimport { WEB_FONTS } from '@/configs/font'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementOutline from '../common/ElementOutline.vue'\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'TableStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId, selectedTableCells: selectedCells, availableFonts } = storeToRefs(useMainStore())\nconst themeColor = computed(() => slidesStore.theme.themeColor)\n\nconst fontSizeOptions = [\n '12px', '14px', '16px', '18px', '20px', '22px', '24px', '28px', '32px',\n]\n\nconst textAttrs = ref({\n bold: false,\n em: false,\n underline: false,\n strikethrough: false,\n color: '#000',\n backcolor: '#000',\n fontsize: '12px',\n fontname: '微软雅黑',\n align: 'left',\n})\n\nconst theme = ref()\nconst hasTheme = ref(false)\nconst rowCount = ref(0)\nconst colCount = ref(0)\nconst minRowCount = ref(0)\nconst minColCount = ref(0)\n\nwatch(handleElement, () => {\n if (!handleElement.value || handleElement.value.type !== 'table') return\n \n theme.value = handleElement.value.theme\n hasTheme.value = !!theme.value\n\n rowCount.value = handleElement.value.data.length\n colCount.value = handleElement.value.data[0].length\n\n minRowCount.value = handleElement.value.data.length\n minColCount.value = handleElement.value.data[0].length\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 更新当前选中单元格的文本样式状态\nconst updateTextAttrState = () => {\n if (!handleElement.value || handleElement.value.type !== 'table') return\n\n let rowIndex = 0\n let colIndex = 0\n if (selectedCells.value.length) {\n const selectedCell = selectedCells.value[0]\n rowIndex = +selectedCell.split('_')[0]\n colIndex = +selectedCell.split('_')[1]\n }\n const style = handleElement.value.data[rowIndex][colIndex].style\n\n if (!style) {\n textAttrs.value = {\n bold: false,\n em: false,\n underline: false,\n strikethrough: false,\n color: '#000',\n backcolor: '#000',\n fontsize: '12px',\n fontname: '微软雅黑',\n align: 'left',\n }\n }\n else {\n textAttrs.value = {\n bold: !!style.bold,\n em: !!style.em,\n underline: !!style.underline,\n strikethrough: !!style.strikethrough,\n color: style.color || '#000',\n backcolor: style.backcolor || '#000',\n fontsize: style.fontsize || '12px',\n fontname: style.fontname || '微软雅黑',\n align: style.align || 'left',\n }\n }\n}\n\nonMounted(() => {\n if (selectedCells.value.length) updateTextAttrState()\n})\n\nwatch(selectedCells, updateTextAttrState)\n\nconst updateElement = (props: Partial) => {\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 设置单元格内容文本样式\nconst updateTextAttrs = (textAttrProp: Partial) => {\n const _handleElement = handleElement.value as PPTTableElement\n\n const data: TableCell[][] = JSON.parse(JSON.stringify(_handleElement.data))\n\n for (let i = 0; i < data.length; i++) {\n for (let j = 0; j < data[i].length; j++) {\n if (!selectedCells.value.length || selectedCells.value.includes(`${i}_${j}`)) {\n const style = data[i][j].style || {}\n data[i][j].style = { ...style, ...textAttrProp }\n }\n }\n }\n updateElement({ data })\n updateTextAttrState()\n}\n\n// 更新表格主题:主题色、标题行、汇总行、第一列、最后一列\nconst updateTheme = (themeProp: Partial) => {\n if (!theme.value) return\n const _theme = { ...theme.value, ...themeProp }\n updateElement({ theme: _theme })\n}\n\n// 开启/关闭表格主题\nconst toggleTheme = (checked: boolean) => {\n if (checked) {\n const props = {\n theme: {\n color: themeColor.value,\n rowHeader: true,\n rowFooter: false,\n colHeader: false,\n colFooter: false,\n }\n }\n updateElement(props)\n }\n else {\n slidesStore.removeElementProps({ id: handleElementId.value, propName: 'theme' })\n addHistorySnapshot()\n }\n}\n\n// 设置表格行数\nconst setTableRow = (value: number) => {\n const _handleElement = handleElement.value as PPTTableElement\n const rowCount = _handleElement.data.length\n\n if (value > rowCount) {\n const rowCells: TableCell[] = new Array(colCount.value).fill({ id: nanoid(10), colspan: 1, rowspan: 1, text: '' })\n const newTableCells: TableCell[][] = new Array(value - rowCount).fill(rowCells)\n \n const tableCells: TableCell[][] = JSON.parse(JSON.stringify(_handleElement.data))\n tableCells.push(...newTableCells)\n \n updateElement({ data: tableCells })\n }\n else {\n const tableCells: TableCell[][] = _handleElement.data.slice(0, value)\n updateElement({ data: tableCells })\n }\n}\n\n// 设置表格列数\nconst setTableCol = (value: number) => {\n const _handleElement = handleElement.value as PPTTableElement\n const colCount = _handleElement.data[0].length\n\n let tableCells = _handleElement.data\n let colSizeList = _handleElement.colWidths.map(item => item * _handleElement.width)\n\n if (value > colCount) {\n tableCells = tableCells.map(item => {\n const cells: TableCell[] = new Array(value - colCount).fill({ id: nanoid(10), colspan: 1, rowspan: 1, text: '' })\n item.push(...cells)\n return item\n })\n \n const newColSizeList: number[] = new Array(value - colCount).fill(100)\n colSizeList.push(...newColSizeList)\n }\n else {\n tableCells = tableCells.map(item => item.slice(0, value))\n colSizeList = colSizeList.slice(0, value)\n }\n\n const width = colSizeList.reduce((a, b) => a + b)\n const colWidths = colSizeList.map(item => item / width)\n\n const props = {\n width,\n data: tableCells,\n colWidths,\n }\n updateElement(props)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_SelectOptGroup = _resolveComponent(\"SelectOptGroup\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_IconAddText = _resolveComponent(\"IconAddText\")!\n const _component_InputGroup = _resolveComponent(\"InputGroup\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_IconText = _resolveComponent(\"IconText\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconFill = _resolveComponent(\"IconFill\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconTextBold = _resolveComponent(\"IconTextBold\")!\n const _component_CheckboxButton = _resolveComponent(\"CheckboxButton\")!\n const _component_IconTextItalic = _resolveComponent(\"IconTextItalic\")!\n const _component_IconTextUnderline = _resolveComponent(\"IconTextUnderline\")!\n const _component_IconStrikethrough = _resolveComponent(\"IconStrikethrough\")!\n const _component_CheckboxButtonGroup = _resolveComponent(\"CheckboxButtonGroup\")!\n const _component_IconAlignTextLeft = _resolveComponent(\"IconAlignTextLeft\")!\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_IconAlignTextCenter = _resolveComponent(\"IconAlignTextCenter\")!\n const _component_IconAlignTextRight = _resolveComponent(\"IconAlignTextRight\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconMinus = _resolveComponent(\"IconMinus\")!\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Checkbox = _resolveComponent(\"Checkbox\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_InputGroup, {\n compact: \"\",\n class: \"row\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: textAttrs.value.fontname,\n onChange: _cache[0] || (_cache[0] = value => updateTextAttrs({ fontname: value as string }))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconFontSize)\n ]),\n default: _withCtx(() => [\n _createVNode(_component_SelectOptGroup, { label: \"系统字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(availableFonts), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", {\n style: _normalizeStyle({ fontFamily: font.value })\n }, _toDisplayString(font.label), 5)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOptGroup, { label: \"在线字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(WEB_FONTS), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", null, _toDisplayString(font.label), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Select, {\n style: {\"flex\":\"2\"},\n value: textAttrs.value.fontsize,\n onChange: _cache[1] || (_cache[1] = value => updateTextAttrs({ fontsize: value as string }))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconAddText)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(fontSizeOptions, (fontsize) => {\n return _createVNode(_component_SelectOption, {\n key: fontsize,\n value: fontsize\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(fontsize), 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: textAttrs.value.color,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = value => updateTextAttrs({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字颜色\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconText),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: textAttrs.value.color })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: textAttrs.value.backcolor,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = value => updateTextAttrs({ backcolor: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"单元格填充\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFill),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: textAttrs.value.backcolor })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"加粗\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: textAttrs.value.bold,\n onClick: _cache[4] || (_cache[4] = ($event: any) => (updateTextAttrs({ bold: !textAttrs.value.bold })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextBold)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"斜体\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: textAttrs.value.em,\n onClick: _cache[5] || (_cache[5] = ($event: any) => (updateTextAttrs({ em: !textAttrs.value.em })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextItalic)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下划线\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: textAttrs.value.underline,\n onClick: _cache[6] || (_cache[6] = ($event: any) => (updateTextAttrs({ underline: !textAttrs.value.underline })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextUnderline)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"删除线\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: textAttrs.value.strikethrough,\n onClick: _cache[7] || (_cache[7] = ($event: any) => (updateTextAttrs({ strikethrough: !textAttrs.value.strikethrough })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconStrikethrough)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: textAttrs.value.align,\n onChange: _cache[8] || (_cache[8] = e => updateTextAttrs({ align: e.target.value }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"left\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"center\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextCenter)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"right\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Divider),\n _createVNode(ElementOutline, { fixed: true }),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_Button, {\n class: \"btn\",\n disabled: rowCount.value <= 1,\n onClick: _cache[9] || (_cache[9] = ($event: any) => (setTableRow(rowCount.value - 1)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconMinus)\n ]),\n _: 1\n }, 8, [\"disabled\"]),\n _createElementVNode(\"div\", _hoisted_5, _toDisplayString(rowCount.value), 1),\n _createVNode(_component_Button, {\n class: \"btn\",\n disabled: rowCount.value >= 30,\n onClick: _cache[10] || (_cache[10] = ($event: any) => (setTableRow(rowCount.value + 1)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPlus)\n ]),\n _: 1\n }, 8, [\"disabled\"])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_6, [\n _hoisted_7,\n _createElementVNode(\"div\", _hoisted_8, [\n _createVNode(_component_Button, {\n class: \"btn\",\n disabled: colCount.value <= 1,\n onClick: _cache[11] || (_cache[11] = ($event: any) => (setTableCol(colCount.value - 1)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconMinus)\n ]),\n _: 1\n }, 8, [\"disabled\"]),\n _createElementVNode(\"div\", _hoisted_9, _toDisplayString(colCount.value), 1),\n _createVNode(_component_Button, {\n class: \"btn\",\n disabled: colCount.value >= 30,\n onClick: _cache[12] || (_cache[12] = ($event: any) => (setTableCol(colCount.value + 1)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPlus)\n ]),\n _: 1\n }, 8, [\"disabled\"])\n ])\n ]),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createElementVNode(\"div\", _hoisted_12, [\n _createVNode(_component_Switch, {\n checked: hasTheme.value,\n onChange: _cache[13] || (_cache[13] = checked => toggleTheme(checked as boolean))\n }, null, 8, [\"checked\"])\n ])\n ]),\n (theme.value)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_13, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[14] || (_cache[14] = e => updateTheme({ rowHeader: e.target.checked })),\n checked: theme.value.rowHeader,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_14\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_Checkbox, {\n onChange: _cache[15] || (_cache[15] = e => updateTheme({ rowFooter: e.target.checked })),\n checked: theme.value.rowFooter,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_15\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _createElementVNode(\"div\", _hoisted_16, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[16] || (_cache[16] = e => updateTheme({ colHeader: e.target.checked })),\n checked: theme.value.colHeader,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_17\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_Checkbox, {\n onChange: _cache[17] || (_cache[17] = e => updateTheme({ colFooter: e.target.checked })),\n checked: theme.value.colFooter,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_18\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _createElementVNode(\"div\", _hoisted_19, [\n _hoisted_20,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: theme.value.color,\n \"onUpdate:modelValue\": _cache[18] || (_cache[18] = value => updateTheme({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: theme.value.color,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./TableStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./TableStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./TableStylePanel.vue?vue&type=style&index=0&id=7e28e1d8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7e28e1d8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-546adf8c\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"latex-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\"编辑 LaTeX\")\nconst _hoisted_4 = { class: \"row\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"颜色:\", -1))\nconst _hoisted_6 = { class: \"row\" }\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"粗细:\", -1))\n\nimport { onUnmounted, Ref, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTLatexElement } from '@/types/slides'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from '../common/ColorButton.vue'\nimport LaTeXEditor from '@/components/LaTeXEditor/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LatexStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst handleLatexElement = handleElement as Ref\n\nconst latexEditorVisible = ref(false)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateLatex = (props: Partial) => {\n if (!handleElement.value) return\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\nconst updateLatexData = (data: { path: string; latex: string; w: number; h: number; }) => {\n updateLatex({\n path: data.path,\n latex: data.latex,\n width: data.w,\n height: data.h,\n viewBox: [data.w, data.h],\n })\n}\n\nconst openLatexEditor = () => latexEditorVisible.value = true\n\nemitter.on(EmitterEvents.OPEN_LATEX_EDITOR, openLatexEditor)\nonUnmounted(() => {\n emitter.off(EmitterEvents.OPEN_LATEX_EDITOR, openLatexEditor)\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_Modal = _resolveComponent(\"Modal\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[0] || (_cache[0] = ($event: any) => (latexEditorVisible.value = true))\n }, {\n default: _withCtx(() => [\n _hoisted_3\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(handleLatexElement).color,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = value => updateLatex({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(handleLatexElement).color,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_6, [\n _hoisted_7,\n _createVNode(_component_InputNumber, {\n min: 1,\n max: 3,\n value: _unref(handleLatexElement).strokeWidth,\n onChange: _cache[2] || (_cache[2] = value => updateLatex({ strokeWidth: value as number })),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ]),\n _createVNode(_component_Modal, {\n visible: latexEditorVisible.value,\n \"onUpdate:visible\": _cache[5] || (_cache[5] = ($event: any) => ((latexEditorVisible).value = $event)),\n footer: null,\n centered: \"\",\n width: 880,\n destroyOnClose: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(LaTeXEditor, {\n value: _unref(handleLatexElement).latex,\n onClose: _cache[3] || (_cache[3] = ($event: any) => (latexEditorVisible.value = false)),\n onUpdate: _cache[4] || (_cache[4] = data => { updateLatexData(data); latexEditorVisible.value = false })\n }, null, 8, [\"value\"])\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]))\n}\n}\n\n})","import script from \"./LatexStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LatexStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LatexStylePanel.vue?vue&type=style&index=0&id=546adf8c&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-546adf8c\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeStyle as _normalizeStyle, withCtx as _withCtx, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-ff7125dc\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"video-style-panel\" }\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"视频预览封面\", -1))\nconst _hoisted_3 = { class: \"background-image-wrapper\" }\nconst _hoisted_4 = { class: \"background-image\" }\nconst _hoisted_5 = { class: \"row\" }\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"重置封面\")\n\nimport { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTVideoElement } from '@/types/slides'\nimport { getImageDataURL } from '@/utils/image'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'VideoStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst handleVideoElement = handleElement as Ref\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateVideo = (props: Partial) => {\n if (!handleElement.value) return\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\n// 设置视频预览封面\nconst setVideoPoster = (files: FileList) => {\n const imageFile = files[0]\n if (!imageFile) return\n getImageDataURL(imageFile).then(dataURL => updateVideo({ poster: dataURL }))\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _hoisted_2,\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_FileInput, {\n onChange: _cache[0] || (_cache[0] = files => setVideoPoster(files))\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", {\n class: \"content\",\n style: _normalizeStyle({ backgroundImage: `url(${_unref(handleVideoElement).poster})` })\n }, [\n _createVNode(_component_IconPlus)\n ], 4)\n ])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[1] || (_cache[1] = ($event: any) => (updateVideo({ poster: '' })))\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./VideoStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./VideoStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./VideoStylePanel.vue?vue&type=style&index=0&id=ff7125dc&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-ff7125dc\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5d723d50\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"audio-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"图标颜色:\", -1))\nconst _hoisted_4 = { class: \"row switch-row\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"自动播放:\", -1))\nconst _hoisted_6 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_7 = { class: \"row switch-row\" }\nconst _hoisted_8 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"循环播放:\", -1))\nconst _hoisted_9 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\n\nimport { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTAudioElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'AudioStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst handleAudioElement = handleElement as Ref\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateAudio = (props: Partial) => {\n if (!handleElement.value) return\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_Switch = _resolveComponent(\"Switch\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(handleAudioElement).color,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = value => updateAudio({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(handleAudioElement).color,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(_component_Switch, {\n checked: _unref(handleAudioElement).autoplay,\n onChange: _cache[1] || (_cache[1] = checked => updateAudio({ autoplay: checked as boolean }))\n }, null, 8, [\"checked\"])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _hoisted_8,\n _createElementVNode(\"div\", _hoisted_9, [\n _createVNode(_component_Switch, {\n checked: _unref(handleAudioElement).loop,\n onChange: _cache[2] || (_cache[2] = checked => updateAudio({ loop: checked as boolean }))\n }, null, 8, [\"checked\"])\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./AudioStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./AudioStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./AudioStylePanel.vue?vue&type=style&index=0&id=5d723d50&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5d723d50\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeStyle as _normalizeStyle, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-71469855\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"multi-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"填充颜色:\", -1))\nconst _hoisted_4 = { class: \"row\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框样式:\", -1))\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"实线边框\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"虚线边框\")\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框颜色:\", -1))\nconst _hoisted_10 = { class: \"row\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框粗细:\", -1))\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"+\")\nconst _hoisted_13 = /*#__PURE__*/_createTextVNode(\"-\")\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement, PPTElementOutline, TableCell } from '@/types/slides'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\nimport { WEB_FONTS } from '@/configs/font'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MultiStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { richTextAttrs, availableFonts, activeElementList } = storeToRefs(useMainStore())\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateElement = (id: string, props: Partial) => {\n slidesStore.updateElement({ id, props })\n addHistorySnapshot()\n}\n\nconst fontSizeOptions = [\n '12px', '14px', '16px', '18px', '20px', '22px', '24px', '28px', '32px',\n '36px', '40px', '44px', '48px', '54px', '60px', '66px', '72px', '76px',\n '80px', '88px', '96px', '104px', '112px', '120px',\n]\n\nconst fill = ref('#fff')\nconst outline = ref({\n width: 0,\n color: '#fff',\n style: 'solid',\n})\n\n// 批量修改填充色(表格元素为单元格填充、音频元素为图标颜色)\nconst updateFill = (value: string) => {\n for (const el of activeElementList.value) {\n if (\n el.type === 'text' ||\n el.type === 'shape' ||\n el.type === 'chart'\n ) updateElement(el.id, { fill: value })\n\n if (el.type === 'table') {\n const data: TableCell[][] = JSON.parse(JSON.stringify(el.data))\n for (let i = 0; i < data.length; i++) {\n for (let j = 0; j < data[i].length; j++) {\n const style = data[i][j].style || {}\n data[i][j].style = { ...style, backcolor: value }\n }\n }\n updateElement(el.id, { data })\n }\n\n if (el.type === 'audio') updateElement(el.id, { color: value })\n }\n fill.value = value\n}\n\n// 修改边框/线条样式\nconst updateOutline = (outlineProps: Partial) => {\n\n for (const el of activeElementList.value) {\n if (\n el.type === 'text' ||\n el.type === 'image' ||\n el.type === 'shape' ||\n el.type === 'table' ||\n el.type === 'chart'\n ) {\n const outline = el.outline || { width: 2, color: '#000', style: 'solid' }\n const props = { outline: { ...outline, ...outlineProps } }\n updateElement(el.id, props)\n }\n\n if (el.type === 'line') updateElement(el.id, outlineProps)\n }\n outline.value = { ...outline.value, ...outlineProps }\n}\n\n// 修改文字样式\nconst updateFontStyle = (command: string, value: string) => {\n for (const el of activeElementList.value) {\n if (el.type === 'text' || (el.type === 'shape' && el.text?.content)) {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { target: el.id, action: { command, value } })\n }\n if (el.type === 'table') {\n const data: TableCell[][] = JSON.parse(JSON.stringify(el.data))\n for (let i = 0; i < data.length; i++) {\n for (let j = 0; j < data[i].length; j++) {\n const style = data[i][j].style || {}\n data[i][j].style = { ...style, [command]: value }\n }\n }\n updateElement(el.id, { data })\n }\n if (el.type === 'latex' && command === 'color') {\n updateElement(el.id, { color: value })\n }\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_SelectOptGroup = _resolveComponent(\"SelectOptGroup\")!\n const _component_IconAddText = _resolveComponent(\"IconAddText\")!\n const _component_InputGroup = _resolveComponent(\"InputGroup\")!\n const _component_IconText = _resolveComponent(\"IconText\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconHighLight = _resolveComponent(\"IconHighLight\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconAlignTextLeft = _resolveComponent(\"IconAlignTextLeft\")!\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_IconAlignTextCenter = _resolveComponent(\"IconAlignTextCenter\")!\n const _component_IconAlignTextRight = _resolveComponent(\"IconAlignTextRight\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: fill.value,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = value => updateFill(value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: fill.value,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: outline.value.style,\n onChange: _cache[1] || (_cache[1] = value => updateOutline({ style: value as 'solid' | 'dashed' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"solid\" }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"dashed\" }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: outline.value.color,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = value => updateOutline({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: outline.value.color || '#000',\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createVNode(_component_InputNumber, {\n value: outline.value.width,\n onChange: _cache[3] || (_cache[3] = value => updateOutline({ width: value as number })),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ]),\n _createVNode(_component_Divider),\n _createVNode(_component_InputGroup, {\n compact: \"\",\n class: \"row\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(richTextAttrs).fontname,\n onChange: _cache[4] || (_cache[4] = value => updateFontStyle('fontname', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconFontSize)\n ]),\n default: _withCtx(() => [\n _createVNode(_component_SelectOptGroup, { label: \"系统字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(availableFonts), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", {\n style: _normalizeStyle({ fontFamily: font.value })\n }, _toDisplayString(font.label), 5)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOptGroup, { label: \"在线字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(WEB_FONTS), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", null, _toDisplayString(font.label), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Select, {\n style: {\"flex\":\"2\"},\n value: _unref(richTextAttrs).fontsize,\n onChange: _cache[5] || (_cache[5] = value => updateFontStyle('fontsize', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconAddText)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(fontSizeOptions, (fontsize) => {\n return _createVNode(_component_SelectOption, {\n key: fontsize,\n value: fontsize\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(fontsize), 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).color,\n \"onUpdate:modelValue\": _cache[6] || (_cache[6] = value => updateFontStyle('color', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字颜色\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconText),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).color })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).backcolor,\n \"onUpdate:modelValue\": _cache[7] || (_cache[7] = value => updateFontStyle('backcolor', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字高亮\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconHighLight),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).backcolor })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"增大字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[8] || (_cache[8] = ($event: any) => (updateFontStyle('fontsize-add', '2')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_12\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"减小字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[9] || (_cache[9] = ($event: any) => (updateFontStyle('fontsize-reduce', '2')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_13\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: _unref(richTextAttrs).align,\n onChange: _cache[10] || (_cache[10] = e => updateFontStyle('align', e.target.value))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"left\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"center\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextCenter)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"right\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"value\"])\n ]))\n}\n}\n\n})","import script from \"./MultiStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MultiStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MultiStylePanel.vue?vue&type=style&index=0&id=71469855&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-71469855\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"element-style-panel\" }\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { ElementTypes } from '@/types/slides'\n\nimport TextStylePanel from './TextStylePanel.vue'\nimport ImageStylePanel from './ImageStylePanel.vue'\nimport ShapeStylePanel from './ShapeStylePanel.vue'\nimport LineStylePanel from './LineStylePanel.vue'\nimport ChartStylePanel from './ChartStylePanel/index.vue'\nimport TableStylePanel from './TableStylePanel.vue'\nimport LatexStylePanel from './LatexStylePanel.vue'\nimport VideoStylePanel from './VideoStylePanel.vue'\nimport AudioStylePanel from './AudioStylePanel.vue'\nimport MultiStylePanel from './MultiStylePanel.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst panelMap = {\n [ElementTypes.TEXT]: TextStylePanel,\n [ElementTypes.IMAGE]: ImageStylePanel,\n [ElementTypes.SHAPE]: ShapeStylePanel,\n [ElementTypes.LINE]: LineStylePanel,\n [ElementTypes.CHART]: ChartStylePanel,\n [ElementTypes.TABLE]: TableStylePanel,\n [ElementTypes.LATEX]: LatexStylePanel,\n [ElementTypes.VIDEO]: VideoStylePanel,\n [ElementTypes.AUDIO]: AudioStylePanel,\n}\n\nconst { activeElementIdList, activeElementList, handleElement, activeGroupElementId } = storeToRefs(useMainStore())\n\nconst currentPanelComponent = computed(() => {\n if (activeElementIdList.value.length > 1) {\n if (!activeGroupElementId.value) return MultiStylePanel\n\n const activeGroupElement = activeElementList.value.find(item => item.id === activeGroupElementId.value)\n return activeGroupElement ? (panelMap[activeGroupElement.type] || null) : null\n }\n\n return handleElement.value ? (panelMap[handleElement.value.type] || null) : null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentPanelComponent))))\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, unref as _unref, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, Fragment as _Fragment, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createStaticVNode as _createStaticVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-43e5f476\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-positopn-panel\" }\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"层级:\", -1))\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\" 置于顶层\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\" 置于底层\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\" 上移一层\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\" 下移一层\")\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"对齐:\", -1))\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"3\"} }, \"位置:\", -1))\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"1\"} }, null, -1))\nconst _hoisted_11 = /*#__PURE__*/_createStaticVNode(\"
X
Y
\", 1)\nconst _hoisted_12 = { class: \"row\" }\nconst _hoisted_13 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"3\"} }, \"大小:\", -1))\nconst _hoisted_14 = {\n key: 1,\n style: {\"flex\":\"1\"}\n}\nconst _hoisted_15 = /*#__PURE__*/_createStaticVNode(\"
\", 1)\nconst _hoisted_16 = { class: \"row\" }\nconst _hoisted_17 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"3\"} }, \"旋转:\", -1))\nconst _hoisted_18 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"1\"} }, null, -1))\n\nimport { computed, ref, watch } from 'vue'\nimport { round } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { ElementAlignCommands, ElementOrderCommands } from '@/types/edit'\nimport { MIN_SIZE } from '@/configs/element'\nimport { SHAPE_PATH_FORMULAS } from '@/configs/shapes'\nimport useOrderElement from '@/hooks/useOrderElement'\nimport useAlignElementToCanvas from '@/hooks/useAlignElementToCanvas'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementPositionPanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId } = storeToRefs(useMainStore())\n\nconst left = ref(0)\nconst top = ref(0)\nconst width = ref(0)\nconst height = ref(0)\nconst rotate = ref(0)\nconst fixedRatio = ref(false)\n\nconst minSize = computed(() => {\n if (!handleElement.value) return 20\n return MIN_SIZE[handleElement.value.type] || 20\n})\n\nwatch(handleElement, () => {\n if (!handleElement.value) return\n\n left.value = round(handleElement.value.left, 1)\n top.value = round(handleElement.value.top, 1)\n\n fixedRatio.value = 'fixedRatio' in handleElement.value && !!handleElement.value.fixedRatio\n\n if (handleElement.value.type !== 'line') {\n width.value = round(handleElement.value.width, 1)\n height.value = round(handleElement.value.height, 1)\n rotate.value = 'rotate' in handleElement.value && handleElement.value.rotate !== undefined ? round(handleElement.value.rotate, 1) : 0\n }\n}, { deep: true, immediate: true })\n\nconst { orderElement } = useOrderElement()\nconst { alignElementToCanvas } = useAlignElementToCanvas()\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 设置元素位置\nconst updateLeft = (value: number) => {\n const props = { left: value }\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\nconst updateTop = (value: number) => {\n const props = { top: value }\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 设置元素宽度、高度、旋转角度\n// 对形状设置宽高时,需要检查是否需要更新形状路径\nconst updateShapePathData = (width: number, height: number) => {\n if (handleElement.value && handleElement.value.type === 'shape' && 'pathFormula' in handleElement.value && handleElement.value.pathFormula) {\n const pathFormula = SHAPE_PATH_FORMULAS[handleElement.value.pathFormula]\n\n let path = ''\n if ('editable' in pathFormula) path = pathFormula.formula(width, height, handleElement.value.keypoint!)\n else path = pathFormula.formula(width, height)\n\n return {\n viewBox: [width, height],\n path,\n }\n }\n return null\n}\nconst updateWidth = (value: number) => {\n let props = { width: value }\n const shapePathData = updateShapePathData(value, height.value)\n if (shapePathData) props = { ...props, ...shapePathData }\n\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\nconst updateHeight = (value: number) => {\n let props = { height: value }\n const shapePathData = updateShapePathData(width.value, value)\n if (shapePathData) props = { ...props, ...shapePathData }\n\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\nconst updateRotate = (value: number) => {\n const props = { rotate: value }\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 固定元素的宽高比\nconst updateFixedRatio = (value: boolean) => {\n const props = { fixedRatio: value }\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 将元素旋转45度(顺时针或逆时针)\nconst updateRotate45 = (command: '+' | '-') => {\n let _rotate = Math.floor(rotate.value / 45) * 45\n if (command === '+') _rotate = _rotate + 45\n else if (command === '-') _rotate = _rotate - 45\n\n if (_rotate < -180) _rotate = -180\n if (_rotate > 180) _rotate = 180\n\n const props = { rotate: _rotate }\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconSendToBack = _resolveComponent(\"IconSendToBack\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_IconBringToFrontOne = _resolveComponent(\"IconBringToFrontOne\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconBringToFront = _resolveComponent(\"IconBringToFront\")!\n const _component_IconSentToBack = _resolveComponent(\"IconSentToBack\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconAlignLeft = _resolveComponent(\"IconAlignLeft\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconAlignVertically = _resolveComponent(\"IconAlignVertically\")!\n const _component_IconAlignRight = _resolveComponent(\"IconAlignRight\")!\n const _component_IconAlignTop = _resolveComponent(\"IconAlignTop\")!\n const _component_IconAlignHorizontally = _resolveComponent(\"IconAlignHorizontally\")!\n const _component_IconAlignBottom = _resolveComponent(\"IconAlignBottom\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_IconLock = _resolveComponent(\"IconLock\")!\n const _component_IconUnlock = _resolveComponent(\"IconUnlock\")!\n const _component_IconRotate = _resolveComponent(\"IconRotate\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _hoisted_2,\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).TOP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconSendToBack, { class: \"btn-icon\" }),\n _hoisted_3\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).BOTTOM)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconBringToFrontOne, { class: \"btn-icon\" }),\n _hoisted_4\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).UP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconBringToFront, { class: \"btn-icon\" }),\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[3] || (_cache[3] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).DOWN)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconSentToBack, { class: \"btn-icon\" }),\n _hoisted_6\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _hoisted_7,\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[4] || (_cache[4] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).LEFT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"水平居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[5] || (_cache[5] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).HORIZONTAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignVertically)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[6] || (_cache[6] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).RIGHT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"上对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[7] || (_cache[7] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).TOP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTop)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"垂直居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[8] || (_cache[8] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).VERTICAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignHorizontally)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[9] || (_cache[9] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).BOTTOM)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignBottom)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_InputNumber, {\n step: 5,\n value: left.value,\n onChange: _cache[10] || (_cache[10] = value => updateLeft(value as number)),\n style: {\"flex\":\"4\"}\n }, null, 8, [\"value\"]),\n _hoisted_10,\n _createVNode(_component_InputNumber, {\n step: 5,\n value: top.value,\n onChange: _cache[11] || (_cache[11] = value => updateTop(value as number)),\n style: {\"flex\":\"4\"}\n }, null, 8, [\"value\"])\n ]),\n _hoisted_11,\n (_unref(handleElement)!.type !== 'line')\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_12, [\n _hoisted_13,\n _createVNode(_component_InputNumber, {\n min: _unref(minSize),\n max: 1500,\n step: 5,\n value: width.value,\n onChange: _cache[12] || (_cache[12] = value => updateWidth(value as number)),\n style: {\"flex\":\"4\"}\n }, null, 8, [\"min\", \"value\"]),\n (['image', 'shape', 'audio'].includes(_unref(handleElement)!.type))\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (fixedRatio.value)\n ? (_openBlock(), _createBlock(_component_Tooltip, {\n key: 0,\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"解除宽高比锁定\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconLock, {\n style: {\"flex\":\"1\"},\n class: \"icon-btn\",\n onClick: _cache[13] || (_cache[13] = ($event: any) => (updateFixedRatio(false)))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]))\n : (_openBlock(), _createBlock(_component_Tooltip, {\n key: 1,\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"宽高比锁定\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconUnlock, {\n style: {\"flex\":\"1\"},\n class: \"icon-btn\",\n onClick: _cache[14] || (_cache[14] = ($event: any) => (updateFixedRatio(true)))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]))\n ], 64))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_14)),\n _createVNode(_component_InputNumber, {\n min: _unref(minSize),\n max: 800,\n step: 5,\n disabled: _unref(handleElement)!.type === 'text',\n value: height.value,\n onChange: _cache[15] || (_cache[15] = value => updateHeight(value as number)),\n style: {\"flex\":\"4\"}\n }, null, 8, [\"min\", \"disabled\", \"value\"])\n ]),\n _hoisted_15\n ], 64))\n : _createCommentVNode(\"\", true),\n (!['line', 'video', 'audio'].includes(_unref(handleElement)!.type))\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_16, [\n _hoisted_17,\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"逆时针旋转\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconRotate, {\n class: \"icon-btn\",\n onClick: _cache[16] || (_cache[16] = ($event: any) => (updateRotate45('-'))),\n style: {\"flex\":\"2\"}\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"顺时针旋转\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconRotate, {\n class: \"icon-btn\",\n onClick: _cache[17] || (_cache[17] = ($event: any) => (updateRotate45('+'))),\n style: _normalizeStyle({\n flex: 2,\n transform: 'rotateY(180deg)',\n })\n }, null, 8, [\"style\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _hoisted_18,\n _createVNode(_component_InputNumber, {\n min: -180,\n max: 180,\n step: 5,\n value: rotate.value,\n onChange: _cache[18] || (_cache[18] = value => updateRotate(value as number)),\n style: {\"flex\":\"4\"}\n }, null, 8, [\"value\"])\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ElementPositionPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementPositionPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementPositionPanel.vue?vue&type=style&index=0&id=43e5f476&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-43e5f476\"]])\n\nexport default __exports__","export const ANIMATION_DEFAULT_DURATION = 1000\r\nexport const ANIMATION_DEFAULT_TRIGGER = 'click'\r\nexport const ANIMATION_CLASS_PREFIX = 'animate__'\r\n\r\nexport const ENTER_ANIMATIONS = [\r\n {\r\n type: 'bounce',\r\n name: '弹跳',\r\n children: [\r\n { name: '弹入', value: 'bounceIn' },\r\n { name: '向右弹入', value: 'bounceInLeft' },\r\n { name: '向左弹入', value: 'bounceInRight' },\r\n { name: '向上弹入', value: 'bounceInUp' },\r\n { name: '向下弹入', value: 'bounceInDown' },\r\n ],\r\n },\r\n {\r\n type: 'fade',\r\n name: '浮现',\r\n children: [\r\n { name: '浮入', value: 'fadeIn' },\r\n { name: '向下浮入', value: 'fadeInDown' },\r\n { name: '向下长距浮入', value: 'fadeInDownBig' },\r\n { name: '向右浮入', value: 'fadeInLeft' },\r\n { name: '向右长距浮入', value: 'fadeInLeftBig' },\r\n { name: '向左浮入', value: 'fadeInRight' },\r\n { name: '向左长距浮入', value: 'fadeInRightBig' },\r\n { name: '向上浮入', value: 'fadeInUp' },\r\n { name: '向上长距浮入', value: 'fadeInUpBig' },\r\n { name: '从左上浮入', value: 'fadeInTopLeft' },\r\n { name: '从右上浮入', value: 'fadeInTopRight' },\r\n { name: '从左下浮入', value: 'fadeInBottomLeft' },\r\n { name: '从右下浮入', value: 'fadeInBottomRight' },\r\n ],\r\n },\r\n {\r\n type: 'rotate',\r\n name: '旋转',\r\n children: [\r\n { name: '旋转进入', value: 'rotateIn' },\r\n { name: '绕左下进入', value: 'rotateInDownLeft' },\r\n { name: '绕右下进入', value: 'rotateInDownRight' },\r\n { name: '绕左上进入', value: 'rotateInUpLeft' },\r\n { name: '绕右上进入', value: 'rotateInUpRight' },\r\n ],\r\n },\r\n {\r\n type: 'zoom',\r\n name: '缩放',\r\n children: [\r\n { name: '放大进入', value: 'zoomIn' },\r\n { name: '向下放大进入', value: 'zoomInDown' },\r\n { name: '从左放大进入', value: 'zoomInLeft' },\r\n { name: '从右放大进入', value: 'zoomInRight' },\r\n { name: '向上放大进入', value: 'zoomInUp' },\r\n ],\r\n },\r\n {\r\n type: 'slide',\r\n name: '滑入',\r\n children: [\r\n { name: '向下滑入', value: 'slideInDown' },\r\n { name: '从右滑入', value: 'slideInLeft' },\r\n { name: '从左滑入', value: 'slideInRight' },\r\n { name: '向上滑入', value: 'slideInUp' },\r\n ],\r\n },\r\n {\r\n type: 'flip',\r\n name: '翻转',\r\n children: [\r\n { name: 'X轴翻转进入', value: 'flipInX' },\r\n { name: 'Y轴翻转进入', value: 'flipInY' },\r\n ],\r\n },\r\n {\r\n type: 'back',\r\n name: '放大滑入',\r\n children: [\r\n { name: '向下放大滑入', value: 'backInDown' },\r\n { name: '从左放大滑入', value: 'backInLeft' },\r\n { name: '从右放大滑入', value: 'backInRight' },\r\n { name: '向上放大滑入', value: 'backInUp' },\r\n ],\r\n },\r\n {\r\n type: 'lightSpeed',\r\n name: '飞入',\r\n children: [\r\n { name: '从右飞入', value: 'lightSpeedInRight' },\r\n { name: '从左飞入', value: 'lightSpeedInLeft' },\r\n ],\r\n },\r\n]\r\n\r\nexport const EXIT_ANIMATIONS = [\r\n {\r\n type: 'bounce',\r\n name: '弹跳',\r\n children: [\r\n { name: '弹出', value: 'bounceOut' },\r\n { name: '向左弹出', value: 'bounceOutLeft' },\r\n { name: '向右弹出', value: 'bounceOutRight' },\r\n { name: '向上弹出', value: 'bounceOutUp' },\r\n { name: '向下弹出', value: 'bounceOutDown' },\r\n ],\r\n },\r\n {\r\n type: 'fade',\r\n name: '浮现',\r\n children: [\r\n { name: '浮出', value: 'fadeOut' },\r\n { name: '向下浮出', value: 'fadeOutDown' },\r\n { name: '向下长距浮出', value: 'fadeOutDownBig' },\r\n { name: '向左浮出', value: 'fadeOutLeft' },\r\n { name: '向左长距浮出', value: 'fadeOutLeftBig' },\r\n { name: '向右浮出', value: 'fadeOutRight' },\r\n { name: '向右长距浮出', value: 'fadeOutRightBig' },\r\n { name: '向上浮出', value: 'fadeOutUp' },\r\n { name: '向上长距浮出', value: 'fadeOutUpBig' },\r\n { name: '从左上浮出', value: 'fadeOutTopLeft' },\r\n { name: '从右上浮出', value: 'fadeOutTopRight' },\r\n { name: '从左下浮出', value: 'fadeOutBottomLeft' },\r\n { name: '从右下浮出', value: 'fadeOutBottomRight' },\r\n ],\r\n },\r\n {\r\n type: 'rotate',\r\n name: '旋转',\r\n children: [\r\n { name: '旋转退出', value: 'rotateOut' },\r\n { name: '绕左下退出', value: 'rotateOutDownLeft' },\r\n { name: '绕右下退出', value: 'rotateOutDownRight' },\r\n { name: '绕左上退出', value: 'rotateOutUpLeft' },\r\n { name: '绕右上退出', value: 'rotateOutUpRight' },\r\n ],\r\n },\r\n {\r\n type: 'zoom',\r\n name: '缩放',\r\n children: [\r\n { name: '缩小退出', value: 'zoomOut' },\r\n { name: '向下缩小退出', value: 'zoomOutDown' },\r\n { name: '从左缩小退出', value: 'zoomOutLeft' },\r\n { name: '从右缩小退出', value: 'zoomOutRight' },\r\n { name: '向上缩小退出', value: 'zoomOutUp' },\r\n ],\r\n },\r\n {\r\n type: 'slide',\r\n name: '滑出',\r\n children: [\r\n { name: '向下滑出', value: 'slideOutDown' },\r\n { name: '从左滑出', value: 'slideOutLeft' },\r\n { name: '从右滑出', value: 'slideOutRight' },\r\n { name: '向上滑出', value: 'slideOutUp' },\r\n ],\r\n },\r\n {\r\n type: 'flip',\r\n name: '翻转',\r\n children: [\r\n { name: 'X轴翻转退出', value: 'flipOutX' },\r\n { name: 'Y轴翻转退出', value: 'flipOutY' },\r\n ],\r\n },\r\n {\r\n type: 'back',\r\n name: '缩小滑出',\r\n children: [\r\n { name: '向下缩小滑出', value: 'backOutDown' },\r\n { name: '从左缩小滑出', value: 'backOutLeft' },\r\n { name: '从右缩小滑出', value: 'backOutRight' },\r\n { name: '向上缩小滑出', value: 'backOutUp' },\r\n ],\r\n },\r\n {\r\n type: 'lightSpeed',\r\n name: '飞出',\r\n children: [\r\n { name: '从右飞出', value: 'lightSpeedOutRight' },\r\n { name: '从左飞出', value: 'lightSpeedOutLeft' },\r\n ],\r\n },\r\n]\r\n\r\nexport const ATTENTION_ANIMATIONS = [\r\n {\r\n type: 'shake',\r\n name: '晃动',\r\n children: [\r\n { name: '左右摇晃', value: 'shakeX' },\r\n { name: '上下摇晃', value: 'shakeY' },\r\n { name: '摇头', value: 'headShake' },\r\n { name: '摆动', value: 'swing' },\r\n { name: '晃动', value: 'wobble' },\r\n { name: '惊恐', value: 'tada' },\r\n { name: '果冻', value: 'jello' },\r\n ],\r\n },\r\n {\r\n type: 'other',\r\n name: '其他',\r\n children: [\r\n { name: '弹跳', value: 'bounce' },\r\n { name: '闪烁', value: 'flash' },\r\n { name: '脉搏', value: 'pulse' },\r\n { name: '橡皮筋', value: 'rubberBand' },\r\n { name: '心跳(快)', value: 'heartBeat' },\r\n ],\r\n },\r\n]","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-2f69234f\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-animation-panel\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"element-animation\"\n}\nconst _hoisted_3 = { class: \"tabs\" }\nconst _hoisted_4 = [\"onClick\"]\nconst _hoisted_5 = { class: \"type-title\" }\nconst _hoisted_6 = { class: \"pool-item-wrapper\" }\nconst _hoisted_7 = [\"onMouseenter\", \"onClick\"]\nconst _hoisted_8 = {\n key: 0,\n class: \"mask\"\n}\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\" 添加动画 \")\nconst _hoisted_10 = {\n key: 1,\n class: \"tip\"\n}\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\" 选中画布中的元素添加动画\")\nconst _hoisted_12 = { class: \"sequence-content\" }\nconst _hoisted_13 = { class: \"index\" }\nconst _hoisted_14 = { class: \"text\" }\nconst _hoisted_15 = { class: \"handler\" }\nconst _hoisted_16 = {\n key: 0,\n class: \"configs\"\n}\nconst _hoisted_17 = { class: \"config-item\" }\nconst _hoisted_18 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"3\"} }, \"持续时长:\", -1))\nconst _hoisted_19 = { class: \"config-item\" }\nconst _hoisted_20 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"3\"} }, \"触发方式:\", -1))\nconst _hoisted_21 = /*#__PURE__*/_createTextVNode(\"主动触发\")\nconst _hoisted_22 = /*#__PURE__*/_createTextVNode(\"与上一动画同时\")\nconst _hoisted_23 = /*#__PURE__*/_createTextVNode(\"上一动画之后\")\nconst _hoisted_24 = { class: \"config-item\" }\nconst _hoisted_25 = /*#__PURE__*/_createTextVNode(\"更换动画\")\n\nimport { computed, ref, watch } from 'vue'\nimport { nanoid } from 'nanoid'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTAnimation } from '@/types/slides'\nimport { \n ENTER_ANIMATIONS,\n EXIT_ANIMATIONS,\n ATTENTION_ANIMATIONS,\n ANIMATION_DEFAULT_DURATION,\n ANIMATION_DEFAULT_TRIGGER,\n ANIMATION_CLASS_PREFIX,\n} from '@/configs/animation'\nimport { ELEMENT_TYPE_ZH } from '@/configs/element'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport Draggable from 'vuedraggable'\n\ntype AnimationType = 'in' | 'out' | 'attention'\ninterface TabItem {\n key: AnimationType\n label: string\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementAnimationPanel',\n setup(__props) {\n\nconst animationEffects: { [key: string]: string } = {}\nfor (const effect of ENTER_ANIMATIONS) {\n for (const animation of effect.children) {\n animationEffects[animation.value] = animation.name\n }\n}\nfor (const effect of EXIT_ANIMATIONS) {\n for (const animation of effect.children) {\n animationEffects[animation.value] = animation.name\n }\n}\nfor (const effect of ATTENTION_ANIMATIONS) {\n for (const animation of effect.children) {\n animationEffects[animation.value] = animation.name\n }\n}\n\nconst animationTypes: AnimationType[] = ['in', 'out', 'attention']\n\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId } = storeToRefs(useMainStore())\nconst { currentSlide, formatedAnimations, currentSlideAnimations } = storeToRefs(slidesStore)\n\nconst tabs: TabItem[] = [\n { key: 'in', label: '入场' },\n { key: 'out', label: '退场' },\n { key: 'attention', label: '强调' },\n]\nconst activeTab = ref('in')\n\nwatch(() => handleElementId.value, () => {\n animationPoolVisible.value = false\n})\n\nconst hoverPreviewAnimation = ref('')\nconst animationPoolVisible = ref(false)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 当前页面的动画列表\nconst animationSequence = computed(() => {\n const animationSequence = []\n for (let i = 0; i < formatedAnimations.value.length; i++) {\n const item = formatedAnimations.value[i]\n for (let j = 0; j < item.animations.length; j++) {\n const animation = item.animations[j]\n const el = currentSlide.value.elements.find(el => el.id === animation.elId)\n if (!el) continue\n\n const elType = ELEMENT_TYPE_ZH[el.type]\n const animationEffect = animationEffects[animation.effect]\n animationSequence.push({\n ...animation,\n index: j === 0 ? i + 1 : '',\n elType,\n animationEffect,\n })\n }\n }\n return animationSequence\n})\n\n// 当前选中元素的入场动画信息\nconst handleElementAnimation = computed(() => {\n const animations = currentSlideAnimations.value\n const animation = animations.filter(item => item.elId === handleElementId.value)\n return animation || []\n})\n\n// 删除元素动画\nconst deleteAnimation = (id: string) => {\n const animations = currentSlideAnimations.value.filter(item => item.id !== id)\n slidesStore.updateSlide({ animations })\n addHistorySnapshot()\n}\n\n// 拖拽修改动画顺序后同步数据\nconst handleDragEnd = (eventData: { newIndex: number; oldIndex: number }) => {\n const { newIndex, oldIndex } = eventData\n if (oldIndex === newIndex) return\n\n const animations: PPTAnimation[] = JSON.parse(JSON.stringify(currentSlideAnimations.value))\n const animation = animations[oldIndex]\n animations.splice(oldIndex, 1)\n animations.splice(newIndex, 0, animation)\n \n slidesStore.updateSlide({ animations })\n addHistorySnapshot()\n}\n\n// 执行动画预览\nconst runAnimation = (elId: string, effect: string, duration: number) => {\n const elRef = document.querySelector(`#editable-element-${elId} [class^=editable-element-]`)\n if (elRef) {\n const animationName = `${ANIMATION_CLASS_PREFIX}${effect}`\n document.documentElement.style.setProperty('--animate-duration', `${duration}ms`)\n elRef.classList.add(`${ANIMATION_CLASS_PREFIX}animated`, animationName)\n\n const handleAnimationEnd = () => {\n document.documentElement.style.removeProperty('--animate-duration')\n elRef.classList.remove(`${ANIMATION_CLASS_PREFIX}animated`, animationName)\n }\n elRef.addEventListener('animationend', handleAnimationEnd, { once: true })\n }\n}\n\n// 修改元素动画持续时间\nconst updateElementAnimationDuration = (id: string, duration: number) => {\n if (duration < 100 || duration > 5000) return\n\n const animations = currentSlideAnimations.value.map(item => {\n if (item.id === id) return { ...item, duration }\n return item\n })\n slidesStore.updateSlide({ animations })\n addHistorySnapshot()\n}\n\n// 修改触发方式\nconst updateElementAnimationTrigger = (id: string, trigger: 'click' | 'meantime' | 'auto') => {\n const animations = currentSlideAnimations.value.map(item => {\n if (item.id === id) return { ...item, trigger }\n return item\n })\n slidesStore.updateSlide({ animations })\n addHistorySnapshot()\n}\n\n// 修改元素动画,并执行一次预览\nconst updateElementAnimation = (type: AnimationType, effect: string) => {\n const animations = currentSlideAnimations.value.map(item => {\n if (item.id === handleAnimationId.value) return { ...item, type, effect }\n return item\n })\n slidesStore.updateSlide({ animations })\n animationPoolVisible.value = false\n addHistorySnapshot()\n\n const animationItem = currentSlideAnimations.value.find(item => item.elId === handleElementId.value)\n const duration = animationItem?.duration || ANIMATION_DEFAULT_DURATION\n\n runAnimation(handleElementId.value, effect, duration)\n}\n\nconst handleAnimationId = ref('')\n// 添加元素动画,并执行一次预览\nconst addAnimation = (type: AnimationType, effect: string) => {\n if (handleAnimationId.value) {\n updateElementAnimation(type, effect)\n return\n }\n\n const animations: PPTAnimation[] = JSON.parse(JSON.stringify(currentSlideAnimations.value))\n animations.push({\n id: nanoid(10),\n elId: handleElementId.value,\n type,\n effect,\n duration: ANIMATION_DEFAULT_DURATION,\n trigger: ANIMATION_DEFAULT_TRIGGER,\n })\n slidesStore.updateSlide({ animations })\n animationPoolVisible.value = false\n addHistorySnapshot()\n\n runAnimation(handleElementId.value, effect, ANIMATION_DEFAULT_DURATION)\n}\n\n// 动画选择面板打开600ms后再移除遮罩层,否则打开面板后迅速滑入鼠标预览会导致抖动\nconst popoverMaskHide = ref(false)\nconst handlePopoverVisibleChange = (visible: boolean) => {\n if (visible) {\n setTimeout(() => popoverMaskHide.value = true, 600)\n }\n else popoverMaskHide.value = false\n}\n\nconst openAnimationPool = (elementId: string) => {\n animationPoolVisible.value = true\n handleAnimationId.value = elementId\n handlePopoverVisibleChange(true)\n}\n\nconst animations = {\n in: ENTER_ANIMATIONS,\n out: EXIT_ANIMATIONS,\n attention: ATTENTION_ANIMATIONS,\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconEffects = _resolveComponent(\"IconEffects\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconClick = _resolveComponent(\"IconClick\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconPlayOne = _resolveComponent(\"IconPlayOne\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconCloseSmall = _resolveComponent(\"IconCloseSmall\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_unref(handleElement))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: animationPoolVisible.value,\n \"onUpdate:visible\": _cache[2] || (_cache[2] = ($event: any) => ((animationPoolVisible).value = $event)),\n onVisibleChange: _cache[3] || (_cache[3] = visible => handlePopoverVisibleChange(visible))\n }, {\n content: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_3, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (tab) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass(['tab', tab.key, { 'active': activeTab.value === tab.key }]),\n key: tab.key,\n onClick: ($event: any) => (activeTab.value = tab.key)\n }, _toDisplayString(tab.label), 11, _hoisted_4)\n }), 64))\n ]),\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(animationTypes, (key) => {\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n (activeTab.value === key)\n ? (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass(['animation-pool', key]),\n key: key\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(animations[key], (effect) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"pool-type\",\n key: effect.name\n }, [\n _createElementVNode(\"div\", _hoisted_5, _toDisplayString(effect.name) + \":\", 1),\n _createElementVNode(\"div\", _hoisted_6, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(effect.children, (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"pool-item\",\n key: item.name,\n onMouseenter: ($event: any) => (hoverPreviewAnimation.value = item.value),\n onMouseleave: _cache[0] || (_cache[0] = ($event: any) => (hoverPreviewAnimation.value = '')),\n onClick: ($event: any) => (addAnimation(key, item.value))\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"animation-box\", [\n `${_unref(ANIMATION_CLASS_PREFIX)}animated`,\n `${_unref(ANIMATION_CLASS_PREFIX)}fast`,\n hoverPreviewAnimation.value === item.value && `${_unref(ANIMATION_CLASS_PREFIX)}${item.value}`,\n ]])\n }, _toDisplayString(item.name), 3)\n ], 40, _hoisted_7))\n }), 128))\n ])\n ]))\n }), 128)),\n (!popoverMaskHide.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_8))\n : _createCommentVNode(\"\", true)\n ], 2))\n : _createCommentVNode(\"\", true)\n ], 64))\n }), 64))\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"element-animation-btn\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (handleAnimationId.value = ''))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconEffects, { style: {\"margin-right\":\"5px\"} }),\n _hoisted_9\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_10, [\n _createVNode(_component_IconClick, { style: {\"margin-right\":\"5px\"} }),\n _hoisted_11\n ])),\n _createVNode(_component_Divider),\n _createVNode(_unref(Draggable), {\n class: \"animation-sequence\",\n modelValue: _unref(animationSequence),\n animation: 300,\n scroll: true,\n scrollSensitivity: 50,\n handle: \".sequence-content\",\n onEnd: handleDragEnd,\n itemKey: \"id\"\n }, {\n item: _withCtx(({ element }) => [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"sequence-item\", [element.type, { 'active': _unref(handleElement)?.id === element.elId }]])\n }, [\n _createElementVNode(\"div\", _hoisted_12, [\n _createElementVNode(\"div\", _hoisted_13, _toDisplayString(element.index), 1),\n _createElementVNode(\"div\", _hoisted_14, \"【\" + _toDisplayString(element.elType) + \"】\" + _toDisplayString(element.animationEffect), 1),\n _createElementVNode(\"div\", _hoisted_15, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"预览\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPlayOne, {\n class: \"handler-btn\",\n onClick: ($event: any) => (runAnimation(element.elId, element.effect, element.duration))\n }, null, 8, [\"onClick\"])\n ]),\n _: 2\n }, 1032, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"删除\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconCloseSmall, {\n class: \"handler-btn\",\n onClick: ($event: any) => (deleteAnimation(element.id))\n }, null, 8, [\"onClick\"])\n ]),\n _: 2\n }, 1032, [\"mouseEnterDelay\"])\n ])\n ]),\n (_unref(handleElementAnimation)[0]?.elId === element.elId)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_16, [\n _createVNode(_component_Divider, { style: {\"margin\":\"16px 0\"} }),\n _createElementVNode(\"div\", _hoisted_17, [\n _hoisted_18,\n _createVNode(_component_InputNumber, {\n min: 500,\n max: 3000,\n step: 500,\n value: element.duration,\n onChange: value => updateElementAnimationDuration(element.id, value as number),\n style: {\"flex\":\"5\"}\n }, null, 8, [\"value\", \"onChange\"])\n ]),\n _createElementVNode(\"div\", _hoisted_19, [\n _hoisted_20,\n _createVNode(_component_Select, {\n value: element.trigger,\n onChange: value => updateElementAnimationTrigger(element.id, value as 'click' | 'meantime' | 'auto'),\n style: {\"flex\":\"5\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"click\" }, {\n default: _withCtx(() => [\n _hoisted_21\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"meantime\" }, {\n default: _withCtx(() => [\n _hoisted_22\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"auto\" }, {\n default: _withCtx(() => [\n _hoisted_23\n ]),\n _: 1\n })\n ]),\n _: 2\n }, 1032, [\"value\", \"onChange\"])\n ]),\n _createElementVNode(\"div\", _hoisted_24, [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: ($event: any) => (openAnimationPool(element.id))\n }, {\n default: _withCtx(() => [\n _hoisted_25\n ]),\n _: 2\n }, 1032, [\"onClick\"])\n ])\n ]))\n : _createCommentVNode(\"\", true)\n ], 2)\n ]),\n _: 1\n }, 8, [\"modelValue\"])\n ]))\n}\n}\n\n})","import script from \"./ElementAnimationPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementAnimationPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementAnimationPanel.vue?vue&type=style&index=0&id=2f69234f&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-2f69234f\"]])\n\nexport default __exports__","export const PRESET_THEMES = [\r\n { color: '#d14424', background: '#ffffff', text: '#333' },\r\n { color: '#42464b', background: '#ffffff', text: '#333' },\r\n { color: '#5d82ba', background: '#ffffff', text: '#333' },\r\n { color: '#005a6f', background: '#ffffff', text: '#333' },\r\n { color: '#d0614c', background: '#dfb044', text: '#333' },\r\n { color: '#86a1ad', background: '#dfdbd4', text: '#333' },\r\n { color: '#697586', background: '#d5c4a4', text: '#333' },\r\n { color: '#333333', background: '#7acfa6', text: '#333' },\r\n { color: '#42464b', background: '#415065', text: '#fff' },\r\n { color: '#0c5999', background: '#35a2cd', text: '#fff' },\r\n { color: '#c49a41', background: '#8c4357', text: '#fff' },\r\n { color: '#dfaa00', background: '#2e4e7d', text: '#fff' },\r\n { color: '#d1ad88', background: '#f99070', text: '#fff' },\r\n { color: '#464d52', background: '#657984', text: '#fff' },\r\n { color: '#ffcfb6', background: '#1e4c6f', text: '#fff' },\r\n { color: '#c3a043', background: '#43292a', text: '#fff' },\r\n { color: '#464d52', background: '#60546f', text: '#fff' },\r\n { color: '#df9636', background: '#5b89a0', text: '#fff' },\r\n { color: '#b898a4', background: '#93716b', text: '#fff' },\r\n { color: '#c47a11', background: '#187db1', text: '#fff' },\r\n { color: '#333333', background: '#759564', text: '#fff' },\r\n { color: '#355b5e', background: '#424b50', text: '#fff' },\r\n { color: '#d29090', background: '#942a32', text: '#fff' },\r\n { color: '#00cfdf', background: '#3b434d', text: '#fff' },\r\n { color: '#424246', background: '#c70042', text: '#fff' },\r\n { color: '#2e4155', background: '#b35d44', text: '#fff' },\r\n { color: '#11bfce', background: '#8f98aa', text: '#fff' },\r\n { color: '#333333', background: '#549688', text: '#fff' },\r\n]","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock, renderList as _renderList, Fragment as _Fragment, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-e0bbbd9e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"slide-design-panel\" }\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"背景填充\", -1))\nconst _hoisted_3 = { class: \"row\" }\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"纯色填充\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"图片填充\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"渐变填充\")\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"1\"} }, null, -1))\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"缩放\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"拼贴\")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"缩放铺满\")\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\"线性渐变\")\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"径向渐变\")\nconst _hoisted_13 = {\n key: 0,\n class: \"background-image-wrapper\"\n}\nconst _hoisted_14 = { class: \"background-image\" }\nconst _hoisted_15 = {\n key: 1,\n class: \"background-gradient-wrapper\"\n}\nconst _hoisted_16 = { class: \"row\" }\nconst _hoisted_17 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"起点颜色:\", -1))\nconst _hoisted_18 = { class: \"row\" }\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"终点颜色:\", -1))\nconst _hoisted_20 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_21 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"渐变角度:\", -1))\nconst _hoisted_22 = { class: \"row\" }\nconst _hoisted_23 = /*#__PURE__*/_createTextVNode(\"应用背景到全部\")\nconst _hoisted_24 = { class: \"row\" }\nconst _hoisted_25 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"画布尺寸:\", -1))\nconst _hoisted_26 = /*#__PURE__*/_createTextVNode(\"宽屏 16 : 9\")\nconst _hoisted_27 = /*#__PURE__*/_createTextVNode(\"宽屏 16 :10\")\nconst _hoisted_28 = /*#__PURE__*/_createTextVNode(\"标准 4 :3\")\nconst _hoisted_29 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"全局主题\", -1))\nconst _hoisted_30 = { class: \"row\" }\nconst _hoisted_31 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"字体:\", -1))\nconst _hoisted_32 = { class: \"row\" }\nconst _hoisted_33 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"字体颜色:\", -1))\nconst _hoisted_34 = { class: \"row\" }\nconst _hoisted_35 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"背景颜色:\", -1))\nconst _hoisted_36 = { class: \"row\" }\nconst _hoisted_37 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"主题色:\", -1))\nconst _hoisted_38 = /*#__PURE__*/_createTextVNode(\" 预置主题 \")\nconst _hoisted_39 = {\n key: 2,\n class: \"theme-list\"\n}\nconst _hoisted_40 = [\"onClick\"]\nconst _hoisted_41 = { class: \"theme-item-content\" }\nconst _hoisted_42 = { class: \"row\" }\nconst _hoisted_43 = /*#__PURE__*/_createTextVNode(\"应用主题到全部\")\n\nimport { computed, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { Slide, SlideBackground, SlideTheme } from '@/types/slides'\nimport { PRESET_THEMES } from '@/configs/theme'\nimport { WEB_FONTS } from '@/configs/font'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from './common/ColorButton.vue'\nimport { getImageDataURL } from '@/utils/image'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SlideDesignPanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { availableFonts } = storeToRefs(useMainStore())\nconst { slides, currentSlide, viewportRatio, theme } = storeToRefs(slidesStore)\n\nconst background = computed(() => {\n if (!currentSlide.value.background) {\n return {\n type: 'solid',\n value: '#fff',\n } as SlideBackground\n }\n return currentSlide.value.background\n})\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 设置背景模式:纯色、图片、渐变色\nconst updateBackgroundType = (type: 'solid' | 'image' | 'gradient') => {\n if (type === 'solid') {\n const newBackground: SlideBackground = {\n ...background.value,\n type: 'solid',\n color: background.value.color || '#fff',\n }\n slidesStore.updateSlide({ background: newBackground })\n }\n else if (type === 'image') {\n const newBackground: SlideBackground = {\n ...background.value,\n type: 'image',\n image: background.value.image || '',\n imageSize: background.value.imageSize || 'cover',\n }\n slidesStore.updateSlide({ background: newBackground })\n }\n else {\n const newBackground: SlideBackground = {\n ...background.value,\n type: 'gradient',\n gradientType: background.value.gradientType || 'linear',\n gradientColor: background.value.gradientColor || ['#fff', '#fff'],\n gradientRotate: background.value.gradientRotate || 0,\n }\n slidesStore.updateSlide({ background: newBackground })\n }\n addHistorySnapshot()\n}\n\n// 设置背景图片\nconst updateBackground = (props: Partial) => {\n slidesStore.updateSlide({ background: { ...background.value, ...props } })\n addHistorySnapshot()\n}\n\n// 上传背景图片\nconst uploadBackgroundImage = (files: FileList) => {\n const imageFile = files[0]\n if (!imageFile) return\n getImageDataURL(imageFile).then(dataURL => updateBackground({ image: dataURL }))\n}\n\n// 应用当前页背景到全部页面\nconst applyBackgroundAllSlide = () => {\n const newSlides = slides.value.map(slide => {\n return {\n ...slide,\n background: currentSlide.value.background,\n }\n })\n slidesStore.setSlides(newSlides)\n addHistorySnapshot()\n}\n\n// 设置主题\nconst updateTheme = (themeProps: Partial) => {\n slidesStore.setTheme(themeProps)\n}\n\n// 将当前主题应用到全部页面\nconst applyThemeAllSlide = () => {\n const newSlides: Slide[] = JSON.parse(JSON.stringify(slides.value))\n const { themeColor, backgroundColor, fontColor, fontName } = theme.value\n\n for (const slide of newSlides) {\n if (!slide.background || slide.background.type !== 'image') {\n slide.background = {\n ...slide.background,\n type: 'solid',\n color: backgroundColor\n }\n }\n\n const elements = slide.elements\n for (const el of elements) {\n if (el.type === 'shape') el.fill = themeColor\n else if (el.type === 'line') el.color = themeColor\n else if (el.type === 'text') {\n el.defaultColor = fontColor\n el.defaultFontName = fontName\n if (el.fill) el.fill = themeColor\n }\n else if (el.type === 'table') {\n if (el.theme) el.theme.color = themeColor\n for (const rowCells of el.data) {\n for (const cell of rowCells) {\n if (cell.style) {\n cell.style.color = fontColor\n cell.style.fontname = fontName\n }\n }\n }\n }\n else if (el.type === 'chart') {\n el.themeColor = [themeColor]\n el.gridColor = fontColor\n }\n else if (el.type === 'latex') el.color = fontColor\n else if (el.type === 'audio') el.color = themeColor\n }\n }\n slidesStore.setSlides(newSlides)\n addHistorySnapshot()\n}\n\n// 是否显示预设主题\nconst showPresetThemes = ref(true)\nconst togglePresetThemesVisible = () => {\n showPresetThemes.value = !showPresetThemes.value\n}\n\n// 设置画布尺寸(宽高比例)\nconst updateViewportRatio = (value: number) => {\n slidesStore.setViewportRatio(value)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_SelectOptGroup = _resolveComponent(\"SelectOptGroup\")!\n const _component_IconDown = _resolveComponent(\"IconDown\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _hoisted_2,\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_Select, {\n style: {\"flex\":\"10\"},\n value: _unref(background).type,\n onChange: _cache[0] || (_cache[0] = value => updateBackgroundType(value as 'gradient' | 'image' | 'solid'))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"solid\" }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"image\" }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"gradient\" }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _hoisted_7,\n (_unref(background).type === 'solid')\n ? (_openBlock(), _createBlock(_component_Popover, {\n key: 0,\n trigger: \"click\"\n }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(background).color,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = color => updateBackground({ color }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(background).color || '#fff',\n style: {\"flex\":\"10\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n }))\n : (_unref(background).type === 'image')\n ? (_openBlock(), _createBlock(_component_Select, {\n key: 1,\n style: {\"flex\":\"10\"},\n value: _unref(background).imageSize || 'cover',\n onChange: _cache[2] || (_cache[2] = value => updateBackground({ imageSize: value as 'repeat' | 'cover' | 'contain' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"contain\" }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"repeat\" }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"cover\" }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]))\n : (_openBlock(), _createBlock(_component_Select, {\n key: 2,\n style: {\"flex\":\"10\"},\n value: _unref(background).gradientType,\n onChange: _cache[3] || (_cache[3] = value => updateBackground({ gradientType: value as 'linear' | 'radial' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"linear\" }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"radial\" }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]))\n ]),\n (_unref(background).type === 'image')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_13, [\n _createVNode(_component_FileInput, {\n onChange: _cache[4] || (_cache[4] = files => uploadBackgroundImage(files))\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_14, [\n _createElementVNode(\"div\", {\n class: \"content\",\n style: _normalizeStyle({ backgroundImage: `url(${_unref(background).image})` })\n }, [\n _createVNode(_component_IconPlus)\n ], 4)\n ])\n ]),\n _: 1\n })\n ]))\n : _createCommentVNode(\"\", true),\n (_unref(background).type === 'gradient')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_15, [\n _createElementVNode(\"div\", _hoisted_16, [\n _hoisted_17,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(background).gradientColor![0],\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = value => updateBackground({ gradientColor: [value, _unref(background).gradientColor![1]] }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(background).gradientColor![0],\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_18, [\n _hoisted_19,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(background).gradientColor![1],\n \"onUpdate:modelValue\": _cache[6] || (_cache[6] = value => updateBackground({ gradientColor: [_unref(background).gradientColor![0], value] }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(background).gradientColor![1],\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n (_unref(background).gradientType === 'linear')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_20, [\n _hoisted_21,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: 0,\n max: 360,\n step: 15,\n value: _unref(background).gradientRotate,\n onChange: _cache[7] || (_cache[7] = value => updateBackground({ gradientRotate: value as number }))\n }, null, 8, [\"value\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_22, [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[8] || (_cache[8] = ($event: any) => (applyBackgroundAllSlide()))\n }, {\n default: _withCtx(() => [\n _hoisted_23\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_24, [\n _hoisted_25,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(viewportRatio),\n onChange: _cache[9] || (_cache[9] = value => updateViewportRatio(value as number))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: 0.5625 }, {\n default: _withCtx(() => [\n _hoisted_26\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_SelectOption, { value: 0.625 }, {\n default: _withCtx(() => [\n _hoisted_27\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_SelectOption, { value: 0.75 }, {\n default: _withCtx(() => [\n _hoisted_28\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createVNode(_component_Divider),\n _hoisted_29,\n _createElementVNode(\"div\", _hoisted_30, [\n _hoisted_31,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(theme).fontName,\n onChange: _cache[10] || (_cache[10] = value => updateTheme({ fontName: value as string }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOptGroup, { label: \"系统字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(availableFonts), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", {\n style: _normalizeStyle({ fontFamily: font.value })\n }, _toDisplayString(font.label), 5)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOptGroup, { label: \"在线字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(WEB_FONTS), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", null, _toDisplayString(font.label), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_32, [\n _hoisted_33,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(theme).fontColor,\n \"onUpdate:modelValue\": _cache[11] || (_cache[11] = value => updateTheme({ fontColor: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(theme).fontColor,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_34, [\n _hoisted_35,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(theme).backgroundColor,\n \"onUpdate:modelValue\": _cache[12] || (_cache[12] = value => updateTheme({ backgroundColor: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(theme).backgroundColor,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_36, [\n _hoisted_37,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(theme).themeColor,\n \"onUpdate:modelValue\": _cache[13] || (_cache[13] = value => updateTheme({ themeColor: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(theme).themeColor,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"title dropdown\", { 'active': showPresetThemes.value }]),\n onClick: _cache[14] || (_cache[14] = ($event: any) => (togglePresetThemesVisible())),\n style: {\"margin-top\":\"20px\"}\n }, [\n _hoisted_38,\n _createVNode(_component_IconDown, { class: \"icon\" })\n ], 2),\n (showPresetThemes.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_39, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(PRESET_THEMES), (item, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"theme-item\",\n key: index,\n style: _normalizeStyle({ backgroundColor: item.background }),\n onClick: ($event: any) => (updateTheme({\n fontColor: item.text,\n backgroundColor: item.background,\n themeColor: item.color,\n }))\n }, [\n _createElementVNode(\"div\", _hoisted_41, [\n _createElementVNode(\"div\", {\n class: \"text\",\n style: _normalizeStyle({ color: item.text })\n }, \"Aa\", 4),\n _createElementVNode(\"div\", {\n class: \"color-block\",\n style: _normalizeStyle({ backgroundColor: item.color })\n }, null, 4)\n ])\n ], 12, _hoisted_40))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_42, [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[15] || (_cache[15] = ($event: any) => (applyThemeAllSlide()))\n }, {\n default: _withCtx(() => [\n _hoisted_43\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./SlideDesignPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SlideDesignPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./SlideDesignPanel.vue?vue&type=style&index=0&id=e0bbbd9e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-e0bbbd9e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, unref as _unref, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-577ae912\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"slide-animation-panel\" }\nconst _hoisted_2 = { class: \"animation-pool\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"animation-text\" }\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"应用到全部\")\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { TurningMode } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface Animations {\n label: string\n value: TurningMode\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SlideAnimationPanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { slides, currentSlide } = storeToRefs(slidesStore)\n\nconst currentTurningMode = computed(() => currentSlide.value.turningMode || 'slideY')\n\nconst animations: Animations[] = [\n { label: '无', value: 'no' },\n { label: '淡入淡出', value: 'fade' },\n { label: '左右推移', value: 'slideX' },\n { label: '上下推移', value: 'slideY' },\n]\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 修改播放时的切换页面方式\nconst updateTurningMode = (mode: TurningMode) => {\n if (mode === currentTurningMode.value) return\n slidesStore.updateSlide({ turningMode: mode })\n addHistorySnapshot()\n}\n\n// 将当前页的切换页面方式应用到全部页面\nconst applyAllSlide = () => {\n const newSlides = slides.value.map(slide => {\n return {\n ...slide,\n turningMode: currentSlide.value.turningMode,\n }\n })\n slidesStore.setSlides(newSlides)\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(animations, (item) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"animation-item\", { 'active': _unref(currentTurningMode) === item.value }]),\n key: item.label,\n onClick: ($event: any) => (updateTurningMode(item.value))\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass(['animation-block', item.value])\n }, null, 2),\n _createElementVNode(\"div\", _hoisted_4, _toDisplayString(item.label), 1)\n ], 10, _hoisted_3)\n }), 64))\n ]),\n _createVNode(_component_Button, {\n style: {\"width\":\"100%\"},\n onClick: _cache[0] || (_cache[0] = ($event: any) => (applyAllSlide()))\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./SlideAnimationPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SlideAnimationPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./SlideAnimationPanel.vue?vue&type=style&index=0&id=577ae912&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-577ae912\"]])\n\nexport default __exports__","import { storeToRefs } from 'pinia'\r\nimport { useMainStore, useSlidesStore } from '@/store'\r\nimport { PPTElement } from '@/types/slides'\r\nimport { ElementAlignCommands } from '@/types/edit'\r\nimport { getElementListRange, getRectRotatedOffset } from '@/utils/element'\r\nimport useHistorySnapshot from './useHistorySnapshot'\r\n\r\nexport default () => {\r\n const slidesStore = useSlidesStore()\r\n const { activeElementIdList, activeElementList } = storeToRefs(useMainStore())\r\n const { currentSlide } = storeToRefs(slidesStore)\r\n\r\n const { addHistorySnapshot } = useHistorySnapshot()\r\n\r\n /**\r\n * 对齐选中的元素\r\n * @param command 对齐方向\r\n */\r\n const alignActiveElement = (command: ElementAlignCommands) => {\r\n const { minX, maxX, minY, maxY } = getElementListRange(activeElementList.value)\r\n const elementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\r\n\r\n // 如果所选择的元素为组合元素的成员,需要计算该组合的整体范围\r\n const groupElementRangeMap = {}\r\n for (const activeElement of activeElementList.value) {\r\n if (activeElement.groupId && !groupElementRangeMap[activeElement.groupId]) {\r\n const groupElements = activeElementList.value.filter(item => item.groupId === activeElement.groupId)\r\n groupElementRangeMap[activeElement.groupId] = getElementListRange(groupElements)\r\n }\r\n }\r\n\r\n // 根据不同的命令,计算对齐的位置\r\n if (command === ElementAlignCommands.LEFT) {\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetX } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.left = minX - offsetX\r\n }\r\n else element.left = minX\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const offset = range.minX - minX\r\n element.left = element.left - offset\r\n }\r\n }\r\n })\r\n }\r\n else if (command === ElementAlignCommands.RIGHT) {\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n const elWidth = element.type === 'line' ? Math.max(element.start[0], element.end[0]) : element.width\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetX } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.left = maxX - elWidth + offsetX\r\n }\r\n else element.left = maxX - elWidth\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const offset = range.maxX - maxX\r\n element.left = element.left - offset\r\n }\r\n }\r\n })\r\n }\r\n else if (command === ElementAlignCommands.TOP) {\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetY } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.top = minY - offsetY\r\n }\r\n else element.top = minY\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const offset = range.minY - minY\r\n element.top = element.top - offset\r\n }\r\n }\r\n })\r\n }\r\n else if (command === ElementAlignCommands.BOTTOM) {\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n const elHeight = element.type === 'line' ? Math.max(element.start[1], element.end[1]) : element.height\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetY } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.top = maxY - elHeight + offsetY\r\n }\r\n else element.top = maxY - elHeight\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const offset = range.maxY - maxY\r\n element.top = element.top - offset\r\n }\r\n }\r\n })\r\n }\r\n else if (command === ElementAlignCommands.HORIZONTAL) {\r\n const horizontalCenter = (minX + maxX) / 2\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n const elWidth = element.type === 'line' ? Math.max(element.start[0], element.end[0]) : element.width\r\n element.left = horizontalCenter - elWidth / 2\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const center = (range.maxX + range.minX) / 2\r\n const offset = center - horizontalCenter\r\n element.left = element.left - offset\r\n }\r\n }\r\n })\r\n }\r\n else if (command === ElementAlignCommands.VERTICAL) {\r\n const verticalCenter = (minY + maxY) / 2\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n const elHeight = element.type === 'line' ? Math.max(element.start[1], element.end[1]) : element.height\r\n element.top = verticalCenter - elHeight / 2\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const center = (range.maxY + range.minY) / 2\r\n const offset = center - verticalCenter\r\n element.top = element.top - offset\r\n }\r\n }\r\n })\r\n }\r\n\r\n slidesStore.updateSlide({ elements: elementList })\r\n addHistorySnapshot()\r\n }\r\n\r\n return {\r\n alignActiveElement,\r\n }\r\n}","import { computed } from 'vue'\r\nimport { storeToRefs } from 'pinia'\r\nimport { useMainStore, useSlidesStore } from '@/store'\r\nimport { PPTElement } from '@/types/slides'\r\nimport { getElementRange, getElementListRange, getRectRotatedOffset } from '@/utils/element'\r\nimport useHistorySnapshot from './useHistorySnapshot'\r\n\r\ninterface ElementItem {\r\n min: number\r\n max: number\r\n el: PPTElement\r\n}\r\n\r\ninterface GroupItem {\r\n groupId: string\r\n els: PPTElement[]\r\n}\r\n\r\ninterface GroupElementsItem {\r\n min: number\r\n max: number\r\n els: PPTElement[]\r\n}\r\n\r\ntype Item = ElementItem | GroupElementsItem\r\n\r\ninterface ElementWithPos {\r\n pos: number\r\n el: PPTElement\r\n}\r\n\r\ninterface LastPos {\r\n min: number\r\n max: number\r\n}\r\n\r\nexport default () => {\r\n const slidesStore = useSlidesStore()\r\n const { activeElementIdList, activeElementList } = storeToRefs(useMainStore())\r\n const { currentSlide } = storeToRefs(slidesStore)\r\n\r\n const { addHistorySnapshot } = useHistorySnapshot()\r\n\r\n const displayItemCount = computed(() => {\r\n let count = 0\r\n const groupIdList: string[] = []\r\n for (const el of activeElementList.value) {\r\n if (!el.groupId) count += 1\r\n else if (!groupIdList.includes(el.groupId)) {\r\n groupIdList.push(el.groupId)\r\n count += 1\r\n }\r\n }\r\n return count\r\n })\r\n // 水平均匀排列\r\n const uniformHorizontalDisplay = () => {\r\n const { minX, maxX } = getElementListRange(activeElementList.value)\r\n const copyOfActiveElementList: PPTElement[] = JSON.parse(JSON.stringify(activeElementList.value))\r\n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\r\n\r\n // 分别获取普通元素和组合元素集合,并记录下每一项的范围\r\n const singleElemetList: ElementItem[] = []\r\n let groupList: GroupItem[] = []\r\n for (const el of copyOfActiveElementList) {\r\n if (!el.groupId) {\r\n const { minX, maxX } = getElementRange(el)\r\n singleElemetList.push({ min: minX, max: maxX, el })\r\n }\r\n else {\r\n const groupEl = groupList.find(item => item.groupId === el.groupId)\r\n if (!groupEl) groupList.push({ groupId: el.groupId, els: [el] })\r\n else {\r\n groupList = groupList.map(item => item.groupId === el.groupId ? { ...item, els: [...item.els, el] } : item)\r\n }\r\n }\r\n }\r\n const formatedGroupList: GroupElementsItem[] = []\r\n for (const groupItem of groupList) {\r\n const { minX, maxX } = getElementListRange(groupItem.els)\r\n formatedGroupList.push({ min: minX, max: maxX, els: groupItem.els })\r\n }\r\n\r\n // 将普通元素和组合元素集合组合在一起,然后将每一项按位置(从左到右)排序\r\n const list: Item[] = [...singleElemetList, ...formatedGroupList]\r\n list.sort((itemA, itemB) => itemA.min - itemB.min)\r\n\r\n // 计算元素均匀分布所需要的间隔:\r\n // (所选元素整体范围 - 所有所选元素宽度和) / (所选元素数 - 1)\r\n let totalWidth = 0\r\n for (const item of list) {\r\n const width = item.max - item.min\r\n totalWidth += width\r\n }\r\n const span = ((maxX - minX) - totalWidth) / (list.length - 1)\r\n\r\n // 按位置顺序依次计算每一个元素的目标位置\r\n // 第一项中的元素即为起点,无需计算\r\n // 从第二项开始,每一项的位置应该为:上一项位置 + 上一项宽度 + 间隔\r\n // 注意此处计算的位置(pos)并非元素最终的left值,而是目标位置范围最小值(元素旋转后的left值 ≠ 范围最小值)\r\n const sortedElementData: ElementWithPos[] = []\r\n\r\n const firstItem = list[0]\r\n let lastPos: LastPos = { min: firstItem.min, max: firstItem.max }\r\n\r\n if ('el' in firstItem) {\r\n sortedElementData.push({ pos: firstItem.min, el: firstItem.el })\r\n }\r\n else {\r\n for (const el of firstItem.els) {\r\n const { minX: pos } = getElementRange(el)\r\n sortedElementData.push({ pos, el })\r\n }\r\n }\r\n\r\n for (let i = 1; i < list.length; i++) {\r\n const item = list[i]\r\n const lastWidth = lastPos.max - lastPos.min\r\n const currentPos = lastPos.min + lastWidth + span\r\n const currentWidth = item.max - item.min\r\n lastPos = { min: currentPos, max: currentPos + currentWidth }\r\n\r\n if ('el' in item) {\r\n sortedElementData.push({ pos: currentPos, el: item.el })\r\n }\r\n else {\r\n for (const el of item.els) {\r\n const { minX } = getElementRange(el)\r\n const offset = minX - item.min\r\n sortedElementData.push({ pos: currentPos + offset, el })\r\n }\r\n }\r\n }\r\n\r\n // 根据目标位置计算元素最终目标left值\r\n // 对于旋转后的元素,需要计算旋转前后left的偏移来做校正\r\n for (const element of newElementList) {\r\n if (!activeElementIdList.value.includes(element.id)) continue\r\n\r\n for (const sortedItem of sortedElementData) {\r\n if (sortedItem.el.id === element.id) {\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetX } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.left = sortedItem.pos - offsetX\r\n }\r\n else element.left = sortedItem.pos\r\n }\r\n }\r\n }\r\n\r\n slidesStore.updateSlide({ elements: newElementList })\r\n addHistorySnapshot()\r\n }\r\n\r\n // 垂直均匀排列(逻辑类似水平均匀排列方法)\r\n const uniformVerticalDisplay = () => {\r\n const { minY, maxY } = getElementListRange(activeElementList.value)\r\n const copyOfActiveElementList: PPTElement[] = JSON.parse(JSON.stringify(activeElementList.value))\r\n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\r\n\r\n const singleElemetList: ElementItem[] = []\r\n let groupList: GroupItem[] = []\r\n for (const el of copyOfActiveElementList) {\r\n if (!el.groupId) {\r\n const { minY, maxY } = getElementRange(el)\r\n singleElemetList.push({ min: minY, max: maxY, el })\r\n }\r\n else {\r\n const groupEl = groupList.find(item => item.groupId === el.groupId)\r\n if (!groupEl) groupList.push({ groupId: el.groupId, els: [el] })\r\n else {\r\n groupList = groupList.map(item => item.groupId === el.groupId ? { ...item, els: [...item.els, el] } : item)\r\n }\r\n }\r\n }\r\n const formatedGroupList: GroupElementsItem[] = []\r\n for (const groupItem of groupList) {\r\n const { minY, maxY } = getElementListRange(groupItem.els)\r\n formatedGroupList.push({ min: minY, max: maxY, els: groupItem.els })\r\n }\r\n\r\n const list: Item[] = [...singleElemetList, ...formatedGroupList]\r\n list.sort((itemA, itemB) => itemA.min - itemB.min)\r\n\r\n let totalHeight = 0\r\n for (const item of list) {\r\n const height = item.max - item.min\r\n totalHeight += height\r\n }\r\n const span = ((maxY - minY) - totalHeight) / (list.length - 1)\r\n\r\n const sortedElementData: ElementWithPos[] = []\r\n\r\n const firstItem = list[0]\r\n let lastPos: LastPos = { min: firstItem.min, max: firstItem.max }\r\n\r\n if ('el' in firstItem) {\r\n sortedElementData.push({ pos: firstItem.min, el: firstItem.el })\r\n }\r\n else {\r\n for (const el of firstItem.els) {\r\n const { minY: pos } = getElementRange(el)\r\n sortedElementData.push({ pos, el })\r\n }\r\n }\r\n\r\n for (let i = 1; i < list.length; i++) {\r\n const item = list[i]\r\n const lastHeight = lastPos.max - lastPos.min\r\n const currentPos = lastPos.min + lastHeight + span\r\n const currentHeight = item.max - item.min\r\n lastPos = { min: currentPos, max: currentPos + currentHeight }\r\n\r\n if ('el' in item) {\r\n sortedElementData.push({ pos: currentPos, el: item.el })\r\n }\r\n else {\r\n for (const el of item.els) {\r\n const { minY } = getElementRange(el)\r\n const offset = minY - item.min\r\n sortedElementData.push({ pos: currentPos + offset, el })\r\n }\r\n }\r\n }\r\n\r\n for (const element of newElementList) {\r\n if (!activeElementIdList.value.includes(element.id)) continue\r\n\r\n for (const sortedItem of sortedElementData) {\r\n if (sortedItem.el.id === element.id) {\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetY } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.top = sortedItem.pos - offsetY\r\n }\r\n else element.top = sortedItem.pos\r\n }\r\n }\r\n }\r\n\r\n slidesStore.updateSlide({ elements: newElementList })\r\n addHistorySnapshot()\r\n }\r\n\r\n return {\r\n displayItemCount,\r\n uniformHorizontalDisplay,\r\n uniformVerticalDisplay,\r\n }\r\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, unref as _unref, withCtx as _withCtx, createTextVNode as _createTextVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-0d3881c5\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"multi-position-panel\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\"水平均匀分布\")\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\"垂直均匀分布\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"组合\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"取消组合\")\n\nimport { ElementAlignCommands } from '@/types/edit'\nimport useCombineElement from '@/hooks/useCombineElement'\nimport useAlignActiveElement from '@/hooks/useAlignActiveElement'\nimport useAlignElementToCanvas from '@/hooks/useAlignElementToCanvas'\nimport useUniformDisplayElement from '@/hooks/useUniformDisplayElement'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MultiPositionPanel',\n setup(__props) {\n\nconst { canCombine, combineElements, uncombineElements } = useCombineElement()\nconst { alignActiveElement } = useAlignActiveElement()\nconst { alignElementToCanvas } = useAlignElementToCanvas()\nconst { displayItemCount, uniformHorizontalDisplay, uniformVerticalDisplay } = useUniformDisplayElement()\n\n// 多选元素对齐,需要先判断当前所选中的元素状态:\n// 如果所选元素为一组组合元素,则将它对齐到画布;\n// 如果所选元素不是组合元素或不止一组元素(即当前为可组合状态),则将这多个(多组)元素相互对齐。\nconst alignElement = (command: ElementAlignCommands) => {\n if (canCombine.value) alignActiveElement(command)\n else alignElementToCanvas(command)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconAlignLeft = _resolveComponent(\"IconAlignLeft\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconAlignHorizontally = _resolveComponent(\"IconAlignHorizontally\")!\n const _component_IconAlignRight = _resolveComponent(\"IconAlignRight\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconAlignTop = _resolveComponent(\"IconAlignTop\")!\n const _component_IconAlignVertically = _resolveComponent(\"IconAlignVertically\")!\n const _component_IconAlignBottom = _resolveComponent(\"IconAlignBottom\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconGroup = _resolveComponent(\"IconGroup\")!\n const _component_IconUngroup = _resolveComponent(\"IconUngroup\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[0] || (_cache[0] = ($event: any) => (alignElement(_unref(ElementAlignCommands).LEFT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"水平居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[1] || (_cache[1] = ($event: any) => (alignElement(_unref(ElementAlignCommands).HORIZONTAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignHorizontally)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[2] || (_cache[2] = ($event: any) => (alignElement(_unref(ElementAlignCommands).RIGHT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"上对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[3] || (_cache[3] = ($event: any) => (alignElement(_unref(ElementAlignCommands).TOP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTop)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"垂直居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[4] || (_cache[4] = ($event: any) => (alignElement(_unref(ElementAlignCommands).VERTICAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignVertically)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[5] || (_cache[5] = ($event: any) => (alignElement(_unref(ElementAlignCommands).BOTTOM)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignBottom)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n (_unref(displayItemCount) > 2)\n ? (_openBlock(), _createBlock(_component_ButtonGroup, {\n key: 0,\n class: \"row\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[6] || (_cache[6] = ($event: any) => (_unref(uniformHorizontalDisplay)()))\n }, {\n default: _withCtx(() => [\n _hoisted_2\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[7] || (_cache[7] = ($event: any) => (_unref(uniformVerticalDisplay)()))\n }, {\n default: _withCtx(() => [\n _hoisted_3\n ]),\n _: 1\n })\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_Divider),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n disabled: !_unref(canCombine),\n onClick: _cache[8] || (_cache[8] = ($event: any) => (_unref(combineElements)())),\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconGroup, { style: {\"margin-right\":\"3px\"} }),\n _hoisted_4\n ]),\n _: 1\n }, 8, [\"disabled\"]),\n _createVNode(_component_Button, {\n disabled: _unref(canCombine),\n onClick: _cache[9] || (_cache[9] = ($event: any) => (_unref(uncombineElements)())),\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconUngroup, { style: {\"margin-right\":\"3px\"} }),\n _hoisted_5\n ]),\n _: 1\n }, 8, [\"disabled\"])\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./MultiPositionPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MultiPositionPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MultiPositionPanel.vue?vue&type=style&index=0&id=0d3881c5&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-0d3881c5\"]])\n\nexport default __exports__","export const SYMBOL_LIST = [\n {\n key: 'letter',\n label: '字母',\n children: [\n 'α', 'β', 'γ', 'δ', 'ϵ', 'ε', 'ζ', 'η', 'θ', 'ϑ', 'ι', 'κ', 'λ', 'μ', 'ν', 'ξ', 'π', 'ϖ', 'ρ', 'ϱ', 'σ', 'ς', 'τ', 'υ', 'ϕ', 'φ', 'χ', 'ψ', 'ω', \n 'Γ', 'Δ', 'Θ', 'Λ', 'Ξ', 'Π', 'Σ', 'Υ', 'Φ', 'Ψ', 'Ω',\n '𝐀', '𝐁', '𝐂', '𝐃', '𝐄', '𝐅', '𝐆', '𝐇', '𝐈', '𝐉', '𝐊', '𝐋', '𝐌', '𝐍', '𝐎', '𝐏', '𝐐', '𝐑', '𝐒', '𝐓', '𝐔', '𝐕', '𝐖', '𝐗', '𝐘', '𝐙',\n '𝐚', '𝐛', '𝐜', '𝐝', '𝐞', '𝐟', '𝐠', '𝐡', '𝐢', '𝐣', '𝐤', '𝐥', '𝐦', '𝐧', '𝐨', '𝐩', '𝐪', '𝐫', '𝐬', '𝐭', '𝐮', '𝐯', '𝐰', '𝐱', '𝐲', '𝐳',\n '𝓐', '𝓑', '𝓒', '𝓓', '𝓔', '𝓕', '𝓖', '𝓗', '𝓘', '𝓙', '𝓚', '𝓛', '𝓜', '𝓝', '𝓞', '𝓟', '𝓠', '𝓡', '𝓢', '𝓣', '𝓤', '𝓥', '𝓦', '𝓧', '𝓨', '𝓩',\n '𝓪', '𝓫', '𝓬', '𝓭', '𝓮', '𝓯', '𝓰', '𝓱', '𝓲', '𝓳', '𝓴', '𝓵', '𝓶', '𝓷', '𝓸', '𝓹', '𝓺', '𝓻', '𝓼', '𝓽', '𝓾', '𝓿', '𝔀', '𝔁', '𝔂', '𝔃',\n ],\n },\n {\n key: 'number',\n label: '序号',\n children: [\n '①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳',\n '⑴', '⑵', '⑶', '⑷', '⑸', '⑹', '⑺', '⑻', '⑼', '⑽', '⑾', '⑿', '⒀', '⒁', '⒂', '⒃', '⒄', '⒅', '⒆', '⒇',\n 'º', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹', '₀', '₁', '₂', '₃', '₄', '₅', '₆', '₇', '₈', '₉',\n 'Ⅰ', 'Ⅱ', 'Ⅲ', 'Ⅳ', 'Ⅴ', 'Ⅵ', 'Ⅶ', 'Ⅷ', 'Ⅸ', 'Ⅹ', 'Ⅺ', 'Ⅻ', 'Ⅼ', 'Ⅽ', 'Ⅾ', 'Ⅿ',\n 'ⅰ', 'ⅱ', 'ⅲ', 'ⅳ', 'ⅴ', 'ⅵ', 'ⅶ', 'ⅷ', 'ⅸ', 'ⅹ', 'ⅺ', 'ⅻ', 'ⅼ', 'ⅽ', 'ⅾ', 'ⅿ', 'ↀ', 'ↁ', 'ↂ',\n '㊀', '㊁', '㊂', '㊃', '㊄', '㊅', '㊆', '㊇', '㊈', '㊉', '㈠', '㈡', '㈢', '㈣', '㈤', '㈥', '㈦', '㈧', '㈨', '㈩',\n '𝟘', '𝟙', '𝟚', '𝟛', '𝟜', '𝟝', '𝟞', '𝟟', '𝟠', '𝟡',\n ],\n },\n {\n key: 'math',\n label: '数学',\n children: [\n '+', '-', '×', '÷', '=', '~', '¬', '±', '%', '°', 'ǃ', '‰', '‱', '½', '⅓', '⅔', '¼', '¾',\n '<', '>', 'l', 'o', 'g', 'l', 'g', 'l', 'n', '⨂', '⨁', '⨄', '⨃', '⨅', '⨆', '√', '∛', '∜', '∝', '∞',\n '∟', '∠', '∡', '∢', '∧', '∨', '∩', '∪', '∫', '∬', '∭', '∮', '∯', '∰', '∱', '∲', '∳',\n '∴', '∵', '∼', '∽', '∾', '∿', '≃', '≄', '≅', '≆', '≇', '≈', '≊', '≋', '≌', '≍', '≎', '≏', '≐', '≑', '≒', '≓', '≔', '≕',\n '≤', '≥', '≦', '≧', '≨', '≩', '≪', '≫', '≺', '≻', '≼', '≽', '≾', '≿', '⊀', '⊁', '⊂', '⊃', '⊄', '⊅', '⊆', '⊇', '⊈', '⊉', '⊊', '⊋', '⊏', '⊐', '⊑', '⊒',\n '⊓', '⊔', '⊢', '⊣', '⊤', '⊥', '⊦', '⊧', '⊨', '⊩', '⊪', '⊫', '⊬', '⊭', '⊮', '⊯', '⊲', '⊳', '⊴', '⊵', '⋀', '⋁', '⋂', '⋃', '⋉', '⋊',\n '⋋', '⋌', '⟨', '⟩', '⟪', '⟫', '⟮', '⟯', '⧼', '⧽', '⦰',\n ],\n },\n {\n key: 'arrow',\n label: '箭头',\n children: [\n '←', '↑', '→', '↓', '↔', '↕', '↖', '↗', '↘', '↙', '↚', '↛', '↜', '↝', '↞', '↟', '↠', '↡', '↢', '↣', '↤', '↥', '↦', '↧', '↨',\n '↫', '↬', '↭', '↮', '↯', '↰', '↱', '↲', '↳', '↴', '↵', '↶', '↷', '↸', '↹', '↺', '↻', '↼', '↽', '↾', '↿', '⇀', '⇁', '⇂', '⇃',\n '⇄', '⇅', '⇆', '⇇', '⇈', '⇉', '⇊', '⇋', '⇌', '⇍', '⇎', '⇏', '⇐', '⇑', '⇒', '⇓', '⇔', '⇕', '⇖', '⇗', '⇘', '⇙', '⇚', '⇛',\n '⇜', '⇝', '⇞', '⇟', '⇠', '⇡', '⇢', '⇣', '⇤', '⇥', '⇦', '⇧', '⇨', '⇩', '⇪', '⇫', '⇬', '⇭', '⇮', '⇯', '⇰', '⇱', '⇲', '⇳', '⇴', '⇵',\n '⇶', '⇷', '⇸', '⇹', '⇺', '⇻', '⇼', '⇽', '⇾', '⇿',\n ],\n },\n {\n key: 'graph',\n label: '图形',\n children: [\n '▢', '▣', '▤', '▥', '▦', '▧', '▨', '▩', '▭', '▮', '▯', '▰', '▱', '▲', '▷', '▼', '◁',\n '◈', '◉', '◍', '◐', '◑', '◒', '◓', '◔', '◕', '◧', '◨', '◩', '◪', '◫', '◬', '◭', '◮',\n ],\n },\n]","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-ba0c96fc\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"symbol-panel\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"pool\" }\nconst _hoisted_5 = [\"onClick\"]\nconst _hoisted_6 = { class: \"symbol\" }\n\nimport { computed, ref } from 'vue'\nimport { SYMBOL_LIST } from '@/configs/symbol'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SymbolPanel',\n setup(__props) {\n\nconst selectedSymbolKey = ref(SYMBOL_LIST[0].key)\nconst symbolPool = computed(() => {\n const selectedSymbol = SYMBOL_LIST.find(item => item.key === selectedSymbolKey.value)\n return selectedSymbol?.children || []\n})\n\nconst selectSymbol = (value: string) => {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command: 'insert', value } })\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(SYMBOL_LIST), (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': selectedSymbolKey.value === item.key }]),\n key: item.key,\n onClick: ($event: any) => (selectedSymbolKey.value = item.key)\n }, _toDisplayString(item.label), 11, _hoisted_3))\n }), 128))\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(symbolPool), (item, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"symbol-item\",\n key: index,\n onClick: ($event: any) => (selectSymbol(item))\n }, [\n _createElementVNode(\"div\", _hoisted_6, _toDisplayString(item), 1)\n ], 8, _hoisted_5))\n }), 128))\n ])\n ]))\n}\n}\n\n})","import script from \"./SymbolPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SymbolPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./SymbolPanel.vue?vue&type=style&index=0&id=ba0c96fc&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-ba0c96fc\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveDynamicComponent as _resolveDynamicComponent, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5303bd17\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"toolbar\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"content\" }\n\nimport { computed, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { ToolbarStates } from '@/types/toolbar'\n\nimport ElementStylePanel from './ElementStylePanel/index.vue'\nimport ElementPositionPanel from './ElementPositionPanel.vue'\nimport ElementAnimationPanel from './ElementAnimationPanel.vue'\nimport SlideDesignPanel from './SlideDesignPanel.vue'\nimport SlideAnimationPanel from './SlideAnimationPanel.vue'\nimport MultiPositionPanel from './MultiPositionPanel.vue'\nimport SymbolPanel from './SymbolPanel.vue'\n\ninterface ElementTabs {\n label: string\n value: ToolbarStates\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst { activeElementIdList, handleElement, toolbarState } = storeToRefs(mainStore)\n\nconst elementTabs = computed(() => {\n if (handleElement.value?.type === 'text') {\n return [\n { label: '样式', value: ToolbarStates.EL_STYLE },\n { label: '符号', value: ToolbarStates.SYMBOL },\n { label: '位置', value: ToolbarStates.EL_POSITION },\n { label: '动画', value: ToolbarStates.EL_ANIMATION },\n ]\n }\n return [\n { label: '样式', value: ToolbarStates.EL_STYLE },\n { label: '位置', value: ToolbarStates.EL_POSITION },\n { label: '动画', value: ToolbarStates.EL_ANIMATION },\n ]\n})\nconst slideTabs = [\n { label: '设计', value: ToolbarStates.SLIDE_DESIGN },\n { label: '切换', value: ToolbarStates.SLIDE_ANIMATION },\n { label: '动画', value: ToolbarStates.EL_ANIMATION },\n]\nconst multiSelectTabs = [\n { label: '样式', value: ToolbarStates.EL_STYLE },\n { label: '位置', value: ToolbarStates.MULTI_POSITION },\n]\n\nconst setToolbarState = (value: ToolbarStates) => {\n mainStore.setToolbarState(value)\n}\n\nconst currentTabs = computed(() => {\n if (!activeElementIdList.value.length) return slideTabs\n else if (activeElementIdList.value.length > 1) return multiSelectTabs\n return elementTabs.value\n})\n\nwatch(currentTabs, () => {\n const currentTabsValue: ToolbarStates[] = currentTabs.value.map(tab => tab.value)\n if (!currentTabsValue.includes(toolbarState.value)) {\n mainStore.setToolbarState(currentTabsValue[0])\n }\n})\n\nconst currentPanelComponent = computed(() => {\n const panelMap = {\n [ToolbarStates.EL_STYLE]: ElementStylePanel,\n [ToolbarStates.EL_POSITION]: ElementPositionPanel,\n [ToolbarStates.EL_ANIMATION]: ElementAnimationPanel,\n [ToolbarStates.SLIDE_DESIGN]: SlideDesignPanel,\n [ToolbarStates.SLIDE_ANIMATION]: SlideAnimationPanel,\n [ToolbarStates.MULTI_POSITION]: MultiPositionPanel,\n [ToolbarStates.SYMBOL]: SymbolPanel,\n }\n return panelMap[toolbarState.value] || null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(currentTabs), (tab) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': tab.value === _unref(toolbarState) }]),\n key: tab.value,\n onClick: ($event: any) => (setToolbarState(tab.value))\n }, _toDisplayString(tab.label), 11, _hoisted_3))\n }), 128))\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentPanelComponent))))\n ])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=5303bd17&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5303bd17\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-82b674f6\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"remark\" }\nconst _hoisted_2 = [\"value\"]\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n height: {\n type: Number,\n required: true,\n },\n},\n emits: [\"update:height\"],\n setup(__props, { emit }: { emit: ({\n (event: 'update:height', payload: number): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst slidesStore = useSlidesStore()\nconst { currentSlide } = storeToRefs(slidesStore)\n\nconst remark = computed(() => currentSlide.value?.remark || '')\n\nconst handleInput = (e: Event) => {\n const value = (e.target as HTMLTextAreaElement).value\n slidesStore.updateSlide({ remark: value })\n}\n\nconst resize = (e: MouseEvent) => {\n let isMouseDown = true\n const startPageY = e.pageY\n const originHeight = props.height\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageY = e.pageY\n\n const moveY = currentPageY - startPageY\n let newHeight = -moveY + originHeight\n\n if (newHeight < 40) newHeight = 40\n if (newHeight > 120) newHeight = 120\n\n emit('update:height', newHeight)\n }\n\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"resize-handler\",\n onMousedown: _cache[0] || (_cache[0] = $event => resize($event))\n }, null, 32),\n _createElementVNode(\"textarea\", {\n value: _unref(remark),\n placeholder: \"点击输入演讲者备注\",\n onInput: _cache[1] || (_cache[1] = $event => handleInput($event))\n }, null, 40, _hoisted_2)\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=82b674f6&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-82b674f6\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-60a953a0\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-img-dialog\" }\nconst _hoisted_2 = { class: \"thumbnails-view\" }\nconst _hoisted_3 = { class: \"configs\" }\nconst _hoisted_4 = { class: \"row\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"导出格式:\", -1))\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"JPEG\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"PNG\")\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"导出范围:\", -1))\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"全部\")\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\"当前页\")\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"自定义\")\nconst _hoisted_13 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_14 = [\"data-range\"]\nconst _hoisted_15 = { class: \"row\" }\nconst _hoisted_16 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"图片质量:\", -1))\nconst _hoisted_17 = { class: \"row\" }\nconst _hoisted_18 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"忽略在线字体:\", -1))\nconst _hoisted_19 = { class: \"config-item\" }\nconst _hoisted_20 = { class: \"btns\" }\nconst _hoisted_21 = /*#__PURE__*/_createTextVNode(\"导出图片\")\nconst _hoisted_22 = /*#__PURE__*/_createTextVNode(\"关闭\")\n\nimport { computed, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useExport from '@/hooks/useExport'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExportImage',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { slides, currentSlide } = storeToRefs(useSlidesStore())\n\nconst imageThumbnailsRef = ref()\nconst rangeType = ref<'all' | 'current' | 'custom'>('all')\nconst range = ref<[number, number]>([1, slides.value.length])\nconst format = ref<'jpeg' | 'png'>('jpeg')\nconst quality = ref(1)\nconst ignoreWebfont = ref(true)\n\nconst renderSlides = computed(() => {\n if (rangeType.value === 'all') return slides.value\n if (rangeType.value === 'current') return [currentSlide.value]\n return slides.value.filter((item, index) => {\n const [min, max] = range.value\n return index >= min - 1 && index <= max - 1\n })\n})\n\nconst { exportImage, exporting } = useExport()\n\nconst expImage = () => {\n if (!imageThumbnailsRef.value) return\n exportImage(imageThumbnailsRef.value, format.value, quality.value, ignoreWebfont.value)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_FullscreenSpin = _resolveComponent(\"FullscreenSpin\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: \"thumbnails\",\n ref_key: \"imageThumbnailsRef\",\n ref: imageThumbnailsRef\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(renderSlides), (slide) => {\n return (_openBlock(), _createBlock(ThumbnailSlide, {\n class: \"thumbnail\",\n key: slide.id,\n slide: slide,\n size: 1600\n }, null, 8, [\"slide\"]))\n }), 128))\n ], 512)\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _createVNode(_component_RadioGroup, {\n class: \"config-item\",\n value: format.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((format).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"50%\"},\n value: \"jpeg\"\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"50%\"},\n value: \"png\"\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_RadioGroup, {\n class: \"config-item\",\n value: rangeType.value,\n \"onUpdate:value\": _cache[1] || (_cache[1] = ($event: any) => ((rangeType).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"all\"\n }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"current\"\n }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"custom\"\n }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n (rangeType.value === 'custom')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_13, [\n _createElementVNode(\"div\", {\n class: \"title\",\n \"data-range\": `(${range.value[0]} ~ ${range.value[1]})`\n }, \"自定义范围:\", 8, _hoisted_14),\n _createVNode(_component_Slider, {\n class: \"config-item\",\n range: \"\",\n min: 1,\n max: _unref(slides).length,\n step: 1,\n value: range.value,\n \"onUpdate:value\": _cache[2] || (_cache[2] = ($event: any) => ((range).value = $event))\n }, null, 8, [\"max\", \"value\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_15, [\n _hoisted_16,\n _createVNode(_component_Slider, {\n class: \"config-item\",\n min: 0,\n max: 1,\n step: 0.1,\n value: quality.value,\n \"onUpdate:value\": _cache[3] || (_cache[3] = ($event: any) => ((quality).value = $event))\n }, null, 8, [\"step\", \"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_17, [\n _hoisted_18,\n _createElementVNode(\"div\", _hoisted_19, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"导出时默认忽略在线字体,若您在幻灯片中使用了在线字体,且希望导出后保留相关样式,可选择关闭【忽略在线字体】选项,但要注意这将会增加导出用时。\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Switch, {\n checked: ignoreWebfont.value,\n \"onUpdate:checked\": _cache[4] || (_cache[4] = ($event: any) => ((ignoreWebfont).value = $event))\n }, null, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_20, [\n _createVNode(_component_Button, {\n class: \"btn export\",\n type: \"primary\",\n onClick: _cache[5] || (_cache[5] = ($event: any) => (expImage()))\n }, {\n default: _withCtx(() => [\n _hoisted_21\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn close\",\n onClick: _cache[6] || (_cache[6] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_22\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_FullscreenSpin, {\n loading: _unref(exporting),\n tip: \"正在导出...\"\n }, null, 8, [\"loading\"])\n ]))\n}\n}\n\n})","import script from \"./ExportImage.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ExportImage.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ExportImage.vue?vue&type=style&index=0&id=60a953a0&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-60a953a0\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1bc24666\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-json-dialog\" }\nconst _hoisted_2 = { class: \"preview\" }\nconst _hoisted_3 = { class: \"btns\" }\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"导出 JSON\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"关闭\")\n\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useExport from '@/hooks/useExport'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExportJSON',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { slides } = storeToRefs(useSlidesStore())\nconst { exportJSON } = useExport()\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"pre\", null, _toDisplayString(_unref(slides)), 1)\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_Button, {\n class: \"btn export\",\n type: \"primary\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_unref(exportJSON)()))\n }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn close\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./ExportJSON.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ExportJSON.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ExportJSON.vue?vue&type=style&index=0&id=1bc24666&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1bc24666\"]])\n\nexport default __exports__","interface PageSize {\n width: number\n height: number\n margin: number\n}\n\nconst createIframe = () => {\n const iframe = document.createElement('iframe')\n iframe.style.width = '0'\n iframe.style.height = '0'\n iframe.style.position = 'absolute'\n iframe.style.right = '0'\n iframe.style.top = '0'\n iframe.style.border = '0'\n\n document.body.appendChild(iframe)\n\n return iframe\n}\n\nconst writeContent = (doc: Document, printNode: HTMLElement, size: PageSize) => {\n const docType = ''\n\n let style = ''\n const styleSheets = document.styleSheets\n if (styleSheets) {\n for (const styleSheet of styleSheets) {\n if (!styleSheet.cssRules) continue\n\n for (const rule of styleSheet.cssRules) {\n style += rule.cssText\n }\n }\n }\n\n const { width, height, margin } = size\n const head = `\n \n \n \n `\n const body = '' + printNode.innerHTML + ''\n\n doc.open()\n doc.write(`\n ${docType}\n \n ${head}\n ${body}\n \n `)\n doc.close()\n}\n\nexport const print = (printNode: HTMLElement, size: PageSize) => {\n const iframe = createIframe()\n const iframeContentWindow = iframe.contentWindow\n\n if (!iframe.contentDocument || !iframeContentWindow) return\n writeContent(iframe.contentDocument, printNode, size)\n\n const handleLoadIframe = () => {\n iframeContentWindow.focus()\n iframeContentWindow.print()\n }\n\n const handleAfterprint = () => {\n iframe.removeEventListener('load', handleLoadIframe)\n iframeContentWindow.removeEventListener('afterprint', handleAfterprint)\n document.body.removeChild(iframe)\n }\n\n iframe.addEventListener('load', handleLoadIframe)\n iframeContentWindow.addEventListener('afterprint', handleAfterprint)\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-15b57798\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-pdf-dialog\" }\nconst _hoisted_2 = { class: \"thumbnails-view\" }\nconst _hoisted_3 = { class: \"configs\" }\nconst _hoisted_4 = { class: \"row\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"导出范围:\", -1))\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"全部幻灯片\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"当前幻灯片\")\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"每页数量:\", -1))\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"1\")\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\"2\")\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"3\")\nconst _hoisted_13 = { class: \"row\" }\nconst _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"边缘留白:\", -1))\nconst _hoisted_15 = { class: \"config-item\" }\nconst _hoisted_16 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"tip\" }, \" 注意:若打印预览与实际样式不一致,请在弹出的打印窗口中勾选【背景图形】选项。 \", -1))\nconst _hoisted_17 = { class: \"btns\" }\nconst _hoisted_18 = /*#__PURE__*/_createTextVNode(\"打印 / 导出 PDF\")\nconst _hoisted_19 = /*#__PURE__*/_createTextVNode(\"关闭\")\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { print } from '@/utils/print'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExportPDF',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { slides, currentSlide } = storeToRefs(useSlidesStore())\n\nconst pdfThumbnailsRef = ref()\nconst rangeType = ref<'all' | 'current'>('all')\nconst count = ref(1)\nconst padding = ref(true)\n\nconst expPDF = () => {\n if (!pdfThumbnailsRef.value) return\n const pageSize = {\n width: 1600,\n height: rangeType.value === 'all' ? 900 * count.value : 900,\n margin: padding.value ? 50 : 0,\n }\n print(pdfThumbnailsRef.value, pageSize)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: \"thumbnails\",\n ref_key: \"pdfThumbnailsRef\",\n ref: pdfThumbnailsRef\n }, [\n (rangeType.value === 'current')\n ? (_openBlock(), _createBlock(ThumbnailSlide, {\n key: 0,\n class: \"thumbnail\",\n slide: _unref(currentSlide),\n size: 1600\n }, null, 8, [\"slide\"]))\n : (_openBlock(true), _createElementBlock(_Fragment, { key: 1 }, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createBlock(ThumbnailSlide, {\n class: _normalizeClass([\"thumbnail\", { 'break-page': (index + 1) % count.value === 0 }]),\n key: slide.id,\n slide: slide,\n size: 1600\n }, null, 8, [\"class\", \"slide\"]))\n }), 128))\n ], 512)\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _createVNode(_component_RadioGroup, {\n class: \"config-item\",\n value: rangeType.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((rangeType).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"50%\"},\n value: \"all\"\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"50%\"},\n value: \"current\"\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_Select, {\n class: \"config-item\",\n value: count.value,\n \"onUpdate:value\": _cache[1] || (_cache[1] = ($event: any) => ((count).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: 1 }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: 2 }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: 3 }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_13, [\n _hoisted_14,\n _createElementVNode(\"div\", _hoisted_15, [\n _createVNode(_component_Switch, {\n checked: padding.value,\n \"onUpdate:checked\": _cache[2] || (_cache[2] = ($event: any) => ((padding).value = $event))\n }, null, 8, [\"checked\"])\n ])\n ]),\n _hoisted_16\n ]),\n _createElementVNode(\"div\", _hoisted_17, [\n _createVNode(_component_Button, {\n class: \"btn export\",\n type: \"primary\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (expPDF()))\n }, {\n default: _withCtx(() => [\n _hoisted_18\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn close\",\n onClick: _cache[4] || (_cache[4] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_19\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./ExportPDF.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ExportPDF.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ExportPDF.vue?vue&type=style&index=0&id=15b57798&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-15b57798\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3fef9be0\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-pptx-dialog\" }\nconst _hoisted_2 = { class: \"configs\" }\nconst _hoisted_3 = { class: \"row\" }\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"导出范围:\", -1))\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"全部\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"当前页\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"自定义\")\nconst _hoisted_8 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_9 = [\"data-range\"]\nconst _hoisted_10 = { class: \"row\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"覆盖默认母版:\", -1))\nconst _hoisted_12 = { class: \"config-item\" }\nconst _hoisted_13 = { class: \"btns\" }\nconst _hoisted_14 = /*#__PURE__*/_createTextVNode(\"导出 PPTX\")\nconst _hoisted_15 = /*#__PURE__*/_createTextVNode(\"关闭\")\n\nimport { computed, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useExport from '@/hooks/useExport'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExportPPTX',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { slides, currentSlide } = storeToRefs(useSlidesStore())\n\nconst { exportPPTX, exporting } = useExport()\n\nconst rangeType = ref<'all' | 'current' | 'custom'>('all')\nconst range = ref<[number, number]>([1, slides.value.length])\nconst masterOverwrite = ref(true)\n\nconst selectedSlides = computed(() => {\n if (rangeType.value === 'all') return slides.value\n if (rangeType.value === 'current') return [currentSlide.value]\n return slides.value.filter((item, index) => {\n const [min, max] = range.value\n return index >= min - 1 && index <= max - 1\n })\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_FullscreenSpin = _resolveComponent(\"FullscreenSpin\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _hoisted_4,\n _createVNode(_component_RadioGroup, {\n class: \"config-item\",\n value: rangeType.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((rangeType).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"all\"\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"current\"\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"custom\"\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n (rangeType.value === 'custom')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_8, [\n _createElementVNode(\"div\", {\n class: \"title\",\n \"data-range\": `(${range.value[0]} ~ ${range.value[1]})`\n }, \"自定义范围:\", 8, _hoisted_9),\n _createVNode(_component_Slider, {\n class: \"config-item\",\n range: \"\",\n min: 1,\n max: _unref(slides).length,\n step: 1,\n value: range.value,\n \"onUpdate:value\": _cache[1] || (_cache[1] = ($event: any) => ((range).value = $event))\n }, null, 8, [\"max\", \"value\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createElementVNode(\"div\", _hoisted_12, [\n _createVNode(_component_Switch, {\n checked: masterOverwrite.value,\n \"onUpdate:checked\": _cache[2] || (_cache[2] = ($event: any) => ((masterOverwrite).value = $event))\n }, null, 8, [\"checked\"])\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_13, [\n _createVNode(_component_Button, {\n class: \"btn export\",\n type: \"primary\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (_unref(exportPPTX)(_unref(selectedSlides), masterOverwrite.value)))\n }, {\n default: _withCtx(() => [\n _hoisted_14\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn close\",\n onClick: _cache[4] || (_cache[4] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_15\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_FullscreenSpin, {\n loading: _unref(exporting),\n tip: \"正在导出...\"\n }, null, 8, [\"loading\"])\n ]))\n}\n}\n\n})","import script from \"./ExportPPTX.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ExportPPTX.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ExportPPTX.vue?vue&type=style&index=0&id=3fef9be0&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-3fef9be0\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-e2b465d2\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-pptist-dialog\" }\nconst _hoisted_2 = { class: \"configs\" }\nconst _hoisted_3 = { class: \"row\" }\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"导出范围:\", -1))\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"全部\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"当前页\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"自定义\")\nconst _hoisted_8 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_9 = [\"data-range\"]\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"tip\" }, \" 提示:.pptist 是本应用的特有文件后缀,支持将该类型的文件导入回应用中。 \", -1))\nconst _hoisted_11 = { class: \"btns\" }\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"导出 .pptist 文件\")\nconst _hoisted_13 = /*#__PURE__*/_createTextVNode(\"关闭\")\n\nimport { computed, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useExport from '@/hooks/useExport'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExportSpecificFile',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { slides, currentSlide } = storeToRefs(useSlidesStore())\n\nconst { exportSpecificFile } = useExport()\n\nconst rangeType = ref<'all' | 'current' | 'custom'>('all')\nconst range = ref<[number, number]>([1, slides.value.length])\n\nconst selectedSlides = computed(() => {\n if (rangeType.value === 'all') return slides.value\n if (rangeType.value === 'current') return [currentSlide.value]\n return slides.value.filter((item, index) => {\n const [min, max] = range.value\n return index >= min - 1 && index <= max - 1\n })\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _hoisted_4,\n _createVNode(_component_RadioGroup, {\n class: \"config-item\",\n value: rangeType.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((rangeType).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"all\"\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"current\"\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"custom\"\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n (rangeType.value === 'custom')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_8, [\n _createElementVNode(\"div\", {\n class: \"title\",\n \"data-range\": `(${range.value[0]} ~ ${range.value[1]})`\n }, \"自定义范围:\", 8, _hoisted_9),\n _createVNode(_component_Slider, {\n class: \"config-item\",\n range: \"\",\n min: 1,\n max: _unref(slides).length,\n step: 1,\n value: range.value,\n \"onUpdate:value\": _cache[1] || (_cache[1] = ($event: any) => ((range).value = $event))\n }, null, 8, [\"max\", \"value\"])\n ]))\n : _createCommentVNode(\"\", true),\n _hoisted_10\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n _createVNode(_component_Button, {\n class: \"btn export\",\n type: \"primary\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_unref(exportSpecificFile)(_unref(selectedSlides))))\n }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn close\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_13\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./ExportSpecificFile.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ExportSpecificFile.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ExportSpecificFile.vue?vue&type=style&index=0&id=e2b465d2&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-e2b465d2\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, unref as _unref, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveDynamicComponent as _resolveDynamicComponent, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1f8f1a8b\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-dialog\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"content\" }\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { DialogForExportTypes } from '@/types/export'\n\nimport ExportImage from './ExportImage.vue'\nimport ExportJSON from './ExportJSON.vue'\nimport ExportPDF from './ExportPDF.vue'\nimport ExportPPTX from './ExportPPTX.vue'\nimport ExportSpecificFile from './ExportSpecificFile.vue'\n\ninterface TabItem {\n key: DialogForExportTypes\n label: string\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst { dialogForExport } = storeToRefs(mainStore)\n\nconst setDialogForExport = mainStore.setDialogForExport\n\nconst tabs: TabItem[] = [\n { key: 'pptist', label: '导出 pptist 文件' },\n { key: 'pptx', label: '导出 PPTX' },\n { key: 'image', label: '导出图片' },\n { key: 'json', label: '导出 JSON' },\n { key: 'pdf', label: '打印 / 导出 PDF' },\n]\n\nconst currentDialogComponent = computed(() => {\n const dialogMap = {\n 'image': ExportImage,\n 'json': ExportJSON,\n 'pdf': ExportPDF,\n 'pptx': ExportPPTX,\n 'pptist': ExportSpecificFile,\n }\n return dialogMap[dialogForExport.value] || null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (tab) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': tab.key === _unref(dialogForExport) }]),\n key: tab.key,\n onClick: ($event: any) => (_unref(setDialogForExport)(tab.key))\n }, _toDisplayString(tab.label), 11, _hoisted_3)\n }), 64))\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentDialogComponent)), {\n onClose: _cache[0] || (_cache[0] = ($event: any) => (_unref(setDialogForExport)('')))\n }, null, 32))\n ])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=1f8f1a8b&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1f8f1a8b\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, unref as _unref, resolveComponent as _resolveComponent, withCtx as _withCtx, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-328e1a4e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"pptist-editor\" }\nconst _hoisted_2 = { class: \"layout-content\" }\nconst _hoisted_3 = { class: \"layout-content-center\" }\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport useGlobalHotkey from '@/hooks/useGlobalHotkey'\nimport usePasteEvent from '@/hooks/usePasteEvent'\n\nimport EditorHeader from './EditorHeader/index.vue'\nimport Canvas from './Canvas/index.vue'\nimport CanvasTool from './CanvasTool/index.vue'\nimport Thumbnails from './Thumbnails/index.vue'\nimport Toolbar from './Toolbar/index.vue'\nimport Remark from './Remark/index.vue'\nimport ExportDialog from './ExportDialog/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst { dialogForExport } = storeToRefs(mainStore)\nconst closeExportDialog = () => mainStore.setDialogForExport('')\n\nconst remarkHeight = ref(40)\n\nuseGlobalHotkey()\nusePasteEvent()\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Modal = _resolveComponent(\"Modal\")!\n\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createVNode(EditorHeader, { class: \"layout-header\" }),\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(Thumbnails, { class: \"layout-content-left\" }),\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(CanvasTool, { class: \"center-top\" }),\n _createVNode(Canvas, {\n class: \"center-body\",\n style: _normalizeStyle({ height: `calc(100% - ${remarkHeight.value + 40}px)` })\n }, null, 8, [\"style\"]),\n _createVNode(Remark, {\n class: \"center-bottom\",\n height: remarkHeight.value,\n \"onUpdate:height\": _cache[0] || (_cache[0] = ($event: any) => ((remarkHeight).value = $event)),\n style: _normalizeStyle({ height: `${remarkHeight.value}px` })\n }, null, 8, [\"height\", \"style\"])\n ]),\n _createVNode(Toolbar, { class: \"layout-content-right\" })\n ])\n ]),\n _createVNode(_component_Modal, {\n visible: !!_unref(dialogForExport),\n footer: null,\n centered: \"\",\n closable: false,\n width: 680,\n destroyOnClose: \"\",\n onCancel: _cache[1] || (_cache[1] = ($event: any) => (closeExportDialog()))\n }, {\n default: _withCtx(() => [\n _createVNode(ExportDialog)\n ]),\n _: 1\n }, 8, [\"visible\"])\n ], 64))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=328e1a4e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-328e1a4e\"]])\n\nexport default __exports__","import { onMounted, onUnmounted, ref } from 'vue'\nimport { throttle } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { KEYS } from '@/configs/hotkey'\nimport { ANIMATION_CLASS_PREFIX } from '@/configs/animation'\n\nimport { message } from 'ant-design-vue'\n\nexport default () => {\n const slidesStore = useSlidesStore()\n const { slides, slideIndex, formatedAnimations } = storeToRefs(slidesStore)\n\n // 当前页的元素动画执行到的位置\n const animationIndex = ref(0)\n\n // 动画执行状态\n const inAnimation = ref(false)\n\n // 最小已播放页面索引\n const playedSlidesMinIndex = ref(slideIndex.value)\n\n // 执行元素动画\n const runAnimation = () => {\n // 正在执行动画时,禁止其他新的动画开始\n if (inAnimation.value) return\n\n const { animations, autoNext } = formatedAnimations.value[animationIndex.value]\n animationIndex.value += 1\n\n // 标记开始执行动画\n inAnimation.value = true\n\n let endAnimationCount = 0\n\n // 依次执行该位置中的全部动画\n for (const animation of animations) {\n const elRef: HTMLElement | null = document.querySelector(`#screen-element-${animation.elId} [class^=base-element-]`)\n if (!elRef) {\n endAnimationCount += 1\n continue\n }\n\n const animationName = `${ANIMATION_CLASS_PREFIX}${animation.effect}`\n \n // 执行动画前先清除原有的动画状态(如果有)\n elRef.style.removeProperty('--animate-duration')\n for (const classname of elRef.classList) {\n if (classname.indexOf(ANIMATION_CLASS_PREFIX) !== -1) elRef.classList.remove(classname, `${ANIMATION_CLASS_PREFIX}animated`)\n }\n \n // 执行动画\n elRef.style.setProperty('--animate-duration', `${animation.duration}ms`)\n elRef.classList.add(animationName, `${ANIMATION_CLASS_PREFIX}animated`)\n\n // 执行动画结束,将“退场”以外的动画状态清除\n const handleAnimationEnd = () => {\n if (animation.type !== 'out') {\n elRef.style.removeProperty('--animate-duration')\n elRef.classList.remove(animationName, `${ANIMATION_CLASS_PREFIX}animated`)\n }\n\n // 判断该位置上的全部动画都已经结束后,标记动画执行完成,并尝试继续向下执行(如果有需要)\n endAnimationCount += 1\n if (endAnimationCount === animations.length) {\n inAnimation.value = false\n if (autoNext) runAnimation()\n }\n }\n elRef.addEventListener('animationend', handleAnimationEnd, { once: true })\n }\n }\n\n // 撤销元素动画,除了将索引前移外,还需要清除动画状态\n const revokeAnimation = () => {\n animationIndex.value -= 1\n const { animations } = formatedAnimations.value[animationIndex.value]\n\n for (const animation of animations) {\n const elRef: HTMLElement | null = document.querySelector(`#screen-element-${animation.elId} [class^=base-element-]`)\n if (!elRef) continue\n \n elRef.style.removeProperty('--animate-duration')\n for (const classname of elRef.classList) {\n if (classname.indexOf(ANIMATION_CLASS_PREFIX) !== -1) elRef.classList.remove(classname, `${ANIMATION_CLASS_PREFIX}animated`)\n }\n }\n\n // 如果撤销时该位置有且仅有强调动画,则继续执行一次撤销\n if (animations.every(item => item.type === 'attention')) execPrev()\n }\n\n // 关闭自动播放\n const autoPlayTimer = ref(0)\n const closeAutoPlay = () => {\n if (autoPlayTimer.value) {\n clearInterval(autoPlayTimer.value)\n autoPlayTimer.value = 0\n }\n }\n onUnmounted(closeAutoPlay)\n\n const throttleMassage = throttle(function(msg) {\n message.success(msg)\n }, 1000, { leading: true, trailing: false })\n\n // 向上/向下播放\n // 遇到元素动画时,优先执行动画播放,无动画则执行翻页\n // 向上播放遇到动画时,仅撤销到动画执行前的状态,不需要反向播放动画\n // 撤回到上一页时,若该页从未播放过(意味着不存在动画状态),需要将动画索引置为最小值(初始状态),否则置为最大值(最终状态)\n const execPrev = () => {\n if (formatedAnimations.value.length && animationIndex.value > 0) {\n revokeAnimation()\n }\n else if (slideIndex.value > 0) {\n slidesStore.updateSlideIndex(slideIndex.value - 1)\n if (slideIndex.value < playedSlidesMinIndex.value) {\n animationIndex.value = 0\n playedSlidesMinIndex.value = slideIndex.value\n }\n else animationIndex.value = formatedAnimations.value.length\n }\n else {\n throttleMassage('已经是第一页了')\n }\n inAnimation.value = false\n }\n const execNext = () => {\n if (formatedAnimations.value.length && animationIndex.value < formatedAnimations.value.length) {\n runAnimation()\n }\n else if (slideIndex.value < slides.value.length - 1) {\n slidesStore.updateSlideIndex(slideIndex.value + 1)\n animationIndex.value = 0\n inAnimation.value = false\n }\n else {\n throttleMassage('已经是最后一页了')\n closeAutoPlay()\n inAnimation.value = false\n }\n }\n\n // 自动播放\n const autoPlay = () => {\n closeAutoPlay()\n message.success('开始自动放映')\n autoPlayTimer.value = setInterval(execNext, 2500)\n }\n\n // 鼠标滚动翻页\n const mousewheelListener = throttle(function(e: WheelEvent) {\n if (e.deltaY < 0) execPrev()\n else if (e.deltaY > 0) execNext()\n }, 500, { leading: true, trailing: false })\n\n // 触摸屏上下滑动翻页\n const touchInfo = ref<{ x: number; y: number; } | null>(null)\n\n const touchStartListener = (e: TouchEvent) => {\n touchInfo.value = {\n x: e.changedTouches[0].pageX,\n y: e.changedTouches[0].pageY,\n }\n }\n const touchEndListener = (e: TouchEvent) => {\n if (!touchInfo.value) return\n\n const offsetX = Math.abs(touchInfo.value.x - e.changedTouches[0].pageX)\n const offsetY = e.changedTouches[0].pageY - touchInfo.value.y\n\n if ( Math.abs(offsetY) > offsetX && Math.abs(offsetY) > 50 ) {\n touchInfo.value = null\n\n if (offsetY > 0) execPrev()\n else execNext()\n }\n }\n\n // 快捷键翻页\n const keydownListener = (e: KeyboardEvent) => {\n const key = e.key.toUpperCase()\n\n if (key === KEYS.UP || key === KEYS.LEFT || key === KEYS.PAGEUP) execPrev()\n else if (\n key === KEYS.DOWN || \n key === KEYS.RIGHT ||\n key === KEYS.SPACE || \n key === KEYS.ENTER ||\n key === KEYS.PAGEDOWN\n ) execNext()\n }\n\n onMounted(() => document.addEventListener('keydown', keydownListener))\n onUnmounted(() => document.removeEventListener('keydown', keydownListener))\n\n // 切换到上一张/上一张幻灯片(无视元素的入场动画)\n const turnPrevSlide = () => {\n slidesStore.updateSlideIndex(slideIndex.value - 1)\n animationIndex.value = 0\n }\n const turnNextSlide = () => {\n slidesStore.updateSlideIndex(slideIndex.value + 1)\n animationIndex.value = 0\n }\n\n // 切换幻灯片到指定的页面\n const turnSlideToIndex = (index: number) => {\n slidesStore.updateSlideIndex(index)\n animationIndex.value = 0\n }\n const turnSlideToId = (id: string) => {\n const index = slides.value.findIndex(slide => slide.id === id)\n if (index !== -1) {\n slidesStore.updateSlideIndex(index)\n animationIndex.value = 0\n }\n }\n\n return {\n autoPlayTimer,\n autoPlay,\n closeAutoPlay,\n mousewheelListener,\n touchStartListener,\n touchEndListener,\n turnPrevSlide,\n turnNextSlide,\n turnSlideToIndex,\n turnSlideToId,\n execPrev,\n execNext,\n animationIndex,\n }\n}\n","import { onMounted, onUnmounted, Ref, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\n\nexport default (wrapRef?: Ref) => {\n const slidesStore = useSlidesStore()\n const { viewportRatio } = storeToRefs(slidesStore)\n\n const slideWidth = ref(0)\n const slideHeight = ref(0)\n\n // 计算和更新幻灯片内容的尺寸(按比例自适应屏幕)\n const setSlideContentSize = () => {\n const slideWrapRef = wrapRef?.value || document.body\n const winWidth = slideWrapRef.clientWidth\n const winHeight = slideWrapRef.clientHeight\n let width, height\n\n if (winHeight / winWidth === viewportRatio.value) {\n width = winWidth\n height = winHeight\n }\n else if (winHeight / winWidth > viewportRatio.value) {\n width = winWidth\n height = winWidth * viewportRatio.value\n }\n else {\n width = winHeight / viewportRatio.value\n height = winHeight\n }\n slideWidth.value = width\n slideHeight.value = height\n }\n\n onMounted(() => {\n setSlideContentSize()\n window.addEventListener('resize', setSlideContentSize)\n })\n onUnmounted(() => {\n window.removeEventListener('resize', setSlideContentSize)\n })\n\n return {\n slideWidth,\n slideHeight,\n }\n}","import { onMounted, onUnmounted, ref } from 'vue'\nimport { isFullscreen, exitFullscreen } from '@/utils/fullscreen'\nimport useScreening from '@/hooks/useScreening'\n\nexport default () => {\n const fullscreenState = ref(true)\n const escExit = ref(true)\n\n const { exitScreening } = useScreening()\n\n const handleFullscreenChange = () => {\n fullscreenState.value = isFullscreen()\n if (!fullscreenState.value && escExit.value) exitScreening()\n\n escExit.value = true\n }\n\n onMounted(() => {\n fullscreenState.value = isFullscreen()\n document.addEventListener('fullscreenchange', handleFullscreenChange)\n document.addEventListener('webkitfullscreenchange', handleFullscreenChange) // Safari 兼容\n })\n onUnmounted(() => {\n document.removeEventListener('fullscreenchange', handleFullscreenChange)\n document.removeEventListener('webkitfullscreenchange', handleFullscreenChange)\n })\n\n const manualExitFullscreen = () => {\n if (!fullscreenState.value) return\n escExit.value = false\n exitFullscreen()\n }\n\n return {\n fullscreenState,\n manualExitFullscreen,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nimport { PropType } from 'vue'\nimport { PPTChartElement } from '@/types/slides'\n\nimport BaseChartElement from './BaseChartElement.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenChartElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(BaseChartElement, {\n class: \"screen-element-chart\",\n elementInfo: __props.elementInfo\n }, null, 8, [\"elementInfo\"]))\n}\n}\n\n})","import script from \"./ScreenChartElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenChartElement.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-76457308\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\n\nimport { computed, inject, PropType, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { PPTVideoElement } from '@/types/slides'\nimport { injectKeySlideId, injectKeySlideScale } from '@/types/injectKey'\n\nimport VideoPlayer from './VideoPlayer/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenVideoElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { currentSlide } = storeToRefs(useSlidesStore())\n\nconst scale = inject(injectKeySlideScale) || ref(1)\nconst slideId = inject(injectKeySlideId) || ref('')\n\nconst inCurrentSlide = computed(() => currentSlide.value.id === slideId.value)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"screen-element-video\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n (_unref(inCurrentSlide))\n ? (_openBlock(), _createBlock(VideoPlayer, {\n key: 0,\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n src: __props.elementInfo.src,\n poster: __props.elementInfo.poster,\n scale: _unref(scale)\n }, null, 8, [\"width\", \"height\", \"src\", \"poster\", \"scale\"]))\n : _createCommentVNode(\"\", true)\n ])\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./ScreenVideoElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenVideoElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ScreenVideoElement.vue?vue&type=style&index=0&id=76457308&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-76457308\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, normalizeStyle as _normalizeStyle, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1172b8ee\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\n\nimport { computed, inject, PropType, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { PPTAudioElement } from '@/types/slides'\nimport { injectKeySlideId, injectKeySlideScale } from '@/types/injectKey'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\n\nimport AudioPlayer from './AudioPlayer.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenAudioElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { viewportRatio, currentSlide } = storeToRefs(useSlidesStore())\n\nconst scale = inject(injectKeySlideScale) || ref(1)\nconst slideId = inject(injectKeySlideId) || ref('')\n\nconst inCurrentSlide = computed(() => currentSlide.value.id === slideId.value)\n\nconst audioIconSize = computed(() => {\n return Math.min(props.elementInfo.width, props.elementInfo.height) + 'px'\n})\nconst audioPlayerPosition = computed(() => {\n const canvasWidth = VIEWPORT_SIZE\n const canvasHeight = VIEWPORT_SIZE * viewportRatio.value\n\n const audioWidth = 280 / scale.value\n const audioHeight = 50 / scale.value\n\n const elWidth = props.elementInfo.width\n const elHeight = props.elementInfo.height\n const elLeft = props.elementInfo.left\n const elTop = props.elementInfo.top\n\n let left = 0\n let top = elHeight\n \n if (elLeft + audioWidth >= canvasWidth) left = elWidth - audioWidth\n if (elTop + elHeight + audioHeight >= canvasHeight) top = -audioHeight\n\n return {\n left: left + 'px',\n top: top + 'px',\n }\n})\n\nconst audioPlayerRef = ref()\nconst toggle = () => {\n if (!audioPlayerRef.value) return\n audioPlayerRef.value.toggle()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconVolumeNotice = _resolveComponent(\"IconVolumeNotice\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"screen-element-audio\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createVNode(_component_IconVolumeNotice, {\n class: \"audio-icon\",\n style: _normalizeStyle({\n fontSize: _unref(audioIconSize),\n color: __props.elementInfo.color,\n }),\n onClick: _cache[0] || (_cache[0] = ($event: any) => (toggle()))\n }, null, 8, [\"style\"]),\n (_unref(inCurrentSlide))\n ? (_openBlock(), _createBlock(AudioPlayer, {\n key: 0,\n class: \"audio-player\",\n ref_key: \"audioPlayerRef\",\n ref: audioPlayerRef,\n style: _normalizeStyle({ ..._unref(audioPlayerPosition) }),\n src: __props.elementInfo.src,\n loop: __props.elementInfo.loop,\n autoplay: __props.elementInfo.autoplay,\n scale: _unref(scale)\n }, null, 8, [\"style\", \"src\", \"loop\", \"autoplay\", \"scale\"]))\n : _createCommentVNode(\"\", true)\n ])\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./ScreenAudioElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenAudioElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ScreenAudioElement.vue?vue&type=style&index=0&id=1172b8ee&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1172b8ee\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-a15cc1d8\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"id\", \"title\"]\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { ElementTypes, PPTElement } from '@/types/slides'\n\nimport BaseImageElement from '@/views/components/element/ImageElement/BaseImageElement.vue'\nimport BaseTextElement from '@/views/components/element/TextElement/BaseTextElement.vue'\nimport BaseShapeElement from '@/views/components/element/ShapeElement/BaseShapeElement.vue'\nimport BaseLineElement from '@/views/components/element/LineElement/BaseLineElement.vue'\nimport ScreenChartElement from '@/views/components/element/ChartElement/ScreenChartElement.vue'\nimport BaseTableElement from '@/views/components/element/TableElement/BaseTableElement.vue'\nimport BaseLatexElement from '@/views/components/element/LatexElement/BaseLatexElement.vue'\nimport ScreenVideoElement from '@/views/components/element/VideoElement/ScreenVideoElement.vue'\nimport ScreenAudioElement from '@/views/components/element/AudioElement/ScreenAudioElement.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n elementIndex: {\n type: Number,\n required: true,\n },\n animationIndex: {\n type: Number,\n required: true,\n },\n turnSlideToId: {\n type: Function as PropType<(id: string) => void>,\n required: true,\n },\n manualExitFullscreen: {\n type: Function as PropType<() => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst currentElementComponent = computed(() => {\n const elementTypeMap = {\n [ElementTypes.IMAGE]: BaseImageElement,\n [ElementTypes.TEXT]: BaseTextElement,\n [ElementTypes.SHAPE]: BaseShapeElement,\n [ElementTypes.LINE]: BaseLineElement,\n [ElementTypes.CHART]: ScreenChartElement,\n [ElementTypes.TABLE]: BaseTableElement,\n [ElementTypes.LATEX]: BaseLatexElement,\n [ElementTypes.VIDEO]: ScreenVideoElement,\n [ElementTypes.AUDIO]: ScreenAudioElement,\n }\n return elementTypeMap[props.elementInfo.type] || null\n})\n\nconst { formatedAnimations, theme } = storeToRefs(useSlidesStore())\n\n// 判断元素是否需要等待执行入场动画:等待执行入场的元素需要先隐藏\nconst needWaitAnimation = computed(() => {\n // 该元素在本页动画序列中的位置\n const elementIndexInAnimation = formatedAnimations.value.findIndex(item => {\n const elIds = item.animations.map(item => item.elId)\n return elIds.includes(props.elementInfo.id)\n })\n\n // 该元素未设置过动画\n if (elementIndexInAnimation === -1) return false\n\n // 若该元素已执行过动画,都无须隐藏\n // 具体来说:若已执行的最后一个动画为入场,显然无须隐藏;若已执行的最后一个动画为退场,由于保留了退场动画结束状态,也无需额外隐藏\n if (elementIndexInAnimation < props.animationIndex) return false\n\n // 若该元素未执行过动画,获取其将要执行的第一个动画\n // 若将要执行的第一个动画为入场,则需要隐藏,否则无须隐藏\n const firstAnimation = formatedAnimations.value[elementIndexInAnimation].animations.find(item => item.elId === props.elementInfo.id)\n if (firstAnimation?.type === 'in') return true\n return false\n})\n\n// 打开元素绑定的超链接\nconst openLink = () => {\n const link = props.elementInfo.link\n if (!link) return\n\n if (link.type === 'web') {\n props.manualExitFullscreen()\n window.open(link.target)\n }\n else if (link.type === 'slide') {\n props.turnSlideToId(link.target)\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"screen-element\", { 'link': __props.elementInfo.link }]),\n id: `screen-element-${__props.elementInfo.id}`,\n style: _normalizeStyle({\n zIndex: __props.elementIndex,\n color: _unref(theme).fontColor,\n fontFamily: _unref(theme).fontName,\n visibility: _unref(needWaitAnimation) ? 'hidden' : 'visible',\n }),\n title: __props.elementInfo.link?.target || '',\n onClick: _cache[0] || (_cache[0] = ($event: any) => (openLink()))\n }, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentElementComponent)), { elementInfo: __props.elementInfo }, null, 8, [\"elementInfo\"]))\n ], 14, _hoisted_1))\n}\n}\n\n})","import script from \"./ScreenElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ScreenElement.vue?vue&type=style&index=0&id=a15cc1d8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-a15cc1d8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock } from \"vue\"\n\nimport { computed, PropType, provide } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { Slide } from '@/types/slides'\nimport { injectKeySlideId } from '@/types/injectKey'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'\n\nimport ScreenElement from './ScreenElement.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenSlide',\n props: {\n slide: {\n type: Object as PropType,\n required: true,\n },\n scale: {\n type: Number,\n required: true,\n },\n animationIndex: {\n type: Number,\n required: true,\n },\n turnSlideToId: {\n type: Function as PropType<(id: string) => void>,\n required: true,\n },\n manualExitFullscreen: {\n type: Function as PropType<() => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { viewportRatio } = storeToRefs(useSlidesStore())\n\nconst background = computed(() => props.slide.background)\nconst { backgroundStyle } = useSlideBackgroundStyle(background)\n\nconst slideId = computed(() => props.slide.id)\nprovide(injectKeySlideId, slideId)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"screen-slide\",\n style: _normalizeStyle({\n width: _unref(VIEWPORT_SIZE) + 'px',\n height: _unref(VIEWPORT_SIZE) * _unref(viewportRatio) + 'px',\n transform: `scale(${__props.scale})`,\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"background\",\n style: _normalizeStyle({ ..._unref(backgroundStyle) })\n }, null, 4),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.slide.elements, (element, index) => {\n return (_openBlock(), _createBlock(ScreenElement, {\n key: element.id,\n elementInfo: element,\n elementIndex: index + 1,\n animationIndex: __props.animationIndex,\n turnSlideToId: __props.turnSlideToId,\n manualExitFullscreen: __props.manualExitFullscreen\n }, null, 8, [\"elementInfo\", \"elementIndex\", \"animationIndex\", \"turnSlideToId\", \"manualExitFullscreen\"]))\n }), 128))\n ], 4))\n}\n}\n\n})","import script from \"./ScreenSlide.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenSlide.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ScreenSlide.vue?vue&type=style&index=0&id=7cf7f9e7&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7cf7f9e7\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-77a3e620\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"screen-slide-list\" }\n\nimport { computed, PropType, provide } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { injectKeySlideScale } from '@/types/injectKey'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\n\nimport ScreenSlide from './ScreenSlide.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenSlideList',\n props: {\n slideWidth: {\n type: Number,\n required: true,\n },\n slideHeight: {\n type: Number,\n required: true,\n },\n animationIndex: {\n type: Number,\n required: true,\n },\n turnSlideToId: {\n type: Function as PropType<(id: string) => void>,\n required: true,\n },\n manualExitFullscreen: {\n type: Function as PropType<() => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { slides, slideIndex, currentSlide } = storeToRefs(useSlidesStore())\n\nconst scale = computed(() => props.slideWidth / VIEWPORT_SIZE)\nprovide(injectKeySlideScale, scale)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\n 'slide-item', \n `turning-mode-${slide.turningMode || 'slideY'}`,\n {\n 'current': index === _unref(slideIndex),\n 'before': index < _unref(slideIndex),\n 'after': index > _unref(slideIndex),\n 'hide': (index === _unref(slideIndex) - 1 || index === _unref(slideIndex) + 1) && slide.turningMode !== _unref(currentSlide).turningMode,\n }\n ]),\n key: slide.id\n }, [\n (Math.abs(_unref(slideIndex) - index) < 2 || slide.animations?.length)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"slide-content\",\n style: _normalizeStyle({\n width: __props.slideWidth + 'px',\n height: __props.slideHeight + 'px',\n })\n }, [\n _createVNode(ScreenSlide, {\n slide: slide,\n scale: _unref(scale),\n animationIndex: __props.animationIndex,\n turnSlideToId: __props.turnSlideToId,\n manualExitFullscreen: __props.manualExitFullscreen\n }, null, 8, [\"slide\", \"scale\", \"animationIndex\", \"turnSlideToId\", \"manualExitFullscreen\"])\n ], 4))\n : _createCommentVNode(\"\", true)\n ], 2))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./ScreenSlideList.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenSlideList.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ScreenSlideList.vue?vue&type=style&index=0&id=77a3e620&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-77a3e620\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createElementVNode as _createElementVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-b7c6c0cc\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"slide-thumbnails\" }\nconst _hoisted_2 = { class: \"return-button\" }\nconst _hoisted_3 = { class: \"slide-thumbnails-content\" }\nconst _hoisted_4 = [\"onClick\"]\n\nimport { PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useLoadSlides from '@/hooks/useLoadSlides'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SlideThumbnails',\n props: {\n turnSlideToIndex: {\n type: Function as PropType<(index: number) => void>,\n required: true,\n },\n},\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst { slides, slideIndex } = storeToRefs(useSlidesStore())\n\nconst { slidesLoadLimit } = useLoadSlides()\n\nconst turnSlide = (index: number) => {\n props.turnSlideToIndex(index)\n emit('close')\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconArrowCircleLeft = _resolveComponent(\"IconArrowCircleLeft\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_IconArrowCircleLeft, {\n class: \"icon\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (emit('close')))\n })\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"thumbnail\", { 'active': index === _unref(slideIndex) }]),\n key: slide.id,\n onClick: ($event: any) => (turnSlide(index))\n }, [\n _createVNode(ThumbnailSlide, {\n slide: slide,\n size: 150,\n visible: index < _unref(slidesLoadLimit)\n }, null, 8, [\"slide\", \"visible\"])\n ], 10, _hoisted_4))\n }), 128))\n ])\n ]))\n}\n}\n\n})","import script from \"./SlideThumbnails.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SlideThumbnails.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./SlideThumbnails.vue?vue&type=style&index=0&id=b7c6c0cc&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-b7c6c0cc\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1d4eb7f0\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 0,\n class: \"blackboard\"\n}\n\nimport { computed, onMounted, onUnmounted, PropType, ref, watch } from 'vue'\nimport { throttle } from 'lodash'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'WritingBoard',\n props: {\n color: {\n type: String,\n default: '#ffcc00',\n },\n model: {\n type: String as PropType<'pen' | 'eraser' | 'mark'>,\n default: 'pen',\n },\n blackboard: {\n type: Boolean,\n default: false,\n },\n},\n setup(__props, { expose }) {\n\nconst props = __props\n\n\n\nlet ctx: CanvasRenderingContext2D | null = null\nconst writingBoardRef = ref()\nconst canvasRef = ref()\n\nconst penSize = ref(6)\nconst rubberSize = ref(80)\nconst markSize = ref(24)\n\nlet lastPos = {\n x: 0,\n y: 0,\n}\nlet isMouseDown = false\nlet lastTime = 0\nlet lastLineWidth = -1\n\n// 鼠标位置坐标:用于画笔或橡皮位置跟随\nconst mouse = ref({\n x: 0,\n y: 0,\n})\n\n// 鼠标是否处在画布范围内:处在范围内才会显示画笔或橡皮\nconst mouseInCanvas = ref(false)\n\n// 监听更新canvas尺寸\nconst canvasWidth = ref(0)\nconst canvasHeight = ref(0)\n\nconst widthScale = computed(() => canvasRef.value ? canvasWidth.value / canvasRef.value.width : 1)\nconst heightScale = computed(() => canvasRef.value ? canvasHeight.value / canvasRef.value.height : 1)\n\nconst updateCanvasSize = () => {\n if (!writingBoardRef.value) return\n canvasWidth.value = writingBoardRef.value.clientWidth\n canvasHeight.value = writingBoardRef.value.clientHeight\n}\nconst resizeObserver = new ResizeObserver(updateCanvasSize)\nonMounted(() => {\n if (writingBoardRef.value) resizeObserver.observe(writingBoardRef.value)\n})\nonUnmounted(() => {\n if (writingBoardRef.value) resizeObserver.unobserve(writingBoardRef.value)\n})\n\n// 初始化画布\nconst initCanvas = () => {\n if (!canvasRef.value || !writingBoardRef.value) return\n\n ctx = canvasRef.value.getContext('2d')\n if (!ctx) return\n\n canvasRef.value.width = writingBoardRef.value.clientWidth\n canvasRef.value.height = writingBoardRef.value.clientHeight\n\n ctx.lineCap = 'round'\n ctx.lineJoin = 'round'\n}\nonMounted(initCanvas)\n\n// 切换画笔模式时,更新 canvas ctx 配置\nconst updateCtx = () => {\n if (!ctx) return\n if (props.model === 'mark') {\n ctx.globalCompositeOperation = 'xor'\n ctx.globalAlpha = 0.5\n }\n else if (props.model === 'pen') {\n ctx.globalCompositeOperation = 'source-over'\n ctx.globalAlpha = 1\n }\n}\nwatch(() => props.model, updateCtx)\n\n// 绘制画笔墨迹方法\nconst draw = (posX: number, posY: number, lineWidth: number) => {\n if (!ctx) return\n\n const lastPosX = lastPos.x\n const lastPosY = lastPos.y\n\n ctx.lineWidth = lineWidth\n ctx.strokeStyle = props.color\n ctx.beginPath()\n ctx.moveTo(lastPosX, lastPosY)\n ctx.lineTo(posX, posY)\n ctx.stroke()\n ctx.closePath()\n}\n\n// 擦除墨迹方法\nconst erase = (posX: number, posY: number) => {\n if (!ctx || !canvasRef.value) return\n const lastPosX = lastPos.x\n const lastPosY = lastPos.y\n\n const radius = rubberSize.value / 2\n\n const sinRadius = radius * Math.sin(Math.atan((posY - lastPosY) / (posX - lastPosX)))\n const cosRadius = radius * Math.cos(Math.atan((posY - lastPosY) / (posX - lastPosX)))\n const rectPoint1: [number, number] = [lastPosX + sinRadius, lastPosY - cosRadius]\n const rectPoint2: [number, number] = [lastPosX - sinRadius, lastPosY + cosRadius]\n const rectPoint3: [number, number] = [posX + sinRadius, posY - cosRadius]\n const rectPoint4: [number, number] = [posX - sinRadius, posY + cosRadius]\n\n ctx.save()\n ctx.beginPath()\n ctx.arc(posX, posY, radius, 0, Math.PI * 2)\n ctx.clip()\n ctx.clearRect(0, 0, canvasRef.value.width, canvasRef.value.height)\n ctx.restore()\n\n ctx.save()\n ctx.beginPath()\n ctx.moveTo(...rectPoint1)\n ctx.lineTo(...rectPoint3)\n ctx.lineTo(...rectPoint4)\n ctx.lineTo(...rectPoint2)\n ctx.closePath()\n ctx.clip()\n ctx.clearRect(0, 0, canvasRef.value.width, canvasRef.value.height)\n ctx.restore()\n}\n\n// 计算鼠标两次移动之间的距离\nconst getDistance = (posX: number, posY: number) => {\n const lastPosX = lastPos.x\n const lastPosY = lastPos.y\n return Math.sqrt((posX - lastPosX) * (posX - lastPosX) + (posY - lastPosY) * (posY - lastPosY))\n}\n\n// 根据鼠标两次移动之间的距离s和时间t计算绘制速度,速度越快,墨迹越细\nconst getLineWidth = (s: number, t: number) => {\n const maxV = 10\n const minV = 0.1\n const maxWidth = penSize.value\n const minWidth = 3\n const v = s / t\n let lineWidth\n\n if (v <= minV) lineWidth = maxWidth\n else if (v >= maxV) lineWidth = minWidth\n else lineWidth = maxWidth - v / maxV * maxWidth\n\n if (lastLineWidth === -1) return lineWidth\n return lineWidth * 1 / 3 + lastLineWidth * 2 / 3\n}\n\n// 路径操作\nconst handleMove = (x: number, y: number) => {\n const time = new Date().getTime()\n\n if (props.model === 'pen') {\n const s = getDistance(x, y)\n const t = time - lastTime\n const lineWidth = getLineWidth(s, t)\n\n draw(x, y, lineWidth)\n lastLineWidth = lineWidth\n }\n else if (props.model === 'mark') draw(x, y, markSize.value)\n else erase(x, y)\n\n lastPos = { x, y }\n lastTime = new Date().getTime()\n}\n\n// 获取鼠标在canvas中的相对位置\nconst getMouseOffsetPosition = (e: MouseEvent | TouchEvent) => {\n if (!canvasRef.value) return [0, 0]\n const event = e instanceof MouseEvent ? e : e.changedTouches[0]\n const canvasRect = canvasRef.value.getBoundingClientRect()\n const x = event.pageX - canvasRect.x\n const y = event.pageY - canvasRect.y\n return [x, y]\n}\n\n// 处理鼠标(触摸)事件\n// 准备开始绘制/擦除墨迹(落笔)\nconst handleMousedown = (e: MouseEvent | TouchEvent) => {\n const [mouseX, mouseY] = getMouseOffsetPosition(e)\n const x = mouseX / widthScale.value\n const y = mouseY / heightScale.value\n\n isMouseDown = true\n lastPos = { x, y }\n lastTime = new Date().getTime()\n\n if (!(e instanceof MouseEvent)) {\n mouse.value = { x: mouseX, y: mouseY }\n mouseInCanvas.value = true\n }\n}\n\n// 开始绘制/擦除墨迹(移动)\nconst handleMousemove = (e: MouseEvent | TouchEvent) => {\n const [mouseX, mouseY] = getMouseOffsetPosition(e)\n const x = mouseX / widthScale.value\n const y = mouseY / heightScale.value\n\n mouse.value = { x: mouseX, y: mouseY }\n\n if (isMouseDown) handleMove(x, y)\n}\n\n// 结束绘制/擦除墨迹(停笔)\nconst handleMouseup = () => {\n if (!isMouseDown) return\n isMouseDown = false\n}\n\n// 清空画布\nconst clearCanvas = () => {\n if (!ctx || !canvasRef.value) return\n ctx.clearRect(0, 0, canvasRef.value.width, canvasRef.value.height)\n}\n\n// 获取 DataURL\nconst getImageDataURL = () => {\n return canvasRef.value?.toDataURL()\n}\n\n// 设置 DataURL(绘制图片到 canvas)\nconst setImageDataURL = (imageDataURL: string) => {\n const img = new Image()\n img.src = imageDataURL\n img.onload = () => {\n if (!ctx) return\n ctx.drawImage(img, 0, 0)\n }\n}\n\n// 滚动鼠标滚轮,调整笔触大小\nconst mousewheelListener = throttle(function(e: WheelEvent) {\n if (props.model === 'eraser') {\n if (e.deltaY < 0 && rubberSize.value < 200) rubberSize.value += 20\n else if (e.deltaY > 0 && rubberSize.value > 20) rubberSize.value -= 20\n }\n if (props.model === 'pen') {\n if (e.deltaY < 0 && penSize.value < 10) penSize.value += 2\n else if (e.deltaY > 0 && penSize.value > 4) penSize.value -= 2\n }\n if (props.model === 'mark') {\n if (e.deltaY < 0 && markSize.value < 40) markSize.value += 4\n else if (e.deltaY > 0 && markSize.value > 16) markSize.value -= 4\n }\n}, 300, { leading: true, trailing: false })\n\nexpose({\n clearCanvas,\n getImageDataURL,\n setImageDataURL,\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconWrite = _resolveComponent(\"IconWrite\")!\n const _component_IconHighLight = _resolveComponent(\"IconHighLight\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"writing-board\",\n ref_key: \"writingBoardRef\",\n ref: writingBoardRef\n }, [\n (__props.blackboard)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"canvas\", {\n class: \"canvas\",\n ref_key: \"canvasRef\",\n ref: canvasRef,\n style: _normalizeStyle({\n width: canvasWidth.value + 'px',\n height: canvasHeight.value + 'px',\n }),\n onMousedown: _cache[0] || (_cache[0] = $event => handleMousedown($event)),\n onMousemove: _cache[1] || (_cache[1] = $event => handleMousemove($event)),\n onMouseup: _cache[2] || (_cache[2] = ($event: any) => (handleMouseup())),\n onTouchstart: _cache[3] || (_cache[3] = $event => handleMousedown($event)),\n onTouchmove: _cache[4] || (_cache[4] = $event => handleMousemove($event)),\n onTouchend: _cache[5] || (_cache[5] = ($event: any) => {handleMouseup(); mouseInCanvas.value = false}),\n onMouseleave: _cache[6] || (_cache[6] = ($event: any) => {handleMouseup(); mouseInCanvas.value = false}),\n onMouseenter: _cache[7] || (_cache[7] = ($event: any) => (mouseInCanvas.value = true)),\n onWheel: _cache[8] || (_cache[8] = $event => _unref(mousewheelListener)($event))\n }, null, 36),\n (mouseInCanvas.value)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n (__props.model === 'eraser')\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"eraser\",\n style: _normalizeStyle({\n left: mouse.value.x - rubberSize.value / 2 + 'px',\n top: mouse.value.y - rubberSize.value / 2 + 'px',\n width: rubberSize.value + 'px',\n height: rubberSize.value + 'px',\n })\n }, null, 4))\n : _createCommentVNode(\"\", true),\n (__props.model === 'pen')\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: \"pen\",\n style: _normalizeStyle({\n left: mouse.value.x - penSize.value / 2 + 'px',\n top: mouse.value.y - penSize.value * 6 + penSize.value / 2 + 'px',\n color: __props.color,\n })\n }, [\n (__props.model === 'pen')\n ? (_openBlock(), _createBlock(_component_IconWrite, {\n key: 0,\n class: \"icon\",\n size: penSize.value * 6\n }, null, 8, [\"size\"]))\n : _createCommentVNode(\"\", true)\n ], 4))\n : _createCommentVNode(\"\", true),\n (__props.model === 'mark')\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 2,\n class: \"pen\",\n style: _normalizeStyle({\n left: mouse.value.x - markSize.value / 2 + 'px',\n top: mouse.value.y + 'px',\n color: __props.color,\n })\n }, [\n (__props.model === 'mark')\n ? (_openBlock(), _createBlock(_component_IconHighLight, {\n key: 0,\n class: \"icon\",\n size: markSize.value * 1.5\n }, null, 8, [\"size\"]))\n : _createCommentVNode(\"\", true)\n ], 4))\n : _createCommentVNode(\"\", true)\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 512))\n}\n}\n\n})","import script from \"./WritingBoard.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./WritingBoard.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./WritingBoard.vue?vue&type=style&index=0&id=1d4eb7f0&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1d4eb7f0\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, withCtx as _withCtx, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-876081a6\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"writing-board-tool\" }\nconst _hoisted_2 = { class: \"colors\" }\nconst _hoisted_3 = [\"onClick\"]\n\nimport { PropType, ref, StyleValue } from 'vue'\nimport WritingBoard from '@/components/WritingBoard.vue'\n\ntype WritingBoardModel = 'pen' | 'mark' | 'eraser'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'WritingBoardTool',\n props: {\n slideWidth: {\n type: Number,\n required: true,\n },\n slideHeight: {\n type: Number,\n required: true,\n },\n position: {\n type: Object as PropType,\n default: () => ({\n right: '5px',\n bottom: '5px',\n })\n },\n},\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst writingBoardColors = ['#000000', '#ffffff', '#1e497b', '#4e81bb', '#e2534d', '#9aba60', '#8165a0', '#47acc5', '#f9974c', '#ffff3a']\n\n\n\n\n\nconst writingBoardRef = ref()\nconst writingBoardColor = ref('#e2534d')\nconst writingBoardModel = ref('pen')\nconst blackboard = ref(false)\n\nconst changeModel = (model: WritingBoardModel) => {\n writingBoardModel.value = model\n}\n\n// 清除画布上的墨迹\nconst clearCanvas = () => {\n writingBoardRef.value!.clearCanvas()\n}\n\n// 修改画笔颜色,如果当前处于橡皮状态则先切换到画笔状态\nconst changeColor = (color: string) => {\n if (writingBoardModel.value === 'eraser') writingBoardModel.value = 'pen'\n writingBoardColor.value = color\n}\n\n// 关闭写字板\nconst closeWritingBoard = () => {\n emit('close')\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconWrite = _resolveComponent(\"IconWrite\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconHighLight = _resolveComponent(\"IconHighLight\")!\n const _component_IconErase = _resolveComponent(\"IconErase\")!\n const _component_IconClear = _resolveComponent(\"IconClear\")!\n const _component_IconFill = _resolveComponent(\"IconFill\")!\n const _component_IconClose = _resolveComponent(\"IconClose\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"writing-board-wrap\",\n style: _normalizeStyle({\n width: __props.slideWidth + 'px',\n height: __props.slideHeight + 'px',\n })\n }, [\n _createVNode(WritingBoard, {\n ref_key: \"writingBoardRef\",\n ref: writingBoardRef,\n color: writingBoardColor.value,\n blackboard: blackboard.value,\n model: writingBoardModel.value\n }, null, 8, [\"color\", \"blackboard\", \"model\"])\n ], 4),\n _createElementVNode(\"div\", {\n class: \"tools\",\n style: _normalizeStyle(__props.position)\n }, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"画笔\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"btn\", { 'active': writingBoardModel.value === 'pen' }]),\n onClick: _cache[0] || (_cache[0] = ($event: any) => (changeModel('pen')))\n }, [\n _createVNode(_component_IconWrite, { class: \"icon\" })\n ], 2)\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"荧光笔\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"btn\", { 'active': writingBoardModel.value === 'mark' }]),\n onClick: _cache[1] || (_cache[1] = ($event: any) => (changeModel('mark')))\n }, [\n _createVNode(_component_IconHighLight, { class: \"icon\" })\n ], 2)\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"橡皮擦\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"btn\", { 'active': writingBoardModel.value === 'eraser' }]),\n onClick: _cache[2] || (_cache[2] = ($event: any) => (changeModel('eraser')))\n }, [\n _createVNode(_component_IconErase, { class: \"icon\" })\n ], 2)\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"清除墨迹\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: \"btn\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (clearCanvas()))\n }, [\n _createVNode(_component_IconClear, { class: \"icon\" })\n ])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"黑板\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"btn\", { 'active': blackboard.value }]),\n onClick: _cache[4] || (_cache[4] = ($event: any) => (blackboard.value = !blackboard.value))\n }, [\n _createVNode(_component_IconFill, { class: \"icon\" })\n ], 2)\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(writingBoardColors, (color) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"color\", { 'active': color === writingBoardColor.value }]),\n key: color,\n style: _normalizeStyle({ backgroundColor: color }),\n onClick: ($event: any) => (changeColor(color))\n }, null, 14, _hoisted_3)\n }), 64))\n ]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"关闭画笔\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: \"btn\",\n onClick: _cache[5] || (_cache[5] = ($event: any) => (closeWritingBoard()))\n }, [\n _createVNode(_component_IconClose, { class: \"icon\" })\n ])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ], 4)\n ]))\n}\n}\n\n})","import script from \"./WritingBoardTool.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./WritingBoardTool.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./WritingBoardTool.vue?vue&type=style&index=0&id=876081a6&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-876081a6\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDirective as _resolveDirective, createVNode as _createVNode, withDirectives as _withDirectives, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, withCtx as _withCtx, normalizeClass as _normalizeClass, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-d72d6626\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"tools-left\" }\nconst _hoisted_2 = { class: \"content\" }\n\nimport { PropType, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport { enterFullscreen } from '@/utils/fullscreen'\nimport useScreening from '@/hooks/useScreening'\nimport useExecPlay from './hooks/useExecPlay'\nimport useSlideSize from './hooks/useSlideSize'\nimport useFullscreen from './hooks/useFullscreen'\n\nimport ScreenSlideList from './ScreenSlideList.vue'\nimport SlideThumbnails from './SlideThumbnails.vue'\nimport WritingBoardTool from './WritingBoardTool.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseView',\n props: {\n changeViewMode: {\n type: Function as PropType<(mode: 'base' | 'presenter') => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { slides, slideIndex } = storeToRefs(useSlidesStore())\n\nconst {\n autoPlayTimer,\n autoPlay,\n closeAutoPlay,\n mousewheelListener,\n touchStartListener,\n touchEndListener,\n turnPrevSlide,\n turnNextSlide,\n turnSlideToIndex,\n turnSlideToId,\n execPrev,\n execNext,\n animationIndex,\n} = useExecPlay()\n\nconst { slideWidth, slideHeight } = useSlideSize()\nconst { exitScreening } = useScreening()\nconst { fullscreenState, manualExitFullscreen } = useFullscreen()\n\nconst rightToolsVisible = ref(false)\nconst writingBoardToolVisible = ref(false)\nconst slideThumbnailModelVisible = ref(false)\nconst laserPen = ref(false)\n\nconst contextmenus = (): ContextmenuItem[] => {\n return [\n {\n text: '上一页',\n subText: '↑ ←',\n disable: slideIndex.value <= 0,\n handler: () => turnPrevSlide(),\n },\n {\n text: '下一页',\n subText: '↓ →',\n disable: slideIndex.value >= slides.value.length - 1,\n handler: () => turnNextSlide(),\n },\n {\n text: '第一页',\n disable: slideIndex.value === 0,\n handler: () => turnSlideToIndex(0),\n },\n {\n text: '最后一页',\n disable: slideIndex.value === slides.value.length - 1,\n handler: () => turnSlideToIndex(slides.value.length - 1),\n },\n { divider: true },\n {\n text: '显示工具栏',\n handler: () => rightToolsVisible.value = true,\n },\n {\n text: '查看所有幻灯片',\n handler: () => slideThumbnailModelVisible.value = true,\n },\n {\n text: '画笔工具',\n handler: () => writingBoardToolVisible.value = true,\n },\n {\n text: '演讲者视图',\n handler: () => props.changeViewMode('presenter'),\n },\n { divider: true },\n {\n text: autoPlayTimer.value ? '取消自动放映' : '自动放映',\n handler: autoPlayTimer.value ? closeAutoPlay : autoPlay,\n },\n {\n text: '结束放映',\n subText: 'ESC',\n handler: exitScreening,\n },\n ]\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconLeftTwo = _resolveComponent(\"IconLeftTwo\")!\n const _component_IconRightTwo = _resolveComponent(\"IconRightTwo\")!\n const _component_IconWrite = _resolveComponent(\"IconWrite\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconMagic = _resolveComponent(\"IconMagic\")!\n const _component_IconListView = _resolveComponent(\"IconListView\")!\n const _component_IconOffScreenOne = _resolveComponent(\"IconOffScreenOne\")!\n const _component_IconFullScreenOne = _resolveComponent(\"IconFullScreenOne\")!\n const _component_IconPower = _resolveComponent(\"IconPower\")!\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"base-view\", { 'laser-pen': laserPen.value }])\n }, [\n _withDirectives(_createVNode(ScreenSlideList, {\n slideWidth: _unref(slideWidth),\n slideHeight: _unref(slideHeight),\n animationIndex: _unref(animationIndex),\n turnSlideToId: _unref(turnSlideToId),\n manualExitFullscreen: _unref(manualExitFullscreen),\n onWheel: _cache[0] || (_cache[0] = $event => _unref(mousewheelListener)($event)),\n onTouchstart: _cache[1] || (_cache[1] = $event => _unref(touchStartListener)($event)),\n onTouchend: _cache[2] || (_cache[2] = $event => _unref(touchEndListener)($event))\n }, null, 8, [\"slideWidth\", \"slideHeight\", \"animationIndex\", \"turnSlideToId\", \"manualExitFullscreen\"]), [\n [_directive_contextmenu, contextmenus]\n ]),\n (slideThumbnailModelVisible.value)\n ? (_openBlock(), _createBlock(SlideThumbnails, {\n key: 0,\n turnSlideToIndex: _unref(turnSlideToIndex),\n onClose: _cache[3] || (_cache[3] = ($event: any) => (slideThumbnailModelVisible.value = false))\n }, null, 8, [\"turnSlideToIndex\"]))\n : _createCommentVNode(\"\", true),\n (writingBoardToolVisible.value)\n ? (_openBlock(), _createBlock(WritingBoardTool, {\n key: 1,\n slideWidth: _unref(slideWidth),\n slideHeight: _unref(slideHeight),\n onClose: _cache[4] || (_cache[4] = ($event: any) => (writingBoardToolVisible.value = false))\n }, null, 8, [\"slideWidth\", \"slideHeight\"]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_1, [\n _createVNode(_component_IconLeftTwo, {\n class: \"tool-btn\",\n theme: \"two-tone\",\n fill: ['#111', '#fff'],\n onClick: _cache[5] || (_cache[5] = ($event: any) => (_unref(execPrev)()))\n }),\n _createVNode(_component_IconRightTwo, {\n class: \"tool-btn\",\n theme: \"two-tone\",\n fill: ['#111', '#fff'],\n onClick: _cache[6] || (_cache[6] = ($event: any) => (_unref(execNext)()))\n })\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"tools-right\", { 'visible': rightToolsVisible.value }]),\n onMouseleave: _cache[14] || (_cache[14] = ($event: any) => (rightToolsVisible.value = false)),\n onMouseenter: _cache[15] || (_cache[15] = ($event: any) => (rightToolsVisible.value = true))\n }, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: \"tool-btn page-number\",\n onClick: _cache[7] || (_cache[7] = ($event: any) => (slideThumbnailModelVisible.value = true))\n }, \"幻灯片 \" + _toDisplayString(_unref(slideIndex) + 1) + \" / \" + _toDisplayString(_unref(slides).length), 1),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"画笔工具\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconWrite, {\n class: \"tool-btn\",\n onClick: _cache[8] || (_cache[8] = ($event: any) => (writingBoardToolVisible.value = true))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"激光笔\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconMagic, {\n class: _normalizeClass([\"tool-btn\", { 'active': laserPen.value }]),\n onClick: _cache[9] || (_cache[9] = ($event: any) => (laserPen.value = !laserPen.value))\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"演讲者视图\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconListView, {\n class: \"tool-btn\",\n onClick: _cache[10] || (_cache[10] = ($event: any) => (__props.changeViewMode('presenter')))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: _unref(fullscreenState) ? '退出全屏' : '进入全屏'\n }, {\n default: _withCtx(() => [\n (_unref(fullscreenState))\n ? (_openBlock(), _createBlock(_component_IconOffScreenOne, {\n key: 0,\n class: \"tool-btn\",\n onClick: _cache[11] || (_cache[11] = ($event: any) => (_unref(manualExitFullscreen)()))\n }))\n : (_openBlock(), _createBlock(_component_IconFullScreenOne, {\n key: 1,\n class: \"tool-btn\",\n onClick: _cache[12] || (_cache[12] = ($event: any) => (_unref(enterFullscreen)()))\n }))\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\", \"title\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"结束放映\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPower, {\n class: \"tool-btn\",\n onClick: _cache[13] || (_cache[13] = ($event: any) => (_unref(exitScreening)()))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ])\n ], 34)\n ], 2))\n}\n}\n\n})","import script from \"./BaseView.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseView.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseView.vue?vue&type=style&index=0&id=d72d6626&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-d72d6626\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, resolveDirective as _resolveDirective, withDirectives as _withDirectives, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, withModifiers as _withModifiers, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5fba3eec\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"presenter-view\" }\nconst _hoisted_2 = { class: \"toolbar\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", null, \"普通视图\", -1))\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", null, \"画笔\", -1))\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", null, \"激光笔\", -1))\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", null, \"结束放映\", -1))\nconst _hoisted_7 = { class: \"content\" }\nconst _hoisted_8 = [\"onClick\"]\nconst _hoisted_9 = { class: \"remark\" }\nconst _hoisted_10 = { class: \"header\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", null, \"演讲者备注\", -1))\nconst _hoisted_12 = [\"innerHTML\"]\nconst _hoisted_13 = { class: \"remark-scale\" }\n\nimport { computed, nextTick, ref, watch, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport { enterFullscreen } from '@/utils/fullscreen'\nimport { parseText2Paragraphs } from '@/utils/textParser'\nimport useScreening from '@/hooks/useScreening'\nimport useLoadSlides from '@/hooks/useLoadSlides'\nimport useExecPlay from './hooks/useExecPlay'\nimport useSlideSize from './hooks/useSlideSize'\nimport useFullscreen from './hooks/useFullscreen'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\nimport ScreenSlideList from './ScreenSlideList.vue'\nimport WritingBoardTool from './WritingBoardTool.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'PresenterView',\n props: {\n changeViewMode: {\n type: Function as PropType<(mode: 'base' | 'presenter') => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { slides, slideIndex, viewportRatio, currentSlide } = storeToRefs(useSlidesStore())\n\nconst slideListWrapRef = ref()\nconst thumbnailsRef = ref()\nconst writingBoardToolVisible = ref(false)\nconst laserPen = ref(false)\n\nconst {\n mousewheelListener,\n touchStartListener,\n touchEndListener,\n turnPrevSlide,\n turnNextSlide,\n turnSlideToIndex,\n turnSlideToId,\n animationIndex,\n} = useExecPlay()\n\nconst { slideWidth, slideHeight } = useSlideSize(slideListWrapRef)\nconst { exitScreening } = useScreening()\nconst { slidesLoadLimit } = useLoadSlides()\nconst { fullscreenState, manualExitFullscreen } = useFullscreen()\n\nconst remarkFontSize = ref(16)\nconst currentSlideRemark = computed(() => {\n return parseText2Paragraphs(currentSlide.value.remark || '无备注')\n})\n\nconst handleMousewheelThumbnails = (e: WheelEvent) => {\n if (!thumbnailsRef.value) return\n thumbnailsRef.value.scrollBy(e.deltaY, 0)\n}\n\nconst setRemarkFontSize = (fontSize: number) => {\n if (fontSize < 12 || fontSize > 40) return\n remarkFontSize.value = fontSize\n}\n\nwatch(slideIndex, () => {\n nextTick(() => {\n if (!thumbnailsRef.value) return\n\n const activeThumbnailRef: HTMLElement | null = thumbnailsRef.value.querySelector('.thumbnail.active')\n if (!activeThumbnailRef) return\n\n const width = thumbnailsRef.value.offsetWidth\n const offsetLeft = activeThumbnailRef.offsetLeft\n thumbnailsRef.value.scrollTo({ left: offsetLeft - width / 2, behavior: 'smooth' })\n })\n})\n\nconst contextmenus = (): ContextmenuItem[] => {\n return [\n {\n text: '上一页',\n subText: '↑ ←',\n disable: slideIndex.value <= 0,\n handler: () => turnPrevSlide(),\n },\n {\n text: '下一页',\n subText: '↓ →',\n disable: slideIndex.value >= slides.value.length - 1,\n handler: () => turnNextSlide(),\n },\n {\n text: '第一页',\n disable: slideIndex.value === 0,\n handler: () => turnSlideToIndex(0),\n },\n {\n text: '最后一页',\n disable: slideIndex.value === slides.value.length - 1,\n handler: () => turnSlideToIndex(slides.value.length - 1),\n },\n { divider: true },\n {\n text: '画笔工具',\n handler: () => writingBoardToolVisible.value = true,\n },\n {\n text: '普通视图',\n handler: () => props.changeViewMode('base'),\n },\n { divider: true },\n {\n text: '结束放映',\n subText: 'ESC',\n handler: exitScreening,\n },\n ]\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconListView = _resolveComponent(\"IconListView\")!\n const _component_IconWrite = _resolveComponent(\"IconWrite\")!\n const _component_IconMagic = _resolveComponent(\"IconMagic\")!\n const _component_IconOffScreenOne = _resolveComponent(\"IconOffScreenOne\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconPower = _resolveComponent(\"IconPower\")!\n const _component_IconMinus = _resolveComponent(\"IconMinus\")!\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: \"tool-btn\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (__props.changeViewMode('base')))\n }, [\n _createVNode(_component_IconListView, { class: \"tool-icon\" }),\n _hoisted_3\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"tool-btn\", { 'active': writingBoardToolVisible.value }]),\n onClick: _cache[1] || (_cache[1] = ($event: any) => (writingBoardToolVisible.value = !writingBoardToolVisible.value))\n }, [\n _createVNode(_component_IconWrite, { class: \"tool-icon\" }),\n _hoisted_4\n ], 2),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"tool-btn\", { 'active': laserPen.value }]),\n onClick: _cache[2] || (_cache[2] = ($event: any) => (laserPen.value = !laserPen.value))\n }, [\n _createVNode(_component_IconMagic, { class: \"tool-icon\" }),\n _hoisted_5\n ], 2),\n _createElementVNode(\"div\", {\n class: \"tool-btn\",\n onClick: _cache[3] || (_cache[3] = () => _unref(fullscreenState) ? _unref(manualExitFullscreen)() : _unref(enterFullscreen)())\n }, [\n (_unref(fullscreenState))\n ? (_openBlock(), _createBlock(_component_IconOffScreenOne, {\n key: 0,\n class: \"tool-icon\"\n }))\n : (_openBlock(), _createBlock(_component_IconOffScreenOne, {\n key: 1,\n class: \"tool-icon\"\n })),\n _createElementVNode(\"span\", null, _toDisplayString(_unref(fullscreenState) ? '退出全屏' : '全屏'), 1)\n ]),\n _createVNode(_component_Divider, { class: \"divider\" }),\n _createElementVNode(\"div\", {\n class: \"tool-btn\",\n onClick: _cache[4] || (_cache[4] = ($event: any) => (_unref(exitScreening)()))\n }, [\n _createVNode(_component_IconPower, { class: \"tool-icon\" }),\n _hoisted_6\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"slide-list-wrap\", { 'laser-pen': laserPen.value }]),\n ref_key: \"slideListWrapRef\",\n ref: slideListWrapRef\n }, [\n _withDirectives(_createVNode(ScreenSlideList, {\n slideWidth: _unref(slideWidth),\n slideHeight: _unref(slideHeight),\n animationIndex: _unref(animationIndex),\n turnSlideToId: _unref(turnSlideToId),\n manualExitFullscreen: _unref(manualExitFullscreen),\n onWheel: _cache[5] || (_cache[5] = $event => _unref(mousewheelListener)($event)),\n onTouchstart: _cache[6] || (_cache[6] = $event => _unref(touchStartListener)($event)),\n onTouchend: _cache[7] || (_cache[7] = $event => _unref(touchEndListener)($event))\n }, null, 8, [\"slideWidth\", \"slideHeight\", \"animationIndex\", \"turnSlideToId\", \"manualExitFullscreen\"]), [\n [_directive_contextmenu, contextmenus]\n ]),\n (writingBoardToolVisible.value)\n ? (_openBlock(), _createBlock(WritingBoardTool, {\n key: 0,\n slideWidth: _unref(slideWidth),\n slideHeight: _unref(slideHeight),\n position: {\n left: '75px',\n top: '5px',\n },\n onClose: _cache[8] || (_cache[8] = ($event: any) => (writingBoardToolVisible.value = false))\n }, null, 8, [\"slideWidth\", \"slideHeight\"]))\n : _createCommentVNode(\"\", true)\n ], 2),\n _createElementVNode(\"div\", {\n class: \"thumbnails\",\n ref_key: \"thumbnailsRef\",\n ref: thumbnailsRef,\n onWheel: _cache[9] || (_cache[9] = _withModifiers($event => handleMousewheelThumbnails($event), [\"prevent\"]))\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"thumbnail\", { 'active': index === _unref(slideIndex) }]),\n key: slide.id,\n onClick: ($event: any) => (_unref(turnSlideToIndex)(index))\n }, [\n _createVNode(ThumbnailSlide, {\n slide: slide,\n size: 120 / _unref(viewportRatio),\n visible: index < _unref(slidesLoadLimit)\n }, null, 8, [\"slide\", \"size\", \"visible\"])\n ], 10, _hoisted_8))\n }), 128))\n ], 544)\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createElementVNode(\"span\", null, \"P \" + _toDisplayString(_unref(slideIndex) + 1) + \" / \" + _toDisplayString(_unref(slides).length), 1)\n ]),\n _createElementVNode(\"div\", {\n class: \"remark-content\",\n style: _normalizeStyle({ fontSize: remarkFontSize.value + 'px' }),\n innerHTML: _unref(currentSlideRemark)\n }, null, 12, _hoisted_12),\n _createElementVNode(\"div\", _hoisted_13, [\n _createElementVNode(\"div\", {\n class: _normalizeClass(['scale-btn', { 'disable': remarkFontSize.value === 12 }]),\n onClick: _cache[10] || (_cache[10] = ($event: any) => (setRemarkFontSize(remarkFontSize.value - 2)))\n }, [\n _createVNode(_component_IconMinus)\n ], 2),\n _createElementVNode(\"div\", {\n class: _normalizeClass(['scale-btn', { 'disable': remarkFontSize.value === 40 }]),\n onClick: _cache[11] || (_cache[11] = ($event: any) => (setRemarkFontSize(remarkFontSize.value + 2)))\n }, [\n _createVNode(_component_IconPlus)\n ], 2)\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./PresenterView.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./PresenterView.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./PresenterView.vue?vue&type=style&index=0&id=5fba3eec&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5fba3eec\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-6bf3d190\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"pptist-screen\" }\n\nimport { onMounted, onUnmounted, ref } from 'vue'\nimport { KEYS } from '@/configs/hotkey'\nimport useScreening from '@/hooks/useScreening'\n\nimport BaseView from './BaseView.vue'\nimport PresenterView from './PresenterView.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst viewMode = ref<'base' | 'presenter'>('base')\n\nconst changeViewMode = (mode: 'base' | 'presenter') => {\n viewMode.value = mode\n}\n\nconst { exitScreening } = useScreening()\n\n// 快捷键退出放映\nconst keydownListener = (e: KeyboardEvent) => {\n const key = e.key.toUpperCase()\n if (key === KEYS.ESC) exitScreening()\n}\n\nonMounted(() => document.addEventListener('keydown', keydownListener))\nonUnmounted(() => document.removeEventListener('keydown', keydownListener))\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (viewMode.value === 'base')\n ? (_openBlock(), _createBlock(BaseView, {\n key: 0,\n changeViewMode: changeViewMode\n }))\n : (viewMode.value === 'presenter')\n ? (_openBlock(), _createBlock(PresenterView, {\n key: 1,\n changeViewMode: changeViewMode\n }))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=6bf3d190&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6bf3d190\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { ElementTypes, PPTElement } from '@/types/slides'\n\nimport ImageElement from '@/views/components/element/ImageElement/index.vue'\nimport TextElement from '@/views/components/element/TextElement/index.vue'\nimport ShapeElement from '@/views/components/element/ShapeElement/index.vue'\nimport LineElement from '@/views/components/element/LineElement/index.vue'\nimport ChartElement from '@/views/components/element/ChartElement/index.vue'\nimport TableElement from '@/views/components/element/TableElement/index.vue'\nimport LatexElement from '@/views/components/element/LatexElement/index.vue'\nimport VideoElement from '@/views/components/element/VideoElement/index.vue'\nimport AudioElement from '@/views/components/element/AudioElement/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MobileEditableElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n elementIndex: {\n type: Number,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: TouchEvent, element: PPTElement, canMove?: boolean) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst currentElementComponent = computed(() => {\n const elementTypeMap = {\n [ElementTypes.IMAGE]: ImageElement,\n [ElementTypes.TEXT]: TextElement,\n [ElementTypes.SHAPE]: ShapeElement,\n [ElementTypes.LINE]: LineElement,\n [ElementTypes.CHART]: ChartElement,\n [ElementTypes.TABLE]: TableElement,\n [ElementTypes.LATEX]: LatexElement,\n [ElementTypes.VIDEO]: VideoElement,\n [ElementTypes.AUDIO]: AudioElement,\n }\n return elementTypeMap[props.elementInfo.type] || null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"mobile-editable-element\",\n style: _normalizeStyle({\n zIndex: __props.elementIndex,\n })\n }, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentElementComponent)), {\n elementInfo: __props.elementInfo,\n selectElement: __props.selectElement,\n contextmenus: () => null\n }, null, 8, [\"elementInfo\", \"selectElement\", \"contextmenus\"]))\n ], 4))\n}\n}\n\n})","import script from \"./MobileEditableElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MobileEditableElement.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode } from \"vue\"\n\nimport { PropType, computed } from 'vue'\nimport { PPTElement, PPTLineElement } from '@/types/slides'\nimport useCommonOperate from '@/views/Editor/Canvas/hooks/useCommonOperate'\nimport { OperateResizeHandlers } from '@/types/edit'\n\nimport BorderLine from '@/views/Editor/Canvas/Operate/BorderLine.vue'\nimport ResizeHandler from '@/views/Editor/Canvas/Operate/ResizeHandler.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MobileOperate',\n props: {\n elementInfo: {\n type: Object as PropType>,\n required: true,\n },\n isSelected: {\n type: Boolean,\n required: true,\n },\n canvasScale: {\n type: Number,\n required: true,\n },\n scaleElement: {\n type: Function as PropType<(e: MouseEvent, element: Exclude, command: OperateResizeHandlers) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst rotate = computed(() => 'rotate' in props.elementInfo ? props.elementInfo.rotate : 0)\n\nconst scaleWidth = computed(() => props.elementInfo.width * props.canvasScale)\nconst scaleHeight = computed(() => props.elementInfo.height * props.canvasScale)\nconst {\n borderLines,\n resizeHandlers: _resizeHandlers,\n textElementResizeHandlers,\n} = useCommonOperate(scaleWidth, scaleHeight)\n\nconst resizeHandlers = props.elementInfo.type === 'text' || props.elementInfo.type === 'table' ? textElementResizeHandlers : _resizeHandlers\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"mobile-operate\",\n style: _normalizeStyle({\n top: __props.elementInfo.top * __props.canvasScale + 'px',\n left: __props.elementInfo.left * __props.canvasScale + 'px',\n transform: `rotate(${_unref(rotate)}deg)`,\n transformOrigin: `${__props.elementInfo.width * __props.canvasScale / 2}px ${__props.elementInfo.height * __props.canvasScale / 2}px`,\n })\n }, [\n (__props.isSelected)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onTouchstart: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onTouchstart\"]))\n }), 128))\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 4))\n}\n}\n\n})","import script from \"./MobileOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MobileOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MobileOperate.vue?vue&type=style&index=0&id=7fdc6c04&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7fdc6c04\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createVNode as _createVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4a0c7aa7\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"mobile-thumbnails\" }\nconst _hoisted_2 = [\"onClick\"]\nconst _hoisted_3 = { class: \"label\" }\n\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useLoadSlides from '@/hooks/useLoadSlides'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MobileThumbnails',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { slides, slideIndex } = storeToRefs(slidesStore)\n\nconst { slidesLoadLimit } = useLoadSlides()\nconst changeSlideIndex = (index: number) => {\n slidesStore.updateSlideIndex(index)\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"thumbnail-item\", { 'active': _unref(slideIndex) === index }]),\n key: slide.id,\n onClick: ($event: any) => (changeSlideIndex(index))\n }, [\n _createElementVNode(\"div\", _hoisted_3, _toDisplayString(index + 1), 1),\n _createVNode(ThumbnailSlide, {\n class: \"thumbnail\",\n slide: slide,\n size: 120,\n visible: index < _unref(slidesLoadLimit)\n }, null, 8, [\"slide\", \"visible\"])\n ], 10, _hoisted_2))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./MobileThumbnails.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MobileThumbnails.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MobileThumbnails.vue?vue&type=style&index=0&id=4a0c7aa7&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-4a0c7aa7\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5c24a24d\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"slide-toolbar\" }\nconst _hoisted_2 = { class: \"remark\" }\nconst _hoisted_3 = [\"value\"]\nconst _hoisted_4 = { class: \"toolbar\" }\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\" 新幻灯片\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\" 复制\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\" 删除\")\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\" 文字\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"图片 \")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\" 矩形\")\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\" 圆形\")\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useSlideHandler from '@/hooks/useSlideHandler'\nimport useCreateElement from '@/hooks/useCreateElement'\nimport { getImageDataURL } from '@/utils/image'\nimport { ShapePoolItem } from '@/configs/shapes'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\n\nimport MobileThumbnails from '../MobileThumbnails.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SlideToolbar',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { viewportRatio, currentSlide } = storeToRefs(slidesStore)\n\nconst { createSlide, copyAndPasteSlide, deleteSlide, } = useSlideHandler()\nconst { createTextElement, createImageElement, createShapeElement } = useCreateElement()\n\nconst insertTextElement = () => {\n const width = 400\n const height = 56\n\n createTextElement({\n left: (VIEWPORT_SIZE - width) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - height) / 2,\n width,\n height,\n }, '

新添加文本

')\n}\n\nconst insertImageElement = (files: FileList) => {\n if (!files || !files[0]) return\n getImageDataURL(files[0]).then(dataURL => createImageElement(dataURL))\n}\n\nconst insertShapeElement = (type: 'square' | 'round') => {\n const square: ShapePoolItem = {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n }\n const round: ShapePoolItem = {\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n }\n const shape = { square, round }\n\n const size = 200\n\n createShapeElement({\n left: (VIEWPORT_SIZE - size) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - size) / 2,\n width: size,\n height: size,\n }, shape[type])\n}\n\nconst remark = computed(() => currentSlide.value?.remark || '')\n\nconst handleInputMark = (e: Event) => {\n const value = (e.target as HTMLTextAreaElement).value\n slidesStore.updateSlide({ remark: value })\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_IconCopy = _resolveComponent(\"IconCopy\")!\n const _component_IconDelete = _resolveComponent(\"IconDelete\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_IconPicture = _resolveComponent(\"IconPicture\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_IconSquare = _resolveComponent(\"IconSquare\")!\n const _component_IconRound = _resolveComponent(\"IconRound\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"textarea\", {\n value: _unref(remark),\n placeholder: \"点击输入演讲者备注\",\n onInput: _cache[0] || (_cache[0] = $event => handleInputMark($event))\n }, null, 40, _hoisted_3)\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_unref(createSlide)()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPlus, { class: \"icon\" }),\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_unref(copyAndPasteSlide)()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconCopy, { class: \"icon\" }),\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[3] || (_cache[3] = ($event: any) => (_unref(deleteSlide)()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconDelete, { class: \"icon\" }),\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[4] || (_cache[4] = ($event: any) => (insertTextElement()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize, { class: \"icon\" }),\n _hoisted_8\n ]),\n _: 1\n }),\n _createVNode(_component_Button, { style: {\"flex\":\"1\"} }, {\n default: _withCtx(() => [\n _createVNode(_component_FileInput, {\n onChange: _cache[5] || (_cache[5] = files => insertImageElement(files))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPicture, { class: \"icon\" }),\n _hoisted_9\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[6] || (_cache[6] = ($event: any) => (insertShapeElement('square')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconSquare, { class: \"icon\" }),\n _hoisted_10\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[7] || (_cache[7] = ($event: any) => (insertShapeElement('round')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconRound, { class: \"icon\" }),\n _hoisted_11\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]),\n _createVNode(MobileThumbnails)\n ]))\n}\n}\n\n})","import script from \"./SlideToolbar.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SlideToolbar.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./SlideToolbar.vue?vue&type=style&index=0&id=5c24a24d&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5c24a24d\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-446388c6\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-toolbar\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"content\" }\nconst _hoisted_5 = {\n key: 0,\n class: \"style\"\n}\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"+\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"-\")\nconst _hoisted_8 = { class: \"row-block\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"label\" }, \"文字颜色:\", -1))\nconst _hoisted_10 = { class: \"colors\" }\nconst _hoisted_11 = [\"onClick\"]\nconst _hoisted_12 = { class: \"row-block\" }\nconst _hoisted_13 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"label\" }, \"填充色:\", -1))\nconst _hoisted_14 = { class: \"colors\" }\nconst _hoisted_15 = [\"onClick\"]\nconst _hoisted_16 = {\n key: 1,\n class: \"common\"\n}\nconst _hoisted_17 = /*#__PURE__*/_createTextVNode(\" 复制\")\nconst _hoisted_18 = /*#__PURE__*/_createTextVNode(\" 删除\")\nconst _hoisted_19 = /*#__PURE__*/_createTextVNode(\" 置顶\")\nconst _hoisted_20 = /*#__PURE__*/_createTextVNode(\" 置底\")\nconst _hoisted_21 = /*#__PURE__*/_createTextVNode(\" 上移\")\nconst _hoisted_22 = /*#__PURE__*/_createTextVNode(\" 下移\")\nconst _hoisted_23 = /*#__PURE__*/_createTextVNode(\" 左对齐\")\nconst _hoisted_24 = /*#__PURE__*/_createTextVNode(\" 水平居中\")\nconst _hoisted_25 = /*#__PURE__*/_createTextVNode(\" 右对齐\")\nconst _hoisted_26 = /*#__PURE__*/_createTextVNode(\" 上对齐\")\nconst _hoisted_27 = /*#__PURE__*/_createTextVNode(\" 垂直居中\")\nconst _hoisted_28 = /*#__PURE__*/_createTextVNode(\" 下对齐\")\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement, TableCell } from '@/types/slides'\nimport { ElementAlignCommands, ElementOrderCommands } from '@/types/edit'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\nimport useOrderElement from '@/hooks/useOrderElement'\nimport useAlignElementToCanvas from '@/hooks/useAlignElementToCanvas'\nimport useDeleteElement from '@/hooks/useDeleteElement'\nimport useAddSlidesOrElements from '@/hooks/useAddSlidesOrElements'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface TabItem {\n key: 'style' | 'common'\n label: string\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementToolbar',\n setup(__props) {\n\nconst colors = ['#000000', '#ffffff', '#eeece1', '#1e497b', '#4e81bb', '#e2534d', '#9aba60', '#8165a0', '#47acc5', '#f9974c', '#c21401', '#ff1e02', '#ffc12a', '#ffff3a', '#90cf5b', '#00af57']\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId, richTextAttrs } = storeToRefs(mainStore)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateElement = (id: string, props: Partial) => {\n slidesStore.updateElement({ id, props })\n addHistorySnapshot()\n}\n\nconst tabs: TabItem[] = [\n { key: 'style', label: '样式' },\n { key: 'common', label: '布局' },\n]\nconst activeTab = ref('common')\n\nconst { orderElement } = useOrderElement()\nconst { alignElementToCanvas } = useAlignElementToCanvas()\nconst { addElementsFromData } = useAddSlidesOrElements()\nconst { deleteElement } = useDeleteElement()\n\nconst copyElement = () => {\n const element: PPTElement = JSON.parse(JSON.stringify(handleElement.value))\n addElementsFromData([element])\n}\n\nconst emitRichTextCommand = (command: string, value?: string) => {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command, value } })\n}\n\nconst updateFontColor = (color: string) => {\n if (!handleElement.value) return\n if (handleElement.value.type === 'text' || (handleElement.value.type === 'shape' && handleElement.value.text?.content)) {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command: 'color', value: color } })\n }\n if (handleElement.value.type === 'table') {\n const data: TableCell[][] = JSON.parse(JSON.stringify(handleElement.value.data))\n for (let i = 0; i < data.length; i++) {\n for (let j = 0; j < data[i].length; j++) {\n const style = data[i][j].style || {}\n data[i][j].style = { ...style, color }\n }\n }\n updateElement(handleElementId.value, { data })\n }\n if (handleElement.value.type === 'latex') {\n updateElement(handleElementId.value, { color })\n }\n}\n\nconst updateFill = (color: string) => {\n if (!handleElement.value) return\n if (\n handleElement.value.type === 'text' ||\n handleElement.value.type === 'shape' ||\n handleElement.value.type === 'chart'\n ) updateElement(handleElementId.value, { fill: color })\n\n if (handleElement.value.type === 'table') {\n const data: TableCell[][] = JSON.parse(JSON.stringify(handleElement.value.data))\n for (let i = 0; i < data.length; i++) {\n for (let j = 0; j < data[i].length; j++) {\n const style = data[i][j].style || {}\n data[i][j].style = { ...style, backcolor: color }\n }\n }\n updateElement(handleElementId.value, { data })\n }\n\n if (handleElement.value.type === 'audio') updateElement(handleElementId.value, { color })\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconTextBold = _resolveComponent(\"IconTextBold\")!\n const _component_CheckboxButton = _resolveComponent(\"CheckboxButton\")!\n const _component_IconTextItalic = _resolveComponent(\"IconTextItalic\")!\n const _component_IconTextUnderline = _resolveComponent(\"IconTextUnderline\")!\n const _component_IconStrikethrough = _resolveComponent(\"IconStrikethrough\")!\n const _component_CheckboxButtonGroup = _resolveComponent(\"CheckboxButtonGroup\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconAlignTextLeft = _resolveComponent(\"IconAlignTextLeft\")!\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_IconAlignTextCenter = _resolveComponent(\"IconAlignTextCenter\")!\n const _component_IconAlignTextRight = _resolveComponent(\"IconAlignTextRight\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_IconCopy = _resolveComponent(\"IconCopy\")!\n const _component_IconDelete = _resolveComponent(\"IconDelete\")!\n const _component_IconSendToBack = _resolveComponent(\"IconSendToBack\")!\n const _component_IconBringToFrontOne = _resolveComponent(\"IconBringToFrontOne\")!\n const _component_IconBringToFront = _resolveComponent(\"IconBringToFront\")!\n const _component_IconSentToBack = _resolveComponent(\"IconSentToBack\")!\n const _component_IconAlignLeft = _resolveComponent(\"IconAlignLeft\")!\n const _component_IconAlignVertically = _resolveComponent(\"IconAlignVertically\")!\n const _component_IconAlignRight = _resolveComponent(\"IconAlignRight\")!\n const _component_IconAlignTop = _resolveComponent(\"IconAlignTop\")!\n const _component_IconAlignHorizontally = _resolveComponent(\"IconAlignHorizontally\")!\n const _component_IconAlignBottom = _resolveComponent(\"IconAlignBottom\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (item) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': activeTab.value === item.key }]),\n key: item.key,\n onClick: ($event: any) => (activeTab.value = item.key)\n }, _toDisplayString(item.label), 11, _hoisted_3)\n }), 64))\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n (activeTab.value === 'style')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_5, [\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).bold,\n onClick: _cache[0] || (_cache[0] = ($event: any) => (emitRichTextCommand('bold')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextBold)\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).em,\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emitRichTextCommand('em')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextItalic)\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).underline,\n onClick: _cache[2] || (_cache[2] = ($event: any) => (emitRichTextCommand('underline')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextUnderline)\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).strikethrough,\n onClick: _cache[3] || (_cache[3] = ($event: any) => (emitRichTextCommand('strikethrough')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconStrikethrough)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"2\"},\n onClick: _cache[4] || (_cache[4] = ($event: any) => (emitRichTextCommand('fontsize-add')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"2\"},\n onClick: _cache[5] || (_cache[5] = ($event: any) => (emitRichTextCommand('fontsize-reduce')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Divider, { style: {\"margin\":\"20px 0\"} }),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: _unref(richTextAttrs).align,\n onChange: _cache[6] || (_cache[6] = e => emitRichTextCommand('align', e.target.value))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"left\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextLeft)\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n value: \"center\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextCenter)\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n value: \"right\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Divider, { style: {\"margin\":\"20px 0\"} }),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createElementVNode(\"div\", _hoisted_10, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(colors, (color) => {\n return _createElementVNode(\"div\", {\n class: \"color\",\n key: color,\n onClick: ($event: any) => (updateFontColor(color))\n }, [\n _createElementVNode(\"div\", {\n class: \"color-block\",\n style: _normalizeStyle({ backgroundColor: color })\n }, null, 4)\n ], 8, _hoisted_11)\n }), 64))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_12, [\n _hoisted_13,\n _createElementVNode(\"div\", _hoisted_14, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(colors, (color) => {\n return _createElementVNode(\"div\", {\n class: \"color\",\n key: color,\n onClick: ($event: any) => (updateFill(color))\n }, [\n _createElementVNode(\"div\", {\n class: \"color-block\",\n style: _normalizeStyle({ backgroundColor: color })\n }, null, 4)\n ], 8, _hoisted_15)\n }), 64))\n ])\n ])\n ]))\n : _createCommentVNode(\"\", true),\n (activeTab.value === 'common')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_16, [\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[7] || (_cache[7] = ($event: any) => (copyElement()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconCopy, { class: \"icon\" }),\n _hoisted_17\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[8] || (_cache[8] = ($event: any) => (_unref(deleteElement)()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconDelete, { class: \"icon\" }),\n _hoisted_18\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Divider, { style: {\"margin\":\"20px 0\"} }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[9] || (_cache[9] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).TOP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconSendToBack, { class: \"icon\" }),\n _hoisted_19\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[10] || (_cache[10] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).BOTTOM)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconBringToFrontOne, { class: \"icon\" }),\n _hoisted_20\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[11] || (_cache[11] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).UP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconBringToFront, { class: \"icon\" }),\n _hoisted_21\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[12] || (_cache[12] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).DOWN)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconSentToBack, { class: \"icon\" }),\n _hoisted_22\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Divider, { style: {\"margin\":\"20px 0\"} }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[13] || (_cache[13] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).LEFT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignLeft, { class: \"icon\" }),\n _hoisted_23\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[14] || (_cache[14] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).HORIZONTAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignVertically, { class: \"icon\" }),\n _hoisted_24\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[15] || (_cache[15] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).RIGHT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignRight, { class: \"icon\" }),\n _hoisted_25\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[16] || (_cache[16] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).TOP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTop, { class: \"icon\" }),\n _hoisted_26\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[17] || (_cache[17] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).VERTICAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignHorizontally, { class: \"icon\" }),\n _hoisted_27\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[18] || (_cache[18] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).BOTTOM)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignBottom, { class: \"icon\" }),\n _hoisted_28\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]))\n : _createCommentVNode(\"\", true)\n ])\n ]))\n}\n}\n\n})","import script from \"./ElementToolbar.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementToolbar.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementToolbar.vue?vue&type=style&index=0&id=446388c6&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-446388c6\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withModifiers as _withModifiers, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-8639f30e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"mobile-editor-header\" }\nconst _hoisted_2 = { class: \"history\" }\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\" 撤销\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\" 重做\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\" 退出编辑\")\n\nimport { PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSnapshotStore } from '@/store'\nimport { Mode } from '@/types/mobile'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Header',\n props: {\n changeMode: {\n type: Function as PropType<(mode: Mode) => void>,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nconst { canUndo, canRedo } = storeToRefs(useSnapshotStore())\nconst { redo, undo } = useHistorySnapshot()\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconBack = _resolveComponent(\"IconBack\")!\n const _component_IconNext = _resolveComponent(\"IconNext\")!\n const _component_IconLogout = _resolveComponent(\"IconLogout\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"history-item\", { 'disable': !_unref(canUndo) }]),\n onClick: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (_unref(undo)()), [\"stop\"]))\n }, [\n _createVNode(_component_IconBack),\n _hoisted_3\n ], 2),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"history-item\", { 'disable': !_unref(canRedo) }]),\n onClick: _cache[1] || (_cache[1] = _withModifiers(($event: any) => (_unref(redo)()), [\"stop\"]))\n }, [\n _createVNode(_component_IconNext),\n _hoisted_4\n ], 2)\n ]),\n _createElementVNode(\"div\", {\n class: \"back\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (__props.changeMode('preview')))\n }, [\n _createVNode(_component_IconLogout),\n _hoisted_5\n ])\n ]))\n}\n}\n\n})","import script from \"./Header.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Header.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Header.vue?vue&type=style&index=0&id=8639f30e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-8639f30e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-8cdcde82\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"mobile-editor\" }\n\nimport { computed, onMounted, PropType, ref, watchEffect } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { AlignmentLineProps } from '@/types/edit'\nimport { Mode } from '@/types/mobile'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'\nimport useDragElement from '@/views/Editor/Canvas/hooks/useDragElement'\nimport useScaleElement from '@/views/Editor/Canvas/hooks/useScaleElement'\n\nimport AlignmentLine from '@/views/Editor/Canvas/AlignmentLine.vue'\nimport MobileEditableElement from './MobileEditableElement.vue'\nimport MobileOperate from './MobileOperate.vue'\nimport SlideToolbar from './SlideToolbar.vue'\nimport ElementToolbar from './ElementToolbar.vue'\nimport Header from './Header.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n changeMode: {\n type: Function as PropType<(mode: Mode) => void>,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nconst slidesStore = useSlidesStore()\nconst mainStore = useMainStore()\nconst { slideIndex, currentSlide, viewportRatio } = storeToRefs(slidesStore)\nconst { activeElementIdList, handleElement } = storeToRefs(mainStore)\n\nconst contentRef = ref()\n\nconst alignmentLines = ref([])\n\nconst background = computed(() => currentSlide.value.background)\nconst { backgroundStyle } = useSlideBackgroundStyle(background)\n\nconst canvasScale = computed(() => {\n if (!contentRef.value) return 1\n const contentWidth = contentRef.value.clientWidth\n const contentheight = contentRef.value.clientHeight\n\n const contentRatio = contentheight / contentWidth\n if (contentRatio >= viewportRatio.value) return (contentWidth - 20) / VIEWPORT_SIZE\n return (contentheight - 20) / viewportRatio.value / VIEWPORT_SIZE\n})\n\nonMounted(() => {\n if (activeElementIdList.value.length) mainStore.setActiveElementIdList([])\n if (slideIndex.value !== 0) slidesStore.updateSlideIndex(0)\n})\n\nconst viewportStyles = computed(() => ({\n width: VIEWPORT_SIZE * canvasScale.value + 'px',\n height: VIEWPORT_SIZE * viewportRatio.value * canvasScale.value + 'px',\n}))\n\nconst elementList = ref([])\nconst setLocalElementList = () => {\n elementList.value = currentSlide.value ? JSON.parse(JSON.stringify(currentSlide.value.elements)) : []\n}\nwatchEffect(setLocalElementList)\n\nconst { dragElement } = useDragElement(elementList, alignmentLines, canvasScale)\nconst { scaleElement } = useScaleElement(elementList, alignmentLines, canvasScale)\n\nconst selectElement = (e: TouchEvent, element: PPTElement, startMove = true) => {\n if (!activeElementIdList.value.includes(element.id)) {\n mainStore.setActiveElementIdList([element.id])\n mainStore.setHandleElementId(element.id)\n }\n if (startMove) dragElement(e, element)\n}\n\nconst handleClickBlankArea = () => {\n mainStore.setActiveElementIdList([])\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(Header, { changeMode: __props.changeMode }, null, 8, [\"changeMode\"]),\n _createElementVNode(\"div\", {\n class: \"content\",\n ref_key: \"contentRef\",\n ref: contentRef,\n onTouchstart: _cache[0] || (_cache[0] = ($event: any) => (handleClickBlankArea()))\n }, [\n _createElementVNode(\"div\", {\n class: \"viewport-wrapper\",\n style: _normalizeStyle(_unref(viewportStyles))\n }, [\n _createElementVNode(\"div\", {\n class: \"background\",\n style: _normalizeStyle(_unref(backgroundStyle))\n }, null, 4),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(alignmentLines.value, (line, index) => {\n return (_openBlock(), _createBlock(AlignmentLine, {\n key: index,\n type: line.type,\n axis: line.axis,\n length: line.length,\n canvasScale: _unref(canvasScale)\n }, null, 8, [\"type\", \"axis\", \"length\", \"canvasScale\"]))\n }), 128)),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(elementList.value, (element) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: element.id\n }, [\n (element.type !== 'line')\n ? (_openBlock(), _createBlock(MobileOperate, {\n key: 0,\n elementInfo: element,\n isSelected: _unref(activeElementIdList).includes(element.id),\n canvasScale: _unref(canvasScale),\n scaleElement: _unref(scaleElement)\n }, null, 8, [\"elementInfo\", \"isSelected\", \"canvasScale\", \"scaleElement\"]))\n : _createCommentVNode(\"\", true)\n ], 64))\n }), 128)),\n _createElementVNode(\"div\", {\n class: \"viewport\",\n style: _normalizeStyle({ transform: `scale(${_unref(canvasScale)})` })\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(elementList.value, (element, index) => {\n return (_openBlock(), _createBlock(MobileEditableElement, {\n key: element.id,\n elementInfo: element,\n elementIndex: index + 1,\n selectElement: selectElement\n }, null, 8, [\"elementInfo\", \"elementIndex\"]))\n }), 128))\n ], 4)\n ], 4)\n ], 544),\n _createVNode(SlideToolbar),\n (_unref(handleElement))\n ? (_openBlock(), _createBlock(ElementToolbar, { key: 0 }))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=8cdcde82&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-8cdcde82\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createTextVNode as _createTextVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5293de3b\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"header\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\" 退出播放\")\n\nimport { computed, onMounted, PropType, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { Mode } from '@/types/mobile'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\nimport MobileThumbnails from './MobileThumbnails.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MobilePlayer',\n props: {\n changeMode: {\n type: Function as PropType<(mode: Mode) => void>,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nconst slidesStore = useSlidesStore()\nconst { slides, slideIndex, currentSlide, viewportRatio } = storeToRefs(slidesStore)\n\nconst toolVisible = ref(false)\n\nconst playerSize = ref({ width: 0, height: 0 })\n\nonMounted(() => {\n if (slideIndex.value !== 0) slidesStore.updateSlideIndex(0)\n\n playerSize.value = {\n width: document.body.clientHeight,\n height: document.body.clientWidth,\n }\n})\n\nconst slideSize = computed(() => {\n const playerRatio = playerSize.value.height / playerSize.value.width\n\n let slideWidth = 0\n let slideHeight = 0\n\n if (playerRatio >= viewportRatio.value) {\n slideWidth = playerSize.value.width\n slideHeight = slideWidth * viewportRatio.value\n }\n else {\n slideHeight = playerSize.value.height\n slideWidth = slideHeight / viewportRatio.value\n }\n\n return {\n width: slideWidth,\n height: slideHeight,\n }\n})\n\nconst touchInfo = ref<{ x: number; y: number; } | null>(null)\nconst touchStartListener = (e: TouchEvent) => {\n touchInfo.value = {\n x: e.changedTouches[0].pageX,\n y: e.changedTouches[0].pageY,\n }\n}\nconst touchEndListener = (e: TouchEvent) => {\n if (!touchInfo.value) return\n\n const offsetY = Math.abs(touchInfo.value.y - e.changedTouches[0].pageY)\n const offsetX = e.changedTouches[0].pageX - touchInfo.value.x\n\n if ( Math.abs(offsetX) > offsetY && Math.abs(offsetX) > 50 ) {\n touchInfo.value = null\n\n if (offsetX < 0 && slideIndex.value > 0) slidesStore.updateSlideIndex(slideIndex.value - 1)\n if (offsetX > 0 && slideIndex.value < slides.value.length - 1) slidesStore.updateSlideIndex(slideIndex.value + 1)\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconLogout = _resolveComponent(\"IconLogout\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"mobile-player\",\n style: _normalizeStyle({\n width: playerSize.value.width + 'px',\n height: playerSize.value.height + 'px',\n transform: `rotate(90deg) translateY(-${playerSize.value.height}px)`,\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"screen-slide-list\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (toolVisible.value = !toolVisible.value)),\n onTouchstart: _cache[1] || (_cache[1] = $event => touchStartListener($event)),\n onTouchend: _cache[2] || (_cache[2] = $event => touchEndListener($event))\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\n 'slide-item', \n `turning-mode-${slide.turningMode || 'slideY'}`,\n {\n 'current': index === _unref(slideIndex),\n 'before': index < _unref(slideIndex),\n 'after': index > _unref(slideIndex),\n 'hide': (index === _unref(slideIndex) - 1 || index === _unref(slideIndex) + 1) && slide.turningMode !== _unref(currentSlide).turningMode,\n }\n ]),\n key: slide.id\n }, [\n (Math.abs(_unref(slideIndex) - index) < 2)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"slide-content\",\n style: _normalizeStyle({\n width: _unref(slideSize).width + 'px',\n height: _unref(slideSize).height + 'px',\n })\n }, [\n _createVNode(ThumbnailSlide, {\n slide: slide,\n size: _unref(slideSize).width\n }, null, 8, [\"slide\", \"size\"])\n ], 4))\n : _createCommentVNode(\"\", true)\n ], 2))\n }), 128))\n ], 32),\n (toolVisible.value)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"back\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (__props.changeMode('preview')))\n }, [\n _createVNode(_component_IconLogout),\n _hoisted_2\n ])\n ]),\n _createVNode(MobileThumbnails, { class: \"thumbnails\" })\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 4))\n}\n}\n\n})","import script from \"./MobilePlayer.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MobilePlayer.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MobilePlayer.vue?vue&type=style&index=0&id=5293de3b&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5293de3b\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createTextVNode as _createTextVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4f906636\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"thumbnail-list\" }\nconst _hoisted_2 = { class: \"menu\" }\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\" 编辑\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\" 播放\")\n\nimport { PropType, onMounted, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useLoadSlides from '@/hooks/useLoadSlides'\nimport { Mode } from '@/types/mobile'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MobilePreview',\n props: {\n changeMode: {\n type: Function as PropType<(mode: Mode) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { slides } = storeToRefs(useSlidesStore())\nconst { slidesLoadLimit } = useLoadSlides()\n\nconst mobileRef = ref()\nconst screenWidth = ref(0)\n\nonMounted(() => {\n if (!mobileRef.value) return\n screenWidth.value = mobileRef.value.clientWidth\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconEdit = _resolveComponent(\"IconEdit\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconFullScreenPlay = _resolveComponent(\"IconFullScreenPlay\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"mobile-preview\",\n ref_key: \"mobileRef\",\n ref: mobileRef\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"thumbnail-item\",\n key: slide.id\n }, [\n _createVNode(ThumbnailSlide, {\n slide: slide,\n size: screenWidth.value - 10,\n visible: index < _unref(slidesLoadLimit)\n }, null, 8, [\"slide\", \"size\", \"visible\"])\n ]))\n }), 128))\n ]),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: \"menu-item\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (__props.changeMode('editor')))\n }, [\n _createVNode(_component_IconEdit, { class: \"icon\" }),\n _hoisted_3\n ]),\n _createVNode(_component_Divider, {\n type: \"vertical\",\n style: {\"height\":\"30px\"}\n }),\n _createElementVNode(\"div\", {\n class: \"menu-item\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (__props.changeMode('player')))\n }, [\n _createVNode(_component_IconFullScreenPlay, { class: \"icon\" }),\n _hoisted_4\n ])\n ])\n ], 512))\n}\n}\n\n})","import script from \"./MobilePreview.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MobilePreview.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MobilePreview.vue?vue&type=style&index=0&id=4f906636&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-4f906636\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1fb24d48\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"mobile\" }\n\nimport { computed, ref } from 'vue'\nimport { Mode } from '@/types/mobile'\n\nimport MobileEditor from './MobileEditor/index.vue'\nimport MobilePlayer from './MobilePlayer.vue'\nimport MobilePreview from './MobilePreview.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mode = ref('preview')\n \nconst changeMode = (_mode: Mode) => mode.value = _mode\n\nconst currentComponent = computed(() => {\n const componentMap = {\n 'editor': MobileEditor,\n 'player': MobilePlayer,\n 'preview': MobilePreview,\n }\n return componentMap[mode.value] || null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentComponent)), { changeMode: changeMode }))\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=1fb24d48&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1fb24d48\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode } from \"vue\"\n\nimport { onMounted } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useScreenStore, useMainStore, useSnapshotStore } from '@/store'\nimport { LOCALSTORAGE_KEY_DISCARDED_DB } from '@/configs/storage'\nimport { isPC } from './utils/common'\n\nimport Editor from './views/Editor/index.vue'\nimport Screen from './views/Screen/index.vue'\nimport Mobile from './views/Mobile/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'App',\n setup(__props) {\n\nconst _isPC = isPC()\n\nconst mainStore = useMainStore()\nconst snapshotStore = useSnapshotStore()\nconst { databaseId } = storeToRefs(mainStore)\nconst { screening } = storeToRefs(useScreenStore())\n\nif (process.env.NODE_ENV === 'production') {\n window.onbeforeunload = () => false\n}\n\nonMounted(() => {\n snapshotStore.initSnapshotDatabase()\n mainStore.setAvailableFonts()\n})\n\n// 应用注销时向 localStorage 中记录下本次 indexedDB 的数据库ID,用于之后清除数据库\nwindow.addEventListener('unload', () => {\n const discardedDB = localStorage.getItem(LOCALSTORAGE_KEY_DISCARDED_DB)\n const discardedDBList: string[] = discardedDB ? JSON.parse(discardedDB) : []\n\n discardedDBList.push(databaseId.value)\n\n const newDiscardedDB = JSON.stringify(discardedDBList)\n localStorage.setItem(LOCALSTORAGE_KEY_DISCARDED_DB, newDiscardedDB)\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_unref(screening))\n ? (_openBlock(), _createBlock(Screen, { key: 0 }))\n : (_unref(_isPC))\n ? (_openBlock(), _createBlock(Editor, { key: 1 }))\n : (_openBlock(), _createBlock(Mobile, { key: 2 }))\n}\n}\n\n})","import script from \"./App.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./App.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./App.vue?vue&type=style&index=0&id=f5c43528&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","/* eslint-disable no-console */\n\nimport { register } from 'register-service-worker'\n\nif (process.env.NODE_ENV === 'production') {\n register(`${process.env.BASE_URL}service-worker.js`, {\n ready() {\n console.log(\n 'App is being served from cache by a service worker.\\n' +\n 'For more details, visit https://goo.gl/AFskqB'\n )\n },\n registered() {\n console.log('Service worker has been registered.')\n },\n cached() {\n console.log('Content has been cached for offline use.')\n },\n updatefound() {\n console.log('New content is downloading.')\n },\n updated() {\n console.log('New content is available; please refresh.')\n },\n offline() {\n console.log('No internet connection found. App is running in offline mode.')\n },\n error(error) {\n console.error('Error during service worker registration:', error)\n }\n })\n}\n","// https://iconpark.bytedance.com/official\n\nimport { App } from 'vue'\nimport {\n PlayOne,\n FullScreenPlay,\n Lock,\n Unlock,\n Ppt,\n Format,\n Picture,\n FullScreen,\n List,\n OrderedList,\n Helpcenter,\n FlipVertically,\n FlipHorizontally,\n FontSize,\n Code,\n TextBold,\n TextItalic,\n TextUnderline,\n Strikethrough,\n Edit,\n Quote,\n BackgroundColor,\n Group,\n Ungroup,\n Back,\n Next,\n Fullwidth,\n AlignTop,\n AlignLeft,\n AlignRight,\n AlignBottom,\n AlignVertically,\n AlignHorizontally,\n BringToFront,\n SendToBack,\n AlignTextLeft,\n AlignTextRight,\n AlignTextCenter,\n RowHeight,\n Write,\n InsertTable,\n AddText,\n Fill,\n Tailoring,\n Effects,\n ColorFilter,\n Down,\n Plus,\n Minus,\n Connection,\n BringToFrontOne,\n SentToBack,\n Github,\n ChartProportion,\n ChartHistogram,\n ChartHistogramOne,\n ChartLineArea,\n ChartRing,\n ChartScatter,\n ChartLine,\n ChartPie,\n Text,\n Rotate,\n LeftTwo,\n RightTwo,\n Platte,\n UpOne,\n DownOne,\n Close,\n CloseSmall,\n Undo,\n Transform,\n Click,\n Theme,\n ArrowCircleLeft,\n GraphicDesign,\n Logout,\n Erase,\n Clear,\n FolderClose,\n AlignTextTopOne,\n AlignTextBottomOne,\n AlignTextMiddleOne,\n Pause,\n VolumeMute,\n VolumeNotice,\n VolumeSmall,\n VideoTwo,\n Formula,\n LinkOne,\n FullScreenOne,\n OffScreenOne,\n Power,\n ListView,\n Magic,\n HighLight,\n Share,\n IndentLeft,\n IndentRight,\n VerticalSpacingBetweenItems,\n Copy,\n Delete,\n Square,\n Round,\n Needle,\n} from '@icon-park/vue-next'\n\nexport const icons = {\n IconPlayOne: PlayOne,\n IconFullScreenPlay: FullScreenPlay,\n IconLock: Lock,\n IconUnlock: Unlock,\n IconPpt: Ppt,\n IconFormat: Format,\n IconPicture: Picture,\n IconFullScreen: FullScreen,\n IconList: List,\n IconOrderedList: OrderedList,\n IconHelpcenter: Helpcenter,\n IconFlipVertically: FlipVertically,\n IconFlipHorizontally: FlipHorizontally,\n IconFontSize: FontSize,\n IconCode: Code,\n IconTextBold: TextBold,\n IconTextItalic: TextItalic,\n IconTextUnderline: TextUnderline,\n IconStrikethrough: Strikethrough,\n IconEdit: Edit,\n IconQuote: Quote,\n IconBackgroundColor: BackgroundColor,\n IconGroup: Group,\n IconUngroup: Ungroup,\n IconBack: Back,\n IconNext: Next,\n IconFullwidth: Fullwidth,\n IconAlignTop: AlignTop,\n IconAlignLeft: AlignLeft,\n IconAlignRight: AlignRight,\n IconAlignBottom: AlignBottom,\n IconAlignVertically: AlignVertically,\n IconAlignHorizontally: AlignHorizontally,\n IconBringToFront: BringToFront,\n IconSendToBack: SendToBack,\n IconAlignTextLeft: AlignTextLeft,\n IconAlignTextRight: AlignTextRight,\n IconAlignTextCenter: AlignTextCenter,\n IconRowHeight: RowHeight,\n IconWrite: Write,\n IconInsertTable: InsertTable,\n IconAddText: AddText,\n IconFill: Fill,\n IconTailoring: Tailoring,\n IconEffects: Effects,\n IconColorFilter: ColorFilter,\n IconDown: Down,\n IconPlus: Plus,\n IconMinus: Minus,\n IconConnection: Connection,\n IconBringToFrontOne: BringToFrontOne,\n IconSentToBack: SentToBack,\n IconGithub: Github,\n IconChartProportion: ChartProportion,\n IconChartHistogram: ChartHistogram,\n IconChartHistogramOne: ChartHistogramOne,\n IconChartLineArea: ChartLineArea,\n IconChartRing: ChartRing,\n IconChartScatter: ChartScatter,\n IconChartLine: ChartLine,\n IconChartPie: ChartPie,\n IconText: Text,\n IconRotate: Rotate,\n IconLeftTwo: LeftTwo,\n IconRightTwo: RightTwo,\n IconPlatte: Platte,\n IconUpOne: UpOne,\n IconDownOne: DownOne,\n IconClose: Close,\n IconCloseSmall: CloseSmall,\n IconUndo: Undo,\n IconTransform: Transform,\n IconClick: Click,\n IconTheme: Theme,\n IconArrowCircleLeft: ArrowCircleLeft,\n IconGraphicDesign: GraphicDesign,\n IconLogout: Logout,\n IconErase: Erase,\n IconClear: Clear,\n IconFolderClose: FolderClose,\n IconAlignTextTopOne: AlignTextTopOne,\n IconAlignTextBottomOne: AlignTextBottomOne,\n IconAlignTextMiddleOne: AlignTextMiddleOne,\n IconPause: Pause,\n IconVolumeMute: VolumeMute,\n IconVolumeNotice: VolumeNotice,\n IconVolumeSmall: VolumeSmall,\n IconVideoTwo: VideoTwo,\n IconFormula: Formula,\n IconLinkOne: LinkOne,\n IconFullScreenOne: FullScreenOne,\n IconOffScreenOne: OffScreenOne,\n IconPower: Power,\n IconListView: ListView,\n IconMagic: Magic,\n IconHighLight: HighLight,\n IconShare: Share,\n IconIndentLeft: IndentLeft,\n IconIndentRight: IndentRight,\n IconVerticalSpacingBetweenItems: VerticalSpacingBetweenItems,\n IconCopy: Copy,\n IconDelete: Delete,\n IconSquare: Square,\n IconRound: Round,\n IconNeedle: Needle,\n}\n\nexport default {\n install(app: App) {\n for (const key of Object.keys(icons)) {\n app.component(key, icons[key])\n }\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4727b7ff\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"accept\"]\n\nimport { ref } from 'vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'FileInput',\n props: {\n accept: {\n type: String,\n default: 'image/*',\n },\n},\n emits: [\"change\"],\n setup(__props, { emit }: { emit: ({\n (event: 'change', payload: FileList): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst inputRef = ref()\n\nconst handleClick = () => {\n if (!inputRef.value) return\n inputRef.value.value = ''\n inputRef.value.click()\n}\nconst handleChange = (e: Event) => {\n const files = (e.target as HTMLInputElement).files\n if (files) emit('change', files)\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"file-input\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (handleClick()))\n }, [\n _renderSlot(_ctx.$slots, \"default\"),\n _createElementVNode(\"input\", {\n class: \"input\",\n type: \"file\",\n name: \"upload\",\n ref_key: \"inputRef\",\n ref: inputRef,\n accept: __props.accept,\n onChange: _cache[0] || (_cache[0] = $event => handleChange($event))\n }, null, 40, _hoisted_1)\n ]))\n}\n}\n\n})","import script from \"./FileInput.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./FileInput.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./FileInput.vue?vue&type=style&index=0&id=4727b7ff&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-4727b7ff\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'CheckboxButton',\n props: {\r\n checked: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n},\n setup(__props) {\n\r\n\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"button\", {\n class: _normalizeClass([\"checkbox-button\", { 'checked': __props.checked }])\n }, [\n _renderSlot(_ctx.$slots, \"default\")\n ], 2))\n}\n}\n\n})","import script from \"./CheckboxButton.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./CheckboxButton.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./CheckboxButton.vue?vue&type=style&index=0&id=699cf016&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-699cf016\"]])\n\nexport default __exports__","\r\n\r\n\r\n\r\n","import { render } from \"./CheckboxButtonGroup.vue?vue&type=template&id=b8aa6eac&scoped=true\"\nconst script = {}\n\nimport \"./CheckboxButtonGroup.vue?vue&type=style&index=0&id=b8aa6eac&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-b8aa6eac\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed } from 'vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Checkboard',\n props: {\n size: {\n type: Number,\n default: 8,\n },\n white: {\n type: String,\n default: '#fff',\n },\n grey: {\n type: String,\n default: '#e6e6e6',\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst checkboardCache = {}\n\nconst renderCheckboard = (white: string, grey: string, size: number) => {\n const canvas = document.createElement('canvas')\n canvas.width = canvas.height = size * 2\n const ctx = canvas.getContext('2d')\n \n if (!ctx) return null\n\n ctx.fillStyle = white\n ctx.fillRect(0, 0, canvas.width, canvas.height)\n ctx.fillStyle = grey\n ctx.fillRect(0, 0, size, size)\n ctx.translate(size, size)\n ctx.fillRect(0, 0, size, size)\n return canvas.toDataURL()\n}\n\nconst getCheckboard = (white: string, grey: string, size: number) => {\n const key = white + ',' + grey + ',' + size\n if (checkboardCache[key]) return checkboardCache[key]\n \n const checkboard = renderCheckboard(white, grey, size)\n checkboardCache[key] = checkboard\n return checkboard\n}\n\nconst bgStyle = computed(() => {\n const checkboard = getCheckboard(props.white, props.grey, props.size)\n return { backgroundImage: `url(${checkboard})` }\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"checkerboard\",\n style: _normalizeStyle(_unref(bgStyle))\n }, null, 4))\n}\n}\n\n})","import script from \"./Checkboard.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Checkboard.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Checkboard.vue?vue&type=style&index=0&id=7494636c&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7494636c\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, createElementVNode as _createElementVNode, unref as _unref, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-246b525c\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"alpha\" }\nconst _hoisted_2 = { class: \"alpha-checkboard-wrap\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"alpha-picker\" }, null, -1))\nconst _hoisted_4 = [\n _hoisted_3\n]\n\nimport { computed, onUnmounted, PropType, ref } from 'vue'\n\nimport Checkboard from './Checkboard.vue'\nimport { ColorFormats } from 'tinycolor2'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Alpha',\n props: {\n value: {\n type: Object as PropType,\n required: true,\n },\n},\n emits: [\"colorChange\"],\n setup(__props, { emit }: { emit: ({\n (event: 'colorChange', payload: ColorFormats.RGBA): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst color = computed(() => props.value)\n \nconst gradientColor = computed(() => {\n const rgbaStr = [color.value.r, color.value.g, color.value.b].join(',')\n return `linear-gradient(to right, rgba(${rgbaStr}, 0) 0%, rgba(${rgbaStr}, 1) 100%)`\n})\n\nconst alphaRef = ref()\nconst handleChange = (e: MouseEvent) => {\n e.preventDefault()\n if (!alphaRef.value) return\n const containerWidth = alphaRef.value.clientWidth\n const xOffset = alphaRef.value.getBoundingClientRect().left + window.pageXOffset\n const left = e.pageX - xOffset\n let a\n\n if (left < 0) a = 0\n else if (left > containerWidth) a = 1\n else a = Math.round(left * 100 / containerWidth) / 100\n\n if (color.value.a !== a) {\n emit('colorChange', {\n r: color.value.r,\n g: color.value.g,\n b: color.value.b,\n a: a,\n })\n }\n}\n\nconst unbindEventListeners = () => {\n window.removeEventListener('mousemove', handleChange)\n window.removeEventListener('mouseup', unbindEventListeners)\n}\nconst handleMouseDown = (e: MouseEvent) => {\n handleChange(e)\n window.addEventListener('mousemove', handleChange)\n window.addEventListener('mouseup', unbindEventListeners)\n}\nonUnmounted(unbindEventListeners)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(Checkboard)\n ]),\n _createElementVNode(\"div\", {\n class: \"alpha-gradient\",\n style: _normalizeStyle({ background: _unref(gradientColor) })\n }, null, 4),\n _createElementVNode(\"div\", {\n class: \"alpha-container\",\n ref_key: \"alphaRef\",\n ref: alphaRef,\n onMousedown: _cache[0] || (_cache[0] = $event => handleMouseDown($event))\n }, [\n _createElementVNode(\"div\", {\n class: \"alpha-pointer\",\n style: _normalizeStyle({ left: _unref(color).a * 100 + '%' })\n }, _hoisted_4, 4)\n ], 544)\n ]))\n}\n}\n\n})","import script from \"./Alpha.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Alpha.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Alpha.vue?vue&type=style&index=0&id=246b525c&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-246b525c\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-60c3cca1\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"hue\" }\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"hue-picker\" }, null, -1))\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nimport { computed, onUnmounted, PropType, ref, watch } from 'vue'\nimport tinycolor, { ColorFormats } from 'tinycolor2'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Hue',\n props: {\n value: {\n type: Object as PropType,\n required: true,\n },\n hue: {\n type: Number,\n required: true,\n },\n},\n emits: [\"colorChange\"],\n setup(__props, { emit }: { emit: ({\n (event: 'colorChange', payload: ColorFormats.HSLA): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst oldHue = ref(0)\nconst pullDirection = ref('')\n\nconst color = computed(() => {\n const hsla = tinycolor(props.value).toHsl()\n if (props.hue !== -1) hsla.h = props.hue\n return hsla\n})\n\nconst pointerLeft = computed(() => {\n if (color.value.h === 0 && pullDirection.value === 'right') return '100%'\n return color.value.h * 100 / 360 + '%'\n})\n\nwatch(() => props.value, () => {\n const hsla = tinycolor(props.value).toHsl()\n const h = hsla.s === 0 ? props.hue : hsla.h\n if (h !== 0 && h - oldHue.value > 0) pullDirection.value = 'right'\n if (h !== 0 && h - oldHue.value < 0) pullDirection.value = 'left'\n oldHue.value = h\n})\n\nconst hueRef = ref()\nconst handleChange = (e: MouseEvent) => {\n e.preventDefault()\n if (!hueRef.value) return\n\n const containerWidth = hueRef.value.clientWidth\n const xOffset = hueRef.value.getBoundingClientRect().left + window.pageXOffset\n const left = e.pageX - xOffset\n let h, percent\n \n if (left < 0) h = 0\n else if (left > containerWidth) h = 360\n else {\n percent = left * 100 / containerWidth\n h = 360 * percent / 100\n }\n if (props.hue === -1 || color.value.h !== h) {\n emit('colorChange', {\n h,\n l: color.value.l,\n s: color.value.s,\n a: color.value.a,\n })\n }\n}\n\nconst unbindEventListeners = () => {\n window.removeEventListener('mousemove', handleChange)\n window.removeEventListener('mouseup', unbindEventListeners)\n}\nconst handleMouseDown = (e: MouseEvent) => {\n handleChange(e)\n window.addEventListener('mousemove', handleChange)\n window.addEventListener('mouseup', unbindEventListeners)\n}\nonUnmounted(unbindEventListeners)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"hue-container\",\n ref_key: \"hueRef\",\n ref: hueRef,\n onMousedown: _cache[0] || (_cache[0] = $event => handleMouseDown($event))\n }, [\n _createElementVNode(\"div\", {\n class: \"hue-pointer\",\n style: _normalizeStyle({ left: _unref(pointerLeft) })\n }, _hoisted_3, 4)\n ], 544)\n ]))\n}\n}\n\n})","import script from \"./Hue.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Hue.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Hue.vue?vue&type=style&index=0&id=60c3cca1&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-60c3cca1\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-d230faf4\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"saturation-white\" }, null, -1))\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"saturation-black\" }, null, -1))\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"saturation-circle\" }, null, -1))\nconst _hoisted_4 = [\n _hoisted_3\n]\n\nimport { computed, onUnmounted, PropType, ref } from 'vue'\nimport tinycolor, { ColorFormats } from 'tinycolor2'\nimport { throttle, clamp } from 'lodash'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Saturation',\n props: {\n value: {\n type: Object as PropType,\n required: true,\n },\n hue: {\n type: Number,\n required: true,\n },\n},\n emits: [\"colorChange\"],\n setup(__props, { emit }: { emit: ({\n (event: 'colorChange', payload: ColorFormats.HSVA): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst color = computed(() => {\n const hsva = tinycolor(props.value).toHsv()\n if (props.hue !== -1) hsva.h = props.hue\n return hsva\n})\n\nconst bgColor = computed(() => `hsl(${color.value.h}, 100%, 50%)`)\nconst pointerTop = computed(() => (-(color.value.v * 100) + 1) + 100 + '%')\nconst pointerLeft = computed(() => color.value.s * 100 + '%')\n\nconst emitChangeEvent = throttle(function(param: ColorFormats.HSVA) {\n emit('colorChange', param)\n}, 20, { leading: true, trailing: false })\n\nconst saturationRef = ref()\nconst handleChange = (e: MouseEvent) => {\n e.preventDefault()\n if (!saturationRef.value) return\n \n const containerWidth = saturationRef.value.clientWidth\n const containerHeight = saturationRef.value.clientHeight\n const xOffset = saturationRef.value.getBoundingClientRect().left + window.pageXOffset\n const yOffset = saturationRef.value.getBoundingClientRect().top + window.pageYOffset\n const left = clamp(e.pageX - xOffset, 0, containerWidth)\n const top = clamp(e.pageY - yOffset, 0, containerHeight)\n const saturation = left / containerWidth\n const bright = clamp(-(top / containerHeight) + 1, 0, 1)\n\n emitChangeEvent({\n h: color.value.h,\n s: saturation,\n v: bright,\n a: color.value.a,\n })\n}\n\n\nconst unbindEventListeners = () => {\n window.removeEventListener('mousemove', handleChange)\n window.removeEventListener('mouseup', unbindEventListeners)\n}\nconst handleMouseDown = (e: MouseEvent) => {\n handleChange(e)\n window.addEventListener('mousemove', handleChange)\n window.addEventListener('mouseup', unbindEventListeners)\n}\nonUnmounted(unbindEventListeners)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"saturation\",\n ref_key: \"saturationRef\",\n ref: saturationRef,\n style: _normalizeStyle({ background: _unref(bgColor) }),\n onMousedown: _cache[0] || (_cache[0] = $event => handleMouseDown($event))\n }, [\n _hoisted_1,\n _hoisted_2,\n _createElementVNode(\"div\", {\n class: \"saturation-pointer\",\n style: _normalizeStyle({\n top: _unref(pointerTop),\n left: _unref(pointerLeft),\n })\n }, _hoisted_4, 4)\n ], 36))\n}\n}\n\n})","import script from \"./Saturation.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Saturation.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Saturation.vue?vue&type=style&index=0&id=d230faf4&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-d230faf4\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-2f428dde\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"editable-input\" }\nconst _hoisted_2 = [\"value\"]\n\nimport { computed, PropType } from 'vue'\nimport tinycolor, { ColorFormats } from 'tinycolor2'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'EditableInput',\n props: {\n value: {\n type: Object as PropType,\n required: true,\n },\n},\n emits: [\"colorChange\"],\n setup(__props, { emit }: { emit: ({\n (event: 'colorChange', payload: ColorFormats.RGBA): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst val = computed(() => {\n let _hex = ''\n if (props.value.a < 1) _hex = tinycolor(props.value).toHex8String().toUpperCase()\n else _hex = tinycolor(props.value).toHexString().toUpperCase()\n return _hex.replace('#', '')\n})\n\nconst handleInput = (e: Event) => {\n const value = (e.target as HTMLInputElement).value\n if (value.length >= 6) emit('colorChange', tinycolor(value).toRgb())\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"input\", {\n class: \"input-content\",\n value: _unref(val),\n onInput: _cache[0] || (_cache[0] = $event => handleInput($event))\n }, null, 40, _hoisted_2)\n ]))\n}\n}\n\n})","import script from \"./EditableInput.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./EditableInput.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./EditableInput.vue?vue&type=style&index=0&id=2f428dde&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-2f428dde\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-c46eb110\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"color-picker\" }\nconst _hoisted_2 = { class: \"picker-saturation-wrap\" }\nconst _hoisted_3 = { class: \"picker-controls\" }\nconst _hoisted_4 = { class: \"picker-color-wrap\" }\nconst _hoisted_5 = { class: \"picker-sliders\" }\nconst _hoisted_6 = { class: \"picker-hue-wrap\" }\nconst _hoisted_7 = { class: \"picker-alpha-wrap\" }\nconst _hoisted_8 = { class: \"picker-field\" }\nconst _hoisted_9 = { class: \"picker-presets\" }\nconst _hoisted_10 = [\"onClick\"]\nconst _hoisted_11 = { class: \"picker-gradient-presets\" }\nconst _hoisted_12 = [\"onClick\"]\nconst _hoisted_13 = { class: \"picker-presets\" }\nconst _hoisted_14 = [\"onClick\"]\nconst _hoisted_15 = {\n key: 0,\n class: \"recent-colors-title\"\n}\nconst _hoisted_16 = { class: \"picker-presets\" }\nconst _hoisted_17 = [\"onClick\"]\n\nimport { computed, onMounted, ref, watch } from 'vue'\nimport tinycolor, { ColorFormats } from 'tinycolor2'\nimport { debounce } from 'lodash'\nimport { toCanvas } from 'html-to-image'\n\nimport Alpha from './Alpha.vue'\nimport Checkboard from './Checkboard.vue'\nimport Hue from './Hue.vue'\nimport Saturation from './Saturation.vue'\nimport EditableInput from './EditableInput.vue'\n\nimport { message } from 'ant-design-vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n modelValue: {\n type: String,\n default: '#e86b99',\n },\n},\n emits: [\"update:modelValue\"],\n setup(__props, { emit }: { emit: ({\n (event: 'update:modelValue', payload: string): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst RECENT_COLORS = 'RECENT_COLORS'\n\nconst presetColorConfig = [\n ['#7f7f7f', '#f2f2f2'],\n ['#0d0d0d', '#808080'],\n ['#1c1a10', '#ddd8c3'],\n ['#0e243d', '#c6d9f0'],\n ['#233f5e', '#dae5f0'],\n ['#632623', '#f2dbdb'],\n ['#4d602c', '#eaf1de'],\n ['#3f3150', '#e6e0ec'],\n ['#1e5867', '#d9eef3'],\n ['#99490f', '#fee9da'],\n]\n\nconst gradient = (startColor: string, endColor: string, step: number) => {\n const _startColor = tinycolor(startColor).toRgb()\n const _endColor = tinycolor(endColor).toRgb()\n\n const rStep = (_endColor.r - _startColor.r) / step\n const gStep = (_endColor.g - _startColor.g) / step\n const bStep = (_endColor.b - _startColor.b) / step\n const gradientColorArr = []\n\n for (let i = 0; i < step; i++) {\n const gradientColor = tinycolor({\n r: _startColor.r + rStep * i,\n g: _startColor.g + gStep * i,\n b: _startColor.b + bStep * i,\n }).toRgbString()\n gradientColorArr.push(gradientColor)\n }\n return gradientColorArr\n}\n\nconst getPresetColors = () => {\n const presetColors = []\n for (const color of presetColorConfig) {\n presetColors.push(gradient(color[1], color[0], 5))\n }\n return presetColors\n}\n\nconst themeColors = ['#000000', '#ffffff', '#eeece1', '#1e497b', '#4e81bb', '#e2534d', '#9aba60', '#8165a0', '#47acc5', '#f9974c']\nconst standardColors = ['#c21401', '#ff1e02', '#ffc12a', '#ffff3a', '#90cf5b', '#00af57', '#00afee', '#0071be', '#00215f', '#72349d']\n\nconst hue = ref(-1)\nconst recentColors = ref([])\n\nconst color = computed({\n get() {\n return tinycolor(props.modelValue).toRgb()\n },\n set(rgba: ColorFormats.RGBA) {\n const rgbaString = `rgba(${[rgba.r, rgba.g, rgba.b, rgba.a].join(',')})`\n emit('update:modelValue', rgbaString)\n },\n})\n\nconst presetColors = getPresetColors()\n\nconst currentColor = computed(() => {\n return `rgba(${[color.value.r, color.value.g, color.value.b, color.value.a].join(',')})`\n})\n\nconst selectPresetColor = (colorString: string) => {\n hue.value = tinycolor(colorString).toHsl().h\n emit('update:modelValue', colorString)\n}\n\n// 每次选择非预设颜色时,需要将该颜色加入到最近使用列表中\nconst updateRecentColorsCache = debounce(function() {\n const _color = tinycolor(color.value).toRgbString()\n if (!recentColors.value.includes(_color)) {\n recentColors.value = [_color, ...recentColors.value]\n\n const maxLength = 10\n if (recentColors.value.length > maxLength) {\n recentColors.value = recentColors.value.slice(0, maxLength)\n }\n }\n}, 300, { trailing: true })\n\nonMounted(() => {\n const recentColorsCache = localStorage.getItem(RECENT_COLORS)\n if (recentColorsCache) recentColors.value = JSON.parse(recentColorsCache)\n})\n\nwatch(recentColors, () => {\n const recentColorsCache = JSON.stringify(recentColors.value)\n localStorage.setItem(RECENT_COLORS, recentColorsCache)\n})\n\nconst changeColor = (value: ColorFormats.RGBA | ColorFormats.HSLA | ColorFormats.HSVA) => {\n if ('h' in value) {\n hue.value = value.h\n color.value = tinycolor(value).toRgb()\n }\n else {\n hue.value = tinycolor(value).toHsl().h\n color.value = value\n }\n\n updateRecentColorsCache()\n}\n\n// 打开取色吸管\n// 检查环境是否支持原生取色吸管,支持则使用原生吸管,否则使用自定义吸管\nconst openEyeDropper = () => {\n const isSupportedEyeDropper = 'EyeDropper' in window\n\n if (isSupportedEyeDropper) browserEyeDropper()\n else customEyeDropper()\n}\n\n// 原生取色吸管\nconst browserEyeDropper = () => {\n message.success('按 ESC 键关闭取色吸管')\n\n // eslint-disable-next-line\n const eyeDropper = new (window as any).EyeDropper()\n eyeDropper.open().then((result: { sRGBHex: string }) => {\n const tColor = tinycolor(result.sRGBHex)\n hue.value = tColor.toHsl().h\n color.value = tColor.toRgb()\n\n updateRecentColorsCache()\n }).catch(() => {\n message.success('关闭取色吸管')\n })\n}\n\n// 基于 Canvas 的自定义取色吸管\nconst customEyeDropper = () => {\n const targetRef: HTMLElement | null = document.querySelector('.canvas')\n if (!targetRef) return\n\n const maskRef = document.createElement('div')\n maskRef.style.cssText = 'position: fixed; top: 0; left: 0; bottom: 0; right: 0; z-index: 9999; cursor: wait;'\n document.body.appendChild(maskRef)\n\n const colorBlockRef = document.createElement('div')\n colorBlockRef.style.cssText = 'position: absolute; top: -100px; left: -100px; width: 16px; height: 16px; border: 1px solid #000; z-index: 999'\n maskRef.appendChild(colorBlockRef)\n\n const { left, top, width, height } = targetRef.getBoundingClientRect()\n\n const filter = (node: HTMLElement) => {\n if (node.tagName && node.tagName.toUpperCase() === 'FOREIGNOBJECT') return false\n if (node.classList && node.classList.contains('operate')) return false\n return true\n }\n\n toCanvas(targetRef, { filter, fontEmbedCSS: '', width, height, canvasWidth: width, canvasHeight: height, pixelRatio: 1 }).then(canvasRef => {\n canvasRef.style.cssText = `position: absolute; top: ${top}px; left: ${left}px; cursor: crosshair;`\n maskRef.style.cursor = 'default'\n maskRef.appendChild(canvasRef)\n\n const ctx = canvasRef.getContext('2d')\n if (!ctx) return\n\n let currentColor = ''\n const handleMousemove = (e: MouseEvent) => {\n const x = e.x\n const y = e.y\n\n const mouseX = x - left\n const mouseY = y - top\n\n const [r, g, b, a] = ctx.getImageData(mouseX, mouseY, 1, 1).data\n currentColor = `rgba(${r}, ${g}, ${b}, ${(a / 255).toFixed(2)})`\n\n colorBlockRef.style.left = x + 10 + 'px'\n colorBlockRef.style.top = y + 10 + 'px'\n colorBlockRef.style.backgroundColor = currentColor\n }\n const handleMouseleave = () => {\n currentColor = ''\n colorBlockRef.style.left = '-100px'\n colorBlockRef.style.top = '-100px'\n colorBlockRef.style.backgroundColor = ''\n }\n const handleMousedown = (e: MouseEvent) => {\n if (currentColor && e.button === 0) {\n const tColor = tinycolor(currentColor)\n hue.value = tColor.toHsl().h\n color.value = tColor.toRgb()\n\n updateRecentColorsCache()\n }\n document.body.removeChild(maskRef)\n \n canvasRef.removeEventListener('mousemove', handleMousemove)\n canvasRef.removeEventListener('mouseleave', handleMouseleave)\n window.removeEventListener('mousedown', handleMousedown)\n }\n\n canvasRef.addEventListener('mousemove', handleMousemove)\n canvasRef.addEventListener('mouseleave', handleMouseleave)\n window.addEventListener('mousedown', handleMousedown)\n }).catch(() => {\n message.error('取色吸管初始化失败')\n document.body.removeChild(maskRef)\n })\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconNeedle = _resolveComponent(\"IconNeedle\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(Saturation, {\n value: _unref(color),\n hue: hue.value,\n onColorChange: _cache[0] || (_cache[0] = value => changeColor(value))\n }, null, 8, [\"value\", \"hue\"])\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", {\n class: \"picker-current-color\",\n style: _normalizeStyle({ background: _unref(currentColor) })\n }, null, 4),\n _createVNode(Checkboard)\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(Hue, {\n value: _unref(color),\n hue: hue.value,\n onColorChange: _cache[1] || (_cache[1] = value => changeColor(value))\n }, null, 8, [\"value\", \"hue\"])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createVNode(Alpha, {\n value: _unref(color),\n onColorChange: _cache[2] || (_cache[2] = value => changeColor(value))\n }, null, 8, [\"value\"])\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _createVNode(EditableInput, {\n class: \"input\",\n value: _unref(color),\n onColorChange: _cache[3] || (_cache[3] = value => changeColor(value))\n }, null, 8, [\"value\"]),\n _createElementVNode(\"div\", {\n class: \"straw\",\n onClick: _cache[4] || (_cache[4] = ($event: any) => (openEyeDropper()))\n }, [\n _createVNode(_component_IconNeedle)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(themeColors, (c) => {\n return _createElementVNode(\"div\", {\n class: \"picker-presets-color\",\n key: c,\n style: _normalizeStyle({ background: c }),\n onClick: ($event: any) => (selectPresetColor(c))\n }, null, 12, _hoisted_10)\n }), 64))\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(presetColors), (col, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"picker-gradient-col\",\n key: index\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(col, (c) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"picker-gradient-color\",\n key: c,\n style: _normalizeStyle({ background: c }),\n onClick: ($event: any) => (selectPresetColor(c))\n }, null, 12, _hoisted_12))\n }), 128))\n ]))\n }), 128))\n ]),\n _createElementVNode(\"div\", _hoisted_13, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(standardColors, (c) => {\n return _createElementVNode(\"div\", {\n key: c,\n class: \"picker-presets-color\",\n style: _normalizeStyle({ background: c }),\n onClick: ($event: any) => (selectPresetColor(c))\n }, null, 12, _hoisted_14)\n }), 64))\n ]),\n (recentColors.value.length)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_15, \"最近使用:\"))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_16, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(recentColors.value, (c) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: c,\n class: \"picker-presets-color alpha\",\n onClick: ($event: any) => (selectPresetColor(c))\n }, [\n _createElementVNode(\"div\", {\n class: \"picker-presets-color-content\",\n style: _normalizeStyle({ background: c })\n }, null, 4)\n ], 8, _hoisted_17))\n }), 128))\n ])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=c46eb110&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-c46eb110\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-16ead44e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 0,\n class: \"fullscreen-spin\"\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'FullscreenSpin',\n props: {\n loading: {\n type: Boolean,\n default: false,\n },\n tip: {\n type: String,\n default: '',\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Spin = _resolveComponent(\"Spin\")!\n\n return (__props.loading)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_Spin, {\n tip: __props.tip,\n size: \"large\"\n }, null, 8, [\"tip\"])\n ]))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./FullscreenSpin.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./FullscreenSpin.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./FullscreenSpin.vue?vue&type=style&index=0&id=16ead44e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-16ead44e\"]])\n\nexport default __exports__","import { App } from 'vue'\n\nimport FileInput from '@/components/FileInput.vue'\nimport CheckboxButton from '@/components/CheckboxButton.vue'\nimport CheckboxButtonGroup from '@/components/CheckboxButtonGroup.vue'\nimport ColorPicker from '@/components/ColorPicker/index.vue'\nimport FullscreenSpin from '@/components/FullscreenSpin.vue'\n\nexport const components = {\n FileInput,\n CheckboxButton,\n CheckboxButtonGroup,\n ColorPicker,\n FullscreenSpin,\n}\n\nexport default {\n install(app: App) {\n for (const key of Object.keys(components)) {\n app.component(key, components[key])\n }\n }\n}\n","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, normalizeClass as _normalizeClass, withModifiers as _withModifiers, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-e470e712\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"menu-content\" }\nconst _hoisted_2 = [\"onClick\"]\nconst _hoisted_3 = { class: \"text\" }\nconst _hoisted_4 = {\n key: 0,\n class: \"sub-text\"\n}\n\nimport { PropType } from 'vue'\nimport { ContextmenuItem } from './types'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MenuContent',\n props: {\n menus: {\n type: Array as PropType,\n required: true,\n },\n handleClickMenuItem: {\n type: Function,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n const _component_menu_content = _resolveComponent(\"menu-content\", true)!\n\n return (_openBlock(), _createElementBlock(\"ul\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.menus, (menu, index) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: menu.text || index\n }, [\n (!menu.hide)\n ? (_openBlock(), _createElementBlock(\"li\", {\n key: 0,\n class: _normalizeClass([\"menu-item\", {'divider': menu.divider, 'disable': menu.disable}]),\n onClick: _withModifiers(($event: any) => (__props.handleClickMenuItem(menu)), [\"stop\"])\n }, [\n (!menu.divider)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: _normalizeClass([\"menu-item-content\", {\n 'has-children': menu.children,\n 'has-handler': menu.handler,\n }])\n }, [\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(menu.text), 1),\n (menu.subText && !menu.children)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_4, _toDisplayString(menu.subText), 1))\n : _createCommentVNode(\"\", true),\n (menu.children && menu.children.length)\n ? (_openBlock(), _createBlock(_component_menu_content, {\n key: 1,\n class: \"sub-menu\",\n menus: menu.children,\n handleClickMenuItem: __props.handleClickMenuItem\n }, null, 8, [\"menus\", \"handleClickMenuItem\"]))\n : _createCommentVNode(\"\", true)\n ], 2))\n : _createCommentVNode(\"\", true)\n ], 10, _hoisted_2))\n : _createCommentVNode(\"\", true)\n ], 64))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./MenuContent.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MenuContent.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MenuContent.vue?vue&type=style&index=0&id=e470e712&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-e470e712\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { withModifiers as _withModifiers, createElementVNode as _createElementVNode, unref as _unref, createVNode as _createVNode, normalizeStyle as _normalizeStyle, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { ContextmenuItem, Axis } from './types'\n\nimport MenuContent from './MenuContent.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n axis: {\n type: Object as PropType,\n required: true,\n },\n el: {\n type: Object as PropType,\n required: true,\n },\n menus: {\n type: Array as PropType,\n required: true,\n },\n removeContextmenu: {\n type: Function,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst style = computed(() => {\n const MENU_WIDTH = 170\n const MENU_HEIGHT = 30\n const DIVIDER_HEIGHT = 11\n const PADDING = 5\n\n const { x, y } = props.axis\n const menuCount = props.menus.filter(menu => !(menu.divider || menu.hide)).length\n const dividerCount = props.menus.filter(menu => menu.divider).length\n\n const menuWidth = MENU_WIDTH\n const menuHeight = menuCount * MENU_HEIGHT + dividerCount * DIVIDER_HEIGHT + PADDING * 2\n\n const screenWidth = document.body.clientWidth\n const screenHeight = document.body.clientHeight\n\n return {\n left: screenWidth <= x + menuWidth ? x - menuWidth : x,\n top: screenHeight <= y + menuHeight ? y - menuHeight : y,\n }\n})\n\nconst handleClickMenuItem = (item: ContextmenuItem) => {\n if (item.disable) return\n if (item.children && !item.handler) return\n if (item.handler) item.handler(props.el)\n props.removeContextmenu()\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n _createElementVNode(\"div\", {\n class: \"mask\",\n onContextmenu: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.removeContextmenu()), [\"prevent\"])),\n onMousedown: _cache[1] || (_cache[1] = ($event: any) => (__props.removeContextmenu()))\n }, null, 32),\n _createElementVNode(\"div\", {\n class: \"contextmenu\",\n style: _normalizeStyle({\n left: _unref(style).left + 'px',\n top: _unref(style).top + 'px',\n }),\n onContextmenu: _cache[2] || (_cache[2] = _withModifiers(() => {}, [\"prevent\"]))\n }, [\n _createVNode(MenuContent, {\n menus: __props.menus,\n handleClickMenuItem: handleClickMenuItem\n }, null, 8, [\"menus\"])\n ], 36)\n ], 64))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=e70aeb5c&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { Directive, createVNode, render, DirectiveBinding } from 'vue'\nimport ContextmenuComponent from '@/components/Contextmenu/index.vue'\n\nconst CTX_CONTEXTMENU_HANDLER = 'CTX_CONTEXTMENU_HANDLER'\n\nconst contextmenuListener = (el: HTMLElement, event: MouseEvent, binding: DirectiveBinding) => {\n event.stopPropagation()\n event.preventDefault()\n\n const menus = binding.value(el)\n if (!menus) return\n\n let container: HTMLDivElement | null = null\n\n // 移除右键菜单并取消相关的事件监听\n const removeContextmenu = () => {\n if (container) {\n document.body.removeChild(container)\n container = null\n }\n el.classList.remove('contextmenu-active')\n document.body.removeEventListener('scroll', removeContextmenu) \n window.removeEventListener('resize', removeContextmenu)\n }\n\n // 创建自定义菜单\n const options = {\n axis: { x: event.x, y: event.y },\n el,\n menus,\n removeContextmenu,\n }\n container = document.createElement('div')\n const vm = createVNode(ContextmenuComponent, options, null)\n render(vm, container)\n document.body.appendChild(container)\n\n // 为目标节点添加菜单激活状态的className\n el.classList.add('contextmenu-active')\n\n // 页面变化时移除菜单\n document.body.addEventListener('scroll', removeContextmenu)\n window.addEventListener('resize', removeContextmenu)\n}\n\nconst ContextmenuDirective: Directive = {\n mounted(el: HTMLElement, binding) {\n el[CTX_CONTEXTMENU_HANDLER] = (event: MouseEvent) => contextmenuListener(el, event, binding)\n el.addEventListener('contextmenu', el[CTX_CONTEXTMENU_HANDLER])\n },\n\n unmounted(el: HTMLElement) {\n if (el && el[CTX_CONTEXTMENU_HANDLER]) {\n el.removeEventListener('contextmenu', el[CTX_CONTEXTMENU_HANDLER])\n delete el[CTX_CONTEXTMENU_HANDLER]\n }\n },\n}\n\nexport default ContextmenuDirective","import { Directive, DirectiveBinding } from 'vue'\n\nconst CTX_CLICK_OUTSIDE_HANDLER = 'CTX_CLICK_OUTSIDE_HANDLER'\n\nconst clickListener = (el: HTMLElement, event: MouseEvent, binding: DirectiveBinding) => {\n const handler = binding.value\n\n const path = event.composedPath()\n const isClickOutside = path ? path.indexOf(el) < 0 : !el.contains(event.target as HTMLElement)\n\n if (!isClickOutside) return\n handler(event)\n}\n\nconst ClickOutsideDirective: Directive = {\n mounted(el: HTMLElement, binding) {\n el[CTX_CLICK_OUTSIDE_HANDLER] = (event: MouseEvent) => clickListener(el, event, binding)\n setTimeout(() => {\n document.addEventListener('click', el[CTX_CLICK_OUTSIDE_HANDLER])\n }, 0)\n },\n \n unmounted(el: HTMLElement) {\n if (el[CTX_CLICK_OUTSIDE_HANDLER]) {\n document.removeEventListener('click', el[CTX_CLICK_OUTSIDE_HANDLER])\n delete el[CTX_CLICK_OUTSIDE_HANDLER]\n }\n },\n}\n\nexport default ClickOutsideDirective","import { App } from 'vue'\n\nimport Contextmenu from './contextmenu'\nimport ClickOutside from './clickOutside'\n\nexport default {\n install(app: App) {\n app.directive('contextmenu', Contextmenu)\n app.directive('click-outside', ClickOutside)\n }\n}\n","import { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport App from './App.vue'\nimport './registerServiceWorker'\n\nimport '@icon-park/vue-next/styles/index.css'\nimport 'prosemirror-view/style/prosemirror.css'\nimport 'animate.css'\n\nimport '@/assets/styles/prosemirror.scss'\nimport '@/assets/styles/global.scss'\nimport '@/assets/styles/antd.scss'\nimport '@/assets/styles/font.scss'\n\nimport Icon from '@/plugins/icon'\nimport Component from '@/plugins/component'\nimport Directive from '@/plugins/directive'\n\nimport {\n InputNumber,\n Divider,\n Button,\n Tooltip,\n Popover,\n Slider,\n Select,\n Switch,\n Radio,\n Input,\n Modal,\n Dropdown,\n Menu,\n Checkbox,\n Drawer,\n Spin,\n} from 'ant-design-vue'\n\nconst app = createApp(App)\n\napp.component('InputNumber', InputNumber)\napp.component('Divider', Divider)\napp.component('Button', Button)\napp.component('ButtonGroup', Button.Group)\napp.component('Tooltip', Tooltip)\napp.component('Popover', Popover)\napp.component('Slider', Slider)\napp.component('Select', Select)\napp.component('SelectOption', Select.Option)\napp.component('SelectOptGroup', Select.OptGroup)\napp.component('Switch', Switch)\napp.component('Radio', Radio)\napp.component('RadioGroup', Radio.Group)\napp.component('RadioButton', Radio.Button)\napp.component('Input', Input)\napp.component('InputGroup', Input.Group)\napp.component('TextArea', Input.TextArea)\napp.component('Modal', Modal)\napp.component('Dropdown', Dropdown)\napp.component('Menu', Menu)\napp.component('MenuItem', Menu.Item)\napp.component('Checkbox', Checkbox)\napp.component('Drawer', Drawer)\napp.component('Spin', Spin)\n\napp.use(Icon)\napp.use(Component)\napp.use(Directive)\n\napp.use(createPinia())\napp.mount('#app')\n","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=5303bd17&lang=scss&scoped=true\"","export * from \"-!../../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=769d6876&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ScreenElement.vue?vue&type=style&index=0&id=a15cc1d8&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=27793fbf&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./LineStylePanel.vue?vue&type=style&index=0&id=938968a2&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=153c0b44&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=1f8f1a8b&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./TableStylePanel.vue?vue&type=style&index=0&id=7e28e1d8&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./MobileOperate.vue?vue&type=style&index=0&id=7fdc6c04&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./MobileThumbnails.vue?vue&type=style&index=0&id=4a0c7aa7&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ShapeStylePanel.vue?vue&type=style&index=0&id=02998580&lang=scss&scoped=true\"","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./FileInput.vue?vue&type=style&index=0&id=4727b7ff&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ExportImage.vue?vue&type=style&index=0&id=60a953a0&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./BaseImageElement.vue?vue&type=style&index=0&id=66f2009f&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./SlideToolbar.vue?vue&type=style&index=0&id=5c24a24d&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./Alpha.vue?vue&type=style&index=0&id=246b525c&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./FormulaContent.vue?vue&type=style&index=0&id=1c41d9fe&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=1db12f3f&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ExportJSON.vue?vue&type=style&index=0&id=1bc24666&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=82b674f6&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=c46eb110&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ElementOutline.vue?vue&type=style&index=0&id=e91e3764&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./Chart.vue?vue&type=style&index=1&id=1aa2357d&lang=scss\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./LineElementOperate.vue?vue&type=style&index=0&id=4659f395&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./BaseLineElement.vue?vue&type=style&index=0&id=340cdee8&lang=scss&scoped=true\"","export * from \"-!../../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ImageRectOutline.vue?vue&type=style&index=0&id=b5bace06&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ExportPPTX.vue?vue&type=style&index=0&id=3fef9be0&lang=scss&scoped=true\""],"sourceRoot":""} \ No newline at end of file diff --git a/js/app.95b5a2d2.js b/js/app.95b5a2d2.js new file mode 100644 index 00000000..e5f9f626 --- /dev/null +++ b/js/app.95b5a2d2.js @@ -0,0 +1,2 @@ +(function(e){function t(t){for(var c,l,r=t[0],i=t[1],u=t[2],s=0,f=[];sb){var p=e.nodeAt(o),m=p&&p.marks.find(a);if(!m||m!==l)break;s=o,r=p,o--}o=n+1,b=e.nodeSize-2;while(o-1||t.type===e},F=function(e,t){for(var n=e.depth;n>0;n--){var c=e.node(n);if(t(c))return{pos:n>0?e.before(n):0,start:e.start(n),depth:n,node:c}}},A=function(e){return function(t){return F(t.$from,e)}},R=function(e){return function(t){return A((function(t){return z(e,t)}))(t)}},P=function(e,t){var n=t.schema.nodes[e];return!!R(n)(t.selection)},H=function(e){var t,n,c=e.state,o=c.selection,a=c.doc,l=o.from,r=a.nodeAt(l)||a.nodeAt(l-1);return null!==(t=r)&&void 0!==t&&t.lastChild&&(r=r.lastChild),(null===(n=r)||void 0===n?void 0:n.marks)||[]},q=function(e,t,n){var c,o=Object(L["a"])(e);try{for(o.s();!(c=o.n()).done;){var a=c.value;if(a.type.name===t&&a.attrs[n])return a.attrs[n]}}catch(l){o.e(l)}finally{o.f()}return null},U=function(e,t){var n,c=Object(L["a"])(e);try{for(c.s();!(n=c.n()).done;){var o=n.value;if(o.type.name===t)return!0}}catch(a){c.e(a)}finally{c.f()}return!1},G=function(e,t){var n=e.selection,c=n.from,o=n.$from,a=n.to,l=n.empty;return l?t.isInSet(e.storedMarks||o.marks()):e.doc.rangeHasMark(c,a,t)},X=function(e,t){var n=e.state,c=n.selection,o=n.doc,a=c.from,l=c.to,r=!0,i="";return o.nodesBetween(a,l,(function(e){return r&&e.attrs[t]&&(r=!1,i=e.attrs[t]),r})),i},Y={color:"#000",backcolor:"#000",fontsize:"20px",fontname:"微软雅黑",align:"left"},Z=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};t=Object(S["a"])(Object(S["a"])({},Y),t);var n=H(e),c=U(n,"strong"),o=U(n,"em"),a=U(n,"underline"),l=U(n,"strikethrough"),r=U(n,"superscript"),i=U(n,"subscript"),u=U(n,"code"),d=q(n,"forecolor","color")||t.color,s=q(n,"backcolor","backcolor")||t.backcolor,f=q(n,"fontsize","fontsize")||t.fontsize,b=q(n,"fontname","fontname")||t.fontname,p=q(n,"link","href")||"",m=X(e,"align")||t.align,O=P("bullet_list",e.state),v=P("ordered_list",e.state),j=P("blockquote",e.state);return{bold:c,em:o,underline:a,strikethrough:l,superscript:r,subscript:i,code:u,color:d,backcolor:s,fontsize:f,fontname:b,link:p,align:m,bulletList:O,orderedList:v,blockquote:j}},W=function(e){var t=H(e),n=q(t,"fontsize","fontsize")||Y.fontsize;return parseInt(n)},J={bold:!1,em:!1,underline:!1,strikethrough:!1,superscript:!1,subscript:!1,code:!1,color:"#000",backcolor:"#000",fontsize:"20px",fontname:"微软雅黑",link:"",align:"left",bulletList:!1,orderedList:!1,blockquote:!1},K=(n("99af"),n("fb6a"),n("a15b"),function(e){if("string"!==typeof e)return!1;var t="Arial";if(e.toLowerCase()===t.toLowerCase())return!0;var n=100,c=100,o=100,a="a",l=document.createElement("canvas"),r=l.getContext("2d");if(!r)return!1;l.width=c,l.height=o,r.textAlign="center",r.fillStyle="black",r.textBaseline="middle";var i=function(e){r.clearRect(0,0,c,o),r.font="".concat(n,"px ").concat(e,", ").concat(t),r.fillText(a,c/2,o/2);var l=r.getImageData(0,0,c,o).data;return[].slice.call(l).filter((function(e){return 0!==e}))};return i(t).join("")!==i(e).join("")}),Q=n("2909"),$=(n("d81d"),n("ac1f"),n("5319"),n("5b81"),n("a434"),n("c740"),n("66cb")),ee=n.n($),te=n("2ef0"),ne=[{id:"test-slide-1",elements:[{type:"shape",id:"4cbRxp",left:0,top:200,width:546,height:362.5,viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z",fill:"#5b9bd5",fixedRatio:!1,opacity:.7,rotate:0},{type:"shape",id:"ookHrf",left:0,top:0,width:300,height:320,viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z",fill:"#5b9bd5",fixedRatio:!1,flipV:!0,rotate:0},{type:"text",id:"idn7Mx",left:355,top:65.25,width:585,height:188,lineHeight:1.2,content:"

PPTIST

",rotate:0,defaultFontName:"Microsoft Yahei",defaultColor:"#333"},{type:"text",id:"7stmVP",left:355,top:253.25,width:585,height:56,content:"

基于 Vue 3.x + TypeScript 的在线演示文稿应用

",rotate:0,defaultFontName:"Microsoft Yahei",defaultColor:"#333"},{type:"line",id:"FnpZs4",left:361,top:238,start:[0,0],end:[549,0],points:["",""],color:"#5b9bd5",style:"solid",width:2}],background:{type:"solid",color:"#ffffff"}},{id:"test-slide-2",elements:[{type:"text",id:"ptNnUJ",left:145,top:148,width:711,height:77,lineHeight:1.2,content:"

在此处添加标题

",rotate:0,defaultFontName:"Microsoft Yahei",defaultColor:"#333"},{type:"text",id:"mRHvQN",left:207.50000000000003,top:249.84259259259264,width:585,height:56,content:"

在此处添加副标题

",rotate:0,defaultFontName:"Microsoft Yahei",defaultColor:"#333"},{type:"line",id:"7CQDwc",left:323.09259259259267,top:238.33333333333334,start:[0,0],end:[354.8148148148148,0],points:["",""],color:"#5b9bd5",style:"solid",width:4},{type:"shape",id:"09wqWw",left:-27.648148148148138,top:432.73148148148147,width:1056.2962962962963,height:162.96296296296296,viewBox:[200,200],path:"M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z",fill:"#5b9bd5",fixedRatio:!1,rotate:0}],background:{type:"solid",color:"#fff"}},{id:"test-slide-3",elements:[{type:"shape",id:"vSheCJ",left:183.5185185185185,top:175.5092592592593,width:605.1851851851851,height:185.18518518518516,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:"#5b9bd5",fixedRatio:!1,rotate:0},{type:"shape",id:"Mpwv7x",left:211.29629629629628,top:201.80555555555557,width:605.1851851851851,height:185.18518518518516,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:"#5b9bd5",fixedRatio:!1,rotate:0,opacity:.7},{type:"text",id:"WQOTAp",left:304.9074074074074,top:198.10185185185182,width:417.9629629629629,height:140,content:"

感谢观看

",rotate:0,defaultFontName:"Microsoft Yahei",defaultColor:"#333",wordSpace:5}],background:{type:"solid",color:"#fff"}}],ce={themeColor:"#5b9bd5",fontColor:"#333",fontName:"Microsoft Yahei",backgroundColor:"#fff"},oe=[{id:"template",elements:[{type:"shape",id:"4cbRxp",left:0,top:200,width:546,height:362.5,viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z",fill:"{{themeColor}}",fixedRatio:!1,opacity:.7,rotate:0},{type:"shape",id:"ookHrf",left:0,top:0,width:300,height:320,viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z",fill:"{{themeColor}}",fixedRatio:!1,flipV:!0,rotate:0},{type:"text",id:"AkIh3E",left:355,top:95.11111111111111,width:585,height:116,lineHeight:1.2,content:"

输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",wordSpace:6},{type:"text",id:"7stmVP",left:355,top:253.25,width:585,height:56,content:"

请在此处输入副标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"line",id:"FnpZs4",left:361,top:238,start:[0,0],end:[549,0],points:["",""],color:"{{themeColor}}",style:"solid",width:2}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"text",id:"ptNnUJ",left:145,top:148,width:711,height:77,lineHeight:1.2,content:"

在此处添加标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"text",id:"mRHvQN",left:207.50000000000003,top:249.84259259259264,width:585,height:56,content:"

在此处添加副标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"line",id:"7CQDwc",left:323.09259259259267,top:238.33333333333334,start:[0,0],end:[354.8148148148148,0],points:["",""],color:"{{themeColor}}",style:"solid",width:4},{type:"shape",id:"09wqWw",left:-27.648148148148138,top:432.73148148148147,width:1056.2962962962963,height:162.96296296296296,viewBox:[200,200],path:"M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"shape",id:"vSheCJ",left:183.5185185185185,top:175.5092592592593,width:605.1851851851851,height:185.18518518518516,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0},{type:"shape",id:"Mpwv7x",left:211.29629629629628,top:201.80555555555557,width:605.1851851851851,height:185.18518518518516,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,opacity:.7},{type:"text",id:"WQOTAp",left:304.9074074074074,top:198.10185185185182,width:417.9629629629629,height:140,content:"

感谢观看

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",wordSpace:5}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"MZVO1kkj",elements:[{type:"shape",id:"cql0h8",left:0,top:0,width:352.59259259259255,height:562.5,viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0},{type:"shape",id:"_RTaF4",left:171.4814814814814,top:100.13888888888887,width:362.22222222222223,height:362.22222222222223,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"rgba(255,255,255,0)",fixedRatio:!1,rotate:0,outline:{width:10,color:"{{backgroundColor}}",style:"solid"}},{type:"shape",id:"UZfo8N",left:216.66666666666663,top:145.32407407407408,width:271.85185185185185,height:271.85185185185185,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{backgroundColor}}",fixedRatio:!1,rotate:0,text:{content:"

01

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"ysqtBg",left:561.4814814814814,top:100.1388888888889,width:359.25925925925924,height:80,content:"

在此处输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"text",id:"lXsoHa",left:572.5925925925925,top:202.3611111111111,width:257.77777777777777,height:260,content:"
  1. 在此处输入内容

  2. 在此处输入内容

  3. 在此处输入内容

  4. 在此处输入内容

  5. 在此处输入内容

  6. 在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",lineHeight:2,fill:"{{subColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"shape",id:"EBBnTr",left:360.5996472663139,top:141.8496472663139,width:278.80070546737215,height:278.80070546737215,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!0,rotate:0,outline:{width:0,color:"{{backgroundColor}}",style:"solid"}},{type:"shape",id:"gDIWDH",left:456.4373897707231,top:98.287037037037,width:87.12522045855381,height:87.12522045855381,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!0,rotate:0,outline:{width:4,color:"{{backgroundColor}}",style:"solid"},text:{content:"

1

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"shape",id:"DUWT7E",left:317.037037037037,top:237.68738977072314,width:87.12522045855381,height:87.12522045855381,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!0,rotate:0,outline:{width:4,color:"{{backgroundColor}}",style:"solid"},text:{content:"

4

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"shape",id:"pbhn38",left:456.43738977072303,top:377.08774250440916,width:87.12522045855381,height:87.12522045855381,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!0,rotate:0,outline:{width:4,color:"{{backgroundColor}}",style:"solid"},text:{content:"

3

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"shape",id:"CvMKrO",left:595.8377425044091,top:237.6873897707231,width:87.12522045855381,height:87.12522045855381,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!0,rotate:0,outline:{width:4,color:"{{backgroundColor}}",style:"solid"},text:{content:"

2

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"adudHB",left:402.962962962963,top:39.39814814814815,width:194.07407407407408,height:50,content:"

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"text",id:"9UpDwg",left:402.962962962963,top:473.1018518518518,width:194.07407407407408,height:50,content:"

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"text",id:"GERdpB",left:111.48148148148151,top:256.25,width:194.07407407407408,height:50,content:"

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"text",id:"G5qoho",left:691.1111111111111,top:256.25,width:194.07407407407408,height:50,content:"

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"},{type:"shape",id:"vdZcI6",left:415.18518518518516,top:196.4351851851852,width:169.62962962962962,height:169.62962962962962,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{backgroundColor}}",fixedRatio:!1,rotate:0}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"shape",id:"tYUmrx",left:156.66666666666683,top:149.02777777777771,width:264.4444444444445,height:264.4444444444445,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

01

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"shape",id:"0GVHf8",left:342.2222222222223,top:217.17592592592587,width:128.14814814814812,height:128.14814814814812,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{backgroundColor}}",fixedRatio:!1,rotate:0},{type:"text",id:"BO33Sv",left:378.8888888888889,top:235.24999999999994,width:464.4444444444444,height:92,content:"

在此处添加标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"text",id:"Hj7ttp",left:69.35185185185185,top:49.21759259259262,width:420,height:63,lineHeight:1.2,content:"

1.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"FmKMNB",left:69.35185185185185,top:129.28240740740745,width:420,height:384,content:"

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"rI7ZeO",left:510.64814814814815,top:49.21759259259262,width:420,height:63,lineHeight:1.2,content:"

2.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"KspwGc",left:510.64814814814815,top:129.28240740740745,width:420,height:384,content:"

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"text",id:"Rx63Jo",left:69.35185185185179,top:51.71759259259262,width:420,height:58,lineHeight:1.2,content:"

1.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"ulyuzE",left:69.35185185185179,top:131.78240740740745,width:420,height:129,content:"

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"kr35Ca",left:510.6481481481481,top:51.71759259259262,width:420,height:58,lineHeight:1.2,content:"

2.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"BNQSpC",left:510.6481481481481,top:131.78240740740745,width:420,height:129,content:"

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"Vr38Nu",left:69.35185185185185,top:301.71759259259255,width:420,height:58,lineHeight:1.2,content:"

3.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"IwKRSu",left:69.35185185185185,top:381.7824074074074,width:420,height:129,content:"

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"0Opr1v",left:510.64814814814815,top:301.71759259259255,width:420,height:58,lineHeight:1.2,content:"

4.请输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{themeColor}}"},{type:"text",id:"4L9Uzz",left:510.64814814814815,top:381.7824074074074,width:420,height:129,content:"

在此处输入内容

在此处输入内容

在此处输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"text",id:"GdEGxg",left:134.53703703703704,top:127.25,width:152.77777777777777,height:308,lineHeight:1.8,content:"

请在此处输入标题

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",wordSpace:8,fill:"{{themeColor}}"},{type:"text",id:"y5sAfw",left:332.8703703703704,top:127.25,width:532.5925925925926,height:50,content:"

请在此处输入内容1

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"VeuocM",left:332.8703703703704,top:212.0648148148148,width:532.5925925925926,height:50,content:"

请在此处输入内容2

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"RyFWQe",left:332.8703703703704,top:296.8796296296296,width:532.5925925925926,height:50,content:"

请在此处输入内容3

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"text",id:"Q56viI",left:332.8703703703704,top:381.69444444444446,width:532.5925925925926,height:50,content:"

请在此处输入内容4

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}},{id:"template",elements:[{type:"shape",id:"SUWirT",left:73.8888888888889,top:64.21296296296302,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

1

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"YjzN1M",left:148.70370370370372,top:64.21296296296302,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"shape",id:"fS09I7",left:527.5925925925926,top:64.21296296296302,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

2

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"qCnfB1",left:602.4074074074074,top:64.21296296296302,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"shape",id:"difAAT",left:73.8888888888889,top:221.25000000000003,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

3

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"EUlvMo",left:148.70370370370372,top:221.25000000000003,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"shape",id:"US_9jB",left:527.5925925925926,top:221.25000000000003,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

4

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"243MnQ",left:602.4074074074074,top:221.25000000000003,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"shape",id:"Y_KUj0",left:73.8888888888889,top:378.287037037037,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

5

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"9GglMe",left:148.70370370370372,top:378.287037037037,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"},{type:"shape",id:"eSInje",left:527.5925925925926,top:378.287037037037,width:49.629629629629626,height:49.629629629629626,viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z",fill:"{{themeColor}}",fixedRatio:!1,rotate:0,text:{content:"

6

",defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",align:"middle"}},{type:"text",id:"0S3yUg",left:602.4074074074074,top:378.287037037037,width:323.7037037037037,height:120,content:"

在此输入内容

在此输入内容

在此输入内容

",rotate:0,defaultFontName:"{{fontName}}",defaultColor:"{{fontColor}}",fill:"{{subColor}}"}],background:{type:"solid",color:"{{backgroundColor}}"}}],ae=Object(g["b"])("slides",{state:function(){return{theme:ce,slides:ne,slideIndex:0,viewportRatio:.5625}},getters:{currentSlide:function(e){return e.slides[e.slideIndex]},currentSlideAnimations:function(e){var t=e.slides[e.slideIndex];if(null===t||void 0===t||!t.animations)return[];var n=t.elements,c=n.map((function(e){return e.id}));return t.animations.filter((function(e){return c.includes(e.elId)}))},formatedAnimations:function(e){var t=e.slides[e.slideIndex];if(null===t||void 0===t||!t.animations)return[];var n,c=t.elements,o=c.map((function(e){return e.id})),a=t.animations.filter((function(e){return o.includes(e.elId)})),l=[],r=Object(L["a"])(a);try{var i=function(){var e=n.value;if("click"!==e.trigger&&l.length){if("meantime"===e.trigger){var t=l[l.length-1];t.animations=t.animations.filter((function(t){return t.elId!==e.elId})),t.animations.push(e),l[l.length-1]=t}else if("auto"===e.trigger){var c=l[l.length-1];c.autoNext=!0,l[l.length-1]=c,l.push({animations:[e],autoNext:!1})}}else l.push({animations:[e],autoNext:!1})};for(r.s();!(n=r.n()).done;)i()}catch(u){r.e(u)}finally{r.f()}return l},layouts:function(e){var t=e.theme,n=t.themeColor,c=t.fontColor,o=t.fontName,a=t.backgroundColor,l=ee()(c).isDark()?"rgba(230, 230, 230, 0.5)":"rgba(180, 180, 180, 0.5)",r=JSON.stringify(oe).replaceAll("{{themeColor}}",n).replaceAll("{{fontColor}}",c).replaceAll("{{fontName}}",o).replaceAll("{{backgroundColor}}",a).replaceAll("{{subColor}}",l);return JSON.parse(r)}},actions:{setTheme:function(e){this.theme=Object(S["a"])(Object(S["a"])({},this.theme),e)},setViewportRatio:function(e){this.viewportRatio=e},setSlides:function(e){this.slides=e},addSlide:function(e){var t,n=Array.isArray(e)?e:[e],c=this.slideIndex+1;(t=this.slides).splice.apply(t,[c,0].concat(Object(Q["a"])(n))),this.slideIndex=c},updateSlide:function(e){var t=this.slideIndex;this.slides[t]=Object(S["a"])(Object(S["a"])({},this.slides[t]),e)},deleteSlide:function(e){for(var t=this,n=Array.isArray(e)?e:[e],c=[],o=function(e){var o=t.slides.findIndex((function(t){return t.id===n[e]}));c.push(o)},a=0;ar&&(l=r),this.slideIndex=l,this.slides=this.slides.filter((function(e){return!n.includes(e.id)}))},updateSlideIndex:function(e){this.slideIndex=e},addElement:function(e){var t=Array.isArray(e)?e:[e],n=this.slides[this.slideIndex].elements,c=[].concat(Object(Q["a"])(n),Object(Q["a"])(t));this.slides[this.slideIndex].elements=c},deleteElement:function(e){var t=Array.isArray(e)?e:[e],n=this.slides[this.slideIndex].elements,c=n.filter((function(e){return!t.includes(e.id)}));this.slides[this.slideIndex].elements=c},updateElement:function(e){var t=e.id,n=e.props,c="string"===typeof t?[t]:t,o=this.slideIndex,a=this.slides[o],l=a.elements.map((function(e){return c.includes(e.id)?Object(S["a"])(Object(S["a"])({},e),n):e}));this.slides[o].elements=l},removeElementProps:function(e){var t=e.id,n=e.propName,c="string"===typeof n?[n]:n,o=this.slideIndex,a=this.slides[o],l=a.elements.map((function(e){return e.id===t?Object(te["omit"])(e,c):e}));this.slides[o].elements=l}}}),le=Object(x["a"])("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"),re=le(10),ie=Object(g["b"])("main",{state:function(){return{activeElementIdList:[],handleElementId:"",activeGroupElementId:"",canvasPercentage:90,canvasScale:1,canvasDragged:!1,thumbnailsFocus:!1,editorAreaFocus:!1,disableHotkeys:!1,showGridLines:!1,showRuler:!1,creatingElement:null,availableFonts:I,toolbarState:c.SLIDE_DESIGN,clipingImageElementId:"",richTextAttrs:J,selectedTableCells:[],isScaling:!1,selectedSlidesIndex:[],dialogForExport:"",databaseId:re}},getters:{activeElementList:function(e){var t=ae(),n=t.currentSlide;return n&&n.elements?n.elements.filter((function(t){return e.activeElementIdList.includes(t.id)})):[]},handleElement:function(e){var t=ae(),n=t.currentSlide;return n&&n.elements&&n.elements.find((function(t){return e.handleElementId===t.id}))||null}},actions:{setActiveElementIdList:function(e){1===e.length?this.handleElementId=e[0]:this.handleElementId="",this.activeElementIdList=e},setHandleElementId:function(e){this.handleElementId=e},setActiveGroupElementId:function(e){this.activeGroupElementId=e},setCanvasPercentage:function(e){this.canvasPercentage=e},setCanvasScale:function(e){this.canvasScale=e},setCanvasDragged:function(e){this.canvasDragged=e},setThumbnailsFocus:function(e){this.thumbnailsFocus=e},setEditorareaFocus:function(e){this.editorAreaFocus=e},setDisableHotkeysState:function(e){this.disableHotkeys=e},setGridLinesState:function(e){this.showGridLines=e},setRulerState:function(e){this.showRuler=e},setCreatingElement:function(e){this.creatingElement=e},setAvailableFonts:function(){this.availableFonts=I.filter((function(e){return K(e.value)}))},setToolbarState:function(e){this.toolbarState=e},setClipingImageElementId:function(e){this.clipingImageElementId=e},setRichtextAttrs:function(e){this.richTextAttrs=e},setSelectedTableCells:function(e){this.selectedTableCells=e},setScalingState:function(e){this.isScaling=e},updateSelectedSlidesIndex:function(e){this.selectedSlidesIndex=e},setDialogForExport:function(e){this.dialogForExport=e}}}),ue=n("1da1"),de=(n("ddb0"),n("96cf"),n("d4ec")),se=n("257e"),fe=n("262e"),be=n("2caf"),pe=n("ade3"),me=n("3835"),Oe=(n("1276"),n("4dec")),ve="PPTIST_DISCARDED_DB",je="PPTist",he=function(){var e=Object(ue["a"])(regeneratorRuntime.mark((function e(){var t,n,c,o,a,l,r,i;return regeneratorRuntime.wrap((function(e){while(1)switch(e.prev=e.next){case 0:return t=(new Date).getTime(),n=localStorage.getItem(ve),c=n?JSON.parse(n):[],e.next=5,Oe["a"].getDatabaseNames();case 5:o=e.sent,a=o.filter((function(e){if(-1===e.indexOf(je))return!1;var n=e.split("_"),o=Object(me["a"])(n,3),a=o[0],l=o[1],r=o[2];return a!==je||!l||!r||(!!c.includes(l)||t-+r>=432e5)})),l=Object(L["a"])(a);try{for(l.s();!(r=l.n()).done;)i=r.value,Oe["a"].delete(i)}catch(u){l.e(u)}finally{l.f()}localStorage.removeItem(ve);case 10:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),ye=function(e){Object(fe["a"])(n,e);var t=Object(be["a"])(n);function n(){var e;return Object(de["a"])(this,n),e=t.call(this,"".concat(je,"_").concat(re,"_").concat((new Date).getTime())),Object(pe["a"])(Object(se["a"])(e),"snapshots",void 0),e.version(1).stores({snapshots:"++id"}),e.snapshots=e.table("snapshots"),e}return n}(Oe["a"]),ge=new ye,xe=Object(g["b"])("snapshot",{state:function(){return{snapshotCursor:-1,snapshotLength:0}},getters:{canUndo:function(e){return e.snapshotCursor>0},canRedo:function(e){return e.snapshotCursor=0&&e.snapshotCursorr&&(o.push(c[0]),l--),l>=2&&ge.snapshots.update(c[l-2],{index:n.slideIndex}),t.next=15,ge.snapshots.bulkDelete(o);case 15:e.setSnapshotCursor(l-1),e.setSnapshotLength(l);case 17:case"end":return t.stop()}}),t)})))()},unDo:function(){var e=this;return Object(ue["a"])(regeneratorRuntime.mark((function t(){var n,c,o,a,l,r,i,u;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!(e.snapshotCursor<=0)){t.next=2;break}return t.abrupt("return");case 2:return n=ae(),c=ie(),o=e.snapshotCursor-1,t.next=7,ge.snapshots.orderBy("id").toArray();case 7:a=t.sent,l=a[o],r=l.index,i=l.slides,u=r>i.length-1?i.length-1:r,n.setSlides(i),n.updateSlideIndex(u),e.setSnapshotCursor(o),c.setActiveElementIdList([]);case 15:case"end":return t.stop()}}),t)})))()},reDo:function(){var e=this;return Object(ue["a"])(regeneratorRuntime.mark((function t(){var n,c,o,a,l,r,i,u;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!(e.snapshotCursor>=e.snapshotLength-1)){t.next=2;break}return t.abrupt("return");case 2:return n=ae(),c=ie(),o=e.snapshotCursor+1,t.next=7,ge.snapshots.orderBy("id").toArray();case 7:a=t.sent,l=a[o],r=l.index,i=l.slides,u=r>i.length-1?i.length-1:r,n.setSlides(i),n.updateSlideIndex(u),e.setSnapshotCursor(o),c.setActiveElementIdList([]);case 15:case"end":return t.stop()}}),t)})))()}}}),ke=Object(g["b"])("keyboard",{state:function(){return{ctrlKeyState:!1,shiftKeyState:!1,spaceKeyState:!1}},getters:{ctrlOrShiftKeyActive:function(e){return e.ctrlKeyState||e.shiftKeyState}},actions:{setCtrlKeyState:function(e){this.ctrlKeyState=e},setShiftKeyState:function(e){this.shiftKeyState=e},setSpaceKeyState:function(e){this.spaceKeyState=e}}}),Ce=Object(g["b"])("screen",{state:function(){return{screening:!1}},actions:{setScreening:function(e){this.screening=e}}}),Ne=(n("466d"),function(e,t){return Object(te["padStart"])(""+e,t,"0")}),Ee=function(){return!navigator.userAgent.match(/(iPhone|iPod|iPad|Android|Mobile|BlackBerry|Symbian|Windows Phone)/i)};(function(e){e["UP"]="up",e["DOWN"]="down",e["TOP"]="top",e["BOTTOM"]="bottom"})(k||(k={})),function(e){e["TOP"]="top",e["BOTTOM"]="bottom",e["LEFT"]="left",e["RIGHT"]="right",e["VERTICAL"]="vertical",e["HORIZONTAL"]="horizontal",e["CENTER"]="center"}(C||(C={})),function(e){e["T"]="top",e["B"]="bottom",e["L"]="left",e["R"]="right"}(N||(N={})),function(e){e["LEFT_TOP"]="left-top",e["TOP"]="top",e["RIGHT_TOP"]="right-top",e["LEFT"]="left",e["RIGHT"]="right",e["LEFT_BOTTOM"]="left-bottom",e["BOTTOM"]="bottom",e["RIGHT_BOTTOM"]="right-bottom"}(E||(E={})),function(e){e["START"]="start",e["END"]="end",e["C"]="ctrl",e["C1"]="ctrl1",e["C2"]="ctrl2"}(w||(w={})),function(e){e["C"]="C",e["X"]="X",e["Z"]="Z",e["Y"]="Y",e["A"]="A",e["G"]="G",e["L"]="L",e["F"]="F",e["D"]="D",e["B"]="B",e["P"]="P",e["MINUS"]="-",e["EQUAL"]="=",e["DIGIT_0"]="0",e["DELETE"]="DELETE",e["UP"]="ARROWUP",e["DOWN"]="ARROWDOWN",e["LEFT"]="ARROWLEFT",e["RIGHT"]="ARROWRIGHT",e["ENTER"]="ENTER",e["SPACE"]=" ",e["TAB"]="TAB",e["BACKSPACE"]="BACKSPACE",e["ESC"]="ESCAPE",e["PAGEUP"]="PAGEUP",e["PAGEDOWN"]="PAGEDOWN",e["F5"]="F5"}(V||(V={}));var we,Ve,Ie,Be=[{type:"通用",children:[{label:"剪切",value:"Ctrl + X"},{label:"复制",value:"Ctrl + C"},{label:"粘贴",value:"Ctrl + V"},{label:"快速复制粘贴",value:"Ctrl + D"},{label:"全选",value:"Ctrl + A"},{label:"撤销",value:"Ctrl + Z"},{label:"恢复",value:"Ctrl + Y"},{label:"删除",value:"Delete / Backspace"},{label:"多选",value:"按住 Ctrl 或 Shift"},{label:"打印",value:"Ctrl + P"},{label:"关闭弹窗",value:"ESC"}]},{type:"幻灯片放映",children:[{label:"从头开始放映幻灯片",value:"F5"},{label:"从当前开始放映幻灯片",value:"Shift + F5"},{label:"切换上一页",value:"↑ / ← / PgUp"},{label:"切换下一页",value:"↓ / → / PgDown"},{label:"切换下一页",value:"Enter / Space"},{label:"退出放映",value:"ESC"},{label:"调整画笔笔触大小",value:"鼠标滚轮"}]},{type:"幻灯片编辑",children:[{label:"新建幻灯片",value:"Enter"},{label:"移动画布",value:"Space + 鼠标拖拽"},{label:"缩放画布",value:"Ctrl + 鼠标滚轮"},{label:"放大画布",value:"Ctrl + ="},{label:"缩小画布",value:"Ctrl + -"},{label:"使画布适应当前屏幕",value:"Ctrl + 0"},{label:"上一页(未选中元素)",value:"↑ / ←"},{label:"下一页(未选中元素)",value:"↓ / →"},{label:"上一页",value:"鼠标上滚 / PgUp"},{label:"下一页",value:"鼠标下滚 / PgDown"}]},{type:"元素操作",children:[{label:"移动",value:"↑ / ← / ↓ / →"},{label:"锁定",value:"Ctrl + L"},{label:"组合",value:"Ctrl + G"},{label:"取消组合",value:"Ctrl + Shift + G"},{label:"置顶层",value:"Alt + F"},{label:"置底层",value:"Alt + B"},{label:"锁定宽高比例",value:"按住 Ctrl 或 Shift"},{label:"创建水平 / 垂直线条",value:"按住 Ctrl 或 Shift"},{label:"切换焦点元素",value:"Tab"},{label:"确认图片裁剪",value:"Enter"}]},{type:"表格编辑",children:[{label:"聚焦到下一个单元格",value:"Tab"},{label:"在上方插入一行",value:"Ctrl + ↑"},{label:"在下方插入一行",value:"Ctrl + ↓"},{label:"在左侧插入一列",value:"Ctrl + ←"},{label:"在右侧插入一列",value:"Ctrl + →"}]},{type:"图表数据编辑",children:[{label:"聚焦到下一行",value:"Enter"}]},{type:"文本编辑",children:[{label:"加粗",value:"Ctrl + B"},{label:"斜体",value:"Ctrl + I"},{label:"下划线",value:"Ctrl + U"},{label:"删除线",value:"Ctrl + D"}]}],Se=(n("3b18"),n("f64c")),Le=(n("a630"),n("3ca3"),n("b311")),_e=n.n(Le),Te=(n("25f0"),n("3452")),Me=n.n(Te),De="pptist",ze=function(e){return Me.a.AES.encrypt(e,De).toString()},Fe=function(e){var t=Me.a.AES.decrypt(e,De);return t.toString(Me.a.enc.Utf8)},Ae=function(e){return new Promise((function(t,n){var c=document.createElement("button"),o=new _e.a(c,{text:function(){return e},action:function(){return"copy"},container:document.body});o.on("success",(function(e){o.destroy(),t(e)})),o.on("error",(function(e){o.destroy(),n(e)})),document.body.appendChild(c),c.click(),document.body.removeChild(c)}))},Re=function(){return new Promise((function(e,t){var n;null!==(n=navigator.clipboard)&&void 0!==n&&n.readText?navigator.clipboard.readText().then((function(n){return n||t("剪贴板为空或者不包含文本"),e(n)})):t("浏览器不支持或禁止访问剪贴板,请使用快捷键 Ctrl + V")}))},Pe=function(e){var t;try{t=JSON.parse(Fe(e))}catch(n){t=e}return t},He=function(e){var t=e.split("\r\n");""===t[t.length-1]&&t.pop();var n=-1,c=[];for(var o in t){if(c[o]=t[o].split("\t"),1===c[o].length)return null;if(-1===n)n=c[o].length;else if(n!==c[o].length)return null}return c},qe=(n("159b"),function(e){var t=e.left,n=e.top,c=e.width,o=e.height,a=e.rotate,l=void 0===a?0:a,r=Math.sqrt(Math.pow(c,2)+Math.pow(o,2))/2,i=180*Math.atan(o/c)/Math.PI,u=(180-l-i)*Math.PI/180,d=(i-l)*Math.PI/180,s=t+c/2,f=n+o/2,b=[s+r*Math.cos(u),s+r*Math.cos(d),s-r*Math.cos(u),s-r*Math.cos(d)],p=[f-r*Math.sin(u),f-r*Math.sin(d),f+r*Math.sin(u),f+r*Math.sin(d)];return{xRange:[Math.min.apply(Math,b),Math.max.apply(Math,b)],yRange:[Math.min.apply(Math,p),Math.max.apply(Math,p)]}}),Ue=function(e){var t=qe({left:e.left,top:e.top,width:e.width,height:e.height,rotate:0}),n=t.xRange,c=t.yRange,o=qe({left:e.left,top:e.top,width:e.width,height:e.height,rotate:e.rotate}),a=o.xRange,l=o.yRange;return{offsetX:a[0]-n[0],offsetY:l[0]-c[0]}},Ge=function(e){var t,n,c,o;if("line"===e.type)t=e.left,n=e.left+Math.max(e.start[0],e.end[0]),c=e.top,o=e.top+Math.max(e.start[1],e.end[1]);else if("rotate"in e&&e.rotate){var a=e.left,l=e.top,r=e.width,i=e.height,u=e.rotate,d=qe({left:a,top:l,width:r,height:i,rotate:u}),s=d.xRange,f=d.yRange;t=s[0],n=s[1],c=f[0],o=f[1]}else t=e.left,n=e.left+e.width,c=e.top,o=e.top+e.height;return{minX:t,maxX:n,minY:c,maxY:o}},Xe=function(e){var t=[],n=[],c=[],o=[];e.forEach((function(e){var a=Ge(e),l=a.minX,r=a.maxX,i=a.minY,u=a.maxY;t.push(l),n.push(i),c.push(r),o.push(u)}));var a=Math.min.apply(Math,t),l=Math.max.apply(Math,c),r=Math.min.apply(Math,n),i=Math.max.apply(Math,o);return{minX:a,maxX:l,minY:r,maxY:i}},Ye=function(e){var t=[];return e.forEach((function(e){var n=t.findIndex((function(t){return t.value===e.value}));if(-1===n)t.push(e);else{var c=t[n],o=Math.min(c.range[0],e.range[0]),a=Math.max(c.range[1],e.range[1]),l=[o,a],r={value:e.value,range:l};t[n]=r}})),t},Ze=function(e){var t,n={},c={},o=Object(L["a"])(e);try{for(o.s();!(t=o.n()).done;){var a=t.value,l=a.groupId;l&&!n[l]&&(n[l]=Object(x["b"])(10)),c[a.id]=Object(x["b"])(10)}}catch(r){o.e(r)}finally{o.f()}return{groupIdMap:n,elIdMap:c}},We=function(e){var t=ee()(e);return[t.setAlpha(.3).toRgbString(),t.setAlpha(.1).toRgbString()]},Je=function(e){var t=e.start.join(","),n=e.end.join(",");if(e.broken){var c=e.broken.join(",");return"M".concat(t," L").concat(c," L").concat(n)}if(e.curve){var o=e.curve.join(",");return"M".concat(t," Q").concat(o," ").concat(n)}if(e.cubic){var a=Object(me["a"])(e.cubic,2),l=a[0],r=a[1],i=l.join(","),u=r.join(",");return"M".concat(t," C").concat(i," ").concat(u," ").concat(n)}return"M".concat(t," L").concat(n)},Ke=n("53ca"),Qe=function(e){var t,n=e.replace(/[\n\r]+/g,"
"),c=n.split("
"),o="",a=Object(L["a"])(c);try{for(a.s();!(t=a.n()).done;){var l=t.value;l&&(o+="
".concat(l,"
"))}}catch(r){a.e(r)}finally{a.f()}return o},$e=(n("cb29"),function(e){return new Promise((function(t){var n=document.createElement("img");n.src=e,n.style.opacity="0",document.body.appendChild(n),n.onload=function(){var e=n.clientWidth,c=n.clientHeight;n.onload=null,n.onerror=null,document.body.removeChild(n),t({width:e,height:c})},n.onerror=function(){n.onload=null,n.onerror=null}}))}),et=function(e){return new Promise((function(t){var n=new FileReader;n.addEventListener("load",(function(){t(n.result)})),n.readAsDataURL(e)}))},tt=1e3;(function(e){e["ROUND_RECT"]="roundRect",e["ROUND_RECT_DIAGONAL"]="roundRectDiagonal",e["ROUND_RECT_SINGLE"]="roundRectSingle",e["ROUND_RECT_SAMESIDE"]="roundRectSameSide",e["CUT_RECT_DIAGONAL"]="cutRectDiagonal",e["CUT_RECT_SINGLE"]="cutRectSingle",e["CUT_RECT_SAMESIDE"]="cutRectSameSide",e["MESSAGE"]="message",e["ROUND_MESSAGE"]="roundMessage",e["L"]="L",e["RING_RECT"]="ringRect",e["PLUS"]="plus",e["TRIANGLE"]="triangle",e["PARALLELOGRAM_LEFT"]="parallelogramLeft",e["PARALLELOGRAM_RIGHT"]="parallelogramRight",e["TRAPEZOID"]="trapezoid",e["BULLET"]="bullet",e["INDICATOR"]="indicator"})(we||(we={})),function(e){e["TEXT"]="text",e["IMAGE"]="image",e["SHAPE"]="shape",e["LINE"]="line",e["CHART"]="chart",e["TABLE"]="table",e["LATEX"]="latex",e["VIDEO"]="video",e["AUDIO"]="audio"}(Ve||(Ve={}));var nt=(Ie={},Object(pe["a"])(Ie,we.ROUND_RECT,{editable:!0,defaultValue:.125,range:[0,.5],relative:"left",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M ".concat(c," 0 L ").concat(e-c," 0 Q ").concat(e," 0 ").concat(e," ").concat(c," L ").concat(e," ").concat(t-c," Q ").concat(e," ").concat(t," ").concat(e-c," ").concat(t," L ").concat(c," ").concat(t," Q 0 ").concat(t," 0 ").concat(t-c," L 0 ").concat(c," Q 0 0 ").concat(c," 0 Z")}}),Object(pe["a"])(Ie,we.CUT_RECT_DIAGONAL,{editable:!0,defaultValue:.2,range:[0,.9],relative:"right",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 ".concat(t-c," L 0 0 L ").concat(e-c," 0 L ").concat(e," ").concat(c," L ").concat(e," ").concat(t," L ").concat(c," ").concat(t," Z")}}),Object(pe["a"])(Ie,we.CUT_RECT_SINGLE,{editable:!0,defaultValue:.2,range:[0,.9],relative:"right",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 ".concat(t," L 0 0 L ").concat(e-c," 0 L ").concat(e," ").concat(c," L ").concat(e," ").concat(t," Z")}}),Object(pe["a"])(Ie,we.CUT_RECT_SAMESIDE,{editable:!0,defaultValue:.2,range:[0,.5],relative:"left",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 ".concat(c," L ").concat(c," 0 L ").concat(e-c," 0 L ").concat(e," ").concat(c," L ").concat(e," ").concat(t," L 0 ").concat(t," Z")}}),Object(pe["a"])(Ie,we.ROUND_RECT_DIAGONAL,{editable:!0,defaultValue:.125,range:[0,1],relative:"right",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 0 L ".concat(e-c," 0 Q ").concat(e," 0 ").concat(e," ").concat(c," L ").concat(e," ").concat(t," L ").concat(c," ").concat(t," Q 0 ").concat(t," 0 ").concat(t-c," L 0 0 Z")}}),Object(pe["a"])(Ie,we.ROUND_RECT_SINGLE,{editable:!0,defaultValue:.125,range:[0,1],relative:"right",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 0 L ".concat(e-c," 0 Q ").concat(e," 0 ").concat(e," ").concat(c," L ").concat(e," ").concat(t," L 0 ").concat(t," L 0 0 Z")}}),Object(pe["a"])(Ie,we.ROUND_RECT_SAMESIDE,{editable:!0,defaultValue:.125,range:[0,.5],relative:"left",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 ".concat(c," Q 0 0 ").concat(c," 0 L ").concat(e-c," 0 Q ").concat(e," 0 ").concat(e," ").concat(c," L ").concat(e," ").concat(t," L 0 ").concat(t," Z")}}),Object(pe["a"])(Ie,we.MESSAGE,{formula:function(e,t){var n=.2*e,c=.2*t;return"M 0 0 L ".concat(e," 0 L ").concat(e," ").concat(t-c," L ").concat(e/2," ").concat(t-c," L ").concat(e/2-n," ").concat(t," L ").concat(e/2-n," ").concat(t-c," L 0 ").concat(t-c," Z")}}),Object(pe["a"])(Ie,we.ROUND_MESSAGE,{formula:function(e,t){var n=.125*Math.min(e,t),c=.2*e,o=.2*t;return"M 0 ".concat(n," Q 0 0 ").concat(n," 0 L ").concat(e-n," 0 Q ").concat(e," 0 ").concat(e," ").concat(n," L ").concat(e," ").concat(t-n-o," Q ").concat(e," ").concat(t-o," ").concat(e-n," ").concat(t-o," L ").concat(e/2," ").concat(t-o," L ").concat(e/2-c," ").concat(t," L ").concat(e/2-c," ").concat(t-o," L ").concat(n," ").concat(t-o," Q 0 ").concat(t-o," 0 ").concat(t-n-o," L 0 ").concat(n," Z")}}),Object(pe["a"])(Ie,we.L,{editable:!0,defaultValue:.25,range:[.1,.9],relative:"left",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 0 L 0 ".concat(t," L ").concat(e," ").concat(t," L ").concat(e," ").concat(t-c," L ").concat(c," ").concat(t-c," L ").concat(c," 0 Z")}}),Object(pe["a"])(Ie,we.RING_RECT,{editable:!0,defaultValue:.25,range:[.1,.45],relative:"left",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M 0 0 ".concat(e," 0 ").concat(e," ").concat(t," L 0 ").concat(t," L 0 0 Z M ").concat(c," ").concat(c," L ").concat(c," ").concat(t-c," L ").concat(e-c," ").concat(t-c," L ").concat(e-c," ").concat(c," Z")}}),Object(pe["a"])(Ie,we.PLUS,{editable:!0,defaultValue:.25,range:[.1,.9],relative:"center",getBaseSize:function(e,t){return Math.min(e,t)},formula:function(e,t,n){var c=Math.min(e,t)*n;return"M ".concat(e/2-c/2," 0 L ").concat(e/2-c/2," ").concat(t/2-c/2," L 0 ").concat(t/2-c/2," L 0 ").concat(t/2+c/2," L ").concat(e/2-c/2," ").concat(t/2+c/2," L ").concat(e/2-c/2," ").concat(t," L ").concat(e/2+c/2," ").concat(t," L ").concat(e/2+c/2," ").concat(t/2+c/2," L ").concat(e," ").concat(t/2+c/2," L ").concat(e," ").concat(t/2-c/2," L ").concat(e/2+c/2," ").concat(t/2-c/2," L ").concat(e/2+c/2," 0 Z")}}),Object(pe["a"])(Ie,we.TRIANGLE,{editable:!0,defaultValue:.5,range:[0,1],relative:"left",getBaseSize:function(e,t){return e},formula:function(e,t,n){var c=e*n;return"M ".concat(c," 0 L 0 ").concat(t," L ").concat(e," ").concat(t," Z")}}),Object(pe["a"])(Ie,we.PARALLELOGRAM_LEFT,{editable:!0,defaultValue:.25,range:[0,.9],relative:"left",getBaseSize:function(e,t){return e},formula:function(e,t,n){var c=e*n;return"M ".concat(c," 0 L ").concat(e," 0 L ").concat(e-c," ").concat(t," L 0 ").concat(t," Z")}}),Object(pe["a"])(Ie,we.PARALLELOGRAM_RIGHT,{editable:!0,defaultValue:.25,range:[0,.9],relative:"right",getBaseSize:function(e,t){return e},formula:function(e,t,n){var c=e*n;return"M 0 0 L ".concat(e-c," 0 L ").concat(e," ").concat(t," L ").concat(c," ").concat(t," Z")}}),Object(pe["a"])(Ie,we.TRAPEZOID,{editable:!0,defaultValue:.25,range:[0,.5],relative:"left",getBaseSize:function(e,t){return e},formula:function(e,t,n){var c=e*n;return"M ".concat(c," 0 L ").concat(e-c," 0 L ").concat(e," ").concat(t," L 0 ").concat(t," Z")}}),Object(pe["a"])(Ie,we.BULLET,{editable:!0,defaultValue:.2,range:[0,1],relative:"top",getBaseSize:function(e,t){return t},formula:function(e,t,n){var c=t*n;return"M ".concat(e/2," 0 L 0 ").concat(c," L 0 ").concat(t," L ").concat(e," ").concat(t," L ").concat(e," ").concat(c," Z")}}),Object(pe["a"])(Ie,we.INDICATOR,{editable:!0,defaultValue:.2,range:[0,.9],relative:"right",getBaseSize:function(e,t){return e},formula:function(e,t,n){var c=e*n;return"M ".concat(e," ").concat(t/2," L ").concat(e-c," 0 L 0 0 L ").concat(c," ").concat(t/2," L 0 ").concat(t," L ").concat(e-c," ").concat(t," Z")}}),Ie),ct=[{type:"矩形",children:[{viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z"},{viewBox:[200,200],path:"M 50 0 L 150 0 Q 200 0 200 50 L 200 150 Q 200 200 150 200 L 50 200 Q 0 200 0 150 L 0 50 Q 0 0 50 0 Z",pathFormula:we.ROUND_RECT},{viewBox:[200,200],path:"M 0 150 L 0 0 L 150 0 L 200 50 L 200 200 L 50 200 Z",pathFormula:we.CUT_RECT_DIAGONAL},{viewBox:[200,200],path:"M 0 200 L 0 0 L 150 0 L 200 50 L 200 200 Z",pathFormula:we.CUT_RECT_SINGLE},{viewBox:[200,200],path:"M 0 50 L 50 0 L 150 0 L 200 50 L 200 200 L 0 200 Z",pathFormula:we.CUT_RECT_SAMESIDE},{viewBox:[200,200],path:"M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 50 200 Q 0 200 0 150 L 0 0 Z",pathFormula:we.ROUND_RECT_DIAGONAL},{viewBox:[200,200],path:"M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 L 0 0 Z",pathFormula:we.ROUND_RECT_SINGLE},{viewBox:[200,200],path:"M 0 50 Q 0 0 50 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 Z",pathFormula:we.ROUND_RECT_SAMESIDE}]},{type:"常用形状",children:[{viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 200 L 200 200 L 100 0 Z",pathFormula:we.TRIANGLE},{viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 Z"},{viewBox:[200,200],path:"M 50 0 L 200 0 L 150 200 L 0 200 L 50 0 Z",pathFormula:we.PARALLELOGRAM_LEFT},{viewBox:[200,200],path:"M 0 0 L 150 0 L 200 200 L 50 200 L 0 0 Z",pathFormula:we.PARALLELOGRAM_RIGHT},{viewBox:[200,200],path:"M 50 0 L 150 0 L 200 200 L 0 200 L 50 0 Z",pathFormula:we.TRAPEZOID},{viewBox:[200,200],path:"M 100 0 L 0 100 L 100 200 L 200 100 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 50 L 0 200 L 200 200 L 200 50 L 100 0 Z",pathFormula:we.BULLET},{viewBox:[200,200],path:"M 200 100 L 150 0 L 0 0 L 50 100 L 0 200 L 150 200 L 200 100 Z",pathFormula:we.INDICATOR},{viewBox:[200,200],path:"M 0 200 A 50 100 0 1 1 200 200 L 0 200 Z"},{viewBox:[200,200],path:"M 40 20 A 100 100 0 1 0 200 100 L 100 100 L 40 20 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 100 100 L 100 0 Z"},{viewBox:[200,200],path:"M 160 20 A 100 100 0 1 0 200 100 L 100 100 L 160 20 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 A 100 100 102 1 0 200 100 L 200 0 L 100 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 0 Q 200 200 0 200 L 0 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 90 L 50 200 L 150 200 L 200 90 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 0 60 L 0 140 L 100 200 L 200 140 L 200 60 L 100 0 Z"},{viewBox:[200,200],path:"M 60 0 L 140 0 L 200 60 L 200 140 L 140 200 L 60 200 L 0 140 L 0 60 L 60 0 Z"},{viewBox:[200,200],path:"M 75 0 L 125 0 L 175 25 L 200 75 L 200 125 L 175 175 L 125 200 L 75 200 L 25 175 L 0 125 L 0 75 L 25 25 L 75 0 Z"},{viewBox:[200,200],path:"M 150 0 A 50 100 0 1 1 150 200 L 0 200 L 0 0 L 150 0 Z"},{viewBox:[200,200],path:"M 50 0 A 25 50 0 1 0 50 200 L 150 200 A 25 50 0 1 0 150 0 L 50 0 Z"},{viewBox:[200,200],path:"M 150 0 A 50 100 0 1 1 150 200 L 0 200 A 50 100 0 0 0 0 0 L 150 0 Z"},{viewBox:[200,200],path:"M 200 0 L 200 200 L 0 200 L 0 100 L 200 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 100 L 200 200 L 0 200 L 0 0 Z"},{viewBox:[200,200],path:"M 200 0 L 100 0 L 0 100 L 0 200 L 200 0 Z"},{viewBox:[200,200],path:"M 50 0 L 150 0 L 150 50 L 200 50 L 200 150 L 150 150 L 150 200 L 50 200 L 50 150 L 0 150 L 0 50 L 50 50 L 50 0 Z"},{viewBox:[200,200],path:"M 0 0 L 0 200 L 200 200 L 200 140 L 60 140 L 60 0 L 0 0 Z",pathFormula:we.L},{viewBox:[200,200],path:"M0 0 L200 0 L200 200 L0 200 L0 0 Z M50 50 L50 150 L150 150 L150 50 Z",pathFormula:we.RING_RECT},{viewBox:[200,200],path:"M0 100 A100 100 0 1 1 0 101 Z M150 100 A50 50 0 1 0 150 101 Z"},{viewBox:[200,200],path:"M 70 0 L 70 70 L 0 70 L 0 130 L 70 130 L 70 200 L 130 200 L 130 130 L 200 130 L 200 70 L 130 70 L 130 0 L 70 0 Z",pathFormula:we.PLUS},{viewBox:[200,200],path:"M 40 0 L 0 40 L 60 100 L 0 160 L 40 200 L 100 140 L 160 200 L 200 160 L 140 100 L 200 40 L 160 0 L 100 60 L 40 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 0 L 200 160 L 100 160 L 60 200 L 60 160 L 0 160 Z",pathFormula:we.MESSAGE},{viewBox:[200,200],path:"M 0 40 Q 0 0 40 0 L 160 0 Q 200 0 200 40 L 200 120 Q 200 160 160 160 L 100 160 L 60 200 L 60 160 L 40 160 Q 0 160 0 120 L 0 40 Z",pathFormula:we.ROUND_MESSAGE},{viewBox:[200,200],path:"M 180 160 A 100 100 0 1 0 100 200 L 200 200 L 200 160 L 180 160 Z"},{viewBox:[200,200],path:"M 200 0 L 0 0 L 200 200 L 0 200 L 200 0 Z"},{viewBox:[200,200],path:"M 0 20 C 60 60 140 -40 200 20 L 200 180 C 140 140 60 240 0 180 L 0 20 Z"},{viewBox:[200,200],path:"M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z"},{viewBox:[200,200],path:"M 100 0 Q 0 50 0 175 Q 100 225 200 175 Q 200 50 100 0 Z"},{viewBox:[200,200],path:"M 0 100 A 50 50 0 1 1 200 100 L 100 200 L 0 100 Z"},{viewBox:[200,200],path:"M 100 0 L 60 60 L 0 100 L 60 140 L 100 200 L 140 140 L 200 100 L 140 60 L 100 0 Z"},{viewBox:[200,200],path:"M 100 0 L 80 40 L 20 20 L 40 80 L 0 100 L 40 120 L 20 180 L 80 160 L 100 200 L 120 160 L 180 180 L 160 120 L 200 100 L 160 80 L 180 20 L 120 40 L 100 0 Z"}]},{type:"箭头",children:[{viewBox:[200,200],path:"M 100 0 L 0 100 L 50 100 L 50 200 L 150 200 L 150 100 L 200 100 L 100 0 Z"},{viewBox:[200,200],path:"M 100 200 L 200 100 L 150 100 L 150 0 L 50 0 L 50 100 L 0 100 L 100 200 Z"},{viewBox:[200,200],path:"M 0 100 L 100 0 L 100 50 L 200 50 L 200 150 L 100 150 L 100 200 L 0 100 Z"},{viewBox:[200,200],path:"M 200 100 L 100 0 L 100 50 L 0 50 L 0 150 L 100 150 L 100 200 L 200 100 Z"},{viewBox:[200,200],path:"M 100 0 L 0 60 L 60 60 L 60 140 L 0 140 L 100 200 L 200 140 L 140 140 L 140 60 L 200 60 L 100 0 Z"},{viewBox:[200,200],path:"M 0 100 L 60 0 L 60 60 L 140 60 L 140 0 L 200 100 L 140 200 L 140 140 L 60 140 L 60 200 L 0 100 Z"},{viewBox:[200,200],path:"M 100 0 L 60 40 L 80 40 L 80 80 L 40 80 L 40 60 L 0 100 L 40 140 L 40 120 L 80 120 L 80 160 L 60 160 L 100 200 L 140 160 L 120 160 L 120 120 L 160 120 L 160 140 L 200 100 L 160 60 L 160 80 L 120 80 L 120 40 L 140 40 L 100 0 Z"},{viewBox:[200,200],path:"M 0 100 L 100 0 L 100 50 L 200 50 L 150 100 L 200 150 L 100 150 L 100 200 L 0 100 Z"},{viewBox:[200,200],path:"M 200 100 L 100 0 L 100 50 L 0 50 L 50 100 L 0 150 L 100 150 L 100 200 L 200 100 Z"},{viewBox:[200,200],path:"M 0 100 L 80 20 L 80 80 L 120 80 L 120 0 L 200 0 L 200 200 L 120 200 L 120 120 L 80 120 L 80 180 L 0 100 Z"},{viewBox:[200,200],path:"M 200 100 L 120 20 L 120 80 L 80 80 L 80 0 L 0 0 L 0 200 L 80 200 L 80 120 L 120 120 L 120 180 L 200 100 Z"},{viewBox:[200,200],path:"M 0 0 L 120 0 L 200 100 L 120 200 L 0 200 L 80 100 L 0 0 Z"},{viewBox:[200,200],path:"M 80 0 L 200 0 L 120 100 L 200 200 L 80 200 L 0 100 L 80 0 Z"},{viewBox:[200,200],path:"M 0 0 L 140 0 L 200 100 L 140 200 L 0 200 L 0 100 L 0 0 Z"},{viewBox:[200,200],path:"M 60 0 L 200 0 L 200 100 L 200 200 L 60 200 L 0 100 L 60 0 Z"},{viewBox:[200,200],path:"M 0 0 L 200 100 L 0 200 L 60 100 L 0 0 Z"},{viewBox:[200,200],path:"M 200 0 L 0 100 L 200 200 L 140 100 L 200 0 Z"},{viewBox:[200,200],path:"M 0 0 L 80 0 L 200 100 L 80 200 L 0 200 L 120 100 L 0 0 Z"},{viewBox:[200,200],path:"M 200 0 L 120 0 L 0 100 L 120 200 L 200 200 L 80 100 L 200 0 Z"},{viewBox:[200,200],path:"M 0 200 L 180 200 L 180 40 L 200 40 L 160 0 L 120 40 L 140 40 L 140 160 L 0 160 L 0 200 Z"},{viewBox:[200,200],path:"M 0 200 L 0 20 L 160 20 L 160 0 L 200 40 L 160 80 L 160 60 L 40 60 L 40 200 L 0 200 Z"},{viewBox:[200,200],path:"M 40 180 L 180 180 L 180 40 L 200 40 L 160 0 L 120 40 L 140 40 L 140 140 L 40 140 L 40 120 L 0 160 L 40 200 L 40 180 Z"},{viewBox:[1024,1024],path:"M398.208 302.912V64L0 482.112l398.208 418.176V655.36c284.48 0 483.584 95.552 625.792 304.64-56.896-298.688-227.584-597.312-625.792-657.088z",special:!0},{viewBox:[1024,1024],path:"M625.792 302.912V64L1024 482.112l-398.208 418.176V655.36C341.312 655.36 142.208 750.912 0 960c56.896-298.688 227.584-597.312 625.792-657.088z",special:!0}]},{type:"其他形状",children:[{viewBox:[1024,1024],path:"M995.336 243.4016c-15.7584-36.5736-38.3376-69.26639999-66.91440001-97.37280001-28.5768-27.98879999-61.73999999-49.8624-98.78399999-65.26799998-38.22-15.876-78.6744-23.8728-120.4224-23.87280001-57.97680001 0-114.5424 15.876-163.69919999 45.864-11.76 7.17360001-22.932 15.05279999-33.51600001 23.63760001-10.584-8.5848-21.75600001-16.46400001-33.51600001-23.63760001-49.1568-29.98799999-105.7224-45.86399999-163.69919999-45.864-41.74799999 0-82.2024 7.9968-120.4224 23.87280001-36.9264 15.28799999-70.2072 37.27919999-98.78399999 65.26799998-28.6944 28.10640001-51.156 60.79919999-66.91440001 97.37280001-16.34639999 37.9848-24.696 78.3216-24.696 119.83439999 0 39.1608 7.9968 79.96800001 23.8728 121.48080001 13.28880001 34.692 32.34000001 70.67760001 56.6832 107.016 38.57279999 57.5064 91.61040001 117.4824 157.4664 178.28160001 109.1328 100.78319999 217.2072 170.4024 221.79359999 173.22479998l27.87120001 17.8752c12.348 7.8792 28.224 7.8792 40.572 0l27.87119999-17.8752c4.58639999-2.94 112.54319999-72.44159999 221.79360001-173.22479998 65.85599999-60.79919999 118.89359999-120.7752 157.4664-178.28160001 24.3432-36.33839999 43.512-72.324 56.68319999-107.016 15.876-41.5128 23.8728-82.32 23.87280001-121.48080001 0.1176-41.5128-8.232-81.8496-24.5784-119.83439999z",special:!0},{viewBox:[1024,1024],path:"M985.20746667 343.50079998l-303.32586667-44.08319999L546.28693333 24.5248c-3.70346666-7.5264-9.79626667-13.6192-17.32266665-17.32266668-18.87573334-9.3184-41.81333333-1.55306667-51.25120001 17.32266668L342.1184 299.41759999l-303.32586667 44.08319999c-8.36266667 1.19466667-16.00853333 5.13706667-21.8624 11.11040001-14.69440001 15.17226667-14.45546667 39.30453334 0.71679999 54.1184l219.46026668 213.9648-51.84853333 302.1312c-1.43359999 8.24320001-0.11946667 16.8448 3.82293333 24.25173333 9.79626667 18.6368 32.9728 25.92426667 51.6096 16.00853334L512 822.44266665l271.3088 142.64320001c7.40693333 3.9424 16.00853333 5.25653333 24.25173333 3.82293333 20.78719999-3.584 34.7648-23.296 31.1808-44.0832l-51.84853333-302.1312 219.46026668-213.9648c5.97333334-5.85386666 9.91573333-13.49973334 11.11039999-21.8624 3.2256-20.90666667-11.34933333-40.26026667-32.256-43.36640001z",special:!0},{viewBox:[1024,1024],path:"M852.65066667 405.84533333C800.54044445 268.40177778 667.76177778 170.66666667 512.22755555 170.66666667S223.91466667 268.288 171.80444445 405.73155555C74.29688889 431.33155555 2.27555555 520.07822222 2.27555555 625.77777778c0 125.72444445 101.83111111 227.55555555 227.44177778 227.55555555h564.56533334C919.89333333 853.33333333 1021.72444445 751.50222222 1021.72444445 625.77777778c0-105.472-71.79377778-194.21866667-169.07377778-219.93244445z",special:!0},{viewBox:[1024,1024],path:"M926.25224691 323.7371485H654.6457886L898.88200917 15.14388241c5.05486373-6.53433603 0.49315743-16.02761669-7.76722963-16.02761668H418.30008701c-3.45210206 0-6.78091476 1.84934039-8.50696579 4.93157436L90.35039154 555.76772251c-3.82197013 6.53433603 0.86302552 14.7947231 8.50696578 14.79472311h215.01664245l-110.22068713 440.88274851c-2.34249783 9.61657002 9.24670194 16.39748478 16.39748477 9.49328065L933.03316167 340.62779071c6.41104668-6.0411786 2.09591911-16.8906422-6.78091476-16.89064221z",special:!0},{viewBox:[1024,1024],path:"M878.47822222 463.30311111c-22.18666667-49.83466667-53.93066667-93.98044445-94.32177777-131.072l-33.10933334-30.37866666c-4.89244445-4.32355555-12.62933333-2.38933333-14.79111111 3.75466666l-14.79111111 42.43911111c-9.216 26.624-26.16888889 53.81688889-50.176 80.55466667-1.59288889 1.70666667-3.41333333 2.16177778-4.66488889 2.27555556-1.25155555 0.11377778-3.18577778-0.11377778-4.89244445-1.70666667-1.59288889-1.36533333-2.38933333-3.41333333-2.27555555-5.46133333 4.20977778-68.49422222-16.27022222-145.74933333-61.09866667-229.83111112C561.26577778 124.01777778 509.72444445 69.51822222 445.32622222 31.51644445l-46.99022222-27.648c-6.144-3.64088889-13.99466667 1.13777778-13.65333333 8.30577777l2.50311111 54.61333333c1.70666667 37.31911111-2.61688889 70.31466667-12.85688889 97.73511112-12.51555555 33.56444445-30.49244445 64.73955555-53.47555556 92.72888888-16.15644445 19.56977778-34.24711111 37.20533333-54.04444444 52.45155556-47.90044445 36.75022222-87.38133333 84.65066667-114.11911111 138.24C125.72444445 502.10133333 111.50222222 562.74488889 111.50222222 623.50222222c0 53.70311111 10.58133333 105.69955555 31.51644445 154.73777778 20.25244445 47.21777778 49.152 89.77066667 85.90222222 126.17955555 36.864 36.40888889 79.64444445 65.08088889 127.31733333 84.992C405.61777778 1010.11911111 457.95555555 1020.58666667 512 1020.58666667s106.38222222-10.46755555 155.76177778-31.06133334c47.67288889-19.91111111 90.56711111-48.46933333 127.31733333-84.992 36.864-36.40888889 65.76355555-78.96177778 85.90222222-126.17955555 20.93511111-49.03822222 31.51644445-101.03466667 31.51644445-154.73777778 0-55.52355555-11.37777778-109.45422222-34.01955556-160.31288889z",special:!0},{viewBox:[1024,1024],path:"M968.20337778 20.11591112H705.44042667c-22.17301333 0-41.92483556 15.16430222-47.14951111 37.33731555C642.36202666 124.73685332 582.08711111 173.03324444 512 173.03324444s-130.36202666-48.29639112-146.29091556-115.58001777c-5.22467555-22.17301333-24.84906667-37.33731556-47.14951111-37.33731555H55.79662222c-30.96576 0-56.06968889 25.10392889-56.06968888 56.06968888v321.12639999c0 30.96576 25.10392889 56.06968889 56.06968888 56.06968889h95.57333334v494.43271112c0 30.96576 25.10392889 56.06968889 56.06968889 56.06968888h609.1207111c30.96576 0 56.06968889-25.10392889 56.06968889-56.06968888V453.38168888h95.57333334c30.96576 0 56.06968889-25.10392889 56.06968888-56.06968889V76.1856c0-30.96576-25.10392889-56.06968889-56.06968888-56.06968888z",special:!0},{viewBox:[1024,1024],path:"M980.94648889 239.80714666H523.46880001L373.99210666 96.82944c-1.91146667-1.78403556-4.46008889-2.80348444-7.00871111-2.80348445H43.05351111c-22.55530667 0-40.77795555 18.22264888-40.77795555 40.77795557v754.39217776c0 22.55530667 18.22264888 40.77795555 40.77795555 40.77795557h937.89297778c22.55530667 0 40.77795555-18.22264888 40.77795555-40.77795557V280.58510222c0-22.55530667-18.22264888-40.77795555-40.77795555-40.77795556z",special:!0},{viewBox:[1024,1024],path:"M972.60904597 164.57058577L841.30587843 33.39070759c-18.86327195-18.86327195-44.1375906-29.34286748-70.64480282-29.3428675-26.75379095 0-51.90482023 10.47959553-70.76809219 29.3428675L558.60337778 174.68031322c-18.86327195 18.86327195-29.34286748 44.1375906-29.34286749 70.64480283 0 26.75379095 10.47959553 51.90482023 29.34286749 70.76809218l103.31648301 103.31648302c-24.28800376 53.50758189-57.69942011 101.59043198-99.24793416 143.13894603-41.42522469 41.67180341-89.63136414 75.08321976-143.13894603 99.61780223L316.21649759 558.84995649c-18.86327195-18.86327195-44.1375906-29.34286748-70.64480283-29.34286747-26.75379095 0-51.90482023 10.47959553-70.76809217 29.34286747L33.39070759 700.01627278c-18.86327195 18.86327195-29.34286748 44.1375906-29.3428675 70.76809217 0 26.75379095 10.47959553 51.90482023 29.3428675 70.76809219l131.05658883 131.05658883c30.08260365 30.205893 71.63111769 47.34311394 114.28923598 47.34311394 9.00012323 0 17.63037836-0.73973616 26.13734414-2.21920846 166.19405621-27.37023774 331.03192945-115.76870829 464.06114804-248.67463751C901.84095379 636.27567408 990.11613498 471.56109018 1017.85624079 304.87387654c8.38367642-50.91850535-8.50696579-103.31648302-45.24719482-140.30329077z",special:!0},{viewBox:[1024,1024],path:"M910.60451556 640.96028445c-20.38897778-65.49959112-43.83630221-120.54983112-79.89930667-210.64362666C836.31217778 193.67708444 737.93535999 2.27555556 511.36284444 2.27555556 282.24170667 2.27555556 186.03121778 197.50001778 192.14791111 430.31665779c-36.19043555 90.22122667-59.51032888 144.88917333-79.89930667 210.64362666-43.32657778 139.53706668-29.30915556 197.26336001-18.60494222 198.53767111 22.9376 2.80348444 89.32920888-105.00323556 89.32920889-105.00323556 0 62.44124445 32.11264001 143.86972444 101.69002667 202.61546667-33.64181333 10.32192-109.20846222 38.10190221-91.24067556 68.55793777 14.52714667 24.59420444 250.01984 15.67402668 317.94062222 8.02816 67.92078222 7.64586667 303.41347556 16.56604444 317.94062223-8.02816 17.96778667-30.32860444-57.72629333-58.23601779-91.24067555-68.55793777 69.57738667-58.87317334 101.69002667-140.30165333 101.69002667-202.61546667 0 0 66.39160889 107.80672 89.32920888 105.00323556 10.83164445-1.40174222 24.84906667-59.12803556-18.47751111-198.53767111z",special:!0},{viewBox:[1024,1024],path:"M1016.86992592 199.24764445c-37.13706667 16.01991111-77.55093333 27.54939259-119.17842962 32.03982222 42.96248889-25.60758518 75.60912592-66.02145185 91.02222222-114.08118519-39.68568889 23.66577778-84.58998518 41.02068148-131.31472593 50.00154074C819.53374815 126.79395555 765.76995555 101.79318518 706.18074075 101.79318518c-114.688 0-206.92385185 92.96402963-206.92385186 207.04521482 0 16.01991111 1.94180741 32.03982222 5.09724444 47.45291852-171.72859259-8.98085925-324.88865185-91.02222222-426.71217778-216.63288889-17.96171852 30.82619259-28.15620741 66.02145185-28.1562074 104.49351112 0 71.84687408 36.53025185 135.19834075 92.23585185 172.45677036-33.98162963-1.33499259-66.02145185-10.92266667-93.57084445-26.33576296v2.54862222c0 100.6098963 71.1186963 183.98625185 165.90317037 203.1616-17.3549037 4.49042963-35.92343703 7.03905185-54.49197037 7.03905185-13.47128889 0-26.2144-1.33499259-39.07887407-3.15543704C146.69748148 681.90814815 223.03478518 741.49736297 313.93564445 743.43917037c-71.1186963 55.7056-160.19911111 88.4736-256.9253926 88.4736-17.3549037 0-33.37481482-0.60681482-50.00154074-2.54862222C98.75911111 888.22518518 207.62168889 922.20681482 324.85831111 922.20681482 705.45256297 922.20681482 913.71140741 606.90583703 913.71140741 333.23235555c0-8.98085925 0-17.96171852-0.60681482-26.94257777 40.2925037-29.4912 75.60912592-66.02145185 103.76533333-107.04213333z",special:!0},{viewBox:[1024,1024],path:"M917.96720197 1.08889505H106.03279803C53.56084718 1.08889505 9.37393998 45.27580225 9.37393998 97.74775309v5.52336372c0 19.33177108 8.28504494 41.42522469 22.0934536 55.23363205l331.40179753 392.15879462v325.87843379c0 16.57008987 8.28504494 30.37849854 22.09345359 35.90186098l209.88780469 104.94390299 2.76168121 2.76168121c27.61681602 11.04672615 55.23363335-8.28504494 55.23363335-38.66354218V550.66354348l331.40179753-392.15879462c35.90186097-41.42522469 30.37849854-102.18222047-11.04672616-135.32240022-11.04672615-13.80840865-33.14017975-22.0934536-55.23363335-22.09345359z",special:!0},{viewBox:[1024,1024],path:"M491.70164031 97.48884502a25.89076502 25.89076502 0 0 1 40.59671938 0L745.66415762 367.01171317a25.89076502 25.89076502 0 0 0 30.49932208 7.72839349l208.00640948-89.14190458a25.89076502 25.89076502 0 0 1 35.56096592 29.06238339l-115.18801541 554.96855704A103.56306132 103.56306132 0 0 1 803.14165689 952.14301275H220.85834311a103.56306132 103.56306132 0 0 1-101.4011828-82.51387024l-115.18801541-554.96855704a25.89076502 25.89076502 0 0 1 35.54802012-29.06238339l208.01935528 89.14190458a25.89076502 25.89076502 0 0 0 30.49932208-7.72839349l213.36579793-269.52286815z",special:!0},{viewBox:[1024,1024],path:"M643.02466884 387.7801525c19.85376751-88.69205333 33.718272-152.84087467 41.61900049-192.57389433C704.52292267 95.17283515 652.90057916 2.27555515 550.58614084 2.27555515c-92.26012484 0-138.59407685 45.84971417-165.91530666 137.49816969l-0.70087152 2.67605334c-16.40038399 74.13942085-41.47882668 131.61085116-74.6746315 172.73287031a189.06953915 189.06953915 0 0 1-143.04142182 70.44391902l-26.17434983 0.5606965C77.66380049 387.52529067 27.76177817 438.90551468 27.76177817 501.84374084V881.55022182c0 77.4144 62.25009818 140.17422182 139.05282766 140.17422303h492.82707951c101.23127467 0 191.59267516-63.995904 225.93535999-159.98976l102.37815468-286.22301868c26.04691951-72.82688-11.39234134-153.15945284-83.63303784-179.42300483a138.04612267 138.04612267 0 0 0-47.17499733-8.30850884H643.02466884z",special:!0},{viewBox:[1024,1024],path:"M512 512c140.82958222 0 254.86222222-114.03264 254.86222222-254.86222222S652.82958222 2.27555555 512 2.27555555a254.78940445 254.78940445 0 0 0-254.86222222 254.86222223C257.13777778 397.96736 371.17041778 512 512 512z m0 72.81777778c-170.10232889 0-509.72444445 97.57582222-509.72444445 291.27111111v145.63555556h1019.4488889v-145.63555556c0-193.69528889-339.62211555-291.27111111-509.72444445-291.27111111z",special:!0},{viewBox:[1024,1024],path:"M1019.81297778 564.50161779l-138.89991111-472.51456c-8.66531556-25.99594668-29.43658667-43.45400889-57.21656889-43.45400891s-50.33528889 15.67402668-59.00060446 41.66997334l-92.00526221 274.48661334H351.69166222L259.6864 90.33045333c-8.66531556-25.99594668-31.22062222-41.66997333-59.00060444-41.66997332s-50.33528889 17.33063112-57.2165689 43.45400887L4.69674667 564.50161779c-5.22467555 17.33063112 1.78403556 36.44529778 15.67402667 46.89464887l491.11950221 368.27591113 492.77610666-368.27591113c13.76256-10.32192 20.77127111-29.43658667 15.54659557-46.89464887z",special:!0},{viewBox:[1024,1024],path:"M927.78951111 340.39277037c-12.01493333-47.81700741 12.01493333-124.03294815 89.08041481-150.97552592l-82.40545184-4.36906667s-31.19028148-109.22666667-174.27721483-118.9357037c-143.08693333-9.8304-236.65777778-3.64088889-236.65777777-3.6408889s106.07122963 67.47780741 63.5941926 187.74850371c-31.06891852 63.71555555-79.85682963 116.02299259-132.04290371 175.61220741-1.57771852 1.57771852-3.03407408 3.15543703-4.2477037 4.49042962C278.25493333 624.86755555 7.13007408 934.34311111 7.13007408 934.34311111c298.43152592 78.15774815 498.43768889-7.64586667 616.76657777-110.56165926 24.87940741-0.24272592 43.5693037-0.36408889 56.19105185-0.36408888 164.8109037 0 304.13558518-142.72284445 298.43152593-301.4656-3.88361482-109.1053037-38.71478518-133.74198518-50.72971852-181.5589926z",special:!0},{viewBox:[1024,1024],path:"M997.8886764 504.17210418L537.2729208 43.89182982c-13.97838539-13.97838539-36.56745619-13.97838539-50.5458416 0L26.1113236 504.17210418c-13.41924998 13.41924998-21.02349164 31.64706454-21.02349163 50.65766867 0 39.47496036 32.09437288 71.56933323 71.56933324 71.56933323h48.53295408V954.83524937c0 19.79339373 15.99127289 35.78466661 35.78466663 35.78466662H440.43066677V740.12724968h125.24633315v250.49266631h297.34821416c19.79339373 0 35.78466661-15.99127289 35.78466663-35.78466662V626.39910608h48.53295408c19.01060414 0 37.23841869-7.49241457 50.65766869-21.02349163 27.84494371-27.95677079 27.84494371-73.24673948-0.11182708-101.20351027z",special:!0},{viewBox:[1024,1024],path:"M1009.13013121 349.27572283L674.72427717 14.86986879c-8.82158299-8.82158299-20.35749924-13.16451618-31.89341544-13.16451618s-23.07183245 4.34293316-31.89341547 13.16451618L392.29790453 233.6451272c-16.5574327-1.90003326-33.25058207-2.71433322-49.94373146-2.71433324-99.34459624 0-198.68919249 32.70771543-280.25490606 98.12314628-20.90036589 16.69314938-22.52896582 48.04369819-3.66434987 67.04403081l246.59717401 246.59717401-292.33368895 292.06225564c-3.52863319 3.52863319-5.83581644 8.27871636-6.24296642 13.30023282l-4.61436649 50.48659809c-1.22144996 12.75736619 8.95729967 23.6146991 21.57894918 23.6146991 0.6785833 0 1.35716662 0 2.03574992-0.13571666l50.48659809-4.61436649c5.02151649-0.40714999 9.77159962-2.71433322 13.30023282-6.24296643l292.33368896-292.33368896 246.59717402 246.59717401c8.82158299 8.82158299 20.35749924 13.16451618 31.89341544 13.16451618 13.16451618 0 26.19331567-5.70009979 35.15061536-16.82886604 76.40848044-95.40881307 108.16617924-214.83947521 95.27309638-330.33435417l218.63954175-218.63954173c17.50744934-17.37173267 17.50744934-45.8722316 0-63.51539759z",special:!0},{viewBox:[1024,1024],path:"M976.62005979 160.47737905c-0.39452595-0.39452595-80.35178503 78.64217259-239.47725131 237.50462156l-111.6508437-111.65084369 237.89914752-237.89914752c-125.19623464-75.35445635-286.03131335-56.02268482-390.31767264 48.26367449-81.92988882 81.92988882-112.57140424 200.15616502-83.37648398 310.09739626l2.36715569 8.81107954-372.82702222 372.69551356c-8.15353628 8.15353628-8.15353628 21.56741857 0 29.72095487l185.95323084 185.95323084c8.15353628 8.15353628 21.56741857 8.15353628 29.72095485 0l372.56400493-372.56400493 8.81107953 2.3671557c110.07273989 29.32642892 228.29901608-1.18357785 310.36041356-83.24497533 104.41786795-104.2863593 123.74963948-265.12143802 49.97328693-390.05465535z",special:!0}]},{type:"线性",children:[{viewBox:[1024,1024],path:"M953.5488 832.61667556c-24.08448-57.08913778-58.74574221-108.31644445-102.70947556-152.28017777-43.96373333-43.96373333-95.19104-78.49756444-152.28017777-102.70947558-0.50972445-0.25486222-1.01944888-0.38229333-1.52917334-0.63715555C776.41955556 519.64586667 828.02915556 426.23886221 828.02915556 320.85333332c0-174.58062221-141.44853334-316.02915556-316.02915556-316.02915554S195.97084444 146.27271111 195.97084444 320.85333332c0 105.38552889 51.6096 198.79253333 130.99918223 256.26396447-0.50972445 0.25486222-1.01944888 0.38229333-1.52917334 0.63715555-57.08913778 24.08448-108.31644445 58.61831112-152.28017777 102.70947554-43.96373333 43.96373333-78.49756444 95.19104-102.70947556 152.28017779C46.74901333 888.55893332 34.13333334 947.8144 32.85902222 1008.72647111c-0.12743111 5.7344 4.46008889 10.44935111 10.19448889 10.44935111h76.45866667c5.60696888 0 10.06705778-4.46008889 10.19448889-9.93962666 2.54862221-98.37681778 42.05226667-190.50951112 111.88451555-260.34176001 72.25344-72.25344 168.20906666-112.01194667 270.40881778-112.01194667s198.15537778 39.75850667 270.40881778 112.01194667C852.24106667 818.72668444 891.74471111 910.85937779 894.29333333 1009.23619556c0.12743111 5.60696888 4.58752 9.93962667 10.19448889 9.93962666h76.45866667c5.7344 0 10.32192-4.71495112 10.19448889-10.44935111-1.27431111-60.91207112-13.88999112-120.16753779-37.59217778-176.10979555zM512 540.03484444c-58.49088 0-113.54112-22.81016889-154.95623111-64.22527999S292.81848888 379.34421333 292.81848888 320.85333332c0-58.49088 22.81016889-113.54112 64.22528001-154.9562311S453.50912 101.67182221 512 101.67182221s113.54112 22.81016889 154.95623111 64.22528001S731.18151112 262.36245333 731.18151112 320.85333332c0 58.49088-22.81016889 113.54112-64.22528001 154.95623113S570.49088 540.03484444 512 540.03484444z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M985.31555555 111.50222222H38.68444445c-20.13866667 0-36.40888889 16.27022222-36.4088889 36.40888889v728.17777778c0 20.13866667 16.27022222 36.40888889 36.4088889 36.40888889h946.6311111c20.13866667 0 36.40888889-16.27022222 36.4088889-36.40888889V147.91111111c0-20.13866667-16.27022222-36.40888889-36.4088889-36.40888889z m-45.5111111 126.06577778V830.57777778H84.19555555V237.568l-31.40266666-24.46222222 44.71466666-57.45777778 48.6968889 37.888h731.70488888l48.69688889-37.888 44.71466667 57.45777778-31.51644444 24.46222222z M877.90933333 193.42222222L512 477.86666667 146.09066667 193.42222222l-48.69688889-37.888-44.71466667 57.45777778 31.40266667 24.46222222 388.66488889 302.19377778c22.98311111 17.86311111 55.18222222 17.86311111 78.16533333 0L939.80444445 237.568l31.40266666-24.46222222-44.71466666-57.45777778-48.58311112 37.77422222z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M985.31555555 88.74666667H38.68444445c-20.13866667 0-36.40888889 16.27022222-36.4088889 36.40888888v564.33777778c0 20.13866667 16.27022222 36.40888889 36.4088889 36.40888889h432.35555555v127.43111111H275.34222222c-10.01244445 0-18.20444445 8.192-18.20444444 18.20444445v54.61333333c0 5.00622222 4.096 9.10222222 9.10222222 9.10222222h491.52c5.00622222 0 9.10222222-4.096 9.10222222-9.10222222v-54.61333333c0-10.01244445-8.192-18.20444445-18.20444444-18.20444445H552.96V725.90222222h432.35555555c20.13866667 0 36.40888889-16.27022222 36.4088889-36.40888889V125.15555555c0-20.13866667-16.27022222-36.40888889-36.4088889-36.40888888z m-45.5111111 555.23555555H84.19555555V170.66666667h855.6088889v473.31555555z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M512 2.27555555C230.51377778 2.27555555 2.27555555 230.51377778 2.27555555 512s228.23822222 509.72444445 509.72444445 509.72444445 509.72444445-228.23822222 509.72444445-509.72444445S793.48622222 2.27555555 512 2.27555555z m0 932.97777778c-233.69955555 0-423.25333333-189.55377778-423.25333333-423.25333333 0-101.26222222 35.61244445-194.33244445 95.00444444-267.15022222l595.39911111 595.39911111C706.33244445 899.64088889 613.26222222 935.25333333 512 935.25333333z m328.24888889-156.10311111L244.84977778 183.75111111C317.66755555 124.35911111 410.73777778 88.74666667 512 88.74666667c233.69955555 0 423.25333333 189.55377778 423.25333333 423.25333333 0 101.26222222-35.61244445 194.33244445-95.00444444 267.15022222z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M901.80266667 257.82044445L656.95288889 12.97066667c-6.82666667-6.82666667-16.04266667-10.69511111-25.71377778-10.69511112H147.91111111c-20.13866667 0-36.40888889 16.27022222-36.40888889 36.4088889v946.6311111c0 20.13866667 16.27022222 36.40888889 36.40888889 36.4088889h728.17777778c20.13866667 0 36.40888889-16.27022222 36.40888889-36.4088889V283.648c0-9.67111111-3.86844445-19.00088889-10.69511111-25.82755555zM828.52977778 300.37333333H614.4V86.24355555L828.52977778 300.37333333z m2.048 639.43111112H193.42222222V84.19555555h343.60888889v245.76c0 26.39644445 21.39022222 47.78666667 47.78666667 47.78666667h245.76v562.06222223z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M981.07392 55.79662222H42.92608c-31.22062222 0-50.71758221 34.02410666-35.04355556 61.16693334L304.28728889 620.82616888V927.42542221c0 22.55530667 18.09521779 40.77795555 40.52309333 40.77795557h334.37923556c22.42787556 0 40.52309333-18.22264888 40.52309333-40.77795557V620.82616888L1016.24490667 116.96355556c15.54659555-27.14282666-3.95036444-61.16693333-35.17098667-61.16693334zM628.47203556 876.45297779H395.52796444V677.66044445h233.07150222v198.79253334z m12.23338666-301.50200891l-12.10595556 21.15356445h-233.19893332l-12.10595556-21.15356445L130.59868445 147.54702221h762.8026311L640.70542222 574.95096888z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M980.62285431 4.54099753H654.39920987c-4.2719763 0-7.76722963 3.49525333-7.76722962 7.76722964v72.4941432c0 4.2719763 3.49525333 7.76722963 7.76722962 7.76722963h207.64393877L604.04167111 350.57107753c-64.72691358-49.83972347-143.69374815-76.7661195-226.67365136-76.7661195-99.54999309 0-193.27456395 38.83614815-263.5679921 109.25903012S4.54099753 547.08198717 4.54099753 646.63198025s38.83614815 193.27456395 109.25903012 263.5679921C184.09345581 980.62285431 277.81802667 1019.45900247 377.36801975 1019.45900247s193.27456395-38.83614815 263.5679921-109.25903012C711.35889383 839.90654419 750.19504197 746.18197333 750.19504197 646.63198025c0-82.9799032-26.92639605-161.68783013-76.63666567-226.41474372L931.4304 162.34521283V369.60079013c0 4.2719763 3.49525333 7.76722963 7.76722963 7.76722962h72.4941432c4.2719763 0 7.76722963-3.49525333 7.76722964-7.76722962V43.37714569c0-21.35988148-17.47626667-38.83614815-38.83614816-38.83614816zM377.36801975 921.07409383c-151.33152395 0-274.44211358-123.11058963-274.44211358-274.44211358s123.11058963-274.44211358 274.44211358-274.44211358 274.44211358 123.11058963 274.44211358 274.44211358-123.11058963 274.44211358-274.44211358 274.44211358z",special:!0,outlined:!0},{viewBox:[1024,1024],path:"M591.98717801 512l405.34042913-483.16579151c6.79427767-8.02960089 1.08090782-20.22841761-9.41933951-20.2284176h-123.22349044c-7.25752386 0-14.20621693 3.24272343-18.99309439 8.80167789L511.38233839 415.95362022 177.07299399 17.40746878c-4.63246205-5.55895447-11.58115512-8.80167789-18.99309439-8.80167789H34.85640916c-10.50024731 0-16.21361717 12.19881672-9.41933952 20.2284176L430.77749876 512 25.43706964 995.16579151c-6.79427767 8.02960089-1.08090782 20.22841761 9.41933952 20.2284176h123.22349044c7.25752386 0 14.20621693-3.24272343 18.99309439-8.80167789l334.3093444-398.54615144 334.30934441 398.54615144c4.63246205 5.55895447 11.58115512 8.80167789 18.99309439 8.80167789h123.22349044c10.50024731 0 16.21361717-12.19881672 9.41933951-20.2284176L591.98717801 512z",special:!0,outlined:!0}]}],ot={bar:"bar",horizontalBar:"bar",line:"line",area:"line",scatter:"line",pie:"pie",ring:"pie"},at=function(){var e=xe(),t=Object(te["debounce"])((function(){e.addSnapshot()}),300,{trailing:!0}),n=Object(te["throttle"])((function(){e.reDo()}),100,{leading:!0,trailing:!1}),c=Object(te["throttle"])((function(){e.unDo()}),100,{leading:!0,trailing:!1});return{addHistorySnapshot:t,redo:n,undo:c}},lt=function(){var e=ie(),t=ae(),n=Object(g["c"])(e),c=n.creatingElement,o=Object(g["c"])(t),a=o.theme,l=o.viewportRatio,r=at(),i=r.addHistorySnapshot,u=function(n,o){t.addElement(n),e.setActiveElementIdList([n.id]),c.value&&e.setCreatingElement(null),setTimeout((function(){e.setEditorareaFocus(!0)}),0),o&&o(),i()},d=function(e){$e(e).then((function(t){var n=t.width,c=t.height,o=c/n;ott?(n=tt,c=n*o):c>tt*l.value&&(c=tt*l.value,n=c/o),u({type:"image",id:Object(x["b"])(10),src:e,width:n,height:c,left:(tt-n)/2,top:(tt*l.value-c)/2,fixedRatio:!0,rotate:0})}))},s=function(e){var t={type:"chart",id:Object(x["b"])(10),chartType:ot[e],left:300,top:81.25,width:400,height:400,rotate:0,themeColor:[a.value.themeColor],gridColor:a.value.fontColor,data:{labels:["类别1","类别2","类别3","类别4","类别5"],legends:["系列1"],series:[[12,19,5,2,18]]}},n={};"horizontalBar"===e?n={horizontalBars:!0}:"area"===e?n={showArea:!0}:"scatter"===e?n={showLine:!1}:"ring"===e&&(n={donut:!0}),u(Object(S["a"])(Object(S["a"])({},t),{},{options:n}))},f=function(e,t){for(var n={fontname:a.value.fontName,color:a.value.fontColor},c=[],o=0;o1&&void 0!==arguments[1]?arguments[1]:"",n=e.left,c=e.top,o=e.width,l=e.height,r=Object(x["b"])(10);u({type:"text",id:r,left:n,top:c,width:o,height:l,content:t,rotate:0,defaultFontName:a.value.fontName,defaultColor:a.value.fontColor},(function(){setTimeout((function(){var e=document.querySelector("#editable-element-".concat(r," .ProseMirror"));e&&e.focus()}),0)}))},p=function(e,t){var n=e.left,c=e.top,o=e.width,l=e.height,r={type:"shape",id:Object(x["b"])(10),left:n,top:c,width:o,height:l,viewBox:t.viewBox,path:t.path,fill:a.value.themeColor,fixedRatio:!1,rotate:0};if(t.special&&(r.special=!0),t.pathFormula){r.pathFormula=t.pathFormula,r.viewBox=[o,l];var i=nt[t.pathFormula];"editable"in i?(r.path=i.formula(o,l,i.defaultValue),r.keypoint=i.defaultValue):r.path=i.formula(o,l)}u(r)},m=function(e,t){var n=e.left,c=e.top,o=e.start,l=e.end,r={type:"line",id:Object(x["b"])(10),left:n,top:c,start:o,end:l,points:t.points,color:a.value.themeColor,style:t.style,width:2};t.isBroken&&(r.broken=[(o[0]+l[0])/2,(o[1]+l[1])/2]),t.isCurve&&(r.curve=[(o[0]+l[0])/2,(o[1]+l[1])/2]),t.isCubic&&(r.cubic=[[(o[0]+l[0])/2,(o[1]+l[1])/2],[(o[0]+l[0])/2,(o[1]+l[1])/2]]),u(r)},O=function(e){u({type:"latex",id:Object(x["b"])(10),width:e.w,height:e.h,rotate:0,left:(tt-e.w)/2,top:(tt*l.value-e.h)/2,path:e.path,latex:e.latex,color:a.value.fontColor,strokeWidth:2,viewBox:[e.w,e.h],fixedRatio:!0})},v=function(e){u({type:"video",id:Object(x["b"])(10),width:500,height:300,rotate:0,left:(tt-500)/2,top:(tt*l.value-300)/2,src:e})},j=function(e){u({type:"audio",id:Object(x["b"])(10),width:50,height:50,rotate:0,left:(tt-50)/2,top:(tt*l.value-50)/2,loop:!1,autoplay:!1,fixedRatio:!0,color:a.value.themeColor,src:e})};return{createImageElement:d,createChartElement:s,createTableElement:f,createTextElement:b,createShapeElement:p,createLineElement:m,createLatexElement:O,createVideoElement:v,createAudioElement:j}},rt=(n("07ac"),function(){var e=ie(),t=ae(),n=Object(g["c"])(t),c=n.currentSlide,o=at(),a=o.addHistorySnapshot,l=function(n){var o,l=Ze(n),r=l.groupIdMap,i=l.elIdMap,u=c.value.elements.map((function(e){return e.id})),d=Object(L["a"])(n);try{for(d.s();!(o=d.n()).done;){var s=o.value,f=u.includes(s.id);s.id=i[s.id],f&&(s.left=s.left+10,s.top=s.top+10),s.groupId&&(s.groupId=r[s.groupId])}}catch(b){d.e(b)}finally{d.f()}t.addElement(n),e.setActiveElementIdList(Object.values(i)),a()},r=function(e){var n=e.map((function(e){var t,n=Ze(e.elements),c=n.groupIdMap,o=n.elIdMap,a=Object(L["a"])(e.elements);try{for(a.s();!(t=a.n()).done;){var l=t.value;l.id=o[l.id],l.groupId&&(l.groupId=c[l.groupId])}}catch(d){a.e(d)}finally{a.f()}if(e.animations){var r,i=Object(L["a"])(e.animations);try{for(i.s();!(r=i.n()).done;){var u=r.value;u.id=Object(x["b"])(10),u.elId=o[u.elId]}}catch(d){i.e(d)}finally{i.f()}}return Object(S["a"])(Object(S["a"])({},e),{},{id:Object(x["b"])(10)})}));t.addSlide(n),a()};return{addElementsFromData:l,addSlidesFromData:r}}),it=function(){var e=lt(),t=e.createTextElement,n=rt(),c=n.addElementsFromData,o=n.addSlidesFromData,a=function(e){t({left:0,top:0,width:600,height:50},e)},l=function(e,t){var n=(null===t||void 0===t?void 0:t.onlySlide)||!1,l=(null===t||void 0===t?void 0:t.onlyElements)||!1,r=Pe(e);if("object"===Object(Ke["a"])(r)){var i=r.type,u=r.data;"elements"!==i||n?"slides"!==i||l||o(u):c(u)}else if(!l&&!n){var d=Qe(r);a(d)}};return{pasteTextClipboardData:l}},ut=function(){var e=ie(),t=ae(),n=Object(g["c"])(e),c=n.selectedSlidesIndex,o=n.activeElementIdList,a=Object(g["c"])(t),l=a.currentSlide,r=a.slides,i=a.theme,u=a.slideIndex,d=Object(y["computed"])((function(){return[].concat(Object(Q["a"])(c.value),[u.value])})),s=Object(y["computed"])((function(){return r.value.filter((function(e,t){return d.value.includes(t)}))})),f=Object(y["computed"])((function(){return s.value.map((function(e){return e.id}))})),b=it(),p=b.pasteTextClipboardData,m=rt(),O=m.addSlidesFromData,v=at(),j=v.addHistorySnapshot,h=function(){var n={id:Object(x["b"])(10),elements:[],background:{type:"solid",color:i.value.backgroundColor}};t.updateSlideIndex(0),e.setActiveElementIdList([]),t.setSlides([n])},k=function(n){n===V.UP&&u.value>0?(o.value.length&&e.setActiveElementIdList([]),t.updateSlideIndex(u.value-1)):n===V.DOWN&&u.value0&&void 0!==arguments[0]?arguments[0]:f.value;r.value.length===n.length?h():t.deleteSlide(n),e.updateSelectedSlidesIndex([]),j()},_=function(){var e=Object(Q["a"])(f.value);C(),B(e)},T=function(){var t=Array.from(Array(r.value.length),(function(e,t){return t}));e.setActiveElementIdList([]),e.updateSelectedSlidesIndex(t)};return{resetSlides:h,updateSlideIndex:k,copySlide:C,pasteSlide:N,createSlide:E,createSlideByTemplate:w,copyAndPasteSlide:I,deleteSlide:B,cutSlide:_,selectAllSlide:T}},dt=function(){var e=ie(),t=ae(),n=Object(g["c"])(e),c=n.activeElementIdList,o=Object(g["c"])(t),a=o.currentSlide,l=at(),r=l.addHistorySnapshot,i=function(){var n,o=JSON.parse(JSON.stringify(a.value.elements)),l=Object(L["a"])(o);try{for(l.s();!(n=l.n()).done;){var i=n.value;c.value.includes(i.id)&&(i.lock=!0)}}catch(u){l.e(u)}finally{l.f()}t.updateSlide({elements:o}),e.setActiveElementIdList([]),r()},u=function(n){var c=JSON.parse(JSON.stringify(a.value.elements));if(n.groupId){var o,l=[],i=Object(L["a"])(c);try{for(i.s();!(o=i.n()).done;){var u=o.value;u.groupId===n.groupId&&(u.lock=!1,l.push(u.id))}}catch(b){i.e(b)}finally{i.f()}t.updateSlide({elements:c}),e.setActiveElementIdList(l)}else{var d,s=Object(L["a"])(c);try{for(s.s();!(d=s.n()).done;){var f=d.value;if(f.id===n.id){f.lock=!1;break}}}catch(b){s.e(b)}finally{s.f()}t.updateSlide({elements:c}),e.setActiveElementIdList([n.id])}r()};return{lockElement:i,unlockElement:u}},st=function(){var e=ie(),t=ae(),n=Object(g["c"])(e),c=n.activeElementIdList,o=n.activeGroupElementId,a=Object(g["c"])(t),l=a.currentSlide,r=at(),i=r.addHistorySnapshot,u=function(){if(c.value.length){var n=[];n=o.value?l.value.elements.filter((function(e){return e.id!==o.value})):l.value.elements.filter((function(e){return!c.value.includes(e.id)})),e.setActiveElementIdList([]),t.updateSlide({elements:n}),i()}},d=function(){l.value.elements.length&&(e.setActiveElementIdList([]),t.updateSlide({elements:[]}),i())};return{deleteElement:u,deleteAllElements:d}},ft=function(){var e=ie(),t=ae(),n=Object(g["c"])(e),c=n.activeElementIdList,o=n.activeElementList,a=n.handleElementId,l=Object(g["c"])(t),r=l.currentSlide,i=at(),u=i.addHistorySnapshot,d=Object(y["computed"])((function(){if(o.value.length<2)return!1;var e=o.value[0].groupId;if(!e)return!0;var t=o.value.every((function(t){return(t.groupId&&t.groupId)===e}));return!t})),s=function(){var e;if(o.value.length){var n,a=JSON.parse(JSON.stringify(r.value.elements)),l=Object(x["b"])(10),i=[],d=Object(L["a"])(a);try{for(d.s();!(n=d.n()).done;){var s=n.value;c.value.includes(s.id)&&(s.groupId=l,i.push(s))}}catch(m){d.e(m)}finally{d.f()}var f=a.findIndex((function(e){return e.id===i[i.length-1].id})),b=i.map((function(e){return e.id}));a=a.filter((function(e){return!b.includes(e.id)}));var p=f-i.length+1;(e=a).splice.apply(e,[p,0].concat(i)),t.updateSlide({elements:a}),u()}},f=function(){if(o.value.length){var n=o.value.some((function(e){return e.groupId}));if(n){var l,i=JSON.parse(JSON.stringify(r.value.elements)),d=Object(L["a"])(i);try{for(d.s();!(l=d.n()).done;){var s=l.value;c.value.includes(s.id)&&s.groupId&&delete s.groupId}}catch(b){d.e(b)}finally{d.f()}t.updateSlide({elements:i});var f=a.value?[a.value]:[];e.setActiveElementIdList(f),u()}}};return{canCombine:d,combineElements:s,uncombineElements:f}},bt=function(){var e=ie(),t=Object(g["c"])(e),n=t.activeElementIdList,c=t.activeElementList,o=it(),a=o.pasteTextClipboardData,l=st(),r=l.deleteElement,i=function(){if(n.value.length){var t=ze(JSON.stringify({type:"elements",data:c.value}));Ae(t).then((function(){e.setEditorareaFocus(!0)}))}},u=function(){i(),r()},d=function(){Re().then((function(e){a(e)})).catch((function(e){return Se["a"].warning(e)}))},s=function(){i(),d()};return{copyElement:i,cutElement:u,pasteElement:d,quickCopyElement:s}},pt=function(){var e=ie(),t=Object(g["c"])(ae()),n=t.currentSlide,c=function(){var t=n.value.elements.filter((function(e){return!e.lock})),c=t.map((function(e){return e.id}));e.setActiveElementIdList(c)};return{selectAllElement:c}},mt=function(){var e=ae(),t=Object(g["c"])(ie()),n=t.activeElementIdList,c=t.activeGroupElementId,o=Object(g["c"])(e),a=o.currentSlide,l=at(),r=l.addHistorySnapshot,i=function(t){var o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1,l=[],i=function(e){var n=e.left,c=e.top;switch(t){case V.LEFT:n-=o;break;case V.RIGHT:n+=o;break;case V.UP:c-=o;break;case V.DOWN:c+=o;break;default:break}return Object(S["a"])(Object(S["a"])({},e),{},{left:n,top:c})};l=c.value?a.value.elements.map((function(e){return c.value===e.id?i(e):e})):a.value.elements.map((function(e){return n.value.includes(e.id)?i(e):e})),e.updateSlide({elements:l}),r()};return{moveElement:i}},Ot=function(){var e=ae(),t=Object(g["c"])(e),n=t.currentSlide,c=at(),o=c.addHistorySnapshot,a=function(e,t){return{minLevel:e.findIndex((function(e){return e.id===t[0].id})),maxLevel:e.findIndex((function(e){return e.id===t[t.length-1].id}))}},l=function(e,t){var n=JSON.parse(JSON.stringify(e));if(t.groupId){var c=n.filter((function(e){return e.groupId===t.groupId})),o=a(e,c),l=o.minLevel,r=o.maxLevel;if(r===e.length-1)return;var i=n[r+1],u=n.splice(l,c.length);if(i.groupId){var d=n.filter((function(e){return e.groupId===i.groupId}));n.splice.apply(n,[l+d.length,0].concat(Object(Q["a"])(u)))}else n.splice.apply(n,[l+1,0].concat(Object(Q["a"])(u)))}else{var s=e.findIndex((function(e){return e.id===t.id}));if(s===e.length-1)return;var f=n[s+1],b=n.splice(s,1)[0];if(f.groupId){var p=n.filter((function(e){return e.groupId===f.groupId}));n.splice(s+p.length,0,b)}else n.splice(s+1,0,b)}return n},r=function(e,t){var n=JSON.parse(JSON.stringify(e));if(t.groupId){var c=n.filter((function(e){return e.groupId===t.groupId})),o=a(e,c),l=o.minLevel;if(0===l)return;var r=n[l-1],i=n.splice(l,c.length);if(r.groupId){var u=n.filter((function(e){return e.groupId===r.groupId}));n.splice.apply(n,[l-u.length,0].concat(Object(Q["a"])(i)))}else n.splice.apply(n,[l-1,0].concat(Object(Q["a"])(i)))}else{var d=e.findIndex((function(e){return e.id===t.id}));if(0===d)return;var s=n[d-1],f=n.splice(d,1)[0];if(s.groupId){var b=n.filter((function(e){return e.groupId===s.groupId}));n.splice(d-b.length,0,f)}else n.splice(d-1,0,f)}return n},i=function(e,t){var n=JSON.parse(JSON.stringify(e));if(t.groupId){var c=n.filter((function(e){return e.groupId===t.groupId})),o=a(e,c),l=o.minLevel,r=o.maxLevel;if(r===e.length-1)return null;var i=n.splice(l,c.length);n.push.apply(n,Object(Q["a"])(i))}else{var u=e.findIndex((function(e){return e.id===t.id}));if(u===e.length-1)return null;n.splice(u,1),n.push(t)}return n},u=function(e,t){var n=JSON.parse(JSON.stringify(e));if(t.groupId){var c=n.filter((function(e){return e.groupId===t.groupId})),o=a(e,c),l=o.minLevel;if(0===l)return;var r=n.splice(l,c.length);n.unshift.apply(n,Object(Q["a"])(r))}else{var i=e.findIndex((function(e){return e.id===t.id}));if(0===i)return;n.splice(i,1),n.unshift(t)}return n},d=function(t,c){var a;c===k.UP?a=l(n.value.elements,t):c===k.DOWN?a=r(n.value.elements,t):c===k.TOP?a=i(n.value.elements,t):c===k.BOTTOM&&(a=u(n.value.elements,t)),a&&(e.updateSlide({elements:a}),o())};return{orderElement:d}},vt=function(){var e=document.documentElement;e.requestFullscreen?e.requestFullscreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.msRequestFullscreen&&e.msRequestFullscreen()},jt=function(){document.exitFullscreen?document.exitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.msExitFullscreen&&document.msExitFullscreen()},ht=function(){var e=document.fullscreenElement||document.mozFullScreenElement||document.webkitFullscreenElement||document.msFullscreenElement||document.webkitCurrentFullScreenElement;return!!e},yt=function(){var e=Ce(),t=ae(),n=function(){vt(),e.setScreening(!0)},c=function(){t.updateSlideIndex(0),n()},o=function(){e.setScreening(!1),ht()&&jt()};return{enterScreening:n,enterScreeningFromStart:c,exitScreening:o}},gt=function(){var e=ie(),t=Object(g["c"])(e),n=t.canvasPercentage,c=t.canvasScale,o=t.canvasDragged,a=Object(y["computed"])((function(){return Math.round(100*c.value)+"%"})),l=function(t){var c=n.value,o=5,a=200,l=30;"+"===t&&c<=a&&(c+=o),"-"===t&&c>=l&&(c-=o),e.setCanvasPercentage(c)},r=function(t){var o=Math.round(t/c.value*n.value)/100;e.setCanvasPercentage(o)},i=function(){e.setCanvasPercentage(90),o&&e.setCanvasDragged(!1)};return{canvasScalePercentage:a,setCanvasScalePercentage:r,scaleCanvas:l,resetCanvas:i}},xt=function(){var e=ie(),t=ke(),n=Object(g["c"])(e),c=n.activeElementIdList,o=n.disableHotkeys,a=n.handleElement,l=n.handleElementId,r=n.editorAreaFocus,i=n.thumbnailsFocus,u=Object(g["c"])(ae()),d=u.currentSlide,s=Object(g["c"])(t),f=s.ctrlKeyState,b=s.shiftKeyState,p=s.spaceKeyState,m=ut(),O=m.updateSlideIndex,v=m.copySlide,j=m.createSlide,h=m.deleteSlide,x=m.cutSlide,C=m.copyAndPasteSlide,N=m.selectAllSlide,E=ft(),w=E.combineElements,I=E.uncombineElements,B=st(),S=B.deleteElement,L=dt(),_=L.lockElement,T=bt(),M=T.copyElement,D=T.cutElement,z=T.quickCopyElement,F=pt(),A=F.selectAllElement,R=mt(),P=R.moveElement,H=Ot(),q=H.orderElement,U=at(),G=U.redo,X=U.undo,Y=yt(),Z=Y.enterScreening,W=Y.enterScreeningFromStart,J=gt(),K=J.scaleCanvas,Q=J.resetCanvas,$=function(){c.value.length?M():i.value&&v()},ee=function(){c.value.length?D():i.value&&x()},te=function(){c.value.length?z():i.value&&C()},ne=function(){r.value&&A(),i.value&&N()},ce=function(){r.value&&_()},oe=function(){r.value&&w()},le=function(){r.value&&I()},re=function(){c.value.length?S():i.value&&h()},ue=function(e){c.value.length?P(e):e!==V.UP&&e!==V.DOWN||O(e)},de=function(e){e===V.PAGEUP?O(V.UP):e===V.PAGEDOWN&&O(V.DOWN)},se=function(e){a.value&&q(a.value,e)},fe=function(){i.value&&j()},be=function(){if(d.value.elements.length)if(l.value){var t=d.value.elements.findIndex((function(e){return e.id===l.value})),n=t>=d.value.elements.length-1?0:t+1,c=d.value.elements[n].id;e.setActiveElementIdList([c])}else{var o=d.value.elements[0];e.setActiveElementIdList([o.id])}},pe=function(n){var c=n.ctrlKey,a=n.shiftKey,l=n.altKey,u=n.metaKey,d=c||u,s=n.key.toUpperCase();if(d&&!f.value&&t.setCtrlKeyState(!0),a&&!b.value&&t.setShiftKeyState(!0),o.value||s!==V.SPACE||t.setSpaceKeyState(!0),d&&s===V.P)return n.preventDefault(),void e.setDialogForExport("pdf");if(a&&s===V.F5)return n.preventDefault(),Z(),void t.setShiftKeyState(!1);if(s===V.F5)return n.preventDefault(),void W();if(r.value||i.value){if(d&&s===V.C){if(o.value)return;n.preventDefault(),$()}if(d&&s===V.X){if(o.value)return;n.preventDefault(),ee()}if(d&&s===V.D){if(o.value)return;n.preventDefault(),te()}if(d&&s===V.Z){if(o.value)return;n.preventDefault(),X()}if(d&&s===V.Y){if(o.value)return;n.preventDefault(),G()}if(d&&s===V.A){if(o.value)return;n.preventDefault(),ne()}if(d&&s===V.L){if(o.value)return;n.preventDefault(),ce()}if(!a&&d&&s===V.G){if(o.value)return;n.preventDefault(),oe()}if(a&&d&&s===V.G){if(o.value)return;n.preventDefault(),le()}if(l&&s===V.F){if(o.value)return;n.preventDefault(),se(k.TOP)}if(l&&s===V.B){if(o.value)return;n.preventDefault(),se(k.BOTTOM)}if(s===V.DELETE||s===V.BACKSPACE){if(o.value)return;n.preventDefault(),re()}if(s===V.UP){if(o.value)return;n.preventDefault(),ue(V.UP)}if(s===V.DOWN){if(o.value)return;n.preventDefault(),ue(V.DOWN)}if(s===V.LEFT){if(o.value)return;n.preventDefault(),ue(V.LEFT)}if(s===V.RIGHT){if(o.value)return;n.preventDefault(),ue(V.RIGHT)}if(s===V.PAGEUP){if(o.value)return;n.preventDefault(),de(V.PAGEUP)}if(s===V.PAGEDOWN){if(o.value)return;n.preventDefault(),de(V.PAGEDOWN)}if(s===V.ENTER){if(o.value)return;n.preventDefault(),fe()}if(s===V.MINUS){if(o.value)return;n.preventDefault(),K("-")}if(s===V.EQUAL){if(o.value)return;n.preventDefault(),K("+")}if(s===V.DIGIT_0){if(o.value)return;n.preventDefault(),Q()}if(s===V.TAB){if(o.value)return;n.preventDefault(),be()}}},me=function(){f.value&&t.setCtrlKeyState(!1),b.value&&t.setShiftKeyState(!1),p.value&&t.setSpaceKeyState(!1)};Object(y["onMounted"])((function(){document.addEventListener("keydown",pe),document.addEventListener("keyup",me),window.addEventListener("blur",me)})),Object(y["onUnmounted"])((function(){document.removeEventListener("keydown",pe),document.removeEventListener("keyup",me),window.removeEventListener("blur",me)}))},kt=function(){var e=Object(g["c"])(ie()),t=e.editorAreaFocus,n=e.thumbnailsFocus,c=e.disableHotkeys,o=it(),a=o.pasteTextClipboardData,l=lt(),r=l.createImageElement,i=function(e){et(e).then((function(e){return r(e)}))},u=function(e){if((t.value||n.value)&&!c.value&&e.clipboardData){var o=e.clipboardData.items,l=o[0];if(l){var r,u=Object(L["a"])(o);try{for(u.s();!(r=u.n()).done;){var d=r.value;if("file"===d.kind&&-1!==d.type.indexOf("image")){var s=d.getAsFile();return void(s&&i(s))}}}catch(f){u.e(f)}finally{u.f()}"string"===l.kind&&"text/plain"===l.type&&l.getAsString((function(e){return a(e)}))}}};Object(y["onMounted"])((function(){document.addEventListener("paste",u)})),Object(y["onUnmounted"])((function(){document.removeEventListener("paste",u)}))},Ct=(n("9911"),n("cc71"),n("21a6")),Nt=n("8f74"),Et=n("e774"),wt=(n("00b4"),["style","script","template"]),Vt=["html","head","body","p","dt","dd","li","option","thead","th","tbody","tr","td","tfoot","colgroup"],It={li:["ul","ol","menu"],dt:["dl"],dd:["dl"],tbody:["table"],thead:["table"],tfoot:["table"],tr:["table"],td:["table"]},Bt=["!doctype","area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],St=function(e,t){var n=t-e.position;Lt(e,n)},Lt=function(e,t){e.position=e.position+t},_t=function(e,t){var n=!1;while(!n){var c=e.indexOf("<",t);if(-1===c)return c;var o=e.charAt(c+1);if("/"===o||"!"===o||/[A-Za-z0-9]/.test(o))return c;t=c+1}return-1},Tt=function(e){var t=e.str,n=_t(t,e.position);if(n!==e.position){-1===n&&(n=t.length);var c=t.slice(e.position,n);St(e,n),e.tokens.push({type:"text",content:c})}},Mt=function(e){var t=e.str;Lt(e,4);var n=t.indexOf("--\x3e",e.position),c=n+3;-1===n&&(n=c=t.length);var o=t.slice(e.position,n);St(e,c),e.tokens.push({type:"comment",content:o})},Dt=function(e){var t=e.str,n=t.length,c=e.position;while(c"===o);if(a)break;c++}var l=c+1;while(l"===r);if(!i)break;l++}St(e,l);var u=t.slice(c,l);return e.tokens.push({type:"tag",content:u}),u},zt=function(e){var t=e.str,n=e.tokens,c=e.position,o=null,a=c,l=[],r=t.length;while(c"===i;if(d){c!==a&&l.push(t.slice(a,c));break}var s=/\s/.test(i);if(s)c!==a&&l.push(t.slice(a,c)),a=c+1,c++;else{var f="'"===i||'"'===i;f?(o=i,c++):c++}}}St(e,c);for(var b="attribute",p=0;p1){var j=m+v;n.push({type:b,content:j}),p+=1;continue}var h=l[p+2];if(p+=1,h){var y=m+"="+h;n.push({type:b,content:y}),p+=1;continue}}}if(Object(te["endsWith"])(m,"=")){var g=l[p+1];if(g&&-1===g.indexOf("=")){var x=m+g;n.push({type:b,content:x}),p+=1;continue}var k=m.slice(0,-1);n.push({type:b,content:k})}else n.push({type:b,content:m})}},Ft=function(e,t){var n=t.str,c=t.tokens,o=e.toLowerCase(),a=n.length,l=t.position;while(l=0){var o=t[c].tagName;if(o===e)break;if(n.includes(o))return!0;c--}}return!1},Ut=function(e,t){e.splice(t)},Gt=function e(t){var n=t.stack,c=t.tokens,o=t.cursor,a=n[n.length-1].children,l=c.length;while(o-1)if(n[d].tagName===u){s=!0;break}while(o0){if(u===n[p].tagName){Ut(n,p);var m=p-1;a=n[m].children;break}p-=1}}var O=[],v=void 0;while(o127&&c<2048?(t+=String.fromCharCode(c>>6|192),t+=String.fromCharCode(63&c|128)):(t+=String.fromCharCode(c>>12|224),t+=String.fromCharCode(c>>6&63|128),t+=String.fromCharCode(63&c|128))}return t},on=function(e){var t,n,c,o,a,l,r,i="",u=0;e=cn(e);while(u>2,a=(3&t)<<4|n>>4,l=(15&n)<<2|c>>6,r=63&c,isNaN(n)?l=r=64:isNaN(c)&&(r=64),i=i+tn.charAt(o)+tn.charAt(a)+tn.charAt(l)+tn.charAt(r);return i},an=function(e){var t=new XMLSerializer,n=t.serializeToString(e);return nn+on(n)},ln=function(){var e=ae(),t=Object(g["c"])(e),n=t.slides,c=t.theme,o=t.viewportRatio,a=rt(),l=a.addSlidesFromData,r=Object(y["ref"])(!1),i=function(e,t,n){var c=!(arguments.length>3&&void 0!==arguments[3])||arguments[3];r.value=!0;var o="png"===t?Et["c"]:Et["b"],a=e.querySelectorAll("foreignObject [xmlns]");a.forEach((function(e){return e.removeAttribute("xmlns")})),setTimeout((function(){var a={quality:n,width:1600};c&&(a.fontEmbedCSS=""),o(e,a).then((function(e){r.value=!1,Object(Ct["saveAs"])(e,"pptist_slides.".concat(t))})).catch((function(){r.value=!1,Se["a"].error("导出图片失败")}))}),200)},u=function(e){var t=new Blob([ze(JSON.stringify(e))],{type:""});Object(Ct["saveAs"])(t,"pptist_slides.pptist")},d=function(t){var n=arguments.length>1&&void 0!==arguments[1]&&arguments[1],c=t[0],o=new FileReader;o.addEventListener("load",(function(){try{var t=JSON.parse(Fe(o.result));n?e.setSlides(t):l(t)}catch(c){Se["a"].error("无法正确读取 / 解析该文件")}})),o.readAsText(c)},s=function(){var e=new Blob([JSON.stringify(n.value)],{type:""});Object(Ct["saveAs"])(e,"pptist_slides.json")},f=function(e){var t=ee()(e),n=t.getAlpha(),c=0===n?"#ffffff":t.setAlpha(1).toHexString();return{alpha:n,color:c}},b=function(e){var t=Jt(e),n=!1,c=0,o=[],a=function e(t){var a,l=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=Object(L["a"])(t);try{for(r.s();!(a=r.n()).done;){var i=a.value,u="tagName"in i&&["div","li","p"].includes(i.tagName);if(u&&o.length){var d=o[o.length-1];d.options||(d.options={}),d.options.breakLine=!0}var s=Object(S["a"])({},l),b="attributes"in i?i.attributes.find((function(e){return"style"===e.key})):null;if(b&&b.value){var p,m=b.value.split(";"),O=Object(L["a"])(m);try{for(O.s();!(p=O.n()).done;){var v=p.value,j=v.split(": "),h=Object(me["a"])(j,2),y=h[0],g=h[1],x=[Object(te["trim"])(y),Object(te["trim"])(g)],k=x[0],C=x[1];k&&C&&(s[k]=C)}}catch(I){O.e(I)}finally{O.f()}}if("tagName"in i){if("em"===i.tagName&&(s["font-style"]="italic"),"strong"===i.tagName&&(s["font-weight"]="bold"),"sup"===i.tagName&&(s["vertical-align"]="super"),"sub"===i.tagName&&(s["vertical-align"]="sub"),"a"===i.tagName){var N=i.attributes.find((function(e){return"href"===e.key}));s["href"]=(null===N||void 0===N?void 0:N.value)||""}if("ul"===i.tagName&&(s["list-type"]="ul"),"ol"===i.tagName&&(s["list-type"]="ol"),"li"===i.tagName&&(n=!0),"p"===i.tagName&&"attributes"in i){var E=i.attributes.find((function(e){return"data-indent"===e.key}));E&&E.value&&(c=+E.value)}}if("tagName"in i&&"br"===i.tagName)o.push({text:"",options:{breakLine:!0}});else if("content"in i){var w=i.content.replace(/ /g," ").replace(/>/g,">").replace(/</g,"<").replace(/&/g,"&").replace(/\n/g,""),V={};s["font-size"]&&(V.fontSize=.75*parseInt(s["font-size"])),s["color"]&&(V.color=f(s["color"]).color),s["background-color"]&&(V.highlight=f(s["background-color"]).color),s["text-decoration-line"]&&(-1!==s["text-decoration-line"].indexOf("underline")&&(V.underline={color:V.color||"#000000",style:"sng"}),-1!==s["text-decoration-line"].indexOf("line-through")&&(V.strike="sngStrike")),s["text-decoration"]&&(-1!==s["text-decoration"].indexOf("underline")&&(V.underline={color:V.color||"#000000",style:"sng"}),-1!==s["text-decoration"].indexOf("line-through")&&(V.strike="sngStrike")),s["vertical-align"]&&("super"===s["vertical-align"]&&(V.superscript=!0),"sub"===s["vertical-align"]&&(V.subscript=!0)),s["text-align"]&&(V.align=s["text-align"]),s["font-weight"]&&(V.bold="bold"===s["font-weight"]),s["font-style"]&&(V.italic="italic"===s["font-style"]),s["font-family"]&&(V.fontFace=s["font-family"]),s["href"]&&(V.hyperlink={url:s["href"]}),n&&"ol"===s["list-type"]&&(V.bullet={type:"number",indent:15},V.paraSpaceBefore=.1,n=!1),n&&"ul"===s["list-type"]&&(V.bullet={indent:15},V.paraSpaceBefore=.1,n=!1),c&&(V.indentLevel=c,c=0),o.push({text:w,options:V})}else"children"in i&&e(i.children,s)}}catch(I){r.e(I)}finally{r.f()}};return a(t),o},p=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{x:1,y:1};return e.map((function(e){if(void 0!==e.close)return{close:!0};if("M"===e.type)return{x:e.x/100*t.x,y:e.y/100*t.y,moveTo:!0};if(e.curve){if("cubic"===e.curve.type)return{x:e.x/100*t.x,y:e.y/100*t.y,curve:{type:"cubic",x1:e.curve.x1/100*t.x,y1:e.curve.y1/100*t.y,x2:e.curve.x2/100*t.x,y2:e.curve.y2/100*t.y}};if("quadratic"===e.curve.type)return{x:e.x/100*t.x,y:e.y/100*t.y,curve:{type:"quadratic",x1:e.curve.x1/100*t.x,y1:e.curve.y1/100*t.y}}}return{x:e.x/100*t.x,y:e.y/100*t.y}}))},m=function(e){var t=f(e.color),n=e.h,c=e.v,o=4,a=45;return 0===n&&0===c?(o=4,a=45):0===n?c>0?(o=c,a=90):(o=-c,a=270):0===c?n>0?(o=n,a=1):(o=-n,a=180):n>0&&c>0?(o=Math.max(n,c),a=45):n>0&&c<0?(o=Math.max(n,-c),a=315):n<0&&c>0?(o=Math.max(-n,c),a=135):n<0&&c<0&&(o=Math.max(-n,-c),a=225),{type:"outer",color:t.color.replace("#",""),opacity:t.alpha,blur:.75*e.blur,offset:o,angle:a}},O=function(e){var t=f((null===e||void 0===e?void 0:e.color)||"#000000");return{color:t.color,transparency:100*(1-t.alpha),width:.75*(e.width||1),dashType:"solid"===e.style?"solid":"dash"}},v=function(e){var t=e.type,c=e.target;if("web"===t)return{url:c};if("slide"===t){var o=n.value.findIndex((function(e){return e.id===c}));if(-1!==o)return{slide:o+1}}return null},j=function(e,t){r.value=!0;var n=new Nt["a"];if(.625===o.value?n.layout="LAYOUT_16x10":.75===o.value?n.layout="LAYOUT_4x3":n.layout="LAYOUT_16x9",t){var a=f(c.value.backgroundColor),l=a.color,i=a.alpha;n.defineSlideMaster({title:"PPTIST_MASTER",background:{color:l,transparency:100*(1-i)}})}var u,d=Object(L["a"])(e);try{for(d.s();!(u=d.n()).done;){var s=u.value,j=n.addSlide();if(s.background){var h=s.background;if("image"===h.type&&h.image)j.background={data:h.image};else if("solid"===h.type&&h.color){var y=f(h.color);j.background={color:y.color,transparency:100*(1-y.alpha)}}else if("gradient"===h.type&&h.gradientColor){var g=Object(me["a"])(h.gradientColor,2),x=g[0],k=g[1],C=ee.a.mix(x,k).toHexString(),N=f(C);j.background={color:N.color,transparency:100*(1-N.alpha)}}}if(s.remark&&j.addNotes(s.remark),s.elements){var E,w=Object(L["a"])(s.elements);try{var V=function(){var e=E.value;if("text"===e.type){var t,c=b(e.content),o={x:e.left/100,y:e.top/100,w:e.width/100,h:e.height/100,fontSize:15,fontFace:"微软雅黑",color:"#000000",valign:"top",margin:7.5,paraSpaceBefore:3.75,lineSpacingMultiple:1.2,autoFit:!0};if(e.rotate&&(o.rotate=e.rotate),e.wordSpace&&(o.charSpacing=.75*e.wordSpace),e.lineHeight&&(o.lineSpacingMultiple=e.lineHeight/1.25),e.fill){var a=f(e.fill),l=void 0===e.opacity?1:e.opacity;o.fill={color:a.color,transparency:100*(1-a.alpha*l)}}e.defaultColor&&(o.color=f(e.defaultColor).color),e.defaultFontName&&(o.fontFace=e.defaultFontName),e.shadow&&(o.shadow=m(e.shadow)),null!==(t=e.outline)&&void 0!==t&&t.width&&(o.line=O(e.outline)),void 0!==e.opacity&&(o.transparency=100*(1-e.opacity)),void 0!==e.paragraphSpace&&(o.paraSpaceBefore=.75*e.paragraphSpace),j.addText(c,o)}else if("image"===e.type){var r,i,u={path:e.src,x:e.left/100,y:e.top/100,w:e.width/100,h:e.height/100};if(e.flipH&&(u.flipH=e.flipH),e.flipV&&(u.flipV=e.flipV),e.rotate&&(u.rotate=e.rotate),e.link){var d=v(e.link);d&&(u.hyperlink=d)}if(null!==(r=e.filters)&&void 0!==r&&r.opacity&&(u.transparency=100-parseInt(null===(i=e.filters)||void 0===i?void 0:i.opacity)),e.clip){"ellipse"===e.clip.shape&&(u.rounding=!0);var s=Object(me["a"])(e.clip.range,2),h=s[0],y=s[1],g=Object(me["a"])(h,2),x=g[0],k=g[1],C=Object(me["a"])(y,2),N=C[0],w=C[1],V=e.width/((N-x)/100),I=e.height/((w-k)/100);u.w=V/100,u.h=I/100,u.sizing={type:"crop",x:x/100*V/100,y:k/100*I/100,w:(N-x)/100*V/100,h:(w-k)/100*I/100}}j.addImage(u)}else if("shape"===e.type){if(e.special){var B=document.querySelector(".thumbnail-list .base-element-".concat(e.id," svg")),S=an(B),L={data:S,x:e.left/100,y:e.top/100,w:e.width/100,h:e.height/100};if(e.rotate&&(L.rotate=e.rotate),e.link){var _=v(e.link);_&&(L.hyperlink=_)}j.addImage(L)}else{var T,M={x:e.width/e.viewBox[0],y:e.height/e.viewBox[1]},D=p(en(e.path),M),z=f(e.fill),F=void 0===e.opacity?1:e.opacity,A={x:e.left/100,y:e.top/100,w:e.width/100,h:e.height/100,fill:{color:z.color,transparency:100*(1-z.alpha*F)},points:D};if(e.flipH&&(A.flipH=e.flipH),e.flipV&&(A.flipV=e.flipV),e.shadow&&(A.shadow=m(e.shadow)),null!==(T=e.outline)&&void 0!==T&&T.width&&(A.line=O(e.outline)),e.link){var R=v(e.link);R&&(A.hyperlink=R)}j.addShape("custGeom",A)}if(e.text){var P=b(e.text.content),H={x:e.left/100,y:e.top/100,w:e.width/100,h:e.height/100,fontSize:15,fontFace:"微软雅黑",color:"#000000",paraSpaceBefore:3.75,valign:e.text.align};e.rotate&&(H.rotate=e.rotate),e.text.defaultColor&&(H.color=f(e.text.defaultColor).color),e.text.defaultFontName&&(H.fontFace=e.text.defaultFontName),j.addText(P,H)}}else if("line"===e.type){var q=Je(e),U=p(en(q)),G=Ge(e),X=G.minX,Y=G.maxX,Z=G.minY,W=G.maxY,J=f(e.color),K={x:e.left/100,y:e.top/100,w:(Y-X)/100,h:(W-Z)/100,line:{color:J.color,transparency:100*(1-J.alpha),width:.75*e.width,dashType:"solid"===e.style?"solid":"dash",beginArrowType:e.points[0]?"arrow":"none",endArrowType:e.points[1]?"arrow":"none"},points:U};e.shadow&&(K.shadow=m(e.shadow)),j.addShape("custGeom",K)}else if("chart"===e.type){for(var $=[],te=0;te1||je.rowspan>1)for(var he=pe;hei.value){var r=o*(a.value/100);c.setCanvasScale(r/tt),t.value=(o-r)/2,n.value=(l-r*i.value)/2}else{var u=l*(a.value/100);c.setCanvasScale(u/(tt*i.value)),t.value=(o-u/i.value)/2,n.value=(l-u)/2}}};Object(y["watch"])([a,i],u),Object(y["watch"])(l,(function(){l.value||u()}));var d=Object(y["computed"])((function(){return{width:tt,height:tt*i.value,left:t.value,top:n.value}})),s=new ResizeObserver(u);Object(y["onMounted"])((function(){e.value&&s.observe(e.value)})),Object(y["onUnmounted"])((function(){e.value&&s.unobserve(e.value)}));var f=function(e){var o=!0,a=e.pageX,l=e.pageY,r=t.value,i=n.value;document.onmousemove=function(e){if(o){var c=e.pageX,u=e.pageY;t.value=r+(c-a),n.value=i+(u-l)}},document.onmouseup=function(){o=!1,document.onmousemove=null,document.onmouseup=null,c.setCanvasDragged(!0)}};return{viewportStyles:d,dragViewport:f}},ac=function(e,t){var n=ie(),c=Object(g["c"])(n),o=c.canvasScale,a=Object(y["ref"])(!1),l=Object(y["ref"])(1),r=Object(y["ref"])({top:0,left:0,width:0,height:0}),i=function(c){if(t.value){var i=!0,u=t.value.getBoundingClientRect(),d=5,s=c.pageX,f=c.pageY,b=(s-u.x)/o.value,p=(f-u.y)/o.value;r.value={top:p,left:b,width:0,height:0},a.value=!1,l.value=4,document.onmousemove=function(e){if(i){var t=e.pageX,n=e.pageY,c=(t-s)/o.value,u=(n-f)/o.value,b=Math.abs(c),p=Math.abs(u);if(!(b0&&u>0?m=4:c<0&&u<0?m=1:c>0&&u<0?m=2:c<0&&u>0&&(m=3),r.value=Object(S["a"])(Object(S["a"])({},r.value),{},{width:b,height:p}),a.value=!0,l.value=m}}},document.onmouseup=function(){document.onmousemove=null,document.onmouseup=null,i=!1;for(var t=[],c=0;cu&&md&&vu-s&&md-f&&vu&&md-f&&vu-s&&md&&v0&&Math.abs(r-45)<=d?r-=r-45:r<0&&Math.abs(r+45)<=d?r-=r+45:r>0&&Math.abs(r-90)<=d?r-=r-90:r<0&&Math.abs(r+90)<=d?r-=r+90:r>0&&Math.abs(r-135)<=d?r-=r-135:r<0&&Math.abs(r+135)<=d?r-=r+135:r>0&&Math.abs(r-180)<=d?r-=r-180:r<0&&Math.abs(r+180)<=d&&(r-=r+180),e.value=e.value.map((function(e){return c.id===e.id?Object(S["a"])(Object(S["a"])({},e),{},{rotate:r}):e}))}},document.onmouseup=function(){a=!1,document.onmousemove=null,document.onmouseup=null,i!==r&&(n.updateSlide({elements:e.value}),l())}}};return{rotateElement:r}},uc={text:"文本",image:"图片",shape:"形状",line:"线条",chart:"图表",table:"表格",video:"视频",audio:"音频"},dc={text:20,image:20,shape:15,chart:200,table:20,video:250,audio:20},sc=function(e,t){var n=e.left,c=e.top,o=e.width,a=e.height,l=Math.sqrt(Math.pow(o,2)+Math.pow(a,2))/2,r=180*Math.atan(a/o)/Math.PI,i=(180-t-r)*Math.PI/180,u=(r-t)*Math.PI/180,d=(90-t)*Math.PI/180,s=t*Math.PI/180,f=o/2,b=a/2,p=n+f,m=c+b,O={left:p+l*Math.cos(i),top:m-l*Math.sin(i)},v={left:p+b*Math.cos(d),top:m-b*Math.sin(d)},j={left:p+l*Math.cos(u),top:m-l*Math.sin(u)},h={left:p+f*Math.cos(s),top:m+f*Math.sin(s)},y={left:p-l*Math.cos(i),top:m+l*Math.sin(i)},g={left:p-b*Math.sin(s),top:m+b*Math.cos(s)},x={left:p-l*Math.cos(u),top:m+l*Math.sin(u)},k={left:p-f*Math.cos(s),top:m-f*Math.sin(s)};return{leftTopPoint:O,topPoint:v,rightTopPoint:j,rightPoint:h,rightBottomPoint:y,bottomPoint:g,leftBottomPoint:x,leftPoint:k}},fc=function(e,t){var n,c=(n={},Object(pe["a"])(n,E.RIGHT_BOTTOM,t.leftTopPoint),Object(pe["a"])(n,E.LEFT_BOTTOM,t.rightTopPoint),Object(pe["a"])(n,E.LEFT_TOP,t.rightBottomPoint),Object(pe["a"])(n,E.RIGHT_TOP,t.leftBottomPoint),Object(pe["a"])(n,E.TOP,t.bottomPoint),Object(pe["a"])(n,E.BOTTOM,t.topPoint),Object(pe["a"])(n,E.LEFT,t.rightPoint),Object(pe["a"])(n,E.RIGHT,t.leftPoint),n);return c[e]},bc=function(e,t,n){var c=ie(),o=ae(),a=Object(g["c"])(c),l=a.activeElementIdList,r=a.activeGroupElementId,i=Object(g["c"])(o),u=i.viewportRatio,d=Object(g["c"])(ke()),s=d.ctrlOrShiftKeyActive,f=at(),b=f.addHistorySnapshot,p=function(a,i,d){var f=!(a instanceof MouseEvent);if(!f||a.changedTouches&&a.changedTouches[0]){var p=!0;c.setScalingState(!0);var m,O=i.left,v=i.top,j=i.width,h=i.height,y="rotate"in i&&i.rotate?i.rotate:0,g=Math.PI*y/180,x=s.value||"fixedRatio"in i&&i.fixedRatio,k=j/h,C=f?a.changedTouches[0].pageX:a.pageX,N=f?a.changedTouches[0].pageY:a.pageY,w=dc[i.type]||20,V=function(e){return e2&&void 0!==arguments[2])||arguments[2];if(r.value||n.setEditorareaFocus(!0),o.value.includes(i.id)){if(u.value){var s=[];if(i.groupId){var f=[];e.value.forEach((function(e){e.groupId===i.groupId&&f.push(e.id)})),s=o.value.filter((function(e){return!f.includes(e)}))}else s=o.value.filter((function(e){return e!==i.id}));s.length>0&&n.setActiveElementIdList(s)}else if(l.value!==i.id)n.setHandleElementId(i.id);else if(a.value!==i.id){var b=c instanceof MouseEvent?c.pageX:c.changedTouches[0].pageX,p=c instanceof MouseEvent?c.pageY:c.changedTouches[0].pageY;c.target.onmouseup=function(e){var t=e.pageX,c=e.pageY;b===t&&p===c&&(n.setActiveGroupElementId(i.id),e.target.onmouseup=null)}}}else{var m=[];if(m=u.value?[].concat(Object(Q["a"])(o.value),[i.id]):[i.id],i.groupId){var O=[];e.value.forEach((function(e){e.groupId===i.groupId&&O.push(e.id)})),m=[].concat(Object(Q["a"])(m),O)}n.setActiveElementIdList(Object(te["uniq"])(m)),n.setHandleElementId(i.id)}d&&t(c,i)},s=function(){var t=e.value.filter((function(e){return!e.lock})),c=t.map((function(e){return e.id}));n.setActiveElementIdList(c)};return{selectElement:d,selectAllElement:s}},mc=function(e,t,n){var c=ae(),o=Object(g["c"])(ie()),a=o.activeElementIdList,l=o.activeGroupElementId,r=Object(g["c"])(c),i=r.viewportRatio,u=at(),d=u.addHistorySnapshot,s=function(o,r){var u=!(o instanceof MouseEvent);if((!u||o.changedTouches&&o.changedTouches[0])&&a.value.includes(r.id)){var s,f=!0,b=tt,p=tt*i.value,m=5,O=JSON.parse(JSON.stringify(e.value)),v=O.filter((function(e){return a.value.includes(e.id)})),j=r.left,h=r.top,y=r.width,g="height"in r&&r.height?r.height:0,x="rotate"in r&&r.rotate?r.rotate:0,k=u?o.changedTouches[0].pageX:o.pageX,C=u?o.changedTouches[0].pageY:o.pageY,N=null,E=r.id===l.value,w=[],V=[],I=Object(L["a"])(e.value);try{for(I.s();!(s=I.n()).done;){var B=s.value;if("line"!==B.type&&((!E||B.id!==r.id)&&(E||!a.value.includes(B.id)))){var _=void 0,T=void 0,M=void 0,D=void 0;if("rotate"in B&&B.rotate){var z=qe({left:B.left,top:B.top,width:B.width,height:B.height,rotate:B.rotate}),F=z.xRange,A=z.yRange;_=F[0],T=A[0],M=F[1]-F[0],D=A[1]-A[0]}else _=B.left,T=B.top,M=B.width,D=B.height;var R=_+M,P=T+D,H=T+D/2,q=_+M/2,U={value:T,range:[_,R]},G={value:P,range:[_,R]},X={value:H,range:[_,R]},Y={value:_,range:[T,P]},Z={value:R,range:[T,P]},W={value:q,range:[T,P]};w.push(U,G,X),V.push(Y,Z,W)}}}catch(ae){I.e(ae)}finally{I.f()}var J={value:0,range:[0,b]},K={value:p,range:[0,b]},$={value:p/2,range:[0,b]},ee={value:0,range:[0,p]},te={value:b,range:[0,p]},ne={value:b/2,range:[0,p]};w.push(J,K,$),V.push(ee,te,ne),w=Ye(w),V=Ye(V);var ce=function(c){var o=c instanceof MouseEvent?c.pageX:c.changedTouches[0].pageX,l=c instanceof MouseEvent?c.pageY:c.changedTouches[0].pageY;if(!1!==N&&(N=Math.abs(k-o)O&&(X[0]=U-H,Y[0]=0),m>v&&(X[1]=G-q,Y[1]=0),e.value=e.value.map((function(e){if(e.id===o.id){var t=Object(S["a"])(Object(S["a"])({},e),{},{left:H,top:q,start:X,end:Y});return l===w.START||l===w.END?(o.broken&&(t.broken=[(X[0]+Y[0])/2,(X[1]+Y[1])/2]),o.curve&&(t.curve=[(X[0]+Y[0])/2,(X[1]+Y[1])/2]),o.cubic&&(t.cubic=[[(X[0]+Y[0])/2,(X[1]+Y[1])/2],[(X[0]+Y[0])/2,(X[1]+Y[1])/2]])):l===w.C?(o.broken&&(t.broken=[h-H,y-q]),o.curve&&(t.curve=[h-H,y-q])):o.cubic&&(t.cubic=[[N-H,E-q],[V-H,I-q]]),t}return e}))}},document.onmouseup=function(n){r=!1,document.onmousemove=null,document.onmouseup=null;var c=n.pageX,o=n.pageY;u===c&&d===o||(t.updateSlide({elements:e.value}),a())}};return{dragLineElement:l}},vc=function(e,t){var n=ae(),c=at(),o=c.addHistorySnapshot,a=function(c,a){var l=!(c instanceof MouseEvent);if(!l||c.changedTouches&&c.changedTouches[0]){var r=!0,i=l?c.changedTouches[0].pageX:c.pageX,u=l?c.changedTouches[0].pageY:c.pageY,d=nt[a.pathFormula],s=null;if("editable"in d){var f=d.getBaseSize(a.width,a.height),b=f*a.keypoint,p=Object(me["a"])(d.range,2),m=p[0],O=p[1],v=d.relative;s={baseSize:f,originPos:b,min:m,max:O,relative:v}}var j=function(n){if(r){var c=n instanceof MouseEvent?n.pageX:n.changedTouches[0].pageX,o=n instanceof MouseEvent?n.pageY:n.changedTouches[0].pageY,l=(c-i)/t.value,f=(o-u)/t.value;e.value=e.value.map((function(e){if(e.id===a.id&&s){var t=s,n=t.baseSize,c=t.originPos,o=t.min,r=t.max,i=t.relative,u=e,b=0;return"left"===i&&(b=(c+l)/n),"right"===i&&(b=(c-l)/n),"center"===i&&(b=(c-2*l)/n),"top"===i&&(b=(c+f)/n),"bottom"===i&&(b=(c-f)/n),br&&(b=r),Object(S["a"])(Object(S["a"])({},e),{},{keypoint:b,path:d.formula(u.width,u.height,b)})}return e}))}},h=function(t){r=!1,document.ontouchmove=null,document.ontouchend=null,document.onmousemove=null,document.onmouseup=null;var c=t instanceof MouseEvent?t.pageX:t.changedTouches[0].pageX,a=t instanceof MouseEvent?t.pageY:t.changedTouches[0].pageY;i===c&&u===a||(n.updateSlide({elements:e.value}),o())};l?(document.ontouchmove=j,document.ontouchend=h):(document.onmousemove=j,document.onmouseup=h)}};return{moveShapeKeypoint:a}},jc=function(e){var t=ie(),n=Object(g["c"])(t),c=n.canvasScale,o=n.creatingElement,a=function(t){var n=t.start,o=t.end;if(e.value){var a=e.value.getBoundingClientRect(),l=Object(me["a"])(n,2),r=l[0],i=l[1],u=Object(me["a"])(o,2),d=u[0],s=u[1],f=Math.min(r,d),b=Math.max(r,d),p=Math.min(i,s),m=Math.max(i,s),O=(f-a.x)/c.value,v=(p-a.y)/c.value,j=(b-f)/c.value,h=(m-p)/c.value;return{left:O,top:v,width:j,height:h}}},l=function(t){var n=t.start,o=t.end;if(e.value){var a=e.value.getBoundingClientRect(),l=Object(me["a"])(n,2),r=l[0],i=l[1],u=Object(me["a"])(o,2),d=u[0],s=u[1],f=Math.min(r,d),b=Math.max(r,d),p=Math.min(i,s),m=Math.max(i,s),O=(f-a.x)/c.value,v=(p-a.y)/c.value,j=(b-f)/c.value,h=(m-p)/c.value,y=[r===f?0:j,i===p?0:h],g=[d===f?0:j,s===p?0:h];return{left:O,top:v,start:y,end:g}}},r=lt(),i=r.createTextElement,u=r.createShapeElement,d=r.createLineElement,s=function(e){if(o.value){var n=o.value.type;if("text"===n){var c=a(e);c&&i(c)}else if("shape"===n){var r=a(e);r&&u(r,o.value.data)}else if("line"===n){var s=l(e);s&&d(s,o.value.data)}t.setCreatingElement(null)}};return{insertElementFromCreateSelection:s}},hc=(n("a9e3"),function(){var e=ae(),t=Object(g["c"])(ie()),n=t.activeElementIdList,c=t.activeElementList,o=Object(g["c"])(e),a=o.currentSlide,l=o.viewportRatio,r=at(),i=r.addHistorySnapshot,u=function(t){var o,r=tt,u=tt*l.value,d=Xe(c.value),s=d.minX,f=d.maxX,b=d.minY,p=d.maxY,m=JSON.parse(JSON.stringify(a.value.elements)),O=Object(L["a"])(m);try{for(O.s();!(o=O.n()).done;){var v=o.value;if(n.value.includes(v.id)){if(t===C.CENTER){var j=b+(p-b)/2-u/2,h=s+(f-s)/2-r/2;v.top=v.top-j,v.left=v.left-h}if(t===C.TOP){var y=b-0;v.top=v.top-y}else if(t===C.VERTICAL){var g=b+(p-b)/2-u/2;v.top=v.top-g}else if(t===C.BOTTOM){var x=p-u;v.top=v.top-x}else if(t===C.LEFT){var k=s-0;v.left=v.left-k}else if(t===C.HORIZONTAL){var N=s+(f-s)/2-r/2;v.left=v.left-N}else if(t===C.RIGHT){var E=f-r;v.left=v.left-E}}}}catch(w){O.e(w)}finally{O.f()}e.updateSlide({elements:m}),i()};return{alignElementToCanvas:u}}),yc=function(e){var t=Object(y["computed"])((function(){if(e.value){var t=e.value,n=t.h,c=t.v,o=t.blur,a=t.color;return"".concat(n,"px ").concat(c,"px ").concat(o,"px ").concat(a)}return""}));return{shadowStyle:t}},gc=function(e,t){var n=Object(y["computed"])((function(){var n="";return e.value&&t.value?n="rotateX(180deg) rotateY(180deg)":t.value?n="rotateX(180deg)":e.value&&(n="rotateY(180deg)"),n}));return{flipStyle:n}};(function(e){e["RECT"]="rect",e["ELLIPSE"]="ellipse",e["POLYGON"]="polygon"})(Qn||(Qn={})),function(e){e["RECT"]="rect",e["ROUNDRECT"]="roundRect",e["ELLIPSE"]="ellipse",e["TRIANGLE"]="triangle",e["PENTAGON"]="pentagon",e["RHOMBUS"]="rhombus",e["STAR"]="star"}($n||($n={}));var xc={rect:{name:"矩形",type:Qn.RECT,radius:"0",style:""},rect2:{name:"矩形2",type:Qn.POLYGON,style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 0 100%)",createPath:function(e,t){return"M 0 0 L ".concat(.8*e," 0 L ").concat(e," ").concat(.2*t," L ").concat(e," ").concat(t," L 0 ").concat(t," Z")}},rect3:{name:"矩形3",type:Qn.POLYGON,style:"polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 20% 100%, 0% 80%)",createPath:function(e,t){return"M 0 0 L ".concat(.8*e," 0 L ").concat(e," ").concat(.2*t," L ").concat(e," ").concat(t," L ").concat(.2*e," ").concat(t," L 0 ").concat(.8*t," Z")}},roundRect:{name:"圆角矩形",type:Qn.RECT,radius:"10%",style:"inset(0 0 0 0 round 10% 10% 10% 10%)"},ellipse:{name:"圆形",type:Qn.ELLIPSE,style:"ellipse(50% 50% at 50% 50%)"},triangle:{name:"三角形",type:Qn.POLYGON,style:"polygon(50% 0%, 0% 100%, 100% 100%)",createPath:function(e,t){return"M ".concat(.5*e," 0 L 0 ").concat(t," L ").concat(e," ").concat(t," Z")}},triangle2:{name:"三角形2",type:Qn.POLYGON,style:"polygon(50% 100%, 0% 0%, 100% 0%)",createPath:function(e,t){return"M ".concat(.5*e," ").concat(t," L 0 0 L ").concat(e," 0 Z")}},triangle3:{name:"三角形3",type:Qn.POLYGON,style:"polygon(0% 0%, 0% 100%, 100% 100%)",createPath:function(e,t){return"M 0 0 L 0 ".concat(t," L ").concat(e," ").concat(t," Z")}},rhombus:{name:"菱形",type:Qn.POLYGON,style:"polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)",createPath:function(e,t){return"M ".concat(.5*e," 0 L ").concat(e," ").concat(.5*t," L ").concat(.5*e," ").concat(t," L 0 ").concat(.5*t," Z")}},hexagon:{name:"六边形",type:Qn.POLYGON,style:"polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%)",createPath:function(e,t){return"M ".concat(.2*e," 0 L ").concat(.8*e," 0 L ").concat(e," ").concat(.5*t," L ").concat(.8*e," ").concat(t," L ").concat(.2*e," ").concat(t," L 0 ").concat(.5*t," Z")}},pentagon:{name:"五边形",type:Qn.POLYGON,style:"polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)",createPath:function(e,t){return"M ".concat(.5*e," 0 L ").concat(e," ").concat(.38*t," L ").concat(.82*e," ").concat(t," L ").concat(.18*e," ").concat(t," L 0 ").concat(.38*t," Z")}},parallelogram:{name:"平行四边形",type:Qn.POLYGON,style:"polygon(30% 0%, 100% 0%, 70% 100%, 0% 100%)",createPath:function(e,t){return"M ".concat(.3*e," 0 L ").concat(e," 0 L ").concat(.7*e," ").concat(t," L 0 ").concat(t," Z")}},parallelogram2:{name:"平行四边形2",type:Qn.POLYGON,style:"polygon(30% 100%, 100% 100%, 70% 0%, 0% 0%)",createPath:function(e,t){return"M ".concat(.3*e," ").concat(t," L ").concat(e," ").concat(t," L ").concat(.7*e," 0 L 0 0 Z")}},trapezoid:{name:"梯形",type:Qn.POLYGON,style:"polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)",createPath:function(e,t){return"M ".concat(.25*e," 0 L ").concat(.75*e," 0 L ").concat(e," ").concat(t," L 0 ").concat(t," Z")}},trapezoid2:{name:"梯形2",type:Qn.POLYGON,style:"polygon(0% 0%, 100% 0%, 75% 100%, 25% 100%)",createPath:function(e,t){return"M 0 0 L ".concat(e," 0 L ").concat(.75*e," ").concat(t," L ").concat(.25*e," ").concat(t," Z")}}},kc=function(e){var t=Object(y["computed"])((function(){if(!e.value)return xc.rect;var t=e.value.shape||Qn.RECT;return xc[t]})),n=Object(y["computed"])((function(){if(!e.value)return{top:"0",left:"0",width:"100%",height:"100%"};var t=Object(me["a"])(e.value.range,2),n=t[0],c=t[1],o=(c[0]-n[0])/100,a=(c[1]-n[1])/100,l=n[0]/o,r=n[1]/a;return{left:-l+"%",top:-r+"%",width:100/o+"%",height:100/a+"%"}}));return{clipShape:t,imgPosition:n}},Cc=(n("b64b"),function(e){var t=Object(y["computed"])((function(){if(!e.value)return"";for(var t="",n=0,c=Object.keys(e.value);n45&&c.rotate<135&&(d=(u-o)/a.value/c.width*100,s=-(i-n)/a.value/c.height*100),(c.rotate>=135&&c.rotate<=180||c.rotate>=-180&&c.rotate<=-135)&&(d=-d,s=-s),c.rotate>-135&&c.rotate<-45&&(d=-(u-o)/a.value/c.width*100,s=(i-n)/a.value/c.height*100);var f=r.left+d,b=r.top+s;f<0?f=0:f+r.width>l.width&&(f=l.width-r.width),b<0?b=0:b+r.height>l.height&&(b=l.height-r.height),p.value=Object(S["a"])(Object(S["a"])({},p.value),{},{left:f,top:b})}},document.onmouseup=function(){t=!1,document.onmousemove=null,document.onmouseup=null,x(),setTimeout((function(){u.value=!1}),0)}},C=function(e,t){u.value=!0;var n=!0,o=50/c.width*100,l=50/c.height*100,i=e.pageX,d=e.pageY,s=f.value,b=Object(S["a"])({},p.value),m=p.value.width/p.value.height;document.onmousemove=function(e){if(n){var u,f,O,v,j=e.pageX,h=e.pageY,y=(j-i)/a.value/c.width*100,g=(h-d)/a.value/c.height*100;c.rotate>45&&c.rotate<135&&(y=(h-d)/a.value/c.width*100,g=-(j-i)/a.value/c.height*100),(c.rotate>=135&&c.rotate<=180||c.rotate>=-180&&c.rotate<=-135)&&(y=-y,g=-g),c.rotate>-135&&c.rotate<-45&&(y=-(h-d)/a.value/c.width*100,g=(j-i)/a.value/c.height*100),r.value&&(t!==E.RIGHT_BOTTOM&&t!==E.LEFT_TOP||(g=y/m),t!==E.LEFT_BOTTOM&&t!==E.RIGHT_TOP||(g=-y/m)),t===E.LEFT_TOP?(b.left+y<0&&(y=-b.left),b.top+g<0&&(g=-b.top),b.width-ys.width&&(y=s.width-(b.left+b.width)),b.top+g<0&&(g=-b.top),b.width+ys.height&&(g=s.height-(b.top+b.height)),b.width-ys.width&&(y=s.width-(b.left+b.width)),b.top+b.height+g>s.height&&(g=s.height-(b.top+b.height)),b.width+ys.height&&(g=s.height-(b.top+b.height)),b.height+gs.width&&(y=s.width-(b.left+b.width)),b.width+y-22.5&&t<=22.5?e+0:t>22.5&&t<=67.5?e+45:t>67.5&&t<=112.5?e+90:t>112.5&&t<=157.5?e+135:t>157.5||t<=-157.5?e+0:t>-157.5&&t<=-112.5?e+45:t>-112.5&&t<=-67.5?e+90:t>-67.5&&t<=-22.5?e+135:e+0})),w=[E.LEFT_TOP,E.RIGHT_TOP,E.LEFT_BOTTOM,E.RIGHT_BOTTOM],I=[E.TOP,E.BOTTOM,E.LEFT,E.RIGHT];return function(t,n){var c=Object(y["resolveDirective"])("click-outside");return Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"image-clip-handler",style:Object(y["normalizeStyle"])(i.value)},[Object(y["createElementVNode"])("img",{class:"bottom-img",src:e.src,draggable:!1,alt:"",style:Object(y["normalizeStyle"])(Object(y["unref"])(b))},null,12,Xc),Object(y["createElementVNode"])("div",{class:"top-image-content",style:Object(y["normalizeStyle"])(Object(S["a"])(Object(S["a"])({},Object(y["unref"])(m)),{},{clipPath:e.clipPath}))},[Object(y["createElementVNode"])("img",{class:"top-img",src:e.src,draggable:!1,alt:"",style:Object(y["normalizeStyle"])(Object(y["unref"])(O))},null,12,Yc)],4),Object(y["createElementVNode"])("div",{class:"operate",style:Object(y["normalizeStyle"])(Object(y["unref"])(m)),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(e){return k(e)}),["stop"]))},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(w,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["clip-point",e,Object(y["unref"])(N)]),key:e,onMousedown:Object(y["withModifiers"])((function(t){return C(t,e)}),["stop"])},Jc,42,Zc)})),64)),(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(I,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["clip-point",e,Object(y["unref"])(N)]),key:e,onMousedown:Object(y["withModifiers"])((function(t){return C(t,e)}),["stop"])},$c,42,Kc)})),64))],36)],4)),[[c,j]])}}});n("5970");const to=pn()(eo,[["__scopeId","data-v-3e0199ec"]]);var no=to,co=["src"],oo=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=ie(),c=ae(),o=Object(g["c"])(n),a=o.clipingImageElementId,l=Object(y["computed"])((function(){return a.value===t.elementInfo.id})),r=at(),i=r.addHistorySnapshot,u=Object(y["computed"])((function(){return t.elementInfo.shadow})),d=yc(u),s=d.shadowStyle,f=Object(y["computed"])((function(){return t.elementInfo.flipH})),b=Object(y["computed"])((function(){return t.elementInfo.flipV})),p=gc(f,b),m=p.flipStyle,O=Object(y["computed"])((function(){return t.elementInfo.clip})),v=kc(O),j=v.clipShape,h=v.imgPosition,x=Object(y["computed"])((function(){return t.elementInfo.filters})),k=Cc(x),C=k.filter,N=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))},E=function(e){if(n.setClipingImageElementId(""),e){var o=e.range,a=e.position,l=t.elementInfo.clip||{shape:"rect",range:[[0,0],[100,100]]},r=t.elementInfo.left+a.left,u=t.elementInfo.top+a.top,d=t.elementInfo.width+a.width,s=t.elementInfo.height+a.height,f=0,b=0;if(t.elementInfo.rotate){var p=r+d/2-(t.elementInfo.left+t.elementInfo.width/2),m=-(u+s/2-(t.elementInfo.top+t.elementInfo.height/2)),O=-t.elementInfo.rotate*Math.PI/180,v=p*Math.cos(O)-m*Math.sin(O),j=p*Math.sin(O)+m*Math.cos(O);f=v-p,b=-(j-m)}var h={clip:Object(S["a"])(Object(S["a"])({},l),{},{range:o}),left:r+f,top:u+b,width:d,height:s};c.updateElement({id:t.elementInfo.id,props:h}),i()}};return function(t,n){var c=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-image",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["unref"])(l)?(Object(y["openBlock"])(),Object(y["createBlock"])(no,{key:0,src:e.elementInfo.src,clipData:e.elementInfo.clip,width:e.elementInfo.width,height:e.elementInfo.height,top:e.elementInfo.top,left:e.elementInfo.left,rotate:e.elementInfo.rotate,clipPath:Object(y["unref"])(j).style,onClip:n[0]||(n[0]=function(e){return E(e)})},null,8,["src","clipData","width","height","top","left","rotate","clipPath"])):Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:1,class:"element-content",style:Object(y["normalizeStyle"])({filter:Object(y["unref"])(s)?"drop-shadow(".concat(Object(y["unref"])(s),")"):"",transform:Object(y["unref"])(m)}),onMousedown:n[2]||(n[2]=function(e){return N(e)}),onTouchstart:n[3]||(n[3]=function(e){return N(e)})},[Object(y["createVNode"])(Uc,{elementInfo:e.elementInfo},null,8,["elementInfo"]),Object(y["createElementVNode"])("div",{class:"image-content",style:Object(y["normalizeStyle"])({clipPath:Object(y["unref"])(j).style})},[Object(y["createElementVNode"])("img",{src:e.elementInfo.src,draggable:!1,style:Object(y["normalizeStyle"])({top:Object(y["unref"])(h).top,left:Object(y["unref"])(h).left,width:Object(y["unref"])(h).width,height:Object(y["unref"])(h).height,filter:Object(y["unref"])(C)}),onDragstart:n[1]||(n[1]=Object(y["withModifiers"])((function(){}),["prevent"])),alt:""},null,44,co)],4)],36)),[[c,e.contextmenus]])],4)],6)}}});n("7394");const ao=pn()(oo,[["__scopeId","data-v-30dc7050"]]);var lo=ao,ro=["width","height"],io=["d","stroke","stroke-width","stroke-dasharray"],uo=Object(y["defineComponent"])({__name:"ElementOutline",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},outline:{type:Object}},setup:function(e){var t=e,n=Nc(Object(y["toRef"])(t,"outline")),c=n.outlineWidth,o=n.outlineStyle,a=n.outlineColor;return function(t,n){return e.outline?(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{key:0,class:"element-outline",overflow:"visible",width:e.width,height:e.height},[Object(y["createElementVNode"])("path",{"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:"transparent",d:"M0,0 L".concat(e.width,",0 L").concat(e.width,",").concat(e.height," L0,").concat(e.height," Z"),stroke:Object(y["unref"])(a),"stroke-width":Object(y["unref"])(c),"stroke-dasharray":"dashed"===Object(y["unref"])(o)?"10 6":"0 0"},null,8,io)],8,ro)):Object(y["createCommentVNode"])("",!0)}}});n("4731");const so=pn()(uo,[["__scopeId","data-v-61b7d06a"]]);var fo,bo=so,po=n("5313"),mo=n("576a"),Oo=n("304a"),vo=n("7f06"),jo=n("8726"),ho=n("23f1"),yo=n("1a16"),go=n("665f"),xo=n("f95e"),ko=function(e){var t={},n=function(e,n){return t[e]=n};return n("Alt-ArrowUp",_["c"]),n("Alt-ArrowDown",_["b"]),n("Ctrl-z",jo["c"]),n("Ctrl-y",jo["b"]),n("Backspace",xo["f"]),n("Escape",_["e"]),n("Ctrl-b",Object(_["f"])(e.marks.strong)),n("Ctrl-i",Object(_["f"])(e.marks.em)),n("Ctrl-u",Object(_["f"])(e.marks.underline)),n("Ctrl-d",Object(_["f"])(e.marks.strikethrough)),n("Enter",Object(go["f"])(e.nodes.list_item)),n("Mod-[",Object(go["b"])(e.nodes.list_item)),n("Mod-]",Object(go["e"])(e.nodes.list_item)),t},Co=function(e){return Object(xo["g"])(/^\s*>\s$/,e)},No=function(e){return Object(xo["g"])(/^(\d+)\.\s$/,e,(function(e){return{order:+e[1]}}),(function(e,t){return t.childCount+t.attrs.order===+e[1]}))},Eo=function(e){return Object(xo["g"])(/^\s*([-+*])\s$/,e)},wo=function(e){return Object(xo["e"])(/^```$/,e)},Vo=function(e){var t=[].concat(Object(Q["a"])(xo["d"]),[xo["a"],xo["b"]]);return t.push(Co(e.nodes.blockquote)),t.push(No(e.nodes.ordered_list)),t.push(Eo(e.nodes.bullet_list)),t.push(wo(e.nodes.code_block)),Object(xo["c"])({rules:t})},Io=function(e){return[Vo(e),Object(vo["b"])(ko(e)),Object(vo["b"])(_["a"]),Object(ho["a"])(),Object(yo["a"])(),Object(jo["a"])()]},Bo=n("15fd"),So=n("2210"),Lo=Object(S["a"])(Object(S["a"])({},go["d"]),{},{content:"list_item+",group:"block"}),_o=Object(S["a"])(Object(S["a"])({},go["a"]),{},{content:"list_item+",group:"block"}),To=Object(S["a"])(Object(S["a"])({},go["c"]),{},{content:"paragraph block*",group:"block"}),Mo={attrs:{align:{default:""},indent:{default:0}},content:"inline*",group:"block",parseDOM:[{tag:"p",getAttrs:function(e){var t=e.style.textAlign,n=e.getAttribute("align")||t||"";n=/(left|right|center|justify)/.test(n)?n:"";var c=+(e.getAttribute("data-indent")||0);return{align:n,indent:c}}}],toDOM:function(e){var t=e.attrs,n=t.align,c=t.indent,o="";n&&"left"!==n&&(o+="text-align: ".concat(n,";"));var a={style:o};return c&&(a["data-indent"]=c),["p",a,0]}},Do=(So["b"].hard_break,Object(Bo["a"])(So["b"],["hard_break"])),zo=Object(S["a"])(Object(S["a"])({},Do),{},{ordered_list:Lo,bullet_list:_o,list_item:To,paragraph:Mo}),Fo={excludes:"subscript",parseDOM:[{tag:"sub"},{style:"vertical-align",getAttrs:function(e){return"sub"===e&&null}}],toDOM:function(){return["sub",0]}},Ao={excludes:"superscript",parseDOM:[{tag:"sup"},{style:"vertical-align",getAttrs:function(e){return"super"===e&&null}}],toDOM:function(){return["sup",0]}},Ro={parseDOM:[{tag:"strike"},{style:"text-decoration",getAttrs:function(e){return"line-through"===e&&null}},{style:"text-decoration-line",getAttrs:function(e){return"line-through"===e&&null}}],toDOM:function(){return["span",{style:"text-decoration-line: line-through"},0]}},Po={parseDOM:[{tag:"u"},{style:"text-decoration",getAttrs:function(e){return"underline"===e&&null}},{style:"text-decoration-line",getAttrs:function(e){return"underline"===e&&null}}],toDOM:function(){return["span",{style:"text-decoration: underline"},0]}},Ho={attrs:{color:{}},inline:!0,group:"inline",parseDOM:[{style:"color",getAttrs:function(e){return e?{color:e}:{}}}],toDOM:function(e){var t=e.attrs.color,n="";return t&&(n+="color: ".concat(t,";")),["span",{style:n},0]}},qo={attrs:{backcolor:{}},inline:!0,group:"inline",parseDOM:[{style:"background-color",getAttrs:function(e){return e?{backcolor:e}:{}}}],toDOM:function(e){var t=e.attrs.backcolor,n="";return t&&(n+="background-color: ".concat(t,";")),["span",{style:n},0]}},Uo={attrs:{fontsize:{}},inline:!0,group:"inline",parseDOM:[{style:"font-size",getAttrs:function(e){return e?{fontsize:e}:{}}}],toDOM:function(e){var t=e.attrs.fontsize,n="";return t&&(n+="font-size: ".concat(t)),["span",{style:n},0]}},Go={attrs:{fontname:{}},inline:!0,group:"inline",parseDOM:[{style:"font-family",getAttrs:function(e){return{fontname:e&&"string"===typeof e?e.replace(/[\"\']/g,""):""}}}],toDOM:function(e){var t=e.attrs.fontname,n="";return t&&(n+="font-family: ".concat(t)),["span",{style:n},0]}},Xo={attrs:{href:{},title:{default:null},target:{default:"_blank"}},inclusive:!1,parseDOM:[{tag:"a[href]",getAttrs:function(e){var t=e.getAttribute("href"),n=e.getAttribute("title");return{href:t,title:n}}}],toDOM:function(e){return["a",e.attrs,0]}},Yo=Object(S["a"])(Object(S["a"])({},So["a"]),{},{subscript:Fo,superscript:Ao,strikethrough:Ro,underline:Po,forecolor:Ho,backcolor:qo,fontsize:Uo,fontname:Go,link:Xo}),Zo=zo,Wo=Yo,Jo=new Oo["i"]({nodes:Zo,marks:Wo}),Ko=function(e){var t="
".concat(e,"
"),n=new window.DOMParser,c=n.parseFromString(t,"text/html").body.firstElementChild;return Oo["a"].fromSchema(Jo).parse(c)},Qo=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return new mo["c"](e,Object(S["a"])({state:po["b"].create({doc:Ko(t),plugins:Io(Jo)})},n))},$o=n("1344");(function(e){e["RICH_TEXT_COMMAND"]="RICH_TEXT_COMMAND",e["OPEN_CHART_DATA_EDITOR"]="OPEN_CHART_DATA_EDITOR",e["OPEN_LATEX_EDITOR"]="OPEN_LATEX_EDITOR"})(fo||(fo={}));var ea=Object($o["a"])(),ta=ea,na=(n("6062"),function(e,t,n){var c=e,o=c.selection,a=c.doc;if(!o||!a)return e;var l=o.from,r=o.to,i=t.nodes,u=i.blockquote,d=i.list_item,s=i.paragraph,f=[];n=n||"";var b=new Set([u,d,s]);return a.nodesBetween(l,r,(function(e,t){var c=e.type,o=e.attrs.align||"";return o!==n&&b.has(c)&&f.push({node:e,pos:t,nodeType:c}),!0})),f.length?(f.forEach((function(t){var c=t.node,o=t.pos,a=t.nodeType,l=c.attrs;l=n?Object(S["a"])(Object(S["a"])({},l),{},{align:n}):Object(S["a"])(Object(S["a"])({},l),{},{align:null}),e=e.setNodeMarkup(o,a,l,c.marks)})),e):e}),ca=function(e,t){var n=e.state,c=n.schema,o=n.selection,a=na(n.tr.setSelection(o),c,t);e.dispatch(a)},oa=function(e,t){return e.type===t.nodes.bullet_list||e.type===t.nodes.ordered_list},aa=function(e,t){return function(n,c){var o=n.schema,a=n.selection,l=a.$from,r=a.$to,i=l.blockRange(r);if(!i)return!1;var u=A((function(e){return oa(e,o)}))(a);if(i.depth>=1&&u&&i.depth-u.depth<=1){if(u.node.type===e)return Object(go["b"])(t)(n,c);if(oa(u.node,o)&&e.validContent(u.node.content)){var d=n.tr;return d.setNodeMarkup(u.pos,e),c&&c(d),!1}}return Object(go["g"])(e)(n,c)}};function la(e,t,n){if(!e.doc)return e;var c=e.doc.nodeAt(t);if(!c)return e;var o=0,a=7,l=(c.attrs.indent||0)+n;if(la&&(l=a),l===c.attrs.indent)return e;var r=Object(S["a"])(Object(S["a"])({},c.attrs),{},{indent:l});return e.setNodeMarkup(t,c.type,r,c.marks)}var ra=function(e,t,n){var c=e,o=c.selection,a=c.doc;if(!o||!a)return e;if(!(o instanceof po["g"]||o instanceof po["a"]))return e;var l=o.from,r=o.to;return a.nodesBetween(l,r,(function(c,o){var a=c.type;return"paragraph"===a.name||"blockquote"===a.name?(e=la(e,o,n),!1):!oa(c,t)})),e},ia=function(e,t){var n=e.state,c=n.schema,o=n.selection,a=ra(n.tr.setSelection(o),c,t);return!!a.docChanged&&(e.dispatch(a),!0)},ua=Object(y["defineComponent"])({__name:"ProsemirrorEditor",props:{elementId:{type:String,required:!0},defaultColor:{type:String,required:!0},defaultFontName:{type:String,required:!0},editable:{type:Boolean,default:!1},value:{type:String,required:!0},autoFocus:{type:Boolean,default:!1}},emits:["update","focus","blur"],setup:function(e,t){var n,c=t.expose,o=t.emit,a=e,l=ie(),r=Object(g["c"])(l),i=r.handleElementId,u=Object(y["ref"])(),d=Object(te["debounce"])((function(){o("update",n.dom.innerHTML)}),300,{trailing:!0}),s=function(){l.setDisableHotkeysState(!0),o("focus")},f=function(){l.setDisableHotkeysState(!1),o("blur")},b=Object(te["debounce"])((function(){var e=Z(n,{color:a.defaultColor,fontname:a.defaultFontName});l.setRichtextAttrs(e)}),30,{trailing:!0}),p=function(){d(),b()},m=Object(y["computed"])((function(){return a.value}));Object(y["watch"])(m,(function(){if(n&&!n.hasFocus()){var e=n.state,t=e.doc,c=e.tr;n.dispatch(c.replaceRangeWith(0,t.content.size,Ko(m.value)))}})),Object(y["watch"])((function(){return a.editable}),(function(){n.setProps({editable:function(){return a.editable}})})),Object(y["onMounted"])((function(){n=Qo(u.value,m.value,{handleDOMEvents:{focus:s,blur:f,keydown:p,click:b},editable:function(){return a.editable}}),a.autoFocus&&n.focus()})),Object(y["onUnmounted"])((function(){n&&n.destroy()}));var O=function(){return n.focus()};c({focus:O});var v=function(e){var t=e.target,c=e.action;if((t||i.value===a.elementId)&&(!t||t===a.elementId)){var o,l="command"in c?[c]:c,r=Object(L["a"])(l);try{for(r.s();!(o=r.n()).done;){var u=o.value;if("fontname"===u.command&&u.value){var s=n.state.schema.marks.fontname.create({fontname:u.value});T(n),M(n,s)}else if("fontsize"===u.command&&u.value){var f=n.state.schema.marks.fontsize.create({fontsize:u.value});T(n),M(n,f)}else if("fontsize-add"===u.command){var p=u.value?+u.value:2;T(n);var m=W(n)+p+"px",O=n.state.schema.marks.fontsize.create({fontsize:m});M(n,O)}else if("fontsize-reduce"===u.command){var v=u.value?+u.value:2;T(n);var j=W(n)-v;j<12&&(j=12);var h=n.state.schema.marks.fontsize.create({fontsize:j+"px"});M(n,h)}else if("color"===u.command&&u.value){var y=n.state.schema.marks.forecolor.create({color:u.value});T(n),M(n,y)}else if("backcolor"===u.command&&u.value){var g=n.state.schema.marks.backcolor.create({backcolor:u.value});T(n),M(n,g)}else if("bold"===u.command)T(n),Object(_["f"])(n.state.schema.marks.strong)(n.state,n.dispatch);else if("em"===u.command)T(n),Object(_["f"])(n.state.schema.marks.em)(n.state,n.dispatch);else if("underline"===u.command)T(n),Object(_["f"])(n.state.schema.marks.underline)(n.state,n.dispatch);else if("strikethrough"===u.command)T(n),Object(_["f"])(n.state.schema.marks.strikethrough)(n.state,n.dispatch);else if("subscript"===u.command)Object(_["f"])(n.state.schema.marks.subscript)(n.state,n.dispatch);else if("superscript"===u.command)Object(_["f"])(n.state.schema.marks.superscript)(n.state,n.dispatch);else if("blockquote"===u.command)Object(_["g"])(n.state.schema.nodes.blockquote)(n.state,n.dispatch);else if("code"===u.command)Object(_["f"])(n.state.schema.marks.code)(n.state,n.dispatch);else if("align"===u.command&&u.value)ca(n,u.value);else if("indent"===u.command&&u.value)ia(n,+u.value);else if("bulletList"===u.command){var x=n.state.schema.nodes,k=x.bullet_list,C=x.list_item;aa(k,C)(n.state,n.dispatch)}else if("orderedList"===u.command){var N=n.state.schema.nodes,E=N.ordered_list,w=N.list_item;aa(E,w)(n.state,n.dispatch)}else if("clear"===u.command){T(n);var V=n.state.selection,I=V.$from,B=V.$to;n.dispatch(n.state.tr.removeMark(I.pos,B.pos))}else if("link"===u.command){var S=n.state.schema.marks.link,z=n.state.selection,F=z.from,A=z.to,R=D(n.state.doc,F,A,S);if(R)if(u.value){var P=n.state.schema.marks.link.create({href:u.value,title:u.value});M(n,P,{from:R.from.pos,to:R.to.pos+1})}else n.dispatch(n.state.tr.removeMark(R.from.pos,R.to.pos+1,S));else if(G(n.state,S))if(u.value){var H=n.state.schema.marks.link.create({href:u.value,title:u.value});M(n,H)}else Object(_["f"])(S)(n.state,n.dispatch);else u.value&&(T(n),Object(_["f"])(S,{href:u.value,title:u.value})(n.state,n.dispatch))}else"insert"===u.command&&u.value&&n.dispatch(n.state.tr.insertText(u.value))}}catch(q){r.e(q)}finally{r.f()}n.focus(),d(),b()}};return ta.on(fo.RICH_TEXT_COMMAND,v),Object(y["onUnmounted"])((function(){ta.off(fo.RICH_TEXT_COMMAND,v)})),function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"prosemirror-editor",ref_key:"editorViewRef",ref:u},null,512)}}});n("a511");const da=pn()(ua,[["__scopeId","data-v-1debd6ff"]]);var sa=da,fa=function(e){return Object(y["pushScopeId"])("data-v-7135a611"),e=e(),Object(y["popScopeId"])(),e},ba=fa((function(){return Object(y["createElementVNode"])("div",{class:"drag-handler top"},null,-1)})),pa=fa((function(){return Object(y["createElementVNode"])("div",{class:"drag-handler bottom"},null,-1)})),ma=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=ie(),c=ae(),o=Object(g["c"])(n),a=o.handleElementId,l=o.isScaling,r=at(),i=r.addHistorySnapshot,u=Object(y["ref"])(),d=Object(y["computed"])((function(){return t.elementInfo.shadow})),s=yc(d),f=s.shadowStyle,b=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo,n))},p=Object(y["ref"])(-1);Object(y["watch"])(l,(function(){a.value===t.elementInfo.id&&(l.value||-1===p.value||(c.updateElement({id:t.elementInfo.id,props:{height:p.value}}),p.value=-1))}));var m=function(e){var n=e[0].contentRect;if(u.value){var o=n.height;t.elementInfo.height!==o&&(l.value?p.value=o:c.updateElement({id:t.elementInfo.id,props:{height:o}}))}},O=new ResizeObserver(m);Object(y["onMounted"])((function(){u.value&&O.observe(u.value)})),Object(y["onUnmounted"])((function(){u.value&&O.unobserve(u.value)}));var v=function(e){c.updateElement({id:t.elementInfo.id,props:{content:e}}),i()},j=function(){var e=t.elementInfo.content.replaceAll(/<[^>]+>/g,"");e||c.deleteElement(t.elementInfo.id)},h=Object(y["computed"])((function(){return a.value===t.elementInfo.id}));return Object(y["watch"])(h,(function(){h.value||j()})),function(t,n){var c=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-text",{lock:e.elementInfo.lock}]),ref_key:"elementRef",ref:u,style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",style:Object(y["normalizeStyle"])({backgroundColor:e.elementInfo.fill,opacity:e.elementInfo.opacity,textShadow:Object(y["unref"])(f),lineHeight:e.elementInfo.lineHeight,letterSpacing:(e.elementInfo.wordSpace||0)+"px",color:e.elementInfo.defaultColor,fontFamily:e.elementInfo.defaultFontName}),onMousedown:n[3]||(n[3]=function(e){return b(e)}),onTouchstart:n[4]||(n[4]=function(e){return b(e)})},[Object(y["createVNode"])(bo,{width:e.elementInfo.width,height:e.elementInfo.height,outline:e.elementInfo.outline},null,8,["width","height","outline"]),Object(y["createVNode"])(sa,{class:"text",elementId:e.elementInfo.id,defaultColor:e.elementInfo.defaultColor,defaultFontName:e.elementInfo.defaultFontName,editable:!e.elementInfo.lock,value:e.elementInfo.content,style:Object(y["normalizeStyle"])({"--textIndent":"".concat(e.elementInfo.textIndent||0,"px"),"--paragraphSpace":"".concat(void 0===e.elementInfo.paragraphSpace?5:e.elementInfo.paragraphSpace,"px")}),onUpdate:n[0]||(n[0]=function(e){return v(e)}),onMousedown:n[1]||(n[1]=function(e){return b(e,!1)}),onTouchstart:n[2]||(n[2]=function(e){return b(e)})},null,8,["elementId","defaultColor","defaultFontName","editable","value","style"]),ba,pa],36)),[[c,e.contextmenus]])],4)],6)}}});n("59bb");const Oa=pn()(ma,[["__scopeId","data-v-7135a611"]]);var va=Oa,ja=["id","gradientTransform"],ha=["stop-color"],ya=["stop-color"],ga=["id"],xa=["stop-color"],ka=["stop-color"],Ca=Object(y["defineComponent"])({__name:"GradientDefs",props:{id:{type:String,required:!0},type:{type:String},color1:{type:String,required:!0},color2:{type:String,required:!0},rotate:{type:Number,default:0}},setup:function(e){return function(t,n){return"linear"===e.type?(Object(y["openBlock"])(),Object(y["createElementBlock"])("linearGradient",{key:0,id:e.id,x1:"0%",y1:"0%",x2:"100%",y2:"0%",gradientTransform:"rotate(".concat(e.rotate,",0.5,0.5)")},[Object(y["createElementVNode"])("stop",{offset:"0%","stop-color":e.color1},null,8,ha),Object(y["createElementVNode"])("stop",{offset:"100%","stop-color":e.color2},null,8,ya)],8,ja)):(Object(y["openBlock"])(),Object(y["createElementBlock"])("radialGradient",{key:1,id:e.id},[Object(y["createElementVNode"])("stop",{offset:"0%","stop-color":e.color1},null,8,xa),Object(y["createElementVNode"])("stop",{offset:"100%","stop-color":e.color2},null,8,ka)],8,ga))}}});const Na=Ca;var Ea=Na,wa=["width","height"],Va={key:0},Ia=["transform"],Ba=["d","fill","stroke","stroke-width","stroke-dasharray"],Sa=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=ie(),c=ae(),o=Object(g["c"])(n),a=o.handleElementId,l=at(),r=l.addHistorySnapshot,i=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo,n))},u=Object(y["computed"])((function(){return t.elementInfo.outline})),d=Nc(u),s=d.outlineWidth,f=d.outlineStyle,b=d.outlineColor,p=Object(y["computed"])((function(){return t.elementInfo.shadow})),m=yc(p),O=m.shadowStyle,v=Object(y["computed"])((function(){return t.elementInfo.flipH})),j=Object(y["computed"])((function(){return t.elementInfo.flipV})),h=gc(v,j),x=h.flipStyle,k=Object(y["ref"])(!1);Object(y["watch"])(a,(function(){a.value!==t.elementInfo.id&&k.value&&(k.value=!1)}));var C=Object(y["computed"])((function(){var e={content:"",defaultFontName:"微软雅黑",defaultColor:"#000",align:"middle"};return t.elementInfo.text?t.elementInfo.text:e})),N=function(e){var n=Object(S["a"])(Object(S["a"])({},C.value),{},{content:e});c.updateElement({id:t.elementInfo.id,props:{text:n}}),r()},E=function(){if(t.elementInfo.text){var e=t.elementInfo.text.content.replaceAll(/<[^>]+>/g,"");e||(c.removeElementProps({id:t.elementInfo.id,propName:"text"}),r())}},w=Object(y["ref"])(),V=function(){k.value=!0,Object(y["nextTick"])((function(){return w.value&&w.value.focus()}))};return function(t,n){var c=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-shape",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",style:Object(y["normalizeStyle"])({opacity:e.elementInfo.opacity,filter:Object(y["unref"])(O)?"drop-shadow(".concat(Object(y["unref"])(O),")"):"",transform:Object(y["unref"])(x),color:Object(y["unref"])(C).defaultColor,fontFamily:Object(y["unref"])(C).defaultFontName}),onMousedown:n[4]||(n[4]=function(e){return i(e)}),onTouchstart:n[5]||(n[5]=function(e){return i(e)}),onDblclick:n[6]||(n[6]=function(e){return V()})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{overflow:"visible",width:e.elementInfo.width,height:e.elementInfo.height},[e.elementInfo.gradient?(Object(y["openBlock"])(),Object(y["createElementBlock"])("defs",Va,[Object(y["createVNode"])(Ea,{id:"editabel-gradient-".concat(e.elementInfo.id),type:e.elementInfo.gradient.type,color1:e.elementInfo.gradient.color[0],color2:e.elementInfo.gradient.color[1],rotate:e.elementInfo.gradient.rotate},null,8,["id","type","color1","color2","rotate"])])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("g",{transform:"scale(".concat(e.elementInfo.width/e.elementInfo.viewBox[0],", ").concat(e.elementInfo.height/e.elementInfo.viewBox[1],") translate(0,0) matrix(1,0,0,1,0,0)")},[Object(y["createElementVNode"])("path",{class:"shape-path","vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",d:e.elementInfo.path,fill:e.elementInfo.gradient?"url(#editabel-gradient-".concat(e.elementInfo.id,")"):e.elementInfo.fill,stroke:Object(y["unref"])(b),"stroke-width":Object(y["unref"])(s),"stroke-dasharray":"dashed"===Object(y["unref"])(f)?"10 6":"0 0"},null,8,Ba)],8,Ia)],8,wa)),Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["shape-text",[Object(y["unref"])(C).align,{editable:k.value||Object(y["unref"])(C).content}]])},[k.value||Object(y["unref"])(C).content?(Object(y["openBlock"])(),Object(y["createBlock"])(sa,{key:0,ref_key:"prosemirrorEditorRef",ref:w,elementId:e.elementInfo.id,defaultColor:Object(y["unref"])(C).defaultColor,defaultFontName:Object(y["unref"])(C).defaultFontName,editable:!e.elementInfo.lock,value:Object(y["unref"])(C).content,onUpdate:n[0]||(n[0]=function(e){return N(e)}),onBlur:n[1]||(n[1]=function(e){return E()}),onMousedown:n[2]||(n[2]=function(e){return i(e,!1)}),onTouchstart:n[3]||(n[3]=function(e){return i(e,!1)})},null,8,["elementId","defaultColor","defaultFontName","editable","value"])):Object(y["createCommentVNode"])("",!0)],2)],36)),[[c,e.contextmenus]])],4)],6)}}});n("990c");const La=pn()(Sa,[["__scopeId","data-v-d4c718fa"]]);var _a=La,Ta=["id","markerWidth","markerHeight","refX","refY"],Ma=["d","fill","transform"],Da=Object(y["defineComponent"])({__name:"LinePointMarker",props:{id:{type:String,required:!0},position:{type:String,required:!0},type:{type:String,required:!0},color:{type:String},baseSize:{type:Number,required:!0}},setup:function(e){var t=e,n={dot:"m0 5a5 5 0 1 0 10 0a5 5 0 1 0 -10 0z",arrow:"M0,0 L10,5 0,10 Z"},c={"arrow-start":180,"arrow-end":0},o=Object(y["computed"])((function(){return n[t.type]})),a=Object(y["computed"])((function(){return c["".concat(t.type,"-").concat(t.position)]||0})),l=Object(y["computed"])((function(){return t.baseSize<2?2:t.baseSize}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("marker",{id:"".concat(e.id,"-").concat(e.type,"-").concat(e.position),markerUnits:"userSpaceOnUse",orient:"auto",markerWidth:3*Object(y["unref"])(l),markerHeight:3*Object(y["unref"])(l),refX:1.5*Object(y["unref"])(l),refY:1.5*Object(y["unref"])(l)},[Object(y["createElementVNode"])("path",{d:Object(y["unref"])(o),fill:e.color,transform:"scale(".concat(.3*Object(y["unref"])(l),", ").concat(.3*Object(y["unref"])(l),") rotate(").concat(Object(y["unref"])(a),", 5, 5)")},null,8,Ma)],8,Ta)}}});const za=Da;var Fa=za,Aa=["width","height"],Ra=["d","stroke","stroke-width","stroke-dasharray","marker-start","marker-end"],Pa=["d"],Ha=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))},c=Object(y["computed"])((function(){return t.elementInfo.shadow})),o=yc(c),a=o.shadowStyle,l=Object(y["computed"])((function(){var e=Math.abs(t.elementInfo.start[0]-t.elementInfo.end[0]);return e<24?24:e})),r=Object(y["computed"])((function(){var e=Math.abs(t.elementInfo.start[1]-t.elementInfo.end[1]);return e<24?24:e})),i=Object(y["computed"])((function(){return"dashed"===t.elementInfo.style?"10 6":"0 0"})),u=Object(y["computed"])((function(){return Je(t.elementInfo)}));return function(t,c){var o=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-shape",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px"})},[Object(y["createElementVNode"])("div",{class:"element-content",style:Object(y["normalizeStyle"])({filter:Object(y["unref"])(a)?"drop-shadow(".concat(Object(y["unref"])(a),")"):""}),onMousedown:c[0]||(c[0]=function(e){return n(e)}),onTouchstart:c[1]||(c[1]=function(e){return n(e)})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{overflow:"visible",width:Object(y["unref"])(l),height:Object(y["unref"])(r)},[Object(y["createElementVNode"])("defs",null,[e.elementInfo.points[0]?(Object(y["openBlock"])(),Object(y["createBlock"])(Fa,{key:0,id:e.elementInfo.id,position:"start",type:e.elementInfo.points[0],color:e.elementInfo.color,baseSize:e.elementInfo.width},null,8,["id","type","color","baseSize"])):Object(y["createCommentVNode"])("",!0),e.elementInfo.points[1]?(Object(y["openBlock"])(),Object(y["createBlock"])(Fa,{key:1,id:e.elementInfo.id,position:"end",type:e.elementInfo.points[1],color:e.elementInfo.color,baseSize:e.elementInfo.width},null,8,["id","type","color","baseSize"])):Object(y["createCommentVNode"])("",!0)]),Object(y["createElementVNode"])("path",{class:"line-point",d:Object(y["unref"])(u),stroke:e.elementInfo.color,"stroke-width":e.elementInfo.width,"stroke-dasharray":Object(y["unref"])(i),fill:"none","marker-start":e.elementInfo.points[0]?"url(#".concat(e.elementInfo.id,"-").concat(e.elementInfo.points[0],"-start)"):"","marker-end":e.elementInfo.points[1]?"url(#".concat(e.elementInfo.id,"-").concat(e.elementInfo.points[1],"-end)"):""},null,8,Ra),Object(y["withDirectives"])(Object(y["createElementVNode"])("path",{class:"line-path",d:Object(y["unref"])(u),stroke:"transparent","stroke-width":"20",fill:"none"},null,8,Pa),[[o,e.contextmenus]])],8,Aa))],36)],6)}}});n("bde5");const qa=pn()(Ha,[["__scopeId","data-v-6550e504"]]);var Ua=qa,Ga=n("ba48"),Xa=n.n(Ga),Ya=(n("aa97"),Object(y["defineComponent"])({__name:"Chart",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},type:{type:String,required:!0},data:{type:Object,required:!0},options:{type:Object},themeColor:{type:Array,required:!0},legends:{type:Array,required:!0},gridColor:{type:String},legend:{type:String}},setup:function(e){var t,n=e,c=Object(y["ref"])(),o=Object(y["inject"])(tc)||Object(y["ref"])(1),a=Object(y["computed"])((function(){return n.legend?n.height-20:n.height})),l=function(){var e=n.options||{},t=Object(S["a"])(Object(S["a"])({},e),{},{width:n.width*o.value,height:a.value*o.value}),c="pie"===n.type?Object(S["a"])(Object(S["a"])({},n.data),{},{series:n.data.series[0]}):n.data;return{data:c,options:t}},r=function(){if(c.value){var e=Object(te["upperFirst"])(n.type),o=l(),a=o.data,r=o.options;t=new Xa.a[e](c.value,a,r)}},i=function(){if(t){var e=l(),n=e.data,c=e.options;t.update(n,c)}else r()};Object(y["watch"])([function(){return n.width},function(){return n.height},function(){return n.data},function(){return n.options},o],i),Object(y["onMounted"])(r);var u=Object(y["computed"])((function(){var e=[];if(n.themeColor.length>=10)e=n.themeColor;else if(1===n.themeColor.length)e=ee()(n.themeColor[0]).analogous(10).map((function(e){return e.toHexString()}));else{var t=n.themeColor.length,c=ee()(n.themeColor[t-1]).analogous(11-t).map((function(e){return e.toHexString()}));e=[].concat(Object(Q["a"])(n.themeColor.slice(0,t-1)),Object(Q["a"])(c))}return e})),d=function(){if(c.value)for(var e=0;e<10;e++)c.value.style.setProperty("--theme-color-".concat(e+1),u.value[e])};Object(y["watch"])(u,d),Object(y["onMounted"])(d);var s=function(){c.value&&n.gridColor&&c.value.style.setProperty("--grid-color",n.gridColor)};return Object(y["watch"])((function(){return n.gridColor}),s),Object(y["onMounted"])(s),function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"chart",style:Object(y["normalizeStyle"])({flexDirection:"top"===e.legend?"column-reverse":"column"})},[Object(y["createElementVNode"])("div",{class:"chart-content",ref_key:"chartRef",ref:c,style:Object(y["normalizeStyle"])({width:e.width+"px",height:Object(y["unref"])(a)+"px",transform:"scale(".concat(1/Object(y["unref"])(o),")")})},null,4),e.legend?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"legends",style:Object(y["normalizeStyle"])({transform:"scale(".concat(1/Object(y["unref"])(o),")")})},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e.legends,(function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"legend",key:n,style:Object(y["normalizeStyle"])({color:e.gridColor})},[Object(y["createElementVNode"])("div",{class:"block",style:Object(y["normalizeStyle"])({backgroundColor:Object(y["unref"])(u)[n]})},null,4),Object(y["createTextVNode"])(" "+Object(y["toDisplayString"])(t),1)],4)})),128))],4)):Object(y["createCommentVNode"])("",!0)],4)}}}));n("921b"),n("f630");const Za=pn()(Ya,[["__scopeId","data-v-1aa2357d"]]);var Wa=Za,Ja=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))},c=function(){ta.emit(fo.OPEN_CHART_DATA_EDITOR)};return function(t,o){var a=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-chart",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",style:Object(y["normalizeStyle"])({backgroundColor:e.elementInfo.fill}),onMousedown:o[0]||(o[0]=function(e){return n(e)}),onTouchstart:o[1]||(o[1]=function(e){return n(e)}),onDblclick:o[2]||(o[2]=function(e){return c()})},[Object(y["createVNode"])(bo,{width:e.elementInfo.width,height:e.elementInfo.height,outline:e.elementInfo.outline},null,8,["width","height","outline"]),Object(y["createVNode"])(Wa,{width:e.elementInfo.width,height:e.elementInfo.height,type:e.elementInfo.chartType,data:e.elementInfo.data,options:e.elementInfo.options,themeColor:e.elementInfo.themeColor,gridColor:e.elementInfo.gridColor,legends:e.elementInfo.data.legends,legend:e.elementInfo.legend||""},null,8,["width","height","type","data","options","themeColor","gridColor","legends","legend"])],36)),[[a,e.contextmenus]])],4)],6)}}});n("8216");const Ka=pn()(Ja,[["__scopeId","data-v-f3c03862"]]);var Qa=Ka,$a=function(e){if(!e)return{};var t=e.bold,n=e.em,c=e.underline,o=e.strikethrough,a=e.color,l=e.backcolor,r=e.fontsize,i=e.fontname,u=e.align,d="".concat(c?"underline":""," ").concat(o?"line-through":"");return" "===d&&(d="none"),{fontWeight:t?"bold":"normal",fontStyle:n?"italic":"normal",textDecoration:d,color:a||"#000",backgroundColor:l||"",fontSize:r||"14px",fontFamily:i||"微软雅黑",textAlign:u||"left"}},el=function(e){return e.replace(/\n/g,"
").replace(/ /g," ")},tl=function(e){var t=Object(y["computed"])((function(){for(var t=[],n=0;n1||a.rowspan>1)for(var l=n;l=d&&p<=f&&O>=s&&O<=b&&l.push("".concat(p,"_").concat(O));return l}));Object(y["watch"])(k,(function(e,t){Object(te["isEqual"])(e,t)||n("changeSelectedCells",k.value)}));var C=Object(y["computed"])((function(){return k.value.length>1?null:k.value[0]})),N=(Object(y["computed"])((function(){if(!r.value.length)return null;var e=Object(me["a"])(r.value,2),t=e[0],n=e[1];if(!i.value.length)return{row:[t,t],col:[n,n]};var c=Object(me["a"])(i.value,2),o=c[0],a=c[1];if(t===o&&n===a)return{row:[t,t],col:[n,n]};var l=Math.min(t,o),u=Math.min(n,a),d=Math.max(t,o),s=Math.max(n,a);return{row:[l,d],col:[u,s]}})),function(){return l.value=!1}),E=function(e,t,n){0===e.button&&(i.value=[],l.value=!0,r.value=[t,n])},w=function(e,t){l.value&&(i.value=[e,t])};Object(y["onMounted"])((function(){document.addEventListener("mouseup",N)})),Object(y["onUnmounted"])((function(){document.removeEventListener("mouseup",N)}));var I=function(e,t){return h.value.includes("".concat(e,"_").concat(t))},B=function(e){var t=u.value.length-1;r.value=[0,e],i.value=[t,e]},L=function(e){var t=u.value[e].length-1;r.value=[e,0],i.value=[e,t]},_=function(){var e=u.value.length-1,t=u.value[e].length-1;r.value=[0,0],i.value=[e,t]},T=function(e){for(var t=JSON.parse(JSON.stringify(u.value)),n=u.value[e],c=[],o=0;o=0;i--)if(!I(i,r)){t[i][r].rowspan=t[i][r].rowspan-1;break}t.splice(e,1),u.value=t},M=function(e){for(var t=JSON.parse(JSON.stringify(u.value)),c=[],o=0;o=0;i--)if(!I(r,i)){t[r][i].colspan=t[r][i].colspan-1;break}u.value=t.map((function(t){return t.splice(e,1),t})),b.value.splice(e,1),n("changeColWidths",b.value)},D=function(e){for(var t=JSON.parse(JSON.stringify(u.value)),n=[],c=0;cu.value.length&&(l=t+o-u.value.length),c+a>u.value[0].length&&(r=c+a-u.value[0].length),(l||r)&&F(l,r),Object(y["nextTick"])((function(){for(var l=0;l1,n=e[0].length>1;return{canDeleteRow:t,canDeleteCol:n}},W=function(e,t){var n=k.value.length>1,c=u.value[e][t],o=n,a=!n&&(c.rowspan>1||c.colspan>1);return{canMerge:o,canSplit:a}},J=function(e){var t=e.dataset.cellIndex,n=+t.split("_")[0],c=+t.split("_")[1];k.value.includes("".concat(n,"_").concat(c))||(r.value=[n,c],i.value=[]);var o=W(n,c),a=o.canMerge,l=o.canSplit,u=Z(),d=u.canDeleteRow,s=u.canDeleteCol;return[{text:"插入列",children:[{text:"到左侧",handler:function(){return z(c)}},{text:"到右侧",handler:function(){return z(c+1)}}]},{text:"插入行",children:[{text:"到上方",handler:function(){return D(n)}},{text:"到下方",handler:function(){return D(n+1)}}]},{text:"删除列",disable:!s,handler:function(){return M(c)}},{text:"删除行",disable:!d,handler:function(){return T(n)}},{divider:!0},{text:"合并单元格",disable:!a,handler:A},{text:"取消合并单元格",disable:!l,handler:function(){return R(n,c)}},{divider:!0},{text:"选中当前列",handler:function(){return B(c)}},{text:"选中当前行",handler:function(){return L(n)}},{text:"选中全部单元格",handler:_}]};return function(t,n){var c,o,a,l,r,i=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"editable-table",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(p)+"px"})},[e.editable?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",rl,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(O),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"drag-line",key:t,style:Object(y["normalizeStyle"])({left:e+"px"}),onMousedown:function(e){return P(e,t)}},null,44,il)})),128))])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("table",{class:Object(y["normalizeClass"])({theme:Object(y["unref"])(d),"row-header":null===(c=Object(y["unref"])(d))||void 0===c?void 0:c.rowHeader,"row-footer":null===(o=Object(y["unref"])(d))||void 0===o?void 0:o.rowFooter,"col-header":null===(a=Object(y["unref"])(d))||void 0===a?void 0:a.colHeader,"col-footer":null===(l=Object(y["unref"])(d))||void 0===l?void 0:l.colFooter}),style:Object(y["normalizeStyle"])("--themeColor: ".concat(null===(r=Object(y["unref"])(d))||void 0===r?void 0:r.color,"; --subThemeColor1: ").concat(Object(y["unref"])(f)[0],"; --subThemeColor2: ").concat(Object(y["unref"])(f)[1]))},[Object(y["createElementVNode"])("colgroup",null,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(b.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("col",{span:"1",key:t,width:e},null,8,ul)})),128))]),Object(y["createElementVNode"])("tbody",null,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(u),(function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("tr",{key:n},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(t,(function(t,c){return Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("td",{class:Object(y["normalizeClass"])(["cell",{selected:Object(y["unref"])(k).includes("".concat(n,"_").concat(c))&&Object(y["unref"])(k).length>1,active:Object(y["unref"])(C)==="".concat(n,"_").concat(c)}]),style:Object(y["normalizeStyle"])(Object(S["a"])({borderStyle:e.outline.style,borderColor:e.outline.color,borderWidth:e.outline.width+"px"},Object(y["unref"])($a)(t.style))),key:t.id,rowspan:t.rowspan,colspan:t.colspan,"data-cell-index":"".concat(n,"_").concat(c),onMousedown:function(e){return E(e,n,c)},onMouseenter:function(e){return w(n,c)}},[Object(y["unref"])(C)==="".concat(n,"_").concat(c)?(Object(y["openBlock"])(),Object(y["createBlock"])(ll,{key:0,class:Object(y["normalizeClass"])(["cell-text",{active:Object(y["unref"])(C)==="".concat(n,"_").concat(c)}]),value:t.text,onUpdateValue:function(e){return Object(y["unref"])(G)(e,n,c)},onInsertExcelData:function(e){return X(e,n,c)}},null,8,["class","value","onUpdateValue","onInsertExcelData"])):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:1,class:"cell-text",innerHTML:Object(y["unref"])(el)(t.text)},null,8,sl))],46,dl)),[[y["vShow"],!Object(y["unref"])(h).includes("".concat(n,"_").concat(c))],[i,function(e){return J(e)}]])})),128))])})),128))])],6)],4)}}});n("bc8c");const bl=pn()(fl,[["__scopeId","data-v-bae8c794"]]);var pl=bl,ml={class:"element-content"},Ol=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=ie(),c=ae(),o=Object(g["c"])(n),a=o.canvasScale,l=o.handleElementId,r=o.isScaling,i=Object(y["ref"])(),u=at(),d=u.addHistorySnapshot,s=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))},f=Object(y["ref"])(!1);Object(y["watch"])(l,(function(){l.value!==t.elementInfo.id&&(f.value=!1)})),Object(y["watch"])(f,(function(){n.setDisableHotkeysState(f.value)}));var b=function(){t.elementInfo.lock||(f.value=!0)},p=Object(y["ref"])(-1);Object(y["watch"])(r,(function(){l.value===t.elementInfo.id&&(r.value&&(f.value=!1),r.value||-1===p.value||(c.updateElement({id:t.elementInfo.id,props:{height:p.value}}),p.value=-1))}));var m=function(e){var n=e[0].contentRect;if(i.value){var o=n.height;t.elementInfo.height!==o&&(r.value?p.value=o:c.updateElement({id:t.elementInfo.id,props:{height:o}}))}},O=new ResizeObserver(m);Object(y["onMounted"])((function(){i.value&&O.observe(i.value)})),Object(y["onUnmounted"])((function(){i.value&&O.unobserve(i.value)}));var v=function(e){c.updateElement({id:t.elementInfo.id,props:{data:e}}),d()},j=function(e){var n=e.reduce((function(e,t){return e+t})),o=e.map((function(e){return e/n}));c.updateElement({id:t.elementInfo.id,props:{width:n,colWidths:o}}),d()},h=function(e){Object(y["nextTick"])((function(){return n.setSelectedTableCells(e)}))};return function(t,n){var c=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-table",{lock:e.elementInfo.lock}]),ref_key:"elementRef",ref:i,style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ml,[Object(y["createVNode"])(pl,{onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(){}),["stop"])),data:e.elementInfo.data,width:e.elementInfo.width,colWidths:e.elementInfo.colWidths,outline:e.elementInfo.outline,theme:e.elementInfo.theme,editable:f.value,onChange:n[1]||(n[1]=function(e){return v(e)}),onChangeColWidths:n[2]||(n[2]=function(e){return j(e)}),onChangeSelectedCells:n[3]||(n[3]=function(e){return h(e)})},null,8,["data","width","colWidths","outline","theme","editable"]),!f.value||e.elementInfo.lock?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:Object(y["normalizeClass"])(["table-mask",{lock:e.elementInfo.lock}]),onDblclick:n[4]||(n[4]=function(e){return b()}),onMousedown:n[5]||(n[5]=function(e){return s(e)}),onTouchstart:n[6]||(n[6]=function(e){return s(e)})},[Object(y["createElementVNode"])("div",{class:"mask-tip",style:Object(y["normalizeStyle"])({transform:"scale(".concat(1/Object(y["unref"])(a),")")})},"双击编辑",4)],34)):Object(y["createCommentVNode"])("",!0)])),[[c,e.contextmenus]])],4)],6)}}});n("76c1");const vl=pn()(Ol,[["__scopeId","data-v-6391c486"]]);var jl=vl,hl=["width","height","stroke","stroke-width"],yl=["transform"],gl=["d"],xl=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))},c=function(){ta.emit(fo.OPEN_LATEX_EDITOR)};return function(t,o){var a=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-latex",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",onMousedown:o[0]||(o[0]=function(e){return n(e)}),onTouchstart:o[1]||(o[1]=function(e){return n(e)}),onDblclick:o[2]||(o[2]=function(e){return c()})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{overflow:"visible",width:e.elementInfo.width,height:e.elementInfo.height,stroke:e.elementInfo.color,"stroke-width":e.elementInfo.strokeWidth,fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[Object(y["createElementVNode"])("g",{transform:"scale(".concat(e.elementInfo.width/e.elementInfo.viewBox[0],", ").concat(e.elementInfo.height/e.elementInfo.viewBox[1],") translate(0,0) matrix(1,0,0,1,0,0)")},[Object(y["createElementVNode"])("path",{d:e.elementInfo.path},null,8,gl)],8,yl)],8,hl))],32)),[[a,e.contextmenus]])],4)],6)}}});n("0f64");const kl=pn()(xl,[["__scopeId","data-v-31390388"]]);var Cl=kl,Nl=function(e,t){Object(y["onMounted"])((function(){if(t.value){var n="normal";if(/m3u8(#|\?|$)/i.exec(e)?n="hls":/.flv(#|\?|$)/i.exec(e)&&(n="flv"),t.value&&"hls"===n&&(t.value.canPlayType("application/x-mpegURL")||t.value.canPlayType("application/vnd.apple.mpegURL"))&&(n="normal"),"hls"===n){var c=window.Hls;if(c&&c.isSupported()){var o=new c;o.loadSource(e),o.attachMedia(t.value)}}else if("flv"===n){var a=window.flvjs;if(a&&a.isSupported()){var l=a.createPlayer({type:"flv",url:e});l.attachMediaElement(t.value),l.load()}}}}))},El=function(e){return Object(y["pushScopeId"])("data-v-2fc4c202"),e=e(),Object(y["popScopeId"])(),e},wl=["src","poster"],Vl={class:"bezel"},Il=El((function(){return Object(y["createElementVNode"])("div",{class:"controller-mask"},null,-1)})),Bl={class:"controller"},Sl={class:"icons icons-left"},Ll={class:"icon-content"},_l={class:"volume"},Tl={class:"icon-content"},Ml=El((function(){return Object(y["createElementVNode"])("span",{class:"thumb"},null,-1)})),Dl=[Ml],zl={class:"time"},Fl={class:"ptime"},Al=Object(y["createTextVNode"])(" / "),Rl={class:"dtime"},Pl={class:"icons icons-right"},Hl={class:"speed"},ql={class:"icon speed-icon"},Ul=["onClick"],Gl=El((function(){return Object(y["createElementVNode"])("span",{class:"icon-content"},"循环",-1)})),Xl=[Gl],Yl={class:"bar"},Zl=El((function(){return Object(y["createElementVNode"])("span",{class:"thumb"},null,-1)})),Wl=[Zl],Jl=Object(y["defineComponent"])({__name:"index",props:{width:{type:Number,required:!0},height:{type:Number,required:!0},src:{type:String,required:!0},poster:{type:String,default:""},scale:{type:Number,default:1}},setup:function(e){var t=e,n=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0===e||isNaN(e))return"00:00";var t=function(e){return e<10?"0"+e:""+e},n=Math.floor(e/3600),c=Math.floor((e-3600*n)/60),o=Math.floor(e-3600*n-60*c);return(n>0?[n,c,o]:[c,o]).map(t).join(":")},c=function(e){return e.getBoundingClientRect().left},o=Object(y["ref"])(),a=Object(y["ref"])(),l=Object(y["ref"])(),r=Object(y["ref"])(.5),i=Object(y["ref"])(!0),u=Object(y["ref"])(0),d=Object(y["ref"])(0),s=Object(y["ref"])(0),f=Object(y["ref"])(!1),b=Object(y["ref"])(!1),p=Object(y["ref"])(1),m=Object(y["ref"])(!1),O=Object(y["ref"])("00:00"),v=Object(y["ref"])("0"),j=Object(y["computed"])((function(){return n(u.value)})),h=Object(y["computed"])((function(){return n(d.value)})),g=Object(y["computed"])((function(){return u.value/d.value*100+"%"})),x=Object(y["computed"])((function(){return s.value/d.value*100+"%"})),k=Object(y["computed"])((function(){return 100*r.value+"%"})),C=Object(y["ref"])(!1),N=[{label:"2x",value:2},{label:"1.5x",value:1.5},{label:"1.25x",value:1.25},{label:"1x",value:1},{label:"0.75x",value:.75},{label:"0.5x",value:.5}],E=function(e){o.value&&(e=Math.max(e,0),e=Math.min(e,d.value),o.value.currentTime=e,u.value=e)},w=function(){o.value&&(i.value=!1,o.value.play(),b.value=!0)},V=function(){o.value&&(i.value=!0,o.value.pause(),b.value=!0)},I=function(){i.value?w():V()},B=function(e){o.value&&(e=Math.max(e,0),e=Math.min(e,1),o.value.volume=e,r.value=e,o.value.muted&&0!==e&&(o.value.muted=!1))},S=function(e){o.value&&(o.value.playbackRate=e),p.value=e},L=function(){var e;d.value=(null===(e=o.value)||void 0===e?void 0:e.duration)||0},_=function(){var e;u.value=(null===(e=o.value)||void 0===e?void 0:e.currentTime)||0},T=function(){f.value?(E(0),w()):V()},M=function(){var e;s.value=null!==(e=o.value)&&void 0!==e&&e.buffered.length?o.value.buffered.end(o.value.buffered.length-1):0},D=function(){return Se["a"].error("视频加载失败")},z=function(e){if(o.value&&a.value){var t="clientX"in e?e.clientX:e.changedTouches[0].clientX,n=(t-c(a.value))/a.value.clientWidth;n=Math.max(n,0),n=Math.min(n,1);var l=n*d.value;o.value.currentTime=l,u.value=l}},F=function e(t){if(o.value&&a.value){var n="clientX"in t?t.clientX:t.changedTouches[0].clientX,l=(n-c(a.value))/a.value.clientWidth;l=Math.max(l,0),l=Math.min(l,1);var r=l*d.value;o.value.currentTime=r,u.value=r,document.removeEventListener("mousemove",z),document.removeEventListener("touchmove",z),document.removeEventListener("mouseup",e),document.removeEventListener("touchend",e)}},A=function(){document.addEventListener("mousemove",z),document.addEventListener("touchmove",z),document.addEventListener("mouseup",F),document.addEventListener("touchend",F)},R=function(e){if(l.value){var t="clientX"in e?e.clientX:e.changedTouches[0].clientX,n=(t-c(l.value))/45;B(n)}},P=function e(){document.removeEventListener("mousemove",R),document.removeEventListener("touchmove",R),document.removeEventListener("mouseup",e),document.removeEventListener("touchend",e)},H=function(){document.addEventListener("mousemove",R),document.addEventListener("touchmove",R),document.addEventListener("mouseup",P),document.addEventListener("touchend",P)},q=function(e){if(l.value){var t=(e.clientX-c(l.value))/45;B(t)}},U=function(e){if(d.value&&a.value){var t=a.value.getBoundingClientRect().left,c=e.clientX-t;if(c<0||c>a.value.offsetWidth)return;var o=d.value*(c/a.value.offsetWidth);v.value="".concat(c-(o>=3600?25:20),"px"),O.value=n(o),m.value=!0}},G=function(){o.value&&(o.value.muted?(o.value.muted=!1,B(.5)):(o.value.muted=!0,B(0)))},X=function(){f.value=!f.value},Y=Object(y["ref"])(-1),Z=Object(y["ref"])(!1),W=function(){Z.value=!1,clearTimeout(Y.value),Y.value=setTimeout((function(){var e;null!==(e=o.value)&&void 0!==e&&e.played.length&&(Z.value=!0)}),3e3)};return Nl(t.src,o),function(t,n){var c=Object(y["resolveComponent"])("IconPause"),u=Object(y["resolveComponent"])("IconPlayOne"),d=Object(y["resolveComponent"])("IconVolumeMute"),s=Object(y["resolveComponent"])("IconVolumeNotice"),E=Object(y["resolveComponent"])("IconVolumeSmall");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["video-player",{"hide-controller":Z.value}]),style:Object(y["normalizeStyle"])({width:e.width*e.scale+"px",height:e.height*e.scale+"px",transform:"scale(".concat(1/e.scale,")")}),onMousemove:n[22]||(n[22]=function(e){return W()}),onClick:n[23]||(n[23]=function(e){return W()})},[Object(y["createElementVNode"])("div",{class:"video-wrap",onClick:n[8]||(n[8]=function(e){return I()})},[Object(y["createElementVNode"])("video",{class:"video",ref_key:"videoRef",ref:o,src:e.src,poster:e.poster,"webkit-playsinline":"",playsinline:"",onDurationchange:n[0]||(n[0]=function(e){return L()}),onTimeupdate:n[1]||(n[1]=function(e){return _()}),onEnded:n[2]||(n[2]=function(e){return T()}),onProgress:n[3]||(n[3]=function(e){return M()}),onPlay:n[4]||(n[4]=function(e){return W()}),onPause:n[5]||(n[5]=function(e){return W()}),onError:n[6]||(n[6]=function(e){return D()})},null,40,wl),Object(y["createElementVNode"])("div",Vl,[Object(y["createElementVNode"])("span",{class:Object(y["normalizeClass"])(["bezel-icon",{"bezel-transition":b.value}]),onAnimationend:n[7]||(n[7]=function(e){return b.value=!1})},[i.value?(Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:0})):(Object(y["openBlock"])(),Object(y["createBlock"])(u,{key:1}))],34)])]),Il,Object(y["createElementVNode"])("div",Bl,[Object(y["createElementVNode"])("div",Sl,[Object(y["createElementVNode"])("div",{class:"icon play-icon",onClick:n[9]||(n[9]=function(e){return I()})},[Object(y["createElementVNode"])("span",Ll,[i.value?(Object(y["openBlock"])(),Object(y["createBlock"])(u,{key:0})):(Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:1}))])]),Object(y["createElementVNode"])("div",_l,[Object(y["createElementVNode"])("div",{class:"icon volume-icon",onClick:n[10]||(n[10]=function(e){return G()})},[Object(y["createElementVNode"])("span",Tl,[0===r.value?(Object(y["openBlock"])(),Object(y["createBlock"])(d,{key:0})):1===r.value?(Object(y["openBlock"])(),Object(y["createBlock"])(s,{key:1})):(Object(y["openBlock"])(),Object(y["createBlock"])(E,{key:2}))])]),Object(y["createElementVNode"])("div",{class:"volume-bar-wrap",onMousedown:n[11]||(n[11]=function(e){return H()}),onTouchstart:n[12]||(n[12]=function(e){return H()}),onClick:n[13]||(n[13]=function(e){return q(e)})},[Object(y["createElementVNode"])("div",{class:"volume-bar",ref_key:"volumeBarRef",ref:l},[Object(y["createElementVNode"])("div",{class:"volume-bar-inner",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(k)})},Dl,4)],512)],32)]),Object(y["createElementVNode"])("span",zl,[Object(y["createElementVNode"])("span",Fl,Object(y["toDisplayString"])(Object(y["unref"])(j)),1),Al,Object(y["createElementVNode"])("span",Rl,Object(y["toDisplayString"])(Object(y["unref"])(h)),1)])]),Object(y["createElementVNode"])("div",Pl,[Object(y["createElementVNode"])("div",Hl,[Object(y["createElementVNode"])("div",ql,[Object(y["createElementVNode"])("span",{class:"icon-content",onClick:n[14]||(n[14]=function(e){return C.value=!C.value})},"倍速"),C.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"speed-menu",onMouseleave:n[15]||(n[15]=function(e){return C.value=!1})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(N,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["speed-menu-item",{active:e.value===p.value}]),key:e.label,onClick:function(t){return S(e.value)}},Object(y["toDisplayString"])(e.label),11,Ul)})),64))],32)):Object(y["createCommentVNode"])("",!0)])]),Object(y["createElementVNode"])("div",{class:"loop",onClick:n[16]||(n[16]=function(e){return X()})},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["icon loop-icon",{active:f.value}])},Xl,2)])]),Object(y["createElementVNode"])("div",{class:"bar-wrap",ref_key:"playBarWrap",ref:a,onMousedown:n[17]||(n[17]=function(e){return A()}),onTouchstart:n[18]||(n[18]=function(e){return A()}),onMousemove:n[19]||(n[19]=function(e){return U(e)}),onMouseenter:n[20]||(n[20]=function(e){return m.value=!0}),onMouseleave:n[21]||(n[21]=function(e){return m.value=!1})},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["bar-time",{hidden:!m.value}]),style:Object(y["normalizeStyle"])({left:v.value})},Object(y["toDisplayString"])(O.value),7),Object(y["createElementVNode"])("div",Yl,[Object(y["createElementVNode"])("div",{class:"loaded",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(x)})},null,4),Object(y["createElementVNode"])("div",{class:"played",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(g)})},Wl,4)])],544)])],38)}}});n("3696");const Kl=pn()(Jl,[["__scopeId","data-v-2fc4c202"]]);var Ql=Kl,$l=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=function(e){var n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo,n))};return function(t,n){var a=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-video",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",onMousedown:n[2]||(n[2]=function(e){return o(e,!1)}),onTouchstart:n[3]||(n[3]=function(e){return o(e,!1)})},[Object(y["createVNode"])(Ql,{width:e.elementInfo.width,height:e.elementInfo.height,src:e.elementInfo.src,poster:e.elementInfo.poster,scale:Object(y["unref"])(c)},null,8,["width","height","src","poster","scale"]),(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(["t","b","l","r"],(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["handler-border",e]),key:e,onMousedown:n[0]||(n[0]=function(e){return o(e)}),onTouchstart:n[1]||(n[1]=function(e){return o(e)})},null,34)})),64))],32)),[[a,e.contextmenus]])],4)],6)}}});n("679c");const er=pn()($l,[["__scopeId","data-v-9d5469c6"]]);var tr=er,nr=function(e){return Object(y["pushScopeId"])("data-v-121f3d11"),e=e(),Object(y["popScopeId"])(),e},cr=["src","autoplay"],or={class:"controller"},ar={class:"icons"},lr={class:"icon-content"},rr={class:"volume"},ir={class:"icon-content"},ur=nr((function(){return Object(y["createElementVNode"])("span",{class:"thumb"},null,-1)})),dr=[ur],sr={class:"time"},fr={class:"ptime"},br=Object(y["createTextVNode"])(" / "),pr={class:"dtime"},mr={class:"bar"},Or=nr((function(){return Object(y["createElementVNode"])("span",{class:"thumb"},null,-1)})),vr=[Or],jr=Object(y["defineComponent"])({__name:"AudioPlayer",props:{src:{type:String,required:!0},loop:{type:Boolean,required:!0},autoplay:{type:Boolean,default:!1},scale:{type:Number,default:1}},setup:function(e,t){var n=t.expose,c=e,o=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(0===e||isNaN(e))return"00:00";var t=function(e){return e<10?"0"+e:""+e},n=Math.floor(e/3600),c=Math.floor((e-3600*n)/60),o=Math.floor(e-3600*n-60*c);return(n>0?[n,c,o]:[c,o]).map(t).join(":")},a=function(e){return e.getBoundingClientRect().left},l=Object(y["ref"])(),r=Object(y["ref"])(),i=Object(y["ref"])(),u=Object(y["ref"])(.5),d=Object(y["ref"])(!0),s=Object(y["ref"])(0),f=Object(y["ref"])(0),b=Object(y["ref"])(0),p=Object(y["ref"])(!1),m=Object(y["ref"])("00:00"),O=Object(y["ref"])("0"),v=Object(y["computed"])((function(){return o(s.value)})),j=Object(y["computed"])((function(){return o(f.value)})),h=Object(y["computed"])((function(){return s.value/f.value*100+"%"})),g=Object(y["computed"])((function(){return b.value/f.value*100+"%"})),x=Object(y["computed"])((function(){return 100*u.value+"%"})),k=function(e){l.value&&(e=Math.max(e,0),e=Math.min(e,f.value),l.value.currentTime=e,s.value=e)},C=function(){l.value&&(d.value=!1,l.value.play())},N=function(){l.value&&(d.value=!0,l.value.pause())},E=function(){d.value?C():N()},w=function(e){l.value&&(e=Math.max(e,0),e=Math.min(e,1),l.value.volume=e,u.value=e,l.value.muted&&0!==e&&(l.value.muted=!1))},V=function(){var e;f.value=(null===(e=l.value)||void 0===e?void 0:e.duration)||0},I=function(){var e;s.value=(null===(e=l.value)||void 0===e?void 0:e.currentTime)||0},B=function(){d.value=!1},S=function(){c.loop?(k(0),C()):N()},L=function(){var e;b.value=null!==(e=l.value)&&void 0!==e&&e.buffered.length?l.value.buffered.end(l.value.buffered.length-1):0},_=function(){return Se["a"].error("视频加载失败")},T=function(e){if(l.value&&r.value){var t="clientX"in e?e.clientX:e.changedTouches[0].clientX,n=(t-a(r.value))/r.value.clientWidth;n=Math.max(n,0),n=Math.min(n,1);var c=n*f.value;l.value.currentTime=c,s.value=c}},M=function e(t){if(l.value&&r.value){var n="clientX"in t?t.clientX:t.changedTouches[0].clientX,c=(n-a(r.value))/r.value.clientWidth;c=Math.max(c,0),c=Math.min(c,1);var o=c*f.value;l.value.currentTime=o,s.value=o,document.removeEventListener("mousemove",T),document.removeEventListener("touchmove",T),document.removeEventListener("mouseup",e),document.removeEventListener("touchend",e)}},D=function(){document.addEventListener("mousemove",T),document.addEventListener("touchmove",T),document.addEventListener("mouseup",M),document.addEventListener("touchend",M)},z=function(e){if(i.value){var t="clientX"in e?e.clientX:e.changedTouches[0].clientX,n=(t-a(i.value))/45;w(n)}},F=function e(){document.removeEventListener("mousemove",z),document.removeEventListener("touchmove",z),document.removeEventListener("mouseup",e),document.removeEventListener("touchend",e)},A=function(){document.addEventListener("mousemove",z),document.addEventListener("touchmove",z),document.addEventListener("mouseup",F),document.addEventListener("touchend",F)},R=function(e){if(i.value){var t=(e.clientX-a(i.value))/45;w(t)}},P=function(e){if(f.value&&r.value){var t=r.value.getBoundingClientRect().left,n=e.clientX-t;if(n<0||n>r.value.offsetWidth)return;var c=f.value*(n/r.value.offsetWidth);O.value="".concat(n-(c>=3600?25:20),"px"),m.value=o(c),p.value=!0}},H=function(){l.value&&(l.value.muted?(l.value.muted=!1,w(.5)):(l.value.muted=!0,w(0)))};return n({toggle:E}),function(t,n){var c=Object(y["resolveComponent"])("IconPlayOne"),o=Object(y["resolveComponent"])("IconPause"),a=Object(y["resolveComponent"])("IconVolumeMute"),s=Object(y["resolveComponent"])("IconVolumeNotice"),f=Object(y["resolveComponent"])("IconVolumeSmall");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"audio-player",style:Object(y["normalizeStyle"])({transform:"scale(".concat(1/e.scale,")")})},[Object(y["createElementVNode"])("audio",{class:"audio",ref_key:"audioRef",ref:l,src:e.src,autoplay:e.autoplay,onDurationchange:n[0]||(n[0]=function(e){return V()}),onTimeupdate:n[1]||(n[1]=function(e){return I()}),onPlay:n[2]||(n[2]=function(e){return B()}),onEnded:n[3]||(n[3]=function(e){return S()}),onProgress:n[4]||(n[4]=function(e){return L()}),onError:n[5]||(n[5]=function(e){return _()})},null,40,cr),Object(y["createElementVNode"])("div",or,[Object(y["createElementVNode"])("div",ar,[Object(y["createElementVNode"])("div",{class:"icon play-icon",onClick:n[6]||(n[6]=function(e){return E()})},[Object(y["createElementVNode"])("span",lr,[d.value?(Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:0})):(Object(y["openBlock"])(),Object(y["createBlock"])(o,{key:1}))])]),Object(y["createElementVNode"])("div",rr,[Object(y["createElementVNode"])("div",{class:"icon volume-icon",onClick:n[7]||(n[7]=function(e){return H()})},[Object(y["createElementVNode"])("span",ir,[0===u.value?(Object(y["openBlock"])(),Object(y["createBlock"])(a,{key:0})):1===u.value?(Object(y["openBlock"])(),Object(y["createBlock"])(s,{key:1})):(Object(y["openBlock"])(),Object(y["createBlock"])(f,{key:2}))])]),Object(y["createElementVNode"])("div",{class:"volume-bar-wrap",onMousedown:n[8]||(n[8]=function(e){return A()}),onTouchstart:n[9]||(n[9]=function(e){return A()}),onClick:n[10]||(n[10]=function(e){return R(e)})},[Object(y["createElementVNode"])("div",{class:"volume-bar",ref_key:"volumeBarRef",ref:i},[Object(y["createElementVNode"])("div",{class:"volume-bar-inner",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(x)})},dr,4)],512)],32)])]),Object(y["createElementVNode"])("span",sr,[Object(y["createElementVNode"])("span",fr,Object(y["toDisplayString"])(Object(y["unref"])(v)),1),br,Object(y["createElementVNode"])("span",pr,Object(y["toDisplayString"])(Object(y["unref"])(j)),1)]),Object(y["createElementVNode"])("div",{class:"bar-wrap",ref_key:"playBarWrap",ref:r,onMousedown:n[11]||(n[11]=function(e){return D()}),onTouchstart:n[12]||(n[12]=function(e){return D()}),onMousemove:n[13]||(n[13]=function(e){return P(e)}),onMouseenter:n[14]||(n[14]=function(e){return p.value=!0}),onMouseleave:n[15]||(n[15]=function(e){return p.value=!1})},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["bar-time",{hidden:!p.value}]),style:Object(y["normalizeStyle"])({left:O.value})},Object(y["toDisplayString"])(m.value),7),Object(y["createElementVNode"])("div",mr,[Object(y["createElementVNode"])("div",{class:"loaded",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(g)})},null,4),Object(y["createElementVNode"])("div",{class:"played",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(h)})},vr,4)])],544)])],4)}}});n("3929");const hr=pn()(jr,[["__scopeId","data-v-121f3d11"]]);var yr=hr,gr=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},selectElement:{type:Function,required:!0},contextmenus:{type:Function}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=n.handleElementId,a=Object(g["c"])(ae()),l=a.viewportRatio,r=Object(y["computed"])((function(){return Math.min(t.elementInfo.width,t.elementInfo.height)+"px"})),i=Object(y["computed"])((function(){var e=tt,n=tt*l.value,o=280/c.value,a=50/c.value,r=t.elementInfo.width,i=t.elementInfo.height,u=t.elementInfo.left,d=t.elementInfo.top,s=0,f=i;return u+o>=e&&(s=r-o),d+i+a>=n&&(f=-a),{left:s+"px",top:f+"px"}})),u=function(e){t.elementInfo.lock||(e.stopPropagation(),t.selectElement(e,t.elementInfo))};return function(t,n){var a=Object(y["resolveComponent"])("IconVolumeNotice"),l=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["editable-element-audio",{lock:e.elementInfo.lock}]),style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-content",onMousedown:n[1]||(n[1]=function(e){return u(e)}),onTouchstart:n[2]||(n[2]=function(e){return u(e)})},[Object(y["createVNode"])(a,{class:"audio-icon",style:Object(y["normalizeStyle"])({fontSize:Object(y["unref"])(r),color:e.elementInfo.color})},null,8,["style"]),Object(y["unref"])(o)===e.elementInfo.id?(Object(y["openBlock"])(),Object(y["createBlock"])(yr,{key:0,class:"audio-player",style:Object(y["normalizeStyle"])(Object(S["a"])({},Object(y["unref"])(i))),src:e.elementInfo.src,loop:e.elementInfo.loop,scale:Object(y["unref"])(c),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(){}),["stop"]))},null,8,["style","src","loop","scale"])):Object(y["createCommentVNode"])("",!0)],32)),[[l,e.contextmenus]])],4)],6)}}});n("75e6");const xr=pn()(gr,[["__scopeId","data-v-001bfbc4"]]);var kr=xr,Cr=["id"],Nr=Object(y["defineComponent"])({__name:"EditableElement",props:{elementInfo:{type:Object,required:!0},elementIndex:{type:Number,required:!0},isMultiSelect:{type:Boolean,required:!0},selectElement:{type:Function,required:!0},openLinkDialog:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(y["computed"])((function(){var e,n=(e={},Object(pe["a"])(e,Ve.IMAGE,lo),Object(pe["a"])(e,Ve.TEXT,va),Object(pe["a"])(e,Ve.SHAPE,_a),Object(pe["a"])(e,Ve.LINE,Ua),Object(pe["a"])(e,Ve.CHART,Qa),Object(pe["a"])(e,Ve.TABLE,jl),Object(pe["a"])(e,Ve.LATEX,Cl),Object(pe["a"])(e,Ve.VIDEO,tr),Object(pe["a"])(e,Ve.AUDIO,kr),e);return n[t.elementInfo.type]||null})),c=Ot(),o=c.orderElement,a=hc(),l=a.alignElementToCanvas,r=ft(),i=r.combineElements,u=r.uncombineElements,d=st(),s=d.deleteElement,f=dt(),b=f.lockElement,p=f.unlockElement,m=bt(),O=m.copyElement,v=m.pasteElement,j=m.cutElement,h=pt(),g=h.selectAllElement,x=function(){return t.elementInfo.lock?[{text:"解锁",handler:function(){return p(t.elementInfo)}}]:[{text:"剪切",subText:"Ctrl + X",handler:j},{text:"复制",subText:"Ctrl + C",handler:O},{text:"粘贴",subText:"Ctrl + V",handler:v},{divider:!0},{text:"水平居中",handler:function(){return l(C.HORIZONTAL)},children:[{text:"水平垂直居中",handler:function(){return l(C.CENTER)}},{text:"水平居中",handler:function(){return l(C.HORIZONTAL)}},{text:"左对齐",handler:function(){return l(C.LEFT)}},{text:"右对齐",handler:function(){return l(C.RIGHT)}}]},{text:"垂直居中",handler:function(){return l(C.VERTICAL)},children:[{text:"水平垂直居中",handler:function(){return l(C.CENTER)}},{text:"垂直居中",handler:function(){return l(C.VERTICAL)}},{text:"顶部对齐",handler:function(){return l(C.TOP)}},{text:"底部对齐",handler:function(){return l(C.BOTTOM)}}]},{divider:!0},{text:"置于顶层",disable:t.isMultiSelect&&!t.elementInfo.groupId,handler:function(){return o(t.elementInfo,k.TOP)},children:[{text:"置于顶层",handler:function(){return o(t.elementInfo,k.TOP)}},{text:"上移一层",handler:function(){return o(t.elementInfo,k.UP)}}]},{text:"置于底层",disable:t.isMultiSelect&&!t.elementInfo.groupId,handler:function(){return o(t.elementInfo,k.BOTTOM)},children:[{text:"置于底层",handler:function(){return o(t.elementInfo,k.BOTTOM)}},{text:"下移一层",handler:function(){return o(t.elementInfo,k.DOWN)}}]},{divider:!0},{text:"设置链接",handler:t.openLinkDialog},{text:t.elementInfo.groupId?"取消组合":"组合",subText:"Ctrl + G",handler:t.elementInfo.groupId?u:i,hide:!t.isMultiSelect},{text:"全选",subText:"Ctrl + A",handler:g},{text:"锁定",subText:"Ctrl + L",handler:b},{text:"删除",subText:"Delete",handler:s}]};return function(t,c){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"editable-element",ref:"elementRef",id:"editable-element-".concat(e.elementInfo.id),style:Object(y["normalizeStyle"])({zIndex:e.elementIndex})},[(Object(y["openBlock"])(),Object(y["createBlock"])(Object(y["resolveDynamicComponent"])(Object(y["unref"])(n)),{elementInfo:e.elementInfo,selectElement:e.selectElement,contextmenus:x},null,8,["elementInfo","selectElement"]))],12,Cr)}}});const Er=Nr;var wr=Er,Vr=Object(y["defineComponent"])({__name:"MouseSelection",props:{top:{type:Number,required:!0},left:{type:Number,required:!0},width:{type:Number,required:!0},height:{type:Number,required:!0},quadrant:{type:Number,required:!0,validator:function(e){return[1,2,3,4].includes(e)}}},setup:function(e){return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])("mouse-selection quadrant-".concat(e.quadrant)),style:Object(y["normalizeStyle"])({top:e.top+"px",left:e.left+"px",width:e.width+"px",height:e.height+"px"})},null,6)}}});n("4b9a");const Ir=pn()(Vr,[["__scopeId","data-v-0d6c0f73"]]);var Br=Ir,Sr={class:"grid-lines"},Lr=["d","stroke"],_r=Object(y["defineComponent"])({__name:"GridLines",setup:function(e){var t=Object(g["c"])(ie()),n=t.canvasScale,c=Object(g["c"])(ae()),o=c.currentSlide,a=c.viewportRatio,l=Object(y["computed"])((function(){var e;return null===(e=o.value)||void 0===e?void 0:e.background})),r=Object(y["computed"])((function(){var e,t=(null===(e=l.value)||void 0===e?void 0:e.color)||"#fff",n=["#000","#fff"];return ee.a.mostReadable(t,n,{includeFallbackColors:!0}).setAlpha(.5).toRgbString()})),i=50,u=function(){for(var e=tt,t=tt*a.value,n="",c=0;c<=Math.floor(t/i);c++)n+="M0 ".concat(c*i," L").concat(e," ").concat(c*i," ");for(var o=0;o<=Math.floor(e/i);o++)n+="M".concat(o*i," 0 L").concat(o*i," ").concat(t," ");return n},d=u();return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",Sr,[Object(y["createElementVNode"])("path",{style:Object(y["normalizeStyle"])({transform:"scale(".concat(Object(y["unref"])(n),")")}),d:Object(y["unref"])(d),fill:"none",stroke:Object(y["unref"])(r),"stroke-width":"0.3","stroke-dasharray":"5"},null,12,Lr)])}}});n("15d9");const Tr=pn()(_r,[["__scopeId","data-v-10cd6d44"]]);var Mr=Tr,Dr=function(e){var t=Object(y["computed"])((function(){if(!e.value)return{backgroundColor:"#fff"};var t=e.value,n=t.type,c=t.color,o=t.image,a=t.imageSize,l=t.gradientColor,r=t.gradientRotate,i=t.gradientType;if("solid"===n)return{backgroundColor:c};if("image"===n)return o?"repeat"===a?{backgroundImage:"url(".concat(o),backgroundRepeat:"repeat",backgroundSize:"contain"}:{backgroundImage:"url(".concat(o),backgroundRepeat:"no-repeat",backgroundSize:a||"cover"}:{backgroundColor:"#fff"};if("gradient"===n){var u=r||0,d=l?l[0]:"#fff",s=l?l[1]:"#fff";return"radial"===i?{backgroundImage:"radial-gradient(".concat(d,", ").concat(s)}:{backgroundImage:"linear-gradient(".concat(u,"deg, ").concat(d,", ").concat(s)}}return{backgroundColor:"#fff"}}));return{backgroundStyle:t}},zr=Object(y["defineComponent"])({__name:"ViewportBackground",setup:function(e){var t=Object(g["c"])(ie()),n=t.showGridLines,c=Object(g["c"])(ae()),o=c.currentSlide,a=Object(y["computed"])((function(){var e;return null===(e=o.value)||void 0===e?void 0:e.background})),l=Dr(a),r=l.backgroundStyle;return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"viewport-background",style:Object(y["normalizeStyle"])(Object(y["unref"])(r))},[Object(y["unref"])(n)?(Object(y["openBlock"])(),Object(y["createBlock"])(Mr,{key:0})):Object(y["createCommentVNode"])("",!0)],4)}}});n("258f");const Fr=pn()(zr,[["__scopeId","data-v-6f1e1261"]]);var Ar=Fr,Rr=Object(y["defineComponent"])({__name:"AlignmentLine",props:{type:{type:String,required:!0},axis:{type:Object,required:!0},length:{type:Number,required:!0},canvasScale:{type:Number,required:!0}},setup:function(e){var t=e,n=Object(y["computed"])((function(){return t.axis.x*t.canvasScale+"px"})),c=Object(y["computed"])((function(){return t.axis.y*t.canvasScale+"px"})),o=Object(y["computed"])((function(){return"vertical"===t.type?{height:t.length*t.canvasScale+"px"}:{width:t.length*t.canvasScale+"px"}}));return function(t,a){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"alignment-line",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(n),top:Object(y["unref"])(c)})},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["line",e.type]),style:Object(y["normalizeStyle"])(Object(y["unref"])(o))},null,6)],4)}}});n("5688");const Pr=pn()(Rr,[["__scopeId","data-v-37fa6068"]]);var Hr=Pr,qr={class:"ruler"},Ur=Object(y["defineComponent"])({__name:"Ruler",props:{viewportStyles:{type:Object,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return t.viewportStyles.width*c.value/10}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",qr,[Object(y["createElementVNode"])("div",{class:"h",style:Object(y["normalizeStyle"])({width:e.viewportStyles.width*Object(y["unref"])(c)+"px",left:e.viewportStyles.left+"px"})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(10,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["ruler-marker-100",{hide:Object(y["unref"])(o)<36,omit:Object(y["unref"])(o)<72}]),key:"marker-100-".concat(e)},[Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(100*e),1)],2)})),64))],4),Object(y["createElementVNode"])("div",{class:"v",style:Object(y["normalizeStyle"])({height:e.viewportStyles.height*Object(y["unref"])(c)+"px",top:e.viewportStyles.top+"px"})},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(10,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["ruler-marker-100",{hide:Object(y["unref"])(o)<36,omit:Object(y["unref"])(o)<72}]),key:e,style:Object(y["normalizeStyle"])({height:Object(y["unref"])(o)+"px"})},[Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(100*e),1)],6)})),64))],4)])}}});n("9854");const Gr=pn()(Ur,[["__scopeId","data-v-60e06332"]]);var Xr=Gr,Yr=["width","height"],Zr=["d"],Wr=Object(y["defineComponent"])({__name:"ElementCreateSelection",emits:["created"],setup:function(e,t){var n=t.emit,c=ie(),o=Object(g["c"])(c),a=o.creatingElement,l=Object(g["c"])(ke()),r=l.ctrlOrShiftKeyActive,i=Object(y["ref"])(),u=Object(y["ref"])(),d=Object(y["ref"])(),s=Object(y["ref"])({x:0,y:0});Object(y["onMounted"])((function(){if(d.value){var e=d.value.getBoundingClientRect(),t=e.x,n=e.y;s.value={x:t,y:n}}}));var f=function(e){var t=!0,o=e.pageX,l=e.pageY;i.value=[o,l],document.onmousemove=function(e){if(a.value&&t){var n=e.pageX,c=e.pageY;if(r.value){var i=n-o,d=c-l,s=Math.abs(i),f=Math.abs(d);if("shape"===a.value.type){var b=d>0&&i<0||d<0&&i>0;s>f?c=b?l-i:l+i:n=b?o-d:o+d}else"line"===a.value.type&&(s>f?c=l:n=o)}u.value=[n,c]}},document.onmouseup=function(e){var r,d;if(document.onmousemove=null,document.onmouseup=null,2!==e.button){t=!1;var s=e.pageX,f=e.pageY,b=30;if("line"===(null===(r=a.value)||void 0===r?void 0:r.type)&&(Math.abs(s-o)>=b||Math.abs(f-l)>=b))n("created",{start:i.value,end:u.value});else if("line"!==(null===(d=a.value)||void 0===d?void 0:d.type)&&Math.abs(s-o)>=b&&Math.abs(f-l)>=b)n("created",{start:i.value,end:u.value});else{var p=200,m=Math.min(s,o),O=Math.min(f,l),v=Math.max(s,o),j=Math.max(f,l),h=v-m>=b?v-m:p,y=j-O>=b?j-O:p;n("created",{start:[m,O],end:[m+h,O+y]})}}else setTimeout((function(){return c.setCreatingElement(null)}),0)}},b=Object(y["computed"])((function(){if(!i.value||!u.value)return null;if(!a.value||"line"!==a.value.type)return null;var e=Object(me["a"])(i.value,2),t=e[0],n=e[1],c=Object(me["a"])(u.value,2),o=c[0],l=c[1],r=Math.min(t,o),d=Math.max(t,o),s=Math.min(n,l),f=Math.max(n,l),b=d-r>=24?d-r:24,p=f-s>=24?f-s:24,m=t===r?0:d-r,O=n===s?0:f-s,v=o===r?0:d-r,j=l===s?0:f-s,h="M".concat(m,", ").concat(O," L").concat(v,", ").concat(j);return{svgWidth:b,svgHeight:p,startX:m,startY:O,endX:v,endY:j,path:h}})),p=Object(y["computed"])((function(){if(!i.value||!u.value)return{};var e=Object(me["a"])(i.value,2),t=e[0],n=e[1],c=Object(me["a"])(u.value,2),o=c[0],a=c[1],l=Math.min(t,o),r=Math.max(t,o),d=Math.min(n,a),f=Math.max(n,a),b=r-l,p=f-d;return{left:l-s.value.x+"px",top:d-s.value.y+"px",width:b+"px",height:p+"px"}}));return function(e,t){var n,c;return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"element-create-selection",ref_key:"selectionRef",ref:d,onMousedown:t[0]||(t[0]=Object(y["withModifiers"])((function(e){return f(e)}),["stop"])),onContextmenu:t[1]||(t[1]=Object(y["withModifiers"])((function(){}),["stop","prevent"]))},[i.value&&u.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:Object(y["normalizeClass"])(["selection",null===(n=Object(y["unref"])(a))||void 0===n?void 0:n.type]),style:Object(y["normalizeStyle"])(Object(y["unref"])(p))},["line"===(null===(c=Object(y["unref"])(a))||void 0===c?void 0:c.type)&&Object(y["unref"])(b)?(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{key:0,overflow:"visible",width:Object(y["unref"])(b).svgWidth,height:Object(y["unref"])(b).svgHeight},[Object(y["createElementVNode"])("path",{d:Object(y["unref"])(b).path,stroke:"#d14424",fill:"none","stroke-width":"2"},null,8,Zr)],8,Yr)):Object(y["createCommentVNode"])("",!0)],6)):Object(y["createCommentVNode"])("",!0)],544)}}});n("7aed");const Jr=pn()(Wr,[["__scopeId","data-v-5a941f07"]]);var Kr=Jr,Qr=function(e,t){var n=Object(y["computed"])((function(){return[{direction:E.LEFT_TOP,style:{}},{direction:E.TOP,style:{left:e.value/2+"px"}},{direction:E.RIGHT_TOP,style:{left:e.value+"px"}},{direction:E.LEFT,style:{top:t.value/2+"px"}},{direction:E.RIGHT,style:{left:e.value+"px",top:t.value/2+"px"}},{direction:E.LEFT_BOTTOM,style:{top:t.value+"px"}},{direction:E.BOTTOM,style:{left:e.value/2+"px",top:t.value+"px"}},{direction:E.RIGHT_BOTTOM,style:{left:e.value+"px",top:t.value+"px"}}]})),c=Object(y["computed"])((function(){return[{direction:E.LEFT,style:{top:t.value/2+"px"}},{direction:E.RIGHT,style:{left:e.value+"px",top:t.value/2+"px"}}]})),o=Object(y["computed"])((function(){return[{type:N.T,style:{width:e.value+"px"}},{type:N.B,style:{top:t.value+"px",width:e.value+"px"}},{type:N.L,style:{height:t.value+"px"}},{type:N.R,style:{left:e.value+"px",height:t.value+"px"}}]}));return{resizeHandlers:n,textElementResizeHandlers:c,borderLines:o}},$r=Object(y["defineComponent"])({__name:"ResizeHandler",props:{type:{type:String,default:""},rotate:{type:Number,default:0}},setup:function(e){var t=e,n=Object(y["computed"])((function(){var e="rotate-",n=t.rotate;return n>-22.5&&n<=22.5?e+0:n>22.5&&n<=67.5?e+45:n>67.5&&n<=112.5?e+90:n>112.5&&n<=157.5?e+135:n>157.5||n<=-157.5?e+0:n>-157.5&&n<=-112.5?e+45:n>-112.5&&n<=-67.5?e+90:n>-67.5&&n<=-22.5?e+135:e+0}));return function(t,c){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["resize-handler",Object(y["unref"])(n),e.type])},null,2)}}});n("b510");const ei=pn()($r,[["__scopeId","data-v-881ee3f8"]]);var ti=ei,ni=Object(y["defineComponent"])({__name:"BorderLine",props:{type:{type:String,required:!0},isWide:{type:Boolean,default:!1}},setup:function(e){return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["border-line",e.type,{wide:e.isWide}])},null,2)}}});n("2460");const ci=pn()(ni,[["__scopeId","data-v-7170d1be"]]);var oi=ci,ai=Object(y["defineComponent"])({__name:"MultiSelectOperate",props:{elementList:{type:Array,required:!0},scaleMultiElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.activeElementIdList,o=n.canvasScale,a=Object(y["computed"])((function(){return t.elementList.filter((function(e){return c.value.includes(e.id)}))})),l=Object(y["ref"])({minX:0,maxX:0,minY:0,maxY:0}),r=Object(y["computed"])((function(){return(l.value.maxX-l.value.minX)*o.value})),i=Object(y["computed"])((function(){return(l.value.maxY-l.value.minY)*o.value})),u=Qr(r,i),d=u.resizeHandlers,s=u.borderLines,f=function(){var e=Xe(a.value),t=e.minX,n=e.maxX,c=e.minY,o=e.maxY;l.value={minX:t,maxX:n,minY:c,maxY:o}};Object(y["watchEffect"])(f);var b=Object(y["computed"])((function(){return a.value.some((function(e){return!!("image"!==e.type&&"shape"!==e.type||e.rotate)}))}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"multi-select-operate",style:Object(y["normalizeStyle"])({left:l.value.minX*Object(y["unref"])(o)+"px",top:l.value.minY*Object(y["unref"])(o)+"px"})},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(s),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),Object(y["unref"])(b)?Object(y["createCommentVNode"])("",!0):(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],{key:0},Object(y["renderList"])(Object(y["unref"])(d),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{key:t.direction,type:t.direction,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleMultiElement(n,l.value,t.direction)}),["stop"])},null,8,["type","style","onMousedown"])})),128))],4)}}});n("a669");const li=pn()(ai,[["__scopeId","data-v-defbd922"]]);var ri=li,ii={class:"rotate-handler"};function ui(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ii)}n("1ebd");const di={},si=pn()(di,[["render",ui],["__scopeId","data-v-b99d8dae"]]);var fi=si,bi={inheritAttrs:!1},pi=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},bi),{},{__name:"ImageElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=n.clipingImageElementId,a=Object(y["computed"])((function(){return o.value===t.elementInfo.id})),l=Object(y["computed"])((function(){return t.elementInfo.width*c.value})),r=Object(y["computed"])((function(){return t.elementInfo.height*c.value})),i=Qr(l,r),u=i.resizeHandlers,d=i.borderLines;return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["image-element-operate",{cliping:Object(y["unref"])(a)}])},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(d),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{class:"operate-border-line",key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(u),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.direction,type:t.direction,rotate:e.elementInfo.rotate,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleElement(n,e.elementInfo,t.direction)}),["stop"])},null,8,["type","rotate","style","onMousedown"])})),128)),Object(y["createVNode"])(fi,{class:"operate-rotate-handler",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(l)/2+"px"}),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(t){return e.rotateElement(e.elementInfo)}),["stop"]))},null,8,["style"])],64)):Object(y["createCommentVNode"])("",!0)],2)}}}));n("ae9f");const mi=pn()(pi,[["__scopeId","data-v-46b250c2"]]);var Oi=mi,vi={class:"text-element-operate"},ji={inheritAttrs:!1},hi=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},ji),{},{__name:"TextElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return t.elementInfo.width*c.value})),a=Object(y["computed"])((function(){return t.elementInfo.height*c.value})),l=Qr(o,a),r=l.textElementResizeHandlers,i=l.borderLines;return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",vi,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(i),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{class:"operate-border-line",key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(r),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.direction,type:t.direction,rotate:e.elementInfo.rotate,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleElement(n,e.elementInfo,t.direction)}),["stop"])},null,8,["type","rotate","style","onMousedown"])})),128)),Object(y["createVNode"])(fi,{class:"operate-rotate-handler",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(o)/2+"px"}),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(t){return e.rotateElement(e.elementInfo)}),["stop"]))},null,8,["style"])],64)):Object(y["createCommentVNode"])("",!0)])}}}));const yi=hi;var gi=yi,xi={class:"shape-element-operate"},ki={inheritAttrs:!1},Ci=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},ki),{},{__name:"ShapeElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0},moveShapeKeypoint:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return t.elementInfo.width*c.value})),a=Object(y["computed"])((function(){return t.elementInfo.height*c.value})),l=Qr(o,a),r=l.resizeHandlers,i=l.borderLines,u=Object(y["computed"])((function(){if(!t.elementInfo.pathFormula||!t.elementInfo.keypoint)return{};var e=nt[t.elementInfo.pathFormula];if("editable"in e){var n=e.getBaseSize(t.elementInfo.width,t.elementInfo.height)*t.elementInfo.keypoint;if("left"===e.relative)return{left:n*c.value+"px"};if("right"===e.relative)return{left:(t.elementInfo.width-n)*c.value+"px"};if("center"===e.relative)return{left:(t.elementInfo.width-n)/2*c.value+"px"};if("top"===e.relative)return{top:n*c.value+"px"};if("bottom"===e.relative)return{top:(t.elementInfo.height-n)*c.value+"px"}}return{}}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",xi,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(i),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{class:"operate-border-line",key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(r),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.direction,type:t.direction,rotate:e.elementInfo.rotate,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleElement(n,e.elementInfo,t.direction)}),["stop"])},null,8,["type","rotate","style","onMousedown"])})),128)),Object(y["createVNode"])(fi,{class:"operate-rotate-handler",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(o)/2+"px"}),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(t){return e.rotateElement(e.elementInfo)}),["stop"]))},null,8,["style"]),void 0!==e.elementInfo.keypoint?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"operate-keypoint-handler",style:Object(y["normalizeStyle"])(Object(y["unref"])(u)),onMousedown:n[1]||(n[1]=Object(y["withModifiers"])((function(t){return e.moveShapeKeypoint(t,e.elementInfo)}),["stop"]))},null,36)):Object(y["createCommentVNode"])("",!0)],64)):Object(y["createCommentVNode"])("",!0)])}}}));n("614e");const Ni=pn()(Ci,[["__scopeId","data-v-fd38df18"]]);var Ei=Ni,wi={class:"line-element-operate"},Vi=["width","height","stroke"],Ii={key:0},Bi=["x1","y1","x2","y2"],Si=["x1","y1","x2","y2"],Li=["x1","y1","x2","y2"],_i=["x1","y1","x2","y2"],Ti={inheritAttrs:!1},Mi=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},Ti),{},{__name:"LineElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},dragLineElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return Math.max(t.elementInfo.start[0],t.elementInfo.end[0])})),a=Object(y["computed"])((function(){return Math.max(t.elementInfo.start[1],t.elementInfo.end[1])})),l=Object(y["computed"])((function(){var e=[{handler:w.START,style:{left:t.elementInfo.start[0]*c.value+"px",top:t.elementInfo.start[1]*c.value+"px"}},{handler:w.END,style:{left:t.elementInfo.end[0]*c.value+"px",top:t.elementInfo.end[1]*c.value+"px"}}];if(t.elementInfo.curve||t.elementInfo.broken){var n=t.elementInfo.curve||t.elementInfo.broken;e.push({handler:w.C,style:{left:n[0]*c.value+"px",top:n[1]*c.value+"px"}})}else if(t.elementInfo.cubic){var o=Object(me["a"])(t.elementInfo.cubic,2),a=o[0],l=o[1];e.push({handler:w.C1,style:{left:a[0]*c.value+"px",top:a[1]*c.value+"px"}}),e.push({handler:w.C2,style:{left:l[0]*c.value+"px",top:l[1]*c.value+"px"}})}return e}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",wi,[e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(l),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.handler,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.dragLineElement(n,e.elementInfo,t.handler)}),["stop"])},null,8,["style","onMousedown"])})),128)),(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{width:Object(y["unref"])(o)||1,height:Object(y["unref"])(a)||1,stroke:e.elementInfo.color,overflow:"visible",style:Object(y["normalizeStyle"])({transform:"scale(".concat(Object(y["unref"])(c),")")})},[e.elementInfo.curve?(Object(y["openBlock"])(),Object(y["createElementBlock"])("g",Ii,[Object(y["createElementVNode"])("line",{class:"anchor-line",x1:e.elementInfo.start[0],y1:e.elementInfo.start[1],x2:e.elementInfo.curve[0],y2:e.elementInfo.curve[1]},null,8,Bi),Object(y["createElementVNode"])("line",{class:"anchor-line",x1:e.elementInfo.end[0],y1:e.elementInfo.end[1],x2:e.elementInfo.curve[0],y2:e.elementInfo.curve[1]},null,8,Si)])):Object(y["createCommentVNode"])("",!0),e.elementInfo.cubic?(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],{key:1},Object(y["renderList"])(e.elementInfo.cubic,(function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("g",{key:n},[0===n?(Object(y["openBlock"])(),Object(y["createElementBlock"])("line",{key:0,class:"anchor-line",x1:e.elementInfo.start[0],y1:e.elementInfo.start[1],x2:t[0],y2:t[1]},null,8,Li)):Object(y["createCommentVNode"])("",!0),1===n?(Object(y["openBlock"])(),Object(y["createElementBlock"])("line",{key:1,class:"anchor-line",x1:e.elementInfo.end[0],y1:e.elementInfo.end[1],x2:t[0],y2:t[1]},null,8,_i)):Object(y["createCommentVNode"])("",!0)])})),128)):Object(y["createCommentVNode"])("",!0)],12,Vi))],64)):Object(y["createCommentVNode"])("",!0)])}}}));n("fac9");const Di=pn()(Mi,[["__scopeId","data-v-4659f395"]]);var zi=Di,Fi={class:"table-element-operate"},Ai={inheritAttrs:!1},Ri=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},Ai),{},{__name:"TableElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return t.elementInfo.outline.width||1})),a=Object(y["computed"])((function(){return(t.elementInfo.width+o.value)*c.value})),l=Object(y["computed"])((function(){return t.elementInfo.height*c.value})),r=Qr(a,l),i=r.textElementResizeHandlers,u=r.borderLines;return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Fi,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(u),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{class:"operate-border-line",key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(i),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.direction,type:t.direction,rotate:e.elementInfo.rotate,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleElement(n,e.elementInfo,t.direction)}),["stop"])},null,8,["type","rotate","style","onMousedown"])})),128)),Object(y["createVNode"])(fi,{class:"operate-rotate-handler",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(a)/2+"px"}),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(t){return e.rotateElement(e.elementInfo)}),["stop"]))},null,8,["style"])],64)):Object(y["createCommentVNode"])("",!0)])}}}));const Pi=Ri;var Hi=Pi,qi={class:"common-element-operate"},Ui={inheritAttrs:!1},Gi=Object(y["defineComponent"])(Object(S["a"])(Object(S["a"])({},Ui),{},{__name:"CommonElementOperate",props:{elementInfo:{type:Object,required:!0},handlerVisible:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Object(y["computed"])((function(){return t.elementInfo.width*c.value})),a=Object(y["computed"])((function(){return t.elementInfo.height*c.value})),l=Qr(o,a),r=l.resizeHandlers,i=l.borderLines,u=Object(y["computed"])((function(){return["video","audio"].includes(t.elementInfo.type)}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",qi,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(i),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(oi,{class:"operate-border-line",key:e.type,type:e.type,style:Object(y["normalizeStyle"])(e.style)},null,8,["type","style"])})),128)),e.handlerVisible?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(r),(function(t){return Object(y["openBlock"])(),Object(y["createBlock"])(ti,{class:"operate-resize-handler",key:t.direction,type:t.direction,rotate:e.elementInfo.rotate,style:Object(y["normalizeStyle"])(t.style),onMousedown:Object(y["withModifiers"])((function(n){return e.scaleElement(n,e.elementInfo,t.direction)}),["stop"])},null,8,["type","rotate","style","onMousedown"])})),128)),Object(y["unref"])(u)?Object(y["createCommentVNode"])("",!0):(Object(y["openBlock"])(),Object(y["createBlock"])(fi,{key:0,class:"operate-rotate-handler",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(o)/2+"px"}),onMousedown:n[0]||(n[0]=Object(y["withModifiers"])((function(t){return e.rotateElement(e.elementInfo)}),["stop"]))},null,8,["style"]))],64)):Object(y["createCommentVNode"])("",!0)])}}}));const Xi=Gi;var Yi=Xi,Zi=function(){var e=ae(),t=at(),n=t.addHistorySnapshot,c=function(t,c){var o=/^(https?):\/\/[\w\-]+(\.[\w\-]+)+([\w\-.,@?^=%&:\/~+#]*[\w\-@?^=%&\/~+#])?$/;if("web"===c.type&&!o.test(c.target))return Se["a"].error("不是正确的网页链接地址"),!1;var a={link:c};return e.updateElement({id:t.id,props:a}),n(),!0},o=function(t){e.removeElementProps({id:t.id,propName:"link"}),n()};return{setLink:c,removeLink:o}},Wi=["href"],Ji={key:1,class:"link"},Ki={class:"btns"},Qi=Object(y["defineComponent"])({__name:"LinkHandler",props:{elementInfo:{type:Object,required:!0},link:{type:Object,required:!0},openLinkDialog:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=Zi(),a=o.removeLink,l=Object(y["computed"])((function(){return"line"===t.elementInfo.type?0:t.elementInfo.height}));return function(t,n){var o=Object(y["resolveComponent"])("Divider");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"link-handler",style:Object(y["normalizeStyle"])({top:Object(y["unref"])(l)*Object(y["unref"])(c)+10+"px"})},["web"===e.link.type?(Object(y["openBlock"])(),Object(y["createElementBlock"])("a",{key:0,class:"link",href:e.link.target,target:"_blank"},Object(y["toDisplayString"])(e.link.target),9,Wi)):(Object(y["openBlock"])(),Object(y["createElementBlock"])("a",Ji,"幻灯片页面 "+Object(y["toDisplayString"])(e.link.target),1)),Object(y["createElementVNode"])("div",Ki,[Object(y["createElementVNode"])("div",{class:"btn",onClick:n[0]||(n[0]=function(t){return e.openLinkDialog()})},"更换"),Object(y["createVNode"])(o,{type:"vertical"}),Object(y["createElementVNode"])("div",{class:"btn",onClick:n[1]||(n[1]=function(t){return Object(y["unref"])(a)(e.elementInfo)})},"移除")])],4)}}});n("7851");const $i=pn()(Qi,[["__scopeId","data-v-bb722fc0"]]);var eu=$i,tu={key:1,class:"animation-index"},nu=Object(y["defineComponent"])({__name:"index",props:{elementInfo:{type:Object,required:!0},isSelected:{type:Boolean,required:!0},isActive:{type:Boolean,required:!0},isActiveGroupElement:{type:Boolean,required:!0},isMultiSelect:{type:Boolean,required:!0},rotateElement:{type:Function,required:!0},scaleElement:{type:Function,required:!0},dragLineElement:{type:Function,required:!0},moveShapeKeypoint:{type:Function,required:!0},openLinkDialog:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ie()),c=n.canvasScale,o=n.toolbarState,a=Object(g["c"])(ae()),l=a.formatedAnimations,r=Object(y["computed"])((function(){var e,n=(e={},Object(pe["a"])(e,Ve.IMAGE,Oi),Object(pe["a"])(e,Ve.TEXT,gi),Object(pe["a"])(e,Ve.SHAPE,Ei),Object(pe["a"])(e,Ve.LINE,zi),Object(pe["a"])(e,Ve.TABLE,Hi),Object(pe["a"])(e,Ve.CHART,Yi),Object(pe["a"])(e,Ve.LATEX,Yi),Object(pe["a"])(e,Ve.VIDEO,Yi),Object(pe["a"])(e,Ve.AUDIO,Yi),e);return n[t.elementInfo.type]||null})),i=Object(y["computed"])((function(){for(var e=[],n=0;n0?de("-"):e.deltaY<0&&de("+"):e.deltaY>0?se(V.DOWN):e.deltaY<0&&se(V.UP)},be=function(){t.setGridLinesState(!r.value)},pe=function(){t.setRulerState(!i.value)},me=jc(O),Oe=me.insertElementFromCreateSelection,ve=function(){return[{text:"粘贴",subText:"Ctrl + V",handler:Q},{text:"全选",subText:"Ctrl + A",handler:Z},{text:"网格线",subText:r.value?"√":"",handler:be},{text:"标尺",subText:i.value?"√":"",handler:pe},{text:"重置当前页",handler:J},{divider:!0},{text:"幻灯片放映",subText:"F5",handler:ee}]};return Object(y["provide"])(tc,d),function(e,t){var n=Object(y["resolveComponent"])("Modal"),l=Object(y["resolveDirective"])("contextmenu"),r=Object(y["resolveDirective"])("click-outside");return Object(y["withDirectives"])((Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"canvas",ref_key:"canvasRef",ref:C,onWheel:t[3]||(t[3]=function(e){return fe(e)}),onMousedown:t[4]||(t[4]=function(e){return oe(e)})},[Object(y["unref"])(u)?(Object(y["openBlock"])(),Object(y["createBlock"])(Kr,{key:0,onCreated:t[0]||(t[0]=function(e){return Object(y["unref"])(Oe)(e)})})):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",{class:"viewport-wrapper",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(w).width*Object(y["unref"])(d)+"px",height:Object(y["unref"])(w).height*Object(y["unref"])(d)+"px",left:Object(y["unref"])(w).left+"px",top:Object(y["unref"])(w).top+"px"})},[Object(y["createElementVNode"])("div",jd,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(v.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createBlock"])(Hr,{key:t,type:e.type,axis:e.axis,length:e.length,canvasScale:Object(y["unref"])(d)},null,8,["type","axis","length","canvasScale"])})),128)),Object(y["unref"])(c).length>1?(Object(y["openBlock"])(),Object(y["createBlock"])(ri,{key:0,elementList:x.value,scaleMultiElement:Object(y["unref"])(H)},null,8,["elementList","scaleMultiElement"])):Object(y["createCommentVNode"])("",!0),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(x.value,(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(ou,{key:e.id,elementInfo:e,isSelected:Object(y["unref"])(c).includes(e.id),isActive:Object(y["unref"])(a)===e.id,isActiveGroupElement:Object(y["unref"])(o)===e.id,isMultiSelect:Object(y["unref"])(c).length>1,rotateElement:Object(y["unref"])(U),scaleElement:Object(y["unref"])(P),openLinkDialog:h,dragLineElement:Object(y["unref"])(z),moveShapeKeypoint:Object(y["unref"])(X)},null,8,["elementInfo","isSelected","isActive","isActiveGroupElement","isMultiSelect","rotateElement","scaleElement","dragLineElement","moveShapeKeypoint"])})),128)),Object(y["createVNode"])(Ar)]),Object(y["createElementVNode"])("div",{class:"viewport",ref_key:"viewportRef",ref:O,style:Object(y["normalizeStyle"])({transform:"scale(".concat(Object(y["unref"])(d),")")})},[Object(y["unref"])(S)?(Object(y["openBlock"])(),Object(y["createBlock"])(Br,{key:0,top:Object(y["unref"])(B).top,left:Object(y["unref"])(B).left,width:Object(y["unref"])(B).width,height:Object(y["unref"])(B).height,quadrant:Object(y["unref"])(L)},null,8,["top","left","width","height","quadrant"])):Object(y["createCommentVNode"])("",!0),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(x.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createBlock"])(wr,{key:e.id,elementInfo:e,elementIndex:t+1,isMultiSelect:Object(y["unref"])(c).length>1,selectElement:Object(y["unref"])(A),openLinkDialog:h},null,8,["elementInfo","elementIndex","isMultiSelect","selectElement"])})),128))],4)],4),Object(y["unref"])(m)?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",hd)):Object(y["createCommentVNode"])("",!0),Object(y["unref"])(i)?(Object(y["openBlock"])(),Object(y["createBlock"])(Xr,{key:2,viewportStyles:Object(y["unref"])(w)},null,8,["viewportStyles"])):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(n,{visible:j.value,"onUpdate:visible":t[2]||(t[2]=function(e){return j.value=e}),footer:null,centered:"",width:540,destroyOnClose:""},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(vd,{onClose:t[1]||(t[1]=function(e){return j.value=!1})})]})),_:1},8,["visible"])],32)),[[l,ve],[r,le]])}}});n("ead6");const gd=pn()(yd,[["__scopeId","data-v-1db12f3f"]]);var xd=gd,kd={class:"shape-pool"},Cd={class:"category-name"},Nd={class:"shape-list"},Ed=["onClick"],wd={overflow:"visible",width:"18",height:"18"},Vd=["transform"],Id=["fill","stroke","d"],Bd=Object(y["defineComponent"])({__name:"ShapePool",emits:["select"],setup:function(e,t){var n=t.emit,c=function(e){n("select",e)};return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",kd,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(ct),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"category",key:e.type},[Object(y["createElementVNode"])("div",Cd,Object(y["toDisplayString"])(e.type),1),Object(y["createElementVNode"])("div",Nd,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e.children,(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"shape-item",key:t},[Object(y["createElementVNode"])("div",{class:"shape-content",onClick:function(t){return c(e)}},[(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",wd,[Object(y["createElementVNode"])("g",{transform:"scale(".concat(18/e.viewBox[0],", ").concat(18/e.viewBox[1],") translate(0,0) matrix(1,0,0,1,0,0)")},[Object(y["createElementVNode"])("path",{class:Object(y["normalizeClass"])(["shape-path",{outlined:e.outlined}]),"vector-effect":"non-scaling-stroke","stroke-linecap":"butt","stroke-miterlimit":"8",fill:e.outlined?"#999":"transparent",stroke:e.outlined?"transparent":"#999","stroke-width":"2",d:e.path},null,10,Id)],8,Vd)]))],8,Ed)])})),128))])])})),128))])}}});n("c24c9");const Sd=pn()(Bd,[["__scopeId","data-v-5788e0d2"]]);var Ld=Sd,_d=[{type:"直线",children:[{path:"M 0 0 L 20 20",style:"solid",points:["",""]},{path:"M 0 0 L 20 20",style:"dashed",points:["",""]},{path:"M 0 0 L 20 20",style:"solid",points:["","arrow"]},{path:"M 0 0 L 20 20",style:"dashed",points:["","arrow"]},{path:"M 0 0 L 20 20",style:"solid",points:["","dot"]}]},{type:"折线、曲线",children:[{path:"M 0 0 L 0 20 L 20 20",style:"solid",points:["","arrow"],isBroken:!0},{path:"M 0 0 Q 0 20 20 20",style:"solid",points:["","arrow"],isCurve:!0},{path:"M 0 0 C 20 0 0 20 20 20",style:"solid",points:["","arrow"],isCubic:!0}]}],Td={class:"line-pool"},Md={class:"category-name"},Dd={class:"line-list"},zd=["onClick"],Fd={overflow:"visible",width:"20",height:"20"},Ad=["d","stroke-dasharray","marker-start","marker-end"],Rd=Object(y["defineComponent"])({__name:"LinePool",emits:["select"],setup:function(e,t){var n=t.emit,c=function(e){n("select",e)};return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Td,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(_d),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"category",key:e.type},[Object(y["createElementVNode"])("div",Md,Object(y["toDisplayString"])(e.type),1),Object(y["createElementVNode"])("div",Dd,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e.children,(function(e,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"line-item",key:n},[Object(y["createElementVNode"])("div",{class:"line-content",onClick:function(t){return c(e)}},[(Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",Fd,[Object(y["createElementVNode"])("defs",null,[e.points[0]?(Object(y["openBlock"])(),Object(y["createBlock"])(Fa,{key:0,class:"line-marker",id:"preset-line-".concat(t,"-").concat(n),position:"start",type:e.points[0],color:"currentColor",baseSize:2},null,8,["id","type"])):Object(y["createCommentVNode"])("",!0),e.points[1]?(Object(y["openBlock"])(),Object(y["createBlock"])(Fa,{key:1,class:"line-marker",id:"preset-line-".concat(t,"-").concat(n),position:"end",type:e.points[1],color:"currentColor",baseSize:2},null,8,["id","type"])):Object(y["createCommentVNode"])("",!0)]),Object(y["createElementVNode"])("path",{class:"line-path",d:e.path,stroke:"currentColor",fill:"none","stroke-width":"2","stroke-dasharray":"solid"===e.style?"0, 0":"4, 1","marker-start":e.points[0]?"url(#".concat("preset-line-".concat(t,"-").concat(n),"-",e.points[0],"-start)"):"","marker-end":e.points[1]?"url(#".concat("preset-line-".concat(t,"-").concat(n),"-",e.points[1],"-end)"):""},null,8,Ad)]))],8,zd)])})),128))])])})),128))])}}});n("3836");const Pd=pn()(Rd,[["__scopeId","data-v-bca68faa"]]);var Hd=Pd,qd={class:"chart-pool"},Ud=["onClick"],Gd=Object(y["defineComponent"])({__name:"ChartPool",emits:["select"],setup:function(e,t){var n=t.emit,c=["bar","horizontalBar","line","area","scatter","pie","ring"],o=function(e){n("select",e)};return function(e,t){var n=Object(y["resolveComponent"])("IconChartLine"),a=Object(y["resolveComponent"])("IconChartHistogram"),l=Object(y["resolveComponent"])("IconChartPie"),r=Object(y["resolveComponent"])("IconChartHistogramOne"),i=Object(y["resolveComponent"])("IconChartLineArea"),u=Object(y["resolveComponent"])("IconChartRing"),d=Object(y["resolveComponent"])("IconChartScatter");return Object(y["openBlock"])(),Object(y["createElementBlock"])("ul",qd,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(c,(function(e,t){return Object(y["createElementVNode"])("li",{class:"chart-item",key:t},[Object(y["createElementVNode"])("div",{class:"chart-content",onClick:function(t){return o(e)}},["line"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(n,{key:0,size:"24"})):"bar"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(a,{key:1,size:"24"})):"pie"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(l,{key:2,size:"24"})):"horizontalBar"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(r,{key:3,size:"24"})):"area"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(i,{key:4,size:"24"})):"ring"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(u,{key:5,size:"24"})):"scatter"===e?(Object(y["openBlock"])(),Object(y["createBlock"])(d,{key:6,size:"24"})):Object(y["createCommentVNode"])("",!0)],8,Ud)])})),64))])}}});n("24bc");const Xd=pn()(Gd,[["__scopeId","data-v-3870b42e"]]);var Yd=Xd,Zd=function(e){return Object(y["pushScopeId"])("data-v-144fbd05"),e=e(),Object(y["popScopeId"])(),e},Wd={class:"table-generator"},Jd={class:"title"},Kd={class:"lef"},Qd=["onMouseenter"],$d={key:1,class:"custom"},es={class:"row"},ts=Zd((function(){return Object(y["createElementVNode"])("div",{class:"label",style:{flex:"1"}},"行数:",-1)})),ns={class:"row"},cs=Zd((function(){return Object(y["createElementVNode"])("div",{class:"label",style:{flex:"1"}},"列数:",-1)})),os={class:"btns"},as=Object(y["createTextVNode"])("取消"),ls=Object(y["createTextVNode"])("确认"),rs=Object(y["defineComponent"])({__name:"TableGenerator",emits:["insert","close"],setup:function(e,t){var n=t.emit,c=Object(y["ref"])([]),o=Object(y["ref"])(3),a=Object(y["ref"])(3),l=Object(y["ref"])(!1),r=function(){if(c.value.length){var e=Object(me["a"])(c.value,2),t=e[0],o=e[1];n("insert",{row:t,col:o})}},i=function(){return o.value<1||o.value>20||a.value<1||a.value>20?Se["a"].warning("行数/列数必须在0~20之间!"):(n("insert",{row:o.value,col:a.value}),void(l.value=!1))},u=function(){n("close"),l.value=!1};return function(e,t){var n=Object(y["resolveComponent"])("InputNumber"),d=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Wd,[Object(y["createElementVNode"])("div",Jd,[Object(y["createElementVNode"])("div",Kd,"表格 "+Object(y["toDisplayString"])(c.value.length?"".concat(c.value[0]," x ").concat(c.value[1]):""),1),Object(y["createElementVNode"])("div",{class:"right",onClick:t[0]||(t[0]=function(e){return l.value=!l.value})},Object(y["toDisplayString"])(l.value?"返回":"自定义"),1)]),l.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",$d,[Object(y["createElementVNode"])("div",es,[ts,Object(y["createVNode"])(n,{min:1,max:20,value:o.value,"onUpdate:value":t[3]||(t[3]=function(e){return o.value=e}),style:{flex:"3"}},null,8,["value"])]),Object(y["createElementVNode"])("div",ns,[cs,Object(y["createVNode"])(n,{min:1,max:20,value:a.value,"onUpdate:value":t[4]||(t[4]=function(e){return a.value=e}),style:{flex:"3"}},null,8,["value"])]),Object(y["createElementVNode"])("div",os,[Object(y["createVNode"])(d,{class:"btn",onClick:t[5]||(t[5]=function(e){return u()})},{default:Object(y["withCtx"])((function(){return[as]})),_:1}),Object(y["createVNode"])(d,{class:"btn",type:"primary",onClick:t[6]||(t[6]=function(e){return i()})},{default:Object(y["withCtx"])((function(){return[ls]})),_:1})])])):(Object(y["openBlock"])(),Object(y["createElementBlock"])("table",{key:0,onMouseleave:t[1]||(t[1]=function(e){return c.value=[]}),onClick:t[2]||(t[2]=function(e){return r()})},[Object(y["createElementVNode"])("tbody",null,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(10,(function(e){return Object(y["createElementVNode"])("tr",{key:e},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(10,(function(t){return Object(y["createElementVNode"])("td",{onMouseenter:function(n){return c.value=[e,t]},key:t},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["cell",{active:c.value.length&&e<=c.value[0]&&t<=c.value[1]}])},null,2)],40,Qd)})),64))])})),64))])],32))])}}});n("307a");const is=pn()(rs,[["__scopeId","data-v-144fbd05"]]);var us=is,ds={class:"media-input"},ss={class:"tabs"},fs=["onClick"],bs={class:"btns"},ps=Object(y["createTextVNode"])("取消"),ms=Object(y["createTextVNode"])("确认"),Os={class:"btns"},vs=Object(y["createTextVNode"])("取消"),js=Object(y["createTextVNode"])("确认"),hs=Object(y["defineComponent"])({__name:"MediaInput",emits:["insertVideo","insertAudio","close"],setup:function(e,t){var n=t.emit,c=Object(y["ref"])("video"),o=Object(y["ref"])("https://mazwai.com/videvo_files/video/free/2019-01/small_watermarked/181004_04_Dolphins-Whale_06_preview.webm"),a=Object(y["ref"])("https://freesound.org/data/previews/614/614107_11861866-lq.mp3"),l=[{key:"video",label:"视频"},{key:"audio",label:"音频"}],r=function(){if(!o.value)return Se["a"].error("请先输入正确的视频地址");n("insertVideo",o.value)},i=function(){if(!a.value)return Se["a"].error("请先输入正确的音频地址");n("insertAudio",a.value)};return function(e,t){var u=Object(y["resolveComponent"])("Input"),d=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ds,[Object(y["createElementVNode"])("div",ss,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(l,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tab",{active:c.value===e.key}]),key:e.key,onClick:function(t){return c.value=e.key}},Object(y["toDisplayString"])(e.label),11,fs)})),64))]),"video"===c.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createVNode"])(u,{value:o.value,"onUpdate:value":t[0]||(t[0]=function(e){return o.value=e}),placeholder:"请输入视频地址,e.g. https://xxx.mp4"},null,8,["value"]),Object(y["createElementVNode"])("div",bs,[Object(y["createVNode"])(d,{onClick:t[1]||(t[1]=function(e){return n("close")}),style:{"margin-right":"10px"}},{default:Object(y["withCtx"])((function(){return[ps]})),_:1}),Object(y["createVNode"])(d,{type:"primary",onClick:t[2]||(t[2]=function(e){return r()})},{default:Object(y["withCtx"])((function(){return[ms]})),_:1})])],64)):Object(y["createCommentVNode"])("",!0),"audio"===c.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:1},[Object(y["createVNode"])(u,{value:a.value,"onUpdate:value":t[3]||(t[3]=function(e){return a.value=e}),placeholder:"请输入音频地址,e.g. https://xxx.mp3"},null,8,["value"]),Object(y["createElementVNode"])("div",Os,[Object(y["createVNode"])(d,{onClick:t[4]||(t[4]=function(e){return n("close")}),style:{"margin-right":"10px"}},{default:Object(y["withCtx"])((function(){return[vs]})),_:1}),Object(y["createVNode"])(d,{type:"primary",onClick:t[5]||(t[5]=function(e){return i()})},{default:Object(y["withCtx"])((function(){return[js]})),_:1})])],64)):Object(y["createCommentVNode"])("",!0)])}}});n("4675");const ys=pn()(hs,[["__scopeId","data-v-b9437110"]]);var gs=ys,xs=n("e5ca");xs["a"].SUB_SUP_SCALE=.5;var ks=[{label:"高斯公式",latex:"\\int\\int\\int _ { \\Omega } \\left( \\frac { \\partial {P} } { \\partial {x} } + \\frac { \\partial {Q} } { \\partial {y} } + \\frac { \\partial {R} }{ \\partial {z} } \\right) \\mathrm { d } V = \\oint _ { \\partial \\Omega } ( P \\cos \\alpha + Q \\cos \\beta + R \\cos \\gamma ) \\mathrm{ d} S"},{label:"傅里叶级数",latex:"f(x) = \\frac {a_0} 2 + \\sum_{n = 1}^\\infty {({a_n}\\cos {nx} + {b_n}\\sin {nx})}"},{label:"泰勒展开式",latex:"e ^ { x } = 1 + \\frac { x } { 1 ! } + \\frac { x ^ { 2 } } { 2 ! } + \\frac { x ^ { 3 } } { 3 ! } + ... , \\quad - \\infty < x < \\infty"},{label:"定积分",latex:"\\lim_ { n \\rightarrow + \\infty } \\sum _ { i = 1 } ^ { n } f \\left[ a + \\frac { i } { n } ( b - a ) \\right] \\frac { b - a } { n } = \\int _ { a } ^ { b } f ( x ) dx"},{label:"三角恒等式1",latex:"\\sin \\alpha \\pm \\sin \\beta = 2 \\sin \\frac { 1 } { 2 } ( \\alpha \\pm \\beta ) \\cos \\frac { 1 } { 2 } ( \\alpha \\mp \\beta )"},{label:"三角恒等式2",latex:"\\cos \\alpha + \\cos \\beta = 2 \\cos \\frac { 1 } { 2 } ( \\alpha + \\beta ) \\cos \\frac { 1 } { 2 } ( \\alpha - \\beta )"},{label:"和的展开式",latex:"( 1 + x ) ^ { n } = 1 + \\frac { n x } { 1 ! } + \\frac { n ( n - 1 ) x ^ { 2 } } { 2 ! } + ..."},{label:"欧拉公式",latex:" e^{ix} = \\cos {x} + i\\sin {x}"},{label:"贝努利方程",latex:"\\frac {dy} {dx} + P(x)y = Q(x) y^n ({n} \\not= {0,1})"},{label:"全微分方程",latex:"du(x,y) = P(x,y)dx + Q(x,y)dy = 0"},{label:"非齐次方程",latex:"y = (\\int Q(x) e^{\\int {P(x)dx}}dx + C)e^{-\\int {P(x)dx}}"},{label:"柯西中值定理",latex:"\\frac{{f(b) - f(a)}}{{F(b) - F(a)}} = \\frac{{f'(\\xi )}}{{F'(\\xi )}}"},{label:"拉格朗日中值定理",latex:"f(b) - f(a) = f'(\\xi )(b - a)"},{label:"导数公式",latex:"(\\arcsin x)' = \\frac{1}{{\\sqrt {1 - x^2} }}"},{label:"三角函数积分",latex:"\\int {tgxdx = - \\ln \\left| {\\cos x} \\right| + C}"},{label:"二次曲面",latex:"\\frac{{{x^2}}}{{{a^2}}} + \\frac{{{y^2}}}{{{b^2}}} - \\frac{{{z^2}}}{{{c^2}}} = 1"},{label:"二阶微分",latex:"\\frac {{d^2}y} {dx^2} + P(x) \\frac {dy} {dx} + Q(x)y = f(x)"},{label:"方向导数",latex:"\\frac{{\\partial f}}{{\\partial l}} = \\frac{{\\partial f}}{{\\partial x}}\\cos \\phi + \\frac{{\\partial f}}{{\\partial y}}\\sin \\phi"}],Cs=[{type:"operators",label:"数学",children:[{latex:"\\cdot"},{latex:"\\pm"},{latex:"\\mp"},{latex:"+"},{latex:"-"},{latex:"\\times"},{latex:"\\div"},{latex:"<"},{latex:">"},{latex:"="},{latex:"\\neq\\ne"},{latex:"\\leqq"},{latex:"\\geqq"},{latex:"\\leq"},{latex:"\\geq"},{latex:"\\propto"},{latex:"\\sim"},{latex:"\\equiv"},{latex:"\\dagger"},{latex:"\\ddagger"},{latex:"\\ell"},{latex:"\\#"},{latex:"\\$"},{latex:"\\&"},{latex:"\\%"},{latex:"\\langle\\rangle"},{latex:"()"},{latex:"[]"},{latex:"\\{\\}"},{latex:"||"},{latex:"\\|"},{latex:"\\exists"},{latex:"\\in"},{latex:"\\subset"},{latex:"\\supset"},{latex:"\\cup"},{latex:"\\cap"},{latex:"\\infty"},{latex:"\\partial"},{latex:"\\nabla"},{latex:"\\aleph"},{latex:"\\wp"},{latex:"\\therefore"},{latex:"\\mid"},{latex:"\\sum"},{latex:"\\prod"},{latex:"\\bigoplus"},{latex:"\\bigodot"},{latex:"\\int"},{latex:"\\oint"},{latex:"\\oplus"},{latex:"\\odot"},{latex:"\\perp"},{latex:"\\angle"},{latex:"\\triangle"},{latex:"\\Box"},{latex:"\\rightarrow"},{latex:"\\to"},{latex:"\\leftarrow"},{latex:"\\gets"},{latex:"\\circ"},{latex:"\\bigcirc"},{latex:"\\bullet"},{latex:"\\star"},{latex:"\\diamond"},{latex:"\\ast"},{latex:","},{latex:"."},{latex:";"},{latex:"!"}]},{type:"group",label:"组合",children:[{latex:"\\frac{a}{b}"},{latex:"\\frac{dx}{dx}"},{latex:"\\frac{\\partial a}{\\partial b}"},{latex:"\\sqrt{x}"},{latex:"\\sqrt[n]{x}"},{latex:"x^{n}"},{latex:"x_{n}"},{latex:"x_a^b"},{latex:"\\int_{a}^{b}"},{latex:"\\oint_a^b"},{latex:"\\lim_{a \\rightarrow b}"},{latex:"\\prod_a^b"},{latex:"\\sum_a^b"},{latex:"\\left(\\begin{array}a \\\\ b\\end{array}\\right)"},{latex:"\\begin{bmatrix}a & b \\\\ c & d \\end{bmatrix}"},{latex:"\\begin{cases}a & x = 0 \\\\ b & x > 0\\end{cases}"},{latex:"\\hat{a}"},{latex:"\\breve{a}"},{latex:"\\acute{a}"},{latex:"\\grave{a}"},{latex:"\\tilde{a}"},{latex:"\\bar{a}"},{latex:"\\vec{a}"},{latex:"\\underline{a}"},{latex:"\\overline{a}"},{latex:"\\widehat{ab}"},{latex:"\\overleftarrow{ab}"},{latex:"\\overrightarrow{ab}"}]},{type:"verbatim",label:"函数",children:[{latex:"\\log"},{latex:"\\ln"},{latex:"\\exp"},{latex:"\\mod"},{latex:"\\lim"},{latex:"\\sin"},{latex:"\\cos"},{latex:"\\tan"},{latex:"\\csc"},{latex:"\\sec"},{latex:"\\cot"},{latex:"\\sinh"},{latex:"\\cosh"},{latex:"\\tanh"},{latex:"\\csch"},{latex:"\\sech"},{latex:"\\coth"},{latex:"\\arcsin"},{latex:"\\arccos"},{latex:"\\arctan"},{latex:"\\arccsc"},{latex:"\\arcsec"},{latex:"\\arccot"}]},{type:"greek",label:"希腊字母",children:[{latex:"\\alpha"},{latex:"\\beta"},{latex:"\\gamma"},{latex:"\\delta"},{latex:"\\varepsilon"},{latex:"\\zeta"},{latex:"\\eta"},{latex:"\\vartheta"},{latex:"\\iota"},{latex:"\\kappa"},{latex:"\\lambda"},{latex:"\\mu"},{latex:"\\nu"},{latex:"\\xi"},{latex:"\\omicron"},{latex:"\\pi"},{latex:"\\rho"},{latex:"\\sigma"},{latex:"\\tau"},{latex:"\\upsilon"},{latex:"\\varphi"},{latex:"\\chi"},{latex:"\\psi"},{latex:"\\omega"},{latex:"\\epsilon"},{latex:"\\theta"},{latex:"\\phi"},{latex:"\\varsigma"},{latex:"\\Alpha"},{latex:"\\Beta"},{latex:"\\Gamma"},{latex:"\\Delta"},{latex:"\\Epsilon"},{latex:"\\Zeta"},{latex:"\\Eta"},{latex:"\\Theta"},{latex:"\\Iota"},{latex:"\\Kappa"},{latex:"\\Lambda"},{latex:"\\Mu"},{latex:"\\Nu"},{latex:"\\Xi"},{latex:"\\Omicron"},{latex:"\\Pi"},{latex:"\\Rho"},{latex:"\\Sigma"},{latex:"\\Tau"},{latex:"\\Upsilon"},{latex:"\\Phi"},{latex:"\\Chi"},{latex:"\\Psi"},{latex:"\\Omega"}]}],Ns=["width","height"],Es=["transform"],ws=["d"],Vs=Object(y["defineComponent"])({__name:"FormulaContent",props:{latex:{type:String,required:!0},width:{type:Number,required:!0},height:{type:Number,required:!0}},setup:function(e){var t=e,n=Object(y["ref"])({x:0,y:0,w:0,h:0}),c=Object(y["ref"])("");Object(y["watch"])((function(){return t.latex}),(function(){var e=new xs["b"](t.latex);c.value=e.pathd({}),n.value=e.box({})}),{immediate:!0});var o=Object(y["computed"])((function(){var e=n.value.w+32,c=n.value.h+32;return e>t.width||c>t.height?e/c>t.width/t.height?t.width/e:t.height/c:1}));return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("svg",{class:"formula-content",overflow:"visible",width:n.value.w+32,height:n.value.h+32,stroke:"#000","stroke-width":"1",fill:"none","stroke-linecap":"round","stroke-linejoin":"round"},[Object(y["createElementVNode"])("g",{transform:"scale(".concat(Object(y["unref"])(o),", ").concat(Object(y["unref"])(o),") translate(0,0) matrix(1,0,0,1,0,0)"),"transform-origin":"0 50%"},[Object(y["createElementVNode"])("path",{d:c.value},null,8,ws)],8,Es)],8,Ns)}}});n("e9df");const Is=pn()(Vs,[["__scopeId","data-v-1c41d9fe"]]);var Bs=Is,Ss=["innerHTML"],Ls=Object(y["defineComponent"])({__name:"SymbolContent",props:{latex:{type:String,required:!0}},setup:function(e){var t=e,n=Object(y["computed"])((function(){var e=new xs["b"](t.latex);return e.svg({SCALE_X:10,SCALE_Y:10})}));return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"symbol-content",innerHTML:Object(y["unref"])(n)},null,8,Ss)}}});const _s=Ls;var Ts=_s,Ms={class:"latex-editor"},Ds={class:"container"},zs={class:"left"},Fs={class:"input-area"},As={class:"preview"},Rs={key:0,class:"placeholder"},Ps={key:1,class:"preview-content"},Hs={class:"right"},qs={class:"tabs"},Us=["onClick"],Gs={class:"content"},Xs={key:0,class:"symbol"},Ys={class:"symbol-tabs"},Zs=["onClick"],Ws={class:"symbol-pool"},Js=["onClick"],Ks={key:1,class:"formula"},Qs={class:"formula-title"},$s=["onClick"],ef={class:"footer"},tf=Object(y["createTextVNode"])("取消"),nf=Object(y["createTextVNode"])("确定"),cf=Object(y["defineComponent"])({__name:"index",props:{value:{type:String,default:""}},emits:["update","close"],setup:function(e,t){var n=t.emit,c=e,o=[{label:"常用符号",value:"symbol"},{label:"预置公式",value:"formula"}],a=ks,l=Cs,r=Object(y["ref"])(""),i=Object(y["ref"])("symbol"),u=Object(y["ref"])(),d=Object(y["ref"])(Cs[0].type),s=Object(y["computed"])((function(){var e=Cs.find((function(e){return e.type===d.value}));return(null===e||void 0===e?void 0:e.children)||[]}));Object(y["onMounted"])((function(){c.value&&(r.value=c.value)}));var f=function(){if(!r.value)return Se["a"].error("公式不能为空");var e=new xs["b"](r.value),t=e.pathd({}),c=e.box({});n("update",{latex:r.value,path:t,w:c.w+32,h:c.h+32})},b=function(e){u.value&&(u.value.focus(),document.execCommand("insertText",!1,e))};return function(e,t){var c=Object(y["resolveComponent"])("TextArea"),p=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Ms,[Object(y["createElementVNode"])("div",Ds,[Object(y["createElementVNode"])("div",zs,[Object(y["createElementVNode"])("div",Fs,[Object(y["createVNode"])(c,{value:r.value,"onUpdate:value":t[0]||(t[0]=function(e){return r.value=e}),placeholder:"输入 LaTeX 公式",ref_key:"textAreaRef",ref:u},null,8,["value"])]),Object(y["createElementVNode"])("div",As,[r.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Ps,[Object(y["createVNode"])(Bs,{width:518,height:138,latex:r.value},null,8,["latex"])])):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Rs,"公式预览"))])]),Object(y["createElementVNode"])("div",Hs,[Object(y["createElementVNode"])("div",qs,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(o,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tab",{active:e.value===i.value}]),key:e.value,onClick:function(t){return i.value=e.value}},Object(y["toDisplayString"])(e.label),11,Us)})),64))]),Object(y["createElementVNode"])("div",Gs,["symbol"===i.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Xs,[Object(y["createElementVNode"])("div",Ys,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(l),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["symbol-tab",{active:d.value===e.type}]),key:e.type,onClick:function(t){return d.value=e.type}},Object(y["toDisplayString"])(e.label),11,Zs)})),128))]),Object(y["createElementVNode"])("div",Ws,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(s),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"symbol-item",key:e.latex,onClick:function(t){return b(e.latex)}},[Object(y["createVNode"])(Ts,{latex:e.latex},null,8,["latex"])],8,Js)})),128))])])):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Ks,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(a),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"formula-item",key:e.label},[Object(y["createElementVNode"])("div",Qs,Object(y["toDisplayString"])(e.label),1),Object(y["createElementVNode"])("div",{class:"formula-item-content",onClick:function(t){return r.value=e.latex}},[Object(y["createVNode"])(Bs,{width:236,height:60,latex:e.latex},null,8,["latex"])],8,$s)])})),128))]))])])]),Object(y["createElementVNode"])("div",ef,[Object(y["createVNode"])(p,{class:"btn",onClick:t[1]||(t[1]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[tf]})),_:1}),Object(y["createVNode"])(p,{class:"btn",type:"primary",onClick:t[2]||(t[2]=function(e){return f()})},{default:Object(y["withCtx"])((function(){return[nf]})),_:1})])])}}});n("1933");const of=pn()(cf,[["__scopeId","data-v-2d73bf28"]]);var af=of,lf={class:"canvas-tool"},rf={class:"left-handler"},uf={class:"add-element-handler"},df={class:"right-handler"},sf={class:"viewport-size-preset"},ff=["onClick"],bf={class:"text"},pf=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=ie(),n=Object(g["c"])(t),c=n.creatingElement,o=Object(g["c"])(xe()),a=o.canUndo,l=o.canRedo,r=at(),i=r.redo,u=r.undo,d=gt(),s=d.scaleCanvas,f=d.setCanvasScalePercentage,b=d.resetCanvas,p=d.canvasScalePercentage,m=[200,150,100,80,50],O=Object(y["ref"])(!1),v=function(e){f(e),O.value=!1},j=lt(),h=j.createImageElement,x=j.createChartElement,k=j.createTableElement,C=j.createLatexElement,N=j.createVideoElement,E=j.createAudioElement,w=function(e){var t=e[0];t&&et(t).then((function(e){return h(e)}))},V=Object(y["ref"])(!1),I=Object(y["ref"])(!1),B=Object(y["ref"])(!1),S=Object(y["ref"])(!1),L=Object(y["ref"])(!1),_=Object(y["ref"])(!1),T=function(){t.setCreatingElement({type:"text"})},M=function(e){t.setCreatingElement({type:"shape",data:e}),V.value=!1},D=function(e){t.setCreatingElement({type:"line",data:e}),I.value=!1};return function(e,t){var n=Object(y["resolveComponent"])("IconBack"),o=Object(y["resolveComponent"])("Tooltip"),r=Object(y["resolveComponent"])("IconNext"),d=Object(y["resolveComponent"])("IconFontSize"),f=Object(y["resolveComponent"])("IconPicture"),j=Object(y["resolveComponent"])("FileInput"),h=Object(y["resolveComponent"])("IconGraphicDesign"),g=Object(y["resolveComponent"])("Popover"),z=Object(y["resolveComponent"])("IconConnection"),F=Object(y["resolveComponent"])("IconChartProportion"),A=Object(y["resolveComponent"])("IconInsertTable"),R=Object(y["resolveComponent"])("IconFormula"),P=Object(y["resolveComponent"])("IconVideoTwo"),H=Object(y["resolveComponent"])("IconMinus"),q=Object(y["resolveComponent"])("IconPlus"),U=Object(y["resolveComponent"])("IconFullScreen"),G=Object(y["resolveComponent"])("Modal");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",lf,[Object(y["createElementVNode"])("div",rf,[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"撤销"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{class:Object(y["normalizeClass"])(["handler-item",{disable:!Object(y["unref"])(a)}]),onClick:t[0]||(t[0]=function(e){return Object(y["unref"])(u)()})},null,8,["class"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"重做"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r,{class:Object(y["normalizeClass"])(["handler-item",{disable:!Object(y["unref"])(l)}]),onClick:t[1]||(t[1]=function(e){return Object(y["unref"])(i)()})},null,8,["class"])]})),_:1},8,["mouseEnterDelay"])]),Object(y["createElementVNode"])("div",uf,[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入文字"},{default:Object(y["withCtx"])((function(){var e;return[Object(y["createVNode"])(d,{class:Object(y["normalizeClass"])(["handler-item",{active:"text"===(null===(e=Object(y["unref"])(c))||void 0===e?void 0:e.type)}]),onClick:t[2]||(t[2]=function(e){return T()})},null,8,["class"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{onChange:t[3]||(t[3]=function(e){return w(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入图片"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{class:"handler-item"})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(g,{trigger:"click",visible:V.value,"onUpdate:visible":t[5]||(t[5]=function(e){return V.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Ld,{onSelect:t[4]||(t[4]=function(e){return M(e)})})]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入形状"},{default:Object(y["withCtx"])((function(){var e;return[Object(y["createVNode"])(h,{class:Object(y["normalizeClass"])(["handler-item",{active:"shape"===(null===(e=Object(y["unref"])(c))||void 0===e?void 0:e.type)}])},null,8,["class"])]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["visible"]),Object(y["createVNode"])(g,{trigger:"click",visible:I.value,"onUpdate:visible":t[7]||(t[7]=function(e){return I.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hd,{onSelect:t[6]||(t[6]=function(e){return D(e)})})]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入线条"},{default:Object(y["withCtx"])((function(){var e;return[Object(y["createVNode"])(z,{class:Object(y["normalizeClass"])(["handler-item",{active:"line"===(null===(e=Object(y["unref"])(c))||void 0===e?void 0:e.type)}])},null,8,["class"])]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["visible"]),Object(y["createVNode"])(g,{trigger:"click",visible:B.value,"onUpdate:visible":t[9]||(t[9]=function(e){return B.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Yd,{onSelect:t[8]||(t[8]=function(e){Object(y["unref"])(x)(e),B.value=!1})})]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入图表"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(F,{class:"handler-item"})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["visible"]),Object(y["createVNode"])(g,{trigger:"click",visible:S.value,"onUpdate:visible":t[12]||(t[12]=function(e){return S.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(us,{onClose:t[10]||(t[10]=function(e){return S.value=!1}),onInsert:t[11]||(t[11]=function(e){var t=e.row,n=e.col;Object(y["unref"])(k)(t,n),S.value=!1})})]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入表格"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(A,{class:"handler-item"})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["visible"]),Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入公式"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{class:"handler-item",onClick:t[13]||(t[13]=function(e){return _.value=!0})})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(g,{trigger:"click",visible:L.value,"onUpdate:visible":t[17]||(t[17]=function(e){return L.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(gs,{onClose:t[14]||(t[14]=function(e){return L.value=!1}),onInsertVideo:t[15]||(t[15]=function(e){Object(y["unref"])(N)(e),L.value=!1}),onInsertAudio:t[16]||(t[16]=function(e){Object(y["unref"])(E)(e),L.value=!1})})]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"插入音视频"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(P,{class:"handler-item"})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["visible"])]),Object(y["createElementVNode"])("div",df,[Object(y["createVNode"])(H,{class:"handler-item viewport-size",onClick:t[18]||(t[18]=function(e){return Object(y["unref"])(s)("-")})}),Object(y["createVNode"])(g,{trigger:"click",visible:O.value,"onUpdate:visible":t[19]||(t[19]=function(e){return O.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",sf,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(m,(function(e){return Object(y["createElementVNode"])("div",{class:"preset-item",key:e,onClick:function(t){return v(e)}},Object(y["toDisplayString"])(e)+"%",9,ff)})),64))])]})),default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",bf,Object(y["toDisplayString"])(Object(y["unref"])(p)),1)]})),_:1},8,["visible"]),Object(y["createVNode"])(q,{class:"handler-item viewport-size",onClick:t[20]||(t[20]=function(e){return Object(y["unref"])(s)("+")})}),Object(y["createVNode"])(o,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"适应屏幕"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(U,{class:"handler-item viewport-size-adaptation",onClick:t[21]||(t[21]=function(e){return Object(y["unref"])(b)()})})]})),_:1},8,["mouseEnterDelay"])]),Object(y["createVNode"])(G,{visible:_.value,"onUpdate:visible":t[24]||(t[24]=function(e){return _.value=e}),footer:null,centered:"",width:880,destroyOnClose:""},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(af,{onClose:t[22]||(t[22]=function(e){return _.value=!1}),onUpdate:t[23]||(t[23]=function(e){Object(y["unref"])(C)(e),_.value=!1})})]})),_:1},8,["visible"])])}}});n("9ff2");const mf=pn()(pf,[["__scopeId","data-v-5d4eff54"]]);var Of=mf,vf=function(){var e=Object(g["c"])(ae()),t=e.slides,n=Object(y["ref"])(null),c=Object(y["ref"])(50),o=function e(){t.value.length>c.value?n.value=setTimeout((function(){c.value=c.value+20,e()}),600):c.value=9999};return Object(y["onMounted"])(o),Object(y["onUnmounted"])((function(){n.value&&clearTimeout(n.value)})),{slidesLoadLimit:c}},jf=n("b76a"),hf=n.n(jf),yf={class:"layout-pool"},gf=["onClick"],xf=Object(y["defineComponent"])({__name:"LayoutPool",emits:["select"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.layouts,a=function(e){n("select",e)};return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",yf,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(o),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"layout-item",key:e.id,onClick:function(t){return a(e)}},[Object(y["createVNode"])(ad,{class:"thumbnail",slide:e,size:180},null,8,["slide"])],8,gf)})),128))])}}});n("3328");const kf=pn()(xf,[["__scopeId","data-v-cc6b7dca"]]);var Cf=kf,Nf={class:"add-slide"},Ef=Object(y["createTextVNode"])("添加幻灯片"),wf={class:"select-btn"},Vf=["onMousedown"],If=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=ie(),n=ae(),c=ke(),o=Object(g["c"])(t),a=o.selectedSlidesIndex,l=o.thumbnailsFocus,r=Object(g["c"])(n),i=r.slides,u=r.slideIndex,d=Object(g["c"])(c),s=d.ctrlKeyState,f=d.shiftKeyState,b=vf(),p=b.slidesLoadLimit,m=Object(y["computed"])((function(){return[].concat(Object(Q["a"])(a.value),[u.value])})),O=Object(y["ref"])(!1),v=ut(),j=v.copySlide,h=v.pasteSlide,x=v.createSlide,k=v.createSlideByTemplate,C=v.copyAndPasteSlide,N=v.deleteSlide,E=v.cutSlide,w=v.selectAllSlide,V=function(e){t.setActiveElementIdList([]),u.value!==e&&n.updateSlideIndex(e)},I=function(e,n){var c=m.value.length>1;if(!c||!m.value.includes(n)||0===e.button)if(s.value)if(u.value===n){if(!c)return;var o=m.value.filter((function(e){return e!==n}));t.updateSelectedSlidesIndex(o),V(m.value[0])}else if(m.value.includes(n)){var a=m.value.filter((function(e){return e!==n}));t.updateSelectedSlidesIndex(a)}else{var l=[].concat(Object(Q["a"])(m.value),[n]);t.updateSelectedSlidesIndex(l),V(n)}else if(f.value){if(u.value===n&&!c)return;var r=Math.min.apply(Math,Object(Q["a"])(m.value)),i=n;n=99}])},Object(y["toDisplayString"])(Object(y["unref"])(Ne)(n+1,2)),3),Object(y["createVNode"])(ad,{class:"thumbnail",slide:t,size:120,visible:n1&&void 0!==arguments[1]?arguments[1]:0,n=l.value,c=m(),a=c.originClipRange,i=c.originWidth,u=c.originHeight,d=c.originLeft,s=c.originTop;if(t){var f,O=u/i,v=0,j=100;if(O>t){var h=(1-t/O)/2*100;f=[[v,h],[j,j-h]]}else{var y=(1-O/t)/2*100;f=[[y,v],[j-y,j]]}o.updateElement({id:r.value,props:{clip:Object(S["a"])(Object(S["a"])({},n.clip),{},{shape:e,range:f}),left:d+i*(f[0][0]/100),top:s+u*(f[0][1]/100),width:i*(f[1][0]-f[0][0])/100,height:u*(f[1][1]-f[0][1])/100}})}else o.updateElement({id:r.value,props:{clip:Object(S["a"])(Object(S["a"])({},n.clip),{},{shape:e,range:a})}});p(),b()},v=function(e){var t=e[0];t&&(et(t).then((function(e){var t={src:e};o.updateElement({id:r.value,props:t})})),b())},j=function(){var e=l.value;if(e.clip){var t=m(),n=t.originWidth,c=t.originHeight,a=t.originLeft,i=t.originTop;o.updateElement({id:r.value,props:{left:a,top:i,width:n,height:c}})}o.removeElementProps({id:r.value,propName:["clip","outline","flip","shadow","filters"]}),b()},h=function(){var e=l.value,t=Object(S["a"])(Object(S["a"])({},u.value.background),{},{type:"image",image:e.src,imageSize:"cover"});o.updateSlide({background:t}),b()};return function(e,c){var o=Object(y["resolveComponent"])("IconTailoring"),a=Object(y["resolveComponent"])("Button"),l=Object(y["resolveComponent"])("ButtonGroup"),r=Object(y["resolveComponent"])("IconDown"),i=Object(y["resolveComponent"])("Popover"),u=Object(y["resolveComponent"])("Divider"),f=Object(y["resolveComponent"])("IconTransform"),b=Object(y["resolveComponent"])("FileInput"),m=Object(y["resolveComponent"])("IconUndo"),g=Object(y["resolveComponent"])("IconTheme");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",rp,[Object(y["createElementVNode"])("div",{class:"origin-image",style:Object(y["normalizeStyle"])({backgroundImage:"url(".concat(Object(y["unref"])(d).src,")")})},null,4),Object(y["createVNode"])(Wb),Object(y["createVNode"])(l,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{style:{flex:"5"},onClick:c[0]||(c[0]=function(e){return p()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{class:"btn-icon"}),ip]})),_:1}),Object(y["createVNode"])(i,{trigger:"click",visible:s.value,"onUpdate:visible":c[1]||(c[1]=function(e){return s.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",up,[dp,Object(y["createElementVNode"])("div",sp,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(t),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"shape-clip-item",key:t,onClick:function(e){return O(t)}},[Object(y["createElementVNode"])("div",{class:"shape",style:Object(y["normalizeStyle"])({clipPath:e.style})},null,4)],8,fp)})),128))]),(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(n,(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:e.label},[e.label?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",bp,"按"+Object(y["toDisplayString"])(e.label)+":",1)):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(l,{class:"row"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e.children,(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(a,{style:{flex:"1"},key:e.key,onClick:function(t){return O("rect",e.ratio)}},{default:Object(y["withCtx"])((function(){return[Object(y["createTextVNode"])(Object(y["toDisplayString"])(e.key),1)]})),_:2},1032,["onClick"])})),128))]})),_:2},1024)],64)})),64))])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{class:"no-padding",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r)]})),_:1})]})),_:1},8,["visible"])]})),_:1}),Object(y["createVNode"])(u),Object(y["createVNode"])(ap),Object(y["createVNode"])(u),Object(y["createVNode"])(ob),Object(y["createVNode"])(u),Object(y["createVNode"])(yb),Object(y["createVNode"])(u),Object(y["createVNode"])(b,{onChange:c[2]||(c[2]=function(e){return v(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{class:"full-width-btn"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{class:"btn-icon"}),pp]})),_:1})]})),_:1}),Object(y["createVNode"])(a,{class:"full-width-btn",onClick:c[3]||(c[3]=function(e){return j()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(m,{class:"btn-icon"}),mp]})),_:1}),Object(y["createVNode"])(a,{class:"full-width-btn",onClick:c[4]||(c[4]=function(e){return h()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g,{class:"btn-icon"}),Op]})),_:1})])}}});n("911d");const jp=pn()(vp,[["__scopeId","data-v-7da35bec"]]);var hp=jp,yp=function(e){return Object(y["pushScopeId"])("data-v-02998580"),e=e(),Object(y["popScopeId"])(),e},gp={class:"shape-style-panel"},xp={class:"row"},kp=Object(y["createTextVNode"])("纯色填充"),Cp=Object(y["createTextVNode"])("渐变填充"),Np=yp((function(){return Object(y["createElementVNode"])("div",{style:{flex:"1"}},null,-1)})),Ep=Object(y["createTextVNode"])("线性渐变"),wp=Object(y["createTextVNode"])("径向渐变"),Vp={class:"row"},Ip=yp((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"起点颜色:",-1)})),Bp={class:"row"},Sp=yp((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"终点颜色:",-1)})),Lp={key:0,class:"row"},_p=yp((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"渐变角度:",-1)})),Tp=Object(y["createTextVNode"])("+"),Mp=Object(y["createTextVNode"])("-"),Dp=Object(y["defineComponent"])({__name:"ShapeStylePanel",setup:function(e){var t=ie(),n=ae(),c=Object(g["c"])(t),o=c.handleElement,a=c.handleElementId,l=c.richTextAttrs,r=c.availableFonts,i=o,u=Object(y["ref"])("#000"),d=Object(y["ref"])({type:"linear",rotate:0,color:["#fff","#fff"]}),s=Object(y["ref"])("fill"),f=Object(y["ref"])("middle");Object(y["watch"])(o,(function(){var e,t;o.value&&"shape"===o.value.type&&(u.value=o.value.fill||"#fff",d.value=o.value.gradient||{type:"linear",rotate:0,color:[u.value,"#fff"]},s.value=o.value.gradient?"gradient":"fill",f.value=(null===(e=o.value)||void 0===e||null===(t=e.text)||void 0===t?void 0:t.align)||"middle")}),{deep:!0,immediate:!0});var b=at(),p=b.addHistorySnapshot,m=function(e){n.updateElement({id:a.value,props:e}),p()},O=function(e){"fill"===e?(n.removeElementProps({id:a.value,propName:"gradient"}),p()):m({gradient:d.value})},v=function(e){if(d.value){var t=Object(S["a"])(Object(S["a"])({},d.value),e);m({gradient:t})}},j=function(e){m({fill:e})},h=function(e){var t=o.value,n={content:"",defaultFontName:"微软雅黑",defaultColor:"#000",align:"middle"},c=t.text||n;m({text:Object(S["a"])(Object(S["a"])({},c),{},{align:e})})},x=["12px","14px","16px","18px","20px","22px","24px","28px","32px","36px","40px","44px","48px","54px","60px","66px","72px","76px","80px","88px","96px","104px","112px","120px"],k=function(e,t){ta.emit(fo.RICH_TEXT_COMMAND,{action:{command:e,value:t}})};return function(e,t){var n,c=Object(y["resolveComponent"])("SelectOption"),o=Object(y["resolveComponent"])("Select"),a=Object(y["resolveComponent"])("ColorPicker"),b=Object(y["resolveComponent"])("Popover"),p=Object(y["resolveComponent"])("Slider"),m=Object(y["resolveComponent"])("Divider"),g=Object(y["resolveComponent"])("IconFontSize"),C=Object(y["resolveComponent"])("SelectOptGroup"),N=Object(y["resolveComponent"])("IconAddText"),E=Object(y["resolveComponent"])("InputGroup"),w=Object(y["resolveComponent"])("IconText"),V=Object(y["resolveComponent"])("Button"),I=Object(y["resolveComponent"])("Tooltip"),S=Object(y["resolveComponent"])("IconHighLight"),L=Object(y["resolveComponent"])("ButtonGroup"),_=Object(y["resolveComponent"])("IconTextBold"),T=Object(y["resolveComponent"])("CheckboxButton"),M=Object(y["resolveComponent"])("IconTextItalic"),D=Object(y["resolveComponent"])("IconTextUnderline"),z=Object(y["resolveComponent"])("IconFormat"),F=Object(y["resolveComponent"])("CheckboxButtonGroup"),A=Object(y["resolveComponent"])("IconAlignTextLeft"),R=Object(y["resolveComponent"])("RadioButton"),P=Object(y["resolveComponent"])("IconAlignTextCenter"),H=Object(y["resolveComponent"])("IconAlignTextRight"),q=Object(y["resolveComponent"])("RadioGroup"),U=Object(y["resolveComponent"])("IconAlignTextTopOne"),G=Object(y["resolveComponent"])("IconAlignTextMiddleOne"),X=Object(y["resolveComponent"])("IconAlignTextBottomOne");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",gp,[Object(y["createElementVNode"])("div",xp,[Object(y["createVNode"])(o,{style:{flex:"10"},value:s.value,onChange:t[0]||(t[0]=function(e){return O(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{value:"fill"},{default:Object(y["withCtx"])((function(){return[kp]})),_:1}),Object(y["createVNode"])(c,{value:"gradient"},{default:Object(y["withCtx"])((function(){return[Cp]})),_:1})]})),_:1},8,["value"]),Np,"fill"===s.value?(Object(y["openBlock"])(),Object(y["createBlock"])(b,{key:0,trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:u.value,"onUpdate:modelValue":t[1]||(t[1]=function(e){return j(e)})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:u.value,style:{flex:"10"}},null,8,["color"])]})),_:1})):(Object(y["openBlock"])(),Object(y["createBlock"])(o,{key:1,style:{flex:"10"},value:d.value.type,onChange:t[2]||(t[2]=function(e){return v({type:e})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{value:"linear"},{default:Object(y["withCtx"])((function(){return[Ep]})),_:1}),Object(y["createVNode"])(c,{value:"radial"},{default:Object(y["withCtx"])((function(){return[wp]})),_:1})]})),_:1},8,["value"]))]),"gradient"===s.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createElementVNode"])("div",Vp,[Ip,Object(y["createVNode"])(b,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:d.value.color[0],"onUpdate:modelValue":t[3]||(t[3]=function(e){return v({color:[e,d.value.color[1]]})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:d.value.color[0],style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",Bp,[Sp,Object(y["createVNode"])(b,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:d.value.color[1],"onUpdate:modelValue":t[4]||(t[4]=function(e){return v({color:[d.value.color[0],e]})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:d.value.color[1],style:{flex:"3"}},null,8,["color"])]})),_:1})]),"linear"===d.value.type?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Lp,[_p,Object(y["createVNode"])(p,{class:"slider",min:0,max:360,step:15,value:d.value.rotate,onChange:t[5]||(t[5]=function(e){return v({rotate:e})})},null,8,["value"])])):Object(y["createCommentVNode"])("",!0)],64)):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(Wb),Object(y["createVNode"])(m),null!==(n=Object(y["unref"])(i).text)&&void 0!==n&&n.content?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:1},[Object(y["createVNode"])(E,{compact:"",class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"3"},value:Object(y["unref"])(l).fontname,onChange:t[6]||(t[6]=function(e){return k("fontname",e)})},{suffixIcon:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g)]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(C,{label:"系统字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(r),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",{style:Object(y["normalizeStyle"])({fontFamily:e.value})},Object(y["toDisplayString"])(e.label),5)]})),_:2},1032,["value"])})),128))]})),_:1}),Object(y["createVNode"])(C,{label:"在线字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(B),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(e.label),1)]})),_:2},1032,["value"])})),128))]})),_:1})]})),_:1},8,["value"]),Object(y["createVNode"])(o,{style:{flex:"2"},value:Object(y["unref"])(l).fontsize,onChange:t[7]||(t[7]=function(e){return k("fontsize",e)})},{suffixIcon:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(N)]})),default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(x,(function(e){return Object(y["createVNode"])(c,{key:e,value:e},{default:Object(y["withCtx"])((function(){return[Object(y["createTextVNode"])(Object(y["toDisplayString"])(e),1)]})),_:2},1032,["value"])})),64))]})),_:1},8,["value"])]})),_:1}),Object(y["createVNode"])(L,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(b,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(l).color,"onUpdate:modelValue":t[8]||(t[8]=function(e){return k("color",e)})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"文字颜色"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(V,{class:"text-color-btn",style:{flex:"3"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(w),Object(y["createElementVNode"])("div",{class:"text-color-block",style:Object(y["normalizeStyle"])({backgroundColor:Object(y["unref"])(l).color})},null,4)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(b,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(l).backcolor,"onUpdate:modelValue":t[9]||(t[9]=function(e){return k("backcolor",e)})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"文字高亮"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(V,{class:"text-color-btn",style:{flex:"3"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(S),Object(y["createElementVNode"])("div",{class:"text-color-block",style:Object(y["normalizeStyle"])({backgroundColor:Object(y["unref"])(l).backcolor})},null,4)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"增大字号"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(V,{class:"font-size-btn",style:{flex:"2"},onClick:t[10]||(t[10]=function(e){return k("fontsize-add")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g),Tp]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"减小字号"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(V,{class:"font-size-btn",style:{flex:"2"},onClick:t[11]||(t[11]=function(e){return k("fontsize-reduce")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g),Mp]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(F,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"加粗"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(T,{style:{flex:"1"},checked:Object(y["unref"])(l).bold,onClick:t[12]||(t[12]=function(e){return k("bold")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(_)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"斜体"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(T,{style:{flex:"1"},checked:Object(y["unref"])(l).em,onClick:t[13]||(t[13]=function(e){return k("em")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(M)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"下划线"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(T,{style:{flex:"1"},checked:Object(y["unref"])(l).underline,onClick:t[14]||(t[14]=function(e){return k("underline")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(D)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"清除格式"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(T,{style:{flex:"1"},onClick:t[15]||(t[15]=function(e){return k("clear")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(z)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(q,{class:"row","button-style":"solid",value:Object(y["unref"])(l).align,onChange:t[16]||(t[16]=function(e){return k("align",e.target.value)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"左对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"left",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(A)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"居中"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"center",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(P)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"右对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"right",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(H)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["value"]),Object(y["createVNode"])(q,{class:"row","button-style":"solid",value:f.value,onChange:t[17]||(t[17]=function(e){return h(e.target.value)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"顶对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"top",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(U)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"居中"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"middle",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(G)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(I,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"底对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(R,{value:"bottom",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(X)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["value"]),Object(y["createVNode"])(m)],64)):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(ob),Object(y["createVNode"])(m),Object(y["createVNode"])(yb),Object(y["createVNode"])(m),Object(y["createVNode"])(Ff)])}}});n("de23");const zp=pn()(Dp,[["__scopeId","data-v-02998580"]]);var Fp=zp,Ap=function(e){return Object(y["pushScopeId"])("data-v-938968a2"),e=e(),Object(y["popScopeId"])(),e},Rp={class:"line-style-panel"},Pp={class:"row"},Hp=Ap((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"线条样式:",-1)})),qp=Object(y["createTextVNode"])("实线"),Up=Object(y["createTextVNode"])("虚线"),Gp={class:"row"},Xp=Ap((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"线条颜色:",-1)})),Yp={class:"row"},Zp=Ap((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"线条宽度:",-1)})),Wp={class:"row"},Jp=Ap((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"起点样式:",-1)})),Kp=Object(y["createTextVNode"])("无"),Qp=Object(y["createTextVNode"])("箭头"),$p=Object(y["createTextVNode"])("圆点"),em={class:"row"},tm=Ap((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"终点样式:",-1)})),nm=Object(y["createTextVNode"])("无"),cm=Object(y["createTextVNode"])("箭头"),om=Object(y["createTextVNode"])("圆点"),am=Object(y["defineComponent"])({__name:"LineStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=c,a=at(),l=a.addHistorySnapshot,r=function(e){c.value&&(t.updateElement({id:c.value.id,props:e}),l())};return function(e,t){var n=Object(y["resolveComponent"])("SelectOption"),c=Object(y["resolveComponent"])("Select"),a=Object(y["resolveComponent"])("ColorPicker"),l=Object(y["resolveComponent"])("Popover"),i=Object(y["resolveComponent"])("InputNumber"),u=Object(y["resolveComponent"])("Divider");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Rp,[Object(y["createElementVNode"])("div",Pp,[Hp,Object(y["createVNode"])(c,{style:{flex:"3"},value:Object(y["unref"])(o).style,onChange:t[0]||(t[0]=function(e){return r({style:e})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:"solid"},{default:Object(y["withCtx"])((function(){return[qp]})),_:1}),Object(y["createVNode"])(n,{value:"dashed"},{default:Object(y["withCtx"])((function(){return[Up]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",Gp,[Xp,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(o).color,"onUpdate:modelValue":t[1]||(t[1]=function(e){return r({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(o).color,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",Yp,[Zp,Object(y["createVNode"])(i,{value:Object(y["unref"])(o).width,onChange:t[2]||(t[2]=function(e){return r({width:e})}),style:{flex:"3"}},null,8,["value"])]),Object(y["createElementVNode"])("div",Wp,[Jp,Object(y["createVNode"])(c,{style:{flex:"3"},value:Object(y["unref"])(o).points[0],onChange:t[3]||(t[3]=function(e){return r({points:[e,Object(y["unref"])(o).points[1]]})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:""},{default:Object(y["withCtx"])((function(){return[Kp]})),_:1}),Object(y["createVNode"])(n,{value:"arrow"},{default:Object(y["withCtx"])((function(){return[Qp]})),_:1}),Object(y["createVNode"])(n,{value:"dot"},{default:Object(y["withCtx"])((function(){return[$p]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",em,[tm,Object(y["createVNode"])(c,{style:{flex:"3"},value:Object(y["unref"])(o).points[1],onChange:t[4]||(t[4]=function(e){return r({points:[Object(y["unref"])(o).points[0],e]})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:""},{default:Object(y["withCtx"])((function(){return[nm]})),_:1}),Object(y["createVNode"])(n,{value:"arrow"},{default:Object(y["withCtx"])((function(){return[cm]})),_:1}),Object(y["createVNode"])(n,{value:"dot"},{default:Object(y["withCtx"])((function(){return[om]})),_:1})]})),_:1},8,["value"])]),Object(y["createVNode"])(u),Object(y["createVNode"])(yb)])}}});n("d806");const lm=pn()(am,[["__scopeId","data-v-938968a2"]]);var rm=lm,im={class:"chart-data-editor"},um={class:"editor-content"},dm={class:"range-box"},sm=["id","onFocus","onPaste"],fm={class:"btns"},bm={class:"left"},pm=Object(y["createTextVNode"])("清空"),mm={class:"right"},Om=Object(y["createTextVNode"])("取消"),vm=Object(y["createTextVNode"])("确认"),jm=Object(y["defineComponent"])({__name:"ChartDataEditor",props:{data:{type:Object,required:!0}},emits:["save","close"],setup:function(e,t){var n=t.emit,c=e,o=100,a=32,l=Object(y["ref"])([0,0]),r=Object(y["ref"])({width:0,height:0}),i=Object(y["ref"])(null),u=Object(y["computed"])((function(){var e=l.value[0]*o,t=l.value[1]*a;return[{type:"t",style:{width:e+"px"}},{type:"b",style:{top:t+"px",width:e+"px"}},{type:"l",style:{height:t+"px"}},{type:"r",style:{left:e+"px",height:t+"px"}}]})),d=Object(y["computed"])((function(){var e=l.value[0]*o,t=l.value[1]*a;return{left:e+"px",top:t+"px"}})),s=function(){var e=[],t=c.data,n=t.labels,o=t.legends,a=t.series,r=n.length,i=a.length;e.push([""].concat(Object(Q["a"])(o)));for(var u=0;u.5*o&&(d+=o-d%o),s%a>.5*a&&(s+=a-s%a);var f=Math.round(s/a),b=Math.round(d/o);f<3&&(f=3),b<2&&(b=2),l.value=[b,f],r.value={width:0,height:0}}}};return function(e,t){var n=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",im,[Object(y["createElementVNode"])("div",um,[Object(y["createElementVNode"])("div",dm,[Object(y["createElementVNode"])("div",{class:"temp-range",style:Object(y["normalizeStyle"])({width:r.value.width+"px",height:r.value.height+"px"})},null,4),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(u),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["range-line",e.type]),key:e.type,style:Object(y["normalizeStyle"])(e.style)},null,6)})),128)),Object(y["createElementVNode"])("div",{class:"resizable",style:Object(y["normalizeStyle"])(Object(y["unref"])(d)),onMousedown:t[0]||(t[0]=Object(y["withModifiers"])((function(e){return j(e)}),["stop"]))},null,36)]),Object(y["createElementVNode"])("table",null,[Object(y["createElementVNode"])("tbody",null,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(31,(function(e){return Object(y["createElementVNode"])("tr",{key:e},[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(7,(function(t){return Object(y["createElementVNode"])("td",{key:t,class:Object(y["normalizeClass"])({head:1===t&&e<=l.value[1]||1===e&&t<=l.value[0]})},[Object(y["createElementVNode"])("input",{class:Object(y["normalizeClass"])(["item",{selected:e<=l.value[1]&&t<=l.value[0]}]),id:"cell-".concat(e-1,"-").concat(t-1),autocomplete:"off",onFocus:function(n){return i.value=[e-1,t-1]},onPaste:function(n){return O(n,e-1,t-1)}},null,42,sm)],2)})),64))])})),64))])])]),Object(y["createElementVNode"])("div",fm,[Object(y["createElementVNode"])("div",bm,[Object(y["createVNode"])(n,{class:"btn",onClick:t[1]||(t[1]=function(e){return m()})},{default:Object(y["withCtx"])((function(){return[pm]})),_:1})]),Object(y["createElementVNode"])("div",mm,[Object(y["createVNode"])(n,{class:"btn",onClick:t[2]||(t[2]=function(e){return v()})},{default:Object(y["withCtx"])((function(){return[Om]})),_:1}),Object(y["createVNode"])(n,{type:"primary",class:"btn",onClick:t[3]||(t[3]=function(e){return p()}),style:{"margin-left":"10px"}},{default:Object(y["withCtx"])((function(){return[vm]})),_:1})])])])}}});n("ca17");const hm=pn()(jm,[["__scopeId","data-v-53b32689"]]);var ym=hm,gm=function(e){return Object(y["pushScopeId"])("data-v-769d6876"),e=e(),Object(y["popScopeId"])(),e},xm={class:"chart-style-panel"},km=Object(y["createTextVNode"])(" 编辑图表数据 "),Cm={class:"row"},Nm=Object(y["createTextVNode"])("面积图样式"),Em=Object(y["createTextVNode"])("散点图样式"),wm={class:"row"},Vm=Object(y["createTextVNode"])("使用平滑曲线"),Im={key:1,class:"row"},Bm=Object(y["createTextVNode"])("条形图样式"),Sm=Object(y["createTextVNode"])("堆叠样式"),Lm={key:2,class:"row"},_m=Object(y["createTextVNode"])("环形图样式"),Tm={class:"row"},Mm=gm((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"图例:",-1)})),Dm=Object(y["createTextVNode"])("不显示"),zm=Object(y["createTextVNode"])("显示在上方"),Fm=Object(y["createTextVNode"])("显示在下方"),Am={class:"row"},Rm=gm((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"背景填充:",-1)})),Pm={class:"row"},Hm=gm((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"网格颜色:",-1)})),qm={style:{flex:"2"}},Um={class:"color-btn-wrap",style:{flex:"3"}},Gm=["onClick"],Xm={class:"preset-themes"},Ym=["onClick","onMouseenter"],Zm=Object(y["createTextVNode"])("推荐主题"),Wm=Object(y["createTextVNode"])(" 添加主题色 "),Jm=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=[["#d87c7c","#919e8b","#d7ab82","#6e7074","#61a0a8","#efa18d"],["#dd6b66","#759aa0","#e69d87","#8dc1a9","#ea7e53","#eedd78"],["#516b91","#59c4e6","#edafda","#93b7e3","#a5e7f0","#cbb0e3"],["#893448","#d95850","#eb8146","#ffb248","#f2d643","#ebdba4"],["#4ea397","#22c3aa","#7bd9a5","#d0648a","#f58db2","#f2b3c9"],["#3fb1e3","#6be6c1","#626c91","#a0a7e6","#c4ebad","#96dee8"],["#fc97af","#87f7cf","#f7f494","#72ccff","#f7c5a0","#d4a4eb"],["#c1232b","#27727b","#fcce10","#e87c25","#b5c334","#fe8463"],["#2ec7c9","#b6a2de","#5ab1ef","#ffb980","#d87a80","#8d98b3"],["#e01f54","#001852","#f5e8c8","#b8d2c7","#c6b38e","#a4d8c2"],["#c12e34","#e6b600","#0098d9","#2b821d","#005eaa","#339ca8"],["#8a7ca8","#e098c7","#8fd3e8","#71669e","#cc70af","#7cb4cc"]],n=ie(),c=ae(),o=Object(g["c"])(n),a=o.handleElement,l=o.handleElementId,r=Object(g["c"])(c),i=r.theme,u=a,d=Object(y["ref"])(!1),s=Object(y["ref"])(!1),f=Object(y["ref"])([-1,-1]),b=at(),p=b.addHistorySnapshot,m=Object(y["ref"])("#000"),O=Object(y["ref"])([]),v=Object(y["ref"])(""),j=Object(y["ref"])(""),h=Object(y["ref"])(!0),x=Object(y["ref"])(!0),k=Object(y["ref"])(!1),C=Object(y["ref"])(!1),N=Object(y["ref"])(!1),E=Object(y["ref"])(!1);Object(y["watch"])(a,(function(){if(a.value&&"chart"===a.value.type){if(m.value=a.value.fill||"#fff",a.value.options){var e=a.value.options,t=e.lineSmooth,n=e.showLine,c=e.showArea,o=e.horizontalBars,l=e.donut,r=e.stackBars;void 0!==t&&(h.value=t),void 0!==n&&(x.value=n),void 0!==c&&(k.value=c),void 0!==o&&(C.value=o),void 0!==l&&(N.value=l),void 0!==r&&(E.value=r)}O.value=a.value.themeColor,v.value=a.value.gridColor||"#333",j.value=a.value.legend||""}}),{deep:!0,immediate:!0});var w=function(e){c.updateElement({id:l.value,props:e}),p()},V=function(e){d.value=!1,w({data:e})},I=function(e){w({fill:e})},B=function(e){var t=a.value,n=Object(S["a"])(Object(S["a"])({},t.options),e);w({options:n})},L=function(e,t){var n={themeColor:O.value.map((function(n,c){return c===t?e:n}))};w(n)},_=function(){var e={themeColor:[].concat(Object(Q["a"])(O.value),[i.value.themeColor])};w(e)},T=function(e,t){var n=e.slice(0,t+1);w({themeColor:n}),s.value=!1},M=function(e){var t={themeColor:O.value.filter((function(t,n){return n!==e}))};w(t)},D=function(e){w({gridColor:e})},z=function(e){w({legend:e})},F=function(){return d.value=!0};return ta.on(fo.OPEN_CHART_DATA_EDITOR,F),Object(y["onUnmounted"])((function(){ta.off(fo.OPEN_CHART_DATA_EDITOR,F)})),function(e,n){var c=Object(y["resolveComponent"])("IconEdit"),o=Object(y["resolveComponent"])("Button"),a=Object(y["resolveComponent"])("Divider"),l=Object(y["resolveComponent"])("Checkbox"),r=Object(y["resolveComponent"])("SelectOption"),i=Object(y["resolveComponent"])("Select"),b=Object(y["resolveComponent"])("ColorPicker"),p=Object(y["resolveComponent"])("Popover"),g=Object(y["resolveComponent"])("IconCloseSmall"),w=Object(y["resolveComponent"])("Tooltip"),S=Object(y["resolveComponent"])("IconPlus"),F=Object(y["resolveComponent"])("ButtonGroup"),A=Object(y["resolveComponent"])("Modal");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",xm,[Object(y["createVNode"])(o,{class:"full-width-btn",onClick:n[0]||(n[0]=function(e){return d.value=!0})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{class:"btn-icon"}),km]})),_:1}),Object(y["createVNode"])(a),"line"===Object(y["unref"])(u).chartType?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createElementVNode"])("div",Cm,[Object(y["createVNode"])(l,{onChange:n[1]||(n[1]=function(e){return B({showArea:e.target.checked})}),checked:k.value,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Nm]})),_:1},8,["checked"]),Object(y["createVNode"])(l,{onChange:n[2]||(n[2]=function(e){return B({showLine:!e.target.checked})}),checked:!x.value,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Em]})),_:1},8,["checked"])]),Object(y["createElementVNode"])("div",wm,[Object(y["createVNode"])(l,{onChange:n[3]||(n[3]=function(e){return B({lineSmooth:e.target.checked})}),checked:h.value},{default:Object(y["withCtx"])((function(){return[Vm]})),_:1},8,["checked"])])],64)):Object(y["createCommentVNode"])("",!0),"bar"===Object(y["unref"])(u).chartType?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Im,[Object(y["createVNode"])(l,{onChange:n[4]||(n[4]=function(e){return B({horizontalBars:e.target.checked})}),checked:C.value},{default:Object(y["withCtx"])((function(){return[Bm]})),_:1},8,["checked"]),Object(y["createVNode"])(l,{onChange:n[5]||(n[5]=function(e){return B({stackBars:e.target.checked})}),checked:E.value},{default:Object(y["withCtx"])((function(){return[Sm]})),_:1},8,["checked"])])):Object(y["createCommentVNode"])("",!0),"pie"===Object(y["unref"])(u).chartType?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Lm,[Object(y["createVNode"])(l,{onChange:n[6]||(n[6]=function(e){return B({donut:e.target.checked})}),checked:N.value},{default:Object(y["withCtx"])((function(){return[_m]})),_:1},8,["checked"])])):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(a),Object(y["createElementVNode"])("div",Tm,[Mm,Object(y["createVNode"])(i,{style:{flex:"3"},value:j.value,onChange:n[7]||(n[7]=function(e){return z(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r,{value:""},{default:Object(y["withCtx"])((function(){return[Dm]})),_:1}),Object(y["createVNode"])(r,{value:"top"},{default:Object(y["withCtx"])((function(){return[zm]})),_:1}),Object(y["createVNode"])(r,{value:"bottom"},{default:Object(y["withCtx"])((function(){return[Fm]})),_:1})]})),_:1},8,["value"])]),Object(y["createVNode"])(a),Object(y["createElementVNode"])("div",Am,[Rm,Object(y["createVNode"])(p,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(b,{modelValue:m.value,"onUpdate:modelValue":n[8]||(n[8]=function(e){return I(e)})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:m.value,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",Pm,[Hm,Object(y["createVNode"])(p,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(b,{modelValue:v.value,"onUpdate:modelValue":n[9]||(n[9]=function(e){return D(e)})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:v.value,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createVNode"])(a),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(O.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"row",key:t},[Object(y["createElementVNode"])("div",qm,Object(y["toDisplayString"])(0===t?"主题配色:":""),1),Object(y["createVNode"])(p,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(b,{modelValue:e,"onUpdate:modelValue":function(e){return L(e,t)}},null,8,["modelValue","onUpdate:modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",Um,[Object(y["createVNode"])(Hf,{color:e,style:{width:"100%"}},null,8,["color"]),Object(y["createVNode"])(w,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"删除"},{default:Object(y["withCtx"])((function(){return[0!==t?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"delete-color-btn",onClick:Object(y["withModifiers"])((function(e){return M(t)}),["stop"])},[Object(y["createVNode"])(g)],8,Gm)):Object(y["createCommentVNode"])("",!0)]})),_:2},1032,["mouseEnterDelay"])])]})),_:2},1024)])})),128)),Object(y["createVNode"])(F,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(p,{trigger:"click",visible:s.value,"onUpdate:visible":n[11]||(n[11]=function(e){return s.value=e})},{content:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",Xm,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(t,(function(e,t){return Object(y["createElementVNode"])("div",{class:"preset-theme",key:t},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e,(function(c,o){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["preset-theme-color",{select:f.value[0]===t&&o<=f.value[1]}]),key:c,style:Object(y["normalizeStyle"])({backgroundColor:c}),onClick:function(t){return T(e,o)},onMouseenter:function(e){return f.value=[t,o]},onMouseleave:n[10]||(n[10]=function(e){return f.value=[-1,-1]})},null,46,Ym)})),128))])})),64))])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{class:"no-padding",style:{flex:"2"}},{default:Object(y["withCtx"])((function(){return[Zm]})),_:1})]})),_:1},8,["visible"]),Object(y["createVNode"])(o,{class:"no-padding",disabled:O.value.length>=10,style:{flex:"3"},onClick:n[12]||(n[12]=function(e){return _()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(S,{class:"btn-icon"}),Wm]})),_:1},8,["disabled"])]})),_:1}),Object(y["createVNode"])(a),Object(y["createVNode"])(ob),Object(y["createVNode"])(A,{visible:d.value,"onUpdate:visible":n[15]||(n[15]=function(e){return d.value=e}),footer:null,centered:"",closable:!1,width:648,destroyOnClose:""},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(ym,{data:Object(y["unref"])(u).data,onClose:n[13]||(n[13]=function(e){return d.value=!1}),onSave:n[14]||(n[14]=function(e){return V(e)})},null,8,["data"])]})),_:1},8,["visible"])])}}});n("d074");const Km=pn()(Jm,[["__scopeId","data-v-769d6876"]]);var Qm=Km,$m=function(e){return Object(y["pushScopeId"])("data-v-7e28e1d8"),e=e(),Object(y["popScopeId"])(),e},eO={class:"table-style-panel"},tO={class:"row"},nO=$m((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"行数:",-1)})),cO={class:"set-count",style:{flex:"3"}},oO={class:"count-text"},aO={class:"row"},lO=$m((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"列数:",-1)})),rO={class:"set-count",style:{flex:"3"}},iO={class:"count-text"},uO={class:"row theme-switch"},dO=$m((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"启用主题表格:",-1)})),sO={class:"switch-wrapper",style:{flex:"3"}},fO={class:"row"},bO=Object(y["createTextVNode"])("标题行"),pO=Object(y["createTextVNode"])("汇总行"),mO={class:"row"},OO=Object(y["createTextVNode"])("第一列"),vO=Object(y["createTextVNode"])("最后一列"),jO={class:"row"},hO=$m((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"主题颜色:",-1)})),yO=Object(y["defineComponent"])({__name:"TableStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=n.handleElementId,a=n.selectedTableCells,l=n.availableFonts,r=Object(y["computed"])((function(){return t.theme.themeColor})),i=["12px","14px","16px","18px","20px","22px","24px","28px","32px"],u=Object(y["ref"])({bold:!1,em:!1,underline:!1,strikethrough:!1,color:"#000",backcolor:"#000",fontsize:"12px",fontname:"微软雅黑",align:"left"}),d=Object(y["ref"])(),s=Object(y["ref"])(!1),f=Object(y["ref"])(0),b=Object(y["ref"])(0),p=Object(y["ref"])(0),m=Object(y["ref"])(0);Object(y["watch"])(c,(function(){c.value&&"table"===c.value.type&&(d.value=c.value.theme,s.value=!!d.value,f.value=c.value.data.length,b.value=c.value.data[0].length,p.value=c.value.data.length,m.value=c.value.data[0].length)}),{deep:!0,immediate:!0});var O=at(),v=O.addHistorySnapshot,j=function(){if(c.value&&"table"===c.value.type){var e=0,t=0;if(a.value.length){var n=a.value[0];e=+n.split("_")[0],t=+n.split("_")[1]}var o=c.value.data[e][t].style;u.value=o?{bold:!!o.bold,em:!!o.em,underline:!!o.underline,strikethrough:!!o.strikethrough,color:o.color||"#000",backcolor:o.backcolor||"#000",fontsize:o.fontsize||"12px",fontname:o.fontname||"微软雅黑",align:o.align||"left"}:{bold:!1,em:!1,underline:!1,strikethrough:!1,color:"#000",backcolor:"#000",fontsize:"12px",fontname:"微软雅黑",align:"left"}}};Object(y["onMounted"])((function(){a.value.length&&j()})),Object(y["watch"])(a,j);var h=function(e){t.updateElement({id:o.value,props:e}),v()},k=function(e){for(var t=c.value,n=JSON.parse(JSON.stringify(t.data)),o=0;on){var o=new Array(b.value).fill({id:Object(x["b"])(10),colspan:1,rowspan:1,text:""}),a=new Array(e-n).fill(o),l=JSON.parse(JSON.stringify(t.data));l.push.apply(l,Object(Q["a"])(a)),h({data:l})}else{var r=t.data.slice(0,e);h({data:r})}},w=function(e){var t=c.value,n=t.data[0].length,o=t.data,a=t.colWidths.map((function(e){return e*t.width}));if(e>n){var l;o=o.map((function(t){var c=new Array(e-n).fill({id:Object(x["b"])(10),colspan:1,rowspan:1,text:""});return t.push.apply(t,Object(Q["a"])(c)),t}));var r=new Array(e-n).fill(100);(l=a).push.apply(l,Object(Q["a"])(r))}else o=o.map((function(t){return t.slice(0,e)})),a=a.slice(0,e);var i=a.reduce((function(e,t){return e+t})),u=a.map((function(e){return e/i})),d={width:i,data:o,colWidths:u};h(d)};return function(e,t){var n=Object(y["resolveComponent"])("IconFontSize"),c=Object(y["resolveComponent"])("SelectOption"),o=Object(y["resolveComponent"])("SelectOptGroup"),a=Object(y["resolveComponent"])("Select"),r=Object(y["resolveComponent"])("IconAddText"),p=Object(y["resolveComponent"])("InputGroup"),m=Object(y["resolveComponent"])("ColorPicker"),O=Object(y["resolveComponent"])("IconText"),v=Object(y["resolveComponent"])("Button"),j=Object(y["resolveComponent"])("Tooltip"),h=Object(y["resolveComponent"])("Popover"),g=Object(y["resolveComponent"])("IconFill"),x=Object(y["resolveComponent"])("ButtonGroup"),V=Object(y["resolveComponent"])("IconTextBold"),I=Object(y["resolveComponent"])("CheckboxButton"),S=Object(y["resolveComponent"])("IconTextItalic"),L=Object(y["resolveComponent"])("IconTextUnderline"),_=Object(y["resolveComponent"])("IconStrikethrough"),T=Object(y["resolveComponent"])("CheckboxButtonGroup"),M=Object(y["resolveComponent"])("IconAlignTextLeft"),D=Object(y["resolveComponent"])("RadioButton"),z=Object(y["resolveComponent"])("IconAlignTextCenter"),F=Object(y["resolveComponent"])("IconAlignTextRight"),A=Object(y["resolveComponent"])("RadioGroup"),R=Object(y["resolveComponent"])("Divider"),P=Object(y["resolveComponent"])("IconMinus"),H=Object(y["resolveComponent"])("IconPlus"),q=Object(y["resolveComponent"])("Switch"),U=Object(y["resolveComponent"])("Checkbox");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",eO,[Object(y["createVNode"])(p,{compact:"",class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{style:{flex:"3"},value:u.value.fontname,onChange:t[0]||(t[0]=function(e){return k({fontname:e})})},{suffixIcon:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n)]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{label:"系统字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(l),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",{style:Object(y["normalizeStyle"])({fontFamily:e.value})},Object(y["toDisplayString"])(e.label),5)]})),_:2},1032,["value"])})),128))]})),_:1}),Object(y["createVNode"])(o,{label:"在线字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(B),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(e.label),1)]})),_:2},1032,["value"])})),128))]})),_:1})]})),_:1},8,["value"]),Object(y["createVNode"])(a,{style:{flex:"2"},value:u.value.fontsize,onChange:t[1]||(t[1]=function(e){return k({fontsize:e})})},{suffixIcon:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r)]})),default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(i,(function(e){return Object(y["createVNode"])(c,{key:e,value:e},{default:Object(y["withCtx"])((function(){return[Object(y["createTextVNode"])(Object(y["toDisplayString"])(e),1)]})),_:2},1032,["value"])})),64))]})),_:1},8,["value"])]})),_:1}),Object(y["createVNode"])(x,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(h,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(m,{modelValue:u.value.color,"onUpdate:modelValue":t[2]||(t[2]=function(e){return k({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"文字颜色"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(v,{class:"text-color-btn",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(O),Object(y["createElementVNode"])("div",{class:"text-color-block",style:Object(y["normalizeStyle"])({backgroundColor:u.value.color})},null,4)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(h,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(m,{modelValue:u.value.backcolor,"onUpdate:modelValue":t[3]||(t[3]=function(e){return k({backcolor:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"单元格填充"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(v,{class:"text-color-btn",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g),Object(y["createElementVNode"])("div",{class:"text-color-block",style:Object(y["normalizeStyle"])({backgroundColor:u.value.backcolor})},null,4)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1})]})),_:1}),Object(y["createVNode"])(T,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"加粗"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{style:{flex:"1"},checked:u.value.bold,onClick:t[4]||(t[4]=function(e){return k({bold:!u.value.bold})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(V)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"斜体"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{style:{flex:"1"},checked:u.value.em,onClick:t[5]||(t[5]=function(e){return k({em:!u.value.em})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(S)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"下划线"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{style:{flex:"1"},checked:u.value.underline,onClick:t[6]||(t[6]=function(e){return k({underline:!u.value.underline})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(L)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"删除线"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(I,{style:{flex:"1"},checked:u.value.strikethrough,onClick:t[7]||(t[7]=function(e){return k({strikethrough:!u.value.strikethrough})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(_)]})),_:1},8,["checked"])]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(A,{class:"row","button-style":"solid",value:u.value.align,onChange:t[8]||(t[8]=function(e){return k({align:e.target.value})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"左对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(D,{value:"left",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(M)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"居中"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(D,{value:"center",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(z)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(j,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"右对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(D,{value:"right",style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(F)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1},8,["value"]),Object(y["createVNode"])(R),Object(y["createVNode"])(ob,{fixed:!0}),Object(y["createVNode"])(R),Object(y["createElementVNode"])("div",tO,[nO,Object(y["createElementVNode"])("div",cO,[Object(y["createVNode"])(v,{class:"btn",disabled:f.value<=1,onClick:t[9]||(t[9]=function(e){return E(f.value-1)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(P)]})),_:1},8,["disabled"]),Object(y["createElementVNode"])("div",oO,Object(y["toDisplayString"])(f.value),1),Object(y["createVNode"])(v,{class:"btn",disabled:f.value>=30,onClick:t[10]||(t[10]=function(e){return E(f.value+1)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(H)]})),_:1},8,["disabled"])])]),Object(y["createElementVNode"])("div",aO,[lO,Object(y["createElementVNode"])("div",rO,[Object(y["createVNode"])(v,{class:"btn",disabled:b.value<=1,onClick:t[11]||(t[11]=function(e){return w(b.value-1)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(P)]})),_:1},8,["disabled"]),Object(y["createElementVNode"])("div",iO,Object(y["toDisplayString"])(b.value),1),Object(y["createVNode"])(v,{class:"btn",disabled:b.value>=30,onClick:t[12]||(t[12]=function(e){return w(b.value+1)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(H)]})),_:1},8,["disabled"])])]),Object(y["createVNode"])(R),Object(y["createElementVNode"])("div",uO,[dO,Object(y["createElementVNode"])("div",sO,[Object(y["createVNode"])(q,{checked:s.value,onChange:t[13]||(t[13]=function(e){return N(e)})},null,8,["checked"])])]),d.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createElementVNode"])("div",fO,[Object(y["createVNode"])(U,{onChange:t[14]||(t[14]=function(e){return C({rowHeader:e.target.checked})}),checked:d.value.rowHeader,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[bO]})),_:1},8,["checked"]),Object(y["createVNode"])(U,{onChange:t[15]||(t[15]=function(e){return C({rowFooter:e.target.checked})}),checked:d.value.rowFooter,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[pO]})),_:1},8,["checked"])]),Object(y["createElementVNode"])("div",mO,[Object(y["createVNode"])(U,{onChange:t[16]||(t[16]=function(e){return C({colHeader:e.target.checked})}),checked:d.value.colHeader,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[OO]})),_:1},8,["checked"]),Object(y["createVNode"])(U,{onChange:t[17]||(t[17]=function(e){return C({colFooter:e.target.checked})}),checked:d.value.colFooter,style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[vO]})),_:1},8,["checked"])]),Object(y["createElementVNode"])("div",jO,[hO,Object(y["createVNode"])(h,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(m,{modelValue:d.value.color,"onUpdate:modelValue":t[18]||(t[18]=function(e){return C({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:d.value.color,style:{flex:"3"}},null,8,["color"])]})),_:1})])],64)):Object(y["createCommentVNode"])("",!0)])}}});n("dcd4");const gO=pn()(yO,[["__scopeId","data-v-7e28e1d8"]]);var xO=gO,kO=function(e){return Object(y["pushScopeId"])("data-v-546adf8c"),e=e(),Object(y["popScopeId"])(),e},CO={class:"latex-style-panel"},NO={class:"row"},EO=Object(y["createTextVNode"])("编辑 LaTeX"),wO={class:"row"},VO=kO((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"颜色:",-1)})),IO={class:"row"},BO=kO((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"粗细:",-1)})),SO=Object(y["defineComponent"])({__name:"LatexStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=c,a=Object(y["ref"])(!1),l=at(),r=l.addHistorySnapshot,i=function(e){c.value&&(t.updateElement({id:c.value.id,props:e}),r())},u=function(e){i({path:e.path,latex:e.latex,width:e.w,height:e.h,viewBox:[e.w,e.h]})},d=function(){return a.value=!0};return ta.on(fo.OPEN_LATEX_EDITOR,d),Object(y["onUnmounted"])((function(){ta.off(fo.OPEN_LATEX_EDITOR,d)})),function(e,t){var n=Object(y["resolveComponent"])("Button"),c=Object(y["resolveComponent"])("Divider"),l=Object(y["resolveComponent"])("ColorPicker"),r=Object(y["resolveComponent"])("Popover"),d=Object(y["resolveComponent"])("InputNumber"),s=Object(y["resolveComponent"])("Modal");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",CO,[Object(y["createElementVNode"])("div",NO,[Object(y["createVNode"])(n,{style:{flex:"1"},onClick:t[0]||(t[0]=function(e){return a.value=!0})},{default:Object(y["withCtx"])((function(){return[EO]})),_:1})]),Object(y["createVNode"])(c),Object(y["createElementVNode"])("div",wO,[VO,Object(y["createVNode"])(r,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(l,{modelValue:Object(y["unref"])(o).color,"onUpdate:modelValue":t[1]||(t[1]=function(e){return i({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(o).color,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",IO,[BO,Object(y["createVNode"])(d,{min:1,max:3,value:Object(y["unref"])(o).strokeWidth,onChange:t[2]||(t[2]=function(e){return i({strokeWidth:e})}),style:{flex:"3"}},null,8,["value"])]),Object(y["createVNode"])(s,{visible:a.value,"onUpdate:visible":t[5]||(t[5]=function(e){return a.value=e}),footer:null,centered:"",width:880,destroyOnClose:""},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(af,{value:Object(y["unref"])(o).latex,onClose:t[3]||(t[3]=function(e){return a.value=!1}),onUpdate:t[4]||(t[4]=function(e){u(e),a.value=!1})},null,8,["value"])]})),_:1},8,["visible"])])}}});n("c041");const LO=pn()(SO,[["__scopeId","data-v-546adf8c"]]);var _O=LO,TO=function(e){return Object(y["pushScopeId"])("data-v-ff7125dc"),e=e(),Object(y["popScopeId"])(),e},MO={class:"video-style-panel"},DO=TO((function(){return Object(y["createElementVNode"])("div",{class:"title"},"视频预览封面",-1)})),zO={class:"background-image-wrapper"},FO={class:"background-image"},AO={class:"row"},RO=Object(y["createTextVNode"])("重置封面"),PO=Object(y["defineComponent"])({__name:"VideoStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=c,a=at(),l=a.addHistorySnapshot,r=function(e){c.value&&(t.updateElement({id:c.value.id,props:e}),l())},i=function(e){var t=e[0];t&&et(t).then((function(e){return r({poster:e})}))};return function(e,t){var n=Object(y["resolveComponent"])("IconPlus"),c=Object(y["resolveComponent"])("FileInput"),a=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",MO,[DO,Object(y["createElementVNode"])("div",zO,[Object(y["createVNode"])(c,{onChange:t[0]||(t[0]=function(e){return i(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",FO,[Object(y["createElementVNode"])("div",{class:"content",style:Object(y["normalizeStyle"])({backgroundImage:"url(".concat(Object(y["unref"])(o).poster,")")})},[Object(y["createVNode"])(n)],4)])]})),_:1})]),Object(y["createElementVNode"])("div",AO,[Object(y["createVNode"])(a,{style:{flex:"1"},onClick:t[1]||(t[1]=function(e){return r({poster:""})})},{default:Object(y["withCtx"])((function(){return[RO]})),_:1})])])}}});n("a81a");const HO=pn()(PO,[["__scopeId","data-v-ff7125dc"]]);var qO=HO,UO=function(e){return Object(y["pushScopeId"])("data-v-5d723d50"),e=e(),Object(y["popScopeId"])(),e},GO={class:"audio-style-panel"},XO={class:"row"},YO=UO((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"图标颜色:",-1)})),ZO={class:"row switch-row"},WO=UO((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"自动播放:",-1)})),JO={class:"switch-wrapper",style:{flex:"3"}},KO={class:"row switch-row"},QO=UO((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"循环播放:",-1)})),$O={class:"switch-wrapper",style:{flex:"3"}},ev=Object(y["defineComponent"])({__name:"AudioStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=c,a=at(),l=a.addHistorySnapshot,r=function(e){c.value&&(t.updateElement({id:c.value.id,props:e}),l())};return function(e,t){var n=Object(y["resolveComponent"])("ColorPicker"),c=Object(y["resolveComponent"])("Popover"),a=Object(y["resolveComponent"])("Switch");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",GO,[Object(y["createElementVNode"])("div",XO,[YO,Object(y["createVNode"])(c,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{modelValue:Object(y["unref"])(o).color,"onUpdate:modelValue":t[0]||(t[0]=function(e){return r({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(o).color,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",ZO,[WO,Object(y["createElementVNode"])("div",JO,[Object(y["createVNode"])(a,{checked:Object(y["unref"])(o).autoplay,onChange:t[1]||(t[1]=function(e){return r({autoplay:e})})},null,8,["checked"])])]),Object(y["createElementVNode"])("div",KO,[QO,Object(y["createElementVNode"])("div",$O,[Object(y["createVNode"])(a,{checked:Object(y["unref"])(o).loop,onChange:t[2]||(t[2]=function(e){return r({loop:e})})},null,8,["checked"])])])])}}});n("795e");const tv=pn()(ev,[["__scopeId","data-v-5d723d50"]]);var nv=tv,cv=function(e){return Object(y["pushScopeId"])("data-v-71469855"),e=e(),Object(y["popScopeId"])(),e},ov={class:"multi-style-panel"},av={class:"row"},lv=cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"填充颜色:",-1)})),rv={class:"row"},iv=cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"边框样式:",-1)})),uv=Object(y["createTextVNode"])("实线边框"),dv=Object(y["createTextVNode"])("虚线边框"),sv={class:"row"},fv=cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"边框颜色:",-1)})),bv={class:"row"},pv=cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"边框粗细:",-1)})),mv=Object(y["createTextVNode"])("+"),Ov=Object(y["createTextVNode"])("-"),vv=Object(y["defineComponent"])({__name:"MultiStylePanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.richTextAttrs,o=n.availableFonts,a=n.activeElementList,l=at(),r=l.addHistorySnapshot,i=function(e,n){t.updateElement({id:e,props:n}),r()},u=["12px","14px","16px","18px","20px","22px","24px","28px","32px","36px","40px","44px","48px","54px","60px","66px","72px","76px","80px","88px","96px","104px","112px","120px"],d=Object(y["ref"])("#fff"),s=Object(y["ref"])({width:0,color:"#fff",style:"solid"}),f=function(e){var t,n=Object(L["a"])(a.value);try{for(n.s();!(t=n.n()).done;){var c=t.value;if("text"!==c.type&&"shape"!==c.type&&"chart"!==c.type||i(c.id,{fill:e}),"table"===c.type){for(var o=JSON.parse(JSON.stringify(c.data)),l=0;l1){if(!r.value)return hv;var e=a.value.find((function(e){return e.id===r.value}));return e&&n[e.type]||null}return l.value&&n[l.value.type]||null}));return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",yv,[(Object(y["openBlock"])(),Object(y["createBlock"])(Object(y["resolveDynamicComponent"])(Object(y["unref"])(i))))])}}});const xv=gv;var kv=xv,Cv=function(e){return Object(y["pushScopeId"])("data-v-43e5f476"),e=e(),Object(y["popScopeId"])(),e},Nv={class:"element-positopn-panel"},Ev=Cv((function(){return Object(y["createElementVNode"])("div",{class:"title"},"层级:",-1)})),wv=Object(y["createTextVNode"])(" 置于顶层"),Vv=Object(y["createTextVNode"])(" 置于底层"),Iv=Object(y["createTextVNode"])(" 上移一层"),Bv=Object(y["createTextVNode"])(" 下移一层"),Sv=Cv((function(){return Object(y["createElementVNode"])("div",{class:"title"},"对齐:",-1)})),Lv={class:"row"},_v=Cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"3"}},"位置:",-1)})),Tv=Cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"1"}},null,-1)})),Mv=Object(y["createStaticVNode"])('
X
Y
',1),Dv={class:"row"},zv=Cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"3"}},"大小:",-1)})),Fv={key:1,style:{flex:"1"}},Av=Object(y["createStaticVNode"])('
',1),Rv={class:"row"},Pv=Cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"3"}},"旋转:",-1)})),Hv=Cv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"1"}},null,-1)})),qv=Object(y["defineComponent"])({__name:"ElementPositionPanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.handleElement,o=n.handleElementId,a=Object(y["ref"])(0),l=Object(y["ref"])(0),r=Object(y["ref"])(0),i=Object(y["ref"])(0),u=Object(y["ref"])(0),d=Object(y["ref"])(!1),s=Object(y["computed"])((function(){return c.value&&dc[c.value.type]||20}));Object(y["watch"])(c,(function(){c.value&&(a.value=Object(te["round"])(c.value.left,1),l.value=Object(te["round"])(c.value.top,1),d.value="fixedRatio"in c.value&&!!c.value.fixedRatio,"line"!==c.value.type&&(r.value=Object(te["round"])(c.value.width,1),i.value=Object(te["round"])(c.value.height,1),u.value="rotate"in c.value&&void 0!==c.value.rotate?Object(te["round"])(c.value.rotate,1):0))}),{deep:!0,immediate:!0});var f=Ot(),b=f.orderElement,p=hc(),m=p.alignElementToCanvas,O=at(),v=O.addHistorySnapshot,j=function(e){var n={left:e};t.updateElement({id:o.value,props:n}),v()},h=function(e){var n={top:e};t.updateElement({id:o.value,props:n}),v()},x=function(e,t){if(c.value&&"shape"===c.value.type&&"pathFormula"in c.value&&c.value.pathFormula){var n=nt[c.value.pathFormula],o="";return o="editable"in n?n.formula(e,t,c.value.keypoint):n.formula(e,t),{viewBox:[e,t],path:o}}return null},N=function(e){var n={width:e},c=x(e,i.value);c&&(n=Object(S["a"])(Object(S["a"])({},n),c)),t.updateElement({id:o.value,props:n}),v()},E=function(e){var n={height:e},c=x(r.value,e);c&&(n=Object(S["a"])(Object(S["a"])({},n),c)),t.updateElement({id:o.value,props:n}),v()},w=function(e){var n={rotate:e};t.updateElement({id:o.value,props:n}),v()},V=function(e){var n={fixedRatio:e};t.updateElement({id:o.value,props:n}),v()},I=function(e){var n=45*Math.floor(u.value/45);"+"===e?n+=45:"-"===e&&(n-=45),n<-180&&(n=-180),n>180&&(n=180);var c={rotate:n};t.updateElement({id:o.value,props:c}),v()};return function(e,t){var n=Object(y["resolveComponent"])("IconSendToBack"),o=Object(y["resolveComponent"])("Button"),f=Object(y["resolveComponent"])("IconBringToFrontOne"),p=Object(y["resolveComponent"])("ButtonGroup"),O=Object(y["resolveComponent"])("IconBringToFront"),v=Object(y["resolveComponent"])("IconSentToBack"),g=Object(y["resolveComponent"])("Divider"),x=Object(y["resolveComponent"])("IconAlignLeft"),B=Object(y["resolveComponent"])("Tooltip"),S=Object(y["resolveComponent"])("IconAlignVertically"),L=Object(y["resolveComponent"])("IconAlignRight"),_=Object(y["resolveComponent"])("IconAlignTop"),T=Object(y["resolveComponent"])("IconAlignHorizontally"),M=Object(y["resolveComponent"])("IconAlignBottom"),D=Object(y["resolveComponent"])("InputNumber"),z=Object(y["resolveComponent"])("IconLock"),F=Object(y["resolveComponent"])("IconUnlock"),A=Object(y["resolveComponent"])("IconRotate");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Nv,[Ev,Object(y["createVNode"])(p,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[0]||(t[0]=function(e){return Object(y["unref"])(b)(Object(y["unref"])(c),Object(y["unref"])(k).TOP)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{class:"btn-icon"}),wv]})),_:1}),Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[1]||(t[1]=function(e){return Object(y["unref"])(b)(Object(y["unref"])(c),Object(y["unref"])(k).BOTTOM)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{class:"btn-icon"}),Vv]})),_:1})]})),_:1}),Object(y["createVNode"])(p,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[2]||(t[2]=function(e){return Object(y["unref"])(b)(Object(y["unref"])(c),Object(y["unref"])(k).UP)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(O,{class:"btn-icon"}),Iv]})),_:1}),Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[3]||(t[3]=function(e){return Object(y["unref"])(b)(Object(y["unref"])(c),Object(y["unref"])(k).DOWN)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(v,{class:"btn-icon"}),Bv]})),_:1})]})),_:1}),Object(y["createVNode"])(g),Sv,Object(y["createVNode"])(p,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"左对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[4]||(t[4]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).LEFT)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(x)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"水平居中"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[5]||(t[5]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).HORIZONTAL)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(S)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"右对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[6]||(t[6]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).RIGHT)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(L)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(p,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"上对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[7]||(t[7]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).TOP)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(_)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"垂直居中"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[8]||(t[8]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).VERTICAL)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(T)]})),_:1})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"下对齐"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{style:{flex:"1"},onClick:t[9]||(t[9]=function(e){return Object(y["unref"])(m)(Object(y["unref"])(C).BOTTOM)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(M)]})),_:1})]})),_:1},8,["mouseEnterDelay"])]})),_:1}),Object(y["createVNode"])(g),Object(y["createElementVNode"])("div",Lv,[_v,Object(y["createVNode"])(D,{step:5,value:a.value,onChange:t[10]||(t[10]=function(e){return j(e)}),style:{flex:"4"}},null,8,["value"]),Tv,Object(y["createVNode"])(D,{step:5,value:l.value,onChange:t[11]||(t[11]=function(e){return h(e)}),style:{flex:"4"}},null,8,["value"])]),Mv,"line"!==Object(y["unref"])(c).type?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createElementVNode"])("div",Dv,[zv,Object(y["createVNode"])(D,{min:Object(y["unref"])(s),max:1500,step:5,value:r.value,onChange:t[12]||(t[12]=function(e){return N(e)}),style:{flex:"4"}},null,8,["min","value"]),["image","shape","audio"].includes(Object(y["unref"])(c).type)?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[d.value?(Object(y["openBlock"])(),Object(y["createBlock"])(B,{key:0,mouseLeaveDelay:0,mouseEnterDelay:.5,title:"解除宽高比锁定"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(z,{style:{flex:"1"},class:"icon-btn",onClick:t[13]||(t[13]=function(e){return V(!1)})})]})),_:1},8,["mouseEnterDelay"])):(Object(y["openBlock"])(),Object(y["createBlock"])(B,{key:1,mouseLeaveDelay:0,mouseEnterDelay:.5,title:"宽高比锁定"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(F,{style:{flex:"1"},class:"icon-btn",onClick:t[14]||(t[14]=function(e){return V(!0)})})]})),_:1},8,["mouseEnterDelay"]))],64)):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Fv)),Object(y["createVNode"])(D,{min:Object(y["unref"])(s),max:800,step:5,disabled:"text"===Object(y["unref"])(c).type,value:i.value,onChange:t[15]||(t[15]=function(e){return E(e)}),style:{flex:"4"}},null,8,["min","disabled","value"])]),Av],64)):Object(y["createCommentVNode"])("",!0),["line","video","audio"].includes(Object(y["unref"])(c).type)?Object(y["createCommentVNode"])("",!0):(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:1},[Object(y["createVNode"])(g),Object(y["createElementVNode"])("div",Rv,[Pv,Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"逆时针旋转"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(A,{class:"icon-btn",onClick:t[16]||(t[16]=function(e){return I("-")}),style:{flex:"2"}})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(B,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"顺时针旋转"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(A,{class:"icon-btn",onClick:t[17]||(t[17]=function(e){return I("+")}),style:Object(y["normalizeStyle"])({flex:2,transform:"rotateY(180deg)"})},null,8,["style"])]})),_:1},8,["mouseEnterDelay"]),Hv,Object(y["createVNode"])(D,{min:-180,max:180,step:5,value:u.value,onChange:t[18]||(t[18]=function(e){return w(e)}),style:{flex:"4"}},null,8,["value"])])],64))])}}});n("cb45");const Uv=pn()(qv,[["__scopeId","data-v-43e5f476"]]);var Gv=Uv,Xv=1e3,Yv="click",Zv="animate__",Wv=[{type:"bounce",name:"弹跳",children:[{name:"弹入",value:"bounceIn"},{name:"向右弹入",value:"bounceInLeft"},{name:"向左弹入",value:"bounceInRight"},{name:"向上弹入",value:"bounceInUp"},{name:"向下弹入",value:"bounceInDown"}]},{type:"fade",name:"浮现",children:[{name:"浮入",value:"fadeIn"},{name:"向下浮入",value:"fadeInDown"},{name:"向下长距浮入",value:"fadeInDownBig"},{name:"向右浮入",value:"fadeInLeft"},{name:"向右长距浮入",value:"fadeInLeftBig"},{name:"向左浮入",value:"fadeInRight"},{name:"向左长距浮入",value:"fadeInRightBig"},{name:"向上浮入",value:"fadeInUp"},{name:"向上长距浮入",value:"fadeInUpBig"},{name:"从左上浮入",value:"fadeInTopLeft"},{name:"从右上浮入",value:"fadeInTopRight"},{name:"从左下浮入",value:"fadeInBottomLeft"},{name:"从右下浮入",value:"fadeInBottomRight"}]},{type:"rotate",name:"旋转",children:[{name:"旋转进入",value:"rotateIn"},{name:"绕左下进入",value:"rotateInDownLeft"},{name:"绕右下进入",value:"rotateInDownRight"},{name:"绕左上进入",value:"rotateInUpLeft"},{name:"绕右上进入",value:"rotateInUpRight"}]},{type:"zoom",name:"缩放",children:[{name:"放大进入",value:"zoomIn"},{name:"向下放大进入",value:"zoomInDown"},{name:"从左放大进入",value:"zoomInLeft"},{name:"从右放大进入",value:"zoomInRight"},{name:"向上放大进入",value:"zoomInUp"}]},{type:"slide",name:"滑入",children:[{name:"向下滑入",value:"slideInDown"},{name:"从右滑入",value:"slideInLeft"},{name:"从左滑入",value:"slideInRight"},{name:"向上滑入",value:"slideInUp"}]},{type:"flip",name:"翻转",children:[{name:"X轴翻转进入",value:"flipInX"},{name:"Y轴翻转进入",value:"flipInY"}]},{type:"back",name:"放大滑入",children:[{name:"向下放大滑入",value:"backInDown"},{name:"从左放大滑入",value:"backInLeft"},{name:"从右放大滑入",value:"backInRight"},{name:"向上放大滑入",value:"backInUp"}]},{type:"lightSpeed",name:"飞入",children:[{name:"从右飞入",value:"lightSpeedInRight"},{name:"从左飞入",value:"lightSpeedInLeft"}]}],Jv=[{type:"bounce",name:"弹跳",children:[{name:"弹出",value:"bounceOut"},{name:"向左弹出",value:"bounceOutLeft"},{name:"向右弹出",value:"bounceOutRight"},{name:"向上弹出",value:"bounceOutUp"},{name:"向下弹出",value:"bounceOutDown"}]},{type:"fade",name:"浮现",children:[{name:"浮出",value:"fadeOut"},{name:"向下浮出",value:"fadeOutDown"},{name:"向下长距浮出",value:"fadeOutDownBig"},{name:"向左浮出",value:"fadeOutLeft"},{name:"向左长距浮出",value:"fadeOutLeftBig"},{name:"向右浮出",value:"fadeOutRight"},{name:"向右长距浮出",value:"fadeOutRightBig"},{name:"向上浮出",value:"fadeOutUp"},{name:"向上长距浮出",value:"fadeOutUpBig"},{name:"从左上浮出",value:"fadeOutTopLeft"},{name:"从右上浮出",value:"fadeOutTopRight"},{name:"从左下浮出",value:"fadeOutBottomLeft"},{name:"从右下浮出",value:"fadeOutBottomRight"}]},{type:"rotate",name:"旋转",children:[{name:"旋转退出",value:"rotateOut"},{name:"绕左下退出",value:"rotateOutDownLeft"},{name:"绕右下退出",value:"rotateOutDownRight"},{name:"绕左上退出",value:"rotateOutUpLeft"},{name:"绕右上退出",value:"rotateOutUpRight"}]},{type:"zoom",name:"缩放",children:[{name:"缩小退出",value:"zoomOut"},{name:"向下缩小退出",value:"zoomOutDown"},{name:"从左缩小退出",value:"zoomOutLeft"},{name:"从右缩小退出",value:"zoomOutRight"},{name:"向上缩小退出",value:"zoomOutUp"}]},{type:"slide",name:"滑出",children:[{name:"向下滑出",value:"slideOutDown"},{name:"从左滑出",value:"slideOutLeft"},{name:"从右滑出",value:"slideOutRight"},{name:"向上滑出",value:"slideOutUp"}]},{type:"flip",name:"翻转",children:[{name:"X轴翻转退出",value:"flipOutX"},{name:"Y轴翻转退出",value:"flipOutY"}]},{type:"back",name:"缩小滑出",children:[{name:"向下缩小滑出",value:"backOutDown"},{name:"从左缩小滑出",value:"backOutLeft"},{name:"从右缩小滑出",value:"backOutRight"},{name:"向上缩小滑出",value:"backOutUp"}]},{type:"lightSpeed",name:"飞出",children:[{name:"从右飞出",value:"lightSpeedOutRight"},{name:"从左飞出",value:"lightSpeedOutLeft"}]}],Kv=[{type:"shake",name:"晃动",children:[{name:"左右摇晃",value:"shakeX"},{name:"上下摇晃",value:"shakeY"},{name:"摇头",value:"headShake"},{name:"摆动",value:"swing"},{name:"晃动",value:"wobble"},{name:"惊恐",value:"tada"},{name:"果冻",value:"jello"}]},{type:"other",name:"其他",children:[{name:"弹跳",value:"bounce"},{name:"闪烁",value:"flash"},{name:"脉搏",value:"pulse"},{name:"橡皮筋",value:"rubberBand"},{name:"心跳(快)",value:"heartBeat"}]}],Qv=function(e){return Object(y["pushScopeId"])("data-v-2f69234f"),e=e(),Object(y["popScopeId"])(),e},$v={class:"element-animation-panel"},ej={key:0,class:"element-animation"},tj={class:"tabs"},nj=["onClick"],cj={class:"type-title"},oj={class:"pool-item-wrapper"},aj=["onMouseenter","onClick"],lj={key:0,class:"mask"},rj=Object(y["createTextVNode"])(" 添加动画 "),ij={key:1,class:"tip"},uj=Object(y["createTextVNode"])(" 选中画布中的元素添加动画"),dj={class:"sequence-content"},sj={class:"index"},fj={class:"text"},bj={class:"handler"},pj={key:0,class:"configs"},mj={class:"config-item"},Oj=Qv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"3"}},"持续时长:",-1)})),vj={class:"config-item"},jj=Qv((function(){return Object(y["createElementVNode"])("div",{style:{flex:"3"}},"触发方式:",-1)})),hj=Object(y["createTextVNode"])("主动触发"),yj=Object(y["createTextVNode"])("与上一动画同时"),gj=Object(y["createTextVNode"])("上一动画之后"),xj={class:"config-item"},kj=Object(y["createTextVNode"])("更换动画"),Cj=Object(y["defineComponent"])({__name:"ElementAnimationPanel",setup:function(e){var t,n={},c=Object(L["a"])(Wv);try{for(c.s();!(t=c.n()).done;){var o,a=t.value,l=Object(L["a"])(a.children);try{for(l.s();!(o=l.n()).done;){var r=o.value;n[r.value]=r.name}}catch(ee){l.e(ee)}finally{l.f()}}}catch(ee){c.e(ee)}finally{c.f()}var i,u=Object(L["a"])(Jv);try{for(u.s();!(i=u.n()).done;){var d,s=i.value,f=Object(L["a"])(s.children);try{for(f.s();!(d=f.n()).done;){var b=d.value;n[b.value]=b.name}}catch(ee){f.e(ee)}finally{f.f()}}}catch(ee){u.e(ee)}finally{u.f()}var p,m=Object(L["a"])(Kv);try{for(m.s();!(p=m.n()).done;){var O,v=p.value,j=Object(L["a"])(v.children);try{for(j.s();!(O=j.n()).done;){var h=O.value;n[h.value]=h.name}}catch(ee){j.e(ee)}finally{j.f()}}}catch(ee){m.e(ee)}finally{m.f()}var k=["in","out","attention"],C=ae(),N=Object(g["c"])(ie()),E=N.handleElement,w=N.handleElementId,V=Object(g["c"])(C),I=V.currentSlide,B=V.formatedAnimations,_=V.currentSlideAnimations,T=[{key:"in",label:"入场"},{key:"out",label:"退场"},{key:"attention",label:"强调"}],M=Object(y["ref"])("in");Object(y["watch"])((function(){return w.value}),(function(){z.value=!1}));var D=Object(y["ref"])(""),z=Object(y["ref"])(!1),F=at(),A=F.addHistorySnapshot,R=Object(y["computed"])((function(){for(var e=[],t=0;t5e3)){var n=_.value.map((function(n){return n.id===e?Object(S["a"])(Object(S["a"])({},n),{},{duration:t}):n}));C.updateSlide({animations:n}),A()}},X=function(e,t){var n=_.value.map((function(n){return n.id===e?Object(S["a"])(Object(S["a"])({},n),{},{trigger:t}):n}));C.updateSlide({animations:n}),A()},Y=function(e,t){var n=_.value.map((function(n){return n.id===Z.value?Object(S["a"])(Object(S["a"])({},n),{},{type:e,effect:t}):n}));C.updateSlide({animations:n}),z.value=!1,A();var c=_.value.find((function(e){return e.elId===w.value})),o=(null===c||void 0===c?void 0:c.duration)||Xv;U(w.value,t,o)},Z=Object(y["ref"])(""),W=function(e,t){if(Z.value)Y(e,t);else{var n=JSON.parse(JSON.stringify(_.value));n.push({id:Object(x["b"])(10),elId:w.value,type:e,effect:t,duration:Xv,trigger:Yv}),C.updateSlide({animations:n}),z.value=!1,A(),U(w.value,t,Xv)}},J=Object(y["ref"])(!1),K=function(e){e?setTimeout((function(){return J.value=!0}),600):J.value=!1},Q=function(e){z.value=!0,Z.value=e,K(!0)},$={in:Wv,out:Jv,attention:Kv};return function(e,t){var n=Object(y["resolveComponent"])("IconEffects"),c=Object(y["resolveComponent"])("Button"),o=Object(y["resolveComponent"])("Popover"),a=Object(y["resolveComponent"])("IconClick"),l=Object(y["resolveComponent"])("Divider"),r=Object(y["resolveComponent"])("IconPlayOne"),i=Object(y["resolveComponent"])("Tooltip"),u=Object(y["resolveComponent"])("IconCloseSmall"),d=Object(y["resolveComponent"])("InputNumber"),s=Object(y["resolveComponent"])("SelectOption"),f=Object(y["resolveComponent"])("Select");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",$v,[Object(y["unref"])(E)?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ej,[Object(y["createVNode"])(o,{trigger:"click",visible:z.value,"onUpdate:visible":t[2]||(t[2]=function(e){return z.value=e}),onVisibleChange:t[3]||(t[3]=function(e){return K(e)})},{content:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",tj,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(T,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tab",e.key,{active:M.value===e.key}]),key:e.key,onClick:function(t){return M.value=e.key}},Object(y["toDisplayString"])(e.label),11,nj)})),64))]),(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(k,(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,[M.value===e?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["animation-pool",e]),key:e},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])($[e],(function(n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"pool-type",key:n.name},[Object(y["createElementVNode"])("div",cj,Object(y["toDisplayString"])(n.name)+":",1),Object(y["createElementVNode"])("div",oj,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(n.children,(function(n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"pool-item",key:n.name,onMouseenter:function(e){return D.value=n.value},onMouseleave:t[0]||(t[0]=function(e){return D.value=""}),onClick:function(t){return W(e,n.value)}},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["animation-box",["".concat(Object(y["unref"])(Zv),"animated"),"".concat(Object(y["unref"])(Zv),"fast"),D.value===n.value&&"".concat(Object(y["unref"])(Zv)).concat(n.value)]])},Object(y["toDisplayString"])(n.name),3)],40,aj)})),128))])])})),128)),J.value?Object(y["createCommentVNode"])("",!0):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",lj))],2)):Object(y["createCommentVNode"])("",!0)],64)})),64))]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{class:"element-animation-btn",onClick:t[1]||(t[1]=function(e){return Z.value=""})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{style:{"margin-right":"5px"}}),rj]})),_:1})]})),_:1},8,["visible"])])):(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ij,[Object(y["createVNode"])(a,{style:{"margin-right":"5px"}}),uj])),Object(y["createVNode"])(l),Object(y["createVNode"])(Object(y["unref"])(hf.a),{class:"animation-sequence",modelValue:Object(y["unref"])(R),animation:300,scroll:!0,scrollSensitivity:50,handle:".sequence-content",onEnd:q,itemKey:"id"},{item:Object(y["withCtx"])((function(e){var t,n,o=e.element;return[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["sequence-item",[o.type,{active:(null===(t=Object(y["unref"])(E))||void 0===t?void 0:t.id)===o.elId}]])},[Object(y["createElementVNode"])("div",dj,[Object(y["createElementVNode"])("div",sj,Object(y["toDisplayString"])(o.index),1),Object(y["createElementVNode"])("div",fj,"【"+Object(y["toDisplayString"])(o.elType)+"】"+Object(y["toDisplayString"])(o.animationEffect),1),Object(y["createElementVNode"])("div",bj,[Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"预览"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r,{class:"handler-btn",onClick:function(e){return U(o.elId,o.effect,o.duration)}},null,8,["onClick"])]})),_:2},1032,["mouseEnterDelay"]),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"删除"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(u,{class:"handler-btn",onClick:function(e){return H(o.id)}},null,8,["onClick"])]})),_:2},1032,["mouseEnterDelay"])])]),(null===(n=Object(y["unref"])(P)[0])||void 0===n?void 0:n.elId)===o.elId?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",pj,[Object(y["createVNode"])(l,{style:{margin:"16px 0"}}),Object(y["createElementVNode"])("div",mj,[Oj,Object(y["createVNode"])(d,{min:500,max:3e3,step:500,value:o.duration,onChange:function(e){return G(o.id,e)},style:{flex:"5"}},null,8,["value","onChange"])]),Object(y["createElementVNode"])("div",vj,[jj,Object(y["createVNode"])(f,{value:o.trigger,onChange:function(e){return X(o.id,e)},style:{flex:"5"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(s,{value:"click"},{default:Object(y["withCtx"])((function(){return[hj]})),_:1}),Object(y["createVNode"])(s,{value:"meantime"},{default:Object(y["withCtx"])((function(){return[yj]})),_:1}),Object(y["createVNode"])(s,{value:"auto"},{default:Object(y["withCtx"])((function(){return[gj]})),_:1})]})),_:2},1032,["value","onChange"])]),Object(y["createElementVNode"])("div",xj,[Object(y["createVNode"])(c,{style:{flex:"1"},onClick:function(e){return Q(o.id)}},{default:Object(y["withCtx"])((function(){return[kj]})),_:2},1032,["onClick"])])])):Object(y["createCommentVNode"])("",!0)],2)]})),_:1},8,["modelValue"])])}}});n("cc39");const Nj=pn()(Cj,[["__scopeId","data-v-2f69234f"]]);var Ej=Nj,wj=[{color:"#d14424",background:"#ffffff",text:"#333"},{color:"#42464b",background:"#ffffff",text:"#333"},{color:"#5d82ba",background:"#ffffff",text:"#333"},{color:"#005a6f",background:"#ffffff",text:"#333"},{color:"#d0614c",background:"#dfb044",text:"#333"},{color:"#86a1ad",background:"#dfdbd4",text:"#333"},{color:"#697586",background:"#d5c4a4",text:"#333"},{color:"#333333",background:"#7acfa6",text:"#333"},{color:"#42464b",background:"#415065",text:"#fff"},{color:"#0c5999",background:"#35a2cd",text:"#fff"},{color:"#c49a41",background:"#8c4357",text:"#fff"},{color:"#dfaa00",background:"#2e4e7d",text:"#fff"},{color:"#d1ad88",background:"#f99070",text:"#fff"},{color:"#464d52",background:"#657984",text:"#fff"},{color:"#ffcfb6",background:"#1e4c6f",text:"#fff"},{color:"#c3a043",background:"#43292a",text:"#fff"},{color:"#464d52",background:"#60546f",text:"#fff"},{color:"#df9636",background:"#5b89a0",text:"#fff"},{color:"#b898a4",background:"#93716b",text:"#fff"},{color:"#c47a11",background:"#187db1",text:"#fff"},{color:"#333333",background:"#759564",text:"#fff"},{color:"#355b5e",background:"#424b50",text:"#fff"},{color:"#d29090",background:"#942a32",text:"#fff"},{color:"#00cfdf",background:"#3b434d",text:"#fff"},{color:"#424246",background:"#c70042",text:"#fff"},{color:"#2e4155",background:"#b35d44",text:"#fff"},{color:"#11bfce",background:"#8f98aa",text:"#fff"},{color:"#333333",background:"#549688",text:"#fff"}],Vj=function(e){return Object(y["pushScopeId"])("data-v-e0bbbd9e"),e=e(),Object(y["popScopeId"])(),e},Ij={class:"slide-design-panel"},Bj=Vj((function(){return Object(y["createElementVNode"])("div",{class:"title"},"背景填充",-1)})),Sj={class:"row"},Lj=Object(y["createTextVNode"])("纯色填充"),_j=Object(y["createTextVNode"])("图片填充"),Tj=Object(y["createTextVNode"])("渐变填充"),Mj=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"1"}},null,-1)})),Dj=Object(y["createTextVNode"])("缩放"),zj=Object(y["createTextVNode"])("拼贴"),Fj=Object(y["createTextVNode"])("缩放铺满"),Aj=Object(y["createTextVNode"])("线性渐变"),Rj=Object(y["createTextVNode"])("径向渐变"),Pj={key:0,class:"background-image-wrapper"},Hj={class:"background-image"},qj={key:1,class:"background-gradient-wrapper"},Uj={class:"row"},Gj=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"起点颜色:",-1)})),Xj={class:"row"},Yj=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"终点颜色:",-1)})),Zj={key:0,class:"row"},Wj=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"渐变角度:",-1)})),Jj={class:"row"},Kj=Object(y["createTextVNode"])("应用背景到全部"),Qj={class:"row"},$j=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"画布尺寸:",-1)})),eh=Object(y["createTextVNode"])("宽屏 16 : 9"),th=Object(y["createTextVNode"])("宽屏 16 :10"),nh=Object(y["createTextVNode"])("标准 4 :3"),ch=Vj((function(){return Object(y["createElementVNode"])("div",{class:"title"},"全局主题",-1)})),oh={class:"row"},ah=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"字体:",-1)})),lh={class:"row"},rh=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"字体颜色:",-1)})),ih={class:"row"},uh=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"背景颜色:",-1)})),dh={class:"row"},sh=Vj((function(){return Object(y["createElementVNode"])("div",{style:{flex:"2"}},"主题色:",-1)})),fh=Object(y["createTextVNode"])(" 预置主题 "),bh={key:2,class:"theme-list"},ph=["onClick"],mh={class:"theme-item-content"},Oh={class:"row"},vh=Object(y["createTextVNode"])("应用主题到全部"),jh=Object(y["defineComponent"])({__name:"SlideDesignPanel",setup:function(e){var t=ae(),n=Object(g["c"])(ie()),c=n.availableFonts,o=Object(g["c"])(t),a=o.slides,l=o.currentSlide,r=o.viewportRatio,i=o.theme,u=Object(y["computed"])((function(){return l.value.background?l.value.background:{type:"solid",value:"#fff"}})),d=at(),s=d.addHistorySnapshot,f=function(e){if("solid"===e){var n=Object(S["a"])(Object(S["a"])({},u.value),{},{type:"solid",color:u.value.color||"#fff"});t.updateSlide({background:n})}else if("image"===e){var c=Object(S["a"])(Object(S["a"])({},u.value),{},{type:"image",image:u.value.image||"",imageSize:u.value.imageSize||"cover"});t.updateSlide({background:c})}else{var o=Object(S["a"])(Object(S["a"])({},u.value),{},{type:"gradient",gradientType:u.value.gradientType||"linear",gradientColor:u.value.gradientColor||["#fff","#fff"],gradientRotate:u.value.gradientRotate||0});t.updateSlide({background:o})}s()},b=function(e){t.updateSlide({background:Object(S["a"])(Object(S["a"])({},u.value),e)}),s()},p=function(e){var t=e[0];t&&et(t).then((function(e){return b({image:e})}))},m=function(){var e=a.value.map((function(e){return Object(S["a"])(Object(S["a"])({},e),{},{background:l.value.background})}));t.setSlides(e),s()},O=function(e){t.setTheme(e)},v=function(){var e,n=JSON.parse(JSON.stringify(a.value)),c=i.value,o=c.themeColor,l=c.backgroundColor,r=c.fontColor,u=c.fontName,d=Object(L["a"])(n);try{for(d.s();!(e=d.n()).done;){var f=e.value;f.background&&"image"===f.background.type||(f.background=Object(S["a"])(Object(S["a"])({},f.background),{},{type:"solid",color:l}));var b,p=f.elements,m=Object(L["a"])(p);try{for(m.s();!(b=m.n()).done;){var O=b.value;if("shape"===O.type)O.fill=o;else if("line"===O.type)O.color=o;else if("text"===O.type)O.defaultColor=r,O.defaultFontName=u,O.fill&&(O.fill=o);else if("table"===O.type){O.theme&&(O.theme.color=o);var v,j=Object(L["a"])(O.data);try{for(j.s();!(v=j.n()).done;){var h,y=v.value,g=Object(L["a"])(y);try{for(g.s();!(h=g.n()).done;){var x=h.value;x.style&&(x.style.color=r,x.style.fontname=u)}}catch(k){g.e(k)}finally{g.f()}}}catch(k){j.e(k)}finally{j.f()}}else"chart"===O.type?(O.themeColor=[o],O.gridColor=r):"latex"===O.type?O.color=r:"audio"===O.type&&(O.color=o)}}catch(k){m.e(k)}finally{m.f()}}}catch(k){d.e(k)}finally{d.f()}t.setSlides(n),s()},j=Object(y["ref"])(!0),h=function(){j.value=!j.value},x=function(e){t.setViewportRatio(e)};return function(e,t){var n=Object(y["resolveComponent"])("SelectOption"),o=Object(y["resolveComponent"])("Select"),a=Object(y["resolveComponent"])("ColorPicker"),l=Object(y["resolveComponent"])("Popover"),d=Object(y["resolveComponent"])("IconPlus"),s=Object(y["resolveComponent"])("FileInput"),g=Object(y["resolveComponent"])("Slider"),k=Object(y["resolveComponent"])("Button"),C=Object(y["resolveComponent"])("Divider"),N=Object(y["resolveComponent"])("SelectOptGroup"),E=Object(y["resolveComponent"])("IconDown");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Ij,[Bj,Object(y["createElementVNode"])("div",Sj,[Object(y["createVNode"])(o,{style:{flex:"10"},value:Object(y["unref"])(u).type,onChange:t[0]||(t[0]=function(e){return f(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:"solid"},{default:Object(y["withCtx"])((function(){return[Lj]})),_:1}),Object(y["createVNode"])(n,{value:"image"},{default:Object(y["withCtx"])((function(){return[_j]})),_:1}),Object(y["createVNode"])(n,{value:"gradient"},{default:Object(y["withCtx"])((function(){return[Tj]})),_:1})]})),_:1},8,["value"]),Mj,"solid"===Object(y["unref"])(u).type?(Object(y["openBlock"])(),Object(y["createBlock"])(l,{key:0,trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(u).color,"onUpdate:modelValue":t[1]||(t[1]=function(e){return b({color:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(u).color||"#fff",style:{flex:"10"}},null,8,["color"])]})),_:1})):"image"===Object(y["unref"])(u).type?(Object(y["openBlock"])(),Object(y["createBlock"])(o,{key:1,style:{flex:"10"},value:Object(y["unref"])(u).imageSize||"cover",onChange:t[2]||(t[2]=function(e){return b({imageSize:e})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:"contain"},{default:Object(y["withCtx"])((function(){return[Dj]})),_:1}),Object(y["createVNode"])(n,{value:"repeat"},{default:Object(y["withCtx"])((function(){return[zj]})),_:1}),Object(y["createVNode"])(n,{value:"cover"},{default:Object(y["withCtx"])((function(){return[Fj]})),_:1})]})),_:1},8,["value"])):(Object(y["openBlock"])(),Object(y["createBlock"])(o,{key:2,style:{flex:"10"},value:Object(y["unref"])(u).gradientType,onChange:t[3]||(t[3]=function(e){return b({gradientType:e})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:"linear"},{default:Object(y["withCtx"])((function(){return[Aj]})),_:1}),Object(y["createVNode"])(n,{value:"radial"},{default:Object(y["withCtx"])((function(){return[Rj]})),_:1})]})),_:1},8,["value"]))]),"image"===Object(y["unref"])(u).type?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Pj,[Object(y["createVNode"])(s,{onChange:t[4]||(t[4]=function(e){return p(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",Hj,[Object(y["createElementVNode"])("div",{class:"content",style:Object(y["normalizeStyle"])({backgroundImage:"url(".concat(Object(y["unref"])(u).image,")")})},[Object(y["createVNode"])(d)],4)])]})),_:1})])):Object(y["createCommentVNode"])("",!0),"gradient"===Object(y["unref"])(u).type?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",qj,[Object(y["createElementVNode"])("div",Uj,[Gj,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(u).gradientColor[0],"onUpdate:modelValue":t[5]||(t[5]=function(e){return b({gradientColor:[e,Object(y["unref"])(u).gradientColor[1]]})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(u).gradientColor[0],style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",Xj,[Yj,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(u).gradientColor[1],"onUpdate:modelValue":t[6]||(t[6]=function(e){return b({gradientColor:[Object(y["unref"])(u).gradientColor[0],e]})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(u).gradientColor[1],style:{flex:"3"}},null,8,["color"])]})),_:1})]),"linear"===Object(y["unref"])(u).gradientType?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Zj,[Wj,Object(y["createVNode"])(g,{class:"slider",min:0,max:360,step:15,value:Object(y["unref"])(u).gradientRotate,onChange:t[7]||(t[7]=function(e){return b({gradientRotate:e})})},null,8,["value"])])):Object(y["createCommentVNode"])("",!0)])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",Jj,[Object(y["createVNode"])(k,{style:{flex:"1"},onClick:t[8]||(t[8]=function(e){return m()})},{default:Object(y["withCtx"])((function(){return[Kj]})),_:1})]),Object(y["createVNode"])(C),Object(y["createElementVNode"])("div",Qj,[$j,Object(y["createVNode"])(o,{style:{flex:"3"},value:Object(y["unref"])(r),onChange:t[9]||(t[9]=function(e){return x(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{value:.5625},{default:Object(y["withCtx"])((function(){return[eh]})),_:1},8,["value"]),Object(y["createVNode"])(n,{value:.625},{default:Object(y["withCtx"])((function(){return[th]})),_:1},8,["value"]),Object(y["createVNode"])(n,{value:.75},{default:Object(y["withCtx"])((function(){return[nh]})),_:1},8,["value"])]})),_:1},8,["value"])]),Object(y["createVNode"])(C),ch,Object(y["createElementVNode"])("div",oh,[ah,Object(y["createVNode"])(o,{style:{flex:"3"},value:Object(y["unref"])(i).fontName,onChange:t[10]||(t[10]=function(e){return O({fontName:e})})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(N,{label:"系统字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(c),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(n,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",{style:Object(y["normalizeStyle"])({fontFamily:e.value})},Object(y["toDisplayString"])(e.label),5)]})),_:2},1032,["value"])})),128))]})),_:1}),Object(y["createVNode"])(N,{label:"在线字体"},{default:Object(y["withCtx"])((function(){return[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(B),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(n,{key:e.value,value:e.value},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(e.label),1)]})),_:2},1032,["value"])})),128))]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",lh,[rh,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(i).fontColor,"onUpdate:modelValue":t[11]||(t[11]=function(e){return O({fontColor:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(i).fontColor,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",ih,[uh,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(i).backgroundColor,"onUpdate:modelValue":t[12]||(t[12]=function(e){return O({backgroundColor:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(i).backgroundColor,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",dh,[sh,Object(y["createVNode"])(l,{trigger:"click"},{content:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{modelValue:Object(y["unref"])(i).themeColor,"onUpdate:modelValue":t[13]||(t[13]=function(e){return O({themeColor:e})})},null,8,["modelValue"])]})),default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(Hf,{color:Object(y["unref"])(i).themeColor,style:{flex:"3"}},null,8,["color"])]})),_:1})]),Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["title dropdown",{active:j.value}]),onClick:t[14]||(t[14]=function(e){return h()}),style:{"margin-top":"20px"}},[fh,Object(y["createVNode"])(E,{class:"icon"})],2),j.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",bh,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(wj),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"theme-item",key:t,style:Object(y["normalizeStyle"])({backgroundColor:e.background}),onClick:function(t){return O({fontColor:e.text,backgroundColor:e.background,themeColor:e.color})}},[Object(y["createElementVNode"])("div",mh,[Object(y["createElementVNode"])("div",{class:"text",style:Object(y["normalizeStyle"])({color:e.text})},"Aa",4),Object(y["createElementVNode"])("div",{class:"color-block",style:Object(y["normalizeStyle"])({backgroundColor:e.color})},null,4)])],12,ph)})),128))])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",Oh,[Object(y["createVNode"])(k,{style:{flex:"1"},onClick:t[15]||(t[15]=function(e){return v()})},{default:Object(y["withCtx"])((function(){return[vh]})),_:1})])])}}});n("60fd");const hh=pn()(jh,[["__scopeId","data-v-e0bbbd9e"]]);var yh=hh,gh={class:"slide-animation-panel"},xh={class:"animation-pool"},kh=["onClick"],Ch={class:"animation-text"},Nh=Object(y["createTextVNode"])("应用到全部"),Eh=Object(y["defineComponent"])({__name:"SlideAnimationPanel",setup:function(e){var t=ae(),n=Object(g["c"])(t),c=n.slides,o=n.currentSlide,a=Object(y["computed"])((function(){return o.value.turningMode||"slideY"})),l=[{label:"无",value:"no"},{label:"淡入淡出",value:"fade"},{label:"左右推移",value:"slideX"},{label:"上下推移",value:"slideY"}],r=at(),i=r.addHistorySnapshot,u=function(e){e!==a.value&&(t.updateSlide({turningMode:e}),i())},d=function(){var e=c.value.map((function(e){return Object(S["a"])(Object(S["a"])({},e),{},{turningMode:o.value.turningMode})}));t.setSlides(e),i()};return function(e,t){var n=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",gh,[Object(y["createElementVNode"])("div",xh,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(l,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["animation-item",{active:Object(y["unref"])(a)===e.value}]),key:e.label,onClick:function(t){return u(e.value)}},[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["animation-block",e.value])},null,2),Object(y["createElementVNode"])("div",Ch,Object(y["toDisplayString"])(e.label),1)],10,kh)})),64))]),Object(y["createVNode"])(n,{style:{width:"100%"},onClick:t[0]||(t[0]=function(e){return d()})},{default:Object(y["withCtx"])((function(){return[Nh]})),_:1})])}}});n("cc76");const wh=pn()(Eh,[["__scopeId","data-v-577ae912"]]);var Vh=wh,Ih=function(){var e=ae(),t=Object(g["c"])(ie()),n=t.activeElementIdList,c=t.activeElementList,o=Object(g["c"])(e),a=o.currentSlide,l=at(),r=l.addHistorySnapshot,i=function(t){var o,l=Xe(c.value),i=l.minX,u=l.maxX,d=l.minY,s=l.maxY,f=JSON.parse(JSON.stringify(a.value.elements)),b={},p=Object(L["a"])(c.value);try{var m=function(){var e=o.value;if(e.groupId&&!b[e.groupId]){var t=c.value.filter((function(t){return t.groupId===e.groupId}));b[e.groupId]=Xe(t)}};for(p.s();!(o=p.n()).done;)m()}catch(j){p.e(j)}finally{p.f()}if(t===C.LEFT)f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=t.minX-i;e.left=e.left-c}else if("rotate"in e&&e.rotate){var o=Ue({left:e.left,top:e.top,width:e.width,height:e.height,rotate:e.rotate}),a=o.offsetX;e.left=i-a}else e.left=i}));else if(t===C.RIGHT)f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=t.maxX-u;e.left=e.left-c}else{var o="line"===e.type?Math.max(e.start[0],e.end[0]):e.width;if("rotate"in e&&e.rotate){var a=Ue({left:e.left,top:e.top,width:e.width,height:e.height,rotate:e.rotate}),l=a.offsetX;e.left=u-o+l}else e.left=u-o}}));else if(t===C.TOP)f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=t.minY-d;e.top=e.top-c}else if("rotate"in e&&e.rotate){var o=Ue({left:e.left,top:e.top,width:e.width,height:e.height,rotate:e.rotate}),a=o.offsetY;e.top=d-a}else e.top=d}));else if(t===C.BOTTOM)f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=t.maxY-s;e.top=e.top-c}else{var o="line"===e.type?Math.max(e.start[1],e.end[1]):e.height;if("rotate"in e&&e.rotate){var a=Ue({left:e.left,top:e.top,width:e.width,height:e.height,rotate:e.rotate}),l=a.offsetY;e.top=s-o+l}else e.top=s-o}}));else if(t===C.HORIZONTAL){var O=(i+u)/2;f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=(t.maxX+t.minX)/2,o=c-O;e.left=e.left-o}else{var a="line"===e.type?Math.max(e.start[0],e.end[0]):e.width;e.left=O-a/2}}))}else if(t===C.VERTICAL){var v=(d+s)/2;f.forEach((function(e){if(n.value.includes(e.id))if(e.groupId){var t=b[e.groupId],c=(t.maxY+t.minY)/2,o=c-v;e.top=e.top-o}else{var a="line"===e.type?Math.max(e.start[1],e.end[1]):e.height;e.top=v-a/2}}))}e.updateSlide({elements:f}),r()};return{alignActiveElement:i}},Bh=(n("4e82"),function(){var e=ae(),t=Object(g["c"])(ie()),n=t.activeElementIdList,c=t.activeElementList,o=Object(g["c"])(e),a=o.currentSlide,l=at(),r=l.addHistorySnapshot,i=Object(y["computed"])((function(){var e,t=0,n=[],o=Object(L["a"])(c.value);try{for(o.s();!(e=o.n()).done;){var a=e.value;a.groupId?n.includes(a.groupId)||(n.push(a.groupId),t+=1):t+=1}}catch(l){o.e(l)}finally{o.f()}return t})),u=function(){var t,o=Xe(c.value),l=o.minX,i=o.maxX,u=JSON.parse(JSON.stringify(c.value)),d=JSON.parse(JSON.stringify(a.value.elements)),s=[],f=[],b=Object(L["a"])(u);try{var p=function(){var e=t.value;if(e.groupId){var n=f.find((function(t){return t.groupId===e.groupId}));n?f=f.map((function(t){return t.groupId===e.groupId?Object(S["a"])(Object(S["a"])({},t),{},{els:[].concat(Object(Q["a"])(t.els),[e])}):t})):f.push({groupId:e.groupId,els:[e]})}else{var c=Ge(e),o=c.minX,a=c.maxX;s.push({min:o,max:a,el:e})}};for(b.s();!(t=b.n()).done;)p()}catch(ae){b.e(ae)}finally{b.f()}var m,O=[],v=Object(L["a"])(f);try{for(v.s();!(m=v.n()).done;){var j=m.value,h=Xe(j.els),y=h.minX,g=h.maxX;O.push({min:y,max:g,els:j.els})}}catch(ae){v.e(ae)}finally{v.f()}var x=[].concat(s,O);x.sort((function(e,t){return e.min-t.min}));var k,C=0,N=Object(L["a"])(x);try{for(N.s();!(k=N.n()).done;){var E=k.value,w=E.max-E.min;C+=w}}catch(ae){N.e(ae)}finally{N.f()}var V=(i-l-C)/(x.length-1),I=[],B=x[0],_={min:B.min,max:B.max};if("el"in B)I.push({pos:B.min,el:B.el});else{var T,M=Object(L["a"])(B.els);try{for(M.s();!(T=M.n()).done;){var D=T.value,z=Ge(D),F=z.minX;I.push({pos:F,el:D})}}catch(ae){M.e(ae)}finally{M.f()}}for(var A=1;A2?(Object(y["openBlock"])(),Object(y["createBlock"])(p,{key:0,class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(l,{style:{flex:"1"},onClick:t[6]||(t[6]=function(e){return Object(y["unref"])(s)()})},{default:Object(y["withCtx"])((function(){return[Lh]})),_:1}),Object(y["createVNode"])(l,{style:{flex:"1"},onClick:t[7]||(t[7]=function(e){return Object(y["unref"])(f)()})},{default:Object(y["withCtx"])((function(){return[_h]})),_:1})]})),_:1})):Object(y["createCommentVNode"])("",!0),Object(y["createVNode"])(j),Object(y["createVNode"])(p,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(l,{disabled:!Object(y["unref"])(n),onClick:t[8]||(t[8]=function(e){return Object(y["unref"])(c)()}),style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(h,{style:{"margin-right":"3px"}}),Th]})),_:1},8,["disabled"]),Object(y["createVNode"])(l,{disabled:Object(y["unref"])(n),onClick:t[9]||(t[9]=function(e){return Object(y["unref"])(o)()}),style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(g,{style:{"margin-right":"3px"}}),Mh]})),_:1},8,["disabled"])]})),_:1})])}}});n("1855");const zh=pn()(Dh,[["__scopeId","data-v-0d3881c5"]]);var Fh=zh,Ah=[{key:"letter",label:"字母",children:["α","β","γ","δ","ϵ","ε","ζ","η","θ","ϑ","ι","κ","λ","μ","ν","ξ","π","ϖ","ρ","ϱ","σ","ς","τ","υ","ϕ","φ","χ","ψ","ω","Γ","Δ","Θ","Λ","Ξ","Π","Σ","Υ","Φ","Ψ","Ω","𝐀","𝐁","𝐂","𝐃","𝐄","𝐅","𝐆","𝐇","𝐈","𝐉","𝐊","𝐋","𝐌","𝐍","𝐎","𝐏","𝐐","𝐑","𝐒","𝐓","𝐔","𝐕","𝐖","𝐗","𝐘","𝐙","𝐚","𝐛","𝐜","𝐝","𝐞","𝐟","𝐠","𝐡","𝐢","𝐣","𝐤","𝐥","𝐦","𝐧","𝐨","𝐩","𝐪","𝐫","𝐬","𝐭","𝐮","𝐯","𝐰","𝐱","𝐲","𝐳","𝓐","𝓑","𝓒","𝓓","𝓔","𝓕","𝓖","𝓗","𝓘","𝓙","𝓚","𝓛","𝓜","𝓝","𝓞","𝓟","𝓠","𝓡","𝓢","𝓣","𝓤","𝓥","𝓦","𝓧","𝓨","𝓩","𝓪","𝓫","𝓬","𝓭","𝓮","𝓯","𝓰","𝓱","𝓲","𝓳","𝓴","𝓵","𝓶","𝓷","𝓸","𝓹","𝓺","𝓻","𝓼","𝓽","𝓾","𝓿","𝔀","𝔁","𝔂","𝔃"]},{key:"number",label:"序号",children:["①","②","③","④","⑤","⑥","⑦","⑧","⑨","⑩","⑪","⑫","⑬","⑭","⑮","⑯","⑰","⑱","⑲","⑳","⑴","⑵","⑶","⑷","⑸","⑹","⑺","⑻","⑼","⑽","⑾","⑿","⒀","⒁","⒂","⒃","⒄","⒅","⒆","⒇","º","¹","²","³","⁴","⁵","⁶","⁷","⁸","⁹","₀","₁","₂","₃","₄","₅","₆","₇","₈","₉","Ⅰ","Ⅱ","Ⅲ","Ⅳ","Ⅴ","Ⅵ","Ⅶ","Ⅷ","Ⅸ","Ⅹ","Ⅺ","Ⅻ","Ⅼ","Ⅽ","Ⅾ","Ⅿ","ⅰ","ⅱ","ⅲ","ⅳ","ⅴ","ⅵ","ⅶ","ⅷ","ⅸ","ⅹ","ⅺ","ⅻ","ⅼ","ⅽ","ⅾ","ⅿ","ↀ","ↁ","ↂ","㊀","㊁","㊂","㊃","㊄","㊅","㊆","㊇","㊈","㊉","㈠","㈡","㈢","㈣","㈤","㈥","㈦","㈧","㈨","㈩","𝟘","𝟙","𝟚","𝟛","𝟜","𝟝","𝟞","𝟟","𝟠","𝟡"]},{key:"math",label:"数学",children:["+","-","×","÷","=","~","¬","±","%","°","ǃ","‰","‱","½","⅓","⅔","¼","¾","<",">","l","o","g","l","g","l","n","⨂","⨁","⨄","⨃","⨅","⨆","√","∛","∜","∝","∞","∟","∠","∡","∢","∧","∨","∩","∪","∫","∬","∭","∮","∯","∰","∱","∲","∳","∴","∵","∼","∽","∾","∿","≃","≄","≅","≆","≇","≈","≊","≋","≌","≍","≎","≏","≐","≑","≒","≓","≔","≕","≤","≥","≦","≧","≨","≩","≪","≫","≺","≻","≼","≽","≾","≿","⊀","⊁","⊂","⊃","⊄","⊅","⊆","⊇","⊈","⊉","⊊","⊋","⊏","⊐","⊑","⊒","⊓","⊔","⊢","⊣","⊤","⊥","⊦","⊧","⊨","⊩","⊪","⊫","⊬","⊭","⊮","⊯","⊲","⊳","⊴","⊵","⋀","⋁","⋂","⋃","⋉","⋊","⋋","⋌","⟨","⟩","⟪","⟫","⟮","⟯","⧼","⧽","⦰"]},{key:"arrow",label:"箭头",children:["←","↑","→","↓","↔","↕","↖","↗","↘","↙","↚","↛","↜","↝","↞","↟","↠","↡","↢","↣","↤","↥","↦","↧","↨","↫","↬","↭","↮","↯","↰","↱","↲","↳","↴","↵","↶","↷","↸","↹","↺","↻","↼","↽","↾","↿","⇀","⇁","⇂","⇃","⇄","⇅","⇆","⇇","⇈","⇉","⇊","⇋","⇌","⇍","⇎","⇏","⇐","⇑","⇒","⇓","⇔","⇕","⇖","⇗","⇘","⇙","⇚","⇛","⇜","⇝","⇞","⇟","⇠","⇡","⇢","⇣","⇤","⇥","⇦","⇧","⇨","⇩","⇪","⇫","⇬","⇭","⇮","⇯","⇰","⇱","⇲","⇳","⇴","⇵","⇶","⇷","⇸","⇹","⇺","⇻","⇼","⇽","⇾","⇿"]},{key:"graph",label:"图形",children:["▢","▣","▤","▥","▦","▧","▨","▩","▭","▮","▯","▰","▱","▲","▷","▼","◁","◈","◉","◍","◐","◑","◒","◓","◔","◕","◧","◨","◩","◪","◫","◬","◭","◮"]}],Rh={class:"symbol-panel"},Ph={class:"tabs"},Hh=["onClick"],qh={class:"pool"},Uh=["onClick"],Gh={class:"symbol"},Xh=Object(y["defineComponent"])({__name:"SymbolPanel",setup:function(e){var t=Object(y["ref"])(Ah[0].key),n=Object(y["computed"])((function(){var e=Ah.find((function(e){return e.key===t.value}));return(null===e||void 0===e?void 0:e.children)||[]})),c=function(e){ta.emit(fo.RICH_TEXT_COMMAND,{action:{command:"insert",value:e}})};return function(e,o){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Rh,[Object(y["createElementVNode"])("div",Ph,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(Ah),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["tab",{active:t.value===e.key}]),key:e.key,onClick:function(n){return t.value=e.key}},Object(y["toDisplayString"])(e.label),11,Hh)})),128))]),Object(y["createElementVNode"])("div",qh,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(n),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"symbol-item",key:t,onClick:function(t){return c(e)}},[Object(y["createElementVNode"])("div",Gh,Object(y["toDisplayString"])(e),1)],8,Uh)})),128))])])}}});n("1126");const Yh=pn()(Xh,[["__scopeId","data-v-ba0c96fc"]]);var Zh=Yh,Wh={class:"toolbar"},Jh={class:"tabs"},Kh=["onClick"],Qh={class:"content"},$h=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=ie(),n=Object(g["c"])(t),o=n.activeElementIdList,a=n.handleElement,l=n.toolbarState,r=Object(y["computed"])((function(){var e;return"text"===(null===(e=a.value)||void 0===e?void 0:e.type)?[{label:"样式",value:c.EL_STYLE},{label:"符号",value:c.SYMBOL},{label:"位置",value:c.EL_POSITION},{label:"动画",value:c.EL_ANIMATION}]:[{label:"样式",value:c.EL_STYLE},{label:"位置",value:c.EL_POSITION},{label:"动画",value:c.EL_ANIMATION}]})),i=[{label:"设计",value:c.SLIDE_DESIGN},{label:"切换",value:c.SLIDE_ANIMATION},{label:"动画",value:c.EL_ANIMATION}],u=[{label:"样式",value:c.EL_STYLE},{label:"位置",value:c.MULTI_POSITION}],d=function(e){t.setToolbarState(e)},s=Object(y["computed"])((function(){return o.value.length?o.value.length>1?u:r.value:i}));Object(y["watch"])(s,(function(){var e=s.value.map((function(e){return e.value}));e.includes(l.value)||t.setToolbarState(e[0])}));var f=Object(y["computed"])((function(){var e,t=(e={},Object(pe["a"])(e,c.EL_STYLE,kv),Object(pe["a"])(e,c.EL_POSITION,Gv),Object(pe["a"])(e,c.EL_ANIMATION,Ej),Object(pe["a"])(e,c.SLIDE_DESIGN,yh),Object(pe["a"])(e,c.SLIDE_ANIMATION,Vh),Object(pe["a"])(e,c.MULTI_POSITION,Fh),Object(pe["a"])(e,c.SYMBOL,Zh),e);return t[l.value]||null}));return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Wh,[Object(y["createElementVNode"])("div",Jh,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(s),(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["tab",{active:e.value===Object(y["unref"])(l)}]),key:e.value,onClick:function(t){return d(e.value)}},Object(y["toDisplayString"])(e.label),11,Kh)})),128))]),Object(y["createElementVNode"])("div",Qh,[(Object(y["openBlock"])(),Object(y["createBlock"])(Object(y["resolveDynamicComponent"])(Object(y["unref"])(f))))])])}}});n("cd7e");const ey=pn()($h,[["__scopeId","data-v-5303bd17"]]);var ty=ey,ny={class:"remark"},cy=["value"],oy=Object(y["defineComponent"])({__name:"index",props:{height:{type:Number,required:!0}},emits:["update:height"],setup:function(e,t){var n=t.emit,c=e,o=ae(),a=Object(g["c"])(o),l=a.currentSlide,r=Object(y["computed"])((function(){var e;return(null===(e=l.value)||void 0===e?void 0:e.remark)||""})),i=function(e){var t=e.target.value;o.updateSlide({remark:t})},u=function(e){var t=!0,o=e.pageY,a=c.height;document.onmousemove=function(e){if(t){var c=e.pageY,l=c-o,r=-l+a;r<40&&(r=40),r>120&&(r=120),n("update:height",r)}},document.onmouseup=function(){t=!1,document.onmousemove=null,document.onmouseup=null}};return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ny,[Object(y["createElementVNode"])("div",{class:"resize-handler",onMousedown:t[0]||(t[0]=function(e){return u(e)})},null,32),Object(y["createElementVNode"])("textarea",{value:Object(y["unref"])(r),placeholder:"点击输入演讲者备注",onInput:t[1]||(t[1]=function(e){return i(e)})},null,40,cy)])}}});n("ec27");const ay=pn()(oy,[["__scopeId","data-v-82b674f6"]]);var ly=ay,ry=function(e){return Object(y["pushScopeId"])("data-v-60a953a0"),e=e(),Object(y["popScopeId"])(),e},iy={class:"export-img-dialog"},uy={class:"thumbnails-view"},dy={class:"configs"},sy={class:"row"},fy=ry((function(){return Object(y["createElementVNode"])("div",{class:"title"},"导出格式:",-1)})),by=Object(y["createTextVNode"])("JPEG"),py=Object(y["createTextVNode"])("PNG"),my={class:"row"},Oy=ry((function(){return Object(y["createElementVNode"])("div",{class:"title"},"导出范围:",-1)})),vy=Object(y["createTextVNode"])("全部"),jy=Object(y["createTextVNode"])("当前页"),hy=Object(y["createTextVNode"])("自定义"),yy={key:0,class:"row"},gy=["data-range"],xy={class:"row"},ky=ry((function(){return Object(y["createElementVNode"])("div",{class:"title"},"图片质量:",-1)})),Cy={class:"row"},Ny=ry((function(){return Object(y["createElementVNode"])("div",{class:"title"},"忽略在线字体:",-1)})),Ey={class:"config-item"},wy={class:"btns"},Vy=Object(y["createTextVNode"])("导出图片"),Iy=Object(y["createTextVNode"])("关闭"),By=Object(y["defineComponent"])({__name:"ExportImage",emits:["close"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.slides,a=c.currentSlide,l=Object(y["ref"])(),r=Object(y["ref"])("all"),i=Object(y["ref"])([1,o.value.length]),u=Object(y["ref"])("jpeg"),d=Object(y["ref"])(1),s=Object(y["ref"])(!0),f=Object(y["computed"])((function(){return"all"===r.value?o.value:"current"===r.value?[a.value]:o.value.filter((function(e,t){var n=Object(me["a"])(i.value,2),c=n[0],o=n[1];return t>=c-1&&t<=o-1}))})),b=ln(),p=b.exportImage,m=b.exporting,O=function(){l.value&&p(l.value,u.value,d.value,s.value)};return function(e,t){var c=Object(y["resolveComponent"])("RadioButton"),a=Object(y["resolveComponent"])("RadioGroup"),b=Object(y["resolveComponent"])("Slider"),p=Object(y["resolveComponent"])("Switch"),v=Object(y["resolveComponent"])("Tooltip"),j=Object(y["resolveComponent"])("Button"),h=Object(y["resolveComponent"])("FullscreenSpin");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",iy,[Object(y["createElementVNode"])("div",uy,[Object(y["createElementVNode"])("div",{class:"thumbnails",ref_key:"imageThumbnailsRef",ref:l},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(f),(function(e){return Object(y["openBlock"])(),Object(y["createBlock"])(ad,{class:"thumbnail",key:e.id,slide:e,size:1600},null,8,["slide"])})),128))],512)]),Object(y["createElementVNode"])("div",dy,[Object(y["createElementVNode"])("div",sy,[fy,Object(y["createVNode"])(a,{class:"config-item",value:u.value,"onUpdate:value":t[0]||(t[0]=function(e){return u.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{width:"50%"},value:"jpeg"},{default:Object(y["withCtx"])((function(){return[by]})),_:1}),Object(y["createVNode"])(c,{style:{width:"50%"},value:"png"},{default:Object(y["withCtx"])((function(){return[py]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",my,[Oy,Object(y["createVNode"])(a,{class:"config-item",value:r.value,"onUpdate:value":t[1]||(t[1]=function(e){return r.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"all"},{default:Object(y["withCtx"])((function(){return[vy]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"current"},{default:Object(y["withCtx"])((function(){return[jy]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"custom"},{default:Object(y["withCtx"])((function(){return[hy]})),_:1})]})),_:1},8,["value"])]),"custom"===r.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",yy,[Object(y["createElementVNode"])("div",{class:"title","data-range":"(".concat(i.value[0]," ~ ").concat(i.value[1],")")},"自定义范围:",8,gy),Object(y["createVNode"])(b,{class:"config-item",range:"",min:1,max:Object(y["unref"])(o).length,step:1,value:i.value,"onUpdate:value":t[2]||(t[2]=function(e){return i.value=e})},null,8,["max","value"])])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",xy,[ky,Object(y["createVNode"])(b,{class:"config-item",min:0,max:1,step:.1,value:d.value,"onUpdate:value":t[3]||(t[3]=function(e){return d.value=e})},null,8,["step","value"])]),Object(y["createElementVNode"])("div",Cy,[Ny,Object(y["createElementVNode"])("div",Ey,[Object(y["createVNode"])(v,{mouseLeaveDelay:0,mouseEnterDelay:.5,title:"导出时默认忽略在线字体,若您在幻灯片中使用了在线字体,且希望导出后保留相关样式,可选择关闭【忽略在线字体】选项,但要注意这将会增加导出用时。"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(p,{checked:s.value,"onUpdate:checked":t[4]||(t[4]=function(e){return s.value=e})},null,8,["checked"])]})),_:1},8,["mouseEnterDelay"])])])]),Object(y["createElementVNode"])("div",wy,[Object(y["createVNode"])(j,{class:"btn export",type:"primary",onClick:t[5]||(t[5]=function(e){return O()})},{default:Object(y["withCtx"])((function(){return[Vy]})),_:1}),Object(y["createVNode"])(j,{class:"btn close",onClick:t[6]||(t[6]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[Iy]})),_:1})]),Object(y["createVNode"])(h,{loading:Object(y["unref"])(m),tip:"正在导出..."},null,8,["loading"])])}}});n("e303");const Sy=pn()(By,[["__scopeId","data-v-60a953a0"]]);var Ly=Sy,_y={class:"export-json-dialog"},Ty={class:"preview"},My={class:"btns"},Dy=Object(y["createTextVNode"])("导出 JSON"),zy=Object(y["createTextVNode"])("关闭"),Fy=Object(y["defineComponent"])({__name:"ExportJSON",emits:["close"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.slides,a=ln(),l=a.exportJSON;return function(e,t){var c=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",_y,[Object(y["createElementVNode"])("div",Ty,[Object(y["createElementVNode"])("pre",null,Object(y["toDisplayString"])(Object(y["unref"])(o)),1)]),Object(y["createElementVNode"])("div",My,[Object(y["createVNode"])(c,{class:"btn export",type:"primary",onClick:t[0]||(t[0]=function(e){return Object(y["unref"])(l)()})},{default:Object(y["withCtx"])((function(){return[Dy]})),_:1}),Object(y["createVNode"])(c,{class:"btn close",onClick:t[1]||(t[1]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[zy]})),_:1})])])}}});n("eba1");const Ay=pn()(Fy,[["__scopeId","data-v-1bc24666"]]);var Ry=Ay,Py=function(){var e=document.createElement("iframe");return e.style.width="0",e.style.height="0",e.style.position="absolute",e.style.right="0",e.style.top="0",e.style.border="0",document.body.appendChild(e),e},Hy=function(e,t,n){var c="",o="",a=document.styleSheets;if(a){var l,r=Object(L["a"])(a);try{for(r.s();!(l=r.n()).done;){var i=l.value;if(i.cssRules){var u,d=Object(L["a"])(i.cssRules);try{for(d.s();!(u=d.n()).done;){var s=u.value;o+=s.cssText}}catch(v){d.e(v)}finally{d.f()}}}}catch(v){r.e(v)}finally{r.f()}}var f=n.width,b=n.height,p=n.margin,m='\n \n \n \n "),O=""+t.innerHTML+"";e.open(),e.write("\n ".concat(c,"\n \n ").concat(m,"\n ").concat(O,"\n \n ")),e.close()},qy=function(e,t){var n=Py(),c=n.contentWindow;if(n.contentDocument&&c){Hy(n.contentDocument,e,t);var o=function(){c.focus(),c.print()},a=function e(){n.removeEventListener("load",o),c.removeEventListener("afterprint",e),document.body.removeChild(n)};n.addEventListener("load",o),c.addEventListener("afterprint",a)}},Uy=function(e){return Object(y["pushScopeId"])("data-v-15b57798"),e=e(),Object(y["popScopeId"])(),e},Gy={class:"export-pdf-dialog"},Xy={class:"thumbnails-view"},Yy={class:"configs"},Zy={class:"row"},Wy=Uy((function(){return Object(y["createElementVNode"])("div",{class:"title"},"导出范围:",-1)})),Jy=Object(y["createTextVNode"])("全部幻灯片"),Ky=Object(y["createTextVNode"])("当前幻灯片"),Qy={class:"row"},$y=Uy((function(){return Object(y["createElementVNode"])("div",{class:"title"},"每页数量:",-1)})),eg=Object(y["createTextVNode"])("1"),tg=Object(y["createTextVNode"])("2"),ng=Object(y["createTextVNode"])("3"),cg={class:"row"},og=Uy((function(){return Object(y["createElementVNode"])("div",{class:"title"},"边缘留白:",-1)})),ag={class:"config-item"},lg=Uy((function(){return Object(y["createElementVNode"])("div",{class:"tip"}," 注意:若打印预览与实际样式不一致,请在弹出的打印窗口中勾选【背景图形】选项。 ",-1)})),rg={class:"btns"},ig=Object(y["createTextVNode"])("打印 / 导出 PDF"),ug=Object(y["createTextVNode"])("关闭"),dg=Object(y["defineComponent"])({__name:"ExportPDF",emits:["close"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.slides,a=c.currentSlide,l=Object(y["ref"])(),r=Object(y["ref"])("all"),i=Object(y["ref"])(1),u=Object(y["ref"])(!0),d=function(){if(l.value){var e={width:1600,height:"all"===r.value?900*i.value:900,margin:u.value?50:0};qy(l.value,e)}};return function(e,t){var c=Object(y["resolveComponent"])("RadioButton"),s=Object(y["resolveComponent"])("RadioGroup"),f=Object(y["resolveComponent"])("SelectOption"),b=Object(y["resolveComponent"])("Select"),p=Object(y["resolveComponent"])("Switch"),m=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Gy,[Object(y["createElementVNode"])("div",Xy,[Object(y["createElementVNode"])("div",{class:"thumbnails",ref_key:"pdfThumbnailsRef",ref:l},["current"===r.value?(Object(y["openBlock"])(),Object(y["createBlock"])(ad,{key:0,class:"thumbnail",slide:Object(y["unref"])(a),size:1600},null,8,["slide"])):(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],{key:1},Object(y["renderList"])(Object(y["unref"])(o),(function(e,t){return Object(y["openBlock"])(),Object(y["createBlock"])(ad,{class:Object(y["normalizeClass"])(["thumbnail",{"break-page":(t+1)%i.value===0}]),key:e.id,slide:e,size:1600},null,8,["class","slide"])})),128))],512)]),Object(y["createElementVNode"])("div",Yy,[Object(y["createElementVNode"])("div",Zy,[Wy,Object(y["createVNode"])(s,{class:"config-item",value:r.value,"onUpdate:value":t[0]||(t[0]=function(e){return r.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{width:"50%"},value:"all"},{default:Object(y["withCtx"])((function(){return[Jy]})),_:1}),Object(y["createVNode"])(c,{style:{width:"50%"},value:"current"},{default:Object(y["withCtx"])((function(){return[Ky]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",Qy,[$y,Object(y["createVNode"])(b,{class:"config-item",value:i.value,"onUpdate:value":t[1]||(t[1]=function(e){return i.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{value:1},{default:Object(y["withCtx"])((function(){return[eg]})),_:1}),Object(y["createVNode"])(f,{value:2},{default:Object(y["withCtx"])((function(){return[tg]})),_:1}),Object(y["createVNode"])(f,{value:3},{default:Object(y["withCtx"])((function(){return[ng]})),_:1})]})),_:1},8,["value"])]),Object(y["createElementVNode"])("div",cg,[og,Object(y["createElementVNode"])("div",ag,[Object(y["createVNode"])(p,{checked:u.value,"onUpdate:checked":t[2]||(t[2]=function(e){return u.value=e})},null,8,["checked"])])]),lg]),Object(y["createElementVNode"])("div",rg,[Object(y["createVNode"])(m,{class:"btn export",type:"primary",onClick:t[3]||(t[3]=function(e){return d()})},{default:Object(y["withCtx"])((function(){return[ig]})),_:1}),Object(y["createVNode"])(m,{class:"btn close",onClick:t[4]||(t[4]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[ug]})),_:1})])])}}});n("7239");const sg=pn()(dg,[["__scopeId","data-v-15b57798"]]);var fg=sg,bg=function(e){return Object(y["pushScopeId"])("data-v-3fef9be0"),e=e(),Object(y["popScopeId"])(),e},pg={class:"export-pptx-dialog"},mg={class:"configs"},Og={class:"row"},vg=bg((function(){return Object(y["createElementVNode"])("div",{class:"title"},"导出范围:",-1)})),jg=Object(y["createTextVNode"])("全部"),hg=Object(y["createTextVNode"])("当前页"),yg=Object(y["createTextVNode"])("自定义"),gg={key:0,class:"row"},xg=["data-range"],kg={class:"row"},Cg=bg((function(){return Object(y["createElementVNode"])("div",{class:"title"},"覆盖默认母版:",-1)})),Ng={class:"config-item"},Eg={class:"btns"},wg=Object(y["createTextVNode"])("导出 PPTX"),Vg=Object(y["createTextVNode"])("关闭"),Ig=Object(y["defineComponent"])({__name:"ExportPPTX",emits:["close"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.slides,a=c.currentSlide,l=ln(),r=l.exportPPTX,i=l.exporting,u=Object(y["ref"])("all"),d=Object(y["ref"])([1,o.value.length]),s=Object(y["ref"])(!0),f=Object(y["computed"])((function(){return"all"===u.value?o.value:"current"===u.value?[a.value]:o.value.filter((function(e,t){var n=Object(me["a"])(d.value,2),c=n[0],o=n[1];return t>=c-1&&t<=o-1}))}));return function(e,t){var c=Object(y["resolveComponent"])("RadioButton"),a=Object(y["resolveComponent"])("RadioGroup"),l=Object(y["resolveComponent"])("Slider"),b=Object(y["resolveComponent"])("Switch"),p=Object(y["resolveComponent"])("Button"),m=Object(y["resolveComponent"])("FullscreenSpin");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",pg,[Object(y["createElementVNode"])("div",mg,[Object(y["createElementVNode"])("div",Og,[vg,Object(y["createVNode"])(a,{class:"config-item",value:u.value,"onUpdate:value":t[0]||(t[0]=function(e){return u.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"all"},{default:Object(y["withCtx"])((function(){return[jg]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"current"},{default:Object(y["withCtx"])((function(){return[hg]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"custom"},{default:Object(y["withCtx"])((function(){return[yg]})),_:1})]})),_:1},8,["value"])]),"custom"===u.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",gg,[Object(y["createElementVNode"])("div",{class:"title","data-range":"(".concat(d.value[0]," ~ ").concat(d.value[1],")")},"自定义范围:",8,xg),Object(y["createVNode"])(l,{class:"config-item",range:"",min:1,max:Object(y["unref"])(o).length,step:1,value:d.value,"onUpdate:value":t[1]||(t[1]=function(e){return d.value=e})},null,8,["max","value"])])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",kg,[Cg,Object(y["createElementVNode"])("div",Ng,[Object(y["createVNode"])(b,{checked:s.value,"onUpdate:checked":t[2]||(t[2]=function(e){return s.value=e})},null,8,["checked"])])])]),Object(y["createElementVNode"])("div",Eg,[Object(y["createVNode"])(p,{class:"btn export",type:"primary",onClick:t[3]||(t[3]=function(e){return Object(y["unref"])(r)(Object(y["unref"])(f),s.value)})},{default:Object(y["withCtx"])((function(){return[wg]})),_:1}),Object(y["createVNode"])(p,{class:"btn close",onClick:t[4]||(t[4]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[Vg]})),_:1})]),Object(y["createVNode"])(m,{loading:Object(y["unref"])(i),tip:"正在导出..."},null,8,["loading"])])}}});n("fef8");const Bg=pn()(Ig,[["__scopeId","data-v-3fef9be0"]]);var Sg=Bg,Lg=function(e){return Object(y["pushScopeId"])("data-v-e2b465d2"),e=e(),Object(y["popScopeId"])(),e},_g={class:"export-pptist-dialog"},Tg={class:"configs"},Mg={class:"row"},Dg=Lg((function(){return Object(y["createElementVNode"])("div",{class:"title"},"导出范围:",-1)})),zg=Object(y["createTextVNode"])("全部"),Fg=Object(y["createTextVNode"])("当前页"),Ag=Object(y["createTextVNode"])("自定义"),Rg={key:0,class:"row"},Pg=["data-range"],Hg=Lg((function(){return Object(y["createElementVNode"])("div",{class:"tip"}," 提示:.pptist 是本应用的特有文件后缀,支持将该类型的文件导入回应用中。 ",-1)})),qg={class:"btns"},Ug=Object(y["createTextVNode"])("导出 .pptist 文件"),Gg=Object(y["createTextVNode"])("关闭"),Xg=Object(y["defineComponent"])({__name:"ExportSpecificFile",emits:["close"],setup:function(e,t){var n=t.emit,c=Object(g["c"])(ae()),o=c.slides,a=c.currentSlide,l=ln(),r=l.exportSpecificFile,i=Object(y["ref"])("all"),u=Object(y["ref"])([1,o.value.length]),d=Object(y["computed"])((function(){return"all"===i.value?o.value:"current"===i.value?[a.value]:o.value.filter((function(e,t){var n=Object(me["a"])(u.value,2),c=n[0],o=n[1];return t>=c-1&&t<=o-1}))}));return function(e,t){var c=Object(y["resolveComponent"])("RadioButton"),a=Object(y["resolveComponent"])("RadioGroup"),l=Object(y["resolveComponent"])("Slider"),s=Object(y["resolveComponent"])("Button");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",_g,[Object(y["createElementVNode"])("div",Tg,[Object(y["createElementVNode"])("div",Mg,[Dg,Object(y["createVNode"])(a,{class:"config-item",value:i.value,"onUpdate:value":t[0]||(t[0]=function(e){return i.value=e})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"all"},{default:Object(y["withCtx"])((function(){return[zg]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"current"},{default:Object(y["withCtx"])((function(){return[Fg]})),_:1}),Object(y["createVNode"])(c,{style:{width:"33.33%"},value:"custom"},{default:Object(y["withCtx"])((function(){return[Ag]})),_:1})]})),_:1},8,["value"])]),"custom"===i.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Rg,[Object(y["createElementVNode"])("div",{class:"title","data-range":"(".concat(u.value[0]," ~ ").concat(u.value[1],")")},"自定义范围:",8,Pg),Object(y["createVNode"])(l,{class:"config-item",range:"",min:1,max:Object(y["unref"])(o).length,step:1,value:u.value,"onUpdate:value":t[1]||(t[1]=function(e){return u.value=e})},null,8,["max","value"])])):Object(y["createCommentVNode"])("",!0),Hg]),Object(y["createElementVNode"])("div",qg,[Object(y["createVNode"])(s,{class:"btn export",type:"primary",onClick:t[2]||(t[2]=function(e){return Object(y["unref"])(r)(Object(y["unref"])(d))})},{default:Object(y["withCtx"])((function(){return[Ug]})),_:1}),Object(y["createVNode"])(s,{class:"btn close",onClick:t[3]||(t[3]=function(e){return n("close")})},{default:Object(y["withCtx"])((function(){return[Gg]})),_:1})])])}}});n("bf43");const Yg=pn()(Xg,[["__scopeId","data-v-e2b465d2"]]);var Zg=Yg,Wg={class:"export-dialog"},Jg={class:"tabs"},Kg=["onClick"],Qg={class:"content"},$g=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=ie(),n=Object(g["c"])(t),c=n.dialogForExport,o=t.setDialogForExport,a=[{key:"pptist",label:"导出 pptist 文件"},{key:"pptx",label:"导出 PPTX"},{key:"image",label:"导出图片"},{key:"json",label:"导出 JSON"},{key:"pdf",label:"打印 / 导出 PDF"}],l=Object(y["computed"])((function(){var e={image:Ly,json:Ry,pdf:fg,pptx:Sg,pptist:Zg};return e[c.value]||null}));return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Wg,[Object(y["createElementVNode"])("div",Jg,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(a,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tab",{active:e.key===Object(y["unref"])(c)}]),key:e.key,onClick:function(t){return Object(y["unref"])(o)(e.key)}},Object(y["toDisplayString"])(e.label),11,Kg)})),64))]),Object(y["createElementVNode"])("div",Qg,[(Object(y["openBlock"])(),Object(y["createBlock"])(Object(y["resolveDynamicComponent"])(Object(y["unref"])(l)),{onClose:t[0]||(t[0]=function(e){return Object(y["unref"])(o)("")})},null,32))])])}}});n("d970");const ex=pn()($g,[["__scopeId","data-v-1f8f1a8b"]]);var tx=ex,nx={class:"pptist-editor"},cx={class:"layout-content"},ox={class:"layout-content-center"},ax=Object(y["defineComponent"])({__name:"index",setup:function(e){var t=ie(),n=Object(g["c"])(t),c=n.dialogForExport,o=function(){return t.setDialogForExport("")},a=Object(y["ref"])(40);return xt(),kt(),function(e,t){var n=Object(y["resolveComponent"])("Modal");return Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,[Object(y["createElementVNode"])("div",nx,[Object(y["createVNode"])(ec,{class:"layout-header"}),Object(y["createElementVNode"])("div",cx,[Object(y["createVNode"])(Sf,{class:"layout-content-left"}),Object(y["createElementVNode"])("div",ox,[Object(y["createVNode"])(Of,{class:"center-top"}),Object(y["createVNode"])(xd,{class:"center-body",style:Object(y["normalizeStyle"])({height:"calc(100% - ".concat(a.value+40,"px)")})},null,8,["style"]),Object(y["createVNode"])(ly,{class:"center-bottom",height:a.value,"onUpdate:height":t[0]||(t[0]=function(e){return a.value=e}),style:Object(y["normalizeStyle"])({height:"".concat(a.value,"px")})},null,8,["height","style"])]),Object(y["createVNode"])(ty,{class:"layout-content-right"})])]),Object(y["createVNode"])(n,{visible:!!Object(y["unref"])(c),footer:null,centered:"",closable:!1,width:680,destroyOnClose:"",onCancel:t[1]||(t[1]=function(e){return o()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(tx)]})),_:1},8,["visible"])],64)}}});n("0be5");const lx=pn()(ax,[["__scopeId","data-v-328e1a4e"]]);var rx=lx,ix=function(){var e=ae(),t=Object(g["c"])(e),n=t.slides,c=t.slideIndex,o=t.formatedAnimations,a=Object(y["ref"])(0),l=Object(y["ref"])(!1),r=Object(y["ref"])(c.value),i=function e(){if(!l.value){var t=o.value[a.value],n=t.animations,c=t.autoNext;a.value+=1,l.value=!0;var r,i=0,u=Object(L["a"])(n);try{var d=function(){var t=r.value,o=document.querySelector("#screen-element-".concat(t.elId," [class^=base-element-]"));if(!o)return i+=1,"continue";var a="".concat(Zv).concat(t.effect);o.style.removeProperty("--animate-duration");var u,d=Object(L["a"])(o.classList);try{for(d.s();!(u=d.n()).done;){var s=u.value;-1!==s.indexOf(Zv)&&o.classList.remove(s,"".concat(Zv,"animated"))}}catch(b){d.e(b)}finally{d.f()}o.style.setProperty("--animate-duration","".concat(t.duration,"ms")),o.classList.add(a,"".concat(Zv,"animated"));var f=function(){"out"!==t.type&&(o.style.removeProperty("--animate-duration"),o.classList.remove(a,"".concat(Zv,"animated"))),i+=1,i===n.length&&(l.value=!1,c&&e())};o.addEventListener("animationend",f,{once:!0})};for(u.s();!(r=u.n()).done;)d()}catch(s){u.e(s)}finally{u.f()}}},u=function(){a.value-=1;var e,t=o.value[a.value].animations,n=Object(L["a"])(t);try{for(n.s();!(e=n.n()).done;){var c=e.value,l=document.querySelector("#screen-element-".concat(c.elId," [class^=base-element-]"));if(l){l.style.removeProperty("--animate-duration");var r,i=Object(L["a"])(l.classList);try{for(i.s();!(r=i.n()).done;){var u=r.value;-1!==u.indexOf(Zv)&&l.classList.remove(u,"".concat(Zv,"animated"))}}catch(d){i.e(d)}finally{i.f()}}}}catch(d){n.e(d)}finally{n.f()}t.every((function(e){return"attention"===e.type}))&&b()},d=Object(y["ref"])(0),s=function(){d.value&&(clearInterval(d.value),d.value=0)};Object(y["onUnmounted"])(s);var f=Object(te["throttle"])((function(e){Se["a"].success(e)}),1e3,{leading:!0,trailing:!1}),b=function(){o.value.length&&a.value>0?u():c.value>0?(e.updateSlideIndex(c.value-1),c.value0&&p()}),500,{leading:!0,trailing:!1}),v=Object(y["ref"])(null),j=function(e){v.value={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}},h=function(e){if(v.value){var t=Math.abs(v.value.x-e.changedTouches[0].pageX),n=e.changedTouches[0].pageY-v.value.y;Math.abs(n)>t&&Math.abs(n)>50&&(v.value=null,n>0?b():p())}},x=function(e){var t=e.key.toUpperCase();t===V.UP||t===V.LEFT||t===V.PAGEUP?b():t!==V.DOWN&&t!==V.RIGHT&&t!==V.SPACE&&t!==V.ENTER&&t!==V.PAGEDOWN||p()};Object(y["onMounted"])((function(){return document.addEventListener("keydown",x)})),Object(y["onUnmounted"])((function(){return document.removeEventListener("keydown",x)}));var k=function(){e.updateSlideIndex(c.value-1),a.value=0},C=function(){e.updateSlideIndex(c.value+1),a.value=0},N=function(t){e.updateSlideIndex(t),a.value=0},E=function(t){var c=n.value.findIndex((function(e){return e.id===t}));-1!==c&&(e.updateSlideIndex(c),a.value=0)};return{autoPlayTimer:d,autoPlay:m,closeAutoPlay:s,mousewheelListener:O,touchStartListener:j,touchEndListener:h,turnPrevSlide:k,turnNextSlide:C,turnSlideToIndex:N,turnSlideToId:E,execPrev:b,execNext:p,animationIndex:a}},ux=function(e){var t=ae(),n=Object(g["c"])(t),c=n.viewportRatio,o=Object(y["ref"])(0),a=Object(y["ref"])(0),l=function(){var t,n,l=(null===e||void 0===e?void 0:e.value)||document.body,r=l.clientWidth,i=l.clientHeight;i/r===c.value?(t=r,n=i):i/r>c.value?(t=r,n=r*c.value):(t=i/c.value,n=i),o.value=t,a.value=n};return Object(y["onMounted"])((function(){l(),window.addEventListener("resize",l)})),Object(y["onUnmounted"])((function(){window.removeEventListener("resize",l)})),{slideWidth:o,slideHeight:a}},dx=function(){var e=Object(y["ref"])(!0),t=Object(y["ref"])(!0),n=yt(),c=n.exitScreening,o=function(){e.value=ht(),!e.value&&t.value&&c(),t.value=!0};Object(y["onMounted"])((function(){e.value=ht(),document.addEventListener("fullscreenchange",o),document.addEventListener("webkitfullscreenchange",o)})),Object(y["onUnmounted"])((function(){document.removeEventListener("fullscreenchange",o),document.removeEventListener("webkitfullscreenchange",o)}));var a=function(){e.value&&(t.value=!1,jt())};return{fullscreenState:e,manualExitFullscreen:a}},sx=Object(y["defineComponent"])({__name:"ScreenChartElement",props:{elementInfo:{type:Object,required:!0}},setup:function(e){return function(t,n){return Object(y["openBlock"])(),Object(y["createBlock"])(Vu,{class:"screen-element-chart",elementInfo:e.elementInfo},null,8,["elementInfo"])}}});const fx=sx;var bx=fx,px={class:"element-content"},mx=Object(y["defineComponent"])({__name:"ScreenVideoElement",props:{elementInfo:{type:Object,required:!0}},setup:function(e){var t=Object(g["c"])(ae()),n=t.currentSlide,c=Object(y["inject"])(tc)||Object(y["ref"])(1),o=Object(y["inject"])(nc)||Object(y["ref"])(""),a=Object(y["computed"])((function(){return n.value.id===o.value}));return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"screen-element-video",style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["createElementVNode"])("div",px,[Object(y["unref"])(a)?(Object(y["openBlock"])(),Object(y["createBlock"])(Ql,{key:0,width:e.elementInfo.width,height:e.elementInfo.height,src:e.elementInfo.src,poster:e.elementInfo.poster,scale:Object(y["unref"])(c)},null,8,["width","height","src","poster","scale"])):Object(y["createCommentVNode"])("",!0)])],4)],4)}}});n("7a78");const Ox=pn()(mx,[["__scopeId","data-v-76457308"]]);var vx=Ox,jx={class:"element-content"},hx=Object(y["defineComponent"])({__name:"ScreenAudioElement",props:{elementInfo:{type:Object,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ae()),c=n.viewportRatio,o=n.currentSlide,a=Object(y["inject"])(tc)||Object(y["ref"])(1),l=Object(y["inject"])(nc)||Object(y["ref"])(""),r=Object(y["computed"])((function(){return o.value.id===l.value})),i=Object(y["computed"])((function(){return Math.min(t.elementInfo.width,t.elementInfo.height)+"px"})),u=Object(y["computed"])((function(){var e=tt,n=tt*c.value,o=280/a.value,l=50/a.value,r=t.elementInfo.width,i=t.elementInfo.height,u=t.elementInfo.left,d=t.elementInfo.top,s=0,f=i;return u+o>=e&&(s=r-o),d+i+l>=n&&(f=-l),{left:s+"px",top:f+"px"}})),d=Object(y["ref"])(),s=function(){d.value&&d.value.toggle()};return function(t,n){var c=Object(y["resolveComponent"])("IconVolumeNotice");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"screen-element-audio",style:Object(y["normalizeStyle"])({top:e.elementInfo.top+"px",left:e.elementInfo.left+"px",width:e.elementInfo.width+"px",height:e.elementInfo.height+"px"})},[Object(y["createElementVNode"])("div",{class:"rotate-wrapper",style:Object(y["normalizeStyle"])({transform:"rotate(".concat(e.elementInfo.rotate,"deg)")})},[Object(y["createElementVNode"])("div",jx,[Object(y["createVNode"])(c,{class:"audio-icon",style:Object(y["normalizeStyle"])({fontSize:Object(y["unref"])(i),color:e.elementInfo.color}),onClick:n[0]||(n[0]=function(e){return s()})},null,8,["style"]),Object(y["unref"])(r)?(Object(y["openBlock"])(),Object(y["createBlock"])(yr,{key:0,class:"audio-player",ref_key:"audioPlayerRef",ref:d,style:Object(y["normalizeStyle"])(Object(S["a"])({},Object(y["unref"])(u))),src:e.elementInfo.src,loop:e.elementInfo.loop,autoplay:e.elementInfo.autoplay,scale:Object(y["unref"])(a)},null,8,["style","src","loop","autoplay","scale"])):Object(y["createCommentVNode"])("",!0)])],4)],4)}}});n("3010");const yx=pn()(hx,[["__scopeId","data-v-1172b8ee"]]);var gx=yx,xx=["id","title"],kx=Object(y["defineComponent"])({__name:"ScreenElement",props:{elementInfo:{type:Object,required:!0},elementIndex:{type:Number,required:!0},animationIndex:{type:Number,required:!0},turnSlideToId:{type:Function,required:!0},manualExitFullscreen:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(y["computed"])((function(){var e,n=(e={},Object(pe["a"])(e,Ve.IMAGE,iu),Object(pe["a"])(e,Ve.TEXT,fu),Object(pe["a"])(e,Ve.SHAPE,yu),Object(pe["a"])(e,Ve.LINE,Nu),Object(pe["a"])(e,Ve.CHART,bx),Object(pe["a"])(e,Ve.TABLE,Fu),Object(pe["a"])(e,Ve.LATEX,Gu),Object(pe["a"])(e,Ve.VIDEO,vx),Object(pe["a"])(e,Ve.AUDIO,gx),e);return n[t.elementInfo.type]||null})),c=Object(g["c"])(ae()),o=c.formatedAnimations,a=c.theme,l=Object(y["computed"])((function(){var e=o.value.findIndex((function(e){var n=e.animations.map((function(e){return e.elId}));return n.includes(t.elementInfo.id)}));if(-1===e)return!1;if(eObject(y["unref"])(o),hide:(n===Object(y["unref"])(o)-1||n===Object(y["unref"])(o)+1)&&t.turningMode!==Object(y["unref"])(a).turningMode}]),key:t.id},[Math.abs(Object(y["unref"])(o)-n)<2||null!==(c=t.animations)&&void 0!==c&&c.length?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"slide-content",style:Object(y["normalizeStyle"])({width:e.slideWidth+"px",height:e.slideHeight+"px"})},[Object(y["createVNode"])(Vx,{slide:t,scale:Object(y["unref"])(l),animationIndex:e.animationIndex,turnSlideToId:e.turnSlideToId,manualExitFullscreen:e.manualExitFullscreen},null,8,["slide","scale","animationIndex","turnSlideToId","manualExitFullscreen"])],4)):Object(y["createCommentVNode"])("",!0)],2)})),128))])}}});n("9557");const Sx=pn()(Bx,[["__scopeId","data-v-77a3e620"]]);var Lx=Sx,_x={class:"slide-thumbnails"},Tx={class:"return-button"},Mx={class:"slide-thumbnails-content"},Dx=["onClick"],zx=Object(y["defineComponent"])({__name:"SlideThumbnails",props:{turnSlideToIndex:{type:Function,required:!0}},emits:["close"],setup:function(e,t){var n=t.emit,c=e,o=Object(g["c"])(ae()),a=o.slides,l=o.slideIndex,r=vf(),i=r.slidesLoadLimit,u=function(e){c.turnSlideToIndex(e),n("close")};return function(e,t){var c=Object(y["resolveComponent"])("IconArrowCircleLeft");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",_x,[Object(y["createElementVNode"])("div",Tx,[Object(y["createVNode"])(c,{class:"icon",onClick:t[0]||(t[0]=function(e){return n("close")})})]),Object(y["createElementVNode"])("div",Mx,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(a),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["thumbnail",{active:t===Object(y["unref"])(l)}]),key:e.id,onClick:function(e){return u(t)}},[Object(y["createVNode"])(ad,{slide:e,size:150,visible:t=c?l:a-i/c*a,-1===b?n:1*n/3+2*b/3},I=function(e,t){var n=(new Date).getTime();if("pen"===c.model){var o=w(e,t),a=n-f,l=V(o,a);N(e,t,l),b=l}else"mark"===c.model?N(e,t,u.value):E(e,t);d={x:e,y:t},f=(new Date).getTime()},B=function(e){if(!l.value)return[0,0];var t=e instanceof MouseEvent?e:e.changedTouches[0],n=l.value.getBoundingClientRect(),c=t.pageX-n.x,o=t.pageY-n.y;return[c,o]},S=function(e){var t=B(e),n=Object(me["a"])(t,2),c=n[0],o=n[1],a=c/j.value,l=o/h.value;s=!0,d={x:a,y:l},f=(new Date).getTime(),e instanceof MouseEvent||(p.value={x:c,y:o},m.value=!0)},L=function(e){var t=B(e),n=Object(me["a"])(t,2),c=n[0],o=n[1],a=c/j.value,l=o/h.value;p.value={x:c,y:o},s&&I(a,l)},_=function(){s&&(s=!1)},T=function(){o&&l.value&&o.clearRect(0,0,l.value.width,l.value.height)},M=function(){var e;return null===(e=l.value)||void 0===e?void 0:e.toDataURL()},D=function(e){var t=new Image;t.src=e,t.onload=function(){o&&o.drawImage(t,0,0)}},z=Object(te["throttle"])((function(e){"eraser"===c.model&&(e.deltaY<0&&i.value<200?i.value+=20:e.deltaY>0&&i.value>20&&(i.value-=20)),"pen"===c.model&&(e.deltaY<0&&r.value<10?r.value+=2:e.deltaY>0&&r.value>4&&(r.value-=2)),"mark"===c.model&&(e.deltaY<0&&u.value<40?u.value+=4:e.deltaY>0&&u.value>16&&(u.value-=4))}),300,{leading:!0,trailing:!1});return n({clearCanvas:T,getImageDataURL:M,setImageDataURL:D}),function(t,n){var c=Object(y["resolveComponent"])("IconWrite"),o=Object(y["resolveComponent"])("IconHighLight");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"writing-board",ref_key:"writingBoardRef",ref:a},[e.blackboard?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Rx)):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("canvas",{class:"canvas",ref_key:"canvasRef",ref:l,style:Object(y["normalizeStyle"])({width:O.value+"px",height:v.value+"px"}),onMousedown:n[0]||(n[0]=function(e){return S(e)}),onMousemove:n[1]||(n[1]=function(e){return L(e)}),onMouseup:n[2]||(n[2]=function(e){return _()}),onTouchstart:n[3]||(n[3]=function(e){return S(e)}),onTouchmove:n[4]||(n[4]=function(e){return L(e)}),onTouchend:n[5]||(n[5]=function(e){_(),m.value=!1}),onMouseleave:n[6]||(n[6]=function(e){_(),m.value=!1}),onMouseenter:n[7]||(n[7]=function(e){return m.value=!0}),onWheel:n[8]||(n[8]=function(e){return Object(y["unref"])(z)(e)})},null,36),m.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:1},["eraser"===e.model?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"eraser",style:Object(y["normalizeStyle"])({left:p.value.x-i.value/2+"px",top:p.value.y-i.value/2+"px",width:i.value+"px",height:i.value+"px"})},null,4)):Object(y["createCommentVNode"])("",!0),"pen"===e.model?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:1,class:"pen",style:Object(y["normalizeStyle"])({left:p.value.x-r.value/2+"px",top:p.value.y-6*r.value+r.value/2+"px",color:e.color})},["pen"===e.model?(Object(y["openBlock"])(),Object(y["createBlock"])(c,{key:0,class:"icon",size:6*r.value},null,8,["size"])):Object(y["createCommentVNode"])("",!0)],4)):Object(y["createCommentVNode"])("",!0),"mark"===e.model?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:2,class:"pen",style:Object(y["normalizeStyle"])({left:p.value.x-u.value/2+"px",top:p.value.y+"px",color:e.color})},["mark"===e.model?(Object(y["openBlock"])(),Object(y["createBlock"])(o,{key:0,class:"icon",size:1.5*u.value},null,8,["size"])):Object(y["createCommentVNode"])("",!0)],4)):Object(y["createCommentVNode"])("",!0)],64)):Object(y["createCommentVNode"])("",!0)],512)}}});n("5fa4");const Hx=pn()(Px,[["__scopeId","data-v-1d4eb7f0"]]);var qx=Hx,Ux={class:"writing-board-tool"},Gx={class:"colors"},Xx=["onClick"],Yx=Object(y["defineComponent"])({__name:"WritingBoardTool",props:{slideWidth:{type:Number,required:!0},slideHeight:{type:Number,required:!0},position:{type:Object,default:function(){return{right:"5px",bottom:"5px"}}}},emits:["close"],setup:function(e,t){var n=t.emit,c=["#000000","#ffffff","#1e497b","#4e81bb","#e2534d","#9aba60","#8165a0","#47acc5","#f9974c","#ffff3a"],o=Object(y["ref"])(),a=Object(y["ref"])("#e2534d"),l=Object(y["ref"])("pen"),r=Object(y["ref"])(!1),i=function(e){l.value=e},u=function(){o.value.clearCanvas()},d=function(e){"eraser"===l.value&&(l.value="pen"),a.value=e},s=function(){n("close")};return function(t,n){var f=Object(y["resolveComponent"])("IconWrite"),b=Object(y["resolveComponent"])("Tooltip"),p=Object(y["resolveComponent"])("IconHighLight"),m=Object(y["resolveComponent"])("IconErase"),O=Object(y["resolveComponent"])("IconClear"),v=Object(y["resolveComponent"])("IconFill"),j=Object(y["resolveComponent"])("IconClose");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Ux,[Object(y["createElementVNode"])("div",{class:"writing-board-wrap",style:Object(y["normalizeStyle"])({width:e.slideWidth+"px",height:e.slideHeight+"px"})},[Object(y["createVNode"])(qx,{ref_key:"writingBoardRef",ref:o,color:a.value,blackboard:r.value,model:l.value},null,8,["color","blackboard","model"])],4),Object(y["createElementVNode"])("div",{class:"tools",style:Object(y["normalizeStyle"])(e.position)},[Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"画笔"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["btn",{active:"pen"===l.value}]),onClick:n[0]||(n[0]=function(e){return i("pen")})},[Object(y["createVNode"])(f,{class:"icon"})],2)]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"荧光笔"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["btn",{active:"mark"===l.value}]),onClick:n[1]||(n[1]=function(e){return i("mark")})},[Object(y["createVNode"])(p,{class:"icon"})],2)]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"橡皮擦"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["btn",{active:"eraser"===l.value}]),onClick:n[2]||(n[2]=function(e){return i("eraser")})},[Object(y["createVNode"])(m,{class:"icon"})],2)]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"清除墨迹"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:"btn",onClick:n[3]||(n[3]=function(e){return u()})},[Object(y["createVNode"])(O,{class:"icon"})])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"黑板"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["btn",{active:r.value}]),onClick:n[4]||(n[4]=function(e){return r.value=!r.value})},[Object(y["createVNode"])(v,{class:"icon"})],2)]})),_:1},8,["mouseEnterDelay"]),Object(y["createElementVNode"])("div",Gx,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(c,(function(e){return Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["color",{active:e===a.value}]),key:e,style:Object(y["normalizeStyle"])({backgroundColor:e}),onClick:function(t){return d(e)}},null,14,Xx)})),64))]),Object(y["createVNode"])(b,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"关闭画笔"},{default:Object(y["withCtx"])((function(){return[Object(y["createElementVNode"])("div",{class:"btn",onClick:n[5]||(n[5]=function(e){return s()})},[Object(y["createVNode"])(j,{class:"icon"})])]})),_:1},8,["mouseEnterDelay"])],4)])}}});n("4f60");const Zx=pn()(Yx,[["__scopeId","data-v-876081a6"]]);var Wx=Zx,Jx={class:"tools-left"},Kx={class:"content"},Qx=Object(y["defineComponent"])({__name:"BaseView",props:{changeViewMode:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ae()),c=n.slides,o=n.slideIndex,a=ix(),l=a.autoPlayTimer,r=a.autoPlay,i=a.closeAutoPlay,u=a.mousewheelListener,d=a.touchStartListener,s=a.touchEndListener,f=a.turnPrevSlide,b=a.turnNextSlide,p=a.turnSlideToIndex,m=a.turnSlideToId,O=a.execPrev,v=a.execNext,j=a.animationIndex,h=ux(),x=h.slideWidth,k=h.slideHeight,C=yt(),N=C.exitScreening,E=dx(),w=E.fullscreenState,V=E.manualExitFullscreen,I=Object(y["ref"])(!1),B=Object(y["ref"])(!1),S=Object(y["ref"])(!1),L=Object(y["ref"])(!1),_=function(){return[{text:"上一页",subText:"↑ ←",disable:o.value<=0,handler:function(){return f()}},{text:"下一页",subText:"↓ →",disable:o.value>=c.value.length-1,handler:function(){return b()}},{text:"第一页",disable:0===o.value,handler:function(){return p(0)}},{text:"最后一页",disable:o.value===c.value.length-1,handler:function(){return p(c.value.length-1)}},{divider:!0},{text:"显示工具栏",handler:function(){return I.value=!0}},{text:"查看所有幻灯片",handler:function(){return S.value=!0}},{text:"画笔工具",handler:function(){return B.value=!0}},{text:"演讲者视图",handler:function(){return t.changeViewMode("presenter")}},{divider:!0},{text:l.value?"取消自动放映":"自动放映",handler:l.value?i:r},{text:"结束放映",subText:"ESC",handler:N}]};return function(t,n){var a=Object(y["resolveComponent"])("IconLeftTwo"),l=Object(y["resolveComponent"])("IconRightTwo"),r=Object(y["resolveComponent"])("IconWrite"),i=Object(y["resolveComponent"])("Tooltip"),f=Object(y["resolveComponent"])("IconMagic"),b=Object(y["resolveComponent"])("IconListView"),h=Object(y["resolveComponent"])("IconOffScreenOne"),g=Object(y["resolveComponent"])("IconFullScreenOne"),C=Object(y["resolveComponent"])("IconPower"),E=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["base-view",{"laser-pen":L.value}])},[Object(y["withDirectives"])(Object(y["createVNode"])(Lx,{slideWidth:Object(y["unref"])(x),slideHeight:Object(y["unref"])(k),animationIndex:Object(y["unref"])(j),turnSlideToId:Object(y["unref"])(m),manualExitFullscreen:Object(y["unref"])(V),onWheel:n[0]||(n[0]=function(e){return Object(y["unref"])(u)(e)}),onTouchstart:n[1]||(n[1]=function(e){return Object(y["unref"])(d)(e)}),onTouchend:n[2]||(n[2]=function(e){return Object(y["unref"])(s)(e)})},null,8,["slideWidth","slideHeight","animationIndex","turnSlideToId","manualExitFullscreen"]),[[E,_]]),S.value?(Object(y["openBlock"])(),Object(y["createBlock"])(Ax,{key:0,turnSlideToIndex:Object(y["unref"])(p),onClose:n[3]||(n[3]=function(e){return S.value=!1})},null,8,["turnSlideToIndex"])):Object(y["createCommentVNode"])("",!0),B.value?(Object(y["openBlock"])(),Object(y["createBlock"])(Wx,{key:1,slideWidth:Object(y["unref"])(x),slideHeight:Object(y["unref"])(k),onClose:n[4]||(n[4]=function(e){return B.value=!1})},null,8,["slideWidth","slideHeight"])):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",Jx,[Object(y["createVNode"])(a,{class:"tool-btn",theme:"two-tone",fill:["#111","#fff"],onClick:n[5]||(n[5]=function(e){return Object(y["unref"])(O)()})}),Object(y["createVNode"])(l,{class:"tool-btn",theme:"two-tone",fill:["#111","#fff"],onClick:n[6]||(n[6]=function(e){return Object(y["unref"])(v)()})})]),Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tools-right",{visible:I.value}]),onMouseleave:n[14]||(n[14]=function(e){return I.value=!1}),onMouseenter:n[15]||(n[15]=function(e){return I.value=!0})},[Object(y["createElementVNode"])("div",Kx,[Object(y["createElementVNode"])("div",{class:"tool-btn page-number",onClick:n[7]||(n[7]=function(e){return S.value=!0})},"幻灯片 "+Object(y["toDisplayString"])(Object(y["unref"])(o)+1)+" / "+Object(y["toDisplayString"])(Object(y["unref"])(c).length),1),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"画笔工具"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(r,{class:"tool-btn",onClick:n[8]||(n[8]=function(e){return B.value=!0})})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"激光笔"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{class:Object(y["normalizeClass"])(["tool-btn",{active:L.value}]),onClick:n[9]||(n[9]=function(e){return L.value=!L.value})},null,8,["class"])]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"演讲者视图"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(b,{class:"tool-btn",onClick:n[10]||(n[10]=function(t){return e.changeViewMode("presenter")})})]})),_:1},8,["mouseEnterDelay"]),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:Object(y["unref"])(w)?"退出全屏":"进入全屏"},{default:Object(y["withCtx"])((function(){return[Object(y["unref"])(w)?(Object(y["openBlock"])(),Object(y["createBlock"])(h,{key:0,class:"tool-btn",onClick:n[11]||(n[11]=function(e){return Object(y["unref"])(V)()})})):(Object(y["openBlock"])(),Object(y["createBlock"])(g,{key:1,class:"tool-btn",onClick:n[12]||(n[12]=function(e){return Object(y["unref"])(vt)()})}))]})),_:1},8,["mouseEnterDelay","title"]),Object(y["createVNode"])(i,{mouseLeaveDelay:0,mouseEnterDelay:.3,title:"结束放映"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(C,{class:"tool-btn",onClick:n[13]||(n[13]=function(e){return Object(y["unref"])(N)()})})]})),_:1},8,["mouseEnterDelay"])])],34)],2)}}});n("4a2e");const $x=pn()(Qx,[["__scopeId","data-v-d72d6626"]]);var ek=$x,tk=function(e){return Object(y["pushScopeId"])("data-v-5fba3eec"),e=e(),Object(y["popScopeId"])(),e},nk={class:"presenter-view"},ck={class:"toolbar"},ok=tk((function(){return Object(y["createElementVNode"])("span",null,"普通视图",-1)})),ak=tk((function(){return Object(y["createElementVNode"])("span",null,"画笔",-1)})),lk=tk((function(){return Object(y["createElementVNode"])("span",null,"激光笔",-1)})),rk=tk((function(){return Object(y["createElementVNode"])("span",null,"结束放映",-1)})),ik={class:"content"},uk=["onClick"],dk={class:"remark"},sk={class:"header"},fk=tk((function(){return Object(y["createElementVNode"])("span",null,"演讲者备注",-1)})),bk=["innerHTML"],pk={class:"remark-scale"},mk=Object(y["defineComponent"])({__name:"PresenterView",props:{changeViewMode:{type:Function,required:!0}},setup:function(e){var t=e,n=Object(g["c"])(ae()),c=n.slides,o=n.slideIndex,a=n.viewportRatio,l=n.currentSlide,r=Object(y["ref"])(),i=Object(y["ref"])(),u=Object(y["ref"])(!1),d=Object(y["ref"])(!1),s=ix(),f=s.mousewheelListener,b=s.touchStartListener,p=s.touchEndListener,m=s.turnPrevSlide,O=s.turnNextSlide,v=s.turnSlideToIndex,j=s.turnSlideToId,h=s.animationIndex,x=ux(r),k=x.slideWidth,C=x.slideHeight,N=yt(),E=N.exitScreening,w=vf(),V=w.slidesLoadLimit,I=dx(),B=I.fullscreenState,S=I.manualExitFullscreen,L=Object(y["ref"])(16),_=Object(y["computed"])((function(){return Qe(l.value.remark||"无备注")})),T=function(e){i.value&&i.value.scrollBy(e.deltaY,0)},M=function(e){e<12||e>40||(L.value=e)};Object(y["watch"])(o,(function(){Object(y["nextTick"])((function(){if(i.value){var e=i.value.querySelector(".thumbnail.active");if(e){var t=i.value.offsetWidth,n=e.offsetLeft;i.value.scrollTo({left:n-t/2,behavior:"smooth"})}}}))}));var D=function(){return[{text:"上一页",subText:"↑ ←",disable:o.value<=0,handler:function(){return m()}},{text:"下一页",subText:"↓ →",disable:o.value>=c.value.length-1,handler:function(){return O()}},{text:"第一页",disable:0===o.value,handler:function(){return v(0)}},{text:"最后一页",disable:o.value===c.value.length-1,handler:function(){return v(c.value.length-1)}},{divider:!0},{text:"画笔工具",handler:function(){return u.value=!0}},{text:"普通视图",handler:function(){return t.changeViewMode("base")}},{divider:!0},{text:"结束放映",subText:"ESC",handler:E}]};return function(t,n){var l=Object(y["resolveComponent"])("IconListView"),s=Object(y["resolveComponent"])("IconWrite"),m=Object(y["resolveComponent"])("IconMagic"),O=Object(y["resolveComponent"])("IconOffScreenOne"),g=Object(y["resolveComponent"])("Divider"),x=Object(y["resolveComponent"])("IconPower"),N=Object(y["resolveComponent"])("IconMinus"),w=Object(y["resolveComponent"])("IconPlus"),I=Object(y["resolveDirective"])("contextmenu");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",nk,[Object(y["createElementVNode"])("div",ck,[Object(y["createElementVNode"])("div",{class:"tool-btn",onClick:n[0]||(n[0]=function(t){return e.changeViewMode("base")})},[Object(y["createVNode"])(l,{class:"tool-icon"}),ok]),Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tool-btn",{active:u.value}]),onClick:n[1]||(n[1]=function(e){return u.value=!u.value})},[Object(y["createVNode"])(s,{class:"tool-icon"}),ak],2),Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["tool-btn",{active:d.value}]),onClick:n[2]||(n[2]=function(e){return d.value=!d.value})},[Object(y["createVNode"])(m,{class:"tool-icon"}),lk],2),Object(y["createElementVNode"])("div",{class:"tool-btn",onClick:n[3]||(n[3]=function(){return Object(y["unref"])(B)?Object(y["unref"])(S)():Object(y["unref"])(vt)()})},[Object(y["unref"])(B)?(Object(y["openBlock"])(),Object(y["createBlock"])(O,{key:0,class:"tool-icon"})):(Object(y["openBlock"])(),Object(y["createBlock"])(O,{key:1,class:"tool-icon"})),Object(y["createElementVNode"])("span",null,Object(y["toDisplayString"])(Object(y["unref"])(B)?"退出全屏":"全屏"),1)]),Object(y["createVNode"])(g,{class:"divider"}),Object(y["createElementVNode"])("div",{class:"tool-btn",onClick:n[4]||(n[4]=function(e){return Object(y["unref"])(E)()})},[Object(y["createVNode"])(x,{class:"tool-icon"}),rk])]),Object(y["createElementVNode"])("div",ik,[Object(y["createElementVNode"])("div",{class:Object(y["normalizeClass"])(["slide-list-wrap",{"laser-pen":d.value}]),ref_key:"slideListWrapRef",ref:r},[Object(y["withDirectives"])(Object(y["createVNode"])(Lx,{slideWidth:Object(y["unref"])(k),slideHeight:Object(y["unref"])(C),animationIndex:Object(y["unref"])(h),turnSlideToId:Object(y["unref"])(j),manualExitFullscreen:Object(y["unref"])(S),onWheel:n[5]||(n[5]=function(e){return Object(y["unref"])(f)(e)}),onTouchstart:n[6]||(n[6]=function(e){return Object(y["unref"])(b)(e)}),onTouchend:n[7]||(n[7]=function(e){return Object(y["unref"])(p)(e)})},null,8,["slideWidth","slideHeight","animationIndex","turnSlideToId","manualExitFullscreen"]),[[I,D]]),u.value?(Object(y["openBlock"])(),Object(y["createBlock"])(Wx,{key:0,slideWidth:Object(y["unref"])(k),slideHeight:Object(y["unref"])(C),position:{left:"75px",top:"5px"},onClose:n[8]||(n[8]=function(e){return u.value=!1})},null,8,["slideWidth","slideHeight"])):Object(y["createCommentVNode"])("",!0)],2),Object(y["createElementVNode"])("div",{class:"thumbnails",ref_key:"thumbnailsRef",ref:i,onWheel:n[9]||(n[9]=Object(y["withModifiers"])((function(e){return T(e)}),["prevent"]))},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(c),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:Object(y["normalizeClass"])(["thumbnail",{active:t===Object(y["unref"])(o)}]),key:e.id,onClick:function(e){return Object(y["unref"])(v)(t)}},[Object(y["createVNode"])(ad,{slide:e,size:120/Object(y["unref"])(a),visible:t新添加文本

")},p=function(e){e&&e[0]&&et(e[0]).then((function(e){return s(e)}))},m=function(e){var t={viewBox:[200,200],path:"M 0 0 L 200 0 L 200 200 L 0 200 Z"},n={viewBox:[200,200],path:"M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z"},o={square:t,round:n},a=200;f({left:(tt-a)/2,top:(tt*c.value-a)/2,width:a,height:a},o[e])},O=Object(y["computed"])((function(){var e;return(null===(e=o.value)||void 0===e?void 0:e.remark)||""})),v=function(e){var n=e.target.value;t.updateSlide({remark:n})};return function(e,t){var n=Object(y["resolveComponent"])("IconPlus"),c=Object(y["resolveComponent"])("Button"),o=Object(y["resolveComponent"])("IconCopy"),a=Object(y["resolveComponent"])("IconDelete"),u=Object(y["resolveComponent"])("ButtonGroup"),d=Object(y["resolveComponent"])("IconFontSize"),s=Object(y["resolveComponent"])("IconPicture"),f=Object(y["resolveComponent"])("FileInput"),j=Object(y["resolveComponent"])("IconSquare"),h=Object(y["resolveComponent"])("IconRound");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Tk,[Object(y["createElementVNode"])("div",Mk,[Object(y["createElementVNode"])("textarea",{value:Object(y["unref"])(O),placeholder:"点击输入演讲者备注",onInput:t[0]||(t[0]=function(e){return v(e)})},null,40,Dk)]),Object(y["createElementVNode"])("div",zk,[Object(y["createVNode"])(u,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[1]||(t[1]=function(e){return Object(y["unref"])(l)()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(n,{class:"icon"}),Fk]})),_:1}),Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[2]||(t[2]=function(e){return Object(y["unref"])(r)()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(o,{class:"icon"}),Ak]})),_:1}),Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[3]||(t[3]=function(e){return Object(y["unref"])(i)()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(a,{class:"icon"}),Rk]})),_:1})]})),_:1}),Object(y["createVNode"])(u,{class:"row"},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[4]||(t[4]=function(e){return b()})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(d,{class:"icon"}),Pk]})),_:1}),Object(y["createVNode"])(c,{style:{flex:"1"}},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(f,{onChange:t[5]||(t[5]=function(e){return p(e)})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(s,{class:"icon"}),Hk]})),_:1})]})),_:1}),Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[6]||(t[6]=function(e){return m("square")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(j,{class:"icon"}),qk]})),_:1}),Object(y["createVNode"])(c,{style:{flex:"1"},onClick:t[7]||(t[7]=function(e){return m("round")})},{default:Object(y["withCtx"])((function(){return[Object(y["createVNode"])(h,{class:"icon"}),Uk]})),_:1})]})),_:1})]),Object(y["createVNode"])(_k)])}}});n("e62b");const Xk=pn()(Gk,[["__scopeId","data-v-5c24a24d"]]);var Yk=Xk,Zk=function(e){return Object(y["pushScopeId"])("data-v-446388c6"),e=e(),Object(y["popScopeId"])(),e},Wk={class:"element-toolbar"},Jk={class:"tabs"},Kk=["onClick"],Qk={class:"content"},$k={key:0,class:"style"},eC=Object(y["createTextVNode"])("+"),tC=Object(y["createTextVNode"])("-"),nC={class:"row-block"},cC=Zk((function(){return Object(y["createElementVNode"])("div",{class:"label"},"文字颜色:",-1)})),oC={class:"colors"},aC=["onClick"],lC={class:"row-block"},rC=Zk((function(){return Object(y["createElementVNode"])("div",{class:"label"},"填充色:",-1)})),iC={class:"colors"},uC=["onClick"],dC={key:1,class:"common"},sC=Object(y["createTextVNode"])(" 复制"),fC=Object(y["createTextVNode"])(" 删除"),bC=Object(y["createTextVNode"])(" 置顶"),pC=Object(y["createTextVNode"])(" 置底"),mC=Object(y["createTextVNode"])(" 上移"),OC=Object(y["createTextVNode"])(" 下移"),vC=Object(y["createTextVNode"])(" 左对齐"),jC=Object(y["createTextVNode"])(" 水平居中"),hC=Object(y["createTextVNode"])(" 右对齐"),yC=Object(y["createTextVNode"])(" 上对齐"),gC=Object(y["createTextVNode"])(" 垂直居中"),xC=Object(y["createTextVNode"])(" 下对齐"),kC=Object(y["defineComponent"])({__name:"ElementToolbar",setup:function(e){var t=["#000000","#ffffff","#eeece1","#1e497b","#4e81bb","#e2534d","#9aba60","#8165a0","#47acc5","#f9974c","#c21401","#ff1e02","#ffc12a","#ffff3a","#90cf5b","#00af57"],n=ie(),c=ae(),o=Object(g["c"])(n),a=o.handleElement,l=o.handleElementId,r=o.richTextAttrs,i=at(),u=i.addHistorySnapshot,d=function(e,t){c.updateElement({id:e,props:t}),u()},s=[{key:"style",label:"样式"},{key:"common",label:"布局"}],f=Object(y["ref"])("common"),b=Ot(),p=b.orderElement,m=hc(),O=m.alignElementToCanvas,v=rt(),j=v.addElementsFromData,h=st(),x=h.deleteElement,N=function(){var e=JSON.parse(JSON.stringify(a.value));j([e])},E=function(e,t){ta.emit(fo.RICH_TEXT_COMMAND,{action:{command:e,value:t}})},w=function(e){var t;if(a.value){if(("text"===a.value.type||"shape"===a.value.type&&null!==(t=a.value.text)&&void 0!==t&&t.content)&&ta.emit(fo.RICH_TEXT_COMMAND,{action:{command:"color",value:e}}),"table"===a.value.type){for(var n=JSON.parse(JSON.stringify(a.value.data)),c=0;c=l.value?(e-20)/tt:(t-20)/l.value/tt}));Object(y["onMounted"])((function(){i.value.length&&n.setActiveElementIdList([]),0!==o.value&&t.updateSlideIndex(0)}));var O=Object(y["computed"])((function(){return{width:tt*m.value+"px",height:tt*l.value*m.value+"px"}})),v=Object(y["ref"])([]),j=function(){v.value=a.value?JSON.parse(JSON.stringify(a.value.elements)):[]};Object(y["watchEffect"])(j);var h=mc(v,s,m),x=h.dragElement,k=bc(v,s,m),C=k.scaleElement,N=function(e,t){var c=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];i.value.includes(t.id)||(n.setActiveElementIdList([t.id]),n.setHandleElementId(t.id)),c&&x(e,t)},E=function(){n.setActiveElementIdList([])};return function(t,n){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",TC,[Object(y["createVNode"])(_C,{changeMode:e.changeMode},null,8,["changeMode"]),Object(y["createElementVNode"])("div",{class:"content",ref_key:"contentRef",ref:d,onTouchstart:n[0]||(n[0]=function(e){return E()})},[Object(y["createElementVNode"])("div",{class:"viewport-wrapper",style:Object(y["normalizeStyle"])(Object(y["unref"])(O))},[Object(y["createElementVNode"])("div",{class:"background",style:Object(y["normalizeStyle"])(Object(y["unref"])(p))},null,4),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(s.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createBlock"])(Hr,{key:t,type:e.type,axis:e.axis,length:e.length,canvasScale:Object(y["unref"])(m)},null,8,["type","axis","length","canvasScale"])})),128)),(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(v.value,(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:e.id},["line"!==e.type?(Object(y["openBlock"])(),Object(y["createBlock"])(wk,{key:0,elementInfo:e,isSelected:Object(y["unref"])(i).includes(e.id),canvasScale:Object(y["unref"])(m),scaleElement:Object(y["unref"])(C)},null,8,["elementInfo","isSelected","canvasScale","scaleElement"])):Object(y["createCommentVNode"])("",!0)],64)})),128)),Object(y["createElementVNode"])("div",{class:"viewport",style:Object(y["normalizeStyle"])({transform:"scale(".concat(Object(y["unref"])(m),")")})},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(v.value,(function(e,t){return Object(y["openBlock"])(),Object(y["createBlock"])(Ck,{key:e.id,elementInfo:e,elementIndex:t+1,selectElement:N},null,8,["elementInfo","elementIndex"])})),128))],4)],4)],544),Object(y["createVNode"])(Yk),Object(y["unref"])(u)?(Object(y["openBlock"])(),Object(y["createBlock"])(NC,{key:0})):Object(y["createCommentVNode"])("",!0)])}}});n("2d86");const DC=pn()(MC,[["__scopeId","data-v-8cdcde82"]]);var zC=DC,FC={class:"header"},AC=Object(y["createTextVNode"])(" 退出播放"),RC=Object(y["defineComponent"])({__name:"MobilePlayer",props:{changeMode:{type:Function,required:!0}},setup:function(e){var t=ae(),n=Object(g["c"])(t),c=n.slides,o=n.slideIndex,a=n.currentSlide,l=n.viewportRatio,r=Object(y["ref"])(!1),i=Object(y["ref"])({width:0,height:0});Object(y["onMounted"])((function(){0!==o.value&&t.updateSlideIndex(0),i.value={width:document.body.clientHeight,height:document.body.clientWidth}}));var u=Object(y["computed"])((function(){var e=i.value.height/i.value.width,t=0,n=0;return e>=l.value?(t=i.value.width,n=t*l.value):(n=i.value.height,t=n/l.value),{width:t,height:n}})),d=Object(y["ref"])(null),s=function(e){d.value={x:e.changedTouches[0].pageX,y:e.changedTouches[0].pageY}},f=function(e){if(d.value){var n=Math.abs(d.value.y-e.changedTouches[0].pageY),a=e.changedTouches[0].pageX-d.value.x;Math.abs(a)>n&&Math.abs(a)>50&&(d.value=null,a<0&&o.value>0&&t.updateSlideIndex(o.value-1),a>0&&o.valueObject(y["unref"])(o),hide:(t===Object(y["unref"])(o)-1||t===Object(y["unref"])(o)+1)&&e.turningMode!==Object(y["unref"])(a).turningMode}]),key:e.id},[Math.abs(Object(y["unref"])(o)-t)<2?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:0,class:"slide-content",style:Object(y["normalizeStyle"])({width:Object(y["unref"])(u).width+"px",height:Object(y["unref"])(u).height+"px"})},[Object(y["createVNode"])(ad,{slide:e,size:Object(y["unref"])(u).width},null,8,["slide","size"])],4)):Object(y["createCommentVNode"])("",!0)],2)})),128))],32),r.value?(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],{key:0},[Object(y["createElementVNode"])("div",FC,[Object(y["createElementVNode"])("div",{class:"back",onClick:n[3]||(n[3]=function(t){return e.changeMode("preview")})},[Object(y["createVNode"])(l),AC])]),Object(y["createVNode"])(_k,{class:"thumbnails"})],64)):Object(y["createCommentVNode"])("",!0)],4)}}});n("4f8b");const PC=pn()(RC,[["__scopeId","data-v-5293de3b"]]);var HC=PC,qC={class:"thumbnail-list"},UC={class:"menu"},GC=Object(y["createTextVNode"])(" 编辑"),XC=Object(y["createTextVNode"])(" 播放"),YC=Object(y["defineComponent"])({__name:"MobilePreview",props:{changeMode:{type:Function,required:!0}},setup:function(e){var t=Object(g["c"])(ae()),n=t.slides,c=vf(),o=c.slidesLoadLimit,a=Object(y["ref"])(),l=Object(y["ref"])(0);return Object(y["onMounted"])((function(){a.value&&(l.value=a.value.clientWidth)})),function(t,c){var r=Object(y["resolveComponent"])("IconEdit"),i=Object(y["resolveComponent"])("Divider"),u=Object(y["resolveComponent"])("IconFullScreenPlay");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"mobile-preview",ref_key:"mobileRef",ref:a},[Object(y["createElementVNode"])("div",qC,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(n),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"thumbnail-item",key:e.id},[Object(y["createVNode"])(ad,{slide:e,size:l.value-20,visible:tc?1:Math.round(100*r/c)/100,o.value.a!==t&&n("colorChange",{r:o.value.r,g:o.value.g,b:o.value.b,a:t})}},i=function e(){window.removeEventListener("mousemove",r),window.removeEventListener("mouseup",e)},u=function(e){r(e),window.addEventListener("mousemove",r),window.addEventListener("mouseup",i)};return Object(y["onUnmounted"])(i),function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",hw,[Object(y["createElementVNode"])("div",yw,[Object(y["createVNode"])(vw)]),Object(y["createElementVNode"])("div",{class:"alpha-gradient",style:Object(y["normalizeStyle"])({background:Object(y["unref"])(a)})},null,4),Object(y["createElementVNode"])("div",{class:"alpha-container",ref_key:"alphaRef",ref:l,onMousedown:t[0]||(t[0]=function(e){return u(e)})},[Object(y["createElementVNode"])("div",{class:"alpha-pointer",style:Object(y["normalizeStyle"])({left:100*Object(y["unref"])(o).a+"%"})},xw,4)],544)])}}});n("e83e");const Cw=pn()(kw,[["__scopeId","data-v-246b525c"]]);var Nw=Cw,Ew=function(e){return Object(y["pushScopeId"])("data-v-60c3cca1"),e=e(),Object(y["popScopeId"])(),e},ww={class:"hue"},Vw=Ew((function(){return Object(y["createElementVNode"])("div",{class:"hue-picker"},null,-1)})),Iw=[Vw],Bw=Object(y["defineComponent"])({__name:"Hue",props:{value:{type:Object,required:!0},hue:{type:Number,required:!0}},emits:["colorChange"],setup:function(e,t){var n=t.emit,c=e,o=Object(y["ref"])(0),a=Object(y["ref"])(""),l=Object(y["computed"])((function(){var e=ee()(c.value).toHsl();return-1!==c.hue&&(e.h=c.hue),e})),r=Object(y["computed"])((function(){return 0===l.value.h&&"right"===a.value?"100%":100*l.value.h/360+"%"}));Object(y["watch"])((function(){return c.value}),(function(){var e=ee()(c.value).toHsl(),t=0===e.s?c.hue:e.h;0!==t&&t-o.value>0&&(a.value="right"),0!==t&&t-o.value<0&&(a.value="left"),o.value=t}));var i=Object(y["ref"])(),u=function(e){if(e.preventDefault(),i.value){var t,o,a=i.value.clientWidth,r=i.value.getBoundingClientRect().left+window.pageXOffset,u=e.pageX-r;u<0?t=0:u>a?t=360:(o=100*u/a,t=360*o/100),-1!==c.hue&&l.value.h===t||n("colorChange",{h:t,l:l.value.l,s:l.value.s,a:l.value.a})}},d=function e(){window.removeEventListener("mousemove",u),window.removeEventListener("mouseup",e)},s=function(e){u(e),window.addEventListener("mousemove",u),window.addEventListener("mouseup",d)};return Object(y["onUnmounted"])(d),function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",ww,[Object(y["createElementVNode"])("div",{class:"hue-container",ref_key:"hueRef",ref:i,onMousedown:t[0]||(t[0]=function(e){return s(e)})},[Object(y["createElementVNode"])("div",{class:"hue-pointer",style:Object(y["normalizeStyle"])({left:Object(y["unref"])(r)})},Iw,4)],544)])}}});n("179a");const Sw=pn()(Bw,[["__scopeId","data-v-60c3cca1"]]);var Lw=Sw,_w=function(e){return Object(y["pushScopeId"])("data-v-d230faf4"),e=e(),Object(y["popScopeId"])(),e},Tw=_w((function(){return Object(y["createElementVNode"])("div",{class:"saturation-white"},null,-1)})),Mw=_w((function(){return Object(y["createElementVNode"])("div",{class:"saturation-black"},null,-1)})),Dw=_w((function(){return Object(y["createElementVNode"])("div",{class:"saturation-circle"},null,-1)})),zw=[Dw],Fw=Object(y["defineComponent"])({__name:"Saturation",props:{value:{type:Object,required:!0},hue:{type:Number,required:!0}},emits:["colorChange"],setup:function(e,t){var n=t.emit,c=e,o=Object(y["computed"])((function(){var e=ee()(c.value).toHsv();return-1!==c.hue&&(e.h=c.hue),e})),a=Object(y["computed"])((function(){return"hsl(".concat(o.value.h,", 100%, 50%)")})),l=Object(y["computed"])((function(){return-100*o.value.v+1+100+"%"})),r=Object(y["computed"])((function(){return 100*o.value.s+"%"})),i=Object(te["throttle"])((function(e){n("colorChange",e)}),20,{leading:!0,trailing:!1}),u=Object(y["ref"])(),d=function(e){if(e.preventDefault(),u.value){var t=u.value.clientWidth,n=u.value.clientHeight,c=u.value.getBoundingClientRect().left+window.pageXOffset,a=u.value.getBoundingClientRect().top+window.pageYOffset,l=Object(te["clamp"])(e.pageX-c,0,t),r=Object(te["clamp"])(e.pageY-a,0,n),d=l/t,s=Object(te["clamp"])(-r/n+1,0,1);i({h:o.value.h,s:d,v:s,a:o.value.a})}},s=function e(){window.removeEventListener("mousemove",d),window.removeEventListener("mouseup",e)},f=function(e){d(e),window.addEventListener("mousemove",d),window.addEventListener("mouseup",s)};return Object(y["onUnmounted"])(s),function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"saturation",ref_key:"saturationRef",ref:u,style:Object(y["normalizeStyle"])({background:Object(y["unref"])(a)}),onMousedown:t[0]||(t[0]=function(e){return f(e)})},[Tw,Mw,Object(y["createElementVNode"])("div",{class:"saturation-pointer",style:Object(y["normalizeStyle"])({top:Object(y["unref"])(l),left:Object(y["unref"])(r)})},zw,4)],36)}}});n("0516");const Aw=pn()(Fw,[["__scopeId","data-v-d230faf4"]]);var Rw=Aw,Pw={class:"editable-input"},Hw=["value"],qw=Object(y["defineComponent"])({__name:"EditableInput",props:{value:{type:Object,required:!0}},emits:["colorChange"],setup:function(e,t){var n=t.emit,c=e,o=Object(y["computed"])((function(){var e="";return e=c.value.a<1?ee()(c.value).toHex8String().toUpperCase():ee()(c.value).toHexString().toUpperCase(),e.replace("#","")})),a=function(e){var t=e.target.value;t.length>=6&&n("colorChange",ee()(t).toRgb())};return function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Pw,[Object(y["createElementVNode"])("input",{class:"input-content",value:Object(y["unref"])(o),onInput:t[0]||(t[0]=function(e){return a(e)})},null,40,Hw)])}}});n("a9b0");const Uw=pn()(qw,[["__scopeId","data-v-2f428dde"]]);var Gw=Uw,Xw={class:"color-picker"},Yw={class:"picker-saturation-wrap"},Zw={class:"picker-controls"},Ww={class:"picker-color-wrap"},Jw={class:"picker-sliders"},Kw={class:"picker-hue-wrap"},Qw={class:"picker-alpha-wrap"},$w={class:"picker-field"},eV={class:"picker-presets"},tV=["onClick"],nV={class:"picker-gradient-presets"},cV=["onClick"],oV={class:"picker-presets"},aV=["onClick"],lV={key:0,class:"recent-colors-title"},rV={class:"picker-presets"},iV=["onClick"],uV=Object(y["defineComponent"])({__name:"index",props:{modelValue:{type:String,default:"#e86b99"}},emits:["update:modelValue"],setup:function(e,t){var n=t.emit,c=e,o="RECENT_COLORS",a=[["#7f7f7f","#f2f2f2"],["#0d0d0d","#808080"],["#1c1a10","#ddd8c3"],["#0e243d","#c6d9f0"],["#233f5e","#dae5f0"],["#632623","#f2dbdb"],["#4d602c","#eaf1de"],["#3f3150","#e6e0ec"],["#1e5867","#d9eef3"],["#99490f","#fee9da"]],l=function(e,t,n){for(var c=ee()(e).toRgb(),o=ee()(t).toRgb(),a=(o.r-c.r)/n,l=(o.g-c.g)/n,r=(o.b-c.b)/n,i=[],u=0;ut&&(s.value=s.value.slice(0,t))}}),300,{trailing:!0});Object(y["onMounted"])((function(){var e=localStorage.getItem(o);e&&(s.value=JSON.parse(e))})),Object(y["watch"])(s,(function(){var e=JSON.stringify(s.value);localStorage.setItem(o,e)}));var v=function(e){"h"in e?(d.value=e.h,f.value=ee()(e).toRgb()):(d.value=ee()(e).toHsl().h,f.value=e),O()},j=function(){var e="EyeDropper"in window;e?h():g()},h=function(){Se["a"].success("按 ESC 键关闭取色吸管");var e=new window.EyeDropper;e.open().then((function(e){var t=ee()(e.sRGBHex);d.value=t.toHsl().h,f.value=t.toRgb(),O()})).catch((function(){Se["a"].success("关闭取色吸管")}))},g=function(){var e=document.querySelector(".canvas");if(e){var t=document.createElement("div");t.style.cssText="position: fixed; top: 0; left: 0; bottom: 0; right: 0; z-index: 9999; cursor: wait;",document.body.appendChild(t);var n=document.createElement("div");n.style.cssText="position: absolute; top: -100px; left: -100px; width: 16px; height: 16px; border: 1px solid #000; z-index: 999",t.appendChild(n);var c=e.getBoundingClientRect(),o=c.left,a=c.top,l=c.width,r=c.height,i=function(e){return(!e.tagName||"FOREIGNOBJECT"!==e.tagName.toUpperCase())&&(!e.classList||!e.classList.contains("operate"))};Object(Et["a"])(e,{filter:i,fontEmbedCSS:"",width:l,height:r,canvasWidth:l,canvasHeight:r,pixelRatio:1}).then((function(e){e.style.cssText="position: absolute; top: ".concat(a,"px; left: ").concat(o,"px; cursor: crosshair;"),t.style.cursor="default",t.appendChild(e);var c=e.getContext("2d");if(c){var l="",r=function(e){var t=e.x,r=e.y,i=t-o,u=r-a,d=Object(me["a"])(c.getImageData(i,u,1,1).data,4),s=d[0],f=d[1],b=d[2],p=d[3];l="rgba(".concat(s,", ").concat(f,", ").concat(b,", ").concat((p/255).toFixed(2),")"),n.style.left=t+10+"px",n.style.top=r+10+"px",n.style.backgroundColor=l},i=function(){l="",n.style.left="-100px",n.style.top="-100px",n.style.backgroundColor=""},u=function n(c){if(l&&0===c.button){var o=ee()(l);d.value=o.toHsl().h,f.value=o.toRgb(),O()}document.body.removeChild(t),e.removeEventListener("mousemove",r),e.removeEventListener("mouseleave",i),window.removeEventListener("mousedown",n)};e.addEventListener("mousemove",r),e.addEventListener("mouseleave",i),window.addEventListener("mousedown",u)}})).catch((function(){Se["a"].error("取色吸管初始化失败"),document.body.removeChild(t)}))}};return function(e,t){var n=Object(y["resolveComponent"])("IconNeedle");return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",Xw,[Object(y["createElementVNode"])("div",Yw,[Object(y["createVNode"])(Rw,{value:Object(y["unref"])(f),hue:d.value,onColorChange:t[0]||(t[0]=function(e){return v(e)})},null,8,["value","hue"])]),Object(y["createElementVNode"])("div",Zw,[Object(y["createElementVNode"])("div",Ww,[Object(y["createElementVNode"])("div",{class:"picker-current-color",style:Object(y["normalizeStyle"])({background:Object(y["unref"])(p)})},null,4),Object(y["createVNode"])(vw)]),Object(y["createElementVNode"])("div",Jw,[Object(y["createElementVNode"])("div",Kw,[Object(y["createVNode"])(Lw,{value:Object(y["unref"])(f),hue:d.value,onColorChange:t[1]||(t[1]=function(e){return v(e)})},null,8,["value","hue"])]),Object(y["createElementVNode"])("div",Qw,[Object(y["createVNode"])(Nw,{value:Object(y["unref"])(f),onColorChange:t[2]||(t[2]=function(e){return v(e)})},null,8,["value"])])])]),Object(y["createElementVNode"])("div",$w,[Object(y["createVNode"])(Gw,{class:"input",value:Object(y["unref"])(f),onColorChange:t[3]||(t[3]=function(e){return v(e)})},null,8,["value"]),Object(y["createElementVNode"])("div",{class:"straw",onClick:t[4]||(t[4]=function(e){return j()})},[Object(y["createVNode"])(n)])]),Object(y["createElementVNode"])("div",eV,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(i,(function(e){return Object(y["createElementVNode"])("div",{class:"picker-presets-color",key:e,style:Object(y["normalizeStyle"])({background:e}),onClick:function(t){return m(e)}},null,12,tV)})),64))]),Object(y["createElementVNode"])("div",nV,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(Object(y["unref"])(b),(function(e,t){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"picker-gradient-col",key:t},[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(e,(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{class:"picker-gradient-color",key:e,style:Object(y["normalizeStyle"])({background:e}),onClick:function(t){return m(e)}},null,12,cV)})),128))])})),128))]),Object(y["createElementVNode"])("div",oV,[(Object(y["openBlock"])(),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(u,(function(e){return Object(y["createElementVNode"])("div",{key:e,class:"picker-presets-color",style:Object(y["normalizeStyle"])({background:e}),onClick:function(t){return m(e)}},null,12,aV)})),64))]),s.value.length?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",lV,"最近使用:")):Object(y["createCommentVNode"])("",!0),Object(y["createElementVNode"])("div",rV,[(Object(y["openBlock"])(!0),Object(y["createElementBlock"])(y["Fragment"],null,Object(y["renderList"])(s.value,(function(e){return Object(y["openBlock"])(),Object(y["createElementBlock"])("div",{key:e,class:"picker-presets-color alpha",onClick:function(t){return m(e)}},[Object(y["createElementVNode"])("div",{class:"picker-presets-color-content",style:Object(y["normalizeStyle"])({background:e})},null,4)],8,iV)})),128))])])}}});n("ecf8");const dV=pn()(uV,[["__scopeId","data-v-c46eb110"]]);var sV=dV,fV={key:0,class:"fullscreen-spin"},bV=Object(y["defineComponent"])({__name:"FullscreenSpin",props:{loading:{type:Boolean,default:!1},tip:{type:String,default:""}},setup:function(e){return function(t,n){var c=Object(y["resolveComponent"])("Spin");return e.loading?(Object(y["openBlock"])(),Object(y["createElementBlock"])("div",fV,[Object(y["createVNode"])(c,{tip:e.tip,size:"large"},null,8,["tip"])])):Object(y["createCommentVNode"])("",!0)}}});n("5d4b");const pV=pn()(bV,[["__scopeId","data-v-16ead44e"]]);var mV=pV,OV={FileInput:lw,CheckboxButton:uw,CheckboxButtonGroup:pw,ColorPicker:sV,FullscreenSpin:mV},vV={install:function(e){for(var t=0,n=Object.keys(OV);t {\n const { empty } = view.state.selection\n if (empty) selectAll(view.state, view.dispatch)\n}\n\nexport const addMark = (editorView: EditorView, mark: Mark, selection?: { from: number; to: number; }) => {\n if (selection) {\n editorView.dispatch(editorView.state.tr.addMark(selection.from, selection.to, mark))\n }\n else {\n const { $from, $to } = editorView.state.selection\n editorView.dispatch(editorView.state.tr.addMark($from.pos, $to.pos, mark))\n }\n}\n\nexport const findNodesWithSameMark = (doc: Node, from: number, to: number, markType: MarkType) => {\n let ii = from\n const finder = (mark: Mark) => mark.type === markType\n let firstMark = null\n let fromNode = null\n let toNode = null\n\n while (ii <= to) {\n const node = doc.nodeAt(ii)\n if (!node || !node.marks) return null\n\n const mark = node.marks.find(finder)\n if (!mark) return null\n\n if (firstMark && mark !== firstMark) return null\n\n fromNode = fromNode || node\n firstMark = firstMark || mark\n toNode = node\n ii++\n }\n\n let fromPos = from\n let toPos = to\n\n let jj = 0\n ii = from - 1\n while (ii > jj) {\n const node = doc.nodeAt(ii)\n const mark = node && node.marks.find(finder)\n if (!mark || mark !== firstMark) break\n fromPos = ii\n fromNode = node\n ii--\n }\n\n ii = to + 1\n jj = doc.nodeSize - 2\n while (ii < jj) {\n const node = doc.nodeAt(ii)\n const mark = node && node.marks.find(finder)\n if (!mark || mark !== firstMark) break\n toPos = ii\n toNode = node\n ii++\n }\n\n return {\n mark: firstMark,\n from: {\n node: fromNode,\n pos: fromPos,\n },\n to: {\n node: toNode,\n pos: toPos,\n },\n }\n}\n\nconst equalNodeType = (nodeType: NodeType, node: Node) => {\n return Array.isArray(nodeType) && nodeType.indexOf(node.type) > -1 || node.type === nodeType\n}\n\nconst findParentNodeClosestToPos = ($pos: ResolvedPos, predicate: (node: Node) => boolean) => {\n for (let i = $pos.depth; i > 0; i--) {\n const node = $pos.node(i)\n if (predicate(node)) {\n return {\n pos: i > 0 ? $pos.before(i) : 0,\n start: $pos.start(i),\n depth: i,\n node,\n }\n }\n }\n}\n\nexport const findParentNode = (predicate: (node: Node) => boolean) => {\n return (_ref: Selection) => findParentNodeClosestToPos(_ref.$from, predicate)\n}\n\nexport const findParentNodeOfType = (nodeType: NodeType) => {\n return (selection: Selection) => {\n return findParentNode((node: Node) => {\n return equalNodeType(nodeType, node)\n })(selection)\n }\n}\n\nexport const isActiveOfParentNodeType = (nodeType: string, state: EditorState) => {\n const node = state.schema.nodes[nodeType]\n return !!findParentNodeOfType(node)(state.selection)\n}\n\nexport const getMarkAttrs = (view: EditorView) => {\n const { selection, doc } = view.state\n const { from } = selection\n\n let node = doc.nodeAt(from) || doc.nodeAt(from - 1)\n if (node?.lastChild) node = node.lastChild\n\n return node?.marks || []\n}\n\nexport const getAttrValue = (marks: Mark[], markType: string, attr: string) => {\n for (const mark of marks) {\n if (mark.type.name === markType && mark.attrs[attr]) return mark.attrs[attr]\n }\n return null\n}\n\nexport const isActiveMark = (marks: Mark[], markType: string) => {\n for (const mark of marks) {\n if (mark.type.name === markType) return true\n }\n return false\n}\n\nexport const markActive = (state: EditorState, type: MarkType) => {\n const { from, $from, to, empty } = state.selection\n if (empty) return type.isInSet(state.storedMarks || $from.marks())\n return state.doc.rangeHasMark(from, to, type)\n}\n\nexport const getAttrValueInSelection = (view: EditorView, attr: string) => {\n const { selection, doc } = view.state\n const { from, to } = selection\n\n let keepChecking = true\n let value = ''\n doc.nodesBetween(from, to, node => {\n if (keepChecking && node.attrs[attr]) {\n keepChecking = false\n value = node.attrs[attr]\n }\n return keepChecking\n })\n return value\n}\n\ninterface DefaultAttrs {\n color?: string\n backcolor?: string\n fontsize?: string\n fontname?: string\n align?: string\n}\nconst _defaultAttrs: DefaultAttrs = {\n color: '#000',\n backcolor: '#000',\n fontsize: '20px',\n fontname: '微软雅黑',\n align: 'left',\n}\nexport const getTextAttrs = (view: EditorView, defaultAttrs: DefaultAttrs = {}) => {\n defaultAttrs = { ..._defaultAttrs, ...defaultAttrs }\n\n const marks = getMarkAttrs(view)\n\n const isBold = isActiveMark(marks, 'strong')\n const isEm = isActiveMark(marks, 'em')\n const isUnderline = isActiveMark(marks, 'underline')\n const isStrikethrough = isActiveMark(marks, 'strikethrough')\n const isSuperscript = isActiveMark(marks, 'superscript')\n const isSubscript = isActiveMark(marks, 'subscript')\n const isCode = isActiveMark(marks, 'code')\n const color = getAttrValue(marks, 'forecolor', 'color') || defaultAttrs.color\n const backcolor = getAttrValue(marks, 'backcolor', 'backcolor') || defaultAttrs.backcolor\n const fontsize = getAttrValue(marks, 'fontsize', 'fontsize') || defaultAttrs.fontsize\n const fontname = getAttrValue(marks, 'fontname', 'fontname') || defaultAttrs.fontname\n const link = getAttrValue(marks, 'link', 'href') || ''\n const align = getAttrValueInSelection(view, 'align') || defaultAttrs.align\n const isBulletList = isActiveOfParentNodeType('bullet_list', view.state)\n const isOrderedList = isActiveOfParentNodeType('ordered_list', view.state)\n const isBlockquote = isActiveOfParentNodeType('blockquote', view.state)\n\n return {\n bold: isBold,\n em: isEm,\n underline: isUnderline,\n strikethrough: isStrikethrough,\n superscript: isSuperscript,\n subscript: isSubscript,\n code: isCode,\n color: color,\n backcolor: backcolor,\n fontsize: fontsize,\n fontname: fontname,\n link: link,\n align: align,\n bulletList: isBulletList,\n orderedList: isOrderedList,\n blockquote: isBlockquote,\n }\n}\n\nexport type TextAttrs = ReturnType\n\nexport const getFontsize = (view: EditorView) => {\n const marks = getMarkAttrs(view)\n const fontsize = getAttrValue(marks, 'fontsize', 'fontsize') || _defaultAttrs.fontsize\n return parseInt(fontsize)\n}\n\nexport const defaultRichTextAttrs: TextAttrs = {\n bold: false,\n em: false,\n underline: false,\n strikethrough: false,\n superscript: false,\n subscript: false,\n code: false,\n color: '#000',\n backcolor: '#000',\n fontsize: '20px',\n fontname: '微软雅黑',\n link: '',\n align: 'left',\n bulletList: false,\n orderedList: false,\n blockquote: false,\n}","/**\n * 判断操作系统是否存在某字体\n * @param fontName 字体名\n */\nexport const isSupportFont = (fontName: string) => {\n if (typeof fontName !== 'string') return false\n\n const arial = 'Arial'\n if (fontName.toLowerCase() === arial.toLowerCase()) return true\n\n const size = 100\n const width = 100\n const height = 100\n const str = 'a'\n\n const canvas = document.createElement('canvas')\n const ctx = canvas.getContext('2d')\n\n if (!ctx) return false\n\n canvas.width = width\n canvas.height = height\n ctx.textAlign = 'center'\n ctx.fillStyle = 'black'\n ctx.textBaseline = 'middle'\n\n const getDotArray = (_fontFamily: string) => {\n ctx.clearRect(0, 0, width, height)\n ctx.font = `${size}px ${_fontFamily}, ${arial}`\n ctx.fillText(str, width / 2, height / 2)\n const imageData = ctx.getImageData(0, 0, width, height).data\n return [].slice.call(imageData).filter(item => item !== 0)\n }\n\n return getDotArray(arial).join('') !== getDotArray(fontName).join('')\n}","import { Slide } from '@/types/slides'\n\nexport const slides: Slide[] = [\n {\n id: 'test-slide-1',\n elements: [\n {\n type: 'shape',\n id: '4cbRxp',\n left: 0,\n top: 200,\n width: 546,\n height: 362.5,\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 Z',\n fill: '#5b9bd5',\n fixedRatio: false,\n opacity: 0.7,\n rotate: 0\n },\n {\n type: 'shape',\n id: 'ookHrf',\n left: 0,\n top: 0,\n width: 300,\n height: 320,\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 Z',\n fill: '#5b9bd5',\n fixedRatio: false,\n flipV: true,\n rotate: 0\n },\n {\n type: 'text',\n id: 'idn7Mx',\n left: 355,\n top: 65.25,\n width: 585,\n height: 188,\n lineHeight: 1.2,\n content: '

PPTIST

',\n rotate: 0,\n defaultFontName: 'Microsoft Yahei',\n defaultColor: '#333'\n },\n {\n type: 'text',\n id: '7stmVP',\n left: 355,\n top: 253.25,\n width: 585,\n height: 56,\n content: '

基于 Vue 3.x + TypeScript 的在线演示文稿应用

',\n rotate: 0,\n defaultFontName: 'Microsoft Yahei',\n defaultColor: '#333'\n },\n {\n type: 'line',\n id: 'FnpZs4',\n left: 361,\n top: 238,\n start: [0, 0],\n end: [549, 0],\n points: ['', ''],\n color: '#5b9bd5',\n style: 'solid',\n width: 2,\n },\n ],\n background: {\n type: 'solid',\n color: '#ffffff',\n },\n },\n {\n id: 'test-slide-2',\n elements: [\n {\n type: 'text',\n id: 'ptNnUJ',\n left: 145,\n top: 148,\n width: 711,\n height: 77,\n lineHeight: 1.2,\n content: '

在此处添加标题

',\n rotate: 0,\n defaultFontName: 'Microsoft Yahei',\n defaultColor: '#333',\n }, \n {\n type: 'text',\n id: 'mRHvQN',\n left: 207.50000000000003,\n top: 249.84259259259264,\n width: 585,\n height: 56,\n content: '

在此处添加副标题

',\n rotate: 0,\n defaultFontName: 'Microsoft Yahei',\n defaultColor: '#333',\n }, \n {\n type: 'line',\n id: '7CQDwc',\n left: 323.09259259259267,\n top: 238.33333333333334,\n start: [0, 0],\n end: [354.8148148148148, 0],\n points: ['', ''],\n color: '#5b9bd5',\n style: 'solid',\n width: 4\n }, \n {\n type: 'shape',\n id: '09wqWw',\n left: -27.648148148148138,\n top: 432.73148148148147,\n width: 1056.2962962962963,\n height: 162.96296296296296,\n viewBox: [200, 200],\n path: 'M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z',\n fill: '#5b9bd5',\n fixedRatio: false,\n rotate: 0\n }\n ],\n background: {\n type: 'solid',\n color: '#fff',\n },\n },\n {\n id: 'test-slide-3',\n elements: [\n {\n type: 'shape',\n id: 'vSheCJ',\n left: 183.5185185185185,\n top: 175.5092592592593,\n width: 605.1851851851851,\n height: 185.18518518518516,\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n fill: '#5b9bd5',\n fixedRatio: false,\n rotate: 0\n }, \n {\n type: 'shape',\n id: 'Mpwv7x',\n left: 211.29629629629628,\n top: 201.80555555555557,\n width: 605.1851851851851,\n height: 185.18518518518516,\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n fill: '#5b9bd5',\n fixedRatio: false,\n rotate: 0,\n opacity: 0.7\n }, \n {\n type: 'text',\n id: 'WQOTAp',\n left: 304.9074074074074,\n top: 198.10185185185182,\n width: 417.9629629629629,\n height: 140,\n content: '

感谢观看

',\n rotate: 0,\n defaultFontName: 'Microsoft Yahei',\n defaultColor: '#333',\n wordSpace: 5\n }\n ],\n background: {\n type: 'solid',\n color: '#fff',\n },\n },\n]","import { SlideTheme } from '@/types/slides'\n\nexport const theme: SlideTheme = {\n themeColor: '#5b9bd5',\n fontColor: '#333',\n fontName: 'Microsoft Yahei',\n backgroundColor: '#fff',\n}","/* eslint-disable max-lines */\n\nimport { Slide } from '@/types/slides'\n\nexport const layouts: Slide[] = [\n {\n id: 'template',\n elements: [\n {\n type: 'shape',\n id: '4cbRxp',\n left: 0,\n top: 200,\n width: 546,\n height: 362.5,\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n opacity: 0.7,\n rotate: 0\n },\n {\n type: 'shape',\n id: 'ookHrf',\n left: 0,\n top: 0,\n width: 300,\n height: 320,\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n flipV: true,\n rotate: 0\n },\n {\n type: 'text',\n id: 'AkIh3E',\n left: 355,\n top: 95.11111111111111,\n width: 585,\n height: 116,\n lineHeight: 1.2,\n content: '

输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n wordSpace: 6\n },\n {\n type: 'text',\n id: '7stmVP',\n left: 355,\n top: 253.25,\n width: 585,\n height: 56,\n content: '

请在此处输入副标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n },\n {\n type: 'line',\n id: 'FnpZs4',\n left: 361,\n top: 238,\n start: [0, 0],\n end: [549, 0],\n points: ['', ''],\n color: '{{themeColor}}',\n style: 'solid',\n width: 2,\n },\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'text',\n id: 'ptNnUJ',\n left: 145,\n top: 148,\n width: 711,\n height: 77,\n lineHeight: 1.2,\n content: '

在此处添加标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'text',\n id: 'mRHvQN',\n left: 207.50000000000003,\n top: 249.84259259259264,\n width: 585,\n height: 56,\n content: '

在此处添加副标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'line',\n id: '7CQDwc',\n left: 323.09259259259267,\n top: 238.33333333333334,\n start: [0, 0],\n end: [354.8148148148148, 0],\n points: ['', ''],\n color: '{{themeColor}}',\n style: 'solid',\n width: 4\n }, \n {\n type: 'shape',\n id: '09wqWw',\n left: -27.648148148148138,\n top: 432.73148148148147,\n width: 1056.2962962962963,\n height: 162.96296296296296,\n viewBox: [200, 200],\n path: 'M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'shape',\n id: 'vSheCJ',\n left: 183.5185185185185,\n top: 175.5092592592593,\n width: 605.1851851851851,\n height: 185.18518518518516,\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0\n }, \n {\n type: 'shape',\n id: 'Mpwv7x',\n left: 211.29629629629628,\n top: 201.80555555555557,\n width: 605.1851851851851,\n height: 185.18518518518516,\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n opacity: 0.7\n }, \n {\n type: 'text',\n id: 'WQOTAp',\n left: 304.9074074074074,\n top: 198.10185185185182,\n width: 417.9629629629629,\n height: 140,\n content: '

感谢观看

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n wordSpace: 5\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'MZVO1kkj',\n elements: [\n {\n type: 'shape',\n id: 'cql0h8',\n left: 0,\n top: 0,\n width: 352.59259259259255,\n height: 562.5,\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0\n },\n {\n type: 'shape',\n id: '_RTaF4',\n left: 171.4814814814814,\n top: 100.13888888888887,\n width: 362.22222222222223,\n height: 362.22222222222223,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: 'rgba(255,255,255,0)',\n fixedRatio: false,\n rotate: 0,\n outline: {\n width: 10,\n color: '{{backgroundColor}}',\n style: 'solid'\n }\n },\n {\n type: 'shape',\n id: 'UZfo8N',\n left: 216.66666666666663,\n top: 145.32407407407408,\n width: 271.85185185185185,\n height: 271.85185185185185,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{backgroundColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

01

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n },\n {\n type: 'text',\n id: 'ysqtBg',\n left: 561.4814814814814,\n top: 100.1388888888889,\n width: 359.25925925925924,\n height: 80,\n content: '

在此处输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n },\n {\n type: 'text',\n id: 'lXsoHa',\n left: 572.5925925925925,\n top: 202.3611111111111,\n width: 257.77777777777777,\n height: 260,\n content: '
  1. 在此处输入内容

  2. 在此处输入内容

  3. 在此处输入内容

  4. 在此处输入内容

  5. 在此处输入内容

  6. 在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n lineHeight: 2,\n fill: '{{subColor}}'\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'shape',\n id: 'EBBnTr',\n left: 360.5996472663139,\n top: 141.8496472663139,\n width: 278.80070546737215,\n height: 278.80070546737215,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: true,\n rotate: 0,\n outline: {\n width: 0,\n color: '{{backgroundColor}}',\n style: 'solid'\n }\n }, \n {\n type: 'shape',\n id: 'gDIWDH',\n left: 456.4373897707231,\n top: 98.287037037037,\n width: 87.12522045855381,\n height: 87.12522045855381,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: true,\n rotate: 0,\n outline: {\n width: 4,\n color: '{{backgroundColor}}',\n style: 'solid'\n },\n text: {\n content: '

1

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'shape',\n id: 'DUWT7E',\n left: 317.037037037037,\n top: 237.68738977072314,\n width: 87.12522045855381,\n height: 87.12522045855381,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: true,\n rotate: 0,\n outline: {\n width: 4,\n color: '{{backgroundColor}}',\n style: 'solid'\n },\n text: {\n content: '

4

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'shape',\n id: 'pbhn38',\n left: 456.43738977072303,\n top: 377.08774250440916,\n width: 87.12522045855381,\n height: 87.12522045855381,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: true,\n rotate: 0,\n outline: {\n width: 4,\n color: '{{backgroundColor}}',\n style: 'solid'\n },\n text: {\n content: '

3

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'shape',\n id: 'CvMKrO',\n left: 595.8377425044091,\n top: 237.6873897707231,\n width: 87.12522045855381,\n height: 87.12522045855381,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: true,\n rotate: 0,\n outline: {\n width: 4,\n color: '{{backgroundColor}}',\n style: 'solid'\n },\n text: {\n content: '

2

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: 'adudHB',\n left: 402.962962962963,\n top: 39.39814814814815,\n width: 194.07407407407408,\n height: 50,\n content: '

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'text',\n id: '9UpDwg',\n left: 402.962962962963,\n top: 473.1018518518518,\n width: 194.07407407407408,\n height: 50,\n content: '

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'text',\n id: 'GERdpB',\n left: 111.48148148148151,\n top: 256.25,\n width: 194.07407407407408,\n height: 50,\n content: '

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'text',\n id: 'G5qoho',\n left: 691.1111111111111,\n top: 256.25,\n width: 194.07407407407408,\n height: 50,\n content: '

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }, \n {\n type: 'shape',\n id: 'vdZcI6',\n left: 415.18518518518516,\n top: 196.4351851851852,\n width: 169.62962962962962,\n height: 169.62962962962962,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{backgroundColor}}',\n fixedRatio: false,\n rotate: 0\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'shape',\n id: 'tYUmrx',\n left: 156.66666666666683,\n top: 149.02777777777771,\n width: 264.4444444444445,\n height: 264.4444444444445,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

01

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n },\n {\n type: 'shape',\n id: '0GVHf8',\n left: 342.2222222222223,\n top: 217.17592592592587,\n width: 128.14814814814812,\n height: 128.14814814814812,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{backgroundColor}}',\n fixedRatio: false,\n rotate: 0\n },\n {\n type: 'text',\n id: 'BO33Sv',\n left: 378.8888888888889,\n top: 235.24999999999994,\n width: 464.4444444444444,\n height: 92,\n content: '

在此处添加标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'text',\n id: 'Hj7ttp',\n left: 69.35185185185185,\n top: 49.21759259259262,\n width: 420,\n height: 63,\n lineHeight: 1.2,\n content: '

1.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'FmKMNB',\n left: 69.35185185185185,\n top: 129.28240740740745,\n width: 420,\n height: 384,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'rI7ZeO',\n left: 510.64814814814815,\n top: 49.21759259259262,\n width: 420,\n height: 63,\n lineHeight: 1.2,\n content: '

2.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'KspwGc',\n left: 510.64814814814815,\n top: 129.28240740740745,\n width: 420,\n height: 384,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'text',\n id: 'Rx63Jo',\n left: 69.35185185185179,\n top: 51.71759259259262,\n width: 420,\n height: 58,\n lineHeight: 1.2,\n content: '

1.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'ulyuzE',\n left: 69.35185185185179,\n top: 131.78240740740745,\n width: 420,\n height: 129,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'kr35Ca',\n left: 510.6481481481481,\n top: 51.71759259259262,\n width: 420,\n height: 58,\n lineHeight: 1.2,\n content: '

2.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'BNQSpC',\n left: 510.6481481481481,\n top: 131.78240740740745,\n width: 420,\n height: 129,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'Vr38Nu',\n left: 69.35185185185185,\n top: 301.71759259259255,\n width: 420,\n height: 58,\n lineHeight: 1.2,\n content: '

3.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'IwKRSu',\n left: 69.35185185185185,\n top: 381.7824074074074,\n width: 420,\n height: 129,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: '0Opr1v',\n left: 510.64814814814815,\n top: 301.71759259259255,\n width: 420,\n height: 58,\n lineHeight: 1.2,\n content: '

4.请输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: '4L9Uzz',\n left: 510.64814814814815,\n top: 381.7824074074074,\n width: 420,\n height: 129,\n content: '

在此处输入内容

在此处输入内容

在此处输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'text',\n id: 'GdEGxg',\n left: 134.53703703703704,\n top: 127.25,\n width: 152.77777777777777,\n height: 308,\n lineHeight: 1.8,\n content: '

请在此处输入标题

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n wordSpace: 8,\n fill: '{{themeColor}}',\n },\n {\n type: 'text',\n id: 'y5sAfw',\n left: 332.8703703703704,\n top: 127.25,\n width: 532.5925925925926,\n height: 50,\n content: '

请在此处输入内容1

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'VeuocM',\n left: 332.8703703703704,\n top: 212.0648148148148,\n width: 532.5925925925926,\n height: 50,\n content: '

请在此处输入内容2

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'RyFWQe',\n left: 332.8703703703704,\n top: 296.8796296296296,\n width: 532.5925925925926,\n height: 50,\n content: '

请在此处输入内容3

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n {\n type: 'text',\n id: 'Q56viI',\n left: 332.8703703703704,\n top: 381.69444444444446,\n width: 532.5925925925926,\n height: 50,\n content: '

请在此处输入内容4

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}',\n },\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n {\n id: 'template',\n elements: [\n {\n type: 'shape',\n id: 'SUWirT',\n left: 73.8888888888889,\n top: 64.21296296296302,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

1

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: 'YjzN1M',\n left: 148.70370370370372,\n top: 64.21296296296302,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n }, \n {\n type: 'shape',\n id: 'fS09I7',\n left: 527.5925925925926,\n top: 64.21296296296302,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

2

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: 'qCnfB1',\n left: 602.4074074074074,\n top: 64.21296296296302,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n },\n {\n type: 'shape',\n id: 'difAAT',\n left: 73.8888888888889,\n top: 221.25000000000003,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

3

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: 'EUlvMo',\n left: 148.70370370370372,\n top: 221.25000000000003,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n }, \n {\n type: 'shape',\n id: 'US_9jB',\n left: 527.5925925925926,\n top: 221.25000000000003,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

4

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: '243MnQ',\n left: 602.4074074074074,\n top: 221.25000000000003,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n }, \n {\n type: 'shape',\n id: 'Y_KUj0',\n left: 73.8888888888889,\n top: 378.287037037037,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

5

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: '9GglMe',\n left: 148.70370370370372,\n top: 378.287037037037,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n }, \n {\n type: 'shape',\n id: 'eSInje',\n left: 527.5925925925926,\n top: 378.287037037037,\n width: 49.629629629629626,\n height: 49.629629629629626,\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n fill: '{{themeColor}}',\n fixedRatio: false,\n rotate: 0,\n text: {\n content: '

6

',\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n align: 'middle'\n }\n }, \n {\n type: 'text',\n id: '0S3yUg',\n left: 602.4074074074074,\n top: 378.287037037037,\n width: 323.7037037037037,\n height: 120,\n content: '

在此输入内容

在此输入内容

在此输入内容

',\n rotate: 0,\n defaultFontName: '{{fontName}}',\n defaultColor: '{{fontColor}}',\n fill: '{{subColor}}'\n }\n ],\n background: {\n type: 'solid',\n color: '{{backgroundColor}}',\n },\n },\n]","import { defineStore } from 'pinia'\nimport tinycolor from 'tinycolor2'\nimport { omit } from 'lodash'\nimport { Slide, SlideTheme, PPTElement, PPTAnimation } from '@/types/slides'\nimport { slides } from '@/mocks/slides'\nimport { theme } from '@/mocks/theme'\nimport { layouts } from '@/mocks/layout'\n\ninterface RemoveElementPropData {\n id: string\n propName: string | string[]\n}\n\ninterface UpdateElementData {\n id: string | string[]\n props: Partial\n}\n\ninterface FormatedAnimation {\n animations: PPTAnimation[]\n autoNext: boolean\n}\n\nexport interface SlidesState {\n theme: SlideTheme\n slides: Slide[]\n slideIndex: number\n viewportRatio: number\n}\n\nexport const useSlidesStore = defineStore('slides', {\n state: (): SlidesState => ({\n theme: theme, // 主题样式\n slides: slides, // 幻灯片页面数据\n slideIndex: 0, // 当前页面索引\n viewportRatio: 0.5625, // 可是区域比例,默认16:9\n }),\n\n getters: {\n currentSlide(state) {\n return state.slides[state.slideIndex]\n },\n \n currentSlideAnimations(state) {\n const currentSlide = state.slides[state.slideIndex]\n if (!currentSlide?.animations) return []\n\n const els = currentSlide.elements\n const elIds = els.map(el => el.id)\n return currentSlide.animations.filter(animation => elIds.includes(animation.elId))\n },\n\n // 格式化的当前页动画\n // 将触发条件为“与上一动画同时”的项目向上合并到序列中的同一位置\n // 为触发条件为“上一动画之后”项目的上一项添加自动向下执行标记\n formatedAnimations(state) {\n const currentSlide = state.slides[state.slideIndex]\n if (!currentSlide?.animations) return []\n\n const els = currentSlide.elements\n const elIds = els.map(el => el.id)\n const animations = currentSlide.animations.filter(animation => elIds.includes(animation.elId))\n\n const formatedAnimations: FormatedAnimation[] = []\n for (const animation of animations) {\n if (animation.trigger === 'click' || !formatedAnimations.length) {\n formatedAnimations.push({ animations: [animation], autoNext: false })\n }\n else if (animation.trigger === 'meantime') {\n const last = formatedAnimations[formatedAnimations.length - 1]\n last.animations = last.animations.filter(item => item.elId !== animation.elId)\n last.animations.push(animation)\n formatedAnimations[formatedAnimations.length - 1] = last\n }\n else if (animation.trigger === 'auto') {\n const last = formatedAnimations[formatedAnimations.length - 1]\n last.autoNext = true\n formatedAnimations[formatedAnimations.length - 1] = last\n formatedAnimations.push({ animations: [animation], autoNext: false })\n }\n }\n return formatedAnimations\n },\n \n layouts(state) {\n const {\n themeColor,\n fontColor,\n fontName,\n backgroundColor,\n } = state.theme\n \n const subColor = tinycolor(fontColor).isDark() ? 'rgba(230, 230, 230, 0.5)' : 'rgba(180, 180, 180, 0.5)'\n \n const layoutsString = JSON.stringify(layouts)\n .replaceAll('{{themeColor}}', themeColor)\n .replaceAll('{{fontColor}}', fontColor)\n .replaceAll('{{fontName}}', fontName)\n .replaceAll('{{backgroundColor}}', backgroundColor)\n .replaceAll('{{subColor}}', subColor)\n \n return JSON.parse(layoutsString)\n },\n },\n\n actions: {\n setTheme(themeProps: Partial) {\n this.theme = { ...this.theme, ...themeProps }\n },\n \n setViewportRatio(viewportRatio: number) {\n this.viewportRatio = viewportRatio\n },\n \n setSlides(slides: Slide[]) {\n this.slides = slides\n },\n \n addSlide(slide: Slide | Slide[]) {\n const slides = Array.isArray(slide) ? slide : [slide]\n const addIndex = this.slideIndex + 1\n this.slides.splice(addIndex, 0, ...slides)\n this.slideIndex = addIndex\n },\n \n updateSlide(props: Partial) {\n const slideIndex = this.slideIndex\n this.slides[slideIndex] = { ...this.slides[slideIndex], ...props }\n },\n \n deleteSlide(slideId: string | string[]) {\n const slidesId = Array.isArray(slideId) ? slideId : [slideId]\n \n const deleteSlidesIndex = []\n for (let i = 0; i < slidesId.length; i++) {\n const index = this.slides.findIndex(item => item.id === slidesId[i])\n deleteSlidesIndex.push(index)\n }\n let newIndex = Math.min(...deleteSlidesIndex)\n \n const maxIndex = this.slides.length - slidesId.length - 1\n if (newIndex > maxIndex) newIndex = maxIndex\n \n this.slideIndex = newIndex\n this.slides = this.slides.filter(item => !slidesId.includes(item.id))\n },\n \n updateSlideIndex(index: number) {\n this.slideIndex = index\n },\n \n addElement(element: PPTElement | PPTElement[]) {\n const elements = Array.isArray(element) ? element : [element]\n const currentSlideEls = this.slides[this.slideIndex].elements\n const newEls = [...currentSlideEls, ...elements]\n this.slides[this.slideIndex].elements = newEls\n },\n\n deleteElement(elementId: string | string[]) {\n const elementIdList = Array.isArray(elementId) ? elementId : [elementId]\n const currentSlideEls = this.slides[this.slideIndex].elements\n const newEls = currentSlideEls.filter(item => !elementIdList.includes(item.id))\n this.slides[this.slideIndex].elements = newEls\n },\n \n updateElement(data: UpdateElementData) {\n const { id, props } = data\n const elIdList = typeof id === 'string' ? [id] : id\n \n const slideIndex = this.slideIndex\n const slide = this.slides[slideIndex]\n const elements = slide.elements.map(el => {\n return elIdList.includes(el.id) ? { ...el, ...props } : el\n })\n this.slides[slideIndex].elements = (elements as PPTElement[])\n },\n \n removeElementProps(data: RemoveElementPropData) {\n const { id, propName } = data\n const propsNames = typeof propName === 'string' ? [propName] : propName\n \n const slideIndex = this.slideIndex\n const slide = this.slides[slideIndex]\n const elements = slide.elements.map(el => {\n return el.id === id ? omit(el, propsNames) : el\n })\n this.slides[slideIndex].elements = (elements as PPTElement[])\n },\n },\n})","import { customAlphabet } from 'nanoid'\nimport { defineStore } from 'pinia'\nimport { CreatingElement } from '@/types/edit'\nimport { ToolbarStates } from '@/types/toolbar'\nimport { DialogForExportTypes } from '@/types/export'\nimport { SYS_FONTS } from '@/configs/font'\nimport { TextAttrs, defaultRichTextAttrs } from '@/utils/prosemirror/utils'\nimport { isSupportFont } from '@/utils/font'\n\nimport { useSlidesStore } from './slides'\n\nexport interface MainState {\n activeElementIdList: string[]\n handleElementId: string\n activeGroupElementId: string\n canvasPercentage: number\n canvasScale: number\n canvasDragged: boolean\n thumbnailsFocus: boolean\n editorAreaFocus: boolean\n disableHotkeys: boolean\n showGridLines: boolean\n showRuler: boolean\n creatingElement: CreatingElement | null\n availableFonts: typeof SYS_FONTS\n toolbarState: ToolbarStates\n clipingImageElementId: string\n isScaling: boolean\n richTextAttrs: TextAttrs\n selectedTableCells: string[]\n selectedSlidesIndex: number[]\n dialogForExport: DialogForExportTypes\n databaseId: string\n}\n\nconst nanoid = customAlphabet('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz')\nexport const databaseId = nanoid(10)\n\nexport const useMainStore = defineStore('main', {\n state: (): MainState => ({\n activeElementIdList: [], // 被选中的元素ID集合,包含 handleElementId\n handleElementId: '', // 正在操作的元素ID\n activeGroupElementId: '', // 组合元素成员中,被选中可独立操作的元素ID\n canvasPercentage: 90, // 画布可视区域百分比\n canvasScale: 1, // 画布缩放比例(基于宽度1000px)\n canvasDragged: false, // 画布被拖拽移动\n thumbnailsFocus: false, // 左侧导航缩略图区域聚焦\n editorAreaFocus: false, // 编辑区域聚焦\n disableHotkeys: false, // 禁用快捷键\n showGridLines: false, // 显示网格线\n showRuler: false, // 显示标尺\n creatingElement: null, // 正在插入的元素信息,需要通过绘制插入的元素(文字、形状、线条)\n availableFonts: SYS_FONTS, // 当前环境可用字体\n toolbarState: ToolbarStates.SLIDE_DESIGN, // 右侧工具栏状态\n clipingImageElementId: '', // 当前正在裁剪的图片ID \n richTextAttrs: defaultRichTextAttrs, // 富文本状态\n selectedTableCells: [], // 选中的表格单元格\n isScaling: false, // 正在进行元素缩放\n selectedSlidesIndex: [], // 当前被选中的页面索引集合\n dialogForExport: '', // 导出面板\n databaseId, // 标识当前应用的indexedDB数据库ID\n }),\n\n getters: {\n activeElementList(state) {\n const slidesStore = useSlidesStore()\n const currentSlide = slidesStore.currentSlide\n if (!currentSlide || !currentSlide.elements) return []\n return currentSlide.elements.filter(element => state.activeElementIdList.includes(element.id))\n },\n \n handleElement(state) {\n const slidesStore = useSlidesStore()\n const currentSlide = slidesStore.currentSlide\n if (!currentSlide || !currentSlide.elements) return null\n return currentSlide.elements.find(element => state.handleElementId === element.id) || null\n },\n },\n\n actions: {\n setActiveElementIdList(activeElementIdList: string[]) {\n if (activeElementIdList.length === 1) this.handleElementId = activeElementIdList[0]\n else this.handleElementId = ''\n \n this.activeElementIdList = activeElementIdList\n },\n \n setHandleElementId(handleElementId: string) {\n this.handleElementId = handleElementId\n },\n \n setActiveGroupElementId(activeGroupElementId: string) {\n this.activeGroupElementId = activeGroupElementId\n },\n \n setCanvasPercentage(percentage: number) {\n this.canvasPercentage = percentage\n },\n \n setCanvasScale(scale: number) {\n this.canvasScale = scale\n },\n \n setCanvasDragged(isDragged: boolean) {\n this.canvasDragged = isDragged\n },\n \n setThumbnailsFocus(isFocus: boolean) {\n this.thumbnailsFocus = isFocus\n },\n \n setEditorareaFocus(isFocus: boolean) {\n this.editorAreaFocus = isFocus\n },\n \n setDisableHotkeysState(disable: boolean) {\n this.disableHotkeys = disable\n },\n \n setGridLinesState(show: boolean) {\n this.showGridLines = show\n },\n \n setRulerState(show: boolean) {\n this.showRuler = show\n },\n \n setCreatingElement(element: CreatingElement | null) {\n this.creatingElement = element\n },\n \n setAvailableFonts() {\n this.availableFonts = SYS_FONTS.filter(font => isSupportFont(font.value))\n },\n \n setToolbarState(toolbarState: ToolbarStates) {\n this.toolbarState = toolbarState\n },\n \n setClipingImageElementId(elId: string) {\n this.clipingImageElementId = elId\n },\n \n setRichtextAttrs(attrs: TextAttrs) {\n this.richTextAttrs = attrs\n },\n \n setSelectedTableCells(cells: string[]) {\n this.selectedTableCells = cells\n },\n \n setScalingState(isScaling: boolean) {\n this.isScaling = isScaling\n },\n \n updateSelectedSlidesIndex(selectedSlidesIndex: number[]) {\n this.selectedSlidesIndex = selectedSlidesIndex\n },\n\n setDialogForExport(type: DialogForExportTypes) {\n this.dialogForExport = type\n },\n },\n})","export const LOCALSTORAGE_KEY_DISCARDED_DB = 'PPTIST_DISCARDED_DB'","import Dexie from 'dexie'\nimport { databaseId } from '@/store/main'\nimport { Slide } from '@/types/slides'\nimport { LOCALSTORAGE_KEY_DISCARDED_DB } from '@/configs/storage'\n\nexport interface Snapshot {\n index: number\n slides: Slide[]\n}\n\nconst databaseNamePrefix = 'PPTist'\n\n// 删除失效/过期的数据库\n// 应用关闭时(关闭或刷新浏览器),会将其数据库ID记录在 localStorage 中,表示该ID指向的数据库已失效\n// 当应用初始化时,检查当前所有数据库,将被记录失效的数据库删除\n// 另外,距离初始化时间超过12小时的数据库也将被删除(这是为了防止出现因以外未被正确删除的库)\nexport const deleteDiscardedDB = async () => {\n const now = new Date().getTime()\n\n const localStorageDiscardedDB = localStorage.getItem(LOCALSTORAGE_KEY_DISCARDED_DB)\n const localStorageDiscardedDBList: string[] = localStorageDiscardedDB ? JSON.parse(localStorageDiscardedDB) : []\n\n const databaseNames = await Dexie.getDatabaseNames()\n const discardedDBNames = databaseNames.filter(name => {\n if (name.indexOf(databaseNamePrefix) === -1) return false\n \n const [prefix, id, time] = name.split('_')\n if (prefix !== databaseNamePrefix || !id || !time) return true\n if (localStorageDiscardedDBList.includes(id)) return true\n if (now - (+time) >= 1000 * 60 * 60 * 12) return true\n\n return false\n })\n\n for (const name of discardedDBNames) Dexie.delete(name)\n localStorage.removeItem(LOCALSTORAGE_KEY_DISCARDED_DB)\n}\n\nclass PPTistDB extends Dexie {\n public snapshots: Dexie.Table\n\n public constructor() {\n super(`${databaseNamePrefix}_${databaseId}_${new Date().getTime()}`)\n this.version(1).stores({\n snapshots: '++id'\n })\n this.snapshots = this.table('snapshots')\n }\n}\n\nexport const db = new PPTistDB()","import { defineStore } from 'pinia'\nimport { IndexableTypeArray } from 'dexie'\nimport { db, deleteDiscardedDB, Snapshot } from '@/utils/database'\n\nimport { useSlidesStore } from './slides'\nimport { useMainStore } from './main'\n\nexport interface ScreenState {\n snapshotCursor: number\n snapshotLength: number\n}\n\nexport const useSnapshotStore = defineStore('snapshot', {\n state: (): ScreenState => ({\n snapshotCursor: -1, // 历史快照指针\n snapshotLength: 0, // 历史快照长度\n }),\n\n getters: {\n canUndo(state) {\n return state.snapshotCursor > 0\n },\n canRedo(state) {\n return state.snapshotCursor < state.snapshotLength - 1\n },\n },\n\n actions: {\n setSnapshotCursor(cursor: number) {\n this.snapshotCursor = cursor\n },\n setSnapshotLength(length: number) {\n this.snapshotLength = length\n },\n\n async initSnapshotDatabase() {\n const slidesStore = useSlidesStore()\n\n await deleteDiscardedDB()\n \n const newFirstSnapshot = {\n index: slidesStore.slideIndex,\n slides: slidesStore.slides,\n }\n await db.snapshots.add(newFirstSnapshot)\n this.setSnapshotCursor(0)\n this.setSnapshotLength(1)\n },\n \n async addSnapshot() {\n const slidesStore = useSlidesStore()\n\n // 获取当前indexeddb中全部快照的ID\n const allKeys = await db.snapshots.orderBy('id').keys()\n \n let needDeleteKeys: IndexableTypeArray = []\n \n // 记录需要删除的快照ID\n // 若当前快照指针不处在最后一位,那么再添加快照时,应该将当前指针位置后面的快照全部删除,对应的实际情况是:\n // 用户撤回多次后,再进行操作(添加快照),此时原先被撤销的快照都应该被删除\n if (this.snapshotCursor >= 0 && this.snapshotCursor < allKeys.length - 1) {\n needDeleteKeys = allKeys.slice(this.snapshotCursor + 1)\n }\n \n // 添加新快照\n const snapshot = {\n index: slidesStore.slideIndex,\n slides: slidesStore.slides,\n }\n await db.snapshots.add(snapshot)\n \n // 计算当前快照长度,用于设置快照指针的位置(此时指针应该处在最后一位,即:快照长度 - 1)\n let snapshotLength = allKeys.length - needDeleteKeys.length + 1\n \n // 快照数量超过长度限制时,应该将头部多余的快照删除\n const snapshotLengthLimit = 20\n if (snapshotLength > snapshotLengthLimit) {\n needDeleteKeys.push(allKeys[0])\n snapshotLength--\n }\n \n // 快照数大于1时,需要保证撤回操作后维持页面焦点不变:也就是将倒数第二个快照对应的索引设置为当前页的索引\n // https://github.com/pipipi-pikachu/PPTist/issues/27\n if (snapshotLength >= 2) {\n db.snapshots.update(allKeys[snapshotLength - 2] as number, { index: slidesStore.slideIndex })\n }\n \n await db.snapshots.bulkDelete(needDeleteKeys)\n \n this.setSnapshotCursor(snapshotLength - 1)\n this.setSnapshotLength(snapshotLength)\n },\n \n async unDo() {\n if (this.snapshotCursor <= 0) return\n\n const slidesStore = useSlidesStore()\n const mainStore = useMainStore()\n \n const snapshotCursor = this.snapshotCursor - 1\n const snapshots: Snapshot[] = await db.snapshots.orderBy('id').toArray()\n const snapshot = snapshots[snapshotCursor]\n const { index, slides } = snapshot\n \n const slideIndex = index > slides.length - 1 ? slides.length - 1 : index\n \n slidesStore.setSlides(slides)\n slidesStore.updateSlideIndex(slideIndex)\n this.setSnapshotCursor(snapshotCursor)\n mainStore.setActiveElementIdList([])\n },\n \n async reDo() {\n if (this.snapshotCursor >= this.snapshotLength - 1) return\n\n const slidesStore = useSlidesStore()\n const mainStore = useMainStore()\n \n const snapshotCursor = this.snapshotCursor + 1\n const snapshots: Snapshot[] = await db.snapshots.orderBy('id').toArray()\n const snapshot = snapshots[snapshotCursor]\n const { index, slides } = snapshot\n \n const slideIndex = index > slides.length - 1 ? slides.length - 1 : index\n \n slidesStore.setSlides(slides)\n slidesStore.updateSlideIndex(slideIndex)\n this.setSnapshotCursor(snapshotCursor)\n mainStore.setActiveElementIdList([])\n },\n },\n})","import { defineStore } from 'pinia'\n\nexport interface KeyboardState {\n ctrlKeyState: boolean\n shiftKeyState: boolean\n spaceKeyState: boolean\n}\n\nexport const useKeyboardStore = defineStore('keyboard', {\n state: (): KeyboardState => ({\n ctrlKeyState: false, // ctrl键按下状态\n shiftKeyState: false, // shift键按下状态\n spaceKeyState: false, // space键按下状态\n }),\n\n getters: {\n ctrlOrShiftKeyActive(state) {\n return state.ctrlKeyState || state.shiftKeyState\n },\n },\n\n actions: {\n setCtrlKeyState(active: boolean) {\n this.ctrlKeyState = active\n },\n setShiftKeyState(active: boolean) {\n this.shiftKeyState = active\n },\n setSpaceKeyState(active: boolean) {\n this.spaceKeyState = active\n },\n },\n})","import { defineStore } from 'pinia'\n\nexport interface ScreenState {\n screening: boolean\n}\n\nexport const useScreenStore = defineStore('screen', {\n state: (): ScreenState => ({\n screening: false, // 是否进入放映状态\n }),\n\n actions: {\n setScreening(screening: boolean) {\n this.screening = screening\n },\n },\n})","import { padStart } from 'lodash'\n\n/**\n * 补足数字位数\n * @param digit 数字\n * @param len 位数\n */\nexport const fillDigit = (digit: number, len: number) => {\n return padStart('' + digit, len, '0')\n}\n\n/**\n * 判断设备\n */\nexport const isPC = () => {\n return !navigator.userAgent.match(/(iPhone|iPod|iPad|Android|Mobile|BlackBerry|Symbian|Windows Phone)/i)\n}","import { IBarChartOptions, ILineChartOptions, IPieChartOptions } from 'chartist'\n\nexport const enum ShapePathFormulasKeys {\n ROUND_RECT = 'roundRect',\n ROUND_RECT_DIAGONAL = 'roundRectDiagonal',\n ROUND_RECT_SINGLE = 'roundRectSingle',\n ROUND_RECT_SAMESIDE = 'roundRectSameSide',\n CUT_RECT_DIAGONAL = 'cutRectDiagonal',\n CUT_RECT_SINGLE = 'cutRectSingle',\n CUT_RECT_SAMESIDE = 'cutRectSameSide',\n MESSAGE = 'message',\n ROUND_MESSAGE = 'roundMessage',\n L = 'L',\n RING_RECT = 'ringRect',\n PLUS = 'plus',\n TRIANGLE = 'triangle',\n PARALLELOGRAM_LEFT = 'parallelogramLeft',\n PARALLELOGRAM_RIGHT = 'parallelogramRight',\n TRAPEZOID = 'trapezoid',\n BULLET = 'bullet',\n INDICATOR = 'indicator',\n}\n\nexport const enum ElementTypes {\n TEXT = 'text',\n IMAGE = 'image',\n SHAPE = 'shape',\n LINE = 'line',\n CHART = 'chart',\n TABLE = 'table',\n LATEX = 'latex',\n VIDEO = 'video',\n AUDIO = 'audio',\n}\n\n/**\n * 元素阴影\n * \n * h: 水平偏移量\n * \n * v: 垂直偏移量\n * \n * blur: 模糊程度\n * \n * color: 阴影颜色\n */\nexport interface PPTElementShadow {\n h: number\n v: number\n blur: number\n color: string\n}\n\n/**\n * 元素边框\n * \n * style?: 边框样式(实线或虚线)\n * \n * width?: 边框宽度\n * \n * color?: 边框颜色\n */\nexport interface PPTElementOutline {\n style?: 'dashed' | 'solid'\n width?: number\n color?: string\n}\n\n/**\n * 元素超链接\n * \n * type: 链接类型(网页、幻灯片页面)\n * \n * target: 目标地址(网页链接、幻灯片页面ID)\n */\nexport interface PPTElementLink {\n type: 'web' | 'slide'\n target: string\n}\n\n\n/**\n * 元素通用属性\n * \n * id: 元素ID\n * \n * left: 元素水平方向位置(距离画布左侧)\n * \n * top: 元素垂直方向位置(距离画布顶部)\n * \n * lock?: 锁定元素\n * \n * groupId?: 组合ID(拥有相同组合ID的元素即为同一组合元素成员)\n * \n * width: 元素宽度\n * \n * height: 元素高度\n * \n * rotate: 旋转角度\n * \n * link?: 超链接\n */\ninterface PPTBaseElement {\n id: string\n left: number\n top: number\n lock?: boolean\n groupId?: string\n width: number\n height: number\n rotate: number\n link?: PPTElementLink\n}\n\n\n/**\n * 文本元素\n * \n * type: 元素类型(text)\n * \n * content: 文本内容(HTML字符串)\n * \n * defaultFontName: 默认字体(会被文本内容中的HTML内联样式覆盖)\n * \n * defaultColor: 默认颜色(会被文本内容中的HTML内联样式覆盖)\n * \n * outline?: 边框\n * \n * fill?: 填充色\n * \n * lineHeight?: 行高(倍),默认1.5\n * \n * wordSpace?: 字间距,默认0\n * \n * opacity?: 不透明度,默认1\n * \n * shadow?: 阴影\n * \n * textIndent?: 段落首行缩进\n * \n * paragraphSpace?: 段间距,默认 5px\n */\nexport interface PPTTextElement extends PPTBaseElement {\n type: 'text'\n content: string\n defaultFontName: string\n defaultColor: string\n outline?: PPTElementOutline\n fill?: string\n lineHeight?: number\n wordSpace?: number\n opacity?: number\n shadow?: PPTElementShadow\n textIndent?: number\n paragraphSpace?: number\n}\n\n\n/**\n * 图片翻转、形状翻转\n * \n * flipH?: 水平翻转\n * \n * flipV?: 垂直翻转\n */\nexport interface ImageOrShapeFlip {\n flipH?: boolean\n flipV?: boolean\n}\n\n/**\n * 图片滤镜\n * \n * https://developer.mozilla.org/zh-CN/docs/Web/CSS/filter\n * \n * 'blur'?: 模糊,默认0(px)\n * \n * 'brightness'?: 亮度,默认100(%)\n * \n * 'contrast'?: 对比度,默认100(%)\n * \n * 'grayscale'?: 灰度,默认0(%)\n * \n * 'saturate'?: 饱和度,默认100(%)\n * \n * 'hue-rotate'?: 色相旋转,默认0(deg)\n * \n * 'opacity'?: 不透明度,默认100(%)\n */\nexport interface ImageElementFilters {\n 'blur'?: string\n 'brightness'?: string\n 'contrast'?: string\n 'grayscale'?: string\n 'saturate'?: string\n 'hue-rotate'?: string\n 'opacity'?: string\n}\n\nexport type ImageClipDataRange = [[number, number], [number, number]]\n\n/**\n * 图片裁剪\n * \n * range: 裁剪范围,例如:[[10, 10], [90, 90]] 表示裁取原图从左上角 10%, 10% 到 90%, 90% 的范围\n * \n * shape: 裁剪形状,见 configs/imageClip.ts CLIPPATHS \n */\nexport interface ImageElementClip {\n range: ImageClipDataRange\n shape: string\n}\n\n/**\n * 图片元素\n * \n * type: 元素类型(image)\n * \n * fixedRatio: 固定图片宽高比例\n * \n * src: 图片地址\n * \n * outline?: 边框\n * \n * filters?: 图片滤镜\n * \n * clip?: 裁剪信息\n * \n * flipH?: 水平翻转\n * \n * flipV?: 垂直翻转\n * \n * shadow?: 阴影\n */\nexport interface PPTImageElement extends PPTBaseElement {\n type: 'image'\n fixedRatio: boolean\n src: string\n outline?: PPTElementOutline\n filters?: ImageElementFilters\n clip?: ImageElementClip\n flipH?: boolean\n flipV?: boolean\n shadow?: PPTElementShadow\n}\n\n\n/**\n * 形状渐变\n * \n * type: 渐变类型(径向、线性)\n * \n * color: 渐变颜色\n * \n * rotate: 渐变角度(线性渐变)\n */\nexport interface ShapeGradient {\n type: 'linear' | 'radial'\n color: [string, string]\n rotate: number\n}\n\n/**\n * 形状内文本\n * \n * content: 文本内容(HTML字符串)\n * \n * defaultFontName: 默认字体(会被文本内容中的HTML内联样式覆盖)\n * \n * defaultColor: 默认颜色(会被文本内容中的HTML内联样式覆盖)\n * \n * align: 文本对齐方向(垂直方向)\n */\nexport interface ShapeText {\n content: string\n defaultFontName: string\n defaultColor: string\n align: 'top' | 'middle' | 'bottom'\n}\n\n/**\n * 形状元素\n * \n * type: 元素类型(shape)\n * \n * viewBox: SVG的viewBox属性,例如 [1000, 1000] 表示 '0 0 1000 1000'\n * \n * path: 形状路径,SVG path 的 d 属性\n * \n * fixedRatio: 固定形状宽高比例\n * \n * fill: 填充,不存在渐变时生效\n * \n * gradient?: 渐变,该属性存在时将优先作为填充\n * \n * outline?: 边框\n * \n * opacity?: 不透明度\n * \n * flipH?: 水平翻转\n * \n * flipV?: 垂直翻转\n * \n * shadow?: 阴影\n * \n * special?: 特殊形状(标记一些难以解析的形状,例如路径使用了 L Q C A 以外的类型,该类形状在导出后将变为图片的形式)\n * \n * text?: 形状内文本\n * \n * pathFormula?: 形状路径计算公式\n * 一般情况下,形状的大小变化时仅由宽高基于 viewBox 的缩放比例来调整形状,而 viewBox 本身和 path 不会变化,\n * 但也有一些形状希望能更精确的控制一些关键点的位置,此时就需要提供路径计算公式,通过在缩放时更新 viewBox 并重新计算 path 来重新绘制形状\n * \n * keypoint?: 关键点位置百分比\n */\nexport interface PPTShapeElement extends PPTBaseElement {\n type: 'shape'\n viewBox: [number, number]\n path: string\n fixedRatio: boolean\n fill: string\n gradient?: ShapeGradient\n outline?: PPTElementOutline\n opacity?: number\n flipH?: boolean\n flipV?: boolean\n shadow?: PPTElementShadow\n special?: boolean\n text?: ShapeText\n pathFormula?: ShapePathFormulasKeys\n keypoint?: number\n}\n\n\nexport type LinePoint = '' | 'arrow' | 'dot' \n\n/**\n * 线条元素\n * \n * type: 元素类型(line)\n * \n * start: 起点位置([x, y])\n * \n * end: 终点位置([x, y])\n * \n * style: 线条样式(实线、虚线)\n * \n * color: 线条颜色\n * \n * points: 端点样式([起点样式, 终点样式],可选:无、箭头、圆点)\n * \n * shadow?: 阴影\n * \n * broken?: 折线控制点位置([x, y])\n * \n * curve?: 二次曲线控制点位置([x, y])\n * \n * curve?: 三次曲线控制点位置([[x1, y1], [x2, y2]])\n */\nexport interface PPTLineElement extends Omit {\n type: 'line'\n start: [number, number]\n end: [number, number]\n style: 'solid' | 'dashed'\n color: string\n points: [LinePoint, LinePoint]\n shadow?: PPTElementShadow\n broken?: [number, number]\n curve?: [number, number]\n cubic?: [[number, number], [number, number]]\n}\n\n\nexport type PresetChartType = 'bar' | 'horizontalBar' | 'line' | 'area' | 'scatter' | 'pie' | 'ring'\nexport type ChartType = 'bar' | 'line' | 'pie'\nexport type ChartOptions = ILineChartOptions & IBarChartOptions & IPieChartOptions\nexport interface ChartData {\n labels: string[]\n legends: string[]\n series: number[][]\n}\n\n/**\n * 图表元素\n * \n * type: 元素类型(chart)\n * \n * fill?: 填充色\n * \n * chartType: 图表基础类型(bar/line/pie),所有图表类型都是由这三种基本类型衍生而来\n * \n * data: 图表数据\n * \n * options?: 图表配置项\n * \n * outline?: 边框\n * \n * themeColor: 主题色\n * \n * gridColor?: 网格&坐标颜色\n * \n * legend?: 图例/位置\n */\nexport interface PPTChartElement extends PPTBaseElement {\n type: 'chart'\n fill?: string\n chartType: ChartType\n data: ChartData\n options?: ChartOptions\n outline?: PPTElementOutline\n themeColor: string[]\n gridColor?: string\n legend?: '' | 'top' | 'bottom'\n}\n\n\n/**\n * 表格单元格样式\n * \n * bold?: 加粗\n * \n * em?: 斜体\n * \n * underline?: 下划线\n * \n * strikethrough?: 删除线\n * \n * color?: 字体颜色\n * \n * backcolor?: 填充色\n * \n * fontsize?: 字体大小\n * \n * fontname?: 字体\n * \n * align?: 对齐方式\n */\nexport interface TableCellStyle {\n bold?: boolean\n em?: boolean\n underline?: boolean\n strikethrough?: boolean\n color?: string\n backcolor?: string\n fontsize?: string\n fontname?: string\n align?: 'left' | 'center' | 'right'\n}\n\n\n/**\n * 表格单元格\n * \n * id: 单元格ID\n * \n * colspan: 合并列数\n * \n * rowspan: 合并行数\n * \n * text: 文字内容\n * \n * style?: 单元格样式\n */\nexport interface TableCell {\n id: string\n colspan: number\n rowspan: number\n text: string\n style?: TableCellStyle\n}\n\n/**\n * 表格主题\n * \n * color: 主题色\n * \n * rowHeader: 标题行\n * \n * rowFooter: 汇总行\n * \n * colHeader: 第一列\n * \n * colFooter: 最后一列\n */\nexport interface TableTheme {\n color: string\n rowHeader: boolean\n rowFooter: boolean\n colHeader: boolean\n colFooter: boolean\n}\n\n/**\n * 表格元素\n * \n * type: 元素类型(table)\n * \n * outline: 边框\n * \n * theme?: 主题\n * \n * colWidths: 列宽数组,如[30, 50, 20]表示三列宽度分别为30%, 50%, 20%\n * \n * data: 表格数据\n */\nexport interface PPTTableElement extends PPTBaseElement {\n type: 'table'\n outline: PPTElementOutline\n theme?: TableTheme\n colWidths: number[]\n data: TableCell[][]\n}\n\n\n/**\n * LaTeX元素(公式)\n * \n * type: 元素类型(latex)\n * \n * latex: latex代码\n * \n * path: svg path\n * \n * color: 颜色\n * \n * strokeWidth: 路径宽度\n * \n * viewBox: SVG的viewBox属性\n * \n * fixedRatio: 固定形状宽高比例\n */\nexport interface PPTLatexElement extends PPTBaseElement {\n type: 'latex'\n latex: string\n path: string\n color: string\n strokeWidth: number\n viewBox: [number, number]\n fixedRatio: boolean\n}\n\n/**\n * 视频元素\n * \n * type: 元素类型(video)\n * \n * src: 视频地址\n * \n * poster: 预览封面\n */\nexport interface PPTVideoElement extends PPTBaseElement {\n type: 'video'\n src: string\n poster?: string\n}\n\n/**\n * 音频元素\n * \n * type: 元素类型(audio)\n * \n * fixedRatio: 固定图标宽高比例\n * \n * color: 图标颜色\n * \n * loop: 循环播放\n * \n * autoplay: 自动播放\n * \n * src: 音频地址\n */\nexport interface PPTAudioElement extends PPTBaseElement {\n type: 'audio'\n fixedRatio: boolean\n color: string,\n loop: boolean,\n autoplay: boolean,\n src: string\n}\n\n\nexport type PPTElement = PPTTextElement | PPTImageElement | PPTShapeElement | PPTLineElement | PPTChartElement | PPTTableElement | PPTLatexElement | PPTVideoElement | PPTAudioElement\n\n\n/**\n * 元素动画\n * \n * id: 动画id\n * \n * elId: 元素ID\n * \n * effect: 动画效果\n * \n * type: 动画类型(入场、退场、强调)\n * \n * duration: 动画持续时间\n * \n * trigger: 动画触发方式(click - 单击时、meantime - 与上一动画同时、auto - 上一动画之后)\n */\nexport interface PPTAnimation {\n id: string\n elId: string\n effect: string\n type: 'in' | 'out' | 'attention'\n duration: number\n trigger: 'click' | 'meantime' | 'auto'\n}\n\n/**\n * 幻灯片背景\n * \n * type: 背景类型(纯色、图片、渐变)\n * \n * color?: 背景颜色(纯色)\n * \n * image?: 图片地址(图片)\n * \n * imageSize?: 图片填充方式\n * \n * gradientType?: 渐变类型(线性、径向)\n * \n * gradientColor?: 渐变颜色\n * \n * gradientRotate?: 渐变角度(线性)\n */\nexport interface SlideBackground {\n type: 'solid' | 'image' | 'gradient'\n color?: string\n image?: string\n imageSize?: 'cover' | 'contain' | 'repeat'\n gradientType?: 'linear' | 'radial'\n gradientColor?: [string, string]\n gradientRotate?: number\n}\n\n\nexport type TurningMode = 'no' | 'fade' | 'slideX' | 'slideY'\n\n/**\n * 幻灯片页面\n * \n * id: 页面ID\n * \n * elements: 元素集合\n * \n * remark?: 备注\n * \n * background?: 页面背景\n * \n * animations?: 元素动画集合\n * \n * turningMode?: 翻页方式\n */\nexport interface Slide {\n id: string\n elements: PPTElement[]\n remark?: string\n background?: SlideBackground\n animations?: PPTAnimation[]\n turningMode?: TurningMode\n}\n\n/**\n * 幻灯片主题\n * \n * backgroundColor: 页面背景颜色\n * \n * themeColor: 主题色,用于默认创建的形状颜色等\n * \n * fontColor: 字体颜色\n * \n * fontName: 字体\n */\nexport interface SlideTheme {\n backgroundColor: string\n themeColor: string\n fontColor: string\n fontName: string\n}","import CryptoJS from 'crypto-js'\n\nconst CRYPTO_KEY = 'pptist'\n\n/**\n * 加密\n * @param msg 待加密字符串\n */\nexport const encrypt = (msg: string) => {\n return CryptoJS.AES.encrypt(msg, CRYPTO_KEY).toString()\n}\n\n/**\n * 解密\n * @param ciphertext 待解密字符串\n */\nexport const decrypt = (ciphertext: string) => {\n const bytes = CryptoJS.AES.decrypt(ciphertext, CRYPTO_KEY)\n return bytes.toString(CryptoJS.enc.Utf8)\n}","import Clipboard from 'clipboard'\nimport { decrypt } from '@/utils/crypto'\n\n/**\n * 复制文本到剪贴板\n * @param text 文本内容\n */\nexport const copyText = (text: string) => {\n return new Promise((resolve, reject) => {\n const fakeElement = document.createElement('button')\n const clipboard = new Clipboard(fakeElement, {\n text: () => text,\n action: () => 'copy',\n container: document.body,\n })\n clipboard.on('success', e => {\n clipboard.destroy()\n resolve(e)\n })\n clipboard.on('error', e => {\n clipboard.destroy()\n reject(e)\n })\n document.body.appendChild(fakeElement)\n fakeElement.click()\n document.body.removeChild(fakeElement)\n })\n}\n\n// 读取剪贴板\nexport const readClipboard = (): Promise => {\n return new Promise((resolve, reject) => {\n if (navigator.clipboard?.readText) {\n navigator.clipboard.readText().then(text => {\n if (!text) reject('剪贴板为空或者不包含文本')\n return resolve(text)\n })\n }\n else reject('浏览器不支持或禁止访问剪贴板,请使用快捷键 Ctrl + V')\n })\n}\n\n// 解析加密后的剪贴板内容\nexport const pasteCustomClipboardString = (text: string) => {\n let clipboardData\n try {\n clipboardData = JSON.parse(decrypt(text))\n }\n catch {\n clipboardData = text\n }\n\n return clipboardData\n}\n\n// 尝试解析剪贴板内容是否为Excel表格(或类似的)数据格式\nexport const pasteExcelClipboardString = (text: string): string[][] | null => {\n const lines: string[] = text.split('\\r\\n')\n\n if (lines[lines.length - 1] === '') lines.pop()\n\n let colCount = -1\n const data: string[][] = []\n for (const index in lines) {\n data[index] = lines[index].split('\\t')\n\n if (data[index].length === 1) return null\n if (colCount === -1) colCount = data[index].length\n else if (colCount !== data[index].length) return null\n }\n return data\n}","import tinycolor from 'tinycolor2'\r\nimport { nanoid } from 'nanoid'\r\nimport { PPTElement, PPTLineElement } from '@/types/slides'\r\n\r\ninterface RotatedElementData {\r\n left: number\r\n top: number\r\n width: number\r\n height: number\r\n rotate: number\r\n}\r\n\r\n/**\r\n * 计算元素在画布中的矩形范围旋转后的新位置范围\r\n * @param element 元素的位置大小和旋转角度信息\r\n */\r\nexport const getRectRotatedRange = (element: RotatedElementData) => {\r\n const { left, top, width, height, rotate = 0 } = element\r\n\r\n const radius = Math.sqrt( Math.pow(width, 2) + Math.pow(height, 2) ) / 2\r\n const auxiliaryAngle = Math.atan(height / width) * 180 / Math.PI\r\n\r\n const tlbraRadian = (180 - rotate - auxiliaryAngle) * Math.PI / 180\r\n const trblaRadian = (auxiliaryAngle - rotate) * Math.PI / 180\r\n\r\n const middleLeft = left + width / 2\r\n const middleTop = top + height / 2\r\n\r\n const xAxis = [\r\n middleLeft + radius * Math.cos(tlbraRadian),\r\n middleLeft + radius * Math.cos(trblaRadian),\r\n middleLeft - radius * Math.cos(tlbraRadian),\r\n middleLeft - radius * Math.cos(trblaRadian),\r\n ]\r\n const yAxis = [\r\n middleTop - radius * Math.sin(tlbraRadian),\r\n middleTop - radius * Math.sin(trblaRadian),\r\n middleTop + radius * Math.sin(tlbraRadian),\r\n middleTop + radius * Math.sin(trblaRadian),\r\n ]\r\n\r\n return {\r\n xRange: [Math.min(...xAxis), Math.max(...xAxis)],\r\n yRange: [Math.min(...yAxis), Math.max(...yAxis)],\r\n }\r\n}\r\n\r\n/**\r\n * 计算元素在画布中的矩形范围旋转后的新位置与旋转之前位置的偏离距离\r\n * @param element 元素的位置大小和旋转角度信息\r\n */\r\nexport const getRectRotatedOffset = (element: RotatedElementData) => {\r\n const { xRange: originXRange, yRange: originYRange } = getRectRotatedRange({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: 0,\r\n })\r\n const { xRange: rotatedXRange, yRange: rotatedYRange } = getRectRotatedRange({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n return {\r\n offsetX: rotatedXRange[0] - originXRange[0],\r\n offsetY: rotatedYRange[0] - originYRange[0],\r\n }\r\n}\r\n\r\n/**\r\n * 计算元素在画布中的位置范围\r\n * @param element 元素信息\r\n */\r\nexport const getElementRange = (element: PPTElement) => {\r\n let minX, maxX, minY, maxY\r\n\r\n if (element.type === 'line') {\r\n minX = element.left\r\n maxX = element.left + Math.max(element.start[0], element.end[0])\r\n minY = element.top\r\n maxY = element.top + Math.max(element.start[1], element.end[1])\r\n }\r\n else if ('rotate' in element && element.rotate) {\r\n const { left, top, width, height, rotate } = element\r\n const { xRange, yRange } = getRectRotatedRange({ left, top, width, height, rotate })\r\n minX = xRange[0]\r\n maxX = xRange[1]\r\n minY = yRange[0]\r\n maxY = yRange[1]\r\n }\r\n else {\r\n minX = element.left\r\n maxX = element.left + element.width\r\n minY = element.top\r\n maxY = element.top + element.height\r\n }\r\n return { minX, maxX, minY, maxY }\r\n}\r\n\r\n/**\r\n * 计算一组元素在画布中的位置范围\r\n * @param elementList 一组元素信息\r\n */\r\nexport const getElementListRange = (elementList: PPTElement[]) => {\r\n const leftValues: number[] = []\r\n const topValues: number[] = []\r\n const rightValues: number[] = []\r\n const bottomValues: number[] = []\r\n\r\n elementList.forEach(element => {\r\n const { minX, maxX, minY, maxY } = getElementRange(element)\r\n leftValues.push(minX)\r\n topValues.push(minY)\r\n rightValues.push(maxX)\r\n bottomValues.push(maxY)\r\n })\r\n\r\n const minX = Math.min(...leftValues)\r\n const maxX = Math.max(...rightValues)\r\n const minY = Math.min(...topValues)\r\n const maxY = Math.max(...bottomValues)\r\n\r\n return { minX, maxX, minY, maxY }\r\n}\r\n\r\nexport interface AlignLine {\r\n value: number\r\n range: [number, number]\r\n}\r\n\r\n/**\r\n * 将一组对齐吸附线进行去重:同位置的的多条对齐吸附线仅留下一条,取该位置所有对齐吸附线的最大值和最小值为新的范围\r\n * @param lines 一组对齐吸附线信息\r\n */\r\nexport const uniqAlignLines = (lines: AlignLine[]) => {\r\n const uniqLines: AlignLine[] = []\r\n lines.forEach(line => {\r\n const index = uniqLines.findIndex(_line => _line.value === line.value)\r\n if (index === -1) uniqLines.push(line)\r\n else {\r\n const uniqLine = uniqLines[index]\r\n const rangeMin = Math.min(uniqLine.range[0], line.range[0])\r\n const rangeMax = Math.max(uniqLine.range[1], line.range[1])\r\n const range: [number, number] = [rangeMin, rangeMax]\r\n const _line = { value: line.value, range }\r\n uniqLines[index] = _line\r\n }\r\n })\r\n return uniqLines\r\n}\r\n\r\n/**\r\n * 以元素列表为基础,为每一个元素生成新的ID,并关联到旧ID形成一个字典\r\n * 主要用于复制元素时,维持数据中各处元素ID原有的关系\r\n * 例如:原本两个组合的元素拥有相同的groupId,复制后依然会拥有另一个相同的groupId\r\n * @param elements 元素列表数据\r\n */\r\nexport const createElementIdMap = (elements: PPTElement[]) => {\r\n const groupIdMap = {}\r\n const elIdMap = {}\r\n for (const element of elements) {\r\n const groupId = element.groupId\r\n if (groupId && !groupIdMap[groupId]) {\r\n groupIdMap[groupId] = nanoid(10)\r\n }\r\n elIdMap[element.id] = nanoid(10)\r\n }\r\n return {\r\n groupIdMap,\r\n elIdMap,\r\n }\r\n}\r\n\r\n/**\r\n * 根据表格的主题色,获取对应用于配色的子颜色\r\n * @param themeColor 主题色\r\n */\r\nexport const getTableSubThemeColor = (themeColor: string) => {\r\n const rgba = tinycolor(themeColor)\r\n return [\r\n rgba.setAlpha(0.3).toRgbString(),\r\n rgba.setAlpha(0.1).toRgbString(),\r\n ]\r\n}\r\n\r\n/**\r\n * 获取线条元素路径字符串\r\n * @param element 线条元素\r\n */\r\nexport const getLineElementPath = (element: PPTLineElement) => {\r\n const start = element.start.join(',')\r\n const end = element.end.join(',')\r\n if (element.broken) {\r\n const mid = element.broken.join(',')\r\n return `M${start} L${mid} L${end}`\r\n }\r\n else if (element.curve) {\r\n const mid = element.curve.join(',')\r\n return `M${start} Q${mid} ${end}`\r\n }\r\n else if (element.cubic) {\r\n const [c1, c2] = element.cubic\r\n const p1 = c1.join(',')\r\n const p2 = c2.join(',')\r\n return `M${start} C${p1} ${p2} ${end}`\r\n }\r\n return `M${start} L${end}`\r\n}","/**\r\n * 将普通文本转为带段落信息的HTML字符串\r\n * @param text 文本\r\n */\r\nexport const parseText2Paragraphs = (text: string) => {\r\n const htmlText = text.replace(/[\\n\\r]+/g, '
')\r\n const paragraphs = htmlText.split('
')\r\n let string = ''\r\n for (const paragraph of paragraphs) {\r\n if (paragraph) string += `
${paragraph}
`\r\n }\r\n return string\r\n}","interface ImageSize {\n width: number\n height: number\n}\n\n/**\n * 获取图片的原始宽高\n * @param src 图片地址\n */\nexport const getImageSize = (src: string): Promise => {\n return new Promise(resolve => {\n const img = document.createElement('img')\n img.src = src\n img.style.opacity = '0'\n document.body.appendChild(img)\n\n img.onload = () => {\n const imgWidth = img.clientWidth\n const imgHeight = img.clientHeight\n \n img.onload = null\n img.onerror = null\n\n document.body.removeChild(img)\n\n resolve({ width: imgWidth, height: imgHeight })\n }\n\n img.onerror = () => {\n img.onload = null\n img.onerror = null\n }\n })\n}\n\n/**\n * 读取图片文件的dataURL\n * @param file 图片文件\n */\nexport const getImageDataURL = (file: File): Promise => {\n return new Promise(resolve => {\n const reader = new FileReader()\n reader.addEventListener('load', () => {\n resolve(reader.result as string)\n })\n reader.readAsDataURL(file)\n })\n}","export const VIEWPORT_SIZE = 1000","import { ShapePathFormulasKeys } from '@/types/slides'\n\nexport interface ShapePoolItem {\n viewBox: [number, number]\n path: string\n special?: boolean\n pathFormula?: ShapePathFormulasKeys\n outlined?: boolean\n}\n\ninterface ShapeListItem {\n type: string\n children: ShapePoolItem[]\n}\n\nexport const SHAPE_PATH_FORMULAS = {\n [ShapePathFormulasKeys.ROUND_RECT]: {\n editable: true,\n defaultValue: 0.125,\n range: [0, 0.5],\n relative: 'left',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M ${radius} 0 L ${width - radius} 0 Q ${width} 0 ${width} ${radius} L ${width} ${height - radius} Q ${width} ${height} ${width - radius} ${height} L ${radius} ${height} Q 0 ${height} 0 ${height - radius} L 0 ${radius} Q 0 0 ${radius} 0 Z`\n }\n },\n [ShapePathFormulasKeys.CUT_RECT_DIAGONAL]: {\n editable: true,\n defaultValue: 0.2,\n range: [0, 0.9],\n relative: 'right',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 ${height - radius} L 0 0 L ${width - radius} 0 L ${width} ${radius} L ${width} ${height} L ${radius} ${height} Z`\n }\n },\n [ShapePathFormulasKeys.CUT_RECT_SINGLE]: {\n editable: true,\n defaultValue: 0.2,\n range: [0, 0.9],\n relative: 'right',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 ${height} L 0 0 L ${width - radius} 0 L ${width} ${radius} L ${width} ${height} Z`\n }\n },\n [ShapePathFormulasKeys.CUT_RECT_SAMESIDE]: {\n editable: true,\n defaultValue: 0.2,\n range: [0, 0.5],\n relative: 'left',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 ${radius} L ${radius} 0 L ${width - radius} 0 L ${width} ${radius} L ${width} ${height} L 0 ${height} Z`\n }\n },\n [ShapePathFormulasKeys.ROUND_RECT_DIAGONAL]: {\n editable: true,\n defaultValue: 0.125,\n range: [0, 1],\n relative: 'right',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 0 L ${width - radius} 0 Q ${width} 0 ${width} ${radius} L ${width} ${height} L ${radius} ${height} Q 0 ${height} 0 ${height - radius} L 0 0 Z`\n }\n },\n [ShapePathFormulasKeys.ROUND_RECT_SINGLE]: {\n editable: true,\n defaultValue: 0.125,\n range: [0, 1],\n relative: 'right',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 0 L ${width - radius} 0 Q ${width} 0 ${width} ${radius} L ${width} ${height} L 0 ${height} L 0 0 Z`\n }\n },\n [ShapePathFormulasKeys.ROUND_RECT_SAMESIDE]: {\n editable: true,\n defaultValue: 0.125,\n range: [0, 0.5],\n relative: 'left',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const radius = Math.min(width, height) * value\n return `M 0 ${radius} Q 0 0 ${radius} 0 L ${width - radius} 0 Q ${width} 0 ${width} ${radius} L ${width} ${height} L 0 ${height} Z`\n }\n },\n [ShapePathFormulasKeys.MESSAGE]: {\n formula: (width: number, height: number) => {\n const arrowWidth = width * 0.2\n const arrowheight = height * 0.2\n return `M 0 0 L ${width} 0 L ${width} ${height - arrowheight} L ${width / 2} ${height - arrowheight} L ${width / 2 - arrowWidth} ${height} L ${width / 2 - arrowWidth} ${height - arrowheight} L 0 ${height - arrowheight} Z`\n }\n },\n [ShapePathFormulasKeys.ROUND_MESSAGE]: {\n formula: (width: number, height: number) => {\n const radius = Math.min(width, height) * 0.125\n const arrowWidth = width * 0.2\n const arrowheight = height * 0.2\n return `M 0 ${radius} Q 0 0 ${radius} 0 L ${width - radius} 0 Q ${width} 0 ${width} ${radius} L ${width} ${height - radius - arrowheight} Q ${width} ${height - arrowheight} ${width - radius} ${height - arrowheight} L ${width / 2} ${height - arrowheight} L ${width / 2 - arrowWidth} ${height} L ${width / 2 - arrowWidth} ${height - arrowheight} L ${radius} ${height - arrowheight} Q 0 ${height - arrowheight} 0 ${height - radius - arrowheight} L 0 ${radius} Z`\n }\n },\n [ShapePathFormulasKeys.L]: {\n editable: true,\n defaultValue: 0.25,\n range: [0.1, 0.9],\n relative: 'left',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const lineWidth = Math.min(width, height) * value\n return `M 0 0 L 0 ${height} L ${width} ${height} L ${width} ${height - lineWidth} L ${lineWidth} ${height - lineWidth} L ${lineWidth} 0 Z`\n }\n },\n [ShapePathFormulasKeys.RING_RECT]: {\n editable: true,\n defaultValue: 0.25,\n range: [0.1, 0.45],\n relative: 'left',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const lineWidth = Math.min(width, height) * value\n return `M 0 0 ${width} 0 ${width} ${height} L 0 ${height} L 0 0 Z M ${lineWidth} ${lineWidth} L ${lineWidth} ${height - lineWidth} L ${width - lineWidth} ${height - lineWidth} L ${width - lineWidth} ${lineWidth} Z`\n }\n },\n [ShapePathFormulasKeys.PLUS]: {\n editable: true,\n defaultValue: 0.25,\n range: [0.1, 0.9],\n relative: 'center',\n getBaseSize: (width: number, height: number) => Math.min(width, height),\n formula: (width: number, height: number, value: number) => {\n const lineWidth = Math.min(width, height) * value\n return `M ${width / 2 - lineWidth / 2} 0 L ${width / 2 - lineWidth / 2} ${height / 2 - lineWidth / 2} L 0 ${height / 2 - lineWidth / 2} L 0 ${height / 2 + lineWidth / 2} L ${width / 2 - lineWidth / 2} ${height / 2 + lineWidth / 2} L ${width / 2 - lineWidth / 2} ${height} L ${width / 2 + lineWidth / 2} ${height} L ${width / 2 + lineWidth / 2} ${height / 2 + lineWidth / 2} L ${width} ${height / 2 + lineWidth / 2} L ${width} ${height / 2 - lineWidth / 2} L ${width / 2 + lineWidth / 2} ${height / 2 - lineWidth / 2} L ${width / 2 + lineWidth / 2} 0 Z`\n }\n },\n [ShapePathFormulasKeys.TRIANGLE]: {\n editable: true,\n defaultValue: 0.5,\n range: [0, 1],\n relative: 'left',\n getBaseSize: (width: number, height: number) => width,\n formula: (width: number, height: number, value: number) => {\n const vertex = width * value\n return `M ${vertex} 0 L 0 ${height} L ${width} ${height} Z`\n }\n },\n [ShapePathFormulasKeys.PARALLELOGRAM_LEFT]: {\n editable: true,\n defaultValue: 0.25,\n range: [0, 0.9],\n relative: 'left',\n getBaseSize: (width: number, height: number) => width,\n formula: (width: number, height: number, value: number) => {\n const point = width * value\n return `M ${point} 0 L ${width} 0 L ${width - point} ${height} L 0 ${height} Z`\n }\n },\n [ShapePathFormulasKeys.PARALLELOGRAM_RIGHT]: {\n editable: true,\n defaultValue: 0.25,\n range: [0, 0.9],\n relative: 'right',\n getBaseSize: (width: number, height: number) => width,\n formula: (width: number, height: number, value: number) => {\n const point = width * value\n return `M 0 0 L ${width - point} 0 L ${width} ${height} L ${point} ${height} Z`\n }\n },\n [ShapePathFormulasKeys.TRAPEZOID]: {\n editable: true,\n defaultValue: 0.25,\n range: [0, 0.5],\n relative: 'left',\n getBaseSize: (width: number, height: number) => width,\n formula: (width: number, height: number, value: number) => {\n const point = width * value\n return `M ${point} 0 L ${width - point} 0 L ${width} ${height} L 0 ${height} Z`\n }\n },\n [ShapePathFormulasKeys.BULLET]: {\n editable: true,\n defaultValue: 0.2,\n range: [0, 1],\n relative: 'top',\n getBaseSize: (width: number, height: number) => height,\n formula: (width: number, height: number, value: number) => {\n const point = height * value\n return `M ${width / 2} 0 L 0 ${point} L 0 ${height} L ${width} ${height} L ${width} ${point} Z`\n }\n },\n [ShapePathFormulasKeys.INDICATOR]: {\n editable: true,\n defaultValue: 0.2,\n range: [0, 0.9],\n relative: 'right',\n getBaseSize: (width: number, height: number) => width,\n formula: (width: number, height: number, value: number) => {\n const point = width * value\n return `M ${width} ${height / 2} L ${width - point} 0 L 0 0 L ${point} ${height / 2} L 0 ${height} L ${width - point} ${height} Z`\n }\n },\n}\n\nexport const SHAPE_LIST: ShapeListItem[] = [\n {\n type: '矩形',\n children: [\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 50 0 L 150 0 Q 200 0 200 50 L 200 150 Q 200 200 150 200 L 50 200 Q 0 200 0 150 L 0 50 Q 0 0 50 0 Z',\n pathFormula: ShapePathFormulasKeys.ROUND_RECT,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 150 L 0 0 L 150 0 L 200 50 L 200 200 L 50 200 Z',\n pathFormula: ShapePathFormulasKeys.CUT_RECT_DIAGONAL,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 200 L 0 0 L 150 0 L 200 50 L 200 200 Z',\n pathFormula: ShapePathFormulasKeys.CUT_RECT_SINGLE,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 50 L 50 0 L 150 0 L 200 50 L 200 200 L 0 200 Z',\n pathFormula: ShapePathFormulasKeys.CUT_RECT_SAMESIDE,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 50 200 Q 0 200 0 150 L 0 0 Z',\n pathFormula: ShapePathFormulasKeys.ROUND_RECT_DIAGONAL,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 L 0 0 Z',\n pathFormula: ShapePathFormulasKeys.ROUND_RECT_SINGLE,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 50 Q 0 0 50 0 L 150 0 Q 200 0 200 50 L 200 200 L 0 200 Z',\n pathFormula: ShapePathFormulasKeys.ROUND_RECT_SAMESIDE,\n },\n ]\n },\n\n {\n type: '常用形状',\n children: [\n {\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 200 L 200 200 L 100 0 Z',\n pathFormula: ShapePathFormulasKeys.TRIANGLE,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 50 0 L 200 0 L 150 200 L 0 200 L 50 0 Z',\n pathFormula: ShapePathFormulasKeys.PARALLELOGRAM_LEFT,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 150 0 L 200 200 L 50 200 L 0 0 Z',\n pathFormula: ShapePathFormulasKeys.PARALLELOGRAM_RIGHT,\n },\n {\n viewBox: [200, 200],\n path: 'M 50 0 L 150 0 L 200 200 L 0 200 L 50 0 Z',\n pathFormula: ShapePathFormulasKeys.TRAPEZOID,\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 100 L 100 200 L 200 100 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 50 L 0 200 L 200 200 L 200 50 L 100 0 Z',\n pathFormula: ShapePathFormulasKeys.BULLET,\n },\n {\n viewBox: [200, 200],\n path: 'M 200 100 L 150 0 L 0 0 L 50 100 L 0 200 L 150 200 L 200 100 Z',\n pathFormula: ShapePathFormulasKeys.INDICATOR,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 200 A 50 100 0 1 1 200 200 L 0 200 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 40 20 A 100 100 0 1 0 200 100 L 100 100 L 40 20 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 A 100 100 102 1 0 200 100 L 100 100 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 160 20 A 100 100 0 1 0 200 100 L 100 100 L 160 20 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 A 100 100 102 1 0 200 100 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 A 100 100 102 1 0 200 100 L 200 0 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 Q 200 200 0 200 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 90 L 50 200 L 150 200 L 200 90 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 60 L 0 140 L 100 200 L 200 140 L 200 60 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 60 0 L 140 0 L 200 60 L 200 140 L 140 200 L 60 200 L 0 140 L 0 60 L 60 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 75 0 L 125 0 L 175 25 L 200 75 L 200 125 L 175 175 L 125 200 L 75 200 L 25 175 L 0 125 L 0 75 L 25 25 L 75 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 150 0 A 50 100 0 1 1 150 200 L 0 200 L 0 0 L 150 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 50 0 A 25 50 0 1 0 50 200 L 150 200 A 25 50 0 1 0 150 0 L 50 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 150 0 A 50 100 0 1 1 150 200 L 0 200 A 50 100 0 0 0 0 0 L 150 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 0 L 200 200 L 0 200 L 0 100 L 200 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 100 L 200 200 L 0 200 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 0 L 100 0 L 0 100 L 0 200 L 200 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 50 0 L 150 0 L 150 50 L 200 50 L 200 150 L 150 150 L 150 200 L 50 200 L 50 150 L 0 150 L 0 50 L 50 50 L 50 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 0 200 L 200 200 L 200 140 L 60 140 L 60 0 L 0 0 Z',\n pathFormula: ShapePathFormulasKeys.L\n },\n {\n viewBox: [200, 200],\n path: 'M0 0 L200 0 L200 200 L0 200 L0 0 Z M50 50 L50 150 L150 150 L150 50 Z',\n pathFormula: ShapePathFormulasKeys.RING_RECT,\n },\n {\n viewBox: [200, 200],\n path: 'M0 100 A100 100 0 1 1 0 101 Z M150 100 A50 50 0 1 0 150 101 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 70 0 L 70 70 L 0 70 L 0 130 L 70 130 L 70 200 L 130 200 L 130 130 L 200 130 L 200 70 L 130 70 L 130 0 L 70 0 Z',\n pathFormula: ShapePathFormulasKeys.PLUS,\n },\n {\n viewBox: [200, 200],\n path: 'M 40 0 L 0 40 L 60 100 L 0 160 L 40 200 L 100 140 L 160 200 L 200 160 L 140 100 L 200 40 L 160 0 L 100 60 L 40 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 160 L 100 160 L 60 200 L 60 160 L 0 160 Z',\n pathFormula: ShapePathFormulasKeys.MESSAGE,\n },\n {\n viewBox: [200, 200],\n path: 'M 0 40 Q 0 0 40 0 L 160 0 Q 200 0 200 40 L 200 120 Q 200 160 160 160 L 100 160 L 60 200 L 60 160 L 40 160 Q 0 160 0 120 L 0 40 Z',\n pathFormula: ShapePathFormulasKeys.ROUND_MESSAGE,\n },\n {\n viewBox: [200, 200],\n path: 'M 180 160 A 100 100 0 1 0 100 200 L 200 200 L 200 160 L 180 160 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 0 L 0 0 L 200 200 L 0 200 L 200 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 20 C 60 60 140 -40 200 20 L 200 180 C 140 140 60 240 0 180 L 0 20 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 0 20 C 40 -40 60 60 100 20 C 140 -40 160 60 200 20 L 200 180 C 140 240 160 140 100 180 C 40 240 60 140 0 180 L 0 20 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 Q 0 50 0 175 Q 100 225 200 175 Q 200 50 100 0 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 0 100 A 50 50 0 1 1 200 100 L 100 200 L 0 100 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 60 60 L 0 100 L 60 140 L 100 200 L 140 140 L 200 100 L 140 60 L 100 0 Z',\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 80 40 L 20 20 L 40 80 L 0 100 L 40 120 L 20 180 L 80 160 L 100 200 L 120 160 L 180 180 L 160 120 L 200 100 L 160 80 L 180 20 L 120 40 L 100 0 Z',\n },\n ],\n },\n \n {\n type: '箭头',\n children: [\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 100 L 50 100 L 50 200 L 150 200 L 150 100 L 200 100 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 200 L 200 100 L 150 100 L 150 0 L 50 0 L 50 100 L 0 100 L 100 200 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 100 L 100 0 L 100 50 L 200 50 L 200 150 L 100 150 L 100 200 L 0 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 100 L 100 0 L 100 50 L 0 50 L 0 150 L 100 150 L 100 200 L 200 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 0 60 L 60 60 L 60 140 L 0 140 L 100 200 L 200 140 L 140 140 L 140 60 L 200 60 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 100 L 60 0 L 60 60 L 140 60 L 140 0 L 200 100 L 140 200 L 140 140 L 60 140 L 60 200 L 0 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 100 0 L 60 40 L 80 40 L 80 80 L 40 80 L 40 60 L 0 100 L 40 140 L 40 120 L 80 120 L 80 160 L 60 160 L 100 200 L 140 160 L 120 160 L 120 120 L 160 120 L 160 140 L 200 100 L 160 60 L 160 80 L 120 80 L 120 40 L 140 40 L 100 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 100 L 100 0 L 100 50 L 200 50 L 150 100 L 200 150 L 100 150 L 100 200 L 0 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 100 L 100 0 L 100 50 L 0 50 L 50 100 L 0 150 L 100 150 L 100 200 L 200 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 100 L 80 20 L 80 80 L 120 80 L 120 0 L 200 0 L 200 200 L 120 200 L 120 120 L 80 120 L 80 180 L 0 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 100 L 120 20 L 120 80 L 80 80 L 80 0 L 0 0 L 0 200 L 80 200 L 80 120 L 120 120 L 120 180 L 200 100 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 120 0 L 200 100 L 120 200 L 0 200 L 80 100 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 80 0 L 200 0 L 120 100 L 200 200 L 80 200 L 0 100 L 80 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 140 0 L 200 100 L 140 200 L 0 200 L 0 100 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 60 0 L 200 0 L 200 100 L 200 200 L 60 200 L 0 100 L 60 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 100 L 0 200 L 60 100 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 0 L 0 100 L 200 200 L 140 100 L 200 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 0 L 80 0 L 200 100 L 80 200 L 0 200 L 120 100 L 0 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 200 0 L 120 0 L 0 100 L 120 200 L 200 200 L 80 100 L 200 0 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 200 L 180 200 L 180 40 L 200 40 L 160 0 L 120 40 L 140 40 L 140 160 L 0 160 L 0 200 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 0 200 L 0 20 L 160 20 L 160 0 L 200 40 L 160 80 L 160 60 L 40 60 L 40 200 L 0 200 Z'\n },\n {\n viewBox: [200, 200],\n path: 'M 40 180 L 180 180 L 180 40 L 200 40 L 160 0 L 120 40 L 140 40 L 140 140 L 40 140 L 40 120 L 0 160 L 40 200 L 40 180 Z'\n },\n {\n viewBox: [1024, 1024],\n path: 'M398.208 302.912V64L0 482.112l398.208 418.176V655.36c284.48 0 483.584 95.552 625.792 304.64-56.896-298.688-227.584-597.312-625.792-657.088z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M625.792 302.912V64L1024 482.112l-398.208 418.176V655.36C341.312 655.36 142.208 750.912 0 960c56.896-298.688 227.584-597.312 625.792-657.088z',\n special: true,\n },\n ],\n },\n\n {\n type: '其他形状',\n children: [\n {\n viewBox: [1024, 1024],\n path: 'M995.336 243.4016c-15.7584-36.5736-38.3376-69.26639999-66.91440001-97.37280001-28.5768-27.98879999-61.73999999-49.8624-98.78399999-65.26799998-38.22-15.876-78.6744-23.8728-120.4224-23.87280001-57.97680001 0-114.5424 15.876-163.69919999 45.864-11.76 7.17360001-22.932 15.05279999-33.51600001 23.63760001-10.584-8.5848-21.75600001-16.46400001-33.51600001-23.63760001-49.1568-29.98799999-105.7224-45.86399999-163.69919999-45.864-41.74799999 0-82.2024 7.9968-120.4224 23.87280001-36.9264 15.28799999-70.2072 37.27919999-98.78399999 65.26799998-28.6944 28.10640001-51.156 60.79919999-66.91440001 97.37280001-16.34639999 37.9848-24.696 78.3216-24.696 119.83439999 0 39.1608 7.9968 79.96800001 23.8728 121.48080001 13.28880001 34.692 32.34000001 70.67760001 56.6832 107.016 38.57279999 57.5064 91.61040001 117.4824 157.4664 178.28160001 109.1328 100.78319999 217.2072 170.4024 221.79359999 173.22479998l27.87120001 17.8752c12.348 7.8792 28.224 7.8792 40.572 0l27.87119999-17.8752c4.58639999-2.94 112.54319999-72.44159999 221.79360001-173.22479998 65.85599999-60.79919999 118.89359999-120.7752 157.4664-178.28160001 24.3432-36.33839999 43.512-72.324 56.68319999-107.016 15.876-41.5128 23.8728-82.32 23.87280001-121.48080001 0.1176-41.5128-8.232-81.8496-24.5784-119.83439999z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M985.20746667 343.50079998l-303.32586667-44.08319999L546.28693333 24.5248c-3.70346666-7.5264-9.79626667-13.6192-17.32266665-17.32266668-18.87573334-9.3184-41.81333333-1.55306667-51.25120001 17.32266668L342.1184 299.41759999l-303.32586667 44.08319999c-8.36266667 1.19466667-16.00853333 5.13706667-21.8624 11.11040001-14.69440001 15.17226667-14.45546667 39.30453334 0.71679999 54.1184l219.46026668 213.9648-51.84853333 302.1312c-1.43359999 8.24320001-0.11946667 16.8448 3.82293333 24.25173333 9.79626667 18.6368 32.9728 25.92426667 51.6096 16.00853334L512 822.44266665l271.3088 142.64320001c7.40693333 3.9424 16.00853333 5.25653333 24.25173333 3.82293333 20.78719999-3.584 34.7648-23.296 31.1808-44.0832l-51.84853333-302.1312 219.46026668-213.9648c5.97333334-5.85386666 9.91573333-13.49973334 11.11039999-21.8624 3.2256-20.90666667-11.34933333-40.26026667-32.256-43.36640001z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M852.65066667 405.84533333C800.54044445 268.40177778 667.76177778 170.66666667 512.22755555 170.66666667S223.91466667 268.288 171.80444445 405.73155555C74.29688889 431.33155555 2.27555555 520.07822222 2.27555555 625.77777778c0 125.72444445 101.83111111 227.55555555 227.44177778 227.55555555h564.56533334C919.89333333 853.33333333 1021.72444445 751.50222222 1021.72444445 625.77777778c0-105.472-71.79377778-194.21866667-169.07377778-219.93244445z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M926.25224691 323.7371485H654.6457886L898.88200917 15.14388241c5.05486373-6.53433603 0.49315743-16.02761669-7.76722963-16.02761668H418.30008701c-3.45210206 0-6.78091476 1.84934039-8.50696579 4.93157436L90.35039154 555.76772251c-3.82197013 6.53433603 0.86302552 14.7947231 8.50696578 14.79472311h215.01664245l-110.22068713 440.88274851c-2.34249783 9.61657002 9.24670194 16.39748478 16.39748477 9.49328065L933.03316167 340.62779071c6.41104668-6.0411786 2.09591911-16.8906422-6.78091476-16.89064221z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M878.47822222 463.30311111c-22.18666667-49.83466667-53.93066667-93.98044445-94.32177777-131.072l-33.10933334-30.37866666c-4.89244445-4.32355555-12.62933333-2.38933333-14.79111111 3.75466666l-14.79111111 42.43911111c-9.216 26.624-26.16888889 53.81688889-50.176 80.55466667-1.59288889 1.70666667-3.41333333 2.16177778-4.66488889 2.27555556-1.25155555 0.11377778-3.18577778-0.11377778-4.89244445-1.70666667-1.59288889-1.36533333-2.38933333-3.41333333-2.27555555-5.46133333 4.20977778-68.49422222-16.27022222-145.74933333-61.09866667-229.83111112C561.26577778 124.01777778 509.72444445 69.51822222 445.32622222 31.51644445l-46.99022222-27.648c-6.144-3.64088889-13.99466667 1.13777778-13.65333333 8.30577777l2.50311111 54.61333333c1.70666667 37.31911111-2.61688889 70.31466667-12.85688889 97.73511112-12.51555555 33.56444445-30.49244445 64.73955555-53.47555556 92.72888888-16.15644445 19.56977778-34.24711111 37.20533333-54.04444444 52.45155556-47.90044445 36.75022222-87.38133333 84.65066667-114.11911111 138.24C125.72444445 502.10133333 111.50222222 562.74488889 111.50222222 623.50222222c0 53.70311111 10.58133333 105.69955555 31.51644445 154.73777778 20.25244445 47.21777778 49.152 89.77066667 85.90222222 126.17955555 36.864 36.40888889 79.64444445 65.08088889 127.31733333 84.992C405.61777778 1010.11911111 457.95555555 1020.58666667 512 1020.58666667s106.38222222-10.46755555 155.76177778-31.06133334c47.67288889-19.91111111 90.56711111-48.46933333 127.31733333-84.992 36.864-36.40888889 65.76355555-78.96177778 85.90222222-126.17955555 20.93511111-49.03822222 31.51644445-101.03466667 31.51644445-154.73777778 0-55.52355555-11.37777778-109.45422222-34.01955556-160.31288889z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M968.20337778 20.11591112H705.44042667c-22.17301333 0-41.92483556 15.16430222-47.14951111 37.33731555C642.36202666 124.73685332 582.08711111 173.03324444 512 173.03324444s-130.36202666-48.29639112-146.29091556-115.58001777c-5.22467555-22.17301333-24.84906667-37.33731556-47.14951111-37.33731555H55.79662222c-30.96576 0-56.06968889 25.10392889-56.06968888 56.06968888v321.12639999c0 30.96576 25.10392889 56.06968889 56.06968888 56.06968889h95.57333334v494.43271112c0 30.96576 25.10392889 56.06968889 56.06968889 56.06968888h609.1207111c30.96576 0 56.06968889-25.10392889 56.06968889-56.06968888V453.38168888h95.57333334c30.96576 0 56.06968889-25.10392889 56.06968888-56.06968889V76.1856c0-30.96576-25.10392889-56.06968889-56.06968888-56.06968888z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M980.94648889 239.80714666H523.46880001L373.99210666 96.82944c-1.91146667-1.78403556-4.46008889-2.80348444-7.00871111-2.80348445H43.05351111c-22.55530667 0-40.77795555 18.22264888-40.77795555 40.77795557v754.39217776c0 22.55530667 18.22264888 40.77795555 40.77795555 40.77795557h937.89297778c22.55530667 0 40.77795555-18.22264888 40.77795555-40.77795557V280.58510222c0-22.55530667-18.22264888-40.77795555-40.77795555-40.77795556z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M972.60904597 164.57058577L841.30587843 33.39070759c-18.86327195-18.86327195-44.1375906-29.34286748-70.64480282-29.3428675-26.75379095 0-51.90482023 10.47959553-70.76809219 29.3428675L558.60337778 174.68031322c-18.86327195 18.86327195-29.34286748 44.1375906-29.34286749 70.64480283 0 26.75379095 10.47959553 51.90482023 29.34286749 70.76809218l103.31648301 103.31648302c-24.28800376 53.50758189-57.69942011 101.59043198-99.24793416 143.13894603-41.42522469 41.67180341-89.63136414 75.08321976-143.13894603 99.61780223L316.21649759 558.84995649c-18.86327195-18.86327195-44.1375906-29.34286748-70.64480283-29.34286747-26.75379095 0-51.90482023 10.47959553-70.76809217 29.34286747L33.39070759 700.01627278c-18.86327195 18.86327195-29.34286748 44.1375906-29.3428675 70.76809217 0 26.75379095 10.47959553 51.90482023 29.3428675 70.76809219l131.05658883 131.05658883c30.08260365 30.205893 71.63111769 47.34311394 114.28923598 47.34311394 9.00012323 0 17.63037836-0.73973616 26.13734414-2.21920846 166.19405621-27.37023774 331.03192945-115.76870829 464.06114804-248.67463751C901.84095379 636.27567408 990.11613498 471.56109018 1017.85624079 304.87387654c8.38367642-50.91850535-8.50696579-103.31648302-45.24719482-140.30329077z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M910.60451556 640.96028445c-20.38897778-65.49959112-43.83630221-120.54983112-79.89930667-210.64362666C836.31217778 193.67708444 737.93535999 2.27555556 511.36284444 2.27555556 282.24170667 2.27555556 186.03121778 197.50001778 192.14791111 430.31665779c-36.19043555 90.22122667-59.51032888 144.88917333-79.89930667 210.64362666-43.32657778 139.53706668-29.30915556 197.26336001-18.60494222 198.53767111 22.9376 2.80348444 89.32920888-105.00323556 89.32920889-105.00323556 0 62.44124445 32.11264001 143.86972444 101.69002667 202.61546667-33.64181333 10.32192-109.20846222 38.10190221-91.24067556 68.55793777 14.52714667 24.59420444 250.01984 15.67402668 317.94062222 8.02816 67.92078222 7.64586667 303.41347556 16.56604444 317.94062223-8.02816 17.96778667-30.32860444-57.72629333-58.23601779-91.24067555-68.55793777 69.57738667-58.87317334 101.69002667-140.30165333 101.69002667-202.61546667 0 0 66.39160889 107.80672 89.32920888 105.00323556 10.83164445-1.40174222 24.84906667-59.12803556-18.47751111-198.53767111z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M1016.86992592 199.24764445c-37.13706667 16.01991111-77.55093333 27.54939259-119.17842962 32.03982222 42.96248889-25.60758518 75.60912592-66.02145185 91.02222222-114.08118519-39.68568889 23.66577778-84.58998518 41.02068148-131.31472593 50.00154074C819.53374815 126.79395555 765.76995555 101.79318518 706.18074075 101.79318518c-114.688 0-206.92385185 92.96402963-206.92385186 207.04521482 0 16.01991111 1.94180741 32.03982222 5.09724444 47.45291852-171.72859259-8.98085925-324.88865185-91.02222222-426.71217778-216.63288889-17.96171852 30.82619259-28.15620741 66.02145185-28.1562074 104.49351112 0 71.84687408 36.53025185 135.19834075 92.23585185 172.45677036-33.98162963-1.33499259-66.02145185-10.92266667-93.57084445-26.33576296v2.54862222c0 100.6098963 71.1186963 183.98625185 165.90317037 203.1616-17.3549037 4.49042963-35.92343703 7.03905185-54.49197037 7.03905185-13.47128889 0-26.2144-1.33499259-39.07887407-3.15543704C146.69748148 681.90814815 223.03478518 741.49736297 313.93564445 743.43917037c-71.1186963 55.7056-160.19911111 88.4736-256.9253926 88.4736-17.3549037 0-33.37481482-0.60681482-50.00154074-2.54862222C98.75911111 888.22518518 207.62168889 922.20681482 324.85831111 922.20681482 705.45256297 922.20681482 913.71140741 606.90583703 913.71140741 333.23235555c0-8.98085925 0-17.96171852-0.60681482-26.94257777 40.2925037-29.4912 75.60912592-66.02145185 103.76533333-107.04213333z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M917.96720197 1.08889505H106.03279803C53.56084718 1.08889505 9.37393998 45.27580225 9.37393998 97.74775309v5.52336372c0 19.33177108 8.28504494 41.42522469 22.0934536 55.23363205l331.40179753 392.15879462v325.87843379c0 16.57008987 8.28504494 30.37849854 22.09345359 35.90186098l209.88780469 104.94390299 2.76168121 2.76168121c27.61681602 11.04672615 55.23363335-8.28504494 55.23363335-38.66354218V550.66354348l331.40179753-392.15879462c35.90186097-41.42522469 30.37849854-102.18222047-11.04672616-135.32240022-11.04672615-13.80840865-33.14017975-22.0934536-55.23363335-22.09345359z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M491.70164031 97.48884502a25.89076502 25.89076502 0 0 1 40.59671938 0L745.66415762 367.01171317a25.89076502 25.89076502 0 0 0 30.49932208 7.72839349l208.00640948-89.14190458a25.89076502 25.89076502 0 0 1 35.56096592 29.06238339l-115.18801541 554.96855704A103.56306132 103.56306132 0 0 1 803.14165689 952.14301275H220.85834311a103.56306132 103.56306132 0 0 1-101.4011828-82.51387024l-115.18801541-554.96855704a25.89076502 25.89076502 0 0 1 35.54802012-29.06238339l208.01935528 89.14190458a25.89076502 25.89076502 0 0 0 30.49932208-7.72839349l213.36579793-269.52286815z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M643.02466884 387.7801525c19.85376751-88.69205333 33.718272-152.84087467 41.61900049-192.57389433C704.52292267 95.17283515 652.90057916 2.27555515 550.58614084 2.27555515c-92.26012484 0-138.59407685 45.84971417-165.91530666 137.49816969l-0.70087152 2.67605334c-16.40038399 74.13942085-41.47882668 131.61085116-74.6746315 172.73287031a189.06953915 189.06953915 0 0 1-143.04142182 70.44391902l-26.17434983 0.5606965C77.66380049 387.52529067 27.76177817 438.90551468 27.76177817 501.84374084V881.55022182c0 77.4144 62.25009818 140.17422182 139.05282766 140.17422303h492.82707951c101.23127467 0 191.59267516-63.995904 225.93535999-159.98976l102.37815468-286.22301868c26.04691951-72.82688-11.39234134-153.15945284-83.63303784-179.42300483a138.04612267 138.04612267 0 0 0-47.17499733-8.30850884H643.02466884z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M512 512c140.82958222 0 254.86222222-114.03264 254.86222222-254.86222222S652.82958222 2.27555555 512 2.27555555a254.78940445 254.78940445 0 0 0-254.86222222 254.86222223C257.13777778 397.96736 371.17041778 512 512 512z m0 72.81777778c-170.10232889 0-509.72444445 97.57582222-509.72444445 291.27111111v145.63555556h1019.4488889v-145.63555556c0-193.69528889-339.62211555-291.27111111-509.72444445-291.27111111z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M1019.81297778 564.50161779l-138.89991111-472.51456c-8.66531556-25.99594668-29.43658667-43.45400889-57.21656889-43.45400891s-50.33528889 15.67402668-59.00060446 41.66997334l-92.00526221 274.48661334H351.69166222L259.6864 90.33045333c-8.66531556-25.99594668-31.22062222-41.66997333-59.00060444-41.66997332s-50.33528889 17.33063112-57.2165689 43.45400887L4.69674667 564.50161779c-5.22467555 17.33063112 1.78403556 36.44529778 15.67402667 46.89464887l491.11950221 368.27591113 492.77610666-368.27591113c13.76256-10.32192 20.77127111-29.43658667 15.54659557-46.89464887z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M927.78951111 340.39277037c-12.01493333-47.81700741 12.01493333-124.03294815 89.08041481-150.97552592l-82.40545184-4.36906667s-31.19028148-109.22666667-174.27721483-118.9357037c-143.08693333-9.8304-236.65777778-3.64088889-236.65777777-3.6408889s106.07122963 67.47780741 63.5941926 187.74850371c-31.06891852 63.71555555-79.85682963 116.02299259-132.04290371 175.61220741-1.57771852 1.57771852-3.03407408 3.15543703-4.2477037 4.49042962C278.25493333 624.86755555 7.13007408 934.34311111 7.13007408 934.34311111c298.43152592 78.15774815 498.43768889-7.64586667 616.76657777-110.56165926 24.87940741-0.24272592 43.5693037-0.36408889 56.19105185-0.36408888 164.8109037 0 304.13558518-142.72284445 298.43152593-301.4656-3.88361482-109.1053037-38.71478518-133.74198518-50.72971852-181.5589926z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M997.8886764 504.17210418L537.2729208 43.89182982c-13.97838539-13.97838539-36.56745619-13.97838539-50.5458416 0L26.1113236 504.17210418c-13.41924998 13.41924998-21.02349164 31.64706454-21.02349163 50.65766867 0 39.47496036 32.09437288 71.56933323 71.56933324 71.56933323h48.53295408V954.83524937c0 19.79339373 15.99127289 35.78466661 35.78466663 35.78466662H440.43066677V740.12724968h125.24633315v250.49266631h297.34821416c19.79339373 0 35.78466661-15.99127289 35.78466663-35.78466662V626.39910608h48.53295408c19.01060414 0 37.23841869-7.49241457 50.65766869-21.02349163 27.84494371-27.95677079 27.84494371-73.24673948-0.11182708-101.20351027z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M1009.13013121 349.27572283L674.72427717 14.86986879c-8.82158299-8.82158299-20.35749924-13.16451618-31.89341544-13.16451618s-23.07183245 4.34293316-31.89341547 13.16451618L392.29790453 233.6451272c-16.5574327-1.90003326-33.25058207-2.71433322-49.94373146-2.71433324-99.34459624 0-198.68919249 32.70771543-280.25490606 98.12314628-20.90036589 16.69314938-22.52896582 48.04369819-3.66434987 67.04403081l246.59717401 246.59717401-292.33368895 292.06225564c-3.52863319 3.52863319-5.83581644 8.27871636-6.24296642 13.30023282l-4.61436649 50.48659809c-1.22144996 12.75736619 8.95729967 23.6146991 21.57894918 23.6146991 0.6785833 0 1.35716662 0 2.03574992-0.13571666l50.48659809-4.61436649c5.02151649-0.40714999 9.77159962-2.71433322 13.30023282-6.24296643l292.33368896-292.33368896 246.59717402 246.59717401c8.82158299 8.82158299 20.35749924 13.16451618 31.89341544 13.16451618 13.16451618 0 26.19331567-5.70009979 35.15061536-16.82886604 76.40848044-95.40881307 108.16617924-214.83947521 95.27309638-330.33435417l218.63954175-218.63954173c17.50744934-17.37173267 17.50744934-45.8722316 0-63.51539759z',\n special: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M976.62005979 160.47737905c-0.39452595-0.39452595-80.35178503 78.64217259-239.47725131 237.50462156l-111.6508437-111.65084369 237.89914752-237.89914752c-125.19623464-75.35445635-286.03131335-56.02268482-390.31767264 48.26367449-81.92988882 81.92988882-112.57140424 200.15616502-83.37648398 310.09739626l2.36715569 8.81107954-372.82702222 372.69551356c-8.15353628 8.15353628-8.15353628 21.56741857 0 29.72095487l185.95323084 185.95323084c8.15353628 8.15353628 21.56741857 8.15353628 29.72095485 0l372.56400493-372.56400493 8.81107953 2.3671557c110.07273989 29.32642892 228.29901608-1.18357785 310.36041356-83.24497533 104.41786795-104.2863593 123.74963948-265.12143802 49.97328693-390.05465535z',\n special: true,\n },\n ],\n },\n\n {\n type: '线性',\n children: [\n {\n viewBox: [1024, 1024],\n path: 'M953.5488 832.61667556c-24.08448-57.08913778-58.74574221-108.31644445-102.70947556-152.28017777-43.96373333-43.96373333-95.19104-78.49756444-152.28017777-102.70947558-0.50972445-0.25486222-1.01944888-0.38229333-1.52917334-0.63715555C776.41955556 519.64586667 828.02915556 426.23886221 828.02915556 320.85333332c0-174.58062221-141.44853334-316.02915556-316.02915556-316.02915554S195.97084444 146.27271111 195.97084444 320.85333332c0 105.38552889 51.6096 198.79253333 130.99918223 256.26396447-0.50972445 0.25486222-1.01944888 0.38229333-1.52917334 0.63715555-57.08913778 24.08448-108.31644445 58.61831112-152.28017777 102.70947554-43.96373333 43.96373333-78.49756444 95.19104-102.70947556 152.28017779C46.74901333 888.55893332 34.13333334 947.8144 32.85902222 1008.72647111c-0.12743111 5.7344 4.46008889 10.44935111 10.19448889 10.44935111h76.45866667c5.60696888 0 10.06705778-4.46008889 10.19448889-9.93962666 2.54862221-98.37681778 42.05226667-190.50951112 111.88451555-260.34176001 72.25344-72.25344 168.20906666-112.01194667 270.40881778-112.01194667s198.15537778 39.75850667 270.40881778 112.01194667C852.24106667 818.72668444 891.74471111 910.85937779 894.29333333 1009.23619556c0.12743111 5.60696888 4.58752 9.93962667 10.19448889 9.93962666h76.45866667c5.7344 0 10.32192-4.71495112 10.19448889-10.44935111-1.27431111-60.91207112-13.88999112-120.16753779-37.59217778-176.10979555zM512 540.03484444c-58.49088 0-113.54112-22.81016889-154.95623111-64.22527999S292.81848888 379.34421333 292.81848888 320.85333332c0-58.49088 22.81016889-113.54112 64.22528001-154.9562311S453.50912 101.67182221 512 101.67182221s113.54112 22.81016889 154.95623111 64.22528001S731.18151112 262.36245333 731.18151112 320.85333332c0 58.49088-22.81016889 113.54112-64.22528001 154.95623113S570.49088 540.03484444 512 540.03484444z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M985.31555555 111.50222222H38.68444445c-20.13866667 0-36.40888889 16.27022222-36.4088889 36.40888889v728.17777778c0 20.13866667 16.27022222 36.40888889 36.4088889 36.40888889h946.6311111c20.13866667 0 36.40888889-16.27022222 36.4088889-36.40888889V147.91111111c0-20.13866667-16.27022222-36.40888889-36.4088889-36.40888889z m-45.5111111 126.06577778V830.57777778H84.19555555V237.568l-31.40266666-24.46222222 44.71466666-57.45777778 48.6968889 37.888h731.70488888l48.69688889-37.888 44.71466667 57.45777778-31.51644444 24.46222222z M877.90933333 193.42222222L512 477.86666667 146.09066667 193.42222222l-48.69688889-37.888-44.71466667 57.45777778 31.40266667 24.46222222 388.66488889 302.19377778c22.98311111 17.86311111 55.18222222 17.86311111 78.16533333 0L939.80444445 237.568l31.40266666-24.46222222-44.71466666-57.45777778-48.58311112 37.77422222z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M985.31555555 88.74666667H38.68444445c-20.13866667 0-36.40888889 16.27022222-36.4088889 36.40888888v564.33777778c0 20.13866667 16.27022222 36.40888889 36.4088889 36.40888889h432.35555555v127.43111111H275.34222222c-10.01244445 0-18.20444445 8.192-18.20444444 18.20444445v54.61333333c0 5.00622222 4.096 9.10222222 9.10222222 9.10222222h491.52c5.00622222 0 9.10222222-4.096 9.10222222-9.10222222v-54.61333333c0-10.01244445-8.192-18.20444445-18.20444444-18.20444445H552.96V725.90222222h432.35555555c20.13866667 0 36.40888889-16.27022222 36.4088889-36.40888889V125.15555555c0-20.13866667-16.27022222-36.40888889-36.4088889-36.40888888z m-45.5111111 555.23555555H84.19555555V170.66666667h855.6088889v473.31555555z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M512 2.27555555C230.51377778 2.27555555 2.27555555 230.51377778 2.27555555 512s228.23822222 509.72444445 509.72444445 509.72444445 509.72444445-228.23822222 509.72444445-509.72444445S793.48622222 2.27555555 512 2.27555555z m0 932.97777778c-233.69955555 0-423.25333333-189.55377778-423.25333333-423.25333333 0-101.26222222 35.61244445-194.33244445 95.00444444-267.15022222l595.39911111 595.39911111C706.33244445 899.64088889 613.26222222 935.25333333 512 935.25333333z m328.24888889-156.10311111L244.84977778 183.75111111C317.66755555 124.35911111 410.73777778 88.74666667 512 88.74666667c233.69955555 0 423.25333333 189.55377778 423.25333333 423.25333333 0 101.26222222-35.61244445 194.33244445-95.00444444 267.15022222z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M901.80266667 257.82044445L656.95288889 12.97066667c-6.82666667-6.82666667-16.04266667-10.69511111-25.71377778-10.69511112H147.91111111c-20.13866667 0-36.40888889 16.27022222-36.40888889 36.4088889v946.6311111c0 20.13866667 16.27022222 36.40888889 36.40888889 36.4088889h728.17777778c20.13866667 0 36.40888889-16.27022222 36.40888889-36.4088889V283.648c0-9.67111111-3.86844445-19.00088889-10.69511111-25.82755555zM828.52977778 300.37333333H614.4V86.24355555L828.52977778 300.37333333z m2.048 639.43111112H193.42222222V84.19555555h343.60888889v245.76c0 26.39644445 21.39022222 47.78666667 47.78666667 47.78666667h245.76v562.06222223z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M981.07392 55.79662222H42.92608c-31.22062222 0-50.71758221 34.02410666-35.04355556 61.16693334L304.28728889 620.82616888V927.42542221c0 22.55530667 18.09521779 40.77795555 40.52309333 40.77795557h334.37923556c22.42787556 0 40.52309333-18.22264888 40.52309333-40.77795557V620.82616888L1016.24490667 116.96355556c15.54659555-27.14282666-3.95036444-61.16693333-35.17098667-61.16693334zM628.47203556 876.45297779H395.52796444V677.66044445h233.07150222v198.79253334z m12.23338666-301.50200891l-12.10595556 21.15356445h-233.19893332l-12.10595556-21.15356445L130.59868445 147.54702221h762.8026311L640.70542222 574.95096888z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M980.62285431 4.54099753H654.39920987c-4.2719763 0-7.76722963 3.49525333-7.76722962 7.76722964v72.4941432c0 4.2719763 3.49525333 7.76722963 7.76722962 7.76722963h207.64393877L604.04167111 350.57107753c-64.72691358-49.83972347-143.69374815-76.7661195-226.67365136-76.7661195-99.54999309 0-193.27456395 38.83614815-263.5679921 109.25903012S4.54099753 547.08198717 4.54099753 646.63198025s38.83614815 193.27456395 109.25903012 263.5679921C184.09345581 980.62285431 277.81802667 1019.45900247 377.36801975 1019.45900247s193.27456395-38.83614815 263.5679921-109.25903012C711.35889383 839.90654419 750.19504197 746.18197333 750.19504197 646.63198025c0-82.9799032-26.92639605-161.68783013-76.63666567-226.41474372L931.4304 162.34521283V369.60079013c0 4.2719763 3.49525333 7.76722963 7.76722963 7.76722962h72.4941432c4.2719763 0 7.76722963-3.49525333 7.76722964-7.76722962V43.37714569c0-21.35988148-17.47626667-38.83614815-38.83614816-38.83614816zM377.36801975 921.07409383c-151.33152395 0-274.44211358-123.11058963-274.44211358-274.44211358s123.11058963-274.44211358 274.44211358-274.44211358 274.44211358 123.11058963 274.44211358 274.44211358-123.11058963 274.44211358-274.44211358 274.44211358z',\n special: true,\n outlined: true,\n },\n {\n viewBox: [1024, 1024],\n path: 'M591.98717801 512l405.34042913-483.16579151c6.79427767-8.02960089 1.08090782-20.22841761-9.41933951-20.2284176h-123.22349044c-7.25752386 0-14.20621693 3.24272343-18.99309439 8.80167789L511.38233839 415.95362022 177.07299399 17.40746878c-4.63246205-5.55895447-11.58115512-8.80167789-18.99309439-8.80167789H34.85640916c-10.50024731 0-16.21361717 12.19881672-9.41933952 20.2284176L430.77749876 512 25.43706964 995.16579151c-6.79427767 8.02960089-1.08090782 20.22841761 9.41933952 20.2284176h123.22349044c7.25752386 0 14.20621693-3.24272343 18.99309439-8.80167789l334.3093444-398.54615144 334.30934441 398.54615144c4.63246205 5.55895447 11.58115512 8.80167789 18.99309439 8.80167789h123.22349044c10.50024731 0 16.21361717-12.19881672 9.41933951-20.2284176L591.98717801 512z',\n special: true,\n outlined: true,\n },\n ],\n }\n]","import { ChartType } from '@/types/slides'\n\ninterface ChartTypes {\n [propName: string]: ChartType\n}\n\nexport const CHART_TYPES: ChartTypes = {\n bar: 'bar',\n horizontalBar: 'bar',\n line: 'line',\n area: 'line',\n scatter: 'line',\n pie: 'pie',\n ring: 'pie',\n}","import { debounce, throttle} from 'lodash'\nimport { useSnapshotStore } from '@/store'\n\nexport default () => {\n const snapshotStore = useSnapshotStore()\n\n // 添加历史快照(历史记录)\n const addHistorySnapshot = debounce(function() {\n snapshotStore.addSnapshot()\n }, 300, { trailing: true })\n\n // 重做\n const redo = throttle(function() {\n snapshotStore.reDo()\n }, 100, { leading: true, trailing: false })\n\n // 撤销\n const undo = throttle(function() {\n snapshotStore.unDo()\n }, 100, { leading: true, trailing: false })\n\n return {\n addHistorySnapshot,\n redo,\n undo,\n }\n}","import { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { getImageSize } from '@/utils/image'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport { PPTLineElement, PPTElement, TableCell, TableCellStyle, PPTShapeElement, PPTChartElement, ChartOptions, PresetChartType } from '@/types/slides'\nimport { ShapePoolItem, SHAPE_PATH_FORMULAS } from '@/configs/shapes'\nimport { LinePoolItem } from '@/configs/lines'\nimport { CHART_TYPES } from '@/configs/chartTypes'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface CommonElementPosition {\n top: number\n left: number\n width: number\n height: number\n}\n\ninterface LineElementPosition {\n top: number\n left: number\n start: [number, number]\n end: [number, number]\n}\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { creatingElement } = storeToRefs(mainStore)\n const { theme, viewportRatio } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 创建(插入)一个元素并将其设置为被选中元素\n const createElement = (element: PPTElement, callback?: () => void) => {\n slidesStore.addElement(element)\n mainStore.setActiveElementIdList([element.id])\n\n if (creatingElement.value) mainStore.setCreatingElement(null)\n\n setTimeout(() => {\n mainStore.setEditorareaFocus(true)\n }, 0)\n\n if (callback) callback()\n\n addHistorySnapshot()\n }\n\n /**\n * 创建图片元素\n * @param src 图片地址\n */\n const createImageElement = (src: string) => {\n getImageSize(src).then(({ width, height }) => {\n const scale = height / width\n \n if (scale < viewportRatio.value && width > VIEWPORT_SIZE) {\n width = VIEWPORT_SIZE\n height = width * scale\n }\n else if (height > VIEWPORT_SIZE * viewportRatio.value) {\n height = VIEWPORT_SIZE * viewportRatio.value\n width = height / scale\n }\n\n createElement({\n type: 'image',\n id: nanoid(10),\n src,\n width,\n height,\n left: (VIEWPORT_SIZE - width) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - height) / 2,\n fixedRatio: true,\n rotate: 0,\n })\n })\n }\n \n /**\n * 创建图表元素\n * @param chartType 图表类型\n */\n const createChartElement = (type: PresetChartType) => {\n const newElement: PPTChartElement = {\n type: 'chart',\n id: nanoid(10),\n chartType: CHART_TYPES[type],\n left: 300,\n top: 81.25,\n width: 400,\n height: 400,\n rotate: 0,\n themeColor: [theme.value.themeColor],\n gridColor: theme.value.fontColor,\n data: {\n labels: ['类别1', '类别2', '类别3', '类别4', '类别5'],\n legends: ['系列1'],\n series: [\n [12, 19, 5, 2, 18],\n ],\n },\n }\n\n let options: ChartOptions = {}\n if (type === 'horizontalBar') options = { horizontalBars: true }\n else if (type === 'area') options = { showArea: true }\n else if (type === 'scatter') options = { showLine: false }\n else if (type === 'ring') options = { donut: true }\n\n createElement({\n ...newElement,\n options,\n })\n }\n \n /**\n * 创建表格元素\n * @param row 行数\n * @param col 列数\n */\n const createTableElement = (row: number, col: number) => {\n const style: TableCellStyle = {\n fontname: theme.value.fontName,\n color: theme.value.fontColor,\n }\n const data: TableCell[][] = []\n for (let i = 0; i < row; i++) {\n const rowCells: TableCell[] = []\n for (let j = 0; j < col; j++) {\n rowCells.push({ id: nanoid(10), colspan: 1, rowspan: 1, text: '', style })\n }\n data.push(rowCells)\n }\n\n const DEFAULT_CELL_WIDTH = 100\n const DEFAULT_CELL_HEIGHT = 36\n\n const colWidths: number[] = new Array(col).fill(1 / col)\n\n const width = col * DEFAULT_CELL_WIDTH\n const height = row * DEFAULT_CELL_HEIGHT\n\n createElement({\n type: 'table',\n id: nanoid(10),\n width,\n height,\n colWidths,\n rotate: 0,\n data,\n left: (VIEWPORT_SIZE - width) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - height) / 2,\n outline: {\n width: 2,\n style: 'solid',\n color: '#eeece1',\n },\n theme: {\n color: theme.value.themeColor,\n rowHeader: true,\n rowFooter: false,\n colHeader: false,\n colFooter: false,\n },\n })\n }\n \n /**\n * 创建文本元素\n * @param position 位置大小信息\n * @param content 文本内容\n */\n const createTextElement = (position: CommonElementPosition, content = '') => {\n const { left, top, width, height } = position\n const id = nanoid(10)\n createElement({\n type: 'text',\n id,\n left, \n top, \n width, \n height,\n content,\n rotate: 0,\n defaultFontName: theme.value.fontName,\n defaultColor: theme.value.fontColor,\n }, () => {\n setTimeout(() => {\n const editorRef: HTMLElement | null = document.querySelector(`#editable-element-${id} .ProseMirror`)\n if (editorRef) editorRef.focus()\n }, 0)\n })\n }\n \n /**\n * 创建形状元素\n * @param position 位置大小信息\n * @param data 形状路径信息\n */\n const createShapeElement = (position: CommonElementPosition, data: ShapePoolItem) => {\n const { left, top, width, height } = position\n const newElement: PPTShapeElement = {\n type: 'shape',\n id: nanoid(10),\n left, \n top, \n width, \n height,\n viewBox: data.viewBox,\n path: data.path,\n fill: theme.value.themeColor,\n fixedRatio: false,\n rotate: 0,\n }\n if (data.special) newElement.special = true\n if (data.pathFormula) {\n newElement.pathFormula = data.pathFormula\n newElement.viewBox = [width, height]\n\n const pathFormula = SHAPE_PATH_FORMULAS[data.pathFormula]\n if ('editable' in pathFormula) {\n newElement.path = pathFormula.formula(width, height, pathFormula.defaultValue)\n newElement.keypoint = pathFormula.defaultValue\n }\n else newElement.path = pathFormula.formula(width, height)\n }\n createElement(newElement)\n }\n \n /**\n * 创建线条元素\n * @param position 位置大小信息\n * @param data 线条的路径和样式\n */\n const createLineElement = (position: LineElementPosition, data: LinePoolItem) => {\n const { left, top, start, end } = position\n\n const newElement: PPTLineElement = {\n type: 'line',\n id: nanoid(10),\n left, \n top, \n start,\n end,\n points: data.points,\n color: theme.value.themeColor,\n style: data.style,\n width: 2,\n }\n if (data.isBroken) newElement.broken = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]\n if (data.isCurve) newElement.curve = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]\n if (data.isCubic) newElement.cubic = [[(start[0] + end[0]) / 2, (start[1] + end[1]) / 2], [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]]\n createElement(newElement)\n }\n \n /**\n * 创建LaTeX元素\n * @param svg SVG代码\n */\n const createLatexElement = (data: { path: string; latex: string; w: number; h: number; }) => {\n createElement({\n type: 'latex',\n id: nanoid(10),\n width: data.w,\n height: data.h,\n rotate: 0,\n left: (VIEWPORT_SIZE - data.w) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - data.h) / 2,\n path: data.path,\n latex: data.latex,\n color: theme.value.fontColor,\n strokeWidth: 2,\n viewBox: [data.w, data.h],\n fixedRatio: true,\n })\n }\n \n /**\n * 创建视频元素\n * @param src 视频地址\n */\n const createVideoElement = (src: string) => {\n createElement({\n type: 'video',\n id: nanoid(10),\n width: 500,\n height: 300,\n rotate: 0,\n left: (VIEWPORT_SIZE - 500) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - 300) / 2,\n src,\n })\n }\n \n /**\n * 创建音频元素\n * @param src 音频地址\n */\n const createAudioElement = (src: string) => {\n createElement({\n type: 'audio',\n id: nanoid(10),\n width: 50,\n height: 50,\n rotate: 0,\n left: (VIEWPORT_SIZE - 50) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - 50) / 2,\n loop: false,\n autoplay: false,\n fixedRatio: true,\n color: theme.value.themeColor,\n src,\n })\n }\n\n return {\n createImageElement,\n createChartElement,\n createTableElement,\n createTextElement,\n createShapeElement,\n createLineElement,\n createLatexElement,\n createVideoElement,\n createAudioElement,\n }\n}","import { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useSlidesStore, useMainStore } from '@/store'\nimport { PPTElement, Slide } from '@/types/slides'\nimport { createElementIdMap } from '@/utils/element'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { currentSlide } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n /**\n * 添加指定的元素数据(一组)\n * @param elements 元素列表数据\n */\n const addElementsFromData = (elements: PPTElement[]) => {\n const { groupIdMap, elIdMap } = createElementIdMap(elements)\n const currentSlideElementIdList = currentSlide.value.elements.map(el => el.id)\n \n for (const element of elements) {\n const inCurrentSlide = currentSlideElementIdList.includes(element.id)\n \n element.id = elIdMap[element.id]\n\n if (inCurrentSlide) {\n element.left = element.left + 10\n element.top = element.top + 10\n }\n\n if (element.groupId) element.groupId = groupIdMap[element.groupId]\n }\n slidesStore.addElement(elements)\n mainStore.setActiveElementIdList(Object.values(elIdMap))\n addHistorySnapshot()\n }\n\n /**\n * 添加指定的页面数据\n * @param slide 页面数据\n */\n const addSlidesFromData = (slides: Slide[]) => {\n const newSlides = slides.map(slide => {\n const { groupIdMap, elIdMap } = createElementIdMap(slide.elements)\n\n for (const element of slide.elements) {\n element.id = elIdMap[element.id]\n if (element.groupId) element.groupId = groupIdMap[element.groupId]\n }\n // 动画id替换\n if (slide.animations) {\n for (const animation of slide.animations) {\n animation.id = nanoid(10)\n animation.elId = elIdMap[animation.elId]\n }\n }\n return {\n ...slide,\n id: nanoid(10),\n }\n })\n slidesStore.addSlide(newSlides)\n addHistorySnapshot()\n }\n\n return {\n addElementsFromData,\n addSlidesFromData,\n }\n}","import { pasteCustomClipboardString } from '@/utils/clipboard'\nimport { parseText2Paragraphs } from '@/utils/textParser'\nimport useCreateElement from '@/hooks/useCreateElement'\nimport useAddSlidesOrElements from '@/hooks/useAddSlidesOrElements'\n\ninterface PasteTextClipboardDataOptions {\n onlySlide?: boolean\n onlyElements?: boolean\n}\n\nexport default () => {\n const { createTextElement } = useCreateElement()\n const { addElementsFromData, addSlidesFromData } = useAddSlidesOrElements()\n\n /**\n * 粘贴普通文本:创建为新的文本元素\n * @param text 文本\n */\n const createTextElementFromClipboard = (text: string) => {\n createTextElement({\n left: 0,\n top: 0,\n width: 600,\n height: 50,\n }, text)\n }\n\n /**\n * 解析剪贴板内容,根据解析结果选择合适的粘贴方式\n * @param text 剪贴板内容\n * @param options 配置项:onlySlide -- 仅处理页面粘贴;onlyElements -- 仅处理元素粘贴;\n */\n const pasteTextClipboardData = (text: string, options?: PasteTextClipboardDataOptions) => {\n const onlySlide = options?.onlySlide || false\n const onlyElements = options?.onlyElements || false\n\n const clipboardData = pasteCustomClipboardString(text)\n\n // 元素或页面\n if (typeof clipboardData === 'object') {\n const { type, data } = clipboardData\n\n if (type === 'elements' && !onlySlide) addElementsFromData(data)\n else if (type === 'slides' && !onlyElements) addSlidesFromData(data)\n }\n\n // 普通文本\n else if (!onlyElements && !onlySlide) {\n const string = parseText2Paragraphs(clipboardData)\n createTextElementFromClipboard(string)\n }\n }\n\n return {\n pasteTextClipboardData,\n }\n}","import { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { Slide } from '@/types/slides'\nimport { copyText, readClipboard } from '@/utils/clipboard'\nimport { encrypt } from '@/utils/crypto'\nimport { createElementIdMap } from '@/utils/element'\nimport { KEYS } from '@/configs/hotkey'\nimport { message } from 'ant-design-vue'\nimport usePasteTextClipboardData from '@/hooks/usePasteTextClipboardData'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport useAddSlidesOrElements from '@/hooks//useAddSlidesOrElements'\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { selectedSlidesIndex: _selectedSlidesIndex, activeElementIdList } = storeToRefs(mainStore)\n const { currentSlide, slides, theme, slideIndex } = storeToRefs(slidesStore)\n\n const selectedSlidesIndex = computed(() => [..._selectedSlidesIndex.value, slideIndex.value])\n const selectedSlides = computed(() => slides.value.filter((item, index) => selectedSlidesIndex.value.includes(index)))\n const selectedSlidesId = computed(() => selectedSlides.value.map(item => item.id))\n\n const { pasteTextClipboardData } = usePasteTextClipboardData()\n const { addSlidesFromData } = useAddSlidesOrElements()\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 重置幻灯片\n const resetSlides = () => {\n const emptySlide: Slide = {\n id: nanoid(10),\n elements: [],\n background: {\n type: 'solid',\n color: theme.value.backgroundColor,\n },\n }\n slidesStore.updateSlideIndex(0)\n mainStore.setActiveElementIdList([])\n slidesStore.setSlides([emptySlide])\n }\n\n /**\n * 移动页面焦点\n * @param command 移动页面焦点命令:上移、下移\n */\n const updateSlideIndex = (command: string) => {\n if (command === KEYS.UP && slideIndex.value > 0) {\n if (activeElementIdList.value.length) mainStore.setActiveElementIdList([])\n slidesStore.updateSlideIndex(slideIndex.value - 1)\n }\n else if (command === KEYS.DOWN && slideIndex.value < slides.value.length - 1) {\n if (activeElementIdList.value.length) mainStore.setActiveElementIdList([])\n slidesStore.updateSlideIndex(slideIndex.value + 1)\n }\n }\n\n // 将当前页面数据加密后复制到剪贴板\n const copySlide = () => {\n const text = encrypt(JSON.stringify({\n type: 'slides',\n data: selectedSlides.value,\n }))\n\n copyText(text).then(() => {\n mainStore.setThumbnailsFocus(true)\n })\n }\n\n // 尝试将剪贴板页面数据解密后添加到下一页(粘贴)\n const pasteSlide = () => {\n readClipboard().then(text => {\n pasteTextClipboardData(text, { onlySlide: true })\n }).catch(err => message.warning(err))\n }\n\n // 创建一页空白页并添加到下一页\n const createSlide = () => {\n const emptySlide: Slide = {\n id: nanoid(10),\n elements: [],\n background: {\n type: 'solid',\n color: theme.value.backgroundColor,\n },\n }\n mainStore.setActiveElementIdList([])\n slidesStore.addSlide(emptySlide)\n addHistorySnapshot()\n }\n\n // 根据模板创建新页面\n const createSlideByTemplate = (slide: Slide) => {\n const { groupIdMap, elIdMap } = createElementIdMap(slide.elements)\n\n for (const element of slide.elements) {\n element.id = elIdMap[element.id]\n if (element.groupId) element.groupId = groupIdMap[element.groupId]\n }\n const newSlide = {\n ...slide,\n id: nanoid(10),\n }\n mainStore.setActiveElementIdList([])\n slidesStore.addSlide(newSlide)\n addHistorySnapshot()\n }\n\n // 将当前页复制一份到下一页\n const copyAndPasteSlide = () => {\n const slide = JSON.parse(JSON.stringify(currentSlide.value))\n addSlidesFromData([slide])\n }\n\n // 删除当前页,若将删除全部页面,则执行重置幻灯片操作\n const deleteSlide = (targetSlidesId = selectedSlidesId.value) => {\n if (slides.value.length === targetSlidesId.length) resetSlides()\n else slidesStore.deleteSlide(targetSlidesId)\n\n mainStore.updateSelectedSlidesIndex([])\n\n addHistorySnapshot()\n }\n\n // 将当前页复制后删除(剪切)\n // 由于复制操作会导致多选状态消失,所以需要提前将需要删除的页面ID进行缓存\n const cutSlide = () => {\n const targetSlidesId = [...selectedSlidesId.value]\n copySlide()\n deleteSlide(targetSlidesId)\n }\n\n // 选中全部幻灯片\n const selectAllSlide = () => {\n const newSelectedSlidesIndex = Array.from(Array(slides.value.length), (item, index) => index)\n mainStore.setActiveElementIdList([])\n mainStore.updateSelectedSlidesIndex(newSelectedSlidesIndex)\n }\n\n return {\n resetSlides,\n updateSlideIndex,\n copySlide,\n pasteSlide,\n createSlide,\n createSlideByTemplate,\n copyAndPasteSlide,\n deleteSlide,\n cutSlide,\n selectAllSlide,\n }\n}","import { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { activeElementIdList } = storeToRefs(mainStore)\n const { currentSlide } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 锁定选中的元素,并清空选中元素状态\n const lockElement = () => {\n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\n \n for (const element of newElementList) {\n if (activeElementIdList.value.includes(element.id)) element.lock = true\n }\n slidesStore.updateSlide({ elements: newElementList })\n mainStore.setActiveElementIdList([])\n addHistorySnapshot()\n }\n\n /**\n * 解除元素的锁定状态,并将其设置为当前选择元素\n * @param handleElement 需要解锁的元素\n */\n const unlockElement = (handleElement: PPTElement) => {\n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\n\n if (handleElement.groupId) {\n const groupElementIdList = []\n for (const element of newElementList) {\n if (element.groupId === handleElement.groupId) {\n element.lock = false\n groupElementIdList.push(element.id)\n }\n }\n slidesStore.updateSlide({ elements: newElementList })\n mainStore.setActiveElementIdList(groupElementIdList)\n }\n else {\n for (const element of newElementList) {\n if (element.id === handleElement.id) {\n element.lock = false\n break\n }\n }\n slidesStore.updateSlide({ elements: newElementList })\n mainStore.setActiveElementIdList([handleElement.id])\n }\n addHistorySnapshot()\n }\n\n return {\n lockElement,\n unlockElement,\n }\n}","import { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { activeElementIdList, activeGroupElementId } = storeToRefs(mainStore)\n const { currentSlide } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 删除全部选中元素\n // 组合元素成员中,存在被选中可独立操作的元素时,优先删除该元素。否则默认删除所有被选中的元素\n const deleteElement = () => {\n if (!activeElementIdList.value.length) return\n\n let newElementList: PPTElement[] = []\n if (activeGroupElementId.value) {\n newElementList = currentSlide.value.elements.filter(el => el.id !== activeGroupElementId.value)\n }\n else {\n newElementList = currentSlide.value.elements.filter(el => !activeElementIdList.value.includes(el.id))\n }\n\n mainStore.setActiveElementIdList([])\n slidesStore.updateSlide({ elements: newElementList })\n addHistorySnapshot()\n }\n\n // 删除内面内全部元素(无论是否选中)\n const deleteAllElements = () => {\n if (!currentSlide.value.elements.length) return\n mainStore.setActiveElementIdList([])\n slidesStore.updateSlide({ elements: [] })\n addHistorySnapshot()\n }\n\n return {\n deleteElement,\n deleteAllElements,\n }\n}","import { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default () => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { activeElementIdList, activeElementList, handleElementId } = storeToRefs(mainStore)\n const { currentSlide } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n /**\n * 判断当前选中的元素是否可以组合\n */\n const canCombine = computed(() => {\n if (activeElementList.value.length < 2) return false\n\n const firstGroupId = activeElementList.value[0].groupId\n if (!firstGroupId) return true\n\n const inSameGroup = activeElementList.value.every(el => (el.groupId && el.groupId) === firstGroupId)\n return !inSameGroup\n })\n\n /**\n * 组合当前选中的元素:给当前选中的元素赋予一个相同的分组ID\n */\n const combineElements = () => {\n if (!activeElementList.value.length) return\n\n // 生成一个新元素列表进行后续操作\n let newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\n\n // 生成分组ID\n const groupId = nanoid(10)\n\n // 收集需要组合的元素列表,并赋上唯一分组ID\n const combineElementList: PPTElement[] = []\n for (const element of newElementList) {\n if (activeElementIdList.value.includes(element.id)) {\n element.groupId = groupId\n combineElementList.push(element)\n }\n }\n\n // 确保该组合内所有元素成员的层级是连续的,具体操作方法为:\n // 先获取到该组合内最上层元素的层级,将本次需要组合的元素从新元素列表中移除,\n // 再根据最上层元素的层级位置,将上面收集到的需要组合的元素列表一起插入到新元素列表中合适的位置\n const combineElementMaxLevel = newElementList.findIndex(_element => _element.id === combineElementList[combineElementList.length - 1].id)\n const combineElementIdList = combineElementList.map(_element => _element.id)\n newElementList = newElementList.filter(_element => !combineElementIdList.includes(_element.id))\n\n const insertLevel = combineElementMaxLevel - combineElementList.length + 1\n newElementList.splice(insertLevel, 0, ...combineElementList)\n\n slidesStore.updateSlide({ elements: newElementList })\n addHistorySnapshot()\n }\n\n /**\n * 取消组合元素:移除选中元素的分组ID\n */\n const uncombineElements = () => {\n if (!activeElementList.value.length) return\n const hasElementInGroup = activeElementList.value.some(item => item.groupId)\n if (!hasElementInGroup) return\n \n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\n for (const element of newElementList) {\n if (activeElementIdList.value.includes(element.id) && element.groupId) delete element.groupId\n }\n slidesStore.updateSlide({ elements: newElementList })\n\n // 取消组合后,需要重置激活元素状态\n // 默认重置为当前正在操作的元素,如果不存在则重置为空\n const handleElementIdList = handleElementId.value ? [handleElementId.value] : []\n mainStore.setActiveElementIdList(handleElementIdList)\n\n addHistorySnapshot()\n }\n\n return {\n canCombine,\n combineElements,\n uncombineElements,\n }\n}","import { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { copyText, readClipboard } from '@/utils/clipboard'\nimport { encrypt } from '@/utils/crypto'\nimport { message } from 'ant-design-vue'\nimport usePasteTextClipboardData from '@/hooks/usePasteTextClipboardData'\nimport useDeleteElement from './useDeleteElement'\n\nexport default () => {\n const mainStore = useMainStore()\n const { activeElementIdList, activeElementList } = storeToRefs(mainStore)\n\n const { pasteTextClipboardData } = usePasteTextClipboardData()\n const { deleteElement } = useDeleteElement()\n\n // 将选中元素数据加密后复制到剪贴板\n const copyElement = () => {\n if (!activeElementIdList.value.length) return\n\n const text = encrypt(JSON.stringify({\n type: 'elements',\n data: activeElementList.value,\n }))\n\n copyText(text).then(() => {\n mainStore.setEditorareaFocus(true)\n })\n }\n\n // 将选中元素复制后删除(剪切)\n const cutElement = () => {\n copyElement()\n deleteElement()\n }\n\n // 尝试将剪贴板元素数据解密后进行粘贴\n const pasteElement = () => {\n readClipboard().then(text => {\n pasteTextClipboardData(text)\n }).catch(err => message.warning(err))\n }\n\n // 将选中元素复制后立刻粘贴\n const quickCopyElement = () => {\n copyElement()\n pasteElement()\n }\n\n return {\n copyElement,\n cutElement,\n pasteElement,\n quickCopyElement,\n }\n}","import { storeToRefs } from 'pinia'\r\nimport { useMainStore, useSlidesStore } from '@/store'\r\n\r\nexport default () => {\r\n const mainStore = useMainStore()\r\n const { currentSlide } = storeToRefs(useSlidesStore())\r\n\r\n // 将当前页面全部元素设置为被选择状态\r\n const selectAllElement = () => {\r\n const unlockedElements = currentSlide.value.elements.filter(el => !el.lock)\r\n const newActiveElementIdList = unlockedElements.map(el => el.id)\r\n mainStore.setActiveElementIdList(newActiveElementIdList)\r\n }\r\n\r\n return {\r\n selectAllElement,\r\n }\r\n}","import { storeToRefs } from 'pinia'\r\nimport { useMainStore, useSlidesStore } from '@/store'\r\nimport { PPTElement } from '@/types/slides'\r\nimport { KEYS } from '@/configs/hotkey'\r\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\r\n\r\nexport default () => {\r\n const slidesStore = useSlidesStore()\r\n const { activeElementIdList, activeGroupElementId } = storeToRefs(useMainStore())\r\n const { currentSlide } = storeToRefs(slidesStore)\r\n\r\n const { addHistorySnapshot } = useHistorySnapshot()\r\n\r\n /**\r\n * 将元素向指定方向移动指定的距离\r\n * 组合元素成员中,存在被选中可独立操作的元素时,优先移动该元素。否则默认移动所有被选中的元素\r\n * @param command 移动方向\r\n * @param step 移动距离\r\n */\r\n const moveElement = (command: string, step = 1) => {\r\n let newElementList: PPTElement[] = []\r\n\r\n const move = (el: PPTElement) => {\r\n let { left, top } = el\r\n switch (command) {\r\n case KEYS.LEFT: \r\n left = left - step\r\n break\r\n case KEYS.RIGHT: \r\n left = left + step\r\n break\r\n case KEYS.UP: \r\n top = top - step\r\n break\r\n case KEYS.DOWN: \r\n top = top + step\r\n break\r\n default: break\r\n }\r\n return { ...el, left, top }\r\n }\r\n\r\n if (activeGroupElementId.value) {\r\n newElementList = currentSlide.value.elements.map(el => {\r\n return activeGroupElementId.value === el.id ? move(el) : el\r\n })\r\n }\r\n else {\r\n newElementList = currentSlide.value.elements.map(el => {\r\n return activeElementIdList.value.includes(el.id) ? move(el) : el\r\n })\r\n }\r\n\r\n slidesStore.updateSlide({ elements: newElementList })\r\n addHistorySnapshot()\r\n }\r\n\r\n return {\r\n moveElement,\r\n }\r\n}","import { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { ElementOrderCommands } from '@/types/edit'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default () => {\n const slidesStore = useSlidesStore()\n const { currentSlide } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n /**\n * 获取组合元素层级范围\n * @param elementList 本页所有元素列表\n * @param combineElementList 组合元素列表\n */\n const getCombineElementLevelRange = (elementList: PPTElement[], combineElementList: PPTElement[]) => {\n return {\n minLevel: elementList.findIndex(_element => _element.id === combineElementList[0].id),\n maxLevel: elementList.findIndex(_element => _element.id === combineElementList[combineElementList.length - 1].id),\n }\n }\n\n /**\n * 上移一层\n * @param elementList 本页所有元素列表\n * @param element 当前操作的元素\n */\n const moveUpElement = (elementList: PPTElement[], element: PPTElement) => {\n const copyOfElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList))\n\n // 如果被操作的元素是组合元素成员,需要将该组合全部成员一起进行移动\n if (element.groupId) {\n\n // 获取到该组合全部成员,以及所有成员的层级范围\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === element.groupId)\n const { minLevel, maxLevel } = getCombineElementLevelRange(elementList, combineElementList)\n\n // 已经处在顶层,无法继续移动\n if (maxLevel === elementList.length - 1) return\n\n // 通过组合成员范围的最大值,获取到该组合上一层的元素,然后将该组合元素从元素列表中移除(并缓存被移除的元素列表)\n // 若上层元素处在另一个组合中,则将上述被移除的组合元素插入到该上层组合上方\n // 若上层元素不处于任何分组中,则将上述被移除的组合元素插入到该上层元素上方\n const nextElement = copyOfElementList[maxLevel + 1]\n const movedElementList = copyOfElementList.splice(minLevel, combineElementList.length)\n\n if (nextElement.groupId) {\n const nextCombineElementList = copyOfElementList.filter(_element => _element.groupId === nextElement.groupId)\n copyOfElementList.splice(minLevel + nextCombineElementList.length, 0, ...movedElementList)\n }\n else copyOfElementList.splice(minLevel + 1, 0, ...movedElementList)\n }\n\n // 如果被操作的元素不是组合元素成员\n else {\n\n // 获取该元素在列表中的层级\n const level = elementList.findIndex(item => item.id === element.id)\n\n // 已经处在顶层,无法继续移动\n if (level === elementList.length - 1) return\n\n // 获取到该组合上一层的元素,然后将该组合元素从元素列表中移除(并缓存被移除的元素列表)\n const nextElement = copyOfElementList[level + 1]\n const movedElement = copyOfElementList.splice(level, 1)[0]\n\n // 通过组合成员范围的最大值,获取到该组合上一层的元素,然后将该组合元素从元素列表中移除(并缓存被移除的元素列表)\n // 若上层元素处在另一个组合中,则将上述被移除的组合元素插入到该上层组合上方\n // 若上层元素不处于任何分组中,则将上述被移除的组合元素插入到该上层元素上方\n if (nextElement.groupId) {\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === nextElement.groupId)\n copyOfElementList.splice(level + combineElementList.length, 0, movedElement)\n }\n else copyOfElementList.splice(level + 1, 0, movedElement)\n }\n\n return copyOfElementList\n }\n\n /**\n * 下移一层,操作方式同上移\n * @param elementList 本页所有元素列表\n * @param element 当前操作的元素\n */\n const moveDownElement = (elementList: PPTElement[], element: PPTElement) => {\n const copyOfElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList))\n\n if (element.groupId) {\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === element.groupId)\n const { minLevel } = getCombineElementLevelRange(elementList, combineElementList)\n if (minLevel === 0) return\n\n const prevElement = copyOfElementList[minLevel - 1]\n const movedElementList = copyOfElementList.splice(minLevel, combineElementList.length)\n\n if (prevElement.groupId) {\n const prevCombineElementList = copyOfElementList.filter(_element => _element.groupId === prevElement.groupId)\n copyOfElementList.splice(minLevel - prevCombineElementList.length, 0, ...movedElementList)\n }\n else copyOfElementList.splice(minLevel - 1, 0, ...movedElementList)\n }\n\n else {\n const level = elementList.findIndex(item => item.id === element.id)\n if (level === 0) return\n\n const prevElement = copyOfElementList[level - 1]\n const movedElement = copyOfElementList.splice(level, 1)[0]\n\n if (prevElement.groupId) {\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === prevElement.groupId)\n copyOfElementList.splice(level - combineElementList.length, 0, movedElement)\n }\n else copyOfElementList.splice(level - 1, 0, movedElement)\n }\n\n return copyOfElementList\n }\n\n /**\n * 置顶层\n * @param elementList 本页所有元素列表\n * @param element 当前操作的元素\n */\n const moveTopElement = (elementList: PPTElement[], element: PPTElement) => {\n const copyOfElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList))\n\n // 如果被操作的元素是组合元素成员,需要将该组合全部成员一起进行移动\n if (element.groupId) {\n\n // 获取到该组合全部成员,以及所有成员的层级范围\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === element.groupId)\n const { minLevel, maxLevel } = getCombineElementLevelRange(elementList, combineElementList)\n\n // 已经处在顶层,无法继续移动\n if (maxLevel === elementList.length - 1) return null\n\n // 将该组合元素从元素列表中移除,然后将被移除的元素添加到元素列表顶部\n const movedElementList = copyOfElementList.splice(minLevel, combineElementList.length)\n copyOfElementList.push(...movedElementList)\n }\n\n // 如果被操作的元素不是组合元素成员\n else {\n\n // 获取该元素在列表中的层级\n const level = elementList.findIndex(item => item.id === element.id)\n\n // 已经处在顶层,无法继续移动\n if (level === elementList.length - 1) return null\n\n // 将该组合元素从元素列表中移除,然后将被移除的元素添加到元素列表底部\n copyOfElementList.splice(level, 1)\n copyOfElementList.push(element)\n }\n\n return copyOfElementList\n }\n\n /**\n * 置底层,操作方式同置顶\n * @param elementList 本页所有元素列表\n * @param element 当前操作的元素\n */\n const moveBottomElement = (elementList: PPTElement[], element: PPTElement) => {\n const copyOfElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList))\n\n if (element.groupId) {\n const combineElementList = copyOfElementList.filter(_element => _element.groupId === element.groupId)\n const { minLevel } = getCombineElementLevelRange(elementList, combineElementList)\n if (minLevel === 0) return\n\n const movedElementList = copyOfElementList.splice(minLevel, combineElementList.length)\n copyOfElementList.unshift(...movedElementList)\n }\n\n else {\n const level = elementList.findIndex(item => item.id === element.id)\n if (level === 0) return\n\n copyOfElementList.splice(level, 1)\n copyOfElementList.unshift(element)\n }\n\n return copyOfElementList\n }\n\n /**\n * 调整元素层级\n * @param element 需要调整层级的元素\n * @param command 调整命令:上移、下移、置顶、置底\n */\n const orderElement = (element: PPTElement, command: ElementOrderCommands) => {\n let newElementList\n \n if (command === ElementOrderCommands.UP) newElementList = moveUpElement(currentSlide.value.elements, element)\n else if (command === ElementOrderCommands.DOWN) newElementList = moveDownElement(currentSlide.value.elements, element)\n else if (command === ElementOrderCommands.TOP) newElementList = moveTopElement(currentSlide.value.elements, element)\n else if (command === ElementOrderCommands.BOTTOM) newElementList = moveBottomElement(currentSlide.value.elements, element)\n\n if (!newElementList) return\n\n slidesStore.updateSlide({ elements: newElementList })\n addHistorySnapshot()\n }\n\n return {\n orderElement,\n }\n}","// 进入全屏\nexport const enterFullscreen = () => {\n const docElm = document.documentElement\n if (docElm.requestFullscreen) docElm.requestFullscreen() \n else if (docElm.mozRequestFullScreen) docElm.mozRequestFullScreen() \n else if (docElm.webkitRequestFullScreen) docElm.webkitRequestFullScreen()\n else if (docElm.msRequestFullscreen) docElm.msRequestFullscreen()\n}\n\n// 退出全屏\nexport const exitFullscreen = () => {\n if (document.exitFullscreen) document.exitFullscreen()\n else if (document.mozCancelFullScreen) document.mozCancelFullScreen()\n else if (document.webkitExitFullscreen) document.webkitExitFullscreen()\n else if (document.msExitFullscreen) document.msExitFullscreen()\n}\n\n// 判断是否全屏\nexport const isFullscreen = () => {\n const fullscreenElement = \n document.fullscreenElement ||\n document.mozFullScreenElement ||\n document.webkitFullscreenElement ||\n document.msFullscreenElement ||\n document.webkitCurrentFullScreenElement\n return !!fullscreenElement\n}","import { useScreenStore, useSlidesStore } from '@/store'\nimport { enterFullscreen, exitFullscreen, isFullscreen } from '@/utils/fullscreen'\n\nexport default () => {\n const screenStore = useScreenStore()\n const slidesStore = useSlidesStore()\n\n // 进入放映状态(从当前页开始)\n const enterScreening = () => {\n enterFullscreen()\n screenStore.setScreening(true)\n }\n\n // 进入放映状态(从第一页开始)\n const enterScreeningFromStart = () => {\n slidesStore.updateSlideIndex(0)\n enterScreening()\n }\n\n // 退出放映状态\n const exitScreening = () => {\n screenStore.setScreening(false)\n if (isFullscreen()) exitFullscreen()\n }\n\n return {\n enterScreening,\n enterScreeningFromStart,\n exitScreening,\n }\n}","import { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\n\nexport default () => {\n const mainStore = useMainStore()\n const { canvasPercentage, canvasScale, canvasDragged } = storeToRefs(mainStore)\n\n const canvasScalePercentage = computed(() => Math.round(canvasScale.value * 100) + '%')\n\n /**\n * 缩放画布百分比\n * @param command 缩放命令:放大、缩小\n */\n const scaleCanvas = (command: '+' | '-') => {\n let percentage = canvasPercentage.value\n const step = 5\n const max = 200\n const min = 30\n if (command === '+' && percentage <= max) percentage += step\n if (command === '-' && percentage >= min) percentage -= step\n\n mainStore.setCanvasPercentage(percentage)\n }\n\n /**\n * 设置画布缩放比例\n * 但不是直接设置该值,而是通过设置画布可视区域百分比来动态计算\n * @param value 目标画布缩放比例\n */\n const setCanvasScalePercentage = (value: number) => {\n const percentage = Math.round(value / canvasScale.value * canvasPercentage.value) / 100\n mainStore.setCanvasPercentage(percentage)\n }\n\n /**\n * 重置画布尺寸和位置\n */\n const resetCanvas = () => {\n mainStore.setCanvasPercentage(90)\n if (canvasDragged) mainStore.setCanvasDragged(false)\n }\n\n return {\n canvasScalePercentage,\n setCanvasScalePercentage,\n scaleCanvas,\n resetCanvas,\n }\n}","import { onMounted, onUnmounted } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore, useKeyboardStore } from '@/store'\nimport { ElementOrderCommands } from '@/types/edit'\nimport { KEYS } from '@/configs/hotkey'\n\nimport useSlideHandler from './useSlideHandler'\nimport useLockElement from './useLockElement'\nimport useDeleteElement from './useDeleteElement'\nimport useCombineElement from './useCombineElement'\nimport useCopyAndPasteElement from './useCopyAndPasteElement'\nimport useSelectAllElement from './useSelectAllElement'\nimport useMoveElement from './useMoveElement'\nimport useOrderElement from './useOrderElement'\nimport useHistorySnapshot from './useHistorySnapshot'\nimport useScreening from './useScreening'\nimport useScaleCanvas from './useScaleCanvas'\n\nexport default () => {\n const mainStore = useMainStore()\n const keyboardStore = useKeyboardStore()\n const {\n activeElementIdList,\n disableHotkeys,\n handleElement,\n handleElementId,\n editorAreaFocus,\n thumbnailsFocus,\n } = storeToRefs(mainStore)\n const { currentSlide } = storeToRefs(useSlidesStore())\n const { ctrlKeyState, shiftKeyState, spaceKeyState } = storeToRefs(keyboardStore)\n\n const {\n updateSlideIndex,\n copySlide,\n createSlide,\n deleteSlide,\n cutSlide,\n copyAndPasteSlide,\n selectAllSlide,\n } = useSlideHandler()\n\n const { combineElements, uncombineElements } = useCombineElement()\n const { deleteElement } = useDeleteElement()\n const { lockElement } = useLockElement()\n const { copyElement, cutElement, quickCopyElement } = useCopyAndPasteElement()\n const { selectAllElement } = useSelectAllElement()\n const { moveElement } = useMoveElement()\n const { orderElement } = useOrderElement()\n const { redo, undo } = useHistorySnapshot()\n const { enterScreening, enterScreeningFromStart } = useScreening()\n const { scaleCanvas, resetCanvas } = useScaleCanvas()\n\n const copy = () => {\n if (activeElementIdList.value.length) copyElement()\n else if (thumbnailsFocus.value) copySlide()\n }\n\n const cut = () => {\n if (activeElementIdList.value.length) cutElement()\n else if (thumbnailsFocus.value) cutSlide()\n }\n\n const quickCopy = () => {\n if (activeElementIdList.value.length) quickCopyElement()\n else if (thumbnailsFocus.value) copyAndPasteSlide()\n }\n\n const selectAll = () => {\n if (editorAreaFocus.value) selectAllElement()\n if (thumbnailsFocus.value) selectAllSlide()\n }\n\n const lock = () => {\n if (!editorAreaFocus.value) return\n lockElement()\n }\n const combine = () => {\n if (!editorAreaFocus.value) return\n combineElements()\n }\n\n const uncombine = () => {\n if (!editorAreaFocus.value) return\n uncombineElements()\n }\n\n const remove = () => {\n if (activeElementIdList.value.length) deleteElement()\n else if (thumbnailsFocus.value) deleteSlide()\n }\n\n const move = (key: string) => {\n if (activeElementIdList.value.length) moveElement(key)\n else if (key === KEYS.UP || key === KEYS.DOWN) updateSlideIndex(key)\n }\n\n const moveSlide = (key: string) => {\n if (key === KEYS.PAGEUP) updateSlideIndex(KEYS.UP)\n else if (key === KEYS.PAGEDOWN) updateSlideIndex(KEYS.DOWN)\n }\n\n const order = (command: ElementOrderCommands) => {\n if (!handleElement.value) return\n orderElement(handleElement.value, command)\n }\n\n const create = () => {\n if (!thumbnailsFocus.value) return\n createSlide()\n }\n\n const tabActiveElement = () => {\n if (!currentSlide.value.elements.length) return\n if (!handleElementId.value) {\n const firstElement = currentSlide.value.elements[0]\n mainStore.setActiveElementIdList([firstElement.id])\n return\n }\n const currentIndex = currentSlide.value.elements.findIndex(el => el.id === handleElementId.value)\n const nextIndex = currentIndex >= currentSlide.value.elements.length - 1 ? 0 : currentIndex + 1\n const nextElementId = currentSlide.value.elements[nextIndex].id\n\n mainStore.setActiveElementIdList([nextElementId])\n }\n\n const keydownListener = (e: KeyboardEvent) => {\n const { ctrlKey, shiftKey, altKey, metaKey } = e\n const ctrlOrMetaKeyActive = ctrlKey || metaKey\n \n const key = e.key.toUpperCase()\n\n if (ctrlOrMetaKeyActive && !ctrlKeyState.value) keyboardStore.setCtrlKeyState(true)\n if (shiftKey && !shiftKeyState.value) keyboardStore.setShiftKeyState(true)\n if (!disableHotkeys.value && key === KEYS.SPACE) keyboardStore.setSpaceKeyState(true)\n\n \n if (ctrlOrMetaKeyActive && key === KEYS.P) {\n e.preventDefault()\n mainStore.setDialogForExport('pdf')\n return\n }\n if (shiftKey && key === KEYS.F5) {\n e.preventDefault()\n enterScreening()\n keyboardStore.setShiftKeyState(false)\n return\n }\n if (key === KEYS.F5) {\n e.preventDefault()\n enterScreeningFromStart()\n return\n }\n \n if (!editorAreaFocus.value && !thumbnailsFocus.value) return \n\n if (ctrlOrMetaKeyActive && key === KEYS.C) {\n if (disableHotkeys.value) return\n e.preventDefault()\n copy()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.X) {\n if (disableHotkeys.value) return\n e.preventDefault()\n cut()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.D) {\n if (disableHotkeys.value) return\n e.preventDefault()\n quickCopy()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.Z) {\n if (disableHotkeys.value) return\n e.preventDefault()\n undo()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.Y) {\n if (disableHotkeys.value) return\n e.preventDefault()\n redo()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.A) {\n if (disableHotkeys.value) return\n e.preventDefault()\n selectAll()\n }\n if (ctrlOrMetaKeyActive && key === KEYS.L) {\n if (disableHotkeys.value) return\n e.preventDefault()\n lock()\n }\n if (!shiftKey && ctrlOrMetaKeyActive && key === KEYS.G) {\n if (disableHotkeys.value) return\n e.preventDefault()\n combine()\n }\n if (shiftKey && ctrlOrMetaKeyActive && key === KEYS.G) {\n if (disableHotkeys.value) return\n e.preventDefault()\n uncombine()\n }\n if (altKey && key === KEYS.F) {\n if (disableHotkeys.value) return\n e.preventDefault()\n order(ElementOrderCommands.TOP)\n }\n if (altKey && key === KEYS.B) {\n if (disableHotkeys.value) return\n e.preventDefault()\n order(ElementOrderCommands.BOTTOM)\n }\n if (key === KEYS.DELETE || key === KEYS.BACKSPACE) {\n if (disableHotkeys.value) return\n e.preventDefault()\n remove()\n }\n if (key === KEYS.UP) {\n if (disableHotkeys.value) return\n e.preventDefault()\n move(KEYS.UP)\n }\n if (key === KEYS.DOWN) {\n if (disableHotkeys.value) return\n e.preventDefault()\n move(KEYS.DOWN)\n }\n if (key === KEYS.LEFT) {\n if (disableHotkeys.value) return\n e.preventDefault()\n move(KEYS.LEFT)\n }\n if (key === KEYS.RIGHT) {\n if (disableHotkeys.value) return\n e.preventDefault()\n move(KEYS.RIGHT)\n }\n if (key === KEYS.PAGEUP) {\n if (disableHotkeys.value) return\n e.preventDefault()\n moveSlide(KEYS.PAGEUP)\n }\n if (key === KEYS.PAGEDOWN) {\n if (disableHotkeys.value) return\n e.preventDefault()\n moveSlide(KEYS.PAGEDOWN)\n }\n if (key === KEYS.ENTER) {\n if (disableHotkeys.value) return\n e.preventDefault()\n create()\n }\n if (key === KEYS.MINUS) {\n if (disableHotkeys.value) return\n e.preventDefault()\n scaleCanvas('-')\n }\n if (key === KEYS.EQUAL) {\n if (disableHotkeys.value) return\n e.preventDefault()\n scaleCanvas('+')\n }\n if (key === KEYS.DIGIT_0) {\n if (disableHotkeys.value) return\n e.preventDefault()\n resetCanvas()\n }\n if (key === KEYS.TAB) {\n if (disableHotkeys.value) return\n e.preventDefault()\n tabActiveElement()\n }\n }\n \n const keyupListener = () => {\n if (ctrlKeyState.value) keyboardStore.setCtrlKeyState(false)\n if (shiftKeyState.value) keyboardStore.setShiftKeyState(false)\n if (spaceKeyState.value) keyboardStore.setSpaceKeyState(false)\n }\n\n onMounted(() => {\n document.addEventListener('keydown', keydownListener)\n document.addEventListener('keyup', keyupListener)\n window.addEventListener('blur', keyupListener)\n })\n onUnmounted(() => {\n document.removeEventListener('keydown', keydownListener)\n document.removeEventListener('keyup', keyupListener)\n window.removeEventListener('blur', keyupListener)\n })\n}","import { onMounted, onUnmounted } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { getImageDataURL } from '@/utils/image'\nimport usePasteTextClipboardData from './usePasteTextClipboardData'\nimport useCreateElement from './useCreateElement'\n\nexport default () => {\n const { editorAreaFocus, thumbnailsFocus, disableHotkeys } = storeToRefs(useMainStore())\n\n const { pasteTextClipboardData } = usePasteTextClipboardData()\n const { createImageElement } = useCreateElement()\n\n // 粘贴图片到幻灯片元素\n const pasteImageFile = (imageFile: File) => {\n getImageDataURL(imageFile).then(dataURL => createImageElement(dataURL))\n }\n\n /**\n * 粘贴事件监听\n * @param e ClipboardEvent\n */\n const pasteListener = (e: ClipboardEvent) => {\n if (!editorAreaFocus.value && !thumbnailsFocus.value) return\n if (disableHotkeys.value) return\n\n if (!e.clipboardData) return\n\n const clipboardDataItems = e.clipboardData.items\n const clipboardDataFirstItem = clipboardDataItems[0]\n\n if (!clipboardDataFirstItem) return\n\n // 如果剪贴板内有图片,优先尝试读取图片\n for (const item of clipboardDataItems) {\n if (item.kind === 'file' && item.type.indexOf('image') !== -1) {\n const imageFile = item.getAsFile()\n if (imageFile) pasteImageFile(imageFile)\n return\n }\n }\n \n // 如果剪贴板内没有图片,但有文字内容,尝试解析文字内容\n if (clipboardDataFirstItem.kind === 'string' && clipboardDataFirstItem.type === 'text/plain') {\n clipboardDataFirstItem.getAsString(text => pasteTextClipboardData(text))\n }\n }\n\n onMounted(() => {\n document.addEventListener('paste', pasteListener)\n })\n onUnmounted(() => {\n document.removeEventListener('paste', pasteListener)\n })\n}","export const childlessTags = ['style', 'script', 'template']\n\nexport const closingTags = ['html', 'head', 'body', 'p', 'dt', 'dd', 'li', 'option', 'thead', 'th', 'tbody', 'tr', 'td', 'tfoot', 'colgroup']\n\nexport const closingTagAncestorBreakers = {\n li: ['ul', 'ol', 'menu'],\n dt: ['dl'],\n dd: ['dl'],\n tbody: ['table'],\n thead: ['table'],\n tfoot: ['table'],\n tr: ['table'],\n td: ['table'],\n}\n\nexport const voidTags = ['!doctype', 'area', 'base', 'br', 'col', 'command', 'embed', 'hr', 'img', 'input', 'keygen', 'link', 'meta', 'param', 'source', 'track', 'wbr']","import { startsWith, endsWith } from 'lodash'\nimport { Token } from './types'\nimport { childlessTags } from './tags'\n\ninterface State {\n str: string\n position: number\n tokens: Token[]\n}\n\nconst jumpPosition = (state: State, end: number) => {\n const len = end - state.position\n movePositopn(state, len)\n}\n\nconst movePositopn = (state: State, len: number) => {\n state.position = state.position + len\n}\n\nconst findTextEnd = (str: string, index: number) => {\n const isEnd = false\n while (!isEnd) {\n const textEnd = str.indexOf('<', index)\n if (textEnd === -1) {\n return textEnd\n }\n const char = str.charAt(textEnd + 1)\n if (char === '/' || char === '!' || /[A-Za-z0-9]/.test(char)) {\n return textEnd\n }\n index = textEnd + 1\n }\n return -1\n}\n\nconst lexText = (state: State) => {\n const { str } = state\n let textEnd = findTextEnd(str, state.position)\n if (textEnd === state.position) return\n if (textEnd === -1) {\n textEnd = str.length\n }\n\n const content = str.slice(state.position, textEnd)\n jumpPosition(state, textEnd)\n\n state.tokens.push({\n type: 'text', \n content, \n })\n}\n\nconst lexComment = (state: State) => {\n const { str } = state\n\n movePositopn(state, 4)\n let contentEnd = str.indexOf('-->', state.position)\n let commentEnd = contentEnd + 3\n if (contentEnd === -1) {\n contentEnd = commentEnd = str.length\n }\n\n const content = str.slice(state.position, contentEnd)\n jumpPosition(state, commentEnd)\n\n state.tokens.push({\n type: 'comment',\n content,\n })\n}\n\nconst lexTagName = (state: State) => {\n const { str } = state\n const len = str.length\n let start = state.position\n\n while (start < len) {\n const char = str.charAt(start)\n const isTagChar = !(/\\s/.test(char) || char === '/' || char === '>')\n if (isTagChar) break\n start++\n }\n\n let end = start + 1\n while (end < len) {\n const char = str.charAt(end)\n const isTagChar = !(/\\s/.test(char) || char === '/' || char === '>')\n if (!isTagChar) break\n end++\n }\n\n jumpPosition(state, end)\n const tagName = str.slice(start, end)\n state.tokens.push({\n type: 'tag',\n content: tagName\n })\n return tagName\n}\n\nconst lexTagAttributes = (state: State) => {\n const { str, tokens } = state\n let cursor = state.position\n let quote = null\n let wordBegin = cursor\n const words = []\n const len = str.length\n while (cursor < len) {\n const char = str.charAt(cursor)\n if (quote) {\n const isQuoteEnd = char === quote\n if (isQuoteEnd) quote = null\n cursor++\n continue\n }\n\n const isTagEnd = char === '/' || char === '>'\n if (isTagEnd) {\n if (cursor !== wordBegin) words.push(str.slice(wordBegin, cursor))\n break\n }\n\n const isWordEnd = /\\s/.test(char)\n if (isWordEnd) {\n if (cursor !== wordBegin) words.push(str.slice(wordBegin, cursor))\n wordBegin = cursor + 1\n cursor++\n continue\n }\n\n const isQuoteStart = char === '\\'' || char === '\"'\n if (isQuoteStart) {\n quote = char\n cursor++\n continue\n }\n\n cursor++\n }\n jumpPosition(state, cursor)\n\n const type = 'attribute'\n for (let i = 0; i < words.length; i++) {\n const word = words[i]\n\n const isNotPair = word.indexOf('=') === -1\n if (isNotPair) {\n const secondWord = words[i + 1]\n if (secondWord && startsWith(secondWord, '=')) {\n if (secondWord.length > 1) {\n const newWord = word + secondWord\n tokens.push({ type, content: newWord })\n i += 1\n continue\n }\n const thirdWord = words[i + 2]\n i += 1\n if (thirdWord) {\n const newWord = word + '=' + thirdWord\n tokens.push({ type, content: newWord })\n i += 1\n continue\n }\n }\n }\n if (endsWith(word, '=')) {\n const secondWord = words[i + 1]\n if (secondWord && secondWord.indexOf('=') === -1) {\n const newWord = word + secondWord\n tokens.push({ type, content: newWord })\n i += 1\n continue\n }\n\n const newWord = word.slice(0, -1)\n tokens.push({ type, content: newWord })\n continue\n }\n\n tokens.push({ type, content: word })\n }\n}\n\nconst lexSkipTag = (tagName: string, state: State) => {\n const { str, tokens } = state\n const safeTagName = tagName.toLowerCase()\n const len = str.length\n let index = state.position\n \n while (index < len) {\n const nextTag = str.indexOf(' {\n const { str } = state\n const secondChar = str.charAt(state.position + 1)\n const tagStartClose = secondChar === '/'\n movePositopn(state, tagStartClose ? 2 : 1)\n state.tokens.push({\n type: 'tag-start',\n close: tagStartClose,\n })\n\n const tagName = lexTagName(state)\n lexTagAttributes(state)\n\n const firstChar = str.charAt(state.position)\n const tagEndClose = firstChar === '/'\n movePositopn(state, tagEndClose ? 2 : 1)\n state.tokens.push({\n type: 'tag-end',\n close: tagEndClose,\n })\n return tagName\n}\n\nconst lex = (state: State) => {\n const str = state.str\n const len = str.length\n\n while (state.position < len) {\n const start = state.position\n lexText(state)\n\n if (state.position === start) {\n const isComment = startsWith(str, '!--', start + 1)\n if (isComment) lexComment(state)\n else {\n const tagName = lexTag(state)\n const safeTag = tagName.toLowerCase()\n if (childlessTags.includes(safeTag)) lexSkipTag(tagName, state)\n }\n }\n }\n}\n\nexport const lexer = (str: string): Token[] => {\n const state = {\n str,\n position: 0,\n tokens: [],\n }\n lex(state)\n return state.tokens\n}","import { Token, HTMLNode, TagToken, NormalElement, TagEndToken, AttributeToken, TextToken } from './types'\nimport { closingTags, closingTagAncestorBreakers, voidTags } from './tags'\n\ninterface StackItem {\n tagName: string | null\n children: HTMLNode[]\n}\n\ninterface State {\n stack: StackItem[]\n cursor: number\n tokens: Token[]\n}\n\nexport const parser = (tokens: Token[]) => {\n const root: StackItem = { tagName: null, children: [] }\n const state: State = { tokens, cursor: 0, stack: [root] }\n parse(state)\n return root.children\n}\n\nexport const hasTerminalParent = (tagName: string, stack: StackItem[]) => {\n const tagParents = closingTagAncestorBreakers[tagName]\n if (tagParents) {\n let currentIndex = stack.length - 1\n while (currentIndex >= 0) {\n const parentTagName = stack[currentIndex].tagName\n if (parentTagName === tagName) break\n if (tagParents.includes(parentTagName)) return true\n currentIndex--\n }\n }\n return false\n}\n\nexport const rewindStack = (stack: StackItem[], newLength: number) => {\n stack.splice(newLength)\n}\n\nexport const parse = (state: State) => {\n const { stack, tokens } = state\n let { cursor } = state\n let nodes = stack[stack.length - 1].children\n const len = tokens.length\n \n while (cursor < len) {\n const token = tokens[cursor]\n if (token.type !== 'tag-start') {\n nodes.push(token as TextToken)\n cursor++\n continue\n }\n\n const tagToken = tokens[++cursor] as TagToken\n cursor++\n const tagName = tagToken.content.toLowerCase()\n if (token.close) {\n let index = stack.length\n let shouldRewind = false\n while (--index > -1) {\n if (stack[index].tagName === tagName) {\n shouldRewind = true\n break\n }\n }\n while (cursor < len) {\n if (tokens[cursor].type !== 'tag-end') break\n cursor++\n }\n if (shouldRewind) {\n rewindStack(stack, index)\n break\n } \n else continue\n }\n\n const isClosingTag = closingTags.includes(tagName)\n let shouldRewindToAutoClose = isClosingTag\n if (shouldRewindToAutoClose) {\n shouldRewindToAutoClose = !hasTerminalParent(tagName, stack)\n }\n\n if (shouldRewindToAutoClose) {\n let currentIndex = stack.length - 1\n while (currentIndex > 0) {\n if (tagName === stack[currentIndex].tagName) {\n rewindStack(stack, currentIndex)\n const previousIndex = currentIndex - 1\n nodes = stack[previousIndex].children\n break\n }\n currentIndex = currentIndex - 1\n }\n }\n\n const attributes = []\n let tagEndToken: TagEndToken | undefined\n while (cursor < len) {\n const _token = tokens[cursor]\n if (_token.type === 'tag-end') {\n tagEndToken = _token\n break\n }\n attributes.push((_token as AttributeToken).content)\n cursor++\n }\n\n if (!tagEndToken) break\n\n cursor++\n const children: HTMLNode[] = []\n const elementNode: NormalElement = {\n type: 'element',\n tagName: tagToken.content,\n attributes,\n children,\n }\n nodes.push(elementNode)\n\n const hasChildren = !(tagEndToken.close || voidTags.includes(tagName))\n if (hasChildren) {\n stack.push({tagName, children})\n const innerState = { tokens, cursor, stack }\n parse(innerState)\n cursor = innerState.cursor\n }\n }\n state.cursor = cursor\n}","import { HTMLNode, CommentOrTextAST, ElementAST, AST } from './types'\n\nexport const splitHead = (str: string, sep: string) => {\n const idx = str.indexOf(sep)\n if (idx === -1) return [str]\n return [str.slice(0, idx), str.slice(idx + sep.length)]\n}\n\nconst unquote = (str: string) => {\n const car = str.charAt(0)\n const end = str.length - 1\n const isQuoteStart = car === '\"' || car === \"'\"\n if (isQuoteStart && car === str.charAt(end)) {\n return str.slice(1, end)\n }\n return str\n}\n\nconst formatAttributes = (attributes: string[]) => {\n return attributes.map(attribute => {\n const parts = splitHead(attribute.trim(), '=')\n const key = parts[0]\n const value = typeof parts[1] === 'string' ? unquote(parts[1]) : null\n return { key, value }\n })\n}\n\nexport const format = (nodes: HTMLNode[]): AST[] => {\n return nodes.map(node => { \n if (node.type === 'element') {\n const children = format(node.children)\n const item: ElementAST = {\n type: 'element',\n tagName: node.tagName.toLowerCase(),\n attributes: formatAttributes(node.attributes),\n children,\n }\n return item\n }\n\n const item: CommentOrTextAST = {\n type: node.type,\n content: node.content,\n }\n return item\n })\n}","// 参考:https://github.com/andrejewski/himalaya 用TypeScript重写并简化部分功能\n\nimport { lexer } from './lexer'\nimport { parser } from './parser'\nimport { format } from './format'\nimport { toHTML } from './stringify'\nimport type { AST } from './types'\n\nexport const toAST = (str: string) => {\n const tokens = lexer(str)\n const nodes = parser(tokens)\n return format(nodes)\n}\n\nexport { toHTML, AST }","import { SVGPathData } from 'svg-pathdata'\nimport arcToBezier from 'svg-arc-to-cubic-bezier'\n\nconst typeMap = {\n 1: 'Z',\n 2: 'M',\n 4: 'H',\n 8: 'V',\n 16: 'L',\n 32: 'C',\n 64: 'S',\n 128: 'Q',\n 256: 'T',\n 512: 'A',\n}\n\n/**\n * 简单解析SVG路径\n * @param d SVG path d属性\n */\nexport const parseSvgPath = (d: string) => {\n const pathData = new SVGPathData(d)\n\n const ret = pathData.commands.map(item => {\n return { ...item, type: typeMap[item.type] }\n })\n return ret\n}\n\nexport type SvgPath = ReturnType\n\n/**\n * 解析SVG路径,并将圆弧(A)类型的路径转为三次贝塞尔(C)类型的路径\n * @param d SVG path d属性\n */\nexport const toPoints = (d: string) => {\n const pathData = new SVGPathData(d)\n \n const points = []\n for (const item of pathData.commands) {\n const type = typeMap[item.type]\n\n if (item.type === 2 || item.type === 16) {\n points.push({\n x: item.x,\n y: item.y,\n relative: item.relative,\n type,\n })\n }\n if (item.type === 32) {\n points.push({\n x: item.x, \n y: item.y,\n curve: {\n type: 'cubic',\n x1: item.x1,\n y1: item.y1,\n x2: item.x2,\n y2: item.y2,\n },\n relative: item.relative,\n type,\n })\n }\n else if (item.type === 128) {\n points.push({\n x: item.x, \n y: item.y,\n curve: {\n type: 'quadratic',\n x1: item.x1,\n y1: item.y1,\n },\n relative: item.relative,\n type,\n })\n }\n else if (item.type === 512) {\n const lastPoint = points[points.length - 1]\n if (!['M', 'L', 'Q', 'C'].includes(lastPoint.type)) continue\n\n const cubicBezierPoints = arcToBezier({\n px: lastPoint.x as number,\n py: lastPoint.y as number,\n cx: item.x,\n cy: item.y,\n rx: item.rX,\n ry: item.rY,\n xAxisRotation: item.xRot,\n largeArcFlag: item.lArcFlag,\n sweepFlag: item.sweepFlag,\n })\n for (const cbPoint of cubicBezierPoints) {\n points.push({\n x: cbPoint.x, \n y: cbPoint.y,\n curve: {\n type: 'cubic',\n x1: cbPoint.x1,\n y1: cbPoint.y1,\n x2: cbPoint.x2,\n y2: cbPoint.y2,\n },\n relative: false,\n type: 'C',\n })\n }\n }\n else if (item.type === 1) {\n points.push({ close: true, type })\n }\n else continue\n }\n return points\n}\n\nexport type SvgPoints = ReturnType","// svg转base64图片,参考:https://github.com/scriptex/svg64\n\nconst characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/='\nconst PREFIX = 'data:image/svg+xml;base64,'\n\nconst utf8Encode = (string: string) => {\n string = string.replace(/\\r\\n/g, '\\n')\n let utftext = ''\n\n for (let n = 0; n < string.length; n++) {\n const c = string.charCodeAt(n)\n\n if (c < 128) {\n utftext += String.fromCharCode(c)\n }\n else if (c > 127 && c < 2048) {\n utftext += String.fromCharCode((c >> 6) | 192)\n utftext += String.fromCharCode((c & 63) | 128)\n }\n else {\n utftext += String.fromCharCode((c >> 12) | 224)\n utftext += String.fromCharCode(((c >> 6) & 63) | 128)\n utftext += String.fromCharCode((c & 63) | 128)\n }\n }\n\n return utftext\n}\n\nconst encode = (input: string) => {\n let output = ''\n let chr1, chr2, chr3, enc1, enc2, enc3, enc4\n let i = 0\n input = utf8Encode(input)\n while (i < input.length) {\n chr1 = input.charCodeAt(i++)\n chr2 = input.charCodeAt(i++)\n chr3 = input.charCodeAt(i++)\n enc1 = chr1 >> 2\n enc2 = ((chr1 & 3) << 4) | (chr2 >> 4)\n enc3 = ((chr2 & 15) << 2) | (chr3 >> 6)\n enc4 = chr3 & 63\n if (isNaN(chr2)) enc3 = enc4 = 64\n else if (isNaN(chr3)) enc4 = 64\n output = output + characters.charAt(enc1) + characters.charAt(enc2) + characters.charAt(enc3) + characters.charAt(enc4)\n }\n return output\n}\n\nexport const svg2Base64 = (element: Element) => {\n const XMLS = new XMLSerializer()\n const svg = XMLS.serializeToString(element)\n\n return PREFIX + encode(svg)\n}","import { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { trim } from 'lodash'\nimport { saveAs } from 'file-saver'\nimport pptxgen from 'pptxgenjs'\nimport tinycolor from 'tinycolor2'\nimport { toPng, toJpeg } from 'html-to-image'\nimport { useSlidesStore } from '@/store'\nimport { PPTElementOutline, PPTElementShadow, PPTElementLink, Slide } from '@/types/slides'\nimport { getElementRange, getLineElementPath, getTableSubThemeColor } from '@/utils/element'\nimport { AST, toAST } from '@/utils/htmlParser'\nimport { SvgPoints, toPoints } from '@/utils/svgPathParser'\nimport { decrypt, encrypt } from '@/utils/crypto'\nimport { svg2Base64 } from '@/utils/svg2Base64'\nimport { message } from 'ant-design-vue'\nimport useAddSlidesOrElements from '@/hooks/useAddSlidesOrElements'\n\ninterface ExportImageConfig {\n quality: number\n width: number\n fontEmbedCSS?: string\n}\n\nexport default () => {\n const slidesStore = useSlidesStore()\n const { slides, theme, viewportRatio } = storeToRefs(slidesStore)\n\n const { addSlidesFromData } = useAddSlidesOrElements()\n\n const exporting = ref(false)\n\n // 导出图片\n const exportImage = (domRef: HTMLElement, format: string, quality: number, ignoreWebfont = true) => {\n exporting.value = true\n const toImage = format === 'png' ? toPng : toJpeg\n\n const foreignObjectSpans = domRef.querySelectorAll('foreignObject [xmlns]')\n foreignObjectSpans.forEach(spanRef => spanRef.removeAttribute('xmlns'))\n\n setTimeout(() => {\n const config: ExportImageConfig = {\n quality,\n width: 1600,\n }\n\n if (ignoreWebfont) config.fontEmbedCSS = ''\n\n toImage(domRef, config).then(dataUrl => {\n exporting.value = false\n saveAs(dataUrl, `pptist_slides.${format}`)\n }).catch(() => {\n exporting.value = false\n message.error('导出图片失败')\n })\n }, 200)\n }\n \n // 导出pptist文件(特有 .pptist 后缀文件)\n const exportSpecificFile = (_slides: Slide[]) => {\n const blob = new Blob([encrypt(JSON.stringify(_slides))], { type: '' })\n saveAs(blob, 'pptist_slides.pptist')\n }\n \n // 导入pptist文件\n const importSpecificFile = (files: FileList, cover = false) => {\n const file = files[0]\n\n const reader = new FileReader()\n reader.addEventListener('load', () => {\n try {\n const slides = JSON.parse(decrypt(reader.result as string))\n if (cover) slidesStore.setSlides(slides)\n else addSlidesFromData(slides)\n }\n catch {\n message.error('无法正确读取 / 解析该文件')\n }\n })\n reader.readAsText(file)\n }\n \n // 导出JSON文件\n const exportJSON = () => {\n const blob = new Blob([JSON.stringify(slides.value)], { type: '' })\n saveAs(blob, 'pptist_slides.json')\n }\n\n // 格式化颜色值为 透明度 + HexString,供pptxgenjs使用\n const formatColor = (_color: string) => {\n const c = tinycolor(_color)\n const alpha = c.getAlpha()\n const color = alpha === 0 ? '#ffffff' : c.setAlpha(1).toHexString()\n return {\n alpha,\n color,\n }\n }\n\n type FormatColor = ReturnType\n\n // 将HTML字符串格式化为pptxgenjs所需的格式\n // 核心思路:将HTML字符串按样式分片平铺,每个片段需要继承祖先元素的样式信息,遇到块级元素需要换行\n const formatHTML = (html: string) => {\n const ast = toAST(html)\n let bulletFlag = false\n let indent = 0\n\n const slices: pptxgen.TextProps[] = []\n const parse = (obj: AST[], baseStyleObj = {}) => {\n\n for (const item of obj) {\n const isBlockTag = 'tagName' in item && ['div', 'li', 'p'].includes(item.tagName)\n\n if (isBlockTag && slices.length) {\n const lastSlice = slices[slices.length - 1]\n if (!lastSlice.options) lastSlice.options = {}\n lastSlice.options.breakLine = true\n }\n\n const styleObj = { ...baseStyleObj }\n const styleAttr = 'attributes' in item ? item.attributes.find(attr => attr.key === 'style') : null\n if (styleAttr && styleAttr.value) {\n const styleArr = styleAttr.value.split(';')\n for (const styleItem of styleArr) {\n const [_key, _value] = styleItem.split(': ')\n const [key, value] = [trim(_key), trim(_value)]\n if (key && value) styleObj[key] = value\n }\n }\n\n if ('tagName' in item) {\n if (item.tagName === 'em') {\n styleObj['font-style'] = 'italic'\n }\n if (item.tagName === 'strong') {\n styleObj['font-weight'] = 'bold'\n }\n if (item.tagName === 'sup') {\n styleObj['vertical-align'] = 'super'\n }\n if (item.tagName === 'sub') {\n styleObj['vertical-align'] = 'sub'\n }\n if (item.tagName === 'a') {\n const attr = item.attributes.find(attr => attr.key === 'href')\n styleObj['href'] = attr?.value || ''\n }\n if (item.tagName === 'ul') {\n styleObj['list-type'] = 'ul'\n }\n if (item.tagName === 'ol') {\n styleObj['list-type'] = 'ol'\n }\n if (item.tagName === 'li') {\n bulletFlag = true\n }\n if (item.tagName === 'p') {\n if ('attributes' in item) {\n const dataIndentAttr = item.attributes.find(attr => attr.key === 'data-indent')\n if (dataIndentAttr && dataIndentAttr.value) indent = +dataIndentAttr.value\n }\n }\n }\n\n if ('tagName' in item && item.tagName === 'br') {\n slices.push({ text: '', options: { breakLine: true } })\n }\n else if ('content' in item) {\n const text = item.content.replace(/ /g, ' ').replace(/>/g, '>').replace(/</g, '<').replace(/&/g, '&').replace(/\\n/g, '')\n const options: pptxgen.TextPropsOptions = {}\n\n if (styleObj['font-size']) {\n options.fontSize = parseInt(styleObj['font-size']) * 0.75\n }\n if (styleObj['color']) {\n options.color = formatColor(styleObj['color']).color\n }\n if (styleObj['background-color']) {\n options.highlight = formatColor(styleObj['background-color']).color\n }\n if (styleObj['text-decoration-line']) {\n if (styleObj['text-decoration-line'].indexOf('underline') !== -1) {\n options.underline = {\n color: options.color || '#000000',\n style: 'sng',\n }\n }\n if (styleObj['text-decoration-line'].indexOf('line-through') !== -1) {\n options.strike = 'sngStrike'\n }\n }\n if (styleObj['text-decoration']) {\n if (styleObj['text-decoration'].indexOf('underline') !== -1) {\n options.underline = {\n color: options.color || '#000000',\n style: 'sng',\n }\n }\n if (styleObj['text-decoration'].indexOf('line-through') !== -1) {\n options.strike = 'sngStrike'\n }\n }\n if (styleObj['vertical-align']) {\n if (styleObj['vertical-align'] === 'super') options.superscript = true\n if (styleObj['vertical-align'] === 'sub') options.subscript = true\n }\n if (styleObj['text-align']) options.align = styleObj['text-align']\n if (styleObj['font-weight']) options.bold = styleObj['font-weight'] === 'bold'\n if (styleObj['font-style']) options.italic = styleObj['font-style'] === 'italic'\n if (styleObj['font-family']) options.fontFace = styleObj['font-family']\n if (styleObj['href']) options.hyperlink = { url: styleObj['href'] }\n\n if (bulletFlag && styleObj['list-type'] === 'ol') {\n options.bullet = { type: 'number', indent: 20 * 0.75 }\n options.paraSpaceBefore = 0.1\n bulletFlag = false\n }\n if (bulletFlag && styleObj['list-type'] === 'ul') {\n options.bullet = { indent: 20 * 0.75 }\n options.paraSpaceBefore = 0.1\n bulletFlag = false\n }\n if (indent) {\n options.indentLevel = indent\n indent = 0\n }\n\n slices.push({ text, options })\n }\n else if ('children' in item) parse(item.children, styleObj)\n }\n }\n parse(ast)\n return slices\n }\n\n type Points = Array<\n | { x: number; y: number; moveTo?: boolean }\n | { x: number; y: number; curve: { type: 'arc'; hR: number; wR: number; stAng: number; swAng: number } }\n | { x: number; y: number; curve: { type: 'quadratic'; x1: number; y1: number } }\n | { x: number; y: number; curve: { type: 'cubic'; x1: number; y1: number; x2: number; y2: number } }\n | { close: true }\n >\n\n // 将SVG路径信息格式化为pptxgenjs所需要的格式\n const formatPoints = (points: SvgPoints, scale = { x: 1, y: 1 }): Points => {\n return points.map(point => {\n if (point.close !== undefined) {\n return { close: true }\n }\n else if (point.type === 'M') {\n return {\n x: point.x / 100 * scale.x,\n y: point.y / 100 * scale.y,\n moveTo: true,\n }\n }\n else if (point.curve) {\n if (point.curve.type === 'cubic') {\n return {\n x: point.x / 100 * scale.x,\n y: point.y / 100 * scale.y,\n curve: {\n type: 'cubic',\n x1: (point.curve.x1 as number) / 100 * scale.x,\n y1: (point.curve.y1 as number) / 100 * scale.y,\n x2: (point.curve.x2 as number) / 100 * scale.x,\n y2: (point.curve.y2 as number) / 100 * scale.y,\n },\n }\n }\n else if (point.curve.type === 'quadratic') {\n return {\n x: point.x / 100 * scale.x,\n y: point.y / 100 * scale.y,\n curve: {\n type: 'quadratic',\n x1: (point.curve.x1 as number) / 100 * scale.x,\n y1: (point.curve.y1 as number) / 100 * scale.y,\n },\n }\n }\n }\n return {\n x: point.x / 100 * scale.x,\n y: point.y / 100 * scale.y,\n }\n })\n }\n\n // 获取阴影配置\n const getShadowOption = (shadow: PPTElementShadow): pptxgen.ShadowProps => {\n const c = formatColor(shadow.color)\n const { h, v } = shadow\n\n let offset = 4\n let angle = 45\n\n if (h === 0 && v === 0) {\n offset = 4\n angle = 45\n }\n else if (h === 0) {\n if (v > 0) {\n offset = v\n angle = 90\n }\n else {\n offset = -v\n angle = 270\n }\n }\n else if (v === 0) {\n if (h > 0) {\n offset = h\n angle = 1\n }\n else {\n offset = -h\n angle = 180\n }\n }\n else if (h > 0 && v > 0) {\n offset = Math.max(h, v)\n angle = 45\n }\n else if (h > 0 && v < 0) {\n offset = Math.max(h, -v)\n angle = 315\n }\n else if (h < 0 && v > 0) {\n offset = Math.max(-h, v)\n angle = 135\n }\n else if (h < 0 && v < 0) {\n offset = Math.max(-h, -v)\n angle = 225\n }\n\n return {\n type: 'outer',\n color: c.color.replace('#', ''),\n opacity: c.alpha,\n blur: shadow.blur * 0.75,\n offset,\n angle,\n }\n }\n\n // 获取边框配置\n const getOutlineOption = (outline: PPTElementOutline): pptxgen.ShapeLineProps => {\n const c = formatColor(outline?.color || '#000000')\n return {\n color: c.color, \n transparency: (1 - c.alpha) * 100,\n width: (outline.width || 1) * 0.75, \n dashType: outline.style === 'solid' ? 'solid' : 'dash',\n }\n }\n\n // 获取超链接配置\n const getLinkOption = (link: PPTElementLink): pptxgen.HyperlinkProps | null => {\n const { type, target } = link\n if (type === 'web') return { url: target }\n if (type === 'slide') {\n const index = slides.value.findIndex(slide => slide.id === target)\n if (index !== -1) return { slide: index + 1 }\n }\n\n return null\n }\n\n // 导出PPTX文件\n const exportPPTX = (_slides: Slide[], masterOverwrite: boolean) => {\n exporting.value = true\n const pptx = new pptxgen()\n\n if (viewportRatio.value === 0.625) pptx.layout = 'LAYOUT_16x10'\n else if (viewportRatio.value === 0.75) pptx.layout = 'LAYOUT_4x3'\n else pptx.layout = 'LAYOUT_16x9'\n\n if (masterOverwrite) {\n const { color: bgColor, alpha: bgAlpha } = formatColor(theme.value.backgroundColor)\n pptx.defineSlideMaster({\n title: 'PPTIST_MASTER',\n background: { color: bgColor, transparency: (1 - bgAlpha) * 100 },\n })\n }\n\n for (const slide of _slides) {\n const pptxSlide = pptx.addSlide()\n\n if (slide.background) {\n const background = slide.background\n if (background.type === 'image' && background.image) {\n pptxSlide.background = { data: background.image }\n }\n else if (background.type === 'solid' && background.color) {\n const c = formatColor(background.color)\n pptxSlide.background = { color: c.color, transparency: (1 - c.alpha) * 100 }\n }\n else if (background.type === 'gradient' && background.gradientColor) {\n const [color1, color2] = background.gradientColor\n const color = tinycolor.mix(color1, color2).toHexString()\n const c = formatColor(color)\n pptxSlide.background = { color: c.color, transparency: (1 - c.alpha) * 100 }\n }\n }\n if (slide.remark) pptxSlide.addNotes(slide.remark)\n\n if (!slide.elements) continue\n\n for (const el of slide.elements) {\n if (el.type === 'text') {\n const textProps = formatHTML(el.content)\n\n const options: pptxgen.TextPropsOptions = {\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n fontSize: 20 * 0.75,\n fontFace: '微软雅黑',\n color: '#000000',\n valign: 'top',\n margin: 10 * 0.75,\n paraSpaceBefore: 5 * 0.75,\n lineSpacingMultiple: 1.5 / 1.25,\n autoFit: true,\n }\n if (el.rotate) options.rotate = el.rotate\n if (el.wordSpace) options.charSpacing = el.wordSpace * 0.75\n if (el.lineHeight) options.lineSpacingMultiple = el.lineHeight / 1.25\n if (el.fill) {\n const c = formatColor(el.fill)\n const opacity = el.opacity === undefined ? 1 : el.opacity\n options.fill = { color: c.color, transparency: (1 - c.alpha * opacity) * 100 }\n }\n if (el.defaultColor) options.color = formatColor(el.defaultColor).color\n if (el.defaultFontName) options.fontFace = el.defaultFontName\n if (el.shadow) options.shadow = getShadowOption(el.shadow)\n if (el.outline?.width) options.line = getOutlineOption(el.outline)\n if (el.opacity !== undefined) options.transparency = (1 - el.opacity) * 100\n if (el.paragraphSpace !== undefined) options.paraSpaceBefore = el.paragraphSpace * 0.75\n\n pptxSlide.addText(textProps, options)\n }\n\n else if (el.type === 'image') {\n const options: pptxgen.ImageProps = {\n path: el.src,\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n }\n if (el.flipH) options.flipH = el.flipH\n if (el.flipV) options.flipV = el.flipV\n if (el.rotate) options.rotate = el.rotate\n if (el.link) {\n const linkOption = getLinkOption(el.link)\n if (linkOption) options.hyperlink = linkOption\n }\n if (el.filters?.opacity) options.transparency = 100 - parseInt(el.filters?.opacity)\n if (el.clip) {\n if (el.clip.shape === 'ellipse') options.rounding = true\n\n const [start, end] = el.clip.range\n const [startX, startY] = start\n const [endX, endY] = end\n\n const originW = el.width / ((endX - startX) / 100)\n const originH = el.height / ((endY - startY) / 100)\n\n options.w = originW / 100\n options.h = originH / 100\n\n options.sizing = {\n type: 'crop',\n x: startX / 100 * originW / 100,\n y: startY / 100 * originH / 100,\n w: (endX - startX) / 100 * originW / 100,\n h: (endY - startY) / 100 * originH / 100,\n }\n }\n\n pptxSlide.addImage(options)\n }\n\n else if (el.type === 'shape') {\n if (el.special) {\n const svgRef = document.querySelector(`.thumbnail-list .base-element-${el.id} svg`) as HTMLElement\n const base64SVG = svg2Base64(svgRef)\n\n const options: pptxgen.ImageProps = {\n data: base64SVG,\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n }\n if (el.rotate) options.rotate = el.rotate\n if (el.link) {\n const linkOption = getLinkOption(el.link)\n if (linkOption) options.hyperlink = linkOption\n }\n\n pptxSlide.addImage(options)\n }\n else {\n const scale = {\n x: el.width / el.viewBox[0],\n y: el.height / el.viewBox[1],\n }\n const points = formatPoints(toPoints(el.path), scale)\n \n const fillColor = formatColor(el.fill)\n const opacity = el.opacity === undefined ? 1 : el.opacity\n \n const options: pptxgen.ShapeProps = {\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n fill: { color: fillColor.color, transparency: (1 - fillColor.alpha * opacity) * 100 },\n points,\n }\n if (el.flipH) options.flipH = el.flipH\n if (el.flipV) options.flipV = el.flipV\n if (el.shadow) options.shadow = getShadowOption(el.shadow)\n if (el.outline?.width) options.line = getOutlineOption(el.outline)\n if (el.link) {\n const linkOption = getLinkOption(el.link)\n if (linkOption) options.hyperlink = linkOption\n }\n\n pptxSlide.addShape('custGeom' as pptxgen.ShapeType, options)\n }\n if (el.text) {\n const textProps = formatHTML(el.text.content)\n\n const options: pptxgen.TextPropsOptions = {\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n fontSize: 20 * 0.75,\n fontFace: '微软雅黑',\n color: '#000000',\n paraSpaceBefore: 5 * 0.75,\n valign: el.text.align,\n }\n if (el.rotate) options.rotate = el.rotate\n if (el.text.defaultColor) options.color = formatColor(el.text.defaultColor).color\n if (el.text.defaultFontName) options.fontFace = el.text.defaultFontName\n\n pptxSlide.addText(textProps, options)\n }\n }\n\n else if (el.type === 'line') {\n const path = getLineElementPath(el)\n const points = formatPoints(toPoints(path))\n const { minX, maxX, minY, maxY } = getElementRange(el)\n const c = formatColor(el.color)\n\n const options: pptxgen.ShapeProps = {\n x: el.left / 100,\n y: el.top / 100,\n w: (maxX - minX) / 100,\n h: (maxY - minY) / 100,\n line: {\n color: c.color, \n transparency: (1 - c.alpha) * 100,\n width: el.width * 0.75, \n dashType: el.style === 'solid' ? 'solid' : 'dash',\n beginArrowType: el.points[0] ? 'arrow' : 'none',\n endArrowType: el.points[1] ? 'arrow' : 'none',\n },\n points,\n }\n if (el.shadow) options.shadow = getShadowOption(el.shadow)\n\n pptxSlide.addShape('custGeom' as pptxgen.ShapeType, options)\n }\n\n else if (el.type === 'chart') {\n const chartData = []\n for (let i = 0; i < el.data.series.length; i++) {\n const item = el.data.series[i]\n chartData.push({\n name: `系列${i + 1}`,\n labels: el.data.labels,\n values: item,\n })\n }\n\n let chartColors: string[] = []\n if (el.themeColor.length === 10) chartColors = el.themeColor.map(color => formatColor(color).color)\n else if (el.themeColor.length === 1) chartColors = tinycolor(el.themeColor[0]).analogous(10).map(color => formatColor(color.toHexString()).color)\n else {\n const len = el.themeColor.length\n const supplement = tinycolor(el.themeColor[len - 1]).analogous(10 + 1 - len).map(color => color.toHexString())\n chartColors = [...el.themeColor.slice(0, len - 1), ...supplement].map(color => formatColor(color).color)\n }\n \n const options: pptxgen.IChartOpts = {\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n chartColors: el.chartType === 'pie' ? chartColors : chartColors.slice(0, el.data.series.length),\n }\n\n if (el.fill) options.fill = formatColor(el.fill).color\n if (el.legend) {\n options.showLegend = true\n options.legendPos = el.legend === 'top' ? 't' : 'b'\n options.legendColor = formatColor(el.gridColor || '#000000').color\n options.legendFontSize = 14 * 0.75\n }\n\n let type = pptx.ChartType.bar\n if (el.chartType === 'bar') {\n type = pptx.ChartType.bar\n options.barDir = el.options?.horizontalBars ? 'bar' : 'col'\n }\n else if (el.chartType === 'line') {\n if (el.options?.showArea) type = pptx.ChartType.area\n else if (el.options?.showLine === false) {\n type = pptx.ChartType.scatter\n\n chartData.unshift({ name: 'X-Axis', values: Array(el.data.series[0].length).fill(0).map((v, i) => i) })\n options.lineSize = 0\n }\n else type = pptx.ChartType.line\n\n if (el.options?.lineSmooth) options.lineSmooth = true\n }\n else if (el.chartType === 'pie') {\n if (el.options?.donut) {\n type = pptx.ChartType.doughnut\n options.holeSize = 75\n }\n else type = pptx.ChartType.pie\n }\n \n pptxSlide.addChart(type, chartData, options)\n }\n\n else if (el.type === 'table') {\n const hiddenCells = []\n for (let i = 0; i < el.data.length; i++) {\n const rowData = el.data[i]\n\n for (let j = 0; j < rowData.length; j++) {\n const cell = rowData[j]\n if (cell.colspan > 1 || cell.rowspan > 1) {\n for (let row = i; row < i + cell.rowspan; row++) {\n for (let col = row === i ? j + 1 : j; col < j + cell.colspan; col++) hiddenCells.push(`${row}_${col}`)\n }\n }\n }\n }\n\n const tableData = []\n\n const theme = el.theme\n let themeColor: FormatColor | null = null\n let subThemeColors: FormatColor[] = []\n if (theme) {\n themeColor = formatColor(theme.color)\n subThemeColors = getTableSubThemeColor(theme.color).map(item => formatColor(item))\n }\n\n for (let i = 0; i < el.data.length; i++) {\n const row = el.data[i]\n const _row = []\n\n for (let j = 0; j < row.length; j++) {\n const cell = row[j]\n const cellOptions: pptxgen.TableCellProps = {\n colspan: cell.colspan,\n rowspan: cell.rowspan,\n bold: cell.style?.bold || false,\n italic: cell.style?.em || false,\n underline: { style: cell.style?.underline ? 'sng' : 'none' },\n align: cell.style?.align || 'left',\n valign: 'middle',\n fontFace: cell.style?.fontname || '微软雅黑',\n fontSize: (cell.style?.fontsize ? parseInt(cell.style?.fontsize) : 14) * 0.75,\n }\n if (theme && themeColor) {\n let c: FormatColor\n if (i % 2 === 0) c = subThemeColors[1]\n else c = subThemeColors[0]\n\n if (theme.rowHeader && i === 0) c = themeColor\n else if (theme.rowFooter && i === el.data.length - 1) c = themeColor\n else if (theme.colHeader && j === 0) c = themeColor\n else if (theme.colFooter && j === row.length - 1) c = themeColor\n\n cellOptions.fill = { color: c.color, transparency: (1 - c.alpha) * 100 }\n }\n if (cell.style?.backcolor) {\n const c = formatColor(cell.style.backcolor)\n cellOptions.fill = { color: c.color, transparency: (1 - c.alpha) * 100 }\n }\n if (cell.style?.color) cellOptions.color = formatColor(cell.style.color).color\n\n if (!hiddenCells.includes(`${i}_${j}`)) {\n _row.push({\n text: cell.text,\n options: cellOptions,\n })\n }\n }\n if (_row.length) tableData.push(_row)\n }\n\n const options: pptxgen.TableProps = {\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n colW: el.colWidths.map(item => el.width * item / 100),\n }\n if (el.theme) options.fill = { color: '#ffffff' }\n if (el.outline.width && el.outline.color) {\n options.border = {\n type: el.outline.style === 'solid' ? 'solid' : 'dash',\n pt: el.outline.width * 0.75,\n color: formatColor(el.outline.color).color,\n }\n }\n\n pptxSlide.addTable(tableData, options)\n }\n \n else if (el.type === 'latex') {\n const svgRef = document.querySelector(`.thumbnail-list .base-element-${el.id} svg`) as HTMLElement\n const base64SVG = svg2Base64(svgRef)\n\n const options: pptxgen.ImageProps = {\n data: base64SVG,\n x: el.left / 100,\n y: el.top / 100,\n w: el.width / 100,\n h: el.height / 100,\n }\n if (el.link) {\n const linkOption = getLinkOption(el.link)\n if (linkOption) options.hyperlink = linkOption\n }\n\n pptxSlide.addImage(options)\n }\n }\n }\n pptx.writeFile({ fileName: `pptist.pptx` }).then(() => exporting.value = false).catch(() => {\n exporting.value = false\n message.error('导出失败')\n })\n }\n\n return {\n exporting,\n exportImage,\n exportJSON,\n importSpecificFile,\n exportSpecificFile,\n exportPPTX,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4b1afc5f\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"hotkey-doc\" }\nconst _hoisted_2 = { class: \"title\" }\nconst _hoisted_3 = { class: \"label\" }\nconst _hoisted_4 = { class: \"value\" }\n\nimport { HOTKEY_DOC } from '@/configs/hotkey' \n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'HotkeyDoc',\n setup(__props) {\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(HOTKEY_DOC), (item) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: item.type\n }, [\n _createElementVNode(\"div\", _hoisted_2, _toDisplayString(item.type), 1),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(item.children, (hotkey) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"hotkey-item\",\n key: hotkey.label\n }, [\n _createElementVNode(\"div\", _hoisted_3, _toDisplayString(hotkey.label), 1),\n _createElementVNode(\"div\", _hoisted_4, _toDisplayString(hotkey.value), 1)\n ]))\n }), 128))\n ], 64))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./HotkeyDoc.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./HotkeyDoc.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./HotkeyDoc.vue?vue&type=style&index=0&id=4b1afc5f&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-4b1afc5f\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, unref as _unref, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-6c34fc9c\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"editor-header\" }\nconst _hoisted_2 = { class: \"left\" }\nconst _hoisted_3 = { class: \"menu-item\" }\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode()\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"text\" }, \"文件\", -1))\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"导入 pptist 文件\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"导出 pptist 文件\")\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"导出 PPTX\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"导出图片\")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"导出 JSON\")\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\"打印 / 导出 PDF\")\nconst _hoisted_12 = { class: \"menu-item\" }\nconst _hoisted_13 = /*#__PURE__*/_createTextVNode()\nconst _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"text\" }, \"编辑\", -1))\nconst _hoisted_15 = /*#__PURE__*/_createTextVNode(\"撤销\")\nconst _hoisted_16 = /*#__PURE__*/_createTextVNode(\"重做\")\nconst _hoisted_17 = /*#__PURE__*/_createTextVNode(\"添加页面\")\nconst _hoisted_18 = /*#__PURE__*/_createTextVNode(\"删除页面\")\nconst _hoisted_19 = /*#__PURE__*/_createTextVNode(\"重置幻灯片\")\nconst _hoisted_20 = { class: \"menu-item\" }\nconst _hoisted_21 = /*#__PURE__*/_createTextVNode()\nconst _hoisted_22 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"text\" }, \"演示\", -1))\nconst _hoisted_23 = /*#__PURE__*/_createTextVNode(\"从头开始\")\nconst _hoisted_24 = /*#__PURE__*/_createTextVNode(\"从当前页开始\")\nconst _hoisted_25 = { class: \"menu-item\" }\nconst _hoisted_26 = /*#__PURE__*/_createTextVNode()\nconst _hoisted_27 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"text\" }, \"帮助\", -1))\nconst _hoisted_28 = /*#__PURE__*/_createTextVNode(\"意见反馈\")\nconst _hoisted_29 = /*#__PURE__*/_createTextVNode(\"快捷键\")\nconst _hoisted_30 = { class: \"right\" }\nconst _hoisted_31 = {\n href: \"https://github.com/pipipi-pikachu/PPTist\",\n target: \"_blank\"\n}\nconst _hoisted_32 = { class: \"menu-item\" }\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport useScreening from '@/hooks/useScreening'\nimport useSlideHandler from '@/hooks/useSlideHandler'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport useExport from '@/hooks/useExport'\n\nimport HotkeyDoc from './HotkeyDoc.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst { showGridLines, showRuler } = storeToRefs(mainStore)\n\nconst { enterScreening, enterScreeningFromStart } = useScreening()\nconst { createSlide, deleteSlide, resetSlides } = useSlideHandler()\nconst { redo, undo } = useHistorySnapshot()\nconst { importSpecificFile } = useExport()\n\nconst setDialogForExport = mainStore.setDialogForExport\n\nconst toggleGridLines = () => {\n mainStore.setGridLinesState(!showGridLines.value)\n}\n\nconst toggleRuler = () => {\n mainStore.setRulerState(!showRuler.value)\n}\n\nconst hotkeyDrawerVisible = ref(false)\n\nconst goIssues = () => {\n window.open('https://github.com/pipipi-pikachu/PPTist/issues')\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconFolderClose = _resolveComponent(\"IconFolderClose\")!\n const _component_MenuItem = _resolveComponent(\"MenuItem\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_Menu = _resolveComponent(\"Menu\")!\n const _component_Dropdown = _resolveComponent(\"Dropdown\")!\n const _component_IconEdit = _resolveComponent(\"IconEdit\")!\n const _component_IconPpt = _resolveComponent(\"IconPpt\")!\n const _component_IconHelpcenter = _resolveComponent(\"IconHelpcenter\")!\n const _component_IconShare = _resolveComponent(\"IconShare\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconGithub = _resolveComponent(\"IconGithub\")!\n const _component_Drawer = _resolveComponent(\"Drawer\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_Dropdown, { trigger: ['click'] }, {\n overlay: _withCtx(() => [\n _createVNode(_component_Menu, null, {\n default: _withCtx(() => [\n _createVNode(_component_FileInput, {\n accept: \".pptist\",\n onChange: _cache[0] || (_cache[0] = files => _unref(importSpecificFile)(files))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_MenuItem, null, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_unref(setDialogForExport)('pptist')))\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_unref(setDialogForExport)('pptx')))\n }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[3] || (_cache[3] = ($event: any) => (_unref(setDialogForExport)('image')))\n }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[4] || (_cache[4] = ($event: any) => (_unref(setDialogForExport)('json')))\n }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[5] || (_cache[5] = ($event: any) => (_unref(setDialogForExport)('pdf')))\n }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_IconFolderClose),\n _hoisted_4,\n _hoisted_5\n ])\n ]),\n _: 1\n }),\n _createVNode(_component_Dropdown, { trigger: ['click'] }, {\n overlay: _withCtx(() => [\n _createVNode(_component_Menu, null, {\n default: _withCtx(() => [\n _createVNode(_component_MenuItem, {\n onClick: _cache[6] || (_cache[6] = ($event: any) => (_unref(undo)()))\n }, {\n default: _withCtx(() => [\n _hoisted_15\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[7] || (_cache[7] = ($event: any) => (_unref(redo)()))\n }, {\n default: _withCtx(() => [\n _hoisted_16\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[8] || (_cache[8] = ($event: any) => (_unref(createSlide)()))\n }, {\n default: _withCtx(() => [\n _hoisted_17\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[9] || (_cache[9] = ($event: any) => (_unref(deleteSlide)()))\n }, {\n default: _withCtx(() => [\n _hoisted_18\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[10] || (_cache[10] = ($event: any) => (toggleGridLines()))\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(showGridLines) ? '关闭网格线' : '打开网格线'), 1)\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[11] || (_cache[11] = ($event: any) => (toggleRuler()))\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(_unref(showRuler) ? '关闭标尺' : '打开标尺'), 1)\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[12] || (_cache[12] = ($event: any) => (_unref(resetSlides)()))\n }, {\n default: _withCtx(() => [\n _hoisted_19\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_12, [\n _createVNode(_component_IconEdit),\n _hoisted_13,\n _hoisted_14\n ])\n ]),\n _: 1\n }),\n _createVNode(_component_Dropdown, { trigger: ['click'] }, {\n overlay: _withCtx(() => [\n _createVNode(_component_Menu, null, {\n default: _withCtx(() => [\n _createVNode(_component_MenuItem, {\n onClick: _cache[13] || (_cache[13] = ($event: any) => (_unref(enterScreeningFromStart)()))\n }, {\n default: _withCtx(() => [\n _hoisted_23\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[14] || (_cache[14] = ($event: any) => (_unref(enterScreening)()))\n }, {\n default: _withCtx(() => [\n _hoisted_24\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_20, [\n _createVNode(_component_IconPpt),\n _hoisted_21,\n _hoisted_22\n ])\n ]),\n _: 1\n }),\n _createVNode(_component_Dropdown, { trigger: ['click'] }, {\n overlay: _withCtx(() => [\n _createVNode(_component_Menu, null, {\n default: _withCtx(() => [\n _createVNode(_component_MenuItem, {\n onClick: _cache[15] || (_cache[15] = ($event: any) => (goIssues()))\n }, {\n default: _withCtx(() => [\n _hoisted_28\n ]),\n _: 1\n }),\n _createVNode(_component_MenuItem, {\n onClick: _cache[16] || (_cache[16] = ($event: any) => (hotkeyDrawerVisible.value = true))\n }, {\n default: _withCtx(() => [\n _hoisted_29\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_25, [\n _createVNode(_component_IconHelpcenter),\n _hoisted_26,\n _hoisted_27\n ])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_30, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n title: \"导出\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: \"menu-item\",\n onClick: _cache[17] || (_cache[17] = ($event: any) => (_unref(setDialogForExport)('pptx')))\n }, [\n _createVNode(_component_IconShare, {\n size: \"18\",\n fill: \"#666\"\n })\n ])\n ]),\n _: 1\n }),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n title: \"幻灯片放映\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: \"menu-item\",\n onClick: _cache[18] || (_cache[18] = ($event: any) => (_unref(enterScreening)()))\n }, [\n _createVNode(_component_IconPpt, {\n size: \"19\",\n fill: \"#666\",\n style: {\"margin-top\":\"1px\"}\n })\n ])\n ]),\n _: 1\n }),\n _createElementVNode(\"a\", _hoisted_31, [\n _createElementVNode(\"div\", _hoisted_32, [\n _createVNode(_component_IconGithub, {\n size: \"18\",\n fill: \"#666\"\n })\n ])\n ])\n ]),\n _createVNode(_component_Drawer, {\n width: \"320\",\n placement: \"right\",\n closable: false,\n visible: hotkeyDrawerVisible.value,\n onClose: _cache[19] || (_cache[19] = ($event: any) => (hotkeyDrawerVisible.value = false))\n }, {\n default: _withCtx(() => [\n _createVNode(HotkeyDoc)\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=6c34fc9c&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6c34fc9c\"]])\n\nexport default __exports__","export const enum ClipPathTypes {\n RECT = 'rect',\n ELLIPSE = 'ellipse',\n POLYGON = 'polygon',\n}\n\nexport const enum ClipPaths {\n RECT = 'rect',\n ROUNDRECT = 'roundRect',\n ELLIPSE = 'ellipse',\n TRIANGLE = 'triangle',\n PENTAGON = 'pentagon',\n RHOMBUS = 'rhombus',\n STAR = 'star',\n}\n\nexport const CLIPPATHS = {\n rect: {\n name: '矩形',\n type: ClipPathTypes.RECT,\n radius: '0',\n style: '',\n },\n rect2: {\n name: '矩形2',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 0 100%)',\n createPath: (width: number, height: number) => {\n return `M 0 0 L ${width * 0.8} 0 L ${width} ${height * 0.2} L ${width} ${height} L 0 ${height} Z`\n },\n },\n rect3: {\n name: '矩形3',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(0% 0%, 80% 0%, 100% 20%, 100% 100%, 20% 100%, 0% 80%)',\n createPath: (width: number, height: number) => {\n return `M 0 0 L ${width * 0.8} 0 L ${width} ${height * 0.2} L ${width} ${height} L ${width * 0.2} ${height} L 0 ${height * 0.8} Z`\n },\n },\n roundRect: {\n name: '圆角矩形',\n type: ClipPathTypes.RECT,\n radius: '10%',\n style: 'inset(0 0 0 0 round 10% 10% 10% 10%)',\n },\n ellipse: {\n name: '圆形',\n type: ClipPathTypes.ELLIPSE,\n style: 'ellipse(50% 50% at 50% 50%)',\n },\n triangle: {\n name: '三角形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(50% 0%, 0% 100%, 100% 100%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.5} 0 L 0 ${height} L ${width} ${height} Z`\n },\n },\n triangle2: {\n name: '三角形2',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(50% 100%, 0% 0%, 100% 0%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.5} ${height} L 0 0 L ${width} 0 Z`\n },\n },\n triangle3: {\n name: '三角形3',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(0% 0%, 0% 100%, 100% 100%)',\n createPath: (width: number, height: number) => {\n return `M 0 0 L 0 ${height} L ${width} ${height} Z`\n },\n },\n rhombus: {\n name: '菱形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.5} 0 L ${width} ${height * 0.5} L ${width * 0.5} ${height} L 0 ${height * 0.5} Z`\n },\n },\n hexagon: {\n name: '六边形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(20% 0%, 80% 0%, 100% 50%, 80% 100%, 20% 100%, 0% 50%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.2} 0 L ${width * 0.8} 0 L ${width} ${height * 0.5} L ${width * 0.8} ${height} L ${width * 0.2} ${height} L 0 ${height * 0.5} Z`\n },\n },\n pentagon: {\n name: '五边形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(50% 0%, 100% 38%, 82% 100%, 18% 100%, 0% 38%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.5} 0 L ${width} ${0.38 * height} L ${0.82 * width} ${height} L ${0.18 * width} ${height} L 0 ${0.38 * height} Z`\n },\n },\n parallelogram: {\n name: '平行四边形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(30% 0%, 100% 0%, 70% 100%, 0% 100%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.3} 0 L ${width} 0 L ${width * 0.7} ${height} L 0 ${height} Z`\n },\n },\n parallelogram2: {\n name: '平行四边形2',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(30% 100%, 100% 100%, 70% 0%, 0% 0%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.3} ${height} L ${width} ${height} L ${width * 0.7} 0 L 0 0 Z`\n },\n },\n trapezoid: {\n name: '梯形',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(25% 0%, 75% 0%, 100% 100%, 0% 100%)',\n createPath: (width: number, height: number) => {\n return `M ${width * 0.25} 0 L ${width * 0.75} 0 L ${width} ${height} L 0 ${height} Z`\n },\n },\n trapezoid2: {\n name: '梯形2',\n type: ClipPathTypes.POLYGON,\n style: 'polygon(0% 0%, 100% 0%, 75% 100%, 25% 100%)',\n createPath: (width: number, height: number) => {\n return `M 0 0 L ${width} 0 L ${width * 0.75} ${height} L ${width * 0.25} ${height} Z`\n },\n },\n}","import { InjectionKey, Ref } from 'vue'\n\nexport type SlideScale = Ref\nexport type SlideId = Ref\n\nexport const injectKeySlideScale: InjectionKey = Symbol()\nexport const injectKeySlideId: InjectionKey = Symbol()","// 清除文字选区\nexport const removeAllRanges = () => {\n const selection = window.getSelection()\n selection && selection.removeAllRanges()\n}","import { ref, computed, onMounted, onUnmounted, Ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\n\nexport default (canvasRef: Ref) => {\n const viewportLeft = ref(0)\n const viewportTop = ref(0)\n\n const mainStore = useMainStore()\n const { canvasPercentage, canvasDragged } = storeToRefs(mainStore)\n const { viewportRatio } = storeToRefs(useSlidesStore())\n\n // 计算画布可视区域的位置\n const setViewportPosition = () => {\n if (!canvasRef.value) return\n const canvasWidth = canvasRef.value.clientWidth\n const canvasHeight = canvasRef.value.clientHeight\n\n if (canvasHeight / canvasWidth > viewportRatio.value) {\n const viewportActualWidth = canvasWidth * (canvasPercentage.value / 100)\n mainStore.setCanvasScale(viewportActualWidth / VIEWPORT_SIZE)\n viewportLeft.value = (canvasWidth - viewportActualWidth) / 2\n viewportTop.value = (canvasHeight - viewportActualWidth * viewportRatio.value) / 2\n }\n else {\n const viewportActualHeight = canvasHeight * (canvasPercentage.value / 100)\n mainStore.setCanvasScale(viewportActualHeight / (VIEWPORT_SIZE * viewportRatio.value))\n viewportLeft.value = (canvasWidth - viewportActualHeight / viewportRatio.value) / 2\n viewportTop.value = (canvasHeight - viewportActualHeight) / 2\n }\n }\n\n // 可视区域缩放或比例变化时,更新可视区域的位置\n watch([canvasPercentage, viewportRatio], setViewportPosition)\n\n // 画布拖拽状态改变(复原)时,更新可视区域的位置\n watch(canvasDragged, () => {\n if (!canvasDragged.value) setViewportPosition()\n })\n\n // 画布可视区域位置和大小的样式\n const viewportStyles = computed(() => ({\n width: VIEWPORT_SIZE,\n height: VIEWPORT_SIZE * viewportRatio.value,\n left: viewportLeft.value,\n top: viewportTop.value,\n }))\n\n // 监听画布尺寸发生变化时,更新可视区域的位置\n const resizeObserver = new ResizeObserver(setViewportPosition)\n\n onMounted(() => {\n if (canvasRef.value) resizeObserver.observe(canvasRef.value)\n })\n onUnmounted(() => {\n if (canvasRef.value) resizeObserver.unobserve(canvasRef.value)\n })\n\n // 拖拽画布\n const dragViewport = (e: MouseEvent) => {\n let isMouseDown = true\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n\n const originLeft = viewportLeft.value\n const originTop = viewportTop.value\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n viewportLeft.value = originLeft + (currentPageX - startPageX)\n viewportTop.value = originTop + (currentPageY - startPageY)\n }\n\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n mainStore.setCanvasDragged(true)\n }\n }\n\n return {\n viewportStyles,\n dragViewport,\n }\n}","import { Ref, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { getElementRange } from '@/utils/element'\n\nexport default (elementList: Ref, viewportRef: Ref) => {\n const mainStore = useMainStore()\n const { canvasScale } = storeToRefs(mainStore)\n\n const mouseSelectionVisible = ref(false)\n const mouseSelectionQuadrant = ref(1)\n const mouseSelection = ref({\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n })\n\n // 更新鼠标框选范围\n const updateMouseSelection = (e: MouseEvent) => {\n if (!viewportRef.value) return\n\n let isMouseDown = true\n const viewportRect = viewportRef.value.getBoundingClientRect()\n\n const minSelectionRange = 5\n \n const startPageX = e.pageX\n const startPageY = e.pageY\n\n const left = (startPageX - viewportRect.x) / canvasScale.value\n const top = (startPageY - viewportRect.y) / canvasScale.value\n\n // 确定框选的起始位置和其他默认值初始化\n mouseSelection.value = {\n top: top,\n left: left,\n width: 0,\n height: 0,\n }\n mouseSelectionVisible.value = false\n mouseSelectionQuadrant.value = 4\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n const offsetWidth = (currentPageX - startPageX) / canvasScale.value\n const offsetHeight = (currentPageY - startPageY) / canvasScale.value\n\n const width = Math.abs(offsetWidth)\n const height = Math.abs(offsetHeight)\n\n if ( width < minSelectionRange || height < minSelectionRange ) return\n \n // 计算鼠标框选(移动)的方向\n // 按四个象限的位置区分,如右下角为第四象限\n let quadrant = 0\n if ( offsetWidth > 0 && offsetHeight > 0 ) quadrant = 4\n else if ( offsetWidth < 0 && offsetHeight < 0 ) quadrant = 1\n else if ( offsetWidth > 0 && offsetHeight < 0 ) quadrant = 2\n else if ( offsetWidth < 0 && offsetHeight > 0 ) quadrant = 3\n\n // 更新框选范围\n mouseSelection.value = {\n ...mouseSelection.value,\n width: width,\n height: height,\n }\n mouseSelectionVisible.value = true\n mouseSelectionQuadrant.value = quadrant\n }\n\n document.onmouseup = () => {\n document.onmousemove = null\n document.onmouseup = null\n isMouseDown = false\n\n // 计算画布中的元素是否处在鼠标选择范围中,处在范围中的元素设置为被选中状态\n let inRangeElementList: PPTElement[] = []\n for (let i = 0; i < elementList.value.length; i++) {\n const element = elementList.value[i]\n const mouseSelectionLeft = mouseSelection.value.left\n const mouseSelectionTop = mouseSelection.value.top\n const mouseSelectionWidth = mouseSelection.value.width\n const mouseSelectionHeight = mouseSelection.value.height\n\n const { minX, maxX, minY, maxY } = getElementRange(element)\n\n // 计算元素是否处在框选范围内时,四个框选方向的计算方式有差异\n let isInclude = false\n if (mouseSelectionQuadrant.value === 4) {\n isInclude = minX > mouseSelectionLeft && \n maxX < mouseSelectionLeft + mouseSelectionWidth && \n minY > mouseSelectionTop && \n maxY < mouseSelectionTop + mouseSelectionHeight\n }\n else if (mouseSelectionQuadrant.value === 1) {\n isInclude = minX > (mouseSelectionLeft - mouseSelectionWidth) && \n maxX < (mouseSelectionLeft - mouseSelectionWidth) + mouseSelectionWidth && \n minY > (mouseSelectionTop - mouseSelectionHeight) && \n maxY < (mouseSelectionTop - mouseSelectionHeight) + mouseSelectionHeight\n }\n else if (mouseSelectionQuadrant.value === 2) {\n isInclude = minX > mouseSelectionLeft && \n maxX < mouseSelectionLeft + mouseSelectionWidth && \n minY > (mouseSelectionTop - mouseSelectionHeight) && \n maxY < (mouseSelectionTop - mouseSelectionHeight) + mouseSelectionHeight\n }\n else if (mouseSelectionQuadrant.value === 3) {\n isInclude = minX > (mouseSelectionLeft - mouseSelectionWidth) && \n maxX < (mouseSelectionLeft - mouseSelectionWidth) + mouseSelectionWidth && \n minY > mouseSelectionTop && \n maxY < mouseSelectionTop + mouseSelectionHeight\n }\n\n // 被锁定的元素即使在范围内,也不需要设置为选中状态\n if (isInclude && !element.lock) inRangeElementList.push(element)\n }\n\n // 如果范围内有组合元素的成员,需要该组全部成员都处在范围内,才会被设置为选中状态\n inRangeElementList = inRangeElementList.filter(inRangeElement => {\n if (inRangeElement.groupId) {\n const inRangeElementIdList = inRangeElementList.map(inRangeElement => inRangeElement.id)\n const groupElementList = elementList.value.filter(element => element.groupId === inRangeElement.groupId)\n return groupElementList.every(groupElement => inRangeElementIdList.includes(groupElement.id))\n }\n return true\n })\n const inRangeElementIdList = inRangeElementList.map(inRangeElement => inRangeElement.id)\n mainStore.setActiveElementIdList(inRangeElementIdList)\n\n mouseSelectionVisible.value = false\n }\n }\n\n return {\n mouseSelection,\n mouseSelectionVisible,\n mouseSelectionQuadrant,\n updateMouseSelection,\n }\n}","import { onMounted, onUnmounted, Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { getImageDataURL } from '@/utils/image'\nimport { parseText2Paragraphs } from '@/utils/textParser'\nimport useCreateElement from '@/hooks/useCreateElement'\n\nexport default (elementRef: Ref) => {\n const { disableHotkeys } = storeToRefs(useMainStore())\n\n const { createImageElement, createTextElement } = useCreateElement()\n\n // 拖拽元素到画布中\n const handleDrop = (e: DragEvent) => {\n if (!e.dataTransfer || e.dataTransfer.items.length === 0) return\n const dataTransferItem = e.dataTransfer.items[0]\n\n // 检查事件对象中是否存在图片,存在则插入图片,否则继续检查是否存在文字,存在则插入文字\n if (dataTransferItem.kind === 'file' && dataTransferItem.type.indexOf('image') !== -1) {\n const imageFile = dataTransferItem.getAsFile()\n if (imageFile) {\n getImageDataURL(imageFile).then(dataURL => createImageElement(dataURL))\n }\n }\n else if (dataTransferItem.kind === 'string' && dataTransferItem.type === 'text/plain') {\n dataTransferItem.getAsString(text => {\n if (disableHotkeys.value) return\n const string = parseText2Paragraphs(text)\n createTextElement({\n left: 0,\n top: 0,\n width: 600,\n height: 50,\n }, string)\n })\n }\n }\n\n onMounted(() => {\n elementRef.value && elementRef.value.addEventListener('drop', handleDrop)\n\n document.ondragleave = e => e.preventDefault()\n document.ondrop = e => e.preventDefault()\n document.ondragenter = e => e.preventDefault()\n document.ondragover = e => e.preventDefault()\n })\n onUnmounted(() => {\n elementRef.value && elementRef.value.removeEventListener('drop', handleDrop)\n\n document.ondragleave = null\n document.ondrop = null\n document.ondragenter = null\n document.ondragover = null\n })\n}","import { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement, PPTLineElement, PPTVideoElement, PPTAudioElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n/**\n * 计算给定坐标到原点连线的弧度\n * @param x 坐标x\n * @param y 坐标y\n */\nconst getAngleFromCoordinate = (x: number, y: number) => {\n const radian = Math.atan2(x, y)\n const angle = 180 / Math.PI * radian\n return angle\n}\n\nexport default (elementList: Ref, viewportRef: Ref) => {\n const slidesStore = useSlidesStore()\n const { canvasScale } = storeToRefs(useMainStore())\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 旋转元素\n const rotateElement = (element: Exclude) => {\n let isMouseDown = true\n let angle = 0\n const elOriginRotate = element.rotate || 0\n\n const elLeft = element.left\n const elTop = element.top\n const elWidth = element.width\n const elHeight = element.height\n\n // 元素中心点(旋转中心点)\n const centerX = elLeft + elWidth / 2\n const centerY = elTop + elHeight / 2\n\n if (!viewportRef.value) return\n const viewportRect = viewportRef.value.getBoundingClientRect()\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n \n // 计算当前鼠标位置相对元素中心点连线的角度(弧度)\n const mouseX = (e.pageX - viewportRect.left) / canvasScale.value\n const mouseY = (e.pageY - viewportRect.top) / canvasScale.value\n const x = mouseX - centerX\n const y = centerY - mouseY\n\n angle = getAngleFromCoordinate(x, y)\n\n // 靠近45倍数的角度时有吸附效果\n const sorptionRange = 5\n if ( Math.abs(angle) <= sorptionRange ) angle = 0\n else if ( angle > 0 && Math.abs(angle - 45) <= sorptionRange ) angle -= (angle - 45)\n else if ( angle < 0 && Math.abs(angle + 45) <= sorptionRange ) angle -= (angle + 45)\n else if ( angle > 0 && Math.abs(angle - 90) <= sorptionRange ) angle -= (angle - 90)\n else if ( angle < 0 && Math.abs(angle + 90) <= sorptionRange ) angle -= (angle + 90)\n else if ( angle > 0 && Math.abs(angle - 135) <= sorptionRange ) angle -= (angle - 135)\n else if ( angle < 0 && Math.abs(angle + 135) <= sorptionRange ) angle -= (angle + 135)\n else if ( angle > 0 && Math.abs(angle - 180) <= sorptionRange ) angle -= (angle - 180)\n else if ( angle < 0 && Math.abs(angle + 180) <= sorptionRange ) angle -= (angle + 180)\n\n elementList.value = elementList.value.map(el => element.id === el.id ? { ...el, rotate: angle } : el)\n }\n\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n if (elOriginRotate === angle) return\n\n slidesStore.updateSlide({ elements: elementList.value })\n addHistorySnapshot()\n }\n }\n\n return {\n rotateElement,\n }\n}","export const ELEMENT_TYPE_ZH = {\n text: '文本',\n image: '图片',\n shape: '形状',\n line: '线条',\n chart: '图表',\n table: '表格',\n video: '视频',\n audio: '音频',\n}\n\nexport const MIN_SIZE = {\n text: 20,\n image: 20,\n shape: 15,\n chart: 200,\n table: 20,\n video: 250,\n audio: 20,\n}","import { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore, useKeyboardStore } from '@/store'\nimport { PPTElement, PPTImageElement, PPTLineElement, PPTShapeElement } from '@/types/slides'\nimport { OperateResizeHandlers, AlignmentLineProps, MultiSelectRange } from '@/types/edit'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport { MIN_SIZE } from '@/configs/element'\nimport { SHAPE_PATH_FORMULAS } from '@/configs/shapes'\nimport { AlignLine, uniqAlignLines } from '@/utils/element'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface RotateElementData {\n left: number\n top: number\n width: number\n height: number\n}\n\n/**\n * 计算旋转后的元素八个缩放点的位置\n * @param element 元素原始位置大小信息\n * @param angle 旋转角度\n */\nconst getRotateElementPoints = (element: RotateElementData, angle: number) => {\n const { left, top, width, height } = element\n\n const radius = Math.sqrt( Math.pow(width, 2) + Math.pow(height, 2) ) / 2\n const auxiliaryAngle = Math.atan(height / width) * 180 / Math.PI\n\n const tlbraRadian = (180 - angle - auxiliaryAngle) * Math.PI / 180\n const trblaRadian = (auxiliaryAngle - angle) * Math.PI / 180\n const taRadian = (90 - angle) * Math.PI / 180\n const raRadian = angle * Math.PI / 180\n\n const halfWidth = width / 2\n const halfHeight = height / 2\n\n const middleLeft = left + halfWidth\n const middleTop = top + halfHeight\n\n const leftTopPoint = {\n left: middleLeft + radius * Math.cos(tlbraRadian),\n top: middleTop - radius * Math.sin(tlbraRadian),\n }\n const topPoint = {\n left: middleLeft + halfHeight * Math.cos(taRadian),\n top: middleTop - halfHeight * Math.sin(taRadian),\n }\n const rightTopPoint = {\n left: middleLeft + radius * Math.cos(trblaRadian),\n top: middleTop - radius * Math.sin(trblaRadian),\n }\n const rightPoint = {\n left: middleLeft + halfWidth * Math.cos(raRadian),\n top: middleTop + halfWidth * Math.sin(raRadian),\n }\n const rightBottomPoint = {\n left: middleLeft - radius * Math.cos(tlbraRadian),\n top: middleTop + radius * Math.sin(tlbraRadian),\n }\n const bottomPoint = {\n left: middleLeft - halfHeight * Math.sin(raRadian),\n top: middleTop + halfHeight * Math.cos(raRadian),\n }\n const leftBottomPoint = {\n left: middleLeft - radius * Math.cos(trblaRadian),\n top: middleTop + radius * Math.sin(trblaRadian),\n }\n const leftPoint = {\n left: middleLeft - halfWidth * Math.cos(raRadian),\n top: middleTop - halfWidth * Math.sin(raRadian),\n }\n\n return { leftTopPoint, topPoint, rightTopPoint, rightPoint, rightBottomPoint, bottomPoint, leftBottomPoint, leftPoint }\n}\n\n/**\n * 获取元素某缩放点相对的另一个点的位置,如:【上】对应【下】、【左上】对应【右下】\n * @param direction 当前操作的缩放点\n * @param points 旋转后的元素八个缩放点的位置\n */\nconst getOppositePoint = (direction: string, points: ReturnType): { left: number; top: number } => {\n const oppositeMap = {\n [OperateResizeHandlers.RIGHT_BOTTOM]: points.leftTopPoint,\n [OperateResizeHandlers.LEFT_BOTTOM]: points.rightTopPoint,\n [OperateResizeHandlers.LEFT_TOP]: points.rightBottomPoint,\n [OperateResizeHandlers.RIGHT_TOP]: points.leftBottomPoint,\n [OperateResizeHandlers.TOP]: points.bottomPoint,\n [OperateResizeHandlers.BOTTOM]: points.topPoint,\n [OperateResizeHandlers.LEFT]: points.rightPoint,\n [OperateResizeHandlers.RIGHT]: points.leftPoint,\n }\n return oppositeMap[direction]\n}\n\nexport default (\n elementList: Ref,\n alignmentLines: Ref,\n canvasScale: Ref,\n) => {\n const mainStore = useMainStore()\n const slidesStore = useSlidesStore()\n const { activeElementIdList, activeGroupElementId } = storeToRefs(mainStore)\n const { viewportRatio } = storeToRefs(slidesStore)\n const { ctrlOrShiftKeyActive } = storeToRefs(useKeyboardStore())\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 缩放元素\n const scaleElement = (e: MouseEvent | TouchEvent, element: Exclude, command: OperateResizeHandlers) => {\n const isTouchEvent = !(e instanceof MouseEvent)\n if (isTouchEvent && (!e.changedTouches || !e.changedTouches[0])) return\n\n let isMouseDown = true\n mainStore.setScalingState(true)\n\n const elOriginLeft = element.left\n const elOriginTop = element.top\n const elOriginWidth = element.width\n const elOriginHeight = element.height\n \n const elRotate = ('rotate' in element && element.rotate) ? element.rotate : 0\n const rotateRadian = Math.PI * elRotate / 180\n\n const fixedRatio = ctrlOrShiftKeyActive.value || ('fixedRatio' in element && element.fixedRatio)\n const aspectRatio = elOriginWidth / elOriginHeight\n\n const startPageX = isTouchEvent ? e.changedTouches[0].pageX : e.pageX\n const startPageY = isTouchEvent ? e.changedTouches[0].pageY : e.pageY\n\n // 元素最小缩放限制\n const minSize = MIN_SIZE[element.type] || 20\n const getSizeWithinRange = (size: number) => size < minSize ? minSize : size\n\n let points: ReturnType\n let baseLeft = 0\n let baseTop = 0\n let horizontalLines: AlignLine[] = []\n let verticalLines: AlignLine[] = []\n\n // 旋转后的元素进行缩放时,引入基点的概念,以当前操作的缩放点相对的点为基点\n // 例如拖动右下角缩放时,左上角为基点,需要保持左上角不变然后修改其他的点的位置来达到所放的效果\n if ('rotate' in element && element.rotate) {\n const { left, top, width, height } = element\n points = getRotateElementPoints({ left, top, width, height }, elRotate)\n const oppositePoint = getOppositePoint(command, points)\n\n baseLeft = oppositePoint.left\n baseTop = oppositePoint.top\n }\n\n // 未旋转的元素具有缩放时的对齐吸附功能,在此处收集对齐对齐吸附线\n // 包括页面内除目标元素外的其他元素在画布中的各个可吸附对齐位置:上下左右四边\n // 其中线条和被旋转过的元素不参与吸附对齐\n else {\n const edgeWidth = VIEWPORT_SIZE\n const edgeHeight = VIEWPORT_SIZE * viewportRatio.value\n const isActiveGroupElement = element.id === activeGroupElementId.value\n \n for (const el of elementList.value) {\n if ('rotate' in el && el.rotate) continue\n if (el.type === 'line') continue\n if (isActiveGroupElement && el.id === element.id) continue\n if (!isActiveGroupElement && activeElementIdList.value.includes(el.id)) continue\n\n const left = el.left\n const top = el.top\n const width = el.width\n const height = el.height\n const right = left + width\n const bottom = top + height\n\n const topLine: AlignLine = { value: top, range: [left, right] }\n const bottomLine: AlignLine = { value: bottom, range: [left, right] }\n const leftLine: AlignLine = { value: left, range: [top, bottom] }\n const rightLine: AlignLine = { value: right, range: [top, bottom] }\n\n horizontalLines.push(topLine, bottomLine)\n verticalLines.push(leftLine, rightLine)\n }\n\n // 画布可视区域的四个边界、水平中心、垂直中心\n const edgeTopLine: AlignLine = { value: 0, range: [0, edgeWidth] }\n const edgeBottomLine: AlignLine = { value: edgeHeight, range: [0, edgeWidth] }\n const edgeHorizontalCenterLine: AlignLine = { value: edgeHeight / 2, range: [0, edgeWidth] }\n const edgeLeftLine: AlignLine = { value: 0, range: [0, edgeHeight] }\n const edgeRightLine: AlignLine = { value: edgeWidth, range: [0, edgeHeight] }\n const edgeVerticalCenterLine: AlignLine = { value: edgeWidth / 2, range: [0, edgeHeight] }\n\n horizontalLines.push(edgeTopLine, edgeBottomLine, edgeHorizontalCenterLine)\n verticalLines.push(edgeLeftLine, edgeRightLine, edgeVerticalCenterLine)\n \n horizontalLines = uniqAlignLines(horizontalLines)\n verticalLines = uniqAlignLines(verticalLines)\n }\n \n // 对齐吸附方法\n // 将收集到的对齐吸附线与计算的目标元素当前的位置大小相关数据做对比,差值小于设定的值时执行自动缩放校正\n // 水平和垂直两个方向需要分开计算\n const alignedAdsorption = (currentX: number | null, currentY: number | null) => {\n const sorptionRange = 5\n\n const _alignmentLines: AlignmentLineProps[] = []\n let isVerticalAdsorbed = false\n let isHorizontalAdsorbed = false\n const correctionVal = { offsetX: 0, offsetY: 0 }\n \n if (currentY || currentY === 0) {\n for (let i = 0; i < horizontalLines.length; i++) {\n const { value, range } = horizontalLines[i]\n const min = Math.min(...range, currentX || 0)\n const max = Math.max(...range, currentX || 0)\n \n if (Math.abs(currentY - value) < sorptionRange && !isHorizontalAdsorbed) {\n correctionVal.offsetY = currentY - value\n isHorizontalAdsorbed = true\n _alignmentLines.push({ type: 'horizontal', axis: {x: min - 50, y: value}, length: max - min + 100 })\n }\n }\n }\n if (currentX || currentX === 0) {\n for (let i = 0; i < verticalLines.length; i++) {\n const { value, range } = verticalLines[i]\n const min = Math.min(...range, (currentY || 0))\n const max = Math.max(...range, (currentY || 0))\n\n if (Math.abs(currentX - value) < sorptionRange && !isVerticalAdsorbed) {\n correctionVal.offsetX = currentX - value\n isVerticalAdsorbed = true\n _alignmentLines.push({ type: 'vertical', axis: {x: value, y: min - 50}, length: max - min + 100 })\n }\n }\n }\n alignmentLines.value = _alignmentLines\n return correctionVal\n }\n\n const handleMousemove = (e: MouseEvent | TouchEvent) => {\n if (!isMouseDown) return\n\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n\n const x = currentPageX - startPageX\n const y = currentPageY - startPageY\n\n let width = elOriginWidth\n let height = elOriginHeight\n let left = elOriginLeft\n let top = elOriginTop\n \n // 元素被旋转的情况下,需要根据元素旋转的角度,重新计算需要缩放的距离(鼠标按下后移动的距离)\n if (elRotate) {\n const revisedX = (Math.cos(rotateRadian) * x + Math.sin(rotateRadian) * y) / canvasScale.value\n let revisedY = (Math.cos(rotateRadian) * y - Math.sin(rotateRadian) * x) / canvasScale.value\n\n // 锁定宽高比例(仅四个角可能触发,四条边不会触发)\n // 以水平方向上缩放的距离为基础,计算垂直方向上的缩放距离,保持二者具有相同的缩放比例\n if (fixedRatio) {\n if (command === OperateResizeHandlers.RIGHT_BOTTOM || command === OperateResizeHandlers.LEFT_TOP) revisedY = revisedX / aspectRatio\n if (command === OperateResizeHandlers.LEFT_BOTTOM || command === OperateResizeHandlers.RIGHT_TOP) revisedY = -revisedX / aspectRatio\n }\n\n // 根据不同的操作点分别计算元素缩放后的大小和位置\n // 需要注意:\n // 此处计算的位置需要在后面重新进行校正,因为旋转后再缩放事实上会改变元素基点的位置(虽然视觉上基点保持不动,但这是【旋转】+【移动】共同作用的结果)\n // 但此处计算的大小不需要重新校正,因为前面已经重新计算需要缩放的距离,相当于大小已经经过了校正\n if (command === OperateResizeHandlers.RIGHT_BOTTOM) {\n width = getSizeWithinRange(elOriginWidth + revisedX)\n height = getSizeWithinRange(elOriginHeight + revisedY)\n }\n else if (command === OperateResizeHandlers.LEFT_BOTTOM) {\n width = getSizeWithinRange(elOriginWidth - revisedX)\n height = getSizeWithinRange(elOriginHeight + revisedY)\n left = elOriginLeft - (width - elOriginWidth)\n }\n else if (command === OperateResizeHandlers.LEFT_TOP) {\n width = getSizeWithinRange(elOriginWidth - revisedX)\n height = getSizeWithinRange(elOriginHeight - revisedY)\n left = elOriginLeft - (width - elOriginWidth)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.RIGHT_TOP) {\n width = getSizeWithinRange(elOriginWidth + revisedX)\n height = getSizeWithinRange(elOriginHeight - revisedY)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.TOP) {\n height = getSizeWithinRange(elOriginHeight - revisedY)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.BOTTOM) {\n height = getSizeWithinRange(elOriginHeight + revisedY)\n }\n else if (command === OperateResizeHandlers.LEFT) {\n width = getSizeWithinRange(elOriginWidth - revisedX)\n left = elOriginLeft - (width - elOriginWidth)\n }\n else if (command === OperateResizeHandlers.RIGHT) {\n width = getSizeWithinRange(elOriginWidth + revisedX)\n }\n\n // 获取当前元素的基点坐标,与初始状态时的基点坐标进行对比,并计算差值进行元素位置的校正\n const currentPoints = getRotateElementPoints({ width, height, left, top }, elRotate)\n const currentOppositePoint = getOppositePoint(command, currentPoints)\n const currentBaseLeft = currentOppositePoint.left\n const currentBaseTop = currentOppositePoint.top\n\n const offsetX = currentBaseLeft - baseLeft\n const offsetY = currentBaseTop - baseTop\n\n left = left - offsetX\n top = top - offsetY\n }\n\n // 元素未被旋转的情况下,正常计算新的位置大小即可,无需复杂的校正等工作\n // 额外需要处理对齐吸附相关的操作\n // 锁定宽高比例相关的操作同上,不再赘述\n else {\n let moveX = x / canvasScale.value\n let moveY = y / canvasScale.value\n\n if (fixedRatio) {\n if (command === OperateResizeHandlers.RIGHT_BOTTOM || command === OperateResizeHandlers.LEFT_TOP) moveY = moveX / aspectRatio\n if (command === OperateResizeHandlers.LEFT_BOTTOM || command === OperateResizeHandlers.RIGHT_TOP) moveY = -moveX / aspectRatio\n }\n\n if (command === OperateResizeHandlers.RIGHT_BOTTOM) {\n const { offsetX, offsetY } = alignedAdsorption(elOriginLeft + elOriginWidth + moveX, elOriginTop + elOriginHeight + moveY)\n moveX = moveX - offsetX\n moveY = moveY - offsetY\n if (fixedRatio) {\n if (offsetY) moveX = moveY * aspectRatio\n else moveY = moveX / aspectRatio\n }\n width = getSizeWithinRange(elOriginWidth + moveX)\n height = getSizeWithinRange(elOriginHeight + moveY)\n }\n else if (command === OperateResizeHandlers.LEFT_BOTTOM) {\n const { offsetX, offsetY } = alignedAdsorption(elOriginLeft + moveX, elOriginTop + elOriginHeight + moveY)\n moveX = moveX - offsetX\n moveY = moveY - offsetY\n if (fixedRatio) {\n if (offsetY) moveX = -moveY * aspectRatio\n else moveY = -moveX / aspectRatio\n }\n width = getSizeWithinRange(elOriginWidth - moveX)\n height = getSizeWithinRange(elOriginHeight + moveY)\n left = elOriginLeft - (width - elOriginWidth)\n }\n else if (command === OperateResizeHandlers.LEFT_TOP) {\n const { offsetX, offsetY } = alignedAdsorption(elOriginLeft + moveX, elOriginTop + moveY)\n moveX = moveX - offsetX\n moveY = moveY - offsetY\n if (fixedRatio) {\n if (offsetY) moveX = moveY * aspectRatio\n else moveY = moveX / aspectRatio\n }\n width = getSizeWithinRange(elOriginWidth - moveX)\n height = getSizeWithinRange(elOriginHeight - moveY)\n left = elOriginLeft - (width - elOriginWidth)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.RIGHT_TOP) {\n const { offsetX, offsetY } = alignedAdsorption(elOriginLeft + elOriginWidth + moveX, elOriginTop + moveY)\n moveX = moveX - offsetX\n moveY = moveY - offsetY\n if (fixedRatio) {\n if (offsetY) moveX = -moveY * aspectRatio\n else moveY = -moveX / aspectRatio\n }\n width = getSizeWithinRange(elOriginWidth + moveX)\n height = getSizeWithinRange(elOriginHeight - moveY)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.LEFT) {\n const { offsetX } = alignedAdsorption(elOriginLeft + moveX, null)\n moveX = moveX - offsetX\n width = getSizeWithinRange(elOriginWidth - moveX)\n left = elOriginLeft - (width - elOriginWidth)\n }\n else if (command === OperateResizeHandlers.RIGHT) {\n const { offsetX } = alignedAdsorption(elOriginLeft + elOriginWidth + moveX, null)\n moveX = moveX - offsetX\n width = getSizeWithinRange(elOriginWidth + moveX)\n }\n else if (command === OperateResizeHandlers.TOP) {\n const { offsetY } = alignedAdsorption(null, elOriginTop + moveY)\n moveY = moveY - offsetY\n height = getSizeWithinRange(elOriginHeight - moveY)\n top = elOriginTop - (height - elOriginHeight)\n }\n else if (command === OperateResizeHandlers.BOTTOM) {\n const { offsetY } = alignedAdsorption(null, elOriginTop + elOriginHeight + moveY)\n moveY = moveY - offsetY\n height = getSizeWithinRange(elOriginHeight + moveY)\n }\n }\n \n elementList.value = elementList.value.map(el => {\n if (element.id !== el.id) return el\n if (el.type === 'shape' && 'pathFormula' in el && el.pathFormula) {\n const pathFormula = SHAPE_PATH_FORMULAS[el.pathFormula]\n\n let path = ''\n if ('editable' in pathFormula) path = pathFormula.formula(width, height, el.keypoint!)\n else path = pathFormula.formula(width, height)\n\n return {\n ...el, left, top, width, height,\n viewBox: [width, height],\n path,\n }\n }\n return { ...el, left, top, width, height }\n })\n }\n\n const handleMouseup = (e: MouseEvent | TouchEvent) => {\n isMouseDown = false\n \n document.ontouchmove = null\n document.ontouchend = null\n document.onmousemove = null\n document.onmouseup = null\n\n alignmentLines.value = []\n\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n \n if (startPageX === currentPageX && startPageY === currentPageY) return\n \n slidesStore.updateSlide({ elements: elementList.value })\n mainStore.setScalingState(false)\n \n addHistorySnapshot()\n }\n\n if (isTouchEvent) {\n document.ontouchmove = handleMousemove\n document.ontouchend = handleMouseup\n }\n else {\n document.onmousemove = handleMousemove\n document.onmouseup = handleMouseup\n }\n }\n\n // 多选元素缩放\n const scaleMultiElement = (e: MouseEvent, range: MultiSelectRange, command: OperateResizeHandlers) => {\n let isMouseDown = true\n \n const { minX, maxX, minY, maxY } = range\n const operateWidth = maxX - minX\n const operateHeight = maxY - minY\n const aspectRatio = operateWidth / operateHeight\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n\n const originElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList.value))\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n \n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n const x = (currentPageX - startPageX) / canvasScale.value\n let y = (currentPageY - startPageY) / canvasScale.value\n\n // 锁定宽高比例,逻辑同上\n if (ctrlOrShiftKeyActive.value) {\n if (command === OperateResizeHandlers.RIGHT_BOTTOM || command === OperateResizeHandlers.LEFT_TOP) y = x / aspectRatio\n if (command === OperateResizeHandlers.LEFT_BOTTOM || command === OperateResizeHandlers.RIGHT_TOP) y = -x / aspectRatio\n }\n\n // 所有选中元素的整体范围\n let currentMinX = minX\n let currentMaxX = maxX\n let currentMinY = minY\n let currentMaxY = maxY\n\n if (command === OperateResizeHandlers.RIGHT_BOTTOM) {\n currentMaxX = maxX + x\n currentMaxY = maxY + y\n }\n else if (command === OperateResizeHandlers.LEFT_BOTTOM) {\n currentMinX = minX + x\n currentMaxY = maxY + y\n }\n else if (command === OperateResizeHandlers.LEFT_TOP) {\n currentMinX = minX + x\n currentMinY = minY + y\n }\n else if (command === OperateResizeHandlers.RIGHT_TOP) {\n currentMaxX = maxX + x\n currentMinY = minY + y\n }\n else if (command === OperateResizeHandlers.TOP) {\n currentMinY = minY + y\n }\n else if (command === OperateResizeHandlers.BOTTOM) {\n currentMaxY = maxY + y\n }\n else if (command === OperateResizeHandlers.LEFT) {\n currentMinX = minX + x\n }\n else if (command === OperateResizeHandlers.RIGHT) {\n currentMaxX = maxX + x\n }\n\n // 所有选中元素的整体宽高\n const currentOppositeWidth = currentMaxX - currentMinX\n const currentOppositeHeight = currentMaxY - currentMinY\n\n // 当前正在操作元素宽高占所有选中元素的整体宽高的比例\n let widthScale = currentOppositeWidth / operateWidth\n let heightScale = currentOppositeHeight / operateHeight\n\n if (widthScale <= 0) widthScale = 0\n if (heightScale <= 0) heightScale = 0\n \n // 根据前面计算的比例,计算并修改所有选中元素的位置大小\n elementList.value = elementList.value.map(el => {\n if ((el.type === 'image' || el.type === 'shape') && activeElementIdList.value.includes(el.id)) {\n const originElement = originElementList.find(originEl => originEl.id === el.id) as PPTImageElement | PPTShapeElement\n return {\n ...el,\n width: originElement.width * widthScale,\n height: originElement.height * heightScale,\n left: currentMinX + (originElement.left - minX) * widthScale,\n top: currentMinY + (originElement.top - minY) * heightScale,\n }\n }\n return el\n })\n }\n\n document.onmouseup = e => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n if (startPageX === e.pageX && startPageY === e.pageY) return\n\n slidesStore.updateSlide({ elements: elementList.value })\n addHistorySnapshot()\n }\n }\n\n return {\n scaleElement,\n scaleMultiElement,\n }\n}","import { Ref } from 'vue'\nimport { uniq } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useKeyboardStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\n\nexport default (\n elementList: Ref,\n moveElement: (e: MouseEvent | TouchEvent, element: PPTElement) => void,\n) => {\n const mainStore = useMainStore()\n const { activeElementIdList, activeGroupElementId, handleElementId, editorAreaFocus } = storeToRefs(mainStore)\n const { ctrlOrShiftKeyActive } = storeToRefs(useKeyboardStore())\n\n // 选中元素\n // startMove 表示是否需要再选中操作后进入到开始移动的状态\n const selectElement = (e: MouseEvent | TouchEvent, element: PPTElement, startMove = true) => {\n if (!editorAreaFocus.value) mainStore.setEditorareaFocus(true)\n\n // 如果目标元素当前未被选中,则将他设为选中状态\n // 此时如果按下Ctrl键或Shift键,则进入多选状态,将当前已选中的元素和目标元素一起设置为选中状态,否则仅将目标元素设置为选中状态\n // 如果目标元素是分组成员,需要将该组合的其他元素一起设置为选中状态\n if (!activeElementIdList.value.includes(element.id)) {\n let newActiveIdList: string[] = []\n\n if (ctrlOrShiftKeyActive.value) {\n newActiveIdList = [...activeElementIdList.value, element.id]\n }\n else newActiveIdList = [element.id]\n \n if (element.groupId) {\n const groupMembersId: string[] = []\n elementList.value.forEach((el: PPTElement) => {\n if (el.groupId === element.groupId) groupMembersId.push(el.id)\n })\n newActiveIdList = [...newActiveIdList, ...groupMembersId]\n }\n\n mainStore.setActiveElementIdList(uniq(newActiveIdList))\n mainStore.setHandleElementId(element.id)\n }\n\n // 如果目标元素已被选中,且按下了Ctrl键或Shift键,则取消其被选中状态\n // 除非目标元素是最后的一个被选中元素,或者目标元素所在的组合是最后一组选中组合\n // 如果目标元素是分组成员,需要将该组合的其他元素一起取消选中状态\n else if (ctrlOrShiftKeyActive.value) {\n let newActiveIdList: string[] = []\n\n if (element.groupId) {\n const groupMembersId: string[] = []\n elementList.value.forEach((el: PPTElement) => {\n if (el.groupId === element.groupId) groupMembersId.push(el.id)\n })\n newActiveIdList = activeElementIdList.value.filter(id => !groupMembersId.includes(id))\n }\n else {\n newActiveIdList = activeElementIdList.value.filter(id => id !== element.id)\n }\n\n if (newActiveIdList.length > 0) {\n mainStore.setActiveElementIdList(newActiveIdList)\n }\n }\n\n // 如果目标元素已被选中,同时目标元素不是当前操作元素,则将其设置为当前操作元素\n else if (handleElementId.value !== element.id) {\n mainStore.setHandleElementId(element.id)\n }\n\n // 如果目标元素已被选中,同时也是当前操作元素,那么当目标元素在该状态下再次被点击时,将被设置为多选元素中的激活成员\n else if (activeGroupElementId.value !== element.id) {\n const startPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const startPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n\n ;(e.target as HTMLElement).onmouseup = (e: MouseEvent) => {\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n if (startPageX === currentPageX && startPageY === currentPageY) {\n mainStore.setActiveGroupElementId(element.id)\n ;(e.target as HTMLElement).onmouseup = null\n }\n }\n }\n\n if (startMove) moveElement(e, element)\n }\n\n // 选中页面内的全部元素\n const selectAllElement = () => {\n const unlockedElements = elementList.value.filter(el => !el.lock)\n const newActiveElementIdList = unlockedElements.map(el => el.id)\n mainStore.setActiveElementIdList(newActiveElementIdList)\n }\n\n return {\n selectElement,\n selectAllElement,\n }\n}\n","import { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { AlignmentLineProps } from '@/types/edit'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport { getRectRotatedRange, AlignLine, uniqAlignLines } from '@/utils/element'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nexport default (\n elementList: Ref,\n alignmentLines: Ref,\n canvasScale: Ref,\n) => {\n const slidesStore = useSlidesStore()\n const { activeElementIdList, activeGroupElementId } = storeToRefs(useMainStore())\n const { viewportRatio } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n const dragElement = (e: MouseEvent | TouchEvent, element: PPTElement) => {\n const isTouchEvent = !(e instanceof MouseEvent)\n if (isTouchEvent && (!e.changedTouches || !e.changedTouches[0])) return\n\n if (!activeElementIdList.value.includes(element.id)) return\n let isMouseDown = true\n\n const edgeWidth = VIEWPORT_SIZE\n const edgeHeight = VIEWPORT_SIZE * viewportRatio.value\n \n const sorptionRange = 5\n\n const originElementList: PPTElement[] = JSON.parse(JSON.stringify(elementList.value))\n const originActiveElementList = originElementList.filter(el => activeElementIdList.value.includes(el.id))\n \n const elOriginLeft = element.left\n const elOriginTop = element.top\n const elOriginWidth = element.width\n const elOriginHeight = ('height' in element && element.height) ? element.height : 0\n const elOriginRotate = ('rotate' in element && element.rotate) ? element.rotate : 0\n \n const startPageX = isTouchEvent ? e.changedTouches[0].pageX : e.pageX\n const startPageY = isTouchEvent ? e.changedTouches[0].pageY : e.pageY\n\n let isMisoperation: boolean | null = null\n\n const isActiveGroupElement = element.id === activeGroupElementId.value\n\n // 收集对齐对齐吸附线\n // 包括页面内除目标元素外的其他元素在画布中的各个可吸附对齐位置:上下左右四边,水平中心、垂直中心\n // 其中线条和被旋转过的元素需要重新计算他们在画布中的中心点位置的范围\n let horizontalLines: AlignLine[] = []\n let verticalLines: AlignLine[] = []\n\n for (const el of elementList.value) {\n if (el.type === 'line') continue\n if (isActiveGroupElement && el.id === element.id) continue\n if (!isActiveGroupElement && activeElementIdList.value.includes(el.id)) continue\n\n let left, top, width, height\n if ('rotate' in el && el.rotate) {\n const { xRange, yRange } = getRectRotatedRange({\n left: el.left,\n top: el.top,\n width: el.width,\n height: el.height,\n rotate: el.rotate,\n })\n left = xRange[0]\n top = yRange[0]\n width = xRange[1] - xRange[0]\n height = yRange[1] - yRange[0]\n }\n else {\n left = el.left\n top = el.top\n width = el.width\n height = el.height\n }\n \n const right = left + width\n const bottom = top + height\n const centerX = top + height / 2\n const centerY = left + width / 2\n\n const topLine: AlignLine = { value: top, range: [left, right] }\n const bottomLine: AlignLine = { value: bottom, range: [left, right] }\n const horizontalCenterLine: AlignLine = { value: centerX, range: [left, right] }\n const leftLine: AlignLine = { value: left, range: [top, bottom] }\n const rightLine: AlignLine = { value: right, range: [top, bottom] }\n const verticalCenterLine: AlignLine = { value: centerY, range: [top, bottom] }\n\n horizontalLines.push(topLine, bottomLine, horizontalCenterLine)\n verticalLines.push(leftLine, rightLine, verticalCenterLine)\n }\n\n // 画布可视区域的四个边界、水平中心、垂直中心\n const edgeTopLine: AlignLine = { value: 0, range: [0, edgeWidth] }\n const edgeBottomLine: AlignLine = { value: edgeHeight, range: [0, edgeWidth] }\n const edgeHorizontalCenterLine: AlignLine = { value: edgeHeight / 2, range: [0, edgeWidth] }\n const edgeLeftLine: AlignLine = { value: 0, range: [0, edgeHeight] }\n const edgeRightLine: AlignLine = { value: edgeWidth, range: [0, edgeHeight] }\n const edgeVerticalCenterLine: AlignLine = { value: edgeWidth / 2, range: [0, edgeHeight] }\n\n horizontalLines.push(edgeTopLine, edgeBottomLine, edgeHorizontalCenterLine)\n verticalLines.push(edgeLeftLine, edgeRightLine, edgeVerticalCenterLine)\n \n // 对齐吸附线去重\n horizontalLines = uniqAlignLines(horizontalLines)\n verticalLines = uniqAlignLines(verticalLines)\n\n const handleMousemove = (e: MouseEvent | TouchEvent) => {\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n\n // 如果鼠标滑动距离过小,则将操作判定为误操作:\n // 如果误操作标记为null,表示是第一次触发移动,需要计算当前是否是误操作\n // 如果误操作标记为true,表示当前还处在误操作范围内,但仍然需要继续计算检查后续操作是否还处于误操作\n // 如果误操作标记为false,表示已经脱离了误操作范围,不需要再次计算\n if (isMisoperation !== false) {\n isMisoperation = Math.abs(startPageX - currentPageX) < sorptionRange && \n Math.abs(startPageY - currentPageY) < sorptionRange\n }\n if (!isMouseDown || isMisoperation) return\n\n const moveX = (currentPageX - startPageX) / canvasScale.value\n const moveY = (currentPageY - startPageY) / canvasScale.value\n\n // 基础目标位置\n let targetLeft = elOriginLeft + moveX\n let targetTop = elOriginTop + moveY\n\n // 计算目标元素在画布中的位置范围,用于吸附对齐\n // 需要区分单选和多选两种情况,其中多选状态下需要计算多选元素的整体范围;单选状态下需要继续区分线条、普通元素、旋转后的普通元素三种情况\n let targetMinX: number, targetMaxX: number, targetMinY: number, targetMaxY: number\n\n if (activeElementIdList.value.length === 1 || isActiveGroupElement) {\n if (elOriginRotate) {\n const { xRange, yRange } = getRectRotatedRange({\n left: targetLeft,\n top: targetTop,\n width: elOriginWidth,\n height: elOriginHeight,\n rotate: elOriginRotate,\n })\n targetMinX = xRange[0]\n targetMaxX = xRange[1]\n targetMinY = yRange[0]\n targetMaxY = yRange[1]\n }\n else if (element.type === 'line') {\n targetMinX = targetLeft\n targetMaxX = targetLeft + Math.max(element.start[0], element.end[0])\n targetMinY = targetTop\n targetMaxY = targetTop + Math.max(element.start[1], element.end[1])\n }\n else {\n targetMinX = targetLeft\n targetMaxX = targetLeft + elOriginWidth\n targetMinY = targetTop\n targetMaxY = targetTop + elOriginHeight\n }\n }\n else {\n const leftValues = []\n const topValues = []\n const rightValues = []\n const bottomValues = []\n \n for (let i = 0; i < originActiveElementList.length; i++) {\n const element = originActiveElementList[i]\n const left = element.left + moveX\n const top = element.top + moveY\n const width = element.width\n const height = ('height' in element && element.height) ? element.height : 0\n const rotate = ('rotate' in element && element.rotate) ? element.rotate : 0\n\n if ('rotate' in element && element.rotate) {\n const { xRange, yRange } = getRectRotatedRange({ left, top, width, height, rotate })\n leftValues.push(xRange[0])\n topValues.push(yRange[0])\n rightValues.push(xRange[1])\n bottomValues.push(yRange[1])\n }\n else if (element.type === 'line') {\n leftValues.push(left)\n topValues.push(top)\n rightValues.push(left + Math.max(element.start[0], element.end[0]))\n bottomValues.push(top + Math.max(element.start[1], element.end[1]))\n }\n else {\n leftValues.push(left)\n topValues.push(top)\n rightValues.push(left + width)\n bottomValues.push(top + height)\n }\n }\n\n targetMinX = Math.min(...leftValues)\n targetMaxX = Math.max(...rightValues)\n targetMinY = Math.min(...topValues)\n targetMaxY = Math.max(...bottomValues)\n }\n \n const targetCenterX = targetMinX + (targetMaxX - targetMinX) / 2\n const targetCenterY = targetMinY + (targetMaxY - targetMinY) / 2\n\n // 将收集到的对齐吸附线与计算的目标元素位置范围做对比,二者的差小于设定的值时执行自动对齐校正\n // 水平和垂直两个方向需要分开计算\n const _alignmentLines: AlignmentLineProps[] = []\n let isVerticalAdsorbed = false\n let isHorizontalAdsorbed = false\n for (let i = 0; i < horizontalLines.length; i++) {\n const { value, range } = horizontalLines[i]\n const min = Math.min(...range, targetMinX, targetMaxX)\n const max = Math.max(...range, targetMinX, targetMaxX)\n \n if (Math.abs(targetMinY - value) < sorptionRange && !isHorizontalAdsorbed) {\n targetTop = targetTop - (targetMinY - value)\n isHorizontalAdsorbed = true\n _alignmentLines.push({type: 'horizontal', axis: {x: min - 50, y: value}, length: max - min + 100})\n }\n if (Math.abs(targetMaxY - value) < sorptionRange && !isHorizontalAdsorbed) {\n targetTop = targetTop - (targetMaxY - value)\n isHorizontalAdsorbed = true\n _alignmentLines.push({type: 'horizontal', axis: {x: min - 50, y: value}, length: max - min + 100})\n }\n if (Math.abs(targetCenterY - value) < sorptionRange && !isHorizontalAdsorbed) {\n targetTop = targetTop - (targetCenterY - value)\n isHorizontalAdsorbed = true\n _alignmentLines.push({type: 'horizontal', axis: {x: min - 50, y: value}, length: max - min + 100})\n }\n }\n for (let i = 0; i < verticalLines.length; i++) {\n const { value, range } = verticalLines[i]\n const min = Math.min(...range, targetMinY, targetMaxY)\n const max = Math.max(...range, targetMinY, targetMaxY)\n\n if (Math.abs(targetMinX - value) < sorptionRange && !isVerticalAdsorbed) {\n targetLeft = targetLeft - (targetMinX - value)\n isVerticalAdsorbed = true\n _alignmentLines.push({type: 'vertical', axis: {x: value, y: min - 50}, length: max - min + 100})\n }\n if (Math.abs(targetMaxX - value) < sorptionRange && !isVerticalAdsorbed) {\n targetLeft = targetLeft - (targetMaxX - value)\n isVerticalAdsorbed = true\n _alignmentLines.push({type: 'vertical', axis: {x: value, y: min - 50}, length: max - min + 100})\n }\n if (Math.abs(targetCenterX - value) < sorptionRange && !isVerticalAdsorbed) {\n targetLeft = targetLeft - (targetCenterX - value)\n isVerticalAdsorbed = true\n _alignmentLines.push({type: 'vertical', axis: {x: value, y: min - 50}, length: max - min + 100})\n }\n }\n alignmentLines.value = _alignmentLines\n \n // 单选状态下,或者当前选中的多个元素中存在正在操作的元素时,仅修改正在操作的元素的位置\n if (activeElementIdList.value.length === 1 || isActiveGroupElement) {\n elementList.value = elementList.value.map(el => {\n return el.id === element.id ? { ...el, left: targetLeft, top: targetTop } : el\n })\n }\n\n // 多选状态下,除了修改正在操作的元素的位置,其他被选中的元素也需要修改位置信息\n // 其他被选中的元素的位置信息通过正在操作的元素的移动偏移量来进行计算\n else {\n const handleElement = elementList.value.find(el => el.id === element.id)\n if (!handleElement) return\n\n elementList.value = elementList.value.map(el => {\n if (activeElementIdList.value.includes(el.id)) {\n if (el.id === element.id) {\n return {\n ...el,\n left: targetLeft,\n top: targetTop,\n }\n }\n return {\n ...el,\n left: el.left + (targetLeft - handleElement.left),\n top: el.top + (targetTop - handleElement.top),\n }\n }\n return el\n })\n }\n }\n\n const handleMouseup = (e: MouseEvent | TouchEvent) => {\n isMouseDown = false\n \n document.ontouchmove = null\n document.ontouchend = null\n document.onmousemove = null\n document.onmouseup = null\n\n alignmentLines.value = []\n\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n\n if (startPageX === currentPageX && startPageY === currentPageY) return\n\n slidesStore.updateSlide({ elements: elementList.value })\n addHistorySnapshot()\n }\n\n if (isTouchEvent) {\n document.ontouchmove = handleMousemove\n document.ontouchend = handleMouseup\n }\n else {\n document.onmousemove = handleMousemove\n document.onmouseup = handleMouseup\n }\n }\n\n return {\n dragElement,\n }\n}","import { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement, PPTLineElement } from '@/types/slides'\nimport { OperateLineHandlers } from '@/types/edit'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface AdsorptionPoint {\n x: number\n y: number\n}\n\nexport default (elementList: Ref) => {\n const slidesStore = useSlidesStore()\n const { canvasScale } = storeToRefs(useMainStore())\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n // 拖拽线条端点\n const dragLineElement = (e: MouseEvent, element: PPTLineElement, command: OperateLineHandlers) => {\n let isMouseDown = true\n\n const sorptionRange = 8\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n\n const adsorptionPoints: AdsorptionPoint[] = []\n\n // 获取所有线条以外的未旋转的元素的8个缩放点作为吸附位置\n for (let i = 0; i < elementList.value.length; i++) {\n const _element = elementList.value[i]\n if (_element.type === 'line' || _element.rotate) continue\n\n const left = _element.left\n const top = _element.top\n const width = _element.width\n const height = _element.height\n \n const right = left + width\n const bottom = top + height\n const centerX = top + height / 2\n const centerY = left + width / 2\n\n const topPoint = { x: centerY, y: top }\n const bottomPoint = { x: centerY, y: bottom }\n const leftPoint = { x: left, y: centerX }\n const rightPoint = { x: right, y: centerX }\n\n const leftTopPoint = { x: left, y: top }\n const rightTopPoint = { x: right, y: top }\n const leftBottomPoint = { x: left, y: bottom }\n const rightBottomPoint = { x: right, y: bottom }\n\n adsorptionPoints.push(\n topPoint,\n bottomPoint,\n leftPoint,\n rightPoint,\n leftTopPoint,\n rightTopPoint,\n leftBottomPoint,\n rightBottomPoint,\n )\n }\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n const moveX = (currentPageX - startPageX) / canvasScale.value\n const moveY = (currentPageY - startPageY) / canvasScale.value\n \n // 线条起点和终点在编辑区域中的位置\n let startX = element.left + element.start[0]\n let startY = element.top + element.start[1]\n let endX = element.left + element.end[0]\n let endY = element.top + element.end[1]\n\n const mid = element.broken || element.curve || [0, 0]\n let midX = element.left + mid[0]\n let midY = element.top + mid[1]\n\n const [c1, c2] = element.cubic || [[0, 0], [0, 0]]\n let c1X = element.left + c1[0]\n let c1Y = element.top + c1[1]\n let c2X = element.left + c2[0]\n let c2Y = element.top + c2[1]\n\n // 拖拽起点或终点的位置\n // 水平和垂直方向上有吸附\n if (command === OperateLineHandlers.START) {\n startX = startX + moveX\n startY = startY + moveY\n\n if (Math.abs(startX - endX) < sorptionRange) startX = endX\n if (Math.abs(startY - endY) < sorptionRange) startY = endY\n\n for (const adsorptionPoint of adsorptionPoints) {\n const { x, y } = adsorptionPoint\n if (Math.abs(x - startX) < sorptionRange && Math.abs(y - startY) < sorptionRange) {\n startX = x\n startY = y\n break\n }\n }\n }\n else if (command === OperateLineHandlers.END) {\n endX = endX + moveX\n endY = endY + moveY\n\n if (Math.abs(startX - endX) < sorptionRange) endX = startX\n if (Math.abs(startY - endY) < sorptionRange) endY = startY\n\n for (const adsorptionPoint of adsorptionPoints) {\n const { x, y } = adsorptionPoint\n if (Math.abs(x - endX) < sorptionRange && Math.abs(y - endY) < sorptionRange) {\n endX = x\n endY = y\n break\n }\n }\n }\n else if (command === OperateLineHandlers.C) {\n midX = midX + moveX\n midY = midY + moveY\n\n if (Math.abs(midX - startX) < sorptionRange) midX = startX\n if (Math.abs(midY - startY) < sorptionRange) midY = startY\n if (Math.abs(midX - endX) < sorptionRange) midX = endX\n if (Math.abs(midY - endY) < sorptionRange) midY = endY\n if (Math.abs(midX - (startX + endX) / 2) < sorptionRange && Math.abs(midY - (startY + endY) / 2) < sorptionRange) {\n midX = (startX + endX) / 2\n midY = (startY + endY) / 2\n }\n }\n else if (command === OperateLineHandlers.C1) {\n c1X = c1X + moveX\n c1Y = c1Y + moveY\n\n if (Math.abs(c1X - startX) < sorptionRange) c1X = startX\n if (Math.abs(c1Y - startY) < sorptionRange) c1Y = startY\n if (Math.abs(c1X - endX) < sorptionRange) c1X = endX\n if (Math.abs(c1Y - endY) < sorptionRange) c1Y = endY\n }\n else if (command === OperateLineHandlers.C2) {\n c2X = c2X + moveX\n c2Y = c2Y + moveY\n\n if (Math.abs(c2X - startX) < sorptionRange) c2X = startX\n if (Math.abs(c2Y - startY) < sorptionRange) c2Y = startY\n if (Math.abs(c2X - endX) < sorptionRange) c2X = endX\n if (Math.abs(c2Y - endY) < sorptionRange) c2Y = endY\n }\n\n // 计算更新起点和终点基于自身元素位置的坐标\n const minX = Math.min(startX, endX)\n const minY = Math.min(startY, endY)\n const maxX = Math.max(startX, endX)\n const maxY = Math.max(startY, endY)\n\n const start: [number, number] = [0, 0]\n const end: [number, number] = [maxX - minX, maxY - minY]\n if (startX > endX) {\n start[0] = maxX - minX\n end[0] = 0\n }\n if (startY > endY) {\n start[1] = maxY - minY\n end[1] = 0\n }\n\n elementList.value = elementList.value.map(el => {\n if (el.id === element.id) {\n const newEl: PPTLineElement = {\n ...(el as PPTLineElement),\n left: minX,\n top: minY,\n start: start,\n end: end,\n }\n if (command === OperateLineHandlers.START || command === OperateLineHandlers.END) {\n if (element.broken) newEl.broken = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]\n if (element.curve) newEl.curve = [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]\n if (element.cubic) newEl.cubic = [[(start[0] + end[0]) / 2, (start[1] + end[1]) / 2], [(start[0] + end[0]) / 2, (start[1] + end[1]) / 2]]\n }\n else if (command === OperateLineHandlers.C) {\n if (element.broken) newEl.broken = [midX - minX, midY - minY]\n if (element.curve) newEl.curve = [midX - minX, midY - minY]\n }\n else {\n if (element.cubic) newEl.cubic = [[c1X - minX, c1Y - minY], [c2X - minX, c2Y - minY]]\n }\n return newEl\n }\n return el\n })\n }\n\n document.onmouseup = e => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n if (startPageX === currentPageX && startPageY === currentPageY) return\n\n slidesStore.updateSlide({ elements: elementList.value })\n addHistorySnapshot()\n }\n }\n\n return {\n dragLineElement,\n }\n}","import { Ref } from 'vue'\nimport { useSlidesStore } from '@/store'\nimport { PPTElement, PPTShapeElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport { SHAPE_PATH_FORMULAS } from '@/configs/shapes'\n\ninterface ShapePathData {\n baseSize: number,\n originPos: number,\n min: number,\n max: number,\n relative: string,\n}\n\nexport default (\n elementList: Ref,\n canvasScale: Ref,\n) => {\n const slidesStore = useSlidesStore()\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n const moveShapeKeypoint = (e: MouseEvent | TouchEvent, element: PPTShapeElement) => {\n const isTouchEvent = !(e instanceof MouseEvent)\n if (isTouchEvent && (!e.changedTouches || !e.changedTouches[0])) return\n\n let isMouseDown = true\n \n const startPageX = isTouchEvent ? e.changedTouches[0].pageX : e.pageX\n const startPageY = isTouchEvent ? e.changedTouches[0].pageY : e.pageY\n\n const pathFormula = SHAPE_PATH_FORMULAS[element.pathFormula!]\n let shapePathData: ShapePathData | null = null\n if ('editable' in pathFormula) {\n const baseSize = pathFormula.getBaseSize(element.width, element.height)\n const originPos = baseSize * element.keypoint!\n const [min, max] = pathFormula.range\n const relative = pathFormula.relative\n\n shapePathData = { baseSize, originPos, min, max, relative }\n }\n\n const handleMousemove = (e: MouseEvent | TouchEvent) => {\n if (!isMouseDown) return\n\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n const moveX = (currentPageX - startPageX) / canvasScale.value\n const moveY = (currentPageY - startPageY) / canvasScale.value\n\n elementList.value = elementList.value.map(el => {\n if (el.id === element.id && shapePathData) {\n const { baseSize, originPos, min, max, relative } = shapePathData\n const shapeElement = el as PPTShapeElement\n\n let keypoint = 0\n\n if (relative === 'left') keypoint = (originPos + moveX) / baseSize\n if (relative === 'right') keypoint = (originPos - moveX) / baseSize\n if (relative === 'center') keypoint = (originPos - moveX * 2) / baseSize\n if (relative === 'top') keypoint = (originPos + moveY) / baseSize\n if (relative === 'bottom') keypoint = (originPos - moveY) / baseSize\n\n if (keypoint < min) keypoint = min\n if (keypoint > max) keypoint = max\n\n return {\n ...el,\n keypoint,\n path: pathFormula.formula(shapeElement.width, shapeElement.height, keypoint),\n }\n }\n return el\n })\n }\n\n const handleMouseup = (e: MouseEvent | TouchEvent) => {\n isMouseDown = false\n \n document.ontouchmove = null\n document.ontouchend = null\n document.onmousemove = null\n document.onmouseup = null\n\n const currentPageX = e instanceof MouseEvent ? e.pageX : e.changedTouches[0].pageX\n const currentPageY = e instanceof MouseEvent ? e.pageY : e.changedTouches[0].pageY\n\n if (startPageX === currentPageX && startPageY === currentPageY) return\n\n slidesStore.updateSlide({ elements: elementList.value })\n addHistorySnapshot()\n }\n\n if (isTouchEvent) {\n document.ontouchmove = handleMousemove\n document.ontouchend = handleMouseup\n }\n else {\n document.onmousemove = handleMousemove\n document.onmouseup = handleMouseup\n }\n }\n\n return {\n moveShapeKeypoint,\n }\n}","import { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { CreateElementSelectionData, CreatingLineElement, CreatingShapeElement } from '@/types/edit'\nimport useCreateElement from '@/hooks/useCreateElement'\n\nexport default (viewportRef: Ref) => {\n const mainStore = useMainStore()\n const { canvasScale, creatingElement } = storeToRefs(mainStore)\n\n // 通过鼠标框选时的起点和终点,计算选区的位置大小\n const formatCreateSelection = (selectionData: CreateElementSelectionData) => {\n const { start, end } = selectionData\n\n if (!viewportRef.value) return\n const viewportRect = viewportRef.value.getBoundingClientRect()\n\n const [startX, startY] = start\n const [endX, endY] = end\n const minX = Math.min(startX, endX)\n const maxX = Math.max(startX, endX)\n const minY = Math.min(startY, endY)\n const maxY = Math.max(startY, endY)\n\n const left = (minX - viewportRect.x) / canvasScale.value\n const top = (minY - viewportRect.y) / canvasScale.value\n const width = (maxX - minX) / canvasScale.value\n const height = (maxY - minY) / canvasScale.value\n\n return { left, top, width, height }\n }\n\n // 通过鼠标框选时的起点和终点,计算线条在画布中的位置和起点终点\n const formatCreateSelectionForLine = (selectionData: CreateElementSelectionData) => {\n const { start, end } = selectionData\n\n if (!viewportRef.value) return\n const viewportRect = viewportRef.value.getBoundingClientRect()\n\n const [startX, startY] = start\n const [endX, endY] = end\n const minX = Math.min(startX, endX)\n const maxX = Math.max(startX, endX)\n const minY = Math.min(startY, endY)\n const maxY = Math.max(startY, endY)\n\n const left = (minX - viewportRect.x) / canvasScale.value\n const top = (minY - viewportRect.y) / canvasScale.value\n const width = (maxX - minX) / canvasScale.value\n const height = (maxY - minY) / canvasScale.value\n\n const _start: [number, number] = [\n startX === minX ? 0 : width,\n startY === minY ? 0 : height,\n ]\n const _end: [number, number] = [\n endX === minX ? 0 : width,\n endY === minY ? 0 : height,\n ]\n\n return {\n left,\n top,\n start: _start,\n end: _end,\n }\n }\n\n const { createTextElement, createShapeElement, createLineElement } = useCreateElement()\n\n // 根据鼠标选区的位置大小插入元素\n const insertElementFromCreateSelection = (selectionData: CreateElementSelectionData) => {\n if (!creatingElement.value) return\n\n const type = creatingElement.value.type\n if (type === 'text') {\n const position = formatCreateSelection(selectionData)\n position && createTextElement(position)\n }\n else if (type === 'shape') {\n const position = formatCreateSelection(selectionData)\n position && createShapeElement(position, (creatingElement.value as CreatingShapeElement).data)\n }\n else if (type === 'line') {\n const position = formatCreateSelectionForLine(selectionData)\n position && createLineElement(position, (creatingElement.value as CreatingLineElement).data)\n }\n mainStore.setCreatingElement(null)\n }\n\n return {\n insertElementFromCreateSelection,\n }\n}","import { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { ElementAlignCommands } from '@/types/edit'\nimport { getElementListRange } from '@/utils/element'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport useHistorySnapshot from './useHistorySnapshot'\n\nexport default () => {\n const slidesStore = useSlidesStore()\n const { activeElementIdList, activeElementList } = storeToRefs(useMainStore())\n const { currentSlide, viewportRatio } = storeToRefs(slidesStore)\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n /**\n * 将所有选中的元素对齐到画布\n * @param command 对齐方向\n */\n const alignElementToCanvas = (command: ElementAlignCommands) => {\n const viewportWidth = VIEWPORT_SIZE\n const viewportHeight = VIEWPORT_SIZE * viewportRatio.value\n const { minX, maxX, minY, maxY } = getElementListRange(activeElementList.value)\n \n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\n for (const element of newElementList) {\n if (!activeElementIdList.value.includes(element.id)) continue\n \n // 水平垂直居中\n if (command === ElementAlignCommands.CENTER) {\n const offsetY = minY + (maxY - minY) / 2 - viewportHeight / 2\n const offsetX = minX + (maxX - minX) / 2 - viewportWidth / 2\n element.top = element.top - offsetY \n element.left = element.left - offsetX \n }\n\n // 顶部对齐\n if (command === ElementAlignCommands.TOP) {\n const offsetY = minY - 0\n element.top = element.top - offsetY \n }\n\n // 垂直居中\n else if (command === ElementAlignCommands.VERTICAL) {\n const offsetY = minY + (maxY - minY) / 2 - viewportHeight / 2\n element.top = element.top - offsetY \n }\n\n // 底部对齐\n else if (command === ElementAlignCommands.BOTTOM) {\n const offsetY = maxY - viewportHeight\n element.top = element.top - offsetY \n }\n \n // 左侧对齐\n else if (command === ElementAlignCommands.LEFT) {\n const offsetX = minX - 0\n element.left = element.left - offsetX \n }\n\n // 水平居中\n else if (command === ElementAlignCommands.HORIZONTAL) {\n const offsetX = minX + (maxX - minX) / 2 - viewportWidth / 2\n element.left = element.left - offsetX \n }\n\n // 右侧对齐\n else if (command === ElementAlignCommands.RIGHT) {\n const offsetX = maxX - viewportWidth\n element.left = element.left - offsetX \n }\n }\n\n slidesStore.updateSlide({ elements: newElementList })\n addHistorySnapshot()\n }\n\n return {\n alignElementToCanvas,\n }\n}","import { computed, Ref } from 'vue'\nimport { PPTElementShadow } from '@/types/slides'\n\n// 计算元素的阴影样式\nexport default (shadow: Ref) => {\n const shadowStyle = computed(() => {\n if (shadow.value) {\n const { h, v, blur, color } = shadow.value\n return `${h}px ${v}px ${blur}px ${color}`\n }\n return ''\n })\n\n return {\n shadowStyle,\n }\n}","import { computed, Ref } from 'vue'\n\n// 计算元素的翻转样式\nexport default (flipH: Ref, flipV: Ref) => {\n const flipStyle = computed(() => {\n let style = ''\n \n if (flipH.value && flipV.value) style = 'rotateX(180deg) rotateY(180deg)'\n else if (flipV.value) style = 'rotateX(180deg)'\n else if (flipH.value) style = 'rotateY(180deg)'\n\n return style\n })\n\n return {\n flipStyle,\n }\n}","import { computed, Ref } from 'vue'\nimport { CLIPPATHS, ClipPathTypes } from '@/configs/imageClip'\nimport { ImageElementClip } from '@/types/slides'\n\nexport default (clip: Ref) => {\n const clipShape = computed(() => {\n if (!clip.value) return CLIPPATHS.rect\n const shape = clip.value.shape || ClipPathTypes.RECT\n\n return CLIPPATHS[shape]\n })\n\n const imgPosition = computed(() => {\n if (!clip.value) {\n return {\n top: '0',\n left: '0',\n width: '100%',\n height: '100%',\n }\n }\n\n const [start, end] = clip.value.range\n\n const widthScale = (end[0] - start[0]) / 100\n const heightScale = (end[1] - start[1]) / 100\n const left = start[0] / widthScale\n const top = start[1] / heightScale\n\n return {\n left: -left + '%',\n top: -top + '%',\n width: 100 / widthScale + '%',\n height: 100 / heightScale + '%',\n }\n })\n\n return {\n clipShape,\n imgPosition,\n }\n}","import { computed, Ref } from 'vue'\nimport { ImageElementFilters } from '@/types/slides'\n\nexport default (filters: Ref) => {\n const filter = computed(() => {\n if (!filters.value) return ''\n let filter = ''\n for (const key of Object.keys(filters.value)) {\n filter += `${key}(${filters.value[key]}) `\n }\n return filter\n })\n\n return {\n filter,\n }\n}","import { computed, Ref } from 'vue'\nimport { PPTElementOutline } from '@/types/slides'\n\n// 计算边框相关属性值,主要是对默认值的处理\nexport default (outline: Ref) => {\n const outlineWidth = computed(() => outline.value?.width ?? 0)\n const outlineStyle = computed(() => outline.value?.style || 'solid')\n const outlineColor = computed(() => outline.value?.color || '#d14424')\n\n return {\n outlineWidth,\n outlineStyle,\n outlineColor,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-b5bace06\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"rx\", \"ry\", \"width\", \"height\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\n\nimport { PropType, toRef } from 'vue'\nimport { PPTElementOutline } from '@/types/slides'\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ImageRectOutline',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n outline: {\n type: Object as PropType\n },\n radius: {\n type: String,\n default: '0',\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst {\n outlineWidth,\n outlineStyle,\n outlineColor,\n} = useElementOutline(toRef(props, 'outline'))\n\nreturn (_ctx: any,_cache: any) => {\n return (__props.outline)\n ? (_openBlock(), _createElementBlock(\"svg\", {\n key: 0,\n class: \"image-rect-outline\",\n overflow: \"visible\",\n width: __props.width,\n height: __props.height\n }, [\n _createElementVNode(\"rect\", {\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n fill: \"transparent\",\n rx: __props.radius,\n ry: __props.radius,\n width: __props.width,\n height: __props.height,\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 6' : '0 0'\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./ImageRectOutline.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImageRectOutline.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImageRectOutline.vue?vue&type=style&index=0&id=b5bace06&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-b5bace06\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-71b17928\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"cx\", \"cy\", \"rx\", \"ry\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\n\nimport { PropType, toRef } from 'vue'\nimport { PPTElementOutline } from '@/types/slides'\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ImageEllipseOutline',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n outline: {\n type: Object as PropType\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst {\n outlineWidth,\n outlineStyle,\n outlineColor,\n} = useElementOutline(toRef(props, 'outline'))\n\nreturn (_ctx: any,_cache: any) => {\n return (__props.outline)\n ? (_openBlock(), _createElementBlock(\"svg\", {\n key: 0,\n class: \"image-ellipse-outline\",\n overflow: \"visible\",\n width: __props.width,\n height: __props.height\n }, [\n _createElementVNode(\"ellipse\", {\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n fill: \"transparent\",\n cx: __props.width / 2,\n cy: __props.height / 2,\n rx: __props.width / 2,\n ry: __props.height / 2,\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 6' : '0 0'\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./ImageEllipseOutline.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImageEllipseOutline.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImageEllipseOutline.vue?vue&type=style&index=0&id=71b17928&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-71b17928\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-41071294\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"d\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\n\nimport { PropType, toRef } from 'vue'\nimport { PPTElementOutline } from '@/types/slides'\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ImagePolygonOutline',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n outline: {\n type: Object as PropType\n },\n createPath: {\n type: Function,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst {\n outlineWidth,\n outlineStyle,\n outlineColor,\n} = useElementOutline(toRef(props, 'outline'))\n\nreturn (_ctx: any,_cache: any) => {\n return (__props.outline)\n ? (_openBlock(), _createElementBlock(\"svg\", {\n key: 0,\n class: \"image-polygon-outline\",\n overflow: \"visible\",\n width: __props.width,\n height: __props.height\n }, [\n _createElementVNode(\"path\", {\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n fill: \"transparent\",\n d: __props.createPath(__props.width, __props.height),\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 6' : '0 0'\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./ImagePolygonOutline.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImagePolygonOutline.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImagePolygonOutline.vue?vue&type=style&index=0&id=41071294&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-41071294\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"image-outline\" }\n\nimport { computed, PropType } from 'vue'\nimport { PPTImageElement } from '@/types/slides'\nimport useClipImage from '../useClipImage'\n\nimport ImageRectOutline from './ImageRectOutline.vue'\nimport ImageEllipseOutline from './ImageEllipseOutline.vue'\nimport ImagePolygonOutline from './ImagePolygonOutline.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst clip = computed(() => props.elementInfo.clip)\nconst { clipShape } = useClipImage(clip)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_unref(clipShape).type === 'rect')\n ? (_openBlock(), _createBlock(ImageRectOutline, {\n key: 0,\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n radius: _unref(clipShape).radius,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"radius\", \"outline\"]))\n : (_unref(clipShape).type === 'ellipse')\n ? (_openBlock(), _createBlock(ImageEllipseOutline, {\n key: 1,\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"outline\"]))\n : (_unref(clipShape).type === 'polygon')\n ? (_openBlock(), _createBlock(ImagePolygonOutline, {\n key: 2,\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline,\n createPath: _unref(clipShape).createPath\n }, null, 8, [\"width\", \"height\", \"outline\", \"createPath\"]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, withModifiers as _withModifiers, normalizeClass as _normalizeClass, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3e0199ec\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"src\"]\nconst _hoisted_2 = [\"src\"]\nconst _hoisted_3 = [\"onMousedown\"]\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"svg\", {\n width: \"16\",\n height: \"16\",\n fill: \"#fff\",\n stroke: \"#333\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n \"stroke-width\": \"0.3\",\n \"shape-rendering\": \"crispEdges\",\n d: \"M 16 0 L 0 0 L 0 16 L 4 16 L 4 4 L 16 4 L 16 0 Z\"\n })\n], -1))\nconst _hoisted_5 = [\n _hoisted_4\n]\nconst _hoisted_6 = [\"onMousedown\"]\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"svg\", {\n width: \"16\",\n height: \"16\",\n fill: \"#fff\",\n stroke: \"#333\"\n}, [\n /*#__PURE__*/_createElementVNode(\"path\", {\n \"stroke-width\": \"0.3\",\n \"shape-rendering\": \"crispEdges\",\n d: \"M 16 0 L 0 0 L 0 4 L 16 4 Z\"\n })\n], -1))\nconst _hoisted_8 = [\n _hoisted_7\n]\n\nimport { computed, onMounted, onUnmounted, PropType, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useKeyboardStore } from '@/store'\nimport { KEYS } from '@/configs/hotkey'\nimport { ImageClipedEmitData, OperateResizeHandlers } from '@/types/edit'\nimport { ImageClipDataRange, ImageElementClip } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ImageClipHandler',\n props: {\n src: {\n type: String,\n required: true,\n },\n clipData: {\n type: Object as PropType,\n },\n clipPath: {\n type: String,\n required: true,\n },\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n top: {\n type: Number,\n required: true,\n },\n left: {\n type: Number,\n required: true,\n },\n rotate: {\n type: Number,\n required: true,\n },\n},\n emits: [\"clip\"],\n setup(__props, { emit }: { emit: ({\n (event: 'clip', payload: ImageClipedEmitData | null): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\nconst { ctrlOrShiftKeyActive } = storeToRefs(useKeyboardStore())\n\nconst clipWrapperPositionStyle = ref({\n top: '0',\n left: '0',\n})\nconst isSettingClipRange = ref(false)\nconst currentRange = ref(null)\n\n// 获取裁剪区域信息(裁剪区域占原图的宽高比例,处在原图中的位置)\nconst getClipDataTransformInfo = () => {\n const [start, end] = props.clipData ? props.clipData.range : [[0, 0], [100, 100]]\n\n const widthScale = (end[0] - start[0]) / 100\n const heightScale = (end[1] - start[1]) / 100\n const left = start[0] / widthScale\n const top = start[1] / heightScale\n\n return { widthScale, heightScale, left, top }\n}\n\n// 底层图片位置大小(遮罩区域图片)\nconst imgPosition = computed(() => {\n const { widthScale, heightScale, left, top } = getClipDataTransformInfo()\n return {\n left: -left,\n top: -top,\n width: 100 / widthScale,\n height: 100 / heightScale,\n }\n})\n\n// 底层图片位置大小样式(遮罩区域图片)\nconst bottomImgPositionStyle = computed(() => {\n return {\n top: imgPosition.value.top + '%',\n left: imgPosition.value.left + '%',\n width: imgPosition.value.width + '%',\n height: imgPosition.value.height + '%',\n }\n})\n\n// 顶层图片容器位置大小(裁剪高亮区域)\nconst topImgWrapperPosition = ref({\n top: 0,\n left: 0,\n width: 0,\n height: 0,\n})\n\n// 顶层图片容器位置大小样式(裁剪高亮区域)\nconst topImgWrapperPositionStyle = computed(() => {\n const { top, left, width, height } = topImgWrapperPosition.value\n return {\n top: top + '%',\n left: left + '%',\n width: width + '%',\n height: height + '%',\n }\n})\n\n// 顶层图片位置大小样式(裁剪区域图片)\nconst topImgPositionStyle = computed(() => {\n const bottomWidth = imgPosition.value.width\n const bottomHeight = imgPosition.value.height\n \n const { top, left, width, height } = topImgWrapperPosition.value\n \n return {\n left: -left * (100 / width) + '%',\n top: -top * (100 / height) + '%',\n width: bottomWidth / width * 100 + '%',\n height: bottomHeight / height * 100 + '%',\n }\n})\n\n// 初始化裁剪位置信息\nconst initClipPosition = () => {\n const { left, top } = getClipDataTransformInfo()\n topImgWrapperPosition.value = {\n left: left,\n top: top,\n width: 100,\n height: 100,\n }\n \n clipWrapperPositionStyle.value = {\n top: -top + '%',\n left: -left + '%',\n }\n}\n\n// 执行裁剪:计算裁剪后的图片位置大小和裁剪信息,并将数据同步出去\nconst handleClip = () => {\n if (isSettingClipRange.value) return\n\n if (!currentRange.value) {\n emit('clip', null)\n return\n }\n\n const { left, top } = getClipDataTransformInfo()\n\n const position = {\n left: (topImgWrapperPosition.value.left - left) / 100 * props.width,\n top: (topImgWrapperPosition.value.top - top) / 100 * props.height,\n width: (topImgWrapperPosition.value.width - 100) / 100 * props.width,\n height: (topImgWrapperPosition.value.height - 100) / 100 * props.height,\n }\n\n const clipedEmitData: ImageClipedEmitData = {\n range: currentRange.value,\n position,\n }\n emit('clip', clipedEmitData)\n}\n\n// 快捷键监听:回车确认裁剪\nconst keyboardListener = (e: KeyboardEvent) => {\n const key = e.key.toUpperCase()\n if (key === KEYS.ENTER) handleClip()\n}\n\nonMounted(() => {\n initClipPosition()\n document.addEventListener('keydown', keyboardListener)\n})\nonUnmounted(() => {\n document.removeEventListener('keydown', keyboardListener)\n})\n\n// 计算并更新裁剪区域范围数据\nconst updateRange = () => {\n const retPosition = {\n left: parseInt(topImgPositionStyle.value.left),\n top: parseInt(topImgPositionStyle.value.top),\n width: parseInt(topImgPositionStyle.value.width),\n height: parseInt(topImgPositionStyle.value.height),\n }\n\n const widthScale = 100 / retPosition.width\n const heightScale = 100 / retPosition.height\n\n const start: [number, number] = [\n -retPosition.left * widthScale,\n -retPosition.top * heightScale,\n ]\n const end: [number, number] = [\n widthScale * 100 + start[0],\n heightScale * 100 + start[1],\n ]\n\n currentRange.value = [start, end]\n}\n\n// 移动裁剪区域\nconst moveClipRange = (e: MouseEvent) => {\n isSettingClipRange.value = true\n let isMouseDown = true\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n const bottomPosition = imgPosition.value\n const originPositopn = { ...topImgWrapperPosition.value }\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n let moveX = (currentPageX - startPageX) / canvasScale.value / props.width * 100\n let moveY = (currentPageY - startPageY) / canvasScale.value / props.height * 100\n\n if (props.rotate > 45 && props.rotate < 135) {\n moveX = (currentPageY - startPageY) / canvasScale.value / props.width * 100\n moveY = -(currentPageX - startPageX) / canvasScale.value / props.height * 100\n }\n if ((props.rotate >= 135 && props.rotate <= 180) || (props.rotate >= -180 && props.rotate <= -135)) {\n moveX = -moveX\n moveY = -moveY\n }\n if (props.rotate > -135 && props.rotate < -45) {\n moveX = -(currentPageY - startPageY) / canvasScale.value / props.width * 100\n moveY = (currentPageX - startPageX) / canvasScale.value / props.height * 100\n }\n\n let targetLeft = originPositopn.left + moveX\n let targetTop = originPositopn.top + moveY\n\n if (targetLeft < 0) targetLeft = 0\n else if (targetLeft + originPositopn.width > bottomPosition.width) {\n targetLeft = bottomPosition.width - originPositopn.width\n }\n if (targetTop < 0) targetTop = 0\n else if (targetTop + originPositopn.height > bottomPosition.height) {\n targetTop = bottomPosition.height - originPositopn.height\n }\n \n topImgWrapperPosition.value = {\n ...topImgWrapperPosition.value,\n left: targetLeft,\n top: targetTop,\n }\n }\n\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n updateRange()\n\n setTimeout(() => {\n isSettingClipRange.value = false\n }, 0)\n }\n}\n\n// 缩放裁剪区域\nconst scaleClipRange = (e: MouseEvent, type: OperateResizeHandlers) => {\n isSettingClipRange.value = true\n let isMouseDown = true\n\n const minWidth = 50 / props.width * 100\n const minHeight = 50 / props.height * 100\n \n const startPageX = e.pageX\n const startPageY = e.pageY\n const bottomPosition = imgPosition.value\n const originPositopn = { ...topImgWrapperPosition.value }\n\n const aspectRatio = topImgWrapperPosition.value.width / topImgWrapperPosition.value.height\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n let moveX = (currentPageX - startPageX) / canvasScale.value / props.width * 100\n let moveY = (currentPageY - startPageY) / canvasScale.value / props.height * 100\n\n if (props.rotate > 45 && props.rotate < 135) {\n moveX = (currentPageY - startPageY) / canvasScale.value / props.width * 100\n moveY = -(currentPageX - startPageX) / canvasScale.value / props.height * 100\n }\n if ((props.rotate >= 135 && props.rotate <= 180) || (props.rotate >= -180 && props.rotate <= -135)) {\n moveX = -moveX\n moveY = -moveY\n }\n if (props.rotate > -135 && props.rotate < -45) {\n moveX = -(currentPageY - startPageY) / canvasScale.value / props.width * 100\n moveY = (currentPageX - startPageX) / canvasScale.value / props.height * 100\n }\n\n if (ctrlOrShiftKeyActive.value) {\n if (type === OperateResizeHandlers.RIGHT_BOTTOM || type === OperateResizeHandlers.LEFT_TOP) moveY = moveX / aspectRatio\n if (type === OperateResizeHandlers.LEFT_BOTTOM || type === OperateResizeHandlers.RIGHT_TOP) moveY = -moveX / aspectRatio\n }\n\n let targetLeft, targetTop, targetWidth, targetHeight\n\n if (type === OperateResizeHandlers.LEFT_TOP) {\n if (originPositopn.left + moveX < 0) {\n moveX = -originPositopn.left\n }\n if (originPositopn.top + moveY < 0) {\n moveY = -originPositopn.top\n }\n if (originPositopn.width - moveX < minWidth) {\n moveX = originPositopn.width - minWidth\n }\n if (originPositopn.height - moveY < minHeight) {\n moveY = originPositopn.height - minHeight\n }\n targetWidth = originPositopn.width - moveX\n targetHeight = originPositopn.height - moveY\n targetLeft = originPositopn.left + moveX\n targetTop = originPositopn.top + moveY\n }\n else if (type === OperateResizeHandlers.RIGHT_TOP) {\n if (originPositopn.left + originPositopn.width + moveX > bottomPosition.width) {\n moveX = bottomPosition.width - (originPositopn.left + originPositopn.width)\n }\n if (originPositopn.top + moveY < 0) {\n moveY = -originPositopn.top\n }\n if (originPositopn.width + moveX < minWidth) {\n moveX = minWidth - originPositopn.width\n }\n if (originPositopn.height - moveY < minHeight) {\n moveY = originPositopn.height - minHeight\n }\n targetWidth = originPositopn.width + moveX\n targetHeight = originPositopn.height - moveY\n targetLeft = originPositopn.left\n targetTop = originPositopn.top + moveY\n }\n else if (type === OperateResizeHandlers.LEFT_BOTTOM) {\n if (originPositopn.left + moveX < 0) {\n moveX = -originPositopn.left\n }\n if (originPositopn.top + originPositopn.height + moveY > bottomPosition.height) {\n moveY = bottomPosition.height - (originPositopn.top + originPositopn.height)\n }\n if (originPositopn.width - moveX < minWidth) {\n moveX = originPositopn.width - minWidth\n }\n if (originPositopn.height + moveY < minHeight) {\n moveY = minHeight - originPositopn.height\n }\n targetWidth = originPositopn.width - moveX\n targetHeight = originPositopn.height + moveY\n targetLeft = originPositopn.left + moveX\n targetTop = originPositopn.top\n }\n else if (type === OperateResizeHandlers.RIGHT_BOTTOM) {\n if (originPositopn.left + originPositopn.width + moveX > bottomPosition.width) {\n moveX = bottomPosition.width - (originPositopn.left + originPositopn.width)\n }\n if (originPositopn.top + originPositopn.height + moveY > bottomPosition.height) {\n moveY = bottomPosition.height - (originPositopn.top + originPositopn.height)\n }\n if (originPositopn.width + moveX < minWidth) {\n moveX = minWidth - originPositopn.width\n }\n if (originPositopn.height + moveY < minHeight) {\n moveY = minHeight - originPositopn.height\n }\n targetWidth = originPositopn.width + moveX\n targetHeight = originPositopn.height + moveY\n targetLeft = originPositopn.left\n targetTop = originPositopn.top\n }\n else if (type === OperateResizeHandlers.TOP) {\n if (originPositopn.top + moveY < 0) {\n moveY = -originPositopn.top\n }\n if (originPositopn.height - moveY < minHeight) {\n moveY = originPositopn.height - minHeight\n }\n targetWidth = originPositopn.width\n targetHeight = originPositopn.height - moveY\n targetLeft = originPositopn.left\n targetTop = originPositopn.top + moveY\n }\n else if (type === OperateResizeHandlers.BOTTOM) {\n if (originPositopn.top + originPositopn.height + moveY > bottomPosition.height) {\n moveY = bottomPosition.height - (originPositopn.top + originPositopn.height)\n }\n if (originPositopn.height + moveY < minHeight) {\n moveY = minHeight - originPositopn.height\n }\n targetWidth = originPositopn.width\n targetHeight = originPositopn.height + moveY\n targetLeft = originPositopn.left\n targetTop = originPositopn.top\n }\n else if (type === OperateResizeHandlers.LEFT) {\n if (originPositopn.left + moveX < 0) {\n moveX = -originPositopn.left\n }\n if (originPositopn.width - moveX < minWidth) {\n moveX = originPositopn.width - minWidth\n }\n targetWidth = originPositopn.width - moveX\n targetHeight = originPositopn.height\n targetLeft = originPositopn.left + moveX\n targetTop = originPositopn.top\n }\n else {\n if (originPositopn.left + originPositopn.width + moveX > bottomPosition.width) {\n moveX = bottomPosition.width - (originPositopn.left + originPositopn.width)\n }\n if (originPositopn.width + moveX < minWidth) {\n moveX = minWidth - originPositopn.width\n }\n targetHeight = originPositopn.height\n targetWidth = originPositopn.width + moveX\n targetLeft = originPositopn.left\n targetTop = originPositopn.top\n }\n\n topImgWrapperPosition.value = {\n left: targetLeft,\n top: targetTop,\n width: targetWidth,\n height: targetHeight,\n }\n }\n\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n updateRange()\n\n setTimeout(() => isSettingClipRange.value = false, 0)\n }\n}\n\nconst rotateClassName = computed(() => {\n const prefix = 'rotate-'\n const rotate = props.rotate\n if (rotate > -22.5 && rotate <= 22.5) return prefix + 0\n else if (rotate > 22.5 && rotate <= 67.5) return prefix + 45\n else if (rotate > 67.5 && rotate <= 112.5) return prefix + 90\n else if (rotate > 112.5 && rotate <= 157.5) return prefix + 135\n else if (rotate > 157.5 || rotate <= -157.5) return prefix + 0\n else if (rotate > -157.5 && rotate <= -112.5) return prefix + 45\n else if (rotate > -112.5 && rotate <= -67.5) return prefix + 90\n else if (rotate > -67.5 && rotate <= -22.5) return prefix + 135\n return prefix + 0\n})\n\nconst cornerPoint = [\n OperateResizeHandlers.LEFT_TOP,\n OperateResizeHandlers.RIGHT_TOP,\n OperateResizeHandlers.LEFT_BOTTOM,\n OperateResizeHandlers.RIGHT_BOTTOM,\n]\nconst edgePoints = [\n OperateResizeHandlers.TOP,\n OperateResizeHandlers.BOTTOM,\n OperateResizeHandlers.LEFT,\n OperateResizeHandlers.RIGHT,\n]\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_click_outside = _resolveDirective(\"click-outside\")!\n\n return _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"image-clip-handler\",\n style: _normalizeStyle(clipWrapperPositionStyle.value)\n }, [\n _createElementVNode(\"img\", {\n class: \"bottom-img\",\n src: __props.src,\n draggable: false,\n alt: \"\",\n style: _normalizeStyle(_unref(bottomImgPositionStyle))\n }, null, 12, _hoisted_1),\n _createElementVNode(\"div\", {\n class: \"top-image-content\",\n style: _normalizeStyle({\n ..._unref(topImgWrapperPositionStyle),\n clipPath: __props.clipPath,\n })\n }, [\n _createElementVNode(\"img\", {\n class: \"top-img\",\n src: __props.src,\n draggable: false,\n alt: \"\",\n style: _normalizeStyle(_unref(topImgPositionStyle))\n }, null, 12, _hoisted_2)\n ], 4),\n _createElementVNode(\"div\", {\n class: \"operate\",\n style: _normalizeStyle(_unref(topImgWrapperPositionStyle)),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers($event => moveClipRange($event), [\"stop\"]))\n }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(cornerPoint, (point) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass(['clip-point', point, _unref(rotateClassName)]),\n key: point,\n onMousedown: _withModifiers($event => scaleClipRange($event, point), [\"stop\"])\n }, _hoisted_5, 42, _hoisted_3)\n }), 64)),\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(edgePoints, (point) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass(['clip-point', point, _unref(rotateClassName)]),\n key: point,\n onMousedown: _withModifiers($event => scaleClipRange($event, point), [\"stop\"])\n }, _hoisted_8, 42, _hoisted_6)\n }), 64))\n ], 36)\n ], 4)), [\n [_directive_click_outside, handleClip]\n ])\n}\n}\n\n})","import script from \"./ImageClipHandler.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImageClipHandler.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImageClipHandler.vue?vue&type=style&index=0&id=3e0199ec&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-3e0199ec\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createVNode as _createVNode, withModifiers as _withModifiers, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-30dc7050\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"src\"]\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { ImageElementClip, PPTImageElement } from '@/types/slides'\nimport { ImageClipedEmitData } from '@/types/edit'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\nimport useElementFlip from '@/views/components/element/hooks/useElementFlip'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport useClipImage from './useClipImage'\nimport useFilter from './useFilter'\n\nimport ImageOutline from './ImageOutline/index.vue'\nimport ImageClipHandler from './ImageClipHandler.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTImageElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { clipingImageElementId } = storeToRefs(mainStore)\n\nconst isCliping = computed(() => clipingImageElementId.value === props.elementInfo.id)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst flipH = computed(() => props.elementInfo.flipH)\nconst flipV = computed(() => props.elementInfo.flipV)\nconst { flipStyle } = useElementFlip(flipH, flipV)\n\nconst clip = computed(() => props.elementInfo.clip)\nconst { clipShape, imgPosition } = useClipImage(clip)\n\nconst filters = computed(() => props.elementInfo.filters)\nconst { filter } = useFilter(filters)\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n props.selectElement(e, props.elementInfo)\n}\n\nconst handleClip = (data: ImageClipedEmitData | null) => {\n mainStore.setClipingImageElementId('')\n \n if (!data) return\n\n const { range, position } = data\n const originClip: ImageElementClip = props.elementInfo.clip || { shape: 'rect', range: [[0, 0], [100, 100]] }\n\n const left = props.elementInfo.left + position.left\n const top = props.elementInfo.top + position.top\n const width = props.elementInfo.width + position.width\n const height = props.elementInfo.height + position.height\n\n let centerOffsetX = 0\n let centerOffsetY = 0\n\n if (props.elementInfo.rotate) {\n const centerX = (left + width / 2) - (props.elementInfo.left + props.elementInfo.width / 2)\n const centerY = -((top + height / 2) - (props.elementInfo.top + props.elementInfo.height / 2))\n\n const radian = -props.elementInfo.rotate * Math.PI / 180\n\n const rotatedCenterX = centerX * Math.cos(radian) - centerY * Math.sin(radian)\n const rotatedCenterY = centerX * Math.sin(radian) + centerY * Math.cos(radian)\n\n centerOffsetX = rotatedCenterX - centerX\n centerOffsetY = -(rotatedCenterY - centerY)\n }\n\n const _props = {\n clip: { ...originClip, range },\n left: left + centerOffsetX,\n top: top + centerOffsetY,\n width,\n height,\n }\n slidesStore.updateElement({ id: props.elementInfo.id, props: _props })\n \n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-image\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n (_unref(isCliping))\n ? (_openBlock(), _createBlock(ImageClipHandler, {\n key: 0,\n src: __props.elementInfo.src,\n clipData: __props.elementInfo.clip,\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n top: __props.elementInfo.top,\n left: __props.elementInfo.left,\n rotate: __props.elementInfo.rotate,\n clipPath: _unref(clipShape).style,\n onClip: _cache[0] || (_cache[0] = range => handleClip(range))\n }, null, 8, [\"src\", \"clipData\", \"width\", \"height\", \"top\", \"left\", \"rotate\", \"clipPath\"]))\n : _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: \"element-content\",\n style: _normalizeStyle({\n filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '',\n transform: _unref(flipStyle),\n }),\n onMousedown: _cache[2] || (_cache[2] = $event => handleSelectElement($event)),\n onTouchstart: _cache[3] || (_cache[3] = $event => handleSelectElement($event))\n }, [\n _createVNode(ImageOutline, { elementInfo: __props.elementInfo }, null, 8, [\"elementInfo\"]),\n _createElementVNode(\"div\", {\n class: \"image-content\",\n style: _normalizeStyle({ clipPath: _unref(clipShape).style })\n }, [\n _createElementVNode(\"img\", {\n src: __props.elementInfo.src,\n draggable: false,\n style: _normalizeStyle({\n top: _unref(imgPosition).top,\n left: _unref(imgPosition).left,\n width: _unref(imgPosition).width,\n height: _unref(imgPosition).height,\n filter: _unref(filter),\n }),\n onDragstart: _cache[1] || (_cache[1] = _withModifiers(() => {}, [\"prevent\"])),\n alt: \"\"\n }, null, 44, _hoisted_1)\n ], 4)\n ], 36)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=30dc7050&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-30dc7050\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-61b7d06a\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"d\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\n\nimport { PropType, toRef } from 'vue'\nimport { PPTElementOutline } from '@/types/slides'\n\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementOutline',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n outline: {\n type: Object as PropType\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst {\n outlineWidth,\n outlineStyle,\n outlineColor,\n} = useElementOutline(toRef(props, 'outline'))\n\nreturn (_ctx: any,_cache: any) => {\n return (__props.outline)\n ? (_openBlock(), _createElementBlock(\"svg\", {\n key: 0,\n class: \"element-outline\",\n overflow: \"visible\",\n width: __props.width,\n height: __props.height\n }, [\n _createElementVNode(\"path\", {\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n fill: \"transparent\",\n d: `M0,0 L${__props.width},0 L${__props.width},${__props.height} L0,${__props.height} Z`,\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 6' : '0 0'\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./ElementOutline.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementOutline.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementOutline.vue?vue&type=style&index=0&id=61b7d06a&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-61b7d06a\"]])\n\nexport default __exports__","import mitt, { Emitter } from 'mitt'\n\nexport const enum EmitterEvents {\n RICH_TEXT_COMMAND = 'RICH_TEXT_COMMAND',\n OPEN_CHART_DATA_EDITOR = 'OPEN_CHART_DATA_EDITOR',\n OPEN_LATEX_EDITOR = 'OPEN_LATEX_EDITOR',\n}\n\nexport interface RichTextAction {\n command: string\n value?: string\n}\n\nexport interface RichTextCommand {\n target?: string\n action: RichTextAction | RichTextAction[]\n}\n\ntype Events = {\n [EmitterEvents.RICH_TEXT_COMMAND]: RichTextCommand\n [EmitterEvents.OPEN_CHART_DATA_EDITOR]: void\n [EmitterEvents.OPEN_LATEX_EDITOR]: void\n} \n\nconst emitter: Emitter = mitt()\n\nexport default emitter","import { splitListItem, liftListItem, sinkListItem } from 'prosemirror-schema-list'\nimport { Schema } from 'prosemirror-model'\nimport { undo, redo } from 'prosemirror-history'\nimport { undoInputRule } from 'prosemirror-inputrules'\nimport {\n toggleMark,\n selectParentNode,\n joinUp,\n joinDown,\n Command,\n} from 'prosemirror-commands'\n\nexport const buildKeymap = (schema: Schema) => {\n const keys = {}\n const bind = (key: string, cmd: Command) => keys[key] = cmd\n\n bind('Alt-ArrowUp', joinUp)\n bind('Alt-ArrowDown', joinDown)\n bind('Ctrl-z', undo)\n bind('Ctrl-y', redo)\n bind('Backspace', undoInputRule)\n bind('Escape', selectParentNode)\n bind('Ctrl-b', toggleMark(schema.marks.strong))\n bind('Ctrl-i', toggleMark(schema.marks.em))\n bind('Ctrl-u', toggleMark(schema.marks.underline))\n bind('Ctrl-d', toggleMark(schema.marks.strikethrough))\n\n bind('Enter', splitListItem(schema.nodes.list_item))\n bind('Mod-[', liftListItem(schema.nodes.list_item))\n bind('Mod-]', sinkListItem(schema.nodes.list_item))\n\n return keys\n}","import { NodeType, Schema } from 'prosemirror-model'\nimport {\n inputRules,\n wrappingInputRule,\n textblockTypeInputRule,\n smartQuotes,\n emDash,\n ellipsis,\n} from 'prosemirror-inputrules'\n\nconst blockQuoteRule = (nodeType: NodeType) => wrappingInputRule(/^\\s*>\\s$/, nodeType)\n\nconst orderedListRule = (nodeType: NodeType) => (\n wrappingInputRule(\n /^(\\d+)\\.\\s$/, \n nodeType, \n match => ({order: +match[1]}),\n (match, node) => node.childCount + node.attrs.order === +match[1],\n )\n)\n\nconst bulletListRule = (nodeType: NodeType) => wrappingInputRule(/^\\s*([-+*])\\s$/, nodeType)\n\nconst codeBlockRule = (nodeType: NodeType) => textblockTypeInputRule(/^```$/, nodeType)\n\nexport const buildInputRules = (schema: Schema) => {\n const rules = [\n ...smartQuotes,\n ellipsis,\n emDash,\n ]\n rules.push(blockQuoteRule(schema.nodes.blockquote))\n rules.push(orderedListRule(schema.nodes.ordered_list))\n rules.push(bulletListRule(schema.nodes.bullet_list))\n rules.push(codeBlockRule(schema.nodes.code_block))\n\n return inputRules({ rules })\n}","import { keymap } from 'prosemirror-keymap'\nimport { Schema } from 'prosemirror-model'\nimport { history } from 'prosemirror-history'\nimport { baseKeymap } from 'prosemirror-commands'\nimport { dropCursor } from 'prosemirror-dropcursor'\nimport { gapCursor } from 'prosemirror-gapcursor'\n\nimport { buildKeymap } from './keymap'\nimport { buildInputRules } from './inputrules'\n\nexport const buildPlugins = (schema: Schema) => {\n return [\n buildInputRules(schema),\n keymap(buildKeymap(schema)),\n keymap(baseKeymap),\n dropCursor(),\n gapCursor(),\n history(),\n ]\n}","import { nodes } from 'prosemirror-schema-basic'\nimport { Node, NodeSpec } from 'prosemirror-model'\nimport { orderedList, bulletList, listItem } from 'prosemirror-schema-list'\n\nconst _orderedList: NodeSpec = {\n ...orderedList,\n content: 'list_item+',\n group: 'block',\n}\n\nconst _bulletList: NodeSpec = {\n ...bulletList,\n content: 'list_item+',\n group: 'block',\n}\n\nconst _listItem: NodeSpec = {\n ...listItem,\n content: 'paragraph block*',\n group: 'block',\n}\n\nconst paragraph: NodeSpec = {\n attrs: {\n align: {\n default: '',\n },\n indent: {\n default: 0,\n },\n },\n content: 'inline*',\n group: 'block',\n parseDOM: [\n {\n tag: 'p',\n getAttrs: dom => {\n const { textAlign } = (dom as HTMLElement).style\n\n let align = (dom as HTMLElement).getAttribute('align') || textAlign || ''\n align = /(left|right|center|justify)/.test(align) ? align : ''\n\n const indent = +((dom as HTMLElement).getAttribute('data-indent') || 0)\n \n return { align, indent }\n }\n }\n ],\n toDOM: (node: Node) => {\n const { align, indent } = node.attrs\n let style = ''\n if (align && align !== 'left') style += `text-align: ${align};`\n\n const attr = { style }\n if (indent) attr['data-indent'] = indent\n\n return ['p', attr, 0]\n },\n}\n\n// https://github.com/pipipi-pikachu/PPTist/issues/134\nconst { hard_break, ...otherNodes } = nodes\n\nexport default {\n ...otherNodes,\n 'ordered_list': _orderedList,\n 'bullet_list': _bulletList,\n 'list_item': _listItem,\n paragraph,\n}\n","import { marks } from 'prosemirror-schema-basic'\nimport { MarkSpec } from 'prosemirror-model'\n\nconst subscript: MarkSpec = {\n excludes: 'subscript',\n parseDOM: [\n { tag: 'sub' },\n {\n style: 'vertical-align',\n getAttrs: value => value === 'sub' && null\n },\n ],\n toDOM: () => ['sub', 0],\n}\n\nconst superscript: MarkSpec = {\n excludes: 'superscript',\n parseDOM: [\n { tag: 'sup' },\n {\n style: 'vertical-align',\n getAttrs: value => value === 'super' && null\n },\n ],\n toDOM: () => ['sup', 0],\n}\n\nconst strikethrough: MarkSpec = {\n parseDOM: [\n { tag: 'strike' },\n {\n style: 'text-decoration',\n getAttrs: value => value === 'line-through' && null\n },\n {\n style: 'text-decoration-line',\n getAttrs: value => value === 'line-through' && null\n },\n ],\n toDOM: () => ['span', { style: 'text-decoration-line: line-through' }, 0],\n}\n\nconst underline: MarkSpec = {\n parseDOM: [\n { tag: 'u' },\n {\n style: 'text-decoration',\n getAttrs: value => value === 'underline' && null\n },\n {\n style: 'text-decoration-line',\n getAttrs: value => value === 'underline' && null\n },\n ],\n toDOM: () => ['span', { style: 'text-decoration: underline' }, 0],\n}\n\nconst forecolor: MarkSpec = {\n attrs: {\n color: {},\n },\n inline: true,\n group: 'inline',\n parseDOM: [\n {\n style: 'color',\n getAttrs: color => color ? { color } : {}\n },\n ],\n toDOM: mark => {\n const { color } = mark.attrs\n let style = ''\n if (color) style += `color: ${color};`\n return ['span', { style }, 0]\n },\n}\n\nconst backcolor: MarkSpec = {\n attrs: {\n backcolor: {},\n },\n inline: true,\n group: 'inline',\n parseDOM: [\n {\n style: 'background-color',\n getAttrs: backcolor => backcolor ? { backcolor } : {}\n },\n ],\n toDOM: mark => {\n const { backcolor } = mark.attrs\n let style = ''\n if (backcolor) style += `background-color: ${backcolor};`\n return ['span', { style }, 0]\n },\n}\n\nconst fontsize: MarkSpec = {\n attrs: {\n fontsize: {},\n },\n inline: true,\n group: 'inline',\n parseDOM: [\n {\n style: 'font-size',\n getAttrs: fontsize => fontsize ? { fontsize } : {}\n },\n ],\n toDOM: mark => {\n const { fontsize } = mark.attrs\n let style = ''\n if (fontsize) style += `font-size: ${fontsize}`\n return ['span', { style }, 0]\n },\n}\n\nconst fontname: MarkSpec = {\n attrs: {\n fontname: {},\n },\n inline: true,\n group: 'inline',\n parseDOM: [\n {\n style: 'font-family',\n getAttrs: fontname => {\n return { fontname: fontname && typeof fontname === 'string' ? fontname.replace(/[\\\"\\']/g, '') : '' }\n }\n },\n ],\n toDOM: mark => {\n const { fontname } = mark.attrs\n let style = ''\n if (fontname) style += `font-family: ${fontname}`\n return ['span', { style }, 0]\n },\n}\n\nconst link: MarkSpec = {\n attrs: {\n href: {},\n title: { default: null },\n target: { default: '_blank' },\n },\n inclusive: false,\n parseDOM: [\n {\n tag: 'a[href]',\n getAttrs: dom => {\n const href = (dom as HTMLElement).getAttribute('href')\n const title = (dom as HTMLElement).getAttribute('title')\n return { href, title }\n }\n },\n ],\n toDOM: node => ['a', node.attrs, 0],\n}\n\nexport default {\n ...marks,\n subscript,\n superscript,\n strikethrough,\n underline,\n forecolor,\n backcolor,\n fontsize,\n fontname,\n link,\n}","import nodes from './nodes'\nimport marks from './marks'\n\nexport const schemaNodes = nodes\nexport const schemaMarks = marks\n","import { EditorState } from 'prosemirror-state'\nimport { EditorView } from 'prosemirror-view'\nimport { Schema, DOMParser } from 'prosemirror-model'\n\nimport { buildPlugins } from './plugins/index'\nimport { schemaNodes, schemaMarks } from './schema/index'\n\nconst schema = new Schema({\n nodes: schemaNodes,\n marks: schemaMarks,\n})\n\nexport const createDocument = (content: string) => {\n const htmlString = `
${content}
`\n const parser = new window.DOMParser()\n const element = parser.parseFromString(htmlString, 'text/html').body.firstElementChild\n return DOMParser.fromSchema(schema).parse(element as Element)\n}\n\nexport const initProsemirrorEditor = (dom: Element, content: string, props = {}) => {\n return new EditorView(dom, {\n state: EditorState.create({\n doc: createDocument(content),\n plugins: buildPlugins(schema),\n }),\n ...props,\n })\n}","import { Schema, Node, NodeType } from 'prosemirror-model'\nimport { Transaction } from 'prosemirror-state'\nimport { EditorView } from 'prosemirror-view'\n\nexport const setTextAlign = (tr: Transaction, schema: Schema, alignment: string) => {\n const { selection, doc } = tr\n if (!selection || !doc) return tr\n\n const { from, to } = selection\n const { nodes } = schema\n\n const blockquote = nodes.blockquote\n const listItem = nodes.list_item\n const paragraph = nodes.paragraph\n\n interface Task {\n node: Node\n pos: number\n nodeType: NodeType\n }\n\n const tasks: Task[] = []\n alignment = alignment || ''\n\n const allowedNodeTypes = new Set([blockquote, listItem, paragraph])\n\n doc.nodesBetween(from, to, (node, pos) => {\n const nodeType = node.type\n const align = node.attrs.align || ''\n if (align !== alignment && allowedNodeTypes.has(nodeType)) {\n tasks.push({\n node,\n pos,\n nodeType,\n })\n }\n return true\n })\n\n if (!tasks.length) return tr\n\n tasks.forEach(task => {\n const { node, pos, nodeType } = task\n let { attrs } = node\n if (alignment) attrs = { ...attrs, align: alignment }\n else attrs = { ...attrs, align: null }\n tr = tr.setNodeMarkup(pos, nodeType, attrs, node.marks)\n })\n\n return tr\n}\n\nexport const alignmentCommand = (view: EditorView, alignment: string) => {\n const { state } = view\n const { schema, selection } = state\n const tr = setTextAlign(\n state.tr.setSelection(selection),\n schema,\n alignment,\n )\n view.dispatch(tr)\n}","import { wrapInList, liftListItem } from 'prosemirror-schema-list'\nimport { Schema, Node, NodeType } from 'prosemirror-model'\nimport { Transaction, EditorState } from 'prosemirror-state'\nimport { findParentNode } from '../utils'\n\nexport const isList = (node: Node, schema: Schema) => {\n return (\n node.type === schema.nodes.bullet_list ||\n node.type === schema.nodes.ordered_list\n )\n}\n\nexport const toggleList = (listType: NodeType, itemType: NodeType) => {\n return (state: EditorState, dispatch: (tr: Transaction) => void) => {\n const { schema, selection } = state\n const { $from, $to } = selection\n const range = $from.blockRange($to)\n\n if (!range) return false\n\n const parentList = findParentNode((node: Node) => isList(node, schema))(selection)\n\n if (range.depth >= 1 && parentList && range.depth - parentList.depth <= 1) {\n if (parentList.node.type === listType) {\n return liftListItem(itemType)(state, dispatch)\n }\n\n if (isList(parentList.node, schema) && listType.validContent(parentList.node.content)) {\n const { tr } = state\n tr.setNodeMarkup(parentList.pos, listType)\n\n if (dispatch) dispatch(tr)\n\n return false\n }\n }\n\n return wrapInList(listType)(state, dispatch)\n }\n}\n","import { Schema } from 'prosemirror-model'\nimport { TextSelection, AllSelection, Transaction } from 'prosemirror-state'\nimport { EditorView } from 'prosemirror-view'\nimport { isList } from './toggleList'\n\nfunction setNodeIndentMarkup(tr: Transaction, pos: number, delta: number): Transaction {\n if (!tr.doc) return tr\n\n const node = tr.doc.nodeAt(pos)\n if (!node) return tr\n\n const minIndent = 0\n const maxIndent = 7\n\n let indent = (node.attrs.indent || 0) + delta\n if (indent < minIndent) indent = minIndent\n if (indent > maxIndent) indent = maxIndent\n\n if (indent === node.attrs.indent) return tr\n\n const nodeAttrs = {\n ...node.attrs,\n indent,\n }\n\n return tr.setNodeMarkup(pos, node.type, nodeAttrs, node.marks)\n}\n\nconst setTextIndent = (tr: Transaction, schema: Schema, delta: number): Transaction => {\n const { selection, doc } = tr\n if (!selection || !doc) return tr\n\n if (!(selection instanceof TextSelection || selection instanceof AllSelection)) return tr\n\n const { from, to } = selection\n\n doc.nodesBetween(from, to, (node, pos) => {\n const nodeType = node.type\n\n if (nodeType.name === 'paragraph' || nodeType.name === 'blockquote') {\n tr = setNodeIndentMarkup(tr, pos, delta)\n return false\n } \n else if (isList(node, schema)) return false\n return true\n })\n\n return tr\n}\n\nexport const indentCommand = (view: EditorView, delta: number) => {\n const { state } = view\n const { schema, selection } = state\n\n const tr = setTextIndent(\n state.tr.setSelection(selection),\n schema,\n delta,\n )\n if (tr.docChanged) {\n view.dispatch(tr)\n return true\n }\n\n return false\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, onMounted, onUnmounted, ref, watch } from 'vue'\nimport { debounce } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { EditorView } from 'prosemirror-view'\nimport { toggleMark, wrapIn } from 'prosemirror-commands'\nimport { initProsemirrorEditor, createDocument } from '@/utils/prosemirror'\nimport { findNodesWithSameMark, getTextAttrs, autoSelectAll, addMark, markActive, getFontsize } from '@/utils/prosemirror/utils'\nimport emitter, { EmitterEvents, RichTextCommand } from '@/utils/emitter'\nimport { alignmentCommand } from '@/utils/prosemirror/commands/setTextAlign'\nimport { indentCommand } from '@/utils/prosemirror/commands/setTextIndent'\nimport { toggleList } from '@/utils/prosemirror/commands/toggleList'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ProsemirrorEditor',\n props: {\n elementId: {\n type: String,\n required: true,\n },\n defaultColor: {\n type: String,\n required: true,\n },\n defaultFontName: {\n type: String,\n required: true,\n },\n editable: {\n type: Boolean,\n default: false,\n },\n value: {\n type: String,\n required: true,\n },\n autoFocus: {\n type: Boolean,\n default: false,\n },\n},\n emits: [\"update\", \"focus\", \"blur\"],\n setup(__props, { expose, emit }: { emit: ({\n (event: 'update', payload: string): void\n (event: 'focus'): void\n (event: 'blur'): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst mainStore = useMainStore()\nconst { handleElementId } = storeToRefs(mainStore)\n\nconst editorViewRef = ref()\nlet editorView: EditorView\n\n// 富文本的各种交互事件监听:\n// 聚焦时取消全局快捷键事件\n// 输入文字时同步数据到vuex\n// 点击鼠标和键盘时同步富文本状态到工具栏\nconst handleInput = debounce(function() {\n emit('update', editorView.dom.innerHTML)\n}, 300, { trailing: true })\n\nconst handleFocus = () => {\n mainStore.setDisableHotkeysState(true)\n emit('focus')\n}\n\nconst handleBlur = () => {\n mainStore.setDisableHotkeysState(false)\n emit('blur')\n}\n\nconst handleClick = debounce(function() {\n const attrs = getTextAttrs(editorView, {\n color: props.defaultColor,\n fontname: props.defaultFontName,\n })\n mainStore.setRichtextAttrs(attrs)\n}, 30, { trailing: true })\n\nconst handleKeydown = () => {\n handleInput()\n handleClick()\n}\n\n// 将富文本内容同步到DOM\nconst textContent = computed(() => props.value)\nwatch(textContent, () => {\n if (!editorView) return\n if (editorView.hasFocus()) return\n\n const { doc, tr } = editorView.state\n editorView.dispatch(tr.replaceRangeWith(0, doc.content.size, createDocument(textContent.value)))\n})\n\n// 打开/关闭编辑器的编辑模式\nwatch(() => props.editable, () => {\n editorView.setProps({ editable: () => props.editable })\n})\n\n// Prosemirror编辑器的初始化和卸载\nonMounted(() => {\n editorView = initProsemirrorEditor((editorViewRef.value as Element), textContent.value, {\n handleDOMEvents: {\n focus: handleFocus,\n blur: handleBlur,\n keydown: handleKeydown,\n click: handleClick,\n },\n editable: () => props.editable,\n })\n if (props.autoFocus) editorView.focus()\n})\nonUnmounted(() => {\n editorView && editorView.destroy()\n})\n\n// 暴露 focus 方法\nconst focus = () => editorView.focus()\nexpose({ focus })\n\n// 执行富文本命令(可以是一个或多个)\n// 部分命令在执行前先判断当前选区是否为空,如果选区为空先进行全选操作\nconst execCommand = ({ target, action }: RichTextCommand) => {\n if (!target && handleElementId.value !== props.elementId) return\n if (target && target !== props.elementId) return\n\n const actions = ('command' in action) ? [action] : action\n\n for (const item of actions) {\n if (item.command === 'fontname' && item.value) {\n const mark = editorView.state.schema.marks.fontname.create({ fontname: item.value })\n autoSelectAll(editorView)\n addMark(editorView, mark)\n }\n else if (item.command === 'fontsize' && item.value) {\n const mark = editorView.state.schema.marks.fontsize.create({ fontsize: item.value })\n autoSelectAll(editorView)\n addMark(editorView, mark)\n }\n else if (item.command === 'fontsize-add') {\n const step = item.value ? +item.value : 2\n autoSelectAll(editorView)\n const fontsize = getFontsize(editorView) + step + 'px'\n const mark = editorView.state.schema.marks.fontsize.create({ fontsize })\n addMark(editorView, mark)\n }\n else if (item.command === 'fontsize-reduce') {\n const step = item.value ? +item.value : 2\n autoSelectAll(editorView)\n let fontsize = getFontsize(editorView) - step\n if (fontsize < 12) fontsize = 12\n const mark = editorView.state.schema.marks.fontsize.create({ fontsize: fontsize + 'px' })\n addMark(editorView, mark)\n }\n else if (item.command === 'color' && item.value) {\n const mark = editorView.state.schema.marks.forecolor.create({ color: item.value })\n autoSelectAll(editorView)\n addMark(editorView, mark)\n }\n else if (item.command === 'backcolor' && item.value) {\n const mark = editorView.state.schema.marks.backcolor.create({ backcolor: item.value })\n autoSelectAll(editorView)\n addMark(editorView, mark)\n }\n else if (item.command === 'bold') {\n autoSelectAll(editorView)\n toggleMark(editorView.state.schema.marks.strong)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'em') {\n autoSelectAll(editorView)\n toggleMark(editorView.state.schema.marks.em)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'underline') {\n autoSelectAll(editorView)\n toggleMark(editorView.state.schema.marks.underline)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'strikethrough') {\n autoSelectAll(editorView)\n toggleMark(editorView.state.schema.marks.strikethrough)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'subscript') {\n toggleMark(editorView.state.schema.marks.subscript)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'superscript') {\n toggleMark(editorView.state.schema.marks.superscript)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'blockquote') {\n wrapIn(editorView.state.schema.nodes.blockquote)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'code') {\n toggleMark(editorView.state.schema.marks.code)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'align' && item.value) {\n alignmentCommand(editorView, item.value)\n }\n else if (item.command === 'indent' && item.value) {\n indentCommand(editorView, +item.value)\n }\n else if (item.command === 'bulletList') {\n const { bullet_list: bulletList, list_item: listItem } = editorView.state.schema.nodes\n toggleList(bulletList, listItem)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'orderedList') {\n const { ordered_list: orderedList, list_item: listItem } = editorView.state.schema.nodes\n toggleList(orderedList, listItem)(editorView.state, editorView.dispatch)\n }\n else if (item.command === 'clear') {\n autoSelectAll(editorView)\n const { $from, $to } = editorView.state.selection\n editorView.dispatch(editorView.state.tr.removeMark($from.pos, $to.pos))\n }\n else if (item.command === 'link') {\n const markType = editorView.state.schema.marks.link\n const { from, to } = editorView.state.selection\n const result = findNodesWithSameMark(editorView.state.doc, from, to, markType)\n if (result) {\n if (item.value) {\n const mark = editorView.state.schema.marks.link.create({ href: item.value, title: item.value })\n addMark(editorView, mark, { from: result.from.pos, to: result.to.pos + 1 })\n }\n else editorView.dispatch(editorView.state.tr.removeMark(result.from.pos, result.to.pos + 1, markType))\n }\n else if (markActive(editorView.state, markType)) {\n if (item.value) {\n const mark = editorView.state.schema.marks.link.create({ href: item.value, title: item.value })\n addMark(editorView, mark)\n }\n else toggleMark(markType)(editorView.state, editorView.dispatch)\n }\n else if (item.value) {\n autoSelectAll(editorView)\n toggleMark(markType, { href: item.value, title: item.value })(editorView.state, editorView.dispatch)\n }\n }\n else if (item.command === 'insert' && item.value) {\n editorView.dispatch(editorView.state.tr.insertText(item.value))\n }\n }\n\n editorView.focus()\n handleInput()\n handleClick()\n}\n\nemitter.on(EmitterEvents.RICH_TEXT_COMMAND, execCommand)\nonUnmounted(() => {\n emitter.off(EmitterEvents.RICH_TEXT_COMMAND, execCommand)\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"prosemirror-editor\",\n ref_key: \"editorViewRef\",\n ref: editorViewRef\n }, null, 512))\n}\n}\n\n})","import script from \"./ProsemirrorEditor.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ProsemirrorEditor.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ProsemirrorEditor.vue?vue&type=style&index=0&id=1debd6ff&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1debd6ff\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-7135a611\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"drag-handler top\" }, null, -1))\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"drag-handler bottom\" }, null, -1))\n\nimport { computed, onMounted, onUnmounted, PropType, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTTextElement } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementOutline from '@/views/components/element/ElementOutline.vue'\nimport ProsemirrorEditor from '@/views/components/element/ProsemirrorEditor.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTTextElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElementId, isScaling } = storeToRefs(mainStore)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst elementRef = ref()\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent, canMove = true) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo, canMove)\n}\n\n// 监听文本元素的尺寸变化,当高度变化时,更新高度到vuex\n// 如果高度变化时正处在缩放操作中,则等待缩放操作结束后再更新\nconst realHeightCache = ref(-1)\n\nwatch(isScaling, () => {\n if (handleElementId.value !== props.elementInfo.id) return\n\n if (!isScaling.value && realHeightCache.value !== -1) {\n slidesStore.updateElement({\n id: props.elementInfo.id,\n props: { height: realHeightCache.value },\n })\n realHeightCache.value = -1\n }\n})\n\nconst updateTextElementHeight = (entries: ResizeObserverEntry[]) => {\n const contentRect = entries[0].contentRect\n if (!elementRef.value) return\n\n const realHeight = contentRect.height\n\n if (props.elementInfo.height !== realHeight) {\n if (!isScaling.value) {\n slidesStore.updateElement({\n id: props.elementInfo.id,\n props: { height: realHeight },\n })\n }\n else realHeightCache.value = realHeight\n }\n}\nconst resizeObserver = new ResizeObserver(updateTextElementHeight)\n\nonMounted(() => {\n if (elementRef.value) resizeObserver.observe(elementRef.value)\n})\nonUnmounted(() => {\n if (elementRef.value) resizeObserver.unobserve(elementRef.value)\n})\n\nconst updateContent = (content: string) => {\n slidesStore.updateElement({\n id: props.elementInfo.id,\n props: { content },\n })\n \n addHistorySnapshot()\n}\n\nconst checkEmptyText = () => {\n const pureText = props.elementInfo.content.replaceAll(/<[^>]+>/g, '')\n if (!pureText) slidesStore.deleteElement(props.elementInfo.id)\n}\n\nconst isHandleElement = computed(() => handleElementId.value === props.elementInfo.id)\nwatch(isHandleElement, () => {\n if (!isHandleElement.value) checkEmptyText()\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-text\", { 'lock': __props.elementInfo.lock }]),\n ref_key: \"elementRef\",\n ref: elementRef,\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\n backgroundColor: __props.elementInfo.fill,\n opacity: __props.elementInfo.opacity,\n textShadow: _unref(shadowStyle),\n lineHeight: __props.elementInfo.lineHeight,\n letterSpacing: (__props.elementInfo.wordSpace || 0) + 'px',\n color: __props.elementInfo.defaultColor,\n fontFamily: __props.elementInfo.defaultFontName,\n }),\n onMousedown: _cache[3] || (_cache[3] = $event => handleSelectElement($event)),\n onTouchstart: _cache[4] || (_cache[4] = $event => handleSelectElement($event))\n }, [\n _createVNode(ElementOutline, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"outline\"]),\n _createVNode(ProsemirrorEditor, {\n class: \"text\",\n elementId: __props.elementInfo.id,\n defaultColor: __props.elementInfo.defaultColor,\n defaultFontName: __props.elementInfo.defaultFontName,\n editable: !__props.elementInfo.lock,\n value: __props.elementInfo.content,\n style: _normalizeStyle({\n '--textIndent': `${__props.elementInfo.textIndent || 0}px`,\n '--paragraphSpace': `${__props.elementInfo.paragraphSpace === undefined ? 5 : __props.elementInfo.paragraphSpace}px`,\n }),\n onUpdate: _cache[0] || (_cache[0] = value => updateContent(value)),\n onMousedown: _cache[1] || (_cache[1] = $event => handleSelectElement($event, false)),\n onTouchstart: _cache[2] || (_cache[2] = $event => handleSelectElement($event))\n }, null, 8, [\"elementId\", \"defaultColor\", \"defaultFontName\", \"editable\", \"value\", \"style\"]),\n _hoisted_1,\n _hoisted_2\n ], 36)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=7135a611&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7135a611\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = [\"id\", \"gradientTransform\"]\nconst _hoisted_2 = [\"stop-color\"]\nconst _hoisted_3 = [\"stop-color\"]\nconst _hoisted_4 = [\"id\"]\nconst _hoisted_5 = [\"stop-color\"]\nconst _hoisted_6 = [\"stop-color\"]\n\nimport { PropType } from 'vue'\r\n\r\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'GradientDefs',\n props: {\r\n id: {\r\n type: String,\r\n required: true,\r\n },\r\n type: {\r\n type: String as PropType<'linear' | 'radial'>,\r\n },\r\n color1: {\r\n type: String,\r\n required: true,\r\n },\r\n color2: {\r\n type: String,\r\n required: true,\r\n },\r\n rotate: {\r\n type: Number,\r\n default: 0,\r\n },\r\n},\n setup(__props) {\n\r\n\r\n\nreturn (_ctx: any,_cache: any) => {\n return (__props.type === 'linear')\n ? (_openBlock(), _createElementBlock(\"linearGradient\", {\n key: 0,\n id: __props.id,\n x1: \"0%\",\n y1: \"0%\",\n x2: \"100%\",\n y2: \"0%\",\n gradientTransform: `rotate(${__props.rotate},0.5,0.5)`\n }, [\n _createElementVNode(\"stop\", {\n offset: \"0%\",\n \"stop-color\": __props.color1\n }, null, 8, _hoisted_2),\n _createElementVNode(\"stop\", {\n offset: \"100%\",\n \"stop-color\": __props.color2\n }, null, 8, _hoisted_3)\n ], 8, _hoisted_1))\n : (_openBlock(), _createElementBlock(\"radialGradient\", {\n key: 1,\n id: __props.id\n }, [\n _createElementVNode(\"stop\", {\n offset: \"0%\",\n \"stop-color\": __props.color1\n }, null, 8, _hoisted_5),\n _createElementVNode(\"stop\", {\n offset: \"100%\",\n \"stop-color\": __props.color2\n }, null, 8, _hoisted_6)\n ], 8, _hoisted_4))\n}\n}\n\n})","import script from \"./GradientDefs.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./GradientDefs.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-d4c718fa\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = { key: 0 }\nconst _hoisted_3 = [\"transform\"]\nconst _hoisted_4 = [\"d\", \"fill\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\n\nimport { computed, nextTick, PropType, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTShapeElement, ShapeText } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\nimport useElementFlip from '@/views/components/element/hooks/useElementFlip'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport GradientDefs from './GradientDefs.vue'\nimport ProsemirrorEditor from '@/views/components/element/ProsemirrorEditor.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTShapeElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElementId } = storeToRefs(mainStore)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent, canMove = true) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo, canMove)\n}\n\nconst outline = computed(() => props.elementInfo.outline)\nconst { outlineWidth, outlineStyle, outlineColor } = useElementOutline(outline)\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst flipH = computed(() => props.elementInfo.flipH)\nconst flipV = computed(() => props.elementInfo.flipV)\nconst { flipStyle } = useElementFlip(flipH, flipV)\n\nconst editable = ref(false)\n\nwatch(handleElementId, () => {\n if (handleElementId.value !== props.elementInfo.id) {\n if (editable.value) editable.value = false\n }\n})\n\nconst text = computed(() => {\n const defaultText: ShapeText = {\n content: '',\n defaultFontName: '微软雅黑',\n defaultColor: '#000',\n align: 'middle',\n }\n if (!props.elementInfo.text) return defaultText\n\n return props.elementInfo.text\n})\n\nconst updateText = (content: string) => {\n const _text = { ...text.value, content }\n slidesStore.updateElement({\n id: props.elementInfo.id, \n props: { text: _text },\n })\n \n addHistorySnapshot()\n}\n\nconst checkEmptyText = () => {\n if (!props.elementInfo.text) return\n\n const pureText = props.elementInfo.text.content.replaceAll(/<[^>]+>/g, '')\n if (!pureText) {\n slidesStore.removeElementProps({ id: props.elementInfo.id, propName: 'text' })\n addHistorySnapshot()\n }\n}\n\nconst prosemirrorEditorRef = ref()\nconst startEdit = () => {\n editable.value = true\n nextTick(() => prosemirrorEditorRef.value && prosemirrorEditorRef.value.focus())\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-shape\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\n opacity: __props.elementInfo.opacity,\n filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '',\n transform: _unref(flipStyle),\n color: _unref(text).defaultColor,\n fontFamily: _unref(text).defaultFontName,\n }),\n onMousedown: _cache[4] || (_cache[4] = $event => handleSelectElement($event)),\n onTouchstart: _cache[5] || (_cache[5] = $event => handleSelectElement($event)),\n onDblclick: _cache[6] || (_cache[6] = ($event: any) => (startEdit()))\n }, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: __props.elementInfo.width,\n height: __props.elementInfo.height\n }, [\n (__props.elementInfo.gradient)\n ? (_openBlock(), _createElementBlock(\"defs\", _hoisted_2, [\n _createVNode(GradientDefs, {\n id: `editabel-gradient-${__props.elementInfo.id}`,\n type: __props.elementInfo.gradient.type,\n color1: __props.elementInfo.gradient.color[0],\n color2: __props.elementInfo.gradient.color[1],\n rotate: __props.elementInfo.gradient.rotate\n }, null, 8, [\"id\", \"type\", \"color1\", \"color2\", \"rotate\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"g\", {\n transform: `scale(${__props.elementInfo.width / __props.elementInfo.viewBox[0]}, ${__props.elementInfo.height / __props.elementInfo.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`\n }, [\n _createElementVNode(\"path\", {\n class: \"shape-path\",\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n d: __props.elementInfo.path,\n fill: __props.elementInfo.gradient ? `url(#editabel-gradient-${__props.elementInfo.id})` : __props.elementInfo.fill,\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 6' : '0 0'\n }, null, 8, _hoisted_4)\n ], 8, _hoisted_3)\n ], 8, _hoisted_1)),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"shape-text\", [_unref(text).align, { 'editable': editable.value || _unref(text).content }]])\n }, [\n (editable.value || _unref(text).content)\n ? (_openBlock(), _createBlock(ProsemirrorEditor, {\n key: 0,\n ref_key: \"prosemirrorEditorRef\",\n ref: prosemirrorEditorRef,\n elementId: __props.elementInfo.id,\n defaultColor: _unref(text).defaultColor,\n defaultFontName: _unref(text).defaultFontName,\n editable: !__props.elementInfo.lock,\n value: _unref(text).content,\n onUpdate: _cache[0] || (_cache[0] = value => updateText(value)),\n onBlur: _cache[1] || (_cache[1] = ($event: any) => (checkEmptyText())),\n onMousedown: _cache[2] || (_cache[2] = $event => handleSelectElement($event, false)),\n onTouchstart: _cache[3] || (_cache[3] = $event => handleSelectElement($event, false))\n }, null, 8, [\"elementId\", \"defaultColor\", \"defaultFontName\", \"editable\", \"value\"]))\n : _createCommentVNode(\"\", true)\n ], 2)\n ], 36)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=d4c718fa&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-d4c718fa\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"id\", \"markerWidth\", \"markerHeight\", \"refX\", \"refY\"]\nconst _hoisted_2 = [\"d\", \"fill\", \"transform\"]\n\nimport { computed, PropType } from 'vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LinePointMarker',\n props: {\n id: {\n type: String,\n required: true,\n },\n position: {\n type: String as PropType<'start' | 'end'>,\n required: true,\n },\n type: {\n type: String as PropType<'dot' | 'arrow'>,\n required: true,\n },\n color: {\n type: String,\n },\n baseSize: {\n type: Number,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst pathMap = {\n dot: 'm0 5a5 5 0 1 0 10 0a5 5 0 1 0 -10 0z',\n arrow: 'M0,0 L10,5 0,10 Z',\n}\nconst rotateMap = {\n 'arrow-start': 180,\n 'arrow-end': 0,\n}\n\nconst path = computed(() => pathMap[props.type])\nconst rotate = computed(() => rotateMap[`${props.type}-${props.position}`] || 0)\nconst size = computed(() => props.baseSize < 2 ? 2 : props.baseSize)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"marker\", {\n id: `${__props.id}-${__props.type}-${__props.position}`,\n markerUnits: \"userSpaceOnUse\",\n orient: \"auto\",\n markerWidth: _unref(size) * 3,\n markerHeight: _unref(size) * 3,\n refX: _unref(size) * 1.5,\n refY: _unref(size) * 1.5\n }, [\n _createElementVNode(\"path\", {\n d: _unref(path),\n fill: __props.color,\n transform: `scale(${_unref(size) * 0.3}, ${_unref(size) * 0.3}) rotate(${_unref(rotate)}, 5, 5)`\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n}\n}\n\n})","import script from \"./LinePointMarker.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LinePointMarker.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-6550e504\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"d\", \"stroke\", \"stroke-width\", \"stroke-dasharray\", \"marker-start\", \"marker-end\"]\nconst _hoisted_3 = [\"d\"]\n\nimport { computed, PropType } from 'vue'\nimport { PPTLineElement } from '@/types/slides'\nimport { getLineElementPath } from '@/utils/element'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\n\nimport LinePointMarker from './LinePointMarker.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTLineElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo)\n}\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst svgWidth = computed(() => {\n const width = Math.abs(props.elementInfo.start[0] - props.elementInfo.end[0])\n return width < 24 ? 24 : width\n})\nconst svgHeight = computed(() => {\n const height = Math.abs(props.elementInfo.start[1] - props.elementInfo.end[1])\n return height < 24 ? 24 : height\n})\n\nconst lineDashArray = computed(() => props.elementInfo.style === 'dashed' ? '10 6' : '0 0')\n\nconst path = computed(() => {\n return getLineElementPath(props.elementInfo)\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-shape\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({ filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '' }),\n onMousedown: _cache[0] || (_cache[0] = $event => handleSelectElement($event)),\n onTouchstart: _cache[1] || (_cache[1] = $event => handleSelectElement($event))\n }, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: _unref(svgWidth),\n height: _unref(svgHeight)\n }, [\n _createElementVNode(\"defs\", null, [\n (__props.elementInfo.points[0])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 0,\n id: __props.elementInfo.id,\n position: \"start\",\n type: __props.elementInfo.points[0],\n color: __props.elementInfo.color,\n baseSize: __props.elementInfo.width\n }, null, 8, [\"id\", \"type\", \"color\", \"baseSize\"]))\n : _createCommentVNode(\"\", true),\n (__props.elementInfo.points[1])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 1,\n id: __props.elementInfo.id,\n position: \"end\",\n type: __props.elementInfo.points[1],\n color: __props.elementInfo.color,\n baseSize: __props.elementInfo.width\n }, null, 8, [\"id\", \"type\", \"color\", \"baseSize\"]))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"path\", {\n class: \"line-point\",\n d: _unref(path),\n stroke: __props.elementInfo.color,\n \"stroke-width\": __props.elementInfo.width,\n \"stroke-dasharray\": _unref(lineDashArray),\n fill: \"none\",\n \"marker-start\": __props.elementInfo.points[0] ? `url(#${__props.elementInfo.id}-${__props.elementInfo.points[0]}-start)` : '',\n \"marker-end\": __props.elementInfo.points[1] ? `url(#${__props.elementInfo.id}-${__props.elementInfo.points[1]}-end)` : ''\n }, null, 8, _hoisted_2),\n _withDirectives(_createElementVNode(\"path\", {\n class: \"line-path\",\n d: _unref(path),\n stroke: \"transparent\",\n \"stroke-width\": \"20\",\n fill: \"none\"\n }, null, 8, _hoisted_3), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 8, _hoisted_1))\n ], 36)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=6550e504&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6550e504\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, createCommentVNode as _createCommentVNode } from \"vue\"\n\nimport { computed, inject, onMounted, PropType, ref, watch } from 'vue'\nimport { upperFirst } from 'lodash'\nimport tinycolor from 'tinycolor2'\nimport Chartist, {\n IChartistLineChart,\n IChartistBarChart,\n IChartistPieChart,\n} from 'chartist'\nimport { ChartData, ChartOptions, ChartType } from '@/types/slides'\nimport { injectKeySlideScale } from '@/types/injectKey'\n\nimport 'chartist/dist/scss/chartist.scss'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Chart',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n type: {\n type: String as PropType,\n required: true,\n },\n data: {\n type: Object as PropType,\n required: true,\n },\n options: {\n type: Object as PropType,\n },\n themeColor: {\n type: Array as PropType,\n required: true,\n },\n legends: {\n type: Array as PropType,\n required: true,\n },\n gridColor: {\n type: String,\n },\n legend: {\n type: String as PropType<'' | 'top' | 'bottom'>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst chartRef = ref()\nconst slideScale = inject(injectKeySlideScale) || ref(1)\n\nlet chart: IChartistLineChart | IChartistBarChart | IChartistPieChart | undefined\n\nconst chartHeight = computed(() => {\n if (props.legend) return props.height - 20\n return props.height\n})\n\nconst getDataAndOptions = () => {\n const propsOptopns = props.options || {}\n const options = {\n ...propsOptopns,\n width: props.width * slideScale.value,\n height: chartHeight.value * slideScale.value,\n }\n const data = props.type === 'pie' ? { ...props.data, series: props.data.series[0] } : props.data\n return { data, options }\n}\n\nconst renderChart = () => {\n if (!chartRef.value) return\n\n const type = upperFirst(props.type)\n const { data, options } = getDataAndOptions()\n chart = new Chartist[type](chartRef.value, data, options)\n}\n\nconst updateChart = () => {\n if (!chart) {\n renderChart()\n return\n }\n const { data, options } = getDataAndOptions()\n chart.update(data, options)\n}\n\nwatch([\n () => props.width,\n () => props.height,\n () => props.data,\n () => props.options,\n slideScale,\n], updateChart)\n\nonMounted(renderChart)\n\nconst themeColors = computed(() => {\n let colors: string[] = []\n if (props.themeColor.length >= 10) colors = props.themeColor\n else if (props.themeColor.length === 1) colors = tinycolor(props.themeColor[0]).analogous(10).map(color => color.toHexString())\n else {\n const len = props.themeColor.length\n const supplement = tinycolor(props.themeColor[len - 1]).analogous(10 + 1 - len).map(color => color.toHexString())\n colors = [...props.themeColor.slice(0, len - 1), ...supplement]\n }\n return colors\n})\n\n// 更新主题配色:\n// 如果当前所设置的主题色数小于10,剩余部分获取最后一个主题色的相近颜色作为配色\nconst updateTheme = () => {\n if (!chartRef.value) return\n\n for (let i = 0; i < 10; i++) {\n chartRef.value.style.setProperty(`--theme-color-${i + 1}`, themeColors.value[i])\n }\n}\n\nwatch(themeColors, updateTheme)\nonMounted(updateTheme)\n\n// 更新网格颜色,包括坐标的文字部分\nconst updateGridColor = () => {\n if (!chartRef.value) return\n if (props.gridColor) chartRef.value.style.setProperty(`--grid-color`, props.gridColor)\n}\n\nwatch(() => props.gridColor, updateGridColor)\nonMounted(updateGridColor)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"chart\",\n style: _normalizeStyle({ flexDirection: __props.legend === 'top' ? 'column-reverse' : 'column' })\n }, [\n _createElementVNode(\"div\", {\n class: \"chart-content\",\n ref_key: \"chartRef\",\n ref: chartRef,\n style: _normalizeStyle({\n width: __props.width + 'px',\n height: _unref(chartHeight) + 'px',\n transform: `scale(${1 / _unref(slideScale)})`,\n })\n }, null, 4),\n (__props.legend)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"legends\",\n style: _normalizeStyle({ transform: `scale(${1 / _unref(slideScale)})` })\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.legends, (legend, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"legend\",\n key: index,\n style: _normalizeStyle({ color: __props.gridColor })\n }, [\n _createElementVNode(\"div\", {\n class: \"block\",\n style: _normalizeStyle({ backgroundColor: _unref(themeColors)[index] })\n }, null, 4),\n _createTextVNode(\" \" + _toDisplayString(legend), 1)\n ], 4))\n }), 128))\n ], 4))\n : _createCommentVNode(\"\", true)\n ], 4))\n}\n}\n\n})","import script from \"./Chart.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Chart.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Chart.vue?vue&type=style&index=0&id=1aa2357d&lang=scss&scoped=true\"\nimport \"./Chart.vue?vue&type=style&index=1&id=1aa2357d&lang=scss\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1aa2357d\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, normalizeStyle as _normalizeStyle, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nimport { PropType } from 'vue'\r\nimport { PPTChartElement } from '@/types/slides'\r\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\r\nimport emitter, { EmitterEvents } from '@/utils/emitter'\r\n\r\nimport ElementOutline from '@/views/components/element/ElementOutline.vue'\r\nimport Chart from './Chart.vue'\r\n\r\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\r\n elementInfo: {\r\n type: Object as PropType,\r\n required: true,\r\n },\r\n selectElement: {\r\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTChartElement, canMove?: boolean) => void>,\r\n required: true,\r\n },\r\n contextmenus: {\r\n type: Function as PropType<() => ContextmenuItem[] | null>,\r\n },\r\n},\n setup(__props) {\n\nconst props = __props\n\r\n\r\n\r\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\r\n if (props.elementInfo.lock) return\r\n e.stopPropagation()\r\n\r\n props.selectElement(e, props.elementInfo)\r\n}\r\n\r\nconst openDataEditor = () => {\r\n emitter.emit(EmitterEvents.OPEN_CHART_DATA_EDITOR)\r\n}\r\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-chart\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\r\n top: __props.elementInfo.top + 'px',\r\n left: __props.elementInfo.left + 'px',\r\n width: __props.elementInfo.width + 'px',\r\n height: __props.elementInfo.height + 'px',\r\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\r\n backgroundColor: __props.elementInfo.fill,\r\n }),\n onMousedown: _cache[0] || (_cache[0] = $event => handleSelectElement($event)),\n onTouchstart: _cache[1] || (_cache[1] = $event => handleSelectElement($event)),\n onDblclick: _cache[2] || (_cache[2] = ($event: any) => (openDataEditor()))\n }, [\n _createVNode(ElementOutline, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"outline\"]),\n _createVNode(Chart, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n type: __props.elementInfo.chartType,\n data: __props.elementInfo.data,\n options: __props.elementInfo.options,\n themeColor: __props.elementInfo.themeColor,\n gridColor: __props.elementInfo.gridColor,\n legends: __props.elementInfo.data.legends,\n legend: __props.elementInfo.legend || ''\n }, null, 8, [\"width\", \"height\", \"type\", \"data\", \"options\", \"themeColor\", \"gridColor\", \"legends\", \"legend\"])\n ], 36)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=f3c03862&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-f3c03862\"]])\n\nexport default __exports__","import { CSSProperties } from 'vue'\nimport { TableCellStyle } from '@/types/slides'\n\n/**\n * 计算单元格文本样式\n * @param style 单元格文本样式原数据\n */\nexport const getTextStyle = (style?: TableCellStyle): CSSProperties => {\n if (!style) return {}\n const {\n bold,\n em,\n underline,\n strikethrough,\n color,\n backcolor,\n fontsize,\n fontname,\n align,\n } = style\n\n let textDecoration = `${underline ? 'underline' : ''} ${strikethrough ? 'line-through' : ''}`\n if (textDecoration === ' ') textDecoration = 'none'\n \n return {\n fontWeight: bold ? 'bold' : 'normal',\n fontStyle: em ? 'italic' : 'normal',\n textDecoration,\n color: color || '#000',\n backgroundColor: backcolor || '',\n fontSize: fontsize || '14px',\n fontFamily: fontname || '微软雅黑',\n textAlign: align || 'left',\n }\n}\n\nexport const formatText = (text: string) => {\n return text.replace(/\\n/g, '
').replace(/ /g, ' ')\n}","import { computed, Ref } from 'vue'\nimport { TableCell } from '@/types/slides'\n\n// 计算无效的单元格位置(被合并的单元格位置)集合\n\nexport default (cells: Ref) => {\n const hideCells = computed(() => {\n const hideCells = []\n \n for (let i = 0; i < cells.value.length; i++) {\n const rowCells = cells.value[i]\n\n for (let j = 0; j < rowCells.length; j++) {\n const cell = rowCells[j]\n \n if (cell.colspan > 1 || cell.rowspan > 1) {\n for (let row = i; row < i + cell.rowspan; row++) {\n for (let col = row === i ? j + 1 : j; col < j + cell.colspan; col++) {\n hideCells.push(`${row}_${col}`)\n }\n }\n }\n }\n }\n return hideCells\n })\n\n return {\n hideCells,\n }\n}","import { ref, Ref, watch } from 'vue'\nimport { TableTheme } from '@/types/slides'\nimport { getTableSubThemeColor } from '@/utils/element'\n\n// 通过表格的主题色计算辅助颜色\n\nexport default (theme: Ref) => {\n const subThemeColor = ref(['', ''])\n watch(() => theme.value, () => {\n if (theme.value) {\n subThemeColor.value = getTableSubThemeColor(theme.value.color)\n }\n }, { immediate: true })\n\n return {\n subThemeColor,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-cdb58a1e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"innerHTML\"]\n\nimport { onUnmounted, ref, watch } from 'vue'\nimport { pasteCustomClipboardString, pasteExcelClipboardString } from '@/utils/clipboard'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'CustomTextarea',\n props: {\n value: {\n type: String,\n default: '',\n },\n contenteditable: {\n type: [Boolean, String],\n default: false,\n },\n},\n emits: [\"updateValue\", \"insertExcelData\"],\n setup(__props, { emit }: { emit: ({\n (event: 'updateValue', payload: string): void\n (event: 'insertExcelData', payload: string[][]): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst textareaRef = ref()\nconst text = ref('')\nconst isFocus = ref(false)\n\n// 自定义v-modal,同步数据\n// 当文本框聚焦时,不执行数据同步\nwatch(() => props.value, () => {\n if (isFocus.value) return\n text.value = props.value\n if (textareaRef.value) textareaRef.value.innerHTML = props.value\n}, { immediate: true })\n\nconst handleInput = () => {\n if (!textareaRef.value) return\n const text = textareaRef.value.innerHTML\n emit('updateValue', text)\n}\n\n// 聚焦时更新焦点标记,并监听粘贴事件\nconst handleFocus = () => {\n isFocus.value = true\n\n if (!textareaRef.value) return\n textareaRef.value.onpaste = (e: ClipboardEvent) => {\n e.preventDefault()\n if (!e.clipboardData) return\n\n const clipboardDataFirstItem = e.clipboardData.items[0]\n\n if (clipboardDataFirstItem && clipboardDataFirstItem.kind === 'string' && clipboardDataFirstItem.type === 'text/plain') {\n clipboardDataFirstItem.getAsString(text => {\n const clipboardData = pasteCustomClipboardString(text)\n if (typeof clipboardData === 'object') return\n \n const excelData = pasteExcelClipboardString(text)\n if (excelData) {\n emit('insertExcelData', excelData)\n if (textareaRef.value) textareaRef.value.innerHTML = excelData[0][0]\n return\n }\n\n emit('updateValue', text)\n document.execCommand('insertText', false, text)\n })\n }\n }\n}\n\n// 失焦时更新焦点标记,清除粘贴事件监听\nconst handleBlur = () => {\n isFocus.value = false\n if (textareaRef.value) textareaRef.value.onpaste = null\n}\n\n// 清除粘贴事件监听\nonUnmounted(() => {\n if (textareaRef.value) textareaRef.value.onpaste = null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"custom-textarea\",\n ref_key: \"textareaRef\",\n ref: textareaRef,\n onFocus: handleFocus,\n onBlur: handleBlur,\n onInput: _cache[0] || (_cache[0] = ($event: any) => (handleInput())),\n innerHTML: text.value\n }, null, 40, _hoisted_1))\n}\n}\n\n})","import script from \"./CustomTextarea.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./CustomTextarea.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./CustomTextarea.vue?vue&type=style&index=0&id=cdb58a1e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-cdb58a1e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, createBlock as _createBlock, vShow as _vShow, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-bae8c794\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 0,\n class: \"handler\"\n}\nconst _hoisted_2 = [\"onMousedown\"]\nconst _hoisted_3 = [\"width\"]\nconst _hoisted_4 = [\"rowspan\", \"colspan\", \"data-cell-index\", \"onMousedown\", \"onMouseenter\"]\nconst _hoisted_5 = [\"innerHTML\"]\n\nimport { computed, nextTick, onMounted, onUnmounted, PropType, ref, watch } from 'vue'\nimport { debounce, isEqual } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useMainStore } from '@/store'\nimport { PPTElementOutline, TableCell, TableTheme } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport { KEYS } from '@/configs/hotkey'\nimport { getTextStyle, formatText } from './utils'\nimport useHideCells from './useHideCells'\nimport useSubThemeColor from './useSubThemeColor'\n\nimport CustomTextarea from './CustomTextarea.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'EditableTable',\n props: {\n data: {\n type: Array as PropType,\n required: true,\n },\n width: {\n type: Number,\n required: true,\n },\n colWidths: {\n type: Array as PropType,\n required: true,\n },\n outline: {\n type: Object as PropType,\n required: true,\n },\n theme: {\n type: Object as PropType,\n },\n editable: {\n type: Boolean,\n default: true,\n },\n},\n emits: [\"change\", \"changeColWidths\", \"changeSelectedCells\"],\n setup(__props, { emit }: { emit: ({\n (event: 'change', payload: TableCell[][]): void\n (event: 'changeColWidths', payload: number[]): void\n (event: 'changeSelectedCells', payload: string[]): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n \nconst isStartSelect = ref(false)\nconst startCell = ref([])\nconst endCell = ref([])\n\nconst tableCells = computed({\n get() {\n return props.data\n },\n set(newData) {\n emit('change', newData)\n },\n})\n\n// 主题辅助色\nconst theme = computed(() => props.theme)\nconst { subThemeColor } = useSubThemeColor(theme)\n\n// 计算表格每一列的列宽和总宽度\nconst colSizeList = ref([])\nconst totalWidth = computed(() => colSizeList.value.reduce((a, b) => a + b))\nwatch([\n () => props.colWidths,\n () => props.width,\n], () => {\n colSizeList.value = props.colWidths.map(item => item * props.width)\n}, { immediate: true })\n\n// 清除全部单元格的选中状态\n// 表格处于不可编辑状态时也需要清除\nconst removeSelectedCells = () => {\n startCell.value = []\n endCell.value = []\n}\n\nwatch(() => props.editable, () => {\n if (!props.editable) removeSelectedCells()\n})\n\n// 用于拖拽列宽的操作节点位置\nconst dragLinePosition = computed(() => {\n const dragLinePosition: number[] = []\n for (let i = 1; i < colSizeList.value.length + 1; i++) {\n const pos = colSizeList.value.slice(0, i).reduce((a, b) => (a + b))\n dragLinePosition.push(pos)\n }\n return dragLinePosition\n})\n\n// 无效的单元格位置(被合并的单元格位置)集合\nconst cells = computed(() => props.data)\nconst { hideCells } = useHideCells(cells)\n\n// 当前选中的单元格集合\nconst selectedCells = computed(() => {\n if (!startCell.value.length) return []\n const [startX, startY] = startCell.value\n\n if (!endCell.value.length) return [`${startX}_${startY}`]\n const [endX, endY] = endCell.value\n\n if (startX === endX && startY === endY) return [`${startX}_${startY}`]\n\n const selectedCells = []\n\n const minX = Math.min(startX, endX)\n const minY = Math.min(startY, endY)\n const maxX = Math.max(startX, endX)\n const maxY = Math.max(startY, endY)\n\n for (let i = 0; i < tableCells.value.length; i++) {\n const rowCells = tableCells.value[i]\n for (let j = 0; j < rowCells.length; j++) {\n if (i >= minX && i <= maxX && j >= minY && j <= maxY) selectedCells.push(`${i}_${j}`)\n }\n }\n return selectedCells\n})\n\nwatch(selectedCells, (value, oldValue) => {\n if (isEqual(value, oldValue)) return\n emit('changeSelectedCells', selectedCells.value)\n})\n\n// 当前激活的单元格:当且仅当只有一个选中单元格时,该单元格为激活的单元格\nconst activedCell = computed(() => {\n if (selectedCells.value.length > 1) return null\n return selectedCells.value[0]\n})\n\n// 当前选中的单元格位置范围\nconst selectedRange = computed(() => {\n if (!startCell.value.length) return null\n const [startX, startY] = startCell.value\n\n if (!endCell.value.length) return { row: [startX, startX], col: [startY, startY] }\n const [endX, endY] = endCell.value\n\n if (startX === endX && startY === endY) return { row: [startX, startX], col: [startY, startY] }\n\n const minX = Math.min(startX, endX)\n const minY = Math.min(startY, endY)\n const maxX = Math.max(startX, endX)\n const maxY = Math.max(startY, endY)\n\n return {\n row: [minX, maxX],\n col: [minY, maxY],\n }\n})\n\n// 设置选中单元格状态(鼠标点击或拖选)\nconst handleMouseup = () => isStartSelect.value = false\n\nconst handleCellMousedown = (e: MouseEvent, rowIndex: number, colIndex: number) => {\n if (e.button === 0) {\n endCell.value = []\n isStartSelect.value = true\n startCell.value = [rowIndex, colIndex]\n }\n}\n\nconst handleCellMouseenter = (rowIndex: number, colIndex: number) => {\n if (!isStartSelect.value) return\n endCell.value = [rowIndex, colIndex]\n}\n\nonMounted(() => {\n document.addEventListener('mouseup', handleMouseup)\n})\nonUnmounted(() => {\n document.removeEventListener('mouseup', handleMouseup)\n})\n\n// 判断某位置是否为无效单元格(被合并掉的位置)\nconst isHideCell = (rowIndex: number, colIndex: number) => hideCells.value.includes(`${rowIndex}_${colIndex}`)\n\n// 选中指定的列\nconst selectCol = (index: number) => {\n const maxRow = tableCells.value.length - 1\n startCell.value = [0, index]\n endCell.value = [maxRow, index]\n}\n\n// 选中指定的行\nconst selectRow = (index: number) => {\n const maxCol = tableCells.value[index].length - 1\n startCell.value = [index, 0]\n endCell.value = [index, maxCol]\n}\n\n// 选中全部单元格\nconst selectAll = () => {\n const maxRow = tableCells.value.length - 1\n const maxCol = tableCells.value[maxRow].length - 1\n startCell.value = [0, 0]\n endCell.value = [maxRow, maxCol]\n}\n\n// 删除一行\nconst deleteRow = (rowIndex: number) => {\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n\n const targetCells = tableCells.value[rowIndex]\n const hideCellsPos = []\n for (let i = 0; i < targetCells.length; i++) {\n if (isHideCell(rowIndex, i)) hideCellsPos.push(i)\n }\n \n for (const pos of hideCellsPos) {\n for (let i = rowIndex; i >= 0; i--) {\n if (!isHideCell(i, pos)) {\n _tableCells[i][pos].rowspan = _tableCells[i][pos].rowspan - 1\n break\n }\n }\n }\n\n _tableCells.splice(rowIndex, 1)\n tableCells.value = _tableCells\n}\n\n// 删除一列\nconst deleteCol = (colIndex: number) => {\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n\n const hideCellsPos = []\n for (let i = 0; i < tableCells.value.length; i++) {\n if (isHideCell(i, colIndex)) hideCellsPos.push(i)\n }\n\n for (const pos of hideCellsPos) {\n for (let i = colIndex; i >= 0; i--) {\n if (!isHideCell(pos, i)) {\n _tableCells[pos][i].colspan = _tableCells[pos][i].colspan - 1\n break\n }\n }\n }\n\n tableCells.value = _tableCells.map(item => {\n item.splice(colIndex, 1)\n return item\n })\n colSizeList.value.splice(colIndex, 1)\n emit('changeColWidths', colSizeList.value)\n}\n\n// 插入一行\nconst insertRow = (rowIndex: number) => {\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n\n const rowCells: TableCell[] = []\n for (let i = 0; i < _tableCells[0].length; i++) {\n rowCells.push({\n colspan: 1,\n rowspan: 1,\n text: '',\n id: nanoid(10),\n })\n }\n\n _tableCells.splice(rowIndex, 0, rowCells)\n tableCells.value = _tableCells\n}\n\n// 插入一列\nconst insertCol = (colIndex: number) => {\n tableCells.value = tableCells.value.map(item => {\n const cell = {\n colspan: 1,\n rowspan: 1,\n text: '',\n id: nanoid(10),\n }\n item.splice(colIndex, 0, cell)\n return item\n })\n colSizeList.value.splice(colIndex, 0, 100)\n emit('changeColWidths', colSizeList.value)\n}\n\n// 填充指定的行/列数\nconst fillTable = (rowCount: number, colCount: number) => {\n let _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n const defaultCell = { colspan: 1, rowspan: 1, text: '' }\n \n if (rowCount) {\n const newRows = []\n for (let i = 0; i < rowCount; i++) {\n const rowCells: TableCell[] = []\n for (let j = 0; j < _tableCells[0].length; j++) {\n rowCells.push({\n ...defaultCell,\n id: nanoid(10),\n })\n }\n newRows.push(rowCells)\n }\n _tableCells = [..._tableCells, ...newRows]\n }\n if (colCount) {\n _tableCells = _tableCells.map(item => {\n const cells: TableCell[] = []\n for (let i = 0; i < colCount; i++) {\n const cell = {\n ...defaultCell,\n id: nanoid(10),\n }\n cells.push(cell)\n }\n return [...item, ...cells]\n })\n colSizeList.value = [...colSizeList.value, ...new Array(colCount).fill(100)]\n emit('changeColWidths', colSizeList.value)\n }\n\n tableCells.value = _tableCells\n}\n\n// 合并单元格\nconst mergeCells = () => {\n const [startX, startY] = startCell.value\n const [endX, endY] = endCell.value\n\n const minX = Math.min(startX, endX)\n const minY = Math.min(startY, endY)\n const maxX = Math.max(startX, endX)\n const maxY = Math.max(startY, endY)\n\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n \n _tableCells[minX][minY].rowspan = maxX - minX + 1\n _tableCells[minX][minY].colspan = maxY - minY + 1\n\n tableCells.value = _tableCells\n removeSelectedCells()\n}\n\n// 拆分单元格\nconst splitCells = (rowIndex: number, colIndex: number) => {\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n _tableCells[rowIndex][colIndex].rowspan = 1\n _tableCells[rowIndex][colIndex].colspan = 1\n\n tableCells.value = _tableCells\n removeSelectedCells()\n}\n\n// 鼠标拖拽调整列宽\nconst handleMousedownColHandler = (e: MouseEvent, colIndex: number) => {\n removeSelectedCells()\n let isMouseDown = true\n\n const originWidth = colSizeList.value[colIndex]\n const startPageX = e.pageX\n\n const minWidth = 50\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n \n const moveX = (e.pageX - startPageX) / canvasScale.value\n const width = originWidth + moveX < minWidth ? minWidth : Math.round(originWidth + moveX)\n\n colSizeList.value[colIndex] = width\n }\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n emit('changeColWidths', colSizeList.value)\n }\n}\n\n// 清空选中单元格内的文字\nconst clearSelectedCellText = () => {\n const _tableCells: TableCell[][] = JSON.parse(JSON.stringify(tableCells.value))\n\n for (let i = 0; i < _tableCells.length; i++) {\n for (let j = 0; j < _tableCells[i].length; j++) {\n if (selectedCells.value.includes(`${i}_${j}`)) {\n _tableCells[i][j].text = ''\n }\n }\n }\n tableCells.value = _tableCells\n}\n\n// 将焦点移动到下一个单元格\n// 当前行右边有单元格时,焦点右移\n// 当前行右边无单元格(已处在行末),且存在下一行时,焦点移动至下一行行首\n// 当前行右边无单元格(已处在行末),且不存在下一行(已处在最后一行)时,新建一行并将焦点移动至下一行行首\nconst tabActiveCell = () => {\n const getNextCell = (i: number, j: number): [number, number] | null => {\n if (!tableCells.value[i]) return null\n if (!tableCells.value[i][j]) return getNextCell(i + 1, 0)\n if (isHideCell(i, j)) return getNextCell(i, j + 1)\n return [i, j]\n }\n\n endCell.value = []\n\n const nextRow = startCell.value[0]\n const nextCol = startCell.value[1] + 1\n\n const nextCell = getNextCell(nextRow, nextCol)\n if (!nextCell) {\n insertRow(nextRow + 1)\n startCell.value = [nextRow + 1, 0]\n }\n else startCell.value = nextCell\n\n // 移动焦点后自动聚焦文本\n nextTick(() => {\n const textRef = document.querySelector('.cell-text.active') as HTMLInputElement\n if (textRef) textRef.focus()\n })\n}\n\n// 表格快捷键监听\nconst keydownListener = (e: KeyboardEvent) => {\n if (!props.editable || !selectedCells.value.length) return\n\n const key = e.key.toUpperCase()\n if (selectedCells.value.length < 2) {\n if (key === KEYS.TAB) {\n e.preventDefault()\n tabActiveCell()\n }\n if (e.ctrlKey && key === KEYS.UP) {\n e.preventDefault()\n const rowIndex = +selectedCells.value[0].split('_')[0]\n insertRow(rowIndex)\n }\n if (e.ctrlKey && key === KEYS.DOWN) {\n e.preventDefault()\n const rowIndex = +selectedCells.value[0].split('_')[0]\n insertRow(rowIndex + 1)\n }\n if (e.ctrlKey && key === KEYS.LEFT) {\n e.preventDefault()\n const colIndex = +selectedCells.value[0].split('_')[1]\n insertCol(colIndex)\n }\n if (e.ctrlKey && key === KEYS.RIGHT) {\n e.preventDefault()\n const colIndex = +selectedCells.value[0].split('_')[1]\n insertCol(colIndex + 1)\n }\n }\n else if (key === KEYS.DELETE) {\n clearSelectedCellText()\n }\n}\n\nonMounted(() => {\n document.addEventListener('keydown', keydownListener)\n})\nonUnmounted(() => {\n document.removeEventListener('keydown', keydownListener)\n})\n\n// 单元格文字输入时更新表格数据\nconst handleInput = debounce(function(value, rowIndex, colIndex) {\n tableCells.value[rowIndex][colIndex].text = value\n emit('change', tableCells.value)\n}, 300, { trailing: true })\n\n// 插入来自Excel的数据,表格的行/列数不够时自动补足\nconst insertExcelData = (data: string[][], rowIndex: number, colIndex: number) => {\n const maxRow = data.length\n const maxCol = data[0].length\n\n let fillRowCount = 0\n let fillColCount = 0\n if (rowIndex + maxRow > tableCells.value.length) fillRowCount = rowIndex + maxRow - tableCells.value.length\n if (colIndex + maxCol > tableCells.value[0].length) fillColCount = colIndex + maxCol - tableCells.value[0].length\n if (fillRowCount || fillColCount) fillTable(fillRowCount, fillColCount)\n\n nextTick(() => {\n for (let i = 0; i < maxRow; i++) {\n for (let j = 0; j < maxCol; j++) {\n if (tableCells.value[rowIndex + i][colIndex + j]) {\n tableCells.value[rowIndex + i][colIndex + j].text = data[i][j]\n }\n }\n }\n emit('change', tableCells.value)\n })\n}\n\n// 获取有效的单元格(排除掉被合并的单元格)\nconst getEffectiveTableCells = () => {\n const effectiveTableCells = []\n\n for (let i = 0; i < tableCells.value.length; i++) {\n const rowCells = tableCells.value[i]\n const _rowCells = []\n for (let j = 0; j < rowCells.length; j++) {\n if (!isHideCell(i, j)) _rowCells.push(rowCells[j])\n }\n if (_rowCells.length) effectiveTableCells.push(_rowCells)\n }\n\n return effectiveTableCells\n}\n\n// 检查是否可以删除行和列:有效的行/列数大于1\nconst checkCanDeleteRowOrCol = () => {\n const effectiveTableCells = getEffectiveTableCells()\n const canDeleteRow = effectiveTableCells.length > 1\n const canDeleteCol = effectiveTableCells[0].length > 1\n\n return { canDeleteRow, canDeleteCol }\n}\n\n// 检查是否可以合并或拆分\n// 必须多选才可以合并\n// 必须单选且所选单元格为合并单元格才可以拆分\nconst checkCanMergeOrSplit = (rowIndex: number, colIndex: number) => {\n const isMultiSelected = selectedCells.value.length > 1\n const targetCell = tableCells.value[rowIndex][colIndex]\n\n const canMerge = isMultiSelected\n const canSplit = !isMultiSelected && (targetCell.rowspan > 1 || targetCell.colspan > 1)\n\n return { canMerge, canSplit }\n}\n\nconst contextmenus = (el: HTMLElement): ContextmenuItem[] => {\n const cellIndex = el.dataset.cellIndex as string\n const rowIndex = +cellIndex.split('_')[0]\n const colIndex = +cellIndex.split('_')[1]\n\n if (!selectedCells.value.includes(`${rowIndex}_${colIndex}`)) {\n startCell.value = [rowIndex, colIndex]\n endCell.value = []\n }\n\n const { canMerge, canSplit } = checkCanMergeOrSplit(rowIndex, colIndex)\n const { canDeleteRow, canDeleteCol } = checkCanDeleteRowOrCol()\n\n return [\n {\n text: '插入列',\n children: [\n { text: '到左侧', handler: () => insertCol(colIndex) },\n { text: '到右侧', handler: () => insertCol(colIndex + 1) },\n ],\n },\n {\n text: '插入行',\n children: [\n { text: '到上方', handler: () => insertRow(rowIndex) },\n { text: '到下方', handler: () => insertRow(rowIndex + 1) },\n ],\n },\n {\n text: '删除列',\n disable: !canDeleteCol,\n handler: () => deleteCol(colIndex),\n },\n {\n text: '删除行',\n disable: !canDeleteRow,\n handler: () => deleteRow(rowIndex),\n },\n { divider: true },\n {\n text: '合并单元格',\n disable: !canMerge,\n handler: mergeCells,\n },\n {\n text: '取消合并单元格',\n disable: !canSplit,\n handler: () => splitCells(rowIndex, colIndex),\n },\n { divider: true },\n {\n text: '选中当前列',\n handler: () => selectCol(colIndex),\n },\n {\n text: '选中当前行',\n handler: () => selectRow(rowIndex),\n },\n {\n text: '选中全部单元格',\n handler: selectAll,\n },\n ]\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"editable-table\",\n style: _normalizeStyle({ width: _unref(totalWidth) + 'px' })\n }, [\n (__props.editable)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(dragLinePosition), (pos, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"drag-line\",\n key: index,\n style: _normalizeStyle({ left: pos + 'px' }),\n onMousedown: $event => handleMousedownColHandler($event, index)\n }, null, 44, _hoisted_2))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"table\", {\n class: _normalizeClass({\n 'theme': _unref(theme),\n 'row-header': _unref(theme)?.rowHeader,\n 'row-footer': _unref(theme)?.rowFooter,\n 'col-header': _unref(theme)?.colHeader,\n 'col-footer': _unref(theme)?.colFooter,\n }),\n style: _normalizeStyle(`--themeColor: ${_unref(theme)?.color}; --subThemeColor1: ${_unref(subThemeColor)[0]}; --subThemeColor2: ${_unref(subThemeColor)[1]}`)\n }, [\n _createElementVNode(\"colgroup\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(colSizeList.value, (width, index) => {\n return (_openBlock(), _createElementBlock(\"col\", {\n span: \"1\",\n key: index,\n width: width\n }, null, 8, _hoisted_3))\n }), 128))\n ]),\n _createElementVNode(\"tbody\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(tableCells), (rowCells, rowIndex) => {\n return (_openBlock(), _createElementBlock(\"tr\", { key: rowIndex }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(rowCells, (cell, colIndex) => {\n return _withDirectives((_openBlock(), _createElementBlock(\"td\", {\n class: _normalizeClass([\"cell\", {\n 'selected': _unref(selectedCells).includes(`${rowIndex}_${colIndex}`) && _unref(selectedCells).length > 1,\n 'active': _unref(activedCell) === `${rowIndex}_${colIndex}`,\n }]),\n style: _normalizeStyle({\n borderStyle: __props.outline.style,\n borderColor: __props.outline.color,\n borderWidth: __props.outline.width + 'px',\n ..._unref(getTextStyle)(cell.style),\n }),\n key: cell.id,\n rowspan: cell.rowspan,\n colspan: cell.colspan,\n \"data-cell-index\": `${rowIndex}_${colIndex}`,\n onMousedown: $event => handleCellMousedown($event, rowIndex, colIndex),\n onMouseenter: ($event: any) => (handleCellMouseenter(rowIndex, colIndex))\n }, [\n (_unref(activedCell) === `${rowIndex}_${colIndex}`)\n ? (_openBlock(), _createBlock(CustomTextarea, {\n key: 0,\n class: _normalizeClass([\"cell-text\", { 'active': _unref(activedCell) === `${rowIndex}_${colIndex}` }]),\n value: cell.text,\n onUpdateValue: value => _unref(handleInput)(value, rowIndex, colIndex),\n onInsertExcelData: value => insertExcelData(value, rowIndex, colIndex)\n }, null, 8, [\"class\", \"value\", \"onUpdateValue\", \"onInsertExcelData\"]))\n : (_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: \"cell-text\",\n innerHTML: _unref(formatText)(cell.text)\n }, null, 8, _hoisted_5))\n ], 46, _hoisted_4)), [\n [_vShow, !_unref(hideCells).includes(`${rowIndex}_${colIndex}`)],\n [_directive_contextmenu, (el) => contextmenus(el)]\n ])\n }), 128))\n ]))\n }), 128))\n ])\n ], 6)\n ], 4))\n}\n}\n\n})","import script from \"./EditableTable.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./EditableTable.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./EditableTable.vue?vue&type=style&index=0&id=bae8c794&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-bae8c794\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { withModifiers as _withModifiers, createVNode as _createVNode, unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-6391c486\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\n\nimport { nextTick, onMounted, onUnmounted, PropType, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTTableElement, TableCell } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport EditableTable from './EditableTable.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTTableElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { canvasScale, handleElementId, isScaling } = storeToRefs(mainStore)\n\nconst elementRef = ref()\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo)\n}\n\n// 更新表格的可编辑状态,表格处于编辑状态时需要禁用全局快捷键\nconst editable = ref(false)\n\nwatch(handleElementId, () => {\n if (handleElementId.value !== props.elementInfo.id) editable.value = false\n})\n\nwatch(editable, () => {\n mainStore.setDisableHotkeysState(editable.value)\n})\n\nconst startEdit = () => {\n if (!props.elementInfo.lock) editable.value = true\n}\n\n// 监听表格元素的尺寸变化,当高度变化时,更新高度到vuex\n// 如果高度变化时正处在缩放操作中,则等待缩放操作结束后再更新\nconst realHeightCache = ref(-1)\n\nwatch(isScaling, () => {\n if (handleElementId.value !== props.elementInfo.id) return\n\n if (isScaling.value) editable.value = false\n\n if (!isScaling.value && realHeightCache.value !== -1) {\n slidesStore.updateElement({\n id: props.elementInfo.id,\n props: { height: realHeightCache.value },\n })\n realHeightCache.value = -1\n }\n})\n\nconst updateTableElementHeight = (entries: ResizeObserverEntry[]) => {\n const contentRect = entries[0].contentRect\n if (!elementRef.value) return\n\n const realHeight = contentRect.height\n\n if (props.elementInfo.height !== realHeight) {\n if (!isScaling.value) {\n slidesStore.updateElement({\n id: props.elementInfo.id,\n props: { height: realHeight },\n })\n }\n else realHeightCache.value = realHeight\n }\n}\n\nconst resizeObserver = new ResizeObserver(updateTableElementHeight)\n\nonMounted(() => {\n if (elementRef.value) resizeObserver.observe(elementRef.value)\n})\nonUnmounted(() => {\n if (elementRef.value) resizeObserver.unobserve(elementRef.value)\n})\n\n// 更新表格内容数据\nconst updateTableCells = (data: TableCell[][]) => {\n slidesStore.updateElement({\n id: props.elementInfo.id, \n props: { data },\n })\n addHistorySnapshot()\n}\n\n// 更新表格的列宽数据\nconst updateColWidths = (widths: number[]) => {\n const width = widths.reduce((a, b) => a + b)\n const colWidths = widths.map(item => item / width)\n\n slidesStore.updateElement({\n id: props.elementInfo.id, \n props: { width, colWidths },\n })\n addHistorySnapshot()\n}\n\n// 更新表格当前选中的单元格\nconst updateSelectedCells = (cells: string[]) => {\n nextTick(() => mainStore.setSelectedTableCells(cells))\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-table\", { 'lock': __props.elementInfo.lock }]),\n ref_key: \"elementRef\",\n ref: elementRef,\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(EditableTable, {\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(() => {}, [\"stop\"])),\n data: __props.elementInfo.data,\n width: __props.elementInfo.width,\n colWidths: __props.elementInfo.colWidths,\n outline: __props.elementInfo.outline,\n theme: __props.elementInfo.theme,\n editable: editable.value,\n onChange: _cache[1] || (_cache[1] = data => updateTableCells(data)),\n onChangeColWidths: _cache[2] || (_cache[2] = widths => updateColWidths(widths)),\n onChangeSelectedCells: _cache[3] || (_cache[3] = cells => updateSelectedCells(cells))\n }, null, 8, [\"data\", \"width\", \"colWidths\", \"outline\", \"theme\", \"editable\"]),\n (!editable.value || __props.elementInfo.lock)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: _normalizeClass([\"table-mask\", { 'lock': __props.elementInfo.lock }]),\n onDblclick: _cache[4] || (_cache[4] = ($event: any) => (startEdit())),\n onMousedown: _cache[5] || (_cache[5] = $event => handleSelectElement($event)),\n onTouchstart: _cache[6] || (_cache[6] = $event => handleSelectElement($event))\n }, [\n _createElementVNode(\"div\", {\n class: \"mask-tip\",\n style: _normalizeStyle({ transform: `scale(${ 1 / _unref(canvasScale) })` })\n }, \"双击编辑\", 4)\n ], 34))\n : _createCommentVNode(\"\", true)\n ])), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=6391c486&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6391c486\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveDirective as _resolveDirective, withDirectives as _withDirectives, normalizeStyle as _normalizeStyle, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-31390388\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\", \"stroke\", \"stroke-width\"]\nconst _hoisted_2 = [\"transform\"]\nconst _hoisted_3 = [\"d\"]\n\nimport { PropType } from 'vue'\nimport { PPTLatexElement } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTLatexElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo)\n}\n\nconst openLatexEditor = () => {\n emitter.emit(EmitterEvents.OPEN_LATEX_EDITOR)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-latex\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n onMousedown: _cache[0] || (_cache[0] = $event => handleSelectElement($event)),\n onTouchstart: _cache[1] || (_cache[1] = $event => handleSelectElement($event)),\n onDblclick: _cache[2] || (_cache[2] = ($event: any) => (openLatexEditor()))\n }, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n stroke: __props.elementInfo.color,\n \"stroke-width\": __props.elementInfo.strokeWidth,\n fill: \"none\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }, [\n _createElementVNode(\"g\", {\n transform: `scale(${__props.elementInfo.width / __props.elementInfo.viewBox[0]}, ${__props.elementInfo.height / __props.elementInfo.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`\n }, [\n _createElementVNode(\"path\", {\n d: __props.elementInfo.path\n }, null, 8, _hoisted_3)\n ], 8, _hoisted_2)\n ], 8, _hoisted_1))\n ], 32)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=31390388&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-31390388\"]])\n\nexport default __exports__","/* eslint-disable */\n\nimport { onMounted, Ref } from 'vue'\n\nexport default (\n src: string,\n videoRef: Ref,\n) => {\n onMounted(() => {\n if (!videoRef.value) return\n\n let type = 'normal'\n if (/m3u8(#|\\?|$)/i.exec(src)) type = 'hls'\n else if (/.flv(#|\\?|$)/i.exec(src)) type = 'flv'\n\n if (videoRef.value && type === 'hls' && (videoRef.value.canPlayType('application/x-mpegURL') || videoRef.value.canPlayType('application/vnd.apple.mpegURL'))) {\n type = 'normal'\n }\n\n if (type === 'hls') {\n const Hls = (window as any).Hls\n \n if (Hls && Hls.isSupported()) {\n const hls = new Hls()\n hls.loadSource(src)\n hls.attachMedia(videoRef.value)\n }\n }\n else if (type === 'flv') {\n const flvjs = (window as any).flvjs\n if (flvjs && flvjs.isSupported()) {\n const flvPlayer = flvjs.createPlayer({\n type: 'flv',\n url: src,\n })\n flvPlayer.attachMediaElement(videoRef.value)\n flvPlayer.load()\n }\n }\n })\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, unref as _unref, normalizeStyle as _normalizeStyle, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-2fc4c202\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"src\", \"poster\"]\nconst _hoisted_2 = { class: \"bezel\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"controller-mask\" }, null, -1))\nconst _hoisted_4 = { class: \"controller\" }\nconst _hoisted_5 = { class: \"icons icons-left\" }\nconst _hoisted_6 = { class: \"icon-content\" }\nconst _hoisted_7 = { class: \"volume\" }\nconst _hoisted_8 = { class: \"icon-content\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"thumb\" }, null, -1))\nconst _hoisted_10 = [\n _hoisted_9\n]\nconst _hoisted_11 = { class: \"time\" }\nconst _hoisted_12 = { class: \"ptime\" }\nconst _hoisted_13 = /*#__PURE__*/_createTextVNode(\" / \")\nconst _hoisted_14 = { class: \"dtime\" }\nconst _hoisted_15 = { class: \"icons icons-right\" }\nconst _hoisted_16 = { class: \"speed\" }\nconst _hoisted_17 = { class: \"icon speed-icon\" }\nconst _hoisted_18 = [\"onClick\"]\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"icon-content\" }, \"循环\", -1))\nconst _hoisted_20 = [\n _hoisted_19\n]\nconst _hoisted_21 = { class: \"bar\" }\nconst _hoisted_22 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"thumb\" }, null, -1))\nconst _hoisted_23 = [\n _hoisted_22\n]\n\nimport { computed, ref } from 'vue'\nimport useMSE from './useMSE'\nimport { message } from 'ant-design-vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n src: {\n type: String,\n required: true,\n },\n poster: {\n type: String,\n default: '',\n },\n scale: {\n type: Number,\n default: 1,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst secondToTime = (second = 0) => {\n if (second === 0 || isNaN(second)) return '00:00'\n\n const add0 = (num: number) => (num < 10 ? '0' + num : '' + num)\n const hour = Math.floor(second / 3600)\n const min = Math.floor((second - hour * 3600) / 60)\n const sec = Math.floor(second - hour * 3600 - min * 60)\n return (hour > 0 ? [hour, min, sec] : [min, sec]).map(add0).join(':')\n}\n\nconst getBoundingClientRectViewLeft = (element: HTMLElement) => {\n return element.getBoundingClientRect().left\n}\n\nconst videoRef = ref()\nconst playBarWrap = ref()\nconst volumeBarRef = ref()\n\nconst volume = ref(0.5)\nconst paused = ref(true)\nconst currentTime = ref(0)\nconst duration = ref(0)\nconst loaded = ref(0)\nconst loop = ref(false)\nconst bezelTransition = ref(false)\nconst playbackRate = ref(1)\n\nconst playBarTimeVisible = ref(false)\nconst playBarTime = ref('00:00')\nconst playBarTimeLeft = ref('0')\n\nconst ptime = computed(() => secondToTime(currentTime.value))\nconst dtime = computed(() => secondToTime(duration.value))\nconst playedBarWidth = computed(() => currentTime.value / duration.value * 100 + '%')\nconst loadedBarWidth = computed(() => loaded.value / duration.value * 100 + '%')\nconst volumeBarWidth = computed(() => volume.value * 100 + '%')\n\nconst speedMenuVisible = ref(false)\nconst speedOptions = [\n { label: '2x', value: 2 },\n { label: '1.5x', value: 1.5 },\n { label: '1.25x', value: 1.25 },\n { label: '1x', value: 1 },\n { label: '0.75x', value: 0.75 },\n { label: '0.5x', value: 0.5 },\n]\n\nconst seek = (time: number) => {\n if (!videoRef.value) return\n\n time = Math.max(time, 0)\n time = Math.min(time, duration.value)\n\n videoRef.value.currentTime = time\n currentTime.value = time\n}\n\nconst play = () => {\n if (!videoRef.value) return\n\n paused.value = false\n videoRef.value.play()\n bezelTransition.value = true\n}\n\nconst pause = () => {\n if (!videoRef.value) return\n\n paused.value = true\n videoRef.value.pause()\n bezelTransition.value = true\n}\n\nconst toggle = () => {\n if (paused.value) play() \n else pause()\n}\n\nconst setVolume = (percentage: number) => {\n if (!videoRef.value) return\n\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n\n videoRef.value.volume = percentage\n volume.value = percentage\n if (videoRef.value.muted && percentage !== 0) videoRef.value.muted = false\n}\n\nconst speed = (rate: number) => {\n if (videoRef.value) videoRef.value.playbackRate = rate\n playbackRate.value = rate\n}\n\nconst handleDurationchange = () => {\n duration.value = videoRef.value?.duration || 0\n}\n\nconst handleTimeupdate = () => {\n currentTime.value = videoRef.value?.currentTime || 0\n}\n\nconst handleEnded = () => {\n if (!loop.value) pause()\n else {\n seek(0)\n play()\n }\n}\n\nconst handleProgress = () => {\n loaded.value = videoRef.value?.buffered.length ? videoRef.value.buffered.end(videoRef.value.buffered.length - 1) : 0\n}\n\nconst handleError = () => message.error('视频加载失败')\n\nconst thumbMove = (e: MouseEvent | TouchEvent) => {\n if (!videoRef.value || !playBarWrap.value) return\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n let percentage = (clientX - getBoundingClientRectViewLeft(playBarWrap.value)) / playBarWrap.value.clientWidth\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n const time = percentage * duration.value\n\n videoRef.value.currentTime = time\n currentTime.value = time\n}\n\nconst thumbUp = (e: MouseEvent | TouchEvent) => {\n if (!videoRef.value || !playBarWrap.value) return\n\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n let percentage = (clientX - getBoundingClientRectViewLeft(playBarWrap.value)) / playBarWrap.value.clientWidth\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n const time = percentage * duration.value\n\n videoRef.value.currentTime = time\n currentTime.value = time\n\n document.removeEventListener('mousemove', thumbMove)\n document.removeEventListener('touchmove', thumbMove)\n document.removeEventListener('mouseup', thumbUp)\n document.removeEventListener('touchend', thumbUp)\n}\n\nconst handleMousedownPlayBar = () => {\n document.addEventListener('mousemove', thumbMove)\n document.addEventListener('touchmove', thumbMove)\n document.addEventListener('mouseup', thumbUp)\n document.addEventListener('touchend', thumbUp)\n}\n\nconst volumeMove = (e: MouseEvent | TouchEvent) => {\n if (!volumeBarRef.value) return\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n const percentage = (clientX - getBoundingClientRectViewLeft(volumeBarRef.value)) / 45\n setVolume(percentage)\n}\n\nconst volumeUp = () => {\n document.removeEventListener('mousemove', volumeMove)\n document.removeEventListener('touchmove', volumeMove)\n document.removeEventListener('mouseup', volumeUp)\n document.removeEventListener('touchend', volumeUp)\n}\n\nconst handleMousedownVolumeBar = () => {\n document.addEventListener('mousemove', volumeMove)\n document.addEventListener('touchmove', volumeMove)\n document.addEventListener('mouseup', volumeUp)\n document.addEventListener('touchend', volumeUp)\n}\n\nconst handleClickVolumeBar = (e: MouseEvent) => {\n if (!volumeBarRef.value) return\n const percentage = (e.clientX - getBoundingClientRectViewLeft(volumeBarRef.value)) / 45\n setVolume(percentage)\n}\n\nconst handleMousemovePlayBar = (e: MouseEvent) => {\n if (duration.value && playBarWrap.value) {\n const px = playBarWrap.value.getBoundingClientRect().left\n const tx = e.clientX - px\n if (tx < 0 || tx > playBarWrap.value.offsetWidth) return\n\n const time = duration.value * (tx / playBarWrap.value.offsetWidth)\n playBarTimeLeft.value = `${tx - (time >= 3600 ? 25 : 20)}px`\n playBarTime.value = secondToTime(time)\n playBarTimeVisible.value = true\n }\n}\n\nconst toggleVolume = () => {\n if (!videoRef.value) return\n\n if (videoRef.value.muted) {\n videoRef.value.muted = false\n setVolume(0.5)\n }\n else {\n videoRef.value.muted = true\n setVolume(0)\n }\n}\n\nconst toggleLoop = () => {\n loop.value = !loop.value\n}\n\nconst autoHideControllerTimer = ref(-1)\nconst hideController = ref(false)\nconst autoHideController = () => {\n hideController.value = false\n clearTimeout(autoHideControllerTimer.value)\n autoHideControllerTimer.value = setTimeout(() => {\n if (videoRef.value?.played.length) hideController.value = true\n }, 3000)\n}\n\nuseMSE(props.src, videoRef)\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPause = _resolveComponent(\"IconPause\")!\n const _component_IconPlayOne = _resolveComponent(\"IconPlayOne\")!\n const _component_IconVolumeMute = _resolveComponent(\"IconVolumeMute\")!\n const _component_IconVolumeNotice = _resolveComponent(\"IconVolumeNotice\")!\n const _component_IconVolumeSmall = _resolveComponent(\"IconVolumeSmall\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"video-player\", { 'hide-controller': hideController.value }]),\n style: _normalizeStyle({\n width: __props.width * __props.scale + 'px',\n height: __props.height * __props.scale + 'px',\n transform: `scale(${1 / __props.scale})`,\n }),\n onMousemove: _cache[22] || (_cache[22] = ($event: any) => (autoHideController())),\n onClick: _cache[23] || (_cache[23] = ($event: any) => (autoHideController()))\n }, [\n _createElementVNode(\"div\", {\n class: \"video-wrap\",\n onClick: _cache[8] || (_cache[8] = ($event: any) => (toggle()))\n }, [\n _createElementVNode(\"video\", {\n class: \"video\",\n ref_key: \"videoRef\",\n ref: videoRef,\n src: __props.src,\n poster: __props.poster,\n \"webkit-playsinline\": \"\",\n playsinline: \"\",\n onDurationchange: _cache[0] || (_cache[0] = ($event: any) => (handleDurationchange())),\n onTimeupdate: _cache[1] || (_cache[1] = ($event: any) => (handleTimeupdate())),\n onEnded: _cache[2] || (_cache[2] = ($event: any) => (handleEnded())),\n onProgress: _cache[3] || (_cache[3] = ($event: any) => (handleProgress())),\n onPlay: _cache[4] || (_cache[4] = ($event: any) => (autoHideController())),\n onPause: _cache[5] || (_cache[5] = ($event: any) => (autoHideController())),\n onError: _cache[6] || (_cache[6] = ($event: any) => (handleError()))\n }, null, 40, _hoisted_1),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"span\", {\n class: _normalizeClass([\"bezel-icon\", { 'bezel-transition': bezelTransition.value }]),\n onAnimationend: _cache[7] || (_cache[7] = ($event: any) => (bezelTransition.value = false))\n }, [\n (paused.value)\n ? (_openBlock(), _createBlock(_component_IconPause, { key: 0 }))\n : (_openBlock(), _createBlock(_component_IconPlayOne, { key: 1 }))\n ], 34)\n ])\n ]),\n _hoisted_3,\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", {\n class: \"icon play-icon\",\n onClick: _cache[9] || (_cache[9] = ($event: any) => (toggle()))\n }, [\n _createElementVNode(\"span\", _hoisted_6, [\n (paused.value)\n ? (_openBlock(), _createBlock(_component_IconPlayOne, { key: 0 }))\n : (_openBlock(), _createBlock(_component_IconPause, { key: 1 }))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"div\", {\n class: \"icon volume-icon\",\n onClick: _cache[10] || (_cache[10] = ($event: any) => (toggleVolume()))\n }, [\n _createElementVNode(\"span\", _hoisted_8, [\n (volume.value === 0)\n ? (_openBlock(), _createBlock(_component_IconVolumeMute, { key: 0 }))\n : (volume.value === 1)\n ? (_openBlock(), _createBlock(_component_IconVolumeNotice, { key: 1 }))\n : (_openBlock(), _createBlock(_component_IconVolumeSmall, { key: 2 }))\n ])\n ]),\n _createElementVNode(\"div\", {\n class: \"volume-bar-wrap\",\n onMousedown: _cache[11] || (_cache[11] = ($event: any) => (handleMousedownVolumeBar())),\n onTouchstart: _cache[12] || (_cache[12] = ($event: any) => (handleMousedownVolumeBar())),\n onClick: _cache[13] || (_cache[13] = $event => handleClickVolumeBar($event))\n }, [\n _createElementVNode(\"div\", {\n class: \"volume-bar\",\n ref_key: \"volumeBarRef\",\n ref: volumeBarRef\n }, [\n _createElementVNode(\"div\", {\n class: \"volume-bar-inner\",\n style: _normalizeStyle({ width: _unref(volumeBarWidth) })\n }, _hoisted_10, 4)\n ], 512)\n ], 32)\n ]),\n _createElementVNode(\"span\", _hoisted_11, [\n _createElementVNode(\"span\", _hoisted_12, _toDisplayString(_unref(ptime)), 1),\n _hoisted_13,\n _createElementVNode(\"span\", _hoisted_14, _toDisplayString(_unref(dtime)), 1)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_15, [\n _createElementVNode(\"div\", _hoisted_16, [\n _createElementVNode(\"div\", _hoisted_17, [\n _createElementVNode(\"span\", {\n class: \"icon-content\",\n onClick: _cache[14] || (_cache[14] = ($event: any) => (speedMenuVisible.value = !speedMenuVisible.value))\n }, \"倍速\"),\n (speedMenuVisible.value)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"speed-menu\",\n onMouseleave: _cache[15] || (_cache[15] = ($event: any) => (speedMenuVisible.value = false))\n }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(speedOptions, (item) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"speed-menu-item\", { 'active': item.value === playbackRate.value }]),\n key: item.label,\n onClick: ($event: any) => (speed(item.value))\n }, _toDisplayString(item.label), 11, _hoisted_18)\n }), 64))\n ], 32))\n : _createCommentVNode(\"\", true)\n ])\n ]),\n _createElementVNode(\"div\", {\n class: \"loop\",\n onClick: _cache[16] || (_cache[16] = ($event: any) => (toggleLoop()))\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"icon loop-icon\", { 'active': loop.value }])\n }, _hoisted_20, 2)\n ])\n ]),\n _createElementVNode(\"div\", {\n class: \"bar-wrap\",\n ref_key: \"playBarWrap\",\n ref: playBarWrap,\n onMousedown: _cache[17] || (_cache[17] = ($event: any) => (handleMousedownPlayBar())),\n onTouchstart: _cache[18] || (_cache[18] = ($event: any) => (handleMousedownPlayBar())),\n onMousemove: _cache[19] || (_cache[19] = $event => handleMousemovePlayBar($event)),\n onMouseenter: _cache[20] || (_cache[20] = ($event: any) => (playBarTimeVisible.value = true)),\n onMouseleave: _cache[21] || (_cache[21] = ($event: any) => (playBarTimeVisible.value = false))\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"bar-time\", { 'hidden': !playBarTimeVisible.value }]),\n style: _normalizeStyle({ left: playBarTimeLeft.value })\n }, _toDisplayString(playBarTime.value), 7),\n _createElementVNode(\"div\", _hoisted_21, [\n _createElementVNode(\"div\", {\n class: \"loaded\",\n style: _normalizeStyle({ width: _unref(loadedBarWidth) })\n }, null, 4),\n _createElementVNode(\"div\", {\n class: \"played\",\n style: _normalizeStyle({ width: _unref(playedBarWidth) })\n }, _hoisted_23, 4)\n ])\n ], 544)\n ])\n ], 38))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=2fc4c202&scoped=true&lang=scss\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-2fc4c202\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveDirective as _resolveDirective, withDirectives as _withDirectives, normalizeStyle as _normalizeStyle } from \"vue\"\n\nimport { PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTVideoElement } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\n\nimport VideoPlayer from './VideoPlayer/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTVideoElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent, canMove = true) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo, canMove)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-video\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n onMousedown: _cache[2] || (_cache[2] = $event => handleSelectElement($event, false)),\n onTouchstart: _cache[3] || (_cache[3] = $event => handleSelectElement($event, false))\n }, [\n _createVNode(VideoPlayer, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n src: __props.elementInfo.src,\n poster: __props.elementInfo.poster,\n scale: _unref(canvasScale)\n }, null, 8, [\"width\", \"height\", \"src\", \"poster\", \"scale\"]),\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(['t', 'b', 'l', 'r'], (item) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass(['handler-border', item]),\n key: item,\n onMousedown: _cache[0] || (_cache[0] = $event => handleSelectElement($event)),\n onTouchstart: _cache[1] || (_cache[1] = $event => handleSelectElement($event))\n }, null, 34)\n }), 64))\n ], 32)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=9d5469c6&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-9d5469c6\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, unref as _unref, normalizeStyle as _normalizeStyle, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, normalizeClass as _normalizeClass, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-121f3d11\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"src\", \"autoplay\"]\nconst _hoisted_2 = { class: \"controller\" }\nconst _hoisted_3 = { class: \"icons\" }\nconst _hoisted_4 = { class: \"icon-content\" }\nconst _hoisted_5 = { class: \"volume\" }\nconst _hoisted_6 = { class: \"icon-content\" }\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"thumb\" }, null, -1))\nconst _hoisted_8 = [\n _hoisted_7\n]\nconst _hoisted_9 = { class: \"time\" }\nconst _hoisted_10 = { class: \"ptime\" }\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\" / \")\nconst _hoisted_12 = { class: \"dtime\" }\nconst _hoisted_13 = { class: \"bar\" }\nconst _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", { class: \"thumb\" }, null, -1))\nconst _hoisted_15 = [\n _hoisted_14\n]\n\nimport { computed, ref } from 'vue'\nimport { message } from 'ant-design-vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'AudioPlayer',\n props: {\n src: {\n type: String,\n required: true,\n },\n loop: {\n type: Boolean,\n required: true,\n },\n autoplay: {\n type: Boolean,\n default: false,\n },\n scale: {\n type: Number,\n default: 1,\n },\n},\n setup(__props, { expose }) {\n\nconst props = __props\n\n\n\nconst secondToTime = (second = 0) => {\n if (second === 0 || isNaN(second)) return '00:00'\n\n const add0 = (num: number) => (num < 10 ? '0' + num : '' + num)\n const hour = Math.floor(second / 3600)\n const min = Math.floor((second - hour * 3600) / 60)\n const sec = Math.floor(second - hour * 3600 - min * 60)\n return (hour > 0 ? [hour, min, sec] : [min, sec]).map(add0).join(':')\n}\n\nconst getBoundingClientRectViewLeft = (element: HTMLElement) => {\n return element.getBoundingClientRect().left\n}\n\nconst audioRef = ref()\nconst playBarWrap = ref()\nconst volumeBarRef = ref()\n\nconst volume = ref(0.5)\nconst paused = ref(true)\nconst currentTime = ref(0)\nconst duration = ref(0)\nconst loaded = ref(0)\n\nconst playBarTimeVisible = ref(false)\nconst playBarTime = ref('00:00')\nconst playBarTimeLeft = ref('0')\n\nconst ptime = computed(() => secondToTime(currentTime.value))\nconst dtime = computed(() => secondToTime(duration.value))\nconst playedBarWidth = computed(() => currentTime.value / duration.value * 100 + '%')\nconst loadedBarWidth = computed(() => loaded.value / duration.value * 100 + '%')\nconst volumeBarWidth = computed(() => volume.value * 100 + '%')\n\nconst seek = (time: number) => {\n if (!audioRef.value) return\n\n time = Math.max(time, 0)\n time = Math.min(time, duration.value)\n\n audioRef.value.currentTime = time\n currentTime.value = time\n}\n\nconst play = () => {\n if (!audioRef.value) return\n\n paused.value = false\n audioRef.value.play()\n}\n\nconst pause = () => {\n if (!audioRef.value) return\n\n paused.value = true\n audioRef.value.pause()\n}\n\nconst toggle = () => {\n if (paused.value) play() \n else pause()\n}\n\nconst setVolume = (percentage: number) => {\n if (!audioRef.value) return\n\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n\n audioRef.value.volume = percentage\n volume.value = percentage\n if (audioRef.value.muted && percentage !== 0) audioRef.value.muted = false\n}\n\nconst handleDurationchange = () => {\n duration.value = audioRef.value?.duration || 0\n}\n\nconst handleTimeupdate = () => {\n currentTime.value = audioRef.value?.currentTime || 0\n}\n\nconst handlePlayed = () => {\n paused.value = false\n}\n\nconst handleEnded = () => {\n if (!props.loop) pause()\n else {\n seek(0)\n play()\n }\n}\n\nconst handleProgress = () => {\n loaded.value = audioRef.value?.buffered.length ? audioRef.value.buffered.end(audioRef.value.buffered.length - 1) : 0\n}\n\nconst handleError = () => message.error('视频加载失败')\n\nconst thumbMove = (e: MouseEvent | TouchEvent) => {\n if (!audioRef.value || !playBarWrap.value) return\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n let percentage = (clientX - getBoundingClientRectViewLeft(playBarWrap.value)) / playBarWrap.value.clientWidth\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n const time = percentage * duration.value\n\n audioRef.value.currentTime = time\n currentTime.value = time\n}\n\nconst thumbUp = (e: MouseEvent | TouchEvent) => {\n if (!audioRef.value || !playBarWrap.value) return\n\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n let percentage = (clientX - getBoundingClientRectViewLeft(playBarWrap.value)) / playBarWrap.value.clientWidth\n percentage = Math.max(percentage, 0)\n percentage = Math.min(percentage, 1)\n const time = percentage * duration.value\n\n audioRef.value.currentTime = time\n currentTime.value = time\n\n document.removeEventListener('mousemove', thumbMove)\n document.removeEventListener('touchmove', thumbMove)\n document.removeEventListener('mouseup', thumbUp)\n document.removeEventListener('touchend', thumbUp)\n}\n\nconst handleMousedownPlayBar = () => {\n document.addEventListener('mousemove', thumbMove)\n document.addEventListener('touchmove', thumbMove)\n document.addEventListener('mouseup', thumbUp)\n document.addEventListener('touchend', thumbUp)\n}\n\nconst volumeMove = (e: MouseEvent | TouchEvent) => {\n if (!volumeBarRef.value) return\n const clientX = 'clientX' in e ? e.clientX : e.changedTouches[0].clientX\n const percentage = (clientX - getBoundingClientRectViewLeft(volumeBarRef.value)) / 45\n setVolume(percentage)\n}\n\nconst volumeUp = () => {\n document.removeEventListener('mousemove', volumeMove)\n document.removeEventListener('touchmove', volumeMove)\n document.removeEventListener('mouseup', volumeUp)\n document.removeEventListener('touchend', volumeUp)\n}\n\nconst handleMousedownVolumeBar = () => {\n document.addEventListener('mousemove', volumeMove)\n document.addEventListener('touchmove', volumeMove)\n document.addEventListener('mouseup', volumeUp)\n document.addEventListener('touchend', volumeUp)\n}\n\nconst handleClickVolumeBar = (e: MouseEvent) => {\n if (!volumeBarRef.value) return\n const percentage = (e.clientX - getBoundingClientRectViewLeft(volumeBarRef.value)) / 45\n setVolume(percentage)\n}\n\nconst handleMousemovePlayBar = (e: MouseEvent) => {\n if (duration.value && playBarWrap.value) {\n const px = playBarWrap.value.getBoundingClientRect().left\n const tx = e.clientX - px\n if (tx < 0 || tx > playBarWrap.value.offsetWidth) return\n\n const time = duration.value * (tx / playBarWrap.value.offsetWidth)\n playBarTimeLeft.value = `${tx - (time >= 3600 ? 25 : 20)}px`\n playBarTime.value = secondToTime(time)\n playBarTimeVisible.value = true\n }\n}\n\nconst toggleVolume = () => {\n if (!audioRef.value) return\n\n if (audioRef.value.muted) {\n audioRef.value.muted = false\n setVolume(0.5)\n }\n else {\n audioRef.value.muted = true\n setVolume(0)\n }\n}\n\nexpose({\n toggle,\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlayOne = _resolveComponent(\"IconPlayOne\")!\n const _component_IconPause = _resolveComponent(\"IconPause\")!\n const _component_IconVolumeMute = _resolveComponent(\"IconVolumeMute\")!\n const _component_IconVolumeNotice = _resolveComponent(\"IconVolumeNotice\")!\n const _component_IconVolumeSmall = _resolveComponent(\"IconVolumeSmall\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"audio-player\",\n style: _normalizeStyle({ transform: `scale(${1 / __props.scale})` })\n }, [\n _createElementVNode(\"audio\", {\n class: \"audio\",\n ref_key: \"audioRef\",\n ref: audioRef,\n src: __props.src,\n autoplay: __props.autoplay,\n onDurationchange: _cache[0] || (_cache[0] = ($event: any) => (handleDurationchange())),\n onTimeupdate: _cache[1] || (_cache[1] = ($event: any) => (handleTimeupdate())),\n onPlay: _cache[2] || (_cache[2] = ($event: any) => (handlePlayed())),\n onEnded: _cache[3] || (_cache[3] = ($event: any) => (handleEnded())),\n onProgress: _cache[4] || (_cache[4] = ($event: any) => (handleProgress())),\n onError: _cache[5] || (_cache[5] = ($event: any) => (handleError()))\n }, null, 40, _hoisted_1),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", {\n class: \"icon play-icon\",\n onClick: _cache[6] || (_cache[6] = ($event: any) => (toggle()))\n }, [\n _createElementVNode(\"span\", _hoisted_4, [\n (paused.value)\n ? (_openBlock(), _createBlock(_component_IconPlayOne, { key: 0 }))\n : (_openBlock(), _createBlock(_component_IconPause, { key: 1 }))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", {\n class: \"icon volume-icon\",\n onClick: _cache[7] || (_cache[7] = ($event: any) => (toggleVolume()))\n }, [\n _createElementVNode(\"span\", _hoisted_6, [\n (volume.value === 0)\n ? (_openBlock(), _createBlock(_component_IconVolumeMute, { key: 0 }))\n : (volume.value === 1)\n ? (_openBlock(), _createBlock(_component_IconVolumeNotice, { key: 1 }))\n : (_openBlock(), _createBlock(_component_IconVolumeSmall, { key: 2 }))\n ])\n ]),\n _createElementVNode(\"div\", {\n class: \"volume-bar-wrap\",\n onMousedown: _cache[8] || (_cache[8] = ($event: any) => (handleMousedownVolumeBar())),\n onTouchstart: _cache[9] || (_cache[9] = ($event: any) => (handleMousedownVolumeBar())),\n onClick: _cache[10] || (_cache[10] = $event => handleClickVolumeBar($event))\n }, [\n _createElementVNode(\"div\", {\n class: \"volume-bar\",\n ref_key: \"volumeBarRef\",\n ref: volumeBarRef\n }, [\n _createElementVNode(\"div\", {\n class: \"volume-bar-inner\",\n style: _normalizeStyle({ width: _unref(volumeBarWidth) })\n }, _hoisted_8, 4)\n ], 512)\n ], 32)\n ])\n ]),\n _createElementVNode(\"span\", _hoisted_9, [\n _createElementVNode(\"span\", _hoisted_10, _toDisplayString(_unref(ptime)), 1),\n _hoisted_11,\n _createElementVNode(\"span\", _hoisted_12, _toDisplayString(_unref(dtime)), 1)\n ]),\n _createElementVNode(\"div\", {\n class: \"bar-wrap\",\n ref_key: \"playBarWrap\",\n ref: playBarWrap,\n onMousedown: _cache[11] || (_cache[11] = ($event: any) => (handleMousedownPlayBar())),\n onTouchstart: _cache[12] || (_cache[12] = ($event: any) => (handleMousedownPlayBar())),\n onMousemove: _cache[13] || (_cache[13] = $event => handleMousemovePlayBar($event)),\n onMouseenter: _cache[14] || (_cache[14] = ($event: any) => (playBarTimeVisible.value = true)),\n onMouseleave: _cache[15] || (_cache[15] = ($event: any) => (playBarTimeVisible.value = false))\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"bar-time\", { 'hidden': !playBarTimeVisible.value }]),\n style: _normalizeStyle({ left: playBarTimeLeft.value })\n }, _toDisplayString(playBarTime.value), 7),\n _createElementVNode(\"div\", _hoisted_13, [\n _createElementVNode(\"div\", {\n class: \"loaded\",\n style: _normalizeStyle({ width: _unref(loadedBarWidth) })\n }, null, 4),\n _createElementVNode(\"div\", {\n class: \"played\",\n style: _normalizeStyle({ width: _unref(playedBarWidth) })\n }, _hoisted_15, 4)\n ])\n ], 544)\n ])\n ], 4))\n}\n}\n\n})","import script from \"./AudioPlayer.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./AudioPlayer.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./AudioPlayer.vue?vue&type=style&index=0&id=121f3d11&scoped=true&lang=scss\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-121f3d11\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, normalizeStyle as _normalizeStyle, createVNode as _createVNode, withModifiers as _withModifiers, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveDirective as _resolveDirective, createElementBlock as _createElementBlock, withDirectives as _withDirectives, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTAudioElement } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\n\nimport AudioPlayer from './AudioPlayer.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTAudioElement, canMove?: boolean) => void>,\n required: true,\n },\n contextmenus: {\n type: Function as PropType<() => ContextmenuItem[] | null>,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale, handleElementId } = storeToRefs(useMainStore())\nconst { viewportRatio } = storeToRefs(useSlidesStore())\n\nconst audioIconSize = computed(() => {\n return Math.min(props.elementInfo.width, props.elementInfo.height) + 'px'\n})\nconst audioPlayerPosition = computed(() => {\n const canvasWidth = VIEWPORT_SIZE\n const canvasHeight = VIEWPORT_SIZE * viewportRatio.value\n\n const audioWidth = 280 / canvasScale.value\n const audioHeight = 50 / canvasScale.value\n\n const elWidth = props.elementInfo.width\n const elHeight = props.elementInfo.height\n const elLeft = props.elementInfo.left\n const elTop = props.elementInfo.top\n\n let left = 0\n let top = elHeight\n \n if (elLeft + audioWidth >= canvasWidth) left = elWidth - audioWidth\n if (elTop + elHeight + audioHeight >= canvasHeight) top = -audioHeight\n\n return {\n left: left + 'px',\n top: top + 'px',\n }\n})\n\nconst handleSelectElement = (e: MouseEvent | TouchEvent) => {\n if (props.elementInfo.lock) return\n e.stopPropagation()\n\n props.selectElement(e, props.elementInfo)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconVolumeNotice = _resolveComponent(\"IconVolumeNotice\")!\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"editable-element-audio\", { 'lock': __props.elementInfo.lock }]),\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"element-content\",\n onMousedown: _cache[1] || (_cache[1] = $event => handleSelectElement($event)),\n onTouchstart: _cache[2] || (_cache[2] = $event => handleSelectElement($event))\n }, [\n _createVNode(_component_IconVolumeNotice, {\n class: \"audio-icon\",\n style: _normalizeStyle({\n fontSize: _unref(audioIconSize),\n color: __props.elementInfo.color,\n })\n }, null, 8, [\"style\"]),\n (_unref(handleElementId) === __props.elementInfo.id)\n ? (_openBlock(), _createBlock(AudioPlayer, {\n key: 0,\n class: \"audio-player\",\n style: _normalizeStyle({ ..._unref(audioPlayerPosition) }),\n src: __props.elementInfo.src,\n loop: __props.elementInfo.loop,\n scale: _unref(canvasScale),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(() => {}, [\"stop\"]))\n }, null, 8, [\"style\", \"src\", \"loop\", \"scale\"]))\n : _createCommentVNode(\"\", true)\n ], 32)), [\n [_directive_contextmenu, __props.contextmenus]\n ])\n ], 4)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=001bfbc4&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-001bfbc4\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"id\"]\n\nimport { computed, PropType } from 'vue'\nimport { ElementTypes, PPTElement } from '@/types/slides'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\n\nimport useLockElement from '@/hooks/useLockElement'\nimport useDeleteElement from '@/hooks/useDeleteElement'\nimport useCombineElement from '@/hooks/useCombineElement'\nimport useOrderElement from '@/hooks/useOrderElement'\nimport useAlignElementToCanvas from '@/hooks/useAlignElementToCanvas'\nimport useCopyAndPasteElement from '@/hooks/useCopyAndPasteElement'\nimport useSelectAllElement from '@/hooks/useSelectAllElement'\n\nimport { ElementOrderCommands, ElementAlignCommands } from '@/types/edit'\n\nimport ImageElement from '@/views/components/element/ImageElement/index.vue'\nimport TextElement from '@/views/components/element/TextElement/index.vue'\nimport ShapeElement from '@/views/components/element/ShapeElement/index.vue'\nimport LineElement from '@/views/components/element/LineElement/index.vue'\nimport ChartElement from '@/views/components/element/ChartElement/index.vue'\nimport TableElement from '@/views/components/element/TableElement/index.vue'\nimport LatexElement from '@/views/components/element/LatexElement/index.vue'\nimport VideoElement from '@/views/components/element/VideoElement/index.vue'\nimport AudioElement from '@/views/components/element/AudioElement/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'EditableElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n elementIndex: {\n type: Number,\n required: true,\n },\n isMultiSelect: {\n type: Boolean,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: MouseEvent | TouchEvent, element: PPTElement, canMove?: boolean) => void>,\n required: true,\n },\n openLinkDialog: {\n type: Function as PropType<() => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst currentElementComponent = computed(() => {\n const elementTypeMap = {\n [ElementTypes.IMAGE]: ImageElement,\n [ElementTypes.TEXT]: TextElement,\n [ElementTypes.SHAPE]: ShapeElement,\n [ElementTypes.LINE]: LineElement,\n [ElementTypes.CHART]: ChartElement,\n [ElementTypes.TABLE]: TableElement,\n [ElementTypes.LATEX]: LatexElement,\n [ElementTypes.VIDEO]: VideoElement,\n [ElementTypes.AUDIO]: AudioElement,\n }\n return elementTypeMap[props.elementInfo.type] || null\n})\n\nconst { orderElement } = useOrderElement()\nconst { alignElementToCanvas } = useAlignElementToCanvas()\nconst { combineElements, uncombineElements } = useCombineElement()\nconst { deleteElement } = useDeleteElement()\nconst { lockElement, unlockElement } = useLockElement()\nconst { copyElement, pasteElement, cutElement } = useCopyAndPasteElement()\nconst { selectAllElement } = useSelectAllElement()\n\nconst contextmenus = (): ContextmenuItem[] => {\n if (props.elementInfo.lock) {\n return [{\n text: '解锁', \n handler: () => unlockElement(props.elementInfo),\n }]\n }\n\n return [\n {\n text: '剪切',\n subText: 'Ctrl + X',\n handler: cutElement,\n },\n {\n text: '复制',\n subText: 'Ctrl + C',\n handler: copyElement,\n },\n {\n text: '粘贴',\n subText: 'Ctrl + V',\n handler: pasteElement,\n },\n { divider: true },\n {\n text: '水平居中',\n handler: () => alignElementToCanvas(ElementAlignCommands.HORIZONTAL),\n children: [\n { text: '水平垂直居中', handler: () => alignElementToCanvas(ElementAlignCommands.CENTER), },\n { text: '水平居中', handler: () => alignElementToCanvas(ElementAlignCommands.HORIZONTAL) },\n { text: '左对齐', handler: () => alignElementToCanvas(ElementAlignCommands.LEFT) },\n { text: '右对齐', handler: () => alignElementToCanvas(ElementAlignCommands.RIGHT) },\n ],\n },\n {\n text: '垂直居中',\n handler: () => alignElementToCanvas(ElementAlignCommands.VERTICAL),\n children: [\n { text: '水平垂直居中', handler: () => alignElementToCanvas(ElementAlignCommands.CENTER) },\n { text: '垂直居中', handler: () => alignElementToCanvas(ElementAlignCommands.VERTICAL) },\n { text: '顶部对齐', handler: () => alignElementToCanvas(ElementAlignCommands.TOP) },\n { text: '底部对齐', handler: () => alignElementToCanvas(ElementAlignCommands.BOTTOM) },\n ],\n },\n { divider: true },\n {\n text: '置于顶层',\n disable: props.isMultiSelect && !props.elementInfo.groupId,\n handler: () => orderElement(props.elementInfo, ElementOrderCommands.TOP),\n children: [\n { text: '置于顶层', handler: () => orderElement(props.elementInfo, ElementOrderCommands.TOP) },\n { text: '上移一层', handler: () => orderElement(props.elementInfo, ElementOrderCommands.UP) },\n ],\n },\n {\n text: '置于底层',\n disable: props.isMultiSelect && !props.elementInfo.groupId,\n handler: () => orderElement(props.elementInfo, ElementOrderCommands.BOTTOM),\n children: [\n { text: '置于底层', handler: () => orderElement(props.elementInfo, ElementOrderCommands.BOTTOM) },\n { text: '下移一层', handler: () => orderElement(props.elementInfo, ElementOrderCommands.DOWN) },\n ],\n },\n { divider: true },\n {\n text: '设置链接',\n handler: props.openLinkDialog,\n },\n {\n text: props.elementInfo.groupId ? '取消组合' : '组合',\n subText: 'Ctrl + G',\n handler: props.elementInfo.groupId ? uncombineElements : combineElements,\n hide: !props.isMultiSelect,\n },\n {\n text: '全选',\n subText: 'Ctrl + A',\n handler: selectAllElement,\n },\n {\n text: '锁定',\n subText: 'Ctrl + L',\n handler: lockElement,\n },\n {\n text: '删除',\n subText: 'Delete',\n handler: deleteElement,\n },\n ]\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"editable-element\",\n ref: \"elementRef\",\n id: `editable-element-${__props.elementInfo.id}`,\n style: _normalizeStyle({\n zIndex: __props.elementIndex,\n })\n }, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentElementComponent)), {\n elementInfo: __props.elementInfo,\n selectElement: __props.selectElement,\n contextmenus: contextmenus\n }, null, 8, [\"elementInfo\", \"selectElement\"]))\n ], 12, _hoisted_1))\n}\n}\n\n})","import script from \"./EditableElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./EditableElement.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MouseSelection',\n props: {\n top: {\n type: Number,\n required: true,\n },\n left: {\n type: Number,\n required: true,\n },\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n quadrant: {\n type: Number,\n required: true,\n validator(value: number) {\n return [1, 2, 3, 4].includes(value)\n },\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass(`mouse-selection quadrant-${__props.quadrant}`),\n style: _normalizeStyle({\n top: __props.top + 'px',\n left: __props.left + 'px',\n width: __props.width + 'px',\n height: __props.height + 'px',\n })\n }, null, 6))\n}\n}\n\n})","import script from \"./MouseSelection.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MouseSelection.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MouseSelection.vue?vue&type=style&index=0&id=0d6c0f73&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-0d6c0f73\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-10cd6d44\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"grid-lines\" }\nconst _hoisted_2 = [\"d\", \"stroke\"]\n\nimport { computed } from 'vue'\nimport tinycolor from 'tinycolor2'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport { SlideBackground } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'GridLines',\n setup(__props) {\n\nconst { canvasScale } = storeToRefs(useMainStore())\nconst { currentSlide, viewportRatio } = storeToRefs(useSlidesStore())\n\nconst background = computed(() => currentSlide.value?.background)\n\n// 计算网格线的颜色,避免与背景的颜色太接近\nconst gridColor = computed(() => {\n const bgColor = background.value?.color || '#fff'\n const colorList = ['#000', '#fff']\n return tinycolor.mostReadable(bgColor, colorList, { includeFallbackColors: true }).setAlpha(.5).toRgbString()\n})\n\nconst gridSize = 50\n\n// 计算网格路径\nconst getPath = () => {\n const maxX = VIEWPORT_SIZE\n const maxY = VIEWPORT_SIZE * viewportRatio.value\n\n let path = ''\n for (let i = 0; i <= Math.floor(maxY / gridSize); i++) {\n path += `M0 ${i * gridSize} L${maxX} ${i * gridSize} `\n }\n for (let i = 0; i <= Math.floor(maxX / gridSize); i++) {\n path += `M${i * gridSize} 0 L${i * gridSize} ${maxY} `\n }\n return path\n}\n\nconst path = getPath()\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"svg\", _hoisted_1, [\n _createElementVNode(\"path\", {\n style: _normalizeStyle({\n transform: `scale(${_unref(canvasScale)})`,\n }),\n d: _unref(path),\n fill: \"none\",\n stroke: _unref(gridColor),\n \"stroke-width\": \"0.3\",\n \"stroke-dasharray\": \"5\"\n }, null, 12, _hoisted_2)\n ]))\n}\n}\n\n})","import script from \"./GridLines.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./GridLines.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./GridLines.vue?vue&type=style&index=0&id=10cd6d44&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-10cd6d44\"]])\n\nexport default __exports__","import { Ref, computed } from 'vue'\nimport { SlideBackground } from '@/types/slides'\n\n// 将页面背景数据转换为css样式\nexport default (background: Ref) => {\n const backgroundStyle = computed(() => {\n if (!background.value) return { backgroundColor: '#fff' }\n\n const {\n type,\n color,\n image,\n imageSize,\n gradientColor,\n gradientRotate,\n gradientType,\n } = background.value\n\n // 纯色背景\n if (type === 'solid') return { backgroundColor: color }\n\n // 背景图模式\n // 包括:背景图、背景大小,是否重复\n else if (type === 'image') {\n if (!image) return { backgroundColor: '#fff' }\n if (imageSize === 'repeat') {\n return {\n backgroundImage: `url(${image}`,\n backgroundRepeat: 'repeat',\n backgroundSize: 'contain',\n }\n }\n return {\n backgroundImage: `url(${image}`,\n backgroundRepeat: 'no-repeat',\n backgroundSize: imageSize || 'cover',\n }\n }\n\n // 渐变色背景\n else if (type === 'gradient') {\n const rotate = gradientRotate || 0\n const color1 = gradientColor ? gradientColor[0] : '#fff'\n const color2 = gradientColor ? gradientColor[1] : '#fff'\n \n if (gradientType === 'radial') return { backgroundImage: `radial-gradient(${color1}, ${color2}` }\n return { backgroundImage: `linear-gradient(${rotate}deg, ${color1}, ${color2}` }\n }\n\n return { backgroundColor: '#fff' }\n })\n\n return {\n backgroundStyle,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { SlideBackground } from '@/types/slides'\nimport GridLines from './GridLines.vue'\nimport useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ViewportBackground',\n setup(__props) {\n\nconst { showGridLines } = storeToRefs(useMainStore())\nconst { currentSlide } = storeToRefs(useSlidesStore())\nconst background = computed(() => currentSlide.value?.background)\n\nconst { backgroundStyle } = useSlideBackgroundStyle(background)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"viewport-background\",\n style: _normalizeStyle(_unref(backgroundStyle))\n }, [\n (_unref(showGridLines))\n ? (_openBlock(), _createBlock(GridLines, { key: 0 }))\n : _createCommentVNode(\"\", true)\n ], 4))\n}\n}\n\n})","import script from \"./ViewportBackground.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ViewportBackground.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ViewportBackground.vue?vue&type=style&index=0&id=6f1e1261&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6f1e1261\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { AlignmentLineAxis } from '@/types/edit'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'AlignmentLine',\n props: {\n type: {\n type: String as PropType<'vertical' | 'horizontal'>,\n required: true,\n },\n axis: {\n type: Object as PropType,\n required: true,\n },\n length: {\n type: Number,\n required: true,\n },\n canvasScale: {\n type: Number,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\n// 吸附对齐线的位置\nconst left = computed(() => props.axis.x * props.canvasScale + 'px')\nconst top = computed(() => props.axis.y * props.canvasScale + 'px')\n\n// 吸附对齐线的长度\nconst sizeStyle = computed(() => {\n if (props.type === 'vertical') return { height: props.length * props.canvasScale + 'px' }\n return { width: props.length * props.canvasScale + 'px' }\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"alignment-line\",\n style: _normalizeStyle({ left: _unref(left), top: _unref(top) })\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass(['line', __props.type]),\n style: _normalizeStyle(_unref(sizeStyle))\n }, null, 6)\n ], 4))\n}\n}\n\n})","import script from \"./AlignmentLine.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./AlignmentLine.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./AlignmentLine.vue?vue&type=style&index=0&id=37fa6068&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-37fa6068\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-60e06332\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"ruler\" }\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\n\ninterface ViewportStyles {\n top: number\n left: number\n width: number\n height: number\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Ruler',\n props: {\n viewportStyles: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst markerSize = computed(() => {\n return props.viewportStyles.width * canvasScale.value / 10\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"h\",\n style: _normalizeStyle({\n width: __props.viewportStyles.width * _unref(canvasScale) + 'px',\n left: __props.viewportStyles.left + 'px',\n })\n }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(10, (marker) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"ruler-marker-100\", { 'hide': _unref(markerSize) < 36, 'omit': _unref(markerSize) < 72 }]),\n key: `marker-100-${marker}`\n }, [\n _createElementVNode(\"span\", null, _toDisplayString(marker * 100), 1)\n ], 2)\n }), 64))\n ], 4),\n _createElementVNode(\"div\", {\n class: \"v\",\n style: _normalizeStyle({\n height: __props.viewportStyles.height * _unref(canvasScale) + 'px',\n top: __props.viewportStyles.top + 'px',\n })\n }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(10, (marker) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"ruler-marker-100\", { 'hide': _unref(markerSize) < 36, 'omit': _unref(markerSize) < 72 }]),\n key: marker,\n style: _normalizeStyle({ height: _unref(markerSize) + 'px' })\n }, [\n _createElementVNode(\"span\", null, _toDisplayString(marker * 100), 1)\n ], 6)\n }), 64))\n ], 4)\n ]))\n}\n}\n\n})","import script from \"./Ruler.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Ruler.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Ruler.vue?vue&type=style&index=0&id=60e06332&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-60e06332\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, withModifiers as _withModifiers, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5a941f07\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"d\"]\n\nimport { computed, onMounted, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useKeyboardStore } from '@/store'\nimport { CreateElementSelectionData } from '@/types/edit'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementCreateSelection',\n emits: [\"created\"],\n setup(__props, { emit }: { emit: ({\n (event: 'created', payload: CreateElementSelectionData): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst mainStore = useMainStore()\nconst { creatingElement } = storeToRefs(mainStore)\nconst { ctrlOrShiftKeyActive } = storeToRefs(useKeyboardStore())\n\nconst start = ref<[number, number]>()\nconst end = ref<[number, number]>()\n\nconst selectionRef = ref()\nconst offset = ref({\n x: 0,\n y: 0,\n})\nonMounted(() => {\n if (!selectionRef.value) return\n const { x, y } = selectionRef.value.getBoundingClientRect()\n offset.value = { x, y }\n})\n\n// 鼠标拖动创建元素生成位置大小\n// 获取范围的起始位置和终点位置\nconst createSelection = (e: MouseEvent) => {\n let isMouseDown = true\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n start.value = [startPageX, startPageY]\n\n document.onmousemove = e => {\n if (!creatingElement.value || !isMouseDown) return\n\n let currentPageX = e.pageX\n let currentPageY = e.pageY\n\n // 按住Ctrl键或者Shift键时:\n // 对于非线条元素需要锁定宽高比例,对于线条元素需要锁定水平或垂直方向\n if (ctrlOrShiftKeyActive.value) {\n const moveX = currentPageX - startPageX\n const moveY = currentPageY - startPageY\n\n // 水平和垂直方向的拖动距离,后面以拖动距离较大的方向为基础计算另一方向的数据\n const absX = Math.abs(moveX)\n const absY = Math.abs(moveY)\n\n if (creatingElement.value.type === 'shape') {\n\n // 判断是否为反向拖动:从左上到右下为正向操作,此外所有情况都是反向操作\n const isOpposite = (moveY > 0 && moveX < 0) || (moveY < 0 && moveX > 0)\n\n if (absX > absY) {\n currentPageY = isOpposite ? startPageY - moveX : startPageY + moveX\n }\n else {\n currentPageX = isOpposite ? startPageX - moveY : startPageX + moveY\n }\n }\n\n else if (creatingElement.value.type === 'line') {\n if (absX > absY) currentPageY = startPageY\n else currentPageX = startPageX\n }\n }\n\n end.value = [currentPageX, currentPageY]\n }\n\n document.onmouseup = e => {\n document.onmousemove = null\n document.onmouseup = null\n\n if (e.button === 2) {\n setTimeout(() => mainStore.setCreatingElement(null), 0)\n return\n }\n\n isMouseDown = false\n\n const endPageX = e.pageX\n const endPageY = e.pageY\n\n const minSize = 30\n\n if (\n creatingElement.value?.type === 'line' &&\n (Math.abs(endPageX - startPageX) >= minSize || Math.abs(endPageY - startPageY) >= minSize)\n ) {\n emit('created', {\n start: start.value!,\n end: end.value!,\n })\n }\n else if (\n creatingElement.value?.type !== 'line' &&\n (Math.abs(endPageX - startPageX) >= minSize && Math.abs(endPageY - startPageY) >= minSize)\n ) {\n emit('created', {\n start: start.value!,\n end: end.value!,\n })\n }\n else {\n const defaultSize = 200\n const minX = Math.min(endPageX, startPageX)\n const minY = Math.min(endPageY, startPageY)\n const maxX = Math.max(endPageX, startPageX)\n const maxY = Math.max(endPageY, startPageY)\n const offsetX = maxX - minX >= minSize ? maxX - minX : defaultSize\n const offsetY = maxY - minY >= minSize ? maxY - minY : defaultSize\n emit('created', {\n start: [minX, minY],\n end: [minX + offsetX, minY + offsetY],\n })\n }\n }\n}\n\n// 绘制线条的路径相关数据(仅当绘制元素类型为线条时使用)\nconst lineData = computed(() => {\n if (!start.value || !end.value) return null\n if (!creatingElement.value || creatingElement.value.type !== 'line') return null\n\n const [_startX, _startY] = start.value\n const [_endX, _endY] = end.value\n const minX = Math.min(_startX, _endX)\n const maxX = Math.max(_startX, _endX)\n const minY = Math.min(_startY, _endY)\n const maxY = Math.max(_startY, _endY)\n\n const svgWidth = maxX - minX >= 24 ? maxX - minX : 24\n const svgHeight = maxY - minY >= 24 ? maxY - minY : 24\n\n const startX = _startX === minX ? 0 : maxX - minX\n const startY = _startY === minY ? 0 : maxY - minY\n const endX = _endX === minX ? 0 : maxX - minX\n const endY = _endY === minY ? 0 : maxY - minY\n\n const path = `M${startX}, ${startY} L${endX}, ${endY}`\n\n return {\n svgWidth,\n svgHeight,\n startX,\n startY,\n endX,\n endY,\n path,\n }\n})\n\n// 根据生成范围的起始位置和终点位置,计算元素创建时的位置和大小\nconst position = computed(() => {\n if (!start.value || !end.value) return {}\n\n const [startX, startY] = start.value\n const [endX, endY] = end.value\n const minX = Math.min(startX, endX)\n const maxX = Math.max(startX, endX)\n const minY = Math.min(startY, endY)\n const maxY = Math.max(startY, endY)\n\n const width = maxX - minX\n const height = maxY - minY\n\n return {\n left: minX - offset.value.x + 'px',\n top: minY - offset.value.y + 'px',\n width: width + 'px',\n height: height + 'px',\n }\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"element-create-selection\",\n ref_key: \"selectionRef\",\n ref: selectionRef,\n onMousedown: _cache[0] || (_cache[0] = _withModifiers($event => createSelection($event), [\"stop\"])),\n onContextmenu: _cache[1] || (_cache[1] = _withModifiers(() => {}, [\"stop\",\"prevent\"]))\n }, [\n (start.value && end.value)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: _normalizeClass(['selection', _unref(creatingElement)?.type]),\n style: _normalizeStyle(_unref(position))\n }, [\n (_unref(creatingElement)?.type === 'line' && _unref(lineData))\n ? (_openBlock(), _createElementBlock(\"svg\", {\n key: 0,\n overflow: \"visible\",\n width: _unref(lineData).svgWidth,\n height: _unref(lineData).svgHeight\n }, [\n _createElementVNode(\"path\", {\n d: _unref(lineData).path,\n stroke: \"#d14424\",\n fill: \"none\",\n \"stroke-width\": \"2\"\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n : _createCommentVNode(\"\", true)\n ], 6))\n : _createCommentVNode(\"\", true)\n ], 544))\n}\n}\n\n})","import script from \"./ElementCreateSelection.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementCreateSelection.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementCreateSelection.vue?vue&type=style&index=0&id=5a941f07&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5a941f07\"]])\n\nexport default __exports__","import { computed, Ref } from 'vue'\nimport { OperateResizeHandlers, OperateBorderLines } from '@/types/edit'\n\nexport default (width: Ref, height: Ref) => {\n // 元素缩放点\n const resizeHandlers = computed(() => {\n return [\n { direction: OperateResizeHandlers.LEFT_TOP, style: {} },\n { direction: OperateResizeHandlers.TOP, style: {left: width.value / 2 + 'px'} },\n { direction: OperateResizeHandlers.RIGHT_TOP, style: {left: width.value + 'px'} },\n { direction: OperateResizeHandlers.LEFT, style: {top: height.value / 2 + 'px'} },\n { direction: OperateResizeHandlers.RIGHT, style: {left: width.value + 'px', top: height.value / 2 + 'px'} },\n { direction: OperateResizeHandlers.LEFT_BOTTOM, style: {top: height.value + 'px'} },\n { direction: OperateResizeHandlers.BOTTOM, style: {left: width.value / 2 + 'px', top: height.value + 'px'} },\n { direction: OperateResizeHandlers.RIGHT_BOTTOM, style: {left: width.value + 'px', top: height.value + 'px'} },\n ]\n })\n\n // 文本元素缩放点\n const textElementResizeHandlers = computed(() => {\n return [\n { direction: OperateResizeHandlers.LEFT, style: {top: height.value / 2 + 'px'} },\n { direction: OperateResizeHandlers.RIGHT, style: {left: width.value + 'px', top: height.value / 2 + 'px'} },\n ]\n })\n\n // 元素选中边框线\n const borderLines = computed(() => {\n return [\n { type: OperateBorderLines.T, style: {width: width.value + 'px'} },\n { type: OperateBorderLines.B, style: {top: height.value + 'px', width: width.value + 'px'} },\n { type: OperateBorderLines.L, style: {height: height.value + 'px'} },\n { type: OperateBorderLines.R, style: {left: width.value + 'px', height: height.value + 'px'} },\n ]\n })\n\n return {\n resizeHandlers,\n textElementResizeHandlers,\n borderLines,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { OperateResizeHandlers } from '@/types/edit'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ResizeHandler',\n props: {\n type: {\n type: String as PropType,\n default: '',\n },\n rotate: {\n type: Number,\n default: 0,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst rotateClassName = computed(() => {\n const prefix = 'rotate-'\n const rotate = props.rotate\n if (rotate > -22.5 && rotate <= 22.5) return prefix + 0\n else if (rotate > 22.5 && rotate <= 67.5) return prefix + 45\n else if (rotate > 67.5 && rotate <= 112.5) return prefix + 90\n else if (rotate > 112.5 && rotate <= 157.5) return prefix + 135\n else if (rotate > 157.5 || rotate <= -157.5) return prefix + 0\n else if (rotate > -157.5 && rotate <= -112.5) return prefix + 45\n else if (rotate > -112.5 && rotate <= -67.5) return prefix + 90\n else if (rotate > -67.5 && rotate <= -22.5) return prefix + 135\n return prefix + 0\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass(['resize-handler', _unref(rotateClassName), __props.type])\n }, null, 2))\n}\n}\n\n})","import script from \"./ResizeHandler.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ResizeHandler.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ResizeHandler.vue?vue&type=style&index=0&id=881ee3f8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-881ee3f8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { PropType } from 'vue'\nimport { OperateBorderLines } from '@/types/edit'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BorderLine',\n props: {\n type: {\n type: String as PropType,\n required: true,\n },\n isWide: {\n type: Boolean,\n default: false,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass(['border-line', __props.type, { 'wide': __props.isWide }])\n }, null, 2))\n}\n}\n\n})","import script from \"./BorderLine.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BorderLine.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BorderLine.vue?vue&type=style&index=0&id=7170d1be&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7170d1be\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode } from \"vue\"\n\nimport { computed, ref, PropType, watchEffect } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { getElementListRange } from '@/utils/element'\nimport { OperateResizeHandlers, MultiSelectRange } from '@/types/edit'\nimport useCommonOperate from '../hooks/useCommonOperate'\n\nimport ResizeHandler from './ResizeHandler.vue'\nimport BorderLine from './BorderLine.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MultiSelectOperate',\n props: {\n elementList: {\n type: Array as PropType,\n required: true,\n },\n scaleMultiElement: {\n type: Function as PropType<(e: MouseEvent, range: MultiSelectRange, command: OperateResizeHandlers) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { activeElementIdList, canvasScale } = storeToRefs(useMainStore())\n\nconst localActiveElementList = computed(() => props.elementList.filter(el => activeElementIdList.value.includes(el.id)))\n\nconst range = ref({\n minX: 0,\n maxX: 0,\n minY: 0,\n maxY: 0,\n})\n\n// 根据多选元素整体在画布中的范围,计算边框线和缩放点的位置信息\nconst width = computed(() => (range.value.maxX - range.value.minX) * canvasScale.value)\nconst height = computed(() => (range.value.maxY - range.value.minY) * canvasScale.value)\nconst { resizeHandlers, borderLines } = useCommonOperate(width, height)\n\n// 计算多选元素整体在画布中的范围\nconst setRange = () => {\n const { minX, maxX, minY, maxY } = getElementListRange(localActiveElementList.value)\n range.value = { minX, maxX, minY, maxY }\n}\nwatchEffect(setRange)\n\n// 禁用多选状态下缩放:仅未旋转的图片和形状可以在多选状态下缩放\nconst disableResize = computed(() => {\n return localActiveElementList.value.some(item => {\n if (\n (item.type === 'image' || item.type === 'shape') && \n !item.rotate\n ) return false\n return true\n })\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"multi-select-operate\",\n style: _normalizeStyle({\n left: range.value.minX * _unref(canvasScale) + 'px',\n top: range.value.minY * _unref(canvasScale) + 'px',\n })\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (!_unref(disableResize))\n ? (_openBlock(true), _createElementBlock(_Fragment, { key: 0 }, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n key: point.direction,\n type: point.direction,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers(($event: any) => (__props.scaleMultiElement($event, range.value, point.direction)), [\"stop\"])\n }, null, 8, [\"type\", \"style\", \"onMousedown\"]))\n }), 128))\n : _createCommentVNode(\"\", true)\n ], 4))\n}\n}\n\n})","import script from \"./MultiSelectOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MultiSelectOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MultiSelectOperate.vue?vue&type=style&index=0&id=defbd922&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-defbd922\"]])\n\nexport default __exports__","\n\n\n\n","import { render } from \"./RotateHandler.vue?vue&type=template&id=b99d8dae&scoped=true\"\nconst script = {}\n\nimport \"./RotateHandler.vue?vue&type=style&index=0&id=b99d8dae&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-b99d8dae\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createVNode as _createVNode, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass } from \"vue\"\n\nimport { computed, PropType } from 'vue'\r\nimport { storeToRefs } from 'pinia'\r\nimport { useMainStore } from '@/store'\r\nimport { PPTImageElement } from '@/types/slides'\r\nimport { OperateResizeHandlers } from '@/types/edit'\r\nimport useCommonOperate from '../hooks/useCommonOperate'\r\n\r\nimport RotateHandler from './RotateHandler.vue'\r\nimport ResizeHandler from './ResizeHandler.vue'\r\nimport BorderLine from './BorderLine.vue'\r\n\r\n\r\nconst __default__ = {\r\n inheritAttrs: false,\r\n}\r\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'ImageElementOperate',\n props: {\r\n elementInfo: {\r\n type: Object as PropType,\r\n required: true,\r\n },\r\n handlerVisible: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n rotateElement: {\r\n type: Function as PropType<(element: PPTImageElement) => void>,\r\n required: true,\r\n },\r\n scaleElement: {\r\n type: Function as PropType<(e: MouseEvent, element: PPTImageElement, command: OperateResizeHandlers) => void>,\r\n required: true,\r\n },\r\n},\n setup(__props) {\n\nconst props = __props\n\r\n\r\n\r\nconst { canvasScale, clipingImageElementId } = storeToRefs(useMainStore())\r\n\r\nconst isCliping = computed(() => clipingImageElementId.value === props.elementInfo.id)\r\n\r\nconst scaleWidth = computed(() => props.elementInfo.width * canvasScale.value)\r\nconst scaleHeight = computed(() => props.elementInfo.height * canvasScale.value)\r\nconst { resizeHandlers, borderLines } = useCommonOperate(scaleWidth, scaleHeight)\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"image-element-operate\", { 'cliping': _unref(isCliping) }])\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onMousedown\"]))\n }), 128)),\n _createVNode(RotateHandler, {\n class: \"operate-rotate-handler\",\n style: _normalizeStyle({ left: _unref(scaleWidth) / 2 + 'px' }),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.rotateElement(__props.elementInfo)), [\"stop\"]))\n }, null, 8, [\"style\"])\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 2))\n}\n}\n\n})","import script from \"./ImageElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImageElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImageElementOperate.vue?vue&type=style&index=0&id=46b250c2&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-46b250c2\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createVNode as _createVNode, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"text-element-operate\" }\n\nimport { computed, PropType } from 'vue'\r\nimport { storeToRefs } from 'pinia'\r\nimport { useMainStore } from '@/store'\r\nimport { PPTTextElement } from '@/types/slides'\r\nimport { OperateResizeHandlers } from '@/types/edit'\r\nimport useCommonOperate from '../hooks/useCommonOperate'\r\n\r\nimport RotateHandler from './RotateHandler.vue'\r\nimport ResizeHandler from './ResizeHandler.vue'\r\nimport BorderLine from './BorderLine.vue'\r\n\r\n\r\nconst __default__ = {\r\n inheritAttrs: false,\r\n}\r\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'TextElementOperate',\n props: {\r\n elementInfo: {\r\n type: Object as PropType,\r\n required: true,\r\n },\r\n handlerVisible: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n rotateElement: {\r\n type: Function as PropType<(element: PPTTextElement) => void>,\r\n required: true,\r\n },\r\n scaleElement: {\r\n type: Function as PropType<(e: MouseEvent, element: PPTTextElement, command: OperateResizeHandlers) => void>,\r\n required: true,\r\n },\r\n},\n setup(__props) {\n\nconst props = __props\n\r\n\r\n\r\nconst { canvasScale } = storeToRefs(useMainStore())\r\n\r\nconst scaleWidth = computed(() => props.elementInfo.width * canvasScale.value)\r\nconst scaleHeight = computed(() => props.elementInfo.height * canvasScale.value)\r\n\r\nconst { textElementResizeHandlers, borderLines } = useCommonOperate(scaleWidth, scaleHeight)\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(textElementResizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onMousedown\"]))\n }), 128)),\n _createVNode(RotateHandler, {\n class: \"operate-rotate-handler\",\n style: _normalizeStyle({ left: _unref(scaleWidth) / 2 + 'px' }),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.rotateElement(__props.elementInfo)), [\"stop\"]))\n }, null, 8, [\"style\"])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./TextElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./TextElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createVNode as _createVNode, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-fd38df18\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"shape-element-operate\" }\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTShapeElement } from '@/types/slides'\nimport { OperateResizeHandlers } from '@/types/edit'\nimport { SHAPE_PATH_FORMULAS } from '@/configs/shapes'\nimport useCommonOperate from '../hooks/useCommonOperate'\n\nimport RotateHandler from './RotateHandler.vue'\nimport ResizeHandler from './ResizeHandler.vue'\nimport BorderLine from './BorderLine.vue'\n\n\nconst __default__ = {\n inheritAttrs: false,\n}\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'ShapeElementOperate',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n handlerVisible: {\n type: Boolean,\n required: true,\n },\n rotateElement: {\n type: Function as PropType<(element: PPTShapeElement) => void>,\n required: true,\n },\n scaleElement: {\n type: Function as PropType<(e: MouseEvent, element: PPTShapeElement, command: OperateResizeHandlers) => void>,\n required: true,\n },\n moveShapeKeypoint: {\n type: Function as PropType<(e: MouseEvent, element: PPTShapeElement) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst scaleWidth = computed(() => props.elementInfo.width * canvasScale.value)\nconst scaleHeight = computed(() => props.elementInfo.height * canvasScale.value)\nconst { resizeHandlers, borderLines } = useCommonOperate(scaleWidth, scaleHeight)\n\nconst keypointStyle = computed(() => {\n if (!props.elementInfo.pathFormula || !props.elementInfo.keypoint) return {}\n\n const pathFormula = SHAPE_PATH_FORMULAS[props.elementInfo.pathFormula]\n if ('editable' in pathFormula) {\n const keypointPos = pathFormula.getBaseSize(props.elementInfo.width, props.elementInfo.height) * props.elementInfo.keypoint\n if (pathFormula.relative === 'left') return { left: keypointPos * canvasScale.value + 'px' }\n if (pathFormula.relative === 'right') return { left: (props.elementInfo.width - keypointPos) * canvasScale.value + 'px' }\n if (pathFormula.relative === 'center') return { left: (props.elementInfo.width - keypointPos) / 2 * canvasScale.value + 'px' }\n if (pathFormula.relative === 'top') return { top: keypointPos * canvasScale.value + 'px' }\n if (pathFormula.relative === 'bottom') return { top: (props.elementInfo.height - keypointPos) * canvasScale.value + 'px' }\n }\n return {}\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onMousedown\"]))\n }), 128)),\n _createVNode(RotateHandler, {\n class: \"operate-rotate-handler\",\n style: _normalizeStyle({ left: _unref(scaleWidth) / 2 + 'px' }),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.rotateElement(__props.elementInfo)), [\"stop\"]))\n }, null, 8, [\"style\"]),\n (__props.elementInfo.keypoint !== undefined)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"operate-keypoint-handler\",\n style: _normalizeStyle(_unref(keypointStyle)),\n onMousedown: _cache[1] || (_cache[1] = _withModifiers($event => __props.moveShapeKeypoint($event, __props.elementInfo), [\"stop\"]))\n }, null, 36))\n : _createCommentVNode(\"\", true)\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ShapeElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ShapeElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ShapeElementOperate.vue?vue&type=style&index=0&id=fd38df18&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-fd38df18\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, withModifiers as _withModifiers, normalizeStyle as _normalizeStyle, createBlock as _createBlock, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4659f395\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"line-element-operate\" }\nconst _hoisted_2 = [\"width\", \"height\", \"stroke\"]\nconst _hoisted_3 = { key: 0 }\nconst _hoisted_4 = [\"x1\", \"y1\", \"x2\", \"y2\"]\nconst _hoisted_5 = [\"x1\", \"y1\", \"x2\", \"y2\"]\nconst _hoisted_6 = [\"x1\", \"y1\", \"x2\", \"y2\"]\nconst _hoisted_7 = [\"x1\", \"y1\", \"x2\", \"y2\"]\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTLineElement } from '@/types/slides'\nimport { OperateLineHandlers } from '@/types/edit'\n\nimport ResizeHandler from './ResizeHandler.vue'\n\n\nconst __default__ = {\n inheritAttrs: false,\n}\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'LineElementOperate',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n handlerVisible: {\n type: Boolean,\n required: true,\n },\n dragLineElement: {\n type: Function as PropType<(e: MouseEvent, element: PPTLineElement, command: OperateLineHandlers) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst svgWidth = computed(() => Math.max(props.elementInfo.start[0], props.elementInfo.end[0]))\nconst svgHeight = computed(() => Math.max(props.elementInfo.start[1], props.elementInfo.end[1]))\n\nconst resizeHandlers = computed(() => {\n const handlers = [\n {\n handler: OperateLineHandlers.START,\n style: {\n left: props.elementInfo.start[0] * canvasScale.value + 'px',\n top: props.elementInfo.start[1] * canvasScale.value + 'px',\n }\n },\n {\n handler: OperateLineHandlers.END,\n style: {\n left: props.elementInfo.end[0] * canvasScale.value + 'px',\n top: props.elementInfo.end[1] * canvasScale.value + 'px',\n }\n },\n ]\n\n if (props.elementInfo.curve || props.elementInfo.broken) {\n const ctrlHandler = (props.elementInfo.curve || props.elementInfo.broken) as [number, number]\n\n handlers.push({\n handler: OperateLineHandlers.C,\n style: {\n left: ctrlHandler[0] * canvasScale.value + 'px',\n top: ctrlHandler[1] * canvasScale.value + 'px',\n }\n })\n }\n else if (props.elementInfo.cubic) {\n const [ctrlHandler1, ctrlHandler2] = props.elementInfo.cubic\n handlers.push({\n handler: OperateLineHandlers.C1,\n style: {\n left: ctrlHandler1[0] * canvasScale.value + 'px',\n top: ctrlHandler1[1] * canvasScale.value + 'px',\n }\n })\n handlers.push({\n handler: OperateLineHandlers.C2,\n style: {\n left: ctrlHandler2[0] * canvasScale.value + 'px',\n top: ctrlHandler2[1] * canvasScale.value + 'px',\n }\n })\n }\n\n return handlers\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.handler,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.dragLineElement($event, __props.elementInfo, point.handler), [\"stop\"])\n }, null, 8, [\"style\", \"onMousedown\"]))\n }), 128)),\n (_openBlock(), _createElementBlock(\"svg\", {\n width: _unref(svgWidth) || 1,\n height: _unref(svgHeight) || 1,\n stroke: __props.elementInfo.color,\n overflow: \"visible\",\n style: _normalizeStyle({ transform: `scale(${_unref(canvasScale)})` })\n }, [\n (__props.elementInfo.curve)\n ? (_openBlock(), _createElementBlock(\"g\", _hoisted_3, [\n _createElementVNode(\"line\", {\n class: \"anchor-line\",\n x1: __props.elementInfo.start[0],\n y1: __props.elementInfo.start[1],\n x2: __props.elementInfo.curve[0],\n y2: __props.elementInfo.curve[1]\n }, null, 8, _hoisted_4),\n _createElementVNode(\"line\", {\n class: \"anchor-line\",\n x1: __props.elementInfo.end[0],\n y1: __props.elementInfo.end[1],\n x2: __props.elementInfo.curve[0],\n y2: __props.elementInfo.curve[1]\n }, null, 8, _hoisted_5)\n ]))\n : _createCommentVNode(\"\", true),\n (__props.elementInfo.cubic)\n ? (_openBlock(true), _createElementBlock(_Fragment, { key: 1 }, _renderList(__props.elementInfo.cubic, (item, index) => {\n return (_openBlock(), _createElementBlock(\"g\", { key: index }, [\n (index === 0)\n ? (_openBlock(), _createElementBlock(\"line\", {\n key: 0,\n class: \"anchor-line\",\n x1: __props.elementInfo.start[0],\n y1: __props.elementInfo.start[1],\n x2: item[0],\n y2: item[1]\n }, null, 8, _hoisted_6))\n : _createCommentVNode(\"\", true),\n (index === 1)\n ? (_openBlock(), _createElementBlock(\"line\", {\n key: 1,\n class: \"anchor-line\",\n x1: __props.elementInfo.end[0],\n y1: __props.elementInfo.end[1],\n x2: item[0],\n y2: item[1]\n }, null, 8, _hoisted_7))\n : _createCommentVNode(\"\", true)\n ]))\n }), 128))\n : _createCommentVNode(\"\", true)\n ], 12, _hoisted_2))\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./LineElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LineElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LineElementOperate.vue?vue&type=style&index=0&id=4659f395&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-4659f395\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createVNode as _createVNode, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"table-element-operate\" }\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTTableElement } from '@/types/slides'\nimport { OperateResizeHandlers } from '@/types/edit'\nimport useCommonOperate from '../hooks/useCommonOperate'\n\nimport RotateHandler from './RotateHandler.vue'\nimport ResizeHandler from './ResizeHandler.vue'\nimport BorderLine from './BorderLine.vue'\n\n\nconst __default__ = {\n inheritAttrs: false,\n}\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'TableElementOperate',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n handlerVisible: {\n type: Boolean,\n required: true,\n },\n rotateElement: {\n type: Function as PropType<(element: PPTTableElement) => void>,\n required: true,\n },\n scaleElement: {\n type: Function as PropType<(e: MouseEvent, element: PPTTableElement, command: OperateResizeHandlers) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst outlineWidth = computed(() => props.elementInfo.outline.width || 1)\n\nconst scaleWidth = computed(() => (props.elementInfo.width + outlineWidth.value) * canvasScale.value)\nconst scaleHeight = computed(() => props.elementInfo.height * canvasScale.value)\n\nconst { textElementResizeHandlers, borderLines } = useCommonOperate(scaleWidth, scaleHeight)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(textElementResizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onMousedown\"]))\n }), 128)),\n _createVNode(RotateHandler, {\n class: \"operate-rotate-handler\",\n style: _normalizeStyle({ left: _unref(scaleWidth) / 2 + 'px' }),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.rotateElement(__props.elementInfo)), [\"stop\"]))\n }, null, 8, [\"style\"])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./TableElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./TableElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode } from \"vue\"\n\nconst _hoisted_1 = { class: \"common-element-operate\" }\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTShapeElement, PPTVideoElement, PPTLatexElement, PPTAudioElement } from '@/types/slides'\nimport { OperateResizeHandlers } from '@/types/edit'\nimport useCommonOperate from '../hooks/useCommonOperate'\n\nimport RotateHandler from './RotateHandler.vue'\nimport ResizeHandler from './ResizeHandler.vue'\nimport BorderLine from './BorderLine.vue'\n\ntype PPTElement = PPTShapeElement | PPTVideoElement | PPTLatexElement | PPTAudioElement\n\n\nconst __default__ = {\n inheritAttrs: false,\n}\n\nexport default /*#__PURE__*/_defineComponent({\n ...__default__,\n __name: 'CommonElementOperate',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n handlerVisible: {\n type: Boolean,\n required: true,\n },\n rotateElement: {\n type: Function as PropType<(element: PPTElement) => void>,\n required: true,\n },\n scaleElement: {\n type: Function as PropType<(e: MouseEvent, element: PPTElement, command: OperateResizeHandlers) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\n\nconst scaleWidth = computed(() => props.elementInfo.width * canvasScale.value)\nconst scaleHeight = computed(() => props.elementInfo.height * canvasScale.value)\nconst { resizeHandlers, borderLines } = useCommonOperate(scaleWidth, scaleHeight)\n\nconst cannotRotate = computed(() => ['video', 'audio'].includes(props.elementInfo.type))\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (__props.handlerVisible)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onMousedown: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onMousedown\"]))\n }), 128)),\n (!_unref(cannotRotate))\n ? (_openBlock(), _createBlock(RotateHandler, {\n key: 0,\n class: \"operate-rotate-handler\",\n style: _normalizeStyle({ left: _unref(scaleWidth) / 2 + 'px' }),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.rotateElement(__props.elementInfo)), [\"stop\"]))\n }, null, 8, [\"style\"]))\n : _createCommentVNode(\"\", true)\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./CommonElementOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./CommonElementOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { useSlidesStore } from '@/store'\nimport { PPTElement, PPTElementLink } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport { message } from 'ant-design-vue'\n\nexport default () => {\n const slidesStore = useSlidesStore()\n\n const { addHistorySnapshot } = useHistorySnapshot()\n\n const setLink = (handleElement: PPTElement, link: PPTElementLink) => {\n const linkRegExp = /^(https?):\\/\\/[\\w\\-]+(\\.[\\w\\-]+)+([\\w\\-.,@?^=%&:\\/~+#]*[\\w\\-@?^=%&\\/~+#])?$/\n if (link.type === 'web' && !linkRegExp.test(link.target)) {\n message.error('不是正确的网页链接地址')\n return false\n }\n const props = { link }\n slidesStore.updateElement({ id: handleElement.id, props })\n addHistorySnapshot()\n\n return true\n }\n\n const removeLink = (handleElement: PPTElement) => {\n slidesStore.removeElementProps({ id: handleElement.id, propName: 'link' })\n addHistorySnapshot()\n }\n\n return {\n setLink,\n removeLink,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-bb722fc0\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"href\"]\nconst _hoisted_2 = {\n key: 1,\n class: \"link\"\n}\nconst _hoisted_3 = { class: \"btns\" }\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { PPTElement, PPTElementLink } from '@/types/slides'\nimport useLink from '@/hooks/useLink'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LinkHandler',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n link: {\n type: Object as PropType,\n required: true,\n },\n openLinkDialog: {\n type: Function as PropType<() => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { canvasScale } = storeToRefs(useMainStore())\nconst { removeLink } = useLink()\nconst height = computed(() => props.elementInfo.type === 'line' ? 0 : props.elementInfo.height)\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Divider = _resolveComponent(\"Divider\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"link-handler\",\n style: _normalizeStyle({ top: _unref(height) * _unref(canvasScale) + 10 + 'px' })\n }, [\n (__props.link.type === 'web')\n ? (_openBlock(), _createElementBlock(\"a\", {\n key: 0,\n class: \"link\",\n href: __props.link.target,\n target: \"_blank\"\n }, _toDisplayString(__props.link.target), 9, _hoisted_1))\n : (_openBlock(), _createElementBlock(\"a\", _hoisted_2, \"幻灯片页面 \" + _toDisplayString(__props.link.target), 1)),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", {\n class: \"btn\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (__props.openLinkDialog()))\n }, \"更换\"),\n _createVNode(_component_Divider, { type: \"vertical\" }),\n _createElementVNode(\"div\", {\n class: \"btn\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_unref(removeLink)(__props.elementInfo)))\n }, \"移除\")\n ])\n ], 4))\n}\n}\n\n})","import script from \"./LinkHandler.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LinkHandler.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LinkHandler.vue?vue&type=style&index=0&id=bb722fc0&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-bb722fc0\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, withModifiers as _withModifiers, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-27793fbf\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 1,\n class: \"animation-index\"\n}\n\nimport { PropType, computed } from 'vue'\r\nimport { storeToRefs } from 'pinia'\r\nimport { useMainStore, useSlidesStore } from '@/store'\r\nimport { ElementTypes, PPTElement, PPTLineElement, PPTVideoElement, PPTAudioElement, PPTShapeElement } from '@/types/slides'\r\nimport { OperateLineHandlers, OperateResizeHandlers } from '@/types/edit'\r\n\r\nimport ImageElementOperate from './ImageElementOperate.vue'\r\nimport TextElementOperate from './TextElementOperate.vue'\r\nimport ShapeElementOperate from './ShapeElementOperate.vue'\r\nimport LineElementOperate from './LineElementOperate.vue'\r\nimport TableElementOperate from './TableElementOperate.vue'\r\nimport CommonElementOperate from './CommonElementOperate.vue'\r\nimport LinkHandler from './LinkHandler.vue'\r\n\r\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\r\n elementInfo: {\r\n type: Object as PropType,\r\n required: true,\r\n },\r\n isSelected: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n isActive: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n isActiveGroupElement: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n isMultiSelect: {\r\n type: Boolean,\r\n required: true,\r\n },\r\n rotateElement: {\r\n type: Function as PropType<(element: Exclude) => void>,\r\n required: true,\r\n },\r\n scaleElement: {\r\n type: Function as PropType<(e: MouseEvent, element: Exclude, command: OperateResizeHandlers) => void>,\r\n required: true,\r\n },\r\n dragLineElement: {\r\n type: Function as PropType<(e: MouseEvent, element: PPTLineElement, command: OperateLineHandlers) => void>,\r\n required: true,\r\n },\r\n moveShapeKeypoint: {\r\n type: Function as PropType<(e: MouseEvent, element: PPTShapeElement) => void>,\r\n required: true,\r\n },\r\n openLinkDialog: {\r\n type: Function as PropType<() => void>,\r\n required: true,\r\n },\r\n},\n setup(__props) {\n\nconst props = __props\n\r\n\r\n\r\nconst { canvasScale, toolbarState } = storeToRefs(useMainStore())\r\nconst { formatedAnimations } = storeToRefs(useSlidesStore())\r\n\r\nconst currentOperateComponent = computed(() => {\r\n const elementTypeMap = {\r\n [ElementTypes.IMAGE]: ImageElementOperate,\r\n [ElementTypes.TEXT]: TextElementOperate,\r\n [ElementTypes.SHAPE]: ShapeElementOperate,\r\n [ElementTypes.LINE]: LineElementOperate,\r\n [ElementTypes.TABLE]: TableElementOperate,\r\n [ElementTypes.CHART]: CommonElementOperate,\r\n [ElementTypes.LATEX]: CommonElementOperate,\r\n [ElementTypes.VIDEO]: CommonElementOperate,\r\n [ElementTypes.AUDIO]: CommonElementOperate,\r\n }\r\n return elementTypeMap[props.elementInfo.type] || null\r\n})\r\n\r\nconst elementIndexListInAnimation = computed(() => {\r\n const indexList = []\r\n for (let i = 0; i < formatedAnimations.value.length; i++) {\r\n const elIds = formatedAnimations.value[i].animations.map(item => item.elId)\r\n if (elIds.includes(props.elementInfo.id)) indexList.push(i)\r\n }\r\n return indexList\r\n})\r\n\r\nconst rotate = computed(() => 'rotate' in props.elementInfo ? props.elementInfo.rotate : 0)\r\nconst height = computed(() => 'height' in props.elementInfo ? props.elementInfo.height : 0)\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"operate\", { 'multi-select': __props.isMultiSelect && !__props.isActive }]),\n style: _normalizeStyle({\r\n top: __props.elementInfo.top * _unref(canvasScale) + 'px',\r\n left: __props.elementInfo.left * _unref(canvasScale) + 'px',\r\n transform: `rotate(${_unref(rotate)}deg)`,\r\n transformOrigin: `${__props.elementInfo.width * _unref(canvasScale) / 2}px ${_unref(height) * _unref(canvasScale) / 2}px`,\r\n })\n }, [\n (__props.isSelected)\n ? (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentOperateComponent)), {\n key: 0,\n elementInfo: __props.elementInfo,\n handlerVisible: !__props.elementInfo.lock && (__props.isActiveGroupElement || !__props.isMultiSelect),\n rotateElement: __props.rotateElement,\n scaleElement: __props.scaleElement,\n dragLineElement: __props.dragLineElement,\n moveShapeKeypoint: __props.moveShapeKeypoint\n }, null, 8, [\"elementInfo\", \"handlerVisible\", \"rotateElement\", \"scaleElement\", \"dragLineElement\", \"moveShapeKeypoint\"]))\n : _createCommentVNode(\"\", true),\n (_unref(toolbarState) === 'elAnimation' && _unref(elementIndexListInAnimation).length)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(elementIndexListInAnimation), (index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"index-item\",\n key: index\n }, _toDisplayString(index + 1), 1))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true),\n (__props.isActive && __props.elementInfo.link)\n ? (_openBlock(), _createBlock(LinkHandler, {\n key: 2,\n elementInfo: __props.elementInfo,\n link: __props.elementInfo.link,\n openLinkDialog: __props.openLinkDialog,\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(() => {}, [\"stop\"]))\n }, null, 8, [\"elementInfo\", \"link\", \"openLinkDialog\"]))\n : _createCommentVNode(\"\", true)\n ], 6))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=27793fbf&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-27793fbf\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-66f2009f\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"src\"]\n\nimport { computed, PropType } from 'vue'\nimport { PPTImageElement } from '@/types/slides'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\nimport useElementFlip from '@/views/components/element/hooks/useElementFlip'\nimport useClipImage from './useClipImage'\nimport useFilter from './useFilter'\n\nimport ImageOutline from './ImageOutline/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseImageElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst flipH = computed(() => props.elementInfo.flipH)\nconst flipV = computed(() => props.elementInfo.flipV)\nconst { flipStyle } = useElementFlip(flipH, flipV)\n\nconst clip = computed(() => props.elementInfo.clip)\nconst { clipShape, imgPosition } = useClipImage(clip)\n\nconst filters = computed(() => props.elementInfo.filters)\nconst { filter } = useFilter(filters)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-image\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\n filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '',\n transform: _unref(flipStyle),\n })\n }, [\n _createVNode(ImageOutline, { elementInfo: __props.elementInfo }, null, 8, [\"elementInfo\"]),\n _createElementVNode(\"div\", {\n class: \"image-content\",\n style: _normalizeStyle({ clipPath: _unref(clipShape).style })\n }, [\n _createElementVNode(\"img\", {\n src: __props.elementInfo.src,\n draggable: false,\n style: _normalizeStyle({\n top: _unref(imgPosition).top,\n left: _unref(imgPosition).left,\n width: _unref(imgPosition).width,\n height: _unref(imgPosition).height,\n filter: _unref(filter),\n }),\n alt: \"\"\n }, null, 12, _hoisted_1)\n ], 4)\n ], 4)\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseImageElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseImageElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseImageElement.vue?vue&type=style&index=0&id=66f2009f&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-66f2009f\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-659e869d\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"innerHTML\"]\n\nimport { PropType, computed, StyleValue } from 'vue'\nimport { PPTTextElement } from '@/types/slides'\nimport ElementOutline from '@/views/components/element/ElementOutline.vue'\n\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseTextElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst cssVar = computed(() => ({\n '--textIndent': `${props.elementInfo.textIndent || 0}px`,\n '--paragraphSpace': `${props.elementInfo.paragraphSpace === undefined ? 5 : props.elementInfo.paragraphSpace}px`,\n} as StyleValue))\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-text\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\n backgroundColor: __props.elementInfo.fill,\n opacity: __props.elementInfo.opacity,\n textShadow: _unref(shadowStyle),\n lineHeight: __props.elementInfo.lineHeight,\n letterSpacing: (__props.elementInfo.wordSpace || 0) + 'px',\n color: __props.elementInfo.defaultColor,\n fontFamily: __props.elementInfo.defaultFontName,\n })\n }, [\n _createVNode(ElementOutline, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"outline\"]),\n _createElementVNode(\"div\", {\n class: \"text ProseMirror-static\",\n style: _normalizeStyle(_unref(cssVar)),\n innerHTML: __props.elementInfo.content\n }, null, 12, _hoisted_1)\n ], 4)\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseTextElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseTextElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseTextElement.vue?vue&type=style&index=0&id=659e869d&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-659e869d\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-073084bf\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = { key: 0 }\nconst _hoisted_3 = [\"transform\"]\nconst _hoisted_4 = [\"d\", \"fill\", \"stroke\", \"stroke-width\", \"stroke-dasharray\"]\nconst _hoisted_5 = [\"innerHTML\"]\n\nimport { computed, PropType } from 'vue'\nimport { PPTShapeElement, ShapeText } from '@/types/slides'\nimport useElementOutline from '@/views/components/element/hooks/useElementOutline'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\nimport useElementFlip from '@/views/components/element/hooks/useElementFlip'\n\nimport GradientDefs from './GradientDefs.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseShapeElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst outline = computed(() => props.elementInfo.outline)\nconst { outlineWidth, outlineStyle, outlineColor } = useElementOutline(outline)\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst flipH = computed(() => props.elementInfo.flipH)\nconst flipV = computed(() => props.elementInfo.flipV)\nconst { flipStyle } = useElementFlip(flipH, flipV)\n\nconst text = computed(() => {\n const defaultText: ShapeText = {\n content: '',\n defaultFontName: '微软雅黑',\n defaultColor: '#000',\n align: 'middle',\n }\n if (!props.elementInfo.text) return defaultText\n\n return props.elementInfo.text\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-shape\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\n opacity: __props.elementInfo.opacity,\n filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '',\n transform: _unref(flipStyle),\n color: _unref(text).defaultColor,\n fontFamily: _unref(text).defaultFontName,\n })\n }, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: __props.elementInfo.width,\n height: __props.elementInfo.height\n }, [\n (__props.elementInfo.gradient)\n ? (_openBlock(), _createElementBlock(\"defs\", _hoisted_2, [\n _createVNode(GradientDefs, {\n id: `base-gradient-${__props.elementInfo.id}`,\n type: __props.elementInfo.gradient.type,\n color1: __props.elementInfo.gradient.color[0],\n color2: __props.elementInfo.gradient.color[1],\n rotate: __props.elementInfo.gradient.rotate\n }, null, 8, [\"id\", \"type\", \"color1\", \"color2\", \"rotate\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"g\", {\n transform: `scale(${__props.elementInfo.width / __props.elementInfo.viewBox[0]}, ${__props.elementInfo.height / __props.elementInfo.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`\n }, [\n _createElementVNode(\"path\", {\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n d: __props.elementInfo.path,\n fill: __props.elementInfo.gradient ? `url(#base-gradient-${__props.elementInfo.id})` : __props.elementInfo.fill,\n stroke: _unref(outlineColor),\n \"stroke-width\": _unref(outlineWidth),\n \"stroke-dasharray\": _unref(outlineStyle) === 'dashed' ? '10 5' : '0 0'\n }, null, 8, _hoisted_4)\n ], 8, _hoisted_3)\n ], 8, _hoisted_1)),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"shape-text\", _unref(text).align])\n }, [\n _createElementVNode(\"div\", {\n class: \"ProseMirror-static\",\n innerHTML: _unref(text).content\n }, null, 8, _hoisted_5)\n ], 2)\n ], 4)\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseShapeElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseShapeElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseShapeElement.vue?vue&type=style&index=0&id=073084bf&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-073084bf\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-340cdee8\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"d\", \"stroke\", \"stroke-width\", \"stroke-dasharray\", \"marker-start\", \"marker-end\"]\n\nimport { computed, PropType } from 'vue'\nimport { PPTLineElement } from '@/types/slides'\nimport { getLineElementPath } from '@/utils/element'\nimport useElementShadow from '@/views/components/element/hooks/useElementShadow'\n\nimport LinePointMarker from './LinePointMarker.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseLineElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst shadow = computed(() => props.elementInfo.shadow)\nconst { shadowStyle } = useElementShadow(shadow)\n\nconst svgWidth = computed(() => {\n const width = Math.abs(props.elementInfo.start[0] - props.elementInfo.end[0])\n return width < 24 ? 24 : width\n})\nconst svgHeight = computed(() => {\n const height = Math.abs(props.elementInfo.start[1] - props.elementInfo.end[1])\n return height < 24 ? 24 : height\n})\n\nconst lineDashArray = computed(() => props.elementInfo.style === 'dashed' ? '10, 5' : '0, 0')\n\nconst path = computed(() => {\n return getLineElementPath(props.elementInfo)\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-line\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({ filter: _unref(shadowStyle) ? `drop-shadow(${_unref(shadowStyle)})` : '' })\n }, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: _unref(svgWidth),\n height: _unref(svgHeight)\n }, [\n _createElementVNode(\"defs\", null, [\n (__props.elementInfo.points[0])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 0,\n id: __props.elementInfo.id,\n position: \"start\",\n type: __props.elementInfo.points[0],\n color: __props.elementInfo.color,\n baseSize: __props.elementInfo.width\n }, null, 8, [\"id\", \"type\", \"color\", \"baseSize\"]))\n : _createCommentVNode(\"\", true),\n (__props.elementInfo.points[1])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 1,\n id: __props.elementInfo.id,\n position: \"end\",\n type: __props.elementInfo.points[1],\n color: __props.elementInfo.color,\n baseSize: __props.elementInfo.width\n }, null, 8, [\"id\", \"type\", \"color\", \"baseSize\"]))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"path\", {\n d: _unref(path),\n stroke: __props.elementInfo.color,\n \"stroke-width\": __props.elementInfo.width,\n \"stroke-dasharray\": _unref(lineDashArray),\n fill: \"none\",\n \"marker-start\": __props.elementInfo.points[0] ? `url(#${__props.elementInfo.id}-${__props.elementInfo.points[0]}-start)` : '',\n \"marker-end\": __props.elementInfo.points[1] ? `url(#${__props.elementInfo.id}-${__props.elementInfo.points[1]}-end)` : ''\n }, null, 8, _hoisted_2)\n ], 8, _hoisted_1))\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseLineElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseLineElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseLineElement.vue?vue&type=style&index=0&id=340cdee8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-340cdee8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, inject, PropType, ref } from 'vue'\r\nimport { PPTChartElement } from '@/types/slides'\r\nimport { injectKeySlideScale } from '@/types/injectKey'\r\n\r\nimport ElementOutline from '@/views/components/element/ElementOutline.vue'\r\nimport Chart from './Chart.vue'\r\n\r\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseChartElement',\n props: {\r\n elementInfo: {\r\n type: Object as PropType,\r\n required: true,\r\n },\r\n},\n setup(__props) {\n\r\n\r\n\r\nconst slideScale = inject(injectKeySlideScale) || ref(1)\r\n\r\nconst needScaleSize = computed(() => slideScale.value < 1)\r\nconst zoom = computed(() => needScaleSize.value ? 1 / slideScale.value : 1)\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-chart\",\n style: _normalizeStyle({\r\n top: __props.elementInfo.top + 'px',\r\n left: __props.elementInfo.left + 'px',\r\n width: __props.elementInfo.width + 'px',\r\n height: __props.elementInfo.height + 'px',\r\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({\r\n backgroundColor: __props.elementInfo.fill,\r\n })\n }, [\n _createVNode(ElementOutline, {\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n outline: __props.elementInfo.outline\n }, null, 8, [\"width\", \"height\", \"outline\"]),\n _createVNode(Chart, {\n width: __props.elementInfo.width * _unref(zoom),\n height: __props.elementInfo.height * _unref(zoom),\n type: __props.elementInfo.chartType,\n data: __props.elementInfo.data,\n options: __props.elementInfo.options,\n themeColor: __props.elementInfo.themeColor,\n gridColor: __props.elementInfo.gridColor,\n legends: __props.elementInfo.data.legends,\n legend: __props.elementInfo.legend || '',\n style: _normalizeStyle({ zoom: 1 / _unref(zoom) })\n }, null, 8, [\"width\", \"height\", \"type\", \"data\", \"options\", \"themeColor\", \"gridColor\", \"legends\", \"legend\", \"style\"])\n ], 4)\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseChartElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseChartElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseChartElement.vue?vue&type=style&index=0&id=7d2e5c4e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7d2e5c4e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createElementVNode as _createElementVNode, vShow as _vShow, normalizeStyle as _normalizeStyle, withDirectives as _withDirectives, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-00712fa4\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\"]\nconst _hoisted_2 = [\"rowspan\", \"colspan\"]\nconst _hoisted_3 = [\"innerHTML\"]\n\nimport { computed, PropType, ref, watch } from 'vue'\nimport { PPTElementOutline, TableCell, TableTheme } from '@/types/slides'\nimport { getTextStyle, formatText } from './utils'\nimport useHideCells from './useHideCells'\nimport useSubThemeColor from './useSubThemeColor'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'StaticTable',\n props: {\n data: {\n type: Array as PropType,\n required: true,\n },\n width: {\n type: Number,\n required: true,\n },\n colWidths: {\n type: Array as PropType,\n required: true,\n },\n outline: {\n type: Object as PropType,\n required: true,\n },\n theme: {\n type: Object as PropType,\n },\n editable: {\n type: Boolean,\n default: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst colSizeList = ref([])\nconst totalWidth = computed(() => colSizeList.value.reduce((a, b) => a + b))\n\nwatch([\n () => props.colWidths,\n () => props.width,\n], () => {\n colSizeList.value = props.colWidths.map(item => item * props.width)\n}, { immediate: true })\n\nconst cells = computed(() => props.data)\nconst { hideCells } = useHideCells(cells)\n\nconst theme = computed(() => props.theme)\nconst { subThemeColor } = useSubThemeColor(theme)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"static-table\",\n style: _normalizeStyle({ width: _unref(totalWidth) + 'px' })\n }, [\n _createElementVNode(\"table\", {\n class: _normalizeClass({\n 'theme': _unref(theme),\n 'row-header': _unref(theme)?.rowHeader,\n 'row-footer': _unref(theme)?.rowFooter,\n 'col-header': _unref(theme)?.colHeader,\n 'col-footer': _unref(theme)?.colFooter,\n }),\n style: _normalizeStyle(`--themeColor: ${_unref(theme)?.color}; --subThemeColor1: ${_unref(subThemeColor)[0]}; --subThemeColor2: ${_unref(subThemeColor)[1]}`)\n }, [\n _createElementVNode(\"colgroup\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(colSizeList.value, (width, index) => {\n return (_openBlock(), _createElementBlock(\"col\", {\n span: \"1\",\n key: index,\n width: width\n }, null, 8, _hoisted_1))\n }), 128))\n ]),\n _createElementVNode(\"tbody\", null, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.data, (rowCells, rowIndex) => {\n return (_openBlock(), _createElementBlock(\"tr\", { key: rowIndex }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(rowCells, (cell, colIndex) => {\n return _withDirectives((_openBlock(), _createElementBlock(\"td\", {\n class: \"cell\",\n style: _normalizeStyle({\n borderStyle: __props.outline.style,\n borderColor: __props.outline.color,\n borderWidth: __props.outline.width + 'px',\n ..._unref(getTextStyle)(cell.style),\n }),\n key: cell.id,\n rowspan: cell.rowspan,\n colspan: cell.colspan\n }, [\n _createElementVNode(\"div\", {\n class: \"cell-text\",\n innerHTML: _unref(formatText)(cell.text)\n }, null, 8, _hoisted_3)\n ], 12, _hoisted_2)), [\n [_vShow, !_unref(hideCells).includes(`${rowIndex}_${colIndex}`)]\n ])\n }), 128))\n ]))\n }), 128))\n ])\n ], 6)\n ], 4))\n}\n}\n\n})","import script from \"./StaticTable.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./StaticTable.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./StaticTable.vue?vue&type=style&index=0&id=00712fa4&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-00712fa4\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-53e0f1ba\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\n\nimport { PropType } from 'vue'\nimport { PPTTableElement } from '@/types/slides'\n\nimport StaticTable from './StaticTable.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseTableElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-table\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createVNode(StaticTable, {\n data: __props.elementInfo.data,\n width: __props.elementInfo.width,\n colWidths: __props.elementInfo.colWidths,\n outline: __props.elementInfo.outline,\n theme: __props.elementInfo.theme\n }, null, 8, [\"data\", \"width\", \"colWidths\", \"outline\", \"theme\"])\n ])\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseTableElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseTableElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseTableElement.vue?vue&type=style&index=0&id=53e0f1ba&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-53e0f1ba\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-9a47b5f4\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\nconst _hoisted_2 = [\"width\", \"height\", \"stroke\", \"stroke-width\"]\nconst _hoisted_3 = [\"transform\"]\nconst _hoisted_4 = [\"d\"]\n\nimport { PropType } from 'vue'\nimport { PPTLatexElement } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseLatexElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-latex\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n (_openBlock(), _createElementBlock(\"svg\", {\n overflow: \"visible\",\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n stroke: __props.elementInfo.color,\n \"stroke-width\": __props.elementInfo.strokeWidth,\n fill: \"none\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }, [\n _createElementVNode(\"g\", {\n transform: `scale(${__props.elementInfo.width / __props.elementInfo.viewBox[0]}, ${__props.elementInfo.height / __props.elementInfo.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`\n }, [\n _createElementVNode(\"path\", {\n d: __props.elementInfo.path\n }, null, 8, _hoisted_4)\n ], 8, _hoisted_3)\n ], 8, _hoisted_2))\n ])\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseLatexElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseLatexElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseLatexElement.vue?vue&type=style&index=0&id=9a47b5f4&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-9a47b5f4\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { PropType } from 'vue'\nimport { PPTVideoElement } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseVideoElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlayOne = _resolveComponent(\"IconPlayOne\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-video\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", {\n class: \"element-content\",\n style: _normalizeStyle({ backgroundImage: `url(${__props.elementInfo.poster})` })\n }, [\n _createVNode(_component_IconPlayOne, { class: \"icon\" })\n ], 4)\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseVideoElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseVideoElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseVideoElement.vue?vue&type=style&index=0&id=56b7f716&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-56b7f716\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, normalizeStyle as _normalizeStyle, createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5258e03b\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\n\nimport { computed, PropType } from 'vue'\nimport { PPTAudioElement } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseAudioElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst audioIconSize = computed(() => {\n return Math.min(props.elementInfo.width, props.elementInfo.height) + 'px'\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconVolumeNotice = _resolveComponent(\"IconVolumeNotice\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"base-element-audio\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createVNode(_component_IconVolumeNotice, {\n class: \"audio-icon\",\n style: _normalizeStyle({\n fontSize: _unref(audioIconSize),\n color: __props.elementInfo.color,\n })\n }, null, 8, [\"style\"])\n ])\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./BaseAudioElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseAudioElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseAudioElement.vue?vue&type=style&index=0&id=5258e03b&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5258e03b\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { ElementTypes, PPTElement } from '@/types/slides'\n\nimport BaseImageElement from '@/views/components/element/ImageElement/BaseImageElement.vue'\nimport BaseTextElement from '@/views/components/element/TextElement/BaseTextElement.vue'\nimport BaseShapeElement from '@/views/components/element/ShapeElement/BaseShapeElement.vue'\nimport BaseLineElement from '@/views/components/element/LineElement/BaseLineElement.vue'\nimport BaseChartElement from '@/views/components/element/ChartElement/BaseChartElement.vue'\nimport BaseTableElement from '@/views/components/element/TableElement/BaseTableElement.vue'\nimport BaseLatexElement from '@/views/components/element/LatexElement/BaseLatexElement.vue'\nimport BaseVideoElement from '@/views/components/element/VideoElement/BaseVideoElement.vue'\nimport BaseAudioElement from '@/views/components/element/AudioElement/BaseAudioElement.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ThumbnailElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n elementIndex: {\n type: Number,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst currentElementComponent = computed(() => {\n const elementTypeMap = {\n [ElementTypes.IMAGE]: BaseImageElement,\n [ElementTypes.TEXT]: BaseTextElement,\n [ElementTypes.SHAPE]: BaseShapeElement,\n [ElementTypes.LINE]: BaseLineElement,\n [ElementTypes.CHART]: BaseChartElement,\n [ElementTypes.TABLE]: BaseTableElement,\n [ElementTypes.LATEX]: BaseLatexElement,\n [ElementTypes.VIDEO]: BaseVideoElement,\n [ElementTypes.AUDIO]: BaseAudioElement,\n }\n return elementTypeMap[props.elementInfo.type] || null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"base-element\", `base-element-${__props.elementInfo.id}`]),\n style: _normalizeStyle({\n zIndex: __props.elementIndex,\n })\n }, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentElementComponent)), {\n elementInfo: __props.elementInfo,\n target: \"thumbnail\"\n }, null, 8, [\"elementInfo\"]))\n ], 6))\n}\n}\n\n})","import script from \"./ThumbnailElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ThumbnailElement.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-f69fb5b2\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 1,\n class: \"placeholder\"\n}\n\nimport { computed, PropType, provide } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { Slide } from '@/types/slides'\nimport { injectKeySlideScale } from '@/types/injectKey'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'\n\nimport ThumbnailElement from './ThumbnailElement.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n slide: {\n type: Object as PropType,\n required: true,\n },\n size: {\n type: Number,\n required: true,\n },\n visible: {\n type: Boolean,\n default: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { viewportRatio } = storeToRefs(useSlidesStore())\n\nconst background = computed(() => props.slide.background)\nconst { backgroundStyle } = useSlideBackgroundStyle(background)\n\nconst scale = computed(() => props.size / VIEWPORT_SIZE)\nprovide(injectKeySlideScale, scale)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"thumbnail-slide\",\n style: _normalizeStyle({\n width: __props.size + 'px',\n height: __props.size * _unref(viewportRatio) + 'px',\n })\n }, [\n (__props.visible)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"elements\",\n style: _normalizeStyle({\n width: _unref(VIEWPORT_SIZE) + 'px',\n height: _unref(VIEWPORT_SIZE) * _unref(viewportRatio) + 'px',\n transform: `scale(${_unref(scale)})`,\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"background\",\n style: _normalizeStyle(_unref(backgroundStyle))\n }, null, 4),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.slide.elements, (element, index) => {\n return (_openBlock(), _createBlock(ThumbnailElement, {\n key: element.id,\n elementInfo: element,\n elementIndex: index + 1\n }, null, 8, [\"elementInfo\", \"elementIndex\"]))\n }), 128))\n ], 4))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_1, \"加载中 ...\"))\n ], 4))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=f69fb5b2&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-f69fb5b2\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, createCommentVNode as _createCommentVNode, unref as _unref, createTextVNode as _createTextVNode, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-dfb654e8\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"link-dialog\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = {\n key: 2,\n class: \"preview\"\n}\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", null, \"预览:\", -1))\nconst _hoisted_6 = { class: \"btns\" }\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"确认\")\n\nimport { computed, onMounted, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElementLink } from '@/types/slides'\nimport useLink from '@/hooks/useLink'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\ntype TypeKey = 'web' | 'slide'\ninterface TabItem {\n key: TypeKey\n label: string\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LinkDialog',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { handleElement } = storeToRefs(useMainStore())\nconst { slides } = storeToRefs(useSlidesStore())\n\nconst type = ref('web')\nconst address = ref('')\nconst slideId = ref('')\n\nslideId.value = slides.value[0].id\n\nconst selectedSlide = computed(() => {\n if (!slideId.value) return null\n\n return slides.value.find(item => item.id === slideId.value) || null\n})\n\nconst tabs: TabItem[] = [\n { key: 'web', label: '网页链接' },\n { key: 'slide', label: '幻灯片页面' },\n]\n\nconst { setLink } = useLink()\n\nonMounted(() => {\n if (handleElement.value?.link) {\n if (handleElement.value.link.type === 'web') address.value = handleElement.value.link.target\n else if (handleElement.value.link.type === 'slide') slideId.value = handleElement.value.link.target\n\n type.value = handleElement.value.link.type\n }\n})\n\nconst save = () => {\n const link: PPTElementLink = {\n type: type.value,\n target: type.value === 'web' ? address.value : slideId.value,\n }\n if (handleElement.value) {\n const success = setLink(handleElement.value, link)\n if (success) emit('close')\n else address.value = ''\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Input = _resolveComponent(\"Input\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (tab) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': type.value === tab.key }]),\n key: tab.key,\n onClick: ($event: any) => (type.value = tab.key)\n }, _toDisplayString(tab.label), 11, _hoisted_3)\n }), 64))\n ]),\n (type.value === 'web')\n ? (_openBlock(), _createBlock(_component_Input, {\n key: 0,\n class: \"input\",\n value: address.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((address).value = $event)),\n placeholder: \"请输入网页链接地址\"\n }, null, 8, [\"value\"]))\n : _createCommentVNode(\"\", true),\n (type.value === 'slide')\n ? (_openBlock(), _createBlock(_component_Select, {\n key: 1,\n class: \"input\",\n value: slideId.value,\n \"onUpdate:value\": _cache[1] || (_cache[1] = ($event: any) => ((slideId).value = $event))\n }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: slide.id,\n value: slide.id\n }, {\n default: _withCtx(() => [\n _createTextVNode(\"幻灯片 \" + _toDisplayString(index + 1), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }, 8, [\"value\"]))\n : _createCommentVNode(\"\", true),\n (type.value === 'slide' && _unref(selectedSlide))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_4, [\n _hoisted_5,\n _createVNode(ThumbnailSlide, {\n class: \"thumbnail\",\n slide: _unref(selectedSlide),\n size: 490\n }, null, 8, [\"slide\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(_component_Button, {\n onClick: _cache[2] || (_cache[2] = ($event: any) => (emit('close'))),\n style: {\"margin-right\":\"10px\"}\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n type: \"primary\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (save()))\n }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./LinkDialog.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LinkDialog.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LinkDialog.vue?vue&type=style&index=0&id=dfb654e8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-dfb654e8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, createVNode as _createVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, withCtx as _withCtx, resolveDirective as _resolveDirective, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1db12f3f\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"operates\" }\nconst _hoisted_2 = {\n key: 1,\n class: \"drag-mask\"\n}\n\nimport { onMounted, provide, ref, watch, watchEffect } from 'vue'\nimport { throttle } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore, useKeyboardStore } from '@/store'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport { PPTElement } from '@/types/slides'\nimport { AlignmentLineProps } from '@/types/edit'\nimport { injectKeySlideScale } from '@/types/injectKey'\nimport { removeAllRanges } from '@/utils/selection'\nimport { KEYS } from '@/configs/hotkey'\n\nimport useViewportSize from './hooks/useViewportSize'\nimport useMouseSelection from './hooks/useMouseSelection'\nimport useDropImageOrText from './hooks/useDropImageOrText'\nimport useRotateElement from './hooks/useRotateElement'\nimport useScaleElement from './hooks/useScaleElement'\nimport useSelectElement from './hooks/useSelectElement'\nimport useDragElement from './hooks/useDragElement'\nimport useDragLineElement from './hooks/useDragLineElement'\nimport useMoveShapeKeypoint from './hooks/useMoveShapeKeypoint'\nimport useInsertFromCreateSelection from './hooks/useInsertFromCreateSelection'\n\nimport useDeleteElement from '@/hooks/useDeleteElement'\nimport useCopyAndPasteElement from '@/hooks/useCopyAndPasteElement'\nimport useSelectAllElement from '@/hooks/useSelectAllElement'\nimport useScaleCanvas from '@/hooks/useScaleCanvas'\nimport useScreening from '@/hooks/useScreening'\nimport useSlideHandler from '@/hooks/useSlideHandler'\n\nimport EditableElement from './EditableElement.vue'\nimport MouseSelection from './MouseSelection.vue'\nimport ViewportBackground from './ViewportBackground.vue'\nimport AlignmentLine from './AlignmentLine.vue'\nimport Ruler from './Ruler.vue'\nimport ElementCreateSelection from './ElementCreateSelection.vue'\nimport MultiSelectOperate from './Operate/MultiSelectOperate.vue'\nimport Operate from './Operate/index.vue'\nimport LinkDialog from './LinkDialog.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst {\n activeElementIdList,\n activeGroupElementId,\n handleElementId,\n editorAreaFocus,\n showGridLines,\n showRuler,\n creatingElement,\n canvasScale,\n} = storeToRefs(mainStore)\nconst { currentSlide } = storeToRefs(useSlidesStore())\nconst { ctrlKeyState, spaceKeyState } = storeToRefs(useKeyboardStore())\n\nconst viewportRef = ref()\nconst alignmentLines = ref([])\n\nconst linkDialogVisible = ref(false)\nconst openLinkDialog = () => linkDialogVisible.value = true\n\nwatch(handleElementId, () => {\n mainStore.setActiveGroupElementId('')\n})\n\nconst elementList = ref([])\nconst setLocalElementList = () => {\n elementList.value = currentSlide.value ? JSON.parse(JSON.stringify(currentSlide.value.elements)) : []\n}\nwatchEffect(setLocalElementList)\n\nconst canvasRef = ref()\nconst { dragViewport, viewportStyles } = useViewportSize(canvasRef)\n\nuseDropImageOrText(canvasRef)\n\nconst { mouseSelection, mouseSelectionVisible, mouseSelectionQuadrant, updateMouseSelection } = useMouseSelection(elementList, viewportRef)\n\nconst { dragElement } = useDragElement(elementList, alignmentLines, canvasScale)\nconst { dragLineElement } = useDragLineElement(elementList)\nconst { selectElement } = useSelectElement(elementList, dragElement)\nconst { scaleElement, scaleMultiElement } = useScaleElement(elementList, alignmentLines, canvasScale)\nconst { rotateElement } = useRotateElement(elementList, viewportRef)\nconst { moveShapeKeypoint } = useMoveShapeKeypoint(elementList, canvasScale)\n\nconst { selectAllElement } = useSelectAllElement()\nconst { deleteAllElements } = useDeleteElement()\nconst { pasteElement } = useCopyAndPasteElement()\nconst { enterScreeningFromStart } = useScreening()\nconst { updateSlideIndex } = useSlideHandler()\n\n// 组件渲染时,如果存在元素焦点,需要清除\n// 这种情况存在于:有焦点元素的情况下进入了放映模式,再退出时,需要清除原先的焦点(因为可能已经切换了页面)\nonMounted(() => {\n if (activeElementIdList.value.length) mainStore.setActiveElementIdList([])\n})\n\n// 点击画布的空白区域:清空焦点元素、设置画布焦点、清除文字选区\nconst handleClickBlankArea = (e: MouseEvent) => {\n mainStore.setActiveElementIdList([])\n\n if (!spaceKeyState.value) updateMouseSelection(e)\n else dragViewport(e)\n\n if (!editorAreaFocus.value) mainStore.setEditorareaFocus(true)\n removeAllRanges()\n}\n\n// 移除画布编辑区域焦点\nconst removeEditorAreaFocus = () => {\n if (editorAreaFocus.value) mainStore.setEditorareaFocus(false)\n}\n\n// 滚动鼠标\nconst { scaleCanvas } = useScaleCanvas()\nconst throttleScaleCanvas = throttle(scaleCanvas, 100, { leading: true, trailing: false })\nconst throttleUpdateSlideIndex = throttle(updateSlideIndex, 300, { leading: true, trailing: false })\n\nconst handleMousewheelCanvas = (e: WheelEvent) => {\n e.preventDefault()\n\n // 按住Ctrl键时:缩放画布\n if (ctrlKeyState.value) {\n if (e.deltaY > 0) throttleScaleCanvas('-')\n else if (e.deltaY < 0) throttleScaleCanvas('+')\n }\n // 上下翻页\n else {\n if (e.deltaY > 0) throttleUpdateSlideIndex(KEYS.DOWN)\n else if (e.deltaY < 0) throttleUpdateSlideIndex(KEYS.UP)\n }\n}\n\n// 开关网格线\nconst toggleGridLines = () => {\n mainStore.setGridLinesState(!showGridLines.value)\n}\n\n// 开关标尺\nconst toggleRuler = () => {\n mainStore.setRulerState(!showRuler.value)\n}\n\n// 在鼠标绘制的范围插入元素\nconst { insertElementFromCreateSelection } = useInsertFromCreateSelection(viewportRef)\n\nconst contextmenus = (): ContextmenuItem[] => {\n return [\n {\n text: '粘贴',\n subText: 'Ctrl + V',\n handler: pasteElement,\n },\n {\n text: '全选',\n subText: 'Ctrl + A',\n handler: selectAllElement,\n },\n {\n text: '网格线',\n subText: showGridLines.value ? '√' : '',\n handler: toggleGridLines,\n },\n {\n text: '标尺',\n subText: showRuler.value ? '√' : '',\n handler: toggleRuler,\n },\n {\n text: '重置当前页',\n handler: deleteAllElements,\n },\n { divider: true },\n {\n text: '幻灯片放映',\n subText: 'F5',\n handler: enterScreeningFromStart,\n },\n ]\n}\n\nprovide(injectKeySlideScale, canvasScale)\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Modal = _resolveComponent(\"Modal\")!\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n const _directive_click_outside = _resolveDirective(\"click-outside\")!\n\n return _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"canvas\",\n ref_key: \"canvasRef\",\n ref: canvasRef,\n onWheel: _cache[3] || (_cache[3] = $event => handleMousewheelCanvas($event)),\n onMousedown: _cache[4] || (_cache[4] = $event => handleClickBlankArea($event))\n }, [\n (_unref(creatingElement))\n ? (_openBlock(), _createBlock(ElementCreateSelection, {\n key: 0,\n onCreated: _cache[0] || (_cache[0] = data => _unref(insertElementFromCreateSelection)(data))\n }))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", {\n class: \"viewport-wrapper\",\n style: _normalizeStyle({\n width: _unref(viewportStyles).width * _unref(canvasScale) + 'px',\n height: _unref(viewportStyles).height * _unref(canvasScale) + 'px',\n left: _unref(viewportStyles).left + 'px',\n top: _unref(viewportStyles).top + 'px',\n })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(alignmentLines.value, (line, index) => {\n return (_openBlock(), _createBlock(AlignmentLine, {\n key: index,\n type: line.type,\n axis: line.axis,\n length: line.length,\n canvasScale: _unref(canvasScale)\n }, null, 8, [\"type\", \"axis\", \"length\", \"canvasScale\"]))\n }), 128)),\n (_unref(activeElementIdList).length > 1)\n ? (_openBlock(), _createBlock(MultiSelectOperate, {\n key: 0,\n elementList: elementList.value,\n scaleMultiElement: _unref(scaleMultiElement)\n }, null, 8, [\"elementList\", \"scaleMultiElement\"]))\n : _createCommentVNode(\"\", true),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(elementList.value, (element) => {\n return (_openBlock(), _createBlock(Operate, {\n key: element.id,\n elementInfo: element,\n isSelected: _unref(activeElementIdList).includes(element.id),\n isActive: _unref(handleElementId) === element.id,\n isActiveGroupElement: _unref(activeGroupElementId) === element.id,\n isMultiSelect: _unref(activeElementIdList).length > 1,\n rotateElement: _unref(rotateElement),\n scaleElement: _unref(scaleElement),\n openLinkDialog: openLinkDialog,\n dragLineElement: _unref(dragLineElement),\n moveShapeKeypoint: _unref(moveShapeKeypoint)\n }, null, 8, [\"elementInfo\", \"isSelected\", \"isActive\", \"isActiveGroupElement\", \"isMultiSelect\", \"rotateElement\", \"scaleElement\", \"dragLineElement\", \"moveShapeKeypoint\"]))\n }), 128)),\n _createVNode(ViewportBackground)\n ]),\n _createElementVNode(\"div\", {\n class: \"viewport\",\n ref_key: \"viewportRef\",\n ref: viewportRef,\n style: _normalizeStyle({ transform: `scale(${_unref(canvasScale)})` })\n }, [\n (_unref(mouseSelectionVisible))\n ? (_openBlock(), _createBlock(MouseSelection, {\n key: 0,\n top: _unref(mouseSelection).top,\n left: _unref(mouseSelection).left,\n width: _unref(mouseSelection).width,\n height: _unref(mouseSelection).height,\n quadrant: _unref(mouseSelectionQuadrant)\n }, null, 8, [\"top\", \"left\", \"width\", \"height\", \"quadrant\"]))\n : _createCommentVNode(\"\", true),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(elementList.value, (element, index) => {\n return (_openBlock(), _createBlock(EditableElement, {\n key: element.id,\n elementInfo: element,\n elementIndex: index + 1,\n isMultiSelect: _unref(activeElementIdList).length > 1,\n selectElement: _unref(selectElement),\n openLinkDialog: openLinkDialog\n }, null, 8, [\"elementInfo\", \"elementIndex\", \"isMultiSelect\", \"selectElement\"]))\n }), 128))\n ], 4)\n ], 4),\n (_unref(spaceKeyState))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2))\n : _createCommentVNode(\"\", true),\n (_unref(showRuler))\n ? (_openBlock(), _createBlock(Ruler, {\n key: 2,\n viewportStyles: _unref(viewportStyles)\n }, null, 8, [\"viewportStyles\"]))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_Modal, {\n visible: linkDialogVisible.value,\n \"onUpdate:visible\": _cache[2] || (_cache[2] = ($event: any) => ((linkDialogVisible).value = $event)),\n footer: null,\n centered: \"\",\n width: 540,\n destroyOnClose: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(LinkDialog, {\n onClose: _cache[1] || (_cache[1] = ($event: any) => (linkDialogVisible.value = false))\n })\n ]),\n _: 1\n }, 8, [\"visible\"])\n ], 32)), [\n [_directive_contextmenu, contextmenus],\n [_directive_click_outside, removeEditorAreaFocus]\n ])\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=1db12f3f&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1db12f3f\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5788e0d2\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"shape-pool\" }\nconst _hoisted_2 = { class: \"category-name\" }\nconst _hoisted_3 = { class: \"shape-list\" }\nconst _hoisted_4 = [\"onClick\"]\nconst _hoisted_5 = {\n overflow: \"visible\",\n width: \"18\",\n height: \"18\"\n}\nconst _hoisted_6 = [\"transform\"]\nconst _hoisted_7 = [\"fill\", \"stroke\", \"d\"]\n\nimport { SHAPE_LIST, ShapePoolItem } from '@/configs/shapes'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ShapePool',\n emits: [\"select\"],\n setup(__props, { emit }: { emit: ({\n (event: 'select', payload: ShapePoolItem): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst selectShape = (shape: ShapePoolItem) => {\n emit('select', shape)\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(SHAPE_LIST), (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"category\",\n key: item.type\n }, [\n _createElementVNode(\"div\", _hoisted_2, _toDisplayString(item.type), 1),\n _createElementVNode(\"div\", _hoisted_3, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(item.children, (shape, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"shape-item\",\n key: index\n }, [\n _createElementVNode(\"div\", {\n class: \"shape-content\",\n onClick: ($event: any) => (selectShape(shape))\n }, [\n (_openBlock(), _createElementBlock(\"svg\", _hoisted_5, [\n _createElementVNode(\"g\", {\n transform: `scale(${18 / shape.viewBox[0]}, ${18 / shape.viewBox[1]}) translate(0,0) matrix(1,0,0,1,0,0)`\n }, [\n _createElementVNode(\"path\", {\n class: _normalizeClass([\"shape-path\", { 'outlined': shape.outlined }]),\n \"vector-effect\": \"non-scaling-stroke\",\n \"stroke-linecap\": \"butt\",\n \"stroke-miterlimit\": \"8\",\n fill: shape.outlined ? '#999' : 'transparent',\n stroke: shape.outlined ? 'transparent' : '#999',\n \"stroke-width\": \"2\",\n d: shape.path\n }, null, 10, _hoisted_7)\n ], 8, _hoisted_6)\n ]))\n ], 8, _hoisted_4)\n ]))\n }), 128))\n ])\n ]))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./ShapePool.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ShapePool.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ShapePool.vue?vue&type=style&index=0&id=5788e0d2&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5788e0d2\"]])\n\nexport default __exports__","import { LinePoint } from '@/types/slides'\n\n\nexport interface LinePoolItem {\n path: string\n style: 'solid' | 'dashed'\n points: [LinePoint, LinePoint]\n isBroken?: boolean\n isCurve?: boolean\n isCubic?: boolean\n}\n\ninterface PresetLine {\n type: string\n children: LinePoolItem[]\n}\n\nexport const LINE_LIST: PresetLine[] = [\n {\n type: '直线',\n children: [\n { path: 'M 0 0 L 20 20', style: 'solid', points: ['', ''] },\n { path: 'M 0 0 L 20 20', style: 'dashed', points: ['', ''] },\n { path: 'M 0 0 L 20 20', style: 'solid', points: ['', 'arrow'] },\n { path: 'M 0 0 L 20 20', style: 'dashed', points: ['', 'arrow'] },\n { path: 'M 0 0 L 20 20', style: 'solid', points: ['', 'dot'] },\n ],\n },\n {\n type: '折线、曲线',\n children: [\n { path: 'M 0 0 L 0 20 L 20 20', style: 'solid', points: ['', 'arrow'], isBroken: true },\n { path: 'M 0 0 Q 0 20 20 20', style: 'solid', points: ['', 'arrow'], isCurve: true },\n { path: 'M 0 0 C 20 0 0 20 20 20', style: 'solid', points: ['', 'arrow'], isCubic: true },\n ],\n },\n]","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createBlock as _createBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-bca68faa\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"line-pool\" }\nconst _hoisted_2 = { class: \"category-name\" }\nconst _hoisted_3 = { class: \"line-list\" }\nconst _hoisted_4 = [\"onClick\"]\nconst _hoisted_5 = {\n overflow: \"visible\",\n width: \"20\",\n height: \"20\"\n}\nconst _hoisted_6 = [\"d\", \"stroke-dasharray\", \"marker-start\", \"marker-end\"]\n\nimport { LINE_LIST, LinePoolItem } from '@/configs/lines'\n\nimport LinePointMarker from '@/views/components/element/LineElement/LinePointMarker.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LinePool',\n emits: [\"select\"],\n setup(__props, { emit }: { emit: ({\n (event: 'select', payload: LinePoolItem): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst selectLine = (line: LinePoolItem) => {\n emit('select', line)\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(LINE_LIST), (item, i) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"category\",\n key: item.type\n }, [\n _createElementVNode(\"div\", _hoisted_2, _toDisplayString(item.type), 1),\n _createElementVNode(\"div\", _hoisted_3, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(item.children, (line, j) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"line-item\",\n key: j\n }, [\n _createElementVNode(\"div\", {\n class: \"line-content\",\n onClick: ($event: any) => (selectLine(line))\n }, [\n (_openBlock(), _createElementBlock(\"svg\", _hoisted_5, [\n _createElementVNode(\"defs\", null, [\n (line.points[0])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 0,\n class: \"line-marker\",\n id: `preset-line-${i}-${j}`,\n position: \"start\",\n type: line.points[0],\n color: \"currentColor\",\n baseSize: 2\n }, null, 8, [\"id\", \"type\"]))\n : _createCommentVNode(\"\", true),\n (line.points[1])\n ? (_openBlock(), _createBlock(LinePointMarker, {\n key: 1,\n class: \"line-marker\",\n id: `preset-line-${i}-${j}`,\n position: \"end\",\n type: line.points[1],\n color: \"currentColor\",\n baseSize: 2\n }, null, 8, [\"id\", \"type\"]))\n : _createCommentVNode(\"\", true)\n ]),\n _createElementVNode(\"path\", {\n class: \"line-path\",\n d: line.path,\n stroke: \"currentColor\",\n fill: \"none\",\n \"stroke-width\": \"2\",\n \"stroke-dasharray\": line.style === 'solid' ? '0, 0' : '4, 1',\n \"marker-start\": line.points[0] ? `url(#${`preset-line-${i}-${j}`}-${line.points[0]}-start)` : '',\n \"marker-end\": line.points[1] ? `url(#${`preset-line-${i}-${j}`}-${line.points[1]}-end)` : ''\n }, null, 8, _hoisted_6)\n ]))\n ], 8, _hoisted_4)\n ]))\n }), 128))\n ])\n ]))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./LinePool.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LinePool.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LinePool.vue?vue&type=style&index=0&id=bca68faa&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-bca68faa\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, resolveComponent as _resolveComponent, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3870b42e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"chart-pool\" }\nconst _hoisted_2 = [\"onClick\"]\n\nimport { PresetChartType } from '@/types/slides'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ChartPool',\n emits: [\"select\"],\n setup(__props, { emit }: { emit: ({\n (event: 'select', payload: PresetChartType): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst chartList: PresetChartType[] = ['bar', 'horizontalBar', 'line', 'area', 'scatter', 'pie', 'ring']\n\nconst selectChart = (chart: PresetChartType) => {\n emit('select', chart)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconChartLine = _resolveComponent(\"IconChartLine\")!\n const _component_IconChartHistogram = _resolveComponent(\"IconChartHistogram\")!\n const _component_IconChartPie = _resolveComponent(\"IconChartPie\")!\n const _component_IconChartHistogramOne = _resolveComponent(\"IconChartHistogramOne\")!\n const _component_IconChartLineArea = _resolveComponent(\"IconChartLineArea\")!\n const _component_IconChartRing = _resolveComponent(\"IconChartRing\")!\n const _component_IconChartScatter = _resolveComponent(\"IconChartScatter\")!\n\n return (_openBlock(), _createElementBlock(\"ul\", _hoisted_1, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(chartList, (chart, index) => {\n return _createElementVNode(\"li\", {\n class: \"chart-item\",\n key: index\n }, [\n _createElementVNode(\"div\", {\n class: \"chart-content\",\n onClick: ($event: any) => (selectChart(chart))\n }, [\n (chart === 'line')\n ? (_openBlock(), _createBlock(_component_IconChartLine, {\n key: 0,\n size: \"24\"\n }))\n : (chart === 'bar')\n ? (_openBlock(), _createBlock(_component_IconChartHistogram, {\n key: 1,\n size: \"24\"\n }))\n : (chart === 'pie')\n ? (_openBlock(), _createBlock(_component_IconChartPie, {\n key: 2,\n size: \"24\"\n }))\n : (chart === 'horizontalBar')\n ? (_openBlock(), _createBlock(_component_IconChartHistogramOne, {\n key: 3,\n size: \"24\"\n }))\n : (chart === 'area')\n ? (_openBlock(), _createBlock(_component_IconChartLineArea, {\n key: 4,\n size: \"24\"\n }))\n : (chart === 'ring')\n ? (_openBlock(), _createBlock(_component_IconChartRing, {\n key: 5,\n size: \"24\"\n }))\n : (chart === 'scatter')\n ? (_openBlock(), _createBlock(_component_IconChartScatter, {\n key: 6,\n size: \"24\"\n }))\n : _createCommentVNode(\"\", true)\n ], 8, _hoisted_2)\n ])\n }), 64))\n ]))\n}\n}\n\n})","import script from \"./ChartPool.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ChartPool.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ChartPool.vue?vue&type=style&index=0&id=3870b42e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-3870b42e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-144fbd05\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"table-generator\" }\nconst _hoisted_2 = { class: \"title\" }\nconst _hoisted_3 = { class: \"lef\" }\nconst _hoisted_4 = [\"onMouseenter\"]\nconst _hoisted_5 = {\n key: 1,\n class: \"custom\"\n}\nconst _hoisted_6 = { class: \"row\" }\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", {\n class: \"label\",\n style: {\"flex\":\"1\"}\n}, \"行数:\", -1))\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", {\n class: \"label\",\n style: {\"flex\":\"1\"}\n}, \"列数:\", -1))\nconst _hoisted_10 = { class: \"btns\" }\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"确认\")\n\nimport { ref } from 'vue'\nimport { message } from 'ant-design-vue'\n\ninterface InsertData {\n row: number\n col: number\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'TableGenerator',\n emits: [\"insert\", \"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'insert', payload: InsertData): void\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst endCell = ref([])\nconst customRow = ref(3)\nconst customCol = ref(3)\nconst isCustom = ref(false)\n\nconst handleClickTable = () => {\n if (!endCell.value.length) return\n const [row, col] = endCell.value\n emit('insert', { row, col })\n}\n\nconst insertCustomTable = () => {\n if (customRow.value < 1 || customRow.value > 20) return message.warning('行数/列数必须在0~20之间!')\n if (customCol.value < 1 || customCol.value > 20) return message.warning('行数/列数必须在0~20之间!')\n emit('insert', { row: customRow.value, col: customCol.value })\n isCustom.value = false\n}\n\nconst close = () => {\n emit('close')\n isCustom.value = false\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, \"表格 \" + _toDisplayString(endCell.value.length ? `${endCell.value[0]} x ${endCell.value[1]}` : ''), 1),\n _createElementVNode(\"div\", {\n class: \"right\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (isCustom.value = !isCustom.value))\n }, _toDisplayString(isCustom.value ? '返回' : '自定义'), 1)\n ]),\n (!isCustom.value)\n ? (_openBlock(), _createElementBlock(\"table\", {\n key: 0,\n onMouseleave: _cache[1] || (_cache[1] = ($event: any) => (endCell.value = [])),\n onClick: _cache[2] || (_cache[2] = ($event: any) => (handleClickTable()))\n }, [\n _createElementVNode(\"tbody\", null, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(10, (row) => {\n return _createElementVNode(\"tr\", { key: row }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(10, (col) => {\n return _createElementVNode(\"td\", {\n onMouseenter: ($event: any) => (endCell.value = [row, col]),\n key: col\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"cell\", { 'active': endCell.value.length && row <= endCell.value[0] && col <= endCell.value[1] }])\n }, null, 2)\n ], 40, _hoisted_4)\n }), 64))\n ])\n }), 64))\n ])\n ], 32))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", _hoisted_6, [\n _hoisted_7,\n _createVNode(_component_InputNumber, {\n min: 1,\n max: 20,\n value: customRow.value,\n \"onUpdate:value\": _cache[3] || (_cache[3] = ($event: any) => ((customRow).value = $event)),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_InputNumber, {\n min: 1,\n max: 20,\n value: customCol.value,\n \"onUpdate:value\": _cache[4] || (_cache[4] = ($event: any) => ((customCol).value = $event)),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _createVNode(_component_Button, {\n class: \"btn\",\n onClick: _cache[5] || (_cache[5] = ($event: any) => (close()))\n }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn\",\n type: \"primary\",\n onClick: _cache[6] || (_cache[6] = ($event: any) => (insertCustomTable()))\n }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n })\n ])\n ]))\n ]))\n}\n}\n\n})","import script from \"./TableGenerator.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./TableGenerator.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./TableGenerator.vue?vue&type=style&index=0&id=144fbd05&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-144fbd05\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-b9437110\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"media-input\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"btns\" }\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"确认\")\nconst _hoisted_7 = { class: \"btns\" }\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"确认\")\n\nimport { ref } from 'vue'\nimport { message } from 'ant-design-vue'\n\ntype TypeKey = 'video' | 'audio'\ninterface TabItem {\n key: TypeKey\n label: string\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MediaInput',\n emits: [\"insertVideo\", \"insertAudio\", \"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'insertVideo', payload: string): void\n (event: 'insertAudio', payload: string): void\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst type = ref('video')\n\nconst videoSrc = ref('https://mazwai.com/videvo_files/video/free/2019-01/small_watermarked/181004_04_Dolphins-Whale_06_preview.webm')\nconst audioSrc = ref('https://freesound.org/data/previews/614/614107_11861866-lq.mp3')\n\nconst tabs: TabItem[] = [\n { key: 'video', label: '视频' },\n { key: 'audio', label: '音频' },\n]\n\nconst insertVideo = () => {\n if (!videoSrc.value) return message.error('请先输入正确的视频地址')\n emit('insertVideo', videoSrc.value)\n}\n\nconst insertAudio = () => {\n if (!audioSrc.value) return message.error('请先输入正确的音频地址')\n emit('insertAudio', audioSrc.value)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Input = _resolveComponent(\"Input\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (tab) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': type.value === tab.key }]),\n key: tab.key,\n onClick: ($event: any) => (type.value = tab.key)\n }, _toDisplayString(tab.label), 11, _hoisted_3)\n }), 64))\n ]),\n (type.value === 'video')\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createVNode(_component_Input, {\n value: videoSrc.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((videoSrc).value = $event)),\n placeholder: \"请输入视频地址,e.g. https://xxx.mp4\"\n }, null, 8, [\"value\"]),\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_Button, {\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emit('close'))),\n style: {\"margin-right\":\"10px\"}\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n type: \"primary\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (insertVideo()))\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n })\n ])\n ], 64))\n : _createCommentVNode(\"\", true),\n (type.value === 'audio')\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n _createVNode(_component_Input, {\n value: audioSrc.value,\n \"onUpdate:value\": _cache[3] || (_cache[3] = ($event: any) => ((audioSrc).value = $event)),\n placeholder: \"请输入音频地址,e.g. https://xxx.mp3\"\n }, null, 8, [\"value\"]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createVNode(_component_Button, {\n onClick: _cache[4] || (_cache[4] = ($event: any) => (emit('close'))),\n style: {\"margin-right\":\"10px\"}\n }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n type: \"primary\",\n onClick: _cache[5] || (_cache[5] = ($event: any) => (insertAudio()))\n }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n })\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./MediaInput.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MediaInput.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MediaInput.vue?vue&type=style&index=0&id=b9437110&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-b9437110\"]])\n\nexport default __exports__","import { hfmath, CONFIG as hfmathConfig } from 'hfmath'\n\nhfmathConfig.SUB_SUP_SCALE = 0.5\n\nexport { hfmath }","export const FORMULA_LIST = [\n {\n label: '高斯公式',\n latex: `\\\\int\\\\int\\\\int _ { \\\\Omega } \\\\left( \\\\frac { \\\\partial {P} } { \\\\partial {x} } + \\\\frac { \\\\partial {Q} } { \\\\partial {y} } + \\\\frac { \\\\partial {R} }{ \\\\partial {z} } \\\\right) \\\\mathrm { d } V = \\\\oint _ { \\\\partial \\\\Omega } ( P \\\\cos \\\\alpha + Q \\\\cos \\\\beta + R \\\\cos \\\\gamma ) \\\\mathrm{ d} S`\n },\n {\n label: '傅里叶级数',\n latex: `f(x) = \\\\frac {a_0} 2 + \\\\sum_{n = 1}^\\\\infty {({a_n}\\\\cos {nx} + {b_n}\\\\sin {nx})}`,\n },\n {\n label: '泰勒展开式',\n latex: `e ^ { x } = 1 + \\\\frac { x } { 1 ! } + \\\\frac { x ^ { 2 } } { 2 ! } + \\\\frac { x ^ { 3 } } { 3 ! } + ... , \\\\quad - \\\\infty < x < \\\\infty`,\n },\n {\n label: '定积分',\n latex: `\\\\lim_ { n \\\\rightarrow + \\\\infty } \\\\sum _ { i = 1 } ^ { n } f \\\\left[ a + \\\\frac { i } { n } ( b - a ) \\\\right] \\\\frac { b - a } { n } = \\\\int _ { a } ^ { b } f ( x ) dx`,\n },\n {\n label: '三角恒等式1',\n latex: `\\\\sin \\\\alpha \\\\pm \\\\sin \\\\beta = 2 \\\\sin \\\\frac { 1 } { 2 } ( \\\\alpha \\\\pm \\\\beta ) \\\\cos \\\\frac { 1 } { 2 } ( \\\\alpha \\\\mp \\\\beta )`,\n },\n {\n label: '三角恒等式2',\n latex: `\\\\cos \\\\alpha + \\\\cos \\\\beta = 2 \\\\cos \\\\frac { 1 } { 2 } ( \\\\alpha + \\\\beta ) \\\\cos \\\\frac { 1 } { 2 } ( \\\\alpha - \\\\beta )`,\n },\n {\n label: '和的展开式',\n latex: `( 1 + x ) ^ { n } = 1 + \\\\frac { n x } { 1 ! } + \\\\frac { n ( n - 1 ) x ^ { 2 } } { 2 ! } + ...`,\n },\n {\n label: '欧拉公式',\n latex: ` e^{ix} = \\\\cos {x} + i\\\\sin {x}`,\n },\n {\n label: '贝努利方程',\n latex: `\\\\frac {dy} {dx} + P(x)y = Q(x) y^n ({n} \\\\not= {0,1})`,\n },\n {\n label: '全微分方程',\n latex: `du(x,y) = P(x,y)dx + Q(x,y)dy = 0`,\n },\n {\n label: '非齐次方程',\n latex: `y = (\\\\int Q(x) e^{\\\\int {P(x)dx}}dx + C)e^{-\\\\int {P(x)dx}}`,\n },\n {\n label: '柯西中值定理',\n latex: `\\\\frac{{f(b) - f(a)}}{{F(b) - F(a)}} = \\\\frac{{f'(\\\\xi )}}{{F'(\\\\xi )}}`,\n },\n {\n label: '拉格朗日中值定理',\n latex: `f(b) - f(a) = f'(\\\\xi )(b - a)`,\n },\n {\n label: '导数公式',\n latex: `(\\\\arcsin x)' = \\\\frac{1}{{\\\\sqrt {1 - x^2} }}`,\n },\n {\n label: '三角函数积分',\n latex: `\\\\int {tgxdx = - \\\\ln \\\\left| {\\\\cos x} \\\\right| + C}`,\n },\n {\n label: '二次曲面',\n latex: `\\\\frac{{{x^2}}}{{{a^2}}} + \\\\frac{{{y^2}}}{{{b^2}}} - \\\\frac{{{z^2}}}{{{c^2}}} = 1`,\n },\n {\n label: '二阶微分',\n latex: `\\\\frac {{d^2}y} {dx^2} + P(x) \\\\frac {dy} {dx} + Q(x)y = f(x)`,\n },\n {\n label: '方向导数',\n latex: `\\\\frac{{\\\\partial f}}{{\\\\partial l}} = \\\\frac{{\\\\partial f}}{{\\\\partial x}}\\\\cos \\\\phi + \\\\frac{{\\\\partial f}}{{\\\\partial y}}\\\\sin \\\\phi`,\n },\n]\n\nexport const SYMBOL_LIST = [\n {\n type: 'operators',\n label: '数学',\n children: [\n { latex: '\\\\cdot' },\n { latex: '\\\\pm' },\n { latex: '\\\\mp' },\n { latex: '+' },\n { latex: '-' },\n { latex: '\\\\times' },\n { latex: '\\\\div' },\n { latex: '<' },\n { latex: '>' },\n { latex: '=' },\n { latex: '\\\\neq\\\\ne' },\n { latex: '\\\\leqq' },\n { latex: '\\\\geqq' },\n { latex: '\\\\leq' },\n { latex: '\\\\geq' },\n { latex: '\\\\propto' },\n { latex: '\\\\sim' },\n { latex: '\\\\equiv' },\n { latex: '\\\\dagger' },\n { latex: '\\\\ddagger' },\n { latex: '\\\\ell' },\n { latex: '\\\\#' },\n { latex: '\\\\$' },\n { latex: '\\\\&' },\n { latex: '\\\\%' },\n { latex: '\\\\langle\\\\rangle' },\n { latex: '()' },\n { latex: '[]' },\n { latex: '\\\\{\\\\}' },\n { latex: '||' },\n { latex: '\\\\|' },\n { latex: '\\\\exists' },\n { latex: '\\\\in' },\n { latex: '\\\\subset' },\n { latex: '\\\\supset' },\n { latex: '\\\\cup' },\n { latex: '\\\\cap' },\n { latex: '\\\\infty' },\n { latex: '\\\\partial' },\n { latex: '\\\\nabla' },\n { latex: '\\\\aleph' },\n { latex: '\\\\wp' },\n { latex: '\\\\therefore' },\n { latex: '\\\\mid' },\n { latex: '\\\\sum' },\n { latex: '\\\\prod' },\n { latex: '\\\\bigoplus' },\n { latex: '\\\\bigodot' },\n { latex: '\\\\int' },\n { latex: '\\\\oint' },\n { latex: '\\\\oplus' },\n { latex: '\\\\odot' },\n { latex: '\\\\perp' },\n { latex: '\\\\angle' },\n { latex: '\\\\triangle' },\n { latex: '\\\\Box' },\n { latex: '\\\\rightarrow' },\n { latex: '\\\\to' },\n { latex: '\\\\leftarrow' },\n { latex: '\\\\gets' },\n { latex: '\\\\circ' },\n { latex: '\\\\bigcirc' },\n { latex: '\\\\bullet' },\n { latex: '\\\\star' },\n { latex: '\\\\diamond' },\n { latex: '\\\\ast' },\n { latex: ',' },\n { latex: '.' },\n { latex: ';' },\n { latex: '!' },\n ],\n },\n {\n type: 'group',\n label: '组合',\n children: [\n { latex: '\\\\frac{a}{b}' },\n { latex: '\\\\frac{dx}{dx}' },\n { latex: '\\\\frac{\\\\partial a}{\\\\partial b}' },\n { latex: '\\\\sqrt{x}' },\n { latex: '\\\\sqrt[n]{x}' },\n { latex: 'x^{n}' },\n { latex: 'x_{n}' },\n { latex: 'x_a^b' },\n { latex: '\\\\int_{a}^{b}' },\n { latex: '\\\\oint_a^b' },\n { latex: '\\\\lim_{a \\\\rightarrow b}' },\n { latex: '\\\\prod_a^b' },\n { latex: '\\\\sum_a^b' },\n { latex: '\\\\left(\\\\begin{array}a \\\\\\\\ b\\\\end{array}\\\\right)' },\n { latex: '\\\\begin{bmatrix}a & b \\\\\\\\ c & d \\\\end{bmatrix}' },\n { latex: '\\\\begin{cases}a & x = 0 \\\\\\\\ b & x > 0\\\\end{cases}' },\n { latex: '\\\\hat{a}' },\n { latex: '\\\\breve{a}' },\n { latex: '\\\\acute{a}' },\n { latex: '\\\\grave{a}' },\n { latex: '\\\\tilde{a}' },\n { latex: '\\\\bar{a}' },\n { latex: '\\\\vec{a}' },\n { latex: '\\\\underline{a}' },\n { latex: '\\\\overline{a}' },\n { latex: '\\\\widehat{ab}' },\n { latex: '\\\\overleftarrow{ab}' },\n { latex: '\\\\overrightarrow{ab}' },\n ],\n },\n {\n type: 'verbatim',\n label: '函数',\n children: [\n { latex: '\\\\log' },\n { latex: '\\\\ln' },\n { latex: '\\\\exp' },\n { latex: '\\\\mod' },\n { latex: '\\\\lim' },\n { latex: '\\\\sin' },\n { latex: '\\\\cos' },\n { latex: '\\\\tan' },\n { latex: '\\\\csc' },\n { latex: '\\\\sec' },\n { latex: '\\\\cot' },\n { latex: '\\\\sinh' },\n { latex: '\\\\cosh' },\n { latex: '\\\\tanh' },\n { latex: '\\\\csch' },\n { latex: '\\\\sech' },\n { latex: '\\\\coth' },\n { latex: '\\\\arcsin' },\n { latex: '\\\\arccos' },\n { latex: '\\\\arctan' },\n { latex: '\\\\arccsc' },\n { latex: '\\\\arcsec' },\n { latex: '\\\\arccot' },\n ],\n },\n {\n type: 'greek',\n label: '希腊字母',\n children: [\n { latex: '\\\\alpha' },\n { latex: '\\\\beta' },\n { latex: '\\\\gamma' },\n { latex: '\\\\delta' },\n { latex: '\\\\varepsilon' },\n { latex: '\\\\zeta' },\n { latex: '\\\\eta' },\n { latex: '\\\\vartheta' },\n { latex: '\\\\iota' },\n { latex: '\\\\kappa' },\n { latex: '\\\\lambda' },\n { latex: '\\\\mu' },\n { latex: '\\\\nu' },\n { latex: '\\\\xi' },\n { latex: '\\\\omicron' },\n { latex: '\\\\pi' },\n { latex: '\\\\rho' },\n { latex: '\\\\sigma' },\n { latex: '\\\\tau' },\n { latex: '\\\\upsilon' },\n { latex: '\\\\varphi' },\n { latex: '\\\\chi' },\n { latex: '\\\\psi' },\n { latex: '\\\\omega' },\n { latex: '\\\\epsilon' },\n { latex: '\\\\theta' },\n { latex: '\\\\phi' },\n { latex: '\\\\varsigma' },\n { latex: '\\\\Alpha' },\n { latex: '\\\\Beta' },\n { latex: '\\\\Gamma' },\n { latex: '\\\\Delta' },\n { latex: '\\\\Epsilon' },\n { latex: '\\\\Zeta' },\n { latex: '\\\\Eta' },\n { latex: '\\\\Theta' },\n { latex: '\\\\Iota' },\n { latex: '\\\\Kappa' },\n { latex: '\\\\Lambda' },\n { latex: '\\\\Mu' },\n { latex: '\\\\Nu' },\n { latex: '\\\\Xi' },\n { latex: '\\\\Omicron' },\n { latex: '\\\\Pi' },\n { latex: '\\\\Rho' },\n { latex: '\\\\Sigma' },\n { latex: '\\\\Tau' },\n { latex: '\\\\Upsilon' },\n { latex: '\\\\Phi' },\n { latex: '\\\\Chi' },\n { latex: '\\\\Psi' },\n { latex: '\\\\Omega' },\n ],\n },\n]","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1c41d9fe\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"width\", \"height\"]\nconst _hoisted_2 = [\"transform\"]\nconst _hoisted_3 = [\"d\"]\n\nimport { computed, ref, watch } from 'vue'\nimport { hfmath } from './hfmath'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'FormulaContent',\n props: {\n latex: {\n type: String,\n required: true,\n },\n width: {\n type: Number,\n required: true,\n },\n height: {\n type: Number,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst box = ref({ x: 0, y: 0, w: 0, h: 0 })\nconst pathd = ref('')\n\nwatch(() => props.latex, () => {\n const eq = new hfmath(props.latex)\n pathd.value = eq.pathd({})\n box.value = eq.box({})\n}, { immediate: true })\n\nconst scale = computed(() => {\n const boxW = box.value.w + 32\n const boxH = box.value.h + 32\n\n if (boxW > props.width || boxH > props.height) {\n if (boxW / boxH > props.width / props.height) return props.width / boxW\n return props.height / boxH\n }\n return 1\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"svg\", {\n class: \"formula-content\",\n overflow: \"visible\",\n width: box.value.w + 32,\n height: box.value.h + 32,\n stroke: \"#000\",\n \"stroke-width\": \"1\",\n fill: \"none\",\n \"stroke-linecap\": \"round\",\n \"stroke-linejoin\": \"round\"\n }, [\n _createElementVNode(\"g\", {\n transform: `scale(${_unref(scale)}, ${_unref(scale)}) translate(0,0) matrix(1,0,0,1,0,0)`,\n \"transform-origin\": \"0 50%\"\n }, [\n _createElementVNode(\"path\", { d: pathd.value }, null, 8, _hoisted_3)\n ], 8, _hoisted_2)\n ], 8, _hoisted_1))\n}\n}\n\n})","import script from \"./FormulaContent.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./FormulaContent.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./FormulaContent.vue?vue&type=style&index=0&id=1c41d9fe&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1c41d9fe\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = [\"innerHTML\"]\n\nimport { computed } from 'vue'\nimport { hfmath } from './hfmath'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SymbolContent',\n props: {\n latex: {\n type: String,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst svg = computed(() => {\n const eq = new hfmath(props.latex)\n return eq.svg({\n SCALE_X: 10,\n SCALE_Y: 10,\n })\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"symbol-content\",\n innerHTML: _unref(svg)\n }, null, 8, _hoisted_1))\n}\n}\n\n})","import script from \"./SymbolContent.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SymbolContent.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, unref as _unref, createTextVNode as _createTextVNode, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-2d73bf28\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"latex-editor\" }\nconst _hoisted_2 = { class: \"container\" }\nconst _hoisted_3 = { class: \"left\" }\nconst _hoisted_4 = { class: \"input-area\" }\nconst _hoisted_5 = { class: \"preview\" }\nconst _hoisted_6 = {\n key: 0,\n class: \"placeholder\"\n}\nconst _hoisted_7 = {\n key: 1,\n class: \"preview-content\"\n}\nconst _hoisted_8 = { class: \"right\" }\nconst _hoisted_9 = { class: \"tabs\" }\nconst _hoisted_10 = [\"onClick\"]\nconst _hoisted_11 = { class: \"content\" }\nconst _hoisted_12 = {\n key: 0,\n class: \"symbol\"\n}\nconst _hoisted_13 = { class: \"symbol-tabs\" }\nconst _hoisted_14 = [\"onClick\"]\nconst _hoisted_15 = { class: \"symbol-pool\" }\nconst _hoisted_16 = [\"onClick\"]\nconst _hoisted_17 = {\n key: 1,\n class: \"formula\"\n}\nconst _hoisted_18 = { class: \"formula-title\" }\nconst _hoisted_19 = [\"onClick\"]\nconst _hoisted_20 = { class: \"footer\" }\nconst _hoisted_21 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_22 = /*#__PURE__*/_createTextVNode(\"确定\")\n\nimport { computed, onMounted, ref } from 'vue'\nimport { hfmath } from './hfmath'\nimport { FORMULA_LIST, SYMBOL_LIST } from '@/configs/latex'\n\nimport FormulaContent from './FormulaContent.vue'\nimport SymbolContent from './SymbolContent.vue'\n\nimport { message } from 'ant-design-vue'\n\ninterface Tab {\n label: string\n value: 'symbol' | 'formula'\n}\n\ninterface LatexResult {\n latex: string\n path: string\n w: number\n h: number\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n value: {\n type: String,\n default: '',\n },\n},\n emits: [\"update\", \"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'update', payload: LatexResult): void\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\nconst tabs: Tab[] = [\n { label: '常用符号', value: 'symbol' },\n { label: '预置公式', value: 'formula' },\n]\n\n\n\n\n\nconst formulaList = FORMULA_LIST\nconst symbolList = SYMBOL_LIST\n\nconst latex = ref('')\nconst toolbarState = ref<'symbol' | 'formula'>('symbol')\nconst textAreaRef = ref()\n\nconst selectedSymbolKey = ref(SYMBOL_LIST[0].type)\nconst symbolPool = computed(() => {\n const selectedSymbol = SYMBOL_LIST.find(item => item.type === selectedSymbolKey.value)\n return selectedSymbol?.children || []\n})\n\nonMounted(() => {\n if (props.value) latex.value = props.value\n})\n\nconst update = () => {\n if (!latex.value) return message.error('公式不能为空')\n\n const eq = new hfmath(latex.value)\n const pathd = eq.pathd({})\n const box = eq.box({})\n \n emit('update', {\n latex: latex.value,\n path: pathd,\n w: box.w + 32,\n h: box.h + 32,\n })\n}\n\nconst insertSymbol = (latex: string) => {\n if (!textAreaRef.value) return\n textAreaRef.value.focus()\n document.execCommand('insertText', false, latex)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_TextArea = _resolveComponent(\"TextArea\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_TextArea, {\n value: latex.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((latex).value = $event)),\n placeholder: \"输入 LaTeX 公式\",\n ref_key: \"textAreaRef\",\n ref: textAreaRef\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n (!latex.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_6, \"公式预览\"))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_7, [\n _createVNode(FormulaContent, {\n width: 518,\n height: 138,\n latex: latex.value\n }, null, 8, [\"latex\"])\n ]))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _createElementVNode(\"div\", _hoisted_9, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (tab) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': tab.value === toolbarState.value }]),\n key: tab.value,\n onClick: ($event: any) => (toolbarState.value = tab.value)\n }, _toDisplayString(tab.label), 11, _hoisted_10)\n }), 64))\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n (toolbarState.value === 'symbol')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_12, [\n _createElementVNode(\"div\", _hoisted_13, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(symbolList), (group) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"symbol-tab\", { 'active': selectedSymbolKey.value === group.type }]),\n key: group.type,\n onClick: ($event: any) => (selectedSymbolKey.value = group.type)\n }, _toDisplayString(group.label), 11, _hoisted_14))\n }), 128))\n ]),\n _createElementVNode(\"div\", _hoisted_15, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(symbolPool), (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"symbol-item\",\n key: item.latex,\n onClick: ($event: any) => (insertSymbol(item.latex))\n }, [\n _createVNode(SymbolContent, {\n latex: item.latex\n }, null, 8, [\"latex\"])\n ], 8, _hoisted_16))\n }), 128))\n ])\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_17, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(formulaList), (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"formula-item\",\n key: item.label\n }, [\n _createElementVNode(\"div\", _hoisted_18, _toDisplayString(item.label), 1),\n _createElementVNode(\"div\", {\n class: \"formula-item-content\",\n onClick: ($event: any) => (latex.value =item.latex)\n }, [\n _createVNode(FormulaContent, {\n width: 236,\n height: 60,\n latex: item.latex\n }, null, 8, [\"latex\"])\n ], 8, _hoisted_19)\n ]))\n }), 128))\n ]))\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_20, [\n _createVNode(_component_Button, {\n class: \"btn\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_21\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn\",\n type: \"primary\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (update()))\n }, {\n default: _withCtx(() => [\n _hoisted_22\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=2d73bf28&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-2d73bf28\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, createVNode as _createVNode, withCtx as _withCtx, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5d4eff54\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"canvas-tool\" }\nconst _hoisted_2 = { class: \"left-handler\" }\nconst _hoisted_3 = { class: \"add-element-handler\" }\nconst _hoisted_4 = { class: \"right-handler\" }\nconst _hoisted_5 = { class: \"viewport-size-preset\" }\nconst _hoisted_6 = [\"onClick\"]\nconst _hoisted_7 = { class: \"text\" }\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSnapshotStore } from '@/store'\nimport { getImageDataURL } from '@/utils/image'\nimport { ShapePoolItem } from '@/configs/shapes'\nimport { LinePoolItem } from '@/configs/lines'\nimport useScaleCanvas from '@/hooks/useScaleCanvas'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport useCreateElement from '@/hooks/useCreateElement'\n\nimport ShapePool from './ShapePool.vue'\nimport LinePool from './LinePool.vue'\nimport ChartPool from './ChartPool.vue'\nimport TableGenerator from './TableGenerator.vue'\nimport MediaInput from './MediaInput.vue'\nimport LaTeXEditor from '@/components/LaTeXEditor/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst { creatingElement } = storeToRefs(mainStore)\nconst { canUndo, canRedo } = storeToRefs(useSnapshotStore())\n\nconst { redo, undo } = useHistorySnapshot()\n\nconst {\n scaleCanvas,\n setCanvasScalePercentage,\n resetCanvas,\n canvasScalePercentage,\n} = useScaleCanvas()\n\nconst canvasScalePresetList = [200, 150, 100, 80, 50]\nconst canvasScaleVisible = ref(false)\n\nconst applyCanvasPresetScale = (value: number) => {\n setCanvasScalePercentage(value)\n canvasScaleVisible.value = false\n}\n\nconst {\n createImageElement,\n createChartElement,\n createTableElement,\n createLatexElement,\n createVideoElement,\n createAudioElement,\n} = useCreateElement()\n\nconst insertImageElement = (files: FileList) => {\n const imageFile = files[0]\n if (!imageFile) return\n getImageDataURL(imageFile).then(dataURL => createImageElement(dataURL))\n}\n\nconst shapePoolVisible = ref(false)\nconst linePoolVisible = ref(false)\nconst chartPoolVisible = ref(false)\nconst tableGeneratorVisible = ref(false)\nconst mediaInputVisible = ref(false)\nconst latexEditorVisible = ref(false)\n\n// 绘制文字范围\nconst drawText = () => {\n mainStore.setCreatingElement({\n type: 'text',\n })\n}\n\n// 绘制形状范围\nconst drawShape = (shape: ShapePoolItem) => {\n mainStore.setCreatingElement({\n type: 'shape',\n data: shape,\n })\n shapePoolVisible.value = false\n}\n\n// 绘制线条路径\nconst drawLine = (line: LinePoolItem) => {\n mainStore.setCreatingElement({\n type: 'line',\n data: line,\n })\n linePoolVisible.value = false\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconBack = _resolveComponent(\"IconBack\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconNext = _resolveComponent(\"IconNext\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_IconPicture = _resolveComponent(\"IconPicture\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_IconGraphicDesign = _resolveComponent(\"IconGraphicDesign\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconConnection = _resolveComponent(\"IconConnection\")!\n const _component_IconChartProportion = _resolveComponent(\"IconChartProportion\")!\n const _component_IconInsertTable = _resolveComponent(\"IconInsertTable\")!\n const _component_IconFormula = _resolveComponent(\"IconFormula\")!\n const _component_IconVideoTwo = _resolveComponent(\"IconVideoTwo\")!\n const _component_IconMinus = _resolveComponent(\"IconMinus\")!\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_IconFullScreen = _resolveComponent(\"IconFullScreen\")!\n const _component_Modal = _resolveComponent(\"Modal\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"撤销\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconBack, {\n class: _normalizeClass([\"handler-item\", { 'disable': !_unref(canUndo) }]),\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_unref(undo)()))\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"重做\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconNext, {\n class: _normalizeClass([\"handler-item\", { 'disable': !_unref(canRedo) }]),\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_unref(redo)()))\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入文字\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize, {\n class: _normalizeClass([\"handler-item\", { 'active': _unref(creatingElement)?.type === 'text' }]),\n onClick: _cache[2] || (_cache[2] = ($event: any) => (drawText()))\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_FileInput, {\n onChange: _cache[3] || (_cache[3] = files => insertImageElement(files))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入图片\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPicture, { class: \"handler-item\" })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: shapePoolVisible.value,\n \"onUpdate:visible\": _cache[5] || (_cache[5] = ($event: any) => ((shapePoolVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(ShapePool, {\n onSelect: _cache[4] || (_cache[4] = shape => drawShape(shape))\n })\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入形状\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconGraphicDesign, {\n class: _normalizeClass([\"handler-item\", { 'active': _unref(creatingElement)?.type === 'shape' }])\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: linePoolVisible.value,\n \"onUpdate:visible\": _cache[7] || (_cache[7] = ($event: any) => ((linePoolVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(LinePool, {\n onSelect: _cache[6] || (_cache[6] = line => drawLine(line))\n })\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入线条\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconConnection, {\n class: _normalizeClass([\"handler-item\", { 'active': _unref(creatingElement)?.type === 'line' }])\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: chartPoolVisible.value,\n \"onUpdate:visible\": _cache[9] || (_cache[9] = ($event: any) => ((chartPoolVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(ChartPool, {\n onSelect: _cache[8] || (_cache[8] = chart => { _unref(createChartElement)(chart); chartPoolVisible.value = false })\n })\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入图表\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconChartProportion, { class: \"handler-item\" })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: tableGeneratorVisible.value,\n \"onUpdate:visible\": _cache[12] || (_cache[12] = ($event: any) => ((tableGeneratorVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(TableGenerator, {\n onClose: _cache[10] || (_cache[10] = ($event: any) => (tableGeneratorVisible.value = false)),\n onInsert: _cache[11] || (_cache[11] = ({ row, col }) => { _unref(createTableElement)(row, col); tableGeneratorVisible.value = false })\n })\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入表格\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconInsertTable, { class: \"handler-item\" })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入公式\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFormula, {\n class: \"handler-item\",\n onClick: _cache[13] || (_cache[13] = ($event: any) => (latexEditorVisible.value = true))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: mediaInputVisible.value,\n \"onUpdate:visible\": _cache[17] || (_cache[17] = ($event: any) => ((mediaInputVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(MediaInput, {\n onClose: _cache[14] || (_cache[14] = ($event: any) => (mediaInputVisible.value = false)),\n onInsertVideo: _cache[15] || (_cache[15] = src => { _unref(createVideoElement)(src); mediaInputVisible.value = false }),\n onInsertAudio: _cache[16] || (_cache[16] = src => { _unref(createAudioElement)(src); mediaInputVisible.value = false })\n })\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"插入音视频\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconVideoTwo, { class: \"handler-item\" })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_IconMinus, {\n class: \"handler-item viewport-size\",\n onClick: _cache[18] || (_cache[18] = ($event: any) => (_unref(scaleCanvas)('-')))\n }),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: canvasScaleVisible.value,\n \"onUpdate:visible\": _cache[19] || (_cache[19] = ($event: any) => ((canvasScaleVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_5, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(canvasScalePresetList, (item) => {\n return _createElementVNode(\"div\", {\n class: \"preset-item\",\n key: item,\n onClick: ($event: any) => (applyCanvasPresetScale(item))\n }, _toDisplayString(item) + \"%\", 9, _hoisted_6)\n }), 64))\n ])\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"span\", _hoisted_7, _toDisplayString(_unref(canvasScalePercentage)), 1)\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_IconPlus, {\n class: \"handler-item viewport-size\",\n onClick: _cache[20] || (_cache[20] = ($event: any) => (_unref(scaleCanvas)('+')))\n }),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"适应屏幕\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFullScreen, {\n class: \"handler-item viewport-size-adaptation\",\n onClick: _cache[21] || (_cache[21] = ($event: any) => (_unref(resetCanvas)()))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _createVNode(_component_Modal, {\n visible: latexEditorVisible.value,\n \"onUpdate:visible\": _cache[24] || (_cache[24] = ($event: any) => ((latexEditorVisible).value = $event)),\n footer: null,\n centered: \"\",\n width: 880,\n destroyOnClose: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(LaTeXEditor, {\n onClose: _cache[22] || (_cache[22] = ($event: any) => (latexEditorVisible.value = false)),\n onUpdate: _cache[23] || (_cache[23] = data => { _unref(createLatexElement)(data); latexEditorVisible.value = false })\n })\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=5d4eff54&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5d4eff54\"]])\n\nexport default __exports__","import { ref, onMounted, onUnmounted } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\n\nexport default () => {\n const { slides } = storeToRefs(useSlidesStore())\n\n const timer = ref(null)\n const slidesLoadLimit = ref(50)\n\n const loadSlide = () => {\n if (slides.value.length > slidesLoadLimit.value) {\n timer.value = setTimeout(() => {\n slidesLoadLimit.value = slidesLoadLimit.value + 20\n loadSlide()\n }, 600)\n }\n else slidesLoadLimit.value = 9999\n }\n\n onMounted(loadSlide)\n\n onUnmounted(() => {\n if (timer.value) clearTimeout(timer.value)\n })\n\n return {\n slidesLoadLimit,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-cc6b7dca\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"layout-pool\" }\nconst _hoisted_2 = [\"onClick\"]\n\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { Slide } from '@/types/slides'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LayoutPool',\n emits: [\"select\"],\n setup(__props, { emit }: { emit: ({\n (event: 'select', payload: Slide): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { layouts } = storeToRefs(useSlidesStore())\n\nconst selectSlideTemplate = (slide: Slide) => {\n emit('select', slide)\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(layouts), (slide) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"layout-item\",\n key: slide.id,\n onClick: ($event: any) => (selectSlideTemplate(slide))\n }, [\n _createVNode(ThumbnailSlide, {\n class: \"thumbnail\",\n slide: slide,\n size: 180\n }, null, 8, [\"slide\"])\n ], 8, _hoisted_2))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./LayoutPool.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LayoutPool.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LayoutPool.vue?vue&type=style&index=0&id=cc6b7dca&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-cc6b7dca\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, unref as _unref, createElementVNode as _createElementVNode, withCtx as _withCtx, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, resolveDirective as _resolveDirective, openBlock as _openBlock, createElementBlock as _createElementBlock, withDirectives as _withDirectives, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-153c0b44\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"add-slide\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\"添加幻灯片\")\nconst _hoisted_3 = { class: \"select-btn\" }\nconst _hoisted_4 = [\"onMousedown\"]\n\nimport { computed, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore, useKeyboardStore } from '@/store'\nimport { fillDigit } from '@/utils/common'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport useSlideHandler from '@/hooks/useSlideHandler'\nimport useScreening from '@/hooks/useScreening'\nimport useLoadSlides from '@/hooks/useLoadSlides'\n\nimport Draggable from 'vuedraggable'\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\nimport LayoutPool from './LayoutPool.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst keyboardStore = useKeyboardStore()\nconst { selectedSlidesIndex: _selectedSlidesIndex, thumbnailsFocus } = storeToRefs(mainStore)\nconst { slides, slideIndex } = storeToRefs(slidesStore)\nconst { ctrlKeyState, shiftKeyState } = storeToRefs(keyboardStore)\n\nconst { slidesLoadLimit } = useLoadSlides()\n\nconst selectedSlidesIndex = computed(() => [..._selectedSlidesIndex.value, slideIndex.value])\n\nconst presetLayoutPopoverVisible = ref(false)\n\nconst {\n copySlide,\n pasteSlide,\n createSlide,\n createSlideByTemplate,\n copyAndPasteSlide,\n deleteSlide,\n cutSlide,\n selectAllSlide,\n} = useSlideHandler()\n\n// 切换页面\nconst changSlideIndex = (index: number) => {\n mainStore.setActiveElementIdList([])\n\n if (slideIndex.value === index) return\n slidesStore.updateSlideIndex(index)\n}\n\n// 点击缩略图\nconst handleClickSlideThumbnail = (e: MouseEvent, index: number) => {\n const isMultiSelected = selectedSlidesIndex.value.length > 1\n\n if (isMultiSelected && selectedSlidesIndex.value.includes(index) && e.button !== 0) return\n\n // 按住Ctrl键,点选幻灯片,再次点击已选中的页面则取消选中\n if (ctrlKeyState.value) {\n if (slideIndex.value === index) {\n if (!isMultiSelected) return\n\n const newSelectedSlidesIndex = selectedSlidesIndex.value.filter(item => item !== index)\n mainStore.updateSelectedSlidesIndex(newSelectedSlidesIndex)\n changSlideIndex(selectedSlidesIndex.value[0])\n }\n else {\n if (selectedSlidesIndex.value.includes(index)) {\n const newSelectedSlidesIndex = selectedSlidesIndex.value.filter(item => item !== index)\n mainStore.updateSelectedSlidesIndex(newSelectedSlidesIndex)\n }\n else {\n const newSelectedSlidesIndex = [...selectedSlidesIndex.value, index]\n mainStore.updateSelectedSlidesIndex(newSelectedSlidesIndex)\n changSlideIndex(index)\n }\n }\n }\n // 按住Shift键,选择范围内的全部幻灯片\n else if (shiftKeyState.value) {\n if (slideIndex.value === index && !isMultiSelected) return\n\n let minIndex = Math.min(...selectedSlidesIndex.value)\n let maxIndex = index\n\n if (index < minIndex) {\n maxIndex = Math.max(...selectedSlidesIndex.value)\n minIndex = index\n }\n\n const newSelectedSlidesIndex = []\n for (let i = minIndex; i <= maxIndex; i++) newSelectedSlidesIndex.push(i)\n mainStore.updateSelectedSlidesIndex(newSelectedSlidesIndex)\n changSlideIndex(index)\n }\n // 正常切换页面\n else {\n mainStore.updateSelectedSlidesIndex([])\n changSlideIndex(index)\n }\n}\n\n// 设置缩略图工具栏聚焦状态(只有聚焦状态下,该部分的快捷键才能生效)\nconst setThumbnailsFocus = (focus: boolean) => {\n if (thumbnailsFocus.value === focus) return\n mainStore.setThumbnailsFocus(focus)\n\n if (!focus) mainStore.updateSelectedSlidesIndex([])\n}\n\n// 拖拽调整顺序后进行数据的同步\nconst handleDragEnd = (eventData: { newIndex: number; oldIndex: number }) => {\n const { newIndex, oldIndex } = eventData\n if (oldIndex === newIndex) return\n\n const _slides = JSON.parse(JSON.stringify(slides.value))\n const _slide = _slides[oldIndex]\n _slides.splice(oldIndex, 1)\n _slides.splice(newIndex, 0, _slide)\n slidesStore.setSlides(_slides)\n slidesStore.updateSlideIndex(newIndex)\n}\n\nconst { enterScreening, enterScreeningFromStart } = useScreening()\n\nconst contextmenusThumbnails = (): ContextmenuItem[] => {\n return [\n {\n text: '粘贴',\n subText: 'Ctrl + V',\n handler: pasteSlide,\n },\n {\n text: '全选',\n subText: 'Ctrl + A',\n handler: selectAllSlide,\n },\n {\n text: '新建页面',\n subText: 'Enter',\n handler: createSlide,\n },\n {\n text: '幻灯片放映',\n subText: 'F5',\n handler: enterScreeningFromStart,\n },\n ]\n}\n\nconst contextmenusThumbnailItem = (): ContextmenuItem[] => {\n return [\n {\n text: '剪切',\n subText: 'Ctrl + X',\n handler: cutSlide,\n },\n {\n text: '复制',\n subText: 'Ctrl + C',\n handler: copySlide,\n },\n {\n text: '粘贴',\n subText: 'Ctrl + V',\n handler: pasteSlide,\n },\n {\n text: '全选',\n subText: 'Ctrl + A',\n handler: selectAllSlide,\n },\n { divider: true },\n {\n text: '新建页面',\n subText: 'Enter',\n handler: createSlide,\n },\n {\n text: '复制页面',\n subText: 'Ctrl + D',\n handler: copyAndPasteSlide,\n },\n {\n text: '删除页面',\n subText: 'Delete',\n handler: () => deleteSlide(),\n },\n { divider: true },\n {\n text: '从当前放映',\n subText: 'Shift + F5',\n handler: enterScreening,\n },\n ]\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_IconDown = _resolveComponent(\"IconDown\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n const _directive_click_outside = _resolveDirective(\"click-outside\")!\n\n return _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: \"thumbnails\",\n onMousedown: _cache[3] || (_cache[3] = () => setThumbnailsFocus(true))\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"btn\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_unref(createSlide)()))\n }, [\n _createVNode(_component_IconPlus, { class: \"icon\" }),\n _hoisted_2\n ]),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n placement: \"bottomLeft\",\n visible: presetLayoutPopoverVisible.value,\n \"onUpdate:visible\": _cache[2] || (_cache[2] = ($event: any) => ((presetLayoutPopoverVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createVNode(LayoutPool, {\n onSelect: _cache[1] || (_cache[1] = slide => { _unref(createSlideByTemplate)(slide); presetLayoutPopoverVisible.value = false })\n })\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_IconDown)\n ])\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]),\n _createVNode(_unref(Draggable), {\n class: \"thumbnail-list\",\n modelValue: _unref(slides),\n animation: 300,\n scroll: true,\n scrollSensitivity: 50,\n setData: null,\n onEnd: handleDragEnd,\n itemKey: \"id\"\n }, {\n item: _withCtx(({ element, index }) => [\n _withDirectives((_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"thumbnail-item\", {\n 'active': _unref(slideIndex) === index,\n 'selected': _unref(selectedSlidesIndex).includes(index),\n }]),\n onMousedown: $event => handleClickSlideThumbnail($event, index)\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"label\", { 'offset-left': index >= 99 }])\n }, _toDisplayString(_unref(fillDigit)(index + 1, 2)), 3),\n _createVNode(ThumbnailSlide, {\n class: \"thumbnail\",\n slide: element,\n size: 120,\n visible: index < _unref(slidesLoadLimit)\n }, null, 8, [\"slide\", \"visible\"])\n ], 42, _hoisted_4)), [\n [_directive_contextmenu, contextmenusThumbnailItem]\n ])\n ]),\n _: 1\n }, 8, [\"modelValue\"])\n ], 32)), [\n [_directive_click_outside, () => setThumbnailsFocus(false)],\n [_directive_contextmenu, contextmenusThumbnails]\n ])\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=153c0b44&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-153c0b44\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-22345a51\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-opacity\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"不透明度:\", -1))\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementOpacity',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst opacity = ref(1)\n\nwatch(handleElement, () => {\n if (!handleElement.value) return\n opacity.value = 'opacity' in handleElement.value && handleElement.value.opacity !== undefined ? handleElement.value.opacity : 1\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateOpacity = (value: number) => {\n if (!handleElement.value) return\n const props = { opacity: value }\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Slider = _resolveComponent(\"Slider\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: 0,\n max: 1,\n step: 0.1,\n value: opacity.value,\n onChange: _cache[0] || (_cache[0] = value => updateOpacity(value as number))\n }, null, 8, [\"step\", \"value\"])\n ])\n ]))\n}\n}\n\n})","import script from \"./ElementOpacity.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementOpacity.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementOpacity.vue?vue&type=style&index=0&id=22345a51&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-22345a51\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-ed8f2044\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"color-block\" }\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ColorButton',\n props: {\n color: {\n type: String,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlatte = _resolveComponent(\"IconPlatte\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createBlock(_component_Button, { class: \"color-btn\" }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"content\",\n style: _normalizeStyle({ backgroundColor: __props.color })\n }, null, 4)\n ]),\n _createVNode(_component_IconPlatte, { class: \"color-btn-icon\" })\n ]),\n _: 1\n }))\n}\n}\n\n})","import script from \"./ColorButton.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ColorButton.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ColorButton.vue?vue&type=style&index=0&id=ed8f2044&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-ed8f2044\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-e91e3764\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-outline\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"启用边框:\", -1))\nconst _hoisted_4 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_5 = { class: \"row\" }\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框样式:\", -1))\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"实线边框\")\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"虚线边框\")\nconst _hoisted_9 = { class: \"row\" }\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框颜色:\", -1))\nconst _hoisted_11 = { class: \"row\" }\nconst _hoisted_12 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框粗细:\", -1))\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElementOutline } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from './ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementOutline',\n props: {\n fixed: {\n type: Boolean,\n default: false,\n },\n},\n setup(__props) {\n\n\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst outline = ref()\nconst hasOutline = ref(false)\n\nwatch(handleElement, () => {\n if (!handleElement.value) return\n outline.value = 'outline' in handleElement.value ? handleElement.value.outline : undefined\n hasOutline.value = !!outline.value\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateOutline = (outlineProps: Partial) => {\n if (!handleElement.value) return\n const props = { outline: { ...outline.value, ...outlineProps } }\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\nconst toggleOutline = (checked: boolean) => {\n if (!handleElement.value) return\n if (checked) {\n const _outline: PPTElementOutline = { width: 2, color: '#000', style: 'solid' }\n slidesStore.updateElement({ id: handleElement.value.id, props: { outline: _outline } })\n }\n else {\n slidesStore.removeElementProps({ id: handleElement.value.id, propName: 'outline' })\n }\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (!__props.fixed)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _hoisted_3,\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_Switch, {\n checked: hasOutline.value,\n onChange: _cache[0] || (_cache[0] = checked => toggleOutline(checked as boolean))\n }, null, 8, [\"checked\"])\n ])\n ]))\n : _createCommentVNode(\"\", true),\n (hasOutline.value && outline.value)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n _createElementVNode(\"div\", _hoisted_5, [\n _hoisted_6,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: outline.value.style,\n onChange: _cache[1] || (_cache[1] = value => updateOutline({ style: value as 'dashed' | 'solid' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"solid\" }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"dashed\" }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _hoisted_10,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: outline.value.color,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = value => updateOutline({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: outline.value.color || '#000',\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n _hoisted_12,\n _createVNode(_component_InputNumber, {\n value: outline.value.width,\n onChange: _cache[3] || (_cache[3] = value => updateOutline({ width: value as number })),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ElementOutline.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementOutline.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementOutline.vue?vue&type=style&index=0&id=e91e3764&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-e91e3764\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-053ed706\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-shadow\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"启用阴影:\", -1))\nconst _hoisted_4 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_5 = { class: \"row\" }\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"水平阴影:\", -1))\nconst _hoisted_7 = { class: \"row\" }\nconst _hoisted_8 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"垂直阴影:\", -1))\nconst _hoisted_9 = { class: \"row\" }\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"模糊距离:\", -1))\nconst _hoisted_11 = { class: \"row\" }\nconst _hoisted_12 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"阴影颜色:\", -1))\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElementShadow } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from './ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementShadow',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst shadow = ref()\nconst hasShadow = ref(false)\n\nwatch(handleElement, () => {\n if (!handleElement.value) return\n shadow.value = 'shadow' in handleElement.value ? handleElement.value.shadow : undefined\n hasShadow.value = !!shadow.value\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateShadow = (shadowProps: Partial) => {\n if (!handleElement.value || !shadow.value) return\n const _shadow = { ...shadow.value, ...shadowProps }\n slidesStore.updateElement({ id: handleElement.value.id, props: { shadow: _shadow } })\n addHistorySnapshot()\n}\n\nconst toggleShadow = (checked: boolean) => {\n if (!handleElement.value) return\n if (checked) {\n const _shadow: PPTElementShadow = { h: 1, v: 1, blur: 2, color: '#000' }\n slidesStore.updateElement({ id: handleElement.value.id, props: { shadow: _shadow } })\n }\n else {\n slidesStore.removeElementProps({ id: handleElement.value.id, propName: 'shadow' })\n }\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_Switch, {\n checked: hasShadow.value,\n onChange: _cache[0] || (_cache[0] = checked => toggleShadow(checked as boolean))\n }, null, 8, [\"checked\"])\n ])\n ]),\n (hasShadow.value && shadow.value)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_5, [\n _hoisted_6,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: -10,\n max: 10,\n step: 1,\n value: shadow.value.h,\n onChange: _cache[1] || (_cache[1] = value => updateShadow({ h: value as number }))\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _hoisted_8,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: -10,\n max: 10,\n step: 1,\n value: shadow.value.v,\n onChange: _cache[2] || (_cache[2] = value => updateShadow({ v: value as number }))\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _hoisted_10,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: 1,\n max: 20,\n step: 1,\n value: shadow.value.blur,\n onChange: _cache[3] || (_cache[3] = value => updateShadow({ blur: value as number }))\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n _hoisted_12,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: shadow.value.color,\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = value => updateShadow({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: shadow.value.color,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ElementShadow.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementShadow.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementShadow.vue?vue&type=style&index=0&id=053ed706&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-053ed706\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, unref as _unref, withCtx as _withCtx, createBlock as _createBlock, createTextVNode as _createTextVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5830b9cf\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"text-style-panel\" }\nconst _hoisted_2 = { class: \"preset-style\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"+\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"-\")\nconst _hoisted_6 = { class: \"link-popover\" }\nconst _hoisted_7 = { class: \"btns\" }\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"移除\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"确认\")\nconst _hoisted_10 = { class: \"row\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"行间距:\", -1))\nconst _hoisted_12 = { class: \"row\" }\nconst _hoisted_13 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"段间距:\", -1))\nconst _hoisted_14 = { class: \"row\" }\nconst _hoisted_15 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"字间距:\", -1))\nconst _hoisted_16 = { class: \"row\" }\nconst _hoisted_17 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"首行缩进:\", -1))\nconst _hoisted_18 = { class: \"row\" }\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"文本框填充:\", -1))\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTTextElement } from '@/types/slides'\nimport emitter, { EmitterEvents, RichTextAction } from '@/utils/emitter'\nimport { WEB_FONTS } from '@/configs/font'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\nimport { message } from 'ant-design-vue'\n\nimport ElementOpacity from '../common/ElementOpacity.vue'\nimport ElementOutline from '../common/ElementOutline.vue'\nimport ElementShadow from '../common/ElementShadow.vue'\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'TextStylePanel',\n setup(__props) {\n\nconst presetStyles = [\n {\n label: '大标题',\n style: {\n fontSize: '26px',\n fontWeight: 700,\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '48px' },\n { command: 'align', value: 'center' },\n { command: 'bold' },\n ],\n },\n {\n label: '小标题',\n style: {\n fontSize: '22px',\n fontWeight: 700,\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '36px' },\n { command: 'align', value: 'center' },\n { command: 'bold' },\n ],\n },\n {\n label: '正文',\n style: {\n fontSize: '20px',\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '20px' },\n ],\n },\n {\n label: '正文[小]',\n style: {\n fontSize: '18px',\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '18px' },\n ],\n },\n {\n label: '注释 1',\n style: {\n fontSize: '16px',\n fontStyle: 'italic',\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '16px' },\n { command: 'em' },\n ],\n },\n {\n label: '注释 2',\n style: {\n fontSize: '16px',\n textDecoration: 'underline',\n },\n cmd: [\n { command: 'clear' },\n { command: 'fontsize', value: '16px' },\n { command: 'underline' },\n ],\n },\n]\n\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId, richTextAttrs, availableFonts } = storeToRefs(useMainStore())\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateElement = (props: Partial) => {\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\nconst fill = ref('#000')\nconst lineHeight = ref()\nconst wordSpace = ref()\nconst textIndent = ref()\nconst paragraphSpace = ref()\n\nwatch(handleElement, () => {\n if (!handleElement.value || handleElement.value.type !== 'text') return\n\n fill.value = handleElement.value.fill || '#fff'\n lineHeight.value = handleElement.value.lineHeight || 1.5\n wordSpace.value = handleElement.value.wordSpace || 0\n textIndent.value = handleElement.value.textIndent || 0\n paragraphSpace.value = handleElement.value.paragraphSpace === undefined ? 5 : handleElement.value.paragraphSpace\n}, { deep: true, immediate: true })\n\nconst fontSizeOptions = [\n '12px', '14px', '16px', '18px', '20px', '22px', '24px', '28px', '32px',\n '36px', '40px', '44px', '48px', '54px', '60px', '66px', '72px', '76px',\n '80px', '88px', '96px', '104px', '112px', '120px',\n]\nconst lineHeightOptions = [0.9, 1.0, 1.15, 1.2, 1.4, 1.5, 1.8, 2.0, 2.5, 3.0]\nconst wordSpaceOptions = [0, 1, 2, 3, 4, 5, 6, 8, 10]\nconst textIndentOptions = [0, 48, 96, 144, 192, 240, 288, 336]\nconst paragraphSpaceOptions = [0, 5, 10, 15, 20, 25, 30, 40, 50, 80]\n\n// 设置行高\nconst updateLineHeight = (value: number) => {\n updateElement({ lineHeight: value })\n}\n\n// 设置段间距\nconst updateParagraphSpace = (value: number) => {\n updateElement({ paragraphSpace: value })\n}\n\n// 设置字间距\nconst updateWordSpace = (value: number) => {\n updateElement({ wordSpace: value })\n}\n\n// 设置首行缩进\nconst updateTextIndent = (value: number) => {\n updateElement({ textIndent: value })\n}\n\n// 设置文本框填充\nconst updateFill = (value: string) => {\n updateElement({ fill: value })\n}\n\n// 发射富文本设置命令\nconst emitRichTextCommand = (command: string, value?: string) => {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command, value } })\n}\n\n// 发射富文本设置命令(批量)\nconst emitBatchRichTextCommand = (action: RichTextAction[]) => {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action })\n}\n\n// 设置富文本超链接\nconst link = ref('')\nconst linkPopoverVisible = ref(false)\n\nwatch(richTextAttrs, () => linkPopoverVisible.value = false)\n\nconst openLinkPopover = () => {\n link.value = richTextAttrs.value.link\n linkPopoverVisible.value = true\n}\nconst updateLink = (link?: string) => {\n if (link) {\n const linkRegExp = /^(https?):\\/\\/[\\w\\-]+(\\.[\\w\\-]+)+([\\w\\-.,@?^=%&:\\/~+#]*[\\w\\-@?^=%&\\/~+#])?$/\n if (!linkRegExp.test(link)) return message.error('不是正确的网页链接地址')\n }\n emitRichTextCommand('link', link)\n linkPopoverVisible.value = false\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_SelectOptGroup = _resolveComponent(\"SelectOptGroup\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_IconAddText = _resolveComponent(\"IconAddText\")!\n const _component_InputGroup = _resolveComponent(\"InputGroup\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_IconText = _resolveComponent(\"IconText\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconHighLight = _resolveComponent(\"IconHighLight\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconTextBold = _resolveComponent(\"IconTextBold\")!\n const _component_CheckboxButton = _resolveComponent(\"CheckboxButton\")!\n const _component_IconTextItalic = _resolveComponent(\"IconTextItalic\")!\n const _component_IconTextUnderline = _resolveComponent(\"IconTextUnderline\")!\n const _component_IconStrikethrough = _resolveComponent(\"IconStrikethrough\")!\n const _component_IconFormat = _resolveComponent(\"IconFormat\")!\n const _component_CheckboxButtonGroup = _resolveComponent(\"CheckboxButtonGroup\")!\n const _component_IconUpOne = _resolveComponent(\"IconUpOne\")!\n const _component_IconDownOne = _resolveComponent(\"IconDownOne\")!\n const _component_IconCode = _resolveComponent(\"IconCode\")!\n const _component_IconQuote = _resolveComponent(\"IconQuote\")!\n const _component_Input = _resolveComponent(\"Input\")!\n const _component_IconLinkOne = _resolveComponent(\"IconLinkOne\")!\n const _component_IconAlignTextLeft = _resolveComponent(\"IconAlignTextLeft\")!\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_IconAlignTextCenter = _resolveComponent(\"IconAlignTextCenter\")!\n const _component_IconAlignTextRight = _resolveComponent(\"IconAlignTextRight\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_IconList = _resolveComponent(\"IconList\")!\n const _component_IconOrderedList = _resolveComponent(\"IconOrderedList\")!\n const _component_IconIndentLeft = _resolveComponent(\"IconIndentLeft\")!\n const _component_IconIndentRight = _resolveComponent(\"IconIndentRight\")!\n const _component_IconRowHeight = _resolveComponent(\"IconRowHeight\")!\n const _component_IconVerticalSpacingBetweenItems = _resolveComponent(\"IconVerticalSpacingBetweenItems\")!\n const _component_IconFullwidth = _resolveComponent(\"IconFullwidth\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(presetStyles, (item) => {\n return _createElementVNode(\"div\", {\n class: \"preset-style-item\",\n key: item.label,\n style: _normalizeStyle(item.style),\n onClick: ($event: any) => (emitBatchRichTextCommand(item.cmd))\n }, _toDisplayString(item.label), 13, _hoisted_3)\n }), 64))\n ]),\n _createVNode(_component_Divider),\n _createVNode(_component_InputGroup, {\n compact: \"\",\n class: \"row\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(richTextAttrs).fontname,\n onChange: _cache[0] || (_cache[0] = value => emitRichTextCommand('fontname', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconFontSize)\n ]),\n default: _withCtx(() => [\n _createVNode(_component_SelectOptGroup, { label: \"系统字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(availableFonts), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", {\n style: _normalizeStyle({ fontFamily: font.value })\n }, _toDisplayString(font.label), 5)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOptGroup, { label: \"在线字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(WEB_FONTS), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", null, _toDisplayString(font.label), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Select, {\n style: {\"flex\":\"2\"},\n value: _unref(richTextAttrs).fontsize,\n onChange: _cache[1] || (_cache[1] = value => emitRichTextCommand('fontsize', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconAddText)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(fontSizeOptions, (fontsize) => {\n return _createVNode(_component_SelectOption, {\n key: fontsize,\n value: fontsize\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(fontsize), 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).color,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = value => emitRichTextCommand('color', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字颜色\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconText),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).color })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).backcolor,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = value => emitRichTextCommand('backcolor', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字高亮\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconHighLight),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).backcolor })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"增大字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[4] || (_cache[4] = ($event: any) => (emitRichTextCommand('fontsize-add')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_4\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"减小字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[5] || (_cache[5] = ($event: any) => (emitRichTextCommand('fontsize-reduce')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_5\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"加粗\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).bold,\n onClick: _cache[6] || (_cache[6] = ($event: any) => (emitRichTextCommand('bold')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextBold)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"斜体\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).em,\n onClick: _cache[7] || (_cache[7] = ($event: any) => (emitRichTextCommand('em')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextItalic)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下划线\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).underline,\n onClick: _cache[8] || (_cache[8] = ($event: any) => (emitRichTextCommand('underline')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextUnderline)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"删除线\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).strikethrough,\n onClick: _cache[9] || (_cache[9] = ($event: any) => (emitRichTextCommand('strikethrough')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconStrikethrough)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"清除格式\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n onClick: _cache[10] || (_cache[10] = ($event: any) => (emitRichTextCommand('clear')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFormat)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"上标\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).superscript,\n onClick: _cache[11] || (_cache[11] = ($event: any) => (emitRichTextCommand('superscript')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconUpOne)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下标\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).subscript,\n onClick: _cache[12] || (_cache[12] = ($event: any) => (emitRichTextCommand('subscript')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconDownOne)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"行内代码\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).code,\n onClick: _cache[13] || (_cache[13] = ($event: any) => (emitRichTextCommand('code')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconCode)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"引用\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).blockquote,\n onClick: _cache[14] || (_cache[14] = ($event: any) => (emitRichTextCommand('blockquote')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconQuote)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"超链接\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, {\n placement: \"bottomRight\",\n trigger: \"click\",\n visible: linkPopoverVisible.value,\n \"onUpdate:visible\": _cache[19] || (_cache[19] = ($event: any) => ((linkPopoverVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(_component_Input, {\n value: link.value,\n \"onUpdate:value\": _cache[15] || (_cache[15] = ($event: any) => ((link).value = $event)),\n placeholder: \"请输入超链接\"\n }, null, 8, [\"value\"]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createVNode(_component_Button, {\n size: \"small\",\n disabled: !_unref(richTextAttrs).link,\n onClick: _cache[16] || (_cache[16] = ($event: any) => (updateLink())),\n style: {\"margin-right\":\"5px\"}\n }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n }, 8, [\"disabled\"]),\n _createVNode(_component_Button, {\n size: \"small\",\n type: \"primary\",\n onClick: _cache[17] || (_cache[17] = ($event: any) => (updateLink(link.value)))\n }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n })\n ])\n ])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: !!_unref(richTextAttrs).link,\n onClick: _cache[18] || (_cache[18] = ($event: any) => (openLinkPopover()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconLinkOne)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: _unref(richTextAttrs).align,\n onChange: _cache[20] || (_cache[20] = e => emitRichTextCommand('align', e.target.value))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"left\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"center\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextCenter)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"right\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"项目符号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).bulletList,\n onClick: _cache[21] || (_cache[21] = ($event: any) => (emitRichTextCommand('bulletList')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconList)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"编号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).orderedList,\n onClick: _cache[22] || (_cache[22] = ($event: any) => (emitRichTextCommand('orderedList')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconOrderedList)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"减小缩进\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[23] || (_cache[23] = ($event: any) => (emitRichTextCommand('indent', '-1')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconIndentLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"增大缩进\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[24] || (_cache[24] = ($event: any) => (emitRichTextCommand('indent', '+1')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconIndentRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: lineHeight.value,\n onChange: _cache[25] || (_cache[25] = value => updateLineHeight(value as number))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconRowHeight)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(lineHeightOptions, (item) => {\n return _createVNode(_component_SelectOption, {\n key: item,\n value: item\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item) + \"倍\", 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_12, [\n _hoisted_13,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: paragraphSpace.value,\n onChange: _cache[26] || (_cache[26] = value => updateParagraphSpace(value as number))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconVerticalSpacingBetweenItems)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(paragraphSpaceOptions, (item) => {\n return _createVNode(_component_SelectOption, {\n key: item,\n value: item\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item) + \"px\", 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_14, [\n _hoisted_15,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: wordSpace.value,\n onChange: _cache[27] || (_cache[27] = value => updateWordSpace(value as number))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconFullwidth)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(wordSpaceOptions, (item) => {\n return _createVNode(_component_SelectOption, {\n key: item,\n value: item\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item) + \"px\", 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_16, [\n _hoisted_17,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: textIndent.value,\n onChange: _cache[28] || (_cache[28] = value => updateTextIndent(value as number))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconIndentRight)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(textIndentOptions, (item) => {\n return _createVNode(_component_SelectOption, {\n key: item,\n value: item\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item) + \"px\", 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_18, [\n _hoisted_19,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: fill.value,\n \"onUpdate:modelValue\": _cache[29] || (_cache[29] = value => updateFill(value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: fill.value,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_Divider),\n _createVNode(ElementOutline),\n _createVNode(_component_Divider),\n _createVNode(ElementShadow),\n _createVNode(_component_Divider),\n _createVNode(ElementOpacity)\n ]))\n}\n}\n\n})","import script from \"./TextStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./TextStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./TextStylePanel.vue?vue&type=style&index=0&id=5830b9cf&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5830b9cf\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-59a1646e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-flip\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\" 垂直翻转\")\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\" 水平翻转\")\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { ImageOrShapeFlip } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementFlip',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst flipH = ref(false)\nconst flipV = ref(false)\n\nwatch(handleElement, () => {\n if (handleElement.value && (handleElement.value.type === 'image' || handleElement.value.type === 'shape')) {\n flipH.value = !!handleElement.value.flipH\n flipV.value = !!handleElement.value.flipV\n }\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateFlip = (flipProps: ImageOrShapeFlip) => {\n if (!handleElement.value) return\n slidesStore.updateElement({ id: handleElement.value.id, props: flipProps })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconFlipVertically = _resolveComponent(\"IconFlipVertically\")!\n const _component_CheckboxButton = _resolveComponent(\"CheckboxButton\")!\n const _component_IconFlipHorizontally = _resolveComponent(\"IconFlipHorizontally\")!\n const _component_CheckboxButtonGroup = _resolveComponent(\"CheckboxButtonGroup\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: flipV.value,\n onClick: _cache[0] || (_cache[0] = ($event: any) => (updateFlip({ flipV: !flipV.value })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFlipVertically),\n _hoisted_2\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: flipH.value,\n onClick: _cache[1] || (_cache[1] = ($event: any) => (updateFlip({ flipH: !flipH.value })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFlipHorizontally),\n _hoisted_3\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./ElementFlip.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementFlip.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementFlip.vue?vue&type=style&index=0&id=59a1646e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-59a1646e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-37fbdfde\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-filter\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"启用滤镜:\", -1))\nconst _hoisted_4 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_5 = {\n key: 0,\n class: \"filter\"\n}\nconst _hoisted_6 = { class: \"name\" }\n\nimport { ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTImageElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface FilterOption {\n label: string\n key: string\n default: number\n value: number\n unit: string\n max: number\n step: number\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementFilter',\n setup(__props) {\n\nconst defaultFilters: FilterOption[] = [\n { label: '模糊', key: 'blur', default: 0, value: 0, unit: 'px', max: 10, step: 1 },\n { label: '亮度', key: 'brightness', default: 100, value: 100, unit: '%', max: 200, step: 5 },\n { label: '对比度', key: 'contrast', default: 100, value: 100, unit: '%', max: 200, step: 5 },\n { label: '灰度', key: 'grayscale', default: 0, value: 0, unit: '%', max: 100, step: 5 },\n { label: '饱和度', key: 'saturate', default: 100, value: 100, unit: '%', max: 200, step: 5 },\n { label: '色相', key: 'hue-rotate', default: 0, value: 0, unit: 'deg', max: 360, step: 10 },\n { label: '不透明度', key: 'opacity', default: 100, value: 100, unit: '%', max: 100, step: 5 },\n]\n\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId } = storeToRefs(useMainStore())\n\nconst filterOptions = ref(JSON.parse(JSON.stringify(defaultFilters)))\nconst hasFilters = ref(false)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nwatch(handleElement, () => {\n if (!handleElement.value || handleElement.value.type !== 'image') return\n \n const filters = handleElement.value.filters\n if (filters) {\n filterOptions.value = defaultFilters.map(item => {\n if (filters[item.key] !== undefined) return { ...item, value: parseInt(filters[item.key]) }\n return item\n })\n hasFilters.value = true\n }\n else {\n filterOptions.value = JSON.parse(JSON.stringify(defaultFilters))\n hasFilters.value = false\n }\n}, { deep: true, immediate: true })\n\n// 设置滤镜\nconst updateFilter = (filter: FilterOption, value: number) => {\n const _handleElement = handleElement.value as PPTImageElement\n \n const originFilters = _handleElement.filters || {}\n const filters = { ...originFilters, [filter.key]: `${value}${filter.unit}` }\n slidesStore.updateElement({ id: handleElementId.value, props: { filters } })\n addHistorySnapshot()\n}\n\nconst toggleFilters = (checked: boolean) => {\n if (!handleElement.value) return\n if (checked) {\n slidesStore.updateElement({ id: handleElement.value.id, props: { filters: {} } })\n }\n else {\n slidesStore.removeElementProps({ id: handleElement.value.id, propName: 'filters' })\n }\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_Switch, {\n checked: hasFilters.value,\n onChange: _cache[0] || (_cache[0] = checked => toggleFilters(checked as boolean))\n }, null, 8, [\"checked\"])\n ])\n ]),\n (hasFilters.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_5, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(filterOptions.value, (filter) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"filter-item\",\n key: filter.key\n }, [\n _createElementVNode(\"div\", _hoisted_6, _toDisplayString(filter.label), 1),\n _createVNode(_component_Slider, {\n class: \"filter-slider\",\n max: filter.max,\n min: 0,\n step: filter.step,\n value: filter.value,\n onChange: value => updateFilter(filter, value as number)\n }, null, 8, [\"max\", \"step\", \"value\", \"onChange\"])\n ]))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ElementFilter.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementFilter.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementFilter.vue?vue&type=style&index=0&id=37fbdfde&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-37fbdfde\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, createVNode as _createVNode, resolveComponent as _resolveComponent, createTextVNode as _createTextVNode, withCtx as _withCtx, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createCommentVNode as _createCommentVNode, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-7da35bec\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"image-style-panel\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\" 裁剪图片\")\nconst _hoisted_3 = { class: \"clip\" }\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"按形状:\", -1))\nconst _hoisted_5 = { class: \"shape-clip\" }\nconst _hoisted_6 = [\"onClick\"]\nconst _hoisted_7 = {\n key: 0,\n class: \"title\"\n}\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\" 替换图片\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\" 重置样式\")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\" 设为背景\")\n\nimport { Ref, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTImageElement, SlideBackground } from '@/types/slides'\nimport { CLIPPATHS } from '@/configs/imageClip'\nimport { getImageDataURL } from '@/utils/image'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementOutline from '../common/ElementOutline.vue'\nimport ElementShadow from '../common/ElementShadow.vue'\nimport ElementFlip from '../common/ElementFlip.vue'\nimport ElementFilter from '../common/ElementFilter.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ImageStylePanel',\n setup(__props) {\n\nconst shapeClipPathOptions = CLIPPATHS\nconst ratioClipOptions = [\n {\n label: '纵横比(方形)',\n children: [\n { key: '1:1', ratio: 1 / 1 },\n ],\n },\n {\n label: '纵横比(纵向)',\n children: [\n { key: '2:3', ratio: 3 / 2 },\n { key: '3:4', ratio: 4 / 3 },\n { key: '3:5', ratio: 5 / 3 },\n { key: '4:5', ratio: 5 / 4 },\n ],\n },\n {\n label: '纵横比(横向)',\n children: [\n { key: '3:2', ratio: 2 / 3 },\n { key: '4:3', ratio: 3 / 4 },\n { key: '5:3', ratio: 3 / 5 },\n { key: '5:4', ratio: 4 / 5 },\n ],\n },\n {\n children: [\n { key: '16:9', ratio: 9 / 16 },\n { key: '16:10', ratio: 10 / 16 },\n ],\n },\n]\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId } = storeToRefs(mainStore)\nconst { currentSlide } = storeToRefs(slidesStore)\n\nconst handleImageElement = handleElement as Ref\n\nconst clipPanelVisible = ref(false)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 打开自由裁剪\nconst clipImage = () => {\n mainStore.setClipingImageElementId(handleElementId.value)\n clipPanelVisible.value = false\n}\n\n// 获取原始图片的位置大小\nconst getImageElementDataBeforeClip = () => {\n const _handleElement = handleElement.value as PPTImageElement\n\n // 图片当前的位置大小和裁剪范围\n const imgWidth = _handleElement.width\n const imgHeight = _handleElement.height\n const imgLeft = _handleElement.left\n const imgTop = _handleElement.top\n const originClipRange: [[number, number], [number, number]] = _handleElement.clip ? _handleElement.clip.range : [[0, 0], [100, 100]]\n\n const originWidth = imgWidth / ((originClipRange[1][0] - originClipRange[0][0]) / 100)\n const originHeight = imgHeight / ((originClipRange[1][1] - originClipRange[0][1]) / 100)\n const originLeft = imgLeft - originWidth * (originClipRange[0][0] / 100)\n const originTop = imgTop - originHeight * (originClipRange[0][1] / 100)\n\n return {\n originClipRange,\n originWidth,\n originHeight,\n originLeft,\n originTop,\n }\n}\n\n// 预设裁剪\nconst presetImageClip = (shape: string, ratio = 0) => {\n const _handleElement = handleElement.value as PPTImageElement\n\n const {\n originClipRange,\n originWidth,\n originHeight,\n originLeft,\n originTop,\n } = getImageElementDataBeforeClip()\n \n // 纵横比裁剪(形状固定为矩形)\n if (ratio) {\n const imageRatio = originHeight / originWidth\n\n const min = 0\n const max = 100\n let range: [[number, number], [number, number]]\n\n if (imageRatio > ratio) {\n const distance = ((1 - ratio / imageRatio) / 2) * 100\n range = [[min, distance], [max, max - distance]]\n }\n else {\n const distance = ((1 - imageRatio / ratio) / 2) * 100\n range = [[distance, min], [max - distance, max]]\n }\n slidesStore.updateElement({\n id: handleElementId.value,\n props: {\n clip: { ..._handleElement.clip, shape, range },\n left: originLeft + originWidth * (range[0][0] / 100),\n top: originTop + originHeight * (range[0][1] / 100),\n width: originWidth * (range[1][0] - range[0][0]) / 100,\n height: originHeight * (range[1][1] - range[0][1]) / 100,\n },\n })\n }\n // 形状裁剪(保持当前裁剪范围)\n else {\n slidesStore.updateElement({\n id: handleElementId.value,\n props: {\n clip: { ..._handleElement.clip, shape, range: originClipRange }\n },\n })\n }\n clipImage()\n addHistorySnapshot()\n}\n\n// 替换图片(保持当前的样式)\nconst replaceImage = (files: FileList) => {\n const imageFile = files[0]\n if (!imageFile) return\n getImageDataURL(imageFile).then(dataURL => {\n const props = { src: dataURL }\n slidesStore.updateElement({ id: handleElementId.value, props })\n })\n addHistorySnapshot()\n}\n\n// 重置图片:清除全部样式\nconst resetImage = () => {\n const _handleElement = handleElement.value as PPTImageElement\n\n if (_handleElement.clip) {\n const {\n originWidth,\n originHeight,\n originLeft,\n originTop,\n } = getImageElementDataBeforeClip()\n\n slidesStore.updateElement({\n id: handleElementId.value,\n props: {\n left: originLeft,\n top: originTop,\n width: originWidth,\n height: originHeight,\n },\n })\n }\n\n slidesStore.removeElementProps({\n id: handleElementId.value,\n propName: ['clip', 'outline', 'flip', 'shadow', 'filters'],\n })\n addHistorySnapshot()\n}\n\n// 将图片设置为背景\nconst setBackgroundImage = () => {\n const _handleElement = handleElement.value as PPTImageElement\n\n const background: SlideBackground = {\n ...currentSlide.value.background,\n type: 'image',\n image: _handleElement.src,\n imageSize: 'cover',\n }\n slidesStore.updateSlide({ background })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconTailoring = _resolveComponent(\"IconTailoring\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconDown = _resolveComponent(\"IconDown\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconTransform = _resolveComponent(\"IconTransform\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_IconUndo = _resolveComponent(\"IconUndo\")!\n const _component_IconTheme = _resolveComponent(\"IconTheme\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"origin-image\",\n style: _normalizeStyle({ backgroundImage: `url(${_unref(handleImageElement).src})` })\n }, null, 4),\n _createVNode(ElementFlip),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"5\"},\n onClick: _cache[0] || (_cache[0] = ($event: any) => (clipImage()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTailoring, { class: \"btn-icon\" }),\n _hoisted_2\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: clipPanelVisible.value,\n \"onUpdate:visible\": _cache[1] || (_cache[1] = ($event: any) => ((clipPanelVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_3, [\n _hoisted_4,\n _createElementVNode(\"div\", _hoisted_5, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(shapeClipPathOptions), (item, key) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"shape-clip-item\",\n key: key,\n onClick: ($event: any) => (presetImageClip(key))\n }, [\n _createElementVNode(\"div\", {\n class: \"shape\",\n style: _normalizeStyle({ clipPath: item.style })\n }, null, 4)\n ], 8, _hoisted_6))\n }), 128))\n ]),\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(ratioClipOptions, (type) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: type.label\n }, [\n (type.label)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_7, \"按\" + _toDisplayString(type.label) + \":\", 1))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(type.children, (item) => {\n return (_openBlock(), _createBlock(_component_Button, {\n style: {\"flex\":\"1\"},\n key: item.key,\n onClick: ($event: any) => (presetImageClip('rect', item.ratio))\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(item.key), 1)\n ]),\n _: 2\n }, 1032, [\"onClick\"]))\n }), 128))\n ]),\n _: 2\n }, 1024)\n ], 64))\n }), 64))\n ])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"no-padding\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconDown)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _createVNode(ElementFilter),\n _createVNode(_component_Divider),\n _createVNode(ElementOutline),\n _createVNode(_component_Divider),\n _createVNode(ElementShadow),\n _createVNode(_component_Divider),\n _createVNode(_component_FileInput, {\n onChange: _cache[2] || (_cache[2] = files => replaceImage(files))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, { class: \"full-width-btn\" }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTransform, { class: \"btn-icon\" }),\n _hoisted_8\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"full-width-btn\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (resetImage()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconUndo, { class: \"btn-icon\" }),\n _hoisted_9\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"full-width-btn\",\n onClick: _cache[4] || (_cache[4] = ($event: any) => (setBackgroundImage()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTheme, { class: \"btn-icon\" }),\n _hoisted_10\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./ImageStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ImageStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ImageStylePanel.vue?vue&type=style&index=0&id=7da35bec&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7da35bec\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock, Fragment as _Fragment, unref as _unref, renderList as _renderList, toDisplayString as _toDisplayString, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-02998580\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"shape-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\"纯色填充\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"渐变填充\")\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"1\"} }, null, -1))\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"线性渐变\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"径向渐变\")\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"起点颜色:\", -1))\nconst _hoisted_10 = { class: \"row\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"终点颜色:\", -1))\nconst _hoisted_12 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_13 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"渐变角度:\", -1))\nconst _hoisted_14 = /*#__PURE__*/_createTextVNode(\"+\")\nconst _hoisted_15 = /*#__PURE__*/_createTextVNode(\"-\")\n\nimport { Ref, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTShapeElement, ShapeGradient, ShapeText } from '@/types/slides'\nimport { WEB_FONTS } from '@/configs/font'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementOpacity from '../common/ElementOpacity.vue'\nimport ElementOutline from '../common/ElementOutline.vue'\nimport ElementShadow from '../common/ElementShadow.vue'\nimport ElementFlip from '../common/ElementFlip.vue'\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ShapeStylePanel',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId, richTextAttrs, availableFonts } = storeToRefs(mainStore)\n\nconst handleShapeElement = handleElement as Ref\n\nconst fill = ref('#000')\nconst gradient = ref({\n type: 'linear', \n rotate: 0,\n color: ['#fff', '#fff'],\n})\nconst fillType = ref('fill')\nconst textAlign = ref('middle')\n\nwatch(handleElement, () => {\n if (!handleElement.value || handleElement.value.type !== 'shape') return\n\n fill.value = handleElement.value.fill || '#fff'\n gradient.value = handleElement.value.gradient || { type: 'linear', rotate: 0, color: [fill.value, '#fff'] }\n fillType.value = handleElement.value.gradient ? 'gradient' : 'fill'\n textAlign.value = handleElement.value?.text?.align || 'middle'\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateElement = (props: Partial) => {\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 设置填充类型:渐变、纯色\nconst updateFillType = (type: 'gradient' | 'fill') => {\n if (type === 'fill') {\n slidesStore.removeElementProps({ id: handleElementId.value, propName: 'gradient' })\n addHistorySnapshot()\n }\n else updateElement({ gradient: gradient.value })\n}\n\n// 设置渐变填充\nconst updateGradient = (gradientProps: Partial) => {\n if (!gradient.value) return\n const _gradient: ShapeGradient = { ...gradient.value, ...gradientProps }\n updateElement({ gradient: _gradient })\n}\n\n// 设置填充色\nconst updateFill = (value: string) => {\n updateElement({ fill: value })\n}\n\nconst updateTextAlign = (align: 'top' | 'middle' | 'bottom') => {\n const _handleElement = handleElement.value as PPTShapeElement\n \n const defaultText: ShapeText = {\n content: '',\n defaultFontName: '微软雅黑',\n defaultColor: '#000',\n align: 'middle',\n }\n const _text = _handleElement.text || defaultText\n updateElement({ text: { ..._text, align } })\n}\n\nconst fontSizeOptions = [\n '12px', '14px', '16px', '18px', '20px', '22px', '24px', '28px', '32px',\n '36px', '40px', '44px', '48px', '54px', '60px', '66px', '72px', '76px',\n '80px', '88px', '96px', '104px', '112px', '120px',\n]\n\nconst emitRichTextCommand = (command: string, value?: string) => {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command, value } })\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_SelectOptGroup = _resolveComponent(\"SelectOptGroup\")!\n const _component_IconAddText = _resolveComponent(\"IconAddText\")!\n const _component_InputGroup = _resolveComponent(\"InputGroup\")!\n const _component_IconText = _resolveComponent(\"IconText\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconHighLight = _resolveComponent(\"IconHighLight\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconTextBold = _resolveComponent(\"IconTextBold\")!\n const _component_CheckboxButton = _resolveComponent(\"CheckboxButton\")!\n const _component_IconTextItalic = _resolveComponent(\"IconTextItalic\")!\n const _component_IconTextUnderline = _resolveComponent(\"IconTextUnderline\")!\n const _component_IconFormat = _resolveComponent(\"IconFormat\")!\n const _component_CheckboxButtonGroup = _resolveComponent(\"CheckboxButtonGroup\")!\n const _component_IconAlignTextLeft = _resolveComponent(\"IconAlignTextLeft\")!\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_IconAlignTextCenter = _resolveComponent(\"IconAlignTextCenter\")!\n const _component_IconAlignTextRight = _resolveComponent(\"IconAlignTextRight\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_IconAlignTextTopOne = _resolveComponent(\"IconAlignTextTopOne\")!\n const _component_IconAlignTextMiddleOne = _resolveComponent(\"IconAlignTextMiddleOne\")!\n const _component_IconAlignTextBottomOne = _resolveComponent(\"IconAlignTextBottomOne\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_Select, {\n style: {\"flex\":\"10\"},\n value: fillType.value,\n onChange: _cache[0] || (_cache[0] = value => updateFillType(value as 'fill' | 'gradient'))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"fill\" }, {\n default: _withCtx(() => [\n _hoisted_3\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"gradient\" }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _hoisted_5,\n (fillType.value === 'fill')\n ? (_openBlock(), _createBlock(_component_Popover, {\n key: 0,\n trigger: \"click\"\n }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: fill.value,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = value => updateFill(value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: fill.value,\n style: {\"flex\":\"10\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n }))\n : (_openBlock(), _createBlock(_component_Select, {\n key: 1,\n style: {\"flex\":\"10\"},\n value: gradient.value.type,\n onChange: _cache[2] || (_cache[2] = value => updateGradient({ type: value as 'linear' | 'radial' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"linear\" }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"radial\" }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]))\n ]),\n (fillType.value === 'gradient')\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: gradient.value.color[0],\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = value => updateGradient({ color: [value, gradient.value.color[1]] }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: gradient.value.color[0],\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: gradient.value.color[1],\n \"onUpdate:modelValue\": _cache[4] || (_cache[4] = value => updateGradient({ color: [gradient.value.color[0], value] }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: gradient.value.color[1],\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n (gradient.value.type === 'linear')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_12, [\n _hoisted_13,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: 0,\n max: 360,\n step: 15,\n value: gradient.value.rotate,\n onChange: _cache[5] || (_cache[5] = value => updateGradient({ rotate: value as number }))\n }, null, 8, [\"value\"])\n ]))\n : _createCommentVNode(\"\", true)\n ], 64))\n : _createCommentVNode(\"\", true),\n _createVNode(ElementFlip),\n _createVNode(_component_Divider),\n (_unref(handleShapeElement).text?.content)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n _createVNode(_component_InputGroup, {\n compact: \"\",\n class: \"row\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(richTextAttrs).fontname,\n onChange: _cache[6] || (_cache[6] = value => emitRichTextCommand('fontname', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconFontSize)\n ]),\n default: _withCtx(() => [\n _createVNode(_component_SelectOptGroup, { label: \"系统字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(availableFonts), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", {\n style: _normalizeStyle({ fontFamily: font.value })\n }, _toDisplayString(font.label), 5)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOptGroup, { label: \"在线字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(WEB_FONTS), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", null, _toDisplayString(font.label), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Select, {\n style: {\"flex\":\"2\"},\n value: _unref(richTextAttrs).fontsize,\n onChange: _cache[7] || (_cache[7] = value => emitRichTextCommand('fontsize', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconAddText)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(fontSizeOptions, (fontsize) => {\n return _createVNode(_component_SelectOption, {\n key: fontsize,\n value: fontsize\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(fontsize), 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).color,\n \"onUpdate:modelValue\": _cache[8] || (_cache[8] = value => emitRichTextCommand('color', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字颜色\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconText),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).color })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).backcolor,\n \"onUpdate:modelValue\": _cache[9] || (_cache[9] = value => emitRichTextCommand('backcolor', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字高亮\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconHighLight),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).backcolor })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"增大字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[10] || (_cache[10] = ($event: any) => (emitRichTextCommand('fontsize-add')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_14\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"减小字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[11] || (_cache[11] = ($event: any) => (emitRichTextCommand('fontsize-reduce')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_15\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"加粗\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).bold,\n onClick: _cache[12] || (_cache[12] = ($event: any) => (emitRichTextCommand('bold')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextBold)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"斜体\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).em,\n onClick: _cache[13] || (_cache[13] = ($event: any) => (emitRichTextCommand('em')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextItalic)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下划线\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).underline,\n onClick: _cache[14] || (_cache[14] = ($event: any) => (emitRichTextCommand('underline')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextUnderline)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"清除格式\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n onClick: _cache[15] || (_cache[15] = ($event: any) => (emitRichTextCommand('clear')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFormat)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: _unref(richTextAttrs).align,\n onChange: _cache[16] || (_cache[16] = e => emitRichTextCommand('align', e.target.value))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"left\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"center\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextCenter)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"right\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: textAlign.value,\n onChange: _cache[17] || (_cache[17] = e => updateTextAlign(e.target.value))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"顶对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"top\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextTopOne)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"middle\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextMiddleOne)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"底对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"bottom\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextBottomOne)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Divider)\n ], 64))\n : _createCommentVNode(\"\", true),\n _createVNode(ElementOutline),\n _createVNode(_component_Divider),\n _createVNode(ElementShadow),\n _createVNode(_component_Divider),\n _createVNode(ElementOpacity)\n ]))\n}\n}\n\n})","import script from \"./ShapeStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ShapeStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ShapeStylePanel.vue?vue&type=style&index=0&id=02998580&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-02998580\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-938968a2\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"line-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"线条样式:\", -1))\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"实线\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"虚线\")\nconst _hoisted_6 = { class: \"row\" }\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"线条颜色:\", -1))\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"线条宽度:\", -1))\nconst _hoisted_10 = { class: \"row\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"起点样式:\", -1))\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"无\")\nconst _hoisted_13 = /*#__PURE__*/_createTextVNode(\"箭头\")\nconst _hoisted_14 = /*#__PURE__*/_createTextVNode(\"圆点\")\nconst _hoisted_15 = { class: \"row\" }\nconst _hoisted_16 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"终点样式:\", -1))\nconst _hoisted_17 = /*#__PURE__*/_createTextVNode(\"无\")\nconst _hoisted_18 = /*#__PURE__*/_createTextVNode(\"箭头\")\nconst _hoisted_19 = /*#__PURE__*/_createTextVNode(\"圆点\")\n\nimport { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTLineElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementShadow from '../common/ElementShadow.vue'\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LineStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst handleLineElement = handleElement as Ref\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateLine = (props: Partial) => {\n if (!handleElement.value) return\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(handleLineElement).style,\n onChange: _cache[0] || (_cache[0] = value => updateLine({ style: value as 'solid' | 'dashed' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"solid\" }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"dashed\" }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_6, [\n _hoisted_7,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(handleLineElement).color,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = value => updateLine({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(handleLineElement).color,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_InputNumber, {\n value: _unref(handleLineElement).width,\n onChange: _cache[2] || (_cache[2] = value => updateLine({ width: value as number })),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(handleLineElement).points[0],\n onChange: _cache[3] || (_cache[3] = value => updateLine({ points: [value as 'arrow' | 'dot', _unref(handleLineElement).points[1]] }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"\" }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"arrow\" }, {\n default: _withCtx(() => [\n _hoisted_13\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"dot\" }, {\n default: _withCtx(() => [\n _hoisted_14\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_15, [\n _hoisted_16,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(handleLineElement).points[1],\n onChange: _cache[4] || (_cache[4] = value => updateLine({ points: [_unref(handleLineElement).points[0], value as 'arrow' | 'dot'] }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"\" }, {\n default: _withCtx(() => [\n _hoisted_17\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"arrow\" }, {\n default: _withCtx(() => [\n _hoisted_18\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"dot\" }, {\n default: _withCtx(() => [\n _hoisted_19\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createVNode(_component_Divider),\n _createVNode(ElementShadow)\n ]))\n}\n}\n\n})","import script from \"./LineStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LineStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LineStylePanel.vue?vue&type=style&index=0&id=938968a2&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-938968a2\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, withModifiers as _withModifiers, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-53b32689\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"chart-data-editor\" }\nconst _hoisted_2 = { class: \"editor-content\" }\nconst _hoisted_3 = { class: \"range-box\" }\nconst _hoisted_4 = [\"id\", \"onFocus\", \"onPaste\"]\nconst _hoisted_5 = { class: \"btns\" }\nconst _hoisted_6 = { class: \"left\" }\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"清空\")\nconst _hoisted_8 = { class: \"right\" }\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"取消\")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"确认\")\n\nimport { computed, onMounted, onUnmounted, PropType, ref } from 'vue'\nimport { ChartData } from '@/types/slides'\nimport { KEYS } from '@/configs/hotkey'\nimport { pasteCustomClipboardString, pasteExcelClipboardString } from '@/utils/clipboard'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ChartDataEditor',\n props: {\n data: {\n type: Object as PropType,\n required: true,\n }\n},\n emits: [\"save\", \"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'save', payload: ChartData): void\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst CELL_WIDTH = 100\nconst CELL_HEIGHT = 32\n\nconst selectedRange = ref([0, 0])\nconst tempRangeSize = ref({ width: 0, height: 0 })\nconst focusCell = ref<[number, number] | null>(null)\n\n// 当前选区的边框线条位置\nconst rangeLines = computed(() => {\n const width = selectedRange.value[0] * CELL_WIDTH\n const height = selectedRange.value[1] * CELL_HEIGHT\n return [\n { type: 't', style: {width: width + 'px'} },\n { type: 'b', style: {top: height + 'px', width: width + 'px'} },\n { type: 'l', style: {height: height + 'px'} },\n { type: 'r', style: {left: width + 'px', height: height + 'px'} },\n ]\n})\n\n// 当前选区的缩放点位置\nconst resizablePointStyle = computed(() => {\n const width = selectedRange.value[0] * CELL_WIDTH\n const height = selectedRange.value[1] * CELL_HEIGHT\n return { left: width + 'px', top: height + 'px' }\n})\n\n// 初始化图表数据:将数据格式化并填充到DOM\nconst initData = () => {\n const _data: string[][] = []\n\n const { labels, legends, series } = props.data\n const rowCount = labels.length\n const colCount = series.length\n\n _data.push(['', ...legends])\n for (let rowIndex = 0; rowIndex < rowCount; rowIndex++) {\n const row = [labels[rowIndex]]\n for (let colIndex = 0; colIndex < colCount; colIndex++) {\n row.push(series[colIndex][rowIndex] + '')\n }\n _data.push(row)\n }\n\n for (let rowIndex = 0; rowIndex < rowCount + 1; rowIndex++) {\n for (let colIndex = 0; colIndex < colCount + 1; colIndex++) {\n const inputRef = document.querySelector(`#cell-${rowIndex}-${colIndex}`) as HTMLInputElement\n if (!inputRef) continue\n inputRef.value = _data[rowIndex][colIndex] + ''\n }\n }\n\n selectedRange.value = [colCount + 1, rowCount + 1]\n}\n\nonMounted(initData)\n\n// 快捷键监听:回车移动焦点到下一行\nconst moveNextRow = () => {\n if (!focusCell.value) return\n\n const [rowIndex, colIndex] = focusCell.value\n const inputRef = document.querySelector(`#cell-${rowIndex + 1}-${colIndex}`) as HTMLInputElement\n inputRef && inputRef.focus()\n}\n\nconst keyboardListener = (e: KeyboardEvent) => {\n const key = e.key.toUpperCase()\n if (key === KEYS.ENTER) moveNextRow()\n}\n\nonMounted(() => {\n document.addEventListener('keydown', keyboardListener)\n})\nonUnmounted(() => {\n document.removeEventListener('keydown', keyboardListener)\n})\n\n// 获取当前图表DOM中的数据,整理格式化后传递出去\nconst getTableData = () => {\n const [col, row] = selectedRange.value\n\n const labels: string[] = []\n const legends: string[] = []\n const series: number[][] = []\n\n // 第一行为系列名,第一列为项目名,实际数据从第二行第二列开始\n for (let rowIndex = 1; rowIndex < row; rowIndex++) {\n let labelsItem = `类别${rowIndex}`\n const labelInputRef = document.querySelector(`#cell-${rowIndex}-0`) as HTMLInputElement\n if (labelInputRef && labelInputRef.value) labelsItem = labelInputRef.value\n labels.push(labelsItem)\n }\n for (let colIndex = 1; colIndex < col; colIndex++) {\n let legendsItem = `系列${colIndex}`\n const labelInputRef = document.querySelector(`#cell-0-${colIndex}`) as HTMLInputElement\n if (labelInputRef && labelInputRef.value) legendsItem = labelInputRef.value\n legends.push(legendsItem)\n }\n\n for (let colIndex = 1; colIndex < col; colIndex++) {\n const seriesItem = []\n for (let rowIndex = 1; rowIndex < row; rowIndex++) {\n const valueInputRef = document.querySelector(`#cell-${rowIndex}-${colIndex}`) as HTMLInputElement\n let value = 0\n if (valueInputRef && valueInputRef.value && !!(+valueInputRef.value)) {\n value = +valueInputRef.value\n }\n seriesItem.push(value)\n }\n series.push(seriesItem)\n }\n\n emit('save', { labels, legends, series })\n}\n\n// 清空表格数据\nconst clear = () => {\n for (let rowIndex = 1; rowIndex < 31; rowIndex++) {\n for (let colIndex = 1; colIndex < 7; colIndex++) {\n const inputRef = document.querySelector(`#cell-${rowIndex}-${colIndex}`) as HTMLInputElement\n if (!inputRef) continue\n inputRef.value = ''\n }\n }\n}\n\n// 自定义粘贴事件(尝试读取剪贴板中的表格数据)\nconst handlePaste = (e: ClipboardEvent, rowIndex: number, colIndex: number) => {\n e.preventDefault()\n\n if (!e.clipboardData) return\n\n const clipboardDataFirstItem = e.clipboardData.items[0]\n\n if (clipboardDataFirstItem && clipboardDataFirstItem.kind === 'string' && clipboardDataFirstItem.type === 'text/plain') {\n clipboardDataFirstItem.getAsString(text => {\n const clipboardData = pasteCustomClipboardString(text)\n if (typeof clipboardData === 'object') return\n \n const excelData = pasteExcelClipboardString(text)\n if (excelData) {\n const maxRow = rowIndex + excelData.length\n const maxCol = colIndex + excelData[0].length\n for (let i = rowIndex; i < maxRow; i++) {\n for (let j = colIndex; j < maxCol; j++) {\n const inputRef = document.querySelector(`#cell-${i}-${j}`) as HTMLInputElement\n if (!inputRef) continue\n inputRef.value = excelData[i - rowIndex][j - colIndex]\n }\n }\n }\n })\n }\n}\n\n// 关闭图表数据编辑器\nconst closeEditor = () => emit('close')\n\n// 鼠标拖拽修改选中的数据范围\nconst changeSelectRange = (e: MouseEvent) => {\n let isMouseDown = true\n\n const startPageX = e.pageX\n const startPageY = e.pageY\n\n const originWidth = selectedRange.value[0] * CELL_WIDTH\n const originHeight = selectedRange.value[1] * CELL_HEIGHT\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageX = e.pageX\n const currentPageY = e.pageY\n\n const x = currentPageX - startPageX\n const y = currentPageY - startPageY\n\n const width = originWidth + x\n const height = originHeight + y\n\n tempRangeSize.value = { width, height }\n }\n\n document.onmouseup = e => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n\n const endPageX = e.pageX\n const endPageY = e.pageY\n\n if (startPageX === endPageX && startPageY === endPageY) return\n\n // 拖拽结束时,范围超过格子一半自动扩大到下一格(如拖动到一格半多的位置,会自动扩展到两格,横竖都同理)\n let width = tempRangeSize.value.width\n let height = tempRangeSize.value.height\n if (width % CELL_WIDTH > CELL_WIDTH * 0.5) width = width + (CELL_WIDTH - width % CELL_WIDTH)\n if (height % CELL_HEIGHT > CELL_HEIGHT * 0.5) height = height + (CELL_HEIGHT - height % CELL_HEIGHT)\n\n let row = Math.round(height / CELL_HEIGHT)\n let col = Math.round(width / CELL_WIDTH)\n\n if (row < 3) row = 3\n if (col < 2) col = 2\n\n selectedRange.value = [col, row]\n tempRangeSize.value = { width: 0, height: 0 }\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", {\n class: \"temp-range\",\n style: _normalizeStyle({\n width: tempRangeSize.value.width + 'px',\n height: tempRangeSize.value.height + 'px',\n })\n }, null, 4),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(rangeLines), (line) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass(['range-line', line.type]),\n key: line.type,\n style: _normalizeStyle(line.style)\n }, null, 6))\n }), 128)),\n _createElementVNode(\"div\", {\n class: \"resizable\",\n style: _normalizeStyle(_unref(resizablePointStyle)),\n onMousedown: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (changeSelectRange($event)), [\"stop\"]))\n }, null, 36)\n ]),\n _createElementVNode(\"table\", null, [\n _createElementVNode(\"tbody\", null, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(31, (rowIndex) => {\n return _createElementVNode(\"tr\", { key: rowIndex }, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(7, (colIndex) => {\n return _createElementVNode(\"td\", {\n key: colIndex,\n class: _normalizeClass({ 'head': (colIndex === 1 && rowIndex <= selectedRange.value[1]) || (rowIndex === 1 && colIndex <= selectedRange.value[0]) })\n }, [\n _createElementVNode(\"input\", {\n class: _normalizeClass(['item', { 'selected': rowIndex <= selectedRange.value[1] && colIndex <= selectedRange.value[0] }]),\n id: `cell-${rowIndex - 1}-${colIndex - 1}`,\n autocomplete: \"off\",\n onFocus: ($event: any) => (focusCell.value = [rowIndex - 1, colIndex - 1]),\n onPaste: $event => handlePaste($event, rowIndex - 1, colIndex - 1)\n }, null, 42, _hoisted_4)\n ], 2)\n }), 64))\n ])\n }), 64))\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(_component_Button, {\n class: \"btn\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (clear()))\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _createVNode(_component_Button, {\n class: \"btn\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (closeEditor()))\n }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n type: \"primary\",\n class: \"btn\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (getTableData())),\n style: {\"margin-left\":\"10px\"}\n }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n })\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./ChartDataEditor.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ChartDataEditor.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ChartDataEditor.vue?vue&type=style&index=0&id=53b32689&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-53b32689\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, unref as _unref, createElementVNode as _createElementVNode, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, toDisplayString as _toDisplayString, withModifiers as _withModifiers, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-769d6876\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"chart-style-panel\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\" 编辑图表数据 \")\nconst _hoisted_3 = { class: \"row\" }\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"面积图样式\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"散点图样式\")\nconst _hoisted_6 = { class: \"row\" }\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"使用平滑曲线\")\nconst _hoisted_8 = {\n key: 1,\n class: \"row\"\n}\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"条形图样式\")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"堆叠样式\")\nconst _hoisted_11 = {\n key: 2,\n class: \"row\"\n}\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"环形图样式\")\nconst _hoisted_13 = { class: \"row\" }\nconst _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"图例:\", -1))\nconst _hoisted_15 = /*#__PURE__*/_createTextVNode(\"不显示\")\nconst _hoisted_16 = /*#__PURE__*/_createTextVNode(\"显示在上方\")\nconst _hoisted_17 = /*#__PURE__*/_createTextVNode(\"显示在下方\")\nconst _hoisted_18 = { class: \"row\" }\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"背景填充:\", -1))\nconst _hoisted_20 = { class: \"row\" }\nconst _hoisted_21 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"网格颜色:\", -1))\nconst _hoisted_22 = { style: {\"flex\":\"2\"} }\nconst _hoisted_23 = {\n class: \"color-btn-wrap\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_24 = [\"onClick\"]\nconst _hoisted_25 = { class: \"preset-themes\" }\nconst _hoisted_26 = [\"onClick\", \"onMouseenter\"]\nconst _hoisted_27 = /*#__PURE__*/_createTextVNode(\"推荐主题\")\nconst _hoisted_28 = /*#__PURE__*/_createTextVNode(\" 添加主题色 \")\n\nimport { onUnmounted, Ref, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { ChartData, ChartOptions, PPTChartElement } from '@/types/slides'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementOutline from '../../common/ElementOutline.vue'\nimport ColorButton from '../../common/ColorButton.vue'\nimport ChartDataEditor from './ChartDataEditor.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst presetChartThemes = [\n ['#d87c7c', '#919e8b', '#d7ab82', '#6e7074', '#61a0a8', '#efa18d'],\n ['#dd6b66', '#759aa0', '#e69d87', '#8dc1a9', '#ea7e53', '#eedd78'],\n ['#516b91', '#59c4e6', '#edafda', '#93b7e3', '#a5e7f0', '#cbb0e3'],\n ['#893448', '#d95850', '#eb8146', '#ffb248', '#f2d643', '#ebdba4'],\n ['#4ea397', '#22c3aa', '#7bd9a5', '#d0648a', '#f58db2', '#f2b3c9'],\n ['#3fb1e3', '#6be6c1', '#626c91', '#a0a7e6', '#c4ebad', '#96dee8'],\n ['#fc97af', '#87f7cf', '#f7f494', '#72ccff', '#f7c5a0', '#d4a4eb'],\n ['#c1232b', '#27727b', '#fcce10', '#e87c25', '#b5c334', '#fe8463'],\n ['#2ec7c9', '#b6a2de', '#5ab1ef', '#ffb980', '#d87a80', '#8d98b3'],\n ['#e01f54', '#001852', '#f5e8c8', '#b8d2c7', '#c6b38e', '#a4d8c2'],\n ['#c12e34', '#e6b600', '#0098d9', '#2b821d', '#005eaa', '#339ca8'],\n ['#8a7ca8', '#e098c7', '#8fd3e8', '#71669e', '#cc70af', '#7cb4cc'],\n]\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId } = storeToRefs(mainStore)\nconst { theme } = storeToRefs(slidesStore)\n\nconst handleChartElement = handleElement as Ref\n\nconst chartDataEditorVisible = ref(false)\nconst presetThemesVisible = ref(false)\nconst presetThemeColorHoverIndex = ref<[number, number]>([-1, -1])\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst fill = ref('#000')\n\nconst themeColor = ref([])\nconst gridColor = ref('')\nconst legend = ref('')\n\nconst lineSmooth = ref(true)\nconst showLine = ref(true)\nconst showArea = ref(false)\nconst horizontalBars = ref(false)\nconst donut = ref(false)\nconst stackBars = ref(false)\n\nwatch(handleElement, () => {\n if (!handleElement.value || handleElement.value.type !== 'chart') return\n fill.value = handleElement.value.fill || '#fff'\n\n if (handleElement.value.options) {\n const {\n lineSmooth: _lineSmooth,\n showLine: _showLine,\n showArea: _showArea,\n horizontalBars: _horizontalBars,\n donut: _donut,\n stackBars: _stackBars,\n } = handleElement.value.options\n\n if (_lineSmooth !== undefined) lineSmooth.value = _lineSmooth as boolean\n if (_showLine !== undefined) showLine.value = _showLine\n if (_showArea !== undefined) showArea.value = _showArea\n if (_horizontalBars !== undefined) horizontalBars.value = _horizontalBars\n if (_donut !== undefined) donut.value = _donut\n if (_stackBars !== undefined) stackBars.value = _stackBars\n }\n\n themeColor.value = handleElement.value.themeColor\n gridColor.value = handleElement.value.gridColor || '#333'\n legend.value = handleElement.value.legend || ''\n}, { deep: true, immediate: true })\n\nconst updateElement = (props: Partial) => {\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 设置图表数据\nconst updateData = (data: ChartData) => {\n chartDataEditorVisible.value = false\n updateElement({ data })\n}\n\n// 设置填充色\nconst updateFill = (value: string) => {\n updateElement({ fill: value })\n}\n\n// 设置其他选项:柱状图转条形图、折线图转面积图、折线图转散点图、饼图转环形图、折线图开关平滑曲线\nconst updateOptions = (optionProps: ChartOptions) => {\n const _handleElement = handleElement.value as PPTChartElement\n\n const newOptions = { ..._handleElement.options, ...optionProps }\n updateElement({ options: newOptions })\n}\n\n// 设置主题色\nconst updateTheme = (color: string, index: number) => {\n const props = {\n themeColor: themeColor.value.map((c, i) => i === index ? color : c),\n }\n updateElement(props)\n}\n\n// 添加主题色\nconst addThemeColor = () => {\n const props = {\n themeColor: [...themeColor.value, theme.value.themeColor],\n }\n updateElement(props)\n}\n\n// 使用预置主题配色\nconst applyPresetTheme = (colors: string[], index: number) => {\n const themeColor = colors.slice(0, index + 1)\n updateElement({ themeColor })\n presetThemesVisible.value = false\n}\n\n// 删除主题色\nconst deleteThemeColor = (index: number) => {\n const props = {\n themeColor: themeColor.value.filter((c, i) => i !== index),\n }\n updateElement(props)\n}\n\n// 设置网格颜色\nconst updateGridColor = (gridColor: string) => {\n updateElement({ gridColor })\n}\n\n// 设置图例位置/不显示\nconst updateLegend = (legend: '' | 'top' | 'bottom') => {\n updateElement({ legend })\n}\n\nconst openDataEditor = () => chartDataEditorVisible.value = true\n\nemitter.on(EmitterEvents.OPEN_CHART_DATA_EDITOR, openDataEditor)\nonUnmounted(() => {\n emitter.off(EmitterEvents.OPEN_CHART_DATA_EDITOR, openDataEditor)\n})\n\n// handleElement: handleElement as Ref,\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconEdit = _resolveComponent(\"IconEdit\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_Checkbox = _resolveComponent(\"Checkbox\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconCloseSmall = _resolveComponent(\"IconCloseSmall\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_Modal = _resolveComponent(\"Modal\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_Button, {\n class: \"full-width-btn\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (chartDataEditorVisible.value = true))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconEdit, { class: \"btn-icon\" }),\n _hoisted_2\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n (_unref(handleChartElement).chartType === 'line')\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[1] || (_cache[1] = e => updateOptions({ showArea: e.target.checked })),\n checked: showArea.value,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_Checkbox, {\n onChange: _cache[2] || (_cache[2] = e => updateOptions({ showLine: !e.target.checked })),\n checked: !showLine.value,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[3] || (_cache[3] = e => updateOptions({ lineSmooth: e.target.checked })),\n checked: lineSmooth.value\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n }, 8, [\"checked\"])\n ])\n ], 64))\n : _createCommentVNode(\"\", true),\n (_unref(handleChartElement).chartType === 'bar')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_8, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[4] || (_cache[4] = e => updateOptions({ horizontalBars: e.target.checked })),\n checked: horizontalBars.value\n }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_Checkbox, {\n onChange: _cache[5] || (_cache[5] = e => updateOptions({ stackBars: e.target.checked })),\n checked: stackBars.value\n }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]))\n : _createCommentVNode(\"\", true),\n (_unref(handleChartElement).chartType === 'pie')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_11, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[6] || (_cache[6] = e => updateOptions({ donut: e.target.checked })),\n checked: donut.value\n }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_13, [\n _hoisted_14,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: legend.value,\n onChange: _cache[7] || (_cache[7] = value => updateLegend(value as '' | 'top' | 'bottom'))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"\" }, {\n default: _withCtx(() => [\n _hoisted_15\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"top\" }, {\n default: _withCtx(() => [\n _hoisted_16\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"bottom\" }, {\n default: _withCtx(() => [\n _hoisted_17\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_18, [\n _hoisted_19,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: fill.value,\n \"onUpdate:modelValue\": _cache[8] || (_cache[8] = value => updateFill(value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: fill.value,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_20, [\n _hoisted_21,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: gridColor.value,\n \"onUpdate:modelValue\": _cache[9] || (_cache[9] = value => updateGridColor(value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: gridColor.value,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_Divider),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(themeColor.value, (color, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"row\",\n key: index\n }, [\n _createElementVNode(\"div\", _hoisted_22, _toDisplayString(index === 0 ? '主题配色:' : ''), 1),\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: color,\n \"onUpdate:modelValue\": value => updateTheme(value, index)\n }, null, 8, [\"modelValue\", \"onUpdate:modelValue\"])\n ]),\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_23, [\n _createVNode(ColorButton, {\n color: color,\n style: {\"width\":\"100%\"}\n }, null, 8, [\"color\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"删除\"\n }, {\n default: _withCtx(() => [\n (index !== 0)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"delete-color-btn\",\n onClick: _withModifiers(($event: any) => (deleteThemeColor(index)), [\"stop\"])\n }, [\n _createVNode(_component_IconCloseSmall)\n ], 8, _hoisted_24))\n : _createCommentVNode(\"\", true)\n ]),\n _: 2\n }, 1032, [\"mouseEnterDelay\"])\n ])\n ]),\n _: 2\n }, 1024)\n ]))\n }), 128)),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: presetThemesVisible.value,\n \"onUpdate:visible\": _cache[11] || (_cache[11] = ($event: any) => ((presetThemesVisible).value = $event))\n }, {\n content: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_25, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(presetChartThemes, (item, index) => {\n return _createElementVNode(\"div\", {\n class: \"preset-theme\",\n key: index\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(item, (color, itemIndex) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"preset-theme-color\", { 'select': presetThemeColorHoverIndex.value[0] === index && itemIndex <= presetThemeColorHoverIndex.value[1] }]),\n key: color,\n style: _normalizeStyle({ backgroundColor: color }),\n onClick: ($event: any) => (applyPresetTheme(item, itemIndex)),\n onMouseenter: ($event: any) => (presetThemeColorHoverIndex.value = [index, itemIndex]),\n onMouseleave: _cache[10] || (_cache[10] = ($event: any) => (presetThemeColorHoverIndex.value = [-1, -1]))\n }, null, 46, _hoisted_26))\n }), 128))\n ])\n }), 64))\n ])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"no-padding\",\n style: {\"flex\":\"2\"}\n }, {\n default: _withCtx(() => [\n _hoisted_27\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"visible\"]),\n _createVNode(_component_Button, {\n class: \"no-padding\",\n disabled: themeColor.value.length >= 10,\n style: {\"flex\":\"3\"},\n onClick: _cache[12] || (_cache[12] = ($event: any) => (addThemeColor()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPlus, { class: \"btn-icon\" }),\n _hoisted_28\n ]),\n _: 1\n }, 8, [\"disabled\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _createVNode(ElementOutline),\n _createVNode(_component_Modal, {\n visible: chartDataEditorVisible.value,\n \"onUpdate:visible\": _cache[15] || (_cache[15] = ($event: any) => ((chartDataEditorVisible).value = $event)),\n footer: null,\n centered: \"\",\n closable: false,\n width: 648,\n destroyOnClose: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(ChartDataEditor, {\n data: _unref(handleChartElement).data,\n onClose: _cache[13] || (_cache[13] = ($event: any) => (chartDataEditorVisible.value = false)),\n onSave: _cache[14] || (_cache[14] = value => updateData(value))\n }, null, 8, [\"data\"])\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=769d6876&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-769d6876\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, withCtx as _withCtx, createBlock as _createBlock, createTextVNode as _createTextVNode, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-7e28e1d8\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"table-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"行数:\", -1))\nconst _hoisted_4 = {\n class: \"set-count\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_5 = { class: \"count-text\" }\nconst _hoisted_6 = { class: \"row\" }\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"列数:\", -1))\nconst _hoisted_8 = {\n class: \"set-count\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_9 = { class: \"count-text\" }\nconst _hoisted_10 = { class: \"row theme-switch\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"启用主题表格:\", -1))\nconst _hoisted_12 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_13 = { class: \"row\" }\nconst _hoisted_14 = /*#__PURE__*/_createTextVNode(\"标题行\")\nconst _hoisted_15 = /*#__PURE__*/_createTextVNode(\"汇总行\")\nconst _hoisted_16 = { class: \"row\" }\nconst _hoisted_17 = /*#__PURE__*/_createTextVNode(\"第一列\")\nconst _hoisted_18 = /*#__PURE__*/_createTextVNode(\"最后一列\")\nconst _hoisted_19 = { class: \"row\" }\nconst _hoisted_20 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"主题颜色:\", -1))\n\nimport { computed, onMounted, ref, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { nanoid } from 'nanoid'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTTableElement, TableCell, TableCellStyle, TableTheme } from '@/types/slides'\nimport { WEB_FONTS } from '@/configs/font'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ElementOutline from '../common/ElementOutline.vue'\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'TableStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId, selectedTableCells: selectedCells, availableFonts } = storeToRefs(useMainStore())\nconst themeColor = computed(() => slidesStore.theme.themeColor)\n\nconst fontSizeOptions = [\n '12px', '14px', '16px', '18px', '20px', '22px', '24px', '28px', '32px',\n]\n\nconst textAttrs = ref({\n bold: false,\n em: false,\n underline: false,\n strikethrough: false,\n color: '#000',\n backcolor: '#000',\n fontsize: '12px',\n fontname: '微软雅黑',\n align: 'left',\n})\n\nconst theme = ref()\nconst hasTheme = ref(false)\nconst rowCount = ref(0)\nconst colCount = ref(0)\nconst minRowCount = ref(0)\nconst minColCount = ref(0)\n\nwatch(handleElement, () => {\n if (!handleElement.value || handleElement.value.type !== 'table') return\n \n theme.value = handleElement.value.theme\n hasTheme.value = !!theme.value\n\n rowCount.value = handleElement.value.data.length\n colCount.value = handleElement.value.data[0].length\n\n minRowCount.value = handleElement.value.data.length\n minColCount.value = handleElement.value.data[0].length\n}, { deep: true, immediate: true })\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 更新当前选中单元格的文本样式状态\nconst updateTextAttrState = () => {\n if (!handleElement.value || handleElement.value.type !== 'table') return\n\n let rowIndex = 0\n let colIndex = 0\n if (selectedCells.value.length) {\n const selectedCell = selectedCells.value[0]\n rowIndex = +selectedCell.split('_')[0]\n colIndex = +selectedCell.split('_')[1]\n }\n const style = handleElement.value.data[rowIndex][colIndex].style\n\n if (!style) {\n textAttrs.value = {\n bold: false,\n em: false,\n underline: false,\n strikethrough: false,\n color: '#000',\n backcolor: '#000',\n fontsize: '12px',\n fontname: '微软雅黑',\n align: 'left',\n }\n }\n else {\n textAttrs.value = {\n bold: !!style.bold,\n em: !!style.em,\n underline: !!style.underline,\n strikethrough: !!style.strikethrough,\n color: style.color || '#000',\n backcolor: style.backcolor || '#000',\n fontsize: style.fontsize || '12px',\n fontname: style.fontname || '微软雅黑',\n align: style.align || 'left',\n }\n }\n}\n\nonMounted(() => {\n if (selectedCells.value.length) updateTextAttrState()\n})\n\nwatch(selectedCells, updateTextAttrState)\n\nconst updateElement = (props: Partial) => {\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 设置单元格内容文本样式\nconst updateTextAttrs = (textAttrProp: Partial) => {\n const _handleElement = handleElement.value as PPTTableElement\n\n const data: TableCell[][] = JSON.parse(JSON.stringify(_handleElement.data))\n\n for (let i = 0; i < data.length; i++) {\n for (let j = 0; j < data[i].length; j++) {\n if (!selectedCells.value.length || selectedCells.value.includes(`${i}_${j}`)) {\n const style = data[i][j].style || {}\n data[i][j].style = { ...style, ...textAttrProp }\n }\n }\n }\n updateElement({ data })\n updateTextAttrState()\n}\n\n// 更新表格主题:主题色、标题行、汇总行、第一列、最后一列\nconst updateTheme = (themeProp: Partial) => {\n if (!theme.value) return\n const _theme = { ...theme.value, ...themeProp }\n updateElement({ theme: _theme })\n}\n\n// 开启/关闭表格主题\nconst toggleTheme = (checked: boolean) => {\n if (checked) {\n const props = {\n theme: {\n color: themeColor.value,\n rowHeader: true,\n rowFooter: false,\n colHeader: false,\n colFooter: false,\n }\n }\n updateElement(props)\n }\n else {\n slidesStore.removeElementProps({ id: handleElementId.value, propName: 'theme' })\n addHistorySnapshot()\n }\n}\n\n// 设置表格行数\nconst setTableRow = (value: number) => {\n const _handleElement = handleElement.value as PPTTableElement\n const rowCount = _handleElement.data.length\n\n if (value > rowCount) {\n const rowCells: TableCell[] = new Array(colCount.value).fill({ id: nanoid(10), colspan: 1, rowspan: 1, text: '' })\n const newTableCells: TableCell[][] = new Array(value - rowCount).fill(rowCells)\n \n const tableCells: TableCell[][] = JSON.parse(JSON.stringify(_handleElement.data))\n tableCells.push(...newTableCells)\n \n updateElement({ data: tableCells })\n }\n else {\n const tableCells: TableCell[][] = _handleElement.data.slice(0, value)\n updateElement({ data: tableCells })\n }\n}\n\n// 设置表格列数\nconst setTableCol = (value: number) => {\n const _handleElement = handleElement.value as PPTTableElement\n const colCount = _handleElement.data[0].length\n\n let tableCells = _handleElement.data\n let colSizeList = _handleElement.colWidths.map(item => item * _handleElement.width)\n\n if (value > colCount) {\n tableCells = tableCells.map(item => {\n const cells: TableCell[] = new Array(value - colCount).fill({ id: nanoid(10), colspan: 1, rowspan: 1, text: '' })\n item.push(...cells)\n return item\n })\n \n const newColSizeList: number[] = new Array(value - colCount).fill(100)\n colSizeList.push(...newColSizeList)\n }\n else {\n tableCells = tableCells.map(item => item.slice(0, value))\n colSizeList = colSizeList.slice(0, value)\n }\n\n const width = colSizeList.reduce((a, b) => a + b)\n const colWidths = colSizeList.map(item => item / width)\n\n const props = {\n width,\n data: tableCells,\n colWidths,\n }\n updateElement(props)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_SelectOptGroup = _resolveComponent(\"SelectOptGroup\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_IconAddText = _resolveComponent(\"IconAddText\")!\n const _component_InputGroup = _resolveComponent(\"InputGroup\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_IconText = _resolveComponent(\"IconText\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconFill = _resolveComponent(\"IconFill\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconTextBold = _resolveComponent(\"IconTextBold\")!\n const _component_CheckboxButton = _resolveComponent(\"CheckboxButton\")!\n const _component_IconTextItalic = _resolveComponent(\"IconTextItalic\")!\n const _component_IconTextUnderline = _resolveComponent(\"IconTextUnderline\")!\n const _component_IconStrikethrough = _resolveComponent(\"IconStrikethrough\")!\n const _component_CheckboxButtonGroup = _resolveComponent(\"CheckboxButtonGroup\")!\n const _component_IconAlignTextLeft = _resolveComponent(\"IconAlignTextLeft\")!\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_IconAlignTextCenter = _resolveComponent(\"IconAlignTextCenter\")!\n const _component_IconAlignTextRight = _resolveComponent(\"IconAlignTextRight\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconMinus = _resolveComponent(\"IconMinus\")!\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Checkbox = _resolveComponent(\"Checkbox\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_InputGroup, {\n compact: \"\",\n class: \"row\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: textAttrs.value.fontname,\n onChange: _cache[0] || (_cache[0] = value => updateTextAttrs({ fontname: value as string }))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconFontSize)\n ]),\n default: _withCtx(() => [\n _createVNode(_component_SelectOptGroup, { label: \"系统字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(availableFonts), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", {\n style: _normalizeStyle({ fontFamily: font.value })\n }, _toDisplayString(font.label), 5)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOptGroup, { label: \"在线字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(WEB_FONTS), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", null, _toDisplayString(font.label), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Select, {\n style: {\"flex\":\"2\"},\n value: textAttrs.value.fontsize,\n onChange: _cache[1] || (_cache[1] = value => updateTextAttrs({ fontsize: value as string }))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconAddText)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(fontSizeOptions, (fontsize) => {\n return _createVNode(_component_SelectOption, {\n key: fontsize,\n value: fontsize\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(fontsize), 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: textAttrs.value.color,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = value => updateTextAttrs({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字颜色\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconText),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: textAttrs.value.color })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: textAttrs.value.backcolor,\n \"onUpdate:modelValue\": _cache[3] || (_cache[3] = value => updateTextAttrs({ backcolor: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"单元格填充\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFill),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: textAttrs.value.backcolor })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"加粗\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: textAttrs.value.bold,\n onClick: _cache[4] || (_cache[4] = ($event: any) => (updateTextAttrs({ bold: !textAttrs.value.bold })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextBold)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"斜体\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: textAttrs.value.em,\n onClick: _cache[5] || (_cache[5] = ($event: any) => (updateTextAttrs({ em: !textAttrs.value.em })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextItalic)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下划线\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: textAttrs.value.underline,\n onClick: _cache[6] || (_cache[6] = ($event: any) => (updateTextAttrs({ underline: !textAttrs.value.underline })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextUnderline)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"删除线\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: textAttrs.value.strikethrough,\n onClick: _cache[7] || (_cache[7] = ($event: any) => (updateTextAttrs({ strikethrough: !textAttrs.value.strikethrough })))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconStrikethrough)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: textAttrs.value.align,\n onChange: _cache[8] || (_cache[8] = e => updateTextAttrs({ align: e.target.value }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"left\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"center\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextCenter)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"right\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Divider),\n _createVNode(ElementOutline, { fixed: true }),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_Button, {\n class: \"btn\",\n disabled: rowCount.value <= 1,\n onClick: _cache[9] || (_cache[9] = ($event: any) => (setTableRow(rowCount.value - 1)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconMinus)\n ]),\n _: 1\n }, 8, [\"disabled\"]),\n _createElementVNode(\"div\", _hoisted_5, _toDisplayString(rowCount.value), 1),\n _createVNode(_component_Button, {\n class: \"btn\",\n disabled: rowCount.value >= 30,\n onClick: _cache[10] || (_cache[10] = ($event: any) => (setTableRow(rowCount.value + 1)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPlus)\n ]),\n _: 1\n }, 8, [\"disabled\"])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_6, [\n _hoisted_7,\n _createElementVNode(\"div\", _hoisted_8, [\n _createVNode(_component_Button, {\n class: \"btn\",\n disabled: colCount.value <= 1,\n onClick: _cache[11] || (_cache[11] = ($event: any) => (setTableCol(colCount.value - 1)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconMinus)\n ]),\n _: 1\n }, 8, [\"disabled\"]),\n _createElementVNode(\"div\", _hoisted_9, _toDisplayString(colCount.value), 1),\n _createVNode(_component_Button, {\n class: \"btn\",\n disabled: colCount.value >= 30,\n onClick: _cache[12] || (_cache[12] = ($event: any) => (setTableCol(colCount.value + 1)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPlus)\n ]),\n _: 1\n }, 8, [\"disabled\"])\n ])\n ]),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createElementVNode(\"div\", _hoisted_12, [\n _createVNode(_component_Switch, {\n checked: hasTheme.value,\n onChange: _cache[13] || (_cache[13] = checked => toggleTheme(checked as boolean))\n }, null, 8, [\"checked\"])\n ])\n ]),\n (theme.value)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_13, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[14] || (_cache[14] = e => updateTheme({ rowHeader: e.target.checked })),\n checked: theme.value.rowHeader,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_14\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_Checkbox, {\n onChange: _cache[15] || (_cache[15] = e => updateTheme({ rowFooter: e.target.checked })),\n checked: theme.value.rowFooter,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_15\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _createElementVNode(\"div\", _hoisted_16, [\n _createVNode(_component_Checkbox, {\n onChange: _cache[16] || (_cache[16] = e => updateTheme({ colHeader: e.target.checked })),\n checked: theme.value.colHeader,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_17\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_Checkbox, {\n onChange: _cache[17] || (_cache[17] = e => updateTheme({ colFooter: e.target.checked })),\n checked: theme.value.colFooter,\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _hoisted_18\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _createElementVNode(\"div\", _hoisted_19, [\n _hoisted_20,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: theme.value.color,\n \"onUpdate:modelValue\": _cache[18] || (_cache[18] = value => updateTheme({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: theme.value.color,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./TableStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./TableStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./TableStylePanel.vue?vue&type=style&index=0&id=7e28e1d8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7e28e1d8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createElementVNode as _createElementVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-546adf8c\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"latex-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\"编辑 LaTeX\")\nconst _hoisted_4 = { class: \"row\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"颜色:\", -1))\nconst _hoisted_6 = { class: \"row\" }\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"粗细:\", -1))\n\nimport { onUnmounted, Ref, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTLatexElement } from '@/types/slides'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from '../common/ColorButton.vue'\nimport LaTeXEditor from '@/components/LaTeXEditor/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'LatexStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst handleLatexElement = handleElement as Ref\n\nconst latexEditorVisible = ref(false)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateLatex = (props: Partial) => {\n if (!handleElement.value) return\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\nconst updateLatexData = (data: { path: string; latex: string; w: number; h: number; }) => {\n updateLatex({\n path: data.path,\n latex: data.latex,\n width: data.w,\n height: data.h,\n viewBox: [data.w, data.h],\n })\n}\n\nconst openLatexEditor = () => latexEditorVisible.value = true\n\nemitter.on(EmitterEvents.OPEN_LATEX_EDITOR, openLatexEditor)\nonUnmounted(() => {\n emitter.off(EmitterEvents.OPEN_LATEX_EDITOR, openLatexEditor)\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_Modal = _resolveComponent(\"Modal\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[0] || (_cache[0] = ($event: any) => (latexEditorVisible.value = true))\n }, {\n default: _withCtx(() => [\n _hoisted_3\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(handleLatexElement).color,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = value => updateLatex({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(handleLatexElement).color,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_6, [\n _hoisted_7,\n _createVNode(_component_InputNumber, {\n min: 1,\n max: 3,\n value: _unref(handleLatexElement).strokeWidth,\n onChange: _cache[2] || (_cache[2] = value => updateLatex({ strokeWidth: value as number })),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ]),\n _createVNode(_component_Modal, {\n visible: latexEditorVisible.value,\n \"onUpdate:visible\": _cache[5] || (_cache[5] = ($event: any) => ((latexEditorVisible).value = $event)),\n footer: null,\n centered: \"\",\n width: 880,\n destroyOnClose: \"\"\n }, {\n default: _withCtx(() => [\n _createVNode(LaTeXEditor, {\n value: _unref(handleLatexElement).latex,\n onClose: _cache[3] || (_cache[3] = ($event: any) => (latexEditorVisible.value = false)),\n onUpdate: _cache[4] || (_cache[4] = data => { updateLatexData(data); latexEditorVisible.value = false })\n }, null, 8, [\"value\"])\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]))\n}\n}\n\n})","import script from \"./LatexStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./LatexStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./LatexStylePanel.vue?vue&type=style&index=0&id=546adf8c&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-546adf8c\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, normalizeStyle as _normalizeStyle, withCtx as _withCtx, createTextVNode as _createTextVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-ff7125dc\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"video-style-panel\" }\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"视频预览封面\", -1))\nconst _hoisted_3 = { class: \"background-image-wrapper\" }\nconst _hoisted_4 = { class: \"background-image\" }\nconst _hoisted_5 = { class: \"row\" }\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"重置封面\")\n\nimport { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTVideoElement } from '@/types/slides'\nimport { getImageDataURL } from '@/utils/image'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'VideoStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst handleVideoElement = handleElement as Ref\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateVideo = (props: Partial) => {\n if (!handleElement.value) return\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\n// 设置视频预览封面\nconst setVideoPoster = (files: FileList) => {\n const imageFile = files[0]\n if (!imageFile) return\n getImageDataURL(imageFile).then(dataURL => updateVideo({ poster: dataURL }))\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _hoisted_2,\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_FileInput, {\n onChange: _cache[0] || (_cache[0] = files => setVideoPoster(files))\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", {\n class: \"content\",\n style: _normalizeStyle({ backgroundImage: `url(${_unref(handleVideoElement).poster})` })\n }, [\n _createVNode(_component_IconPlus)\n ], 4)\n ])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[1] || (_cache[1] = ($event: any) => (updateVideo({ poster: '' })))\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./VideoStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./VideoStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./VideoStylePanel.vue?vue&type=style&index=0&id=ff7125dc&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-ff7125dc\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5d723d50\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"audio-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"图标颜色:\", -1))\nconst _hoisted_4 = { class: \"row switch-row\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"自动播放:\", -1))\nconst _hoisted_6 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\nconst _hoisted_7 = { class: \"row switch-row\" }\nconst _hoisted_8 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"循环播放:\", -1))\nconst _hoisted_9 = {\n class: \"switch-wrapper\",\n style: {\"flex\":\"3\"}\n}\n\nimport { Ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTAudioElement } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'AudioStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement } = storeToRefs(useMainStore())\n\nconst handleAudioElement = handleElement as Ref\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateAudio = (props: Partial) => {\n if (!handleElement.value) return\n slidesStore.updateElement({ id: handleElement.value.id, props })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_Switch = _resolveComponent(\"Switch\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(handleAudioElement).color,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = value => updateAudio({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(handleAudioElement).color,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(_component_Switch, {\n checked: _unref(handleAudioElement).autoplay,\n onChange: _cache[1] || (_cache[1] = checked => updateAudio({ autoplay: checked as boolean }))\n }, null, 8, [\"checked\"])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _hoisted_8,\n _createElementVNode(\"div\", _hoisted_9, [\n _createVNode(_component_Switch, {\n checked: _unref(handleAudioElement).loop,\n onChange: _cache[2] || (_cache[2] = checked => updateAudio({ loop: checked as boolean }))\n }, null, 8, [\"checked\"])\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./AudioStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./AudioStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./AudioStylePanel.vue?vue&type=style&index=0&id=5d723d50&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5d723d50\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeStyle as _normalizeStyle, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-71469855\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"multi-style-panel\" }\nconst _hoisted_2 = { class: \"row\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"填充颜色:\", -1))\nconst _hoisted_4 = { class: \"row\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框样式:\", -1))\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"实线边框\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"虚线边框\")\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框颜色:\", -1))\nconst _hoisted_10 = { class: \"row\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"边框粗细:\", -1))\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"+\")\nconst _hoisted_13 = /*#__PURE__*/_createTextVNode(\"-\")\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement, PPTElementOutline, TableCell } from '@/types/slides'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\nimport { WEB_FONTS } from '@/configs/font'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from '../common/ColorButton.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MultiStylePanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { richTextAttrs, availableFonts, activeElementList } = storeToRefs(useMainStore())\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateElement = (id: string, props: Partial) => {\n slidesStore.updateElement({ id, props })\n addHistorySnapshot()\n}\n\nconst fontSizeOptions = [\n '12px', '14px', '16px', '18px', '20px', '22px', '24px', '28px', '32px',\n '36px', '40px', '44px', '48px', '54px', '60px', '66px', '72px', '76px',\n '80px', '88px', '96px', '104px', '112px', '120px',\n]\n\nconst fill = ref('#fff')\nconst outline = ref({\n width: 0,\n color: '#fff',\n style: 'solid',\n})\n\n// 批量修改填充色(表格元素为单元格填充、音频元素为图标颜色)\nconst updateFill = (value: string) => {\n for (const el of activeElementList.value) {\n if (\n el.type === 'text' ||\n el.type === 'shape' ||\n el.type === 'chart'\n ) updateElement(el.id, { fill: value })\n\n if (el.type === 'table') {\n const data: TableCell[][] = JSON.parse(JSON.stringify(el.data))\n for (let i = 0; i < data.length; i++) {\n for (let j = 0; j < data[i].length; j++) {\n const style = data[i][j].style || {}\n data[i][j].style = { ...style, backcolor: value }\n }\n }\n updateElement(el.id, { data })\n }\n\n if (el.type === 'audio') updateElement(el.id, { color: value })\n }\n fill.value = value\n}\n\n// 修改边框/线条样式\nconst updateOutline = (outlineProps: Partial) => {\n\n for (const el of activeElementList.value) {\n if (\n el.type === 'text' ||\n el.type === 'image' ||\n el.type === 'shape' ||\n el.type === 'table' ||\n el.type === 'chart'\n ) {\n const outline = el.outline || { width: 2, color: '#000', style: 'solid' }\n const props = { outline: { ...outline, ...outlineProps } }\n updateElement(el.id, props)\n }\n\n if (el.type === 'line') updateElement(el.id, outlineProps)\n }\n outline.value = { ...outline.value, ...outlineProps }\n}\n\n// 修改文字样式\nconst updateFontStyle = (command: string, value: string) => {\n for (const el of activeElementList.value) {\n if (el.type === 'text' || (el.type === 'shape' && el.text?.content)) {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { target: el.id, action: { command, value } })\n }\n if (el.type === 'table') {\n const data: TableCell[][] = JSON.parse(JSON.stringify(el.data))\n for (let i = 0; i < data.length; i++) {\n for (let j = 0; j < data[i].length; j++) {\n const style = data[i][j].style || {}\n data[i][j].style = { ...style, [command]: value }\n }\n }\n updateElement(el.id, { data })\n }\n if (el.type === 'latex' && command === 'color') {\n updateElement(el.id, { color: value })\n }\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_SelectOptGroup = _resolveComponent(\"SelectOptGroup\")!\n const _component_IconAddText = _resolveComponent(\"IconAddText\")!\n const _component_InputGroup = _resolveComponent(\"InputGroup\")!\n const _component_IconText = _resolveComponent(\"IconText\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconHighLight = _resolveComponent(\"IconHighLight\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconAlignTextLeft = _resolveComponent(\"IconAlignTextLeft\")!\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_IconAlignTextCenter = _resolveComponent(\"IconAlignTextCenter\")!\n const _component_IconAlignTextRight = _resolveComponent(\"IconAlignTextRight\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _hoisted_3,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: fill.value,\n \"onUpdate:modelValue\": _cache[0] || (_cache[0] = value => updateFill(value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: fill.value,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: outline.value.style,\n onChange: _cache[1] || (_cache[1] = value => updateOutline({ style: value as 'solid' | 'dashed' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"solid\" }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"dashed\" }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: outline.value.color,\n \"onUpdate:modelValue\": _cache[2] || (_cache[2] = value => updateOutline({ color: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: outline.value.color || '#000',\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createVNode(_component_InputNumber, {\n value: outline.value.width,\n onChange: _cache[3] || (_cache[3] = value => updateOutline({ width: value as number })),\n style: {\"flex\":\"3\"}\n }, null, 8, [\"value\"])\n ]),\n _createVNode(_component_Divider),\n _createVNode(_component_InputGroup, {\n compact: \"\",\n class: \"row\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(richTextAttrs).fontname,\n onChange: _cache[4] || (_cache[4] = value => updateFontStyle('fontname', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconFontSize)\n ]),\n default: _withCtx(() => [\n _createVNode(_component_SelectOptGroup, { label: \"系统字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(availableFonts), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", {\n style: _normalizeStyle({ fontFamily: font.value })\n }, _toDisplayString(font.label), 5)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOptGroup, { label: \"在线字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(WEB_FONTS), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", null, _toDisplayString(font.label), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Select, {\n style: {\"flex\":\"2\"},\n value: _unref(richTextAttrs).fontsize,\n onChange: _cache[5] || (_cache[5] = value => updateFontStyle('fontsize', value as string))\n }, {\n suffixIcon: _withCtx(() => [\n _createVNode(_component_IconAddText)\n ]),\n default: _withCtx(() => [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(fontSizeOptions, (fontsize) => {\n return _createVNode(_component_SelectOption, {\n key: fontsize,\n value: fontsize\n }, {\n default: _withCtx(() => [\n _createTextVNode(_toDisplayString(fontsize), 1)\n ]),\n _: 2\n }, 1032, [\"value\"])\n }), 64))\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).color,\n \"onUpdate:modelValue\": _cache[6] || (_cache[6] = value => updateFontStyle('color', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字颜色\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconText),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).color })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(richTextAttrs).backcolor,\n \"onUpdate:modelValue\": _cache[7] || (_cache[7] = value => updateFontStyle('backcolor', value))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"文字高亮\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"text-color-btn\",\n style: {\"flex\":\"3\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconHighLight),\n _createElementVNode(\"div\", {\n class: \"text-color-block\",\n style: _normalizeStyle({ backgroundColor: _unref(richTextAttrs).backcolor })\n }, null, 4)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"增大字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[8] || (_cache[8] = ($event: any) => (updateFontStyle('fontsize-add', '2')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_12\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"减小字号\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"font-size-btn\",\n style: {\"flex\":\"2\"},\n onClick: _cache[9] || (_cache[9] = ($event: any) => (updateFontStyle('fontsize-reduce', '2')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_13\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: _unref(richTextAttrs).align,\n onChange: _cache[10] || (_cache[10] = e => updateFontStyle('align', e.target.value))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"left\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"center\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextCenter)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"right\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }, 8, [\"value\"])\n ]))\n}\n}\n\n})","import script from \"./MultiStylePanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MultiStylePanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MultiStylePanel.vue?vue&type=style&index=0&id=71469855&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-71469855\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nconst _hoisted_1 = { class: \"element-style-panel\" }\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { ElementTypes } from '@/types/slides'\n\nimport TextStylePanel from './TextStylePanel.vue'\nimport ImageStylePanel from './ImageStylePanel.vue'\nimport ShapeStylePanel from './ShapeStylePanel.vue'\nimport LineStylePanel from './LineStylePanel.vue'\nimport ChartStylePanel from './ChartStylePanel/index.vue'\nimport TableStylePanel from './TableStylePanel.vue'\nimport LatexStylePanel from './LatexStylePanel.vue'\nimport VideoStylePanel from './VideoStylePanel.vue'\nimport AudioStylePanel from './AudioStylePanel.vue'\nimport MultiStylePanel from './MultiStylePanel.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst panelMap = {\n [ElementTypes.TEXT]: TextStylePanel,\n [ElementTypes.IMAGE]: ImageStylePanel,\n [ElementTypes.SHAPE]: ShapeStylePanel,\n [ElementTypes.LINE]: LineStylePanel,\n [ElementTypes.CHART]: ChartStylePanel,\n [ElementTypes.TABLE]: TableStylePanel,\n [ElementTypes.LATEX]: LatexStylePanel,\n [ElementTypes.VIDEO]: VideoStylePanel,\n [ElementTypes.AUDIO]: AudioStylePanel,\n}\n\nconst { activeElementIdList, activeElementList, handleElement, activeGroupElementId } = storeToRefs(useMainStore())\n\nconst currentPanelComponent = computed(() => {\n if (activeElementIdList.value.length > 1) {\n if (!activeGroupElementId.value) return MultiStylePanel\n\n const activeGroupElement = activeElementList.value.find(item => item.id === activeGroupElementId.value)\n return activeGroupElement ? (panelMap[activeGroupElement.type] || null) : null\n }\n\n return handleElement.value ? (panelMap[handleElement.value.type] || null) : null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentPanelComponent))))\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, unref as _unref, withCtx as _withCtx, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, Fragment as _Fragment, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createStaticVNode as _createStaticVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-43e5f476\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-positopn-panel\" }\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"层级:\", -1))\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\" 置于顶层\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\" 置于底层\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\" 上移一层\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\" 下移一层\")\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"对齐:\", -1))\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"3\"} }, \"位置:\", -1))\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"1\"} }, null, -1))\nconst _hoisted_11 = /*#__PURE__*/_createStaticVNode(\"
X
Y
\", 1)\nconst _hoisted_12 = { class: \"row\" }\nconst _hoisted_13 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"3\"} }, \"大小:\", -1))\nconst _hoisted_14 = {\n key: 1,\n style: {\"flex\":\"1\"}\n}\nconst _hoisted_15 = /*#__PURE__*/_createStaticVNode(\"
\", 1)\nconst _hoisted_16 = { class: \"row\" }\nconst _hoisted_17 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"3\"} }, \"旋转:\", -1))\nconst _hoisted_18 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"1\"} }, null, -1))\n\nimport { computed, ref, watch } from 'vue'\nimport { round } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { ElementAlignCommands, ElementOrderCommands } from '@/types/edit'\nimport { MIN_SIZE } from '@/configs/element'\nimport { SHAPE_PATH_FORMULAS } from '@/configs/shapes'\nimport useOrderElement from '@/hooks/useOrderElement'\nimport useAlignElementToCanvas from '@/hooks/useAlignElementToCanvas'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementPositionPanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId } = storeToRefs(useMainStore())\n\nconst left = ref(0)\nconst top = ref(0)\nconst width = ref(0)\nconst height = ref(0)\nconst rotate = ref(0)\nconst fixedRatio = ref(false)\n\nconst minSize = computed(() => {\n if (!handleElement.value) return 20\n return MIN_SIZE[handleElement.value.type] || 20\n})\n\nwatch(handleElement, () => {\n if (!handleElement.value) return\n\n left.value = round(handleElement.value.left, 1)\n top.value = round(handleElement.value.top, 1)\n\n fixedRatio.value = 'fixedRatio' in handleElement.value && !!handleElement.value.fixedRatio\n\n if (handleElement.value.type !== 'line') {\n width.value = round(handleElement.value.width, 1)\n height.value = round(handleElement.value.height, 1)\n rotate.value = 'rotate' in handleElement.value && handleElement.value.rotate !== undefined ? round(handleElement.value.rotate, 1) : 0\n }\n}, { deep: true, immediate: true })\n\nconst { orderElement } = useOrderElement()\nconst { alignElementToCanvas } = useAlignElementToCanvas()\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 设置元素位置\nconst updateLeft = (value: number) => {\n const props = { left: value }\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\nconst updateTop = (value: number) => {\n const props = { top: value }\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 设置元素宽度、高度、旋转角度\n// 对形状设置宽高时,需要检查是否需要更新形状路径\nconst updateShapePathData = (width: number, height: number) => {\n if (handleElement.value && handleElement.value.type === 'shape' && 'pathFormula' in handleElement.value && handleElement.value.pathFormula) {\n const pathFormula = SHAPE_PATH_FORMULAS[handleElement.value.pathFormula]\n\n let path = ''\n if ('editable' in pathFormula) path = pathFormula.formula(width, height, handleElement.value.keypoint!)\n else path = pathFormula.formula(width, height)\n\n return {\n viewBox: [width, height],\n path,\n }\n }\n return null\n}\nconst updateWidth = (value: number) => {\n let props = { width: value }\n const shapePathData = updateShapePathData(value, height.value)\n if (shapePathData) props = { ...props, ...shapePathData }\n\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\nconst updateHeight = (value: number) => {\n let props = { height: value }\n const shapePathData = updateShapePathData(width.value, value)\n if (shapePathData) props = { ...props, ...shapePathData }\n\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\nconst updateRotate = (value: number) => {\n const props = { rotate: value }\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 固定元素的宽高比\nconst updateFixedRatio = (value: boolean) => {\n const props = { fixedRatio: value }\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\n// 将元素旋转45度(顺时针或逆时针)\nconst updateRotate45 = (command: '+' | '-') => {\n let _rotate = Math.floor(rotate.value / 45) * 45\n if (command === '+') _rotate = _rotate + 45\n else if (command === '-') _rotate = _rotate - 45\n\n if (_rotate < -180) _rotate = -180\n if (_rotate > 180) _rotate = 180\n\n const props = { rotate: _rotate }\n slidesStore.updateElement({ id: handleElementId.value, props })\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconSendToBack = _resolveComponent(\"IconSendToBack\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_IconBringToFrontOne = _resolveComponent(\"IconBringToFrontOne\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconBringToFront = _resolveComponent(\"IconBringToFront\")!\n const _component_IconSentToBack = _resolveComponent(\"IconSentToBack\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconAlignLeft = _resolveComponent(\"IconAlignLeft\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconAlignVertically = _resolveComponent(\"IconAlignVertically\")!\n const _component_IconAlignRight = _resolveComponent(\"IconAlignRight\")!\n const _component_IconAlignTop = _resolveComponent(\"IconAlignTop\")!\n const _component_IconAlignHorizontally = _resolveComponent(\"IconAlignHorizontally\")!\n const _component_IconAlignBottom = _resolveComponent(\"IconAlignBottom\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_IconLock = _resolveComponent(\"IconLock\")!\n const _component_IconUnlock = _resolveComponent(\"IconUnlock\")!\n const _component_IconRotate = _resolveComponent(\"IconRotate\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _hoisted_2,\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).TOP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconSendToBack, { class: \"btn-icon\" }),\n _hoisted_3\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).BOTTOM)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconBringToFrontOne, { class: \"btn-icon\" }),\n _hoisted_4\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).UP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconBringToFront, { class: \"btn-icon\" }),\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[3] || (_cache[3] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).DOWN)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconSentToBack, { class: \"btn-icon\" }),\n _hoisted_6\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _hoisted_7,\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[4] || (_cache[4] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).LEFT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"水平居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[5] || (_cache[5] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).HORIZONTAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignVertically)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[6] || (_cache[6] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).RIGHT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"上对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[7] || (_cache[7] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).TOP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTop)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"垂直居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[8] || (_cache[8] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).VERTICAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignHorizontally)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[9] || (_cache[9] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).BOTTOM)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignBottom)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_InputNumber, {\n step: 5,\n value: left.value,\n onChange: _cache[10] || (_cache[10] = value => updateLeft(value as number)),\n style: {\"flex\":\"4\"}\n }, null, 8, [\"value\"]),\n _hoisted_10,\n _createVNode(_component_InputNumber, {\n step: 5,\n value: top.value,\n onChange: _cache[11] || (_cache[11] = value => updateTop(value as number)),\n style: {\"flex\":\"4\"}\n }, null, 8, [\"value\"])\n ]),\n _hoisted_11,\n (_unref(handleElement)!.type !== 'line')\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_12, [\n _hoisted_13,\n _createVNode(_component_InputNumber, {\n min: _unref(minSize),\n max: 1500,\n step: 5,\n value: width.value,\n onChange: _cache[12] || (_cache[12] = value => updateWidth(value as number)),\n style: {\"flex\":\"4\"}\n }, null, 8, [\"min\", \"value\"]),\n (['image', 'shape', 'audio'].includes(_unref(handleElement)!.type))\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (fixedRatio.value)\n ? (_openBlock(), _createBlock(_component_Tooltip, {\n key: 0,\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"解除宽高比锁定\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconLock, {\n style: {\"flex\":\"1\"},\n class: \"icon-btn\",\n onClick: _cache[13] || (_cache[13] = ($event: any) => (updateFixedRatio(false)))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]))\n : (_openBlock(), _createBlock(_component_Tooltip, {\n key: 1,\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"宽高比锁定\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconUnlock, {\n style: {\"flex\":\"1\"},\n class: \"icon-btn\",\n onClick: _cache[14] || (_cache[14] = ($event: any) => (updateFixedRatio(true)))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]))\n ], 64))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_14)),\n _createVNode(_component_InputNumber, {\n min: _unref(minSize),\n max: 800,\n step: 5,\n disabled: _unref(handleElement)!.type === 'text',\n value: height.value,\n onChange: _cache[15] || (_cache[15] = value => updateHeight(value as number)),\n style: {\"flex\":\"4\"}\n }, null, 8, [\"min\", \"disabled\", \"value\"])\n ]),\n _hoisted_15\n ], 64))\n : _createCommentVNode(\"\", true),\n (!['line', 'video', 'audio'].includes(_unref(handleElement)!.type))\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_16, [\n _hoisted_17,\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"逆时针旋转\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconRotate, {\n class: \"icon-btn\",\n onClick: _cache[16] || (_cache[16] = ($event: any) => (updateRotate45('-'))),\n style: {\"flex\":\"2\"}\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"顺时针旋转\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconRotate, {\n class: \"icon-btn\",\n onClick: _cache[17] || (_cache[17] = ($event: any) => (updateRotate45('+'))),\n style: _normalizeStyle({\n flex: 2,\n transform: 'rotateY(180deg)',\n })\n }, null, 8, [\"style\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _hoisted_18,\n _createVNode(_component_InputNumber, {\n min: -180,\n max: 180,\n step: 5,\n value: rotate.value,\n onChange: _cache[18] || (_cache[18] = value => updateRotate(value as number)),\n style: {\"flex\":\"4\"}\n }, null, 8, [\"value\"])\n ])\n ], 64))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./ElementPositionPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementPositionPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementPositionPanel.vue?vue&type=style&index=0&id=43e5f476&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-43e5f476\"]])\n\nexport default __exports__","export const ANIMATION_DEFAULT_DURATION = 1000\r\nexport const ANIMATION_DEFAULT_TRIGGER = 'click'\r\nexport const ANIMATION_CLASS_PREFIX = 'animate__'\r\n\r\nexport const ENTER_ANIMATIONS = [\r\n {\r\n type: 'bounce',\r\n name: '弹跳',\r\n children: [\r\n { name: '弹入', value: 'bounceIn' },\r\n { name: '向右弹入', value: 'bounceInLeft' },\r\n { name: '向左弹入', value: 'bounceInRight' },\r\n { name: '向上弹入', value: 'bounceInUp' },\r\n { name: '向下弹入', value: 'bounceInDown' },\r\n ],\r\n },\r\n {\r\n type: 'fade',\r\n name: '浮现',\r\n children: [\r\n { name: '浮入', value: 'fadeIn' },\r\n { name: '向下浮入', value: 'fadeInDown' },\r\n { name: '向下长距浮入', value: 'fadeInDownBig' },\r\n { name: '向右浮入', value: 'fadeInLeft' },\r\n { name: '向右长距浮入', value: 'fadeInLeftBig' },\r\n { name: '向左浮入', value: 'fadeInRight' },\r\n { name: '向左长距浮入', value: 'fadeInRightBig' },\r\n { name: '向上浮入', value: 'fadeInUp' },\r\n { name: '向上长距浮入', value: 'fadeInUpBig' },\r\n { name: '从左上浮入', value: 'fadeInTopLeft' },\r\n { name: '从右上浮入', value: 'fadeInTopRight' },\r\n { name: '从左下浮入', value: 'fadeInBottomLeft' },\r\n { name: '从右下浮入', value: 'fadeInBottomRight' },\r\n ],\r\n },\r\n {\r\n type: 'rotate',\r\n name: '旋转',\r\n children: [\r\n { name: '旋转进入', value: 'rotateIn' },\r\n { name: '绕左下进入', value: 'rotateInDownLeft' },\r\n { name: '绕右下进入', value: 'rotateInDownRight' },\r\n { name: '绕左上进入', value: 'rotateInUpLeft' },\r\n { name: '绕右上进入', value: 'rotateInUpRight' },\r\n ],\r\n },\r\n {\r\n type: 'zoom',\r\n name: '缩放',\r\n children: [\r\n { name: '放大进入', value: 'zoomIn' },\r\n { name: '向下放大进入', value: 'zoomInDown' },\r\n { name: '从左放大进入', value: 'zoomInLeft' },\r\n { name: '从右放大进入', value: 'zoomInRight' },\r\n { name: '向上放大进入', value: 'zoomInUp' },\r\n ],\r\n },\r\n {\r\n type: 'slide',\r\n name: '滑入',\r\n children: [\r\n { name: '向下滑入', value: 'slideInDown' },\r\n { name: '从右滑入', value: 'slideInLeft' },\r\n { name: '从左滑入', value: 'slideInRight' },\r\n { name: '向上滑入', value: 'slideInUp' },\r\n ],\r\n },\r\n {\r\n type: 'flip',\r\n name: '翻转',\r\n children: [\r\n { name: 'X轴翻转进入', value: 'flipInX' },\r\n { name: 'Y轴翻转进入', value: 'flipInY' },\r\n ],\r\n },\r\n {\r\n type: 'back',\r\n name: '放大滑入',\r\n children: [\r\n { name: '向下放大滑入', value: 'backInDown' },\r\n { name: '从左放大滑入', value: 'backInLeft' },\r\n { name: '从右放大滑入', value: 'backInRight' },\r\n { name: '向上放大滑入', value: 'backInUp' },\r\n ],\r\n },\r\n {\r\n type: 'lightSpeed',\r\n name: '飞入',\r\n children: [\r\n { name: '从右飞入', value: 'lightSpeedInRight' },\r\n { name: '从左飞入', value: 'lightSpeedInLeft' },\r\n ],\r\n },\r\n]\r\n\r\nexport const EXIT_ANIMATIONS = [\r\n {\r\n type: 'bounce',\r\n name: '弹跳',\r\n children: [\r\n { name: '弹出', value: 'bounceOut' },\r\n { name: '向左弹出', value: 'bounceOutLeft' },\r\n { name: '向右弹出', value: 'bounceOutRight' },\r\n { name: '向上弹出', value: 'bounceOutUp' },\r\n { name: '向下弹出', value: 'bounceOutDown' },\r\n ],\r\n },\r\n {\r\n type: 'fade',\r\n name: '浮现',\r\n children: [\r\n { name: '浮出', value: 'fadeOut' },\r\n { name: '向下浮出', value: 'fadeOutDown' },\r\n { name: '向下长距浮出', value: 'fadeOutDownBig' },\r\n { name: '向左浮出', value: 'fadeOutLeft' },\r\n { name: '向左长距浮出', value: 'fadeOutLeftBig' },\r\n { name: '向右浮出', value: 'fadeOutRight' },\r\n { name: '向右长距浮出', value: 'fadeOutRightBig' },\r\n { name: '向上浮出', value: 'fadeOutUp' },\r\n { name: '向上长距浮出', value: 'fadeOutUpBig' },\r\n { name: '从左上浮出', value: 'fadeOutTopLeft' },\r\n { name: '从右上浮出', value: 'fadeOutTopRight' },\r\n { name: '从左下浮出', value: 'fadeOutBottomLeft' },\r\n { name: '从右下浮出', value: 'fadeOutBottomRight' },\r\n ],\r\n },\r\n {\r\n type: 'rotate',\r\n name: '旋转',\r\n children: [\r\n { name: '旋转退出', value: 'rotateOut' },\r\n { name: '绕左下退出', value: 'rotateOutDownLeft' },\r\n { name: '绕右下退出', value: 'rotateOutDownRight' },\r\n { name: '绕左上退出', value: 'rotateOutUpLeft' },\r\n { name: '绕右上退出', value: 'rotateOutUpRight' },\r\n ],\r\n },\r\n {\r\n type: 'zoom',\r\n name: '缩放',\r\n children: [\r\n { name: '缩小退出', value: 'zoomOut' },\r\n { name: '向下缩小退出', value: 'zoomOutDown' },\r\n { name: '从左缩小退出', value: 'zoomOutLeft' },\r\n { name: '从右缩小退出', value: 'zoomOutRight' },\r\n { name: '向上缩小退出', value: 'zoomOutUp' },\r\n ],\r\n },\r\n {\r\n type: 'slide',\r\n name: '滑出',\r\n children: [\r\n { name: '向下滑出', value: 'slideOutDown' },\r\n { name: '从左滑出', value: 'slideOutLeft' },\r\n { name: '从右滑出', value: 'slideOutRight' },\r\n { name: '向上滑出', value: 'slideOutUp' },\r\n ],\r\n },\r\n {\r\n type: 'flip',\r\n name: '翻转',\r\n children: [\r\n { name: 'X轴翻转退出', value: 'flipOutX' },\r\n { name: 'Y轴翻转退出', value: 'flipOutY' },\r\n ],\r\n },\r\n {\r\n type: 'back',\r\n name: '缩小滑出',\r\n children: [\r\n { name: '向下缩小滑出', value: 'backOutDown' },\r\n { name: '从左缩小滑出', value: 'backOutLeft' },\r\n { name: '从右缩小滑出', value: 'backOutRight' },\r\n { name: '向上缩小滑出', value: 'backOutUp' },\r\n ],\r\n },\r\n {\r\n type: 'lightSpeed',\r\n name: '飞出',\r\n children: [\r\n { name: '从右飞出', value: 'lightSpeedOutRight' },\r\n { name: '从左飞出', value: 'lightSpeedOutLeft' },\r\n ],\r\n },\r\n]\r\n\r\nexport const ATTENTION_ANIMATIONS = [\r\n {\r\n type: 'shake',\r\n name: '晃动',\r\n children: [\r\n { name: '左右摇晃', value: 'shakeX' },\r\n { name: '上下摇晃', value: 'shakeY' },\r\n { name: '摇头', value: 'headShake' },\r\n { name: '摆动', value: 'swing' },\r\n { name: '晃动', value: 'wobble' },\r\n { name: '惊恐', value: 'tada' },\r\n { name: '果冻', value: 'jello' },\r\n ],\r\n },\r\n {\r\n type: 'other',\r\n name: '其他',\r\n children: [\r\n { name: '弹跳', value: 'bounce' },\r\n { name: '闪烁', value: 'flash' },\r\n { name: '脉搏', value: 'pulse' },\r\n { name: '橡皮筋', value: 'rubberBand' },\r\n { name: '心跳(快)', value: 'heartBeat' },\r\n ],\r\n },\r\n]","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-2f69234f\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-animation-panel\" }\nconst _hoisted_2 = {\n key: 0,\n class: \"element-animation\"\n}\nconst _hoisted_3 = { class: \"tabs\" }\nconst _hoisted_4 = [\"onClick\"]\nconst _hoisted_5 = { class: \"type-title\" }\nconst _hoisted_6 = { class: \"pool-item-wrapper\" }\nconst _hoisted_7 = [\"onMouseenter\", \"onClick\"]\nconst _hoisted_8 = {\n key: 0,\n class: \"mask\"\n}\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\" 添加动画 \")\nconst _hoisted_10 = {\n key: 1,\n class: \"tip\"\n}\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\" 选中画布中的元素添加动画\")\nconst _hoisted_12 = { class: \"sequence-content\" }\nconst _hoisted_13 = { class: \"index\" }\nconst _hoisted_14 = { class: \"text\" }\nconst _hoisted_15 = { class: \"handler\" }\nconst _hoisted_16 = {\n key: 0,\n class: \"configs\"\n}\nconst _hoisted_17 = { class: \"config-item\" }\nconst _hoisted_18 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"3\"} }, \"持续时长:\", -1))\nconst _hoisted_19 = { class: \"config-item\" }\nconst _hoisted_20 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"3\"} }, \"触发方式:\", -1))\nconst _hoisted_21 = /*#__PURE__*/_createTextVNode(\"主动触发\")\nconst _hoisted_22 = /*#__PURE__*/_createTextVNode(\"与上一动画同时\")\nconst _hoisted_23 = /*#__PURE__*/_createTextVNode(\"上一动画之后\")\nconst _hoisted_24 = { class: \"config-item\" }\nconst _hoisted_25 = /*#__PURE__*/_createTextVNode(\"更换动画\")\n\nimport { computed, ref, watch } from 'vue'\nimport { nanoid } from 'nanoid'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTAnimation } from '@/types/slides'\nimport { \n ENTER_ANIMATIONS,\n EXIT_ANIMATIONS,\n ATTENTION_ANIMATIONS,\n ANIMATION_DEFAULT_DURATION,\n ANIMATION_DEFAULT_TRIGGER,\n ANIMATION_CLASS_PREFIX,\n} from '@/configs/animation'\nimport { ELEMENT_TYPE_ZH } from '@/configs/element'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport Draggable from 'vuedraggable'\n\ntype AnimationType = 'in' | 'out' | 'attention'\ninterface TabItem {\n key: AnimationType\n label: string\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementAnimationPanel',\n setup(__props) {\n\nconst animationEffects: { [key: string]: string } = {}\nfor (const effect of ENTER_ANIMATIONS) {\n for (const animation of effect.children) {\n animationEffects[animation.value] = animation.name\n }\n}\nfor (const effect of EXIT_ANIMATIONS) {\n for (const animation of effect.children) {\n animationEffects[animation.value] = animation.name\n }\n}\nfor (const effect of ATTENTION_ANIMATIONS) {\n for (const animation of effect.children) {\n animationEffects[animation.value] = animation.name\n }\n}\n\nconst animationTypes: AnimationType[] = ['in', 'out', 'attention']\n\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId } = storeToRefs(useMainStore())\nconst { currentSlide, formatedAnimations, currentSlideAnimations } = storeToRefs(slidesStore)\n\nconst tabs: TabItem[] = [\n { key: 'in', label: '入场' },\n { key: 'out', label: '退场' },\n { key: 'attention', label: '强调' },\n]\nconst activeTab = ref('in')\n\nwatch(() => handleElementId.value, () => {\n animationPoolVisible.value = false\n})\n\nconst hoverPreviewAnimation = ref('')\nconst animationPoolVisible = ref(false)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 当前页面的动画列表\nconst animationSequence = computed(() => {\n const animationSequence = []\n for (let i = 0; i < formatedAnimations.value.length; i++) {\n const item = formatedAnimations.value[i]\n for (let j = 0; j < item.animations.length; j++) {\n const animation = item.animations[j]\n const el = currentSlide.value.elements.find(el => el.id === animation.elId)\n if (!el) continue\n\n const elType = ELEMENT_TYPE_ZH[el.type]\n const animationEffect = animationEffects[animation.effect]\n animationSequence.push({\n ...animation,\n index: j === 0 ? i + 1 : '',\n elType,\n animationEffect,\n })\n }\n }\n return animationSequence\n})\n\n// 当前选中元素的入场动画信息\nconst handleElementAnimation = computed(() => {\n const animations = currentSlideAnimations.value\n const animation = animations.filter(item => item.elId === handleElementId.value)\n return animation || []\n})\n\n// 删除元素动画\nconst deleteAnimation = (id: string) => {\n const animations = currentSlideAnimations.value.filter(item => item.id !== id)\n slidesStore.updateSlide({ animations })\n addHistorySnapshot()\n}\n\n// 拖拽修改动画顺序后同步数据\nconst handleDragEnd = (eventData: { newIndex: number; oldIndex: number }) => {\n const { newIndex, oldIndex } = eventData\n if (oldIndex === newIndex) return\n\n const animations: PPTAnimation[] = JSON.parse(JSON.stringify(currentSlideAnimations.value))\n const animation = animations[oldIndex]\n animations.splice(oldIndex, 1)\n animations.splice(newIndex, 0, animation)\n \n slidesStore.updateSlide({ animations })\n addHistorySnapshot()\n}\n\n// 执行动画预览\nconst runAnimation = (elId: string, effect: string, duration: number) => {\n const elRef = document.querySelector(`#editable-element-${elId} [class^=editable-element-]`)\n if (elRef) {\n const animationName = `${ANIMATION_CLASS_PREFIX}${effect}`\n document.documentElement.style.setProperty('--animate-duration', `${duration}ms`)\n elRef.classList.add(`${ANIMATION_CLASS_PREFIX}animated`, animationName)\n\n const handleAnimationEnd = () => {\n document.documentElement.style.removeProperty('--animate-duration')\n elRef.classList.remove(`${ANIMATION_CLASS_PREFIX}animated`, animationName)\n }\n elRef.addEventListener('animationend', handleAnimationEnd, { once: true })\n }\n}\n\n// 修改元素动画持续时间\nconst updateElementAnimationDuration = (id: string, duration: number) => {\n if (duration < 100 || duration > 5000) return\n\n const animations = currentSlideAnimations.value.map(item => {\n if (item.id === id) return { ...item, duration }\n return item\n })\n slidesStore.updateSlide({ animations })\n addHistorySnapshot()\n}\n\n// 修改触发方式\nconst updateElementAnimationTrigger = (id: string, trigger: 'click' | 'meantime' | 'auto') => {\n const animations = currentSlideAnimations.value.map(item => {\n if (item.id === id) return { ...item, trigger }\n return item\n })\n slidesStore.updateSlide({ animations })\n addHistorySnapshot()\n}\n\n// 修改元素动画,并执行一次预览\nconst updateElementAnimation = (type: AnimationType, effect: string) => {\n const animations = currentSlideAnimations.value.map(item => {\n if (item.id === handleAnimationId.value) return { ...item, type, effect }\n return item\n })\n slidesStore.updateSlide({ animations })\n animationPoolVisible.value = false\n addHistorySnapshot()\n\n const animationItem = currentSlideAnimations.value.find(item => item.elId === handleElementId.value)\n const duration = animationItem?.duration || ANIMATION_DEFAULT_DURATION\n\n runAnimation(handleElementId.value, effect, duration)\n}\n\nconst handleAnimationId = ref('')\n// 添加元素动画,并执行一次预览\nconst addAnimation = (type: AnimationType, effect: string) => {\n if (handleAnimationId.value) {\n updateElementAnimation(type, effect)\n return\n }\n\n const animations: PPTAnimation[] = JSON.parse(JSON.stringify(currentSlideAnimations.value))\n animations.push({\n id: nanoid(10),\n elId: handleElementId.value,\n type,\n effect,\n duration: ANIMATION_DEFAULT_DURATION,\n trigger: ANIMATION_DEFAULT_TRIGGER,\n })\n slidesStore.updateSlide({ animations })\n animationPoolVisible.value = false\n addHistorySnapshot()\n\n runAnimation(handleElementId.value, effect, ANIMATION_DEFAULT_DURATION)\n}\n\n// 动画选择面板打开600ms后再移除遮罩层,否则打开面板后迅速滑入鼠标预览会导致抖动\nconst popoverMaskHide = ref(false)\nconst handlePopoverVisibleChange = (visible: boolean) => {\n if (visible) {\n setTimeout(() => popoverMaskHide.value = true, 600)\n }\n else popoverMaskHide.value = false\n}\n\nconst openAnimationPool = (elementId: string) => {\n animationPoolVisible.value = true\n handleAnimationId.value = elementId\n handlePopoverVisibleChange(true)\n}\n\nconst animations = {\n in: ENTER_ANIMATIONS,\n out: EXIT_ANIMATIONS,\n attention: ATTENTION_ANIMATIONS,\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconEffects = _resolveComponent(\"IconEffects\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconClick = _resolveComponent(\"IconClick\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconPlayOne = _resolveComponent(\"IconPlayOne\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconCloseSmall = _resolveComponent(\"IconCloseSmall\")!\n const _component_InputNumber = _resolveComponent(\"InputNumber\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_unref(handleElement))\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_2, [\n _createVNode(_component_Popover, {\n trigger: \"click\",\n visible: animationPoolVisible.value,\n \"onUpdate:visible\": _cache[2] || (_cache[2] = ($event: any) => ((animationPoolVisible).value = $event)),\n onVisibleChange: _cache[3] || (_cache[3] = visible => handlePopoverVisibleChange(visible))\n }, {\n content: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_3, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (tab) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass(['tab', tab.key, { 'active': activeTab.value === tab.key }]),\n key: tab.key,\n onClick: ($event: any) => (activeTab.value = tab.key)\n }, _toDisplayString(tab.label), 11, _hoisted_4)\n }), 64))\n ]),\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(animationTypes, (key) => {\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n (activeTab.value === key)\n ? (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass(['animation-pool', key]),\n key: key\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(animations[key], (effect) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"pool-type\",\n key: effect.name\n }, [\n _createElementVNode(\"div\", _hoisted_5, _toDisplayString(effect.name) + \":\", 1),\n _createElementVNode(\"div\", _hoisted_6, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(effect.children, (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"pool-item\",\n key: item.name,\n onMouseenter: ($event: any) => (hoverPreviewAnimation.value = item.value),\n onMouseleave: _cache[0] || (_cache[0] = ($event: any) => (hoverPreviewAnimation.value = '')),\n onClick: ($event: any) => (addAnimation(key, item.value))\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"animation-box\", [\n `${_unref(ANIMATION_CLASS_PREFIX)}animated`,\n `${_unref(ANIMATION_CLASS_PREFIX)}fast`,\n hoverPreviewAnimation.value === item.value && `${_unref(ANIMATION_CLASS_PREFIX)}${item.value}`,\n ]])\n }, _toDisplayString(item.name), 3)\n ], 40, _hoisted_7))\n }), 128))\n ])\n ]))\n }), 128)),\n (!popoverMaskHide.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_8))\n : _createCommentVNode(\"\", true)\n ], 2))\n : _createCommentVNode(\"\", true)\n ], 64))\n }), 64))\n ]),\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n class: \"element-animation-btn\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (handleAnimationId.value = ''))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconEffects, { style: {\"margin-right\":\"5px\"} }),\n _hoisted_9\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"visible\"])\n ]))\n : (_openBlock(), _createElementBlock(\"div\", _hoisted_10, [\n _createVNode(_component_IconClick, { style: {\"margin-right\":\"5px\"} }),\n _hoisted_11\n ])),\n _createVNode(_component_Divider),\n _createVNode(_unref(Draggable), {\n class: \"animation-sequence\",\n modelValue: _unref(animationSequence),\n animation: 300,\n scroll: true,\n scrollSensitivity: 50,\n handle: \".sequence-content\",\n onEnd: handleDragEnd,\n itemKey: \"id\"\n }, {\n item: _withCtx(({ element }) => [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"sequence-item\", [element.type, { 'active': _unref(handleElement)?.id === element.elId }]])\n }, [\n _createElementVNode(\"div\", _hoisted_12, [\n _createElementVNode(\"div\", _hoisted_13, _toDisplayString(element.index), 1),\n _createElementVNode(\"div\", _hoisted_14, \"【\" + _toDisplayString(element.elType) + \"】\" + _toDisplayString(element.animationEffect), 1),\n _createElementVNode(\"div\", _hoisted_15, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"预览\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPlayOne, {\n class: \"handler-btn\",\n onClick: ($event: any) => (runAnimation(element.elId, element.effect, element.duration))\n }, null, 8, [\"onClick\"])\n ]),\n _: 2\n }, 1032, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"删除\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconCloseSmall, {\n class: \"handler-btn\",\n onClick: ($event: any) => (deleteAnimation(element.id))\n }, null, 8, [\"onClick\"])\n ]),\n _: 2\n }, 1032, [\"mouseEnterDelay\"])\n ])\n ]),\n (_unref(handleElementAnimation)[0]?.elId === element.elId)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_16, [\n _createVNode(_component_Divider, { style: {\"margin\":\"16px 0\"} }),\n _createElementVNode(\"div\", _hoisted_17, [\n _hoisted_18,\n _createVNode(_component_InputNumber, {\n min: 500,\n max: 3000,\n step: 500,\n value: element.duration,\n onChange: value => updateElementAnimationDuration(element.id, value as number),\n style: {\"flex\":\"5\"}\n }, null, 8, [\"value\", \"onChange\"])\n ]),\n _createElementVNode(\"div\", _hoisted_19, [\n _hoisted_20,\n _createVNode(_component_Select, {\n value: element.trigger,\n onChange: value => updateElementAnimationTrigger(element.id, value as 'click' | 'meantime' | 'auto'),\n style: {\"flex\":\"5\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"click\" }, {\n default: _withCtx(() => [\n _hoisted_21\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"meantime\" }, {\n default: _withCtx(() => [\n _hoisted_22\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"auto\" }, {\n default: _withCtx(() => [\n _hoisted_23\n ]),\n _: 1\n })\n ]),\n _: 2\n }, 1032, [\"value\", \"onChange\"])\n ]),\n _createElementVNode(\"div\", _hoisted_24, [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: ($event: any) => (openAnimationPool(element.id))\n }, {\n default: _withCtx(() => [\n _hoisted_25\n ]),\n _: 2\n }, 1032, [\"onClick\"])\n ])\n ]))\n : _createCommentVNode(\"\", true)\n ], 2)\n ]),\n _: 1\n }, 8, [\"modelValue\"])\n ]))\n}\n}\n\n})","import script from \"./ElementAnimationPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementAnimationPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementAnimationPanel.vue?vue&type=style&index=0&id=2f69234f&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-2f69234f\"]])\n\nexport default __exports__","export const PRESET_THEMES = [\r\n { color: '#d14424', background: '#ffffff', text: '#333' },\r\n { color: '#42464b', background: '#ffffff', text: '#333' },\r\n { color: '#5d82ba', background: '#ffffff', text: '#333' },\r\n { color: '#005a6f', background: '#ffffff', text: '#333' },\r\n { color: '#d0614c', background: '#dfb044', text: '#333' },\r\n { color: '#86a1ad', background: '#dfdbd4', text: '#333' },\r\n { color: '#697586', background: '#d5c4a4', text: '#333' },\r\n { color: '#333333', background: '#7acfa6', text: '#333' },\r\n { color: '#42464b', background: '#415065', text: '#fff' },\r\n { color: '#0c5999', background: '#35a2cd', text: '#fff' },\r\n { color: '#c49a41', background: '#8c4357', text: '#fff' },\r\n { color: '#dfaa00', background: '#2e4e7d', text: '#fff' },\r\n { color: '#d1ad88', background: '#f99070', text: '#fff' },\r\n { color: '#464d52', background: '#657984', text: '#fff' },\r\n { color: '#ffcfb6', background: '#1e4c6f', text: '#fff' },\r\n { color: '#c3a043', background: '#43292a', text: '#fff' },\r\n { color: '#464d52', background: '#60546f', text: '#fff' },\r\n { color: '#df9636', background: '#5b89a0', text: '#fff' },\r\n { color: '#b898a4', background: '#93716b', text: '#fff' },\r\n { color: '#c47a11', background: '#187db1', text: '#fff' },\r\n { color: '#333333', background: '#759564', text: '#fff' },\r\n { color: '#355b5e', background: '#424b50', text: '#fff' },\r\n { color: '#d29090', background: '#942a32', text: '#fff' },\r\n { color: '#00cfdf', background: '#3b434d', text: '#fff' },\r\n { color: '#424246', background: '#c70042', text: '#fff' },\r\n { color: '#2e4155', background: '#b35d44', text: '#fff' },\r\n { color: '#11bfce', background: '#8f98aa', text: '#fff' },\r\n { color: '#333333', background: '#549688', text: '#fff' },\r\n]","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock, renderList as _renderList, Fragment as _Fragment, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-e0bbbd9e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"slide-design-panel\" }\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"背景填充\", -1))\nconst _hoisted_3 = { class: \"row\" }\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"纯色填充\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"图片填充\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"渐变填充\")\nconst _hoisted_7 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"1\"} }, null, -1))\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\"缩放\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"拼贴\")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"缩放铺满\")\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\"线性渐变\")\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"径向渐变\")\nconst _hoisted_13 = {\n key: 0,\n class: \"background-image-wrapper\"\n}\nconst _hoisted_14 = { class: \"background-image\" }\nconst _hoisted_15 = {\n key: 1,\n class: \"background-gradient-wrapper\"\n}\nconst _hoisted_16 = { class: \"row\" }\nconst _hoisted_17 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"起点颜色:\", -1))\nconst _hoisted_18 = { class: \"row\" }\nconst _hoisted_19 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"终点颜色:\", -1))\nconst _hoisted_20 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_21 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"渐变角度:\", -1))\nconst _hoisted_22 = { class: \"row\" }\nconst _hoisted_23 = /*#__PURE__*/_createTextVNode(\"应用背景到全部\")\nconst _hoisted_24 = { class: \"row\" }\nconst _hoisted_25 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"画布尺寸:\", -1))\nconst _hoisted_26 = /*#__PURE__*/_createTextVNode(\"宽屏 16 : 9\")\nconst _hoisted_27 = /*#__PURE__*/_createTextVNode(\"宽屏 16 :10\")\nconst _hoisted_28 = /*#__PURE__*/_createTextVNode(\"标准 4 :3\")\nconst _hoisted_29 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"全局主题\", -1))\nconst _hoisted_30 = { class: \"row\" }\nconst _hoisted_31 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"字体:\", -1))\nconst _hoisted_32 = { class: \"row\" }\nconst _hoisted_33 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"字体颜色:\", -1))\nconst _hoisted_34 = { class: \"row\" }\nconst _hoisted_35 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"背景颜色:\", -1))\nconst _hoisted_36 = { class: \"row\" }\nconst _hoisted_37 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { style: {\"flex\":\"2\"} }, \"主题色:\", -1))\nconst _hoisted_38 = /*#__PURE__*/_createTextVNode(\" 预置主题 \")\nconst _hoisted_39 = {\n key: 2,\n class: \"theme-list\"\n}\nconst _hoisted_40 = [\"onClick\"]\nconst _hoisted_41 = { class: \"theme-item-content\" }\nconst _hoisted_42 = { class: \"row\" }\nconst _hoisted_43 = /*#__PURE__*/_createTextVNode(\"应用主题到全部\")\n\nimport { computed, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { Slide, SlideBackground, SlideTheme } from '@/types/slides'\nimport { PRESET_THEMES } from '@/configs/theme'\nimport { WEB_FONTS } from '@/configs/font'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\nimport ColorButton from './common/ColorButton.vue'\nimport { getImageDataURL } from '@/utils/image'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SlideDesignPanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { availableFonts } = storeToRefs(useMainStore())\nconst { slides, currentSlide, viewportRatio, theme } = storeToRefs(slidesStore)\n\nconst background = computed(() => {\n if (!currentSlide.value.background) {\n return {\n type: 'solid',\n value: '#fff',\n } as SlideBackground\n }\n return currentSlide.value.background\n})\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 设置背景模式:纯色、图片、渐变色\nconst updateBackgroundType = (type: 'solid' | 'image' | 'gradient') => {\n if (type === 'solid') {\n const newBackground: SlideBackground = {\n ...background.value,\n type: 'solid',\n color: background.value.color || '#fff',\n }\n slidesStore.updateSlide({ background: newBackground })\n }\n else if (type === 'image') {\n const newBackground: SlideBackground = {\n ...background.value,\n type: 'image',\n image: background.value.image || '',\n imageSize: background.value.imageSize || 'cover',\n }\n slidesStore.updateSlide({ background: newBackground })\n }\n else {\n const newBackground: SlideBackground = {\n ...background.value,\n type: 'gradient',\n gradientType: background.value.gradientType || 'linear',\n gradientColor: background.value.gradientColor || ['#fff', '#fff'],\n gradientRotate: background.value.gradientRotate || 0,\n }\n slidesStore.updateSlide({ background: newBackground })\n }\n addHistorySnapshot()\n}\n\n// 设置背景图片\nconst updateBackground = (props: Partial) => {\n slidesStore.updateSlide({ background: { ...background.value, ...props } })\n addHistorySnapshot()\n}\n\n// 上传背景图片\nconst uploadBackgroundImage = (files: FileList) => {\n const imageFile = files[0]\n if (!imageFile) return\n getImageDataURL(imageFile).then(dataURL => updateBackground({ image: dataURL }))\n}\n\n// 应用当前页背景到全部页面\nconst applyBackgroundAllSlide = () => {\n const newSlides = slides.value.map(slide => {\n return {\n ...slide,\n background: currentSlide.value.background,\n }\n })\n slidesStore.setSlides(newSlides)\n addHistorySnapshot()\n}\n\n// 设置主题\nconst updateTheme = (themeProps: Partial) => {\n slidesStore.setTheme(themeProps)\n}\n\n// 将当前主题应用到全部页面\nconst applyThemeAllSlide = () => {\n const newSlides: Slide[] = JSON.parse(JSON.stringify(slides.value))\n const { themeColor, backgroundColor, fontColor, fontName } = theme.value\n\n for (const slide of newSlides) {\n if (!slide.background || slide.background.type !== 'image') {\n slide.background = {\n ...slide.background,\n type: 'solid',\n color: backgroundColor\n }\n }\n\n const elements = slide.elements\n for (const el of elements) {\n if (el.type === 'shape') el.fill = themeColor\n else if (el.type === 'line') el.color = themeColor\n else if (el.type === 'text') {\n el.defaultColor = fontColor\n el.defaultFontName = fontName\n if (el.fill) el.fill = themeColor\n }\n else if (el.type === 'table') {\n if (el.theme) el.theme.color = themeColor\n for (const rowCells of el.data) {\n for (const cell of rowCells) {\n if (cell.style) {\n cell.style.color = fontColor\n cell.style.fontname = fontName\n }\n }\n }\n }\n else if (el.type === 'chart') {\n el.themeColor = [themeColor]\n el.gridColor = fontColor\n }\n else if (el.type === 'latex') el.color = fontColor\n else if (el.type === 'audio') el.color = themeColor\n }\n }\n slidesStore.setSlides(newSlides)\n addHistorySnapshot()\n}\n\n// 是否显示预设主题\nconst showPresetThemes = ref(true)\nconst togglePresetThemesVisible = () => {\n showPresetThemes.value = !showPresetThemes.value\n}\n\n// 设置画布尺寸(宽高比例)\nconst updateViewportRatio = (value: number) => {\n slidesStore.setViewportRatio(value)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_ColorPicker = _resolveComponent(\"ColorPicker\")!\n const _component_Popover = _resolveComponent(\"Popover\")!\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_SelectOptGroup = _resolveComponent(\"SelectOptGroup\")!\n const _component_IconDown = _resolveComponent(\"IconDown\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _hoisted_2,\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_Select, {\n style: {\"flex\":\"10\"},\n value: _unref(background).type,\n onChange: _cache[0] || (_cache[0] = value => updateBackgroundType(value as 'gradient' | 'image' | 'solid'))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"solid\" }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"image\" }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"gradient\" }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _hoisted_7,\n (_unref(background).type === 'solid')\n ? (_openBlock(), _createBlock(_component_Popover, {\n key: 0,\n trigger: \"click\"\n }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(background).color,\n \"onUpdate:modelValue\": _cache[1] || (_cache[1] = color => updateBackground({ color }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(background).color || '#fff',\n style: {\"flex\":\"10\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n }))\n : (_unref(background).type === 'image')\n ? (_openBlock(), _createBlock(_component_Select, {\n key: 1,\n style: {\"flex\":\"10\"},\n value: _unref(background).imageSize || 'cover',\n onChange: _cache[2] || (_cache[2] = value => updateBackground({ imageSize: value as 'repeat' | 'cover' | 'contain' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"contain\" }, {\n default: _withCtx(() => [\n _hoisted_8\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"repeat\" }, {\n default: _withCtx(() => [\n _hoisted_9\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"cover\" }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]))\n : (_openBlock(), _createBlock(_component_Select, {\n key: 2,\n style: {\"flex\":\"10\"},\n value: _unref(background).gradientType,\n onChange: _cache[3] || (_cache[3] = value => updateBackground({ gradientType: value as 'linear' | 'radial' }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: \"linear\" }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: \"radial\" }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]))\n ]),\n (_unref(background).type === 'image')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_13, [\n _createVNode(_component_FileInput, {\n onChange: _cache[4] || (_cache[4] = files => uploadBackgroundImage(files))\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", _hoisted_14, [\n _createElementVNode(\"div\", {\n class: \"content\",\n style: _normalizeStyle({ backgroundImage: `url(${_unref(background).image})` })\n }, [\n _createVNode(_component_IconPlus)\n ], 4)\n ])\n ]),\n _: 1\n })\n ]))\n : _createCommentVNode(\"\", true),\n (_unref(background).type === 'gradient')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_15, [\n _createElementVNode(\"div\", _hoisted_16, [\n _hoisted_17,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(background).gradientColor![0],\n \"onUpdate:modelValue\": _cache[5] || (_cache[5] = value => updateBackground({ gradientColor: [value, _unref(background).gradientColor![1]] }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(background).gradientColor![0],\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_18, [\n _hoisted_19,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(background).gradientColor![1],\n \"onUpdate:modelValue\": _cache[6] || (_cache[6] = value => updateBackground({ gradientColor: [_unref(background).gradientColor![0], value] }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(background).gradientColor![1],\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n (_unref(background).gradientType === 'linear')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_20, [\n _hoisted_21,\n _createVNode(_component_Slider, {\n class: \"slider\",\n min: 0,\n max: 360,\n step: 15,\n value: _unref(background).gradientRotate,\n onChange: _cache[7] || (_cache[7] = value => updateBackground({ gradientRotate: value as number }))\n }, null, 8, [\"value\"])\n ]))\n : _createCommentVNode(\"\", true)\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_22, [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[8] || (_cache[8] = ($event: any) => (applyBackgroundAllSlide()))\n }, {\n default: _withCtx(() => [\n _hoisted_23\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_Divider),\n _createElementVNode(\"div\", _hoisted_24, [\n _hoisted_25,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(viewportRatio),\n onChange: _cache[9] || (_cache[9] = value => updateViewportRatio(value as number))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: 0.5625 }, {\n default: _withCtx(() => [\n _hoisted_26\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_SelectOption, { value: 0.625 }, {\n default: _withCtx(() => [\n _hoisted_27\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_SelectOption, { value: 0.75 }, {\n default: _withCtx(() => [\n _hoisted_28\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createVNode(_component_Divider),\n _hoisted_29,\n _createElementVNode(\"div\", _hoisted_30, [\n _hoisted_31,\n _createVNode(_component_Select, {\n style: {\"flex\":\"3\"},\n value: _unref(theme).fontName,\n onChange: _cache[10] || (_cache[10] = value => updateTheme({ fontName: value as string }))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOptGroup, { label: \"系统字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(availableFonts), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", {\n style: _normalizeStyle({ fontFamily: font.value })\n }, _toDisplayString(font.label), 5)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOptGroup, { label: \"在线字体\" }, {\n default: _withCtx(() => [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(WEB_FONTS), (font) => {\n return (_openBlock(), _createBlock(_component_SelectOption, {\n key: font.value,\n value: font.value\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"span\", null, _toDisplayString(font.label), 1)\n ]),\n _: 2\n }, 1032, [\"value\"]))\n }), 128))\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_32, [\n _hoisted_33,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(theme).fontColor,\n \"onUpdate:modelValue\": _cache[11] || (_cache[11] = value => updateTheme({ fontColor: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(theme).fontColor,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_34, [\n _hoisted_35,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(theme).backgroundColor,\n \"onUpdate:modelValue\": _cache[12] || (_cache[12] = value => updateTheme({ backgroundColor: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(theme).backgroundColor,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", _hoisted_36, [\n _hoisted_37,\n _createVNode(_component_Popover, { trigger: \"click\" }, {\n content: _withCtx(() => [\n _createVNode(_component_ColorPicker, {\n modelValue: _unref(theme).themeColor,\n \"onUpdate:modelValue\": _cache[13] || (_cache[13] = value => updateTheme({ themeColor: value }))\n }, null, 8, [\"modelValue\"])\n ]),\n default: _withCtx(() => [\n _createVNode(ColorButton, {\n color: _unref(theme).themeColor,\n style: {\"flex\":\"3\"}\n }, null, 8, [\"color\"])\n ]),\n _: 1\n })\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"title dropdown\", { 'active': showPresetThemes.value }]),\n onClick: _cache[14] || (_cache[14] = ($event: any) => (togglePresetThemesVisible())),\n style: {\"margin-top\":\"20px\"}\n }, [\n _hoisted_38,\n _createVNode(_component_IconDown, { class: \"icon\" })\n ], 2),\n (showPresetThemes.value)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_39, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(PRESET_THEMES), (item, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"theme-item\",\n key: index,\n style: _normalizeStyle({ backgroundColor: item.background }),\n onClick: ($event: any) => (updateTheme({\n fontColor: item.text,\n backgroundColor: item.background,\n themeColor: item.color,\n }))\n }, [\n _createElementVNode(\"div\", _hoisted_41, [\n _createElementVNode(\"div\", {\n class: \"text\",\n style: _normalizeStyle({ color: item.text })\n }, \"Aa\", 4),\n _createElementVNode(\"div\", {\n class: \"color-block\",\n style: _normalizeStyle({ backgroundColor: item.color })\n }, null, 4)\n ])\n ], 12, _hoisted_40))\n }), 128))\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_42, [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[15] || (_cache[15] = ($event: any) => (applyThemeAllSlide()))\n }, {\n default: _withCtx(() => [\n _hoisted_43\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./SlideDesignPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SlideDesignPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./SlideDesignPanel.vue?vue&type=style&index=0&id=e0bbbd9e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-e0bbbd9e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, unref as _unref, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-577ae912\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"slide-animation-panel\" }\nconst _hoisted_2 = { class: \"animation-pool\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"animation-text\" }\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"应用到全部\")\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { TurningMode } from '@/types/slides'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface Animations {\n label: string\n value: TurningMode\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SlideAnimationPanel',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { slides, currentSlide } = storeToRefs(slidesStore)\n\nconst currentTurningMode = computed(() => currentSlide.value.turningMode || 'slideY')\n\nconst animations: Animations[] = [\n { label: '无', value: 'no' },\n { label: '淡入淡出', value: 'fade' },\n { label: '左右推移', value: 'slideX' },\n { label: '上下推移', value: 'slideY' },\n]\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\n// 修改播放时的切换页面方式\nconst updateTurningMode = (mode: TurningMode) => {\n if (mode === currentTurningMode.value) return\n slidesStore.updateSlide({ turningMode: mode })\n addHistorySnapshot()\n}\n\n// 将当前页的切换页面方式应用到全部页面\nconst applyAllSlide = () => {\n const newSlides = slides.value.map(slide => {\n return {\n ...slide,\n turningMode: currentSlide.value.turningMode,\n }\n })\n slidesStore.setSlides(newSlides)\n addHistorySnapshot()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(animations, (item) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"animation-item\", { 'active': _unref(currentTurningMode) === item.value }]),\n key: item.label,\n onClick: ($event: any) => (updateTurningMode(item.value))\n }, [\n _createElementVNode(\"div\", {\n class: _normalizeClass(['animation-block', item.value])\n }, null, 2),\n _createElementVNode(\"div\", _hoisted_4, _toDisplayString(item.label), 1)\n ], 10, _hoisted_3)\n }), 64))\n ]),\n _createVNode(_component_Button, {\n style: {\"width\":\"100%\"},\n onClick: _cache[0] || (_cache[0] = ($event: any) => (applyAllSlide()))\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./SlideAnimationPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SlideAnimationPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./SlideAnimationPanel.vue?vue&type=style&index=0&id=577ae912&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-577ae912\"]])\n\nexport default __exports__","import { storeToRefs } from 'pinia'\r\nimport { useMainStore, useSlidesStore } from '@/store'\r\nimport { PPTElement } from '@/types/slides'\r\nimport { ElementAlignCommands } from '@/types/edit'\r\nimport { getElementListRange, getRectRotatedOffset } from '@/utils/element'\r\nimport useHistorySnapshot from './useHistorySnapshot'\r\n\r\nexport default () => {\r\n const slidesStore = useSlidesStore()\r\n const { activeElementIdList, activeElementList } = storeToRefs(useMainStore())\r\n const { currentSlide } = storeToRefs(slidesStore)\r\n\r\n const { addHistorySnapshot } = useHistorySnapshot()\r\n\r\n /**\r\n * 对齐选中的元素\r\n * @param command 对齐方向\r\n */\r\n const alignActiveElement = (command: ElementAlignCommands) => {\r\n const { minX, maxX, minY, maxY } = getElementListRange(activeElementList.value)\r\n const elementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\r\n\r\n // 如果所选择的元素为组合元素的成员,需要计算该组合的整体范围\r\n const groupElementRangeMap = {}\r\n for (const activeElement of activeElementList.value) {\r\n if (activeElement.groupId && !groupElementRangeMap[activeElement.groupId]) {\r\n const groupElements = activeElementList.value.filter(item => item.groupId === activeElement.groupId)\r\n groupElementRangeMap[activeElement.groupId] = getElementListRange(groupElements)\r\n }\r\n }\r\n\r\n // 根据不同的命令,计算对齐的位置\r\n if (command === ElementAlignCommands.LEFT) {\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetX } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.left = minX - offsetX\r\n }\r\n else element.left = minX\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const offset = range.minX - minX\r\n element.left = element.left - offset\r\n }\r\n }\r\n })\r\n }\r\n else if (command === ElementAlignCommands.RIGHT) {\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n const elWidth = element.type === 'line' ? Math.max(element.start[0], element.end[0]) : element.width\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetX } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.left = maxX - elWidth + offsetX\r\n }\r\n else element.left = maxX - elWidth\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const offset = range.maxX - maxX\r\n element.left = element.left - offset\r\n }\r\n }\r\n })\r\n }\r\n else if (command === ElementAlignCommands.TOP) {\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetY } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.top = minY - offsetY\r\n }\r\n else element.top = minY\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const offset = range.minY - minY\r\n element.top = element.top - offset\r\n }\r\n }\r\n })\r\n }\r\n else if (command === ElementAlignCommands.BOTTOM) {\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n const elHeight = element.type === 'line' ? Math.max(element.start[1], element.end[1]) : element.height\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetY } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.top = maxY - elHeight + offsetY\r\n }\r\n else element.top = maxY - elHeight\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const offset = range.maxY - maxY\r\n element.top = element.top - offset\r\n }\r\n }\r\n })\r\n }\r\n else if (command === ElementAlignCommands.HORIZONTAL) {\r\n const horizontalCenter = (minX + maxX) / 2\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n const elWidth = element.type === 'line' ? Math.max(element.start[0], element.end[0]) : element.width\r\n element.left = horizontalCenter - elWidth / 2\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const center = (range.maxX + range.minX) / 2\r\n const offset = center - horizontalCenter\r\n element.left = element.left - offset\r\n }\r\n }\r\n })\r\n }\r\n else if (command === ElementAlignCommands.VERTICAL) {\r\n const verticalCenter = (minY + maxY) / 2\r\n elementList.forEach(element => {\r\n if (activeElementIdList.value.includes(element.id)) {\r\n if (!element.groupId) {\r\n const elHeight = element.type === 'line' ? Math.max(element.start[1], element.end[1]) : element.height\r\n element.top = verticalCenter - elHeight / 2\r\n }\r\n else {\r\n const range = groupElementRangeMap[element.groupId]\r\n const center = (range.maxY + range.minY) / 2\r\n const offset = center - verticalCenter\r\n element.top = element.top - offset\r\n }\r\n }\r\n })\r\n }\r\n\r\n slidesStore.updateSlide({ elements: elementList })\r\n addHistorySnapshot()\r\n }\r\n\r\n return {\r\n alignActiveElement,\r\n }\r\n}","import { computed } from 'vue'\r\nimport { storeToRefs } from 'pinia'\r\nimport { useMainStore, useSlidesStore } from '@/store'\r\nimport { PPTElement } from '@/types/slides'\r\nimport { getElementRange, getElementListRange, getRectRotatedOffset } from '@/utils/element'\r\nimport useHistorySnapshot from './useHistorySnapshot'\r\n\r\ninterface ElementItem {\r\n min: number\r\n max: number\r\n el: PPTElement\r\n}\r\n\r\ninterface GroupItem {\r\n groupId: string\r\n els: PPTElement[]\r\n}\r\n\r\ninterface GroupElementsItem {\r\n min: number\r\n max: number\r\n els: PPTElement[]\r\n}\r\n\r\ntype Item = ElementItem | GroupElementsItem\r\n\r\ninterface ElementWithPos {\r\n pos: number\r\n el: PPTElement\r\n}\r\n\r\ninterface LastPos {\r\n min: number\r\n max: number\r\n}\r\n\r\nexport default () => {\r\n const slidesStore = useSlidesStore()\r\n const { activeElementIdList, activeElementList } = storeToRefs(useMainStore())\r\n const { currentSlide } = storeToRefs(slidesStore)\r\n\r\n const { addHistorySnapshot } = useHistorySnapshot()\r\n\r\n const displayItemCount = computed(() => {\r\n let count = 0\r\n const groupIdList: string[] = []\r\n for (const el of activeElementList.value) {\r\n if (!el.groupId) count += 1\r\n else if (!groupIdList.includes(el.groupId)) {\r\n groupIdList.push(el.groupId)\r\n count += 1\r\n }\r\n }\r\n return count\r\n })\r\n // 水平均匀排列\r\n const uniformHorizontalDisplay = () => {\r\n const { minX, maxX } = getElementListRange(activeElementList.value)\r\n const copyOfActiveElementList: PPTElement[] = JSON.parse(JSON.stringify(activeElementList.value))\r\n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\r\n\r\n // 分别获取普通元素和组合元素集合,并记录下每一项的范围\r\n const singleElemetList: ElementItem[] = []\r\n let groupList: GroupItem[] = []\r\n for (const el of copyOfActiveElementList) {\r\n if (!el.groupId) {\r\n const { minX, maxX } = getElementRange(el)\r\n singleElemetList.push({ min: minX, max: maxX, el })\r\n }\r\n else {\r\n const groupEl = groupList.find(item => item.groupId === el.groupId)\r\n if (!groupEl) groupList.push({ groupId: el.groupId, els: [el] })\r\n else {\r\n groupList = groupList.map(item => item.groupId === el.groupId ? { ...item, els: [...item.els, el] } : item)\r\n }\r\n }\r\n }\r\n const formatedGroupList: GroupElementsItem[] = []\r\n for (const groupItem of groupList) {\r\n const { minX, maxX } = getElementListRange(groupItem.els)\r\n formatedGroupList.push({ min: minX, max: maxX, els: groupItem.els })\r\n }\r\n\r\n // 将普通元素和组合元素集合组合在一起,然后将每一项按位置(从左到右)排序\r\n const list: Item[] = [...singleElemetList, ...formatedGroupList]\r\n list.sort((itemA, itemB) => itemA.min - itemB.min)\r\n\r\n // 计算元素均匀分布所需要的间隔:\r\n // (所选元素整体范围 - 所有所选元素宽度和) / (所选元素数 - 1)\r\n let totalWidth = 0\r\n for (const item of list) {\r\n const width = item.max - item.min\r\n totalWidth += width\r\n }\r\n const span = ((maxX - minX) - totalWidth) / (list.length - 1)\r\n\r\n // 按位置顺序依次计算每一个元素的目标位置\r\n // 第一项中的元素即为起点,无需计算\r\n // 从第二项开始,每一项的位置应该为:上一项位置 + 上一项宽度 + 间隔\r\n // 注意此处计算的位置(pos)并非元素最终的left值,而是目标位置范围最小值(元素旋转后的left值 ≠ 范围最小值)\r\n const sortedElementData: ElementWithPos[] = []\r\n\r\n const firstItem = list[0]\r\n let lastPos: LastPos = { min: firstItem.min, max: firstItem.max }\r\n\r\n if ('el' in firstItem) {\r\n sortedElementData.push({ pos: firstItem.min, el: firstItem.el })\r\n }\r\n else {\r\n for (const el of firstItem.els) {\r\n const { minX: pos } = getElementRange(el)\r\n sortedElementData.push({ pos, el })\r\n }\r\n }\r\n\r\n for (let i = 1; i < list.length; i++) {\r\n const item = list[i]\r\n const lastWidth = lastPos.max - lastPos.min\r\n const currentPos = lastPos.min + lastWidth + span\r\n const currentWidth = item.max - item.min\r\n lastPos = { min: currentPos, max: currentPos + currentWidth }\r\n\r\n if ('el' in item) {\r\n sortedElementData.push({ pos: currentPos, el: item.el })\r\n }\r\n else {\r\n for (const el of item.els) {\r\n const { minX } = getElementRange(el)\r\n const offset = minX - item.min\r\n sortedElementData.push({ pos: currentPos + offset, el })\r\n }\r\n }\r\n }\r\n\r\n // 根据目标位置计算元素最终目标left值\r\n // 对于旋转后的元素,需要计算旋转前后left的偏移来做校正\r\n for (const element of newElementList) {\r\n if (!activeElementIdList.value.includes(element.id)) continue\r\n\r\n for (const sortedItem of sortedElementData) {\r\n if (sortedItem.el.id === element.id) {\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetX } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.left = sortedItem.pos - offsetX\r\n }\r\n else element.left = sortedItem.pos\r\n }\r\n }\r\n }\r\n\r\n slidesStore.updateSlide({ elements: newElementList })\r\n addHistorySnapshot()\r\n }\r\n\r\n // 垂直均匀排列(逻辑类似水平均匀排列方法)\r\n const uniformVerticalDisplay = () => {\r\n const { minY, maxY } = getElementListRange(activeElementList.value)\r\n const copyOfActiveElementList: PPTElement[] = JSON.parse(JSON.stringify(activeElementList.value))\r\n const newElementList: PPTElement[] = JSON.parse(JSON.stringify(currentSlide.value.elements))\r\n\r\n const singleElemetList: ElementItem[] = []\r\n let groupList: GroupItem[] = []\r\n for (const el of copyOfActiveElementList) {\r\n if (!el.groupId) {\r\n const { minY, maxY } = getElementRange(el)\r\n singleElemetList.push({ min: minY, max: maxY, el })\r\n }\r\n else {\r\n const groupEl = groupList.find(item => item.groupId === el.groupId)\r\n if (!groupEl) groupList.push({ groupId: el.groupId, els: [el] })\r\n else {\r\n groupList = groupList.map(item => item.groupId === el.groupId ? { ...item, els: [...item.els, el] } : item)\r\n }\r\n }\r\n }\r\n const formatedGroupList: GroupElementsItem[] = []\r\n for (const groupItem of groupList) {\r\n const { minY, maxY } = getElementListRange(groupItem.els)\r\n formatedGroupList.push({ min: minY, max: maxY, els: groupItem.els })\r\n }\r\n\r\n const list: Item[] = [...singleElemetList, ...formatedGroupList]\r\n list.sort((itemA, itemB) => itemA.min - itemB.min)\r\n\r\n let totalHeight = 0\r\n for (const item of list) {\r\n const height = item.max - item.min\r\n totalHeight += height\r\n }\r\n const span = ((maxY - minY) - totalHeight) / (list.length - 1)\r\n\r\n const sortedElementData: ElementWithPos[] = []\r\n\r\n const firstItem = list[0]\r\n let lastPos: LastPos = { min: firstItem.min, max: firstItem.max }\r\n\r\n if ('el' in firstItem) {\r\n sortedElementData.push({ pos: firstItem.min, el: firstItem.el })\r\n }\r\n else {\r\n for (const el of firstItem.els) {\r\n const { minY: pos } = getElementRange(el)\r\n sortedElementData.push({ pos, el })\r\n }\r\n }\r\n\r\n for (let i = 1; i < list.length; i++) {\r\n const item = list[i]\r\n const lastHeight = lastPos.max - lastPos.min\r\n const currentPos = lastPos.min + lastHeight + span\r\n const currentHeight = item.max - item.min\r\n lastPos = { min: currentPos, max: currentPos + currentHeight }\r\n\r\n if ('el' in item) {\r\n sortedElementData.push({ pos: currentPos, el: item.el })\r\n }\r\n else {\r\n for (const el of item.els) {\r\n const { minY } = getElementRange(el)\r\n const offset = minY - item.min\r\n sortedElementData.push({ pos: currentPos + offset, el })\r\n }\r\n }\r\n }\r\n\r\n for (const element of newElementList) {\r\n if (!activeElementIdList.value.includes(element.id)) continue\r\n\r\n for (const sortedItem of sortedElementData) {\r\n if (sortedItem.el.id === element.id) {\r\n if ('rotate' in element && element.rotate) {\r\n const { offsetY } = getRectRotatedOffset({\r\n left: element.left,\r\n top: element.top,\r\n width: element.width,\r\n height: element.height,\r\n rotate: element.rotate,\r\n })\r\n element.top = sortedItem.pos - offsetY\r\n }\r\n else element.top = sortedItem.pos\r\n }\r\n }\r\n }\r\n\r\n slidesStore.updateSlide({ elements: newElementList })\r\n addHistorySnapshot()\r\n }\r\n\r\n return {\r\n displayItemCount,\r\n uniformHorizontalDisplay,\r\n uniformVerticalDisplay,\r\n }\r\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, unref as _unref, withCtx as _withCtx, createTextVNode as _createTextVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-0d3881c5\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"multi-position-panel\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\"水平均匀分布\")\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\"垂直均匀分布\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"组合\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"取消组合\")\n\nimport { ElementAlignCommands } from '@/types/edit'\nimport useCombineElement from '@/hooks/useCombineElement'\nimport useAlignActiveElement from '@/hooks/useAlignActiveElement'\nimport useAlignElementToCanvas from '@/hooks/useAlignElementToCanvas'\nimport useUniformDisplayElement from '@/hooks/useUniformDisplayElement'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MultiPositionPanel',\n setup(__props) {\n\nconst { canCombine, combineElements, uncombineElements } = useCombineElement()\nconst { alignActiveElement } = useAlignActiveElement()\nconst { alignElementToCanvas } = useAlignElementToCanvas()\nconst { displayItemCount, uniformHorizontalDisplay, uniformVerticalDisplay } = useUniformDisplayElement()\n\n// 多选元素对齐,需要先判断当前所选中的元素状态:\n// 如果所选元素为一组组合元素,则将它对齐到画布;\n// 如果所选元素不是组合元素或不止一组元素(即当前为可组合状态),则将这多个(多组)元素相互对齐。\nconst alignElement = (command: ElementAlignCommands) => {\n if (canCombine.value) alignActiveElement(command)\n else alignElementToCanvas(command)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconAlignLeft = _resolveComponent(\"IconAlignLeft\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconAlignHorizontally = _resolveComponent(\"IconAlignHorizontally\")!\n const _component_IconAlignRight = _resolveComponent(\"IconAlignRight\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconAlignTop = _resolveComponent(\"IconAlignTop\")!\n const _component_IconAlignVertically = _resolveComponent(\"IconAlignVertically\")!\n const _component_IconAlignBottom = _resolveComponent(\"IconAlignBottom\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconGroup = _resolveComponent(\"IconGroup\")!\n const _component_IconUngroup = _resolveComponent(\"IconUngroup\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"左对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[0] || (_cache[0] = ($event: any) => (alignElement(_unref(ElementAlignCommands).LEFT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignLeft)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"水平居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[1] || (_cache[1] = ($event: any) => (alignElement(_unref(ElementAlignCommands).HORIZONTAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignHorizontally)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"右对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[2] || (_cache[2] = ($event: any) => (alignElement(_unref(ElementAlignCommands).RIGHT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"上对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[3] || (_cache[3] = ($event: any) => (alignElement(_unref(ElementAlignCommands).TOP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTop)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"垂直居中\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[4] || (_cache[4] = ($event: any) => (alignElement(_unref(ElementAlignCommands).VERTICAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignVertically)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"下对齐\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[5] || (_cache[5] = ($event: any) => (alignElement(_unref(ElementAlignCommands).BOTTOM)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignBottom)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ]),\n _: 1\n }),\n (_unref(displayItemCount) > 2)\n ? (_openBlock(), _createBlock(_component_ButtonGroup, {\n key: 0,\n class: \"row\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[6] || (_cache[6] = ($event: any) => (_unref(uniformHorizontalDisplay)()))\n }, {\n default: _withCtx(() => [\n _hoisted_2\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[7] || (_cache[7] = ($event: any) => (_unref(uniformVerticalDisplay)()))\n }, {\n default: _withCtx(() => [\n _hoisted_3\n ]),\n _: 1\n })\n ]),\n _: 1\n }))\n : _createCommentVNode(\"\", true),\n _createVNode(_component_Divider),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n disabled: !_unref(canCombine),\n onClick: _cache[8] || (_cache[8] = ($event: any) => (_unref(combineElements)())),\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconGroup, { style: {\"margin-right\":\"3px\"} }),\n _hoisted_4\n ]),\n _: 1\n }, 8, [\"disabled\"]),\n _createVNode(_component_Button, {\n disabled: _unref(canCombine),\n onClick: _cache[9] || (_cache[9] = ($event: any) => (_unref(uncombineElements)())),\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconUngroup, { style: {\"margin-right\":\"3px\"} }),\n _hoisted_5\n ]),\n _: 1\n }, 8, [\"disabled\"])\n ]),\n _: 1\n })\n ]))\n}\n}\n\n})","import script from \"./MultiPositionPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MultiPositionPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MultiPositionPanel.vue?vue&type=style&index=0&id=0d3881c5&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-0d3881c5\"]])\n\nexport default __exports__","export const SYMBOL_LIST = [\n {\n key: 'letter',\n label: '字母',\n children: [\n 'α', 'β', 'γ', 'δ', 'ϵ', 'ε', 'ζ', 'η', 'θ', 'ϑ', 'ι', 'κ', 'λ', 'μ', 'ν', 'ξ', 'π', 'ϖ', 'ρ', 'ϱ', 'σ', 'ς', 'τ', 'υ', 'ϕ', 'φ', 'χ', 'ψ', 'ω', \n 'Γ', 'Δ', 'Θ', 'Λ', 'Ξ', 'Π', 'Σ', 'Υ', 'Φ', 'Ψ', 'Ω',\n '𝐀', '𝐁', '𝐂', '𝐃', '𝐄', '𝐅', '𝐆', '𝐇', '𝐈', '𝐉', '𝐊', '𝐋', '𝐌', '𝐍', '𝐎', '𝐏', '𝐐', '𝐑', '𝐒', '𝐓', '𝐔', '𝐕', '𝐖', '𝐗', '𝐘', '𝐙',\n '𝐚', '𝐛', '𝐜', '𝐝', '𝐞', '𝐟', '𝐠', '𝐡', '𝐢', '𝐣', '𝐤', '𝐥', '𝐦', '𝐧', '𝐨', '𝐩', '𝐪', '𝐫', '𝐬', '𝐭', '𝐮', '𝐯', '𝐰', '𝐱', '𝐲', '𝐳',\n '𝓐', '𝓑', '𝓒', '𝓓', '𝓔', '𝓕', '𝓖', '𝓗', '𝓘', '𝓙', '𝓚', '𝓛', '𝓜', '𝓝', '𝓞', '𝓟', '𝓠', '𝓡', '𝓢', '𝓣', '𝓤', '𝓥', '𝓦', '𝓧', '𝓨', '𝓩',\n '𝓪', '𝓫', '𝓬', '𝓭', '𝓮', '𝓯', '𝓰', '𝓱', '𝓲', '𝓳', '𝓴', '𝓵', '𝓶', '𝓷', '𝓸', '𝓹', '𝓺', '𝓻', '𝓼', '𝓽', '𝓾', '𝓿', '𝔀', '𝔁', '𝔂', '𝔃',\n ],\n },\n {\n key: 'number',\n label: '序号',\n children: [\n '①', '②', '③', '④', '⑤', '⑥', '⑦', '⑧', '⑨', '⑩', '⑪', '⑫', '⑬', '⑭', '⑮', '⑯', '⑰', '⑱', '⑲', '⑳',\n '⑴', '⑵', '⑶', '⑷', '⑸', '⑹', '⑺', '⑻', '⑼', '⑽', '⑾', '⑿', '⒀', '⒁', '⒂', '⒃', '⒄', '⒅', '⒆', '⒇',\n 'º', '¹', '²', '³', '⁴', '⁵', '⁶', '⁷', '⁸', '⁹', '₀', '₁', '₂', '₃', '₄', '₅', '₆', '₇', '₈', '₉',\n 'Ⅰ', 'Ⅱ', 'Ⅲ', 'Ⅳ', 'Ⅴ', 'Ⅵ', 'Ⅶ', 'Ⅷ', 'Ⅸ', 'Ⅹ', 'Ⅺ', 'Ⅻ', 'Ⅼ', 'Ⅽ', 'Ⅾ', 'Ⅿ',\n 'ⅰ', 'ⅱ', 'ⅲ', 'ⅳ', 'ⅴ', 'ⅵ', 'ⅶ', 'ⅷ', 'ⅸ', 'ⅹ', 'ⅺ', 'ⅻ', 'ⅼ', 'ⅽ', 'ⅾ', 'ⅿ', 'ↀ', 'ↁ', 'ↂ',\n '㊀', '㊁', '㊂', '㊃', '㊄', '㊅', '㊆', '㊇', '㊈', '㊉', '㈠', '㈡', '㈢', '㈣', '㈤', '㈥', '㈦', '㈧', '㈨', '㈩',\n '𝟘', '𝟙', '𝟚', '𝟛', '𝟜', '𝟝', '𝟞', '𝟟', '𝟠', '𝟡',\n ],\n },\n {\n key: 'math',\n label: '数学',\n children: [\n '+', '-', '×', '÷', '=', '~', '¬', '±', '%', '°', 'ǃ', '‰', '‱', '½', '⅓', '⅔', '¼', '¾',\n '<', '>', 'l', 'o', 'g', 'l', 'g', 'l', 'n', '⨂', '⨁', '⨄', '⨃', '⨅', '⨆', '√', '∛', '∜', '∝', '∞',\n '∟', '∠', '∡', '∢', '∧', '∨', '∩', '∪', '∫', '∬', '∭', '∮', '∯', '∰', '∱', '∲', '∳',\n '∴', '∵', '∼', '∽', '∾', '∿', '≃', '≄', '≅', '≆', '≇', '≈', '≊', '≋', '≌', '≍', '≎', '≏', '≐', '≑', '≒', '≓', '≔', '≕',\n '≤', '≥', '≦', '≧', '≨', '≩', '≪', '≫', '≺', '≻', '≼', '≽', '≾', '≿', '⊀', '⊁', '⊂', '⊃', '⊄', '⊅', '⊆', '⊇', '⊈', '⊉', '⊊', '⊋', '⊏', '⊐', '⊑', '⊒',\n '⊓', '⊔', '⊢', '⊣', '⊤', '⊥', '⊦', '⊧', '⊨', '⊩', '⊪', '⊫', '⊬', '⊭', '⊮', '⊯', '⊲', '⊳', '⊴', '⊵', '⋀', '⋁', '⋂', '⋃', '⋉', '⋊',\n '⋋', '⋌', '⟨', '⟩', '⟪', '⟫', '⟮', '⟯', '⧼', '⧽', '⦰',\n ],\n },\n {\n key: 'arrow',\n label: '箭头',\n children: [\n '←', '↑', '→', '↓', '↔', '↕', '↖', '↗', '↘', '↙', '↚', '↛', '↜', '↝', '↞', '↟', '↠', '↡', '↢', '↣', '↤', '↥', '↦', '↧', '↨',\n '↫', '↬', '↭', '↮', '↯', '↰', '↱', '↲', '↳', '↴', '↵', '↶', '↷', '↸', '↹', '↺', '↻', '↼', '↽', '↾', '↿', '⇀', '⇁', '⇂', '⇃',\n '⇄', '⇅', '⇆', '⇇', '⇈', '⇉', '⇊', '⇋', '⇌', '⇍', '⇎', '⇏', '⇐', '⇑', '⇒', '⇓', '⇔', '⇕', '⇖', '⇗', '⇘', '⇙', '⇚', '⇛',\n '⇜', '⇝', '⇞', '⇟', '⇠', '⇡', '⇢', '⇣', '⇤', '⇥', '⇦', '⇧', '⇨', '⇩', '⇪', '⇫', '⇬', '⇭', '⇮', '⇯', '⇰', '⇱', '⇲', '⇳', '⇴', '⇵',\n '⇶', '⇷', '⇸', '⇹', '⇺', '⇻', '⇼', '⇽', '⇾', '⇿',\n ],\n },\n {\n key: 'graph',\n label: '图形',\n children: [\n '▢', '▣', '▤', '▥', '▦', '▧', '▨', '▩', '▭', '▮', '▯', '▰', '▱', '▲', '▷', '▼', '◁',\n '◈', '◉', '◍', '◐', '◑', '◒', '◓', '◔', '◕', '◧', '◨', '◩', '◪', '◫', '◬', '◭', '◮',\n ],\n },\n]","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-ba0c96fc\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"symbol-panel\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"pool\" }\nconst _hoisted_5 = [\"onClick\"]\nconst _hoisted_6 = { class: \"symbol\" }\n\nimport { computed, ref } from 'vue'\nimport { SYMBOL_LIST } from '@/configs/symbol'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SymbolPanel',\n setup(__props) {\n\nconst selectedSymbolKey = ref(SYMBOL_LIST[0].key)\nconst symbolPool = computed(() => {\n const selectedSymbol = SYMBOL_LIST.find(item => item.key === selectedSymbolKey.value)\n return selectedSymbol?.children || []\n})\n\nconst selectSymbol = (value: string) => {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command: 'insert', value } })\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(SYMBOL_LIST), (item) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': selectedSymbolKey.value === item.key }]),\n key: item.key,\n onClick: ($event: any) => (selectedSymbolKey.value = item.key)\n }, _toDisplayString(item.label), 11, _hoisted_3))\n }), 128))\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(symbolPool), (item, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"symbol-item\",\n key: index,\n onClick: ($event: any) => (selectSymbol(item))\n }, [\n _createElementVNode(\"div\", _hoisted_6, _toDisplayString(item), 1)\n ], 8, _hoisted_5))\n }), 128))\n ])\n ]))\n}\n}\n\n})","import script from \"./SymbolPanel.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SymbolPanel.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./SymbolPanel.vue?vue&type=style&index=0&id=ba0c96fc&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-ba0c96fc\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveDynamicComponent as _resolveDynamicComponent, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5303bd17\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"toolbar\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"content\" }\n\nimport { computed, watch } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { ToolbarStates } from '@/types/toolbar'\n\nimport ElementStylePanel from './ElementStylePanel/index.vue'\nimport ElementPositionPanel from './ElementPositionPanel.vue'\nimport ElementAnimationPanel from './ElementAnimationPanel.vue'\nimport SlideDesignPanel from './SlideDesignPanel.vue'\nimport SlideAnimationPanel from './SlideAnimationPanel.vue'\nimport MultiPositionPanel from './MultiPositionPanel.vue'\nimport SymbolPanel from './SymbolPanel.vue'\n\ninterface ElementTabs {\n label: string\n value: ToolbarStates\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst { activeElementIdList, handleElement, toolbarState } = storeToRefs(mainStore)\n\nconst elementTabs = computed(() => {\n if (handleElement.value?.type === 'text') {\n return [\n { label: '样式', value: ToolbarStates.EL_STYLE },\n { label: '符号', value: ToolbarStates.SYMBOL },\n { label: '位置', value: ToolbarStates.EL_POSITION },\n { label: '动画', value: ToolbarStates.EL_ANIMATION },\n ]\n }\n return [\n { label: '样式', value: ToolbarStates.EL_STYLE },\n { label: '位置', value: ToolbarStates.EL_POSITION },\n { label: '动画', value: ToolbarStates.EL_ANIMATION },\n ]\n})\nconst slideTabs = [\n { label: '设计', value: ToolbarStates.SLIDE_DESIGN },\n { label: '切换', value: ToolbarStates.SLIDE_ANIMATION },\n { label: '动画', value: ToolbarStates.EL_ANIMATION },\n]\nconst multiSelectTabs = [\n { label: '样式', value: ToolbarStates.EL_STYLE },\n { label: '位置', value: ToolbarStates.MULTI_POSITION },\n]\n\nconst setToolbarState = (value: ToolbarStates) => {\n mainStore.setToolbarState(value)\n}\n\nconst currentTabs = computed(() => {\n if (!activeElementIdList.value.length) return slideTabs\n else if (activeElementIdList.value.length > 1) return multiSelectTabs\n return elementTabs.value\n})\n\nwatch(currentTabs, () => {\n const currentTabsValue: ToolbarStates[] = currentTabs.value.map(tab => tab.value)\n if (!currentTabsValue.includes(toolbarState.value)) {\n mainStore.setToolbarState(currentTabsValue[0])\n }\n})\n\nconst currentPanelComponent = computed(() => {\n const panelMap = {\n [ToolbarStates.EL_STYLE]: ElementStylePanel,\n [ToolbarStates.EL_POSITION]: ElementPositionPanel,\n [ToolbarStates.EL_ANIMATION]: ElementAnimationPanel,\n [ToolbarStates.SLIDE_DESIGN]: SlideDesignPanel,\n [ToolbarStates.SLIDE_ANIMATION]: SlideAnimationPanel,\n [ToolbarStates.MULTI_POSITION]: MultiPositionPanel,\n [ToolbarStates.SYMBOL]: SymbolPanel,\n }\n return panelMap[toolbarState.value] || null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(currentTabs), (tab) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': tab.value === _unref(toolbarState) }]),\n key: tab.value,\n onClick: ($event: any) => (setToolbarState(tab.value))\n }, _toDisplayString(tab.label), 11, _hoisted_3))\n }), 128))\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentPanelComponent))))\n ])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=5303bd17&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5303bd17\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-82b674f6\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"remark\" }\nconst _hoisted_2 = [\"value\"]\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n height: {\n type: Number,\n required: true,\n },\n},\n emits: [\"update:height\"],\n setup(__props, { emit }: { emit: ({\n (event: 'update:height', payload: number): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst slidesStore = useSlidesStore()\nconst { currentSlide } = storeToRefs(slidesStore)\n\nconst remark = computed(() => currentSlide.value?.remark || '')\n\nconst handleInput = (e: Event) => {\n const value = (e.target as HTMLTextAreaElement).value\n slidesStore.updateSlide({ remark: value })\n}\n\nconst resize = (e: MouseEvent) => {\n let isMouseDown = true\n const startPageY = e.pageY\n const originHeight = props.height\n\n document.onmousemove = e => {\n if (!isMouseDown) return\n\n const currentPageY = e.pageY\n\n const moveY = currentPageY - startPageY\n let newHeight = -moveY + originHeight\n\n if (newHeight < 40) newHeight = 40\n if (newHeight > 120) newHeight = 120\n\n emit('update:height', newHeight)\n }\n\n document.onmouseup = () => {\n isMouseDown = false\n document.onmousemove = null\n document.onmouseup = null\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"resize-handler\",\n onMousedown: _cache[0] || (_cache[0] = $event => resize($event))\n }, null, 32),\n _createElementVNode(\"textarea\", {\n value: _unref(remark),\n placeholder: \"点击输入演讲者备注\",\n onInput: _cache[1] || (_cache[1] = $event => handleInput($event))\n }, null, 40, _hoisted_2)\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=82b674f6&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-82b674f6\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-60a953a0\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-img-dialog\" }\nconst _hoisted_2 = { class: \"thumbnails-view\" }\nconst _hoisted_3 = { class: \"configs\" }\nconst _hoisted_4 = { class: \"row\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"导出格式:\", -1))\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"JPEG\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"PNG\")\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"导出范围:\", -1))\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"全部\")\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\"当前页\")\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"自定义\")\nconst _hoisted_13 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_14 = [\"data-range\"]\nconst _hoisted_15 = { class: \"row\" }\nconst _hoisted_16 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"图片质量:\", -1))\nconst _hoisted_17 = { class: \"row\" }\nconst _hoisted_18 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"忽略在线字体:\", -1))\nconst _hoisted_19 = { class: \"config-item\" }\nconst _hoisted_20 = { class: \"btns\" }\nconst _hoisted_21 = /*#__PURE__*/_createTextVNode(\"导出图片\")\nconst _hoisted_22 = /*#__PURE__*/_createTextVNode(\"关闭\")\n\nimport { computed, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useExport from '@/hooks/useExport'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExportImage',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { slides, currentSlide } = storeToRefs(useSlidesStore())\n\nconst imageThumbnailsRef = ref()\nconst rangeType = ref<'all' | 'current' | 'custom'>('all')\nconst range = ref<[number, number]>([1, slides.value.length])\nconst format = ref<'jpeg' | 'png'>('jpeg')\nconst quality = ref(1)\nconst ignoreWebfont = ref(true)\n\nconst renderSlides = computed(() => {\n if (rangeType.value === 'all') return slides.value\n if (rangeType.value === 'current') return [currentSlide.value]\n return slides.value.filter((item, index) => {\n const [min, max] = range.value\n return index >= min - 1 && index <= max - 1\n })\n})\n\nconst { exportImage, exporting } = useExport()\n\nconst expImage = () => {\n if (!imageThumbnailsRef.value) return\n exportImage(imageThumbnailsRef.value, format.value, quality.value, ignoreWebfont.value)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_FullscreenSpin = _resolveComponent(\"FullscreenSpin\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: \"thumbnails\",\n ref_key: \"imageThumbnailsRef\",\n ref: imageThumbnailsRef\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(renderSlides), (slide) => {\n return (_openBlock(), _createBlock(ThumbnailSlide, {\n class: \"thumbnail\",\n key: slide.id,\n slide: slide,\n size: 1600\n }, null, 8, [\"slide\"]))\n }), 128))\n ], 512)\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _createVNode(_component_RadioGroup, {\n class: \"config-item\",\n value: format.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((format).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"50%\"},\n value: \"jpeg\"\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"50%\"},\n value: \"png\"\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_RadioGroup, {\n class: \"config-item\",\n value: rangeType.value,\n \"onUpdate:value\": _cache[1] || (_cache[1] = ($event: any) => ((rangeType).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"all\"\n }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"current\"\n }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"custom\"\n }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n (rangeType.value === 'custom')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_13, [\n _createElementVNode(\"div\", {\n class: \"title\",\n \"data-range\": `(${range.value[0]} ~ ${range.value[1]})`\n }, \"自定义范围:\", 8, _hoisted_14),\n _createVNode(_component_Slider, {\n class: \"config-item\",\n range: \"\",\n min: 1,\n max: _unref(slides).length,\n step: 1,\n value: range.value,\n \"onUpdate:value\": _cache[2] || (_cache[2] = ($event: any) => ((range).value = $event))\n }, null, 8, [\"max\", \"value\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_15, [\n _hoisted_16,\n _createVNode(_component_Slider, {\n class: \"config-item\",\n min: 0,\n max: 1,\n step: 0.1,\n value: quality.value,\n \"onUpdate:value\": _cache[3] || (_cache[3] = ($event: any) => ((quality).value = $event))\n }, null, 8, [\"step\", \"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_17, [\n _hoisted_18,\n _createElementVNode(\"div\", _hoisted_19, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.5,\n title: \"导出时默认忽略在线字体,若您在幻灯片中使用了在线字体,且希望导出后保留相关样式,可选择关闭【忽略在线字体】选项,但要注意这将会增加导出用时。\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_Switch, {\n checked: ignoreWebfont.value,\n \"onUpdate:checked\": _cache[4] || (_cache[4] = ($event: any) => ((ignoreWebfont).value = $event))\n }, null, 8, [\"checked\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_20, [\n _createVNode(_component_Button, {\n class: \"btn export\",\n type: \"primary\",\n onClick: _cache[5] || (_cache[5] = ($event: any) => (expImage()))\n }, {\n default: _withCtx(() => [\n _hoisted_21\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn close\",\n onClick: _cache[6] || (_cache[6] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_22\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_FullscreenSpin, {\n loading: _unref(exporting),\n tip: \"正在导出...\"\n }, null, 8, [\"loading\"])\n ]))\n}\n}\n\n})","import script from \"./ExportImage.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ExportImage.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ExportImage.vue?vue&type=style&index=0&id=60a953a0&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-60a953a0\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1bc24666\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-json-dialog\" }\nconst _hoisted_2 = { class: \"preview\" }\nconst _hoisted_3 = { class: \"btns\" }\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\"导出 JSON\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"关闭\")\n\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useExport from '@/hooks/useExport'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExportJSON',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { slides } = storeToRefs(useSlidesStore())\nconst { exportJSON } = useExport()\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"pre\", null, _toDisplayString(_unref(slides)), 1)\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(_component_Button, {\n class: \"btn export\",\n type: \"primary\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (_unref(exportJSON)()))\n }, {\n default: _withCtx(() => [\n _hoisted_4\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn close\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./ExportJSON.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ExportJSON.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ExportJSON.vue?vue&type=style&index=0&id=1bc24666&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1bc24666\"]])\n\nexport default __exports__","interface PageSize {\n width: number\n height: number\n margin: number\n}\n\nconst createIframe = () => {\n const iframe = document.createElement('iframe')\n iframe.style.width = '0'\n iframe.style.height = '0'\n iframe.style.position = 'absolute'\n iframe.style.right = '0'\n iframe.style.top = '0'\n iframe.style.border = '0'\n\n document.body.appendChild(iframe)\n\n return iframe\n}\n\nconst writeContent = (doc: Document, printNode: HTMLElement, size: PageSize) => {\n const docType = ''\n\n let style = ''\n const styleSheets = document.styleSheets\n if (styleSheets) {\n for (const styleSheet of styleSheets) {\n if (!styleSheet.cssRules) continue\n\n for (const rule of styleSheet.cssRules) {\n style += rule.cssText\n }\n }\n }\n\n const { width, height, margin } = size\n const head = `\n \n \n \n `\n const body = '' + printNode.innerHTML + ''\n\n doc.open()\n doc.write(`\n ${docType}\n \n ${head}\n ${body}\n \n `)\n doc.close()\n}\n\nexport const print = (printNode: HTMLElement, size: PageSize) => {\n const iframe = createIframe()\n const iframeContentWindow = iframe.contentWindow\n\n if (!iframe.contentDocument || !iframeContentWindow) return\n writeContent(iframe.contentDocument, printNode, size)\n\n const handleLoadIframe = () => {\n iframeContentWindow.focus()\n iframeContentWindow.print()\n }\n\n const handleAfterprint = () => {\n iframe.removeEventListener('load', handleLoadIframe)\n iframeContentWindow.removeEventListener('afterprint', handleAfterprint)\n document.body.removeChild(iframe)\n }\n\n iframe.addEventListener('load', handleLoadIframe)\n iframeContentWindow.addEventListener('afterprint', handleAfterprint)\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-15b57798\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-pdf-dialog\" }\nconst _hoisted_2 = { class: \"thumbnails-view\" }\nconst _hoisted_3 = { class: \"configs\" }\nconst _hoisted_4 = { class: \"row\" }\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"导出范围:\", -1))\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"全部幻灯片\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"当前幻灯片\")\nconst _hoisted_8 = { class: \"row\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"每页数量:\", -1))\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\"1\")\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\"2\")\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"3\")\nconst _hoisted_13 = { class: \"row\" }\nconst _hoisted_14 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"边缘留白:\", -1))\nconst _hoisted_15 = { class: \"config-item\" }\nconst _hoisted_16 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"tip\" }, \" 注意:若打印预览与实际样式不一致,请在弹出的打印窗口中勾选【背景图形】选项。 \", -1))\nconst _hoisted_17 = { class: \"btns\" }\nconst _hoisted_18 = /*#__PURE__*/_createTextVNode(\"打印 / 导出 PDF\")\nconst _hoisted_19 = /*#__PURE__*/_createTextVNode(\"关闭\")\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { print } from '@/utils/print'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExportPDF',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { slides, currentSlide } = storeToRefs(useSlidesStore())\n\nconst pdfThumbnailsRef = ref()\nconst rangeType = ref<'all' | 'current'>('all')\nconst count = ref(1)\nconst padding = ref(true)\n\nconst expPDF = () => {\n if (!pdfThumbnailsRef.value) return\n const pageSize = {\n width: 1600,\n height: rangeType.value === 'all' ? 900 * count.value : 900,\n margin: padding.value ? 50 : 0,\n }\n print(pdfThumbnailsRef.value, pageSize)\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_SelectOption = _resolveComponent(\"SelectOption\")!\n const _component_Select = _resolveComponent(\"Select\")!\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: \"thumbnails\",\n ref_key: \"pdfThumbnailsRef\",\n ref: pdfThumbnailsRef\n }, [\n (rangeType.value === 'current')\n ? (_openBlock(), _createBlock(ThumbnailSlide, {\n key: 0,\n class: \"thumbnail\",\n slide: _unref(currentSlide),\n size: 1600\n }, null, 8, [\"slide\"]))\n : (_openBlock(true), _createElementBlock(_Fragment, { key: 1 }, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createBlock(ThumbnailSlide, {\n class: _normalizeClass([\"thumbnail\", { 'break-page': (index + 1) % count.value === 0 }]),\n key: slide.id,\n slide: slide,\n size: 1600\n }, null, 8, [\"class\", \"slide\"]))\n }), 128))\n ], 512)\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _hoisted_5,\n _createVNode(_component_RadioGroup, {\n class: \"config-item\",\n value: rangeType.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((rangeType).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"50%\"},\n value: \"all\"\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"50%\"},\n value: \"current\"\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createVNode(_component_Select, {\n class: \"config-item\",\n value: count.value,\n \"onUpdate:value\": _cache[1] || (_cache[1] = ($event: any) => ((count).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_SelectOption, { value: 1 }, {\n default: _withCtx(() => [\n _hoisted_10\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: 2 }, {\n default: _withCtx(() => [\n _hoisted_11\n ]),\n _: 1\n }),\n _createVNode(_component_SelectOption, { value: 3 }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n _createElementVNode(\"div\", _hoisted_13, [\n _hoisted_14,\n _createElementVNode(\"div\", _hoisted_15, [\n _createVNode(_component_Switch, {\n checked: padding.value,\n \"onUpdate:checked\": _cache[2] || (_cache[2] = ($event: any) => ((padding).value = $event))\n }, null, 8, [\"checked\"])\n ])\n ]),\n _hoisted_16\n ]),\n _createElementVNode(\"div\", _hoisted_17, [\n _createVNode(_component_Button, {\n class: \"btn export\",\n type: \"primary\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (expPDF()))\n }, {\n default: _withCtx(() => [\n _hoisted_18\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn close\",\n onClick: _cache[4] || (_cache[4] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_19\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./ExportPDF.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ExportPDF.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ExportPDF.vue?vue&type=style&index=0&id=15b57798&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-15b57798\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-3fef9be0\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-pptx-dialog\" }\nconst _hoisted_2 = { class: \"configs\" }\nconst _hoisted_3 = { class: \"row\" }\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"导出范围:\", -1))\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"全部\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"当前页\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"自定义\")\nconst _hoisted_8 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_9 = [\"data-range\"]\nconst _hoisted_10 = { class: \"row\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"覆盖默认母版:\", -1))\nconst _hoisted_12 = { class: \"config-item\" }\nconst _hoisted_13 = { class: \"btns\" }\nconst _hoisted_14 = /*#__PURE__*/_createTextVNode(\"导出 PPTX\")\nconst _hoisted_15 = /*#__PURE__*/_createTextVNode(\"关闭\")\n\nimport { computed, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useExport from '@/hooks/useExport'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExportPPTX',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { slides, currentSlide } = storeToRefs(useSlidesStore())\n\nconst { exportPPTX, exporting } = useExport()\n\nconst rangeType = ref<'all' | 'current' | 'custom'>('all')\nconst range = ref<[number, number]>([1, slides.value.length])\nconst masterOverwrite = ref(true)\n\nconst selectedSlides = computed(() => {\n if (rangeType.value === 'all') return slides.value\n if (rangeType.value === 'current') return [currentSlide.value]\n return slides.value.filter((item, index) => {\n const [min, max] = range.value\n return index >= min - 1 && index <= max - 1\n })\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_Switch = _resolveComponent(\"Switch\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_FullscreenSpin = _resolveComponent(\"FullscreenSpin\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _hoisted_4,\n _createVNode(_component_RadioGroup, {\n class: \"config-item\",\n value: rangeType.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((rangeType).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"all\"\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"current\"\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"custom\"\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n (rangeType.value === 'custom')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_8, [\n _createElementVNode(\"div\", {\n class: \"title\",\n \"data-range\": `(${range.value[0]} ~ ${range.value[1]})`\n }, \"自定义范围:\", 8, _hoisted_9),\n _createVNode(_component_Slider, {\n class: \"config-item\",\n range: \"\",\n min: 1,\n max: _unref(slides).length,\n step: 1,\n value: range.value,\n \"onUpdate:value\": _cache[1] || (_cache[1] = ($event: any) => ((range).value = $event))\n }, null, 8, [\"max\", \"value\"])\n ]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createElementVNode(\"div\", _hoisted_12, [\n _createVNode(_component_Switch, {\n checked: masterOverwrite.value,\n \"onUpdate:checked\": _cache[2] || (_cache[2] = ($event: any) => ((masterOverwrite).value = $event))\n }, null, 8, [\"checked\"])\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_13, [\n _createVNode(_component_Button, {\n class: \"btn export\",\n type: \"primary\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (_unref(exportPPTX)(_unref(selectedSlides), masterOverwrite.value)))\n }, {\n default: _withCtx(() => [\n _hoisted_14\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn close\",\n onClick: _cache[4] || (_cache[4] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_15\n ]),\n _: 1\n })\n ]),\n _createVNode(_component_FullscreenSpin, {\n loading: _unref(exporting),\n tip: \"正在导出...\"\n }, null, 8, [\"loading\"])\n ]))\n}\n}\n\n})","import script from \"./ExportPPTX.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ExportPPTX.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ExportPPTX.vue?vue&type=style&index=0&id=3fef9be0&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-3fef9be0\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createElementVNode as _createElementVNode, createTextVNode as _createTextVNode, resolveComponent as _resolveComponent, withCtx as _withCtx, createVNode as _createVNode, unref as _unref, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-e2b465d2\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-pptist-dialog\" }\nconst _hoisted_2 = { class: \"configs\" }\nconst _hoisted_3 = { class: \"row\" }\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"title\" }, \"导出范围:\", -1))\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\"全部\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"当前页\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"自定义\")\nconst _hoisted_8 = {\n key: 0,\n class: \"row\"\n}\nconst _hoisted_9 = [\"data-range\"]\nconst _hoisted_10 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"tip\" }, \" 提示:.pptist 是本应用的特有文件后缀,支持将该类型的文件导入回应用中。 \", -1))\nconst _hoisted_11 = { class: \"btns\" }\nconst _hoisted_12 = /*#__PURE__*/_createTextVNode(\"导出 .pptist 文件\")\nconst _hoisted_13 = /*#__PURE__*/_createTextVNode(\"关闭\")\n\nimport { computed, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useExport from '@/hooks/useExport'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ExportSpecificFile',\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\n\n\nconst { slides, currentSlide } = storeToRefs(useSlidesStore())\n\nconst { exportSpecificFile } = useExport()\n\nconst rangeType = ref<'all' | 'current' | 'custom'>('all')\nconst range = ref<[number, number]>([1, slides.value.length])\n\nconst selectedSlides = computed(() => {\n if (rangeType.value === 'all') return slides.value\n if (rangeType.value === 'current') return [currentSlide.value]\n return slides.value.filter((item, index) => {\n const [min, max] = range.value\n return index >= min - 1 && index <= max - 1\n })\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_Slider = _resolveComponent(\"Slider\")!\n const _component_Button = _resolveComponent(\"Button\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", _hoisted_3, [\n _hoisted_4,\n _createVNode(_component_RadioGroup, {\n class: \"config-item\",\n value: rangeType.value,\n \"onUpdate:value\": _cache[0] || (_cache[0] = ($event: any) => ((rangeType).value = $event))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"all\"\n }, {\n default: _withCtx(() => [\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"current\"\n }, {\n default: _withCtx(() => [\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n style: {\"width\":\"33.33%\"},\n value: \"custom\"\n }, {\n default: _withCtx(() => [\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"])\n ]),\n (rangeType.value === 'custom')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_8, [\n _createElementVNode(\"div\", {\n class: \"title\",\n \"data-range\": `(${range.value[0]} ~ ${range.value[1]})`\n }, \"自定义范围:\", 8, _hoisted_9),\n _createVNode(_component_Slider, {\n class: \"config-item\",\n range: \"\",\n min: 1,\n max: _unref(slides).length,\n step: 1,\n value: range.value,\n \"onUpdate:value\": _cache[1] || (_cache[1] = ($event: any) => ((range).value = $event))\n }, null, 8, [\"max\", \"value\"])\n ]))\n : _createCommentVNode(\"\", true),\n _hoisted_10\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n _createVNode(_component_Button, {\n class: \"btn export\",\n type: \"primary\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_unref(exportSpecificFile)(_unref(selectedSlides))))\n }, {\n default: _withCtx(() => [\n _hoisted_12\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n class: \"btn close\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (emit('close')))\n }, {\n default: _withCtx(() => [\n _hoisted_13\n ]),\n _: 1\n })\n ])\n ]))\n}\n}\n\n})","import script from \"./ExportSpecificFile.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ExportSpecificFile.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ExportSpecificFile.vue?vue&type=style&index=0&id=e2b465d2&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-e2b465d2\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, unref as _unref, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveDynamicComponent as _resolveDynamicComponent, createBlock as _createBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1f8f1a8b\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"export-dialog\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"content\" }\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport { DialogForExportTypes } from '@/types/export'\n\nimport ExportImage from './ExportImage.vue'\nimport ExportJSON from './ExportJSON.vue'\nimport ExportPDF from './ExportPDF.vue'\nimport ExportPPTX from './ExportPPTX.vue'\nimport ExportSpecificFile from './ExportSpecificFile.vue'\n\ninterface TabItem {\n key: DialogForExportTypes\n label: string\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst { dialogForExport } = storeToRefs(mainStore)\n\nconst setDialogForExport = mainStore.setDialogForExport\n\nconst tabs: TabItem[] = [\n { key: 'pptist', label: '导出 pptist 文件' },\n { key: 'pptx', label: '导出 PPTX' },\n { key: 'image', label: '导出图片' },\n { key: 'json', label: '导出 JSON' },\n { key: 'pdf', label: '打印 / 导出 PDF' },\n]\n\nconst currentDialogComponent = computed(() => {\n const dialogMap = {\n 'image': ExportImage,\n 'json': ExportJSON,\n 'pdf': ExportPDF,\n 'pptx': ExportPPTX,\n 'pptist': ExportSpecificFile,\n }\n return dialogMap[dialogForExport.value] || null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (tab) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': tab.key === _unref(dialogForExport) }]),\n key: tab.key,\n onClick: ($event: any) => (_unref(setDialogForExport)(tab.key))\n }, _toDisplayString(tab.label), 11, _hoisted_3)\n }), 64))\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentDialogComponent)), {\n onClose: _cache[0] || (_cache[0] = ($event: any) => (_unref(setDialogForExport)('')))\n }, null, 32))\n ])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=1f8f1a8b&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1f8f1a8b\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, unref as _unref, resolveComponent as _resolveComponent, withCtx as _withCtx, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-328e1a4e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"pptist-editor\" }\nconst _hoisted_2 = { class: \"layout-content\" }\nconst _hoisted_3 = { class: \"layout-content-center\" }\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore } from '@/store'\nimport useGlobalHotkey from '@/hooks/useGlobalHotkey'\nimport usePasteEvent from '@/hooks/usePasteEvent'\n\nimport EditorHeader from './EditorHeader/index.vue'\nimport Canvas from './Canvas/index.vue'\nimport CanvasTool from './CanvasTool/index.vue'\nimport Thumbnails from './Thumbnails/index.vue'\nimport Toolbar from './Toolbar/index.vue'\nimport Remark from './Remark/index.vue'\nimport ExportDialog from './ExportDialog/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mainStore = useMainStore()\nconst { dialogForExport } = storeToRefs(mainStore)\nconst closeExportDialog = () => mainStore.setDialogForExport('')\n\nconst remarkHeight = ref(40)\n\nuseGlobalHotkey()\nusePasteEvent()\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Modal = _resolveComponent(\"Modal\")!\n\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createVNode(EditorHeader, { class: \"layout-header\" }),\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(Thumbnails, { class: \"layout-content-left\" }),\n _createElementVNode(\"div\", _hoisted_3, [\n _createVNode(CanvasTool, { class: \"center-top\" }),\n _createVNode(Canvas, {\n class: \"center-body\",\n style: _normalizeStyle({ height: `calc(100% - ${remarkHeight.value + 40}px)` })\n }, null, 8, [\"style\"]),\n _createVNode(Remark, {\n class: \"center-bottom\",\n height: remarkHeight.value,\n \"onUpdate:height\": _cache[0] || (_cache[0] = ($event: any) => ((remarkHeight).value = $event)),\n style: _normalizeStyle({ height: `${remarkHeight.value}px` })\n }, null, 8, [\"height\", \"style\"])\n ]),\n _createVNode(Toolbar, { class: \"layout-content-right\" })\n ])\n ]),\n _createVNode(_component_Modal, {\n visible: !!_unref(dialogForExport),\n footer: null,\n centered: \"\",\n closable: false,\n width: 680,\n destroyOnClose: \"\",\n onCancel: _cache[1] || (_cache[1] = ($event: any) => (closeExportDialog()))\n }, {\n default: _withCtx(() => [\n _createVNode(ExportDialog)\n ]),\n _: 1\n }, 8, [\"visible\"])\n ], 64))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=328e1a4e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-328e1a4e\"]])\n\nexport default __exports__","import { onMounted, onUnmounted, ref } from 'vue'\nimport { throttle } from 'lodash'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { KEYS } from '@/configs/hotkey'\nimport { ANIMATION_CLASS_PREFIX } from '@/configs/animation'\n\nimport { message } from 'ant-design-vue'\n\nexport default () => {\n const slidesStore = useSlidesStore()\n const { slides, slideIndex, formatedAnimations } = storeToRefs(slidesStore)\n\n // 当前页的元素动画执行到的位置\n const animationIndex = ref(0)\n\n // 动画执行状态\n const inAnimation = ref(false)\n\n // 最小已播放页面索引\n const playedSlidesMinIndex = ref(slideIndex.value)\n\n // 执行元素动画\n const runAnimation = () => {\n // 正在执行动画时,禁止其他新的动画开始\n if (inAnimation.value) return\n\n const { animations, autoNext } = formatedAnimations.value[animationIndex.value]\n animationIndex.value += 1\n\n // 标记开始执行动画\n inAnimation.value = true\n\n let endAnimationCount = 0\n\n // 依次执行该位置中的全部动画\n for (const animation of animations) {\n const elRef: HTMLElement | null = document.querySelector(`#screen-element-${animation.elId} [class^=base-element-]`)\n if (!elRef) {\n endAnimationCount += 1\n continue\n }\n\n const animationName = `${ANIMATION_CLASS_PREFIX}${animation.effect}`\n \n // 执行动画前先清除原有的动画状态(如果有)\n elRef.style.removeProperty('--animate-duration')\n for (const classname of elRef.classList) {\n if (classname.indexOf(ANIMATION_CLASS_PREFIX) !== -1) elRef.classList.remove(classname, `${ANIMATION_CLASS_PREFIX}animated`)\n }\n \n // 执行动画\n elRef.style.setProperty('--animate-duration', `${animation.duration}ms`)\n elRef.classList.add(animationName, `${ANIMATION_CLASS_PREFIX}animated`)\n\n // 执行动画结束,将“退场”以外的动画状态清除\n const handleAnimationEnd = () => {\n if (animation.type !== 'out') {\n elRef.style.removeProperty('--animate-duration')\n elRef.classList.remove(animationName, `${ANIMATION_CLASS_PREFIX}animated`)\n }\n\n // 判断该位置上的全部动画都已经结束后,标记动画执行完成,并尝试继续向下执行(如果有需要)\n endAnimationCount += 1\n if (endAnimationCount === animations.length) {\n inAnimation.value = false\n if (autoNext) runAnimation()\n }\n }\n elRef.addEventListener('animationend', handleAnimationEnd, { once: true })\n }\n }\n\n // 撤销元素动画,除了将索引前移外,还需要清除动画状态\n const revokeAnimation = () => {\n animationIndex.value -= 1\n const { animations } = formatedAnimations.value[animationIndex.value]\n\n for (const animation of animations) {\n const elRef: HTMLElement | null = document.querySelector(`#screen-element-${animation.elId} [class^=base-element-]`)\n if (!elRef) continue\n \n elRef.style.removeProperty('--animate-duration')\n for (const classname of elRef.classList) {\n if (classname.indexOf(ANIMATION_CLASS_PREFIX) !== -1) elRef.classList.remove(classname, `${ANIMATION_CLASS_PREFIX}animated`)\n }\n }\n\n // 如果撤销时该位置有且仅有强调动画,则继续执行一次撤销\n if (animations.every(item => item.type === 'attention')) execPrev()\n }\n\n // 关闭自动播放\n const autoPlayTimer = ref(0)\n const closeAutoPlay = () => {\n if (autoPlayTimer.value) {\n clearInterval(autoPlayTimer.value)\n autoPlayTimer.value = 0\n }\n }\n onUnmounted(closeAutoPlay)\n\n const throttleMassage = throttle(function(msg) {\n message.success(msg)\n }, 1000, { leading: true, trailing: false })\n\n // 向上/向下播放\n // 遇到元素动画时,优先执行动画播放,无动画则执行翻页\n // 向上播放遇到动画时,仅撤销到动画执行前的状态,不需要反向播放动画\n // 撤回到上一页时,若该页从未播放过(意味着不存在动画状态),需要将动画索引置为最小值(初始状态),否则置为最大值(最终状态)\n const execPrev = () => {\n if (formatedAnimations.value.length && animationIndex.value > 0) {\n revokeAnimation()\n }\n else if (slideIndex.value > 0) {\n slidesStore.updateSlideIndex(slideIndex.value - 1)\n if (slideIndex.value < playedSlidesMinIndex.value) {\n animationIndex.value = 0\n playedSlidesMinIndex.value = slideIndex.value\n }\n else animationIndex.value = formatedAnimations.value.length\n }\n else {\n throttleMassage('已经是第一页了')\n }\n inAnimation.value = false\n }\n const execNext = () => {\n if (formatedAnimations.value.length && animationIndex.value < formatedAnimations.value.length) {\n runAnimation()\n }\n else if (slideIndex.value < slides.value.length - 1) {\n slidesStore.updateSlideIndex(slideIndex.value + 1)\n animationIndex.value = 0\n inAnimation.value = false\n }\n else {\n throttleMassage('已经是最后一页了')\n closeAutoPlay()\n inAnimation.value = false\n }\n }\n\n // 自动播放\n const autoPlay = () => {\n closeAutoPlay()\n message.success('开始自动放映')\n autoPlayTimer.value = setInterval(execNext, 2500)\n }\n\n // 鼠标滚动翻页\n const mousewheelListener = throttle(function(e: WheelEvent) {\n if (e.deltaY < 0) execPrev()\n else if (e.deltaY > 0) execNext()\n }, 500, { leading: true, trailing: false })\n\n // 触摸屏上下滑动翻页\n const touchInfo = ref<{ x: number; y: number; } | null>(null)\n\n const touchStartListener = (e: TouchEvent) => {\n touchInfo.value = {\n x: e.changedTouches[0].pageX,\n y: e.changedTouches[0].pageY,\n }\n }\n const touchEndListener = (e: TouchEvent) => {\n if (!touchInfo.value) return\n\n const offsetX = Math.abs(touchInfo.value.x - e.changedTouches[0].pageX)\n const offsetY = e.changedTouches[0].pageY - touchInfo.value.y\n\n if ( Math.abs(offsetY) > offsetX && Math.abs(offsetY) > 50 ) {\n touchInfo.value = null\n\n if (offsetY > 0) execPrev()\n else execNext()\n }\n }\n\n // 快捷键翻页\n const keydownListener = (e: KeyboardEvent) => {\n const key = e.key.toUpperCase()\n\n if (key === KEYS.UP || key === KEYS.LEFT || key === KEYS.PAGEUP) execPrev()\n else if (\n key === KEYS.DOWN || \n key === KEYS.RIGHT ||\n key === KEYS.SPACE || \n key === KEYS.ENTER ||\n key === KEYS.PAGEDOWN\n ) execNext()\n }\n\n onMounted(() => document.addEventListener('keydown', keydownListener))\n onUnmounted(() => document.removeEventListener('keydown', keydownListener))\n\n // 切换到上一张/上一张幻灯片(无视元素的入场动画)\n const turnPrevSlide = () => {\n slidesStore.updateSlideIndex(slideIndex.value - 1)\n animationIndex.value = 0\n }\n const turnNextSlide = () => {\n slidesStore.updateSlideIndex(slideIndex.value + 1)\n animationIndex.value = 0\n }\n\n // 切换幻灯片到指定的页面\n const turnSlideToIndex = (index: number) => {\n slidesStore.updateSlideIndex(index)\n animationIndex.value = 0\n }\n const turnSlideToId = (id: string) => {\n const index = slides.value.findIndex(slide => slide.id === id)\n if (index !== -1) {\n slidesStore.updateSlideIndex(index)\n animationIndex.value = 0\n }\n }\n\n return {\n autoPlayTimer,\n autoPlay,\n closeAutoPlay,\n mousewheelListener,\n touchStartListener,\n touchEndListener,\n turnPrevSlide,\n turnNextSlide,\n turnSlideToIndex,\n turnSlideToId,\n execPrev,\n execNext,\n animationIndex,\n }\n}\n","import { onMounted, onUnmounted, Ref, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\n\nexport default (wrapRef?: Ref) => {\n const slidesStore = useSlidesStore()\n const { viewportRatio } = storeToRefs(slidesStore)\n\n const slideWidth = ref(0)\n const slideHeight = ref(0)\n\n // 计算和更新幻灯片内容的尺寸(按比例自适应屏幕)\n const setSlideContentSize = () => {\n const slideWrapRef = wrapRef?.value || document.body\n const winWidth = slideWrapRef.clientWidth\n const winHeight = slideWrapRef.clientHeight\n let width, height\n\n if (winHeight / winWidth === viewportRatio.value) {\n width = winWidth\n height = winHeight\n }\n else if (winHeight / winWidth > viewportRatio.value) {\n width = winWidth\n height = winWidth * viewportRatio.value\n }\n else {\n width = winHeight / viewportRatio.value\n height = winHeight\n }\n slideWidth.value = width\n slideHeight.value = height\n }\n\n onMounted(() => {\n setSlideContentSize()\n window.addEventListener('resize', setSlideContentSize)\n })\n onUnmounted(() => {\n window.removeEventListener('resize', setSlideContentSize)\n })\n\n return {\n slideWidth,\n slideHeight,\n }\n}","import { onMounted, onUnmounted, ref } from 'vue'\nimport { isFullscreen, exitFullscreen } from '@/utils/fullscreen'\nimport useScreening from '@/hooks/useScreening'\n\nexport default () => {\n const fullscreenState = ref(true)\n const escExit = ref(true)\n\n const { exitScreening } = useScreening()\n\n const handleFullscreenChange = () => {\n fullscreenState.value = isFullscreen()\n if (!fullscreenState.value && escExit.value) exitScreening()\n\n escExit.value = true\n }\n\n onMounted(() => {\n fullscreenState.value = isFullscreen()\n document.addEventListener('fullscreenchange', handleFullscreenChange)\n document.addEventListener('webkitfullscreenchange', handleFullscreenChange) // Safari 兼容\n })\n onUnmounted(() => {\n document.removeEventListener('fullscreenchange', handleFullscreenChange)\n document.removeEventListener('webkitfullscreenchange', handleFullscreenChange)\n })\n\n const manualExitFullscreen = () => {\n if (!fullscreenState.value) return\n escExit.value = false\n exitFullscreen()\n }\n\n return {\n fullscreenState,\n manualExitFullscreen,\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createBlock as _createBlock } from \"vue\"\n\nimport { PropType } from 'vue'\nimport { PPTChartElement } from '@/types/slides'\n\nimport BaseChartElement from './BaseChartElement.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenChartElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createBlock(BaseChartElement, {\n class: \"screen-element-chart\",\n elementInfo: __props.elementInfo\n }, null, 8, [\"elementInfo\"]))\n}\n}\n\n})","import script from \"./ScreenChartElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenChartElement.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-76457308\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\n\nimport { computed, inject, PropType, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { PPTVideoElement } from '@/types/slides'\nimport { injectKeySlideId, injectKeySlideScale } from '@/types/injectKey'\n\nimport VideoPlayer from './VideoPlayer/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenVideoElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { currentSlide } = storeToRefs(useSlidesStore())\n\nconst scale = inject(injectKeySlideScale) || ref(1)\nconst slideId = inject(injectKeySlideId) || ref('')\n\nconst inCurrentSlide = computed(() => currentSlide.value.id === slideId.value)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"screen-element-video\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n (_unref(inCurrentSlide))\n ? (_openBlock(), _createBlock(VideoPlayer, {\n key: 0,\n width: __props.elementInfo.width,\n height: __props.elementInfo.height,\n src: __props.elementInfo.src,\n poster: __props.elementInfo.poster,\n scale: _unref(scale)\n }, null, 8, [\"width\", \"height\", \"src\", \"poster\", \"scale\"]))\n : _createCommentVNode(\"\", true)\n ])\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./ScreenVideoElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenVideoElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ScreenVideoElement.vue?vue&type=style&index=0&id=76457308&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-76457308\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, normalizeStyle as _normalizeStyle, createVNode as _createVNode, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementVNode as _createElementVNode, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1172b8ee\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-content\" }\n\nimport { computed, inject, PropType, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { PPTAudioElement } from '@/types/slides'\nimport { injectKeySlideId, injectKeySlideScale } from '@/types/injectKey'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\n\nimport AudioPlayer from './AudioPlayer.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenAudioElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { viewportRatio, currentSlide } = storeToRefs(useSlidesStore())\n\nconst scale = inject(injectKeySlideScale) || ref(1)\nconst slideId = inject(injectKeySlideId) || ref('')\n\nconst inCurrentSlide = computed(() => currentSlide.value.id === slideId.value)\n\nconst audioIconSize = computed(() => {\n return Math.min(props.elementInfo.width, props.elementInfo.height) + 'px'\n})\nconst audioPlayerPosition = computed(() => {\n const canvasWidth = VIEWPORT_SIZE\n const canvasHeight = VIEWPORT_SIZE * viewportRatio.value\n\n const audioWidth = 280 / scale.value\n const audioHeight = 50 / scale.value\n\n const elWidth = props.elementInfo.width\n const elHeight = props.elementInfo.height\n const elLeft = props.elementInfo.left\n const elTop = props.elementInfo.top\n\n let left = 0\n let top = elHeight\n \n if (elLeft + audioWidth >= canvasWidth) left = elWidth - audioWidth\n if (elTop + elHeight + audioHeight >= canvasHeight) top = -audioHeight\n\n return {\n left: left + 'px',\n top: top + 'px',\n }\n})\n\nconst audioPlayerRef = ref()\nconst toggle = () => {\n if (!audioPlayerRef.value) return\n audioPlayerRef.value.toggle()\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconVolumeNotice = _resolveComponent(\"IconVolumeNotice\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"screen-element-audio\",\n style: _normalizeStyle({\n top: __props.elementInfo.top + 'px',\n left: __props.elementInfo.left + 'px',\n width: __props.elementInfo.width + 'px',\n height: __props.elementInfo.height + 'px',\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"rotate-wrapper\",\n style: _normalizeStyle({ transform: `rotate(${__props.elementInfo.rotate}deg)` })\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createVNode(_component_IconVolumeNotice, {\n class: \"audio-icon\",\n style: _normalizeStyle({\n fontSize: _unref(audioIconSize),\n color: __props.elementInfo.color,\n }),\n onClick: _cache[0] || (_cache[0] = ($event: any) => (toggle()))\n }, null, 8, [\"style\"]),\n (_unref(inCurrentSlide))\n ? (_openBlock(), _createBlock(AudioPlayer, {\n key: 0,\n class: \"audio-player\",\n ref_key: \"audioPlayerRef\",\n ref: audioPlayerRef,\n style: _normalizeStyle({ ..._unref(audioPlayerPosition) }),\n src: __props.elementInfo.src,\n loop: __props.elementInfo.loop,\n autoplay: __props.elementInfo.autoplay,\n scale: _unref(scale)\n }, null, 8, [\"style\", \"src\", \"loop\", \"autoplay\", \"scale\"]))\n : _createCommentVNode(\"\", true)\n ])\n ], 4)\n ], 4))\n}\n}\n\n})","import script from \"./ScreenAudioElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenAudioElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ScreenAudioElement.vue?vue&type=style&index=0&id=1172b8ee&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1172b8ee\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, normalizeClass as _normalizeClass, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-a15cc1d8\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"id\", \"title\"]\n\nimport { computed, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { ElementTypes, PPTElement } from '@/types/slides'\n\nimport BaseImageElement from '@/views/components/element/ImageElement/BaseImageElement.vue'\nimport BaseTextElement from '@/views/components/element/TextElement/BaseTextElement.vue'\nimport BaseShapeElement from '@/views/components/element/ShapeElement/BaseShapeElement.vue'\nimport BaseLineElement from '@/views/components/element/LineElement/BaseLineElement.vue'\nimport ScreenChartElement from '@/views/components/element/ChartElement/ScreenChartElement.vue'\nimport BaseTableElement from '@/views/components/element/TableElement/BaseTableElement.vue'\nimport BaseLatexElement from '@/views/components/element/LatexElement/BaseLatexElement.vue'\nimport ScreenVideoElement from '@/views/components/element/VideoElement/ScreenVideoElement.vue'\nimport ScreenAudioElement from '@/views/components/element/AudioElement/ScreenAudioElement.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n elementIndex: {\n type: Number,\n required: true,\n },\n animationIndex: {\n type: Number,\n required: true,\n },\n turnSlideToId: {\n type: Function as PropType<(id: string) => void>,\n required: true,\n },\n manualExitFullscreen: {\n type: Function as PropType<() => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst currentElementComponent = computed(() => {\n const elementTypeMap = {\n [ElementTypes.IMAGE]: BaseImageElement,\n [ElementTypes.TEXT]: BaseTextElement,\n [ElementTypes.SHAPE]: BaseShapeElement,\n [ElementTypes.LINE]: BaseLineElement,\n [ElementTypes.CHART]: ScreenChartElement,\n [ElementTypes.TABLE]: BaseTableElement,\n [ElementTypes.LATEX]: BaseLatexElement,\n [ElementTypes.VIDEO]: ScreenVideoElement,\n [ElementTypes.AUDIO]: ScreenAudioElement,\n }\n return elementTypeMap[props.elementInfo.type] || null\n})\n\nconst { formatedAnimations, theme } = storeToRefs(useSlidesStore())\n\n// 判断元素是否需要等待执行入场动画:等待执行入场的元素需要先隐藏\nconst needWaitAnimation = computed(() => {\n // 该元素在本页动画序列中的位置\n const elementIndexInAnimation = formatedAnimations.value.findIndex(item => {\n const elIds = item.animations.map(item => item.elId)\n return elIds.includes(props.elementInfo.id)\n })\n\n // 该元素未设置过动画\n if (elementIndexInAnimation === -1) return false\n\n // 若该元素已执行过动画,都无须隐藏\n // 具体来说:若已执行的最后一个动画为入场,显然无须隐藏;若已执行的最后一个动画为退场,由于保留了退场动画结束状态,也无需额外隐藏\n if (elementIndexInAnimation < props.animationIndex) return false\n\n // 若该元素未执行过动画,获取其将要执行的第一个动画\n // 若将要执行的第一个动画为入场,则需要隐藏,否则无须隐藏\n const firstAnimation = formatedAnimations.value[elementIndexInAnimation].animations.find(item => item.elId === props.elementInfo.id)\n if (firstAnimation?.type === 'in') return true\n return false\n})\n\n// 打开元素绑定的超链接\nconst openLink = () => {\n const link = props.elementInfo.link\n if (!link) return\n\n if (link.type === 'web') {\n props.manualExitFullscreen()\n window.open(link.target)\n }\n else if (link.type === 'slide') {\n props.turnSlideToId(link.target)\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"screen-element\", { 'link': __props.elementInfo.link }]),\n id: `screen-element-${__props.elementInfo.id}`,\n style: _normalizeStyle({\n zIndex: __props.elementIndex,\n color: _unref(theme).fontColor,\n fontFamily: _unref(theme).fontName,\n visibility: _unref(needWaitAnimation) ? 'hidden' : 'visible',\n }),\n title: __props.elementInfo.link?.target || '',\n onClick: _cache[0] || (_cache[0] = ($event: any) => (openLink()))\n }, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentElementComponent)), { elementInfo: __props.elementInfo }, null, 8, [\"elementInfo\"]))\n ], 14, _hoisted_1))\n}\n}\n\n})","import script from \"./ScreenElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenElement.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ScreenElement.vue?vue&type=style&index=0&id=a15cc1d8&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-a15cc1d8\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock } from \"vue\"\n\nimport { computed, PropType, provide } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { Slide } from '@/types/slides'\nimport { injectKeySlideId } from '@/types/injectKey'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'\n\nimport ScreenElement from './ScreenElement.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenSlide',\n props: {\n slide: {\n type: Object as PropType,\n required: true,\n },\n scale: {\n type: Number,\n required: true,\n },\n animationIndex: {\n type: Number,\n required: true,\n },\n turnSlideToId: {\n type: Function as PropType<(id: string) => void>,\n required: true,\n },\n manualExitFullscreen: {\n type: Function as PropType<() => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { viewportRatio } = storeToRefs(useSlidesStore())\n\nconst background = computed(() => props.slide.background)\nconst { backgroundStyle } = useSlideBackgroundStyle(background)\n\nconst slideId = computed(() => props.slide.id)\nprovide(injectKeySlideId, slideId)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"screen-slide\",\n style: _normalizeStyle({\n width: _unref(VIEWPORT_SIZE) + 'px',\n height: _unref(VIEWPORT_SIZE) * _unref(viewportRatio) + 'px',\n transform: `scale(${__props.scale})`,\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"background\",\n style: _normalizeStyle({ ..._unref(backgroundStyle) })\n }, null, 4),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.slide.elements, (element, index) => {\n return (_openBlock(), _createBlock(ScreenElement, {\n key: element.id,\n elementInfo: element,\n elementIndex: index + 1,\n animationIndex: __props.animationIndex,\n turnSlideToId: __props.turnSlideToId,\n manualExitFullscreen: __props.manualExitFullscreen\n }, null, 8, [\"elementInfo\", \"elementIndex\", \"animationIndex\", \"turnSlideToId\", \"manualExitFullscreen\"]))\n }), 128))\n ], 4))\n}\n}\n\n})","import script from \"./ScreenSlide.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenSlide.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ScreenSlide.vue?vue&type=style&index=0&id=7cf7f9e7&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7cf7f9e7\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-77a3e620\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"screen-slide-list\" }\n\nimport { computed, PropType, provide } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { injectKeySlideScale } from '@/types/injectKey'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\n\nimport ScreenSlide from './ScreenSlide.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ScreenSlideList',\n props: {\n slideWidth: {\n type: Number,\n required: true,\n },\n slideHeight: {\n type: Number,\n required: true,\n },\n animationIndex: {\n type: Number,\n required: true,\n },\n turnSlideToId: {\n type: Function as PropType<(id: string) => void>,\n required: true,\n },\n manualExitFullscreen: {\n type: Function as PropType<() => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { slides, slideIndex, currentSlide } = storeToRefs(useSlidesStore())\n\nconst scale = computed(() => props.slideWidth / VIEWPORT_SIZE)\nprovide(injectKeySlideScale, scale)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\n 'slide-item', \n `turning-mode-${slide.turningMode || 'slideY'}`,\n {\n 'current': index === _unref(slideIndex),\n 'before': index < _unref(slideIndex),\n 'after': index > _unref(slideIndex),\n 'hide': (index === _unref(slideIndex) - 1 || index === _unref(slideIndex) + 1) && slide.turningMode !== _unref(currentSlide).turningMode,\n }\n ]),\n key: slide.id\n }, [\n (Math.abs(_unref(slideIndex) - index) < 2 || slide.animations?.length)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"slide-content\",\n style: _normalizeStyle({\n width: __props.slideWidth + 'px',\n height: __props.slideHeight + 'px',\n })\n }, [\n _createVNode(ScreenSlide, {\n slide: slide,\n scale: _unref(scale),\n animationIndex: __props.animationIndex,\n turnSlideToId: __props.turnSlideToId,\n manualExitFullscreen: __props.manualExitFullscreen\n }, null, 8, [\"slide\", \"scale\", \"animationIndex\", \"turnSlideToId\", \"manualExitFullscreen\"])\n ], 4))\n : _createCommentVNode(\"\", true)\n ], 2))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./ScreenSlideList.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ScreenSlideList.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ScreenSlideList.vue?vue&type=style&index=0&id=77a3e620&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-77a3e620\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createElementVNode as _createElementVNode, unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-b7c6c0cc\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"slide-thumbnails\" }\nconst _hoisted_2 = { class: \"return-button\" }\nconst _hoisted_3 = { class: \"slide-thumbnails-content\" }\nconst _hoisted_4 = [\"onClick\"]\n\nimport { PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useLoadSlides from '@/hooks/useLoadSlides'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SlideThumbnails',\n props: {\n turnSlideToIndex: {\n type: Function as PropType<(index: number) => void>,\n required: true,\n },\n},\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst { slides, slideIndex } = storeToRefs(useSlidesStore())\n\nconst { slidesLoadLimit } = useLoadSlides()\n\nconst turnSlide = (index: number) => {\n props.turnSlideToIndex(index)\n emit('close')\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconArrowCircleLeft = _resolveComponent(\"IconArrowCircleLeft\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(_component_IconArrowCircleLeft, {\n class: \"icon\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (emit('close')))\n })\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"thumbnail\", { 'active': index === _unref(slideIndex) }]),\n key: slide.id,\n onClick: ($event: any) => (turnSlide(index))\n }, [\n _createVNode(ThumbnailSlide, {\n slide: slide,\n size: 150,\n visible: index < _unref(slidesLoadLimit)\n }, null, 8, [\"slide\", \"visible\"])\n ], 10, _hoisted_4))\n }), 128))\n ])\n ]))\n}\n}\n\n})","import script from \"./SlideThumbnails.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SlideThumbnails.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./SlideThumbnails.vue?vue&type=style&index=0&id=b7c6c0cc&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-b7c6c0cc\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, Fragment as _Fragment, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1d4eb7f0\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 0,\n class: \"blackboard\"\n}\n\nimport { computed, onMounted, onUnmounted, PropType, ref, watch } from 'vue'\nimport { throttle } from 'lodash'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'WritingBoard',\n props: {\n color: {\n type: String,\n default: '#ffcc00',\n },\n model: {\n type: String as PropType<'pen' | 'eraser' | 'mark'>,\n default: 'pen',\n },\n blackboard: {\n type: Boolean,\n default: false,\n },\n},\n setup(__props, { expose }) {\n\nconst props = __props\n\n\n\nlet ctx: CanvasRenderingContext2D | null = null\nconst writingBoardRef = ref()\nconst canvasRef = ref()\n\nconst penSize = ref(6)\nconst rubberSize = ref(80)\nconst markSize = ref(24)\n\nlet lastPos = {\n x: 0,\n y: 0,\n}\nlet isMouseDown = false\nlet lastTime = 0\nlet lastLineWidth = -1\n\n// 鼠标位置坐标:用于画笔或橡皮位置跟随\nconst mouse = ref({\n x: 0,\n y: 0,\n})\n\n// 鼠标是否处在画布范围内:处在范围内才会显示画笔或橡皮\nconst mouseInCanvas = ref(false)\n\n// 监听更新canvas尺寸\nconst canvasWidth = ref(0)\nconst canvasHeight = ref(0)\n\nconst widthScale = computed(() => canvasRef.value ? canvasWidth.value / canvasRef.value.width : 1)\nconst heightScale = computed(() => canvasRef.value ? canvasHeight.value / canvasRef.value.height : 1)\n\nconst updateCanvasSize = () => {\n if (!writingBoardRef.value) return\n canvasWidth.value = writingBoardRef.value.clientWidth\n canvasHeight.value = writingBoardRef.value.clientHeight\n}\nconst resizeObserver = new ResizeObserver(updateCanvasSize)\nonMounted(() => {\n if (writingBoardRef.value) resizeObserver.observe(writingBoardRef.value)\n})\nonUnmounted(() => {\n if (writingBoardRef.value) resizeObserver.unobserve(writingBoardRef.value)\n})\n\n// 初始化画布\nconst initCanvas = () => {\n if (!canvasRef.value || !writingBoardRef.value) return\n\n ctx = canvasRef.value.getContext('2d')\n if (!ctx) return\n\n canvasRef.value.width = writingBoardRef.value.clientWidth\n canvasRef.value.height = writingBoardRef.value.clientHeight\n\n ctx.lineCap = 'round'\n ctx.lineJoin = 'round'\n}\nonMounted(initCanvas)\n\n// 切换画笔模式时,更新 canvas ctx 配置\nconst updateCtx = () => {\n if (!ctx) return\n if (props.model === 'mark') {\n ctx.globalCompositeOperation = 'xor'\n ctx.globalAlpha = 0.5\n }\n else if (props.model === 'pen') {\n ctx.globalCompositeOperation = 'source-over'\n ctx.globalAlpha = 1\n }\n}\nwatch(() => props.model, updateCtx)\n\n// 绘制画笔墨迹方法\nconst draw = (posX: number, posY: number, lineWidth: number) => {\n if (!ctx) return\n\n const lastPosX = lastPos.x\n const lastPosY = lastPos.y\n\n ctx.lineWidth = lineWidth\n ctx.strokeStyle = props.color\n ctx.beginPath()\n ctx.moveTo(lastPosX, lastPosY)\n ctx.lineTo(posX, posY)\n ctx.stroke()\n ctx.closePath()\n}\n\n// 擦除墨迹方法\nconst erase = (posX: number, posY: number) => {\n if (!ctx || !canvasRef.value) return\n const lastPosX = lastPos.x\n const lastPosY = lastPos.y\n\n const radius = rubberSize.value / 2\n\n const sinRadius = radius * Math.sin(Math.atan((posY - lastPosY) / (posX - lastPosX)))\n const cosRadius = radius * Math.cos(Math.atan((posY - lastPosY) / (posX - lastPosX)))\n const rectPoint1: [number, number] = [lastPosX + sinRadius, lastPosY - cosRadius]\n const rectPoint2: [number, number] = [lastPosX - sinRadius, lastPosY + cosRadius]\n const rectPoint3: [number, number] = [posX + sinRadius, posY - cosRadius]\n const rectPoint4: [number, number] = [posX - sinRadius, posY + cosRadius]\n\n ctx.save()\n ctx.beginPath()\n ctx.arc(posX, posY, radius, 0, Math.PI * 2)\n ctx.clip()\n ctx.clearRect(0, 0, canvasRef.value.width, canvasRef.value.height)\n ctx.restore()\n\n ctx.save()\n ctx.beginPath()\n ctx.moveTo(...rectPoint1)\n ctx.lineTo(...rectPoint3)\n ctx.lineTo(...rectPoint4)\n ctx.lineTo(...rectPoint2)\n ctx.closePath()\n ctx.clip()\n ctx.clearRect(0, 0, canvasRef.value.width, canvasRef.value.height)\n ctx.restore()\n}\n\n// 计算鼠标两次移动之间的距离\nconst getDistance = (posX: number, posY: number) => {\n const lastPosX = lastPos.x\n const lastPosY = lastPos.y\n return Math.sqrt((posX - lastPosX) * (posX - lastPosX) + (posY - lastPosY) * (posY - lastPosY))\n}\n\n// 根据鼠标两次移动之间的距离s和时间t计算绘制速度,速度越快,墨迹越细\nconst getLineWidth = (s: number, t: number) => {\n const maxV = 10\n const minV = 0.1\n const maxWidth = penSize.value\n const minWidth = 3\n const v = s / t\n let lineWidth\n\n if (v <= minV) lineWidth = maxWidth\n else if (v >= maxV) lineWidth = minWidth\n else lineWidth = maxWidth - v / maxV * maxWidth\n\n if (lastLineWidth === -1) return lineWidth\n return lineWidth * 1 / 3 + lastLineWidth * 2 / 3\n}\n\n// 路径操作\nconst handleMove = (x: number, y: number) => {\n const time = new Date().getTime()\n\n if (props.model === 'pen') {\n const s = getDistance(x, y)\n const t = time - lastTime\n const lineWidth = getLineWidth(s, t)\n\n draw(x, y, lineWidth)\n lastLineWidth = lineWidth\n }\n else if (props.model === 'mark') draw(x, y, markSize.value)\n else erase(x, y)\n\n lastPos = { x, y }\n lastTime = new Date().getTime()\n}\n\n// 获取鼠标在canvas中的相对位置\nconst getMouseOffsetPosition = (e: MouseEvent | TouchEvent) => {\n if (!canvasRef.value) return [0, 0]\n const event = e instanceof MouseEvent ? e : e.changedTouches[0]\n const canvasRect = canvasRef.value.getBoundingClientRect()\n const x = event.pageX - canvasRect.x\n const y = event.pageY - canvasRect.y\n return [x, y]\n}\n\n// 处理鼠标(触摸)事件\n// 准备开始绘制/擦除墨迹(落笔)\nconst handleMousedown = (e: MouseEvent | TouchEvent) => {\n const [mouseX, mouseY] = getMouseOffsetPosition(e)\n const x = mouseX / widthScale.value\n const y = mouseY / heightScale.value\n\n isMouseDown = true\n lastPos = { x, y }\n lastTime = new Date().getTime()\n\n if (!(e instanceof MouseEvent)) {\n mouse.value = { x: mouseX, y: mouseY }\n mouseInCanvas.value = true\n }\n}\n\n// 开始绘制/擦除墨迹(移动)\nconst handleMousemove = (e: MouseEvent | TouchEvent) => {\n const [mouseX, mouseY] = getMouseOffsetPosition(e)\n const x = mouseX / widthScale.value\n const y = mouseY / heightScale.value\n\n mouse.value = { x: mouseX, y: mouseY }\n\n if (isMouseDown) handleMove(x, y)\n}\n\n// 结束绘制/擦除墨迹(停笔)\nconst handleMouseup = () => {\n if (!isMouseDown) return\n isMouseDown = false\n}\n\n// 清空画布\nconst clearCanvas = () => {\n if (!ctx || !canvasRef.value) return\n ctx.clearRect(0, 0, canvasRef.value.width, canvasRef.value.height)\n}\n\n// 获取 DataURL\nconst getImageDataURL = () => {\n return canvasRef.value?.toDataURL()\n}\n\n// 设置 DataURL(绘制图片到 canvas)\nconst setImageDataURL = (imageDataURL: string) => {\n const img = new Image()\n img.src = imageDataURL\n img.onload = () => {\n if (!ctx) return\n ctx.drawImage(img, 0, 0)\n }\n}\n\n// 滚动鼠标滚轮,调整笔触大小\nconst mousewheelListener = throttle(function(e: WheelEvent) {\n if (props.model === 'eraser') {\n if (e.deltaY < 0 && rubberSize.value < 200) rubberSize.value += 20\n else if (e.deltaY > 0 && rubberSize.value > 20) rubberSize.value -= 20\n }\n if (props.model === 'pen') {\n if (e.deltaY < 0 && penSize.value < 10) penSize.value += 2\n else if (e.deltaY > 0 && penSize.value > 4) penSize.value -= 2\n }\n if (props.model === 'mark') {\n if (e.deltaY < 0 && markSize.value < 40) markSize.value += 4\n else if (e.deltaY > 0 && markSize.value > 16) markSize.value -= 4\n }\n}, 300, { leading: true, trailing: false })\n\nexpose({\n clearCanvas,\n getImageDataURL,\n setImageDataURL,\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconWrite = _resolveComponent(\"IconWrite\")!\n const _component_IconHighLight = _resolveComponent(\"IconHighLight\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"writing-board\",\n ref_key: \"writingBoardRef\",\n ref: writingBoardRef\n }, [\n (__props.blackboard)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"canvas\", {\n class: \"canvas\",\n ref_key: \"canvasRef\",\n ref: canvasRef,\n style: _normalizeStyle({\n width: canvasWidth.value + 'px',\n height: canvasHeight.value + 'px',\n }),\n onMousedown: _cache[0] || (_cache[0] = $event => handleMousedown($event)),\n onMousemove: _cache[1] || (_cache[1] = $event => handleMousemove($event)),\n onMouseup: _cache[2] || (_cache[2] = ($event: any) => (handleMouseup())),\n onTouchstart: _cache[3] || (_cache[3] = $event => handleMousedown($event)),\n onTouchmove: _cache[4] || (_cache[4] = $event => handleMousemove($event)),\n onTouchend: _cache[5] || (_cache[5] = ($event: any) => {handleMouseup(); mouseInCanvas.value = false}),\n onMouseleave: _cache[6] || (_cache[6] = ($event: any) => {handleMouseup(); mouseInCanvas.value = false}),\n onMouseenter: _cache[7] || (_cache[7] = ($event: any) => (mouseInCanvas.value = true)),\n onWheel: _cache[8] || (_cache[8] = $event => _unref(mousewheelListener)($event))\n }, null, 36),\n (mouseInCanvas.value)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 1 }, [\n (__props.model === 'eraser')\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"eraser\",\n style: _normalizeStyle({\n left: mouse.value.x - rubberSize.value / 2 + 'px',\n top: mouse.value.y - rubberSize.value / 2 + 'px',\n width: rubberSize.value + 'px',\n height: rubberSize.value + 'px',\n })\n }, null, 4))\n : _createCommentVNode(\"\", true),\n (__props.model === 'pen')\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 1,\n class: \"pen\",\n style: _normalizeStyle({\n left: mouse.value.x - penSize.value / 2 + 'px',\n top: mouse.value.y - penSize.value * 6 + penSize.value / 2 + 'px',\n color: __props.color,\n })\n }, [\n (__props.model === 'pen')\n ? (_openBlock(), _createBlock(_component_IconWrite, {\n key: 0,\n class: \"icon\",\n size: penSize.value * 6\n }, null, 8, [\"size\"]))\n : _createCommentVNode(\"\", true)\n ], 4))\n : _createCommentVNode(\"\", true),\n (__props.model === 'mark')\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 2,\n class: \"pen\",\n style: _normalizeStyle({\n left: mouse.value.x - markSize.value / 2 + 'px',\n top: mouse.value.y + 'px',\n color: __props.color,\n })\n }, [\n (__props.model === 'mark')\n ? (_openBlock(), _createBlock(_component_IconHighLight, {\n key: 0,\n class: \"icon\",\n size: markSize.value * 1.5\n }, null, 8, [\"size\"]))\n : _createCommentVNode(\"\", true)\n ], 4))\n : _createCommentVNode(\"\", true)\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 512))\n}\n}\n\n})","import script from \"./WritingBoard.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./WritingBoard.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./WritingBoard.vue?vue&type=style&index=0&id=1d4eb7f0&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1d4eb7f0\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, normalizeClass as _normalizeClass, withCtx as _withCtx, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-876081a6\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"writing-board-tool\" }\nconst _hoisted_2 = { class: \"colors\" }\nconst _hoisted_3 = [\"onClick\"]\n\nimport { PropType, ref, StyleValue } from 'vue'\nimport WritingBoard from '@/components/WritingBoard.vue'\n\ntype WritingBoardModel = 'pen' | 'mark' | 'eraser'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'WritingBoardTool',\n props: {\n slideWidth: {\n type: Number,\n required: true,\n },\n slideHeight: {\n type: Number,\n required: true,\n },\n position: {\n type: Object as PropType,\n default: () => ({\n right: '5px',\n bottom: '5px',\n })\n },\n},\n emits: [\"close\"],\n setup(__props, { emit }: { emit: ({\n (event: 'close'): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst writingBoardColors = ['#000000', '#ffffff', '#1e497b', '#4e81bb', '#e2534d', '#9aba60', '#8165a0', '#47acc5', '#f9974c', '#ffff3a']\n\n\n\n\n\nconst writingBoardRef = ref()\nconst writingBoardColor = ref('#e2534d')\nconst writingBoardModel = ref('pen')\nconst blackboard = ref(false)\n\nconst changeModel = (model: WritingBoardModel) => {\n writingBoardModel.value = model\n}\n\n// 清除画布上的墨迹\nconst clearCanvas = () => {\n writingBoardRef.value!.clearCanvas()\n}\n\n// 修改画笔颜色,如果当前处于橡皮状态则先切换到画笔状态\nconst changeColor = (color: string) => {\n if (writingBoardModel.value === 'eraser') writingBoardModel.value = 'pen'\n writingBoardColor.value = color\n}\n\n// 关闭写字板\nconst closeWritingBoard = () => {\n emit('close')\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconWrite = _resolveComponent(\"IconWrite\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconHighLight = _resolveComponent(\"IconHighLight\")!\n const _component_IconErase = _resolveComponent(\"IconErase\")!\n const _component_IconClear = _resolveComponent(\"IconClear\")!\n const _component_IconFill = _resolveComponent(\"IconFill\")!\n const _component_IconClose = _resolveComponent(\"IconClose\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"writing-board-wrap\",\n style: _normalizeStyle({\n width: __props.slideWidth + 'px',\n height: __props.slideHeight + 'px',\n })\n }, [\n _createVNode(WritingBoard, {\n ref_key: \"writingBoardRef\",\n ref: writingBoardRef,\n color: writingBoardColor.value,\n blackboard: blackboard.value,\n model: writingBoardModel.value\n }, null, 8, [\"color\", \"blackboard\", \"model\"])\n ], 4),\n _createElementVNode(\"div\", {\n class: \"tools\",\n style: _normalizeStyle(__props.position)\n }, [\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"画笔\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"btn\", { 'active': writingBoardModel.value === 'pen' }]),\n onClick: _cache[0] || (_cache[0] = ($event: any) => (changeModel('pen')))\n }, [\n _createVNode(_component_IconWrite, { class: \"icon\" })\n ], 2)\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"荧光笔\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"btn\", { 'active': writingBoardModel.value === 'mark' }]),\n onClick: _cache[1] || (_cache[1] = ($event: any) => (changeModel('mark')))\n }, [\n _createVNode(_component_IconHighLight, { class: \"icon\" })\n ], 2)\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"橡皮擦\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"btn\", { 'active': writingBoardModel.value === 'eraser' }]),\n onClick: _cache[2] || (_cache[2] = ($event: any) => (changeModel('eraser')))\n }, [\n _createVNode(_component_IconErase, { class: \"icon\" })\n ], 2)\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"清除墨迹\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: \"btn\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (clearCanvas()))\n }, [\n _createVNode(_component_IconClear, { class: \"icon\" })\n ])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"黑板\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"btn\", { 'active': blackboard.value }]),\n onClick: _cache[4] || (_cache[4] = ($event: any) => (blackboard.value = !blackboard.value))\n }, [\n _createVNode(_component_IconFill, { class: \"icon\" })\n ], 2)\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(writingBoardColors, (color) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"color\", { 'active': color === writingBoardColor.value }]),\n key: color,\n style: _normalizeStyle({ backgroundColor: color }),\n onClick: ($event: any) => (changeColor(color))\n }, null, 14, _hoisted_3)\n }), 64))\n ]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"关闭画笔\"\n }, {\n default: _withCtx(() => [\n _createElementVNode(\"div\", {\n class: \"btn\",\n onClick: _cache[5] || (_cache[5] = ($event: any) => (closeWritingBoard()))\n }, [\n _createVNode(_component_IconClose, { class: \"icon\" })\n ])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ], 4)\n ]))\n}\n}\n\n})","import script from \"./WritingBoardTool.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./WritingBoardTool.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./WritingBoardTool.vue?vue&type=style&index=0&id=876081a6&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-876081a6\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDirective as _resolveDirective, createVNode as _createVNode, withDirectives as _withDirectives, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createElementVNode as _createElementVNode, toDisplayString as _toDisplayString, withCtx as _withCtx, normalizeClass as _normalizeClass, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-d72d6626\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"tools-left\" }\nconst _hoisted_2 = { class: \"content\" }\n\nimport { PropType, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport { enterFullscreen } from '@/utils/fullscreen'\nimport useScreening from '@/hooks/useScreening'\nimport useExecPlay from './hooks/useExecPlay'\nimport useSlideSize from './hooks/useSlideSize'\nimport useFullscreen from './hooks/useFullscreen'\n\nimport ScreenSlideList from './ScreenSlideList.vue'\nimport SlideThumbnails from './SlideThumbnails.vue'\nimport WritingBoardTool from './WritingBoardTool.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'BaseView',\n props: {\n changeViewMode: {\n type: Function as PropType<(mode: 'base' | 'presenter') => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { slides, slideIndex } = storeToRefs(useSlidesStore())\n\nconst {\n autoPlayTimer,\n autoPlay,\n closeAutoPlay,\n mousewheelListener,\n touchStartListener,\n touchEndListener,\n turnPrevSlide,\n turnNextSlide,\n turnSlideToIndex,\n turnSlideToId,\n execPrev,\n execNext,\n animationIndex,\n} = useExecPlay()\n\nconst { slideWidth, slideHeight } = useSlideSize()\nconst { exitScreening } = useScreening()\nconst { fullscreenState, manualExitFullscreen } = useFullscreen()\n\nconst rightToolsVisible = ref(false)\nconst writingBoardToolVisible = ref(false)\nconst slideThumbnailModelVisible = ref(false)\nconst laserPen = ref(false)\n\nconst contextmenus = (): ContextmenuItem[] => {\n return [\n {\n text: '上一页',\n subText: '↑ ←',\n disable: slideIndex.value <= 0,\n handler: () => turnPrevSlide(),\n },\n {\n text: '下一页',\n subText: '↓ →',\n disable: slideIndex.value >= slides.value.length - 1,\n handler: () => turnNextSlide(),\n },\n {\n text: '第一页',\n disable: slideIndex.value === 0,\n handler: () => turnSlideToIndex(0),\n },\n {\n text: '最后一页',\n disable: slideIndex.value === slides.value.length - 1,\n handler: () => turnSlideToIndex(slides.value.length - 1),\n },\n { divider: true },\n {\n text: '显示工具栏',\n handler: () => rightToolsVisible.value = true,\n },\n {\n text: '查看所有幻灯片',\n handler: () => slideThumbnailModelVisible.value = true,\n },\n {\n text: '画笔工具',\n handler: () => writingBoardToolVisible.value = true,\n },\n {\n text: '演讲者视图',\n handler: () => props.changeViewMode('presenter'),\n },\n { divider: true },\n {\n text: autoPlayTimer.value ? '取消自动放映' : '自动放映',\n handler: autoPlayTimer.value ? closeAutoPlay : autoPlay,\n },\n {\n text: '结束放映',\n subText: 'ESC',\n handler: exitScreening,\n },\n ]\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconLeftTwo = _resolveComponent(\"IconLeftTwo\")!\n const _component_IconRightTwo = _resolveComponent(\"IconRightTwo\")!\n const _component_IconWrite = _resolveComponent(\"IconWrite\")!\n const _component_Tooltip = _resolveComponent(\"Tooltip\")!\n const _component_IconMagic = _resolveComponent(\"IconMagic\")!\n const _component_IconListView = _resolveComponent(\"IconListView\")!\n const _component_IconOffScreenOne = _resolveComponent(\"IconOffScreenOne\")!\n const _component_IconFullScreenOne = _resolveComponent(\"IconFullScreenOne\")!\n const _component_IconPower = _resolveComponent(\"IconPower\")!\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"base-view\", { 'laser-pen': laserPen.value }])\n }, [\n _withDirectives(_createVNode(ScreenSlideList, {\n slideWidth: _unref(slideWidth),\n slideHeight: _unref(slideHeight),\n animationIndex: _unref(animationIndex),\n turnSlideToId: _unref(turnSlideToId),\n manualExitFullscreen: _unref(manualExitFullscreen),\n onWheel: _cache[0] || (_cache[0] = $event => _unref(mousewheelListener)($event)),\n onTouchstart: _cache[1] || (_cache[1] = $event => _unref(touchStartListener)($event)),\n onTouchend: _cache[2] || (_cache[2] = $event => _unref(touchEndListener)($event))\n }, null, 8, [\"slideWidth\", \"slideHeight\", \"animationIndex\", \"turnSlideToId\", \"manualExitFullscreen\"]), [\n [_directive_contextmenu, contextmenus]\n ]),\n (slideThumbnailModelVisible.value)\n ? (_openBlock(), _createBlock(SlideThumbnails, {\n key: 0,\n turnSlideToIndex: _unref(turnSlideToIndex),\n onClose: _cache[3] || (_cache[3] = ($event: any) => (slideThumbnailModelVisible.value = false))\n }, null, 8, [\"turnSlideToIndex\"]))\n : _createCommentVNode(\"\", true),\n (writingBoardToolVisible.value)\n ? (_openBlock(), _createBlock(WritingBoardTool, {\n key: 1,\n slideWidth: _unref(slideWidth),\n slideHeight: _unref(slideHeight),\n onClose: _cache[4] || (_cache[4] = ($event: any) => (writingBoardToolVisible.value = false))\n }, null, 8, [\"slideWidth\", \"slideHeight\"]))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_1, [\n _createVNode(_component_IconLeftTwo, {\n class: \"tool-btn\",\n theme: \"two-tone\",\n fill: ['#111', '#fff'],\n onClick: _cache[5] || (_cache[5] = ($event: any) => (_unref(execPrev)()))\n }),\n _createVNode(_component_IconRightTwo, {\n class: \"tool-btn\",\n theme: \"two-tone\",\n fill: ['#111', '#fff'],\n onClick: _cache[6] || (_cache[6] = ($event: any) => (_unref(execNext)()))\n })\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"tools-right\", { 'visible': rightToolsVisible.value }]),\n onMouseleave: _cache[14] || (_cache[14] = ($event: any) => (rightToolsVisible.value = false)),\n onMouseenter: _cache[15] || (_cache[15] = ($event: any) => (rightToolsVisible.value = true))\n }, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: \"tool-btn page-number\",\n onClick: _cache[7] || (_cache[7] = ($event: any) => (slideThumbnailModelVisible.value = true))\n }, \"幻灯片 \" + _toDisplayString(_unref(slideIndex) + 1) + \" / \" + _toDisplayString(_unref(slides).length), 1),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"画笔工具\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconWrite, {\n class: \"tool-btn\",\n onClick: _cache[8] || (_cache[8] = ($event: any) => (writingBoardToolVisible.value = true))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"激光笔\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconMagic, {\n class: _normalizeClass([\"tool-btn\", { 'active': laserPen.value }]),\n onClick: _cache[9] || (_cache[9] = ($event: any) => (laserPen.value = !laserPen.value))\n }, null, 8, [\"class\"])\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"演讲者视图\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconListView, {\n class: \"tool-btn\",\n onClick: _cache[10] || (_cache[10] = ($event: any) => (__props.changeViewMode('presenter')))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: _unref(fullscreenState) ? '退出全屏' : '进入全屏'\n }, {\n default: _withCtx(() => [\n (_unref(fullscreenState))\n ? (_openBlock(), _createBlock(_component_IconOffScreenOne, {\n key: 0,\n class: \"tool-btn\",\n onClick: _cache[11] || (_cache[11] = ($event: any) => (_unref(manualExitFullscreen)()))\n }))\n : (_openBlock(), _createBlock(_component_IconFullScreenOne, {\n key: 1,\n class: \"tool-btn\",\n onClick: _cache[12] || (_cache[12] = ($event: any) => (_unref(enterFullscreen)()))\n }))\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\", \"title\"]),\n _createVNode(_component_Tooltip, {\n mouseLeaveDelay: 0,\n mouseEnterDelay: 0.3,\n title: \"结束放映\"\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPower, {\n class: \"tool-btn\",\n onClick: _cache[13] || (_cache[13] = ($event: any) => (_unref(exitScreening)()))\n })\n ]),\n _: 1\n }, 8, [\"mouseEnterDelay\"])\n ])\n ], 34)\n ], 2))\n}\n}\n\n})","import script from \"./BaseView.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./BaseView.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./BaseView.vue?vue&type=style&index=0&id=d72d6626&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-d72d6626\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, createElementVNode as _createElementVNode, normalizeClass as _normalizeClass, unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, toDisplayString as _toDisplayString, resolveDirective as _resolveDirective, withDirectives as _withDirectives, renderList as _renderList, Fragment as _Fragment, createElementBlock as _createElementBlock, withModifiers as _withModifiers, normalizeStyle as _normalizeStyle, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5fba3eec\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"presenter-view\" }\nconst _hoisted_2 = { class: \"toolbar\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", null, \"普通视图\", -1))\nconst _hoisted_4 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", null, \"画笔\", -1))\nconst _hoisted_5 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", null, \"激光笔\", -1))\nconst _hoisted_6 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", null, \"结束放映\", -1))\nconst _hoisted_7 = { class: \"content\" }\nconst _hoisted_8 = [\"onClick\"]\nconst _hoisted_9 = { class: \"remark\" }\nconst _hoisted_10 = { class: \"header\" }\nconst _hoisted_11 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"span\", null, \"演讲者备注\", -1))\nconst _hoisted_12 = [\"innerHTML\"]\nconst _hoisted_13 = { class: \"remark-scale\" }\n\nimport { computed, nextTick, ref, watch, PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { ContextmenuItem } from '@/components/Contextmenu/types'\nimport { enterFullscreen } from '@/utils/fullscreen'\nimport { parseText2Paragraphs } from '@/utils/textParser'\nimport useScreening from '@/hooks/useScreening'\nimport useLoadSlides from '@/hooks/useLoadSlides'\nimport useExecPlay from './hooks/useExecPlay'\nimport useSlideSize from './hooks/useSlideSize'\nimport useFullscreen from './hooks/useFullscreen'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\nimport ScreenSlideList from './ScreenSlideList.vue'\nimport WritingBoardTool from './WritingBoardTool.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'PresenterView',\n props: {\n changeViewMode: {\n type: Function as PropType<(mode: 'base' | 'presenter') => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { slides, slideIndex, viewportRatio, currentSlide } = storeToRefs(useSlidesStore())\n\nconst slideListWrapRef = ref()\nconst thumbnailsRef = ref()\nconst writingBoardToolVisible = ref(false)\nconst laserPen = ref(false)\n\nconst {\n mousewheelListener,\n touchStartListener,\n touchEndListener,\n turnPrevSlide,\n turnNextSlide,\n turnSlideToIndex,\n turnSlideToId,\n animationIndex,\n} = useExecPlay()\n\nconst { slideWidth, slideHeight } = useSlideSize(slideListWrapRef)\nconst { exitScreening } = useScreening()\nconst { slidesLoadLimit } = useLoadSlides()\nconst { fullscreenState, manualExitFullscreen } = useFullscreen()\n\nconst remarkFontSize = ref(16)\nconst currentSlideRemark = computed(() => {\n return parseText2Paragraphs(currentSlide.value.remark || '无备注')\n})\n\nconst handleMousewheelThumbnails = (e: WheelEvent) => {\n if (!thumbnailsRef.value) return\n thumbnailsRef.value.scrollBy(e.deltaY, 0)\n}\n\nconst setRemarkFontSize = (fontSize: number) => {\n if (fontSize < 12 || fontSize > 40) return\n remarkFontSize.value = fontSize\n}\n\nwatch(slideIndex, () => {\n nextTick(() => {\n if (!thumbnailsRef.value) return\n\n const activeThumbnailRef: HTMLElement | null = thumbnailsRef.value.querySelector('.thumbnail.active')\n if (!activeThumbnailRef) return\n\n const width = thumbnailsRef.value.offsetWidth\n const offsetLeft = activeThumbnailRef.offsetLeft\n thumbnailsRef.value.scrollTo({ left: offsetLeft - width / 2, behavior: 'smooth' })\n })\n})\n\nconst contextmenus = (): ContextmenuItem[] => {\n return [\n {\n text: '上一页',\n subText: '↑ ←',\n disable: slideIndex.value <= 0,\n handler: () => turnPrevSlide(),\n },\n {\n text: '下一页',\n subText: '↓ →',\n disable: slideIndex.value >= slides.value.length - 1,\n handler: () => turnNextSlide(),\n },\n {\n text: '第一页',\n disable: slideIndex.value === 0,\n handler: () => turnSlideToIndex(0),\n },\n {\n text: '最后一页',\n disable: slideIndex.value === slides.value.length - 1,\n handler: () => turnSlideToIndex(slides.value.length - 1),\n },\n { divider: true },\n {\n text: '画笔工具',\n handler: () => writingBoardToolVisible.value = true,\n },\n {\n text: '普通视图',\n handler: () => props.changeViewMode('base'),\n },\n { divider: true },\n {\n text: '结束放映',\n subText: 'ESC',\n handler: exitScreening,\n },\n ]\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconListView = _resolveComponent(\"IconListView\")!\n const _component_IconWrite = _resolveComponent(\"IconWrite\")!\n const _component_IconMagic = _resolveComponent(\"IconMagic\")!\n const _component_IconOffScreenOne = _resolveComponent(\"IconOffScreenOne\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconPower = _resolveComponent(\"IconPower\")!\n const _component_IconMinus = _resolveComponent(\"IconMinus\")!\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _directive_contextmenu = _resolveDirective(\"contextmenu\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: \"tool-btn\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (__props.changeViewMode('base')))\n }, [\n _createVNode(_component_IconListView, { class: \"tool-icon\" }),\n _hoisted_3\n ]),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"tool-btn\", { 'active': writingBoardToolVisible.value }]),\n onClick: _cache[1] || (_cache[1] = ($event: any) => (writingBoardToolVisible.value = !writingBoardToolVisible.value))\n }, [\n _createVNode(_component_IconWrite, { class: \"tool-icon\" }),\n _hoisted_4\n ], 2),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"tool-btn\", { 'active': laserPen.value }]),\n onClick: _cache[2] || (_cache[2] = ($event: any) => (laserPen.value = !laserPen.value))\n }, [\n _createVNode(_component_IconMagic, { class: \"tool-icon\" }),\n _hoisted_5\n ], 2),\n _createElementVNode(\"div\", {\n class: \"tool-btn\",\n onClick: _cache[3] || (_cache[3] = () => _unref(fullscreenState) ? _unref(manualExitFullscreen)() : _unref(enterFullscreen)())\n }, [\n (_unref(fullscreenState))\n ? (_openBlock(), _createBlock(_component_IconOffScreenOne, {\n key: 0,\n class: \"tool-icon\"\n }))\n : (_openBlock(), _createBlock(_component_IconOffScreenOne, {\n key: 1,\n class: \"tool-icon\"\n })),\n _createElementVNode(\"span\", null, _toDisplayString(_unref(fullscreenState) ? '退出全屏' : '全屏'), 1)\n ]),\n _createVNode(_component_Divider, { class: \"divider\" }),\n _createElementVNode(\"div\", {\n class: \"tool-btn\",\n onClick: _cache[4] || (_cache[4] = ($event: any) => (_unref(exitScreening)()))\n }, [\n _createVNode(_component_IconPower, { class: \"tool-icon\" }),\n _hoisted_6\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"slide-list-wrap\", { 'laser-pen': laserPen.value }]),\n ref_key: \"slideListWrapRef\",\n ref: slideListWrapRef\n }, [\n _withDirectives(_createVNode(ScreenSlideList, {\n slideWidth: _unref(slideWidth),\n slideHeight: _unref(slideHeight),\n animationIndex: _unref(animationIndex),\n turnSlideToId: _unref(turnSlideToId),\n manualExitFullscreen: _unref(manualExitFullscreen),\n onWheel: _cache[5] || (_cache[5] = $event => _unref(mousewheelListener)($event)),\n onTouchstart: _cache[6] || (_cache[6] = $event => _unref(touchStartListener)($event)),\n onTouchend: _cache[7] || (_cache[7] = $event => _unref(touchEndListener)($event))\n }, null, 8, [\"slideWidth\", \"slideHeight\", \"animationIndex\", \"turnSlideToId\", \"manualExitFullscreen\"]), [\n [_directive_contextmenu, contextmenus]\n ]),\n (writingBoardToolVisible.value)\n ? (_openBlock(), _createBlock(WritingBoardTool, {\n key: 0,\n slideWidth: _unref(slideWidth),\n slideHeight: _unref(slideHeight),\n position: {\n left: '75px',\n top: '5px',\n },\n onClose: _cache[8] || (_cache[8] = ($event: any) => (writingBoardToolVisible.value = false))\n }, null, 8, [\"slideWidth\", \"slideHeight\"]))\n : _createCommentVNode(\"\", true)\n ], 2),\n _createElementVNode(\"div\", {\n class: \"thumbnails\",\n ref_key: \"thumbnailsRef\",\n ref: thumbnailsRef,\n onWheel: _cache[9] || (_cache[9] = _withModifiers($event => handleMousewheelThumbnails($event), [\"prevent\"]))\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"thumbnail\", { 'active': index === _unref(slideIndex) }]),\n key: slide.id,\n onClick: ($event: any) => (_unref(turnSlideToIndex)(index))\n }, [\n _createVNode(ThumbnailSlide, {\n slide: slide,\n size: 120 / _unref(viewportRatio),\n visible: index < _unref(slidesLoadLimit)\n }, null, 8, [\"slide\", \"size\", \"visible\"])\n ], 10, _hoisted_8))\n }), 128))\n ], 544)\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n _createElementVNode(\"div\", _hoisted_10, [\n _hoisted_11,\n _createElementVNode(\"span\", null, \"P \" + _toDisplayString(_unref(slideIndex) + 1) + \" / \" + _toDisplayString(_unref(slides).length), 1)\n ]),\n _createElementVNode(\"div\", {\n class: \"remark-content\",\n style: _normalizeStyle({ fontSize: remarkFontSize.value + 'px' }),\n innerHTML: _unref(currentSlideRemark)\n }, null, 12, _hoisted_12),\n _createElementVNode(\"div\", _hoisted_13, [\n _createElementVNode(\"div\", {\n class: _normalizeClass(['scale-btn', { 'disable': remarkFontSize.value === 12 }]),\n onClick: _cache[10] || (_cache[10] = ($event: any) => (setRemarkFontSize(remarkFontSize.value - 2)))\n }, [\n _createVNode(_component_IconMinus)\n ], 2),\n _createElementVNode(\"div\", {\n class: _normalizeClass(['scale-btn', { 'disable': remarkFontSize.value === 40 }]),\n onClick: _cache[11] || (_cache[11] = ($event: any) => (setRemarkFontSize(remarkFontSize.value + 2)))\n }, [\n _createVNode(_component_IconPlus)\n ], 2)\n ])\n ])\n ]))\n}\n}\n\n})","import script from \"./PresenterView.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./PresenterView.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./PresenterView.vue?vue&type=style&index=0&id=5fba3eec&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5fba3eec\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-6bf3d190\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"pptist-screen\" }\n\nimport { onMounted, onUnmounted, ref } from 'vue'\nimport { KEYS } from '@/configs/hotkey'\nimport useScreening from '@/hooks/useScreening'\n\nimport BaseView from './BaseView.vue'\nimport PresenterView from './PresenterView.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst viewMode = ref<'base' | 'presenter'>('base')\n\nconst changeViewMode = (mode: 'base' | 'presenter') => {\n viewMode.value = mode\n}\n\nconst { exitScreening } = useScreening()\n\n// 快捷键退出放映\nconst keydownListener = (e: KeyboardEvent) => {\n const key = e.key.toUpperCase()\n if (key === KEYS.ESC) exitScreening()\n}\n\nonMounted(() => document.addEventListener('keydown', keydownListener))\nonUnmounted(() => document.removeEventListener('keydown', keydownListener))\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (viewMode.value === 'base')\n ? (_openBlock(), _createBlock(BaseView, {\n key: 0,\n changeViewMode: changeViewMode\n }))\n : (viewMode.value === 'presenter')\n ? (_openBlock(), _createBlock(PresenterView, {\n key: 1,\n changeViewMode: changeViewMode\n }))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=6bf3d190&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-6bf3d190\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, normalizeStyle as _normalizeStyle, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { ElementTypes, PPTElement } from '@/types/slides'\n\nimport ImageElement from '@/views/components/element/ImageElement/index.vue'\nimport TextElement from '@/views/components/element/TextElement/index.vue'\nimport ShapeElement from '@/views/components/element/ShapeElement/index.vue'\nimport LineElement from '@/views/components/element/LineElement/index.vue'\nimport ChartElement from '@/views/components/element/ChartElement/index.vue'\nimport TableElement from '@/views/components/element/TableElement/index.vue'\nimport LatexElement from '@/views/components/element/LatexElement/index.vue'\nimport VideoElement from '@/views/components/element/VideoElement/index.vue'\nimport AudioElement from '@/views/components/element/AudioElement/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MobileEditableElement',\n props: {\n elementInfo: {\n type: Object as PropType,\n required: true,\n },\n elementIndex: {\n type: Number,\n required: true,\n },\n selectElement: {\n type: Function as PropType<(e: TouchEvent, element: PPTElement, canMove?: boolean) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst currentElementComponent = computed(() => {\n const elementTypeMap = {\n [ElementTypes.IMAGE]: ImageElement,\n [ElementTypes.TEXT]: TextElement,\n [ElementTypes.SHAPE]: ShapeElement,\n [ElementTypes.LINE]: LineElement,\n [ElementTypes.CHART]: ChartElement,\n [ElementTypes.TABLE]: TableElement,\n [ElementTypes.LATEX]: LatexElement,\n [ElementTypes.VIDEO]: VideoElement,\n [ElementTypes.AUDIO]: AudioElement,\n }\n return elementTypeMap[props.elementInfo.type] || null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"mobile-editable-element\",\n style: _normalizeStyle({\n zIndex: __props.elementIndex,\n })\n }, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentElementComponent)), {\n elementInfo: __props.elementInfo,\n selectElement: __props.selectElement,\n contextmenus: () => null\n }, null, 8, [\"elementInfo\", \"selectElement\", \"contextmenus\"]))\n ], 4))\n}\n}\n\n})","import script from \"./MobileEditableElement.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MobileEditableElement.vue?vue&type=script&lang=ts&setup=true\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, normalizeStyle as _normalizeStyle, createBlock as _createBlock, withModifiers as _withModifiers, createCommentVNode as _createCommentVNode } from \"vue\"\n\nimport { PropType, computed } from 'vue'\nimport { PPTElement, PPTLineElement } from '@/types/slides'\nimport useCommonOperate from '@/views/Editor/Canvas/hooks/useCommonOperate'\nimport { OperateResizeHandlers } from '@/types/edit'\n\nimport BorderLine from '@/views/Editor/Canvas/Operate/BorderLine.vue'\nimport ResizeHandler from '@/views/Editor/Canvas/Operate/ResizeHandler.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MobileOperate',\n props: {\n elementInfo: {\n type: Object as PropType>,\n required: true,\n },\n isSelected: {\n type: Boolean,\n required: true,\n },\n canvasScale: {\n type: Number,\n required: true,\n },\n scaleElement: {\n type: Function as PropType<(e: MouseEvent, element: Exclude, command: OperateResizeHandlers) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst rotate = computed(() => 'rotate' in props.elementInfo ? props.elementInfo.rotate : 0)\n\nconst scaleWidth = computed(() => props.elementInfo.width * props.canvasScale)\nconst scaleHeight = computed(() => props.elementInfo.height * props.canvasScale)\nconst {\n borderLines,\n resizeHandlers: _resizeHandlers,\n textElementResizeHandlers,\n} = useCommonOperate(scaleWidth, scaleHeight)\n\nconst resizeHandlers = props.elementInfo.type === 'text' || props.elementInfo.type === 'table' ? textElementResizeHandlers : _resizeHandlers\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"mobile-operate\",\n style: _normalizeStyle({\n top: __props.elementInfo.top * __props.canvasScale + 'px',\n left: __props.elementInfo.left * __props.canvasScale + 'px',\n transform: `rotate(${_unref(rotate)}deg)`,\n transformOrigin: `${__props.elementInfo.width * __props.canvasScale / 2}px ${__props.elementInfo.height * __props.canvasScale / 2}px`,\n })\n }, [\n (__props.isSelected)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(borderLines), (line) => {\n return (_openBlock(), _createBlock(BorderLine, {\n class: \"operate-border-line\",\n key: line.type,\n type: line.type,\n style: _normalizeStyle(line.style)\n }, null, 8, [\"type\", \"style\"]))\n }), 128)),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(resizeHandlers), (point) => {\n return (_openBlock(), _createBlock(ResizeHandler, {\n class: \"operate-resize-handler\",\n key: point.direction,\n type: point.direction,\n rotate: __props.elementInfo.rotate,\n style: _normalizeStyle(point.style),\n onTouchstart: _withModifiers($event => __props.scaleElement($event, __props.elementInfo, point.direction), [\"stop\"])\n }, null, 8, [\"type\", \"rotate\", \"style\", \"onTouchstart\"]))\n }), 128))\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 4))\n}\n}\n\n})","import script from \"./MobileOperate.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MobileOperate.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MobileOperate.vue?vue&type=style&index=0&id=7fdc6c04&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7fdc6c04\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createVNode as _createVNode, normalizeClass as _normalizeClass, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4a0c7aa7\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"mobile-thumbnails\" }\nconst _hoisted_2 = [\"onClick\"]\nconst _hoisted_3 = { class: \"label\" }\n\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useLoadSlides from '@/hooks/useLoadSlides'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MobileThumbnails',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { slides, slideIndex } = storeToRefs(slidesStore)\n\nconst { slidesLoadLimit } = useLoadSlides()\nconst changeSlideIndex = (index: number) => {\n slidesStore.updateSlideIndex(index)\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\"thumbnail-item\", { 'active': _unref(slideIndex) === index }]),\n key: slide.id,\n onClick: ($event: any) => (changeSlideIndex(index))\n }, [\n _createElementVNode(\"div\", _hoisted_3, _toDisplayString(index + 1), 1),\n _createVNode(ThumbnailSlide, {\n class: \"thumbnail\",\n slide: slide,\n size: 120,\n visible: index < _unref(slidesLoadLimit)\n }, null, 8, [\"slide\", \"visible\"])\n ], 10, _hoisted_2))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./MobileThumbnails.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MobileThumbnails.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MobileThumbnails.vue?vue&type=style&index=0&id=4a0c7aa7&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-4a0c7aa7\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withCtx as _withCtx, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5c24a24d\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"slide-toolbar\" }\nconst _hoisted_2 = { class: \"remark\" }\nconst _hoisted_3 = [\"value\"]\nconst _hoisted_4 = { class: \"toolbar\" }\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\" 新幻灯片\")\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\" 复制\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\" 删除\")\nconst _hoisted_8 = /*#__PURE__*/_createTextVNode(\" 文字\")\nconst _hoisted_9 = /*#__PURE__*/_createTextVNode(\"图片 \")\nconst _hoisted_10 = /*#__PURE__*/_createTextVNode(\" 矩形\")\nconst _hoisted_11 = /*#__PURE__*/_createTextVNode(\" 圆形\")\n\nimport { computed } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useSlideHandler from '@/hooks/useSlideHandler'\nimport useCreateElement from '@/hooks/useCreateElement'\nimport { getImageDataURL } from '@/utils/image'\nimport { ShapePoolItem } from '@/configs/shapes'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\n\nimport MobileThumbnails from '../MobileThumbnails.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'SlideToolbar',\n setup(__props) {\n\nconst slidesStore = useSlidesStore()\nconst { viewportRatio, currentSlide } = storeToRefs(slidesStore)\n\nconst { createSlide, copyAndPasteSlide, deleteSlide, } = useSlideHandler()\nconst { createTextElement, createImageElement, createShapeElement } = useCreateElement()\n\nconst insertTextElement = () => {\n const width = 400\n const height = 56\n\n createTextElement({\n left: (VIEWPORT_SIZE - width) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - height) / 2,\n width,\n height,\n }, '

新添加文本

')\n}\n\nconst insertImageElement = (files: FileList) => {\n if (!files || !files[0]) return\n getImageDataURL(files[0]).then(dataURL => createImageElement(dataURL))\n}\n\nconst insertShapeElement = (type: 'square' | 'round') => {\n const square: ShapePoolItem = {\n viewBox: [200, 200],\n path: 'M 0 0 L 200 0 L 200 200 L 0 200 Z',\n }\n const round: ShapePoolItem = {\n viewBox: [200, 200],\n path: 'M 100 0 A 50 50 0 1 1 100 200 A 50 50 0 1 1 100 0 Z',\n }\n const shape = { square, round }\n\n const size = 200\n\n createShapeElement({\n left: (VIEWPORT_SIZE - size) / 2,\n top: (VIEWPORT_SIZE * viewportRatio.value - size) / 2,\n width: size,\n height: size,\n }, shape[type])\n}\n\nconst remark = computed(() => currentSlide.value?.remark || '')\n\nconst handleInputMark = (e: Event) => {\n const value = (e.target as HTMLTextAreaElement).value\n slidesStore.updateSlide({ remark: value })\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconPlus = _resolveComponent(\"IconPlus\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_IconCopy = _resolveComponent(\"IconCopy\")!\n const _component_IconDelete = _resolveComponent(\"IconDelete\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_IconPicture = _resolveComponent(\"IconPicture\")!\n const _component_FileInput = _resolveComponent(\"FileInput\")!\n const _component_IconSquare = _resolveComponent(\"IconSquare\")!\n const _component_IconRound = _resolveComponent(\"IconRound\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"textarea\", {\n value: _unref(remark),\n placeholder: \"点击输入演讲者备注\",\n onInput: _cache[0] || (_cache[0] = $event => handleInputMark($event))\n }, null, 40, _hoisted_3)\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[1] || (_cache[1] = ($event: any) => (_unref(createSlide)()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPlus, { class: \"icon\" }),\n _hoisted_5\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[2] || (_cache[2] = ($event: any) => (_unref(copyAndPasteSlide)()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconCopy, { class: \"icon\" }),\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[3] || (_cache[3] = ($event: any) => (_unref(deleteSlide)()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconDelete, { class: \"icon\" }),\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[4] || (_cache[4] = ($event: any) => (insertTextElement()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize, { class: \"icon\" }),\n _hoisted_8\n ]),\n _: 1\n }),\n _createVNode(_component_Button, { style: {\"flex\":\"1\"} }, {\n default: _withCtx(() => [\n _createVNode(_component_FileInput, {\n onChange: _cache[5] || (_cache[5] = files => insertImageElement(files))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconPicture, { class: \"icon\" }),\n _hoisted_9\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[6] || (_cache[6] = ($event: any) => (insertShapeElement('square')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconSquare, { class: \"icon\" }),\n _hoisted_10\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[7] || (_cache[7] = ($event: any) => (insertShapeElement('round')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconRound, { class: \"icon\" }),\n _hoisted_11\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]),\n _createVNode(MobileThumbnails)\n ]))\n}\n}\n\n})","import script from \"./SlideToolbar.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./SlideToolbar.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./SlideToolbar.vue?vue&type=style&index=0&id=5c24a24d&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5c24a24d\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, withCtx as _withCtx, createTextVNode as _createTextVNode, normalizeStyle as _normalizeStyle, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-446388c6\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"element-toolbar\" }\nconst _hoisted_2 = { class: \"tabs\" }\nconst _hoisted_3 = [\"onClick\"]\nconst _hoisted_4 = { class: \"content\" }\nconst _hoisted_5 = {\n key: 0,\n class: \"style\"\n}\nconst _hoisted_6 = /*#__PURE__*/_createTextVNode(\"+\")\nconst _hoisted_7 = /*#__PURE__*/_createTextVNode(\"-\")\nconst _hoisted_8 = { class: \"row-block\" }\nconst _hoisted_9 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"label\" }, \"文字颜色:\", -1))\nconst _hoisted_10 = { class: \"colors\" }\nconst _hoisted_11 = [\"onClick\"]\nconst _hoisted_12 = { class: \"row-block\" }\nconst _hoisted_13 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"label\" }, \"填充色:\", -1))\nconst _hoisted_14 = { class: \"colors\" }\nconst _hoisted_15 = [\"onClick\"]\nconst _hoisted_16 = {\n key: 1,\n class: \"common\"\n}\nconst _hoisted_17 = /*#__PURE__*/_createTextVNode(\" 复制\")\nconst _hoisted_18 = /*#__PURE__*/_createTextVNode(\" 删除\")\nconst _hoisted_19 = /*#__PURE__*/_createTextVNode(\" 置顶\")\nconst _hoisted_20 = /*#__PURE__*/_createTextVNode(\" 置底\")\nconst _hoisted_21 = /*#__PURE__*/_createTextVNode(\" 上移\")\nconst _hoisted_22 = /*#__PURE__*/_createTextVNode(\" 下移\")\nconst _hoisted_23 = /*#__PURE__*/_createTextVNode(\" 左对齐\")\nconst _hoisted_24 = /*#__PURE__*/_createTextVNode(\" 水平居中\")\nconst _hoisted_25 = /*#__PURE__*/_createTextVNode(\" 右对齐\")\nconst _hoisted_26 = /*#__PURE__*/_createTextVNode(\" 上对齐\")\nconst _hoisted_27 = /*#__PURE__*/_createTextVNode(\" 垂直居中\")\nconst _hoisted_28 = /*#__PURE__*/_createTextVNode(\" 下对齐\")\n\nimport { ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement, TableCell } from '@/types/slides'\nimport { ElementAlignCommands, ElementOrderCommands } from '@/types/edit'\nimport emitter, { EmitterEvents } from '@/utils/emitter'\nimport useOrderElement from '@/hooks/useOrderElement'\nimport useAlignElementToCanvas from '@/hooks/useAlignElementToCanvas'\nimport useDeleteElement from '@/hooks/useDeleteElement'\nimport useAddSlidesOrElements from '@/hooks/useAddSlidesOrElements'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\ninterface TabItem {\n key: 'style' | 'common'\n label: string\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'ElementToolbar',\n setup(__props) {\n\nconst colors = ['#000000', '#ffffff', '#eeece1', '#1e497b', '#4e81bb', '#e2534d', '#9aba60', '#8165a0', '#47acc5', '#f9974c', '#c21401', '#ff1e02', '#ffc12a', '#ffff3a', '#90cf5b', '#00af57']\n\nconst mainStore = useMainStore()\nconst slidesStore = useSlidesStore()\nconst { handleElement, handleElementId, richTextAttrs } = storeToRefs(mainStore)\n\nconst { addHistorySnapshot } = useHistorySnapshot()\n\nconst updateElement = (id: string, props: Partial) => {\n slidesStore.updateElement({ id, props })\n addHistorySnapshot()\n}\n\nconst tabs: TabItem[] = [\n { key: 'style', label: '样式' },\n { key: 'common', label: '布局' },\n]\nconst activeTab = ref('common')\n\nconst { orderElement } = useOrderElement()\nconst { alignElementToCanvas } = useAlignElementToCanvas()\nconst { addElementsFromData } = useAddSlidesOrElements()\nconst { deleteElement } = useDeleteElement()\n\nconst copyElement = () => {\n const element: PPTElement = JSON.parse(JSON.stringify(handleElement.value))\n addElementsFromData([element])\n}\n\nconst emitRichTextCommand = (command: string, value?: string) => {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command, value } })\n}\n\nconst updateFontColor = (color: string) => {\n if (!handleElement.value) return\n if (handleElement.value.type === 'text' || (handleElement.value.type === 'shape' && handleElement.value.text?.content)) {\n emitter.emit(EmitterEvents.RICH_TEXT_COMMAND, { action: { command: 'color', value: color } })\n }\n if (handleElement.value.type === 'table') {\n const data: TableCell[][] = JSON.parse(JSON.stringify(handleElement.value.data))\n for (let i = 0; i < data.length; i++) {\n for (let j = 0; j < data[i].length; j++) {\n const style = data[i][j].style || {}\n data[i][j].style = { ...style, color }\n }\n }\n updateElement(handleElementId.value, { data })\n }\n if (handleElement.value.type === 'latex') {\n updateElement(handleElementId.value, { color })\n }\n}\n\nconst updateFill = (color: string) => {\n if (!handleElement.value) return\n if (\n handleElement.value.type === 'text' ||\n handleElement.value.type === 'shape' ||\n handleElement.value.type === 'chart'\n ) updateElement(handleElementId.value, { fill: color })\n\n if (handleElement.value.type === 'table') {\n const data: TableCell[][] = JSON.parse(JSON.stringify(handleElement.value.data))\n for (let i = 0; i < data.length; i++) {\n for (let j = 0; j < data[i].length; j++) {\n const style = data[i][j].style || {}\n data[i][j].style = { ...style, backcolor: color }\n }\n }\n updateElement(handleElementId.value, { data })\n }\n\n if (handleElement.value.type === 'audio') updateElement(handleElementId.value, { color })\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconTextBold = _resolveComponent(\"IconTextBold\")!\n const _component_CheckboxButton = _resolveComponent(\"CheckboxButton\")!\n const _component_IconTextItalic = _resolveComponent(\"IconTextItalic\")!\n const _component_IconTextUnderline = _resolveComponent(\"IconTextUnderline\")!\n const _component_IconStrikethrough = _resolveComponent(\"IconStrikethrough\")!\n const _component_CheckboxButtonGroup = _resolveComponent(\"CheckboxButtonGroup\")!\n const _component_IconFontSize = _resolveComponent(\"IconFontSize\")!\n const _component_Button = _resolveComponent(\"Button\")!\n const _component_ButtonGroup = _resolveComponent(\"ButtonGroup\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconAlignTextLeft = _resolveComponent(\"IconAlignTextLeft\")!\n const _component_RadioButton = _resolveComponent(\"RadioButton\")!\n const _component_IconAlignTextCenter = _resolveComponent(\"IconAlignTextCenter\")!\n const _component_IconAlignTextRight = _resolveComponent(\"IconAlignTextRight\")!\n const _component_RadioGroup = _resolveComponent(\"RadioGroup\")!\n const _component_IconCopy = _resolveComponent(\"IconCopy\")!\n const _component_IconDelete = _resolveComponent(\"IconDelete\")!\n const _component_IconSendToBack = _resolveComponent(\"IconSendToBack\")!\n const _component_IconBringToFrontOne = _resolveComponent(\"IconBringToFrontOne\")!\n const _component_IconBringToFront = _resolveComponent(\"IconBringToFront\")!\n const _component_IconSentToBack = _resolveComponent(\"IconSentToBack\")!\n const _component_IconAlignLeft = _resolveComponent(\"IconAlignLeft\")!\n const _component_IconAlignVertically = _resolveComponent(\"IconAlignVertically\")!\n const _component_IconAlignRight = _resolveComponent(\"IconAlignRight\")!\n const _component_IconAlignTop = _resolveComponent(\"IconAlignTop\")!\n const _component_IconAlignHorizontally = _resolveComponent(\"IconAlignHorizontally\")!\n const _component_IconAlignBottom = _resolveComponent(\"IconAlignBottom\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(tabs, (item) => {\n return _createElementVNode(\"div\", {\n class: _normalizeClass([\"tab\", { 'active': activeTab.value === item.key }]),\n key: item.key,\n onClick: ($event: any) => (activeTab.value = item.key)\n }, _toDisplayString(item.label), 11, _hoisted_3)\n }), 64))\n ]),\n _createElementVNode(\"div\", _hoisted_4, [\n (activeTab.value === 'style')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_5, [\n _createVNode(_component_CheckboxButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).bold,\n onClick: _cache[0] || (_cache[0] = ($event: any) => (emitRichTextCommand('bold')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextBold)\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).em,\n onClick: _cache[1] || (_cache[1] = ($event: any) => (emitRichTextCommand('em')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextItalic)\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).underline,\n onClick: _cache[2] || (_cache[2] = ($event: any) => (emitRichTextCommand('underline')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconTextUnderline)\n ]),\n _: 1\n }, 8, [\"checked\"]),\n _createVNode(_component_CheckboxButton, {\n style: {\"flex\":\"1\"},\n checked: _unref(richTextAttrs).strikethrough,\n onClick: _cache[3] || (_cache[3] = ($event: any) => (emitRichTextCommand('strikethrough')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconStrikethrough)\n ]),\n _: 1\n }, 8, [\"checked\"])\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"2\"},\n onClick: _cache[4] || (_cache[4] = ($event: any) => (emitRichTextCommand('fontsize-add')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_6\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"2\"},\n onClick: _cache[5] || (_cache[5] = ($event: any) => (emitRichTextCommand('fontsize-reduce')))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconFontSize),\n _hoisted_7\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Divider, { style: {\"margin\":\"20px 0\"} }),\n _createVNode(_component_RadioGroup, {\n class: \"row\",\n \"button-style\": \"solid\",\n value: _unref(richTextAttrs).align,\n onChange: _cache[6] || (_cache[6] = e => emitRichTextCommand('align', e.target.value))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_RadioButton, {\n value: \"left\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextLeft)\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n value: \"center\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextCenter)\n ]),\n _: 1\n }),\n _createVNode(_component_RadioButton, {\n value: \"right\",\n style: {\"flex\":\"1\"}\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTextRight)\n ]),\n _: 1\n })\n ]),\n _: 1\n }, 8, [\"value\"]),\n _createVNode(_component_Divider, { style: {\"margin\":\"20px 0\"} }),\n _createElementVNode(\"div\", _hoisted_8, [\n _hoisted_9,\n _createElementVNode(\"div\", _hoisted_10, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(colors, (color) => {\n return _createElementVNode(\"div\", {\n class: \"color\",\n key: color,\n onClick: ($event: any) => (updateFontColor(color))\n }, [\n _createElementVNode(\"div\", {\n class: \"color-block\",\n style: _normalizeStyle({ backgroundColor: color })\n }, null, 4)\n ], 8, _hoisted_11)\n }), 64))\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_12, [\n _hoisted_13,\n _createElementVNode(\"div\", _hoisted_14, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(colors, (color) => {\n return _createElementVNode(\"div\", {\n class: \"color\",\n key: color,\n onClick: ($event: any) => (updateFill(color))\n }, [\n _createElementVNode(\"div\", {\n class: \"color-block\",\n style: _normalizeStyle({ backgroundColor: color })\n }, null, 4)\n ], 8, _hoisted_15)\n }), 64))\n ])\n ])\n ]))\n : _createCommentVNode(\"\", true),\n (activeTab.value === 'common')\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_16, [\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[7] || (_cache[7] = ($event: any) => (copyElement()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconCopy, { class: \"icon\" }),\n _hoisted_17\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[8] || (_cache[8] = ($event: any) => (_unref(deleteElement)()))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconDelete, { class: \"icon\" }),\n _hoisted_18\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Divider, { style: {\"margin\":\"20px 0\"} }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[9] || (_cache[9] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).TOP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconSendToBack, { class: \"icon\" }),\n _hoisted_19\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[10] || (_cache[10] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).BOTTOM)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconBringToFrontOne, { class: \"icon\" }),\n _hoisted_20\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[11] || (_cache[11] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).UP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconBringToFront, { class: \"icon\" }),\n _hoisted_21\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[12] || (_cache[12] = ($event: any) => (_unref(orderElement)(_unref(handleElement)!, _unref(ElementOrderCommands).DOWN)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconSentToBack, { class: \"icon\" }),\n _hoisted_22\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_Divider, { style: {\"margin\":\"20px 0\"} }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[13] || (_cache[13] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).LEFT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignLeft, { class: \"icon\" }),\n _hoisted_23\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[14] || (_cache[14] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).HORIZONTAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignVertically, { class: \"icon\" }),\n _hoisted_24\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[15] || (_cache[15] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).RIGHT)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignRight, { class: \"icon\" }),\n _hoisted_25\n ]),\n _: 1\n })\n ]),\n _: 1\n }),\n _createVNode(_component_ButtonGroup, { class: \"row\" }, {\n default: _withCtx(() => [\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[16] || (_cache[16] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).TOP)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignTop, { class: \"icon\" }),\n _hoisted_26\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[17] || (_cache[17] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).VERTICAL)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignHorizontally, { class: \"icon\" }),\n _hoisted_27\n ]),\n _: 1\n }),\n _createVNode(_component_Button, {\n style: {\"flex\":\"1\"},\n onClick: _cache[18] || (_cache[18] = ($event: any) => (_unref(alignElementToCanvas)(_unref(ElementAlignCommands).BOTTOM)))\n }, {\n default: _withCtx(() => [\n _createVNode(_component_IconAlignBottom, { class: \"icon\" }),\n _hoisted_28\n ]),\n _: 1\n })\n ]),\n _: 1\n })\n ]))\n : _createCommentVNode(\"\", true)\n ])\n ]))\n}\n}\n\n})","import script from \"./ElementToolbar.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./ElementToolbar.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./ElementToolbar.vue?vue&type=style&index=0&id=446388c6&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-446388c6\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveComponent as _resolveComponent, createVNode as _createVNode, createTextVNode as _createTextVNode, withModifiers as _withModifiers, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-8639f30e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"mobile-editor-header\" }\nconst _hoisted_2 = { class: \"history\" }\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\" 撤销\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\" 重做\")\nconst _hoisted_5 = /*#__PURE__*/_createTextVNode(\" 退出编辑\")\n\nimport { PropType } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSnapshotStore } from '@/store'\nimport { Mode } from '@/types/mobile'\nimport useHistorySnapshot from '@/hooks/useHistorySnapshot'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Header',\n props: {\n changeMode: {\n type: Function as PropType<(mode: Mode) => void>,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nconst { canUndo, canRedo } = storeToRefs(useSnapshotStore())\nconst { redo, undo } = useHistorySnapshot()\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconBack = _resolveComponent(\"IconBack\")!\n const _component_IconNext = _resolveComponent(\"IconNext\")!\n const _component_IconLogout = _resolveComponent(\"IconLogout\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"history-item\", { 'disable': !_unref(canUndo) }]),\n onClick: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (_unref(undo)()), [\"stop\"]))\n }, [\n _createVNode(_component_IconBack),\n _hoisted_3\n ], 2),\n _createElementVNode(\"div\", {\n class: _normalizeClass([\"history-item\", { 'disable': !_unref(canRedo) }]),\n onClick: _cache[1] || (_cache[1] = _withModifiers(($event: any) => (_unref(redo)()), [\"stop\"]))\n }, [\n _createVNode(_component_IconNext),\n _hoisted_4\n ], 2)\n ]),\n _createElementVNode(\"div\", {\n class: \"back\",\n onClick: _cache[2] || (_cache[2] = ($event: any) => (__props.changeMode('preview')))\n }, [\n _createVNode(_component_IconLogout),\n _hoisted_5\n ])\n ]))\n}\n}\n\n})","import script from \"./Header.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Header.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Header.vue?vue&type=style&index=0&id=8639f30e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-8639f30e\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, unref as _unref, normalizeStyle as _normalizeStyle, createElementVNode as _createElementVNode, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-8cdcde82\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"mobile-editor\" }\n\nimport { computed, onMounted, PropType, ref, watchEffect } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useMainStore, useSlidesStore } from '@/store'\nimport { PPTElement } from '@/types/slides'\nimport { AlignmentLineProps } from '@/types/edit'\nimport { Mode } from '@/types/mobile'\nimport { VIEWPORT_SIZE } from '@/configs/canvas'\nimport useSlideBackgroundStyle from '@/hooks/useSlideBackgroundStyle'\nimport useDragElement from '@/views/Editor/Canvas/hooks/useDragElement'\nimport useScaleElement from '@/views/Editor/Canvas/hooks/useScaleElement'\n\nimport AlignmentLine from '@/views/Editor/Canvas/AlignmentLine.vue'\nimport MobileEditableElement from './MobileEditableElement.vue'\nimport MobileOperate from './MobileOperate.vue'\nimport SlideToolbar from './SlideToolbar.vue'\nimport ElementToolbar from './ElementToolbar.vue'\nimport Header from './Header.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n changeMode: {\n type: Function as PropType<(mode: Mode) => void>,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nconst slidesStore = useSlidesStore()\nconst mainStore = useMainStore()\nconst { slideIndex, currentSlide, viewportRatio } = storeToRefs(slidesStore)\nconst { activeElementIdList, handleElement } = storeToRefs(mainStore)\n\nconst contentRef = ref()\n\nconst alignmentLines = ref([])\n\nconst background = computed(() => currentSlide.value.background)\nconst { backgroundStyle } = useSlideBackgroundStyle(background)\n\nconst canvasScale = computed(() => {\n if (!contentRef.value) return 1\n const contentWidth = contentRef.value.clientWidth\n const contentheight = contentRef.value.clientHeight\n\n const contentRatio = contentheight / contentWidth\n if (contentRatio >= viewportRatio.value) return (contentWidth - 20) / VIEWPORT_SIZE\n return (contentheight - 20) / viewportRatio.value / VIEWPORT_SIZE\n})\n\nonMounted(() => {\n if (activeElementIdList.value.length) mainStore.setActiveElementIdList([])\n if (slideIndex.value !== 0) slidesStore.updateSlideIndex(0)\n})\n\nconst viewportStyles = computed(() => ({\n width: VIEWPORT_SIZE * canvasScale.value + 'px',\n height: VIEWPORT_SIZE * viewportRatio.value * canvasScale.value + 'px',\n}))\n\nconst elementList = ref([])\nconst setLocalElementList = () => {\n elementList.value = currentSlide.value ? JSON.parse(JSON.stringify(currentSlide.value.elements)) : []\n}\nwatchEffect(setLocalElementList)\n\nconst { dragElement } = useDragElement(elementList, alignmentLines, canvasScale)\nconst { scaleElement } = useScaleElement(elementList, alignmentLines, canvasScale)\n\nconst selectElement = (e: TouchEvent, element: PPTElement, startMove = true) => {\n if (!activeElementIdList.value.includes(element.id)) {\n mainStore.setActiveElementIdList([element.id])\n mainStore.setHandleElementId(element.id)\n }\n if (startMove) dragElement(e, element)\n}\n\nconst handleClickBlankArea = () => {\n mainStore.setActiveElementIdList([])\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(Header, { changeMode: __props.changeMode }, null, 8, [\"changeMode\"]),\n _createElementVNode(\"div\", {\n class: \"content\",\n ref_key: \"contentRef\",\n ref: contentRef,\n onTouchstart: _cache[0] || (_cache[0] = ($event: any) => (handleClickBlankArea()))\n }, [\n _createElementVNode(\"div\", {\n class: \"viewport-wrapper\",\n style: _normalizeStyle(_unref(viewportStyles))\n }, [\n _createElementVNode(\"div\", {\n class: \"background\",\n style: _normalizeStyle(_unref(backgroundStyle))\n }, null, 4),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(alignmentLines.value, (line, index) => {\n return (_openBlock(), _createBlock(AlignmentLine, {\n key: index,\n type: line.type,\n axis: line.axis,\n length: line.length,\n canvasScale: _unref(canvasScale)\n }, null, 8, [\"type\", \"axis\", \"length\", \"canvasScale\"]))\n }), 128)),\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(elementList.value, (element) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: element.id\n }, [\n (element.type !== 'line')\n ? (_openBlock(), _createBlock(MobileOperate, {\n key: 0,\n elementInfo: element,\n isSelected: _unref(activeElementIdList).includes(element.id),\n canvasScale: _unref(canvasScale),\n scaleElement: _unref(scaleElement)\n }, null, 8, [\"elementInfo\", \"isSelected\", \"canvasScale\", \"scaleElement\"]))\n : _createCommentVNode(\"\", true)\n ], 64))\n }), 128)),\n _createElementVNode(\"div\", {\n class: \"viewport\",\n style: _normalizeStyle({ transform: `scale(${_unref(canvasScale)})` })\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(elementList.value, (element, index) => {\n return (_openBlock(), _createBlock(MobileEditableElement, {\n key: element.id,\n elementInfo: element,\n elementIndex: index + 1,\n selectElement: selectElement\n }, null, 8, [\"elementInfo\", \"elementIndex\"]))\n }), 128))\n ], 4)\n ], 4)\n ], 544),\n _createVNode(SlideToolbar),\n (_unref(handleElement))\n ? (_openBlock(), _createBlock(ElementToolbar, { key: 0 }))\n : _createCommentVNode(\"\", true)\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=8cdcde82&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-8cdcde82\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, normalizeStyle as _normalizeStyle, createCommentVNode as _createCommentVNode, normalizeClass as _normalizeClass, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createTextVNode as _createTextVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-5293de3b\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"header\" }\nconst _hoisted_2 = /*#__PURE__*/_createTextVNode(\" 退出播放\")\n\nimport { computed, onMounted, PropType, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport { Mode } from '@/types/mobile'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\nimport MobileThumbnails from './MobileThumbnails.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MobilePlayer',\n props: {\n changeMode: {\n type: Function as PropType<(mode: Mode) => void>,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nconst slidesStore = useSlidesStore()\nconst { slides, slideIndex, currentSlide, viewportRatio } = storeToRefs(slidesStore)\n\nconst toolVisible = ref(false)\n\nconst playerSize = ref({ width: 0, height: 0 })\n\nonMounted(() => {\n if (slideIndex.value !== 0) slidesStore.updateSlideIndex(0)\n\n playerSize.value = {\n width: document.body.clientHeight,\n height: document.body.clientWidth,\n }\n})\n\nconst slideSize = computed(() => {\n const playerRatio = playerSize.value.height / playerSize.value.width\n\n let slideWidth = 0\n let slideHeight = 0\n\n if (playerRatio >= viewportRatio.value) {\n slideWidth = playerSize.value.width\n slideHeight = slideWidth * viewportRatio.value\n }\n else {\n slideHeight = playerSize.value.height\n slideWidth = slideHeight / viewportRatio.value\n }\n\n return {\n width: slideWidth,\n height: slideHeight,\n }\n})\n\nconst touchInfo = ref<{ x: number; y: number; } | null>(null)\nconst touchStartListener = (e: TouchEvent) => {\n touchInfo.value = {\n x: e.changedTouches[0].pageX,\n y: e.changedTouches[0].pageY,\n }\n}\nconst touchEndListener = (e: TouchEvent) => {\n if (!touchInfo.value) return\n\n const offsetY = Math.abs(touchInfo.value.y - e.changedTouches[0].pageY)\n const offsetX = e.changedTouches[0].pageX - touchInfo.value.x\n\n if ( Math.abs(offsetX) > offsetY && Math.abs(offsetX) > 50 ) {\n touchInfo.value = null\n\n if (offsetX < 0 && slideIndex.value > 0) slidesStore.updateSlideIndex(slideIndex.value - 1)\n if (offsetX > 0 && slideIndex.value < slides.value.length - 1) slidesStore.updateSlideIndex(slideIndex.value + 1)\n }\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconLogout = _resolveComponent(\"IconLogout\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"mobile-player\",\n style: _normalizeStyle({\n width: playerSize.value.width + 'px',\n height: playerSize.value.height + 'px',\n transform: `rotate(90deg) translateY(-${playerSize.value.height}px)`,\n })\n }, [\n _createElementVNode(\"div\", {\n class: \"screen-slide-list\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (toolVisible.value = !toolVisible.value)),\n onTouchstart: _cache[1] || (_cache[1] = $event => touchStartListener($event)),\n onTouchend: _cache[2] || (_cache[2] = $event => touchEndListener($event))\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: _normalizeClass([\n 'slide-item', \n `turning-mode-${slide.turningMode || 'slideY'}`,\n {\n 'current': index === _unref(slideIndex),\n 'before': index < _unref(slideIndex),\n 'after': index > _unref(slideIndex),\n 'hide': (index === _unref(slideIndex) - 1 || index === _unref(slideIndex) + 1) && slide.turningMode !== _unref(currentSlide).turningMode,\n }\n ]),\n key: slide.id\n }, [\n (Math.abs(_unref(slideIndex) - index) < 2)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: \"slide-content\",\n style: _normalizeStyle({\n width: _unref(slideSize).width + 'px',\n height: _unref(slideSize).height + 'px',\n })\n }, [\n _createVNode(ThumbnailSlide, {\n slide: slide,\n size: _unref(slideSize).width\n }, null, 8, [\"slide\", \"size\"])\n ], 4))\n : _createCommentVNode(\"\", true)\n ], 2))\n }), 128))\n ], 32),\n (toolVisible.value)\n ? (_openBlock(), _createElementBlock(_Fragment, { key: 0 }, [\n _createElementVNode(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"back\",\n onClick: _cache[3] || (_cache[3] = ($event: any) => (__props.changeMode('preview')))\n }, [\n _createVNode(_component_IconLogout),\n _hoisted_2\n ])\n ]),\n _createVNode(MobileThumbnails, { class: \"thumbnails\" })\n ], 64))\n : _createCommentVNode(\"\", true)\n ], 4))\n}\n}\n\n})","import script from \"./MobilePlayer.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MobilePlayer.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MobilePlayer.vue?vue&type=style&index=0&id=5293de3b&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-5293de3b\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createVNode as _createVNode, createElementVNode as _createElementVNode, resolveComponent as _resolveComponent, createTextVNode as _createTextVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-836e1638\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"thumbnail-list\" }\nconst _hoisted_2 = { class: \"menu\" }\nconst _hoisted_3 = /*#__PURE__*/_createTextVNode(\" 编辑\")\nconst _hoisted_4 = /*#__PURE__*/_createTextVNode(\" 播放\")\n\nimport { PropType, onMounted, ref } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useSlidesStore } from '@/store'\nimport useLoadSlides from '@/hooks/useLoadSlides'\nimport { Mode } from '@/types/mobile'\n\nimport ThumbnailSlide from '@/views/components/ThumbnailSlide/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MobilePreview',\n props: {\n changeMode: {\n type: Function as PropType<(mode: Mode) => void>,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst { slides } = storeToRefs(useSlidesStore())\nconst { slidesLoadLimit } = useLoadSlides()\n\nconst mobileRef = ref()\nconst screenWidth = ref(0)\n\nonMounted(() => {\n if (!mobileRef.value) return\n screenWidth.value = mobileRef.value.clientWidth\n})\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconEdit = _resolveComponent(\"IconEdit\")!\n const _component_Divider = _resolveComponent(\"Divider\")!\n const _component_IconFullScreenPlay = _resolveComponent(\"IconFullScreenPlay\")!\n\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"mobile-preview\",\n ref_key: \"mobileRef\",\n ref: mobileRef\n }, [\n _createElementVNode(\"div\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(slides), (slide, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"thumbnail-item\",\n key: slide.id\n }, [\n _createVNode(ThumbnailSlide, {\n slide: slide,\n size: screenWidth.value - 20,\n visible: index < _unref(slidesLoadLimit)\n }, null, 8, [\"slide\", \"size\", \"visible\"])\n ]))\n }), 128))\n ]),\n _createElementVNode(\"div\", _hoisted_2, [\n _createElementVNode(\"div\", {\n class: \"menu-item\",\n onClick: _cache[0] || (_cache[0] = ($event: any) => (__props.changeMode('editor')))\n }, [\n _createVNode(_component_IconEdit, { class: \"icon\" }),\n _hoisted_3\n ]),\n _createVNode(_component_Divider, {\n type: \"vertical\",\n style: {\"height\":\"30px\"}\n }),\n _createElementVNode(\"div\", {\n class: \"menu-item\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (__props.changeMode('player')))\n }, [\n _createVNode(_component_IconFullScreenPlay, { class: \"icon\" }),\n _hoisted_4\n ])\n ])\n ], 512))\n}\n}\n\n})","import script from \"./MobilePreview.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MobilePreview.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MobilePreview.vue?vue&type=style&index=0&id=836e1638&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-836e1638\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, resolveDynamicComponent as _resolveDynamicComponent, openBlock as _openBlock, createBlock as _createBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-1fb24d48\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"mobile\" }\n\nimport { computed, ref } from 'vue'\nimport { Mode } from '@/types/mobile'\n\nimport MobileEditor from './MobileEditor/index.vue'\nimport MobilePlayer from './MobilePlayer.vue'\nimport MobilePreview from './MobilePreview.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n setup(__props) {\n\nconst mode = ref('preview')\n \nconst changeMode = (_mode: Mode) => mode.value = _mode\n\nconst currentComponent = computed(() => {\n const componentMap = {\n 'editor': MobileEditor,\n 'player': MobilePlayer,\n 'preview': MobilePreview,\n }\n return componentMap[mode.value] || null\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n (_openBlock(), _createBlock(_resolveDynamicComponent(_unref(currentComponent)), { changeMode: changeMode }))\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=1fb24d48&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-1fb24d48\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, openBlock as _openBlock, createBlock as _createBlock, createCommentVNode as _createCommentVNode } from \"vue\"\n\nimport { onMounted } from 'vue'\nimport { storeToRefs } from 'pinia'\nimport { useScreenStore, useMainStore, useSnapshotStore } from '@/store'\nimport { LOCALSTORAGE_KEY_DISCARDED_DB } from '@/configs/storage'\nimport { isPC } from './utils/common'\n\nimport Editor from './views/Editor/index.vue'\nimport Screen from './views/Screen/index.vue'\nimport Mobile from './views/Mobile/index.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'App',\n setup(__props) {\n\nconst _isPC = isPC()\n\nconst mainStore = useMainStore()\nconst snapshotStore = useSnapshotStore()\nconst { databaseId } = storeToRefs(mainStore)\nconst { screening } = storeToRefs(useScreenStore())\n\nif (process.env.NODE_ENV === 'production') {\n window.onbeforeunload = () => false\n}\n\nonMounted(() => {\n snapshotStore.initSnapshotDatabase()\n mainStore.setAvailableFonts()\n})\n\n// 应用注销时向 localStorage 中记录下本次 indexedDB 的数据库ID,用于之后清除数据库\nwindow.addEventListener('unload', () => {\n const discardedDB = localStorage.getItem(LOCALSTORAGE_KEY_DISCARDED_DB)\n const discardedDBList: string[] = discardedDB ? JSON.parse(discardedDB) : []\n\n discardedDBList.push(databaseId.value)\n\n const newDiscardedDB = JSON.stringify(discardedDBList)\n localStorage.setItem(LOCALSTORAGE_KEY_DISCARDED_DB, newDiscardedDB)\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_unref(screening))\n ? (_openBlock(), _createBlock(Screen, { key: 0 }))\n : (_unref(_isPC))\n ? (_openBlock(), _createBlock(Editor, { key: 1 }))\n : (_openBlock(), _createBlock(Mobile, { key: 2 }))\n}\n}\n\n})","import script from \"./App.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./App.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./App.vue?vue&type=style&index=0&id=f5c43528&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","/* eslint-disable no-console */\n\nimport { register } from 'register-service-worker'\n\nif (process.env.NODE_ENV === 'production') {\n register(`${process.env.BASE_URL}service-worker.js`, {\n ready() {\n console.log(\n 'App is being served from cache by a service worker.\\n' +\n 'For more details, visit https://goo.gl/AFskqB'\n )\n },\n registered() {\n console.log('Service worker has been registered.')\n },\n cached() {\n console.log('Content has been cached for offline use.')\n },\n updatefound() {\n console.log('New content is downloading.')\n },\n updated() {\n console.log('New content is available; please refresh.')\n },\n offline() {\n console.log('No internet connection found. App is running in offline mode.')\n },\n error(error) {\n console.error('Error during service worker registration:', error)\n }\n })\n}\n","// https://iconpark.bytedance.com/official\n\nimport { App } from 'vue'\nimport {\n PlayOne,\n FullScreenPlay,\n Lock,\n Unlock,\n Ppt,\n Format,\n Picture,\n FullScreen,\n List,\n OrderedList,\n Helpcenter,\n FlipVertically,\n FlipHorizontally,\n FontSize,\n Code,\n TextBold,\n TextItalic,\n TextUnderline,\n Strikethrough,\n Edit,\n Quote,\n BackgroundColor,\n Group,\n Ungroup,\n Back,\n Next,\n Fullwidth,\n AlignTop,\n AlignLeft,\n AlignRight,\n AlignBottom,\n AlignVertically,\n AlignHorizontally,\n BringToFront,\n SendToBack,\n AlignTextLeft,\n AlignTextRight,\n AlignTextCenter,\n RowHeight,\n Write,\n InsertTable,\n AddText,\n Fill,\n Tailoring,\n Effects,\n ColorFilter,\n Down,\n Plus,\n Minus,\n Connection,\n BringToFrontOne,\n SentToBack,\n Github,\n ChartProportion,\n ChartHistogram,\n ChartHistogramOne,\n ChartLineArea,\n ChartRing,\n ChartScatter,\n ChartLine,\n ChartPie,\n Text,\n Rotate,\n LeftTwo,\n RightTwo,\n Platte,\n UpOne,\n DownOne,\n Close,\n CloseSmall,\n Undo,\n Transform,\n Click,\n Theme,\n ArrowCircleLeft,\n GraphicDesign,\n Logout,\n Erase,\n Clear,\n FolderClose,\n AlignTextTopOne,\n AlignTextBottomOne,\n AlignTextMiddleOne,\n Pause,\n VolumeMute,\n VolumeNotice,\n VolumeSmall,\n VideoTwo,\n Formula,\n LinkOne,\n FullScreenOne,\n OffScreenOne,\n Power,\n ListView,\n Magic,\n HighLight,\n Share,\n IndentLeft,\n IndentRight,\n VerticalSpacingBetweenItems,\n Copy,\n Delete,\n Square,\n Round,\n Needle,\n} from '@icon-park/vue-next'\n\nexport const icons = {\n IconPlayOne: PlayOne,\n IconFullScreenPlay: FullScreenPlay,\n IconLock: Lock,\n IconUnlock: Unlock,\n IconPpt: Ppt,\n IconFormat: Format,\n IconPicture: Picture,\n IconFullScreen: FullScreen,\n IconList: List,\n IconOrderedList: OrderedList,\n IconHelpcenter: Helpcenter,\n IconFlipVertically: FlipVertically,\n IconFlipHorizontally: FlipHorizontally,\n IconFontSize: FontSize,\n IconCode: Code,\n IconTextBold: TextBold,\n IconTextItalic: TextItalic,\n IconTextUnderline: TextUnderline,\n IconStrikethrough: Strikethrough,\n IconEdit: Edit,\n IconQuote: Quote,\n IconBackgroundColor: BackgroundColor,\n IconGroup: Group,\n IconUngroup: Ungroup,\n IconBack: Back,\n IconNext: Next,\n IconFullwidth: Fullwidth,\n IconAlignTop: AlignTop,\n IconAlignLeft: AlignLeft,\n IconAlignRight: AlignRight,\n IconAlignBottom: AlignBottom,\n IconAlignVertically: AlignVertically,\n IconAlignHorizontally: AlignHorizontally,\n IconBringToFront: BringToFront,\n IconSendToBack: SendToBack,\n IconAlignTextLeft: AlignTextLeft,\n IconAlignTextRight: AlignTextRight,\n IconAlignTextCenter: AlignTextCenter,\n IconRowHeight: RowHeight,\n IconWrite: Write,\n IconInsertTable: InsertTable,\n IconAddText: AddText,\n IconFill: Fill,\n IconTailoring: Tailoring,\n IconEffects: Effects,\n IconColorFilter: ColorFilter,\n IconDown: Down,\n IconPlus: Plus,\n IconMinus: Minus,\n IconConnection: Connection,\n IconBringToFrontOne: BringToFrontOne,\n IconSentToBack: SentToBack,\n IconGithub: Github,\n IconChartProportion: ChartProportion,\n IconChartHistogram: ChartHistogram,\n IconChartHistogramOne: ChartHistogramOne,\n IconChartLineArea: ChartLineArea,\n IconChartRing: ChartRing,\n IconChartScatter: ChartScatter,\n IconChartLine: ChartLine,\n IconChartPie: ChartPie,\n IconText: Text,\n IconRotate: Rotate,\n IconLeftTwo: LeftTwo,\n IconRightTwo: RightTwo,\n IconPlatte: Platte,\n IconUpOne: UpOne,\n IconDownOne: DownOne,\n IconClose: Close,\n IconCloseSmall: CloseSmall,\n IconUndo: Undo,\n IconTransform: Transform,\n IconClick: Click,\n IconTheme: Theme,\n IconArrowCircleLeft: ArrowCircleLeft,\n IconGraphicDesign: GraphicDesign,\n IconLogout: Logout,\n IconErase: Erase,\n IconClear: Clear,\n IconFolderClose: FolderClose,\n IconAlignTextTopOne: AlignTextTopOne,\n IconAlignTextBottomOne: AlignTextBottomOne,\n IconAlignTextMiddleOne: AlignTextMiddleOne,\n IconPause: Pause,\n IconVolumeMute: VolumeMute,\n IconVolumeNotice: VolumeNotice,\n IconVolumeSmall: VolumeSmall,\n IconVideoTwo: VideoTwo,\n IconFormula: Formula,\n IconLinkOne: LinkOne,\n IconFullScreenOne: FullScreenOne,\n IconOffScreenOne: OffScreenOne,\n IconPower: Power,\n IconListView: ListView,\n IconMagic: Magic,\n IconHighLight: HighLight,\n IconShare: Share,\n IconIndentLeft: IndentLeft,\n IconIndentRight: IndentRight,\n IconVerticalSpacingBetweenItems: VerticalSpacingBetweenItems,\n IconCopy: Copy,\n IconDelete: Delete,\n IconSquare: Square,\n IconRound: Round,\n IconNeedle: Needle,\n}\n\nexport default {\n install(app: App) {\n for (const key of Object.keys(icons)) {\n app.component(key, icons[key])\n }\n }\n}","import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-4727b7ff\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = [\"accept\"]\n\nimport { ref } from 'vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'FileInput',\n props: {\n accept: {\n type: String,\n default: 'image/*',\n },\n},\n emits: [\"change\"],\n setup(__props, { emit }: { emit: ({\n (event: 'change', payload: FileList): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst inputRef = ref()\n\nconst handleClick = () => {\n if (!inputRef.value) return\n inputRef.value.value = ''\n inputRef.value.click()\n}\nconst handleChange = (e: Event) => {\n const files = (e.target as HTMLInputElement).files\n if (files) emit('change', files)\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"file-input\",\n onClick: _cache[1] || (_cache[1] = ($event: any) => (handleClick()))\n }, [\n _renderSlot(_ctx.$slots, \"default\"),\n _createElementVNode(\"input\", {\n class: \"input\",\n type: \"file\",\n name: \"upload\",\n ref_key: \"inputRef\",\n ref: inputRef,\n accept: __props.accept,\n onChange: _cache[0] || (_cache[0] = $event => handleChange($event))\n }, null, 40, _hoisted_1)\n ]))\n}\n}\n\n})","import script from \"./FileInput.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./FileInput.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./FileInput.vue?vue&type=style&index=0&id=4727b7ff&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-4727b7ff\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { renderSlot as _renderSlot, normalizeClass as _normalizeClass, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'CheckboxButton',\n props: {\r\n checked: {\r\n type: Boolean,\r\n default: false,\r\n },\r\n},\n setup(__props) {\n\r\n\r\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"button\", {\n class: _normalizeClass([\"checkbox-button\", { 'checked': __props.checked }])\n }, [\n _renderSlot(_ctx.$slots, \"default\")\n ], 2))\n}\n}\n\n})","import script from \"./CheckboxButton.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./CheckboxButton.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./CheckboxButton.vue?vue&type=style&index=0&id=699cf016&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-699cf016\"]])\n\nexport default __exports__","\r\n\r\n\r\n\r\n","import { render } from \"./CheckboxButtonGroup.vue?vue&type=template&id=b8aa6eac&scoped=true\"\nconst script = {}\n\nimport \"./CheckboxButtonGroup.vue?vue&type=style&index=0&id=b8aa6eac&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['render',render],['__scopeId',\"data-v-b8aa6eac\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed } from 'vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Checkboard',\n props: {\n size: {\n type: Number,\n default: 8,\n },\n white: {\n type: String,\n default: '#fff',\n },\n grey: {\n type: String,\n default: '#e6e6e6',\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst checkboardCache = {}\n\nconst renderCheckboard = (white: string, grey: string, size: number) => {\n const canvas = document.createElement('canvas')\n canvas.width = canvas.height = size * 2\n const ctx = canvas.getContext('2d')\n \n if (!ctx) return null\n\n ctx.fillStyle = white\n ctx.fillRect(0, 0, canvas.width, canvas.height)\n ctx.fillStyle = grey\n ctx.fillRect(0, 0, size, size)\n ctx.translate(size, size)\n ctx.fillRect(0, 0, size, size)\n return canvas.toDataURL()\n}\n\nconst getCheckboard = (white: string, grey: string, size: number) => {\n const key = white + ',' + grey + ',' + size\n if (checkboardCache[key]) return checkboardCache[key]\n \n const checkboard = renderCheckboard(white, grey, size)\n checkboardCache[key] = checkboard\n return checkboard\n}\n\nconst bgStyle = computed(() => {\n const checkboard = getCheckboard(props.white, props.grey, props.size)\n return { backgroundImage: `url(${checkboard})` }\n})\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"checkerboard\",\n style: _normalizeStyle(_unref(bgStyle))\n }, null, 4))\n}\n}\n\n})","import script from \"./Checkboard.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Checkboard.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Checkboard.vue?vue&type=style&index=0&id=7494636c&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-7494636c\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { createVNode as _createVNode, createElementVNode as _createElementVNode, unref as _unref, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-246b525c\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"alpha\" }\nconst _hoisted_2 = { class: \"alpha-checkboard-wrap\" }\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"alpha-picker\" }, null, -1))\nconst _hoisted_4 = [\n _hoisted_3\n]\n\nimport { computed, onUnmounted, PropType, ref } from 'vue'\n\nimport Checkboard from './Checkboard.vue'\nimport { ColorFormats } from 'tinycolor2'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Alpha',\n props: {\n value: {\n type: Object as PropType,\n required: true,\n },\n},\n emits: [\"colorChange\"],\n setup(__props, { emit }: { emit: ({\n (event: 'colorChange', payload: ColorFormats.RGBA): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst color = computed(() => props.value)\n \nconst gradientColor = computed(() => {\n const rgbaStr = [color.value.r, color.value.g, color.value.b].join(',')\n return `linear-gradient(to right, rgba(${rgbaStr}, 0) 0%, rgba(${rgbaStr}, 1) 100%)`\n})\n\nconst alphaRef = ref()\nconst handleChange = (e: MouseEvent) => {\n e.preventDefault()\n if (!alphaRef.value) return\n const containerWidth = alphaRef.value.clientWidth\n const xOffset = alphaRef.value.getBoundingClientRect().left + window.pageXOffset\n const left = e.pageX - xOffset\n let a\n\n if (left < 0) a = 0\n else if (left > containerWidth) a = 1\n else a = Math.round(left * 100 / containerWidth) / 100\n\n if (color.value.a !== a) {\n emit('colorChange', {\n r: color.value.r,\n g: color.value.g,\n b: color.value.b,\n a: a,\n })\n }\n}\n\nconst unbindEventListeners = () => {\n window.removeEventListener('mousemove', handleChange)\n window.removeEventListener('mouseup', unbindEventListeners)\n}\nconst handleMouseDown = (e: MouseEvent) => {\n handleChange(e)\n window.addEventListener('mousemove', handleChange)\n window.addEventListener('mouseup', unbindEventListeners)\n}\nonUnmounted(unbindEventListeners)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(Checkboard)\n ]),\n _createElementVNode(\"div\", {\n class: \"alpha-gradient\",\n style: _normalizeStyle({ background: _unref(gradientColor) })\n }, null, 4),\n _createElementVNode(\"div\", {\n class: \"alpha-container\",\n ref_key: \"alphaRef\",\n ref: alphaRef,\n onMousedown: _cache[0] || (_cache[0] = $event => handleMouseDown($event))\n }, [\n _createElementVNode(\"div\", {\n class: \"alpha-pointer\",\n style: _normalizeStyle({ left: _unref(color).a * 100 + '%' })\n }, _hoisted_4, 4)\n ], 544)\n ]))\n}\n}\n\n})","import script from \"./Alpha.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Alpha.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Alpha.vue?vue&type=style&index=0&id=246b525c&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-246b525c\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-60c3cca1\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"hue\" }\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"hue-picker\" }, null, -1))\nconst _hoisted_3 = [\n _hoisted_2\n]\n\nimport { computed, onUnmounted, PropType, ref, watch } from 'vue'\nimport tinycolor, { ColorFormats } from 'tinycolor2'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Hue',\n props: {\n value: {\n type: Object as PropType,\n required: true,\n },\n hue: {\n type: Number,\n required: true,\n },\n},\n emits: [\"colorChange\"],\n setup(__props, { emit }: { emit: ({\n (event: 'colorChange', payload: ColorFormats.HSLA): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst oldHue = ref(0)\nconst pullDirection = ref('')\n\nconst color = computed(() => {\n const hsla = tinycolor(props.value).toHsl()\n if (props.hue !== -1) hsla.h = props.hue\n return hsla\n})\n\nconst pointerLeft = computed(() => {\n if (color.value.h === 0 && pullDirection.value === 'right') return '100%'\n return color.value.h * 100 / 360 + '%'\n})\n\nwatch(() => props.value, () => {\n const hsla = tinycolor(props.value).toHsl()\n const h = hsla.s === 0 ? props.hue : hsla.h\n if (h !== 0 && h - oldHue.value > 0) pullDirection.value = 'right'\n if (h !== 0 && h - oldHue.value < 0) pullDirection.value = 'left'\n oldHue.value = h\n})\n\nconst hueRef = ref()\nconst handleChange = (e: MouseEvent) => {\n e.preventDefault()\n if (!hueRef.value) return\n\n const containerWidth = hueRef.value.clientWidth\n const xOffset = hueRef.value.getBoundingClientRect().left + window.pageXOffset\n const left = e.pageX - xOffset\n let h, percent\n \n if (left < 0) h = 0\n else if (left > containerWidth) h = 360\n else {\n percent = left * 100 / containerWidth\n h = 360 * percent / 100\n }\n if (props.hue === -1 || color.value.h !== h) {\n emit('colorChange', {\n h,\n l: color.value.l,\n s: color.value.s,\n a: color.value.a,\n })\n }\n}\n\nconst unbindEventListeners = () => {\n window.removeEventListener('mousemove', handleChange)\n window.removeEventListener('mouseup', unbindEventListeners)\n}\nconst handleMouseDown = (e: MouseEvent) => {\n handleChange(e)\n window.addEventListener('mousemove', handleChange)\n window.addEventListener('mouseup', unbindEventListeners)\n}\nonUnmounted(unbindEventListeners)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", {\n class: \"hue-container\",\n ref_key: \"hueRef\",\n ref: hueRef,\n onMousedown: _cache[0] || (_cache[0] = $event => handleMouseDown($event))\n }, [\n _createElementVNode(\"div\", {\n class: \"hue-pointer\",\n style: _normalizeStyle({ left: _unref(pointerLeft) })\n }, _hoisted_3, 4)\n ], 544)\n ]))\n}\n}\n\n})","import script from \"./Hue.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Hue.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Hue.vue?vue&type=style&index=0&id=60c3cca1&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-60c3cca1\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-d230faf4\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"saturation-white\" }, null, -1))\nconst _hoisted_2 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"saturation-black\" }, null, -1))\nconst _hoisted_3 = /*#__PURE__*/ _withScopeId(() => /*#__PURE__*/_createElementVNode(\"div\", { class: \"saturation-circle\" }, null, -1))\nconst _hoisted_4 = [\n _hoisted_3\n]\n\nimport { computed, onUnmounted, PropType, ref } from 'vue'\nimport tinycolor, { ColorFormats } from 'tinycolor2'\nimport { throttle, clamp } from 'lodash'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'Saturation',\n props: {\n value: {\n type: Object as PropType,\n required: true,\n },\n hue: {\n type: Number,\n required: true,\n },\n},\n emits: [\"colorChange\"],\n setup(__props, { emit }: { emit: ({\n (event: 'colorChange', payload: ColorFormats.HSVA): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst color = computed(() => {\n const hsva = tinycolor(props.value).toHsv()\n if (props.hue !== -1) hsva.h = props.hue\n return hsva\n})\n\nconst bgColor = computed(() => `hsl(${color.value.h}, 100%, 50%)`)\nconst pointerTop = computed(() => (-(color.value.v * 100) + 1) + 100 + '%')\nconst pointerLeft = computed(() => color.value.s * 100 + '%')\n\nconst emitChangeEvent = throttle(function(param: ColorFormats.HSVA) {\n emit('colorChange', param)\n}, 20, { leading: true, trailing: false })\n\nconst saturationRef = ref()\nconst handleChange = (e: MouseEvent) => {\n e.preventDefault()\n if (!saturationRef.value) return\n \n const containerWidth = saturationRef.value.clientWidth\n const containerHeight = saturationRef.value.clientHeight\n const xOffset = saturationRef.value.getBoundingClientRect().left + window.pageXOffset\n const yOffset = saturationRef.value.getBoundingClientRect().top + window.pageYOffset\n const left = clamp(e.pageX - xOffset, 0, containerWidth)\n const top = clamp(e.pageY - yOffset, 0, containerHeight)\n const saturation = left / containerWidth\n const bright = clamp(-(top / containerHeight) + 1, 0, 1)\n\n emitChangeEvent({\n h: color.value.h,\n s: saturation,\n v: bright,\n a: color.value.a,\n })\n}\n\n\nconst unbindEventListeners = () => {\n window.removeEventListener('mousemove', handleChange)\n window.removeEventListener('mouseup', unbindEventListeners)\n}\nconst handleMouseDown = (e: MouseEvent) => {\n handleChange(e)\n window.addEventListener('mousemove', handleChange)\n window.addEventListener('mouseup', unbindEventListeners)\n}\nonUnmounted(unbindEventListeners)\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"saturation\",\n ref_key: \"saturationRef\",\n ref: saturationRef,\n style: _normalizeStyle({ background: _unref(bgColor) }),\n onMousedown: _cache[0] || (_cache[0] = $event => handleMouseDown($event))\n }, [\n _hoisted_1,\n _hoisted_2,\n _createElementVNode(\"div\", {\n class: \"saturation-pointer\",\n style: _normalizeStyle({\n top: _unref(pointerTop),\n left: _unref(pointerLeft),\n })\n }, _hoisted_4, 4)\n ], 36))\n}\n}\n\n})","import script from \"./Saturation.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./Saturation.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./Saturation.vue?vue&type=style&index=0&id=d230faf4&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-d230faf4\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createElementVNode as _createElementVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-2f428dde\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"editable-input\" }\nconst _hoisted_2 = [\"value\"]\n\nimport { computed, PropType } from 'vue'\nimport tinycolor, { ColorFormats } from 'tinycolor2'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'EditableInput',\n props: {\n value: {\n type: Object as PropType,\n required: true,\n },\n},\n emits: [\"colorChange\"],\n setup(__props, { emit }: { emit: ({\n (event: 'colorChange', payload: ColorFormats.RGBA): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst val = computed(() => {\n let _hex = ''\n if (props.value.a < 1) _hex = tinycolor(props.value).toHex8String().toUpperCase()\n else _hex = tinycolor(props.value).toHexString().toUpperCase()\n return _hex.replace('#', '')\n})\n\nconst handleInput = (e: Event) => {\n const value = (e.target as HTMLInputElement).value\n if (value.length >= 6) emit('colorChange', tinycolor(value).toRgb())\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"input\", {\n class: \"input-content\",\n value: _unref(val),\n onInput: _cache[0] || (_cache[0] = $event => handleInput($event))\n }, null, 40, _hoisted_2)\n ]))\n}\n}\n\n})","import script from \"./EditableInput.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./EditableInput.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./EditableInput.vue?vue&type=style&index=0&id=2f428dde&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-2f428dde\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { unref as _unref, createVNode as _createVNode, createElementVNode as _createElementVNode, normalizeStyle as _normalizeStyle, resolveComponent as _resolveComponent, renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-c46eb110\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"color-picker\" }\nconst _hoisted_2 = { class: \"picker-saturation-wrap\" }\nconst _hoisted_3 = { class: \"picker-controls\" }\nconst _hoisted_4 = { class: \"picker-color-wrap\" }\nconst _hoisted_5 = { class: \"picker-sliders\" }\nconst _hoisted_6 = { class: \"picker-hue-wrap\" }\nconst _hoisted_7 = { class: \"picker-alpha-wrap\" }\nconst _hoisted_8 = { class: \"picker-field\" }\nconst _hoisted_9 = { class: \"picker-presets\" }\nconst _hoisted_10 = [\"onClick\"]\nconst _hoisted_11 = { class: \"picker-gradient-presets\" }\nconst _hoisted_12 = [\"onClick\"]\nconst _hoisted_13 = { class: \"picker-presets\" }\nconst _hoisted_14 = [\"onClick\"]\nconst _hoisted_15 = {\n key: 0,\n class: \"recent-colors-title\"\n}\nconst _hoisted_16 = { class: \"picker-presets\" }\nconst _hoisted_17 = [\"onClick\"]\n\nimport { computed, onMounted, ref, watch } from 'vue'\nimport tinycolor, { ColorFormats } from 'tinycolor2'\nimport { debounce } from 'lodash'\nimport { toCanvas } from 'html-to-image'\n\nimport Alpha from './Alpha.vue'\nimport Checkboard from './Checkboard.vue'\nimport Hue from './Hue.vue'\nimport Saturation from './Saturation.vue'\nimport EditableInput from './EditableInput.vue'\n\nimport { message } from 'ant-design-vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n modelValue: {\n type: String,\n default: '#e86b99',\n },\n},\n emits: [\"update:modelValue\"],\n setup(__props, { emit }: { emit: ({\n (event: 'update:modelValue', payload: string): void\n}), expose: any, slots: any, attrs: any }) {\n\nconst props = __props\n\n\n\n\n\nconst RECENT_COLORS = 'RECENT_COLORS'\n\nconst presetColorConfig = [\n ['#7f7f7f', '#f2f2f2'],\n ['#0d0d0d', '#808080'],\n ['#1c1a10', '#ddd8c3'],\n ['#0e243d', '#c6d9f0'],\n ['#233f5e', '#dae5f0'],\n ['#632623', '#f2dbdb'],\n ['#4d602c', '#eaf1de'],\n ['#3f3150', '#e6e0ec'],\n ['#1e5867', '#d9eef3'],\n ['#99490f', '#fee9da'],\n]\n\nconst gradient = (startColor: string, endColor: string, step: number) => {\n const _startColor = tinycolor(startColor).toRgb()\n const _endColor = tinycolor(endColor).toRgb()\n\n const rStep = (_endColor.r - _startColor.r) / step\n const gStep = (_endColor.g - _startColor.g) / step\n const bStep = (_endColor.b - _startColor.b) / step\n const gradientColorArr = []\n\n for (let i = 0; i < step; i++) {\n const gradientColor = tinycolor({\n r: _startColor.r + rStep * i,\n g: _startColor.g + gStep * i,\n b: _startColor.b + bStep * i,\n }).toRgbString()\n gradientColorArr.push(gradientColor)\n }\n return gradientColorArr\n}\n\nconst getPresetColors = () => {\n const presetColors = []\n for (const color of presetColorConfig) {\n presetColors.push(gradient(color[1], color[0], 5))\n }\n return presetColors\n}\n\nconst themeColors = ['#000000', '#ffffff', '#eeece1', '#1e497b', '#4e81bb', '#e2534d', '#9aba60', '#8165a0', '#47acc5', '#f9974c']\nconst standardColors = ['#c21401', '#ff1e02', '#ffc12a', '#ffff3a', '#90cf5b', '#00af57', '#00afee', '#0071be', '#00215f', '#72349d']\n\nconst hue = ref(-1)\nconst recentColors = ref([])\n\nconst color = computed({\n get() {\n return tinycolor(props.modelValue).toRgb()\n },\n set(rgba: ColorFormats.RGBA) {\n const rgbaString = `rgba(${[rgba.r, rgba.g, rgba.b, rgba.a].join(',')})`\n emit('update:modelValue', rgbaString)\n },\n})\n\nconst presetColors = getPresetColors()\n\nconst currentColor = computed(() => {\n return `rgba(${[color.value.r, color.value.g, color.value.b, color.value.a].join(',')})`\n})\n\nconst selectPresetColor = (colorString: string) => {\n hue.value = tinycolor(colorString).toHsl().h\n emit('update:modelValue', colorString)\n}\n\n// 每次选择非预设颜色时,需要将该颜色加入到最近使用列表中\nconst updateRecentColorsCache = debounce(function() {\n const _color = tinycolor(color.value).toRgbString()\n if (!recentColors.value.includes(_color)) {\n recentColors.value = [_color, ...recentColors.value]\n\n const maxLength = 10\n if (recentColors.value.length > maxLength) {\n recentColors.value = recentColors.value.slice(0, maxLength)\n }\n }\n}, 300, { trailing: true })\n\nonMounted(() => {\n const recentColorsCache = localStorage.getItem(RECENT_COLORS)\n if (recentColorsCache) recentColors.value = JSON.parse(recentColorsCache)\n})\n\nwatch(recentColors, () => {\n const recentColorsCache = JSON.stringify(recentColors.value)\n localStorage.setItem(RECENT_COLORS, recentColorsCache)\n})\n\nconst changeColor = (value: ColorFormats.RGBA | ColorFormats.HSLA | ColorFormats.HSVA) => {\n if ('h' in value) {\n hue.value = value.h\n color.value = tinycolor(value).toRgb()\n }\n else {\n hue.value = tinycolor(value).toHsl().h\n color.value = value\n }\n\n updateRecentColorsCache()\n}\n\n// 打开取色吸管\n// 检查环境是否支持原生取色吸管,支持则使用原生吸管,否则使用自定义吸管\nconst openEyeDropper = () => {\n const isSupportedEyeDropper = 'EyeDropper' in window\n\n if (isSupportedEyeDropper) browserEyeDropper()\n else customEyeDropper()\n}\n\n// 原生取色吸管\nconst browserEyeDropper = () => {\n message.success('按 ESC 键关闭取色吸管')\n\n // eslint-disable-next-line\n const eyeDropper = new (window as any).EyeDropper()\n eyeDropper.open().then((result: { sRGBHex: string }) => {\n const tColor = tinycolor(result.sRGBHex)\n hue.value = tColor.toHsl().h\n color.value = tColor.toRgb()\n\n updateRecentColorsCache()\n }).catch(() => {\n message.success('关闭取色吸管')\n })\n}\n\n// 基于 Canvas 的自定义取色吸管\nconst customEyeDropper = () => {\n const targetRef: HTMLElement | null = document.querySelector('.canvas')\n if (!targetRef) return\n\n const maskRef = document.createElement('div')\n maskRef.style.cssText = 'position: fixed; top: 0; left: 0; bottom: 0; right: 0; z-index: 9999; cursor: wait;'\n document.body.appendChild(maskRef)\n\n const colorBlockRef = document.createElement('div')\n colorBlockRef.style.cssText = 'position: absolute; top: -100px; left: -100px; width: 16px; height: 16px; border: 1px solid #000; z-index: 999'\n maskRef.appendChild(colorBlockRef)\n\n const { left, top, width, height } = targetRef.getBoundingClientRect()\n\n const filter = (node: HTMLElement) => {\n if (node.tagName && node.tagName.toUpperCase() === 'FOREIGNOBJECT') return false\n if (node.classList && node.classList.contains('operate')) return false\n return true\n }\n\n toCanvas(targetRef, { filter, fontEmbedCSS: '', width, height, canvasWidth: width, canvasHeight: height, pixelRatio: 1 }).then(canvasRef => {\n canvasRef.style.cssText = `position: absolute; top: ${top}px; left: ${left}px; cursor: crosshair;`\n maskRef.style.cursor = 'default'\n maskRef.appendChild(canvasRef)\n\n const ctx = canvasRef.getContext('2d')\n if (!ctx) return\n\n let currentColor = ''\n const handleMousemove = (e: MouseEvent) => {\n const x = e.x\n const y = e.y\n\n const mouseX = x - left\n const mouseY = y - top\n\n const [r, g, b, a] = ctx.getImageData(mouseX, mouseY, 1, 1).data\n currentColor = `rgba(${r}, ${g}, ${b}, ${(a / 255).toFixed(2)})`\n\n colorBlockRef.style.left = x + 10 + 'px'\n colorBlockRef.style.top = y + 10 + 'px'\n colorBlockRef.style.backgroundColor = currentColor\n }\n const handleMouseleave = () => {\n currentColor = ''\n colorBlockRef.style.left = '-100px'\n colorBlockRef.style.top = '-100px'\n colorBlockRef.style.backgroundColor = ''\n }\n const handleMousedown = (e: MouseEvent) => {\n if (currentColor && e.button === 0) {\n const tColor = tinycolor(currentColor)\n hue.value = tColor.toHsl().h\n color.value = tColor.toRgb()\n\n updateRecentColorsCache()\n }\n document.body.removeChild(maskRef)\n \n canvasRef.removeEventListener('mousemove', handleMousemove)\n canvasRef.removeEventListener('mouseleave', handleMouseleave)\n window.removeEventListener('mousedown', handleMousedown)\n }\n\n canvasRef.addEventListener('mousemove', handleMousemove)\n canvasRef.addEventListener('mouseleave', handleMouseleave)\n window.addEventListener('mousedown', handleMousedown)\n }).catch(() => {\n message.error('取色吸管初始化失败')\n document.body.removeChild(maskRef)\n })\n}\n\nreturn (_ctx: any,_cache: any) => {\n const _component_IconNeedle = _resolveComponent(\"IconNeedle\")!\n\n return (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createElementVNode(\"div\", _hoisted_2, [\n _createVNode(Saturation, {\n value: _unref(color),\n hue: hue.value,\n onColorChange: _cache[0] || (_cache[0] = value => changeColor(value))\n }, null, 8, [\"value\", \"hue\"])\n ]),\n _createElementVNode(\"div\", _hoisted_3, [\n _createElementVNode(\"div\", _hoisted_4, [\n _createElementVNode(\"div\", {\n class: \"picker-current-color\",\n style: _normalizeStyle({ background: _unref(currentColor) })\n }, null, 4),\n _createVNode(Checkboard)\n ]),\n _createElementVNode(\"div\", _hoisted_5, [\n _createElementVNode(\"div\", _hoisted_6, [\n _createVNode(Hue, {\n value: _unref(color),\n hue: hue.value,\n onColorChange: _cache[1] || (_cache[1] = value => changeColor(value))\n }, null, 8, [\"value\", \"hue\"])\n ]),\n _createElementVNode(\"div\", _hoisted_7, [\n _createVNode(Alpha, {\n value: _unref(color),\n onColorChange: _cache[2] || (_cache[2] = value => changeColor(value))\n }, null, 8, [\"value\"])\n ])\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_8, [\n _createVNode(EditableInput, {\n class: \"input\",\n value: _unref(color),\n onColorChange: _cache[3] || (_cache[3] = value => changeColor(value))\n }, null, 8, [\"value\"]),\n _createElementVNode(\"div\", {\n class: \"straw\",\n onClick: _cache[4] || (_cache[4] = ($event: any) => (openEyeDropper()))\n }, [\n _createVNode(_component_IconNeedle)\n ])\n ]),\n _createElementVNode(\"div\", _hoisted_9, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(themeColors, (c) => {\n return _createElementVNode(\"div\", {\n class: \"picker-presets-color\",\n key: c,\n style: _normalizeStyle({ background: c }),\n onClick: ($event: any) => (selectPresetColor(c))\n }, null, 12, _hoisted_10)\n }), 64))\n ]),\n _createElementVNode(\"div\", _hoisted_11, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(_unref(presetColors), (col, index) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"picker-gradient-col\",\n key: index\n }, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(col, (c) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n class: \"picker-gradient-color\",\n key: c,\n style: _normalizeStyle({ background: c }),\n onClick: ($event: any) => (selectPresetColor(c))\n }, null, 12, _hoisted_12))\n }), 128))\n ]))\n }), 128))\n ]),\n _createElementVNode(\"div\", _hoisted_13, [\n (_openBlock(), _createElementBlock(_Fragment, null, _renderList(standardColors, (c) => {\n return _createElementVNode(\"div\", {\n key: c,\n class: \"picker-presets-color\",\n style: _normalizeStyle({ background: c }),\n onClick: ($event: any) => (selectPresetColor(c))\n }, null, 12, _hoisted_14)\n }), 64))\n ]),\n (recentColors.value.length)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_15, \"最近使用:\"))\n : _createCommentVNode(\"\", true),\n _createElementVNode(\"div\", _hoisted_16, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(recentColors.value, (c) => {\n return (_openBlock(), _createElementBlock(\"div\", {\n key: c,\n class: \"picker-presets-color alpha\",\n onClick: ($event: any) => (selectPresetColor(c))\n }, [\n _createElementVNode(\"div\", {\n class: \"picker-presets-color-content\",\n style: _normalizeStyle({ background: c })\n }, null, 4)\n ], 8, _hoisted_17))\n }), 128))\n ])\n ]))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=c46eb110&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-c46eb110\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { resolveComponent as _resolveComponent, createVNode as _createVNode, openBlock as _openBlock, createElementBlock as _createElementBlock, createCommentVNode as _createCommentVNode, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-16ead44e\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = {\n key: 0,\n class: \"fullscreen-spin\"\n}\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'FullscreenSpin',\n props: {\n loading: {\n type: Boolean,\n default: false,\n },\n tip: {\n type: String,\n default: '',\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nreturn (_ctx: any,_cache: any) => {\n const _component_Spin = _resolveComponent(\"Spin\")!\n\n return (__props.loading)\n ? (_openBlock(), _createElementBlock(\"div\", _hoisted_1, [\n _createVNode(_component_Spin, {\n tip: __props.tip,\n size: \"large\"\n }, null, 8, [\"tip\"])\n ]))\n : _createCommentVNode(\"\", true)\n}\n}\n\n})","import script from \"./FullscreenSpin.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./FullscreenSpin.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./FullscreenSpin.vue?vue&type=style&index=0&id=16ead44e&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-16ead44e\"]])\n\nexport default __exports__","import { App } from 'vue'\n\nimport FileInput from '@/components/FileInput.vue'\nimport CheckboxButton from '@/components/CheckboxButton.vue'\nimport CheckboxButtonGroup from '@/components/CheckboxButtonGroup.vue'\nimport ColorPicker from '@/components/ColorPicker/index.vue'\nimport FullscreenSpin from '@/components/FullscreenSpin.vue'\n\nexport const components = {\n FileInput,\n CheckboxButton,\n CheckboxButtonGroup,\n ColorPicker,\n FullscreenSpin,\n}\n\nexport default {\n install(app: App) {\n for (const key of Object.keys(components)) {\n app.component(key, components[key])\n }\n }\n}\n","import { defineComponent as _defineComponent } from 'vue'\nimport { renderList as _renderList, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock, toDisplayString as _toDisplayString, createElementVNode as _createElementVNode, createCommentVNode as _createCommentVNode, resolveComponent as _resolveComponent, createBlock as _createBlock, normalizeClass as _normalizeClass, withModifiers as _withModifiers, pushScopeId as _pushScopeId, popScopeId as _popScopeId } from \"vue\"\n\nconst _withScopeId = n => (_pushScopeId(\"data-v-e470e712\"),n=n(),_popScopeId(),n)\nconst _hoisted_1 = { class: \"menu-content\" }\nconst _hoisted_2 = [\"onClick\"]\nconst _hoisted_3 = { class: \"text\" }\nconst _hoisted_4 = {\n key: 0,\n class: \"sub-text\"\n}\n\nimport { PropType } from 'vue'\nimport { ContextmenuItem } from './types'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'MenuContent',\n props: {\n menus: {\n type: Array as PropType,\n required: true,\n },\n handleClickMenuItem: {\n type: Function,\n required: true,\n },\n},\n setup(__props) {\n\n\n\nreturn (_ctx: any,_cache: any) => {\n const _component_menu_content = _resolveComponent(\"menu-content\", true)!\n\n return (_openBlock(), _createElementBlock(\"ul\", _hoisted_1, [\n (_openBlock(true), _createElementBlock(_Fragment, null, _renderList(__props.menus, (menu, index) => {\n return (_openBlock(), _createElementBlock(_Fragment, {\n key: menu.text || index\n }, [\n (!menu.hide)\n ? (_openBlock(), _createElementBlock(\"li\", {\n key: 0,\n class: _normalizeClass([\"menu-item\", {'divider': menu.divider, 'disable': menu.disable}]),\n onClick: _withModifiers(($event: any) => (__props.handleClickMenuItem(menu)), [\"stop\"])\n }, [\n (!menu.divider)\n ? (_openBlock(), _createElementBlock(\"div\", {\n key: 0,\n class: _normalizeClass([\"menu-item-content\", {\n 'has-children': menu.children,\n 'has-handler': menu.handler,\n }])\n }, [\n _createElementVNode(\"span\", _hoisted_3, _toDisplayString(menu.text), 1),\n (menu.subText && !menu.children)\n ? (_openBlock(), _createElementBlock(\"span\", _hoisted_4, _toDisplayString(menu.subText), 1))\n : _createCommentVNode(\"\", true),\n (menu.children && menu.children.length)\n ? (_openBlock(), _createBlock(_component_menu_content, {\n key: 1,\n class: \"sub-menu\",\n menus: menu.children,\n handleClickMenuItem: __props.handleClickMenuItem\n }, null, 8, [\"menus\", \"handleClickMenuItem\"]))\n : _createCommentVNode(\"\", true)\n ], 2))\n : _createCommentVNode(\"\", true)\n ], 10, _hoisted_2))\n : _createCommentVNode(\"\", true)\n ], 64))\n }), 128))\n ]))\n}\n}\n\n})","import script from \"./MenuContent.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./MenuContent.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./MenuContent.vue?vue&type=style&index=0&id=e470e712&lang=scss&scoped=true\"\n\nimport exportComponent from \"/home/runner/work/PPTist/PPTist/node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/exportHelper.js\"\nconst __exports__ = /*#__PURE__*/exportComponent(script, [['__scopeId',\"data-v-e470e712\"]])\n\nexport default __exports__","import { defineComponent as _defineComponent } from 'vue'\nimport { withModifiers as _withModifiers, createElementVNode as _createElementVNode, unref as _unref, createVNode as _createVNode, normalizeStyle as _normalizeStyle, Fragment as _Fragment, openBlock as _openBlock, createElementBlock as _createElementBlock } from \"vue\"\n\nimport { computed, PropType } from 'vue'\nimport { ContextmenuItem, Axis } from './types'\n\nimport MenuContent from './MenuContent.vue'\n\n\nexport default /*#__PURE__*/_defineComponent({\n __name: 'index',\n props: {\n axis: {\n type: Object as PropType,\n required: true,\n },\n el: {\n type: Object as PropType,\n required: true,\n },\n menus: {\n type: Array as PropType,\n required: true,\n },\n removeContextmenu: {\n type: Function,\n required: true,\n },\n},\n setup(__props) {\n\nconst props = __props\n\n\n\nconst style = computed(() => {\n const MENU_WIDTH = 170\n const MENU_HEIGHT = 30\n const DIVIDER_HEIGHT = 11\n const PADDING = 5\n\n const { x, y } = props.axis\n const menuCount = props.menus.filter(menu => !(menu.divider || menu.hide)).length\n const dividerCount = props.menus.filter(menu => menu.divider).length\n\n const menuWidth = MENU_WIDTH\n const menuHeight = menuCount * MENU_HEIGHT + dividerCount * DIVIDER_HEIGHT + PADDING * 2\n\n const screenWidth = document.body.clientWidth\n const screenHeight = document.body.clientHeight\n\n return {\n left: screenWidth <= x + menuWidth ? x - menuWidth : x,\n top: screenHeight <= y + menuHeight ? y - menuHeight : y,\n }\n})\n\nconst handleClickMenuItem = (item: ContextmenuItem) => {\n if (item.disable) return\n if (item.children && !item.handler) return\n if (item.handler) item.handler(props.el)\n props.removeContextmenu()\n}\n\nreturn (_ctx: any,_cache: any) => {\n return (_openBlock(), _createElementBlock(_Fragment, null, [\n _createElementVNode(\"div\", {\n class: \"mask\",\n onContextmenu: _cache[0] || (_cache[0] = _withModifiers(($event: any) => (__props.removeContextmenu()), [\"prevent\"])),\n onMousedown: _cache[1] || (_cache[1] = ($event: any) => (__props.removeContextmenu()))\n }, null, 32),\n _createElementVNode(\"div\", {\n class: \"contextmenu\",\n style: _normalizeStyle({\n left: _unref(style).left + 'px',\n top: _unref(style).top + 'px',\n }),\n onContextmenu: _cache[2] || (_cache[2] = _withModifiers(() => {}, [\"prevent\"]))\n }, [\n _createVNode(MenuContent, {\n menus: __props.menus,\n handleClickMenuItem: handleClickMenuItem\n }, null, 8, [\"menus\"])\n ], 36)\n ], 64))\n}\n}\n\n})","import script from \"./index.vue?vue&type=script&lang=ts&setup=true\"\nexport * from \"./index.vue?vue&type=script&lang=ts&setup=true\"\n\nimport \"./index.vue?vue&type=style&index=0&id=e70aeb5c&lang=scss\"\n\nconst __exports__ = script;\n\nexport default __exports__","import { Directive, createVNode, render, DirectiveBinding } from 'vue'\nimport ContextmenuComponent from '@/components/Contextmenu/index.vue'\n\nconst CTX_CONTEXTMENU_HANDLER = 'CTX_CONTEXTMENU_HANDLER'\n\nconst contextmenuListener = (el: HTMLElement, event: MouseEvent, binding: DirectiveBinding) => {\n event.stopPropagation()\n event.preventDefault()\n\n const menus = binding.value(el)\n if (!menus) return\n\n let container: HTMLDivElement | null = null\n\n // 移除右键菜单并取消相关的事件监听\n const removeContextmenu = () => {\n if (container) {\n document.body.removeChild(container)\n container = null\n }\n el.classList.remove('contextmenu-active')\n document.body.removeEventListener('scroll', removeContextmenu) \n window.removeEventListener('resize', removeContextmenu)\n }\n\n // 创建自定义菜单\n const options = {\n axis: { x: event.x, y: event.y },\n el,\n menus,\n removeContextmenu,\n }\n container = document.createElement('div')\n const vm = createVNode(ContextmenuComponent, options, null)\n render(vm, container)\n document.body.appendChild(container)\n\n // 为目标节点添加菜单激活状态的className\n el.classList.add('contextmenu-active')\n\n // 页面变化时移除菜单\n document.body.addEventListener('scroll', removeContextmenu)\n window.addEventListener('resize', removeContextmenu)\n}\n\nconst ContextmenuDirective: Directive = {\n mounted(el: HTMLElement, binding) {\n el[CTX_CONTEXTMENU_HANDLER] = (event: MouseEvent) => contextmenuListener(el, event, binding)\n el.addEventListener('contextmenu', el[CTX_CONTEXTMENU_HANDLER])\n },\n\n unmounted(el: HTMLElement) {\n if (el && el[CTX_CONTEXTMENU_HANDLER]) {\n el.removeEventListener('contextmenu', el[CTX_CONTEXTMENU_HANDLER])\n delete el[CTX_CONTEXTMENU_HANDLER]\n }\n },\n}\n\nexport default ContextmenuDirective","import { Directive, DirectiveBinding } from 'vue'\n\nconst CTX_CLICK_OUTSIDE_HANDLER = 'CTX_CLICK_OUTSIDE_HANDLER'\n\nconst clickListener = (el: HTMLElement, event: MouseEvent, binding: DirectiveBinding) => {\n const handler = binding.value\n\n const path = event.composedPath()\n const isClickOutside = path ? path.indexOf(el) < 0 : !el.contains(event.target as HTMLElement)\n\n if (!isClickOutside) return\n handler(event)\n}\n\nconst ClickOutsideDirective: Directive = {\n mounted(el: HTMLElement, binding) {\n el[CTX_CLICK_OUTSIDE_HANDLER] = (event: MouseEvent) => clickListener(el, event, binding)\n setTimeout(() => {\n document.addEventListener('click', el[CTX_CLICK_OUTSIDE_HANDLER])\n }, 0)\n },\n \n unmounted(el: HTMLElement) {\n if (el[CTX_CLICK_OUTSIDE_HANDLER]) {\n document.removeEventListener('click', el[CTX_CLICK_OUTSIDE_HANDLER])\n delete el[CTX_CLICK_OUTSIDE_HANDLER]\n }\n },\n}\n\nexport default ClickOutsideDirective","import { App } from 'vue'\n\nimport Contextmenu from './contextmenu'\nimport ClickOutside from './clickOutside'\n\nexport default {\n install(app: App) {\n app.directive('contextmenu', Contextmenu)\n app.directive('click-outside', ClickOutside)\n }\n}\n","import { createApp } from 'vue'\nimport { createPinia } from 'pinia'\nimport App from './App.vue'\nimport './registerServiceWorker'\n\nimport '@icon-park/vue-next/styles/index.css'\nimport 'prosemirror-view/style/prosemirror.css'\nimport 'animate.css'\n\nimport '@/assets/styles/prosemirror.scss'\nimport '@/assets/styles/global.scss'\nimport '@/assets/styles/antd.scss'\nimport '@/assets/styles/font.scss'\n\nimport Icon from '@/plugins/icon'\nimport Component from '@/plugins/component'\nimport Directive from '@/plugins/directive'\n\nimport {\n InputNumber,\n Divider,\n Button,\n Tooltip,\n Popover,\n Slider,\n Select,\n Switch,\n Radio,\n Input,\n Modal,\n Dropdown,\n Menu,\n Checkbox,\n Drawer,\n Spin,\n} from 'ant-design-vue'\n\nconst app = createApp(App)\n\napp.component('InputNumber', InputNumber)\napp.component('Divider', Divider)\napp.component('Button', Button)\napp.component('ButtonGroup', Button.Group)\napp.component('Tooltip', Tooltip)\napp.component('Popover', Popover)\napp.component('Slider', Slider)\napp.component('Select', Select)\napp.component('SelectOption', Select.Option)\napp.component('SelectOptGroup', Select.OptGroup)\napp.component('Switch', Switch)\napp.component('Radio', Radio)\napp.component('RadioGroup', Radio.Group)\napp.component('RadioButton', Radio.Button)\napp.component('Input', Input)\napp.component('InputGroup', Input.Group)\napp.component('TextArea', Input.TextArea)\napp.component('Modal', Modal)\napp.component('Dropdown', Dropdown)\napp.component('Menu', Menu)\napp.component('MenuItem', Menu.Item)\napp.component('Checkbox', Checkbox)\napp.component('Drawer', Drawer)\napp.component('Spin', Spin)\n\napp.use(Icon)\napp.use(Component)\napp.use(Directive)\n\napp.use(createPinia())\napp.mount('#app')\n","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=5303bd17&lang=scss&scoped=true\"","export * from \"-!../../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=769d6876&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ScreenElement.vue?vue&type=style&index=0&id=a15cc1d8&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=27793fbf&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./LineStylePanel.vue?vue&type=style&index=0&id=938968a2&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=153c0b44&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=1f8f1a8b&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./TableStylePanel.vue?vue&type=style&index=0&id=7e28e1d8&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./MobileOperate.vue?vue&type=style&index=0&id=7fdc6c04&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./MobileThumbnails.vue?vue&type=style&index=0&id=4a0c7aa7&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ShapeStylePanel.vue?vue&type=style&index=0&id=02998580&lang=scss&scoped=true\"","export * from \"-!../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./FileInput.vue?vue&type=style&index=0&id=4727b7ff&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ExportImage.vue?vue&type=style&index=0&id=60a953a0&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./MobilePreview.vue?vue&type=style&index=0&id=836e1638&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./BaseImageElement.vue?vue&type=style&index=0&id=66f2009f&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./SlideToolbar.vue?vue&type=style&index=0&id=5c24a24d&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./Alpha.vue?vue&type=style&index=0&id=246b525c&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./FormulaContent.vue?vue&type=style&index=0&id=1c41d9fe&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=1db12f3f&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ExportJSON.vue?vue&type=style&index=0&id=1bc24666&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=82b674f6&lang=scss&scoped=true\"","export * from \"-!../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./index.vue?vue&type=style&index=0&id=c46eb110&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ElementOutline.vue?vue&type=style&index=0&id=e91e3764&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./Chart.vue?vue&type=style&index=1&id=1aa2357d&lang=scss\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./LineElementOperate.vue?vue&type=style&index=0&id=4659f395&lang=scss&scoped=true\"","export * from \"-!../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./BaseLineElement.vue?vue&type=style&index=0&id=340cdee8&lang=scss&scoped=true\"","export * from \"-!../../../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ImageRectOutline.vue?vue&type=style&index=0&id=b5bace06&lang=scss&scoped=true\"","export * from \"-!../../../../node_modules/mini-css-extract-plugin/dist/loader.js??ref--9-oneOf-1-0!../../../../node_modules/css-loader/dist/cjs.js??ref--9-oneOf-1-1!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/stylePostLoader.js!../../../../node_modules/postcss-loader/src/index.js??ref--9-oneOf-1-2!../../../../node_modules/sass-loader/dist/cjs.js??ref--9-oneOf-1-3!../../../../node_modules/cache-loader/dist/cjs.js??ref--1-0!../../../../node_modules/@vue/cli-service/node_modules/vue-loader-v16/dist/index.js??ref--1-1!./ExportPPTX.vue?vue&type=style&index=0&id=3fef9be0&lang=scss&scoped=true\""],"sourceRoot":""} \ No newline at end of file