<core:FragmentDefinition xmlns:build="sap.build" xmlns:core="sap.ui.core" xmlns:l="sap.ui.layout" xmlns:ovp="sap.ovp.ui"
  xmlns:template="http://schemas.sap.com/sapui5/extension/sap.ui.core.template/1"
  xmlns:app="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1" xmlns="sap.m" xmlns:f="sap.f">
  <HBox id="ovpListRow" class="sapOvpLinkListStandardHBox cardType">
    <customData>
      <ovp:CustomData key="aria-label" value="{ovplibResourceBundle>linkListType}" writeToDom="true" />
    </customData>
    <List id="ovpLinkList"
      class="{= ${ovpCardProperties>/densityStyle} === 'cozy' ? 'sapOvpLinkListStandardPaddingCozy' : 'sapOvpLinkListStandardPaddingCompact'}"
      showSeparators="None"
      items="{parts:[{path:'entitySet>'}, {path:'header>'}], formatter: 'sap.ovp.cards.linklist.AnnotationHelper.formatItems'}">
      <template:with helper="sap.ovp.cards.AnnotationHelper.resolveEntityTypePath" path='ovpCardProperties>/identificationAnnotationPath' var='identification'>
        <CustomListItem id="ovpCLI" type="Active" press="{= ${path: 'identification>0/Action', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'} ? 'onLinkNavigationSingleTarget'
          : ${path: 'entityType>com.sap.vocabularies.UI.v1.LineItem/0/Action', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'} ? 'onLinkListActionPress'
          : ${path: 'entityType>com.sap.vocabularies.UI.v1.LineItem/0/Url', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'} ? 'onLinkListLineItemUrl'
          : ${path: 'entityType>com.sap.vocabularies.Communication.v1.Contact', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'} ? ''
          : ''}"
          app:dataAction="{path: 'entityType>com.sap.vocabularies.UI.v1.LineItem/0/Action', formatter: 'sap.ui.model.odata.AnnotationHelper.format'}">
          <HBox
            class="{= ${ovpCardProperties>/densityStyle} === 'cozy' &amp;&amp; !${header>ImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; !${header>Description/Value}) ? 'sapOvpCozyTitle'
            : ( ${ovpCardProperties>/densityStyle} === 'cozy') &amp;&amp; ${header>ImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; !${header>Description/Value}) ? 'sapOvpCozyTitleImage'
            : ( ${ovpCardProperties>/densityStyle} === 'cozy') &amp;&amp; ${header>TypeImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; !${header>Description/Value}) ? 'sapOvpCozyTitleIcon'
            : ( ${ovpCardProperties>/densityStyle} === 'cozy') &amp;&amp; !${header>ImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; ${header>Description/Value}) ? 'sapOvpCozyTitleSubtitle'
            : ( ${ovpCardProperties>/densityStyle} === 'cozy') &amp;&amp; ${header>ImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; ${header>Description/Value}) ? 'sapOvpCozyTitleImageSubtitle'
            : ( ${ovpCardProperties>/densityStyle} === 'cozy') &amp;&amp; ${header>TypeImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; ${header>Description/Value}) ? 'sapOvpCozyTitleIconSubtitle'
            : ${ovpCardProperties>/densityStyle} === 'compact' &amp;&amp; !${header>ImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; !${header>Description/Value}) ? 'sapOvpCompactTitle'
            : ( ${ovpCardProperties>/densityStyle} === 'compact') &amp;&amp; ${header>ImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; !${header>Description/Value}) ? 'sapOvpCompactTitleImage'
            : ( ${ovpCardProperties>/densityStyle} === 'compact') &amp;&amp; ${header>TypeImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; !${header>Description/Value}) ? 'sapOvpCompactTitleIcon'
            : ( ${ovpCardProperties>/densityStyle} === 'compact') &amp;&amp; !${header>ImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; ${header>Description/Value}) ? 'sapOvpCompactTitleSubtitle'
            : ( ${ovpCardProperties>/densityStyle} === 'compact') &amp;&amp; ${header>ImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; ${header>Description/Value}) ? 'sapOvpCompactTitleImageSubtitle'
            : ( ${ovpCardProperties>/densityStyle} === 'compact') &amp;&amp; ${header>TypeImageUrl} &amp;&amp; (${header>Title/Value} &amp;&amp; ${header>Description/Value}) ? 'sapOvpCompactTitleIconSubtitle'
            : 'ovpDefaultClass'}
            {= ${path: 'identification>0/Action', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'} ? ''
            : ${path: 'entityType>com.sap.vocabularies.UI.v1.LineItem/0/Action', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'} ? ''
            : ${path: 'entityType>com.sap.vocabularies.UI.v1.LineItem/0/Url', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'} ? ''
            : ${path: 'entityType>com.sap.vocabularies.Communication.v1.Contact', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'} ? 'linkListHasPopover'
            : ''} ">
            <template:if
              test="{= ${header>ImageUrl} || ${header>TypeImageUrl}}">
              <template:then>
                <VBox class="sapOvpLinkListItem {= ${ovpCardProperties>/densityStyle} === 'cozy' ? 'sapOvpLinkListItemImageCozy' : 'sapOvpLinkListItemImageCompact' }">
                  <template:if
                    test="{path: 'header>ImageUrl', formatter: 'sap.ui.model.odata.AnnotationHelper.format'}">
                    <template:then>
                      <template:if test="{= ${ovpCardProperties>/densityStyle} === 'cozy'}">
                        <template:then>
                          <FlexBox height="40px">
                            <f:Avatar id="linkListImage"
                              class="sapUiSmallMarginEnd"
                              displayShape="Circle" displaySize="Custom"
                              customDisplaySize="40px"
                              src="{path: 'header>ImageUrl', formatter: 'sap.ui.model.odata.AnnotationHelper.format'}"
                              initials="{path: 'header>Initials', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.getAvatarInitials'}"></f:Avatar>
                            </FlexBox>
                          </template:then>
                          <template:else>
                            <FlexBox height="40px">
                              <f:Avatar id="linkListImage"
                                class="sapUiSmallMarginEnd"
                                displayShape="Circle" displaySize="Custom"
                                customDisplaySize="36px"
                                src="{path: 'header>ImageUrl', formatter: 'sap.ui.model.odata.AnnotationHelper.format'}"
                                initials="{path: 'header>Initials', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.getAvatarInitials'}"></f:Avatar>
                              </FlexBox>
                            </template:else>
                          </template:if>
                        </template:then>
                        <template:else>
                          <FlexBox height="40px">
                            <core:Icon id="linkListIcon" size="24px" class="sapOvpLinkListImageCenter"
                              src="{path: 'header>TypeImageUrl', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.getIconPath'}"/>
                            </FlexBox>
                          </template:else>
                        </template:if>
                      </VBox>
                    </template:then>
                  </template:if>
                  <VBox class="sapOvpLinkListItem">
                    <template:if
                      test="{path: 'identification>0/Action', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'}">
                      <template:then>
                        <!--  navigation from identification annotation and quick view from contact annotation -->
                        <template:if
                          test="{path: 'entityType>com.sap.vocabularies.Communication.v1.Contact', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'}">
                          <template:then>
                            <template:with helper="sap.ovp.cards.AnnotationHelper.resolveEntityTypePath"
                             path='ovpCardProperties>/communicationPath' var='contact'>
                             <template:if test="{contact>}">
                              <core:Fragment fragmentName="sap.ovp.cards.generic.ContactDetails"
                               type="XML"/>
                               <Link id="linkListTitleLabel" press="onLinkPopover"
                                class="{= ${header>Description/Value} || !${header>Description/Value} &amp;&amp; !${header>ImageUrl} &amp;&amp; !${header>TypeImageUrl} ? 'sapOvpCardLinkListTitle' : 'sapOvpCardLinkListTitleOnly'}"
                                text="{path: 'header>Title', formatter: 'sap.ovp.cards.AnnotationHelper.formatField'}"/>
                              </template:if>
                            </template:with>
                          </template:then>
                          <!-- only  navigation from identification -->
                          <template:else>
                            <Label id="linkListTitleLabel"
                             class="{= ${header>Description/Value} || !${header>Description/Value} &amp;&amp; !${header>ImageUrl} &amp;&amp; !${header>TypeImageUrl} ? 'sapOvpCardLinkListTitle' : 'sapOvpCardLinkListTitleOnly'}"
                             text="{path: 'header>Title', formatter: 'sap.ovp.cards.AnnotationHelper.formatField'}"/>
                           </template:else>
                         </template:if>
                       </template:then>
                       <template:elseif
                        test="{path: 'entityType>com.sap.vocabularies.UI.v1.LineItem/0/Action', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'}">
                        <!--  navigation from lineitem annotation and quick view from contact annotation -->
                        <template:if
                          test="{path: 'entityType>com.sap.vocabularies.Communication.v1.Contact', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'}">
                          <template:then>
                            <template:with helper="sap.ovp.cards.AnnotationHelper.resolveEntityTypePath"
                             path='ovpCardProperties>/communicationPath' var='contact'>
                             <template:if test="{contact>}">
                              <core:Fragment fragmentName="sap.ovp.cards.generic.ContactDetails"
                               type="XML"/>
                               <Link id="linkListTitleLabel" press="onLinkPopover"
                                class="{= ${header>Description/Value} || !${header>Description/Value} &amp;&amp; !${header>ImageUrl} &amp;&amp; !${header>TypeImageUrl} ? 'sapOvpCardLinkListTitle' : 'sapOvpCardLinkListTitleOnly'}"
                                text="{path: 'header>Title', formatter: 'sap.ovp.cards.AnnotationHelper.formatField'}"/>
                              </template:if>
                            </template:with>
                          </template:then>
                          <!-- only  navigation from lineitem -->
                          <template:else>
                            <Label id="linkListTitleLabel"
                             class="{= ${header>Description/Value} || !${header>Description/Value} &amp;&amp; !${header>ImageUrl} &amp;&amp; !${header>TypeImageUrl} ? 'sapOvpCardLinkListTitle' : 'sapOvpCardLinkListTitleOnly'}"
                             app:dataAction="{path: 'entityType>com.sap.vocabularies.UI.v1.LineItem/0/Action', formatter: 'sap.ui.model.odata.AnnotationHelper.format'}"
                             text="{path: 'header>Title', formatter: 'sap.ovp.cards.AnnotationHelper.formatField'}"/>
                           </template:else>
                         </template:if>
                       </template:elseif>
                       <template:elseif
                        test="{path: 'entityType>com.sap.vocabularies.UI.v1.LineItem/0/Url', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'}">
                        <!--  navigation from lineitem annotation and quick view from contact annotation -->
                        <template:if
                          test="{path: 'entityType>com.sap.vocabularies.Communication.v1.Contact', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'}">
                          <template:then>
                            <template:with helper="sap.ovp.cards.AnnotationHelper.resolveEntityTypePath"
                             path='ovpCardProperties>/communicationPath' var='contact'>
                             <template:if test="{contact>}">
                              <core:Fragment fragmentName="sap.ovp.cards.generic.ContactDetails"
                               type="XML"/>
                               <Link id="linkListTitleLabel" press="onLinkPopover"
                                class="{= ${header>Description/Value} || !${header>Description/Value} &amp;&amp; !${header>ImageUrl} &amp;&amp; !${header>TypeImageUrl} ? 'sapOvpCardLinkListTitle' : 'sapOvpCardLinkListTitleOnly'}"
                                text="{path: 'header>Title', formatter: 'sap.ovp.cards.AnnotationHelper.formatField'}"/>
                              </template:if>
                            </template:with>
                          </template:then>
                          <!-- only  navigation from lineitem -->
                          <template:else>
                            <Label id="linkListTitleLabel"
                             target="_blank"
                             class="{= ${header>Description/Value} || !${header>Description/Value} &amp;&amp; !${header>ImageUrl} &amp;&amp; !${header>TypeImageUrl} ? 'sapOvpCardLinkListTitle' : 'sapOvpCardLinkListTitleOnly'}"
                             text="{path: 'header>Title', formatter: 'sap.ovp.cards.AnnotationHelper.formatField'}"/>
                           </template:else>
                         </template:if>
                       </template:elseif>
                       <!--  to show contact info on click of title -->
                       <template:elseif
                        test="{path: 'entityType>com.sap.vocabularies.Communication.v1.Contact', formatter: 'sap.ovp.cards.linklist.AnnotationHelper.linkedAction'}">
                        <template:with helper="sap.ovp.cards.AnnotationHelper.resolveEntityTypePath" path='ovpCardProperties>/communicationPath' var='contact'>
                          <template:if test="{contact>}">
                            <core:Fragment fragmentName="sap.ovp.cards.generic.ContactDetails" type="XML"/>
                            <Link id="linkListTitleLabel" press="onLinkPopover"
                              class="{= ${header>Description/Value} || !${header>Description/Value} &amp;&amp; !${header>ImageUrl} &amp;&amp; !${header>TypeImageUrl} ? 'sapOvpCardLinkListTitle' : 'sapOvpCardLinkListTitleOnly'}"
                              text="{path: 'header>Title', formatter: 'sap.ovp.cards.AnnotationHelper.formatField'}"/>
                            </template:if>
                          </template:with>
                        </template:elseif>
                        <!-- only  Label no navigation no quickview -->
                        <template:else>
                          <Label id="linkListTitleLabel"
                            class="{= ${header>Description/Value} || !${header>Description/Value} &amp;&amp; !${header>ImageUrl} &amp;&amp; !${header>TypeImageUrl} ? 'sapOvpCardLinkListTitle' : 'sapOvpCardLinkListTitleOnly'}"
                            text="{path: 'header>Title', formatter: 'sap.ovp.cards.AnnotationHelper.formatField'}"/>
                          </template:else>
                        </template:if>
                        <!-- heder info description-->
                        <template:if test="{header>Description/Value}">
                          <template:then>
                            <Label id="linkListSubTitleLabel"
                             class="sapOvpCardLinkListSubTitle"
                             text="{path: 'header>Description', formatter: 'sap.ovp.cards.AnnotationHelper.formatField'}"/>
                           </template:then>
                         </template:if>
                       </VBox>
                     </HBox>
                   </CustomListItem>
                 </template:with>
               </List>
             </HBox>
           </core:FragmentDefinition>