var $e=Object.defineProperty,qe=Object.defineProperties;var We=Object.getOwnPropertyDescriptors;var ve=Object.getOwnPropertySymbols;var Ve=Object.prototype.hasOwnProperty,Ue=Object.prototype.propertyIsEnumerable;var me=(y,H,i)=>H in y?$e(y,H,{enumerable:!0,configurable:!0,writable:!0,value:i}):y[H]=i,be=(y,H)=>{for(var i in H||(H={}))Ve.call(H,i)&&me(y,i,H[i]);if(ve)for(var i of ve(H))Ue.call(H,i)&&me(y,i,H[i]);return y},ye=(y,H)=>qe(y,We(H));import{d as De,f as $,r as Ge,e as xe,w as ae,o as ze,u as ke,aI as Ke,ag as Me,aq as Je,ar as we,aE as Ae,aB as Xe,ah as Ye,at as Qe}from"./vue-vendor-Be68asQ6.js";import{D as Ze,F as et,a9 as tt,ay as nt,az as it,H as B,a as rt}from"./index-BFfnEkVs.js";import{useRuleFormItem as ot}from"./useFormItem-CtGMPcLp.js";import{r as I,C as st}from"./htmlmixed-DNSd26j0.js";import"./vue-DbzutmLn.js";/* empty css */import{a as Tt}from"./antd-vue-vendor-DcqS7Wvq.js";import"./vxe-table-vendor-DHF2TRpV.js";var q={exports:{}},St=q.exports,Le;function Be(){return Le||(Le=1,function(y,H){(function(i){i(I())})(function(i){"use strict";function A(f,c,r,l){if(r&&r.call){var p=r;r=null}else var p=g(f,r,"rangeFinder");typeof c=="number"&&(c=i.Pos(c,0));var s=g(f,r,"minFoldSize");function d(e){var n=p(f,c);if(!n||n.to.line-n.from.linef.firstLine();)c=i.Pos(c.line-1,0),h=d(!1);if(!(!h||h.cleared||l==="unfold")){var x=b(f,r,h);i.on(x,"mousedown",function(e){o.clear(),i.e_preventDefault(e)});var o=f.markText(h.from,h.to,{replacedWith:x,clearOnEnter:g(f,r,"clearOnEnter"),__isFold:!0});o.on("clear",function(e,n){i.signal(f,"unfold",f,e,n)}),i.signal(f,"fold",f,h.from,h.to)}}function b(f,c,r){var l=g(f,c,"widget");if(typeof l=="function"&&(l=l(r.from,r.to)),typeof l=="string"){var p=document.createTextNode(l);l=document.createElement("span"),l.appendChild(p),l.className="CodeMirror-foldmarker"}else l&&(l=l.cloneNode(!0));return l}i.newFoldFunction=function(f,c){return function(r,l){A(r,l,{rangeFinder:f,widget:c})}},i.defineExtension("foldCode",function(f,c,r){A(this,f,c,r)}),i.defineExtension("isFolded",function(f){for(var c=this.findMarksAt(f),r=0;rb.lastLine())return null;var d=b.getTokenAt(i.Pos(s,1));if(/\S/.test(d.string)||(d=b.getTokenAt(i.Pos(s,d.end+1))),d.type!="keyword"||d.string!="import")return null;for(var h=s,x=Math.min(b.lastLine(),s+10);h<=x;++h){var o=b.getLine(h),e=o.indexOf(";");if(e!=-1)return{startCh:d.end,end:i.Pos(h,e)}}}var f=w.line,c=g(f),r;if(!c||g(f-1)||(r=g(f-2))&&r.end.line==f-1)return null;for(var l=c.end;;){var p=g(l.line+1);if(p==null)break;l=p.end}return{from:b.clipPos(i.Pos(f,c.startCh+1)),to:l}}),i.registerHelper("fold","include",function(b,w){function g(p){if(pb.lastLine())return null;var s=b.getTokenAt(i.Pos(p,1));if(/\S/.test(s.string)||(s=b.getTokenAt(i.Pos(p,s.end+1))),s.type=="meta"&&s.string.slice(0,8)=="#include")return s.start+8}var f=w.line,c=g(f);if(c==null||g(f-1)!=null)return null;for(var r=f;;){var l=g(r+1);if(l==null)break;++r}return{from:i.Pos(f,c+1),to:b.clipPos(i.Pos(r))}})})}(W,W.exports)),W.exports}var Et=at();var V={exports:{}},Pt=V.exports,Te;function lt(){return Te||(Te=1,function(y,H){(function(i){i(I())})(function(i){"use strict";i.registerGlobalHelper("fold","comment",function(A){return A.blockCommentStart&&A.blockCommentEnd},function(A,b){var w=A.getModeAt(b),g=w.blockCommentStart,f=w.blockCommentEnd;if(!(!g||!f)){for(var c=b.line,r=A.getLine(c),l,p=b.ch,s=0;;){var d=p<=0?-1:r.lastIndexOf(g,p-1);if(d==-1){if(s==1)return;s=1,p=r.length;continue}if(s==1&&dg)f=c;else break}if(f)return{from:i.Pos(w.line,b.getLine(w.line).length),to:i.Pos(f,b.getLine(f).length)}}})})}(U,U.exports)),U.exports}var Rt=ft();var D={exports:{}},Bt=D.exports,Se;function ut(){return Se||(Se=1,function(y,H){(function(i){i(I(),Be())})(function(i){"use strict";i.defineOption("foldGutter",!1,function(o,e,n){n&&n!=i.Init&&(o.clearGutter(o.state.foldGutter.options.gutter),o.state.foldGutter=null,o.off("gutterClick",p),o.off("changes",d),o.off("viewportChange",h),o.off("fold",x),o.off("unfold",x),o.off("swapDoc",d),o.off("optionChange",s)),e&&(o.state.foldGutter=new b(w(e)),l(o),o.on("gutterClick",p),o.on("changes",d),o.on("viewportChange",h),o.on("fold",x),o.on("unfold",x),o.on("swapDoc",d),o.on("optionChange",s))});var A=i.Pos;function b(o){this.options=o,this.from=this.to=0}function w(o){return o===!0&&(o={}),o.gutter==null&&(o.gutter="CodeMirror-foldgutter"),o.indicatorOpen==null&&(o.indicatorOpen="CodeMirror-foldgutter-open"),o.indicatorFolded==null&&(o.indicatorFolded="CodeMirror-foldgutter-folded"),o}function g(o,e){for(var n=o.findMarks(A(e,0),A(e+1,0)),t=0;t=u){if(L&&T&&L.test(T.className))return;S=f(t.indicatorOpen)}}!S&&!T||o.setGutterMarker(F,t.gutter,S)})}function r(o){return new RegExp("(^|\\s)"+o+"(?:$|\\s)\\s*")}function l(o){var e=o.getViewport(),n=o.state.foldGutter;n&&(o.operation(function(){c(o,e.from,e.to)}),n.from=e.from,n.to=e.to)}function p(o,e,n){var t=o.state.foldGutter;if(t){var a=t.options;if(n==a.gutter){var u=g(o,e);u?u.clear():o.foldCode(A(e,0),a)}}}function s(o,e){e=="mode"&&d(o)}function d(o){var e=o.state.foldGutter;if(e){var n=e.options;e.from=e.to=0,clearTimeout(e.changeUpdate),e.changeUpdate=setTimeout(function(){l(o)},n.foldOnChangeTimeSpan||600)}}function h(o){var e=o.state.foldGutter;if(e){var n=e.options;clearTimeout(e.changeUpdate),e.changeUpdate=setTimeout(function(){var t=o.getViewport();e.from==e.to||t.from-e.to>20||e.from-t.to>20?l(o):o.operation(function(){t.frome.to&&(c(o,e.to,t.to),e.to=t.to)})},n.updateViewportTimeSpan||400)}}function x(o,e){var n=o.state.foldGutter;if(n){var t=e.line;t>=n.from&&t1)){if(this.somethingSelected()){if(!e.hint.supportsSelection)return;for(var t=0;tv.clientHeight+1:!1,_;setTimeout(function(){_=a.getScrollInfo()});var _e=P.bottom-ie;if(_e>0){var re=P.bottom-P.top,oe=P.top-(j.bottom-j.top)-2;ie-P.topoe&&(v.style.height=(re=oe)+"px"),v.style.top=(Z=j.top-re)+te+"px",fe=!1):v.style.height=ie-P.top-2+"px"}var Y=P.right-X;if(de&&(Y+=a.display.nativeBarWidth),Y>0&&(P.right-P.left>X&&(v.style.width=X-5+"px",Y-=P.right-P.left-X),v.style.left=(N=Math.max(j.left-Y-ee,0))+"px"),de)for(var Q=v.firstChild;Q;Q=Q.nextSibling)Q.style.paddingRight=a.display.nativeBarWidth+"px";if(a.addKeyMap(this.keyMap=l(e,{moveFocus:function(C,E){t.changeActive(t.selectedHint+C,E)},setFocus:function(C){t.changeActive(C)},menuSize:function(){return t.screenAmount()},length:F.length,close:function(){e.close()},pick:function(){t.pick()},data:n})),e.options.closeOnUnfocus){var he;a.on("blur",this.onBlur=function(){he=setTimeout(function(){e.close()},100)}),a.on("focus",this.onFocus=function(){clearTimeout(he)})}a.on("scroll",this.onScroll=function(){var C=a.getScrollInfo(),E=a.getWrapperElement().getBoundingClientRect();_||(_=a.getScrollInfo());var ge=Z+_.top-C.top,se=ge-(m.pageYOffset||(u.documentElement||u.body).scrollTop);if(fe||(se+=v.offsetHeight),se<=E.top||se>=E.bottom)return e.close();v.style.top=ge+"px",v.style.left=N+_.left-C.left+"px"}),i.on(v,"dblclick",function(C){var E=p(v,C.target||C.srcElement);E&&E.hintId!=null&&(t.changeActive(E.hintId),t.pick())}),i.on(v,"click",function(C){var E=p(v,C.target||C.srcElement);E&&E.hintId!=null&&(t.changeActive(E.hintId),e.options.completeOnSingleClick&&t.pick())}),i.on(v,"mousedown",function(){setTimeout(function(){a.focus()},20)});var pe=this.getSelectedHintRange();return(pe.from!==0||pe.to!==0)&&this.scrollToActive(),i.signal(n,"select",F[this.selectedHint],v.childNodes[this.selectedHint]),!0}s.prototype={close:function(){if(this.completion.widget==this){this.completion.widget=null,this.hints.parentNode&&this.hints.parentNode.removeChild(this.hints),this.completion.cm.removeKeyMap(this.keyMap);var e=this.completion.cm.getInputField();e.removeAttribute("aria-activedescendant"),e.removeAttribute("aria-owns");var n=this.completion.cm;this.completion.options.closeOnUnfocus&&(n.off("blur",this.onBlur),n.off("focus",this.onFocus)),n.off("scroll",this.onScroll)}},disable:function(){this.completion.cm.removeKeyMap(this.keyMap);var e=this;this.keyMap={Enter:function(){e.picked=!0}},this.completion.cm.addKeyMap(this.keyMap)},pick:function(){this.completion.pick(this.data,this.selectedHint)},changeActive:function(e,n){if(e>=this.data.list.length?e=n?this.data.list.length-1:0:e<0&&(e=n?0:this.data.list.length-1),this.selectedHint!=e){var t=this.hints.childNodes[this.selectedHint];t&&(t.className=t.className.replace(" "+b,""),t.removeAttribute("aria-selected")),t=this.hints.childNodes[this.selectedHint=e],t.className+=" "+b,t.setAttribute("aria-selected","true"),this.completion.cm.getInputField().setAttribute("aria-activedescendant",t.id),this.scrollToActive(),i.signal(this.data,"select",this.data.list[this.selectedHint],t)}},scrollToActive:function(){var e=this.getSelectedHintRange(),n=this.hints.childNodes[e.from],t=this.hints.childNodes[e.to],a=this.hints.firstChild;n.offsetTopthis.hints.scrollTop+this.hints.clientHeight&&(this.hints.scrollTop=t.offsetTop+t.offsetHeight-this.hints.clientHeight+a.offsetTop)},screenAmount:function(){return Math.floor(this.hints.clientHeight/this.hints.firstChild.offsetHeight)||1},getSelectedHintRange:function(){var e=this.completion.options.scrollMargin||0;return{from:Math.max(0,this.selectedHint-e),to:Math.min(this.data.list.length-1,this.selectedHint+e)}}};function d(e,n){if(!e.somethingSelected())return n;for(var t=[],a=0;a0?v(k):S(T+1)})}S(0)};return u.async=!0,u.supportsSelection=!0,u}else return(a=e.getHelper(e.getCursor(),"hintWords"))?function(m){return i.hint.fromList(m,{words:a})}:i.hint.anyword?function(m,v){return i.hint.anyword(m,v)}:function(){}}i.registerHelper("hint","auto",{resolve:x}),i.registerHelper("hint","fromList",function(e,n){var t=e.getCursor(),a=e.getTokenAt(t),u,m=i.Pos(t.line,a.start),v=t;a.start,]/,closeOnPick:!0,closeOnUnfocus:!0,updateOnCursorActivity:!0,completeOnSingleClick:!0,container:null,customKeys:null,extraKeys:null,paddingForScrollbar:!0,moveOnOverlap:!0};i.defineOption("hintOptions",null)})}(z,z.exports)),z.exports}var Wt=dt();var K={exports:{}},Vt=K.exports,Ee;function ht(){return Ee||(Ee=1,function(y,H){(function(i){i(I())})(function(i){"use strict";var A=/[\w$]+/,b=500;i.registerHelper("hint","anyword",function(w,g){for(var f=g&&g.word||A,c=g&&g.range||b,r=w.getCursor(),l=w.getLine(r.line),p=r.ch,s=p;s&&f.test(l.charAt(s-1));)--s;for(var d=s!=p&&l.slice(s,p),h=g&&g.list||[],x={},o=new RegExp(f.source,"g"),e=-1;e<=1;e+=2)for(var n=r.line,t=Math.min(Math.max(n+e*c,w.firstLine()),w.lastLine())+e;n!=t;n+=e)for(var a=w.getLine(n),u;u=o.exec(a);)n==r.line&&u[0]===d||(!d||u[0].lastIndexOf(d,0)==0)&&!Object.prototype.hasOwnProperty.call(x,u[0])&&(x[u[0]]=!0,h.push(u[0]));return{list:h,from:i.Pos(r.line,s),to:i.Pos(r.line,p)}})})}(K,K.exports)),K.exports}var Ut=ht();var M={exports:{}},Dt=M.exports,Pe;function pt(){return Pe||(Pe=1,function(y,H){(function(i){i(I())})(function(i){var A=/MSIE \d/.test(navigator.userAgent)&&(document.documentMode==null||document.documentMode<8),b=i.Pos,w={"(":")>",")":"(<","[":"]>","]":"[<","{":"}>","}":"{<","<":">>",">":"<<"};function g(s){return s&&s.bracketRegex||/[(){}[\]]/}function f(s,d,h){var x=s.getLineHandle(d.line),o=d.ch-1,e=h&&h.afterCursor;e==null&&(e=/(^| )cm-fat-cursor($| )/.test(s.getWrapperElement().className));var n=g(h),t=!e&&o>=0&&n.test(x.text.charAt(o))&&w[x.text.charAt(o)]||n.test(x.text.charAt(o+1))&&w[x.text.charAt(++o)];if(!t)return null;var a=t.charAt(1)==">"?1:-1;if(h&&h.strict&&a>0!=(o==d.ch))return null;var u=s.getTokenTypeAt(b(d.line,o+1)),m=c(s,b(d.line,o+(a>0?1:0)),a,u,h);return m==null?null:{from:b(d.line,o),to:m&&m.pos,match:m&&m.ch==t.charAt(0),forward:a>0}}function c(s,d,h,x,o){for(var e=o&&o.maxScanLineLength||1e4,n=o&&o.maxScanLines||1e3,t=[],a=g(o),u=h>0?Math.min(d.line+n,s.lastLine()+1):Math.max(s.firstLine()-1,d.line-n),m=d.line;m!=u;m+=h){var v=s.getLine(m);if(v){var L=h>0?0:v.length-1,F=h>0?v.length:-1;if(!(v.length>e))for(m==d.line&&(L=d.ch-(h<0?1:0));L!=F;L+=h){var S=v.charAt(L);if(a.test(S)&&(x===void 0||(s.getTokenTypeAt(b(m,L+1))||"")==(x||""))){var T=w[S];if(T&&T.charAt(1)==">"==h>0)t.push(S);else if(t.length)t.pop();else return{pos:b(m,L),ch:S}}}}}return m-h==(h>0?s.lastLine():s.firstLine())?!1:null}function r(s,d,h){for(var x=s.state.matchBrackets.maxHighlightLineLength||1e3,o=h&&h.highlightNonMatching,e=[],n=s.listSelections(),t=0;t{const A=[...H];return{codeHintingRegistry:()=>{const g=[];A.forEach(c=>{c.superiors&&g.push(c.superiors)});const f=(c,r)=>{const l=c.getCursor(),p=c.getTokenAt(l),s=p.start,d=l.ch,h=p.string;let x=null;if(h.length){if(h==="."){const n=c.getLine(l.line);for(let t=0,a=g.length;tn.toLowerCase().indexOf(t.toLowerCase());let e=A.filter(n=>x?n.superiors===x:n.superiors==null);if(h==="."?x==null&&(e=[]):e=e.filter(n=>{const{text:t}=n,a=o(t,h);return t.startsWith(".")?a===1:a===0}).sort((n,t)=>o(n.text,h)t.text.indexOf(".")===0?ye(be({},t),{text:t.text.substring(1)}):t)),r({list:e,from:y.Pos(l.line,s),to:y.Pos(l.line,d)});const n=A[0];n!=null&&n.desc&&setTimeout(()=>{const t=document.querySelector(".CodeMirror-hints");if(t){const a=t.children;Array.from(a).forEach(u=>{const m=u.textContent,v=A.find(L=>L.displayText===m);v&&u.setAttribute("title",v.desc)})}},0)}}};f.async=!0,f.supportsSelection=!0,H.length&&y.registerHelper("hint",i,f)},codeHintingMount:g=>{H.length&&(g.setOption("mode",i),setTimeout(()=>{g.on("cursorActivity",function(){g==null||g.showHint({completeSingle:!1})})},1e3))}}},le=De({name:"JCodeEditor",inheritAttrs:!1,components:{},props:{value:B.string.def(""),height:B.string.def("auto"),disabled:B.bool.def(!1),fullScreen:B.bool.def(!1),zIndex:B.any.def(1500),theme:B.string.def("idea"),language:B.string.def(""),keywords:B.array.def([])},emits:["change","update:value"],setup(y,{emit:H}){var T;const{getDarkMode:i}=Ze(),A=$(null),{prefixCls:b}=et("code-editer"),w=window.CodeMirror||st,g=$(),[f]=ot(y,"value","change",g),c=$();let r=null;const l=tt(),p=$(y.height),s=Ge({tabSize:2,theme:i.value==nt.DARK?"monokai":y.theme,smartIndent:!0,lineNumbers:!0,line:!0,foldGutter:!0,lineWrapping:!0,gutters:["CodeMirror-linenumbers","CodeMirror-foldgutter","CodeMirror-lint-markers"],styleActiveLine:!0,mode:y.language,readOnly:y.disabled,matchBrackets:!0,extraKeys:{"Cmd-/":k=>S(k),"Ctrl-/":k=>S(k)}});let d=(T=y.value)!=null?T:"";const h=$(!1),x=xe(()=>h.value?"fullscreen-exit":"fullscreen"),o=xe(()=>{let k={class:[b,"full-screen-parent","auto-height",{"full-screen":h.value}],style:{}};return h.value&&(k.style["z-index"]=y.zIndex),k}),{codeHintingMount:e,codeHintingRegistry:n}=vt(w,y.keywords,y.language);n(),ae(()=>y.value,()=>{d!=y.value&&t(y.value,!1)}),ze(()=>{m(),setTimeout(()=>{F()},150)});function t(k,O=!0){k&&it(k)&&(k=JSON.stringify(JSON.parse(k),null,2)),r==null||r.setValue(k!=null?k:""),d=k,O&&u(d),setTimeout(()=>{F(),setTimeout(()=>{F()},600)},400)}function a(k){d=k.getValue()||"",y.value!=d&&u(d)}function u(k){H("change",k),H("update:value",k)}function m(){r=w.fromTextArea(c.value,s),r.on("change",a),t(d,!1),e(r)}function v(){h.value=!h.value}ae(()=>y.disabled,k=>{r&&r.setOption("readOnly",k)}),ae(()=>y.language,k=>{k&&r&&r.setOption("mode",k)});const L=Object.assign({},ke(y),ke(l));function F(){r&&r.refresh()}function S(k){var O=k.getSelection(),R=k.getCursor("start"),j=k.getCursor("end"),N=O.startsWith("//");N?k.replaceRange(O.replace(/\n\/\/\s/g,` `).replace(/^\/\/\s/,""),R,j):k.replaceRange("// "+O.replace(/\n(?=.)/g,` // `),R,j)}return{state:f,textarea:c,boxBindProps:o,getBindValue:L,setValue:t,isFullScreen:h,fullScreenIcon:x,onToggleFullScreen:v,refresh:F,containerRef:A}}}),je=()=>{Ke(y=>({"7d6a9170":y.height}))},Re=le.setup;le.setup=Re?(y,H)=>(je(),Re(y,H)):je;function mt(y,H,i,A,b,w){const g=Me("a-icon");return we(),Je("div",Ae({ref:"containerRef"},y.boxBindProps),[y.fullScreen?(we(),Xe(g,{key:0,class:"full-screen-icon",type:y.fullScreenIcon,onClick:y.onToggleFullScreen},null,8,["type","onClick"])):Ye("",!0),Qe("textarea",Ae({ref:"textarea"},y.getBindValue),null,16)],16)}const Mt=rt(le,[["render",mt]]);export{Mt as default};