{
    "version": "1.0.0",
    "layout_name": "admin_module_list",
    "permissions": [
        "core.modules.read"
    ],
    "extends": "_admin_base",
    "meta": {
        "title": "$t:admin.modules.page_title",
        "description": "$t:admin.modules.page_description"
    },
    "state": {
        "searchQuery": "",
        "showHidden": false
    },
    "transition_overlay": {
        "wait_for": [
            "modules",
            "auto_deactivated_banner"
        ]
    },
    "init_actions": [
        {
            "handler": "setState",
            "params": {
                "target": "global",
                "_local": {
                    "searchQuery": "{{query.search || ''}}"
                }
            }
        }
    ],
    "data_sources": [
        {
            "id": "modules",
            "label_key": "$t:editor.data_source.modules",
            "type": "api",
            "endpoint": "/api/admin/modules",
            "method": "GET",
            "auto_fetch": true,
            "auth_required": true,
            "params": {
                "page": "{{query.page}}",
                "per_page": "{{query.per_page || 12}}",
                "search": "{{query.search}}",
                "status": "{{query.status}}",
                "include_hidden": "{{_local.showHidden ? 1 : 0}}"
            },
            "fallback": {
                "data": {
                    "data": [],
                    "current_page": 1,
                    "last_page": 1,
                    "per_page": 12,
                    "total": 0
                }
            }
        },
        {
            "id": "auto_deactivated_banner",
            "label_key": "$t:editor.data_source.auto_deactivated_banner",
            "type": "api",
            "endpoint": "/api/admin/extensions/auto-deactivated",
            "method": "GET",
            "auto_fetch": true,
            "auth_required": true,
            "fallback": {
                "data": {
                    "items": {
                        "plugins": [],
                        "modules": [],
                        "templates": []
                    },
                    "current_core_version": ""
                }
            }
        }
    ],
    "slots": {
        "content": [
            {
                "id": "module_list_content",
                "type": "basic",
                "name": "Div",
                "props": {
                    "className": "admin-page-content-responsive-fluid"
                },
                "children": [
                    {
                        "id": "page_header",
                        "type": "composite",
                        "name": "PageHeader",
                        "props": {
                            "title": "$t:admin.modules.title",
                            "description": "$t:admin.modules.description"
                        },
                        "children": [
                            {
                                "id": "refresh_button",
                                "type": "composite",
                                "name": "IconButton",
                                "props": {
                                    "iconName": "refresh",
                                    "variant": "outline",
                                    "size": "md"
                                },
                                "actions": [
                                    {
                                        "type": "click",
                                        "handler": "refetchDataSource",
                                        "params": {
                                            "dataSourceId": "modules"
                                        }
                                    }
                                ]
                            },
                            {
                                "id": "check_updates_button",
                                "type": "basic",
                                "name": "Button",
                                "props": {
                                    "className": "flex-center gap-2 px-4 h-10 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
                                    "disabled": "{{_global.isCheckingUpdates || modules?.data?.abilities?.can_install !== true}}",
                                    "type": "button"
                                },
                                "responsive": {
                                    "portable": {
                                        "props": {
                                            "className": "hidden"
                                        }
                                    }
                                },
                                "actions": [
                                    {
                                        "type": "click",
                                        "handler": "sequence",
                                        "actions": [
                                            {
                                                "handler": "setState",
                                                "params": {
                                                    "target": "global",
                                                    "isCheckingUpdates": true
                                                }
                                            },
                                            {
                                                "handler": "apiCall",
                                                "auth_required": true,
                                                "target": "/api/admin/modules/check-updates",
                                                "params": {
                                                    "method": "POST"
                                                },
                                                "onSuccess": [
                                                    {
                                                        "handler": "setState",
                                                        "params": {
                                                            "target": "global",
                                                            "isCheckingUpdates": false
                                                        }
                                                    },
                                                    {
                                                        "handler": "refetchDataSource",
                                                        "params": {
                                                            "dataSourceId": "modules"
                                                        }
                                                    },
                                                    {
                                                        "handler": "toast",
                                                        "params": {
                                                            "type": "success",
                                                            "message": "{{response.data?.update_count > 0 ? '$t:admin.modules.check_updates_success|count=' + response.data.update_count : '$t:admin.modules.check_updates_no_updates'}}"
                                                        }
                                                    }
                                                ],
                                                "onError": [
                                                    {
                                                        "handler": "setState",
                                                        "params": {
                                                            "target": "global",
                                                            "isCheckingUpdates": false
                                                        }
                                                    },
                                                    {
                                                        "handler": "toast",
                                                        "params": {
                                                            "type": "error",
                                                            "message": "{{$error.message}}"
                                                        }
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ],
                                "children": [
                                    {
                                        "type": "basic",
                                        "name": "Icon",
                                        "if": "{{!_global.isCheckingUpdates}}",
                                        "props": {
                                            "name": "refresh",
                                            "size": "sm"
                                        }
                                    },
                                    {
                                        "type": "basic",
                                        "name": "Icon",
                                        "if": "{{_global.isCheckingUpdates}}",
                                        "props": {
                                            "name": "spinner",
                                            "size": "sm",
                                            "className": "animate-spin"
                                        }
                                    },
                                    {
                                        "type": "basic",
                                        "name": "Span",
                                        "text": "$t:admin.modules.actions.check_updates"
                                    }
                                ]
                            },
                            {
                                "id": "manual_install_button",
                                "type": "basic",
                                "name": "Button",
                                "props": {
                                    "className": "flex-center gap-2 px-4 h-10 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
                                    "disabled": "{{modules?.data?.abilities?.can_install !== true}}"
                                },
                                "responsive": {
                                    "portable": {
                                        "props": {
                                            "className": "hidden"
                                        }
                                    }
                                },
                                "actions": [
                                    {
                                        "type": "click",
                                        "handler": "openModal",
                                        "target": "module_manual_install_modal"
                                    }
                                ],
                                "children": [
                                    {
                                        "type": "basic",
                                        "name": "Icon",
                                        "props": {
                                            "name": "upload",
                                            "className": "w-5 h-5"
                                        }
                                    },
                                    {
                                        "type": "basic",
                                        "name": "Span",
                                        "text": "$t:admin.modules.manual_install"
                                    }
                                ]
                            },
                            {
                                "id": "marketplace_button",
                                "type": "basic",
                                "name": "Button",
                                "if": "{{false}}",
                                "props": {
                                    "className": "flex-center gap-2 px-4 py-2 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-lg hover:bg-gray-800 dark:hover:bg-gray-100 transition-colors"
                                },
                                "responsive": {
                                    "portable": {
                                        "props": {
                                            "className": "hidden"
                                        }
                                    }
                                },
                                "children": [
                                    {
                                        "type": "basic",
                                        "name": "Icon",
                                        "props": {
                                            "name": "globe",
                                            "className": "w-5 h-5"
                                        }
                                    },
                                    {
                                        "type": "basic",
                                        "name": "Span",
                                        "text": "$t:admin.modules.marketplace"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "mobile_action_buttons",
                        "type": "basic",
                        "name": "Div",
                        "props": {
                            "className": "hidden"
                        },
                        "responsive": {
                            "portable": {
                                "props": {
                                    "className": "flex-center gap-2 -mt-4 mb-4"
                                }
                            }
                        },
                        "children": [
                            {
                                "id": "mobile_manual_install_button",
                                "type": "basic",
                                "name": "Button",
                                "props": {
                                    "className": "flex-center flex-1 justify-center gap-2 px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
                                    "disabled": "{{modules?.data?.abilities?.can_install !== true}}"
                                },
                                "actions": [
                                    {
                                        "type": "click",
                                        "handler": "openModal",
                                        "target": "module_manual_install_modal"
                                    }
                                ],
                                "children": [
                                    {
                                        "type": "basic",
                                        "name": "Icon",
                                        "props": {
                                            "name": "upload",
                                            "className": "w-5 h-5"
                                        }
                                    },
                                    {
                                        "type": "basic",
                                        "name": "Span",
                                        "text": "$t:admin.modules.manual_install"
                                    }
                                ]
                            },
                            {
                                "id": "mobile_marketplace_button",
                                "type": "basic",
                                "name": "Button",
                                "if": "{{false}}",
                                "props": {
                                    "className": "flex-center flex-1 justify-center gap-2 px-4 py-2 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-lg hover:bg-gray-800 dark:hover:bg-gray-100 transition-colors"
                                },
                                "children": [
                                    {
                                        "type": "basic",
                                        "name": "Icon",
                                        "props": {
                                            "name": "globe",
                                            "className": "w-5 h-5"
                                        }
                                    },
                                    {
                                        "type": "basic",
                                        "name": "Span",
                                        "text": "$t:admin.modules.marketplace"
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "auto_deactivated_banner_wrapper",
                        "type": "basic",
                        "name": "Div",
                        "if": "{{(auto_deactivated_banner?.data?.items?.modules?.length ?? 0) > 0}}",
                        "props": {
                            "className": "alert-warning",
                            "role": "alert"
                        },
                        "children": [
                            {
                                "type": "basic",
                                "name": "Div",
                                "props": {
                                    "className": "flex-start gap-3"
                                },
                                "children": [
                                    {
                                        "type": "basic",
                                        "name": "Icon",
                                        "props": {
                                            "name": "exclamation-triangle",
                                            "className": "text-amber-600 dark:text-amber-400 mt-0.5 shrink-0"
                                        }
                                    },
                                    {
                                        "type": "basic",
                                        "name": "Div",
                                        "props": {
                                            "className": "flex-1 min-w-0"
                                        },
                                        "children": [
                                            {
                                                "type": "basic",
                                                "name": "P",
                                                "props": {
                                                    "className": "text-sm font-medium text-warning-soft mb-2"
                                                },
                                                "text": "$t:extensions.banner.title"
                                            },
                                            {
                                                "type": "basic",
                                                "name": "Div",
                                                "props": {
                                                    "className": "row-stack"
                                                },
                                                "children": [
                                                    {
                                                        "type": "basic",
                                                        "name": "Div",
                                                        "iteration": {
                                                            "source": "{{auto_deactivated_banner?.data?.items?.modules ?? []}}",
                                                            "item_var": "banner_item"
                                                        },
                                                        "props": {
                                                            "className": "flex-between gap-2 text-warning-soft"
                                                        },
                                                        "children": [
                                                            {
                                                                "type": "basic",
                                                                "name": "Span",
                                                                "props": {
                                                                    "className": "font-mono"
                                                                },
                                                                "text": "{{banner_item.identifier}} — $t:defer:extensions.banner.item_required|required={{banner_item.incompatible_required_version ?? ''}}"
                                                            },
                                                            {
                                                                "type": "basic",
                                                                "name": "Button",
                                                                "props": {
                                                                    "type": "button",
                                                                    "className": "text-warning-soft hover:underline",
                                                                    "aria-label": "$t:extensions.banner.dismiss"
                                                                },
                                                                "actions": [
                                                                    {
                                                                        "type": "click",
                                                                        "handler": "apiCall",
                                                                        "auth_required": true,
                                                                        "target": "/api/admin/extensions/module/{{banner_item.identifier}}/dismiss",
                                                                        "params": {
                                                                            "method": "POST"
                                                                        },
                                                                        "onSuccess": [
                                                                            {
                                                                                "handler": "refetchDataSource",
                                                                                "params": {
                                                                                    "dataSourceId": "auto_deactivated_banner"
                                                                                }
                                                                            }
                                                                        ]
                                                                    }
                                                                ],
                                                                "children": [
                                                                    {
                                                                        "type": "basic",
                                                                        "name": "Icon",
                                                                        "props": {
                                                                            "name": "times",
                                                                            "size": "xs"
                                                                        }
                                                                    }
                                                                ]
                                                            }
                                                        ]
                                                    }
                                                ]
                                            },
                                            {
                                                "type": "basic",
                                                "name": "Div",
                                                "props": {
                                                    "className": "mt-2"
                                                },
                                                "children": [
                                                    {
                                                        "type": "basic",
                                                        "name": "Button",
                                                        "props": {
                                                            "type": "button",
                                                            "className": "inline-flex items-center gap-1.5 px-4 py-2 text-sm font-medium border border-amber-500 dark:border-amber-400 bg-white dark:bg-gray-800 text-warning-soft hover:bg-amber-50 dark:hover:bg-gray-700 rounded-md focus:outline-none focus:ring-2 focus:ring-amber-500 dark:focus:ring-amber-400 focus:ring-offset-2 transition-colors cursor-pointer"
                                                        },
                                                        "actions": [
                                                            {
                                                                "type": "click",
                                                                "handler": "openModal",
                                                                "target": "core_update_guide_modal"
                                                            }
                                                        ],
                                                        "children": [
                                                            {
                                                                "type": "basic",
                                                                "name": "Icon",
                                                                "props": {
                                                                    "name": "arrow-up-circle",
                                                                    "size": "xs"
                                                                }
                                                            },
                                                            {
                                                                "type": "basic",
                                                                "name": "Span",
                                                                "text": "$t:extensions.banner.guide_link"
                                                            }
                                                        ]
                                                    }
                                                ]
                                            }
                                        ]
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "search_bar_wrapper",
                        "type": "basic",
                        "name": "Div",
                        "props": {
                            "className": "flex-center justify-end gap-4 mb-6"
                        },
                        "responsive": {
                            "portable": {
                                "props": {
                                    "className": "mb-6 row-stack"
                                }
                            }
                        },
                        "children": [
                            {
                                "id": "include_hidden_toggle",
                                "type": "basic",
                                "name": "Label",
                                "if": "{{currentUser?.is_super === true}}",
                                "props": {
                                    "className": "flex-center gap-2 text-body cursor-pointer select-none"
                                },
                                "children": [
                                    {
                                        "type": "basic",
                                        "name": "Input",
                                        "props": {
                                            "type": "checkbox",
                                            "checked": "{{_local.showHidden === true}}",
                                            "className": "w-4 h-4 rounded text-blue-600 dark:text-blue-400 dark:focus:ring-blue-400"
                                        },
                                        "actions": [
                                            {
                                                "type": "change",
                                                "handler": "setState",
                                                "params": {
                                                    "showHidden": "{{!_local.showHidden}}"
                                                }
                                            },
                                            {
                                                "type": "change",
                                                "handler": "refetchDataSource",
                                                "params": {
                                                    "dataSourceId": "modules"
                                                }
                                            }
                                        ]
                                    },
                                    {
                                        "type": "basic",
                                        "name": "Span",
                                        "text": "$t:admin.modules.include_hidden"
                                    }
                                ]
                            },
                            {
                                "id": "search_bar",
                                "type": "composite",
                                "name": "SearchBar",
                                "props": {
                                    "placeholder": "$t:admin.modules.search_placeholder",
                                    "value": "{{_local.searchQuery || ''}}",
                                    "className": "w-64"
                                },
                                "responsive": {
                                    "portable": {
                                        "props": {
                                            "className": "w-full"
                                        }
                                    }
                                },
                                "actions": [
                                    {
                                        "type": "change",
                                        "handler": "setState",
                                        "params": {
                                            "searchQuery": "{{$event.target.value}}"
                                        }
                                    },
                                    {
                                        "type": "submit",
                                        "handler": "navigate",
                                        "params": {
                                            "path": "/admin/modules",
                                            "query": {
                                                "search": "{{_local.searchQuery || undefined}}",
                                                "page": 1
                                            }
                                        }
                                    }
                                ]
                            }
                        ]
                    },
                    {
                        "id": "content_area",
                        "type": "basic",
                        "name": "Div",
                        "props": {
                            "className": "admin-card"
                        },
                        "children": [
                            {
                                "id": "module_card_grid",
                                "type": "composite",
                                "name": "CardGrid",
                                "blur_until_loaded": true,
                                "props": {
                                    "data": "{{modules?.data?.data ?? []}}",
                                    "gridColumns": 1,
                                    "gap": 4,
                                    "idField": "identifier",
                                    "pagination": true,
                                    "alwaysShowPagination": true,
                                    "serverSidePagination": true,
                                    "serverCurrentPage": "{{modules?.data?.current_page ?? 1}}",
                                    "serverTotalPages": "{{modules?.data?.last_page ?? 1}}",
                                    "cardClassName": "border border-gray-200 dark:border-gray-700 rounded-lg p-4 relative",
                                    "cardColumns": [
                                        {
                                            "id": "module_content",
                                            "cellChildren": [
                                                {
                                                    "type": "basic",
                                                    "name": "Div",
                                                    "props": {
                                                        "className": "flex items-start gap-4"
                                                    },
                                                    "children": [
                                                        {
                                                            "type": "basic",
                                                            "name": "Div",
                                                            "props": {
                                                                "className": "flex-shrink-0 w-12 h-12 bg-gray-100 dark:bg-gray-700 rounded-lg flex items-center justify-center"
                                                            },
                                                            "children": [
                                                                {
                                                                    "type": "basic",
                                                                    "name": "Icon",
                                                                    "props": {
                                                                        "name": "cube",
                                                                        "className": "text-2xl text-gray-600 dark:text-gray-400"
                                                                    }
                                                                }
                                                            ]
                                                        },
                                                        {
                                                            "type": "basic",
                                                            "name": "Div",
                                                            "props": {
                                                                "className": "flex-1 min-w-0 flex items-start justify-between gap-4"
                                                            },
                                                            "responsive": {
                                                                "portable": {
                                                                    "props": {
                                                                        "className": "flex-1 min-w-0 row-stack"
                                                                    }
                                                                }
                                                            },
                                                            "children": [
                                                                {
                                                                    "type": "basic",
                                                                    "name": "Div",
                                                                    "props": {
                                                                        "className": "flex-1 min-w-0"
                                                                    },
                                                                    "children": [
                                                                        {
                                                                            "type": "basic",
                                                                            "name": "Div",
                                                                            "props": {
                                                                                "className": "flex-center gap-2 flex-wrap"
                                                                            },
                                                                            "children": [
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "props": {
                                                                                        "className": "font-semibold text-gray-900 dark:text-white"
                                                                                    },
                                                                                    "text": "{{row.name}}"
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "props": {
                                                                                        "className": "px-2 py-0.5 text-xs bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 rounded"
                                                                                    },
                                                                                    "text": "v{{row.version}}"
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "if": "{{row.status === 'active'}}",
                                                                                    "props": {
                                                                                        "className": "px-2 py-0.5 text-xs bg-green-100 dark:bg-green-900 text-green-600 dark:text-green-400 rounded"
                                                                                    },
                                                                                    "text": "$t:admin.modules.status.active"
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "if": "{{row.status == 'inactive'}}",
                                                                                    "props": {
                                                                                        "className": "px-2 py-0.5 text-xs bg-gray-100 dark:bg-gray-700 text-gray-600 dark:text-gray-400 rounded"
                                                                                    },
                                                                                    "text": "$t:admin.modules.status.inactive"
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "if": "{{row.status == 'uninstalled'}}",
                                                                                    "props": {
                                                                                        "className": "px-2 py-0.5 text-xs bg-blue-100 dark:bg-blue-900 text-blue-600 dark:text-blue-400 rounded"
                                                                                    },
                                                                                    "text": "$t:admin.modules.status.not_installed"
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "if": "{{row.status == 'installing'}}",
                                                                                    "props": {
                                                                                        "className": "px-2 py-0.5 text-xs bg-yellow-100 dark:bg-yellow-900 text-yellow-600 dark:text-yellow-400 rounded"
                                                                                    },
                                                                                    "text": "$t:admin.modules.status.installing"
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "if": "{{row.status == 'uninstalling'}}",
                                                                                    "props": {
                                                                                        "className": "px-2 py-0.5 text-xs bg-orange-100 dark:bg-orange-900 text-orange-600 dark:text-orange-400 rounded"
                                                                                    },
                                                                                    "text": "$t:admin.modules.status.uninstalling"
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "if": "{{row.status == 'updating'}}",
                                                                                    "props": {
                                                                                        "className": "px-2 py-0.5 text-xs bg-purple-100 dark:bg-purple-900 text-purple-600 dark:text-purple-400 rounded"
                                                                                    },
                                                                                    "text": "$t:admin.modules.status.updating"
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "if": "{{row.update_available && row.status != 'updating' && row.status != 'uninstalled'}}",
                                                                                    "props": {
                                                                                        "className": "px-2 py-0.5 text-xs bg-red-100 dark:bg-red-900 text-red-600 dark:text-red-400 rounded"
                                                                                    },
                                                                                    "text": "$t:admin.modules.update_available"
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "if": "{{row.update_available && row.latest_version && row.status != 'updating' && row.status != 'uninstalled'}}",
                                                                                    "props": {
                                                                                        "className": "text-tertiary"
                                                                                    },
                                                                                    "text": "$t:defer:admin.modules.version_available|version={{row.latest_version ?? ''}}"
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "if": "{{row.is_compatible === false}}",
                                                                                    "props": {
                                                                                        "className": "px-2 py-0.5 text-xs bg-amber-100 dark:bg-amber-900 text-amber-700 dark:text-amber-300 rounded inline-flex items-center gap-1",
                                                                                        "title": "$t:defer:extensions.badges.incompatible_tooltip|required={{row.required_core_version ?? row.incompatible_required_version ?? ''}}|installed={{row.current_core_version ?? ''}}",
                                                                                        "aria-describedby": "compat_sr_{{row.identifier}}"
                                                                                    },
                                                                                    "children": [
                                                                                        {
                                                                                            "type": "basic",
                                                                                            "name": "Icon",
                                                                                            "props": {
                                                                                                "name": "exclamation-triangle",
                                                                                                "size": "xs"
                                                                                            }
                                                                                        },
                                                                                        {
                                                                                            "type": "basic",
                                                                                            "name": "Span",
                                                                                            "text": "$t:extensions.badges.incompatible"
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "if": "{{row.is_compatible === false}}",
                                                                                    "props": {
                                                                                        "id": "compat_sr_{{row.identifier}}",
                                                                                        "className": "sr-only"
                                                                                    },
                                                                                    "text": "$t:defer:extensions.badges.incompatible_sr|name={{row.name ?? row.identifier ?? ''}}|required={{row.required_core_version ?? row.incompatible_required_version ?? ''}}|installed={{row.current_core_version ?? ''}}"
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "type": "basic",
                                                                            "name": "P",
                                                                            "props": {
                                                                                "className": "mt-1 text-label"
                                                                            },
                                                                            "text": "{{row.description}}"
                                                                        },
                                                                        {
                                                                            "type": "basic",
                                                                            "name": "Div",
                                                                            "props": {
                                                                                "className": "mt-2 flex items-center gap-4 text-xs text-gray-500 dark:text-gray-500"
                                                                            },
                                                                            "responsive": {
                                                                                "portable": {
                                                                                    "props": {
                                                                                        "className": "mt-2 flex flex-col items-start gap-1 text-xs text-gray-500 dark:text-gray-500"
                                                                                    }
                                                                                }
                                                                            },
                                                                            "children": [
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "text": "$t:defer:admin.modules.vendor|vendor={{row.vendor}}"
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Div",
                                                                                    "if": "{{row.dependencies && row.dependencies.length > 0}}",
                                                                                    "props": {
                                                                                        "className": "flex items-center gap-1 flex-wrap"
                                                                                    },
                                                                                    "children": [
                                                                                        {
                                                                                            "type": "basic",
                                                                                            "name": "Span",
                                                                                            "text": "$t:admin.modules.dependencies_label"
                                                                                        },
                                                                                        {
                                                                                            "type": "basic",
                                                                                            "name": "Span",
                                                                                            "iteration": {
                                                                                                "source": "{{row.dependencies}}",
                                                                                                "item_var": "dep",
                                                                                                "index_var": "depIndex"
                                                                                            },
                                                                                            "children": [
                                                                                                {
                                                                                                    "type": "basic",
                                                                                                    "name": "Span",
                                                                                                    "props": {
                                                                                                        "className": "inline-flex items-center gap-0.5 align-middle"
                                                                                                    },
                                                                                                    "children": [
                                                                                                        {
                                                                                                            "type": "basic",
                                                                                                            "name": "Icon",
                                                                                                            "if": "{{dep.type === 'module'}}",
                                                                                                            "props": {
                                                                                                                "name": "cube",
                                                                                                                "className": "w-3.5 h-3.5 text-gray-500 dark:text-gray-400"
                                                                                                            }
                                                                                                        },
                                                                                                        {
                                                                                                            "type": "basic",
                                                                                                            "name": "Icon",
                                                                                                            "if": "{{dep.type === 'plugin'}}",
                                                                                                            "props": {
                                                                                                                "name": "puzzle-piece",
                                                                                                                "className": "w-3.5 h-3.5 text-gray-500 dark:text-gray-400"
                                                                                                            }
                                                                                                        },
                                                                                                        {
                                                                                                            "type": "basic",
                                                                                                            "name": "Span",
                                                                                                            "text": "{{dep.name}}"
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                {
                                                                                                    "type": "basic",
                                                                                                    "name": "Span",
                                                                                                    "if": "{{depIndex < row.dependencies.length - 1}}",
                                                                                                    "text": ",",
                                                                                                    "props": {
                                                                                                        "className": "ml-0 mr-1"
                                                                                                    }
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "if": "{{!row.dependencies || row.dependencies.length === 0}}",
                                                                                    "text": "$t:admin.modules.no_dependencies"
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                },
                                                                {
                                                                    "type": "basic",
                                                                    "name": "Div",
                                                                    "props": {
                                                                        "className": "flex items-center gap-3 shrink-0"
                                                                    },
                                                                    "children": [
                                                                        {
                                                                            "type": "basic",
                                                                            "name": "Button",
                                                                            "if": "{{row.status == 'uninstalled'}}",
                                                                            "props": {
                                                                                "className": "flex-center gap-2 px-4 py-2 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-lg hover:bg-gray-800 dark:hover:bg-gray-100 text-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
                                                                                "disabled": "{{row.abilities?.can_install !== true}}"
                                                                            },
                                                                            "responsive": {
                                                                                "portable": {
                                                                                    "props": {
                                                                                        "className": "flex items-center justify-center gap-2 px-4 py-2 bg-gray-900 dark:bg-white text-white dark:text-gray-900 rounded-lg hover:bg-gray-800 dark:hover:bg-gray-100 text-sm transition-colors w-full"
                                                                                    }
                                                                                }
                                                                            },
                                                                            "actions": [
                                                                                {
                                                                                    "type": "click",
                                                                                    "handler": "sequence",
                                                                                    "actions": [
                                                                                        {
                                                                                            "handler": "setState",
                                                                                            "params": {
                                                                                                "target": "global",
                                                                                                "selectedModule": "{{row}}"
                                                                                            }
                                                                                        },
                                                                                        {
                                                                                            "handler": "openModal",
                                                                                            "target": "module_install_modal"
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ],
                                                                            "children": [
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Icon",
                                                                                    "props": {
                                                                                        "name": "download",
                                                                                        "className": "w-4 h-4"
                                                                                    }
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "text": "$t:admin.modules.actions.install"
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "id": "update_button",
                                                                            "type": "basic",
                                                                            "name": "Button",
                                                                            "if": "{{row.update_available && row.status != 'updating' && row.status != 'uninstalled'}}",
                                                                            "props": {
                                                                                "className": "flex-center gap-2 px-4 py-2 border border-gray-300 dark:border-gray-600 text-gray-700 dark:text-gray-300 rounded-lg hover:bg-gray-50 dark:hover:bg-gray-700 text-sm transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
                                                                                "type": "button",
                                                                                "disabled": "{{row.abilities?.can_install !== true || row.is_compatible === false}}",
                                                                                "title": "{{row.is_compatible === false ? '$t:defer:extensions.badges.incompatible_tooltip|required=' + (row.required_core_version ?? row.incompatible_required_version ?? '') + '|installed=' + (row.current_core_version ?? '') : ''}}",
                                                                                "aria-describedby": "{{row.is_compatible === false ? 'compat_sr_' + row.identifier : ''}}"
                                                                            },
                                                                            "actions": [
                                                                                {
                                                                                    "type": "click",
                                                                                    "handler": "sequence",
                                                                                    "actions": [
                                                                                        {
                                                                                            "handler": "setState",
                                                                                            "params": {
                                                                                                "target": "global",
                                                                                                "selectedModule": "{{row}}",
                                                                                                "moduleLayoutStrategy": "overwrite",
                                                                                                "hasModifiedModuleLayouts": false,
                                                                                                "modifiedModuleLayoutsCount": 0,
                                                                                                "modifiedModuleLayouts": []
                                                                                            }
                                                                                        },
                                                                                        {
                                                                                            "handler": "apiCall",
                                                                                            "auth_required": true,
                                                                                            "target": "/api/admin/modules/{{row.identifier}}/check-modified-layouts",
                                                                                            "params": {
                                                                                                "method": "GET"
                                                                                            },
                                                                                            "onSuccess": [
                                                                                                {
                                                                                                    "handler": "setState",
                                                                                                    "params": {
                                                                                                        "target": "global",
                                                                                                        "hasModifiedModuleLayouts": "{{response.data?.has_modified_layouts ?? false}}",
                                                                                                        "modifiedModuleLayoutsCount": "{{response.data?.modified_count ?? 0}}",
                                                                                                        "modifiedModuleLayouts": "{{response.data?.modified_layouts ?? []}}"
                                                                                                    }
                                                                                                }
                                                                                            ]
                                                                                        },
                                                                                        {
                                                                                            "handler": "apiCall",
                                                                                            "auth_required": true,
                                                                                            "target": "/api/admin/modules/{{row.identifier}}/changelog?source={{row.update_source ?? 'bundled'}}&from_version={{row.version}}&to_version={{row.latest_version}}",
                                                                                            "params": {
                                                                                                "method": "GET"
                                                                                            },
                                                                                            "onSuccess": [
                                                                                                {
                                                                                                    "handler": "setState",
                                                                                                    "params": {
                                                                                                        "target": "global",
                                                                                                        "updateChangelog": "{{response.data.changelog ?? []}}"
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    "handler": "setState",
                                                                                                    "params": {
                                                                                                        "target": "global",
                                                                                                        "moduleUpdateError": null
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    "handler": "openModal",
                                                                                                    "target": "module_update_modal"
                                                                                                }
                                                                                            ],
                                                                                            "onError": [
                                                                                                {
                                                                                                    "handler": "setState",
                                                                                                    "params": {
                                                                                                        "target": "global",
                                                                                                        "updateChangelog": [],
                                                                                                        "moduleUpdateError": null
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    "handler": "openModal",
                                                                                                    "target": "module_update_modal"
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ],
                                                                            "children": [
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Icon",
                                                                                    "props": {
                                                                                        "name": "refresh",
                                                                                        "className": "w-4 h-4"
                                                                                    }
                                                                                },
                                                                                {
                                                                                    "type": "basic",
                                                                                    "name": "Span",
                                                                                    "text": "$t:admin.modules.actions.update"
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "type": "composite",
                                                                            "name": "Toggle",
                                                                            "if": "{{row.status != 'uninstalled'}}",
                                                                            "props": {
                                                                                "checked": "{{row.status == 'active'}}",
                                                                                "disabled": "{{row.abilities?.can_activate !== true}}",
                                                                                "size": "sm",
                                                                                "className": ""
                                                                            },
                                                                            "responsive": {
                                                                                "portable": {
                                                                                    "props": {
                                                                                        "className": "absolute right-4 top-1/2 -translate-y-1/2"
                                                                                    }
                                                                                }
                                                                            },
                                                                            "actions": [
                                                                                {
                                                                                    "type": "change",
                                                                                    "handler": "apiCall",
                                                                                    "auth_required": true,
                                                                                    "target": "{{$event.target.checked ? '/api/admin/modules/activate' : '/api/admin/modules/deactivate'}}",
                                                                                    "params": {
                                                                                        "method": "POST",
                                                                                        "body": {
                                                                                            "module_name": "{{row.identifier}}"
                                                                                        }
                                                                                    },
                                                                                    "onSuccess": [
                                                                                        {
                                                                                            "handler": "parallel",
                                                                                            "actions": [
                                                                                                {
                                                                                                    "handler": "toast",
                                                                                                    "params": {
                                                                                                        "type": "success",
                                                                                                        "message": "{{$event.target.checked ? '$t:admin.modules.activate_success' : '$t:admin.modules.deactivate_success'}}"
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    "handler": "refetchDataSource",
                                                                                                    "params": {
                                                                                                        "dataSourceId": "modules"
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    "handler": "refetchDataSource",
                                                                                                    "params": {
                                                                                                        "dataSourceId": "admin_menu"
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    "handler": "reloadExtensions",
                                                                                                    "params": {
                                                                                                        "moduleInfo": "{{result}}",
                                                                                                        "action": "{{$event.target.checked ? 'add' : 'remove'}}"
                                                                                                    }
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ],
                                                                                    "errorHandling": {
                                                                                        "409": {
                                                                                            "handler": "sequence",
                                                                                            "actions": [
                                                                                                {
                                                                                                    "handler": "setState",
                                                                                                    "params": {
                                                                                                        "target": "global",
                                                                                                        "selectedModule": "{{row}}",
                                                                                                        "deactivateWarningData": "{{error.errors?.dependent_templates ? error.errors : null}}",
                                                                                                        "activateWarningData": "{{error.errors?.missing_modules || error.errors?.missing_plugins ? error.errors : null}}"
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    "handler": "openModal",
                                                                                                    "target": "{{error.errors?.dependent_templates || error.errors?.dependent_modules || error.errors?.dependent_plugins ? 'module_force_deactivate_modal' : 'module_force_activate_modal'}}"
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    },
                                                                                    "onError": [
                                                                                        {
                                                                                            "handler": "sequence",
                                                                                            "actions": [
                                                                                                {
                                                                                                    "handler": "toast",
                                                                                                    "params": {
                                                                                                        "type": "error",
                                                                                                        "message": "{{error.message}}"
                                                                                                    }
                                                                                                },
                                                                                                {
                                                                                                    "handler": "refetchDataSource",
                                                                                                    "params": {
                                                                                                        "dataSourceId": "modules"
                                                                                                    }
                                                                                                }
                                                                                            ]
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        },
                                                                        {
                                                                            "type": "basic",
                                                                            "name": "Div",
                                                                            "props": {
                                                                                "className": ""
                                                                            },
                                                                            "responsive": {
                                                                                "portable": {
                                                                                    "props": {
                                                                                        "className": "absolute right-0 top-0"
                                                                                    }
                                                                                }
                                                                            },
                                                                            "children": [
                                                                                {
                                                                                    "type": "composite",
                                                                                    "name": "ActionMenu",
                                                                                    "props": {
                                                                                        "triggerLabel": "",
                                                                                        "items": [
                                                                                            {
                                                                                                "id": "view_detail",
                                                                                                "label": "$t:admin.modules.actions.view_detail",
                                                                                                "iconName": "info-circle"
                                                                                            },
                                                                                            {
                                                                                                "id": "refresh_layouts",
                                                                                                "label": "$t:admin.modules.actions.refresh_layouts",
                                                                                                "iconName": "refresh",
                                                                                                "disabled": "{{row.status != 'active' || row.abilities?.can_activate !== true}}"
                                                                                            },
                                                                                            {
                                                                                                "id": "manage_language_packs",
                                                                                                "label": "$t:admin.language_packs.actions.manage",
                                                                                                "iconName": "language",
                                                                                                "disabled": "{{row.status != 'active'}}"
                                                                                            },
                                                                                            {
                                                                                                "id": "uninstall",
                                                                                                "label": "$t:admin.modules.actions.uninstall",
                                                                                                "iconName": "trash",
                                                                                                "variant": "danger",
                                                                                                "disabled": "{{row.status == 'uninstalled' || row.status == 'uninstalling' || row.status == 'installing' || row.abilities?.can_uninstall !== true}}"
                                                                                            }
                                                                                        ]
                                                                                    },
                                                                                    "actions": [
                                                                                        {
                                                                                            "event": "onItemClick",
                                                                                            "type": "action",
                                                                                            "handler": "switch",
                                                                                            "cases": {
                                                                                                "view_detail": {
                                                                                                    "handler": "sequence",
                                                                                                    "actions": [
                                                                                                        {
                                                                                                            "handler": "setState",
                                                                                                            "params": {
                                                                                                                "target": "global",
                                                                                                                "selectedModule": "{{row}}"
                                                                                                            }
                                                                                                        },
                                                                                                        {
                                                                                                            "handler": "apiCall",
                                                                                                            "auth_required": true,
                                                                                                            "target": "/api/admin/modules/{{row.identifier}}/changelog",
                                                                                                            "params": {
                                                                                                                "method": "GET"
                                                                                                            },
                                                                                                            "onSuccess": [
                                                                                                                {
                                                                                                                    "handler": "setState",
                                                                                                                    "params": {
                                                                                                                        "target": "global",
                                                                                                                        "moduleChangelog": "{{response.data.changelog ?? []}}"
                                                                                                                    }
                                                                                                                },
                                                                                                                {
                                                                                                                    "handler": "openModal",
                                                                                                                    "target": "module_detail_modal"
                                                                                                                }
                                                                                                            ],
                                                                                                            "onError": [
                                                                                                                {
                                                                                                                    "handler": "setState",
                                                                                                                    "params": {
                                                                                                                        "target": "global",
                                                                                                                        "moduleChangelog": []
                                                                                                                    }
                                                                                                                },
                                                                                                                {
                                                                                                                    "handler": "openModal",
                                                                                                                    "target": "module_detail_modal"
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                "refresh_layouts": {
                                                                                                    "handler": "sequence",
                                                                                                    "actions": [
                                                                                                        {
                                                                                                            "handler": "setState",
                                                                                                            "params": {
                                                                                                                "target": "global",
                                                                                                                "selectedModule": "{{row}}"
                                                                                                            }
                                                                                                        },
                                                                                                        {
                                                                                                            "handler": "openModal",
                                                                                                            "target": "module_refresh_layouts_modal"
                                                                                                        }
                                                                                                    ]
                                                                                                },
                                                                                                "manage_language_packs": {
                                                                                                    "handler": "navigate",
                                                                                                    "params": {
                                                                                                        "path": "/admin/modules/{{row.identifier}}/language-packs"
                                                                                                    }
                                                                                                },
                                                                                                "uninstall": {
                                                                                                    "handler": "sequence",
                                                                                                    "actions": [
                                                                                                        {
                                                                                                            "handler": "setState",
                                                                                                            "params": {
                                                                                                                "target": "global",
                                                                                                                "selectedModule": "{{row}}",
                                                                                                                "deleteModuleData": false,
                                                                                                                "moduleUninstallInfo": null
                                                                                                            }
                                                                                                        },
                                                                                                        {
                                                                                                            "handler": "openModal",
                                                                                                            "target": "module_uninstall_modal"
                                                                                                        },
                                                                                                        {
                                                                                                            "handler": "apiCall",
                                                                                                            "auth_required": true,
                                                                                                            "target": "/api/admin/modules/{{row.identifier}}/uninstall-info",
                                                                                                            "params": {
                                                                                                                "method": "GET"
                                                                                                            },
                                                                                                            "onSuccess": [
                                                                                                                {
                                                                                                                    "handler": "setState",
                                                                                                                    "params": {
                                                                                                                        "target": "global",
                                                                                                                        "moduleUninstallInfo": "{{response.data}}"
                                                                                                                    }
                                                                                                                }
                                                                                                            ]
                                                                                                        }
                                                                                                    ]
                                                                                                }
                                                                                            }
                                                                                        }
                                                                                    ]
                                                                                }
                                                                            ]
                                                                        }
                                                                    ]
                                                                }
                                                            ]
                                                        }
                                                    ]
                                                }
                                            ]
                                        }
                                    ]
                                },
                                "actions": [
                                    {
                                        "event": "onPageChange",
                                        "type": "change",
                                        "handler": "navigate",
                                        "params": {
                                            "path": "/admin/modules",
                                            "mergeQuery": true,
                                            "query": {
                                                "page": "{{$args[0]}}"
                                            }
                                        }
                                    }
                                ]
                            },
                            {
                                "id": "pagination_info",
                                "type": "basic",
                                "name": "Div",
                                "props": {
                                    "className": "mt-4 text-label text-center"
                                },
                                "children": [
                                    {
                                        "type": "basic",
                                        "name": "Span",
                                        "text": "$t:admin.modules.pagination_info|total={{modules?.data?.total ?? 0}}|from={{((modules?.data?.current_page ?? 1) - 1) * (modules?.data?.per_page ?? 12) + 1}}|to={{Math.min((modules?.data?.current_page ?? 1) * (modules?.data?.per_page ?? 12), modules?.data?.total ?? 0)}}"
                                    }
                                ]
                            }
                        ]
                    }
                ]
            }
        ]
    },
    "modals": [
        {
            "partial": "partials/admin_module_list/_modal_detail.json"
        },
        {
            "partial": "partials/admin_module_list/_modal_install.json"
        },
        {
            "partial": "partials/admin_module_list/_drawer_manifest_preview.json"
        },
        {
            "partial": "partials/admin_module_list/_modal_uninstall.json"
        },
        {
            "partial": "partials/admin_module_list/_modal_manual_install.json"
        },
        {
            "partial": "partials/admin_module_list/_modal_refresh_layouts.json"
        },
        {
            "partial": "partials/admin_module_list/_modal_force_deactivate.json"
        },
        {
            "partial": "partials/admin_module_list/_modal_force_activate.json"
        },
        {
            "partial": "partials/admin_module_list/_modal_update.json"
        },
        {
            "partial": "partials/admin_module_list/_modal_extension_license.json"
        },
        {
            "partial": "partials/admin_settings/_modal_core_update_guide.json"
        }
    ]
}
