@chaibuilder/pages 0.4.9-beta.4 → 0.4.9-beta.5

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.
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./B4MFY5CR-BM1hdUqj.cjs"),t=require("./index-DzHZPAjK.cjs");var s=c=>{const[r,o]=e.createLocalStorage({prefix:"TanstackQueryDevtools"}),l=t.getPreferredColorScheme(),a=t.createMemo(()=>{const n=r.theme_preference||e.THEME_PREFERENCE;return n!=="system"?n:l()});return t.createComponent(e.QueryDevtoolsContext.Provider,{value:c,get children(){return t.createComponent(e.PiPProvider,{localStore:r,setLocalStore:o,get children(){return t.createComponent(e.ThemeContext.Provider,{value:a,get children(){return t.createComponent(e.Devtools,{localStore:r,setLocalStore:o})}})}})}})},u=s;exports.default=u;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./B4MFY5CR-Brb7f5Af.cjs"),t=require("./index-CCpzjW2l.cjs");var s=c=>{const[r,o]=e.createLocalStorage({prefix:"TanstackQueryDevtools"}),l=t.getPreferredColorScheme(),a=t.createMemo(()=>{const n=r.theme_preference||e.THEME_PREFERENCE;return n!=="system"?n:l()});return t.createComponent(e.QueryDevtoolsContext.Provider,{value:c,get children(){return t.createComponent(e.PiPProvider,{localStore:r,setLocalStore:o,get children(){return t.createComponent(e.ThemeContext.Provider,{value:a,get children(){return t.createComponent(e.Devtools,{localStore:r,setLocalStore:o})}})}})}})},u=s;exports.default=u;
@@ -1,5 +1,5 @@
1
- import { c, T as l, P as m, a as u, D as v, Q as i } from "./B4MFY5CR-CWm1-ws5.js";
2
- import { g as d, c as f, a as e } from "./index-BpwQFwgB.js";
1
+ import { c, T as l, P as m, a as u, D as v, Q as i } from "./B4MFY5CR-Bkzzkf1C.js";
2
+ import { g as d, c as f, a as e } from "./index-C0uClVKz.js";
3
3
  var p = (a) => {
4
4
  const [r, t] = c({
5
5
  prefix: "TanstackQueryDevtools"
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./B4MFY5CR-BM1hdUqj.cjs"),t=require("./index-DzHZPAjK.cjs");var u=o=>{const[r,n]=e.createLocalStorage({prefix:"TanstackQueryDevtools"}),c=t.getPreferredColorScheme(),a=t.createMemo(()=>{const l=r.theme_preference||e.THEME_PREFERENCE;return l!=="system"?l:c()});return t.createComponent(e.QueryDevtoolsContext.Provider,{value:o,get children(){return t.createComponent(e.PiPProvider,{disabled:!0,localStore:r,setLocalStore:n,get children(){return t.createComponent(e.ThemeContext.Provider,{value:a,get children(){return t.createComponent(e.ParentPanel,{get children(){return t.createComponent(e.ContentView,{localStore:r,setLocalStore:n,get onClose(){return o.onClose},showPanelViewOnly:!0})}})}})}})}})},i=u;exports.default=i;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./B4MFY5CR-Brb7f5Af.cjs"),t=require("./index-CCpzjW2l.cjs");var u=o=>{const[r,n]=e.createLocalStorage({prefix:"TanstackQueryDevtools"}),c=t.getPreferredColorScheme(),a=t.createMemo(()=>{const l=r.theme_preference||e.THEME_PREFERENCE;return l!=="system"?l:c()});return t.createComponent(e.QueryDevtoolsContext.Provider,{value:o,get children(){return t.createComponent(e.PiPProvider,{disabled:!0,localStore:r,setLocalStore:n,get children(){return t.createComponent(e.ThemeContext.Provider,{value:a,get children(){return t.createComponent(e.ParentPanel,{get children(){return t.createComponent(e.ContentView,{localStore:r,setLocalStore:n,get onClose(){return o.onClose},showPanelViewOnly:!0})}})}})}})}})},i=u;exports.default=i;
@@ -1,5 +1,5 @@
1
- import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./B4MFY5CR-CWm1-ws5.js";
2
- import { g as v, c as C, a as e } from "./index-BpwQFwgB.js";
1
+ import { c as s, T as c, P as u, a as i, b as m, C as P, Q as d } from "./B4MFY5CR-Bkzzkf1C.js";
2
+ import { g as v, c as C, a as e } from "./index-C0uClVKz.js";
3
3
  var h = (t) => {
4
4
  const [r, o] = s({
5
5
  prefix: "TanstackQueryDevtools"
@@ -7,7 +7,7 @@ import { Search as Ee, Film as Te, ImageIcon as De, Edit as Pe, Trash2 as Ue, Lo
7
7
  import { useDropzone as ze } from "react-dropzone";
8
8
  import { useQueryClient as K, useMutation as G, useQuery as ke } from "@tanstack/react-query";
9
9
  import { toast as b } from "sonner";
10
- import { W as F, X as z, Y as y, Z as k } from "./index-BpwQFwgB.js";
10
+ import { W as F, X as z, Y as y, Z as k } from "./index-C0uClVKz.js";
11
11
  const Me = () => {
12
12
  const a = F(), r = K(), o = z();
13
13
  return G({
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),L=require("@chaibuilder/sdk"),t=require("@chaibuilder/sdk/ui"),y=require("lodash-es"),j=require("lucide-react"),X=require("react-dropzone"),N=require("@tanstack/react-query"),w=require("sonner"),a=require("./index-DzHZPAjK.cjs"),Z=()=>{const l=a.useAssetsApiUrl(),c=N.useQueryClient(),d=a.useFetch();return N.useMutation({mutationFn:async({file:r,folderId:h,name:g})=>d(l,{action:a.ACTIONS.UPLOAD_ASSET,data:{file:r,folderId:h,name:g}}),onSuccess:()=>{c.invalidateQueries({queryKey:[a.QUERY_KEY_BASE,a.ACTIONS.GET_ASSETS]}),w.toast.success("Asset uploaded successfully")},onError:()=>{w.toast.error("Failed to upload asset")}})},ee=()=>{const l=a.useAssetsApiUrl(),c=N.useQueryClient(),d=a.useFetch();return N.useMutation({mutationFn:async r=>d(l,{action:a.ACTIONS.DELETE_ASSET,data:{id:r}}),onSuccess:()=>{c.invalidateQueries({queryKey:[a.QUERY_KEY_BASE,a.ACTIONS.GET_ASSETS]}),w.toast.success("Asset deleted successfully")},onError:()=>{w.toast.error("Failed to delete asset")}})},se=()=>{const l=a.useAssetsApiUrl(),c=N.useQueryClient(),d=a.useFetch();return N.useMutation({mutationFn:async r=>d(l,{action:a.ACTIONS.UPDATE_ASSET,data:r}),onSuccess:()=>{c.invalidateQueries({queryKey:[a.QUERY_KEY_BASE,a.ACTIONS.GET_ASSETS]}),w.toast.success("Asset updated successfully")},onError:()=>{w.toast.error("Failed to update asset")}})},te=(l={})=>{const c=a.useAssetsApiUrl(),d=a.useFetch(),{search:r,page:h=1,limit:g=10}=l;return N.useQuery({queryKey:[a.QUERY_KEY_BASE,a.ACTIONS.GET_ASSETS,r,h,g],queryFn:async()=>await d(c,{action:a.ACTIONS.GET_ASSETS,data:{search:r,page:h,limit:g}}),retry:1})};function ae(){const[c,d]=n.useState([]),[r,h]=n.useState({query:"",page:1,pageSize:10}),g=y.debounce(()=>r.query,300)(),{data:o,isLoading:C}=te({search:(g==null?void 0:g.toLowerCase().trim())||"",page:r.page,limit:r.pageSize}),v=o?Math.ceil(o.total/o.pageSize):0,u=(o==null?void 0:o.page)||1,f=u<v,x=u>1,{mutate:E,isPending:k}=se(),{mutate:b,isPending:m}=Z(),{mutate:T,isPending:U}=ee(),S=n.useCallback(p=>{p>=1&&p<=v&&h(A=>({...A,page:p}))},[v]),q=n.useCallback(()=>{f&&S(u+1)},[u,f,S]),F=n.useCallback(()=>{x&&S(u-1)},[u,x,S]),I=n.useCallback(p=>{h(A=>({...A,query:p,page:1}))},[]),D=n.useCallback(p=>{d(A=>y.find(A,{id:p.id})?[]:[p])},[!1]),z=n.useCallback(()=>{d([])},[]);return{query:(r==null?void 0:r.query)||"",selectedAssets:c,assets:(o==null?void 0:o.assets)||[],currentPage:u,totalPages:v,hasNextPage:f,hasPreviousPage:x,uploadAsset:b,updateAsset:E,deleteAsset:T,goToPage:S,nextPage:q,previousPage:F,updateSearchQuery:I,clearSelectedAssets:z,updateSelectedAssets:D,isLoadingAssets:C,isUploadingAsset:m,isUpdatingAsset:k,isDeletingAsset:U}}const le=n.lazy(()=>Promise.resolve().then(()=>require("./asset-metadata-editor-IRTgc3or.cjs"))),ne=n.lazy(()=>Promise.resolve().then(()=>require("./image-editor-DHmv5L8S.cjs")));function ie({close:l,onSelect:c,mode:d="image"}){const h=n.useMemo(()=>[d],[d]),[g,o]=n.useState("browse"),[C,v]=n.useState(null),[u,f]=n.useState(null),[x,E]=n.useState({show:!1,file:""}),{query:k,assets:b,selectedAssets:m,uploadAsset:T,updateAsset:U,deleteAsset:S,updateSearchQuery:q,clearSelectedAssets:F,updateSelectedAssets:I,isLoadingAssets:D,isUploadingAsset:z,isUpdatingAsset:p}=ae(),A=n.useRef(null),_=n.useCallback(async s=>new Promise((i,M)=>{const Q=s[0],P=new FileReader;P.readAsDataURL(Q),P.onload=async()=>{const B=await T({file:P.result,folderId:null,name:Q.name},{onSuccess:()=>{o("browse")}});i(B)},P.onerror=B=>M(B)}),[T]),{getRootProps:O,getInputProps:R,isDragActive:K}=X.useDropzone({onDrop:_,accept:{"image/*":h.includes("image")?[]:[]},maxSize:10*1024*1024}),Y=()=>{console.log("selectedAssets",m,y.pick(y.first(m),["url","width","height","description"])),m.length!==0&&(c(y.pick(y.first(m),["url","width","height","description"])),l())},G=async s=>{f(s)},$=async()=>{u&&(await S(u.id),f(null))},H=s=>{v(s)},V=async(s,i)=>{await U(y.merge(s,y.pick(i,["id","description"]))),l()},J=s=>{q(s.target.value)},W=async(s,i)=>{try{i?await T({file:s,folderId:null,name:x.name||""}):await U({id:x.id||"",file:s}),E({show:!1,file:""}),o("browse")}catch(M){console.error("Error saving edited image:",M)}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"min-w-[700px] min-h-[600px] w-[900px] max-w-[900px]",children:[e.jsx("h1",{className:"text-lg font-medium pb-4",children:"Digital Asset Manager"}),e.jsxs(t.Tabs,{value:g,onValueChange:s=>o(s),className:"flex-1 flex flex-col h-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs(t.TabsList,{children:[e.jsx(t.TabsTrigger,{value:"browse",children:"Browse Assets"}),e.jsx(t.TabsTrigger,{value:"upload",children:"Upload"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[m.length>0&&e.jsx(e.Fragment,{children:e.jsx(t.Button,{variant:"outline",size:"sm",onClick:()=>F(),title:"Clear selection",children:"Clear"})}),e.jsx(t.Button,{size:"sm",onClick:Y,disabled:m.length===0,children:"Select Asset"})]})]}),e.jsxs(t.TabsContent,{value:"browse",className:"flex-1 flex flex-col",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsxs("div",{className:"relative w-full",children:[e.jsx(j.Search,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(t.Input,{placeholder:"Search assets...",value:k,onChange:J,className:"pl-8"})]})}),D&&b.length===0?e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2 overflow-y-auto max-h-[550px] p-1",children:[e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"})]}):b.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-12 h-[380px]",children:[e.jsxs("div",{className:"text-muted-foreground mb-2",children:[e.jsx("h3",{className:"text-gray-800 font-medium",children:"No assets to display"}),e.jsx("p",{className:"text-sm",children:"You haven't uploaded any assets yet. Start by uploading your first asset."})]}),e.jsx("div",{className:"flex gap-2 pt-4",children:e.jsx(t.Button,{size:"lg",onClick:()=>o("upload"),children:"Upload Assets"})})]}):e.jsxs("div",{ref:A,className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2 overflow-y-auto max-h-[550px] p-1",children:[b.map(s=>e.jsx(t.Card,{className:L.mergeClasses("cursor-pointer overflow-hidden transition-all",m.some(i=>i.id===s.id)?"ring-2 ring-primary":"hover:ring-2 hover:ring-primary/20"),onClick:()=>I(s),children:e.jsxs(t.CardContent,{className:"p-0 relative group",children:[e.jsxs("div",{className:"aspect-square relative overflow-hidden bg-muted",children:[s.type==="image"?e.jsx("img",{src:s.thumbnailUrl||"/placeholder.svg",alt:s.name,className:"object-cover w-full h-full min-h-[100px]"}):e.jsxs("div",{className:"flex items-center justify-center h-full",children:[e.jsx(j.Film,{className:"h-12 w-12 text-muted-foreground"}),s.thumbnailUrl&&e.jsx("img",{src:s.thumbnailUrl||"/placeholder.svg",alt:s.name,className:"absolute inset-0 object-cover w-full h-full"})]}),e.jsxs("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[e.jsx(t.Button,{variant:"secondary",size:"icon",className:"h-8 w-8",onClick:i=>{i.stopPropagation(),H(s)},children:e.jsx(j.ImageIcon,{className:"h-4 w-4"})}),e.jsx(t.Button,{variant:"secondary",size:"icon",className:"h-8 w-8",onClick:i=>{i.stopPropagation(),E({id:s.id,show:!0,file:s.url,name:s.name})},children:e.jsx(j.Edit,{className:"h-4 w-4"})}),e.jsx(t.Button,{variant:"destructive",size:"icon",className:"h-8 w-8",onClick:i=>{i.stopPropagation(),G(s)},children:e.jsx(j.Trash2,{className:"h-4 w-4"})})]}),m.some(i=>i.id===s.id)&&e.jsx("div",{className:"absolute top-2 left-2",children:e.jsx("input",{type:"checkbox",checked:m.some(i=>i.id===s.id),readOnly:!0,className:"rounded-full"})})]}),e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"text-sm font-medium truncate",title:s.name,children:s.name}),e.jsxs("div",{className:"text-xs text-muted-foreground flex items-center justify-between",children:[e.jsx("span",{children:re((s==null?void 0:s.size)||0)}),e.jsx("span",{children:oe(s.createdAt)})]})]})]})},s.id)),D&&b.length>0&&e.jsx("div",{className:"col-span-full flex justify-center py-4",children:e.jsx(j.Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]}),e.jsx(t.TabsContent,{value:"upload",className:"flex-1 ",children:e.jsxs("div",{...O(),className:L.mergeClasses("border-2 border-dashed rounded-lg h-[380px] flex flex-col items-center justify-center text-center cursor-pointer hover:bg-gray-50",K?"border-primary bg-primary/5":"border-muted-foreground/20"),children:[e.jsx("input",{...R()}),p||z?e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx(j.Loader2,{className:"h-12 w-12 text-primary animate-spin mb-4"}),e.jsx("h3",{className:"text-lg font-medium mb-1",children:"Uploading files..."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Please wait while your files are being processed."})]}):e.jsxs(e.Fragment,{children:[e.jsx(j.Upload,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium mb-1",children:"Drag & drop files here"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"or click to browse your files"}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsxs("p",{children:["Accepted file types: ",h.join(", ")]}),e.jsxs("p",{children:["Maximum file size: ",10,"MB"]})]})]})]})})]})]}),C&&e.jsx(n.Suspense,{fallback:e.jsx("div",{children:"Loading..."}),children:e.jsx(le,{asset:C,onSave:s=>V(C,s),onCancel:()=>{v(null)}})}),x.show&&e.jsx(n.Suspense,{fallback:e.jsx("div",{children:"Loading..."}),children:e.jsx(ne,{imageUrl:x.file,onSave:W,onClose:()=>E({show:!1,file:""}),defaultSavedImageName:x.name,isEditing:!!x.id})}),u&&e.jsx(t.Dialog,{open:!!u,onOpenChange:()=>f(null),children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:"Delete Asset"}),e.jsxs(t.DialogDescription,{children:['Are you sure you want to delete "',u.name,'"? This action cannot be undone.']})]}),e.jsxs(t.DialogFooter,{className:"gap-2 sm:gap-0",children:[e.jsx(t.Button,{variant:"outline",onClick:()=>f(null),children:"Cancel"}),e.jsx(t.Button,{variant:"destructive",onClick:$,children:"Delete"})]})]})})]})}function re(l){return l<1024?`${l.toFixed(2)} B`:l<1024*1024?`${(l/1024).toFixed(2)} KB`:`${(l/(1024*1024)).toFixed(2)} MB`}function oe(l){const c=new Date(l);return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(c)}exports.default=ie;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react/jsx-runtime"),n=require("react"),L=require("@chaibuilder/sdk"),t=require("@chaibuilder/sdk/ui"),y=require("lodash-es"),j=require("lucide-react"),X=require("react-dropzone"),N=require("@tanstack/react-query"),w=require("sonner"),a=require("./index-CCpzjW2l.cjs"),Z=()=>{const l=a.useAssetsApiUrl(),c=N.useQueryClient(),d=a.useFetch();return N.useMutation({mutationFn:async({file:r,folderId:h,name:g})=>d(l,{action:a.ACTIONS.UPLOAD_ASSET,data:{file:r,folderId:h,name:g}}),onSuccess:()=>{c.invalidateQueries({queryKey:[a.QUERY_KEY_BASE,a.ACTIONS.GET_ASSETS]}),w.toast.success("Asset uploaded successfully")},onError:()=>{w.toast.error("Failed to upload asset")}})},ee=()=>{const l=a.useAssetsApiUrl(),c=N.useQueryClient(),d=a.useFetch();return N.useMutation({mutationFn:async r=>d(l,{action:a.ACTIONS.DELETE_ASSET,data:{id:r}}),onSuccess:()=>{c.invalidateQueries({queryKey:[a.QUERY_KEY_BASE,a.ACTIONS.GET_ASSETS]}),w.toast.success("Asset deleted successfully")},onError:()=>{w.toast.error("Failed to delete asset")}})},se=()=>{const l=a.useAssetsApiUrl(),c=N.useQueryClient(),d=a.useFetch();return N.useMutation({mutationFn:async r=>d(l,{action:a.ACTIONS.UPDATE_ASSET,data:r}),onSuccess:()=>{c.invalidateQueries({queryKey:[a.QUERY_KEY_BASE,a.ACTIONS.GET_ASSETS]}),w.toast.success("Asset updated successfully")},onError:()=>{w.toast.error("Failed to update asset")}})},te=(l={})=>{const c=a.useAssetsApiUrl(),d=a.useFetch(),{search:r,page:h=1,limit:g=10}=l;return N.useQuery({queryKey:[a.QUERY_KEY_BASE,a.ACTIONS.GET_ASSETS,r,h,g],queryFn:async()=>await d(c,{action:a.ACTIONS.GET_ASSETS,data:{search:r,page:h,limit:g}}),retry:1})};function ae(){const[c,d]=n.useState([]),[r,h]=n.useState({query:"",page:1,pageSize:10}),g=y.debounce(()=>r.query,300)(),{data:o,isLoading:C}=te({search:(g==null?void 0:g.toLowerCase().trim())||"",page:r.page,limit:r.pageSize}),v=o?Math.ceil(o.total/o.pageSize):0,u=(o==null?void 0:o.page)||1,f=u<v,x=u>1,{mutate:E,isPending:k}=se(),{mutate:b,isPending:m}=Z(),{mutate:T,isPending:U}=ee(),S=n.useCallback(p=>{p>=1&&p<=v&&h(A=>({...A,page:p}))},[v]),q=n.useCallback(()=>{f&&S(u+1)},[u,f,S]),F=n.useCallback(()=>{x&&S(u-1)},[u,x,S]),I=n.useCallback(p=>{h(A=>({...A,query:p,page:1}))},[]),D=n.useCallback(p=>{d(A=>y.find(A,{id:p.id})?[]:[p])},[!1]),z=n.useCallback(()=>{d([])},[]);return{query:(r==null?void 0:r.query)||"",selectedAssets:c,assets:(o==null?void 0:o.assets)||[],currentPage:u,totalPages:v,hasNextPage:f,hasPreviousPage:x,uploadAsset:b,updateAsset:E,deleteAsset:T,goToPage:S,nextPage:q,previousPage:F,updateSearchQuery:I,clearSelectedAssets:z,updateSelectedAssets:D,isLoadingAssets:C,isUploadingAsset:m,isUpdatingAsset:k,isDeletingAsset:U}}const le=n.lazy(()=>Promise.resolve().then(()=>require("./asset-metadata-editor-IRTgc3or.cjs"))),ne=n.lazy(()=>Promise.resolve().then(()=>require("./image-editor-DHmv5L8S.cjs")));function ie({close:l,onSelect:c,mode:d="image"}){const h=n.useMemo(()=>[d],[d]),[g,o]=n.useState("browse"),[C,v]=n.useState(null),[u,f]=n.useState(null),[x,E]=n.useState({show:!1,file:""}),{query:k,assets:b,selectedAssets:m,uploadAsset:T,updateAsset:U,deleteAsset:S,updateSearchQuery:q,clearSelectedAssets:F,updateSelectedAssets:I,isLoadingAssets:D,isUploadingAsset:z,isUpdatingAsset:p}=ae(),A=n.useRef(null),_=n.useCallback(async s=>new Promise((i,M)=>{const Q=s[0],P=new FileReader;P.readAsDataURL(Q),P.onload=async()=>{const B=await T({file:P.result,folderId:null,name:Q.name},{onSuccess:()=>{o("browse")}});i(B)},P.onerror=B=>M(B)}),[T]),{getRootProps:O,getInputProps:R,isDragActive:K}=X.useDropzone({onDrop:_,accept:{"image/*":h.includes("image")?[]:[]},maxSize:10*1024*1024}),Y=()=>{console.log("selectedAssets",m,y.pick(y.first(m),["url","width","height","description"])),m.length!==0&&(c(y.pick(y.first(m),["url","width","height","description"])),l())},G=async s=>{f(s)},$=async()=>{u&&(await S(u.id),f(null))},H=s=>{v(s)},V=async(s,i)=>{await U(y.merge(s,y.pick(i,["id","description"]))),l()},J=s=>{q(s.target.value)},W=async(s,i)=>{try{i?await T({file:s,folderId:null,name:x.name||""}):await U({id:x.id||"",file:s}),E({show:!1,file:""}),o("browse")}catch(M){console.error("Error saving edited image:",M)}};return e.jsxs(e.Fragment,{children:[e.jsxs("div",{className:"min-w-[700px] min-h-[600px] w-[900px] max-w-[900px]",children:[e.jsx("h1",{className:"text-lg font-medium pb-4",children:"Digital Asset Manager"}),e.jsxs(t.Tabs,{value:g,onValueChange:s=>o(s),className:"flex-1 flex flex-col h-full",children:[e.jsxs("div",{className:"flex justify-between items-center mb-2",children:[e.jsxs(t.TabsList,{children:[e.jsx(t.TabsTrigger,{value:"browse",children:"Browse Assets"}),e.jsx(t.TabsTrigger,{value:"upload",children:"Upload"})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[m.length>0&&e.jsx(e.Fragment,{children:e.jsx(t.Button,{variant:"outline",size:"sm",onClick:()=>F(),title:"Clear selection",children:"Clear"})}),e.jsx(t.Button,{size:"sm",onClick:Y,disabled:m.length===0,children:"Select Asset"})]})]}),e.jsxs(t.TabsContent,{value:"browse",className:"flex-1 flex flex-col",children:[e.jsx("div",{className:"flex items-center gap-2 mb-2",children:e.jsxs("div",{className:"relative w-full",children:[e.jsx(j.Search,{className:"absolute left-2 top-2.5 h-4 w-4 text-muted-foreground"}),e.jsx(t.Input,{placeholder:"Search assets...",value:k,onChange:J,className:"pl-8"})]})}),D&&b.length===0?e.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2 overflow-y-auto max-h-[550px] p-1",children:[e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"}),e.jsx("div",{className:"bg-gray-200 h-64 w-full animate-pulse rounded"})]}):b.length===0?e.jsxs("div",{className:"flex flex-col items-center justify-center text-center p-12 h-[380px]",children:[e.jsxs("div",{className:"text-muted-foreground mb-2",children:[e.jsx("h3",{className:"text-gray-800 font-medium",children:"No assets to display"}),e.jsx("p",{className:"text-sm",children:"You haven't uploaded any assets yet. Start by uploading your first asset."})]}),e.jsx("div",{className:"flex gap-2 pt-4",children:e.jsx(t.Button,{size:"lg",onClick:()=>o("upload"),children:"Upload Assets"})})]}):e.jsxs("div",{ref:A,className:"grid grid-cols-2 sm:grid-cols-3 md:grid-cols-4 lg:grid-cols-5 gap-2 overflow-y-auto max-h-[550px] p-1",children:[b.map(s=>e.jsx(t.Card,{className:L.mergeClasses("cursor-pointer overflow-hidden transition-all",m.some(i=>i.id===s.id)?"ring-2 ring-primary":"hover:ring-2 hover:ring-primary/20"),onClick:()=>I(s),children:e.jsxs(t.CardContent,{className:"p-0 relative group",children:[e.jsxs("div",{className:"aspect-square relative overflow-hidden bg-muted",children:[s.type==="image"?e.jsx("img",{src:s.thumbnailUrl||"/placeholder.svg",alt:s.name,className:"object-cover w-full h-full min-h-[100px]"}):e.jsxs("div",{className:"flex items-center justify-center h-full",children:[e.jsx(j.Film,{className:"h-12 w-12 text-muted-foreground"}),s.thumbnailUrl&&e.jsx("img",{src:s.thumbnailUrl||"/placeholder.svg",alt:s.name,className:"absolute inset-0 object-cover w-full h-full"})]}),e.jsxs("div",{className:"absolute inset-0 bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity flex items-center justify-center gap-2",children:[e.jsx(t.Button,{variant:"secondary",size:"icon",className:"h-8 w-8",onClick:i=>{i.stopPropagation(),H(s)},children:e.jsx(j.ImageIcon,{className:"h-4 w-4"})}),e.jsx(t.Button,{variant:"secondary",size:"icon",className:"h-8 w-8",onClick:i=>{i.stopPropagation(),E({id:s.id,show:!0,file:s.url,name:s.name})},children:e.jsx(j.Edit,{className:"h-4 w-4"})}),e.jsx(t.Button,{variant:"destructive",size:"icon",className:"h-8 w-8",onClick:i=>{i.stopPropagation(),G(s)},children:e.jsx(j.Trash2,{className:"h-4 w-4"})})]}),m.some(i=>i.id===s.id)&&e.jsx("div",{className:"absolute top-2 left-2",children:e.jsx("input",{type:"checkbox",checked:m.some(i=>i.id===s.id),readOnly:!0,className:"rounded-full"})})]}),e.jsxs("div",{className:"p-2",children:[e.jsx("div",{className:"text-sm font-medium truncate",title:s.name,children:s.name}),e.jsxs("div",{className:"text-xs text-muted-foreground flex items-center justify-between",children:[e.jsx("span",{children:re((s==null?void 0:s.size)||0)}),e.jsx("span",{children:oe(s.createdAt)})]})]})]})},s.id)),D&&b.length>0&&e.jsx("div",{className:"col-span-full flex justify-center py-4",children:e.jsx(j.Loader2,{className:"h-6 w-6 animate-spin text-muted-foreground"})})]})]}),e.jsx(t.TabsContent,{value:"upload",className:"flex-1 ",children:e.jsxs("div",{...O(),className:L.mergeClasses("border-2 border-dashed rounded-lg h-[380px] flex flex-col items-center justify-center text-center cursor-pointer hover:bg-gray-50",K?"border-primary bg-primary/5":"border-muted-foreground/20"),children:[e.jsx("input",{...R()}),p||z?e.jsxs("div",{className:"flex flex-col items-center",children:[e.jsx(j.Loader2,{className:"h-12 w-12 text-primary animate-spin mb-4"}),e.jsx("h3",{className:"text-lg font-medium mb-1",children:"Uploading files..."}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Please wait while your files are being processed."})]}):e.jsxs(e.Fragment,{children:[e.jsx(j.Upload,{className:"h-12 w-12 text-muted-foreground mb-4"}),e.jsx("h3",{className:"text-lg font-medium mb-1",children:"Drag & drop files here"}),e.jsx("p",{className:"text-sm text-muted-foreground mb-4",children:"or click to browse your files"}),e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsxs("p",{children:["Accepted file types: ",h.join(", ")]}),e.jsxs("p",{children:["Maximum file size: ",10,"MB"]})]})]})]})})]})]}),C&&e.jsx(n.Suspense,{fallback:e.jsx("div",{children:"Loading..."}),children:e.jsx(le,{asset:C,onSave:s=>V(C,s),onCancel:()=>{v(null)}})}),x.show&&e.jsx(n.Suspense,{fallback:e.jsx("div",{children:"Loading..."}),children:e.jsx(ne,{imageUrl:x.file,onSave:W,onClose:()=>E({show:!1,file:""}),defaultSavedImageName:x.name,isEditing:!!x.id})}),u&&e.jsx(t.Dialog,{open:!!u,onOpenChange:()=>f(null),children:e.jsxs(t.DialogContent,{children:[e.jsxs(t.DialogHeader,{children:[e.jsx(t.DialogTitle,{children:"Delete Asset"}),e.jsxs(t.DialogDescription,{children:['Are you sure you want to delete "',u.name,'"? This action cannot be undone.']})]}),e.jsxs(t.DialogFooter,{className:"gap-2 sm:gap-0",children:[e.jsx(t.Button,{variant:"outline",onClick:()=>f(null),children:"Cancel"}),e.jsx(t.Button,{variant:"destructive",onClick:$,children:"Delete"})]})]})})]})}function re(l){return l<1024?`${l.toFixed(2)} B`:l<1024*1024?`${(l/1024).toFixed(2)} KB`:`${(l/(1024*1024)).toFixed(2)} MB`}function oe(l){const c=new Date(l);return new Intl.DateTimeFormat("en-US",{month:"short",day:"numeric",year:"numeric"}).format(c)}exports.default=ie;
@@ -4,10 +4,10 @@ var ks = (e) => {
4
4
  var Ls = (e, t, n) => t.has(e) || ks("Cannot " + n);
5
5
  var R = (e, t, n) => (Ls(e, t, "read from private field"), n ? n.call(e) : t.get(e)), re = (e, t, n) => t.has(e) ? ks("Cannot add the same private member more than once") : t instanceof WeakSet ? t.add(e) : t.set(e, n), te = (e, t, n, s) => (Ls(e, t, "write to private field"), s ? s.call(e, n) : t.set(e, n), n);
6
6
  import { jsx as r, jsxs as u, Fragment as we } from "react/jsx-runtime";
7
- import { noop as Ra, isFunction as Oa, get as ne, isEmpty as me, reverse as Ba, sortBy as Ma, each as Fa, find as ge, set as qa, has as nn, startsWith as Rt, isEqual as is, map as Fe, toLower as Dt, trim as Ha, filter as Ce, startCase as It, groupBy as Ka, compact as Nn, includes as Mt, concat as Zs, endsWith as Js, orderBy as mn, first as Va, uniq as ja, debounce as $a, pick as er, keys as za, pickBy as Wa, isArray as Ya, cloneDeep as Qa, isString as Ds } from "lodash-es";
7
+ import { isFunction as Ra, noop as Oa, get as ne, isEmpty as me, reverse as Ba, sortBy as Ma, each as Fa, find as ge, set as qa, has as nn, startsWith as Rt, isEqual as is, map as Fe, toLower as Dt, trim as Ha, filter as Ce, startCase as It, groupBy as Ka, compact as Nn, includes as Mt, concat as Zs, endsWith as Js, orderBy as mn, first as Va, uniq as ja, debounce as $a, pick as er, keys as za, pickBy as Wa, isArray as Ya, cloneDeep as Qa, isString as Ds } from "lodash-es";
8
8
  import { useAtom as Dn, atom as ls } from "jotai";
9
9
  import * as ue from "react";
10
- import tr, { useMemo as Y, useCallback as Ie, useState as P, useEffect as Se, useRef as ut, Suspense as Xa, lazy as Za } from "react";
10
+ import tr, { useCallback as Pe, useMemo as Y, useState as P, useEffect as Se, useRef as ut, Suspense as Xa, lazy as Za } from "react";
11
11
  import { useQueryClient as Ne, useQuery as Ae, useMutation as xe, onlineManager as nr, QueryClient as Ja, QueryClientProvider as ei } from "@tanstack/react-query";
12
12
  import { toast as $ } from "sonner";
13
13
  import { useLanguages as dt, useUpdateBlocksPropsRealtime as sr, PERMISSIONS as ti, usePartailBlocksStore as ni, usePermissions as sn, useLibraryBlocks as si, useTheme as ri, mergeClasses as ai, useSavePage as rr, useRightPanel as ii, useBlocksStore as li, getBlocksFromHTML as oi, useTranslation as ci, useSidebarActivePanel as ui, registerChaiSidebarPanel as zn, registerChaiTopBar as di, registerChaiMediaManager as hi, registerChaiSaveToLibrary as mi, ChaiBuilderEditor as fi } from "@chaibuilder/sdk";
@@ -353,15 +353,15 @@ function bl(e, t, n = El, s) {
353
353
  }
354
354
  );
355
355
  }
356
- const wl = bl("__chai_user", null), rt = () => {
357
- const [e, t] = Dn(wl), n = tt("onLogout", Ra);
356
+ const wl = bl("__chai__user", null), rt = () => {
357
+ const [e, t] = Dn(wl), n = tt("onLogout", Oa), s = Pe(() => {
358
+ t(null), Ra(n) && n();
359
+ }, [n, t]);
358
360
  return {
359
361
  isLoggedIn: !!e,
360
362
  user: e,
361
363
  setUser: t,
362
- logout: () => {
363
- t(null), Oa(n) && n();
364
- }
364
+ logout: s
365
365
  };
366
366
  }, Sl = () => {
367
367
  const { user: e, setUser: t, logout: n } = rt(), s = Un(), a = Ne();
@@ -416,7 +416,7 @@ const Qu = () => {
416
416
  () => e == null ? void 0 : e.accessToken,
417
417
  [e == null ? void 0 : e.accessToken]
418
418
  );
419
- return Ie(
419
+ return Pe(
420
420
  async (s, a, i = {}) => {
421
421
  if (!n) {
422
422
  console.log("no auth token");
@@ -448,7 +448,7 @@ const Qu = () => {
448
448
  () => e == null ? void 0 : e.accessToken,
449
449
  [e == null ? void 0 : e.accessToken]
450
450
  ), { refetch: n } = Sl();
451
- return Ie(
451
+ return Pe(
452
452
  async (s, a, i = {}) => {
453
453
  if (t)
454
454
  try {
@@ -579,7 +579,7 @@ const Al = ls({}), Or = () => Dn(Al), xl = () => {
579
579
  initialData: "",
580
580
  queryFn: () => ""
581
581
  });
582
- return { setAiContext: Ie(
582
+ return { setAiContext: Pe(
583
583
  (s) => {
584
584
  e.setQueryData([I.AI_CONTEXT], s);
585
585
  },
@@ -718,7 +718,7 @@ function Pl({
718
718
  ] }) });
719
719
  }
720
720
  const _l = () => {
721
- const { isLocked: e, currentEditor: t } = hn(), { data: n } = dn(t), [s] = Ue(), a = s.get("page"), { mutate: i } = Ur(), { isFetching: l } = Mr(), o = Ie(() => {
721
+ const { isLocked: e, currentEditor: t } = hn(), { data: n } = dn(t), [s] = Ue(), a = s.get("page"), { mutate: i } = Ur(), { isFetching: l } = Mr(), o = Pe(() => {
722
722
  i({ id: a });
723
723
  }, [a, i]);
724
724
  return !e || l ? /* @__PURE__ */ r("div", { className: "" }) : /* @__PURE__ */ r(
@@ -1074,7 +1074,7 @@ const _l = () => {
1074
1074
  )
1075
1075
  ] });
1076
1076
  }, Bl = 1 * 1024 * 1024, Ml = ({ value: e, onChange: t }) => {
1077
- const [n, s] = P(!1), a = ut(null), i = Ie(
1077
+ const [n, s] = P(!1), a = ut(null), i = Pe(
1078
1078
  (c) => {
1079
1079
  var g;
1080
1080
  const h = (g = c.target.files) == null ? void 0 : g[0];
@@ -2949,7 +2949,7 @@ const lo = ({
2949
2949
  }) => {
2950
2950
  const [n, s] = P(!1), [a, i] = P(""), [l, o] = P(""), [c, h] = P(!1), g = ut(null), d = $l(), { data: E } = ke(), y = E == null ? void 0 : E.find(
2951
2951
  (b) => b.key === e.pageType
2952
- ), p = (y == null ? void 0 : y.name) || It(e.pageType), S = Ie(
2952
+ ), p = (y == null ? void 0 : y.name) || It(e.pageType), S = Pe(
2953
2953
  (b) => {
2954
2954
  var T;
2955
2955
  const w = (T = b.target.files) == null ? void 0 : T[0];
@@ -3289,7 +3289,7 @@ const lo = ({
3289
3289
  }
3290
3290
  );
3291
3291
  }, ho = ({ close: e }) => {
3292
- const [, t] = P([]), [n, s] = P(""), [a, i] = P(null), [l, o] = P(null), [c, h] = P(null), [g, d] = P(null), [E, y] = P(null), { data: p, isFetching: S } = Rn(), [v, x] = P(""), { hasPermission: U } = sn(), [b, w] = Ue(), T = b.get("page"), { data: D } = ke(), ee = Ie(
3292
+ const [, t] = P([]), [n, s] = P(""), [a, i] = P(null), [l, o] = P(null), [c, h] = P(null), [g, d] = P(null), [E, y] = P(null), { data: p, isFetching: S } = Rn(), [v, x] = P(""), { hasPermission: U } = sn(), [b, w] = Ue(), T = b.get("page"), { data: D } = ke(), ee = Pe(
3293
3293
  (A) => {
3294
3294
  var M;
3295
3295
  return (M = ge(D, { key: A })) == null ? void 0 : M.hasSlug;
@@ -3303,7 +3303,7 @@ const lo = ({
3303
3303
  }, [D, v]);
3304
3304
  const le = (A) => {
3305
3305
  x(A), sessionStorage.setItem("pageTypeFilter", A);
3306
- }, k = Ie(
3306
+ }, k = Pe(
3307
3307
  (A) => {
3308
3308
  const se = new URLSearchParams(window.location.search).get("lang"), fe = new URLSearchParams({ page: A });
3309
3309
  se && fe.set("lang", se), window.history.pushState({}, "", `?${fe.toString()}`), w(fe), window.dispatchEvent(new PopStateEvent("popstate")), e();
@@ -4035,7 +4035,7 @@ function _o({
4035
4035
  showModal: e = !1,
4036
4036
  onClose: t = () => console.log("Cancelled")
4037
4037
  }) {
4038
- const [n, s] = P([]), { data: a, isFetching: i } = Co(), { data: l } = ke(), o = Ie(
4038
+ const [n, s] = P([]), { data: a, isFetching: i } = Co(), { data: l } = ke(), o = Pe(
4039
4039
  (w) => {
4040
4040
  var T;
4041
4041
  return (T = ge(l, { key: w })) == null ? void 0 : T.hasSlug;
@@ -4256,7 +4256,7 @@ const Lo = () => {
4256
4256
  return (g = l == null ? void 0 : l.find((d) => (d == null ? void 0 : d.lang) === e)) == null ? void 0 : g.slug;
4257
4257
  },
4258
4258
  [e, l]
4259
- ), h = Ie(
4259
+ ), h = Pe(
4260
4260
  (g) => {
4261
4261
  var d;
4262
4262
  return (d = ge(o, { key: g })) == null ? void 0 : d.hasSlug;
@@ -4301,7 +4301,7 @@ const Lo = () => {
4301
4301
  window.removeEventListener("beforeunload", g);
4302
4302
  };
4303
4303
  }, [a]);
4304
- const i = Ie(async () => {
4304
+ const i = Pe(async () => {
4305
4305
  t(!0), await s(!1);
4306
4306
  }, [s]);
4307
4307
  Se(() => {
@@ -4470,7 +4470,7 @@ const Lo = () => {
4470
4470
  ] }) : null;
4471
4471
  }, Oo = () => {
4472
4472
  const { data: e } = Re(), t = e && (e == null ? void 0 : e.online), { data: n } = ke();
4473
- return Ie(
4473
+ return Pe(
4474
4474
  (a) => {
4475
4475
  var i;
4476
4476
  return (i = ge(n, { key: a })) == null ? void 0 : i.hasSlug;
@@ -4508,7 +4508,7 @@ const Mo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4508
4508
  /* @__PURE__ */ r(Bo, {})
4509
4509
  ] }), Fo = () => {
4510
4510
  const e = X(), { aiContext: t } = bs(), n = z();
4511
- return Ie(
4511
+ return Pe(
4512
4512
  async (s, a, i, l) => n(e, {
4513
4513
  action: I.ASK_AI,
4514
4514
  data: { type: s, prompt: a, blocks: i, context: t, lang: l }
@@ -4603,7 +4603,7 @@ const Mo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4603
4603
  }, $o = () => {
4604
4604
  const { data: e } = Rn(), t = X(), n = z();
4605
4605
  return {
4606
- getPartialBlocks: Ie(async () => {
4606
+ getPartialBlocks: Pe(async () => {
4607
4607
  const s = {};
4608
4608
  for (const a of e ?? [])
4609
4609
  me(a == null ? void 0 : a.slug) && (s[a.id] = {
@@ -4613,7 +4613,7 @@ const Mo = () => /* @__PURE__ */ u("div", { className: "flex px-2 h-full items-c
4613
4613
  });
4614
4614
  return s;
4615
4615
  }, [e]),
4616
- getPartialBlockBlocks: Ie(
4616
+ getPartialBlockBlocks: Pe(
4617
4617
  async (s) => {
4618
4618
  if (!s) return [];
4619
4619
  try {
@@ -5439,14 +5439,14 @@ var ic = (e, t) => e === t, Cn = Symbol("solid-proxy"), Wr = typeof Proxy == "fu
5439
5439
  cleanups: null,
5440
5440
  context: null,
5441
5441
  owner: null
5442
- }, Kn = {}, J = null, Vn = null, lc = null, ae = null, _e = null, Je = null, On = 0;
5442
+ }, Kn = {}, J = null, Vn = null, lc = null, ae = null, Ie = null, Je = null, On = 0;
5443
5443
  function ot(e, t) {
5444
5444
  const n = ae, s = J, a = e.length === 0, i = t === void 0 ? s : t, l = a ? Xr : {
5445
5445
  owned: null,
5446
5446
  cleanups: null,
5447
5447
  context: i ? i.context : null,
5448
5448
  owner: i
5449
- }, o = a ? e : () => e(() => Pe(() => qt(l)));
5449
+ }, o = a ? e : () => e(() => _e(() => qt(l)));
5450
5450
  J = l, ae = null;
5451
5451
  try {
5452
5452
  return We(o, !0);
@@ -5520,10 +5520,10 @@ function uc(e, t, n) {
5520
5520
  h = !1;
5521
5521
  const q = d ? d() : s;
5522
5522
  if (q == null || q === !1) {
5523
- T(l, Pe(y));
5523
+ T(l, _e(y));
5524
5524
  return;
5525
5525
  }
5526
- const A = o !== Kn ? o : Pe(
5526
+ const A = o !== Kn ? o : _e(
5527
5527
  () => a(q, {
5528
5528
  value: y(),
5529
5529
  refetching: k
@@ -5570,7 +5570,7 @@ function uc(e, t, n) {
5570
5570
  function Ju(e) {
5571
5571
  return We(e, !1);
5572
5572
  }
5573
- function Pe(e) {
5573
+ function _e(e) {
5574
5574
  if (ae === null)
5575
5575
  return e();
5576
5576
  const t = ae;
@@ -5594,12 +5594,12 @@ function ed(e, t, n) {
5594
5594
  o = e();
5595
5595
  if (i)
5596
5596
  return i = !1, l;
5597
- const c = Pe(() => t(o, a, l));
5597
+ const c = _e(() => t(o, a, l));
5598
5598
  return a = o, c;
5599
5599
  };
5600
5600
  }
5601
5601
  function dc(e) {
5602
- Zr(() => Pe(e));
5602
+ Zr(() => _e(e));
5603
5603
  }
5604
5604
  function Ft(e) {
5605
5605
  return J === null || (J.cleanups === null ? J.cleanups = [e] : J.cleanups.push(e)), e;
@@ -5655,8 +5655,8 @@ function ea() {
5655
5655
  if (this.state === nt)
5656
5656
  Lt(this);
5657
5657
  else {
5658
- const e = _e;
5659
- _e = null, We(() => kn(this), !1), _e = e;
5658
+ const e = Ie;
5659
+ Ie = null, We(() => kn(this), !1), Ie = e;
5660
5660
  }
5661
5661
  if (ae) {
5662
5662
  const e = this.observers ? this.observers.length : 0;
@@ -5669,10 +5669,10 @@ function ta(e, t, n) {
5669
5669
  return (!e.comparator || !e.comparator(s, t)) && (e.value = t, e.observers && e.observers.length && We(() => {
5670
5670
  for (let a = 0; a < e.observers.length; a += 1) {
5671
5671
  const i = e.observers[a], l = Vn && Vn.running;
5672
- l && Vn.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? _e.push(i) : Je.push(i), i.observers && sa(i)), l || (i.state = nt);
5672
+ l && Vn.disposed.has(i), (l ? !i.tState : !i.state) && (i.pure ? Ie.push(i) : Je.push(i), i.observers && sa(i)), l || (i.state = nt);
5673
5673
  }
5674
- if (_e.length > 1e6)
5675
- throw _e = [], new Error();
5674
+ if (Ie.length > 1e6)
5675
+ throw Ie = [], new Error();
5676
5676
  }, !1)), t;
5677
5677
  }
5678
5678
  function Lt(e) {
@@ -5720,7 +5720,7 @@ function In(e) {
5720
5720
  return;
5721
5721
  if (e.state === _n)
5722
5722
  return kn(e);
5723
- if (e.suspense && Pe(e.suspense.inFallback))
5723
+ if (e.suspense && _e(e.suspense.inFallback))
5724
5724
  return e.suspense.effects.push(e);
5725
5725
  const t = [e];
5726
5726
  for (; (e = e.owner) && (!e.updatedAt || e.updatedAt < On); )
@@ -5729,24 +5729,24 @@ function In(e) {
5729
5729
  if (e = t[n], e.state === nt)
5730
5730
  Lt(e);
5731
5731
  else if (e.state === _n) {
5732
- const s = _e;
5733
- _e = null, We(() => kn(e, t[0]), !1), _e = s;
5732
+ const s = Ie;
5733
+ Ie = null, We(() => kn(e, t[0]), !1), Ie = s;
5734
5734
  }
5735
5735
  }
5736
5736
  function We(e, t) {
5737
- if (_e)
5737
+ if (Ie)
5738
5738
  return e();
5739
5739
  let n = !1;
5740
- t || (_e = []), Je ? n = !0 : Je = [], On++;
5740
+ t || (Ie = []), Je ? n = !0 : Je = [], On++;
5741
5741
  try {
5742
5742
  const s = e();
5743
5743
  return yc(n), s;
5744
5744
  } catch (s) {
5745
- n || (Je = null), _e = null, Ts(s);
5745
+ n || (Je = null), Ie = null, Ts(s);
5746
5746
  }
5747
5747
  }
5748
5748
  function yc(e) {
5749
- if (_e && (na(_e), _e = null), e)
5749
+ if (Ie && (na(Ie), Ie = null), e)
5750
5750
  return;
5751
5751
  const t = Je;
5752
5752
  Je = null, t.length && We(() => Qr(t), !1);
@@ -5784,7 +5784,7 @@ function kn(e, t) {
5784
5784
  function sa(e) {
5785
5785
  for (let t = 0; t < e.observers.length; t += 1) {
5786
5786
  const n = e.observers[t];
5787
- n.state || (n.state = _n, n.pure ? _e.push(n) : Je.push(n), n.observers && sa(n));
5787
+ n.state || (n.state = _n, n.pure ? Ie.push(n) : Je.push(n), n.observers && sa(n));
5788
5788
  }
5789
5789
  }
5790
5790
  function qt(e) {
@@ -5839,7 +5839,7 @@ function Ec(e, t) {
5839
5839
  return function(s) {
5840
5840
  let a;
5841
5841
  return ct(
5842
- () => a = Pe(() => (J.context = {
5842
+ () => a = _e(() => (J.context = {
5843
5843
  ...J.context,
5844
5844
  [e]: s.value
5845
5845
  }, Jr(() => s.children))),
@@ -5856,7 +5856,7 @@ function bc(e, t, n = {}) {
5856
5856
  let s = [], a = [], i = [], l = 0, o = t.length > 1 ? [] : null;
5857
5857
  return Ft(() => Ln(i)), () => {
5858
5858
  let c = e() || [], h = c.length, g, d;
5859
- return c[Yr], Pe(() => {
5859
+ return c[Yr], _e(() => {
5860
5860
  let y, p, S, v, x, U, b, w, T;
5861
5861
  if (h === 0)
5862
5862
  l !== 0 && (Ln(i), i = [], s = [], a = [], l = 0, o && (o = [])), n.fallback && (s = [Xn], a[0] = ot((D) => (i[0] = D, n.fallback())), l = 1);
@@ -5892,7 +5892,7 @@ function wc(e, t, n = {}) {
5892
5892
  let s = [], a = [], i = [], l = [], o = 0, c;
5893
5893
  return Ft(() => Ln(i)), () => {
5894
5894
  const h = e() || [], g = h.length;
5895
- return h[Yr], Pe(() => {
5895
+ return h[Yr], _e(() => {
5896
5896
  if (g === 0)
5897
5897
  return o !== 0 && (Ln(i), i = [], s = [], a = [], o = 0, l = []), n.fallback && (s = [Xn], a[0] = ot((E) => (i[0] = E, n.fallback())), o = 1), a;
5898
5898
  for (s[0] === Xn && (i[0](), i = [], s = [], a = [], o = 0), c = 0; c < g; c++)
@@ -5909,7 +5909,7 @@ function wc(e, t, n = {}) {
5909
5909
  };
5910
5910
  }
5911
5911
  function ra(e, t) {
5912
- return Pe(() => e(t || {}));
5912
+ return _e(() => e(t || {}));
5913
5913
  }
5914
5914
  function vn() {
5915
5915
  return !0;
@@ -6067,7 +6067,7 @@ function ia(e) {
6067
6067
  }
6068
6068
  let l;
6069
6069
  return Ge(
6070
- () => (l = t()) ? Pe(() => {
6070
+ () => (l = t()) ? _e(() => {
6071
6071
  if (!i || O.done)
6072
6072
  return l(a);
6073
6073
  const o = O.context;
@@ -6105,10 +6105,10 @@ function od(e) {
6105
6105
  const s = n();
6106
6106
  if (s) {
6107
6107
  const a = e.children;
6108
- return typeof a == "function" && a.length > 0 ? Pe(
6108
+ return typeof a == "function" && a.length > 0 ? _e(
6109
6109
  () => a(
6110
6110
  t ? s : () => {
6111
- if (!Pe(n))
6111
+ if (!_e(n))
6112
6112
  throw la("Show");
6113
6113
  return e.when;
6114
6114
  }
@@ -6145,10 +6145,10 @@ function cd(e) {
6145
6145
  if (i < 0)
6146
6146
  return e.fallback;
6147
6147
  const c = o.children;
6148
- return typeof c == "function" && c.length > 0 ? Pe(
6148
+ return typeof c == "function" && c.length > 0 ? _e(
6149
6149
  () => c(
6150
6150
  t ? l : () => {
6151
- if (Pe(a)[0] !== i)
6151
+ if (_e(a)[0] !== i)
6152
6152
  throw la("Match");
6153
6153
  return o.when;
6154
6154
  }
@@ -6470,7 +6470,7 @@ function Hc(e, t = {}, n, s) {
6470
6470
  ), ct(() => typeof t.ref == "function" && Kc(t.ref, e)), ct(() => Vc(e, t, n, !0, a, !0)), a;
6471
6471
  }
6472
6472
  function Kc(e, t, n) {
6473
- return Pe(() => e(t, n));
6473
+ return _e(() => e(t, n));
6474
6474
  }
6475
6475
  function es(e, t, n, s) {
6476
6476
  if (n !== void 0 && !s && (s = []), typeof t != "function")
@@ -6746,7 +6746,7 @@ function fd(e) {
6746
6746
  const a = s();
6747
6747
  switch (typeof a) {
6748
6748
  case "function":
6749
- return Pe(() => a(n));
6749
+ return _e(() => a(n));
6750
6750
  case "string":
6751
6751
  const i = Lc.has(a), l = O.context ? jc() : ua(a, i);
6752
6752
  return Hc(l, n, i), l;
@@ -7414,7 +7414,7 @@ var wd = (e, t = !1) => {
7414
7414
  const t = oa(() => {
7415
7415
  const n = this, [s] = R(this, yt), [a] = R(this, vt), [i] = R(this, Et), [l] = R(this, bt), [o] = R(this, gt);
7416
7416
  let c;
7417
- return R(this, wt) ? c = R(this, wt) : (c = ia(() => import("./HO4MOOFI-xwFJgXgx.js")), te(this, wt, c)), Ca(R(this, Yt), R(this, pt)), ra(c, aa({
7417
+ return R(this, wt) ? c = R(this, wt) : (c = ia(() => import("./HO4MOOFI-ReftF839.js")), te(this, wt, c)), Ca(R(this, Yt), R(this, pt)), ra(c, aa({
7418
7418
  get queryFlavor() {
7419
7419
  return R(n, zt);
7420
7420
  },
@@ -7508,7 +7508,7 @@ var wd = (e, t = !1) => {
7508
7508
  const t = oa(() => {
7509
7509
  const n = this, [s] = R(this, At), [a] = R(this, xt), [i] = R(this, Tt), [l] = R(this, Ct), [o] = R(this, St), [c] = R(this, Pt);
7510
7510
  let h;
7511
- return R(this, _t) ? h = R(this, _t) : (h = ia(() => import("./HUY7CZI3-DTaJjjSa.js")), te(this, _t, h)), Ca(R(this, en), R(this, Nt)), ra(h, aa({
7511
+ return R(this, _t) ? h = R(this, _t) : (h = ia(() => import("./HUY7CZI3-DKB5lU_R.js")), te(this, _t, h)), Ca(R(this, en), R(this, Nt)), ra(h, aa({
7512
7512
  get queryFlavor() {
7513
7513
  return R(n, Zt);
7514
7514
  },
@@ -7626,7 +7626,7 @@ var Lu = process.env.NODE_ENV !== "development" ? function() {
7626
7626
  } : Iu;
7627
7627
  process.env.NODE_ENV;
7628
7628
  const Du = Za(
7629
- () => import("./digital-asset-manager-2IyrrYZ6.js")
7629
+ () => import("./digital-asset-manager-DePlpEGM.js")
7630
7630
  );
7631
7631
  hl();
7632
7632
  nc();
@@ -7656,7 +7656,7 @@ const Gu = (e) => {
7656
7656
  const A = Y(() => {
7657
7657
  const W = {};
7658
7658
  return l && (W.permissions = ne(l, "permissions", null), W.role = ne(l, "role", "user")), W;
7659
- }, [l]), M = Y(() => o, [o]), se = Ie(
7659
+ }, [l]), M = Y(() => o, [o]), se = Pe(
7660
7660
  async (W, he) => await D({ pageType: W, query: he }),
7661
7661
  [D]
7662
7662
  ), fe = Y(
@@ -7753,7 +7753,7 @@ export {
7753
7753
  Ju as B,
7754
7754
  hd as C,
7755
7755
  fd as D,
7756
- Pe as E,
7756
+ _e as E,
7757
7757
  id as F,
7758
7758
  oc as G,
7759
7759
  Au as H,