<?php

// phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedNamespaceFound -- APD is the established namespace shared with the Pro add-on and retained for backward compatibility.
namespace APD\Domain\Config;

defined('ABSPATH') || exit;

class DefaultConfigFactory
{
    public function make() : array
    {
        return [
            'mode' => 'standalone',
            'theme' => [
                'appearance' => 'light',
            ],
            'layout' => [
                'height' => '720px',
            ],
            'permissions' => [
                'moduleOpen' => [
                    'state' => false,
                    'pricing' => false,
                    'pricingRules' => false,
                    'pricing-rules' => false,
                    'element-editor' => false,
                    'elementEditor' => false,
                    'element-variation-picker' => true,
                    'elementVariationPicker' => true,
                    'variations' => true,
                    'assembly' => false,
                    'product-parameters' => false,
                    'productParameters' => false,
                ],
                'canOpenModule' => true,
                'canMovePanels' => true,
                'canCollapsePanels' => true,
                'canUseStateTools' => false,
                'canUseMagnifier' => true,
                'canUseZoom' => true,
                'canZoomIn' => true,
                'canZoomOut' => true,
                'canFitViewport' => true,
                'canResetViewport' => true,
                'canPanCanvas' => true,
                'canUndo' => true,
                'canRedo' => true,
                'canReset' => true,
                'canAddRect' => true,
                'canAddText' => true,
                'canAddImage' => true,
                'canAddShape' => true,
                'canDrawShape' => true,
                'canClearCanvas' => true,
                'canDuplicateObject' => true,
                'canDeleteObject' => true,
                'canMoveObject' => true,
                'canResizeObject' => true,
                'canRotateObject' => true,
                'canEditObjectColors' => true,
                'canEditObjectStudio' => true,
                'canEditObjectText' => true,
                'canSwitchView' => true,
                'canAddView' => false,
                'canViewViews' => true,
                'canCreateView' => false,
                'canEditView' => false,
                'canDeleteView' => false,
                'canViewLayers' => true,
                'canReorderLayers' => true,
                'canLockLayers' => true,
                'canHideLayers' => true,
                'canSelectLayers' => true,
                'canViewDesigns' => true,
                'canAddDesigns' => true,
                'canOpenImages' => true,
                'canUploadImage' => true,
                'canUseRemoteImages' => true,
                'canUseExternalImageLibraries' => true,
                'canUseFacebookImages' => true,
                'canUsePixabayImages' => true,
                'canUsePexelsImages' => true,
                'canEditText' => true,
                'canEditFontFamily' => true,
                'canEditTextFormatting' => true,
                'canEditTextCurve' => true,
                'canUseColors' => true,
                'canEditColors' => true,
                'canUseStudio' => true,
                'canApplyStudioEffects' => true,
                'canDownload' => true,
                'canDownloadCurrentView' => true,
                'canDownloadAllViews' => true,
                'canDownloadObjects' => true,
                'canDownloadDrawingZones' => true,
                'canExportJson' => false,
                'canImportJson' => false,
                'canViewDrawingAreas' => true,
                'canCreateDrawingAreas' => false,
                'canEditDrawingAreas' => false,
                'canDeleteDrawingAreas' => false,
                'canViewFixedSlots' => true,
                'canCreateFixedSlots' => false,
                'canEditFixedSlots' => false,
                'canDeleteFixedSlots' => false,
                'canViewPricing' => false,
                'canEditPricingBasePrice' => false,
                'canEditPricingRules' => false,
                'canAddPricingRule' => false,
                'canRemovePricingRule' => false,
                'canViewElements' => true,
                'canAddElements' => false,
                'canEditElements' => false,
                'canEditElementVariations' => false,
                'canDeleteElements' => false,
            ],
            'listeners' => [],
            'fonts' => [
                'system' => [],
                'google' => [],
                'custom' => [],
            ],
            'moduleConfig' => [],
            'views' => [],
            'drawingZones' => [],
            'integrations' => [],
            'license' => [],
            'ai' => [],
            'exports' => [],
            'selectionMenu' => [],
            'ui' => [],
            'frontBehavior' => [],
            'mobileBehavior' => [],
            'upload' => [
                'strategy' => 'remote',
                'endpoint' => add_query_arg('apd_source', is_admin() ? 'admin' : 'frontend', rest_url('asuka-designer/v1/upload')),
                'method' => 'POST',
                'fieldName' => 'file',
                'source' => is_admin() ? 'admin' : 'frontend',
                'credentials' => 'same-origin',
                'headers' => [
                    'X-WP-Nonce' => \APD\Support\Nonces::runtime(),
                ],
            ],
            'pricing' => [
                'enabled' => false,
                'rules' => [],
                'pricingRules' => [],
            ],
            'price' => 0,
            'pricingRules' => [],
            'priceFormat' => [],
            'colors' => [
                'scope' => 'object',
                'items' => [],
            ],
            'printingMethods' => [],
            'catalog' => [
                'designs' => [],
                'elements' => [],
                'colors' => [],
                'printingMethods' => [],
            ],
            'initialDocument' => null,
            'initialState' => null,
            'context' => [
                'configId' => null,
                'productId' => null,
                'orderId' => null,
                'userDesignId' => null,
                'isWooCommerce' => false,
                'isAdmin' => false,
            ],
        ];
    }
}
