@oscloudlab/knowledge-card 0.0.7 → 0.0.8
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.
|
@@ -282,4 +282,4 @@ var kse=function(){return kse=Object.assign||function(e){for(var t,n=1,r=argumen
|
|
|
282
282
|
Copyright (c) 2018 Jed Watson.
|
|
283
283
|
Licensed under the MIT License (MIT), see
|
|
284
284
|
http://jedwatson.github.io/classnames
|
|
285
|
-
*/!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,r(n)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var r="";for(var i in e)t.call(e,i)&&e[i]&&(r=o(r,i));return r}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(classnames);var classnamesExports=classnames.exports;const classNames=getDefaultExportFromCjs(classnamesExports),Show=e=>{const{height:t="300px",value:n,maskTip:r=!1,maskClick:o}=e,i=React.useRef(null),a=React.useRef(null);React.useEffect(()=>(i.current&&l(i.current),()=>{var e;null==(e=a.current)||e.dispose()}),[]);const s=React.useRef(null);React.useEffect(()=>{var e,t;return(null==n?void 0:n.cells)&&(null==(e=a.current)||e.fromJSON(n.cells),null==(t=a.current)||t.centerContent(),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{var e;null==(e=a.current)||e.zoomToFit({maxScale:1,padding:20})},500)),()=>{s.current&&clearTimeout(s.current)}},[n]);const l=e=>{a.current=new Graph({container:e,autoResize:!0,background:{color:"#ffffff"},grid:{visible:!0,size:10,type:"dot",args:{color:"#a0a0a0",thickness:1}},panning:{enabled:!0,modifiers:["ctrl","meta"]},mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:["ctrl","meta"],minScale:.5,maxScale:3},interacting:!1})};return jsxRuntimeExports.jsxs("div",{className:classNames("drawx6","drawx6-show"),style:{height:t},children:[jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx("div",{ref:i,className:"drawx6-container"})}),!!r&&jsxRuntimeExports.jsx("div",{className:"drawx6-show-mask",onClick:o,children:"string"==typeof r&&jsxRuntimeExports.jsxs("div",{className:"drawx6-center drawx6-show-mask-tip",children:[r,jsxRuntimeExports.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M2.00477 7.0309L2.00977 7.0949L2.02377 7.2249C2.12977 7.9959 2.61077 8.2449 4.92477 8.9539L6.42377 9.4079L6.59977 9.4679C6.6472 9.48276 6.69282 9.50289 6.73577 9.5279L6.75177 9.5419L6.77077 9.5659C6.79377 9.6029 6.82377 9.6759 6.87377 9.8329L6.96077 10.1149L7.39277 11.5389L7.55677 12.0599C8.12777 13.8389 8.39877 14.1999 9.13677 14.2799L9.19777 14.2849C10.1658 14.3669 10.4048 13.9549 11.3768 11.2969L13.4548 5.5859L13.6278 5.0929C14.1158 3.6729 14.1238 3.2479 13.6518 2.7489L13.5998 2.6949C13.0028 2.0989 12.5648 2.1669 10.5338 2.9019L4.64877 5.0459L3.98577 5.2959C2.27677 5.9549 1.95477 6.2519 2.00477 7.0309ZM5.11877 6.1719L11.0628 4.0079C12.3268 3.5549 12.6708 3.4909 12.7368 3.5569L12.7488 3.5769L12.7568 3.6069C12.7768 3.7509 12.6618 4.1899 12.2348 5.3749L10.1218 11.1749L9.86377 11.8509C9.49577 12.7919 9.33777 13.0729 9.30177 13.0709L9.28477 13.0509L9.25677 13.0109C9.19758 12.9171 9.14511 12.8192 9.09977 12.7179L9.01777 12.5329L8.96177 12.3959C8.81703 12.0073 8.68595 11.6137 8.56877 11.2159L8.08877 9.6349C7.92877 9.1119 7.83877 8.9049 7.61377 8.6799C7.58752 8.65373 7.56016 8.62871 7.53177 8.6049L7.43677 8.5299C7.28077 8.4159 7.12077 8.3499 6.76877 8.2399L4.72477 7.6159L4.34077 7.4909C4.133 7.42316 3.92815 7.34676 3.72677 7.2619L3.65577 7.2319C3.31577 7.0799 3.22377 6.9949 3.22377 6.9919L3.22877 6.9809L3.24777 6.9639C3.35177 6.8809 3.83277 6.6509 5.11977 6.1719H5.11877Z"}),jsxRuntimeExports.jsx("path",{d:"M7.24609 9.07483L9.69727 6.8866",strokeLinecap:"round"})]})]})})]})},content$4=".x6-widget-dnd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n}\n.x6-widget-dnd.dragging {\n display: inline-block;\n}\n.x6-widget-dnd.dragging * {\n pointer-events: none !important;\n}\n.x6-widget-dnd .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n";var __decorate$b=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Dnd2;class Dnd extends View{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){return this.options.target.getPlugin("snapline")}constructor(e){super(),this.name="dnd",this.options=Object.assign(Object.assign({},Dnd.defaults),e),this.init()}init(){ensure(this.name,content$4),this.container=document.createElement("div"),addClass(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new Graph(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),append(this.container,this.draggingGraph.container)}start(e,t){const n=t;n.preventDefault(),this.targetModel.startBatch("dnd"),addClass(this.container,"dragging"),appendTo(this.container,this.options.draggingContainer||document.body),this.sourceNode=e,this.prepareDragging(e,n.clientX,n.clientY);const r=this.updateNodePosition(n.clientX,n.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:n,node:e,cell:e,view:this.draggingView,x:r.x,y:r.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(Dnd.documentEvents,n.data)}isSnaplineEnabled(){return this.snapline&&this.snapline.isEnabled()}prepareDragging(e,t,n){const r=this.draggingGraph,o=r.model,i=this.options.getDragNode(e,{sourceNode:e,draggingGraph:r,targetGraph:this.targetGraph});i.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const e=this.targetGraph.transform.getScale();r.scale(e.sx,e.sy),a*=Math.max(e.sx,e.sy)}else r.scale(1,1);this.clearDragging(),o.resetCells([i]);const s=r.findViewByCell(i);s.undelegateEvents(),s.cell.off("changed"),r.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const l=s.getBBox();this.geometryBBox=s.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(l.getTopLeft()),this.draggingNode=i,this.draggingView=s,this.draggingBBox=i.getBBox(),this.padding=a,this.originOffset=this.updateGraphPosition(t,n)}updateGraphPosition(e,t){const n=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft,o=this.delta,i=this.geometryBBox,a=this.padding||5,s={left:e-o.x-i.width/2-a+r,top:t-o.y-i.height/2-a+n};return this.draggingGraph&&css(this.container,{left:`${s.left}px`,top:`${s.top}px`}),s}updateNodePosition(e,t){const n=this.targetGraph.clientToLocal(e,t),r=this.draggingBBox;return n.x-=r.width/2,n.y-=r.height/2,this.draggingNode.position(n.x,n.y),n}snap({cell:e,current:t,options:n}){const r=e;if(n.snapped){const e=this.draggingBBox;r.position(e.x+n.tx,e.y+n.ty,{silent:!0}),this.draggingView.translate(),r.position(t.x,t.y,{silent:!0}),this.snapOffset={x:n.tx,y:n.ty}}else this.snapOffset=null}onDragging(e){const t=this.draggingView;if(t){e.preventDefault();const n=this.normalizeEvent(e),r=n.clientX,o=n.clientY;this.updateGraphPosition(r,o);const i=this.updateNodePosition(r,o),a=this.targetGraph.options.embedding.enabled,s=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:r,y:o});if(a){t.setEventData(n,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const e=t.getEventData(n);s?t.processEmbedding(n,e):t.clearEmbedding(e),this.candidateEmbedView=e.candidateEmbedView}this.isSnaplineEnabled()&&(s?this.snapline.snapOnMoving({e:n,view:t,x:i.x,y:i.y}):this.snapline.hide())}}onDragEnd(e){const t=this.draggingNode;if(t){const n=this.normalizeEvent(e),r=this.draggingView,o=this.draggingBBox,i=this.snapOffset;let a=o.x,s=o.y;i&&(a+=i.x,s+=i.y),t.position(a,s,{silent:!0});const l=this.drop(t,{x:n.clientX,y:n.clientY}),c=e=>{e?(this.onDropped(t),this.targetGraph.options.embedding.enabled&&r&&(r.setEventData(n,{cell:e,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),r.finalizeEmbedding(n,r.getEventData(n)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};isAsync(l)?(this.undelegateDocumentEvents(),l.then(c)):c(l)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(e){this.draggingNode===e&&(this.clearDragging(),removeClass(this.container,"dragging"),remove(this.container))}onDropInvalid(){const e=this.draggingNode;e&&this.onDropped(e)}isInsideValidArea(e){let t,n=null;const r=this.targetGraph,o=this.targetScroller;this.options.dndContainer&&(n=this.getDropArea(this.options.dndContainer));const i=n&&n.containsPoint(e);if(o)if(o.options.autoResize)t=this.getDropArea(o.container);else{const e=this.getDropArea(o.container);t=this.getDropArea(r.container).intersectsWithRect(e)}else t=this.getDropArea(r.container);return!i&&t&&t.containsPoint(e)}getDropArea(e){const t=offset$1(e),n=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return Rectangle.create({x:t.left+parseInt(css(e,"border-left-width"),10)-r,y:t.top+parseInt(css(e,"border-top-width"),10)-n,width:e.clientWidth,height:e.clientHeight})}drop(e,t){if(this.isInsideValidArea(t)){const n=this.targetGraph,r=n.model,o=n.clientToLocal(t),i=this.sourceNode,a=this.options.getDropNode(e,{sourceNode:i,draggingNode:e,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),s=a.getBBox();o.x+=s.x-s.width/2,o.y+=s.y-s.height/2;const l=this.snapOffset?1:n.getGridSize();a.position(GeometryUtil.snapToGrid(o.x,l),GeometryUtil.snapToGrid(o.y,l)),a.removeZIndex();const c=this.options.validateNode,u=!c||c(a,{sourceNode:i,draggingNode:e,droppingNode:a,targetGraph:n,draggingGraph:this.draggingGraph});return"boolean"==typeof u?u?(r.addCell(a,{stencil:this.cid}),a):null:toDeferredBoolean(u).then(e=>e?(r.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),clean(this.name)}}__decorate$b([View.dispose()],Dnd.prototype,"dispose",null),Dnd2=Dnd||(Dnd={}),Dnd2.defaults={getDragNode:e=>e.clone(),getDropNode:e=>e.clone()},Dnd2.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"},Graph.prototype.toSVG=function(e,t){const n=this.getPlugin("export");n&&n.toSVG(e,t)},Graph.prototype.toPNG=function(e,t){const n=this.getPlugin("export");n&&n.toPNG(e,t)},Graph.prototype.toJPEG=function(e,t){const n=this.getPlugin("export");n&&n.toJPEG(e,t)},Graph.prototype.exportPNG=function(e,t){const n=this.getPlugin("export");n&&n.exportPNG(e,t)},Graph.prototype.exportJPEG=function(e,t){const n=this.getPlugin("export");n&&n.exportJPEG(e,t)},Graph.prototype.exportSVG=function(e,t){const n=this.getPlugin("export");n&&n.exportSVG(e,t)};var __decorate$a=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};class Export extends Basecoat{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(t=>{DataUri.downloadDataUri(t,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(t=>{DataUri.downloadDataUri(t,e)},t)}exportSVG(e="chart",t={}){this.toSVG(t=>{DataUri.downloadDataUri(DataUri.svgToDataUrl(t),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const n=this.view.svg,r=Vector.create(n).clone();let o=r.node;const i=r.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=t.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),s=t.preserveDimensions;if(s){const e="boolean"==typeof s?a:s;r.attr({width:e.width,height:e.height})}if(r.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),i.removeAttribute("transform"),!1!==t.copyStyles){const e=n.ownerDocument,t=Array.from(n.querySelectorAll("*")),r=Array.from(o.querySelectorAll("*")),i=e.styleSheets.length,a=[];for(let n=i-1;n>=0;n-=1)a[n]=e.styleSheets[n],e.styleSheets[n].disabled=!0;const s={};t.forEach((e,t)=>{const n=window.getComputedStyle(e,null),r={};Object.keys(n).forEach(e=>{r[e]=n.getPropertyValue(e)}),s[t]=r}),i!==e.styleSheets.length&&a.forEach((t,n)=>{e.styleSheets[n]=t});for(let n=0;n<i;n+=1)e.styleSheets[n].disabled=!1;const l={};t.forEach((e,t)=>{const n=window.getComputedStyle(e,null),r=s[t],o={};Object.keys(n).forEach(e=>{isNumber(e)||n.getPropertyValue(e)===r[e]||(o[e]=n.getPropertyValue(e))}),l[t]=o}),r.forEach((e,t)=>{css(e,l[t])})}const l=t.stylesheet;if("string"==typeof l){const e=n.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(l);r.prepend(Vector.create("style",{type:"text/css"},[e]))}const c=()=>{const n=t.beforeSerialize;if("function"==typeof n){const e=call$1(n,this.graph,o);e instanceof SVGSVGElement&&(o=e)}const r=(new XMLSerializer).serializeToString(o).replace(/ /g," ");this.notify("after:export",t),e(r)};if(t.serializeImages){const e=r.find("image").map(e=>new Promise(t=>{const n=e.attr("xlink:href")||e.attr("href");DataUri.imageToDataUri(n,(n,r)=>{!n&&r&&e.attr("xlink:href",r),t()})}));Promise.all(e).then(c)}else c()}toDataURL(e,t){let n=t.viewBox||this.graph.getContentBBox();const r=normalizeSides(t.padding);t.width&&t.height&&(r.left+r.right>=t.width&&(r.left=r.right=0),r.top+r.bottom>=t.height&&(r.top=r.bottom=0));const o=new Rectangle(-r.left,-r.top,r.left+r.right,r.top+r.bottom);if(t.width&&t.height){const e=n.width+r.left+r.right,i=n.height+r.top+r.bottom;o.scale(e/t.width,i/t.height)}n=Rectangle.create(n).moveAndExpand(o);const i="number"==typeof t.width&&"number"==typeof t.height?{width:t.width,height:t.height}:n;let a=t.ratio?parseFloat(t.ratio):1;Number.isFinite(a)&&0!==a||(a=1);const s={width:Math.max(Math.round(i.width*a),1),height:Math.max(Math.round(i.height*a),1)};{const e=document.createElement("canvas"),t=e.getContext("2d");e.width=s.width,e.height=s.height;const n=s.width-1,r=s.height-1;t.fillStyle="rgb(1,1,1)",t.fillRect(n,r,1,1);const o=t.getImageData(n,r,1,1).data;if(1!==o[0]||1!==o[1]||1!==o[2])throw new Error("size exceeded")}const l=new Image;l.onload=()=>{const n=document.createElement("canvas");n.width=s.width,n.height=s.height;const r=n.getContext("2d");r.fillStyle=t.backgroundColor||"white",r.fillRect(0,0,s.width,s.height);try{r.drawImage(l,0,0,s.width,s.height);const o=n.toDataURL(t.type,t.quality);e(o)}catch(o){}},this.toSVG(e=>{l.src=`data:image/svg+xml,${encodeURIComponent(e)}`},Object.assign(Object.assign({},t),{viewBox:n,serializeImages:!0,preserveDimensions:Object.assign({},s)}))}toPNG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/png"}))}toJPEG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/jpeg"}))}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.off()}}__decorate$a([Basecoat.dispose()],Export.prototype,"dispose",null);var __decorate$9=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Private$1;class TransformImpl extends View{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(e,t,n){super(),this.node=t,this.graph=n,this.options=Object.assign(Object.assign({},Private$1.defaultOptions),e),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this)}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this)}renderHandles(){this.container=document.createElement("div");const e=document.createElement("div");attr(e,"draggable","false");const t=e.cloneNode(!0);addClass(t,this.rotateClassName);const n=Private$1.POSITIONS.map(t=>{const n=e.cloneNode(!0);return addClass(n,this.resizeClassName),attr(n,"data-position",t),n});this.empty(),append(this.container,[...n,t])}render(){return this.renderHandles(),this.view&&this.view.addClass(Private$1.NODE_CLS),addClass(this.container,this.containerClassName),toggleClass(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),toggleClass(this.container,"no-resize",!this.options.resizable),toggleClass(this.container,"no-rotate",!this.options.rotatable),this.options.className&&addClass(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const e=this.graph.matrix(),t=this.node.getBBox();t.x*=e.a,t.x+=e.e,t.y*=e.d,t.y+=e.f,t.width*=e.a,t.height*=e.d;const n=Angle.normalize(this.node.getAngle()),r=0!==n?`rotate(${n}deg)`:"";return css(this.container,{transform:r,width:t.width,height:t.height,left:t.x,top:t.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(Private$1.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const e=Angle.normalize(this.node.getAngle()),t=Math.floor(e*(Private$1.DIRECTIONS.length/360));if(t!==this.prevShift){const e=Private$1.DIRECTIONS.slice(t).concat(Private$1.DIRECTIONS.slice(0,t)),n=e=>`${this.containerClassName}-cursor-${e}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((t,r)=>{removeClass(t,Private$1.DIRECTIONS.map(e=>n(e)).join(" ")),addClass(t,n(e[r]))}),this.prevShift=t}}getTrueDirection(e){const t=Angle.normalize(this.node.getAngle());let n=Private$1.POSITIONS.indexOf(e);return n+=Math.floor(t*(Private$1.POSITIONS.length/360)),n%=Private$1.POSITIONS.length,Private$1.POSITIONS[n]}toValidResizeDirection(e){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[e]||e}startResizing(e){e.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const t=attr(e.target,"data-position");this.prepareResizing(e,t),this.startAction(e)}prepareResizing(e,t){const n=this.getTrueDirection(t);let r=0,o=0;t.split("-").forEach(e=>{r={left:-1,right:1}[e]||r,o={top:-1,bottom:1}[e]||o});const i=this.toValidResizeDirection(t),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[i],s=Angle.normalize(this.node.getAngle());this.setEventData(e,{selector:a,direction:i,trueDirection:n,relativeDirection:t,angle:s,resizeX:r,resizeY:o,action:"resizing"})}startRotating(e){e.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const t=this.node.getBBox().getCenter(),n=this.normalizeEvent(e),r=this.graph.snapToGrid(n.clientX,n.clientY);this.setEventData(e,{center:t,action:"rotating",angle:Angle.normalize(this.node.getAngle()),start:Point.create(r).theta(t)}),this.startAction(e)}onMouseMove(e){const t=this.graph.findViewByCell(this.node);let n=this.getEventData(e);if(n.action){const r=this.normalizeEvent(e);let o=r.clientX,i=r.clientY;const a=this.graph.getPlugin("scroller"),s=this.options.restrictedResizing;if(!0===s||"number"==typeof s){const e=!0===s?0:s,t=a?Math.max(e,8):e,n=this.graph.container.getBoundingClientRect();o=clamp(o,n.left+t,n.right-t),i=clamp(i,n.top+t,n.bottom-t)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(o,i);const l=this.graph.snapToGrid(o,i),c=this.graph.getGridSize(),u=this.node,d=this.options;if("resizing"===n.action){n.resized||(t&&(t.addClass("node-resizing"),this.notify("node:resize",e,t)),n.resized=!0);const r=u.getBBox(),o=Point.create(l).rotate(n.angle,r.getCenter()).diff(r[n.selector]);let i=n.resizeX?o.x*n.resizeX:r.width,a=n.resizeY?o.y*n.resizeY:r.height;const s=i,p=a;if(i=GeometryUtil.snapToGrid(i,c),a=GeometryUtil.snapToGrid(a,c),i=Math.max(i,d.minWidth||c),a=Math.max(a,d.minHeight||c),i=Math.min(i,d.maxWidth||1/0),a=Math.min(a,d.maxHeight||1/0),d.preserveAspectRatio){const e=r.width*a/r.height,t=r.height*i/r.width;i<e?a=t:i=e}const f=n.relativeDirection;if(d.allowReverse&&(s<=-i||p<=-a)){let t;"left"===f?s<=-i&&(t="right"):"right"===f?s<=-i&&(t="left"):"top"===f?p<=-a&&(t="bottom"):"bottom"===f?p<=-a&&(t="top"):"top-left"===f?s<=-i&&p<=-a?t="bottom-right":s<=-i?t="top-right":p<=-a&&(t="bottom-left"):"top-right"===f?s<=-i&&p<=-a?t="bottom-left":s<=-i?t="top-left":p<=-a&&(t="bottom-right"):"bottom-left"===f?s<=-i&&p<=-a?t="top-right":s<=-i?t="bottom-right":p<=-a&&(t="top-left"):"bottom-right"===f&&(s<=-i&&p<=-a?t="top-left":s<=-i?t="bottom-left":p<=-a&&(t="top-right"));const n=t;this.stopHandle();const r=this.container.querySelector(`.${this.resizeClassName}[data-position="${n}"]`);this.startHandle(r),this.prepareResizing(e,n),this.onMouseMove(e)}if(r.width!==i||r.height!==a){const r={ui:!0,direction:n.direction,relativeDirection:n.relativeDirection,trueDirection:n.trueDirection,minWidth:d.minWidth,minHeight:d.minHeight,maxWidth:d.maxWidth,maxHeight:d.maxHeight,preserveAspectRatio:!0===d.preserveAspectRatio};u.resize(i,a,r),this.notify("node:resizing",e,t)}}else if("rotating"===n.action){n.rotated||(t&&(t.addClass("node-rotating"),this.notify("node:rotate",e,t)),n.rotated=!0);const r=u.getAngle(),o=n.start-Point.create(l).theta(n.center);let i=n.angle+o;d.rotateGrid&&(i=GeometryUtil.snapToGrid(i,d.rotateGrid)),i=Angle.normalize(i),r!==i&&(u.rotate(i,{absolute:!0}),this.notify("node:rotating",e,t))}}}onMouseUp(e){const t=this.getEventData(e);t.action&&(this.stopAction(e),this.model.stopBatch("resizing"===t.action?"resize":"rotate",{cid:this.cid}))}startHandle(e){if(this.handle=e||null,addClass(this.container,`${this.containerClassName}-active`),e){addClass(e,`${this.containerClassName}-active-handle`);const t=e.getAttribute("data-position");if(t){const e=Private$1.DIRECTIONS[Private$1.POSITIONS.indexOf(t)];addClass(this.container,`${this.containerClassName}-cursor-${e}`)}}}stopHandle(){if(removeClass(this.container,`${this.containerClassName}-active`),this.handle){removeClass(this.handle,`${this.containerClassName}-active-handle`);const e=this.handle.getAttribute("data-position");if(e){const t=Private$1.DIRECTIONS[Private$1.POSITIONS.indexOf(e)];removeClass(this.container,`${this.containerClassName}-cursor-${t}`)}this.handle=null}}startAction(e){this.startHandle(e.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(Private$1.documentEvents,e.data)}stopAction(e){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const t=this.graph.findViewByCell(this.node),n=this.getEventData(e);t&&(t.removeClass(`node-${n.action}`),"resizing"===n.action&&n.resized?this.notify("node:resized",e,t):"rotating"===n.action&&n.rotated&&this.notify("node:rotated",e,t))}notify(e,t,n,r={}){if(n){const o=n.graph,i=o.view.normalizeEvent(t),a=o.snapToGrid(i.clientX,i.clientY);this.trigger(e,Object.assign({e:i,view:n,node:n.cell,cell:n.cell,x:a.x,y:a.y},r))}}dispose(){this.stopListening(),this.remove(),this.off()}}__decorate$9([View.dispose()],TransformImpl.prototype,"dispose",null),function(e){e.NODE_CLS="has-widget-transform",e.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],e.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],e.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},e.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}}(Private$1||(Private$1={}));const content$3=".x6-widget-transform {\n position: absolute;\n box-sizing: content-box !important;\n margin: -5px 0 0 -5px;\n padding: 4px;\n border: 1px dashed #000;\n border-radius: 5px;\n user-select: none;\n pointer-events: none;\n}\n.x6-widget-transform > div {\n position: absolute;\n box-sizing: border-box;\n background-color: #fff;\n border: 1px solid #000;\n transition: background-color 0.2s;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-transform > div:hover {\n background-color: #d3d3d3;\n}\n.x6-widget-transform-cursor-n {\n cursor: n-resize;\n}\n.x6-widget-transform-cursor-s {\n cursor: s-resize;\n}\n.x6-widget-transform-cursor-e {\n cursor: e-resize;\n}\n.x6-widget-transform-cursor-w {\n cursor: w-resize;\n}\n.x6-widget-transform-cursor-ne {\n cursor: ne-resize;\n}\n.x6-widget-transform-cursor-nw {\n cursor: nw-resize;\n}\n.x6-widget-transform-cursor-se {\n cursor: se-resize;\n}\n.x6-widget-transform-cursor-sw {\n cursor: sw-resize;\n}\n.x6-widget-transform-resize {\n width: 10px;\n height: 10px;\n border-radius: 6px;\n}\n.x6-widget-transform-resize[data-position='top-left'] {\n top: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='top-right'] {\n top: -5px;\n right: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-left'] {\n bottom: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-right'] {\n right: -5px;\n bottom: -5px;\n}\n.x6-widget-transform-resize[data-position='top'] {\n top: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom'] {\n bottom: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='left'] {\n top: 50%;\n left: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform-resize[data-position='right'] {\n top: 50%;\n right: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='top'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='right'] {\n display: none;\n}\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='right'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='top'] {\n display: none;\n}\n.x6-widget-transform.no-resize .x6-widget-transform-resize {\n display: none;\n}\n.x6-widget-transform-rotate {\n top: -20px;\n left: -20px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n cursor: crosshair;\n}\n.x6-widget-transform.no-rotate .x6-widget-transform-rotate {\n display: none;\n}\n.x6-widget-transform-active {\n border-color: transparent;\n pointer-events: all;\n}\n.x6-widget-transform-active > div {\n display: none;\n}\n.x6-widget-transform-active > .x6-widget-transform-active-handle {\n display: block;\n background-color: #808080;\n}\n";Graph.prototype.createTransformWidget=function(e){const t=this.getPlugin("transform");return t&&t.createWidget(e),this},Graph.prototype.clearTransformWidgets=function(){const e=this.getPlugin("transform");return e&&e.clearWidgets(),this};var __decorate$8=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Transform2;class Transform extends Basecoat{constructor(e={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=e,ensure(this.name,content$3)}init(e){this.graph=e,this.disabled||this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(e){this.clearWidgets();const t=this.createTransform(e);t&&(this.widgets.set(e,t),t.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)}))}onNodeClick({node:e}){this.createWidget(e)}onBlankMouseDown(){this.clearWidgets()}createTransform(e){const t=this.getTransformOptions(e);return t.resizable||t.rotatable?new TransformImpl(t,e,this.graph):null}getTransformOptions(e){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),"boolean"==typeof this.options.resizing&&(this.options.resizing={enabled:this.options.resizing}),"boolean"==typeof this.options.rotating&&(this.options.rotating={enabled:this.options.rotating});const t=Transform.parseOptionGroup(this.graph,e,this.options.resizing),n=Transform.parseOptionGroup(this.graph,e,this.options.rotating);return{resizable:!!t.enabled,minWidth:t.minWidth||0,maxWidth:t.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:t.minHeight||0,maxHeight:t.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:"boolean"!=typeof t.orthogonal||t.orthogonal,restrictedResizing:!!t.restrict,autoScrollOnResizing:"boolean"!=typeof t.autoScroll||t.autoScroll,preserveAspectRatio:!!t.preserveAspectRatio,allowReverse:"boolean"!=typeof t.allowReverse||t.allowReverse,rotatable:!!n.enabled,rotateGrid:n.grid||15}}clearWidgets(){this.widgets.forEach((e,t)=>{this.graph.getCellById(t.id)&&e.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),clean(this.name)}}__decorate$8([Basecoat.dispose()],Transform.prototype,"dispose",null),Transform2=Transform||(Transform={}),Transform2.parseOptionGroup=function(e,t,n){const r={};return Object.keys(n||{}).forEach(o=>{const i=n[o];r[o]="function"==typeof i?i.call(e,t):i}),r};var mousetrap={exports:{}};!function(e){!function(t,n){if(t){for(var r,o={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l=1;l<20;++l)o[111+l]="f"+l;for(l=0;l<=9;++l)o[l+96]=l.toString();m.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},m.prototype.unbind=function(e,t){return this.bind.call(this,e,function(){},t)},m.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},m.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},m.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(g(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},m.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},m.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t]);r=null},m.init=function(){var e=m(n);for(var t in e)"_"!==t.charAt(0)&&(m[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},m.init(),t.Mousetrap=m,e.exports&&(e.exports=m)}function c(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function u(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return o[e.which]?o[e.which]:i[e.which]?i[e.which]:String.fromCharCode(e.which).toLowerCase()}function d(e,t){return e.sort().join(",")===t.sort().join(",")}function p(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function f(e,t,n){return n||(n=function(){if(!r)for(var e in r={},o)e>95&&e<112||o.hasOwnProperty(e)&&(r[o[e]]=e);return r}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function h(e,t){var n,r,o,i=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),o=0;o<n.length;++o)r=n[o],s[r]&&(r=s[r]),t&&"keypress"!=t&&a[r]&&(r=a[r],i.push("shift")),p(r)&&i.push(r);return{key:r,modifiers:i,action:t=f(r,i,t)}}function g(e,t){return null!==e&&e!==n&&(e===t||g(e.parentNode,t))}function m(e){var t=this;if(e=e||n,!(t instanceof m))return new m(e);t.target=e,t._callbacks={},t._directMap={};var r,o={},i=!1,a=!1,s=!1;function l(e){e=e||{};var t,n=!1;for(t in o)e[t]?n=!0:o[t]=0;n||(s=!1)}function f(e,n,r,i,a,s){var l,c,u=[],f=r.type;if(!t._callbacks[e])return[];for("keyup"==f&&p(e)&&(n=[e]),l=0;l<t._callbacks[e].length;++l)if(c=t._callbacks[e][l],(i||!c.seq||o[c.seq]==c.level)&&f==c.action&&("keypress"==f&&!r.metaKey&&!r.ctrlKey||d(n,c.modifiers))){var h=!i&&c.combo==a,g=i&&c.seq==i&&c.level==s;(h||g)&&t._callbacks[e].splice(l,1),u.push(c)}return u}function g(e,n,r,o){t.stopCallback(n,n.target||n.srcElement,r,o)||!1===e(n,r)&&(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}(n),function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}(n))}function y(e){"number"!=typeof e.which&&(e.which=e.keyCode);var n=u(e);n&&("keyup"!=e.type||i!==n?t.handleKey(n,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(e),e):i=!1)}function v(e,t,n,a){function c(t){return function(){s=t,++o[e],clearTimeout(r),r=setTimeout(l,1e3)}}function d(t){g(n,t,e),"keyup"!==a&&(i=u(t)),setTimeout(l,10)}o[e]=0;for(var p=0;p<t.length;++p){var f=p+1===t.length?d:c(a||h(t[p+1]).action);b(t[p],f,a,e,p)}}function b(e,n,r,o,i){t._directMap[e+":"+r]=n;var a,s=(e=e.replace(/\s+/g," ")).split(" ");s.length>1?v(e,s,n,r):(a=h(e,r),t._callbacks[a.key]=t._callbacks[a.key]||[],f(a.key,a.modifiers,{type:a.action},o,e,i),t._callbacks[a.key][o?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:o,level:i,combo:e}))}t._handleKey=function(e,t,n){var r,o=f(e,t,n),i={},c=0,u=!1;for(r=0;r<o.length;++r)o[r].seq&&(c=Math.max(c,o[r].level));for(r=0;r<o.length;++r)if(o[r].seq){if(o[r].level!=c)continue;u=!0,i[o[r].seq]=1,g(o[r].callback,n,o[r].combo,o[r].seq)}else u||g(o[r].callback,n,o[r].combo);var d="keypress"==n.type&&a;n.type!=s||p(e)||d||l(i),a=u&&"keydown"==n.type},t._bindMultiple=function(e,t,n){for(var r=0;r<e.length;++r)b(e[r],t,n)},c(e,"keypress",y),c(e,"keydown",y),c(e,"keyup",y)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(mousetrap);var mousetrapExports=mousetrap.exports;const Mousetrap=getDefaultExportFromCjs(mousetrapExports);var __decorate$7=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},KeyboardImpl2;class KeyboardImpl extends Disposable{get graph(){return this.options.graph}constructor(e){super(),this.options=e;const t=this.graph.getPlugin("scroller");this.container=t?t.container:this.graph.container,e.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=KeyboardImpl.createMousetrap(this)}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(e,t,n){this.mousetrap.bind(this.getKeys(e),t,n)}off(e,t){this.mousetrap.unbind(this.getKeys(e),t)}clear(){this.mousetrap.reset()}trigger(e,t){this.mousetrap.trigger(e,t)}focus(e){if(this.isInputEvent(e.e))return;this.target.focus({preventScroll:!0})}getKeys(e){return(Array.isArray(e)?e:[e]).map(e=>this.formatkey(e))}formatkey(e){const t=e.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left"),n=this.options.format;return n?call$1(n,this.graph,t):t}isGraphEvent(e){const t=e.target,n=e.currentTarget;return!!t&&(t===this.target||n===this.target||t===document.body||contains(this.container,t))}isInputEvent(e){var t;const n=e.target,r=null===(t=null==n?void 0:n.tagName)||void 0===t?void 0:t.toLowerCase();let o=["input","textarea"].includes(r);return"true"===attr(n,"contenteditable")&&(o=!0),o}isEnabledForEvent(e){const t=!this.disabled&&this.isGraphEvent(e),n=this.isInputEvent(e);if(t){if(n&&("Backspace"===e.key||"Delete"===e.key))return!1;if(this.options.guard)return call$1(this.options.guard,this.graph,e)}return t}dispose(){this.mousetrap.reset()}}__decorate$7([Disposable.dispose()],KeyboardImpl.prototype,"dispose",null),KeyboardImpl2=KeyboardImpl||(KeyboardImpl={}),KeyboardImpl2.createMousetrap=function(e){const t=new Mousetrap(e.target),n=t.stopCallback;return t.stopCallback=(r,o,i)=>!e.isEnabledForEvent(r)||!!n&&n.call(t,r,o,i),t},Graph.prototype.isKeyboardEnabled=function(){const e=this.getPlugin("keyboard");return!!e&&e.isEnabled()},Graph.prototype.enableKeyboard=function(){const e=this.getPlugin("keyboard");return e&&e.enable(),this},Graph.prototype.disableKeyboard=function(){const e=this.getPlugin("keyboard");return e&&e.disable(),this},Graph.prototype.toggleKeyboard=function(e){const t=this.getPlugin("keyboard");return t&&t.toggleEnabled(e),this},Graph.prototype.bindKey=function(e,t,n){const r=this.getPlugin("keyboard");return r&&r.bindKey(e,t,n),this},Graph.prototype.unbindKey=function(e,t){const n=this.getPlugin("keyboard");return n&&n.unbindKey(e,t),this},Graph.prototype.clearKeys=function(){const e=this.getPlugin("keyboard");return e&&e.clear(),this},Graph.prototype.triggerKey=function(e,t){const n=this.getPlugin("keyboard");return n&&n.trigger(e,t),this};var __decorate$6=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Storage;class Keyboard extends Disposable{constructor(e={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},e)}init(e){this.keyboardImpl=new KeyboardImpl(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}bindKey(e,t,n){return this.keyboardImpl.on(e,t,n),this}trigger(e,t){return this.keyboardImpl.trigger(e,t),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(e,t){return this.keyboardImpl.off(e,t),this}dispose(){this.keyboardImpl.dispose()}}__decorate$6([Disposable.dispose()],Keyboard.prototype,"dispose",null);class ClipboardImpl{constructor(){this.cells=[]}copy(e,t,n={}){this.options=Object.assign({},n);const r=(Model.isModel(t)?t:t.model).cloneSubGraph(e,n);this.cells=sortBy(Object.keys(r).map(e=>r[e]),e=>e.isEdge()?2:1),this.serialize(n)}cut(e,t,n={}){this.copy(e,t,n);(Graph.isGraph(t)?t.model:t).batchUpdate("cut",()=>{e.forEach(e=>e.remove())})}paste(e,t={}){const n=Object.assign(Object.assign({},this.options),t),{offset:r,edgeProps:o,nodeProps:i}=n;let a=20,s=20;r&&(a="number"==typeof r?r:r.dx,s="number"==typeof r?r:r.dy),this.deserialize(n);const l=this.cells;l.forEach(e=>{e.model=null,e.removeProp("zIndex"),(a||s)&&e.translate(a,s),i&&e.isNode()&&e.prop(i),o&&e.isEdge()&&e.prop(o)});const c=Graph.isGraph(e)?e.model:e;return c.batchUpdate("paste",()=>{c.addCells(this.cells)}),this.copy(l,e,t),l}serialize(e){!1!==e.useLocalStorage&&Storage.save(this.cells)}deserialize(e){if(e.useLocalStorage){const e=Storage.fetch();e&&(this.cells=e)}}isEmpty(e={}){return e.useLocalStorage&&this.deserialize(e),this.cells.length<=0}clean(){this.options={},this.cells=[],Storage.clean()}}!function(e){const t=`${Config.prefixCls}.clipboard.cells`;e.save=function(e){if(window.localStorage){const n=e.map(e=>e.toJSON());localStorage.setItem(t,JSON.stringify(n))}},e.fetch=function(){if(window.localStorage){const e=localStorage.getItem(t),n=e?JSON.parse(e):[];if(n)return Model.fromJSON(n)}},e.clean=function(){window.localStorage&&localStorage.removeItem(t)}}(Storage||(Storage={})),Graph.prototype.isClipboardEnabled=function(){const e=this.getPlugin("clipboard");return!!e&&e.isEnabled()},Graph.prototype.enableClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.enable(),this},Graph.prototype.disableClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.disable(),this},Graph.prototype.toggleClipboard=function(e){const t=this.getPlugin("clipboard");return t&&t.toggleEnabled(e),this},Graph.prototype.isClipboardEmpty=function(e){const t=this.getPlugin("clipboard");return!t||t.isEmpty(e)},Graph.prototype.getCellsInClipboard=function(){const e=this.getPlugin("clipboard");return e?e.getCellsInClipboard():[]},Graph.prototype.cleanClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.clean(),this},Graph.prototype.copy=function(e,t){const n=this.getPlugin("clipboard");return n&&n.copy(e,t),this},Graph.prototype.cut=function(e,t){const n=this.getPlugin("clipboard");return n&&n.cut(e,t),this},Graph.prototype.paste=function(e,t){const n=this.getPlugin("clipboard");return n?n.paste(e,t):[]};var __decorate$5=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},__rest$1=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};class Clipboard extends Basecoat{get disabled(){return!0!==this.options.enabled}get cells(){return this.clipboardImpl.cells}constructor(e={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},e)}init(e){this.graph=e,this.clipboardImpl=new ClipboardImpl,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isEmpty(e={}){return this.clipboardImpl.isEmpty(e)}getCellsInClipboard(){return this.cells}clean(e){return this.disabled&&!e||(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(e,t={}){return this.disabled||(this.clipboardImpl.copy(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}cut(e,t={}){return this.disabled||(this.clipboardImpl.cut(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}paste(e={},t=this.graph){return this.disabled?[]:this.clipboardImpl.paste(t,Object.assign(Object.assign({},this.commonOptions),e))}get commonOptions(){const e=this.options,{enabled:t}=e;return __rest$1(e,["enabled"])}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.clean(!0),this.off()}}__decorate$5([Basecoat.dispose()],Clipboard.prototype,"dispose",null),Graph.prototype.isHistoryEnabled=function(){const e=this.getPlugin("history");return!!e&&e.isEnabled()},Graph.prototype.enableHistory=function(){const e=this.getPlugin("history");return e&&e.enable(),this},Graph.prototype.disableHistory=function(){const e=this.getPlugin("history");return e&&e.disable(),this},Graph.prototype.toggleHistory=function(e){const t=this.getPlugin("history");return t&&t.toggleEnabled(e),this},Graph.prototype.undo=function(e){const t=this.getPlugin("history");return t&&t.undo(e),this},Graph.prototype.redo=function(e){const t=this.getPlugin("history");return t&&t.redo(e),this},Graph.prototype.undoAndCancel=function(e){const t=this.getPlugin("history");return t&&t.cancel(e),this},Graph.prototype.canUndo=function(){const e=this.getPlugin("history");return!!e&&e.canUndo()},Graph.prototype.canRedo=function(){const e=this.getPlugin("history");return!!e&&e.canRedo()},Graph.prototype.cleanHistory=function(e){const t=this.getPlugin("history");return t&&t.clean(e),this},Graph.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},Graph.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},Graph.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},Graph.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var __decorate$4=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Util;class History extends Basecoat{constructor(e={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:t=0}=e;this.stackSize=t,this.options=Util.getOptions(e),this.validator=new History.Validator({history:this,cancelInvalid:this.options.cancelInvalid})}init(e){this.graph=e,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack.push(t),this.notify("undo",t,e))}return this}redo(e={}){if(!this.disabled){const t=this.redoStack.pop();t&&(this.applyCommand(t,e),this.undoStackPush(t),this.notify("redo",t,e))}return this}cancel(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack=[],this.notify("cancel",t,e))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const e=this.undoStack.length;return this.stackSize-e}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(e={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,e),this}get disabled(){return!0!==this.options.enabled}validate(e,...t){return this.validator.validate(e,...t),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((e,t)=>{this.handlers[t]=this.addCommand.bind(this,e),this.model.on(e,this.handlers[t])}),this.validator.on("invalid",e=>this.trigger("invalid",e))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((e,t)=>{this.model.off(e,this.handlers[t])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(e){return{batch:!!e&&e.batch,data:{}}}revertCommand(e,t){this.freezed=!0;const n=Array.isArray(e)?Util.sortBatchCommands(e):[e];for(let r=n.length-1;r>=0;r-=1){const e=n[r],o=Object.assign(Object.assign({},t),pick(e.options,this.options.revertOptionsList||[]));this.executeCommand(e,!0,o)}this.freezed=!1}applyCommand(e,t){this.freezed=!0;const n=Array.isArray(e)?Util.sortBatchCommands(e):[e];for(let r=0;r<n.length;r+=1){const e=n[r],o=Object.assign(Object.assign({},t),pick(e.options,this.options.applyOptionsList||[]));this.executeCommand(e,!1,o)}this.freezed=!1}executeCommand(e,t,n){const r=this.model,o=r.getCell(e.data.id),i=e.event;if(Util.isAddEvent(i)&&t||Util.isRemoveEvent(i)&&!t)o&&o.remove(n);else if(Util.isAddEvent(i)&&!t||Util.isRemoveEvent(i)&&t){const t=e.data;t.node?r.addNode(t.props,n):t.edge&&r.addEdge(t.props,n)}else if(Util.isChangeEvent(i)){const r=e.data,i=r.key;if(i&&o){const e=t?r.prev[i]:r.next[i];if("attrs"===r.key){this.ensureUndefinedAttrs(e,t?r.next[i]:r.prev[i])&&(n.dirty=!0)}o.prop(i,e,n)}}else{const r=this.options.executeCommand;r&&call$1(r,this,e,t,n)}}addCommand(e,t){if(this.freezed||this.disabled)return;const n=t,r=n.options||{};if(r.dryrun)return;if(Util.isAddEvent(e)&&this.options.ignoreAdd||Util.isRemoveEvent(e)&&this.options.ignoreRemove||Util.isChangeEvent(e)&&this.options.ignoreChange)return;const o=this.options.beforeAddCommand;if(null!=o&&!1===call$1(o,this,e,t))return;"cell:change:*"===e&&(e=`cell:change:${n.key}`);const i=n.cell,a=Model.isModel(i);let s;if(this.batchCommands){s=this.batchCommands[Math.max(this.lastBatchIndex,0)];const t=a&&!s.modelChange||s.data.id!==i.id,n=s.event!==e;if(this.lastBatchIndex>=0&&(t||n)){const t=this.batchCommands.findIndex(t=>(a&&t.modelChange||t.data.id===i.id)&&t.event===e);t<0||Util.isAddEvent(e)||Util.isRemoveEvent(e)?s=this.createCommand({batch:!0}):(s=this.batchCommands[t],this.batchCommands.splice(t,1)),this.batchCommands.push(s),this.lastBatchIndex=this.batchCommands.length-1}}else s=this.createCommand({batch:!1});if(Util.isAddEvent(e)||Util.isRemoveEvent(e)){const t=s.data;return s.event=e,s.options=r,t.id=i.id,t.props=cloneDeep(i.toJSON()),i.isEdge()?t.edge=!0:i.isNode()&&(t.node=!0),this.push(s,r)}if(Util.isChangeEvent(e)){const n=t.key,o=s.data;return s.batch&&s.event||(s.event=e,s.options=r,o.key=n,null==o.prev&&(o.prev={}),o.prev[n]=cloneDeep(i.previous(n)),a?s.modelChange=!0:o.id=i.id),null==o.next&&(o.next={}),o.next[n]=cloneDeep(i.prop(n)),this.push(s,r)}const l=this.options.afterAddCommand;l&&call$1(l,this,e,t,s),this.push(s,r)}initBatchCommand(e){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(e){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const t=this.filterBatchCommand(this.batchCommands);t.length>0&&(this.redoStack=[],this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(e){let t=e.slice();const n=[];for(;t.length>0;){const e=t.shift(),r=e.event,o=e.data.id;if(null!=r&&(null!=o||e.modelChange)){if(Util.isAddEvent(r)){const e=t.findIndex(e=>Util.isRemoveEvent(e.event)&&e.data.id===o);if(e>=0){t=t.filter((t,n)=>e<n||t.data.id!==o);continue}}else if(Util.isRemoveEvent(r)){const e=t.findIndex(e=>Util.isAddEvent(e.event)&&e.data.id===o);if(e>=0){t.splice(e,1);continue}}else if(Util.isChangeEvent(r)){const t=e.data;if(isEqual(t.prev,t.next))continue}n.push(e)}}return n}notify(e,t,n){const r=null==t?null:Array.isArray(t)?t:[t];this.emit(e,{cmds:r,options:n}),this.graph.trigger(`history:${e}`,{cmds:r,options:n}),this.emit("change",{cmds:r,options:n}),this.graph.trigger("history:change",{cmds:r,options:n})}push(e,t){this.redoStack=[],e.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:e,options:t})):(this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t))}consolidateCommands(){var e;const t=this.undoStack[this.undoStack.length-1],n=this.undoStack[this.undoStack.length-2];if(!Array.isArray(t))return;const r=new Set(t.map(e=>e.event));if(2!==r.size||!r.has("cell:change:parent")||!r.has("cell:change:children"))return;if(!t.every(e=>{var t;return e.batch&&(null===(t=e.options)||void 0===t?void 0:t.ui)}))return;if(!Array.isArray(n)||1!==n.length)return;const o=n[0];"cell:change:position"===o.event&&(null===(e=o.options)||void 0===e?void 0:e.ui)&&(n.push(...t),this.undoStack.pop())}undoStackPush(e){0!==this.stackSize?(this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(e)):this.undoStack.push(e)}ensureUndefinedAttrs(e,t){let n=!1;return null!==e&&null!==t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).forEach(r=>{void 0===e[r]&&void 0!==t[r]?(e[r]=void 0,n=!0):"object"==typeof e[r]&&"object"==typeof t[r]&&(n=this.ensureUndefinedAttrs(e[r],t[r]))}),n}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}__decorate$4([Basecoat.dispose()],History.prototype,"dispose",null),function(e){class t extends Basecoat{constructor(e){super(),this.map={},this.command=e.history,this.cancelInvalid=!1!==e.cancelInvalid,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:e}){return Array.isArray(e)?e.every(e=>this.isValidCommand(e)):this.isValidCommand(e)}isValidCommand(e){if(e.options&&!1===e.options.validation)return!0;const t=e.event&&this.map[e.event]||[];let n=null;return t.forEach(t=>{let r=0;const o=i=>{const a=t[r];r+=1;try{if(!a)return void(n=i);a(i,e,o)}catch(s){o(s)}};o(n)}),!n||(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:n}),!1)}validate(e,...t){const n=Array.isArray(e)?e:e.split(/\s+/);return t.forEach(e=>{if("function"!=typeof e)throw new Error(`${n.join(" ")} requires callback functions.`)}),n.forEach(e=>{null==this.map[e]&&(this.map[e]=[]),this.map[e].push(t)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}__decorate$4([Basecoat.dispose()],t.prototype,"dispose",null),e.Validator=t}(History||(History={})),function(e){e.isAddEvent=function(e){return"cell:added"===e},e.isRemoveEvent=function(e){return"cell:removed"===e},e.isChangeEvent=function(e){return null!=e&&e.startsWith("cell:change:")},e.getOptions=function(t){const n=["cell:added","cell:removed","cell:change:*"],r=["batch:start","batch:stop"],o=t.eventNames?t.eventNames.filter(t=>!(e.isChangeEvent(t)||n.includes(t)||r.includes(t))):n;return Object.assign(Object.assign({enabled:!0},t),{eventNames:o,applyOptionsList:t.applyOptionsList||["propertyPath"],revertOptionsList:t.revertOptionsList||["propertyPath"]})},e.sortBatchCommands=function(t){const n=[];for(let r=0,o=t.length;r<o;r+=1){const o=t[r];let i=null;if(e.isAddEvent(o.event)){const e=o.data.id;for(let n=0;n<r;n+=1)if(t[n].data.id===e){i=n;break}}null!==i?n.splice(i,0,o):n.push(o)}return n}}(Util||(Util={}));var __decorate$3=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Private;class SelectionImpl extends View{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Private.classNames.box)}get $boxes(){return children(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new Collection([],{comparator:Private.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){const e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){const{showNodeSelectionBox:n,pointerEvents:r}=this.options,{ui:o,selection:i,translateBy:a,snapped:s}=t,l=(!0!==n||r&&"none"===this.getPointerEventsValue(r))&&!this.translating&&!i,c=o&&a&&e.id===a;if(l&&(c||s)){this.translating=!0;const n=e.position(),r=e.previous("position"),o=n.x-r.x,i=n.y-r.y;0===o&&0===i||this.translateSelectedNodes(o,i,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;const n=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(n,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){const n=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(n,Object.assign(Object.assign({},t),{ui:!0})),this}const n=this.cells,r=this.filter(Array.isArray(e)?e:[e]),o={},i={};n.forEach(e=>o[e.id]=e),r.forEach(e=>i[e.id]=e);const a=[],s=[];return r.forEach(e=>{o[e.id]||a.push(e)}),n.forEach(e=>{i[e.id]||s.push(e)}),s.length&&this.unselect(s,Object.assign(Object.assign({},t),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},t),{ui:!0})),0===s.length&&0===a.length&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(!1===e.batch?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){let t,n;e=this.normalizeEvent(e),this.clean();const r=this.graph.container;if(null!=e.offsetX&&null!=e.offsetY&&r.contains(e.target))t=e.offsetX,n=e.offsetY;else{const o=offset$1(r),i=r.scrollLeft,a=r.scrollTop;t=e.clientX-o.left+window.pageXOffset+i,n=e.clientY-o.top+window.pageYOffset+a}css(this.container,{top:n,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:n,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(Private.documentEvents,e.data)}filter(e){const t=this.options.filter;return e.filter(e=>Array.isArray(t)?t.some(t=>"string"==typeof t?e.shape===t:e.id===t.id):"function"!=typeof t||call$1(t,this.graph,e))}stopSelecting(e){const t=this.graph,n=this.getEventData(e);switch(n.action){case"selecting":{let e=width$1(this.container),n=height$1(this.container);const r=offset$1(this.container),o=t.pageToLocal(r.left,r.top),i=t.transform.getScale();e/=i.sx,n/=i.sy;const a=new Rectangle(o.x,o.y,e,n),s=this.getCellViewsInArea(a).map(e=>e.cell);this.reset(s,{batch:!0}),this.hideRubberband();break}case"translating":{const r=t.snapToGrid(e.clientX,e.clientY);if(!this.options.following){const e=n;this.updateSelectedNodesPosition({dx:e.clientX-e.originX,dy:e.clientY-e.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",e,r.x,r.y);break}default:this.clean()}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){this.options.following||e.stopPropagation();const t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);const n=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:n});const r=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,r.x,r.y),this.delegateDocumentEvents(Private.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");const t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){const e=this.graph.options.translating.restrict,t="function"==typeof e?call$1(e,this.graph,null):e;return"number"==typeof t?this.graph.transform.getGraphArea().inflate(t):!0===t?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let n=e.x-t.clientX,r=e.y-t.clientY;const o=this.getRestrictArea();if(o){const i=this.collection.toArray(),a=Cell.getCellsBBox(i,{deep:!0})||Rectangle.create(),s=o.x-a.x,l=o.y-a.y,c=o.x+o.width-(a.x+a.width),u=o.y+o.height-(a.y+a.height);if(n<s&&(n=s),r<l&&(r=l),c<n&&(n=c),u<r&&(r=u),!this.options.following){const o=e.x-t.originX,i=e.y-t.originY;n=o<=s||o>=c?0:n,r=i<=l||i>=u?0:r}}return{dx:n,dy:r}}updateElementPosition(e,t,n){const r=css(e,"left"),o=css(e,"top"),i=r?parseFloat(r):0,a=o?parseFloat(o):0;css(e,"left",i+t),css(e,"top",a+n)}updateSelectedNodesPosition(e){const{dx:t,dy:n}=e;if(t||n)if(this.translateSelectedNodes(t,n),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const e=this.graph.transform.getScale();for(let r=0,o=this.$boxes,i=o.length;r<i;r+=1)this.updateElementPosition(o[r],t*e.sx,n*e.sy);this.updateElementPosition(this.selectionContainer,t*e.sx,n*e.sy)}}autoScrollGraph(e,t){const n=this.graph.getPlugin("scroller");return n?n.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){const t=this.normalizeEvent(e),n=this.getEventData(t);switch(n.action){case"selecting":{const e=n;!0!==e.moving&&(appendTo(this.container,this.graph.container),this.showRubberband(),e.moving=!0);const{scrollerX:r,scrollerY:o}=this.autoScrollGraph(t.clientX,t.clientY);e.scrollerX+=r,e.scrollerY+=o;const i=t.clientX-e.clientX+e.scrollerX,a=t.clientY-e.clientY+e.scrollerY,s=parseInt(css(this.container,"left")||"0",10),l=parseInt(css(this.container,"top")||"0",10);css(this.container,{left:i<0?e.offsetX+i:s,top:a<0?e.offsetY+a:l,width:Math.abs(i),height:Math.abs(a)});break}case"translating":{const r=this.graph.snapToGrid(t.clientX,t.clientY),o=n,i=this.getSelectionOffset(r,o);this.options.following?this.updateSelectedNodesPosition(i):this.updateContainerPosition(i),i.dx&&(o.clientX=r.x),i.dy&&(o.clientY=r.y),this.notifyBoxEvent("box:mousemove",e,r.x,r.y);break}}this.boxesUpdated=!1}translateSelectedNodes(e,t,n,r){const o={},i=[];if(n&&(o[n.id]=!0),this.collection.toArray().forEach(e=>{e.getDescendants({deep:!0}).forEach(e=>{o[e.id]=!0})}),r&&r.translateBy){const e=this.graph.getCellById(r.translateBy);e&&(o[e.id]=!0,e.getDescendants({deep:!0}).forEach(e=>{o[e.id]=!0}),i.push(e))}this.collection.toArray().forEach(n=>{if(!o[n.id]){const a=Object.assign(Object.assign({},r),{selection:this.cid,exclude:i});n.translate(e,t,a),this.graph.model.getConnectedEdges(n).forEach(n=>{o[n.id]||(n.translate(e,t,a),o[n.id]=!0)})}})}getCellViewsInArea(e){const t=this.graph,n={strict:this.options.strict};let r=[];return this.options.rubberNode&&(r=r.concat(t.model.getNodesInArea(e,n).map(e=>t.renderer.findViewByCell(e)).filter(e=>null!=e))),this.options.rubberEdge&&(r=r.concat(t.model.getEdgesInArea(e,n).map(e=>t.renderer.findViewByCell(e)).filter(e=>null!=e))),r}notifyBoxEvent(e,t,n,r){const o=this.getEventData(t).activeView;this.trigger(e,{e:t,view:o,x:n,y:r,cell:o.cell})}getSelectedClassName(e){return this.prefixClassName((e.isNode()?"node":"edge")+"-selected")}addCellSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(remove(this.container.querySelector(`[data-cell-id="${e.id}"]`)),0===this.$boxes.length&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(e=>this.removeCellUnSelectedClassName(e)),this.hide(),remove(this.$boxes),this.boxCount=0}hide(){removeClass(this.container,this.prefixClassName(Private.classNames.rubberband)),removeClass(this.container,this.prefixClassName(Private.classNames.selected))}showRubberband(){addClass(this.container,this.prefixClassName(Private.classNames.rubberband))}hideRubberband(){removeClass(this.container,this.prefixClassName(Private.classNames.rubberband))}showSelected(){removeAttribute(this.container,"style"),addClass(this.container,this.prefixClassName(Private.classNames.selected))}createContainer(){this.container=document.createElement("div"),addClass(this.container,this.prefixClassName(Private.classNames.root)),this.options.className&&addClass(this.container,this.options.className),this.selectionContainer=document.createElement("div"),addClass(this.selectionContainer,this.prefixClassName(Private.classNames.inner)),this.selectionContent=document.createElement("div"),addClass(this.selectionContent,this.prefixClassName(Private.classNames.content)),append(this.selectionContainer,this.selectionContent),attr(this.selectionContainer,"data-selection-length",this.collection.length),prepend(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){const e={x:1/0,y:1/0},t={x:0,y:0};this.collection.toArray().filter(e=>this.canShowSelectionBox(e)).forEach(n=>{const r=this.graph.renderer.findViewByCell(n);if(r){const n=r.getBBox({useCellGeometry:!0});e.x=Math.min(e.x,n.x),e.y=Math.min(e.y,n.y),t.x=Math.max(t.x,n.x+n.width),t.y=Math.max(t.y,n.y+n.height)}}),css(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),attr(this.selectionContainer,"data-selection-length",this.collection.length);const n=this.options.content;if(n)if("function"==typeof n){const e=call$1(n,this.graph,this,this.selectionContent);e&&(this.selectionContent.innerHTML=e)}else this.selectionContent.innerHTML=n;this.collection.length>0&&!this.container.parentNode?appendTo(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&!0===this.options.showNodeSelectionBox||e.isEdge()&&!0===this.options.showEdgeSelectionBox}getPointerEventsValue(e){return"string"==typeof e?e:e(this.cells)}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){const t=this.graph.renderer.findViewByCell(e);if(t){const n=t.getBBox({useCellGeometry:!0}),r=this.boxClassName,o=document.createElement("div"),i=this.options.pointerEvents;addClass(o,r),addClass(o,`${r}-${e.isNode()?"node":"edge"}`),attr(o,"data-cell-id",e.id),css(o,{position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:i?this.getPointerEventsValue(i):"auto"}),appendTo(o,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let e=0,t=this.$boxes,n=t.length;e<n;e+=1){const n=t[e],r=attr(n,"data-cell-id");remove(n),this.boxCount-=1;const o=this.collection.get(r);o&&this.createSelectionBox(o)}this.updateContainer()}return 0}getCellViewFromElem(e){const t=e.getAttribute("data-cell-id");if(t){const e=this.collection.get(t);if(e)return this.graph.renderer.findViewByCell(e)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(e=>{this.listenCellRemoveEvent(e),this.createSelectionBox(e)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:n}){e.forEach(e=>{this.trigger("cell:selected",{cell:e,options:n}),e.isNode()?this.trigger("node:selected",{cell:e,options:n,node:e}):e.isEdge()&&this.trigger("edge:selected",{cell:e,options:n,edge:e})}),t.forEach(e=>{this.trigger("cell:unselected",{cell:e,options:n}),e.isNode()?this.trigger("node:unselected",{cell:e,options:n,node:e}):e.isEdge()&&this.trigger("edge:unselected",{cell:e,options:n,edge:e})});const r={added:e,removed:t,options:n,selected:this.cells.filter(e=>!!this.graph.getCellById(e.id))};this.trigger("selection:changed",r)}dispose(){this.clean(),this.remove(),this.off()}}__decorate$3([View.dispose()],SelectionImpl.prototype,"dispose",null),function(e){const t="widget-selection";e.classNames={root:t,inner:`${t}-inner`,box:`${t}-box`,content:`${t}-content`,rubberband:`${t}-rubberband`,selected:`${t}-selected`},e.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},e.depthComparator=function(e){return e.getAncestors().length}}(Private||(Private={}));const content$2=".x6-widget-selection {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n width: 0;\n height: 0;\n touch-action: none;\n}\n.x6-widget-selection-rubberband {\n display: block;\n overflow: visible;\n opacity: 0.3;\n}\n.x6-widget-selection-selected {\n display: block;\n}\n.x6-widget-selection-box {\n cursor: move;\n}\n.x6-widget-selection-inner[data-selection-length='0'],\n.x6-widget-selection-inner[data-selection-length='1'] {\n display: none;\n}\n.x6-widget-selection-content {\n position: absolute;\n top: 100%;\n right: -20px;\n left: -20px;\n margin-top: 30px;\n padding: 6px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-selection-content:empty {\n display: none;\n}\n.x6-widget-selection-rubberband {\n background-color: #3498db;\n border: 2px solid #2980b9;\n}\n.x6-widget-selection-box {\n box-sizing: content-box !important;\n margin-top: -4px;\n margin-left: -4px;\n padding-right: 4px;\n padding-bottom: 4px;\n border: 2px dashed #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-inner {\n box-sizing: content-box !important;\n margin-top: -8px;\n margin-left: -8px;\n padding-right: 12px;\n padding-bottom: 12px;\n border: 2px solid #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-content {\n color: #fff;\n font-size: 10px;\n background-color: #6a6b8a;\n}\n";Graph.prototype.isSelectionEnabled=function(){const e=this.getPlugin("selection");return!!e&&e.isEnabled()},Graph.prototype.enableSelection=function(){const e=this.getPlugin("selection");return e&&e.enable(),this},Graph.prototype.disableSelection=function(){const e=this.getPlugin("selection");return e&&e.disable(),this},Graph.prototype.toggleSelection=function(e){const t=this.getPlugin("selection");return t&&t.toggleEnabled(e),this},Graph.prototype.isMultipleSelection=function(){const e=this.getPlugin("selection");return!!e&&e.isMultipleSelection()},Graph.prototype.enableMultipleSelection=function(){const e=this.getPlugin("selection");return e&&e.enableMultipleSelection(),this},Graph.prototype.disableMultipleSelection=function(){const e=this.getPlugin("selection");return e&&e.disableMultipleSelection(),this},Graph.prototype.toggleMultipleSelection=function(e){const t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(e),this},Graph.prototype.isSelectionMovable=function(){const e=this.getPlugin("selection");return!!e&&e.isSelectionMovable()},Graph.prototype.enableSelectionMovable=function(){const e=this.getPlugin("selection");return e&&e.enableSelectionMovable(),this},Graph.prototype.disableSelectionMovable=function(){const e=this.getPlugin("selection");return e&&e.disableSelectionMovable(),this},Graph.prototype.toggleSelectionMovable=function(e){const t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(e),this},Graph.prototype.isRubberbandEnabled=function(){const e=this.getPlugin("selection");return!!e&&e.isRubberbandEnabled()},Graph.prototype.enableRubberband=function(){const e=this.getPlugin("selection");return e&&e.enableRubberband(),this},Graph.prototype.disableRubberband=function(){const e=this.getPlugin("selection");return e&&e.disableRubberband(),this},Graph.prototype.toggleRubberband=function(e){const t=this.getPlugin("selection");return t&&t.toggleRubberband(e),this},Graph.prototype.isStrictRubberband=function(){const e=this.getPlugin("selection");return!!e&&e.isStrictRubberband()},Graph.prototype.enableStrictRubberband=function(){const e=this.getPlugin("selection");return e&&e.enableStrictRubberband(),this},Graph.prototype.disableStrictRubberband=function(){const e=this.getPlugin("selection");return e&&e.disableStrictRubberband(),this},Graph.prototype.toggleStrictRubberband=function(e){const t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(e),this},Graph.prototype.setRubberbandModifiers=function(e){const t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(e),this},Graph.prototype.setSelectionFilter=function(e){const t=this.getPlugin("selection");return t&&t.setSelectionFilter(e),this},Graph.prototype.setSelectionDisplayContent=function(e){const t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(e),this},Graph.prototype.isSelectionEmpty=function(){const e=this.getPlugin("selection");return!e||e.isEmpty()},Graph.prototype.cleanSelection=function(e){const t=this.getPlugin("selection");return t&&t.clean(e),this},Graph.prototype.resetSelection=function(e,t){const n=this.getPlugin("selection");return n&&n.reset(e,t),this},Graph.prototype.getSelectedCells=function(){const e=this.getPlugin("selection");return e?e.getSelectedCells():[]},Graph.prototype.getSelectedCellCount=function(){const e=this.getPlugin("selection");return e?e.getSelectedCellCount():0},Graph.prototype.isSelected=function(e){const t=this.getPlugin("selection");return!!t&&t.isSelected(e)},Graph.prototype.select=function(e,t){const n=this.getPlugin("selection");return n&&n.select(e,t),this},Graph.prototype.unselect=function(e,t){const n=this.getPlugin("selection");return n&&n.unselect(e,t),this};var __decorate$2=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Selection2;class Selection extends Basecoat{get rubberbandDisabled(){return!0!==this.options.enabled||!0!==this.options.rubberband}get disabled(){return!0!==this.options.enabled}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},Selection.defaultOptions),e),ensure(this.name,content$2)}init(e){this.graph=e,this.selectionImpl=new SelectionImpl(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(e){return null!=e?e!==this.isMultipleSelection()&&(e?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return!1!==this.options.movable}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(e){return null!=e?e!==this.isSelectionMovable()&&(e?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(e){return null!=e?e!==this.isRubberbandEnabled()&&(e?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return!0===this.selectionImpl.options.strict}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(e){return null!=e?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){const n=this.getCells(e);return n.length&&(this.isMultiple()?this.selectionImpl.select(n,t):this.reset(n.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.panning.allowPanning(e,!0),n=this.graph.getPlugin("scroller"),r=n&&n.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!r&&!t)&&this.startRubberband(e)}allowBlankMouseDown(e){const t=this.options.eventTypes;return(null==t?void 0:t.includes("leftMouseDown"))&&0===e.button||(null==t?void 0:t.includes("mouseWheelDown"))&&1===e.button}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&ModifierKey.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&ModifierKey.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e:e,cell:t}){const n=this.options;let r=this.disabled;!r&&this.movedMap.has(t)&&(r=!1===n.selectCellOnMoved,r||(r=!1===n.selectNodeOnMoved&&t.isNode()),r||(r=!1===n.selectEdgeOnMoved&&t.isEdge())),r||(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e:e,cell:t}){this.disabled||this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(e=>"string"==typeof e?this.graph.getCellById(e):e).filter(e=>null!=e)}startRubberband(e){return this.rubberbandDisabled||this.selectionImpl.startSelecting(e),this}isMultiple(){return!1!==this.options.multiple}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),clean(this.name)}}__decorate$2([Basecoat.dispose()],Selection.prototype,"dispose",null),Selection2=Selection||(Selection={}),Selection2.defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]};var __decorate$1=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},__rest=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};class SnaplineImpl extends View{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(e){super();const{graph:t}=e,n=__rest(e,["graph"]);this.graph=t,this.options=Object.assign({},n),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(e){this.options.filter=e}render(){const e=this.containerWrapper=new Vector("svg"),t=this.horizontal=new Vector("line"),n=this.vertical=new Vector("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),n.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),n.setAttribute("display","none"),e.append([t,n]),this.options.className&&e.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:e,data:t}){"resize"===e&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:n}){const r=e.getDelegatedView();if(r&&this.isNodeMovable(r)){const r=e.cell.getPosition();this.offset={x:t-r.x,y:n-r.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){const t=this.graph.options.translating.restrict,n="function"==typeof t?call$1(t,this.graph,e):t;return"number"==typeof n?this.graph.transform.getGraphArea().inflate(n):!0===n?this.graph.transform.getGraphArea():n||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){const n=this.graph.renderer.findViewByCell(e);if(n&&n.cell.isNode()){const r=e.getBBox(),o=r.bbox(e.getAngle()),i=o.getTopLeft(),a=o.getBottomRight(),s=Angle.normalize(e.getAngle()),l=this.options.tolerance||0;let c,u,d,p,f,h;const g={vertical:0,horizontal:0},m=t.direction,y=t.trueDirection,v=t.relativeDirection;-1!==y.indexOf("right")?g.vertical=a.x:g.vertical=i.x,-1!==y.indexOf("bottom")?g.horizontal=a.y:g.horizontal=i.y,this.model.getNodes().some(t=>{if(this.isIgnored(e,t))return!1;const n=t.getBBox().bbox(t.getAngle()),r=n.getTopLeft(),i=n.getBottomRight(),s={vertical:[r.x,i.x],horizontal:[r.y,i.y]},m={};return Object.keys(s).forEach(e=>{const t=e,n=s[t].map(e=>({position:e,distance:Math.abs(e-g[t])})).filter(e=>e.distance<=l);m[t]=sortBy(n,e=>e.distance)}),null==c&&m.vertical.length>0&&(c=m.vertical[0].position,u=Math.min(o.y,n.y),d=Math.max(a.y,i.y)-u),null==p&&m.horizontal.length>0&&(p=m.horizontal[0].position,f=Math.min(o.x,n.x),h=Math.max(a.x,i.x)-f),null!=c&&null!=p}),this.hide();let b=0,_=0;null==p&&null==c||(null!=c&&(b=-1!==y.indexOf("right")?c-a.x:i.x-c),null!=p&&(_=-1!==y.indexOf("bottom")?p-a.y:i.y-p));let E=0,S=0;if(s%90==0)90===s||270===s?(E=_,S=b):(E=b,S=_);else{const e=s>=0&&s<90?1:s>=90&&s<180?4:s>=180&&s<270?3:2;null!=p&&null!=c&&(b<_?(_=0,p=void 0):(b=0,c=void 0));const t=Angle.toRad(s%90);b&&(E=3===e?b/Math.cos(t):b/Math.sin(t)),_&&(S=3===e?_/Math.cos(t):_/Math.sin(t));const n=1===e||3===e;switch(v){case"top":case"bottom":S=_?_/(n?Math.cos(t):Math.sin(t)):b/(n?Math.sin(t):Math.cos(t));break;case"left":case"right":E=b?b/(n?Math.cos(t):Math.sin(t)):_/(n?Math.sin(t):Math.cos(t))}}switch(v){case"top":case"bottom":E=0;break;case"left":case"right":S=0}const x=this.graph.getGridSize();let w=Math.max(r.width+E,x),C=Math.max(r.height+S,x);t.minWidth&&t.minWidth>x&&(w=Math.max(w,t.minWidth)),t.minHeight&&t.minHeight>x&&(C=Math.max(C,t.minHeight)),t.maxWidth&&(w=Math.min(w,t.maxWidth)),t.maxHeight&&(C=Math.min(C,t.maxHeight)),t.preserveAspectRatio&&(S<E?C=w*(r.height/r.width):w=C*(r.width/r.height)),w===r.width&&C===r.height||(e.resize(w,C,{direction:m,relativeDirection:v,trueDirection:y,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(n)}),d&&(d+=C-r.height),h&&(h+=w-r.width));const R=e.getBBox().bbox(s);c&&Math.abs(R.x-c)>1&&Math.abs(R.width+R.x-c)>1&&(c=void 0),p&&Math.abs(R.y-p)>1&&Math.abs(R.height+R.y-p)>1&&(p=void 0),this.update({verticalLeft:c,verticalTop:u,verticalHeight:d,horizontalTop:p,horizontalLeft:f,horizontalWidth:h})}}}snapOnMoving({view:e,e:t,x:n,y:r}){const o=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(o))return;const i=o.cell,a=i.getSize(),s=i.getPosition(),l=new Rectangle(n-this.offset.x,r-this.offset.y,a.width,a.height),c=i.getAngle(),u=l.getCenter(),d=l.bbox(c),p=d.getTopLeft(),f=d.getBottomRight(),h=this.options.tolerance||0;let g,m,y,v,b,_,E=0,S=0;if(this.model.getNodes().some(e=>{if(this.isIgnored(i,e))return!1;const t=e.getBBox().bbox(e.getAngle()),n=t.getCenter(),r=t.getTopLeft(),o=t.getBottomRight();return null==g&&(Math.abs(n.x-u.x)<h?(g=n.x,E=.5):Math.abs(r.x-p.x)<h?(g=r.x,E=0):Math.abs(r.x-f.x)<h?(g=r.x,E=1):Math.abs(o.x-f.x)<h?(g=o.x,E=1):Math.abs(o.x-p.x)<h&&(g=o.x),null!=g&&(m=Math.min(d.y,t.y),y=Math.max(f.y,o.y)-m)),null==v&&(Math.abs(n.y-u.y)<h?(v=n.y,S=.5):Math.abs(r.y-p.y)<h?v=r.y:Math.abs(r.y-f.y)<h?(v=r.y,S=1):Math.abs(o.y-f.y)<h?(v=o.y,S=1):Math.abs(o.y-p.y)<h&&(v=o.y),null!=v&&(b=Math.min(d.x,t.x),_=Math.max(f.x,o.x)-b)),null!=g&&null!=v}),this.hide(),null!=v||null!=g){null!=v&&(d.y=v-S*d.height),null!=g&&(d.x=g-E*d.width);const e=d.getCenter(),t=e.x-l.width/2,n=e.y-l.height/2,r=t-s.x,a=n-s.y;0===r&&0===a||(i.translate(r,a,{snapped:!0,restrict:this.getRestrictArea(o)}),_&&(_+=r),y&&(y+=a)),this.update({verticalLeft:g,verticalTop:m,verticalHeight:y,horizontalTop:v,horizontalLeft:b,horizontalWidth:_})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){const t=this.options.filter;return Array.isArray(t)?t.some(t=>"string"==typeof t?e.shape===t:e.id===t.id):"function"!=typeof t||call$1(t,this.graph,e)}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new Point(e.horizontalLeft,e.horizontalTop)),n=this.graph.localToGraph(new Point(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${n.x}`:"100%",y2:`${n.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){const t=this.graph.localToGraph(new Point(e.verticalLeft,e.verticalTop)),n=this.graph.localToGraph(new Point(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.y}`:"0",x2:`${n.x}`,y2:this.options.sharp?`${n.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),null==this.container.parentNode&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const e=this.options.clean,t="number"==typeof e?e:!1!==e?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{null!==this.container.parentNode&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}__decorate$1([View.dispose()],SnaplineImpl.prototype,"dispose",null);const content$1=".x6-widget-snapline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n.x6-widget-snapline-vertical,\n.x6-widget-snapline-horizontal {\n stroke: #2ecc71;\n stroke-width: 1px;\n}\n";Graph.prototype.isSnaplineEnabled=function(){const e=this.getPlugin("snapline");return!!e&&e.isEnabled()},Graph.prototype.enableSnapline=function(){const e=this.getPlugin("snapline");return e&&e.enable(),this},Graph.prototype.disableSnapline=function(){const e=this.getPlugin("snapline");return e&&e.disable(),this},Graph.prototype.toggleSnapline=function(){const e=this.getPlugin("snapline");return e&&e.toggleEnabled(),this},Graph.prototype.hideSnapline=function(){const e=this.getPlugin("snapline");return e&&e.hide(),this},Graph.prototype.setSnaplineFilter=function(e){const t=this.getPlugin("snapline");return t&&t.setFilter(e),this},Graph.prototype.isSnaplineOnResizingEnabled=function(){const e=this.getPlugin("snapline");return!!e&&e.isOnResizingEnabled()},Graph.prototype.enableSnaplineOnResizing=function(){const e=this.getPlugin("snapline");return e&&e.enableOnResizing(),this},Graph.prototype.disableSnaplineOnResizing=function(){const e=this.getPlugin("snapline");return e&&e.disableOnResizing(),this},Graph.prototype.toggleSnaplineOnResizing=function(e){const t=this.getPlugin("snapline");return t&&t.toggleOnResizing(e),this},Graph.prototype.isSharpSnapline=function(){const e=this.getPlugin("snapline");return!!e&&e.isSharp()},Graph.prototype.enableSharpSnapline=function(){const e=this.getPlugin("snapline");return e&&e.enableSharp(),this},Graph.prototype.disableSharpSnapline=function(){const e=this.getPlugin("snapline");return e&&e.disableSharp(),this},Graph.prototype.toggleSharpSnapline=function(e){const t=this.getPlugin("snapline");return t&&t.toggleSharp(e),this},Graph.prototype.getSnaplineTolerance=function(){const e=this.getPlugin("snapline");if(e)return e.getTolerance()},Graph.prototype.setSnaplineTolerance=function(e){const t=this.getPlugin("snapline");return t&&t.setTolerance(e),this};var __decorate=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};class Snapline extends Disposable{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),ensure(this.name,content$1)}init(e){this.snaplineImpl=new SnaplineImpl(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(null==e)return this.isEnabled()?this.disable():this.enable(),this;e!==this.isEnabled()&&(e?this.enable():this.disable())}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),this}isOnResizingEnabled(){return!0===this.snaplineImpl.options.resizing}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(e){return null!=e?e!==this.isOnResizingEnabled()&&(e?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return!0===this.snaplineImpl.options.sharp}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(e){return null!=e?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),clean(this.name)}}__decorate([Disposable.dispose()],Snapline.prototype,"dispose",null);let nanoid=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_","");const CellPanel=e=>{var t,n,r,o,i,a,s,l,c,u,d;const{cell:p,graph:f}=e,[h,g]=React.useState(p.prop());React.useEffect(()=>{},[h]),React.useEffect(()=>{g(p.prop());const e=e=>{const t={...e.cell.prop()};g(t)};return p.on("changed",e),()=>{p.off("changed",e)}},[p]);const m=(e,t)=>{p.prop(e,t)};let y=0,v=0;"edge"===h.shape&&([y,v]=calculateDistanceAndAngle([h.source.x,h.source.y],[h.target.x,h.target.y]));let b="";b="edge"===h.shape?(null==(o=null==(r=null==(n=null==(t=h.labels)?void 0:t[0])?void 0:n.attrs)?void 0:r.label)?void 0:o.text)||"":(null==(a=null==(i=h.attrs)?void 0:i.text)?void 0:a.text)||"";let _=0;return _="edge"===h.shape?(null==(u=null==(c=null==(l=null==(s=h.labels)?void 0:s[0])?void 0:l.attrs)?void 0:c.text)?void 0:u.fontSize)||14:null==(d=h.attrs)?void 0:d.text.fontSize,jsxRuntimeExports.jsxs("div",{className:"cell-panel",children:[jsxRuntimeExports.jsx(PanelOne,{title:"大小"}),"rect"===h.shape||"text"===h.shape?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Space,{size:20,children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"宽"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:h.size.width,onChange:e=>{m("size/width",e)}})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"高"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:h.size.height,onChange:e=>{m("size/height",e)}})]})]})}):"circle"===h.shape?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"半径"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},value:h.size.width,min:0,onChange:e=>{m("size",{width:e,height:e})}})]}):"edge"===h.shape?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"长"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},value:y,min:0,onChange:e=>{const[t,n]=calculateEndPoint([h.source.x,h.source.y],v,e);m("target",{x:t,y:n})}})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),jsxRuntimeExports.jsx(PanelOne,{title:"旋转"}),jsxRuntimeExports.jsx(PanelTwo,{title:"角度"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:"edge"===h.shape?v:h.angle,onChange:e=>{if("edge"===h.shape){const[t,n]=calculateEndPoint([h.source.x,h.source.y],e,y);return void m("target",{x:t,y:n})}m("angle",e)}}),jsxRuntimeExports.jsx(PanelOne,{title:"文本"}),jsxRuntimeExports.jsx(PanelTwo,{title:"内容"}),jsxRuntimeExports.jsx(Input.TextArea,{style:{resize:"none",height:"100px",marginBottom:"16px",background:"#f7f8fa"},value:b,onChange:e=>{const t=e.target.value;"edge"!==h.shape?m("attrs/text/text",t):h.labels?p.setLabelAt(0,t):p.appendLabel({attrs:{text:{text:t}}})}}),jsxRuntimeExports.jsx(PanelTwo,{title:"字号"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"16px"},value:_,min:0,onChange:e=>{"edge"!==h.shape||null==e?m("attrs/text/fontSize",e):h.labels?p.setLabelAt(0,{attrs:{label:{text:b},text:{fontSize:e}}}):p.appendLabel({attrs:{label:{text:b},text:{fontSize:e}}})}})]})},PanelOne=e=>{const{title:t}=e;return jsxRuntimeExports.jsx("div",{className:"cell-panel-one",children:t})},PanelTwo=e=>{const{title:t}=e;return jsxRuntimeExports.jsx("div",{className:"cell-panel-two",children:t})};function calculateDistanceAndAngle(e,t){const[n,r]=e,[o,i]=t,a=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2));let s=Math.atan2(i-r,o-n)*(180/Math.PI);s<0&&(s+=360);return[Math.floor(a),Math.floor(s)]}function calculateEndPoint(e,t,n){const[r,o]=e,i=t*(Math.PI/180),a=r+n*Math.cos(i),s=o+n*Math.sin(i);return[Math.round(a),Math.round(s)]}const{Text:Text}=Typography,KeyBordModal=e=>{const{children:t}=e;return jsxRuntimeExports.jsx(Popover,{arrow:!1,trigger:"click",rootClassName:"drawx6-keybordermodal-pop",content:jsxRuntimeExports.jsx("div",{className:"drawx6-keybordermodal-pop-content",children:jsxRuntimeExports.jsx(List,{bordered:!1,dataSource:[{key:["Ctrl","C"],desc:"拷贝"},{key:["Ctrl","V"],desc:"粘贴"},{key:["Ctrl","X"],desc:"剪切"},{key:["Ctrl","Z"],desc:"撤销"},{key:["Ctrl","Shift","Z"],desc:"重做"},{key:["BackSpace"],desc:"删除"},{key:["Ctrl","鼠标拖动"],desc:"平移"},{key:["Ctrl","鼠标滚轮"],desc:"缩放"}],renderItem:(e,t)=>jsxRuntimeExports.jsx(List.Item,{children:jsxRuntimeExports.jsxs(Space,{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[jsxRuntimeExports.jsx(Space,{size:6,children:e.key.map((e,t,n)=>jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsx(Tag,{style:{marginRight:0},children:e}),t<n.length-1&&"+"]},t))}),jsxRuntimeExports.jsx(Text,{strong:!0,children:e.desc})]})},t)})}),children:t})},content=".x6-widget-edgednd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n }\n .x6-widget-edgednd.dragging {\n display: inline-block;\n }\n .x6-widget-edgednd.dragging * {\n pointer-events: none !important;\n }\n .x6-widget-edgednd .x6-graph {\n background: transparent;\n box-shadow: none;\n }\n ",_EdgeDnd=class e extends View{constructor(e){super(),__publicField(this,"name","edgednd"),__publicField(this,"options"),__publicField(this,"draggingGraph"),__publicField(this,"sourceEdge"),__publicField(this,"draggingEdge"),__publicField(this,"length",0),__publicField(this,"draggingBBox"),__publicField(this,"geometryBBox"),__publicField(this,"draggingView"),__publicField(this,"delta"),__publicField(this,"padding"),__publicField(this,"snapOffset"),__publicField(this,"originOffset"),this.options={...e,getDragEdge:e=>e.clone(),getDropEdge:e=>e.clone()},this.init()}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}init(){ensure(this.name,content),this.container=document.createElement("div"),addClass(this.container,this.prefixClassName("widget-edgednd")),this.draggingGraph=new Graph({...this.options.delegateGraphOptions,container:document.createElement("div"),width:1,height:1,async:!1}),append(this.container,this.draggingGraph.container)}start(t,n,r){const o=r;o.preventDefault(),this.length=n,this.targetModel.startBatch("edgednd"),addClass(this.container,"dragging"),appendTo(this.container,this.options.draggingContainer||document.body),this.sourceEdge=t,this.prepareDragging(t,o.clientX,o.clientY),this.updateNodePosition(o.clientX,o.clientY),this.delegateDocumentEvents(e.documentEvents,o.data)}prepareDragging(e,t,n){const r=this.draggingGraph,o=r.model,i=this.options.getDragEdge(e);i.setSource({x:0,y:0}),i.setTarget({x:0+this.length,y:0});r.scale(1,1),this.clearDragging(),o.resetCells([i]);const a=r.findViewByCell(i);a.undelegateEvents(),a.cell.off("changed"),r.fitToContent({padding:5,allowNewOrigin:"any",useCellGeometry:!1});const s=a.getBBox();this.geometryBBox=a.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(s.getTopLeft()),this.draggingEdge=i,this.draggingView=a,this.draggingBBox=i.getBBox(),this.padding=5,this.originOffset=this.updateGraphPosition(t,n)}clearDragging(){this.draggingEdge&&(this.sourceEdge=null,this.draggingEdge.remove(),this.draggingEdge=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}updateGraphPosition(e,t){const n=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft,o=this.delta,i=this.geometryBBox,a=this.padding||5,s={left:e-o.x-i.width/2-a+r,top:t-o.y-i.height/2-a+n};return this.draggingGraph&&css(this.container,{left:`${s.left}px`,top:`${s.top}px`}),s}updateNodePosition(e,t){const n=this.targetGraph.clientToLocal(e,t),r=this.draggingBBox;return n.x-=r.width/2,n.y-=r.height/2,this.draggingEdge.setSource({x:n.x,y:n.y}),this.draggingEdge.setTarget({x:n.x+this.length,y:n.y}),n}onDragging(e){if(this.draggingView){e.preventDefault();const t=this.normalizeEvent(e),n=t.clientX,r=t.clientY;this.updateGraphPosition(n,r),this.updateNodePosition(n,r)}}onDragEnd(e){const t=this.draggingEdge;if(t){const n=this.normalizeEvent(e);this.draggingView;const r=this.draggingBBox,o=this.snapOffset;let i=r.x,a=r.y;o&&(i+=o.x,a+=o.y),t.setSource({x:i,y:a}),t.setTarget({x:i+this.length,y:a});(e=>{e?this.onDropped(e):this.onDropInvalid(),this.targetModel.stopBatch("edgednd")})(this.drop(t,{x:n.clientX,y:n.clientY}))}}drop(e,t){if(this.isInsideValidArea(t)){const n=this.targetGraph,r=n.model,o=n.clientToLocal(t),i=this.options.getDropEdge(e),a=i.getBBox();o.x+=a.x-a.width/2,o.y+=a.y-a.height/2;const s=this.snapOffset?1:n.getGridSize(),l=GeometryUtil.snapToGrid(o.x,s),c=GeometryUtil.snapToGrid(o.y,s);return i.setSource({x:l,y:c}),i.setTarget({x:l+this.length,y:c}),i.removeZIndex(),r.addCell(i,{stencil:this.cid}),i}return null}isInsideValidArea(e){let t;const n=this.targetGraph;return t=this.getDropArea(n.container),t&&t.containsPoint(e)}getDropArea(e){const t=offset$1(e),n=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return Rectangle.create({x:t.left+parseInt(css(e,"border-left-width"),10)-r,y:t.top+parseInt(css(e,"border-top-width"),10)-n,width:e.clientWidth,height:e.clientHeight})}onDropInvalid(){const e=this.draggingEdge;e&&this.onDropped(e)}onDropped(e){this.clearDragging(),removeClass(this.container,"dragging"),remove(this.container)}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),clean(this.name)}};__publicField(_EdgeDnd,"documentEvents",{mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"});let EdgeDnd=_EdgeDnd;const activeColor="#1677ff",normalColor="#999999",ports={groups:{top:{position:"top",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},right:{position:"right",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},bottom:{position:"bottom",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},left:{position:"left",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}}},items:[{group:"top"},{group:"right"},{group:"bottom"},{group:"left"}]},Editor=React.forwardRef((e,t)=>{const{value:n,onSave:r,onExit:o,savePngType:i="url",editabled:a=!0,showSaveBtn:s=!0}=e,{topProps:l}=useQuestionContext(),{uploadImg:c}=l,u=React.useRef(null),d=React.useRef(null),p=React.useRef(null),f=React.useRef(null),[h,g]=React.useState(!1),[m,y]=React.useState(null),[v,b]=React.useState(!1);React.useEffect(()=>(u.current&&_(u.current),()=>{var e;null==(e=d.current)||e.dispose()}),[]),React.useEffect(()=>{var e;(null==n?void 0:n.cells)&&(null==(e=d.current)||e.fromJSON(n.cells))},[n]);const _=e=>{d.current=new Graph({container:e,autoResize:!0,background:{color:"#ffffff"},grid:{visible:!0,size:10,type:"dot",args:{color:"#a0a0a0",thickness:1}},panning:{enabled:!0,modifiers:["ctrl","meta"]},mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:["ctrl","meta"],minScale:.5,maxScale:3},interacting:a,connecting:{createEdge:()=>new Edge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},tools:["edge-editor"]})},highlighting:{magnetAdsorbed:{name:"stroke",args:{attrs:{"stroke-width":1,stroke:activeColor}}}}}),S(d.current),E(d.current),x(d.current),w(d.current)},E=e=>{e.use(new Export),e.use(new Transform({resizing:{enabled:!0,preserveAspectRatio:e=>"circle"===e.shape},rotating:!0})),e.use(new Selection({rubberband:!0,showNodeSelectionBox:!0})),e.use(new Snapline({className:"x6-snapline-color"})),e.use(new Keyboard),e.use(new Clipboard),e.use(new History)},S=e=>{p.current=new Dnd({target:e}),f.current=new EdgeDnd({target:e})},x=e=>{const t=(e,t)=>{for(let n=0,r=e.length;n<r;n+=1)e[n].style.visibility=t?"visible":"hidden"};e.on("node:mouseenter",({e:e,node:n,view:r})=>{const o=u.current.querySelectorAll(".x6-port-body");t(o,!0)}),e.on("node:mouseleave",({e:e,node:n,view:r})=>{const o=u.current.querySelectorAll(".x6-port-body");t(o,!1)}),e.on("cell:click",({e:e,x:t,y:n,cell:r,view:o})=>{"edge"!==r.shape&&(g(!0),y(r))}),e.on("blank:click",({e:e,x:t,y:n})=>{g(!1),y(null)})},w=e=>{e.bindKey(["meta+c","ctrl+c"],()=>{const t=e.getSelectedCells();return t.length&&e.copy(t,{deep:!0}),!1}),e.bindKey(["meta+x","ctrl+x"],()=>{const t=e.getSelectedCells();return t.length&&e.cut(t,{deep:!0}),!1}),e.bindKey(["meta+v","ctrl+v"],()=>{if(!e.isClipboardEmpty()){const t=e.paste({offset:32});e.cleanSelection(),e.select(t)}return!1}),e.bindKey(["meta+z","ctrl+z"],()=>(e.canUndo()&&e.undo(),!1)),e.bindKey(["meta+shift+z","ctrl+shift+z"],()=>(e.canRedo()&&e.redo(),!1)),e.bindKey("backspace",()=>{const t=e.getSelectedCells();t.length&&e.removeCells(t)})},C=e=>{let t=null;switch(e.currentTarget.getAttribute("data-type")){case"rect":t=d.current.createNode({width:80,height:40,shape:"rect",label:"矩形",attrs:{body:{stroke:normalColor,strokeWidth:1,fill:"#fff"}},ports:{...ports},tools:["node-editor"]});break;case"circle":t=d.current.createNode({width:60,height:60,shape:"circle",label:"圆形",attrs:{body:{stroke:normalColor,strokeWidth:1,fill:"#fff"}},ports:{...ports},tools:["node-editor"]});break;case"text":t=d.current.createNode({width:80,height:40,shape:"text",tools:["node-editor"]});break;case"hori-line":t=d.current.createEdge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:null,sourceMarker:null}},tools:[{name:"edge-editor",args:{labelAddable:!0}},{name:"source-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}},{name:"target-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}}]});break;case"arrow":t=d.current.createEdge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},tools:["edge-editor",{name:"source-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}},{name:"target-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}}]})}t&&(t.isNode()?p.current.start(t,e.nativeEvent):f.current.start(t,100,e.nativeEvent))},R=async()=>new Promise(e=>{var t,n;const r=null==(t=d.current)?void 0:t.toJSON();null==(n=d.current)||n.toPNG(t=>{e({json:r,png:t})},{padding:20,copyStyles:!1})}),T=async(e=!1)=>{if(e){b(!0);const e=await R();if("url"===i){const t=k(e.png),n=new FormData;n.append("file",t);const r=await(null==c?void 0:c({file:n}).catch(()=>{}));(null==r?void 0:r.url)&&(e.png=r.url)}null==r||r(e),b(!1)}null==o||o()},k=e=>{const t=e.replace(/^data:image\/png;base64,/,""),n=atob(t),r=n.length,o=new ArrayBuffer(r),i=new Uint8Array(o);for(let l=0;l<r;l++)i[l]=n.charCodeAt(l);const a=new Blob([o],{type:"image/png"}),s=`${nanoid()}.png`;return new File([a],s,{type:"image/png"})};return React.useImperativeHandle(t,()=>({getGraphInstance:()=>d.current,getData:async()=>{const e=await R();if("url"===i){const t=k(e.png),n=new FormData;n.append("file",t);const r=await(null==c?void 0:c({file:n}).catch(()=>{}));(null==r?void 0:r.url)&&(e.png=r.url)}return e}})),jsxRuntimeExports.jsxs("div",{className:classNames("drawx6","drawx6-editor"),children:[jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-header drawx6-space",children:[jsxRuntimeExports.jsx("div",{children:"画板"}),jsxRuntimeExports.jsxs(Space,{size:10,children:[jsxRuntimeExports.jsx(Button$1,{ghost:!0,type:"primary",onClick:()=>T(!1),children:"仅退出"}),s&&jsxRuntimeExports.jsx(Button$1,{loading:v,type:"primary",onClick:()=>T(!0),children:"保存并退出"})]})]}),jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-container",children:[jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx("div",{ref:u,className:"drawx6-container"})}),jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-container-nav drawx6-overflow-y",children:[jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"rect",onMouseDown:C,children:[jsxRuntimeExports.jsx("div",{className:"graph-rect"}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"矩形"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"circle",onMouseDown:C,children:[jsxRuntimeExports.jsx("div",{className:"graph-circle"}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"圆形"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"text",onMouseDown:C,children:[jsxRuntimeExports.jsx(TextSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"文本"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"hori-line",onMouseDown:C,children:[jsxRuntimeExports.jsx(LineSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"水平线"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"arrow",onMouseDown:C,children:[jsxRuntimeExports.jsx(ArrawSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"箭头"})]}),jsxRuntimeExports.jsx(KeyBordModal,{children:jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space",style:{cursor:"default"},children:[jsxRuntimeExports.jsx(KeyBoard,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"快捷键"})]})})]}),jsxRuntimeExports.jsx(Popconfirm,{title:null,description:jsxRuntimeExports.jsxs("div",{style:{marginTop:"-4px"},children:["确认清空画板?清空后无法恢复,",jsxRuntimeExports.jsx("br",{}),"请谨慎操作。"]}),onConfirm:()=>{var e;null==(e=d.current)||e.clearCells()},placement:"bottomRight",arrow:!1,children:jsxRuntimeExports.jsx("div",{className:"drawx6-editor-container-clear drawx6-center",style:{right:h?"220px":"20px"},children:jsxRuntimeExports.jsx(ClearSvg,{})})}),h&&jsxRuntimeExports.jsx("div",{className:"drawx6-editor-container-control drawx6-overflow-y",children:jsxRuntimeExports.jsx(CellPanel,{cell:m,graph:d.current})})]})]})}),TextSvg=()=>jsxRuntimeExports.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("g",{clipPath:"url(#clip0_6137_1319)",children:jsxRuntimeExports.jsx("path",{d:"M13.5394 28.9231H12.3086C11.9394 28.9231 11.6932 29.1692 11.6932 29.5385C11.6932 29.9077 11.9394 30.1539 12.3086 30.1539H13.5394C13.9086 30.1539 14.1547 29.9077 14.1547 29.5385C14.1547 29.1692 13.9086 28.9231 13.5394 28.9231ZM6.15475 28.9231H4.92398C4.8009 28.9231 4.67782 28.9846 4.61629 29.0462V28.3077C4.61629 27.8154 4.18552 27.3846 3.69321 27.3846H1.23167C0.739363 27.3846 0.308594 27.8154 0.308594 28.3077V30.7692C0.308594 31.2615 0.739363 31.6923 1.23167 31.6923H3.69321C4.18552 31.6923 4.61629 31.2615 4.61629 30.7692V30.0308C4.67782 30.0923 4.8009 30.1539 4.92398 30.1539H6.15475C6.52398 30.1539 6.77013 29.9077 6.77013 29.5385C6.77013 29.1692 6.52398 28.9231 6.15475 28.9231ZM3.07782 6.15385C3.07782 5.78462 2.83167 5.53846 2.46244 5.53846C2.09321 5.53846 1.84706 5.78462 1.84706 6.15385V7.38462C1.84706 7.75385 2.09321 8 2.46244 8C2.83167 8 3.07783 7.75385 3.07782 7.38462V6.15385ZM9.84706 28.9231H8.61629C8.24706 28.9231 8.0009 29.1692 8.0009 29.5385C8.0009 29.9077 8.24706 30.1539 8.61629 30.1539H9.84706C10.2163 30.1539 10.4624 29.9077 10.4624 29.5385C10.4624 29.1692 10.2163 28.9231 9.84706 28.9231ZM7.38552 1.84616H6.15475C5.78552 1.84616 5.53936 2.09231 5.53936 2.46154C5.53936 2.83077 5.78552 3.07692 6.15475 3.07692H7.38552C7.75475 3.07692 8.0009 2.83077 8.0009 2.46154C8.0009 2.09231 7.75475 1.84616 7.38552 1.84616ZM3.07782 17.2308C3.07782 16.8615 2.83167 16.6154 2.46244 16.6154C2.09321 16.6154 1.84706 16.8615 1.84706 17.2308V18.4615C1.84706 18.8308 2.09321 19.0769 2.46244 19.0769C2.83167 19.0769 3.07783 18.8308 3.07782 18.4615V17.2308ZM3.07782 20.9231C3.07782 20.5539 2.83167 20.3077 2.46244 20.3077C2.09321 20.3077 1.84706 20.5539 1.84706 20.9231V22.1539C1.84706 22.5231 2.09321 22.7692 2.46244 22.7692C2.83167 22.7692 3.07783 22.5231 3.07782 22.1539V20.9231ZM3.07782 9.84616C3.07782 9.47693 2.83167 9.23077 2.46244 9.23077C2.09321 9.23077 1.84706 9.47693 1.84706 9.84616V11.0769C1.84706 11.4462 2.09321 11.6923 2.46244 11.6923C2.83167 11.6923 3.07783 11.4462 3.07782 11.0769V9.84616ZM13.5394 3.07692H14.7701C15.1394 3.07692 15.3855 2.83077 15.3855 2.46154C15.3855 2.09231 15.1394 1.84616 14.7701 1.84616H13.5394C13.1701 1.84616 12.924 2.09231 12.924 2.46154C12.924 2.83077 13.1701 3.07692 13.5394 3.07692ZM2.46244 24C2.09321 24 1.84706 24.2462 1.84706 24.6154V25.8462C1.84706 26.2154 2.09321 26.4615 2.46244 26.4615C2.83167 26.4615 3.07783 26.2154 3.07782 25.8462V24.6154C3.07782 24.2462 2.83167 24 2.46244 24ZM3.07782 13.5385C3.07782 13.1692 2.83167 12.9231 2.46244 12.9231C2.09321 12.9231 1.84706 13.1692 1.84706 13.5385V14.7692C1.84706 15.1385 2.09321 15.3846 2.46244 15.3846C2.83167 15.3846 3.07783 15.1385 3.07782 14.7692V13.5385ZM20.924 3.07692H22.1548C22.524 3.07692 22.7701 2.83077 22.7701 2.46154C22.7701 2.09231 22.524 1.84616 22.1548 1.84616H20.924C20.5548 1.84616 20.3086 2.09231 20.3086 2.46154C20.3086 2.83077 20.5548 3.07692 20.924 3.07692ZM28.924 20.9231C28.924 21.2923 29.1701 21.5385 29.5394 21.5385C29.9086 21.5385 30.1548 21.2923 30.1548 20.9231V19.6923C30.1548 19.3231 29.9086 19.0769 29.5394 19.0769C29.1701 19.0769 28.924 19.3231 28.924 19.6923V20.9231ZM29.5394 10.4615C29.9086 10.4615 30.1548 10.2154 30.1548 9.84616V8.61539C30.1548 8.24616 29.9086 8 29.5394 8C29.1701 8 28.924 8.24616 28.924 8.61539V9.84616C28.924 10.2154 29.1701 10.4615 29.5394 10.4615ZM28.924 17.2308C28.924 17.6 29.1701 17.8462 29.5394 17.8462C29.9086 17.8462 30.1548 17.6 30.1548 17.2308V16C30.1548 15.6308 29.9086 15.3846 29.5394 15.3846C29.1701 15.3846 28.924 15.6308 28.924 16V17.2308ZM28.924 24.6154C28.924 24.9846 29.1701 25.2308 29.5394 25.2308C29.9086 25.2308 30.1548 24.9846 30.1548 24.6154V23.3846C30.1548 23.0154 29.9086 22.7692 29.5394 22.7692C29.1701 22.7692 28.924 23.0154 28.924 23.3846V24.6154ZM9.84706 3.07692H11.0778C11.4471 3.07692 11.6932 2.83077 11.6932 2.46154C11.6932 2.09231 11.4471 1.84616 11.0778 1.84616H9.84706C9.47783 1.84616 9.23167 2.09231 9.23167 2.46154C9.23167 2.83077 9.47783 3.07692 9.84706 3.07692ZM17.2317 28.9231H16.0009C15.6317 28.9231 15.3855 29.1692 15.3855 29.5385C15.3855 29.9077 15.6317 30.1539 16.0009 30.1539H17.2317C17.6009 30.1539 17.8471 29.9077 17.8471 29.5385C17.8471 29.1692 17.6009 28.9231 17.2317 28.9231ZM20.924 28.9231H19.6932C19.324 28.9231 19.0778 29.1692 19.0778 29.5385C19.0778 29.9077 19.324 30.1539 19.6932 30.1539H20.924C21.2932 30.1539 21.5394 29.9077 21.5394 29.5385C21.5394 29.1692 21.2932 28.9231 20.924 28.9231ZM24.6163 28.9231H23.3855C23.0163 28.9231 22.7701 29.1692 22.7701 29.5385C22.7701 29.9077 23.0163 30.1539 23.3855 30.1539H24.6163C24.9855 30.1539 25.2317 29.9077 25.2317 29.5385C25.2317 29.1692 24.9855 28.9231 24.6163 28.9231ZM17.2317 3.07692H18.4624C18.8317 3.07692 19.0778 2.83077 19.0778 2.46154C19.0778 2.09231 18.8317 1.84616 18.4624 1.84616H17.2317C16.8624 1.84616 16.6163 2.09231 16.6163 2.46154C16.6163 2.83077 16.8624 3.07692 17.2317 3.07692ZM28.924 13.5385C28.924 13.9077 29.1701 14.1538 29.5394 14.1538C29.9086 14.1538 30.1548 13.9077 30.1548 13.5385V12.3077C30.1548 11.9385 29.9086 11.6923 29.5394 11.6923C29.1701 11.6923 28.924 11.9385 28.924 12.3077V13.5385ZM25.8471 1.84616H24.6163C24.2471 1.84616 24.0009 2.09231 24.0009 2.46154C24.0009 2.83077 24.2471 3.07692 24.6163 3.07692H25.8471C26.2163 3.07692 26.4624 2.83077 26.4624 2.46154C26.4624 2.09231 26.2163 1.84616 25.8471 1.84616ZM17.6624 24V10.7692H22.7701V8H9.23167V10.7692H14.4624V24H17.6624ZM1.23167 4.61539H3.69321C4.18552 4.61539 4.61629 4.18462 4.61629 3.69231V1.23077C4.61629 0.738463 4.18552 0.307693 3.69321 0.307693H1.23167C0.739363 0.307693 0.308594 0.738463 0.308594 1.23077V3.69231C0.308594 4.18462 0.739363 4.61539 1.23167 4.61539ZM30.7701 0.307693H28.3086C27.8163 0.307693 27.3855 0.738463 27.3855 1.23077V3.69231C27.3855 4.18462 27.8163 4.61539 28.3086 4.61539H29.0471C28.9855 4.67692 28.924 4.8 28.924 4.92308V6.15385C28.924 6.52308 29.1701 6.76923 29.5394 6.76923C29.9086 6.76923 30.1548 6.52308 30.1548 6.15385V4.92308C30.1548 4.8 30.0932 4.67692 30.0317 4.61539H30.7701C31.2624 4.61539 31.6932 4.18462 31.6932 3.69231V1.23077C31.6932 0.738463 31.2624 0.307693 30.7701 0.307693ZM30.7701 27.3846H30.1548V27.0769C30.1548 26.7077 29.9086 26.4615 29.5394 26.4615C29.1701 26.4615 28.924 26.7077 28.924 27.0769V27.3846H28.3086C27.8163 27.3846 27.3855 27.8154 27.3855 28.3077V28.9231H27.0778C26.7086 28.9231 26.4624 29.1692 26.4624 29.5385C26.4624 29.9077 26.7086 30.1539 27.0778 30.1539H27.3855V30.7692C27.3855 31.2615 27.8163 31.6923 28.3086 31.6923H30.7701C31.2624 31.6923 31.6932 31.2615 31.6932 30.7692V28.3077C31.6932 27.8154 31.2624 27.3846 30.7701 27.3846Z",fill:"#999999"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_6137_1319",children:jsxRuntimeExports.jsx("rect",{width:"32",height:"32",fill:"white"})})})]}),LineSvg=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M6.2069 18.6207V21.1034H0V14.8965H6.2069V17.3793H29.7931V14.8965H36V21.1034H29.7931V18.6207H6.2069Z",fill:"#999999"})}),ArrawSvg=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M35.1875 17.9118L25.1875 11.3857V17.2H0.8125V18.8H25.1875V24.6143L35.1875 17.9118Z",fill:"#999999"})}),ClearSvg=()=>jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.884 12.8993C11.884 13.3639 11.5054 13.7425 11.0408 13.7425H4.96411C4.74038 13.7425 4.52579 13.6537 4.3675 13.4956C4.2092 13.3375 4.12014 13.123 4.11988 12.8993V3.94589H11.884V12.8993ZM5.80735 2.43241C5.80735 2.33553 5.88248 2.25941 5.98035 2.25941H10.0344C10.1323 2.25941 10.2074 2.33553 10.2074 2.43241V2.94053H5.80735V2.43241ZM14.4138 2.94053H11.2128V2.43241C11.2128 1.78391 10.6839 1.25404 10.0344 1.25404H5.98035C5.66807 1.25483 5.3688 1.37923 5.14798 1.60004C4.92717 1.82086 4.80277 2.12013 4.80198 2.43241V2.94053H1.59015C1.45539 2.94053 1.32615 2.99406 1.23086 3.08935C1.13557 3.18464 1.08203 3.31389 1.08203 3.44865C1.08203 3.58341 1.13557 3.71265 1.23086 3.80794C1.32615 3.90323 1.45539 3.95677 1.59015 3.95677H3.10364V12.8993C3.10364 13.9264 3.93699 14.7578 4.96411 14.7578H11.0398C11.284 14.7579 11.5258 14.7099 11.7515 14.6166C11.9771 14.5233 12.1822 14.3864 12.3549 14.2139C12.5277 14.0413 12.6648 13.8364 12.7583 13.6108C12.8519 13.3853 12.9001 13.1435 12.9003 12.8993V3.94589H14.4128C14.6945 3.94589 14.9219 3.71852 14.9219 3.43777C14.9218 3.37159 14.9085 3.30609 14.8827 3.2451C14.857 3.18411 14.8194 3.12886 14.7721 3.08257C14.7248 3.03628 14.6688 2.99987 14.6072 2.97549C14.5457 2.9511 14.4799 2.93921 14.4138 2.94053ZM8.00195 12.2182C8.28271 12.2182 8.51007 11.9908 8.51007 11.71V6.30262C8.51007 6.16786 8.45654 6.03862 8.36125 5.94333C8.26596 5.84804 8.13672 5.7945 8.00195 5.7945C7.86719 5.7945 7.73795 5.84804 7.64266 5.94333C7.54737 6.03862 7.49383 6.16786 7.49383 6.30262V11.71C7.49383 11.9908 7.7212 12.2182 8.00195 12.2182ZM5.63435 12.2182C5.9151 12.2182 6.14247 11.9908 6.14247 11.71V6.30262C6.14247 6.16786 6.08894 6.03862 5.99365 5.94333C5.89836 5.84804 5.76911 5.7945 5.63435 5.7945C5.49959 5.7945 5.37035 5.84804 5.27506 5.94333C5.17977 6.03862 5.12623 6.16786 5.12623 6.30262V11.71C5.13612 11.9908 5.36349 12.2182 5.63435 12.2182ZM10.3696 12.2182C10.6513 12.2182 10.8787 11.9908 10.8787 11.71V6.30262C10.8787 6.23583 10.8655 6.16969 10.8399 6.10798C10.8144 6.04628 10.7769 5.99021 10.7297 5.94298C10.6825 5.89575 10.6264 5.85828 10.5647 5.83272C10.503 5.80716 10.4368 5.79401 10.3701 5.79401C10.3033 5.79401 10.2371 5.80716 10.1754 5.83272C10.1137 5.85828 10.0576 5.89575 10.0104 5.94298C9.96318 5.99021 9.92571 6.04628 9.90015 6.10798C9.87459 6.16969 9.86144 6.23583 9.86144 6.30262V11.71C9.86144 11.9908 10.0888 12.2182 10.3696 12.2182Z"})}),KeyBoard=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M9.83398 4.15039C11.3405 4.15201 12.7852 4.75035 13.8506 5.81543C14.9161 6.88062 15.5156 8.32539 15.5176 9.83203V13.4824H20.4844V9.83594L20.4922 9.55371C20.5632 8.14986 21.152 6.81818 22.1504 5.81934C23.2155 4.75392 24.6596 4.15448 26.166 4.15234C27.6725 4.15384 29.1171 4.75238 30.1826 5.81738C31.2482 6.88257 31.8476 8.32733 31.8496 9.83398L31.8428 10.1152C31.7718 11.5193 31.1832 12.8516 30.1846 13.8506C29.1194 14.9161 27.6746 15.5156 26.168 15.5176H22.5176V20.4844H26.168C27.6743 20.4864 29.1185 21.0862 30.1836 22.1514C31.182 23.1499 31.7714 24.4812 31.8428 25.8848L31.8496 26.167C31.8479 27.6732 31.2494 29.1173 30.1846 30.1826C29.1194 31.2482 27.6746 31.8476 26.168 31.8496L25.8867 31.8428C24.4827 31.7718 23.1503 31.1832 22.1514 30.1846C21.0858 29.1194 20.4864 27.6746 20.4844 26.168V22.5176H15.5176V26.168L15.5098 26.4502C15.4383 27.8537 14.849 29.1851 13.8506 30.1836C12.7855 31.2486 11.3412 31.8466 9.83496 31.8486C8.32824 31.8474 6.88316 31.2496 5.81738 30.1846C4.75165 29.1194 4.15238 27.6748 4.15039 26.168L4.15723 25.8867C4.22817 24.4827 4.81682 23.1503 5.81543 22.1514C6.81394 21.1525 8.14594 20.5637 9.5498 20.4922L9.83203 20.4844H13.4824V15.5176H9.83594L9.55371 15.5098C8.14943 15.4392 6.81665 14.8511 5.81738 13.8525C4.75158 12.7874 4.15253 11.3427 4.15039 9.83594C4.15139 8.32878 4.74997 6.88336 5.81543 5.81738C6.81442 4.81806 8.14719 4.22829 9.55176 4.15723L9.83398 4.15039ZM9.68555 22.5225C7.74117 22.6014 6.18669 24.2064 6.18652 26.168C6.18652 28.1818 7.82394 29.8193 9.83594 29.8193C11.8497 29.8191 13.4863 28.1817 13.4863 26.168V22.5176H9.68555V22.5225ZM22.5176 26.168C22.5176 28.1817 24.1542 29.8192 26.168 29.8193C28.182 29.8193 29.8174 28.1817 29.8174 26.168C29.8172 24.1543 28.1799 22.5176 26.168 22.5176H22.5176V26.168ZM15.5176 20.4844H20.4844V15.5195H15.5176V20.4844ZM9.83594 6.18652C7.82195 6.18652 6.18652 7.82412 6.18652 9.83789C6.18673 11.8497 7.82412 13.4863 9.83594 13.4863H13.4863V9.83594C13.4863 7.82405 11.8496 6.18671 9.83594 6.18652ZM26.168 6.18652C24.1543 6.18669 22.5176 7.82404 22.5176 9.83594V13.4863H26.168C28.1818 13.4863 29.8172 11.8495 29.8174 9.83594C29.8174 7.82206 28.1818 6.18652 26.168 6.18652Z",fill:"#999999",stroke:"white",strokeWidth:"0.3"})}),Drawx6=React.forwardRef((e,t)=>{const{height:n="300px",maskTip:r="点击画板进入绘制",value:o,onSave:i,savePngType:a="url",showSaveBtn:s}=e,[l,c]=React.useState(!1),u=React.useRef(null);return React.useImperativeHandle(t,()=>{var e;return{getIsFullScreen:()=>l,getData:null==(e=u.current)?void 0:e.getData}}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Show,{height:n,value:o,maskTip:r,maskClick:()=>{c(!0)}}),l&&jsxRuntimeExports.jsx(Editor,{ref:u,value:o,savePngType:a,editabled:!0,onSave:i,onExit:()=>{c(!1)},showSaveBtn:s})]})}),Draw=e=>{const{status:t=QuestionStatus.EXAM,data:n,onSubmit:r}=e,[o,i]=React.useState(),a=React.useRef(null),s=(e,o=!0)=>{if("exam"!==t)return;const a={userAnswerOption:{content:null==e?void 0:e.json,photo:null==e?void 0:e.png},questionCode:null==n?void 0:n.questionCode};i(null==e?void 0:e.json),null==r||r(a),o&&staticMethods.success("保存成功")};return React.useEffect(()=>{if("exam"!==t)return;const e=async e=>{var t,n;const{type:r}=e.data??{};if("examTimeEnd5"===r&&(null==(t=a.current)?void 0:t.getIsFullScreen())){const e=await(null==(n=a.current)?void 0:n.getData());s(e,!1)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[t]),React.useEffect(()=>{if(n){const{answerOption:e}=n;e&&!Array.isArray(e)&&i(null==e?void 0:e.content)}},[n,t]),jsxRuntimeExports.jsxs("div",{className:"draw-question",children:[jsxRuntimeExports.jsx("div",{className:"draw-question-title",children:jsxRuntimeExports.jsxs("div",{className:"draw-question-title-content",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("span",{className:"score",children:[null==n?void 0:n.score,"分"]}),jsxRuntimeExports.jsx("span",{className:"type",children:"画图题"}),((null==n?void 0:n.hasAutoScore)??(null==n?void 0:n.judgeMode)===CCMJudgeMode.AI_AGENT)&&jsxRuntimeExports.jsx("span",{className:"auto",children:"自动判分"})]}),jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,noPadding:!0,defaultValue:null==n?void 0:n.topic,readOnly:!0,autoHeight:{min:0,max:1e5}})]})}),jsxRuntimeExports.jsxs("div",{className:"draw-question-content",children:[jsxRuntimeExports.jsx(Drawx6,{ref:a,value:o,showSaveBtn:"mark"!==t&&"view"!==t,onSave:s,maskTip:"mark"===t||"view"===t?"点击画板查看答题":"点击画板进入答题"}),["add","mark"].includes(t)&&!!(null==n?void 0:n.judgeNorm)&&jsxRuntimeExports.jsx(Collapse,{defaultActiveKey:"add"===t?["1"]:[],ghost:!0,expandIcon:({isActive:e})=>jsxRuntimeExports.jsx(RefIcon$e,{rotate:e?90:0}),items:[{key:"1",label:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{style:{fontWeight:"bold"},children:"判分标准"}),jsxRuntimeExports.jsx("span",{style:{fontSize:"12px",color:"#999999"},children:"(学生不可见)"})]}),children:jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,readOnly:!0,defaultValue:n.judgeNorm,noPadding:!0,autoHeight:{min:0,max:1e4}})}]}),n.difficulty&&jsxRuntimeExports.jsx("div",{className:"draw-question-content-others",children:jsxRuntimeExports.jsxs("div",{className:"difficulty",children:[jsxRuntimeExports.jsx("span",{children:"题目难度:"}),jsxRuntimeExports.jsx("span",{children:difficultyMap[n.difficulty]})]})})]})]},null==n?void 0:n.questionCode)},Composite=e=>{var t;const{data:n}=e,{children:r,difficulty:o,topic:i,score:a}=n,[s,l]=React.useState([]),c=React.useRef(null);return React.useEffect(()=>{const e=null==r?void 0:r.map((e,t)=>(null==e?void 0:e.questionCode)||t);l(e)},[null==(t=null==n?void 0:n.children)?void 0:t.length]),jsxRuntimeExports.jsxs("div",{className:"composite",children:[jsxRuntimeExports.jsx("div",{className:"composite-title",children:jsxRuntimeExports.jsxs("div",{className:"composite-title-content",children:[jsxRuntimeExports.jsxs("div",{children:[a&&jsxRuntimeExports.jsxs("span",{className:"score",children:[a,"分"]}),jsxRuntimeExports.jsx("span",{className:"type",children:"组合题"}),(null==n?void 0:n.hasAutoScore)&&jsxRuntimeExports.jsx("span",{className:"auto",children:"自动判分"})]}),jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,noPadding:!0,defaultValue:i,readOnly:!0,autoHeight:{min:0,max:1e5}})]})}),jsxRuntimeExports.jsxs("div",{className:"composite-content",children:[jsxRuntimeExports.jsx(Collapse,{activeKey:s,ghost:!0,ref:c,expandIcon:({isActive:e})=>jsxRuntimeExports.jsx(RefIcon$e,{rotate:e?90:0}),onChange:e=>{l(Array.isArray(e)?e:[e])},items:null==r?void 0:r.map((e,t)=>({key:(null==e?void 0:e.questionCode)||t,label:`第${t+1}小题(${questionTypesMap[null==e?void 0:e.type]})`,children:jsxRuntimeExports.jsx(QuestionRender,{data:e})}))}),jsxRuntimeExports.jsx("div",{className:"composite-content-others",children:o&&jsxRuntimeExports.jsxs("div",{className:"difficulty",children:[jsxRuntimeExports.jsx("span",{children:"题目难度:"}),jsxRuntimeExports.jsx("span",{children:difficultyMap[o]})]})})]})]})},QuestionRender=React.forwardRef((e,t)=>{const{data:n,questionProps:r={},listeners:o}=e,{onSubmit:i,onNextQuestion:a,editable:s=!1,deleteable:l=!1,onDelete:c=()=>{},onEditOk:u=()=>{},buttonText:d="",showQuestionTip:p=!1,langList:f,showResult:h,status:g=QuestionStatus.PREVIEW,className:m="",styles:y={},uploadImg:v,codeTestURL:b,codeplayerURL:_,rightTopButtonArr:E,unknowQesutionRender:S,QuestionTopRender:x,QuestionBottomRender:w,onlyAdd:C,toRunCodeQuestion:R}=r,[T,k]=React.useState(!1),[A,P]=React.useState(!0),[O,N]=React.useState(!1),[I,$]=React.useState(""),D=React.useMemo(()=>{const e={...n},{optionJson:t,type:r}=n;return!t||r!==QuestionTypeEnum.ACM&&r!==QuestionTypeEnum.CCM||(e.lang=null==t?void 0:t.defaultLanguage),e},[n]);React.useImperativeHandle(t,()=>({setEditShow:e=>k(e),setShowOperateButton:P,addQuestion:()=>{N(!0)}}));const[L,M]=React.useState((e=>{switch(e){case QuestionTypeEnum.RADIO:return"";case QuestionTypeEnum.CHECKBOX:return[];case QuestionTypeEnum.ANSWER:case QuestionTypeEnum.JUDGE:return"";case QuestionTypeEnum.ACM:case QuestionTypeEnum.CCM:return{code:"",language:"javascript"};case QuestionTypeEnum.COMPLETION:return[];case QuestionTypeEnum.DRAW:case QuestionTypeEnum.COMPOSITE:return{};default:return null}})(D.type)),B=e=>jsxRuntimeExports.jsx(QuestionContext.Provider,{value:{topProps:{uploadImg:v}},children:jsxRuntimeExports.jsxs("div",{className:`question-wrapper ${m}`,style:{...y},children:[A&&jsxRuntimeExports.jsxs("div",{className:"operate-area",children:[s&&jsxRuntimeExports.jsx(Tooltip,{title:"编辑",children:jsxRuntimeExports.jsx(Button$1,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$9,{}),onClick:()=>k(!0)},"edit")}),l&&jsxRuntimeExports.jsx(Tooltip,{title:"删除",children:jsxRuntimeExports.jsx(Button$1,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$c,{}),onClick:()=>c(D)},"delete")}),(null==E?void 0:E.length)&&E.map(e=>{const{text:n,icon:r,needBindRef:i}=e,a={...e};return delete a.needBindRef,jsxRuntimeExports.jsx(Tooltip,{title:n,children:React.createElement(Button$1,{...a,ref:i?t:null,size:"small",key:n??(null==r?void 0:r.toString()),"data-cypress":i?"draggable-handle":"",...i?o:{}})},n??(null==r?void 0:r.toString()))})]}),x&&x(D),e,w&&w(D)]})}),F={data:D,onSubmit:i,buttonText:d,status:g,onNextQuestion:a};if(C)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(QuestionContext.Provider,{value:{topProps:{uploadImg:v}},children:O&&jsxRuntimeExports.jsx(Modal,{style:{top:"40%"},open:O,footer:null,title:"请选择题型",width:300,onCancel:()=>{N(!1),$("")},children:jsxRuntimeExports.jsx(Select,{style:{width:"100%"},placeholder:"请选择",onChange:e=>{N(!1),$(e),k(!0)},options:questionTypeSelectOptions})})})});switch(D.type){case QuestionTypeEnum.RADIO:case QuestionTypeEnum.CHECKBOX:return(()=>{const e=jsxRuntimeExports.jsx(ChoiceQuestion,{showQuestionTip:p,showResult:h,...F});return B(e)})();case QuestionTypeEnum.ACM:case QuestionTypeEnum.CCM:return(()=>{const e=jsxRuntimeExports.jsx(Preview,{codeTestURL:b,codeplayerURL:_,toRunCodeQuestion:R,...F});return B(e)})();case QuestionTypeEnum.COMPLETION:return(()=>{const e=jsxRuntimeExports.jsx(Completion,{showResult:h,...F});return B(e)})();case QuestionTypeEnum.ANSWER:return(()=>{const e=jsxRuntimeExports.jsx(AnswerQuestion,{...F});return B(e)})();case QuestionTypeEnum.DRAW:return(()=>{const e=jsxRuntimeExports.jsx(Draw,{...F});return B(e)})();case QuestionTypeEnum.COMPOSITE:return(()=>{const e=jsxRuntimeExports.jsx(Composite,{...F});return B(e)})();default:return S?S(D):jsxRuntimeExports.jsx("div",{children:"未知题型"})}}),VideoKnowledgeCard=e=>{const{editCallBack:t,resetContentCallback:n,id:r,createKnowldegeLoading:o,createKnowledgeCallback:i,relatedKnowledgeList:a,basicKnowledgeList:s,expandKnowledgeList:l,createQuestionCallback:c,aiConsultCallback:u,questionSubmitCallback:d}=e,[p,f]=React.useState(e),[h,g]=React.useState(!1),[m,y]=React.useState(!1),[v,b]=React.useState(e.title),[_,E]=React.useState(e.content),[S,x]=React.useState(!1),[w,C]=React.useState(!1),[R,T]=React.useState(!1),[k,A]=React.useState("basic"),[P,O]=React.useState(""),[N,I]=React.useState(null),[$,D]=React.useState(!1),L=React.useRef(null),{knowledgeType:M,title:B,content:F,codeData:j,videoTime:H,videoUrl:U,videoLicense:z,runCode:q,questionsList:V,relatedKnowledgeList:G,basicKnowledgeList:W,expandKnowledgeList:K}=p,X=e=>{"basic"===e.key?(T(!0),A("basic")):"expand"===e.key?(T(!0),A("expand")):"aiconsult"===e.key&&(null==u||u({title:B,content:F,id:r}))},Y={1:jsxRuntimeExports.jsx(RefIcon$5,{}),2:jsxRuntimeExports.jsx(RefIcon$5,{}),3:jsxRuntimeExports.jsx(RefIcon$4,{}),4:jsxRuntimeExports.jsx(RefIcon$2,{}),5:jsxRuntimeExports.jsx(RefIcon$2,{})},Z=React.useMemo(()=>"basic"===k?s||[]:"expand"===k?l||[]:"related"===k?a||[]:void 0,[k,s,l,a]);return jsxRuntimeExports.jsxs("div",{className:styles$3.knowledgeCardContainer,children:[jsxRuntimeExports.jsxs(Card,{className:styles$3.card,children:[h&&jsxRuntimeExports.jsxs("div",{className:styles$3.returnArea,onClick:()=>{f(e),g(!1)},children:[jsxRuntimeExports.jsx(ArrowLeft,{className:styles$3.arrowLeft}),"返回初始卡片"]}),jsxRuntimeExports.jsxs("div",{className:styles$3.header,children:[jsxRuntimeExports.jsxs("div",{className:styles$3.titleSection,children:[jsxRuntimeExports.jsx(Tag,{color:"orange",className:styles$3.knowledgeTag,children:"practice"===M?"实操知识点":"概念知识点"}),m?jsxRuntimeExports.jsx(Input,{value:v,onChange:e=>{b(e.target.value)}}):jsxRuntimeExports.jsx("h1",{className:styles$3.title,children:B}),t&&!m&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsx("button",{onClick:()=>{y(!0)},className:"p-2 hover:bg-gray-50 rounded-lg transition-colors group",children:jsxRuntimeExports.jsx(PenLine,{className:"w-5 h-5 text-gray-600 group-hover:text-blue-600"})})}),!m&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsx("button",{onClick:()=>{navigator.clipboard.writeText(F),staticMethods.success("复制成功")},className:"p-2 hover:bg-gray-50 rounded-lg transition-colors group",children:jsxRuntimeExports.jsx(Copy,{className:"w-5 h-5 text-gray-600 group-hover:text-blue-600"})})}),m&&n&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsx(Tooltip,{title:"恢复原文",children:jsxRuntimeExports.jsx("button",{onClick:()=>{null==n||n(),y(!1)},className:"p-2 hover:bg-blue-50 rounded-lg transition-colors group",children:jsxRuntimeExports.jsx(RotateCcw,{className:"w-5 h-5 text-blue-600"})})})}),m&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsx("button",{onClick:()=>{null==t||t({title:v,content:_,id:r}),y(!1)},className:"p-2 hover:bg-green-50 rounded-lg transition-colors group",title:"保存",children:jsxRuntimeExports.jsx(Save,{className:"w-5 h-5 text-green-600"})})}),m&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsx("button",{onClick:()=>y(!1),className:"p-2 hover:bg-red-50 rounded-lg transition-colors group",title:"取消",children:jsxRuntimeExports.jsx(X$2,{className:"w-5 h-5 text-red-600"})})})]}),jsxRuntimeExports.jsx("div",{className:styles$3.metaInfo,children:jsxRuntimeExports.jsxs(Space,{children:[H&&jsxRuntimeExports.jsxs("div",{className:styles$3.duration,children:[jsxRuntimeExports.jsx(Clock,{size:16}),jsxRuntimeExports.jsx("span",{children:H})]}),U&&jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(Play,{size:16}),className:styles$3.videoBtn,onClick:()=>{C(!0)},children:"视频讲解"}),!h&&jsxRuntimeExports.jsxs(Space.Compact,{children:[jsxRuntimeExports.jsx(Button$1,{onClick:()=>{A("related"),T(!0)},children:"关联知识点"}),jsxRuntimeExports.jsx(Dropdown,{menu:{items:[{key:"basic",label:"他的基础知识点"},{key:"expand",label:"他的拓展知识点"}],onClick:X},placement:"bottomRight",children:jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(RefIcon$g,{})})})]}),c?jsxRuntimeExports.jsxs(Space.Compact,{children:[jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(FileText,{size:16}),className:styles$3.aiBtn,onClick:()=>null==c?void 0:c({title:B,content:F,id:r}),children:"AI出题"}),u&&jsxRuntimeExports.jsx(Dropdown,{menu:{items:[{key:"aiconsult",label:"AI问答"}],onClick:X},placement:"bottomRight",children:jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(RefIcon$g,{})})})]}):u&&jsxRuntimeExports.jsx(Button$1,{className:styles$3.aiBtn,onClick:()=>null==u?void 0:u({title:B,content:F,id:r}),children:"AI问答"})]})})]}),jsxRuntimeExports.jsx("div",{className:styles$3.description,children:m?jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3 flex items-start gap-2",children:[jsxRuntimeExports.jsx(Sparkles,{className:"w-5 h-5 text-blue-600 flex-shrink-0 mt-0.5"}),jsxRuntimeExports.jsxs("div",{className:"text-sm text-blue-800",children:[jsxRuntimeExports.jsx("p",{className:"font-medium mb-1",children:"编辑提示"}),jsxRuntimeExports.jsx("p",{children:"支持Markdown格式,可以使用**粗体**、*斜体*、`代码`等格式化文本"})]})]}),jsxRuntimeExports.jsx("textarea",{value:_,onChange:e=>E(e.target.value),className:"bg-white w-full min-h-[200px] px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent resize-none font-mono text-sm",placeholder:"在此编辑内容,支持Markdown格式...",maxLength:1e3}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[jsxRuntimeExports.jsx("span",{children:"支持Markdown格式化"}),jsxRuntimeExports.jsxs("span",{children:[_.length,"/1000"]})]})]})}):jsxRuntimeExports.jsx(MyReactMarkdown,{children:F})}),V&&V.length>0&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsxs("div",{className:"bg-white rounded-lg my-6 overflow-y-auto h-full",children:[jsxRuntimeExports.jsx("h3",{className:"font-semibold text-gray-800 mb-4",children:"练习题"}),jsxRuntimeExports.jsx("div",{className:" pr-[12px] left-que-item flex gap-4 items-center",children:null==V?void 0:V.map((e,t)=>{var n,r,o;return jsxRuntimeExports.jsxs("button",{onClick:()=>{I(e),D(!0)},className:"w-100 h-full text-left p-4 rounded-lg border-2 transition-all border-gray-200 hover:border-gray-300 hover:bg-gray-50",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntimeExports.jsx("span",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium bg-gray-200 text-gray-600",children:t+1}),jsxRuntimeExports.jsx("div",{className:"p-1 rounded bg-gray-100",children:getQuestionTypeIcon(e.type)}),V[t].userAnswer&&jsxRuntimeExports.jsx("div",{className:"text-xs px-2 py-1 rounded-1 font-medium text-green-500 bg-green-100}",children:"已完成"})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntimeExports.jsx("span",{className:`text-xs px-2 py-1 rounded-full font-medium ${getDifficultyColor(e.difficulty||"")}`,children:"low"===e.difficulty?"简单":"middle"===e.difficulty?"中等":"困难"}),e.score?jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1 text-xs text-gray-500",children:[jsxRuntimeExports.jsx(Star,{className:"w-3 h-3"}),jsxRuntimeExports.jsx("span",{children:e.score})]}):null]})]}),jsxRuntimeExports.jsx(Tooltip,{title:(e.topic||e.content||"").replace(/<[^>]*>/g,""),children:jsxRuntimeExports.jsx("h4",{className:"font-medium text-sm mb-1 text-ellipsis line-clamp-2 text-gray-800",children:jsxRuntimeExports.jsx("span",{dangerouslySetInnerHTML:{__html:e.topic||e.content||""}})})}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[(null==(n=null==e?void 0:e.labels)?void 0:n.length)?jsxRuntimeExports.jsx("span",{className:"text-xs text-blue-600 bg-blue-100 px-2 py-1 rounded-full",children:null==(o=null==(r=null==e?void 0:e.labels)?void 0:r[0])?void 0:o.labelName}):jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-500",children:getQuestionTypeName(e.type)})]})]},e.content||""+t)})})]})}),j&&j.code&&jsxRuntimeExports.jsxs("div",{className:styles$3.codeSection,children:[jsxRuntimeExports.jsxs("div",{className:styles$3.codeHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$3.language,children:j.lang}),jsxRuntimeExports.jsxs("div",{className:styles$3.btnGroup,children:[S?jsxRuntimeExports.jsx(Button$1,{size:"small",className:styles$3.copyBtn,icon:jsxRuntimeExports.jsx(RefIcon$s,{}),children:"复制成功"}):jsxRuntimeExports.jsx(Button$1,{size:"small",className:styles$3.copyBtn,icon:jsxRuntimeExports.jsx(Copy,{size:14}),onClick:()=>{return e=j.code||"",navigator.clipboard.writeText(e),x(!0),void setTimeout(()=>x(!1),2e3);var e},children:"复制代码"}),jsxRuntimeExports.jsx(Button$1,{size:"small",className:styles$3.runBtn,icon:jsxRuntimeExports.jsx(Play,{size:14}),onClick:()=>null==q?void 0:q(j.code||""),children:"在线运行"})]})]}),jsxRuntimeExports.jsx("div",{className:styles$3.codeBlock,children:jsxRuntimeExports.jsx(ThemedCodeBlock,{text:j.code||"",language:j.lang||"c",showLineNumbers:!0,theme:dracula})})]}),jsxRuntimeExports.jsx("div",{className:styles$3.rateSection,children:jsxRuntimeExports.jsx("span",{className:styles$3.rateTitle,children:"打分"})}),jsxRuntimeExports.jsx(Rate,{defaultValue:5,character:({index:e=0})=>Y[e+1]})]}),jsxRuntimeExports.jsx(Modal,{open:w,onCancel:()=>C(!1),forceRender:!0,footer:null,className:styles$3.videoModal,width:700,children:jsxRuntimeExports.jsx("div",{className:styles$3.playerPanel,style:{width:"700px"},children:jsxRuntimeExports.jsx(VideoPlayer,{containerId:"aliplayerModalId",url:U||"",playerRef:L,license:z||{domain:"",key:""}})})}),jsxRuntimeExports.jsx(Modal,{open:R,onCancel:()=>T(!1),footer:null,className:styles$3.relatedKnowledgeModal,width:700,children:jsxRuntimeExports.jsx(Spin,{spinning:o,children:jsxRuntimeExports.jsxs("div",{className:styles$3.relatedKnowledgeModalContent,children:[jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:(null==Z?void 0:Z.length)?jsxRuntimeExports.jsxs("div",{className:"p-6 rounded-xl bg-gradient-to-br from-purple-50 to-blue-50 shadow-md",children:[jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between mb-4",children:jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-purple-600 to-blue-600 rounded-xl flex items-center justify-center shadow-lg",children:jsxRuntimeExports.jsx(Lightbulb,{className:"w-6 h-6 text-white"})}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{className:"font-bold text-gray-900",children:"知识点卡片"}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-gray-600",children:["共 ",Z.length," 个知识点"]})]})]})}),jsxRuntimeExports.jsx("div",{className:"grid grid-cols-2 gap-3",children:Z.map(e=>jsxRuntimeExports.jsxs("button",{onClick:()=>(e=>{f(e),T(!1),g(!0)})(e),className:"w-full group relative bg-white rounded-xl p-4 border-2 border-purple-200 hover:border-purple-400 hover:shadow-lg transition-all text-left",children:[jsxRuntimeExports.jsx("div",{className:"absolute top-3 right-3",children:"concept"===e.knowledgeType?jsxRuntimeExports.jsx("div",{className:"w-8 h-8 bg-blue-100 rounded-lg flex items-center justify-center",children:jsxRuntimeExports.jsx(BookOpen,{className:"w-4 h-4 text-blue-600"})}):jsxRuntimeExports.jsx("div",{className:"w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center",children:jsxRuntimeExports.jsx(Code$1,{className:"w-4 h-4 text-purple-600"})})}),jsxRuntimeExports.jsxs("div",{className:"pr-10",children:[jsxRuntimeExports.jsx(Tooltip,{title:e.title,children:jsxRuntimeExports.jsx("h4",{className:"font-semibold text-gray-900 mb-2 group-hover:text-purple-600 transition-colors text-ellipsis whitespace-nowrap overflow-hidden",children:e.title})}),jsxRuntimeExports.jsx("div",{className:"mt-2",children:jsxRuntimeExports.jsx("span",{className:"text-xs px-2 py-1 rounded-full whitespace-nowrap "+("concept"===e.knowledgeType?"bg-blue-100 text-blue-700":"bg-purple-100 text-purple-700"),children:"concept"===e.knowledgeType?"概念型":"实操型"})})]})]},e.id))})]}):jsxRuntimeExports.jsx(Empty,{description:jsxRuntimeExports.jsx("span",{children:"暂无知识点数据,可以通过下方对话自行生成"}),image:Empty.PRESENTED_IMAGE_SIMPLE})}),i&&jsxRuntimeExports.jsx("div",{className:styles$3.inputContainer,children:jsxRuntimeExports.jsxs(Space.Compact,{style:{width:"100%"},children:[jsxRuntimeExports.jsx(Input,{value:P,onChange:e=>O(e.target.value),placeholder:"输入描述AI帮你生成知识点"}),jsxRuntimeExports.jsx(Button$1,{type:"primary",onClick:()=>null==i?void 0:i({createType:k,userInput:P,id:r}),children:"一键生成"})]})})]})})}),$&&jsxRuntimeExports.jsx(Modal,{open:$,onCancel:()=>D(!1),footer:null,className:styles$3.questionPracticeModal,width:700,children:jsxRuntimeExports.jsx(QuestionRender,{data:N,questionProps:{showResult:!0,onSubmit:e=>{null==d||d({questionCode:(null==N?void 0:N.questionCode)||"",userAnswer:e,questionData:N})}}})})]},r)};var abapExports=requireAbap();const abap=getDefaultExportFromCjs(abapExports),abap$1=_mergeNamespaces({__proto__:null,default:abap},[abapExports]);var abnfExports=requireAbnf();const abnf=getDefaultExportFromCjs(abnfExports),abnf$1=_mergeNamespaces({__proto__:null,default:abnf},[abnfExports]);var actionscriptExports=requireActionscript();const actionscript=getDefaultExportFromCjs(actionscriptExports),actionscript$1=_mergeNamespaces({__proto__:null,default:actionscript},[actionscriptExports]);var adaExports=requireAda();const ada=getDefaultExportFromCjs(adaExports),ada$1=_mergeNamespaces({__proto__:null,default:ada},[adaExports]);var agdaExports=requireAgda();const agda=getDefaultExportFromCjs(agdaExports),agda$1=_mergeNamespaces({__proto__:null,default:agda},[agdaExports]);var alExports=requireAl();const al=getDefaultExportFromCjs(alExports),al$1=_mergeNamespaces({__proto__:null,default:al},[alExports]);var antlr4Exports=requireAntlr4();const antlr4=getDefaultExportFromCjs(antlr4Exports),antlr4$1=_mergeNamespaces({__proto__:null,default:antlr4},[antlr4Exports]);var apacheconfExports=requireApacheconf();const apacheconf=getDefaultExportFromCjs(apacheconfExports),apacheconf$1=_mergeNamespaces({__proto__:null,default:apacheconf},[apacheconfExports]);var apexExports=requireApex();const apex=getDefaultExportFromCjs(apexExports),apex$1=_mergeNamespaces({__proto__:null,default:apex},[apexExports]);var aplExports=requireApl();const apl=getDefaultExportFromCjs(aplExports),apl$1=_mergeNamespaces({__proto__:null,default:apl},[aplExports]);var applescriptExports=requireApplescript();const applescript=getDefaultExportFromCjs(applescriptExports),applescript$1=_mergeNamespaces({__proto__:null,default:applescript},[applescriptExports]);var aqlExports=requireAql();const aql=getDefaultExportFromCjs(aqlExports),aql$1=_mergeNamespaces({__proto__:null,default:aql},[aqlExports]);var arduinoExports=requireArduino();const arduino=getDefaultExportFromCjs(arduinoExports),arduino$1=_mergeNamespaces({__proto__:null,default:arduino},[arduinoExports]);var arffExports=requireArff();const arff=getDefaultExportFromCjs(arffExports),arff$1=_mergeNamespaces({__proto__:null,default:arff},[arffExports]);var asciidocExports=requireAsciidoc();const asciidoc=getDefaultExportFromCjs(asciidocExports),asciidoc$1=_mergeNamespaces({__proto__:null,default:asciidoc},[asciidocExports]);var asm6502Exports=requireAsm6502();const asm6502=getDefaultExportFromCjs(asm6502Exports),asm6502$1=_mergeNamespaces({__proto__:null,default:asm6502},[asm6502Exports]);var asmatmelExports=requireAsmatmel();const asmatmel=getDefaultExportFromCjs(asmatmelExports),asmatmel$1=_mergeNamespaces({__proto__:null,default:asmatmel},[asmatmelExports]);var aspnetExports=requireAspnet();const aspnet=getDefaultExportFromCjs(aspnetExports),aspnet$1=_mergeNamespaces({__proto__:null,default:aspnet},[aspnetExports]);var autohotkeyExports=requireAutohotkey();const autohotkey=getDefaultExportFromCjs(autohotkeyExports),autohotkey$1=_mergeNamespaces({__proto__:null,default:autohotkey},[autohotkeyExports]);var autoitExports=requireAutoit();const autoit=getDefaultExportFromCjs(autoitExports),autoit$1=_mergeNamespaces({__proto__:null,default:autoit},[autoitExports]);var avisynthExports=requireAvisynth();const avisynth=getDefaultExportFromCjs(avisynthExports),avisynth$1=_mergeNamespaces({__proto__:null,default:avisynth},[avisynthExports]);var avroIdlExports=requireAvroIdl();const avroIdl=getDefaultExportFromCjs(avroIdlExports),avroIdl$1=_mergeNamespaces({__proto__:null,default:avroIdl},[avroIdlExports]);var bashExports=requireBash();const bash=getDefaultExportFromCjs(bashExports),bash$1=_mergeNamespaces({__proto__:null,default:bash},[bashExports]);var basicExports=requireBasic();const basic=getDefaultExportFromCjs(basicExports),basic$1=_mergeNamespaces({__proto__:null,default:basic},[basicExports]);var batchExports=requireBatch();const batch=getDefaultExportFromCjs(batchExports),batch$1=_mergeNamespaces({__proto__:null,default:batch},[batchExports]);var bbcodeExports=requireBbcode();const bbcode=getDefaultExportFromCjs(bbcodeExports),bbcode$1=_mergeNamespaces({__proto__:null,default:bbcode},[bbcodeExports]);var bicepExports=requireBicep();const bicep=getDefaultExportFromCjs(bicepExports),bicep$1=_mergeNamespaces({__proto__:null,default:bicep},[bicepExports]);var birbExports=requireBirb();const birb=getDefaultExportFromCjs(birbExports),birb$1=_mergeNamespaces({__proto__:null,default:birb},[birbExports]);var bisonExports=requireBison();const bison=getDefaultExportFromCjs(bisonExports),bison$1=_mergeNamespaces({__proto__:null,default:bison},[bisonExports]);var bnfExports=requireBnf();const bnf=getDefaultExportFromCjs(bnfExports),bnf$1=_mergeNamespaces({__proto__:null,default:bnf},[bnfExports]);var brainfuckExports=requireBrainfuck();const brainfuck=getDefaultExportFromCjs(brainfuckExports),brainfuck$1=_mergeNamespaces({__proto__:null,default:brainfuck},[brainfuckExports]);var brightscriptExports=requireBrightscript();const brightscript=getDefaultExportFromCjs(brightscriptExports),brightscript$1=_mergeNamespaces({__proto__:null,default:brightscript},[brightscriptExports]);var broExports=requireBro();const bro=getDefaultExportFromCjs(broExports),bro$1=_mergeNamespaces({__proto__:null,default:bro},[broExports]);var bslExports=requireBsl();const bsl=getDefaultExportFromCjs(bslExports),bsl$1=_mergeNamespaces({__proto__:null,default:bsl},[bslExports]);var cExports=requireC();const c=getDefaultExportFromCjs(cExports),c$1=_mergeNamespaces({__proto__:null,default:c},[cExports]);var cfscriptExports=requireCfscript();const cfscript=getDefaultExportFromCjs(cfscriptExports),cfscript$1=_mergeNamespaces({__proto__:null,default:cfscript},[cfscriptExports]);var chaiscriptExports=requireChaiscript();const chaiscript=getDefaultExportFromCjs(chaiscriptExports),chaiscript$1=_mergeNamespaces({__proto__:null,default:chaiscript},[chaiscriptExports]);var cilExports=requireCil();const cil=getDefaultExportFromCjs(cilExports),cil$1=_mergeNamespaces({__proto__:null,default:cil},[cilExports]);var clojureExports=requireClojure();const clojure=getDefaultExportFromCjs(clojureExports),clojure$1=_mergeNamespaces({__proto__:null,default:clojure},[clojureExports]);var cmakeExports=requireCmake();const cmake=getDefaultExportFromCjs(cmakeExports),cmake$1=_mergeNamespaces({__proto__:null,default:cmake},[cmakeExports]);var cobolExports=requireCobol();const cobol=getDefaultExportFromCjs(cobolExports),cobol$1=_mergeNamespaces({__proto__:null,default:cobol},[cobolExports]);var coffeescriptExports=requireCoffeescript();const coffeescript=getDefaultExportFromCjs(coffeescriptExports),coffeescript$1=_mergeNamespaces({__proto__:null,default:coffeescript},[coffeescriptExports]);var concurnasExports=requireConcurnas();const concurnas=getDefaultExportFromCjs(concurnasExports),concurnas$1=_mergeNamespaces({__proto__:null,default:concurnas},[concurnasExports]);var coqExports=requireCoq();const coq=getDefaultExportFromCjs(coqExports),coq$1=_mergeNamespaces({__proto__:null,default:coq},[coqExports]);var cppExports=requireCpp();const cpp=getDefaultExportFromCjs(cppExports),cpp$1=_mergeNamespaces({__proto__:null,default:cpp},[cppExports]);var crystalExports=requireCrystal();const crystal=getDefaultExportFromCjs(crystalExports),crystal$1=_mergeNamespaces({__proto__:null,default:crystal},[crystalExports]);var csharpExports=requireCsharp();const csharp=getDefaultExportFromCjs(csharpExports),csharp$1=_mergeNamespaces({__proto__:null,default:csharp},[csharpExports]);var cshtmlExports=requireCshtml();const cshtml=getDefaultExportFromCjs(cshtmlExports),cshtml$1=_mergeNamespaces({__proto__:null,default:cshtml},[cshtmlExports]);var cspExports=requireCsp();const csp=getDefaultExportFromCjs(cspExports),csp$1=_mergeNamespaces({__proto__:null,default:csp},[cspExports]);var cssExtrasExports=requireCssExtras();const cssExtras=getDefaultExportFromCjs(cssExtrasExports),cssExtras$1=_mergeNamespaces({__proto__:null,default:cssExtras},[cssExtrasExports]);var csvExports=requireCsv();const csv=getDefaultExportFromCjs(csvExports),csv$1=_mergeNamespaces({__proto__:null,default:csv},[csvExports]);var cypherExports=requireCypher();const cypher=getDefaultExportFromCjs(cypherExports),cypher$1=_mergeNamespaces({__proto__:null,default:cypher},[cypherExports]);var dExports=requireD();const d=getDefaultExportFromCjs(dExports),d$1=_mergeNamespaces({__proto__:null,default:d},[dExports]);var dartExports=requireDart();const dart=getDefaultExportFromCjs(dartExports),dart$1=_mergeNamespaces({__proto__:null,default:dart},[dartExports]);var dataweaveExports=requireDataweave();const dataweave=getDefaultExportFromCjs(dataweaveExports),dataweave$1=_mergeNamespaces({__proto__:null,default:dataweave},[dataweaveExports]);var daxExports=requireDax();const dax=getDefaultExportFromCjs(daxExports),dax$1=_mergeNamespaces({__proto__:null,default:dax},[daxExports]);var dhallExports=requireDhall();const dhall=getDefaultExportFromCjs(dhallExports),dhall$1=_mergeNamespaces({__proto__:null,default:dhall},[dhallExports]);var diffExports=requireDiff();const diff=getDefaultExportFromCjs(diffExports),diff$1=_mergeNamespaces({__proto__:null,default:diff},[diffExports]);var djangoExports=requireDjango();const django=getDefaultExportFromCjs(djangoExports),django$1=_mergeNamespaces({__proto__:null,default:django},[djangoExports]);var dnsZoneFileExports=requireDnsZoneFile();const dnsZoneFile=getDefaultExportFromCjs(dnsZoneFileExports),dnsZoneFile$1=_mergeNamespaces({__proto__:null,default:dnsZoneFile},[dnsZoneFileExports]);var dockerExports=requireDocker();const docker=getDefaultExportFromCjs(dockerExports),docker$1=_mergeNamespaces({__proto__:null,default:docker},[dockerExports]);var dotExports=requireDot();const dot=getDefaultExportFromCjs(dotExports),dot$1=_mergeNamespaces({__proto__:null,default:dot},[dotExports]);var ebnfExports=requireEbnf();const ebnf=getDefaultExportFromCjs(ebnfExports),ebnf$1=_mergeNamespaces({__proto__:null,default:ebnf},[ebnfExports]);var editorconfigExports=requireEditorconfig();const editorconfig=getDefaultExportFromCjs(editorconfigExports),editorconfig$1=_mergeNamespaces({__proto__:null,default:editorconfig},[editorconfigExports]);var eiffelExports=requireEiffel();const eiffel=getDefaultExportFromCjs(eiffelExports),eiffel$1=_mergeNamespaces({__proto__:null,default:eiffel},[eiffelExports]);var ejsExports=requireEjs();const ejs=getDefaultExportFromCjs(ejsExports),ejs$1=_mergeNamespaces({__proto__:null,default:ejs},[ejsExports]);var elixirExports=requireElixir();const elixir=getDefaultExportFromCjs(elixirExports),elixir$1=_mergeNamespaces({__proto__:null,default:elixir},[elixirExports]);var elmExports=requireElm();const elm=getDefaultExportFromCjs(elmExports),elm$1=_mergeNamespaces({__proto__:null,default:elm},[elmExports]);var erbExports=requireErb();const erb=getDefaultExportFromCjs(erbExports),erb$1=_mergeNamespaces({__proto__:null,default:erb},[erbExports]);var erlangExports=requireErlang();const erlang=getDefaultExportFromCjs(erlangExports),erlang$1=_mergeNamespaces({__proto__:null,default:erlang},[erlangExports]);var etluaExports=requireEtlua();const etlua=getDefaultExportFromCjs(etluaExports),etlua$1=_mergeNamespaces({__proto__:null,default:etlua},[etluaExports]);var excelFormulaExports=requireExcelFormula();const excelFormula=getDefaultExportFromCjs(excelFormulaExports),excelFormula$1=_mergeNamespaces({__proto__:null,default:excelFormula},[excelFormulaExports]);var factorExports=requireFactor();const factor=getDefaultExportFromCjs(factorExports),factor$1=_mergeNamespaces({__proto__:null,default:factor},[factorExports]);var _falseExports=require_false();const _false=getDefaultExportFromCjs(_falseExports),_false$1=_mergeNamespaces({__proto__:null,default:_false},[_falseExports]);var firestoreSecurityRulesExports=requireFirestoreSecurityRules();const firestoreSecurityRules=getDefaultExportFromCjs(firestoreSecurityRulesExports),firestoreSecurityRules$1=_mergeNamespaces({__proto__:null,default:firestoreSecurityRules},[firestoreSecurityRulesExports]);var flowExports=requireFlow();const flow=getDefaultExportFromCjs(flowExports),flow$1=_mergeNamespaces({__proto__:null,default:flow},[flowExports]);var fortranExports=requireFortran();const fortran=getDefaultExportFromCjs(fortranExports),fortran$1=_mergeNamespaces({__proto__:null,default:fortran},[fortranExports]);var fsharpExports=requireFsharp();const fsharp=getDefaultExportFromCjs(fsharpExports),fsharp$1=_mergeNamespaces({__proto__:null,default:fsharp},[fsharpExports]);var ftlExports=requireFtl();const ftl=getDefaultExportFromCjs(ftlExports),ftl$1=_mergeNamespaces({__proto__:null,default:ftl},[ftlExports]);var gapExports=requireGap();const gap=getDefaultExportFromCjs(gapExports),gap$1=_mergeNamespaces({__proto__:null,default:gap},[gapExports]);var gcodeExports=requireGcode();const gcode=getDefaultExportFromCjs(gcodeExports),gcode$1=_mergeNamespaces({__proto__:null,default:gcode},[gcodeExports]);var gdscriptExports=requireGdscript();const gdscript=getDefaultExportFromCjs(gdscriptExports),gdscript$1=_mergeNamespaces({__proto__:null,default:gdscript},[gdscriptExports]);var gedcomExports=requireGedcom();const gedcom=getDefaultExportFromCjs(gedcomExports),gedcom$1=_mergeNamespaces({__proto__:null,default:gedcom},[gedcomExports]);var gherkinExports=requireGherkin();const gherkin=getDefaultExportFromCjs(gherkinExports),gherkin$1=_mergeNamespaces({__proto__:null,default:gherkin},[gherkinExports]);var gitExports=requireGit();const git=getDefaultExportFromCjs(gitExports),git$1=_mergeNamespaces({__proto__:null,default:git},[gitExports]);var glslExports=requireGlsl();const glsl=getDefaultExportFromCjs(glslExports),glsl$1=_mergeNamespaces({__proto__:null,default:glsl},[glslExports]);var gmlExports=requireGml();const gml=getDefaultExportFromCjs(gmlExports),gml$1=_mergeNamespaces({__proto__:null,default:gml},[gmlExports]);var gnExports=requireGn();const gn=getDefaultExportFromCjs(gnExports),gn$1=_mergeNamespaces({__proto__:null,default:gn},[gnExports]);var goModuleExports=requireGoModule();const goModule=getDefaultExportFromCjs(goModuleExports),goModule$1=_mergeNamespaces({__proto__:null,default:goModule},[goModuleExports]);var goExports=requireGo();const go=getDefaultExportFromCjs(goExports),go$1=_mergeNamespaces({__proto__:null,default:go},[goExports]);var graphqlExports=requireGraphql();const graphql=getDefaultExportFromCjs(graphqlExports),graphql$1=_mergeNamespaces({__proto__:null,default:graphql},[graphqlExports]);var groovyExports=requireGroovy();const groovy=getDefaultExportFromCjs(groovyExports),groovy$1=_mergeNamespaces({__proto__:null,default:groovy},[groovyExports]);var hamlExports=requireHaml();const haml=getDefaultExportFromCjs(hamlExports),haml$1=_mergeNamespaces({__proto__:null,default:haml},[hamlExports]);var handlebarsExports=requireHandlebars();const handlebars=getDefaultExportFromCjs(handlebarsExports),handlebars$1=_mergeNamespaces({__proto__:null,default:handlebars},[handlebarsExports]);var haskellExports=requireHaskell();const haskell=getDefaultExportFromCjs(haskellExports),haskell$1=_mergeNamespaces({__proto__:null,default:haskell},[haskellExports]);var haxeExports=requireHaxe();const haxe=getDefaultExportFromCjs(haxeExports),haxe$1=_mergeNamespaces({__proto__:null,default:haxe},[haxeExports]);var hclExports=requireHcl();const hcl=getDefaultExportFromCjs(hclExports),hcl$1=_mergeNamespaces({__proto__:null,default:hcl},[hclExports]);var hlslExports=requireHlsl();const hlsl=getDefaultExportFromCjs(hlslExports),hlsl$1=_mergeNamespaces({__proto__:null,default:hlsl},[hlslExports]);var hoonExports=requireHoon();const hoon=getDefaultExportFromCjs(hoonExports),hoon$1=_mergeNamespaces({__proto__:null,default:hoon},[hoonExports]);var hpkpExports=requireHpkp();const hpkp=getDefaultExportFromCjs(hpkpExports),hpkp$1=_mergeNamespaces({__proto__:null,default:hpkp},[hpkpExports]);var hstsExports=requireHsts();const hsts=getDefaultExportFromCjs(hstsExports),hsts$1=_mergeNamespaces({__proto__:null,default:hsts},[hstsExports]);var httpExports=requireHttp();const http=getDefaultExportFromCjs(httpExports),http$1=_mergeNamespaces({__proto__:null,default:http},[httpExports]);var ichigojamExports=requireIchigojam();const ichigojam=getDefaultExportFromCjs(ichigojamExports),ichigojam$1=_mergeNamespaces({__proto__:null,default:ichigojam},[ichigojamExports]);var iconExports=requireIcon();const icon=getDefaultExportFromCjs(iconExports),icon$1=_mergeNamespaces({__proto__:null,default:icon},[iconExports]);var icuMessageFormatExports=requireIcuMessageFormat();const icuMessageFormat=getDefaultExportFromCjs(icuMessageFormatExports),icuMessageFormat$1=_mergeNamespaces({__proto__:null,default:icuMessageFormat},[icuMessageFormatExports]);var idrisExports=requireIdris();const idris=getDefaultExportFromCjs(idrisExports),idris$1=_mergeNamespaces({__proto__:null,default:idris},[idrisExports]);var iecstExports=requireIecst();const iecst=getDefaultExportFromCjs(iecstExports),iecst$1=_mergeNamespaces({__proto__:null,default:iecst},[iecstExports]);var ignoreExports=requireIgnore();const ignore=getDefaultExportFromCjs(ignoreExports),ignore$1=_mergeNamespaces({__proto__:null,default:ignore},[ignoreExports]);var inform7Exports=requireInform7();const inform7=getDefaultExportFromCjs(inform7Exports),inform7$1=_mergeNamespaces({__proto__:null,default:inform7},[inform7Exports]);var iniExports=requireIni();const ini=getDefaultExportFromCjs(iniExports),ini$1=_mergeNamespaces({__proto__:null,default:ini},[iniExports]);var ioExports=requireIo();const io=getDefaultExportFromCjs(ioExports),io$1=_mergeNamespaces({__proto__:null,default:io},[ioExports]);var jExports=requireJ();const j=getDefaultExportFromCjs(jExports),j$1=_mergeNamespaces({__proto__:null,default:j},[jExports]);var javaExports=requireJava();const java=getDefaultExportFromCjs(javaExports),java$1=_mergeNamespaces({__proto__:null,default:java},[javaExports]);var javadocExports=requireJavadoc();const javadoc=getDefaultExportFromCjs(javadocExports),javadoc$1=_mergeNamespaces({__proto__:null,default:javadoc},[javadocExports]);var javadoclikeExports=requireJavadoclike();const javadoclike=getDefaultExportFromCjs(javadoclikeExports),javadoclike$1=_mergeNamespaces({__proto__:null,default:javadoclike},[javadoclikeExports]);var javastacktraceExports=requireJavastacktrace();const javastacktrace=getDefaultExportFromCjs(javastacktraceExports),javastacktrace$1=_mergeNamespaces({__proto__:null,default:javastacktrace},[javastacktraceExports]);var jexlExports=requireJexl();const jexl=getDefaultExportFromCjs(jexlExports),jexl$1=_mergeNamespaces({__proto__:null,default:jexl},[jexlExports]);var jolieExports=requireJolie();const jolie=getDefaultExportFromCjs(jolieExports),jolie$1=_mergeNamespaces({__proto__:null,default:jolie},[jolieExports]);var jqExports=requireJq();const jq=getDefaultExportFromCjs(jqExports),jq$1=_mergeNamespaces({__proto__:null,default:jq},[jqExports]);var jsExtrasExports=requireJsExtras();const jsExtras=getDefaultExportFromCjs(jsExtrasExports),jsExtras$1=_mergeNamespaces({__proto__:null,default:jsExtras},[jsExtrasExports]);var jsTemplatesExports=requireJsTemplates();const jsTemplates=getDefaultExportFromCjs(jsTemplatesExports),jsTemplates$1=_mergeNamespaces({__proto__:null,default:jsTemplates},[jsTemplatesExports]);var jsdocExports=requireJsdoc();const jsdoc=getDefaultExportFromCjs(jsdocExports),jsdoc$1=_mergeNamespaces({__proto__:null,default:jsdoc},[jsdocExports]);var jsonExports=requireJson();const json=getDefaultExportFromCjs(jsonExports),json$1=_mergeNamespaces({__proto__:null,default:json},[jsonExports]);var json5Exports=requireJson5();const json5=getDefaultExportFromCjs(json5Exports),json5$1=_mergeNamespaces({__proto__:null,default:json5},[json5Exports]);var jsonpExports=requireJsonp();const jsonp=getDefaultExportFromCjs(jsonpExports),jsonp$1=_mergeNamespaces({__proto__:null,default:jsonp},[jsonpExports]);var jsstacktraceExports=requireJsstacktrace();const jsstacktrace=getDefaultExportFromCjs(jsstacktraceExports),jsstacktrace$1=_mergeNamespaces({__proto__:null,default:jsstacktrace},[jsstacktraceExports]);var jsxExports=requireJsx();const jsx=getDefaultExportFromCjs(jsxExports),jsx$1=_mergeNamespaces({__proto__:null,default:jsx},[jsxExports]);var juliaExports=requireJulia();const julia=getDefaultExportFromCjs(juliaExports),julia$1=_mergeNamespaces({__proto__:null,default:julia},[juliaExports]);var keepalivedExports=requireKeepalived();const keepalived=getDefaultExportFromCjs(keepalivedExports),keepalived$1=_mergeNamespaces({__proto__:null,default:keepalived},[keepalivedExports]);var keymanExports=requireKeyman();const keyman=getDefaultExportFromCjs(keymanExports),keyman$1=_mergeNamespaces({__proto__:null,default:keyman},[keymanExports]);var kotlinExports=requireKotlin();const kotlin=getDefaultExportFromCjs(kotlinExports),kotlin$1=_mergeNamespaces({__proto__:null,default:kotlin},[kotlinExports]);var kumirExports=requireKumir();const kumir=getDefaultExportFromCjs(kumirExports),kumir$1=_mergeNamespaces({__proto__:null,default:kumir},[kumirExports]);var kustoExports=requireKusto();const kusto=getDefaultExportFromCjs(kustoExports),kusto$1=_mergeNamespaces({__proto__:null,default:kusto},[kustoExports]);var latexExports=requireLatex();const latex=getDefaultExportFromCjs(latexExports),latex$1=_mergeNamespaces({__proto__:null,default:latex},[latexExports]);var latteExports=requireLatte();const latte=getDefaultExportFromCjs(latteExports),latte$1=_mergeNamespaces({__proto__:null,default:latte},[latteExports]);var lessExports=requireLess();const less=getDefaultExportFromCjs(lessExports),less$1=_mergeNamespaces({__proto__:null,default:less},[lessExports]);var lilypondExports=requireLilypond();const lilypond=getDefaultExportFromCjs(lilypondExports),lilypond$1=_mergeNamespaces({__proto__:null,default:lilypond},[lilypondExports]);var liquidExports=requireLiquid();const liquid=getDefaultExportFromCjs(liquidExports),liquid$1=_mergeNamespaces({__proto__:null,default:liquid},[liquidExports]);var lispExports=requireLisp();const lisp=getDefaultExportFromCjs(lispExports),lisp$1=_mergeNamespaces({__proto__:null,default:lisp},[lispExports]);var livescriptExports=requireLivescript();const livescript=getDefaultExportFromCjs(livescriptExports),livescript$1=_mergeNamespaces({__proto__:null,default:livescript},[livescriptExports]);var llvmExports=requireLlvm();const llvm=getDefaultExportFromCjs(llvmExports),llvm$1=_mergeNamespaces({__proto__:null,default:llvm},[llvmExports]);var logExports=requireLog();const log=getDefaultExportFromCjs(logExports),log$1=_mergeNamespaces({__proto__:null,default:log},[logExports]);var lolcodeExports=requireLolcode();const lolcode=getDefaultExportFromCjs(lolcodeExports),lolcode$1=_mergeNamespaces({__proto__:null,default:lolcode},[lolcodeExports]);var luaExports=requireLua();const lua=getDefaultExportFromCjs(luaExports),lua$1=_mergeNamespaces({__proto__:null,default:lua},[luaExports]);var magmaExports=requireMagma();const magma=getDefaultExportFromCjs(magmaExports),magma$1=_mergeNamespaces({__proto__:null,default:magma},[magmaExports]);var makefileExports=requireMakefile();const makefile=getDefaultExportFromCjs(makefileExports),makefile$1=_mergeNamespaces({__proto__:null,default:makefile},[makefileExports]);var markdownExports=requireMarkdown();const markdown=getDefaultExportFromCjs(markdownExports),markdown$1=_mergeNamespaces({__proto__:null,default:markdown},[markdownExports]);var markupTemplatingExports=requireMarkupTemplating();const markupTemplating=getDefaultExportFromCjs(markupTemplatingExports),markupTemplating$1=_mergeNamespaces({__proto__:null,default:markupTemplating},[markupTemplatingExports]);var matlabExports=requireMatlab();const matlab=getDefaultExportFromCjs(matlabExports),matlab$1=_mergeNamespaces({__proto__:null,default:matlab},[matlabExports]);var maxscriptExports=requireMaxscript();const maxscript=getDefaultExportFromCjs(maxscriptExports),maxscript$1=_mergeNamespaces({__proto__:null,default:maxscript},[maxscriptExports]);var melExports=requireMel();const mel=getDefaultExportFromCjs(melExports),mel$1=_mergeNamespaces({__proto__:null,default:mel},[melExports]);var mermaidExports=requireMermaid();const mermaid=getDefaultExportFromCjs(mermaidExports),mermaid$1=_mergeNamespaces({__proto__:null,default:mermaid},[mermaidExports]);var mizarExports=requireMizar();const mizar=getDefaultExportFromCjs(mizarExports),mizar$1=_mergeNamespaces({__proto__:null,default:mizar},[mizarExports]);var mongodbExports=requireMongodb();const mongodb=getDefaultExportFromCjs(mongodbExports),mongodb$1=_mergeNamespaces({__proto__:null,default:mongodb},[mongodbExports]);var monkeyExports=requireMonkey();const monkey=getDefaultExportFromCjs(monkeyExports),monkey$1=_mergeNamespaces({__proto__:null,default:monkey},[monkeyExports]);var moonscriptExports=requireMoonscript();const moonscript=getDefaultExportFromCjs(moonscriptExports),moonscript$1=_mergeNamespaces({__proto__:null,default:moonscript},[moonscriptExports]);var n1qlExports=requireN1ql();const n1ql=getDefaultExportFromCjs(n1qlExports),n1ql$1=_mergeNamespaces({__proto__:null,default:n1ql},[n1qlExports]);var n4jsExports=requireN4js();const n4js=getDefaultExportFromCjs(n4jsExports),n4js$1=_mergeNamespaces({__proto__:null,default:n4js},[n4jsExports]);var nand2tetrisHdlExports=requireNand2tetrisHdl();const nand2tetrisHdl=getDefaultExportFromCjs(nand2tetrisHdlExports),nand2tetrisHdl$1=_mergeNamespaces({__proto__:null,default:nand2tetrisHdl},[nand2tetrisHdlExports]);var naniscriptExports=requireNaniscript();const naniscript=getDefaultExportFromCjs(naniscriptExports),naniscript$1=_mergeNamespaces({__proto__:null,default:naniscript},[naniscriptExports]);var nasmExports=requireNasm();const nasm=getDefaultExportFromCjs(nasmExports),nasm$1=_mergeNamespaces({__proto__:null,default:nasm},[nasmExports]);var neonExports=requireNeon();const neon=getDefaultExportFromCjs(neonExports),neon$1=_mergeNamespaces({__proto__:null,default:neon},[neonExports]);var nevodExports=requireNevod();const nevod=getDefaultExportFromCjs(nevodExports),nevod$1=_mergeNamespaces({__proto__:null,default:nevod},[nevodExports]);var nginxExports=requireNginx();const nginx=getDefaultExportFromCjs(nginxExports),nginx$1=_mergeNamespaces({__proto__:null,default:nginx},[nginxExports]);var nimExports=requireNim();const nim=getDefaultExportFromCjs(nimExports),nim$1=_mergeNamespaces({__proto__:null,default:nim},[nimExports]);var nixExports=requireNix();const nix=getDefaultExportFromCjs(nixExports),nix$1=_mergeNamespaces({__proto__:null,default:nix},[nixExports]);var nsisExports=requireNsis();const nsis=getDefaultExportFromCjs(nsisExports),nsis$1=_mergeNamespaces({__proto__:null,default:nsis},[nsisExports]);var objectivecExports=requireObjectivec();const objectivec=getDefaultExportFromCjs(objectivecExports),objectivec$1=_mergeNamespaces({__proto__:null,default:objectivec},[objectivecExports]);var ocamlExports=requireOcaml();const ocaml=getDefaultExportFromCjs(ocamlExports),ocaml$1=_mergeNamespaces({__proto__:null,default:ocaml},[ocamlExports]);var openclExports=requireOpencl();const opencl=getDefaultExportFromCjs(openclExports),opencl$1=_mergeNamespaces({__proto__:null,default:opencl},[openclExports]);var openqasmExports=requireOpenqasm();const openqasm=getDefaultExportFromCjs(openqasmExports),openqasm$1=_mergeNamespaces({__proto__:null,default:openqasm},[openqasmExports]);var ozExports=requireOz();const oz=getDefaultExportFromCjs(ozExports),oz$1=_mergeNamespaces({__proto__:null,default:oz},[ozExports]);var parigpExports=requireParigp();const parigp=getDefaultExportFromCjs(parigpExports),parigp$1=_mergeNamespaces({__proto__:null,default:parigp},[parigpExports]);var parserExports=requireParser();const parser=getDefaultExportFromCjs(parserExports),parser$1=_mergeNamespaces({__proto__:null,default:parser},[parserExports]);var pascalExports=requirePascal();const pascal=getDefaultExportFromCjs(pascalExports),pascal$1=_mergeNamespaces({__proto__:null,default:pascal},[pascalExports]);var pascaligoExports=requirePascaligo();const pascaligo=getDefaultExportFromCjs(pascaligoExports),pascaligo$1=_mergeNamespaces({__proto__:null,default:pascaligo},[pascaligoExports]);var pcaxisExports=requirePcaxis();const pcaxis=getDefaultExportFromCjs(pcaxisExports),pcaxis$1=_mergeNamespaces({__proto__:null,default:pcaxis},[pcaxisExports]);var peoplecodeExports=requirePeoplecode();const peoplecode=getDefaultExportFromCjs(peoplecodeExports),peoplecode$1=_mergeNamespaces({__proto__:null,default:peoplecode},[peoplecodeExports]);var perlExports=requirePerl();const perl=getDefaultExportFromCjs(perlExports),perl$1=_mergeNamespaces({__proto__:null,default:perl},[perlExports]);var phpExtrasExports=requirePhpExtras();const phpExtras=getDefaultExportFromCjs(phpExtrasExports),phpExtras$1=_mergeNamespaces({__proto__:null,default:phpExtras},[phpExtrasExports]);var phpExports=requirePhp();const php=getDefaultExportFromCjs(phpExports),php$1=_mergeNamespaces({__proto__:null,default:php},[phpExports]);var phpdocExports=requirePhpdoc();const phpdoc=getDefaultExportFromCjs(phpdocExports),phpdoc$1=_mergeNamespaces({__proto__:null,default:phpdoc},[phpdocExports]);var plsqlExports=requirePlsql();const plsql=getDefaultExportFromCjs(plsqlExports),plsql$1=_mergeNamespaces({__proto__:null,default:plsql},[plsqlExports]);var powerqueryExports=requirePowerquery();const powerquery=getDefaultExportFromCjs(powerqueryExports),powerquery$1=_mergeNamespaces({__proto__:null,default:powerquery},[powerqueryExports]);var powershellExports=requirePowershell();const powershell=getDefaultExportFromCjs(powershellExports),powershell$1=_mergeNamespaces({__proto__:null,default:powershell},[powershellExports]);var processingExports=requireProcessing();const processing=getDefaultExportFromCjs(processingExports),processing$1=_mergeNamespaces({__proto__:null,default:processing},[processingExports]);var prologExports=requireProlog();const prolog=getDefaultExportFromCjs(prologExports),prolog$1=_mergeNamespaces({__proto__:null,default:prolog},[prologExports]);var promqlExports=requirePromql();const promql=getDefaultExportFromCjs(promqlExports),promql$1=_mergeNamespaces({__proto__:null,default:promql},[promqlExports]);var propertiesExports=requireProperties();const properties=getDefaultExportFromCjs(propertiesExports),properties$1=_mergeNamespaces({__proto__:null,default:properties},[propertiesExports]);var protobufExports=requireProtobuf();const protobuf=getDefaultExportFromCjs(protobufExports),protobuf$1=_mergeNamespaces({__proto__:null,default:protobuf},[protobufExports]);var pslExports=requirePsl();const psl=getDefaultExportFromCjs(pslExports),psl$1=_mergeNamespaces({__proto__:null,default:psl},[pslExports]);var pugExports=requirePug();const pug=getDefaultExportFromCjs(pugExports),pug$1=_mergeNamespaces({__proto__:null,default:pug},[pugExports]);var puppetExports=requirePuppet();const puppet=getDefaultExportFromCjs(puppetExports),puppet$1=_mergeNamespaces({__proto__:null,default:puppet},[puppetExports]);var pureExports=requirePure();const pure=getDefaultExportFromCjs(pureExports),pure$1=_mergeNamespaces({__proto__:null,default:pure},[pureExports]);var purebasicExports=requirePurebasic();const purebasic=getDefaultExportFromCjs(purebasicExports),purebasic$1=_mergeNamespaces({__proto__:null,default:purebasic},[purebasicExports]);var purescriptExports=requirePurescript();const purescript=getDefaultExportFromCjs(purescriptExports),purescript$1=_mergeNamespaces({__proto__:null,default:purescript},[purescriptExports]);var pythonExports=requirePython();const python=getDefaultExportFromCjs(pythonExports),python$1=_mergeNamespaces({__proto__:null,default:python},[pythonExports]);var qExports=requireQ();const q=getDefaultExportFromCjs(qExports),q$1=_mergeNamespaces({__proto__:null,default:q},[qExports]);var qmlExports=requireQml();const qml=getDefaultExportFromCjs(qmlExports),qml$1=_mergeNamespaces({__proto__:null,default:qml},[qmlExports]);var qoreExports=requireQore();const qore=getDefaultExportFromCjs(qoreExports),qore$1=_mergeNamespaces({__proto__:null,default:qore},[qoreExports]);var qsharpExports=requireQsharp();const qsharp=getDefaultExportFromCjs(qsharpExports),qsharp$1=_mergeNamespaces({__proto__:null,default:qsharp},[qsharpExports]);var rExports=requireR();const r=getDefaultExportFromCjs(rExports),r$1=_mergeNamespaces({__proto__:null,default:r},[rExports]);var racketExports=requireRacket();const racket=getDefaultExportFromCjs(racketExports),racket$1=_mergeNamespaces({__proto__:null,default:racket},[racketExports]);var reasonExports=requireReason();const reason=getDefaultExportFromCjs(reasonExports),reason$1=_mergeNamespaces({__proto__:null,default:reason},[reasonExports]);var regexExports=requireRegex();const regex=getDefaultExportFromCjs(regexExports),regex$1=_mergeNamespaces({__proto__:null,default:regex},[regexExports]);var regoExports=requireRego();const rego=getDefaultExportFromCjs(regoExports),rego$1=_mergeNamespaces({__proto__:null,default:rego},[regoExports]);var renpyExports=requireRenpy();const renpy=getDefaultExportFromCjs(renpyExports),renpy$1=_mergeNamespaces({__proto__:null,default:renpy},[renpyExports]);var restExports=requireRest();const rest=getDefaultExportFromCjs(restExports),rest$1=_mergeNamespaces({__proto__:null,default:rest},[restExports]);var ripExports=requireRip();const rip=getDefaultExportFromCjs(ripExports),rip$1=_mergeNamespaces({__proto__:null,default:rip},[ripExports]);var roboconfExports=requireRoboconf();const roboconf=getDefaultExportFromCjs(roboconfExports),roboconf$1=_mergeNamespaces({__proto__:null,default:roboconf},[roboconfExports]);var robotframeworkExports=requireRobotframework();const robotframework=getDefaultExportFromCjs(robotframeworkExports),robotframework$1=_mergeNamespaces({__proto__:null,default:robotframework},[robotframeworkExports]);var rubyExports=requireRuby();const ruby=getDefaultExportFromCjs(rubyExports),ruby$1=_mergeNamespaces({__proto__:null,default:ruby},[rubyExports]);var rustExports=requireRust();const rust=getDefaultExportFromCjs(rustExports),rust$1=_mergeNamespaces({__proto__:null,default:rust},[rustExports]);var sasExports=requireSas();const sas=getDefaultExportFromCjs(sasExports),sas$1=_mergeNamespaces({__proto__:null,default:sas},[sasExports]);var sassExports=requireSass();const sass=getDefaultExportFromCjs(sassExports),sass$1=_mergeNamespaces({__proto__:null,default:sass},[sassExports]);var scalaExports=requireScala();const scala=getDefaultExportFromCjs(scalaExports),scala$1=_mergeNamespaces({__proto__:null,default:scala},[scalaExports]);var schemeExports=requireScheme();const scheme=getDefaultExportFromCjs(schemeExports),scheme$1=_mergeNamespaces({__proto__:null,default:scheme},[schemeExports]);var scssExports=requireScss();const scss=getDefaultExportFromCjs(scssExports),scss$1=_mergeNamespaces({__proto__:null,default:scss},[scssExports]);var shellSessionExports=requireShellSession();const shellSession=getDefaultExportFromCjs(shellSessionExports),shellSession$1=_mergeNamespaces({__proto__:null,default:shellSession},[shellSessionExports]);var smaliExports=requireSmali();const smali=getDefaultExportFromCjs(smaliExports),smali$1=_mergeNamespaces({__proto__:null,default:smali},[smaliExports]);var smalltalkExports=requireSmalltalk();const smalltalk=getDefaultExportFromCjs(smalltalkExports),smalltalk$1=_mergeNamespaces({__proto__:null,default:smalltalk},[smalltalkExports]);var smartyExports=requireSmarty();const smarty=getDefaultExportFromCjs(smartyExports),smarty$1=_mergeNamespaces({__proto__:null,default:smarty},[smartyExports]);var smlExports=requireSml();const sml=getDefaultExportFromCjs(smlExports),sml$1=_mergeNamespaces({__proto__:null,default:sml},[smlExports]);var solidityExports=requireSolidity();const solidity=getDefaultExportFromCjs(solidityExports),solidity$1=_mergeNamespaces({__proto__:null,default:solidity},[solidityExports]);var solutionFileExports=requireSolutionFile();const solutionFile=getDefaultExportFromCjs(solutionFileExports),solutionFile$1=_mergeNamespaces({__proto__:null,default:solutionFile},[solutionFileExports]);var soyExports=requireSoy();const soy=getDefaultExportFromCjs(soyExports),soy$1=_mergeNamespaces({__proto__:null,default:soy},[soyExports]);var sparqlExports=requireSparql();const sparql=getDefaultExportFromCjs(sparqlExports),sparql$1=_mergeNamespaces({__proto__:null,default:sparql},[sparqlExports]);var splunkSplExports=requireSplunkSpl();const splunkSpl=getDefaultExportFromCjs(splunkSplExports),splunkSpl$1=_mergeNamespaces({__proto__:null,default:splunkSpl},[splunkSplExports]);var sqfExports=requireSqf();const sqf=getDefaultExportFromCjs(sqfExports),sqf$1=_mergeNamespaces({__proto__:null,default:sqf},[sqfExports]);var sqlExports=requireSql();const sql=getDefaultExportFromCjs(sqlExports),sql$1=_mergeNamespaces({__proto__:null,default:sql},[sqlExports]);var squirrelExports=requireSquirrel();const squirrel=getDefaultExportFromCjs(squirrelExports),squirrel$1=_mergeNamespaces({__proto__:null,default:squirrel},[squirrelExports]);var stanExports=requireStan();const stan=getDefaultExportFromCjs(stanExports),stan$1=_mergeNamespaces({__proto__:null,default:stan},[stanExports]);var stylusExports=requireStylus();const stylus=getDefaultExportFromCjs(stylusExports),stylus$1=_mergeNamespaces({__proto__:null,default:stylus},[stylusExports]);var swiftExports=requireSwift();const swift=getDefaultExportFromCjs(swiftExports),swift$1=_mergeNamespaces({__proto__:null,default:swift},[swiftExports]);var systemdExports=requireSystemd();const systemd=getDefaultExportFromCjs(systemdExports),systemd$1=_mergeNamespaces({__proto__:null,default:systemd},[systemdExports]);var t4CsExports=requireT4Cs();const t4Cs=getDefaultExportFromCjs(t4CsExports),t4Cs$1=_mergeNamespaces({__proto__:null,default:t4Cs},[t4CsExports]);var t4TemplatingExports=requireT4Templating();const t4Templating=getDefaultExportFromCjs(t4TemplatingExports),t4Templating$1=_mergeNamespaces({__proto__:null,default:t4Templating},[t4TemplatingExports]);var t4VbExports=requireT4Vb();const t4Vb=getDefaultExportFromCjs(t4VbExports),t4Vb$1=_mergeNamespaces({__proto__:null,default:t4Vb},[t4VbExports]);var tapExports=requireTap();const tap=getDefaultExportFromCjs(tapExports),tap$1=_mergeNamespaces({__proto__:null,default:tap},[tapExports]);var tclExports=requireTcl();const tcl=getDefaultExportFromCjs(tclExports),tcl$1=_mergeNamespaces({__proto__:null,default:tcl},[tclExports]);var textileExports=requireTextile();const textile=getDefaultExportFromCjs(textileExports),textile$1=_mergeNamespaces({__proto__:null,default:textile},[textileExports]);var tomlExports=requireToml();const toml=getDefaultExportFromCjs(tomlExports),toml$1=_mergeNamespaces({__proto__:null,default:toml},[tomlExports]);var tremorExports=requireTremor();const tremor=getDefaultExportFromCjs(tremorExports),tremor$1=_mergeNamespaces({__proto__:null,default:tremor},[tremorExports]);var tsxExports=requireTsx();const tsx=getDefaultExportFromCjs(tsxExports),tsx$1=_mergeNamespaces({__proto__:null,default:tsx},[tsxExports]);var tt2Exports=requireTt2();const tt2=getDefaultExportFromCjs(tt2Exports),tt2$1=_mergeNamespaces({__proto__:null,default:tt2},[tt2Exports]);var turtleExports=requireTurtle();const turtle=getDefaultExportFromCjs(turtleExports),turtle$1=_mergeNamespaces({__proto__:null,default:turtle},[turtleExports]);var twigExports=requireTwig();const twig=getDefaultExportFromCjs(twigExports),twig$1=_mergeNamespaces({__proto__:null,default:twig},[twigExports]);var typescriptExports=requireTypescript();const typescript=getDefaultExportFromCjs(typescriptExports),typescript$1=_mergeNamespaces({__proto__:null,default:typescript},[typescriptExports]);var typoscriptExports=requireTyposcript();const typoscript=getDefaultExportFromCjs(typoscriptExports),typoscript$1=_mergeNamespaces({__proto__:null,default:typoscript},[typoscriptExports]);var unrealscriptExports=requireUnrealscript();const unrealscript=getDefaultExportFromCjs(unrealscriptExports),unrealscript$1=_mergeNamespaces({__proto__:null,default:unrealscript},[unrealscriptExports]);var uorazorExports=requireUorazor();const uorazor=getDefaultExportFromCjs(uorazorExports),uorazor$1=_mergeNamespaces({__proto__:null,default:uorazor},[uorazorExports]);var uriExports=requireUri();const uri=getDefaultExportFromCjs(uriExports),uri$1=_mergeNamespaces({__proto__:null,default:uri},[uriExports]);var vExports=requireV();const v=getDefaultExportFromCjs(vExports),v$1=_mergeNamespaces({__proto__:null,default:v},[vExports]);var valaExports=requireVala();const vala=getDefaultExportFromCjs(valaExports),vala$1=_mergeNamespaces({__proto__:null,default:vala},[valaExports]);var vbnetExports=requireVbnet();const vbnet=getDefaultExportFromCjs(vbnetExports),vbnet$1=_mergeNamespaces({__proto__:null,default:vbnet},[vbnetExports]);var velocityExports=requireVelocity();const velocity=getDefaultExportFromCjs(velocityExports),velocity$1=_mergeNamespaces({__proto__:null,default:velocity},[velocityExports]);var verilogExports=requireVerilog();const verilog=getDefaultExportFromCjs(verilogExports),verilog$1=_mergeNamespaces({__proto__:null,default:verilog},[verilogExports]);var vhdlExports=requireVhdl();const vhdl=getDefaultExportFromCjs(vhdlExports),vhdl$1=_mergeNamespaces({__proto__:null,default:vhdl},[vhdlExports]);var vimExports=requireVim();const vim=getDefaultExportFromCjs(vimExports),vim$1=_mergeNamespaces({__proto__:null,default:vim},[vimExports]);var visualBasicExports=requireVisualBasic();const visualBasic=getDefaultExportFromCjs(visualBasicExports),visualBasic$1=_mergeNamespaces({__proto__:null,default:visualBasic},[visualBasicExports]);var warpscriptExports=requireWarpscript();const warpscript=getDefaultExportFromCjs(warpscriptExports),warpscript$1=_mergeNamespaces({__proto__:null,default:warpscript},[warpscriptExports]);var wasmExports=requireWasm();const wasm=getDefaultExportFromCjs(wasmExports),wasm$1=_mergeNamespaces({__proto__:null,default:wasm},[wasmExports]);var webIdlExports=requireWebIdl();const webIdl=getDefaultExportFromCjs(webIdlExports),webIdl$1=_mergeNamespaces({__proto__:null,default:webIdl},[webIdlExports]);var wikiExports=requireWiki();const wiki=getDefaultExportFromCjs(wikiExports),wiki$1=_mergeNamespaces({__proto__:null,default:wiki},[wikiExports]);var wolframExports=requireWolfram();const wolfram=getDefaultExportFromCjs(wolframExports),wolfram$1=_mergeNamespaces({__proto__:null,default:wolfram},[wolframExports]);var wrenExports=requireWren();const wren=getDefaultExportFromCjs(wrenExports),wren$1=_mergeNamespaces({__proto__:null,default:wren},[wrenExports]);var xeoraExports=requireXeora();const xeora=getDefaultExportFromCjs(xeoraExports),xeora$1=_mergeNamespaces({__proto__:null,default:xeora},[xeoraExports]);var xmlDocExports=requireXmlDoc();const xmlDoc=getDefaultExportFromCjs(xmlDocExports),xmlDoc$1=_mergeNamespaces({__proto__:null,default:xmlDoc},[xmlDocExports]);var xojoExports=requireXojo();const xojo=getDefaultExportFromCjs(xojoExports),xojo$1=_mergeNamespaces({__proto__:null,default:xojo},[xojoExports]);var xqueryExports=requireXquery();const xquery=getDefaultExportFromCjs(xqueryExports),xquery$1=_mergeNamespaces({__proto__:null,default:xquery},[xqueryExports]);var yamlExports=requireYaml();const yaml=getDefaultExportFromCjs(yamlExports),yaml$1=_mergeNamespaces({__proto__:null,default:yaml},[yamlExports]);var yangExports=requireYang();const yang=getDefaultExportFromCjs(yangExports),yang$1=_mergeNamespaces({__proto__:null,default:yang},[yangExports]);var zigExports=requireZig();const zig=getDefaultExportFromCjs(zigExports),zig$1=_mergeNamespaces({__proto__:null,default:zig},[zigExports]);exports.KnowledgeCard=VideoKnowledgeCard,exports.default=VideoKnowledgeCard,Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
285
|
+
*/!function(e){!function(){var t={}.hasOwnProperty;function n(){for(var e="",t=0;t<arguments.length;t++){var n=arguments[t];n&&(e=o(e,r(n)))}return e}function r(e){if("string"==typeof e||"number"==typeof e)return e;if("object"!=typeof e)return"";if(Array.isArray(e))return n.apply(null,e);if(e.toString!==Object.prototype.toString&&!e.toString.toString().includes("[native code]"))return e.toString();var r="";for(var i in e)t.call(e,i)&&e[i]&&(r=o(r,i));return r}function o(e,t){return t?e?e+" "+t:e+t:e}e.exports?(n.default=n,e.exports=n):window.classNames=n}()}(classnames);var classnamesExports=classnames.exports;const classNames=getDefaultExportFromCjs(classnamesExports),Show=e=>{const{height:t="300px",value:n,maskTip:r=!1,maskClick:o}=e,i=React.useRef(null),a=React.useRef(null);React.useEffect(()=>(i.current&&l(i.current),()=>{var e;null==(e=a.current)||e.dispose()}),[]);const s=React.useRef(null);React.useEffect(()=>{var e,t;return(null==n?void 0:n.cells)&&(null==(e=a.current)||e.fromJSON(n.cells),null==(t=a.current)||t.centerContent(),s.current&&clearTimeout(s.current),s.current=setTimeout(()=>{var e;null==(e=a.current)||e.zoomToFit({maxScale:1,padding:20})},500)),()=>{s.current&&clearTimeout(s.current)}},[n]);const l=e=>{a.current=new Graph({container:e,autoResize:!0,background:{color:"#ffffff"},grid:{visible:!0,size:10,type:"dot",args:{color:"#a0a0a0",thickness:1}},panning:{enabled:!0,modifiers:["ctrl","meta"]},mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:["ctrl","meta"],minScale:.5,maxScale:3},interacting:!1})};return jsxRuntimeExports.jsxs("div",{className:classNames("drawx6","drawx6-show"),style:{height:t},children:[jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx("div",{ref:i,className:"drawx6-container"})}),!!r&&jsxRuntimeExports.jsx("div",{className:"drawx6-show-mask",onClick:o,children:"string"==typeof r&&jsxRuntimeExports.jsxs("div",{className:"drawx6-center drawx6-show-mask-tip",children:[r,jsxRuntimeExports.jsxs("svg",{width:"16",height:"17",viewBox:"0 0 16 17",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("path",{d:"M2.00477 7.0309L2.00977 7.0949L2.02377 7.2249C2.12977 7.9959 2.61077 8.2449 4.92477 8.9539L6.42377 9.4079L6.59977 9.4679C6.6472 9.48276 6.69282 9.50289 6.73577 9.5279L6.75177 9.5419L6.77077 9.5659C6.79377 9.6029 6.82377 9.6759 6.87377 9.8329L6.96077 10.1149L7.39277 11.5389L7.55677 12.0599C8.12777 13.8389 8.39877 14.1999 9.13677 14.2799L9.19777 14.2849C10.1658 14.3669 10.4048 13.9549 11.3768 11.2969L13.4548 5.5859L13.6278 5.0929C14.1158 3.6729 14.1238 3.2479 13.6518 2.7489L13.5998 2.6949C13.0028 2.0989 12.5648 2.1669 10.5338 2.9019L4.64877 5.0459L3.98577 5.2959C2.27677 5.9549 1.95477 6.2519 2.00477 7.0309ZM5.11877 6.1719L11.0628 4.0079C12.3268 3.5549 12.6708 3.4909 12.7368 3.5569L12.7488 3.5769L12.7568 3.6069C12.7768 3.7509 12.6618 4.1899 12.2348 5.3749L10.1218 11.1749L9.86377 11.8509C9.49577 12.7919 9.33777 13.0729 9.30177 13.0709L9.28477 13.0509L9.25677 13.0109C9.19758 12.9171 9.14511 12.8192 9.09977 12.7179L9.01777 12.5329L8.96177 12.3959C8.81703 12.0073 8.68595 11.6137 8.56877 11.2159L8.08877 9.6349C7.92877 9.1119 7.83877 8.9049 7.61377 8.6799C7.58752 8.65373 7.56016 8.62871 7.53177 8.6049L7.43677 8.5299C7.28077 8.4159 7.12077 8.3499 6.76877 8.2399L4.72477 7.6159L4.34077 7.4909C4.133 7.42316 3.92815 7.34676 3.72677 7.2619L3.65577 7.2319C3.31577 7.0799 3.22377 6.9949 3.22377 6.9919L3.22877 6.9809L3.24777 6.9639C3.35177 6.8809 3.83277 6.6509 5.11977 6.1719H5.11877Z"}),jsxRuntimeExports.jsx("path",{d:"M7.24609 9.07483L9.69727 6.8866",strokeLinecap:"round"})]})]})})]})},content$4=".x6-widget-dnd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n}\n.x6-widget-dnd.dragging {\n display: inline-block;\n}\n.x6-widget-dnd.dragging * {\n pointer-events: none !important;\n}\n.x6-widget-dnd .x6-graph {\n background: transparent;\n box-shadow: none;\n}\n";var __decorate$b=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Dnd2;class Dnd extends View{get targetScroller(){return this.options.target.getPlugin("scroller")}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}get snapline(){return this.options.target.getPlugin("snapline")}constructor(e){super(),this.name="dnd",this.options=Object.assign(Object.assign({},Dnd.defaults),e),this.init()}init(){ensure(this.name,content$4),this.container=document.createElement("div"),addClass(this.container,this.prefixClassName("widget-dnd")),this.draggingGraph=new Graph(Object.assign(Object.assign({},this.options.delegateGraphOptions),{container:document.createElement("div"),width:1,height:1,async:!1})),append(this.container,this.draggingGraph.container)}start(e,t){const n=t;n.preventDefault(),this.targetModel.startBatch("dnd"),addClass(this.container,"dragging"),appendTo(this.container,this.options.draggingContainer||document.body),this.sourceNode=e,this.prepareDragging(e,n.clientX,n.clientY);const r=this.updateNodePosition(n.clientX,n.clientY);this.isSnaplineEnabled()&&(this.snapline.captureCursorOffset({e:n,node:e,cell:e,view:this.draggingView,x:r.x,y:r.y}),this.draggingNode.on("change:position",this.snap,this)),this.delegateDocumentEvents(Dnd.documentEvents,n.data)}isSnaplineEnabled(){return this.snapline&&this.snapline.isEnabled()}prepareDragging(e,t,n){const r=this.draggingGraph,o=r.model,i=this.options.getDragNode(e,{sourceNode:e,draggingGraph:r,targetGraph:this.targetGraph});i.position(0,0);let a=5;if(this.isSnaplineEnabled()&&(a+=this.snapline.options.tolerance||0),this.isSnaplineEnabled()||this.options.scaled){const e=this.targetGraph.transform.getScale();r.scale(e.sx,e.sy),a*=Math.max(e.sx,e.sy)}else r.scale(1,1);this.clearDragging(),o.resetCells([i]);const s=r.findViewByCell(i);s.undelegateEvents(),s.cell.off("changed"),r.fitToContent({padding:a,allowNewOrigin:"any",useCellGeometry:!1});const l=s.getBBox();this.geometryBBox=s.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(l.getTopLeft()),this.draggingNode=i,this.draggingView=s,this.draggingBBox=i.getBBox(),this.padding=a,this.originOffset=this.updateGraphPosition(t,n)}updateGraphPosition(e,t){const n=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft,o=this.delta,i=this.geometryBBox,a=this.padding||5,s={left:e-o.x-i.width/2-a+r,top:t-o.y-i.height/2-a+n};return this.draggingGraph&&css(this.container,{left:`${s.left}px`,top:`${s.top}px`}),s}updateNodePosition(e,t){const n=this.targetGraph.clientToLocal(e,t),r=this.draggingBBox;return n.x-=r.width/2,n.y-=r.height/2,this.draggingNode.position(n.x,n.y),n}snap({cell:e,current:t,options:n}){const r=e;if(n.snapped){const e=this.draggingBBox;r.position(e.x+n.tx,e.y+n.ty,{silent:!0}),this.draggingView.translate(),r.position(t.x,t.y,{silent:!0}),this.snapOffset={x:n.tx,y:n.ty}}else this.snapOffset=null}onDragging(e){const t=this.draggingView;if(t){e.preventDefault();const n=this.normalizeEvent(e),r=n.clientX,o=n.clientY;this.updateGraphPosition(r,o);const i=this.updateNodePosition(r,o),a=this.targetGraph.options.embedding.enabled,s=(a||this.isSnaplineEnabled())&&this.isInsideValidArea({x:r,y:o});if(a){t.setEventData(n,{graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView});const e=t.getEventData(n);s?t.processEmbedding(n,e):t.clearEmbedding(e),this.candidateEmbedView=e.candidateEmbedView}this.isSnaplineEnabled()&&(s?this.snapline.snapOnMoving({e:n,view:t,x:i.x,y:i.y}):this.snapline.hide())}}onDragEnd(e){const t=this.draggingNode;if(t){const n=this.normalizeEvent(e),r=this.draggingView,o=this.draggingBBox,i=this.snapOffset;let a=o.x,s=o.y;i&&(a+=i.x,s+=i.y),t.position(a,s,{silent:!0});const l=this.drop(t,{x:n.clientX,y:n.clientY}),c=e=>{e?(this.onDropped(t),this.targetGraph.options.embedding.enabled&&r&&(r.setEventData(n,{cell:e,graph:this.targetGraph,candidateEmbedView:this.candidateEmbedView}),r.finalizeEmbedding(n,r.getEventData(n)))):this.onDropInvalid(),this.candidateEmbedView=null,this.targetModel.stopBatch("dnd")};isAsync(l)?(this.undelegateDocumentEvents(),l.then(c)):c(l)}}clearDragging(){this.draggingNode&&(this.sourceNode=null,this.draggingNode.remove(),this.draggingNode=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}onDropped(e){this.draggingNode===e&&(this.clearDragging(),removeClass(this.container,"dragging"),remove(this.container))}onDropInvalid(){const e=this.draggingNode;e&&this.onDropped(e)}isInsideValidArea(e){let t,n=null;const r=this.targetGraph,o=this.targetScroller;this.options.dndContainer&&(n=this.getDropArea(this.options.dndContainer));const i=n&&n.containsPoint(e);if(o)if(o.options.autoResize)t=this.getDropArea(o.container);else{const e=this.getDropArea(o.container);t=this.getDropArea(r.container).intersectsWithRect(e)}else t=this.getDropArea(r.container);return!i&&t&&t.containsPoint(e)}getDropArea(e){const t=offset$1(e),n=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return Rectangle.create({x:t.left+parseInt(css(e,"border-left-width"),10)-r,y:t.top+parseInt(css(e,"border-top-width"),10)-n,width:e.clientWidth,height:e.clientHeight})}drop(e,t){if(this.isInsideValidArea(t)){const n=this.targetGraph,r=n.model,o=n.clientToLocal(t),i=this.sourceNode,a=this.options.getDropNode(e,{sourceNode:i,draggingNode:e,targetGraph:this.targetGraph,draggingGraph:this.draggingGraph}),s=a.getBBox();o.x+=s.x-s.width/2,o.y+=s.y-s.height/2;const l=this.snapOffset?1:n.getGridSize();a.position(GeometryUtil.snapToGrid(o.x,l),GeometryUtil.snapToGrid(o.y,l)),a.removeZIndex();const c=this.options.validateNode,u=!c||c(a,{sourceNode:i,draggingNode:e,droppingNode:a,targetGraph:n,draggingGraph:this.draggingGraph});return"boolean"==typeof u?u?(r.addCell(a,{stencil:this.cid}),a):null:toDeferredBoolean(u).then(e=>e?(r.addCell(a,{stencil:this.cid}),a):null)}return null}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),clean(this.name)}}__decorate$b([View.dispose()],Dnd.prototype,"dispose",null),Dnd2=Dnd||(Dnd={}),Dnd2.defaults={getDragNode:e=>e.clone(),getDropNode:e=>e.clone()},Dnd2.documentEvents={mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"},Graph.prototype.toSVG=function(e,t){const n=this.getPlugin("export");n&&n.toSVG(e,t)},Graph.prototype.toPNG=function(e,t){const n=this.getPlugin("export");n&&n.toPNG(e,t)},Graph.prototype.toJPEG=function(e,t){const n=this.getPlugin("export");n&&n.toJPEG(e,t)},Graph.prototype.exportPNG=function(e,t){const n=this.getPlugin("export");n&&n.exportPNG(e,t)},Graph.prototype.exportJPEG=function(e,t){const n=this.getPlugin("export");n&&n.exportJPEG(e,t)},Graph.prototype.exportSVG=function(e,t){const n=this.getPlugin("export");n&&n.exportSVG(e,t)};var __decorate$a=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};class Export extends Basecoat{constructor(){super(),this.name="export"}get view(){return this.graph.view}init(e){this.graph=e}exportPNG(e="chart",t={}){this.toPNG(t=>{DataUri.downloadDataUri(t,e)},t)}exportJPEG(e="chart",t={}){this.toPNG(t=>{DataUri.downloadDataUri(t,e)},t)}exportSVG(e="chart",t={}){this.toSVG(t=>{DataUri.downloadDataUri(DataUri.svgToDataUrl(t),e)},t)}toSVG(e,t={}){this.notify("before:export",t);const n=this.view.svg,r=Vector.create(n).clone();let o=r.node;const i=r.findOne(`.${this.view.prefixClassName("graph-svg-stage")}`),a=t.viewBox||this.graph.graphToLocal(this.graph.getContentBBox()),s=t.preserveDimensions;if(s){const e="boolean"==typeof s?a:s;r.attr({width:e.width,height:e.height})}if(r.removeAttribute("style").attr("viewBox",[a.x,a.y,a.width,a.height].join(" ")),i.removeAttribute("transform"),!1!==t.copyStyles){const e=n.ownerDocument,t=Array.from(n.querySelectorAll("*")),r=Array.from(o.querySelectorAll("*")),i=e.styleSheets.length,a=[];for(let n=i-1;n>=0;n-=1)a[n]=e.styleSheets[n],e.styleSheets[n].disabled=!0;const s={};t.forEach((e,t)=>{const n=window.getComputedStyle(e,null),r={};Object.keys(n).forEach(e=>{r[e]=n.getPropertyValue(e)}),s[t]=r}),i!==e.styleSheets.length&&a.forEach((t,n)=>{e.styleSheets[n]=t});for(let n=0;n<i;n+=1)e.styleSheets[n].disabled=!1;const l={};t.forEach((e,t)=>{const n=window.getComputedStyle(e,null),r=s[t],o={};Object.keys(n).forEach(e=>{isNumber(e)||n.getPropertyValue(e)===r[e]||(o[e]=n.getPropertyValue(e))}),l[t]=o}),r.forEach((e,t)=>{css(e,l[t])})}const l=t.stylesheet;if("string"==typeof l){const e=n.ownerDocument.implementation.createDocument(null,"xml",null).createCDATASection(l);r.prepend(Vector.create("style",{type:"text/css"},[e]))}const c=()=>{const n=t.beforeSerialize;if("function"==typeof n){const e=call$1(n,this.graph,o);e instanceof SVGSVGElement&&(o=e)}const r=(new XMLSerializer).serializeToString(o).replace(/ /g," ");this.notify("after:export",t),e(r)};if(t.serializeImages){const e=r.find("image").map(e=>new Promise(t=>{const n=e.attr("xlink:href")||e.attr("href");DataUri.imageToDataUri(n,(n,r)=>{!n&&r&&e.attr("xlink:href",r),t()})}));Promise.all(e).then(c)}else c()}toDataURL(e,t){let n=t.viewBox||this.graph.getContentBBox();const r=normalizeSides(t.padding);t.width&&t.height&&(r.left+r.right>=t.width&&(r.left=r.right=0),r.top+r.bottom>=t.height&&(r.top=r.bottom=0));const o=new Rectangle(-r.left,-r.top,r.left+r.right,r.top+r.bottom);if(t.width&&t.height){const e=n.width+r.left+r.right,i=n.height+r.top+r.bottom;o.scale(e/t.width,i/t.height)}n=Rectangle.create(n).moveAndExpand(o);const i="number"==typeof t.width&&"number"==typeof t.height?{width:t.width,height:t.height}:n;let a=t.ratio?parseFloat(t.ratio):1;Number.isFinite(a)&&0!==a||(a=1);const s={width:Math.max(Math.round(i.width*a),1),height:Math.max(Math.round(i.height*a),1)};{const e=document.createElement("canvas"),t=e.getContext("2d");e.width=s.width,e.height=s.height;const n=s.width-1,r=s.height-1;t.fillStyle="rgb(1,1,1)",t.fillRect(n,r,1,1);const o=t.getImageData(n,r,1,1).data;if(1!==o[0]||1!==o[1]||1!==o[2])throw new Error("size exceeded")}const l=new Image;l.onload=()=>{const n=document.createElement("canvas");n.width=s.width,n.height=s.height;const r=n.getContext("2d");r.fillStyle=t.backgroundColor||"white",r.fillRect(0,0,s.width,s.height);try{r.drawImage(l,0,0,s.width,s.height);const o=n.toDataURL(t.type,t.quality);e(o)}catch(o){}},this.toSVG(e=>{l.src=`data:image/svg+xml,${encodeURIComponent(e)}`},Object.assign(Object.assign({},t),{viewBox:n,serializeImages:!0,preserveDimensions:Object.assign({},s)}))}toPNG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/png"}))}toJPEG(e,t={}){this.toDataURL(e,Object.assign(Object.assign({},t),{type:"image/jpeg"}))}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.off()}}__decorate$a([Basecoat.dispose()],Export.prototype,"dispose",null);var __decorate$9=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Private$1;class TransformImpl extends View{get model(){return this.graph.model}get view(){return this.graph.renderer.findViewByCell(this.node)}get containerClassName(){return this.prefixClassName("widget-transform")}get resizeClassName(){return`${this.containerClassName}-resize`}get rotateClassName(){return`${this.containerClassName}-rotate`}constructor(e,t,n){super(),this.node=t,this.graph=n,this.options=Object.assign(Object.assign({},Private$1.defaultOptions),e),this.render(),this.startListening()}startListening(){this.delegateEvents({[`mousedown .${this.resizeClassName}`]:"startResizing",[`touchstart .${this.resizeClassName}`]:"startResizing",[`mousedown .${this.rotateClassName}`]:"startRotating",[`touchstart .${this.rotateClassName}`]:"startRotating"}),this.model.on("*",this.update,this),this.graph.on("scale",this.update,this),this.graph.on("translate",this.update,this),this.node.on("removed",this.remove,this),this.model.on("reseted",this.remove,this),this.view.on("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.on("cell:knob:mouseup",this.onKnobMouseUp,this)}stopListening(){this.undelegateEvents(),this.model.off("*",this.update,this),this.graph.off("scale",this.update,this),this.graph.off("translate",this.update,this),this.node.off("removed",this.remove,this),this.model.off("reseted",this.remove,this),this.view.off("cell:knob:mousedown",this.onKnobMouseDown,this),this.view.off("cell:knob:mouseup",this.onKnobMouseUp,this)}renderHandles(){this.container=document.createElement("div");const e=document.createElement("div");attr(e,"draggable","false");const t=e.cloneNode(!0);addClass(t,this.rotateClassName);const n=Private$1.POSITIONS.map(t=>{const n=e.cloneNode(!0);return addClass(n,this.resizeClassName),attr(n,"data-position",t),n});this.empty(),append(this.container,[...n,t])}render(){return this.renderHandles(),this.view&&this.view.addClass(Private$1.NODE_CLS),addClass(this.container,this.containerClassName),toggleClass(this.container,"no-orth-resize",this.options.preserveAspectRatio||!this.options.orthogonalResizing),toggleClass(this.container,"no-resize",!this.options.resizable),toggleClass(this.container,"no-rotate",!this.options.rotatable),this.options.className&&addClass(this.container,this.options.className),this.graph.container.appendChild(this.container),this.update()}update(){const e=this.graph.matrix(),t=this.node.getBBox();t.x*=e.a,t.x+=e.e,t.y*=e.d,t.y+=e.f,t.width*=e.a,t.height*=e.d;const n=Angle.normalize(this.node.getAngle()),r=0!==n?`rotate(${n}deg)`:"";return css(this.container,{transform:r,width:t.width,height:t.height,left:t.x,top:t.y}),this.updateResizerDirections(),this}remove(){return this.view&&this.view.removeClass(Private$1.NODE_CLS),super.remove()}onKnobMouseDown(){this.startHandle()}onKnobMouseUp(){this.stopHandle()}updateResizerDirections(){const e=Angle.normalize(this.node.getAngle()),t=Math.floor(e*(Private$1.DIRECTIONS.length/360));if(t!==this.prevShift){const e=Private$1.DIRECTIONS.slice(t).concat(Private$1.DIRECTIONS.slice(0,t)),n=e=>`${this.containerClassName}-cursor-${e}`;this.container.querySelectorAll(`.${this.resizeClassName}`).forEach((t,r)=>{removeClass(t,Private$1.DIRECTIONS.map(e=>n(e)).join(" ")),addClass(t,n(e[r]))}),this.prevShift=t}}getTrueDirection(e){const t=Angle.normalize(this.node.getAngle());let n=Private$1.POSITIONS.indexOf(e);return n+=Math.floor(t*(Private$1.POSITIONS.length/360)),n%=Private$1.POSITIONS.length,Private$1.POSITIONS[n]}toValidResizeDirection(e){return{top:"top-left",bottom:"bottom-right",left:"bottom-left",right:"top-right"}[e]||e}startResizing(e){e.stopPropagation(),this.model.startBatch("resize",{cid:this.cid});const t=attr(e.target,"data-position");this.prepareResizing(e,t),this.startAction(e)}prepareResizing(e,t){const n=this.getTrueDirection(t);let r=0,o=0;t.split("-").forEach(e=>{r={left:-1,right:1}[e]||r,o={top:-1,bottom:1}[e]||o});const i=this.toValidResizeDirection(t),a={"top-right":"bottomLeft","top-left":"bottomRight","bottom-left":"topRight","bottom-right":"topLeft"}[i],s=Angle.normalize(this.node.getAngle());this.setEventData(e,{selector:a,direction:i,trueDirection:n,relativeDirection:t,angle:s,resizeX:r,resizeY:o,action:"resizing"})}startRotating(e){e.stopPropagation(),this.model.startBatch("rotate",{cid:this.cid});const t=this.node.getBBox().getCenter(),n=this.normalizeEvent(e),r=this.graph.snapToGrid(n.clientX,n.clientY);this.setEventData(e,{center:t,action:"rotating",angle:Angle.normalize(this.node.getAngle()),start:Point.create(r).theta(t)}),this.startAction(e)}onMouseMove(e){const t=this.graph.findViewByCell(this.node);let n=this.getEventData(e);if(n.action){const r=this.normalizeEvent(e);let o=r.clientX,i=r.clientY;const a=this.graph.getPlugin("scroller"),s=this.options.restrictedResizing;if(!0===s||"number"==typeof s){const e=!0===s?0:s,t=a?Math.max(e,8):e,n=this.graph.container.getBoundingClientRect();o=clamp(o,n.left+t,n.right-t),i=clamp(i,n.top+t,n.bottom-t)}else this.options.autoScrollOnResizing&&a&&a.autoScroll(o,i);const l=this.graph.snapToGrid(o,i),c=this.graph.getGridSize(),u=this.node,d=this.options;if("resizing"===n.action){n.resized||(t&&(t.addClass("node-resizing"),this.notify("node:resize",e,t)),n.resized=!0);const r=u.getBBox(),o=Point.create(l).rotate(n.angle,r.getCenter()).diff(r[n.selector]);let i=n.resizeX?o.x*n.resizeX:r.width,a=n.resizeY?o.y*n.resizeY:r.height;const s=i,p=a;if(i=GeometryUtil.snapToGrid(i,c),a=GeometryUtil.snapToGrid(a,c),i=Math.max(i,d.minWidth||c),a=Math.max(a,d.minHeight||c),i=Math.min(i,d.maxWidth||1/0),a=Math.min(a,d.maxHeight||1/0),d.preserveAspectRatio){const e=r.width*a/r.height,t=r.height*i/r.width;i<e?a=t:i=e}const f=n.relativeDirection;if(d.allowReverse&&(s<=-i||p<=-a)){let t;"left"===f?s<=-i&&(t="right"):"right"===f?s<=-i&&(t="left"):"top"===f?p<=-a&&(t="bottom"):"bottom"===f?p<=-a&&(t="top"):"top-left"===f?s<=-i&&p<=-a?t="bottom-right":s<=-i?t="top-right":p<=-a&&(t="bottom-left"):"top-right"===f?s<=-i&&p<=-a?t="bottom-left":s<=-i?t="top-left":p<=-a&&(t="bottom-right"):"bottom-left"===f?s<=-i&&p<=-a?t="top-right":s<=-i?t="bottom-right":p<=-a&&(t="top-left"):"bottom-right"===f&&(s<=-i&&p<=-a?t="top-left":s<=-i?t="bottom-left":p<=-a&&(t="top-right"));const n=t;this.stopHandle();const r=this.container.querySelector(`.${this.resizeClassName}[data-position="${n}"]`);this.startHandle(r),this.prepareResizing(e,n),this.onMouseMove(e)}if(r.width!==i||r.height!==a){const r={ui:!0,direction:n.direction,relativeDirection:n.relativeDirection,trueDirection:n.trueDirection,minWidth:d.minWidth,minHeight:d.minHeight,maxWidth:d.maxWidth,maxHeight:d.maxHeight,preserveAspectRatio:!0===d.preserveAspectRatio};u.resize(i,a,r),this.notify("node:resizing",e,t)}}else if("rotating"===n.action){n.rotated||(t&&(t.addClass("node-rotating"),this.notify("node:rotate",e,t)),n.rotated=!0);const r=u.getAngle(),o=n.start-Point.create(l).theta(n.center);let i=n.angle+o;d.rotateGrid&&(i=GeometryUtil.snapToGrid(i,d.rotateGrid)),i=Angle.normalize(i),r!==i&&(u.rotate(i,{absolute:!0}),this.notify("node:rotating",e,t))}}}onMouseUp(e){const t=this.getEventData(e);t.action&&(this.stopAction(e),this.model.stopBatch("resizing"===t.action?"resize":"rotate",{cid:this.cid}))}startHandle(e){if(this.handle=e||null,addClass(this.container,`${this.containerClassName}-active`),e){addClass(e,`${this.containerClassName}-active-handle`);const t=e.getAttribute("data-position");if(t){const e=Private$1.DIRECTIONS[Private$1.POSITIONS.indexOf(t)];addClass(this.container,`${this.containerClassName}-cursor-${e}`)}}}stopHandle(){if(removeClass(this.container,`${this.containerClassName}-active`),this.handle){removeClass(this.handle,`${this.containerClassName}-active-handle`);const e=this.handle.getAttribute("data-position");if(e){const t=Private$1.DIRECTIONS[Private$1.POSITIONS.indexOf(e)];removeClass(this.container,`${this.containerClassName}-cursor-${t}`)}this.handle=null}}startAction(e){this.startHandle(e.target),this.graph.view.undelegateEvents(),this.delegateDocumentEvents(Private$1.documentEvents,e.data)}stopAction(e){this.stopHandle(),this.undelegateDocumentEvents(),this.graph.view.delegateEvents();const t=this.graph.findViewByCell(this.node),n=this.getEventData(e);t&&(t.removeClass(`node-${n.action}`),"resizing"===n.action&&n.resized?this.notify("node:resized",e,t):"rotating"===n.action&&n.rotated&&this.notify("node:rotated",e,t))}notify(e,t,n,r={}){if(n){const o=n.graph,i=o.view.normalizeEvent(t),a=o.snapToGrid(i.clientX,i.clientY);this.trigger(e,Object.assign({e:i,view:n,node:n.cell,cell:n.cell,x:a.x,y:a.y},r))}}dispose(){this.stopListening(),this.remove(),this.off()}}__decorate$9([View.dispose()],TransformImpl.prototype,"dispose",null),function(e){e.NODE_CLS="has-widget-transform",e.DIRECTIONS=["nw","n","ne","e","se","s","sw","w"],e.POSITIONS=["top-left","top","top-right","right","bottom-right","bottom","bottom-left","left"],e.documentEvents={mousemove:"onMouseMove",touchmove:"onMouseMove",mouseup:"onMouseUp",touchend:"onMouseUp"},e.defaultOptions={minWidth:0,minHeight:0,maxWidth:1/0,maxHeight:1/0,rotateGrid:15,rotatable:!0,preserveAspectRatio:!1,orthogonalResizing:!0,restrictedResizing:!1,autoScrollOnResizing:!0,allowReverse:!0}}(Private$1||(Private$1={}));const content$3=".x6-widget-transform {\n position: absolute;\n box-sizing: content-box !important;\n margin: -5px 0 0 -5px;\n padding: 4px;\n border: 1px dashed #000;\n border-radius: 5px;\n user-select: none;\n pointer-events: none;\n}\n.x6-widget-transform > div {\n position: absolute;\n box-sizing: border-box;\n background-color: #fff;\n border: 1px solid #000;\n transition: background-color 0.2s;\n pointer-events: auto;\n -webkit-user-drag: none;\n user-drag: none;\n /* stylelint-disable-line */\n}\n.x6-widget-transform > div:hover {\n background-color: #d3d3d3;\n}\n.x6-widget-transform-cursor-n {\n cursor: n-resize;\n}\n.x6-widget-transform-cursor-s {\n cursor: s-resize;\n}\n.x6-widget-transform-cursor-e {\n cursor: e-resize;\n}\n.x6-widget-transform-cursor-w {\n cursor: w-resize;\n}\n.x6-widget-transform-cursor-ne {\n cursor: ne-resize;\n}\n.x6-widget-transform-cursor-nw {\n cursor: nw-resize;\n}\n.x6-widget-transform-cursor-se {\n cursor: se-resize;\n}\n.x6-widget-transform-cursor-sw {\n cursor: sw-resize;\n}\n.x6-widget-transform-resize {\n width: 10px;\n height: 10px;\n border-radius: 6px;\n}\n.x6-widget-transform-resize[data-position='top-left'] {\n top: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='top-right'] {\n top: -5px;\n right: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-left'] {\n bottom: -5px;\n left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom-right'] {\n right: -5px;\n bottom: -5px;\n}\n.x6-widget-transform-resize[data-position='top'] {\n top: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='bottom'] {\n bottom: -5px;\n left: 50%;\n margin-left: -5px;\n}\n.x6-widget-transform-resize[data-position='left'] {\n top: 50%;\n left: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform-resize[data-position='right'] {\n top: 50%;\n right: -5px;\n margin-top: -5px;\n}\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='top'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.prevent-aspect-ratio .x6-widget-transform-resize[data-position='right'] {\n display: none;\n}\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='bottom'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='left'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='right'],\n.x6-widget-transform.no-orth-resize .x6-widget-transform-resize[data-position='top'] {\n display: none;\n}\n.x6-widget-transform.no-resize .x6-widget-transform-resize {\n display: none;\n}\n.x6-widget-transform-rotate {\n top: -20px;\n left: -20px;\n width: 12px;\n height: 12px;\n border-radius: 6px;\n cursor: crosshair;\n}\n.x6-widget-transform.no-rotate .x6-widget-transform-rotate {\n display: none;\n}\n.x6-widget-transform-active {\n border-color: transparent;\n pointer-events: all;\n}\n.x6-widget-transform-active > div {\n display: none;\n}\n.x6-widget-transform-active > .x6-widget-transform-active-handle {\n display: block;\n background-color: #808080;\n}\n";Graph.prototype.createTransformWidget=function(e){const t=this.getPlugin("transform");return t&&t.createWidget(e),this},Graph.prototype.clearTransformWidgets=function(){const e=this.getPlugin("transform");return e&&e.clearWidgets(),this};var __decorate$8=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Transform2;class Transform extends Basecoat{constructor(e={}){super(),this.name="transform",this.widgets=new Map,this.disabled=!1,this.options=e,ensure(this.name,content$3)}init(e){this.graph=e,this.disabled||this.startListening()}startListening(){this.graph.on("node:click",this.onNodeClick,this),this.graph.on("blank:mousedown",this.onBlankMouseDown,this)}stopListening(){this.graph.off("node:click",this.onNodeClick,this),this.graph.off("blank:mousedown",this.onBlankMouseDown,this)}enable(){this.disabled&&(this.disabled=!1,this.startListening())}disable(){this.disabled||(this.disabled=!0,this.stopListening())}isEnabled(){return!this.disabled}createWidget(e){this.clearWidgets();const t=this.createTransform(e);t&&(this.widgets.set(e,t),t.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)}))}onNodeClick({node:e}){this.createWidget(e)}onBlankMouseDown(){this.clearWidgets()}createTransform(e){const t=this.getTransformOptions(e);return t.resizable||t.rotatable?new TransformImpl(t,e,this.graph):null}getTransformOptions(e){this.options.resizing||(this.options.resizing={enabled:!1}),this.options.rotating||(this.options.rotating={enabled:!1}),"boolean"==typeof this.options.resizing&&(this.options.resizing={enabled:this.options.resizing}),"boolean"==typeof this.options.rotating&&(this.options.rotating={enabled:this.options.rotating});const t=Transform.parseOptionGroup(this.graph,e,this.options.resizing),n=Transform.parseOptionGroup(this.graph,e,this.options.rotating);return{resizable:!!t.enabled,minWidth:t.minWidth||0,maxWidth:t.maxWidth||Number.MAX_SAFE_INTEGER,minHeight:t.minHeight||0,maxHeight:t.maxHeight||Number.MAX_SAFE_INTEGER,orthogonalResizing:"boolean"!=typeof t.orthogonal||t.orthogonal,restrictedResizing:!!t.restrict,autoScrollOnResizing:"boolean"!=typeof t.autoScroll||t.autoScroll,preserveAspectRatio:!!t.preserveAspectRatio,allowReverse:"boolean"!=typeof t.allowReverse||t.allowReverse,rotatable:!!n.enabled,rotateGrid:n.grid||15}}clearWidgets(){this.widgets.forEach((e,t)=>{this.graph.getCellById(t.id)&&e.dispose()}),this.widgets.clear()}dispose(){this.clearWidgets(),this.stopListening(),this.off(),clean(this.name)}}__decorate$8([Basecoat.dispose()],Transform.prototype,"dispose",null),Transform2=Transform||(Transform={}),Transform2.parseOptionGroup=function(e,t,n){const r={};return Object.keys(n||{}).forEach(o=>{const i=n[o];r[o]="function"==typeof i?i.call(e,t):i}),r};var mousetrap={exports:{}};!function(e){!function(t,n){if(t){for(var r,o={8:"backspace",9:"tab",13:"enter",16:"shift",17:"ctrl",18:"alt",20:"capslock",27:"esc",32:"space",33:"pageup",34:"pagedown",35:"end",36:"home",37:"left",38:"up",39:"right",40:"down",45:"ins",46:"del",91:"meta",93:"meta",224:"meta"},i={106:"*",107:"+",109:"-",110:".",111:"/",186:";",187:"=",188:",",189:"-",190:".",191:"/",192:"`",219:"[",220:"\\",221:"]",222:"'"},a={"~":"`","!":"1","@":"2","#":"3",$:"4","%":"5","^":"6","&":"7","*":"8","(":"9",")":"0",_:"-","+":"=",":":";",'"':"'","<":",",">":".","?":"/","|":"\\"},s={option:"alt",command:"meta",return:"enter",escape:"esc",plus:"+",mod:/Mac|iPod|iPhone|iPad/.test(navigator.platform)?"meta":"ctrl"},l=1;l<20;++l)o[111+l]="f"+l;for(l=0;l<=9;++l)o[l+96]=l.toString();m.prototype.bind=function(e,t,n){var r=this;return e=e instanceof Array?e:[e],r._bindMultiple.call(r,e,t,n),r},m.prototype.unbind=function(e,t){return this.bind.call(this,e,function(){},t)},m.prototype.trigger=function(e,t){var n=this;return n._directMap[e+":"+t]&&n._directMap[e+":"+t]({},e),n},m.prototype.reset=function(){var e=this;return e._callbacks={},e._directMap={},e},m.prototype.stopCallback=function(e,t){if((" "+t.className+" ").indexOf(" mousetrap ")>-1)return!1;if(g(t,this.target))return!1;if("composedPath"in e&&"function"==typeof e.composedPath){var n=e.composedPath()[0];n!==e.target&&(t=n)}return"INPUT"==t.tagName||"SELECT"==t.tagName||"TEXTAREA"==t.tagName||t.isContentEditable},m.prototype.handleKey=function(){return this._handleKey.apply(this,arguments)},m.addKeycodes=function(e){for(var t in e)e.hasOwnProperty(t)&&(o[t]=e[t]);r=null},m.init=function(){var e=m(n);for(var t in e)"_"!==t.charAt(0)&&(m[t]=function(t){return function(){return e[t].apply(e,arguments)}}(t))},m.init(),t.Mousetrap=m,e.exports&&(e.exports=m)}function c(e,t,n){e.addEventListener?e.addEventListener(t,n,!1):e.attachEvent("on"+t,n)}function u(e){if("keypress"==e.type){var t=String.fromCharCode(e.which);return e.shiftKey||(t=t.toLowerCase()),t}return o[e.which]?o[e.which]:i[e.which]?i[e.which]:String.fromCharCode(e.which).toLowerCase()}function d(e,t){return e.sort().join(",")===t.sort().join(",")}function p(e){return"shift"==e||"ctrl"==e||"alt"==e||"meta"==e}function f(e,t,n){return n||(n=function(){if(!r)for(var e in r={},o)e>95&&e<112||o.hasOwnProperty(e)&&(r[o[e]]=e);return r}()[e]?"keydown":"keypress"),"keypress"==n&&t.length&&(n="keydown"),n}function h(e,t){var n,r,o,i=[];for(n=function(e){return"+"===e?["+"]:(e=e.replace(/\+{2}/g,"+plus")).split("+")}(e),o=0;o<n.length;++o)r=n[o],s[r]&&(r=s[r]),t&&"keypress"!=t&&a[r]&&(r=a[r],i.push("shift")),p(r)&&i.push(r);return{key:r,modifiers:i,action:t=f(r,i,t)}}function g(e,t){return null!==e&&e!==n&&(e===t||g(e.parentNode,t))}function m(e){var t=this;if(e=e||n,!(t instanceof m))return new m(e);t.target=e,t._callbacks={},t._directMap={};var r,o={},i=!1,a=!1,s=!1;function l(e){e=e||{};var t,n=!1;for(t in o)e[t]?n=!0:o[t]=0;n||(s=!1)}function f(e,n,r,i,a,s){var l,c,u=[],f=r.type;if(!t._callbacks[e])return[];for("keyup"==f&&p(e)&&(n=[e]),l=0;l<t._callbacks[e].length;++l)if(c=t._callbacks[e][l],(i||!c.seq||o[c.seq]==c.level)&&f==c.action&&("keypress"==f&&!r.metaKey&&!r.ctrlKey||d(n,c.modifiers))){var h=!i&&c.combo==a,g=i&&c.seq==i&&c.level==s;(h||g)&&t._callbacks[e].splice(l,1),u.push(c)}return u}function g(e,n,r,o){t.stopCallback(n,n.target||n.srcElement,r,o)||!1===e(n,r)&&(function(e){e.preventDefault?e.preventDefault():e.returnValue=!1}(n),function(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}(n))}function y(e){"number"!=typeof e.which&&(e.which=e.keyCode);var n=u(e);n&&("keyup"!=e.type||i!==n?t.handleKey(n,function(e){var t=[];return e.shiftKey&&t.push("shift"),e.altKey&&t.push("alt"),e.ctrlKey&&t.push("ctrl"),e.metaKey&&t.push("meta"),t}(e),e):i=!1)}function v(e,t,n,a){function c(t){return function(){s=t,++o[e],clearTimeout(r),r=setTimeout(l,1e3)}}function d(t){g(n,t,e),"keyup"!==a&&(i=u(t)),setTimeout(l,10)}o[e]=0;for(var p=0;p<t.length;++p){var f=p+1===t.length?d:c(a||h(t[p+1]).action);b(t[p],f,a,e,p)}}function b(e,n,r,o,i){t._directMap[e+":"+r]=n;var a,s=(e=e.replace(/\s+/g," ")).split(" ");s.length>1?v(e,s,n,r):(a=h(e,r),t._callbacks[a.key]=t._callbacks[a.key]||[],f(a.key,a.modifiers,{type:a.action},o,e,i),t._callbacks[a.key][o?"unshift":"push"]({callback:n,modifiers:a.modifiers,action:a.action,seq:o,level:i,combo:e}))}t._handleKey=function(e,t,n){var r,o=f(e,t,n),i={},c=0,u=!1;for(r=0;r<o.length;++r)o[r].seq&&(c=Math.max(c,o[r].level));for(r=0;r<o.length;++r)if(o[r].seq){if(o[r].level!=c)continue;u=!0,i[o[r].seq]=1,g(o[r].callback,n,o[r].combo,o[r].seq)}else u||g(o[r].callback,n,o[r].combo);var d="keypress"==n.type&&a;n.type!=s||p(e)||d||l(i),a=u&&"keydown"==n.type},t._bindMultiple=function(e,t,n){for(var r=0;r<e.length;++r)b(e[r],t,n)},c(e,"keypress",y),c(e,"keydown",y),c(e,"keyup",y)}}("undefined"!=typeof window?window:null,"undefined"!=typeof window?document:null)}(mousetrap);var mousetrapExports=mousetrap.exports;const Mousetrap=getDefaultExportFromCjs(mousetrapExports);var __decorate$7=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},KeyboardImpl2;class KeyboardImpl extends Disposable{get graph(){return this.options.graph}constructor(e){super(),this.options=e;const t=this.graph.getPlugin("scroller");this.container=t?t.container:this.graph.container,e.global?this.target=document:(this.target=this.container,this.disabled||this.target.setAttribute("tabindex","-1"),this.graph.on("cell:mouseup",this.focus,this),this.graph.on("blank:mouseup",this.focus,this)),this.mousetrap=KeyboardImpl.createMousetrap(this)}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.target instanceof HTMLElement&&this.target.setAttribute("tabindex","-1"))}disable(){this.disabled||(this.options.enabled=!1,this.target instanceof HTMLElement&&this.target.removeAttribute("tabindex"))}on(e,t,n){this.mousetrap.bind(this.getKeys(e),t,n)}off(e,t){this.mousetrap.unbind(this.getKeys(e),t)}clear(){this.mousetrap.reset()}trigger(e,t){this.mousetrap.trigger(e,t)}focus(e){if(this.isInputEvent(e.e))return;this.target.focus({preventScroll:!0})}getKeys(e){return(Array.isArray(e)?e:[e]).map(e=>this.formatkey(e))}formatkey(e){const t=e.toLocaleLowerCase().replace(/\s/g,"").replace("delete","del").replace("cmd","command").replace("arrowup","up").replace("arrowright","right").replace("arrowdown","down").replace("arrowleft","left"),n=this.options.format;return n?call$1(n,this.graph,t):t}isGraphEvent(e){const t=e.target,n=e.currentTarget;return!!t&&(t===this.target||n===this.target||t===document.body||contains(this.container,t))}isInputEvent(e){var t;const n=e.target,r=null===(t=null==n?void 0:n.tagName)||void 0===t?void 0:t.toLowerCase();let o=["input","textarea"].includes(r);return"true"===attr(n,"contenteditable")&&(o=!0),o}isEnabledForEvent(e){const t=!this.disabled&&this.isGraphEvent(e),n=this.isInputEvent(e);if(t){if(n&&("Backspace"===e.key||"Delete"===e.key))return!1;if(this.options.guard)return call$1(this.options.guard,this.graph,e)}return t}dispose(){this.mousetrap.reset()}}__decorate$7([Disposable.dispose()],KeyboardImpl.prototype,"dispose",null),KeyboardImpl2=KeyboardImpl||(KeyboardImpl={}),KeyboardImpl2.createMousetrap=function(e){const t=new Mousetrap(e.target),n=t.stopCallback;return t.stopCallback=(r,o,i)=>!e.isEnabledForEvent(r)||!!n&&n.call(t,r,o,i),t},Graph.prototype.isKeyboardEnabled=function(){const e=this.getPlugin("keyboard");return!!e&&e.isEnabled()},Graph.prototype.enableKeyboard=function(){const e=this.getPlugin("keyboard");return e&&e.enable(),this},Graph.prototype.disableKeyboard=function(){const e=this.getPlugin("keyboard");return e&&e.disable(),this},Graph.prototype.toggleKeyboard=function(e){const t=this.getPlugin("keyboard");return t&&t.toggleEnabled(e),this},Graph.prototype.bindKey=function(e,t,n){const r=this.getPlugin("keyboard");return r&&r.bindKey(e,t,n),this},Graph.prototype.unbindKey=function(e,t){const n=this.getPlugin("keyboard");return n&&n.unbindKey(e,t),this},Graph.prototype.clearKeys=function(){const e=this.getPlugin("keyboard");return e&&e.clear(),this},Graph.prototype.triggerKey=function(e,t){const n=this.getPlugin("keyboard");return n&&n.trigger(e,t),this};var __decorate$6=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Storage;class Keyboard extends Disposable{constructor(e={}){super(),this.name="keyboard",this.options=Object.assign({enabled:!0},e)}init(e){this.keyboardImpl=new KeyboardImpl(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.keyboardImpl.disabled}enable(){this.keyboardImpl.enable()}disable(){this.keyboardImpl.disable()}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}bindKey(e,t,n){return this.keyboardImpl.on(e,t,n),this}trigger(e,t){return this.keyboardImpl.trigger(e,t),this}clear(){return this.keyboardImpl.clear(),this}unbindKey(e,t){return this.keyboardImpl.off(e,t),this}dispose(){this.keyboardImpl.dispose()}}__decorate$6([Disposable.dispose()],Keyboard.prototype,"dispose",null);class ClipboardImpl{constructor(){this.cells=[]}copy(e,t,n={}){this.options=Object.assign({},n);const r=(Model.isModel(t)?t:t.model).cloneSubGraph(e,n);this.cells=sortBy(Object.keys(r).map(e=>r[e]),e=>e.isEdge()?2:1),this.serialize(n)}cut(e,t,n={}){this.copy(e,t,n);(Graph.isGraph(t)?t.model:t).batchUpdate("cut",()=>{e.forEach(e=>e.remove())})}paste(e,t={}){const n=Object.assign(Object.assign({},this.options),t),{offset:r,edgeProps:o,nodeProps:i}=n;let a=20,s=20;r&&(a="number"==typeof r?r:r.dx,s="number"==typeof r?r:r.dy),this.deserialize(n);const l=this.cells;l.forEach(e=>{e.model=null,e.removeProp("zIndex"),(a||s)&&e.translate(a,s),i&&e.isNode()&&e.prop(i),o&&e.isEdge()&&e.prop(o)});const c=Graph.isGraph(e)?e.model:e;return c.batchUpdate("paste",()=>{c.addCells(this.cells)}),this.copy(l,e,t),l}serialize(e){!1!==e.useLocalStorage&&Storage.save(this.cells)}deserialize(e){if(e.useLocalStorage){const e=Storage.fetch();e&&(this.cells=e)}}isEmpty(e={}){return e.useLocalStorage&&this.deserialize(e),this.cells.length<=0}clean(){this.options={},this.cells=[],Storage.clean()}}!function(e){const t=`${Config.prefixCls}.clipboard.cells`;e.save=function(e){if(window.localStorage){const n=e.map(e=>e.toJSON());localStorage.setItem(t,JSON.stringify(n))}},e.fetch=function(){if(window.localStorage){const e=localStorage.getItem(t),n=e?JSON.parse(e):[];if(n)return Model.fromJSON(n)}},e.clean=function(){window.localStorage&&localStorage.removeItem(t)}}(Storage||(Storage={})),Graph.prototype.isClipboardEnabled=function(){const e=this.getPlugin("clipboard");return!!e&&e.isEnabled()},Graph.prototype.enableClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.enable(),this},Graph.prototype.disableClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.disable(),this},Graph.prototype.toggleClipboard=function(e){const t=this.getPlugin("clipboard");return t&&t.toggleEnabled(e),this},Graph.prototype.isClipboardEmpty=function(e){const t=this.getPlugin("clipboard");return!t||t.isEmpty(e)},Graph.prototype.getCellsInClipboard=function(){const e=this.getPlugin("clipboard");return e?e.getCellsInClipboard():[]},Graph.prototype.cleanClipboard=function(){const e=this.getPlugin("clipboard");return e&&e.clean(),this},Graph.prototype.copy=function(e,t){const n=this.getPlugin("clipboard");return n&&n.copy(e,t),this},Graph.prototype.cut=function(e,t){const n=this.getPlugin("clipboard");return n&&n.cut(e,t),this},Graph.prototype.paste=function(e,t){const n=this.getPlugin("clipboard");return n?n.paste(e,t):[]};var __decorate$5=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},__rest$1=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};class Clipboard extends Basecoat{get disabled(){return!0!==this.options.enabled}get cells(){return this.clipboardImpl.cells}constructor(e={}){super(),this.name="clipboard",this.options=Object.assign({enabled:!0},e)}init(e){this.graph=e,this.clipboardImpl=new ClipboardImpl,this.clipboardImpl.deserialize(this.options)}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isEmpty(e={}){return this.clipboardImpl.isEmpty(e)}getCellsInClipboard(){return this.cells}clean(e){return this.disabled&&!e||(this.clipboardImpl.clean(),this.notify("clipboard:changed",{cells:[]})),this}copy(e,t={}){return this.disabled||(this.clipboardImpl.copy(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}cut(e,t={}){return this.disabled||(this.clipboardImpl.cut(e,this.graph,Object.assign(Object.assign({},this.commonOptions),t)),this.notify("clipboard:changed",{cells:e})),this}paste(e={},t=this.graph){return this.disabled?[]:this.clipboardImpl.paste(t,Object.assign(Object.assign({},this.commonOptions),e))}get commonOptions(){const e=this.options,{enabled:t}=e;return __rest$1(e,["enabled"])}notify(e,t){this.trigger(e,t),this.graph.trigger(e,t)}dispose(){this.clean(!0),this.off()}}__decorate$5([Basecoat.dispose()],Clipboard.prototype,"dispose",null),Graph.prototype.isHistoryEnabled=function(){const e=this.getPlugin("history");return!!e&&e.isEnabled()},Graph.prototype.enableHistory=function(){const e=this.getPlugin("history");return e&&e.enable(),this},Graph.prototype.disableHistory=function(){const e=this.getPlugin("history");return e&&e.disable(),this},Graph.prototype.toggleHistory=function(e){const t=this.getPlugin("history");return t&&t.toggleEnabled(e),this},Graph.prototype.undo=function(e){const t=this.getPlugin("history");return t&&t.undo(e),this},Graph.prototype.redo=function(e){const t=this.getPlugin("history");return t&&t.redo(e),this},Graph.prototype.undoAndCancel=function(e){const t=this.getPlugin("history");return t&&t.cancel(e),this},Graph.prototype.canUndo=function(){const e=this.getPlugin("history");return!!e&&e.canUndo()},Graph.prototype.canRedo=function(){const e=this.getPlugin("history");return!!e&&e.canRedo()},Graph.prototype.cleanHistory=function(e){const t=this.getPlugin("history");return t&&t.clean(e),this},Graph.prototype.getHistoryStackSize=function(){return this.getPlugin("history").getSize()},Graph.prototype.getUndoStackSize=function(){return this.getPlugin("history").getUndoSize()},Graph.prototype.getRedoStackSize=function(){return this.getPlugin("history").getRedoSize()},Graph.prototype.getUndoRemainSize=function(){return this.getPlugin("history").getUndoRemainSize()};var __decorate$4=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Util;class History extends Basecoat{constructor(e={}){super(),this.name="history",this.batchCommands=null,this.batchLevel=0,this.lastBatchIndex=-1,this.freezed=!1,this.stackSize=0,this.handlers=[];const{stackSize:t=0}=e;this.stackSize=t,this.options=Util.getOptions(e),this.validator=new History.Validator({history:this,cancelInvalid:this.options.cancelInvalid})}init(e){this.graph=e,this.model=this.graph.model,this.clean(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}undo(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack.push(t),this.notify("undo",t,e))}return this}redo(e={}){if(!this.disabled){const t=this.redoStack.pop();t&&(this.applyCommand(t,e),this.undoStackPush(t),this.notify("redo",t,e))}return this}cancel(e={}){if(!this.disabled){const t=this.undoStack.pop();t&&(this.revertCommand(t,e),this.redoStack=[],this.notify("cancel",t,e))}return this}getSize(){return this.stackSize}getUndoRemainSize(){const e=this.undoStack.length;return this.stackSize-e}getUndoSize(){return this.undoStack.length}getRedoSize(){return this.redoStack.length}canUndo(){return!this.disabled&&this.undoStack.length>0}canRedo(){return!this.disabled&&this.redoStack.length>0}clean(e={}){return this.undoStack=[],this.redoStack=[],this.notify("clean",null,e),this}get disabled(){return!0!==this.options.enabled}validate(e,...t){return this.validator.validate(e,...t),this}startListening(){this.model.on("batch:start",this.initBatchCommand,this),this.model.on("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&this.options.eventNames.forEach((e,t)=>{this.handlers[t]=this.addCommand.bind(this,e),this.model.on(e,this.handlers[t])}),this.validator.on("invalid",e=>this.trigger("invalid",e))}stopListening(){this.model.off("batch:start",this.initBatchCommand,this),this.model.off("batch:stop",this.storeBatchCommand,this),this.options.eventNames&&(this.options.eventNames.forEach((e,t)=>{this.model.off(e,this.handlers[t])}),this.handlers.length=0),this.validator.off("invalid")}createCommand(e){return{batch:!!e&&e.batch,data:{}}}revertCommand(e,t){this.freezed=!0;const n=Array.isArray(e)?Util.sortBatchCommands(e):[e];for(let r=n.length-1;r>=0;r-=1){const e=n[r],o=Object.assign(Object.assign({},t),pick(e.options,this.options.revertOptionsList||[]));this.executeCommand(e,!0,o)}this.freezed=!1}applyCommand(e,t){this.freezed=!0;const n=Array.isArray(e)?Util.sortBatchCommands(e):[e];for(let r=0;r<n.length;r+=1){const e=n[r],o=Object.assign(Object.assign({},t),pick(e.options,this.options.applyOptionsList||[]));this.executeCommand(e,!1,o)}this.freezed=!1}executeCommand(e,t,n){const r=this.model,o=r.getCell(e.data.id),i=e.event;if(Util.isAddEvent(i)&&t||Util.isRemoveEvent(i)&&!t)o&&o.remove(n);else if(Util.isAddEvent(i)&&!t||Util.isRemoveEvent(i)&&t){const t=e.data;t.node?r.addNode(t.props,n):t.edge&&r.addEdge(t.props,n)}else if(Util.isChangeEvent(i)){const r=e.data,i=r.key;if(i&&o){const e=t?r.prev[i]:r.next[i];if("attrs"===r.key){this.ensureUndefinedAttrs(e,t?r.next[i]:r.prev[i])&&(n.dirty=!0)}o.prop(i,e,n)}}else{const r=this.options.executeCommand;r&&call$1(r,this,e,t,n)}}addCommand(e,t){if(this.freezed||this.disabled)return;const n=t,r=n.options||{};if(r.dryrun)return;if(Util.isAddEvent(e)&&this.options.ignoreAdd||Util.isRemoveEvent(e)&&this.options.ignoreRemove||Util.isChangeEvent(e)&&this.options.ignoreChange)return;const o=this.options.beforeAddCommand;if(null!=o&&!1===call$1(o,this,e,t))return;"cell:change:*"===e&&(e=`cell:change:${n.key}`);const i=n.cell,a=Model.isModel(i);let s;if(this.batchCommands){s=this.batchCommands[Math.max(this.lastBatchIndex,0)];const t=a&&!s.modelChange||s.data.id!==i.id,n=s.event!==e;if(this.lastBatchIndex>=0&&(t||n)){const t=this.batchCommands.findIndex(t=>(a&&t.modelChange||t.data.id===i.id)&&t.event===e);t<0||Util.isAddEvent(e)||Util.isRemoveEvent(e)?s=this.createCommand({batch:!0}):(s=this.batchCommands[t],this.batchCommands.splice(t,1)),this.batchCommands.push(s),this.lastBatchIndex=this.batchCommands.length-1}}else s=this.createCommand({batch:!1});if(Util.isAddEvent(e)||Util.isRemoveEvent(e)){const t=s.data;return s.event=e,s.options=r,t.id=i.id,t.props=cloneDeep(i.toJSON()),i.isEdge()?t.edge=!0:i.isNode()&&(t.node=!0),this.push(s,r)}if(Util.isChangeEvent(e)){const n=t.key,o=s.data;return s.batch&&s.event||(s.event=e,s.options=r,o.key=n,null==o.prev&&(o.prev={}),o.prev[n]=cloneDeep(i.previous(n)),a?s.modelChange=!0:o.id=i.id),null==o.next&&(o.next={}),o.next[n]=cloneDeep(i.prop(n)),this.push(s,r)}const l=this.options.afterAddCommand;l&&call$1(l,this,e,t,s),this.push(s,r)}initBatchCommand(e){this.freezed||(this.batchCommands?this.batchLevel+=1:(this.batchCommands=[this.createCommand({batch:!0})],this.batchLevel=0,this.lastBatchIndex=-1))}storeBatchCommand(e){if(!this.freezed)if(this.batchCommands&&this.batchLevel<=0){const t=this.filterBatchCommand(this.batchCommands);t.length>0&&(this.redoStack=[],this.undoStackPush(t),this.consolidateCommands(),this.notify("add",t,e)),this.batchCommands=null,this.lastBatchIndex=-1,this.batchLevel=0}else this.batchCommands&&this.batchLevel>0&&(this.batchLevel-=1)}filterBatchCommand(e){let t=e.slice();const n=[];for(;t.length>0;){const e=t.shift(),r=e.event,o=e.data.id;if(null!=r&&(null!=o||e.modelChange)){if(Util.isAddEvent(r)){const e=t.findIndex(e=>Util.isRemoveEvent(e.event)&&e.data.id===o);if(e>=0){t=t.filter((t,n)=>e<n||t.data.id!==o);continue}}else if(Util.isRemoveEvent(r)){const e=t.findIndex(e=>Util.isAddEvent(e.event)&&e.data.id===o);if(e>=0){t.splice(e,1);continue}}else if(Util.isChangeEvent(r)){const t=e.data;if(isEqual(t.prev,t.next))continue}n.push(e)}}return n}notify(e,t,n){const r=null==t?null:Array.isArray(t)?t:[t];this.emit(e,{cmds:r,options:n}),this.graph.trigger(`history:${e}`,{cmds:r,options:n}),this.emit("change",{cmds:r,options:n}),this.graph.trigger("history:change",{cmds:r,options:n})}push(e,t){this.redoStack=[],e.batch?(this.lastBatchIndex=Math.max(this.lastBatchIndex,0),this.emit("batch",{cmd:e,options:t})):(this.undoStackPush(e),this.consolidateCommands(),this.notify("add",e,t))}consolidateCommands(){var e;const t=this.undoStack[this.undoStack.length-1],n=this.undoStack[this.undoStack.length-2];if(!Array.isArray(t))return;const r=new Set(t.map(e=>e.event));if(2!==r.size||!r.has("cell:change:parent")||!r.has("cell:change:children"))return;if(!t.every(e=>{var t;return e.batch&&(null===(t=e.options)||void 0===t?void 0:t.ui)}))return;if(!Array.isArray(n)||1!==n.length)return;const o=n[0];"cell:change:position"===o.event&&(null===(e=o.options)||void 0===e?void 0:e.ui)&&(n.push(...t),this.undoStack.pop())}undoStackPush(e){0!==this.stackSize?(this.undoStack.length>=this.stackSize&&this.undoStack.shift(),this.undoStack.push(e)):this.undoStack.push(e)}ensureUndefinedAttrs(e,t){let n=!1;return null!==e&&null!==t&&"object"==typeof e&&"object"==typeof t&&Object.keys(t).forEach(r=>{void 0===e[r]&&void 0!==t[r]?(e[r]=void 0,n=!0):"object"==typeof e[r]&&"object"==typeof t[r]&&(n=this.ensureUndefinedAttrs(e[r],t[r]))}),n}dispose(){this.validator.dispose(),this.clean(),this.stopListening(),this.off()}}__decorate$4([Basecoat.dispose()],History.prototype,"dispose",null),function(e){class t extends Basecoat{constructor(e){super(),this.map={},this.command=e.history,this.cancelInvalid=!1!==e.cancelInvalid,this.command.on("add",this.onCommandAdded,this)}onCommandAdded({cmds:e}){return Array.isArray(e)?e.every(e=>this.isValidCommand(e)):this.isValidCommand(e)}isValidCommand(e){if(e.options&&!1===e.options.validation)return!0;const t=e.event&&this.map[e.event]||[];let n=null;return t.forEach(t=>{let r=0;const o=i=>{const a=t[r];r+=1;try{if(!a)return void(n=i);a(i,e,o)}catch(s){o(s)}};o(n)}),!n||(this.cancelInvalid&&this.command.cancel(),this.emit("invalid",{err:n}),!1)}validate(e,...t){const n=Array.isArray(e)?e:e.split(/\s+/);return t.forEach(e=>{if("function"!=typeof e)throw new Error(`${n.join(" ")} requires callback functions.`)}),n.forEach(e=>{null==this.map[e]&&(this.map[e]=[]),this.map[e].push(t)}),this}dispose(){this.command.off("add",this.onCommandAdded,this)}}__decorate$4([Basecoat.dispose()],t.prototype,"dispose",null),e.Validator=t}(History||(History={})),function(e){e.isAddEvent=function(e){return"cell:added"===e},e.isRemoveEvent=function(e){return"cell:removed"===e},e.isChangeEvent=function(e){return null!=e&&e.startsWith("cell:change:")},e.getOptions=function(t){const n=["cell:added","cell:removed","cell:change:*"],r=["batch:start","batch:stop"],o=t.eventNames?t.eventNames.filter(t=>!(e.isChangeEvent(t)||n.includes(t)||r.includes(t))):n;return Object.assign(Object.assign({enabled:!0},t),{eventNames:o,applyOptionsList:t.applyOptionsList||["propertyPath"],revertOptionsList:t.revertOptionsList||["propertyPath"]})},e.sortBatchCommands=function(t){const n=[];for(let r=0,o=t.length;r<o;r+=1){const o=t[r];let i=null;if(e.isAddEvent(o.event)){const e=o.data.id;for(let n=0;n<r;n+=1)if(t[n].data.id===e){i=n;break}}null!==i?n.splice(i,0,o):n.push(o)}return n}}(Util||(Util={}));var __decorate$3=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Private;class SelectionImpl extends View{get graph(){return this.options.graph}get boxClassName(){return this.prefixClassName(Private.classNames.box)}get $boxes(){return children(this.container,this.boxClassName)}get handleOptions(){return this.options}constructor(e){super(),this.options=e,this.options.model&&(this.options.collection=this.options.model.collection),this.options.collection?this.collection=this.options.collection:(this.collection=new Collection([],{comparator:Private.depthComparator}),this.options.collection=this.collection),this.boxCount=0,this.createContainer(),this.startListening()}startListening(){const e=this.graph,t=this.collection;this.delegateEvents({[`mousedown .${this.boxClassName}`]:"onSelectionBoxMouseDown",[`touchstart .${this.boxClassName}`]:"onSelectionBoxMouseDown"},!0),e.on("scale",this.onGraphTransformed,this),e.on("translate",this.onGraphTransformed,this),e.model.on("updated",this.onModelUpdated,this),t.on("added",this.onCellAdded,this),t.on("removed",this.onCellRemoved,this),t.on("reseted",this.onReseted,this),t.on("updated",this.onCollectionUpdated,this),t.on("node:change:position",this.onNodePositionChanged,this),t.on("cell:changed",this.onCellChanged,this)}stopListening(){const e=this.graph,t=this.collection;this.undelegateEvents(),e.off("scale",this.onGraphTransformed,this),e.off("translate",this.onGraphTransformed,this),e.model.off("updated",this.onModelUpdated,this),t.off("added",this.onCellAdded,this),t.off("removed",this.onCellRemoved,this),t.off("reseted",this.onReseted,this),t.off("updated",this.onCollectionUpdated,this),t.off("node:change:position",this.onNodePositionChanged,this),t.off("cell:changed",this.onCellChanged,this)}onRemove(){this.stopListening()}onGraphTransformed(){this.updateSelectionBoxes()}onCellChanged(){this.updateSelectionBoxes()}onNodePositionChanged({node:e,options:t}){const{showNodeSelectionBox:n,pointerEvents:r}=this.options,{ui:o,selection:i,translateBy:a,snapped:s}=t,l=(!0!==n||r&&"none"===this.getPointerEventsValue(r))&&!this.translating&&!i,c=o&&a&&e.id===a;if(l&&(c||s)){this.translating=!0;const n=e.position(),r=e.previous("position"),o=n.x-r.x,i=n.y-r.y;0===o&&0===i||this.translateSelectedNodes(o,i,e,t),this.translating=!1}}onModelUpdated({removed:e}){e&&e.length&&this.unselect(e)}isEmpty(){return this.length<=0}isSelected(e){return this.collection.has(e)}get length(){return this.collection.length}get cells(){return this.collection.toArray()}select(e,t={}){t.dryrun=!0;const n=this.filter(Array.isArray(e)?e:[e]);return this.collection.add(n,t),this}unselect(e,t={}){return t.dryrun=!0,this.collection.remove(Array.isArray(e)?e:[e],t),this}reset(e,t={}){if(e){if(t.batch){const n=this.filter(Array.isArray(e)?e:[e]);return this.collection.reset(n,Object.assign(Object.assign({},t),{ui:!0})),this}const n=this.cells,r=this.filter(Array.isArray(e)?e:[e]),o={},i={};n.forEach(e=>o[e.id]=e),r.forEach(e=>i[e.id]=e);const a=[],s=[];return r.forEach(e=>{o[e.id]||a.push(e)}),n.forEach(e=>{i[e.id]||s.push(e)}),s.length&&this.unselect(s,Object.assign(Object.assign({},t),{ui:!0})),a.length&&this.select(a,Object.assign(Object.assign({},t),{ui:!0})),0===s.length&&0===a.length&&this.updateContainer(),this}return this.clean(t)}clean(e={}){return this.length&&(!1===e.batch?this.unselect(this.cells,e):this.collection.reset([],Object.assign(Object.assign({},e),{ui:!0}))),this}setFilter(e){this.options.filter=e}setContent(e){this.options.content=e}startSelecting(e){let t,n;e=this.normalizeEvent(e),this.clean();const r=this.graph.container;if(null!=e.offsetX&&null!=e.offsetY&&r.contains(e.target))t=e.offsetX,n=e.offsetY;else{const o=offset$1(r),i=r.scrollLeft,a=r.scrollTop;t=e.clientX-o.left+window.pageXOffset+i,n=e.clientY-o.top+window.pageYOffset+a}css(this.container,{top:n,left:t,width:1,height:1}),this.setEventData(e,{action:"selecting",clientX:e.clientX,clientY:e.clientY,offsetX:t,offsetY:n,scrollerX:0,scrollerY:0,moving:!1}),this.delegateDocumentEvents(Private.documentEvents,e.data)}filter(e){const t=this.options.filter;return e.filter(e=>Array.isArray(t)?t.some(t=>"string"==typeof t?e.shape===t:e.id===t.id):"function"!=typeof t||call$1(t,this.graph,e))}stopSelecting(e){const t=this.graph,n=this.getEventData(e);switch(n.action){case"selecting":{let e=width$1(this.container),n=height$1(this.container);const r=offset$1(this.container),o=t.pageToLocal(r.left,r.top),i=t.transform.getScale();e/=i.sx,n/=i.sy;const a=new Rectangle(o.x,o.y,e,n),s=this.getCellViewsInArea(a).map(e=>e.cell);this.reset(s,{batch:!0}),this.hideRubberband();break}case"translating":{const r=t.snapToGrid(e.clientX,e.clientY);if(!this.options.following){const e=n;this.updateSelectedNodesPosition({dx:e.clientX-e.originX,dy:e.clientY-e.originY})}this.graph.model.stopBatch("move-selection"),this.notifyBoxEvent("box:mouseup",e,r.x,r.y);break}default:this.clean()}}onMouseUp(e){this.getEventData(e).action&&(this.stopSelecting(e),this.undelegateDocumentEvents())}onSelectionBoxMouseDown(e){this.options.following||e.stopPropagation();const t=this.normalizeEvent(e);this.options.movable&&this.startTranslating(t);const n=this.getCellViewFromElem(t.target);this.setEventData(t,{activeView:n});const r=this.graph.snapToGrid(t.clientX,t.clientY);this.notifyBoxEvent("box:mousedown",t,r.x,r.y),this.delegateDocumentEvents(Private.documentEvents,t.data)}startTranslating(e){this.graph.model.startBatch("move-selection");const t=this.graph.snapToGrid(e.clientX,e.clientY);this.setEventData(e,{action:"translating",clientX:t.x,clientY:t.y,originX:t.x,originY:t.y})}getRestrictArea(){const e=this.graph.options.translating.restrict,t="function"==typeof e?call$1(e,this.graph,null):e;return"number"==typeof t?this.graph.transform.getGraphArea().inflate(t):!0===t?this.graph.transform.getGraphArea():t||null}getSelectionOffset(e,t){let n=e.x-t.clientX,r=e.y-t.clientY;const o=this.getRestrictArea();if(o){const i=this.collection.toArray(),a=Cell.getCellsBBox(i,{deep:!0})||Rectangle.create(),s=o.x-a.x,l=o.y-a.y,c=o.x+o.width-(a.x+a.width),u=o.y+o.height-(a.y+a.height);if(n<s&&(n=s),r<l&&(r=l),c<n&&(n=c),u<r&&(r=u),!this.options.following){const o=e.x-t.originX,i=e.y-t.originY;n=o<=s||o>=c?0:n,r=i<=l||i>=u?0:r}}return{dx:n,dy:r}}updateElementPosition(e,t,n){const r=css(e,"left"),o=css(e,"top"),i=r?parseFloat(r):0,a=o?parseFloat(o):0;css(e,"left",i+t),css(e,"top",a+n)}updateSelectedNodesPosition(e){const{dx:t,dy:n}=e;if(t||n)if(this.translateSelectedNodes(t,n),this.boxesUpdated)this.collection.length>1&&this.updateSelectionBoxes();else{const e=this.graph.transform.getScale();for(let r=0,o=this.$boxes,i=o.length;r<i;r+=1)this.updateElementPosition(o[r],t*e.sx,n*e.sy);this.updateElementPosition(this.selectionContainer,t*e.sx,n*e.sy)}}autoScrollGraph(e,t){const n=this.graph.getPlugin("scroller");return n?n.autoScroll(e,t):{scrollerX:0,scrollerY:0}}adjustSelection(e){const t=this.normalizeEvent(e),n=this.getEventData(t);switch(n.action){case"selecting":{const e=n;!0!==e.moving&&(appendTo(this.container,this.graph.container),this.showRubberband(),e.moving=!0);const{scrollerX:r,scrollerY:o}=this.autoScrollGraph(t.clientX,t.clientY);e.scrollerX+=r,e.scrollerY+=o;const i=t.clientX-e.clientX+e.scrollerX,a=t.clientY-e.clientY+e.scrollerY,s=parseInt(css(this.container,"left")||"0",10),l=parseInt(css(this.container,"top")||"0",10);css(this.container,{left:i<0?e.offsetX+i:s,top:a<0?e.offsetY+a:l,width:Math.abs(i),height:Math.abs(a)});break}case"translating":{const r=this.graph.snapToGrid(t.clientX,t.clientY),o=n,i=this.getSelectionOffset(r,o);this.options.following?this.updateSelectedNodesPosition(i):this.updateContainerPosition(i),i.dx&&(o.clientX=r.x),i.dy&&(o.clientY=r.y),this.notifyBoxEvent("box:mousemove",e,r.x,r.y);break}}this.boxesUpdated=!1}translateSelectedNodes(e,t,n,r){const o={},i=[];if(n&&(o[n.id]=!0),this.collection.toArray().forEach(e=>{e.getDescendants({deep:!0}).forEach(e=>{o[e.id]=!0})}),r&&r.translateBy){const e=this.graph.getCellById(r.translateBy);e&&(o[e.id]=!0,e.getDescendants({deep:!0}).forEach(e=>{o[e.id]=!0}),i.push(e))}this.collection.toArray().forEach(n=>{if(!o[n.id]){const a=Object.assign(Object.assign({},r),{selection:this.cid,exclude:i});n.translate(e,t,a),this.graph.model.getConnectedEdges(n).forEach(n=>{o[n.id]||(n.translate(e,t,a),o[n.id]=!0)})}})}getCellViewsInArea(e){const t=this.graph,n={strict:this.options.strict};let r=[];return this.options.rubberNode&&(r=r.concat(t.model.getNodesInArea(e,n).map(e=>t.renderer.findViewByCell(e)).filter(e=>null!=e))),this.options.rubberEdge&&(r=r.concat(t.model.getEdgesInArea(e,n).map(e=>t.renderer.findViewByCell(e)).filter(e=>null!=e))),r}notifyBoxEvent(e,t,n,r){const o=this.getEventData(t).activeView;this.trigger(e,{e:t,view:o,x:n,y:r,cell:o.cell})}getSelectedClassName(e){return this.prefixClassName((e.isNode()?"node":"edge")+"-selected")}addCellSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.addClass(this.getSelectedClassName(e))}removeCellUnSelectedClassName(e){const t=this.graph.renderer.findViewByCell(e);t&&t.removeClass(this.getSelectedClassName(e))}destroySelectionBox(e){this.removeCellUnSelectedClassName(e),this.canShowSelectionBox(e)&&(remove(this.container.querySelector(`[data-cell-id="${e.id}"]`)),0===this.$boxes.length&&this.hide(),this.boxCount=Math.max(0,this.boxCount-1))}destroyAllSelectionBoxes(e){e.forEach(e=>this.removeCellUnSelectedClassName(e)),this.hide(),remove(this.$boxes),this.boxCount=0}hide(){removeClass(this.container,this.prefixClassName(Private.classNames.rubberband)),removeClass(this.container,this.prefixClassName(Private.classNames.selected))}showRubberband(){addClass(this.container,this.prefixClassName(Private.classNames.rubberband))}hideRubberband(){removeClass(this.container,this.prefixClassName(Private.classNames.rubberband))}showSelected(){removeAttribute(this.container,"style"),addClass(this.container,this.prefixClassName(Private.classNames.selected))}createContainer(){this.container=document.createElement("div"),addClass(this.container,this.prefixClassName(Private.classNames.root)),this.options.className&&addClass(this.container,this.options.className),this.selectionContainer=document.createElement("div"),addClass(this.selectionContainer,this.prefixClassName(Private.classNames.inner)),this.selectionContent=document.createElement("div"),addClass(this.selectionContent,this.prefixClassName(Private.classNames.content)),append(this.selectionContainer,this.selectionContent),attr(this.selectionContainer,"data-selection-length",this.collection.length),prepend(this.container,this.selectionContainer)}updateContainerPosition(e){(e.dx||e.dy)&&this.updateElementPosition(this.selectionContainer,e.dx,e.dy)}updateContainer(){const e={x:1/0,y:1/0},t={x:0,y:0};this.collection.toArray().filter(e=>this.canShowSelectionBox(e)).forEach(n=>{const r=this.graph.renderer.findViewByCell(n);if(r){const n=r.getBBox({useCellGeometry:!0});e.x=Math.min(e.x,n.x),e.y=Math.min(e.y,n.y),t.x=Math.max(t.x,n.x+n.width),t.y=Math.max(t.y,n.y+n.height)}}),css(this.selectionContainer,{position:"absolute",pointerEvents:"none",left:e.x,top:e.y,width:t.x-e.x,height:t.y-e.y}),attr(this.selectionContainer,"data-selection-length",this.collection.length);const n=this.options.content;if(n)if("function"==typeof n){const e=call$1(n,this.graph,this,this.selectionContent);e&&(this.selectionContent.innerHTML=e)}else this.selectionContent.innerHTML=n;this.collection.length>0&&!this.container.parentNode?appendTo(this.container,this.graph.container):this.collection.length<=0&&this.container.parentNode&&this.container.parentNode.removeChild(this.container)}canShowSelectionBox(e){return e.isNode()&&!0===this.options.showNodeSelectionBox||e.isEdge()&&!0===this.options.showEdgeSelectionBox}getPointerEventsValue(e){return"string"==typeof e?e:e(this.cells)}createSelectionBox(e){if(this.addCellSelectedClassName(e),this.canShowSelectionBox(e)){const t=this.graph.renderer.findViewByCell(e);if(t){const n=t.getBBox({useCellGeometry:!0}),r=this.boxClassName,o=document.createElement("div"),i=this.options.pointerEvents;addClass(o,r),addClass(o,`${r}-${e.isNode()?"node":"edge"}`),attr(o,"data-cell-id",e.id),css(o,{position:"absolute",left:n.x,top:n.y,width:n.width,height:n.height,pointerEvents:i?this.getPointerEventsValue(i):"auto"}),appendTo(o,this.container),this.showSelected(),this.boxCount+=1}}}updateSelectionBoxes(){this.collection.length>0&&(this.boxesUpdated=!0,this.confirmUpdate())}confirmUpdate(){if(this.boxCount){this.hide();for(let e=0,t=this.$boxes,n=t.length;e<n;e+=1){const n=t[e],r=attr(n,"data-cell-id");remove(n),this.boxCount-=1;const o=this.collection.get(r);o&&this.createSelectionBox(o)}this.updateContainer()}return 0}getCellViewFromElem(e){const t=e.getAttribute("data-cell-id");if(t){const e=this.collection.get(t);if(e)return this.graph.renderer.findViewByCell(e)}return null}onCellRemoved({cell:e}){this.destroySelectionBox(e),this.updateContainer()}onReseted({previous:e,current:t}){this.destroyAllSelectionBoxes(e),t.forEach(e=>{this.listenCellRemoveEvent(e),this.createSelectionBox(e)}),this.updateContainer()}onCellAdded({cell:e}){this.listenCellRemoveEvent(e),this.createSelectionBox(e),this.updateContainer()}listenCellRemoveEvent(e){e.off("removed",this.onCellRemoved,this),e.on("removed",this.onCellRemoved,this)}onCollectionUpdated({added:e,removed:t,options:n}){e.forEach(e=>{this.trigger("cell:selected",{cell:e,options:n}),e.isNode()?this.trigger("node:selected",{cell:e,options:n,node:e}):e.isEdge()&&this.trigger("edge:selected",{cell:e,options:n,edge:e})}),t.forEach(e=>{this.trigger("cell:unselected",{cell:e,options:n}),e.isNode()?this.trigger("node:unselected",{cell:e,options:n,node:e}):e.isEdge()&&this.trigger("edge:unselected",{cell:e,options:n,edge:e})});const r={added:e,removed:t,options:n,selected:this.cells.filter(e=>!!this.graph.getCellById(e.id))};this.trigger("selection:changed",r)}dispose(){this.clean(),this.remove(),this.off()}}__decorate$3([View.dispose()],SelectionImpl.prototype,"dispose",null),function(e){const t="widget-selection";e.classNames={root:t,inner:`${t}-inner`,box:`${t}-box`,content:`${t}-content`,rubberband:`${t}-rubberband`,selected:`${t}-selected`},e.documentEvents={mousemove:"adjustSelection",touchmove:"adjustSelection",mouseup:"onMouseUp",touchend:"onMouseUp",touchcancel:"onMouseUp"},e.depthComparator=function(e){return e.getAncestors().length}}(Private||(Private={}));const content$2=".x6-widget-selection {\n position: absolute;\n top: 0;\n left: 0;\n display: none;\n width: 0;\n height: 0;\n touch-action: none;\n}\n.x6-widget-selection-rubberband {\n display: block;\n overflow: visible;\n opacity: 0.3;\n}\n.x6-widget-selection-selected {\n display: block;\n}\n.x6-widget-selection-box {\n cursor: move;\n}\n.x6-widget-selection-inner[data-selection-length='0'],\n.x6-widget-selection-inner[data-selection-length='1'] {\n display: none;\n}\n.x6-widget-selection-content {\n position: absolute;\n top: 100%;\n right: -20px;\n left: -20px;\n margin-top: 30px;\n padding: 6px;\n line-height: 14px;\n text-align: center;\n border-radius: 6px;\n}\n.x6-widget-selection-content:empty {\n display: none;\n}\n.x6-widget-selection-rubberband {\n background-color: #3498db;\n border: 2px solid #2980b9;\n}\n.x6-widget-selection-box {\n box-sizing: content-box !important;\n margin-top: -4px;\n margin-left: -4px;\n padding-right: 4px;\n padding-bottom: 4px;\n border: 2px dashed #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-inner {\n box-sizing: content-box !important;\n margin-top: -8px;\n margin-left: -8px;\n padding-right: 12px;\n padding-bottom: 12px;\n border: 2px solid #feb663;\n box-shadow: 2px 2px 5px #d3d3d3;\n}\n.x6-widget-selection-content {\n color: #fff;\n font-size: 10px;\n background-color: #6a6b8a;\n}\n";Graph.prototype.isSelectionEnabled=function(){const e=this.getPlugin("selection");return!!e&&e.isEnabled()},Graph.prototype.enableSelection=function(){const e=this.getPlugin("selection");return e&&e.enable(),this},Graph.prototype.disableSelection=function(){const e=this.getPlugin("selection");return e&&e.disable(),this},Graph.prototype.toggleSelection=function(e){const t=this.getPlugin("selection");return t&&t.toggleEnabled(e),this},Graph.prototype.isMultipleSelection=function(){const e=this.getPlugin("selection");return!!e&&e.isMultipleSelection()},Graph.prototype.enableMultipleSelection=function(){const e=this.getPlugin("selection");return e&&e.enableMultipleSelection(),this},Graph.prototype.disableMultipleSelection=function(){const e=this.getPlugin("selection");return e&&e.disableMultipleSelection(),this},Graph.prototype.toggleMultipleSelection=function(e){const t=this.getPlugin("selection");return t&&t.toggleMultipleSelection(e),this},Graph.prototype.isSelectionMovable=function(){const e=this.getPlugin("selection");return!!e&&e.isSelectionMovable()},Graph.prototype.enableSelectionMovable=function(){const e=this.getPlugin("selection");return e&&e.enableSelectionMovable(),this},Graph.prototype.disableSelectionMovable=function(){const e=this.getPlugin("selection");return e&&e.disableSelectionMovable(),this},Graph.prototype.toggleSelectionMovable=function(e){const t=this.getPlugin("selection");return t&&t.toggleSelectionMovable(e),this},Graph.prototype.isRubberbandEnabled=function(){const e=this.getPlugin("selection");return!!e&&e.isRubberbandEnabled()},Graph.prototype.enableRubberband=function(){const e=this.getPlugin("selection");return e&&e.enableRubberband(),this},Graph.prototype.disableRubberband=function(){const e=this.getPlugin("selection");return e&&e.disableRubberband(),this},Graph.prototype.toggleRubberband=function(e){const t=this.getPlugin("selection");return t&&t.toggleRubberband(e),this},Graph.prototype.isStrictRubberband=function(){const e=this.getPlugin("selection");return!!e&&e.isStrictRubberband()},Graph.prototype.enableStrictRubberband=function(){const e=this.getPlugin("selection");return e&&e.enableStrictRubberband(),this},Graph.prototype.disableStrictRubberband=function(){const e=this.getPlugin("selection");return e&&e.disableStrictRubberband(),this},Graph.prototype.toggleStrictRubberband=function(e){const t=this.getPlugin("selection");return t&&t.toggleStrictRubberband(e),this},Graph.prototype.setRubberbandModifiers=function(e){const t=this.getPlugin("selection");return t&&t.setRubberbandModifiers(e),this},Graph.prototype.setSelectionFilter=function(e){const t=this.getPlugin("selection");return t&&t.setSelectionFilter(e),this},Graph.prototype.setSelectionDisplayContent=function(e){const t=this.getPlugin("selection");return t&&t.setSelectionDisplayContent(e),this},Graph.prototype.isSelectionEmpty=function(){const e=this.getPlugin("selection");return!e||e.isEmpty()},Graph.prototype.cleanSelection=function(e){const t=this.getPlugin("selection");return t&&t.clean(e),this},Graph.prototype.resetSelection=function(e,t){const n=this.getPlugin("selection");return n&&n.reset(e,t),this},Graph.prototype.getSelectedCells=function(){const e=this.getPlugin("selection");return e?e.getSelectedCells():[]},Graph.prototype.getSelectedCellCount=function(){const e=this.getPlugin("selection");return e?e.getSelectedCellCount():0},Graph.prototype.isSelected=function(e){const t=this.getPlugin("selection");return!!t&&t.isSelected(e)},Graph.prototype.select=function(e,t){const n=this.getPlugin("selection");return n&&n.select(e,t),this},Graph.prototype.unselect=function(e,t){const n=this.getPlugin("selection");return n&&n.unselect(e,t),this};var __decorate$2=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},Selection2;class Selection extends Basecoat{get rubberbandDisabled(){return!0!==this.options.enabled||!0!==this.options.rubberband}get disabled(){return!0!==this.options.enabled}get length(){return this.selectionImpl.length}get cells(){return this.selectionImpl.cells}constructor(e={}){super(),this.name="selection",this.movedMap=new WeakMap,this.unselectMap=new WeakMap,this.options=Object.assign(Object.assign({enabled:!0},Selection.defaultOptions),e),ensure(this.name,content$2)}init(e){this.graph=e,this.selectionImpl=new SelectionImpl(Object.assign(Object.assign({},this.options),{graph:e})),this.setup(),this.startListening()}isEnabled(){return!this.disabled}enable(){this.disabled&&(this.options.enabled=!0)}disable(){this.disabled||(this.options.enabled=!1)}toggleEnabled(e){return null!=e?e!==this.isEnabled()&&(e?this.enable():this.disable()):this.isEnabled()?this.disable():this.enable(),this}isMultipleSelection(){return this.isMultiple()}enableMultipleSelection(){return this.enableMultiple(),this}disableMultipleSelection(){return this.disableMultiple(),this}toggleMultipleSelection(e){return null!=e?e!==this.isMultipleSelection()&&(e?this.enableMultipleSelection():this.disableMultipleSelection()):this.isMultipleSelection()?this.disableMultipleSelection():this.enableMultipleSelection(),this}isSelectionMovable(){return!1!==this.options.movable}enableSelectionMovable(){return this.selectionImpl.options.movable=!0,this}disableSelectionMovable(){return this.selectionImpl.options.movable=!1,this}toggleSelectionMovable(e){return null!=e?e!==this.isSelectionMovable()&&(e?this.enableSelectionMovable():this.disableSelectionMovable()):this.isSelectionMovable()?this.disableSelectionMovable():this.enableSelectionMovable(),this}isRubberbandEnabled(){return!this.rubberbandDisabled}enableRubberband(){return this.rubberbandDisabled&&(this.options.rubberband=!0),this}disableRubberband(){return this.rubberbandDisabled||(this.options.rubberband=!1),this}toggleRubberband(e){return null!=e?e!==this.isRubberbandEnabled()&&(e?this.enableRubberband():this.disableRubberband()):this.isRubberbandEnabled()?this.disableRubberband():this.enableRubberband(),this}isStrictRubberband(){return!0===this.selectionImpl.options.strict}enableStrictRubberband(){return this.selectionImpl.options.strict=!0,this}disableStrictRubberband(){return this.selectionImpl.options.strict=!1,this}toggleStrictRubberband(e){return null!=e?e!==this.isStrictRubberband()&&(e?this.enableStrictRubberband():this.disableStrictRubberband()):this.isStrictRubberband()?this.disableStrictRubberband():this.enableStrictRubberband(),this}setRubberbandModifiers(e){this.setModifiers(e)}setSelectionFilter(e){return this.setFilter(e),this}setSelectionDisplayContent(e){return this.setContent(e),this}isEmpty(){return this.length<=0}clean(e={}){return this.selectionImpl.clean(e),this}reset(e,t={}){return this.selectionImpl.reset(e?this.getCells(e):[],t),this}getSelectedCells(){return this.cells}getSelectedCellCount(){return this.length}isSelected(e){return this.selectionImpl.isSelected(e)}select(e,t={}){const n=this.getCells(e);return n.length&&(this.isMultiple()?this.selectionImpl.select(n,t):this.reset(n.slice(0,1),t)),this}unselect(e,t={}){return this.selectionImpl.unselect(this.getCells(e),t),this}setup(){this.selectionImpl.on("*",(e,t)=>{this.trigger(e,t),this.graph.trigger(e,t)})}startListening(){this.graph.on("blank:mousedown",this.onBlankMouseDown,this),this.graph.on("blank:click",this.onBlankClick,this),this.graph.on("cell:mousemove",this.onCellMouseMove,this),this.graph.on("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.on("box:mousedown",this.onBoxMouseDown,this)}stopListening(){this.graph.off("blank:mousedown",this.onBlankMouseDown,this),this.graph.off("blank:click",this.onBlankClick,this),this.graph.off("cell:mousemove",this.onCellMouseMove,this),this.graph.off("cell:mouseup",this.onCellMouseUp,this),this.selectionImpl.off("box:mousedown",this.onBoxMouseDown,this)}onBlankMouseDown({e:e}){if(!this.allowBlankMouseDown(e))return;const t=this.graph.panning.allowPanning(e,!0),n=this.graph.getPlugin("scroller"),r=n&&n.allowPanning(e,!0);(this.allowRubberband(e,!0)||this.allowRubberband(e)&&!r&&!t)&&this.startRubberband(e)}allowBlankMouseDown(e){const t=this.options.eventTypes;return(null==t?void 0:t.includes("leftMouseDown"))&&0===e.button||(null==t?void 0:t.includes("mouseWheelDown"))&&1===e.button}onBlankClick(){this.clean()}allowRubberband(e,t){return!this.rubberbandDisabled&&ModifierKey.isMatch(e,this.options.modifiers,t)}allowMultipleSelection(e){return this.isMultiple()&&ModifierKey.isMatch(e,this.options.multipleSelectionModifiers)}onCellMouseMove({cell:e}){this.movedMap.set(e,!0)}onCellMouseUp({e:e,cell:t}){const n=this.options;let r=this.disabled;!r&&this.movedMap.has(t)&&(r=!1===n.selectCellOnMoved,r||(r=!1===n.selectNodeOnMoved&&t.isNode()),r||(r=!1===n.selectEdgeOnMoved&&t.isEdge())),r||(this.allowMultipleSelection(e)?this.unselectMap.has(t)?this.unselectMap.delete(t):this.isSelected(t)?this.unselect(t):this.select(t):this.reset(t)),this.movedMap.delete(t)}onBoxMouseDown({e:e,cell:t}){this.disabled||this.allowMultipleSelection(e)&&(this.unselect(t),this.unselectMap.set(t,!0))}getCells(e){return(Array.isArray(e)?e:[e]).map(e=>"string"==typeof e?this.graph.getCellById(e):e).filter(e=>null!=e)}startRubberband(e){return this.rubberbandDisabled||this.selectionImpl.startSelecting(e),this}isMultiple(){return!1!==this.options.multiple}enableMultiple(){return this.options.multiple=!0,this}disableMultiple(){return this.options.multiple=!1,this}setModifiers(e){return this.options.modifiers=e,this}setContent(e){return this.selectionImpl.setContent(e),this}setFilter(e){return this.selectionImpl.setFilter(e),this}dispose(){this.stopListening(),this.off(),this.selectionImpl.dispose(),clean(this.name)}}__decorate$2([Basecoat.dispose()],Selection.prototype,"dispose",null),Selection2=Selection||(Selection={}),Selection2.defaultOptions={rubberband:!1,rubberNode:!0,rubberEdge:!1,pointerEvents:"auto",multiple:!0,multipleSelectionModifiers:["ctrl","meta"],movable:!0,strict:!1,selectCellOnMoved:!1,selectNodeOnMoved:!1,selectEdgeOnMoved:!1,following:!0,content:null,eventTypes:["leftMouseDown","mouseWheelDown"]};var __decorate$1=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a},__rest=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n};class SnaplineImpl extends View{get model(){return this.graph.model}get containerClassName(){return this.prefixClassName("widget-snapline")}get verticalClassName(){return`${this.containerClassName}-vertical`}get horizontalClassName(){return`${this.containerClassName}-horizontal`}constructor(e){super();const{graph:t}=e,n=__rest(e,["graph"]);this.graph=t,this.options=Object.assign({},n),this.offset={x:0,y:0},this.render(),this.disabled||this.startListening()}get disabled(){return!0!==this.options.enabled}enable(){this.disabled&&(this.options.enabled=!0,this.startListening())}disable(){this.disabled||(this.options.enabled=!1,this.stopListening())}setFilter(e){this.options.filter=e}render(){const e=this.containerWrapper=new Vector("svg"),t=this.horizontal=new Vector("line"),n=this.vertical=new Vector("line");e.addClass(this.containerClassName),t.addClass(this.horizontalClassName),n.addClass(this.verticalClassName),e.setAttribute("width","100%"),e.setAttribute("height","100%"),t.setAttribute("display","none"),n.setAttribute("display","none"),e.append([t,n]),this.options.className&&e.addClass(this.options.className),this.container=this.containerWrapper.node}startListening(){this.stopListening(),this.graph.on("node:mousedown",this.captureCursorOffset,this),this.graph.on("node:mousemove",this.snapOnMoving,this),this.model.on("batch:stop",this.onBatchStop,this),this.delegateDocumentEvents({mouseup:"hide",touchend:"hide"})}stopListening(){this.graph.off("node:mousedown",this.captureCursorOffset,this),this.graph.off("node:mousemove",this.snapOnMoving,this),this.model.off("batch:stop",this.onBatchStop,this),this.undelegateDocumentEvents()}onBatchStop({name:e,data:t}){"resize"===e&&this.snapOnResizing(t.cell,t)}captureCursorOffset({view:e,x:t,y:n}){const r=e.getDelegatedView();if(r&&this.isNodeMovable(r)){const r=e.cell.getPosition();this.offset={x:t-r.x,y:n-r.y}}}isNodeMovable(e){return e&&e.cell.isNode()&&e.can("nodeMovable")}getRestrictArea(e){const t=this.graph.options.translating.restrict,n="function"==typeof t?call$1(t,this.graph,e):t;return"number"==typeof n?this.graph.transform.getGraphArea().inflate(n):!0===n?this.graph.transform.getGraphArea():n||null}snapOnResizing(e,t){if(this.options.resizing&&!t.snapped&&t.ui&&t.direction&&t.trueDirection){const n=this.graph.renderer.findViewByCell(e);if(n&&n.cell.isNode()){const r=e.getBBox(),o=r.bbox(e.getAngle()),i=o.getTopLeft(),a=o.getBottomRight(),s=Angle.normalize(e.getAngle()),l=this.options.tolerance||0;let c,u,d,p,f,h;const g={vertical:0,horizontal:0},m=t.direction,y=t.trueDirection,v=t.relativeDirection;-1!==y.indexOf("right")?g.vertical=a.x:g.vertical=i.x,-1!==y.indexOf("bottom")?g.horizontal=a.y:g.horizontal=i.y,this.model.getNodes().some(t=>{if(this.isIgnored(e,t))return!1;const n=t.getBBox().bbox(t.getAngle()),r=n.getTopLeft(),i=n.getBottomRight(),s={vertical:[r.x,i.x],horizontal:[r.y,i.y]},m={};return Object.keys(s).forEach(e=>{const t=e,n=s[t].map(e=>({position:e,distance:Math.abs(e-g[t])})).filter(e=>e.distance<=l);m[t]=sortBy(n,e=>e.distance)}),null==c&&m.vertical.length>0&&(c=m.vertical[0].position,u=Math.min(o.y,n.y),d=Math.max(a.y,i.y)-u),null==p&&m.horizontal.length>0&&(p=m.horizontal[0].position,f=Math.min(o.x,n.x),h=Math.max(a.x,i.x)-f),null!=c&&null!=p}),this.hide();let b=0,_=0;null==p&&null==c||(null!=c&&(b=-1!==y.indexOf("right")?c-a.x:i.x-c),null!=p&&(_=-1!==y.indexOf("bottom")?p-a.y:i.y-p));let E=0,S=0;if(s%90==0)90===s||270===s?(E=_,S=b):(E=b,S=_);else{const e=s>=0&&s<90?1:s>=90&&s<180?4:s>=180&&s<270?3:2;null!=p&&null!=c&&(b<_?(_=0,p=void 0):(b=0,c=void 0));const t=Angle.toRad(s%90);b&&(E=3===e?b/Math.cos(t):b/Math.sin(t)),_&&(S=3===e?_/Math.cos(t):_/Math.sin(t));const n=1===e||3===e;switch(v){case"top":case"bottom":S=_?_/(n?Math.cos(t):Math.sin(t)):b/(n?Math.sin(t):Math.cos(t));break;case"left":case"right":E=b?b/(n?Math.cos(t):Math.sin(t)):_/(n?Math.sin(t):Math.cos(t))}}switch(v){case"top":case"bottom":E=0;break;case"left":case"right":S=0}const x=this.graph.getGridSize();let w=Math.max(r.width+E,x),C=Math.max(r.height+S,x);t.minWidth&&t.minWidth>x&&(w=Math.max(w,t.minWidth)),t.minHeight&&t.minHeight>x&&(C=Math.max(C,t.minHeight)),t.maxWidth&&(w=Math.min(w,t.maxWidth)),t.maxHeight&&(C=Math.min(C,t.maxHeight)),t.preserveAspectRatio&&(S<E?C=w*(r.height/r.width):w=C*(r.width/r.height)),w===r.width&&C===r.height||(e.resize(w,C,{direction:m,relativeDirection:v,trueDirection:y,snapped:!0,snaplines:this.cid,restrict:this.getRestrictArea(n)}),d&&(d+=C-r.height),h&&(h+=w-r.width));const R=e.getBBox().bbox(s);c&&Math.abs(R.x-c)>1&&Math.abs(R.width+R.x-c)>1&&(c=void 0),p&&Math.abs(R.y-p)>1&&Math.abs(R.height+R.y-p)>1&&(p=void 0),this.update({verticalLeft:c,verticalTop:u,verticalHeight:d,horizontalTop:p,horizontalLeft:f,horizontalWidth:h})}}}snapOnMoving({view:e,e:t,x:n,y:r}){const o=e.getEventData(t).delegatedView||e;if(!this.isNodeMovable(o))return;const i=o.cell,a=i.getSize(),s=i.getPosition(),l=new Rectangle(n-this.offset.x,r-this.offset.y,a.width,a.height),c=i.getAngle(),u=l.getCenter(),d=l.bbox(c),p=d.getTopLeft(),f=d.getBottomRight(),h=this.options.tolerance||0;let g,m,y,v,b,_,E=0,S=0;if(this.model.getNodes().some(e=>{if(this.isIgnored(i,e))return!1;const t=e.getBBox().bbox(e.getAngle()),n=t.getCenter(),r=t.getTopLeft(),o=t.getBottomRight();return null==g&&(Math.abs(n.x-u.x)<h?(g=n.x,E=.5):Math.abs(r.x-p.x)<h?(g=r.x,E=0):Math.abs(r.x-f.x)<h?(g=r.x,E=1):Math.abs(o.x-f.x)<h?(g=o.x,E=1):Math.abs(o.x-p.x)<h&&(g=o.x),null!=g&&(m=Math.min(d.y,t.y),y=Math.max(f.y,o.y)-m)),null==v&&(Math.abs(n.y-u.y)<h?(v=n.y,S=.5):Math.abs(r.y-p.y)<h?v=r.y:Math.abs(r.y-f.y)<h?(v=r.y,S=1):Math.abs(o.y-f.y)<h?(v=o.y,S=1):Math.abs(o.y-p.y)<h&&(v=o.y),null!=v&&(b=Math.min(d.x,t.x),_=Math.max(f.x,o.x)-b)),null!=g&&null!=v}),this.hide(),null!=v||null!=g){null!=v&&(d.y=v-S*d.height),null!=g&&(d.x=g-E*d.width);const e=d.getCenter(),t=e.x-l.width/2,n=e.y-l.height/2,r=t-s.x,a=n-s.y;0===r&&0===a||(i.translate(r,a,{snapped:!0,restrict:this.getRestrictArea(o)}),_&&(_+=r),y&&(y+=a)),this.update({verticalLeft:g,verticalTop:m,verticalHeight:y,horizontalTop:v,horizontalLeft:b,horizontalWidth:_})}}isIgnored(e,t){return t.id===e.id||t.isDescendantOf(e)||!this.filter(t)}filter(e){const t=this.options.filter;return Array.isArray(t)?t.some(t=>"string"==typeof t?e.shape===t:e.id===t.id):"function"!=typeof t||call$1(t,this.graph,e)}update(e){if(e.horizontalTop){const t=this.graph.localToGraph(new Point(e.horizontalLeft,e.horizontalTop)),n=this.graph.localToGraph(new Point(e.horizontalLeft+e.horizontalWidth,e.horizontalTop));this.horizontal.setAttributes({x1:this.options.sharp?`${t.x}`:"0",y1:`${t.y}`,x2:this.options.sharp?`${n.x}`:"100%",y2:`${n.y}`,display:"inherit"})}else this.horizontal.setAttribute("display","none");if(e.verticalLeft){const t=this.graph.localToGraph(new Point(e.verticalLeft,e.verticalTop)),n=this.graph.localToGraph(new Point(e.verticalLeft,e.verticalTop+e.verticalHeight));this.vertical.setAttributes({x1:`${t.x}`,y1:this.options.sharp?`${t.y}`:"0",x2:`${n.x}`,y2:this.options.sharp?`${n.y}`:"100%",display:"inherit"})}else this.vertical.setAttribute("display","none");this.show()}resetTimer(){this.timer&&(clearTimeout(this.timer),this.timer=null)}show(){return this.resetTimer(),null==this.container.parentNode&&this.graph.container.appendChild(this.container),this}hide(){this.resetTimer(),this.vertical.setAttribute("display","none"),this.horizontal.setAttribute("display","none");const e=this.options.clean,t="number"==typeof e?e:!1!==e?3e3:0;return t>0&&(this.timer=window.setTimeout(()=>{null!==this.container.parentNode&&this.unmount()},t)),this}onRemove(){this.stopListening(),this.hide()}dispose(){this.remove()}}__decorate$1([View.dispose()],SnaplineImpl.prototype,"dispose",null);const content$1=".x6-widget-snapline {\n position: absolute;\n top: 0;\n right: 0;\n bottom: 0;\n left: 0;\n pointer-events: none;\n}\n.x6-widget-snapline-vertical,\n.x6-widget-snapline-horizontal {\n stroke: #2ecc71;\n stroke-width: 1px;\n}\n";Graph.prototype.isSnaplineEnabled=function(){const e=this.getPlugin("snapline");return!!e&&e.isEnabled()},Graph.prototype.enableSnapline=function(){const e=this.getPlugin("snapline");return e&&e.enable(),this},Graph.prototype.disableSnapline=function(){const e=this.getPlugin("snapline");return e&&e.disable(),this},Graph.prototype.toggleSnapline=function(){const e=this.getPlugin("snapline");return e&&e.toggleEnabled(),this},Graph.prototype.hideSnapline=function(){const e=this.getPlugin("snapline");return e&&e.hide(),this},Graph.prototype.setSnaplineFilter=function(e){const t=this.getPlugin("snapline");return t&&t.setFilter(e),this},Graph.prototype.isSnaplineOnResizingEnabled=function(){const e=this.getPlugin("snapline");return!!e&&e.isOnResizingEnabled()},Graph.prototype.enableSnaplineOnResizing=function(){const e=this.getPlugin("snapline");return e&&e.enableOnResizing(),this},Graph.prototype.disableSnaplineOnResizing=function(){const e=this.getPlugin("snapline");return e&&e.disableOnResizing(),this},Graph.prototype.toggleSnaplineOnResizing=function(e){const t=this.getPlugin("snapline");return t&&t.toggleOnResizing(e),this},Graph.prototype.isSharpSnapline=function(){const e=this.getPlugin("snapline");return!!e&&e.isSharp()},Graph.prototype.enableSharpSnapline=function(){const e=this.getPlugin("snapline");return e&&e.enableSharp(),this},Graph.prototype.disableSharpSnapline=function(){const e=this.getPlugin("snapline");return e&&e.disableSharp(),this},Graph.prototype.toggleSharpSnapline=function(e){const t=this.getPlugin("snapline");return t&&t.toggleSharp(e),this},Graph.prototype.getSnaplineTolerance=function(){const e=this.getPlugin("snapline");if(e)return e.getTolerance()},Graph.prototype.setSnaplineTolerance=function(e){const t=this.getPlugin("snapline");return t&&t.setTolerance(e),this};var __decorate=function(e,t,n,r){var o,i=arguments.length,a=i<3?t:null===r?r=Object.getOwnPropertyDescriptor(t,n):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)a=Reflect.decorate(e,t,n,r);else for(var s=e.length-1;s>=0;s--)(o=e[s])&&(a=(i<3?o(a):i>3?o(t,n,a):o(t,n))||a);return i>3&&a&&Object.defineProperty(t,n,a),a};class Snapline extends Disposable{constructor(e={}){super(),this.name="snapline",this.options=Object.assign({enabled:!0,tolerance:10},e),ensure(this.name,content$1)}init(e){this.snaplineImpl=new SnaplineImpl(Object.assign(Object.assign({},this.options),{graph:e}))}isEnabled(){return!this.snaplineImpl.disabled}enable(){this.snaplineImpl.enable()}disable(){this.snaplineImpl.disable()}toggleEnabled(e){if(null==e)return this.isEnabled()?this.disable():this.enable(),this;e!==this.isEnabled()&&(e?this.enable():this.disable())}hide(){return this.snaplineImpl.hide(),this}setFilter(e){return this.snaplineImpl.setFilter(e),this}isOnResizingEnabled(){return!0===this.snaplineImpl.options.resizing}enableOnResizing(){return this.snaplineImpl.options.resizing=!0,this}disableOnResizing(){return this.snaplineImpl.options.resizing=!1,this}toggleOnResizing(e){return null!=e?e!==this.isOnResizingEnabled()&&(e?this.enableOnResizing():this.disableOnResizing()):this.isOnResizingEnabled()?this.disableOnResizing():this.enableOnResizing(),this}isSharp(){return!0===this.snaplineImpl.options.sharp}enableSharp(){return this.snaplineImpl.options.sharp=!0,this}disableSharp(){return this.snaplineImpl.options.sharp=!1,this}toggleSharp(e){return null!=e?e!==this.isSharp()&&(e?this.enableSharp():this.disableSharp()):this.isSharp()?this.disableSharp():this.enableSharp(),this}getTolerance(){return this.snaplineImpl.options.tolerance}setTolerance(e){return this.snaplineImpl.options.tolerance=e,this}captureCursorOffset(e){this.snaplineImpl.captureCursorOffset(e)}snapOnMoving(e){this.snaplineImpl.snapOnMoving(e)}dispose(){this.snaplineImpl.dispose(),clean(this.name)}}__decorate([Disposable.dispose()],Snapline.prototype,"dispose",null);let nanoid=(e=21)=>crypto.getRandomValues(new Uint8Array(e)).reduce((e,t)=>e+=(t&=63)<36?t.toString(36):t<62?(t-26).toString(36).toUpperCase():t>62?"-":"_","");const CellPanel=e=>{var t,n,r,o,i,a,s,l,c,u,d;const{cell:p,graph:f}=e,[h,g]=React.useState(p.prop());React.useEffect(()=>{},[h]),React.useEffect(()=>{g(p.prop());const e=e=>{const t={...e.cell.prop()};g(t)};return p.on("changed",e),()=>{p.off("changed",e)}},[p]);const m=(e,t)=>{p.prop(e,t)};let y=0,v=0;"edge"===h.shape&&([y,v]=calculateDistanceAndAngle([h.source.x,h.source.y],[h.target.x,h.target.y]));let b="";b="edge"===h.shape?(null==(o=null==(r=null==(n=null==(t=h.labels)?void 0:t[0])?void 0:n.attrs)?void 0:r.label)?void 0:o.text)||"":(null==(a=null==(i=h.attrs)?void 0:i.text)?void 0:a.text)||"";let _=0;return _="edge"===h.shape?(null==(u=null==(c=null==(l=null==(s=h.labels)?void 0:s[0])?void 0:l.attrs)?void 0:c.text)?void 0:u.fontSize)||14:null==(d=h.attrs)?void 0:d.text.fontSize,jsxRuntimeExports.jsxs("div",{className:"cell-panel",children:[jsxRuntimeExports.jsx(PanelOne,{title:"大小"}),"rect"===h.shape||"text"===h.shape?jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsxs(Space,{size:20,children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"宽"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:h.size.width,onChange:e=>{m("size/width",e)}})]}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"高"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:h.size.height,onChange:e=>{m("size/height",e)}})]})]})}):"circle"===h.shape?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"半径"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},value:h.size.width,min:0,onChange:e=>{m("size",{width:e,height:e})}})]}):"edge"===h.shape?jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(PanelTwo,{title:"长"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},value:y,min:0,onChange:e=>{const[t,n]=calculateEndPoint([h.source.x,h.source.y],v,e);m("target",{x:t,y:n})}})]}):jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{}),jsxRuntimeExports.jsx(PanelOne,{title:"旋转"}),jsxRuntimeExports.jsx(PanelTwo,{title:"角度"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"24px"},min:0,max:360,value:"edge"===h.shape?v:h.angle,onChange:e=>{if("edge"===h.shape){const[t,n]=calculateEndPoint([h.source.x,h.source.y],e,y);return void m("target",{x:t,y:n})}m("angle",e)}}),jsxRuntimeExports.jsx(PanelOne,{title:"文本"}),jsxRuntimeExports.jsx(PanelTwo,{title:"内容"}),jsxRuntimeExports.jsx(Input.TextArea,{style:{resize:"none",height:"100px",marginBottom:"16px",background:"#f7f8fa"},value:b,onChange:e=>{const t=e.target.value;"edge"!==h.shape?m("attrs/text/text",t):h.labels?p.setLabelAt(0,t):p.appendLabel({attrs:{text:{text:t}}})}}),jsxRuntimeExports.jsx(PanelTwo,{title:"字号"}),jsxRuntimeExports.jsx(TypedInputNumber,{style:{marginBottom:"16px"},value:_,min:0,onChange:e=>{"edge"!==h.shape||null==e?m("attrs/text/fontSize",e):h.labels?p.setLabelAt(0,{attrs:{label:{text:b},text:{fontSize:e}}}):p.appendLabel({attrs:{label:{text:b},text:{fontSize:e}}})}})]})},PanelOne=e=>{const{title:t}=e;return jsxRuntimeExports.jsx("div",{className:"cell-panel-one",children:t})},PanelTwo=e=>{const{title:t}=e;return jsxRuntimeExports.jsx("div",{className:"cell-panel-two",children:t})};function calculateDistanceAndAngle(e,t){const[n,r]=e,[o,i]=t,a=Math.sqrt(Math.pow(o-n,2)+Math.pow(i-r,2));let s=Math.atan2(i-r,o-n)*(180/Math.PI);s<0&&(s+=360);return[Math.floor(a),Math.floor(s)]}function calculateEndPoint(e,t,n){const[r,o]=e,i=t*(Math.PI/180),a=r+n*Math.cos(i),s=o+n*Math.sin(i);return[Math.round(a),Math.round(s)]}const{Text:Text}=Typography,KeyBordModal=e=>{const{children:t}=e;return jsxRuntimeExports.jsx(Popover,{arrow:!1,trigger:"click",rootClassName:"drawx6-keybordermodal-pop",content:jsxRuntimeExports.jsx("div",{className:"drawx6-keybordermodal-pop-content",children:jsxRuntimeExports.jsx(List,{bordered:!1,dataSource:[{key:["Ctrl","C"],desc:"拷贝"},{key:["Ctrl","V"],desc:"粘贴"},{key:["Ctrl","X"],desc:"剪切"},{key:["Ctrl","Z"],desc:"撤销"},{key:["Ctrl","Shift","Z"],desc:"重做"},{key:["BackSpace"],desc:"删除"},{key:["Ctrl","鼠标拖动"],desc:"平移"},{key:["Ctrl","鼠标滚轮"],desc:"缩放"}],renderItem:(e,t)=>jsxRuntimeExports.jsx(List.Item,{children:jsxRuntimeExports.jsxs(Space,{style:{display:"flex",justifyContent:"space-between",width:"100%"},children:[jsxRuntimeExports.jsx(Space,{size:6,children:e.key.map((e,t,n)=>jsxRuntimeExports.jsxs(React.Fragment,{children:[jsxRuntimeExports.jsx(Tag,{style:{marginRight:0},children:e}),t<n.length-1&&"+"]},t))}),jsxRuntimeExports.jsx(Text,{strong:!0,children:e.desc})]})},t)})}),children:t})},content=".x6-widget-edgednd {\n position: absolute;\n top: -10000px;\n left: -10000px;\n z-index: 999999;\n display: none;\n cursor: move;\n opacity: 0.7;\n pointer-events: 'cursor';\n }\n .x6-widget-edgednd.dragging {\n display: inline-block;\n }\n .x6-widget-edgednd.dragging * {\n pointer-events: none !important;\n }\n .x6-widget-edgednd .x6-graph {\n background: transparent;\n box-shadow: none;\n }\n ",_EdgeDnd=class e extends View{constructor(e){super(),__publicField(this,"name","edgednd"),__publicField(this,"options"),__publicField(this,"draggingGraph"),__publicField(this,"sourceEdge"),__publicField(this,"draggingEdge"),__publicField(this,"length",0),__publicField(this,"draggingBBox"),__publicField(this,"geometryBBox"),__publicField(this,"draggingView"),__publicField(this,"delta"),__publicField(this,"padding"),__publicField(this,"snapOffset"),__publicField(this,"originOffset"),this.options={...e,getDragEdge:e=>e.clone(),getDropEdge:e=>e.clone()},this.init()}get targetGraph(){return this.options.target}get targetModel(){return this.targetGraph.model}init(){ensure(this.name,content),this.container=document.createElement("div"),addClass(this.container,this.prefixClassName("widget-edgednd")),this.draggingGraph=new Graph({...this.options.delegateGraphOptions,container:document.createElement("div"),width:1,height:1,async:!1}),append(this.container,this.draggingGraph.container)}start(t,n,r){const o=r;o.preventDefault(),this.length=n,this.targetModel.startBatch("edgednd"),addClass(this.container,"dragging"),appendTo(this.container,this.options.draggingContainer||document.body),this.sourceEdge=t,this.prepareDragging(t,o.clientX,o.clientY),this.updateNodePosition(o.clientX,o.clientY),this.delegateDocumentEvents(e.documentEvents,o.data)}prepareDragging(e,t,n){const r=this.draggingGraph,o=r.model,i=this.options.getDragEdge(e);i.setSource({x:0,y:0}),i.setTarget({x:0+this.length,y:0});r.scale(1,1),this.clearDragging(),o.resetCells([i]);const a=r.findViewByCell(i);a.undelegateEvents(),a.cell.off("changed"),r.fitToContent({padding:5,allowNewOrigin:"any",useCellGeometry:!1});const s=a.getBBox();this.geometryBBox=a.getBBox({useCellGeometry:!0}),this.delta=this.geometryBBox.getTopLeft().diff(s.getTopLeft()),this.draggingEdge=i,this.draggingView=a,this.draggingBBox=i.getBBox(),this.padding=5,this.originOffset=this.updateGraphPosition(t,n)}clearDragging(){this.draggingEdge&&(this.sourceEdge=null,this.draggingEdge.remove(),this.draggingEdge=null,this.draggingView=null,this.delta=null,this.padding=null,this.snapOffset=null,this.originOffset=null,this.undelegateDocumentEvents())}updateGraphPosition(e,t){const n=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft,o=this.delta,i=this.geometryBBox,a=this.padding||5,s={left:e-o.x-i.width/2-a+r,top:t-o.y-i.height/2-a+n};return this.draggingGraph&&css(this.container,{left:`${s.left}px`,top:`${s.top}px`}),s}updateNodePosition(e,t){const n=this.targetGraph.clientToLocal(e,t),r=this.draggingBBox;return n.x-=r.width/2,n.y-=r.height/2,this.draggingEdge.setSource({x:n.x,y:n.y}),this.draggingEdge.setTarget({x:n.x+this.length,y:n.y}),n}onDragging(e){if(this.draggingView){e.preventDefault();const t=this.normalizeEvent(e),n=t.clientX,r=t.clientY;this.updateGraphPosition(n,r),this.updateNodePosition(n,r)}}onDragEnd(e){const t=this.draggingEdge;if(t){const n=this.normalizeEvent(e);this.draggingView;const r=this.draggingBBox,o=this.snapOffset;let i=r.x,a=r.y;o&&(i+=o.x,a+=o.y),t.setSource({x:i,y:a}),t.setTarget({x:i+this.length,y:a});(e=>{e?this.onDropped(e):this.onDropInvalid(),this.targetModel.stopBatch("edgednd")})(this.drop(t,{x:n.clientX,y:n.clientY}))}}drop(e,t){if(this.isInsideValidArea(t)){const n=this.targetGraph,r=n.model,o=n.clientToLocal(t),i=this.options.getDropEdge(e),a=i.getBBox();o.x+=a.x-a.width/2,o.y+=a.y-a.height/2;const s=this.snapOffset?1:n.getGridSize(),l=GeometryUtil.snapToGrid(o.x,s),c=GeometryUtil.snapToGrid(o.y,s);return i.setSource({x:l,y:c}),i.setTarget({x:l+this.length,y:c}),i.removeZIndex(),r.addCell(i,{stencil:this.cid}),i}return null}isInsideValidArea(e){let t;const n=this.targetGraph;return t=this.getDropArea(n.container),t&&t.containsPoint(e)}getDropArea(e){const t=offset$1(e),n=document.body.scrollTop||document.documentElement.scrollTop,r=document.body.scrollLeft||document.documentElement.scrollLeft;return Rectangle.create({x:t.left+parseInt(css(e,"border-left-width"),10)-r,y:t.top+parseInt(css(e,"border-top-width"),10)-n,width:e.clientWidth,height:e.clientHeight})}onDropInvalid(){const e=this.draggingEdge;e&&this.onDropped(e)}onDropped(e){this.clearDragging(),removeClass(this.container,"dragging"),remove(this.container)}onRemove(){this.draggingGraph&&(this.draggingGraph.view.remove(),this.draggingGraph.dispose())}dispose(){this.remove(),clean(this.name)}};__publicField(_EdgeDnd,"documentEvents",{mousemove:"onDragging",touchmove:"onDragging",mouseup:"onDragEnd",touchend:"onDragEnd",touchcancel:"onDragEnd"});let EdgeDnd=_EdgeDnd;const activeColor="#1677ff",normalColor="#999999",ports={groups:{top:{position:"top",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},right:{position:"right",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},bottom:{position:"bottom",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}},left:{position:"left",attrs:{circle:{magnet:!0,stroke:normalColor,r:5,style:{visibility:"hidden"}}}}},items:[{group:"top"},{group:"right"},{group:"bottom"},{group:"left"}]},Editor=React.forwardRef((e,t)=>{const{value:n,onSave:r,onExit:o,savePngType:i="url",editabled:a=!0,showSaveBtn:s=!0}=e,{topProps:l}=useQuestionContext(),{uploadImg:c}=l,u=React.useRef(null),d=React.useRef(null),p=React.useRef(null),f=React.useRef(null),[h,g]=React.useState(!1),[m,y]=React.useState(null),[v,b]=React.useState(!1);React.useEffect(()=>(u.current&&_(u.current),()=>{var e;null==(e=d.current)||e.dispose()}),[]),React.useEffect(()=>{var e;(null==n?void 0:n.cells)&&(null==(e=d.current)||e.fromJSON(n.cells))},[n]);const _=e=>{d.current=new Graph({container:e,autoResize:!0,background:{color:"#ffffff"},grid:{visible:!0,size:10,type:"dot",args:{color:"#a0a0a0",thickness:1}},panning:{enabled:!0,modifiers:["ctrl","meta"]},mousewheel:{enabled:!0,zoomAtMousePosition:!0,modifiers:["ctrl","meta"],minScale:.5,maxScale:3},interacting:a,connecting:{createEdge:()=>new Edge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},tools:["edge-editor"]})},highlighting:{magnetAdsorbed:{name:"stroke",args:{attrs:{"stroke-width":1,stroke:activeColor}}}}}),S(d.current),E(d.current),x(d.current),w(d.current)},E=e=>{e.use(new Export),e.use(new Transform({resizing:{enabled:!0,preserveAspectRatio:e=>"circle"===e.shape},rotating:!0})),e.use(new Selection({rubberband:!0,showNodeSelectionBox:!0})),e.use(new Snapline({className:"x6-snapline-color"})),e.use(new Keyboard),e.use(new Clipboard),e.use(new History)},S=e=>{p.current=new Dnd({target:e}),f.current=new EdgeDnd({target:e})},x=e=>{const t=(e,t)=>{for(let n=0,r=e.length;n<r;n+=1)e[n].style.visibility=t?"visible":"hidden"};e.on("node:mouseenter",({e:e,node:n,view:r})=>{const o=u.current.querySelectorAll(".x6-port-body");t(o,!0)}),e.on("node:mouseleave",({e:e,node:n,view:r})=>{const o=u.current.querySelectorAll(".x6-port-body");t(o,!1)}),e.on("cell:click",({e:e,x:t,y:n,cell:r,view:o})=>{"edge"!==r.shape&&(g(!0),y(r))}),e.on("blank:click",({e:e,x:t,y:n})=>{g(!1),y(null)})},w=e=>{e.bindKey(["meta+c","ctrl+c"],()=>{const t=e.getSelectedCells();return t.length&&e.copy(t,{deep:!0}),!1}),e.bindKey(["meta+x","ctrl+x"],()=>{const t=e.getSelectedCells();return t.length&&e.cut(t,{deep:!0}),!1}),e.bindKey(["meta+v","ctrl+v"],()=>{if(!e.isClipboardEmpty()){const t=e.paste({offset:32});e.cleanSelection(),e.select(t)}return!1}),e.bindKey(["meta+z","ctrl+z"],()=>(e.canUndo()&&e.undo(),!1)),e.bindKey(["meta+shift+z","ctrl+shift+z"],()=>(e.canRedo()&&e.redo(),!1)),e.bindKey("backspace",()=>{const t=e.getSelectedCells();t.length&&e.removeCells(t)})},C=e=>{let t=null;switch(e.currentTarget.getAttribute("data-type")){case"rect":t=d.current.createNode({width:80,height:40,shape:"rect",label:"矩形",attrs:{body:{stroke:normalColor,strokeWidth:1,fill:"#fff"}},ports:{...ports},tools:["node-editor"]});break;case"circle":t=d.current.createNode({width:60,height:60,shape:"circle",label:"圆形",attrs:{body:{stroke:normalColor,strokeWidth:1,fill:"#fff"}},ports:{...ports},tools:["node-editor"]});break;case"text":t=d.current.createNode({width:80,height:40,shape:"text",tools:["node-editor"]});break;case"hori-line":t=d.current.createEdge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:null,sourceMarker:null}},tools:[{name:"edge-editor",args:{labelAddable:!0}},{name:"source-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}},{name:"target-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}}]});break;case"arrow":t=d.current.createEdge({attrs:{line:{stroke:"#333333",strokeWidth:2,targetMarker:{name:"block",width:12,height:8}}},tools:["edge-editor",{name:"source-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}},{name:"target-arrowhead",args:{attrs:{fill:"transparent",stroke:"transparent"}}}]})}t&&(t.isNode()?p.current.start(t,e.nativeEvent):f.current.start(t,100,e.nativeEvent))},R=async()=>new Promise(e=>{var t,n;const r=null==(t=d.current)?void 0:t.toJSON();null==(n=d.current)||n.toPNG(t=>{e({json:r,png:t})},{padding:20,copyStyles:!1})}),T=async(e=!1)=>{if(e){b(!0);const e=await R();if("url"===i){const t=k(e.png),n=new FormData;n.append("file",t);const r=await(null==c?void 0:c({file:n}).catch(()=>{}));(null==r?void 0:r.url)&&(e.png=r.url)}null==r||r(e),b(!1)}null==o||o()},k=e=>{const t=e.replace(/^data:image\/png;base64,/,""),n=atob(t),r=n.length,o=new ArrayBuffer(r),i=new Uint8Array(o);for(let l=0;l<r;l++)i[l]=n.charCodeAt(l);const a=new Blob([o],{type:"image/png"}),s=`${nanoid()}.png`;return new File([a],s,{type:"image/png"})};return React.useImperativeHandle(t,()=>({getGraphInstance:()=>d.current,getData:async()=>{const e=await R();if("url"===i){const t=k(e.png),n=new FormData;n.append("file",t);const r=await(null==c?void 0:c({file:n}).catch(()=>{}));(null==r?void 0:r.url)&&(e.png=r.url)}return e}})),jsxRuntimeExports.jsxs("div",{className:classNames("drawx6","drawx6-editor"),children:[jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-header drawx6-space",children:[jsxRuntimeExports.jsx("div",{children:"画板"}),jsxRuntimeExports.jsxs(Space,{size:10,children:[jsxRuntimeExports.jsx(Button$1,{ghost:!0,type:"primary",onClick:()=>T(!1),children:"仅退出"}),s&&jsxRuntimeExports.jsx(Button$1,{loading:v,type:"primary",onClick:()=>T(!0),children:"保存并退出"})]})]}),jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-container",children:[jsxRuntimeExports.jsx("div",{style:{width:"100%",height:"100%"},children:jsxRuntimeExports.jsx("div",{ref:u,className:"drawx6-container"})}),jsxRuntimeExports.jsxs("div",{className:"drawx6-editor-container-nav drawx6-overflow-y",children:[jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"rect",onMouseDown:C,children:[jsxRuntimeExports.jsx("div",{className:"graph-rect"}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"矩形"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"circle",onMouseDown:C,children:[jsxRuntimeExports.jsx("div",{className:"graph-circle"}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"圆形"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"text",onMouseDown:C,children:[jsxRuntimeExports.jsx(TextSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"文本"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"hori-line",onMouseDown:C,children:[jsxRuntimeExports.jsx(LineSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"水平线"})]}),jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space","data-type":"arrow",onMouseDown:C,children:[jsxRuntimeExports.jsx(ArrawSvg,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"箭头"})]}),jsxRuntimeExports.jsx(KeyBordModal,{children:jsxRuntimeExports.jsxs("div",{className:"nav-item drawx6-space",style:{cursor:"default"},children:[jsxRuntimeExports.jsx(KeyBoard,{}),jsxRuntimeExports.jsx("span",{className:"nav-item-title",children:"快捷键"})]})})]}),jsxRuntimeExports.jsx(Popconfirm,{title:null,description:jsxRuntimeExports.jsxs("div",{style:{marginTop:"-4px"},children:["确认清空画板?清空后无法恢复,",jsxRuntimeExports.jsx("br",{}),"请谨慎操作。"]}),onConfirm:()=>{var e;null==(e=d.current)||e.clearCells()},placement:"bottomRight",arrow:!1,children:jsxRuntimeExports.jsx("div",{className:"drawx6-editor-container-clear drawx6-center",style:{right:h?"220px":"20px"},children:jsxRuntimeExports.jsx(ClearSvg,{})})}),h&&jsxRuntimeExports.jsx("div",{className:"drawx6-editor-container-control drawx6-overflow-y",children:jsxRuntimeExports.jsx(CellPanel,{cell:m,graph:d.current})})]})]})}),TextSvg=()=>jsxRuntimeExports.jsxs("svg",{width:"32",height:"32",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[jsxRuntimeExports.jsx("g",{clipPath:"url(#clip0_6137_1319)",children:jsxRuntimeExports.jsx("path",{d:"M13.5394 28.9231H12.3086C11.9394 28.9231 11.6932 29.1692 11.6932 29.5385C11.6932 29.9077 11.9394 30.1539 12.3086 30.1539H13.5394C13.9086 30.1539 14.1547 29.9077 14.1547 29.5385C14.1547 29.1692 13.9086 28.9231 13.5394 28.9231ZM6.15475 28.9231H4.92398C4.8009 28.9231 4.67782 28.9846 4.61629 29.0462V28.3077C4.61629 27.8154 4.18552 27.3846 3.69321 27.3846H1.23167C0.739363 27.3846 0.308594 27.8154 0.308594 28.3077V30.7692C0.308594 31.2615 0.739363 31.6923 1.23167 31.6923H3.69321C4.18552 31.6923 4.61629 31.2615 4.61629 30.7692V30.0308C4.67782 30.0923 4.8009 30.1539 4.92398 30.1539H6.15475C6.52398 30.1539 6.77013 29.9077 6.77013 29.5385C6.77013 29.1692 6.52398 28.9231 6.15475 28.9231ZM3.07782 6.15385C3.07782 5.78462 2.83167 5.53846 2.46244 5.53846C2.09321 5.53846 1.84706 5.78462 1.84706 6.15385V7.38462C1.84706 7.75385 2.09321 8 2.46244 8C2.83167 8 3.07783 7.75385 3.07782 7.38462V6.15385ZM9.84706 28.9231H8.61629C8.24706 28.9231 8.0009 29.1692 8.0009 29.5385C8.0009 29.9077 8.24706 30.1539 8.61629 30.1539H9.84706C10.2163 30.1539 10.4624 29.9077 10.4624 29.5385C10.4624 29.1692 10.2163 28.9231 9.84706 28.9231ZM7.38552 1.84616H6.15475C5.78552 1.84616 5.53936 2.09231 5.53936 2.46154C5.53936 2.83077 5.78552 3.07692 6.15475 3.07692H7.38552C7.75475 3.07692 8.0009 2.83077 8.0009 2.46154C8.0009 2.09231 7.75475 1.84616 7.38552 1.84616ZM3.07782 17.2308C3.07782 16.8615 2.83167 16.6154 2.46244 16.6154C2.09321 16.6154 1.84706 16.8615 1.84706 17.2308V18.4615C1.84706 18.8308 2.09321 19.0769 2.46244 19.0769C2.83167 19.0769 3.07783 18.8308 3.07782 18.4615V17.2308ZM3.07782 20.9231C3.07782 20.5539 2.83167 20.3077 2.46244 20.3077C2.09321 20.3077 1.84706 20.5539 1.84706 20.9231V22.1539C1.84706 22.5231 2.09321 22.7692 2.46244 22.7692C2.83167 22.7692 3.07783 22.5231 3.07782 22.1539V20.9231ZM3.07782 9.84616C3.07782 9.47693 2.83167 9.23077 2.46244 9.23077C2.09321 9.23077 1.84706 9.47693 1.84706 9.84616V11.0769C1.84706 11.4462 2.09321 11.6923 2.46244 11.6923C2.83167 11.6923 3.07783 11.4462 3.07782 11.0769V9.84616ZM13.5394 3.07692H14.7701C15.1394 3.07692 15.3855 2.83077 15.3855 2.46154C15.3855 2.09231 15.1394 1.84616 14.7701 1.84616H13.5394C13.1701 1.84616 12.924 2.09231 12.924 2.46154C12.924 2.83077 13.1701 3.07692 13.5394 3.07692ZM2.46244 24C2.09321 24 1.84706 24.2462 1.84706 24.6154V25.8462C1.84706 26.2154 2.09321 26.4615 2.46244 26.4615C2.83167 26.4615 3.07783 26.2154 3.07782 25.8462V24.6154C3.07782 24.2462 2.83167 24 2.46244 24ZM3.07782 13.5385C3.07782 13.1692 2.83167 12.9231 2.46244 12.9231C2.09321 12.9231 1.84706 13.1692 1.84706 13.5385V14.7692C1.84706 15.1385 2.09321 15.3846 2.46244 15.3846C2.83167 15.3846 3.07783 15.1385 3.07782 14.7692V13.5385ZM20.924 3.07692H22.1548C22.524 3.07692 22.7701 2.83077 22.7701 2.46154C22.7701 2.09231 22.524 1.84616 22.1548 1.84616H20.924C20.5548 1.84616 20.3086 2.09231 20.3086 2.46154C20.3086 2.83077 20.5548 3.07692 20.924 3.07692ZM28.924 20.9231C28.924 21.2923 29.1701 21.5385 29.5394 21.5385C29.9086 21.5385 30.1548 21.2923 30.1548 20.9231V19.6923C30.1548 19.3231 29.9086 19.0769 29.5394 19.0769C29.1701 19.0769 28.924 19.3231 28.924 19.6923V20.9231ZM29.5394 10.4615C29.9086 10.4615 30.1548 10.2154 30.1548 9.84616V8.61539C30.1548 8.24616 29.9086 8 29.5394 8C29.1701 8 28.924 8.24616 28.924 8.61539V9.84616C28.924 10.2154 29.1701 10.4615 29.5394 10.4615ZM28.924 17.2308C28.924 17.6 29.1701 17.8462 29.5394 17.8462C29.9086 17.8462 30.1548 17.6 30.1548 17.2308V16C30.1548 15.6308 29.9086 15.3846 29.5394 15.3846C29.1701 15.3846 28.924 15.6308 28.924 16V17.2308ZM28.924 24.6154C28.924 24.9846 29.1701 25.2308 29.5394 25.2308C29.9086 25.2308 30.1548 24.9846 30.1548 24.6154V23.3846C30.1548 23.0154 29.9086 22.7692 29.5394 22.7692C29.1701 22.7692 28.924 23.0154 28.924 23.3846V24.6154ZM9.84706 3.07692H11.0778C11.4471 3.07692 11.6932 2.83077 11.6932 2.46154C11.6932 2.09231 11.4471 1.84616 11.0778 1.84616H9.84706C9.47783 1.84616 9.23167 2.09231 9.23167 2.46154C9.23167 2.83077 9.47783 3.07692 9.84706 3.07692ZM17.2317 28.9231H16.0009C15.6317 28.9231 15.3855 29.1692 15.3855 29.5385C15.3855 29.9077 15.6317 30.1539 16.0009 30.1539H17.2317C17.6009 30.1539 17.8471 29.9077 17.8471 29.5385C17.8471 29.1692 17.6009 28.9231 17.2317 28.9231ZM20.924 28.9231H19.6932C19.324 28.9231 19.0778 29.1692 19.0778 29.5385C19.0778 29.9077 19.324 30.1539 19.6932 30.1539H20.924C21.2932 30.1539 21.5394 29.9077 21.5394 29.5385C21.5394 29.1692 21.2932 28.9231 20.924 28.9231ZM24.6163 28.9231H23.3855C23.0163 28.9231 22.7701 29.1692 22.7701 29.5385C22.7701 29.9077 23.0163 30.1539 23.3855 30.1539H24.6163C24.9855 30.1539 25.2317 29.9077 25.2317 29.5385C25.2317 29.1692 24.9855 28.9231 24.6163 28.9231ZM17.2317 3.07692H18.4624C18.8317 3.07692 19.0778 2.83077 19.0778 2.46154C19.0778 2.09231 18.8317 1.84616 18.4624 1.84616H17.2317C16.8624 1.84616 16.6163 2.09231 16.6163 2.46154C16.6163 2.83077 16.8624 3.07692 17.2317 3.07692ZM28.924 13.5385C28.924 13.9077 29.1701 14.1538 29.5394 14.1538C29.9086 14.1538 30.1548 13.9077 30.1548 13.5385V12.3077C30.1548 11.9385 29.9086 11.6923 29.5394 11.6923C29.1701 11.6923 28.924 11.9385 28.924 12.3077V13.5385ZM25.8471 1.84616H24.6163C24.2471 1.84616 24.0009 2.09231 24.0009 2.46154C24.0009 2.83077 24.2471 3.07692 24.6163 3.07692H25.8471C26.2163 3.07692 26.4624 2.83077 26.4624 2.46154C26.4624 2.09231 26.2163 1.84616 25.8471 1.84616ZM17.6624 24V10.7692H22.7701V8H9.23167V10.7692H14.4624V24H17.6624ZM1.23167 4.61539H3.69321C4.18552 4.61539 4.61629 4.18462 4.61629 3.69231V1.23077C4.61629 0.738463 4.18552 0.307693 3.69321 0.307693H1.23167C0.739363 0.307693 0.308594 0.738463 0.308594 1.23077V3.69231C0.308594 4.18462 0.739363 4.61539 1.23167 4.61539ZM30.7701 0.307693H28.3086C27.8163 0.307693 27.3855 0.738463 27.3855 1.23077V3.69231C27.3855 4.18462 27.8163 4.61539 28.3086 4.61539H29.0471C28.9855 4.67692 28.924 4.8 28.924 4.92308V6.15385C28.924 6.52308 29.1701 6.76923 29.5394 6.76923C29.9086 6.76923 30.1548 6.52308 30.1548 6.15385V4.92308C30.1548 4.8 30.0932 4.67692 30.0317 4.61539H30.7701C31.2624 4.61539 31.6932 4.18462 31.6932 3.69231V1.23077C31.6932 0.738463 31.2624 0.307693 30.7701 0.307693ZM30.7701 27.3846H30.1548V27.0769C30.1548 26.7077 29.9086 26.4615 29.5394 26.4615C29.1701 26.4615 28.924 26.7077 28.924 27.0769V27.3846H28.3086C27.8163 27.3846 27.3855 27.8154 27.3855 28.3077V28.9231H27.0778C26.7086 28.9231 26.4624 29.1692 26.4624 29.5385C26.4624 29.9077 26.7086 30.1539 27.0778 30.1539H27.3855V30.7692C27.3855 31.2615 27.8163 31.6923 28.3086 31.6923H30.7701C31.2624 31.6923 31.6932 31.2615 31.6932 30.7692V28.3077C31.6932 27.8154 31.2624 27.3846 30.7701 27.3846Z",fill:"#999999"})}),jsxRuntimeExports.jsx("defs",{children:jsxRuntimeExports.jsx("clipPath",{id:"clip0_6137_1319",children:jsxRuntimeExports.jsx("rect",{width:"32",height:"32",fill:"white"})})})]}),LineSvg=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M6.2069 18.6207V21.1034H0V14.8965H6.2069V17.3793H29.7931V14.8965H36V21.1034H29.7931V18.6207H6.2069Z",fill:"#999999"})}),ArrawSvg=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M35.1875 17.9118L25.1875 11.3857V17.2H0.8125V18.8H25.1875V24.6143L35.1875 17.9118Z",fill:"#999999"})}),ClearSvg=()=>jsxRuntimeExports.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M11.884 12.8993C11.884 13.3639 11.5054 13.7425 11.0408 13.7425H4.96411C4.74038 13.7425 4.52579 13.6537 4.3675 13.4956C4.2092 13.3375 4.12014 13.123 4.11988 12.8993V3.94589H11.884V12.8993ZM5.80735 2.43241C5.80735 2.33553 5.88248 2.25941 5.98035 2.25941H10.0344C10.1323 2.25941 10.2074 2.33553 10.2074 2.43241V2.94053H5.80735V2.43241ZM14.4138 2.94053H11.2128V2.43241C11.2128 1.78391 10.6839 1.25404 10.0344 1.25404H5.98035C5.66807 1.25483 5.3688 1.37923 5.14798 1.60004C4.92717 1.82086 4.80277 2.12013 4.80198 2.43241V2.94053H1.59015C1.45539 2.94053 1.32615 2.99406 1.23086 3.08935C1.13557 3.18464 1.08203 3.31389 1.08203 3.44865C1.08203 3.58341 1.13557 3.71265 1.23086 3.80794C1.32615 3.90323 1.45539 3.95677 1.59015 3.95677H3.10364V12.8993C3.10364 13.9264 3.93699 14.7578 4.96411 14.7578H11.0398C11.284 14.7579 11.5258 14.7099 11.7515 14.6166C11.9771 14.5233 12.1822 14.3864 12.3549 14.2139C12.5277 14.0413 12.6648 13.8364 12.7583 13.6108C12.8519 13.3853 12.9001 13.1435 12.9003 12.8993V3.94589H14.4128C14.6945 3.94589 14.9219 3.71852 14.9219 3.43777C14.9218 3.37159 14.9085 3.30609 14.8827 3.2451C14.857 3.18411 14.8194 3.12886 14.7721 3.08257C14.7248 3.03628 14.6688 2.99987 14.6072 2.97549C14.5457 2.9511 14.4799 2.93921 14.4138 2.94053ZM8.00195 12.2182C8.28271 12.2182 8.51007 11.9908 8.51007 11.71V6.30262C8.51007 6.16786 8.45654 6.03862 8.36125 5.94333C8.26596 5.84804 8.13672 5.7945 8.00195 5.7945C7.86719 5.7945 7.73795 5.84804 7.64266 5.94333C7.54737 6.03862 7.49383 6.16786 7.49383 6.30262V11.71C7.49383 11.9908 7.7212 12.2182 8.00195 12.2182ZM5.63435 12.2182C5.9151 12.2182 6.14247 11.9908 6.14247 11.71V6.30262C6.14247 6.16786 6.08894 6.03862 5.99365 5.94333C5.89836 5.84804 5.76911 5.7945 5.63435 5.7945C5.49959 5.7945 5.37035 5.84804 5.27506 5.94333C5.17977 6.03862 5.12623 6.16786 5.12623 6.30262V11.71C5.13612 11.9908 5.36349 12.2182 5.63435 12.2182ZM10.3696 12.2182C10.6513 12.2182 10.8787 11.9908 10.8787 11.71V6.30262C10.8787 6.23583 10.8655 6.16969 10.8399 6.10798C10.8144 6.04628 10.7769 5.99021 10.7297 5.94298C10.6825 5.89575 10.6264 5.85828 10.5647 5.83272C10.503 5.80716 10.4368 5.79401 10.3701 5.79401C10.3033 5.79401 10.2371 5.80716 10.1754 5.83272C10.1137 5.85828 10.0576 5.89575 10.0104 5.94298C9.96318 5.99021 9.92571 6.04628 9.90015 6.10798C9.87459 6.16969 9.86144 6.23583 9.86144 6.30262V11.71C9.86144 11.9908 10.0888 12.2182 10.3696 12.2182Z"})}),KeyBoard=()=>jsxRuntimeExports.jsx("svg",{width:"36",height:"36",viewBox:"0 0 36 36",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntimeExports.jsx("path",{d:"M9.83398 4.15039C11.3405 4.15201 12.7852 4.75035 13.8506 5.81543C14.9161 6.88062 15.5156 8.32539 15.5176 9.83203V13.4824H20.4844V9.83594L20.4922 9.55371C20.5632 8.14986 21.152 6.81818 22.1504 5.81934C23.2155 4.75392 24.6596 4.15448 26.166 4.15234C27.6725 4.15384 29.1171 4.75238 30.1826 5.81738C31.2482 6.88257 31.8476 8.32733 31.8496 9.83398L31.8428 10.1152C31.7718 11.5193 31.1832 12.8516 30.1846 13.8506C29.1194 14.9161 27.6746 15.5156 26.168 15.5176H22.5176V20.4844H26.168C27.6743 20.4864 29.1185 21.0862 30.1836 22.1514C31.182 23.1499 31.7714 24.4812 31.8428 25.8848L31.8496 26.167C31.8479 27.6732 31.2494 29.1173 30.1846 30.1826C29.1194 31.2482 27.6746 31.8476 26.168 31.8496L25.8867 31.8428C24.4827 31.7718 23.1503 31.1832 22.1514 30.1846C21.0858 29.1194 20.4864 27.6746 20.4844 26.168V22.5176H15.5176V26.168L15.5098 26.4502C15.4383 27.8537 14.849 29.1851 13.8506 30.1836C12.7855 31.2486 11.3412 31.8466 9.83496 31.8486C8.32824 31.8474 6.88316 31.2496 5.81738 30.1846C4.75165 29.1194 4.15238 27.6748 4.15039 26.168L4.15723 25.8867C4.22817 24.4827 4.81682 23.1503 5.81543 22.1514C6.81394 21.1525 8.14594 20.5637 9.5498 20.4922L9.83203 20.4844H13.4824V15.5176H9.83594L9.55371 15.5098C8.14943 15.4392 6.81665 14.8511 5.81738 13.8525C4.75158 12.7874 4.15253 11.3427 4.15039 9.83594C4.15139 8.32878 4.74997 6.88336 5.81543 5.81738C6.81442 4.81806 8.14719 4.22829 9.55176 4.15723L9.83398 4.15039ZM9.68555 22.5225C7.74117 22.6014 6.18669 24.2064 6.18652 26.168C6.18652 28.1818 7.82394 29.8193 9.83594 29.8193C11.8497 29.8191 13.4863 28.1817 13.4863 26.168V22.5176H9.68555V22.5225ZM22.5176 26.168C22.5176 28.1817 24.1542 29.8192 26.168 29.8193C28.182 29.8193 29.8174 28.1817 29.8174 26.168C29.8172 24.1543 28.1799 22.5176 26.168 22.5176H22.5176V26.168ZM15.5176 20.4844H20.4844V15.5195H15.5176V20.4844ZM9.83594 6.18652C7.82195 6.18652 6.18652 7.82412 6.18652 9.83789C6.18673 11.8497 7.82412 13.4863 9.83594 13.4863H13.4863V9.83594C13.4863 7.82405 11.8496 6.18671 9.83594 6.18652ZM26.168 6.18652C24.1543 6.18669 22.5176 7.82404 22.5176 9.83594V13.4863H26.168C28.1818 13.4863 29.8172 11.8495 29.8174 9.83594C29.8174 7.82206 28.1818 6.18652 26.168 6.18652Z",fill:"#999999",stroke:"white",strokeWidth:"0.3"})}),Drawx6=React.forwardRef((e,t)=>{const{height:n="300px",maskTip:r="点击画板进入绘制",value:o,onSave:i,savePngType:a="url",showSaveBtn:s}=e,[l,c]=React.useState(!1),u=React.useRef(null);return React.useImperativeHandle(t,()=>{var e;return{getIsFullScreen:()=>l,getData:null==(e=u.current)?void 0:e.getData}}),jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx(Show,{height:n,value:o,maskTip:r,maskClick:()=>{c(!0)}}),l&&jsxRuntimeExports.jsx(Editor,{ref:u,value:o,savePngType:a,editabled:!0,onSave:i,onExit:()=>{c(!1)},showSaveBtn:s})]})}),Draw=e=>{const{status:t=QuestionStatus.EXAM,data:n,onSubmit:r}=e,[o,i]=React.useState(),a=React.useRef(null),s=(e,o=!0)=>{if("exam"!==t)return;const a={userAnswerOption:{content:null==e?void 0:e.json,photo:null==e?void 0:e.png},questionCode:null==n?void 0:n.questionCode};i(null==e?void 0:e.json),null==r||r(a),o&&staticMethods.success("保存成功")};return React.useEffect(()=>{if("exam"!==t)return;const e=async e=>{var t,n;const{type:r}=e.data??{};if("examTimeEnd5"===r&&(null==(t=a.current)?void 0:t.getIsFullScreen())){const e=await(null==(n=a.current)?void 0:n.getData());s(e,!1)}};return window.addEventListener("message",e),()=>{window.removeEventListener("message",e)}},[t]),React.useEffect(()=>{if(n){const{answerOption:e}=n;e&&!Array.isArray(e)&&i(null==e?void 0:e.content)}},[n,t]),jsxRuntimeExports.jsxs("div",{className:"draw-question",children:[jsxRuntimeExports.jsx("div",{className:"draw-question-title",children:jsxRuntimeExports.jsxs("div",{className:"draw-question-title-content",children:[jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsxs("span",{className:"score",children:[null==n?void 0:n.score,"分"]}),jsxRuntimeExports.jsx("span",{className:"type",children:"画图题"}),((null==n?void 0:n.hasAutoScore)??(null==n?void 0:n.judgeMode)===CCMJudgeMode.AI_AGENT)&&jsxRuntimeExports.jsx("span",{className:"auto",children:"自动判分"})]}),jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,noPadding:!0,defaultValue:null==n?void 0:n.topic,readOnly:!0,autoHeight:{min:0,max:1e5}})]})}),jsxRuntimeExports.jsxs("div",{className:"draw-question-content",children:[jsxRuntimeExports.jsx(Drawx6,{ref:a,value:o,showSaveBtn:"mark"!==t&&"view"!==t,onSave:s,maskTip:"mark"===t||"view"===t?"点击画板查看答题":"点击画板进入答题"}),["add","mark"].includes(t)&&!!(null==n?void 0:n.judgeNorm)&&jsxRuntimeExports.jsx(Collapse,{defaultActiveKey:"add"===t?["1"]:[],ghost:!0,expandIcon:({isActive:e})=>jsxRuntimeExports.jsx(RefIcon$e,{rotate:e?90:0}),items:[{key:"1",label:jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment,{children:[jsxRuntimeExports.jsx("span",{style:{fontWeight:"bold"},children:"判分标准"}),jsxRuntimeExports.jsx("span",{style:{fontSize:"12px",color:"#999999"},children:"(学生不可见)"})]}),children:jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,readOnly:!0,defaultValue:n.judgeNorm,noPadding:!0,autoHeight:{min:0,max:1e4}})}]}),n.difficulty&&jsxRuntimeExports.jsx("div",{className:"draw-question-content-others",children:jsxRuntimeExports.jsxs("div",{className:"difficulty",children:[jsxRuntimeExports.jsx("span",{children:"题目难度:"}),jsxRuntimeExports.jsx("span",{children:difficultyMap[n.difficulty]})]})})]})]},null==n?void 0:n.questionCode)},Composite=e=>{var t;const{data:n}=e,{children:r,difficulty:o,topic:i,score:a}=n,[s,l]=React.useState([]),c=React.useRef(null);return React.useEffect(()=>{const e=null==r?void 0:r.map((e,t)=>(null==e?void 0:e.questionCode)||t);l(e)},[null==(t=null==n?void 0:n.children)?void 0:t.length]),jsxRuntimeExports.jsxs("div",{className:"composite",children:[jsxRuntimeExports.jsx("div",{className:"composite-title",children:jsxRuntimeExports.jsxs("div",{className:"composite-title-content",children:[jsxRuntimeExports.jsxs("div",{children:[a&&jsxRuntimeExports.jsxs("span",{className:"score",children:[a,"分"]}),jsxRuntimeExports.jsx("span",{className:"type",children:"组合题"}),(null==n?void 0:n.hasAutoScore)&&jsxRuntimeExports.jsx("span",{className:"auto",children:"自动判分"})]}),jsxRuntimeExports.jsx(RichEditor,{isBorder:!1,noPadding:!0,defaultValue:i,readOnly:!0,autoHeight:{min:0,max:1e5}})]})}),jsxRuntimeExports.jsxs("div",{className:"composite-content",children:[jsxRuntimeExports.jsx(Collapse,{activeKey:s,ghost:!0,ref:c,expandIcon:({isActive:e})=>jsxRuntimeExports.jsx(RefIcon$e,{rotate:e?90:0}),onChange:e=>{l(Array.isArray(e)?e:[e])},items:null==r?void 0:r.map((e,t)=>({key:(null==e?void 0:e.questionCode)||t,label:`第${t+1}小题(${questionTypesMap[null==e?void 0:e.type]})`,children:jsxRuntimeExports.jsx(QuestionRender,{data:e})}))}),jsxRuntimeExports.jsx("div",{className:"composite-content-others",children:o&&jsxRuntimeExports.jsxs("div",{className:"difficulty",children:[jsxRuntimeExports.jsx("span",{children:"题目难度:"}),jsxRuntimeExports.jsx("span",{children:difficultyMap[o]})]})})]})]})},QuestionRender=React.forwardRef((e,t)=>{const{data:n,questionProps:r={},listeners:o}=e,{onSubmit:i,onNextQuestion:a,editable:s=!1,deleteable:l=!1,onDelete:c=()=>{},onEditOk:u=()=>{},buttonText:d="",showQuestionTip:p=!1,langList:f,showResult:h,status:g=QuestionStatus.PREVIEW,className:m="",styles:y={},uploadImg:v,codeTestURL:b,codeplayerURL:_,rightTopButtonArr:E,unknowQesutionRender:S,QuestionTopRender:x,QuestionBottomRender:w,onlyAdd:C,toRunCodeQuestion:R}=r,[T,k]=React.useState(!1),[A,P]=React.useState(!0),[O,N]=React.useState(!1),[I,$]=React.useState(""),D=React.useMemo(()=>{const e={...n},{optionJson:t,type:r}=n;return!t||r!==QuestionTypeEnum.ACM&&r!==QuestionTypeEnum.CCM||(e.lang=null==t?void 0:t.defaultLanguage),e},[n]);React.useImperativeHandle(t,()=>({setEditShow:e=>k(e),setShowOperateButton:P,addQuestion:()=>{N(!0)}}));const[L,M]=React.useState((e=>{switch(e){case QuestionTypeEnum.RADIO:return"";case QuestionTypeEnum.CHECKBOX:return[];case QuestionTypeEnum.ANSWER:case QuestionTypeEnum.JUDGE:return"";case QuestionTypeEnum.ACM:case QuestionTypeEnum.CCM:return{code:"",language:"javascript"};case QuestionTypeEnum.COMPLETION:return[];case QuestionTypeEnum.DRAW:case QuestionTypeEnum.COMPOSITE:return{};default:return null}})(D.type)),B=e=>jsxRuntimeExports.jsx(QuestionContext.Provider,{value:{topProps:{uploadImg:v}},children:jsxRuntimeExports.jsxs("div",{className:`question-wrapper ${m}`,style:{...y},children:[A&&jsxRuntimeExports.jsxs("div",{className:"operate-area",children:[s&&jsxRuntimeExports.jsx(Tooltip,{title:"编辑",children:jsxRuntimeExports.jsx(Button$1,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$9,{}),onClick:()=>k(!0)},"edit")}),l&&jsxRuntimeExports.jsx(Tooltip,{title:"删除",children:jsxRuntimeExports.jsx(Button$1,{size:"small",icon:jsxRuntimeExports.jsx(RefIcon$c,{}),onClick:()=>c(D)},"delete")}),(null==E?void 0:E.length)&&E.map(e=>{const{text:n,icon:r,needBindRef:i}=e,a={...e};return delete a.needBindRef,jsxRuntimeExports.jsx(Tooltip,{title:n,children:React.createElement(Button$1,{...a,ref:i?t:null,size:"small",key:n??(null==r?void 0:r.toString()),"data-cypress":i?"draggable-handle":"",...i?o:{}})},n??(null==r?void 0:r.toString()))})]}),x&&x(D),e,w&&w(D)]})}),F={data:D,onSubmit:i,buttonText:d,status:g,onNextQuestion:a};if(C)return jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment,{children:jsxRuntimeExports.jsx(QuestionContext.Provider,{value:{topProps:{uploadImg:v}},children:O&&jsxRuntimeExports.jsx(Modal,{style:{top:"40%"},open:O,footer:null,title:"请选择题型",width:300,onCancel:()=>{N(!1),$("")},children:jsxRuntimeExports.jsx(Select,{style:{width:"100%"},placeholder:"请选择",onChange:e=>{N(!1),$(e),k(!0)},options:questionTypeSelectOptions})})})});switch(D.type){case QuestionTypeEnum.RADIO:case QuestionTypeEnum.CHECKBOX:return(()=>{const e=jsxRuntimeExports.jsx(ChoiceQuestion,{showQuestionTip:p,showResult:h,...F});return B(e)})();case QuestionTypeEnum.ACM:case QuestionTypeEnum.CCM:return(()=>{const e=jsxRuntimeExports.jsx(Preview,{codeTestURL:b,codeplayerURL:_,toRunCodeQuestion:R,...F});return B(e)})();case QuestionTypeEnum.COMPLETION:return(()=>{const e=jsxRuntimeExports.jsx(Completion,{showResult:h,...F});return B(e)})();case QuestionTypeEnum.ANSWER:return(()=>{const e=jsxRuntimeExports.jsx(AnswerQuestion,{...F});return B(e)})();case QuestionTypeEnum.DRAW:return(()=>{const e=jsxRuntimeExports.jsx(Draw,{...F});return B(e)})();case QuestionTypeEnum.COMPOSITE:return(()=>{const e=jsxRuntimeExports.jsx(Composite,{...F});return B(e)})();default:return S?S(D):jsxRuntimeExports.jsx("div",{children:"未知题型"})}}),VideoKnowledgeCard=e=>{const{editCallBack:t,resetContentCallback:n,id:r,createKnowldegeLoading:o,createKnowledgeCallback:i,relatedKnowledgeList:a,basicKnowledgeList:s,expandKnowledgeList:l,createQuestionCallback:c,aiConsultCallback:u,questionSubmitCallback:d}=e,[p,f]=React.useState(e),[h,g]=React.useState(!1),[m,y]=React.useState(!1),[v,b]=React.useState(e.title),[_,E]=React.useState(e.content),[S,x]=React.useState(!1),[w,C]=React.useState(!1),[R,T]=React.useState(!1),[k,A]=React.useState("basic"),[P,O]=React.useState(""),[N,I]=React.useState(null),[$,D]=React.useState(!1),L=React.useRef(null),{knowledgeType:M,title:B,content:F,codeData:j,videoTime:H,videoUrl:U,videoLicense:z,runCode:q,questionsList:V,relatedKnowledgeList:G,basicKnowledgeList:W,expandKnowledgeList:K}=p,X=e=>{"basic"===e.key?(T(!0),A("basic")):"expand"===e.key?(T(!0),A("expand")):"aiconsult"===e.key&&(null==u||u({title:B,content:F,id:r}))},Y={1:jsxRuntimeExports.jsx(RefIcon$5,{}),2:jsxRuntimeExports.jsx(RefIcon$5,{}),3:jsxRuntimeExports.jsx(RefIcon$4,{}),4:jsxRuntimeExports.jsx(RefIcon$2,{}),5:jsxRuntimeExports.jsx(RefIcon$2,{})},Z=React.useMemo(()=>"basic"===k?s||[]:"expand"===k?l||[]:"related"===k?a||[]:void 0,[k,s,l,a]);return jsxRuntimeExports.jsxs("div",{className:styles$3.knowledgeCardContainer,children:[jsxRuntimeExports.jsxs(Card,{className:styles$3.card,children:[h&&jsxRuntimeExports.jsxs("div",{className:styles$3.returnArea,onClick:()=>{f(e),g(!1)},children:[jsxRuntimeExports.jsx(ArrowLeft,{className:styles$3.arrowLeft}),"返回初始卡片"]}),jsxRuntimeExports.jsxs("div",{className:styles$3.header,children:[jsxRuntimeExports.jsxs("div",{className:styles$3.titleSection,children:[jsxRuntimeExports.jsx(Tag,{color:"orange",className:styles$3.knowledgeTag,children:"practice"===M?"实操知识点":"概念知识点"}),m?jsxRuntimeExports.jsx(Input,{value:v,onChange:e=>{b(e.target.value)}}):jsxRuntimeExports.jsx("h1",{className:styles$3.title,children:B}),t&&!m&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsx("button",{onClick:()=>{y(!0)},className:"p-2 hover:bg-gray-50 rounded-lg transition-colors group",children:jsxRuntimeExports.jsx(PenLine,{className:"w-5 h-5 text-gray-600 group-hover:text-blue-600"})})}),!m&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsx("button",{onClick:()=>{navigator.clipboard.writeText(F),staticMethods.success("复制成功")},className:"p-2 hover:bg-gray-50 rounded-lg transition-colors group",children:jsxRuntimeExports.jsx(Copy,{className:"w-5 h-5 text-gray-600 group-hover:text-blue-600"})})}),m&&n&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsx(Tooltip,{title:"恢复原文",children:jsxRuntimeExports.jsx("button",{onClick:()=>{null==n||n(),y(!1)},className:"p-2 hover:bg-blue-50 rounded-lg transition-colors group",children:jsxRuntimeExports.jsx(RotateCcw,{className:"w-5 h-5 text-blue-600"})})})}),m&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsx("button",{onClick:()=>{null==t||t({title:v,content:_,id:r}),y(!1)},className:"p-2 hover:bg-green-50 rounded-lg transition-colors group",title:"保存",children:jsxRuntimeExports.jsx(Save,{className:"w-5 h-5 text-green-600"})})}),m&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsx("button",{onClick:()=>y(!1),className:"p-2 hover:bg-red-50 rounded-lg transition-colors group",title:"取消",children:jsxRuntimeExports.jsx(X$2,{className:"w-5 h-5 text-red-600"})})})]}),jsxRuntimeExports.jsx("div",{className:styles$3.metaInfo,children:jsxRuntimeExports.jsxs(Space,{children:[H&&jsxRuntimeExports.jsxs("div",{className:styles$3.duration,children:[jsxRuntimeExports.jsx(Clock,{size:16}),jsxRuntimeExports.jsx("span",{children:H})]}),U&&jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(Play,{size:16}),className:styles$3.videoBtn,onClick:()=>{C(!0)},children:"视频讲解"}),!h&&jsxRuntimeExports.jsxs(Space.Compact,{children:[jsxRuntimeExports.jsx(Button$1,{onClick:()=>{A("related"),T(!0)},children:"关联知识点"}),jsxRuntimeExports.jsx(Dropdown,{menu:{items:[{key:"basic",label:"他的基础知识点"},{key:"expand",label:"他的拓展知识点"}],onClick:X},placement:"bottomRight",children:jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(RefIcon$g,{})})})]}),c?jsxRuntimeExports.jsxs(Space.Compact,{children:[jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(FileText,{size:16}),className:styles$3.aiBtn,onClick:()=>null==c?void 0:c({title:B,content:F,id:r}),children:"AI出题"}),u&&jsxRuntimeExports.jsx(Dropdown,{menu:{items:[{key:"aiconsult",label:"AI问答"}],onClick:X},placement:"bottomRight",children:jsxRuntimeExports.jsx(Button$1,{icon:jsxRuntimeExports.jsx(RefIcon$g,{})})})]}):u&&jsxRuntimeExports.jsx(Button$1,{className:styles$3.aiBtn,onClick:()=>null==u?void 0:u({title:B,content:F,id:r}),children:"AI问答"})]})})]}),jsxRuntimeExports.jsx("div",{className:styles$3.description,children:m?jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsxs("div",{className:"space-y-4",children:[jsxRuntimeExports.jsxs("div",{className:"bg-blue-50 border border-blue-200 rounded-lg p-3 flex items-start gap-2",children:[jsxRuntimeExports.jsx(Sparkles,{className:"w-5 h-5 text-blue-600 flex-shrink-0 mt-0.5"}),jsxRuntimeExports.jsxs("div",{className:"text-sm text-blue-800",children:[jsxRuntimeExports.jsx("p",{className:"font-medium mb-1",children:"编辑提示"}),jsxRuntimeExports.jsx("p",{children:"支持Markdown格式,可以使用**粗体**、*斜体*、`代码`等格式化文本"})]})]}),jsxRuntimeExports.jsx("textarea",{value:_,onChange:e=>E(e.target.value),className:"bg-white w-full min-h-[200px] px-4 py-3 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-transparent resize-none font-mono text-sm",placeholder:"在此编辑内容,支持Markdown格式...",maxLength:1e3}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500",children:[jsxRuntimeExports.jsx("span",{children:"支持Markdown格式化"}),jsxRuntimeExports.jsxs("span",{children:[_.length,"/1000"]})]})]})}):jsxRuntimeExports.jsx(MyReactMarkdown,{children:F})}),V&&V.length>0&&jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:jsxRuntimeExports.jsxs("div",{className:"bg-white rounded-lg my-6 overflow-y-auto h-full",children:[jsxRuntimeExports.jsx("h3",{className:"font-semibold text-gray-800 mb-4",children:"练习题"}),jsxRuntimeExports.jsx("div",{className:" pr-[12px] left-que-item flex gap-4 items-center",children:null==V?void 0:V.map((e,t)=>{var n,r,o;return jsxRuntimeExports.jsxs("button",{onClick:()=>{I(e),D(!0)},className:"w-100 h-full text-left p-4 rounded-lg border-2 transition-all border-gray-200 hover:border-gray-300 hover:bg-gray-50",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between mb-2",children:[jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntimeExports.jsx("span",{className:"w-6 h-6 rounded-full flex items-center justify-center text-xs font-medium bg-gray-200 text-gray-600",children:t+1}),jsxRuntimeExports.jsx("div",{className:"p-1 rounded bg-gray-100",children:getQuestionTypeIcon(e.type)}),V[t].userAnswer&&jsxRuntimeExports.jsx("div",{className:"text-xs px-2 py-1 rounded-1 font-medium text-green-500 bg-green-100}",children:"已完成"})]}),jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntimeExports.jsx("span",{className:`text-xs px-2 py-1 rounded-full font-medium ${getDifficultyColor(e.difficulty||"")}`,children:"low"===e.difficulty?"简单":"middle"===e.difficulty?"中等":"困难"}),e.score?jsxRuntimeExports.jsxs("div",{className:"flex items-center space-x-1 text-xs text-gray-500",children:[jsxRuntimeExports.jsx(Star,{className:"w-3 h-3"}),jsxRuntimeExports.jsx("span",{children:e.score})]}):null]})]}),jsxRuntimeExports.jsx(Tooltip,{title:(e.topic||e.content||"").replace(/<[^>]*>/g,""),children:jsxRuntimeExports.jsx("h4",{className:"font-medium text-sm mb-1 text-ellipsis line-clamp-2 text-gray-800",children:jsxRuntimeExports.jsx("span",{dangerouslySetInnerHTML:{__html:e.topic||e.content||""}})})}),jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between",children:[(null==(n=null==e?void 0:e.labels)?void 0:n.length)?jsxRuntimeExports.jsx("span",{className:"text-xs text-blue-600 bg-blue-100 px-2 py-1 rounded-full",children:null==(o=null==(r=null==e?void 0:e.labels)?void 0:r[0])?void 0:o.labelName}):jsxRuntimeExports.jsx("span",{}),jsxRuntimeExports.jsx("span",{className:"text-xs text-gray-500",children:getQuestionTypeName(e.type)})]})]},e.content||""+t)})})]})}),j&&j.code&&jsxRuntimeExports.jsxs("div",{className:styles$3.codeSection,children:[jsxRuntimeExports.jsxs("div",{className:styles$3.codeHeader,children:[jsxRuntimeExports.jsx("span",{className:styles$3.language,children:j.lang}),jsxRuntimeExports.jsxs("div",{className:styles$3.btnGroup,children:[S?jsxRuntimeExports.jsx(Button$1,{size:"small",className:styles$3.copyBtn,icon:jsxRuntimeExports.jsx(RefIcon$s,{}),children:"复制成功"}):jsxRuntimeExports.jsx(Button$1,{size:"small",className:styles$3.copyBtn,icon:jsxRuntimeExports.jsx(Copy,{size:14}),onClick:()=>{return e=j.code||"",navigator.clipboard.writeText(e),x(!0),void setTimeout(()=>x(!1),2e3);var e},children:"复制代码"}),jsxRuntimeExports.jsx(Button$1,{size:"small",className:styles$3.runBtn,icon:jsxRuntimeExports.jsx(Play,{size:14}),onClick:()=>null==q?void 0:q(j.code||""),children:"在线运行"})]})]}),jsxRuntimeExports.jsx("div",{className:styles$3.codeBlock,children:jsxRuntimeExports.jsx(ThemedCodeBlock,{text:j.code||"",language:j.lang||"c",showLineNumbers:!0,theme:dracula})})]}),jsxRuntimeExports.jsx("div",{className:styles$3.rateSection,children:jsxRuntimeExports.jsx("span",{className:styles$3.rateTitle,children:"打分"})}),jsxRuntimeExports.jsx(Rate,{defaultValue:5,character:({index:e=0})=>Y[e+1]})]}),jsxRuntimeExports.jsx(Modal,{open:w,onCancel:()=>C(!1),forceRender:!0,footer:null,className:styles$3.videoModal,width:700,children:jsxRuntimeExports.jsx("div",{className:styles$3.playerPanel,style:{width:"700px"},children:jsxRuntimeExports.jsx(VideoPlayer,{containerId:"aliplayerModalId",url:U||"",playerRef:L,license:z||{domain:"",key:""}})})}),jsxRuntimeExports.jsx(Modal,{open:R,onCancel:()=>T(!1),footer:null,className:styles$3.relatedKnowledgeModal,width:700,children:jsxRuntimeExports.jsx(Spin,{spinning:o,children:jsxRuntimeExports.jsxs("div",{className:styles$3.relatedKnowledgeModalContent,children:[jsxRuntimeExports.jsx("div",{className:"tailwind-scoped",children:(null==Z?void 0:Z.length)?jsxRuntimeExports.jsxs("div",{className:"p-6 rounded-xl bg-gradient-to-br from-purple-50 to-blue-50 shadow-md",children:[jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between mb-4",children:jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[jsxRuntimeExports.jsx("div",{className:"w-10 h-10 bg-gradient-to-br from-purple-600 to-blue-600 rounded-xl flex items-center justify-center shadow-lg",children:jsxRuntimeExports.jsx(Lightbulb,{className:"w-6 h-6 text-white"})}),jsxRuntimeExports.jsxs("div",{children:[jsxRuntimeExports.jsx("h3",{className:"font-bold text-gray-900",children:"知识点卡片"}),jsxRuntimeExports.jsxs("p",{className:"text-sm text-gray-600",children:["共 ",Z.length," 个知识点"]})]})]})}),jsxRuntimeExports.jsx("div",{className:"grid grid-cols-2 gap-3",children:Z.map(e=>jsxRuntimeExports.jsxs("button",{onClick:()=>(e=>{f(e),T(!1),g(!0)})(e),className:"w-full group relative bg-white rounded-xl p-4 border-2 border-purple-200 hover:border-purple-400 hover:shadow-lg transition-all text-left",children:[jsxRuntimeExports.jsx("div",{className:"absolute top-3 right-3",children:"concept"===e.knowledgeType?jsxRuntimeExports.jsx("div",{className:"w-8 h-8 bg-blue-100 rounded-lg flex items-center justify-center",children:jsxRuntimeExports.jsx(BookOpen,{className:"w-4 h-4 text-blue-600"})}):jsxRuntimeExports.jsx("div",{className:"w-8 h-8 bg-purple-100 rounded-lg flex items-center justify-center",children:jsxRuntimeExports.jsx(Code$1,{className:"w-4 h-4 text-purple-600"})})}),jsxRuntimeExports.jsxs("div",{className:"pr-10",children:[jsxRuntimeExports.jsx(Tooltip,{title:e.title,children:jsxRuntimeExports.jsx("h4",{className:"font-semibold text-gray-900 mb-2 group-hover:text-purple-600 transition-colors text-ellipsis whitespace-nowrap overflow-hidden",children:e.title})}),jsxRuntimeExports.jsx("div",{className:"mt-2",children:jsxRuntimeExports.jsx("span",{className:"text-xs px-2 py-1 rounded-full whitespace-nowrap "+("concept"===e.knowledgeType?"bg-blue-100 text-blue-700":"bg-purple-100 text-purple-700"),children:"concept"===e.knowledgeType?"概念型":"实操型"})})]})]},e.id))})]}):jsxRuntimeExports.jsx(Empty,{description:jsxRuntimeExports.jsx("span",{children:"暂无知识点数据,可以通过下方对话自行生成"}),image:Empty.PRESENTED_IMAGE_SIMPLE})}),i&&jsxRuntimeExports.jsx("div",{className:styles$3.inputContainer,children:jsxRuntimeExports.jsxs(Space.Compact,{style:{width:"100%"},children:[jsxRuntimeExports.jsx(Input,{value:P,onChange:e=>O(e.target.value),placeholder:"输入描述AI帮你生成知识点"}),jsxRuntimeExports.jsx(Button$1,{type:"primary",onClick:()=>null==i?void 0:i({createType:k,userInput:P,id:r}),children:"一键生成"})]})})]})})}),$&&jsxRuntimeExports.jsx(Modal,{open:$,onCancel:()=>D(!1),footer:null,className:styles$3.questionPracticeModal,width:700,children:jsxRuntimeExports.jsx(QuestionRender,{data:N,questionProps:{showResult:!0,onSubmit:e=>{null==d||d({questionCode:(null==N?void 0:N.questionCode)||"",userAnswer:e,questionData:N})}}})})]},r)};var abapExports=requireAbap();const abap=getDefaultExportFromCjs(abapExports),abap$1=_mergeNamespaces({__proto__:null,default:abap},[abapExports]);var abnfExports=requireAbnf();const abnf=getDefaultExportFromCjs(abnfExports),abnf$1=_mergeNamespaces({__proto__:null,default:abnf},[abnfExports]);var actionscriptExports=requireActionscript();const actionscript=getDefaultExportFromCjs(actionscriptExports),actionscript$1=_mergeNamespaces({__proto__:null,default:actionscript},[actionscriptExports]);var adaExports=requireAda();const ada=getDefaultExportFromCjs(adaExports),ada$1=_mergeNamespaces({__proto__:null,default:ada},[adaExports]);var agdaExports=requireAgda();const agda=getDefaultExportFromCjs(agdaExports),agda$1=_mergeNamespaces({__proto__:null,default:agda},[agdaExports]);var alExports=requireAl();const al=getDefaultExportFromCjs(alExports),al$1=_mergeNamespaces({__proto__:null,default:al},[alExports]);var antlr4Exports=requireAntlr4();const antlr4=getDefaultExportFromCjs(antlr4Exports),antlr4$1=_mergeNamespaces({__proto__:null,default:antlr4},[antlr4Exports]);var apacheconfExports=requireApacheconf();const apacheconf=getDefaultExportFromCjs(apacheconfExports),apacheconf$1=_mergeNamespaces({__proto__:null,default:apacheconf},[apacheconfExports]);var apexExports=requireApex();const apex=getDefaultExportFromCjs(apexExports),apex$1=_mergeNamespaces({__proto__:null,default:apex},[apexExports]);var aplExports=requireApl();const apl=getDefaultExportFromCjs(aplExports),apl$1=_mergeNamespaces({__proto__:null,default:apl},[aplExports]);var applescriptExports=requireApplescript();const applescript=getDefaultExportFromCjs(applescriptExports),applescript$1=_mergeNamespaces({__proto__:null,default:applescript},[applescriptExports]);var aqlExports=requireAql();const aql=getDefaultExportFromCjs(aqlExports),aql$1=_mergeNamespaces({__proto__:null,default:aql},[aqlExports]);var arduinoExports=requireArduino();const arduino=getDefaultExportFromCjs(arduinoExports),arduino$1=_mergeNamespaces({__proto__:null,default:arduino},[arduinoExports]);var arffExports=requireArff();const arff=getDefaultExportFromCjs(arffExports),arff$1=_mergeNamespaces({__proto__:null,default:arff},[arffExports]);var asciidocExports=requireAsciidoc();const asciidoc=getDefaultExportFromCjs(asciidocExports),asciidoc$1=_mergeNamespaces({__proto__:null,default:asciidoc},[asciidocExports]);var asm6502Exports=requireAsm6502();const asm6502=getDefaultExportFromCjs(asm6502Exports),asm6502$1=_mergeNamespaces({__proto__:null,default:asm6502},[asm6502Exports]);var asmatmelExports=requireAsmatmel();const asmatmel=getDefaultExportFromCjs(asmatmelExports),asmatmel$1=_mergeNamespaces({__proto__:null,default:asmatmel},[asmatmelExports]);var aspnetExports=requireAspnet();const aspnet=getDefaultExportFromCjs(aspnetExports),aspnet$1=_mergeNamespaces({__proto__:null,default:aspnet},[aspnetExports]);var autohotkeyExports=requireAutohotkey();const autohotkey=getDefaultExportFromCjs(autohotkeyExports),autohotkey$1=_mergeNamespaces({__proto__:null,default:autohotkey},[autohotkeyExports]);var autoitExports=requireAutoit();const autoit=getDefaultExportFromCjs(autoitExports),autoit$1=_mergeNamespaces({__proto__:null,default:autoit},[autoitExports]);var avisynthExports=requireAvisynth();const avisynth=getDefaultExportFromCjs(avisynthExports),avisynth$1=_mergeNamespaces({__proto__:null,default:avisynth},[avisynthExports]);var avroIdlExports=requireAvroIdl();const avroIdl=getDefaultExportFromCjs(avroIdlExports),avroIdl$1=_mergeNamespaces({__proto__:null,default:avroIdl},[avroIdlExports]);var bashExports=requireBash();const bash=getDefaultExportFromCjs(bashExports),bash$1=_mergeNamespaces({__proto__:null,default:bash},[bashExports]);var basicExports=requireBasic();const basic=getDefaultExportFromCjs(basicExports),basic$1=_mergeNamespaces({__proto__:null,default:basic},[basicExports]);var batchExports=requireBatch();const batch=getDefaultExportFromCjs(batchExports),batch$1=_mergeNamespaces({__proto__:null,default:batch},[batchExports]);var bbcodeExports=requireBbcode();const bbcode=getDefaultExportFromCjs(bbcodeExports),bbcode$1=_mergeNamespaces({__proto__:null,default:bbcode},[bbcodeExports]);var bicepExports=requireBicep();const bicep=getDefaultExportFromCjs(bicepExports),bicep$1=_mergeNamespaces({__proto__:null,default:bicep},[bicepExports]);var birbExports=requireBirb();const birb=getDefaultExportFromCjs(birbExports),birb$1=_mergeNamespaces({__proto__:null,default:birb},[birbExports]);var bisonExports=requireBison();const bison=getDefaultExportFromCjs(bisonExports),bison$1=_mergeNamespaces({__proto__:null,default:bison},[bisonExports]);var bnfExports=requireBnf();const bnf=getDefaultExportFromCjs(bnfExports),bnf$1=_mergeNamespaces({__proto__:null,default:bnf},[bnfExports]);var brainfuckExports=requireBrainfuck();const brainfuck=getDefaultExportFromCjs(brainfuckExports),brainfuck$1=_mergeNamespaces({__proto__:null,default:brainfuck},[brainfuckExports]);var brightscriptExports=requireBrightscript();const brightscript=getDefaultExportFromCjs(brightscriptExports),brightscript$1=_mergeNamespaces({__proto__:null,default:brightscript},[brightscriptExports]);var broExports=requireBro();const bro=getDefaultExportFromCjs(broExports),bro$1=_mergeNamespaces({__proto__:null,default:bro},[broExports]);var bslExports=requireBsl();const bsl=getDefaultExportFromCjs(bslExports),bsl$1=_mergeNamespaces({__proto__:null,default:bsl},[bslExports]);var cExports=requireC();const c=getDefaultExportFromCjs(cExports),c$1=_mergeNamespaces({__proto__:null,default:c},[cExports]);var cfscriptExports=requireCfscript();const cfscript=getDefaultExportFromCjs(cfscriptExports),cfscript$1=_mergeNamespaces({__proto__:null,default:cfscript},[cfscriptExports]);var chaiscriptExports=requireChaiscript();const chaiscript=getDefaultExportFromCjs(chaiscriptExports),chaiscript$1=_mergeNamespaces({__proto__:null,default:chaiscript},[chaiscriptExports]);var cilExports=requireCil();const cil=getDefaultExportFromCjs(cilExports),cil$1=_mergeNamespaces({__proto__:null,default:cil},[cilExports]);var clojureExports=requireClojure();const clojure=getDefaultExportFromCjs(clojureExports),clojure$1=_mergeNamespaces({__proto__:null,default:clojure},[clojureExports]);var cmakeExports=requireCmake();const cmake=getDefaultExportFromCjs(cmakeExports),cmake$1=_mergeNamespaces({__proto__:null,default:cmake},[cmakeExports]);var cobolExports=requireCobol();const cobol=getDefaultExportFromCjs(cobolExports),cobol$1=_mergeNamespaces({__proto__:null,default:cobol},[cobolExports]);var coffeescriptExports=requireCoffeescript();const coffeescript=getDefaultExportFromCjs(coffeescriptExports),coffeescript$1=_mergeNamespaces({__proto__:null,default:coffeescript},[coffeescriptExports]);var concurnasExports=requireConcurnas();const concurnas=getDefaultExportFromCjs(concurnasExports),concurnas$1=_mergeNamespaces({__proto__:null,default:concurnas},[concurnasExports]);var coqExports=requireCoq();const coq=getDefaultExportFromCjs(coqExports),coq$1=_mergeNamespaces({__proto__:null,default:coq},[coqExports]);var cppExports=requireCpp();const cpp=getDefaultExportFromCjs(cppExports),cpp$1=_mergeNamespaces({__proto__:null,default:cpp},[cppExports]);var crystalExports=requireCrystal();const crystal=getDefaultExportFromCjs(crystalExports),crystal$1=_mergeNamespaces({__proto__:null,default:crystal},[crystalExports]);var csharpExports=requireCsharp();const csharp=getDefaultExportFromCjs(csharpExports),csharp$1=_mergeNamespaces({__proto__:null,default:csharp},[csharpExports]);var cshtmlExports=requireCshtml();const cshtml=getDefaultExportFromCjs(cshtmlExports),cshtml$1=_mergeNamespaces({__proto__:null,default:cshtml},[cshtmlExports]);var cspExports=requireCsp();const csp=getDefaultExportFromCjs(cspExports),csp$1=_mergeNamespaces({__proto__:null,default:csp},[cspExports]);var cssExtrasExports=requireCssExtras();const cssExtras=getDefaultExportFromCjs(cssExtrasExports),cssExtras$1=_mergeNamespaces({__proto__:null,default:cssExtras},[cssExtrasExports]);var csvExports=requireCsv();const csv=getDefaultExportFromCjs(csvExports),csv$1=_mergeNamespaces({__proto__:null,default:csv},[csvExports]);var cypherExports=requireCypher();const cypher=getDefaultExportFromCjs(cypherExports),cypher$1=_mergeNamespaces({__proto__:null,default:cypher},[cypherExports]);var dExports=requireD();const d=getDefaultExportFromCjs(dExports),d$1=_mergeNamespaces({__proto__:null,default:d},[dExports]);var dartExports=requireDart();const dart=getDefaultExportFromCjs(dartExports),dart$1=_mergeNamespaces({__proto__:null,default:dart},[dartExports]);var dataweaveExports=requireDataweave();const dataweave=getDefaultExportFromCjs(dataweaveExports),dataweave$1=_mergeNamespaces({__proto__:null,default:dataweave},[dataweaveExports]);var daxExports=requireDax();const dax=getDefaultExportFromCjs(daxExports),dax$1=_mergeNamespaces({__proto__:null,default:dax},[daxExports]);var dhallExports=requireDhall();const dhall=getDefaultExportFromCjs(dhallExports),dhall$1=_mergeNamespaces({__proto__:null,default:dhall},[dhallExports]);var diffExports=requireDiff();const diff=getDefaultExportFromCjs(diffExports),diff$1=_mergeNamespaces({__proto__:null,default:diff},[diffExports]);var djangoExports=requireDjango();const django=getDefaultExportFromCjs(djangoExports),django$1=_mergeNamespaces({__proto__:null,default:django},[djangoExports]);var dnsZoneFileExports=requireDnsZoneFile();const dnsZoneFile=getDefaultExportFromCjs(dnsZoneFileExports),dnsZoneFile$1=_mergeNamespaces({__proto__:null,default:dnsZoneFile},[dnsZoneFileExports]);var dockerExports=requireDocker();const docker=getDefaultExportFromCjs(dockerExports),docker$1=_mergeNamespaces({__proto__:null,default:docker},[dockerExports]);var dotExports=requireDot();const dot=getDefaultExportFromCjs(dotExports),dot$1=_mergeNamespaces({__proto__:null,default:dot},[dotExports]);var ebnfExports=requireEbnf();const ebnf=getDefaultExportFromCjs(ebnfExports),ebnf$1=_mergeNamespaces({__proto__:null,default:ebnf},[ebnfExports]);var editorconfigExports=requireEditorconfig();const editorconfig=getDefaultExportFromCjs(editorconfigExports),editorconfig$1=_mergeNamespaces({__proto__:null,default:editorconfig},[editorconfigExports]);var eiffelExports=requireEiffel();const eiffel=getDefaultExportFromCjs(eiffelExports),eiffel$1=_mergeNamespaces({__proto__:null,default:eiffel},[eiffelExports]);var ejsExports=requireEjs();const ejs=getDefaultExportFromCjs(ejsExports),ejs$1=_mergeNamespaces({__proto__:null,default:ejs},[ejsExports]);var elixirExports=requireElixir();const elixir=getDefaultExportFromCjs(elixirExports),elixir$1=_mergeNamespaces({__proto__:null,default:elixir},[elixirExports]);var elmExports=requireElm();const elm=getDefaultExportFromCjs(elmExports),elm$1=_mergeNamespaces({__proto__:null,default:elm},[elmExports]);var erbExports=requireErb();const erb=getDefaultExportFromCjs(erbExports),erb$1=_mergeNamespaces({__proto__:null,default:erb},[erbExports]);var erlangExports=requireErlang();const erlang=getDefaultExportFromCjs(erlangExports),erlang$1=_mergeNamespaces({__proto__:null,default:erlang},[erlangExports]);var etluaExports=requireEtlua();const etlua=getDefaultExportFromCjs(etluaExports),etlua$1=_mergeNamespaces({__proto__:null,default:etlua},[etluaExports]);var excelFormulaExports=requireExcelFormula();const excelFormula=getDefaultExportFromCjs(excelFormulaExports),excelFormula$1=_mergeNamespaces({__proto__:null,default:excelFormula},[excelFormulaExports]);var factorExports=requireFactor();const factor=getDefaultExportFromCjs(factorExports),factor$1=_mergeNamespaces({__proto__:null,default:factor},[factorExports]);var _falseExports=require_false();const _false=getDefaultExportFromCjs(_falseExports),_false$1=_mergeNamespaces({__proto__:null,default:_false},[_falseExports]);var firestoreSecurityRulesExports=requireFirestoreSecurityRules();const firestoreSecurityRules=getDefaultExportFromCjs(firestoreSecurityRulesExports),firestoreSecurityRules$1=_mergeNamespaces({__proto__:null,default:firestoreSecurityRules},[firestoreSecurityRulesExports]);var flowExports=requireFlow();const flow=getDefaultExportFromCjs(flowExports),flow$1=_mergeNamespaces({__proto__:null,default:flow},[flowExports]);var fortranExports=requireFortran();const fortran=getDefaultExportFromCjs(fortranExports),fortran$1=_mergeNamespaces({__proto__:null,default:fortran},[fortranExports]);var fsharpExports=requireFsharp();const fsharp=getDefaultExportFromCjs(fsharpExports),fsharp$1=_mergeNamespaces({__proto__:null,default:fsharp},[fsharpExports]);var ftlExports=requireFtl();const ftl=getDefaultExportFromCjs(ftlExports),ftl$1=_mergeNamespaces({__proto__:null,default:ftl},[ftlExports]);var gapExports=requireGap();const gap=getDefaultExportFromCjs(gapExports),gap$1=_mergeNamespaces({__proto__:null,default:gap},[gapExports]);var gcodeExports=requireGcode();const gcode=getDefaultExportFromCjs(gcodeExports),gcode$1=_mergeNamespaces({__proto__:null,default:gcode},[gcodeExports]);var gdscriptExports=requireGdscript();const gdscript=getDefaultExportFromCjs(gdscriptExports),gdscript$1=_mergeNamespaces({__proto__:null,default:gdscript},[gdscriptExports]);var gedcomExports=requireGedcom();const gedcom=getDefaultExportFromCjs(gedcomExports),gedcom$1=_mergeNamespaces({__proto__:null,default:gedcom},[gedcomExports]);var gherkinExports=requireGherkin();const gherkin=getDefaultExportFromCjs(gherkinExports),gherkin$1=_mergeNamespaces({__proto__:null,default:gherkin},[gherkinExports]);var gitExports=requireGit();const git=getDefaultExportFromCjs(gitExports),git$1=_mergeNamespaces({__proto__:null,default:git},[gitExports]);var glslExports=requireGlsl();const glsl=getDefaultExportFromCjs(glslExports),glsl$1=_mergeNamespaces({__proto__:null,default:glsl},[glslExports]);var gmlExports=requireGml();const gml=getDefaultExportFromCjs(gmlExports),gml$1=_mergeNamespaces({__proto__:null,default:gml},[gmlExports]);var gnExports=requireGn();const gn=getDefaultExportFromCjs(gnExports),gn$1=_mergeNamespaces({__proto__:null,default:gn},[gnExports]);var goModuleExports=requireGoModule();const goModule=getDefaultExportFromCjs(goModuleExports),goModule$1=_mergeNamespaces({__proto__:null,default:goModule},[goModuleExports]);var goExports=requireGo();const go=getDefaultExportFromCjs(goExports),go$1=_mergeNamespaces({__proto__:null,default:go},[goExports]);var graphqlExports=requireGraphql();const graphql=getDefaultExportFromCjs(graphqlExports),graphql$1=_mergeNamespaces({__proto__:null,default:graphql},[graphqlExports]);var groovyExports=requireGroovy();const groovy=getDefaultExportFromCjs(groovyExports),groovy$1=_mergeNamespaces({__proto__:null,default:groovy},[groovyExports]);var hamlExports=requireHaml();const haml=getDefaultExportFromCjs(hamlExports),haml$1=_mergeNamespaces({__proto__:null,default:haml},[hamlExports]);var handlebarsExports=requireHandlebars();const handlebars=getDefaultExportFromCjs(handlebarsExports),handlebars$1=_mergeNamespaces({__proto__:null,default:handlebars},[handlebarsExports]);var haskellExports=requireHaskell();const haskell=getDefaultExportFromCjs(haskellExports),haskell$1=_mergeNamespaces({__proto__:null,default:haskell},[haskellExports]);var haxeExports=requireHaxe();const haxe=getDefaultExportFromCjs(haxeExports),haxe$1=_mergeNamespaces({__proto__:null,default:haxe},[haxeExports]);var hclExports=requireHcl();const hcl=getDefaultExportFromCjs(hclExports),hcl$1=_mergeNamespaces({__proto__:null,default:hcl},[hclExports]);var hlslExports=requireHlsl();const hlsl=getDefaultExportFromCjs(hlslExports),hlsl$1=_mergeNamespaces({__proto__:null,default:hlsl},[hlslExports]);var hoonExports=requireHoon();const hoon=getDefaultExportFromCjs(hoonExports),hoon$1=_mergeNamespaces({__proto__:null,default:hoon},[hoonExports]);var hpkpExports=requireHpkp();const hpkp=getDefaultExportFromCjs(hpkpExports),hpkp$1=_mergeNamespaces({__proto__:null,default:hpkp},[hpkpExports]);var hstsExports=requireHsts();const hsts=getDefaultExportFromCjs(hstsExports),hsts$1=_mergeNamespaces({__proto__:null,default:hsts},[hstsExports]);var httpExports=requireHttp();const http=getDefaultExportFromCjs(httpExports),http$1=_mergeNamespaces({__proto__:null,default:http},[httpExports]);var ichigojamExports=requireIchigojam();const ichigojam=getDefaultExportFromCjs(ichigojamExports),ichigojam$1=_mergeNamespaces({__proto__:null,default:ichigojam},[ichigojamExports]);var iconExports=requireIcon();const icon=getDefaultExportFromCjs(iconExports),icon$1=_mergeNamespaces({__proto__:null,default:icon},[iconExports]);var icuMessageFormatExports=requireIcuMessageFormat();const icuMessageFormat=getDefaultExportFromCjs(icuMessageFormatExports),icuMessageFormat$1=_mergeNamespaces({__proto__:null,default:icuMessageFormat},[icuMessageFormatExports]);var idrisExports=requireIdris();const idris=getDefaultExportFromCjs(idrisExports),idris$1=_mergeNamespaces({__proto__:null,default:idris},[idrisExports]);var iecstExports=requireIecst();const iecst=getDefaultExportFromCjs(iecstExports),iecst$1=_mergeNamespaces({__proto__:null,default:iecst},[iecstExports]);var ignoreExports=requireIgnore();const ignore=getDefaultExportFromCjs(ignoreExports),ignore$1=_mergeNamespaces({__proto__:null,default:ignore},[ignoreExports]);var inform7Exports=requireInform7();const inform7=getDefaultExportFromCjs(inform7Exports),inform7$1=_mergeNamespaces({__proto__:null,default:inform7},[inform7Exports]);var iniExports=requireIni();const ini=getDefaultExportFromCjs(iniExports),ini$1=_mergeNamespaces({__proto__:null,default:ini},[iniExports]);var ioExports=requireIo();const io=getDefaultExportFromCjs(ioExports),io$1=_mergeNamespaces({__proto__:null,default:io},[ioExports]);var jExports=requireJ();const j=getDefaultExportFromCjs(jExports),j$1=_mergeNamespaces({__proto__:null,default:j},[jExports]);var javaExports=requireJava();const java=getDefaultExportFromCjs(javaExports),java$1=_mergeNamespaces({__proto__:null,default:java},[javaExports]);var javadocExports=requireJavadoc();const javadoc=getDefaultExportFromCjs(javadocExports),javadoc$1=_mergeNamespaces({__proto__:null,default:javadoc},[javadocExports]);var javadoclikeExports=requireJavadoclike();const javadoclike=getDefaultExportFromCjs(javadoclikeExports),javadoclike$1=_mergeNamespaces({__proto__:null,default:javadoclike},[javadoclikeExports]);var javastacktraceExports=requireJavastacktrace();const javastacktrace=getDefaultExportFromCjs(javastacktraceExports),javastacktrace$1=_mergeNamespaces({__proto__:null,default:javastacktrace},[javastacktraceExports]);var jexlExports=requireJexl();const jexl=getDefaultExportFromCjs(jexlExports),jexl$1=_mergeNamespaces({__proto__:null,default:jexl},[jexlExports]);var jolieExports=requireJolie();const jolie=getDefaultExportFromCjs(jolieExports),jolie$1=_mergeNamespaces({__proto__:null,default:jolie},[jolieExports]);var jqExports=requireJq();const jq=getDefaultExportFromCjs(jqExports),jq$1=_mergeNamespaces({__proto__:null,default:jq},[jqExports]);var jsExtrasExports=requireJsExtras();const jsExtras=getDefaultExportFromCjs(jsExtrasExports),jsExtras$1=_mergeNamespaces({__proto__:null,default:jsExtras},[jsExtrasExports]);var jsTemplatesExports=requireJsTemplates();const jsTemplates=getDefaultExportFromCjs(jsTemplatesExports),jsTemplates$1=_mergeNamespaces({__proto__:null,default:jsTemplates},[jsTemplatesExports]);var jsdocExports=requireJsdoc();const jsdoc=getDefaultExportFromCjs(jsdocExports),jsdoc$1=_mergeNamespaces({__proto__:null,default:jsdoc},[jsdocExports]);var jsonExports=requireJson();const json=getDefaultExportFromCjs(jsonExports),json$1=_mergeNamespaces({__proto__:null,default:json},[jsonExports]);var json5Exports=requireJson5();const json5=getDefaultExportFromCjs(json5Exports),json5$1=_mergeNamespaces({__proto__:null,default:json5},[json5Exports]);var jsonpExports=requireJsonp();const jsonp=getDefaultExportFromCjs(jsonpExports),jsonp$1=_mergeNamespaces({__proto__:null,default:jsonp},[jsonpExports]);var jsstacktraceExports=requireJsstacktrace();const jsstacktrace=getDefaultExportFromCjs(jsstacktraceExports),jsstacktrace$1=_mergeNamespaces({__proto__:null,default:jsstacktrace},[jsstacktraceExports]);var jsxExports=requireJsx();const jsx=getDefaultExportFromCjs(jsxExports),jsx$1=_mergeNamespaces({__proto__:null,default:jsx},[jsxExports]);var juliaExports=requireJulia();const julia=getDefaultExportFromCjs(juliaExports),julia$1=_mergeNamespaces({__proto__:null,default:julia},[juliaExports]);var keepalivedExports=requireKeepalived();const keepalived=getDefaultExportFromCjs(keepalivedExports),keepalived$1=_mergeNamespaces({__proto__:null,default:keepalived},[keepalivedExports]);var keymanExports=requireKeyman();const keyman=getDefaultExportFromCjs(keymanExports),keyman$1=_mergeNamespaces({__proto__:null,default:keyman},[keymanExports]);var kotlinExports=requireKotlin();const kotlin=getDefaultExportFromCjs(kotlinExports),kotlin$1=_mergeNamespaces({__proto__:null,default:kotlin},[kotlinExports]);var kumirExports=requireKumir();const kumir=getDefaultExportFromCjs(kumirExports),kumir$1=_mergeNamespaces({__proto__:null,default:kumir},[kumirExports]);var kustoExports=requireKusto();const kusto=getDefaultExportFromCjs(kustoExports),kusto$1=_mergeNamespaces({__proto__:null,default:kusto},[kustoExports]);var latexExports=requireLatex();const latex=getDefaultExportFromCjs(latexExports),latex$1=_mergeNamespaces({__proto__:null,default:latex},[latexExports]);var latteExports=requireLatte();const latte=getDefaultExportFromCjs(latteExports),latte$1=_mergeNamespaces({__proto__:null,default:latte},[latteExports]);var lessExports=requireLess();const less=getDefaultExportFromCjs(lessExports),less$1=_mergeNamespaces({__proto__:null,default:less},[lessExports]);var lilypondExports=requireLilypond();const lilypond=getDefaultExportFromCjs(lilypondExports),lilypond$1=_mergeNamespaces({__proto__:null,default:lilypond},[lilypondExports]);var liquidExports=requireLiquid();const liquid=getDefaultExportFromCjs(liquidExports),liquid$1=_mergeNamespaces({__proto__:null,default:liquid},[liquidExports]);var lispExports=requireLisp();const lisp=getDefaultExportFromCjs(lispExports),lisp$1=_mergeNamespaces({__proto__:null,default:lisp},[lispExports]);var livescriptExports=requireLivescript();const livescript=getDefaultExportFromCjs(livescriptExports),livescript$1=_mergeNamespaces({__proto__:null,default:livescript},[livescriptExports]);var llvmExports=requireLlvm();const llvm=getDefaultExportFromCjs(llvmExports),llvm$1=_mergeNamespaces({__proto__:null,default:llvm},[llvmExports]);var logExports=requireLog();const log=getDefaultExportFromCjs(logExports),log$1=_mergeNamespaces({__proto__:null,default:log},[logExports]);var lolcodeExports=requireLolcode();const lolcode=getDefaultExportFromCjs(lolcodeExports),lolcode$1=_mergeNamespaces({__proto__:null,default:lolcode},[lolcodeExports]);var luaExports=requireLua();const lua=getDefaultExportFromCjs(luaExports),lua$1=_mergeNamespaces({__proto__:null,default:lua},[luaExports]);var magmaExports=requireMagma();const magma=getDefaultExportFromCjs(magmaExports),magma$1=_mergeNamespaces({__proto__:null,default:magma},[magmaExports]);var makefileExports=requireMakefile();const makefile=getDefaultExportFromCjs(makefileExports),makefile$1=_mergeNamespaces({__proto__:null,default:makefile},[makefileExports]);var markdownExports=requireMarkdown();const markdown=getDefaultExportFromCjs(markdownExports),markdown$1=_mergeNamespaces({__proto__:null,default:markdown},[markdownExports]);var markupTemplatingExports=requireMarkupTemplating();const markupTemplating=getDefaultExportFromCjs(markupTemplatingExports),markupTemplating$1=_mergeNamespaces({__proto__:null,default:markupTemplating},[markupTemplatingExports]);var matlabExports=requireMatlab();const matlab=getDefaultExportFromCjs(matlabExports),matlab$1=_mergeNamespaces({__proto__:null,default:matlab},[matlabExports]);var maxscriptExports=requireMaxscript();const maxscript=getDefaultExportFromCjs(maxscriptExports),maxscript$1=_mergeNamespaces({__proto__:null,default:maxscript},[maxscriptExports]);var melExports=requireMel();const mel=getDefaultExportFromCjs(melExports),mel$1=_mergeNamespaces({__proto__:null,default:mel},[melExports]);var mermaidExports=requireMermaid();const mermaid=getDefaultExportFromCjs(mermaidExports),mermaid$1=_mergeNamespaces({__proto__:null,default:mermaid},[mermaidExports]);var mizarExports=requireMizar();const mizar=getDefaultExportFromCjs(mizarExports),mizar$1=_mergeNamespaces({__proto__:null,default:mizar},[mizarExports]);var mongodbExports=requireMongodb();const mongodb=getDefaultExportFromCjs(mongodbExports),mongodb$1=_mergeNamespaces({__proto__:null,default:mongodb},[mongodbExports]);var monkeyExports=requireMonkey();const monkey=getDefaultExportFromCjs(monkeyExports),monkey$1=_mergeNamespaces({__proto__:null,default:monkey},[monkeyExports]);var moonscriptExports=requireMoonscript();const moonscript=getDefaultExportFromCjs(moonscriptExports),moonscript$1=_mergeNamespaces({__proto__:null,default:moonscript},[moonscriptExports]);var n1qlExports=requireN1ql();const n1ql=getDefaultExportFromCjs(n1qlExports),n1ql$1=_mergeNamespaces({__proto__:null,default:n1ql},[n1qlExports]);var n4jsExports=requireN4js();const n4js=getDefaultExportFromCjs(n4jsExports),n4js$1=_mergeNamespaces({__proto__:null,default:n4js},[n4jsExports]);var nand2tetrisHdlExports=requireNand2tetrisHdl();const nand2tetrisHdl=getDefaultExportFromCjs(nand2tetrisHdlExports),nand2tetrisHdl$1=_mergeNamespaces({__proto__:null,default:nand2tetrisHdl},[nand2tetrisHdlExports]);var naniscriptExports=requireNaniscript();const naniscript=getDefaultExportFromCjs(naniscriptExports),naniscript$1=_mergeNamespaces({__proto__:null,default:naniscript},[naniscriptExports]);var nasmExports=requireNasm();const nasm=getDefaultExportFromCjs(nasmExports),nasm$1=_mergeNamespaces({__proto__:null,default:nasm},[nasmExports]);var neonExports=requireNeon();const neon=getDefaultExportFromCjs(neonExports),neon$1=_mergeNamespaces({__proto__:null,default:neon},[neonExports]);var nevodExports=requireNevod();const nevod=getDefaultExportFromCjs(nevodExports),nevod$1=_mergeNamespaces({__proto__:null,default:nevod},[nevodExports]);var nginxExports=requireNginx();const nginx=getDefaultExportFromCjs(nginxExports),nginx$1=_mergeNamespaces({__proto__:null,default:nginx},[nginxExports]);var nimExports=requireNim();const nim=getDefaultExportFromCjs(nimExports),nim$1=_mergeNamespaces({__proto__:null,default:nim},[nimExports]);var nixExports=requireNix();const nix=getDefaultExportFromCjs(nixExports),nix$1=_mergeNamespaces({__proto__:null,default:nix},[nixExports]);var nsisExports=requireNsis();const nsis=getDefaultExportFromCjs(nsisExports),nsis$1=_mergeNamespaces({__proto__:null,default:nsis},[nsisExports]);var objectivecExports=requireObjectivec();const objectivec=getDefaultExportFromCjs(objectivecExports),objectivec$1=_mergeNamespaces({__proto__:null,default:objectivec},[objectivecExports]);var ocamlExports=requireOcaml();const ocaml=getDefaultExportFromCjs(ocamlExports),ocaml$1=_mergeNamespaces({__proto__:null,default:ocaml},[ocamlExports]);var openclExports=requireOpencl();const opencl=getDefaultExportFromCjs(openclExports),opencl$1=_mergeNamespaces({__proto__:null,default:opencl},[openclExports]);var openqasmExports=requireOpenqasm();const openqasm=getDefaultExportFromCjs(openqasmExports),openqasm$1=_mergeNamespaces({__proto__:null,default:openqasm},[openqasmExports]);var ozExports=requireOz();const oz=getDefaultExportFromCjs(ozExports),oz$1=_mergeNamespaces({__proto__:null,default:oz},[ozExports]);var parigpExports=requireParigp();const parigp=getDefaultExportFromCjs(parigpExports),parigp$1=_mergeNamespaces({__proto__:null,default:parigp},[parigpExports]);var parserExports=requireParser();const parser=getDefaultExportFromCjs(parserExports),parser$1=_mergeNamespaces({__proto__:null,default:parser},[parserExports]);var pascalExports=requirePascal();const pascal=getDefaultExportFromCjs(pascalExports),pascal$1=_mergeNamespaces({__proto__:null,default:pascal},[pascalExports]);var pascaligoExports=requirePascaligo();const pascaligo=getDefaultExportFromCjs(pascaligoExports),pascaligo$1=_mergeNamespaces({__proto__:null,default:pascaligo},[pascaligoExports]);var pcaxisExports=requirePcaxis();const pcaxis=getDefaultExportFromCjs(pcaxisExports),pcaxis$1=_mergeNamespaces({__proto__:null,default:pcaxis},[pcaxisExports]);var peoplecodeExports=requirePeoplecode();const peoplecode=getDefaultExportFromCjs(peoplecodeExports),peoplecode$1=_mergeNamespaces({__proto__:null,default:peoplecode},[peoplecodeExports]);var perlExports=requirePerl();const perl=getDefaultExportFromCjs(perlExports),perl$1=_mergeNamespaces({__proto__:null,default:perl},[perlExports]);var phpExtrasExports=requirePhpExtras();const phpExtras=getDefaultExportFromCjs(phpExtrasExports),phpExtras$1=_mergeNamespaces({__proto__:null,default:phpExtras},[phpExtrasExports]);var phpExports=requirePhp();const php=getDefaultExportFromCjs(phpExports),php$1=_mergeNamespaces({__proto__:null,default:php},[phpExports]);var phpdocExports=requirePhpdoc();const phpdoc=getDefaultExportFromCjs(phpdocExports),phpdoc$1=_mergeNamespaces({__proto__:null,default:phpdoc},[phpdocExports]);var plsqlExports=requirePlsql();const plsql=getDefaultExportFromCjs(plsqlExports),plsql$1=_mergeNamespaces({__proto__:null,default:plsql},[plsqlExports]);var powerqueryExports=requirePowerquery();const powerquery=getDefaultExportFromCjs(powerqueryExports),powerquery$1=_mergeNamespaces({__proto__:null,default:powerquery},[powerqueryExports]);var powershellExports=requirePowershell();const powershell=getDefaultExportFromCjs(powershellExports),powershell$1=_mergeNamespaces({__proto__:null,default:powershell},[powershellExports]);var processingExports=requireProcessing();const processing=getDefaultExportFromCjs(processingExports),processing$1=_mergeNamespaces({__proto__:null,default:processing},[processingExports]);var prologExports=requireProlog();const prolog=getDefaultExportFromCjs(prologExports),prolog$1=_mergeNamespaces({__proto__:null,default:prolog},[prologExports]);var promqlExports=requirePromql();const promql=getDefaultExportFromCjs(promqlExports),promql$1=_mergeNamespaces({__proto__:null,default:promql},[promqlExports]);var propertiesExports=requireProperties();const properties=getDefaultExportFromCjs(propertiesExports),properties$1=_mergeNamespaces({__proto__:null,default:properties},[propertiesExports]);var protobufExports=requireProtobuf();const protobuf=getDefaultExportFromCjs(protobufExports),protobuf$1=_mergeNamespaces({__proto__:null,default:protobuf},[protobufExports]);var pslExports=requirePsl();const psl=getDefaultExportFromCjs(pslExports),psl$1=_mergeNamespaces({__proto__:null,default:psl},[pslExports]);var pugExports=requirePug();const pug=getDefaultExportFromCjs(pugExports),pug$1=_mergeNamespaces({__proto__:null,default:pug},[pugExports]);var puppetExports=requirePuppet();const puppet=getDefaultExportFromCjs(puppetExports),puppet$1=_mergeNamespaces({__proto__:null,default:puppet},[puppetExports]);var pureExports=requirePure();const pure=getDefaultExportFromCjs(pureExports),pure$1=_mergeNamespaces({__proto__:null,default:pure},[pureExports]);var purebasicExports=requirePurebasic();const purebasic=getDefaultExportFromCjs(purebasicExports),purebasic$1=_mergeNamespaces({__proto__:null,default:purebasic},[purebasicExports]);var purescriptExports=requirePurescript();const purescript=getDefaultExportFromCjs(purescriptExports),purescript$1=_mergeNamespaces({__proto__:null,default:purescript},[purescriptExports]);var pythonExports=requirePython();const python=getDefaultExportFromCjs(pythonExports),python$1=_mergeNamespaces({__proto__:null,default:python},[pythonExports]);var qExports=requireQ();const q=getDefaultExportFromCjs(qExports),q$1=_mergeNamespaces({__proto__:null,default:q},[qExports]);var qmlExports=requireQml();const qml=getDefaultExportFromCjs(qmlExports),qml$1=_mergeNamespaces({__proto__:null,default:qml},[qmlExports]);var qoreExports=requireQore();const qore=getDefaultExportFromCjs(qoreExports),qore$1=_mergeNamespaces({__proto__:null,default:qore},[qoreExports]);var qsharpExports=requireQsharp();const qsharp=getDefaultExportFromCjs(qsharpExports),qsharp$1=_mergeNamespaces({__proto__:null,default:qsharp},[qsharpExports]);var rExports=requireR();const r=getDefaultExportFromCjs(rExports),r$1=_mergeNamespaces({__proto__:null,default:r},[rExports]);var racketExports=requireRacket();const racket=getDefaultExportFromCjs(racketExports),racket$1=_mergeNamespaces({__proto__:null,default:racket},[racketExports]);var reasonExports=requireReason();const reason=getDefaultExportFromCjs(reasonExports),reason$1=_mergeNamespaces({__proto__:null,default:reason},[reasonExports]);var regexExports=requireRegex();const regex=getDefaultExportFromCjs(regexExports),regex$1=_mergeNamespaces({__proto__:null,default:regex},[regexExports]);var regoExports=requireRego();const rego=getDefaultExportFromCjs(regoExports),rego$1=_mergeNamespaces({__proto__:null,default:rego},[regoExports]);var renpyExports=requireRenpy();const renpy=getDefaultExportFromCjs(renpyExports),renpy$1=_mergeNamespaces({__proto__:null,default:renpy},[renpyExports]);var restExports=requireRest();const rest=getDefaultExportFromCjs(restExports),rest$1=_mergeNamespaces({__proto__:null,default:rest},[restExports]);var ripExports=requireRip();const rip=getDefaultExportFromCjs(ripExports),rip$1=_mergeNamespaces({__proto__:null,default:rip},[ripExports]);var roboconfExports=requireRoboconf();const roboconf=getDefaultExportFromCjs(roboconfExports),roboconf$1=_mergeNamespaces({__proto__:null,default:roboconf},[roboconfExports]);var robotframeworkExports=requireRobotframework();const robotframework=getDefaultExportFromCjs(robotframeworkExports),robotframework$1=_mergeNamespaces({__proto__:null,default:robotframework},[robotframeworkExports]);var rubyExports=requireRuby();const ruby=getDefaultExportFromCjs(rubyExports),ruby$1=_mergeNamespaces({__proto__:null,default:ruby},[rubyExports]);var rustExports=requireRust();const rust=getDefaultExportFromCjs(rustExports),rust$1=_mergeNamespaces({__proto__:null,default:rust},[rustExports]);var sasExports=requireSas();const sas=getDefaultExportFromCjs(sasExports),sas$1=_mergeNamespaces({__proto__:null,default:sas},[sasExports]);var sassExports=requireSass();const sass=getDefaultExportFromCjs(sassExports),sass$1=_mergeNamespaces({__proto__:null,default:sass},[sassExports]);var scalaExports=requireScala();const scala=getDefaultExportFromCjs(scalaExports),scala$1=_mergeNamespaces({__proto__:null,default:scala},[scalaExports]);var schemeExports=requireScheme();const scheme=getDefaultExportFromCjs(schemeExports),scheme$1=_mergeNamespaces({__proto__:null,default:scheme},[schemeExports]);var scssExports=requireScss();const scss=getDefaultExportFromCjs(scssExports),scss$1=_mergeNamespaces({__proto__:null,default:scss},[scssExports]);var shellSessionExports=requireShellSession();const shellSession=getDefaultExportFromCjs(shellSessionExports),shellSession$1=_mergeNamespaces({__proto__:null,default:shellSession},[shellSessionExports]);var smaliExports=requireSmali();const smali=getDefaultExportFromCjs(smaliExports),smali$1=_mergeNamespaces({__proto__:null,default:smali},[smaliExports]);var smalltalkExports=requireSmalltalk();const smalltalk=getDefaultExportFromCjs(smalltalkExports),smalltalk$1=_mergeNamespaces({__proto__:null,default:smalltalk},[smalltalkExports]);var smartyExports=requireSmarty();const smarty=getDefaultExportFromCjs(smartyExports),smarty$1=_mergeNamespaces({__proto__:null,default:smarty},[smartyExports]);var smlExports=requireSml();const sml=getDefaultExportFromCjs(smlExports),sml$1=_mergeNamespaces({__proto__:null,default:sml},[smlExports]);var solidityExports=requireSolidity();const solidity=getDefaultExportFromCjs(solidityExports),solidity$1=_mergeNamespaces({__proto__:null,default:solidity},[solidityExports]);var solutionFileExports=requireSolutionFile();const solutionFile=getDefaultExportFromCjs(solutionFileExports),solutionFile$1=_mergeNamespaces({__proto__:null,default:solutionFile},[solutionFileExports]);var soyExports=requireSoy();const soy=getDefaultExportFromCjs(soyExports),soy$1=_mergeNamespaces({__proto__:null,default:soy},[soyExports]);var sparqlExports=requireSparql();const sparql=getDefaultExportFromCjs(sparqlExports),sparql$1=_mergeNamespaces({__proto__:null,default:sparql},[sparqlExports]);var splunkSplExports=requireSplunkSpl();const splunkSpl=getDefaultExportFromCjs(splunkSplExports),splunkSpl$1=_mergeNamespaces({__proto__:null,default:splunkSpl},[splunkSplExports]);var sqfExports=requireSqf();const sqf=getDefaultExportFromCjs(sqfExports),sqf$1=_mergeNamespaces({__proto__:null,default:sqf},[sqfExports]);var sqlExports=requireSql();const sql=getDefaultExportFromCjs(sqlExports),sql$1=_mergeNamespaces({__proto__:null,default:sql},[sqlExports]);var squirrelExports=requireSquirrel();const squirrel=getDefaultExportFromCjs(squirrelExports),squirrel$1=_mergeNamespaces({__proto__:null,default:squirrel},[squirrelExports]);var stanExports=requireStan();const stan=getDefaultExportFromCjs(stanExports),stan$1=_mergeNamespaces({__proto__:null,default:stan},[stanExports]);var stylusExports=requireStylus();const stylus=getDefaultExportFromCjs(stylusExports),stylus$1=_mergeNamespaces({__proto__:null,default:stylus},[stylusExports]);var swiftExports=requireSwift();const swift=getDefaultExportFromCjs(swiftExports),swift$1=_mergeNamespaces({__proto__:null,default:swift},[swiftExports]);var systemdExports=requireSystemd();const systemd=getDefaultExportFromCjs(systemdExports),systemd$1=_mergeNamespaces({__proto__:null,default:systemd},[systemdExports]);var t4CsExports=requireT4Cs();const t4Cs=getDefaultExportFromCjs(t4CsExports),t4Cs$1=_mergeNamespaces({__proto__:null,default:t4Cs},[t4CsExports]);var t4TemplatingExports=requireT4Templating();const t4Templating=getDefaultExportFromCjs(t4TemplatingExports),t4Templating$1=_mergeNamespaces({__proto__:null,default:t4Templating},[t4TemplatingExports]);var t4VbExports=requireT4Vb();const t4Vb=getDefaultExportFromCjs(t4VbExports),t4Vb$1=_mergeNamespaces({__proto__:null,default:t4Vb},[t4VbExports]);var tapExports=requireTap();const tap=getDefaultExportFromCjs(tapExports),tap$1=_mergeNamespaces({__proto__:null,default:tap},[tapExports]);var tclExports=requireTcl();const tcl=getDefaultExportFromCjs(tclExports),tcl$1=_mergeNamespaces({__proto__:null,default:tcl},[tclExports]);var textileExports=requireTextile();const textile=getDefaultExportFromCjs(textileExports),textile$1=_mergeNamespaces({__proto__:null,default:textile},[textileExports]);var tomlExports=requireToml();const toml=getDefaultExportFromCjs(tomlExports),toml$1=_mergeNamespaces({__proto__:null,default:toml},[tomlExports]);var tremorExports=requireTremor();const tremor=getDefaultExportFromCjs(tremorExports),tremor$1=_mergeNamespaces({__proto__:null,default:tremor},[tremorExports]);var tsxExports=requireTsx();const tsx=getDefaultExportFromCjs(tsxExports),tsx$1=_mergeNamespaces({__proto__:null,default:tsx},[tsxExports]);var tt2Exports=requireTt2();const tt2=getDefaultExportFromCjs(tt2Exports),tt2$1=_mergeNamespaces({__proto__:null,default:tt2},[tt2Exports]);var turtleExports=requireTurtle();const turtle=getDefaultExportFromCjs(turtleExports),turtle$1=_mergeNamespaces({__proto__:null,default:turtle},[turtleExports]);var twigExports=requireTwig();const twig=getDefaultExportFromCjs(twigExports),twig$1=_mergeNamespaces({__proto__:null,default:twig},[twigExports]);var typescriptExports=requireTypescript();const typescript=getDefaultExportFromCjs(typescriptExports),typescript$1=_mergeNamespaces({__proto__:null,default:typescript},[typescriptExports]);var typoscriptExports=requireTyposcript();const typoscript=getDefaultExportFromCjs(typoscriptExports),typoscript$1=_mergeNamespaces({__proto__:null,default:typoscript},[typoscriptExports]);var unrealscriptExports=requireUnrealscript();const unrealscript=getDefaultExportFromCjs(unrealscriptExports),unrealscript$1=_mergeNamespaces({__proto__:null,default:unrealscript},[unrealscriptExports]);var uorazorExports=requireUorazor();const uorazor=getDefaultExportFromCjs(uorazorExports),uorazor$1=_mergeNamespaces({__proto__:null,default:uorazor},[uorazorExports]);var uriExports=requireUri();const uri=getDefaultExportFromCjs(uriExports),uri$1=_mergeNamespaces({__proto__:null,default:uri},[uriExports]);var vExports=requireV();const v=getDefaultExportFromCjs(vExports),v$1=_mergeNamespaces({__proto__:null,default:v},[vExports]);var valaExports=requireVala();const vala=getDefaultExportFromCjs(valaExports),vala$1=_mergeNamespaces({__proto__:null,default:vala},[valaExports]);var vbnetExports=requireVbnet();const vbnet=getDefaultExportFromCjs(vbnetExports),vbnet$1=_mergeNamespaces({__proto__:null,default:vbnet},[vbnetExports]);var velocityExports=requireVelocity();const velocity=getDefaultExportFromCjs(velocityExports),velocity$1=_mergeNamespaces({__proto__:null,default:velocity},[velocityExports]);var verilogExports=requireVerilog();const verilog=getDefaultExportFromCjs(verilogExports),verilog$1=_mergeNamespaces({__proto__:null,default:verilog},[verilogExports]);var vhdlExports=requireVhdl();const vhdl=getDefaultExportFromCjs(vhdlExports),vhdl$1=_mergeNamespaces({__proto__:null,default:vhdl},[vhdlExports]);var vimExports=requireVim();const vim=getDefaultExportFromCjs(vimExports),vim$1=_mergeNamespaces({__proto__:null,default:vim},[vimExports]);var visualBasicExports=requireVisualBasic();const visualBasic=getDefaultExportFromCjs(visualBasicExports),visualBasic$1=_mergeNamespaces({__proto__:null,default:visualBasic},[visualBasicExports]);var warpscriptExports=requireWarpscript();const warpscript=getDefaultExportFromCjs(warpscriptExports),warpscript$1=_mergeNamespaces({__proto__:null,default:warpscript},[warpscriptExports]);var wasmExports=requireWasm();const wasm=getDefaultExportFromCjs(wasmExports),wasm$1=_mergeNamespaces({__proto__:null,default:wasm},[wasmExports]);var webIdlExports=requireWebIdl();const webIdl=getDefaultExportFromCjs(webIdlExports),webIdl$1=_mergeNamespaces({__proto__:null,default:webIdl},[webIdlExports]);var wikiExports=requireWiki();const wiki=getDefaultExportFromCjs(wikiExports),wiki$1=_mergeNamespaces({__proto__:null,default:wiki},[wikiExports]);var wolframExports=requireWolfram();const wolfram=getDefaultExportFromCjs(wolframExports),wolfram$1=_mergeNamespaces({__proto__:null,default:wolfram},[wolframExports]);var wrenExports=requireWren();const wren=getDefaultExportFromCjs(wrenExports),wren$1=_mergeNamespaces({__proto__:null,default:wren},[wrenExports]);var xeoraExports=requireXeora();const xeora=getDefaultExportFromCjs(xeoraExports),xeora$1=_mergeNamespaces({__proto__:null,default:xeora},[xeoraExports]);var xmlDocExports=requireXmlDoc();const xmlDoc=getDefaultExportFromCjs(xmlDocExports),xmlDoc$1=_mergeNamespaces({__proto__:null,default:xmlDoc},[xmlDocExports]);var xojoExports=requireXojo();const xojo=getDefaultExportFromCjs(xojoExports),xojo$1=_mergeNamespaces({__proto__:null,default:xojo},[xojoExports]);var xqueryExports=requireXquery();const xquery=getDefaultExportFromCjs(xqueryExports),xquery$1=_mergeNamespaces({__proto__:null,default:xquery},[xqueryExports]);var yamlExports=requireYaml();const yaml=getDefaultExportFromCjs(yamlExports),yaml$1=_mergeNamespaces({__proto__:null,default:yaml},[yamlExports]);var yangExports=requireYang();const yang=getDefaultExportFromCjs(yangExports),yang$1=_mergeNamespaces({__proto__:null,default:yang},[yangExports]);var zigExports=requireZig();const zig=getDefaultExportFromCjs(zigExports),zig$1=_mergeNamespaces({__proto__:null,default:zig},[zigExports]);exports.KnowledgeCard=VideoKnowledgeCard,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})});
|
|
Binary file
|
package/dist/types/index.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@oscloudlab/knowledge-card",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.8",
|
|
5
5
|
"description": "A beautiful and customizable knowledge card component for React",
|
|
6
6
|
"main": "./dist/knowledge-card.umd.js",
|
|
7
7
|
"module": "./dist/knowledge-card.es.js",
|