@chaibuilder/sdk 1.2.53 → 1.2.55

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/dist/{AddBlocks-kJNH96eQ.js → AddBlocks-HeYXoex4.js} +2 -2
  2. package/dist/{AddBlocks-7OJEZC2D.cjs → AddBlocks-VHoZezjj.cjs} +1 -1
  3. package/dist/{CanvasArea-nWHWl6zD.cjs → CanvasArea-137WY3Wx.cjs} +2 -2
  4. package/dist/{CanvasArea-ZxrQurg_.js → CanvasArea-CqILE5PR.js} +3 -3
  5. package/dist/{ChaiBuilderEditor-Rqlg194T.cjs → ChaiBuilderEditor-aY8flOgX.cjs} +1 -1
  6. package/dist/{ChaiBuilderEditor-4xhn_QlL.js → ChaiBuilderEditor-tkzS851D.js} +2 -2
  7. package/dist/{CodeEditor-C6p5CZfl.cjs → CodeEditor-R2jKe97T.cjs} +1 -1
  8. package/dist/{CodeEditor-vTWgHJei.js → CodeEditor-kxV5RCpd.js} +1 -1
  9. package/dist/{CurrentPage-KPr8MnO0.js → CurrentPage-IrFGAb7n.js} +3 -3
  10. package/dist/{CurrentPage-bfY5xyr7.cjs → CurrentPage-PjrVzHXR.cjs} +1 -1
  11. package/dist/{ListTree-5s7iNbKT.js → ListTree-0n_G8NJx.js} +1 -1
  12. package/dist/{ListTree-4J0SUudU.cjs → ListTree-C6oCXZDV.cjs} +1 -1
  13. package/dist/{PagesPanel-aZBPSLS7.js → PagesPanel-RYBf0Yct.js} +4 -4
  14. package/dist/{PagesPanel-re4w2009.cjs → PagesPanel-lIC3kYmS.cjs} +1 -1
  15. package/dist/{ProjectPanel-uo19SCtW.cjs → ProjectPanel-0Siyi5YS.cjs} +1 -1
  16. package/dist/{ProjectPanel-bWZtA_mw.js → ProjectPanel-Zagx6l3Q.js} +4 -4
  17. package/dist/Settings-6QRVcl16.cjs +1 -0
  18. package/dist/{Settings-SK2ONoi0.js → Settings-RLDTFFf8.js} +13 -13
  19. package/dist/{SidePanels-ezU-hGki.js → SidePanels-ao969pMV.js} +2 -2
  20. package/dist/{SidePanels-YAKKqxIi.cjs → SidePanels-j1EFsBlK.cjs} +1 -1
  21. package/dist/{ThemeConfiguration-q5rLYmXB.js → ThemeConfiguration-S7yArRMp.js} +1 -1
  22. package/dist/{ThemeConfiguration-qUXsJBBZ.cjs → ThemeConfiguration-q1471P7b.cjs} +1 -1
  23. package/dist/{Topbar-YhJ6xVs-.js → Topbar-B8u0whpc.js} +1 -1
  24. package/dist/{Topbar-9mJ6dJn-.cjs → Topbar-ogFKKDbx.cjs} +1 -1
  25. package/dist/{UILibrariesPanel-uNt8spPr.cjs → UILibrariesPanel-cm9CFWxc.cjs} +1 -1
  26. package/dist/{UILibrariesPanel-N7acP7aA.js → UILibrariesPanel-tcfz2ELp.js} +1 -1
  27. package/dist/{UnsplashImages-5IlwWgRv.cjs → UnsplashImages-E2L3YDJI.cjs} +1 -1
  28. package/dist/{UnsplashImages-iY__3dsJ.js → UnsplashImages-wWRifkCp.js} +1 -1
  29. package/dist/{UploadImages-KHk-jx9-.js → UploadImages-lUvZhW_j.js} +1 -1
  30. package/dist/{UploadImages-UjtFHUqM.cjs → UploadImages-s-eeaGiS.cjs} +1 -1
  31. package/dist/{add-page-modal-HmfsbbCH.js → add-page-modal-04b4l2zu.js} +4 -4
  32. package/dist/{add-page-modal-8GuYgZa-.cjs → add-page-modal-eroF20lO.cjs} +1 -1
  33. package/dist/{confirm-alert-AoUx_ZEf.js → confirm-alert-FX5030eR.js} +1 -1
  34. package/dist/{confirm-alert-qdryZAvd.cjs → confirm-alert-XuxEzG-V.cjs} +1 -1
  35. package/dist/core.cjs +1 -1
  36. package/dist/core.js +1 -1
  37. package/dist/{delete-page-modal-KCPx8Ako.js → delete-page-modal-1u9CyAIP.js} +3 -3
  38. package/dist/{delete-page-modal-8qEY88SK.cjs → delete-page-modal-pgh7sdfg.cjs} +1 -1
  39. package/dist/email.cjs +1 -1
  40. package/dist/email.js +1 -1
  41. package/dist/{form-LHHE25z8.js → form-HRdEJjVq.js} +1 -1
  42. package/dist/{form-zHGQEmOp.cjs → form-Z4IRWj0o.cjs} +1 -1
  43. package/dist/{html-to-json-ofq1N3tB.js → html-to-json-OnIZDDXw.js} +63 -58
  44. package/dist/html-to-json-rauxDBi6.cjs +1 -0
  45. package/dist/{index-swYRuZtl.cjs → index-bt7EhwLh.cjs} +1 -1
  46. package/dist/{index-tGVTszX2.js → index-vfmO3y2d.js} +3 -3
  47. package/dist/lib.cjs +1 -1
  48. package/dist/lib.js +1 -1
  49. package/dist/{page-viewer-t9AFrRlP.cjs → page-viewer-O960kM2x.cjs} +1 -1
  50. package/dist/{page-viewer-P5yNaWy1.js → page-viewer-dcb3u4OV.js} +4 -4
  51. package/dist/{project-general-setting-Qm8odisi.js → project-general-setting--sS34seu.js} +4 -4
  52. package/dist/{project-general-setting-Ojhf6Nl6.cjs → project-general-setting-lIvNs-Vq.cjs} +1 -1
  53. package/dist/{project-seo-setting-j8EdSO40.js → project-seo-setting-8tc3I-0M.js} +2 -2
  54. package/dist/{project-seo-setting-4E1mqV3j.cjs → project-seo-setting-MIlAuqcc.cjs} +1 -1
  55. package/dist/{single-page-detail-bv-XFGOD.cjs → single-page-detail-0Z_hvd_j.cjs} +1 -1
  56. package/dist/{single-page-detail-mQfFVaou.js → single-page-detail-tP2pfgBp.js} +5 -5
  57. package/dist/studio.cjs +1 -1
  58. package/dist/studio.js +3 -3
  59. package/dist/ui.cjs +1 -1
  60. package/dist/ui.js +1 -1
  61. package/dist/{useCanvasSettings-4WtrDzCu.cjs → useCanvasSettings-R0h03UfD.cjs} +1 -1
  62. package/dist/{useCanvasSettings-Rvn5rRB8.js → useCanvasSettings-rEZHbw3s.js} +1 -1
  63. package/package.json +1 -1
  64. package/dist/Settings-AcK9rEs3.cjs +0 -1
  65. package/dist/html-to-json-9uiQ2Dp2.cjs +0 -1
@@ -1 +1 @@
1
- "use strict";var H2=(h,t,c)=>{if(!t.has(h))throw TypeError("Cannot "+c)};var n=(h,t,c)=>(H2(h,t,"read from private field"),c?c.call(h):t.get(h)),e=(h,t,c)=>{if(t.has(h))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(h):t.set(h,c)},v=(h,t,c,a)=>(H2(h,t,"write to private field"),a?a.call(h,c):t.set(h,c),c);var i2=(h,t,c,a)=>({set _(l){v(h,t,l,c)},get _(){return n(h,t,a)}}),M=(h,t,c)=>(H2(h,t,"access private method"),c);const d=require("./jsx-runtime-Z_BpKhVy.cjs"),N=require("react");require("./core.cjs");const r2=require("@radix-ui/react-icons"),T=require("./ChaiBuilderEditor-Rqlg194T.cjs"),h1=require("sonner"),s0=require("react-i18next"),c1=require("lodash-es"),p0=require("./html-to-json-9uiQ2Dp2.cjs"),S2=require("lucide-react"),t0=require("./index--mLLy7QQ.cjs");function V0(h){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const c in h)if(c!=="default"){const a=Object.getOwnPropertyDescriptor(h,c);Object.defineProperty(t,c,a.get?a:{enumerable:!0,get:()=>h[c]})}}return t.default=h,Object.freeze(t)}const A=V0(N);var W1=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(h){return this.listeners.add(h),this.onSubscribe(),()=>{this.listeners.delete(h),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},N1=typeof window>"u"||"Deno"in window;function _(){}function f0(h,t){return typeof h=="function"?h(t):h}function s2(h){return typeof h=="number"&&h>=0&&h!==1/0}function h0(h,t){return Math.max(h+(t||0)-Date.now(),0)}function R2(h,t){const{type:c="all",exact:a,fetchStatus:l,predicate:i,queryKey:r,stale:z}=h;if(r){if(a){if(t.queryHash!==A2(r,t.options))return!1}else if(!Q1(t.queryKey,r))return!1}if(c!=="all"){const s=t.isActive();if(c==="active"&&!s||c==="inactive"&&s)return!1}return!(typeof z=="boolean"&&t.isStale()!==z||typeof l<"u"&&l!==t.state.fetchStatus||i&&!i(t))}function F2(h,t){const{exact:c,status:a,predicate:l,mutationKey:i}=h;if(i){if(!t.options.mutationKey)return!1;if(c){if(U1(t.options.mutationKey)!==U1(i))return!1}else if(!Q1(t.options.mutationKey,i))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function A2(h,t){return((t==null?void 0:t.queryKeyHashFn)||U1)(h)}function U1(h){return JSON.stringify(h,(t,c)=>p2(c)?Object.keys(c).sort().reduce((a,l)=>(a[l]=c[l],a),{}):c)}function Q1(h,t){return h===t?!0:typeof h!=typeof t?!1:h&&t&&typeof h=="object"&&typeof t=="object"?!Object.keys(t).some(c=>!Q1(h[c],t[c])):!1}function c0(h,t){if(h===t)return h;const c=k2(h)&&k2(t);if(c||p2(h)&&p2(t)){const a=c?h.length:Object.keys(h).length,l=c?t:Object.keys(t),i=l.length,r=c?[]:{};let z=0;for(let s=0;s<i;s++){const p=c?s:l[s];r[p]=c0(h[p],t[p]),r[p]===h[p]&&z++}return a===i&&z===a?h:r}return t}function e2(h,t){if(h&&!t||t&&!h)return!1;for(const c in h)if(h[c]!==t[c])return!1;return!0}function k2(h){return Array.isArray(h)&&h.length===Object.keys(h).length}function p2(h){if(!D2(h))return!1;const t=h.constructor;if(typeof t>"u")return!0;const c=t.prototype;return!(!D2(c)||!c.hasOwnProperty("isPrototypeOf"))}function D2(h){return Object.prototype.toString.call(h)==="[object Object]"}function a0(h){return new Promise(t=>{setTimeout(t,h)})}function E2(h){a0(0).then(h)}function V2(h,t,c){return typeof c.structuralSharing=="function"?c.structuralSharing(h,t):c.structuralSharing!==!1?c0(h,t):t}function m0(h,t,c=0){const a=[...h,t];return c&&a.length>c?a.slice(1):a}function x0(h,t,c=0){const a=[t,...h];return c&&a.length>c?a.slice(0,-1):a}var u1,v1,B1,U2,L0=(U2=class extends W1{constructor(){super();e(this,u1,void 0);e(this,v1,void 0);e(this,B1,void 0);v(this,B1,t=>{if(!N1&&window.addEventListener){const c=()=>t();return window.addEventListener("visibilitychange",c,!1),()=>{window.removeEventListener("visibilitychange",c)}}})}onSubscribe(){n(this,v1)||this.setEventListener(n(this,B1))}onUnsubscribe(){var t;this.hasListeners()||((t=n(this,v1))==null||t.call(this),v(this,v1,void 0))}setEventListener(t){var c;v(this,B1,t),(c=n(this,v1))==null||c.call(this),v(this,v1,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){n(this,u1)!==t&&(v(this,u1,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof n(this,u1)=="boolean"?n(this,u1):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},u1=new WeakMap,v1=new WeakMap,B1=new WeakMap,U2),o2=new L0,I1,d1,G1,Q2,w0=(Q2=class extends W1{constructor(){super();e(this,I1,!0);e(this,d1,void 0);e(this,G1,void 0);v(this,G1,t=>{if(!N1&&window.addEventListener){const c=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",c,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",c),window.removeEventListener("offline",a)}}})}onSubscribe(){n(this,d1)||this.setEventListener(n(this,G1))}onUnsubscribe(){var t;this.hasListeners()||((t=n(this,d1))==null||t.call(this),v(this,d1,void 0))}setEventListener(t){var c;v(this,G1,t),(c=n(this,d1))==null||c.call(this),v(this,d1,t(this.setOnline.bind(this)))}setOnline(t){n(this,I1)!==t&&(v(this,I1,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return n(this,I1)}},I1=new WeakMap,d1=new WeakMap,G1=new WeakMap,Q2),z2=new w0;function B0(h){return Math.min(1e3*2**h,3e4)}function M2(h){return(h??"online")==="online"?z2.isOnline():!0}var n0=class{constructor(h){this.revert=h==null?void 0:h.revert,this.silent=h==null?void 0:h.silent}};function u2(h){return h instanceof n0}function l0(h){let t=!1,c=0,a=!1,l,i,r;const z=new Promise((g,u)=>{i=g,r=u}),s=g=>{var u;a||(H(new n0(g)),(u=h.abort)==null||u.call(h))},p=()=>{t=!0},o=()=>{t=!1},L=()=>!o2.isFocused()||h.networkMode!=="always"&&!z2.isOnline(),b=g=>{var u;a||(a=!0,(u=h.onSuccess)==null||u.call(h,g),l==null||l(),i(g))},H=g=>{var u;a||(a=!0,(u=h.onError)==null||u.call(h,g),l==null||l(),r(g))},V=()=>new Promise(g=>{var u;l=G=>{const f=a||!L();return f&&g(G),f},(u=h.onPause)==null||u.call(h)}).then(()=>{var g;l=void 0,a||(g=h.onContinue)==null||g.call(h)}),B=()=>{if(a)return;let g;try{g=h.fn()}catch(u){g=Promise.reject(u)}Promise.resolve(g).then(b).catch(u=>{var F;if(a)return;const G=h.retry??(N1?0:3),f=h.retryDelay??B0,m=typeof f=="function"?f(c,u):f,y=G===!0||typeof G=="number"&&c<G||typeof G=="function"&&G(c,u);if(t||!y){H(u);return}c++,(F=h.onFail)==null||F.call(h,c,u),a0(m).then(()=>{if(L())return V()}).then(()=>{t?H(u):B()})})};return M2(h.networkMode)?B():V().then(B),{promise:z,cancel:s,continue:()=>(l==null?void 0:l())?z:Promise.resolve(),cancelRetry:p,continueRetry:o}}function I0(){let h=[],t=0,c=o=>{o()},a=o=>{o()};const l=o=>{let L;t++;try{L=o()}finally{t--,t||z()}return L},i=o=>{t?h.push(o):E2(()=>{c(o)})},r=o=>(...L)=>{i(()=>{o(...L)})},z=()=>{const o=h;h=[],o.length&&E2(()=>{a(()=>{o.forEach(L=>{c(L)})})})};return{batch:l,batchCalls:r,schedule:i,setNotifyFunction:o=>{c=o},setBatchNotifyFunction:o=>{a=o}}}var O=I0(),s1,K2,i0=(K2=class{constructor(){e(this,s1,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),s2(this.gcTime)&&v(this,s1,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(h){this.gcTime=Math.max(this.gcTime||0,h??(N1?1/0:5*60*1e3))}clearGcTimeout(){n(this,s1)&&(clearTimeout(n(this,s1)),v(this,s1,void 0))}},s1=new WeakMap,K2),C1,O1,U,r1,Q,S,K1,p1,S1,v2,$,n1,q2,G0=(q2=class extends i0{constructor(t){super();e(this,S1);e(this,$);e(this,C1,void 0);e(this,O1,void 0);e(this,U,void 0);e(this,r1,void 0);e(this,Q,void 0);e(this,S,void 0);e(this,K1,void 0);e(this,p1,void 0);v(this,p1,!1),v(this,K1,t.defaultOptions),M(this,S1,v2).call(this,t.options),v(this,S,[]),v(this,U,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,v(this,C1,t.state||C0(this.options)),this.state=n(this,C1),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!n(this,S).length&&this.state.fetchStatus==="idle"&&n(this,U).remove(this)}setData(t,c){const a=V2(this.state.data,t,this.options);return M(this,$,n1).call(this,{data:a,type:"success",dataUpdatedAt:c==null?void 0:c.updatedAt,manual:c==null?void 0:c.manual}),a}setState(t,c){M(this,$,n1).call(this,{type:"setState",state:t,setStateOptions:c})}cancel(t){var a;const c=n(this,r1);return(a=n(this,Q))==null||a.cancel(t),c?c.then(_).catch(_):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(n(this,C1))}isActive(){return n(this,S).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||n(this,S).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!h0(this.state.dataUpdatedAt,t)}onFocus(){var c;const t=n(this,S).find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(c=n(this,Q))==null||c.continue()}onOnline(){var c;const t=n(this,S).find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(c=n(this,Q))==null||c.continue()}addObserver(t){n(this,S).includes(t)||(n(this,S).push(t),this.clearGcTimeout(),n(this,U).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){n(this,S).includes(t)&&(v(this,S,n(this,S).filter(c=>c!==t)),n(this,S).length||(n(this,Q)&&(n(this,p1)?n(this,Q).cancel({revert:!0}):n(this,Q).cancelRetry()),this.scheduleGc()),n(this,U).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return n(this,S).length}invalidate(){this.state.isInvalidated||M(this,$,n1).call(this,{type:"invalidate"})}fetch(t,c){var p,o,L,b;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(c!=null&&c.cancelRefetch))this.cancel({silent:!0});else if(n(this,r1))return(p=n(this,Q))==null||p.continueRetry(),n(this,r1)}if(t&&M(this,S1,v2).call(this,t),!this.options.queryFn){const H=n(this,S).find(V=>V.options.queryFn);H&&M(this,S1,v2).call(this,H.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const a=new AbortController,l={queryKey:this.queryKey,meta:this.meta},i=H=>{Object.defineProperty(H,"signal",{enumerable:!0,get:()=>(v(this,p1,!0),a.signal)})};i(l);const r=()=>this.options.queryFn?(v(this,p1,!1),this.options.persister?this.options.persister(this.options.queryFn,l,this):this.options.queryFn(l)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),z={fetchOptions:c,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:r};i(z),(o=this.options.behavior)==null||o.onFetch(z,this),v(this,O1,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((L=z.fetchOptions)==null?void 0:L.meta))&&M(this,$,n1).call(this,{type:"fetch",meta:(b=z.fetchOptions)==null?void 0:b.meta});const s=H=>{var V,B,g,u;u2(H)&&H.silent||M(this,$,n1).call(this,{type:"error",error:H}),u2(H)||((B=(V=n(this,U).config).onError)==null||B.call(V,H,this),(u=(g=n(this,U).config).onSettled)==null||u.call(g,this.state.data,H,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return v(this,Q,l0({fn:z.fetchFn,abort:a.abort.bind(a),onSuccess:H=>{var V,B,g,u;if(typeof H>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),s(new Error(`${this.queryHash} data is undefined`));return}this.setData(H),(B=(V=n(this,U).config).onSuccess)==null||B.call(V,H,this),(u=(g=n(this,U).config).onSettled)==null||u.call(g,H,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:s,onFail:(H,V)=>{M(this,$,n1).call(this,{type:"failed",failureCount:H,error:V})},onPause:()=>{M(this,$,n1).call(this,{type:"pause"})},onContinue:()=>{M(this,$,n1).call(this,{type:"continue"})},retry:z.options.retry,retryDelay:z.options.retryDelay,networkMode:z.options.networkMode})),v(this,r1,n(this,Q).promise),n(this,r1)}},C1=new WeakMap,O1=new WeakMap,U=new WeakMap,r1=new WeakMap,Q=new WeakMap,S=new WeakMap,K1=new WeakMap,p1=new WeakMap,S1=new WeakSet,v2=function(t){this.options={...n(this,K1),...t},this.updateGcTime(this.options.gcTime)},$=new WeakSet,n1=function(t){const c=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:M2(this.options.networkMode)?"fetching":"paused",...!a.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...a,data:t.data,dataUpdateCount:a.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const l=t.error;return u2(l)&&l.revert&&n(this,O1)?{...n(this,O1),fetchStatus:"idle"}:{...a,error:l,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=c(this.state),O.batch(()=>{n(this,S).forEach(a=>{a.onQueryUpdate()}),n(this,U).notify({query:this,type:"updated",action:t})})},q2);function C0(h){const t=typeof h.initialData=="function"?h.initialData():h.initialData,c=typeof t<"u",a=c?typeof h.initialDataUpdatedAt=="function"?h.initialDataUpdatedAt():h.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:c?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:c?"success":"pending",fetchStatus:"idle"}}var Z,_2,O0=(_2=class extends W1{constructor(t={}){super();e(this,Z,void 0);this.config=t,v(this,Z,new Map)}build(t,c,a){const l=c.queryKey,i=c.queryHash??A2(l,c);let r=this.get(i);return r||(r=new G0({cache:this,queryKey:l,queryHash:i,options:t.defaultQueryOptions(c),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(r)),r}add(t){n(this,Z).has(t.queryHash)||(n(this,Z).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const c=n(this,Z).get(t.queryHash);c&&(t.destroy(),c===t&&n(this,Z).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){O.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return n(this,Z).get(t)}getAll(){return[...n(this,Z).values()]}find(t){const c={exact:!0,...t};return this.getAll().find(a=>R2(c,a))}findAll(t={}){const c=this.getAll();return Object.keys(t).length>0?c.filter(a=>R2(t,a)):c}notify(t){O.batch(()=>{this.listeners.forEach(c=>{c(t)})})}onFocus(){O.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){O.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Z=new WeakMap,_2),Y,q1,E,A1,X,i1,$2,S0=($2=class extends i0{constructor(t){super();e(this,X);e(this,Y,void 0);e(this,q1,void 0);e(this,E,void 0);e(this,A1,void 0);this.mutationId=t.mutationId,v(this,q1,t.defaultOptions),v(this,E,t.mutationCache),v(this,Y,[]),this.state=t.state||v0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...n(this,q1),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){n(this,Y).includes(t)||(n(this,Y).push(t),this.clearGcTimeout(),n(this,E).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){v(this,Y,n(this,Y).filter(c=>c!==t)),this.scheduleGc(),n(this,E).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){n(this,Y).length||(this.state.status==="pending"?this.scheduleGc():n(this,E).remove(this))}continue(){var t;return((t=n(this,A1))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,i,r,z,s,p,o,L,b,H,V,B,g,u,G,f,m,y,F,I;const c=()=>(v(this,A1,l0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(w,a1)=>{M(this,X,i1).call(this,{type:"failed",failureCount:w,error:a1})},onPause:()=>{M(this,X,i1).call(this,{type:"pause"})},onContinue:()=>{M(this,X,i1).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),n(this,A1).promise),a=this.state.status==="pending";try{if(!a){M(this,X,i1).call(this,{type:"pending",variables:t}),await((i=(l=n(this,E).config).onMutate)==null?void 0:i.call(l,t,this));const a1=await((z=(r=this.options).onMutate)==null?void 0:z.call(r,t));a1!==this.state.context&&M(this,X,i1).call(this,{type:"pending",context:a1,variables:t})}const w=await c();return await((p=(s=n(this,E).config).onSuccess)==null?void 0:p.call(s,w,t,this.state.context,this)),await((L=(o=this.options).onSuccess)==null?void 0:L.call(o,w,t,this.state.context)),await((H=(b=n(this,E).config).onSettled)==null?void 0:H.call(b,w,null,this.state.variables,this.state.context,this)),await((B=(V=this.options).onSettled)==null?void 0:B.call(V,w,null,t,this.state.context)),M(this,X,i1).call(this,{type:"success",data:w}),w}catch(w){try{throw await((u=(g=n(this,E).config).onError)==null?void 0:u.call(g,w,t,this.state.context,this)),await((f=(G=this.options).onError)==null?void 0:f.call(G,w,t,this.state.context)),await((y=(m=n(this,E).config).onSettled)==null?void 0:y.call(m,void 0,w,this.state.variables,this.state.context,this)),await((I=(F=this.options).onSettled)==null?void 0:I.call(F,void 0,w,t,this.state.context)),w}finally{M(this,X,i1).call(this,{type:"error",error:w})}}}},Y=new WeakMap,q1=new WeakMap,E=new WeakMap,A1=new WeakMap,X=new WeakSet,i1=function(t){const c=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!M2(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=c(this.state),O.batch(()=>{n(this,Y).forEach(a=>{a.onMutationUpdate(t)}),n(this,E).notify({mutation:this,type:"updated",action:t})})},$2);function v0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var K,_1,V1,J2,A0=(J2=class extends W1{constructor(t={}){super();e(this,K,void 0);e(this,_1,void 0);e(this,V1,void 0);this.config=t,v(this,K,[]),v(this,_1,0)}build(t,c,a){const l=new S0({mutationCache:this,mutationId:++i2(this,_1)._,options:t.defaultMutationOptions(c),state:a});return this.add(l),l}add(t){n(this,K).push(t),this.notify({type:"added",mutation:t})}remove(t){v(this,K,n(this,K).filter(c=>c!==t)),this.notify({type:"removed",mutation:t})}clear(){O.batch(()=>{n(this,K).forEach(t=>{this.remove(t)})})}getAll(){return n(this,K)}find(t){const c={exact:!0,...t};return n(this,K).find(a=>F2(c,a))}findAll(t={}){return n(this,K).filter(c=>F2(t,c))}notify(t){O.batch(()=>{this.listeners.forEach(c=>{c(t)})})}resumePausedMutations(){return v(this,V1,(n(this,V1)??Promise.resolve()).then(()=>{const t=n(this,K).filter(c=>c.state.isPaused);return O.batch(()=>t.reduce((c,a)=>c.then(()=>a.continue().catch(_)),Promise.resolve()))}).then(()=>{v(this,V1,void 0)})),n(this,V1)}},K=new WeakMap,_1=new WeakMap,V1=new WeakMap,J2);function y0(h){return{onFetch:(t,c)=>{const a=async()=>{var V,B,g,u,G;const l=t.options,i=(g=(B=(V=t.fetchOptions)==null?void 0:V.meta)==null?void 0:B.fetchMore)==null?void 0:g.direction,r=((u=t.state.data)==null?void 0:u.pages)||[],z=((G=t.state.data)==null?void 0:G.pageParams)||[],s={pages:[],pageParams:[]};let p=!1;const o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},L=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),b=async(f,m,y)=>{if(p)return Promise.reject();if(m==null&&f.pages.length)return Promise.resolve(f);const F={queryKey:t.queryKey,pageParam:m,direction:y?"backward":"forward",meta:t.options.meta};o(F);const I=await L(F),{maxPages:w}=t.options,a1=y?x0:m0;return{pages:a1(f.pages,I,w),pageParams:a1(f.pageParams,m,w)}};let H;if(i&&r.length){const f=i==="backward",m=f?b0:T2,y={pages:r,pageParams:z},F=m(l,y);H=await b(y,F,f)}else{H=await b(s,z[0]??l.initialPageParam);const f=h??r.length;for(let m=1;m<f;m++){const y=T2(l,H);H=await b(H,y)}}return H};t.options.persister?t.fetchFn=()=>{var l,i;return(i=(l=t.options).persister)==null?void 0:i.call(l,a,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},c)}:t.fetchFn=a}}}function T2(h,{pages:t,pageParams:c}){const a=t.length-1;return h.getNextPageParam(t[a],t,c[a],c)}function b0(h,{pages:t,pageParams:c}){var a;return(a=h.getPreviousPageParam)==null?void 0:a.call(h,t[0],t,c[0],c)}var C,e1,o1,y1,b1,z1,P1,R1,Z2,P0=(Z2=class{constructor(h={}){e(this,C,void 0);e(this,e1,void 0);e(this,o1,void 0);e(this,y1,void 0);e(this,b1,void 0);e(this,z1,void 0);e(this,P1,void 0);e(this,R1,void 0);v(this,C,h.queryCache||new O0),v(this,e1,h.mutationCache||new A0),v(this,o1,h.defaultOptions||{}),v(this,y1,new Map),v(this,b1,new Map),v(this,z1,0)}mount(){i2(this,z1)._++,n(this,z1)===1&&(v(this,P1,o2.subscribe(()=>{o2.isFocused()&&(this.resumePausedMutations(),n(this,C).onFocus())})),v(this,R1,z2.subscribe(()=>{z2.isOnline()&&(this.resumePausedMutations(),n(this,C).onOnline())})))}unmount(){var h,t;i2(this,z1)._--,n(this,z1)===0&&((h=n(this,P1))==null||h.call(this),v(this,P1,void 0),(t=n(this,R1))==null||t.call(this),v(this,R1,void 0))}isFetching(h){return n(this,C).findAll({...h,fetchStatus:"fetching"}).length}isMutating(h){return n(this,e1).findAll({...h,status:"pending"}).length}getQueryData(h){var t;return(t=n(this,C).find({queryKey:h}))==null?void 0:t.state.data}ensureQueryData(h){const t=this.getQueryData(h.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(h)}getQueriesData(h){return this.getQueryCache().findAll(h).map(({queryKey:t,state:c})=>{const a=c.data;return[t,a]})}setQueryData(h,t,c){const a=n(this,C).find({queryKey:h}),l=a==null?void 0:a.state.data,i=f0(t,l);if(typeof i>"u")return;const r=this.defaultQueryOptions({queryKey:h});return n(this,C).build(this,r).setData(i,{...c,manual:!0})}setQueriesData(h,t,c){return O.batch(()=>this.getQueryCache().findAll(h).map(({queryKey:a})=>[a,this.setQueryData(a,t,c)]))}getQueryState(h){var t;return(t=n(this,C).find({queryKey:h}))==null?void 0:t.state}removeQueries(h){const t=n(this,C);O.batch(()=>{t.findAll(h).forEach(c=>{t.remove(c)})})}resetQueries(h,t){const c=n(this,C),a={type:"active",...h};return O.batch(()=>(c.findAll(h).forEach(l=>{l.reset()}),this.refetchQueries(a,t)))}cancelQueries(h={},t={}){const c={revert:!0,...t},a=O.batch(()=>n(this,C).findAll(h).map(l=>l.cancel(c)));return Promise.all(a).then(_).catch(_)}invalidateQueries(h={},t={}){return O.batch(()=>{if(n(this,C).findAll(h).forEach(a=>{a.invalidate()}),h.refetchType==="none")return Promise.resolve();const c={...h,type:h.refetchType??h.type??"active"};return this.refetchQueries(c,t)})}refetchQueries(h={},t){const c={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},a=O.batch(()=>n(this,C).findAll(h).filter(l=>!l.isDisabled()).map(l=>{let i=l.fetch(void 0,c);return c.throwOnError||(i=i.catch(_)),l.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(a).then(_)}fetchQuery(h){const t=this.defaultQueryOptions(h);typeof t.retry>"u"&&(t.retry=!1);const c=n(this,C).build(this,t);return c.isStaleByTime(t.staleTime)?c.fetch(t):Promise.resolve(c.state.data)}prefetchQuery(h){return this.fetchQuery(h).then(_).catch(_)}fetchInfiniteQuery(h){return h.behavior=y0(h.pages),this.fetchQuery(h)}prefetchInfiniteQuery(h){return this.fetchInfiniteQuery(h).then(_).catch(_)}resumePausedMutations(){return n(this,e1).resumePausedMutations()}getQueryCache(){return n(this,C)}getMutationCache(){return n(this,e1)}getDefaultOptions(){return n(this,o1)}setDefaultOptions(h){v(this,o1,h)}setQueryDefaults(h,t){n(this,y1).set(U1(h),{queryKey:h,defaultOptions:t})}getQueryDefaults(h){const t=[...n(this,y1).values()];let c={};return t.forEach(a=>{Q1(h,a.queryKey)&&(c={...c,...a.defaultOptions})}),c}setMutationDefaults(h,t){n(this,b1).set(U1(h),{mutationKey:h,defaultOptions:t})}getMutationDefaults(h){const t=[...n(this,b1).values()];let c={};return t.forEach(a=>{Q1(h,a.mutationKey)&&(c={...c,...a.defaultOptions})}),c}defaultQueryOptions(h){if(h!=null&&h._defaulted)return h;const t={...n(this,o1).queries,...(h==null?void 0:h.queryKey)&&this.getQueryDefaults(h.queryKey),...h,_defaulted:!0};return t.queryHash||(t.queryHash=A2(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(h){return h!=null&&h._defaulted?h:{...n(this,o1).mutations,...(h==null?void 0:h.mutationKey)&&this.getMutationDefaults(h.mutationKey),...h,_defaulted:!0}}clear(){n(this,C).clear(),n(this,e1).clear()}},C=new WeakMap,e1=new WeakMap,o1=new WeakMap,y1=new WeakMap,b1=new WeakMap,z1=new WeakMap,P1=new WeakMap,R1=new WeakMap,Z2),D,x,F1,P,f1,k1,t1,$1,D1,E1,m1,x1,g1,L1,w1,j1,J1,f2,Z1,m2,Y1,x2,X1,L2,t2,w2,h2,B2,c2,I2,g2,d0,Y2,R0=(Y2=class extends W1{constructor(t,c){super();e(this,w1);e(this,J1);e(this,Z1);e(this,Y1);e(this,X1);e(this,t2);e(this,h2);e(this,c2);e(this,g2);e(this,D,void 0);e(this,x,void 0);e(this,F1,void 0);e(this,P,void 0);e(this,f1,void 0);e(this,k1,void 0);e(this,t1,void 0);e(this,$1,void 0);e(this,D1,void 0);e(this,E1,void 0);e(this,m1,void 0);e(this,x1,void 0);e(this,g1,void 0);e(this,L1,void 0);v(this,x,void 0),v(this,F1,void 0),v(this,P,void 0),v(this,L1,new Set),v(this,D,t),this.options=c,v(this,t1,null),this.bindMethods(),this.setOptions(c)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(n(this,x).addObserver(this),N2(n(this,x),this.options)?M(this,w1,j1).call(this):this.updateResult(),M(this,X1,L2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G2(n(this,x),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G2(n(this,x),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,M(this,t2,w2).call(this),M(this,h2,B2).call(this),n(this,x).removeObserver(this)}setOptions(t,c){const a=this.options,l=n(this,x);if(this.options=n(this,D).defaultQueryOptions(t),e2(a,this.options)||n(this,D).getQueryCache().notify({type:"observerOptionsUpdated",query:n(this,x),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=a.queryKey),M(this,c2,I2).call(this);const i=this.hasListeners();i&&W2(n(this,x),l,this.options,a)&&M(this,w1,j1).call(this),this.updateResult(c),i&&(n(this,x)!==l||this.options.enabled!==a.enabled||this.options.staleTime!==a.staleTime)&&M(this,J1,f2).call(this);const r=M(this,Z1,m2).call(this);i&&(n(this,x)!==l||this.options.enabled!==a.enabled||r!==n(this,g1))&&M(this,Y1,x2).call(this,r)}getOptimisticResult(t){const c=n(this,D).getQueryCache().build(n(this,D),t),a=this.createResult(c,t);return k0(this,a)&&(v(this,P,a),v(this,k1,this.options),v(this,f1,n(this,x).state)),a}getCurrentResult(){return n(this,P)}trackResult(t){const c={};return Object.keys(t).forEach(a=>{Object.defineProperty(c,a,{configurable:!1,enumerable:!0,get:()=>(n(this,L1).add(a),t[a])})}),c}getCurrentQuery(){return n(this,x)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const c=n(this,D).defaultQueryOptions(t),a=n(this,D).getQueryCache().build(n(this,D),c);return a.isFetchingOptimistic=!0,a.fetch().then(()=>this.createResult(a,c))}fetch(t){return M(this,w1,j1).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),n(this,P)))}createResult(t,c){var F;const a=n(this,x),l=this.options,i=n(this,P),r=n(this,f1),z=n(this,k1),p=t!==a?t.state:n(this,F1),{state:o}=t;let{error:L,errorUpdatedAt:b,fetchStatus:H,status:V}=o,B=!1,g;if(c._optimisticResults){const I=this.hasListeners(),w=!I&&N2(t,c),a1=I&&W2(t,a,c,l);(w||a1)&&(H=M2(t.options.networkMode)?"fetching":"paused",o.dataUpdatedAt||(V="pending")),c._optimisticResults==="isRestoring"&&(H="idle")}if(c.select&&typeof o.data<"u")if(i&&o.data===(r==null?void 0:r.data)&&c.select===n(this,$1))g=n(this,D1);else try{v(this,$1,c.select),g=c.select(o.data),g=V2(i==null?void 0:i.data,g,c),v(this,D1,g),v(this,t1,null)}catch(I){v(this,t1,I)}else g=o.data;if(typeof c.placeholderData<"u"&&typeof g>"u"&&V==="pending"){let I;if(i!=null&&i.isPlaceholderData&&c.placeholderData===(z==null?void 0:z.placeholderData))I=i.data;else if(I=typeof c.placeholderData=="function"?c.placeholderData((F=n(this,E1))==null?void 0:F.state.data,n(this,E1)):c.placeholderData,c.select&&typeof I<"u")try{I=c.select(I),v(this,t1,null)}catch(w){v(this,t1,w)}typeof I<"u"&&(V="success",g=V2(i==null?void 0:i.data,I,c),B=!0)}n(this,t1)&&(L=n(this,t1),g=n(this,D1),b=Date.now(),V="error");const u=H==="fetching",G=V==="pending",f=V==="error",m=G&&u;return{status:V,fetchStatus:H,isPending:G,isSuccess:V==="success",isError:f,isInitialLoading:m,isLoading:m,data:g,dataUpdatedAt:o.dataUpdatedAt,error:L,errorUpdatedAt:b,failureCount:o.fetchFailureCount,failureReason:o.fetchFailureReason,errorUpdateCount:o.errorUpdateCount,isFetched:o.dataUpdateCount>0||o.errorUpdateCount>0,isFetchedAfterMount:o.dataUpdateCount>p.dataUpdateCount||o.errorUpdateCount>p.errorUpdateCount,isFetching:u,isRefetching:u&&!G,isLoadingError:f&&o.dataUpdatedAt===0,isPaused:H==="paused",isPlaceholderData:B,isRefetchError:f&&o.dataUpdatedAt!==0,isStale:y2(t,c),refetch:this.refetch}}updateResult(t){const c=n(this,P),a=this.createResult(n(this,x),this.options);if(v(this,f1,n(this,x).state),v(this,k1,this.options),n(this,f1).data!==void 0&&v(this,E1,n(this,x)),e2(a,c))return;v(this,P,a);const l={},i=()=>{if(!c)return!0;const{notifyOnChangeProps:r}=this.options,z=typeof r=="function"?r():r;if(z==="all"||!z&&!n(this,L1).size)return!0;const s=new Set(z??n(this,L1));return this.options.throwOnError&&s.add("error"),Object.keys(n(this,P)).some(p=>{const o=p;return n(this,P)[o]!==c[o]&&s.has(o)})};(t==null?void 0:t.listeners)!==!1&&i()&&(l.listeners=!0),M(this,g2,d0).call(this,{...l,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&M(this,X1,L2).call(this)}},D=new WeakMap,x=new WeakMap,F1=new WeakMap,P=new WeakMap,f1=new WeakMap,k1=new WeakMap,t1=new WeakMap,$1=new WeakMap,D1=new WeakMap,E1=new WeakMap,m1=new WeakMap,x1=new WeakMap,g1=new WeakMap,L1=new WeakMap,w1=new WeakSet,j1=function(t){M(this,c2,I2).call(this);let c=n(this,x).fetch(this.options,t);return t!=null&&t.throwOnError||(c=c.catch(_)),c},J1=new WeakSet,f2=function(){if(M(this,t2,w2).call(this),N1||n(this,P).isStale||!s2(this.options.staleTime))return;const c=h0(n(this,P).dataUpdatedAt,this.options.staleTime)+1;v(this,m1,setTimeout(()=>{n(this,P).isStale||this.updateResult()},c))},Z1=new WeakSet,m2=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(n(this,x)):this.options.refetchInterval)??!1},Y1=new WeakSet,x2=function(t){M(this,h2,B2).call(this),v(this,g1,t),!(N1||this.options.enabled===!1||!s2(n(this,g1))||n(this,g1)===0)&&v(this,x1,setInterval(()=>{(this.options.refetchIntervalInBackground||o2.isFocused())&&M(this,w1,j1).call(this)},n(this,g1)))},X1=new WeakSet,L2=function(){M(this,J1,f2).call(this),M(this,Y1,x2).call(this,M(this,Z1,m2).call(this))},t2=new WeakSet,w2=function(){n(this,m1)&&(clearTimeout(n(this,m1)),v(this,m1,void 0))},h2=new WeakSet,B2=function(){n(this,x1)&&(clearInterval(n(this,x1)),v(this,x1,void 0))},c2=new WeakSet,I2=function(){const t=n(this,D).getQueryCache().build(n(this,D),this.options);if(t===n(this,x))return;const c=n(this,x);v(this,x,t),v(this,F1,t.state),this.hasListeners()&&(c==null||c.removeObserver(this),t.addObserver(this))},g2=new WeakSet,d0=function(t){O.batch(()=>{t.listeners&&this.listeners.forEach(c=>{c(n(this,P))}),n(this,D).getQueryCache().notify({query:n(this,x),type:"observerResultsUpdated"})})},Y2);function F0(h,t){return t.enabled!==!1&&!h.state.dataUpdatedAt&&!(h.state.status==="error"&&t.retryOnMount===!1)}function N2(h,t){return F0(h,t)||h.state.dataUpdatedAt>0&&G2(h,t,t.refetchOnMount)}function G2(h,t,c){if(t.enabled!==!1){const a=typeof c=="function"?c(h):c;return a==="always"||a!==!1&&y2(h,t)}return!1}function W2(h,t,c,a){return c.enabled!==!1&&(h!==t||a.enabled===!1)&&(!c.suspense||h.state.status!=="error")&&y2(h,c)}function y2(h,t){return h.isStaleByTime(t.staleTime)}function k0(h,t){return!e2(h.getCurrentResult(),t)}var M1,k,q,l1,T1,d2,a2,C2,X2,D0=(X2=class extends W1{constructor(t,c){super();e(this,T1);e(this,a2);e(this,M1,void 0);e(this,k,void 0);e(this,q,void 0);e(this,l1,void 0);v(this,k,void 0),v(this,M1,t),this.setOptions(c),this.bindMethods(),M(this,T1,d2).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var a;const c=this.options;this.options=n(this,M1).defaultMutationOptions(t),e2(c,this.options)||n(this,M1).getMutationCache().notify({type:"observerOptionsUpdated",mutation:n(this,q),observer:this}),(a=n(this,q))==null||a.setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=n(this,q))==null||t.removeObserver(this)}onMutationUpdate(t){M(this,T1,d2).call(this),M(this,a2,C2).call(this,t)}getCurrentResult(){return n(this,k)}reset(){v(this,q,void 0),M(this,T1,d2).call(this),M(this,a2,C2).call(this)}mutate(t,c){var a;return v(this,l1,c),(a=n(this,q))==null||a.removeObserver(this),v(this,q,n(this,M1).getMutationCache().build(n(this,M1),this.options)),n(this,q).addObserver(this),n(this,q).execute(t)}},M1=new WeakMap,k=new WeakMap,q=new WeakMap,l1=new WeakMap,T1=new WeakSet,d2=function(){var c;const t=((c=n(this,q))==null?void 0:c.state)??v0();v(this,k,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},a2=new WeakSet,C2=function(t){O.batch(()=>{var c,a,l,i,r,z,s,p;n(this,l1)&&this.hasListeners()&&((t==null?void 0:t.type)==="success"?((a=(c=n(this,l1)).onSuccess)==null||a.call(c,t.data,n(this,k).variables,n(this,k).context),(i=(l=n(this,l1)).onSettled)==null||i.call(l,t.data,null,n(this,k).variables,n(this,k).context)):(t==null?void 0:t.type)==="error"&&((z=(r=n(this,l1)).onError)==null||z.call(r,t.error,n(this,k).variables,n(this,k).context),(p=(s=n(this,l1)).onSettled)==null||p.call(s,void 0,t.error,n(this,k).variables,n(this,k).context))),this.listeners.forEach(o=>{o(n(this,k))})})},X2);var r0=A.createContext(void 0),W=h=>{const t=A.useContext(r0);if(h)return h;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},E0=({client:h,children:t})=>(A.useEffect(()=>(h.mount(),()=>{h.unmount()}),[h]),A.createElement(r0.Provider,{value:h},t)),e0=A.createContext(!1),T0=()=>A.useContext(e0),G4=e0.Provider;function N0(){let h=!1;return{clearReset:()=>{h=!1},reset:()=>{h=!0},isReset:()=>h}}var W0=A.createContext(N0()),j0=()=>A.useContext(W0);function o0(h,t){return typeof h=="function"?h(...t):!!h}var U0=(h,t)=>{(h.suspense||h.throwOnError)&&(t.isReset()||(h.retryOnMount=!1))},Q0=h=>{A.useEffect(()=>{h.clearReset()},[h])},K0=({result:h,errorResetBoundary:t,throwOnError:c,query:a})=>h.isError&&!t.isReset()&&!h.isFetching&&o0(c,[h.error,a]);var q0=h=>{h.suspense&&typeof h.staleTime!="number"&&(h.staleTime=1e3)};var _0=(h,t)=>(h==null?void 0:h.suspense)&&t.isPending,$0=(h,t,c)=>t.fetchOptimistic(h).catch(()=>{c.clearReset()});function J0(h,t,c){if(process.env.NODE_ENV!=="production"&&(typeof h!="object"||Array.isArray(h)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const a=W(c),l=T0(),i=j0(),r=a.defaultQueryOptions(h);r._optimisticResults=l?"isRestoring":"optimistic",q0(r),U0(r,i),Q0(i);const[z]=A.useState(()=>new t(a,r)),s=z.getOptimisticResult(r);if(A.useSyncExternalStore(A.useCallback(p=>{const o=l?()=>{}:z.subscribe(O.batchCalls(p));return z.updateResult(),o},[z,l]),()=>z.getCurrentResult(),()=>z.getCurrentResult()),A.useEffect(()=>{z.setOptions(r,{listeners:!1})},[r,z]),_0(r,s))throw $0(r,z,i);if(K0({result:s,errorResetBoundary:i,throwOnError:r.throwOnError,query:z.getCurrentQuery()}))throw s.error;return r.notifyOnChangeProps?s:z.trackResult(s)}function n2(h,t){return J0(h,R0,t)}function J(h,t){const c=W(t),[a]=A.useState(()=>new D0(c,h));A.useEffect(()=>{a.setOptions(h)},[a,h]);const l=A.useSyncExternalStore(A.useCallback(r=>a.subscribe(O.batchCalls(r)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),i=A.useCallback((r,z)=>{a.mutate(r,z).catch(Z0)},[a]);if(l.error&&o0(a.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:i,mutateAsync:l.mutate}}function Z0(){}function R(){return W().getQueryData(["apiBaseUrl"])||"/api/chaibuilder"}const H1=()=>{const{data:h,refetch:t}=n2({queryKey:["currentPage"],queryFn:()=>localStorage.getItem("currentPage")||""});return[h,c=>{c&&(localStorage.setItem("currentPage",c||""),t())}]};let j2="";const l2=()=>(j2=localStorage.getItem("__chai_at"),j2);function Y0(h){const t={method:"GET",headers:{"x-chai-access-token":l2()}};return fetch(h,t)}function X0(h,t){const c={method:"POST",headers:{"x-chai-access-token":l2()},body:JSON.stringify(t)};return fetch(h,c)}function t4(h,t){const c={method:"PUT",headers:{"x-chai-access-token":l2()},body:JSON.stringify(t)};return fetch(h,c)}function h4(h,t){const c={method:"DELETE",headers:{"x-chai-access-token":l2()},body:JSON.stringify(t)};return fetch(h,c)}const j={get:Y0,post:X0,put:t4,delete:h4},b2=()=>{const[h,t]=H1(),c=R();return n2({queryKey:["project"],queryFn:async()=>{const{data:a}=await j.get(`${c}/project`).then(l=>l.json());if(!h&&a){const l=localStorage.getItem("currentPage");t(l||(a==null?void 0:a.homepage))}return a}})},P2=()=>{const h=R();return n2({queryKey:["pages"],queryFn:async()=>{const{data:t}=await j.get(`${h}/pages`).then(c=>c.json());return t||[]}})},z0=()=>{const[h]=H1(),t=R();return n2({queryKey:["page_data",h],queryFn:async()=>{const{data:c}=await j.get(`${t}/page?uuid=${h}`).then(a=>a.json());return c},enabled:!!h,staleTime:3e3})},O2=()=>d.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-gray-200",children:d.jsxRuntimeExports.jsxs("div",{className:"flex flex-col h-full w-full justify-center items-center",children:[d.jsxRuntimeExports.jsxs("div",{className:"flex flex-row gap-2",children:[d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-orange-600 animate-bounce [animation-delay:.6s]"}),d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-600 animate-bounce [animation-delay:.4s]"}),d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-green-600 animate-bounce [animation-delay:.2s]"}),d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-yellow-600 animate-bounce [animation-delay:.0s]"})]}),d.jsxRuntimeExports.jsx("div",{className:"text-gray-700 font-thin",children:"Loading Builder..."})]})}),g0=(h="Project updated successfully.")=>{const t=W(),c=R();return J({mutationFn:async a=>await j.put(`${c}/project`,a).then(l=>l.json()),onSuccess:()=>{t.invalidateQueries({queryKey:["project"]}),h1.toast.success(h)}})},M0=()=>{const[h]=["SAVED"],[t,c]=H1(),a=T.useBuilderReset(),{t:l}=s0.useTranslation();return i=>h!=="SAVED"?(h1.toast.error(l("You have unsaved changes. Please save before changing the page.")),!1):t===i.uuid?!1:(a(),setTimeout(()=>c(i.uuid),100),!0)},c4=()=>{const h=W(),t=M0(),c=R();return J({mutationFn:async a=>j.post(`${c}/pages`,a).then(l=>l.json()),onSuccess:a=>{h.invalidateQueries({queryKey:["pages"]}),t({uuid:a.uuid,slug:a.slug}),h1.toast.success("Page added successfully.")}})},H0=()=>{const h=R(),[t]=H1(),c=W();return J({mutationFn:async a=>j.put(`${h}/page`,a).then(l=>l.json()),onSuccess:async a=>{var l;if(a.result==="error"&&((l=a.error)==null?void 0:l.code)=="PAGE_LOCKED"){c.invalidateQueries({queryKey:["page_data",t]});return}h1.toast.success("Page saved successfully.")}})},a4=()=>{const h=R(),{data:t}=P2(),[c]=H1(),{data:a}=b2(),l=W();return J({mutationFn:async()=>{const i=t.find(r=>r.uuid===c).slug;return await j.post(`${h}/publish`,{slug:i,uuid:c,isHomepage:(a==null?void 0:a.homepage)===c}).then(r=>r.json())},onSuccess:async i=>{var r;if(i.result==="error"&&((r=i.error)==null?void 0:r.code)=="PAGE_LOCKED"){l.invalidateQueries({queryKey:["page_data",c]});return}h1.toast.success("Page published successfully.",{position:"bottom-right",duration:2e3})}})},n4=()=>{const h=W(),t=R();return J({mutationFn:async c=>j.delete(`${t}/page`,c).then(a=>a.json()),onSuccess:()=>{h1.toast.success("Page deleted successfully."),h.invalidateQueries({queryKey:["pages"]})}})},l4=()=>{const h=W(),t=R();return J({mutationFn:async c=>j.post(`${t}/take-control`,{uuid:c}).then(a=>a.json()),onSuccess:(c,a)=>{h.invalidateQueries({queryKey:["page_data",a]})}})},i4=()=>{const h=R();return J({mutationFn:async()=>{const{data:t}=await j.get(`${h}/library`).then(c=>c.json());return c1.sortBy(c1.filter(t,c=>!c1.has(c,"hidden")),"group")}})},v4=()=>{const h=R();return J({mutationFn:async t=>{if(!t||!t.uuid)return[];try{const{data:c}=await j.get(`${h}/block?uuid=${t.uuid}&format=${t.format}`).then(async a=>t.format==="html"?p0.getBlocksFromHTML(await a.text()):await a.json());return c1.set(c,"0._name",c1.capitalize(t.group)),c||[]}catch{return[]}}})},d4=()=>{const h=R();return J({mutationFn:async t=>{const c=new FormData;c.append("file",t);const{data:a}=await fetch(`${h}/upload`,{method:"POST",headers:{"x-chai-access-token":l2()},body:c}).then(l=>l.json());return a}})};function u0(h){return t0.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"},child:[]}]})(h)}function r4(h){return t0.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"},child:[]}]})(h)}const e4=()=>{const{mutate:h,isPending:t}=l4(),[c]=H1(),{data:a}=z0(),l=c1.get(a,"lockedBy.name",""),i=c1.get(a,"lockedBy.email","");return d.jsxRuntimeExports.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg drop-shadow-2xl mx-auto p-10 space-y-4 text-center max-w-xl",children:[d.jsxRuntimeExports.jsxs("h2",{className:"text-2xl font-bold",children:["Page is ",d.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"locked"})]}),d.jsxRuntimeExports.jsxs("div",{className:"text-gray-500 dark:text-gray-400 font-light",children:["This page is currently being edited by ",d.jsxRuntimeExports.jsx("br",{}),d.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-3 w-max mx-auto font-medium text-gray-700 mt-2 text-sm",children:[d.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 bg-gray-100 py-1 px-2 rounded-md",children:[d.jsxRuntimeExports.jsx(r4,{className:"w-4 h-4 text-gray-500"})," ",l]}),d.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 bg-gray-100 py-1 px-2 rounded-md lowercase",children:[d.jsxRuntimeExports.jsx(u0,{className:"w-4 h-4 text-gray-500"})," ",i]})]}),d.jsxRuntimeExports.jsxs("div",{className:"pt-4",children:["If you take control, ",l," will be ",d.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"restricted"})," from making additional edits."]})]}),d.jsxRuntimeExports.jsx(T.Button,{disabled:t,onClick:()=>h(c),className:`w-36 ${t?"bg-transparent shadow-none hover:bg-transparent":""}`,children:t?d.jsxRuntimeExports.jsx(S2.Loader,{className:"text-sm animate-spin text-gray-500"}):"Take Over"})]})},o4=()=>{const h=R(),t=W();return J({mutationFn:async c=>{const a=await fetch(`${h}/login`,{method:"POST",body:JSON.stringify(c)});if(a.ok)return await a.json();throw a.status===401?new Error("Invalid login credentials"):new Error("Invalid")},onSuccess:c=>{const{data:a}=c;if(!a.accessToken){h1.toast.error("Something went wrong. Please try again.",{position:"top-center"});return}localStorage.setItem("__chai_at",a.accessToken),localStorage.setItem("__chai_ur",JSON.stringify(c1.omit(a,["accessToken"]))),t.invalidateQueries({queryKey:["verify"]}),h1.toast.success("Logged in successfully.")},onError:()=>{h1.toast.error("Invalid login credentials. Please try again.",{position:"top-center"})}})},z4=()=>{const h=R();return n2({queryKey:["verify"],queryFn:async()=>{const t=await j.get(`${h}/verify`);return t.ok?(await t.json()).result==="success"?{valid:!0}:(localStorage.removeItem("__chai_at"),{valid:!1}):(localStorage.removeItem("__chai_at"),{valid:!0})}})},g4=()=>{const h=R(),t=W();return J({mutationFn:async()=>{const{result:c}=await j.post(`${h}/logout`).then(a=>a.json());if(c==="success")return localStorage.clear(),t.invalidateQueries({queryKey:["verify"]}),{logout:!0};throw new Error("Invalid session")}})},M4=({children:h})=>{const t=g4();return d.jsxRuntimeExports.jsxs(T.AlertDialog,{children:[d.jsxRuntimeExports.jsx(T.AlertDialogTrigger,{asChild:!0,children:h}),d.jsxRuntimeExports.jsxs(T.AlertDialogContent,{children:[d.jsxRuntimeExports.jsxs(T.AlertDialogHeader,{children:[d.jsxRuntimeExports.jsxs(T.AlertDialogTitle,{children:["Are you sure, you want to ",d.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"Sign Out"}),"?"]}),d.jsxRuntimeExports.jsx(T.AlertDialogDescription,{children:"Kindly ensure that all your data is saved before proceeding with the sign-out process to prevent any potential loss of unsaved information"})]}),d.jsxRuntimeExports.jsxs(T.AlertDialogFooter,{children:[d.jsxRuntimeExports.jsx(T.AlertDialogCancel,{disabled:t.isPending,children:"Cancel"}),d.jsxRuntimeExports.jsxs("button",{disabled:t.isPending,onClick:()=>t.mutate(),className:"rounded-md text-white w-28 text-center justify-center bg-red-600 hover:bg-red-700 flex items-center gap-x-2",children:[t.isPending&&d.jsxRuntimeExports.jsx(S2.Loader2,{className:"animate-spin w-5 h-5"}),"Sign Out"]})]})]})]})},H4=()=>d.jsxRuntimeExports.jsx(M4,{children:d.jsxRuntimeExports.jsx("button",{className:"border-gray-200 rounded-md p-2 mb-2 border",children:d.jsxRuntimeExports.jsx(S2.LogOutIcon,{className:"w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300"})})}),u4=N.lazy(()=>Promise.resolve().then(()=>require("./PagesPanel-re4w2009.cjs"))),s4=N.lazy(()=>Promise.resolve().then(()=>require("./ProjectPanel-uo19SCtW.cjs"))),p4=N.lazy(()=>Promise.resolve().then(()=>require("./CurrentPage-bfY5xyr7.cjs"))),V4=()=>d.jsxRuntimeExports.jsx("h2",{children:"Your Logo"}),f4=()=>{const{mutate:h}=a4();return T.useBuilderProp("editable",!0)?d.jsxRuntimeExports.jsx(T.Button,{onClick:h,className:"bg-blue-600 text-white",children:"Publish"}):null},m4=h=>{var f;const{data:t,isLoading:c}=b2(),{data:a,isLoading:l}=P2(),{data:i}=z0(),{mutate:r}=g0(),{mutate:z}=H0(),[s]=H1(),p=d4(),o=i4(),L=v4(),b=R(),H=N.useCallback(async m=>await p.mutateAsync(m),[p]),V=N.useCallback(async()=>await o.mutateAsync(),[o]),B=N.useCallback(async m=>await L.mutateAsync(m),[L]),g=async(m=20,y=0)=>{const F=`limit=${m}&offset=${y}`,I=await fetch(`${b}/assets?${F}`).then(w=>w.json());return I.result==="success"?I.data:[]},{logo:u=V4}=h;if(c||!t)return d.jsxRuntimeExports.jsx(O2,{});if(l||!a)return d.jsxRuntimeExports.jsx(O2,{});const G={...h,editable:i!=null&&i.lockedBy?i==null?void 0:i.lockedBy.self:!0,nonEditableComponent:e4,blocks:(i==null?void 0:i.blocks)||[],brandingOptions:t.brandingOptions,darkMode:h.darkMode||!1,dataProviders:(i==null?void 0:i.providers)||[],onSavePage:async({blocks:m,providers:y})=>(await z({blocks:m,providers:y,uuid:s}),!0),onSaveBrandingOptions:async m=>(await r({brandingOptions:m}),!0),topBarComponents:{left:[u],center:[p4],right:[f4]},sideBarComponents:{top:[{icon:r2.FileTextIcon,name:"pages",panel:u4},{icon:r2.GearIcon,name:"settings",panel:s4},...((f=h.sideBarComponents)==null?void 0:f.top)||[]],bottom:[H4]},uploadMediaCallback:H,fetchMediaCallback:g,getUILibraryBlocks:V,getExternalPredefinedBlock:B,getPages:()=>a};return d.jsxRuntimeExports.jsx(T.ChaiBuilderEditor,{...G})},x4=({logo:h})=>{const[t,c]=N.useState(!1),[a,l]=N.useState(""),[i,r]=N.useState(""),{mutate:z,isPending:s}=o4(),p=o=>{o.preventDefault(),z({email:a,password:i})};return d.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen flex items-center justify-center bg-[radial-gradient(#AAA,transparent_0.5px)] duration-300 [background-size:6px_6px]",children:d.jsxRuntimeExports.jsx("div",{className:"overflow-hidden bg-white rounded-xl w-96 drop-shadow-2xl duration-300",children:d.jsxRuntimeExports.jsxs("div",{className:"p-12",children:[d.jsxRuntimeExports.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[d.jsxRuntimeExports.jsx(N.Suspense,{children:h?N.createElement(h):""}),d.jsxRuntimeExports.jsx("p",{className:"max-w-xl mx-auto text-base leading-relaxed text-gray-700 font-thin",children:"Enter your login credential to continue"})]}),d.jsxRuntimeExports.jsx("div",{className:"mt-8",children:d.jsxRuntimeExports.jsxs("form",{method:"POST",onSubmit:p,className:"space-y-5",children:[d.jsxRuntimeExports.jsx("div",{children:d.jsxRuntimeExports.jsxs("div",{className:"mt-2.5 relative text-gray-400 focus-within:text-gray-600",children:[d.jsxRuntimeExports.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:d.jsxRuntimeExports.jsx(u0,{})}),d.jsxRuntimeExports.jsx("input",{value:a,onChange:o=>l(o.target.value),type:"email",id:"email",placeholder:"Enter email",className:"block w-full py-4 px-10 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"})]})}),d.jsxRuntimeExports.jsx("div",{children:d.jsxRuntimeExports.jsxs("div",{className:"mt-2.5 relative text-gray-400 focus-within:text-gray-600",children:[d.jsxRuntimeExports.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:d.jsxRuntimeExports.jsx("svg",{className:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4"})})}),d.jsxRuntimeExports.jsx("input",{value:i,onChange:o=>r(o.target.value),type:t?"text":"password",id:"pwd",placeholder:"Enter password",className:"block w-full py-4 px-10 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"}),d.jsxRuntimeExports.jsx("button",{type:"button",className:"absolute inset-y-0 right-4 flex items-center pl-3 cursor-pointer",onClick:()=>c(!t),children:t?d.jsxRuntimeExports.jsx(r2.EyeClosedIcon,{}):d.jsxRuntimeExports.jsx(r2.EyeOpenIcon,{})})]})}),d.jsxRuntimeExports.jsx("div",{children:d.jsxRuntimeExports.jsx("button",{disabled:s||c1.size(a)<2||c1.size(i)<2,type:"submit",className:"inline-flex disabled:bg-gray-400 items-center justify-center w-full px-4 py-4 text-base font-semibold text-white transition-all duration-200 bg-blue-600 border border-transparent rounded-md focus:outline-none hover:bg-blue-700 focus:bg-blue-700",children:s?"Signing in...":"Login"})})]})}),d.jsxRuntimeExports.jsx("div",{className:"mt-4 flex items-center justify-end gap-x-2 text-sm",children:d.jsxRuntimeExports.jsx("a",{href:"https://apps.chaibuilder.com/settings",target:"_blank",className:"text-gray-500 hover:text-blue-400",children:"Forget your password?"})})]})})})},L4=h=>{const{data:t,isLoading:c}=z4(),a=W();return N.useEffect(()=>{a.setQueryData(["apiBaseUrl"],h.apiBaseUrl||"/api/chaibuilder")},[h.apiBaseUrl,a]),c?d.jsxRuntimeExports.jsx(O2,{}):t!=null&&t.valid?d.jsxRuntimeExports.jsx(m4,{...h}):d.jsxRuntimeExports.jsx(x4,{logo:h.logo})},w4=new P0,B4=h=>d.jsxRuntimeExports.jsxs(E0,{client:w4,children:[d.jsxRuntimeExports.jsx(h1.Toaster,{richColors:!0}),d.jsxRuntimeExports.jsx(L4,{...h})]});exports.ChaiBuilderStudio=B4;exports.useAddPage=c4;exports.useChangePage=M0;exports.useCurrentPage=H1;exports.useDeletePage=n4;exports.usePages=P2;exports.useProject=b2;exports.useQueryClient=W;exports.useUpdatePage=H0;exports.useUpdateProject=g0;
1
+ "use strict";var H2=(h,t,c)=>{if(!t.has(h))throw TypeError("Cannot "+c)};var n=(h,t,c)=>(H2(h,t,"read from private field"),c?c.call(h):t.get(h)),e=(h,t,c)=>{if(t.has(h))throw TypeError("Cannot add the same private member more than once");t instanceof WeakSet?t.add(h):t.set(h,c)},v=(h,t,c,a)=>(H2(h,t,"write to private field"),a?a.call(h,c):t.set(h,c),c);var i2=(h,t,c,a)=>({set _(l){v(h,t,l,c)},get _(){return n(h,t,a)}}),M=(h,t,c)=>(H2(h,t,"access private method"),c);const d=require("./jsx-runtime-Z_BpKhVy.cjs"),N=require("react");require("./core.cjs");const r2=require("@radix-ui/react-icons"),T=require("./ChaiBuilderEditor-aY8flOgX.cjs"),h1=require("sonner"),s0=require("react-i18next"),c1=require("lodash-es"),p0=require("./html-to-json-rauxDBi6.cjs"),S2=require("lucide-react"),t0=require("./index--mLLy7QQ.cjs");function V0(h){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(h){for(const c in h)if(c!=="default"){const a=Object.getOwnPropertyDescriptor(h,c);Object.defineProperty(t,c,a.get?a:{enumerable:!0,get:()=>h[c]})}}return t.default=h,Object.freeze(t)}const A=V0(N);var W1=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(h){return this.listeners.add(h),this.onSubscribe(),()=>{this.listeners.delete(h),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},N1=typeof window>"u"||"Deno"in window;function _(){}function f0(h,t){return typeof h=="function"?h(t):h}function s2(h){return typeof h=="number"&&h>=0&&h!==1/0}function h0(h,t){return Math.max(h+(t||0)-Date.now(),0)}function R2(h,t){const{type:c="all",exact:a,fetchStatus:l,predicate:i,queryKey:r,stale:z}=h;if(r){if(a){if(t.queryHash!==A2(r,t.options))return!1}else if(!Q1(t.queryKey,r))return!1}if(c!=="all"){const s=t.isActive();if(c==="active"&&!s||c==="inactive"&&s)return!1}return!(typeof z=="boolean"&&t.isStale()!==z||typeof l<"u"&&l!==t.state.fetchStatus||i&&!i(t))}function F2(h,t){const{exact:c,status:a,predicate:l,mutationKey:i}=h;if(i){if(!t.options.mutationKey)return!1;if(c){if(U1(t.options.mutationKey)!==U1(i))return!1}else if(!Q1(t.options.mutationKey,i))return!1}return!(a&&t.state.status!==a||l&&!l(t))}function A2(h,t){return((t==null?void 0:t.queryKeyHashFn)||U1)(h)}function U1(h){return JSON.stringify(h,(t,c)=>p2(c)?Object.keys(c).sort().reduce((a,l)=>(a[l]=c[l],a),{}):c)}function Q1(h,t){return h===t?!0:typeof h!=typeof t?!1:h&&t&&typeof h=="object"&&typeof t=="object"?!Object.keys(t).some(c=>!Q1(h[c],t[c])):!1}function c0(h,t){if(h===t)return h;const c=k2(h)&&k2(t);if(c||p2(h)&&p2(t)){const a=c?h.length:Object.keys(h).length,l=c?t:Object.keys(t),i=l.length,r=c?[]:{};let z=0;for(let s=0;s<i;s++){const p=c?s:l[s];r[p]=c0(h[p],t[p]),r[p]===h[p]&&z++}return a===i&&z===a?h:r}return t}function e2(h,t){if(h&&!t||t&&!h)return!1;for(const c in h)if(h[c]!==t[c])return!1;return!0}function k2(h){return Array.isArray(h)&&h.length===Object.keys(h).length}function p2(h){if(!D2(h))return!1;const t=h.constructor;if(typeof t>"u")return!0;const c=t.prototype;return!(!D2(c)||!c.hasOwnProperty("isPrototypeOf"))}function D2(h){return Object.prototype.toString.call(h)==="[object Object]"}function a0(h){return new Promise(t=>{setTimeout(t,h)})}function E2(h){a0(0).then(h)}function V2(h,t,c){return typeof c.structuralSharing=="function"?c.structuralSharing(h,t):c.structuralSharing!==!1?c0(h,t):t}function m0(h,t,c=0){const a=[...h,t];return c&&a.length>c?a.slice(1):a}function x0(h,t,c=0){const a=[t,...h];return c&&a.length>c?a.slice(0,-1):a}var u1,v1,B1,U2,L0=(U2=class extends W1{constructor(){super();e(this,u1,void 0);e(this,v1,void 0);e(this,B1,void 0);v(this,B1,t=>{if(!N1&&window.addEventListener){const c=()=>t();return window.addEventListener("visibilitychange",c,!1),()=>{window.removeEventListener("visibilitychange",c)}}})}onSubscribe(){n(this,v1)||this.setEventListener(n(this,B1))}onUnsubscribe(){var t;this.hasListeners()||((t=n(this,v1))==null||t.call(this),v(this,v1,void 0))}setEventListener(t){var c;v(this,B1,t),(c=n(this,v1))==null||c.call(this),v(this,v1,t(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(t){n(this,u1)!==t&&(v(this,u1,t),this.onFocus())}onFocus(){this.listeners.forEach(t=>{t()})}isFocused(){var t;return typeof n(this,u1)=="boolean"?n(this,u1):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},u1=new WeakMap,v1=new WeakMap,B1=new WeakMap,U2),o2=new L0,I1,d1,G1,Q2,w0=(Q2=class extends W1{constructor(){super();e(this,I1,!0);e(this,d1,void 0);e(this,G1,void 0);v(this,G1,t=>{if(!N1&&window.addEventListener){const c=()=>t(!0),a=()=>t(!1);return window.addEventListener("online",c,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",c),window.removeEventListener("offline",a)}}})}onSubscribe(){n(this,d1)||this.setEventListener(n(this,G1))}onUnsubscribe(){var t;this.hasListeners()||((t=n(this,d1))==null||t.call(this),v(this,d1,void 0))}setEventListener(t){var c;v(this,G1,t),(c=n(this,d1))==null||c.call(this),v(this,d1,t(this.setOnline.bind(this)))}setOnline(t){n(this,I1)!==t&&(v(this,I1,t),this.listeners.forEach(a=>{a(t)}))}isOnline(){return n(this,I1)}},I1=new WeakMap,d1=new WeakMap,G1=new WeakMap,Q2),z2=new w0;function B0(h){return Math.min(1e3*2**h,3e4)}function M2(h){return(h??"online")==="online"?z2.isOnline():!0}var n0=class{constructor(h){this.revert=h==null?void 0:h.revert,this.silent=h==null?void 0:h.silent}};function u2(h){return h instanceof n0}function l0(h){let t=!1,c=0,a=!1,l,i,r;const z=new Promise((g,u)=>{i=g,r=u}),s=g=>{var u;a||(H(new n0(g)),(u=h.abort)==null||u.call(h))},p=()=>{t=!0},o=()=>{t=!1},L=()=>!o2.isFocused()||h.networkMode!=="always"&&!z2.isOnline(),b=g=>{var u;a||(a=!0,(u=h.onSuccess)==null||u.call(h,g),l==null||l(),i(g))},H=g=>{var u;a||(a=!0,(u=h.onError)==null||u.call(h,g),l==null||l(),r(g))},V=()=>new Promise(g=>{var u;l=G=>{const f=a||!L();return f&&g(G),f},(u=h.onPause)==null||u.call(h)}).then(()=>{var g;l=void 0,a||(g=h.onContinue)==null||g.call(h)}),B=()=>{if(a)return;let g;try{g=h.fn()}catch(u){g=Promise.reject(u)}Promise.resolve(g).then(b).catch(u=>{var F;if(a)return;const G=h.retry??(N1?0:3),f=h.retryDelay??B0,m=typeof f=="function"?f(c,u):f,y=G===!0||typeof G=="number"&&c<G||typeof G=="function"&&G(c,u);if(t||!y){H(u);return}c++,(F=h.onFail)==null||F.call(h,c,u),a0(m).then(()=>{if(L())return V()}).then(()=>{t?H(u):B()})})};return M2(h.networkMode)?B():V().then(B),{promise:z,cancel:s,continue:()=>(l==null?void 0:l())?z:Promise.resolve(),cancelRetry:p,continueRetry:o}}function I0(){let h=[],t=0,c=o=>{o()},a=o=>{o()};const l=o=>{let L;t++;try{L=o()}finally{t--,t||z()}return L},i=o=>{t?h.push(o):E2(()=>{c(o)})},r=o=>(...L)=>{i(()=>{o(...L)})},z=()=>{const o=h;h=[],o.length&&E2(()=>{a(()=>{o.forEach(L=>{c(L)})})})};return{batch:l,batchCalls:r,schedule:i,setNotifyFunction:o=>{c=o},setBatchNotifyFunction:o=>{a=o}}}var O=I0(),s1,K2,i0=(K2=class{constructor(){e(this,s1,void 0)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),s2(this.gcTime)&&v(this,s1,setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(h){this.gcTime=Math.max(this.gcTime||0,h??(N1?1/0:5*60*1e3))}clearGcTimeout(){n(this,s1)&&(clearTimeout(n(this,s1)),v(this,s1,void 0))}},s1=new WeakMap,K2),C1,O1,U,r1,Q,S,K1,p1,S1,v2,$,n1,q2,G0=(q2=class extends i0{constructor(t){super();e(this,S1);e(this,$);e(this,C1,void 0);e(this,O1,void 0);e(this,U,void 0);e(this,r1,void 0);e(this,Q,void 0);e(this,S,void 0);e(this,K1,void 0);e(this,p1,void 0);v(this,p1,!1),v(this,K1,t.defaultOptions),M(this,S1,v2).call(this,t.options),v(this,S,[]),v(this,U,t.cache),this.queryKey=t.queryKey,this.queryHash=t.queryHash,v(this,C1,t.state||C0(this.options)),this.state=n(this,C1),this.scheduleGc()}get meta(){return this.options.meta}optionalRemove(){!n(this,S).length&&this.state.fetchStatus==="idle"&&n(this,U).remove(this)}setData(t,c){const a=V2(this.state.data,t,this.options);return M(this,$,n1).call(this,{data:a,type:"success",dataUpdatedAt:c==null?void 0:c.updatedAt,manual:c==null?void 0:c.manual}),a}setState(t,c){M(this,$,n1).call(this,{type:"setState",state:t,setStateOptions:c})}cancel(t){var a;const c=n(this,r1);return(a=n(this,Q))==null||a.cancel(t),c?c.then(_).catch(_):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}reset(){this.destroy(),this.setState(n(this,C1))}isActive(){return n(this,S).some(t=>t.options.enabled!==!1)}isDisabled(){return this.getObserversCount()>0&&!this.isActive()}isStale(){return this.state.isInvalidated||!this.state.dataUpdatedAt||n(this,S).some(t=>t.getCurrentResult().isStale)}isStaleByTime(t=0){return this.state.isInvalidated||!this.state.dataUpdatedAt||!h0(this.state.dataUpdatedAt,t)}onFocus(){var c;const t=n(this,S).find(a=>a.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(c=n(this,Q))==null||c.continue()}onOnline(){var c;const t=n(this,S).find(a=>a.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(c=n(this,Q))==null||c.continue()}addObserver(t){n(this,S).includes(t)||(n(this,S).push(t),this.clearGcTimeout(),n(this,U).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){n(this,S).includes(t)&&(v(this,S,n(this,S).filter(c=>c!==t)),n(this,S).length||(n(this,Q)&&(n(this,p1)?n(this,Q).cancel({revert:!0}):n(this,Q).cancelRetry()),this.scheduleGc()),n(this,U).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return n(this,S).length}invalidate(){this.state.isInvalidated||M(this,$,n1).call(this,{type:"invalidate"})}fetch(t,c){var p,o,L,b;if(this.state.fetchStatus!=="idle"){if(this.state.dataUpdatedAt&&(c!=null&&c.cancelRefetch))this.cancel({silent:!0});else if(n(this,r1))return(p=n(this,Q))==null||p.continueRetry(),n(this,r1)}if(t&&M(this,S1,v2).call(this,t),!this.options.queryFn){const H=n(this,S).find(V=>V.options.queryFn);H&&M(this,S1,v2).call(this,H.options)}process.env.NODE_ENV!=="production"&&(Array.isArray(this.options.queryKey)||console.error("As of v4, queryKey needs to be an Array. If you are using a string like 'repoData', please change it to an Array, e.g. ['repoData']"));const a=new AbortController,l={queryKey:this.queryKey,meta:this.meta},i=H=>{Object.defineProperty(H,"signal",{enumerable:!0,get:()=>(v(this,p1,!0),a.signal)})};i(l);const r=()=>this.options.queryFn?(v(this,p1,!1),this.options.persister?this.options.persister(this.options.queryFn,l,this):this.options.queryFn(l)):Promise.reject(new Error(`Missing queryFn: '${this.options.queryHash}'`)),z={fetchOptions:c,options:this.options,queryKey:this.queryKey,state:this.state,fetchFn:r};i(z),(o=this.options.behavior)==null||o.onFetch(z,this),v(this,O1,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((L=z.fetchOptions)==null?void 0:L.meta))&&M(this,$,n1).call(this,{type:"fetch",meta:(b=z.fetchOptions)==null?void 0:b.meta});const s=H=>{var V,B,g,u;u2(H)&&H.silent||M(this,$,n1).call(this,{type:"error",error:H}),u2(H)||((B=(V=n(this,U).config).onError)==null||B.call(V,H,this),(u=(g=n(this,U).config).onSettled)==null||u.call(g,this.state.data,H,this)),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1};return v(this,Q,l0({fn:z.fetchFn,abort:a.abort.bind(a),onSuccess:H=>{var V,B,g,u;if(typeof H>"u"){process.env.NODE_ENV!=="production"&&console.error(`Query data cannot be undefined. Please make sure to return a value other than undefined from your query function. Affected query key: ${this.queryHash}`),s(new Error(`${this.queryHash} data is undefined`));return}this.setData(H),(B=(V=n(this,U).config).onSuccess)==null||B.call(V,H,this),(u=(g=n(this,U).config).onSettled)==null||u.call(g,H,this.state.error,this),this.isFetchingOptimistic||this.scheduleGc(),this.isFetchingOptimistic=!1},onError:s,onFail:(H,V)=>{M(this,$,n1).call(this,{type:"failed",failureCount:H,error:V})},onPause:()=>{M(this,$,n1).call(this,{type:"pause"})},onContinue:()=>{M(this,$,n1).call(this,{type:"continue"})},retry:z.options.retry,retryDelay:z.options.retryDelay,networkMode:z.options.networkMode})),v(this,r1,n(this,Q).promise),n(this,r1)}},C1=new WeakMap,O1=new WeakMap,U=new WeakMap,r1=new WeakMap,Q=new WeakMap,S=new WeakMap,K1=new WeakMap,p1=new WeakMap,S1=new WeakSet,v2=function(t){this.options={...n(this,K1),...t},this.updateGcTime(this.options.gcTime)},$=new WeakSet,n1=function(t){const c=a=>{switch(t.type){case"failed":return{...a,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:t.meta??null,fetchStatus:M2(this.options.networkMode)?"fetching":"paused",...!a.dataUpdatedAt&&{error:null,status:"pending"}};case"success":return{...a,data:t.data,dataUpdateCount:a.dataUpdateCount+1,dataUpdatedAt:t.dataUpdatedAt??Date.now(),error:null,isInvalidated:!1,status:"success",...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};case"error":const l=t.error;return u2(l)&&l.revert&&n(this,O1)?{...n(this,O1),fetchStatus:"idle"}:{...a,error:l,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:l,fetchStatus:"idle",status:"error"};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...t.state}}};this.state=c(this.state),O.batch(()=>{n(this,S).forEach(a=>{a.onQueryUpdate()}),n(this,U).notify({query:this,type:"updated",action:t})})},q2);function C0(h){const t=typeof h.initialData=="function"?h.initialData():h.initialData,c=typeof t<"u",a=c?typeof h.initialDataUpdatedAt=="function"?h.initialDataUpdatedAt():h.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:c?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:c?"success":"pending",fetchStatus:"idle"}}var Z,_2,O0=(_2=class extends W1{constructor(t={}){super();e(this,Z,void 0);this.config=t,v(this,Z,new Map)}build(t,c,a){const l=c.queryKey,i=c.queryHash??A2(l,c);let r=this.get(i);return r||(r=new G0({cache:this,queryKey:l,queryHash:i,options:t.defaultQueryOptions(c),state:a,defaultOptions:t.getQueryDefaults(l)}),this.add(r)),r}add(t){n(this,Z).has(t.queryHash)||(n(this,Z).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const c=n(this,Z).get(t.queryHash);c&&(t.destroy(),c===t&&n(this,Z).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){O.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return n(this,Z).get(t)}getAll(){return[...n(this,Z).values()]}find(t){const c={exact:!0,...t};return this.getAll().find(a=>R2(c,a))}findAll(t={}){const c=this.getAll();return Object.keys(t).length>0?c.filter(a=>R2(t,a)):c}notify(t){O.batch(()=>{this.listeners.forEach(c=>{c(t)})})}onFocus(){O.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){O.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Z=new WeakMap,_2),Y,q1,E,A1,X,i1,$2,S0=($2=class extends i0{constructor(t){super();e(this,X);e(this,Y,void 0);e(this,q1,void 0);e(this,E,void 0);e(this,A1,void 0);this.mutationId=t.mutationId,v(this,q1,t.defaultOptions),v(this,E,t.mutationCache),v(this,Y,[]),this.state=t.state||v0(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options={...n(this,q1),...t},this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){n(this,Y).includes(t)||(n(this,Y).push(t),this.clearGcTimeout(),n(this,E).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){v(this,Y,n(this,Y).filter(c=>c!==t)),this.scheduleGc(),n(this,E).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){n(this,Y).length||(this.state.status==="pending"?this.scheduleGc():n(this,E).remove(this))}continue(){var t;return((t=n(this,A1))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,i,r,z,s,p,o,L,b,H,V,B,g,u,G,f,m,y,F,I;const c=()=>(v(this,A1,l0({fn:()=>this.options.mutationFn?this.options.mutationFn(t):Promise.reject(new Error("No mutationFn found")),onFail:(w,a1)=>{M(this,X,i1).call(this,{type:"failed",failureCount:w,error:a1})},onPause:()=>{M(this,X,i1).call(this,{type:"pause"})},onContinue:()=>{M(this,X,i1).call(this,{type:"continue"})},retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode})),n(this,A1).promise),a=this.state.status==="pending";try{if(!a){M(this,X,i1).call(this,{type:"pending",variables:t}),await((i=(l=n(this,E).config).onMutate)==null?void 0:i.call(l,t,this));const a1=await((z=(r=this.options).onMutate)==null?void 0:z.call(r,t));a1!==this.state.context&&M(this,X,i1).call(this,{type:"pending",context:a1,variables:t})}const w=await c();return await((p=(s=n(this,E).config).onSuccess)==null?void 0:p.call(s,w,t,this.state.context,this)),await((L=(o=this.options).onSuccess)==null?void 0:L.call(o,w,t,this.state.context)),await((H=(b=n(this,E).config).onSettled)==null?void 0:H.call(b,w,null,this.state.variables,this.state.context,this)),await((B=(V=this.options).onSettled)==null?void 0:B.call(V,w,null,t,this.state.context)),M(this,X,i1).call(this,{type:"success",data:w}),w}catch(w){try{throw await((u=(g=n(this,E).config).onError)==null?void 0:u.call(g,w,t,this.state.context,this)),await((f=(G=this.options).onError)==null?void 0:f.call(G,w,t,this.state.context)),await((y=(m=n(this,E).config).onSettled)==null?void 0:y.call(m,void 0,w,this.state.variables,this.state.context,this)),await((I=(F=this.options).onSettled)==null?void 0:I.call(F,void 0,w,t,this.state.context)),w}finally{M(this,X,i1).call(this,{type:"error",error:w})}}}},Y=new WeakMap,q1=new WeakMap,E=new WeakMap,A1=new WeakMap,X=new WeakSet,i1=function(t){const c=a=>{switch(t.type){case"failed":return{...a,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:!M2(this.options.networkMode),status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...a,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:t.error,failureCount:a.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=c(this.state),O.batch(()=>{n(this,Y).forEach(a=>{a.onMutationUpdate(t)}),n(this,E).notify({mutation:this,type:"updated",action:t})})},$2);function v0(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var K,_1,V1,J2,A0=(J2=class extends W1{constructor(t={}){super();e(this,K,void 0);e(this,_1,void 0);e(this,V1,void 0);this.config=t,v(this,K,[]),v(this,_1,0)}build(t,c,a){const l=new S0({mutationCache:this,mutationId:++i2(this,_1)._,options:t.defaultMutationOptions(c),state:a});return this.add(l),l}add(t){n(this,K).push(t),this.notify({type:"added",mutation:t})}remove(t){v(this,K,n(this,K).filter(c=>c!==t)),this.notify({type:"removed",mutation:t})}clear(){O.batch(()=>{n(this,K).forEach(t=>{this.remove(t)})})}getAll(){return n(this,K)}find(t){const c={exact:!0,...t};return n(this,K).find(a=>F2(c,a))}findAll(t={}){return n(this,K).filter(c=>F2(t,c))}notify(t){O.batch(()=>{this.listeners.forEach(c=>{c(t)})})}resumePausedMutations(){return v(this,V1,(n(this,V1)??Promise.resolve()).then(()=>{const t=n(this,K).filter(c=>c.state.isPaused);return O.batch(()=>t.reduce((c,a)=>c.then(()=>a.continue().catch(_)),Promise.resolve()))}).then(()=>{v(this,V1,void 0)})),n(this,V1)}},K=new WeakMap,_1=new WeakMap,V1=new WeakMap,J2);function y0(h){return{onFetch:(t,c)=>{const a=async()=>{var V,B,g,u,G;const l=t.options,i=(g=(B=(V=t.fetchOptions)==null?void 0:V.meta)==null?void 0:B.fetchMore)==null?void 0:g.direction,r=((u=t.state.data)==null?void 0:u.pages)||[],z=((G=t.state.data)==null?void 0:G.pageParams)||[],s={pages:[],pageParams:[]};let p=!1;const o=f=>{Object.defineProperty(f,"signal",{enumerable:!0,get:()=>(t.signal.aborted?p=!0:t.signal.addEventListener("abort",()=>{p=!0}),t.signal)})},L=t.options.queryFn||(()=>Promise.reject(new Error(`Missing queryFn: '${t.options.queryHash}'`))),b=async(f,m,y)=>{if(p)return Promise.reject();if(m==null&&f.pages.length)return Promise.resolve(f);const F={queryKey:t.queryKey,pageParam:m,direction:y?"backward":"forward",meta:t.options.meta};o(F);const I=await L(F),{maxPages:w}=t.options,a1=y?x0:m0;return{pages:a1(f.pages,I,w),pageParams:a1(f.pageParams,m,w)}};let H;if(i&&r.length){const f=i==="backward",m=f?b0:T2,y={pages:r,pageParams:z},F=m(l,y);H=await b(y,F,f)}else{H=await b(s,z[0]??l.initialPageParam);const f=h??r.length;for(let m=1;m<f;m++){const y=T2(l,H);H=await b(H,y)}}return H};t.options.persister?t.fetchFn=()=>{var l,i;return(i=(l=t.options).persister)==null?void 0:i.call(l,a,{queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},c)}:t.fetchFn=a}}}function T2(h,{pages:t,pageParams:c}){const a=t.length-1;return h.getNextPageParam(t[a],t,c[a],c)}function b0(h,{pages:t,pageParams:c}){var a;return(a=h.getPreviousPageParam)==null?void 0:a.call(h,t[0],t,c[0],c)}var C,e1,o1,y1,b1,z1,P1,R1,Z2,P0=(Z2=class{constructor(h={}){e(this,C,void 0);e(this,e1,void 0);e(this,o1,void 0);e(this,y1,void 0);e(this,b1,void 0);e(this,z1,void 0);e(this,P1,void 0);e(this,R1,void 0);v(this,C,h.queryCache||new O0),v(this,e1,h.mutationCache||new A0),v(this,o1,h.defaultOptions||{}),v(this,y1,new Map),v(this,b1,new Map),v(this,z1,0)}mount(){i2(this,z1)._++,n(this,z1)===1&&(v(this,P1,o2.subscribe(()=>{o2.isFocused()&&(this.resumePausedMutations(),n(this,C).onFocus())})),v(this,R1,z2.subscribe(()=>{z2.isOnline()&&(this.resumePausedMutations(),n(this,C).onOnline())})))}unmount(){var h,t;i2(this,z1)._--,n(this,z1)===0&&((h=n(this,P1))==null||h.call(this),v(this,P1,void 0),(t=n(this,R1))==null||t.call(this),v(this,R1,void 0))}isFetching(h){return n(this,C).findAll({...h,fetchStatus:"fetching"}).length}isMutating(h){return n(this,e1).findAll({...h,status:"pending"}).length}getQueryData(h){var t;return(t=n(this,C).find({queryKey:h}))==null?void 0:t.state.data}ensureQueryData(h){const t=this.getQueryData(h.queryKey);return t!==void 0?Promise.resolve(t):this.fetchQuery(h)}getQueriesData(h){return this.getQueryCache().findAll(h).map(({queryKey:t,state:c})=>{const a=c.data;return[t,a]})}setQueryData(h,t,c){const a=n(this,C).find({queryKey:h}),l=a==null?void 0:a.state.data,i=f0(t,l);if(typeof i>"u")return;const r=this.defaultQueryOptions({queryKey:h});return n(this,C).build(this,r).setData(i,{...c,manual:!0})}setQueriesData(h,t,c){return O.batch(()=>this.getQueryCache().findAll(h).map(({queryKey:a})=>[a,this.setQueryData(a,t,c)]))}getQueryState(h){var t;return(t=n(this,C).find({queryKey:h}))==null?void 0:t.state}removeQueries(h){const t=n(this,C);O.batch(()=>{t.findAll(h).forEach(c=>{t.remove(c)})})}resetQueries(h,t){const c=n(this,C),a={type:"active",...h};return O.batch(()=>(c.findAll(h).forEach(l=>{l.reset()}),this.refetchQueries(a,t)))}cancelQueries(h={},t={}){const c={revert:!0,...t},a=O.batch(()=>n(this,C).findAll(h).map(l=>l.cancel(c)));return Promise.all(a).then(_).catch(_)}invalidateQueries(h={},t={}){return O.batch(()=>{if(n(this,C).findAll(h).forEach(a=>{a.invalidate()}),h.refetchType==="none")return Promise.resolve();const c={...h,type:h.refetchType??h.type??"active"};return this.refetchQueries(c,t)})}refetchQueries(h={},t){const c={...t,cancelRefetch:(t==null?void 0:t.cancelRefetch)??!0},a=O.batch(()=>n(this,C).findAll(h).filter(l=>!l.isDisabled()).map(l=>{let i=l.fetch(void 0,c);return c.throwOnError||(i=i.catch(_)),l.state.fetchStatus==="paused"?Promise.resolve():i}));return Promise.all(a).then(_)}fetchQuery(h){const t=this.defaultQueryOptions(h);typeof t.retry>"u"&&(t.retry=!1);const c=n(this,C).build(this,t);return c.isStaleByTime(t.staleTime)?c.fetch(t):Promise.resolve(c.state.data)}prefetchQuery(h){return this.fetchQuery(h).then(_).catch(_)}fetchInfiniteQuery(h){return h.behavior=y0(h.pages),this.fetchQuery(h)}prefetchInfiniteQuery(h){return this.fetchInfiniteQuery(h).then(_).catch(_)}resumePausedMutations(){return n(this,e1).resumePausedMutations()}getQueryCache(){return n(this,C)}getMutationCache(){return n(this,e1)}getDefaultOptions(){return n(this,o1)}setDefaultOptions(h){v(this,o1,h)}setQueryDefaults(h,t){n(this,y1).set(U1(h),{queryKey:h,defaultOptions:t})}getQueryDefaults(h){const t=[...n(this,y1).values()];let c={};return t.forEach(a=>{Q1(h,a.queryKey)&&(c={...c,...a.defaultOptions})}),c}setMutationDefaults(h,t){n(this,b1).set(U1(h),{mutationKey:h,defaultOptions:t})}getMutationDefaults(h){const t=[...n(this,b1).values()];let c={};return t.forEach(a=>{Q1(h,a.mutationKey)&&(c={...c,...a.defaultOptions})}),c}defaultQueryOptions(h){if(h!=null&&h._defaulted)return h;const t={...n(this,o1).queries,...(h==null?void 0:h.queryKey)&&this.getQueryDefaults(h.queryKey),...h,_defaulted:!0};return t.queryHash||(t.queryHash=A2(t.queryKey,t)),typeof t.refetchOnReconnect>"u"&&(t.refetchOnReconnect=t.networkMode!=="always"),typeof t.throwOnError>"u"&&(t.throwOnError=!!t.suspense),typeof t.networkMode>"u"&&t.persister&&(t.networkMode="offlineFirst"),t}defaultMutationOptions(h){return h!=null&&h._defaulted?h:{...n(this,o1).mutations,...(h==null?void 0:h.mutationKey)&&this.getMutationDefaults(h.mutationKey),...h,_defaulted:!0}}clear(){n(this,C).clear(),n(this,e1).clear()}},C=new WeakMap,e1=new WeakMap,o1=new WeakMap,y1=new WeakMap,b1=new WeakMap,z1=new WeakMap,P1=new WeakMap,R1=new WeakMap,Z2),D,x,F1,P,f1,k1,t1,$1,D1,E1,m1,x1,g1,L1,w1,j1,J1,f2,Z1,m2,Y1,x2,X1,L2,t2,w2,h2,B2,c2,I2,g2,d0,Y2,R0=(Y2=class extends W1{constructor(t,c){super();e(this,w1);e(this,J1);e(this,Z1);e(this,Y1);e(this,X1);e(this,t2);e(this,h2);e(this,c2);e(this,g2);e(this,D,void 0);e(this,x,void 0);e(this,F1,void 0);e(this,P,void 0);e(this,f1,void 0);e(this,k1,void 0);e(this,t1,void 0);e(this,$1,void 0);e(this,D1,void 0);e(this,E1,void 0);e(this,m1,void 0);e(this,x1,void 0);e(this,g1,void 0);e(this,L1,void 0);v(this,x,void 0),v(this,F1,void 0),v(this,P,void 0),v(this,L1,new Set),v(this,D,t),this.options=c,v(this,t1,null),this.bindMethods(),this.setOptions(c)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(n(this,x).addObserver(this),N2(n(this,x),this.options)?M(this,w1,j1).call(this):this.updateResult(),M(this,X1,L2).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return G2(n(this,x),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return G2(n(this,x),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,M(this,t2,w2).call(this),M(this,h2,B2).call(this),n(this,x).removeObserver(this)}setOptions(t,c){const a=this.options,l=n(this,x);if(this.options=n(this,D).defaultQueryOptions(t),e2(a,this.options)||n(this,D).getQueryCache().notify({type:"observerOptionsUpdated",query:n(this,x),observer:this}),typeof this.options.enabled<"u"&&typeof this.options.enabled!="boolean")throw new Error("Expected enabled to be a boolean");this.options.queryKey||(this.options.queryKey=a.queryKey),M(this,c2,I2).call(this);const i=this.hasListeners();i&&W2(n(this,x),l,this.options,a)&&M(this,w1,j1).call(this),this.updateResult(c),i&&(n(this,x)!==l||this.options.enabled!==a.enabled||this.options.staleTime!==a.staleTime)&&M(this,J1,f2).call(this);const r=M(this,Z1,m2).call(this);i&&(n(this,x)!==l||this.options.enabled!==a.enabled||r!==n(this,g1))&&M(this,Y1,x2).call(this,r)}getOptimisticResult(t){const c=n(this,D).getQueryCache().build(n(this,D),t),a=this.createResult(c,t);return k0(this,a)&&(v(this,P,a),v(this,k1,this.options),v(this,f1,n(this,x).state)),a}getCurrentResult(){return n(this,P)}trackResult(t){const c={};return Object.keys(t).forEach(a=>{Object.defineProperty(c,a,{configurable:!1,enumerable:!0,get:()=>(n(this,L1).add(a),t[a])})}),c}getCurrentQuery(){return n(this,x)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const c=n(this,D).defaultQueryOptions(t),a=n(this,D).getQueryCache().build(n(this,D),c);return a.isFetchingOptimistic=!0,a.fetch().then(()=>this.createResult(a,c))}fetch(t){return M(this,w1,j1).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),n(this,P)))}createResult(t,c){var F;const a=n(this,x),l=this.options,i=n(this,P),r=n(this,f1),z=n(this,k1),p=t!==a?t.state:n(this,F1),{state:o}=t;let{error:L,errorUpdatedAt:b,fetchStatus:H,status:V}=o,B=!1,g;if(c._optimisticResults){const I=this.hasListeners(),w=!I&&N2(t,c),a1=I&&W2(t,a,c,l);(w||a1)&&(H=M2(t.options.networkMode)?"fetching":"paused",o.dataUpdatedAt||(V="pending")),c._optimisticResults==="isRestoring"&&(H="idle")}if(c.select&&typeof o.data<"u")if(i&&o.data===(r==null?void 0:r.data)&&c.select===n(this,$1))g=n(this,D1);else try{v(this,$1,c.select),g=c.select(o.data),g=V2(i==null?void 0:i.data,g,c),v(this,D1,g),v(this,t1,null)}catch(I){v(this,t1,I)}else g=o.data;if(typeof c.placeholderData<"u"&&typeof g>"u"&&V==="pending"){let I;if(i!=null&&i.isPlaceholderData&&c.placeholderData===(z==null?void 0:z.placeholderData))I=i.data;else if(I=typeof c.placeholderData=="function"?c.placeholderData((F=n(this,E1))==null?void 0:F.state.data,n(this,E1)):c.placeholderData,c.select&&typeof I<"u")try{I=c.select(I),v(this,t1,null)}catch(w){v(this,t1,w)}typeof I<"u"&&(V="success",g=V2(i==null?void 0:i.data,I,c),B=!0)}n(this,t1)&&(L=n(this,t1),g=n(this,D1),b=Date.now(),V="error");const u=H==="fetching",G=V==="pending",f=V==="error",m=G&&u;return{status:V,fetchStatus:H,isPending:G,isSuccess:V==="success",isError:f,isInitialLoading:m,isLoading:m,data:g,dataUpdatedAt:o.dataUpdatedAt,error:L,errorUpdatedAt:b,failureCount:o.fetchFailureCount,failureReason:o.fetchFailureReason,errorUpdateCount:o.errorUpdateCount,isFetched:o.dataUpdateCount>0||o.errorUpdateCount>0,isFetchedAfterMount:o.dataUpdateCount>p.dataUpdateCount||o.errorUpdateCount>p.errorUpdateCount,isFetching:u,isRefetching:u&&!G,isLoadingError:f&&o.dataUpdatedAt===0,isPaused:H==="paused",isPlaceholderData:B,isRefetchError:f&&o.dataUpdatedAt!==0,isStale:y2(t,c),refetch:this.refetch}}updateResult(t){const c=n(this,P),a=this.createResult(n(this,x),this.options);if(v(this,f1,n(this,x).state),v(this,k1,this.options),n(this,f1).data!==void 0&&v(this,E1,n(this,x)),e2(a,c))return;v(this,P,a);const l={},i=()=>{if(!c)return!0;const{notifyOnChangeProps:r}=this.options,z=typeof r=="function"?r():r;if(z==="all"||!z&&!n(this,L1).size)return!0;const s=new Set(z??n(this,L1));return this.options.throwOnError&&s.add("error"),Object.keys(n(this,P)).some(p=>{const o=p;return n(this,P)[o]!==c[o]&&s.has(o)})};(t==null?void 0:t.listeners)!==!1&&i()&&(l.listeners=!0),M(this,g2,d0).call(this,{...l,...t})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&M(this,X1,L2).call(this)}},D=new WeakMap,x=new WeakMap,F1=new WeakMap,P=new WeakMap,f1=new WeakMap,k1=new WeakMap,t1=new WeakMap,$1=new WeakMap,D1=new WeakMap,E1=new WeakMap,m1=new WeakMap,x1=new WeakMap,g1=new WeakMap,L1=new WeakMap,w1=new WeakSet,j1=function(t){M(this,c2,I2).call(this);let c=n(this,x).fetch(this.options,t);return t!=null&&t.throwOnError||(c=c.catch(_)),c},J1=new WeakSet,f2=function(){if(M(this,t2,w2).call(this),N1||n(this,P).isStale||!s2(this.options.staleTime))return;const c=h0(n(this,P).dataUpdatedAt,this.options.staleTime)+1;v(this,m1,setTimeout(()=>{n(this,P).isStale||this.updateResult()},c))},Z1=new WeakSet,m2=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(n(this,x)):this.options.refetchInterval)??!1},Y1=new WeakSet,x2=function(t){M(this,h2,B2).call(this),v(this,g1,t),!(N1||this.options.enabled===!1||!s2(n(this,g1))||n(this,g1)===0)&&v(this,x1,setInterval(()=>{(this.options.refetchIntervalInBackground||o2.isFocused())&&M(this,w1,j1).call(this)},n(this,g1)))},X1=new WeakSet,L2=function(){M(this,J1,f2).call(this),M(this,Y1,x2).call(this,M(this,Z1,m2).call(this))},t2=new WeakSet,w2=function(){n(this,m1)&&(clearTimeout(n(this,m1)),v(this,m1,void 0))},h2=new WeakSet,B2=function(){n(this,x1)&&(clearInterval(n(this,x1)),v(this,x1,void 0))},c2=new WeakSet,I2=function(){const t=n(this,D).getQueryCache().build(n(this,D),this.options);if(t===n(this,x))return;const c=n(this,x);v(this,x,t),v(this,F1,t.state),this.hasListeners()&&(c==null||c.removeObserver(this),t.addObserver(this))},g2=new WeakSet,d0=function(t){O.batch(()=>{t.listeners&&this.listeners.forEach(c=>{c(n(this,P))}),n(this,D).getQueryCache().notify({query:n(this,x),type:"observerResultsUpdated"})})},Y2);function F0(h,t){return t.enabled!==!1&&!h.state.dataUpdatedAt&&!(h.state.status==="error"&&t.retryOnMount===!1)}function N2(h,t){return F0(h,t)||h.state.dataUpdatedAt>0&&G2(h,t,t.refetchOnMount)}function G2(h,t,c){if(t.enabled!==!1){const a=typeof c=="function"?c(h):c;return a==="always"||a!==!1&&y2(h,t)}return!1}function W2(h,t,c,a){return c.enabled!==!1&&(h!==t||a.enabled===!1)&&(!c.suspense||h.state.status!=="error")&&y2(h,c)}function y2(h,t){return h.isStaleByTime(t.staleTime)}function k0(h,t){return!e2(h.getCurrentResult(),t)}var M1,k,q,l1,T1,d2,a2,C2,X2,D0=(X2=class extends W1{constructor(t,c){super();e(this,T1);e(this,a2);e(this,M1,void 0);e(this,k,void 0);e(this,q,void 0);e(this,l1,void 0);v(this,k,void 0),v(this,M1,t),this.setOptions(c),this.bindMethods(),M(this,T1,d2).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(t){var a;const c=this.options;this.options=n(this,M1).defaultMutationOptions(t),e2(c,this.options)||n(this,M1).getMutationCache().notify({type:"observerOptionsUpdated",mutation:n(this,q),observer:this}),(a=n(this,q))==null||a.setOptions(this.options)}onUnsubscribe(){var t;this.hasListeners()||(t=n(this,q))==null||t.removeObserver(this)}onMutationUpdate(t){M(this,T1,d2).call(this),M(this,a2,C2).call(this,t)}getCurrentResult(){return n(this,k)}reset(){v(this,q,void 0),M(this,T1,d2).call(this),M(this,a2,C2).call(this)}mutate(t,c){var a;return v(this,l1,c),(a=n(this,q))==null||a.removeObserver(this),v(this,q,n(this,M1).getMutationCache().build(n(this,M1),this.options)),n(this,q).addObserver(this),n(this,q).execute(t)}},M1=new WeakMap,k=new WeakMap,q=new WeakMap,l1=new WeakMap,T1=new WeakSet,d2=function(){var c;const t=((c=n(this,q))==null?void 0:c.state)??v0();v(this,k,{...t,isPending:t.status==="pending",isSuccess:t.status==="success",isError:t.status==="error",isIdle:t.status==="idle",mutate:this.mutate,reset:this.reset})},a2=new WeakSet,C2=function(t){O.batch(()=>{var c,a,l,i,r,z,s,p;n(this,l1)&&this.hasListeners()&&((t==null?void 0:t.type)==="success"?((a=(c=n(this,l1)).onSuccess)==null||a.call(c,t.data,n(this,k).variables,n(this,k).context),(i=(l=n(this,l1)).onSettled)==null||i.call(l,t.data,null,n(this,k).variables,n(this,k).context)):(t==null?void 0:t.type)==="error"&&((z=(r=n(this,l1)).onError)==null||z.call(r,t.error,n(this,k).variables,n(this,k).context),(p=(s=n(this,l1)).onSettled)==null||p.call(s,void 0,t.error,n(this,k).variables,n(this,k).context))),this.listeners.forEach(o=>{o(n(this,k))})})},X2);var r0=A.createContext(void 0),W=h=>{const t=A.useContext(r0);if(h)return h;if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},E0=({client:h,children:t})=>(A.useEffect(()=>(h.mount(),()=>{h.unmount()}),[h]),A.createElement(r0.Provider,{value:h},t)),e0=A.createContext(!1),T0=()=>A.useContext(e0),G4=e0.Provider;function N0(){let h=!1;return{clearReset:()=>{h=!1},reset:()=>{h=!0},isReset:()=>h}}var W0=A.createContext(N0()),j0=()=>A.useContext(W0);function o0(h,t){return typeof h=="function"?h(...t):!!h}var U0=(h,t)=>{(h.suspense||h.throwOnError)&&(t.isReset()||(h.retryOnMount=!1))},Q0=h=>{A.useEffect(()=>{h.clearReset()},[h])},K0=({result:h,errorResetBoundary:t,throwOnError:c,query:a})=>h.isError&&!t.isReset()&&!h.isFetching&&o0(c,[h.error,a]);var q0=h=>{h.suspense&&typeof h.staleTime!="number"&&(h.staleTime=1e3)};var _0=(h,t)=>(h==null?void 0:h.suspense)&&t.isPending,$0=(h,t,c)=>t.fetchOptimistic(h).catch(()=>{c.clearReset()});function J0(h,t,c){if(process.env.NODE_ENV!=="production"&&(typeof h!="object"||Array.isArray(h)))throw new Error('Bad argument type. Starting with v5, only the "Object" form is allowed when calling query related functions. Please use the error stack to find the culprit call. More info here: https://tanstack.com/query/latest/docs/react/guides/migrating-to-v5#supports-a-single-signature-one-object');const a=W(c),l=T0(),i=j0(),r=a.defaultQueryOptions(h);r._optimisticResults=l?"isRestoring":"optimistic",q0(r),U0(r,i),Q0(i);const[z]=A.useState(()=>new t(a,r)),s=z.getOptimisticResult(r);if(A.useSyncExternalStore(A.useCallback(p=>{const o=l?()=>{}:z.subscribe(O.batchCalls(p));return z.updateResult(),o},[z,l]),()=>z.getCurrentResult(),()=>z.getCurrentResult()),A.useEffect(()=>{z.setOptions(r,{listeners:!1})},[r,z]),_0(r,s))throw $0(r,z,i);if(K0({result:s,errorResetBoundary:i,throwOnError:r.throwOnError,query:z.getCurrentQuery()}))throw s.error;return r.notifyOnChangeProps?s:z.trackResult(s)}function n2(h,t){return J0(h,R0,t)}function J(h,t){const c=W(t),[a]=A.useState(()=>new D0(c,h));A.useEffect(()=>{a.setOptions(h)},[a,h]);const l=A.useSyncExternalStore(A.useCallback(r=>a.subscribe(O.batchCalls(r)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),i=A.useCallback((r,z)=>{a.mutate(r,z).catch(Z0)},[a]);if(l.error&&o0(a.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:i,mutateAsync:l.mutate}}function Z0(){}function R(){return W().getQueryData(["apiBaseUrl"])||"/api/chaibuilder"}const H1=()=>{const{data:h,refetch:t}=n2({queryKey:["currentPage"],queryFn:()=>localStorage.getItem("currentPage")||""});return[h,c=>{c&&(localStorage.setItem("currentPage",c||""),t())}]};let j2="";const l2=()=>(j2=localStorage.getItem("__chai_at"),j2);function Y0(h){const t={method:"GET",headers:{"x-chai-access-token":l2()}};return fetch(h,t)}function X0(h,t){const c={method:"POST",headers:{"x-chai-access-token":l2()},body:JSON.stringify(t)};return fetch(h,c)}function t4(h,t){const c={method:"PUT",headers:{"x-chai-access-token":l2()},body:JSON.stringify(t)};return fetch(h,c)}function h4(h,t){const c={method:"DELETE",headers:{"x-chai-access-token":l2()},body:JSON.stringify(t)};return fetch(h,c)}const j={get:Y0,post:X0,put:t4,delete:h4},b2=()=>{const[h,t]=H1(),c=R();return n2({queryKey:["project"],queryFn:async()=>{const{data:a}=await j.get(`${c}/project`).then(l=>l.json());if(!h&&a){const l=localStorage.getItem("currentPage");t(l||(a==null?void 0:a.homepage))}return a}})},P2=()=>{const h=R();return n2({queryKey:["pages"],queryFn:async()=>{const{data:t}=await j.get(`${h}/pages`).then(c=>c.json());return t||[]}})},z0=()=>{const[h]=H1(),t=R();return n2({queryKey:["page_data",h],queryFn:async()=>{const{data:c}=await j.get(`${t}/page?uuid=${h}`).then(a=>a.json());return c},enabled:!!h,staleTime:3e3})},O2=()=>d.jsxRuntimeExports.jsx("div",{className:"h-screen w-screen bg-gray-200",children:d.jsxRuntimeExports.jsxs("div",{className:"flex flex-col h-full w-full justify-center items-center",children:[d.jsxRuntimeExports.jsxs("div",{className:"flex flex-row gap-2",children:[d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-orange-600 animate-bounce [animation-delay:.6s]"}),d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-blue-600 animate-bounce [animation-delay:.4s]"}),d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-green-600 animate-bounce [animation-delay:.2s]"}),d.jsxRuntimeExports.jsx("div",{className:"w-4 h-4 rounded-full bg-yellow-600 animate-bounce [animation-delay:.0s]"})]}),d.jsxRuntimeExports.jsx("div",{className:"text-gray-700 font-thin",children:"Loading Builder..."})]})}),g0=(h="Project updated successfully.")=>{const t=W(),c=R();return J({mutationFn:async a=>await j.put(`${c}/project`,a).then(l=>l.json()),onSuccess:()=>{t.invalidateQueries({queryKey:["project"]}),h1.toast.success(h)}})},M0=()=>{const[h]=["SAVED"],[t,c]=H1(),a=T.useBuilderReset(),{t:l}=s0.useTranslation();return i=>h!=="SAVED"?(h1.toast.error(l("You have unsaved changes. Please save before changing the page.")),!1):t===i.uuid?!1:(a(),setTimeout(()=>c(i.uuid),100),!0)},c4=()=>{const h=W(),t=M0(),c=R();return J({mutationFn:async a=>j.post(`${c}/pages`,a).then(l=>l.json()),onSuccess:a=>{h.invalidateQueries({queryKey:["pages"]}),t({uuid:a.uuid,slug:a.slug}),h1.toast.success("Page added successfully.")}})},H0=()=>{const h=R(),[t]=H1(),c=W();return J({mutationFn:async a=>j.put(`${h}/page`,a).then(l=>l.json()),onSuccess:async a=>{var l;if(a.result==="error"&&((l=a.error)==null?void 0:l.code)=="PAGE_LOCKED"){c.invalidateQueries({queryKey:["page_data",t]});return}h1.toast.success("Page saved successfully.")}})},a4=()=>{const h=R(),{data:t}=P2(),[c]=H1(),{data:a}=b2(),l=W();return J({mutationFn:async()=>{const i=t.find(r=>r.uuid===c).slug;return await j.post(`${h}/publish`,{slug:i,uuid:c,isHomepage:(a==null?void 0:a.homepage)===c}).then(r=>r.json())},onSuccess:async i=>{var r;if(i.result==="error"&&((r=i.error)==null?void 0:r.code)=="PAGE_LOCKED"){l.invalidateQueries({queryKey:["page_data",c]});return}h1.toast.success("Page published successfully.",{position:"bottom-right",duration:2e3})}})},n4=()=>{const h=W(),t=R();return J({mutationFn:async c=>j.delete(`${t}/page`,c).then(a=>a.json()),onSuccess:()=>{h1.toast.success("Page deleted successfully."),h.invalidateQueries({queryKey:["pages"]})}})},l4=()=>{const h=W(),t=R();return J({mutationFn:async c=>j.post(`${t}/take-control`,{uuid:c}).then(a=>a.json()),onSuccess:(c,a)=>{h.invalidateQueries({queryKey:["page_data",a]})}})},i4=()=>{const h=R();return J({mutationFn:async()=>{const{data:t}=await j.get(`${h}/library`).then(c=>c.json());return c1.sortBy(c1.filter(t,c=>!c1.has(c,"hidden")),"group")}})},v4=()=>{const h=R();return J({mutationFn:async t=>{if(!t||!t.uuid)return[];try{const{data:c}=await j.get(`${h}/block?uuid=${t.uuid}&format=${t.format}`).then(async a=>t.format==="html"?p0.getBlocksFromHTML(await a.text()):await a.json());return c1.set(c,"0._name",c1.capitalize(t.group)),c||[]}catch{return[]}}})},d4=()=>{const h=R();return J({mutationFn:async t=>{const c=new FormData;c.append("file",t);const{data:a}=await fetch(`${h}/upload`,{method:"POST",headers:{"x-chai-access-token":l2()},body:c}).then(l=>l.json());return a}})};function u0(h){return t0.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 4-8 5-8-5V6l8 5 8-5v2z"},child:[]}]})(h)}function r4(h){return t0.GenIcon({tag:"svg",attr:{viewBox:"0 0 24 24"},child:[{tag:"path",attr:{fill:"none",d:"M0 0h24v24H0z"},child:[]},{tag:"path",attr:{d:"M12 12c2.21 0 4-1.79 4-4s-1.79-4-4-4-4 1.79-4 4 1.79 4 4 4zm0 2c-2.67 0-8 1.34-8 4v2h16v-2c0-2.66-5.33-4-8-4z"},child:[]}]})(h)}const e4=()=>{const{mutate:h,isPending:t}=l4(),[c]=H1(),{data:a}=z0(),l=c1.get(a,"lockedBy.name",""),i=c1.get(a,"lockedBy.email","");return d.jsxRuntimeExports.jsxs("div",{className:"bg-white dark:bg-gray-800 rounded-lg drop-shadow-2xl mx-auto p-10 space-y-4 text-center max-w-xl",children:[d.jsxRuntimeExports.jsxs("h2",{className:"text-2xl font-bold",children:["Page is ",d.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"locked"})]}),d.jsxRuntimeExports.jsxs("div",{className:"text-gray-500 dark:text-gray-400 font-light",children:["This page is currently being edited by ",d.jsxRuntimeExports.jsx("br",{}),d.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-3 w-max mx-auto font-medium text-gray-700 mt-2 text-sm",children:[d.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 bg-gray-100 py-1 px-2 rounded-md",children:[d.jsxRuntimeExports.jsx(r4,{className:"w-4 h-4 text-gray-500"})," ",l]}),d.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-x-2 bg-gray-100 py-1 px-2 rounded-md lowercase",children:[d.jsxRuntimeExports.jsx(u0,{className:"w-4 h-4 text-gray-500"})," ",i]})]}),d.jsxRuntimeExports.jsxs("div",{className:"pt-4",children:["If you take control, ",l," will be ",d.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"restricted"})," from making additional edits."]})]}),d.jsxRuntimeExports.jsx(T.Button,{disabled:t,onClick:()=>h(c),className:`w-36 ${t?"bg-transparent shadow-none hover:bg-transparent":""}`,children:t?d.jsxRuntimeExports.jsx(S2.Loader,{className:"text-sm animate-spin text-gray-500"}):"Take Over"})]})},o4=()=>{const h=R(),t=W();return J({mutationFn:async c=>{const a=await fetch(`${h}/login`,{method:"POST",body:JSON.stringify(c)});if(a.ok)return await a.json();throw a.status===401?new Error("Invalid login credentials"):new Error("Invalid")},onSuccess:c=>{const{data:a}=c;if(!a.accessToken){h1.toast.error("Something went wrong. Please try again.",{position:"top-center"});return}localStorage.setItem("__chai_at",a.accessToken),localStorage.setItem("__chai_ur",JSON.stringify(c1.omit(a,["accessToken"]))),t.invalidateQueries({queryKey:["verify"]}),h1.toast.success("Logged in successfully.")},onError:()=>{h1.toast.error("Invalid login credentials. Please try again.",{position:"top-center"})}})},z4=()=>{const h=R();return n2({queryKey:["verify"],queryFn:async()=>{const t=await j.get(`${h}/verify`);return t.ok?(await t.json()).result==="success"?{valid:!0}:(localStorage.removeItem("__chai_at"),{valid:!1}):(localStorage.removeItem("__chai_at"),{valid:!0})}})},g4=()=>{const h=R(),t=W();return J({mutationFn:async()=>{const{result:c}=await j.post(`${h}/logout`).then(a=>a.json());if(c==="success")return localStorage.clear(),t.invalidateQueries({queryKey:["verify"]}),{logout:!0};throw new Error("Invalid session")}})},M4=({children:h})=>{const t=g4();return d.jsxRuntimeExports.jsxs(T.AlertDialog,{children:[d.jsxRuntimeExports.jsx(T.AlertDialogTrigger,{asChild:!0,children:h}),d.jsxRuntimeExports.jsxs(T.AlertDialogContent,{children:[d.jsxRuntimeExports.jsxs(T.AlertDialogHeader,{children:[d.jsxRuntimeExports.jsxs(T.AlertDialogTitle,{children:["Are you sure, you want to ",d.jsxRuntimeExports.jsx("span",{className:"text-red-500",children:"Sign Out"}),"?"]}),d.jsxRuntimeExports.jsx(T.AlertDialogDescription,{children:"Kindly ensure that all your data is saved before proceeding with the sign-out process to prevent any potential loss of unsaved information"})]}),d.jsxRuntimeExports.jsxs(T.AlertDialogFooter,{children:[d.jsxRuntimeExports.jsx(T.AlertDialogCancel,{disabled:t.isPending,children:"Cancel"}),d.jsxRuntimeExports.jsxs("button",{disabled:t.isPending,onClick:()=>t.mutate(),className:"rounded-md text-white w-28 text-center justify-center bg-red-600 hover:bg-red-700 flex items-center gap-x-2",children:[t.isPending&&d.jsxRuntimeExports.jsx(S2.Loader2,{className:"animate-spin w-5 h-5"}),"Sign Out"]})]})]})]})},H4=()=>d.jsxRuntimeExports.jsx(M4,{children:d.jsxRuntimeExports.jsx("button",{className:"border-gray-200 rounded-md p-2 mb-2 border",children:d.jsxRuntimeExports.jsx(S2.LogOutIcon,{className:"w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300"})})}),u4=N.lazy(()=>Promise.resolve().then(()=>require("./PagesPanel-lIC3kYmS.cjs"))),s4=N.lazy(()=>Promise.resolve().then(()=>require("./ProjectPanel-0Siyi5YS.cjs"))),p4=N.lazy(()=>Promise.resolve().then(()=>require("./CurrentPage-PjrVzHXR.cjs"))),V4=()=>d.jsxRuntimeExports.jsx("h2",{children:"Your Logo"}),f4=()=>{const{mutate:h}=a4();return T.useBuilderProp("editable",!0)?d.jsxRuntimeExports.jsx(T.Button,{onClick:h,className:"bg-blue-600 text-white",children:"Publish"}):null},m4=h=>{var f;const{data:t,isLoading:c}=b2(),{data:a,isLoading:l}=P2(),{data:i}=z0(),{mutate:r}=g0(),{mutate:z}=H0(),[s]=H1(),p=d4(),o=i4(),L=v4(),b=R(),H=N.useCallback(async m=>await p.mutateAsync(m),[p]),V=N.useCallback(async()=>await o.mutateAsync(),[o]),B=N.useCallback(async m=>await L.mutateAsync(m),[L]),g=async(m=20,y=0)=>{const F=`limit=${m}&offset=${y}`,I=await fetch(`${b}/assets?${F}`).then(w=>w.json());return I.result==="success"?I.data:[]},{logo:u=V4}=h;if(c||!t)return d.jsxRuntimeExports.jsx(O2,{});if(l||!a)return d.jsxRuntimeExports.jsx(O2,{});const G={...h,editable:i!=null&&i.lockedBy?i==null?void 0:i.lockedBy.self:!0,nonEditableComponent:e4,blocks:(i==null?void 0:i.blocks)||[],brandingOptions:t.brandingOptions,darkMode:h.darkMode||!1,dataProviders:(i==null?void 0:i.providers)||[],onSavePage:async({blocks:m,providers:y})=>(await z({blocks:m,providers:y,uuid:s}),!0),onSaveBrandingOptions:async m=>(await r({brandingOptions:m}),!0),topBarComponents:{left:[u],center:[p4],right:[f4]},sideBarComponents:{top:[{icon:r2.FileTextIcon,name:"pages",panel:u4},{icon:r2.GearIcon,name:"settings",panel:s4},...((f=h.sideBarComponents)==null?void 0:f.top)||[]],bottom:[H4]},uploadMediaCallback:H,fetchMediaCallback:g,getUILibraryBlocks:V,getExternalPredefinedBlock:B,getPages:()=>a};return d.jsxRuntimeExports.jsx(T.ChaiBuilderEditor,{...G})},x4=({logo:h})=>{const[t,c]=N.useState(!1),[a,l]=N.useState(""),[i,r]=N.useState(""),{mutate:z,isPending:s}=o4(),p=o=>{o.preventDefault(),z({email:a,password:i})};return d.jsxRuntimeExports.jsx("section",{className:"h-screen w-screen flex items-center justify-center bg-[radial-gradient(#AAA,transparent_0.5px)] duration-300 [background-size:6px_6px]",children:d.jsxRuntimeExports.jsx("div",{className:"overflow-hidden bg-white rounded-xl w-96 drop-shadow-2xl duration-300",children:d.jsxRuntimeExports.jsxs("div",{className:"p-12",children:[d.jsxRuntimeExports.jsxs("div",{className:"max-w-2xl mx-auto text-center",children:[d.jsxRuntimeExports.jsx(N.Suspense,{children:h?N.createElement(h):""}),d.jsxRuntimeExports.jsx("p",{className:"max-w-xl mx-auto text-base leading-relaxed text-gray-700 font-thin",children:"Enter your login credential to continue"})]}),d.jsxRuntimeExports.jsx("div",{className:"mt-8",children:d.jsxRuntimeExports.jsxs("form",{method:"POST",onSubmit:p,className:"space-y-5",children:[d.jsxRuntimeExports.jsx("div",{children:d.jsxRuntimeExports.jsxs("div",{className:"mt-2.5 relative text-gray-400 focus-within:text-gray-600",children:[d.jsxRuntimeExports.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:d.jsxRuntimeExports.jsx(u0,{})}),d.jsxRuntimeExports.jsx("input",{value:a,onChange:o=>l(o.target.value),type:"email",id:"email",placeholder:"Enter email",className:"block w-full py-4 px-10 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"})]})}),d.jsxRuntimeExports.jsx("div",{children:d.jsxRuntimeExports.jsxs("div",{className:"mt-2.5 relative text-gray-400 focus-within:text-gray-600",children:[d.jsxRuntimeExports.jsx("div",{className:"absolute inset-y-0 left-0 flex items-center pl-3 pointer-events-none",children:d.jsxRuntimeExports.jsx("svg",{className:"w-5 h-5",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:d.jsxRuntimeExports.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 11c0 3.517-1.009 6.799-2.753 9.571m-3.44-2.04l.054-.09A13.916 13.916 0 008 11a4 4 0 118 0c0 1.017-.07 2.019-.203 3m-2.118 6.844A21.88 21.88 0 0015.171 17m3.839 1.132c.645-2.266.99-4.659.99-7.132A8 8 0 008 4.07M3 15.364c.64-1.319 1-2.8 1-4.364 0-1.457.39-2.823 1.07-4"})})}),d.jsxRuntimeExports.jsx("input",{value:i,onChange:o=>r(o.target.value),type:t?"text":"password",id:"pwd",placeholder:"Enter password",className:"block w-full py-4 px-10 text-black placeholder-gray-500 transition-all duration-200 bg-white border border-gray-200 rounded-md focus:outline-none focus:border-blue-600 caret-blue-600"}),d.jsxRuntimeExports.jsx("button",{type:"button",className:"absolute inset-y-0 right-4 flex items-center pl-3 cursor-pointer",onClick:()=>c(!t),children:t?d.jsxRuntimeExports.jsx(r2.EyeClosedIcon,{}):d.jsxRuntimeExports.jsx(r2.EyeOpenIcon,{})})]})}),d.jsxRuntimeExports.jsx("div",{children:d.jsxRuntimeExports.jsx("button",{disabled:s||c1.size(a)<2||c1.size(i)<2,type:"submit",className:"inline-flex disabled:bg-gray-400 items-center justify-center w-full px-4 py-4 text-base font-semibold text-white transition-all duration-200 bg-blue-600 border border-transparent rounded-md focus:outline-none hover:bg-blue-700 focus:bg-blue-700",children:s?"Signing in...":"Login"})})]})}),d.jsxRuntimeExports.jsx("div",{className:"mt-4 flex items-center justify-end gap-x-2 text-sm",children:d.jsxRuntimeExports.jsx("a",{href:"https://apps.chaibuilder.com/settings",target:"_blank",className:"text-gray-500 hover:text-blue-400",children:"Forget your password?"})})]})})})},L4=h=>{const{data:t,isLoading:c}=z4(),a=W();return N.useEffect(()=>{a.setQueryData(["apiBaseUrl"],h.apiBaseUrl||"/api/chaibuilder")},[h.apiBaseUrl,a]),c?d.jsxRuntimeExports.jsx(O2,{}):t!=null&&t.valid?d.jsxRuntimeExports.jsx(m4,{...h}):d.jsxRuntimeExports.jsx(x4,{logo:h.logo})},w4=new P0,B4=h=>d.jsxRuntimeExports.jsxs(E0,{client:w4,children:[d.jsxRuntimeExports.jsx(h1.Toaster,{richColors:!0}),d.jsxRuntimeExports.jsx(L4,{...h})]});exports.ChaiBuilderStudio=B4;exports.useAddPage=c4;exports.useChangePage=M0;exports.useCurrentPage=H1;exports.useDeletePage=n4;exports.usePages=P2;exports.useProject=b2;exports.useQueryClient=W;exports.useUpdatePage=H0;exports.useUpdateProject=g0;
@@ -20,11 +20,11 @@ import * as b from "react";
20
20
  import H0, { lazy as A2, useCallback as g2, useState as o2, Suspense as u0, useEffect as s0 } from "react";
21
21
  import "./core.js";
22
22
  import { FileTextIcon as p0, GearIcon as V0, EyeClosedIcon as f0, EyeOpenIcon as m0 } from "@radix-ui/react-icons";
23
- import { u as L0, B as Y2, A as x0, a as w0, b as B0, c as C0, d as O0, e as A0, f as S0, g as y0, h as b0, C as P0 } from "./ChaiBuilderEditor-4xhn_QlL.js";
23
+ import { u as L0, B as Y2, A as x0, a as w0, b as B0, c as C0, d as O0, e as A0, f as S0, g as y0, h as b0, C as P0 } from "./ChaiBuilderEditor-tkzS851D.js";
24
24
  import { toast as a1, Toaster as F0 } from "sonner";
25
25
  import { useTranslation as k0 } from "react-i18next";
26
26
  import { sortBy as R0, filter as D0, has as T0, set as E0, capitalize as N0, get as b2, omit as I0, size as P2 } from "lodash-es";
27
- import { g as W0 } from "./html-to-json-ofq1N3tB.js";
27
+ import { g as W0 } from "./html-to-json-OnIZDDXw.js";
28
28
  import { Loader as U0, Loader2 as j0, LogOutIcon as Q0 } from "lucide-react";
29
29
  import { G as X2 } from "./index-VBXQixVm.js";
30
30
  var N1 = class {
@@ -2044,7 +2044,7 @@ const D4 = () => {
2044
2044
  ] })
2045
2045
  ] })
2046
2046
  ] });
2047
- }, W4 = () => /* @__PURE__ */ r.jsx(I4, { children: /* @__PURE__ */ r.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ r.jsx(Q0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), U4 = A2(() => import("./PagesPanel-aZBPSLS7.js")), j4 = A2(() => import("./ProjectPanel-bWZtA_mw.js")), Q4 = A2(() => import("./CurrentPage-KPr8MnO0.js")), K4 = () => /* @__PURE__ */ r.jsx("h2", { children: "Your Logo" }), G4 = () => {
2047
+ }, W4 = () => /* @__PURE__ */ r.jsx(I4, { children: /* @__PURE__ */ r.jsx("button", { className: "border-gray-200 rounded-md p-2 mb-2 border", children: /* @__PURE__ */ r.jsx(Q0, { className: "w-4 h-4 text-red-500 cursor-pointer hover:text-red-300 duration-300" }) }) }), U4 = A2(() => import("./PagesPanel-RYBf0Yct.js")), j4 = A2(() => import("./ProjectPanel-Zagx6l3Q.js")), Q4 = A2(() => import("./CurrentPage-IrFGAb7n.js")), K4 = () => /* @__PURE__ */ r.jsx("h2", { children: "Your Logo" }), G4 = () => {
2048
2048
  const { mutate: h } = y4();
2049
2049
  return b0("editable", !0) ? /* @__PURE__ */ r.jsx(Y2, { onClick: h, className: "bg-blue-600 text-white", children: "Publish" }) : null;
2050
2050
  }, q4 = (h) => {
package/dist/lib.cjs CHANGED
@@ -1,3 +1,3 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./utils-D_vtk3zK.cjs"),C=require("./Functions-N3yhPYKY.cjs"),P=require("./html-to-json-9uiQ2Dp2.cjs"),n=require("lodash-es"),u=require("./functions-EVUeSwX1.cjs"),L=require("@mhsdesign/jit-browser-tailwindcss"),F=require("./_commonjsHelpers-wDK0ZLPo.cjs"),U=require("@tailwindcss/forms"),M=require("@tailwindcss/typography"),H=require("@tailwindcss/aspect-ratio"),I=require("./MODIFIERS-mVmfEGgo.cjs"),R=require("tailwindcss-palette-generator");require("clsx");require("tailwind-merge");require("himalaya");const T={25:"1/4","33.33":"1/3",50:"1/2","66.67":"2/3",75:"3/4",20:"1/5",40:"2/5",60:"3/5",80:"4/5","16.67":"1/6","83.33":"5/6","8.33":"1/12","41.67":"5/12","58.33":"7/12","91.67":"11/12",100:"full"},B={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",10:"2.5",12:"3",14:"3.5",16:"4",20:"5",24:"6",28:"7",32:"8",36:"9",40:"10",44:"11",48:"12",56:"14",64:"16",80:"20",96:"24",112:"28",128:"32",144:"36",160:"40",176:"44",192:"48",208:"52",224:"56",240:"60",256:"64",288:"72",320:"80",384:"96"};const $=16,j=4;function W(e){return e.indexOf("rem")!==-1&&(e=`${parseFloat(e.replace("rem",""))*$}px`),e}const q=e=>{const a=e.match(/\[.*\]/);if(a===null)return e;const r=k.constructClassObject(e);if(r===null)return e;const{property:o}=r;let t=n.first(a).replace(/\]/i,"").replace(/\[/i,"");const s=e.replace(/\[.*\]/i,"");t=W(t);let i=e;switch(o){case"top":case"right":case"left":case"bottom":case"inset":case"insetX":case"insetY":case"gap":case"gapX":case"gapY":case"padding":case"paddingX":case"paddingY":case"paddingTop":case"paddingRight":case"paddingBottom":case"paddingLeft":case"margin":case"marginX":case"marginY":case"marginTop":case"marginRight":case"marginBottom":case"marginLeft":case"flexBasis":case"width":case"height":case"maxHeight":case"textIndent":case"spaceX":case"spaceY":if(t.indexOf("px")!==-1){const p=n.map(n.keys(B),l=>`${l}px`);if(n.includes(p,t)){const l=n.parseInt(t.replace("px",""),10);l===1?i=`${s}px`:i=s+l/j}}if(t.indexOf("%")!==-1){const p=n.map(n.keys(T),l=>`${l}%`);if(n.includes(p,t)){const l=parseFloat(t.replace("%",""));i=s+n.get(T,l)}}t.indexOf("vw")!==-1&&parseFloat(t.replace("vw",""))===100&&(i=`${s}screen`),t.indexOf("vh")!==-1&&parseFloat(t.replace("vh",""))===100&&(i=`${s}screen`);break;case"minWidth":t.indexOf("%")!==-1&&parseFloat(t.replace("%",""))===100&&(i=`${s}full`),t==="0px"&&(i="min-w-0");break;case"maxWidth":t==="0px"&&(i="max-w-0");const x={"320px":"xs","384px":"sm","448px":"md","512px":"lg","576px":"xl","672px":"2xl","768px":"3xl","896px":"4xl","1024px":"5xl","1152px":"6xl","1280px":"7xl","100%":"full","65ch":"prose","640px":"screen-sm","1536px":"screen-2xl"};n.includes(n.keys(x),t)&&(i=`max-w-${x[t]}`);break;case"minHeight":t.indexOf("%")!==-1&&parseFloat(t.replace("%",""))===100&&(i=`${s}full`),t==="0px"&&(i="min-h-0"),t==="100vh"&&(i="min-h-screen");break;case"fontSize":const d={"12px":"xs","14px":"sm","16px":"base","18px":"lg","20px":"xl","24px":"2xl","30px":"3xl","36px":"4xl","48px":"5xl","60px":"6xl","72px":"7xl","96px":"8xl","128px":"9xl"};n.includes(n.keys(d),t)&&(i=s+d[t]);break;case"lineHeight":const m={"12px":"3","16px":"4","20px":"5","24px":"6","28px":"7","32px":"8","36px":"9","40px":"10",1:"none","1.25":"tight","1.375":"snug","1.5":"normal","1.625":"relaxed",2:"loose"};n.includes(n.keys(m),t)&&(i=s+m[t]);break;case"zIndex":i=["0","10","20","30","40","50"].indexOf(t)!==-1?`${s}${t}`:e;break;case"opacity":const f=["0","5","10","20","25","30","40","50","60","70","75","80","90","95","100"],g=parseFloat(t)*100;n.includes(f,g.toString())&&(i=`opacity-${g}`);break;default:break}return i};var S={},D={};(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"cloneDeep",{enumerable:!0,get:function(){return a}});function a(r){return Array.isArray(r)?r.map(o=>a(o)):typeof r=="object"&&r!==null?Object.fromEntries(Object.entries(r).map(([o,t])=>[o,a(t)])):r}})(D);var V={content:[],presets:[],darkMode:"media",theme:{accentColor:({theme:e})=>({...e("colors"),auto:"auto"}),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9"},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>e("brightness"),backdropContrast:({theme:e})=>e("contrast"),backdropGrayscale:({theme:e})=>e("grayscale"),backdropHueRotate:({theme:e})=>e("hueRotate"),backdropInvert:({theme:e})=>e("invert"),backdropOpacity:({theme:e})=>e("opacity"),backdropSaturate:({theme:e})=>e("saturate"),backdropSepia:({theme:e})=>e("sepia"),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({...e("colors"),DEFAULT:e("colors.gray.200","currentColor")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>({...e("spacing")}),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px"},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2"},caretColor:({theme:e})=>e("colors"),colors:({colors:e})=>({inherit:e.inherit,current:e.current,transparent:e.transparent,black:e.black,white:e.white,slate:e.slate,gray:e.gray,zinc:e.zinc,neutral:e.neutral,stone:e.stone,red:e.red,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,green:e.green,emerald:e.emerald,teal:e.teal,cyan:e.cyan,sky:e.sky,blue:e.blue,indigo:e.indigo,violet:e.violet,purple:e.purple,fuchsia:e.fuchsia,pink:e.pink,rose:e.rose}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2"},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>e("borderWidth"),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>({none:"none",...e("colors")}),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%"}),flexGrow:{0:"0",DEFAULT:"1"},flexShrink:{0:"0",DEFAULT:"1"},fontFamily:{sans:["ui-sans-serif","system-ui","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial",'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%"},grayscale:{0:"0",DEFAULT:"100%"},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7"},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7"},gridTemplateColumns:{none:"none",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},gridTemplateRows:{none:"none",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))"},height:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},inset:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),invert:{0:"0",DEFAULT:"100%"},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6"},maxHeight:({theme:e})=>({...e("spacing"),none:"none",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"}),maxWidth:({theme:e,breakpoints:a})=>({none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...a(e("screens"))}),minHeight:{0:"0px",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",20:"0.2",25:"0.25",30:"0.3",40:"0.4",50:"0.5",60:"0.6",70:"0.7",75:"0.75",80:"0.8",90:"0.9",95:"0.95",100:"1"},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:e("colors.blue.500","#3b82f6"),...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2"},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"},screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},scrollMargin:({theme:e})=>({...e("spacing")}),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg"},space:({theme:e})=>({...e("spacing")}),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2"},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},textIndent:({theme:e})=>({...e("spacing")}),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),width:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50"}},plugins:[]};(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});const a=D,r=o(V);function o(s){return s&&s.__esModule?s:{default:s}}const t=(0,a.cloneDeep)(r.default.theme)})(S);let b=S;var X=(b.__esModule?b:{default:b}).default;const _=F.getDefaultExportFromCjs(X);var E={},O={};(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});function a(o,t){return{handler:o,config:t}}a.withOptions=function(o,t=()=>({})){const s=function(i){return{__options:i,handler:o(i),config:t(i)}};return s.__isOptionsFunction=!0,s.__pluginFunction=o,s.__configFunction=t,s};const r=a})(O);(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const a=r(O);function r(t){return t&&t.__esModule?t:{default:t}}const o=a.default})(E);let h=E;var Y=(h.__esModule?h:{default:h}).default;const G=F.getDefaultExportFromCjs(Y);async function z(e,a,r=[],o="",t=!1){const s=n.get(e,"primaryColor","#000"),i=n.get(e,"secondaryColor","#ccc"),x=n.get(e,"headingFont","Inter"),d=n.get(e,"bodyFont","Inter"),m=n.get(e,"roundedCorners","0"),w=n.get(e,"bodyBgLightColor","#fff"),f=n.get(e,"bodyBgDarkColor","#000"),g=n.get(e,"bodyTextDarkColor","#FFF"),p=n.get(e,"bodyTextLightColor","#000"),l={"bg-light":w,"bg-dark":f,"text-dark":g,"text-light":p},v=R([{color:s,name:"primary"},{color:i,name:"secondary"}]);return await L.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:r,theme:{container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},fontFamily:{heading:[x,..._.fontFamily.sans],body:[d,..._.fontFamily.sans]},extend:{borderRadius:{DEFAULT:`${m||"0px"}px`},colors:{...l,...v}}},plugins:[U,M,H,G(function({addBase:A,theme:c}){A({"h1,h2,h3,h4,h5,h6":{fontFamily:c("fontFamily.heading")},body:{fontFamily:c("fontFamily.body"),color:c("colors.text-light"),backgroundColor:c("colors.bg-light")},".dark body":{color:c("colors.text-dark"),backgroundColor:c("colors.bg-dark")}})})],corePlugins:{preflight:t},...o?{prefix:`${o}`}:{}}}).generateStylesFromContent(` ${t?"@tailwind base;":""}
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("./utils-D_vtk3zK.cjs"),C=require("./Functions-N3yhPYKY.cjs"),P=require("./html-to-json-rauxDBi6.cjs"),n=require("lodash-es"),u=require("./functions-EVUeSwX1.cjs"),L=require("@mhsdesign/jit-browser-tailwindcss"),F=require("./_commonjsHelpers-wDK0ZLPo.cjs"),U=require("@tailwindcss/forms"),M=require("@tailwindcss/typography"),H=require("@tailwindcss/aspect-ratio"),I=require("./MODIFIERS-mVmfEGgo.cjs"),R=require("tailwindcss-palette-generator");require("clsx");require("tailwind-merge");require("himalaya");const T={25:"1/4","33.33":"1/3",50:"1/2","66.67":"2/3",75:"3/4",20:"1/5",40:"2/5",60:"3/5",80:"4/5","16.67":"1/6","83.33":"5/6","8.33":"1/12","41.67":"5/12","58.33":"7/12","91.67":"11/12",100:"full"},B={0:"0",1:"px",2:"0.5",4:"1",6:"1.5",8:"2",10:"2.5",12:"3",14:"3.5",16:"4",20:"5",24:"6",28:"7",32:"8",36:"9",40:"10",44:"11",48:"12",56:"14",64:"16",80:"20",96:"24",112:"28",128:"32",144:"36",160:"40",176:"44",192:"48",208:"52",224:"56",240:"60",256:"64",288:"72",320:"80",384:"96"};const $=16,j=4;function W(e){return e.indexOf("rem")!==-1&&(e=`${parseFloat(e.replace("rem",""))*$}px`),e}const q=e=>{const a=e.match(/\[.*\]/);if(a===null)return e;const r=k.constructClassObject(e);if(r===null)return e;const{property:o}=r;let t=n.first(a).replace(/\]/i,"").replace(/\[/i,"");const s=e.replace(/\[.*\]/i,"");t=W(t);let i=e;switch(o){case"top":case"right":case"left":case"bottom":case"inset":case"insetX":case"insetY":case"gap":case"gapX":case"gapY":case"padding":case"paddingX":case"paddingY":case"paddingTop":case"paddingRight":case"paddingBottom":case"paddingLeft":case"margin":case"marginX":case"marginY":case"marginTop":case"marginRight":case"marginBottom":case"marginLeft":case"flexBasis":case"width":case"height":case"maxHeight":case"textIndent":case"spaceX":case"spaceY":if(t.indexOf("px")!==-1){const p=n.map(n.keys(B),l=>`${l}px`);if(n.includes(p,t)){const l=n.parseInt(t.replace("px",""),10);l===1?i=`${s}px`:i=s+l/j}}if(t.indexOf("%")!==-1){const p=n.map(n.keys(T),l=>`${l}%`);if(n.includes(p,t)){const l=parseFloat(t.replace("%",""));i=s+n.get(T,l)}}t.indexOf("vw")!==-1&&parseFloat(t.replace("vw",""))===100&&(i=`${s}screen`),t.indexOf("vh")!==-1&&parseFloat(t.replace("vh",""))===100&&(i=`${s}screen`);break;case"minWidth":t.indexOf("%")!==-1&&parseFloat(t.replace("%",""))===100&&(i=`${s}full`),t==="0px"&&(i="min-w-0");break;case"maxWidth":t==="0px"&&(i="max-w-0");const x={"320px":"xs","384px":"sm","448px":"md","512px":"lg","576px":"xl","672px":"2xl","768px":"3xl","896px":"4xl","1024px":"5xl","1152px":"6xl","1280px":"7xl","100%":"full","65ch":"prose","640px":"screen-sm","1536px":"screen-2xl"};n.includes(n.keys(x),t)&&(i=`max-w-${x[t]}`);break;case"minHeight":t.indexOf("%")!==-1&&parseFloat(t.replace("%",""))===100&&(i=`${s}full`),t==="0px"&&(i="min-h-0"),t==="100vh"&&(i="min-h-screen");break;case"fontSize":const d={"12px":"xs","14px":"sm","16px":"base","18px":"lg","20px":"xl","24px":"2xl","30px":"3xl","36px":"4xl","48px":"5xl","60px":"6xl","72px":"7xl","96px":"8xl","128px":"9xl"};n.includes(n.keys(d),t)&&(i=s+d[t]);break;case"lineHeight":const m={"12px":"3","16px":"4","20px":"5","24px":"6","28px":"7","32px":"8","36px":"9","40px":"10",1:"none","1.25":"tight","1.375":"snug","1.5":"normal","1.625":"relaxed",2:"loose"};n.includes(n.keys(m),t)&&(i=s+m[t]);break;case"zIndex":i=["0","10","20","30","40","50"].indexOf(t)!==-1?`${s}${t}`:e;break;case"opacity":const f=["0","5","10","20","25","30","40","50","60","70","75","80","90","95","100"],g=parseFloat(t)*100;n.includes(f,g.toString())&&(i=`opacity-${g}`);break;default:break}return i};var S={},D={};(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"cloneDeep",{enumerable:!0,get:function(){return a}});function a(r){return Array.isArray(r)?r.map(o=>a(o)):typeof r=="object"&&r!==null?Object.fromEntries(Object.entries(r).map(([o,t])=>[o,a(t)])):r}})(D);var V={content:[],presets:[],darkMode:"media",theme:{accentColor:({theme:e})=>({...e("colors"),auto:"auto"}),animation:{none:"none",spin:"spin 1s linear infinite",ping:"ping 1s cubic-bezier(0, 0, 0.2, 1) infinite",pulse:"pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite",bounce:"bounce 1s infinite"},aria:{busy:'busy="true"',checked:'checked="true"',disabled:'disabled="true"',expanded:'expanded="true"',hidden:'hidden="true"',pressed:'pressed="true"',readonly:'readonly="true"',required:'required="true"',selected:'selected="true"'},aspectRatio:{auto:"auto",square:"1 / 1",video:"16 / 9"},backdropBlur:({theme:e})=>e("blur"),backdropBrightness:({theme:e})=>e("brightness"),backdropContrast:({theme:e})=>e("contrast"),backdropGrayscale:({theme:e})=>e("grayscale"),backdropHueRotate:({theme:e})=>e("hueRotate"),backdropInvert:({theme:e})=>e("invert"),backdropOpacity:({theme:e})=>e("opacity"),backdropSaturate:({theme:e})=>e("saturate"),backdropSepia:({theme:e})=>e("sepia"),backgroundColor:({theme:e})=>e("colors"),backgroundImage:{none:"none","gradient-to-t":"linear-gradient(to top, var(--tw-gradient-stops))","gradient-to-tr":"linear-gradient(to top right, var(--tw-gradient-stops))","gradient-to-r":"linear-gradient(to right, var(--tw-gradient-stops))","gradient-to-br":"linear-gradient(to bottom right, var(--tw-gradient-stops))","gradient-to-b":"linear-gradient(to bottom, var(--tw-gradient-stops))","gradient-to-bl":"linear-gradient(to bottom left, var(--tw-gradient-stops))","gradient-to-l":"linear-gradient(to left, var(--tw-gradient-stops))","gradient-to-tl":"linear-gradient(to top left, var(--tw-gradient-stops))"},backgroundOpacity:({theme:e})=>e("opacity"),backgroundPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},backgroundSize:{auto:"auto",cover:"cover",contain:"contain"},blur:{0:"0",none:"0",sm:"4px",DEFAULT:"8px",md:"12px",lg:"16px",xl:"24px","2xl":"40px","3xl":"64px"},borderColor:({theme:e})=>({...e("colors"),DEFAULT:e("colors.gray.200","currentColor")}),borderOpacity:({theme:e})=>e("opacity"),borderRadius:{none:"0px",sm:"0.125rem",DEFAULT:"0.25rem",md:"0.375rem",lg:"0.5rem",xl:"0.75rem","2xl":"1rem","3xl":"1.5rem",full:"9999px"},borderSpacing:({theme:e})=>({...e("spacing")}),borderWidth:{DEFAULT:"1px",0:"0px",2:"2px",4:"4px",8:"8px"},boxShadow:{sm:"0 1px 2px 0 rgb(0 0 0 / 0.05)",DEFAULT:"0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1)",md:"0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)",lg:"0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1)",xl:"0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1)","2xl":"0 25px 50px -12px rgb(0 0 0 / 0.25)",inner:"inset 0 2px 4px 0 rgb(0 0 0 / 0.05)",none:"none"},boxShadowColor:({theme:e})=>e("colors"),brightness:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5",200:"2"},caretColor:({theme:e})=>e("colors"),colors:({colors:e})=>({inherit:e.inherit,current:e.current,transparent:e.transparent,black:e.black,white:e.white,slate:e.slate,gray:e.gray,zinc:e.zinc,neutral:e.neutral,stone:e.stone,red:e.red,orange:e.orange,amber:e.amber,yellow:e.yellow,lime:e.lime,green:e.green,emerald:e.emerald,teal:e.teal,cyan:e.cyan,sky:e.sky,blue:e.blue,indigo:e.indigo,violet:e.violet,purple:e.purple,fuchsia:e.fuchsia,pink:e.pink,rose:e.rose}),columns:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12","3xs":"16rem","2xs":"18rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem"},container:{},content:{none:"none"},contrast:{0:"0",50:".5",75:".75",100:"1",125:"1.25",150:"1.5",200:"2"},cursor:{auto:"auto",default:"default",pointer:"pointer",wait:"wait",text:"text",move:"move",help:"help","not-allowed":"not-allowed",none:"none","context-menu":"context-menu",progress:"progress",cell:"cell",crosshair:"crosshair","vertical-text":"vertical-text",alias:"alias",copy:"copy","no-drop":"no-drop",grab:"grab",grabbing:"grabbing","all-scroll":"all-scroll","col-resize":"col-resize","row-resize":"row-resize","n-resize":"n-resize","e-resize":"e-resize","s-resize":"s-resize","w-resize":"w-resize","ne-resize":"ne-resize","nw-resize":"nw-resize","se-resize":"se-resize","sw-resize":"sw-resize","ew-resize":"ew-resize","ns-resize":"ns-resize","nesw-resize":"nesw-resize","nwse-resize":"nwse-resize","zoom-in":"zoom-in","zoom-out":"zoom-out"},divideColor:({theme:e})=>e("borderColor"),divideOpacity:({theme:e})=>e("borderOpacity"),divideWidth:({theme:e})=>e("borderWidth"),dropShadow:{sm:"0 1px 1px rgb(0 0 0 / 0.05)",DEFAULT:["0 1px 2px rgb(0 0 0 / 0.1)","0 1px 1px rgb(0 0 0 / 0.06)"],md:["0 4px 3px rgb(0 0 0 / 0.07)","0 2px 2px rgb(0 0 0 / 0.06)"],lg:["0 10px 8px rgb(0 0 0 / 0.04)","0 4px 3px rgb(0 0 0 / 0.1)"],xl:["0 20px 13px rgb(0 0 0 / 0.03)","0 8px 5px rgb(0 0 0 / 0.08)"],"2xl":"0 25px 25px rgb(0 0 0 / 0.15)",none:"0 0 #0000"},fill:({theme:e})=>({none:"none",...e("colors")}),flex:{1:"1 1 0%",auto:"1 1 auto",initial:"0 1 auto",none:"none"},flexBasis:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%"}),flexGrow:{0:"0",DEFAULT:"1"},flexShrink:{0:"0",DEFAULT:"1"},fontFamily:{sans:["ui-sans-serif","system-ui","-apple-system","BlinkMacSystemFont",'"Segoe UI"',"Roboto",'"Helvetica Neue"',"Arial",'"Noto Sans"',"sans-serif",'"Apple Color Emoji"','"Segoe UI Emoji"','"Segoe UI Symbol"','"Noto Color Emoji"'],serif:["ui-serif","Georgia","Cambria",'"Times New Roman"',"Times","serif"],mono:["ui-monospace","SFMono-Regular","Menlo","Monaco","Consolas",'"Liberation Mono"','"Courier New"',"monospace"]},fontSize:{xs:["0.75rem",{lineHeight:"1rem"}],sm:["0.875rem",{lineHeight:"1.25rem"}],base:["1rem",{lineHeight:"1.5rem"}],lg:["1.125rem",{lineHeight:"1.75rem"}],xl:["1.25rem",{lineHeight:"1.75rem"}],"2xl":["1.5rem",{lineHeight:"2rem"}],"3xl":["1.875rem",{lineHeight:"2.25rem"}],"4xl":["2.25rem",{lineHeight:"2.5rem"}],"5xl":["3rem",{lineHeight:"1"}],"6xl":["3.75rem",{lineHeight:"1"}],"7xl":["4.5rem",{lineHeight:"1"}],"8xl":["6rem",{lineHeight:"1"}],"9xl":["8rem",{lineHeight:"1"}]},fontWeight:{thin:"100",extralight:"200",light:"300",normal:"400",medium:"500",semibold:"600",bold:"700",extrabold:"800",black:"900"},gap:({theme:e})=>e("spacing"),gradientColorStops:({theme:e})=>e("colors"),gradientColorStopPositions:{"0%":"0%","5%":"5%","10%":"10%","15%":"15%","20%":"20%","25%":"25%","30%":"30%","35%":"35%","40%":"40%","45%":"45%","50%":"50%","55%":"55%","60%":"60%","65%":"65%","70%":"70%","75%":"75%","80%":"80%","85%":"85%","90%":"90%","95%":"95%","100%":"100%"},grayscale:{0:"0",DEFAULT:"100%"},gridAutoColumns:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridAutoRows:{auto:"auto",min:"min-content",max:"max-content",fr:"minmax(0, 1fr)"},gridColumn:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-7":"span 7 / span 7","span-8":"span 8 / span 8","span-9":"span 9 / span 9","span-10":"span 10 / span 10","span-11":"span 11 / span 11","span-12":"span 12 / span 12","span-full":"1 / -1"},gridColumnEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridColumnStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12",13:"13"},gridRow:{auto:"auto","span-1":"span 1 / span 1","span-2":"span 2 / span 2","span-3":"span 3 / span 3","span-4":"span 4 / span 4","span-5":"span 5 / span 5","span-6":"span 6 / span 6","span-full":"1 / -1"},gridRowEnd:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7"},gridRowStart:{auto:"auto",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7"},gridTemplateColumns:{none:"none",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))",7:"repeat(7, minmax(0, 1fr))",8:"repeat(8, minmax(0, 1fr))",9:"repeat(9, minmax(0, 1fr))",10:"repeat(10, minmax(0, 1fr))",11:"repeat(11, minmax(0, 1fr))",12:"repeat(12, minmax(0, 1fr))"},gridTemplateRows:{none:"none",1:"repeat(1, minmax(0, 1fr))",2:"repeat(2, minmax(0, 1fr))",3:"repeat(3, minmax(0, 1fr))",4:"repeat(4, minmax(0, 1fr))",5:"repeat(5, minmax(0, 1fr))",6:"repeat(6, minmax(0, 1fr))"},height:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"}),hueRotate:{0:"0deg",15:"15deg",30:"30deg",60:"60deg",90:"90deg",180:"180deg"},inset:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),invert:{0:"0",DEFAULT:"100%"},keyframes:{spin:{to:{transform:"rotate(360deg)"}},ping:{"75%, 100%":{transform:"scale(2)",opacity:"0"}},pulse:{"50%":{opacity:".5"}},bounce:{"0%, 100%":{transform:"translateY(-25%)",animationTimingFunction:"cubic-bezier(0.8,0,1,1)"},"50%":{transform:"none",animationTimingFunction:"cubic-bezier(0,0,0.2,1)"}}},letterSpacing:{tighter:"-0.05em",tight:"-0.025em",normal:"0em",wide:"0.025em",wider:"0.05em",widest:"0.1em"},lineHeight:{none:"1",tight:"1.25",snug:"1.375",normal:"1.5",relaxed:"1.625",loose:"2",3:".75rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem"},listStyleType:{none:"none",disc:"disc",decimal:"decimal"},listStyleImage:{none:"none"},margin:({theme:e})=>({auto:"auto",...e("spacing")}),lineClamp:{1:"1",2:"2",3:"3",4:"4",5:"5",6:"6"},maxHeight:({theme:e})=>({...e("spacing"),none:"none",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"}),maxWidth:({theme:e,breakpoints:a})=>({none:"none",0:"0rem",xs:"20rem",sm:"24rem",md:"28rem",lg:"32rem",xl:"36rem","2xl":"42rem","3xl":"48rem","4xl":"56rem","5xl":"64rem","6xl":"72rem","7xl":"80rem",full:"100%",min:"min-content",max:"max-content",fit:"fit-content",prose:"65ch",...a(e("screens"))}),minHeight:{0:"0px",full:"100%",screen:"100vh",min:"min-content",max:"max-content",fit:"fit-content"},minWidth:{0:"0px",full:"100%",min:"min-content",max:"max-content",fit:"fit-content"},objectPosition:{bottom:"bottom",center:"center",left:"left","left-bottom":"left bottom","left-top":"left top",right:"right","right-bottom":"right bottom","right-top":"right top",top:"top"},opacity:{0:"0",5:"0.05",10:"0.1",20:"0.2",25:"0.25",30:"0.3",40:"0.4",50:"0.5",60:"0.6",70:"0.7",75:"0.75",80:"0.8",90:"0.9",95:"0.95",100:"1"},order:{first:"-9999",last:"9999",none:"0",1:"1",2:"2",3:"3",4:"4",5:"5",6:"6",7:"7",8:"8",9:"9",10:"10",11:"11",12:"12"},outlineColor:({theme:e})=>e("colors"),outlineOffset:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},outlineWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},padding:({theme:e})=>e("spacing"),placeholderColor:({theme:e})=>e("colors"),placeholderOpacity:({theme:e})=>e("opacity"),ringColor:({theme:e})=>({DEFAULT:e("colors.blue.500","#3b82f6"),...e("colors")}),ringOffsetColor:({theme:e})=>e("colors"),ringOffsetWidth:{0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},ringOpacity:({theme:e})=>({DEFAULT:"0.5",...e("opacity")}),ringWidth:{DEFAULT:"3px",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},rotate:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg",45:"45deg",90:"90deg",180:"180deg"},saturate:{0:"0",50:".5",100:"1",150:"1.5",200:"2"},scale:{0:"0",50:".5",75:".75",90:".9",95:".95",100:"1",105:"1.05",110:"1.1",125:"1.25",150:"1.5"},screens:{sm:"640px",md:"768px",lg:"1024px",xl:"1280px","2xl":"1536px"},scrollMargin:({theme:e})=>({...e("spacing")}),scrollPadding:({theme:e})=>e("spacing"),sepia:{0:"0",DEFAULT:"100%"},skew:{0:"0deg",1:"1deg",2:"2deg",3:"3deg",6:"6deg",12:"12deg"},space:({theme:e})=>({...e("spacing")}),spacing:{px:"1px",0:"0px",.5:"0.125rem",1:"0.25rem",1.5:"0.375rem",2:"0.5rem",2.5:"0.625rem",3:"0.75rem",3.5:"0.875rem",4:"1rem",5:"1.25rem",6:"1.5rem",7:"1.75rem",8:"2rem",9:"2.25rem",10:"2.5rem",11:"2.75rem",12:"3rem",14:"3.5rem",16:"4rem",20:"5rem",24:"6rem",28:"7rem",32:"8rem",36:"9rem",40:"10rem",44:"11rem",48:"12rem",52:"13rem",56:"14rem",60:"15rem",64:"16rem",72:"18rem",80:"20rem",96:"24rem"},stroke:({theme:e})=>({none:"none",...e("colors")}),strokeWidth:{0:"0",1:"1",2:"2"},supports:{},data:{},textColor:({theme:e})=>e("colors"),textDecorationColor:({theme:e})=>e("colors"),textDecorationThickness:{auto:"auto","from-font":"from-font",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},textIndent:({theme:e})=>({...e("spacing")}),textOpacity:({theme:e})=>e("opacity"),textUnderlineOffset:{auto:"auto",0:"0px",1:"1px",2:"2px",4:"4px",8:"8px"},transformOrigin:{center:"center",top:"top","top-right":"top right",right:"right","bottom-right":"bottom right",bottom:"bottom","bottom-left":"bottom left",left:"left","top-left":"top left"},transitionDelay:{0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionDuration:{DEFAULT:"150ms",0:"0s",75:"75ms",100:"100ms",150:"150ms",200:"200ms",300:"300ms",500:"500ms",700:"700ms",1e3:"1000ms"},transitionProperty:{none:"none",all:"all",DEFAULT:"color, background-color, border-color, text-decoration-color, fill, stroke, opacity, box-shadow, transform, filter, backdrop-filter",colors:"color, background-color, border-color, text-decoration-color, fill, stroke",opacity:"opacity",shadow:"box-shadow",transform:"transform"},transitionTimingFunction:{DEFAULT:"cubic-bezier(0.4, 0, 0.2, 1)",linear:"linear",in:"cubic-bezier(0.4, 0, 1, 1)",out:"cubic-bezier(0, 0, 0.2, 1)","in-out":"cubic-bezier(0.4, 0, 0.2, 1)"},translate:({theme:e})=>({...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%",full:"100%"}),width:({theme:e})=>({auto:"auto",...e("spacing"),"1/2":"50%","1/3":"33.333333%","2/3":"66.666667%","1/4":"25%","2/4":"50%","3/4":"75%","1/5":"20%","2/5":"40%","3/5":"60%","4/5":"80%","1/6":"16.666667%","2/6":"33.333333%","3/6":"50%","4/6":"66.666667%","5/6":"83.333333%","1/12":"8.333333%","2/12":"16.666667%","3/12":"25%","4/12":"33.333333%","5/12":"41.666667%","6/12":"50%","7/12":"58.333333%","8/12":"66.666667%","9/12":"75%","10/12":"83.333333%","11/12":"91.666667%",full:"100%",screen:"100vw",min:"min-content",max:"max-content",fit:"fit-content"}),willChange:{auto:"auto",scroll:"scroll-position",contents:"contents",transform:"transform"},zIndex:{auto:"auto",0:"0",10:"10",20:"20",30:"30",40:"40",50:"50"}},plugins:[]};(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return t}});const a=D,r=o(V);function o(s){return s&&s.__esModule?s:{default:s}}const t=(0,a.cloneDeep)(r.default.theme)})(S);let b=S;var X=(b.__esModule?b:{default:b}).default;const _=F.getDefaultExportFromCjs(X);var E={},O={};(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return r}});function a(o,t){return{handler:o,config:t}}a.withOptions=function(o,t=()=>({})){const s=function(i){return{__options:i,handler:o(i),config:t(i)}};return s.__isOptionsFunction=!0,s.__pluginFunction=o,s.__configFunction=t,s};const r=a})(O);(function(e){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),Object.defineProperty(e,"default",{enumerable:!0,get:function(){return o}});const a=r(O);function r(t){return t&&t.__esModule?t:{default:t}}const o=a.default})(E);let h=E;var Y=(h.__esModule?h:{default:h}).default;const G=F.getDefaultExportFromCjs(Y);async function z(e,a,r=[],o="",t=!1){const s=n.get(e,"primaryColor","#000"),i=n.get(e,"secondaryColor","#ccc"),x=n.get(e,"headingFont","Inter"),d=n.get(e,"bodyFont","Inter"),m=n.get(e,"roundedCorners","0"),w=n.get(e,"bodyBgLightColor","#fff"),f=n.get(e,"bodyBgDarkColor","#000"),g=n.get(e,"bodyTextDarkColor","#FFF"),p=n.get(e,"bodyTextLightColor","#000"),l={"bg-light":w,"bg-dark":f,"text-dark":g,"text-light":p},v=R([{color:s,name:"primary"},{color:i,name:"secondary"}]);return await L.createTailwindcss({tailwindConfig:{darkMode:"class",safelist:r,theme:{container:{center:!0,padding:"1rem",screens:{"2xl":"1400px"}},fontFamily:{heading:[x,..._.fontFamily.sans],body:[d,..._.fontFamily.sans]},extend:{borderRadius:{DEFAULT:`${m||"0px"}px`},colors:{...l,...v}}},plugins:[U,M,H,G(function({addBase:A,theme:c}){A({"h1,h2,h3,h4,h5,h6":{fontFamily:c("fontFamily.heading")},body:{fontFamily:c("fontFamily.body"),color:c("colors.text-light"),backgroundColor:c("colors.bg-light")},".dark body":{color:c("colors.text-dark"),backgroundColor:c("colors.bg-dark")}})})],corePlugins:{preflight:t},...o?{prefix:`${o}`}:{}}}).generateStylesFromContent(` ${t?"@tailwind base;":""}
2
2
  @tailwind components;
3
3
  @tailwind utilities;`,a)}const K=(e,a)=>e.map(r=>{const o={};return Object.keys(r).forEach(t=>{n.startsWith(r[t],I.STYLES_KEY)&&(o[t]=u.addPrefixToClasses(r[t],a))}),o}),y=(e,a,r="",o=!1)=>z(a,[n.replace(JSON.stringify(K(e,r)),/#styles:/g,"")],[],r,o),N=async(e,a="",r=!1)=>{const o=e.page.blocks;return await y(o,e.project.brandingOptions,a,r)},J=async(e,a,r="",o=!0)=>await y(e,a,r,o);exports.cn=k.cn;exports.generateUUID=C.generateUUID;exports.getBreakpointValue=C.getBreakpointValue;exports.getBlocksFromHTML=P.getBlocksFromHTML;exports.addPrefixToClasses=u.addPrefixToClasses;exports.convertToBlocks=u.convertToBlocks;exports.getBrandingClasses=u.getBrandingClasses;exports.convertArbitraryToTailwindClass=q;exports.getBlocksTailwindCSS=y;exports.getStylesForBlocks=J;exports.getStylesForPageData=N;exports.getTailwindCSS=z;
package/dist/lib.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { c as A } from "./utils-VpVqnC9m.js";
2
2
  import { a as ye } from "./utils-VpVqnC9m.js";
3
3
  import { g as _e, a as Te } from "./Functions-7jnEwJyw.js";
4
- import { g as Ce } from "./html-to-json-ofq1N3tB.js";
4
+ import { g as Ce } from "./html-to-json-OnIZDDXw.js";
5
5
  import { first as L, includes as m, keys as d, map as _, parseInt as P, get as l, startsWith as U, replace as R } from "lodash-es";
6
6
  import { a as H } from "./functions--tdNWQDW.js";
7
7
  import { c as ze, g as Oe } from "./functions--tdNWQDW.js";
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./ChaiBuilderEditor-Rqlg194T.cjs"),x=require("./index-swYRuZtl.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./MODIFIERS-mVmfEGgo.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("tree-model");require("./utils-D_vtk3zK.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lucide-react");require("./index--mLLy7QQ.cjs");require("./core.cjs");require("sonner");require("./html-to-json-9uiQ2Dp2.cjs");require("himalaya");const m=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-bv-XFGOD.cjs"))),j=({pageData:s})=>{const[r,i]=u.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:t=>{i(r==="PENDING"?"ALERT":t?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:t=>{t.stopPropagation(),i("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:r==="OPEN"||r==="ALERT"||r==="PENDING"?e.jsxRuntimeExports.jsx(n.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(n.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(m,{pageData:s,open:r,setOpen:i})})})]})},p=s=>{const[r]=x.useCurrentPage(),{data:i}=x.useProject(),t=x.useChangePage(),l=(i==null?void 0:i.homepage)===s.uuid,a=r===s.uuid,c=()=>t(s);return i?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a?"bg-blue-200 ":""}`,onClick:c,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex text-sm items-center gap-x-1.5",children:[l?e.jsxRuntimeExports.jsx(n.HomeIcon,{}):e.jsxRuntimeExports.jsx(n.FileTextIcon,{})," ",s.name]}),e.jsxRuntimeExports.jsx(j,{pageData:s})]}):null},q=({pages:s,isLoading:r})=>r?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):s.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:u.Children.toArray(s.map(i=>e.jsxRuntimeExports.jsx(p,{...i})))});exports.default=q;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./jsx-runtime-Z_BpKhVy.cjs"),u=require("react"),n=require("@radix-ui/react-icons"),o=require("./ChaiBuilderEditor-aY8flOgX.cjs"),x=require("./index-bt7EhwLh.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./MODIFIERS-mVmfEGgo.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("tree-model");require("./utils-D_vtk3zK.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lucide-react");require("./index--mLLy7QQ.cjs");require("./core.cjs");require("sonner");require("./html-to-json-rauxDBi6.cjs");require("himalaya");const m=u.lazy(()=>Promise.resolve().then(()=>require("./single-page-detail-0Z_hvd_j.cjs"))),j=({pageData:s})=>{const[r,i]=u.useState("CLOSE");return e.jsxRuntimeExports.jsxs(o.Popover,{open:r==="OPEN"||r==="ALERT"||r==="PENDING",onOpenChange:t=>{i(r==="PENDING"?"ALERT":t?"OPEN":"CLOSE")},children:[e.jsxRuntimeExports.jsx(o.PopoverTrigger,{asChild:!0,onClick:t=>{t.stopPropagation(),i("OPEN")},children:e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-between",children:r==="OPEN"||r==="ALERT"||r==="PENDING"?e.jsxRuntimeExports.jsx(n.ChevronRightIcon,{}):e.jsxRuntimeExports.jsx("div",{className:"hidden hover:text-blue-600 group-hover:flex",children:e.jsxRuntimeExports.jsx(n.GearIcon,{})})})}),e.jsxRuntimeExports.jsx(o.PopoverContent,{side:"right",align:"start",alignOffset:-35,className:"h-screen w-96",children:e.jsxRuntimeExports.jsx(u.Suspense,{fallback:e.jsxRuntimeExports.jsxs("div",{className:"flex w-full animate-pulse flex-col gap-y-3",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-6 w-1/2"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-300 h-20 w-full"})]}),children:e.jsxRuntimeExports.jsx(m,{pageData:s,open:r,setOpen:i})})})]})},p=s=>{const[r]=x.useCurrentPage(),{data:i}=x.useProject(),t=x.useChangePage(),l=(i==null?void 0:i.homepage)===s.uuid,a=r===s.uuid,c=()=>t(s);return i?e.jsxRuntimeExports.jsxs("button",{className:`group relative flex w-full cursor-pointer items-center justify-between px-2.5 py-2 ${a?"bg-blue-200 ":""}`,onClick:c,type:"button",children:[e.jsxRuntimeExports.jsxs("div",{className:"flex text-sm items-center gap-x-1.5",children:[l?e.jsxRuntimeExports.jsx(n.HomeIcon,{}):e.jsxRuntimeExports.jsx(n.FileTextIcon,{})," ",s.name]}),e.jsxRuntimeExports.jsx(j,{pageData:s})]}):null},q=({pages:s,isLoading:r})=>r?e.jsxRuntimeExports.jsxs("div",{className:"flex animate-pulse flex-col gap-y-1 px-2.5 pt-2",children:[e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"}),e.jsxRuntimeExports.jsx("div",{className:"bg-background-200 h-7 w-full"})]}):s.length===0?e.jsxRuntimeExports.jsx("div",{className:"px-2.5 pb-2 pt-4",children:"No pages"}):e.jsxRuntimeExports.jsx("div",{className:"-mb-2",children:u.Children.toArray(s.map(i=>e.jsxRuntimeExports.jsx(p,{...i})))});exports.default=q;
@@ -1,8 +1,8 @@
1
1
  import { j as e } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import s, { useState as p, Suspense as l } from "react";
3
3
  import { ChevronRightIcon as c, GearIcon as u, HomeIcon as d, FileTextIcon as x } from "@radix-ui/react-icons";
4
- import { aQ as g, aR as h, aS as f } from "./ChaiBuilderEditor-4xhn_QlL.js";
5
- import { d as j, a as N, c as b } from "./index-tGVTszX2.js";
4
+ import { aQ as g, aR as h, aS as f } from "./ChaiBuilderEditor-tkzS851D.js";
5
+ import { d as j, a as N, c as b } from "./index-vfmO3y2d.js";
6
6
  import "./_commonjsHelpers-UyOWmZb0.js";
7
7
  import "clsx";
8
8
  import "react-dom";
@@ -46,9 +46,9 @@ import "lucide-react";
46
46
  import "./index-VBXQixVm.js";
47
47
  import "./core.js";
48
48
  import "sonner";
49
- import "./html-to-json-ofq1N3tB.js";
49
+ import "./html-to-json-OnIZDDXw.js";
50
50
  import "himalaya";
51
- const v = s.lazy(() => import("./single-page-detail-mQfFVaou.js")), P = ({ pageData: r }) => {
51
+ const v = s.lazy(() => import("./single-page-detail-tP2pfgBp.js")), P = ({ pageData: r }) => {
52
52
  const [t, i] = p("CLOSE");
53
53
  return /* @__PURE__ */ e.jsxs(
54
54
  g,
@@ -1,9 +1,9 @@
1
1
  import { j as i } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import * as l from "react";
3
- import { bg as n } from "./ChaiBuilderEditor-4xhn_QlL.js";
3
+ import { bg as n } from "./ChaiBuilderEditor-tkzS851D.js";
4
4
  import { g as c, v as d } from "./controls-yjgoZzB6.js";
5
- import { F as u } from "./form-LHHE25z8.js";
6
- import { a as x } from "./index-tGVTszX2.js";
5
+ import { F as u } from "./form-HRdEJjVq.js";
6
+ import { a as x } from "./index-vfmO3y2d.js";
7
7
  import "./_commonjsHelpers-UyOWmZb0.js";
8
8
  import "clsx";
9
9
  import "react-dom";
@@ -50,7 +50,7 @@ import "@rjsf/core";
50
50
  import "@rjsf/validator-ajv8";
51
51
  import "./core.js";
52
52
  import "sonner";
53
- import "./html-to-json-ofq1N3tB.js";
53
+ import "./html-to-json-OnIZDDXw.js";
54
54
  import "himalaya";
55
55
  const go = ({
56
56
  _projectData: m,
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),f=require("./ChaiBuilderEditor-Rqlg194T.cjs"),o=require("./controls-rRZhz0vu.cjs"),d=require("./form-zHGQEmOp.cjs"),m=require("./index-swYRuZtl.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./MODIFIERS-mVmfEGgo.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("tree-model");require("./utils-D_vtk3zK.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lucide-react");require("./index--mLLy7QQ.cjs");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./core.cjs");require("sonner");require("./html-to-json-9uiQ2Dp2.cjs");require("himalaya");function g(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,u.get?u:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const j=g(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();j.useEffect(()=>{e&&i(e)},[e,i]);const n=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:o.g({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.v({title:"Favicon",default:e==null?void 0:e.favicon})};return q.jsxRuntimeExports.jsx(f.ScrollArea,{className:"flex h-full select-none flex-col",children:q.jsxRuntimeExports.jsx(d.Form,{properties:c,disabled:u,formData:r,onChange:n})})};exports.default=b;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const q=require("./jsx-runtime-Z_BpKhVy.cjs"),a=require("react"),f=require("./ChaiBuilderEditor-aY8flOgX.cjs"),o=require("./controls-rRZhz0vu.cjs"),d=require("./form-Z4IRWj0o.cjs"),m=require("./index-bt7EhwLh.cjs");require("./_commonjsHelpers-wDK0ZLPo.cjs");require("clsx");require("react-dom");require("@radix-ui/react-scroll-area");require("@floating-ui/react-dom");require("jotai");require("i18next");require("react-i18next");require("flagged");require("lodash-es");require("./MODIFIERS-mVmfEGgo.cjs");require("./Functions-N3yhPYKY.cjs");require("tailwind-merge");require("@chaibuilder/runtime");require("@react-hookz/web");require("tree-model");require("./utils-D_vtk3zK.cjs");require("@radix-ui/react-toggle");require("class-variance-authority");require("@radix-ui/react-switch");require("@radix-ui/react-slot");require("@radix-ui/react-accordion");require("@radix-ui/react-icons");require("@radix-ui/react-alert-dialog");require("@radix-ui/react-dialog");require("@radix-ui/react-label");require("@radix-ui/react-tabs");require("@radix-ui/react-tooltip");require("@radix-ui/react-popover");require("@radix-ui/react-menubar");require("@radix-ui/react-hover-card");require("@radix-ui/react-select");require("@radix-ui/react-dropdown-menu");require("@radix-ui/react-separator");require("@radix-ui/react-toast");require("cmdk");require("@radix-ui/react-context-menu");require("react-icons-picker");require("react-quill");require("react-hotkeys-hook");require("lucide-react");require("./index--mLLy7QQ.cjs");require("@rjsf/core");require("@rjsf/validator-ajv8");require("./core.cjs");require("sonner");require("./html-to-json-rauxDBi6.cjs");require("himalaya");function g(r){const i=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(r){for(const e in r)if(e!=="default"){const u=Object.getOwnPropertyDescriptor(r,e);Object.defineProperty(i,e,u.get?u:{enumerable:!0,get:()=>r[e]})}}return i.default=r,Object.freeze(i)}const j=g(a),b=({_projectData:r,seany:i})=>{const{data:e,isLoading:u}=m.useProject();j.useEffect(()=>{e&&i(e)},[e,i]);const n=({formData:s},t)=>{i(l=>({...l,[t]:s[t]}))},c={name:o.g({title:"Project Name",default:e==null?void 0:e.name}),favicon:o.v({title:"Favicon",default:e==null?void 0:e.favicon})};return q.jsxRuntimeExports.jsx(f.ScrollArea,{className:"flex h-full select-none flex-col",children:q.jsxRuntimeExports.jsx(d.Form,{properties:c,disabled:u,formData:r,onChange:n})})};exports.default=b;
@@ -1,12 +1,12 @@
1
1
  import { j as s } from "./jsx-runtime-WbnYoNE9.js";
2
2
  import { h as c, g as u, r as g, v as x } from "./controls-yjgoZzB6.js";
3
- import { F as v } from "./form-LHHE25z8.js";
3
+ import { F as v } from "./form-HRdEJjVq.js";
4
4
  import "./_commonjsHelpers-UyOWmZb0.js";
5
5
  import "react";
6
6
  import "lodash-es";
7
7
  import "@rjsf/core";
8
8
  import "@rjsf/validator-ajv8";
9
- import "./ChaiBuilderEditor-4xhn_QlL.js";
9
+ import "./ChaiBuilderEditor-tkzS851D.js";
10
10
  import "clsx";
11
11
  import "react-dom";
12
12
  import "@radix-ui/react-scroll-area";