var ut=Object.defineProperty;var ct=(e,n,t)=>n in e?ut(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t;var y=(e,n,t)=>(ct(e,typeof n!="symbol"?n+"":n,t),t);function _r(){import("data:text/javascript,")}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))r(i);new MutationObserver(i=>{for(const o of i)if(o.type==="childList")for(const s of o.addedNodes)s.tagName==="LINK"&&s.rel==="modulepreload"&&r(s)}).observe(document,{childList:!0,subtree:!0});function t(i){const o={};return i.integrity&&(o.integrity=i.integrity),i.referrerpolicy&&(o.referrerPolicy=i.referrerpolicy),i.crossorigin==="use-credentials"?o.credentials="include":i.crossorigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(i){if(i.ep)return;i.ep=!0;const o=t(i);fetch(i.href,o)}})();const ft="modulepreload",lt=function(e){return"/static/vue3/runtime/playground/"+e},be={},we=function(n,t,r){return!t||t.length===0?n():Promise.all(t.map(i=>{if(i=lt(i),i in be)return;be[i]=!0;const o=i.endsWith(".css"),s=o?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${i}"]${s}`))return;const a=document.createElement("link");if(a.rel=o?"stylesheet":ft,o||(a.as="script",a.crossOrigin=""),a.href=i,document.head.appendChild(a),o)return new Promise((f,v)=>{a.addEventListener("load",f),a.addEventListener("error",()=>v(new Error(`Unable to preload CSS for ${i}`)))})})).then(()=>n())};var Re=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{},ue={exports:{}},K=typeof Reflect=="object"?Reflect:null,Oe=K&&typeof K.apply=="function"?K.apply:function(n,t,r){return Function.prototype.apply.call(n,t,r)},se;K&&typeof K.ownKeys=="function"?se=K.ownKeys:Object.getOwnPropertySymbols?se=function(n){return Object.getOwnPropertyNames(n).concat(Object.getOwnPropertySymbols(n))}:se=function(n){return Object.getOwnPropertyNames(n)};function dt(e){console&&console.warn&&console.warn(e)}var Ve=Number.isNaN||function(n){return n!==n};function w(){w.init.call(this)}ue.exports=w;ue.exports.once=mt;w.EventEmitter=w;w.prototype._events=void 0;w.prototype._eventsCount=0;w.prototype._maxListeners=void 0;var Te=10;function ce(e){if(typeof e!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}Object.defineProperty(w,"defaultMaxListeners",{enumerable:!0,get:function(){return Te},set:function(e){if(typeof e!="number"||e<0||Ve(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");Te=e}});w.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};w.prototype.setMaxListeners=function(n){if(typeof n!="number"||n<0||Ve(n))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+n+".");return this._maxListeners=n,this};function Be(e){return e._maxListeners===void 0?w.defaultMaxListeners:e._maxListeners}w.prototype.getMaxListeners=function(){return Be(this)};w.prototype.emit=function(n){for(var t=[],r=1;r0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var f=o[n];if(f===void 0)return!1;if(typeof f=="function")Oe(f,this,t);else for(var v=f.length,$=ze(f,v),r=0;r0&&s.length>i&&!s.warned){s.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=e,a.type=n,a.count=s.length,dt(a)}return e}w.prototype.addListener=function(n,t){return Ue(this,n,t,!1)};w.prototype.on=w.prototype.addListener;w.prototype.prependListener=function(n,t){return Ue(this,n,t,!0)};function ht(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function He(e,n,t){var r={fired:!1,wrapFn:void 0,target:e,type:n,listener:t},i=ht.bind(r);return i.listener=t,r.wrapFn=i,i}w.prototype.once=function(n,t){return ce(t),this.on(n,He(this,n,t)),this};w.prototype.prependOnceListener=function(n,t){return ce(t),this.prependListener(n,He(this,n,t)),this};w.prototype.removeListener=function(n,t){var r,i,o,s,a;if(ce(t),i=this._events,i===void 0)return this;if(r=i[n],r===void 0)return this;if(r===t||r.listener===t)--this._eventsCount===0?this._events=Object.create(null):(delete i[n],i.removeListener&&this.emit("removeListener",n,r.listener||t));else if(typeof r!="function"){for(o=-1,s=r.length-1;s>=0;s--)if(r[s]===t||r[s].listener===t){a=r[s].listener,o=s;break}if(o<0)return this;o===0?r.shift():pt(r,o),r.length===1&&(i[n]=r[0]),i.removeListener!==void 0&&this.emit("removeListener",n,a||t)}return this};w.prototype.off=w.prototype.removeListener;w.prototype.removeAllListeners=function(n){var t,r,i;if(r=this._events,r===void 0)return this;if(r.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):r[n]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete r[n]),this;if(arguments.length===0){var o=Object.keys(r),s;for(i=0;i=0;i--)this.removeListener(n,t[i]);return this};function Fe(e,n,t){var r=e._events;if(r===void 0)return[];var i=r[n];return i===void 0?[]:typeof i=="function"?t?[i.listener||i]:[i]:t?gt(i):ze(i,i.length)}w.prototype.listeners=function(n){return Fe(this,n,!0)};w.prototype.rawListeners=function(n){return Fe(this,n,!1)};w.listenerCount=function(e,n){return typeof e.listenerCount=="function"?e.listenerCount(n):Ye.call(e,n)};w.prototype.listenerCount=Ye;function Ye(e){var n=this._events;if(n!==void 0){var t=n[e];if(typeof t=="function")return 1;if(t!==void 0)return t.length}return 0}w.prototype.eventNames=function(){return this._eventsCount>0?se(this._events):[]};function ze(e,n){for(var t=new Array(n),r=0;r-1&&e%1==0&&e<=Gt}function Jt(e){return e!=null&&Ze(e.length)&&!Je(e)}var Zt=Object.prototype;function Xe(e){var n=e&&e.constructor,t=typeof n=="function"&&n.prototype||Zt;return e===t}var Xt="[object Arguments]";function _e(e){return ye(e)&&ee(e)==Xt}var et=Object.prototype,en=et.hasOwnProperty,tn=et.propertyIsEnumerable,nn=_e(function(){return arguments}())?_e:function(e){return ye(e)&&en.call(e,"callee")&&!tn.call(e,"callee")};const rn=nn;function on(){return!1}var tt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,je=tt&&typeof module=="object"&&module&&!module.nodeType&&module,sn=je&&je.exports===tt,Se=sn?V.Buffer:void 0,an=Se?Se.isBuffer:void 0,un=an||on;const cn=un;var fn="[object Arguments]",ln="[object Array]",dn="[object Boolean]",hn="[object Date]",pn="[object Error]",gn="[object Function]",mn="[object Map]",vn="[object Number]",yn="[object Object]",$n="[object RegExp]",bn="[object Set]",wn="[object String]",On="[object WeakMap]",Tn="[object ArrayBuffer]",En="[object DataView]",Mn="[object Float32Array]",_n="[object Float64Array]",jn="[object Int8Array]",Sn="[object Int16Array]",Ln="[object Int32Array]",Cn="[object Uint8Array]",xn="[object Uint8ClampedArray]",Dn="[object Uint16Array]",An="[object Uint32Array]",T={};T[Mn]=T[_n]=T[jn]=T[Sn]=T[Ln]=T[Cn]=T[xn]=T[Dn]=T[An]=!0;T[fn]=T[ln]=T[Tn]=T[dn]=T[En]=T[hn]=T[pn]=T[gn]=T[mn]=T[vn]=T[yn]=T[$n]=T[bn]=T[wn]=T[On]=!1;function Pn(e){return ye(e)&&Ze(e.length)&&!!T[ee(e)]}function In(e){return function(n){return e(n)}}var nt=typeof exports=="object"&&exports&&!exports.nodeType&&exports,X=nt&&typeof module=="object"&&module&&!module.nodeType&&module,Nn=X&&X.exports===nt,de=Nn&&Ke.process,kn=function(){try{var e=X&&X.require&&X.require("util").types;return e||de&&de.binding&&de.binding("util")}catch(n){}}();const Le=kn;var Ce=Le&&Le.isTypedArray,Wn=Ce?In(Ce):Pn;const Rn=Wn;function Vn(e,n){return function(t){return e(n(t))}}var Bn=Vn(Object.keys,Object);const Un=Bn;var Hn=Object.prototype,Fn=Hn.hasOwnProperty;function Yn(e){if(!Xe(e))return Un(e);var n=[];for(var t in Object(e))Fn.call(e,t)&&t!="constructor"&&n.push(t);return n}var zn=te(V,"Map");const pe=zn;var qn=te(V,"DataView");const ge=qn;var Kn=te(V,"Promise");const me=Kn;var Qn=te(V,"Set");const ve=Qn;var xe="[object Map]",Gn="[object Object]",De="[object Promise]",Ae="[object Set]",Pe="[object WeakMap]",Ie="[object DataView]",Jn=Y(ge),Zn=Y(pe),Xn=Y(me),er=Y(ve),tr=Y(he),F=ee;(ge&&F(new ge(new ArrayBuffer(1)))!=Ie||pe&&F(new pe)!=xe||me&&F(me.resolve())!=De||ve&&F(new ve)!=Ae||he&&F(new he)!=Pe)&&(F=function(e){var n=ee(e),t=n==Gn?e.constructor:void 0,r=t?Y(t):"";if(r)switch(r){case Jn:return Ie;case Zn:return xe;case Xn:return De;case er:return Ae;case tr:return Pe}return n});const nr=F;var rr="[object Map]",ir="[object Set]",or=Object.prototype,sr=or.hasOwnProperty;function ar(e){if(e==null)return!0;if(Jt(e)&&(xt(e)||typeof e=="string"||typeof e.splice=="function"||cn(e)||Rn(e)||rn(e)))return!e.length;var n=nr(e);if(n==rr||n==ir)return!e.size;if(Xe(e))return!Yn(e).length;for(var t in e)if(sr.call(e,t))return!1;return!0}var rt=(e=>(e.CODE="code",e))(rt||{});class ur{constructor(n=globalThis.navigator.userAgent,t={}){y(this,"isIos",!1);y(this,"isIphone",!1);y(this,"isIpad",!1);y(this,"isAndroid",!1);y(this,"isAndroidPad",!1);y(this,"isMac",!1);y(this,"isWin",!1);y(this,"isMqq",!1);y(this,"isWechat",!1);y(this,"isWeb",!1);this.isIphone=n.indexOf("iPhone")>=0,this.isIpad=/(iPad).*OS\s([\d_]+)/.test(n),this.isIos=this.isIphone||this.isIpad,this.isAndroid=n.indexOf("Android")>=0,this.isAndroidPad=this.isAndroid&&n.indexOf("Mobile")<0,this.isMac=n.indexOf("Macintosh")>=0,this.isWin=n.indexOf("Windows")>=0,this.isMqq=/QQ\/([\d.]+)/.test(n),this.isWechat=n.indexOf("MicroMessenger")>=0&&n.indexOf("wxwork")<0,this.isWeb=!this.isIos&&!this.isAndroid&&!/(WebOS|BlackBerry)/.test(n),Object.entries(t).forEach(([r,i])=>{this[r]=i})}}const Ne="magic:common:events:",it="magic:common:actions:",oe={SHOW:"show",HIDE:"hide",SCROLL_TO_VIEW:"scrollIntoView",SCROLL_TO_TOP:"scrollToTop"},cr=e=>e.startsWith(Ne)?e:`${Ne}${e}`,fr=e=>e.startsWith(it),ot=(e,n)=>{var r;if(!e)return!1;if(!e.id)return ot(e.parentElement,n);const t=(r=n.page)==null?void 0:r.getNode(e.id);return t||!1},ke=(e,n,t)=>{const r=ot(t.target,e);r&&e.emit(cr(n),r)},lr=e=>{window.document.body.addEventListener("click",n=>{ke(e,"click",n)}),window.document.body.addEventListener("click",n=>{ke(e,"click:capture",n)},!0)},dr=(e,n)=>{const{instance:t}=n;switch(e.replace(it,"")){case oe.SHOW:t.show();break;case oe.HIDE:t.hide();break;case oe.SCROLL_TO_VIEW:t.$el.scrollIntoView({behavior:"smooth"});break;case oe.SCROLL_TO_TOP:window.scrollTo({top:0,behavior:"smooth"});break}};class hr{constructor(){y(this,"data",{})}set(n,t){this.data[n]=t}get(n){return this.data[n]}}class We extends ue.exports.EventEmitter{constructor(t){super();y(this,"data");y(this,"style");y(this,"events");y(this,"instance");y(this,"page");y(this,"parent");y(this,"app");y(this,"store",new hr);this.page=t.page,this.parent=t.parent,this.app=t.app;const{events:r}=t.config;this.data=t.config,this.events=r,this.listenLifeSafe(),this.once("destroy",()=>{this.instance=null,typeof this.data.destroy=="function"&&this.data.destroy(this),this.listenLifeSafe()})}listenLifeSafe(){this.once("created",async t=>{this.instance=t,await this.runCodeBlock("created")}),this.once("mounted",async t=>{this.instance=t;const r=this.app.eventQueueMap[t.config.id]||[];for(let i=r.shift();i;i=r.shift())this.app.eventHandler(i.eventConfig,i.fromCpt,i.args);await this.runCodeBlock("mounted")})}async runCodeBlock(t){var r,i,o,s;if(typeof this.data[t]=="function"){await this.data[t](this);return}if(!(((r=this.data[t])==null?void 0:r.hookType)!==rt.CODE||!this.app.codeDsl||ar((i=this.app)==null?void 0:i.codeDsl)))for(const a of this.data[t].hookData){const{codeId:f,params:v={}}=a;this.app.codeDsl[f]&&typeof((s=(o=this.app)==null?void 0:o.codeDsl[f])==null?void 0:s.content)=="function"&&await this.app.codeDsl[f].content({app:this.app,params:v})}}}class pr extends We{constructor(t){super(t);y(this,"nodes",new Map);this.setNode(t.config.id,this),this.initNode(t.config,this)}initNode(t,r){var o;const i=new We({config:t,parent:r,page:this,app:this.app});this.setNode(t.id,i),(o=t.items)==null||o.forEach(s=>{this.initNode(s,i)})}getNode(t){return this.nodes.get(t)}setNode(t,r){this.nodes.set(t,r)}deleteNode(t){this.nodes.delete(t)}}const gr=e=>{if(typeof e!="string")return e;const n={};return e.split(";").forEach(t=>{if(!t)return;const r=t.split(":");let i=r.shift(),o=r.join(":");!i||(i=i.replace(/^\s*/,"").replace(/\s*$/,""),o=o.replace(/^\s*/,"").replace(/\s*$/,""),i=i.split("-").map((s,a)=>a>0?`${s[0].toUpperCase()}${s.substr(1)}`:s).join(""),n[i]=o)}),n},mr=e=>e&&!/^url/.test(e)&&!/^linear-gradient/.test(e)?`url(${e})`:e,vr=e=>/^(-?\d+)(\.\d+)?$/.test(e);class yr extends ue.exports.EventEmitter{constructor(t){var r;super();y(this,"env");y(this,"codeDsl");y(this,"pages",new Map);y(this,"page");y(this,"platform","mobile");y(this,"jsEngine","browser");y(this,"designWidth",375);y(this,"components",new Map);y(this,"eventQueueMap",{});if(this.env=new ur(t.ua),this.codeDsl=(r=t.config)==null?void 0:r.codeBlocks,t.platform&&(this.platform=t.platform),t.jsEngine&&(this.jsEngine=t.jsEngine),t.designWidth&&(this.designWidth=t.designWidth),this.platform==="mobile"||this.platform==="editor"){const i=()=>{const{width:o}=document.documentElement.getBoundingClientRect(),s=o/(this.designWidth/100);document.documentElement.style.fontSize=`${s}px`};i(),document.body.style.fontSize="14px",globalThis.addEventListener("resize",i)}t.transformStyle&&(this.transformStyle=t.transformStyle),t.config&&this.setConfig(t.config,t.curPage),lr(this)}transformStyle(t){if(!t)return{};let r={};const i={};typeof t=="string"?r=gr(t):r={...t};const o=["zIndex","opacity","fontWeight"];return Object.entries(r).forEach(([s,a])=>{if(s==="backgroundImage")a&&(i[s]=mr(a));else if(s==="transform"&&typeof a!="string"){const f=Object.entries(a).map(([v,$])=>$.trim()?(v==="rotate"&&vr($)&&($=`${$}deg`),`${v}(${$})`):"").join(" ");i[s]=f.trim()?f:"none"}else!o.includes(s)&&a&&/^[-]?[0-9]*[.]?[0-9]*$/.test(a)?i[s]=`${a/100}rem`:i[s]=a}),i}setConfig(t,r){var i,o,s;this.codeDsl=t.codeBlocks,this.pages=new Map,(i=t.items)==null||i.forEach(a=>{this.pages.set(a.id,new pr({config:a,app:this}))}),this.setPage(r||((s=(o=this.page)==null?void 0:o.data)==null?void 0:s.id))}setPage(t){let r;t&&(r=this.pages.get(t)),r||(r=this.pages.get(this.pages.keys().next().value)),this.page=r,this.platform!=="magic"&&this.bindEvents()}registerComponent(t,r){this.components.set(t,r)}unregisterComponent(t){this.components.delete(t)}resolveComponent(t){return this.components.get(t)}bindEvents(){var t;if(!!this.page){this.removeAllListeners();for(const[,r]of this.page.nodes)(t=r.events)==null||t.forEach(i=>this.bindEvent(i,`${r.data.id}`))}}bindEvent(t,r){const{name:i}=t;this.on(`${i}_${r}`,(o,...s)=>{this.eventHandler(t,o,s)})}emit(t,r,...i){var o;return(o=r==null?void 0:r.data)!=null&&o.id?super.emit(`${String(t)}_${r.data.id}`,r,...i):super.emit(t,r,...i)}eventHandler(t,r,i){if(!this.page)throw new Error("\u5F53\u524D\u6CA1\u6709\u9875\u9762");const{method:o,to:s}=t,a=this.page.getNode(s);if(!a)throw`ID\u4E3A${s}\u7684\u7EC4\u4EF6\u4E0D\u5B58\u5728`;if(fr(o))return dr(o,a);a.instance?typeof a.instance[o]=="function"&&a.instance[o](r,...i):this.addEventToMap({eventConfig:t,fromCpt:r,args:i})}destroy(){this.removeAllListeners(),this.pages.clear()}addEventToMap(t){this.eventQueueMap[t.eventConfig.to]?this.eventQueueMap[t.eventConfig.to].push(t):this.eventQueueMap[t.eventConfig.to]=[t]}}var st={exports:{}};(function(e,n){(function(t,r){e.exports=r()})(Re,function(){var t=1e3,r=6e4,i=36e5,o="millisecond",s="second",a="minute",f="hour",v="day",$="week",E="month",x="quarter",S="year",P="date",d="Invalid Date",D=/^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/,B=/\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g,U={name:"en",weekdays:"Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),months:"January_February_March_April_May_June_July_August_September_October_November_December".split("_")},A=function(m,l,u){var h=String(m);return!h||h.length>=l?m:""+Array(l+1-h.length).join(u)+m},ne={s:A,z:function(m){var l=-m.utcOffset(),u=Math.abs(l),h=Math.floor(u/60),c=u%60;return(l<=0?"+":"-")+A(h,2,"0")+":"+A(c,2,"0")},m:function m(l,u){if(l.date()1)return m(p[0])}else{var b=l.name;I[b]=l,c=b}return!h&&c&&(N=c),c||!h&&N},M=function(m,l){if(H(m))return m.clone();var u=typeof l=="object"?l:{};return u.date=m,u.args=arguments,new re(u)},O=ne;O.l=z,O.i=H,O.w=function(m,l){return M(m,{locale:l.$L,utc:l.$u,x:l.$x,$offset:l.$offset})};var re=function(){function m(u){this.$L=z(u.locale,null,!0),this.parse(u)}var l=m.prototype;return l.parse=function(u){this.$d=function(h){var c=h.date,g=h.utc;if(c===null)return new Date(NaN);if(O.u(c))return new Date;if(c instanceof Date)return new Date(c);if(typeof c=="string"&&!/Z$/i.test(c)){var p=c.match(D);if(p){var b=p[2]-1||0,j=(p[7]||"0").substring(0,3);return g?new Date(Date.UTC(p[1],b,p[3]||1,p[4]||0,p[5]||0,p[6]||0,j)):new Date(p[1],b,p[3]||1,p[4]||0,p[5]||0,p[6]||0,j)}}return new Date(c)}(u),this.$x=u.x||{},this.init()},l.init=function(){var u=this.$d;this.$y=u.getFullYear(),this.$M=u.getMonth(),this.$D=u.getDate(),this.$W=u.getDay(),this.$H=u.getHours(),this.$m=u.getMinutes(),this.$s=u.getSeconds(),this.$ms=u.getMilliseconds()},l.$utils=function(){return O},l.isValid=function(){return this.$d.toString()!==d},l.isSame=function(u,h){var c=M(u);return this.startOf(h)<=c&&c<=this.endOf(h)},l.isAfter=function(u,h){return M(u)e.replace(/\B([A-Z])/g,"-$1").toLowerCase(),Z=(e,n=[])=>{const t=[],r=function(i,o){if(!Array.isArray(o))return null;for(let s=0,a=o.length;s{var a,f,v,$;return((f=(a=e.value)==null?void 0:a.items)==null?void 0:f.find(E=>E.id===n.value))||(($=(v=e.value)==null?void 0:v.items)==null?void 0:$[0])}),i=document.documentElement.getBoundingClientRect().width,o=new yr({designWidth:i,config:e.value,platform:"editor"});return globalThis.appInstance=o,Vue.provide("app",o),Vue.watch(r,async()=>{await Vue.nextTick();const a=document.querySelector(".magic-ui-page");a&&window.magic.onPageElUpdate(a)}),(s=window.magic)==null||s.onRuntimeReady({getApp(){return o},updateRootConfig(a){console.log("update config",a),e.value=a,o==null||o.setConfig(a,n.value)},updatePageId(a){console.log("update page id",a),n.value=a,o==null||o.setPage(a)},select(a){console.log("select config",a),t.value=a;const f=document.getElementById(`${a}`);return f||Vue.nextTick().then(()=>document.getElementById(`${a}`))},add({config:a,parentId:f}){var $,E,x;if(console.log("add config",a),!e.value)throw new Error("error");if(!t.value)throw new Error("error");if(!f)throw new Error("error");const v=Z(f,[e.value]).pop();if(!v)throw new Error("\u672A\u627E\u5230\u7236\u8282\u70B9");if(v.id!==t.value){const S=($=v.items)==null?void 0:$.findIndex(P=>P.id===t.value);(E=v.items)==null||E.splice(S+1,0,a)}else(x=v.items)==null||x.push(a)},update({config:a,parentId:f}){var x;if(console.log("update config",a),!e.value)throw new Error("error");const v=Z(a.id,[e.value]).pop();if(!f)throw new Error("error");const $=Z(f,[e.value]).pop();if(!v)throw new Error("\u672A\u627E\u5230\u76EE\u6807\u8282\u70B9");if(!$)throw new Error("\u672A\u627E\u5230\u7236\u8282\u70B9");const E=(x=$.items)==null?void 0:x.findIndex(S=>S.id===v.id);$.items.splice(E,1,Vue.reactive(a))},remove({id:a,parentId:f}){var x;if(!e.value)throw new Error("error");const v=Z(a,[e.value]).pop();if(!v)throw new Error("\u672A\u627E\u5230\u76EE\u6807\u5143\u7D20");const $=Z(f,[e.value]).pop();if(!$)throw new Error("\u672A\u627E\u5230\u7236\u5143\u7D20");const E=(x=$.items)==null?void 0:x.findIndex(S=>S.id===v.id);$.items.splice(E,1)}}),{pageConfig:r}}}),Or=(e,n)=>{const t=e.__vccOpts||e;for(const[r,i]of n)t[r]=i;return t};function Tr(e,n,t,r,i,o){const s=Vue.resolveComponent("magic-ui-page");return e.pageConfig?(Vue.openBlock(),Vue.createBlock(s,{key:0,config:e.pageConfig},null,8,["config"])):Vue.createCommentVNode("v-if",!0)}const Er=Or(wr,[["render",Tr],["__file","/parisma/github/tmagic-editor/runtime/vue3/playground/App.vue"]]);Promise.all([we(()=>import("./comp-entry.12facb0c.js"),[]),we(()=>import("./plugin-entry.b765d2c2.js"),[])]).then(([e,n])=>{const t=Vue.createApp(Er);Object.entries(e.default).forEach(([r,i])=>{t.component(`magic-ui-${r}`,i)}),Object.values(n.default).forEach(r=>{t.use(r)}),t.mount("#app")});export{Or as _,_r as __vite_legacy_guard,jr as t}; //# sourceMappingURL=index.6b44beaf.js.map