exports.id = 5486;
exports.ids = [5486];
exports.modules = {

/***/ 309622:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var map = {
	"./argv": 194751,
	"./argv.js": 194751,
	"./env": 249365,
	"./env.js": 249365,
	"./file": 527114,
	"./file.js": 527114,
	"./literal": 776505,
	"./literal.js": 776505,
	"./memory": 671967,
	"./memory.js": 671967
};


function webpackContext(req) {
	var id = webpackContextResolve(req);
	return __webpack_require__(id);
}
function webpackContextResolve(req) {
	if(!__webpack_require__.o(map, req)) {
		var e = new Error("Cannot find module '" + req + "'");
		e.code = 'MODULE_NOT_FOUND';
		throw e;
	}
	return map[req];
}
webpackContext.keys = function webpackContextKeys() {
	return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = 309622;

/***/ }),

/***/ 657144:
/***/ ((module) => {

function webpackEmptyContext(req) {
	var e = new Error("Cannot find module '" + req + "'");
	e.code = 'MODULE_NOT_FOUND';
	throw e;
}
webpackEmptyContext.keys = () => ([]);
webpackEmptyContext.resolve = webpackEmptyContext;
webpackEmptyContext.id = 657144;
module.exports = webpackEmptyContext;

/***/ }),

/***/ 633244:
/***/ ((module) => {

function webpackEmptyContext(req) {
	var e = new Error("Cannot find module '" + req + "'");
	e.code = 'MODULE_NOT_FOUND';
	throw e;
}
webpackEmptyContext.keys = () => ([]);
webpackEmptyContext.resolve = webpackEmptyContext;
webpackEmptyContext.id = 633244;
module.exports = webpackEmptyContext;

/***/ }),

/***/ 530747:
/***/ ((module) => {

function webpackEmptyContext(req) {
	var e = new Error("Cannot find module '" + req + "'");
	e.code = 'MODULE_NOT_FOUND';
	throw e;
}
webpackEmptyContext.keys = () => ([]);
webpackEmptyContext.resolve = webpackEmptyContext;
webpackEmptyContext.id = 530747;
module.exports = webpackEmptyContext;

/***/ }),

/***/ 947717:
/***/ ((module, __unused_webpack_exports, __webpack_require__) => {

var map = {
	"./accountsettings": 272366,
	"./accountsettings.js": 272366,
	"./activitystream": 718390,
	"./activitystream.js": 718390,
	"./attachments": 932486,
	"./attachments.js": 932486,
	"./automations": 925613,
	"./automations.js": 925613,
	"./brand": 402776,
	"./brand.js": 402776,
	"./categories": 167886,
	"./categories.js": 167886,
	"./client": 670429,
	"./client.js": 670429,
	"./customagentroles": 262017,
	"./customagentroles.js": 262017,
	"./dynamiccontent": 957212,
	"./dynamiccontent.js": 957212,
	"./forums": 606310,
	"./forums.js": 606310,
	"./forumsubscriptions": 380571,
	"./forumsubscriptions.js": 380571,
	"./groupmemberships": 626893,
	"./groupmemberships.js": 626893,
	"./groups": 677963,
	"./groups.js": 677963,
	"./helpcenter/accesspolicies": 59214,
	"./helpcenter/accesspolicies.js": 59214,
	"./helpcenter/articleattachments": 585412,
	"./helpcenter/articleattachments.js": 585412,
	"./helpcenter/articlecomments": 998337,
	"./helpcenter/articlecomments.js": 998337,
	"./helpcenter/articlelabels": 615679,
	"./helpcenter/articlelabels.js": 615679,
	"./helpcenter/articles": 712275,
	"./helpcenter/articles.js": 712275,
	"./helpcenter/categories": 135575,
	"./helpcenter/categories.js": 135575,
	"./helpcenter/search": 467956,
	"./helpcenter/search.js": 467956,
	"./helpcenter/sections": 581176,
	"./helpcenter/sections.js": 581176,
	"./helpcenter/subscriptions": 216733,
	"./helpcenter/subscriptions.js": 216733,
	"./helpcenter/translations": 499971,
	"./helpcenter/translations.js": 499971,
	"./helpcenter/usersegments": 475116,
	"./helpcenter/usersegments.js": 475116,
	"./helpcenter/votes": 95987,
	"./helpcenter/votes.js": 95987,
	"./helpers": 34124,
	"./helpers.js": 34124,
	"./imports": 157590,
	"./imports.js": 157590,
	"./installations": 742900,
	"./installations.js": 742900,
	"./jobstatuses": 92207,
	"./jobstatuses.js": 92207,
	"./locales": 959519,
	"./locales.js": 959519,
	"./macros": 859431,
	"./macros.js": 859431,
	"./nps/invitations": 483841,
	"./nps/invitations.js": 483841,
	"./nps/surveys": 883753,
	"./nps/surveys.js": 883753,
	"./oauthtokens": 20150,
	"./oauthtokens.js": 20150,
	"./organizationfields": 540515,
	"./organizationfields.js": 540515,
	"./organizationmemberships": 323417,
	"./organizationmemberships.js": 323417,
	"./organizations": 577614,
	"./organizations.js": 577614,
	"./permissiongroups": 720450,
	"./permissiongroups.js": 720450,
	"./policies": 920522,
	"./policies.js": 920522,
	"./requests": 295331,
	"./requests.js": 295331,
	"./satisfactionratings": 240210,
	"./satisfactionratings.js": 240210,
	"./search": 52736,
	"./search.js": 52736,
	"./services/links": 99296,
	"./services/links.js": 99296,
	"./sessions": 14642,
	"./sessions.js": 14642,
	"./sharingagreement": 518324,
	"./sharingagreement.js": 518324,
	"./suspendedtickets": 767428,
	"./suspendedtickets.js": 767428,
	"./tags": 47061,
	"./tags.js": 47061,
	"./targetfailures": 978559,
	"./targetfailures.js": 978559,
	"./targets": 707767,
	"./targets.js": 707767,
	"./throttle": 391831,
	"./throttle.js": 391831,
	"./ticketaudits": 911176,
	"./ticketaudits.js": 911176,
	"./ticketevents": 538567,
	"./ticketevents.js": 538567,
	"./ticketexport": 453182,
	"./ticketexport.js": 453182,
	"./ticketfields": 995782,
	"./ticketfields.js": 995782,
	"./ticketforms": 274327,
	"./ticketforms.js": 274327,
	"./ticketimport": 237847,
	"./ticketimport.js": 237847,
	"./ticketmetrics": 947550,
	"./ticketmetrics.js": 947550,
	"./tickets": 489857,
	"./tickets.js": 489857,
	"./topiccomments": 357038,
	"./topiccomments.js": 357038,
	"./topics": 453039,
	"./topics.js": 453039,
	"./topicsubscriptions": 774625,
	"./topicsubscriptions.js": 774625,
	"./topicvotes": 826626,
	"./topicvotes.js": 826626,
	"./triggers": 682966,
	"./triggers.js": 682966,
	"./userfields": 889375,
	"./userfields.js": 889375,
	"./useridentities": 814328,
	"./useridentities.js": 814328,
	"./users": 173156,
	"./users.js": 173156,
	"./views": 729433,
	"./views.js": 729433,
	"./voice/agentactivity": 78205,
	"./voice/agentactivity.js": 78205,
	"./voice/availabilities": 206513,
	"./voice/availabilities.js": 206513,
	"./voice/currentqueueactivity": 639564,
	"./voice/currentqueueactivity.js": 639564,
	"./voice/greetingcategories": 972386,
	"./voice/greetingcategories.js": 972386,
	"./voice/greetings": 827384,
	"./voice/greetings.js": 827384,
	"./voice/historicalqueueactivity": 779067,
	"./voice/historicalqueueactivity.js": 779067,
	"./voice/phonenumbers": 533483,
	"./voice/phonenumbers.js": 533483,
	"./webhooks": 855788,
	"./webhooks.js": 855788
};


function webpackContext(req) {
	var id = webpackContextResolve(req);
	return __webpack_require__(id);
}
function webpackContextResolve(req) {
	if(!__webpack_require__.o(map, req)) {
		var e = new Error("Cannot find module '" + req + "'");
		e.code = 'MODULE_NOT_FOUND';
		throw e;
	}
	return map[req];
}
webpackContext.keys = function webpackContextKeys() {
	return Object.keys(map);
};
webpackContext.resolve = webpackContextResolve;
module.exports = webpackContext;
webpackContext.id = 947717;

/***/ }),

/***/ 840336:
/***/ ((__unused_webpack_module, exports, __webpack_require__) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.getServerSettings = void 0;
var server_settings_1 = __webpack_require__(526177);
Object.defineProperty(exports, "getServerSettings", ({ enumerable: true, get: function () { return server_settings_1.getServerSettings; } }));
//# sourceMappingURL=index.js.map

/***/ }),

/***/ 662895:
/***/ ((__unused_webpack_module, exports) => {

"use strict";

Object.defineProperty(exports, "__esModule", ({ value: true }));
exports.urlToUserURL = void 0;
function urlToUserURL(url) {
    return (url !== null && url !== void 0 ? url : "").replace("api/v2/tickets", "requests").replace(".json", "");
}
exports.urlToUserURL = urlToUserURL;
//# sourceMappingURL=util.js.map

/***/ }),

/***/ 214641:
/***/ (function(__unused_webpack_module, exports, __webpack_require__) {

"use strict";

var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
    function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
    return new (P || (P = Promise))(function (resolve, reject) {
        function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
        function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
        function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
        step((generator = generator.apply(thisArg, _arguments || [])).next());
    });
};
var __generator = (this && this.__generator) || function (thisArg, body) {
    var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
    return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
    function verb(n) { return function (v) { return step([n, v]); }; }
    function step(op) {
        if (f) throw new TypeError("Generator is already executing.");
        while (_) try {
            if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
            if (y = 0, t) op = [op[0] & 2, t.value];
            switch (op[0]) {
                case 0: case 1: t = op; break;
                case 4: _.label++; return { value: op[1], done: false };
                case 5: _.label++; y = op[1]; op = [0]; continue;
                case 7: op = _.ops.pop(); _.trys.pop(); continue;
                default:
                    if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
                    if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
                    if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
                    if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
                    if (t[2]) _.ops.pop();
                    _.trys.pop(); continue;
            }
            op = body.call(thisArg, _);
        } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
        if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
    }
};
Object.defineProperty(exports, "__esModule", ({ value: true }));
var settings_1 = __webpack_require__(840336);
var node_zendesk_1 = __webpack_require__(944519);
var client = undefined;
var config = "";
function getClient() {
    return __awaiter(this, void 0, void 0, function () {
        var _a, token, username, remoteUri, config0;
        return __generator(this, function (_b) {
            switch (_b.label) {
                case 0: return [4 /*yield*/, (0, settings_1.getServerSettings)()];
                case 1:
                    _a = _b.sent(), token = _a.zendesk_token, username = _a.zendesk_username, remoteUri = _a.zendesk_uri;
                    config0 = "".concat(token + username + remoteUri);
                    if (config == config0 && client != null) {
                        return [2 /*return*/, client];
                    }
                    if (client == null) {
                        // Get the credential from the database.
                        if (!token) {
                            throw Error("Support not available -- admin must configure the Zendesk token");
                        }
                        if (!username) {
                            throw Error("Support not available -- admin must configure the Zendesk username");
                        }
                        if (!remoteUri) {
                            throw Error("Support not available -- admin must configure the Zendesk Uri");
                        }
                        config = config0;
                        client = (0, node_zendesk_1.createClient)({ username: username, token: token, remoteUri: remoteUri });
                    }
                    return [2 /*return*/, client];
            }
        });
    });
}
exports["default"] = getClient;
//# sourceMappingURL=zendesk-client.js.map

/***/ })

};
;