<?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/1.0"
    xsi:type="MailApp">

  <!-- ========================================================= -->
  <!-- Basic Add-in Information                                  -->
  <!-- ========================================================= -->

  <Id>94267f2f-2223-42b5-b889-53e1c4ab915e</Id>

  <Version>3.1.0.0</Version>

  <ProviderName>Whiti Services</ProviderName>

  <DefaultLocale>en-US</DefaultLocale>

  <DisplayName DefaultValue="Link to Freyja"/>

  <Description
      DefaultValue="Link the current email to an Action in Freyja."/>

  <IconUrl
      DefaultValue="https://outlook-app.freyja-test.com/assets/icon-v01-64.png"/>

  <HighResolutionIconUrl
      DefaultValue="https://outlook-app.freyja-test.com/assets/icon-v01-128.png"/>

  <SupportUrl
      DefaultValue="https://outlook-app.freyja-test.com/support"/>

  <AppDomains>
    <AppDomain>https://outlook-app.freyja-test.com</AppDomain>
  </AppDomains>


  <!-- ========================================================= -->
  <!-- Hosts                                                      -->
  <!-- ========================================================= -->

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


  <!-- ========================================================= -->
  <!-- Base Requirements                                         -->
  <!-- ========================================================= -->

  <Requirements>
    <Sets>
      <Set Name="Mailbox" MinVersion="1.3"/>
    </Sets>
  </Requirements>


  <!-- ========================================================= -->
  <!-- Fallback Form Settings                                    -->
  <!-- ========================================================= -->

  <FormSettings>

    <Form xsi:type="ItemRead">

      <DesktopSettings>

        <SourceLocation
            DefaultValue="https://outlook-app.freyja-test.com/taskpane.html"/>

        <RequestedHeight>250</RequestedHeight>

      </DesktopSettings>

    </Form>

  </FormSettings>


  <!-- ========================================================= -->
  <!-- Permissions                                                -->
  <!-- ========================================================= -->

  <Permissions>ReadWriteItem</Permissions>


  <!-- ========================================================= -->
  <!-- Activation Rule                                            -->
  <!-- ========================================================= -->

  <Rule xsi:type="RuleCollection" Mode="Or">

    <Rule
        xsi:type="ItemIs"
        ItemType="Message"
        FormType="Read"/>

  </Rule>

  <DisableEntityHighlighting>false</DisableEntityHighlighting>


  <!-- ========================================================= -->
  <!-- VERSION OVERRIDES V1.0                                    -->
  <!-- IMPORTANT: this outer block must contain ONLY the nested  -->
  <!-- V1.1 block as its child. Do NOT put Requirements/Hosts/   -->
  <!-- Resources directly here as well as inside V1.1 - having   -->
  <!-- them duplicated in both is what breaks new Outlook and    -->
  <!-- Outlook on the web (confirmed pattern on Microsoft Q&A).  -->
  <!-- ========================================================= -->

  <VersionOverrides
      xmlns="http://schemas.microsoft.com/office/mailappversionoverrides"
      xsi:type="VersionOverridesV1_0">


    <!-- ======================================================= -->
    <!-- VERSION OVERRIDES V1.1                                  -->
    <!-- All real config + SSO lives here, and only here.        -->
    <!-- ======================================================= -->

    <VersionOverrides
        xmlns="http://schemas.microsoft.com/office/mailappversionoverrides/1.1"
        xsi:type="VersionOverridesV1_1">

      <Requirements>

        <bt:Sets DefaultMinVersion="1.5">
          <bt:Set Name="Mailbox"/>
        </bt:Sets>

      </Requirements>


      <!-- ===================================================== -->
      <!-- V1.1 Hosts                                             -->
      <!-- ===================================================== -->

      <Hosts>

        <Host xsi:type="MailHost">

          <DesktopFormFactor>


            <ExtensionPoint
                xsi:type="MessageReadCommandSurface">

              <OfficeTab id="TabDefault">

                <Group id="msgReadGroup">

                  <Label resid="GroupLabel"/>


                  <!-- ========================================= -->
                  <!-- Show Task Pane                             -->
                  <!-- ========================================= -->

                  <Control
                      xsi:type="Button"
                      id="msgReadOpenPaneButton">

                    <Label resid="TaskpaneButton.Label"/>

                    <Supertip>

                      <Title resid="TaskpaneButton.Label"/>

                      <Description
                          resid="TaskpaneButton.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>


      <!-- ===================================================== -->
      <!-- V1.1 Resources                                         -->
      <!-- ===================================================== -->

      <Resources>

        <bt:Images>

          <bt:Image
              id="Icon.16x16"
              DefaultValue="https://outlook-app.freyja-test.com/assets/icon-v01-16.png"/>

          <bt:Image
              id="Icon.32x32"
              DefaultValue="https://outlook-app.freyja-test.com/assets/icon-v01-32.png"/>

          <bt:Image
              id="Icon.80x80"
              DefaultValue="https://outlook-app.freyja-test.com/assets/icon-v01-80.png"/>

        </bt:Images>


        <bt:Urls>


          <bt:Url
              id="Taskpane.Url"
              DefaultValue="https://outlook-app.freyja-test.com/taskpane.html"/>

        </bt:Urls>


        <bt:ShortStrings>

          <bt:String
              id="GroupLabel"
              DefaultValue="Link to Freyja"/>

          <bt:String
              id="TaskpaneButton.Label"
              DefaultValue="Link to Freyja"/>



        </bt:ShortStrings>


        <bt:LongStrings>

          <bt:String
              id="TaskpaneButton.Tooltip"
              DefaultValue="Open the Freyja task pane"/>


        </bt:LongStrings>

      </Resources>


      <!-- ===================================================== -->
      <!-- Microsoft Entra ID / Office SSO                       -->
      <!-- MUST BE THE LAST CHILD OF V1.1                        -->
      <!-- ===================================================== -->

      <WebApplicationInfo>

        <Id>79621ef8-41b1-420a-af47-be9d9a0fd556</Id>

        <Resource>api://outlook-app.freyja-test.com/79621ef8-41b1-420a-af47-be9d9a0fd556</Resource>

        <Scopes>
          <Scope>openid</Scope>
          <Scope>profile</Scope>
          <Scope>access_as_user</Scope>
        </Scopes>

      </WebApplicationInfo>

    </VersionOverrides>

  </VersionOverrides>

</OfficeApp>