module.exports = [
"[externals]/next/dist/compiled/next-server/app-route-turbo.runtime.dev.js [external] (next/dist/compiled/next-server/app-route-turbo.runtime.dev.js, cjs)", ((__turbopack_context__, module, exports) => {

const mod = __turbopack_context__.x("next/dist/compiled/next-server/app-route-turbo.runtime.dev.js", () => require("next/dist/compiled/next-server/app-route-turbo.runtime.dev.js"));

module.exports = mod;
}),
"[externals]/next/dist/compiled/@opentelemetry/api [external] (next/dist/compiled/@opentelemetry/api, cjs)", ((__turbopack_context__, module, exports) => {

const mod = __turbopack_context__.x("next/dist/compiled/@opentelemetry/api", () => require("next/dist/compiled/@opentelemetry/api"));

module.exports = mod;
}),
"[externals]/next/dist/compiled/next-server/app-page-turbo.runtime.dev.js [external] (next/dist/compiled/next-server/app-page-turbo.runtime.dev.js, cjs)", ((__turbopack_context__, module, exports) => {

const mod = __turbopack_context__.x("next/dist/compiled/next-server/app-page-turbo.runtime.dev.js", () => require("next/dist/compiled/next-server/app-page-turbo.runtime.dev.js"));

module.exports = mod;
}),
"[externals]/next/dist/server/app-render/work-unit-async-storage.external.js [external] (next/dist/server/app-render/work-unit-async-storage.external.js, cjs)", ((__turbopack_context__, module, exports) => {

const mod = __turbopack_context__.x("next/dist/server/app-render/work-unit-async-storage.external.js", () => require("next/dist/server/app-render/work-unit-async-storage.external.js"));

module.exports = mod;
}),
"[externals]/next/dist/server/app-render/work-async-storage.external.js [external] (next/dist/server/app-render/work-async-storage.external.js, cjs)", ((__turbopack_context__, module, exports) => {

const mod = __turbopack_context__.x("next/dist/server/app-render/work-async-storage.external.js", () => require("next/dist/server/app-render/work-async-storage.external.js"));

module.exports = mod;
}),
"[externals]/next/dist/shared/lib/no-fallback-error.external.js [external] (next/dist/shared/lib/no-fallback-error.external.js, cjs)", ((__turbopack_context__, module, exports) => {

const mod = __turbopack_context__.x("next/dist/shared/lib/no-fallback-error.external.js", () => require("next/dist/shared/lib/no-fallback-error.external.js"));

module.exports = mod;
}),
"[externals]/next/dist/server/app-render/after-task-async-storage.external.js [external] (next/dist/server/app-render/after-task-async-storage.external.js, cjs)", ((__turbopack_context__, module, exports) => {

const mod = __turbopack_context__.x("next/dist/server/app-render/after-task-async-storage.external.js", () => require("next/dist/server/app-render/after-task-async-storage.external.js"));

module.exports = mod;
}),
"[externals]/fs [external] (fs, cjs)", ((__turbopack_context__, module, exports) => {

const mod = __turbopack_context__.x("fs", () => require("fs"));

module.exports = mod;
}),
"[externals]/path [external] (path, cjs)", ((__turbopack_context__, module, exports) => {

const mod = __turbopack_context__.x("path", () => require("path"));

module.exports = mod;
}),
"[project]/src/lib/data-store.ts [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";

__turbopack_context__.s([
    "DataStore",
    ()=>DataStore,
    "companyStore",
    ()=>companyStore,
    "featureStore",
    ()=>featureStore,
    "initializeDefaultData",
    ()=>initializeDefaultData,
    "pageStore",
    ()=>pageStore,
    "productStore",
    ()=>productStore,
    "projectStore",
    ()=>projectStore,
    "sliderStore",
    ()=>sliderStore,
    "testimonialStore",
    ()=>testimonialStore
]);
var __TURBOPACK__imported__module__$5b$externals$5d2f$fs__$5b$external$5d$__$28$fs$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/fs [external] (fs, cjs)");
var __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__ = __turbopack_context__.i("[externals]/path [external] (path, cjs)");
;
;
// Data storage paths
const DATA_DIR = __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["default"].join(process.cwd(), 'data');
const UPLOADS_DIR = __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["default"].join(process.cwd(), 'public', 'uploads');
// Ensure directories exist
if ("TURBOPACK compile-time truthy", 1) {
    if (!__TURBOPACK__imported__module__$5b$externals$5d2f$fs__$5b$external$5d$__$28$fs$2c$__cjs$29$__["default"].existsSync(DATA_DIR)) {
        __TURBOPACK__imported__module__$5b$externals$5d2f$fs__$5b$external$5d$__$28$fs$2c$__cjs$29$__["default"].mkdirSync(DATA_DIR, {
            recursive: true
        });
    }
    if (!__TURBOPACK__imported__module__$5b$externals$5d2f$fs__$5b$external$5d$__$28$fs$2c$__cjs$29$__["default"].existsSync(UPLOADS_DIR)) {
        __TURBOPACK__imported__module__$5b$externals$5d2f$fs__$5b$external$5d$__$28$fs$2c$__cjs$29$__["default"].mkdirSync(UPLOADS_DIR, {
            recursive: true
        });
    }
}
class DataStore {
    filePath;
    constructor(fileName){
        this.filePath = __TURBOPACK__imported__module__$5b$externals$5d2f$path__$5b$external$5d$__$28$path$2c$__cjs$29$__["default"].join(DATA_DIR, fileName);
    }
    async readData() {
        try {
            if (!__TURBOPACK__imported__module__$5b$externals$5d2f$fs__$5b$external$5d$__$28$fs$2c$__cjs$29$__["default"].existsSync(this.filePath)) {
                return [];
            }
            const data = __TURBOPACK__imported__module__$5b$externals$5d2f$fs__$5b$external$5d$__$28$fs$2c$__cjs$29$__["default"].readFileSync(this.filePath, 'utf-8');
            return JSON.parse(data);
        } catch (error) {
            console.error('Error reading data:', error);
            return [];
        }
    }
    async writeData(data) {
        try {
            __TURBOPACK__imported__module__$5b$externals$5d2f$fs__$5b$external$5d$__$28$fs$2c$__cjs$29$__["default"].writeFileSync(this.filePath, JSON.stringify(data, null, 2));
        } catch (error) {
            console.error('Error writing data:', error);
            throw error;
        }
    }
    async getAll() {
        return this.readData();
    }
    async getById(id) {
        const data = await this.readData();
        return data.find((item)=>item.id === id) || null;
    }
    async create(item) {
        const data = await this.readData();
        const newItem = {
            ...item,
            id: Date.now().toString(),
            createdAt: new Date().toISOString(),
            updatedAt: new Date().toISOString()
        };
        data.push(newItem);
        await this.writeData(data);
        return newItem;
    }
    async update(id, updates) {
        const data = await this.readData();
        const index = data.findIndex((item)=>item.id === id);
        if (index === -1) return null;
        data[index] = {
            ...data[index],
            ...updates,
            updatedAt: new Date().toISOString()
        };
        await this.writeData(data);
        return data[index];
    }
    async delete(id) {
        const data = await this.readData();
        const filteredData = data.filter((item)=>item.id !== id);
        if (filteredData.length === data.length) return false;
        await this.writeData(filteredData);
        return true;
    }
}
const companyStore = new DataStore('company.json');
const productStore = new DataStore('products.json');
const featureStore = new DataStore('features.json');
const testimonialStore = new DataStore('testimonials.json');
const projectStore = new DataStore('projects.json');
const pageStore = new DataStore('pages.json');
const sliderStore = new DataStore('sliders.json');
async function initializeDefaultData() {
    try {
        // Check if company info exists
        const companies = await companyStore.getAll();
        if (companies.length === 0) {
            await companyStore.create({
                companyName: 'SAAM Cabins',
                tagline: 'Premium Porta Cabins & Containers in UAE',
                description: 'Leading manufacturer and supplier of high-quality porta cabins, security cabins, and containers across the United Arab Emirates.',
                phoneNumber: '+971 58 201 2073',
                whatsappNumber: '+971 58 201 2073',
                email: 'info@saamcabins.com',
                address: 'Industrial Area, Sharjah, UAE',
                workingHours: 'Sunday - Thursday: 8:00 AM - 6:00 PM'
            });
        }
        // Check if features exist
        const features = await featureStore.getAll();
        if (features.length === 0) {
            const defaultFeatures = [
                {
                    title: 'Premium Quality',
                    description: 'ISO certified manufacturing with premium materials',
                    icon: 'Award',
                    order: 1,
                    isActive: true
                },
                {
                    title: 'Fast Delivery',
                    description: 'Quick manufacturing and delivery across UAE',
                    icon: 'Zap',
                    order: 2,
                    isActive: true
                },
                {
                    title: 'Custom Solutions',
                    description: 'Tailored designs for specific requirements',
                    icon: 'Wrench',
                    order: 3,
                    isActive: true
                },
                {
                    title: 'Professional Service',
                    description: 'Expert consultation and support',
                    icon: 'Users',
                    order: 4,
                    isActive: true
                },
                {
                    title: 'Nationwide Coverage',
                    description: 'Service across all UAE emirates',
                    icon: 'Globe',
                    order: 5,
                    isActive: true
                },
                {
                    title: 'Security & Safety',
                    description: 'Enhanced security and safety compliance',
                    icon: 'Shield',
                    order: 6,
                    isActive: true
                }
            ];
            for (const feature of defaultFeatures){
                await featureStore.create(feature);
            }
        }
        // Check if products exist
        const products = await productStore.getAll();
        if (products.length === 0) {
            const defaultProducts = [
                {
                    name: 'Security Cabins',
                    slug: 'security-cabin',
                    category: 'Security',
                    shortDescription: 'Professional security cabins for monitoring and surveillance',
                    fullDescription: 'Our security cabins are designed for professional security applications with enhanced features for monitoring and surveillance.',
                    features: [
                        'Bullet-proof glass options',
                        'Climate control systems',
                        'Communication equipment',
                        'CCTV integration'
                    ],
                    specifications: [
                        {
                            name: 'Dimensions',
                            value: '8ft x 6ft x 8ft'
                        },
                        {
                            name: 'Material',
                            value: 'Steel frame with insulation'
                        },
                        {
                            name: 'Windows',
                            value: 'Bullet-proof glass'
                        },
                        {
                            name: 'Door',
                            value: 'Security door with multiple locks'
                        }
                    ],
                    applications: [
                        'Construction sites',
                        'Industrial facilities',
                        'Government buildings'
                    ],
                    images: [],
                    isActive: true,
                    order: 1
                },
                {
                    name: 'Office Cabins',
                    slug: 'office-cabin',
                    category: 'Office',
                    shortDescription: 'Modern office solutions for temporary and permanent installations',
                    fullDescription: 'Professional office cabins designed for business use with modern amenities and professional interiors.',
                    features: [
                        'Professional interiors',
                        'IT infrastructure ready',
                        'Meeting room configurations',
                        'Ergonomic design'
                    ],
                    specifications: [
                        {
                            name: 'Dimensions',
                            value: '20ft x 10ft x 9ft'
                        },
                        {
                            name: 'Material',
                            value: 'Insulated steel panels'
                        },
                        {
                            name: 'Flooring',
                            value: 'Raised floor with carpet'
                        },
                        {
                            name: 'Electrical',
                            value: 'Full electrical installation'
                        }
                    ],
                    applications: [
                        'Construction site offices',
                        'Remote work locations',
                        'Business expansion'
                    ],
                    images: [],
                    isActive: true,
                    order: 2
                }
            ];
            for (const product of defaultProducts){
                await productStore.create(product);
            }
        }
        // Check if sliders exist
        const sliders = await sliderStore.getAll();
        if (sliders.length === 0) {
            const createSlide = (slide)=>({
                    ...slide,
                    id: Date.now().toString() + Math.random().toString(36).substr(2, 9),
                    createdAt: new Date().toISOString(),
                    updatedAt: new Date().toISOString()
                });
            const defaultSliders = [
                {
                    name: 'Hero Banner Slider',
                    type: 'hero',
                    slides: [
                        createSlide({
                            title: 'Premium Porta Cabins & Containers in UAE',
                            subtitle: 'Quality & Innovation',
                            description: 'Leading manufacturer and supplier of high-quality porta cabins, security cabins, and containers across the United Arab Emirates.',
                            image: '/hero-slide-1.jpg',
                            buttonText: 'Get Quote',
                            buttonLink: '/contact',
                            buttonStyle: 'primary',
                            textPosition: 'center',
                            isActive: true,
                            order: 1
                        }),
                        createSlide({
                            title: 'Professional Security Solutions',
                            subtitle: 'Security & Reliability',
                            description: 'Specialized security cabins and monitoring solutions for construction sites, industrial facilities, and commercial properties.',
                            image: '/hero-slide-2.jpg',
                            buttonText: 'View Products',
                            buttonLink: '/products',
                            buttonStyle: 'primary',
                            textPosition: 'center',
                            isActive: true,
                            order: 2
                        }),
                        createSlide({
                            title: 'Custom Office Solutions',
                            subtitle: 'Comfort & Efficiency',
                            description: 'Modern office porta cabins with professional interiors, climate control, and all necessary amenities for your business needs.',
                            image: '/hero-slide-3.jpg',
                            buttonText: 'Learn More',
                            buttonLink: '/about',
                            buttonStyle: 'outline',
                            textPosition: 'center',
                            isActive: true,
                            order: 3
                        })
                    ],
                    settings: {
                        autoPlay: true,
                        autoPlayDelay: 5000,
                        showDots: true,
                        showArrows: true,
                        infinite: true,
                        slidesToShow: 1,
                        slidesToScroll: 1
                    },
                    isActive: true
                }
            ];
            for (const slider of defaultSliders){
                await sliderStore.create(slider);
            }
        }
        console.log('Default data initialized successfully');
    } catch (error) {
        console.error('Error initializing default data:', error);
    }
}
}),
"[project]/src/app/api/admin/products/route.ts [app-route] (ecmascript)", ((__turbopack_context__) => {
"use strict";

__turbopack_context__.s([
    "GET",
    ()=>GET,
    "POST",
    ()=>POST
]);
var __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$server$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/node_modules/next/server.js [app-route] (ecmascript)");
var __TURBOPACK__imported__module__$5b$project$5d2f$src$2f$lib$2f$data$2d$store$2e$ts__$5b$app$2d$route$5d$__$28$ecmascript$29$__ = __turbopack_context__.i("[project]/src/lib/data-store.ts [app-route] (ecmascript)");
;
;
async function GET() {
    try {
        await (0, __TURBOPACK__imported__module__$5b$project$5d2f$src$2f$lib$2f$data$2d$store$2e$ts__$5b$app$2d$route$5d$__$28$ecmascript$29$__["initializeDefaultData"])();
        const products = await __TURBOPACK__imported__module__$5b$project$5d2f$src$2f$lib$2f$data$2d$store$2e$ts__$5b$app$2d$route$5d$__$28$ecmascript$29$__["productStore"].getAll();
        return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$server$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextResponse"].json({
            success: true,
            data: products
        });
    } catch (error) {
        return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$server$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextResponse"].json({
            success: false,
            error: 'Failed to fetch products'
        }, {
            status: 500
        });
    }
}
async function POST(request) {
    try {
        const data = await request.json();
        const product = await __TURBOPACK__imported__module__$5b$project$5d2f$src$2f$lib$2f$data$2d$store$2e$ts__$5b$app$2d$route$5d$__$28$ecmascript$29$__["productStore"].create(data);
        return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$server$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextResponse"].json({
            success: true,
            data: product
        });
    } catch (error) {
        return __TURBOPACK__imported__module__$5b$project$5d2f$node_modules$2f$next$2f$server$2e$js__$5b$app$2d$route$5d$__$28$ecmascript$29$__["NextResponse"].json({
            success: false,
            error: 'Failed to create product'
        }, {
            status: 500
        });
    }
}
}),
];

//# sourceMappingURL=%5Broot-of-the-server%5D__0fe6101d._.js.map