<?xml version="1.0" encoding="UTF-8"?>
<!--
  Outlook add-in manifest for "Assistant Regles". A SEPARATE add-in
  identity from manifest.xml, not a second button on it.

  manifest.xml's own header comment explains its Permissions choice:
  ReadItem is the lowest level that still allows getCallbackTokenAsync,
  deliberately, because the whole point of that add-in is proving per-item
  scope. This add-in needs ReadWriteMailbox instead, and it cannot share
  that manifest without silently raising the trust ask for every user of
  the flagship reply drafting feature, whether they use this feature or
  not. Permissions is one value for the WHOLE manifest, not per button.
  Same reasoning make_manifest.py's own header gives for the TEST server:
  two add-ins that need to coexist need two ids, because Outlook keys
  installation on Id and would otherwise replace one with the other.

  Measured directly against the real mailbox, Phase 0 of the plan this
  add-in comes from, 2026-09-04: FindItem across the Inbox via a callback
  token forwarded to a server came back ErrorAccessDenied, even at
  ReadWriteMailbox. That channel and makeEwsRequestAsync are different
  authorization paths inside Exchange. The identical SOAP body sent
  instead via makeEwsRequestAsync from the pane succeeded. See
  addin/web/rules.html's own header comment for the full account.

  NOTE FOR ANYONE EDITING THIS FILE: an XML comment may not contain a
  double hyphen, and this project's prose style uses it constantly. Single
  hyphens only, in here.

  Everything points at https://mail-rules.drimagri.fr because that is where
  serve.py hosts the pages during testing, exactly like manifest.xml.
  make_manifest.py substitutes it for a real deployment, via
  read_source("manifest-rules.xml") or its own source-selecting command
  line option pointed at manifest-rules.xml.

  Reuses the flagship's icon files (icon-16/32/64/80/128.png) rather than
  commissioning separate artwork. A deliberate simplification, easy to
  revisit if the two add-ins need to be told apart by icon rather than by
  name in the ribbon.
-->
<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:ov="http://schemas.microsoft.com/office/mailappversionoverrides"
  xsi:type="MailApp">

  <Id>2270c553-79c7-4854-a9d8-732f4841a435</Id>
  <Version>1.0.0.0</Version>
  <ProviderName>Coop Sud - test interne</ProviderName>
  <DefaultLocale>fr-FR</DefaultLocale>
  <DisplayName DefaultValue="Assistant Regles"/>
  <Description DefaultValue="Analyse votre boite de reception et propose des regles de tri (expediteur, domaine, objet) a valider une par une. Ne modifie jamais votre boite automatiquement."/>
  <IconUrl DefaultValue="https://mail-rules.drimagri.fr/icon-64.png"/>
  <HighResolutionIconUrl DefaultValue="https://mail-rules.drimagri.fr/icon-128.png"/>
  <SupportUrl DefaultValue="https://mail-rules.drimagri.fr/rules.html?v=1.0.0.0"/>

  <AppDomains>
    <AppDomain>https://mail-rules.drimagri.fr</AppDomain>
  </AppDomains>

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

  <!-- 1.1 on purpose, same reasoning as manifest.xml: load everywhere,
       measure the real supported level at runtime rather than turning a
       capability question into an installation failure. -->
  <Requirements>
    <Sets DefaultMinVersion="1.1">
      <Set Name="Mailbox" MinVersion="1.1"/>
    </Sets>
  </Requirements>

  <FormSettings>
    <Form xsi:type="ItemRead">
      <DesktopSettings>
        <SourceLocation DefaultValue="https://mail-rules.drimagri.fr/rules.html?v=1.0.0.0"/>
        <RequestedHeight>450</RequestedHeight>
      </DesktopSettings>
    </Form>
  </FormSettings>

  <Permissions>ReadWriteMailbox</Permissions>

  <Rule xsi:type="RuleCollection" Mode="Or">
    <Rule xsi:type="ItemIs" ItemType="Message" FormType="Read"/>
  </Rule>
  <DisableEntityHighlighting>false</DisableEntityHighlighting>

  <!-- Same reasoning as manifest.xml: a real ribbon button, or the add-in
       only appears in the old add-in bar and reads as "it did not
       install". Exchange 2016+ supports VersionOverrides on-prem. -->
  <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="functionFile"/>
          <ExtensionPoint xsi:type="MessageReadCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="reglesGroup">
                <Label resid="groupLabel"/>
                <Control xsi:type="Button" id="reglesOpenPaneButton">
                  <Label resid="buttonLabel"/>
                  <Supertip>
                    <Title resid="buttonLabel"/>
                    <Description resid="buttonTip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16"/>
                    <bt:Image size="32" resid="icon32"/>
                    <bt:Image size="80" resid="icon80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="taskpaneUrl"/>
                  </Action>
                </Control>
                <Control xsi:type="Button" id="playgroundButton">
                  <Label resid="playgroundLabel"/>
                  <Supertip>
                    <Title resid="playgroundLabel"/>
                    <Description resid="playgroundTip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16"/>
                    <bt:Image size="32" resid="icon32"/>
                    <bt:Image size="80" resid="icon80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="playgroundUrl"/>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="icon16" DefaultValue="https://mail-rules.drimagri.fr/icon-16.png"/>
        <bt:Image id="icon32" DefaultValue="https://mail-rules.drimagri.fr/icon-32.png"/>
        <bt:Image id="icon80" DefaultValue="https://mail-rules.drimagri.fr/icon-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="functionFile" DefaultValue="https://mail-rules.drimagri.fr/commands.html?v=1.0.0.0"/>
        <bt:Url id="taskpaneUrl" DefaultValue="https://mail-rules.drimagri.fr/rules.html?v=1.0.0.0"/>
        <bt:Url id="playgroundUrl" DefaultValue="https://mail-rules.drimagri.fr/playground.html?v=1.0.0.0"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="groupLabel" DefaultValue="Assistant"/>
        <bt:String id="buttonLabel" DefaultValue="Assistant Regles"/>
        <bt:String id="playgroundLabel" DefaultValue="Bac a sable"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="buttonTip" DefaultValue="Analyse votre boite de reception et propose des regles de tri a valider."/>
        <bt:String id="playgroundTip" DefaultValue="Ecrire et executer du code Office.js contre ce message. Outil de developpement."/>
      </bt:LongStrings>
    </Resources>
  
    <!-- Schema v1.1, GENERE depuis le bloc v1.0 ci-dessus par
         make_manifest.py. Ne pas editer a la main : c'est une copie,
         et une copie editee est une copie qui diverge. -->
    <VersionOverrides xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1" xsi:type="VersionOverridesV1_1">
    <Requirements>
      <bt:Sets DefaultMinVersion="1.3">
        <bt:Set Name="Mailbox"/>
      </bt:Sets>
    </Requirements>
    <Hosts>
      <Host xsi:type="MailHost">
        <DesktopFormFactor>
          <FunctionFile resid="functionFile"/>
          <ExtensionPoint xsi:type="MessageReadCommandSurface">
            <OfficeTab id="TabDefault">
              <Group id="reglesGroup">
                <Label resid="groupLabel"/>
                <Control xsi:type="Button" id="reglesOpenPaneButton">
                  <Label resid="buttonLabel"/>
                  <Supertip>
                    <Title resid="buttonLabel"/>
                    <Description resid="buttonTip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16"/>
                    <bt:Image size="32" resid="icon32"/>
                    <bt:Image size="80" resid="icon80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="taskpaneUrl"/>
                    <SupportsPinning>true</SupportsPinning>
                  </Action>
                </Control>
                <Control xsi:type="Button" id="playgroundButton">
                  <Label resid="playgroundLabel"/>
                  <Supertip>
                    <Title resid="playgroundLabel"/>
                    <Description resid="playgroundTip"/>
                  </Supertip>
                  <Icon>
                    <bt:Image size="16" resid="icon16"/>
                    <bt:Image size="32" resid="icon32"/>
                    <bt:Image size="80" resid="icon80"/>
                  </Icon>
                  <Action xsi:type="ShowTaskpane">
                    <SourceLocation resid="playgroundUrl"/>
                    <SupportsPinning>true</SupportsPinning>
                  </Action>
                </Control>
              </Group>
            </OfficeTab>
          </ExtensionPoint>
        </DesktopFormFactor>
      </Host>
    </Hosts>
    <Resources>
      <bt:Images>
        <bt:Image id="icon16" DefaultValue="https://mail-rules.drimagri.fr/icon-16.png"/>
        <bt:Image id="icon32" DefaultValue="https://mail-rules.drimagri.fr/icon-32.png"/>
        <bt:Image id="icon80" DefaultValue="https://mail-rules.drimagri.fr/icon-80.png"/>
      </bt:Images>
      <bt:Urls>
        <bt:Url id="functionFile" DefaultValue="https://mail-rules.drimagri.fr/commands.html?v=1.0.0.0"/>
        <bt:Url id="taskpaneUrl" DefaultValue="https://mail-rules.drimagri.fr/rules.html?v=1.0.0.0"/>
        <bt:Url id="playgroundUrl" DefaultValue="https://mail-rules.drimagri.fr/playground.html?v=1.0.0.0"/>
      </bt:Urls>
      <bt:ShortStrings>
        <bt:String id="groupLabel" DefaultValue="Assistant"/>
        <bt:String id="buttonLabel" DefaultValue="Assistant Regles"/>
        <bt:String id="playgroundLabel" DefaultValue="Bac a sable"/>
      </bt:ShortStrings>
      <bt:LongStrings>
        <bt:String id="buttonTip" DefaultValue="Analyse votre boite de reception et propose des regles de tri a valider."/>
        <bt:String id="playgroundTip" DefaultValue="Ecrire et executer du code Office.js contre ce message. Outil de developpement."/>
      </bt:LongStrings>
    </Resources>
  </VersionOverrides>
  </VersionOverrides>

</OfficeApp>
