import { createMentornityApiInstance } from 'src/modules/mentornity-js-client';
import { mentornityApiEndpoint } from '../../constants/env';
import { getSessionDetails } from '../../util/session';
import { Component, h, Host, Prop } from '@stencil/core';
import { SozlukApi } from '@dvn/sozluk/api';
export class MentornityApplicationLegalFooter {
  async componentWillLoad() {
    const { context, headers } = getSessionDetails();
    this.api = createMentornityApiInstance(mentornityApiEndpoint, headers);
    this.wl = await this.api.getWhiteLabel(context.organisationId);
  }
  render() {
    var _a, _b;
    const termsUrl = ((_a = this.wl) === null || _a === void 0 ? void 0 : _a.termsUrl) || '/terms';
    const privacyUrl = ((_b = this.wl) === null || _b === void 0 ? void 0 : _b.privacyUrl) || '/privacy-policy';
    const { i18n } = this.field;
    return (h(Host, null,
      h("dvn-markdown", { content: SozlukApi.build(i18n.agreeTermsAndPrivacy, {
          privacyUrl,
          termsUrl
        }) })));
  }
  static get is() { return "mentornity-application-legal-footer"; }
  static get properties() { return {
    "field": {
      "type": "unknown",
      "mutable": false,
      "complexType": {
        "original": "CustomField",
        "resolved": "CustomField",
        "references": {
          "CustomField": {
            "location": "global"
          }
        }
      },
      "required": false,
      "optional": false,
      "docs": {
        "tags": [],
        "text": ""
      }
    }
  }; }
}
