From 9ac42edde0f49082dcbcf7e5981839bf8deca681 Mon Sep 17 00:00:00 2001 From: Rizky Date: Sat, 23 Mar 2024 10:05:33 +0700 Subject: [PATCH] wip fix --- app/srv/core/main.js | 4 ++-- app/web/src/nova/ed/panel/tree/node/item/action.tsx | 8 +++++--- .../src/nova/ed/panel/tree/node/item/action/hide.tsx | 12 ++++-------- app/web/src/nova/vi/meta/comp/instantiate.tsx | 1 + app/web/src/nova/vi/render/render.tsx | 2 +- app/web/src/nova/vi/render/script/eval-script.tsx | 3 ++- app/web/src/nova/vi/render/script/passprop.tsx | 12 ++++++++++-- app/web/src/nova/vi/vi.tsx | 1 + 8 files changed, 26 insertions(+), 17 deletions(-) diff --git a/app/srv/core/main.js b/app/srv/core/main.js index d2cad8d0..ec6a3ef3 100644 --- a/app/srv/core/main.js +++ b/app/srv/core/main.js @@ -95,7 +95,7 @@ Error generating stack: `+i.message+` ${cy(e,t.mode)} ${qh(e,t.mode)} ${py(e,t.mode)} - `,(t?.hover||t?.active)&&dy({item:e,hover:t?.hover,active:t?.active}),Kh(e,t.mode)])}catch(n){console.log(n)}return cx([])};var yy=O(V()),To=(e,t,n,r)=>{let o=t.item,i;o.component?.style&&(i={style:o.component.style,className:Yu(o.component.style,{mode:e.mode})});let s={className:Yu(o,{mode:e.mode}),inherit:i},l={},a=t.item.childs,f;return t.item.type==="text"?(f=null,s.dangerouslySetInnerHTML={__html:t.item.html||""}):f=Array.isArray(a)&&a?.map(u=>{if(!u)return null;let{id:c}=u,d=n?e.layout?.meta[c]:e.meta[c];return d?(0,yy.jsx)(Tt,{meta:d,is_layout:n,passprop:r},c):null}),s.children=f,t.item.adv?.html?(delete s.children,s.dangerouslySetInnerHTML={__html:t.item.adv?.html}):t.item.adv?.js&&!t.item.adv.js.includes("children")&&(delete s.children,delete s.dangerouslySetInnerHTML),{props:s,text_props:l}};var Py=O(ce());var Ts=e=>({isMobile:e.mode==="mobile",isDesktop:e.mode==="desktop",isEditor:location.pathname.startsWith("/ed/")});var Ls=O(ce());var Xe=window;function ec(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function tc(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=ec(n);return(o,i)=>r.then(s=>i(s.transaction(t,o).objectStore(t)))}var Zu;function gy(){return Zu||(Zu=tc("keyval-store","keyval")),Zu}function nc(e,t=gy()){return t("readonly",n=>ec(n.get(e)))}function vy(e,t,n=gy()){return n("readwrite",r=>(r.put(t,e),ec(r.transaction)))}var Ax=tc("prasi-cache","prasi-cache-store"),Io={timeout:null,store:Ax},Is=(e,t)=>{let n=[...wy(t,"navigate(",")"),...wy(t,"href = ",";")],r=e.page.cur.id;e.page.navs[r]||(e.page.navs[r]=new Set);for(let o of n)e.page.navs[r].add(o);clearTimeout(Io.timeout),Io.timeout=setTimeout(()=>{e.on_nav_loaded&&e.on_nav_loaded({urls:Array.from(e.page.navs[r])})},100)},wy=(e,t,n)=>{let r=0,o=0,i=[];for(;;){let s=e.indexOf(t,r);if(o=r,s>=0){let l=e[s+t.length];if(l==='"'||l==="'"||l==="`"){let a=e.indexOf(`${l}${n}`,s+t.length+1),f=e.substring(s+t.length+1,a);r=a+2+n.length,i.push(f)}}if(o===r)break}return i};var Lo=O(ce());var Sy=O(Ju()),bo=O(ce());var rc=O(V()),_y=(e,t,n,r)=>o=>{n.item.script||(n.item.script={}),n.item.script.passprop||(n.item.script.passprop={});let i={};if(n.item.script.passprop){let a=!1;for(let[f,u]of Object.entries(o))["children","key"].includes(f)||(a=!0,i[f]=u,n.item.script.passprop[f]={end:0,start:0,value:u})}let s={...r,...i};if(!Array.isArray(o.children)&&(0,bo.isValidElement)(o.children)&&typeof o.children=="object"){let a=(0,Sy.default)(o.children,"props.meta.item.component.props.child.content.childs");if(Array.isArray(a)){let f=!0;for(let u of a)!(0,bo.isValidElement)(u)&&typeof u=="object"||(f=!1);if(f)return a.map(u=>{let c=e.meta[u.id];return c?(0,rc.jsx)(Tt,{is_layout:t,meta:c,passprop:s},u.id):null})}}if(!Array.isArray(o.children)&&!(0,bo.isValidElement)(o.children)&&typeof o.children=="object"){let a=o.children.id;if(a){let f=e.meta[a];return(0,rc.jsx)(Tt,{is_layout:t,meta:f,passprop:s})}}return oc(o,n.script?.scope)},oc=(e,t)=>{let n={};if(Array.isArray(e)?n.children=e:n=e,Array.isArray(n.children)){let r=[];for(let o of n.children)r.push(xy(o,n,t));return r}return xy(n.children,n,t)},xy=(e,t,n)=>{if((0,bo.isValidElement)(e)){let r={...t};return delete r.children,{...e,props:{...e.props,passprop:{...n,...r}}}}return e};var mr={},ky=(e,t,n)=>r=>{let o=["localhost","prasi.avolut.com"].includes(location.hostname)&&location.pathname.startsWith("/ed/"),i=n.item.id,{children:s}=r,l=e.script?.init_local_effect,a=t?e.layout?.meta:e.meta,u=(0,Lo.useRef)(mr[i]?mr[i]:r.value).current;return u.render=n.render,bs(e,n,n.script?.scope),r.hook&&r.hook(u),(0,Lo.useEffect)(()=>{if(n.parent?.instance_id&&a){let d=a[n.parent?.instance_id];if(d&&d.instances){for(let[y,m]of Object.entries(d.instances[n.parent.instance_id]))if(m===n.item.id){i=y;break}}}return!l[i]&&(typeof l=="object"&&(l[i]=!0),(async()=>r.effect&&(await r.effect(u),o&&(mr[i]=u)))()),()=>{}},[location.pathname]),(0,Lo.useEffect)(()=>{o&&mr[i]===null&&(async()=>r.effect&&(await r.effect(u),o&&(mr[i]=u)))()},[mr[i]]),oc(s,{...n.script?.scope,[r.name]:u})};var ic=O(V()),Ey=(e,t,n,r)=>{let o=To(e,t,n,r);e.visit&&e.visit(t,o),t.script?t.script.scope=r:t.script={scope:r,result:null,Local:ky(e,n,t),PassProp:_y(e,n,t,r)};let i=t.script,s=window.exports,l={useEffect:Ls.useEffect,children:o.props.children,props:o.props,Local:i.Local,db:e.site.db,api:e.site.api,PassProp:i?.PassProp,ErrorBox:mt,newElement:()=>{},render:c=>{i.result=(0,ic.jsx)(Ls.Suspense,{children:c})},params,...Ts(e),...s,...r};if(typeof r=="object"){for(let[c,d]of Object.entries(r))if(typeof d=="object"&&d&&d._jsx){let y=d;l[c]=(0,ic.jsx)(jx,{fn:y.fn,passprop:r,meta:t})}}!Xe.isEditor&&t.item.adv?.js&&Is(e,t.item.adv.js);let a=t.item.adv?.jsBuilt||"",f=lc(a,sc)||"";new Function(...Object.keys(l),`// ${t.item.name}: ${t.item.id} + `,(t?.hover||t?.active)&&dy({item:e,hover:t?.hover,active:t?.active}),Kh(e,t.mode)])}catch(n){console.log(n)}return cx([])};var yy=O(V()),To=(e,t,n,r)=>{let o=t.item,i;o.component?.style&&(i={style:o.component.style,className:Yu(o.component.style,{mode:e.mode})});let s={className:Yu(o,{mode:e.mode}),inherit:i},l={},a=t.item.childs,f;return t.item.type==="text"?(f=null,s.dangerouslySetInnerHTML={__html:t.item.html||""}):f=Array.isArray(a)&&a?.map(u=>{if(!u)return null;let{id:c}=u,d=n?e.layout?.meta[c]:e.meta[c];return d?(0,yy.jsx)(Tt,{meta:d,is_layout:n,passprop:r},c):null}),s.children=f,t.item.adv?.html?(delete s.children,s.dangerouslySetInnerHTML={__html:t.item.adv?.html}):t.item.adv?.js&&!t.item.adv.js.includes("children")&&(delete s.children,delete s.dangerouslySetInnerHTML),{props:s,text_props:l}};var Py=O(ce());var Ts=e=>({isMobile:e.mode==="mobile",isDesktop:e.mode==="desktop",isEditor:location.pathname.startsWith("/ed/")});var Ls=O(ce());var Xe=window;function ec(e){return new Promise((t,n)=>{e.oncomplete=e.onsuccess=()=>t(e.result),e.onabort=e.onerror=()=>n(e.error)})}function tc(e,t){let n=indexedDB.open(e);n.onupgradeneeded=()=>n.result.createObjectStore(t);let r=ec(n);return(o,i)=>r.then(s=>i(s.transaction(t,o).objectStore(t)))}var Zu;function gy(){return Zu||(Zu=tc("keyval-store","keyval")),Zu}function nc(e,t=gy()){return t("readonly",n=>ec(n.get(e)))}function vy(e,t,n=gy()){return n("readwrite",r=>(r.put(t,e),ec(r.transaction)))}var Ax=tc("prasi-cache","prasi-cache-store"),Io={timeout:null,store:Ax},Is=(e,t)=>{let n=[...wy(t,"navigate(",")"),...wy(t,"href = ",";")],r=e.page.cur.id;e.page.navs[r]||(e.page.navs[r]=new Set);for(let o of n)e.page.navs[r].add(o);clearTimeout(Io.timeout),Io.timeout=setTimeout(()=>{e.on_nav_loaded&&e.on_nav_loaded({urls:Array.from(e.page.navs[r])})},100)},wy=(e,t,n)=>{let r=0,o=0,i=[];for(;;){let s=e.indexOf(t,r);if(o=r,s>=0){let l=e[s+t.length];if(l==='"'||l==="'"||l==="`"){let a=e.indexOf(`${l}${n}`,s+t.length+1),f=e.substring(s+t.length+1,a);r=a+2+n.length,i.push(f)}}if(o===r)break}return i};var Lo=O(ce());var Sy=O(Ju()),bo=O(ce());var rc=O(V()),_y=(e,t,n,r)=>o=>{n.item.script||(n.item.script={}),n.item.script.passprop||(n.item.script.passprop={});let i={};if(n.item.script.passprop){let a=!1;for(let[f,u]of Object.entries(o))["children","key"].includes(f)||(a=!0,i[f]=u,n.item.script.passprop[f]={end:0,start:0,value:u})}let s={...r,...i};if(!Array.isArray(o.children)&&(0,bo.isValidElement)(o.children)&&typeof o.children=="object"){let a=(0,Sy.default)(o.children,"props.meta.item.component.props.child.content.childs");if(Array.isArray(a)){let f=!0;for(let u of a)!(0,bo.isValidElement)(u)&&typeof u=="object"||(f=!1);if(f)return a.map(u=>{let c=e.meta[u.id];return c||(e.meta[u.id]={item:u},c=e.meta[u.id]),c?(Object.keys(c.item).length===1&&c.mitem&&(c.item=c.mitem.toJSON()),(0,rc.jsx)(Tt,{is_layout:t,meta:c,passprop:s},u.id)):null})}}if(!Array.isArray(o.children)&&!(0,bo.isValidElement)(o.children)&&typeof o.children=="object"){let a=o.children.id;if(a){let f=e.meta[a];return(0,rc.jsx)(Tt,{is_layout:t,meta:f,passprop:s})}}return oc(o,n.script?.scope)},oc=(e,t)=>{let n={};if(Array.isArray(e)?n.children=e:n=e,Array.isArray(n.children)){let r=[];for(let o of n.children)r.push(xy(o,n,t));return r}return xy(n.children,n,t)},xy=(e,t,n)=>{if((0,bo.isValidElement)(e)){let r={...t};return delete r.children,{...e,props:{...e.props,passprop:{...n,...r}}}}return e};var mr={},ky=(e,t,n)=>r=>{let o=["localhost","prasi.avolut.com"].includes(location.hostname)&&location.pathname.startsWith("/ed/"),i=n.item.id,{children:s}=r,l=e.script?.init_local_effect,a=t?e.layout?.meta:e.meta,u=(0,Lo.useRef)(mr[i]?mr[i]:r.value).current;return u.render=n.render,bs(e,n,n.script?.scope),r.hook&&r.hook(u),(0,Lo.useEffect)(()=>{if(n.parent?.instance_id&&a){let d=a[n.parent?.instance_id];if(d&&d.instances){for(let[y,m]of Object.entries(d.instances[n.parent.instance_id]))if(m===n.item.id){i=y;break}}}return!l[i]&&(typeof l=="object"&&(l[i]=!0),(async()=>r.effect&&(await r.effect(u),o&&(mr[i]=u)))()),()=>{}},[location.pathname]),(0,Lo.useEffect)(()=>{o&&mr[i]===null&&(async()=>r.effect&&(await r.effect(u),o&&(mr[i]=u)))()},[mr[i]]),oc(s,{...n.script?.scope,[r.name]:u})};var ic=O(V()),Ey=(e,t,n,r)=>{let o=To(e,t,n,r);e.visit&&e.visit(t,o),t.script?t.script.scope=r:t.script={scope:r,result:null,Local:ky(e,n,t),PassProp:_y(e,n,t,r)};let i=t.script,s=window.exports,l={useEffect:Ls.useEffect,children:o.props.children,props:o.props,Local:i.Local,db:e.site.db,api:e.site.api,PassProp:i?.PassProp,ErrorBox:mt,newElement:()=>{},render:c=>{i.result=(0,ic.jsx)(Ls.Suspense,{children:c})},params,...Ts(e),...s,...r};if(typeof r=="object"){for(let[c,d]of Object.entries(r))if(typeof d=="object"&&d&&d._jsx){let y=d;l[c]=(0,ic.jsx)(jx,{fn:y.fn,passprop:r,meta:t})}}!Xe.isEditor&&t.item.adv?.js&&Is(e,t.item.adv.js);let a=t.item.adv?.jsBuilt||"",f=lc(a,sc)||"";new Function(...Object.keys(l),`// ${t.item.name}: ${t.item.id} ${f} `)(...Object.values(l)),bs(e,t,r)},jx=({fn:e,meta:t,passprop:n})=>e({passprop:n,meta:t}),sc={"stroke-width":"strokeWidth","fill-rule":"fillRule","clip-rule":"clipRule","stroke-linejoin":"strokeLinejoin","stroke-linecap":"strokeLinecap","clip-path":"clipPath"},lc=(e,t)=>{let n=e;for(let[r,o]of Object.entries(t))n=n.replaceAll(r,o);return n};var Ry=O(V()),Cy=(e,t,n,r)=>{if(t.item.component?.id){t.item.script||(t.item.script={});let i={...window.exports,db:e.site.db,api:e.site.api,...Ts(e),...r,params};t.item.script.props={};let s=new Set;if(t.item.component.props)for(let[l,a]of Object.entries(t.item.component.props))try{if(a.meta?.type==="content-element"){let y={_jsx:!0,fn:m=>{let v=a.content?.id;if(v){let E=n?e.layout?.meta[v]:e.meta[v];if(!E)return null;let h=t.instances;if(!m.meta.item.originalId||!h||!h[t.item.id])return null;let g=m.meta.item.originalId;if(E.mitem&&(a.jsxCalledBy&&(!a.jsxCalledBy.includes(g)||a.jsxCalledBy.length!==2)||!a.jsxCalledBy)){let x=t.mitem?.get("component")?.get("props")?.get(l);if(x){let k=x.get("jsxCalledBy");!k||typeof k!="object"?x.set("jsxCalledBy",[t.item.id,g]):(!k.includes(g)||k.length!==2||k[0]!==t.item.id||k[1]!==g)&&x.set("jsxCalledBy",[t.item.id,g])}}return(0,Ry.jsx)(Tt,{meta:E,passprop:m.passprop,is_layout:n})}return null}};i[l]=y,r&&(r[l]=y);continue}a.value&&Is(e,a.value);let f=a.valueBuilt||"",u=lc(f,sc)||"",c=new Function(...Object.keys(i),`// [${t.item.name}] ${l}: ${t.item.id} return ${u} @@ -108,7 +108,7 @@ ${f} `):" "+hg(i[0]):"as no adapter specified";throw new A("There is no suitable adapter to dispatch the request "+s,"ERR_NOT_SUPPORT")}return r},adapters:Cc};function Rc(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new un(null,e)}function Js(e){return Rc(e),e.headers=Ne.from(e.headers),e.data=Bo.call(e,e.transformRequest),["post","put","patch"].indexOf(e.method)!==-1&&e.headers.setContentType("application/x-www-form-urlencoded",!1),Xs.getAdapter(e.adapter||xr.adapter)(e).then(function(r){return Rc(e),r.data=Bo.call(e,e.transformResponse,r),r.headers=Ne.from(r.headers),r},function(r){return Uo(r)||(Rc(e),r&&r.response&&(r.response.data=Bo.call(e,e.transformResponse,r.response),r.response.headers=Ne.from(r.response.headers))),Promise.reject(r)})}var yg=e=>e instanceof Ne?e.toJSON():e;function It(e,t){t=t||{};let n={};function r(f,u,c){return w.isPlainObject(f)&&w.isPlainObject(u)?w.merge.call({caseless:c},f,u):w.isPlainObject(u)?w.merge({},u):w.isArray(u)?u.slice():u}function o(f,u,c){if(w.isUndefined(u)){if(!w.isUndefined(f))return r(void 0,f,c)}else return r(f,u,c)}function i(f,u){if(!w.isUndefined(u))return r(void 0,u)}function s(f,u){if(w.isUndefined(u)){if(!w.isUndefined(f))return r(void 0,f)}else return r(void 0,u)}function l(f,u,c){if(c in t)return r(f,u);if(c in e)return r(void 0,f)}let a={url:i,method:i,data:i,baseURL:s,transformRequest:s,transformResponse:s,paramsSerializer:s,timeout:s,timeoutMessage:s,withCredentials:s,withXSRFToken:s,adapter:s,responseType:s,xsrfCookieName:s,xsrfHeaderName:s,onUploadProgress:s,onDownloadProgress:s,decompress:s,maxContentLength:s,maxBodyLength:s,beforeRedirect:s,transport:s,httpAgent:s,httpsAgent:s,cancelToken:s,socketPath:s,responseEncoding:s,validateStatus:l,headers:(f,u)=>o(yg(f),yg(u),!0)};return w.forEach(Object.keys(Object.assign({},e,t)),function(u){let c=a[u]||o,d=c(e[u],t[u],u);w.isUndefined(d)&&c!==l||(n[u]=d)}),n}var Ys="1.6.7";var Pc={};["object","boolean","number","function","string","symbol"].forEach((e,t)=>{Pc[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}});var gg={};Pc.transitional=function(t,n,r){function o(i,s){return"[Axios v"+Ys+"] Transitional option '"+i+"'"+s+(r?". "+r:"")}return(i,s,l)=>{if(t===!1)throw new A(o(s," has been removed"+(n?" in "+n:"")),A.ERR_DEPRECATED);return n&&!gg[s]&&(gg[s]=!0,console.warn(o(s," has been deprecated since v"+n+" and will be removed in the near future"))),t?t(i,s,l):!0}};function zS(e,t,n){if(typeof e!="object")throw new A("options must be an object",A.ERR_BAD_OPTION_VALUE);let r=Object.keys(e),o=r.length;for(;o-- >0;){let i=r[o],s=t[i];if(s){let l=e[i],a=l===void 0||s(l,i,e);if(a!==!0)throw new A("option "+i+" must be "+a,A.ERR_BAD_OPTION_VALUE);continue}if(n!==!0)throw new A("Unknown option "+i,A.ERR_BAD_OPTION)}}var Zs={assertOptions:zS,validators:Pc};var cn=Zs.validators,_r=class{constructor(t){this.defaults=t,this.interceptors={request:new yc,response:new yc}}async request(t,n){try{return await this._request(t,n)}catch(r){if(r instanceof Error){let o;Error.captureStackTrace?Error.captureStackTrace(o={}):o=new Error;let i=o.stack?o.stack.replace(/^.+\n/,""):"";r.stack?i&&!String(r.stack).endsWith(i.replace(/^.+\n.+\n/,""))&&(r.stack+=` `+i):r.stack=i}throw r}}_request(t,n){typeof t=="string"?(n=n||{},n.url=t):n=t||{},n=It(this.defaults,n);let{transitional:r,paramsSerializer:o,headers:i}=n;r!==void 0&&Zs.assertOptions(r,{silentJSONParsing:cn.transitional(cn.boolean),forcedJSONParsing:cn.transitional(cn.boolean),clarifyTimeoutError:cn.transitional(cn.boolean)},!1),o!=null&&(w.isFunction(o)?n.paramsSerializer={serialize:o}:Zs.assertOptions(o,{encode:cn.function,serialize:cn.function},!0)),n.method=(n.method||this.defaults.method||"get").toLowerCase();let s=i&&w.merge(i.common,i[n.method]);i&&w.forEach(["delete","get","head","post","put","patch","common"],m=>{delete i[m]}),n.headers=Ne.concat(s,i);let l=[],a=!0;this.interceptors.request.forEach(function(v){typeof v.runWhen=="function"&&v.runWhen(n)===!1||(a=a&&v.synchronous,l.unshift(v.fulfilled,v.rejected))});let f=[];this.interceptors.response.forEach(function(v){f.push(v.fulfilled,v.rejected)});let u,c=0,d;if(!a){let m=[Js.bind(this),void 0];for(m.unshift.apply(m,l),m.push.apply(m,f),d=m.length,u=Promise.resolve(n);c{if(!r._listeners)return;let i=r._listeners.length;for(;i-- >0;)r._listeners[i](o);r._listeners=null}),this.promise.then=o=>{let i,s=new Promise(l=>{r.subscribe(l),i=l}).then(o);return s.cancel=function(){r.unsubscribe(i)},s},t(function(i,s,l){r.reason||(r.reason=new un(i,s,l),n(r.reason))})}throwIfRequested(){if(this.reason)throw this.reason}subscribe(t){if(this.reason){t(this.reason);return}this._listeners?this._listeners.push(t):this._listeners=[t]}unsubscribe(t){if(!this._listeners)return;let n=this._listeners.indexOf(t);n!==-1&&this._listeners.splice(n,1)}static source(){let t;return{token:new e(function(o){t=o}),cancel:t}}},vg=Nc;function Oc(e){return function(n){return e.apply(null,n)}}function Tc(e){return w.isObject(e)&&e.isAxiosError===!0}var Ic={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(Ic).forEach(([e,t])=>{Ic[t]=e});var wg=Ic;function xg(e){let t=new $o(e),n=jo($o.prototype.request,t);return w.extend(n,$o.prototype,t,{allOwnKeys:!0}),w.extend(n,t,null,{allOwnKeys:!0}),n.create=function(o){return xg(It(e,o))},n}var oe=xg(xr);oe.Axios=$o;oe.CanceledError=un;oe.CancelToken=vg;oe.isCancel=Uo;oe.VERSION=Ys;oe.toFormData=an;oe.AxiosError=A;oe.Cancel=oe.CanceledError;oe.all=function(t){return Promise.all(t)};oe.spread=Oc;oe.isAxiosError=Tc;oe.mergeConfig=It;oe.AxiosHeaders=Ne;oe.formToJSON=e=>Ks(w.isHTMLForm(e)?new FormData(e):e);oe.getAdapter=Xs.getAdapter;oe.HttpStatusCode=wg;oe.default=oe;var el=oe;var{Axios:lP,AxiosError:aP,CanceledError:uP,isCancel:cP,CancelToken:fP,VERSION:dP,all:pP,Cancel:mP,isAxiosError:hP,spread:yP,toFormData:gP,AxiosHeaders:vP,HttpStatusCode:wP,formToJSON:xP,getAdapter:SP,mergeConfig:_P}=el;BigInt.prototype.toJSON=function(){return"BigInt::"+this.toString()};var BS=typeof window<"u"?window:null,Sg=typeof global<"u"?global:void 0,kr=async(e,t,n)=>{let r={...n},o=null,i=!1,s=null,l=[];if(Array.isArray(t))for(let c of t)c instanceof File&&(l.push(c),i=!0),typeof c=="function"&&(s=c);else t instanceof File&&(i=!0,l.push(t));if(!i)o=JSON.stringify(t),r["content-type"]="aplication/json";else{let c=new FormData;for(let d of l)c.append(d.name,d);o=c,delete r["content-type"],r.enctype="multipart/form-data;"}let a=new URL(e);if(BS!==null){let c=new URL(location.href),d="";if(a.host===c.host||Sg&&typeof Sg.server_hook=="function"?d=a.toString():d=`${c.protocol}//${c.host}/_proxy/${encodeURIComponent(a.toString())}`,d){if(s)return(await el({method:t?"post":void 0,url:d,data:o,onUploadProgress:s})).data;{let m=await(await fetch(d,t?{method:"POST",body:o,headers:r}:void 0)).text();try{return JSON.parse(m,_g)}catch{return m}}}}let u=await(await fetch(a,t?{method:"POST",body:o,headers:r}:void 0)).text();try{return JSON.parse(u,_g)}catch{return u}},_g=(e,t)=>typeof t=="string"&&t.startsWith("BigInt::")?BigInt(t.substring(8)):t;var Bg=O(zg());var Ug=async(e,t)=>{let n=(0,Bg.default)(e,"/"),r=await kr(y_(n,"/_prasi/_")),o="";r&&r.prasi&&(o=r.prasi);let i=h_(n);if(o==="v2")await new Promise(s=>{let l=document,a=l.createElement("script");a.onload=async()=>{s()},localStorage.getItem("api-ts-"+n)||localStorage.setItem("api-ts-"+n,Date.now().toString());let f=localStorage.getItem("api-ts-"+n);t?a.src=`${i}/_prasi/load.js?url=${n}&v3&dev=1&ts=${f}`:a.src=`${i}/_prasi/load.js?url=${n}&v3&ts=${f}`,document.querySelector(`script[src="${a.src}"]`)?s():l.body.appendChild(a)});else{let s=await fetch(i+"/_prasi/api-entry");if(Xe.prasiApi[n]={apiEntry:(await s.json()).srv},t){let l=await fetch(i+"/_prasi/api-types");Xe.prasiApi[n].apiTypes=await l.text(),Xe.prasiApi[n].prismaTypes={"prisma.d.ts":await jc(`${i}/_prasi/prisma/index.d.ts`),"runtime/index.d.ts":await jc(`${i}/_prasi/prisma/runtime/index.d.ts`),"runtime/library.d.ts":await jc(`${i}/_prasi/prisma/runtime/library.d.ts`)}}}},h_=e=>{let t=new URL(e);return`${t.protocol}//${t.host}`},y_=(e,t)=>{let n=new URL(e);return n.pathname=t,n.toString()},jc=async(e,t)=>await(await fetch(e)).text();var Ho={},$g=e=>{Xe.prasiApi||(Xe.prasiApi={});try{let t=new URL(e),n=`${t.protocol}//${t.host}`;return Xe.prasiApi[n]||Ho[n]||(Ho[n]=Ug(n,location.hostname.includes("prasi"))),new Proxy({},{get:(r,o)=>{if(o==="_url")return(s,l)=>{let a=new URL(n);a.pathname=s.split("/").filter(c=>c).join("/");let f=new URL(location.href),u="";return a.host===f.host||l===!1?u=a.toString():u=`${f.protocol}//${f.host}/_proxy/${encodeURIComponent(a.toString())}`,u};let i=s=>function(...l){return new Promise(async(a,f)=>{try{let u=Xe.prasiApi[n];if(!u&&Ho&&typeof Ho[n]=="object"&&(await Ho[n],u=Xe.prasiApi[n]),u){if(s==="_raw"){let y=l[0],m=`${n}${y}`,v=await Vg(m,l.slice(1));a(v);return}if(u.apiEntry||(u.apiEntry={}),u.apiEntry&&!u.apiEntry[s]){f(`API ${s.toString()} not found, existing API: - ${Object.keys(u.apiEntry||{}).join(` - - `)}`);return}let c=u.apiEntry[s].url,d=u.apiEntry[s].args;if(c&&d){if(l.length>0&&d.length>0)for(let[v,E]of Object.entries(l)){let h=d[parseInt(v)];d&&d.includes(h)&&E&&typeof E!="string"&&typeof E!="number"||(c=c.replace(`:${h}?`,E+""),c=c.replace(`:${h}`,E+""))}let y=`${n}${c}`,m=await Vg(y,l);a(m)}else console.error(`API Not Found: ${s.toString()}`)}else f("Failed to load API [Proxy]: "+n)}catch(u){f(u)}})};return o==="then"?new Proxy({},{get:(s,l)=>i(l)}):i(o)}})}catch{return null}},Vg=async(e,t)=>await kr(e,t,{"content-type":"application/json"});var Qg=O(Gg());var Kg=e=>{let t="";return new Proxy({},{get(n,r){return r==="_batch"?{update:async o=>Er({name:t,action:"batch_update",table:"",params:{batch:o}},e)}:r==="_schema"?{tables:async()=>Er({name:t,action:"schema_tables",table:"",params:[]},e),columns:async o=>Er({name:t,action:"schema_columns",table:o,params:[]},e),rels:async o=>Er({name:t,action:"schema_rels",table:o,params:[]},e)}:r.startsWith("$")?(...o)=>Er({name:t,action:"query",table:r,params:o},e):new Proxy({},{get(o,i){return async(...s)=>(r==="query"&&(r=i,i="query"),await Er({name:t,action:i,table:r,params:s},e))}})}})},tl={},Er=async(e,t)=>{try{let n=new URL(t);n.pathname="/_dbs",e.table&&(n.pathname+=`/${e.table}`);let r=n.toString(),o=(0,Qg.default)(e),i=tl[o];if(!i||i&&Date.now()-i.timestamp>1e3){tl[o]={timestamp:Date.now(),promise:kr(r,e,{"content-type":"application/json"}),result:null};let s=await tl[o].promise;return tl[o].result=s,s}return await i.promise}catch{}};var o0=O(r0());var i0=e=>{let{item:t,item_comp:n,ids:r}=e,o=fr(n);if(s0(o,r),t.id&&(o.id=t.id),o.component){if(o.component.props&&t.component)for(let i of Object.keys(o.component.props)){let s=t.component.props[i],l=o.component.props[i];s&&(l.value=s.value,l.valueBuilt=s.valueBuilt,l.jsxCalledBy=s.jsxCalledBy,l.content=s.content)}o.component.instances=t.component?.instances,o.component.style=t.component?.style}for(let i of Object.keys(t))delete t[i];for(let[i,s]of Object.entries(o))t[i]=s},s0=(e,t)=>{if(e.originalId=e.id,t[e.id]||(t[e.id]=(0,o0.createId)()),e.id=t[e.id],e.childs)for(let n of e.childs)s0(n,t)};var l0=e=>{for(let[t,n]of Object.entries(e.item_comp.component?.props||{})){let r=fr(n),o=e.item.component?.props;o&&o[t]&&(r.value=o[t].value,r.valueBuilt=o[t].valueBuilt,o[t].content&&(r.content=o[t].content)),r&&e.each(t,r)}};var nl=e=>{let t={};for(let[n,r]of Object.entries(e))if(n==="childs"){if(t.childs=[],r&&Array.isArray(r))for(let o of r)t.childs.push({id:o.id})}else t[n]=r;return t};var a0=(e,t)=>{let{item:n}=t;if(n.type==="item"&&n.component?.id&&t.parent?.item.id){let r=e.comps[n.component.id];if(e.on?.visit_component&&e.on.visit_component(n,t.root||t.item),!r)return;if(r){let o;if(e.mode==="page"?(n.component.instances||(n.component.instances={}),o=n.component.instances):o=t.parent?.root_instances,o){let s=o[n.id];o[n.id]||(o[n.id]={},s=o[n.id]),i0({item:n,item_comp:r,ids:s})}let i={item:nl(n),jsx_prop:t.jsx_prop,parent:{id:t.parent.item.id,comp_id:t.parent?.comp?.component?.id,instance_id:t.parent?.instance_id},instances:o};e.on?.visit&&e.on.visit(i,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[n.id]=i),l0({item:n,item_comp:r,instance:o?o[n.id]:{},each(s,l){let a=n.component?.id;l.meta?.type==="content-element"&&a&&l.content&&(l.content.name=s,Cr({...e,mode:"comp"},{item:l.content,root:t.root||l.content,is_root:!1,jsx_prop:{is_root:!0,comp_id:a,name:s},parent:{item:i.item,instance_id:n.id,comp:r,root_instances:o}}))}});for(let s of Object.values(n.childs))s?.name?.startsWith("jsx:")||s&&Object.keys(s).length>1&&Cr({...e,mode:"comp"},{item:s,is_root:!1,root:t.root||t.item,parent:{item:n,instance_id:n.id,root_instances:o,comp:r}})}}};var Cr=(e,t)=>{let n=t.item;if(n.type==="item"&&n.component?.id&&t.ignore_first_component!==!0){a0(e,t);return}let r={item:nl(n),parent:{id:t.parent?.item.id||"root",instance_id:t.parent?.instance_id,comp_id:t.parent?.comp?.component?.id}};if(t.jsx_prop&&(r.jsx_prop=t.jsx_prop),e.on?.visit&&e.on.visit(r,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[r.item.id]=r),n.childs){for(let[o,i]of Object.entries(n.childs))if(i.id){let s={item:i,is_root:!1,root:t.root||t.item,parent:{item:r.item,instance_id:t.parent?.instance_id,comp:t.parent?.comp,root_instances:t.parent?.root_instances}};t.jsx_prop&&(s.jsx_prop={...t.jsx_prop,is_root:!1}),Cr(e,s)}}};var T_=()=>new Promise(async e=>{let t=!1,n=await(await fetch(_.url`_prasi/route`)).json();t||e(n)}),u0=async()=>{let e=Dy(),t=[];try{let n=await T_();if(n&&n.site&&n.urls){n.layout&&(_.layout.id=n.layout.id,_.layout.root=n.layout.root,_.layout.meta={},_.layout.root&&(await yr(_.layout.root.childs),rl(_.layout.meta,_.layout.root))),_.site=n.site,_.site.code={mode:"vsc"},await I_(),_.site.api=$g(_.site.api_url),_.site.db=Kg(_.site.api_url);let r=window;r.serverurl=_.site.api_url,r.db=_.site.db,r.api=_.site.api;for(let o of n.urls)e.insert(o.url,o),t.push(o)}}catch{}return{router:e,pages:t}},I_=()=>new Promise(e=>{let t=document,n=t.createElement("script");n.onload=async()=>{e()};let r=_.site.api_url;try{new URL(r)}catch{location.hostname==="localhost"?r="http://localhost:4550":r="https://prasi.avolut.com"}localStorage.getItem("api-ts-"+r)||localStorage.setItem("api-ts-"+r,Date.now().toString());let o=localStorage.getItem("api-ts-"+r);n.src=`${r}/_prasi/load.js?url=${r}&v3&ts=${o}`,document.querySelector(`script[src="${n.src}"]`)?e():t.body.appendChild(n)}),rl=(e,t)=>{for(let n of t.childs)Cr({set_meta:!0,comps:_.comp.list,meta:e,mode:"page"},{item:n})};var dn=window;var Lt=O(V()),Dc=()=>location.hostname.split(".").length===4||location.hostname==="prasi.app"||location.hostname==="prasi.avolut.com"||location.hostname.includes("ngrok")||location.hostname==="localhost"||location.hostname==="127.0.0.1"||location.hostname==="10.0.2.2",f0=()=>{let e=nn({page_id:""}),[t,n]=(0,c0.useState)({}),r=()=>n({});dn.prasiContext.render=r;let o=Bu.Provider,i=Dc()&&location.pathname.startsWith("/prod");if(_.route.status!=="ready")return _.route.status==="init"&&(_.route.status="loading",u0().then(async({router:u,pages:c})=>{My(),_.route.status="ready",_.route.router=u,_.route.pages=c;let d=`${dn._prasi.basepath}/_prasi/code/index.js`,y=new Function("callback",`import("${d}").then(callback)`);await new Promise(m=>{y(v=>{for(let[E,h]of Object.entries(v))dn[E]=h;m()})}),r()})),(0,Lt.jsx)(No,{});let s=_.route.router;if(!s)return(0,Lt.jsx)(Hu,{children:"Failed to create Router"});let l="";if(i){let u=location.pathname.split("/");$u(u[3])&&(l=u[3])}let a=s.lookup(_.pathname);if(l){let u=_.route.pages.find(c=>l===c.id);u&&(a=u)}if(!a)return(0,Lt.jsx)(Hu,{children:"Page Not Found"});a.id!==e.page_id&&(_.init_local_effect={}),dn.params=a.params||{},_.page.id=a.id,_.page.url=a.url;let f=_.page.cache[a.id];if(f)_.page.root=f.root,_.page.meta=f.meta;else return by(a.id).then(async({root:u})=>{if(a){let c={id:a.id,url:a.url,root:u,meta:{}};await yr(u.childs),rl(c.meta,u),_.page.cache[c.id]=c,r()}}).catch(()=>{r()}),(0,Lt.jsx)(No,{note:"Loading page"});return(0,Lt.jsx)(o,{value:dn.prasiContext,children:(0,Lt.jsx)("div",{className:cx("relative flex flex-1 items-center justify-center"),children:(0,Lt.jsx)("div",{className:cx("absolute flex flex-col items-stretch flex-1 bg-white main-content-preview",_.mode==="mobile"?css` + - `)}`);return}let c=u.apiEntry[s].url,d=u.apiEntry[s].args;if(c&&d){if(l.length>0&&d.length>0)for(let[v,E]of Object.entries(l)){let h=d[parseInt(v)];d&&d.includes(h)&&E&&typeof E!="string"&&typeof E!="number"||(c=c.replace(`:${h}?`,E+""),c=c.replace(`:${h}`,E+""))}let y=`${n}${c}`,m=await Vg(y,l);a(m)}else console.error(`API Not Found: ${s.toString()}`)}else f("Failed to load API [Proxy]: "+n)}catch(u){f(u)}})};return o==="then"?new Proxy({},{get:(s,l)=>i(l)}):i(o)}})}catch{return null}},Vg=async(e,t)=>await kr(e,t,{"content-type":"application/json"});var Qg=O(Gg());var Kg=e=>{let t="";return new Proxy({},{get(n,r){return r==="_batch"?{update:async o=>Er({name:t,action:"batch_update",table:"",params:{batch:o}},e)}:r==="_schema"?{tables:async()=>Er({name:t,action:"schema_tables",table:"",params:[]},e),columns:async o=>Er({name:t,action:"schema_columns",table:o,params:[]},e),rels:async o=>Er({name:t,action:"schema_rels",table:o,params:[]},e)}:r.startsWith("$")?(...o)=>Er({name:t,action:"query",table:r,params:o},e):new Proxy({},{get(o,i){return async(...s)=>(r==="query"&&(r=i,i="query"),await Er({name:t,action:i,table:r,params:s},e))}})}})},tl={},Er=async(e,t)=>{try{let n=new URL(t);n.pathname="/_dbs",e.table&&(n.pathname+=`/${e.table}`);let r=n.toString(),o=(0,Qg.default)(e),i=tl[o];if(!i||i&&Date.now()-i.timestamp>1e3){tl[o]={timestamp:Date.now(),promise:kr(r,e,{"content-type":"application/json"}),result:null};let s=await tl[o].promise;return tl[o].result=s,s}return await i.promise}catch{}};var o0=O(r0());var i0=e=>{let{item:t,item_comp:n,ids:r}=e,o=fr(n);if(s0(o,r),t.id&&(o.id=t.id),o.hidden=t.hidden,o.component){if(o.component.props&&t.component)for(let i of Object.keys(o.component.props)){let s=t.component.props[i],l=o.component.props[i];s&&(l.value=s.value,l.valueBuilt=s.valueBuilt,l.jsxCalledBy=s.jsxCalledBy,l.content=s.content)}o.component.instances=t.component?.instances,o.component.style=t.component?.style}for(let i of Object.keys(t))delete t[i];for(let[i,s]of Object.entries(o))t[i]=s},s0=(e,t)=>{if(e.originalId=e.id,t[e.id]||(t[e.id]=(0,o0.createId)()),e.id=t[e.id],e.childs)for(let n of e.childs)s0(n,t)};var l0=e=>{for(let[t,n]of Object.entries(e.item_comp.component?.props||{})){let r=fr(n),o=e.item.component?.props;o&&o[t]&&(r.value=o[t].value,r.valueBuilt=o[t].valueBuilt,o[t].content&&(r.content=o[t].content)),r&&e.each(t,r)}};var nl=e=>{let t={};for(let[n,r]of Object.entries(e))if(n==="childs"){if(t.childs=[],r&&Array.isArray(r))for(let o of r)t.childs.push({id:o.id})}else t[n]=r;return t};var a0=(e,t)=>{let{item:n}=t;if(n.type==="item"&&n.component?.id&&t.parent?.item.id){let r=e.comps[n.component.id];if(e.on?.visit_component&&e.on.visit_component(n,t.root||t.item),!r)return;if(r){let o;if(e.mode==="page"?(n.component.instances||(n.component.instances={}),o=n.component.instances):o=t.parent?.root_instances,o){let s=o[n.id];o[n.id]||(o[n.id]={},s=o[n.id]),i0({item:n,item_comp:r,ids:s})}let i={item:nl(n),jsx_prop:t.jsx_prop,parent:{id:t.parent.item.id,comp_id:t.parent?.comp?.component?.id,instance_id:t.parent?.instance_id},instances:o};e.on?.visit&&e.on.visit(i,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[n.id]=i),l0({item:n,item_comp:r,instance:o?o[n.id]:{},each(s,l){let a=n.component?.id;l.meta?.type==="content-element"&&a&&l.content&&(l.content.name=s,Cr({...e,mode:"comp"},{item:l.content,root:t.root||l.content,is_root:!1,jsx_prop:{is_root:!0,comp_id:a,name:s},parent:{item:i.item,instance_id:n.id,comp:r,root_instances:o}}))}});for(let s of Object.values(n.childs))s?.name?.startsWith("jsx:")||s&&Object.keys(s).length>1&&Cr({...e,mode:"comp"},{item:s,is_root:!1,root:t.root||t.item,parent:{item:n,instance_id:n.id,root_instances:o,comp:r}})}}};var Cr=(e,t)=>{let n=t.item;if(n.type==="item"&&n.component?.id&&t.ignore_first_component!==!0){a0(e,t);return}let r={item:nl(n),parent:{id:t.parent?.item.id||"root",instance_id:t.parent?.instance_id,comp_id:t.parent?.comp?.component?.id}};if(t.jsx_prop&&(r.jsx_prop=t.jsx_prop),e.on?.visit&&e.on.visit(r,n,t.root||t.item),n.id&&e.set_meta!==!1&&(e.meta[r.item.id]=r),n.childs){for(let[o,i]of Object.entries(n.childs))if(i.id){let s={item:i,is_root:!1,root:t.root||t.item,parent:{item:r.item,instance_id:t.parent?.instance_id,comp:t.parent?.comp,root_instances:t.parent?.root_instances}};t.jsx_prop&&(s.jsx_prop={...t.jsx_prop,is_root:!1}),Cr(e,s)}}};var T_=()=>new Promise(async e=>{let t=!1,n=await(await fetch(_.url`_prasi/route`)).json();t||e(n)}),u0=async()=>{let e=Dy(),t=[];try{let n=await T_();if(n&&n.site&&n.urls){n.layout&&(_.layout.id=n.layout.id,_.layout.root=n.layout.root,_.layout.meta={},_.layout.root&&(await yr(_.layout.root.childs),rl(_.layout.meta,_.layout.root))),_.site=n.site,_.site.code={mode:"vsc"},await I_(),_.site.api=$g(_.site.api_url),_.site.db=Kg(_.site.api_url);let r=window;r.serverurl=_.site.api_url,r.db=_.site.db,r.api=_.site.api;for(let o of n.urls)e.insert(o.url,o),t.push(o)}}catch{}return{router:e,pages:t}},I_=()=>new Promise(e=>{let t=document,n=t.createElement("script");n.onload=async()=>{e()};let r=_.site.api_url;try{new URL(r)}catch{location.hostname==="localhost"?r="http://localhost:4550":r="https://prasi.avolut.com"}localStorage.getItem("api-ts-"+r)||localStorage.setItem("api-ts-"+r,Date.now().toString());let o=localStorage.getItem("api-ts-"+r);n.src=`${r}/_prasi/load.js?url=${r}&v3&ts=${o}`,document.querySelector(`script[src="${n.src}"]`)?e():t.body.appendChild(n)}),rl=(e,t)=>{for(let n of t.childs)Cr({set_meta:!0,comps:_.comp.list,meta:e,mode:"page"},{item:n})};var dn=window;var Lt=O(V()),Dc=()=>location.hostname.split(".").length===4||location.hostname==="prasi.app"||location.hostname==="prasi.avolut.com"||location.hostname.includes("ngrok")||location.hostname==="localhost"||location.hostname==="127.0.0.1"||location.hostname==="10.0.2.2",f0=()=>{let e=nn({page_id:""}),[t,n]=(0,c0.useState)({}),r=()=>n({});dn.prasiContext.render=r;let o=Bu.Provider,i=Dc()&&location.pathname.startsWith("/prod");if(_.route.status!=="ready")return _.route.status==="init"&&(_.route.status="loading",u0().then(async({router:u,pages:c})=>{My(),_.route.status="ready",_.route.router=u,_.route.pages=c;let d=`${dn._prasi.basepath}/_prasi/code/index.js`,y=new Function("callback",`import("${d}").then(callback)`);await new Promise(m=>{y(v=>{for(let[E,h]of Object.entries(v))dn[E]=h;m()})}),r()})),(0,Lt.jsx)(No,{});let s=_.route.router;if(!s)return(0,Lt.jsx)(Hu,{children:"Failed to create Router"});let l="";if(i){let u=location.pathname.split("/");$u(u[3])&&(l=u[3])}let a=s.lookup(_.pathname);if(l){let u=_.route.pages.find(c=>l===c.id);u&&(a=u)}if(!a)return(0,Lt.jsx)(Hu,{children:"Page Not Found"});a.id!==e.page_id&&(_.init_local_effect={}),dn.params=a.params||{},_.page.id=a.id,_.page.url=a.url;let f=_.page.cache[a.id];if(f)_.page.root=f.root,_.page.meta=f.meta;else return by(a.id).then(async({root:u})=>{if(a){let c={id:a.id,url:a.url,root:u,meta:{}};await yr(u.childs),rl(c.meta,u),_.page.cache[c.id]=c,r()}}).catch(()=>{r()}),(0,Lt.jsx)(No,{note:"Loading page"});return(0,Lt.jsx)(o,{value:dn.prasiContext,children:(0,Lt.jsx)("div",{className:cx("relative flex flex-1 items-center justify-center"),children:(0,Lt.jsx)("div",{className:cx("absolute flex flex-col items-stretch flex-1 bg-white main-content-preview",_.mode==="mobile"?css` @media (min-width: 768px) { border-left: 1px solid #ccc; border-right: 1px solid #ccc; diff --git a/app/web/src/nova/ed/panel/tree/node/item/action.tsx b/app/web/src/nova/ed/panel/tree/node/item/action.tsx index 11f02556..0a8f29e3 100644 --- a/app/web/src/nova/ed/panel/tree/node/item/action.tsx +++ b/app/web/src/nova/ed/panel/tree/node/item/action.tsx @@ -35,13 +35,15 @@ export const EdTreeAction = ({ e.stopPropagation(); const meta = getMetaById(p, item.id); if (meta) meta.mitem?.set("hidden", false); + treeRebuild(p, { note: "show" }); + p.render(); }} > - + )} - {item.hidden === "only-editor" && ( + {/* {item.hidden === "only-editor" && (
- )} + )} */} {(!comp.enabled || (comp.enabled && comp.id === active.comp_id)) && (