1/*
2@license
3
4dhtmlxGantt v.6.3.5 Standard
5
6This version of dhtmlxGantt is distributed under GPL 2.0 license and can be legally used in GPL projects.
7
8To use dhtmlxGantt in non-GPL projects (and get Pro version of the product), please obtain Commercial/Enterprise or Ultimate license on our site https://dhtmlx.com/docs/products/dhtmlxGantt/#licensing or contact us at sales@dhtmlx.com
9
10(c) XB Software Ltd.
11
12*/
13(function webpackUniversalModuleDefinition(root, factory) {
14	if(typeof exports === 'object' && typeof module === 'object')
15		module.exports = factory();
16	else if(typeof define === 'function' && define.amd)
17		define("ext/dhtmlxgantt_csp", [], factory);
18	else if(typeof exports === 'object')
19		exports["ext/dhtmlxgantt_csp"] = factory();
20	else
21		root["ext/dhtmlxgantt_csp"] = factory();
22})(window, function() {
23return /******/ (function(modules) { // webpackBootstrap
24/******/ 	// The module cache
25/******/ 	var installedModules = {};
26/******/
27/******/ 	// The require function
28/******/ 	function __webpack_require__(moduleId) {
29/******/
30/******/ 		// Check if module is in cache
31/******/ 		if(installedModules[moduleId]) {
32/******/ 			return installedModules[moduleId].exports;
33/******/ 		}
34/******/ 		// Create a new module (and put it into the cache)
35/******/ 		var module = installedModules[moduleId] = {
36/******/ 			i: moduleId,
37/******/ 			l: false,
38/******/ 			exports: {}
39/******/ 		};
40/******/
41/******/ 		// Execute the module function
42/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
43/******/
44/******/ 		// Flag the module as loaded
45/******/ 		module.l = true;
46/******/
47/******/ 		// Return the exports of the module
48/******/ 		return module.exports;
49/******/ 	}
50/******/
51/******/
52/******/ 	// expose the modules object (__webpack_modules__)
53/******/ 	__webpack_require__.m = modules;
54/******/
55/******/ 	// expose the module cache
56/******/ 	__webpack_require__.c = installedModules;
57/******/
58/******/ 	// define getter function for harmony exports
59/******/ 	__webpack_require__.d = function(exports, name, getter) {
60/******/ 		if(!__webpack_require__.o(exports, name)) {
61/******/ 			Object.defineProperty(exports, name, { enumerable: true, get: getter });
62/******/ 		}
63/******/ 	};
64/******/
65/******/ 	// define __esModule on exports
66/******/ 	__webpack_require__.r = function(exports) {
67/******/ 		if(typeof Symbol !== 'undefined' && Symbol.toStringTag) {
68/******/ 			Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
69/******/ 		}
70/******/ 		Object.defineProperty(exports, '__esModule', { value: true });
71/******/ 	};
72/******/
73/******/ 	// create a fake namespace object
74/******/ 	// mode & 1: value is a module id, require it
75/******/ 	// mode & 2: merge all properties of value into the ns
76/******/ 	// mode & 4: return value when already ns object
77/******/ 	// mode & 8|1: behave like require
78/******/ 	__webpack_require__.t = function(value, mode) {
79/******/ 		if(mode & 1) value = __webpack_require__(value);
80/******/ 		if(mode & 8) return value;
81/******/ 		if((mode & 4) && typeof value === 'object' && value && value.__esModule) return value;
82/******/ 		var ns = Object.create(null);
83/******/ 		__webpack_require__.r(ns);
84/******/ 		Object.defineProperty(ns, 'default', { enumerable: true, value: value });
85/******/ 		if(mode & 2 && typeof value != 'string') for(var key in value) __webpack_require__.d(ns, key, function(key) { return value[key]; }.bind(null, key));
86/******/ 		return ns;
87/******/ 	};
88/******/
89/******/ 	// getDefaultExport function for compatibility with non-harmony modules
90/******/ 	__webpack_require__.n = function(module) {
91/******/ 		var getter = module && module.__esModule ?
92/******/ 			function getDefault() { return module['default']; } :
93/******/ 			function getModuleExports() { return module; };
94/******/ 		__webpack_require__.d(getter, 'a', getter);
95/******/ 		return getter;
96/******/ 	};
97/******/
98/******/ 	// Object.prototype.hasOwnProperty.call
99/******/ 	__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
100/******/
101/******/ 	// __webpack_public_path__
102/******/ 	__webpack_require__.p = "/codebase/sources/";
103/******/
104/******/
105/******/ 	// Load entry module and return exports
106/******/ 	return __webpack_require__(__webpack_require__.s = "./sources/ext/csp.js");
107/******/ })
108/************************************************************************/
109/******/ ({
110
111/***/ "./sources/ext/csp.js":
112/*!****************************!*\
113  !*** ./sources/ext/csp.js ***!
114  \****************************/
115/*! no static exports found */
116/***/ (function(module, exports) {
117
118/*
119 Compatibility with Content Security Policy
120 https://github.com/denys86/gantt/commit/f64f62f14086a8ec33d5667cfc5dc3a7e775fd2a
121
122 Removes evil JS. Inline styles are still used for rendering, may need to allow them or redefine unsafe methods
123 style-src 'unsafe-inline'
124
125*/
126
127gantt.date.date_to_str = function(format,utc){
128	return function(date) {
129		return format.replace(/%[a-zA-Z]/g, function (a) {
130			switch (a) {
131				case "%d": return utc ? gantt.date.to_fixed(date.getUTCDate()) : gantt.date.to_fixed(date.getDate());
132				case "%m": return utc ? gantt.date.to_fixed((date.getUTCMonth() + 1)) : gantt.date.to_fixed((date.getMonth() + 1));
133				case "%j": return utc ? date.getUTCDate() : date.getDate();
134				case "%n": return utc ? (date.getUTCMonth() + 1) : (date.getMonth() + 1);
135				case "%y": return utc ? gantt.date.to_fixed(date.getUTCFullYear() % 100) : gantt.date.to_fixed(date.getFullYear() % 100);
136				case "%Y": return utc ? date.getUTCFullYear() : date.getFullYear();
137				case "%D": return utc ? gantt.locale.date.day_short[date.getUTCDay()] : gantt.locale.date.day_short[date.getDay()];
138				case "%l": return utc ? gantt.locale.date.day_full[date.getUTCDay()] : gantt.locale.date.day_full[date.getDay()];
139				case "%M": return utc ? gantt.locale.date.month_short[date.getUTCMonth()] : gantt.locale.date.month_short[date.getMonth()];
140				case "%F": return utc ? gantt.locale.date.month_full[date.getUTCMonth()] : gantt.locale.date.month_full[date.getMonth()];
141				case "%h": return utc ? gantt.date.to_fixed((date.getUTCHours() + 11) % 12 + 1) : gantt.date.to_fixed((date.getHours() + 11) % 12 + 1);
142				case "%g": return utc ? ((date.getUTCHours() + 11) % 12 + 1) : ((date.getHours() + 11) % 12 + 1);
143				case "%G": return utc ? date.getUTCHours() : date.getHours();
144				case "%H": return utc ? gantt.date.to_fixed(date.getUTCHours()) : gantt.date.to_fixed(date.getHours());
145				case "%i": return utc ? gantt.date.to_fixed(date.getUTCMinutes()) : gantt.date.to_fixed(date.getMinutes());
146				case "%a": return utc ? (date.getUTCHours() > 11 ? "pm" : "am") : (date.getHours() > 11 ? "pm" : "am");
147				case "%A": return utc ? (date.getUTCHours() > 11 ? "PM" : "AM") : (date.getHours() > 11 ? "PM" : "AM");
148				case "%s": return utc ? gantt.date.to_fixed(date.getUTCSeconds()) : gantt.date.to_fixed(date.getSeconds());
149				case "%W": return utc ? gantt.date.to_fixed(gantt.date.getUTCISOWeek(date)) : gantt.date.to_fixed(gantt.date.getISOWeek(date));
150				default: return a;
151			}
152		});
153	};
154};
155gantt.date.str_to_date = function(format,utc){
156	return function(date) {
157		var set = [0, 0, 1, 0, 0, 0];
158		var temp = date.match(/[a-zA-Z]+|[0-9]+/g);
159		var mask = format.match(/%[a-zA-Z]/g);
160
161		for (var i = 0; i < mask.length; i++) {
162			switch (mask[i]) {
163				case "%j":
164				case "%d":
165					set[2] = temp[i] || 1;
166					break;
167				case "%n":
168				case "%m":
169					set[1] = (temp[i] || 1) - 1;
170					break;
171				case "%y":
172					set[0] = temp[i] * 1 + (temp[i] > 50 ? 1900 : 2000);
173					break;
174				case "%g":
175				case "%G":
176				case "%h":
177				case "%H":
178					set[3] = temp[i] || 0;
179					break;
180				case "%i":
181					set[4] = temp[i] || 0;
182					break;
183				case "%Y":
184					set[0] = temp[i] || 0;
185					break;
186				case "%a":
187				case "%A":
188					set[3] = set[3] % 12 + ((temp[i] || '').toLowerCase() == 'am' ? 0 : 12);
189					break;
190				case "%s":
191					set[5] = temp[i] || 0;
192					break;
193				case "%M":
194					set[1] = gantt.locale.date.month_short_hash[temp[i]] || 0;
195					break;
196				case "%F":
197					set[1] = gantt.locale.date.month_full_hash[temp[i]] || 0;
198					break;
199				default:
200					break;
201			}
202		}
203
204		if (utc) {
205			return new Date(Date.UTC(set[0], set[1], set[2], set[3], set[4], set[5]));
206		}
207
208		return new Date(set[0], set[1], set[2], set[3], set[4], set[5]);
209	};
210};
211
212// custom DOM attributes may be stripped in some environemnts, make sure data attributes used instead
213gantt.config.task_attribute = "data-task-id";
214gantt.config.link_attribute = "data-link-id";
215gantt.config.grid_resizer_column_attribute = "data-column-index";
216gantt.config.grid_resizer_attribute = "data-grid-resizer";
217
218/***/ })
219
220/******/ });
221});