import{c as R}from"./utils-Q0fnGDhj.js";import{r as S,j as e}from"./client-BbMi5ewG.js";import{B as w}from"./Button-1dacbE2T.js";import{P as q}from"./progress-LiitFnHM.js";import{T as D,a as H,b as U,c as G}from"./tabs-sf64UEkO.js";import{C as T}from"./circle-check-B35mPstZ.js";import{A as I,a as J}from"./arrow-right-B8h6q6X7.js";import{L as y}from"./loader-circle--S58donA.js";/**
 * @license lucide-react v0.525.0 - ISC
 *
 * This source code is licensed under the ISC license.
 * See the LICENSE file in the root directory of this source tree.
 */const K=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],le=R("sparkles",K),O=(r="")=>{if(!r)return"";const t=r.toLowerCase();return t.startsWith("create ")?`Creating ${r.slice(7)}`:t.startsWith("update ")?`Updating ${r.slice(7)}`:t.startsWith("save ")?`Saving ${r.slice(5)}`:t.startsWith("delete ")?`Deleting ${r.slice(7)}`:t.startsWith("submit ")?`Submitting ${r.slice(7)}`:`${r}…`},Q=({progressTitle:r,progressSubtitle:t,progressPercentage:c,completedSections:h,tabs:x})=>e.jsx("div",{className:"mb-6",children:e.jsxs("div",{className:"bg-gradient-to-r from-blue-50 to-white rounded-2xl p-6 shadow-sm border border-blue-100",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-lg font-semibold text-slate-800",children:r}),e.jsx("p",{className:"text-sm text-slate-600 mt-1",children:t})]}),e.jsxs("div",{className:"text-right",children:[e.jsxs("div",{className:"text-3xl font-bold text-[#1d4ed8]",children:[Math.round(c),"%"]}),e.jsxs("div",{className:"text-xs text-small-font mt-1",children:[h.size," of ",x.length," completed"]})]})]}),e.jsx(q,{value:c,className:"h-2.5 bg-slate-200"})]})});function ne(r){const{tabs:t=[],initialTab:c=null,initialCompletedSections:h=[],showProgress:x=!0,progressTitle:k="Setup Progress",progressSubtitle:$="Complete all sections to finish",onTabChange:m=()=>{},onComplete:P=()=>{},onStepComplete:j=()=>{},className:X="",navigationPosition:p="bottom",allowSkipSteps:f=!1,completeButtonText:N="Complete Setup",nextButtonText:A="Next Step",prevButtonText:L="Previous Step",allowNextSteps:Y=!0,isCompleting:l=!1}=r,[i,g]=S.useState(c||(t.length>0?t[0].id:"")),[a,M]=S.useState(new Set(h)),C=s=>{const o=new Set([...a,s]);M(o),j(s,o)},n=t.findIndex(s=>s.id===i),z=t.length>0?a.size/t.length*100:0,B=async()=>{if(n<t.length-1){if(await j(i,a)===!1)return;C(i);const o=t[n+1].id;g(o),m(o)}},W=()=>{if(n>0){const s=t[n-1].id;g(s),m(s)}},F=s=>{var o;(f||a.has((o=t.find(b=>b.id===s))==null?void 0:o.id)||s===i)&&(g(s),m(s))},_=()=>{C(i),P(a)},V=()=>e.jsx("div",{className:"px-8 py-6",children:e.jsxs("div",{className:"flex gap-4 items-center justify-center max-w-7xl mx-auto",children:[e.jsxs(w,{variant:"outline",onClick:W,disabled:n===0,className:"h-11 px-6 border-border hover:border-slate-300 hover:bg-white transition-all disabled:opacity-50 disabled:cursor-not-allowed rounded-[8px]",children:[e.jsx(I,{className:"w-4 h-4 mr-2"}),L]}),n===t.length-1?e.jsx(w,{onClick:_,disabled:l,className:`
                                    h-11 px-8 rounded-[8px] text-white transition-all
                                    ${l?"bg-green-500 cursor-not-allowed":"bg-green-600 hover:bg-green-700 shadow-lg shadow-green-500/20 hover:shadow-xl hover:shadow-green-500/30"}
                                `,children:l?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-4 h-4 mr-2 animate-spin"}),O(N)]}):e.jsxs(e.Fragment,{children:[e.jsx(T,{className:"w-4 h-4 mr-2"}),N]})}):e.jsx(w,{onClick:B,disabled:l,className:`
                                    h-11 px-8 rounded-[8px] text-white transition-all
                                    ${l?"bg-blue-400 cursor-not-allowed":"bg-[#1d4ed8] hover:bg-[#1e40af] shadow-lg shadow-blue-500/20 hover:shadow-xl hover:shadow-blue-500/30"}
                                `,children:l?e.jsxs(e.Fragment,{children:[e.jsx(y,{className:"w-4 h-4 mr-2 animate-spin"}),"Processing..."]}):e.jsxs(e.Fragment,{children:[A,e.jsx(J,{className:"w-4 h-4 ml-2"})]})})]})}),E={1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6",7:"grid-cols-7",8:"grid-cols-8"};return e.jsxs("div",{className:"space-y-6",children:[x&&e.jsx(Q,{progressTitle:k,progressSubtitle:$,progressPercentage:z,completedSections:a,tabs:t}),e.jsx("div",{className:"bg-white rounded-2xl shadow-sm border border-border overflow-hidden p-[4px_30px_30px]",children:e.jsxs(D,{value:i,onValueChange:F,className:"space-y-0",children:[e.jsx("div",{className:"bg-gradient-to-r from-slate-50 to-white border-b-[4px] border-border",children:e.jsx(H,{className:`grid w-full ${E[t.length]||"grid-cols-1"} bg-transparent rounded-none px-0 py-0 border-none shadow-none h-auto`,children:t.map((s,o)=>{const b=s.icon,u=a.has(s.id),d=i===s.id,v=f||u||d||o===0;return e.jsxs(U,{value:s.id,disabled:!v,className:`flex flex-col lg:flex-row justify-start items-center bg-white shadow-none hover:shadow-none gap-2 py-6 relative rounded-none transition-all duration-200 border-b-[4px] -mb-[4px] data-[state=active]:shadow-none ${d?"bg-white border-[#1d4ed8] !shadow-none":v?"hover:bg-white/50 hover:border-primary-lighter !shadow-none":"opacity-50 cursor-not-allowed hover:border-primary-lighter !shadow-none"}`,children:[e.jsx("div",{className:`relative shrink-0 bg-light-bg flex items-center justify-center w-[32px] h-[32px] rounded-[10px] transition-all duration-200 ${d?" text-primary":u?" bg-green-100 text-green-600":" text-small-font"}`,children:u&&!d?e.jsx(T,{className:"w-6 h-6"}):e.jsx(b,{size:"16px"})}),e.jsxs("div",{className:`text-left ${d?"text-title":v?"text-slate-600":"text-slate-400"}`,children:[e.jsx("div",{className:"text-[12px] lg:text-sm font-semibold transition-colors text-current -mt-[1px]",children:s.label}),s.description&&e.jsx("div",{className:"text-xs font-normal text-current hidden xl:block",children:s.description})]})]},s.id)})})}),e.jsxs("div",{className:"bg-white",children:[t.map(s=>e.jsx(G,{value:s.id,className:"mt-0 border-0 p-0",children:e.jsxs("div",{className:"py-8",children:[s.headerContent?s.headerContent:s.title&&e.jsxs("div",{className:"mb-8 pb-4 border-b border-border",children:[e.jsx("div",{className:"flex items-center gap-3",children:e.jsx("h2",{className:"text-[20px] font-bold text-title",children:s.title||s.label})}),s.subtitle&&e.jsx("p",{className:"text-slate-600 text-base ml-[52px]",children:s.subtitle})]}),s.content]})},s.id)),p!=="none"&&(p==="bottom"||p==="both")&&e.jsx(V,{})]})]})})]})}export{ne as M,le as S};
//# sourceMappingURL=Tabs-CCGdXr30.js.map
