<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<OfficeApp
  xmlns="http://schemas.microsoft.com/office/appforoffice/1.1"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xmlns:bt="http://schemas.microsoft.com/office/officeappbasictypes/1.0"
  xmlns:mailappor="http://schemas.microsoft.com/office/mailappversionoverrides"
  xsi:type="MailApp">

  <!--
    komplai for Outlook — anonymise a draft before you send it.

    Separate from manifest.xml because mail add-ins are a different
    schema: `xsi:type="MailApp"`, a `<Rule>`-driven activation model
    instead of `<Hosts>`, and VersionOverrides in the mailappversion-
    overrides namespace. There is no way to fold Outlook into the
    Word/PowerPoint/Excel manifest — Microsoft models it as a different
    kind of add-in.

    Scope note: this is a TASKPANE add-in, activated from the ribbon in
    a compose window. It does NOT block send. True on-send enforcement
    needs `LaunchEvent` / `OnMessageSend`, which requires a Microsoft
    365 subscription, admin deployment, and is unsupported on several
    Outlook builds — a poor fit for a tool whose whole point is that
    anyone can install it themselves. The taskpane covers the case that
    matters: the user opens it while drafting and cleans the mail
    before hitting send.
  -->

  <Id>8e46c1b3-a70d-4f52-9c18-6b2fd4e07a91</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>[TEST] Progressify ApS</ProviderName>
  <DefaultLocale>da-DK</DefaultLocale>

  <DisplayName DefaultValue="[TEST] komplai for Outlook">
    <Override Locale="en-US" Value="[TEST] komplai for Outlook"/>
  </DisplayName>
  <Description DefaultValue="Find og anonymisér CPR, navne og personoplysninger i en mail, inden du sender den.">
    <Override Locale="en-US" Value="Find and redact CPR numbers, names and personal data in an email before you send it."/>
  </Description>

  <IconUrl DefaultValue="https://docs.test.komplai.dk/word-icons/icon-32.png"/>
  <HighResolutionIconUrl DefaultValue="https://docs.test.komplai.dk/word-icons/icon-128.png"/>
  <SupportUrl DefaultValue="https://komplai.dk/support"/>

  <AppDomains>
    <AppDomain>https://komplai.dk</AppDomain>
    <AppDomain>https://auth.test.komplai.dk</AppDomain>
    <AppDomain>https://auth.komplai.dk</AppDomain>
    <AppDomain>https://api.test.komplai.dk</AppDomain>
    <AppDomain>https://api.komplai.dk</AppDomain>
    <AppDomain>https://docs.test.komplai.dk</AppDomain>
    <AppDomain>https://docs.komplai.dk</AppDomain>
  </AppDomains>

  <Hosts>
    <Host Name="Mailbox"/>
  </Hosts>

  <Requirements>
    <Sets>
      <!--
        Mailbox 1.3 is the floor for `body.setAsync` in compose mode,
        which is the only way this add-in can write. Below it we could
        read a draft and report findings but never fix them, which is
        not a product worth shipping.
      -->
      <Set Name="Mailbox" MinVersion="1.3"/>
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemEdit">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://docs.test.komplai.dk/embed/tools"/>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteItem</Permissions>

  <Rule xsi:type="RuleCollection" Mode="Or">
    <!-- Compose windows only: a sent message can't be edited. -->
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Edit"/>
  </Rule>

  <DisableEntityHighlighting>false</DisableEntityHighlighting>

  <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides" xsi:type="VersionOverridesV1_0">
    <Requirements>
      <bt:Sets DefaultMinVersion="1.3">
        <bt:Set Name="Mailbox"/>
      </bt:Sets>
    </Requirements>

    <Hosts>
      <Host xsi:type="MailHost">
        <DesktopFormFactor>
          <FunctionFile resid="Taskpane.Url"/>

          <ExtensionPoint xsi:type="MessageComposeCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="komplai.test.compose.group">
                <Label resid="Group.Label"/>
                <Control xsi:type="Button" id="komplai.test.compose.button">
                  <Label resid="ScanButton.Label"/>
                  <Supertip>
                    <Title resid="ScanButton.Title"/>
                    <Description resid="ScanButton.Tooltip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="Icon.16x16"/>
                    <bt:Image size="32" resid="Icon.32x32"/>
                    <bt:Image size="80" resid="Icon.80x80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="Taskpane.Url"/>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>

    <Resources>
      <bt:Images>
        <bt:Image id="Icon.16x16" DefaultValue="https://docs.test.komplai.dk/word-icons/icon-16.png"/>
        <bt:Image id="Icon.32x32" DefaultValue="https://docs.test.komplai.dk/word-icons/icon-32.png"/>
        <bt:Image id="Icon.80x80" DefaultValue="https://docs.test.komplai.dk/word-icons/icon-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="Taskpane.Url" DefaultValue="https://docs.test.komplai.dk/embed/tools"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="Group.Label" DefaultValue="komplai">
          <bt:Override Locale="en-US" Value="komplai"/>
        </bt:String>
        <bt:String id="ScanButton.Label" DefaultValue="Anonymisér">
          <bt:Override Locale="en-US" Value="Redact"/>
        </bt:String>
        <bt:String id="ScanButton.Title" DefaultValue="Anonymisér mail">
          <bt:Override Locale="en-US" Value="Redact email"/>
        </bt:String>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="ScanButton.Tooltip" DefaultValue="Gennemgå mailen for CPR, navne og personoplysninger, inden du sender den.">
          <bt:Override Locale="en-US" Value="Review the message for CPR numbers, names and personal data before you send it."/>
        </bt:String>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
</OfficeApp>
