(function(O,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react"),require("@easy-coder/sdk/helper"),require("@easy-coder/sdk/store"),require("@easy-coder/sdk/style"),require("@easy-coder/sdk/event"),require("@easy-coder/sdk/variable"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","@easy-coder/sdk/helper","@easy-coder/sdk/store","@easy-coder/sdk/style","@easy-coder/sdk/event","@easy-coder/sdk/variable","react-dom"],c):(O=typeof globalThis<"u"?globalThis:O||self,c(O.index={},O.require$$0,O.helper,O.store,O.style,O.event,O.variable,O.ReactDOM))})(this,function(O,c,Q,y,ee,ve,te,rt){"use strict";function nt(o){return o&&o.__esModule&&Object.prototype.hasOwnProperty.call(o,"default")?o.default:o}var pe={exports:{}},re={};/**
 * @license React
 * react-jsx-runtime.production.min.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var Se;function at(){if(Se)return re;Se=1;var o=c,r=Symbol.for("react.element"),s=Symbol.for("react.fragment"),u=Object.prototype.hasOwnProperty,d=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(n,p,w){var E,g={},P=null,R=null;w!==void 0&&(P=""+w),p.key!==void 0&&(P=""+p.key),p.ref!==void 0&&(R=p.ref);for(E in p)u.call(p,E)&&!i.hasOwnProperty(E)&&(g[E]=p[E]);if(n&&n.defaultProps)for(E in p=n.defaultProps,p)g[E]===void 0&&(g[E]=p[E]);return{$$typeof:r,type:n,key:P,ref:R,props:g,_owner:d.current}}return re.Fragment=s,re.jsx=l,re.jsxs=l,re}var ne={};/**
 * @license React
 * react-jsx-runtime.development.js
 *
 * Copyright (c) Facebook, Inc. and its affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var je;function st(){return je||(je=1,process.env.NODE_ENV!=="production"&&function(){var o=c,r=Symbol.for("react.element"),s=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),d=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),n=Symbol.for("react.context"),p=Symbol.for("react.forward_ref"),w=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),g=Symbol.for("react.memo"),P=Symbol.for("react.lazy"),R=Symbol.for("react.offscreen"),F=Symbol.iterator,D="@@iterator";function J(e){if(e===null||typeof e!="object")return null;var t=F&&e[F]||e[D];return typeof t=="function"?t:null}var Y=o.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function _(e){{for(var t=arguments.length,a=new Array(t>1?t-1:0),f=1;f<t;f++)a[f-1]=arguments[f];H("error",e,a)}}function H(e,t,a){{var f=Y.ReactDebugCurrentFrame,b=f.getStackAddendum();b!==""&&(t+="%s",a=a.concat([b]));var x=a.map(function(h){return String(h)});x.unshift("Warning: "+t),Function.prototype.apply.call(console[e],console,x)}}var X=!1,N=!1,U=!1,L=!1,C=!1,S;S=Symbol.for("react.module.reference");function A(e){return!!(typeof e=="string"||typeof e=="function"||e===u||e===i||C||e===d||e===w||e===E||L||e===R||X||N||U||typeof e=="object"&&e!==null&&(e.$$typeof===P||e.$$typeof===g||e.$$typeof===l||e.$$typeof===n||e.$$typeof===p||e.$$typeof===S||e.getModuleId!==void 0))}function M(e,t,a){var f=e.displayName;if(f)return f;var b=t.displayName||t.name||"";return b!==""?a+"("+b+")":a}function I(e){return e.displayName||"Context"}function k(e){if(e==null)return null;if(typeof e.tag=="number"&&_("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case u:return"Fragment";case s:return"Portal";case i:return"Profiler";case d:return"StrictMode";case w:return"Suspense";case E:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case n:var t=e;return I(t)+".Consumer";case l:var a=e;return I(a._context)+".Provider";case p:return M(e,e.render,"ForwardRef");case g:var f=e.displayName||null;return f!==null?f:k(e.type)||"Memo";case P:{var b=e,x=b._payload,h=b._init;try{return k(h(x))}catch{return null}}}return null}var G=Object.assign,W=0,ce,Ie,Fe,Ne,Ve,We,Be;function Le(){}Le.__reactDisabledLog=!0;function wt(){{if(W===0){ce=console.log,Ie=console.info,Fe=console.warn,Ne=console.error,Ve=console.group,We=console.groupCollapsed,Be=console.groupEnd;var e={configurable:!0,enumerable:!0,value:Le,writable:!0};Object.defineProperties(console,{info:e,log:e,warn:e,error:e,group:e,groupCollapsed:e,groupEnd:e})}W++}}function Ct(){{if(W--,W===0){var e={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:G({},e,{value:ce}),info:G({},e,{value:Ie}),warn:G({},e,{value:Fe}),error:G({},e,{value:Ne}),group:G({},e,{value:Ve}),groupCollapsed:G({},e,{value:We}),groupEnd:G({},e,{value:Be})})}W<0&&_("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var ge=Y.ReactCurrentDispatcher,be;function ue(e,t,a){{if(be===void 0)try{throw Error()}catch(b){var f=b.stack.trim().match(/\n( *(at )?)/);be=f&&f[1]||""}return`
`+be+e}}var Ee=!1,le;{var St=typeof WeakMap=="function"?WeakMap:Map;le=new St}function Ye(e,t){if(!e||Ee)return"";{var a=le.get(e);if(a!==void 0)return a}var f;Ee=!0;var b=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var x;x=ge.current,ge.current=null,wt();try{if(t){var h=function(){throw Error()};if(Object.defineProperty(h.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(h,[])}catch(B){f=B}Reflect.construct(e,[],h)}else{try{h.call()}catch(B){f=B}e.call(h.prototype)}}else{try{throw Error()}catch(B){f=B}e()}}catch(B){if(B&&f&&typeof B.stack=="string"){for(var m=B.stack.split(`
`),V=f.stack.split(`
`),j=m.length-1,T=V.length-1;j>=1&&T>=0&&m[j]!==V[T];)T--;for(;j>=1&&T>=0;j--,T--)if(m[j]!==V[T]){if(j!==1||T!==1)do if(j--,T--,T<0||m[j]!==V[T]){var K=`
`+m[j].replace(" at new "," at ");return e.displayName&&K.includes("<anonymous>")&&(K=K.replace("<anonymous>",e.displayName)),typeof e=="function"&&le.set(e,K),K}while(j>=1&&T>=0);break}}}finally{Ee=!1,ge.current=x,Ct(),Error.prepareStackTrace=b}var $=e?e.displayName||e.name:"",Z=$?ue($):"";return typeof e=="function"&&le.set(e,Z),Z}function jt(e,t,a){return Ye(e,!1)}function Tt(e){var t=e.prototype;return!!(t&&t.isReactComponent)}function fe(e,t,a){if(e==null)return"";if(typeof e=="function")return Ye(e,Tt(e));if(typeof e=="string")return ue(e);switch(e){case w:return ue("Suspense");case E:return ue("SuspenseList")}if(typeof e=="object")switch(e.$$typeof){case p:return jt(e.render);case g:return fe(e.type,t,a);case P:{var f=e,b=f._payload,x=f._init;try{return fe(x(b),t,a)}catch{}}}return""}var se=Object.prototype.hasOwnProperty,Ue={},Ge=Y.ReactDebugCurrentFrame;function de(e){if(e){var t=e._owner,a=fe(e.type,e._source,t?t.type:null);Ge.setExtraStackFrame(a)}else Ge.setExtraStackFrame(null)}function Ot(e,t,a,f,b){{var x=Function.call.bind(se);for(var h in e)if(x(e,h)){var m=void 0;try{if(typeof e[h]!="function"){var V=Error((f||"React class")+": "+a+" type `"+h+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof e[h]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw V.name="Invariant Violation",V}m=e[h](t,h,f,a,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(j){m=j}m&&!(m instanceof Error)&&(de(b),_("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",f||"React class",a,h,typeof m),de(null)),m instanceof Error&&!(m.message in Ue)&&(Ue[m.message]=!0,de(b),_("Failed %s type: %s",a,m.message),de(null))}}}var kt=Array.isArray;function Re(e){return kt(e)}function At(e){{var t=typeof Symbol=="function"&&Symbol.toStringTag,a=t&&e[Symbol.toStringTag]||e.constructor.name||"Object";return a}}function Dt(e){try{return Ke(e),!1}catch{return!0}}function Ke(e){return""+e}function ze(e){if(Dt(e))return _("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",At(e)),Ke(e)}var oe=Y.ReactCurrentOwner,Mt={key:!0,ref:!0,__self:!0,__source:!0},Je,He,xe;xe={};function It(e){if(se.call(e,"ref")){var t=Object.getOwnPropertyDescriptor(e,"ref").get;if(t&&t.isReactWarning)return!1}return e.ref!==void 0}function Ft(e){if(se.call(e,"key")){var t=Object.getOwnPropertyDescriptor(e,"key").get;if(t&&t.isReactWarning)return!1}return e.key!==void 0}function Nt(e,t){if(typeof e.ref=="string"&&oe.current&&t&&oe.current.stateNode!==t){var a=k(oe.current.type);xe[a]||(_('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',k(oe.current.type),e.ref),xe[a]=!0)}}function Vt(e,t){{var a=function(){Je||(Je=!0,_("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};a.isReactWarning=!0,Object.defineProperty(e,"key",{get:a,configurable:!0})}}function Wt(e,t){{var a=function(){He||(He=!0,_("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",t))};a.isReactWarning=!0,Object.defineProperty(e,"ref",{get:a,configurable:!0})}}var Bt=function(e,t,a,f,b,x,h){var m={$$typeof:r,type:e,key:t,ref:a,props:h,_owner:x};return m._store={},Object.defineProperty(m._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(m,"_self",{configurable:!1,enumerable:!1,writable:!1,value:f}),Object.defineProperty(m,"_source",{configurable:!1,enumerable:!1,writable:!1,value:b}),Object.freeze&&(Object.freeze(m.props),Object.freeze(m)),m};function Lt(e,t,a,f,b){{var x,h={},m=null,V=null;a!==void 0&&(ze(a),m=""+a),Ft(t)&&(ze(t.key),m=""+t.key),It(t)&&(V=t.ref,Nt(t,b));for(x in t)se.call(t,x)&&!Mt.hasOwnProperty(x)&&(h[x]=t[x]);if(e&&e.defaultProps){var j=e.defaultProps;for(x in j)h[x]===void 0&&(h[x]=j[x])}if(m||V){var T=typeof e=="function"?e.displayName||e.name||"Unknown":e;m&&Vt(h,T),V&&Wt(h,T)}return Bt(e,m,V,b,f,oe.current,h)}}var _e=Y.ReactCurrentOwner,Xe=Y.ReactDebugCurrentFrame;function q(e){if(e){var t=e._owner,a=fe(e.type,e._source,t?t.type:null);Xe.setExtraStackFrame(a)}else Xe.setExtraStackFrame(null)}var Pe;Pe=!1;function we(e){return typeof e=="object"&&e!==null&&e.$$typeof===r}function Ze(){{if(_e.current){var e=k(_e.current.type);if(e)return`

Check the render method of \``+e+"`."}return""}}function Yt(e){{if(e!==void 0){var t=e.fileName.replace(/^.*[\\\/]/,""),a=e.lineNumber;return`

Check your code at `+t+":"+a+"."}return""}}var Qe={};function Ut(e){{var t=Ze();if(!t){var a=typeof e=="string"?e:e.displayName||e.name;a&&(t=`

Check the top-level render call using <`+a+">.")}return t}}function qe(e,t){{if(!e._store||e._store.validated||e.key!=null)return;e._store.validated=!0;var a=Ut(t);if(Qe[a])return;Qe[a]=!0;var f="";e&&e._owner&&e._owner!==_e.current&&(f=" It was passed a child from "+k(e._owner.type)+"."),q(e),_('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',a,f),q(null)}}function $e(e,t){{if(typeof e!="object")return;if(Re(e))for(var a=0;a<e.length;a++){var f=e[a];we(f)&&qe(f,t)}else if(we(e))e._store&&(e._store.validated=!0);else if(e){var b=J(e);if(typeof b=="function"&&b!==e.entries)for(var x=b.call(e),h;!(h=x.next()).done;)we(h.value)&&qe(h.value,t)}}}function Gt(e){{var t=e.type;if(t==null||typeof t=="string")return;var a;if(typeof t=="function")a=t.propTypes;else if(typeof t=="object"&&(t.$$typeof===p||t.$$typeof===g))a=t.propTypes;else return;if(a){var f=k(t);Ot(a,e.props,"prop",f,e)}else if(t.PropTypes!==void 0&&!Pe){Pe=!0;var b=k(t);_("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",b||"Unknown")}typeof t.getDefaultProps=="function"&&!t.getDefaultProps.isReactClassApproved&&_("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function Kt(e){{for(var t=Object.keys(e.props),a=0;a<t.length;a++){var f=t[a];if(f!=="children"&&f!=="key"){q(e),_("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",f),q(null);break}}e.ref!==null&&(q(e),_("Invalid attribute `ref` supplied to `React.Fragment`."),q(null))}}var et={};function tt(e,t,a,f,b,x){{var h=A(e);if(!h){var m="";(e===void 0||typeof e=="object"&&e!==null&&Object.keys(e).length===0)&&(m+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var V=Yt(b);V?m+=V:m+=Ze();var j;e===null?j="null":Re(e)?j="array":e!==void 0&&e.$$typeof===r?(j="<"+(k(e.type)||"Unknown")+" />",m=" Did you accidentally export a JSX literal instead of a component?"):j=typeof e,_("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",j,m)}var T=Lt(e,t,a,b,x);if(T==null)return T;if(h){var K=t.children;if(K!==void 0)if(f)if(Re(K)){for(var $=0;$<K.length;$++)$e(K[$],e);Object.freeze&&Object.freeze(K)}else _("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else $e(K,e)}if(se.call(t,"key")){var Z=k(e),B=Object.keys(t).filter(function(Qt){return Qt!=="key"}),Ce=B.length>0?"{key: someKey, "+B.join(": ..., ")+": ...}":"{key: someKey}";if(!et[Z+Ce]){var Zt=B.length>0?"{"+B.join(": ..., ")+": ...}":"{}";_(`A props object containing a "key" prop is being spread into JSX:
  let props = %s;
  <%s {...props} />
React keys must be passed directly to JSX without using spread:
  let props = %s;
  <%s key={someKey} {...props} />`,Ce,Z,Zt,Z),et[Z+Ce]=!0}}return e===u?Kt(T):Gt(T),T}}function zt(e,t,a){return tt(e,t,a,!0)}function Jt(e,t,a){return tt(e,t,a,!1)}var Ht=Jt,Xt=zt;ne.Fragment=u,ne.jsx=Ht,ne.jsxs=Xt}()),ne}process.env.NODE_ENV==="production"?pe.exports=at():pe.exports=st();var v=pe.exports;const me=c.createContext({extra:new Q.LazyActive([])});function Te({children:o,extra:r}){const s=c.useRef(new Q.LazyActive([]));c.useEffect(()=>{s.current.updateValue(r||[])},[r]);const u=c.useMemo(()=>({extra:s.current}),[]);return v.jsx(me.Provider,{value:u,children:o})}function ot(){return c.useContext(me)}function ae(o,r){const{extra:s}=c.useContext(me),[u,d,i]=Q.useRefState(Oe(s.getValue(),o,r));return c.useEffect(()=>s.addChangeListener(()=>{const l=Oe(s.getValue(),o,r);l!==d.current&&i(l)}),[o,r]),u}function Oe(o,r,s){return o==null?void 0:o.find(u=>u.type===r&&u.id===s)}var ke={exports:{}};/*!
	Copyright (c) 2018 Jed Watson.
	Licensed under the MIT License (MIT), see
	http://jedwatson.github.io/classnames
*/(function(o){(function(){var r={}.hasOwnProperty;function s(){for(var i="",l=0;l<arguments.length;l++){var n=arguments[l];n&&(i=d(i,u(n)))}return i}function u(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return s.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var l="";for(var n in i)r.call(i,n)&&i[n]&&(l=d(l,n));return l}function d(i,l){return l?i?i+" "+l:i+l:i}o.exports?(s.default=s,o.exports=s):window.classNames=s})()})(ke);var it=ke.exports;const z=nt(it),ct=c.createContext(null),ye={didCatch:!1,error:null};class ut extends c.Component{constructor(r){super(r),this.resetErrorBoundary=this.resetErrorBoundary.bind(this),this.state=ye}static getDerivedStateFromError(r){return{didCatch:!0,error:r}}resetErrorBoundary(){const{error:r}=this.state;if(r!==null){for(var s,u,d=arguments.length,i=new Array(d),l=0;l<d;l++)i[l]=arguments[l];(s=(u=this.props).onReset)===null||s===void 0||s.call(u,{args:i,reason:"imperative-api"}),this.setState(ye)}}componentDidCatch(r,s){var u,d;(u=(d=this.props).onError)===null||u===void 0||u.call(d,r,s)}componentDidUpdate(r,s){const{didCatch:u}=this.state,{resetKeys:d}=this.props;if(u&&s.error!==null&&lt(r.resetKeys,d)){var i,l;(i=(l=this.props).onReset)===null||i===void 0||i.call(l,{next:d,prev:r.resetKeys,reason:"keys"}),this.setState(ye)}}render(){const{children:r,fallbackRender:s,FallbackComponent:u,fallback:d}=this.props,{didCatch:i,error:l}=this.state;let n=r;if(i){const p={error:l,resetErrorBoundary:this.resetErrorBoundary};if(typeof s=="function")n=s(p);else if(u)n=c.createElement(u,p);else if(d===null||c.isValidElement(d))n=d;else throw l}return c.createElement(ct.Provider,{value:{didCatch:i,error:l,resetErrorBoundary:this.resetErrorBoundary}},n)}}function lt(){let o=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[];return o.length!==r.length||o.some((s,u)=>!Object.is(s,r[u]))}const ie="data-edit-id",Ae="data-element-id",ft="data-slot-order";function dt({id:o,payload:r}){const s=y.useStateById("editor",o),u=y.useEnv(),d=y.useRootId(),i=ae("editor",o),l=y.useActiveGlobalStyleVarGroup(),n=c.useMemo(()=>new ee.StyleConvert().toString(s.style,l==null?void 0:l.vars),[s.style,l==null?void 0:l.vars]),p=c.useMemo(()=>{var g;return(g=s.classNames)==null?void 0:g.map(P=>`${d}${P}`)},[s.classNames,d]),w=c.useMemo(()=>s.elements.map(g=>v.jsx(he,{id:g},g)),[s.elements]),E=c.useMemo(()=>{if(u.isPreviewing)return{[ie]:o}},[o,u.isPreviewing]);return!u.isPreviewing&&!s.elements.length?null:v.jsx("div",{...E,className:z("easy-coder-slot",p),style:n,children:v.jsxs(y.SlotProvider,{id:o,payload:r,children:[w,i&&v.jsx(i.Render,{...i.renderProps})]})})}function vt({reset:o,error:r,resetErrorBoundary:s,...u}){return c.useEffect(()=>{o&&s()},[o]),v.jsx("div",{...u,style:{padding:8,borderRadius:4,backgroundColor:"red",fontSize:"1rem",fontWeight:"bold",display:"inline-block",color:"#fff"},children:"渲染组件失败"})}function pt({id:o,element:r,env:s,variableDefine:u,variableValue:d,addDependent:i}){const l=y.useStore(),n=y.useElement(r.type),p=y.useSlotContext(),w=y.useActiveGlobalStyleVarGroup(),E=y.useRootId(),g=ae("element",o),P=c.useRef(!1),[R,F]=c.useState(!1),[D,J]=c.useState({});c.useEffect(()=>{P.current&&F(!0)},[D]);const Y=c.useCallback(async(C,S,A,M)=>{const I={};for(const k in C.attr){const G=C.attr[k],W=M==null?void 0:M[k];if(y.isRefVariableDefine(G)){i(W),I[k]=W!=null&&W.length?y.getValueByPath(W,A):void 0;continue}if(te.isFxValue(W)){const ce=await te.computedFormula({context:A,contextDefine:S,code:W.code,onVariablePath:i});I[k]=ce}else I[k]=W}J(I)},[]);c.useEffect(()=>{n&&Y(n,u,d,r.props)},[r.props,n,u,d]);const _=c.useMemo(()=>{var S;const C={};for(const A in n==null?void 0:n.slot){const M=(S=r.slotMap)==null?void 0:S[A];M&&(C[A]=I=>v.jsx(dt,{id:M,payload:I}))}return C},[r.slotMap,n]),H=c.useMemo(()=>{var S;const C={};for(const A in n==null?void 0:n.style)C[A]=new ee.StyleConvert().toString((S=r.props)==null?void 0:S[A],w==null?void 0:w.vars)||{};return C},[r.props,w==null?void 0:w.vars,n]),X=c.useMemo(()=>{var S,A;const C={};for(const M in n==null?void 0:n.className)C[M]=z((A=(S=r.props)==null?void 0:S[M])==null?void 0:A.map(I=>`${E}${I}`));return C},[r.props,n,E]),N=Q.useEffectCallback(async(C,S,A)=>{if(s.isPreviewing)return;const M=await y.parseEvent(o,C,l.state.getValue(),l.elements.getValue(),u);try{return await ve.executeEvent({value:S,triggerMethod:M,triggerParams:A,variables:u,variableContext:y.getElementVariable(l.variableStore,p),store:l})}catch(I){console.error(I)}},[o,p,u,s.isPreviewing]),U=c.useMemo(()=>{const C={};for(const S in n==null?void 0:n.event)C[S]=(...A)=>{var k,G;const M=(k=n==null?void 0:n.event)==null?void 0:k[S],I=(G=r.props)==null?void 0:G[S];!M||!I||N(M,I,A)};return C},[r,n]),L=c.useMemo(()=>{if(!n)return;const C=s.isPreviewing?{[Ae]:o}:void 0;return v.jsx(ut,{onError:()=>P.current=!0,onReset:()=>{P.current=!1,F(!1)},fallbackRender:S=>v.jsx(vt,{reset:R,...S,...C}),children:v.jsx(y.ElementProvider,{id:o,children:v.jsx(n.Render,{...H,...X,...D,..._,...U,...C})})})},[D,R,_,o,n,s.isPreviewing]);return v.jsxs(v.Fragment,{children:[L,g&&v.jsx(g.Render,{...g.renderProps})]})}function he({id:o}){var E;const r=y.useEnv(),s=y.useStateById("element",o),{initComplete:u,variableDefine:d}=y.useVariableDefine(),{variableValue:i,addDependent:l}=y.useVariableValue(),[n,p]=c.useState(((E=s.visibleCondition)==null?void 0:E.type)!=="condition"),w=c.useCallback(async(g,P,R)=>{if((R==null?void 0:R.type)!=="condition")return;const F=await te.computedCondition({condition:R.condition,context:g,contextDefine:P,onVariablePath:l});p(F)},[]);if(c.useEffect(()=>{!u||r.isPreviewing||w(i,d,s.visibleCondition)},[u,d,i,s.visibleCondition,r.isPreviewing]),!(!u||!n&&!r.isPreviewing))return v.jsx(pt,{id:o,element:s,env:r,variableDefine:d,variableValue:i,addDependent:l})}function mt(){const o=y.useRootId(),r=c.useRef(document.createElement("style")),s=y.useStore(),u=y.useEnv(),d=ae("editor",o||""),i=y.useActiveGlobalStyleVarGroup(),l=y.useGlobalClassName(),n=y.useStateById("editor",o||""),p=Q.useEffectCallback(async R=>{const F={label:""};try{await ve.executeEvent({value:R,triggerMethod:F,variables:s.variableDefine.getValue(),variableContext:s.variableStore.getValue(),store:s})}catch(D){console.error(D)}},[]);c.useEffect(()=>{if(!((n==null?void 0:n.type)!=="root"||u.isPreviewing))return n.onInit&&p(n.onInit),()=>{n.onDestroy&&p(n.onDestroy)}},[n,u]),c.useEffect(()=>(r.current.setAttribute("type","text/css"),document.head.appendChild(r.current),()=>{document.head.removeChild(r.current)}),[]),c.useEffect(()=>{o&&(r.current.innerText=new ee.StyleConvert().globalStyleToString(l,i==null?void 0:i.vars,[o]))},[o,l,i==null?void 0:i.vars]);const w=c.useMemo(()=>new ee.StyleConvert().toString(n==null?void 0:n.style,i==null?void 0:i.vars),[n==null?void 0:n.style,i==null?void 0:i.vars]),E=c.useMemo(()=>{var R;return(R=n==null?void 0:n.classNames)==null?void 0:R.map(F=>`${o}${F}`)},[n==null?void 0:n.classNames,o]),g=c.useMemo(()=>n==null?void 0:n.elements.map(R=>v.jsx(he,{id:R},R)),[n==null?void 0:n.elements]),P=c.useMemo(()=>{if(u.isPreviewing)return{[ie]:o}},[o,u.isPreviewing]);return o?v.jsxs("div",{...P,className:z("easy-coder-root",E),style:w,children:[g,d&&v.jsx(d.Render,{...d.renderProps})]}):v.jsx("span",{children:"未找到根节点"})}const yt=c.memo(mt,()=>!0),qt="",ht={close:`<path
      d="M504.224 470.288l207.84-207.84a16 16 0 0 1 22.608 0l11.328 11.328a16 16 0 0 1 0 22.624l-207.84 207.824 207.84 207.84a16 16 0 0 1 0 22.608l-11.328 11.328a16 16 0 0 1-22.624 0l-207.824-207.84-207.84 207.84a16 16 0 0 1-22.608 0l-11.328-11.328a16 16 0 0 1 0-22.624l207.84-207.824-207.84-207.84a16 16 0 0 1 0-22.608l11.328-11.328a16 16 0 0 1 22.624 0l207.824 207.84z"
      />`,refresh:`<path
      d="M927.999436 531.028522a31.998984 31.998984 0 0 0-31.998984 31.998984c0 51.852948-10.147341 102.138098-30.163865 149.461048a385.47252 385.47252 0 0 1-204.377345 204.377345c-47.32295 20.016524-97.6081 30.163865-149.461048 30.163865s-102.138098-10.147341-149.461048-30.163865a385.47252 385.47252 0 0 1-204.377345-204.377345c-20.016524-47.32295-30.163865-97.6081-30.163865-149.461048s10.147341-102.138098 30.163865-149.461048a385.47252 385.47252 0 0 1 204.377345-204.377345c47.32295-20.016524 97.6081-30.163865 149.461048-30.163865a387.379888 387.379888 0 0 1 59.193424 4.533611l-56.538282 22.035878A31.998984 31.998984 0 1 0 537.892156 265.232491l137.041483-53.402685a31.998984 31.998984 0 0 0 18.195855-41.434674L639.723197 33.357261a31.998984 31.998984 0 1 0-59.630529 23.23882l26.695923 68.502679a449.969005 449.969005 0 0 0-94.786785-10.060642c-60.465003 0-119.138236 11.8488-174.390489 35.217667a449.214005 449.214005 0 0 0-238.388457 238.388457c-23.361643 55.252253-35.22128 113.925486-35.22128 174.390489s11.8488 119.138236 35.217668 174.390489a449.214005 449.214005 0 0 0 238.388457 238.388457c55.252253 23.368867 113.925486 35.217667 174.390489 35.217667s119.138236-11.8488 174.390489-35.217667A449.210393 449.210393 0 0 0 924.784365 737.42522c23.368867-55.270316 35.217667-113.925486 35.217667-174.390489a31.998984 31.998984 0 0 0-32.002596-32.006209z"
      />`};function gt({type:o,className:r,...s},u){return v.jsx("svg",{className:z("rabbit-icon","rabbit-component",r),viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg",...s,ref:u,dangerouslySetInnerHTML:{__html:ht[o]}})}const bt=c.forwardRef(gt),$t="",De=200,Me={left:0,top:0,width:"100vw",height:"100vh"};function Et({header:o,content:r,visible:s,width:u,height:d,placement:i="center",style:l,className:n,zIndex:p,preventMouseOver:w,preventAutoClose:E,onClose:g,onVisibleChange:P,getContainer:R=()=>document.body,...F}){const[D,J]=c.useState(!!s),[Y,_]=c.useState(!s),[H,X]=c.useState(Me);c.useEffect(()=>{D!==s&&s!==void 0&&(s?(setTimeout(()=>{_(!1)},60),J(!0)):(_(!0),U(!1)))},[s]),c.useEffect(()=>{D!==s&&(P==null||P(D))},[D]),c.useEffect(()=>{R()===document.body?X(Me):X(R().getBoundingClientRect())},[R]);const N=c.useCallback(()=>{E||(_(!0),U(!1)),g==null||g()},[E,g]),U=c.useCallback(L=>{setTimeout(()=>{J(L)},De)},[]);return D?rt.createPortal(v.jsx("div",{className:z("rabbit-modal-wrapper","rabbit-component",`placement-${i}`),style:{zIndex:p},onMouseOverCapture:L=>w&&L.preventDefault(),children:v.jsx("div",{className:z("modal-container",n),style:{width:H.width,height:H.height},children:v.jsxs("div",{...F,className:z("modal-content",{"is-hidden":Y}),style:{...l||{},width:u,height:d,"--animation-time":`${De/1e3}s`},children:[o&&v.jsxs("div",{className:"modal-header",children:[v.jsx("div",{children:o}),v.jsx(bt,{type:"close",style:{fontSize:"1.5rem"},onClick:N})]}),v.jsx("div",{className:"modal-body",children:r})]})})}),R()):v.jsx(v.Fragment,{})}function Rt({id:o,modal:r}){const s=y.useStore(),u=y.useEnv(),d=y.useRootId(),i=ae("editor",o),l=y.useChangeModalVisible(),n=y.useGetModalContainer(),p=y.useActiveGlobalStyleVarGroup(),[w,E]=c.useState(),{initComplete:g,variableDefine:P}=y.useVariableDefine(),{variableValue:R,addDependent:F}=y.useVariableValue(),D=Q.useEffectCallback(async N=>{const U={label:""};try{await ve.executeEvent({value:N,triggerMethod:U,variables:s.variableDefine.getValue(),variableContext:s.variableStore.getValue(),store:s})}catch(L){console.error(L)}},[]);c.useEffect(()=>{if(!u.isPreviewing)return r.onInit&&D(r.onInit),()=>{r.onDestroy&&D(r.onDestroy)}},[r,u]);const J=c.useCallback(async(N,U,L)=>{if(te.isFxValue(L)){const C=await te.computedFormula({context:U,contextDefine:N,code:L.code,onVariablePath:F});E(C)}else E(L)},[]);c.useEffect(()=>{g&&J(P,R,r.header)},[g,P,R,r.header]);const Y=c.useMemo(()=>new ee.StyleConvert().toString(r.style,p==null?void 0:p.vars),[r.style,p==null?void 0:p.vars]),_=c.useMemo(()=>{var N;return(N=r.classNames)==null?void 0:N.map(U=>`${d}${U}`)},[r.classNames,d]),H=c.useMemo(()=>r.elements.map(N=>v.jsx(he,{id:N},N)),[r.elements]),X=c.useMemo(()=>{if(u.isPreviewing)return{[ie]:o}},[o,u.isPreviewing]);return v.jsx(Et,{...X,visible:!0,placement:r.placement,width:r.width,getContainer:n,onClose:()=>l(o,!1),header:w||v.jsx("span",{}),content:v.jsxs("div",{style:Y,className:z(_),children:[H,i&&v.jsx(i.Render,{...i.renderProps})]})})}function xt(){const o=y.useVisibleModals();return v.jsx(v.Fragment,{children:o.map(({id:r,modal:s})=>v.jsx(Rt,{id:r,modal:s},r))})}const _t=c.memo(xt),er="";function Pt(o){return v.jsxs(Te,{...o,children:[v.jsx(yt,{}),v.jsx(_t,{})]})}O.DATA_EDITOR_ID=ie,O.DATA_ELEMENT_ID=Ae,O.DATA_SLOT_ORDER=ft,O.EasyCoderRender=Pt,O.RenderProvider=Te,O.useExtraRender=ae,O.useRenderContext=ot,Object.defineProperty(O,Symbol.toStringTag,{value:"Module"})});
