@tarot-ai/pixel 0.0.1 → 0.0.2

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.
@@ -4,9 +4,10 @@
4
4
  <meta charset="UTF-8" />
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
6
6
  <meta name="color-scheme" content="light" />
7
- <title>My designs</title>
8
- <script type="module" crossorigin src="/view-assets/index-HhBbdUtL.js"></script>
9
- <link rel="stylesheet" crossorigin href="/view-assets/index-2FCV4zqI.css">
7
+ <link rel="icon" type="image/png" href="/view-assets/favicon-CTAWt-LP.png" />
8
+ <title>Tarot Pixel</title>
9
+ <script type="module" crossorigin src="/view-assets/index-CMO4vRwl.js"></script>
10
+ <link rel="stylesheet" crossorigin href="/view-assets/index-CfsmYNhW.css">
10
11
  </head>
11
12
  <body>
12
13
  <div id="app"></div>
@@ -0,0 +1,21 @@
1
+ import{c as fe,r as m,e as k,a as H,l as Qe,g as Ve,d as Xe,D as Ee,t as ee,u as q,j as n,b as W,C as Be,P as Oe,R as Ye,T as We,f as Je,h as Ze,E as Ge,i as et,k as tt,X as Ce,m as nt,S as st,w as Te}from"./index-CMO4vRwl.js";/**
2
+ * @license lucide-react v0.560.0 - ISC
3
+ *
4
+ * This source code is licensed under the ISC license.
5
+ * See the LICENSE file in the root directory of this source tree.
6
+ */const ot=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],rt=fe("chevron-left",ot);/**
7
+ * @license lucide-react v0.560.0 - ISC
8
+ *
9
+ * This source code is licensed under the ISC license.
10
+ * See the LICENSE file in the root directory of this source tree.
11
+ */const at=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],it=fe("history",at);/**
12
+ * @license lucide-react v0.560.0 - ISC
13
+ *
14
+ * This source code is licensed under the ISC license.
15
+ * See the LICENSE file in the root directory of this source tree.
16
+ */const lt=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],ct=fe("link-2",lt);/**
17
+ * @license lucide-react v0.560.0 - ISC
18
+ *
19
+ * This source code is licensed under the ISC license.
20
+ * See the LICENSE file in the root directory of this source tree.
21
+ */const dt=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],ut=fe("trash-2",dt),se=e=>typeof e=="number"&&!isNaN(e),Y=e=>typeof e=="string",$=e=>typeof e=="function",ce=e=>Y(e)||$(e)?e:null,we=e=>m.isValidElement(e)||Y(e)||$(e)||se(e);function ft(e,t,s){s===void 0&&(s=300);const{scrollHeight:o,style:r}=e;requestAnimationFrame(()=>{r.minHeight="initial",r.height=o+"px",r.transition=`all ${s}ms`,requestAnimationFrame(()=>{r.height="0",r.padding="0",r.margin="0",setTimeout(t,s)})})}function pe(e){let{enter:t,exit:s,appendPosition:o=!1,collapse:r=!0,collapseDuration:i=300}=e;return function(a){let{children:c,position:l,preventExitTransition:u,done:d,nodeRef:y,isIn:x,playToast:f}=a;const v=o?`${t}--${l}`:t,w=o?`${s}--${l}`:s,p=m.useRef(0);return m.useLayoutEffect(()=>{const j=y.current,N=v.split(" "),h=I=>{I.target===y.current&&(f(),j.removeEventListener("animationend",h),j.removeEventListener("animationcancel",h),p.current===0&&I.type!=="animationcancel"&&j.classList.remove(...N))};j.classList.add(...N),j.addEventListener("animationend",h),j.addEventListener("animationcancel",h)},[]),m.useEffect(()=>{const j=y.current,N=()=>{j.removeEventListener("animationend",N),r?ft(j,d,i):d()};x||(u?N():(p.current=1,j.className+=` ${w}`,j.addEventListener("animationend",N)))},[x]),k.createElement(k.Fragment,null,c)}}function ke(e,t){return e!=null?{content:e.content,containerId:e.props.containerId,id:e.props.toastId,theme:e.props.theme,type:e.props.type,data:e.props.data||{},isLoading:e.props.isLoading,icon:e.props.icon,status:t}:{}}const M=new Map;let oe=[];const Ne=new Set,pt=e=>Ne.forEach(t=>t(e)),Ue=()=>M.size>0;function ze(e,t){var s;if(t)return!((s=M.get(t))==null||!s.isToastActive(e));let o=!1;return M.forEach(r=>{r.isToastActive(e)&&(o=!0)}),o}function Ke(e,t){we(e)&&(Ue()||oe.push({content:e,options:t}),M.forEach(s=>{s.buildToast(e,t)}))}function _e(e,t){M.forEach(s=>{t!=null&&t!=null&&t.containerId?(t==null?void 0:t.containerId)===s.id&&s.toggle(e,t==null?void 0:t.id):s.toggle(e,t==null?void 0:t.id)})}function mt(e){const{subscribe:t,getSnapshot:s,setProps:o}=m.useRef((function(i){const a=i.containerId||1;return{subscribe(c){const l=(function(d,y,x){let f=1,v=0,w=[],p=[],j=[],N=y;const h=new Map,I=new Set,C=()=>{j=Array.from(h.values()),I.forEach(g=>g())},A=g=>{p=g==null?[]:p.filter(T=>T!==g),C()},_=g=>{const{toastId:T,onOpen:L,updateId:P,children:b}=g.props,S=P==null;g.staleId&&h.delete(g.staleId),h.set(T,g),p=[...p,g.props.toastId].filter(D=>D!==g.staleId),C(),x(ke(g,S?"added":"updated")),S&&$(L)&&L(m.isValidElement(b)&&b.props)};return{id:d,props:N,observe:g=>(I.add(g),()=>I.delete(g)),toggle:(g,T)=>{h.forEach(L=>{T!=null&&T!==L.props.toastId||$(L.toggle)&&L.toggle(g)})},removeToast:A,toasts:h,clearQueue:()=>{v-=w.length,w=[]},buildToast:(g,T)=>{if((O=>{let{containerId:R,toastId:B,updateId:U}=O;const V=R?R!==d:d!==1,te=h.has(B)&&U==null;return V||te})(T))return;const{toastId:L,updateId:P,data:b,staleId:S,delay:D}=T,K=()=>{A(L)},J=P==null;J&&v++;const z={...N,style:N.toastStyle,key:f++,...Object.fromEntries(Object.entries(T).filter(O=>{let[R,B]=O;return B!=null})),toastId:L,updateId:P,data:b,closeToast:K,isIn:!1,className:ce(T.className||N.toastClassName),bodyClassName:ce(T.bodyClassName||N.bodyClassName),progressClassName:ce(T.progressClassName||N.progressClassName),autoClose:!T.isLoading&&(F=T.autoClose,Z=N.autoClose,F===!1||se(F)&&F>0?F:Z),deleteToast(){const O=h.get(L),{onClose:R,children:B}=O.props;$(R)&&R(m.isValidElement(B)&&B.props),x(ke(O,"removed")),h.delete(L),v--,v<0&&(v=0),w.length>0?_(w.shift()):C()}};var F,Z;z.closeButton=N.closeButton,T.closeButton===!1||we(T.closeButton)?z.closeButton=T.closeButton:T.closeButton===!0&&(z.closeButton=!we(N.closeButton)||N.closeButton);let G=g;m.isValidElement(g)&&!Y(g.type)?G=m.cloneElement(g,{closeToast:K,toastProps:z,data:b}):$(g)&&(G=g({closeToast:K,toastProps:z,data:b}));const Q={content:G,props:z,staleId:S};N.limit&&N.limit>0&&v>N.limit&&J?w.push(Q):se(D)?setTimeout(()=>{_(Q)},D):_(Q)},setProps(g){N=g},setToggle:(g,T)=>{h.get(g).toggle=T},isToastActive:g=>p.some(T=>T===g),getSnapshot:()=>j}})(a,i,pt);M.set(a,l);const u=l.observe(c);return oe.forEach(d=>Ke(d.content,d.options)),oe=[],()=>{u(),M.delete(a)}},setProps(c){var l;(l=M.get(a))==null||l.setProps(c)},getSnapshot(){var c;return(c=M.get(a))==null?void 0:c.getSnapshot()}}})(e)).current;o(e);const r=m.useSyncExternalStore(t,s,s);return{getToastToRender:function(i){if(!r)return[];const a=new Map;return e.newestOnTop&&r.reverse(),r.forEach(c=>{const{position:l}=c.props;a.has(l)||a.set(l,[]),a.get(l).push(c)}),Array.from(a,c=>i(c[0],c[1]))},isToastActive:ze,count:r==null?void 0:r.length}}function ht(e){const[t,s]=m.useState(!1),[o,r]=m.useState(!1),i=m.useRef(null),a=m.useRef({start:0,delta:0,removalDistance:0,canCloseOnClick:!0,canDrag:!1,didMove:!1}).current,{autoClose:c,pauseOnHover:l,closeToast:u,onClick:d,closeOnClick:y}=e;var x,f;function v(){s(!0)}function w(){s(!1)}function p(h){const I=i.current;a.canDrag&&I&&(a.didMove=!0,t&&w(),a.delta=e.draggableDirection==="x"?h.clientX-a.start:h.clientY-a.start,a.start!==h.clientX&&(a.canCloseOnClick=!1),I.style.transform=`translate3d(${e.draggableDirection==="x"?`${a.delta}px, var(--y)`:`0, calc(${a.delta}px + var(--y))`},0)`,I.style.opacity=""+(1-Math.abs(a.delta/a.removalDistance)))}function j(){document.removeEventListener("pointermove",p),document.removeEventListener("pointerup",j);const h=i.current;if(a.canDrag&&a.didMove&&h){if(a.canDrag=!1,Math.abs(a.delta)>a.removalDistance)return r(!0),e.closeToast(),void e.collapseAll();h.style.transition="transform 0.2s, opacity 0.2s",h.style.removeProperty("transform"),h.style.removeProperty("opacity")}}(f=M.get((x={id:e.toastId,containerId:e.containerId,fn:s}).containerId||1))==null||f.setToggle(x.id,x.fn),m.useEffect(()=>{if(e.pauseOnFocusLoss)return document.hasFocus()||w(),window.addEventListener("focus",v),window.addEventListener("blur",w),()=>{window.removeEventListener("focus",v),window.removeEventListener("blur",w)}},[e.pauseOnFocusLoss]);const N={onPointerDown:function(h){if(e.draggable===!0||e.draggable===h.pointerType){a.didMove=!1,document.addEventListener("pointermove",p),document.addEventListener("pointerup",j);const I=i.current;a.canCloseOnClick=!0,a.canDrag=!0,I.style.transition="none",e.draggableDirection==="x"?(a.start=h.clientX,a.removalDistance=I.offsetWidth*(e.draggablePercent/100)):(a.start=h.clientY,a.removalDistance=I.offsetHeight*(e.draggablePercent===80?1.5*e.draggablePercent:e.draggablePercent)/100)}},onPointerUp:function(h){const{top:I,bottom:C,left:A,right:_}=i.current.getBoundingClientRect();h.nativeEvent.type!=="touchend"&&e.pauseOnHover&&h.clientX>=A&&h.clientX<=_&&h.clientY>=I&&h.clientY<=C?w():v()}};return c&&l&&(N.onMouseEnter=w,e.stacked||(N.onMouseLeave=v)),y&&(N.onClick=h=>{d&&d(h),a.canCloseOnClick&&u()}),{playToast:v,pauseToast:w,isRunning:t,preventExitTransition:o,toastRef:i,eventHandlers:N}}function xt(e){let{delay:t,isRunning:s,closeToast:o,type:r="default",hide:i,className:a,style:c,controlledProgress:l,progress:u,rtl:d,isIn:y,theme:x}=e;const f=i||l&&u===0,v={...c,animationDuration:`${t}ms`,animationPlayState:s?"running":"paused"};l&&(v.transform=`scaleX(${u})`);const w=H("Toastify__progress-bar",l?"Toastify__progress-bar--controlled":"Toastify__progress-bar--animated",`Toastify__progress-bar-theme--${x}`,`Toastify__progress-bar--${r}`,{"Toastify__progress-bar--rtl":d}),p=$(a)?a({rtl:d,type:r,defaultClassName:w}):H(w,a),j={[l&&u>=1?"onTransitionEnd":"onAnimationEnd"]:l&&u<1?null:()=>{y&&o()}};return k.createElement("div",{className:"Toastify__progress-bar--wrp","data-hidden":f},k.createElement("div",{className:`Toastify__progress-bar--bg Toastify__progress-bar-theme--${x} Toastify__progress-bar--${r}`}),k.createElement("div",{role:"progressbar","aria-hidden":f?"true":"false","aria-label":"notification timer",className:p,style:v,...j}))}let gt=1;const Fe=()=>""+gt++;function bt(e){return e&&(Y(e.toastId)||se(e.toastId))?e.toastId:Fe()}function ne(e,t){return Ke(e,t),t.toastId}function de(e,t){return{...t,type:t&&t.type||e,toastId:bt(t)}}function ae(e){return(t,s)=>ne(t,de(e,s))}function E(e,t){return ne(e,de("default",t))}E.loading=(e,t)=>ne(e,de("default",{isLoading:!0,autoClose:!1,closeOnClick:!1,closeButton:!1,draggable:!1,...t})),E.promise=function(e,t,s){let o,{pending:r,error:i,success:a}=t;r&&(o=Y(r)?E.loading(r,s):E.loading(r.render,{...s,...r}));const c={isLoading:null,autoClose:null,closeOnClick:null,closeButton:null,draggable:null},l=(d,y,x)=>{if(y==null)return void E.dismiss(o);const f={type:d,...c,...s,data:x},v=Y(y)?{render:y}:y;return o?E.update(o,{...f,...v}):E(v.render,{...f,...v}),x},u=$(e)?e():e;return u.then(d=>l("success",a,d)).catch(d=>l("error",i,d)),u},E.success=ae("success"),E.info=ae("info"),E.error=ae("error"),E.warning=ae("warning"),E.warn=E.warning,E.dark=(e,t)=>ne(e,de("default",{theme:"dark",...t})),E.dismiss=function(e){(function(t){var s;if(Ue()){if(t==null||Y(s=t)||se(s))M.forEach(o=>{o.removeToast(t)});else if(t&&("containerId"in t||"id"in t)){const o=M.get(t.containerId);o?o.removeToast(t.id):M.forEach(r=>{r.removeToast(t.id)})}}else oe=oe.filter(o=>t!=null&&o.options.toastId!==t)})(e)},E.clearWaitingQueue=function(e){e===void 0&&(e={}),M.forEach(t=>{!t.props.limit||e.containerId&&t.id!==e.containerId||t.clearQueue()})},E.isActive=ze,E.update=function(e,t){t===void 0&&(t={});const s=((o,r)=>{var i;let{containerId:a}=r;return(i=M.get(a||1))==null?void 0:i.toasts.get(o)})(e,t);if(s){const{props:o,content:r}=s,i={delay:100,...o,...t,toastId:t.toastId||e,updateId:Fe()};i.toastId!==e&&(i.staleId=e);const a=i.render||r;delete i.render,ne(a,i)}},E.done=e=>{E.update(e,{progress:1})},E.onChange=function(e){return Ne.add(e),()=>{Ne.delete(e)}},E.play=e=>_e(!0,e),E.pause=e=>_e(!1,e);const yt=typeof window<"u"?m.useLayoutEffect:m.useEffect,ie=e=>{let{theme:t,type:s,isLoading:o,...r}=e;return k.createElement("svg",{viewBox:"0 0 24 24",width:"100%",height:"100%",fill:t==="colored"?"currentColor":`var(--toastify-icon-color-${s})`,...r})},he={info:function(e){return k.createElement(ie,{...e},k.createElement("path",{d:"M12 0a12 12 0 1012 12A12.013 12.013 0 0012 0zm.25 5a1.5 1.5 0 11-1.5 1.5 1.5 1.5 0 011.5-1.5zm2.25 13.5h-4a1 1 0 010-2h.75a.25.25 0 00.25-.25v-4.5a.25.25 0 00-.25-.25h-.75a1 1 0 010-2h1a2 2 0 012 2v4.75a.25.25 0 00.25.25h.75a1 1 0 110 2z"}))},warning:function(e){return k.createElement(ie,{...e},k.createElement("path",{d:"M23.32 17.191L15.438 2.184C14.728.833 13.416 0 11.996 0c-1.42 0-2.733.833-3.443 2.184L.533 17.448a4.744 4.744 0 000 4.368C1.243 23.167 2.555 24 3.975 24h16.05C22.22 24 24 22.044 24 19.632c0-.904-.251-1.746-.68-2.44zm-9.622 1.46c0 1.033-.724 1.823-1.698 1.823s-1.698-.79-1.698-1.822v-.043c0-1.028.724-1.822 1.698-1.822s1.698.79 1.698 1.822v.043zm.039-12.285l-.84 8.06c-.057.581-.408.943-.897.943-.49 0-.84-.367-.896-.942l-.84-8.065c-.057-.624.25-1.095.779-1.095h1.91c.528.005.84.476.784 1.1z"}))},success:function(e){return k.createElement(ie,{...e},k.createElement("path",{d:"M12 0a12 12 0 1012 12A12.014 12.014 0 0012 0zm6.927 8.2l-6.845 9.289a1.011 1.011 0 01-1.43.188l-4.888-3.908a1 1 0 111.25-1.562l4.076 3.261 6.227-8.451a1 1 0 111.61 1.183z"}))},error:function(e){return k.createElement(ie,{...e},k.createElement("path",{d:"M11.983 0a12.206 12.206 0 00-8.51 3.653A11.8 11.8 0 000 12.207 11.779 11.779 0 0011.8 24h.214A12.111 12.111 0 0024 11.791 11.766 11.766 0 0011.983 0zM10.5 16.542a1.476 1.476 0 011.449-1.53h.027a1.527 1.527 0 011.523 1.47 1.475 1.475 0 01-1.449 1.53h-.027a1.529 1.529 0 01-1.523-1.47zM11 12.5v-6a1 1 0 012 0v6a1 1 0 11-2 0z"}))},spinner:function(){return k.createElement("div",{className:"Toastify__spinner"})}},vt=e=>{const{isRunning:t,preventExitTransition:s,toastRef:o,eventHandlers:r,playToast:i}=ht(e),{closeButton:a,children:c,autoClose:l,onClick:u,type:d,hideProgressBar:y,closeToast:x,transition:f,position:v,className:w,style:p,bodyClassName:j,bodyStyle:N,progressClassName:h,progressStyle:I,updateId:C,role:A,progress:_,rtl:g,toastId:T,deleteToast:L,isIn:P,isLoading:b,closeOnClick:S,theme:D}=e,K=H("Toastify__toast",`Toastify__toast-theme--${D}`,`Toastify__toast--${d}`,{"Toastify__toast--rtl":g},{"Toastify__toast--close-on-click":S}),J=$(w)?w({rtl:g,position:v,type:d,defaultClassName:K}):H(K,w),z=(function(Q){let{theme:O,type:R,isLoading:B,icon:U}=Q,V=null;const te={theme:O,type:R};return U===!1||($(U)?V=U({...te,isLoading:B}):m.isValidElement(U)?V=m.cloneElement(U,te):B?V=he.spinner():(qe=>qe in he)(R)&&(V=he[R](te))),V})(e),F=!!_||!l,Z={closeToast:x,type:d,theme:D};let G=null;return a===!1||(G=$(a)?a(Z):m.isValidElement(a)?m.cloneElement(a,Z):(function(Q){let{closeToast:O,theme:R,ariaLabel:B="close"}=Q;return k.createElement("button",{className:`Toastify__close-button Toastify__close-button--${R}`,type:"button",onClick:U=>{U.stopPropagation(),O(U)},"aria-label":B},k.createElement("svg",{"aria-hidden":"true",viewBox:"0 0 14 16"},k.createElement("path",{fillRule:"evenodd",d:"M7.71 8.23l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75L1 11.98l3.75-3.75L1 4.48 2.48 3l3.75 3.75L9.98 3l1.48 1.48-3.75 3.75z"})))})(Z)),k.createElement(f,{isIn:P,done:L,position:v,preventExitTransition:s,nodeRef:o,playToast:i},k.createElement("div",{id:T,onClick:u,"data-in":P,className:J,...r,style:p,ref:o},k.createElement("div",{...P&&{role:A},className:$(j)?j({type:d}):H("Toastify__toast-body",j),style:N},z!=null&&k.createElement("div",{className:H("Toastify__toast-icon",{"Toastify--animate-icon Toastify__zoom-enter":!b})},z),k.createElement("div",null,c)),G,k.createElement(xt,{...C&&!F?{key:`pb-${C}`}:{},rtl:g,theme:D,delay:l,isRunning:t,isIn:P,closeToast:x,hide:y,type:d,style:I,className:h,controlledProgress:F,progress:_||0})))},me=function(e,t){return t===void 0&&(t=!1),{enter:`Toastify--animate Toastify__${e}-enter`,exit:`Toastify--animate Toastify__${e}-exit`,appendPosition:t}},wt=pe(me("bounce",!0));pe(me("slide",!0));pe(me("zoom"));pe(me("flip"));const Nt={position:"top-right",transition:wt,autoClose:5e3,closeButton:!0,pauseOnHover:!0,pauseOnFocusLoss:!0,draggable:"touch",draggablePercent:80,draggableDirection:"x",role:"alert",theme:"light"};function jt(e){let t={...Nt,...e};const s=e.stacked,[o,r]=m.useState(!0),i=m.useRef(null),{getToastToRender:a,isToastActive:c,count:l}=mt(t),{className:u,style:d,rtl:y,containerId:x}=t;function f(w){const p=H("Toastify__toast-container",`Toastify__toast-container--${w}`,{"Toastify__toast-container--rtl":y});return $(u)?u({position:w,rtl:y,defaultClassName:p}):H(p,ce(u))}function v(){s&&(r(!0),E.play())}return yt(()=>{if(s){var w;const p=i.current.querySelectorAll('[data-in="true"]'),j=12,N=(w=t.position)==null?void 0:w.includes("top");let h=0,I=0;Array.from(p).reverse().forEach((C,A)=>{const _=C;_.classList.add("Toastify__toast--stacked"),A>0&&(_.dataset.collapsed=`${o}`),_.dataset.pos||(_.dataset.pos=N?"top":"bot");const g=h*(o?.2:1)+(o?0:j*A);_.style.setProperty("--y",`${N?g:-1*g}px`),_.style.setProperty("--g",`${j}`),_.style.setProperty("--s",""+(1-(o?I:0))),h+=_.offsetHeight,I+=.025})}},[o,l,s]),k.createElement("div",{ref:i,className:"Toastify",id:x,onMouseEnter:()=>{s&&(r(!1),E.pause())},onMouseLeave:v},a((w,p)=>{const j=p.length?{...d}:{...d,pointerEvents:"none"};return k.createElement("div",{className:f(w),style:j,key:`container-${w}`},p.map(N=>{let{content:h,props:I}=N;return k.createElement(vt,{...I,stacked:s,collapseAll:v,isIn:c(I.toastId,I.containerId),style:I.style,key:`toast-${I.key}`},h)}))}))}async function It(e){return(await Qe(e)).map(Tt)}function Et(e,t){return Xe(e,t)}async function Ct(e,t){const s=await Ve(e,t);return{modules:s.modules,exportedAt:s.exportedAt}}function Tt(e){return X(e.designId,"designId"),X(e.fileId,"fileId"),X(e.pageId,"pageId"),X(e.fileName,"fileName"),X(e.pageName,"pageName"),X(e.exportedAt,"exportedAt"),X(e.updatedAt,"updatedAt"),{designId:e.designId,tool:typeof e.tool=="string"?e.tool:"",fileId:e.fileId,pageId:e.pageId,fileName:e.fileName,pageName:e.pageName,version:typeof e.version=="string"?e.version:"",moduleCount:xe(e.modules,"modules"),moduleNames:Array.isArray(e.moduleNames)?e.moduleNames.filter(t=>typeof t=="string"):[],nodeCount:xe(e.nodes,"nodes"),assetCount:xe(e.assets,"assets"),exportedAt:e.exportedAt,createdAt:typeof e.createdAt=="string"&&e.createdAt?e.createdAt:e.exportedAt,updatedAt:e.updatedAt,viewerUrl:typeof e.viewUrl=="string"&&e.viewUrl?e.viewUrl:`/design/${encodeURIComponent(e.designId)}`}}function X(e,t){if(typeof e!="string"||!e)throw new Error(`design_list 返回的 ${t} 不合法`)}function xe(e,t){if(typeof e!="number"||!Number.isSafeInteger(e)||e<0)throw new Error(`design_list 返回的 ${t} 不合法`);return e}const kt={year:"numeric",month:"short",day:"numeric"};function ue(e,t=Ee){const s=new Date(e),o=s.getTime();if(!Number.isFinite(o))return ee(t,"common.unknownTime");const i=new Date().getTime()-o;if(i<0)return Se(s,t);const a=Math.floor(i/6e4),c=Math.floor(i/36e5),l=Math.floor(i/864e5);return a<1?ee(t,"dashboard.time.justNow"):a<60?ge(t,"minute",a):c<24?ge(t,"hour",c):l<30?ge(t,"day",l):Se(s,t)}function re(e,t,s=Ee){return ee(s,`dashboard.count.${t}.${e===1?"one":"other"}`,{count:e})}function je(e,t=Ee){const s=(e.moduleNames??[]).map(a=>a.trim()).filter(Boolean);if(s.length===0)return ee(t,"dashboard.export.unnamed");const o=s.slice(0,2),r=o.join(" / "),i=Math.max(e.moduleCount-o.length,0);return i>0?ee(t,"dashboard.export.titleWithMore",{title:r,restCount:i}):r}function ge(e,t,s){return ee(e,`dashboard.time.${t}.${s===1?"one":"other"}`,{count:s})}function Se(e,t){return new Intl.DateTimeFormat(t,kt).format(e)}function _t(e){const t=new Map;for(const s of e){const o=Lt(s),r=t.get(o);r?r.push(s):t.set(o,[s])}return Array.from(t.entries()).map(([s,o])=>{const r=[...o].sort(Mt),i=r[0];return{sourceKey:s,fileId:i.fileId,pageId:i.pageId,fileName:i.fileName,pageName:i.pageName,latestUpdatedAt:i.updatedAt,exportCount:r.length,exports:r}}).sort((s,o)=>He(s.latestUpdatedAt,o.latestUpdatedAt))}function St(e,t){const s=Ie(t);return s?e.map(o=>{if([o.fileName,o.pageName,o.fileId].map(Ie).some(a=>a.includes(s)))return o;const i=o.exports.filter(a=>At(a).includes(s));return i.length===0?null:{...o,latestUpdatedAt:i[0].updatedAt,exportCount:i.length,exports:i}}).filter(o=>!!o):e}function Lt(e){return e.fileId||e.pageId?`${e.fileId||"unknown-file"}::${e.pageId||"unknown-page"}`:`design::${e.designId}`}function Mt(e,t){return He(e.exportedAt||e.updatedAt||e.createdAt,t.exportedAt||t.updatedAt||t.createdAt)}function He(e,t){return Le(t)-Le(e)}function Le(e){const t=new Date(e).getTime();return Number.isFinite(t)?t:0}function At(e){return Ie([e.fileName,e.pageName,e.version,e.moduleCount,...e.moduleNames??[]].join(" "))}function Ie(e){return String(e??"").trim().toLowerCase()}function Dt(e,t){const s=m.useMemo(Pt,[]),o=m.useRef(!1),[r,i]=m.useState(s.sourceKey),[a,c]=m.useState(s.designId),[l,u]=m.useState(s.query),[d,y]=m.useState(s.query),x=m.useMemo(()=>_t(e),[e]),f=m.useMemo(()=>St(x,d),[x,d]);m.useEffect(()=>{if(t)return;if(f.length===0){r&&i(null),a&&c(null);return}const C=$t(f,r,a);C.sourceKey!==r&&i(C.sourceKey),C.designId!==a&&c(C.designId)},[f,t,a,r]);const v=m.useMemo(()=>f.find(C=>C.sourceKey===r)??null,[f,r]),w=m.useMemo(()=>(v==null?void 0:v.exports.find(C=>C.designId===a))??null,[v,a]);return m.useEffect(()=>{t||Rt(r,a,d)},[t,d,a,r]),{allGroups:x,groups:f,selectedSourceKey:r,selectedDesignId:a,selectedGroup:v,selectedDesign:w,searchInput:l,setSelectedDesignId:c,selectSource:C=>{i(C),c(null)},changeSearch:C=>{u(C),o.current||y(C)},startSearchComposition:()=>{o.current=!0},endSearchComposition:C=>{o.current=!1;const A=C.currentTarget.value;u(A),y(A)},clearSearch:()=>{o.current=!1,u(""),y("")}}}function $t(e,t,s){var r;if(s){const i=e.find(a=>a.exports.some(c=>c.designId===s));if(i)return{sourceKey:i.sourceKey,designId:s}}const o=e.find(i=>i.sourceKey===t)??e[0];return{sourceKey:o.sourceKey,designId:((r=o.exports[0])==null?void 0:r.designId)??null}}function Pt(){if(typeof window>"u")return{sourceKey:null,designId:null,query:""};const e=new URLSearchParams(window.location.search);return{sourceKey:ye(e.get("source")),designId:ye(e.get("designId")),query:ye(e.get("q"))??""}}function Rt(e,t,s){if(typeof window>"u")return;const o=new URL(window.location.href);be(o,"source",e),be(o,"designId",t),be(o,"q",s.trim());const r=`${o.pathname}${o.search}${o.hash}`,i=`${window.location.pathname}${window.location.search}${window.location.hash}`;r!==i&&window.history.replaceState(window.history.state,"",r)}function be(e,t,s){s?e.searchParams.set(t,s):e.searchParams.delete(t)}function ye(e){return(e==null?void 0:e.trim())||null}function Bt({group:e,active:t,onSelect:s}){const{locale:o,t:r}=q();return n.jsx("div",{role:"button",tabIndex:0,"aria-current":t?"true":void 0,className:W("relative flex cursor-pointer items-start gap-2 rounded-md px-3 py-2.5 transition-colors",t?"bg-[#f0f0f0]":"bg-transparent hover:bg-[#f5f5f5]"),onClick:()=>s(e.sourceKey),onKeyDown:i=>{i.key!=="Enter"&&i.key!==" "||(i.preventDefault(),s(e.sourceKey))},children:n.jsxs("div",{className:"min-w-0 flex-1",children:[n.jsx("h3",{className:"m-0 mb-[3px] truncate text-[13px] font-medium text-[#1a1a1a]",children:e.fileName}),n.jsxs("div",{className:"mb-0.5 flex items-center gap-1.5 text-[11px] text-[#666]",children:[n.jsx("span",{className:"min-w-0 truncate",children:e.pageName}),n.jsx("span",{className:"text-[#d4d4d4]",children:"·"}),n.jsxs("span",{className:"inline-flex shrink-0 items-center gap-[3px]",children:[n.jsx(it,{className:"h-2.5 w-2.5"}),re(e.exportCount,"export",o)]})]}),n.jsx("div",{className:"flex min-h-4 items-center gap-2",children:n.jsx("div",{className:"text-[10px] text-[#999]",children:r("dashboard.export.latestAt",{time:ue(e.latestUpdatedAt,o)})})})]})})}function Ot({source:e,selectedDesignId:t,onSelectExport:s,onCopyLink:o,onDeleteExport:r,collapsed:i,onToggleCollapse:a}){const{locale:c,t:l}=q();return i?n.jsxs("aside",{className:"flex h-full w-11 flex-col items-center gap-3 border-r border-[#e5e5e5] bg-white pt-2.5",children:[n.jsx("button",{type:"button",title:l("dashboard.export.expandList"),"aria-label":l("dashboard.export.expandList"),className:"inline-flex h-7 w-7 cursor-pointer items-center justify-center rounded border-0 bg-transparent text-[#666] transition-colors hover:bg-[#f0f0f0] [&_svg]:h-4 [&_svg]:w-4",onClick:a,children:n.jsx(Be,{})}),n.jsx("span",{className:"text-[11px] tracking-normal text-[#999] [writing-mode:vertical-rl]",children:l("dashboard.export.listLabel")})]}):n.jsxs("aside",{className:"relative flex h-full min-w-0 flex-col border-r border-[#e5e5e5] bg-white",children:[n.jsx("button",{type:"button",title:l("dashboard.export.collapseList"),"aria-label":l("dashboard.export.collapseList"),className:"absolute right-[-11px] top-2.5 z-[2] inline-flex h-[22px] w-[22px] cursor-pointer items-center justify-center rounded-full border border-[#e5e5e5] bg-white text-[#666] shadow-[0_1px_4px_rgba(0,0,0,0.04)] transition-colors hover:border-[#d4d4d4] hover:bg-[#f7f7f7] [&_svg]:h-3 [&_svg]:w-3",onClick:a,children:n.jsx(rt,{})}),e?n.jsx("div",{className:"flex flex-1 flex-col gap-1 overflow-y-auto px-2 pb-2 pt-1.5",children:e.exports.map((u,d)=>{const y=u.designId===t,x=je(u,c);return n.jsxs("div",{role:"button",tabIndex:0,"aria-current":y?"true":void 0,className:W("group relative flex cursor-pointer flex-col gap-1 rounded border border-transparent border-b-[#e8e8e8] px-2.5 py-2 transition-colors hover:border-[#e8e8e8] hover:bg-[#f8f8f8] focus-within:border-[#e8e8e8] focus-within:bg-[#f8f8f8]",y&&"bg-[#f5f5f5] hover:bg-[#f5f5f5]"),onClick:()=>s(u.designId),onKeyDown:f=>{f.target===f.currentTarget&&(f.key!=="Enter"&&f.key!==" "||(f.preventDefault(),s(u.designId)))},children:[n.jsxs("div",{className:"flex min-w-0 items-center justify-between gap-2",children:[n.jsx("div",{className:"min-w-0 flex-1 truncate text-xs font-medium text-[#1a1a1a]",children:x}),n.jsxs("div",{className:"flex min-h-[22px] w-12 shrink-0 items-center justify-end",children:[d===0&&n.jsx("span",{className:"h-4 shrink-0 rounded-[3px] bg-[#e7f5ee] px-[5px] text-[10px] leading-4 text-[#087443] group-hover:hidden group-focus-within:hidden",children:l("dashboard.export.latest")}),n.jsxs("div",{className:"hidden shrink-0 items-center gap-0.5 group-hover:flex group-focus-within:flex",onClick:f=>f.stopPropagation(),children:[n.jsx(Me,{ariaLabel:l("dashboard.export.copyLink"),title:l("dashboard.export.copyLink"),onClick:f=>o(u.designId,f),children:n.jsx(ct,{})}),n.jsx(Me,{ariaLabel:l("dashboard.export.delete"),title:l("dashboard.export.delete"),danger:!0,onClick:f=>r(u.designId,f),children:n.jsx(ut,{})})]})]})]}),n.jsx("div",{className:"flex min-h-4 items-center justify-between gap-2",children:n.jsxs("div",{className:"min-w-0 flex-1 truncate text-[10px] text-[#777]",children:[ue(u.exportedAt||u.updatedAt,c)," ·"," ",re(u.moduleCount,"module",c)," · v",u.version||"-"]})})]},u.designId)})}):n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-2.5 bg-white text-[#999]",children:[n.jsx(Oe,{className:"h-[30px] w-[30px] text-[#d4d4d4]"}),n.jsx("p",{className:"m-0 text-xs",children:l("dashboard.export.selectSource")})]})]})}function Me({ariaLabel:e,title:t,danger:s,onClick:o,children:r}){return n.jsx("button",{type:"button","aria-label":e,title:t,className:W("inline-flex h-[22px] w-[22px] cursor-pointer items-center justify-center rounded border-0 bg-transparent transition-colors [&_svg]:h-[13px] [&_svg]:w-[13px]",s?"text-[#ef4444] hover:bg-[#fef2f2]":"text-[#666] hover:bg-[#ececec]"),onClick:o,children:r})}function Ut({mod:e,exportedAt:t,onOpen:s}){var a;const{t:o}=q(),r=(a=e.preview)!=null&&a.url?t?zt(e.preview.url,t):e.preview.url:null,i=n.jsxs("article",{role:"button",tabIndex:0,"aria-label":o("dashboard.module.open",{name:e.name}),className:"cursor-pointer overflow-hidden rounded-lg border border-[#e5e5e5] bg-white transition-[border-color,box-shadow] duration-200 hover:border-[rgba(26,26,26,0.2)] hover:shadow-[0_4px_12px_rgba(0,0,0,0.05)]",onClick:()=>s(e.moduleId),onKeyDown:c=>{c.key!=="Enter"&&c.key!==" "||(c.preventDefault(),s(e.moduleId))},children:[n.jsx("div",{className:"flex h-36 items-center justify-center overflow-hidden border-b border-[rgba(229,229,229,0.5)] bg-[#f5f5f5] sm:h-44",children:r?n.jsx("img",{className:"max-h-28 max-w-28 object-contain sm:max-h-36 sm:max-w-36",src:r,alt:e.name,loading:"lazy",draggable:!1}):n.jsxs("div",{className:"font-mono text-xs text-[rgba(102,102,102,0.3)]",children:[Math.round(e.bbox.width)," × ",Math.round(e.bbox.height)]})}),n.jsx("div",{className:"flex flex-col gap-2 px-3.5 pb-3 pt-2.5",children:n.jsxs("div",{className:"flex items-center justify-between gap-2",children:[n.jsx("h4",{className:"m-0 min-w-0 truncate text-[13px] font-medium text-[#1a1a1a]",children:e.name}),n.jsxs("span",{className:"shrink-0 font-mono text-[10px] text-[#666]",children:[Math.round(e.bbox.width),"×",Math.round(e.bbox.height)]})]})})]});return r?n.jsxs(Ye,{openDelay:300,closeDelay:100,children:[n.jsx(We,{asChild:!0,children:i}),n.jsx(Je,{children:n.jsxs(Ze,{side:"right",align:"start",sideOffset:8,className:"z-50 max-w-[calc(100vw-32px)] rounded-lg border border-[#e5e5e5] bg-white p-1.5 shadow-[0_8px_24px_rgba(0,0,0,0.12)] sm:max-w-[520px]",children:[n.jsx("img",{className:"block max-h-[80vh] max-w-full rounded object-contain sm:max-h-[600px] sm:max-w-[500px]",src:r,alt:e.name,draggable:!1}),n.jsxs("p",{className:"m-0 mt-1 text-center text-[11px] text-[#666]",children:[e.name," — ",Math.round(e.bbox.width)," × ",Math.round(e.bbox.height)]})]})})]}):i}function zt(e,t){const s=e.includes("?")?"&":"?";return`${e}${s}_t=${encodeURIComponent(t)}`}function Ae({selectedDesign:e,onOpenModule:t,showHeader:s=!0}){const{t:o}=q(),[r,i]=m.useState(null),[a,c]=m.useState(!1),[l,u]=m.useState(!1);if(m.useEffect(()=>{if(!e){i(null),u(!1),c(!1);return}const x=new AbortController;return i(null),u(!1),c(!0),Ct(e.designId,x.signal).then(f=>{x.signal.aborted||i(f)}).catch(()=>{x.signal.aborted||u(!0)}).finally(()=>{x.signal.aborted||c(!1)}),()=>x.abort()},[e]),!e)return n.jsxs("div",{className:"flex h-full min-w-0 flex-col",children:[s&&n.jsx(De,{title:o("dashboard.module.preview")}),n.jsxs("div",{className:"flex flex-1 flex-col items-center justify-center gap-3 text-[#999]",children:[n.jsx(Oe,{className:"h-9 w-9 text-[#d4d4d4]"}),n.jsx("p",{className:"m-0 text-[13px]",children:o("dashboard.module.selectExport")})]})]});const d=(r==null?void 0:r.modules)??[],y=(r==null?void 0:r.exportedAt)??e.exportedAt;return n.jsxs("div",{className:"flex h-full min-w-0 flex-col",children:[s&&n.jsx(De,{title:e.fileName,subtitle:e.pageName,fileId:e.fileId,pageId:e.pageId}),n.jsx("div",{className:"flex-1 overflow-auto p-3 sm:p-5",children:a?n.jsx(ve,{children:o("dashboard.module.loading")}):l?n.jsx(ve,{children:o("dashboard.module.loadFailed")}):d.length===0?n.jsx(ve,{children:o("dashboard.module.empty")}):n.jsx("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-[repeat(auto-fill,minmax(220px,1fr))] sm:gap-3.5",children:d.map(x=>n.jsx(Ut,{mod:x,exportedAt:y,onOpen:f=>t(e.designId,f)},x.moduleId))})})]})}function De({title:e,subtitle:t,fileId:s,pageId:o}){const{t:r}=q(),i=s&&o?Kt(s,o):null;return n.jsxs("div",{className:"flex min-h-12 shrink-0 items-center justify-between gap-3 border-b border-[#e5e5e5] bg-white px-3 py-2 sm:px-5",children:[n.jsxs("div",{className:"flex min-w-0 flex-1 items-baseline gap-2",children:[n.jsx("h2",{className:"m-0 min-w-0 max-w-full truncate text-[13px] font-semibold text-[#1a1a1a]",children:e}),t&&n.jsx("span",{className:"hidden min-w-0 truncate text-[11px] text-[#666] sm:inline",children:t})]}),i&&n.jsxs("a",{href:i,target:"_blank",rel:"noopener noreferrer",className:"flex shrink-0 items-center gap-1 rounded px-2 py-0.5 text-[11px] text-[#666] transition-colors hover:bg-[#f0f0f0] hover:text-[#1a1a1a]",children:[n.jsx(Ge,{className:"h-3 w-3"}),r("dashboard.module.viewInMgdone")]})]})}function Kt(e,t){return e.length!==15?null:`https://mgdone.alibaba-inc.com/file/${e}?pageId=${encodeURIComponent(t)}`}function ve({children:e}){return n.jsx("div",{className:"px-5 py-[60px] text-center text-xs text-[#999]",children:e})}function Ft({loading:e,groups:t,selectedSourceKey:s,selectedDesignId:o,selectedGroup:r,selectedDesign:i,onSelectSource:a,onSelectExport:c}){const{locale:l,t:u}=q(),[d,y]=m.useState(null),x=t.length>0,f=(r==null?void 0:r.exports)??[],v=p=>{a(p),y(null)},w=p=>{c(p),y(null)};return n.jsxs("nav",{className:"relative z-10 shrink-0 border-b border-[#e5e5e5] bg-white px-3 py-2",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[n.jsx($e,{active:d==="source",disabled:e||!x,label:(r==null?void 0:r.fileName)??u(e?"dashboard.mobile.loadingDesigns":x?"dashboard.mobile.selectDesign":"dashboard.mobile.noDesigns"),onClick:()=>y(d==="source"?null:"source")}),n.jsx(Be,{className:"h-3.5 w-3.5 shrink-0 text-[#b8b8b8]"}),n.jsx($e,{active:d==="export",disabled:!r||f.length===0,label:i?je(i,l):u(r?"dashboard.mobile.selectExport":"dashboard.mobile.exportVersion"),onClick:()=>y(d==="export"?null:"export")})]}),d==="source"&&n.jsx(Pe,{children:t.map(p=>n.jsx(Re,{active:p.sourceKey===s,title:p.fileName,meta:`${p.pageName} · ${re(p.exportCount,"export",l)} · ${u("dashboard.export.latestAt",{time:ue(p.latestUpdatedAt,l)})}`,onClick:()=>v(p.sourceKey)},p.sourceKey))}),d==="export"&&n.jsx(Pe,{children:f.map((p,j)=>n.jsx(Re,{active:p.designId===o,title:je(p,l),meta:`${ue(p.exportedAt||p.updatedAt,l)} · ${re(p.moduleCount,"module",l)} · v${p.version||"-"}`,badge:j===0?u("dashboard.export.latest"):void 0,onClick:()=>w(p.designId)},p.designId))})]})}function $e({active:e,disabled:t,label:s,onClick:o}){return n.jsxs("button",{type:"button","aria-expanded":e,disabled:t,className:W("flex min-w-0 flex-1 items-center gap-1 rounded-md border px-2.5 py-1.5 text-left transition-colors",e?"border-[#d4d4d4] bg-[#f7f7f7]":"border-transparent bg-[#fafafa] hover:border-[#e5e5e5]",t&&"cursor-default opacity-60"),onClick:o,children:[n.jsx("span",{className:"min-w-0 flex-1",children:n.jsx("span",{className:"block truncate text-[12px] font-medium text-[#1a1a1a]",children:s})}),n.jsx(et,{className:W("h-3.5 w-3.5 shrink-0 text-[#777] transition-transform",e&&"rotate-180")})]})}function Pe({children:e}){return n.jsx("div",{className:"absolute left-3 right-3 top-full z-20 mt-1 max-h-[52vh] overflow-auto rounded-md border border-[#e5e5e5] bg-white p-1 shadow-[0_8px_24px_rgba(0,0,0,0.08)]",children:n.jsx("div",{className:"flex flex-col gap-0.5",children:e})})}function Re({active:e,title:t,meta:s,badge:o,onClick:r}){return n.jsxs("button",{type:"button",className:W("flex w-full min-w-0 items-center gap-2 rounded px-2.5 py-2 text-left transition-colors",e?"bg-[#f0f0f0]":"hover:bg-[#f7f7f7]"),onClick:r,children:[n.jsxs("span",{className:"min-w-0 flex-1",children:[n.jsx("span",{className:"block truncate text-[12px] font-medium text-[#1a1a1a]",children:t}),n.jsx("span",{className:"mt-0.5 block truncate text-[10px] text-[#777]",children:s})]}),o&&n.jsx("span",{className:"shrink-0 rounded-[3px] bg-[#e7f5ee] px-[5px] text-[10px] leading-4 text-[#087443]",children:o}),e&&n.jsx(tt,{className:"h-3.5 w-3.5 shrink-0 text-[#1a1a1a]"})]})}function Vt(){const{locale:e,t}=q(),[s,o]=m.useState([]),[r,i]=m.useState(!0),[a,c]=m.useState(!1),[l,u]=m.useState(!1),d=Ht("(min-width: 1024px)"),y=m.useCallback(async b=>{i(!0),c(!1);try{const S=await It(b);b!=null&&b.aborted||o(S)}catch{if(b!=null&&b.aborted)return;c(!0)}finally{b!=null&&b.aborted||i(!1)}},[]);m.useEffect(()=>{const b=new AbortController;return y(b.signal),()=>b.abort()},[y]);const{allGroups:x,groups:f,selectedSourceKey:v,selectedDesignId:w,selectedGroup:p,selectedDesign:j,searchInput:N,setSelectedDesignId:h,selectSource:I,changeSearch:C,startSearchComposition:A,endSearchComposition:_,clearSearch:g}=Dt(s,r),T=async(b,S)=>{if(S.stopPropagation(),!!window.confirm(t("dashboard.delete.confirm")))try{if(!await Et(b)){E.error(t("dashboard.delete.failed"));return}o(K=>K.filter(J=>J.designId!==b)),E.success(t("dashboard.delete.succeeded"))}catch{E.error(t("dashboard.delete.failed"))}},L=async(b,S)=>{S.stopPropagation();const D=Te(`${window.location.origin}/design/${encodeURIComponent(b)}`,e);try{await navigator.clipboard.writeText(D),E.success(t("dashboard.copy.succeeded"))}catch{E.error(t("dashboard.copy.failed"))}},P=(b,S)=>{const D=Te(`/design/${encodeURIComponent(b)}#/module/${encodeURIComponent(S)}`,e);window.open(D,"_blank","noopener,noreferrer")};return n.jsxs("div",{className:"flex h-full flex-col overflow-hidden bg-[#fafafa] font-sans text-[#1a1a1a] antialiased",children:[n.jsx(jt,{autoClose:3e3,hideProgressBar:!0,closeButton:({closeToast:b})=>n.jsx("button",{type:"button","aria-label":t("dashboard.toast.close"),className:"inline-flex h-6 w-6 shrink-0 items-center justify-center rounded text-[#777] hover:bg-black/5 hover:text-[#333]",onClick:S=>{S.stopPropagation(),b(S)},children:n.jsx(Ce,{className:"h-3.5 w-3.5","aria-hidden":"true"})})}),n.jsxs("header",{className:"flex min-h-12 shrink-0 flex-col gap-2 border-b border-[#e5e5e5] bg-white py-2 pl-11 pr-3 sm:flex-row sm:items-center sm:justify-between sm:pr-5",children:[n.jsxs("div",{className:"flex min-w-0 items-center gap-1.5",children:[n.jsx(nt,{className:"h-4 w-4 shrink-0 text-[#1a1a1a]"}),n.jsx("h1",{className:"m-0 truncate text-sm font-semibold text-[#1a1a1a]",children:t("navigation.myDesigns")}),!r&&f.length>0&&n.jsxs(n.Fragment,{children:[n.jsx("span",{className:"shrink-0 text-[#e5e5e5]",children:"·"}),n.jsx("span",{className:"shrink-0 text-xs text-[#666]",children:re(f.length,"design",e)})]})]}),n.jsxs("div",{className:"relative w-full min-w-0 sm:w-[260px] sm:shrink-0",children:[n.jsx(st,{className:"pointer-events-none absolute left-2.5 top-1/2 h-3.5 w-3.5 -translate-y-1/2 text-[#999]"}),n.jsx("input",{value:N,onChange:b=>C(b.target.value),onCompositionStart:A,onCompositionEnd:_,placeholder:t("dashboard.search.placeholder"),className:"h-7 w-full rounded border border-[#e5e5e5] bg-[#fafafa] py-0 pl-8 pr-7 text-xs text-[#1a1a1a] outline-none transition-colors placeholder:text-[#aaa] focus:border-[#cfcfcf] focus:bg-white"}),N&&n.jsx("button",{type:"button","aria-label":t("dashboard.search.clear"),title:t("dashboard.search.clear"),className:"absolute right-1.5 top-1/2 inline-flex h-5 w-5 -translate-y-1/2 cursor-pointer items-center justify-center rounded border-0 bg-transparent text-[#999] hover:bg-[#eee] hover:text-[#666] [&_svg]:h-3.5 [&_svg]:w-3.5",onClick:g,children:n.jsx(Ce,{})})]})]}),!d&&(a&&!r?n.jsx(qt,{onRetry:()=>void y()}):n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col",children:[n.jsx(Ft,{loading:r,groups:f,selectedSourceKey:v,selectedDesignId:w,selectedGroup:p,selectedDesign:j,onSelectSource:I,onSelectExport:h}),n.jsx("main",{className:"min-h-0 flex-1 bg-[#fafafa]",children:n.jsx(Ae,{selectedDesign:j,onOpenModule:P,showHeader:!1})})]})),d&&n.jsxs("div",{className:W("grid min-h-0 flex-1 overflow-hidden",l?"grid-cols-[248px_44px_minmax(0,1fr)]":"grid-cols-[248px_300px_minmax(0,1fr)]"),children:[n.jsx("aside",{className:"min-w-0 overflow-y-auto border-r border-[#e5e5e5] bg-white p-2",children:r?n.jsx(le,{children:t("common.loading")}):a?n.jsxs(le,{children:[n.jsx("strong",{className:"text-[13px] font-medium text-[#1a1a1a]",children:t("common.loadFailed")}),n.jsx("span",{className:"max-w-full break-words",children:t("dashboard.designList.loadFailed")}),n.jsx("button",{type:"button",className:"mt-2 rounded border border-[#e5e5e5] bg-white px-2.5 py-1 text-xs text-[#666] hover:bg-[#f5f5f5]",onClick:()=>void y(),children:t("common.retry")})]}):x.length===0?n.jsxs(le,{children:[n.jsx("strong",{className:"text-[13px] font-medium text-[#1a1a1a]",children:t("dashboard.empty.noDesigns.title")}),n.jsx("span",{children:t("dashboard.empty.noDesigns.description")})]}):f.length===0?n.jsxs(le,{children:[n.jsx("strong",{className:"text-[13px] font-medium text-[#1a1a1a]",children:t("dashboard.empty.noResults.title")}),n.jsx("span",{children:t("dashboard.empty.noResults.description")})]}):n.jsx("div",{className:"flex flex-col gap-0.5",children:f.map(b=>n.jsx(Bt,{group:b,active:b.sourceKey===v,onSelect:I},b.sourceKey))})}),n.jsx("div",{className:"min-h-0 min-w-0",children:n.jsx(Ot,{source:p,selectedDesignId:w,onSelectExport:h,onCopyLink:L,onDeleteExport:T,collapsed:l,onToggleCollapse:()=>u(b=>!b)})}),n.jsx("main",{className:"min-w-0 bg-[#fafafa]",children:n.jsx(Ae,{selectedDesign:j,onOpenModule:P})})]})]})}function Ht(e){const[t,s]=m.useState(()=>window.matchMedia(e).matches);return m.useEffect(()=>{const o=window.matchMedia(e),r=()=>s(o.matches);return r(),o.addEventListener("change",r),()=>o.removeEventListener("change",r)},[e]),t}function le({children:e}){return n.jsx("div",{className:"flex flex-col items-center gap-1 px-4 py-10 text-center text-xs text-[#999]",children:e})}function qt({onRetry:e}){const{t}=q();return n.jsxs("div",{className:"flex min-h-0 flex-1 flex-col items-center justify-center gap-2 px-6 text-center text-xs text-[#999]",children:[n.jsx("strong",{className:"text-[13px] font-medium text-[#1a1a1a]",children:t("common.loadFailed")}),n.jsx("span",{className:"max-w-full break-words",children:t("dashboard.designList.loadFailed")}),n.jsx("button",{type:"button",className:"mt-2 rounded border border-[#e5e5e5] bg-white px-2.5 py-1 text-xs text-[#666] hover:bg-[#f5f5f5]",onClick:e,children:t("common.retry")})]})}export{Vt as Dashboard};