...
 
Commits (2)
......@@ -21,12 +21,33 @@ Do not forget to follow our related social media accounts:
## Building
You need OCaml 4.07.1.
First install the dependencies:
# System dependencies
```
$ sudo apt-get install git make curl m4 gcc libgeoip-dev libgmp-dev pkg-config libcurl4-gnutls-dev npm
```
# OPAM install and setup
```
$ sh <(curl -sL https://raw.githubusercontent.com/ocaml/opam/master/shell/install.sh)
$ opam init -y --bare
```
# Sass install
```
$ sudo npm install -g sass
```
# OCaml dependencies
Install ocaml dependencies using opam from metal directory
```
$ make build-deps
$ eval $(opam env)
```
Then initialize the submodule:
......
......@@ -17,16 +17,18 @@ depends: [
"hex"
"ocurl"
"zarith"
"lwt"
"lwt" { = "4.5.0" }
"menhir"
"ezjsonm"
"num"
"omd"
"ocplib-json-typed"
"js_of_ocaml" { = "3.5.1" }
"js_of_ocaml-lwt" { = "3.5.1" }
"js_of_ocaml-tyxml" { = "3.5.1" }
"js_of_ocaml-ppx" { = "3.5.1" }
"js_of_ocaml-compiler" { = "3.4.0" }
"ocplib-json-typed-bson"
"js_of_ocaml" { = "3.5.2" }
"js_of_ocaml-lwt" { = "3.5.2" }
"js_of_ocaml-tyxml" { = "3.5.2" }
"js_of_ocaml-ppx" { = "3.5.2" }
"js_of_ocaml-compiler" { = "3.5.2" }
"ppx_deriving"
"base64" { >= "3.2.0" }
"cohttp-lwt" {>= "0.99.0" }
......
......@@ -12,9 +12,16 @@
outline: 1px solid var(--light);
}
@font-face {
font-family: 'TH Sarabun New Regular';
font-style: normal;
font-weight: normal;
src: local('TH Sarabun New Regular'), url('../THSarabunNew.woff') format('woff');
}
body {
background-color: whitesmoke;
font-family: 'THSarabunNewRegular';
font-family: 'TH Sarabun New Regular';
width:357px;
height:600px;
display: flex;
......@@ -134,7 +141,7 @@ textarea {
/* history */
#history {
font-family: 'THSarabunNewRegular';
font-family: 'TH Sarabun New Regular';
/* font-weight: bold; */
font-style: normal;
font-size: x-large;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
window.FontAwesomeKitConfig = {"asyncLoading":{"enabled":true},"autoA11y":{"enabled":true},"baseUrl":"https://kit-free.fontawesome.com","detectConflictsUntil":null,"license":"free","method":"css","minify":{"enabled":true},"v4FontFaceShim":{"enabled":true},"v4shim":{"enabled":true},"version":"latest"};
!function(){function r(e){var t,n=[],i=document,o=i.documentElement.doScroll,r="DOMContentLoaded",a=(o?/^loaded|^c/:/^loaded|^i|^c/).test(i.readyState);a||i.addEventListener(r,t=function(){for(i.removeEventListener(r,t),a=1;t=n.shift();)t()}),a?setTimeout(e,0):n.push(e)}!function(){if(!(void 0===window.Element||"classList"in document.documentElement)){var e,t,n,i=Array.prototype,o=i.push,r=i.splice,a=i.join;d.prototype={add:function(e){this.contains(e)||(o.call(this,e),this.el.className=this.toString())},contains:function(e){return-1!=this.el.className.indexOf(e)},item:function(e){return this[e]||null},remove:function(e){if(this.contains(e)){for(var t=0;t<this.length&&this[t]!=e;t++);r.call(this,t,1),this.el.className=this.toString()}},toString:function(){return a.call(this," ")},toggle:function(e){return this.contains(e)?this.remove(e):this.add(e),this.contains(e)}},window.DOMTokenList=d,e=Element.prototype,t="classList",n=function(){return new d(this)},Object.defineProperty?Object.defineProperty(e,t,{get:n}):e.__defineGetter__(t,n)}function d(e){for(var t=(this.el=e).className.replace(/^\s+|\s+$/g,"").split(/\s+/),n=0;n<t.length;n++)o.call(this,t[n])}}();function a(e){var t,n,i,o;prefixesArray=e||["fa"],prefixesSelectorString="."+Array.prototype.join.call(e,",."),t=document.querySelectorAll(prefixesSelectorString),Array.prototype.forEach.call(t,function(e){n=e.getAttribute("title"),e.setAttribute("aria-hidden","true"),i=!e.nextElementSibling||!e.nextElementSibling.classList.contains("sr-only"),n&&i&&((o=document.createElement("span")).innerHTML=n,o.classList.add("sr-only"),e.parentNode.insertBefore(o,e.nextSibling))})}var d=function(e,t){var n=document.createElement("link");n.href=e,n.media="all",n.rel="stylesheet",n.id="font-awesome-5-kit-css",t&&t.detectingConflicts&&t.detectionIgnoreAttr&&n.setAttributeNode(document.createAttribute(t.detectionIgnoreAttr)),document.getElementsByTagName("head")[0].appendChild(n)},c=function(e,t){!function(e,t){var n,i=t&&t.before||void 0,o=t&&t.media||void 0,r=window.document,a=r.createElement("link");if(t&&t.detectingConflicts&&t.detectionIgnoreAttr&&a.setAttributeNode(document.createAttribute(t.detectionIgnoreAttr)),i)n=i;else{var d=(r.body||r.getElementsByTagName("head")[0]).childNodes;n=d[d.length-1]}var c=r.styleSheets;a.rel="stylesheet",a.href=e,a.media="only x",function e(t){if(r.body)return t();setTimeout(function(){e(t)})}(function(){n.parentNode.insertBefore(a,i?n:n.nextSibling)});var s=function(e){for(var t=a.href,n=c.length;n--;)if(c[n].href===t)return e();setTimeout(function(){s(e)})};function l(){a.addEventListener&&a.removeEventListener("load",l),a.media=o||"all"}a.addEventListener&&a.addEventListener("load",l),(a.onloadcssdefined=s)(l)}(e,t)},e=function(e,t,n){var i=t&&void 0!==t.autoFetchSvg?t.autoFetchSvg:void 0,o=t&&void 0!==t.async?t.async:void 0,r=t&&void 0!==t.autoA11y?t.autoA11y:void 0,a=document.createElement("script"),d=document.scripts[0];a.src=e,void 0!==r&&a.setAttribute("data-auto-a11y",r?"true":"false"),i&&(a.setAttributeNode(document.createAttribute("data-auto-fetch-svg")),a.setAttribute("data-fetch-svg-from",t.fetchSvgFrom)),o&&a.setAttributeNode(document.createAttribute("defer")),n&&n.detectingConflicts&&n.detectionIgnoreAttr&&a.setAttributeNode(document.createAttribute(n.detectionIgnoreAttr)),d.parentNode.appendChild(a)};function s(e,t){var n=t&&t.addOn||"",i=t&&t.baseFilename||e.license+n,o=t&&t.minify?".min":"",r=t&&t.fileSuffix||e.method,a=t&&t.subdir||e.method;return e.baseUrl+"/releases/"+("latest"===e.version?"latest":"v".concat(e.version))+"/"+a+"/"+i+o+"."+r}var t,n,i,o,l;try{if(window.FontAwesomeKitConfig){var u,f=window.FontAwesomeKitConfig,m={detectingConflicts:f.detectConflictsUntil&&new Date<=new Date(f.detectConflictsUntil),detectionIgnoreAttr:"data-fa-detection-ignore",detectionTimeoutAttr:"data-fa-detection-timeout",detectionTimeout:null};"js"===f.method&&(o=m,l={async:(i=f).asyncLoading.enabled,autoA11y:i.autoA11y.enabled},"pro"===i.license&&(l.autoFetchSvg=!0,l.fetchSvgFrom=i.baseUrl+"/releases/"+("latest"===i.version?"latest":"v".concat(i.version))+"/svgs"),i.v4shim.enabled&&e(s(i,{addOn:"-v4-shims",minify:i.minify.enabled})),e(s(i,{minify:i.minify.enabled}),l,o)),"css"===f.method&&function(e,t){var n,i=a.bind(a,["fa","fab","fas","far","fal"]);e.autoA11y.enabled&&(r(i),n=i,"undefined"!=typeof MutationObserver&&new MutationObserver(n).observe(document,{childList:!0,subtree:!0})),e.v4shim.enabled&&(e.license,e.asyncLoading.enabled?c(s(e,{addOn:"-v4-shims",minify:e.minify.enabled}),t):d(s(e,{addOn:"-v4-shims",minify:e.minify.enabled}),t));e.v4FontFaceShim.enabled&&(e.asyncLoading.enabled?c(s(e,{addOn:"-v4-font-face",minify:e.minify.enabled}),t):d(s(e,{addOn:"-v4-font-face",minify:e.minify.enabled}),t));var o=s(e,{minify:e.minify.enabled});e.asyncLoading.enabled?c(o,t):d(o,t)}(f,m),m.detectingConflicts&&((u=document.currentScript.getAttribute(m.detectionTimeoutAttr))&&(m.detectionTimeout=u),document.currentScript.setAttributeNode(document.createAttribute(m.detectionIgnoreAttr)),t=f,n=m,r(function(){var e=document.createElement("script");n&&n.detectionIgnoreAttr&&e.setAttributeNode(document.createAttribute(n.detectionIgnoreAttr)),n&&n.detectionTimeoutAttr&&n.detectionTimeout&&e.setAttribute(n.detectionTimeoutAttr,n.detectionTimeout),e.src=s(t,{baseFilename:"conflict-detection",fileSuffix:"js",subdir:"js",minify:t.minify.enabled}),e.async=!0,document.body.appendChild(e)}))}}catch(e){}}();
\ No newline at end of file
/*!
* Font Awesome Free 5.12.1 by @fontawesome - https://fontawesome.com
* License - https://fontawesome.com/license/free (Icons: CC BY 4.0, Fonts: SIL OFL 1.1, Code: MIT License)
*/
(function () {
'use strict';
function _typeof(obj) {
if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") {
_typeof = function (obj) {
return typeof obj;
};
} else {
_typeof = function (obj) {
return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj;
};
}
return _typeof(obj);
}
function _classCallCheck(instance, Constructor) {
if (!(instance instanceof Constructor)) {
throw new TypeError("Cannot call a class as a function");
}
}
function _defineProperties(target, props) {
for (var i = 0; i < props.length; i++) {
var descriptor = props[i];
descriptor.enumerable = descriptor.enumerable || false;
descriptor.configurable = true;
if ("value" in descriptor) descriptor.writable = true;
Object.defineProperty(target, descriptor.key, descriptor);
}
}
function _createClass(Constructor, protoProps, staticProps) {
if (protoProps) _defineProperties(Constructor.prototype, protoProps);
if (staticProps) _defineProperties(Constructor, staticProps);
return Constructor;
}
function _defineProperty(obj, key, value) {
if (key in obj) {
Object.defineProperty(obj, key, {
value: value,
enumerable: true,
configurable: true,
writable: true
});
} else {
obj[key] = value;
}
return obj;
}
function _objectSpread(target) {
for (var i = 1; i < arguments.length; i++) {
var source = arguments[i] != null ? arguments[i] : {};
var ownKeys = Object.keys(source);
if (typeof Object.getOwnPropertySymbols === 'function') {
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) {
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
}));
}
ownKeys.forEach(function (key) {
_defineProperty(target, key, source[key]);
});
}
return target;
}
function _slicedToArray(arr, i) {
return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _nonIterableRest();
}
function _toConsumableArray(arr) {
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
}
function _arrayWithoutHoles(arr) {
if (Array.isArray(arr)) {
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
return arr2;
}
}
function _arrayWithHoles(arr) {
if (Array.isArray(arr)) return arr;
}
function _iterableToArray(iter) {
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
}
function _iterableToArrayLimit(arr, i) {
var _arr = [];
var _n = true;
var _d = false;
var _e = undefined;
try {
for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) {
_arr.push(_s.value);
if (i && _arr.length === i) break;
}
} catch (err) {
_d = true;
_e = err;
} finally {
try {
if (!_n && _i["return"] != null) _i["return"]();
} finally {
if (_d) throw _e;
}
}
return _arr;
}
function _nonIterableSpread() {
throw new TypeError("Invalid attempt to spread non-iterable instance");
}
function _nonIterableRest() {
throw new TypeError("Invalid attempt to destructure non-iterable instance");
}
var noop = function noop() {};
var _WINDOW = {};
var _DOCUMENT = {};
var _MUTATION_OBSERVER = null;
var _PERFORMANCE = {
mark: noop,
measure: noop
};
try {
if (typeof window !== 'undefined') _WINDOW = window;
if (typeof document !== 'undefined') _DOCUMENT = document;
if (typeof MutationObserver !== 'undefined') _MUTATION_OBSERVER = MutationObserver;
if (typeof performance !== 'undefined') _PERFORMANCE = performance;
} catch (e) {}
var _ref = _WINDOW.navigator || {},
_ref$userAgent = _ref.userAgent,
userAgent = _ref$userAgent === void 0 ? '' : _ref$userAgent;
var WINDOW = _WINDOW;
var DOCUMENT = _DOCUMENT;
var MUTATION_OBSERVER = _MUTATION_OBSERVER;
var PERFORMANCE = _PERFORMANCE;
var IS_BROWSER = !!WINDOW.document;
var IS_DOM = !!DOCUMENT.documentElement && !!DOCUMENT.head && typeof DOCUMENT.addEventListener === 'function' && typeof DOCUMENT.createElement === 'function';
var IS_IE = ~userAgent.indexOf('MSIE') || ~userAgent.indexOf('Trident/');
var NAMESPACE_IDENTIFIER = '___FONT_AWESOME___';
var UNITS_IN_GRID = 16;
var DEFAULT_FAMILY_PREFIX = 'fa';
var DEFAULT_REPLACEMENT_CLASS = 'svg-inline--fa';
var DATA_FA_I2SVG = 'data-fa-i2svg';
var DATA_FA_PSEUDO_ELEMENT = 'data-fa-pseudo-element';
var DATA_FA_PSEUDO_ELEMENT_PENDING = 'data-fa-pseudo-element-pending';
var DATA_PREFIX = 'data-prefix';
var DATA_ICON = 'data-icon';
var HTML_CLASS_I2SVG_BASE_CLASS = 'fontawesome-i2svg';
var MUTATION_APPROACH_ASYNC = 'async';
var TAGNAMES_TO_SKIP_FOR_PSEUDOELEMENTS = ['HTML', 'HEAD', 'STYLE', 'SCRIPT'];
var PRODUCTION = function () {
try {
return undefined === 'production';
} catch (e) {
return false;
}
}();
var PREFIX_TO_STYLE = {
'fas': 'solid',
'far': 'regular',
'fal': 'light',
'fad': 'duotone',
'fab': 'brands',
'fa': 'solid'
};
var STYLE_TO_PREFIX = {
'solid': 'fas',
'regular': 'far',
'light': 'fal',
'duotone': 'fad',
'brands': 'fab'
};
var LAYERS_TEXT_CLASSNAME = 'fa-layers-text';
var FONT_FAMILY_PATTERN = /Font Awesome 5 (Solid|Regular|Light|Duotone|Brands|Free|Pro)/;
var FONT_WEIGHT_TO_PREFIX = {
'900': 'fas',
'400': 'far',
'normal': 'far',
'300': 'fal'
};
var oneToTen = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
var oneToTwenty = oneToTen.concat([11, 12, 13, 14, 15, 16, 17, 18, 19, 20]);
var ATTRIBUTES_WATCHED_FOR_MUTATION = ['class', 'data-prefix', 'data-icon', 'data-fa-transform', 'data-fa-mask'];
var DUOTONE_CLASSES = {
GROUP: 'group',
SWAP_OPACITY: 'swap-opacity',
PRIMARY: 'primary',
SECONDARY: 'secondary'
};
var RESERVED_CLASSES = ['xs', 'sm', 'lg', 'fw', 'ul', 'li', 'border', 'pull-left', 'pull-right', 'spin', 'pulse', 'rotate-90', 'rotate-180', 'rotate-270', 'flip-horizontal', 'flip-vertical', 'flip-both', 'stack', 'stack-1x', 'stack-2x', 'inverse', 'layers', 'layers-text', 'layers-counter', DUOTONE_CLASSES.GROUP, DUOTONE_CLASSES.SWAP_OPACITY, DUOTONE_CLASSES.PRIMARY, DUOTONE_CLASSES.SECONDARY].concat(oneToTen.map(function (n) {
return "".concat(n, "x");
})).concat(oneToTwenty.map(function (n) {
return "w-".concat(n);
}));
var initial = WINDOW.FontAwesomeConfig || {};
function getAttrConfig(attr) {
var element = DOCUMENT.querySelector('script[' + attr + ']');
if (element) {
return element.getAttribute(attr);
}
}
function coerce(val) {
// Getting an empty string will occur if the attribute is set on the HTML tag but without a value
// We'll assume that this is an indication that it should be toggled to true
// For example <script data-search-pseudo-elements src="..."></script>
if (val === '') return true;
if (val === 'false') return false;
if (val === 'true') return true;
return val;
}
if (DOCUMENT && typeof DOCUMENT.querySelector === 'function') {
var attrs = [['data-family-prefix', 'familyPrefix'], ['data-replacement-class', 'replacementClass'], ['data-auto-replace-svg', 'autoReplaceSvg'], ['data-auto-add-css', 'autoAddCss'], ['data-auto-a11y', 'autoA11y'], ['data-search-pseudo-elements', 'searchPseudoElements'], ['data-observe-mutations', 'observeMutations'], ['data-mutate-approach', 'mutateApproach'], ['data-keep-original-source', 'keepOriginalSource'], ['data-measure-performance', 'measurePerformance'], ['data-show-missing-icons', 'showMissingIcons']];
attrs.forEach(function (_ref) {
var _ref2 = _slicedToArray(_ref, 2),
attr = _ref2[0],
key = _ref2[1];
var val = coerce(getAttrConfig(attr));
if (val !== undefined && val !== null) {
initial[key] = val;
}
});
}
var _default = {
familyPrefix: DEFAULT_FAMILY_PREFIX,
replacementClass: DEFAULT_REPLACEMENT_CLASS,
autoReplaceSvg: true,
autoAddCss: true,
autoA11y: true,
searchPseudoElements: false,
observeMutations: true,
mutateApproach: 'async',
keepOriginalSource: true,
measurePerformance: false,
showMissingIcons: true
};
var _config = _objectSpread({}, _default, initial);
if (!_config.autoReplaceSvg) _config.observeMutations = false;
var config = _objectSpread({}, _config);
WINDOW.FontAwesomeConfig = config;
var w = WINDOW || {};
if (!w[NAMESPACE_IDENTIFIER]) w[NAMESPACE_IDENTIFIER] = {};
if (!w[NAMESPACE_IDENTIFIER].styles) w[NAMESPACE_IDENTIFIER].styles = {};
if (!w[NAMESPACE_IDENTIFIER].hooks) w[NAMESPACE_IDENTIFIER].hooks = {};
if (!w[NAMESPACE_IDENTIFIER].shims) w[NAMESPACE_IDENTIFIER].shims = [];
var namespace = w[NAMESPACE_IDENTIFIER];
var functions = [];
var listener = function listener() {
DOCUMENT.removeEventListener('DOMContentLoaded', listener);
loaded = 1;
functions.map(function (fn) {
return fn();
});
};
var loaded = false;
if (IS_DOM) {
loaded = (DOCUMENT.documentElement.doScroll ? /^loaded|^c/ : /^loaded|^i|^c/).test(DOCUMENT.readyState);
if (!loaded) DOCUMENT.addEventListener('DOMContentLoaded', listener);
}
function domready (fn) {
if (!IS_DOM) return;
loaded ? setTimeout(fn, 0) : functions.push(fn);
}
var PENDING = 'pending';
var SETTLED = 'settled';
var FULFILLED = 'fulfilled';
var REJECTED = 'rejected';
var NOOP = function NOOP() {};
var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';
var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
var asyncQueue = [];
var asyncTimer;
function asyncFlush() {
// run promise callbacks
for (var i = 0; i < asyncQueue.length; i++) {
asyncQueue[i][0](asyncQueue[i][1]);
} // reset async asyncQueue
asyncQueue = [];
asyncTimer = false;
}
function asyncCall(callback, arg) {
asyncQueue.push([callback, arg]);
if (!asyncTimer) {
asyncTimer = true;
asyncSetTimer(asyncFlush, 0);
}
}
function invokeResolver(resolver, promise) {
function resolvePromise(value) {
resolve(promise, value);
}
function rejectPromise(reason) {
reject(promise, reason);
}
try {
resolver(resolvePromise, rejectPromise);
} catch (e) {
rejectPromise(e);
}
}
function invokeCallback(subscriber) {
var owner = subscriber.owner;
var settled = owner._state;
var value = owner._data;
var callback = subscriber[settled];
var promise = subscriber.then;
if (typeof callback === 'function') {
settled = FULFILLED;
try {
value = callback(value);
} catch (e) {
reject(promise, e);
}
}
if (!handleThenable(promise, value)) {
if (settled === FULFILLED) {
resolve(promise, value);
}
if (settled === REJECTED) {
reject(promise, value);
}
}
}
function handleThenable(promise, value) {
var resolved;
try {
if (promise === value) {
throw new TypeError('A promises callback cannot return that same promise.');
}
if (value && (typeof value === 'function' || _typeof(value) === 'object')) {
// then should be retrieved only once
var then = value.then;
if (typeof then === 'function') {
then.call(value, function (val) {
if (!resolved) {
resolved = true;
if (value === val) {
fulfill(promise, val);
} else {
resolve(promise, val);
}
}
}, function (reason) {
if (!resolved) {
resolved = true;
reject(promise, reason);
}
});
return true;
}
}
} catch (e) {
if (!resolved) {
reject(promise, e);
}
return true;
}
return false;
}
function resolve(promise, value) {
if (promise === value || !handleThenable(promise, value)) {
fulfill(promise, value);
}
}
function fulfill(promise, value) {
if (promise._state === PENDING) {
promise._state = SETTLED;
promise._data = value;
asyncCall(publishFulfillment, promise);
}
}
function reject(promise, reason) {
if (promise._state === PENDING) {
promise._state = SETTLED;
promise._data = reason;
asyncCall(publishRejection, promise);
}
}
function publish(promise) {
promise._then = promise._then.forEach(invokeCallback);
}
function publishFulfillment(promise) {
promise._state = FULFILLED;
publish(promise);
}
function publishRejection(promise) {
promise._state = REJECTED;
publish(promise);
if (!promise._handled && isNode) {
global.process.emit('unhandledRejection', promise._data, promise);
}
}
function notifyRejectionHandled(promise) {
global.process.emit('rejectionHandled', promise);
}
/**
* @class
*/
function P(resolver) {
if (typeof resolver !== 'function') {
throw new TypeError('Promise resolver ' + resolver + ' is not a function');
}
if (this instanceof P === false) {
throw new TypeError('Failed to construct \'Promise\': Please use the \'new\' operator, this object constructor cannot be called as a function.');
}
this._then = [];
invokeResolver(resolver, this);
}
P.prototype = {
constructor: P,
_state: PENDING,
_then: null,
_data: undefined,
_handled: false,
then: function then(onFulfillment, onRejection) {
var subscriber = {
owner: this,
then: new this.constructor(NOOP),
fulfilled: onFulfillment,
rejected: onRejection
};
if ((onRejection || onFulfillment) && !this._handled) {
this._handled = true;
if (this._state === REJECTED && isNode) {
asyncCall(notifyRejectionHandled, this);
}
}
if (this._state === FULFILLED || this._state === REJECTED) {
// already resolved, call callback async
asyncCall(invokeCallback, subscriber);
} else {
// subscribe
this._then.push(subscriber);
}
return subscriber.then;
},
catch: function _catch(onRejection) {
return this.then(null, onRejection);
}
};
P.all = function (promises) {
if (!Array.isArray(promises)) {
throw new TypeError('You must pass an array to Promise.all().');
}
return new P(function (resolve, reject) {
var results = [];
var remaining = 0;
function resolver(index) {
remaining++;
return function (value) {
results[index] = value;
if (! --remaining) {
resolve(results);
}
};
}
for (var i = 0, promise; i < promises.length; i++) {
promise = promises[i];
if (promise && typeof promise.then === 'function') {
promise.then(resolver(i), reject);
} else {
results[i] = promise;
}
}
if (!remaining) {
resolve(results);
}
});
};
P.race = function (promises) {
if (!Array.isArray(promises)) {
throw new TypeError('You must pass an array to Promise.race().');
}
return new P(function (resolve, reject) {
for (var i = 0, promise; i < promises.length; i++) {
promise = promises[i];
if (promise && typeof promise.then === 'function') {
promise.then(resolve, reject);
} else {
resolve(promise);
}
}
});
};
P.resolve = function (value) {
if (value && _typeof(value) === 'object' && value.constructor === P) {
return value;
}
return new P(function (resolve) {
resolve(value);
});
};
P.reject = function (reason) {
return new P(function (resolve, reject) {
reject(reason);
});
};
var picked = typeof Promise === 'function' ? Promise : P;
var d = UNITS_IN_GRID;
var meaninglessTransform = {
size: 16,
x: 0,
y: 0,
rotate: 0,
flipX: false,
flipY: false
};
function isReserved(name) {
return ~RESERVED_CLASSES.indexOf(name);
}
function bunker(fn) {
try {
fn();
} catch (e) {
if (!PRODUCTION) {
throw e;
}
}
}
function insertCss(css) {
if (!css || !IS_DOM) {
return;
}
var style = DOCUMENT.createElement('style');
style.setAttribute('type', 'text/css');
style.innerHTML = css;
var headChildren = DOCUMENT.head.childNodes;
var beforeChild = null;
for (var i = headChildren.length - 1; i > -1; i--) {
var child = headChildren[i];
var tagName = (child.tagName || '').toUpperCase();
if (['STYLE', 'LINK'].indexOf(tagName) > -1) {
beforeChild = child;
}
}
DOCUMENT.head.insertBefore(style, beforeChild);
return css;
}
var idPool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ';
function nextUniqueId() {
var size = 12;
var id = '';
while (size-- > 0) {
id += idPool[Math.random() * 62 | 0];
}
return id;
}
function toArray(obj) {
var array = [];
for (var i = (obj || []).length >>> 0; i--;) {
array[i] = obj[i];
}
return array;
}
function classArray(node) {
if (node.classList) {
return toArray(node.classList);
} else {
return (node.getAttribute('class') || '').split(' ').filter(function (i) {
return i;
});
}
}
function getIconName(familyPrefix, cls) {
var parts = cls.split('-');
var prefix = parts[0];
var iconName = parts.slice(1).join('-');
if (prefix === familyPrefix && iconName !== '' && !isReserved(iconName)) {
return iconName;
} else {
return null;
}
}
function htmlEscape(str) {
return "".concat(str).replace(/&/g, '&amp;').replace(/"/g, '&quot;').replace(/'/g, '&#39;').replace(/</g, '&lt;').replace(/>/g, '&gt;');
}
function joinAttributes(attributes) {
return Object.keys(attributes || {}).reduce(function (acc, attributeName) {
return acc + "".concat(attributeName, "=\"").concat(htmlEscape(attributes[attributeName]), "\" ");
}, '').trim();
}
function joinStyles(styles) {
return Object.keys(styles || {}).reduce(function (acc, styleName) {
return acc + "".concat(styleName, ": ").concat(styles[styleName], ";");
}, '');
}
function transformIsMeaningful(transform) {
return transform.size !== meaninglessTransform.size || transform.x !== meaninglessTransform.x || transform.y !== meaninglessTransform.y || transform.rotate !== meaninglessTransform.rotate || transform.flipX || transform.flipY;
}
function transformForSvg(_ref) {
var transform = _ref.transform,
containerWidth = _ref.containerWidth,
iconWidth = _ref.iconWidth;
var outer = {
transform: "translate(".concat(containerWidth / 2, " 256)")
};
var innerTranslate = "translate(".concat(transform.x * 32, ", ").concat(transform.y * 32, ") ");
var innerScale = "scale(".concat(transform.size / 16 * (transform.flipX ? -1 : 1), ", ").concat(transform.size / 16 * (transform.flipY ? -1 : 1), ") ");
var innerRotate = "rotate(".concat(transform.rotate, " 0 0)");
var inner = {
transform: "".concat(innerTranslate, " ").concat(innerScale, " ").concat(innerRotate)
};
var path = {
transform: "translate(".concat(iconWidth / 2 * -1, " -256)")
};
return {
outer: outer,
inner: inner,
path: path
};
}
function transformForCss(_ref2) {
var transform = _ref2.transform,
_ref2$width = _ref2.width,
width = _ref2$width === void 0 ? UNITS_IN_GRID : _ref2$width,
_ref2$height = _ref2.height,
height = _ref2$height === void 0 ? UNITS_IN_GRID : _ref2$height,
_ref2$startCentered = _ref2.startCentered,
startCentered = _ref2$startCentered === void 0 ? false : _ref2$startCentered;
var val = '';
if (startCentered && IS_IE) {
val += "translate(".concat(transform.x / d - width / 2, "em, ").concat(transform.y / d - height / 2, "em) ");
} else if (startCentered) {
val += "translate(calc(-50% + ".concat(transform.x / d, "em), calc(-50% + ").concat(transform.y / d, "em)) ");
} else {
val += "translate(".concat(transform.x / d, "em, ").concat(transform.y / d, "em) ");
}
val += "scale(".concat(transform.size / d * (transform.flipX ? -1 : 1), ", ").concat(transform.size / d * (transform.flipY ? -1 : 1), ") ");
val += "rotate(".concat(transform.rotate, "deg) ");
return val;
}
var ALL_SPACE = {
x: 0,
y: 0,
width: '100%',
height: '100%'
};
function fillBlack(abstract) {
var force = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
if (abstract.attributes && (abstract.attributes.fill || force)) {
abstract.attributes.fill = 'black';
}
return abstract;
}
function deGroup(abstract) {
if (abstract.tag === 'g') {
return abstract.children;
} else {
return [abstract];
}
}
function makeIconMasking (_ref) {
var children = _ref.children,
attributes = _ref.attributes,
main = _ref.main,
mask = _ref.mask,
transform = _ref.transform;
var mainWidth = main.width,
mainPath = main.icon;
var maskWidth = mask.width,
maskPath = mask.icon;
var trans = transformForSvg({
transform: transform,
containerWidth: maskWidth,
iconWidth: mainWidth
});
var maskRect = {
tag: 'rect',
attributes: _objectSpread({}, ALL_SPACE, {
fill: 'white'
})
};
var maskInnerGroupChildrenMixin = mainPath.children ? {
children: mainPath.children.map(fillBlack)
} : {};
var maskInnerGroup = {
tag: 'g',
attributes: _objectSpread({}, trans.inner),
children: [fillBlack(_objectSpread({
tag: mainPath.tag,
attributes: _objectSpread({}, mainPath.attributes, trans.path)
}, maskInnerGroupChildrenMixin))]
};
var maskOuterGroup = {
tag: 'g',
attributes: _objectSpread({}, trans.outer),
children: [maskInnerGroup]
};
var maskId = "mask-".concat(nextUniqueId());
var clipId = "clip-".concat(nextUniqueId());
var maskTag = {
tag: 'mask',
attributes: _objectSpread({}, ALL_SPACE, {
id: maskId,
maskUnits: 'userSpaceOnUse',
maskContentUnits: 'userSpaceOnUse'
}),
children: [maskRect, maskOuterGroup]
};
var defs = {
tag: 'defs',
children: [{
tag: 'clipPath',
attributes: {
id: clipId
},
children: deGroup(maskPath)
}, maskTag]
};
children.push(defs, {
tag: 'rect',
attributes: _objectSpread({
fill: 'currentColor',
'clip-path': "url(#".concat(clipId, ")"),
mask: "url(#".concat(maskId, ")")
}, ALL_SPACE)
});
return {
children: children,
attributes: attributes
};
}
function makeIconStandard (_ref) {
var children = _ref.children,
attributes = _ref.attributes,
main = _ref.main,
transform = _ref.transform,
styles = _ref.styles;
var styleString = joinStyles(styles);
if (styleString.length > 0) {
attributes['style'] = styleString;
}
if (transformIsMeaningful(transform)) {
var trans = transformForSvg({
transform: transform,
containerWidth: main.width,
iconWidth: main.width
});
children.push({
tag: 'g',
attributes: _objectSpread({}, trans.outer),
children: [{
tag: 'g',
attributes: _objectSpread({}, trans.inner),
children: [{
tag: main.icon.tag,
children: main.icon.children,
attributes: _objectSpread({}, main.icon.attributes, trans.path)
}]
}]
});
} else {
children.push(main.icon);
}
return {
children: children,
attributes: attributes
};
}
function asIcon (_ref) {
var children = _ref.children,
main = _ref.main,
mask = _ref.mask,
attributes = _ref.attributes,
styles = _ref.styles,
transform = _ref.transform;
if (transformIsMeaningful(transform) && main.found && !mask.found) {
var width = main.width,
height = main.height;
var offset = {
x: width / height / 2,
y: 0.5
};
attributes['style'] = joinStyles(_objectSpread({}, styles, {
'transform-origin': "".concat(offset.x + transform.x / 16, "em ").concat(offset.y + transform.y / 16, "em")
}));
}
return [{
tag: 'svg',
attributes: attributes,
children: children
}];
}
function asSymbol (_ref) {
var prefix = _ref.prefix,
iconName = _ref.iconName,
children = _ref.children,
attributes = _ref.attributes,
symbol = _ref.symbol;
var id = symbol === true ? "".concat(prefix, "-").concat(config.familyPrefix, "-").concat(iconName) : symbol;
return [{
tag: 'svg',
attributes: {
style: 'display: none;'
},
children: [{
tag: 'symbol',
attributes: _objectSpread({}, attributes, {
id: id
}),
children: children
}]
}];
}
function makeInlineSvgAbstract(params) {
var _params$icons = params.icons,
main = _params$icons.main,
mask = _params$icons.mask,
prefix = params.prefix,
iconName = params.iconName,
transform = params.transform,
symbol = params.symbol,
title = params.title,
extra = params.extra,
_params$watchable = params.watchable,
watchable = _params$watchable === void 0 ? false : _params$watchable;
var _ref = mask.found ? mask : main,
width = _ref.width,
height = _ref.height;
var widthClass = "fa-w-".concat(Math.ceil(width / height * 16));
var attrClass = [config.replacementClass, iconName ? "".concat(config.familyPrefix, "-").concat(iconName) : '', widthClass].filter(function (c) {
return extra.classes.indexOf(c) === -1;
}).concat(extra.classes).join(' ');
var content = {
children: [],
attributes: _objectSpread({}, extra.attributes, {
'data-prefix': prefix,
'data-icon': iconName,
'class': attrClass,
'role': extra.attributes.role || 'img',
'xmlns': 'http://www.w3.org/2000/svg',
'viewBox': "0 0 ".concat(width, " ").concat(height)
})
};
if (watchable) {
content.attributes[DATA_FA_I2SVG] = '';
}
if (title) content.children.push({
tag: 'title',
attributes: {
id: content.attributes['aria-labelledby'] || "title-".concat(nextUniqueId())
},
children: [title]
});
var args = _objectSpread({}, content, {
prefix: prefix,
iconName: iconName,
main: main,
mask: mask,
transform: transform,
symbol: symbol,
styles: extra.styles
});
var _ref2 = mask.found && main.found ? makeIconMasking(args) : makeIconStandard(args),
children = _ref2.children,
attributes = _ref2.attributes;
args.children = children;
args.attributes = attributes;
if (symbol) {
return asSymbol(args);
} else {
return asIcon(args);
}
}
function makeLayersTextAbstract(params) {
var content = params.content,
width = params.width,
height = params.height,
transform = params.transform,
title = params.title,
extra = params.extra,
_params$watchable2 = params.watchable,
watchable = _params$watchable2 === void 0 ? false : _params$watchable2;
var attributes = _objectSpread({}, extra.attributes, title ? {
'title': title
} : {}, {
'class': extra.classes.join(' ')
});
if (watchable) {
attributes[DATA_FA_I2SVG] = '';
}
var styles = _objectSpread({}, extra.styles);
if (transformIsMeaningful(transform)) {
styles['transform'] = transformForCss({
transform: transform,
startCentered: true,
width: width,
height: height
});
styles['-webkit-transform'] = styles['transform'];
}
var styleString = joinStyles(styles);
if (styleString.length > 0) {
attributes['style'] = styleString;
}
var val = [];
val.push({
tag: 'span',
attributes: attributes,
children: [content]
});
if (title) {
val.push({
tag: 'span',
attributes: {
class: 'sr-only'
},
children: [title]
});
}
return val;
}
function makeLayersCounterAbstract(params) {
var content = params.content,
title = params.title,
extra = params.extra;
var attributes = _objectSpread({}, extra.attributes, title ? {
'title': title
} : {}, {
'class': extra.classes.join(' ')
});
var styleString = joinStyles(extra.styles);
if (styleString.length > 0) {
attributes['style'] = styleString;
}
var val = [];
val.push({
tag: 'span',
attributes: attributes,
children: [content]
});
if (title) {
val.push({
tag: 'span',
attributes: {
class: 'sr-only'
},
children: [title]
});
}
return val;
}
var noop$1 = function noop() {};
var p = config.measurePerformance && PERFORMANCE && PERFORMANCE.mark && PERFORMANCE.measure ? PERFORMANCE : {
mark: noop$1,
measure: noop$1
};
var preamble = "FA \"5.12.1\"";
var begin = function begin(name) {
p.mark("".concat(preamble, " ").concat(name, " begins"));
return function () {
return end(name);
};
};
var end = function end(name) {
p.mark("".concat(preamble, " ").concat(name, " ends"));
p.measure("".concat(preamble, " ").concat(name), "".concat(preamble, " ").concat(name, " begins"), "".concat(preamble, " ").concat(name, " ends"));
};
var perf = {
begin: begin,
end: end
};
/**
* Internal helper to bind a function known to have 4 arguments
* to a given context.
*/
var bindInternal4 = function bindInternal4(func, thisContext) {
return function (a, b, c, d) {
return func.call(thisContext, a, b, c, d);
};
};
/**
* # Reduce
*
* A fast object `.reduce()` implementation.
*
* @param {Object} subject The object to reduce over.
* @param {Function} fn The reducer function.
* @param {mixed} initialValue The initial value for the reducer, defaults to subject[0].
* @param {Object} thisContext The context for the reducer.
* @return {mixed} The final result.
*/
var reduce = function fastReduceObject(subject, fn, initialValue, thisContext) {
var keys = Object.keys(subject),
length = keys.length,
iterator = thisContext !== undefined ? bindInternal4(fn, thisContext) : fn,
i,
key,
result;
if (initialValue === undefined) {
i = 1;
result = subject[keys[0]];
} else {
i = 0;
result = initialValue;
}
for (; i < length; i++) {
key = keys[i];
result = iterator(result, subject[key], key, subject);
}
return result;
};
function toHex(unicode) {
var result = '';
for (var i = 0; i < unicode.length; i++) {
var hex = unicode.charCodeAt(i).toString(16);
result += ('000' + hex).slice(-4);
}
return result;
}
function defineIcons(prefix, icons) {
var params = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
var _params$skipHooks = params.skipHooks,
skipHooks = _params$skipHooks === void 0 ? false : _params$skipHooks;
var normalized = Object.keys(icons).reduce(function (acc, iconName) {
var icon = icons[iconName];
var expanded = !!icon.icon;
if (expanded) {
acc[icon.iconName] = icon.icon;
} else {
acc[iconName] = icon;
}
return acc;
}, {});
if (typeof namespace.hooks.addPack === 'function' && !skipHooks) {
namespace.hooks.addPack(prefix, normalized);
} else {
namespace.styles[prefix] = _objectSpread({}, namespace.styles[prefix] || {}, normalized);
}
/**
* Font Awesome 4 used the prefix of `fa` for all icons. With the introduction
* of new styles we needed to differentiate between them. Prefix `fa` is now an alias
* for `fas` so we'll easy the upgrade process for our users by automatically defining
* this as well.
*/
if (prefix === 'fas') {
defineIcons('fa', icons);
}
}
var styles = namespace.styles,
shims = namespace.shims;
var _byUnicode = {};
var _byLigature = {};
var _byOldName = {};
var build = function build() {
var lookup = function lookup(reducer) {
return reduce(styles, function (o, style, prefix) {
o[prefix] = reduce(style, reducer, {});
return o;
}, {});
};
_byUnicode = lookup(function (acc, icon, iconName) {
if (icon[3]) {
acc[icon[3]] = iconName;
}
return acc;
});
_byLigature = lookup(function (acc, icon, iconName) {
var ligatures = icon[2];
acc[iconName] = iconName;
ligatures.forEach(function (ligature) {
acc[ligature] = iconName;
});
return acc;
});
var hasRegular = 'far' in styles;
_byOldName = reduce(shims, function (acc, shim) {
var oldName = shim[0];
var prefix = shim[1];
var iconName = shim[2];
if (prefix === 'far' && !hasRegular) {
prefix = 'fas';
}
acc[oldName] = {
prefix: prefix,
iconName: iconName
};
return acc;
}, {});
};
build();
function byUnicode(prefix, unicode) {
return (_byUnicode[prefix] || {})[unicode];
}
function byLigature(prefix, ligature) {
return (_byLigature[prefix] || {})[ligature];
}
function byOldName(name) {
return _byOldName[name] || {
prefix: null,
iconName: null
};
}
var styles$1 = namespace.styles;
var emptyCanonicalIcon = function emptyCanonicalIcon() {
return {
prefix: null,
iconName: null,
rest: []
};
};
function getCanonicalIcon(values) {
return values.reduce(function (acc, cls) {
var iconName = getIconName(config.familyPrefix, cls);
if (styles$1[cls]) {
acc.prefix = cls;
} else if (config.autoFetchSvg && ['fas', 'far', 'fal', 'fad', 'fab', 'fa'].indexOf(cls) > -1) {
acc.prefix = cls;
} else if (iconName) {
var shim = acc.prefix === 'fa' ? byOldName(iconName) : {};
acc.iconName = shim.iconName || iconName;
acc.prefix = shim.prefix || acc.prefix;
} else if (cls !== config.replacementClass && cls.indexOf('fa-w-') !== 0) {
acc.rest.push(cls);
}
return acc;
}, emptyCanonicalIcon());
}
function iconFromMapping(mapping, prefix, iconName) {
if (mapping && mapping[prefix] && mapping[prefix][iconName]) {
return {
prefix: prefix,
iconName: iconName,
icon: mapping[prefix][iconName]
};
}
}
function toHtml(abstractNodes) {
var tag = abstractNodes.tag,
_abstractNodes$attrib = abstractNodes.attributes,
attributes = _abstractNodes$attrib === void 0 ? {} : _abstractNodes$attrib,
_abstractNodes$childr = abstractNodes.children,
children = _abstractNodes$childr === void 0 ? [] : _abstractNodes$childr;
if (typeof abstractNodes === 'string') {
return htmlEscape(abstractNodes);
} else {
return "<".concat(tag, " ").concat(joinAttributes(attributes), ">").concat(children.map(toHtml).join(''), "</").concat(tag, ">");
}
}
var noop$2 = function noop() {};
function isWatched(node) {
var i2svg = node.getAttribute ? node.getAttribute(DATA_FA_I2SVG) : null;
return typeof i2svg === 'string';
}
function getMutator() {
if (config.autoReplaceSvg === true) {
return mutators.replace;
}
var mutator = mutators[config.autoReplaceSvg];
return mutator || mutators.replace;
}