<?xml version="1.0" encoding="UTF-8" standalone="no"?><config>
	<!-- Requires a link to a valid store offer to show the price -->
	<eval phase="begin" expression="#item = #catalog.getItemById(#stanza.typeRef)" />
	<eval phase="begin" expression="#completableItem = #catalog.getStoreItemById(#item.id)" />
	<eval phase="begin" expression="#firstSlotCost = #completableItem.wildCardCost.value" />
	<eval phase="begin" expression="#userCurrencyValue = #user.user.getCurrency(#completableItem.wildCardCost.currencyRef)" />

	<if expression='#height == null || #height == ""'>
		<eval phase="begin" expression="#height = ~Constants.BUTTON_HEIGHT" />
	</if>

	<if expression='#width == null || #width == ""'>
		<eval phase="begin" expression="#width = 232" />
	</if>

	<!-- Setting variable for One Tap Claim -->
	<if expression='#oneTapClaim == null || #oneTapClaim == ""'>
		<eval phase="begin" expression="#oneTapClaim = 'false'" />
	</if>

	<!-- Setting variable for Auto Switch Summary -->
	<if expression='#autoSummaryToOneTapClaim == null || #autoSummaryToOneTapClaim == ""'>
		<eval phase="begin" expression="#autoSummaryToOneTapClaim = 'false'" />
	</if>
	
	<if expression='#firstSlotCost == null || #firstSlotCost == ""'>
		<eval phase="begin" expression="#firstSlotCost = 0" />
	</if>

	<!--||||||||||||||||| SETTING DEFAULT VALUES FOR BUTTON TEXT |||||||||||||||||-->
	<!-- Setting variable for Normal Button Text -->
	<if expression='#claimText == null || #claimText == ""'>
		<eval phase="begin" expression="#claimText = 'Stanza_Claim'" />
	</if>
	<!-- Setting variable for Normal Button Text -->
	<if expression='#purchaseText == null || #purchaseText == ""'>
		<eval phase="begin" expression="#purchaseText = 'Common_Purchase'" />
	</if>
	<!-- Setting variable for Normal Button Text -->
	<if expression='#summaryText == null || #summaryText == ""'>
		<eval phase="begin" expression="#summaryText = 'Store_Details'" />
	</if>
	<!-- Setting variable for Limit Reached Text -->
	<if expression='#textLimitReached == null || #textLimitReached == ""'>
		<eval phase="begin" expression="#textLimitReached = 'generic_text_claimed'" />
	</if>
	<!-- Setting variable for Limit Reached Text -->
	<if expression='#textPurchaseLimitReached == null || #textPurchaseLimitReached == ""'>
		<eval phase="begin" expression="#textPurchaseLimitReached = 'Common_Purchased'" />
	</if>
	<!-- Setting variable for locked Text -->
	<if expression='#textLocked == null || #textLocked == ""'>
		<if expression='(#stanza.lockText) == null || (#stanza.lockText) == ""'>
			<eval phase="begin" expression="#textLocked = 'Common_Locked'" />
		</if>
		<if expression='(#stanza.lockText) != null && (#stanza.lockText) != ""'>
			<eval phase="begin" expression="#textLocked = #stanza.lockText" />
		</if>
	</if>

	<!-- If pack limit isnt reached or and button is unlocked, show the regular button text -->
	<if expression='(#catalog.isPackPurchaseLimitMet(#stanza.typeRef, #stanza.id)) == false && (#stanza.isUnlocked) == true'>
		<eval phase="begin" expression="#claimButtonText = #claimText" />
		<eval phase="begin" expression="#purchaseButtonText = #purchaseText" />
	</if>
	<!-- If pack limit isnt reached or and button is unlocked, show the regular button text -->
	<if expression='(#catalog.isPackPurchaseLimitMet(#stanza.typeRef, #stanza.id)) == true && (#completableItem.completionLimit <= 0 || #completableItem.wildcardCompletionLimit <= 0)'>
		<eval phase="begin" expression="#claimButtonText = #claimText" />
		<eval phase="begin" expression="#purchaseButtonText = #purchaseText" />
	</if>
	<!-- show the regular summary button text -->
	<eval phase="begin" expression="#summaryButtonText = #summaryText" />
	<!-- If pack limit is reached, show the limit reached button text -->
	<if expression='(#catalog.isPackPurchaseLimitMet(#stanza.typeRef, #stanza.id)) == true && (#completableItem.completionLimit > 0 || #completableItem.wildcardCompletionLimit > 0)'>
		<eval phase="begin" expression="#claimButtonText = #textLimitReached" />
		<eval phase="begin" expression="#purchaseButtonText = #textPurchaseLimitReached" />
	</if>
	<!-- If button is locked, show locked text -->
	<if expression='(#stanza.isUnlocked) == false'>
		<eval phase="begin" expression="#claimButtonText = #textLocked" />
		<eval phase="begin" expression="#purchaseButtonText = #textLocked" />
	</if>
	
	<!--||||||||||||||||| END |||||||||||||||||-->

	<if expression='#oneTapClaim == "true"'>
		<if expression='#firstSlotCost <= 0'>
			<element bind-id="regularButton" bind-type="madden.ui.element.button.OneTapStorePurchaseButton"
				width="${#width}"
				height="${#height}"
				label="${#lang(#claimButtonText)}"
				isInteractive="${#campaign.isPlayable(#stanza)}"
				buttonStyle="1"
				currency="${#completableItem.wildCardCost.currencyRef}"
				stanza="${#stanza}">
			</element>
		</if>

		<if expression='#firstSlotCost > 0'>
			<element bind-id="purchaseButton" bind-type="madden.ui.element.button.OneTapStorePurchaseButton"
				width="${#width}"
				height="${#height}"
				label="${#lang(#purchaseButtonText)}"
				currency="${#completableItem.wildCardCost.currencyRef}"
				price="${#firstSlotCost}"
				isInteractive="${#campaign.isPlayable(#stanza)}"
				stanza="${#stanza}">
			</element>
		</if>
	</if>

	<!-- Summary Panel -->
	<if expression='#oneTapClaim != "true"'>
		<if expression='#autoSummaryToOneTapClaim != "true" || (#autoSummaryToOneTapClaim == "true" && #userCurrencyValue < #firstSlotCost && (#catalog.isPackPurchaseLimitMet(#stanza.typeRef, #stanza.id)) != true)'>
			<element bind-id="regularButton" bind-type="madden.ui.element.button.RectangleButton"
				width="${#width}"
				height="${#height}"
				label="${#lang(#summaryButtonText)}"
				buttonStyle="1">
					<activate expression="#campaign.stanzaSummary(true, #stanza)"/>
			</element>
		</if>

		<!-- Switches to a claim button when cost is reached -->
		<if expression='#autoSummaryToOneTapClaim == "true" && (#userCurrencyValue >= #firstSlotCost || (#catalog.isPackPurchaseLimitMet(#stanza.typeRef, #stanza.id)) == true && (#completableItem.completionLimit > 0 || #completableItem.wildcardCompletionLimit > 0))'>
			<if expression='#firstSlotCost <= 0'>
				<element bind-id="regularButton" bind-type="madden.ui.element.button.OneTapStorePurchaseButton"
					width="${#width}"
					height="${#height}"
					label="${#lang(#claimButtonText)}"
					isInteractive="${#campaign.isPlayable(#stanza)}"
					currency="${#completableItem.wildCardCost.currencyRef}"
					buttonStyle="1"
					stanza="${#stanza}">
				</element>
			</if>

			<if expression='#firstSlotCost > 0'>
				<element bind-id="purchaseButton" bind-type="madden.ui.element.button.OneTapStorePurchaseButton"
					width="${#width}"
					height="${#height}"
					label="${#lang(#purchaseButtonText)}"
					currency="${#completableItem.wildCardCost.currencyRef}"
					price="${#firstSlotCost}"
					isInteractive="${#campaign.isPlayable(#stanza)}"
					stanza="${#stanza}">
				</element>
			</if>
		</if>
	</if>
</config>
