flamelink
Version:
Javascript SDK for integrating with Flamelink CMS
1 lines • 144 kB
JavaScript
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t(require("firebase")):"function"==typeof define&&define.amd?define("flamelink",["firebase"],t):"object"==typeof exports?exports.flamelink=t(require("firebase")):e.flamelink=t(e.firebase)}("undefined"!=typeof self?self:this,function(e){return function(e){function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}var r={};return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(t){return e[t]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="",t(t.s=100)}([function(e,t){var r=Array.isArray;e.exports=r},function(e,t,r){var n=r(56),i="object"==typeof self&&self&&self.Object===Object&&self,o=n||i||Function("return this")();e.exports=o},function(e,t){e.exports=function(e){return null!=e&&"object"==typeof e}},function(e,t,r){var n=r(55),i=r(58),o=r(13);e.exports=function(e){return o(e)?n(e):i(e)}},function(e,t){e.exports=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)}},function(e,t,r){var n=r(7),i=r(109),o=r(110),a="[object Null]",u="[object Undefined]",s=n?n.toStringTag:void 0;e.exports=function(e){return null==e?void 0===e?u:a:s&&s in Object(e)?i(e):o(e)}},function(e,t,r){var n=r(128),i=r(131);e.exports=function(e,t){var r=i(e,t);return n(r)?r:void 0}},function(e,t,r){var n=r(1).Symbol;e.exports=n},function(e,t,r){var n=r(10),i=1/0;e.exports=function(e){if("string"==typeof e||n(e))return e;var t=e+"";return"0"==t&&1/e==-i?"-0":t}},function(e,t,r){var n=r(155),i=r(34),o=r(156),a=r(157),u=r(67),s=r(5),c=r(60),f=c(n),l=c(i),p=c(o),d=c(a),h=c(u),v=s;(n&&"[object DataView]"!=v(new n(new ArrayBuffer(1)))||i&&"[object Map]"!=v(new i)||o&&"[object Promise]"!=v(o.resolve())||a&&"[object Set]"!=v(new a)||u&&"[object WeakMap]"!=v(new u))&&(v=function(e){var t=s(e),r="[object Object]"==t?e.constructor:void 0,n=r?c(r):"";if(n)switch(n){case f:return"[object DataView]";case l:return"[object Map]";case p:return"[object Promise]";case d:return"[object Set]";case h:return"[object WeakMap]"}return t}),e.exports=v},function(e,t,r){var n=r(5),i=r(2),o="[object Symbol]";e.exports=function(e){return"symbol"==typeof e||i(e)&&n(e)==o}},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children||(e.children=[]),Object.defineProperty(e,"loaded",{enumerable:!0,get:function(){return e.l}}),Object.defineProperty(e,"id",{enumerable:!0,get:function(){return e.i}}),e.webpackPolyfill=1),e}},function(e,t){var r=9007199254740991,n=/^(?:0|[1-9]\d*)$/;e.exports=function(e,t){var i=typeof e;return!!(t=null==t?r:t)&&("number"==i||"symbol"!=i&&n.test(e))&&e>-1&&e%1==0&&e<t}},function(e,t,r){var n=r(31),i=r(27);e.exports=function(e){return null!=e&&i(e.length)&&!n(e)}},function(e,t,r){var n=r(116),i=r(159),o=r(40),a=r(0),u=r(164);e.exports=function(e){return"function"==typeof e?e:null==e?o:"object"==typeof e?a(e)?i(e[0],e[1]):n(e):u(e)}},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var i=r(118),o=r(119),a=r(120),u=r(121),s=r(122);n.prototype.clear=i,n.prototype.delete=o,n.prototype.get=a,n.prototype.has=u,n.prototype.set=s,e.exports=n},function(e,t,r){var n=r(33);e.exports=function(e,t){for(var r=e.length;r--;)if(n(e[r][0],t))return r;return-1}},function(e,t,r){var n=r(6)(Object,"create");e.exports=n},function(e,t,r){var n=r(140);e.exports=function(e,t){var r=e.__data__;return n(t)?r["string"==typeof t?"string":"hash"]:r.map}},function(e,t,r){var n=r(0),i=r(39),o=r(71),a=r(73);e.exports=function(e,t){return n(e)?e:i(e,t)?[e]:o(a(e))}},function(e,t,r){var n=r(21),i=r(4);e.exports=function(e){return function(){var t=arguments;switch(t.length){case 0:return new e;case 1:return new e(t[0]);case 2:return new e(t[0],t[1]);case 3:return new e(t[0],t[1],t[2]);case 4:return new e(t[0],t[1],t[2],t[3]);case 5:return new e(t[0],t[1],t[2],t[3],t[4]);case 6:return new e(t[0],t[1],t[2],t[3],t[4],t[5]);case 7:return new e(t[0],t[1],t[2],t[3],t[4],t[5],t[6])}var r=n(e.prototype),o=e.apply(r,t);return i(o)?o:r}}},function(e,t,r){var n=r(4),i=Object.create,o=function(){function e(){}return function(t){if(!n(t))return{};if(i)return i(t);e.prototype=t;var r=new e;return e.prototype=void 0,r}}();e.exports=o},function(e,t){e.exports=function(e,t){var r=-1,n=e.length;for(t||(t=Array(n));++r<n;)t[r]=e[r];return t}},function(e,t,r){var n=r(42),i=r(77);e.exports=function(e,t,r,o){var a=!r;r||(r={});for(var u=-1,s=t.length;++u<s;){var c=t[u],f=o?o(r[c],e[c],c,r,e):void 0;void 0===f&&(f=e[c]),a?i(r,c,f):n(r,c,f)}return r}},function(e,t){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length,i=Array(n);++r<n;)i[r]=t(e[r],r,e);return i}},function(e,t,r){var n=r(107),i=r(2),o=Object.prototype,a=o.hasOwnProperty,u=o.propertyIsEnumerable,s=n(function(){return arguments}())?n:function(e){return i(e)&&a.call(e,"callee")&&!u.call(e,"callee")};e.exports=s},function(e,t,r){(function(e){var n=r(1),i=r(111),o=t&&!t.nodeType&&t,a=o&&"object"==typeof e&&e&&!e.nodeType&&e,u=a&&a.exports===o?n.Buffer:void 0,s=(u?u.isBuffer:void 0)||i;e.exports=s}).call(this,r(11)(e))},function(e,t){var r=9007199254740991;e.exports=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=r}},function(e,t){e.exports=function(e){return function(t){return e(t)}}},function(e,t,r){(function(e){var n=r(56),i=t&&!t.nodeType&&t,o=i&&"object"==typeof e&&e&&!e.nodeType&&e,a=o&&o.exports===i&&n.process,u=function(){try{var e=o&&o.require&&o.require("util").types;return e||a&&a.binding&&a.binding("util")}catch(e){}}();e.exports=u}).call(this,r(11)(e))},function(e,t){var r=Object.prototype;e.exports=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||r)}},function(e,t,r){var n=r(5),i=r(4),o="[object AsyncFunction]",a="[object Function]",u="[object GeneratorFunction]",s="[object Proxy]";e.exports=function(e){if(!i(e))return!1;var t=n(e);return t==a||t==u||t==o||t==s}},function(e,t,r){function n(e){var t=this.__data__=new i(e);this.size=t.size}var i=r(15),o=r(123),a=r(124),u=r(125),s=r(126),c=r(127);n.prototype.clear=o,n.prototype.delete=a,n.prototype.get=u,n.prototype.has=s,n.prototype.set=c,e.exports=n},function(e,t){e.exports=function(e,t){return e===t||e!=e&&t!=t}},function(e,t,r){var n=r(6)(r(1),"Map");e.exports=n},function(e,t,r){function n(e){var t=-1,r=null==e?0:e.length;for(this.clear();++t<r;){var n=e[t];this.set(n[0],n[1])}}var i=r(132),o=r(139),a=r(141),u=r(142),s=r(143);n.prototype.clear=i,n.prototype.delete=o,n.prototype.get=a,n.prototype.has=u,n.prototype.set=s,e.exports=n},function(e,t){e.exports=function(e,t){for(var r=-1,n=t.length,i=e.length;++r<n;)e[i+r]=t[r];return e}},function(e,t,r){var n=r(154),i=r(66),o=Object.prototype.propertyIsEnumerable,a=Object.getOwnPropertySymbols,u=a?function(e){return null==e?[]:(e=Object(e),n(a(e),function(t){return o.call(e,t)}))}:i;e.exports=u},function(e,t,r){var n=r(19),i=r(8);e.exports=function(e,t){for(var r=0,o=(t=n(t,e)).length;null!=e&&r<o;)e=e[i(t[r++])];return r&&r==o?e:void 0}},function(e,t,r){var n=r(0),i=r(10),o=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,a=/^\w*$/;e.exports=function(e,t){if(n(e))return!1;var r=typeof e;return!("number"!=r&&"symbol"!=r&&"boolean"!=r&&null!=e&&!i(e))||a.test(e)||!o.test(e)||null!=t&&e in Object(t)}},function(e,t){e.exports=function(e){return e}},function(e,t,r){var n=r(168);e.exports=function(e){var t=n(e),r=t%1;return t==t?r?t-r:t:0}},function(e,t,r){var n=r(77),i=r(33),o=Object.prototype.hasOwnProperty;e.exports=function(e,t,r){var a=e[t];o.call(e,t)&&i(a,r)&&(void 0!==r||t in e)||n(e,t,r)}},function(e,t,r){var n=r(81),i=r(178),o=r(179),a=r(83),u=r(197),s=r(87),c=r(198),f=r(89),l=r(91),p=r(41),d="Expected a function",h=1,v=2,g=8,m=16,y=32,b=64,x=Math.max;e.exports=function(e,t,r,w,_,R,j,O){var S=t&v;if(!S&&"function"!=typeof e)throw new TypeError(d);var k=w?w.length:0;if(k||(t&=~(y|b),w=_=void 0),j=void 0===j?j:x(p(j),0),O=void 0===O?O:p(O),k-=_?_.length:0,t&b){var F=w,A=_;w=_=void 0}var P=S?void 0:s(e),I=[e,t,r,w,_,F,A,R,j,O];if(P&&c(I,P),e=I[0],t=I[1],r=I[2],w=I[3],_=I[4],!(O=I[9]=void 0===I[9]?S?0:e.length:x(I[9]-k,0))&&t&(g|m)&&(t&=~(g|m)),t&&t!=h)E=t==g||t==m?o(e,t,O):t!=y&&t!=(h|y)||_.length?a.apply(void 0,I):u(e,t,r,w);else var E=i(e,t,r);return l((P?n:f)(E,I),e,t)}},function(e,t){e.exports=function(e,t,r){switch(r.length){case 0:return e.call(t);case 1:return e.call(t,r[0]);case 2:return e.call(t,r[0],r[1]);case 3:return e.call(t,r[0],r[1],r[2])}return e.apply(t,r)}},function(e,t,r){function n(e){this.__wrapped__=e,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=a,this.__views__=[]}var i=r(21),o=r(46),a=4294967295;n.prototype=i(o.prototype),n.prototype.constructor=n,e.exports=n},function(e,t){e.exports=function(){}},function(e,t){e.exports=function(e,t){for(var r=-1,n=null==e?0:e.length;++r<n&&!1!==t(e[r],r,e););return e}},function(e,t){var r="__lodash_placeholder__";e.exports=function(e,t){for(var n=-1,i=e.length,o=0,a=[];++n<i;){var u=e[n];u!==t&&u!==r||(e[n]=r,a[o++]=n)}return a}},function(e,t,r){var n=r(32),i=r(47),o=r(42),a=r(94),u=r(200),s=r(203),c=r(22),f=r(204),l=r(205),p=r(64),d=r(206),h=r(9),v=r(207),g=r(208),m=r(213),y=r(0),b=r(26),x=r(214),w=r(4),_=r(216),R=r(3),j=r(50),O=1,S=2,k=4,F="[object Arguments]",A="[object Function]",P="[object GeneratorFunction]",I="[object Object]",E={};E[F]=E["[object Array]"]=E["[object ArrayBuffer]"]=E["[object DataView]"]=E["[object Boolean]"]=E["[object Date]"]=E["[object Float32Array]"]=E["[object Float64Array]"]=E["[object Int8Array]"]=E["[object Int16Array]"]=E["[object Int32Array]"]=E["[object Map]"]=E["[object Number]"]=E[I]=E["[object RegExp]"]=E["[object Set]"]=E["[object String]"]=E["[object Symbol]"]=E["[object Uint8Array]"]=E["[object Uint8ClampedArray]"]=E["[object Uint16Array]"]=E["[object Uint32Array]"]=!0,E["[object Error]"]=E[A]=E["[object WeakMap]"]=!1,e.exports=function e(t,r,D,L,T,C){var M,B=r&O,U=r&S,W=r&k;if(D&&(M=T?D(t,L,T,C):D(t)),void 0!==M)return M;if(!w(t))return t;var N=y(t);if(N){if(M=v(t),!B)return c(t,M)}else{var z=h(t),G=z==A||z==P;if(b(t))return s(t,B);if(z==I||z==F||G&&!T){if(M=U||G?{}:m(t),!B)return U?l(t,u(M,t)):f(t,a(M,t))}else{if(!E[z])return T?t:{};M=g(t,z,B)}}C||(C=new n);var V=C.get(t);if(V)return V;C.set(t,M),_(t)?t.forEach(function(n){M.add(e(n,r,D,n,t,C))}):x(t)&&t.forEach(function(n,i){M.set(i,e(n,r,D,i,t,C))});var q=N?void 0:(W?U?d:p:U?j:R)(t);return i(q||t,function(n,i){q&&(n=t[i=n]),o(M,i,e(n,r,D,i,t,C))}),M}},function(e,t,r){var n=r(55),i=r(201),o=r(13);e.exports=function(e){return o(e)?n(e,!0):i(e)}},function(e,t,r){var n=r(59)(Object.getPrototypeOf,Object);e.exports=n},function(e,t,r){var n=r(63);e.exports=function(e){var t=new e.constructor(e.byteLength);return new n(t).set(new n(e)),t}},function(e,t){e.exports=function(){throw new Error("define cannot be used indirect")}},function(e,t,r){"use strict";e.exports=function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];return function(e){return t.reduceRight(function(e,t){return e.then(t)},Promise.resolve(e))}}},function(e,t,r){var n=r(106),i=r(25),o=r(0),a=r(26),u=r(12),s=r(57),c=Object.prototype.hasOwnProperty;e.exports=function(e,t){var r=o(e),f=!r&&i(e),l=!r&&!f&&a(e),p=!r&&!f&&!l&&s(e),d=r||f||l||p,h=d?n(e.length,String):[],v=h.length;for(var g in e)!t&&!c.call(e,g)||d&&("length"==g||l&&("offset"==g||"parent"==g)||p&&("buffer"==g||"byteLength"==g||"byteOffset"==g)||u(g,v))||h.push(g);return h}},function(e,t,r){(function(t){var r="object"==typeof t&&t&&t.Object===Object&&t;e.exports=r}).call(this,r(108))},function(e,t,r){var n=r(112),i=r(28),o=r(29),a=o&&o.isTypedArray,u=a?i(a):n;e.exports=u},function(e,t,r){var n=r(30),i=r(113),o=Object.prototype.hasOwnProperty;e.exports=function(e){if(!n(e))return i(e);var t=[];for(var r in Object(e))o.call(e,r)&&"constructor"!=r&&t.push(r);return t}},function(e,t){e.exports=function(e,t){return function(r){return e(t(r))}}},function(e,t){var r=Function.prototype.toString;e.exports=function(e){if(null!=e){try{return r.call(e)}catch(e){}try{return e+""}catch(e){}}return""}},function(e,t,r){var n=r(144),i=r(2);e.exports=function e(t,r,o,a,u){return t===r||(null==t||null==r||!i(t)&&!i(r)?t!=t&&r!=r:n(t,r,o,a,e,u))}},function(e,t,r){var n=r(145),i=r(148),o=r(149),a=1,u=2;e.exports=function(e,t,r,s,c,f){var l=r&a,p=e.length,d=t.length;if(p!=d&&!(l&&d>p))return!1;var h=f.get(e),v=f.get(t);if(h&&v)return h==t&&v==e;var g=-1,m=!0,y=r&u?new n:void 0;for(f.set(e,t),f.set(t,e);++g<p;){var b=e[g],x=t[g];if(s)var w=l?s(x,b,g,t,e,f):s(b,x,g,e,t,f);if(void 0!==w){if(w)continue;m=!1;break}if(y){if(!i(t,function(e,t){if(!o(y,t)&&(b===e||c(b,e,r,s,f)))return y.push(t)})){m=!1;break}}else if(b!==x&&!c(b,x,r,s,f)){m=!1;break}}return f.delete(e),f.delete(t),m}},function(e,t,r){var n=r(1).Uint8Array;e.exports=n},function(e,t,r){var n=r(65),i=r(37),o=r(3);e.exports=function(e){return n(e,o,i)}},function(e,t,r){var n=r(36),i=r(0);e.exports=function(e,t,r){var o=t(e);return i(e)?o:n(o,r(e))}},function(e,t){e.exports=function(){return[]}},function(e,t,r){var n=r(6)(r(1),"WeakMap");e.exports=n},function(e,t,r){var n=r(4);e.exports=function(e){return e==e&&!n(e)}},function(e,t){e.exports=function(e,t){return function(r){return null!=r&&r[e]===t&&(void 0!==t||e in Object(r))}}},function(e,t,r){var n=r(38);e.exports=function(e,t,r){var i=null==e?void 0:n(e,t);return void 0===i?r:i}},function(e,t,r){var n=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,i=/\\(\\)?/g,o=r(160)(function(e){var t=[];return 46===e.charCodeAt(0)&&t.push(""),e.replace(n,function(e,r,n,o){t.push(n?o.replace(i,"$1"):r||e)}),t});e.exports=o},function(e,t,r){function n(e,t){if("function"!=typeof e||null!=t&&"function"!=typeof t)throw new TypeError(o);var r=function(){var n=arguments,i=t?t.apply(this,n):n[0],o=r.cache;if(o.has(i))return o.get(i);var a=e.apply(this,n);return r.cache=o.set(i,a)||o,a};return r.cache=new(n.Cache||i),r}var i=r(35),o="Expected a function";n.Cache=i,e.exports=n},function(e,t,r){var n=r(161);e.exports=function(e){return null==e?"":n(e)}},function(e,t,r){var n=r(162),i=r(163);e.exports=function(e,t){return null!=e&&i(e,t,n)}},function(e,t){e.exports=function(e,t,r,n){for(var i=e.length,o=r+(n?1:-1);n?o--:++o<i;)if(t(e[o],o,e))return o;return-1}},function(e,t,r){var n=r(42),i=r(19),o=r(12),a=r(4),u=r(8);e.exports=function(e,t,r,s){if(!a(e))return e;for(var c=-1,f=(t=i(t,e)).length,l=f-1,p=e;null!=p&&++c<f;){var d=u(t[c]),h=r;if("__proto__"===d||"constructor"===d||"prototype"===d)return e;if(c!=l){var v=p[d];void 0===(h=s?s(v,d,p):void 0)&&(h=a(v)?v:o(t[c+1])?[]:{})}n(p,d,h),p=p[d]}return e}},function(e,t,r){var n=r(78);e.exports=function(e,t,r){"__proto__"==t&&n?n(e,t,{configurable:!0,enumerable:!0,value:r,writable:!0}):e[t]=r}},function(e,t,r){var n=r(6),i=function(){try{var e=n(Object,"defineProperty");return e({},"",{}),e}catch(e){}}();e.exports=i},function(e,t,r){var n=r(173)("pick",r(227));n.placeholder=r(80),e.exports=n},function(e,t){e.exports={}},function(e,t,r){var n=r(40),i=r(82),o=i?function(e,t){return i.set(e,t),e}:n;e.exports=o},function(e,t,r){var n=r(67),i=n&&new n;e.exports=i},function(e,t,r){var n=r(84),i=r(85),o=r(180),a=r(20),u=r(86),s=r(93),c=r(196),f=r(48),l=r(1),p=1,d=2,h=8,v=16,g=128,m=512;e.exports=function e(t,r,y,b,x,w,_,R,j,O){var S=r&g,k=r&p,F=r&d,A=r&(h|v),P=r&m,I=F?void 0:a(t);return function p(){for(var d=arguments.length,h=Array(d),v=d;v--;)h[v]=arguments[v];if(A)var g=s(p),m=o(h,g);if(b&&(h=n(h,b,x,A)),w&&(h=i(h,w,_,A)),d-=m,A&&d<O){var E=f(h,g);return u(t,r,e,p.placeholder,y,h,E,R,j,O-d)}var D=k?y:this,L=F?D[t]:t;return d=h.length,R?h=c(h,R):P&&d>1&&h.reverse(),S&&j<d&&(h.length=j),this&&this!==l&&this instanceof p&&(L=I||a(L)),L.apply(D,h)}}},function(e,t){var r=Math.max;e.exports=function(e,t,n,i){for(var o=-1,a=e.length,u=n.length,s=-1,c=t.length,f=r(a-u,0),l=Array(c+f),p=!i;++s<c;)l[s]=t[s];for(;++o<u;)(p||o<a)&&(l[n[o]]=e[o]);for(;f--;)l[s++]=e[o++];return l}},function(e,t){var r=Math.max;e.exports=function(e,t,n,i){for(var o=-1,a=e.length,u=-1,s=n.length,c=-1,f=t.length,l=r(a-s,0),p=Array(l+f),d=!i;++o<l;)p[o]=e[o];for(var h=o;++c<f;)p[h+c]=t[c];for(;++u<s;)(d||o<a)&&(p[h+n[u]]=e[o++]);return p}},function(e,t,r){var n=r(181),i=r(89),o=r(91),a=1,u=2,s=4,c=8,f=32,l=64;e.exports=function(e,t,r,p,d,h,v,g,m,y){var b=t&c;t|=b?f:l,(t&=~(b?l:f))&s||(t&=~(a|u));var x=[e,t,d,b?h:void 0,b?v:void 0,b?void 0:h,b?void 0:v,g,m,y],w=r.apply(void 0,x);return n(e)&&i(w,x),w.placeholder=p,o(w,e,t)}},function(e,t,r){var n=r(82),i=r(182),o=n?function(e){return n.get(e)}:i;e.exports=o},function(e,t,r){function n(e,t){this.__wrapped__=e,this.__actions__=[],this.__chain__=!!t,this.__index__=0,this.__values__=void 0}var i=r(21),o=r(46);n.prototype=i(o.prototype),n.prototype.constructor=n,e.exports=n},function(e,t,r){var n=r(81),i=r(90)(n);e.exports=i},function(e,t){var r=800,n=16,i=Date.now;e.exports=function(e){var t=0,o=0;return function(){var a=i(),u=n-(a-o);if(o=a,u>0){if(++t>=r)return arguments[0]}else t=0;return e.apply(void 0,arguments)}}},function(e,t,r){var n=r(187),i=r(188),o=r(92),a=r(191);e.exports=function(e,t,r){var u=t+"";return o(e,i(u,a(n(u),r)))}},function(e,t,r){var n=r(189),i=r(90)(n);e.exports=i},function(e,t){e.exports=function(e){return e.placeholder}},function(e,t,r){var n=r(23),i=r(3);e.exports=function(e,t){return e&&n(t,i(t),e)}},function(e,t,r){var n=r(36),i=r(51),o=r(37),a=r(66),u=Object.getOwnPropertySymbols?function(e){for(var t=[];e;)n(t,o(e)),e=i(e);return t}:a;e.exports=u},function(e,t,r){function n(e,t,r){var a=i(e,o,void 0,void 0,void 0,void 0,void 0,t=r?void 0:t);return a.placeholder=n.placeholder,a}var i=r(43),o=8;n.placeholder={},e.exports=n},function(e,t,r){var n=r(5),i=r(51),o=r(2),a="[object Object]",u=Function.prototype,s=Object.prototype,c=u.toString,f=s.hasOwnProperty,l=c.call(Object);e.exports=function(e){if(!o(e)||n(e)!=a)return!1;var t=i(e);if(null===t)return!0;var r=f.call(t,"constructor")&&t.constructor;return"function"==typeof r&&r instanceof r&&c.call(r)==l}},function(e,t,r){var n=r(222),i=r(225),o=r(92);e.exports=function(e){return o(i(e,void 0,n),e+"")}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(e){return new Error("[FLAMELINK] "+e)}},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{default:e}}function i(e){if(Array.isArray(e)){for(var t=0,r=Array(e.length);t<e.length;t++)r[t]=e[t];return r}return Array.from(e)}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a(e){return function(){var t=e.apply(this,arguments);return new Promise(function(e,r){return function n(i,o){try{var a=t[i](o),u=a.value}catch(e){return void r(e)}if(!a.done)return Promise.resolve(u).then(function(e){n("next",e)},function(e){n("throw",e)});e(u)}("next")})}}function u(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=null,r=null,n=null,u=null,O=null,S=!1,k=Object.assign({},R.DEFAULT_CONFIG,e),F=k.env,A=k.locale;if(k.firebaseApp)t=k.firebaseApp,k.isAdminApp&&(S=!0);else if(!t){var P=k.apiKey,I=k.authDomain,E=k.databaseURL,D=k.storageBucket,L=k.projectId;if(!(P&&I&&E&&L))throw(0,x.default)('The following config properties are mandatory: "apiKey", "authDomain", "databaseURL", "projectId"');t=c.initializeApp({apiKey:P,authDomain:I,databaseURL:E,storageBucket:D,projectId:L},L)}var T=function(e,r){return e||"function"==typeof t[r]?t[r]():null};r=T(r,"database"),n=T(n,"storage"),u=T(u,"auth"),O=T(O,"firestore");var C={ref:function(e){if(!r)throw(0,x.default)('The Database service is not available. Make sure the "databaseURL" property is provided.');return r.ref((0,_.getSchemasRefPath)(e||null,F,A))},getRaw:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="string"==typeof e?e:null,n="string"==typeof e?t:e||{},i=(0,_.applyOrderBy)(C.ref(r),n);return(0,_.applyFilters)(i,n).once(n.event||"value")},get:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,i,a,u,s,c,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=10;break}if(r=(0,_.pluckResultFields)(f.fields),(n=(0,v.default)(j,"schemas["+F+"]."+t))&&!(0,_.hasNonCacheableOptions)(f)){e.next=8;break}return e.next=6,C.getRaw(t,f);case 6:i=e.sent,n=i.val();case 8:return a=o({},t,n),e.abrupt("return",r(a)[t]);case 10:if(f=t||{},(u=(0,v.default)(j,"schemas["+F+"]"))&&!(0,_.hasNonCacheableOptions)(f)){e.next=17;break}return e.next=15,C.getRaw(null,f);case 15:s=e.sent,u=s.val();case 17:return c=(0,_.pluckResultFields)(f.fields),e.abrupt("return",c(u));case 19:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),getFieldsRaw:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="string"==typeof e?e+"/fields":null,n="string"==typeof e?t:e||{},i=(0,_.applyOrderBy)(C.ref(r),n);return(0,_.applyFilters)(i,n).once(n.event||"value")},getFields:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,i,a,u,s,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=9;break}if(r=(0,v.default)(j,"schemas["+F+"]."+t),(n=r?r.fields:null)&&!(0,_.hasNonCacheableOptions)(c)){e.next=8;break}return e.next=6,C.getFieldsRaw(t,c);case 6:i=e.sent,n=i.val();case 8:return e.abrupt("return",(0,_.pluckResultFields)(c.fields,n));case 9:if(a=t||{},(u=(0,v.default)(j,"schemas["+F+"]"))&&!(0,_.hasNonCacheableOptions)(a)){e.next=16;break}return e.next=14,C.getFieldsRaw(a);case 14:s=e.sent,u=s.val();case 16:return e.abrupt("return",(0,d.default)(u).reduce(function(e,t){return Object.assign({},e,o({},t,(0,_.pluckResultFields)(a.fields,u[t].fields)))},{}));case 17:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),subscribeRaw:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];if("string"==typeof e){r||(r=t,t={});var n=(0,_.applyOrderBy)(C.ref(e),t);return(0,_.applyFilters)(n,t).on(t.event||"value",r)}r=t,t=e||{},"object"===(void 0===r?"undefined":s(r))&&(r=e,t={});var i=(0,_.applyOrderBy)(C.ref(null),t);return(0,_.applyFilters)(i,t).on(t.event||"value",r)},subscribe:function(e){var t,r,n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=arguments[2];try{if("string"==typeof e){u&&"function"!=typeof i||(u=i,i={});var c=(0,_.pluckResultFields)(i.fields);return C.subscribeRaw(e,i,(r=a(regeneratorRuntime.mark(function t(r){var i,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,l.default)(c)(o({},e,r.val()));case 2:return i=t.sent,a=i[e],t.abrupt("return",u(null,a));case 5:case"end":return t.stop()}},t,n)})),function(e){return r.apply(this,arguments)}))}u=i,i=e||{},"object"===(void 0===u?"undefined":s(u))&&(u=e,i={});var f=(0,_.pluckResultFields)(i.fields);return C.subscribeRaw(i,(t=a(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.default)(f)(t.val());case 2:r=e.sent,u(null,r);case 4:case"end":return e.stop()}},e,n)})),function(e){return t.apply(this,arguments)}))}catch(e){return u(e)}},unsubscribe:function(){if(2===arguments.length){if(R.ALLOWED_CHILD_EVENTS.includes(arguments.length<=1?void 0:arguments[1]))return C.ref(arguments.length<=0?void 0:arguments[0]).off(arguments.length<=1?void 0:arguments[1]);throw(0,x.default)('"'+(arguments.length<=1?void 0:arguments[1])+'" is not a valid child event')}if(1===arguments.length)return C.ref(arguments.length<=0?void 0:arguments[0]).off();throw(0,x.default)('"unsubscribe" method needs to be called with min 1 argument and max 2 arguments')},set:function(e,t){if("string"!=typeof e||"object"!==(void 0===t?"undefined":s(t))&&null!==t)throw(0,x.default)('"set" called with the incorrect arguments. Check the docs for details.');var r="object"===(void 0===t?"undefined":s(t))?Object.assign({},t,{__meta__:{createdBy:(0,v.default)(u,"currentUser.uid","UNKNOWN"),createdDate:(new Date).toISOString()},id:e}):t;return C.ref(e).set(r)},update:function(e,t){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e||"object"!==(void 0===t?"undefined":s(t))&&null!==t)throw(0,x.default)('"update" called with the incorrect arguments. Check the docs for details.');var r="object"===(void 0===t?"undefined":s(t))?Object.assign({},t,{"__meta__/lastModifiedBy":(0,v.default)(u,"currentUser.uid","UNKNOWN"),"__meta__/lastModifiedDate":(new Date).toISOString(),id:e}):t;return C.ref(e).update(r)},remove:function(e){if("number"==typeof e&&(e=e.toString()),"string"!=typeof e)throw(0,x.default)('"remove" called with the incorrect arguments. Check the docs for details.');return C.ref(e).remove()},transaction:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:function(){};if("number"==typeof e&&(e=e.toString()),"string"!=typeof e||"function"!=typeof t)throw(0,x.default)('"transaction" called with the incorrect arguments. Check the docs for details.');return C.ref(e).transaction(t,r)}},M={ref:function(e){if(!r)throw(0,x.default)('The Database service is not available. Make sure the "databaseURL" property is provided.');return r.ref((0,_.getSettingsRefPath)(e))},getRaw:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="string"==typeof e?e:null,n="string"==typeof e?t:e||{},i=(0,_.applyOrderBy)(M.ref(r),n);return(0,_.applyFilters)(i,n).once(n.event||"value")},get:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,i,a,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return r=(0,_.pluckResultFields)(u.fields),e.next=3,M.getRaw(t,u);case 3:return n=e.sent,i=u.needsWrap?o({},t,n.val()):n.val(),e.next=7,(0,l.default)(r)(i);case 7:return a=e.sent,e.abrupt("return",u.needsWrap?a[t]:a);case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),setLocale:function(){var e=a(regeneratorRuntime.mark(function e(){var t,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:A;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.ref("/flamelink/settings/locales").once("value");case 2:if(t=e.sent,n=t.val()){e.next=6;break}throw(0,x.default)("No supported locales found.");case 6:if(n.includes(i)){e.next=8;break}throw(0,x.default)('"'+i+'" is not a supported locale. Supported Locales: '+n.join(", "));case 8:return A=i,e.abrupt("return",A);case 10:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),getLocale:function(){var e=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",A);case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),setEnvironment:function(){var e=a(regeneratorRuntime.mark(function e(){var t,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:F;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,r.ref("/flamelink/settings/environments").once("value");case 2:if(t=e.sent,n=t.val()){e.next=6;break}throw(0,x.default)("No supported environments found.");case 6:if((!(0,m.default)(n)||n.includes(i))&&((0,m.default)(n)||(0,d.default)(n).includes(i))){e.next=8;break}throw(0,x.default)('"'+i+'" is not a supported environment. Supported Environments: '+n.join(", "));case 8:return F=i,e.abrupt("return",F);case 10:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),getEnvironment:function(){var e=a(regeneratorRuntime.mark(function e(){return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",F);case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),getImageSizes:function(){var e=a(regeneratorRuntime.mark(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M.get("general/imageSizes",t));case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),getDefaultPermissionsGroup:function(){var e=a(regeneratorRuntime.mark(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M.get("general/defaultPermissionsGroup",t));case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),getGlobals:function(){var e=a(regeneratorRuntime.mark(function e(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",M.get("globals",Object.assign({},t,{needsWrap:!0})));case 1:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}()},B={_getFolderId:function(){var e=a(regeneratorRuntime.mark(function e(){var t,n,i,o,a=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Root";return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r){e.next=2;break}throw(0,x.default)('The Database service is not available. Make sure the "databaseURL" property is provided.');case 2:return e.next=4,r.ref((0,_.getFolderRefPath)()).once("value");case 4:if(t=e.sent,n=t.val(),i=(0,h.default)(n,{name:a})){e.next=10;break}return o=(0,h.default)(n,{name:u})||{},e.abrupt("return",o.id);case 10:return e.abrupt("return",i.id);case 11:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),_getFolderIdFromOptions:function(){var e=a(regeneratorRuntime.mark(function e(){var t,r,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t=i.folderId,r=i.folderName,n=i.folderFallback,!t){e.next=3;break}return e.abrupt("return",t);case 3:return e.abrupt("return",B._getFolderId(r,n));case 4:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),_setFile:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t="object"===(void 0===e?"undefined":s(e))?Object.assign({},e,{__meta__:{createdBy:(0,v.default)(u,"currentUser.uid","UNKNOWN"),createdDate:(new Date).toISOString()}}):e;return B.fileRef(e.id).set(t)},_createSizedImage:function(){var e=a(regeneratorRuntime.mark(function e(t,r){var n,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!i||!(i.path||i.width||i.maxWidth)){e.next=5;break}return e.next=3,(0,b.default)(t,i);case 3:return n=e.sent,e.abrupt("return",B.ref(r,{path:i.path,width:i.width||i.maxWidth}).put(n));case 5:throw(0,x.default)("Invalid size object supplied - please refer to https://flamelink.github.io/flamelink/#/storage?id=upload for more details on upload options.\nImage upload for supplied size skipped for file: "+r);case 6:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}(),ref:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!n)throw(0,x.default)('The Storage service is not available. Make sure the "storageBucket" property is provided.');if(/:\/\//.test(e)){if(S)throw(0,x.default)("Retrieving files from URL is not supported for the admin SDK");return n.refFromURL(e)}return S?n.bucket().file((0,_.getStorageRefPath)(e,t)):n.ref((0,_.getStorageRefPath)(e,t))},folderRef:function(e){if(!r)throw(0,x.default)('The Database service is not available. Make sure the "databaseURL" property is provided.');return r.ref((0,_.getFolderRefPath)(e))},fileRef:function(e){if(!r)throw(0,x.default)('The Database service is not available. Make sure the "databaseURL" property is provided.');return r.ref((0,_.getFileRefPath)(e))},mediaRef:function(e){if(!r)throw(0,x.default)('The Database service is not available. Make sure the "databaseURL" property is provided.');return r.ref((0,_.getMediaRefPath)(e))},getRaw:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r="string"==typeof e?e:null,n="string"==typeof e?t:e||{},i=(0,_.applyOrderBy)(B.mediaRef(r),n);return(0,_.applyFilters)(i,n).once(n.event||"value")},get:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,i,a,u,s,c,f=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if("string"!=typeof t){e.next=8;break}return r=(0,_.pluckResultFields)(f.fields),e.next=4,B.getRaw(t,f);case 4:return n=e.sent,i=n.val(),a=o({},t,i),e.abrupt("return",r(a)[t]);case 8:return f=t||{},u=(0,_.pluckResultFields)(f.fields),e.next=12,B.getRaw(null,f);case 12:return s=e.sent,c=s.val(),e.abrupt("return",u(c));case 15:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),subscribeRaw:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=arguments[2];if("string"==typeof e){r||(r=t,t={});var n=(0,_.applyOrderBy)(B.mediaRef(e),t);return(0,_.applyFilters)(n,t).on(t.event||"value",r)}r=t,t=e||{},"object"===(void 0===r?"undefined":s(r))&&(r=e,t={});var i=(0,_.applyOrderBy)(B.mediaRef(null),t);return(0,_.applyFilters)(i,t).on(t.event||"value",r)},subscribe:function(e){var t,r,n=this,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},u=arguments[2];try{if("string"==typeof e){u&&"function"!=typeof i||(u=i,i={});var c=(0,_.pluckResultFields)(i.fields);return B.subscribeRaw(e,i,(r=a(regeneratorRuntime.mark(function t(r){var i,a;return regeneratorRuntime.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(0,l.default)(c)(o({},e,r.val()));case 2:return i=t.sent,a=i[e],t.abrupt("return",u(null,a));case 5:case"end":return t.stop()}},t,n)})),function(e){return r.apply(this,arguments)}))}u=i,i=e||{},"object"===(void 0===u?"undefined":s(u))&&(u=e,i={});var f=(0,_.pluckResultFields)(i.fields);return B.subscribeRaw(i,(t=a(regeneratorRuntime.mark(function e(t){var r;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,(0,l.default)(f)(t.val());case 2:r=e.sent,u(null,r);case 4:case"end":return e.stop()}},e,n)})),function(e){return t.apply(this,arguments)}))}catch(e){return u(e)}},unsubscribe:function(){if(2===arguments.length){if(R.ALLOWED_CHILD_EVENTS.includes(arguments.length<=1?void 0:arguments[1]))return B.mediaRef(arguments.length<=0?void 0:arguments[0]).off(arguments.length<=1?void 0:arguments[1]);throw(0,x.default)('"'+(arguments.length<=1?void 0:arguments[1])+'" is not a valid child event')}if(1===arguments.length)return B.mediaRef(arguments.length<=0?void 0:arguments[0]).off();throw(0,x.default)('"unsubscribe" method needs to be called with min 1 argument and max 2 arguments')},getFoldersRaw:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,_.applyOrderBy)(B.folderRef(),e);return(0,_.applyFilters)(t,e).once(e.event||"value")},getFolders:function(){var e=a(regeneratorRuntime.mark(function e(){var t,r,n,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t=(0,_.pluckResultFields)(i.fields),r=(0,_.formatStructure)(i.structure,{idProperty:"id",parentProperty:"parentId"}),e.next=4,B.getFoldersRaw(i);case 4:return n=e.sent,e.abrupt("return",(0,l.default)(t,r,p.default)(n.val()));case 6:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),getFileRaw:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(!e)throw(0,x.default)('"storage.getFileRaw()" should be called with at least the file ID');var r=(0,_.applyOrderBy)(B.fileRef(e),t);return(0,_.applyFilters)(r,t).once(t.event||"value")},getFile:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,i,a,u=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw(0,x.default)('"storage.getFile()" should be called with at least the file ID');case 2:return r=(0,_.pluckResultFields)(u.fields),e.next=5,B.getFileRaw(t,u);case 5:return n=e.sent,i=o({},t,n.val()),e.next=9,(0,l.default)(r)(i);case 9:return a=e.sent,e.abrupt("return",a[t]);case 11:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),getFilesRaw:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=(0,_.applyOrderBy)(B.fileRef(),e);return(0,_.applyFilters)(t,e).once(e.event||"value")},getFiles:function(){var e=a(regeneratorRuntime.mark(function e(){var t,r,n,i,o,a,u=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return t={folderFallback:null},r=Object.assign(t,u,u.mediaType?{orderByChild:"type",equalTo:u.mediaType}:{}),e.next=4,B._getFolderIdFromOptions(r);case 4:return n=e.sent,i=(0,_.filterByFolderId)(n),o=(0,_.pluckResultFields)(r.fields),e.next=9,B.getFilesRaw(r);case 9:return a=e.sent,e.abrupt("return",(0,l.default)(o,i)(a.val()));case 11:case"end":return e.stop()}},e,this)}));return function(){return e.apply(this,arguments)}}(),getURL:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,i,o,a,u,c,f,l,p,d,h,g,m=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw(0,x.default)('"storage.getURL()" should be called with at least the file ID');case 2:return r=m.size,e.next=5,B.getFile(t,m);case 5:if(n=e.sent){e.next=8;break}return e.abrupt("return",n);case 8:return o=(i=n||{}).file,a=i.sizes,u=[o],c=function(e){var t=a.map(function(e){return Object.assign({},e,{width:parseInt(e.width||e.maxWidth,10)})},[]).sort(function(e,t){return e.width-t.width}).find(function(t){return t.width>=e});t?u.push(t):console.warn("[FLAMELINK]: The provided size ("+r+") has been ignored because it did not match any of the given file's available sizes.\nAvailable sizes: "+a.map(function(e){return e.width}).join(", "))},"object"===(void 0===r?"undefined":s(r))?(f=r.width,l=r.height,p=r.quality,void 0!==f&&void 0!==l&&void 0!==p&&(r.path=f+"_"+l+"_"+Math.round(100*parseFloat(p,10))),r.path&&a&&(0,v.default)(a,"[0].path")?a.find(function(e){return e.path===r.path})?u.push({path:r.path}):console.warn("[FLAMELINK]: The provided path ("+r.path+") has been ignored because it did not match any of the given file's available paths.\nAvailable paths: "+a.map(function(e){return e.path}).join(", ")):f&&a&&a.length&&c(f)):r&&a&&a.length&&(d="device"===r?(0,_.getScreenResolution)():r,c(d)),e.next=14,B.ref.apply(B,u);case 14:if(h=e.sent,!S){e.next=20;break}return e.next=18,h.getSignedUrl({action:"read",expires:"01-01-2500"});case 18:return g=e.sent,e.abrupt("return",(0,v.default)(g,"[0]",""));case 20:return e.abrupt("return",h.getDownloadURL());case 21:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),getMetadata:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw(0,x.default)('"storage.getMetadata()" should be called with at least the file ID');case 2:return e.next=4,B.getFile(t,i);case 4:if(r=e.sent){e.next=7;break}throw(0,x.default)('There is no file for File ID: "'+t+'"');case 7:return n=r.file,e.abrupt("return",B.ref(n).getMetadata());case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),updateMetadata:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(t){e.next=2;break}throw(0,x.default)('"storage.updateMetadata()" should be called with at least the file ID');case 2:return e.next=4,B.getFile(t);case 4:if(r=e.sent){e.next=7;break}throw(0,x.default)('There is no file for File ID: "'+t+'"');case 7:return n=r.file,e.abrupt("return",B.ref(n).updateMetadata(i));case 9:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),deleteFile:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,i,o,u=this,s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!S){e.next=2;break}throw(0,x.default)('"storage.deleteFile()" is not currently supported for server-side use.');case 2:if(t){e.next=4;break}throw(0,x.default)('"storage.deleteFile()" should be called with at least the file ID');case 4:return e.next=6,B.getFile(t,s);case 6:if(r=e.sent){e.next=9;break}return e.abrupt("return",r);case 9:return n=r.file,i=r.sizes,o=B.ref(n),e.next=13,o.delete();case 13:if(!Array.isArray(i)){e.next=16;break}return e.next=16,Promise.all(i.map(function(){var e=a(regeneratorRuntime.mark(function e(t){var r,i;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.width||t.maxWidth,i=t.path,r||i){e.next=4;break}return e.abrupt("return",Promise.resolve());case 4:return e.abrupt("return",B.ref(n,{width:r,path:i}).delete());case 5:case"end":return e.stop()}},e,u)}));return function(t){return e.apply(this,arguments)}}()));case 16:return e.abrupt("return",B.fileRef(t).remove());case 17:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}(),upload:function(){var e=a(regeneratorRuntime.mark(function e(t){var r,n,o,a,u,c,f,l,p,d,h,m,y,b,w=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!S){e.next=2;break}throw(0,x.default)('"storage.upload()" is not currently supported for server-side use.');case 2:return r=w.sizes,n=w.overwriteSizes,e.next=5,M.getImageSizes();case 5:return o=e.sent,r||n?r&&r.length&&!n&&(0,g.default)(w,"sizes",[].concat(i(o),i(r))||[]):(0,g.default)(w,"sizes",o||[]),(!w.sizes||w.sizes&&0===w.sizes.length||Array.isArray(w.sizes)&&0===w.sizes.filter(function(e){return!(e.width!==R.DEFAULT_REQUIRED_IMAGE_SIZE&&e.maxWidth!==R.DEFAULT_REQUIRED_IMAGE_SIZE||e.height||e.quality)}).length)&&(Array.isArray(w.sizes)?w.sizes.push({width:R.DEFAULT_REQUIRED_IMAGE_SIZE}):(0,g.default)(w,"sizes",[{width:R.DEFAULT_REQUIRED_IMAGE_SIZE}])),a=Date.now().toString(),u=(0,v.default)(w,"metadata",{}),c="object"===(void 0===t?"undefined":s(t))&&t.name||"string"==typeof u.name?a+"_"+(u.name||t.name):a,f=B.ref(c,w),l="string"==typeof t?"putString":"put",p=[t],e.next=16,B._getFolderIdFromOptions(w);case 16:return"number"==typeof(d=e.sent)&&(d=d.toString()),(0,g.default)(w,"metadata.customMetadata.flamelinkFileId",a),(0,g.default)(w,"metadata.customMetadata.flamelinkFolderId",d),p.push(w.metadata),"putString"===l&&w.stringEncoding&&p.splice(1,0,w.stringEncoding),h=f[l].apply(f,p),e.next=25,h;case 25:if(m=e.sent,y=/^image\//.test((0,v.default)(m,"metadata.contentType"))?"images":"files",b={id:a,file:(0,v.default)(m,"metadata.name",""),folderId:d,type:y,contentType:(0,v.default)(m,"metadata.contentType","")},"images"!==y||"put"!==l||!Array.isArray(w.sizes)){e.next=32;break}return b.sizes=w.sizes.map(function(e){var t=e.width,r=e.height,n=e.quality;return void 0!==t&&void 0!==r&&void 0!==n?Object.assign({},e,{path:t+"_"+r+"_"+Math.round(100*n)}):e}),e.next=32,Promise.all(b.sizes.map(function(e){return B._createSizedImage(t,c,e)}));case 32:return e.next=34,B._setFile(b);case 34:return e.abrupt("return",h);case 35:case"end":return e.stop()}},e,this)}));return function(t){return e.apply(this,arguments)}}()},U={ref:function(e){if(!r)throw(0,x.default)('The Database service is not available. Make sure the "databaseURL" property is provided.');return r.ref((0,_.getContentRefPath)(e,F,A))},getRaw:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(["string","number"].includes(void 0===t?"undefined":s(t))){var n=(0,_.applyOrderBy)(U.ref([e,t]),r);return(0,_.applyFilters)(n,r).once(r.event||"value")}var i="string"==typeof e?e:null,o="string"==typeof e?t||{}:e||{},a=(0,_.applyOrderBy)(U.ref(i),o);return(0,_.applyFilters)(a,o).once(o.event||"value")},get:function(){var e=a(regeneratorRuntime.mark(function e(t,r){var n,i,a,u,c,f,p,h,v,g,m,y,b,x,w,R,j,O,S=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!["string","number"].includes(void 0===r?"undefined":s(r))){e.next=11;break}return n=(0,_.pluckResultFields)(S.fields),i=(0,_.populateEntry)(C,U,B,t,S.populate),e.next=5,U.getRaw(t,r,S);case 5:return a=e.sent,u=o({},r,a.val()),e.next=9,(0,l.default)(i,n)(u);case 9:return c=e.sent,e.abrupt("return",c[r]);case 11:return e.next=13,C.get(t);case 13:return f=e.sent,p=f&&"single"===f.type,h="string"==typeof t?t:null,v="string"==typeof t?r||{}:t||{},g=(0,_.pluckResultFields)(v.fields),m=(0,_.populateEntry)(C,U,B,t,v.populate),e.next=21,U.getRaw(h,v);case 21:if(y=e.sent,!h){e.next=28;break}return b=p?o({},h,y.val()):y.val(),e.next=26,(0,l.default)(m,g)(b);case 26:return x=e.sent,e.abrupt("return",p?x[h]:x);case 28:return w=y.val(),R=A,j=(0,d.default)(w).reduce(function(e,t){return Object.assign({},e,o({},t,w[t][R]))},{}),e.next=33,(0,l.default)(m,g)(j);case 33:return O=e.sent,e.abrupt("return",O);case 35:case"end":return e.stop()}},e,this)}));return function(t,r){return e.apply(this,arguments)}}(),getByFieldRaw:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Object.assign({},n,{orderByChild:t,equalTo:r});return U.getRaw(e,i)},getByField:function(e,t,r){var n=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},i=Object.assign({},n,{orderByChild:t,equalTo:r});return U.get(e,i)},subscribeRaw:function(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},n=arguments[3];if(["string","number"].includes(void 0===t?"undefined":s(t))){n||(n=r,r={});var i=(0,_.applyOrderBy)(U.ref([e,t]),r);return(0,_.applyFilters)(i,r).on(r.event||"value",n)}if("object"===(void 0===t?"undefined":s(t)))n=r,r=t;else if("function"==typeof t)n=t,r={};else{if("function"!=typeof e)throw(0,x.default)("Check out the docs for the required parameters for this method");n=e,r={},e=null}var o=(0,_.applyOrderBy)(U.ref(e),r);return(0,_.applyFilters)(o,r).on(r.event||"value",n)},subscribe:function(){var e=a(regeneratorRuntime.mark(function e(t,r){var n,i,u,c,f,p,h=this,v=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},g=arguments[3];return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!["string","number"].includes(void 0===r?"undefined":s(r))){e.next=6;break}return g||(g=v,v={}),n=(0,_.pluckResultFields)(v.fields),i=(0,_.populateEntry)(C,U,B,t,v.populate),e.abrupt("return",U.subscribeRaw(t,r,v,function(){var e=a(regeneratorRuntime.mark(function e(t){var a,u;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return a=o({},r,t.val()),e.next=3,(0,l.default)(i,n)(a);case 3:u=e.sent,g(null,u[r]);case 5:case"end":return e.stop()}},e,h)}));return function(t){return e.apply(this,arguments)}}()));case 6:if("object"!==(void 0===r?"undefined":s(r))){e.next=11;break}g=v,v=r,e.next=23;break;case 11:if("function"!=typeof r){e.next=16;break}g=r,v={},e.next=23;break;case 16:if("function"!=typeof t){e.next=22;break}g=t,v={},t=null,e.next=23;break;case 22:throw(0,x.default)("Check out the docs for the required parameters for this method");case 23:return e.next=25,C.get(t);case 25:return u=e.sent,c=u&&"single"===u.type,f=(0,_.pluckResultFields)(v.fields),p=(0,_.populateEntry)(C,U,B,t,v.populate),e.abrupt("return",U.subscribeRaw(t,v,function(){var e=a(regeneratorRuntime.mark(function e(r){var n,i,a,u,s,v;return regeneratorRuntime.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=7;break}return n=c?o({},t,r.val()):r.val(),e.next=4,(0,l.default)(p,f)(n);case 4:return i=e.sent,g(null,c?i[t]:i),e.abrupt("return");case 7:return a=r.val(),u=A,s=(0,d.default)(a).reduce(function(e,t){return Object.assign({},e,o({},t,a[t][u]))},{}),e.next=12,(0,l.default)(p,f)(s);case 12:v=e.sent,g(null,v);case 14:case"end":return e.stop()}},e,h)}));return function(t){return e.apply(this,arguments)}}()));case 32:return e.prev=32,e.t0=e.catch(0),e.abrupt("return",g(e.t0));case 35:case"end":return e.stop()}},e,this,[[0,32]])}));return function(t,r){return e.apply(this,arguments)}}(),unsubscribe:function(){if(3===arguments.length)return U.ref([arguments.length<=0?void 0:arguments[0],arguments.length<=1?void 0:arguments[1]]).off(arguments.len