slidecanvas 1.0.1 → 1.0.3
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.
- package/README.md +84 -8
- package/dist/index.d.mts +8 -1
- package/dist/index.d.ts +8 -1
- package/dist/index.js +8 -7
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +8 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -7,9 +7,10 @@
|
|
|
7
7
|
## Key Features
|
|
8
8
|
|
|
9
9
|
- **Pixel-Perfect Rendering**: High-fidelity display of slides using a sophisticated Fabric.js-based canvas.
|
|
10
|
-
- **AI-Powered Editing**: Integrated Gemini AI for smart text manipulation (Shorten, Reframe, Lengthen).
|
|
10
|
+
- **AI-Powered Editing**: Integrated Gemini AI for smart text manipulation (Shorten, Reframe, Lengthen) with side-by-side controls.
|
|
11
11
|
- **Enterprise-Grade Parsing**: Deep internal processing of XML-based PPTX structures.
|
|
12
|
-
- **
|
|
12
|
+
- **Professional Ribbon UI**: A high-density, Microsoft Office-style toolbar layout (120px height) with optimized visibility for all controls.
|
|
13
|
+
- **Smart Actions Group**: Prominent buttons for Present, Export (PPTX), and Delete, with a subtle "Saved" status indicator.
|
|
13
14
|
- **Professional Export**: High-quality `.pptx` generation with support for transparency and layout mapping.
|
|
14
15
|
- **S3 & Remote Support**: Built-in architecture for loading presentations via secure proxy tunnels.
|
|
15
16
|
|
|
@@ -238,14 +239,89 @@ async function extractCaptions(fileBuffer: ArrayBuffer) {
|
|
|
238
239
|
## API Reference
|
|
239
240
|
|
|
240
241
|
### `<PptEditor />`
|
|
242
|
+
### Properties
|
|
241
243
|
|
|
242
|
-
|
|
|
244
|
+
| Property | Type | Default | Description |
|
|
243
245
|
| :--- | :--- | :--- | :--- |
|
|
244
|
-
| `
|
|
245
|
-
| `
|
|
246
|
-
| `
|
|
247
|
-
| `
|
|
248
|
-
| `
|
|
246
|
+
| `width` | `number \| string` | **Required** | The width of the editor container. |
|
|
247
|
+
| `height` | `number \| string` | **Required** | The height of the editor container. |
|
|
248
|
+
| `initialPresentation` | `Presentation` | `undefined` | Initial presentation data to load. |
|
|
249
|
+
| `url` | `string` | `undefined` | URL of a public .pptx file to load on mount. |
|
|
250
|
+
| `initialSource` | `'scratch' \| 'uploaded' \| 'url'` | `undefined` | Sets the initial UI source state and badge. |
|
|
251
|
+
| `appName` | `string` | `"SlideCanvas"` | Brand name shown in the ribbon. |
|
|
252
|
+
| `appBgColor` | `string` | `"#B7472A"` | Primary brand color for the UI. |
|
|
253
|
+
| `geminiApiKey` | `string` | `undefined` | API key for built-in AI text actions. |
|
|
254
|
+
| `showHomeOnEmpty` | `boolean` | `false` | Shows a "New / Upload" splash if no data provided. |
|
|
255
|
+
| `onChange` | `(pres: Presentation) => void` | `undefined` | Fired on any change to the deck. |
|
|
256
|
+
| `onSourceChange` | `(src, url?) => void` | `undefined` | Fired when the deck origin changes (useful for routing). |
|
|
257
|
+
|
|
258
|
+
### Usage Examples
|
|
259
|
+
|
|
260
|
+
#### 1. Branded Full-Screen Editor
|
|
261
|
+
Perfect for a standalone presentation app.
|
|
262
|
+
```tsx
|
|
263
|
+
import { PptEditor } from 'slidecanvas';
|
|
264
|
+
|
|
265
|
+
export default function MyEditor() {
|
|
266
|
+
return (
|
|
267
|
+
<div style={{ width: '100vw', height: '100vh' }}>
|
|
268
|
+
<PptEditor
|
|
269
|
+
width="100%"
|
|
270
|
+
height="100%"
|
|
271
|
+
appName="SkyDeck"
|
|
272
|
+
appBgColor="#0f172a" // Custom dark theme
|
|
273
|
+
showHomeOnEmpty={true} // Show the splash screen if no PPT loaded
|
|
274
|
+
/>
|
|
275
|
+
</div>
|
|
276
|
+
);
|
|
277
|
+
}
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
#### 2. AI-Powered Assistant
|
|
281
|
+
Enable Gemini-driven text refinements and slide generation.
|
|
282
|
+
```tsx
|
|
283
|
+
<PptEditor
|
|
284
|
+
width={1200}
|
|
285
|
+
height={800}
|
|
286
|
+
geminiApiKey={process.env.NEXT_PUBLIC_GEMINI_API_KEY}
|
|
287
|
+
appName="AI Slides"
|
|
288
|
+
/>
|
|
289
|
+
```
|
|
290
|
+
|
|
291
|
+
#### 3. Deep-Linking & URL Sync (Next.js)
|
|
292
|
+
Synchronize the editor's source (Scratch, Uploaded, or Remote) with your browser's address bar.
|
|
293
|
+
```tsx
|
|
294
|
+
const router = useRouter();
|
|
295
|
+
const searchParams = useSearchParams();
|
|
296
|
+
|
|
297
|
+
<PptEditor
|
|
298
|
+
width="100vw"
|
|
299
|
+
height="100vh"
|
|
300
|
+
url={searchParams.get('url')}
|
|
301
|
+
initialSource={searchParams.get('source')} // 'scratch' | 'uploaded' | 'url'
|
|
302
|
+
onSourceChange={(source, url) => {
|
|
303
|
+
// Dynamically update URL as user switches between 'Create New' and 'Upload'
|
|
304
|
+
const query = url ? `?url=${url}` : `?source=${source}`;
|
|
305
|
+
router.push(`/editor${query}`);
|
|
306
|
+
}}
|
|
307
|
+
/>
|
|
308
|
+
```
|
|
309
|
+
|
|
310
|
+
### Advanced Features
|
|
311
|
+
|
|
312
|
+
#### Visual Shape Selection
|
|
313
|
+
The editor includes a rich selection of 30+ SVG shapes out of the box. The shapes are fully responsive and scale accurately with the editor's dimensions.
|
|
314
|
+
|
|
315
|
+
#### Professional Ribbon UI
|
|
316
|
+
SlideCanvas features a sophisticated 120px high ribbon layout divided into logical groups:
|
|
317
|
+
- **Slides**: New slide creation and layout switching (Title, Content, Split).
|
|
318
|
+
- **Font**: Full-width family and size selectors with comprehensive formatting tools.
|
|
319
|
+
- **Drawing**: Instant access to Shapes, Text Boxes, and Image uploads.
|
|
320
|
+
- **AI Text**: Side-by-side buttons for intelligent content transformation.
|
|
321
|
+
- **Actions**: Large, accessible buttons for primary workflows like Presenting and Exporting.
|
|
322
|
+
|
|
323
|
+
#### Intelligent Routing
|
|
324
|
+
Use the `onSourceChange` callback to synchronize the editor state with your application's routing. This allows for deep-linking to specific presentations or maintaining "Upload" vs "New" states in the address bar.
|
|
249
325
|
|
|
250
326
|
### `PptxParser` & `PptxExporter`
|
|
251
327
|
|
package/dist/index.d.mts
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
type ElementType = 'text' | 'image' | 'shape';
|
|
4
4
|
type ShapeType = 'rect' | 'ellipse' | 'triangle' | 'line';
|
|
5
|
+
type PresentationSource = 'scratch' | 'uploaded' | 'url';
|
|
5
6
|
interface BaseElement {
|
|
6
7
|
id: string;
|
|
7
8
|
type: ElementType;
|
|
@@ -53,6 +54,12 @@ interface PptEditorProps {
|
|
|
53
54
|
appName?: string;
|
|
54
55
|
onChange?: (presentation: Presentation) => void;
|
|
55
56
|
geminiApiKey?: string;
|
|
57
|
+
width: number | string;
|
|
58
|
+
height: number | string;
|
|
59
|
+
appBgColor?: string;
|
|
60
|
+
showHomeOnEmpty?: boolean;
|
|
61
|
+
initialSource?: PresentationSource;
|
|
62
|
+
onSourceChange?: (source: PresentationSource, url?: string) => void;
|
|
56
63
|
}
|
|
57
64
|
declare const PptEditor: React.FC<PptEditorProps>;
|
|
58
65
|
|
|
@@ -76,4 +83,4 @@ declare class PptxExporter {
|
|
|
76
83
|
export(presentation: Presentation): Promise<void>;
|
|
77
84
|
}
|
|
78
85
|
|
|
79
|
-
export { type BaseElement, type ElementType, type ImageElement, PptEditor, PptxExporter, PptxParser, type Presentation, type ShapeElement, type ShapeType, type Slide, type SlideElement, type TextElement };
|
|
86
|
+
export { type BaseElement, type ElementType, type ImageElement, PptEditor, PptxExporter, PptxParser, type Presentation, type PresentationSource, type ShapeElement, type ShapeType, type Slide, type SlideElement, type TextElement };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,6 +2,7 @@ import React from 'react';
|
|
|
2
2
|
|
|
3
3
|
type ElementType = 'text' | 'image' | 'shape';
|
|
4
4
|
type ShapeType = 'rect' | 'ellipse' | 'triangle' | 'line';
|
|
5
|
+
type PresentationSource = 'scratch' | 'uploaded' | 'url';
|
|
5
6
|
interface BaseElement {
|
|
6
7
|
id: string;
|
|
7
8
|
type: ElementType;
|
|
@@ -53,6 +54,12 @@ interface PptEditorProps {
|
|
|
53
54
|
appName?: string;
|
|
54
55
|
onChange?: (presentation: Presentation) => void;
|
|
55
56
|
geminiApiKey?: string;
|
|
57
|
+
width: number | string;
|
|
58
|
+
height: number | string;
|
|
59
|
+
appBgColor?: string;
|
|
60
|
+
showHomeOnEmpty?: boolean;
|
|
61
|
+
initialSource?: PresentationSource;
|
|
62
|
+
onSourceChange?: (source: PresentationSource, url?: string) => void;
|
|
56
63
|
}
|
|
57
64
|
declare const PptEditor: React.FC<PptEditorProps>;
|
|
58
65
|
|
|
@@ -76,4 +83,4 @@ declare class PptxExporter {
|
|
|
76
83
|
export(presentation: Presentation): Promise<void>;
|
|
77
84
|
}
|
|
78
85
|
|
|
79
|
-
export { type BaseElement, type ElementType, type ImageElement, PptEditor, PptxExporter, PptxParser, type Presentation, type ShapeElement, type ShapeType, type Slide, type SlideElement, type TextElement };
|
|
86
|
+
export { type BaseElement, type ElementType, type ImageElement, PptEditor, PptxExporter, PptxParser, type Presentation, type PresentationSource, type ShapeElement, type ShapeType, type Slide, type SlideElement, type TextElement };
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
"use strict";var Oe=Object.create;var ne=Object.defineProperty,He=Object.defineProperties,je=Object.getOwnPropertyDescriptor,Xe=Object.getOwnPropertyDescriptors,We=Object.getOwnPropertyNames,ge=Object.getOwnPropertySymbols,Ge=Object.getPrototypeOf,ye=Object.prototype.hasOwnProperty,Ye=Object.prototype.propertyIsEnumerable;var be=(m,o,l)=>o in m?ne(m,o,{enumerable:!0,configurable:!0,writable:!0,value:l}):m[o]=l,w=(m,o)=>{for(var l in o||(o={}))ye.call(o,l)&&be(m,l,o[l]);if(ge)for(var l of ge(o))Ye.call(o,l)&&be(m,l,o[l]);return m},I=(m,o)=>He(m,Xe(o));var _e=(m,o)=>{for(var l in o)ne(m,l,{get:o[l],enumerable:!0})},ve=(m,o,l,c)=>{if(o&&typeof o=="object"||typeof o=="function")for(let g of We(o))!ye.call(m,g)&&g!==l&&ne(m,g,{get:()=>o[g],enumerable:!(c=je(o,g))||c.enumerable});return m};var pe=(m,o,l)=>(l=m!=null?Oe(Ge(m)):{},ve(o||!m||!m.__esModule?ne(l,"default",{value:m,enumerable:!0}):l,m)),Ke=m=>ve(ne({},"__esModule",{value:!0}),m);var tt={};_e(tt,{PptEditor:()=>et,PptxExporter:()=>oe,PptxParser:()=>le});module.exports=Ke(tt);var z=require("react");var M=pe(require("react")),x=require("lucide-react");var we=require("clsx"),Ne=require("tailwind-merge");function E(...m){return(0,Ne.twMerge)((0,we.clsx)(m))}var e=require("react/jsx-runtime"),Ve=["Inter","Lato","Open Sans","Poppins","Roboto","Roboto Slab","Georgia","Playfair Display","Merriweather","Nunito Sans","Montserrat","Oswald","Raleway","Ubuntu","Lora","PT Sans","PT Serif","Play","Arvo","Kanit","Times New Roman","Arial"],qe=[12,14,16,18,20,24,28,32,36,48,64,72,96],Je=[{name:"Basic Shapes",shapes:["rect","circle","triangle","rightTriangle","rhombus","parallelogram","trapezoid","pentagon","hexagon","heptagon","octagon","heart","smiley","sun","moon"]},{name:"Arrows",shapes:["arrowRight","arrowLeft","arrowUp","arrowDown","arrowLeftRight","arrowUpDown"]},{name:"Stars & Symbols",shapes:["star4","star5","star6","star8","cloud","lightning"]},{name:"Equation Shapes",shapes:["plus","minus","multiply","divide","equal"]}],Ze=({onAddShape:m})=>{let[o,l]=(0,M.useState)(!1);return M.default.useEffect(()=>(window._toggleShapesMenu=()=>l(!o),()=>{window._toggleShapesMenu=void 0}),[o]),o?(0,e.jsx)("div",{className:"absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-2xl shadow-2xl p-4 w-[320px] max-h-[480px] overflow-y-auto z-[100] animate-in fade-in zoom-in-95 duration-200",children:(0,e.jsx)("div",{className:"flex flex-col gap-6",children:Je.map(c=>(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsx)("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400 px-1",children:c.name}),(0,e.jsx)("div",{className:"grid grid-cols-5 gap-1",children:c.shapes.map(g=>(0,e.jsx)("button",{onClick:()=>{m(g),l(!1)},className:"aspect-square hover:bg-slate-50 rounded-lg flex items-center justify-center border border-transparent hover:border-slate-100 transition-all group",title:g,children:(0,e.jsx)("div",{className:"w-6 h-6 bg-slate-100 rounded-sm group-hover:bg-blue-100 group-hover:scale-110 transition-all flex items-center justify-center overflow-hidden",children:(0,e.jsx)("div",{className:"text-[8px] font-bold text-slate-400 group-hover:text-blue-600 uppercase text-center scale-[0.8] leading-tight",children:g.slice(0,3)})})},g))})]},c.name))})}):null},Se=({onAddText:m,onAddImage:o,onAddShape:l,onAddSlide:c,onExport:g,onFormatText:p,onDeleteElement:N,onApplyLayout:v,onPlay:f,selectedElement:i,appName:y,onAiAction:a,onAiResponseAction:b,aiResponse:s,isAiLoading:t,onNewPresentation:n,onLoadPresentation:u})=>{let S=M.default.useRef(null),[L,U]=(0,M.useState)("Home"),[O,X]=(0,M.useState)(!1),[W,G]=(0,M.useState)(!1),[Y,P]=(0,M.useState)(!1),[ie,F]=(0,M.useState)(!1),[_,K]=(0,M.useState)("file"),[B,q]=(0,M.useState)(""),T=(i==null?void 0:i.type)==="text",re=(i==null?void 0:i.type)==="shape",ue="#B7472A";return(0,e.jsxs)("div",{className:"flex flex-col border-b border-slate-200 bg-white z-50 select-none",children:[(0,e.jsxs)("div",{className:"flex items-center bg-[#F3F2F1] border-b border-slate-200 h-10",children:[(0,e.jsx)("div",{className:"flex items-center h-full px-4 border-r border-slate-200 mr-2 bg-[#B7472A] text-white",children:(0,e.jsx)("span",{className:"font-black text-xs tracking-tighter capitalize",children:y})}),(0,e.jsxs)("div",{className:"flex h-full relative",children:[(0,e.jsx)("button",{onClick:()=>P(!Y),className:E("px-4 h-10 transition-all flex items-center text-xs font-semibold relative",Y?"text-white bg-[#B7472A]":"text-slate-600 hover:bg-slate-200/50"),children:"File"}),Y&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"fixed inset-0 z-[140]",onClick:()=>P(!1)}),(0,e.jsxs)("div",{className:"absolute top-10 left-0 w-48 bg-white border border-slate-200 shadow-xl rounded-b-xl z-[150] py-2 animate-in fade-in slide-in-from-top-1 duration-200",children:[(0,e.jsxs)("button",{onClick:()=>{n(),P(!1)},className:"w-full text-left px-4 py-2 text-xs text-slate-700 hover:bg-slate-50 flex items-center gap-3 transition-colors",children:[(0,e.jsx)(x.Plus,{size:14,className:"text-slate-400"}),(0,e.jsx)("span",{children:"Create New"})]}),(0,e.jsxs)("button",{onClick:()=>{F(!0),P(!1)},className:"w-full text-left px-4 py-2 text-xs text-slate-700 hover:bg-slate-50 flex items-center gap-3 transition-colors",children:[(0,e.jsx)(x.Download,{size:14,className:"text-slate-400"}),(0,e.jsx)("span",{children:"Upload"})]}),(0,e.jsx)("div",{className:"h-[1px] bg-slate-100 my-1 mx-2"}),(0,e.jsxs)("button",{onClick:()=>{g(),P(!1)},className:"w-full text-left px-4 py-2 text-xs text-slate-700 hover:bg-slate-50 flex items-center gap-3 transition-colors",children:[(0,e.jsx)(x.Share2,{size:14,className:"text-slate-400"}),(0,e.jsx)("span",{children:"Export PPTX"})]})]})]})]}),(0,e.jsx)("div",{className:"flex-1"}),(0,e.jsxs)("div",{className:"flex items-center gap-4 px-4 text-slate-400",children:[(0,e.jsx)("div",{className:"h-4 w-[1px] bg-slate-200"}),(0,e.jsx)(x.Play,{size:16,className:"cursor-pointer hover:text-[#B7472A] transition-colors",onClick:f})]})]}),(0,e.jsxs)("div",{className:"bg-white h-[96px] flex items-center px-6 gap-8 justify-start",children:[(0,e.jsxs)("div",{className:"flex flex-col items-center border-r border-slate-100 pr-8 py-1 min-w-[140px]",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,e.jsxs)("button",{onClick:c,className:"flex flex-col items-center justify-center p-2 hover:bg-slate-50 rounded-xl group transition-all",children:[(0,e.jsx)("div",{className:"bg-orange-50 p-2 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(x.Plus,{size:22,className:"text-[#B7472A]"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700 mt-1",children:"New Slide"})]}),(0,e.jsxs)("div",{className:"relative",children:[(0,e.jsxs)("button",{onClick:()=>X(!O),className:E("p-2 hover:bg-slate-50 rounded-xl transition-all flex flex-col items-center",O&&"bg-slate-100"),children:[(0,e.jsx)(x.Layout,{size:20,className:"text-slate-500"}),(0,e.jsx)("span",{className:"text-[10px] font-medium text-slate-500 mt-1",children:"Layout"})]}),O&&(0,e.jsxs)("div",{className:"absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-xl shadow-2xl p-2 w-56 flex flex-col gap-1 z-[100] animate-in fade-in zoom-in-95 duration-200",children:[(0,e.jsxs)("button",{onClick:()=>{v("title"),X(!1)},className:"flex items-center gap-3 px-4 py-2.5 hover:bg-slate-50 rounded-lg text-xs font-semibold text-slate-700 transition-colors border border-transparent hover:border-slate-100",children:[(0,e.jsx)(x.FileText,{size:16,className:"text-blue-500"})," Title Slide"]}),(0,e.jsxs)("button",{onClick:()=>{v("content"),X(!1)},className:"flex items-center gap-3 px-4 py-2.5 hover:bg-slate-50 rounded-lg text-xs font-semibold text-slate-700 transition-colors border border-transparent hover:border-slate-100",children:[(0,e.jsx)(x.List,{size:16,className:"text-emerald-500"})," Title & Content"]}),(0,e.jsxs)("button",{onClick:()=>{v("split"),X(!1)},className:"flex items-center gap-3 px-4 py-2.5 hover:bg-slate-50 rounded-lg text-xs font-semibold text-slate-700 transition-colors border border-transparent hover:border-slate-100",children:[(0,e.jsx)(x.Columns,{size:16,className:"text-purple-500"})," Two Columns"]})]})]})]}),(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Slides"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center border-r border-slate-100 px-8 py-1",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2 min-w-[220px]",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsx)("select",{disabled:!T,value:(i==null?void 0:i.fontFamily)||"Arial",onChange:A=>p({fontFamily:A.target.value}),className:"h-8 px-3 text-xs text-slate-900 border border-slate-200 rounded-lg font-semibold bg-white hover:border-slate-300 outline-none w-36 disabled:opacity-50 transition-colors appearance-none cursor-pointer",children:Ve.map(A=>(0,e.jsx)("option",{value:A,children:A},A))}),(0,e.jsx)("select",{disabled:!T,value:(i==null?void 0:i.fontSize)||24,onChange:A=>p({fontSize:parseInt(A.target.value)}),className:"h-8 px-2 text-xs text-slate-900 border border-slate-200 rounded-lg font-semibold bg-white hover:border-slate-300 outline-none w-16 disabled:opacity-50 transition-colors appearance-none cursor-pointer text-center",children:qe.map(A=>(0,e.jsx)("option",{value:A,children:A},A))})]}),(0,e.jsxs)("div",{className:"flex items-center gap-1",children:[(0,e.jsx)("button",{disabled:!T,onClick:()=>p({isBold:!i.isBold}),className:E("p-2 rounded-lg transition-all disabled:opacity-30",i!=null&&i.isBold?"bg-slate-100 text-slate-900":"text-slate-500 hover:bg-slate-50"),children:(0,e.jsx)(x.Bold,{size:16,strokeWidth:3})}),(0,e.jsx)("button",{disabled:!T,onClick:()=>p({isItalic:!i.isItalic}),className:E("p-2 rounded-lg transition-all disabled:opacity-30",i!=null&&i.isItalic?"bg-slate-100 text-slate-900":"text-slate-500 hover:bg-slate-50"),children:(0,e.jsx)(x.Italic,{size:16})}),(0,e.jsx)("div",{className:"h-4 w-[1px] bg-slate-200 mx-2"}),(0,e.jsxs)("div",{className:"relative group p-1 hover:bg-slate-50 rounded-lg transition-colors cursor-pointer",children:[(0,e.jsx)("input",{type:"color",disabled:!i,value:T?i.color||"#000000":(i==null?void 0:i.fill)||"#3b82f6",onChange:A=>p(T?{color:A.target.value}:{fill:A.target.value}),className:"w-8 h-6 p-0 border-0 bg-transparent cursor-pointer disabled:opacity-30",title:"Format Color"}),(0,e.jsx)("div",{className:"absolute bottom-1.5 left-2 right-2 h-1 rounded-full",style:{backgroundColor:T?i.color||"#000000":(i==null?void 0:i.fill)||"#3b82f6"}})]})]})]}),(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto pt-1",children:"Font"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center border-r border-slate-100 px-8 py-1",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1 px-1.5 py-1 bg-slate-50 rounded-xl border border-slate-100",children:[(0,e.jsx)("button",{disabled:!T,onClick:()=>p({textAlign:"left"}),className:E("p-1.5 rounded-lg transition-all disabled:opacity-30",(i==null?void 0:i.textAlign)==="left"?"bg-white shadow-sm text-[#B7472A] scale-110":"text-slate-400"),children:(0,e.jsx)(x.AlignLeft,{size:16})}),(0,e.jsx)("button",{disabled:!T,onClick:()=>p({textAlign:"center"}),className:E("p-1.5 rounded-lg transition-all disabled:opacity-30",(i==null?void 0:i.textAlign)==="center"?"bg-white shadow-sm text-[#B7472A] scale-110":"text-slate-400"),children:(0,e.jsx)(x.AlignCenter,{size:16})}),(0,e.jsx)("button",{disabled:!T,onClick:()=>p({textAlign:"right"}),className:E("p-1.5 rounded-lg transition-all disabled:opacity-30",(i==null?void 0:i.textAlign)==="right"?"bg-white shadow-sm text-[#B7472A] scale-110":"text-slate-400"),children:(0,e.jsx)(x.AlignRight,{size:16})})]}),(0,e.jsx)("button",{disabled:!T,onClick:()=>p({isBulleted:!i.isBulleted}),className:E("p-2 rounded-lg self-start transition-all disabled:opacity-30",i!=null&&i.isBulleted?"bg-slate-100 text-[#B7472A]":"text-slate-500 hover:bg-slate-50"),children:(0,e.jsx)(x.List,{size:18})})]}),(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Paragraph"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center border-r border-slate-100 px-8 py-1",children:[(0,e.jsxs)("div",{className:"flex flex-wrap items-center gap-2 mb-1",children:[(0,e.jsxs)("div",{className:"relative group/shapes",children:[(0,e.jsxs)("button",{className:"flex flex-col items-center justify-center p-2 hover:bg-slate-50 rounded-xl group transition-all",onClick:()=>{var A;return(A=window._toggleShapesMenu)==null?void 0:A.call(window)},children:[(0,e.jsx)("div",{className:"bg-blue-50 p-2 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(x.Square,{size:22,className:"text-blue-600"})}),(0,e.jsx)("span",{className:"text-[10px] font-bold text-slate-700 mt-1",children:"Shapes"})]}),(0,e.jsx)(Ze,{onAddShape:A=>{l(A)}})]}),(0,e.jsx)("div",{className:"h-10 w-[1px] bg-slate-100 mx-2"}),(0,e.jsx)("button",{onClick:m,className:"p-2.5 hover:bg-slate-50 rounded-xl text-slate-600 transition-colors",title:"Text Box",children:(0,e.jsx)(x.Type,{size:18})}),(0,e.jsxs)("button",{onClick:()=>{var A;return(A=S.current)==null?void 0:A.click()},className:"p-2.5 hover:bg-slate-50 rounded-xl text-slate-600 transition-colors",title:"Image",children:[(0,e.jsx)(x.Image,{size:18}),(0,e.jsx)("input",{type:"file",ref:S,className:"hidden",accept:"image/*",onChange:A=>{var Q;return((Q=A.target.files)==null?void 0:Q[0])&&o(A.target.files[0])}})]})]}),(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Drawing"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center border-r border-slate-100 px-8 py-1",children:[(0,e.jsxs)("div",{className:"flex flex-col gap-2 relative",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5",children:[(0,e.jsxs)("button",{disabled:!T||t,onClick:()=>a(i.id,"shorten"),className:"flex items-center gap-2 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all group border border-transparent hover:border-slate-100",children:[(0,e.jsx)(x.Sparkles,{size:16,className:"text-purple-500"}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Shorten"})]}),(0,e.jsxs)("button",{disabled:!T||t,onClick:()=>a(i.id,"reframe"),className:"flex items-center gap-2 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all group border border-transparent hover:border-slate-100",children:[(0,e.jsx)(x.Sparkles,{size:16,className:"text-blue-500"}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Reframe"})]}),(0,e.jsxs)("button",{disabled:!T||t,onClick:()=>a(i.id,"lengthen"),className:"flex items-center gap-2 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all group border border-transparent hover:border-slate-100",children:[(0,e.jsx)(x.Sparkles,{size:16,className:"text-emerald-500"}),(0,e.jsx)("span",{className:"text-[10px] font-bold",children:"Lengthen"})]})]}),t&&(0,e.jsx)("div",{className:"absolute inset-0 bg-white/80 flex items-center justify-center rounded-lg z-10 backdrop-blur-[1px]",children:(0,e.jsx)(x.RefreshCw,{size:18,className:"text-blue-600 animate-spin"})}),s&&(0,e.jsxs)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[400px] bg-white border border-slate-200 rounded-2xl shadow-2xl p-6 z-[200] animate-in fade-in zoom-in-95 duration-200",children:[(0,e.jsxs)("div",{className:"flex items-center gap-2 mb-4",children:[(0,e.jsx)(x.Sparkles,{size:20,className:"text-purple-600"}),(0,e.jsx)("h3",{className:"text-sm font-black text-slate-800 uppercase tracking-widest",children:"AI Generated Response"})]}),(0,e.jsxs)("div",{className:"bg-slate-50 p-4 rounded-xl mb-6 max-h-[200px] overflow-y-auto border border-slate-100 italic text-slate-700 text-sm leading-relaxed",children:['"',s,'"']}),(0,e.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,e.jsxs)("div",{className:"grid grid-cols-2 gap-2",children:[(0,e.jsx)("button",{onClick:()=>b("replace"),className:"px-4 py-2.5 bg-[#B7472A] text-white text-[11px] font-bold rounded-lg hover:bg-[#a33f25] transition-colors shadow-sm",children:"REPLACE CURRENT"}),(0,e.jsx)("button",{onClick:()=>b("addBelow"),className:"px-4 py-2.5 bg-slate-800 text-white text-[11px] font-bold rounded-lg hover:bg-slate-900 transition-colors shadow-sm",children:"ADD BELOW"})]}),(0,e.jsxs)("div",{className:"flex gap-2",children:[(0,e.jsxs)("button",{onClick:()=>b("regenerate"),className:"flex-1 px-4 py-2.5 border border-slate-200 text-slate-600 text-[11px] font-bold rounded-lg hover:bg-slate-50 transition-colors flex items-center justify-center gap-2",children:[(0,e.jsx)(x.RefreshCw,{size:14})," REGENERATE"]}),(0,e.jsx)("button",{className:"px-4 py-2.5 text-slate-400 text-[11px] font-bold hover:text-slate-600 transition-colors",onClick:()=>{b("replace")},children:"CLOSE"})]})]})]})]}),(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"AI Text"})]}),(0,e.jsxs)("div",{className:"flex flex-col items-center px-8 py-1",children:[(0,e.jsxs)("div",{className:"flex gap-3",children:[(0,e.jsx)("button",{onClick:g,className:"flex flex-col items-center justify-center p-2.5 hover:bg-emerald-50 rounded-xl group transition-all",title:"Download Presentation",children:(0,e.jsx)("div",{className:"bg-emerald-100/50 p-2 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(x.Download,{size:22,className:"text-emerald-700"})})}),i&&(0,e.jsx)("button",{onClick:N,className:"flex flex-col items-center justify-center p-2.5 hover:bg-red-50 rounded-xl group transition-all",title:"Delete Element",children:(0,e.jsx)("div",{className:"bg-red-100/50 p-2 rounded-lg group-hover:scale-110 transition-transform",children:(0,e.jsx)(x.Trash2,{size:22,className:"text-red-600"})})})]}),(0,e.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Actions"})]}),(0,e.jsx)("div",{className:"flex-1"}),(0,e.jsxs)("div",{className:"pr-12 flex flex-col items-end gap-1 group",children:[(0,e.jsxs)("div",{className:"flex items-center gap-1.5 text-[10px] font-black text-slate-300 group-hover:text-[#B7472A] transition-colors",children:[(0,e.jsx)(x.History,{size:12}),(0,e.jsx)("span",{children:"SAVED AUTOMATICALLY"})]}),(0,e.jsx)("div",{className:"h-1 w-24 bg-slate-100 rounded-full overflow-hidden",children:(0,e.jsx)("div",{className:"h-full w-full bg-emerald-500/20"})})]})]}),ie&&(0,e.jsxs)(e.Fragment,{children:[(0,e.jsx)("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[2000]",onClick:()=>F(!1)}),(0,e.jsxs)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[480px] bg-white rounded-3xl shadow-2xl z-[2001] border border-slate-200 p-8 animate-in fade-in zoom-in-95 duration-200",children:[(0,e.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,e.jsxs)("h3",{className:"text-lg font-black text-slate-800 tracking-tight flex items-center gap-3",children:[(0,e.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-xl",children:(0,e.jsx)(x.Download,{size:20})}),"Upload Presentation"]}),(0,e.jsx)("button",{onClick:()=>F(!1),className:"text-slate-400 hover:text-slate-600 transition-colors",children:(0,e.jsx)(x.RefreshCw,{size:20,className:"rotate-45"})})]}),(0,e.jsxs)("div",{className:"flex gap-2 p-1 bg-slate-50 rounded-2xl mb-8",children:[(0,e.jsx)("button",{onClick:()=>K("file"),className:E("flex-1 py-3 text-xs font-black rounded-xl transition-all",_==="file"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"FILE UPLOAD"}),(0,e.jsx)("button",{onClick:()=>K("link"),className:E("flex-1 py-3 text-xs font-black rounded-xl transition-all",_==="link"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"LINK UPLOAD"})]}),_==="file"?(0,e.jsxs)("label",{className:"flex flex-col items-center justify-center gap-4 py-12 border-2 border-dashed border-slate-200 rounded-3xl hover:border-blue-400 hover:bg-blue-50/50 transition-all cursor-pointer group",children:[(0,e.jsx)("div",{className:"p-4 bg-white rounded-2xl shadow-sm border border-slate-100 group-hover:scale-110 transition-transform",children:(0,e.jsx)(x.Plus,{size:24,className:"text-blue-500"})}),(0,e.jsxs)("div",{className:"text-center",children:[(0,e.jsx)("p",{className:"text-sm font-bold text-slate-700",children:"Choose a PPTX file"}),(0,e.jsx)("p",{className:"text-xs text-slate-400 mt-1",children:"Maximum file size: 50MB"})]}),(0,e.jsx)("input",{type:"file",accept:".pptx",className:"hidden",onChange:A=>{var de;let Q=(de=A.target.files)==null?void 0:de[0];Q&&(u(Q),F(!1))}})]}):(0,e.jsxs)("div",{className:"space-y-4",children:[(0,e.jsx)("div",{className:"relative",children:(0,e.jsx)("input",{type:"text",placeholder:"Paste S3 or public URL",value:B,onChange:A=>q(A.target.value),className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 focus:outline-none focus:ring-4 focus:ring-blue-500/10 focus:border-blue-500 text-sm placeholder:text-slate-400 text-black"})}),(0,e.jsx)("button",{onClick:()=>{B.trim()&&(u(B.trim()),F(!1))},disabled:!B.trim(),className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-slate-300 text-white font-black py-4 rounded-2xl transition-all shadow-lg shadow-blue-500/20",children:"LOAD PRESENTATION"}),(0,e.jsx)("p",{className:"text-[10px] text-slate-400 text-center uppercase tracking-widest font-black",children:"Supports S3, Dropbox, and public URLS"})]})]})]})]})};var ee=require("lucide-react"),$=require("@dnd-kit/core"),Z=require("@dnd-kit/sortable"),Ae=require("@dnd-kit/utilities");var C=require("react/jsx-runtime"),Qe=({slide:m,index:o,isActive:l,onSelect:c,onDelete:g,onDuplicate:p,showDelete:N})=>{let{attributes:v,listeners:f,setNodeRef:i,transform:y,transition:a,isDragging:b}=(0,Z.useSortable)({id:m.id}),s={transform:Ae.CSS.Transform.toString(y),transition:a,zIndex:b?2:1,opacity:b?.5:1};return(0,C.jsxs)("div",{ref:i,style:s,onClick:c,className:E("cursor-pointer border-[1.5px] rounded-2xl p-2 transition-all duration-300 group relative select-none",l?"border-[#B7472A] bg-white":"border-transparent hover:border-slate-200 bg-white/50 hover:bg-white"),children:[(0,C.jsxs)("div",{className:"text-[10px] font-bold text-slate-400 mb-1 flex items-center justify-between",children:[(0,C.jsxs)("div",{className:"flex items-center gap-1",children:[(0,C.jsx)("div",I(w(w({},v),f),{className:"cursor-grab active:cursor-grabbing p-0.5 hover:bg-slate-100 rounded text-slate-300 hover:text-slate-500",children:(0,C.jsx)(ee.GripVertical,{size:10})})),(0,C.jsxs)("span",{children:["SLIDE ",o+1]})]}),(0,C.jsxs)("div",{className:"flex items-center gap-1",children:[l&&(0,C.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[#B7472A]"}),(0,C.jsxs)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,C.jsx)("button",{onClick:t=>{t.stopPropagation(),p()},className:"p-1 hover:bg-blue-50 text-slate-400 hover:text-blue-500 rounded transition-all",title:"Duplicate Slide",children:(0,C.jsx)(ee.Copy,{size:12})}),N&&(0,C.jsx)("button",{onClick:t=>{t.stopPropagation(),g()},className:"p-1 hover:bg-red-50 text-red-400 hover:text-red-500 rounded transition-all",title:"Delete Slide",children:(0,C.jsx)(ee.Trash2,{size:12})})]})]})]}),(0,C.jsx)("div",{className:"aspect-video bg-white rounded-xl flex items-center justify-center border border-slate-200 overflow-hidden relative group-hover:shadow-sm transition-shadow",children:(0,C.jsx)("div",{className:"absolute inset-0 origin-top-left pointer-events-none select-none",style:{width:"1200px",height:"675px",transform:"scale(0.165)",backgroundColor:"#ffffff"},children:m.elements.sort((t,n)=>(t.zIndex||0)-(n.zIndex||0)).map(t=>{var u;let n={position:"absolute",left:t.x,top:t.y,width:t.width,height:t.height,opacity:(u=t.opacity)!=null?u:1};return t.type==="text"?(0,C.jsx)("div",{style:I(w({},n),{fontSize:t.fontSize,fontFamily:t.fontFamily,color:t.color,textAlign:t.textAlign||"left",fontWeight:t.isBold?"bold":"normal",fontStyle:t.isItalic?"italic":"normal",lineHeight:1.2,overflow:"hidden",wordBreak:"break-word",whiteSpace:"pre-wrap"}),children:t.content},t.id):t.type==="shape"?(0,C.jsx)("div",{style:I(w({},n),{backgroundColor:t.fill,borderRadius:t.shapeType==="ellipse"?"50%":"0"})},t.id):t.type==="image"?(0,C.jsx)("img",{src:t.src,alt:"",style:I(w({},n),{objectFit:"contain"})},t.id):null})})})]})},ke=({slides:m,currentSlideIndex:o,onSelectSlide:l,onDeleteSlide:c,onDuplicateSlide:g,onReorderSlides:p})=>{let N=(0,$.useSensors)((0,$.useSensor)($.PointerSensor,{activationConstraint:{distance:5}}),(0,$.useSensor)($.KeyboardSensor,{coordinateGetter:Z.sortableKeyboardCoordinates}));return(0,C.jsx)("div",{className:"w-64 bg-white border-r border-slate-100 overflow-y-auto p-4 flex flex-col gap-4",children:(0,C.jsx)($.DndContext,{sensors:N,collisionDetection:$.closestCenter,onDragEnd:f=>{let{active:i,over:y}=f;if(i.id!==(y==null?void 0:y.id)){let a=m.findIndex(s=>s.id===i.id),b=m.findIndex(s=>s.id===(y==null?void 0:y.id));p(a,b)}},children:(0,C.jsx)(Z.SortableContext,{items:m.map(f=>f.id),strategy:Z.verticalListSortingStrategy,children:m.map((f,i)=>(0,C.jsx)(Qe,{slide:f,index:i,isActive:i===o,onSelect:()=>l(i),onDelete:()=>c(i),onDuplicate:()=>g(i),showDelete:m.length>1},f.id))})})})};var H=require("react"),j=pe(require("fabric"));var me=require("react/jsx-runtime"),fe=({slide:m,onElementUpdate:o,onSelect:l})=>{let c=(0,H.useRef)(null),g=(0,H.useRef)(null),p=(0,H.useRef)(!1),N=(0,H.useRef)(o),v=(0,H.useRef)(l);return(0,H.useEffect)(()=>{N.current=o,v.current=l},[o,l]),(0,H.useEffect)(()=>{if(c.current&&!g.current){g.current=new j.Canvas(c.current,{width:1200,height:675,backgroundColor:"#ffffff"});let f=g.current,i=s=>{s.left<0&&s.set("left",0),s.top<0&&s.set("top",0);let t=s.getBoundingRect();t.left+t.width>(f.width||1200)&&s.set("left",(f.width||1200)-t.width),t.top+t.height>(f.height||675)&&s.set("top",(f.height||675)-t.height)};f.on("object:moving",s=>i(s.target)),f.on("object:scaling",s=>i(s.target));let y=s=>{var u;if(p.current)return;let t=s.target,n=(u=t.get("data"))==null?void 0:u.id;t&&n&&N.current(n,w({x:t.left,y:t.top,width:t.getScaledWidth(),height:t.getScaledHeight()},t.isType("textbox")?{content:t.text,textAlign:t.textAlign,fontSize:t.fontSize,fontFamily:t.fontFamily,color:t.fill}:{fill:t.fill}))};f.on("object:modified",y),f.on("text:changed",y);let a=s=>{var n,u;let t=((n=s.selected)==null?void 0:n[0])||s.target;if(t){let S=(u=t.get("data"))==null?void 0:u.id;v.current(S)}};f.on("selection:created",a),f.on("selection:updated",a),f.on("selection:cleared",()=>v.current(null));let b=s=>{let t=f.getActiveObject();if(!t||t.isType("textbox")&&t.isEditing)return;let n=s.shiftKey?10:1,u=!1;switch(s.key){case"ArrowLeft":t.set("left",t.left-n),u=!0;break;case"ArrowRight":t.set("left",t.left+n),u=!0;break;case"ArrowUp":t.set("top",t.top-n),u=!0;break;case"ArrowDown":t.set("top",t.top+n),u=!0;break}u&&(i(t),f.requestRenderAll(),y({target:t}))};window.addEventListener("keydown",b),f._keyboardListener=b}return()=>{if(g.current){let f=g.current._keyboardListener;f&&window.removeEventListener("keydown",f),g.current.dispose(),g.current=null}}},[]),(0,H.useEffect)(()=>{if(!g.current)return;let f=g.current;(async()=>{p.current=!0;let y=f.getObjects(),a=new Set(m.elements.map(s=>s.id));y.forEach(s=>{var n;let t=(n=s.get("data"))==null?void 0:n.id;t&&!a.has(t)&&f.remove(s)});let b=[...m.elements].sort((s,t)=>(s.zIndex||0)-(t.zIndex||0));for(let s of b){let t=y.find(n=>{var u;return((u=n.get("data"))==null?void 0:u.id)===s.id});if(t){if(t===f.getActiveObject()&&t.isType("textbox")&&t.isEditing)continue;let n={left:s.x,top:s.y,opacity:s.opacity!==void 0?s.opacity:1,zIndex:s.zIndex};s.type==="text"&&t.isType("textbox")?(n.text=s.content||" ",n.fontSize=s.fontSize||22,n.fill=s.color||"#000000",n.textAlign=s.textAlign||"left",n.fontWeight=s.isBold?"bold":"normal",n.fontStyle=s.isItalic?"italic":"normal",n.fontFamily=s.fontFamily||"Arial",n.width=Math.max(s.width||50,10)):s.type==="shape"?(n.fill=s.fill||"#cccccc",n.scaleX=(s.width||50)/(t.width||1),n.scaleY=(s.height||50)/(t.height||1)):s.type==="image"&&(n.scaleX=(s.width||100)/(t.width||1),n.scaleY=(s.height||100)/(t.height||1)),t.set(n)}else{let n=null,u={left:s.x,top:s.y,data:{id:s.id},originX:"left",originY:"top",opacity:s.opacity!==void 0?s.opacity:1};if(s.type==="text")n=new j.Textbox(s.content||" ",I(w({},u),{width:Math.max(s.width||200,10),fontSize:s.fontSize||22,fill:s.color||"#000000",fontFamily:s.fontFamily||"Inter, Arial, sans-serif",textAlign:s.textAlign||"left",fontWeight:s.isBold?"bold":"normal",fontStyle:s.isItalic?"italic":"normal",splitByGrapheme:!1}));else if(s.type==="shape"){let S=s.fill||"#3b82f6";s.shapeType==="ellipse"?n=new j.Circle(I(w({},u),{radius:(s.width||100)/2,scaleY:(s.height||100)/(s.width||100),fill:S})):n=new j.Rect(I(w({},u),{width:s.width||100,height:s.height||100,fill:S}))}else if(s.type==="image")try{let S=await j.FabricImage.fromURL(s.src);S.set(I(w({},u),{scaleX:(s.width||100)/(S.width||1),scaleY:(s.height||100)/(S.height||1)})),n=S}catch(S){console.error(S)}n&&f.add(n)}}f.renderAll(),p.current=!1})()},[m]),(0,me.jsx)("div",{className:"border border-slate-200 rounded-xl overflow-hidden bg-white",children:(0,me.jsx)("canvas",{ref:c})})};var Ie=pe(require("pptxgenjs"));var oe=class{async export(o){var i,y;let l=new Ie.default,c=((i=o.layout)==null?void 0:i.width)||12192e3,g=((y=o.layout)==null?void 0:y.height)||6858e3,p=1200,N=675,v=a=>a/p*(c/914400),f=a=>a/N*(g/914400);o.slides.forEach(a=>{let b=l.addSlide();[...a.elements].sort((t,n)=>t.zIndex-n.zIndex).forEach(t=>{var S,L;let n=t.opacity!==void 0?(1-t.opacity)*100:0,u={x:v(t.x),y:f(t.y),w:v(t.width),h:f(t.height)};if(t.type==="text")b.addText(t.content,I(w({},u),{fontSize:(t.fontSize||18)/2,color:((S=t.color)==null?void 0:S.replace("#",""))||"000000",fontFace:t.fontFamily||"Arial"}));else if(t.type==="image")b.addImage(I(w({},u),{path:t.src,transparency:n}));else if(t.type==="shape"){let U=t.shapeType==="ellipse"?l.ShapeType.ellipse:l.ShapeType.rect;b.addShape(U,I(w({},u),{fill:{color:((L=t.fill)==null?void 0:L.replace("#",""))||"CCCCCC",transparency:n>0?Math.min(n+10,100):0}}))}})}),await l.writeFile({fileName:"presentation.pptx"})}};var Ce=pe(require("jszip")),le=class{constructor(){this.slideWidth=12192e3;this.slideHeight=6858e3;this.CANVAS_WIDTH=1200;this.CANVAS_HEIGHT=675}async parse(o){var y,a;let l=o;if(typeof o=="string"){let b=await fetch(o);if(!b.ok){let s=b.status,t=b.statusText,n="";try{let u=await b.json();n=u.details||u.error||""}catch(u){}throw new Error(`Failed to fetch PPTX from ${o}: ${s} ${t} ${n?`(${n})`:""}`)}l=await b.arrayBuffer()}let c=await Ce.default.loadAsync(l),g=await((y=c.file("ppt/presentation.xml"))==null?void 0:y.async("string"));if(!g)throw new Error("Invalid PPTX");let N=new DOMParser().parseFromString(g,"text/xml"),v=this.findFirstByLocalName(N,"sldSz");v&&(this.slideWidth=parseInt(this.getAttr(v,"cx")||"12192000"),this.slideHeight=parseInt(this.getAttr(v,"cy")||"6858000"));let f=Array.from(N.getElementsByTagNameNS("*","sldId")),i=[];for(let b=0;b<f.length;b++){let s=b+1,t=`ppt/slides/slide${s}.xml`,n=await((a=c.file(t))==null?void 0:a.async("string"));if(n){let u=await this.parseSlide(n,s,c);i.push(u)}}return{slides:i,layout:{width:this.slideWidth,height:this.slideHeight}}}getAttr(o,l){return o.getAttribute(l)||o.getAttribute(`a:${l}`)||o.getAttribute(`p:${l}`)||o.getAttribute(`r:${l}`)}findFirstByLocalName(o,l){let c=o.getElementsByTagNameNS("*",l);return c.length>0?c[0]:null}findAllByLocalName(o,l){return Array.from(o.getElementsByTagNameNS("*",l))}scaleX(o){return o/this.slideWidth*this.CANVAS_WIDTH}scaleY(o){return o/this.slideHeight*this.CANVAS_HEIGHT}parseColor(o){let l=this.findFirstByLocalName(o,"srgbClr");if(l){let g=`#${this.getAttr(l,"val")}`,p=this.findFirstByLocalName(l,"alpha"),N=p?parseInt(this.getAttr(p,"val")||"100000")/1e5:1;return{color:g,opacity:N}}let c=this.findFirstByLocalName(o,"schemeClr");if(c){let g=this.findFirstByLocalName(c,"alpha");return{color:"#000000",opacity:g?parseInt(this.getAttr(g,"val")||"100000")/1e5:1}}return{color:"#000000",opacity:1}}async resolveImage(o,l,c){var i,y;let g=await((i=c.file(`ppt/slides/_rels/slide${l}.xml.rels`))==null?void 0:i.async("string"));if(!g)return null;let N=new DOMParser().parseFromString(g,"text/xml"),v=Array.from(N.getElementsByTagName("Relationship")).find(a=>a.getAttribute("Id")===o),f=v==null?void 0:v.getAttribute("Target");if(f){let a=(f.startsWith("../")?`ppt/${f.substring(3)}`:`ppt/slides/${f}`).replace("ppt/slides/../","ppt/");return await((y=c.file(a))==null?void 0:y.async("blob"))||null}return null}async parseSlide(o,l,c){let p=new DOMParser().parseFromString(o,"text/xml"),N=[],v=0,f=this.findFirstByLocalName(p,"bg");if(f){let a=this.findFirstByLocalName(f,"blip"),b=(a==null?void 0:a.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","embed"))||(a==null?void 0:a.getAttribute("r:embed"));if(b){let s=await this.resolveImage(b,l,c);s&&N.push({id:`bg-${l}`,type:"image",src:URL.createObjectURL(s),x:0,y:0,width:this.CANVAS_WIDTH,height:this.CANVAS_HEIGHT,zIndex:v++,opacity:1})}}let i=this.findFirstByLocalName(p,"spTree");if(!i)return{id:`slide-${l}`,elements:N};let y=Array.from(i.children);for(let a of y){let b=a.localName;if(b==="sp"){let s=this.findFirstByLocalName(a,"txBody"),t=this.findFirstByLocalName(a,"xfrm"),n=t?this.findFirstByLocalName(t,"off"):null,u=t?this.findFirstByLocalName(t,"ext"):null;if(s&&n&&u){let L=this.findAllByLocalName(s,"p"),U="",O=18,X="#000000",W=1,G=!1;for(let Y of L){let P=this.findFirstByLocalName(Y,"pPr"),ie=P?this.findFirstByLocalName(P,"buNone"):null;P&&!ie&&(this.findFirstByLocalName(P,"buChar")||this.findFirstByLocalName(P,"buAutoNum"))&&(G=!0,U+="\u2022 ");let F=this.findAllByLocalName(Y,"r");for(let _ of F){let K=this.findFirstByLocalName(_,"t");K&&(U+=K.textContent);let B=this.findFirstByLocalName(_,"rPr");if(B){let q=this.getAttr(B,"sz");q&&(O=parseInt(q)/100*2);let T=this.parseColor(B);X=T.color,W=T.opacity}}U+=`
|
|
3
|
-
`}if(U.trim()){N.push({id:`el-${l}-${Date.now()}-${v}`,type:"text",content:U.trim(),x:this.scaleX(parseInt(this.getAttr(n,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(n,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(u,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(u,"cy")||"0")),fontSize:O,color:X,fontFamily:"Arial",zIndex:v++,isBulleted:G,opacity:W});continue}}let S=this.findFirstByLocalName(a,"prstGeom");if(S&&n&&u){let L=this.getAttr(S,"prst"),U=this.findFirstByLocalName(a,"spPr"),O=U?this.parseColor(U):{color:"#cccccc",opacity:1};N.push({id:`el-${l}-${Date.now()}-${v}`,type:"shape",shapeType:L==="ellipse"||L==="circle"?"ellipse":"rect",fill:O.color,opacity:O.opacity,x:this.scaleX(parseInt(this.getAttr(n,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(n,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(u,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(u,"cy")||"0")),zIndex:v++})}}if(b==="pic"){let s=this.findFirstByLocalName(a,"blip"),t=(s==null?void 0:s.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","embed"))||(s==null?void 0:s.getAttribute("r:embed")),n=this.findFirstByLocalName(a,"xfrm"),u=n?this.findFirstByLocalName(n,"off"):null,S=n?this.findFirstByLocalName(n,"ext"):null;if(t&&u&&S){let L=await this.resolveImage(t,l,c);L&&N.push({id:`el-${l}-${Date.now()}-${v}`,type:"image",src:URL.createObjectURL(L),x:this.scaleX(parseInt(this.getAttr(u,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(u,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(S,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(S,"cy")||"0")),zIndex:v++,opacity:1})}}}return{id:`slide-${l}`,elements:N}}};var te=require("react"),se=require("lucide-react");var D=require("react/jsx-runtime"),Pe=({presentation:m,initialSlideIndex:o,onClose:l})=>{let[c,g]=(0,te.useState)(o),p=m.slides[c],N=()=>{c>0&&g(c-1)},v=()=>{c<m.slides.length-1&&g(c+1)};(0,te.useEffect)(()=>{let y=a=>{a.key==="ArrowRight"||a.key===" "||a.key==="PageDown"?v():a.key==="ArrowLeft"||a.key==="Backspace"||a.key==="PageUp"?N():a.key==="Escape"&&l()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[c]);let[f,i]=(0,te.useState)(1);return(0,te.useEffect)(()=>{let y=()=>{let b=window.innerWidth-40,s=window.innerHeight-40,t=1200,n=675,u=b/t,S=s/n,L=Math.min(u,S);i(L)};return y(),window.addEventListener("resize",y),()=>window.removeEventListener("resize",y)},[]),(0,D.jsxs)("div",{className:"fixed inset-0 z-[99999] bg-[#0A0A0A] flex flex-col items-center justify-center overflow-hidden",children:[(0,D.jsxs)("div",{className:"absolute top-0 left-0 right-0 p-6 flex justify-between items-center opacity-0 hover:opacity-100 transition-opacity bg-gradient-to-b from-black/60 to-transparent z-[100] pointer-events-none",children:[(0,D.jsxs)("div",{className:"text-white/80 font-bold ml-4 pointer-events-auto",children:["Slide ",c+1," of ",m.slides.length]}),(0,D.jsx)("button",{onClick:l,className:"p-3 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all pointer-events-auto",children:(0,D.jsx)(se.X,{size:24})})]}),(0,D.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,D.jsx)("div",{className:"relative shadow-2xl shadow-black/80 bg-white",style:{width:"1200px",height:"675px",transform:`scale(${f})`,transformOrigin:"center center"},children:(0,D.jsx)(fe,{slide:p,onElementUpdate:()=>{},onSelect:()=>{}})})}),(0,D.jsxs)("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 flex items-center gap-6 opacity-0 hover:opacity-100 transition-opacity bg-black/40 backdrop-blur-md px-6 py-3 rounded-full border border-white/10 pointer-events-auto",children:[(0,D.jsx)("button",{disabled:c===0,onClick:N,className:"p-2 text-white/50 hover:text-white disabled:opacity-20 transition-colors",children:(0,D.jsx)(se.ChevronLeft,{size:32})}),(0,D.jsx)("div",{className:"h-6 w-[1px] bg-white/10"}),(0,D.jsx)("button",{disabled:c===m.slides.length-1,onClick:v,className:"p-2 text-white/50 hover:text-white disabled:opacity-20 transition-colors",children:(0,D.jsx)(se.ChevronRight,{size:32})})]})]})};var ze=require("@google/generative-ai");var V=require("react/jsx-runtime"),et=({initialPresentation:m,url:o,appName:l="SlideCanvas",onChange:c,geminiApiKey:g})=>{let[p,N]=(0,z.useState)(m||{slides:[{id:"slide-1",elements:[]}],layout:{width:12192e3,height:6858e3}}),[v,f]=(0,z.useState)([]),[i,y]=(0,z.useState)([]),[a,b]=(0,z.useState)(0),[s,t]=(0,z.useState)(null),[n,u]=(0,z.useState)(!1),[S,L]=(0,z.useState)(null),[U,O]=(0,z.useState)(!1);(0,z.useEffect)(()=>{o&&xe(o)},[o]);let[X,W]=(0,z.useState)(!1),[G,Y]=(0,z.useState)(null),P=p.slides[a],ie=(0,z.useMemo)(()=>P.elements.find(r=>r.id===s)||null,[P,s]),F=(0,z.useCallback)(r=>{f(d=>[...d.slice(-19),p]),y([]),N(r),c==null||c(r)},[c,p]),_=()=>{if(v.length===0)return;let r=v[v.length-1];y(d=>[...d,p]),f(d=>d.slice(0,-1)),N(r)},K=()=>{if(i.length===0)return;let r=i[i.length-1];f(d=>[...d,p]),y(d=>d.slice(0,-1)),N(r)},B=(0,z.useCallback)(r=>{N(d=>{let h=[...d.slides];h[a]=w(w({},h[a]),r);let k=I(w({},d),{slides:h});return f(R=>[...R.slice(-19),d]),y([]),c==null||c(k),k})},[a,c]),q=(0,z.useCallback)((r,d)=>{N(h=>{let k=h.slides[a],R=k.elements.map(ae=>ae.id===r?w(w({},ae),d):ae),J=[...h.slides];J[a]=I(w({},k),{elements:R});let ce=I(w({},h),{slides:J});return c==null||c(ce),ce})},[a,c]),T=r=>{if(!s)return;if(P.elements.find(h=>h.id===s)){q(s,r);let h=p.slides[a],k=h.elements.map(J=>J.id===s?w(w({},J),r):J),R=[...p.slides];R[a]=I(w({},h),{elements:k}),F(I(w({},p),{slides:R}))}},re=(0,z.useCallback)(()=>{if(!s)return;let d=p.slides[a].elements.filter(h=>h.id!==s);B({elements:d}),t(null)},[s,a,p,B]),ue=()=>{let r={id:`text-${Date.now()}`,type:"text",content:"New Text",x:100,y:100,width:400,height:100,fontSize:48,fontFamily:"Arial",color:"#000000",zIndex:P.elements.length};B({elements:[...P.elements,r]})},A=r=>{let d=URL.createObjectURL(r),h=`img-${Date.now()}`,k={id:h,type:"image",src:d,x:100,y:100,width:400,height:250,zIndex:P.elements.length};B({elements:[...P.elements,k]}),t(h)},Q=r=>{let d={id:`shape-${Date.now()}`,type:"shape",shapeType:r,fill:"#3b82f6",x:200,y:200,width:200,height:200,zIndex:P.elements.length};B({elements:[...P.elements,d]})},de=()=>{let r={id:`slide-${Date.now()}`,elements:[]};F(I(w({},p),{slides:[...p.slides,r]})),b(p.slides.length)},Le=r=>{if(p.slides.length<=1)return;let d=p.slides.filter((h,k)=>k!==r);F(I(w({},p),{slides:d})),r<=a&&b(Math.max(0,a-1))},Te=r=>{let d=p.slides[r],h=I(w({},d),{id:`slide-${Date.now()}`,elements:d.elements.map(R=>I(w({},R),{id:`${R.type}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}))}),k=[...p.slides];k.splice(r+1,0,h),F(I(w({},p),{slides:k})),b(r+1)},Be=(r,d)=>{if(r===d)return;let h=[...p.slides],[k]=h.splice(r,1);h.splice(d,0,k),F(I(w({},p),{slides:h})),a===r?b(d):a>r&&a<=d?b(a-1):a<r&&a>=d&&b(a+1)},De=r=>{let d=[],h=Date.now();r==="title"?d=[{id:`text-title-${h}`,type:"text",content:"Presentation Title",x:100,y:200,width:1e3,height:150,fontSize:80,fontFamily:"Inter",color:"#000000",textAlign:"center",isBold:!0,zIndex:0},{id:`text-sub-${h}`,type:"text",content:"Subtitle goes here",x:200,y:380,width:800,height:80,fontSize:36,fontFamily:"Inter",color:"#64748b",textAlign:"center",zIndex:1}]:r==="content"?d=[{id:`text-title-${h}`,type:"text",content:"Slide Title",x:60,y:40,width:800,height:80,fontSize:48,fontFamily:"Inter",color:"#000000",isBold:!0,zIndex:0},{id:`text-body-${h}`,type:"text",content:`\u2022 Add your points here
|
|
2
|
+
"use strict";var ee=Object.create;var dt=Object.defineProperty,re=Object.defineProperties,ae=Object.getOwnPropertyDescriptor,oe=Object.getOwnPropertyDescriptors,ie=Object.getOwnPropertyNames,Lt=Object.getOwnPropertySymbols,ne=Object.getPrototypeOf,Pt=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var It=(g,a,n)=>a in g?dt(g,a,{enumerable:!0,configurable:!0,writable:!0,value:n}):g[a]=n,k=(g,a)=>{for(var n in a||(a={}))Pt.call(a,n)&&It(g,n,a[n]);if(Lt)for(var n of Lt(a))se.call(a,n)&&It(g,n,a[n]);return g},A=(g,a)=>re(g,oe(a));var le=(g,a)=>{for(var n in a)dt(g,n,{get:a[n],enumerable:!0})},Bt=(g,a,n,p)=>{if(a&&typeof a=="object"||typeof a=="function")for(let b of ie(a))!Pt.call(g,b)&&b!==n&&dt(g,b,{get:()=>a[b],enumerable:!(p=ae(a,b))||p.enumerable});return g};var mt=(g,a,n)=>(n=g!=null?ee(ne(g)):{},Bt(a||!g||!g.__esModule?dt(n,"default",{value:g,enumerable:!0}):n,g)),ce=g=>Bt(dt({},"__esModule",{value:!0}),g);var ve={};le(ve,{PptEditor:()=>me,PptxExporter:()=>pt,PptxParser:()=>gt});module.exports=ce(ve);function Nt(g,{insertAt:a}={}){if(!g||typeof document=="undefined")return;let n=document.head||document.getElementsByTagName("head")[0],p=document.createElement("style");p.type="text/css",a==="top"&&n.firstChild?n.insertBefore(p,n.firstChild):n.appendChild(p),p.styleSheet?p.styleSheet.cssText=g:p.appendChild(document.createTextNode(g))}Nt(`@import"https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Lato:wght@400;700&family=Open+Sans:wght@400;600;700&family=Poppins:wght@400;500;600;700&family=Roboto:wght@400;500;700&family=Roboto+Slab:wght@400;700&family=Playfair+Display:wght@400;700&family=Merriweather:wght@400;700&family=Nunito+Sans:wght@400;600;700&family=Montserrat:wght@400;600;700&family=Oswald:wght@400;500&family=Raleway:wght@400;600;700&family=Ubuntu:wght@400;500;700&family=Lora:wght@400;700&family=PT+Sans:wght@400;700&family=PT+Serif:wght@400;700&family=Play:wght@400;700&family=Arvo:wght@400;700&family=Kanit:wght@400;500;600&display=swap";/*! tailwindcss v4.1.18 | MIT License | https://tailwindcss.com */@layer properties;@layer theme,base,components,utilities;@layer theme{:root,:host{--font-sans: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";--font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;--color-red-50: oklch(97.1% .013 17.38);--color-red-100: oklch(93.6% .032 17.717);--color-red-200: oklch(88.5% .062 18.334);--color-red-400: oklch(70.4% .191 22.216);--color-red-500: oklch(63.7% .237 25.331);--color-red-600: oklch(57.7% .245 27.325);--color-orange-50: oklch(98% .016 73.684);--color-amber-500: oklch(76.9% .188 70.08);--color-emerald-50: oklch(97.9% .021 166.113);--color-emerald-100: oklch(95% .052 163.051);--color-emerald-500: oklch(69.6% .17 162.48);--color-emerald-600: oklch(59.6% .145 163.225);--color-emerald-700: oklch(50.8% .118 165.612);--color-blue-50: oklch(97% .014 254.604);--color-blue-100: oklch(93.2% .032 255.585);--color-blue-400: oklch(70.7% .165 254.624);--color-blue-500: oklch(62.3% .214 259.815);--color-blue-600: oklch(54.6% .245 262.881);--color-blue-700: oklch(48.8% .243 264.376);--color-purple-500: oklch(62.7% .265 303.9);--color-purple-600: oklch(55.8% .288 302.321);--color-slate-50: oklch(98.4% .003 247.858);--color-slate-100: oklch(96.8% .007 247.896);--color-slate-200: oklch(92.9% .013 255.508);--color-slate-300: oklch(86.9% .022 252.894);--color-slate-400: oklch(70.4% .04 256.788);--color-slate-500: oklch(55.4% .046 257.417);--color-slate-600: oklch(44.6% .043 257.281);--color-slate-700: oklch(37.2% .044 257.287);--color-slate-800: oklch(27.9% .041 260.031);--color-slate-900: oklch(20.8% .042 265.755);--color-black: #000;--color-white: #fff;--spacing: .25rem;--container-2xl: 42rem;--text-xs: .75rem;--text-xs--line-height: calc(1 / .75);--text-sm: .875rem;--text-sm--line-height: calc(1.25 / .875);--text-lg: 1.125rem;--text-lg--line-height: calc(1.75 / 1.125);--text-4xl: 2.25rem;--text-4xl--line-height: calc(2.5 / 2.25);--font-weight-medium: 500;--font-weight-semibold: 600;--font-weight-bold: 700;--font-weight-black: 900;--tracking-tighter: -.05em;--tracking-tight: -.025em;--tracking-widest: .1em;--leading-tight: 1.25;--leading-relaxed: 1.625;--radius-sm: .25rem;--radius-md: .375rem;--radius-lg: .5rem;--radius-xl: .75rem;--radius-2xl: 1rem;--radius-3xl: 1.5rem;--animate-spin: spin 1s linear infinite;--blur-sm: 8px;--blur-md: 12px;--aspect-video: 16 / 9;--default-transition-duration: .15s;--default-transition-timing-function: cubic-bezier(.4, 0, .2, 1);--default-font-family: var(--font-sans);--default-mono-font-family: var(--font-mono)}}@layer base{*,:after,:before,::backdrop,::file-selector-button{box-sizing:border-box;margin:0;padding:0;border:0 solid}html,:host{line-height:1.5;-webkit-text-size-adjust:100%;tab-size:4;font-family:var(--default-font-family, ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji");font-feature-settings:var(--default-font-feature-settings, normal);font-variation-settings:var(--default-font-variation-settings, normal);-webkit-tap-highlight-color:transparent}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;-webkit-text-decoration:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,samp,pre{font-family:var(--default-mono-font-family, ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace);font-feature-settings:var(--default-mono-font-feature-settings, normal);font-variation-settings:var(--default-mono-font-variation-settings, normal);font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}:-moz-focusring{outline:auto}progress{vertical-align:baseline}summary{display:list-item}ol,ul,menu{list-style:none}img,svg,video,canvas,audio,iframe,embed,object{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}button,input,select,optgroup,textarea,::file-selector-button{font:inherit;font-feature-settings:inherit;font-variation-settings:inherit;letter-spacing:inherit;color:inherit;border-radius:0;background-color:transparent;opacity:1}:where(select:is([multiple],[size])) optgroup{font-weight:bolder}:where(select:is([multiple],[size])) optgroup option{padding-inline-start:20px}::file-selector-button{margin-inline-end:4px}::placeholder{opacity:1}@supports (not (-webkit-appearance: -apple-pay-button)) or (contain-intrinsic-size: 1px){::placeholder{color:currentcolor;@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,currentcolor 50%,transparent)}}}textarea{resize:vertical}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-date-and-time-value{min-height:1lh;text-align:inherit}::-webkit-datetime-edit{display:inline-flex}::-webkit-datetime-edit-fields-wrapper{padding:0}::-webkit-datetime-edit,::-webkit-datetime-edit-year-field,::-webkit-datetime-edit-month-field,::-webkit-datetime-edit-day-field,::-webkit-datetime-edit-hour-field,::-webkit-datetime-edit-minute-field,::-webkit-datetime-edit-second-field,::-webkit-datetime-edit-millisecond-field,::-webkit-datetime-edit-meridiem-field{padding-block:0}::-webkit-calendar-picker-indicator{line-height:1}:-moz-ui-invalid{box-shadow:none}button,input:where([type=button],[type=reset],[type=submit]),::file-selector-button{appearance:button}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[hidden]:where(:not([hidden=until-found])){display:none!important}}@layer utilities{.pointer-events-auto{pointer-events:auto}.pointer-events-none{pointer-events:none}.visible{visibility:visible}.absolute{position:absolute}.fixed{position:fixed}.relative{position:relative}.inset-0{inset:calc(var(--spacing) * 0)}.inset-x-0{inset-inline:calc(var(--spacing) * 0)}.top-0{top:calc(var(--spacing) * 0)}.top-1{top:calc(var(--spacing) * 1)}.top-1\\/2{top:50%}.top-2{top:calc(var(--spacing) * 2)}.top-10{top:calc(var(--spacing) * 10)}.top-full{top:100%}.right-0{right:calc(var(--spacing) * 0)}.right-1{right:calc(var(--spacing) * 1)}.right-2{right:calc(var(--spacing) * 2)}.right-3{right:calc(var(--spacing) * 3)}.bottom-0{bottom:calc(var(--spacing) * 0)}.bottom-1{bottom:calc(var(--spacing) * 1)}.bottom-2{bottom:calc(var(--spacing) * 2)}.bottom-8{bottom:calc(var(--spacing) * 8)}.bottom-10{bottom:calc(var(--spacing) * 10)}.left-0{left:calc(var(--spacing) * 0)}.left-1{left:calc(var(--spacing) * 1)}.left-1\\/2{left:50%}.left-2{left:calc(var(--spacing) * 2)}.left-4{left:calc(var(--spacing) * 4)}.z-10{z-index:10}.z-50{z-index:50}.z-\\[100\\]{z-index:100}.z-\\[1000\\]{z-index:1000}.z-\\[2000\\]{z-index:2000}.z-\\[2001\\]{z-index:2001}.z-\\[99999\\]{z-index:99999}.mx-1{margin-inline:calc(var(--spacing) * 1)}.mx-1\\.5{margin-inline:calc(var(--spacing) * 1.5)}.mx-2{margin-inline:calc(var(--spacing) * 2)}.my-1{margin-block:calc(var(--spacing) * 1)}.my-auto{margin-block:auto}.mt-1{margin-top:calc(var(--spacing) * 1)}.mt-2{margin-top:calc(var(--spacing) * 2)}.mt-auto{margin-top:auto}.mr-2{margin-right:calc(var(--spacing) * 2)}.mb-0{margin-bottom:calc(var(--spacing) * 0)}.mb-1{margin-bottom:calc(var(--spacing) * 1)}.mb-4{margin-bottom:calc(var(--spacing) * 4)}.mb-6{margin-bottom:calc(var(--spacing) * 6)}.mb-8{margin-bottom:calc(var(--spacing) * 8)}.ml-0{margin-left:calc(var(--spacing) * 0)}.ml-0\\.5{margin-left:calc(var(--spacing) * .5)}.ml-4{margin-left:calc(var(--spacing) * 4)}.contents{display:contents}.flex{display:flex}.grid{display:grid}.hidden{display:none}.table{display:table}.aspect-square{aspect-ratio:1 / 1}.aspect-video{aspect-ratio:var(--aspect-video)}.h-0{height:calc(var(--spacing) * 0)}.h-0\\.5{height:calc(var(--spacing) * .5)}.h-1{height:calc(var(--spacing) * 1)}.h-1\\.5{height:calc(var(--spacing) * 1.5)}.h-4{height:calc(var(--spacing) * 4)}.h-6{height:calc(var(--spacing) * 6)}.h-7{height:calc(var(--spacing) * 7)}.h-8{height:calc(var(--spacing) * 8)}.h-10{height:calc(var(--spacing) * 10)}.h-full{height:100%}.h-screen{height:100vh}.min-h-screen{min-height:100vh}.w-1{width:calc(var(--spacing) * 1)}.w-1\\.5{width:calc(var(--spacing) * 1.5)}.w-4{width:calc(var(--spacing) * 4)}.w-6{width:calc(var(--spacing) * 6)}.w-8{width:calc(var(--spacing) * 8)}.w-10{width:calc(var(--spacing) * 10)}.w-14{width:calc(var(--spacing) * 14)}.w-16{width:calc(var(--spacing) * 16)}.w-24{width:calc(var(--spacing) * 24)}.w-32{width:calc(var(--spacing) * 32)}.w-36{width:calc(var(--spacing) * 36)}.w-44{width:calc(var(--spacing) * 44)}.w-48{width:calc(var(--spacing) * 48)}.w-56{width:calc(var(--spacing) * 56)}.w-64{width:calc(var(--spacing) * 64)}.w-\\[1px\\]{width:1px}.w-\\[480px\\]{width:480px}.w-full{width:100%}.w-screen{width:100vw}.max-w-2xl{max-width:var(--container-2xl)}.min-w-0{min-width:calc(var(--spacing) * 0)}.min-w-\\[64px\\]{min-width:64px}.min-w-\\[68px\\]{min-width:68px}.min-w-fit{min-width:fit-content}.flex-1{flex:1}.shrink-0{flex-shrink:0}.origin-center{transform-origin:center}.origin-top-left{transform-origin:0 0}.-translate-x-1{--tw-translate-x: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-x-1\\/2{--tw-translate-x: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1{--tw-translate-y: calc(var(--spacing) * -1);translate:var(--tw-translate-x) var(--tw-translate-y)}.-translate-y-1\\/2{--tw-translate-y: -50% ;translate:var(--tw-translate-x) var(--tw-translate-y)}.scale-105{--tw-scale-x: 105%;--tw-scale-y: 105%;--tw-scale-z: 105%;scale:var(--tw-scale-x) var(--tw-scale-y)}.scale-110{--tw-scale-x: 110%;--tw-scale-y: 110%;--tw-scale-z: 110%;scale:var(--tw-scale-x) var(--tw-scale-y)}.rotate-45{rotate:45deg}.transform{transform:var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,)}.animate-spin{animation:var(--animate-spin)}.cursor-grab{cursor:grab}.cursor-pointer{cursor:pointer}.resize{resize:both}.appearance-none{appearance:none}.grid-cols-2{grid-template-columns:repeat(2,minmax(0,1fr))}.grid-cols-5{grid-template-columns:repeat(5,minmax(0,1fr))}.flex-col{flex-direction:column}.flex-wrap{flex-wrap:wrap}.items-center{align-items:center}.items-end{align-items:flex-end}.justify-between{justify-content:space-between}.justify-center{justify-content:center}.justify-start{justify-content:flex-start}.justify-stretch{justify-content:stretch}.gap-0{gap:calc(var(--spacing) * 0)}.gap-0\\.5{gap:calc(var(--spacing) * .5)}.gap-1{gap:calc(var(--spacing) * 1)}.gap-1\\.5{gap:calc(var(--spacing) * 1.5)}.gap-2{gap:calc(var(--spacing) * 2)}.gap-3{gap:calc(var(--spacing) * 3)}.gap-4{gap:calc(var(--spacing) * 4)}.gap-6{gap:calc(var(--spacing) * 6)}.gap-8{gap:calc(var(--spacing) * 8)}.space-y-2{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 2) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 2) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-4{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 4) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 4) * calc(1 - var(--tw-space-y-reverse)))}}.space-y-6{:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 6) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 6) * calc(1 - var(--tw-space-y-reverse)))}}.self-start{align-self:flex-start}.overflow-auto{overflow:auto}.overflow-hidden{overflow:hidden}.overflow-y-auto{overflow-y:auto}.rounded{border-radius:.25rem}.rounded-2xl{border-radius:var(--radius-2xl)}.rounded-3xl{border-radius:var(--radius-3xl)}.rounded-full{border-radius:calc(infinity * 1px)}.rounded-lg{border-radius:var(--radius-lg)}.rounded-md{border-radius:var(--radius-md)}.rounded-sm{border-radius:var(--radius-sm)}.rounded-xl{border-radius:var(--radius-xl)}.rounded-b-xl{border-bottom-right-radius:var(--radius-xl);border-bottom-left-radius:var(--radius-xl)}.border{border-style:var(--tw-border-style);border-width:1px}.border-0{border-style:var(--tw-border-style);border-width:0px}.border-2{border-style:var(--tw-border-style);border-width:2px}.border-\\[1\\.5px\\]{border-style:var(--tw-border-style);border-width:1.5px}.border-t{border-top-style:var(--tw-border-style);border-top-width:1px}.border-r{border-right-style:var(--tw-border-style);border-right-width:1px}.border-b{border-bottom-style:var(--tw-border-style);border-bottom-width:1px}.border-dashed{--tw-border-style: dashed;border-style:dashed}.border-\\[\\#B7472A\\]{border-color:#b7472a}.border-emerald-100{border-color:var(--color-emerald-100)}.border-emerald-100\\/50{border-color:color-mix(in srgb,oklch(95% .052 163.051) 50%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-emerald-100) 50%,transparent)}}.border-red-200{border-color:var(--color-red-200)}.border-slate-100{border-color:var(--color-slate-100)}.border-slate-200{border-color:var(--color-slate-200)}.border-slate-200\\/60{border-color:color-mix(in srgb,oklch(92.9% .013 255.508) 60%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-slate-200) 60%,transparent)}}.border-transparent{border-color:transparent}.border-white{border-color:var(--color-white)}.border-white\\/10{border-color:color-mix(in srgb,#fff 10%,transparent);@supports (color: color-mix(in lab,red,red)){border-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-\\[\\#0A0A0A\\]{background-color:#0a0a0a}.bg-\\[\\#B7472A\\]{background-color:#b7472a}.bg-black{background-color:var(--color-black)}.bg-black\\/40{background-color:color-mix(in srgb,#000 40%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-black) 40%,transparent)}}.bg-blue-50{background-color:var(--color-blue-50)}.bg-blue-600{background-color:var(--color-blue-600)}.bg-emerald-50{background-color:var(--color-emerald-50)}.bg-emerald-50\\/50{background-color:color-mix(in srgb,oklch(97.9% .021 166.113) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-emerald-50) 50%,transparent)}}.bg-emerald-100{background-color:var(--color-emerald-100)}.bg-emerald-500{background-color:var(--color-emerald-500)}.bg-orange-50{background-color:var(--color-orange-50)}.bg-red-50{background-color:var(--color-red-50)}.bg-red-100{background-color:var(--color-red-100)}.bg-slate-50{background-color:var(--color-slate-50)}.bg-slate-50\\/50{background-color:color-mix(in srgb,oklch(98.4% .003 247.858) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-50) 50%,transparent)}}.bg-slate-100{background-color:var(--color-slate-100)}.bg-slate-200{background-color:var(--color-slate-200)}.bg-slate-800{background-color:var(--color-slate-800)}.bg-slate-900{background-color:var(--color-slate-900)}.bg-slate-900\\/40{background-color:color-mix(in srgb,oklch(20.8% .042 265.755) 40%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-slate-900) 40%,transparent)}}.bg-transparent{background-color:transparent}.bg-white{background-color:var(--color-white)}.bg-white\\/10{background-color:color-mix(in srgb,#fff 10%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 10%,transparent)}}.bg-white\\/50{background-color:color-mix(in srgb,#fff 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.bg-white\\/80{background-color:color-mix(in srgb,#fff 80%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.bg-gradient-to-b{--tw-gradient-position: to bottom in oklab;background-image:linear-gradient(var(--tw-gradient-stops))}.from-black{--tw-gradient-from: var(--color-black);--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.from-black\\/60{--tw-gradient-from: color-mix(in srgb, #000 60%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-gradient-from: color-mix(in oklab, var(--color-black) 60%, transparent)}--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.to-transparent{--tw-gradient-to: transparent;--tw-gradient-stops: var(--tw-gradient-via-stops, var(--tw-gradient-position), var(--tw-gradient-from) var(--tw-gradient-from-position), var(--tw-gradient-to) var(--tw-gradient-to-position))}.fill-slate-700{fill:var(--color-slate-700)}.p-0{padding:calc(var(--spacing) * 0)}.p-0\\.5{padding:calc(var(--spacing) * .5)}.p-1{padding:calc(var(--spacing) * 1)}.p-1\\.5{padding:calc(var(--spacing) * 1.5)}.p-2{padding:calc(var(--spacing) * 2)}.p-3{padding:calc(var(--spacing) * 3)}.p-4{padding:calc(var(--spacing) * 4)}.p-6{padding:calc(var(--spacing) * 6)}.p-8{padding:calc(var(--spacing) * 8)}.p-12{padding:calc(var(--spacing) * 12)}.px-1{padding-inline:calc(var(--spacing) * 1)}.px-1\\.5{padding-inline:calc(var(--spacing) * 1.5)}.px-2{padding-inline:calc(var(--spacing) * 2)}.px-3{padding-inline:calc(var(--spacing) * 3)}.px-4{padding-inline:calc(var(--spacing) * 4)}.px-5{padding-inline:calc(var(--spacing) * 5)}.px-6{padding-inline:calc(var(--spacing) * 6)}.px-8{padding-inline:calc(var(--spacing) * 8)}.py-0{padding-block:calc(var(--spacing) * 0)}.py-0\\.5{padding-block:calc(var(--spacing) * .5)}.py-1{padding-block:calc(var(--spacing) * 1)}.py-1\\.5{padding-block:calc(var(--spacing) * 1.5)}.py-2{padding-block:calc(var(--spacing) * 2)}.py-2\\.5{padding-block:calc(var(--spacing) * 2.5)}.py-3{padding-block:calc(var(--spacing) * 3)}.py-4{padding-block:calc(var(--spacing) * 4)}.py-12{padding-block:calc(var(--spacing) * 12)}.pt-1{padding-top:calc(var(--spacing) * 1)}.pt-4{padding-top:calc(var(--spacing) * 4)}.pr-3{padding-right:calc(var(--spacing) * 3)}.pr-5{padding-right:calc(var(--spacing) * 5)}.pr-8{padding-right:calc(var(--spacing) * 8)}.pr-12{padding-right:calc(var(--spacing) * 12)}.pb-1{padding-bottom:calc(var(--spacing) * 1)}.pl-4{padding-left:calc(var(--spacing) * 4)}.pl-11{padding-left:calc(var(--spacing) * 11)}.text-center{text-align:center}.text-left{text-align:left}.text-4xl{font-size:var(--text-4xl);line-height:var(--tw-leading, var(--text-4xl--line-height))}.text-lg{font-size:var(--text-lg);line-height:var(--tw-leading, var(--text-lg--line-height))}.text-sm{font-size:var(--text-sm);line-height:var(--tw-leading, var(--text-sm--line-height))}.text-xs{font-size:var(--text-xs);line-height:var(--tw-leading, var(--text-xs--line-height))}.text-\\[7px\\]{font-size:7px}.text-\\[9px\\]{font-size:9px}.text-\\[10px\\]{font-size:10px}.text-\\[11px\\]{font-size:11px}.leading-relaxed{--tw-leading: var(--leading-relaxed);line-height:var(--leading-relaxed)}.leading-tight{--tw-leading: var(--leading-tight);line-height:var(--leading-tight)}.font-black{--tw-font-weight: var(--font-weight-black);font-weight:var(--font-weight-black)}.font-bold{--tw-font-weight: var(--font-weight-bold);font-weight:var(--font-weight-bold)}.font-medium{--tw-font-weight: var(--font-weight-medium);font-weight:var(--font-weight-medium)}.font-semibold{--tw-font-weight: var(--font-weight-semibold);font-weight:var(--font-weight-semibold)}.tracking-\\[0\\.2em\\]{--tw-tracking: .2em;letter-spacing:.2em}.tracking-tight{--tw-tracking: var(--tracking-tight);letter-spacing:var(--tracking-tight)}.tracking-tighter{--tw-tracking: var(--tracking-tighter);letter-spacing:var(--tracking-tighter)}.tracking-widest{--tw-tracking: var(--tracking-widest);letter-spacing:var(--tracking-widest)}.text-amber-500{color:var(--color-amber-500)}.text-black{color:var(--color-black)}.text-blue-500{color:var(--color-blue-500)}.text-blue-600{color:var(--color-blue-600)}.text-emerald-500{color:var(--color-emerald-500)}.text-emerald-600{color:var(--color-emerald-600)}.text-emerald-600\\/70{color:color-mix(in srgb,oklch(59.6% .145 163.225) 70%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-emerald-600) 70%,transparent)}}.text-emerald-700{color:var(--color-emerald-700)}.text-purple-500{color:var(--color-purple-500)}.text-purple-600{color:var(--color-purple-600)}.text-red-400{color:var(--color-red-400)}.text-red-600{color:var(--color-red-600)}.text-slate-300{color:var(--color-slate-300)}.text-slate-400{color:var(--color-slate-400)}.text-slate-500{color:var(--color-slate-500)}.text-slate-600{color:var(--color-slate-600)}.text-slate-700{color:var(--color-slate-700)}.text-slate-800{color:var(--color-slate-800)}.text-slate-900{color:var(--color-slate-900)}.text-white{color:var(--color-white)}.text-white\\/50{color:color-mix(in srgb,#fff 50%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-white) 50%,transparent)}}.text-white\\/80{color:color-mix(in srgb,#fff 80%,transparent);@supports (color: color-mix(in lab,red,red)){color:color-mix(in oklab,var(--color-white) 80%,transparent)}}.capitalize{text-transform:capitalize}.uppercase{text-transform:uppercase}.italic{font-style:italic}.antialiased{-webkit-font-smoothing:antialiased;-moz-osx-font-smoothing:grayscale}.opacity-0{opacity:0%}.shadow-2xl{--tw-shadow: 0 25px 50px -12px var(--tw-shadow-color, rgb(0 0 0 / .25));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-lg{--tw-shadow: 0 10px 15px -3px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 4px 6px -4px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-sm{--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-xl{--tw-shadow: 0 20px 25px -5px var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 8px 10px -6px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}.shadow-black{--tw-shadow-color: #000;@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, var(--color-black) var(--tw-shadow-alpha), transparent)}}.shadow-black\\/80{--tw-shadow-color: color-mix(in srgb, #000 80%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-black) 80%, transparent) var(--tw-shadow-alpha), transparent)}}.shadow-blue-500{--tw-shadow-color: oklch(62.3% .214 259.815);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, var(--color-blue-500) var(--tw-shadow-alpha), transparent)}}.shadow-blue-500\\/20{--tw-shadow-color: color-mix(in srgb, oklch(62.3% .214 259.815) 20%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-shadow-color: color-mix(in oklab, color-mix(in oklab, var(--color-blue-500) 20%, transparent) var(--tw-shadow-alpha), transparent)}}.backdrop-blur-\\[1px\\]{--tw-backdrop-blur: blur(1px);-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-md{--tw-backdrop-blur: blur(var(--blur-md));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.backdrop-blur-sm{--tw-backdrop-blur: blur(var(--blur-sm));-webkit-backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,);backdrop-filter:var(--tw-backdrop-blur,) var(--tw-backdrop-brightness,) var(--tw-backdrop-contrast,) var(--tw-backdrop-grayscale,) var(--tw-backdrop-hue-rotate,) var(--tw-backdrop-invert,) var(--tw-backdrop-opacity,) var(--tw-backdrop-saturate,) var(--tw-backdrop-sepia,)}.transition{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to,opacity,box-shadow,transform,translate,scale,rotate,filter,-webkit-backdrop-filter,backdrop-filter,display,content-visibility,overlay,pointer-events;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-all{transition-property:all;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-colors{transition-property:color,background-color,border-color,outline-color,text-decoration-color,fill,stroke,--tw-gradient-from,--tw-gradient-via,--tw-gradient-to;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-opacity{transition-property:opacity;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-shadow{transition-property:box-shadow;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.transition-transform{transition-property:transform,translate,scale,rotate;transition-timing-function:var(--tw-ease, var(--default-transition-timing-function));transition-duration:var(--tw-duration, var(--default-transition-duration))}.duration-200{--tw-duration: .2s;transition-duration:.2s}.duration-300{--tw-duration: .3s;transition-duration:.3s}.duration-500{--tw-duration: .5s;transition-duration:.5s}.outline-none{--tw-outline-style: none;outline-style:none}.select-none{-webkit-user-select:none;user-select:none}.group-hover\\:scale-105{&:is(:where(.group):hover *){@media(hover:hover){--tw-scale-x: 105%;--tw-scale-y: 105%;--tw-scale-z: 105%;scale:var(--tw-scale-x) var(--tw-scale-y)}}}.group-hover\\:scale-110{&:is(:where(.group):hover *){@media(hover:hover){--tw-scale-x: 110%;--tw-scale-y: 110%;--tw-scale-z: 110%;scale:var(--tw-scale-x) var(--tw-scale-y)}}}.group-hover\\:bg-blue-50{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-blue-50)}}}.group-hover\\:bg-blue-100{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-blue-100)}}}.group-hover\\:bg-emerald-50{&:is(:where(.group):hover *){@media(hover:hover){background-color:var(--color-emerald-50)}}}.group-hover\\:fill-slate-900{&:is(:where(.group):hover *){@media(hover:hover){fill:var(--color-slate-900)}}}.group-hover\\:text-blue-600{&:is(:where(.group):hover *){@media(hover:hover){color:var(--color-blue-600)}}}.group-hover\\:opacity-100{&:is(:where(.group):hover *){@media(hover:hover){opacity:100%}}}.group-hover\\:shadow-sm{&:is(:where(.group):hover *){@media(hover:hover){--tw-shadow: 0 1px 3px 0 var(--tw-shadow-color, rgb(0 0 0 / .1)), 0 1px 2px -1px var(--tw-shadow-color, rgb(0 0 0 / .1));box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}}.placeholder\\:text-slate-400{&::placeholder{color:var(--color-slate-400)}}.hover\\:border-blue-400{&:hover{@media(hover:hover){border-color:var(--color-blue-400)}}}.hover\\:border-slate-100{&:hover{@media(hover:hover){border-color:var(--color-slate-100)}}}.hover\\:border-slate-200{&:hover{@media(hover:hover){border-color:var(--color-slate-200)}}}.hover\\:border-slate-300{&:hover{@media(hover:hover){border-color:var(--color-slate-300)}}}.hover\\:bg-black{&:hover{@media(hover:hover){background-color:var(--color-black)}}}.hover\\:bg-blue-50{&:hover{@media(hover:hover){background-color:var(--color-blue-50)}}}.hover\\:bg-blue-50\\/50{&:hover{@media(hover:hover){background-color:color-mix(in srgb,oklch(97% .014 254.604) 50%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-blue-50) 50%,transparent)}}}}.hover\\:bg-blue-700{&:hover{@media(hover:hover){background-color:var(--color-blue-700)}}}.hover\\:bg-red-50{&:hover{@media(hover:hover){background-color:var(--color-red-50)}}}.hover\\:bg-slate-50{&:hover{@media(hover:hover){background-color:var(--color-slate-50)}}}.hover\\:bg-slate-100{&:hover{@media(hover:hover){background-color:var(--color-slate-100)}}}.hover\\:bg-white{&:hover{@media(hover:hover){background-color:var(--color-white)}}}.hover\\:bg-white\\/20{&:hover{@media(hover:hover){background-color:color-mix(in srgb,#fff 20%,transparent);@supports (color: color-mix(in lab,red,red)){background-color:color-mix(in oklab,var(--color-white) 20%,transparent)}}}}.hover\\:text-blue-500{&:hover{@media(hover:hover){color:var(--color-blue-500)}}}.hover\\:text-red-500{&:hover{@media(hover:hover){color:var(--color-red-500)}}}.hover\\:text-slate-500{&:hover{@media(hover:hover){color:var(--color-slate-500)}}}.hover\\:text-slate-600{&:hover{@media(hover:hover){color:var(--color-slate-600)}}}.hover\\:text-slate-700{&:hover{@media(hover:hover){color:var(--color-slate-700)}}}.hover\\:text-white{&:hover{@media(hover:hover){color:var(--color-white)}}}.hover\\:opacity-100{&:hover{@media(hover:hover){opacity:100%}}}.focus\\:border-blue-500{&:focus{border-color:var(--color-blue-500)}}.focus\\:border-slate-400{&:focus{border-color:var(--color-slate-400)}}.focus\\:ring-4{&:focus{--tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(4px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);box-shadow:var(--tw-inset-shadow),var(--tw-inset-ring-shadow),var(--tw-ring-offset-shadow),var(--tw-ring-shadow),var(--tw-shadow)}}.focus\\:ring-blue-500\\/10{&:focus{--tw-ring-color: color-mix(in srgb, oklch(62.3% .214 259.815) 10%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-blue-500) 10%, transparent)}}}.focus\\:ring-slate-400\\/5{&:focus{--tw-ring-color: color-mix(in srgb, oklch(70.4% .04 256.788) 5%, transparent);@supports (color: color-mix(in lab,red,red)){--tw-ring-color: color-mix(in oklab, var(--color-slate-400) 5%, transparent)}}}.focus\\:outline-none{&:focus{--tw-outline-style: none;outline-style:none}}.active\\:cursor-grabbing{&:active{cursor:grabbing}}.disabled\\:bg-slate-200{&:disabled{background-color:var(--color-slate-200)}}.disabled\\:bg-slate-300{&:disabled{background-color:var(--color-slate-300)}}.disabled\\:text-slate-400{&:disabled{color:var(--color-slate-400)}}.disabled\\:opacity-20{&:disabled{opacity:20%}}.disabled\\:opacity-30{&:disabled{opacity:30%}}.disabled\\:opacity-50{&:disabled{opacity:50%}}.md\\:space-y-8{@media(width>=48rem){:where(&>:not(:last-child)){--tw-space-y-reverse: 0;margin-block-start:calc(calc(var(--spacing) * 8) * var(--tw-space-y-reverse));margin-block-end:calc(calc(var(--spacing) * 8) * calc(1 - var(--tw-space-y-reverse)))}}}.md\\:p-12{@media(width>=48rem){padding:calc(var(--spacing) * 12)}}}@keyframes blob{0%{transform:translate(0) scale(1)}33%{transform:translate(30px,-50px) scale(1.1)}66%{transform:translate(-20px,20px) scale(.9)}to{transform:translate(0) scale(1)}}.animate-blob{animation:blob 7s infinite}.animation-delay-2000{animation-delay:2s}.animation-delay-4000{animation-delay:4s}@property --tw-translate-x{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-y{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-translate-z{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-scale-x{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-y{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-scale-z{syntax: "*"; inherits: false; initial-value: 1;}@property --tw-rotate-x{syntax: "*"; inherits: false;}@property --tw-rotate-y{syntax: "*"; inherits: false;}@property --tw-rotate-z{syntax: "*"; inherits: false;}@property --tw-skew-x{syntax: "*"; inherits: false;}@property --tw-skew-y{syntax: "*"; inherits: false;}@property --tw-space-y-reverse{syntax: "*"; inherits: false; initial-value: 0;}@property --tw-border-style{syntax: "*"; inherits: false; initial-value: solid;}@property --tw-gradient-position{syntax: "*"; inherits: false;}@property --tw-gradient-from{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-via{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-to{syntax: "<color>"; inherits: false; initial-value: #0000;}@property --tw-gradient-stops{syntax: "*"; inherits: false;}@property --tw-gradient-via-stops{syntax: "*"; inherits: false;}@property --tw-gradient-from-position{syntax: "<length-percentage>"; inherits: false; initial-value: 0%;}@property --tw-gradient-via-position{syntax: "<length-percentage>"; inherits: false; initial-value: 50%;}@property --tw-gradient-to-position{syntax: "<length-percentage>"; inherits: false; initial-value: 100%;}@property --tw-leading{syntax: "*"; inherits: false;}@property --tw-font-weight{syntax: "*"; inherits: false;}@property --tw-tracking{syntax: "*"; inherits: false;}@property --tw-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-shadow-color{syntax: "*"; inherits: false;}@property --tw-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-inset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-shadow-color{syntax: "*"; inherits: false;}@property --tw-inset-shadow-alpha{syntax: "<percentage>"; inherits: false; initial-value: 100%;}@property --tw-ring-color{syntax: "*"; inherits: false;}@property --tw-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-inset-ring-color{syntax: "*"; inherits: false;}@property --tw-inset-ring-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-ring-inset{syntax: "*"; inherits: false;}@property --tw-ring-offset-width{syntax: "<length>"; inherits: false; initial-value: 0px;}@property --tw-ring-offset-color{syntax: "*"; inherits: false; initial-value: #fff;}@property --tw-ring-offset-shadow{syntax: "*"; inherits: false; initial-value: 0 0 #0000;}@property --tw-backdrop-blur{syntax: "*"; inherits: false;}@property --tw-backdrop-brightness{syntax: "*"; inherits: false;}@property --tw-backdrop-contrast{syntax: "*"; inherits: false;}@property --tw-backdrop-grayscale{syntax: "*"; inherits: false;}@property --tw-backdrop-hue-rotate{syntax: "*"; inherits: false;}@property --tw-backdrop-invert{syntax: "*"; inherits: false;}@property --tw-backdrop-opacity{syntax: "*"; inherits: false;}@property --tw-backdrop-saturate{syntax: "*"; inherits: false;}@property --tw-backdrop-sepia{syntax: "*"; inherits: false;}@property --tw-duration{syntax: "*"; inherits: false;}@keyframes spin{to{transform:rotate(360deg)}}@layer properties{@supports ((-webkit-hyphens: none) and (not (margin-trim: inline))) or ((-moz-orient: inline) and (not (color:rgb(from red r g b)))){*,:before,:after,::backdrop{--tw-translate-x: 0;--tw-translate-y: 0;--tw-translate-z: 0;--tw-scale-x: 1;--tw-scale-y: 1;--tw-scale-z: 1;--tw-rotate-x: initial;--tw-rotate-y: initial;--tw-rotate-z: initial;--tw-skew-x: initial;--tw-skew-y: initial;--tw-space-y-reverse: 0;--tw-border-style: solid;--tw-gradient-position: initial;--tw-gradient-from: #0000;--tw-gradient-via: #0000;--tw-gradient-to: #0000;--tw-gradient-stops: initial;--tw-gradient-via-stops: initial;--tw-gradient-from-position: 0%;--tw-gradient-via-position: 50%;--tw-gradient-to-position: 100%;--tw-leading: initial;--tw-font-weight: initial;--tw-tracking: initial;--tw-shadow: 0 0 #0000;--tw-shadow-color: initial;--tw-shadow-alpha: 100%;--tw-inset-shadow: 0 0 #0000;--tw-inset-shadow-color: initial;--tw-inset-shadow-alpha: 100%;--tw-ring-color: initial;--tw-ring-shadow: 0 0 #0000;--tw-inset-ring-color: initial;--tw-inset-ring-shadow: 0 0 #0000;--tw-ring-inset: initial;--tw-ring-offset-width: 0px;--tw-ring-offset-color: #fff;--tw-ring-offset-shadow: 0 0 #0000;--tw-backdrop-blur: initial;--tw-backdrop-brightness: initial;--tw-backdrop-contrast: initial;--tw-backdrop-grayscale: initial;--tw-backdrop-hue-rotate: initial;--tw-backdrop-invert: initial;--tw-backdrop-opacity: initial;--tw-backdrop-saturate: initial;--tw-backdrop-sepia: initial;--tw-duration: initial}}}
|
|
3
|
+
`);var I=require("react");var U=mt(require("react")),m=require("lucide-react");var Tt=require("clsx"),Mt=require("tailwind-merge");function D(...g){return(0,Mt.twMerge)((0,Tt.clsx)(g))}var t=require("react/jsx-runtime"),de=["Inter","Lato","Open Sans","Poppins","Roboto","Roboto Slab","Georgia","Playfair Display","Merriweather","Nunito Sans","Montserrat","Oswald","Raleway","Ubuntu","Lora","PT Sans","PT Serif","Play","Arvo","Kanit","Times New Roman","Arial"],pe=[12,14,16,18,20,24,28,32,36,48,64,72,96],ge=[{name:"Basic Shapes",shapes:["rect","circle","triangle","rightTriangle","rhombus","parallelogram","trapezoid","pentagon","hexagon","heptagon","octagon","heart","smiley","sun","moon"]},{name:"Arrows",shapes:["arrowRight","arrowLeft","arrowUp","arrowDown","arrowLeftRight","arrowUpDown"]},{name:"Stars & Symbols",shapes:["star4","star5","star6","star8","cloud","lightning"]},{name:"Equation Shapes",shapes:["plus","minus","multiply","divide","equal"]}],he=({type:g,className:a})=>{switch(g){case"rect":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",fill:"currentColor"})});case"circle":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor"})});case"triangle":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 4L20 18H4L12 4Z",fill:"currentColor"})});case"rightTriangle":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M4 4V20H20L4 4Z",fill:"currentColor"})});case"rhombus":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 4L20 12L12 20L4 12L12 4Z",fill:"currentColor"})});case"parallelogram":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M7 4H21L17 20H3L7 4Z",fill:"currentColor"})});case"trapezoid":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M6 4H18L21 20H3L6 4Z",fill:"currentColor"})});case"pentagon":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 3L21 9V19H3V9L12 3Z",fill:"currentColor"})});case"hexagon":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 3L20 7.5V16.5L12 21L4 16.5V7.5L12 3Z",fill:"currentColor"})});case"heptagon":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 3L18.5 6L21 13L16 20H8L3 13L5.5 6L12 3Z",fill:"currentColor"})});case"octagon":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M8.5 3H15.5L21 8.5V15.5L15.5 21H8.5L3 15.5V8.5L8.5 3Z",fill:"currentColor"})});case"heart":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 21.35l-1.45-1.32C5.4 15.36 2 12.28 2 8.5 2 5.42 4.42 3 7.5 3c1.74 0 3.41.81 4.5 2.09C13.09 3.81 14.76 3 16.5 3 19.58 3 22 5.42 22 8.5c0 3.78-3.4 6.86-8.55 11.54L12 21.35z",fill:"currentColor"})});case"smiley":return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"9",fill:"currentColor",fillOpacity:"0.2",stroke:"currentColor",strokeWidth:"2"}),(0,t.jsx)("circle",{cx:"9",cy:"9",r:"1.5",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"15",cy:"9",r:"1.5",fill:"currentColor"}),(0,t.jsx)("path",{d:"M8 15C8 15 9.5 17 12 17C14.5 17 16 15 16 15",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]});case"sun":return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,t.jsx)("circle",{cx:"12",cy:"12",r:"5",fill:"currentColor"}),(0,t.jsx)("path",{d:"M12 2V4M12 20V22M4 12H2M22 12H20M19.07 4.93L17.66 6.34M6.34 17.66L4.93 19.07M4.93 4.93L6.34 6.34M17.66 17.66L19.07 19.07",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})]});case"moon":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 3a9 9 0 1 0 9 9 7 7 0 0 1-9-9",fill:"currentColor"})});case"arrowRight":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M4 11h11.5l-3.5-3.5 1.5-1.5 6 6-6 6-1.5-1.5 3.5-3.5H4z",fill:"currentColor"})});case"arrowLeft":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M20 11H8.5l3.5-3.5L10.5 6l-6 6 6 6 1.5-1.5-3.5-3.5H20z",fill:"currentColor"})});case"arrowUp":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M13 20V8.5l3.5 3.5 1.5-1.5-6-6-6 6 1.5 1.5 3.5-3.5V20z",fill:"currentColor"})});case"arrowDown":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M11 4v11.5l-3.5-3.5-1.5 1.5 6 6 6-6-1.5-1.5-3.5 3.5V4z",fill:"currentColor"})});case"arrowLeftRight":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M4 12l4-4v3h8V8l4 4-4 4v-3H8v3l-4-4z",fill:"currentColor"})});case"arrowUpDown":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 4l-4 4h3v8H8l4 4 4-4h-3V8h3l-4-4z",fill:"currentColor"})});case"star4":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 2l2 8 8 2-8 2-2 8-2-8-8-2 8-2 2-8z",fill:"currentColor"})});case"star5":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 2l2.5 7.5H22l-6 4.5 2.5 7.5-6.5-4.5-6.5 4.5 2.5-7.5-6-4.5h7.5L12 2z",fill:"currentColor"})});case"star6":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 2l3 5 6-1-4 4.5 2 6.5-7-3-7 3 2-6.5-4-4.5 6 1 3-5z",fill:"currentColor"})});case"star8":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M12 2l2 4 4-2-2 4 4 2-4 2 2 4-4-2-2 4-2-4-4 2 2-4-4-2 4-2-2-4 4 2 2-4z",fill:"currentColor"})});case"cloud":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M17.5 19c-3 0-5.5-2.5-5.5-5.5 0-.2 0-.4.1-.6-2-.8-3.6-2.5-4.1-4.7C6.5 7.4 5 6 3 6c-1.7 0-3 1.3-3 3s1.3 3 3 3c.4 0 .8-.1 1.2-.2C4.1 13 5 14.5 6.5 15.5c.3 1.8 1.4 3.4 3 4.3.4.2.8.3 1.2.4 1.2.4 2.5.6 3.8.6 4.4 0 8-3.6 8-8s-3.6-8-8-8c-.4 0-.8 0-1.2.1-1.2.2-2.3.7-3.2 1.5C11 4.2 12.4 3.5 14 3.5c4.1 0 7.5 3.4 7.5 7.5s-1.8 7.5-4 8z",fill:"currentColor",transform:"scale(0.8) translate(3,3)"})});case"lightning":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M13 2L3 14h9v8l10-12h-9l3-8z",fill:"currentColor"})});case"plus":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M19 13h-6v6h-2v-6H5v-2h6V5h2v6h6v2z",fill:"currentColor"})});case"minus":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M19 13H5v-2h14v2z",fill:"currentColor"})});case"multiply":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12 19 6.41z",fill:"currentColor"})});case"divide":return(0,t.jsxs)("svg",{viewBox:"0 0 24 24",className:a,children:[(0,t.jsx)("circle",{cx:"12",cy:"7",r:"2",fill:"currentColor"}),(0,t.jsx)("circle",{cx:"12",cy:"17",r:"2",fill:"currentColor"}),(0,t.jsx)("rect",{x:"5",y:"11",width:"14",height:"2",fill:"currentColor"})]});case"equal":return(0,t.jsx)("svg",{viewBox:"0 0 24 24",className:a,children:(0,t.jsx)("path",{d:"M19 10H5V8h14v2zm0 6H5v-2h14v2z",fill:"currentColor"})});default:return(0,t.jsx)("div",{className:"w-6 h-6 bg-slate-200 rounded-sm"})}},ue=({onAddShape:g,uiScale:a})=>{let[n,p]=(0,U.useState)(!1);return U.default.useEffect(()=>(window._toggleShapesMenu=()=>p(!n),()=>{window._toggleShapesMenu=void 0}),[n]),n?(0,t.jsx)("div",{className:"absolute top-full left-0 mt-2 bg-white border border-slate-200 rounded-2xl shadow-2xl p-4 overflow-y-auto z-[100] animate-in fade-in zoom-in-95 duration-200",style:{width:`${320*a}px`,maxHeight:`${480*a}px`},children:(0,t.jsx)("div",{className:"flex flex-col gap-6",children:ge.map(b=>(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("span",{className:"text-[10px] font-black uppercase tracking-widest text-slate-400 px-1",style:{fontSize:`${10*a}px`},children:b.name}),(0,t.jsx)("div",{className:"grid grid-cols-5 gap-1",children:b.shapes.map(u=>(0,t.jsx)("button",{onClick:()=>{g(u),p(!1)},className:"aspect-square hover:bg-slate-50 rounded-lg flex items-center justify-center border border-transparent hover:border-slate-100 transition-all group p-1",title:u,children:(0,t.jsx)("div",{className:"w-full h-full bg-slate-100 rounded-sm group-hover:bg-blue-100 group-hover:scale-110 transition-all flex items-center justify-center overflow-hidden p-1.5",children:(0,t.jsx)(he,{type:u,className:"w-full h-full text-slate-400 group-hover:text-blue-600 transition-colors"})})},u))})]},b.name))})}):null},Dt=({onAddText:g,onAddImage:a,onAddShape:n,onAddSlide:p,onExport:b,onFormatText:u,onDeleteElement:S,onApplyLayout:z,onPlay:L,selectedElement:o,appName:x,onAiAction:i,onAiResponseAction:w,aiResponse:y,isAiLoading:e,onNewPresentation:r,onLoadPresentation:s,appBgColor:c="#B7472A",uiScale:f,source:B})=>{let F=U.default.useRef(null),[ot,_]=(0,U.useState)("Home"),[E,j]=(0,U.useState)(!1),[X,it]=(0,U.useState)(!1),[ht,nt]=(0,U.useState)(!1),[Q,H]=(0,U.useState)(!1),[O,Z]=(0,U.useState)("file"),[tt,st]=(0,U.useState)(""),T=(o==null?void 0:o.type)==="text",bt=(o==null?void 0:o.type)==="shape",lt="#B7472A";return(0,t.jsxs)("div",{className:"flex flex-col border-b border-slate-200 bg-white z-50 select-none",style:{fontSize:`${12*f}px`},children:[(0,t.jsxs)("div",{className:"bg-white flex items-center justify-stretch border-b border-slate-200/60 transition-all duration-300 relative z-[1000]",style:{height:`${120*f}px`,overflow:"visible"},children:[(0,t.jsxs)("div",{className:D("flex-1 flex flex-col items-center border-r border-slate-100 px-3 gap-1 h-full py-2",f<.84?"min-w-0":"min-w-fit"),children:[(0,t.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto",children:[(0,t.jsxs)("button",{onClick:p,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg group transition-all min-w-[64px]",children:[(0,t.jsx)("div",{className:"bg-orange-50 p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,t.jsx)(m.Plus,{size:20,style:{color:c}})}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-slate-700",children:"New Slide"})]}),(0,t.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsxs)("button",{onClick:()=>j(!E),className:D("flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg transition-all min-w-[64px]",E&&"bg-slate-100"),children:[(0,t.jsx)("div",{className:"p-1.5 rounded-lg",children:(0,t.jsx)(m.Layout,{size:20,className:"text-slate-500"})}),(0,t.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Layout"})]}),E&&(0,t.jsxs)("div",{className:"absolute top-full left-1/2 -translate-x-1/2 mt-1 bg-white border border-slate-200 rounded-xl shadow-2xl p-2 w-56 flex flex-col gap-1 z-[100] animate-in fade-in zoom-in-95 duration-200",children:[(0,t.jsxs)("button",{onClick:()=>{z("title"),j(!1)},className:"flex items-center gap-3 px-4 py-2.5 hover:bg-slate-50 rounded-lg text-xs font-semibold text-slate-700 transition-colors border border-transparent hover:border-slate-100",children:[(0,t.jsx)(m.FileText,{size:16,className:"text-blue-500"})," Title Slide"]}),(0,t.jsxs)("button",{onClick:()=>{z("content"),j(!1)},className:"flex items-center gap-3 px-4 py-2.5 hover:bg-slate-50 rounded-lg text-xs font-semibold text-slate-700 transition-colors border border-transparent hover:border-slate-100",children:[(0,t.jsx)(m.List,{size:16,className:"text-emerald-500"})," Title & Content"]}),(0,t.jsxs)("button",{onClick:()=>{z("split"),j(!1)},className:"flex items-center gap-3 px-4 py-2.5 hover:bg-slate-50 rounded-lg text-xs font-semibold text-slate-700 transition-colors border border-transparent hover:border-slate-100",children:[(0,t.jsx)(m.Columns,{size:16,className:"text-purple-500"})," Two Columns"]})]})]})]}),f>=.85&&(0,t.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Slides"})]}),(0,t.jsxs)("div",{className:D("flex-1 flex flex-col items-center border-r border-slate-100 px-3 gap-1 h-full py-2",f<.85?"px-2":"px-4"),children:[(0,t.jsxs)("div",{className:"flex items-center justify-center gap-1.5 w-full mt-1",children:[(0,t.jsx)("select",{disabled:!T,value:(o==null?void 0:o.fontFamily)||"Arial",onChange:v=>u({fontFamily:v.target.value}),className:D("h-7 px-2 text-[11px] text-slate-900 border border-slate-200 rounded-lg font-semibold bg-white hover:border-slate-300 outline-none disabled:opacity-50 transition-colors appearance-none cursor-pointer",f<.85?"flex-1":"w-44"),children:de.map(v=>(0,t.jsx)("option",{value:v,children:v},v))}),(0,t.jsx)("select",{disabled:!T,value:(o==null?void 0:o.fontSize)||24,onChange:v=>u({fontSize:parseInt(v.target.value)}),className:"h-7 px-1.5 text-[11px] text-slate-900 border border-slate-200 rounded-lg font-semibold bg-white hover:border-slate-300 outline-none w-14 disabled:opacity-50 transition-colors appearance-none cursor-pointer text-center",children:pe.map(v=>(0,t.jsx)("option",{value:v,children:v},v))})]}),(0,t.jsxs)("div",{className:"flex items-center justify-between w-full mt-auto mb-1",children:[(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)("button",{disabled:!T,onClick:()=>u({isBold:!o.isBold}),className:D("p-1.5 rounded-lg transition-all disabled:opacity-30",o!=null&&o.isBold?"bg-slate-100 text-slate-900":"text-slate-500 hover:bg-slate-50"),children:(0,t.jsx)(m.Bold,{size:14,strokeWidth:3})}),(0,t.jsx)("button",{disabled:!T,onClick:()=>u({isItalic:!o.isItalic}),className:D("p-1.5 rounded-lg transition-all disabled:opacity-30",o!=null&&o.isItalic?"bg-slate-100 text-slate-900":"text-slate-500 hover:bg-slate-50"),children:(0,t.jsx)(m.Italic,{size:14})}),(0,t.jsx)("button",{disabled:!T,onClick:()=>u({isBulleted:!o.isBulleted}),className:D("p-1.5 rounded-lg transition-all disabled:opacity-30",o!=null&&o.isBulleted?"bg-slate-100 text-slate-900":"text-slate-500 hover:bg-slate-50"),children:(0,t.jsx)(m.List,{size:14})}),(0,t.jsxs)("div",{className:"relative group p-1 hover:bg-slate-50 rounded-lg transition-colors cursor-pointer ml-0.5",children:[(0,t.jsx)("input",{type:"color",disabled:!o,value:T?o.color||"#000000":(o==null?void 0:o.fill)||"#3b82f6",onChange:v=>u(T?{color:v.target.value}:{fill:v.target.value}),className:"w-6 h-4 p-0 border-0 bg-transparent cursor-pointer disabled:opacity-50",title:"Font/Fill Color"}),(0,t.jsx)("div",{className:"absolute bottom-1 left-1 right-1 h-0.5 rounded-full",style:{backgroundColor:T?o.color||"#000000":(o==null?void 0:o.fill)||"#3b82f6"}})]})]}),(0,t.jsx)("div",{className:"h-4 w-[1px] bg-slate-200 mx-1.5"}),(0,t.jsxs)("div",{className:"flex items-center gap-0.5 bg-slate-50/50 p-0.5 rounded-lg",children:[(0,t.jsx)("button",{disabled:!T,onClick:()=>u({textAlign:"left"}),className:D("p-1 rounded-md transition-all disabled:opacity-30",(o==null?void 0:o.textAlign)==="left"?"bg-white shadow-sm scale-105":"text-slate-400"),style:{color:(o==null?void 0:o.textAlign)==="left"?c:void 0},children:(0,t.jsx)(m.AlignLeft,{size:13})}),(0,t.jsx)("button",{disabled:!T,onClick:()=>u({textAlign:"center"}),className:D("p-1 rounded-md transition-all disabled:opacity-30",(o==null?void 0:o.textAlign)==="center"?"bg-white shadow-sm scale-105":"text-slate-400"),style:{color:(o==null?void 0:o.textAlign)==="center"?c:void 0},children:(0,t.jsx)(m.AlignCenter,{size:13})}),(0,t.jsx)("button",{disabled:!T,onClick:()=>u({textAlign:"right"}),className:D("p-1 rounded-md transition-all disabled:opacity-30",(o==null?void 0:o.textAlign)==="right"?"bg-white shadow-sm scale-105":"text-slate-400"),style:{color:(o==null?void 0:o.textAlign)==="right"?c:void 0},children:(0,t.jsx)(m.AlignRight,{size:13})})]})]}),f>=.85&&(0,t.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Font"})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center border-r border-slate-100 px-3 gap-1 h-full py-2 shrink-0",children:[(0,t.jsxs)("div",{className:"flex items-center justify-center gap-2 my-auto",children:[(0,t.jsxs)("div",{className:"relative group/shapes flex justify-center",children:[(0,t.jsxs)("button",{className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg group transition-all min-w-[64px]",onClick:()=>{var v;return(v=window._toggleShapesMenu)==null?void 0:v.call(window)},children:[(0,t.jsx)("div",{className:"bg-blue-50 p-1.5 rounded-lg group-hover:scale-105 transition-transform",children:(0,t.jsx)(m.Square,{size:20,className:"text-blue-600"})}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-slate-700",children:"Shapes"})]}),(0,t.jsx)(ue,{onAddShape:v=>{n(v)},uiScale:f})]}),(0,t.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,t.jsxs)("button",{onClick:g,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 transition-colors min-w-[64px]",title:"Text Box",children:[(0,t.jsx)("div",{className:"p-1.5",children:(0,t.jsx)(m.Type,{size:20})}),(0,t.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Text Box"})]}),(0,t.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,t.jsxs)("button",{onClick:()=>{var v;return(v=F.current)==null?void 0:v.click()},className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 transition-colors min-w-[64px]",title:"Image",children:[(0,t.jsx)("div",{className:"p-1.5",children:(0,t.jsx)(m.Image,{size:20})}),(0,t.jsx)("span",{className:"text-[10px] font-medium text-slate-500",children:"Image"}),(0,t.jsx)("input",{type:"file",ref:F,className:"hidden",accept:"image/*",onChange:v=>{var q;return((q=v.target.files)==null?void 0:q[0])&&a(v.target.files[0])}})]})]}),f>=.85&&(0,t.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Drawing"})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center border-r border-slate-100 px-3 gap-1 h-full py-2 relative",children:[(0,t.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto h-full",children:[(0,t.jsxs)("button",{disabled:!T||e,onClick:()=>i(o.id,"shorten"),className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all min-w-[64px]",children:[(0,t.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,t.jsx)(m.Sparkles,{size:20,className:"text-purple-500"})}),(0,t.jsx)("span",{className:"text-[10px] font-bold",children:"Shorten"})]}),(0,t.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,t.jsxs)("button",{disabled:!T||e,onClick:()=>i(o.id,"reframe"),className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all min-w-[64px]",children:[(0,t.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,t.jsx)(m.Sparkles,{size:20,className:"text-blue-500"})}),(0,t.jsx)("span",{className:"text-[10px] font-bold",children:"Reframe"})]}),(0,t.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,t.jsxs)("button",{disabled:!T||e,onClick:()=>i(o.id,"lengthen"),className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-600 disabled:opacity-20 transition-all min-w-[68px]",children:[(0,t.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,t.jsx)(m.Sparkles,{size:20,className:"text-emerald-500"})}),(0,t.jsx)("span",{className:"text-[10px] font-bold text-center leading-tight",children:"Lengthen"})]})]}),e&&(0,t.jsx)("div",{className:"absolute inset-x-0 top-2 bottom-8 bg-white/80 flex items-center justify-center rounded-lg z-10 backdrop-blur-[1px]",children:(0,t.jsx)(m.RefreshCw,{size:16,className:"text-blue-600 animate-spin"})}),f>=.85&&(0,t.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"AI Text"})]}),(0,t.jsxs)("div",{className:"flex-1 flex flex-col items-center pl-4 pr-3 gap-1 h-full py-2 relative",children:[(0,t.jsxs)("div",{className:"flex items-center justify-center gap-1 my-auto h-full",children:[(0,t.jsxs)("button",{onClick:L,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-700 transition-all min-w-[64px] group",title:"Present",children:[(0,t.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,t.jsx)(m.Play,{size:20,className:"fill-slate-700 group-hover:fill-slate-900"})}),(0,t.jsx)("span",{className:"text-[10px] font-bold",children:"Present"})]}),(0,t.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,t.jsxs)("button",{onClick:b,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-slate-50 rounded-lg text-slate-700 transition-all min-w-[64px] group",title:"Export",children:[(0,t.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,t.jsx)(m.Download,{size:20,className:"text-emerald-600"})}),(0,t.jsx)("span",{className:"text-[10px] font-bold",children:"Export"})]}),o&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"w-[1px] h-10 bg-slate-100 mx-1"}),(0,t.jsxs)("button",{onClick:S,className:"flex flex-col items-center justify-center gap-1.5 px-3 py-1.5 hover:bg-red-50 rounded-lg text-red-600 transition-all min-w-[64px] group",title:"Delete",children:[(0,t.jsx)("div",{className:"p-1.5 rounded-lg group-hover:scale-110 transition-transform",children:(0,t.jsx)(m.Trash2,{size:20})}),(0,t.jsx)("span",{className:"text-[10px] font-bold",children:"Delete"})]})]})]}),(0,t.jsxs)("div",{className:"absolute bottom-2 right-3 flex items-center gap-1 px-1.5 py-0.5 bg-emerald-50/50 rounded-md border border-emerald-100/50",children:[(0,t.jsx)(m.Check,{size:9,className:"text-emerald-500"}),(0,t.jsx)("span",{className:"text-[7px] font-black text-emerald-600/70 tracking-tighter uppercase",children:"Saved"})]}),f>=.85&&(0,t.jsx)("span",{className:"text-[9px] uppercase tracking-[0.2em] font-black text-slate-300 mt-auto",children:"Actions"})]})]}),Q&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("div",{className:"fixed inset-0 bg-slate-900/40 backdrop-blur-sm z-[2000]",onClick:()=>H(!1)}),(0,t.jsxs)("div",{className:"fixed top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 w-[480px] bg-white rounded-3xl shadow-2xl z-[2001] border border-slate-200 p-8 animate-in fade-in zoom-in-95 duration-200",children:[(0,t.jsxs)("div",{className:"flex justify-between items-center mb-6",children:[(0,t.jsxs)("h3",{className:"text-lg font-black text-slate-800 tracking-tight flex items-center gap-3",children:[(0,t.jsx)("div",{className:"p-2 bg-blue-50 text-blue-600 rounded-xl",children:(0,t.jsx)(m.Download,{size:20})}),"Upload Presentation"]}),(0,t.jsx)("button",{onClick:()=>H(!1),className:"text-slate-400 hover:text-slate-600 transition-colors",children:(0,t.jsx)(m.RefreshCw,{size:20,className:"rotate-45"})})]}),(0,t.jsxs)("div",{className:"flex gap-2 p-1 bg-slate-50 rounded-2xl mb-8",children:[(0,t.jsx)("button",{onClick:()=>Z("file"),className:D("flex-1 py-3 text-xs font-black rounded-xl transition-all",O==="file"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"FILE UPLOAD"}),(0,t.jsx)("button",{onClick:()=>Z("link"),className:D("flex-1 py-3 text-xs font-black rounded-xl transition-all",O==="link"?"bg-white text-blue-600 shadow-sm":"text-slate-500 hover:text-slate-700"),children:"LINK UPLOAD"})]}),O==="file"?(0,t.jsxs)("label",{className:"flex flex-col items-center justify-center gap-4 py-12 border-2 border-dashed border-slate-200 rounded-3xl hover:border-blue-400 hover:bg-blue-50/50 transition-all cursor-pointer group",children:[(0,t.jsx)("div",{className:"p-4 bg-white rounded-2xl shadow-sm border border-slate-100 group-hover:scale-110 transition-transform",children:(0,t.jsx)(m.Plus,{size:24,className:"text-blue-500"})}),(0,t.jsxs)("div",{className:"text-center",children:[(0,t.jsx)("p",{className:"text-sm font-bold text-slate-700",children:"Choose a PPTX file"}),(0,t.jsx)("p",{className:"text-xs text-slate-400 mt-1",children:"Maximum file size: 50MB"})]}),(0,t.jsx)("input",{type:"file",accept:".pptx",className:"hidden",onChange:v=>{var Y;let q=(Y=v.target.files)==null?void 0:Y[0];q&&(s(q),H(!1))}})]}):(0,t.jsxs)("div",{className:"space-y-4",children:[(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)("input",{type:"text",placeholder:"Paste S3 or public URL",value:tt,onChange:v=>st(v.target.value),className:"w-full bg-slate-50 border border-slate-200 rounded-2xl px-5 py-4 focus:outline-none focus:ring-4 focus:ring-blue-500/10 focus:border-blue-500 text-sm placeholder:text-slate-400 text-black"})}),(0,t.jsx)("button",{onClick:()=>{tt.trim()&&(s(tt.trim()),H(!1))},disabled:!tt.trim(),className:"w-full bg-blue-600 hover:bg-blue-700 disabled:bg-slate-300 text-white font-black py-4 rounded-2xl transition-all shadow-lg shadow-blue-500/20",children:"LOAD PRESENTATION"}),(0,t.jsx)("p",{className:"text-[10px] text-slate-400 text-center uppercase tracking-widest font-black",children:"Supports S3, Dropbox, and public URLS"})]})]})]})]})};var et=require("lucide-react"),$=require("@dnd-kit/core"),K=require("@dnd-kit/sortable"),Ft=require("@dnd-kit/utilities");var P=require("react/jsx-runtime"),fe=({slide:g,index:a,isActive:n,onSelect:p,onDelete:b,onDuplicate:u,showDelete:S,uiScale:z})=>{let{attributes:L,listeners:o,setNodeRef:x,transform:i,transition:w,isDragging:y}=(0,K.useSortable)({id:g.id}),e={transform:Ft.CSS.Transform.toString(i),transition:w,zIndex:y?2:1,opacity:y?.5:1};return(0,P.jsxs)("div",{ref:x,style:e,onClick:p,className:D("cursor-pointer border-[1.5px] rounded-2xl p-2 transition-all duration-300 group relative select-none",n?"border-[#B7472A] bg-white":"border-transparent hover:border-slate-200 bg-white/50 hover:bg-white"),children:[(0,P.jsxs)("div",{className:"text-[10px] font-bold text-slate-400 mb-1 flex items-center justify-between",children:[(0,P.jsxs)("div",{className:"flex items-center gap-1",children:[(0,P.jsx)("div",A(k(k({},L),o),{className:"cursor-grab active:cursor-grabbing p-0.5 hover:bg-slate-100 rounded text-slate-300 hover:text-slate-500",children:(0,P.jsx)(et.GripVertical,{size:10})})),(0,P.jsxs)("span",{children:["SLIDE ",a+1]})]}),(0,P.jsxs)("div",{className:"flex items-center gap-1",children:[n&&(0,P.jsx)("span",{className:"h-1.5 w-1.5 rounded-full bg-[#B7472A]"}),(0,P.jsxs)("div",{className:"flex items-center opacity-0 group-hover:opacity-100 transition-opacity",children:[(0,P.jsx)("button",{onClick:r=>{r.stopPropagation(),u()},className:"p-1 hover:bg-blue-50 text-slate-400 hover:text-blue-500 rounded transition-all",title:"Duplicate Slide",children:(0,P.jsx)(et.Copy,{size:12})}),S&&(0,P.jsx)("button",{onClick:r=>{r.stopPropagation(),b()},className:"p-1 hover:bg-red-50 text-red-400 hover:text-red-500 rounded transition-all",title:"Delete Slide",children:(0,P.jsx)(et.Trash2,{size:12})})]})]})]}),(0,P.jsx)("div",{className:"aspect-video bg-white rounded-xl flex items-center justify-center border border-slate-200 overflow-hidden relative group-hover:shadow-sm transition-shadow",children:(0,P.jsx)("div",{className:"origin-center pointer-events-none select-none shrink-0",style:{width:"1200px",height:"675px",transform:`scale(${180*z/1200})`,backgroundColor:"#ffffff"},children:g.elements.sort((r,s)=>(r.zIndex||0)-(s.zIndex||0)).map(r=>{var c;let s={position:"absolute",left:r.x,top:r.y,width:r.width,height:r.height,opacity:(c=r.opacity)!=null?c:1};return r.type==="text"?(0,P.jsx)("div",{style:A(k({},s),{fontSize:r.fontSize,fontFamily:r.fontFamily,color:r.color,textAlign:r.textAlign||"left",fontWeight:r.isBold?"bold":"normal",fontStyle:r.isItalic?"italic":"normal",lineHeight:1.2,overflow:"hidden",wordBreak:"break-word",whiteSpace:"pre-wrap"}),children:r.content},r.id):r.type==="shape"?(0,P.jsx)("div",{style:A(k({},s),{backgroundColor:r.fill,borderRadius:r.shapeType==="ellipse"?"50%":"0"})},r.id):r.type==="image"?(0,P.jsx)("img",{src:r.src,alt:"",style:A(k({},s),{objectFit:"contain"})},r.id):null})})})]})},Rt=({slides:g,currentSlideIndex:a,onSelectSlide:n,onDeleteSlide:p,onDuplicateSlide:b,onReorderSlides:u,uiScale:S})=>{let z=(0,$.useSensors)((0,$.useSensor)($.PointerSensor,{activationConstraint:{distance:5}}),(0,$.useSensor)($.KeyboardSensor,{coordinateGetter:K.sortableKeyboardCoordinates})),L=o=>{let{active:x,over:i}=o;if(x.id!==(i==null?void 0:i.id)){let w=g.findIndex(e=>e.id===x.id),y=g.findIndex(e=>e.id===(i==null?void 0:i.id));u(w,y)}};return(0,P.jsx)("div",{className:"bg-white border-r border-slate-100 overflow-y-auto p-4 flex flex-col gap-4",style:{width:`${256*S}px`},children:(0,P.jsx)($.DndContext,{sensors:z,collisionDetection:$.closestCenter,onDragEnd:L,children:(0,P.jsx)(K.SortableContext,{items:g.map(o=>o.id),strategy:K.verticalListSortingStrategy,children:g.map((o,x)=>(0,P.jsx)(fe,{slide:o,index:x,isActive:x===a,onSelect:()=>n(x),onDelete:()=>p(x),onDuplicate:()=>b(x),showDelete:g.length>1,uiScale:S},o.id))})})})};var V=require("react"),W=mt(require("fabric"));var St=require("react/jsx-runtime"),vt=({slide:g,onElementUpdate:a,onSelect:n,uiScale:p})=>{let b=(0,V.useRef)(null),u=(0,V.useRef)(null),S=(0,V.useRef)(!1),z=(0,V.useRef)(a),L=(0,V.useRef)(n);return(0,V.useEffect)(()=>{z.current=a,L.current=n},[a,n]),(0,V.useEffect)(()=>{if(b.current&&!u.current){u.current=new W.Canvas(b.current,{width:1200,height:675,backgroundColor:"#ffffff"});let o=u.current,x=e=>{e.left<0&&e.set("left",0),e.top<0&&e.set("top",0);let r=e.getBoundingRect();r.left+r.width>(o.width||1200)&&e.set("left",(o.width||1200)-r.width),r.top+r.height>(o.height||675)&&e.set("top",(o.height||675)-r.height)};o.on("object:moving",e=>x(e.target)),o.on("object:scaling",e=>x(e.target));let i=e=>{var c;if(S.current)return;let r=e.target,s=(c=r.get("data"))==null?void 0:c.id;r&&s&&z.current(s,k({x:r.left,y:r.top,width:r.getScaledWidth(),height:r.getScaledHeight()},r.isType("textbox")?{content:r.text,textAlign:r.textAlign,fontSize:r.fontSize,fontFamily:r.fontFamily,color:r.fill}:{fill:r.fill}))};o.on("object:modified",i),o.on("text:changed",i);let w=e=>{var s,c;let r=((s=e.selected)==null?void 0:s[0])||e.target;if(r){let f=(c=r.get("data"))==null?void 0:c.id;L.current(f)}};o.on("selection:created",w),o.on("selection:updated",w),o.on("selection:cleared",()=>L.current(null));let y=e=>{let r=o.getActiveObject();if(!r||r.isType("textbox")&&r.isEditing)return;let s=e.shiftKey?10:1,c=!1;switch(e.key){case"ArrowLeft":r.set("left",r.left-s),c=!0;break;case"ArrowRight":r.set("left",r.left+s),c=!0;break;case"ArrowUp":r.set("top",r.top-s),c=!0;break;case"ArrowDown":r.set("top",r.top+s),c=!0;break}c&&(x(r),o.requestRenderAll(),i({target:r}))};window.addEventListener("keydown",y),o._keyboardListener=y}return()=>{if(u.current){let o=u.current._keyboardListener;o&&window.removeEventListener("keydown",o),u.current.dispose(),u.current=null}}},[]),(0,V.useEffect)(()=>{if(!u.current)return;let o=u.current;(async()=>{S.current=!0;let i=o.getObjects(),w=new Set(g.elements.map(e=>e.id));i.forEach(e=>{var s;let r=(s=e.get("data"))==null?void 0:s.id;r&&!w.has(r)&&o.remove(e)});let y=[...g.elements].sort((e,r)=>(e.zIndex||0)-(r.zIndex||0));for(let e of y){let r=i.find(s=>{var c;return((c=s.get("data"))==null?void 0:c.id)===e.id});if(r){if(r===o.getActiveObject()&&r.isType("textbox")&&r.isEditing)continue;let s={left:e.x,top:e.y,opacity:e.opacity!==void 0?e.opacity:1,zIndex:e.zIndex};e.type==="text"&&r.isType("textbox")?(s.text=e.content||" ",s.fontSize=e.fontSize||22,s.fill=e.color||"#000000",s.textAlign=e.textAlign||"left",s.fontWeight=e.isBold?"bold":"normal",s.fontStyle=e.isItalic?"italic":"normal",s.fontFamily=e.fontFamily||"Arial",s.width=Math.max(e.width||50,10)):e.type==="shape"?(s.fill=e.fill||"#cccccc",s.scaleX=(e.width||50)/(r.width||1),s.scaleY=(e.height||50)/(r.height||1)):e.type==="image"&&(s.scaleX=(e.width||100)/(r.width||1),s.scaleY=(e.height||100)/(r.height||1)),r.set(s)}else{let s=null,c={left:e.x,top:e.y,data:{id:e.id},originX:"left",originY:"top",opacity:e.opacity!==void 0?e.opacity:1};if(e.type==="text")s=new W.Textbox(e.content||" ",A(k({},c),{width:Math.max(e.width||200,10),fontSize:e.fontSize||22,fill:e.color||"#000000",fontFamily:e.fontFamily||"Inter, Arial, sans-serif",textAlign:e.textAlign||"left",fontWeight:e.isBold?"bold":"normal",fontStyle:e.isItalic?"italic":"normal",splitByGrapheme:!1}));else if(e.type==="shape"){let f=e.fill||"#3b82f6";e.shapeType==="ellipse"?s=new W.Circle(A(k({},c),{radius:(e.width||100)/2,scaleY:(e.height||100)/(e.width||100),fill:f})):s=new W.Rect(A(k({},c),{width:e.width||100,height:e.height||100,fill:f}))}else if(e.type==="image")try{let f=await W.FabricImage.fromURL(e.src);f.set(A(k({},c),{scaleX:(e.width||100)/(f.width||1),scaleY:(e.height||100)/(f.height||1)})),s=f}catch(f){console.error(f)}s&&o.add(s)}}o.renderAll(),S.current=!1})()},[g]),(0,St.jsx)("div",{className:"border border-slate-200 overflow-hidden bg-white shadow-lg transition-transform duration-300",style:{transform:`scale(${p*.8})`,transformOrigin:"center center"},children:(0,St.jsx)("canvas",{ref:b})})};var jt=mt(require("pptxgenjs"));var pt=class{async export(a){var o,x;let n=new jt.default,p=((o=a.layout)==null?void 0:o.width)||12192e3,b=((x=a.layout)==null?void 0:x.height)||6858e3,u=1200,S=675,z=i=>i/u*(p/914400),L=i=>i/S*(b/914400);a.slides.forEach(i=>{let w=n.addSlide();[...i.elements].sort((e,r)=>e.zIndex-r.zIndex).forEach(e=>{var c,f;let r=e.opacity!==void 0?(1-e.opacity)*100:0,s={x:z(e.x),y:L(e.y),w:z(e.width),h:L(e.height)};if(e.type==="text")w.addText(e.content,A(k({},s),{fontSize:(e.fontSize||18)/2,color:((c=e.color)==null?void 0:c.replace("#",""))||"000000",fontFace:e.fontFamily||"Arial"}));else if(e.type==="image")w.addImage(A(k({},s),{path:e.src,transparency:r}));else if(e.type==="shape"){let B=e.shapeType==="ellipse"?n.ShapeType.ellipse:n.ShapeType.rect;w.addShape(B,A(k({},s),{fill:{color:((f=e.fill)==null?void 0:f.replace("#",""))||"CCCCCC",transparency:r>0?Math.min(r+10,100):0}}))}})}),await n.writeFile({fileName:"presentation.pptx"})}};var $t=mt(require("jszip")),gt=class{constructor(){this.slideWidth=12192e3;this.slideHeight=6858e3;this.CANVAS_WIDTH=1200;this.CANVAS_HEIGHT=675}async parse(a){var x,i;let n=a;if(typeof a=="string"){let w=await fetch(a);if(!w.ok){let y=w.status,e=w.statusText,r="";try{let s=await w.json();r=s.details||s.error||""}catch(s){}throw new Error(`Failed to fetch PPTX from ${a}: ${y} ${e} ${r?`(${r})`:""}`)}n=await w.arrayBuffer()}let p=await $t.default.loadAsync(n),b=await((x=p.file("ppt/presentation.xml"))==null?void 0:x.async("string"));if(!b)throw new Error("Invalid PPTX");let S=new DOMParser().parseFromString(b,"text/xml"),z=this.findFirstByLocalName(S,"sldSz");z&&(this.slideWidth=parseInt(this.getAttr(z,"cx")||"12192000"),this.slideHeight=parseInt(this.getAttr(z,"cy")||"6858000"));let L=Array.from(S.getElementsByTagNameNS("*","sldId")),o=[];for(let w=0;w<L.length;w++){let y=w+1,e=`ppt/slides/slide${y}.xml`,r=await((i=p.file(e))==null?void 0:i.async("string"));if(r){let s=await this.parseSlide(r,y,p);o.push(s)}}return{slides:o,layout:{width:this.slideWidth,height:this.slideHeight}}}getAttr(a,n){return a.getAttribute(n)||a.getAttribute(`a:${n}`)||a.getAttribute(`p:${n}`)||a.getAttribute(`r:${n}`)}findFirstByLocalName(a,n){let p=a.getElementsByTagNameNS("*",n);return p.length>0?p[0]:null}findAllByLocalName(a,n){return Array.from(a.getElementsByTagNameNS("*",n))}scaleX(a){return a/this.slideWidth*this.CANVAS_WIDTH}scaleY(a){return a/this.slideHeight*this.CANVAS_HEIGHT}parseColor(a){let n=this.findFirstByLocalName(a,"srgbClr");if(n){let b=`#${this.getAttr(n,"val")}`,u=this.findFirstByLocalName(n,"alpha"),S=u?parseInt(this.getAttr(u,"val")||"100000")/1e5:1;return{color:b,opacity:S}}let p=this.findFirstByLocalName(a,"schemeClr");if(p){let b=this.findFirstByLocalName(p,"alpha");return{color:"#000000",opacity:b?parseInt(this.getAttr(b,"val")||"100000")/1e5:1}}return{color:"#000000",opacity:1}}async resolveImage(a,n,p){var o,x;let b=await((o=p.file(`ppt/slides/_rels/slide${n}.xml.rels`))==null?void 0:o.async("string"));if(!b)return null;let S=new DOMParser().parseFromString(b,"text/xml"),z=Array.from(S.getElementsByTagName("Relationship")).find(i=>i.getAttribute("Id")===a),L=z==null?void 0:z.getAttribute("Target");if(L){let i=(L.startsWith("../")?`ppt/${L.substring(3)}`:`ppt/slides/${L}`).replace("ppt/slides/../","ppt/");return await((x=p.file(i))==null?void 0:x.async("blob"))||null}return null}async parseSlide(a,n,p){let u=new DOMParser().parseFromString(a,"text/xml"),S=[],z=0,L=this.findFirstByLocalName(u,"bg");if(L){let i=this.findFirstByLocalName(L,"blip"),w=(i==null?void 0:i.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","embed"))||(i==null?void 0:i.getAttribute("r:embed"));if(w){let y=await this.resolveImage(w,n,p);y&&S.push({id:`bg-${n}`,type:"image",src:URL.createObjectURL(y),x:0,y:0,width:this.CANVAS_WIDTH,height:this.CANVAS_HEIGHT,zIndex:z++,opacity:1})}}let o=this.findFirstByLocalName(u,"spTree");if(!o)return{id:`slide-${n}`,elements:S};let x=Array.from(o.children);for(let i of x){let w=i.localName;if(w==="sp"){let y=this.findFirstByLocalName(i,"txBody"),e=this.findFirstByLocalName(i,"xfrm"),r=e?this.findFirstByLocalName(e,"off"):null,s=e?this.findFirstByLocalName(e,"ext"):null;if(y&&r&&s){let f=this.findAllByLocalName(y,"p"),B="",F=18,ot="#000000",_=1,E=!1;for(let j of f){let X=this.findFirstByLocalName(j,"pPr"),it=X?this.findFirstByLocalName(X,"buNone"):null;X&&!it&&(this.findFirstByLocalName(X,"buChar")||this.findFirstByLocalName(X,"buAutoNum"))&&(E=!0,B+="\u2022 ");let ht=this.findAllByLocalName(j,"r");for(let nt of ht){let Q=this.findFirstByLocalName(nt,"t");Q&&(B+=Q.textContent);let H=this.findFirstByLocalName(nt,"rPr");if(H){let O=this.getAttr(H,"sz");O&&(F=parseInt(O)/100*2);let Z=this.parseColor(H);ot=Z.color,_=Z.opacity}}B+=`
|
|
4
|
+
`}if(B.trim()){S.push({id:`el-${n}-${Date.now()}-${z}`,type:"text",content:B.trim(),x:this.scaleX(parseInt(this.getAttr(r,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(r,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(s,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(s,"cy")||"0")),fontSize:F,color:ot,fontFamily:"Arial",zIndex:z++,isBulleted:E,opacity:_});continue}}let c=this.findFirstByLocalName(i,"prstGeom");if(c&&r&&s){let f=this.getAttr(c,"prst"),B=this.findFirstByLocalName(i,"spPr"),F=B?this.parseColor(B):{color:"#cccccc",opacity:1};S.push({id:`el-${n}-${Date.now()}-${z}`,type:"shape",shapeType:f==="ellipse"||f==="circle"?"ellipse":"rect",fill:F.color,opacity:F.opacity,x:this.scaleX(parseInt(this.getAttr(r,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(r,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(s,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(s,"cy")||"0")),zIndex:z++})}}if(w==="pic"){let y=this.findFirstByLocalName(i,"blip"),e=(y==null?void 0:y.getAttributeNS("http://schemas.openxmlformats.org/officeDocument/2006/relationships","embed"))||(y==null?void 0:y.getAttribute("r:embed")),r=this.findFirstByLocalName(i,"xfrm"),s=r?this.findFirstByLocalName(r,"off"):null,c=r?this.findFirstByLocalName(r,"ext"):null;if(e&&s&&c){let f=await this.resolveImage(e,n,p);f&&S.push({id:`el-${n}-${Date.now()}-${z}`,type:"image",src:URL.createObjectURL(f),x:this.scaleX(parseInt(this.getAttr(s,"x")||"0")),y:this.scaleY(parseInt(this.getAttr(s,"y")||"0")),width:this.scaleX(parseInt(this.getAttr(c,"cx")||"0")),height:this.scaleY(parseInt(this.getAttr(c,"cy")||"0")),zIndex:z++,opacity:1})}}}return{id:`slide-${n}`,elements:S}}};var rt=require("react"),at=require("lucide-react");var M=require("react/jsx-runtime"),Ht=({presentation:g,initialSlideIndex:a,onClose:n})=>{let[p,b]=(0,rt.useState)(a),u=g.slides[p],S=()=>{p>0&&b(p-1)},z=()=>{p<g.slides.length-1&&b(p+1)};(0,rt.useEffect)(()=>{let x=i=>{i.key==="ArrowRight"||i.key===" "||i.key==="PageDown"?z():i.key==="ArrowLeft"||i.key==="Backspace"||i.key==="PageUp"?S():i.key==="Escape"&&n()};return window.addEventListener("keydown",x),()=>window.removeEventListener("keydown",x)},[p]);let[L,o]=(0,rt.useState)(1);return(0,rt.useEffect)(()=>{let x=()=>{let w=window.innerWidth-40,y=window.innerHeight-40,e=1200,r=675,s=w/e,c=y/r,f=Math.min(s,c);o(f)};return x(),window.addEventListener("resize",x),()=>window.removeEventListener("resize",x)},[]),(0,M.jsxs)("div",{className:"fixed inset-0 z-[99999] bg-[#0A0A0A] flex flex-col items-center justify-center overflow-hidden",children:[(0,M.jsxs)("div",{className:"absolute top-0 left-0 right-0 p-6 flex justify-between items-center opacity-0 hover:opacity-100 transition-opacity bg-gradient-to-b from-black/60 to-transparent z-[100] pointer-events-none",children:[(0,M.jsxs)("div",{className:"text-white/80 font-bold ml-4 pointer-events-auto",children:["Slide ",p+1," of ",g.slides.length]}),(0,M.jsx)("button",{onClick:n,className:"p-3 bg-white/10 hover:bg-white/20 text-white rounded-full transition-all pointer-events-auto",children:(0,M.jsx)(at.X,{size:24})})]}),(0,M.jsx)("div",{className:"w-full h-full flex items-center justify-center",children:(0,M.jsx)("div",{className:"relative shadow-2xl shadow-black/80 bg-white",style:{width:"1200px",height:"675px",transform:`scale(${L})`,transformOrigin:"center center"},children:(0,M.jsx)(vt,{slide:u,onElementUpdate:()=>{},onSelect:()=>{},uiScale:.75})})}),(0,M.jsxs)("div",{className:"absolute bottom-10 left-1/2 -translate-x-1/2 flex items-center gap-6 opacity-0 hover:opacity-100 transition-opacity bg-black/40 backdrop-blur-md px-6 py-3 rounded-full border border-white/10 pointer-events-auto",children:[(0,M.jsx)("button",{disabled:p===0,onClick:S,className:"p-2 text-white/50 hover:text-white disabled:opacity-20 transition-colors",children:(0,M.jsx)(at.ChevronLeft,{size:32})}),(0,M.jsx)("div",{className:"h-6 w-[1px] bg-white/10"}),(0,M.jsx)("button",{disabled:p===g.slides.length-1,onClick:z,className:"p-2 text-white/50 hover:text-white disabled:opacity-20 transition-colors",children:(0,M.jsx)(at.ChevronRight,{size:32})})]})]})};var Ut=require("@google/generative-ai");var N=require("react/jsx-runtime"),me=({initialPresentation:g,url:a,appName:n="SlideCanvas",onChange:p,geminiApiKey:b,width:u,height:S,appBgColor:z="#B7472A",showHomeOnEmpty:L=!1,initialSource:o,onSourceChange:x})=>{let[i,w]=(0,I.useState)(g||{slides:[{id:"slide-1",elements:[]}],layout:{width:12192e3,height:6858e3}}),[y,e]=(0,I.useState)([]),[r,s]=(0,I.useState)([]),[c,f]=(0,I.useState)(0),[B,F]=(0,I.useState)(null),[ot,_]=(0,I.useState)(!1),[E,j]=(0,I.useState)(null),[X,it]=(0,I.useState)(!1),[ht,nt]=(0,I.useState)(o||(a?"url":null)),[Q,H]=(0,I.useState)(L&&!g&&!a&&!o),[O,Z]=(0,I.useState)("");(0,I.useEffect)(()=>{a&&ut(a)},[a]);let[tt,st]=(0,I.useState)(!1),[T,bt]=(0,I.useState)(null),lt=(0,I.useMemo)(()=>{let l=typeof u=="number"?u:parseInt(String(u));return isNaN(l)?1:Math.min(Math.max(l/1600,.7),1)},[u]),v=i.slides[c],q=(0,I.useMemo)(()=>v.elements.find(l=>l.id===B)||null,[v,B]),Y=(0,I.useCallback)(l=>{e(d=>[...d.slice(-19),i]),s([]),w(l),p==null||p(l)},[p,i]),zt=()=>{if(y.length===0)return;let l=y[y.length-1];s(d=>[...d,i]),e(d=>d.slice(0,-1)),w(l)},wt=()=>{if(r.length===0)return;let l=r[r.length-1];e(d=>[...d,i]),s(d=>d.slice(0,-1)),w(l)},J=(0,I.useCallback)(l=>{w(d=>{let h=[...d.slides];h[c]=k(k({},h[c]),l);let C=A(k({},d),{slides:h});return e(R=>[...R.slice(-19),d]),s([]),p==null||p(C),C})},[c,p]),xt=(0,I.useCallback)((l,d)=>{w(h=>{let C=h.slides[c],R=C.elements.map(ct=>ct.id===l?k(k({},ct),d):ct),G=[...h.slides];G[c]=A(k({},C),{elements:R});let ft=A(k({},h),{slides:G});return p==null||p(ft),ft})},[c,p]),Et=l=>{if(!B)return;if(v.elements.find(h=>h.id===B)){xt(B,l);let h=i.slides[c],C=h.elements.map(G=>G.id===B?k(k({},G),l):G),R=[...i.slides];R[c]=A(k({},h),{elements:C}),Y(A(k({},i),{slides:R}))}},yt=(0,I.useCallback)(()=>{if(!B)return;let d=i.slides[c].elements.filter(h=>h.id!==B);J({elements:d}),F(null)},[B,c,i,J]),Ot=()=>{let l={id:`text-${Date.now()}`,type:"text",content:"New Text",x:100,y:100,width:400,height:100,fontSize:48,fontFamily:"Arial",color:"#000000",zIndex:v.elements.length};J({elements:[...v.elements,l]})},Vt=l=>{let d=URL.createObjectURL(l),h=`img-${Date.now()}`,C={id:h,type:"image",src:d,x:100,y:100,width:400,height:250,zIndex:v.elements.length};J({elements:[...v.elements,C]}),F(h)},Wt=l=>{let d={id:`shape-${Date.now()}`,type:"shape",shapeType:l,fill:"#3b82f6",x:200,y:200,width:200,height:200,zIndex:v.elements.length};J({elements:[...v.elements,d]})},Xt=()=>{let l={id:`slide-${Date.now()}`,elements:[]};Y(A(k({},i),{slides:[...i.slides,l]})),f(i.slides.length)},Yt=l=>{if(i.slides.length<=1)return;let d=i.slides.filter((h,C)=>C!==l);Y(A(k({},i),{slides:d})),l<=c&&f(Math.max(0,c-1))},Gt=l=>{let d=i.slides[l],h=A(k({},d),{id:`slide-${Date.now()}`,elements:d.elements.map(R=>A(k({},R),{id:`${R.type}-${Date.now()}-${Math.random().toString(36).substr(2,9)}`}))}),C=[...i.slides];C.splice(l+1,0,h),Y(A(k({},i),{slides:C})),f(l+1)},Kt=(l,d)=>{if(l===d)return;let h=[...i.slides],[C]=h.splice(l,1);h.splice(d,0,C),Y(A(k({},i),{slides:h})),c===l?f(d):c>l&&c<=d?f(c-1):c<l&&c>=d&&f(c+1)},_t=l=>{let d=[],h=Date.now();l==="title"?d=[{id:`text-title-${h}`,type:"text",content:"Presentation Title",x:100,y:200,width:1e3,height:150,fontSize:80,fontFamily:"Inter",color:"#000000",textAlign:"center",isBold:!0,zIndex:0},{id:`text-sub-${h}`,type:"text",content:"Subtitle goes here",x:200,y:380,width:800,height:80,fontSize:36,fontFamily:"Inter",color:"#64748b",textAlign:"center",zIndex:1}]:l==="content"?d=[{id:`text-title-${h}`,type:"text",content:"Slide Title",x:60,y:40,width:800,height:80,fontSize:48,fontFamily:"Inter",color:"#000000",isBold:!0,zIndex:0},{id:`text-body-${h}`,type:"text",content:`\u2022 Add your points here
|
|
4
5
|
\u2022 Press Enter for new line
|
|
5
|
-
\u2022 Use the toolbar to format`,x:60,y:150,width:1080,height:480,fontSize:28,fontFamily:"Inter",color:"#334155",zIndex:1,isBulleted:!0}]:
|
|
6
|
+
\u2022 Use the toolbar to format`,x:60,y:150,width:1080,height:480,fontSize:28,fontFamily:"Inter",color:"#334155",zIndex:1,isBulleted:!0}]:l==="split"&&(d=[{id:`text-title-${h}`,type:"text",content:"Comparison Layout",x:60,y:40,width:1080,height:80,fontSize:48,fontFamily:"Inter",color:"#000000",isBold:!0,textAlign:"center",zIndex:0},{id:`text-left-${h}`,type:"text",content:"Left column content goes here.",x:60,y:180,width:520,height:400,fontSize:24,fontFamily:"Inter",color:"#334155",zIndex:1},{id:`text-right-${h}`,type:"text",content:"Right column content goes here.",x:620,y:180,width:520,height:400,fontSize:24,fontFamily:"Inter",color:"#334155",zIndex:2}]),J({elements:d})},Ct=async(l,d)=>{let C=i.slides[c].elements.find(R=>R.id===l);if(!(!C||C.type!=="text")){st(!0),j(null),bt({id:l,action:d});try{if(!b){j("Gemini API key is missing. Please provide it via the 'geminiApiKey' prop."),st(!1);return}let G=new Ut.GoogleGenerativeAI(b).getGenerativeModel({model:"gemini-flash-latest",systemInstruction:`You are a professional presentation assistant. Your task is to transform slide text according to specific user requests (shorten, reframe, or lengthen).
|
|
6
7
|
|
|
7
8
|
CRITICAL RULES:
|
|
8
9
|
1. Return ONLY the transformed text.
|
|
@@ -10,9 +11,9 @@ CRITICAL RULES:
|
|
|
10
11
|
3. Do NOT use markdown formatting (like bolding or headers) unless specifically needed for bullet points.
|
|
11
12
|
4. If the input text is a title/headline, the output should be a professional title/headline.
|
|
12
13
|
5. If the input text is a bulleted list, the output MUST be a bulleted list using the same bullet style (e.g., '\u2022').
|
|
13
|
-
6. Maintain the professional tone of the original presentation.`}),
|
|
14
|
-
Text Role: ${
|
|
15
|
-
Original Text: "${
|
|
14
|
+
6. Maintain the professional tone of the original presentation.`}),ft=C.fontSize>32?"Title/Headline":"Body Text/List",ct=`Action: ${d.toUpperCase()}
|
|
15
|
+
Text Role: ${ft}
|
|
16
|
+
Original Text: "${C.content}"
|
|
16
17
|
|
|
17
|
-
Transformed Text:`,
|
|
18
|
+
Transformed Text:`,te=await(await G.generateContent(ct)).response;j(te.text().trim())}catch(R){console.error("Gemini AI Error:",R),j("Error generating response. Please check your API key or connection.")}finally{st(!1)}}},Zt=l=>{if(!E||!T)return;if(l==="regenerate"){Ct(T.id,T.action);return}let d=i.slides[c],h=d.elements.find(C=>C.id===T.id);if(!(!h||h.type!=="text")){if(l==="replace")xt(T.id,{content:E});else if(l==="addBelow"){let C=A(k({},h),{id:`text-ai-${Date.now()}`,content:E,y:h.y+h.height+20,zIndex:d.elements.length});J({elements:[...d.elements,C]})}j(null),bt(null)}},qt=async()=>{await new pt().export(i)},Jt=()=>{_(!0);let l=document.documentElement;l.requestFullscreen&&l.requestFullscreen()},Qt=()=>{_(!1),document.fullscreenElement&&document.exitFullscreen()};(0,I.useEffect)(()=>{let l=()=>{document.fullscreenElement||_(!1)};return document.addEventListener("fullscreenchange",l),()=>document.removeEventListener("fullscreenchange",l)},[]),(0,I.useEffect)(()=>{let l=d=>{if(d.key==="Delete"||d.key==="Backspace"){let h=document.activeElement;if((h==null?void 0:h.tagName)==="INPUT"||(h==null?void 0:h.tagName)==="TEXTAREA"||h!=null&&h.isContentEditable)return;yt()}(d.ctrlKey||d.metaKey)&&(d.key==="z"&&(d.preventDefault(),d.shiftKey?wt():zt()),d.key==="y"&&(d.preventDefault(),wt()))};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[yt,zt,wt]);let kt=(l,d)=>{nt(l),x==null||x(l,d)},At=()=>{w({slides:[{id:`slide-${Date.now()}`,elements:[]}],layout:{width:12192e3,height:6858e3}}),f(0),F(null),kt("scratch")},ut=async l=>{it(!0);try{let d=new gt,h=l;typeof l=="string"?(h=`/api/proxy?url=${encodeURIComponent(l.trim())}`,kt("url",l.trim())):kt("uploaded");let C=await d.parse(h);w(C),e([]),s([]),f(0),F(null)}catch(d){console.error("Failed to load PPTX",d),alert("Failed to load presentation. Please ensure it is a valid .pptx.")}finally{it(!1)}};return!u||!S?(0,N.jsx)("div",{className:"flex items-center justify-center bg-red-50 text-red-600 p-8 rounded-xl border-2 border-red-200 font-bold",children:"Error: width and height props are compulsory for PptEditor."}):(0,N.jsxs)("div",{className:"flex flex-col bg-white relative",style:{width:typeof u=="number"?`${u}px`:u,height:typeof S=="number"?`${S}px`:S,fontSize:`${16*lt}px`},children:[Q&&(0,N.jsx)("div",{className:"absolute inset-0 z-[2000] bg-white flex flex-col items-center justify-center p-6 md:p-12 overflow-y-auto",children:(0,N.jsxs)("div",{className:"max-w-2xl w-full text-center space-y-6 md:space-y-8 animate-in fade-in zoom-in-95 duration-500 my-auto",children:[(0,N.jsxs)("div",{className:"space-y-2",children:[(0,N.jsx)("h2",{className:"text-4xl font-black tracking-tight text-slate-800",children:n}),(0,N.jsx)("p",{className:"text-slate-500 font-medium",children:"Create stunning presentations in seconds."})]}),(0,N.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,N.jsxs)("button",{onClick:()=>{At(),H(!1)},className:"flex flex-col items-center justify-center gap-3 p-8 border-2 border-slate-100 rounded-3xl hover:border-slate-300 hover:bg-slate-50 transition-all group",children:[(0,N.jsx)("div",{className:"p-3 bg-slate-100 rounded-xl group-hover:bg-blue-50 transition-colors",children:(0,N.jsx)("svg",{className:"w-6 h-6 text-blue-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,N.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 4v16m8-8H4"})})}),(0,N.jsx)("span",{className:"text-xs font-black uppercase tracking-widest text-slate-600",children:"Start New Deck"})]}),(0,N.jsxs)("label",{className:"flex flex-col items-center justify-center gap-3 p-8 border-2 border-slate-100 rounded-3xl hover:border-slate-300 hover:bg-slate-50 transition-all group cursor-pointer",children:[(0,N.jsx)("div",{className:"p-3 bg-slate-100 rounded-xl group-hover:bg-emerald-50 transition-colors",children:(0,N.jsx)("svg",{className:"w-6 h-6 text-emerald-600",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,N.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 16v1a2 2 0 002 2h12a2 2 0 002-2v-1m-4-8l-4-4m0 0L8 8m4-4v12"})})}),(0,N.jsx)("span",{className:"text-xs font-black uppercase tracking-widest text-slate-600",children:"Upload PPTX"}),(0,N.jsx)("input",{type:"file",accept:".pptx",className:"hidden",onChange:l=>{var h;let d=(h=l.target.files)==null?void 0:h[0];d&&(ut(d),H(!1))}})]})]}),(0,N.jsxs)("div",{className:"space-y-4 pt-4 border-t border-slate-100",children:[(0,N.jsxs)("div",{className:"flex gap-2",children:[(0,N.jsxs)("div",{className:"flex-1 relative",children:[(0,N.jsx)("svg",{className:"absolute left-4 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400",fill:"none",viewBox:"0 0 24 24",stroke:"currentColor",children:(0,N.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9h18"})}),(0,N.jsx)("input",{type:"text",placeholder:"Paste presentation URL...",value:O,onChange:l=>Z(l.target.value),className:"text-black w-full bg-slate-50 border border-slate-200 rounded-2xl pl-11 pr-5 py-4 focus:outline-none focus:border-slate-400 focus:ring-4 focus:ring-slate-400/5 text-sm transition-all"})]}),(0,N.jsx)("button",{onClick:()=>{O.trim()&&(ut(O.trim()),H(!1))},disabled:!O.trim()||X,style:{cursor:"pointer"},className:"bg-slate-900 hover:bg-black disabled:bg-slate-200 disabled:text-slate-400 text-white font-bold px-8 rounded-2xl transition-all shadow-sm text-sm",children:"Load"})]}),(0,N.jsx)("p",{className:"text-[10px] text-slate-400 font-bold uppercase tracking-widest",children:"Supports S3, public links, and versioned assets"})]})]})}),ot&&(0,N.jsx)(Ht,{presentation:i,initialSlideIndex:c,onClose:Qt}),(0,N.jsx)(Dt,{onAddText:Ot,onAddImage:Vt,onAddShape:Wt,onAddSlide:Xt,onExport:qt,onFormatText:Et,onDeleteElement:yt,onApplyLayout:_t,onPlay:Jt,onAiAction:Ct,onAiResponseAction:Zt,onNewPresentation:At,onLoadPresentation:ut,aiResponse:E,isAiLoading:tt,selectedElement:q,appName:n,appBgColor:z,uiScale:lt,source:ht}),(0,N.jsxs)("div",{className:"flex flex-1 overflow-hidden",children:[(0,N.jsx)(Rt,{slides:i.slides,currentSlideIndex:c,onSelectSlide:f,onDeleteSlide:Yt,onDuplicateSlide:Gt,onReorderSlides:Kt,uiScale:lt}),(0,N.jsx)("div",{className:"flex-1 flex items-center justify-center p-12 overflow-auto bg-white",children:(0,N.jsx)(vt,{slide:v,onElementUpdate:xt,onSelect:F,uiScale:lt})})]})]})};0&&(module.exports={PptEditor,PptxExporter,PptxParser});
|
|
18
19
|
//# sourceMappingURL=index.js.map
|