firebase-os 1.1.9 → 1.2.1

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.
@@ -615,4 +615,4 @@ VITE_ADMIN_EMAILS=your@email.com,other@email.com`;function EHn({code:e,label:t})
615
615
  storageBucket: "myproject.firebasestorage.app",
616
616
  messagingSenderId: "123456789012",
617
617
  appId: "1:123456789012:web:abcdef123456"
618
- };`})})]}),(0,y.jsxs)(Y9,{title:`Configure your .env file`,children:[(0,y.jsxs)(`p`,{children:[`Open the `,(0,y.jsx)(`code`,{className:`text-accent font-bold text-[13px]`,children:`.env`}),` file in your source code root. Map the keys from your Firebase Web SDK to the `,(0,y.jsx)(`code`,{className:`bg-foreground/5 rounded px-2 py-0.5 font-mono text-[11px]`,children:`VITE_ FIREBASE_`}),` variables.`]}),(0,y.jsxs)(`p`,{className:`text-[13px] bg-accent/10 border border-accent/20 p-3 rounded-xl mt-2 text-foreground/80`,children:[(0,y.jsx)(`strong`,{children:`Important:`}),` Provide your own emails in `,(0,y.jsx)(`code`,{className:`bg-background/80 rounded px-1.5 py-0.5 font-mono text-[11px]`,children:`VITE_ADMIN_EMAILS`}),` separated by commas. These users will automatically get full admin privileges upon their first registration. No quotes or spaces!`]}),(0,y.jsx)(DHn,{code:THn})]}),(0,y.jsx)(Y9,{title:`Enable Authentication`,children:(0,y.jsxs)(`p`,{children:[`1. In Firebase console Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Security`}),` → `,(0,y.jsx)(`strong`,{children:`Authentication`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get Started`}),`. `,(0,y.jsx)(`br`,{}),`2. Click the `,(0,y.jsx)(`strong`,{children:`Sign-in method`}),` tab. `,(0,y.jsx)(`br`,{}),`3. Enable `,(0,y.jsx)(`strong`,{children:`Email/Password`}),` (no need to enable email links). `,(0,y.jsx)(`br`,{}),`4. Enable `,(0,y.jsx)(`strong`,{children:`Google`}),`. `,(0,y.jsx)(`br`,{}),`5. Enable `,(0,y.jsx)(`strong`,{children:`Anonymous`}),`.`]})}),(0,y.jsxs)(Y9,{title:`Create Firestore Database`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Firestore`}),`. Click `,(0,y.jsx)(`strong`,{children:`Create database`}),`. `,(0,y.jsx)(`br`,{}),`2. Keep the default location and start in `,(0,y.jsx)(`strong`,{children:`Production mode`}),`. `,(0,y.jsx)(`br`,{}),`3. Go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste the rules below, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:CHn,label:`Copy Firestore Rules`})]}),(0,y.jsxs)(Y9,{title:`Configure Storage (Optional but Recommended)`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Storage`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get started`}),`. Start in production mode. `,(0,y.jsx)(`br`,{}),`2. Once created, copy the bucket URL (e.g. `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`your-project.firebasestorage.app`}),`) and paste it into `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`VITE_FIREBASE_STORAGE_BUCKET`}),` in your `,(0,y.jsx)(`code`,{className:`text-[13px] font-bold`,children:`.env`}),`. `,(0,y.jsx)(`br`,{}),`3. In Firebase Storage, go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste tracking rules, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:wHn,label:`Copy Storage Rules`}),(0,y.jsx)(`p`,{className:`text-[12px] mt-4 opacity-60 font-medium border-l-2 border-foreground/20 pl-3`,children:`Note: Storage rules require the Blaze pay-as-you-go plan, but there are large free tiers so you won't be charged for development usage.`})]})]})]})})]})}function kHn(){let{user:e}=B(),t=(e?.displayName||e?.email?.split(`@`)[0]||`there`).split(` `)[0],n=t.charAt(0).toUpperCase()+t.slice(1);return(0,y.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 md:p-8 z-10 flex flex-col`,children:[(0,y.jsxs)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-8`,children:[(0,y.jsxs)(`h1`,{className:`w-fit inline-block text-3xl md:text-4xl lg:text-5xl font-extrabold tracking-tight mb-3 text-gradient mt-1`,children:[`Welcome back, `,n,`.`]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,y.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/dashboard`]})]}),(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 flex-1 min-h-[500px]`,children:[(0,y.jsx)(`div`,{className:`flex justify-start`,children:(0,y.jsx)(p9,{})}),(0,y.jsxs)(`div`,{className:`w-full flex-1 glass-panel rounded-3xl p-8 md:p-12 flex items-center justify-center relative overflow-hidden border border-[var(--panel-border)] shadow-2xl bg-[var(--panel-bg)]`,children:[(0,y.jsx)(`div`,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-64 h-64 bg-accent/10 blur-[100px] rounded-full pointer-events-none`}),(0,y.jsx)(K,{mode:`wait`,children:(0,y.jsxs)(q.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.3},className:`text-center z-10`,children:[(0,y.jsx)(`div`,{className:`w-16 h-16 rounded-3xl bg-accent/10 border border-accent/20 flex items-center justify-center text-accent mx-auto mb-6 shadow-inner`,children:(0,y.jsx)(Me,{className:`w-6 h-6`})}),(0,y.jsx)(`h2`,{className:`text-2xl font-extrabold text-foreground mb-2`,children:`No data added here yet`}),(0,y.jsx)(`p`,{className:`text-foreground/40 font-medium`,children:`Keep moving forward, your data will appear here.`})]})})]})]})]})}var X9=()=>(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center min-h-[60vh] z-10 animate-in fade-in duration-500`,children:[(0,y.jsx)(`div`,{className:`w-12 h-12 rounded-xl glass-panel border border-[var(--panel-border)] flex items-center justify-center mb-6 shadow-xl`,children:(0,y.jsx)(Me,{className:`w-6 h-6 text-accent animate-pulse`})}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3 glass-panel px-5 py-2.5 rounded-full border border-[var(--panel-border)]`,children:[(0,y.jsx)(`div`,{className:`w-4 h-4 border-2 border-accent border-t-transparent rounded-full animate-spin`}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold tracking-widest uppercase text-foreground/70`,children:`Connecting`})]})]});function Z9({children:e}){let{user:t,loading:n,userInactive:r,signOut:i,roleResolved:a}=B(),o=(0,b.useLocation)();return n||!a?(0,y.jsx)(X9,{}):t?r?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>i(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(o.pathname)}`})}function Q9({children:e}){let{user:t,loading:n,roleResolved:r}=B(),[i]=(0,b.useSearchParams)();return n||!r?(0,y.jsx)(X9,{}):t&&t.emailVerified?(0,y.jsx)(b.Navigate,{to:i.get(`from`)||`/dashboard`,replace:!0}):(0,y.jsx)(y.Fragment,{children:e})}function AHn({children:e}){let{user:t,loading:n,roleResolved:r}=B();return n||!r?(0,y.jsx)(X9,{}):t?t.emailVerified?(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/`})}function $9({children:e}){let{user:t,userRole:n,loading:r,userInactive:i,signOut:a,roleResolved:o}=B(),s=(0,b.useLocation)();return r||!o?(0,y.jsx)(X9,{}):t?i?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>a(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?n===`admin`?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(s.pathname)}`})}function jHn(){return(0,y.jsxs)(`div`,{className:`fixed top-0 left-0 w-full h-full pointer-events-none -z-0 overflow-hidden`,children:[(0,y.jsx)(q.div,{animate:{scale:[1,1.1,1],opacity:[.6,1,.6]},transition:{duration:12,repeat:1/0,ease:`easeInOut`},className:`absolute -top-[30%] md:-top-[400px] -right-[10%] md:-right-[200px] w-[500px] md:w-[800px] h-[500px] md:h-[800px] rounded-full bg-decorator-1 blur-[80px] md:blur-[120px]`}),(0,y.jsx)(q.div,{animate:{scale:[1,1.2,1],opacity:[.5,.9,.5]},transition:{duration:18,repeat:1/0,ease:`easeInOut`,delay:2},className:`absolute -bottom-[20%] md:-bottom-[300px] -left-[10%] md:-left-[100px] w-[400px] md:w-[600px] h-[400px] md:h-[600px] rounded-full bg-decorator-2 blur-[60px] md:blur-[100px]`})]})}function MHn(){let e=R().components?.Home||Gse;return(0,y.jsx)(z,{children:(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{}),(0,y.jsxs)(b.Routes,{children:[(0,y.jsx)(b.Route,{path:`/`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(e,{})})}),(0,y.jsx)(b.Route,{path:`/register`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(Kse,{})})}),(0,y.jsx)(b.Route,{path:`/login`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(qse,{})})}),(0,y.jsx)(b.Route,{path:`/reset-password`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(bBn,{})})}),(0,y.jsx)(b.Route,{path:`/verify`,element:(0,y.jsx)(AHn,{children:(0,y.jsx)(Jse,{})})}),(0,y.jsx)(b.Route,{path:`/templates`,element:(0,y.jsx)(OBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/inline_form`,element:(0,y.jsx)(kBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/popup_form`,element:(0,y.jsx)(ABn,{})}),(0,y.jsx)(b.Route,{path:`/templates/confirmation`,element:(0,y.jsx)(jBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/board`,element:(0,y.jsx)(GBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/table`,element:(0,y.jsx)(XVn,{})}),(0,y.jsx)(b.Route,{path:`/templates/calendar`,element:(0,y.jsx)(QVn,{})}),(0,y.jsx)(b.Route,{path:`/users`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/users/:id`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/submissions`,element:(0,y.jsx)($9,{children:(0,y.jsx)(TBn,{})})}),(0,y.jsx)(b.Route,{path:`/requests`,element:(0,y.jsx)($9,{children:(0,y.jsx)(EBn,{})})}),(0,y.jsx)(b.Route,{path:`/drive/*`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(DBn,{})})}),(0,y.jsx)(b.Route,{path:`/theme`,element:(0,y.jsx)($9,{children:(0,y.jsx)(rHn,{})})}),(0,y.jsx)(b.Route,{path:`/pages/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(uHn,{})})}),(0,y.jsx)(b.Route,{path:`/forms/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(dHn,{})})}),(0,y.jsx)(b.Route,{path:`/settings`,element:(0,y.jsx)($9,{children:(0,y.jsx)(wBn,{})})}),(0,y.jsx)(b.Route,{path:`/profile`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(yBn,{})})}),(0,y.jsx)(b.Route,{path:`/dashboard`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(kHn,{})})}),(0,y.jsx)(b.Route,{path:`/setup`,element:(0,y.jsx)(b.Navigate,{to:`/`,replace:!0})}),(0,y.jsx)(b.Route,{path:`*`,element:(0,y.jsx)(gHn,{})})]}),(0,y.jsx)(jHn,{})]})})}function NHn(){return(0,y.jsx)(b.BrowserRouter,{children:(0,y.jsx)(PHn,{})})}function PHn(){let e=R();return e.firebaseConfig&&e.firebaseConfig.apiKey&&e.firebaseConfig.apiKey.trim()!==``&&e.firebaseConfig.projectId&&e.firebaseConfig.projectId.trim()!==``||SHn()?(0,y.jsx)(MHn,{}):(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{standalone:!0}),(0,y.jsx)(OHn,{standalone:!0}),(0,y.jsx)(jHn,{})]})}function FHn(e){let t=e.firebaseConfig;return t&&t.apiKey&&t.apiKey.trim()!==``&&t.projectId&&t.projectId.trim()!==``&&E(t),(0,y.jsx)(L,{config:{firebaseConfig:e.firebaseConfig,adminEmails:e.adminEmails,basename:e.basename,onAuthChange:e.onAuthChange,themeConfig:e.themeConfig,components:e.components},children:(0,y.jsx)(F,{children:(0,y.jsx)(`div`,{className:`firebase-os flex-1 flex flex-col min-h-screen`,style:{background:`var(--bg-gradient)`,color:`var(--fg-color)`},children:(0,y.jsx)(NHn,{})})})})}exports.ContactPopup=Wo,exports.FirebaseOS=FHn,Object.defineProperty(exports,`auth`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`db`,{enumerable:!0,get:function(){return w}}),exports.defaultHomeConfig=Zo,Object.defineProperty(exports,`storage`,{enumerable:!0,get:function(){return T}}),exports.t=u,exports.useAuth=B,exports.useConfig=R,exports.useTheme=I;
618
+ };`})})]}),(0,y.jsxs)(Y9,{title:`Configure your .env file`,children:[(0,y.jsxs)(`p`,{children:[`Open the `,(0,y.jsx)(`code`,{className:`text-accent font-bold text-[13px]`,children:`.env`}),` file in your source code root. Map the keys from your Firebase Web SDK to the `,(0,y.jsx)(`code`,{className:`bg-foreground/5 rounded px-2 py-0.5 font-mono text-[11px]`,children:`VITE_ FIREBASE_`}),` variables.`]}),(0,y.jsxs)(`p`,{className:`text-[13px] bg-accent/10 border border-accent/20 p-3 rounded-xl mt-2 text-foreground/80`,children:[(0,y.jsx)(`strong`,{children:`Important:`}),` Provide your own emails in `,(0,y.jsx)(`code`,{className:`bg-background/80 rounded px-1.5 py-0.5 font-mono text-[11px]`,children:`VITE_ADMIN_EMAILS`}),` separated by commas. These users will automatically get full admin privileges upon their first registration. No quotes or spaces!`]}),(0,y.jsx)(DHn,{code:THn})]}),(0,y.jsx)(Y9,{title:`Enable Authentication`,children:(0,y.jsxs)(`p`,{children:[`1. In Firebase console Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Security`}),` → `,(0,y.jsx)(`strong`,{children:`Authentication`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get Started`}),`. `,(0,y.jsx)(`br`,{}),`2. Click the `,(0,y.jsx)(`strong`,{children:`Sign-in method`}),` tab. `,(0,y.jsx)(`br`,{}),`3. Enable `,(0,y.jsx)(`strong`,{children:`Email/Password`}),` (no need to enable email links). `,(0,y.jsx)(`br`,{}),`4. Enable `,(0,y.jsx)(`strong`,{children:`Google`}),`. `,(0,y.jsx)(`br`,{}),`5. Enable `,(0,y.jsx)(`strong`,{children:`Anonymous`}),`.`]})}),(0,y.jsxs)(Y9,{title:`Create Firestore Database`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Firestore`}),`. Click `,(0,y.jsx)(`strong`,{children:`Create database`}),`. `,(0,y.jsx)(`br`,{}),`2. Keep the default location and start in `,(0,y.jsx)(`strong`,{children:`Production mode`}),`. `,(0,y.jsx)(`br`,{}),`3. Go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste the rules below, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:CHn,label:`Copy Firestore Rules`})]}),(0,y.jsxs)(Y9,{title:`Configure Storage (Optional but Recommended)`,children:[(0,y.jsxs)(`p`,{children:[`1. In the Sidebar, go to `,(0,y.jsx)(`strong`,{children:`Product categories`}),` → `,(0,y.jsx)(`strong`,{children:`Database and Storage`}),` → `,(0,y.jsx)(`strong`,{children:`Storage`}),`. Click `,(0,y.jsx)(`strong`,{children:`Get started`}),`. Start in production mode. `,(0,y.jsx)(`br`,{}),`2. Once created, copy the bucket URL (e.g. `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`your-project.firebasestorage.app`}),`) and paste it into `,(0,y.jsx)(`code`,{className:`text-[12px] bg-foreground/5 rounded px-1.5 py-0.5`,children:`VITE_FIREBASE_STORAGE_BUCKET`}),` in your `,(0,y.jsx)(`code`,{className:`text-[13px] font-bold`,children:`.env`}),`. `,(0,y.jsx)(`br`,{}),`3. In Firebase Storage, go to the `,(0,y.jsx)(`strong`,{children:`Rules`}),` tab, paste tracking rules, and click `,(0,y.jsx)(`strong`,{children:`Publish`}),`.`]}),(0,y.jsx)(EHn,{code:wHn,label:`Copy Storage Rules`}),(0,y.jsx)(`p`,{className:`text-[12px] mt-4 opacity-60 font-medium border-l-2 border-foreground/20 pl-3`,children:`Note: Storage rules require the Blaze pay-as-you-go plan, but there are large free tiers so you won't be charged for development usage.`})]})]})]})})]})}function kHn(){let{user:e}=B(),t=(e?.displayName||e?.email?.split(`@`)[0]||`there`).split(` `)[0],n=t.charAt(0).toUpperCase()+t.slice(1);return(0,y.jsxs)(`main`,{className:`flex-1 w-full max-w-7xl mx-auto p-4 md:p-8 z-10 flex flex-col`,children:[(0,y.jsxs)(q.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:`mb-8`,children:[(0,y.jsxs)(`h1`,{className:`w-fit inline-block text-3xl md:text-4xl lg:text-5xl font-extrabold tracking-tight mb-3 text-gradient mt-1`,children:[`Welcome back, `,n,`.`]}),(0,y.jsxs)(`div`,{className:`flex items-center gap-2 text-foreground/40 font-bold uppercase tracking-[0.2em] text-[11px]`,children:[(0,y.jsx)(`span`,{className:`w-8 h-[1px] bg-foreground/10`}),`/dashboard`]})]}),(0,y.jsxs)(`div`,{className:`flex flex-col gap-4 flex-1 min-h-[500px]`,children:[(0,y.jsx)(`div`,{className:`flex justify-start`,children:(0,y.jsx)(p9,{})}),(0,y.jsxs)(`div`,{className:`w-full flex-1 glass-panel rounded-3xl p-8 md:p-12 flex items-center justify-center relative overflow-hidden border border-[var(--panel-border)] shadow-2xl bg-[var(--panel-bg)]`,children:[(0,y.jsx)(`div`,{className:`absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-64 h-64 bg-accent/10 blur-[100px] rounded-full pointer-events-none`}),(0,y.jsx)(K,{mode:`wait`,children:(0,y.jsxs)(q.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},transition:{duration:.3},className:`text-center z-10`,children:[(0,y.jsx)(`div`,{className:`w-16 h-16 rounded-3xl bg-accent/10 border border-accent/20 flex items-center justify-center text-accent mx-auto mb-6 shadow-inner`,children:(0,y.jsx)(Me,{className:`w-6 h-6`})}),(0,y.jsx)(`h2`,{className:`text-2xl font-extrabold text-foreground mb-2`,children:`No data added here yet`}),(0,y.jsx)(`p`,{className:`text-foreground/40 font-medium`,children:`Keep moving forward, your data will appear here.`})]})})]})]})]})}var X9=()=>(0,y.jsxs)(`div`,{className:`flex-1 flex flex-col items-center justify-center min-h-[60vh] z-10 animate-in fade-in duration-500`,children:[(0,y.jsx)(`div`,{className:`w-12 h-12 rounded-xl glass-panel border border-[var(--panel-border)] flex items-center justify-center mb-6 shadow-xl`,children:(0,y.jsx)(Me,{className:`w-6 h-6 text-accent animate-pulse`})}),(0,y.jsxs)(`div`,{className:`flex items-center gap-3 glass-panel px-5 py-2.5 rounded-full border border-[var(--panel-border)]`,children:[(0,y.jsx)(`div`,{className:`w-4 h-4 border-2 border-accent border-t-transparent rounded-full animate-spin`}),(0,y.jsx)(`span`,{className:`text-[13px] font-bold tracking-widest uppercase text-foreground/70`,children:`Connecting`})]})]});function Z9({children:e}){let{user:t,loading:n,userInactive:r,signOut:i,roleResolved:a}=B(),o=(0,b.useLocation)();return n||!a?(0,y.jsx)(X9,{}):t?r?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>i(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(o.pathname)}`})}function Q9({children:e}){let{user:t,loading:n,roleResolved:r}=B(),[i]=(0,b.useSearchParams)();return n||!r?(0,y.jsx)(X9,{}):t&&t.emailVerified?(0,y.jsx)(b.Navigate,{to:i.get(`from`)||`/dashboard`,replace:!0}):(0,y.jsx)(y.Fragment,{children:e})}function AHn({children:e}){let{user:t,loading:n,roleResolved:r}=B();return n||!r?(0,y.jsx)(X9,{}):t?t.emailVerified?(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/`})}function $9({children:e}){let{user:t,userRole:n,loading:r,userInactive:i,signOut:a,roleResolved:o}=B(),s=(0,b.useLocation)();return r||!o?(0,y.jsx)(X9,{}):t?i?(0,y.jsx)(`div`,{className:`flex-1 flex flex-col items-center justify-center relative z-10 min-h-[60vh] animate-in fade-in duration-500`,children:(0,y.jsxs)(`div`,{className:`glass-panel p-8 md:p-10 rounded-3xl border border-red-500/20 text-center shadow-xl max-w-sm w-full relative overflow-hidden`,children:[(0,y.jsx)(`div`,{className:`absolute inset-0 bg-red-500/5`}),(0,y.jsx)(`h2`,{className:`text-2xl font-black text-red-500 mb-3 relative z-10 tracking-tight`,children:`Access Denied`}),(0,y.jsx)(`p`,{className:`text-[14px] text-foreground/70 font-medium leading-relaxed relative z-10 mb-6`,children:`You don't have access to this app. Please contact the administrator.`}),(0,y.jsx)(`button`,{onClick:()=>a(),className:`w-full relative z-10 py-2.5 bg-foreground/5 hover:bg-foreground/10 text-foreground text-[14px] font-bold rounded-xl transition-colors`,children:`Sign Out`})]})}):t.emailVerified?n===`admin`?(0,y.jsx)(y.Fragment,{children:e}):(0,y.jsx)(b.Navigate,{to:`/dashboard`}):(0,y.jsx)(b.Navigate,{to:`/verify`}):(0,y.jsx)(b.Navigate,{to:`/login?from=${encodeURIComponent(s.pathname)}`})}function jHn(){return(0,y.jsxs)(`div`,{className:`fixed top-0 left-0 w-full h-full pointer-events-none -z-0 overflow-hidden`,children:[(0,y.jsx)(q.div,{animate:{scale:[1,1.1,1],opacity:[.6,1,.6]},transition:{duration:12,repeat:1/0,ease:`easeInOut`},className:`absolute -top-[30%] md:-top-[400px] -right-[10%] md:-right-[200px] w-[500px] md:w-[800px] h-[500px] md:h-[800px] rounded-full bg-decorator-1 blur-[80px] md:blur-[120px]`}),(0,y.jsx)(q.div,{animate:{scale:[1,1.2,1],opacity:[.5,.9,.5]},transition:{duration:18,repeat:1/0,ease:`easeInOut`,delay:2},className:`absolute -bottom-[20%] md:-bottom-[300px] -left-[10%] md:-left-[100px] w-[400px] md:w-[600px] h-[400px] md:h-[600px] rounded-full bg-decorator-2 blur-[60px] md:blur-[100px]`})]})}function MHn(){let e=R().components?.Home||Gse;return(0,y.jsx)(z,{children:(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{}),(0,y.jsxs)(b.Routes,{children:[(0,y.jsx)(b.Route,{path:`/`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(e,{})})}),(0,y.jsx)(b.Route,{path:`/register`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(Kse,{})})}),(0,y.jsx)(b.Route,{path:`/login`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(qse,{})})}),(0,y.jsx)(b.Route,{path:`/reset-password`,element:(0,y.jsx)(Q9,{children:(0,y.jsx)(bBn,{})})}),(0,y.jsx)(b.Route,{path:`/verify`,element:(0,y.jsx)(AHn,{children:(0,y.jsx)(Jse,{})})}),(0,y.jsx)(b.Route,{path:`/templates`,element:(0,y.jsx)(OBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/inline_form`,element:(0,y.jsx)(kBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/popup_form`,element:(0,y.jsx)(ABn,{})}),(0,y.jsx)(b.Route,{path:`/templates/confirmation`,element:(0,y.jsx)(jBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/board`,element:(0,y.jsx)(GBn,{})}),(0,y.jsx)(b.Route,{path:`/templates/table`,element:(0,y.jsx)(XVn,{})}),(0,y.jsx)(b.Route,{path:`/templates/calendar`,element:(0,y.jsx)(QVn,{})}),(0,y.jsx)(b.Route,{path:`/users`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/users/:id`,element:(0,y.jsx)($9,{children:(0,y.jsx)(xBn,{})})}),(0,y.jsx)(b.Route,{path:`/submissions`,element:(0,y.jsx)($9,{children:(0,y.jsx)(TBn,{})})}),(0,y.jsx)(b.Route,{path:`/requests`,element:(0,y.jsx)($9,{children:(0,y.jsx)(EBn,{})})}),(0,y.jsx)(b.Route,{path:`/drive/*`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(DBn,{})})}),(0,y.jsx)(b.Route,{path:`/theme`,element:(0,y.jsx)($9,{children:(0,y.jsx)(rHn,{})})}),(0,y.jsx)(b.Route,{path:`/pages/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(uHn,{})})}),(0,y.jsx)(b.Route,{path:`/forms/*`,element:(0,y.jsx)($9,{children:(0,y.jsx)(dHn,{})})}),(0,y.jsx)(b.Route,{path:`/settings`,element:(0,y.jsx)($9,{children:(0,y.jsx)(wBn,{})})}),(0,y.jsx)(b.Route,{path:`/profile`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(yBn,{})})}),(0,y.jsx)(b.Route,{path:`/dashboard`,element:(0,y.jsx)(Z9,{children:(0,y.jsx)(kHn,{})})}),(0,y.jsx)(b.Route,{path:`/setup`,element:(0,y.jsx)(OHn,{})}),(0,y.jsx)(b.Route,{path:`*`,element:(0,y.jsx)(gHn,{})})]}),(0,y.jsx)(jHn,{})]})})}function NHn(){return(0,y.jsx)(b.BrowserRouter,{children:(0,y.jsx)(PHn,{})})}function PHn(){let e=R();return e.firebaseConfig&&e.firebaseConfig.apiKey&&e.firebaseConfig.apiKey.trim()!==``&&e.firebaseConfig.projectId&&e.firebaseConfig.projectId.trim()!==``||SHn()?(0,y.jsx)(MHn,{}):(0,y.jsxs)(`div`,{className:`min-h-screen relative flex flex-col overflow-x-hidden`,children:[(0,y.jsx)(Xo,{standalone:!0}),(0,y.jsx)(OHn,{standalone:!0}),(0,y.jsx)(jHn,{})]})}function FHn(e){let t=e.firebaseConfig;return t&&t.apiKey&&t.apiKey.trim()!==``&&t.projectId&&t.projectId.trim()!==``&&E(t),(0,y.jsx)(L,{config:{firebaseConfig:e.firebaseConfig,adminEmails:e.adminEmails,basename:e.basename,onAuthChange:e.onAuthChange,themeConfig:e.themeConfig,components:e.components},children:(0,y.jsx)(F,{children:(0,y.jsx)(`div`,{className:`firebase-os flex-1 flex flex-col min-h-screen`,style:{background:`var(--bg-gradient)`,color:`var(--fg-color)`},children:(0,y.jsx)(NHn,{})})})})}exports.ContactPopup=Wo,exports.FirebaseOS=FHn,Object.defineProperty(exports,`auth`,{enumerable:!0,get:function(){return C}}),Object.defineProperty(exports,`db`,{enumerable:!0,get:function(){return w}}),exports.defaultHomeConfig=Zo,Object.defineProperty(exports,`storage`,{enumerable:!0,get:function(){return T}}),exports.t=u,exports.useAuth=B,exports.useConfig=R,exports.useTheme=I;
@@ -90391,10 +90391,7 @@ function FUn() {
90391
90391
  }),
90392
90392
  /* @__PURE__ */ B(U, {
90393
90393
  path: "/setup",
90394
- element: /* @__PURE__ */ B(be, {
90395
- to: "/",
90396
- replace: !0
90397
- })
90394
+ element: /* @__PURE__ */ B(jUn, {})
90398
90395
  }),
90399
90396
  /* @__PURE__ */ B(U, {
90400
90397
  path: "*",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "firebase-os",
3
- "version": "1.1.9",
3
+ "version": "1.2.1",
4
4
  "description": "A complete Firebase-powered admin OS — one React component.",
5
5
  "type": "module",
6
6
  "main": "dist/firebase-os.cjs.js",
@@ -42,18 +42,18 @@
42
42
  "@types/react-dom": "^19.2.3",
43
43
  "@vitejs/plugin-react": "^6.0.1",
44
44
  "clsx": "^2.1.1",
45
- "firebase": "^12.11.0",
45
+ "firebase": ">=10",
46
46
  "framer-motion": "^12.38.0",
47
47
  "fuse.js": "^7.3.0",
48
48
  "iconoir": "^7.11.0",
49
49
  "iconoir-react": "^7.11.0",
50
50
  "lucide-react": "^1.7.0",
51
- "react": "^19.2.4",
52
- "react-dom": "^19.2.4",
51
+ "react": ">=18",
52
+ "react-dom": ">=18",
53
53
  "react-dropzone": "^15.0.0",
54
54
  "react-international-phone": "^4.8.0",
55
55
  "react-phone-number-input": "^3.4.16",
56
- "react-router-dom": "^7.13.2",
56
+ "react-router-dom": ">=6",
57
57
  "tailwind-merge": "^3.5.0",
58
58
  "tailwindcss": "^4.2.2",
59
59
  "typescript": "~5.9.3",
@@ -73,9 +73,9 @@
73
73
  "vitest": "^4.1.2"
74
74
  },
75
75
  "peerDependencies": {
76
+ "firebase": ">=10",
76
77
  "react": ">=18",
77
78
  "react-dom": ">=18",
78
- "react-router-dom": ">=6",
79
- "firebase": ">=10"
79
+ "react-router-dom": ">=6"
80
80
  }
81
81
  }
package/src/App.tsx CHANGED
@@ -160,8 +160,8 @@ function AuthenticatedApp() {
160
160
  <Route path="/profile" element={<PrivateRoute><Profile /></PrivateRoute>} />
161
161
  <Route path="/dashboard" element={<PrivateRoute><Dashboard /></PrivateRoute>} />
162
162
 
163
- {/* Setup Redirect (if already done, don't show it via route) */}
164
- <Route path="/setup" element={<Navigate to="/" replace />} />
163
+ {/* Setup (accessible even after completion for reference) */}
164
+ <Route path="/setup" element={<Setup />} />
165
165
 
166
166
  {/* Dynamic Content Routing */}
167
167
  <Route path="*" element={<DynamicPage />} />