<div class="form-group">
    <label class="short">{{localize "PF2E.RuleEditor.General.Label"}}</label>
    <div class="form-fields">
        <input type="text" name="{{basePath}}.label" value="{{rule.label}}" placeholder="{{object.label}}" />
        <label>
            {{localize "PF2E.RuleEditor.FlatModifier.HideIfDisabled"}}
            <input type="checkbox" name="{{basePath}}.hideIfDisabled" {{checked rule.hideIfDisabled}}>
        </label>
    </div>
</div>

<div class="form-group">
    <label class="short">{{localize "PF2E.RuleEditor.General.Selector"}}</label>
    <div class="attached-input">
        <button type="button" class="attachment" data-action="toggle-selector">
            {{#if selectorIsArray}}Multiple{{else}}Single{{/if}}
        </button>
        {{#if selectorIsArray}}
            <tagify-tags class="pf2e-tagify selector-list" name="{{basePath}}.selector" value="{{json rule.selector}}" />
        {{else}}
            <input type="text" name="{{basePath}}.selector" value="{{rule.selector}}" />
        {{/if}}
    </div>
</div>

<div class="form-group">
    <label class="short">{{localize "PF2E.RuleEditor.General.Value"}}</label>
    <div class="form-fields">
        {{#if (eq rule.type "ability")}}
            <select name="{{basePath}}.ability">
                {{selectOptions abilities selected=rule.ability localize=true}}
            </select>
            <label>
                {{localize "PF2E.RuleEditor.FlatModifier.Force"}}
                <input type="checkbox" name="{{basePath}}.force" {{checked rule.force}}>
            </label>
        {{else}}
            {{{form.resolvableValue "value" hideButton=true}}}
        {{/if}}
        <select name="{{basePath}}.type" class="short">
            {{selectOptions types selected=rule.type localize=true}}
        </select>

        {{{form.resolvableAddBracket "value"}}}
    </div>
</div>

{{{form.resolvableBrackets "value"}}}

{{#if isDamage}}
<div class="form-group">
    <label class="short">{{localize "PF2E.RuleEditor.General.DamageType"}}</label>
    <div class="form-fields">
        <input type="text" class="pf2e-tagify damage-type" name="{{basePath}}.damageType" value="{{rule.damageType}}"/>
        <select name="{{basePath}}.damageCategory" class="short">
            {{selectOptions damageCategories selected=rule.damageCategory blank="" localize=true}}
        </select>
        <select name="{{basePath}}.critical" class="short">
            {{selectOptions criticalOptions selected=rule.critical blank="PF2E.RuleEditor.General.CriticalBehavior.null" localize=true}}
        </select>
    </div>
</div>
{{/if}}

<div class="form-group">
    <label class="short">{{localize "PF2E.RuleEditor.General.Predicate"}}</label>
    <input type="text" name="{{basePath}}.predicate" value="{{json rule.predicate}}" />
</div>
