/*!
 * Crafted with ❤ by Salla
 */
'use strict';

var index = require('./index-vstkdqRz.js');
var functions = require('./functions-DlISHrKx.js');
var gift = require('./gift-DbNivqYO.js');
var cart2 = require('./cart2-B98PSAFN.js');
var userAdd = require('./user-add-BCGrddZS.js');
var mail = require('./mail-Bgvt2hc9.js');
var calendar = require('./calendar-D-PUoCDH.js');
var iphoneX = require('./iphone-x-qC21wCLj.js');
var location = require('./location-DIyESLuI.js');
var shipping = require('./shipping-CPYcgyCL.js');

const sallaLoyaltyProgramCss$1 = "";

const SallaLoyaltyHero = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    render() {
        return (index.h(index.Host, { key: '71421d1a559f9d0b8b9a2023e3015847dd4be7fb' }, index.h("section", { key: '914ae35d2e038a4f0f358eb3d61352cf263f4c7b', class: "s-loyalty-program-hero-container" }, index.h("div", { key: '93353d9f4dcc7d41e4c714f93ee84899b799633e', class: "s-loyalty-program-hero-background", style: {
                backgroundImage: `url(${this.image})`,
            } }, this.image ? index.h("div", { class: "s-loyalty-program-hero-overlay" }) : '', index.h("div", { key: '6f62cb4aadbb81f91549b60177f15e8791e6aa51', class: {
                's-loyalty-program-hero-content': true,
                's-loyalty-program-hero-white': !!this.image,
                's-loyalty-program-hero-gray': !this.image,
            } }, index.h("div", { key: '11794269898ee42023cac29e49c17463fe90781b' }, index.h("h1", { key: '95435290b38fce9dbc6a580d8452e7189074773b', class: "s-loyalty-program-hero-title" }, this.name || index.h("span", { key: '02fbbae525a5973d65bb98626dbe5712374495c4', style: { color: 'transparent', backgroundColor: '#666', borderRadius: '12px' } }, "name")), index.h("p", { key: 'e482ab6a067d54b9c274208a43b286e07a8e471c', class: "s-loyalty-program-hero-description" }, this.description || index.h("span", { key: '2fc2ea5a732e473b2c26d3b885a699b57f7df0c1', style: { color: 'transparent', backgroundColor: '#666', borderRadius: '12px' } }, "description"))), index.h("slot", { key: 'd548c168c97849abd583b510c7b1d6c4370daa1c', name: "action" }))), index.h("div", { key: '2423ee04e5e126eabcbfec20ad6c82a8d2593d2a', class: "s-loyalty-program-hero-footer" }, index.h("div", { key: '25ee4e74c9ea3c0ea420a09858c45b83b454bd40', class: "s-loyalty-program-hero-slot-container" }, index.h("slot", { key: '11a7147bc142914ccfa08b099826a4a2805100aa', name: "crosspoint" }))))));
    }
};
SallaLoyaltyHero.style = sallaLoyaltyProgramCss$1;

var SIStore = `<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<title>store</title>
<path d="M27.25 16c-1.539-0.010-2.899-0.765-3.741-1.921l-0.009-0.013c-0.844 1.178-2.209 1.936-3.75 1.936s-2.906-0.758-3.741-1.922l-0.009-0.014c-0.844 1.178-2.209 1.936-3.75 1.936s-2.906-0.758-3.741-1.922l-0.009-0.014c-0.851 1.169-2.211 1.924-3.748 1.934h-0.002c-2.64-0.075-4.751-2.233-4.751-4.884 0-0.041 0.001-0.081 0.002-0.122l-0 0.006c0-0.086 0.011-0.169 0.032-0.249l-0.002 0.007 2-8c0.112-0.439 0.504-0.758 0.97-0.758h26c0.466 0 0.858 0.319 0.968 0.751l0.002 0.007 2 8c0.019 0.073 0.030 0.156 0.030 0.242v0c0.001 0.034 0.001 0.075 0.001 0.116 0 2.651-2.111 4.809-4.744 4.884l-0.007 0zM23.5 10c0.552 0 1 0.448 1 1v0c-0.006 0.069-0.010 0.149-0.010 0.23 0 1.522 1.234 2.756 2.756 2.756s2.756-1.234 2.756-2.756c0-0.040-0.001-0.080-0.003-0.12l0 0.006-1.782-7.116h-24.436l-1.782 7.116c0 0.003-0 0.007-0 0.011 0 1.544 1.217 2.804 2.744 2.873l0.006 0c1.535-0.073 2.752-1.336 2.752-2.883 0-0.041-0.001-0.082-0.003-0.123l0 0.006c0-0.552 0.448-1 1-1s1 0.448 1 1v0c-0.002 0.035-0.002 0.076-0.002 0.117 0 1.547 1.217 2.81 2.746 2.883l0.007 0c1.535-0.073 2.752-1.336 2.752-2.883 0-0.041-0.001-0.082-0.003-0.123l0 0.006c0-0.552 0.448-1 1-1s1 0.448 1 1v0c-0.002 0.035-0.002 0.076-0.002 0.117 0 1.547 1.217 2.81 2.746 2.883l0.007 0c1.535-0.073 2.752-1.336 2.752-2.883 0-0.041-0.001-0.082-0.003-0.123l0 0.006c0-0.552 0.448-1 1-1v0zM13 30h-10c-0.552 0-1-0.448-1-1v0-14.46c0-0.552 0.448-1 1-1s1 0.448 1 1v0 13.46h9c0.552 0 1 0.448 1 1s-0.448 1-1 1v0zM29 30h-10c-0.552 0-1-0.448-1-1s0.448-1 1-1v0h9v-13.46c0-0.552 0.448-1 1-1s1 0.448 1 1v0 14.46c0 0.552-0.448 1-1 1v0zM19 30c-0.552 0-1-0.448-1-1v0-7h-4v7c0 0.552-0.448 1-1 1s-1-0.448-1-1v0-8c0-0.552 0.448-1 1-1v0h6c0.552 0 1 0.448 1 1v0 8c0 0.552-0.448 1-1 1v0z"></path>
</svg>
`;

var SIChatConversationAlt = `<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<title>chat-conversation-alt</title>
<path d="M17.333 14.667h-8c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h8c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM22.667 8h-13.333c-0.737 0-1.333 0.597-1.333 1.333s0.596 1.333 1.333 1.333h13.333c0.737 0 1.333-0.597 1.333-1.333s-0.596-1.333-1.333-1.333zM28 0h-24c-2.205 0-4 1.795-4 4v17.333c0 2.205 1.795 4 4 4h6.027l4.932 6.167c0.253 0.316 0.636 0.5 1.041 0.5s0.788-0.184 1.041-0.5l4.932-6.167h6.027c2.205 0 4-1.795 4-4v-17.333c0-2.205-1.795-4-4-4zM29.333 21.333c0 0.735-0.597 1.333-1.333 1.333h-6.667c-0.405 0-0.788 0.184-1.041 0.5l-4.292 5.365-4.292-5.365c-0.253-0.316-0.636-0.5-1.041-0.5h-6.667c-0.736 0-1.333-0.599-1.333-1.333v-17.333c0-0.735 0.597-1.333 1.333-1.333h24c0.736 0 1.333 0.599 1.333 1.333z"></path>
</svg>
`;

var SILink1 = `<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<title>link1</title>
<path d="M16.541 19.873c-0.489 0.205-0.825 0.68-0.825 1.233 0 0.184 0.037 0.359 0.105 0.519l-0.003-0.009c0.064 0.151 0.101 0.326 0.101 0.51 0 0.368-0.149 0.702-0.391 0.943v0l-3.771 3.772c-0.483 0.482-1.149 0.781-1.885 0.781s-1.403-0.298-1.885-0.781l-2.829-2.828c-0.483-0.483-0.781-1.149-0.781-1.886s0.299-1.403 0.781-1.886l3.776-3.771c0.244-0.24 0.578-0.388 0.948-0.388 0.183 0 0.357 0.036 0.516 0.102l-0.009-0.003c0.15 0.064 0.325 0.101 0.509 0.101 0.736 0 1.334-0.597 1.334-1.334 0-0.553-0.337-1.027-0.816-1.229l-0.009-0.003c-0.449-0.187-0.97-0.295-1.517-0.295-1.107 0-2.11 0.445-2.841 1.165l0-0-3.776 3.771c-0.963 0.966-1.559 2.299-1.559 3.771s0.596 2.805 1.559 3.771l2.829 2.828c0.965 0.965 2.298 1.562 3.771 1.562s2.806-0.597 3.771-1.562l3.772-3.771c0.723-0.725 1.171-1.726 1.171-2.832 0-0.551-0.111-1.076-0.312-1.555l0.010 0.026c-0.206-0.488-0.68-0.824-1.232-0.824-0.184 0-0.359 0.037-0.518 0.104l0.009-0.003z"></path>
<path d="M10.343 21.655c0.243 0.238 0.576 0.384 0.943 0.384s0.7-0.147 0.943-0.385l-0 0 10.372-10.371c0.232-0.24 0.374-0.566 0.374-0.926 0-0.736-0.597-1.333-1.333-1.333-0.36 0-0.687 0.143-0.927 0.375l-10.372 10.37c-0.241 0.241-0.39 0.575-0.39 0.943s0.149 0.701 0.39 0.943v0z"></path>
<path d="M28.728 6.099l-2.828-2.828c-0.966-0.963-2.299-1.559-3.771-1.559s-2.805 0.596-3.771 1.559l-3.772 3.771c-0.723 0.725-1.171 1.726-1.171 2.831 0 0.551 0.111 1.076 0.313 1.554l-0.010-0.026c0.206 0.488 0.68 0.824 1.233 0.824 0.737 0 1.334-0.597 1.334-1.334 0-0.184-0.037-0.359-0.104-0.518l0.003 0.009c-0.063-0.15-0.1-0.324-0.1-0.506 0-0.368 0.149-0.7 0.389-0.942l3.771-3.771c0.483-0.483 1.149-0.781 1.886-0.781s1.403 0.299 1.886 0.781l2.828 2.828c0.483 0.483 0.781 1.149 0.781 1.886s-0.299 1.403-0.781 1.886v0l-3.776 3.764c-0.244 0.24-0.579 0.388-0.948 0.388-0.183 0-0.357-0.036-0.515-0.102l0.009 0.003c-0.151-0.064-0.326-0.101-0.51-0.101-0.737 0-1.334 0.597-1.334 1.334 0 0.553 0.336 1.027 0.815 1.229l0.009 0.003c0.45 0.189 0.974 0.298 1.523 0.298 1.106 0 2.109-0.445 2.838-1.167l3.77-3.77c0.965-0.966 1.562-2.301 1.562-3.775 0-1.471-0.595-2.803-1.557-3.769l0 0z"></path>
</svg>
`;

var SIUser = `<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<title>user</title>
<path d="M16 16c4.412 0 8-3.588 8-8s-3.588-8-8-8-8 3.588-8 8 3.588 8 8 8zM16 2.667c2.941 0 5.333 2.392 5.333 5.333s-2.392 5.333-5.333 5.333-5.333-2.392-5.333-5.333 2.392-5.333 5.333-5.333zM16 18.667c-7.476 0-13.333 3.66-13.333 8.333v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-3.019 4.984-5.667 10.667-5.667s10.667 2.648 10.667 5.667v3.667c0 0.736 0.597 1.333 1.333 1.333s1.333-0.597 1.333-1.333v-3.667c0-4.673-5.857-8.333-13.333-8.333z"></path>
</svg>
`;

var SIMapLocation = `<!-- Generated by IcoMoon.io -->
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" width="32" height="32" viewBox="0 0 32 32">
<title>map-location</title>
<path d="M24.667 8.013v-0.013c0-0.736-0.597-1.327-1.333-1.327s-1.333 0.604-1.333 1.34 0.597 1.333 1.333 1.333 1.333-0.597 1.333-1.333zM30.667 18.667c-0.736 0-1.333 0.596-1.333 1.333v8.701l-7.879-3.135c-0.308-0.127-0.651-0.127-0.961-0.011l-9.817 3.684-8.009-3.121v-20.351l7.633 2.181c0.708 0.205 1.447-0.209 1.648-0.916 0.203-0.708-0.207-1.447-0.915-1.648l-9.333-2.667c-0.403-0.115-0.836-0.035-1.169 0.217-0.335 0.252-0.531 0.645-0.531 1.064v23.029c0 0.549 0.337 1.043 0.849 1.243l9.333 3.637c0.305 0.12 0.645 0.12 0.952 0.007l9.812-3.68 9.227 3.669c0.16 0.064 0.327 0.095 0.493 0.095 0.263 0 0.525-0.079 0.749-0.231 0.365-0.247 0.584-0.661 0.584-1.103v-10.667c0-0.737-0.597-1.333-1.333-1.333zM23.333 22.667c0.395 0 0.769-0.175 1.023-0.476 0.783-0.935 7.644-9.241 7.644-13.357 0-4.389-2.976-8.833-8.667-8.833-5.689 0-8.667 4.444-8.667 8.833 0 4.116 6.863 12.423 7.645 13.357 0.253 0.301 0.628 0.476 1.021 0.476zM23.333 2.667c4.145 0 6 3.097 6 6.167 0 2.095-3.347 7.027-6 10.385-2.653-3.36-6-8.291-6-10.385 0-3.069 1.856-6.167 6-6.167z"></path>
</svg>
`;

const sallaLoyaltyProgramCss = "";

/**
 * Dashboard sicons:
 * share - sicon-share-alt
 * order from store - sicon-shopping-basket
 * rate order - sicon-chat-conversation-alt
 * order from app - sicon-iphone-x
 * first order - sicon-add-to-cart
 * pos - sicon-store
 * fill profile - sicon-user-add
 */
const sicons = {
    'FIRST_ORDER_STORE_FOR_UNIT': index.h("span", { innerHTML: cart2.SICart2 }),
    'FIRST_ORDER_STORE_FIX_AMOUNT': index.h("span", { innerHTML: cart2.SICart2 }),
    'ORDER_FROM_APP_FOR_UNIT': index.h("span", { innerHTML: cart2.SICart2 }),
    'ORDER_FROM_APP_FIX_AMOUNT': index.h("span", { innerHTML: cart2.SICart2 }),
    'CONDITION_RATING_SHIPPING_STORE': index.h("span", { innerHTML: SIStore }),
    'CONDITION_RATING_PRODUCT': index.h("span", { innerHTML: SIChatConversationAlt }),
    'CONDITION_RATING_SHIPPING_COMPANY': index.h("span", { innerHTML: shipping.SIShipping }),
    'CONDITION_COMPLETE_PERSONAL_INFORMATION_BIRTHDAY': index.h("span", { innerHTML: calendar.SICalendar }),
    'CONDITION_COMPLETE_PERSONAL_INFORMATION_EMAIL': index.h("span", { innerHTML: mail.SIMail }),
    'CONDITION_COMPLETE_PERSONAL_INFORMATION_MOBILE': index.h("span", { innerHTML: iphoneX.SIiPhoneX }),
    'CONDITION_COMPLETE_PERSONAL_INFORMATION_GENDER': index.h("span", { innerHTML: SIUser }),
    'CONDITION_BUY_FROM_STORE_FOR_UNIT': index.h("span", { innerHTML: cart2.SICart2 }),
    'CONDITION_BUY_FROM_STORE_FIX_AMOUNT': index.h("span", { innerHTML: cart2.SICart2 }),
    'order_from_pos_1': index.h("span", { innerHTML: iphoneX.SIiPhoneX }),
    'order_from_pos_2': index.h("span", { innerHTML: location.Location }),
    'buy_from_pos_1': index.h("span", { innerHTML: SIMapLocation }),
    'buy_from_pos_2': index.h("span", { innerHTML: iphoneX.SIiPhoneX }),
    'CONDITION_BUY_FROM_POS_FOR_UNIT': index.h("span", { innerHTML: iphoneX.SIiPhoneX }),
    'CONDITION_BUY_FROM_POS_FIX_AMOUNT': index.h("span", { innerHTML: iphoneX.SIiPhoneX }),
    'affiliate_link_1': index.h("span", { innerHTML: SILink1 }),
    'affiliate_link_2': index.h("span", { innerHTML: userAdd.SIUserAdd }),
    'affiliate_link_3': index.h("span", { innerHTML: cart2.SICart2 }),
    'CONDITION_AFFILIATE_LINK': index.h("span", { innerHTML: SILink1 }),
};
const SallaLoyaltyPoint = class {
    constructor(hostRef) {
        index.registerInstance(this, hostRef);
    }
    async handleShareAction(e, point, successText) {
        const isDesktop = window.matchMedia('(min-width: 1024px)').matches;
        // only on mobile/tablet devices
        if ('share' in navigator && !isDesktop) {
            try {
                await navigator.share({
                    title: document.title,
                    url: point.url,
                });
                return;
            }
            catch (error) { }
        }
        const el = e.target;
        const oldTextContent = el.textContent;
        const temporaryTextContent = successText;
        // fallback to clipboard
        if ('clipboard' in navigator) {
            try {
                await navigator.clipboard.writeText(point.url);
                el.textContent = temporaryTextContent;
                setTimeout(() => {
                    el.textContent = oldTextContent;
                }, 5000);
                return;
            }
            catch (error) { }
        }
        // fallback to textarea
        const textarea = document.createElement('textarea');
        textarea.value = point.url;
        textarea.style.opacity = '0';
        this.host.appendChild(textarea);
        textarea.focus();
        textarea.select();
        try {
            const success = document.execCommand('copy');
            if (!success) {
                throw new Error('Failed to copy URL to clipboard');
            }
            el.textContent = temporaryTextContent;
            setTimeout(() => {
                el.textContent = oldTextContent;
            }, 5000);
        }
        catch (error) { }
        this.host.removeChild(textarea);
    }
    handleAction(e, point) {
        e.stopPropagation();
        if (point.is_completed) {
            e.preventDefault();
            return;
        }
        switch (point.type) {
            case 'profile':
            case 'rating': {
                if (!salla.config.isUser()) {
                    e.preventDefault();
                    functions.closeModals(() => salla.event.dispatch('login::open'));
                    return;
                }
                return;
            }
            case 'share': {
                if (!salla.config.isUser()) {
                    e.preventDefault();
                    functions.closeModals(() => salla.event.dispatch('login::open'));
                    return;
                }
                e.preventDefault();
                this.handleShareAction(e, point, salla.lang.get('pages.loyalty_program.copied'));
                return;
            }
        }
    }
    getSubHeading(point) {
        switch (point.type) {
            case 'share':
                return (index.h("div", { class: "s-loyalty-program-point-subheading" }, index.h("h2", null, salla.lang.get('pages.loyalty_program.how_to_start')), index.h("p", null, salla.lang.get('pages.loyalty_program.three_simple_steps'))));
            case 'pos':
                return (index.h("div", { class: "s-loyalty-program-point-subheading" }, index.h("h2", null, salla.lang.get('pages.loyalty_program.how_to_start')), index.h("p", null, salla.lang.get('pages.loyalty_program.two_simple_steps'))));
            default:
                return '';
        }
    }
    getTrailingContent(point) {
        switch (point.type) {
            case 'first_order':
            case 'profile':
                return index.h("p", { class: "s-loyalty-program-points-completed-note" }, salla.lang.get('pages.loyalty_program.one_time_points'));
            default:
                return point.is_completed ? index.h("p", { class: "s-loyalty-program-points-completed-note" }, salla.lang.get('pages.loyalty_program.one_time_points')) : '';
        }
    }
    render() {
        return (index.h("div", { key: 'e48e7e3f5e8327b840c3d85685e0b71bffefd855' }, index.h("div", { key: 'bf0defb51f62aeb2830261d5daed101c55f84d7b', onClick: () => functions.closeModals(() => this.modal.open()), class: "s-loyalty-program-point-wrapper" }, index.h("div", { key: '0e6121e7f7daeec3a96bdaaa2427978f4215fb16', class: "s-loyalty-program-circle-base s-loyalty-program-circle-size-sm s-loyalty-program-circle-variant-fill" }, index.h("span", { key: '8422ec6e483f05d514170df5916436a9126d4237', class: this.point.icon })), index.h("div", { key: '928d8ed9a8442dd20b218a7713ad6e493d88bc7d', class: "s-loyalty-program-points-badge-mobile" }, index.h("salla-badge", { key: '35fc26961a50c707d29a726405a2f2c48c5a296f', size: "xs", bg: "transparent" }, index.h("span", { key: 'd2b06eceeec70a9561d3612f337035dbc404bf2d', innerHTML: gift.SIGift }), functions.formattedPointsJsx(this.point))), index.h("div", { key: '9ca25c5c22d499bee7bd03c83b221deecaa385c7', class: "s-loyalty-program-points-badge-desktop" }, index.h("salla-badge", { key: 'bbf54dcce2af313a735de53f3297911b0a28433f', size: "sm", bg: "transparent" }, index.h("span", { key: '6832cb1bf6bf23e1c3e221e0e853b87bdf059b76', innerHTML: gift.SIGift }), functions.formattedPointsJsx(this.point))), index.h("p", { key: '0dab348c2d73b95d2a7054130dd8c4414b588a42', class: "s-loyalty-program-point-description" }, this.point.name), this.point.is_completed ?
            index.h("a", { class: {
                    's-loyalty-program-points-action': true,
                    's-loyalty-program-points-action-completed': this.point.is_completed,
                    's-loyalty-program-points-action-incomplete': !this.point.is_completed,
                } }, salla.lang.get('pages.loyalty_program.completed'))
            : index.h("a", { href: this.point.url, onClick: e => this.handleAction(e, this.point), class: {
                    's-loyalty-program-points-action': true,
                    's-loyalty-program-points-action-completed': this.point.is_completed,
                    's-loyalty-program-points-action-incomplete': !this.point.is_completed,
                } }, this.point.description)), index.h("salla-modal", { key: '209bd22b0a09f173dd74a79b0ab2dcf0c41b98d1', ref: modal => this.modal = modal, class: "s-loyalty-program-point-modal s-loyalty-program-modal", width: window.matchMedia('(min-width: 768px)').matches ? 'md' : 'sm', noPadding: true }, index.h("div", { key: 'adf4dc82940f41c943f095519e43e029602554e0', class: "s-loyalty-program-points-modal-header" }, index.h("h1", { key: '88d0babfddde45978760c71825ad01e81b9d7b70', class: "s-loyalty-program-points-modal-info" }, this.point.name)), index.h("div", { key: '387201fe515701d3e39595569cd5dd858dbe41e2', class: "s-loyalty-program-modal-scrollable-content" }, index.h("div", { key: '8460fd33cedcd3c78d299fd1f4f9dfb2d817663e', class: "s-loyalty-program-points-modal-main" }, index.h("div", { key: 'dc5840eb12f44f395fac4b2fa41616897ce3b804', class: "s-loyalty-program-circle-base s-loyalty-program-circle-size-xl s-loyalty-program-circle-variant-fill" }, index.h("span", { key: 'dab41d922110962182ff4a1ec53a7f01fde7400c', class: this.point.icon })), index.h("salla-badge", { key: 'e7947363e9dacb42eb03b97532ed1b6b3a606d73', size: "sm", bg: "light" }, index.h("span", { key: 'f567bdf3fb75d7bc28d9eb78a6b11dcc74f7e608', innerHTML: gift.SIGift }), index.h("span", { key: 'd8fc1f40a225001a90ad6213f924520f3a3fbebc', class: "s-loyalty-program-points-badge-points" }, functions.formattedPointsJsx(this.point)))), this.getSubHeading(this.point), index.h("div", { key: '12e2bf5a9aab51c3bf1c0ec10395751beaf846a3', class: "s-loyalty-program-points-modal-details" }, index.h("div", { key: '17dc3ff458f8cfea3028a47e54df522310cc0b1d', class: "s-loyalty-program-points-chains-wrapper" }, index.h("ul", { key: '4b1b0700e1d260a57fe7093421cb8faa8e68d024', class: "s-loyalty-program-points-chain-list" }, !!this.point.steps && Object.keys(this.point.steps).length > 0
            ? Object.values(this.point.steps).map((step, idx) => {
                const stepsArray = Object.values(this.point.steps);
                const isLastItem = idx === stepsArray.length - 1;
                return (index.h("li", { class: "s-loyalty-program-points-chain-item" }, index.h("div", { class: "s-loyalty-program-points-chain-icon" }, index.h("div", { class: "s-loyalty-program-circle-base s-loyalty-program-circle-size-xs s-loyalty-program-circle-variant-outline-primary" }, sicons[step.key]), !isLastItem && index.h("div", { class: "s-loyalty-program-points-chain-line" })), index.h("div", { class: "s-loyalty-program-points-chain-content" }, index.h("salla-badge", { size: "xs", color: "primary-900", bg: "primary-100" }, index.h("span", null, salla.lang.get(`pages.loyalty_program.step_${idx + 1}`))), index.h("p", { class: "s-loyalty-program-points-chain-description" }, step.title || step.name))));
            })
            : this.point.conditions?.map((condition, idx) => {
                const isLastItem = idx === this.point.conditions.length - 1;
                return (index.h("li", { class: "s-loyalty-program-points-chain-item" }, index.h("div", { class: "s-loyalty-program-points-chain-icon" }, index.h("div", { class: "s-loyalty-program-circle-base s-loyalty-program-circle-size-xs s-loyalty-program-circle-variant-outline-primary" }, sicons[condition.key]), !isLastItem && index.h("div", { class: "s-loyalty-program-points-chain-line" })), index.h("div", { class: "s-loyalty-program-points-chain-content" }, index.h("salla-badge", { size: "xs", color: "primary-900", bg: "primary-100" }, index.h("span", { innerHTML: gift.SIGift }), functions.formattedPointsJsx(condition.points ?? 0)), index.h("p", { class: "s-loyalty-program-points-chain-description" }, condition.name))));
            }))), this.getTrailingContent(this.point)), !this.point.branches?.length ? '' : index.h("div", { class: "s-loyalty-program-points-modal-list" }, index.h("div", { class: "s-loyalty-program-point-details-branches" }, index.h("h2", null, salla.lang.get('pages.loyalty_program.branches')), index.h("p", null, salla.lang.get('pages.loyalty_program.shop_from_branches'))), index.h("div", { class: "s-loyalty-program-points-modal-list-wrapper" }, index.h("ul", null, this.point.branches.map((branch) => (index.h("li", { class: "s-loyalty-program-points-modal-list-item" }, index.h("p", null, branch.name), index.h("salla-badge", { size: "sm", bg: "transparent" }, index.h("span", { innerHTML: gift.SIGift }), index.h("a", { href: branch.location ? `https://www.google.com/maps?q=${branch.location.lat},${branch.location.lon}` : '#', target: "_blank", rel: "noopener noreferrer" }, branch.address_description))))))))), index.h("div", { key: '8984c9e7f20a766c70c25a85b752a2f61fd9c490', class: "s-loyalty-program-points-modal-action" }, index.h("a", { key: '6ee995bf10cd3f9efac2baac8413e7405981389f', href: this.point.url, onClick: (e) => (e.stopPropagation(), this.handleAction(e, this.point)), class: {
                's-loyalty-program-points-action': true,
                's-loyalty-program-points-action-completed': this.point.is_completed,
                's-loyalty-program-points-action-incomplete': !this.point.is_completed,
            } }, this.point.is_completed ? salla.lang.get('pages.loyalty_program.completed') : this.point.description)))));
    }
    get host() { return index.getElement(this); }
};
SallaLoyaltyPoint.style = sallaLoyaltyProgramCss;

exports.salla_loyalty_hero = SallaLoyaltyHero;
exports.salla_loyalty_point = SallaLoyaltyPoint;
