var __extends = (this && this.__extends) || (function () {
    var extendStatics = function (d, b) {
        extendStatics = Object.setPrototypeOf ||
            ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
            function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
        return extendStatics(d, b);
    };
    return function (d, b) {
        extendStatics(d, b);
        function __() { this.constructor = d; }
        d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
    };
})();
import { Language } from '@signatu/common-lib';
import { Consent } from '@signatu/consent';
import { DataProcessingAction, DataProcessingContent, PolicyDataProcessing } from '@signatu/policy';
import React from 'react';
import { DataProcessingConsent } from '..';
import { DemoCard } from './common';
import Highlight from 'react-highlight';
var dataTexts = {
    'en': 'e-mail',
    'no': 'e-post'
};
var purposeTexts = {
    'en': 'send you marketing emails.',
    'no': 'å sende deg direkte markedsføring.'
};
var DataProcessingDemo = /** @class */ (function (_super) {
    __extends(DataProcessingDemo, _super);
    function DataProcessingDemo() {
        var _this = _super !== null && _super.apply(this, arguments) || this;
        _this.name = "Data Processing";
        _this.doc = React.createElement(Highlight, { className: 'hljs' }, "\nimport {DataProcessingConsent} from '@signatu/consent-react';\nimport {PolicyDataProcessing} from '@signatu/policy';\n\nconst config = {\n    apiKey: \"YOUR_API_KEY\", \n    accessToken: \"YOUR_ACCESS_TOKEN\"\n}\n\nconst processing: PolicyDataProcessing = getFromSomeWhere()\n\nrender() {\n    return <DataProcessingConsent\n        config={config} \n        title=\"Direct Marketing\"\n        subtitle={\"You can always withdraw consent in the <a href=\"...\"> privacy dashboard\"}\n        subject={Consent.anonUserId()}\n        issuer=\"signatu.com\"\n        target=\"signatu.com/demo\"\n        scope=\"directmarketing\"\n        language=\"en\"\n        dataprocessing={processing}/>\n}\n");
        _this.state = {};
        return _this;
    }
    DataProcessingDemo.prototype.render = function () {
        var subtitle = React.createElement("div", null,
            React.createElement("span", null,
                "Please read our ",
                React.createElement("a", { href: "https://signatu.com/\n            \n            " }, "Privacy Policy"),
                ". You can always withdraw consent in the "),
            React.createElement("a", { href: "https://signatu.com" }, "privacy dashboard."));
        var processing = new PolicyDataProcessing(DataProcessingAction.COLLECT, dataTexts[this.props.language], purposeTexts[this.props.language]);
        processing.addContent(new DataProcessingContent('We collect your name in EU and EFTA to allow you sign up for and use signatu and enable you to include your contact details in the privacy policy that you generate with signatu.', new Language('en')));
        var demo = React.createElement(DataProcessingConsent, { config: this.props.config, language: this.props.language, title: "Direct Marketing", subtitle: subtitle, subject: Consent.anonUserId(), issuer: "signatu.com", target: "signatu.com/demo", scope: "directmarketing", dataprocessing: processing });
        return React.createElement(DemoCard, { element: demo, doc: this.doc });
    };
    return DataProcessingDemo;
}(React.Component));
export { DataProcessingDemo };
//# sourceMappingURL=dataProcessing.js.map