"use strict";
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 __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ImageUploadFlow = void 0;
var UIElement_1 = require("./UIElement");
var UIEventSource_1 = require("./UIEventSource");
var jquery_1 = require("jquery");
var Imgur_1 = require("../Logic/Imgur");
var DropDown_1 = require("./Input/DropDown");
var VariableUIElement_1 = require("./Base/VariableUIElement");
var ImageUploadFlow = /** @class */ (function (_super) {
__extends(ImageUploadFlow, _super);
function ImageUploadFlow(userInfo, preferedLicense, uploadOptions) {
var _this = _super.call(this, undefined) || this;
_this._isUploading = new UIEventSource_1.UIEventSource(0);
_this._userdetails = userInfo;
_this.ListenTo(userInfo);
_this._uploadOptions = uploadOptions;
_this.ListenTo(_this._isUploading);
var licensePicker = new DropDown_1.DropDown("Jouw foto wordt gepubliceerd ", [
{ value: "CC0", shown: "in het publiek domein" },
{ value: "CC-BY-SA 4.0", shown: "onder een CC-BY-SA-licentie" },
{ value: "CC-BY 4.0", shown: "onder een CC-BY-licentie" }
], preferedLicense);
_this._licensePicker = licensePicker;
_this._selectedLicence = licensePicker.selectedElement;
var licenseExplanations = {
"CC-BY-SA 4.0": "Creative Commonse met naamsvermelding en gelijk delen
" +
"Je foto mag door iedereen gratis gebruikt worden, als ze je naam vermelden én ze afgeleide werken met deze licentie en attributie delen.",
"CC-BY 4.0": "Creative Commonse met naamsvermelding
" +
"Je foto mag door iedereen gratis gebruikt worden, als ze je naam vermelden",
"CC0": "Geen copyright
Je foto mag door iedereen voor alles gebruikt worden"
};
_this._licenseExplanation = new VariableUIElement_1.VariableUiElement(_this._selectedLicence.map(function (license) {
return licenseExplanations[license];
}));
return _this;
}
ImageUploadFlow.prototype.InnerRender = function () {
if (!this._userdetails.data.loggedIn) {
return "