const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./LottiePlayer.modern-By-NXTSk.js","./index-DR3HTfO6.js","./index-BLDnEtdF.css"])))=>i.map(i=>d[i]);
import{c as V,j as t,r as x,o as i,bj as ae,al as H,q as T,P as N,eF as oe,eJ as G,ad as se,aB as B,J as U,B as J,C as L,ab as Q,aq as le,eK as re,eL as ce,eM as pe,eN as de,eO as he,b3 as me,a3 as M,eP as xe,G as P,af as ue,O as ge}from"./index-DR3HTfO6.js";import{j as fe}from"./url-join-CNpJXm5u.js";const be=V(t.jsx("path",{d:"M11.67 3.87 9.9 2.1 0 12l9.9 9.9 1.77-1.77L3.54 12z"})),ye=V([t.jsx("circle",{cx:"12",cy:"19",r:"2"},"0"),t.jsx("path",{d:"M10 3h4v12h-4z"},"1")]),Y=x.createContext(),{Provider:ke}=Y,q=(e,n,o=window.location.pathname.replace(/\/$/,"/"))=>e?n?e===o:new RegExp(e).test(o):!1;function we({children:e,steps:n,mode:o="history"}){const[a,h]=x.useState("");!a&&n.length&&h(n[0].key);const r=n.map(l=>l.children?[{key:l.key,hasChild:!0},l.children.map(g=>({parentKey:l.key,key:g.key}))]:{key:l.key}).flat(1/0),s=r.filter(l=>!l.hasChild),v=l=>{let g;const p=r.findIndex(c=>c.key===a?(g=c.parentKey,!0):!1);if(g===l)return"current";const $=r.findIndex(c=>c.key===l);if($!==-1){if($===p)return"current";if($<p)return"before"}return"after"};function m(l){h(l)}function b(l){if(typeof l=="function"){const g=l(s.findIndex(p=>p.key===a));h(s[g].key)}else h(s[l].key)}const y=s.findIndex(l=>l.key===a);x.useEffect(()=>{if(o==="history"){let l="";n.some(g=>g.children&&g.children.length?g.children.some(p=>q(p.path,p.exact)?(l=p.key,!0):!1):q(g.path,g.exact)?(l=g.key,!0):!1),l&&h(l)}return()=>{}},[n,o]);const j={steps:n,totalStepsCount:s.length,getStepStatus:v,setActiveStepByKey:m,setActiveStepByIndex:b,activeStep:y,canBackToStep:l=>o==="memory"&&y!==0&&l<y};return t.jsx(ke,{value:j,children:e})}function Z(){return x.use(Y)}we.propTypes={children:i.any.isRequired,steps:i.array.isRequired,mode:i.string};var A,W;function ve(){if(W)return A;W=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString;function o(a){if(a==null)return!0;if(typeof a=="boolean")return!1;if(typeof a=="number")return a===0;if(typeof a=="string"||typeof a=="function"||Array.isArray(a))return a.length===0;if(a instanceof Error)return a.message==="";if(a.toString==n)switch(a.toString()){case"[object File]":case"[object Map]":case"[object Set]":return a.size===0;case"[object Object]":{for(var h in a)if(e.call(a,h))return!1;return!0}}return!1}return A=o,A}var je=ve();const $e=ae(je),Se=""+new URL("blocklet-default-logo-Bspnu_ws.png",import.meta.url).href,I={en:{optional:"Optional",defaultNavSubTitle:"Launching"},zh:{optional:"可选",defaultNavSubTitle:"启动"}},Te=e=>I[e]?I[e]:I.en,Ne=e=>e==="zh"?"启动":"Launching",F=e=>e?.title||e?.name||"";function D({blockletMeta:e={},subTitle:n="",logoUrl:o="",locale:a="",navLogo:h="",loading:r=!1}){const s=H(j=>j.breakpoints.down("md")),v=s?18:48,m=x.useRef(null),[b,y]=x.useState("");return x.useEffect(()=>{m.current&&m.current.offsetHeight>34&&(b===""?y("middle"):b==="middle"&&y("small"))},[b]),t.jsxs(Ce,{className:b==="small"?"center-mode":"",children:[s?t.jsx("div",{className:"app-icon",children:h}):t.jsxs("div",{className:"app-icon",children:[r&&t.jsx(ze,{blockletSize:v,isMobile:s}),!r&&t.jsx(X,{blockletSize:v,logoUrl:o})]}),t.jsxs("div",{className:"header-title",children:[s&&n&&t.jsx("div",{className:"header-title-sub",children:n}),t.jsxs("div",{className:"app-name-content",children:[!s&&t.jsx("div",{className:"launching-context",children:n||Ne(a)}),t.jsx("div",{className:`header-title-name ${b==="middle"||b==="small"?"middle-size":""}`,ref:m,children:t.jsx(ee,{logoUrl:o,isMobile:s,blockletMeta:e,blockletSize:v,loading:r})})]})]})]})}D.propTypes={blockletMeta:i.object,subTitle:i.any,logoUrl:i.string,locale:i.string,navLogo:i.any,loading:i.bool};function ze({blockletSize:e,isMobile:n}){return n?t.jsx(N,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):t.jsx(N,{variant:"rectangular",width:e,height:e})}function X({logoUrl:e,blockletSize:n}){return t.jsx(oe,{width:n,height:n,src:e,alt:"blocklet icon",fallback:Se,style:{verticalAlign:"text-bottom"}},`layout-app-icon-${e}`)}function ee({isMobile:e,logoUrl:n,blockletMeta:o={},blockletSize:a,loading:h}){const r=F(o);return h?t.jsx(N,{variant:"rectangular",width:100,height:16,alt:"icon",style:{marginTop:4}}):$e(o)?t.jsx(N,{variant:"rectangular",animation:!1,width:100,height:16,alt:"icon",style:{marginTop:4}}):e?t.jsxs(Me,{children:[t.jsx(X,{blockletSize:a,logoUrl:n}),t.jsx("span",{className:"ellipsis-title",children:F(o)})]}):t.jsx(Oe,{className:"app-link",target:"_blank",href:fe(o?.registryUrl||"",`/blocklets/${o?.did}`),title:r,children:r})}const Me=T.div`
  .ellipsis-title {
    flex: 1;
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;

    ${e=>e.theme.breakpoints.down("md")} {
      left: 26px;
      width: calc(100% - 26px);
    }
  }
`;ee.propTypes={blockletMeta:i.object};const Oe=T.a`
  color: ${e=>e.theme.palette.text.primary};
  text-decoration: none;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-family:
    Lato,
    Avenir,
    -apple-system,
    BlinkMacSystemFont,
    'Segoe UI',
    Roboto,
    'Helvetica Neue',
    Arial,
    sans-serif,
    'Apple Color Emoji',
    'Segoe UI Emoji',
    'Segoe UI Symbol';
  text-decoration: none;
  font-weight: 700;
  -webkit-font-smoothing: antialiased;

  ${e=>e.theme.breakpoints.down("md")} {
    display: block;
    max-width: calc(100vw - 150px);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
`,Ce=T.div`
  display: flex;
  justify-content: flex-start;
  align-items: flex-start;
  width: 100%;
  ${e=>e.theme.breakpoints.up("md")} {
    min-height: 70px;
  }
  ${e=>e.theme.breakpoints.down("md")} {
    align-items: center;
  }
  .app-name-content {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    ${e=>e.theme.breakpoints.up("md")} {
      align-items: flex-start;
      flex-direction: column;
    }
    ${e=>e.theme.breakpoints.down("md")} {
      justify-content: flex-start;
      height: 22px;
    }
  }
  .launching-context {
    flex-shrink: 0;
    font-size: 14px;
    font-weight: 600;
    color: ${e=>e.theme.palette.text.secondary};
    ${e=>e.theme.breakpoints.up("md")} {
      margin-bottom: 4px;
    }
    ${e=>e.theme.breakpoints.down("md")} {
      font-size: 14px;
      line-height: 15px;
      &:after {
        display: inline-block;
        margin: 0 4px;
        content: ':';
      }
    }
  }

  &.center-mode {
    align-items: flex-start;
    .launching-context {
      ${e=>e.theme.breakpoints.up("sm")} {
        margin-bottom: 0;
      }
    }
  }

  .app-icon {
    flex-shrink: 0;
    > * {
      display: block;
      vertical-align: middle;
    }
  }

  .header-title {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: flex-start;
    margin-left: 24px;
    ${e=>e.theme.breakpoints.down("md")} {
      margin-left: 16px;
    }
    .header-title-name {
      position: relative;
      display: flex;
      justify-content: center;
      align-items: center;
      flex: 1;
      height: 100%;
      color: ${e=>e.theme.palette.text.primary};
      font-weight: 700;
      ${e=>e.theme.breakpoints.up("sm")} {
        font-size: 18px;

        &.middle-size {
          font-size: 16px;
        }
      }
      ${e=>e.theme.breakpoints.down("md")} {
        display: block;
        max-width: calc(100vw - 100px);
        font-size: 16px;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }

    .header-title-sub {
      color: ${e=>e.theme.palette.grey[700]};
      font-size: 12px;
      line-height: 16px;

      ${e=>e.theme.breakpoints.down("md")} {
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
    }
  }
`;function te({blockletMeta:e,logoUrl:n="",locale:o="",useOfSkeleton:a=!1,subTitle:h="",loading:r=!1,extraNav:s=null,sx:v={}}){const{steps:m,activeStep:b,setActiveStepByKey:y,setActiveStepByIndex:j,getStepStatus:l,canBackToStep:g}=Z(),p=a?r:!1,$=(c,w)=>{const f=["step-block"],k=l(c.key);switch(k){case"current":f.push("step-active");break;case"before":f.push("step-checked");break}switch(c.showChild){case"activated":k==="after"&&f.push("hide-step-child");break;case"activating":(k==="after"||k==="before")&&f.push("hide-step-child");break;case"always":f.push("always-step-child");break}return c.optional===!0&&b<w&&f.push("step-optional"),f.join(" ")};return t.jsxs(Ee,{sx:v,children:[t.jsx(D,{blockletMeta:e,loading:r,logoUrl:n,locale:o,subTitle:h}),t.jsx(Le,{className:`${p?"hide-child-step-desc":""}`,children:m.map((c,w)=>{const f=!p&&g(w);return t.jsxs("div",{className:$(c,w),children:[t.jsx("div",{className:"step-icon",children:t.jsx(G,{style:{fontSize:16}})}),t.jsx("div",{className:"step-line"}),t.jsxs("div",{className:"step-content",title:c.name,children:[t.jsx("span",{className:`step-content-name ${f?" step-clickable":""}`,onClick:()=>{if(f){if(c.key){y(c.key);return}j(w)}},children:p?t.jsx(N,{variant:"text",width:100}):c.name}),c.description&&t.jsx("div",{className:"step-desc",children:c.description}),c.children&&c.children.length&&t.jsx("div",{className:"step-children",children:c.children.map(k=>{let S="";switch(l(k.key)){case"before":S="step-child-block-checked";break;case"current":S="step-child-block-active";break}return t.jsx("div",{className:`step-child-block ${S}`,children:k.name},k.key)})})]})]},c.key)})}),s&&t.jsxs("div",{className:"extra-nav",children:[s.tooltipText?t.jsx(se,{title:s.tooltipText,children:t.jsx(B,{variant:s.buttonProps?.variant||"text",onClick:()=>{s.link&&window.open(s.link,"_blank")},startIcon:s.icon,className:"extra-nav-button",size:"small",...s.buttonProps,children:s.text})}):t.jsx(B,{variant:s.buttonProps?.variant||"text",onClick:()=>{s.link&&window.open(s.link,"_blank")},startIcon:s.icon,size:"small",className:"extra-nav-button",...s.buttonProps,children:s.text}),s.description&&t.jsx(U,{variant:"caption",sx:{color:"text.secondary",mt:.5},component:"p",className:"extra-nav-description",children:s.description})]})]})}const Ee=T(J)`
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  ${e=>e.theme.breakpoints.up("md")} {
    padding: 24px;
    border-right: 1px solid ${e=>e.theme.palette.divider};
    flex: 0 0 280px;
    min-height: 48px;

    .MuiStepConnector-vertical {
      padding: 0;
    }
  }

  ${e=>e.theme.breakpoints.down("md")} {
    padding: 16px;

    .MuiStepConnector-lineVertical {
      border: none;
    }
  }

  .stepper {
    padding: 0 !important;
    background: transparent;

    ${e=>e.theme.breakpoints.up("sm")} {
      margin-top: 100px;
    }

    ${e=>e.theme.breakpoints.down("md")} {
      margin-top: 40px;
    }

    .step {
      cursor: pointer;
    }
  }

  .always-step-child {
    .step-child-block {
      animation: none !important;
    }
  }
  .extra-nav-button {
    cursor: pointer;
  }
`,Le=T(J)`
  display: flex;
  flex-direction: column;
  margin-top: 60px;
  flex: 1;

  @media (max-height: 900px) {
    margin-top: 32px;
  }

  ${e=>e.theme.breakpoints.down("md")} {
    margin-top: 30px;
  }
  .step-clickable {
    cursor: pointer;
    &:hover {
      color: ${e=>e.theme.palette.primary.main};
    }
  }
  .step-line {
    display: block;
    position: absolute;
    z-index: 1;
    left: 11px;
    top: 24px;
    width: 2px;
    height: 100%;
    opacity: 0.5;
    background-color: ${e=>e.theme.palette.grey[400]};
    transition: all ease 0.2s;
  }
  .step-icon {
    position: relative;
    z-index: 2;
    display: flex;
    flex-shrink: 0;
    justify-content: center;
    align-items: center;
    box-sizing: border-box;
    width: 24px;
    height: 24px;
    border: 4px solid ${e=>e.theme.palette.grey[400]};
    border-radius: 13px;
    color: ${e=>e.theme.palette.common.white};
    transition: all ease 0.3s;

    & > * {
      transform: scale(0);
      transition: all ease 0.2s;
    }
  }
  .step-content {
    position: relative;
    flex: 1;
    padding-top: 1px;
    margin-left: 22px;
    font-size: 16px;
    color: ${e=>e.theme.palette.grey[700]};
    white-space: nowrap;
  }
  .step-desc {
    margin-top: 24px;
    font-size: 12px;
    font-weight: 500;
    height: 17px;
    color: ${e=>e.theme.palette.grey[700]};
    transition: all ease 0.3s;
    overflow: hidden;
  }
  ${e=>e.theme.breakpoints.up("md")} {
    .step-content-name {
      position: absolute;
      left: 0;
      top: 0;
      width: 100%;
      overflow: hidden;
      text-overflow: ellipsis;
    }
  }
  &.hide-child-step-desc {
    .step-desc {
      margin: 0;
      opacity: 0;
      height: 0;
    }
  }
  .step-block {
    position: relative;
    display: flex;
    min-height: 70px;
    opacity: 0.5;
    overflow: hidden;
    transition: all ease 0.2s;
    &:last-child {
      height: auto;
      min-height: auto;
    }
    &.step-optional {
      height: 0;
      opacity: 0;
      min-height: 0px;
    }

    &.step-checked,
    &.step-active {
      .step-desc {
        margin: 0;
        opacity: 0;
        height: 0;
      }
    }

    &.step-checked {
      opacity: 1;
      .step-icon {
        color: ${e=>e.theme.palette.primary.white};
        border-color: ${e=>e.theme.palette.primary.main};
        background-color: ${e=>e.theme.palette.primary.main};
        & > * {
          transform: scale(1);
        }
      }

      .step-line {
        background-color: ${e=>e.theme.palette.primary.main};
        opacity: 1;
      }
    }

    &.step-active {
      opacity: 1;
      .step-icon {
        border-color: ${e=>e.theme.palette.primary.main};
      }
      .step-content {
        color: ${e=>e.theme.palette.primary.main};
      }
    }

    &:last-child {
      .step-line {
        display: none;
      }

      .step-child-block {
        &:last-child {
          padding-bottom: 0;
        }
      }
    }

    &.hide-step-child {
      .step-children {
        .step-child-block {
          margin-top: 0;
          height: 0;
          opacity: 0;
          &:last-child {
            padding-bottom: 0;
          }
        }
      }
    }
  }
  .step-children {
    padding-top: 20px;
    .step-child-block {
      margin-top: 4px;
      height: 24px;
      line-height: 24px;
      font-size: 14px;
      color: ${e=>e.theme.palette.grey[500]};
      transition: all ease 0.3s;
      &:first-of-type {
        margin-top: 8px;
      }
      &:last-child {
        padding-bottom: 40px;
      }
      &.step-child-block-active {
        color: ${e=>e.theme.palette.text.primary};
        font-weight: 700;
      }
      &.step-child-block-checked {
        color: ${e=>e.theme.palette.text.primary};
      }
    }
  }

  .step-active {
    .step-child-block {
      animation: stepChildAnime ease 0.3s;
    }
  }

  @keyframes stepChildAnime {
    0% {
      height: 0;
    }
    100% {
      height: 24px;
    }
  }
`;te.propTypes={blockletMeta:i.object.isRequired,logoUrl:i.string,locale:i.string,useOfSkeleton:i.bool,subTitle:i.string,loading:i.bool,extraNav:i.object,sx:i.any};function ie({value:e,size:n=10,style:o={},...a}){return t.jsxs(_e,{style:{width:n,height:n,...o},...a,children:[t.jsx(L,{variant:"determinate",role:"progressbar",value:100,size:n,"aria-label":"decorative progress bar",thickness:10,sx:{color:"grey.300"}}),t.jsx(L,{variant:"determinate",value:e,role:"progressbar",size:n,thickness:10,"aria-label":"main progress bar"})]})}ie.propTypes={value:i.number.isRequired,size:i.number,style:i.object};const _e=T.span`
  display: inline-block;
  position: relative;
  > * {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
  }
`,R="72px",Ae=M("div")`
  box-sizing: border-box;
  display: flex;
  overflow: hidden;
  width: 100%;
  height: 100%;
  padding-top: ${R};
`,Ie=M("div")`
  display: flex;
  min-width: 900px;
  max-width: ${e=>e.contentMaxWidth};
  max-height: 880px;
  border-radius: 8px;
  background-color: ${({theme:e})=>e.palette.background.paper};
  width: ${e=>e.width||"80%"};
  height: ${e=>e.height||"80%"};

  @media (max-height: 1200px) {
    margin-top: ${R};
    height: 100%;
    max-height: 100%;
  }
`;function Ue({blockletMeta:e={},loading:n=!1,children:o,logoUrl:a="",locale:h="en",header:r=null,headerEndAddons:s=null,pcWidth:v="80%",navLogo:m="",useOfSkeleton:b=!0,navSubTitle:y="",contentMaxWidth:j="1245px",theme:l=null,themeOverrides:g=null,extraNav:p=null,...$}){const c=Q(),w=H(C=>C.breakpoints.down("md")),{activeStep:f,totalStepsCount:k}=Z(),S=e||{},z=w?Ae:Ie,_=Te(h);m&&!x.isValidElement(m)&&le(m)&&(w?m=m.mobile:m=t.jsx(Re,{children:m.desktop}));const O=re(c,l||{});return t.jsx(ce,{injectFirst:!0,children:t.jsx(pe,{theme:O,children:t.jsx(de,{theme:O,children:t.jsxs(De,{...$,children:[t.jsxs(Pe,{maxWidth:j,width:v,className:"ll-header",children:[r&&r,!r&&t.jsxs(t.Fragment,{children:[w&&t.jsx("div",{className:"left",children:t.jsx(D,{blockletMeta:S,navLogo:m,subTitle:t.jsxs("span",{children:[`${y||_.defaultNavSubTitle} ${f+1}/${k}`,t.jsx(ie,{value:(f+1)/k*100,style:{marginLeft:3}}),p&&t.jsx(U,{variant:"caption",className:"extra-nav-text",onClick:()=>{p.link&&window.open(p.link,"_blank")},sx:{ml:1,color:"primary.main",cursor:"pointer","&:hover":{opacity:.8}},children:p.appText||p.text})]}),logoUrl:a,locale:h,loading:n})}),m&&!w&&t.jsx("div",{className:"left",children:m}),s&&t.jsx(he,{className:"right",children:s})]})]}),t.jsxs(z,{contentMaxWidth:j,className:"ll-container",children:[t.jsx(te,{sx:{display:{xs:"none",md:"block"}},locale:h,blockletMeta:S,logoUrl:a,useOfSkeleton:b,subTitle:y,loading:n,extraNav:p}),t.jsx(U,{component:"div",className:"layout-content",children:t.jsx(x.Suspense,{fallback:t.jsx(me,{relative:"parent",children:t.jsx(L,{style:{marginTop:36}})}),children:o})})]})]})})})})}Ue.propTypes={loading:i.bool,blockletMeta:i.object,children:i.object.isRequired,logoUrl:i.string,locale:i.oneOf(["en","zh"]),header:i.any,headerEndAddons:i.any,pcWidth:i.any,pcHeight:i.any,contentMaxWidth:i.string,navLogo:i.oneOfType([i.node,i.object]),useOfSkeleton:i.bool,stepTip:i.string,navSubTitle:i.string,theme:i.object,themeOverrides:i.object,extraNav:i.object};const K=navigator.userAgent.toLocaleLowerCase();let ne="";K.includes("iphone os")&&K.includes("crios")&&(ne="height: calc(100vh - 60px);");const Pe=M("header")`
  width: ${e=>e.width||"80%"};
  min-width: 900px;
  box-sizing: border-box;
  position: absolute;
  z-index: 200;
  top: 0;
  display: flex;
  max-width: ${e=>e.maxWidth};
  height: 68px;
  align-items: center;

  ${e=>`${e.theme.breakpoints.up("sm")} and (min-height: 900px)`} {
    justify-content: flex-end;
  }

  ${e=>e.theme.breakpoints.down("md")} {
    min-width: 360px;
    width: 100%;
    height: ${R};
    justify-content: space-between;
    background-color: ${({theme:e})=>e.palette.mode==="dark"?e.palette.background.default:e.palette.grey[100]};
  }

  .left {
    flex: 1;
    display: flex;
    align-items: center;
  }
`,De=M("div")`
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  letter-spacing: normal;
  background: ${({theme:e})=>e.palette.mode==="dark"?e.palette.background.default:e.palette.grey[100]};
  ${ne}

  header:empty {
    display: none;
  }

  header:empty + div {
    margin-top: 0;
    padding-top: 0;
  }

  .circular {
    display: inline-block;
    position: relative;
    width: 15px;
    height: 12px;
    > * {
      position: absolute;
      left: 3px;
      top: 2px;
      width: 100%;
      height: 100%;
    }
  }

  .layout-content {
    width: 100%;
    min-width: 0;
    flex-grow: 1;
    height: 100%;
    padding: 32px;
    background-color: ${({theme:e})=>e.palette.background.paper};

    ${e=>e.theme.breakpoints.down("md")} {
      padding: 16px;
    }
  }
`,Re=M("div")`
  display: block;
  margin-top: 4px;
`;function Be({title:e="",subTitle:n="",onClickBack:o="",...a}){return t.jsxs(qe,{...a,children:[o&&t.jsx(be,{className:"back-btn",onClick:o}),t.jsx("div",{className:"title",children:e}),t.jsx("div",{className:"sub-title",children:n})]})}const qe=T.div`
  position: relative;
  width: 100%;
  text-align: center;

  .title {
    font-size: 24px;
    font-weight: 700;
    color: ${e=>e.theme.palette.text.primary};

    ${e=>e.theme.breakpoints.down("md")} {
      font-size: 20px;
    }
  }

  .sub-title {
    font-size: 14px;
    color: ${e=>e.theme.palette.text.secondary};
    padding: 0 14px;
    font-weight: 400;
  }

  .back-btn {
    position: absolute;
    left: 0;
    top: 8px;
    color: ${e=>e.theme.palette.grey[500]};
    font-size: 18px;
    cursor: pointer;
  }
`;Be.propTypes={title:i.string,subTitle:i.string,onClickBack:i.oneOfType([i.func,i.string])};function We({variant:e="success",title:n="",subTitle:o="",footer:a=null,...h}){let r;switch(e){case"error":r=xe;break;case"info":r=ye;break;case"loading":r=L;break;default:r=G}return t.jsx(Fe,{variant:e,...h,children:t.jsxs("div",{className:"result-body",children:[t.jsx("span",{className:`result-icon color-${e}`,children:t.jsx(r,{})}),t.jsx("div",{className:`result-title color-${e} ${n?"":"ele-hide"}`,children:n}),t.jsx("div",{className:`result-sub-title ${o?"":"ele-hide"}`,children:o}),a&&t.jsx("div",{className:"result-footer",children:a})]})})}We.propTypes={variant:i.oneOf(["success","error","info","loading"]),title:i.string,subTitle:i.any,footer:i.any};const Fe=T.div`
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  width: 100%;
  height: 100%;

  .result-body {
    padding: 0 14px;
    max-width: 500px;
    text-align: center;
    margin-top: -64px;
  }

  .result-icon {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 24px;
    width: 48px;
    height: 48px;
    border-radius: 100%;
    color: ${e=>e.theme.palette.common.white};
    transition: all ease 0.3s;
    &.color-success {
      background-color: ${e=>e.theme.palette.success.main};
    }
    &.color-error {
      background-color: ${e=>e.theme.palette.error.main};
    }
    &.color-info {
      background-color: ${e=>e.theme.palette.primary.main};
    }
  }

  .result-title {
    height: 34px;
    font-size: 21px;
    margin-bottom: 8px;
    font-weight: bolder;
    transition: all ease 0.3s;
    transition-delay: 0.2s;
    &.color-success {
      color: ${e=>e.theme.palette.success.main};
    }
    &.color-error {
      color: ${e=>e.theme.palette.error.main};
    }
    &.color-info {
      color: ${e=>e.theme.palette.primary.main};
    }
    &.ele-hide {
      height: 0;
      opacity: 0;
      margin-bottom: 0;
    }
  }

  .result-sub-title {
    margin: 0 auto;
    min-height: 17px;
    color: ${e=>e.theme.palette.grey[700]};
    font-size: 14px;
    line-height: 1.21em; // 0.01可以解决视网膜屏轻微偏移问题
    transition: all ease 0.3s;
    transition-delay: 0.2s;
    word-break: break-word;
    &.ele-hide {
      line-height: 0;
      opacity: 0;
      min-height: 0;
    }
  }

  .result-footer {
    padding-top: 24px;
    transition: all ease 0.3s;
    transition-delay: 0.2s;
  }
`,Ke=x.lazy(()=>P(()=>import("./LottiePlayer.modern-By-NXTSk.js"),__vite__mapDeps([0,1,2]),import.meta.url));function Ve({animationData:e=null,size:n=256,message:o="",messageDuration:a=5e3,messageLoop:h=!0,tips:r=[],tipsDuration:s=5e3,maybeDuration:v=12e4,speed:m=1,increaseSpeed:b=0,...y}){const j=Q(),[l,g]=x.useState(0),[p,$]=x.useState(m),[c,w]=x.useState(0),[f,k]=x.useState(null),[S,z]=x.useState(!e),_=x.useRef(new Date().getTime());Array.isArray(o)||(o=[o]),x.useEffect(()=>{e||(z(!0),(async()=>{try{const d=await(j.palette.mode==="dark"?P(()=>import("./dark-animation.json-DxDR1cr6.js"),[],import.meta.url):P(()=>import("./default-animation.json-Bwjw6UFO.js"),[],import.meta.url));k(d.default||d),z(!1)}catch(d){console.error("Failed to load animation:",d),z(!1)}})())},[e,j.palette.mode]),x.useEffect(()=>{if(!o)return;let d=0;const u=setInterval(()=>{d++,d>=o.length&&(h?d=0:d=o.length-1),w(d)},a);return()=>{clearInterval(u)}},[o,a]),x.useEffect(()=>{if(!r.length)return ue;const d=setTimeout(()=>{let u=l+1;u>=r.length&&(u=0),g(u)},s);return()=>clearTimeout(d)},[r,s,l]),x.useEffect(()=>{const d=setTimeout(()=>{let u=(new Date().getTime()-_.current)/v;u>1&&(u=1);const E=m+b*u;$(E)},1e3);return()=>clearTimeout(d)},[p]);const O=d=>{let u="message-before";return c===d?u="show-message":c<d&&(u="message-after"),u},C=t.jsx("div",{style:{width:n,height:n,display:"flex",justifyContent:"center",alignItems:"center"},children:t.jsx(N,{variant:"rounded",width:n*.4,height:n*.4})});return t.jsxs(He,{...y,children:[S?C:t.jsx(x.Suspense,{fallback:C,children:t.jsx(Ke,{loop:!0,animationData:e||f,play:!0,speed:p,style:{width:n,height:n}})}),o&&t.jsx("div",{className:"waiter-message",children:o.map((d,u)=>{const E=O(u);return t.jsxs("div",{children:[t.jsx("span",{className:`message-block ${E}`,children:d}),t.jsx("span",{className:`placeholder-message ${E}`,children:d})]},u)})}),r.length?t.jsx("div",{className:"waiter-tips-container",children:r.map((d,u)=>t.jsx("div",{className:`waiter-tips-block ${l===u?"show-tips":""}`,children:d},u))}):""]})}Ve.propTypes={animationData:i.oneOfType([i.object,i.oneOf([null])]),size:i.oneOfType([i.number,i.string]),message:i.oneOfType([i.string,i.arrayOf(i.node)]),messageDuration:i.number,messageLoop:i.bool,tips:i.arrayOf(i.node),tipsDuration:i.number,speed:i.number,maybeDuration:i.number,increaseSpeed:i.number};const He=ge("div")`
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  width: 100%;
  height: 100%;

  .waiter-message {
    position: relative;
    width: 100%;
    font-weight: 700;
    font-size: 18px;
    line-height: 22px;
    text-align: center;
    overflow: hidden;
    .message-block {
      position: absolute;
      left: 0;
      width: 100%;
      opacity: 0;
      transition: all ease 0.3s;
      user-select: none;
      &.message-before {
        transform: translate(-20px, 0);
      }
      &.message-after {
        transform: translate(20px, 0);
      }
      &.show-message {
        transform: translate(0, 0);
        opacity: 1;
        user-select: text;
        z-index: 2;
      }
    }

    .placeholder-message {
      user-select: none;
      display: none;
      opacity: 0;
      &.show-message {
        display: block;
      }
    }
  }

  .waiter-tips-container {
    position: relative;
    margin-top: auto;
    width: 100%;
    .waiter-tips-block {
      position: absolute;
      bottom: 0;
      left: 0;
      width: 100%;
      opacity: 0;
      pointer-events: none;
      z-index: 1;
      transform: translate(-20px, 0);
      transition: all ease 0.4s;
      &.show-tips {
        opacity: 1;
        pointer-events: auto;
        z-index: 2;
        transform: translate(0, 0);
      }
    }
  }
`;export{Ve as B,Ue as L,we as P,Z as T,Be as a,We as u};
