const PATH = ['globalOptions', 'name:physics', 'options', 'collisionLayers'];
const DEFAULT_LAYER = 'default';
export const collider = {
    fields: [
        {
            name: 'type',
            type: 'select',
            options: ['box', 'capsule', 'circle', 'segment'],
        },
        {
            name: 'sizeX',
            type: 'number',
            dependency: {
                name: 'type',
                value: 'box',
            },
        },
        {
            name: 'sizeY',
            type: 'number',
            dependency: {
                name: 'type',
                value: 'box',
            },
        },
        {
            name: 'radius',
            type: 'number',
            dependency: {
                name: 'type',
                value: 'capsule|circle',
            },
        },
        {
            name: 'height',
            type: 'number',
            dependency: {
                name: 'type',
                value: 'capsule',
            },
        },
        {
            name: 'point1X',
            type: 'number',
            dependency: {
                name: 'type',
                value: 'segment',
            },
        },
        {
            name: 'point1Y',
            type: 'number',
            dependency: {
                name: 'type',
                value: 'segment',
            },
        },
        {
            name: 'point2X',
            type: 'number',
            dependency: {
                name: 'type',
                value: 'segment',
            },
        },
        {
            name: 'point2Y',
            type: 'number',
            dependency: {
                name: 'type',
                value: 'segment',
            },
        },
        {
            name: 'offsetX',
            type: 'number',
        },
        {
            name: 'offsetY',
            type: 'number',
        },
        {
            name: 'layer',
            type: 'select',
            options: (getState) => {
                var _a;
                return [
                    { title: DEFAULT_LAYER, value: DEFAULT_LAYER },
                    ...((_a = getState(PATH)) !== null && _a !== void 0 ? _a : []).map((group) => ({
                        title: group.name,
                        value: group.id,
                    })),
                ];
            },
        },
        {
            name: 'debugColor',
            type: 'color',
        },
        {
            name: 'disabled',
            type: 'boolean',
        },
    ],
    getInitialState: () => ({
        type: 'box',
        sizeX: 1,
        sizeY: 1,
        offsetX: 0,
        offsetY: 0,
        layer: DEFAULT_LAYER,
        debugColor: '#4DFFB8',
        disabled: false,
    }),
};
