Files
vben-app/web/dist/js/render-BV63Eedy.js
2026-10-01 17:05:05 +08:00

4 lines
27 KiB
JavaScript
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import"./bootstrap-Dvp__AlY.js";import{W as Ce,L as xe,O as je,A as Oe,I as Se,D as Le,C as Ve,E as Ie,F as Pe,b as Ee,S as Te,M as ne,Q as Ae,c as Fe,U as Be,B as De,d as _e}from"./index-CxpPjm1h.js";import{g as Me}from"./index-DUhZmPwr.js";import{aF as He,a0 as Ke,T as qe,X as Ge,n as Qe,a7 as ge,x as J,aR as Ye,J as Re,F as Je,aN as We,aw as $e,aq as ze,k as Ue}from"../jse/index-index-D97IFaZ_.js";var Xe={207:(e,n,r)=>{e.exports=r(452)},452:e=>{var n=function(r){var a,N=Object.prototype,x=N.hasOwnProperty,F=typeof Symbol=="function"?Symbol:{},p=F.iterator||"@@iterator",O=F.asyncIterator||"@@asyncIterator",k=F.toStringTag||"@@toStringTag";function L(t,o,l){return Object.defineProperty(t,o,{value:l,enumerable:!0,configurable:!0,writable:!0}),t[o]}try{L({},"")}catch(t){L=function(o,l,f){return o[l]=f}}function B(t,o,l,f){var u=o&&o.prototype instanceof K?o:K,g=Object.create(u.prototype),w=new s(f||[]);return g._invoke=function(j,I,d){var C=R;return function(E,z){if(C===_)throw new Error("Generator is already running");if(C===V){if(E==="throw")throw z;return y()}for(d.method=E,d.arg=z;;){var Z=d.delegate;if(Z){var te=Y(Z,d);if(te){if(te===S)continue;return te}}if(d.method==="next")d.sent=d._sent=d.arg;else if(d.method==="throw"){if(C===R)throw C=V,d.arg;d.dispatchException(d.arg)}else d.method==="return"&&d.abrupt("return",d.arg);C=_;var U=H(j,I,d);if(U.type==="normal"){if(C=d.done?V:G,U.arg===S)continue;return{value:U.arg,done:d.done}}U.type==="throw"&&(C=V,d.method="throw",d.arg=U.arg)}}}(t,l,w),g}function H(t,o,l){try{return{type:"normal",arg:t.call(o,l)}}catch(f){return{type:"throw",arg:f}}}r.wrap=B;var R="suspendedStart",G="suspendedYield",_="executing",V="completed",S={};function K(){}function Q(){}function D(){}var W={};L(W,p,function(){return this});var b=Object.getPrototypeOf,v=b&&b(b(h([])));v&&v!==N&&x.call(v,p)&&(W=v);var m=D.prototype=K.prototype=Object.create(W);function A(t){["next","throw","return"].forEach(function(o){L(t,o,function(l){return this._invoke(o,l)})})}function P(t,o){function l(u,g,w,j){var I=H(t[u],t,g);if(I.type!=="throw"){var d=I.arg,C=d.value;return C&&typeof C=="object"&&x.call(C,"__await")?o.resolve(C.__await).then(function(E){l("next",E,w,j)},function(E){l("throw",E,w,j)}):o.resolve(C).then(function(E){d.value=E,w(d)},function(E){return l("throw",E,w,j)})}j(I.arg)}var f;this._invoke=function(u,g){function w(){return new o(function(j,I){l(u,g,j,I)})}return f=f?f.then(w,w):w()}}function Y(t,o){var l=t.iterator[o.method];if(l===a){if(o.delegate=null,o.method==="throw"){if(t.iterator.return&&(o.method="return",o.arg=a,Y(t,o),o.method==="throw"))return S;o.method="throw",o.arg=new TypeError("The iterator does not provide a 'throw' method")}return S}var f=H(l,t.iterator,o.arg);if(f.type==="throw")return o.method="throw",o.arg=f.arg,o.delegate=null,S;var u=f.arg;return u?u.done?(o[t.resultName]=u.value,o.next=t.nextLoc,o.method!=="return"&&(o.method="next",o.arg=a),o.delegate=null,S):u:(o.method="throw",o.arg=new TypeError("iterator result is not an object"),o.delegate=null,S)}function T(t){var o={tryLoc:t[0]};1 in t&&(o.catchLoc=t[1]),2 in t&&(o.finallyLoc=t[2],o.afterLoc=t[3]),this.tryEntries.push(o)}function i(t){var o=t.completion||{};o.type="normal",delete o.arg,t.completion=o}function s(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(T,this),this.reset(!0)}function h(t){if(t){var o=t[p];if(o)return o.call(t);if(typeof t.next=="function")return t;if(!isNaN(t.length)){var l=-1,f=function u(){for(;++l<t.length;)if(x.call(t,l))return u.value=t[l],u.done=!1,u;return u.value=a,u.done=!0,u};return f.next=f}}return{next:y}}function y(){return{value:a,done:!0}}return Q.prototype=D,L(m,"constructor",D),L(D,"constructor",Q),Q.displayName=L(D,k,"GeneratorFunction"),r.isGeneratorFunction=function(t){var o=typeof t=="function"&&t.constructor;return!!o&&(o===Q||(o.displayName||o.name)==="GeneratorFunction")},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,D):(t.__proto__=D,L(t,k,"GeneratorFunction")),t.prototype=Object.create(m),t},r.awrap=function(t){return{__await:t}},A(P.prototype),L(P.prototype,O,function(){return this}),r.AsyncIterator=P,r.async=function(t,o,l,f,u){u===void 0&&(u=Promise);var g=new P(B(t,o,l,f),u);return r.isGeneratorFunction(o)?g:g.next().then(function(w){return w.done?w.value:g.next()})},A(m),L(m,k,"Generator"),L(m,p,function(){return this}),L(m,"toString",function(){return"[object Generator]"}),r.keys=function(t){var o=[];for(var l in t)o.push(l);return o.reverse(),function f(){for(;o.length;){var u=o.pop();if(u in t)return f.value=u,f.done=!1,f}return f.done=!0,f}},r.values=h,s.prototype={constructor:s,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=a,this.done=!1,this.delegate=null,this.method="next",this.arg=a,this.tryEntries.forEach(i),!t)for(var o in this)o.charAt(0)==="t"&&x.call(this,o)&&!isNaN(+o.slice(1))&&(this[o]=a)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if(t.type==="throw")throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var o=this;function l(I,d){return g.type="throw",g.arg=t,o.next=I,d&&(o.method="next",o.arg=a),!!d}for(var f=this.tryEntries.length-1;f>=0;--f){var u=this.tryEntries[f],g=u.completion;if(u.tryLoc==="root")return l("end");if(u.tryLoc<=this.prev){var w=x.call(u,"catchLoc"),j=x.call(u,"finallyLoc");if(w&&j){if(this.prev<u.catchLoc)return l(u.catchLoc,!0);if(this.prev<u.finallyLoc)return l(u.finallyLoc)}else if(w){if(this.prev<u.catchLoc)return l(u.catchLoc,!0)}else{if(!j)throw new Error("try statement without catch or finally");if(this.prev<u.finallyLoc)return l(u.finallyLoc)}}}},abrupt:function(t,o){for(var l=this.tryEntries.length-1;l>=0;--l){var f=this.tryEntries[l];if(f.tryLoc<=this.prev&&x.call(f,"finallyLoc")&&this.prev<f.finallyLoc){var u=f;break}}u&&(t==="break"||t==="continue")&&u.tryLoc<=o&&o<=u.finallyLoc&&(u=null);var g=u?u.completion:{};return g.type=t,g.arg=o,u?(this.method="next",this.next=u.finallyLoc,S):this.complete(g)},complete:function(t,o){if(t.type==="throw")throw t.arg;return t.type==="break"||t.type==="continue"?this.next=t.arg:t.type==="return"?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):t.type==="normal"&&o&&(this.next=o),S},finish:function(t){for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o];if(l.finallyLoc===t)return this.complete(l.completion,l.afterLoc),i(l),S}},catch:function(t){for(var o=this.tryEntries.length-1;o>=0;--o){var l=this.tryEntries[o];if(l.tryLoc===t){var f=l.completion;if(f.type==="throw"){var u=f.arg;i(l)}return u}}throw new Error("illegal catch attempt")},delegateYield:function(t,o,l){return this.delegate={iterator:h(t),resultName:o,nextLoc:l},this.method==="next"&&(this.arg=a),S}},r}(e.exports);try{regeneratorRuntime=n}catch(r){typeof globalThis=="object"?globalThis.regeneratorRuntime=n:Function("r","regeneratorRuntime = r")(n)}}},ce={};function q(e){var n=ce[e];if(n!==void 0)return n.exports;var r=ce[e]={exports:{}};return Xe[e](r,r.exports,q),r.exports}q.n=e=>{var n=e&&e.__esModule?()=>e.default:()=>e;return q.d(n,{a:n}),n},q.d=(e,n)=>{for(var r in n)q.o(n,r)&&!q.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:n[r]})},q.o=(e,n)=>Object.prototype.hasOwnProperty.call(e,n);var me={};function oe(e,n){(n==null||n>e.length)&&(n=e.length);for(var r=0,a=new Array(n);r<n;r++)a[r]=e[r];return a}function be(e,n){if(e){if(typeof e=="string")return oe(e,n);var r=Object.prototype.toString.call(e).slice(8,-1);return r==="Object"&&e.constructor&&(r=e.constructor.name),r==="Map"||r==="Set"?Array.from(e):r==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?oe(e,n):void 0}}function ee(e){return function(n){if(Array.isArray(n))return oe(n)}(e)||function(n){if(typeof Symbol!="undefined"&&n[Symbol.iterator]!=null||n["@@iterator"]!=null)return Array.from(n)}(e)||be(e)||function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}()}function X(e,n,r){return n in e?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,e}q.d(me,{A:()=>ot});const c=(le={Fragment:()=>Je,computed:()=>Re,createTextVNode:()=>Ye,createVNode:()=>J,defineComponent:()=>ge,nextTick:()=>Qe,reactive:()=>Ge,ref:()=>qe,watch:()=>Ke,watchEffect:()=>He},re={},q.d(re,le),re),Ze=(0,c.defineComponent)({props:{data:{required:!0,type:String},onClick:Function},render:function(){var e=this.data,n=this.onClick;return(0,c.createVNode)("span",{class:"vjs-tree-brackets",onClick:n},[e])}}),et=(0,c.defineComponent)({emits:["change","update:modelValue"],props:{checked:{type:Boolean,default:!1},isMultiple:Boolean,onChange:Function},setup:function(e,n){var r=n.emit;return{uiType:(0,c.computed)(function(){return e.isMultiple?"checkbox":"radio"}),model:(0,c.computed)({get:function(){return e.checked},set:function(a){return r("update:modelValue",a)}})}},render:function(){var e=this.uiType,n=this.model,r=this.$emit;return(0,c.createVNode)("label",{class:["vjs-check-controller",n?"is-checked":""],onClick:function(a){return a.stopPropagation()}},[(0,c.createVNode)("span",{class:"vjs-check-controller-inner is-".concat(e)},null),(0,c.createVNode)("input",{checked:n,class:"vjs-check-controller-original is-".concat(e),type:e,onChange:function(){return r("change",n)}},null)])}}),tt=(0,c.defineComponent)({props:{nodeType:{required:!0,type:String},onClick:Function},render:function(){var e=this.nodeType,n=this.onClick,r=e==="objectStart"||e==="arrayStart";return r||e==="objectCollapsed"||e==="arrayCollapsed"?(0,c.createVNode)("span",{class:"vjs-carets vjs-carets-".concat(r?"open":"close"),onClick:n},[(0,c.createVNode)("svg",{viewBox:"0 0 1024 1024",focusable:"false","data-icon":"caret-down",width:"1em",height:"1em",fill:"currentColor","aria-hidden":"true"},[(0,c.createVNode)("path",{d:"M840.4 300H183.6c-19.7 0-30.7 20.8-18.5 35l328.4 380.8c9.4 10.9 27.5 10.9 37 0L858.9 335c12.2-14.2 1.2-35-18.5-35z"},null)])]):null}});var le,re;function ae(e){return ae=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(n){return typeof n}:function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},ae(e)}function we(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function $(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"root",r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,a=(arguments.length>3?arguments[3]:void 0)||{},N=a.key,x=a.index,F=a.type,p=F===void 0?"content":F,O=a.showComma,k=O!==void 0&&O,L=a.length,B=L===void 0?1:L,H=we(e);if(H==="array"){var R=ue(e.map(function(V,S,K){return $(V,"".concat(n,"[").concat(S,"]"),r+1,{index:S,showComma:S!==K.length-1,length:B,type:p})}));return[$("[",n,r,{showComma:!1,key:N,length:e.length,type:"arrayStart"})[0]].concat(R,$("]",n,r,{showComma:k,length:e.length,type:"arrayEnd"})[0])}if(H==="object"){var G=Object.keys(e),_=ue(G.map(function(V,S,K){return $(e[V],/^[a-zA-Z_]\w*$/.test(V)?"".concat(n,".").concat(V):"".concat(n,'["').concat(V,'"]'),r+1,{key:V,showComma:S!==K.length-1,length:B,type:p})}));return[$("{",n,r,{showComma:!1,key:N,index:x,length:G.length,type:"objectStart"})[0]].concat(_,$("}",n,r,{showComma:k,length:G.length,type:"objectEnd"})[0])}return[{content:e,level:r,key:N,index:x,path:n,showComma:k,length:B,type:p}]}function ue(e){if(typeof Array.prototype.flat=="function")return e.flat();for(var n=ee(e),r=[];n.length;){var a=n.shift();Array.isArray(a)?n.unshift.apply(n,ee(a)):r.push(a)}return r}function ie(e){var n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:new WeakMap;if(e==null)return e;if(e instanceof Date)return new Date(e);if(e instanceof RegExp)return new RegExp(e);if(ae(e)!=="object")return e;if(n.get(e))return n.get(e);if(Array.isArray(e)){var r=e.map(function(x){return ie(x,n)});return n.set(e,r),r}var a={};for(var N in e)a[N]=ie(e[N],n);return n.set(e,a),a}function se(e,n,r,a,N,x,F){try{var p=e[x](F),O=p.value}catch(k){return void r(k)}p.done?n(O):Promise.resolve(O).then(a,N)}var nt=q(207),de=q.n(nt);function fe(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(N){return Object.getOwnPropertyDescriptor(e,N).enumerable})),r.push.apply(r,a)}return r}function he(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?fe(Object(r),!0).forEach(function(a){X(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):fe(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}var ke={data:{type:[String,Number,Boolean,Array,Object],default:null},rootPath:{type:String,default:"root"},indent:{type:Number,default:2},showLength:{type:Boolean,default:!1},showDoubleQuotes:{type:Boolean,default:!0},renderNodeKey:Function,renderNodeValue:Function,renderNodeActions:{type:[Boolean,Function],default:void 0},selectableType:String,showSelectController:{type:Boolean,default:!1},showLine:{type:Boolean,default:!0},showLineNumber:{type:Boolean,default:!1},selectOnClickNode:{type:Boolean,default:!0},nodeSelectable:{type:Function,default:function(){return!0}},highlightSelectedNode:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!1},theme:{type:String,default:"light"},showKeyValueSpace:{type:Boolean,default:!0},editable:{type:Boolean,default:!1},editableTrigger:{type:String,default:"click"},onNodeClick:{type:Function},onNodeMouseover:{type:Function},onBracketsClick:{type:Function},onIconClick:{type:Function},onValueChange:{type:Function}};const rt=(0,c.defineComponent)({name:"TreeNode",props:he(he({},ke),{},{node:{type:Object,required:!0},collapsed:Boolean,checked:Boolean,style:Object,onSelectedChange:{type:Function}}),emits:["nodeClick","nodeMouseover","bracketsClick","iconClick","selectedChange","valueChange"],setup:function(e,n){var r=n.emit,a=(0,c.computed)(function(){return we(e.node.content)}),N=(0,c.computed)(function(){return"vjs-value vjs-value-".concat(a.value)}),x=(0,c.computed)(function(){return e.showDoubleQuotes?'"'.concat(e.node.key,'"'):e.node.key}),F=(0,c.computed)(function(){return e.selectableType==="multiple"}),p=(0,c.computed)(function(){return e.selectableType==="single"}),O=(0,c.computed)(function(){return e.nodeSelectable(e.node)&&(F.value||p.value)}),k=(0,c.reactive)({editing:!1}),L=function(b){var v,m,A=(m=(v=b.target)===null||v===void 0?void 0:v.value)==="null"?null:m==="undefined"?void 0:m==="true"||m!=="false"&&(m[0]+m[m.length-1]==='""'||m[0]+m[m.length-1]==="''"?m.slice(1,-1):typeof Number(m)=="number"&&!isNaN(Number(m))||m==="NaN"?Number(m):m);r("valueChange",A,e.node.path)},B=(0,c.computed)(function(){var b,v=(b=e.node)===null||b===void 0?void 0:b.content;return v===null?v="null":v===void 0&&(v="undefined"),a.value==="string"?'"'.concat(v,'"'):v+""}),H=function(){var b=e.renderNodeValue;return b?b({node:e.node,defaultValue:B.value}):B.value},R=function(){r("bracketsClick",!e.collapsed,e.node)},G=function(){r("iconClick",!e.collapsed,e.node)},_=function(){r("selectedChange",e.node)},V=function(){r("nodeClick",e.node),O.value&&e.selectOnClickNode&&r("selectedChange",e.node)},S=function(){r("nodeMouseover",e.node)},K=function(b){if(e.editable&&!k.editing){k.editing=!0;var v=function m(A){var P;A.target!==b.target&&((P=A.target)===null||P===void 0?void 0:P.parentElement)!==b.target&&(k.editing=!1,document.removeEventListener("click",m))};document.removeEventListener("click",v),document.addEventListener("click",v)}},Q=function(){var b=(0,c.ref)(!1),v=function(){var m,A=(m=de().mark(function P(Y){return de().wrap(function(T){for(;;)switch(T.prev=T.next){case 0:return T.prev=0,T.next=3,navigator.clipboard.writeText(Y);case 3:b.value=!0,setTimeout(function(){b.value=!1},300),T.next=10;break;case 7:T.prev=7,T.t0=T.catch(0),console.error("[vue-json-pretty] Copy failed: ",T.t0);case 10:case"end":return T.stop()}},P,null,[[0,7]])}),function(){var P=this,Y=arguments;return new Promise(function(T,i){var s=m.apply(P,Y);function h(t){se(s,T,i,h,y,"next",t)}function y(t){se(s,T,i,h,y,"throw",t)}h(void 0)})});return function(P){return A.apply(this,arguments)}}();return{copy:v}}().copy,D=function(){var b=e.node,v=b.key,m=b.path,A=e.rootPath,P=new Function("data","return data".concat(m.slice(A.length)))(e.data),Y=JSON.stringify(v?X({},v,P):P,null,2);Q(Y)},W=function(){var b=e.renderNodeActions;if(!b)return null;var v={copy:D};return typeof b=="function"?b({node:e.node,defaultActions:v}):(0,c.createVNode)("span",{onClick:D,class:"vjs-tree-node-actions-item"},[(0,c.createTextVNode)("copy")])};return function(){var b,v=e.node;return(0,c.createVNode)("div",{class:{"vjs-tree-node":!0,"has-selector":e.showSelectController,"has-carets":e.showIcon,"is-highlight":e.highlightSelectedNode&&e.checked,dark:e.theme==="dark"},onClick:V,onMouseover:S,style:e.style},[e.showLineNumber&&(0,c.createVNode)("span",{class:"vjs-node-index"},[v.id+1]),e.showSelectController&&O.value&&v.type!=="objectEnd"&&v.type!=="arrayEnd"&&(0,c.createVNode)(et,{isMultiple:F.value,checked:e.checked,onChange:_},null),(0,c.createVNode)("div",{class:"vjs-indent"},[Array.from(Array(v.level)).map(function(m,A){return(0,c.createVNode)("div",{key:A,class:{"vjs-indent-unit":!0,"has-line":e.showLine}},[Array.from(Array(e.indent)).map(function(){return(0,c.createVNode)(c.Fragment,null,[(0,c.createTextVNode)(" ")])})])}),e.showIcon&&(0,c.createVNode)(tt,{nodeType:v.type,onClick:G},null)]),v.key&&(0,c.createVNode)("span",{class:"vjs-key"},[(b=e.renderNodeKey,b?b({node:e.node,defaultKey:x.value||""}):x.value),(0,c.createVNode)("span",{class:"vjs-colon"},[":".concat(e.showKeyValueSpace?" ":"")])]),(0,c.createVNode)("span",null,[v.type!=="content"&&v.content?(0,c.createVNode)(Ze,{data:v.content.toString(),onClick:R},null):(0,c.createVNode)("span",{class:N.value,onClick:!e.editable||e.editableTrigger&&e.editableTrigger!=="click"?void 0:K,onDblclick:e.editable&&e.editableTrigger==="dblclick"?K:void 0},[e.editable&&k.editing?(0,c.createVNode)("input",{value:B.value,onChange:L,style:{padding:"3px 8px",border:"1px solid #eee",boxShadow:"none",boxSizing:"border-box",borderRadius:5,fontFamily:"inherit"}},null):H()]),v.showComma&&(0,c.createVNode)("span",null,[","]),e.showLength&&e.collapsed&&(0,c.createVNode)("span",{class:"vjs-comment"},[(0,c.createTextVNode)(" // "),v.length,(0,c.createTextVNode)(" items ")])]),e.renderNodeActions&&(0,c.createVNode)("span",{class:"vjs-tree-node-actions"},[W()])])}}});function pe(e,n){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);n&&(a=a.filter(function(N){return Object.getOwnPropertyDescriptor(e,N).enumerable})),r.push.apply(r,a)}return r}function M(e){for(var n=1;n<arguments.length;n++){var r=arguments[n]!=null?arguments[n]:{};n%2?pe(Object(r),!0).forEach(function(a){X(e,a,r[a])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):pe(Object(r)).forEach(function(a){Object.defineProperty(e,a,Object.getOwnPropertyDescriptor(r,a))})}return e}const ot=(0,c.defineComponent)({name:"Tree",props:M(M({},ke),{},{collapsedNodeLength:{type:Number,default:1/0},deep:{type:Number,default:1/0},pathCollapsible:{type:Function,default:function(){return!1}},virtual:{type:Boolean,default:!1},height:{type:Number,default:400},itemHeight:{type:Number,default:20},dynamicHeight:{type:Boolean,default:!0},selectedValue:{type:[String,Array],default:function(){return""}},collapsedOnClickBrackets:{type:Boolean,default:!0},style:Object,onSelectedChange:{type:Function},theme:{type:String,default:"light"}}),slots:["renderNodeKey","renderNodeValue","renderNodeActions"],emits:["nodeClick","nodeMouseover","bracketsClick","iconClick","selectedChange","update:selectedValue","update:data"],setup:function(e,n){var r=n.emit,a=n.slots,N=(0,c.ref)(),x=(0,c.computed)(function(){return $(e.data,e.rootPath)}),F=function(i,s){return x.value.reduce(function(h,y){var t,o=y.level>=i||y.length>=s,l=(t=e.pathCollapsible)===null||t===void 0?void 0:t.call(e,y);return y.type!=="objectStart"&&y.type!=="arrayStart"||!o&&!l?h:M(M({},h),{},X({},y.path,1))},{})},p=(0,c.reactive)({translateY:0,visibleData:null,hiddenPaths:F(e.deep,e.collapsedNodeLength),startIndex:0,endIndex:0}),O=[],k=[],L=0,B={},H=function(i){O=Array(i).fill(0).map(function(){return e.itemHeight||20}),(k=new Array(i+1))[0]=0;for(var s=0;s<i;s++)k[s+1]=k[s]+O[s];L=k[i]||0},R=function(i){var s=O.length;i<0&&(i=0),i>s&&(i=s);for(var h=i;h<s;h++)k[h+1]=k[h]+O[h];L=k[s]||0},G=function(i,s){for(var h=0,y=i.length-1;h<y;){var t=h+y>>>1;i[t]<s?h=t+1:y=t}return h},_=(0,c.computed)(function(){for(var i=null,s=[],h=x.value.length,y=0;y<h;y++){var t=M(M({},x.value[y]),{},{id:y}),o=p.hiddenPaths[t.path];if(i&&i.path===t.path){var l=i.type==="objectStart",f=M(M(M({},t),i),{},{showComma:t.showComma,content:l?"{...}":"[...]",type:l?"objectCollapsed":"arrayCollapsed"});i=null,s.push(f)}else{if(o&&!i){i=t;continue}if(i)continue;s.push(t)}}return s}),V=(0,c.computed)(function(){var i=e.selectedValue;return i&&e.selectableType==="multiple"&&Array.isArray(i)?i:[i]}),S=(0,c.computed)(function(){return!e.selectableType||e.selectOnClickNode||e.showSelectController?"":"When selectableType is not null, selectOnClickNode and showSelectController cannot be false at the same time, because this will cause the selection to fail."}),K=(0,c.computed)(function(){return e.dynamicHeight?L||0:_.value.length*e.itemHeight}),Q=function i(){var s=_.value;if(s)if(e.virtual){var h,y=((h=N.value)===null||h===void 0?void 0:h.scrollTop)||0;if(e.dynamicHeight){O.length!==s.length&&H(s.length);var t=function(I){var d=G(k,I+1e-4);return Math.max(0,Math.min(d-1,O.length-1))}(y),o=function(I,d){var C=G(k,I+d);return Math.max(0,Math.min(C+1,O.length))}(y,e.height),l=Math.max(0,t-5),f=Math.min(s.length,o+5);p.startIndex=l,p.endIndex=f,p.translateY=k[l]||0,p.visibleData=s.slice(l,f),(0,c.nextTick)().then(function(){for(var I=!1,d=p.startIndex;d<p.endIndex;d++){var C=B[d];if(C){var E=C.offsetHeight;E&&O[d]!==E&&(O[d]=E,k[d+1]=k[d]+O[d],R(d+1),I=!0)}}I&&i()})}else{var u=e.height/e.itemHeight,g=Math.floor(y/e.itemHeight),w=g<0?0:g+u>s.length?s.length-u:g;w<0&&(w=0);var j=w+u;p.translateY=w*e.itemHeight,p.startIndex=w,p.endIndex=j,p.visibleData=s.slice(w,j)}}else p.translateY=0,p.startIndex=0,p.endIndex=s.length,p.visibleData=s},D=null,W=function(){D&&cancelAnimationFrame(D),D=requestAnimationFrame(function(){Q()})},b=function(i){var s,h,y=i.path,t=e.selectableType;if(t==="multiple"){var o=V.value.findIndex(function(g){return g===y}),l=ee(V.value);o!==-1?l.splice(o,1):l.push(y),r("update:selectedValue",l),r("selectedChange",l,ee(V.value))}else if(t==="single"&&V.value[0]!==y){var f=(s=V.value,h=1,function(g){if(Array.isArray(g))return g}(s)||function(g,w){var j=g==null?null:typeof Symbol!="undefined"&&g[Symbol.iterator]||g["@@iterator"];if(j!=null){var I,d,C=[],E=!0,z=!1;try{for(j=j.call(g);!(E=(I=j.next()).done)&&(C.push(I.value),!w||C.length!==w);E=!0);}catch(Z){z=!0,d=Z}finally{try{E||j.return==null||j.return()}finally{if(z)throw d}}return C}}(s,h)||be(s,h)||function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}())[0],u=y;r("update:selectedValue",u),r("selectedChange",u,f)}},v=function(i){r("nodeClick",i)},m=function(i){r("nodeMouseover",i)},A=function(i,s){if(i)p.hiddenPaths=M(M({},p.hiddenPaths),{},X({},s,1));else{var h=M({},p.hiddenPaths);delete h[s],p.hiddenPaths=h}},P=function(i,s){e.collapsedOnClickBrackets&&A(i,s.path),r("bracketsClick",i,s)},Y=function(i,s){A(i,s.path),r("iconClick",i,s)},T=function(i,s){var h=ie(e.data),y=e.rootPath;new Function("data","val","data".concat(s.slice(y.length),"=val"))(h,i),r("update:data",h)};return(0,c.watchEffect)(function(){S.value&&function(i){throw new Error("[VueJSONPretty] ".concat(i))}(S.value)}),(0,c.watchEffect)(function(){_.value&&(e.virtual&&e.dynamicHeight&&O.length!==_.value.length&&H(_.value.length),Q())}),(0,c.watch)(function(){return[e.dynamicHeight,e.itemHeight,x.value.length]},function(){e.virtual&&e.dynamicHeight&&(H(_.value.length),(0,c.nextTick)(Q))}),(0,c.watch)(function(){return e.deep},function(i){i&&(p.hiddenPaths=F(i,e.collapsedNodeLength))}),(0,c.watch)(function(){return e.collapsedNodeLength},function(i){i&&(p.hiddenPaths=F(e.deep,i))}),function(){var i,s,h,y,t,o=(i=e.renderNodeKey)!==null&&i!==void 0?i:a.renderNodeKey,l=(s=e.renderNodeValue)!==null&&s!==void 0?s:a.renderNodeValue,f=(h=(y=e.renderNodeActions)!==null&&y!==void 0?y:a.renderNodeActions)!==null&&h!==void 0&&h,u=(t=p.visibleData)===null||t===void 0?void 0:t.map(function(g,w){var j=p.startIndex+w;return(0,c.createVNode)("div",{key:g.id,ref:function(I){return function(d,C){C?B[d]=C:delete B[d]}(j,I||null)}},[(0,c.createVNode)(rt,{data:e.data,rootPath:e.rootPath,indent:e.indent,node:g,collapsed:!!p.hiddenPaths[g.path],theme:e.theme,showDoubleQuotes:e.showDoubleQuotes,showLength:e.showLength,checked:V.value.includes(g.path),selectableType:e.selectableType,showLine:e.showLine,showLineNumber:e.showLineNumber,showSelectController:e.showSelectController,selectOnClickNode:e.selectOnClickNode,nodeSelectable:e.nodeSelectable,highlightSelectedNode:e.highlightSelectedNode,editable:e.editable,editableTrigger:e.editableTrigger,showIcon:e.showIcon,showKeyValueSpace:e.showKeyValueSpace,renderNodeKey:o,renderNodeValue:l,renderNodeActions:f,onNodeClick:v,onNodeMouseover:m,onBracketsClick:P,onIconClick:Y,onSelectedChange:b,onValueChange:T,class:e.dynamicHeight?"dynamic-height":void 0,style:e.dynamicHeight?{}:e.itemHeight&&e.itemHeight!==20?{lineHeight:"".concat(e.itemHeight,"px")}:{}},null)])});return(0,c.createVNode)("div",{ref:N,class:{"vjs-tree":!0,"is-virtual":e.virtual,dark:e.theme==="dark"},onScroll:e.virtual?W:void 0,style:e.showLineNumber?M({paddingLeft:"".concat(12*Number(x.value.length.toString().length),"px")},e.style):e.style},[e.virtual?(0,c.createVNode)("div",{class:"vjs-tree-list",style:{height:"".concat(e.height,"px")}},[(0,c.createVNode)("div",{class:"vjs-tree-list-holder",style:{height:"".concat(K.value,"px")}},[(0,c.createVNode)("div",{class:"vjs-tree-list-holder-inner",style:{transform:"translateY(".concat(p.translateY,"px)")}},[u])])]):u])}}});var at=me.A;const ve=ge({__name:"json-preview",props:{data:{}},setup(e){return(n,r)=>($e(),We(ze(at),{data:e.data,deep:3,"show-length":!0,path:"res"},null,8,["data"]))}});function dt(e){if(typeof e!="object"&&typeof e!="string")return J("span",null,[e]);if(typeof e=="object")return J(ve,{class:"break-normal",data:e},null);try{const n=JSON.parse(e);return typeof n!="object"?J("span",null,[n]):J(ve,{class:"break-normal",data:n},null)}catch(n){return J("span",null,[e])}}function Ne(e,n,r=!1,a="2px"){return J("span",{class:["flex","items-center",r?"justify-center":""]},[Ue(e),J("span",{style:{marginLeft:a}},[n])])}const ye=[{icon:Ce,value:"windows"},{icon:xe,value:"linux"},{icon:je,value:"osx"},{icon:Oe,value:"android"},{icon:Se,value:"iphone"}],it=[{icon:Ve,value:"chrome"},{icon:Ie,value:"edge"},{icon:Pe,value:"firefox"},{icon:Ee,value:"opera"},{icon:Te,value:"safari"},{icon:ne,value:"micromessenger"},{icon:ne,value:"windowswechat"},{icon:Ae,value:"quark"},{icon:ne,value:"wxwork"},{icon:Me,value:"qq"},{icon:Fe,value:"dingtalk"},{icon:Be,value:"uc"},{icon:De,value:"baidu"}];function ft(e,n=!1){if(!e)return;let r=ye.find(N=>e.toLocaleLowerCase().includes(N.value));e.toLocaleLowerCase().includes("windows")&&(r=ye[0]);const a=r?r.icon:Le;return Ne(a,e,n,"5px")}function ht(e,n=!1){if(!e)return;const r=it.find(N=>e.toLocaleLowerCase().includes(N.value)),a=r?r.icon:_e;return Ne(a,e,n,"5px")}export{ht as a,dt as b,ft as r};