@glodon-aiot/react-components 3.11.0-snapshot.1765331449 → 3.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,7 +48,7 @@ const Be = (o) => {
48
48
  fileName: r,
49
49
  className: x,
50
50
  style: p,
51
- showToolbar: g = !0,
51
+ showToolbar: g = !1,
52
52
  page: C = 1
53
53
  } = o, a = b(() => {
54
54
  const s = A(e), n = r ? A(r) : void 0;
package/dist/es/index.mjs CHANGED
@@ -1,4 +1,4 @@
1
- (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.appendChild(document.createTextNode('.copy-btn{font-size:16px;cursor:pointer}.copy-btn:hover{color:#b452ff}.g-expandable-pannel-wrap{inset:0;z-index:999}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar{position:absolute;right:0;top:0;background-color:#222836;z-index:9999}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar.collapsed{position:absolute;top:0;right:0;z-index:9;width:40px;height:40px;display:flex;align-items:center;justify-content:center}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar.expaned{padding:0}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar.expaned .g-icon-btn{background-color:#0000}.g-expandable-pannel-wrap .g-expandable-pannel{width:100%;height:100%;border:.5px solid #313A4D}.g-expandable-pannel-wrap .g-expandable-pannel-header{position:absolute;right:0;top:0;z-index:9;padding-right:28px;height:28px;display:flex;flex-direction:row-reverse}.g-expandable-pannel-wrap .g-expandable-pannel-body{opacity:.85;width:100%;height:100%}.g-expandable-pannel-wrap .g-expandable-pannel-body .icon{width:16px;height:16px}.g-expandable-pannel-wrap .g-expandable-pannel.full{width:100%!important;height:100%!important;inset:0 55px;z-index:9}.g-expandable-pannel-wrap .g-expandable-pannel.hidden{inset:0 -20000px}.g-expandable-pannel-wrap .g-expandable-pannel.hidden+.bar-btn{position:absolute;right:0!important;background:rgba(58,63,76,.5);border-radius:20px 0 0 20px}.g-expandable-pannel-wrap .g-expandable-pannel.normal{height:250px;overflow:hidden;padding:0}.g-expandable-pannel-wrap .g-expandable-pannel.full+.bar-btn{top:0;right:55px;z-index:99}.g-expandable-pannel-wrap .g-expandable-pannel.full~.cover{display:block;position:absolute;width:100vw;height:100vh;top:0;left:0;background:#00000066}.g-expandable-pannel-wrap .g-expandable-pannel.hiddern~.cover{display:none}.g-expandable-pannel-wrap .g-expandable-pannel .minimap-menu-pannel{width:134px;background:#ffffff;border:1px solid #ececec;box-shadow:2px 2px 6px #c0c0c040;border-radius:4px;padding:6px 12px}.g-expandable-pannel-wrap .g-expandable-pannel .minimap-menu-pannel .item-row{width:100%;display:flex;height:32px;align-items:center}.g-expandable-pannel-wrap .g-expandable-pannel .minimap-menu-pannel .item-row img{width:16px;height:16px;margin:0 8px}.g-expandable-pannel-wrap .g-expandable-pannel .status{display:block}.g-expandable-pannel-wrap .g-expandable-pannel .status.success:before{display:inline-block;content:"";width:12px;height:12px;background-color:#52c41a}.g-expandable-pannel-wrap .g-expandable-pannel .status.error:before{display:inline-block;content:"";width:12px;height:12px;background-color:#ff4d4f}.g-expandable-pannel-wrap .g-expandable-pannel .pass-confirm-wrap{position:absolute}.document-viewer{width:100%;height:100%;min-height:200px;display:flex;flex-direction:column;overflow:hidden;position:relative;gap:8px}.document-viewer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;border:1px solid #f0f0f0;background:#fafafa;border-radius:4px;flex-shrink:0}.document-viewer-toolbar-meta{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.document-viewer-toolbar-name{font-weight:500;color:#1f1f1f;max-width:420px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.document-viewer-toolbar-size{font-size:12px;color:#666;flex-shrink:0}.document-viewer-body{flex:1;min-height:0;display:flex}.document-viewer-loading{display:flex;justify-content:center;align-items:center;min-height:200px;flex:1}.document-viewer-text,.document-viewer-json,.document-viewer-xml{padding:16px;background:#f5f5f5;border-radius:4px;overflow:auto;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,source-code-pro,monospace;font-size:14px;line-height:1.6;white-space:pre-wrap;word-wrap:break-word;flex:1;min-height:0}.document-viewer-json{background:#f9f9f9}.document-viewer-xml{background:#fff8e1}.document-viewer-jsonl{padding:16px;overflow:auto;flex:1;min-height:0;width:100%;display:flex;flex-direction:column}.document-viewer-jsonl-item{margin-bottom:16px;padding:12px;background:#f9f9f9;border-radius:4px;border-left:3px solid #1890ff;width:100%;box-sizing:border-box;max-width:100%}.document-viewer-jsonl-item:last-child{margin-bottom:0}.document-viewer-jsonl-item pre{margin:0;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,source-code-pro,monospace;font-size:13px;line-height:1.6;white-space:pre-wrap;word-wrap:break-word;width:100%;max-width:100%;box-sizing:border-box}.document-viewer-code{border-radius:4px;overflow:auto;max-height:100%;height:100%;display:flex;flex-direction:column;width:100%}.document-viewer-code pre{margin:0!important;padding:16px!important;background:#f5f5f5!important;overflow:visible;width:100%;box-sizing:border-box}.document-viewer-code>div{overflow:auto;max-height:100%;width:100%}.document-viewer-image{display:flex;justify-content:center;align-items:center;padding:16px;min-height:200px;overflow:hidden;flex:1;min-height:0}.document-viewer-image .ant-image{max-width:100%;max-height:100%;width:100%;height:100%}.document-viewer-image .ant-image img{max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain}.document-viewer-video{display:flex;justify-content:center;align-items:center;padding:16px;min-height:200px;overflow:hidden;flex:1;min-height:0}.document-viewer-video video{max-width:100%;max-height:100%}.document-viewer-audio{padding:16px;display:flex;justify-content:center;align-items:center;min-height:100px;overflow:hidden;flex:1;min-height:0}.document-viewer-pdf,.document-viewer-office,.document-viewer-unknown,.document-viewer-zip{width:100%;height:100%;min-height:0;position:relative;flex:1;display:flex;flex-direction:column}.document-viewer-zip{display:flex;flex-direction:column;padding:16px;background:#fff;overflow:hidden}.document-viewer-zip .ant-table{font-size:12px}.document-viewer-zip .ant-table .ant-table-tbody>tr:hover>td{background-color:#f5f5f5}.document-viewer-zip .ant-table .ant-table-tbody>tr.ant-table-row-selected>td{background-color:#e6f7ff}.document-viewer-iframe{width:100%;height:100%;min-height:0;border:none;border-radius:4px;flex:1}.document-viewer-fallback{margin-top:16px}.document-viewer-alert-full{width:100%;align-self:flex-start}@media (max-width: 768px){.document-viewer-pdf,.document-viewer-office,.document-viewer-unknown,.document-viewer-iframe{min-height:0}}.g-icon-btn{height:28px;width:28px;line-height:28px;background-color:#222836;color:#b8c1d0;cursor:pointer;text-align:center;padding:0;border:none;font-size:16px;display:block}.g-icon-btn:hover{color:#fff;background:linear-gradient(180deg,#4e5b73 0%,#222836 100%);border-image:linear-gradient(180deg,#4e5b73 0%,#222836 100%),linear-gradient(180deg,#ffffff 16.67%,#d2d2d2 49.48%,#000000 73.44%,#e4e4e4 92.71%)}.g-icon-btn:disabled{color:#68707e;cursor:not-allowed;background:linear-gradient(180deg,#0a111d 0%,#222836 100%)}.image-map{position:relative;width:100%;height:100%;overflow:hidden;user-select:none;display:flex;justify-content:center}.image-map .image-map-pannel{width:100%;height:100%;user-select:none;display:flex;justify-content:center;align-items:center}.image-map .image-map-toolbar{position:absolute;width:auto;height:auto;bottom:12px;z-index:99;display:flex;align-items:center;gap:12px;background-color:#393939;padding:10px;border-radius:6px}.image-map .image-map-toolbar .zoom-controller{display:flex;height:100%;align-items:center;gap:12px;color:#fff}.image-map .image-map-toolbar .zoom-controller .g-icon-btn,.image-map .image-map-toolbar .zoom-controller .g-icon-btn button{background-color:unset;font-size:16px;border:.5px solid #6f6f6f;border-radius:2px;font-size:14px}.image-map .image-map-toolbar .zoom-controller .g-icon-btn .anticon,.image-map .image-map-toolbar .zoom-controller .g-icon-btn button .anticon{font-size:14px}.image-map .image-map-toolbar .zoom-controller.vertical{flex-direction:column}.image-map .image-map-toolbar .zoom-controller.vertical .g-icon-btn{background-color:red;margin-top:6px;border:none}.image-map .image-map-toolbar .zoom-controller.vertical .g-icon-btn .anticon{font-size:16px}.image-map .image-map-toolbar .zoom-controller.horizontal{flex-direction:row}.image-map .image-map-toolbar .line{width:1px;height:12px;border:.5px solid #e0e0e0}.image-map .image-map-toolbar .moveable-controller{background-color:unset;height:100%;border:.5px solid #6f6f6f;border-radius:2px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn{position:relative;border:none;border-radius:2px;background-color:unset;padding:0;display:flex;height:100%}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn .btn-change{display:flex;align-items:center;color:#fff;gap:10px;height:100%;margin-inline-end:unset;padding:4px 8px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn .btn-change svg{font-size:16px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn .anticon{font-size:24px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn.active{color:#fff}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn:hover{background:linear-gradient(180deg,#4e5b73 0%,#222836 100%)}.image-map .image-map-toolbar .editing-controller{display:flex;gap:12px;align-items:center;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left}.image-map .image-map-toolbar .editing-controller .ant-btn-default{border:.5px solid #6f6f6f;border-radius:2px;background-color:unset;color:#fff;padding:4px 8px}.image-map .image-map-toolbar .editing-controller .ant-btn-default:hover{background:linear-gradient(180deg,#4e5b73 0%,#222836 100%)}.image-map .image-map-toolbar .editing-controller .ant-btn-primary{border-radius:2px;background-color:#0532a6;border:.5px solid #6f6f6f;color:#fff;padding:4px 8px}.image-map .image-map-toolbar .editing-controller .ant-btn-primary:hover{background:#0949d2}.image-map .image-map-toolbar .editing-controller .ant-btn-primary .save-detail{display:flex;align-items:center;color:#fff;gap:10px;height:100%}.image-map .image-map-toolbar .editing-controller .ant-btn-primary .save-detail svg{font-size:16px}.pass-map{background:transparent}.pass-map .pass-area{position:absolute;background:rgba(255,77,79,.21);border:1px solid #00000000;z-index:1}.pass-map .pass-area-circle{border-radius:50%}.pass-map .pass-area__active{background:rgba(255,77,79,.25);border:1px solid #ff4d4f}.g-mouse-tip{display:inline-flex;justify-content:center;align-items:center;gap:4px;box-shadow:0 1px 10px #0000000d,0 4px 5px #00000014,0 2px 4px -1px #0000001f;border-radius:4px;background:#000;position:fixed;z-index:2000;padding:8px 12px}.g-mouse-tip-content{font-size:12px;font-style:normal;font-weight:400;color:#fff}.track-map{z-index:10;position:relative}.track-map .point{cursor:pointer}.track-map .bottom-action{position:fixed;left:50%;bottom:10px;transform:translate(-50%);z-index:1000;display:flex;justify-content:center;align-items:flex-end;padding-bottom:12px}.track-map .bottom-action .bottom-pannel{background:white;height:48px;background:rgba(255,255,255,.9);border:1px solid #f8f8f8;box-shadow:2px 2px 4px #c0c0c040;border-radius:4px;padding:0 12px}:where(.css-ed5zg0)[class^=ant-popconfirm],:where(.css-ed5zg0)[class*=" ant-popconfirm"]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-size:14px;box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popconfirm]:before,:where(.css-ed5zg0)[class*=" ant-popconfirm"]:before,:where(.css-ed5zg0)[class^=ant-popconfirm]:after,:where(.css-ed5zg0)[class*=" ant-popconfirm"]:after{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popconfirm] [class^=ant-popconfirm],:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class^=ant-popconfirm],:where(.css-ed5zg0)[class^=ant-popconfirm] [class*=" ant-popconfirm"],:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class*=" ant-popconfirm"]{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popconfirm] [class^=ant-popconfirm]:before,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class^=ant-popconfirm]:before,:where(.css-ed5zg0)[class^=ant-popconfirm] [class*=" ant-popconfirm"]:before,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class*=" ant-popconfirm"]:before,:where(.css-ed5zg0)[class^=ant-popconfirm] [class^=ant-popconfirm]:after,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class^=ant-popconfirm]:after,:where(.css-ed5zg0)[class^=ant-popconfirm] [class*=" ant-popconfirm"]:after,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class*=" ant-popconfirm"]:after{box-sizing:border-box}:where(.css-ed5zg0).ant-popconfirm{z-index:1060}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-inner-content{color:#000000e0}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message{position:relative;margin-bottom:8px;color:#000000e0;font-size:14px;display:flex;flex-wrap:nowrap;align-items:start}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message>.ant-popconfirm-message-icon .anticon{color:#faad14;font-size:14px;flex:none;line-height:1;padding-top:4px}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message-title{flex:auto;margin-inline-start:8px}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message-title-only{font-weight:600}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-description{position:relative;margin-inline-start:22px;margin-bottom:8px;color:#000000e0;font-size:14px}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-buttons{text-align:end}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-buttons button{margin-inline-start:8px}:where(.css-ed5zg0)[class^=ant-popover],:where(.css-ed5zg0)[class*=" ant-popover"]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-size:14px;box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popover]:before,:where(.css-ed5zg0)[class*=" ant-popover"]:before,:where(.css-ed5zg0)[class^=ant-popover]:after,:where(.css-ed5zg0)[class*=" ant-popover"]:after{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popover] [class^=ant-popover],:where(.css-ed5zg0)[class*=" ant-popover"] [class^=ant-popover],:where(.css-ed5zg0)[class^=ant-popover] [class*=" ant-popover"],:where(.css-ed5zg0)[class*=" ant-popover"] [class*=" ant-popover"]{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popover] [class^=ant-popover]:before,:where(.css-ed5zg0)[class*=" ant-popover"] [class^=ant-popover]:before,:where(.css-ed5zg0)[class^=ant-popover] [class*=" ant-popover"]:before,:where(.css-ed5zg0)[class*=" ant-popover"] [class*=" ant-popover"]:before,:where(.css-ed5zg0)[class^=ant-popover] [class^=ant-popover]:after,:where(.css-ed5zg0)[class*=" ant-popover"] [class^=ant-popover]:after,:where(.css-ed5zg0)[class^=ant-popover] [class*=" ant-popover"]:after,:where(.css-ed5zg0)[class*=" ant-popover"] [class*=" ant-popover"]:after{box-sizing:border-box}:where(.css-ed5zg0).ant-popover{box-sizing:border-box;margin:0;padding:0;color:#000000e0;font-size:14px;line-height:1.57142857;list-style:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";position:absolute;top:0;left:0;z-index:1030;font-weight:400;white-space:normal;text-align:start;cursor:auto;user-select:text;--antd-arrow-background-color: #ffffff}:where(.css-ed5zg0).ant-popover-rtl{direction:rtl}:where(.css-ed5zg0).ant-popover-hidden{display:none}:where(.css-ed5zg0).ant-popover .ant-popover-content{position:relative}:where(.css-ed5zg0).ant-popover .ant-popover-inner{background-color:#fff;background-clip:padding-box;border-radius:8px;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;padding:12px}:where(.css-ed5zg0).ant-popover .ant-popover-title{min-width:177px;margin-bottom:8px;color:#000000e0;font-weight:600}:where(.css-ed5zg0).ant-popover .ant-popover-inner-content{color:#000000e0;padding:0}:where(.css-ed5zg0).ant-popover .ant-popover-arrow{position:absolute;z-index:1;display:block;pointer-events:none;width:16px;height:16px;overflow:hidden;border:0}:where(.css-ed5zg0).ant-popover .ant-popover-arrow:before{position:absolute;bottom:0;inset-inline-start:0;width:16px;height:8px;background:var(--antd-arrow-background-color);clip-path:polygon(1.65685425px 100%,50% 1.65685425px,14.34314575px 100%,1.65685425px 100%);clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:""}:where(.css-ed5zg0).ant-popover .ant-popover-arrow:after{content:"";position:absolute;width:8.97056275px;height:8.97056275px;bottom:0;inset-inline:0;margin:auto;border-radius:0 0 2px;transform:translateY(50%) rotate(-135deg);box-shadow:2px 2px 5px #0000000d;z-index:0;background:transparent}:where(.css-ed5zg0).ant-popover .ant-popover-arrow:before{background:var(--antd-arrow-background-color)}:where(.css-ed5zg0).ant-popover-placement-top .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-topLeft .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-topRight .ant-popover-arrow{bottom:0;transform:translateY(100%) rotate(180deg)}:where(.css-ed5zg0).ant-popover-placement-top .ant-popover-arrow{left:50%;transform:translate(-50%) translateY(100%) rotate(180deg)}:where(.css-ed5zg0).ant-popover-placement-topLeft .ant-popover-arrow{left:12px}:where(.css-ed5zg0).ant-popover-placement-topRight .ant-popover-arrow{right:12px}:where(.css-ed5zg0).ant-popover-placement-bottom .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-bottomLeft .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-bottomRight .ant-popover-arrow{top:0;transform:translateY(-100%)}:where(.css-ed5zg0).ant-popover-placement-bottom .ant-popover-arrow{left:50%;transform:translate(-50%) translateY(-100%)}:where(.css-ed5zg0).ant-popover-placement-bottomLeft .ant-popover-arrow{left:12px}:where(.css-ed5zg0).ant-popover-placement-bottomRight .ant-popover-arrow{right:12px}:where(.css-ed5zg0).ant-popover-placement-left .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-leftTop .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-leftBottom .ant-popover-arrow{right:0;transform:translate(100%) rotate(90deg)}:where(.css-ed5zg0).ant-popover-placement-left .ant-popover-arrow{top:50%;transform:translateY(-50%) translate(100%) rotate(90deg)}:where(.css-ed5zg0).ant-popover-placement-leftTop .ant-popover-arrow{top:12px}:where(.css-ed5zg0).ant-popover-placement-leftBottom .ant-popover-arrow{bottom:12px}:where(.css-ed5zg0).ant-popover-placement-right .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-rightTop .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-rightBottom .ant-popover-arrow{left:0;transform:translate(-100%) rotate(-90deg)}:where(.css-ed5zg0).ant-popover-placement-right .ant-popover-arrow{top:50%;transform:translateY(-50%) translate(-100%) rotate(-90deg)}:where(.css-ed5zg0).ant-popover-placement-rightTop .ant-popover-arrow{top:12px}:where(.css-ed5zg0).ant-popover-placement-rightBottom .ant-popover-arrow{bottom:12px}:where(.css-ed5zg0).ant-popover-pure{position:relative;max-width:none;margin:16px;display:inline-block}:where(.css-ed5zg0).ant-popover-pure .ant-popover-content{display:inline-block}:where(.css-ed5zg0).ant-popover.ant-popover-blue{--antd-arrow-background-color: #1677ff}:where(.css-ed5zg0).ant-popover.ant-popover-blue .ant-popover-inner{background-color:#1677ff}:where(.css-ed5zg0).ant-popover.ant-popover-blue .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-purple{--antd-arrow-background-color: #722ed1}:where(.css-ed5zg0).ant-popover.ant-popover-purple .ant-popover-inner{background-color:#722ed1}:where(.css-ed5zg0).ant-popover.ant-popover-purple .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-cyan{--antd-arrow-background-color: #13c2c2}:where(.css-ed5zg0).ant-popover.ant-popover-cyan .ant-popover-inner{background-color:#13c2c2}:where(.css-ed5zg0).ant-popover.ant-popover-cyan .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-green{--antd-arrow-background-color: #52c41a}:where(.css-ed5zg0).ant-popover.ant-popover-green .ant-popover-inner{background-color:#52c41a}:where(.css-ed5zg0).ant-popover.ant-popover-green .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-magenta{--antd-arrow-background-color: #eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-magenta .ant-popover-inner{background-color:#eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-magenta .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-pink{--antd-arrow-background-color: #eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-pink .ant-popover-inner{background-color:#eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-pink .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-red{--antd-arrow-background-color: #f5222d}:where(.css-ed5zg0).ant-popover.ant-popover-red .ant-popover-inner{background-color:#f5222d}:where(.css-ed5zg0).ant-popover.ant-popover-red .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-orange{--antd-arrow-background-color: #fa8c16}:where(.css-ed5zg0).ant-popover.ant-popover-orange .ant-popover-inner{background-color:#fa8c16}:where(.css-ed5zg0).ant-popover.ant-popover-orange .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-yellow{--antd-arrow-background-color: #fadb14}:where(.css-ed5zg0).ant-popover.ant-popover-yellow .ant-popover-inner{background-color:#fadb14}:where(.css-ed5zg0).ant-popover.ant-popover-yellow .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-volcano{--antd-arrow-background-color: #fa541c}:where(.css-ed5zg0).ant-popover.ant-popover-volcano .ant-popover-inner{background-color:#fa541c}:where(.css-ed5zg0).ant-popover.ant-popover-volcano .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-geekblue{--antd-arrow-background-color: #2f54eb}:where(.css-ed5zg0).ant-popover.ant-popover-geekblue .ant-popover-inner{background-color:#2f54eb}:where(.css-ed5zg0).ant-popover.ant-popover-geekblue .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-lime{--antd-arrow-background-color: #a0d911}:where(.css-ed5zg0).ant-popover.ant-popover-lime .ant-popover-inner{background-color:#a0d911}:where(.css-ed5zg0).ant-popover.ant-popover-lime .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-gold{--antd-arrow-background-color: #faad14}:where(.css-ed5zg0).ant-popover.ant-popover-gold .ant-popover-inner{background-color:#faad14}:where(.css-ed5zg0).ant-popover.ant-popover-gold .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-zoom-big-enter,:where(.css-ed5zg0).ant-zoom-big-appear{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}:where(.css-ed5zg0).ant-zoom-big-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}:where(.css-ed5zg0).ant-zoom-big-enter.ant-zoom-big-enter-active,:where(.css-ed5zg0).ant-zoom-big-appear.ant-zoom-big-appear-active{animation-name:css-ed5zg0-antZoomBigIn;animation-play-state:running}:where(.css-ed5zg0).ant-zoom-big-leave.ant-zoom-big-leave-active{animation-name:css-ed5zg0-antZoomBigOut;animation-play-state:running;pointer-events:none}:where(.css-ed5zg0).ant-zoom-big-enter,:where(.css-ed5zg0).ant-zoom-big-appear{transform:scale(0);opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}:where(.css-ed5zg0).ant-zoom-big-enter-prepare,:where(.css-ed5zg0).ant-zoom-big-appear-prepare{transform:none}:where(.css-ed5zg0).ant-zoom-big-leave{animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.track-map .tooltip-container{pointer-events:none!important}.track-map .tooltip-container>*{pointer-events:initial}.g-expandable-pannel-wrap.collapsed .tooltip-container{display:none}.g-rc-tooltip{position:absolute!important}.g-rc-tooltip .g-rc-tooltip-arrow{height:10px}.storybook-button{font-family:Nunito Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:700;border:0;border-radius:3em;cursor:pointer;display:inline-block;line-height:1}.storybook-button--primary{color:#fff;background-color:#027bf4}.storybook-button--secondary{color:#333;background-color:transparent;box-shadow:#00000026 0 0 0 1px inset}.storybook-button--small{font-size:12px;padding:10px 16px}.storybook-button--medium{font-size:14px;padding:11px 20px}.storybook-button--large{font-size:16px;padding:12px 24px}.markdown{word-break:break-all}.markdown :last-child{margin-bottom:0}.markdown div,.markdown hr,.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5,.markdown h6,.markdown p,.markdown table,.markdown code,.markdown img,.markdown address,.markdown blockquote,.markdown dir,.markdown menu,.markdown pre,.markdown ul,.markdown ol,.markdown li,.markdown dl{margin-bottom:12px;line-height:150%;white-space:pre-wrap}.markdown div:last-child,.markdown hr:last-child,.markdown h1:last-child,.markdown h2:last-child,.markdown h3:last-child,.markdown h4:last-child,.markdown h5:last-child,.markdown h6:last-child,.markdown p:last-child,.markdown table:last-child,.markdown code:last-child,.markdown img:last-child,.markdown address:last-child,.markdown blockquote:last-child,.markdown dir:last-child,.markdown menu:last-child,.markdown pre:last-child,.markdown ul:last-child,.markdown ol:last-child,.markdown li:last-child,.markdown dl:last-child{margin-bottom:0}.markdown ul,.markdown ol{padding-inline-start:20px}.markdown ul{list-style-type:disc}.markdown ol{list-style-type:decimal}.markdown ul,.markdown li{white-space:normal;margin-bottom:8px}.markdown table{display:block;border-collapse:collapse;border-radius:4px;max-width:100%;overflow:auto;width:max-content}.markdown td,.markdown th{border:1px solid #e8e9eb;padding:6px 13px;text-align:left}.markdown tr{color:#151b26;background-color:#fff}.markdown th{background-color:#f9f2ff;color:#000}.markdown tr:hover td{background-color:#fff}.markdown p code{background:#f9f2ff;border-radius:4px;padding:4px;display:inline;font-size:12px;color:#070c14}.markdown .markdown-code-title{margin:0;padding:0 16px;height:36px;border-radius:8px 8px 0 0;background:#f9f2ff;display:flex;align-items:center;justify-content:space-between;line-height:21px;font-weight:500;color:#070c14}.markdown .markdown-code-context{padding:16px;background:rgba(249,242,255,.3)!important;margin:0!important;border-radius:0 0 8px 8px}.markdown .markdown-code-context code{margin:0;font-size:85%;background:none;font-size:14px}.markdown .markdown-code-context code>span{flex-wrap:wrap}.markdown p{white-space:pre-line}.markdown pre code.hljs{display:block;overflow-x:auto;padding:1em}.markdown p{line-height:150%;height:auto!important}.markdown img{max-width:100%}.markdown a,.markdown a:hover{color:#0f64ff}.markdown code.hljs{padding:3px 5px}.markdown .hljs{background:rgba(249,242,255,.3);color:#000}.markdown .hljs-comment{color:#697070}.markdown .hljs-tag,.markdown .hljs-punctuation{color:#000a}.markdown .hljs-tag .hljs-name,.markdown .hljs-tag .hljs-attr{color:#000}.markdown .hljs-keyword,.markdown .hljs-attribute,.markdown .hljs-selector-tag,.markdown .hljs-meta .hljs-keyword,.markdown .hljs-doctag,.markdown .hljs-name{font-weight:700}.markdown .hljs-type,.markdown .hljs-string,.markdown .hljs-number,.markdown .hljs-selector-id,.markdown .hljs-selector-class,.markdown .hljs-quote,.markdown .hljs-template-tag,.markdown .hljs-deletion{color:#800}.markdown .hljs-title,.markdown .hljs-section{color:#800;font-weight:700}.markdown .hljs-regexp,.markdown .hljs-symbol,.markdown .hljs-variable,.markdown .hljs-template-variable,.markdown .hljs-link,.markdown .hljs-selector-attr,.markdown .hljs-operator,.markdown .hljs-selector-pseudo{color:#ab5656}.markdown .hljs-literal{color:#695}.markdown .hljs-built_in,.markdown .hljs-bullet,.markdown .hljs-code,.markdown .hljs-addition{color:#397300}.markdown .hljs-meta{color:#1f7199}.markdown .hljs-meta .hljs-string{color:#38a}.markdown .hljs-emphasis{font-style:italic}.markdown .hljs-strong{font-weight:700}.markdown .ant-image{margin-bottom:6px!important}.markdown .ant-image .ant-image-img{margin-bottom:0!important}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
1
+ (function(){"use strict";try{if(typeof document!="undefined"){var e=document.createElement("style");e.appendChild(document.createTextNode('.storybook-button{font-family:Nunito Sans,Helvetica Neue,Helvetica,Arial,sans-serif;font-weight:700;border:0;border-radius:3em;cursor:pointer;display:inline-block;line-height:1}.storybook-button--primary{color:#fff;background-color:#027bf4}.storybook-button--secondary{color:#333;background-color:transparent;box-shadow:#00000026 0 0 0 1px inset}.storybook-button--small{font-size:12px;padding:10px 16px}.storybook-button--medium{font-size:14px;padding:11px 20px}.storybook-button--large{font-size:16px;padding:12px 24px}.markdown{word-break:break-all}.markdown :last-child{margin-bottom:0}.markdown div,.markdown hr,.markdown h1,.markdown h2,.markdown h3,.markdown h4,.markdown h5,.markdown h6,.markdown p,.markdown table,.markdown code,.markdown img,.markdown address,.markdown blockquote,.markdown dir,.markdown menu,.markdown pre,.markdown ul,.markdown ol,.markdown li,.markdown dl{margin-bottom:12px;line-height:150%;white-space:pre-wrap}.markdown div:last-child,.markdown hr:last-child,.markdown h1:last-child,.markdown h2:last-child,.markdown h3:last-child,.markdown h4:last-child,.markdown h5:last-child,.markdown h6:last-child,.markdown p:last-child,.markdown table:last-child,.markdown code:last-child,.markdown img:last-child,.markdown address:last-child,.markdown blockquote:last-child,.markdown dir:last-child,.markdown menu:last-child,.markdown pre:last-child,.markdown ul:last-child,.markdown ol:last-child,.markdown li:last-child,.markdown dl:last-child{margin-bottom:0}.markdown ul,.markdown ol{padding-inline-start:20px}.markdown ul{list-style-type:disc}.markdown ol{list-style-type:decimal}.markdown ul,.markdown li{white-space:normal;margin-bottom:8px}.markdown table{display:block;border-collapse:collapse;border-radius:4px;max-width:100%;overflow:auto;width:max-content}.markdown td,.markdown th{border:1px solid #e8e9eb;padding:6px 13px;text-align:left}.markdown tr{color:#151b26;background-color:#fff}.markdown th{background-color:#f9f2ff;color:#000}.markdown tr:hover td{background-color:#fff}.markdown p code{background:#f9f2ff;border-radius:4px;padding:4px;display:inline;font-size:12px;color:#070c14}.markdown .markdown-code-title{margin:0;padding:0 16px;height:36px;border-radius:8px 8px 0 0;background:#f9f2ff;display:flex;align-items:center;justify-content:space-between;line-height:21px;font-weight:500;color:#070c14}.markdown .markdown-code-context{padding:16px;background:rgba(249,242,255,.3)!important;margin:0!important;border-radius:0 0 8px 8px}.markdown .markdown-code-context code{margin:0;font-size:85%;background:none;font-size:14px}.markdown .markdown-code-context code>span{flex-wrap:wrap}.markdown p{white-space:pre-line}.markdown pre code.hljs{display:block;overflow-x:auto;padding:1em}.markdown p{line-height:150%;height:auto!important}.markdown img{max-width:100%}.markdown a,.markdown a:hover{color:#0f64ff}.markdown code.hljs{padding:3px 5px}.markdown .hljs{background:rgba(249,242,255,.3);color:#000}.markdown .hljs-comment{color:#697070}.markdown .hljs-tag,.markdown .hljs-punctuation{color:#000a}.markdown .hljs-tag .hljs-name,.markdown .hljs-tag .hljs-attr{color:#000}.markdown .hljs-keyword,.markdown .hljs-attribute,.markdown .hljs-selector-tag,.markdown .hljs-meta .hljs-keyword,.markdown .hljs-doctag,.markdown .hljs-name{font-weight:700}.markdown .hljs-type,.markdown .hljs-string,.markdown .hljs-number,.markdown .hljs-selector-id,.markdown .hljs-selector-class,.markdown .hljs-quote,.markdown .hljs-template-tag,.markdown .hljs-deletion{color:#800}.markdown .hljs-title,.markdown .hljs-section{color:#800;font-weight:700}.markdown .hljs-regexp,.markdown .hljs-symbol,.markdown .hljs-variable,.markdown .hljs-template-variable,.markdown .hljs-link,.markdown .hljs-selector-attr,.markdown .hljs-operator,.markdown .hljs-selector-pseudo{color:#ab5656}.markdown .hljs-literal{color:#695}.markdown .hljs-built_in,.markdown .hljs-bullet,.markdown .hljs-code,.markdown .hljs-addition{color:#397300}.markdown .hljs-meta{color:#1f7199}.markdown .hljs-meta .hljs-string{color:#38a}.markdown .hljs-emphasis{font-style:italic}.markdown .hljs-strong{font-weight:700}.markdown .ant-image{margin-bottom:6px!important}.markdown .ant-image .ant-image-img{margin-bottom:0!important}.g-expandable-pannel-wrap{inset:0;z-index:999}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar{position:absolute;right:0;top:0;background-color:#222836;z-index:9999}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar.collapsed{position:absolute;top:0;right:0;z-index:9;width:40px;height:40px;display:flex;align-items:center;justify-content:center}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar.expaned{padding:0}.g-expandable-pannel-wrap .g-expandable-pannel-expand-bar.expaned .g-icon-btn{background-color:#0000}.g-expandable-pannel-wrap .g-expandable-pannel{width:100%;height:100%;border:.5px solid #313A4D}.g-expandable-pannel-wrap .g-expandable-pannel-header{position:absolute;right:0;top:0;z-index:9;padding-right:28px;height:28px;display:flex;flex-direction:row-reverse}.g-expandable-pannel-wrap .g-expandable-pannel-body{opacity:.85;width:100%;height:100%}.g-expandable-pannel-wrap .g-expandable-pannel-body .icon{width:16px;height:16px}.g-expandable-pannel-wrap .g-expandable-pannel.full{width:100%!important;height:100%!important;inset:0 55px;z-index:9}.g-expandable-pannel-wrap .g-expandable-pannel.hidden{inset:0 -20000px}.g-expandable-pannel-wrap .g-expandable-pannel.hidden+.bar-btn{position:absolute;right:0!important;background:rgba(58,63,76,.5);border-radius:20px 0 0 20px}.g-expandable-pannel-wrap .g-expandable-pannel.normal{height:250px;overflow:hidden;padding:0}.g-expandable-pannel-wrap .g-expandable-pannel.full+.bar-btn{top:0;right:55px;z-index:99}.g-expandable-pannel-wrap .g-expandable-pannel.full~.cover{display:block;position:absolute;width:100vw;height:100vh;top:0;left:0;background:#00000066}.g-expandable-pannel-wrap .g-expandable-pannel.hiddern~.cover{display:none}.g-expandable-pannel-wrap .g-expandable-pannel .minimap-menu-pannel{width:134px;background:#ffffff;border:1px solid #ececec;box-shadow:2px 2px 6px #c0c0c040;border-radius:4px;padding:6px 12px}.g-expandable-pannel-wrap .g-expandable-pannel .minimap-menu-pannel .item-row{width:100%;display:flex;height:32px;align-items:center}.g-expandable-pannel-wrap .g-expandable-pannel .minimap-menu-pannel .item-row img{width:16px;height:16px;margin:0 8px}.g-expandable-pannel-wrap .g-expandable-pannel .status{display:block}.g-expandable-pannel-wrap .g-expandable-pannel .status.success:before{display:inline-block;content:"";width:12px;height:12px;background-color:#52c41a}.g-expandable-pannel-wrap .g-expandable-pannel .status.error:before{display:inline-block;content:"";width:12px;height:12px;background-color:#ff4d4f}.g-expandable-pannel-wrap .g-expandable-pannel .pass-confirm-wrap{position:absolute}.document-viewer{width:100%;height:100%;min-height:200px;display:flex;flex-direction:column;overflow:hidden;position:relative;gap:8px}.document-viewer-toolbar{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:8px 12px;border:1px solid #f0f0f0;background:#fafafa;border-radius:4px;flex-shrink:0}.document-viewer-toolbar-meta{display:flex;align-items:center;gap:8px;min-width:0;flex:1}.document-viewer-toolbar-name{font-weight:500;color:#1f1f1f;max-width:420px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.document-viewer-toolbar-size{font-size:12px;color:#666;flex-shrink:0}.document-viewer-body{flex:1;min-height:0;display:flex}.document-viewer-loading{display:flex;justify-content:center;align-items:center;min-height:200px;flex:1}.document-viewer-text,.document-viewer-json,.document-viewer-xml{padding:16px;background:#f5f5f5;border-radius:4px;overflow:auto;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,source-code-pro,monospace;font-size:14px;line-height:1.6;white-space:pre-wrap;word-wrap:break-word;flex:1;min-height:0}.document-viewer-json{background:#f9f9f9}.document-viewer-xml{background:#fff8e1}.document-viewer-jsonl{padding:16px;overflow:auto;flex:1;min-height:0;width:100%;display:flex;flex-direction:column}.document-viewer-jsonl-item{margin-bottom:16px;padding:12px;background:#f9f9f9;border-radius:4px;border-left:3px solid #1890ff;width:100%;box-sizing:border-box;max-width:100%}.document-viewer-jsonl-item:last-child{margin-bottom:0}.document-viewer-jsonl-item pre{margin:0;font-family:Monaco,Menlo,Ubuntu Mono,Consolas,source-code-pro,monospace;font-size:13px;line-height:1.6;white-space:pre-wrap;word-wrap:break-word;width:100%;max-width:100%;box-sizing:border-box}.document-viewer-code{border-radius:4px;overflow:auto;max-height:100%;height:100%;display:flex;flex-direction:column;width:100%}.document-viewer-code pre{margin:0!important;padding:16px!important;background:#f5f5f5!important;overflow:visible;width:100%;box-sizing:border-box}.document-viewer-code>div{overflow:auto;max-height:100%;width:100%}.document-viewer-image{display:flex;justify-content:center;align-items:center;padding:16px;min-height:200px;overflow:hidden;flex:1;min-height:0}.document-viewer-image .ant-image{max-width:100%;max-height:100%;width:100%;height:100%}.document-viewer-image .ant-image img{max-width:100%;max-height:100%;width:100%;height:100%;object-fit:contain}.document-viewer-video{display:flex;justify-content:center;align-items:center;padding:16px;min-height:200px;overflow:hidden;flex:1;min-height:0}.document-viewer-video video{max-width:100%;max-height:100%}.document-viewer-audio{padding:16px;display:flex;justify-content:center;align-items:center;min-height:100px;overflow:hidden;flex:1;min-height:0}.document-viewer-pdf,.document-viewer-office,.document-viewer-unknown,.document-viewer-zip{width:100%;height:100%;min-height:0;position:relative;flex:1;display:flex;flex-direction:column}.document-viewer-zip{display:flex;flex-direction:column;padding:16px;background:#fff;overflow:hidden}.document-viewer-zip .ant-table{font-size:12px}.document-viewer-zip .ant-table .ant-table-tbody>tr:hover>td{background-color:#f5f5f5}.document-viewer-zip .ant-table .ant-table-tbody>tr.ant-table-row-selected>td{background-color:#e6f7ff}.document-viewer-iframe{width:100%;height:100%;min-height:0;border:none;border-radius:4px;flex:1}.document-viewer-fallback{margin-top:16px}.document-viewer-alert-full{width:100%;align-self:flex-start}@media (max-width: 768px){.document-viewer-pdf,.document-viewer-office,.document-viewer-unknown,.document-viewer-iframe{min-height:0}}.image-map{position:relative;width:100%;height:100%;overflow:hidden;user-select:none;display:flex;justify-content:center}.image-map .image-map-pannel{width:100%;height:100%;user-select:none;display:flex;justify-content:center;align-items:center}.image-map .image-map-toolbar{position:absolute;width:auto;height:auto;bottom:12px;z-index:99;display:flex;align-items:center;gap:12px;background-color:#393939;padding:10px;border-radius:6px}.image-map .image-map-toolbar .zoom-controller{display:flex;height:100%;align-items:center;gap:12px;color:#fff}.image-map .image-map-toolbar .zoom-controller .g-icon-btn,.image-map .image-map-toolbar .zoom-controller .g-icon-btn button{background-color:unset;font-size:16px;border:.5px solid #6f6f6f;border-radius:2px;font-size:14px}.image-map .image-map-toolbar .zoom-controller .g-icon-btn .anticon,.image-map .image-map-toolbar .zoom-controller .g-icon-btn button .anticon{font-size:14px}.image-map .image-map-toolbar .zoom-controller.vertical{flex-direction:column}.image-map .image-map-toolbar .zoom-controller.vertical .g-icon-btn{background-color:red;margin-top:6px;border:none}.image-map .image-map-toolbar .zoom-controller.vertical .g-icon-btn .anticon{font-size:16px}.image-map .image-map-toolbar .zoom-controller.horizontal{flex-direction:row}.image-map .image-map-toolbar .line{width:1px;height:12px;border:.5px solid #e0e0e0}.image-map .image-map-toolbar .moveable-controller{background-color:unset;height:100%;border:.5px solid #6f6f6f;border-radius:2px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn{position:relative;border:none;border-radius:2px;background-color:unset;padding:0;display:flex;height:100%}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn .btn-change{display:flex;align-items:center;color:#fff;gap:10px;height:100%;margin-inline-end:unset;padding:4px 8px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn .btn-change svg{font-size:16px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn .anticon{font-size:24px}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn.active{color:#fff}.image-map .image-map-toolbar .moveable-controller .moveable-controller-btn:hover{background:linear-gradient(180deg,#4e5b73 0%,#222836 100%)}.image-map .image-map-toolbar .editing-controller{display:flex;gap:12px;align-items:center;font-size:14px;font-weight:400;line-height:20px;letter-spacing:0px;text-align:left}.image-map .image-map-toolbar .editing-controller .ant-btn-default{border:.5px solid #6f6f6f;border-radius:2px;background-color:unset;color:#fff;padding:4px 8px}.image-map .image-map-toolbar .editing-controller .ant-btn-default:hover{background:linear-gradient(180deg,#4e5b73 0%,#222836 100%)}.image-map .image-map-toolbar .editing-controller .ant-btn-primary{border-radius:2px;background-color:#0532a6;border:.5px solid #6f6f6f;color:#fff;padding:4px 8px}.image-map .image-map-toolbar .editing-controller .ant-btn-primary:hover{background:#0949d2}.image-map .image-map-toolbar .editing-controller .ant-btn-primary .save-detail{display:flex;align-items:center;color:#fff;gap:10px;height:100%}.image-map .image-map-toolbar .editing-controller .ant-btn-primary .save-detail svg{font-size:16px}.g-icon-btn{height:28px;width:28px;line-height:28px;background-color:#222836;color:#b8c1d0;cursor:pointer;text-align:center;padding:0;border:none;font-size:16px;display:block}.g-icon-btn:hover{color:#fff;background:linear-gradient(180deg,#4e5b73 0%,#222836 100%);border-image:linear-gradient(180deg,#4e5b73 0%,#222836 100%),linear-gradient(180deg,#ffffff 16.67%,#d2d2d2 49.48%,#000000 73.44%,#e4e4e4 92.71%)}.g-icon-btn:disabled{color:#68707e;cursor:not-allowed;background:linear-gradient(180deg,#0a111d 0%,#222836 100%)}.g-mouse-tip{display:inline-flex;justify-content:center;align-items:center;gap:4px;box-shadow:0 1px 10px #0000000d,0 4px 5px #00000014,0 2px 4px -1px #0000001f;border-radius:4px;background:#000;position:fixed;z-index:2000;padding:8px 12px}.g-mouse-tip-content{font-size:12px;font-style:normal;font-weight:400;color:#fff}.pass-map{background:transparent}.pass-map .pass-area{position:absolute;background:rgba(255,77,79,.21);border:1px solid #00000000;z-index:1}.pass-map .pass-area-circle{border-radius:50%}.pass-map .pass-area__active{background:rgba(255,77,79,.25);border:1px solid #ff4d4f}.copy-btn{font-size:16px;cursor:pointer}.copy-btn:hover{color:#b452ff}.track-map{z-index:10;position:relative}.track-map .point{cursor:pointer}.track-map .bottom-action{position:fixed;left:50%;bottom:10px;transform:translate(-50%);z-index:1000;display:flex;justify-content:center;align-items:flex-end;padding-bottom:12px}.track-map .bottom-action .bottom-pannel{background:white;height:48px;background:rgba(255,255,255,.9);border:1px solid #f8f8f8;box-shadow:2px 2px 4px #c0c0c040;border-radius:4px;padding:0 12px}:where(.css-ed5zg0)[class^=ant-popconfirm],:where(.css-ed5zg0)[class*=" ant-popconfirm"]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-size:14px;box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popconfirm]:before,:where(.css-ed5zg0)[class*=" ant-popconfirm"]:before,:where(.css-ed5zg0)[class^=ant-popconfirm]:after,:where(.css-ed5zg0)[class*=" ant-popconfirm"]:after{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popconfirm] [class^=ant-popconfirm],:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class^=ant-popconfirm],:where(.css-ed5zg0)[class^=ant-popconfirm] [class*=" ant-popconfirm"],:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class*=" ant-popconfirm"]{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popconfirm] [class^=ant-popconfirm]:before,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class^=ant-popconfirm]:before,:where(.css-ed5zg0)[class^=ant-popconfirm] [class*=" ant-popconfirm"]:before,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class*=" ant-popconfirm"]:before,:where(.css-ed5zg0)[class^=ant-popconfirm] [class^=ant-popconfirm]:after,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class^=ant-popconfirm]:after,:where(.css-ed5zg0)[class^=ant-popconfirm] [class*=" ant-popconfirm"]:after,:where(.css-ed5zg0)[class*=" ant-popconfirm"] [class*=" ant-popconfirm"]:after{box-sizing:border-box}:where(.css-ed5zg0).ant-popconfirm{z-index:1060}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-inner-content{color:#000000e0}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message{position:relative;margin-bottom:8px;color:#000000e0;font-size:14px;display:flex;flex-wrap:nowrap;align-items:start}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message>.ant-popconfirm-message-icon .anticon{color:#faad14;font-size:14px;flex:none;line-height:1;padding-top:4px}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message-title{flex:auto;margin-inline-start:8px}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-message-title-only{font-weight:600}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-description{position:relative;margin-inline-start:22px;margin-bottom:8px;color:#000000e0;font-size:14px}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-buttons{text-align:end}:where(.css-ed5zg0).ant-popconfirm .ant-popconfirm-buttons button{margin-inline-start:8px}:where(.css-ed5zg0)[class^=ant-popover],:where(.css-ed5zg0)[class*=" ant-popover"]{font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";font-size:14px;box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popover]:before,:where(.css-ed5zg0)[class*=" ant-popover"]:before,:where(.css-ed5zg0)[class^=ant-popover]:after,:where(.css-ed5zg0)[class*=" ant-popover"]:after{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popover] [class^=ant-popover],:where(.css-ed5zg0)[class*=" ant-popover"] [class^=ant-popover],:where(.css-ed5zg0)[class^=ant-popover] [class*=" ant-popover"],:where(.css-ed5zg0)[class*=" ant-popover"] [class*=" ant-popover"]{box-sizing:border-box}:where(.css-ed5zg0)[class^=ant-popover] [class^=ant-popover]:before,:where(.css-ed5zg0)[class*=" ant-popover"] [class^=ant-popover]:before,:where(.css-ed5zg0)[class^=ant-popover] [class*=" ant-popover"]:before,:where(.css-ed5zg0)[class*=" ant-popover"] [class*=" ant-popover"]:before,:where(.css-ed5zg0)[class^=ant-popover] [class^=ant-popover]:after,:where(.css-ed5zg0)[class*=" ant-popover"] [class^=ant-popover]:after,:where(.css-ed5zg0)[class^=ant-popover] [class*=" ant-popover"]:after,:where(.css-ed5zg0)[class*=" ant-popover"] [class*=" ant-popover"]:after{box-sizing:border-box}:where(.css-ed5zg0).ant-popover{box-sizing:border-box;margin:0;padding:0;color:#000000e0;font-size:14px;line-height:1.57142857;list-style:none;font-family:-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,"Apple Color Emoji","Segoe UI Emoji",Segoe UI Symbol,"Noto Color Emoji";position:absolute;top:0;left:0;z-index:1030;font-weight:400;white-space:normal;text-align:start;cursor:auto;user-select:text;--antd-arrow-background-color: #ffffff}:where(.css-ed5zg0).ant-popover-rtl{direction:rtl}:where(.css-ed5zg0).ant-popover-hidden{display:none}:where(.css-ed5zg0).ant-popover .ant-popover-content{position:relative}:where(.css-ed5zg0).ant-popover .ant-popover-inner{background-color:#fff;background-clip:padding-box;border-radius:8px;box-shadow:0 6px 16px #00000014,0 3px 6px -4px #0000001f,0 9px 28px 8px #0000000d;padding:12px}:where(.css-ed5zg0).ant-popover .ant-popover-title{min-width:177px;margin-bottom:8px;color:#000000e0;font-weight:600}:where(.css-ed5zg0).ant-popover .ant-popover-inner-content{color:#000000e0;padding:0}:where(.css-ed5zg0).ant-popover .ant-popover-arrow{position:absolute;z-index:1;display:block;pointer-events:none;width:16px;height:16px;overflow:hidden;border:0}:where(.css-ed5zg0).ant-popover .ant-popover-arrow:before{position:absolute;bottom:0;inset-inline-start:0;width:16px;height:8px;background:var(--antd-arrow-background-color);clip-path:polygon(1.65685425px 100%,50% 1.65685425px,14.34314575px 100%,1.65685425px 100%);clip-path:path("M 0 8 A 4 4 0 0 0 2.82842712474619 6.82842712474619 L 6.585786437626905 3.0710678118654755 A 2 2 0 0 1 9.414213562373096 3.0710678118654755 L 13.17157287525381 6.82842712474619 A 4 4 0 0 0 16 8 Z");content:""}:where(.css-ed5zg0).ant-popover .ant-popover-arrow:after{content:"";position:absolute;width:8.97056275px;height:8.97056275px;bottom:0;inset-inline:0;margin:auto;border-radius:0 0 2px;transform:translateY(50%) rotate(-135deg);box-shadow:2px 2px 5px #0000000d;z-index:0;background:transparent}:where(.css-ed5zg0).ant-popover .ant-popover-arrow:before{background:var(--antd-arrow-background-color)}:where(.css-ed5zg0).ant-popover-placement-top .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-topLeft .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-topRight .ant-popover-arrow{bottom:0;transform:translateY(100%) rotate(180deg)}:where(.css-ed5zg0).ant-popover-placement-top .ant-popover-arrow{left:50%;transform:translate(-50%) translateY(100%) rotate(180deg)}:where(.css-ed5zg0).ant-popover-placement-topLeft .ant-popover-arrow{left:12px}:where(.css-ed5zg0).ant-popover-placement-topRight .ant-popover-arrow{right:12px}:where(.css-ed5zg0).ant-popover-placement-bottom .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-bottomLeft .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-bottomRight .ant-popover-arrow{top:0;transform:translateY(-100%)}:where(.css-ed5zg0).ant-popover-placement-bottom .ant-popover-arrow{left:50%;transform:translate(-50%) translateY(-100%)}:where(.css-ed5zg0).ant-popover-placement-bottomLeft .ant-popover-arrow{left:12px}:where(.css-ed5zg0).ant-popover-placement-bottomRight .ant-popover-arrow{right:12px}:where(.css-ed5zg0).ant-popover-placement-left .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-leftTop .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-leftBottom .ant-popover-arrow{right:0;transform:translate(100%) rotate(90deg)}:where(.css-ed5zg0).ant-popover-placement-left .ant-popover-arrow{top:50%;transform:translateY(-50%) translate(100%) rotate(90deg)}:where(.css-ed5zg0).ant-popover-placement-leftTop .ant-popover-arrow{top:12px}:where(.css-ed5zg0).ant-popover-placement-leftBottom .ant-popover-arrow{bottom:12px}:where(.css-ed5zg0).ant-popover-placement-right .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-rightTop .ant-popover-arrow,:where(.css-ed5zg0).ant-popover-placement-rightBottom .ant-popover-arrow{left:0;transform:translate(-100%) rotate(-90deg)}:where(.css-ed5zg0).ant-popover-placement-right .ant-popover-arrow{top:50%;transform:translateY(-50%) translate(-100%) rotate(-90deg)}:where(.css-ed5zg0).ant-popover-placement-rightTop .ant-popover-arrow{top:12px}:where(.css-ed5zg0).ant-popover-placement-rightBottom .ant-popover-arrow{bottom:12px}:where(.css-ed5zg0).ant-popover-pure{position:relative;max-width:none;margin:16px;display:inline-block}:where(.css-ed5zg0).ant-popover-pure .ant-popover-content{display:inline-block}:where(.css-ed5zg0).ant-popover.ant-popover-blue{--antd-arrow-background-color: #1677ff}:where(.css-ed5zg0).ant-popover.ant-popover-blue .ant-popover-inner{background-color:#1677ff}:where(.css-ed5zg0).ant-popover.ant-popover-blue .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-purple{--antd-arrow-background-color: #722ed1}:where(.css-ed5zg0).ant-popover.ant-popover-purple .ant-popover-inner{background-color:#722ed1}:where(.css-ed5zg0).ant-popover.ant-popover-purple .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-cyan{--antd-arrow-background-color: #13c2c2}:where(.css-ed5zg0).ant-popover.ant-popover-cyan .ant-popover-inner{background-color:#13c2c2}:where(.css-ed5zg0).ant-popover.ant-popover-cyan .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-green{--antd-arrow-background-color: #52c41a}:where(.css-ed5zg0).ant-popover.ant-popover-green .ant-popover-inner{background-color:#52c41a}:where(.css-ed5zg0).ant-popover.ant-popover-green .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-magenta{--antd-arrow-background-color: #eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-magenta .ant-popover-inner{background-color:#eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-magenta .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-pink{--antd-arrow-background-color: #eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-pink .ant-popover-inner{background-color:#eb2f96}:where(.css-ed5zg0).ant-popover.ant-popover-pink .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-red{--antd-arrow-background-color: #f5222d}:where(.css-ed5zg0).ant-popover.ant-popover-red .ant-popover-inner{background-color:#f5222d}:where(.css-ed5zg0).ant-popover.ant-popover-red .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-orange{--antd-arrow-background-color: #fa8c16}:where(.css-ed5zg0).ant-popover.ant-popover-orange .ant-popover-inner{background-color:#fa8c16}:where(.css-ed5zg0).ant-popover.ant-popover-orange .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-yellow{--antd-arrow-background-color: #fadb14}:where(.css-ed5zg0).ant-popover.ant-popover-yellow .ant-popover-inner{background-color:#fadb14}:where(.css-ed5zg0).ant-popover.ant-popover-yellow .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-volcano{--antd-arrow-background-color: #fa541c}:where(.css-ed5zg0).ant-popover.ant-popover-volcano .ant-popover-inner{background-color:#fa541c}:where(.css-ed5zg0).ant-popover.ant-popover-volcano .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-geekblue{--antd-arrow-background-color: #2f54eb}:where(.css-ed5zg0).ant-popover.ant-popover-geekblue .ant-popover-inner{background-color:#2f54eb}:where(.css-ed5zg0).ant-popover.ant-popover-geekblue .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-lime{--antd-arrow-background-color: #a0d911}:where(.css-ed5zg0).ant-popover.ant-popover-lime .ant-popover-inner{background-color:#a0d911}:where(.css-ed5zg0).ant-popover.ant-popover-lime .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-popover.ant-popover-gold{--antd-arrow-background-color: #faad14}:where(.css-ed5zg0).ant-popover.ant-popover-gold .ant-popover-inner{background-color:#faad14}:where(.css-ed5zg0).ant-popover.ant-popover-gold .ant-popover-arrow{background:transparent}:where(.css-ed5zg0).ant-zoom-big-enter,:where(.css-ed5zg0).ant-zoom-big-appear{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}:where(.css-ed5zg0).ant-zoom-big-leave{animation-duration:.2s;animation-fill-mode:both;animation-play-state:paused}:where(.css-ed5zg0).ant-zoom-big-enter.ant-zoom-big-enter-active,:where(.css-ed5zg0).ant-zoom-big-appear.ant-zoom-big-appear-active{animation-name:css-ed5zg0-antZoomBigIn;animation-play-state:running}:where(.css-ed5zg0).ant-zoom-big-leave.ant-zoom-big-leave-active{animation-name:css-ed5zg0-antZoomBigOut;animation-play-state:running;pointer-events:none}:where(.css-ed5zg0).ant-zoom-big-enter,:where(.css-ed5zg0).ant-zoom-big-appear{transform:scale(0);opacity:0;animation-timing-function:cubic-bezier(.08,.82,.17,1)}:where(.css-ed5zg0).ant-zoom-big-enter-prepare,:where(.css-ed5zg0).ant-zoom-big-appear-prepare{transform:none}:where(.css-ed5zg0).ant-zoom-big-leave{animation-timing-function:cubic-bezier(.78,.14,.15,.86)}.track-map .tooltip-container{pointer-events:none!important}.track-map .tooltip-container>*{pointer-events:initial}.g-expandable-pannel-wrap.collapsed .tooltip-container{display:none}.g-rc-tooltip{position:absolute!important}.g-rc-tooltip .g-rc-tooltip-arrow{height:10px}')),document.head.appendChild(e)}}catch(o){console.error("vite-plugin-css-injected-by-js",o)}})();
2
2
  import { Button as e } from "./Button/index.mjs";
3
3
  import { Markdown as t } from "./components/Markdown/index.mjs";
4
4
  import { Copy as m } from "./components/Copy/index.mjs";
package/dist/lib/index.js CHANGED
@@ -7,4 +7,4 @@
7
7
  `).filter(a=>a.trim()),l=r.length>_e,c=l?r.slice(0,_e):r;return t.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%",width:"100%",overflow:"hidden"},children:[l&&t.jsx(C.Alert,{message:"文件过大",description:`JSONL文件包含 ${r.length} 行,仅显示前 ${_e} 行。请下载完整文件查看。`,type:"warning",showIcon:!0,style:{marginBottom:16,flexShrink:0},action:t.jsx(X,{url:M,fileName:s})}),t.jsx("div",{className:"document-viewer-jsonl",children:c.map((a,z)=>{try{const u=JSON.parse(a);return t.jsx("div",{className:"document-viewer-jsonl-item",children:t.jsx("pre",{children:JSON.stringify(u,null,2)})},z)}catch(u){return t.jsx("div",{className:"document-viewer-jsonl-item",children:t.jsx("pre",{children:a})},z)}})})]})}catch(r){return t.jsx(C.Alert,{message:"JSONL解析失败",description:"文件内容解析出错",type:"error",action:t.jsx(X,{url:M,fileName:s})})}},_n=({fileContent:n,fileSize:e,url:M,fileName:s})=>{if(!(n!=null&&n.content))return null;const i=e||new Blob([n.content]).size;return i>vn?t.jsx(C.Alert,{message:"Markdown文件过大",description:`文件大小 ${Math.round(i/1024/1024)}MB,无法预览。请下载后查看。`,type:"warning",showIcon:!0,action:t.jsx(X,{url:M,fileName:s})}):t.jsx("div",{style:{height:"100%",overflow:"auto",padding:"16px"},children:t.jsx(Gt,{children:n.content})})},Xn=({fileContent:n})=>n!=null&&n.content?t.jsx("iframe",{srcDoc:n.content,className:"document-viewer-iframe",title:"HTML Preview",sandbox:"allow-same-origin allow-scripts"}):null,Kn=({fileContent:n,fileSize:e,url:M,fileName:s})=>{if(!(n!=null&&n.content))return null;const i=e||new Blob([n.content]).size;if(i>bn)return t.jsx(C.Alert,{message:"XML文件过大",description:`文件大小 ${Math.round(i/1024/1024)}MB,无法预览。请下载后查看。`,type:"warning",showIcon:!0,action:t.jsx(X,{url:M,fileName:s})});try{const r=n.content.replace(/></g,`>
8
8
  <`).replace(/^\s+/gm,"");return t.jsx("pre",{className:"document-viewer-xml",children:r})}catch(r){return t.jsx(qe,{fileContent:n,fileSize:e,url:M,fileName:s})}},qn=({fileContent:n,fileSize:e,url:M,fileName:s})=>{if(!(n!=null&&n.content))return null;const r=o.useMemo(()=>We(s||M),[s,M])||"text";if((e||new Blob([n.content]).size)>kn){const c=n.content.split(`
9
9
  `),a=c.length>Ee,u=(a?c.slice(0,Ee):c).join(`
10
- `);return t.jsxs("div",{className:"document-viewer-code",children:[a&&t.jsx(C.Alert,{message:"文件过大",description:`文件包含 ${c.length} 行,仅显示前 ${Ee} 行。请下载完整文件查看。`,type:"warning",showIcon:!0,style:{marginBottom:16,flexShrink:0},action:t.jsx(X,{url:M,fileName:s})}),t.jsx("div",{style:{overflow:"auto",flex:1,width:"100%"},children:t.jsx("pre",{className:"document-viewer-text",style:{fontSize:"12px",width:"100%",boxSizing:"border-box"},children:u})})]})}return t.jsx("div",{className:"document-viewer-code",children:t.jsx("div",{style:{overflow:"auto",flex:1,width:"100%"},children:t.jsx(kt.Prism,{language:r,wrapLongLines:!0,showLineNumbers:!0,PreTag:"div",customStyle:{width:"100%",margin:0,boxSizing:"border-box"},children:n.content})})})},eM=({url:n,fileName:e})=>t.jsx("div",{className:"document-viewer-image",children:t.jsx(C.Image,{src:n,alt:e||"Image",style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})}),tM=({url:n})=>t.jsx("div",{className:"document-viewer-video",children:t.jsx("video",{src:n,controls:!0,style:{maxWidth:"100%"},children:"您的浏览器不支持视频播放"})}),nM=({url:n})=>t.jsx("div",{className:"document-viewer-audio",children:t.jsx("audio",{src:n,controls:!0,style:{width:"100%"},children:"您的浏览器不支持音频播放"})}),MM=({pdfBlobUrl:n,pdfLoading:e,pdfError:M,url:s,fileName:i,page:r=1})=>e?t.jsx("div",{className:"document-viewer-loading",children:t.jsx(C.Spin,{size:"large",tip:"加载 PDF 中..."})}):M?t.jsx(C.Alert,{message:"PDF 加载失败",description:M,type:"error",showIcon:!0,action:t.jsx(X,{url:s,fileName:i})}):n?t.jsx("div",{className:"document-viewer-pdf",children:t.jsx("iframe",{src:`${n}#page=${r}`,className:"document-viewer-iframe",title:"PDF Preview"})}):t.jsx(C.Alert,{message:"PDF 加载失败",description:"无法创建 PDF 预览",type:"error",showIcon:!0,action:t.jsx(X,{url:s,fileName:i})}),sM=({zipFiles:n,zipLoading:e,zipError:M,selectedZipFile:s,zipFileContent:i,onFileClick:r,url:l})=>e?t.jsx("div",{className:"document-viewer-loading",children:t.jsx(C.Spin,{size:"large",tip:"加载 ZIP 文件..."})}):M&&n.length===0?t.jsx(C.Alert,{className:"document-viewer-alert-full",message:"ZIP 加载失败",description:M,type:"error",showIcon:!0,action:t.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",children:"下载文件"})}):t.jsxs("div",{className:"document-viewer-zip",children:[M&&n.length>0&&t.jsx(C.Alert,{className:"document-viewer-alert-full",message:"提示",description:M,type:"warning",showIcon:!0,style:{marginBottom:16}}),t.jsxs("div",{style:{display:"flex",height:"100%",gap:"16px"},children:[t.jsxs("div",{style:{width:"300px",borderRight:"1px solid #e8e8e8",overflow:"auto",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{padding:"12px",fontWeight:"bold",borderBottom:"1px solid #e8e8e8",flexShrink:0},children:["文件列表 (",n.length,")"]}),t.jsx("div",{style:{flex:1,overflow:"auto",minHeight:0},children:t.jsx(C.Table,{dataSource:n,size:"small",pagination:!1,scroll:{y:"100%"},onRow:c=>({onClick:()=>r(c.name),style:{cursor:"pointer",backgroundColor:s===c.name?"#e6f7ff":"transparent"}}),columns:[{title:"文件名",dataIndex:"name",key:"name",ellipsis:!0,render:c=>t.jsx("span",{title:c,children:c.split("/").pop()})},{title:"大小",dataIndex:"size",key:"size",width:80,render:c=>Wn(c)}]})})]}),t.jsx("div",{style:{flex:1,overflow:"auto",display:"flex",flexDirection:"column"},children:s&&i?t.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[t.jsx("div",{style:{padding:"12px",borderBottom:"1px solid #e8e8e8",fontWeight:"bold",flexShrink:0},children:i.name}),t.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:t.jsx(Vt,{url:i.blobUrl,fileName:i.name,showToolbar:!1,style:{height:"100%",width:"100%"}})})]}):t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"#999"},children:"请从左侧列表中选择文件进行预览"})})]})]}),oM=({message:n,description:e,action:M,url:s,fileName:i})=>{const r=s?t.jsx(C.Button,{type:"link",icon:t.jsx(Ae.DownloadOutlined,{}),href:s,download:i,target:"_blank",rel:"noopener noreferrer",children:"下载文件"}):null;return t.jsx(C.Alert,{className:"document-viewer-alert-full",message:n,description:e,type:"error",showIcon:!0,action:M||r})};const iM=n=>{if(!n)return"unknown";const e=n.split(";")[0].trim().toLowerCase();return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":e==="application/pdf"?"pdf":e==="text/markdown"||e==="text/x-markdown"?"markdown":e==="application/json"?"json":e==="application/jsonl"?"jsonl":e==="text/csv"||e==="application/csv"?"csv":e==="text/tab-separated-values"?"tsv":e==="application/javascript"||e==="text/javascript"?"code":e==="application/xml"||e==="text/xml"?"xml":e==="text/html"||e==="application/xhtml+xml"?"html":e==="text/plain"?"text":"unknown"},rM=n=>!n||Number.isNaN(n)?"大小未知":n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:n<1024*1024*1024?`${(n/1024/1024).toFixed(1)}MB`:`${(n/1024/1024/1024).toFixed(1)}GB`,cM=(n,e)=>{if(e)return e;try{const i=new URL(n).pathname.split("/").filter(Boolean).pop();return decodeURIComponent(i||n)}catch(M){return n}},aM=n=>{const{url:e,fileName:M,className:s,style:i,showToolbar:r=!0,page:l=1}=n,c=o.useMemo(()=>{const R=We(e),k=M?We(M):void 0;return Zt(R||k)},[e,M]),[a,z]=o.useState(c),{pdfBlobUrl:u,pdfLoading:y,pdfError:I}=Pn(c==="pdf"?e:""),{zipFiles:D,zipLoading:j,zipError:x,selectedZipFile:A,zipFileContent:Y,handleFileClick:h}=Vn(c==="zip"?e:""),[p,T]=o.useState(!0),[b,B]=o.useState(null),[N,U]=o.useState(null),[d,L]=o.useState(0),[S,_]=o.useState(!1),se=o.useMemo(()=>cM(e,M),[M,e]),w=o.useMemo(()=>rM(d),[d]),m=!!(N!=null&&N.content),Q=!m&&!e,V=o.useMemo(()=>[{key:"copy-content",label:"复制内容",disabled:!m},{key:"copy-url",label:"复制地址",disabled:!e}],[m,e]);o.useEffect(()=>{if(z(c),c==="pdf"||c==="zip"){T(!1);return}if(!e){B("文件URL不能为空"),T(!1);return}if(["image","video","audio","office"].includes(c)){T(!1);return}T(!0),B(null),ye(exports,null,function*(){try{if(e.startsWith("blob:")||e.startsWith("data:")){const $=yield fetch(e);if(!$.ok)throw new Error(`HTTP error! status: ${$.status}`);const Te=yield $.blob(),ge=Te.size;if(L(ge),ge>Je){B(`文件过大(${Math.round(ge/1024/1024)}MB),无法预览。请下载后查看。`),T(!1);return}const Se=yield Te.text();c==="unknown"&&z("text"),U({content:Se}),T(!1);return}const k=yield fetch(e,{method:"HEAD"}),ce=k.headers.get("Content-Length"),oe=k.headers.get("Content-Type"),K=ce?parseInt(ce,10):0;if(L(K),c==="unknown"){const $=iM(oe);$!=="unknown"&&z($)}if(K>Je){B(`文件过大(${Math.round(K/1024/1024)}MB),无法预览。请下载后查看。`),T(!1);return}const F=yield fetch(e);if(!F.ok)throw new Error(`HTTP error! status: ${F.status}`);const De=yield F.text(),J=new Blob([De]).size;if(J>Je){B(`文件过大(${Math.round(J/1024/1024)}MB),无法预览。请下载后查看。`),T(!1);return}a==="unknown"&&z("text"),U({content:De}),T(!1)}catch(R){B(R.message||"加载文件失败"),T(!1)}})},[e,c]);const Z=o.useCallback(()=>ye(exports,null,function*(){var R;if(!(N!=null&&N.content)){C.message.warning("暂无可复制的内容");return}try{if(_(!0),(R=navigator==null?void 0:navigator.clipboard)!=null&&R.writeText)yield navigator.clipboard.writeText(N.content);else{const k=document.createElement("textarea");k.value=N.content,k.style.position="fixed",k.style.opacity="0",document.body.appendChild(k),k.select(),document.execCommand("copy"),document.body.removeChild(k)}C.message.success("内容已复制到剪贴板")}catch(k){C.message.error((k==null?void 0:k.message)||"复制失败,请手动复制")}finally{_(!1)}}),[N]),je=o.useCallback(()=>ye(exports,null,function*(){var R;if(!e){C.message.warning("暂无可复制的地址");return}try{if((R=navigator==null?void 0:navigator.clipboard)!=null&&R.writeText)yield navigator.clipboard.writeText(e);else{const k=document.createElement("textarea");k.value=e,k.style.position="fixed",k.style.opacity="0",document.body.appendChild(k),k.select(),document.execCommand("copy"),document.body.removeChild(k)}C.message.success("链接已复制到剪贴板")}catch(k){C.message.error((k==null?void 0:k.message)||"复制失败,请手动复制")}}),[e]),le=o.useCallback(k=>ye(exports,[k],function*({key:R}){R==="copy-content"&&(yield Z()),R==="copy-url"&&(yield je())}),[Z,je]),ee=()=>{if(p)return t.jsx("div",{className:"document-viewer-loading",children:t.jsx(C.Spin,{size:"large",tip:"加载中..."})});if(b)return t.jsx(oM,{message:"加载失败",description:b,url:e,fileName:M});if(a==="unknown"&&(N!=null&&N.content))return t.jsx(qe,{fileContent:N,fileSize:d,url:e,fileName:M});switch(a){case"text":return t.jsx(qe,{fileContent:N,fileSize:d,url:e,fileName:M});case"json":return t.jsx($n,{fileContent:N,fileSize:d,url:e,fileName:M});case"csv":return t.jsx(Hn,{fileContent:N,fileSize:d,url:e,fileName:M});case"tsv":return t.jsx(Fn,{fileContent:N,fileSize:d,url:e,fileName:M});case"jsonl":return t.jsx(Jn,{fileContent:N,fileSize:d,url:e,fileName:M});case"markdown":return t.jsx(_n,{fileContent:N,fileSize:d,url:e,fileName:M});case"html":return t.jsx(Xn,{fileContent:N,fileSize:d,url:e,fileName:M});case"xml":return t.jsx(Kn,{fileContent:N,fileSize:d,url:e,fileName:M});case"code":return t.jsx(qn,{fileContent:N,fileSize:d,url:e,fileName:M});case"image":return t.jsx(eM,{url:e,fileName:M});case"video":return t.jsx(tM,{url:e,fileName:M});case"audio":return t.jsx(nM,{url:e,fileName:M});case"pdf":return t.jsx(MM,{pdfBlobUrl:u,pdfLoading:y,pdfError:I,url:e,fileName:M,page:l});case"office":return t.jsx(lM,{url:e});case"zip":return t.jsx(sM,{zipFiles:D,zipLoading:j,zipError:x,selectedZipFile:A,zipFileContent:Y,onFileClick:h,url:e});case"unknown":default:return t.jsx(zM,{url:e})}};return t.jsxs("div",{className:`document-viewer ${s||""}`,style:i,children:[r&&t.jsxs("div",{className:"document-viewer-toolbar",children:[t.jsxs("div",{className:"document-viewer-toolbar-meta",children:[t.jsx("span",{className:"document-viewer-toolbar-name",title:se,children:se}),t.jsx("span",{className:"document-viewer-toolbar-size",children:w})]}),t.jsxs(C.Space,{size:8,wrap:!0,children:[t.jsx(C.Button,{icon:t.jsx(Ae.DownloadOutlined,{}),size:"small",href:e,target:"_blank",rel:"noopener noreferrer",download:M||void 0,children:"下载"}),t.jsx(C.Dropdown.Button,{size:"small",icon:t.jsx(Ae.CopyOutlined,{}),menu:{items:V,onClick:le},disabled:Q,loading:S,onClick:Z,children:"复制"})]})]}),t.jsx("div",{className:"document-viewer-body",children:ee()})]})},lM=({url:n})=>{const e=`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(n)}`;return t.jsxs("div",{className:"document-viewer-office",children:[t.jsx("iframe",{src:e,className:"document-viewer-iframe",title:"Office Document Preview"}),t.jsx("div",{className:"document-viewer-fallback",children:t.jsx(C.Alert,{message:"预览可能不可用",description:t.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"点击下载文件"}),type:"info",showIcon:!0})})]})},zM=({url:n})=>t.jsx("div",{className:"document-viewer-unknown",children:t.jsx("iframe",{src:n,className:"document-viewer-iframe",title:"File Preview"})}),Vt=aM;const ue=n=>{var e;return t.jsx("button",re(E({},n),{className:`g-icon-btn disabled ${(e=n==null?void 0:n.className)!=null?e:""}`}))},jM=n=>{var d,L;const e=o.useRef(null),{className:M,headerClassName:s,style:i,visible:r,mode:l="normal",header:c,icons:a={collapseButton:t.jsx(Me,{type:"icon-yincang"}),expandButton:t.jsx(Me,{type:"icon-yincang"}),fullscreenButton:t.jsx(Me,{type:"icon-suofang"}),exitFullscreenButton:t.jsx(Me,{type:"icon-suofang"})},extraButtons:z=[],onNormalize:u,onMinimize:y,onMaximize:I}=n,[D,j]=o.useState(l==="max"),[x,A]=o.useState(l==="min"),Y=o.useRef(null),[h,p]=o.useState(l);o.useEffect(()=>{j(l==="max"),A(l==="min"),p(l)},[l]);const T=()=>{j(!D),p(D?"normal":"max"),D?u&&u():I&&I()},b=()=>{A(!x),p(x?"normal":"min"),x?u&&u():y&&y()};o.useEffect(()=>{Y.current&&D&&(Y.current.style.transform="none")},[D]);const B=(L=n.fullScreenContainer)!=null?L:(d=e.current)==null?void 0:d.parentElement,N=B==null?void 0:B.getBoundingClientRect(),U={position:"fixed",top:N==null?void 0:N.y,left:N==null?void 0:N.x,width:x?0:N==null?void 0:N.width,height:N==null?void 0:N.height};return t.jsxs("div",{className:"g-expandable-pannel-wrap",style:E({visibility:r!==!1?"visible":"hidden",position:D&&!x?"absolute":"unset"},D?U:null),ref:e,children:[!x&&t.jsxs("div",{className:`g-expandable-pannel ${D?"full":""} `,style:E({},i),children:[c!=null?c:t.jsx("div",{className:`g-expandable-pannel-header ${s!=null?s:""}`,children:t.jsx(ue,{onClick:T,children:D?a.exitFullscreenButton:a.fullscreenButton})}),t.jsx("div",{className:"g-expandable-pannel-body",children:n.children})]}),t.jsx("div",{className:`g-expandable-pannel-expand-bar ${x?"collapsed":"expaned"} ${s!=null?s:""}`,children:t.jsx(ue,{onClick:b,children:x?a.expandButton:a.collapseButton})})]})};const NM={stroke:"rgba(255, 77, 79, 0.25)",strokeWidth:1},$t=n=>{const{style:e,passes:M,scale:s,activePassId:i,passStyle:r,activePassStyle:l}=n;return t.jsx("svg",{className:"pass-map",style:e,children:M.map((c,a)=>{var u;const z=c.id===i?l:NM;return t.jsx("g",{children:t.jsx("polygon",{points:(u=c.points)==null?void 0:u.map(y=>`${y.x*s} ${y.y*s}`).join(","),style:E(E(E({},r),c.passStyle),z)})},a)})})};const uM=n=>{var y,I,D,j;const u=n,{children:e,open:M,point:s,key:i,style:r}=u,l=Ye(u,["children","open","point","key","style"]),[c,a]=o.useState(M&&s.tooltipOpen!==void 0?s.tooltipOpen:void 0),z=o.useRef(null);return o.useEffect(()=>{var Y,h;if(!s.tooltipRender||!z.current)return;const x=s.tooltipRender(s);if(typeof x=="string"||typeof x=="number"){z.current.innerText=x.toString();return}const A=(Y=z.current)==null?void 0:Y.firstChild;A?A.replaceWith(x):(h=z.current)==null||h.appendChild(x),console.log("tooltip inner text",s.id),console.log(new Date().valueOf())},[s.tooltipRender,c]),o.useEffect(()=>{a(s.tooltipOpen!==void 0?s.tooltipOpen&&M:void 0)},[s.tooltipOpen!==void 0?s.tooltipOpen&&M:void 0]),console.log("render PointTooltip",s.id),console.log(new Date().valueOf()),t.jsx(Qt,re(E({},l),{autoAdjustOverflow:!1,placement:"top",open:s.tooltipOpen!==void 0?s.tooltipOpen&&M:void 0,onOpenChange:x=>{var h,p;if(s.tooltipOpen||a(x),console.log("tooltip inner text",s.id),console.log(new Date().valueOf()),!s.tooltipRender||!z.current)return;const A=s.tooltipRender(s);if(typeof A=="string"||typeof A=="number"){z.current.innerText=A.toString();return}const Y=(h=z.current)==null?void 0:h.firstChild;Y?Y.replaceWith(A):(p=z.current)==null||p.appendChild(A)},color:((y=s.tooltipStyle)==null?void 0:y.backgroundColor)||((I=s.tooltipStyle)==null?void 0:I.backgroundImage)||((j=(D=s.tooltipStyle)==null?void 0:D.background)==null?void 0:j.toString()),title:t.jsx("div",{ref:z},i),overlayInnerStyle:s.tooltipStyle,destroyTooltipOnHide:!0,style:E({zIndex:9},r),motion:{forceRender:!0},children:e}))},gM=uM,dM={attributes:!0,characterData:!0},yM=n=>{const e=o.useRef(null),{point:M,open:s,id:i,x:r,y:l,r:c,active:a=!1,hidden:z=!1,onPointClick:u,getTooltipContainer:y}=n,[I,D]=o.useState(n.style),[j,x]=o.useState(!0);o.useEffect(()=>{const h=gn.diff(I,n.style);Object.keys(h).length&&D(n.style)},[n.style]);const A=o.useMemo(()=>t.jsx("circle",{id:`mark-${i}`,className:"point point-active",cx:r,cy:l,r:c,ref:e,style:I,onClick:()=>u&&u(M)}),[r,l,c,I,a]),Y=o.useMemo(()=>{const h=dn(()=>{x(!0),console.log("show tooltip",M.id),console.log(new Date().valueOf())},200);return new MutationObserver(()=>{console.log("circle is changed"),console.log("hide tooltip",M.id),console.log(new Date().valueOf()),x(!1),h()})},[]);return o.useEffect(()=>{if(!(!e.current||!M.tooltipRender))return Y.observe(e.current,dM),()=>{e.current&&Y.disconnect()}},[r,l,c]),z?t.jsx(t.Fragment,{}):M.tooltipRender&&j?t.jsx(gM,{open:s,point:M,getPopupContainer:y,children:A}):A},Et=yM,Ht=n=>{var Ue;const{width:e,height:M,points:s,scale:i,pointSize:r=6,direction:l,activePointId:c,style:a,lineStyle:z,pointStyle:u,directionStyle:y,marks:I,resizable:D,transform:j,keepRatio:x=!1,onPointClick:A,onTransform:Y,onPointsChange:h,onCancelResize:p,actions:T=!0,setIsSaved:b,isSaved:B=!1}=n,N=o.useRef(null),U=o.useRef(null),d=o.useRef(null),L=o.useRef(null),S=o.useRef(null),[_,se]=o.useState(null),[w,m]=o.useState((j==null?void 0:j.scale)||[1,1]),[Q,V]=o.useState((j==null?void 0:j.rotate)||0),[Z,je]=o.useState((j==null?void 0:j.translate)||[0,0,0,0]),[le,ee]=o.useState([]),[R,k]=o.useState(),[ce,oe]=o.useState(),[K,F]=o.useState(D),[De,J]=o.useState([]),[$,Te]=o.useState(s),[ge,Se]=o.useState(!0),[te,me]=o.useState(),[ie,de]=o.useState(),[Oe,Ze]=o.useState(typeof T!="boolean"?T:T===!0?{}:null),fe=(r-r/4*.9)*2/i;o.useEffect(()=>{Ze(typeof T!="boolean"?T:T===!0?{}:null)},[T]);const Ve=(g,f)=>{if(!g.length)return;let G;return g.map(v=>{var ae;if(!G){G=v;return}const H=t.jsx("line",{x1:Number.isFinite(G.x)?G.x:0,y1:Number.isFinite(G.y)?G.y:0,x2:Number.isFinite(v.x)?v.x:0,y2:Number.isFinite(v.y)?v.y:0,style:re(E(E({stroke:"#1F66E1BF"},z),G.lineStyle),{strokeWidth:Number((z==null?void 0:z.strokeWidth)||((ae=G.lineStyle)==null?void 0:ae.strokeWidth)||2)/f})},v.id);return G=v,H})},ve=new ResizeObserver(()=>{N.current&&(U.current&&(U.current.style.transform="none",U.current.style.width="auto",U.current.style.height="100%"),U.current&&(U.current.style.width="100%",U.current.style.height="100%"))});o.useEffect(()=>{var g;de((g=d.current)==null?void 0:g.getBoundingClientRect())},[a==null?void 0:a.left,a==null?void 0:a.top,a==null?void 0:a.width,a==null?void 0:a.height,i]),o.useEffect(()=>{F(D)},[D]),o.useEffect(()=>{Te(s||[])},[s,De]),o.useEffect(()=>{var g;(!((g=d.current)!=null&&g.style.transform)||d.current.style.transform==="none")&&(m((j==null?void 0:j.scale)||[1,1]),V((j==null?void 0:j.rotate)||0),je((j==null?void 0:j.translate)||[0,0,0,0]))},[(Ue=d.current)==null?void 0:Ue.style.transform]),o.useEffect(()=>{!d.current||K||(d.current.style.transform="none",m((j==null?void 0:j.scale)||[1,1]),V((j==null?void 0:j.rotate)||0),je((j==null?void 0:j.translate)||[0,0,0,0]))},[K]),o.useEffect(()=>{if(N.current)return ve.observe(N.current),()=>{N.current&&ve.unobserve(N.current)}},[N.current]),o.useEffect(()=>{!_||!j||(_.throttleDragRotate=j.rotate,_.throttleScale=j.scale,_.throttleDrag=j.translate)},[_,j]),o.useEffect(()=>{k($==null?void 0:$.find(f=>f.id===c));let g=$.map(f=>{var ae,Be,he;const G=f.x,O=f.y,v=f.id===c,H=r*(v?1.2:1)/i;return t.jsx(Et,{open:ge,id:f.id,point:f,getTooltipContainer:()=>S.current||document.body,x:G,y:O,r:u!=null&&u.r||(ae=f.pointStyle)!=null&&ae.r?Number((u==null?void 0:u.r)||((Be=f.pointStyle)==null?void 0:Be.r))/i:H/2,hidden:v,style:re(E(E({stroke:"#1F66E1BF",fill:"#fff",cursor:A?"pointer":"unset"},u),f.pointStyle),{strokeWidth:Number(((he=f.pointStyle)==null?void 0:he.strokeWidth)||2)/i,r:void 0}),onPointClick:A},f.id)})||[];ee(g)},[$,c,i,ge]),o.useEffect(()=>{var v,H,ae;if(!R){oe(void 0);return}const g=R.x,f=R.y,G=R.id===c,O=r*(G?1.2:1)/i;oe(t.jsxs("g",{children:[l!==void 0&&t.jsx("circle",{id:`mark-${R.id}`,cx:g,cy:f,r:`${fe}`,strokeDasharray:fe*2*Math.PI,strokeDashoffset:fe*2*Math.PI/360*(360-60),style:E({transform:`rotate(${l+240}deg)`,transformOrigin:`${g}px ${f}px`,strokeWidth:fe*2,stroke:"#1F66E1BF",fill:"transparent",pointerEvents:"none"},y)}),t.jsx(Et,{open:ge,point:R,getTooltipContainer:()=>S.current||document.body,x:g,y:f,r:(v=R.pointStyle)!=null&&v.r?Number((H=R.pointStyle)==null?void 0:H.r)/i:O/2,style:re(E(E({stroke:"#1F66E1BF",fill:"#fff"},u),R.pointStyle),{strokeWidth:Number(((ae=R.pointStyle)==null?void 0:ae.strokeWidth)||2)/i,r:void 0}),onPointClick:A},R.id)]},R.id))},[R,l,i,ge]),o.useEffect(()=>{d.current&&setTimeout(()=>{var g,f;me((g=d.current)==null?void 0:g.getBBox()),de((f=d.current)==null?void 0:f.getBoundingClientRect())},100)},[j]),o.useEffect(()=>{var f,G;if(!d.current)return;me((f=d.current)==null?void 0:f.getBBox()),de((G=d.current)==null?void 0:G.getBoundingClientRect()),new ResizeObserver(()=>{var O,v;me((O=d.current)==null?void 0:O.getBBox()),de((v=d.current)==null?void 0:v.getBoundingClientRect())}).observe(d.current)},[d.current]),o.useEffect(()=>{B&&(Ne(),b&&b(!1))},[B]);const Ne=()=>{var O;const g=(O=L.current)==null?void 0:O.getBoundingClientRect();if(!g){h&&h(s),F(!1);return}const f=De.map(v=>{const H=v.getBoundingClientRect();return{id:v.id.split("-")[1],x:(H.x+H.width/2-g.x)/i,y:(H.y+H.height/2-g.y)/i}}),G=s.map(v=>{const H=f==null?void 0:f.find(ae=>ae.id.toString()===v.id.toString());return H?E(E({},v),H):v});Te(G),h&&h(G.length?G.map((v,H)=>({id:v.id,x:v.x,y:v.y,order:H})):s),F(!1)},Le=g=>g.map(f=>{const{render:G,renderData:O}=f,v=f.x*i,H=f.y*i;return t.jsx(Qt,{className:"track-map-marker-tooltip",placement:"top",title:G(O,E({},f)),open:!!O,style:{zIndex:9999},children:t.jsx("circle",{id:`mark-${f.id}`,cx:v,cy:H,r:r/2,style:{stroke:"#1F66E100",strokeWidth:2,fill:"#fff0"},children:t.jsx("span",{children:O.label})})},f.id)}),be=te?{x:te.x+te.width/2,y:te.y+te.height/2}:{x:0,y:0},ke=$.reduce((g,f)=>[Math.min(g[0],f.x),Math.max(g[1],f.x)],[0,0]),Qe=$.reduce((g,f)=>[Math.min(g[0],f.y),Math.max(g[1],f.y)],[0,0]);return t.jsx(C.ConfigProvider,{prefixCls:"g-rc",children:t.jsxs("div",{className:"track-map",style:{width:"100%",height:"100%"},ref:N,children:[t.jsx("svg",{style:a,ref:L,viewBox:`0 0 ${e} ${M}`,children:t.jsxs("g",{ref:d,x:ke[0],y:Qe[0],width:ke[1]-ke[0],height:Qe[1]-Qe[0],style:{transformOrigin:`${be.x}px ${be.y}px`,cursor:K?"url('./images/icon-move.svg') 16 16, move":"unset",transform:j&&j.scale?`${j.translate?` translate(${j.translate[0]}px, ${j.translate[1]}px)`:""} rotate(${j.rotate}rad)${j.scale?` scale(${j.scale[0]}, ${j.scale[1]})`:""}`:"none"},children:[te&&t.jsx("rect",{x:te.x,y:te.y,width:te.width,height:te.height,fill:"#ff000004"}),t.jsx("g",{className:"track-lines",children:Ve(($==null?void 0:$.filter(g=>g.order>-1))||[],i)}),t.jsxs("g",{className:"track-points",children:[le,ce]}),I&&t.jsx("g",{children:Le(I)})]})}),t.jsx("div",{className:"tooltip-container",ref:S,style:{position:"fixed",top:(ie==null?void 0:ie.y)||0,left:(ie==null?void 0:ie.x)||0,width:(ie==null?void 0:ie.width)||0,height:(ie==null?void 0:ie.height)||0}}),K&&d.current&&L.current&&t.jsx(un,{className:"path-moveable-control-box",ref:g=>{se(g)},keepRatio:x,target:[d.current],draggable:!0,scalable:!0,rotatable:!0,padding:{left:10,right:10,top:10,bottom:10},onDrag:({target:g,beforeDelta:f,beforeDist:G,left:O,top:v,right:H,bottom:ae,delta:Be,dist:he,transform:pe,clientX:nt,clientY:Mt})=>{je(he),g.style.transform=pe},onDragStart:({inputEvent:g})=>{g.stopPropagation()},onDragEnd:()=>{var f;const g=(f=d.current)==null?void 0:f.getElementsByTagName("circle");J(g!=null&&g.length?[...g]:[]),Y&&Y({rotate:Q,translate:Z,scale:w},g!=null&&g.length?[...g]:[],L.current||void 0)},renderDirections:x?["nw","ne","sw","se"]:["n","w","e","s","nw","ne","sw","se"],onScale:({target:g,scale:f,transform:G})=>{var v;m(f),g.style.transform=G;const O=(v=d.current)==null?void 0:v.getElementsByTagName("circle");J(O!=null&&O.length?[...O]:[]),Y&&Y({rotate:Q,translate:Z,scale:f},O!=null&&O.length?[...O]:[],L.current||void 0)},onRotate:({target:g,dist:f,transform:G})=>{var v;V(f),g.style.transform=G;const O=(v=d.current)==null?void 0:v.getElementsByTagName("circle");J(O!=null&&O.length?[...O]:[]),Y&&Y({rotate:f,translate:Z,scale:w},O!=null&&O.length?[...O]:[],L.current||void 0)},onRenderEnd:()=>{var f,G,O;const g=(f=d.current)==null?void 0:f.getElementsByTagName("circle");Y&&Y({rotate:Q,translate:Z,scale:w},g!=null&&g.length?[...g]:[],L.current||void 0),me((G=d.current)==null?void 0:G.getBBox()),de((O=d.current)==null?void 0:O.getBoundingClientRect())}})]})})},Ct=n=>{const{name:e,type:M,style:s,className:i,children:r,onConfirm:l}=n,[c,a]=o.useState(null);return o.useEffect(()=>{if(!n.confirm){a(null);return}if(n.confirm===!0){a({text:`确认${e}吗?`});return}a(n.confirm)},[n.confirm]),c?t.jsx(yn,{rootClassName:"track-map-popconfirm",okText:"确定",cancelText:"取消",title:c.text,trigger:"click",onConfirm:l,children:t.jsx(Xe,{className:i,type:M,style:E({},s),children:r||e})}):t.jsx(Xe,{className:i,type:M,onClick:l,children:r||e})};let St;const DM=o.forwardRef((n,e)=>{var ot,it,rt,ct,at,lt,zt,jt,Nt,ut,gt,dt,yt,Dt,It,xt,Tt,wt,At,mt,ft;const{url:M,points:s,pointSize:i,direction:r,activePointId:l,lineStyle:c,pointStyle:a,directionStyle:z,onPointClick:u,passes:y,activePassId:I,passStyle:D,activePassStyle:j,marks:x,draggable:A=!1,offsetEdge:Y=[50,50,50,50],zoomable:h=!1,zoomStep:p=.02,zoomMax:T=2,zoomMin:b=0,onImageLoad:B,trackEditable:N,trackEditing:U,keepRatio:d,transform:L,onTrackEditingChange:S,onTransform:_,onPointsChange:se,actions:w=!0}=n,m=o.useRef({}),Q=o.useRef({}),[V,Z]=o.useState(0),[je,le]=o.useState(0),[ee,R]=o.useState(1),[k,ce]=o.useState(0),[oe,K]=o.useState(0),[F,De]=o.useState(0),[J,$]=o.useState(0),[Te,ge]=o.useState(!1),[Se,te]=o.useState(!1),[me,ie]=o.useState(),[de,Oe]=o.useState({x:0,y:0}),[Ze,fe,Ve,ve]=Y,[Ne,Le]=o.useState(U),[be,ke]=o.useState(1),[Qe,Ue]=o.useState(!1),[g,f]=o.useState(typeof w!="boolean"?w:w===!0?{}:null);o.useEffect(()=>{ke(Math.round(ee*100)/100)},[ee]),o.useEffect(()=>{Le(U)},[U]),o.useEffect(()=>{St=new ResizeObserver(G),St.observe(Q.current);const P=W=>(W.preventDefault(),!1);return Q.current.addEventListener("wheel",P),()=>{Q.current.removeEventListener("wheel",P)}},[]);const G=()=>{if(!Q.current)return;const P=Q.current.clientWidth,W=Q.current.clientHeight,q=m.current.naturalWidth,ne=m.current.naturalHeight,we=P/q,$e=W/ne,Re=we<$e?we:$e,Kt=(P-q*Re)/2,qt=(W-ne*Re)/2,en=q*Re,tn=ne*Re;Z(P),le(W),R(Re),ce(Kt),K(qt),De(en),$(tn),ge(!0),B&&B(m.current)},O=()=>{if(!h||ee>=T)return;let P=ee*(1+p),W=p;P>=T&&(P=T,W=T/ee-1),ce(k-F*(W/2)),K(oe-J*(W/2)),De(F+F*W),$(J+J*W),R(P),pe()},v=()=>{if(!h||ee<=b)return;let P=ee*(1-p),W=p;P<=b&&(P=b,W=1-b/ee),ce(k-F*(-W/2)),K(oe-J*(-W/2)),De(F+F*-W),$(J+J*-W),R(P),pe()};o.useImperativeHandle(e,()=>({zoomIn:O,zoomOut:v}));const H=P=>(P.nativeEvent.deltaY<0?O():v(),!1),ae=P=>{te(!0);const{pageX:W,pageY:q}=P;Oe({x:W,y:q})},Be=P=>{if(!Se)return!1;const{pageX:W,pageY:q}=P,ne=W-de.x,we=q-de.y;Oe({x:W,y:q}),ce(k+ne),K(oe+we),pe()},he=()=>{te(!1)};window.onmouseup=()=>{te(!1)};const pe=()=>{k<-F+ve&&ce(-F+ve),oe<-J+Ze&&K(-J+Ze),k>V-fe&&ce(V-fe),oe>je-Ve&&K(je-Ve)},nt=()=>{Le(!Ne),S&&S(!Ne)},Mt=P=>{const{touches:W}=P;if(console.log("onTouchStart"),console.log(W),te(!0),W.length<2){const{clientX:q,clientY:ne}=W[0];Oe({x:q,y:ne})}else ie(W)},Jt=P=>{if(!Se||!P.touches)return!1;const{clientX:W,clientY:q}=P.touches[0];if(P.touches.length<2){const ne=W-de.x,we=q-de.y;Oe({x:W,y:q}),ce(k+ne),K(oe+we),pe()}else{console.log("onTouchMove"),console.log(P.touches);const ne=P.touches,we=st(ne[0],ne[1]),$e=st(me[0],me[1]);we>$e?O():v()}},st=(P,W)=>{const q=W.pageX-P.pageX,ne=W.pageY-P.pageY;return Math.sqrt(q*q+ne*ne)};o.useEffect(()=>{f(typeof w!="boolean"?w:w===!0?{}:null)},[w]);const _t=()=>{Le(!1),S&&S(!1)},Xt=()=>{Ue(!0)};return t.jsxs("div",{className:"image-map",ref:Q,onMouseDown:A?ae:void 0,onMouseMove:A?Be:void 0,onMouseUp:A?he:void 0,onWheel:A?H:void 0,onTouchStart:A?Mt:void 0,onTouchMove:A?Jt:void 0,onTouchEnd:A?he:void 0,children:[t.jsx("img",{className:"img",style:{position:"absolute",left:k,top:oe,width:F,height:J},ref:m,onLoad:G,src:M,alt:""}),Te&&(y==null?void 0:y.length)&&t.jsx($t,{style:{position:"absolute",left:k,top:oe,width:F,height:J},passes:y,scale:ee,activePassId:I,passStyle:D,activePassStyle:j}),Te&&!!(s!=null&&s.length)&&t.jsx(Ht,{style:{position:"absolute",left:k,top:oe,width:F,height:J,overflow:"visible"},width:m.current.naturalWidth,height:m.current.naturalHeight,transform:L,movable:Ne,resizable:Ne,points:s,scale:ee,pointSize:i,direction:r,activePointId:l,lineStyle:c,pointStyle:a,directionStyle:z,keepRatio:d,marks:x,onPointClick:u,onTransform:_,onPointsChange:P=>{se&&se(P),Le(!1),S&&S(!1)},onCancelResize:()=>{Le(!1),S&&S(!1)},actions:w,setIsSaved:Ue,isSaved:Qe}),N&&t.jsxs("div",{className:"image-map-toolbar",children:[t.jsx(Ft,{className:"zoom-controller",value:be,min:b,max:T,step:p,showText:!0,onChange:P=>{be>P?v():O()}}),N&&(Ne&&w?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"line"}),t.jsxs("div",{className:"editing-controller",children:[t.jsx(Ct,{children:typeof w!="boolean"&&((ot=w.cancelButton)==null?void 0:ot.children)||void 0,name:typeof w!="boolean"&&((it=w.cancelButton)==null?void 0:it.text)||"退出编辑",className:`editing-controller${Ne?" active":""} ${typeof w!="boolean"&&((rt=w.cancelButton)==null?void 0:rt.className)||""}`,confirm:((ct=g==null?void 0:g.cancelButton)==null?void 0:ct.confirm)===!0?{text:"调整记录将不被保存"}:(at=g==null?void 0:g.cancelButton)!=null&&at.confirm?g.cancelButton.confirm:!1,style:typeof w!="boolean"&&((lt=w.cancelButton)==null?void 0:lt.style)||void 0,onConfirm:_t}),t.jsx(Ct,{type:"primary",children:typeof w!="boolean"&&((zt=w.okButton)==null?void 0:zt.children)||t.jsxs("div",{className:"save-detail",children:[t.jsx(Ae.SaveOutlined,{}),t.jsx("span",{children:"保存"})]}),name:typeof w!="boolean"&&((jt=w.okButton)!=null&&jt.confirm)?((Nt=w.okButton)==null?void 0:Nt.text)||"保存":"确定",className:`editing-controller${Ne?" active":""} ${typeof w!="boolean"&&((ut=w.okButton)==null?void 0:ut.className)||""}`,confirm:((gt=g==null?void 0:g.okButton)==null?void 0:gt.confirm)===!0?{text:"调整记录保存后,将改变当前巡检数据状态"}:(dt=g==null?void 0:g.okButton)!=null&&dt.confirm?g.okButton.confirm:!1,style:typeof w!="boolean"&&((yt=w.okButton)==null?void 0:yt.style)||void 0,onConfirm:Xt})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"line"}),t.jsx("div",{className:"moveable-controller",children:t.jsx(Xe,{title:Ne?typeof w!="boolean"&&((Dt=w.editButton)==null?void 0:Dt.exitTitleText)||"退出编辑":typeof w!="boolean"&&((It=w.editButton)==null?void 0:It.titleText)||"调整轨迹",className:`moveable-controller-btn${Ne?" active":""} ${typeof w!="boolean"&&((xt=w.editButton)==null?void 0:xt.className)||""}`,style:typeof w!="boolean"&&((Tt=w.editButton)==null?void 0:Tt.style)||void 0,onClick:nt,children:typeof w!="boolean"?(wt=w.editButton)!=null&&wt.children?(At=w.editButton)==null?void 0:At.children:(mt=w.editButton)!=null&&mt.text?t.jsx("span",{children:(ft=w.editButton)==null?void 0:ft.text}):t.jsxs("div",{className:"btn-change",children:[t.jsx(Me,{type:"icon-tiaozheng"}),t.jsx("span",{children:"修改"})]}):void 0})})]}))]})]})}),IM=n=>{const{className:e,style:M,length:s=0,current:i=0,speed:r=2e3,play:l=!1,loop:c=!1,loading:a=!1,onChange:z}=n,[u,y]=o.useState(l),[I,D]=o.useState(i),[j,x]=o.useState(null);o.useEffect(()=>{D(i)},[i]),o.useEffect(()=>{y(l)},[l]),o.useEffect(()=>{u?A():I>=s-1&&(D(0),z(0))},[u]),o.useEffect(()=>{u&&(a?j&&(clearTimeout(j),x(null)):x(setTimeout(A,r)))},[a]);const A=()=>{D(p=>p<s-1?(z(p+1),p+1):c?(z(0),0):(h(),p))},Y=()=>{I>=s-1&&D(0),y(!0)},h=()=>{y(!1),j&&(clearTimeout(j),x(null))};return t.jsxs("div",{className:e,style:M,children:[t.jsx(ue,{disabled:I<=0||a,onClick:()=>{z(0),D(0)},children:t.jsx(Me,{type:"icon-diyige"})}),t.jsx(ue,{disabled:I<=0||a,onClick:()=>{z(I-1),D(I-1)},children:t.jsx(Me,{type:"icon-qianyige"})}),u?t.jsx(ue,{onClick:h,children:t.jsx(Me,{type:"icon-zanting"})}):t.jsx(ue,{disabled:I>=s-1||a,onClick:Y,children:t.jsx(Me,{type:"icon-bofang"})}),t.jsx(ue,{disabled:I>=s-1||a,onClick:()=>{z(I+1),D(I+1)},children:t.jsx(Me,{type:"icon-xiayige"})}),t.jsx(ue,{disabled:I>=s-1||a,onClick:()=>{z(s-1),D(s-1)},children:t.jsx(Me,{type:"icon-zuihouyige"})})]})};const xM=16,TM=16,wM=-1,AM=1,mM=-1,fM=1,LM=n=>{const e=n||window.event,M=n.target||n.srcElement;if(e.offsetX)return e.offsetX;{const s=M.getBoundingClientRect();return e.clientX-s.left}},hM=n=>{const e=n||window.event,M=n.target||n.srcElement;if(e.offsetY)return e.offsetY;{const s=M.getBoundingClientRect();return e.clientY-s.top}},YM=n=>{const e=n.split("-");let M=e.length>1||e[0]==="left"||e[0]==="right"?e[0]:"center",s=e.length>1?e[1]:e[0]==="top"||e[0]==="bottom"?e[0]:"middle";return[M,s]},pM=(n,e,M=[xM,TM])=>{const s=()=>{switch(n[0]){case"left":return wM;case"right":return AM;default:return 0}},i=()=>{switch(n[1]){case"top":return mM;case"bottom":return fM;default:return 0}},r=()=>{switch(n[0]){case"left":return-((e==null?void 0:e.width)||0)-M[0]-2;case"right":return 0;default:return-((e==null?void 0:e.width)||0)/2}},l=()=>{switch(n[1]){case"top":return-M[1]-2;case"bottom":return(e==null?void 0:e.height)||0;default:return((e==null?void 0:e.height)||0)/2}};return{x:M[0]*s()+r(),y:M[1]*i()+l()}},EM=n=>{var T;const{children:e,defaultPosition:M,forElement:s,placement:i="right-bottom",curserPosition:r,className:l,style:c}=n,a=o.useRef(null),z=o.useRef(null),u=s||document.body,y=YM(i),I=pM(y,(T=z.current)==null?void 0:T.getBoundingClientRect(),r),[D,j]=o.useState(n.visible||!0),[x,A]=o.useState(M||{x:-2e3,y:-2e3});o.useEffect(()=>(u.addEventListener("mouseenter",Y),u.addEventListener("mousemove",p),u.addEventListener("mouseleave",h),()=>{u.removeEventListener("mouseenter",Y),u.removeEventListener("mousemove",p),u.removeEventListener("mouseleave",h)}),[u]),o.useEffect(()=>{j(n.visible||!0)},[n.visible]);const Y=()=>{j(!0)},h=()=>{j(!1)},p=b=>{let B=LM(b)+I.x;const N=hM(b)+I.y;A({x:B,y:N})};return t.jsx("div",{className:`g-mouse-tip ${y.join(" ")}`,ref:a,style:{left:`${x.x}px`,top:`${x.y}px`,visibility:`${D?"visible":"hidden"}`},children:t.jsx("div",{className:`g-mouse-tip-content ${l}`,style:c,ref:z,children:e})})},Ft=n=>{const{className:e,style:M,value:s,min:i,max:r,step:l=1,onChange:c,showText:a=!1}=n,[z,u]=o.useState(s!=null?s:0);return o.useEffect(()=>{u(s!=null?s:0)},[s]),t.jsxs("div",{className:e,style:M,children:[t.jsx(ue,{disabled:!!(r&&r<=z),onClick:()=>{c(z+l),u(z+l)},children:t.jsx(Me,{type:"icon-fangda"})}),a&&t.jsxs("div",{style:{width:40,textAlign:"center"},children:[Math.round(z*100),"%"]}),t.jsx(ue,{disabled:!!(i&&i>=z),onClick:()=>{c(z-l),u(z-l)},children:t.jsx(Me,{type:"icon-suoxiao"})})]})};function CM(n,e){var M=document.getElementsByTagName("body")[0],s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",n),M.appendChild(s),s.onload=e}function SM(n){const[e,M]=o.useState(!1),[s,i]=o.useState(),[r,l]=o.useState(),[c,a]=o.useState(!1),[z,u]=o.useState(),[y,I]=o.useState([]),[D,j]=o.useState(0);function x(N){if(N.viewType!="3DView"){console.error("bimface view type is not 3DView");return}M(!0),z&&A(N.viewToken)}const A=N=>{if(!s){let U=z,d=new window.Glodon.Bimface.Application.WebApplication3DConfig;d.domElement=U,d.Toolbars=[];const L=new window.Glodon.Bimface.Application.WebApplication3D(d);L.addView(N),i(L);const S=L.getViewer();S.addEventListener(window.Glodon.Bimface.Viewer.Viewer3DEvent.ViewAdded,function(){window.onresize=function(){S.resize(document.documentElement.clientWidth,document.documentElement.clientHeight-40)},S.setCameraAnimation(!1),S.render(),S.setNavigationMode(window.Glodon.Bimface.Viewer.NavigationMode3D.Walk),S.render(),a(!0)}),S.addEventListener(window.Glodon.Bimface.Viewer.Viewer3DEvent.ModelAdded,()=>{j(_=>_+1)}),l(S)}};o.useEffect(()=>{c&&y.forEach(N=>{r.loadModel({viewToken:N})})},[c,y]),o.useEffect(()=>{},[D]),o.useEffect(()=>{if(!z||!y.length)return;const N=y.pop();N&&h(N),I([...y])},[z]);function Y(N){console.log(N)}function h(N){j(0);const U=()=>{let d=new window.BimfaceSDKLoaderConfig;d.viewToken=N,window.BimfaceSDKLoader.load(d,x,Y)};if(!window.BimfaceSDKLoaderConfig){CM("https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js",U);return}U()}const p=(N,U)=>{if(!r||!c||!z){console.error("BIMFace viewer is not ready.");return}const d=z.getElementsByTagName("canvas")[0],L=document.createElement("canvas");L.width=d.width,L.height=d.height;const S=L.getContext("2d");return S&&(S.fillStyle="#fff",S.fillRect(0,0,L.width,L.height),S.drawImage(d,0,0,d.width,d.height)),L.toDataURL(N,U)},T=N=>{if(!r){console.error("viewer is not ready");return}if(D&&y.length+1===D||!y.length)r.getAllModels().map(L=>r._models[L.modelId]).forEach(L=>{let S=new window.Glodon.Web.Graphics.Color(N);L.overrideAllComponentsColor&&L.overrideAllComponentsColor(S)}),r.enableWireframe(!0),r.getLightManager().getAllFillLights().forEach(L=>L.enableLight(!0)),r.render();else{console.error("viewer is not render complete");return}},b=N=>{if(r)if(D&&y.length+1===D||!y.length)r.getAllModels().map(L=>r._models[L.modelId]).forEach(L=>{Object.keys(N).forEach(S=>{let _=[{categoryId:S}];L.getComponentsByConditions(_,function(se){let w=new window.Glodon.Web.Graphics.Color(N[S]);L.overrideComponentsColorById&&L.overrideComponentsColorById(se,w)},function(){window.alert("error")})})}),r.enableWireframe(!1),r.getLightManager().getAllFillLights().forEach(L=>L.enableLight(!1)),r.render();else{console.error("viewer is not render complete");return}};function B(N,U,d){const L=r.getModel();L==null||L.getBoundingBox(({currentBoundingBox:S})=>{const _=S.max.x-S.min.x,se=S.max.y-S.min.y,w=_/se;let m,Q;w>1?(m=U.width,Q=m/w):(Q=U.height,m=Q*w);const V=document.createElement("div");V.setAttribute("style",`width: ${m}px;height: ${Q}px`),document.body.appendChild(V);const Z=new window.Glodon.Bimface.Plugins.NavigationMap.MapViewerConfig;Z.domElement=V;const je=new window.Glodon.Bimface.Plugins.NavigationMap.MapViewer(Z),le=new window.Glodon.Bimface.Plugins.NavigationMap.NavigationMapConfig;le.viewer=r,le.mapViewer=je,le.type="SetProfile",le.height=N,le.successCallback=ee=>{setTimeout(()=>{const R=new Image;R.src=V.getElementsByTagName("image")[0].getAttribute("href")||"",R.onload=()=>{d(R)}},200)},new window.Glodon.Bimface.Plugins.NavigationMap.NavigationMap(le)})}return{BimfaceViewer:e&&window.Glodon.Bimface.Viewer,BimfaceSection:e&&window.Glodon.Bimface.Plugins.Section,BimfaceMark:e&&window.Glodon.Bimface.Plugins.Marker3D,BimfaceViewerEvents:e&&window.Glodon.Bimface.Viewer.Viewer3DEvent,viewer:r,viewerAdded:c,sDKLoaded:e,loadedModelCount:D,loadModels:N=>{if(N!=null&&N.length||console.error("viewTokens is Empty"),!r&&z){const U=N[0];h(U)}I(N)},setContainerDom:u,getSnapshot:p,setComponentsColorByCatgryId:b,setAllComponentsColor:T,navigationMapByHeight:B}}function OM(n){const{url:e,onScaleChange:M,onLoad:s}=n,i=o.useRef(null),r=Ut.useSize(i),l=r==null?void 0:r.width,c=r==null?void 0:r.height,[a,z]=o.useState();return o.useEffect(()=>{l&&c&&a&&M(l/a.width,l,c)},[l,c,a]),t.jsx("img",{ref:i,src:e,className:"select-none",style:{maxWidth:"100%",maxHeight:"100%",cursor:"crosshair"},alt:"",onLoad:()=>{if(i.current){s&&s(i.current);const{naturalWidth:u,naturalHeight:y}=i.current;z({width:u,height:y})}}})}function Ot(n){const{start:e,end:M}=n,{options:{lineColor:s,lineWidth:i}}=o.useContext(Ge);return t.jsx(t.Fragment,{children:t.jsx("line",{x1:e.x,y1:e.y,x2:M.x,y2:M.y,stroke:s!=null?s:"#FF5500",strokeWidth:i!=null?i:2})})}function vt(n){const{markRenderer:e,marker:M}=n,{point:{x:s,y:i}}=M;return t.jsxs("g",{children:[t.jsx("line",{}),t.jsx("line",{}),t.jsx("circle",{cx:s,cy:i,r:1,fill:"transparent"}),t.jsx("foreignObject",{x:s,y:i,width:0,height:0,fill:"green",className:"relative overflow-visible",children:t.jsx("div",{className:"inline-flex absolute",draggable:!0,onDragStart:()=>{},onDragEnd:()=>{},children:e&&e(M)})})]})}function bt(n){const{points:e,editing:M,options:s,onClose:i}=n,[r,l]=o.useState(!1),{options:{polygon:c}}=o.useContext(Ge);if(!M&&Ke(e)<=2)return null;const a=xn(e),z=e.map(({x:h,y:p})=>`${h},${p}`).join(" "),u=a?`${z} ${a.x},${a.y}`:z,{showVertexIndex:y,vertexBgColor:I,vertexTextColor:D}=c!=null?c:{},j=y?10:5,x=M||y,{hideBorder:A,backgroundColor:Y}=s!=null?s:{};return t.jsxs(t.Fragment,{children:[t.jsx("polygon",{points:`${u}`,fill:Y!=null?Y:"rgba(255, 66, 66, 0.15)"}),!A&&t.jsx("polyline",{points:M?z:u,fill:"transparent",stroke:"#FF5500",strokeDasharray:"6 4",strokeWidth:"2"}),!A&&(e==null?void 0:e.map(({x:h,y:p},T)=>{const b=T===Ke(e)-1;return t.jsx("g",{style:{zIndex:b?1:100,cursor:"pointer",pointerEvents:b?"none":"bounding-box"},onMouseEnter:B=>{b||l(!0)},onMouseLeave:B=>{l(!1)},onClick:B=>{B.stopPropagation()},onDoubleClick:B=>{B.stopPropagation(),i&&i(T)},children:x&&(!b||!r)&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:h,cy:p,r:j,fill:I!=null?I:"#FF5500"}),y&&t.jsx("text",{x:h,y:p,"text-anchor":"middle",fill:D!=null?D:"#fff",dy:".3em",style:{cursor:"pointer",userSelect:"none"},children:T+1})]})})}))]})}const vM=Fe.createMachine({initial:"idle",context:{},states:{idle:{on:{START_ADD_MARKER:{target:"addingMarker"},START_DRAW_LINE:{target:"drawingLine"},START_DRAW_POLYGON:{target:"drawingPolygon"}}},addingMarker:{on:{RESET:{target:"idle",actions:Ie.assign(n=>{n.markerPoint=void 0})},ADD_MARKER:{target:"drawCompleted",actions:[Ie.assign((n,{point:e})=>{n.markerPoint=e}),"onAddMarker"]},MOUSE_MOVE:{target:"addingMarker",actions:Ie.assign((n,{point:e})=>{n.movingPoint=e})}}},drawingLine:{on:{ADD_LINE_START:{target:"drawingLine",actions:Ie.assign((n,e)=>{n.lineStart=e.point})},ADD_LINE_END:{target:"drawCompleted",actions:[Ie.assign((n,e)=>{n.lineEnd=e.point}),"onAddLine"]},MOUSE_MOVE:{target:"drawingLine",actions:Ie.assign((n,{point:e})=>{n.movingPoint=e})},RESET:{target:"drawCompleted"},CANCEL:{target:"drawCompleted"}}},drawingPolygon:{on:{CANCEL:{target:"canceled"},RESET:{target:"idle",actions:Ie.assign(n=>{n.polygonPoints=void 0})},ADD_POLYGON_POINT:{target:"drawingPolygon",actions:Ie.assign((n,{point:e})=>{var M;n.polygonPoints=(M=n.polygonPoints)!=null?M:[],n.polygonPoints.push(e)})},MOUSE_MOVE:{target:"drawingPolygon",actions:Ie.assign((n,{point:e})=>{n.movingPoint=e})},DRAW_POLYGON_COMPLETE:{target:"drawCompleted",actions:["onAddPolygon"]}}},drawCompleted:{always:{target:"idle"}},canceled:{}}});function bM(n){const{state:e,scale:M,width:s,height:i,drawOptions:r,lines:l,polygons:c,markers:a,markRenderer:z,onAddLine:u,onAddPolygon:y,onAddMarker:I,onStateChange:D}=n,[j,x]=o.useState([]),[A,Y]=o.useState([]),[h,p]=o.useState([]),T=o.useRef(null),{width:b,height:B}=Ut.useSize(T)||{};function N({x:m,y:Q}){return{x:m/M,y:Q/M}}function U({x:m,y:Q}){return{x:m*M,y:Q*M}}const[d,L]=In.useMachine(vM,{actions:{onAddMarker:Fe.assign(({markerPoint:m})=>(I&&m&&I(N(m)),{markerPoint:void 0,movingPoint:void 0})),onAddLine:Fe.assign(m=>(m.lineStart&&m.lineEnd&&u&&u(N(m.lineStart),N(m.lineEnd)),{lineEnd:void 0,lineStart:void 0,movingPoint:void 0})),onAddPolygon:Fe.assign(({polygonPoints:m})=>(y&&m&&m.length>2&&y(m.map(N)),{polygonPoints:void 0,movingPoint:void 0}))},services:{}});o.useEffect(()=>{var m;x((m=l==null?void 0:l.map(({id:Q,start:V,end:Z})=>({id:Q,start:U(V),end:U(Z)})))!=null?m:[])},[l]),o.useEffect(()=>{var m;p((m=a==null?void 0:a.map(Q=>re(E({},Q),{point:U(Q.point)})))!=null?m:[])},[a]),o.useEffect(()=>{var m;Y((m=c==null?void 0:c.map(({id:Q,points:V,options:Z})=>({id:Q,points:V.map(U),options:Z})))!=null?m:[])},[c,M]),o.useEffect(()=>{D&&d.matches("idle")&&D("viewOnly")},[d.value]),o.useEffect(()=>{if(D)switch(e){case"drawingLine":L("START_DRAW_LINE");break;case"drawingPolygon":L("START_DRAW_POLYGON");break;case"addingMarker":L("START_ADD_MARKER");break}},[e]);const{lineStart:S,lineEnd:_,polygonPoints:se,movingPoint:w}=d.context;return t.jsx(Ge.Provider,{value:{options:r!=null?r:{}},children:t.jsx("div",{ref:T,className:"w-full h-full absolute left-0 top-0",style:{cursor:e==="viewOnly"?void 0:"crosshair",width:s,height:i},children:b&&B&&t.jsxs("svg",{viewBox:`0 0 ${b} ${B}`,version:"1.1",className:"absolute inset-0",onClick:m=>{if(!T.current)return;const{top:Q,left:V}=T.current.getBoundingClientRect(),Z={x:m.clientX-V,y:m.clientY-Q};d.matches("drawingLine")?L(S===void 0?{type:"ADD_LINE_START",point:Z}:{type:"ADD_LINE_END",point:Z}):d.matches("drawingPolygon")?L({type:"ADD_POLYGON_POINT",point:Z}):d.matches("addingMarker")&&L({type:"ADD_MARKER",point:Z})},onMouseMove:m=>{if(!T.current)return;const{top:Q,left:V}=T.current.getBoundingClientRect(),Z={x:m.clientX-V,y:m.clientY-Q};L({type:"MOUSE_MOVE",point:Z})},children:[j==null?void 0:j.map((m,Q)=>t.jsx(Ot,E({},m),Q)),S&&w&&t.jsx(Ot,{start:S,end:w}),A==null?void 0:A.map(({points:m,options:Q},V)=>t.jsx(bt,{editing:!1,points:m,options:Q},V)),Ke(se)>0&&w&&t.jsx(bt,{editing:!0,points:[...se,w],onClose:m=>{L({type:"DRAW_POLYGON_COMPLETE"})}}),h==null?void 0:h.map(m=>t.jsx(vt,{marker:m,markRenderer:z})),d.matches("addingMarker")&&w&&t.jsx(vt,{marker:{id:"addingMarker",point:w}})]})})})}function et(n,e,M){if(M)return Math.abs(et(n,M)-et(e,M));for(var s=Math.atan2(e.y-n.y,e.x-n.x);s<0;)s+=2*Math.PI;return s}const Ge=o.createContext({options:{}});Ge.displayName="DrawableContext";function kM(n){const r=n,{url:e}=r,M=Ye(r,["url"]),[s,i]=Dn.useImmer({scale:1,width:0,height:0});return e?t.jsxs("div",{className:"relative bg-pink-500 bg-opacity-40",children:[t.jsx(OM,{url:e,onScaleChange:(l,c,a)=>{i(z=>{z.scale=l,z.width=c,z.height=a})}}),t.jsx(bM,E(E({},M),s))]}):null}exports.Button=Tn;exports.Copy=Rt;exports.DocumentViewer=Vt;exports.DrawableContext=Ge;exports.DrawableImageMap=kM;exports.ExpandablePannel=jM;exports.IconButton=ue;exports.Iconfont=Me;exports.ImageMap=DM;exports.Markdown=Gt;exports.MarkdownATag=Wt;exports.MarkdownCode=Pt;exports.MarkdownImage=Bt;exports.MarkdownVideo=tt;exports.MouseTip=EM;exports.PanoramaRecordPlayer=IM;exports.PassMap=$t;exports.TrackMap=Ht;exports.Zoom=Ft;exports.calAngle=et;exports.useBimface=SM;
10
+ `);return t.jsxs("div",{className:"document-viewer-code",children:[a&&t.jsx(C.Alert,{message:"文件过大",description:`文件包含 ${c.length} 行,仅显示前 ${Ee} 行。请下载完整文件查看。`,type:"warning",showIcon:!0,style:{marginBottom:16,flexShrink:0},action:t.jsx(X,{url:M,fileName:s})}),t.jsx("div",{style:{overflow:"auto",flex:1,width:"100%"},children:t.jsx("pre",{className:"document-viewer-text",style:{fontSize:"12px",width:"100%",boxSizing:"border-box"},children:u})})]})}return t.jsx("div",{className:"document-viewer-code",children:t.jsx("div",{style:{overflow:"auto",flex:1,width:"100%"},children:t.jsx(kt.Prism,{language:r,wrapLongLines:!0,showLineNumbers:!0,PreTag:"div",customStyle:{width:"100%",margin:0,boxSizing:"border-box"},children:n.content})})})},eM=({url:n,fileName:e})=>t.jsx("div",{className:"document-viewer-image",children:t.jsx(C.Image,{src:n,alt:e||"Image",style:{maxWidth:"100%",maxHeight:"100%",objectFit:"contain"}})}),tM=({url:n})=>t.jsx("div",{className:"document-viewer-video",children:t.jsx("video",{src:n,controls:!0,style:{maxWidth:"100%"},children:"您的浏览器不支持视频播放"})}),nM=({url:n})=>t.jsx("div",{className:"document-viewer-audio",children:t.jsx("audio",{src:n,controls:!0,style:{width:"100%"},children:"您的浏览器不支持音频播放"})}),MM=({pdfBlobUrl:n,pdfLoading:e,pdfError:M,url:s,fileName:i,page:r=1})=>e?t.jsx("div",{className:"document-viewer-loading",children:t.jsx(C.Spin,{size:"large",tip:"加载 PDF 中..."})}):M?t.jsx(C.Alert,{message:"PDF 加载失败",description:M,type:"error",showIcon:!0,action:t.jsx(X,{url:s,fileName:i})}):n?t.jsx("div",{className:"document-viewer-pdf",children:t.jsx("iframe",{src:`${n}#page=${r}`,className:"document-viewer-iframe",title:"PDF Preview"})}):t.jsx(C.Alert,{message:"PDF 加载失败",description:"无法创建 PDF 预览",type:"error",showIcon:!0,action:t.jsx(X,{url:s,fileName:i})}),sM=({zipFiles:n,zipLoading:e,zipError:M,selectedZipFile:s,zipFileContent:i,onFileClick:r,url:l})=>e?t.jsx("div",{className:"document-viewer-loading",children:t.jsx(C.Spin,{size:"large",tip:"加载 ZIP 文件..."})}):M&&n.length===0?t.jsx(C.Alert,{className:"document-viewer-alert-full",message:"ZIP 加载失败",description:M,type:"error",showIcon:!0,action:t.jsx("a",{href:l,target:"_blank",rel:"noopener noreferrer",children:"下载文件"})}):t.jsxs("div",{className:"document-viewer-zip",children:[M&&n.length>0&&t.jsx(C.Alert,{className:"document-viewer-alert-full",message:"提示",description:M,type:"warning",showIcon:!0,style:{marginBottom:16}}),t.jsxs("div",{style:{display:"flex",height:"100%",gap:"16px"},children:[t.jsxs("div",{style:{width:"300px",borderRight:"1px solid #e8e8e8",overflow:"auto",display:"flex",flexDirection:"column"},children:[t.jsxs("div",{style:{padding:"12px",fontWeight:"bold",borderBottom:"1px solid #e8e8e8",flexShrink:0},children:["文件列表 (",n.length,")"]}),t.jsx("div",{style:{flex:1,overflow:"auto",minHeight:0},children:t.jsx(C.Table,{dataSource:n,size:"small",pagination:!1,scroll:{y:"100%"},onRow:c=>({onClick:()=>r(c.name),style:{cursor:"pointer",backgroundColor:s===c.name?"#e6f7ff":"transparent"}}),columns:[{title:"文件名",dataIndex:"name",key:"name",ellipsis:!0,render:c=>t.jsx("span",{title:c,children:c.split("/").pop()})},{title:"大小",dataIndex:"size",key:"size",width:80,render:c=>Wn(c)}]})})]}),t.jsx("div",{style:{flex:1,overflow:"auto",display:"flex",flexDirection:"column"},children:s&&i?t.jsxs("div",{style:{display:"flex",flexDirection:"column",height:"100%"},children:[t.jsx("div",{style:{padding:"12px",borderBottom:"1px solid #e8e8e8",fontWeight:"bold",flexShrink:0},children:i.name}),t.jsx("div",{style:{flex:1,overflow:"auto",padding:"16px"},children:t.jsx(Vt,{url:i.blobUrl,fileName:i.name,showToolbar:!1,style:{height:"100%",width:"100%"}})})]}):t.jsx("div",{style:{display:"flex",alignItems:"center",justifyContent:"center",height:"100%",color:"#999"},children:"请从左侧列表中选择文件进行预览"})})]})]}),oM=({message:n,description:e,action:M,url:s,fileName:i})=>{const r=s?t.jsx(C.Button,{type:"link",icon:t.jsx(Ae.DownloadOutlined,{}),href:s,download:i,target:"_blank",rel:"noopener noreferrer",children:"下载文件"}):null;return t.jsx(C.Alert,{className:"document-viewer-alert-full",message:n,description:e,type:"error",showIcon:!0,action:M||r})};const iM=n=>{if(!n)return"unknown";const e=n.split(";")[0].trim().toLowerCase();return e.startsWith("image/")?"image":e.startsWith("video/")?"video":e.startsWith("audio/")?"audio":e==="application/pdf"?"pdf":e==="text/markdown"||e==="text/x-markdown"?"markdown":e==="application/json"?"json":e==="application/jsonl"?"jsonl":e==="text/csv"||e==="application/csv"?"csv":e==="text/tab-separated-values"?"tsv":e==="application/javascript"||e==="text/javascript"?"code":e==="application/xml"||e==="text/xml"?"xml":e==="text/html"||e==="application/xhtml+xml"?"html":e==="text/plain"?"text":"unknown"},rM=n=>!n||Number.isNaN(n)?"大小未知":n<1024?`${n}B`:n<1024*1024?`${(n/1024).toFixed(1)}KB`:n<1024*1024*1024?`${(n/1024/1024).toFixed(1)}MB`:`${(n/1024/1024/1024).toFixed(1)}GB`,cM=(n,e)=>{if(e)return e;try{const i=new URL(n).pathname.split("/").filter(Boolean).pop();return decodeURIComponent(i||n)}catch(M){return n}},aM=n=>{const{url:e,fileName:M,className:s,style:i,showToolbar:r=!1,page:l=1}=n,c=o.useMemo(()=>{const R=We(e),k=M?We(M):void 0;return Zt(R||k)},[e,M]),[a,z]=o.useState(c),{pdfBlobUrl:u,pdfLoading:y,pdfError:I}=Pn(c==="pdf"?e:""),{zipFiles:D,zipLoading:j,zipError:x,selectedZipFile:A,zipFileContent:Y,handleFileClick:h}=Vn(c==="zip"?e:""),[p,T]=o.useState(!0),[b,B]=o.useState(null),[N,U]=o.useState(null),[d,L]=o.useState(0),[S,_]=o.useState(!1),se=o.useMemo(()=>cM(e,M),[M,e]),w=o.useMemo(()=>rM(d),[d]),m=!!(N!=null&&N.content),Q=!m&&!e,V=o.useMemo(()=>[{key:"copy-content",label:"复制内容",disabled:!m},{key:"copy-url",label:"复制地址",disabled:!e}],[m,e]);o.useEffect(()=>{if(z(c),c==="pdf"||c==="zip"){T(!1);return}if(!e){B("文件URL不能为空"),T(!1);return}if(["image","video","audio","office"].includes(c)){T(!1);return}T(!0),B(null),ye(exports,null,function*(){try{if(e.startsWith("blob:")||e.startsWith("data:")){const $=yield fetch(e);if(!$.ok)throw new Error(`HTTP error! status: ${$.status}`);const Te=yield $.blob(),ge=Te.size;if(L(ge),ge>Je){B(`文件过大(${Math.round(ge/1024/1024)}MB),无法预览。请下载后查看。`),T(!1);return}const Se=yield Te.text();c==="unknown"&&z("text"),U({content:Se}),T(!1);return}const k=yield fetch(e,{method:"HEAD"}),ce=k.headers.get("Content-Length"),oe=k.headers.get("Content-Type"),K=ce?parseInt(ce,10):0;if(L(K),c==="unknown"){const $=iM(oe);$!=="unknown"&&z($)}if(K>Je){B(`文件过大(${Math.round(K/1024/1024)}MB),无法预览。请下载后查看。`),T(!1);return}const F=yield fetch(e);if(!F.ok)throw new Error(`HTTP error! status: ${F.status}`);const De=yield F.text(),J=new Blob([De]).size;if(J>Je){B(`文件过大(${Math.round(J/1024/1024)}MB),无法预览。请下载后查看。`),T(!1);return}a==="unknown"&&z("text"),U({content:De}),T(!1)}catch(R){B(R.message||"加载文件失败"),T(!1)}})},[e,c]);const Z=o.useCallback(()=>ye(exports,null,function*(){var R;if(!(N!=null&&N.content)){C.message.warning("暂无可复制的内容");return}try{if(_(!0),(R=navigator==null?void 0:navigator.clipboard)!=null&&R.writeText)yield navigator.clipboard.writeText(N.content);else{const k=document.createElement("textarea");k.value=N.content,k.style.position="fixed",k.style.opacity="0",document.body.appendChild(k),k.select(),document.execCommand("copy"),document.body.removeChild(k)}C.message.success("内容已复制到剪贴板")}catch(k){C.message.error((k==null?void 0:k.message)||"复制失败,请手动复制")}finally{_(!1)}}),[N]),je=o.useCallback(()=>ye(exports,null,function*(){var R;if(!e){C.message.warning("暂无可复制的地址");return}try{if((R=navigator==null?void 0:navigator.clipboard)!=null&&R.writeText)yield navigator.clipboard.writeText(e);else{const k=document.createElement("textarea");k.value=e,k.style.position="fixed",k.style.opacity="0",document.body.appendChild(k),k.select(),document.execCommand("copy"),document.body.removeChild(k)}C.message.success("链接已复制到剪贴板")}catch(k){C.message.error((k==null?void 0:k.message)||"复制失败,请手动复制")}}),[e]),le=o.useCallback(k=>ye(exports,[k],function*({key:R}){R==="copy-content"&&(yield Z()),R==="copy-url"&&(yield je())}),[Z,je]),ee=()=>{if(p)return t.jsx("div",{className:"document-viewer-loading",children:t.jsx(C.Spin,{size:"large",tip:"加载中..."})});if(b)return t.jsx(oM,{message:"加载失败",description:b,url:e,fileName:M});if(a==="unknown"&&(N!=null&&N.content))return t.jsx(qe,{fileContent:N,fileSize:d,url:e,fileName:M});switch(a){case"text":return t.jsx(qe,{fileContent:N,fileSize:d,url:e,fileName:M});case"json":return t.jsx($n,{fileContent:N,fileSize:d,url:e,fileName:M});case"csv":return t.jsx(Hn,{fileContent:N,fileSize:d,url:e,fileName:M});case"tsv":return t.jsx(Fn,{fileContent:N,fileSize:d,url:e,fileName:M});case"jsonl":return t.jsx(Jn,{fileContent:N,fileSize:d,url:e,fileName:M});case"markdown":return t.jsx(_n,{fileContent:N,fileSize:d,url:e,fileName:M});case"html":return t.jsx(Xn,{fileContent:N,fileSize:d,url:e,fileName:M});case"xml":return t.jsx(Kn,{fileContent:N,fileSize:d,url:e,fileName:M});case"code":return t.jsx(qn,{fileContent:N,fileSize:d,url:e,fileName:M});case"image":return t.jsx(eM,{url:e,fileName:M});case"video":return t.jsx(tM,{url:e,fileName:M});case"audio":return t.jsx(nM,{url:e,fileName:M});case"pdf":return t.jsx(MM,{pdfBlobUrl:u,pdfLoading:y,pdfError:I,url:e,fileName:M,page:l});case"office":return t.jsx(lM,{url:e});case"zip":return t.jsx(sM,{zipFiles:D,zipLoading:j,zipError:x,selectedZipFile:A,zipFileContent:Y,onFileClick:h,url:e});case"unknown":default:return t.jsx(zM,{url:e})}};return t.jsxs("div",{className:`document-viewer ${s||""}`,style:i,children:[r&&t.jsxs("div",{className:"document-viewer-toolbar",children:[t.jsxs("div",{className:"document-viewer-toolbar-meta",children:[t.jsx("span",{className:"document-viewer-toolbar-name",title:se,children:se}),t.jsx("span",{className:"document-viewer-toolbar-size",children:w})]}),t.jsxs(C.Space,{size:8,wrap:!0,children:[t.jsx(C.Button,{icon:t.jsx(Ae.DownloadOutlined,{}),size:"small",href:e,target:"_blank",rel:"noopener noreferrer",download:M||void 0,children:"下载"}),t.jsx(C.Dropdown.Button,{size:"small",icon:t.jsx(Ae.CopyOutlined,{}),menu:{items:V,onClick:le},disabled:Q,loading:S,onClick:Z,children:"复制"})]})]}),t.jsx("div",{className:"document-viewer-body",children:ee()})]})},lM=({url:n})=>{const e=`https://view.officeapps.live.com/op/embed.aspx?src=${encodeURIComponent(n)}`;return t.jsxs("div",{className:"document-viewer-office",children:[t.jsx("iframe",{src:e,className:"document-viewer-iframe",title:"Office Document Preview"}),t.jsx("div",{className:"document-viewer-fallback",children:t.jsx(C.Alert,{message:"预览可能不可用",description:t.jsx("a",{href:n,target:"_blank",rel:"noopener noreferrer",children:"点击下载文件"}),type:"info",showIcon:!0})})]})},zM=({url:n})=>t.jsx("div",{className:"document-viewer-unknown",children:t.jsx("iframe",{src:n,className:"document-viewer-iframe",title:"File Preview"})}),Vt=aM;const ue=n=>{var e;return t.jsx("button",re(E({},n),{className:`g-icon-btn disabled ${(e=n==null?void 0:n.className)!=null?e:""}`}))},jM=n=>{var d,L;const e=o.useRef(null),{className:M,headerClassName:s,style:i,visible:r,mode:l="normal",header:c,icons:a={collapseButton:t.jsx(Me,{type:"icon-yincang"}),expandButton:t.jsx(Me,{type:"icon-yincang"}),fullscreenButton:t.jsx(Me,{type:"icon-suofang"}),exitFullscreenButton:t.jsx(Me,{type:"icon-suofang"})},extraButtons:z=[],onNormalize:u,onMinimize:y,onMaximize:I}=n,[D,j]=o.useState(l==="max"),[x,A]=o.useState(l==="min"),Y=o.useRef(null),[h,p]=o.useState(l);o.useEffect(()=>{j(l==="max"),A(l==="min"),p(l)},[l]);const T=()=>{j(!D),p(D?"normal":"max"),D?u&&u():I&&I()},b=()=>{A(!x),p(x?"normal":"min"),x?u&&u():y&&y()};o.useEffect(()=>{Y.current&&D&&(Y.current.style.transform="none")},[D]);const B=(L=n.fullScreenContainer)!=null?L:(d=e.current)==null?void 0:d.parentElement,N=B==null?void 0:B.getBoundingClientRect(),U={position:"fixed",top:N==null?void 0:N.y,left:N==null?void 0:N.x,width:x?0:N==null?void 0:N.width,height:N==null?void 0:N.height};return t.jsxs("div",{className:"g-expandable-pannel-wrap",style:E({visibility:r!==!1?"visible":"hidden",position:D&&!x?"absolute":"unset"},D?U:null),ref:e,children:[!x&&t.jsxs("div",{className:`g-expandable-pannel ${D?"full":""} `,style:E({},i),children:[c!=null?c:t.jsx("div",{className:`g-expandable-pannel-header ${s!=null?s:""}`,children:t.jsx(ue,{onClick:T,children:D?a.exitFullscreenButton:a.fullscreenButton})}),t.jsx("div",{className:"g-expandable-pannel-body",children:n.children})]}),t.jsx("div",{className:`g-expandable-pannel-expand-bar ${x?"collapsed":"expaned"} ${s!=null?s:""}`,children:t.jsx(ue,{onClick:b,children:x?a.expandButton:a.collapseButton})})]})};const NM={stroke:"rgba(255, 77, 79, 0.25)",strokeWidth:1},$t=n=>{const{style:e,passes:M,scale:s,activePassId:i,passStyle:r,activePassStyle:l}=n;return t.jsx("svg",{className:"pass-map",style:e,children:M.map((c,a)=>{var u;const z=c.id===i?l:NM;return t.jsx("g",{children:t.jsx("polygon",{points:(u=c.points)==null?void 0:u.map(y=>`${y.x*s} ${y.y*s}`).join(","),style:E(E(E({},r),c.passStyle),z)})},a)})})};const uM=n=>{var y,I,D,j;const u=n,{children:e,open:M,point:s,key:i,style:r}=u,l=Ye(u,["children","open","point","key","style"]),[c,a]=o.useState(M&&s.tooltipOpen!==void 0?s.tooltipOpen:void 0),z=o.useRef(null);return o.useEffect(()=>{var Y,h;if(!s.tooltipRender||!z.current)return;const x=s.tooltipRender(s);if(typeof x=="string"||typeof x=="number"){z.current.innerText=x.toString();return}const A=(Y=z.current)==null?void 0:Y.firstChild;A?A.replaceWith(x):(h=z.current)==null||h.appendChild(x),console.log("tooltip inner text",s.id),console.log(new Date().valueOf())},[s.tooltipRender,c]),o.useEffect(()=>{a(s.tooltipOpen!==void 0?s.tooltipOpen&&M:void 0)},[s.tooltipOpen!==void 0?s.tooltipOpen&&M:void 0]),console.log("render PointTooltip",s.id),console.log(new Date().valueOf()),t.jsx(Qt,re(E({},l),{autoAdjustOverflow:!1,placement:"top",open:s.tooltipOpen!==void 0?s.tooltipOpen&&M:void 0,onOpenChange:x=>{var h,p;if(s.tooltipOpen||a(x),console.log("tooltip inner text",s.id),console.log(new Date().valueOf()),!s.tooltipRender||!z.current)return;const A=s.tooltipRender(s);if(typeof A=="string"||typeof A=="number"){z.current.innerText=A.toString();return}const Y=(h=z.current)==null?void 0:h.firstChild;Y?Y.replaceWith(A):(p=z.current)==null||p.appendChild(A)},color:((y=s.tooltipStyle)==null?void 0:y.backgroundColor)||((I=s.tooltipStyle)==null?void 0:I.backgroundImage)||((j=(D=s.tooltipStyle)==null?void 0:D.background)==null?void 0:j.toString()),title:t.jsx("div",{ref:z},i),overlayInnerStyle:s.tooltipStyle,destroyTooltipOnHide:!0,style:E({zIndex:9},r),motion:{forceRender:!0},children:e}))},gM=uM,dM={attributes:!0,characterData:!0},yM=n=>{const e=o.useRef(null),{point:M,open:s,id:i,x:r,y:l,r:c,active:a=!1,hidden:z=!1,onPointClick:u,getTooltipContainer:y}=n,[I,D]=o.useState(n.style),[j,x]=o.useState(!0);o.useEffect(()=>{const h=gn.diff(I,n.style);Object.keys(h).length&&D(n.style)},[n.style]);const A=o.useMemo(()=>t.jsx("circle",{id:`mark-${i}`,className:"point point-active",cx:r,cy:l,r:c,ref:e,style:I,onClick:()=>u&&u(M)}),[r,l,c,I,a]),Y=o.useMemo(()=>{const h=dn(()=>{x(!0),console.log("show tooltip",M.id),console.log(new Date().valueOf())},200);return new MutationObserver(()=>{console.log("circle is changed"),console.log("hide tooltip",M.id),console.log(new Date().valueOf()),x(!1),h()})},[]);return o.useEffect(()=>{if(!(!e.current||!M.tooltipRender))return Y.observe(e.current,dM),()=>{e.current&&Y.disconnect()}},[r,l,c]),z?t.jsx(t.Fragment,{}):M.tooltipRender&&j?t.jsx(gM,{open:s,point:M,getPopupContainer:y,children:A}):A},Et=yM,Ht=n=>{var Ue;const{width:e,height:M,points:s,scale:i,pointSize:r=6,direction:l,activePointId:c,style:a,lineStyle:z,pointStyle:u,directionStyle:y,marks:I,resizable:D,transform:j,keepRatio:x=!1,onPointClick:A,onTransform:Y,onPointsChange:h,onCancelResize:p,actions:T=!0,setIsSaved:b,isSaved:B=!1}=n,N=o.useRef(null),U=o.useRef(null),d=o.useRef(null),L=o.useRef(null),S=o.useRef(null),[_,se]=o.useState(null),[w,m]=o.useState((j==null?void 0:j.scale)||[1,1]),[Q,V]=o.useState((j==null?void 0:j.rotate)||0),[Z,je]=o.useState((j==null?void 0:j.translate)||[0,0,0,0]),[le,ee]=o.useState([]),[R,k]=o.useState(),[ce,oe]=o.useState(),[K,F]=o.useState(D),[De,J]=o.useState([]),[$,Te]=o.useState(s),[ge,Se]=o.useState(!0),[te,me]=o.useState(),[ie,de]=o.useState(),[Oe,Ze]=o.useState(typeof T!="boolean"?T:T===!0?{}:null),fe=(r-r/4*.9)*2/i;o.useEffect(()=>{Ze(typeof T!="boolean"?T:T===!0?{}:null)},[T]);const Ve=(g,f)=>{if(!g.length)return;let G;return g.map(v=>{var ae;if(!G){G=v;return}const H=t.jsx("line",{x1:Number.isFinite(G.x)?G.x:0,y1:Number.isFinite(G.y)?G.y:0,x2:Number.isFinite(v.x)?v.x:0,y2:Number.isFinite(v.y)?v.y:0,style:re(E(E({stroke:"#1F66E1BF"},z),G.lineStyle),{strokeWidth:Number((z==null?void 0:z.strokeWidth)||((ae=G.lineStyle)==null?void 0:ae.strokeWidth)||2)/f})},v.id);return G=v,H})},ve=new ResizeObserver(()=>{N.current&&(U.current&&(U.current.style.transform="none",U.current.style.width="auto",U.current.style.height="100%"),U.current&&(U.current.style.width="100%",U.current.style.height="100%"))});o.useEffect(()=>{var g;de((g=d.current)==null?void 0:g.getBoundingClientRect())},[a==null?void 0:a.left,a==null?void 0:a.top,a==null?void 0:a.width,a==null?void 0:a.height,i]),o.useEffect(()=>{F(D)},[D]),o.useEffect(()=>{Te(s||[])},[s,De]),o.useEffect(()=>{var g;(!((g=d.current)!=null&&g.style.transform)||d.current.style.transform==="none")&&(m((j==null?void 0:j.scale)||[1,1]),V((j==null?void 0:j.rotate)||0),je((j==null?void 0:j.translate)||[0,0,0,0]))},[(Ue=d.current)==null?void 0:Ue.style.transform]),o.useEffect(()=>{!d.current||K||(d.current.style.transform="none",m((j==null?void 0:j.scale)||[1,1]),V((j==null?void 0:j.rotate)||0),je((j==null?void 0:j.translate)||[0,0,0,0]))},[K]),o.useEffect(()=>{if(N.current)return ve.observe(N.current),()=>{N.current&&ve.unobserve(N.current)}},[N.current]),o.useEffect(()=>{!_||!j||(_.throttleDragRotate=j.rotate,_.throttleScale=j.scale,_.throttleDrag=j.translate)},[_,j]),o.useEffect(()=>{k($==null?void 0:$.find(f=>f.id===c));let g=$.map(f=>{var ae,Be,he;const G=f.x,O=f.y,v=f.id===c,H=r*(v?1.2:1)/i;return t.jsx(Et,{open:ge,id:f.id,point:f,getTooltipContainer:()=>S.current||document.body,x:G,y:O,r:u!=null&&u.r||(ae=f.pointStyle)!=null&&ae.r?Number((u==null?void 0:u.r)||((Be=f.pointStyle)==null?void 0:Be.r))/i:H/2,hidden:v,style:re(E(E({stroke:"#1F66E1BF",fill:"#fff",cursor:A?"pointer":"unset"},u),f.pointStyle),{strokeWidth:Number(((he=f.pointStyle)==null?void 0:he.strokeWidth)||2)/i,r:void 0}),onPointClick:A},f.id)})||[];ee(g)},[$,c,i,ge]),o.useEffect(()=>{var v,H,ae;if(!R){oe(void 0);return}const g=R.x,f=R.y,G=R.id===c,O=r*(G?1.2:1)/i;oe(t.jsxs("g",{children:[l!==void 0&&t.jsx("circle",{id:`mark-${R.id}`,cx:g,cy:f,r:`${fe}`,strokeDasharray:fe*2*Math.PI,strokeDashoffset:fe*2*Math.PI/360*(360-60),style:E({transform:`rotate(${l+240}deg)`,transformOrigin:`${g}px ${f}px`,strokeWidth:fe*2,stroke:"#1F66E1BF",fill:"transparent",pointerEvents:"none"},y)}),t.jsx(Et,{open:ge,point:R,getTooltipContainer:()=>S.current||document.body,x:g,y:f,r:(v=R.pointStyle)!=null&&v.r?Number((H=R.pointStyle)==null?void 0:H.r)/i:O/2,style:re(E(E({stroke:"#1F66E1BF",fill:"#fff"},u),R.pointStyle),{strokeWidth:Number(((ae=R.pointStyle)==null?void 0:ae.strokeWidth)||2)/i,r:void 0}),onPointClick:A},R.id)]},R.id))},[R,l,i,ge]),o.useEffect(()=>{d.current&&setTimeout(()=>{var g,f;me((g=d.current)==null?void 0:g.getBBox()),de((f=d.current)==null?void 0:f.getBoundingClientRect())},100)},[j]),o.useEffect(()=>{var f,G;if(!d.current)return;me((f=d.current)==null?void 0:f.getBBox()),de((G=d.current)==null?void 0:G.getBoundingClientRect()),new ResizeObserver(()=>{var O,v;me((O=d.current)==null?void 0:O.getBBox()),de((v=d.current)==null?void 0:v.getBoundingClientRect())}).observe(d.current)},[d.current]),o.useEffect(()=>{B&&(Ne(),b&&b(!1))},[B]);const Ne=()=>{var O;const g=(O=L.current)==null?void 0:O.getBoundingClientRect();if(!g){h&&h(s),F(!1);return}const f=De.map(v=>{const H=v.getBoundingClientRect();return{id:v.id.split("-")[1],x:(H.x+H.width/2-g.x)/i,y:(H.y+H.height/2-g.y)/i}}),G=s.map(v=>{const H=f==null?void 0:f.find(ae=>ae.id.toString()===v.id.toString());return H?E(E({},v),H):v});Te(G),h&&h(G.length?G.map((v,H)=>({id:v.id,x:v.x,y:v.y,order:H})):s),F(!1)},Le=g=>g.map(f=>{const{render:G,renderData:O}=f,v=f.x*i,H=f.y*i;return t.jsx(Qt,{className:"track-map-marker-tooltip",placement:"top",title:G(O,E({},f)),open:!!O,style:{zIndex:9999},children:t.jsx("circle",{id:`mark-${f.id}`,cx:v,cy:H,r:r/2,style:{stroke:"#1F66E100",strokeWidth:2,fill:"#fff0"},children:t.jsx("span",{children:O.label})})},f.id)}),be=te?{x:te.x+te.width/2,y:te.y+te.height/2}:{x:0,y:0},ke=$.reduce((g,f)=>[Math.min(g[0],f.x),Math.max(g[1],f.x)],[0,0]),Qe=$.reduce((g,f)=>[Math.min(g[0],f.y),Math.max(g[1],f.y)],[0,0]);return t.jsx(C.ConfigProvider,{prefixCls:"g-rc",children:t.jsxs("div",{className:"track-map",style:{width:"100%",height:"100%"},ref:N,children:[t.jsx("svg",{style:a,ref:L,viewBox:`0 0 ${e} ${M}`,children:t.jsxs("g",{ref:d,x:ke[0],y:Qe[0],width:ke[1]-ke[0],height:Qe[1]-Qe[0],style:{transformOrigin:`${be.x}px ${be.y}px`,cursor:K?"url('./images/icon-move.svg') 16 16, move":"unset",transform:j&&j.scale?`${j.translate?` translate(${j.translate[0]}px, ${j.translate[1]}px)`:""} rotate(${j.rotate}rad)${j.scale?` scale(${j.scale[0]}, ${j.scale[1]})`:""}`:"none"},children:[te&&t.jsx("rect",{x:te.x,y:te.y,width:te.width,height:te.height,fill:"#ff000004"}),t.jsx("g",{className:"track-lines",children:Ve(($==null?void 0:$.filter(g=>g.order>-1))||[],i)}),t.jsxs("g",{className:"track-points",children:[le,ce]}),I&&t.jsx("g",{children:Le(I)})]})}),t.jsx("div",{className:"tooltip-container",ref:S,style:{position:"fixed",top:(ie==null?void 0:ie.y)||0,left:(ie==null?void 0:ie.x)||0,width:(ie==null?void 0:ie.width)||0,height:(ie==null?void 0:ie.height)||0}}),K&&d.current&&L.current&&t.jsx(un,{className:"path-moveable-control-box",ref:g=>{se(g)},keepRatio:x,target:[d.current],draggable:!0,scalable:!0,rotatable:!0,padding:{left:10,right:10,top:10,bottom:10},onDrag:({target:g,beforeDelta:f,beforeDist:G,left:O,top:v,right:H,bottom:ae,delta:Be,dist:he,transform:pe,clientX:nt,clientY:Mt})=>{je(he),g.style.transform=pe},onDragStart:({inputEvent:g})=>{g.stopPropagation()},onDragEnd:()=>{var f;const g=(f=d.current)==null?void 0:f.getElementsByTagName("circle");J(g!=null&&g.length?[...g]:[]),Y&&Y({rotate:Q,translate:Z,scale:w},g!=null&&g.length?[...g]:[],L.current||void 0)},renderDirections:x?["nw","ne","sw","se"]:["n","w","e","s","nw","ne","sw","se"],onScale:({target:g,scale:f,transform:G})=>{var v;m(f),g.style.transform=G;const O=(v=d.current)==null?void 0:v.getElementsByTagName("circle");J(O!=null&&O.length?[...O]:[]),Y&&Y({rotate:Q,translate:Z,scale:f},O!=null&&O.length?[...O]:[],L.current||void 0)},onRotate:({target:g,dist:f,transform:G})=>{var v;V(f),g.style.transform=G;const O=(v=d.current)==null?void 0:v.getElementsByTagName("circle");J(O!=null&&O.length?[...O]:[]),Y&&Y({rotate:f,translate:Z,scale:w},O!=null&&O.length?[...O]:[],L.current||void 0)},onRenderEnd:()=>{var f,G,O;const g=(f=d.current)==null?void 0:f.getElementsByTagName("circle");Y&&Y({rotate:Q,translate:Z,scale:w},g!=null&&g.length?[...g]:[],L.current||void 0),me((G=d.current)==null?void 0:G.getBBox()),de((O=d.current)==null?void 0:O.getBoundingClientRect())}})]})})},Ct=n=>{const{name:e,type:M,style:s,className:i,children:r,onConfirm:l}=n,[c,a]=o.useState(null);return o.useEffect(()=>{if(!n.confirm){a(null);return}if(n.confirm===!0){a({text:`确认${e}吗?`});return}a(n.confirm)},[n.confirm]),c?t.jsx(yn,{rootClassName:"track-map-popconfirm",okText:"确定",cancelText:"取消",title:c.text,trigger:"click",onConfirm:l,children:t.jsx(Xe,{className:i,type:M,style:E({},s),children:r||e})}):t.jsx(Xe,{className:i,type:M,onClick:l,children:r||e})};let St;const DM=o.forwardRef((n,e)=>{var ot,it,rt,ct,at,lt,zt,jt,Nt,ut,gt,dt,yt,Dt,It,xt,Tt,wt,At,mt,ft;const{url:M,points:s,pointSize:i,direction:r,activePointId:l,lineStyle:c,pointStyle:a,directionStyle:z,onPointClick:u,passes:y,activePassId:I,passStyle:D,activePassStyle:j,marks:x,draggable:A=!1,offsetEdge:Y=[50,50,50,50],zoomable:h=!1,zoomStep:p=.02,zoomMax:T=2,zoomMin:b=0,onImageLoad:B,trackEditable:N,trackEditing:U,keepRatio:d,transform:L,onTrackEditingChange:S,onTransform:_,onPointsChange:se,actions:w=!0}=n,m=o.useRef({}),Q=o.useRef({}),[V,Z]=o.useState(0),[je,le]=o.useState(0),[ee,R]=o.useState(1),[k,ce]=o.useState(0),[oe,K]=o.useState(0),[F,De]=o.useState(0),[J,$]=o.useState(0),[Te,ge]=o.useState(!1),[Se,te]=o.useState(!1),[me,ie]=o.useState(),[de,Oe]=o.useState({x:0,y:0}),[Ze,fe,Ve,ve]=Y,[Ne,Le]=o.useState(U),[be,ke]=o.useState(1),[Qe,Ue]=o.useState(!1),[g,f]=o.useState(typeof w!="boolean"?w:w===!0?{}:null);o.useEffect(()=>{ke(Math.round(ee*100)/100)},[ee]),o.useEffect(()=>{Le(U)},[U]),o.useEffect(()=>{St=new ResizeObserver(G),St.observe(Q.current);const P=W=>(W.preventDefault(),!1);return Q.current.addEventListener("wheel",P),()=>{Q.current.removeEventListener("wheel",P)}},[]);const G=()=>{if(!Q.current)return;const P=Q.current.clientWidth,W=Q.current.clientHeight,q=m.current.naturalWidth,ne=m.current.naturalHeight,we=P/q,$e=W/ne,Re=we<$e?we:$e,Kt=(P-q*Re)/2,qt=(W-ne*Re)/2,en=q*Re,tn=ne*Re;Z(P),le(W),R(Re),ce(Kt),K(qt),De(en),$(tn),ge(!0),B&&B(m.current)},O=()=>{if(!h||ee>=T)return;let P=ee*(1+p),W=p;P>=T&&(P=T,W=T/ee-1),ce(k-F*(W/2)),K(oe-J*(W/2)),De(F+F*W),$(J+J*W),R(P),pe()},v=()=>{if(!h||ee<=b)return;let P=ee*(1-p),W=p;P<=b&&(P=b,W=1-b/ee),ce(k-F*(-W/2)),K(oe-J*(-W/2)),De(F+F*-W),$(J+J*-W),R(P),pe()};o.useImperativeHandle(e,()=>({zoomIn:O,zoomOut:v}));const H=P=>(P.nativeEvent.deltaY<0?O():v(),!1),ae=P=>{te(!0);const{pageX:W,pageY:q}=P;Oe({x:W,y:q})},Be=P=>{if(!Se)return!1;const{pageX:W,pageY:q}=P,ne=W-de.x,we=q-de.y;Oe({x:W,y:q}),ce(k+ne),K(oe+we),pe()},he=()=>{te(!1)};window.onmouseup=()=>{te(!1)};const pe=()=>{k<-F+ve&&ce(-F+ve),oe<-J+Ze&&K(-J+Ze),k>V-fe&&ce(V-fe),oe>je-Ve&&K(je-Ve)},nt=()=>{Le(!Ne),S&&S(!Ne)},Mt=P=>{const{touches:W}=P;if(console.log("onTouchStart"),console.log(W),te(!0),W.length<2){const{clientX:q,clientY:ne}=W[0];Oe({x:q,y:ne})}else ie(W)},Jt=P=>{if(!Se||!P.touches)return!1;const{clientX:W,clientY:q}=P.touches[0];if(P.touches.length<2){const ne=W-de.x,we=q-de.y;Oe({x:W,y:q}),ce(k+ne),K(oe+we),pe()}else{console.log("onTouchMove"),console.log(P.touches);const ne=P.touches,we=st(ne[0],ne[1]),$e=st(me[0],me[1]);we>$e?O():v()}},st=(P,W)=>{const q=W.pageX-P.pageX,ne=W.pageY-P.pageY;return Math.sqrt(q*q+ne*ne)};o.useEffect(()=>{f(typeof w!="boolean"?w:w===!0?{}:null)},[w]);const _t=()=>{Le(!1),S&&S(!1)},Xt=()=>{Ue(!0)};return t.jsxs("div",{className:"image-map",ref:Q,onMouseDown:A?ae:void 0,onMouseMove:A?Be:void 0,onMouseUp:A?he:void 0,onWheel:A?H:void 0,onTouchStart:A?Mt:void 0,onTouchMove:A?Jt:void 0,onTouchEnd:A?he:void 0,children:[t.jsx("img",{className:"img",style:{position:"absolute",left:k,top:oe,width:F,height:J},ref:m,onLoad:G,src:M,alt:""}),Te&&(y==null?void 0:y.length)&&t.jsx($t,{style:{position:"absolute",left:k,top:oe,width:F,height:J},passes:y,scale:ee,activePassId:I,passStyle:D,activePassStyle:j}),Te&&!!(s!=null&&s.length)&&t.jsx(Ht,{style:{position:"absolute",left:k,top:oe,width:F,height:J,overflow:"visible"},width:m.current.naturalWidth,height:m.current.naturalHeight,transform:L,movable:Ne,resizable:Ne,points:s,scale:ee,pointSize:i,direction:r,activePointId:l,lineStyle:c,pointStyle:a,directionStyle:z,keepRatio:d,marks:x,onPointClick:u,onTransform:_,onPointsChange:P=>{se&&se(P),Le(!1),S&&S(!1)},onCancelResize:()=>{Le(!1),S&&S(!1)},actions:w,setIsSaved:Ue,isSaved:Qe}),N&&t.jsxs("div",{className:"image-map-toolbar",children:[t.jsx(Ft,{className:"zoom-controller",value:be,min:b,max:T,step:p,showText:!0,onChange:P=>{be>P?v():O()}}),N&&(Ne&&w?t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"line"}),t.jsxs("div",{className:"editing-controller",children:[t.jsx(Ct,{children:typeof w!="boolean"&&((ot=w.cancelButton)==null?void 0:ot.children)||void 0,name:typeof w!="boolean"&&((it=w.cancelButton)==null?void 0:it.text)||"退出编辑",className:`editing-controller${Ne?" active":""} ${typeof w!="boolean"&&((rt=w.cancelButton)==null?void 0:rt.className)||""}`,confirm:((ct=g==null?void 0:g.cancelButton)==null?void 0:ct.confirm)===!0?{text:"调整记录将不被保存"}:(at=g==null?void 0:g.cancelButton)!=null&&at.confirm?g.cancelButton.confirm:!1,style:typeof w!="boolean"&&((lt=w.cancelButton)==null?void 0:lt.style)||void 0,onConfirm:_t}),t.jsx(Ct,{type:"primary",children:typeof w!="boolean"&&((zt=w.okButton)==null?void 0:zt.children)||t.jsxs("div",{className:"save-detail",children:[t.jsx(Ae.SaveOutlined,{}),t.jsx("span",{children:"保存"})]}),name:typeof w!="boolean"&&((jt=w.okButton)!=null&&jt.confirm)?((Nt=w.okButton)==null?void 0:Nt.text)||"保存":"确定",className:`editing-controller${Ne?" active":""} ${typeof w!="boolean"&&((ut=w.okButton)==null?void 0:ut.className)||""}`,confirm:((gt=g==null?void 0:g.okButton)==null?void 0:gt.confirm)===!0?{text:"调整记录保存后,将改变当前巡检数据状态"}:(dt=g==null?void 0:g.okButton)!=null&&dt.confirm?g.okButton.confirm:!1,style:typeof w!="boolean"&&((yt=w.okButton)==null?void 0:yt.style)||void 0,onConfirm:Xt})]})]}):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"line"}),t.jsx("div",{className:"moveable-controller",children:t.jsx(Xe,{title:Ne?typeof w!="boolean"&&((Dt=w.editButton)==null?void 0:Dt.exitTitleText)||"退出编辑":typeof w!="boolean"&&((It=w.editButton)==null?void 0:It.titleText)||"调整轨迹",className:`moveable-controller-btn${Ne?" active":""} ${typeof w!="boolean"&&((xt=w.editButton)==null?void 0:xt.className)||""}`,style:typeof w!="boolean"&&((Tt=w.editButton)==null?void 0:Tt.style)||void 0,onClick:nt,children:typeof w!="boolean"?(wt=w.editButton)!=null&&wt.children?(At=w.editButton)==null?void 0:At.children:(mt=w.editButton)!=null&&mt.text?t.jsx("span",{children:(ft=w.editButton)==null?void 0:ft.text}):t.jsxs("div",{className:"btn-change",children:[t.jsx(Me,{type:"icon-tiaozheng"}),t.jsx("span",{children:"修改"})]}):void 0})})]}))]})]})}),IM=n=>{const{className:e,style:M,length:s=0,current:i=0,speed:r=2e3,play:l=!1,loop:c=!1,loading:a=!1,onChange:z}=n,[u,y]=o.useState(l),[I,D]=o.useState(i),[j,x]=o.useState(null);o.useEffect(()=>{D(i)},[i]),o.useEffect(()=>{y(l)},[l]),o.useEffect(()=>{u?A():I>=s-1&&(D(0),z(0))},[u]),o.useEffect(()=>{u&&(a?j&&(clearTimeout(j),x(null)):x(setTimeout(A,r)))},[a]);const A=()=>{D(p=>p<s-1?(z(p+1),p+1):c?(z(0),0):(h(),p))},Y=()=>{I>=s-1&&D(0),y(!0)},h=()=>{y(!1),j&&(clearTimeout(j),x(null))};return t.jsxs("div",{className:e,style:M,children:[t.jsx(ue,{disabled:I<=0||a,onClick:()=>{z(0),D(0)},children:t.jsx(Me,{type:"icon-diyige"})}),t.jsx(ue,{disabled:I<=0||a,onClick:()=>{z(I-1),D(I-1)},children:t.jsx(Me,{type:"icon-qianyige"})}),u?t.jsx(ue,{onClick:h,children:t.jsx(Me,{type:"icon-zanting"})}):t.jsx(ue,{disabled:I>=s-1||a,onClick:Y,children:t.jsx(Me,{type:"icon-bofang"})}),t.jsx(ue,{disabled:I>=s-1||a,onClick:()=>{z(I+1),D(I+1)},children:t.jsx(Me,{type:"icon-xiayige"})}),t.jsx(ue,{disabled:I>=s-1||a,onClick:()=>{z(s-1),D(s-1)},children:t.jsx(Me,{type:"icon-zuihouyige"})})]})};const xM=16,TM=16,wM=-1,AM=1,mM=-1,fM=1,LM=n=>{const e=n||window.event,M=n.target||n.srcElement;if(e.offsetX)return e.offsetX;{const s=M.getBoundingClientRect();return e.clientX-s.left}},hM=n=>{const e=n||window.event,M=n.target||n.srcElement;if(e.offsetY)return e.offsetY;{const s=M.getBoundingClientRect();return e.clientY-s.top}},YM=n=>{const e=n.split("-");let M=e.length>1||e[0]==="left"||e[0]==="right"?e[0]:"center",s=e.length>1?e[1]:e[0]==="top"||e[0]==="bottom"?e[0]:"middle";return[M,s]},pM=(n,e,M=[xM,TM])=>{const s=()=>{switch(n[0]){case"left":return wM;case"right":return AM;default:return 0}},i=()=>{switch(n[1]){case"top":return mM;case"bottom":return fM;default:return 0}},r=()=>{switch(n[0]){case"left":return-((e==null?void 0:e.width)||0)-M[0]-2;case"right":return 0;default:return-((e==null?void 0:e.width)||0)/2}},l=()=>{switch(n[1]){case"top":return-M[1]-2;case"bottom":return(e==null?void 0:e.height)||0;default:return((e==null?void 0:e.height)||0)/2}};return{x:M[0]*s()+r(),y:M[1]*i()+l()}},EM=n=>{var T;const{children:e,defaultPosition:M,forElement:s,placement:i="right-bottom",curserPosition:r,className:l,style:c}=n,a=o.useRef(null),z=o.useRef(null),u=s||document.body,y=YM(i),I=pM(y,(T=z.current)==null?void 0:T.getBoundingClientRect(),r),[D,j]=o.useState(n.visible||!0),[x,A]=o.useState(M||{x:-2e3,y:-2e3});o.useEffect(()=>(u.addEventListener("mouseenter",Y),u.addEventListener("mousemove",p),u.addEventListener("mouseleave",h),()=>{u.removeEventListener("mouseenter",Y),u.removeEventListener("mousemove",p),u.removeEventListener("mouseleave",h)}),[u]),o.useEffect(()=>{j(n.visible||!0)},[n.visible]);const Y=()=>{j(!0)},h=()=>{j(!1)},p=b=>{let B=LM(b)+I.x;const N=hM(b)+I.y;A({x:B,y:N})};return t.jsx("div",{className:`g-mouse-tip ${y.join(" ")}`,ref:a,style:{left:`${x.x}px`,top:`${x.y}px`,visibility:`${D?"visible":"hidden"}`},children:t.jsx("div",{className:`g-mouse-tip-content ${l}`,style:c,ref:z,children:e})})},Ft=n=>{const{className:e,style:M,value:s,min:i,max:r,step:l=1,onChange:c,showText:a=!1}=n,[z,u]=o.useState(s!=null?s:0);return o.useEffect(()=>{u(s!=null?s:0)},[s]),t.jsxs("div",{className:e,style:M,children:[t.jsx(ue,{disabled:!!(r&&r<=z),onClick:()=>{c(z+l),u(z+l)},children:t.jsx(Me,{type:"icon-fangda"})}),a&&t.jsxs("div",{style:{width:40,textAlign:"center"},children:[Math.round(z*100),"%"]}),t.jsx(ue,{disabled:!!(i&&i>=z),onClick:()=>{c(z-l),u(z-l)},children:t.jsx(Me,{type:"icon-suoxiao"})})]})};function CM(n,e){var M=document.getElementsByTagName("body")[0],s=document.createElement("script");s.setAttribute("type","text/javascript"),s.setAttribute("src",n),M.appendChild(s),s.onload=e}function SM(n){const[e,M]=o.useState(!1),[s,i]=o.useState(),[r,l]=o.useState(),[c,a]=o.useState(!1),[z,u]=o.useState(),[y,I]=o.useState([]),[D,j]=o.useState(0);function x(N){if(N.viewType!="3DView"){console.error("bimface view type is not 3DView");return}M(!0),z&&A(N.viewToken)}const A=N=>{if(!s){let U=z,d=new window.Glodon.Bimface.Application.WebApplication3DConfig;d.domElement=U,d.Toolbars=[];const L=new window.Glodon.Bimface.Application.WebApplication3D(d);L.addView(N),i(L);const S=L.getViewer();S.addEventListener(window.Glodon.Bimface.Viewer.Viewer3DEvent.ViewAdded,function(){window.onresize=function(){S.resize(document.documentElement.clientWidth,document.documentElement.clientHeight-40)},S.setCameraAnimation(!1),S.render(),S.setNavigationMode(window.Glodon.Bimface.Viewer.NavigationMode3D.Walk),S.render(),a(!0)}),S.addEventListener(window.Glodon.Bimface.Viewer.Viewer3DEvent.ModelAdded,()=>{j(_=>_+1)}),l(S)}};o.useEffect(()=>{c&&y.forEach(N=>{r.loadModel({viewToken:N})})},[c,y]),o.useEffect(()=>{},[D]),o.useEffect(()=>{if(!z||!y.length)return;const N=y.pop();N&&h(N),I([...y])},[z]);function Y(N){console.log(N)}function h(N){j(0);const U=()=>{let d=new window.BimfaceSDKLoaderConfig;d.viewToken=N,window.BimfaceSDKLoader.load(d,x,Y)};if(!window.BimfaceSDKLoaderConfig){CM("https://static.bimface.com/api/BimfaceSDKLoader/BimfaceSDKLoader@latest-release.js",U);return}U()}const p=(N,U)=>{if(!r||!c||!z){console.error("BIMFace viewer is not ready.");return}const d=z.getElementsByTagName("canvas")[0],L=document.createElement("canvas");L.width=d.width,L.height=d.height;const S=L.getContext("2d");return S&&(S.fillStyle="#fff",S.fillRect(0,0,L.width,L.height),S.drawImage(d,0,0,d.width,d.height)),L.toDataURL(N,U)},T=N=>{if(!r){console.error("viewer is not ready");return}if(D&&y.length+1===D||!y.length)r.getAllModels().map(L=>r._models[L.modelId]).forEach(L=>{let S=new window.Glodon.Web.Graphics.Color(N);L.overrideAllComponentsColor&&L.overrideAllComponentsColor(S)}),r.enableWireframe(!0),r.getLightManager().getAllFillLights().forEach(L=>L.enableLight(!0)),r.render();else{console.error("viewer is not render complete");return}},b=N=>{if(r)if(D&&y.length+1===D||!y.length)r.getAllModels().map(L=>r._models[L.modelId]).forEach(L=>{Object.keys(N).forEach(S=>{let _=[{categoryId:S}];L.getComponentsByConditions(_,function(se){let w=new window.Glodon.Web.Graphics.Color(N[S]);L.overrideComponentsColorById&&L.overrideComponentsColorById(se,w)},function(){window.alert("error")})})}),r.enableWireframe(!1),r.getLightManager().getAllFillLights().forEach(L=>L.enableLight(!1)),r.render();else{console.error("viewer is not render complete");return}};function B(N,U,d){const L=r.getModel();L==null||L.getBoundingBox(({currentBoundingBox:S})=>{const _=S.max.x-S.min.x,se=S.max.y-S.min.y,w=_/se;let m,Q;w>1?(m=U.width,Q=m/w):(Q=U.height,m=Q*w);const V=document.createElement("div");V.setAttribute("style",`width: ${m}px;height: ${Q}px`),document.body.appendChild(V);const Z=new window.Glodon.Bimface.Plugins.NavigationMap.MapViewerConfig;Z.domElement=V;const je=new window.Glodon.Bimface.Plugins.NavigationMap.MapViewer(Z),le=new window.Glodon.Bimface.Plugins.NavigationMap.NavigationMapConfig;le.viewer=r,le.mapViewer=je,le.type="SetProfile",le.height=N,le.successCallback=ee=>{setTimeout(()=>{const R=new Image;R.src=V.getElementsByTagName("image")[0].getAttribute("href")||"",R.onload=()=>{d(R)}},200)},new window.Glodon.Bimface.Plugins.NavigationMap.NavigationMap(le)})}return{BimfaceViewer:e&&window.Glodon.Bimface.Viewer,BimfaceSection:e&&window.Glodon.Bimface.Plugins.Section,BimfaceMark:e&&window.Glodon.Bimface.Plugins.Marker3D,BimfaceViewerEvents:e&&window.Glodon.Bimface.Viewer.Viewer3DEvent,viewer:r,viewerAdded:c,sDKLoaded:e,loadedModelCount:D,loadModels:N=>{if(N!=null&&N.length||console.error("viewTokens is Empty"),!r&&z){const U=N[0];h(U)}I(N)},setContainerDom:u,getSnapshot:p,setComponentsColorByCatgryId:b,setAllComponentsColor:T,navigationMapByHeight:B}}function OM(n){const{url:e,onScaleChange:M,onLoad:s}=n,i=o.useRef(null),r=Ut.useSize(i),l=r==null?void 0:r.width,c=r==null?void 0:r.height,[a,z]=o.useState();return o.useEffect(()=>{l&&c&&a&&M(l/a.width,l,c)},[l,c,a]),t.jsx("img",{ref:i,src:e,className:"select-none",style:{maxWidth:"100%",maxHeight:"100%",cursor:"crosshair"},alt:"",onLoad:()=>{if(i.current){s&&s(i.current);const{naturalWidth:u,naturalHeight:y}=i.current;z({width:u,height:y})}}})}function Ot(n){const{start:e,end:M}=n,{options:{lineColor:s,lineWidth:i}}=o.useContext(Ge);return t.jsx(t.Fragment,{children:t.jsx("line",{x1:e.x,y1:e.y,x2:M.x,y2:M.y,stroke:s!=null?s:"#FF5500",strokeWidth:i!=null?i:2})})}function vt(n){const{markRenderer:e,marker:M}=n,{point:{x:s,y:i}}=M;return t.jsxs("g",{children:[t.jsx("line",{}),t.jsx("line",{}),t.jsx("circle",{cx:s,cy:i,r:1,fill:"transparent"}),t.jsx("foreignObject",{x:s,y:i,width:0,height:0,fill:"green",className:"relative overflow-visible",children:t.jsx("div",{className:"inline-flex absolute",draggable:!0,onDragStart:()=>{},onDragEnd:()=>{},children:e&&e(M)})})]})}function bt(n){const{points:e,editing:M,options:s,onClose:i}=n,[r,l]=o.useState(!1),{options:{polygon:c}}=o.useContext(Ge);if(!M&&Ke(e)<=2)return null;const a=xn(e),z=e.map(({x:h,y:p})=>`${h},${p}`).join(" "),u=a?`${z} ${a.x},${a.y}`:z,{showVertexIndex:y,vertexBgColor:I,vertexTextColor:D}=c!=null?c:{},j=y?10:5,x=M||y,{hideBorder:A,backgroundColor:Y}=s!=null?s:{};return t.jsxs(t.Fragment,{children:[t.jsx("polygon",{points:`${u}`,fill:Y!=null?Y:"rgba(255, 66, 66, 0.15)"}),!A&&t.jsx("polyline",{points:M?z:u,fill:"transparent",stroke:"#FF5500",strokeDasharray:"6 4",strokeWidth:"2"}),!A&&(e==null?void 0:e.map(({x:h,y:p},T)=>{const b=T===Ke(e)-1;return t.jsx("g",{style:{zIndex:b?1:100,cursor:"pointer",pointerEvents:b?"none":"bounding-box"},onMouseEnter:B=>{b||l(!0)},onMouseLeave:B=>{l(!1)},onClick:B=>{B.stopPropagation()},onDoubleClick:B=>{B.stopPropagation(),i&&i(T)},children:x&&(!b||!r)&&t.jsxs(t.Fragment,{children:[t.jsx("circle",{cx:h,cy:p,r:j,fill:I!=null?I:"#FF5500"}),y&&t.jsx("text",{x:h,y:p,"text-anchor":"middle",fill:D!=null?D:"#fff",dy:".3em",style:{cursor:"pointer",userSelect:"none"},children:T+1})]})})}))]})}const vM=Fe.createMachine({initial:"idle",context:{},states:{idle:{on:{START_ADD_MARKER:{target:"addingMarker"},START_DRAW_LINE:{target:"drawingLine"},START_DRAW_POLYGON:{target:"drawingPolygon"}}},addingMarker:{on:{RESET:{target:"idle",actions:Ie.assign(n=>{n.markerPoint=void 0})},ADD_MARKER:{target:"drawCompleted",actions:[Ie.assign((n,{point:e})=>{n.markerPoint=e}),"onAddMarker"]},MOUSE_MOVE:{target:"addingMarker",actions:Ie.assign((n,{point:e})=>{n.movingPoint=e})}}},drawingLine:{on:{ADD_LINE_START:{target:"drawingLine",actions:Ie.assign((n,e)=>{n.lineStart=e.point})},ADD_LINE_END:{target:"drawCompleted",actions:[Ie.assign((n,e)=>{n.lineEnd=e.point}),"onAddLine"]},MOUSE_MOVE:{target:"drawingLine",actions:Ie.assign((n,{point:e})=>{n.movingPoint=e})},RESET:{target:"drawCompleted"},CANCEL:{target:"drawCompleted"}}},drawingPolygon:{on:{CANCEL:{target:"canceled"},RESET:{target:"idle",actions:Ie.assign(n=>{n.polygonPoints=void 0})},ADD_POLYGON_POINT:{target:"drawingPolygon",actions:Ie.assign((n,{point:e})=>{var M;n.polygonPoints=(M=n.polygonPoints)!=null?M:[],n.polygonPoints.push(e)})},MOUSE_MOVE:{target:"drawingPolygon",actions:Ie.assign((n,{point:e})=>{n.movingPoint=e})},DRAW_POLYGON_COMPLETE:{target:"drawCompleted",actions:["onAddPolygon"]}}},drawCompleted:{always:{target:"idle"}},canceled:{}}});function bM(n){const{state:e,scale:M,width:s,height:i,drawOptions:r,lines:l,polygons:c,markers:a,markRenderer:z,onAddLine:u,onAddPolygon:y,onAddMarker:I,onStateChange:D}=n,[j,x]=o.useState([]),[A,Y]=o.useState([]),[h,p]=o.useState([]),T=o.useRef(null),{width:b,height:B}=Ut.useSize(T)||{};function N({x:m,y:Q}){return{x:m/M,y:Q/M}}function U({x:m,y:Q}){return{x:m*M,y:Q*M}}const[d,L]=In.useMachine(vM,{actions:{onAddMarker:Fe.assign(({markerPoint:m})=>(I&&m&&I(N(m)),{markerPoint:void 0,movingPoint:void 0})),onAddLine:Fe.assign(m=>(m.lineStart&&m.lineEnd&&u&&u(N(m.lineStart),N(m.lineEnd)),{lineEnd:void 0,lineStart:void 0,movingPoint:void 0})),onAddPolygon:Fe.assign(({polygonPoints:m})=>(y&&m&&m.length>2&&y(m.map(N)),{polygonPoints:void 0,movingPoint:void 0}))},services:{}});o.useEffect(()=>{var m;x((m=l==null?void 0:l.map(({id:Q,start:V,end:Z})=>({id:Q,start:U(V),end:U(Z)})))!=null?m:[])},[l]),o.useEffect(()=>{var m;p((m=a==null?void 0:a.map(Q=>re(E({},Q),{point:U(Q.point)})))!=null?m:[])},[a]),o.useEffect(()=>{var m;Y((m=c==null?void 0:c.map(({id:Q,points:V,options:Z})=>({id:Q,points:V.map(U),options:Z})))!=null?m:[])},[c,M]),o.useEffect(()=>{D&&d.matches("idle")&&D("viewOnly")},[d.value]),o.useEffect(()=>{if(D)switch(e){case"drawingLine":L("START_DRAW_LINE");break;case"drawingPolygon":L("START_DRAW_POLYGON");break;case"addingMarker":L("START_ADD_MARKER");break}},[e]);const{lineStart:S,lineEnd:_,polygonPoints:se,movingPoint:w}=d.context;return t.jsx(Ge.Provider,{value:{options:r!=null?r:{}},children:t.jsx("div",{ref:T,className:"w-full h-full absolute left-0 top-0",style:{cursor:e==="viewOnly"?void 0:"crosshair",width:s,height:i},children:b&&B&&t.jsxs("svg",{viewBox:`0 0 ${b} ${B}`,version:"1.1",className:"absolute inset-0",onClick:m=>{if(!T.current)return;const{top:Q,left:V}=T.current.getBoundingClientRect(),Z={x:m.clientX-V,y:m.clientY-Q};d.matches("drawingLine")?L(S===void 0?{type:"ADD_LINE_START",point:Z}:{type:"ADD_LINE_END",point:Z}):d.matches("drawingPolygon")?L({type:"ADD_POLYGON_POINT",point:Z}):d.matches("addingMarker")&&L({type:"ADD_MARKER",point:Z})},onMouseMove:m=>{if(!T.current)return;const{top:Q,left:V}=T.current.getBoundingClientRect(),Z={x:m.clientX-V,y:m.clientY-Q};L({type:"MOUSE_MOVE",point:Z})},children:[j==null?void 0:j.map((m,Q)=>t.jsx(Ot,E({},m),Q)),S&&w&&t.jsx(Ot,{start:S,end:w}),A==null?void 0:A.map(({points:m,options:Q},V)=>t.jsx(bt,{editing:!1,points:m,options:Q},V)),Ke(se)>0&&w&&t.jsx(bt,{editing:!0,points:[...se,w],onClose:m=>{L({type:"DRAW_POLYGON_COMPLETE"})}}),h==null?void 0:h.map(m=>t.jsx(vt,{marker:m,markRenderer:z})),d.matches("addingMarker")&&w&&t.jsx(vt,{marker:{id:"addingMarker",point:w}})]})})})}function et(n,e,M){if(M)return Math.abs(et(n,M)-et(e,M));for(var s=Math.atan2(e.y-n.y,e.x-n.x);s<0;)s+=2*Math.PI;return s}const Ge=o.createContext({options:{}});Ge.displayName="DrawableContext";function kM(n){const r=n,{url:e}=r,M=Ye(r,["url"]),[s,i]=Dn.useImmer({scale:1,width:0,height:0});return e?t.jsxs("div",{className:"relative bg-pink-500 bg-opacity-40",children:[t.jsx(OM,{url:e,onScaleChange:(l,c,a)=>{i(z=>{z.scale=l,z.width=c,z.height=a})}}),t.jsx(bM,E(E({},M),s))]}):null}exports.Button=Tn;exports.Copy=Rt;exports.DocumentViewer=Vt;exports.DrawableContext=Ge;exports.DrawableImageMap=kM;exports.ExpandablePannel=jM;exports.IconButton=ue;exports.Iconfont=Me;exports.ImageMap=DM;exports.Markdown=Gt;exports.MarkdownATag=Wt;exports.MarkdownCode=Pt;exports.MarkdownImage=Bt;exports.MarkdownVideo=tt;exports.MouseTip=EM;exports.PanoramaRecordPlayer=IM;exports.PassMap=$t;exports.TrackMap=Ht;exports.Zoom=Ft;exports.calAngle=et;exports.useBimface=SM;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@glodon-aiot/react-components",
3
- "version": "3.11.0-snapshot.1765331449",
3
+ "version": "3.11.0",
4
4
  "author": "glodoncv",
5
5
  "description": "aiot react components",
6
6
  "type": "module",