
{
    "id": "warrant-affidavit",
    "title": "Warrant Affidavit",
    "description": "Generate an affidavit for various types of warrants.",
    "icon": "Landmark",
    "icon_color": "#84cc16",
    "generator_disabled": false,
    "is_html_output": false,
    "output": "{{narrative.narrative}}",
    "form": [
        { "type": "section", "title": "General Information" },
        { "type": "general", "name": "general" },
        { "type": "officer", "name": "officers", "multi": false, "showDivDetail": true, "showBadgeNumber": true },
        {
            "type": "dropdown",
            "name": "warrant_type",
            "label": "Warrant Type",
            "placeholder": "Select warrant type...",
            "options": ["Arrest Warrant", "Search Warrant", "Electronic Search Warrant", "Financial Search Warrant"],
            "required": true
        },
        { "type": "section", "title": "Affiant Introduction Details", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.introduction", "value": true}] },
        { "type": "text", "name": "introduction_years", "label": "Years of Experience", "placeholder": "e.g. 5", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.introduction", "value": true}] },
        { "type": "text", "name": "introduction_experience", "label": "Extensive Experience", "placeholder": "e.g. narcotics investigations", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.introduction", "value": true}] },

        { "type": "section", "title": "Submission Statement Details", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.submission_statement", "value": true}] },
        { "type": "text", "name": "submission_subject", "label": "Subject/Location", "placeholder": "e.g., John Doe or 1234 Imagination Ave", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.submission_statement", "value": true}], "required": true },
        { "type": "text", "name": "submission_crimes", "label": "Suspected Crimes", "placeholder": "FC. 115 Evading a Peace Officer, FA. 201 Capital Murder", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.submission_statement", "value": true}] },
        
        { "type": "section", "title": "Probable Cause Details", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.probable_cause", "value": true}] },
        { "type": "text", "name": "pc_date", "label": "Date of Initial Event", "placeholder": "e.g., 01/JAN/2024", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.probable_cause", "value": true}] },
        { "type": "text", "name": "pc_time", "label": "Time of Initial Event", "placeholder": "e.g., 14:30", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.probable_cause", "value": true}] },
        { "type": "textarea", "name": "pc_initial_event", "label": "Initial Event/Discovery", "placeholder": "Describe the initial event or discovery.", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.probable_cause", "value": true}] },
        { "type": "textarea", "name": "pc_investigative_steps", "label": "Subsequent Investigative Steps", "placeholder": "e.g., witness interviews, evidence collection, surveillance", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.probable_cause", "value": true}] },
        { "type": "textarea", "name": "pc_key_evidence", "label": "Key Evidence", "placeholder": "e.g., informant tips, physical evidence, or preliminary forensic results", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.probable_cause", "value": true}] },
        { "type": "textarea", "name": "pc_conclusion", "label": "Evidence Conclusion", "placeholder": "Explain what the evidence shows and how it links the subject/location to the crime.", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.probable_cause", "value": true}] },

        { "type": "section", "title": "Scope of Request Details", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.scope_of_request", "value": true}] },
        { "type": "modifier_itemgroup", "name": "scope_of_request", "stipulations": [{"field": "narrative.isPreset", "value": true}, {"field": "narrative.modifiers.scope_of_request", "value": true}] },

        { "type": "section", "title": "Affidavit" },
        {
            "type": "textarea-with-preset",
            "name": "narrative",
            "label": "Affidavit Narrative",
            "noLocalStorage": true,
            "refreshOn": ["officers", "general"],
            "preset": "{{modifiers.introduction}}\n\n{{modifiers.submission_statement}}\n\n{{modifiers.probable_cause}}\n\n{{modifiers.scope_of_request}}\n\n{{modifiers.conclusion}}",
            "modifiers": [
                {
                    "name": "introduction",
                    "label": "Affiant Introduction",
                    "generateText": "I, {{officers.0.rank}} {{officers.0.name}} (#{{officers.0.badgeNumber}}), am a peace officer employed with the {{officers.0.department}}, currently assigned to the {{officers.0.divDetail}}.{{#or introduction_years introduction_experience}} I {{#if introduction_years}}have been employed by this agency for {{introduction_years}} years{{/if}}{{#and introduction_years introduction_experience}} and {{/and}}{{#if introduction_experience}}have extensive experience in {{introduction_experience}}{{/if}}.{{/or}}"
                },
                {
                    "name": "submission_statement",
                    "label": "Submission Statement",
                    "generateText": "I submit this affidavit in support of a{{#or (eq warrant_type 'Arrest Warrant') (eq warrant_time 'Electronic Search Warrant')}}n{{/or}} {{warrant_type}} for {{submission_subject}}. This request is based on an ongoing investigation{{#if submission_crimes}} into the following crimes: {{submission_crimes}}{{/if}}."
                },
                {
                    "name": "probable_cause",
                    "label": "Probable Cause Statement",
                    "generateText": "The following facts establish probable cause for this warrant:\nOn {{pc_date}} at approximately {{pc_time}}, {{pc_initial_event}}. This was followed by {{pc_investigative_steps}}. Evidence gathered, including {{pc_key_evidence}}, indicates that {{pc_conclusion}}."
                },
                {
                    "name": "scope_of_request",
                    "label": "Scope of Request",
                    "generateText": "{{#any narrative.modifierInputs.scope_of_request}}Based on the probable cause outlined above, I request authorization to search, seize, and/or monitor the following:\n{{/any}}{{#each narrative.modifierInputs.scope_of_request}}- {{this.item}}\n{{/each}}",
                    "inputGroup": {
                        "label": "Items to be Searched/Seized/Monitored",
                        "fields": [
                            {
                                "type": "text",
                                "name": "item",
                                "label": "Item",
                                "placeholder": "e.g., One (1) black Glock 19 handgun"
                            }
                        ]
                    }
                },
                {
                    "name": "conclusion",
                    "label": "Conclusion",
                    "generateText": "Based on the information contained in this affidavit, I respectfully request that this court issue the requested {{warrant_type}}.\n\nI declare under penalty of perjury that the foregoing is true and correct.\n\n{{officers.0.name}}\n{{officers.0.rank}}\n{{officers.0.department}}\nDATED: {{general.date}}"
                }
            ]
        }
    ]
}
